summaryrefslogtreecommitdiff
path: root/spec/ruby/core/unboundmethod/hash_spec.rb
blob: 12dce0020fe260ccfff09a99fd3a8aa9e320417f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require_relative '../../spec_helper'
require_relative 'fixtures/classes'

describe "UnboundMethod#hash" do
  it "returns the same value for user methods that are eql?" do
    foo, bar = UnboundMethodSpecs::Methods.instance_method(:foo), UnboundMethodSpecs::Methods.instance_method(:bar)
    foo.hash.should == bar.hash
  end

  # See also redmine #6048
  it "returns the same value for builtin methods that are eql?" do
    to_s, inspect = Array.instance_method(:to_s), Array.instance_method(:inspect)
    to_s.hash.should == inspect.hash
  end
end
ref='/ruby.git/diff/.editorconfig?h=v2_0_0_preview2&id2=3c20af1d3348b909a2561f97f5a1887c7a1038e3'>.editorconfig16
-rw-r--r--.gdbinit71
-rw-r--r--.gitignore14
-rw-r--r--.travis.yml71
-rw-r--r--COPYING.ja72
-rw-r--r--ChangeLog22731
-rw-r--r--GPL39
-rw-r--r--KNOWNBUGS.rb11
-rw-r--r--LEGAL1
-rw-r--r--Makefile.in105
-rw-r--r--NEWS573
-rw-r--r--README133
-rw-r--r--README.EXT185
-rw-r--r--README.EXT.ja1580
-rw-r--r--README.ja241
-rw-r--r--ToDo124
-rw-r--r--addr2line.c82
-rw-r--r--array.c1871
-rw-r--r--atomic.h56
-rw-r--r--benchmark/bm_app_mandelbrot.rb2
-rw-r--r--benchmark/bm_app_raise.rb4
-rw-r--r--benchmark/bm_app_strconcat.rb4
-rw-r--r--benchmark/bm_io_select2.rb6
-rw-r--r--benchmark/bm_io_select3.rb6
-rw-r--r--benchmark/bm_loop_whileloop.rb4
-rw-r--r--benchmark/bm_loop_whileloop2.rb4
-rw-r--r--benchmark/bm_so_concatenate.rb4
-rw-r--r--benchmark/bm_so_exception.rb2
-rw-r--r--benchmark/bm_so_lists.rb2
-rw-r--r--benchmark/bm_so_nsieve_bits.rb1
-rw-r--r--benchmark/bm_so_random.rb4
-rw-r--r--benchmark/bm_so_sieve.rb4
-rw-r--r--benchmark/bm_vm1_attr_ivar.rb14
-rw-r--r--benchmark/bm_vm1_attr_ivar_set.rb14
-rw-r--r--benchmark/bm_vm1_block.rb4
-rw-r--r--benchmark/bm_vm1_const.rb2
-rw-r--r--benchmark/bm_vm1_ensure.rb4
-rw-r--r--benchmark/bm_vm1_float_simple.rb7
-rw-r--r--benchmark/bm_vm1_ivar.rb2
-rw-r--r--benchmark/bm_vm1_ivar_set.rb2
-rw-r--r--benchmark/bm_vm1_length.rb4
-rw-r--r--benchmark/bm_vm1_lvar_init.rb18
-rw-r--r--benchmark/bm_vm1_lvar_set.rb5
-rw-r--r--benchmark/bm_vm1_neq.rb2
-rw-r--r--benchmark/bm_vm1_not.rb2
-rw-r--r--benchmark/bm_vm1_rescue.rb4
-rw-r--r--benchmark/bm_vm1_simplereturn.rb4
-rw-r--r--benchmark/bm_vm1_swap.rb4
-rw-r--r--benchmark/bm_vm1_yield.rb10
-rw-r--r--benchmark/bm_vm2_array.rb4
-rw-r--r--benchmark/bm_vm2_bigarray.rb106
-rw-r--r--benchmark/bm_vm2_bighash.rb5
-rw-r--r--benchmark/bm_vm2_case.rb4
-rw-r--r--benchmark/bm_vm2_defined_method.rb4
-rw-r--r--benchmark/bm_vm2_dstr.rb6
-rw-r--r--benchmark/bm_vm2_eval.rb4
-rw-r--r--benchmark/bm_vm2_method.rb4
-rw-r--r--benchmark/bm_vm2_method_missing.rb12
-rw-r--r--benchmark/bm_vm2_method_with_block.rb9
-rw-r--r--benchmark/bm_vm2_mutex.rb4
-rw-r--r--benchmark/bm_vm2_poly_method.rb4
-rw-r--r--benchmark/bm_vm2_poly_method_ov.rb4
-rw-r--r--benchmark/bm_vm2_proc.rb4
-rw-r--r--benchmark/bm_vm2_raise1.rb18
-rw-r--r--benchmark/bm_vm2_raise2.rb18
-rw-r--r--benchmark/bm_vm2_regexp.rb4
-rw-r--r--benchmark/bm_vm2_send.rb4
-rw-r--r--benchmark/bm_vm2_super.rb2
-rw-r--r--benchmark/bm_vm2_unif1.rb2
-rw-r--r--benchmark/bm_vm2_zsuper.rb2
-rw-r--r--benchmark/bm_vm3_backtrace.rb22
-rw-r--r--benchmark/bm_vm3_clearmethodcache.rb4
-rw-r--r--benchmark/bm_vm_thread_create_join.rb4
-rw-r--r--benchmark/bm_vm_thread_mutex1.rb4
-rw-r--r--benchmark/bm_vm_thread_mutex2.rb4
-rw-r--r--benchmark/bm_vm_thread_mutex3.rb4
-rw-r--r--benchmark/bm_vm_thread_pass_flood.rb2
-rw-r--r--benchmark/bmx_temp.rb9
-rw-r--r--benchmark/driver.rb131
-rw-r--r--benchmark/other-lang/fact.rb4
-rw-r--r--benchmark/other-lang/loop.rb4
-rw-r--r--bignum.c310
-rwxr-xr-xbin/rake5
-rwxr-xr-xbin/rdoc13
-rwxr-xr-xbin/ri7
-rwxr-xr-xbin/testrb9
-rwxr-xr-xbootstraptest/runner.rb95
-rw-r--r--bootstraptest/test_block.rb32
-rw-r--r--bootstraptest/test_eval.rb37
-rw-r--r--bootstraptest/test_exception.rb16
-rw-r--r--bootstraptest/test_flow.rb66
-rw-r--r--bootstraptest/test_literal.rb22
-rw-r--r--bootstraptest/test_method.rb78
-rw-r--r--bootstraptest/test_proc.rb25
-rw-r--r--bootstraptest/test_syntax.rb4
-rw-r--r--bootstraptest/test_thread.rb4
-rw-r--r--class.c218
-rw-r--r--common.mk371
-rw-r--r--compile.c1067
-rw-r--r--complex.c622
-rw-r--r--configure.in1073
-rw-r--r--constant.h2
-rw-r--r--cont.c171
-rw-r--r--cygwin/GNUmakefile.in4
-rw-r--r--debug.c6
-rw-r--r--defs/default_gems12
-rw-r--r--dir.c183
-rw-r--r--dln.c79
-rw-r--r--dln_find.c8
-rw-r--r--dmydln.c2
-rw-r--r--dmyext.c5
-rw-r--r--doc/ChangeLog-1.9.312153
-rw-r--r--doc/NEWS-1.9.3304
-rw-r--r--doc/etc.rd.ja76
-rw-r--r--doc/forwardable.rd.ja44
-rw-r--r--doc/globals.rdoc61
-rw-r--r--doc/irb/irb-tools.rd.ja110
-rw-r--r--doc/irb/irb.rd.ja350
-rw-r--r--doc/pty/README.expect.ja28
-rw-r--r--doc/pty/README.ja86
-rw-r--r--doc/rake/CHANGES2
-rw-r--r--doc/re.rdoc103
-rw-r--r--doc/shell.rd.ja150
-rw-r--r--enc/Makefile.in9
-rw-r--r--enc/ascii.c7
-rw-r--r--enc/big5.c12
-rw-r--r--enc/cp949.c4
-rw-r--r--enc/depend87
-rw-r--r--enc/emacs_mule.c3
-rw-r--r--enc/encdb.c2
-rw-r--r--enc/encinit.c.erb26
-rw-r--r--enc/euc_jp.c291
-rw-r--r--enc/euc_kr.c4
-rw-r--r--enc/euc_tw.c4
-rw-r--r--enc/gb18030.c4
-rw-r--r--enc/gbk.c4
-rw-r--r--enc/iso_2022_jp.h7
-rw-r--r--enc/iso_8859_1.c4
-rw-r--r--enc/iso_8859_10.c4
-rw-r--r--enc/iso_8859_11.c4
-rw-r--r--enc/iso_8859_13.c4
-rw-r--r--enc/iso_8859_14.c4
-rw-r--r--enc/iso_8859_15.c4
-rw-r--r--enc/iso_8859_16.c4
-rw-r--r--enc/iso_8859_2.c4
-rw-r--r--enc/iso_8859_3.c4
-rw-r--r--enc/iso_8859_4.c4
-rw-r--r--enc/iso_8859_5.c4
-rw-r--r--enc/iso_8859_6.c4
-rw-r--r--enc/iso_8859_7.c4
-rw-r--r--enc/iso_8859_8.c4
-rw-r--r--enc/iso_8859_9.c4
-rw-r--r--enc/koi8_r.c4
-rw-r--r--enc/koi8_u.c4
-rwxr-xr-xenc/make_encmake.rb86
-rw-r--r--enc/mktable.c1162
-rw-r--r--enc/shift_jis.c283
-rw-r--r--enc/trans/JIS/JISX0213-1%UCS@BMP.src1926
-rw-r--r--enc/trans/JIS/JISX0213-1%UCS@SIP.src60
-rw-r--r--enc/trans/JIS/JISX0213-2%UCS@BMP.src2193
-rw-r--r--enc/trans/JIS/JISX0213-2%UCS@SIP.src311
-rw-r--r--enc/trans/JIS/UCS@BMP%JISX0213-1.src1922
-rw-r--r--enc/trans/JIS/UCS@BMP%JISX0213-2.src2189
-rw-r--r--enc/trans/JIS/UCS@SIP%JISX0213-1.src56
-rw-r--r--enc/trans/JIS/UCS@SIP%JISX0213-2.src307
-rw-r--r--enc/trans/big5.trans3
-rw-r--r--enc/trans/chinese.trans3
-rw-r--r--enc/trans/emoji.trans3
-rw-r--r--enc/trans/emoji_iso2022_kddi.trans3
-rw-r--r--enc/trans/emoji_sjis_docomo.trans3
-rw-r--r--enc/trans/emoji_sjis_kddi.trans3
-rw-r--r--enc/trans/emoji_sjis_softbank.trans3
-rw-r--r--enc/trans/escape.trans3
-rw-r--r--enc/trans/gb18030.trans3
-rw-r--r--enc/trans/gbk.trans3
-rw-r--r--enc/trans/iso-8859-16-tbl.rb98
-rw-r--r--enc/trans/iso2022.trans3
-rw-r--r--enc/trans/japanese.trans3
-rw-r--r--enc/trans/japanese_euc.trans15
-rw-r--r--enc/trans/japanese_sjis.trans3
-rw-r--r--enc/trans/korean.trans3
-rw-r--r--enc/trans/single_byte.trans4
-rw-r--r--enc/trans/utf8_mac.trans3
-rw-r--r--enc/trans/utf_16_32.trans3
-rw-r--r--enc/unicode.c1945
-rw-r--r--enc/unicode/casefold.h2238
-rw-r--r--enc/unicode/name2ctype.h15274
-rw-r--r--enc/unicode/name2ctype.h.blt15274
-rw-r--r--enc/unicode/name2ctype.kwd12679
-rw-r--r--enc/unicode/name2ctype.src12679
-rw-r--r--enc/us_ascii.c4
-rw-r--r--enc/utf_16_32.h5
-rw-r--r--enc/utf_16be.c11
-rw-r--r--enc/utf_16le.c11
-rw-r--r--enc/utf_32be.c12
-rw-r--r--enc/utf_32le.c12
-rw-r--r--enc/utf_8.c12
-rw-r--r--enc/windows_1251.c4
-rw-r--r--enc/windows_31j.c80
-rw-r--r--encoding.c311
-rw-r--r--enum.c1224
-rw-r--r--enumerator.c851
-rw-r--r--error.c599
-rw-r--r--eval.c582
-rw-r--r--eval_error.c38
-rw-r--r--eval_intern.h27
-rw-r--r--eval_jump.c5
-rw-r--r--ext/-test-/add_suffix/bug.c22
-rw-r--r--ext/-test-/add_suffix/depend1
-rw-r--r--ext/-test-/add_suffix/extconf.rb4
-rw-r--r--ext/-test-/bug-5832/bug.c14
-rw-r--r--ext/-test-/bug-5832/extconf.rb1
-rw-r--r--ext/-test-/exception/enc_raise.c15
-rw-r--r--ext/-test-/exception/extconf.rb6
-rw-r--r--ext/-test-/exception/init.c11
-rw-r--r--ext/-test-/iter/break.c16
-rw-r--r--ext/-test-/iter/extconf.rb1
-rw-r--r--ext/-test-/marshal/compat/extconf.rb1
-rw-r--r--ext/-test-/marshal/compat/usrcompat.c32
-rw-r--r--ext/-test-/marshal/usr/extconf.rb1
-rw-r--r--ext/-test-/marshal/usr/usrmarshal.c35
-rw-r--r--ext/-test-/num2int/depend1
-rw-r--r--ext/-test-/num2int/extconf.rb1
-rw-r--r--ext/-test-/num2int/num2int.c120
-rw-r--r--ext/-test-/old_thread_select/depend2
-rw-r--r--ext/-test-/old_thread_select/extconf.rb4
-rw-r--r--ext/-test-/old_thread_select/old_thread_select.c75
-rw-r--r--ext/-test-/path_to_class/extconf.rb6
-rw-r--r--ext/-test-/path_to_class/path_to_class.c15
-rw-r--r--ext/-test-/printf/extconf.rb1
-rw-r--r--ext/-test-/printf/printf.c31
-rw-r--r--ext/-test-/st/numhash/extconf.rb1
-rw-r--r--ext/-test-/st/numhash/numhash.c120
-rw-r--r--ext/-test-/st/update/extconf.rb1
-rw-r--r--ext/-test-/st/update/update.c34
-rw-r--r--ext/-test-/string/coderange.c30
-rw-r--r--ext/-test-/string/enc_str_buf_cat.c14
-rw-r--r--ext/-test-/string/modify.c8
-rw-r--r--ext/-test-/string/qsort.c61
-rw-r--r--ext/-test-/symbol/extconf.rb6
-rw-r--r--ext/-test-/symbol/init.c11
-rw-r--r--ext/-test-/symbol/intern.c14
-rw-r--r--ext/-test-/typeddata/extconf.rb1
-rw-r--r--ext/-test-/typeddata/typeddata.c20
-rw-r--r--ext/-test-/win32/dln/dlntest.c17
-rw-r--r--ext/-test-/win32/dln/extconf.rb36
-rw-r--r--ext/-test-/win32/dln/libdlntest.c4
-rw-r--r--ext/-test-/win32/dln/libdlntest.def2
-rw-r--r--ext/-test-/win32/fd_setsize/depend2
-rw-r--r--ext/-test-/win32/fd_setsize/extconf.rb3
-rw-r--r--ext/-test-/win32/fd_setsize/fd_setsize.c55
-rw-r--r--ext/.document2
-rw-r--r--ext/Setup2
-rw-r--r--ext/Setup.atheos2
-rw-r--r--ext/Setup.emx2
-rw-r--r--ext/Setup.nacl49
-rw-r--r--ext/Setup.nt2
-rw-r--r--ext/bigdecimal/README6
-rw-r--r--ext/bigdecimal/bigdecimal.c478
-rw-r--r--ext/bigdecimal/bigdecimal.gemspec4
-rw-r--r--ext/bigdecimal/bigdecimal.h15
-rw-r--r--ext/bigdecimal/bigdecimal_en.html792
-rw-r--r--ext/bigdecimal/bigdecimal_ja.html799
-rw-r--r--ext/bigdecimal/lib/bigdecimal/jacobian.rb5
-rw-r--r--ext/bigdecimal/lib/bigdecimal/math.rb1
-rw-r--r--ext/bigdecimal/lib/bigdecimal/newton.rb2
-rw-r--r--ext/bigdecimal/lib/bigdecimal/util.rb12
-rw-r--r--ext/coverage/coverage.c12
-rw-r--r--ext/curses/curses.c278
-rw-r--r--ext/curses/depend2
-rw-r--r--ext/curses/extconf.rb112
-rw-r--r--ext/curses/rain.rb2
-rw-r--r--ext/curses/view.rb2
-rw-r--r--ext/date/date_core.c431
-rw-r--r--ext/date/date_parse.c874
-rw-r--r--ext/date/date_strftime.c1692
-rw-r--r--ext/date/date_strptime.c28
-rw-r--r--ext/date/date_tmx.h2
-rw-r--r--ext/date/depend1
-rw-r--r--ext/dbm/dbm.c172
-rw-r--r--ext/dbm/extconf.rb245
-rw-r--r--ext/digest/digest.c57
-rw-r--r--ext/digest/md5/extconf.rb5
-rw-r--r--ext/digest/md5/md5init.c3
-rw-r--r--ext/digest/rmd160/extconf.rb5
-rw-r--r--ext/digest/rmd160/rmd160.c10
-rw-r--r--ext/digest/rmd160/rmd160init.c3
-rw-r--r--ext/digest/sha1/extconf.rb5
-rw-r--r--ext/digest/sha1/sha1init.c3
-rw-r--r--ext/digest/sha2/extconf.rb5
-rw-r--r--ext/digest/sha2/lib/sha2.rb6
-rw-r--r--ext/digest/sha2/sha2.c14
-rw-r--r--ext/digest/sha2/sha2ossl.c2
-rw-r--r--ext/dl/callback/mkcallback.rb28
-rw-r--r--ext/dl/cfunc.c55
-rw-r--r--ext/dl/cptr.c105
-rw-r--r--ext/dl/dl.c410
-rw-r--r--ext/dl/dl.h33
-rw-r--r--ext/dl/extconf.rb16
-rw-r--r--ext/dl/handle.c50
-rw-r--r--ext/dl/lib/dl.rb3
-rw-r--r--ext/dl/lib/dl/callback.rb26
-rw-r--r--ext/dl/lib/dl/cparser.rb47
-rw-r--r--ext/dl/lib/dl/func.rb3
-rw-r--r--ext/dl/lib/dl/import.rb30
-rw-r--r--ext/dl/lib/dl/struct.rb154
-rw-r--r--ext/dl/lib/dl/types.rb37
-rw-r--r--ext/dl/lib/dl/value.rb6
-rw-r--r--ext/dl/win32/lib/Win32API.rb3
-rw-r--r--ext/etc/etc.c30
-rwxr-xr-xext/extmk.rb164
-rw-r--r--ext/fiddle/closure.c88
-rw-r--r--ext/fiddle/conversions.c61
-rw-r--r--ext/fiddle/conversions.h5
-rw-r--r--ext/fiddle/extconf.rb34
-rw-r--r--ext/fiddle/fiddle.c430
-rw-r--r--ext/fiddle/fiddle.h49
-rw-r--r--ext/fiddle/function.c80
-rw-r--r--ext/fiddle/handle.c469
-rw-r--r--ext/fiddle/lib/fiddle.rb25
-rw-r--r--ext/fiddle/lib/fiddle/closure.rb31
-rw-r--r--ext/fiddle/lib/fiddle/cparser.rb176
-rw-r--r--ext/fiddle/lib/fiddle/function.rb9
-rw-r--r--ext/fiddle/lib/fiddle/import.rb302
-rw-r--r--ext/fiddle/lib/fiddle/pack.rb128
-rw-r--r--ext/fiddle/lib/fiddle/struct.rb243
-rw-r--r--ext/fiddle/lib/fiddle/value.rb112
-rw-r--r--ext/fiddle/pointer.c716
-rw-r--r--ext/gdbm/gdbm.c50
-rw-r--r--ext/iconv/charset_alias.rb104
-rw-r--r--ext/iconv/depend2
-rw-r--r--ext/iconv/extconf.rb54
-rw-r--r--ext/iconv/iconv.c1256
-rw-r--r--ext/iconv/mkwrapper.rb53
-rw-r--r--ext/io/console/console.c200
-rw-r--r--ext/io/console/io-console.gemspec1
-rw-r--r--ext/io/wait/wait.c49
-rw-r--r--ext/json/fbuffer/fbuffer.h164
-rw-r--r--ext/json/generator/depend2
-rw-r--r--ext/json/generator/extconf.rb8
-rw-r--r--ext/json/generator/generator.c241
-rw-r--r--ext/json/generator/generator.h46
-rw-r--r--ext/json/lib/json.rb8
-rw-r--r--ext/json/lib/json/add/bigdecimal.rb21
-rw-r--r--ext/json/lib/json/add/complex.rb22
-rw-r--r--ext/json/lib/json/add/core.rb250
-rw-r--r--ext/json/lib/json/add/date.rb34
-rw-r--r--ext/json/lib/json/add/date_time.rb50
-rw-r--r--ext/json/lib/json/add/exception.rb31
-rw-r--r--ext/json/lib/json/add/ostruct.rb31
-rw-r--r--ext/json/lib/json/add/range.rb29
-rw-r--r--ext/json/lib/json/add/rational.rb22
-rw-r--r--ext/json/lib/json/add/regexp.rb30
-rw-r--r--ext/json/lib/json/add/struct.rb30
-rw-r--r--ext/json/lib/json/add/symbol.rb25
-rw-r--r--ext/json/lib/json/add/time.rb35
-rw-r--r--ext/json/lib/json/common.rb128
-rw-r--r--ext/json/lib/json/ext.rb23
-rw-r--r--ext/json/lib/json/generic_object.rb39
-rw-r--r--ext/json/lib/json/version.rb2
-rw-r--r--ext/json/parser/depend2
-rw-r--r--ext/json/parser/extconf.rb7
-rw-r--r--ext/json/parser/parser.c544
-rw-r--r--ext/json/parser/parser.h10
-rw-r--r--ext/json/parser/parser.rl202
-rw-r--r--ext/nkf/depend5
-rw-r--r--ext/nkf/nkf-utf8/nkf.c698
-rw-r--r--ext/nkf/nkf-utf8/nkf.h29
-rw-r--r--ext/nkf/nkf-utf8/utf8tbl.c5875
-rw-r--r--ext/nkf/nkf-utf8/utf8tbl.h14
-rw-r--r--ext/nkf/nkf.c23
-rw-r--r--ext/objspace/objspace.c236
-rw-r--r--ext/openssl/deprecation.rb21
-rw-r--r--ext/openssl/extconf.rb50
-rw-r--r--ext/openssl/lib/openssl.rb5
-rw-r--r--ext/openssl/lib/openssl/bn.rb34
-rw-r--r--ext/openssl/lib/openssl/buffering.rb3
-rw-r--r--ext/openssl/lib/openssl/cipher.rb34
-rw-r--r--ext/openssl/lib/openssl/digest.rb62
-rw-r--r--ext/openssl/lib/openssl/ssl-internal.rb177
-rw-r--r--ext/openssl/lib/openssl/ssl.rb189
-rw-r--r--ext/openssl/lib/openssl/x509-internal.rb158
-rw-r--r--ext/openssl/lib/openssl/x509.rb164
-rw-r--r--ext/openssl/ossl.c146
-rw-r--r--ext/openssl/ossl.h6
-rw-r--r--ext/openssl/ossl_asn1.c69
-rw-r--r--ext/openssl/ossl_bio.c2
-rw-r--r--ext/openssl/ossl_cipher.c233
-rw-r--r--ext/openssl/ossl_digest.c11
-rw-r--r--ext/openssl/ossl_engine.c40
-rw-r--r--ext/openssl/ossl_ns_spki.c138
-rw-r--r--ext/openssl/ossl_pkcs5.c104
-rw-r--r--ext/openssl/ossl_pkcs7.c9
-rw-r--r--ext/openssl/ossl_pkey.c45
-rw-r--r--ext/openssl/ossl_pkey.h10
-rw-r--r--ext/openssl/ossl_pkey_dh.c57
-rw-r--r--ext/openssl/ossl_pkey_dsa.c71
-rw-r--r--ext/openssl/ossl_pkey_ec.c93
-rw-r--r--ext/openssl/ossl_pkey_rsa.c84
-rw-r--r--ext/openssl/ossl_ssl.c471
-rw-r--r--ext/openssl/ossl_x509cert.c101
-rw-r--r--ext/openssl/ossl_x509name.c15
-rw-r--r--ext/openssl/ossl_x509store.c65
-rw-r--r--ext/openssl/ruby_missing.h13
-rw-r--r--ext/pathname/lib/pathname.rb140
-rw-r--r--ext/pathname/pathname.c345
-rw-r--r--ext/psych/.gitignore11
-rw-r--r--ext/psych/extconf.rb32
-rw-r--r--ext/psych/lib/psych.rb124
-rw-r--r--ext/psych/lib/psych/core_ext.rb8
-rw-r--r--ext/psych/lib/psych/deprecated.rb1
-rw-r--r--ext/psych/lib/psych/handler.rb28
-rw-r--r--ext/psych/lib/psych/handlers/document_stream.rb22
-rw-r--r--ext/psych/lib/psych/handlers/recorder.rb39
-rw-r--r--ext/psych/lib/psych/json.rb6
-rw-r--r--ext/psych/lib/psych/json/yaml_events.rb4
-rw-r--r--ext/psych/lib/psych/nodes/node.rb5
-rw-r--r--ext/psych/lib/psych/parser.rb4
-rw-r--r--ext/psych/lib/psych/scalar_scanner.rb57
-rw-r--r--ext/psych/lib/psych/syntax_error.rb22
-rw-r--r--ext/psych/lib/psych/tree_builder.rb4
-rw-r--r--ext/psych/lib/psych/visitors/emitter.rb15
-rw-r--r--ext/psych/lib/psych/visitors/to_ruby.rb95
-rw-r--r--ext/psych/lib/psych/visitors/yaml_tree.rb118
-rw-r--r--ext/psych/lib/psych/y.rb7
-rw-r--r--ext/psych/psych.gemspec24
-rw-r--r--ext/psych/psych.h8
-rw-r--r--ext/psych/psych_emitter.c (renamed from ext/psych/emitter.c)31
-rw-r--r--ext/psych/psych_emitter.h (renamed from ext/psych/emitter.h)0
-rw-r--r--ext/psych/psych_parser.c (renamed from ext/psych/parser.c)306
-rw-r--r--ext/psych/psych_parser.h (renamed from ext/psych/parser.h)0
-rw-r--r--ext/psych/psych_to_ruby.c (renamed from ext/psych/to_ruby.c)0
-rw-r--r--ext/psych/psych_to_ruby.h (renamed from ext/psych/to_ruby.h)0
-rw-r--r--ext/psych/psych_yaml_tree.c (renamed from ext/psych/yaml_tree.c)0
-rw-r--r--ext/psych/psych_yaml_tree.h (renamed from ext/psych/yaml_tree.h)0
-rw-r--r--ext/psych/yaml/LICENSE19
-rw-r--r--ext/psych/yaml/api.c1392
-rw-r--r--ext/psych/yaml/config.h11
-rw-r--r--ext/psych/yaml/dumper.c394
-rw-r--r--ext/psych/yaml/emitter.c2329
-rw-r--r--ext/psych/yaml/loader.c432
-rw-r--r--ext/psych/yaml/parser.c1374
-rw-r--r--ext/psych/yaml/reader.c465
-rw-r--r--ext/psych/yaml/scanner.c3570
-rw-r--r--ext/psych/yaml/writer.c141
-rw-r--r--ext/psych/yaml/yaml.h1971
-rw-r--r--ext/psych/yaml/yaml_private.h643
-rw-r--r--ext/pty/extconf.rb4
-rw-r--r--ext/pty/lib/expect.rb14
-rw-r--r--ext/pty/pty.c215
-rw-r--r--ext/racc/cparse/cparse.c2
-rw-r--r--ext/readline/README.ja344
-rw-r--r--ext/readline/extconf.rb110
-rw-r--r--ext/readline/readline.c327
-rw-r--r--ext/ripper/depend6
-rw-r--r--ext/ripper/eventids2.c14
-rw-r--r--ext/ripper/extconf.rb3
-rw-r--r--ext/ripper/lib/ripper.rb69
-rw-r--r--ext/ripper/lib/ripper/core.rb8
-rw-r--r--ext/ripper/lib/ripper/filter.rb21
-rw-r--r--ext/ripper/lib/ripper/lexer.rb17
-rw-r--r--ext/ripper/lib/ripper/sexp.rb4
-rwxr-xr-xext/ripper/tools/generate.rb12
-rw-r--r--ext/sdbm/_sdbm.c80
-rw-r--r--ext/sdbm/init.c351
-rw-r--r--ext/socket/ancdata.c56
-rw-r--r--ext/socket/basicsocket.c10
-rw-r--r--ext/socket/depend2
-rw-r--r--ext/socket/extconf.rb34
-rw-r--r--ext/socket/init.c84
-rw-r--r--ext/socket/ipsocket.c14
-rw-r--r--ext/socket/lib/socket.rb118
-rw-r--r--ext/socket/mkconstants.rb22
-rw-r--r--ext/socket/option.c22
-rw-r--r--ext/socket/raddrinfo.c137
-rw-r--r--ext/socket/rubysocket.h10
-rw-r--r--ext/socket/socket.c259
-rw-r--r--ext/socket/sockssocket.c23
-rw-r--r--ext/socket/tcpserver.c36
-rw-r--r--ext/socket/tcpsocket.c23
-rw-r--r--ext/socket/udpsocket.c11
-rw-r--r--ext/socket/unixserver.c11
-rw-r--r--ext/socket/unixsocket.c31
-rw-r--r--ext/stringio/stringio.c179
-rw-r--r--ext/strscan/extconf.rb1
-rw-r--r--ext/strscan/strscan.c86
-rw-r--r--ext/syck/bytecode.c1165
-rw-r--r--ext/syck/depend12
-rw-r--r--ext/syck/emitter.c1247
-rw-r--r--ext/syck/extconf.rb5
-rw-r--r--ext/syck/gram.c1894
-rw-r--r--ext/syck/gram.h79
-rw-r--r--ext/syck/handler.c173
-rw-r--r--ext/syck/implicit.c2990
-rw-r--r--ext/syck/lib/syck.rb447
-rw-r--r--ext/syck/lib/syck/baseemitter.rb242
-rw-r--r--ext/syck/lib/syck/basenode.rb222
-rw-r--r--ext/syck/lib/syck/constants.rb45
-rw-r--r--ext/syck/lib/syck/encoding.rb35
-rw-r--r--ext/syck/lib/syck/error.rb34
-rw-r--r--ext/syck/lib/syck/loader.rb14
-rw-r--r--ext/syck/lib/syck/rubytypes.rb466
-rw-r--r--ext/syck/lib/syck/stream.rb41
-rw-r--r--ext/syck/lib/syck/stringio.rb85
-rw-r--r--ext/syck/lib/syck/syck.rb16
-rw-r--r--ext/syck/lib/syck/tag.rb95
-rw-r--r--ext/syck/lib/syck/types.rb192
-rw-r--r--ext/syck/lib/syck/yamlnode.rb54
-rw-r--r--ext/syck/lib/syck/ypath.rb54
-rw-r--r--ext/syck/lib/yaml/syck.rb14
-rw-r--r--ext/syck/node.c407
-rw-r--r--ext/syck/rubyext.c2328
-rw-r--r--ext/syck/syck.c524
-rw-r--r--ext/syck/syck.h453
-rw-r--r--ext/syck/token.c2724
-rw-r--r--ext/syck/yaml2byte.c259
-rw-r--r--ext/syck/yamlbyte.h171
-rw-r--r--ext/syslog/lib/syslog/logger.rb194
-rw-r--r--ext/syslog/syslog.c186
-rw-r--r--ext/tk/MANUAL_tcltklib.eng2
-rw-r--r--ext/tk/MANUAL_tcltklib.eucj822
-rw-r--r--ext/tk/README.1st14
-rw-r--r--ext/tk/extconf.rb27
-rw-r--r--ext/tk/lib/multi-tk.rb2
-rw-r--r--ext/tk/lib/tcltk.rb2
-rw-r--r--ext/tk/lib/tk/image.rb40
-rw-r--r--ext/tk/lib/tk/wm.rb6
-rw-r--r--ext/tk/old-README.tcltklib.eucj206
-rw-r--r--ext/tk/sample/demos-en/README114
-rw-r--r--ext/tk/sample/demos-en/README.tkencoding18
-rw-r--r--ext/tk/sample/demos-en/widget2
-rw-r--r--ext/tk/sample/demos-jp/README102
-rw-r--r--ext/tk/sample/demos-jp/README.1st28
-rw-r--r--ext/tk/sample/demos-jp/anilabel.rb22
-rw-r--r--ext/tk/sample/demos-jp/aniwave.rb10
-rw-r--r--ext/tk/sample/demos-jp/arrow.rb22
-rw-r--r--ext/tk/sample/demos-jp/bind.rb38
-rw-r--r--ext/tk/sample/demos-jp/bitmap.rb20
-rw-r--r--ext/tk/sample/demos-jp/button.rb20
-rw-r--r--ext/tk/sample/demos-jp/check.rb30
-rw-r--r--ext/tk/sample/demos-jp/check2.rb30
-rw-r--r--ext/tk/sample/demos-jp/clrpick.rb28
-rw-r--r--ext/tk/sample/demos-jp/colors.rb20
-rw-r--r--ext/tk/sample/demos-jp/combo.rb36
-rw-r--r--ext/tk/sample/demos-jp/cscroll.rb22
-rw-r--r--ext/tk/sample/demos-jp/ctext.rb36
-rw-r--r--ext/tk/sample/demos-jp/dialog1.rb12
-rw-r--r--ext/tk/sample/demos-jp/dialog2.rb12
-rw-r--r--ext/tk/sample/demos-jp/entry1.rb32
-rw-r--r--ext/tk/sample/demos-jp/entry2.rb32
-rw-r--r--ext/tk/sample/demos-jp/entry3.rb46
-rw-r--r--ext/tk/sample/demos-jp/filebox.rb28
-rw-r--r--ext/tk/sample/demos-jp/floor.rb24
-rw-r--r--ext/tk/sample/demos-jp/floor2.rb24
-rw-r--r--ext/tk/sample/demos-jp/form.rb28
-rw-r--r--ext/tk/sample/demos-jp/goldberg.rb20
-rw-r--r--ext/tk/sample/demos-jp/hello6
-rw-r--r--ext/tk/sample/demos-jp/hscale.rb14
-rw-r--r--ext/tk/sample/demos-jp/icon.rb24
-rw-r--r--ext/tk/sample/demos-jp/image1.rb22
-rw-r--r--ext/tk/sample/demos-jp/image2.rb34
-rw-r--r--ext/tk/sample/demos-jp/image3.rb18
-rw-r--r--ext/tk/sample/demos-jp/items.rb60
-rw-r--r--ext/tk/sample/demos-jp/ixset240
-rw-r--r--ext/tk/sample/demos-jp/knightstour.rb20
-rw-r--r--ext/tk/sample/demos-jp/label.rb30
-rw-r--r--ext/tk/sample/demos-jp/labelframe.rb32
-rw-r--r--ext/tk/sample/demos-jp/mclist.rb58
-rw-r--r--ext/tk/sample/demos-jp/menu.rb108
-rw-r--r--ext/tk/sample/demos-jp/menu84.rb50
-rw-r--r--ext/tk/sample/demos-jp/menu8x.rb120
-rw-r--r--ext/tk/sample/demos-jp/menubu.rb28
-rw-r--r--ext/tk/sample/demos-jp/msgbox.rb30
-rw-r--r--ext/tk/sample/demos-jp/msgbox2.rb32
-rw-r--r--ext/tk/sample/demos-jp/paned1.rb16
-rw-r--r--ext/tk/sample/demos-jp/paned2.rb22
-rw-r--r--ext/tk/sample/demos-jp/pendulum.rb10
-rw-r--r--ext/tk/sample/demos-jp/plot.rb26
-rw-r--r--ext/tk/sample/demos-jp/puzzle.rb30
-rw-r--r--ext/tk/sample/demos-jp/radio.rb30
-rw-r--r--ext/tk/sample/demos-jp/radio2.rb26
-rw-r--r--ext/tk/sample/demos-jp/radio3.rb24
-rw-r--r--ext/tk/sample/demos-jp/rolodex-j132
-rw-r--r--ext/tk/sample/demos-jp/ruler.rb22
-rw-r--r--ext/tk/sample/demos-jp/sayings.rb20
-rw-r--r--ext/tk/sample/demos-jp/search.rb40
-rw-r--r--ext/tk/sample/demos-jp/spin.rb42
-rw-r--r--ext/tk/sample/demos-jp/states.rb34
-rw-r--r--ext/tk/sample/demos-jp/style.rb192
-rw-r--r--ext/tk/sample/demos-jp/tcolor34
-rw-r--r--ext/tk/sample/demos-jp/text.rb102
-rw-r--r--ext/tk/sample/demos-jp/textpeer.rb32
-rw-r--r--ext/tk/sample/demos-jp/toolbar.rb56
-rw-r--r--ext/tk/sample/demos-jp/tree.rb22
-rw-r--r--ext/tk/sample/demos-jp/ttkbut.rb56
-rw-r--r--ext/tk/sample/demos-jp/ttkmenu.rb46
-rw-r--r--ext/tk/sample/demos-jp/ttknote.rb42
-rw-r--r--ext/tk/sample/demos-jp/ttkpane.rb24
-rw-r--r--ext/tk/sample/demos-jp/ttkprogress.rb26
-rw-r--r--ext/tk/sample/demos-jp/twind.rb76
-rw-r--r--ext/tk/sample/demos-jp/twind2.rb116
-rw-r--r--ext/tk/sample/demos-jp/unicodeout.rb42
-rw-r--r--ext/tk/sample/demos-jp/vscale.rb16
-rw-r--r--ext/tk/sample/demos-jp/widget316
-rw-r--r--ext/tk/sample/msgs_rb2/ja.msg154
-rw-r--r--ext/tk/sample/tcltklib/sample0.rb12
-rw-r--r--ext/tk/sample/tcltklib/sample1.rb304
-rw-r--r--ext/tk/sample/tcltklib/sample2.rb14
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page1/index.html2
-rw-r--r--ext/tk/sample/tkoptdb-safeTk.rb2
-rw-r--r--ext/tk/sample/tkoptdb.rb2
-rw-r--r--ext/tk/stubs.c4
-rw-r--r--ext/tk/tcltklib.c126
-rw-r--r--ext/tk/tkutil/tkutil.c53
-rw-r--r--ext/zlib/extconf.rb10
-rw-r--r--ext/zlib/zlib.c978
-rw-r--r--file.c866
-rw-r--r--gc.c4982
-rw-r--r--gc.h10
-rw-r--r--goruby.c34
-rw-r--r--hash.c586
-rw-r--r--ia64.s4
-rw-r--r--id.c11
-rw-r--r--include/ruby.h1
-rw-r--r--include/ruby/backward/rubysig.h8
-rw-r--r--include/ruby/debug.h92
-rw-r--r--include/ruby/defines.h89
-rw-r--r--include/ruby/encoding.h14
-rw-r--r--include/ruby/intern.h132
-rw-r--r--include/ruby/io.h1
-rw-r--r--include/ruby/missing.h20
-rw-r--r--include/ruby/oniguruma.h90
-rw-r--r--include/ruby/ruby.h505
-rw-r--r--include/ruby/st.h17
-rw-r--r--include/ruby/subst.h1
-rw-r--r--include/ruby/thread.h49
-rw-r--r--include/ruby/util.h6
-rw-r--r--include/ruby/version.h6
-rw-r--r--include/ruby/win32.h125
-rw-r--r--inits.c1
-rw-r--r--insns.def988
-rw-r--r--internal.h162
-rw-r--r--io.c2433
-rw-r--r--iseq.c951
-rw-r--r--iseq.h27
-rwxr-xr-x[-rw-r--r--]lib/abbrev.rb84
-rw-r--r--lib/benchmark.rb73
-rw-r--r--lib/cgi.rb35
-rw-r--r--lib/cgi/core.rb92
-rw-r--r--lib/cgi/html.rb104
-rw-r--r--lib/cgi/util.rb18
-rw-r--r--lib/csv.rb65
-rw-r--r--lib/debug.rb170
-rw-r--r--lib/delegate.rb11
-rw-r--r--lib/drb/drb.rb20
-rw-r--r--lib/drb/extservm.rb10
-rw-r--r--lib/drb/ssl.rb10
-rw-r--r--lib/drb/unix.rb2
-rw-r--r--lib/erb.rb15
-rw-r--r--lib/fileutils.rb456
-rw-r--r--lib/find.rb2
-rw-r--r--lib/forwardable.rb4
-rw-r--r--lib/ipaddr.rb305
-rw-r--r--lib/irb/cmd/fork.rb2
-rw-r--r--lib/irb/completion.rb8
-rw-r--r--lib/irb/output-method.rb2
-rw-r--r--lib/irb/workspace.rb2
-rw-r--r--lib/logger.rb124
-rw-r--r--lib/mathn.rb16
-rw-r--r--lib/matrix.rb243
-rw-r--r--lib/minitest/README.txt394
-rw-r--r--lib/minitest/autorun.rb8
-rw-r--r--lib/minitest/benchmark.rb42
-rw-r--r--lib/minitest/hell.rb16
-rw-r--r--lib/minitest/mock.rb173
-rw-r--r--lib/minitest/parallel_each.rb36
-rw-r--r--lib/minitest/pride.rb100
-rw-r--r--lib/minitest/spec.rb488
-rw-r--r--lib/minitest/unit.rb679
-rw-r--r--lib/mkmf.rb3876
-rw-r--r--lib/monitor.rb2
-rw-r--r--lib/net/.document8
-rw-r--r--lib/net/ftp.rb214
-rw-r--r--lib/net/http.rb1823
-rw-r--r--lib/net/http/backward.rb25
-rw-r--r--lib/net/http/exceptions.rb25
-rw-r--r--lib/net/http/generic_request.rb266
-rw-r--r--lib/net/http/header.rb452
-rw-r--r--lib/net/http/proxy_delta.rb16
-rw-r--r--lib/net/http/request.rb20
-rw-r--r--lib/net/http/requests.rb122
-rw-r--r--lib/net/http/response.rb390
-rw-r--r--lib/net/http/responses.rb268
-rw-r--r--lib/net/imap.rb139
-rw-r--r--lib/net/pop.rb14
-rw-r--r--lib/net/protocol.rb18
-rw-r--r--lib/net/smtp.rb22
-rw-r--r--lib/net/telnet.rb21
-rw-r--r--lib/observer.rb4
-rw-r--r--lib/open-uri.rb209
-rw-r--r--lib/open3.rb29
-rw-r--r--lib/optparse.rb10
-rw-r--r--lib/optparse/ac.rb50
-rw-r--r--lib/ostruct.rb140
-rw-r--r--lib/pp.rb62
-rw-r--r--lib/prettyprint.rb9
-rw-r--r--lib/profiler.rb73
-rw-r--r--lib/pstore.rb82
-rw-r--r--lib/racc/parser.rb4
-rw-r--r--lib/rake.rb2
-rw-r--r--lib/rake/application.rb386
-rw-r--r--lib/rake/backtrace.rb18
-rw-r--r--lib/rake/clean.rb2
-rw-r--r--lib/rake/cloneable.rb23
-rw-r--r--lib/rake/contrib/ftptools.rb3
-rw-r--r--lib/rake/contrib/sys.rb13
-rw-r--r--lib/rake/dsl_definition.rb28
-rw-r--r--lib/rake/ext/module.rb2
-rw-r--r--lib/rake/ext/string.rb3
-rw-r--r--lib/rake/ext/time.rb3
-rw-r--r--lib/rake/file_list.rb11
-rw-r--r--lib/rake/file_utils_ext.rb7
-rw-r--r--lib/rake/multi_task.rb7
-rw-r--r--lib/rake/phony.rb15
-rw-r--r--lib/rake/private_reader.rb20
-rw-r--r--lib/rake/promise.rb99
-rw-r--r--lib/rake/rake_module.rb8
-rw-r--r--lib/rake/rdoctask.rb2
-rw-r--r--[-rwxr-xr-x]lib/rake/ruby182_test_unit_fix.rb0
-rw-r--r--lib/rake/runtest.rb3
-rw-r--r--lib/rake/task.rb39
-rw-r--r--lib/rake/task_arguments.rb2
-rw-r--r--lib/rake/task_manager.rb2
-rw-r--r--lib/rake/testtask.rb9
-rw-r--r--lib/rake/thread_history_display.rb48
-rw-r--r--lib/rake/thread_pool.rb155
-rw-r--r--lib/rake/trace_output.rb19
-rw-r--r--lib/rake/version.rb11
-rw-r--r--lib/rbconfig/obsolete.rb43
-rw-r--r--lib/rdoc.rb171
-rw-r--r--lib/rdoc/alias.rb2
-rw-r--r--lib/rdoc/anon_class.rb2
-rw-r--r--lib/rdoc/any_method.rb107
-rw-r--r--lib/rdoc/attr.rb61
-rw-r--r--lib/rdoc/class_module.rb270
-rw-r--r--lib/rdoc/code_object.rb113
-rw-r--r--lib/rdoc/code_objects.rb24
-rw-r--r--lib/rdoc/comment.rb232
-rw-r--r--lib/rdoc/constant.rb108
-rw-r--r--lib/rdoc/context.rb330
-rw-r--r--lib/rdoc/context/section.rb238
-rw-r--r--lib/rdoc/cross_reference.rb183
-rw-r--r--lib/rdoc/encoding.rb66
-rw-r--r--lib/rdoc/erb_partial.rb18
-rw-r--r--lib/rdoc/extend.rb117
-rw-r--r--lib/rdoc/generator.rb32
-rw-r--r--lib/rdoc/generator/darkfish.rb466
-rw-r--r--lib/rdoc/generator/json_index.rb248
-rw-r--r--lib/rdoc/generator/markup.rb91
-rw-r--r--lib/rdoc/generator/ri.rb70
-rw-r--r--lib/rdoc/generator/template/darkfish/_footer.rhtml5
-rw-r--r--lib/rdoc/generator/template/darkfish/_head.rhtml16
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml18
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml9
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml16
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml8
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml16
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml14
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml12
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml7
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml12
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml10
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml10
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml10
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml13
-rw-r--r--lib/rdoc/generator/template/darkfish/class.rhtml179
-rw-r--r--lib/rdoc/generator/template/darkfish/classpage.rhtml319
-rw-r--r--lib/rdoc/generator/template/darkfish/filepage.rhtml124
-rwxr-xr-xlib/rdoc/generator/template/darkfish/images/add.pngbin0 -> 733 bytes-rwxr-xr-xlib/rdoc/generator/template/darkfish/images/arrow_up.pngbin0 -> 372 bytes-rwxr-xr-xlib/rdoc/generator/template/darkfish/images/delete.pngbin0 -> 715 bytes-rwxr-xr-xlib/rdoc/generator/template/darkfish/images/tag_blue.pngbin0 -> 1880 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/images/transparent.pngbin0 -> 97 bytes-rw-r--r--lib/rdoc/generator/template/darkfish/index.rhtml77
-rw-r--r--lib/rdoc/generator/template/darkfish/js/darkfish.js161
-rw-r--r--lib/rdoc/generator/template/darkfish/js/jquery.js44
-rw-r--r--lib/rdoc/generator/template/darkfish/js/quicksearch.js114
-rw-r--r--lib/rdoc/generator/template/darkfish/js/search.js94
-rw-r--r--lib/rdoc/generator/template/darkfish/js/thickbox-compressed.js10
-rw-r--r--lib/rdoc/generator/template/darkfish/page.rhtml18
-rw-r--r--lib/rdoc/generator/template/darkfish/rdoc.css487
-rw-r--r--lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml18
-rw-r--r--lib/rdoc/generator/template/darkfish/servlet_root.rhtml37
-rw-r--r--lib/rdoc/generator/template/darkfish/table_of_contents.rhtml55
-rw-r--r--lib/rdoc/generator/template/json_index/js/navigation.js142
-rw-r--r--lib/rdoc/generator/template/json_index/js/searcher.js228
-rw-r--r--lib/rdoc/ghost_method.rb2
-rw-r--r--lib/rdoc/include.rb43
-rw-r--r--lib/rdoc/markdown.rb16336
-rw-r--r--lib/rdoc/markdown/entities.rb2128
-rw-r--r--lib/rdoc/markdown/literals_1_9.rb417
-rw-r--r--lib/rdoc/markup.rb394
-rw-r--r--lib/rdoc/markup/attr_changer.rb22
-rw-r--r--lib/rdoc/markup/attr_span.rb29
-rw-r--r--lib/rdoc/markup/attribute_manager.rb37
-rw-r--r--lib/rdoc/markup/attributes.rb70
-rw-r--r--lib/rdoc/markup/block_quote.rb14
-rw-r--r--lib/rdoc/markup/document.rb61
-rw-r--r--lib/rdoc/markup/formatter.rb55
-rw-r--r--lib/rdoc/markup/formatter_test_case.rb120
-rw-r--r--lib/rdoc/markup/hard_break.rb31
-rw-r--r--lib/rdoc/markup/heading.rb44
-rw-r--r--lib/rdoc/markup/include.rb42
-rw-r--r--lib/rdoc/markup/indented_paragraph.rb14
-rw-r--r--lib/rdoc/markup/inline.rb145
-rw-r--r--lib/rdoc/markup/list.rb28
-rw-r--r--lib/rdoc/markup/list_item.rb21
-rw-r--r--lib/rdoc/markup/paragraph.rb14
-rw-r--r--lib/rdoc/markup/parser.rb217
-rw-r--r--lib/rdoc/markup/pre_process.rb219
-rw-r--r--lib/rdoc/markup/raw.rb10
-rw-r--r--lib/rdoc/markup/special.rb40
-rw-r--r--lib/rdoc/markup/text_formatter_test_case.rb2
-rw-r--r--lib/rdoc/markup/to_ansi.rb15
-rw-r--r--lib/rdoc/markup/to_bs.rb2
-rw-r--r--lib/rdoc/markup/to_html.rb193
-rw-r--r--lib/rdoc/markup/to_html_crossref.rb253
-rw-r--r--lib/rdoc/markup/to_html_snippet.rb284
-rw-r--r--lib/rdoc/markup/to_joined_paragraph.rb68
-rw-r--r--lib/rdoc/markup/to_label.rb74
-rw-r--r--lib/rdoc/markup/to_markdown.rb134
-rw-r--r--lib/rdoc/markup/to_rdoc.rb52
-rw-r--r--lib/rdoc/markup/to_table_of_contents.rb61
-rw-r--r--lib/rdoc/markup/to_test.rb3
-rw-r--r--lib/rdoc/markup/to_tt_only.rb16
-rw-r--r--lib/rdoc/markup/verbatim.rb38
-rw-r--r--lib/rdoc/meta_method.rb2
-rw-r--r--lib/rdoc/method_attr.rb81
-rw-r--r--lib/rdoc/normal_class.rb35
-rw-r--r--lib/rdoc/normal_module.rb17
-rw-r--r--lib/rdoc/options.rb376
-rw-r--r--lib/rdoc/parser.rb132
-rw-r--r--lib/rdoc/parser/c.rb506
-rw-r--r--lib/rdoc/parser/markdown.rb23
-rw-r--r--lib/rdoc/parser/rd.rb22
-rw-r--r--lib/rdoc/parser/ruby.rb372
-rw-r--r--lib/rdoc/parser/ruby_tools.rb13
-rw-r--r--lib/rdoc/parser/simple.rb30
-rw-r--r--lib/rdoc/parser/text.rb11
-rw-r--r--lib/rdoc/rd.rb99
-rw-r--r--lib/rdoc/rd/block_parser.rb1054
-rw-r--r--lib/rdoc/rd/inline.rb71
-rw-r--r--lib/rdoc/rd/inline_parser.rb1207
-rw-r--r--lib/rdoc/rdoc.rb176
-rw-r--r--lib/rdoc/require.rb2
-rw-r--r--lib/rdoc/ri.rb6
-rw-r--r--lib/rdoc/ri/driver.rb435
-rw-r--r--lib/rdoc/ri/paths.rb121
-rw-r--r--lib/rdoc/ri/store.rb356
-rw-r--r--lib/rdoc/ruby_lex.rb127
-rw-r--r--lib/rdoc/ruby_token.rb50
-rw-r--r--lib/rdoc/rubygems_hook.rb30
-rw-r--r--lib/rdoc/servlet.rb302
-rw-r--r--lib/rdoc/single_class.rb2
-rw-r--r--lib/rdoc/stats.rb58
-rw-r--r--lib/rdoc/store.rb881
-rw-r--r--lib/rdoc/task.rb28
-rw-r--r--lib/rdoc/test_case.rb178
-rw-r--r--lib/rdoc/text.rb75
-rw-r--r--lib/rdoc/token_stream.rb45
-rw-r--r--lib/rdoc/tom_doc.rb233
-rw-r--r--lib/rdoc/top_level.rb363
-rw-r--r--lib/resolv.rb40
-rw-r--r--lib/rexml/document.rb56
-rw-r--r--lib/rexml/element.rb6
-rw-r--r--lib/rexml/encoding.rb14
-rw-r--r--lib/rexml/light/node.rb2
-rw-r--r--lib/rexml/output.rb7
-rw-r--r--lib/rexml/parsers/baseparser.rb65
-rw-r--r--lib/rexml/source.rb87
-rw-r--r--lib/rexml/xmldecl.rb8
-rw-r--r--lib/rinda/ring.rb8
-rw-r--r--lib/rinda/tuplespace.rb2
-rw-r--r--lib/rss/maker/base.rb12
-rw-r--r--lib/rss/maker/entry.rb4
-rw-r--r--lib/rss/rss.rb18
-rw-r--r--lib/rubygems.rb660
-rw-r--r--lib/rubygems/available_set.rb95
-rw-r--r--lib/rubygems/builder.rb99
-rw-r--r--lib/rubygems/command.rb133
-rw-r--r--lib/rubygems/command_manager.rb107
-rw-r--r--lib/rubygems/commands/build_command.rb34
-rw-r--r--lib/rubygems/commands/cert_command.rb256
-rw-r--r--lib/rubygems/commands/check_command.rb53
-rw-r--r--lib/rubygems/commands/cleanup_command.rb19
-rw-r--r--lib/rubygems/commands/contents_command.rb42
-rw-r--r--lib/rubygems/commands/dependency_command.rb11
-rw-r--r--lib/rubygems/commands/environment_command.rb21
-rw-r--r--lib/rubygems/commands/fetch_command.rb12
-rw-r--r--lib/rubygems/commands/generate_index_command.rb54
-rw-r--r--lib/rubygems/commands/help_command.rb2
-rw-r--r--lib/rubygems/commands/install_command.rb105
-rw-r--r--lib/rubygems/commands/list_command.rb10
-rw-r--r--lib/rubygems/commands/lock_command.rb2
-rw-r--r--lib/rubygems/commands/mirror_command.rb17
-rw-r--r--lib/rubygems/commands/outdated_command.rb9
-rw-r--r--lib/rubygems/commands/owner_command.rb18
-rw-r--r--lib/rubygems/commands/pristine_command.rb25
-rw-r--r--lib/rubygems/commands/push_command.rb13
-rw-r--r--lib/rubygems/commands/query_command.rb72
-rw-r--r--lib/rubygems/commands/rdoc_command.rb51
-rw-r--r--lib/rubygems/commands/search_command.rb22
-rw-r--r--lib/rubygems/commands/server_command.rb2
-rw-r--r--lib/rubygems/commands/setup_command.rb176
-rw-r--r--lib/rubygems/commands/sources_command.rb32
-rw-r--r--lib/rubygems/commands/specification_command.rb30
-rw-r--r--lib/rubygems/commands/uninstall_command.rb27
-rw-r--r--lib/rubygems/commands/unpack_command.rb10
-rw-r--r--lib/rubygems/commands/update_command.rb58
-rw-r--r--lib/rubygems/commands/yank_command.rb98
-rw-r--r--lib/rubygems/compatibility.rb51
-rw-r--r--lib/rubygems/config_file.rb148
-rw-r--r--lib/rubygems/core_ext/kernel_gem.rb53
-rwxr-xr-xlib/rubygems/core_ext/kernel_require.rb119
-rw-r--r--lib/rubygems/custom_require.rb68
-rw-r--r--lib/rubygems/defaults.rb38
-rw-r--r--lib/rubygems/dependency.rb73
-rw-r--r--lib/rubygems/dependency_installer.rb226
-rw-r--r--lib/rubygems/dependency_list.rb30
-rw-r--r--lib/rubygems/dependency_resolver.rb562
-rw-r--r--lib/rubygems/deprecate.rb22
-rw-r--r--lib/rubygems/doc_manager.rb243
-rw-r--r--lib/rubygems/errors.rb101
-rw-r--r--lib/rubygems/exceptions.rb32
-rw-r--r--lib/rubygems/ext/builder.rb26
-rw-r--r--lib/rubygems/ext/configure_builder.rb4
-rw-r--r--lib/rubygems/ext/ext_conf_builder.rb4
-rw-r--r--lib/rubygems/ext/rake_builder.rb4
-rw-r--r--lib/rubygems/format.rb82
-rw-r--r--lib/rubygems/gem_openssl.rb92
-rw-r--r--lib/rubygems/gem_path_searcher.rb172
-rw-r--r--lib/rubygems/gem_runner.rb19
-rw-r--r--lib/rubygems/gemcutter_utilities.rb29
-rw-r--r--lib/rubygems/indexer.rb168
-rw-r--r--lib/rubygems/install_message.rb12
-rw-r--r--lib/rubygems/install_update_options.rb74
-rw-r--r--lib/rubygems/installer.rb393
-rw-r--r--lib/rubygems/installer_test_case.rb94
-rw-r--r--lib/rubygems/mock_gem_ui.rb17
-rw-r--r--lib/rubygems/name_tuple.rb110
-rw-r--r--lib/rubygems/old_format.rb153
-rw-r--r--lib/rubygems/package.rb557
-rw-r--r--lib/rubygems/package/digest_io.rb64
-rw-r--r--lib/rubygems/package/f_sync_dir.rb23
-rw-r--r--lib/rubygems/package/old.rb147
-rw-r--r--lib/rubygems/package/tar_header.rb73
-rw-r--r--lib/rubygems/package/tar_input.rb226
-rw-r--r--lib/rubygems/package/tar_output.rb146
-rw-r--r--lib/rubygems/package/tar_reader.rb23
-rw-r--r--lib/rubygems/package/tar_writer.rb70
-rw-r--r--lib/rubygems/package_task.rb7
-rw-r--r--lib/rubygems/path_support.rb2
-rw-r--r--lib/rubygems/platform.rb44
-rw-r--r--lib/rubygems/psych_additions.rb9
-rw-r--r--lib/rubygems/psych_tree.rb27
-rw-r--r--lib/rubygems/rdoc.rb316
-rw-r--r--lib/rubygems/remote_fetcher.rb186
-rw-r--r--lib/rubygems/request_set.rb182
-rw-r--r--lib/rubygems/require_paths_builder.rb18
-rw-r--r--lib/rubygems/requirement.rb134
-rw-r--r--lib/rubygems/security.rb850
-rw-r--r--lib/rubygems/security/policies.rb115
-rw-r--r--lib/rubygems/security/policy.rb227
-rw-r--r--lib/rubygems/security/signer.rb136
-rw-r--r--lib/rubygems/security/trust_dir.rb104
-rw-r--r--lib/rubygems/server.rb100
-rw-r--r--lib/rubygems/source.rb144
-rw-r--r--lib/rubygems/source_index.rb406
-rw-r--r--lib/rubygems/source_list.rb87
-rw-r--r--lib/rubygems/source_local.rb92
-rw-r--r--lib/rubygems/source_specific_file.rb28
-rw-r--r--lib/rubygems/spec_fetcher.rb298
-rw-r--r--lib/rubygems/specification.rb1121
-rw-r--r--lib/rubygems/ssl_certs/AddTrustExternalCARoot.pem90
-rw-r--r--lib/rubygems/ssl_certs/Entrust_net-Secure-Server-Certification-Authority.pem90
-rw-r--r--lib/rubygems/ssl_certs/VerisignClass3PublicPrimaryCertificationAuthority-G2.pem57
-rw-r--r--lib/rubygems/ssl_certs/ca-bundle.pem3366
-rw-r--r--lib/rubygems/syck_hack.rb76
-rw-r--r--lib/rubygems/test_case.rb280
-rw-r--r--lib/rubygems/test_utilities.rb32
-rw-r--r--lib/rubygems/uninstaller.rb82
-rw-r--r--lib/rubygems/user_interaction.rb12
-rw-r--r--lib/rubygems/validator.rb73
-rw-r--r--lib/rubygems/version.rb33
-rw-r--r--lib/scanf.rb2
-rw-r--r--lib/securerandom.rb15
-rw-r--r--[-rwxr-xr-x]lib/set.rb681
-rw-r--r--lib/shell.rb26
-rw-r--r--lib/shell/command-processor.rb4
-rw-r--r--lib/shell/process-controller.rb2
-rw-r--r--lib/shell/system-command.rb2
-rw-r--r--lib/shellwords.rb139
-rw-r--r--lib/sync.rb45
-rw-r--r--lib/tempfile.rb80
-rw-r--r--lib/test/unit.rb583
-rw-r--r--lib/test/unit/assertions.rb60
-rw-r--r--lib/test/unit/parallel.rb59
-rw-r--r--lib/test/unit/test-unit.gemspec14
-rw-r--r--lib/test/unit/testcase.rb9
-rw-r--r--lib/thread.rb164
-rw-r--r--lib/time.rb287
-rw-r--r--lib/timeout.rb3
-rw-r--r--lib/tmpdir.rb23
-rw-r--r--lib/tracer.rb4
-rw-r--r--lib/un.rb15
-rw-r--r--lib/uri/common.rb79
-rw-r--r--lib/uri/ftp.rb1
-rw-r--r--lib/uri/generic.rb89
-rw-r--r--lib/uri/http.rb2
-rw-r--r--lib/uri/mailto.rb2
-rw-r--r--lib/weakref.rb50
-rw-r--r--lib/webrick.rb7
-rw-r--r--lib/webrick/httpproxy.rb30
-rw-r--r--lib/webrick/httpresponse.rb21
-rw-r--r--lib/webrick/httpstatus.rb28
-rw-r--r--lib/webrick/httputils.rb2
-rw-r--r--lib/webrick/server.rb91
-rw-r--r--lib/webrick/ssl.rb2
-rw-r--r--lib/webrick/utils.rb6
-rw-r--r--lib/xmlrpc.rb301
-rw-r--r--lib/xmlrpc/README.rdoc300
-rw-r--r--lib/xmlrpc/README.txt31
-rw-r--r--lib/xmlrpc/base64.rb63
-rw-r--r--lib/xmlrpc/client.rb609
-rw-r--r--lib/xmlrpc/config.rb26
-rw-r--r--lib/xmlrpc/create.rb21
-rw-r--r--lib/xmlrpc/datetime.rb119
-rw-r--r--lib/xmlrpc/httpserver.rb45
-rw-r--r--lib/xmlrpc/marshal.rb18
-rw-r--r--lib/xmlrpc/parser.rb84
-rw-r--r--lib/xmlrpc/server.rb571
-rw-r--r--lib/xmlrpc/utils.rb44
-rw-r--r--lib/yaml.rb74
-rw-r--r--lib/yaml/dbm.rb14
-rw-r--r--lib/yaml/store.rb15
-rw-r--r--load.c466
-rw-r--r--main.c4
-rw-r--r--man/erb.110
-rw-r--r--man/goruby.110
-rw-r--r--man/irb.18
-rw-r--r--man/rake.12
-rw-r--r--man/ri.18
-rw-r--r--man/ruby.135
-rw-r--r--marshal.c324
-rw-r--r--math.c9
-rw-r--r--method.h12
-rw-r--r--misc/inf-ruby.el2
-rw-r--r--misc/rdoc-mode.el69
-rw-r--r--misc/ruby-additional.el100
-rw-r--r--misc/ruby-electric.el6
-rw-r--r--missing/alloca.c6
-rw-r--r--missing/flock.c3
-rw-r--r--missing/setproctitle.c7
-rw-r--r--nacl/GNUmakefile.in87
-rw-r--r--nacl/README.nacl34
-rw-r--r--nacl/create_nmf.rb70
-rw-r--r--nacl/dirent.h15
-rw-r--r--nacl/example.html150
-rw-r--r--nacl/ioctl.h7
-rw-r--r--nacl/nacl-config.rb61
-rw-r--r--nacl/package.rb109
-rw-r--r--nacl/pepper_main.c870
-rw-r--r--nacl/resource.h8
-rw-r--r--nacl/select.h7
-rw-r--r--nacl/signal.h6
-rw-r--r--nacl/stat.h10
-rw-r--r--nacl/unistd.h9
-rw-r--r--nacl/utime.h11
-rw-r--r--node.c66
-rw-r--r--node.h47
-rw-r--r--numeric.c597
-rw-r--r--object.c556
-rw-r--r--pack.c155
-rw-r--r--parse.y1998
-rw-r--r--prelude.rb16
-rw-r--r--probes.d44
-rw-r--r--probes_helper.h64
-rw-r--r--proc.c312
-rw-r--r--process.c2538
-rw-r--r--random.c314
-rw-r--r--range.c550
-rw-r--r--rational.c468
-rw-r--r--re.c124
-rw-r--r--regcomp.c553
-rw-r--r--regenc.c37
-rw-r--r--regenc.h14
-rw-r--r--regerror.c23
-rw-r--r--regexec.c835
-rw-r--r--regint.h109
-rw-r--r--regparse.c1070
-rw-r--r--regparse.h9
-rw-r--r--regsyntax.c84
-rw-r--r--ruby.c311
-rw-r--r--ruby_atomic.h121
-rw-r--r--safe.c2
-rw-r--r--sample/README2
-rw-r--r--sample/coverage.rb2
-rw-r--r--sample/drb/README.rd.ja48
-rw-r--r--sample/drb/dhasenc.rb6
-rwxr-xr-x[-rw-r--r--]sample/mine.rb40
-rwxr-xr-x[-rw-r--r--]sample/test.rb92
-rw-r--r--sample/webrick/httpproxy.rb7
-rw-r--r--signal.c242
-rw-r--r--siphash.c483
-rw-r--r--siphash.h48
-rw-r--r--sparc.c31
-rw-r--r--spec/default.mspec8
-rw-r--r--sprintf.c103
-rw-r--r--st.c728
-rw-r--r--strftime.c178
-rw-r--r--string.c1138
-rw-r--r--struct.c95
-rw-r--r--template/Doxyfile.tmpl20
-rw-r--r--template/encdb.h.tmpl2
-rw-r--r--[-rwxr-xr-x]template/fake.rb.in6
-rw-r--r--template/id.h.tmpl170
-rw-r--r--template/ruby.pc.in7
-rw-r--r--template/yarvarch.ja402
-rw-r--r--test/-ext-/exception/test_enc_raise.rb15
-rw-r--r--test/-ext-/iter/test_iter_break.rb9
-rw-r--r--test/-ext-/marshal/test_usrmarshal.rb34
-rw-r--r--test/-ext-/num2int/test_num2int.rb227
-rw-r--r--test/-ext-/old_thread_select/test_old_thread_select.rb100
-rw-r--r--test/-ext-/path_to_class/test_path_to_class.rb12
-rw-r--r--test/-ext-/st/test_numhash.rb49
-rw-r--r--test/-ext-/st/test_update.rb50
-rw-r--r--test/-ext-/string/test_enc_str_buf_cat.rb15
-rw-r--r--test/-ext-/string/test_modify_expand.rb15
-rw-r--r--test/-ext-/string/test_qsort.rb19
-rw-r--r--test/-ext-/symbol/test_inadvertent_creation.rb163
-rw-r--r--test/-ext-/test_add_suffix.rb47
-rw-r--r--test/-ext-/test_bug-5832.rb21
-rw-r--r--test/-ext-/test_printf.rb49
-rw-r--r--test/-ext-/typeddata/test_typeddata.rb21
-rw-r--r--test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb3
-rw-r--r--test/-ext-/win32/test_dln.rb13
-rw-r--r--test/-ext-/win32/test_fd_setsize.rb25
-rw-r--r--test/base64/test_base64.rb1
-rw-r--r--test/benchmark/test_benchmark.rb102
-rw-r--r--test/bigdecimal/test_bigdecimal.rb145
-rw-r--r--test/bigdecimal/test_bigdecimal_util.rb2
-rw-r--r--test/bigdecimal/testbase.rb7
-rw-r--r--test/cgi/test_cgi_core.rb18
-rw-r--r--test/cgi/test_cgi_header.rb48
-rw-r--r--test/cgi/test_cgi_modruby.rb7
-rw-r--r--test/cgi/test_cgi_multipart.rb53
-rw-r--r--test/cgi/test_cgi_session.rb5
-rw-r--r--test/cgi/test_cgi_tag_helper.rb13
-rw-r--r--test/cgi/test_cgi_util.rb26
-rw-r--r--test/coverage/test_coverage.rb25
-rwxr-xr-xtest/csv/test_encodings.rb2
-rwxr-xr-xtest/csv/test_features.rb55
-rwxr-xr-xtest/csv/test_interface.rb9
-rwxr-xr-xtest/csv/test_serialization.rb7
-rw-r--r--test/date/test_date_marshal.rb12
-rw-r--r--test/date/test_date_parse.rb804
-rw-r--r--test/date/test_date_strftime.rb23
-rw-r--r--test/date/test_date_strptime.rb189
-rw-r--r--test/date/test_switch_hitter.rb112
-rw-r--r--test/dbm/test_dbm.rb101
-rwxr-xr-xtest/digest/test_digest.rb12
-rw-r--r--test/digest/test_digest_extend.rb1
-rw-r--r--test/dl/test_base.rb7
-rw-r--r--test/dl/test_c_struct_entry.rb55
-rw-r--r--test/dl/test_c_union_entity.rb31
-rw-r--r--test/dl/test_callback.rb9
-rw-r--r--test/dl/test_cfunc.rb2
-rw-r--r--test/dl/test_cparser.rb24
-rw-r--r--test/dl/test_cptr.rb6
-rw-r--r--test/dl/test_dl2.rb16
-rw-r--r--test/dl/test_func.rb9
-rw-r--r--test/dl/test_handle.rb9
-rw-r--r--test/dl/test_import.rb9
-rw-r--r--test/drb/drbtest.rb40
-rw-r--r--test/drb/test_drb.rb5
-rw-r--r--test/drb/test_drbssl.rb6
-rw-r--r--test/drb/test_drbunix.rb6
-rw-r--r--test/drb/ut_array_drbssl.rb11
-rw-r--r--test/drb/ut_drb.rb3
-rw-r--r--test/drb/ut_drb_drbssl.rb13
-rw-r--r--test/dtrace/dummy.rb1
-rw-r--r--test/dtrace/helper.rb39
-rw-r--r--test/dtrace/test_array_create.rb35
-rw-r--r--test/dtrace/test_cmethod.rb49
-rw-r--r--test/dtrace/test_function_entry.rb87
-rw-r--r--test/dtrace/test_gc.rb26
-rw-r--r--test/dtrace/test_hash_create.rb52
-rw-r--r--test/dtrace/test_load.rb52
-rw-r--r--test/dtrace/test_object_create_start.rb35
-rw-r--r--test/dtrace/test_raise.rb29
-rw-r--r--test/dtrace/test_require.rb34
-rw-r--r--test/dtrace/test_singleton_function.rb55
-rw-r--r--test/dtrace/test_string.rb27
-rw-r--r--test/erb/test_erb.rb40
-rw-r--r--test/etc/test_etc.rb34
-rw-r--r--test/fiddle/helper.rb17
-rw-r--r--test/fiddle/test_c_struct_entry.rb54
-rw-r--r--test/fiddle/test_c_union_entity.rb31
-rw-r--r--test/fiddle/test_closure.rb25
-rw-r--r--test/fiddle/test_cparser.rb33
-rw-r--r--test/fiddle/test_fiddle.rb16
-rw-r--r--test/fiddle/test_func.rb79
-rw-r--r--test/fiddle/test_handle.rb186
-rw-r--r--test/fiddle/test_import.rb136
-rw-r--r--test/fiddle/test_pointer.rb231
-rw-r--r--test/fileutils/fileasserts.rb79
-rw-r--r--test/fileutils/test_dryrun.rb7
-rw-r--r--test/fileutils/test_fileutils.rb42
-rw-r--r--test/fileutils/test_nowrite.rb8
-rw-r--r--test/fileutils/test_verbose.rb11
-rw-r--r--test/gdbm/test_gdbm.rb55
-rw-r--r--test/iconv/test_basic.rb59
-rw-r--r--test/iconv/test_option.rb43
-rw-r--r--test/iconv/test_partial.rb41
-rw-r--r--test/iconv/utils.rb29
-rw-r--r--test/io/console/test_io_console.rb81
-rw-r--r--test/io/wait/test_io_wait.rb38
-rw-r--r--test/irb/test_completion.rb22
-rwxr-xr-xtest/json/test_json.rb129
-rwxr-xr-xtest/json/test_json_addition.rb33
-rw-r--r--test/json/test_json_encoding.rb2
-rwxr-xr-xtest/json/test_json_fixtures.rb2
-rwxr-xr-xtest/json/test_json_generate.rb130
-rw-r--r--test/json/test_json_string_matching.rb2
-rwxr-xr-xtest/json/test_json_unicode.rb2
-rw-r--r--test/logger/test_logger.rb26
-rw-r--r--test/matrix/test_vector.rb15
-rw-r--r--test/minitest/metametameta.rb74
-rw-r--r--test/minitest/test_minitest_benchmark.rb2
-rw-r--r--test/minitest/test_minitest_mock.rb297
-rw-r--r--test/minitest/test_minitest_spec.rb660
-rw-r--r--test/minitest/test_minitest_unit.rb876
-rw-r--r--test/mkmf/base.rb15
-rw-r--r--test/mkmf/test_convertible.rb2
-rw-r--r--test/mkmf/test_framework.rb14
-rw-r--r--test/mkmf/test_signedness.rb2
-rw-r--r--test/mkmf/test_sizeof.rb2
-rw-r--r--test/net/ftp/test_ftp.rb813
-rw-r--r--test/net/http/test_http.rb324
-rw-r--r--test/net/http/test_http_request.rb57
-rw-r--r--test/net/http/test_httpheader.rb27
-rw-r--r--test/net/http/test_httpresponse.rb185
-rw-r--r--test/net/http/test_httpresponses.rb24
-rw-r--r--test/net/http/test_https.rb37
-rw-r--r--test/net/http/test_https_proxy.rb6
-rw-r--r--test/net/http/utils.rb7
-rw-r--r--test/net/imap/test_imap.rb130
-rw-r--r--test/net/imap/test_imap_response_parser.rb81
-rw-r--r--test/net/protocol/test_protocol.rb19
-rw-r--r--test/objspace/test_objspace.rb40
-rw-r--r--test/open-uri/test_open-uri.rb83
-rw-r--r--test/open-uri/test_ssl.rb25
-rw-r--r--test/openssl/test_asn1.rb39
-rw-r--r--test/openssl/test_buffering.rb1
-rw-r--r--test/openssl/test_cipher.rb16
-rw-r--r--test/openssl/test_config.rb13
-rw-r--r--test/openssl/test_digest.rb8
-rw-r--r--test/openssl/test_engine.rb70
-rw-r--r--test/openssl/test_ns_spki.rb1
-rw-r--r--test/openssl/test_pair.rb5
-rw-r--r--test/openssl/test_pkcs12.rb4
-rw-r--r--test/openssl/test_pkcs5.rb97
-rw-r--r--test/openssl/test_pkcs7.rb5
-rw-r--r--test/openssl/test_pkey_dh.rb23
-rw-r--r--test/openssl/test_pkey_dsa.rb16
-rw-r--r--test/openssl/test_pkey_ec.rb27
-rw-r--r--test/openssl/test_pkey_rsa.rb39
-rw-r--r--test/openssl/test_ssl.rb462
-rw-r--r--test/openssl/test_ssl_session.rb55
-rw-r--r--test/openssl/test_x509cert.rb22
-rw-r--r--test/openssl/test_x509crl.rb4
-rw-r--r--test/openssl/test_x509name.rb73
-rw-r--r--test/openssl/test_x509req.rb4
-rw-r--r--test/openssl/utils.rb21
-rw-r--r--test/optparse/test_autoconf.rb63
-rw-r--r--test/optparse/test_optarg.rb2
-rw-r--r--test/optparse/test_optparse.rb17
-rw-r--r--test/optparse/test_placearg.rb3
-rw-r--r--test/optparse/test_reqarg.rb2
-rw-r--r--test/optparse/test_summary.rb25
-rw-r--r--test/ostruct/test_ostruct.rb56
-rw-r--r--test/pathname/test_pathname.rb16
-rw-r--r--test/psych/handlers/test_recorder.rb25
-rw-r--r--test/psych/helper.rb11
-rw-r--r--test/psych/test_alias_and_anchor.rb70
-rw-r--r--test/psych/test_array.rb38
-rw-r--r--test/psych/test_deprecated.rb2
-rw-r--r--test/psych/test_document.rb8
-rw-r--r--test/psych/test_encoding.rb89
-rw-r--r--test/psych/test_engine_manager.rb10
-rw-r--r--test/psych/test_exception.rb112
-rw-r--r--test/psych/test_merge_keys.rb9
-rw-r--r--test/psych/test_numeric.rb41
-rw-r--r--test/psych/test_object_references.rb67
-rw-r--r--test/psych/test_omap.rb7
-rw-r--r--test/psych/test_parser.rb60
-rw-r--r--test/psych/test_scalar_scanner.rb37
-rw-r--r--test/psych/test_stream.rb44
-rw-r--r--test/psych/test_string.rb46
-rw-r--r--test/psych/test_struct.rb4
-rw-r--r--test/psych/test_tainted.rb4
-rw-r--r--test/psych/test_yaml.rb14
-rw-r--r--test/psych/test_yamldbm.rb197
-rw-r--r--test/psych/test_yamlstore.rb (renamed from test/syck/test_yamlstore.rb)26
-rw-r--r--test/psych/visitors/test_emitter.rb16
-rw-r--r--test/psych/visitors/test_to_ruby.rb1
-rw-r--r--test/psych/visitors/test_yaml_tree.rb18
-rw-r--r--test/rake/helper.rb85
-rw-r--r--test/rake/test_private_reader.rb42
-rw-r--r--test/rake/test_rake_application.rb44
-rw-r--r--test/rake/test_rake_application_options.rb133
-rw-r--r--test/rake/test_rake_backtrace.rb89
-rw-r--r--test/rake/test_rake_directory_task.rb24
-rw-r--r--test/rake/test_rake_dsl.rb4
-rw-r--r--test/rake/test_rake_file_task.rb22
-rw-r--r--test/rake/test_rake_functional.rb63
-rw-r--r--test/rake/test_rake_multi_task.rb8
-rw-r--r--test/rake/test_rake_rake_test_loader.rb2
-rw-r--r--test/rake/test_rake_reduce_compat.rb65
-rw-r--r--test/rake/test_rake_task.rb51
-rw-r--r--test/rake/test_rake_task_with_arguments.rb12
-rw-r--r--test/rake/test_rake_thread_pool.rb123
-rw-r--r--test/rake/test_rake_top_level_functions.rb2
-rw-r--r--test/rake/test_thread_history_display.rb91
-rw-r--r--test/rake/test_trace_output.rb43
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Amps and angle encoding.text21
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Auto links.text13
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Backslash escapes.text120
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Blockquotes with code blocks.text11
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Code Blocks.text14
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Code Spans.text6
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Hard-wrapped paragraphs with list-like lines.text8
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Horizontal rules.text67
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Inline HTML (Advanced).text15
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Inline HTML (Simple).text69
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Inline HTML comments.text13
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Links, inline style.text12
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Links, reference style.text71
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Links, shortcut references.text20
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Literal quotes in titles.text7
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Markdown Documentation - Basics.text306
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Markdown Documentation - Syntax.text888
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Nested blockquotes.text5
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Ordered and unordered lists.text131
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Strong and em together.text7
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Tabs.text21
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Tidyness.text5
-rw-r--r--test/rdoc/test_attribute_manager.rb66
-rw-r--r--test/rdoc/test_rdoc_any_method.rb134
-rw-r--r--test/rdoc/test_rdoc_attr.rb85
-rw-r--r--test/rdoc/test_rdoc_class_module.rb855
-rw-r--r--test/rdoc/test_rdoc_code_object.rb99
-rw-r--r--test/rdoc/test_rdoc_comment.rb504
-rw-r--r--test/rdoc/test_rdoc_constant.rb132
-rw-r--r--test/rdoc/test_rdoc_context.rb230
-rw-r--r--test/rdoc/test_rdoc_context_section.rb125
-rw-r--r--test/rdoc/test_rdoc_cross_reference.rb176
-rw-r--r--test/rdoc/test_rdoc_encoding.rb29
-rw-r--r--test/rdoc/test_rdoc_extend.rb94
-rw-r--r--test/rdoc/test_rdoc_generator_darkfish.rb118
-rw-r--r--test/rdoc/test_rdoc_generator_json_index.rb275
-rw-r--r--test/rdoc/test_rdoc_generator_markup.rb56
-rw-r--r--test/rdoc/test_rdoc_generator_ri.rb39
-rw-r--r--test/rdoc/test_rdoc_include.rb12
-rw-r--r--test/rdoc/test_rdoc_markdown.rb977
-rw-r--r--test/rdoc/test_rdoc_markdown_test.rb1891
-rw-r--r--test/rdoc/test_rdoc_markup.rb16
-rw-r--r--test/rdoc/test_rdoc_markup_attribute_manager.rb17
-rw-r--r--test/rdoc/test_rdoc_markup_attributes.rb39
-rw-r--r--test/rdoc/test_rdoc_markup_document.rb73
-rw-r--r--test/rdoc/test_rdoc_markup_formatter.rb58
-rw-r--r--test/rdoc/test_rdoc_markup_hard_break.rb31
-rw-r--r--test/rdoc/test_rdoc_markup_heading.rb20
-rw-r--r--test/rdoc/test_rdoc_markup_include.rb19
-rw-r--r--test/rdoc/test_rdoc_markup_indented_paragraph.rb23
-rw-r--r--test/rdoc/test_rdoc_markup_paragraph.rb23
-rw-r--r--test/rdoc/test_rdoc_markup_parser.rb457
-rw-r--r--test/rdoc/test_rdoc_markup_pre_process.rb415
-rw-r--r--test/rdoc/test_rdoc_markup_raw.rb14
-rw-r--r--test/rdoc/test_rdoc_markup_to_ansi.rb49
-rw-r--r--test/rdoc/test_rdoc_markup_to_bs.rb33
-rw-r--r--test/rdoc/test_rdoc_markup_to_html.rb271
-rw-r--r--test/rdoc/test_rdoc_markup_to_html_crossref.rb251
-rw-r--r--test/rdoc/test_rdoc_markup_to_html_snippet.rb710
-rw-r--r--test/rdoc/test_rdoc_markup_to_joined_paragraph.rb32
-rw-r--r--test/rdoc/test_rdoc_markup_to_label.rb112
-rw-r--r--test/rdoc/test_rdoc_markup_to_markdown.rb352
-rw-r--r--test/rdoc/test_rdoc_markup_to_rdoc.rb48
-rw-r--r--test/rdoc/test_rdoc_markup_to_table_of_contents.rb95
-rw-r--r--test/rdoc/test_rdoc_markup_to_tt_only.rb25
-rw-r--r--test/rdoc/test_rdoc_markup_verbatim.rb29
-rw-r--r--test/rdoc/test_rdoc_method_attr.rb35
-rw-r--r--test/rdoc/test_rdoc_normal_class.rb29
-rw-r--r--test/rdoc/test_rdoc_normal_module.rb2
-rw-r--r--test/rdoc/test_rdoc_options.rb244
-rw-r--r--test/rdoc/test_rdoc_parser.rb115
-rw-r--r--test/rdoc/test_rdoc_parser_c.rb385
-rw-r--r--test/rdoc/test_rdoc_parser_markdown.rb55
-rw-r--r--test/rdoc/test_rdoc_parser_rd.rb52
-rw-r--r--test/rdoc/test_rdoc_parser_ruby.rb1257
-rw-r--r--test/rdoc/test_rdoc_parser_simple.rb54
-rw-r--r--test/rdoc/test_rdoc_rd.rb30
-rw-r--r--test/rdoc/test_rdoc_rd_block_parser.rb523
-rw-r--r--test/rdoc/test_rdoc_rd_inline.rb63
-rw-r--r--test/rdoc/test_rdoc_rd_inline_parser.rb173
-rw-r--r--test/rdoc/test_rdoc_rdoc.rb245
-rw-r--r--test/rdoc/test_rdoc_ri_driver.rb654
-rw-r--r--test/rdoc/test_rdoc_ri_paths.rb150
-rw-r--r--test/rdoc/test_rdoc_ruby_lex.rb222
-rw-r--r--test/rdoc/test_rdoc_ruby_token.rb19
-rw-r--r--test/rdoc/test_rdoc_rubygems_hook.rb110
-rw-r--r--test/rdoc/test_rdoc_servlet.rb429
-rw-r--r--test/rdoc/test_rdoc_stats.rb352
-rw-r--r--test/rdoc/test_rdoc_store.rb (renamed from test/rdoc/test_rdoc_ri_store.rb)430
-rw-r--r--test/rdoc/test_rdoc_task.rb21
-rw-r--r--test/rdoc/test_rdoc_text.rb195
-rw-r--r--test/rdoc/test_rdoc_token_stream.rb42
-rw-r--r--test/rdoc/test_rdoc_tom_doc.rb455
-rw-r--r--test/rdoc/test_rdoc_top_level.rb229
-rw-r--r--test/rdoc/xref_test_case.rb29
-rw-r--r--test/readline/test_readline.rb271
-rw-r--r--test/readline/test_readline_history.rb8
-rw-r--r--test/resolv/test_dns.rb32
-rw-r--r--test/rexml/data/testsrc.xml128
-rw-r--r--test/rexml/data/ticket_61.xml8
-rw-r--r--test/rexml/test_comment.rb25
-rw-r--r--test/rexml/test_contrib.rb8
-rw-r--r--test/rexml/test_document.rb210
-rw-r--r--test/rexml/test_encoding.rb6
-rw-r--r--test/rexml/test_lightparser.rb2
-rw-r--r--test/rexml/test_namespace.rb38
-rw-r--r--test/rexml/test_order.rb9
-rw-r--r--test/rexml/test_pullparser.rb4
-rw-r--r--test/rexml/test_sax.rb1
-rw-r--r--test/rexml/test_xml_declaration.rb (renamed from test/rexml/test_xml_declaration_parent_child.rb)7
-rw-r--r--test/rexml/test_xpath.rb8
-rw-r--r--test/rexml/test_xpathtext.rb2
-rw-r--r--test/rinda/test_rinda.rb147
-rw-r--r--test/ripper/dummyparser.rb2
-rw-r--r--test/ripper/test_files.rb23
-rw-r--r--test/ripper/test_parser_events.rb39
-rw-r--r--test/ripper/test_ripper.rb49
-rw-r--r--test/ripper/test_scanner_events.rb29
-rw-r--r--test/rss/rss-assertions.rb2
-rw-r--r--test/rss/rss-testcase.rb2
-rw-r--r--test/rss/test_1.0.rb54
-rw-r--r--test/rss/test_2.0.rb54
-rw-r--r--test/rss/test_atom.rb24
-rw-r--r--test/rss/test_dublincore.rb22
-rw-r--r--test/rss/test_maker_2.0.rb8
-rw-r--r--test/ruby/enc/test_euc_jp.rb2
-rw-r--r--test/ruby/enc/test_shift_jis.rb4
-rw-r--r--test/ruby/enc/test_utf16.rb2
-rw-r--r--test/ruby/enc/test_utf32.rb2
-rw-r--r--test/ruby/envutil.rb89
-rw-r--r--test/ruby/lbtest.rb9
-rw-r--r--test/ruby/marshaltestlib.rb40
-rw-r--r--test/ruby/memory_status.rb100
-rw-r--r--test/ruby/test_alias.rb25
-rw-r--r--test/ruby/test_argf.rb107
-rw-r--r--test/ruby/test_arity.rb71
-rw-r--r--test/ruby/test_array.rb166
-rw-r--r--test/ruby/test_autoload.rb126
-rw-r--r--test/ruby/test_backtrace.rb137
-rw-r--r--test/ruby/test_basicinstructions.rb11
-rw-r--r--test/ruby/test_beginendblock.rb30
-rw-r--r--test/ruby/test_bignum.rb283
-rw-r--r--test/ruby/test_class.rb12
-rw-r--r--test/ruby/test_complex.rb26
-rw-r--r--test/ruby/test_const.rb10
-rw-r--r--test/ruby/test_continuation.rb19
-rw-r--r--test/ruby/test_defined.rb57
-rw-r--r--test/ruby/test_dir.rb17
-rw-r--r--test/ruby/test_dir_m17n.rb109
-rw-r--r--test/ruby/test_econv.rb56
-rw-r--r--test/ruby/test_encoding.rb19
-rw-r--r--test/ruby/test_enum.rb37
-rw-r--r--test/ruby/test_enumerator.rb191
-rw-r--r--test/ruby/test_env.rb10
-rw-r--r--test/ruby/test_eval.rb199
-rw-r--r--test/ruby/test_exception.rb262
-rw-r--r--test/ruby/test_fiber.rb76
-rw-r--r--test/ruby/test_file.rb184
-rw-r--r--test/ruby/test_file_exhaustive.rb351
-rw-r--r--test/ruby/test_fixnum.rb50
-rw-r--r--test/ruby/test_float.rb135
-rw-r--r--test/ruby/test_fnmatch.rb6
-rw-r--r--test/ruby/test_gc.rb70
-rw-r--r--test/ruby/test_hash.rb141
-rw-r--r--test/ruby/test_ifunless.rb14
-rw-r--r--test/ruby/test_integer.rb7
-rw-r--r--test/ruby/test_io.rb1305
-rw-r--r--test/ruby/test_io_m17n.rb398
-rw-r--r--test/ruby/test_iseq.rb71
-rw-r--r--test/ruby/test_iterator.rb34
-rw-r--r--test/ruby/test_keyword.rb114
-rw-r--r--test/ruby/test_lambda.rb26
-rw-r--r--test/ruby/test_lazy_enumerator.rb359
-rw-r--r--test/ruby/test_literal.rb174
-rw-r--r--test/ruby/test_m17n.rb98
-rw-r--r--test/ruby/test_m17n_comb.rb81
-rw-r--r--test/ruby/test_marshal.rb50
-rw-r--r--test/ruby/test_method.rb56
-rw-r--r--test/ruby/test_module.rb463
-rw-r--r--test/ruby/test_not.rb12
-rw-r--r--test/ruby/test_numeric.rb2
-rw-r--r--test/ruby/test_object.rb285
-rw-r--r--test/ruby/test_optimization.rb39
-rw-r--r--test/ruby/test_pack.rb62
-rw-r--r--test/ruby/test_parse.rb133
-rw-r--r--test/ruby/test_path.rb9
-rw-r--r--test/ruby/test_proc.rb356
-rw-r--r--test/ruby/test_process.rb333
-rw-r--r--test/ruby/test_rand.rb67
-rw-r--r--test/ruby/test_range.rb89
-rw-r--r--test/ruby/test_rational.rb20
-rw-r--r--test/ruby/test_refinement.rb825
-rw-r--r--test/ruby/test_regexp.rb88
-rw-r--r--test/ruby/test_require.rb241
-rw-r--r--test/ruby/test_rubyoptions.rb101
-rw-r--r--test/ruby/test_settracefunc.rb412
-rw-r--r--test/ruby/test_signal.rb55
-rw-r--r--test/ruby/test_sleep.rb4
-rw-r--r--test/ruby/test_sprintf.rb68
-rw-r--r--test/ruby/test_string.rb233
-rw-r--r--test/ruby/test_stringchar.rb32
-rw-r--r--test/ruby/test_struct.rb25
-rw-r--r--test/ruby/test_super.rb186
-rw-r--r--test/ruby/test_symbol.rb42
-rw-r--r--test/ruby/test_syntax.rb159
-rw-r--r--test/ruby/test_system.rb4
-rw-r--r--test/ruby/test_thread.rb469
-rw-r--r--test/ruby/test_time.rb446
-rw-r--r--test/ruby/test_time_tz.rb41
-rw-r--r--test/ruby/test_transcode.rb95
-rw-r--r--test/ruby/test_unicode_escape.rb4
-rw-r--r--test/ruby/test_variable.rb5
-rw-r--r--test/ruby/test_whileuntil.rb3
-rw-r--r--test/rubygems/alternate_cert.pem9
-rw-r--r--test/rubygems/alternate_cert_32.pem9
-rw-r--r--test/rubygems/alternate_key.pem9
-rw-r--r--test/rubygems/bad_rake.rb1
-rw-r--r--test/rubygems/ca_cert.pem45
-rw-r--r--test/rubygems/child_cert.pem9
-rw-r--r--test/rubygems/child_cert_32.pem9
-rw-r--r--test/rubygems/child_key.pem9
-rw-r--r--test/rubygems/data/null-type.gemspec.rzbin0 -> 554 bytes-rw-r--r--test/rubygems/expired_cert.pem9
-rw-r--r--test/rubygems/future_cert.pem9
-rw-r--r--test/rubygems/future_cert_32.pem9
-rw-r--r--test/rubygems/good_rake.rb1
-rw-r--r--test/rubygems/grandchild_cert.pem9
-rw-r--r--test/rubygems/grandchild_cert_32.pem9
-rw-r--r--test/rubygems/grandchild_key.pem9
-rw-r--r--test/rubygems/invalid_issuer_cert.pem9
-rw-r--r--test/rubygems/invalid_issuer_cert_32.pem9
-rw-r--r--test/rubygems/invalid_key.pem9
-rw-r--r--test/rubygems/invalid_signer_cert.pem9
-rw-r--r--test/rubygems/invalid_signer_cert_32.pem9
-rw-r--r--test/rubygems/invalidchild_cert.pem9
-rw-r--r--test/rubygems/invalidchild_cert_32.pem9
-rw-r--r--test/rubygems/invalidchild_key.pem9
-rw-r--r--test/rubygems/plugin/exception/rubygems_plugin.rb2
-rw-r--r--test/rubygems/plugin/standarderror/rubygems_plugin.rb2
-rw-r--r--test/rubygems/private_key.pem32
-rw-r--r--test/rubygems/public_cert.pem26
-rw-r--r--test/rubygems/public_cert_32.pem10
-rw-r--r--test/rubygems/public_key.pem4
-rw-r--r--test/rubygems/rubygems/commands/crash_command.rb2
-rw-r--r--test/rubygems/ssl_cert.pem19
-rw-r--r--test/rubygems/ssl_key.pem15
-rw-r--r--test/rubygems/test_config.rb10
-rw-r--r--test/rubygems/test_deprecate.rb76
-rw-r--r--test/rubygems/test_gem.rb487
-rw-r--r--test/rubygems/test_gem_available_set.rb106
-rw-r--r--test/rubygems/test_gem_builder.rb44
-rw-r--r--test/rubygems/test_gem_command.rb10
-rw-r--r--test/rubygems/test_gem_command_manager.rb64
-rw-r--r--test/rubygems/test_gem_commands_build_command.rb36
-rw-r--r--test/rubygems/test_gem_commands_cert_command.rb483
-rw-r--r--test/rubygems/test_gem_commands_cleanup_command.rb68
-rw-r--r--test/rubygems/test_gem_commands_contents_command.rb23
-rw-r--r--test/rubygems/test_gem_commands_dependency_command.rb5
-rw-r--r--test/rubygems/test_gem_commands_fetch_command.rb36
-rw-r--r--test/rubygems/test_gem_commands_generate_index_command.rb85
-rw-r--r--test/rubygems/test_gem_commands_help_command.rb3
-rw-r--r--test/rubygems/test_gem_commands_install_command.rb724
-rw-r--r--test/rubygems/test_gem_commands_mirror.rb32
-rw-r--r--test/rubygems/test_gem_commands_owner_command.rb12
-rw-r--r--test/rubygems/test_gem_commands_pristine_command.rb103
-rw-r--r--test/rubygems/test_gem_commands_push_command.rb70
-rw-r--r--test/rubygems/test_gem_commands_query_command.rb51
-rw-r--r--test/rubygems/test_gem_commands_search_command.rb25
-rw-r--r--test/rubygems/test_gem_commands_setup_command.rb45
-rw-r--r--test/rubygems/test_gem_commands_sources_command.rb29
-rw-r--r--test/rubygems/test_gem_commands_specification_command.rb134
-rw-r--r--test/rubygems/test_gem_commands_uninstall_command.rb104
-rw-r--r--test/rubygems/test_gem_commands_unpack_command.rb6
-rw-r--r--test/rubygems/test_gem_commands_update_command.rb94
-rw-r--r--test/rubygems/test_gem_commands_which_command.rb8
-rw-r--r--test/rubygems/test_gem_commands_yank_command.rb97
-rw-r--r--test/rubygems/test_gem_config_file.rb107
-rw-r--r--test/rubygems/test_gem_dependency.rb52
-rw-r--r--test/rubygems/test_gem_dependency_installer.rb246
-rw-r--r--test/rubygems/test_gem_dependency_list.rb9
-rw-r--r--test/rubygems/test_gem_dependency_resolver.rb327
-rw-r--r--test/rubygems/test_gem_doc_manager.rb32
-rw-r--r--test/rubygems/test_gem_ext_configure_builder.rb4
-rw-r--r--test/rubygems/test_gem_ext_ext_conf_builder.rb14
-rw-r--r--test/rubygems/test_gem_ext_rake_builder.rb26
-rw-r--r--test/rubygems/test_gem_format.rb88
-rw-r--r--test/rubygems/test_gem_gem_path_searcher.rb94
-rw-r--r--test/rubygems/test_gem_gem_runner.rb30
-rw-r--r--test/rubygems/test_gem_gemcutter_utilities.rb19
-rw-r--r--test/rubygems/test_gem_indexer.rb289
-rw-r--r--test/rubygems/test_gem_install_update_options.rb86
-rw-r--r--test/rubygems/test_gem_installer.rb429
-rw-r--r--test/rubygems/test_gem_local_remote_options.rb10
-rw-r--r--test/rubygems/test_gem_name_tuple.rb15
-rw-r--r--test/rubygems/test_gem_package.rb547
-rw-r--r--test/rubygems/test_gem_package_old.rb37
-rw-r--r--test/rubygems/test_gem_package_tar_input.rb129
-rw-r--r--test/rubygems/test_gem_package_tar_output.rb101
-rw-r--r--test/rubygems/test_gem_package_tar_reader.rb32
-rw-r--r--test/rubygems/test_gem_package_tar_writer.rb85
-rw-r--r--test/rubygems/test_gem_platform.rb85
-rw-r--r--test/rubygems/test_gem_rdoc.rb245
-rw-r--r--test/rubygems/test_gem_remote_fetcher.rb183
-rw-r--r--test/rubygems/test_gem_request_set.rb70
-rw-r--r--test/rubygems/test_gem_requirement.rb61
-rw-r--r--test/rubygems/test_gem_security.rb232
-rw-r--r--test/rubygems/test_gem_security_policy.rb376
-rw-r--r--test/rubygems/test_gem_security_signer.rb184
-rw-r--r--test/rubygems/test_gem_security_trust_dir.rb94
-rw-r--r--test/rubygems/test_gem_server.rb71
-rw-r--r--test/rubygems/test_gem_silent_ui.rb4
-rw-r--r--test/rubygems/test_gem_source.rb188
-rw-r--r--test/rubygems/test_gem_source_index.rb250
-rw-r--r--test/rubygems/test_gem_source_list.rb87
-rw-r--r--test/rubygems/test_gem_source_local.rb83
-rw-r--r--test/rubygems/test_gem_source_specific_file.rb33
-rw-r--r--test/rubygems/test_gem_spec_fetcher.rb346
-rw-r--r--test/rubygems/test_gem_specification.rb671
-rw-r--r--test/rubygems/test_gem_uninstaller.rb149
-rw-r--r--test/rubygems/test_gem_validator.rb55
-rw-r--r--test/rubygems/test_gem_version.rb25
-rw-r--r--test/rubygems/test_require.rb193
-rw-r--r--test/rubygems/wrong_key_cert.pem9
-rw-r--r--test/rubygems/wrong_key_cert_32.pem9
-rw-r--r--test/runner.rb4
-rw-r--r--test/socket/test_addrinfo.rb23
-rw-r--r--test/socket/test_socket.rb128
-rw-r--r--test/socket/test_unix.rb32
-rw-r--r--test/stringio/test_stringio.rb23
-rw-r--r--test/strscan/test_stringscanner.rb12
-rw-r--r--test/syck/test_array.rb18
-rw-r--r--test/syck/test_boolean.rb37
-rw-r--r--test/syck/test_class.rb27
-rw-r--r--test/syck/test_engine_manager.rb3
-rw-r--r--test/syck/test_exception.rb46
-rw-r--r--test/syck/test_hash.rb29
-rw-r--r--test/syck/test_null.rb20
-rw-r--r--test/syck/test_omap.rb56
-rw-r--r--test/syck/test_set.rb31
-rw-r--r--test/syck/test_string.rb45
-rw-r--r--test/syck/test_struct.rb42
-rw-r--r--test/syck/test_symbol.rb22
-rw-r--r--test/syck/test_time.rb24
-rw-r--r--test/syck/test_yaml.rb1413
-rw-r--r--test/syck/test_yaml_properties.rb64
-rw-r--r--test/syslog/test_syslog_logger.rb522
-rw-r--r--test/test_abbrev.rb54
-rw-r--r--test/test_curses.rb12
-rw-r--r--test/test_delegate.rb7
-rw-r--r--test/test_mathn.rb2
-rw-r--r--test/test_pp.rb5
-rw-r--r--test/test_pstore.rb40
-rw-r--r--test/test_pty.rb52
-rw-r--r--test/test_securerandom.rb12
-rw-r--r--test/test_set.rb641
-rw-r--r--test/test_shellwords.rb22
-rw-r--r--test/test_syslog.rb20
-rw-r--r--test/test_time.rb8
-rw-r--r--test/test_tmpdir.rb21
-rw-r--r--test/test_tracer.rb4
-rw-r--r--test/test_weakref.rb56
-rw-r--r--test/testunit/test4test_redefinition.rb11
-rw-r--r--test/testunit/test4test_sorting.rb15
-rw-r--r--test/testunit/test_hideskip.rb11
-rw-r--r--test/testunit/test_parallel.rb23
-rw-r--r--test/testunit/test_redefinition.rb13
-rw-r--r--test/testunit/test_sorting.rb17
-rw-r--r--test/testunit/tests_for_parallel/ptest_forth.rb7
-rw-r--r--test/thread/test_cv.rb188
-rw-r--r--test/thread/test_queue.rb72
-rw-r--r--test/thread/test_sync.rb57
-rw-r--r--test/uri/test_ftp.rb4
-rw-r--r--test/uri/test_generic.rb80
-rw-r--r--test/uri/test_mailto.rb10
-rw-r--r--test/webrick/test_cgi.rb11
-rw-r--r--test/webrick/test_filehandler.rb1
-rw-r--r--test/webrick/test_httpresponse.rb49
-rw-r--r--test/webrick/test_httpserver.rb72
-rw-r--r--test/webrick/test_server.rb25
-rw-r--r--test/webrick/utils.rb7
-rw-r--r--test/win32ole/test_err_in_callback.rb10
-rw-r--r--test/win32ole/test_win32ole.rb11
-rw-r--r--test/win32ole/test_win32ole_event.rb12
-rw-r--r--test/win32ole/test_win32ole_method.rb2
-rw-r--r--test/win32ole/test_win32ole_type.rb2
-rw-r--r--test/win32ole/test_win32ole_variant.rb35
-rw-r--r--test/win32ole/test_win32ole_variant_outarg.rb13
-rw-r--r--test/xmlrpc/data/blog.xml18
-rw-r--r--test/xmlrpc/test_client.rb293
-rw-r--r--test/xmlrpc/test_webrick_server.rb6
-rw-r--r--test/xmlrpc/webrick_testing.rb1
-rw-r--r--test/zlib/test_zlib.rb252
-rw-r--r--thread.c2204
-rw-r--r--thread_pthread.c433
-rw-r--r--thread_pthread.h5
-rw-r--r--thread_win32.c46
-rw-r--r--thread_win32.h7
-rw-r--r--time.c574
-rw-r--r--[-rwxr-xr-x]tool/asm_parse.rb0
-rwxr-xr-xtool/change_maker.rb6
-rw-r--r--[-rwxr-xr-x]tool/compile_prelude.rb6
-rwxr-xr-xtool/config.guess235
-rwxr-xr-xtool/config.sub184
-rwxr-xr-xtool/enc-unicode.rb87
-rw-r--r--[-rwxr-xr-x]tool/eval.rb0
-rwxr-xr-xtool/file2lastrev.rb13
-rwxr-xr-xtool/gen_dummy_probes.rb26
-rw-r--r--[-rwxr-xr-x]tool/generic_erb.rb8
-rwxr-xr-xtool/id2token.rb24
-rw-r--r--tool/install-sh2
-rwxr-xr-xtool/instruction.rb96
-rwxr-xr-xtool/make-snapshot17
-rwxr-xr-xtool/merger.rb91
-rwxr-xr-xtool/mkconfig.rb20
-rwxr-xr-xtool/mkrunnable.rb85
-rw-r--r--[-rwxr-xr-x]tool/parse.rb0
-rwxr-xr-xtool/rbinstall.rb254
-rwxr-xr-xtool/rubytest.rb3
-rwxr-xr-xtool/runruby.rb12
-rw-r--r--[-rwxr-xr-x]tool/transcode-tblgen.rb24
-rw-r--r--tool/vpath.rb79
-rw-r--r--[-rwxr-xr-x]tool/vtlh.rb0
-rwxr-xr-xtool/ytab.sed6
-rw-r--r--transcode.c190
-rw-r--r--transcode_data.h10
-rw-r--r--util.c274
-rw-r--r--variable.c634
-rw-r--r--version.c6
-rw-r--r--version.h11
-rw-r--r--vm.c934
-rw-r--r--vm_backtrace.c1006
-rw-r--r--vm_core.h369
-rw-r--r--vm_debug.h (renamed from debug.h)2
-rw-r--r--vm_dump.c362
-rw-r--r--vm_eval.c769
-rw-r--r--vm_exec.c53
-rw-r--r--vm_exec.h21
-rw-r--r--vm_insnhelper.c2607
-rw-r--r--vm_insnhelper.h136
-rw-r--r--vm_method.c443
-rw-r--r--vm_opts.h5
-rw-r--r--vm_trace.c1239
-rw-r--r--vsnprintf.c81
-rw-r--r--win32/Makefile.sub161
-rw-r--r--win32/README.win3216
-rwxr-xr-xwin32/configure.bat32
-rw-r--r--win32/file.c666
-rwxr-xr-xwin32/makedirs.bat3
-rwxr-xr-xwin32/mkexports.rb21
-rwxr-xr-x[-rw-r--r--]win32/rmall.bat0
-rw-r--r--win32/setup.mak19
-rw-r--r--win32/win32.c1701
1788 files changed, 256710 insertions, 101029 deletions
diff --git a/.document b/.document
index 8a05d61beb..94bb61a526 100644
--- a/.document
+++ b/.document
@@ -20,3 +20,8 @@ ext
# rdoc files
doc/*.rdoc
+
+README
+README.ja
+README.EXT
+README.EXT.ja
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000000..67abf4b978
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,16 @@
+root = true
+
+[*]
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
+tab_width = 8
+indent_style = tab
+indent_size = 4
+
+[**.bat]
+end_of_line = crlf
+
+[**.rb]
+indent_style = space
+indent_size = 2
diff --git a/.gdbinit b/.gdbinit
index 2a38da8892..b67115b6a2 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -89,7 +89,11 @@ define rp
echo undef\n
else
if (VALUE)($arg0) & RUBY_IMMEDIATE_MASK
- echo immediate\n
+ if ((VALUE)($arg0) & RUBY_FLONUM_MASK) == RUBY_FLONUM_FLAG
+ printf "FLONUM: %g\n", (double)rb_float_value($arg0)
+ else
+ echo immediate\n
+ end
else
set $flags = ((struct RBasic*)($arg0))->flags
if ($flags & RUBY_T_MASK) == RUBY_T_NONE
@@ -106,15 +110,15 @@ define rp
else
if ($flags & RUBY_T_MASK) == RUBY_T_CLASS
printf "T_CLASS%s: ", ($flags & RUBY_FL_SINGLETON) ? "*" : ""
- print (struct RClass *)($arg0)
+ rp_class $arg0
else
if ($flags & RUBY_T_MASK) == RUBY_T_ICLASS
printf "T_ICLASS: "
- print (struct RClass *)($arg0)
+ rp_class $arg0
else
if ($flags & RUBY_T_MASK) == RUBY_T_MODULE
printf "T_MODULE: "
- print (struct RClass *)($arg0)
+ rp_class $arg0
else
if ($flags & RUBY_T_MASK) == RUBY_T_FLOAT
printf "T_FLOAT: %.16g ", (((struct RFloat*)($arg0))->float_value)
@@ -337,6 +341,19 @@ document rp
Print a Ruby's VALUE.
end
+define rp_class
+ printf "(struct RClass *) %p", (void*)$arg0
+ if ((struct RClass *)($arg0))->ptr.origin != $arg0
+ printf " -> %p", ((struct RClass *)($arg0))->ptr.origin
+ end
+ printf "\n"
+ print *(struct RClass *)($arg0)
+ print *((struct RClass *)($arg0))->ptr
+end
+document rp_class
+ Print the content of a Class/Module.
+end
+
define nd_type
print (enum node_type)((((NODE*)($arg0))->flags&RUBY_NODE_TYPEMASK)>>RUBY_NODE_TYPESHIFT)
end
@@ -625,18 +642,18 @@ define rb_numtable_entry
set $rb_numtable_key = 0
set $rb_numtable_rec = 0
if $rb_numtable_tbl->entries_packed
- set $rb_numtable_p = $rb_numtable_tbl->bins
- while $rb_numtable_p && $rb_numtable_p < $rb_numtable_tbl->bins+$rb_numtable_tbl->num_entries
- if (st_data_t)$rb_numtable_p[0] == $rb_numtable_id
- set $rb_numtable_key = (st_data_t)$rb_numtable_p[0]
- set $rb_numtable_rec = (st_data_t)$rb_numtable_p[1]
+ set $rb_numtable_p = $rb_numtable_tbl->as.packed.bins
+ while $rb_numtable_p && $rb_numtable_p < $rb_numtable_tbl->as.packed.bins+$rb_numtable_tbl->num_entries
+ if $rb_numtable_p.k == $rb_numtable_id
+ set $rb_numtable_key = $rb_numtable_p.k
+ set $rb_numtable_rec = $rb_numtable_p.v
set $rb_numtable_p = 0
else
- set $rb_numtable_p = $rb_numtable_p + 2
+ set $rb_numtable_p = $rb_numtable_p + 1
end
end
else
- set $rb_numtable_p = $rb_numtable_tbl->bins[$rb_numtable_id % $rb_numtable_tbl->num_bins]
+ set $rb_numtable_p = $rb_numtable_tbl->as.big.bins[$rb_numtable_id % $rb_numtable_tbl->num_bins]
while $rb_numtable_p
if $rb_numtable_p->key == $rb_numtable_id
set $rb_numtable_key = $rb_numtable_p->key
@@ -689,6 +706,17 @@ define rb_classname
print *(struct RClass*)($arg0)
end
+define rb_ancestors
+ set $rb_ancestors_module = $arg0
+ while $rb_ancestors_module
+ rp $rb_ancestors_module
+ set $rb_ancestors_module = ((struct RClass *)($rb_ancestors_module))->ptr.super
+ end
+end
+document rb_ancestors
+ Print ancestors.
+end
+
define rb_backtrace
call rb_backtrace()
end
@@ -731,8 +759,8 @@ define rb_ps_vm
if $ps_threads->entries_packed
set $ps_threads_i = 0
while $ps_threads_i < $ps_threads->num_entries
- set $ps_threads_key = (st_data_t)$ps_threads->bins[$ps_threads_i * 2]
- set $ps_threads_val = (st_data_t)$ps_threads->bins[$ps_threads_i * 2 + 1]
+ set $ps_threads_key = (st_data_t)$ps_threads->as.packed.entries[$ps_threads_i].key
+ set $ps_threads_val = (st_data_t)$ps_threads->as.packed.entries[$ps_threads_i].val
rb_ps_thread $ps_threads_key $ps_threads_val
set $ps_threads_i = $ps_threads_i + 1
end
@@ -755,3 +783,20 @@ define rb_ps_thread
set $ps_thread_id = $arg1
print $ps_thread_th = (rb_thread_t*)$ps_thread->data
end
+
+# Details: https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/MachineInstructionsTraceWithGDB
+define trace_machine_instructions
+ set logging on
+ set height 0
+ set width 0
+ display/i $pc
+ while !$exit_code
+ info line *$pc
+ si
+ end
+end
+
+define SDR
+ call rb_vmdebug_stack_dump_raw_current()
+end
+
diff --git a/.gitignore b/.gitignore
index 57557c9c2e..e872670e80 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,7 +2,9 @@
*.a
*.bak
*.dSYM
+*.dmyh
*.dylib
+*.elc
*.inc
*.log
*.o
@@ -51,7 +53,6 @@ y.tab.c
/configure
/doc/capi
/enc.mk
-/enc/trans/*.c
/encdb.h
/exts.mk
/goruby
@@ -72,6 +73,7 @@ y.tab.c
/ppack
/prelude.c
/preview
+/probes.h
/rbconfig.rb
/rename2.h
/repack
@@ -84,6 +86,7 @@ y.tab.c
/tmp
/transdb.h
/uncommon.mk
+/verconf.h
/web
/yasmdata.rb
@@ -96,18 +99,10 @@ y.tab.c
# /ext/
/ext/extinit.c
-# /ext/dl/
-/ext/dl/*.func
-
# /ext/dl/callback/
-/ext/dl/callback/*.func
/ext/dl/callback/callback-*.c
/ext/dl/callback/callback.c
-# /ext/iconv/
-/ext/iconv/config.charset
-/ext/iconv/iconv.rb
-
# /ext/ripper/
/ext/ripper/eventids1.c
/ext/ripper/eventids2table.c
@@ -129,3 +124,4 @@ y.tab.c
# /win32/
/win32/*.ico
+/win32/.time
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000000..db25c9eb08
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,71 @@
+# Copyright (C) 2011 Urabe, Shyouhei. All rights reserved.
+#
+# This file is a part of the programming language Ruby. Permission is hereby
+# granted, to either redistribute or modify this file, provided that the
+# conditions mentioned in the file COPYING are met. Consult the file for
+# details.
+
+# This is a Travis-CI build configuration file. The list of configurations
+# available is located in
+#
+# http://about.travis-ci.org/docs/user/build-configuration/
+#
+# and as Ruby itself is a project written in C language,
+#
+# http://about.travis-ci.org/docs/user/languages/c/
+#
+# is also a good place to look at.
+
+# Language specification.
+language: c
+
+# Compilers. Several compilers are provided in Travis, so we try them all.
+# The value set here is visible via $CC environment variable.
+compiler:
+ - gcc
+ - clang
+
+# Dependencies. Some header files are missing in a Travis' worker VM, so we
+# have to install them. The "1.9.1" here is OK. It is the most adopted
+# version string for Debian/Ubuntu, and no dependencies have been changed so
+# far since the 1.9.1 release.
+before_install:
+ - "sudo apt-get -qq update"
+ - "sudo apt-get -qq install $CC" # upgrade if any
+install: "sudo apt-get -qq build-dep ruby1.9.1 2>/dev/null"
+
+# Script is where the test runs. Note we just do "make test", not other tests
+# like test-all, test-rubyspec. This is because they take too much time,
+# enough for Travis to shut down the VM as being stalled.
+before_script:
+ - "autoconf"
+ - "./configure --with-gcc=$CC"
+ - "make -sj encs"
+ - "make -sj exts"
+script: "make test OPTS=-v"
+
+# Branch matrix. Not all branches are Travis-ready so we limit branches here.
+branches:
+ only:
+ - trunk
+ - ruby_1_9_3
+
+# We want to be notified when something happens.
+notifications:
+ irc:
+ channels:
+ - "irc.freenode.org#ruby-core"
+ - "irc.freenode.org#ruby-ja"
+ on_success: change # [always|never|change] # default: always
+ on_failure: change # [always|never|change] # default: always
+ template:
+ - "%{message} by @%{author}: See %{build_url}"
+
+# Local Variables:
+# mode: YAML
+# coding: utf-8-unix
+# indent-tabs-mode: nil
+# tab-width: 4
+# fill-column: 79
+# default-justification: full
+# End:
diff --git a/COPYING.ja b/COPYING.ja
index 5b5b91c149..e50d01c8d1 100644
--- a/COPYING.ja
+++ b/COPYING.ja
@@ -1,51 +1,51 @@
-$BK\%W%m%0%i%`$O%U%j!<%=%U%H%&%'%"$G$9!%(B2-clause BSDL
-$B$^$?$O0J2<$K<($9>r7o$GK\%W%m%0%i%`$r:FG[I[$G$-$^$9(B
-2-clause BSDL$B$K$D$$$F$O(BBSDL$B%U%!%$%k$r;2>H$7$F2<$5$$!%(B
+本プログラムはフリーソフトウェアです.2-clause BSDL
+または以下に示す条件で本プログラムを再配布できます
+2-clause BSDLについてはBSDLファイルを参照して下さい.
- 1. $BJ#@=$O@)8B$J$/<+M3$G$9!%(B
+ 1. 複製は制限なく自由です.
- 2. $B0J2<$N>r7o$N$$$:$l$+$rK~$?$9;~$KK\%W%m%0%i%`$N%=!<%9$r(B
- $B<+M3$KJQ99$G$-$^$9!%(B
+ 2. 以下の条件のいずれかを満たす時に本プログラムのソースを
+ 自由に変更できます.
- (a) $B%M%C%H%K%e!<%:$K%]%9%H$7$?$j!$:n<T$KJQ99$rAwIU$9$k(B
- $B$J$I$NJ}K!$G!$JQ99$r8x3+$9$k!%(B
+ (a) ネットニューズにポストしたり,作者に変更を送付する
+ などの方法で,変更を公開する.
- (b) $BJQ99$7$?K\%W%m%0%i%`$r<+J,$N=jB0$9$kAH?%FbIt$@$1$G(B
- $B;H$&!%(B
+ (b) 変更した本プログラムを自分の所属する組織内部だけで
+ 使う.
- (c) $BJQ99E@$rL@<($7$?$&$(!$%=%U%H%&%'%"$NL>A0$rJQ99$9$k!%(B
- $B$=$N%=%U%H%&%'%"$rG[I[$9$k;~$K$OJQ99A0$NK\%W%m%0%i(B
- $B%`$bF1;~$KG[I[$9$k!%$^$?$OJQ99A0$NK\%W%m%0%i%`$N%=!<(B
- $B%9$NF~<jK!$rL@<($9$k!%(B
+ (c) 変更点を明示したうえ,ソフトウェアの名前を変更する.
+ そのソフトウェアを配布する時には変更前の本プログラ
+ ムも同時に配布する.または変更前の本プログラムのソー
+ スの入手法を明示する.
- (d) $B$=$NB>$NJQ99>r7o$r:n<T$H9g0U$9$k!%(B
+ (d) その他の変更条件を作者と合意する.
- 3. $B0J2<$N>r7o$N$$$:$l$+$rK~$?$9;~$KK\%W%m%0%i%`$r%3%s%Q%$(B
- $B%k$7$?%*%V%8%'%/%H%3!<%I$d<B9T7A<0$G$bG[I[$G$-$^$9!%(B
+ 3. 以下の条件のいずれかを満たす時に本プログラムをコンパイ
+ ルしたオブジェクトコードや実行形式でも配布できます.
- (a) $B%P%$%J%j$r<u$1<h$C$??M$,%=!<%9$rF~<j$G$-$k$h$&$K!$(B
- $B%=!<%9$NF~<jK!$rL@<($9$k!%(B
+ (a) バイナリを受け取った人がソースを入手できるように,
+ ソースの入手法を明示する.
- (b) $B5!3#2DFI$J%=!<%9%3!<%I$rE:IU$9$k!%(B
+ (b) 機械可読なソースコードを添付する.
- (c) $BJQ99$r9T$C$?%P%$%J%j$OL>A0$rJQ99$7$?$&$(!$%*%j%8%J(B
- $B%k$N%=!<%9%3!<%I$NF~<jK!$rL@<($9$k!%(B
+ (c) 変更を行ったバイナリは名前を変更したうえ,オリジナ
+ ルのソースコードの入手法を明示する.
- (d) $B$=$NB>$NG[I[>r7o$r:n<T$H9g0U$9$k!%(B
+ (d) その他の配布条件を作者と合意する.
- 4. $BB>$N%W%m%0%i%`$X$N0zMQ$O$$$+$J$kL\E*$G$"$l<+M3$G$9!%$?(B
- $B$@$7!$K\%W%m%0%i%`$K4^$^$l$kB>$N:n<T$K$h$k%3!<%I$O!$$=(B
- $B$l$>$l$N:n<T$N0U8~$K$h$k@)8B$,2C$($i$l$k>l9g$,$"$j$^$9!%(B
+ 4. 他のプログラムへの引用はいかなる目的であれ自由です.た
+ だし,本プログラムに含まれる他の作者によるコードは,そ
+ れぞれの作者の意向による制限が加えられる場合があります.
- $B$=$l$i%U%!%$%k$N0lMw$H$=$l$>$l$NG[I[>r7o$J$I$KIU$$$F$O(B
- LEGAL$B%U%!%$%k$r;2>H$7$F$/$@$5$$!%(B
+ それらファイルの一覧とそれぞれの配布条件などに付いては
+ LEGALファイルを参照してください.
- 5. $BK\%W%m%0%i%`$X$NF~NO$H$J$k%9%/%j%W%H$*$h$S!$K\%W%m%0%i(B
- $B%`$+$i$N=PNO$N8"Mx$OK\%W%m%0%i%`$N:n<T$G$O$J$/!$$=$l$>(B
- $B$l$NF~=PNO$r@8@.$7$??M$KB0$7$^$9!%$^$?!$K\%W%m%0%i%`$K(B
- $BAH$_9~$^$l$k$?$a$N3HD%%i%$%V%i%j$K$D$$$F$bF1MM$G$9!%(B
+ 5. 本プログラムへの入力となるスクリプトおよび,本プログラ
+ ムからの出力の権利は本プログラムの作者ではなく,それぞ
+ れの入出力を生成した人に属します.また,本プログラムに
+ 組み込まれるための拡張ライブラリについても同様です.
- 6. $BK\%W%m%0%i%`$OL5J]>Z$G$9!%:n<T$OK\%W%m%0%i%`$r%5%]!<%H(B
- $B$9$k0U;V$O$"$j$^$9$,!$%W%m%0%i%`<+?H$N%P%0$"$k$$$OK\%W(B
- $B%m%0%i%`$N<B9T$J$I$+$iH/@8$9$k$$$+$J$kB;32$KBP$7$F$b@U(B
- $BG$$r;}$A$^$;$s!%(B
+ 6. 本プログラムは無保証です.作者は本プログラムをサポート
+ する意志はありますが,プログラム自身のバグあるいは本プ
+ ログラムの実行などから発生するいかなる損害に対しても責
+ 任を持ちません.
diff --git a/ChangeLog b/ChangeLog
index 34929d3a49..cd370918b8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,12747 +1,19906 @@
-Sun Jul 31 22:57:16 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+Sat Dec 1 21:18:19 2012 Koichi Sasada <ko1@atdot.net>
- * enc/Makefile.in (ECHO1): Same as the recent fix in common.mk.
- ":" in a make variable replacement cause a syntax error with
- /usr/ccs/bin/make on Solaris. Uses $(NULLCMD) instead.
+ * test/ruby/test_backtrace.rb: add a test for
+ Thread::Backtrace::Location#inspect.
+ BTW, tests for `caller_locations' are not enough.
+ Any volunteers are welcome.
-Sun Jul 31 22:44:08 2011 Kazuki Tsujimoto <kazuki@callcc.net>
+Sat Dec 1 21:06:58 2012 Koichi Sasada <ko1@atdot.net>
- * configure.in: fix typos.
+ * vm_backtrace.c (location_inspect_m): add
+ Thread::Backtrace::Location#inspect.
+ It same as loc_obj.to_s.inspect.
-Sun Jul 31 21:19:51 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+Sat Dec 1 19:24:09 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mkmf.rb (configuration:ECHO1): Same as the recent fix in
- common.mk.
- ":" in a make variable replacement cause a syntax error with
- /usr/ccs/bin/make on Solaris. Uses $(NULLCMD) instead.
+ * io.c (rb_io_puts): recurse for the argument itself, not converted
+ array elements. [ruby-core:42444] [Bug #5986]
-Sun Jul 31 21:16:02 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+Sat Dec 1 19:01:36 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * complex.c (f_signbit): gcc4 on Solaris DOES have signbit but does
- not have it on header.
+ * marshal.c (w_object, r_object0): call private marshal methods.
+ [Feature #6539]
- * math.c: ditto.
+Sat Dec 1 18:52:22 2012 Eric Hodel <drbrain@segment7.net>
-Sun Jul 31 21:09:04 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+ * lib/rubygems/commands/cleanup_command.rb: Fix cleanup command for
+ multiple gems. [ruby-trunk - #7481] by Kouhei Sutou
+ * test/rubygems/test_gem_commands_cleanup_command.rb: Test for above.
+ * lib/rubygems.rb: Autoload Gem::Source to prevent test failures
- * common.mk (node_name.inc): Use $(Q) for consistency.
+Sat Dec 1 18:17:00 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * Makefile.in (INSNS): ditto.
+ * complex.c (Init_Complex), time.c (Init_Time): make marshal methods
+ private. [Feature #6539]
-Sun Jul 31 20:39:12 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+ * object.c (Init_Object): make remove_instance_variable public.
+ [Feature #6539]
- * common.mk (ECHO1): nmake does not allow parenthesis in make variable
- replacement.
+ * id.c (Init_id), template/id.h.tmpl: add initialize_{copy,clone,dup}
+ and respond_to_missing?.
-Sun Jul 31 20:21:36 2011 "Yuki Sonoda (Yugui)" <yugui@yugui.jp>
+ * vm_method.c (rb_method_entry_make): make above methods private.
+ [Feature #6539]
- * common.mk (ECHO1): ":" in a make variable replacement cause a syntax
- error with /usr/ccs/bin/make on Solaris. Uses $(NULLCMD) instead.
+Sat Dec 1 16:40:22 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * configure.in (NULLCMD): new check.
+ * test/ruby/test_thread.rb: move ConditionVariable related test
+ into test/thread/test_cv.rb.
+ * test/thread/test_cv.rb: new file.
+ * test/thread/test_cv.rb (test_condvar_empty_signal): new tests.
+ * test/thread/test_cv.rb (test_condvar_empty_broadcast): ditto.
- * Makefile.in (NULLCMD): Reflects checking in configure.
+Sat Dec 1 15:14:25 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * win32/Makefile.sub (NULLCMD): new assignment.
+ * test/ruby/test_thread.rb (test_cv_wait_deadlock): enable
+ cv deadlock test.
-Sun Jul 31 11:31:07 2011 Kazuki Tsujimoto <kazuki@callcc.net>
+Sat Dec 1 14:23:33 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * backport r32768 from trunk.
+ * lib/thread.rb (ConditionVariable): use hash instead of array for
+ @waiters.
+ * test/thread/test_queue.rb (test_sized_queue_and_wakeup): remove
+ a test because @waiters no longer have a chance to duplicated. Now it's
+ a hash.
- * vm.c: check if cfp is valid. [Bug #5083] [ruby-dev:44208]
+Sat Dec 1 17:16:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jul 31 01:23:45 2011 Kenta Murata <mrkn@mrkn.jp>
+ * misc/ruby-electric.el (ruby-electric-curlies): use kill-region
+ instead of interactive command delete-backward-char.
- * backport r32762 from trunk.
+Sat Dec 1 17:12:55 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/bigdecimal/test_bigdecimal.rb (test_version): removed.
+ * misc/inf-ruby.el (inferior-ruby-mode): fix the
+ compilation-shell-minor-mode configuration. a patch by
+ j2petkov (Jean-Christophe Petkovich) in [ruby-core:46518].
+ [Bug #6742]
-Sat Jul 30 23:51:44 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Sat Dec 1 15:05:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/cmath.rb (cbrt): should return a real number if possible.
+ * dir.c (glob_helper): use NAMLEN() to tell the length of d_name
+ instead of strlen(), which can access beyond the boundary.
-Sat Jul 30 23:48:04 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Sat Dec 1 13:48:13 2012 Eric Hodel <drbrain@segment7.net>
- * ext/date/date_core.c: an issue that is same as [ruby-dev:44071].
- * ext/date/date_strftime.c: identical to [ruby-dev:44112].
+ * lib/rubygems/specification.rb: Don't add default gems to $LOAD_PATH
+ as they are already there.
-Sat Jul 30 23:19:09 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Dec 1 12:22:17 2012 Kouhei Sutou <kou@cozmixng.org>
- * defs/default_gems: separate from tool/rbinstall.rb.
+ * re-added r38053 that is reverted by r38061. Problems by r38053
+ are resolved by r38096. r38096 removed GEM_SKIP configuration.
-Sat Jul 30 23:14:44 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ The below is ChangeLog of r38053:
- * io.c (rb_io_each_byte): rbuf can be refreshed during yield.
- [Bug #5119]
+ * defs/default_gems: Add base directory column.
-Sat Jul 30 22:35:50 2011 Naohisa Goto <ngotogenome@gmail.com>
+ * tool/rbinstall.rb:
+ - Install .gemspecs of default gem to
+ #{GEM_HOME}/specifications/default/.
+ - Update files parameter of .gemspecs by relative path from
+ library directory.
- * strftime.c (NEEDS): avoid SEGV due to integer overflow in
- sparc-solaris2.10 and i686-linux. fix [Bug #4456] [ruby-dev:43284]
+Sat Dec 1 11:09:12 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Sat Jul 30 14:27:00 2011 Kenta Murata <mrkn@mrkn.jp>
+ * variable.c (rb_class_path_no_cache): add a function to get the class
+ path without caching the computed path. Some classes are frozen, and
+ will raise an exception without this.
- * backport r32754 from trunk.
+ * probes.d (cmethod-entry, cmethod-return): separate cmethods from
+ regular methods to match set trace func.
- * ext/bigdecimal/bigdecimal.c (BigDecimal_version): version 1.1.0.
+ * probes_helper.h: refactor macros. Fix probes to avoid calling
+ #inspect when profiling.
- * ext/bigdecimal/bigdecimal.gemspec: turn into a default gem.
+ * insns.def: update for use with new macros.
- * tool/rbinstall.rb: ditto.
+ * vm_eval.c: ditto
-Sat Jul 30 13:52:00 2011 Kenta Murata <mrkn@mrkn.jp>
+ * vm_insnhelper.c: ditto
- * ext/bigdecimal/lib/bigdecimal/util.rb (Rational#to_d):
- revive zero and implicit precision support as a deprecated feature.
+ * test/dtrace/test_singleton_function.rb: fix test for new output.
- * test/bigdecimal/test_bigdecimal_util.rb: modify a test for the above
- change.
+ * test/dtrace/test_cmethod.rb: test the cmethod probes.
- * NEWS: describes the above change.
+Sat Dec 1 09:44:16 2012 Eric Hodel <drbrain@segment7.net>
-Sat Jul 30 10:58:10 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/rdoc/test_rdoc_options.rb: Windows drive letters are
+ case-insensitive.
- * vm.c (th_init): preallocate alternative stack.
- NoMemoryError is better than rb_bug, of course.
- Patch by Eric Wong. [ruby-core:38572][ruby-core:38594].
+Sat Dec 1 09:42:13 2012 Eric Hodel <drbrain@segment7.net>
- * signal.c (rb_register_sigaltstack): ditto.
+ * lib/rubygems.rb: Search for gem deps file up the directory tree.
+ * test/rubygems/test_gem.rb: Test for above.
- * vm_core.h: moved ALT_STACK_SIZE definition from signal.c.
- * vm.c (thread_free): use xfree() instead of free().
+Sat Dec 1 09:33:32 2012 Eric Hodel <drbrain@segment7.net>
-Sat Jul 30 07:20:49 2011 Tanaka Akira <akr@fsij.org>
+ * test/runner.rb: Set GEM_HOME, GEM_PATH and GEM_SKIP to empty set.
+ With default_gem support in RubyGems GEM_SKIP prevents loading of
+ built-in gems.
- * ext/socket/lib/socket.rb (udp_server_sockets): unused variable
- removed.
- patch by Jeremy Evans. [ruby-core:38600]
+Sat Dec 1 07:16:17 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Fri Jul 29 23:56:32 2011 Tanaka Akira <akr@fsij.org>
+ * compile.c (ADD_CATCH_ENTRY): add a cast to fix SEGV with x64 mingw
+ on Windows 8. Without cast, 0 might be non zero value at higher bits
+ in rb_ary_new3().
+ [ruby-core:50258] [Bug #7456]
- * lib/securerandom.rb: call OpenSSL::Random.seed at the
- SecureRandom.random_bytes call.
- based on the patch by Masahiro Tomita. [ruby-dev:44270]
+Sat Dec 1 04:07:57 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Jul 29 20:48:39 2011 Tanaka Akira <akr@fsij.org>
+ * parse.y (parser.utf8): remove unused property.
- * ext/socket/mkconstants.rb: fix typos.
+ * parse.y (UTF8_ENC): remove unused macro.
-Fri Jul 29 20:28:56 2011 Tanaka Akira <akr@fsij.org>
+ * parse.y (parser_tokadd_utf8): use rb_utf8_encoding() directly.
- * ext/socket/mkconstants.rb: use whitespaces as a separator.
+Sat Dec 1 03:49:45 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Fri Jul 29 18:59:07 2011 Tanaka Akira <akr@fsij.org>
+ * lib/sync.rb (Sync_m#sync_synchronize): add Thread.async_interrupt_timing
+ for protecting from async interrupt.
+ * lib/sync.rb (Sync_m#sync_lock): ditto.
- * ext/socket/mkconstants.rb: add documents for constants.
- patch by Eric Hodel. [ruby-core:37853] [Bug #4989]
+Sat Dec 1 03:38:04 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Mon Jul 25 23:51:01 2011 Yusuke Endoh <mame@tsg.ne.jp>
+ * lib/thread.rb (ConditionVariable#broadcast): s/RuntimeError/StandardError/
+ * lib/thread.rb (ConditionVariable#signal): ditto.
- * backport r32671 from trunk.
+Sat Dec 1 03:29:52 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * proc.c: pre-allocate the unlinked_method_entry_list_entry struct to
- avoid memory allocation during GC. based on a patch from Eric Wong.
- [ruby-core:38498]
+ * lib/thread.rb (SizedQueue#pop): rewrite by using ConditionVariable.
+ * lib/thread.rb (SizedQueue#push): ditto.
+ * lib/thread.rb (SizedQueue#max): ditto.
+ * lib/thread.rb (Queue#pop): ditto.
+ * lib/thread.rb (Queue#push): ditto.
-Mon Jul 25 22:36:11 2011 Yusuke Endoh <mame@tsg.ne.jp>
+ * lib/thread.rb (SizedQueue#num_waiting): adopt the above changes.
+ * lib/thread.rb (SizedQueue#initialize): ditto.
+ * lib/thread.rb (Queue#num_waiting): ditto.
+ * lib/thread.rb (Queue#initialize): ditto.
+ * test/thread/test_queue.rb (test_sized_queue_and_wakeup): ditto.
- * backport r32669 from trunk.
+Sat Dec 1 03:45:47 2012 Koichi Sasada <ko1@atdot.net>
- * proc.c (struct METHOD), gc.c (gc_marks), vm_method.c
- (rb_gc_mark_unlinked_live_method_entries): fix SEGV bug.
- rb_method_entry_t was free'd even when the method is still on the
- stack if it is BMETHOD (i.e., Method#call). This is because
- rb_method_entry_t is embedded in struct METHOD. This commit
- separates them and marks the live method entries.
- See [ruby-core:38449] in detail. fix [Bug #5047] [ruby-core:38171]
+ * thread.c (Thread.async_interrupt_timing): fix RDoc.
+ :never is not used any more.
-Thu Jul 28 23:36:28 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+Sat Dec 1 02:56:19 2012 Koichi Sasada <ko1@atdot.net>
- * ext/fiddle/closure.c (callback): use rb_ary_tmp_new() instead of
- xmalloc() to allocate an array for arguments of callback procedure,
- to prevent arguments from being swept by GC. [ruby-core:38546]
- [Bug #4929]
+ * iseq.c: add RubyVM::InstructionSequence (ISeq) inspection methods.
+ * ISeq#path returns path of this ISeq written.
+ * ISeq#absolute_path returns absolute path.
+ * ISeq#label returns label (method name and so on).
+ * ISeq#base_label returns base label (see Thread::Backtrace::Location).
+ * ISeq#first_lineno returns first line number of this ISeq.
+ * ISeq.of(obj) returns ISeq object which obj (Proc or Method)
+ is contains.
-Thu Jul 28 22:51:27 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+ * test/ruby/test_iseq.rb: add tests.
- * backport r32723 from trunk.
+Sat Dec 1 02:58:51 2012 Eric Hodel <drbrain@segment7.net>
- * ext/openssl/ossl_cipher.c (ossl_cipher_initialize): Avoid possible
- SEGV from AES encryption/decryption. Processing data by
- Cipher#update without initializing key (meaningless usage of Cipher
- object since we don't offer a way to export a key) could cause SEGV.
+ * include/ruby/ruby.h (rb_event_flag_t): Maintain integer precision
+ for clang error (VALUE aka unsigned long vs unsigned int)
- In OpenSSL, the EVP which has EVP_CIPH_RAND_KEY flag (such as DES3)
- allows uninitialized key, but other EVPs (such as AES) does not
- allow it. Calling EVP_CipherUpdate() without initializing key causes
- SEGV so we set the data filled with "\0" as the key by default. See
- #2768.
+Sat Dec 1 02:53:18 2012 Eric Hodel <drbrain@segment7.net>
- * test/openssl/test_cipher.rb: test it.
+ * test/rubygems/test_gem_dependency_installer.rb: Use Gem.read_binary
+ instead of File.binread for ruby 1.8 compatibility in the rubygems
+ source repository. Updates r38075
-Thu Jul 28 04:53:31 2011 Eric Hodel <drbrain@segment7.net>
+Sat Dec 1 02:33:20 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/delegate.rb: Move file-level documentation to the appropriate
- classes.
+ * thread.c (rb_threadptr_interrupt_mask, async_interrupt_timing_func):
+ merge into them into rb_thread_s_async_interrupt_timing.
+ * thread.c (rb_thread_s_async_interrupt_timing): ditto.
-Thu Jul 28 00:33:47 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Sat Dec 1 02:11:47 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/fileutils/test_fileutils.rb: add OpenBSD case.
- patched by Jeremy Evans [ruby-core:38530] see #5097
+ * thread.c (rb_threadptr_interrupt_mask): add argument check.
+ * thread.c (async_interrupt_timing_arg_check_i): helper function
+ for the above.
+ * test/ruby/test_thread.rb (test_async_interrupt_timing_invalid_argument):
+ test for the above.
- * test/ruby/test_process.rb: ditto.
+Sat Dec 1 01:19:34 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Wed Jul 27 17:59:46 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/thread.rb (ConditionVariable#broadcast): protect from
+ async interrupt by using Thread.async_interrupt_timing.
+ * lib/thread.rb (ConditionVariable#signal): ditto.
+ * lib/thread.rb (ConditionVariable#wait): ditto.
- * include/ruby/missing.h: define __syscall if the platform has
- __syscall in the library but doesn't define it in headers
- for example Mac OS X.
+Sat Dec 1 02:04:23 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Wed Jul 27 15:39:14 2011 Eric Hodel <drbrain@segment7.net>
+ * test/ruby/envutil.rb (Test::Unit::Assertions#assert_in_out_err):
+ raise if assert_in_out_err misused.
- * object.c: Add usage documentation for BasicObject. Based on patch
- by Thomas Sawyer. [Ruby 1.9 - Bug #5067]
+Sat Dec 1 02:08:16 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Jul 27 12:24:17 2011 Eric Hodel <drbrain@segment7.net>
+ * test/rdoc/test_rdoc_rubygems_hook.rb
+ (TestRDocRubygemsHook#test_setup_unwritable): 1. check the existance
+ of the file(directory) before touch it. 2. remove test
+ file(directory) after the test. see [ruby-core:50388].
- * lib/rubygems/uninstaller.rb: Add missing require and update
- messaging to avoid confusion with uninstall --format-executable.
- [Ruby 1.9 - Bug #4062]
+Sat Dec 1 01:51:06 2012 Koichi Sasada <ko1@atdot.net>
-Wed Jul 27 10:47:57 2011 Eric Hodel <drbrain@segment7.net>
+ [EXPERIMENTAL]
+ * iseq.c: add following two methods.
+ * ISeq#line_trace_all returns all line traces (line numbers)
+ * ISeq#line_trace_specify(pos, set) set `pos'th line event to
+ specified_line event (if set is true).
+ These features are introduced for debuggers (mainly to make
+ breakpoint).
- * lib/rubygems: Update to RubyGems 1.8.6.1.
+ * iseq.h: add decl. of C APIs.
-Wed Jul 27 10:04:06 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * test/ruby/test_iseq.rb: add tests.
- * backport r32690 from trunk.
+ * vm_trace.c: add `specified_line' event.
- * test/openssl/test_pkcs12.rb: Add test and intermediate certificates.
- [ Ruby 1.9 - Feature #3793 ] [ruby-core:32088]
+ * include/ruby/ruby.h: ditto.
-Sat Jul 27 01:26:00 2011 Kenta Murata <mrkn@mrkn.jp>
+Sat Dec 1 01:49:52 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * NEWS: add changes of bigdecimal and bigdecimal/util.
+ * test/rubygems/test_gem_dependency_installer.rb: gems are of course
+ binary files, so use a binary reading method when reading it.
+ see [ruby-core:50388].
-Wed Jul 27 01:13:00 2011 Kenta Murata <mrkn@mrkn.jp>
+Sat Dec 1 01:21:07 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/bigdecimal/lib/bigdecimal/util.rb (Rational#to_d):
- zero or negative precision is error. fixes #5098.
- [ruby-dev:44210]
+ * lib/rubygems/command.rb (Gem::Command#get_all_gem_names_and_versions):
+ who assumes that the pathname of a gem never contains ':' ?
+ yes, on Unixen pathnames can contain ':', and on Windows they almost
+ certainly contain ':'. see [ruby-core:50388].
- * ext/bigdecimal/lib/bigdecimal/util.rb (Float#to_d): modified for
- specifying precision. fixes #5098. [ruby-dev:44210]
+ * lib/rubygems/requirement.rb (Gem::Requirement::PATTERN_RAW): extract
+ the regexp to match the version specifier from PATTERN to use in
+ above method.
- * ext/bigdecimal/lib/bigdecimal/util.rb (Integer#to_d): added
- for symmetry to BigDecimal() function with an Integer.
- fixes #5098. [ruby-dev:44210]
+Sat Dec 1 00:48:19 2012 Naohisa Goto <ngotogenome@gmail.com>
- * ext/bigdecimal/lib/bigdecimal/util.rb (BigDecimal#to_d): added
- for adapting other Numeric subclasses. [ruby-dev:44245]
+ * ext/fiddle/extconf.rb, ext/fiddle/function.c
+ (Fiddle::Function::STDCALL): FFI_STDCALL is not a macro, but an
+ enumeration. [ruby-core:50398] [Bug #7483]
- * test/bigdecimal/test_bigdecimal_util.rb: add tests for the above
- changes.
+Sat Dec 1 00:08:55 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Jul 27 00:54:38 2011 Kenta Murata <mrkn@mrkn.jp>
+ * test/rubygems/test_gem_installer.rb
+ (TestGemInstaller#test_check_executable_overwrite_other_non_gem):
+ on Windows, rubygems always generate a wrapper .bat file when
+ installing a file into bin, so testing no-overwrite a wrapper file
+ and a non-wrapper file is nonsense. see [ruby-core:50388].
- * bigdecimal/bigdecimal.c (VpDup) a new function for duplicating
- a BigDecimal.
+Fri Nov 30 23:39:58 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * bigdecimal/bigdecimal.c (BigDecimal_new): support generating a new
- BigDecimal from another BigDecimal using BigDecimal global function
- or constructor. [ruby-dev:44245]
+ * test/rubygems/test_gem_installer.rb
+ (TestGemInstaller#test_check_executable_overwrite_default_bin_dir):
+ if the executable to be overwritten was generated by rubygems, the
+ error message differs from the only copied one's.
+ see [ruby-core:50388].
-Mon Jul 25 22:24:09 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+Fri Nov 30 23:27:26 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * backport r32666 from trunk.
+ * test/rubygems/test_gem_ext_ext_conf_builder.rb
+ (TestGemExtExtConfBuilder::test_class_make): reading with binary mode
+ of course introduce \r on Windows. see [ruby-core:50388].
- * lib/xmlrpc/client.rb: Fix possible HTTP header formatting failure by
- 'Basic' header. Long username caused the base64 String truncation in
- HTTP header which is not allowed. See #5046.
+Fri Nov 30 23:11:37 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/xmlrpc/test_webrick_server.rb: test it.
+ * lib/rubygems/specification.rb
+ (Gem::Specification.validate_permissions): don't check executability
+ of the source on Windows. they will be wrapped to .bat files when
+ installing. see [ruby-core:50388].
-Mon Jul 25 15:36:07 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+Fri Nov 30 22:44:14 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/openssl/lib/openssl/{x509.rb,ssl.rb}: Add deprecation warning
- for openssl/{x509,ssl} usage. Users should require "openssl" instead
- of "openssl/ssl" and "openssl/x509". Start of transition period
- introduced by [ruby-dev:38018].
+ * vm_core.h (rb_vm_struct): add thread_destruct_lock field.
+ * thread.c (Init_Thread): ditto.
+ * thread.c (rb_vm_gvl_destroy): ditto.
-Mon Jul 25 13:50:33 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+ * thread.c (thread_start_func_2): make sure vm->running_thread
+ don't point to dead thread.
+ * thread.c (timer_thread_function): close a race against thread
+ destruction. [Bug #4911][ruby-dev:43859]
- * backport r32662 from trunk.
+ * vm_core.h (rb_thread_set_current): reset running time of
+ current thread instead of previous thread. We no longer
+ assume previous running thread still live.
- * ext/openssl/lib/openssl/x509.rb: Cosmetic change: move definition
- introduced in r30152 to x509-internal.rb.
+Fri Nov 30 21:57:43 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Jul 25 13:35:20 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+ * revert r38053 because it causes too many test failures.
+ if you've already installed r38053 or later, remove the installed
+ lib/ruby/gems/2.0.0 directory and reinstall this revision or later.
- * backport r32658 from trunk.
+Fri Nov 30 21:07:56 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/openssl/ossl_ssl.c (ossl_ssl_shutdown): Avoid randomly generated
- SSLError from SSLSocket just after invoking SSLSocket#close.
- OpenSSL's SSL_shutdown could try to send alert packet and it might
- set SSLerr(global error stack) as the result. It causes the next
- SSL read/write operation to fail by unrelated reason.
+ * lib/test/unit/parallel.rb (Test::Unit::Worker.run): wrap LoadError
+ because it's Gem::LoadError sometimes. see [Bug #6882]
- By design, we're ignoring any error at SSL_shutdown() so we clear
- global error stack after SSL_shutdown is called. See #5039.
+Fri Nov 30 20:47:44 2012 Koichi Sasada <ko1@atdot.net>
-Sun Jul 24 20:29:53 2011 Tanaka Akira <akr@fsij.org>
+ * thread.c: TracePoint#self returns invoking/exiting thread object
+ at thread_begin/end event.
- * ext/socket/extconf.rb: refine the recvmsg test.
+ * test/ruby/test_settracefunc.rb: fix test.
-Sun Jul 24 20:02:31 2011 Tanaka Akira <akr@fsij.org>
+Fri Nov 30 19:55:17 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/socket/extconf.rb: fix the recvmsg test.
+ * test/ruby/memory_status.rb (Memory::Win32): use fiddle instead of dl,
+ but I doubt fiddle is not compatible with dl. (if you are interested,
+ see the diff.) [ruby-core:50194] [Bug #7443]
-Sun Jul 24 08:42:51 2011 Tanaka Akira <akr@fsij.org>
+Fri Nov 30 19:37:44 2012 Kouhei Sutou <kou@cozmixng.org>
- * ext/socket/extconf.rb: test recvmsg allocates file descriptors for
- fd passing even with MSG_PEEK.
+ * defs/default_gems: Add base directory column.
- * ext/socket/ancdata.c: use the above test result.
+ * tool/rbinstall.rb:
+ - Install .gemspecs of default gem to
+ #{GEM_HOME}/specifications/default/.
+ - Update files parameter of .gemspecs by relative path from
+ library directory.
-Sun Jul 24 01:24:31 2011 Eric Hodel <drbrain@segment7.net>
+Fri Nov 30 19:30:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * lib/rubygems/specification.rb: Restore behavior of
- Gem::Specification#loaded. [Ruby 1.9 - Bug #5032]
+ * vm_trace.c:
+ tracepoint_attr_return_value (TracePoint#return_value):
+ include `:b_return` for method doc
+ tracepoint_enable_m, tracepoint_disable_m (#enable/#disable):
+ don't have block argument, document block scope
-Sun Jul 24 01:14:49 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Fri Nov 30 18:52:56 2012 Koichi Sasada <ko1@atdot.net>
- * test/rake/test_rake_functional.rb (setup): Use __FILE__ for the base
- directory. Current directory is not the top source directory when
- the building process runs on other than there.
+ * vm_trace.c (tracepoint_disable_m, tracepoint_enable_m):
+ fix block parameter.
+ No argument should be given to a block which is passed
+ to TracePoint#enable (and disable).
- * test/rake/test_rake_rake_test_loader.rb: ditto.
+Fri Nov 30 18:23:26 2012 Koichi Sasada <ko1@atdot.net>
- * test/rake/test_rake_task_argument_parsing.rb
- (test_terminal_width_using_hardcoded_80): hardcoded 80 is used
- when app.unix? is false.
+ * thread.c: rename Thread.control_interrupt
+ to Thread.async_interrupt_timing.
+ The option name `:never' is also changed to `:defer'.
+ [ruby-core:50375] [ruby-trunk - Feature #6762]
-Sun Jul 24 00:42:00 2011 Kenta Murata <mrkn@mrkn.jp>
+ * thread.c: remove Thread.check_interrupt.
+ This method is difficult to understand by name.
- * configure.in: change the default compiler to gcc-4.2 if target os
- is OS X 10.7 (Lion).
+ * thread.c: add Thread.async_interrupted?.
+ This method check any deferred async interrupts.
-Sat Jul 23 17:06:25 2011 Tanaka Akira <akr@fsij.org>
+ * test/ruby/test_thread.rb: change tests for above.
- * io.c (rb_update_max_fd): validate fd.
+Fri Nov 30 18:24:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * ext/socket/rubysocket.h (rsock_discard_cmsg_resource): add
- msg_peek_p argument for the declaration.
+ * vm_trace.c: Documentation for TracePoint API
+ [ruby-core:47243] [Feature #6895]
- * ext/socket/ancdata.c (discard_cmsg): add msg_peek_p argument.
- assume FreeBSD, NetBSD and MacOS X doesn't generate passed fd
- when MSG_PEEK.
- (rsock_discard_cmsg_resource): add msg_peek_p argument.
- (bsock_recvmsg_internal): call rsock_discard_cmsg_resource with
- msg_peek_p argument.
+Fri Nov 30 17:43:50 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/unixsocket.c (unix_recv_io): call
- rsock_discard_cmsg_resource with msg_peek_p argument.
+ * string.c (rb_str_cmp_m): try to compare with to_str result if
+ possible before calling <=> method. [ruby-core:49279] [Bug #7342]
-Sat Jul 23 14:38:28 2011 Eric Hodel <drbrain@segment7.net>
+ * string.c (rb_str_cmp_m): use rb_check_funcall instead of respond_to
+ and call.
- * test/rake*: Remove dependencies on flexmock and session gems.
- [Ruby 1.9 - Bug #4987]
+ * string.c (rb_str_cmp_m): return fixed value, one of -1,0,+1 always.
-Fri Jul 22 21:46:54 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Fri Nov 30 16:19:14 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_insnhelper.c (vm_call_cfunc): added volatile for a workaround
- of cfp consistency error problem on OS X 10.7 (Lion). It's
- suspected llvm optimization bug.
- [Bug #5076] [ruby-dev:44185]
+ * vm_dump.c (rb_vm_bugreport): get rid of calling methods in sigsegv
+ handler. based on a patch by charliesome (Charlie Somerville)
+ [ruby-core:49573] [Bug #7402]
-Fri Jul 22 21:50:16 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Fri Nov 30 16:05:44 2012 Eric Hodel <drbrain@segment7.net>
- * lib/uri/generic.rb (WFKV_): unroll the loop of regexp.
+ * NEWS: Added RubyGems 2.0.0
- * lib/uri/generic.rb (URI.decode_www_form_component): ditto.
+Fri Nov 30 15:24:37 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jul 22 21:49:48 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * parse.y (parser_yylex): fix false usage of local variable, it cannot
+ appear in fname state [ruby-core:49659] [Bug #7408]
- * enum.c (enum_inject): remove empty line to notify rdoc
- Enumerable#reduce is alias. patched by milki@github.
- https://github.com/ruby/ruby/pull/26
+Fri Nov 30 15:20:12 2012 Eric Hodel <drbrain@segment7.net>
-Fri Jul 22 21:49:28 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/rubygems/package.rb: Load YAML for building gems.
+ * test/rubygems/test_gem_commands_contents_command.rb: Sort expected
+ output of default gem contents. Re-fixes r38004 and r38005.
- * lib/webrick/httprequest.rb (WEBrick::HTTPRequest#each):
- Allow HTTP/0.9 request which doesn't has any header or body.
- patched by Felix Jodoin. [ruby-core:38040] [Bug #5022]
+Fri Nov 30 15:15:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Fri Jul 22 21:45:21 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * vm_trace.c (set_trace_func): Formatting of params and events
- * ext/dl/handle.c (dlhandle_sym): clear previous error with dlerror()
- before calling dlsym(). [ruby-dev:44091] [Bug #5021]
+Fri Nov 30 14:45:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Fri Jul 22 19:05:47 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/net/http.rb: Net::HTTP::Patch to list of HTTP Request Classes
+ Patch by Ryunosuke SATO [Fixes #217 on github]
- * parse.y (rb_enc_symname2_p): get rid of potential out-of-bound
- access.
+Fri Nov 30 14:05:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Fri Jul 22 13:55:59 2011 Eric Hodel <drbrain@segment7.net>
+ * lib/cgi.rb: CGI example for HTML generation
+ Patch by Marcus Stollsteimer [ruby-core:50303] [Bug #7465]
- * lib/net/http.rb: Net::HTTP#finish is used to manually close
- connections. [Ruby 1.9 - Bug #5045]
+Fri Nov 30 13:52:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Fri Jul 22 13:51:29 2011 Eric Hodel <drbrain@segment7.net>
+ * time.c: Documentation improvements, grammar and formatting
+ Patch by Bernd Homuth [ruby-core:49203] [Bug #7326]
- * ext/readline/readline.c: Add examples for Readline.completion_proc=.
- [Ruby 1.9 - Bug #5057]
+Fri Nov 30 13:48:33 2012 Eric Hodel <drbrain@segment7.net>
-Fri Jul 22 13:20:33 2011 Eric Hodel <drbrain@segment7.net>
+ * lib/rdoc.rb: Set version to 4.0.0.preview2
+ * lib/rubygems.rb: Set version to 2.0.0.preview2
- * tool/rbinstall.rb (default gems): Install executables into the fake
- gem dir for Gem.bin_path. [Ruby 1.9 - Bug #4485]
+Fri Nov 30 13:11:53 2012 Eric Hodel <drbrain@segment7.net>
-Fri Jul 22 13:03:12 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * lib/rubygems/commands/setup_command.rb: Remove old files on install
+ of RubyGems. (not by rbinstall.rb).
+ * test/rubygems/test_gem_commands_setup_command.rb: Test for above.
- * backport r32609 from trunk.
+Fri Nov 30 12:47:59 2012 Akinori MUSHA <knu@iDaemons.org>
- * ext/openssl/ossl_hmac.c: Revert checking return type of
- HMAC_Init_ex as it is not compatible with OpenSSL < 1.0.0.
+ * lib/abbrev.rb (Abbrev#abbrev): A fixed string prefix pattern
+ should only match the beginning of each word, not the beginning
+ of every line in it.
-Fri Jul 22 11:22:20 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * lib/abbrev.rb (Abbrev#abbrev): Stop using a regexp that causes a
+ false warning. [Bug #7471]
- * backport r32606 from trunk.
+Fri Nov 30 12:30:55 2012 Akinori MUSHA <knu@iDaemons.org>
- * ext/openssl/ossl_digest.c: Check return value of EVP_DigestInit_ex.
- * ext/openssl/ossl_hmac.c: Check return value of HMAC_Init_ex.
- Thanks, Jared Jennings, for the patch.
- [ Ruby 1.9 - Bug #4944 ] [ruby-core:37670]
+ * test/test_abbrev.rb: Add tests for lib/abbrev.rb.
-Fri Jul 22 09:17:43 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+Fri Nov 30 12:27:51 2012 Eric Hodel <drbrain@segment7.net>
- * backport r32604 from trunk.
+ * lib/rubygems/spec_fetcher.rb: Allow prerelease spec fetching to fail
+ for bundler.
+ * test/rubygems/test_gem_spec_fetcher.rb: Test for above.
- * ext/openssl/ossl_engine.c: Avoid double free of ENGINE reference.
- * test/openssl/test_engine.rb: Add a test for it.
- Thanks to Ippei Obayashi for providing the patch.
- [ Ruby 1.9 - Bug #5062 ] [ruby-dev:44173]
+Fri Nov 30 12:20:53 2012 Eric Hodel <drbrain@segment7.net>
-Fri Jul 22 06:39:34 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+ * lib/rake/backtrace.rb: Removed duplication in
+ Rake::Backtrace::SUPPRESSED_PATHS
+ * test/rake/test_rake_backtrace.rb: Skip tests when tmpdir is in the
+ suppressed pattern.
- * lib/csv.rb: Do not modify CSV.generate's argument [ruby-core:38356]
+Fri Nov 30 11:07:45 2012 Shugo Maeda <shugo@ruby-lang.org>
-Thu Jul 21 20:02:11 2011 Yusuke Endoh <mame@tsg.ne.jp>
+ * revert r37993 to avoid SEGV in tests.
- * thread.c (set_trace_func, thread_set_trace_func_m): reset tracing
- state when set_trace_func hook is removed. This is workaround patch
- to force to reset tracing state that is broken by continuation call.
- a patch from James M. Lawrence. [Feature #4347] [ruby-core:34998]
+Fri Nov 30 10:38:54 2012 Eric Hodel <drbrain@segment7.net>
- * test/ruby/test_continuation.rb (class TestContinuation): add a test
- for above. a patch from James M. Lawrence.
+ * lib/rdoc/ri/driver.rb: Relaxed matching for pages to be more
+ user-friendly.
+ * test/rdoc/test_rdoc_ri_driver.rb: Test for above.
-Thu Jul 21 20:59:59 2011 Tanaka Akira <akr@fsij.org>
+Fri Nov 30 09:50:16 2012 Eric Hodel <drbrain@segment7.net>
- * ext/socket/ancdata.c (discard_cmsg): workaround for MacOS X Lion.
+ * lib/rdoc/markdown.rb: Fixed warnings with -w
+Fri Nov 30 09:38:22 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jul 21 07:07:57 2011 Tanaka Akira <akr@fsij.org>
+ * include/ruby/ruby.h (RB_GC_GUARD_PTR): add note.
- * backport r32579, r32581, r32587 by akr and r32588 by kazu.
+ * vm_backtrace.c (backtrace_to_str_ary): use RB_GC_GUARD() instead of
+ RB_GC_GUARD_PTR() which has no effect.
+ (backtrace_to_location_ary): ditto.
+ (vm_backtrace_to_ary): ditto.
- r32579:
+Fri Nov 30 09:22:52 2012 Eric Hodel <drbrain@segment7.net>
- * io.c (rb_update_max_fd): new function.
+ * lib/rubygems/commands/contents_command.rb: Sort output from command.
+ Replaces r38004, r38005
+ * test/rubygems/test_gem_commands_contents_command.rb: ditto.
- * internal.h (rb_update_max_fd): declare rb_update_max_fd.
+ * lib/rubygems/defaults.rb: Use Gem.path_separator for jruby support.
+ * lib/rubygems/path_support.rb: ditto
- * thread_pthread.c (rb_thread_create_timer_thread): update max fd when
- timer thread pipe is created.
+Fri Nov 30 08:34:03 2012 Eric Hodel <drbrain@segment7.net>
- r32581:
+ * lib/rdoc/generator/darkfish.rb: Silenced warning
+ * test/rdoc/test_rdoc_rdoc.rb: ditto
- * io.c (UPDATE_MAXFD): removed.
+ * lib/rdoc/markup/parser.rb: Use byteslice when available for
+ performance
+ * test/rdoc/test_rdoc_markup_parser.rb: Test for above
+ * lib/rdoc/test_case.rb: ditto
- r32587:
+ * lib/rdoc/parser/ruby.rb: Fixed bug parsing yield({})
+ * test/rdoc/test_rdoc_parser_ruby.rb (end):
- * include/ruby/intern.h (rb_update_max_fd): declaration moved from
- internal.h.
+ * lib/rdoc/rubygems_hook.rb: Skip default gems. Display generator
+ name properly.
+ * test/rdoc/test_rdoc_rubygems_hook.rb: Test for above
- * file.c: ditto.
+ * lib/rdoc/servlet.rb: Fixed typo.
- * io.c: call rb_update_max_fd for each new fds.
+Fri Nov 30 08:09:56 2012 Narihiro Nakamura <authornari@gmail.com>
- * process.c: ditto.
+ * gc.c : remove a unused function.
- * random.c: ditto.
+Fri Nov 30 07:46:42 2012 Narihiro Nakamura <authornari@gmail.com>
- * ruby.c: ditto.
+ * gc.c (rb_objspace_call_finalizer): finalize_deferred may free up
+ a object which is reachable from a part after this function,
+ e.g. ruby_vm_destruct(). [ruby-dev:46647] [Bug #7452]
- * ext/io/console/console.c: ditto.
+ * test/ruby/test_gc.rb (test_finalizing_main_thread): add a test
+ for above.
- * ext/openssl/ossl_bio.c: ditto.
+Fri Nov 30 07:43:44 2012 Koichi Sasada <ko1@atdot.net>
- * ext/pty/pty.c: ditto.
+ * thread.c (rb_thread_interrupted): avoid warning of
+ implicit conversion.
- * ext/socket/init.c: ditto.
+ * thread.c (rb_threadptr_execute_interrupts): ditto.
- * ext/socket/socket.c: ditto.
+Fri Nov 30 07:34:28 2012 Koichi Sasada <ko1@atdot.net>
- * ext/socket/ancdata.c: ditto.
+ * vm_backtrace.c: add GC guards.
- * ext/socket/unixsocket.c: ditto.
+Fri Nov 30 07:21:33 2012 Koichi Sasada <ko1@atdot.net>
- r32588:
+ [EXPERIMENTAL: NEED DISCUSS]
+ * vm_trace.c: add events
+ * :thread_begin - hook at thread beginning.
+ * :thread_end - hook at thread ending.
+ * :b_call - hook at block enter.
+ * :b_return - hook at block leave.
+ This change slow down block invocation.
+ Please try and give us feedback until 2.0 code freeze.
- * io.c (rb_update_max_fd): remove parentheses. they are not in
- macro.
+ * include/ruby/ruby.h: ditto.
-Sun Jul 17 08:07:31 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * compile.c (rb_iseq_compile_node): ditto.
- * backport r32563 from trunk
+ * insns.def: ditto.
- * test/openssl/test_ssl_session.rb: add PEM SSL session without TLS
- extensions. Use this as the default for the tests to ensure
- compatibility with OpenSSL 0.9.7.
- [ Ruby 1.9 - Bug #4961 ] [ruby-core:37726]
+ * thread.c: ditto.
-Sat Jul 16 17:29:20 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm.c: ditto.
- * configure.in (RUBY_UNIVERSAL_ARCH): restore arch flag.
- Bug #4977
+ * include/ruby/debug.h: add a comment.
-Sat Jul 16 11:18:26 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/ruby/test_settracefunc.rb: add a tests.
- * win32/setup.mak: support to build x64-mswin64 on Windows7 (and Vista,
- perhaps).
- backported r32521 from trunk
+Fri Nov 30 06:56:30 2012 Ryan Davis <ryand-ruby@zenspider.com>
-Sat Jul 16 06:31:23 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+ * test/minitest/*: Imported minitest 4.3.2 (r8027)
- * lib/uri/common.rb (module): Remove optional parser argument to
- Kernel#URI
- [ruby-core:38061]
+Fri Nov 30 04:16:29 2012 Eric Hodel <drbrain@segment7.net>
- * lib/uri/generic.rb (module): ditto
+ * lib/rake/*: Updated to rake 0.9.5
+ * test/rake/*: ditto.
+ * NEWS: ditto.
-Sat Jul 16 01:15:53 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Fri Nov 30 02:53:47 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * time.c (time_dup): used rb_obj_class() instead of CLASS_OF().
- The patch is made by Kazuki Tsujimoto. [Bug #5012] [ruby-dev:44071]
+ * vm.c: add a return hook when a method raises an exception.
- * test/ruby/test_time.rb (TestTime#test_getlocal_dont_share_eigenclass):
- added a new test for eigenclass of time object.
+ * probes_helper.h: look up klass and method if none are provided.
-Fri Jul 15 19:11:00 2011 Kenta Murata <mrkn@mrkn.jp>
+ * eval.c: update macro usage.
- * bignum.c (bigsub_int): add RB_GC_GUARD. This patch is made by
- Makoto Kishimoto. fixes #4223 [ruby-dev:42907]
+ * vm_eval.c: ditto.
- * bignum.c (bigadd_int): ditto.
+ * vm_insnhelper.c: ditto.
-Fri Jul 15 09:59:12 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+ * test/dtrace/test_function_entry.rb: test for change.
- * backport r32546 from trunk.
+Fri Nov 30 02:27:12 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/digest/sha2/sha2.c (SHA256_Update, SHA512_Update): avoid Bus
- Error caused by unalignment access on Sparc-Solaris (and possibly on
- other similar environment.) This patch just do memcpy always instead
- of checking architecture. I see no perf drop on my 64bit env. For
- more details, see #4320.
+ * compile.c (compile_array_): refix r37991 remove assertion:
+ it is true only if type == COMPILE_ARRAY_TYPE_HASH.
+ [ruby-dev:46658] [Bug #7466]
- * test/digest/test_digest.rb: add test for unalignment access.
+ * vm.c (m_core_hash_from_ary): add assertion instead of above.
+ * vm.c (m_core_hash_merge_ary): ditto.
-Thu Jul 14 12:40:07 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+Thu Nov 29 19:15:14 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * backport r32537 from trunk.
+ * compile.c (compile_array_): hash elements must be paired even for
+ literal elements. [ruby-dev:46658] [Bug #7466]
- * ext/openssl/ossl.c (ossl_verify_cb): trap the exception from
- verify callback of SSLContext and X509Store and make the
- verification fail normally. Raising exception directly from callback
- causes orphan resouces in OpenSSL stack. Patched by Ippei Obayashi.
- See #4445.
+Thu Nov 29 22:39:35 2012 Naohisa Goto <ngotogenome@gmail.com>
- * test/openssl/test_ssl.rb
- (test_exception_in_verify_callback_is_ignored): test it.
+ * ext/openssl/ossl_ssl.c (ssl_npn_encode_protocol_i): fix byte order
+ issue on big-endian architecture [ruby-core:50292] [Bug #7463]
-Wed Jul 13 08:20:08 2011 Shota Fukumori <sorah@tubusu.net>
+Thu Nov 29 22:23:31 2012 Hiroshi Nakamura <nahi@ruby-lang.org>
- * lib/test/unit.rb(Test::Unit::Options#process_args): Fix bug.
- Fix process_args didn't return `@option` after r30939. Backported
- r32526 from trunk.
+ * test/openssl/test_cipher.rb (test_ctr_if_exists): add CTR mode test
+ if underlying OpenSSL supports it. See #4408
-Mon Jul 11 23:50:39 2011 Yutaka Kanemoto <kanemoto@ruby-lang.org>
+Thu Nov 29 21:42:16 2012 Shugo Maeda <shugo@ruby-lang.org>
- * time.c: can't compile time.c on AIX due to missing declaration for
- ffs(). It is declared in strings.h on AIX. backported r32518 from
- trunk.
+ * vm_method.c (rb_method_entry_make): add a method entry with
+ VM_METHOD_TYPE_REFINED to the class refined by the refinement if
+ the target module is a refinement. When a method entry with
+ VM_METHOD_TYPE_UNDEF is invoked by vm_call_method(), a method with
+ the same name is searched in refinements. If such a method is
+ found, the method is invoked. Otherwise, the original method in
+ the refined class (rb_method_definition_t::body.orig_def) is
+ invoked. This change is made to simplify the normal method lookup
+ and to improve the performance of normal method calls.
-Mon Jul 11 23:47:00 2011 Yutaka Kanemoto <kanemoto@ruby-lang.org>
+ * vm_method.c (EXPR1, search_method, rb_method_entry),
+ vm_eval.c (rb_call0, rb_search_method_entry): do not use
+ refinements for method lookup.
- * thread_pthread.c (get_stack): need to adjust stack addr for
- [Bug #1813] on AIX. backported r32511 from trunk.
+ * vm_insnhelper.c (vm_call_method): search methods in refinements if
+ ci->me is VM_METHOD_TYPE_REFINED. If the method is called by
+ super (i.e., ci->call == vm_call_super_method), skip the same
+ method entry as the current method to avoid infinite call of the
+ same method.
-Mon Jul 11 15:17:03 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * class.c (include_modules_at): add a refined method entry for each
+ method defined in a module included in a refinement.
- * numeric.c (rb_num2ull): use FIX2LONG instead of FIX2ULONG. see
- rb_num2ulong(). fixed the problem of ObjectSpace._id2ref of IL32LLP64
- platforms, introduced at r32433.
- backported r32512 from trunk.
+ * class.c (rb_prepend_module): set an empty table to
+ RCLASS_M_TBL(klass) to add refined method entries, because
+ refinements should have priority over prepended modules.
-Sun Jul 10 23:58:55 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+ * proc.c (mnew): use rb_method_entry_with_refinements() to get
+ a refined method.
- * version.h: 1.9.3 is no longer trunk.
+ * test/ruby/test_refinement.rb (test_inline_method_cache): do not skip
+ the test because it should pass successfully.
-Sun Jul 10 23:24:29 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+ * test/ruby/test_refinement.rb (test_redefine_refined_method): new
+ test for the case a refined method is redefined.
- * class.c (rb_mix_module): reverted r31873.
- (check_mix_method_i, do_mix_method_i) reverted r31917.
+Thu Nov 29 17:45:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_module.rb (TestModule#test_mix_const): reverted
- r31918.
+ * variable.c (rb_const_set): show namespace in warning messages.
+ [Feature #7190]
-Sun Jul 10 22:50:00 2011 Kenta Murata <mrkn@mrkn.jp>
+Thu Nov 29 17:31:53 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/bigdecimal/bigdecimal.c (rmpd_power_by_big_decimal): fix
- precision treatment errors.
+ * lib/rubygems.rb (Gem.load_yaml): return if Kernel#gem is not defined
+ yet. This causes crash if test-all requires libraries in a certain
+ order. A simple reproducible code is
+ ruby --disable-gem -e'require"yaml";require"minitest/autorun"'
- * test/bigdecimal/test_bigdecimal.rb: add tests for the above change.
- fix precision treatment errors.
+Thu Nov 29 17:19:26 2012 Eric Hodel <drbrain@segment7.net>
- * ext/bigdecimal/bigdecimal.c (BigDecimal_power): precision argument
- should be optional for its compatibility.
+ * lib/tracer.rb: Updated to match removal of custom_require from
+ RubyGems.
+ * test/test_tracer.rb: ditto. Improved failure message if the test
+ fails
-Sun Jul 10 22:38:09 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Nov 29 17:15:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * parse.y (var_ref): distinguish vcall from local variable
- references. based on a patch by Michael Edgar michael.j.edgar
- AT dartmouth.edu. Bug #5002
+ * gc.c: Documentation for GC, GC::Profiler, ObjectSpace, and
+ ObjectSpace::WeakMap [ruby-core:50245] [Bug #7449]
-Sun Jul 10 21:51:29 2011 Koichi Sasada <ko1@atdot.net>
+Thu Nov 29 17:12:26 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * internal.h: add comments (cautions).
+ * tool/generic_erb.rb, tool/id2token.rb: add --path-separator option
+ for mingw where make and built ruby live in different world.
-Sun Jul 10 20:59:38 2011 Shota Fukumori <sorah@tubusu.net>
+ * tool/vpath.rb: extract from tool/instruction.rb.
- * lib/test/unit.rb: Add new class variable `@@testfile_prefix`.
- This is for changing test name prefix. (For testing)
+Thu Nov 29 17:11:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/testunit/tests_for_parallel/ptest_first.rb: Renamed from
- test_first.rb
+ * test/io/wait/test_io_wait.rb (TestIOWait#fill_pipe):
+ Errno::EWOULDBLOCK may not be the same as Errno::EAGAIN. patch by
+ phasis68 (Heesob Park) at [ruby-core:49894]. [Bug #7420]
- * test/testunit/tests_for_parallel/ptest_second.rb: Renamed from
- test_second.rb
+Thu Nov 29 17:03:38 2012 Eric Hodel <drbrain@segment7.net>
- * test/testunit/tests_for_parallel/ptest_third.rb: Renamed from
- test_third.rb
+ * lib/rubygems/test_case.rb: Determine path to certificates to avoid
+ build-dir problems.
+ * test/rubygems/test_gem_security_signer.rb: Use predetermined paths
+ to avoid build-dir problems.
- * test/testunit/tests_for_parallel/ptest_forth.rb: Renamed from
- test_forth.rb
+Thu Nov 29 16:18:14 2012 Eric Hodel <drbrain@segment7.net>
- * test/testunit/tests_for_parallel/runner.rb: Remove misc.rb
+ * lib/rubygems/test_case.rb: Disable loading of keys and certificates
+ outside rubygems or ruby tests as the files are not available (or
+ necessary).
- * test/testunit/tests_for_parallel/ptest_first.rb: ditto.
+Thu Nov 29 16:14:41 2012 Koichi Sasada <ko1@atdot.net>
- * test/testunit/tests_for_parallel/ptest_second.rb: ditto.
+ * vm_backtrace.c (rb_debug_inspector_open): use RARRAY_LENINT() for
+ int variable.
- * test/testunit/tests_for_parallel/ptest_third.rb: ditto.
+Thu Nov 29 15:59:55 2012 Koichi Sasada <ko1@atdot.net>
- * test/testunit/tests_for_parallel/ptest_forth.rb: ditto.
+ * include/ruby/debug.h: add rb_debug_inspector_* APIs.
- * test/testunit/tests_for_parallel/misc.rb: Removed because no longer
- needed.
+ * vm_backtrace.c: ditto.
- * test/testunit/test_parallel.rb: Fix assertions for above.
+ * common.mk: add dependency from vm_backtrace.o to
+ include/ruby/debug.h.
-Sun Jul 10 16:57:08 2011 Koichi Sasada <ko1@atdot.net>
+ * proc.c (rb_binding_new_with_cfp): constify.
- * vm_insnhelper.c (vm_throw): check a class frame.
- Fixes Bug #4648.
- The patch is contributed by Kazuki Tsujimoto.
+ * vm.c (rb_vm_get_ruby_level_next_cfp): constify.
- * bootstraptest/test_proc.rb: add tests for above.
+ * vm_core.h, vm_trace.c: move decls.
-Sun Jul 10 17:28:01 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Thu Nov 29 15:56:14 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * thread_pthread.c (mutex_debug): use exit(EXIT_FAILURE) instad of
- exit(1).
- * thread_pthread.c (add_signal_thread_list): ditto.
- * thread.c (rb_thread_call_with_gvl): ditto.
- * util.c (Bug): ditto.
+ * lib/rdoc/test_case.rb (RDoc::TestCase#verbose_capture_io):
+ defined for asserts of warnings.
-Sun Jul 10 15:58:12 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/rdoc: use verbose_capture_io on asserts of warnings.
+ they failed when tests was run with RUBYOPT=-W0.
- * ext/json: Merge json gem 1.5.4+ (f7f78896607b6f6226cd).
- [Bug #4700]
+Thu Nov 29 15:53:38 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun Jul 10 16:41:32 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * ext/psych/extconf.rb: added --enable-bundled-libyaml option. this
+ enforces using bundled libyaml.
- * vm_core.h (typedef struct rb_vm_struct): create a new
- 'inhibit_thread_createion' field.
- * thread.c (rb_thread_terminate_all): set inhibit_thread_creation.
- * thread.c (thread_s_new): don't permit to create new thread
- if the VM is under destruction. Otherwise evil finalizer code
- can make SEGV. [Bug #4992][ruby-core:37858]
+Thu Nov 29 15:51:54 2012 Eric Hodel <drbrain@segment7.net>
- * bootstraptest/test_objectspace.rb: new test for this fix.
+ * lib/rubygems*: Updated to RubyGems 2.0
+ * test/rubygems*: ditto.
-Sun Jul 10 16:06:16 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * common.mk (prelude): Updated for RubyGems 2.0 source rearrangement.
- * signal.c (sigsegv): use abort() instead of exit() when nested
- SEGV was happen. Because unnested SEGV use abort().
- [Bug #5013][ruby-dev:44078]
+ * tool/change_maker.rb: Allow invalid UTF-8 characters in source
+ files.
-Sun Jul 10 15:30:00 2011 Kenta Murata <mrkn@mrkn.jp>
+Thu Nov 29 15:38:14 2012 Koichi Sasada <ko1@atdot.net>
- * load.c (rb_f_autoload): prevent to autoload for singleton
- classes. fixes [Bug #4886] [ruby-dev:43816]
+ * include/ruby/debug.h: provide rb_tracearg_*() APIs,
+ instead of rb_tracepoint_attr_*().
+ These APIs are for debuggers/profilers.
+ They will be explained in another docs sometime.
- * bootstraptest/test_autoload.rb: add tests for the above change.
+ * vm_trace.c: ditto.
-Sun Jul 10 15:09:17 2011 Shota Fukumori <sorah@tubusu.net>
+Thu Nov 29 15:10:45 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/test/unit/assertions.rb: Import documentation patch by Justin
- Collins. [ruby-core:37225] [Feature #4903]
+ * test/minitest/test_minitest_unit.rb: restore orig_verbose only
+ if it is set. This broke rdoc's tests.
+ http://u64.rubyci.org/~chkbuild/ruby-trunk/log/20121129T050102Z.diff.html.gz
-Sun Jul 10 14:57:36 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Thu Nov 29 14:56:30 2012 Koichi Sasada <ko1@atdot.net>
- * ext/date/date_core.c: canonicalizes nth and sf.
+ * vm_trace.c (rb_tracepoint_attr_method_id):
+ rename TracePoint#id to TracePoint#method_id.
-Sun Jul 10 14:13:50 2011 Koichi Sasada <ko1@atdot.net>
+ * include/ruby/debug.h: ditto.
- * internal.h (rb_thread_call_with_gvl, rb_thread_call_without_gvl):
- make them visible as experimental C APIs. fixes Feature #4328.
+ * test/ruby/test_settracefunc.rb: ditto,
-Sun Jul 10 12:18:00 2011 Kenta Murata <mrkn@mrkn.jp>
+Thu Nov 29 14:49:10 2012 Koichi Sasada <ko1@atdot.net>
- * ext/bigdecimal/bigdecimal.c (BigDecimal_power): support non-integral
- exponent. fixes [Bug #3271]
+ * vm_trace.c (rb_tracepoint_attr_defined_class):
+ rename TracePoint#klass to TracePoint#defined_class.
+ [ruby-core:50187] Re: [ruby-trunk - Feature #6895]
- * ext/bigdecimal/bigdecimal.c (rmpd_power_by_big_decimal): ditto.
+ * include/ruby/debug.h: ditto.
- * ext/bigdecimal/bigdecimal.c (BigDecimal_power_op): add a function to
- only use for "**" operator.
+ * test/ruby/test_settracefunc.rb: ditto.
- * test/bigdecimal/test_bigdecimal.rb: add a bunch of tests for the
- above changes.
+Thu Nov 29 14:27:57 2012 Koichi Sasada <ko1@atdot.net>
- * ext/bigdecimal/bigdecimal.c (is_integer): add an utility function.
+ * gc.c (gc_stat): prepare Symbol objects at first time
+ to make it fast.
- * ext/bigdecimal/bigdecimal.c (is_negative): ditto.
+Thu Nov 29 14:02:15 2012 Koichi Sasada <ko1@atdot.net>
- * ext/bigdecimal/bigdecimal.c (is_positive): ditto.
+ * gc.c (gc_stat): GC.stat supports new information
+ * total_allocated_object: total allocated object number.
+ * total_freed_object: total freed object number.
+ Above two numbers are only accumulated and they will
+ overflow (return to 0). Please use them as a hint.
- * ext/bigdecimal/bigdecimal.c (is_zero): ditto.
+Thu Nov 29 12:13:54 2012 Ryan Davis <ryand-ruby@zenspider.com>
- * ext/bigdecimal/bigdecimal.c (is_one): ditto.
+ * lib/minitest/*: Imported minitest 4.3.2 (r8026)
+ * test/minitest/*: ditto
- * ext/bigdecimal/bigdecimal.c (is_even): ditto.
+Thu Nov 29 11:06:06 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sun Jul 10 12:08:39 2011 Yusuke Endoh <mame@tsg.ne.jp>
+ * thread.c (thread_start_func_2): remove unused code. When
+ th->safe_level == 4, th->errinfo never be thrown. So, to
+ create new exception makes no sense.
- * compile.c (when_vals): when a string literal is written on when
- clause, skip string creation to make it faster. [ruby-dev:44068]
- [Feature #5000]
+Thu Nov 29 10:29:53 2012 Koichi Sasada <ko1@atdot.net>
-Sun Jul 10 11:35:29 2011 Yusuke Endoh <mame@tsg.ne.jp>
+ * vm_backtrace.c: same as a last patch.
- * parse.y (reduce_nodes_gen): NODE_RETURN in rescue body must not be
- reduced when there is an else clause. This caused bizarre behavior
- in [Bug #4473] [ruby-core:35629] [ruby-core:37884].
+Thu Nov 29 10:24:25 2012 Koichi Sasada <ko1@atdot.net>
-Sun Jul 10 09:46:14 2011 Masaya Tarui <tarui@ruby-lnag.org>
+ * vm_backtrace.c: use `long' for return values of `NUM2LONG()'.
- * range.c (range_max): fix behavior with excluded end value.
- [Bug #4591]
+Thu Nov 29 09:52:08 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Jul 10 09:13:18 2011 Eric Hodel <drbrain@segment7.net>
+ * thread.c (do_select): suppress warning (uninitialized value warning)
+ with UNINITIALIZED_VAR().
- * NEWS: Fix RubyGems version. [Ruby 1.9 - Bug #5004]
+Thu Nov 29 09:36:09 2012 Koichi Sasada <ko1@atdot.net>
-Sat Jul 9 20:01:59 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * eval.c (ruby_cleanup): delay THREAD_KILLED timing.
+ It should be located just before rb_thread_terminate_all().
- * internal.h: rb_rational_reciprocal is defined in rational.c.
+Thu Nov 29 09:10:17 2012 Koichi Sasada <ko1@atdot.net>
-Sat Jul 9 19:48:31 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * vm_backtrace.c (vm_backtrace_to_ary): support range argument
+ like Array#[].
+ [ruby-core:50092] [ruby-trunk - Feature #7434]
+ Test and document is not available. Please help us.
- * internal.h: added declarations.
- * complex.c: followed the above change.
+Thu Nov 29 06:46:33 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sat Jul 9 17:24:41 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * thread.c (thread_start_func_2): small cleanups.
- * NEWS: bigdecimal is not a builtin.
+Thu Nov 29 06:37:08 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sat Jul 9 17:17:53 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * thread.c (thread_start_func_2): remove unused code.
+ this function never be used for main thread.
- * ext/date/date_core.c: some improvements for performance.
+Thu Nov 29 06:27:55 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sat Jul 9 16:56:01 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread.c (thread_start_func_2): remove unused code.
+ errinfo = th->errinfo; and errinfo = rb_errinfo(); are
+ the same.
- * atomic.h (ATOMIC_OR): _InterlockedOr is unavailable in VC6.
+Thu Nov 29 05:26:32 2012 Koichi Sasada <ko1@atdot.net>
- * numeric.c (ULLONG_MAX): fallback definition.
+ * vm_backtrace.c (backtrace_to_str_ary2): rename to backtrace_to_str_ary.
-Sat Jul 9 15:59:19 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_backtrace.c (rb_backtrace_to_str_ary): use `backtrace_to_str_ary()'.
- * win32/win32.c (rb_w32_{read,write}): should be signed.
- Bug #5001
+ * vm_backtrace.c (backtrace_to_frame_ary): rename to
+ backtrace_to_location_ary.
-Sat Jul 9 14:02:20 2011 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
+Thu Nov 29 05:19:25 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/cgi/core.rb: fix multipart form parsing bug. [Bug #3866]
+ * probes.d: Change function-entry probe to method-entry.
+ * insns.def: ditto
+ * probes_helper.h: ditto
+ * test/dtrace/test_function_entry.rb: ditto
+ * test/dtrace/test_singleton_function.rb: ditto
+ * vm.c: ditto
+ * vm_eval.c: ditto
+ * vm_insnhelper.c: ditto
-Sat Jul 9 11:41:03 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+Thu Nov 29 04:45:17 2012 Koichi Sasada <ko1@atdot.net>
- * lib/matrix.rb: Add Vector#normalize [ruby-dev:43829]
+ * vm_backtrace.c: rename Class name from
+ ::RubyVM::Backtrace and ::RubyVM::Backtrace::Location
+ to ::Thread::Backtrace and ::Thread::Backtrace::Location.
-Sat Jul 9 09:25:06 2011 Eric Hodel <drbrain@segment7.net>
+Wed Nov 28 23:52:02 2012 Masaya Tarui <tarui@ruby-lang.org>
- * enumerator.c: Remove "enumeration sequenced by".
- [Ruby 1.9 - Bug #4757]
+ * NEWS (Thread) remove incompatible changes about trap.
-Sat Jul 9 09:14:56 2011 Eric Hodel <drbrain@segment7.net>
+Wed Nov 28 23:39:01 2012 Koichi Sasada <ko1@atdot.net>
- * io.c: Note that methods other than IO#gets may increase IO#lineno.
- [Ruby 1.9 - Bug #4902]
+ * thread.c (rb_mutex_sleep): fix to allow spurious wakeup.
+ [ruby-dev:46654] [ruby-trunk - Bug #7455]
-Sat Jul 9 08:39:39 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * NEWS: write about spurious wakeup.
- * common.mk (RUN_OPT): disable gems.
+Wed Nov 28 22:57:23 2012 Koichi Sasada <ko1@atdot.net>
-Sat Jul 9 08:37:05 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread_win32.c: catch up latest change of BLOCKING_REGION.
- * io.c (rb_io_close): close(2) on a fd which is being read by
- another thread causes deadlock on Mac OS X 10.5
+Wed Nov 28 22:54:21 2012 Koichi Sasada <ko1@atdot.net>
-Fri Jul 8 21:20:39 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * vm_insnhelper.c (vm_call_method): fix undefined behavior.
+ Should not access scope local variable from outer scope.
- * addr2line.c: use USE_ELF instead of __ELF__ because Solaris
- doesn't define it. USE_ELF is already provided by configure.
- patched by Naohisa Goto. [ruby-dev:44066] [Bug #4998]
+Wed Nov 28 22:20:55 2012 Masaya Tarui <tarui@ruby-lang.org>
- * addr2line.h: ditto.
+ * test/ruby/test_thread.rb (test_thread_status_in_trap): change test for
+ thread status in trap. now can accept Thread#join and Thread#value in trap.
- * vm_dump.c: ditto.
+Wed Nov 28 21:58:47 2012 Koichi Sasada <ko1@atdot.net>
-Fri Jul 8 16:40:38 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * include/ruby/thread.h (rb_thread_call_without_gvl2): change
+ meaning of function.
+ This function is called with same parameters of
+ `rb_thread_call_without_gvl()'.
+ However, if interrupts are detected, then return immediately.
- * ext/json/parser/parser.rl (convert_encoding): should not modify
- the argument.
+ * thread.c: implement `rb_thread_call_without_gvl2()'.
- * ext/json/parser/parser.rl (convert_encoding): no needs to use
- force_encoding.
+Wed Nov 28 21:31:21 2012 Masaya Tarui <tarui@ruby-lang.org>
-Fri Jul 8 15:53:31 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread.c (thread_join_sleep): check spurious wakeup by itself for
+ corresponding status change in trap context.
+ * vm_core.h (struct rb_thread_struct): add rb_thread_list_t and use as join_list for
+ reentry by trap context.
+ * thread.c (thread_start_func_2): ditto.
+ * thread.c (remove_from_join_list): ditto.
+ * thread.c (rb_thread_atfork): ditto.
+ * thread.c (thread_join): ditto. & remove trap handler check.
+ * thread.c (sleep_forever): add argument : spurious_check.
+ * thread.c (sleep_timeval): ditto.
+ * thread.c (rb_thread_sleep_forever): set spurious_check.
+ * thread.c (rb_thread_sleep_deadly): ditto.
+ * thread.c (sleep_for_polling): ditto.
+ * thread.c (rb_thread_wait_for): ditto.
+ * thread.c (sleep_wait_for_interrupt): bypass spurious_check.
- * error.c (rb_bug): get rid of segfault after all threads
- disposed.
+Wed Nov 28 21:23:18 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jul 8 15:01:06 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/psych/yaml/emitter.c (yaml_emitter_write_indicator): constify.
- * ext/openssl/ossl.h: include openssl/e_os2.h before checking the
- defition of OPENSSL_SYS_WIN32.
+ * ext/psych/yaml/emitter.c (yaml_emitter_write_block_scalar_hints):
+ ditto.
-Fri Jul 8 14:40:39 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/psych/extconf.rb: mingw32 also needs macros for win32, not
+ only mswin32.
- * win32/win32.c (wunlink): reverted a part of r32426. it was mistakenly
- mixed.
+ * ext/psych/extconf.rb: compile sources in the source directory
+ without copying by using VPATH.
-Fri Jul 8 14:29:47 2011 Narihiro Nakamura <authornari@gmail.com>
+Wed Nov 28 21:18:57 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in: can't subtract void *.
+ * lib/mkmf.rb (MakeMakefile#each_compile_rules): splat $(*VPATH*) for
+ each VPATH elements.
-Fri Jul 8 14:33:26 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Nov 28 16:40:14 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * win32/Makefile.sub (config.h): define GC_MARK_STACKFRAME_WORD.
- fixed build problem of r32438. the value (30) is temporary value.
- maybe it's enough by 20~24 according to my observation.
+ * vm_core.h (enum rb_thread_status): remove THREAD_TO_KILL
+ * vm_core.h (struct rb_thread_struct): add to_kill field
+ * thread.c (terminate_i): convert THREAD_TO_KILL to to_kill.
+ * thread.c (rb_threadptr_to_kill): ditto.
+ * thread.c (rb_thread_kill): ditto.
+ * thread.c (rb_thread_wakeup_alive): ditto.
+ * thread.c (thread_list_i): ditto.
+ * thread.c (static const char): ditto.
+ * thread.c (thread_status_name): ditto.
+ * thread.c (rb_thread_status): ditto.
+ * thread.c (rb_thread_inspect): ditto.
+ * vm_backtrace.c (thread_backtrace_to_ary): ditto.
-Fri Jul 8 13:47:39 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * thread.c (rb_threadptr_execute_interrupts): fix thread status
+ overwritten issue. [Bug #7450] [ruby-core:50249]
+
+ * test/ruby/test_thread.rb (test_hread_status_raise_after_kill):
+ test for the above.
+ * test/ruby/test_thread.rb (test_thread_status_in_trap): test for
+ thread status in trap.
+ * test/ruby/test_thread.rb (test_status_and_stop_p): remove
+ Thread.control_interrupt unsafe test. Thread#kill no longer
+ changes thread status. Instead of, Thread#kill receiver changes
+ their own status when receiving kill signal.
+
+Wed Nov 28 16:21:46 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (struct rb_mutex_struct): add allow_trap field.
+ * internal.h (rb_mutex_allow_trap): added.
+ * thread.c (rb_mutex_lock, rb_mutex_unlock): check mutex->allow_trap.
+ * thread.c (mutex_sleep): remove trap check because it uses
+ rb_mutex_lock and rb_mutex_unlock internally.
+ * thread.c (rb_mutex_allow_trap): new helper function for the above.
+
+ * io.c (io_binwrite): mark fptr->write_lock as writable in trap.
+
+ * test/ruby/test_signal.rb (test_trap_puts): test for the above.
+
+Wed Nov 28 16:59:12 2012 Koichi Sasada <ko1@atdot.net>
+
+ * proc.c: remove Proc#== and Proc#eql?.
+ Proc objects compared with their object ids.
+ [Bug #4559]
- * thread.c (rb_mutex_unlock_all): folded into
- rb_threadptr_unlock_all_locking_mutexes.
- * thread.c (rb_threadptr_unlock_all_locking_mutexes) ditto.
+ * test/ruby/test_proc.rb: remove related test.
+
+Wed Nov 28 16:41:04 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc/servlet.rb: Add support for serving documentation from a
+ subdirectory.
+ * lib/rdoc/generator/darkfish.rb: ditto
+ * test/rdoc/test_rdoc_servlet.rb: Test for above
+ * test/rdoc/test_rdoc_servlet.rb: ditto
+
+Wed Nov 28 15:37:17 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: fix r37294: run only on i[3-6]86-linux.
+
+Wed Nov 28 15:31:11 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (FMODE_SYNCWRITE): removed unused macro.
+
+Wed Nov 28 15:19:25 2012 Naohisa Goto <ngotogenome@gmail.com>
+
+ * configure.in: revert r37911, r37906 and r37904 which break build
+ with non-gcc and/or non-IA32 compilers, e.g. Solaris Studio,
+ Fujitsu C Compiler. [ruby-dev:46646] [Bug #7451]
+
+Wed Nov 28 14:50:55 2012 Koichi Sasada <ko1@atdot.net>
+
+ * ext/psych/extconf.rb: copy sources into build directory,
+ not into srcdir.
+
+Wed Nov 28 14:34:06 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_mutex_lock): moved trap context check from
+ rb_mutex_trylock because try_lock have no change to make
+ a deadlock.
+ * thread.c (rb_mutex_trylock): ditto.
+ * NEWS: news for the above.
+
+Wed Nov 28 13:39:54 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (thread_s_new): uses main_thread->status instead of
+ th->inhibit_thread_creation for preventing thread creation.
+ * vm_core.h (rb_vm_struct): remove inhibit_thread_creation field.
+ * thread.c (rb_thread_terminate_all): ditto.
+
+Wed Nov 28 13:27:29 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/extconf.rb: use embedded libyaml if no system libyaml is
+ found. [ruby-core:49463]
+ * ext/psych/lib/psych.rb: updating to psych 2.0.0
+ * ext/psych/lib/psych/deprecated.rb: updated docs
+ * ext/psych/psych.gemspec: updated to psych 2.0.0
+ * ext/psych/psych.h: fixing header file include for rename
+ * ext/psych/psych_emitter.c: renamed to avoid libyaml conflict.
+ * ext/psych/psych_emitter.h: ditto
+ * ext/psych/psych_parser.c: ditto
+ * ext/psych/psych_parser.h: ditto
+ * ext/psych/psych_to_ruby.c: ditto
+ * ext/psych/psych_to_ruby.h: ditto
+ * ext/psych/psych_yaml_tree.c: ditto
+ * ext/psych/psych_yaml_tree.h: ditto
+ * ext/psych/yaml/LICENSE: embedding libyaml 0.1.4
+ * ext/psych/yaml/api.c: ditto
+ * ext/psych/yaml/config.h: ditto
+ * ext/psych/yaml/dumper.c: ditto
+ * ext/psych/yaml/emitter.c: ditto
+ * ext/psych/yaml/loader.c: ditto
+ * ext/psych/yaml/parser.c: ditto
+ * ext/psych/yaml/reader.c: ditto
+ * ext/psych/yaml/scanner.c: ditto
+ * ext/psych/yaml/writer.c: ditto
+ * ext/psych/yaml/yaml.h: ditto
+ * ext/psych/yaml/yaml_private.h: ditto
+
+Wed Nov 28 12:54:59 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (thread_join): A trap handler check was moved from
+ thread_join_m because Thread#value should be raised an exception
+ too.
+ * thread.c (thread_join_m): remove trap handler check.
+ * test/ruby/test_thread.rb (test_thread_join_in_trap): add test
+ for thread#value.
+ * NEWS: documentation fix for the above.
+
+Wed Nov 28 11:07:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * ext/fiddle/closure.c: Documentation for Fiddle
+ * ext/fiddle/lib/fiddle/import.rb: ditto
+ * ext/fiddle/lib/fiddle/value.rb: ditto
+ * ext/fiddle/lib/fiddle/pack.rb: ditto
+ * ext/fiddle/lib/fiddle/cparser.rb: ditto
+ * ext/fiddle/lib/fiddle/struct.rb: ditto
+ * ext/fiddle/lib/fiddle/function.rb: ditto
+
+Wed Nov 28 09:15:51 2012 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * ext/strscan/strscan.c: Added #charpos for multibyte string position.
+ * test/strscan/test_stringscanner.rb: ditto
+
+Wed Nov 28 09:00:34 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/fiddle/fiddle.c: adding alignment constants for compatibility
+ with DL.
+ * ext/fiddle/fiddle.h: ditto
+ * ext/fiddle/lib/fiddle/cparser.rb: importing the C parser for DL
+ backwards compatibility.
+ * ext/fiddle/lib/fiddle/import.rb: importing the import DSL for DL
+ backwards compatibility.
+ * ext/fiddle/lib/fiddle/pack.rb: importing structure pack for DL
+ backwards compatibility.
+ * ext/fiddle/lib/fiddle/value.rb: ditto
+ * ext/fiddle/lib/fiddle/struct.rb: importing struct DSL for DL backwards
+ compatibility.
+ * test/dl/test_c_struct_entry.rb: importing tests
+ * test/dl/test_c_union_entity.rb: ditto
+ * test/dl/test_cparser.rb: ditto
+ * test/dl/test_import.rb: ditto
+ * test/fiddle/test_c_struct_entry.rb: ditto
+ * test/fiddle/test_c_union_entity.rb: ditto
+ * test/fiddle/test_cparser.rb: ditto
+ * test/fiddle/test_import.rb: ditto
-Fri Jul 8 13:36:02 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Wed Nov 28 08:56:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * thread.c (thread_unlock_all_locking_mutexes): rename to
- rb_threadptr_unlock_all_locking_mutexes and remove static.
- * vm_core.h: add rb_threadptr_unlock_all_locking_mutexes declaration.
- * thread.c (thread_start_func_2): adjust the above rename.
+ * doc/globals.rdoc: Add documentation file for magic globals
+ [ruby-core:29048] [Bug #3022]
- * eval.c (ruby_cleanup): call rb_threadptr_unlock_all_locking_mutexes
- again after finalizer. [Bug #4988] [ruby-dev:44049]
+Wed Nov 28 08:55:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Fri Jul 8 13:06:09 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * .document: Add README's to be included with docs
- * cont.c (FIBER_MACHINE_STACK_ALLOCATION_SIZE): Fiber stack size
- don't need to keep multiple number of sizeof(VALUE).
+Wed Nov 28 08:26:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Fri Jul 8 11:39:12 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/dl/lib/dl.rb: Deprecation notice for DL
- * common.mk (sudo-precheck): true command is not standard on
- Windows.
+Wed Nov 28 08:25:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Fri Jul 8 10:39:52 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * ext/fiddle/closure.c: Documentation for Fiddle
+ * ext/fiddle/pointer.c: ditto
+ * ext/fiddle/function.c: ditto
+ * ext/fiddle/lib/fiddle.rb: ditto
+ * ext/fiddle/fiddle.c: ditto
+ * ext/fiddle/handle.c: ditto
- * thread_pthread.c (gvl_destroy): fix cond_t leak.
+Wed Nov 28 04:53:40 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Fri Jul 8 09:17:59 2011 Eric Hodel <drbrain@segment7.net>
+ * ext/fiddle/handle.c: Make Fiddle independent of DL, copy DL::Handle
+ to Fiddle::Handle.
+ * ext/fiddle/pointer.c: Make Fiddle independent of DL, copy
+ DL::Pointer to Fiddle::Pointer.
+ * test/fiddle/test_func.rb: relevant tests
+ * test/fiddle/test_handle.rb: ditto
+ * test/fiddle/test_pointer.rb: ditto
+ * ext/dl/lib/dl/struct.rb: use Fiddle::Pointer if available
+ * ext/fiddle/extconf.rb: check for dlfcn.h
+ * ext/fiddle/fiddle.c: add constants for sizeof() things
+ * ext/fiddle/fiddle.h: include dlfcn.h
+ * ext/fiddle/function.c: expose a C function for creating new
+ Fiddle::Function objects.
+ * ext/fiddle/lib/fiddle.rb: include constants for dl backwards compat
+ * ext/fiddle/lib/fiddle/function.rb: read the pointer from the
+ function for dl backwards compat.
+ * test/dl/test_callback.rb: check the addresses of the pointers rather
+ than their types.
+ * test/fiddle/helper.rb: remove dependency on dl
+ * test/fiddle/test_closure.rb: ditto
+ * test/fiddle/test_fiddle.rb: ditto
- * gc.c: Improve documentation
+Wed Nov 28 03:03:28 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Jul 7 23:35:31 2011 Narihiro Nakamura <authornari@gmail.com>
+ * configure.in (opt-dir): don't use non portable flag -E of sed.
- * gc.c: change water_mark value that may call
- gc_mark(lev <= GC_LEVEL_MAX) in gc_mark().
- In ruby_stack_check(), water_mark is a value that may call some
- C function. Fixes Bug #3781
+Wed Nov 28 02:55:35 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * configure.in: define GC_MARK_STACKFRAME_WORD that approximate
- size of gc_mark() and gc_mark_children() stackframes.
+ * configure.in (ARCH_FLAG): __sync_val_compare_and_swap_4 needs
+ -march=$target_cpu on at least linux gcc 4.1.
+ patched by KOSAKI Motohiro
-Thu Jul 7 17:55:05 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Nov 27 22:03:09 2012 Akinori MUSHA <knu@iDaemons.org>
- * test/testunit/test_parallel.rb (TestParallelWorker#teardown): wait
- the child process even if the communication pipe is broken.
+ * string.c (rb_str_enumerate_chars, rb_str_enumerate_codepoints)
+ (rb_str_enumerate_lines): Dummy initialization of ary has been
+ replaced with UNINITIALIZED_VAR().
-Thu Jul 7 15:44:42 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 27 21:29:00 2012 Kenta Murata <mrkn@mrkn.jp>
- * encoding.c (rb_enc_set_index, rb_enc_associate_index): should
- check if frozen.
+ * bignum.c (bigdivrem): optimize the way to retry calculation of
+ bigdivrem so that the calculation is started from the point where
+ the last interruption was occurred.
- * parse.y (rb_intern3), ruby.c (process_options, ruby_script):
- defer freezing after associating encodings.
+ * bignum.c (bigdivrem1): ditto.
-Thu Jul 7 15:16:51 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/ruby/test_bignum.rb: add a test case for rb_bigdivrem in the
+ case that an interruption is occurred during bigdivrem1 is running.
- * numeric.c (rb_num2ull): use own switch sentence.
- Current implementation can't convert 18446744073709551615.
+Tue Nov 27 19:56:43 2012 Koichi Sasada <ko1@atdot.net>
-Thu Jul 7 06:56:15 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * vm.c (rb_vm_make_env_object): make Proc object if Env is possible
+ to point block.
+ [ruby-core:41038] [ruby-trunk - Bug #5634]
- * cont.c (FIBER_STACK_FLAGS): workaround fix for r32420 on FreeBSD.
+ * vm.c (rb_vm_make_proc): No need to make Proc object here.
-Thu Jul 7 06:46:12 2011 Eric Hodel <drbrain@segment7.net>
+ * bootstraptest/test_proc.rb: add tests.
- * benchmark/driver.rb: Add difference column to report that averages
- across all runs of a benchmark. [Ruby 1.9 - Feature #4982]
+Tue Nov 27 18:51:06 2012 Naohisa Goto <ngotogenome@gmail.com>
-Thu Jul 7 06:19:38 2011 Eric Hodel <drbrain@segment7.net>
+ * ruby_atomic.h (ATOMIC_CAS): added for Solaris and other platforms.
+ * ruby_atomic.h, signal.c (NEED_RUBY_ATOMIC_OPS): renamed from
+ NEED_RUBY_ATOMIC_EXCHANGE.
+ * signal.c (ruby_atomic_compare_and_swap): naive, non-atomic
+ compare-and-swap implementation only used for platforms without
+ valid support for atomic operations.
- * lib/rubygems.rb: Reduce requires to improve `make benchmark`.
- [#4962]
- * lib/rubygems/specification.rb: Delay initialization of rubygems
- until require is called.
+Tue Nov 27 17:43:46 2012 Eric Hodel <drbrain@segment7.net>
-Thu Jul 7 04:31:26 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rdoc/*: Added --root option for building documentation outside
+ the source directory.
+ * test/rdoc/*: ditto
+ * common.mk (rdoc): Added --root to rdoc rule
- * parse.y (arg): rescue_mod is in inverse order from other
- modifiers. patched by michael.j.edgar AT dartmouth.edu at
- [ruby-core:36248]. fixed #4716.
+Tue Nov 27 16:24:45 2012 Eric Hodel <drbrain@segment7.net>
-Thu Jul 7 00:40:16 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/rdoc/test_rdoc_ri_paths.rb: Fixed duplicate path bug which
+ caused windows failures.
- * win32/win32.c (kill): check that the process exited or not before
- terminating it. [Bug #4943]
+Tue Nov 27 16:06:00 2012 Eric Hodel <drbrain@segment7.net>
-Wed Jul 6 23:13:19 2011 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * test/rdoc/test_rdoc_generator_darkfish.rb: Updated tests for windows
+ * test/rdoc/test_rdoc_options.rb: ditto
+ * test/rdoc/test_rdoc_parser.rb: ditto
+ * test/rdoc/test_rdoc_rdoc.rb: ditto
+ * test/rdoc/test_rdoc_ri_driver.rb: ditto
+ * test/rdoc/test_rdoc_servlet.rb: ditto
- * parse.y (opt_call_args): allow trailing comma after assoc
- argument e.g. 'foo(bar:1,)'. fixed #3456
+Tue Nov 27 15:13:51 2012 Eric Hodel <drbrain@segment7.net>
-Wed Jul 6 22:11:12 2011 Shota Fukumori <sorah@tubusu.net>
+ * common.mk (rdoc): Set --debug for rdoc generation in case of bugs
- * test/cgi/test_cgi_header.rb(test_cgi_header_nph): Validate date in
- "Date:" header
+Tue Nov 27 14:56:45 2012 Eric Hodel <drbrain@segment7.net>
-Wed Jul 6 21:29:33 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * lib/rdoc/rubygems_hook.rb: Updated for (upcoming) RubyGems 2
+ import.
+ * test/rdoc/test_rdoc_rubygems_hook.rb: ditto
- * cont.c (fiber_machine_stack_alloc): cleanup pointer arithmetic.
- "size/sizeof(VALUE)" is ugly and easy confusing.
- * cont.c (fiber_initialize_machine_stack_context): ditto.
+Tue Nov 27 13:59:29 2012 Narihiro Nakamura <authornari@gmail.com>
-Wed Jul 6 21:24:53 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * NEWS: add improvements of the garbage collector.
- * cont.c (fiber_machine_stack_alloc): fix mprotect misuse. A stack
- guard page should have PROT_NONE.
- * cont.c (fiber_initialize_machine_stack_context):
- th->machine_stack_maxsize shouldn't be included guard pages size.
- [Bug #4983][ruby-dev:44043]
+Tue Nov 27 13:27:46 2012 Eric Hodel <drbrain@segment7.net>
-Wed Jul 6 21:23:38 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * lib/rdoc*: Updated to RDoc 4.0 (pre-release)
+ * bin/rdoc: ditto
+ * test/rdoc*: ditto
+ * NEWS: Updated with RDoc 4.0 information
- * cont.c (fiber_machine_stack_alloc): use MAP_STACK if it's provided.
+Tue Nov 27 12:17:11 2012 Koichi Sasada <ko1@atdot.net>
-Wed Jul 6 21:22:16 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * thread.c (rb_thread_terminate_all): retry broadcast only when
+ an exception is raised.
- * cont.c (fiber_machine_stack_alloc): use MAP_FAILED instead of -1.
+Tue Nov 27 12:02:25 2012 Koichi Sasada <ko1@atdot.net>
-Wed Jul 6 21:21:05 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * thread.c (rb_thread_terminate_all): broadcast terminate event
+ not only an interrupt exception but any exceptions.
- * cont.c (fiber_machine_stack_alloc): remove unnecessary cast.
+Tue Nov 27 10:55:09 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Wed Jul 6 18:10:13 2011 Shota Fukumori <sorah@tubusu.net>
+ * eval.c (ruby_cleanup): set thread status to THREAD_KILLED
+ for preventing thr.raise.
+ * test/ruby/test_thread.rb (test_main_thread_status_at_exit):
+ test for the above.
- * test/cgi/test_cgi_header.rb(test_cgi_header_nph): Adding space after
- comma.
+Tue Nov 27 10:31:29 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/cgi/test_cgi_header.rb(test_cgi_header_nph): Remove variable
- `now`. Suppress warning.
+ * thread.c (rb_thread_terminate_all): suppress a warning.
-Wed Jul 6 12:18:09 2011 Shota Fukumori <sorah@tubusu.net>
+Tue Nov 27 09:29:11 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/cgi/test_cgi_header.rb(test_cgi_header_nph): Fix bug depends to
- time. The test fails if time past 1 second in line 136-145
+ * thread.c (thread_join): raises ThreadError if target thread
+ is a main thread.
+ * test/ruby/test_thread.rb (test_thread_join_main_thread):
+ test for the above.
+ * NEWS: news for the above.
-Tue Jul 5 15:28:04 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 27 09:24:47 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * parse.y (parser_here_document): should dispatch heredoc_end
- scanner event on an empty here document. fixed Bug#4543.
+ * thread.c (thread_join): raises ThreadError if target thread
+ is a current thread.
+ * test/ruby/test_thread.rb (test_thread_join_current):
+ test for the above.
+ * NEWS: news for the above.
-Tue Jul 5 13:49:26 2011 Yusuke Endoh <mame@tsg.ne.jp>
+Tue Nov 27 09:59:16 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * addr2line.c: fix r32407 to check HAVE_ALLOCA_H.
+ * ext/extmk.rb (extmake): close mkmf.log for each libraries so that
+ failure messages are not mixed.
-Tue Jul 5 14:05:43 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Tue Nov 27 09:58:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/webrick/httpauth/digestauth.rb (_authenticate):
- Literal texts in HTTP ABNF is case-insensitive (RFC2616 2.1),
- and a ample implementation in RFC2617 also ignores the case
- of algorithms. So now this ignores those cases.
- [ruby-dev:43965] [Feature #4936]
+ * ext/digest/*/extconf.rb, ext/openssl/extconf.rb: get git rid of
+ post-1.8 feature require_relative for cross compilation.
+ [ruby-core:50160] [Bug #7439]
- * lib/webrick/httpauth/digestauth.rb (initialize):
- Because of above, opera_hack is useless and removed.
+Tue Nov 27 09:17:59 2012 Koichi Sasada <ko1@atdot.net>
-Tue Jul 5 01:30:01 2011 Yusuke Endoh <mame@tsg.ne.jp>
+ * NEWS: add TracePoint.
- * thread_pthread.c (native_sleep): cut the waiting time up to
- 100,000,000 because Solaris cond_timedwait() return EINVAL if an
- argument is greater than current_time + 100,000,000. This is
- considered as a kind of spurious wakeup. The caller to native_sleep
- should care about spurious wakeup.
+Tue Nov 27 08:16:03 2012 Koichi Sasada <ko1@atdot.net>
-Tue Jul 5 01:24:26 2011 Yusuke Endoh <mame@tsg.ne.jp>
+ * vm_trace.c: rename TracePoint#file and TracePoint#line
+ to TracePoint#path and TracePoint#lineno respectively.
+ They are consistent to RubyVM::Backtrace::Location.
- * cont.c: disable FIBER_USE_NATIVE on Solaris because resuming any
- Fiber caused SEGV. I haven't follow up the issue deeply, but it
- works when disabling the feature.
+ * include/ruby/debug.h: ditto.
-Tue Jul 5 01:22:46 2011 Yusuke Endoh <mame@tsg.ne.jp>
+ * vm_core.h: ditto.
- * addr2line.c: include <alloca.h> to fix a build issue on Solaris.
+ * test/ruby/test_settracefunc.rb: ditto.
-Tue Jul 5 00:49:05 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+Tue Nov 27 08:04:26 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/coverage/coverage.c: resurrect r32071 + add GC guard for
- rb_coverages. [ruby-core:37352] [Bug #4927]
- [ruby-core:36539] [Feature #4796]
+ * thread.c (rb_thread_terminate_all): broadcast eTerminateSignal
+ again when Ctrl-C was pressed. [Feature #1952] [ruby-dev:39107]
- * test/coverage/test_coverage.rb resurrect r32071.
+Tue Nov 27 07:58:03 2012 Koichi Sasada <ko1@atdot.net>
-Mon Jul 4 22:24:46 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * vm_core.h: add members to rb_trace_arg_t:
+ * `klass_solved' represents klass and id is checked.
+ * `line' represents line calculated from cfp.
+ * `file' represents line calculated from cfp.
- * thread_pthread.c (get_stack): For NetBSD/FreeBSD, use
- pthread_attr_getstack() if possible. and, remove an assumption
- of stack growing direction.
+ * vm_trace.c: fix to use above data structures.
+ No need to calculate klass and id, line and file
+ pairs for each trace points.
-Mon Jul 4 20:42:31 2011 Yusuke Endoh <mame@tsg.ne.jp>
+Tue Nov 27 07:47:09 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/coverage/coverage.c: revert r32071. The commit caused SEGV on
- some minor nonfree OS. I have no means of debugging the bug. My
- personal opinion is that such OS should be unsupported unless there
- is an active maintainer. [ruby-core:37352]
+ * thread.c (rb_thread_terminate_all): add RUBY_VM_CHECK_INTS_BLOCKING().
+ Otherwise the loop in this function behave as busy loop because
+ native_sleep() return immediately when RUBY_VM_INTERRUPTED() is true.
- * test/coverage/test_coverage.rb: ditto.
+Tue Nov 27 04:12:49 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jul 4 07:14:12 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/extmk.rb (extmake): git rid of post-1.8 features for cross
+ compilation. [ruby-core:50160] [Bug #7439]
- * thread_pthread.c (get_stack): the return address of get_stack
- must be the highest address of the current thread's stack.
+Tue Nov 27 00:13:41 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Mon Jul 4 06:37:22 2011 Koichi Sasada <ko1@atdot.net>
+ * thread.c (rb_mutex_trylock, rb_mutex_unlock, mutex_sleep):
+ raises ThreadError if called from trap handler as Thread#join.
+ * NEWS: news for the above.
- * include/ruby/intern.h, thread_pthread.c (rb_reserved_fd_p,
- RB_RESERVED_FD_P): added. This C API is to limit to access
- fds which are used by RubyVM internal. In this version of
- CRuby, return 1 if fd is communication pipe.
- If your application needs to close all file descriptors to
- present resource leak, skip internal fds using this C API.
- We also define a macro RB_RESERVED_FD_P(fd). So you can write
- #ifndef RB_RESERVED_FD_P
- #define RB_RESERVED_FD_P(fd) 0
- #endif
- for Ruby 1.9.2 or previous version to write compatible extensions.
- See [ruby-core:37727]
+Mon Nov 26 23:55:33 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * thread_win32.c (rb_reserved_fd_p): added (return 0 for any fds).
+ * NEWS: update for Thread#join incompatible change.
- * io.c (rb_io_initialize): raise ArgumentError if given fd is reserved by Ruby.
+Mon Nov 26 22:44:24 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sun Jul 3 23:43:56 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+ * thread.c (rb_thread_terminate_all): use native_sleep() instead
+ of rb_thread_schedule(). Otherwise, it consume 100% cpu meaninglessly.
+ [Bug #5368] [ruby-dev:44546]
+ * thread.c (thread_start_func_2): last sub-thread wakes up main thread.
- * ext/extmk.rb (extmake): suppresses outputs from extconf.rb.
- (extmake) warns a failure in extconf.rb.
+Mon Nov 26 21:16:04 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sun Jul 3 13:44:51 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_core.h (RUBY_VM_SET_TIMER_INTERRUPT, RUBY_VM_SET_INTERRUPT)
+ (RUBY_VM_SET_FINALIZER_INTERRUPT, RUBY_VM_SET_TRAP_INTERRUPT)
+ (RUBY_VM_INTERRUPTED): use enum symbol instead of immediate value.
+ * thread.c (thread_join_m, rb_threadptr_execute_interrupts): ditto.
+ * signal.c (signal_exec): ditto.
- * array.c (ary_reject_bang): should not remove elements which are
- not yielded. [Bug #2545]
+Mon Nov 26 20:23:20 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sun Jul 3 06:10:26 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * thread.c (thread_join_m): use th->interrupt_mask instead of
+ th->in_trap.
- * thread_pthread.c (get_stack): pthread_attr_getstack() doesn't
- return stack start address, but stack base address. Thus,
- we need to add stack size for getting stack start address.
- And, we don't have to decrease guard size twice.
- * thread_pthread.c (thread_start_func_1): don't use inaccurate
- stack start guess if native_thread_init_stack() can be used.
- [Bug #1813] [ruby-core:24540]
+ * vm_core.h (struct rb_thread_struct): remove in_trap member.
+ * signal.c (signal_exec): ditto.
+ * thread.c (thread_create_core): ditto.
+ * thread.c (Init_Thread): ditto.
-Sun Jul 3 04:50:08 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Mon Nov 26 20:23:49 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * thread_pthread.c (get_stack): add to a care of guard page on Mac
- OS X. [Bug #1813] [ruby-core:24540]
- * signal.c (ruby_signal): SIGBUS use alternative stack too.
- * signal.c (sigbus): On Mac, thread stack overflow makes SIGBUS
- instead of SIGSEGV. thus, added stackoverflow check.
- * signal.c (default_handler): get rid of compilation warning.
- * signal.c (Init_signal): ditto.
+ * test/ruby/test_argf.rb (TestArgf#test_chars): since marshal data is
+ binary, shouldn't pass via text mode. use base64 encoded data.
-Sat Jul 02 08:59:20 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+Mon Nov 26 19:45:18 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/openssl/test_ocsp.rb
- * test/openssl/test_x509_cert.rb: Perform SHA-256 tests only if
- supported by the available OpenSSL version. Versions < 0.9.8 don't
- support it. [ruby-core:37724]
+ * ruby_atomic.h (ATOMIC_CAS): new macro for compare-and-exchange.
-Sat Jul 2 07:17:45 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_core.h (struct rb_thread_struct): add interrupt_mask member.
+ * thread.c (thread_create_core, Init_Thread): initialize
+ th->thread_mask.
- * array.c (rb_ary_reject_bang, rb_ary_delete_if): rejected
- elements should be removed. fixed [Bug #2545]
+ * vm_core.h (RUBY_VM_INTERRUPTED_ANY): new macro for avoiding
+ bare th->interrupt_flag.
+ * vm_core.h (RUBY_VM_INTERRUPTED, RUBY_VM_INTERRUPTED): check
+ th->interrupt_mask.
+ * thread.c (set_unblock_function, rb_thread_schedule): replace
+ th->interrupt_flag with RUBY_VM_INTERRUPTED_ANY()
-Sat Jul 2 01:57:00 2011 Kenta Murata <mrkn@mrkn.jp>
+ * signal.c (signal_exec): set up thread->interrupt_mask for
+ preventing recursive trap handler.
+ * vm_core.h (RUBY_VM_CHECK_INTS, RUBY_VM_CHECK_INTS_BLOCKING): ditto.
- * NEWS: remove a description of Kernel#respond_to? because it has
- been reverted at revision 28564.
+ * thread.c (rb_threadptr_execute_interrupts):
+ don't process interrupt if it is masked.
+ [Bug #6009] [ruby-core:42524]
-Sat Jul 2 00:58:00 2011 Kenta Murata <mrkn@mrkn.jp>
+Mon Nov 26 19:43:42 2012 Koichi Sasada <ko1@atdot.net>
- * NEWS: describe a change of multiplication of Bignum.
+ * iseq.c (make_compile_option_value): add trace_instruction option.
+ a patch by davidbalbert (David Albert).
+ [Bug #6786]
-Fri Jul 1 18:52:31 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Mon Nov 26 19:10:53 2012 Koichi Sasada <ko1@atdot.net>
- * benchmark/bm_app_erb.rb: increase loop count. too short
- measurement time makes less accuracy.
- * benchmark/bm_app_factorial.rb: ditto.
- * benchmark/bm_app_mandelbrot.rb: ditto.
- * benchmark/bm_app_strconcat.rb: ditto.
+ * bootstraptest/test_thread.rb: try to `join' each 100
+ threads.
+ This benchmark seems consuming long time on travis-ci
+ several times (and make `failure').
- * benchmark/bm_io_file_create.rb: ditto.
- * benchmark/bm_io_file_read.rb: ditto.
- * benchmark/bm_io_file_write.rb: ditto.
+Mon Nov 26 18:22:56 2012 Koichi Sasada <ko1@atdot.net>
- * benchmark/bm_so_concatenate.rb: ditto.
- * benchmark/bm_so_lists.rb: ditto.
- * benchmark/bm_so_matrix.rb: ditto.
- * benchmark/bm_so_random.rb: ditto.
- * benchmark/bm_so_sieve.rb: ditto.
+ * common.mk: specify label `built-ruby'.
- * benchmark/bm_vm_thread_mutex1.rb: ditto.
- * benchmark/bm_vm_thread_mutex2.rb: ditto.
- * benchmark/bm_vm_thread_mutex3.rb: ditto.
+ * benchmark/driver.rb: quote path.
- * benchmark/bm_vm1_block.rb: cleanup.
- * benchmark/bm_vm1_const.rb: cleanup.
- * benchmark/bm_vm1_ensure.rb: cleanup.
- * benchmark/bm_vm1_ivar.rb: cleanup.
- * benchmark/bm_vm1_length.rb: cleanup.
- * benchmark/bm_vm1_neq.rb: cleanup.
- * benchmark/bm_vm1_not.rb: cleanup.
- * benchmark/bm_vm1_rescue.rb: cleanup.
- * benchmark/bm_vm1_simplereturn.rb: cleanup.
- * benchmark/bm_vm1_swap.rb: cleanup.
+Mon Nov 26 18:26:28 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * benchmark/bm_vm2_array.rb: cleanup.
- * benchmark/bm_vm2_case.rb: cleanup.
- * benchmark/bm_vm2_defined_method.rb: cleanup.
- * benchmark/bm_vm2_eval.rb: cleanup.
- * benchmark/bm_vm2_method.rb: cleanup.
- * benchmark/bm_vm2_mutex.rb: cleanup.
- * benchmark/bm_vm2_poly_method.rb: cleanup.
- * benchmark/bm_vm2_poly_method_ov.rb: cleanup.
- * benchmark/bm_vm2_proc.rb: cleanup.
- * benchmark/bm_vm2_regexp.rb: cleanup.
- * benchmark/bm_vm2_send.rb: cleanup.
- * benchmark/bm_vm2_super.rb: cleanup.
- * benchmark/bm_vm2_unif1.rb: cleanup.
- * benchmark/bm_vm2_zsuper.rb: cleanup.
+ * signal.c (signal_exec): add volatile to make sure setjmp safe.
- * benchmark/bm_vm_thread_alive_check1.rb: cleanup.
+Mon Nov 26 18:19:47 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Fri Jul 1 15:23:00 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+ * signal.c (signal_exec): suppress "warning: variable 'signum'
+ might be clobbered by 'longjmp' or 'vfork'" warning.
- * lib/matrix: Add LUP decomposition
+Mon Nov 26 18:15:47 2012 Koichi Sasada <ko1@atdot.net>
-Fri Jul 1 15:21:14 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+ * benchmark/driver.rb: accept multiple `-e'.
+ You don't need to use `;' separation character.
+ [ruby-core:50139] [ruby-trunk - Bug #7380]
- * lib/matrix.rb: Allow non integer exponents for Matrix#**
+Mon Nov 26 17:10:04 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Fri Jul 1 15:13:25 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+ * string.c (rb_str_enumerate_chars, rb_str_enumerate_codepoints)
+ (rb_str_enumerate_lines): suppress "may be used uninitialized in
+ this function" warning.
- * lib/matrix: Add Eigenvalue Decomposition
+Mon Nov 26 17:00:12 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Fri Jul 1 15:10:22 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+ * vm_core.h (rb_thread_struct): added 'in_trap' member for marking
+ running trap handler.
+ * signal.c (signal_exec): turn on in_trap when running trap.
+ * thread.c (Init_Thread, thread_create_core): initialize in_trap
+ when creating new threads.
+ * thread.c (thread_join_m): raise ThreadError when running trap
+ handler.Bug [#6416][ruby-core:44956]
+ * test/ruby/test_thread.rb (test_thread_join_in_trap): new test
+ for the above.
- * lib/matrix: Add Matrix#round
+Mon Nov 26 16:36:13 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Jul 1 11:41:12 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * io.c (argf_each_codepoint): add missing ARGF#codepoints [Bug #7438]
- * string.c (tr_trans): free heap ptr when the str is not embedded.
- patched by Eric Wong. [Bug #4956] [ruby-core:37708]
+Mon Nov 26 15:50:29 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Fri Jul 1 11:07:43 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * bignum.c (bigdivrem): restart calculation when bigdivrem1 was
+ interrupted by signal. Otherwise, ruby script may see a garbage
+ value.
- * thread.c (do_select): fix memory leak.
- Patch by Eric Wong. Thank you! [Bug #4953] [ruby-core:37702]
+Mon Nov 26 15:33:02 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Fri Jul 1 08:21:28 2011 Koichi Sasada <ko1@atdot.net>
+ * bignum.c (big_div_struct): added volatile to 'stop' member.
+ Otherwise, "if (bds->stop)" check in bigdivrem1 don't read
+ memory and ignore interrupt.
+ * bignum.c (bigdivrem, rb_big_stop): ditto.
- * vm_insnhelper.c (vm_getivar): check vm state version
- to invalidate inline cache (ivar index).
- fixes Bug #4926.
+Mon Nov 26 12:11:09 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_insnhelper.c (vm_setivar): ditto.
+ * win32/Makefile.sub (DLNOBJ): missing in r37821.
-Fri Jul 1 08:03:15 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Nov 26 10:50:19 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * error.c, thread_pthread.c (WRITE_CONST): suppress warnings
- `ignoring return value'.
+ * test/ruby/test_process.rb (test_setsid): added a few wait for
+ preventing that Process.getsid(io.pid) makes Errno::ESRCH.
-Fri Jul 1 06:41:36 2011 Koichi Sasada <ko1@atdot.net>
+Sun Nov 25 22:34:00 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * thread.c (rb_threadptr_check_signal): only wake up main thread.
+ * array.c (ary_resize_smaller): new function to resize array.
- * thread.c (rb_threadptr_execute_interrupts_common): check signal
- delivery if it is main thread.
- fixes [ruby-dev:44005] [Ruby 1.9 - Bug #4950]
+ * array.c (rb_ary_delete): refactoring to extract a function.
- * bootstraptest/test_fork.rb: add a test for above.
+ * array.c (rb_ary_delete_same): refactoring.
+ It renames function, reduces duplicated code and removes unused
+ code.
- * signal.c (rb_get_next_signal): skip if signal_buff is empty.
- (check signal_buff.size first)
+ * gc.c (wmap_final_func): follow the above change.
- * vm_core.h: remove unused variable rb_thread_t::exec_signal.
+ * internal.h (rb_ary_delete_same): ditto.
- * thread.c (rb_thread_check_trap_pending): check
- rb_signal_buff_size() because rb_thread_t::exec_signal
- is no longer available.
+Sun Nov 25 22:27:33 2012 Benoit Daloze <eregontp@gmail.com>
-Fri Jul 1 03:28:25 2011 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * array.c: fixes for the updated documentation in r35858:
+ Typos and #take/#drop accept to take/drop 0 elements.
- * class.c (Init_class_hierarchy): should name BasicObject
- explicitly.
+Sun Nov 25 19:43:29 2012 Kazuki Tsujimoto <kazuki@callcc.net>
- * variable.c (rb_const_defined_0): should not check for
- superclasses as const_get.
+ * NEWS: add a news about iconv.
-Fri Jul 1 03:24:03 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Sun Nov 25 03:49:23 2012 Akinori MUSHA <knu@iDaemons.org>
- * ext/date/date_core.c: mathn is still alive (should die soon).
+ * lib/set.rb, test/test_set.rb: Move tests embedded in lib/set.rb
+ to test/test_set.rb.
-Thu Jun 30 23:50:00 2011 Kenta Murata <mrkn@mrkn.jp>
+Sun Nov 25 03:44:50 2012 Akinori MUSHA <knu@iDaemons.org>
- * misc/ruby-mode.el (ruby-indent-beg-re): Fix broken regular
- expression. Fixes #4546
+ * string.c (rb_str_each_line, rb_str_lines): String#lines now
+ returns an array instead of an enumerator. Passing a block is
+ deprecated but still supported for backwards compatibility.
+ Based on the patch by yhara. [Feature #6670]
-Thu Jun 30 23:43:30 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * string.c (rb_str_each_char, rb_str_chars): Ditto for
+ String#chars.
- * ext/openssl/ossl.c/.h: Added ossl_x509_name_sk2ary.
- * ext/openssl/ossl.c: Replaced ossl_x509_ary2k by generic macro to
- simplify future conversions.
- * ext/openssl/ossl_ssl.c: Implement SSLSocket#client_ca.
- * test/openssl/test_ssl.rb: Add test for SSLSocket#client_ca.
- Thanks to Ippei Obayashi for providing the patch!
- [ Ruby 1.9 - Feature #4481 ] [ruby-core:35461]
+ * string.c (rb_str_each_codepoint, rb_str_codepoints): Ditto for
+ String#codepoints.
-Thu Jun 30 22:38:58 2011 Koichi Sasada <ko1@atdot.net>
+ * string.c (rb_str_each_byte, rb_str_bytes): Ditto for
+ String#bytes.
- * benchmark/bm_vm2_defined_method.rb: added to measure performance of
- bmethod (method defined by define_method()).
+ * NEWS: Add notes for the above changes.
-Thu Jun 30 22:17:04 2011 Koichi Sasada <ko1@atdot.net>
+Sun Nov 25 02:07:37 2012 Akinori MUSHA <knu@iDaemons.org>
- * vm_insnhelper.c (vm_call_bmethod): fix to hook call/return event
- for methods defined by define_method(). fixes Bug #4613.
+ * test/ruby/envutil.rb (Test::Unit::Assertions#assert_warning)
+ (Test::Unit::Assertions#assert_warn), test/ruby/envutil.rb,
+ test/ruby/test_enumerator.rb, test/ruby/test_io_m17n.rb,
+ test/ruby/test_regexp.rb, test/ruby/test_syntax.rb:
+ assert_warn() and assert_warning() are reversed.
- * thread.c (call_trace_proc): Fix to skip if class is not given (0).
- Note that ID and Class object are passed for call/return event
- if the called method was defined by define_method().
- If you are author of tracer/profiler/debugger, this may be an
- important change. You should check passed class as zero or
- non-zero instead of checking the event type.
+Sat Nov 24 21:08:50 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * test/ruby/test_settracefunc.rb: add a test for above.
+ * gc.c (wmap_final_func): rename variables to clarify the meaning.
+ In wmap2obj the key is WeakRef and the value is referenced object.
+ In obj2wmap the key is referenced object and the value is an array
+ of WeakRef.
-Thu Jun 30 21:18:35 2011 Yutaka Kanemoto <kanemoto@ruby-lang.org>
+ * gc.c (wmap_finalize): ditto.
+ [ruby-core:49044] [Bug #7304]
- * configure.in: Add warnflags for XL/C on AIX during configure
- to avoid [Bug #3971]. See [ruby-core:32859]
+Sat Nov 24 21:01:55 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Thu Jun 30 21:16:04 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * array.c (rb_ary_delete_same_obj): new function for WeakRef.
+ This deletes same objects as item argument in the array.
- * ext/date/date_core.c (m_ajd): refers a constant.
+ * internal.h (rb_ary_delete_same_obj): add a declaration.
-Thu Jun 30 20:54:25 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (wmap_final_func): remove WeakRef object reference from the
+ array. rb_ary_delete() is not usable because it uses rb_equal() to
+ compare object references.
- * ext/io/console/io-console.gemspec: spin-off gem for 1.9.2.
+ * gc.c (wmap_finalize): remove recycled object references from weak
+ map hash properly. How to get object reference from object id was
+ wrong. st_delete() doesn't work properly if key and value arguments
+ are same. The key of obj2wmap is referenced object and the value of
+ obj2wmap is WeakRef array.
-Thu Jun 30 20:36:23 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * gc.c (wmap_aset): obj2wmap should contain WeakRef array in the
+ definition.
- * ext/date/date_core.c: trivial changes.
+ * test/test_weakref.rb
+ (TestWeakRef#test_not_reference_different_object,
+ TestWeakRef#test_weakref_finalize): add tests for above.
+ [ruby-core:49044] [Bug #7304]
-Thu Jun 30 20:12:36 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Nov 24 19:44:41 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * test/ruby/test_module.rb: tests for [Bug #3422] and [Bug #3423].
+ * ext/nkf/nkf-utf8/nkf.c (unicode_iconv_combine): returning flags are
+ nkf_char.
-Thu Jun 30 20:03:39 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Sat Nov 24 19:29:18 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * ext/date/date_core.c: modified doc.
+ * test/ruby/test_rubyoptions.rb (test_usage, test_usage_long):
+ reduced, renamed.
-Thu Jun 30 19:09:19 2011 Koichi Sasada <ko1@atdot.net>
+Sat Nov 24 13:10:14 2012 Koichi Sasada <ko1@atdot.net>
- * thread_pthread.c (thread_timer): ignore unknown errno.
- (we observed that select(2) was canceled by errno=514 on
- boron == Linux/Xen environment)
+ * vm_trace.c (rb_tracepoint_attr_raised_exception): should not check
+ value before event checking.
-Thu Jun 30 17:33:25 2011 Koichi Sasada <ko1@atdot.net>
+ * vm_trace.c (rb_tracepoint_attr_return_value): ditto.
- * ext/objspace/objspace.c (ObjectSpace.count_tdata_objects):
- Fix rdoc. Fixes Bug #3892.
+ * test/ruby/test_settracefunc.rb: add tests for TracePoint#return_value
+ and TracePoint#raised_exception.
- * ext/objspace/objspace.c (ObjectSpace.count_tdata_objects):
- Change key type if the klass of a object is zero (internal object).
- Read rdoc for details.
+Sat Nov 24 12:47:27 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * internal.h: export rb_objspace_data_type_name().
+ * test/ruby/test_process.rb (TestProcess#test_setsid): "./ruby-trunk"
+ doesn't work on all environments. EnvUtil.rubybin would be suitable.
-Thu Jun 30 17:25:08 2011 Koichi Sasada <ko1@atdot.net>
+Sat Nov 24 12:28:04 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * thread_pthread.c (ping_signal_thread_list, thread_timer):
- fix to keep polling state if there are any ping-tasks.
+ * array.c (rb_ary_aref): fix Segmentation fault at TestArray#test_aref
+ on x64 mingw. Variable argument of rb_scan_args() should be a pointer
+ (VALUE *), but 0 of variable argument seems not equal to null pointer
+ on x64 mingw.
-Thu Jun 30 12:25:34 2011 Koichi Sasada <ko1@atdot.net>
+Sat Nov 24 11:47:14 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * thread_pthread.c (rb_thread_create_timer_thread): allocate
- machine stack for the timer thread at least 12KB. FreeBSD 8.2
- AMD64 causes machine stack overflow (SIGSEGV) only with
- PTHREAD_STACK_MIN (maybe defined as 2KB).
+ * process.c (proc_getsid): adds new method for getting session id.
+ Contributed from fumiyas (Fumiyasu SATOH). Thank you!
+ [Feature #6757] [ruby-dev:45977]
+ * configure.in: adds getsid check.
+ * test/ruby/test_process.rb (TestProcess#test_setsid): new test
+ for the above.
+ * NEWS: news for the above.
-Thu Jun 30 09:36:37 2011 Eric Hodel <drbrain@segment7.net>
+Sat Nov 24 10:59:14 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/weakref.rb: Attach documentation to WeakRef and add missing
- documentation
+ * thread.c (thread_create_core): don't use th->thread_id before
+ initialized.
-Thu Jun 30 09:30:14 2011 Eric Hodel <drbrain@segment7.net>
+Sat Nov 24 00:00:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/yaml.rb: Document toplevel YAML and YAML::ENGINE to describe
- Psych vs Syck engines.
+ * ruby.c (proc_options, process_options, ruby_process_options): take
+ care of the case argc is 0, and check if argv has NULL.
+ [ruby-core:49889] [Bug #7423]
-Thu Jun 30 09:21:52 2011 Eric Hodel <drbrain@segment7.net>
+Sat Nov 24 00:00:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/cmath.rb: Hide handle_no_method_error from RDoc.
- * error.c: Document or hide undocumented error classes.
+ * configure.in (--disable-dln): option to disable dynamic linking
+ feature. [ruby-core:37676] [Feature #4946]
-Thu Jun 30 07:49:04 2011 Eric Hodel <drbrain@segment7.net>
+Fri Nov 23 23:44:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * hash.c: Document ENV
+ * lib/mkmf.rb (MakeMakefile#pkg_config): strip all white spaces for
+ mingw64+MSYS pkg-config which erroneously emits extra newlines.
+ [ruby-core:47998] [Bug #7163]
-Thu Jun 30 06:37:43 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Nov 23 17:31:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ruby.c (ruby_init_loadpath_safe): ensure RUBYLIB_PREFIX stored
- before RUBYLIB, even if MANGLED_PATH is enabled. fixed #1679.
- MANGLED_PATH is disabled by the default and will be removed
- completely in the future.
+ * ruby.c (usage): wrap description lines if options are too long.
-Thu Jun 30 06:32:21 2011 Eric Hodel <drbrain@segment7.net>
+Fri Nov 23 11:13:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/drb/drb.rb: Hide deprecated toplevel DRb constants.
+ * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_usage2): refine
+ assertion.
-Thu Jun 30 06:17:02 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_usage2): now
+ --help option is for modern terminals.
- * lib/cmath.rb (CMath.log): second argument: b can be nil.
+Fri Nov 23 10:45:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Thu Jun 30 06:23:28 2011 Eric Hodel <drbrain@segment7.net>
+ * ext/socket/ipsocket.c (IPSocket#peeraddr): Fix example
+ [ruby-core:46429] [Bug #6732]
- * thread.c (ruby_thread_s_pass): Fix typo.
+Fri Nov 23 02:40:00 2012 Zachary Scott <zachary@zacharyscott.net>
-Thu Jun 30 06:16:53 2011 Eric Hodel <drbrain@segment7.net>
+ * lib/cgi/core.rb: Documentation for CGI#header alias
+ Based on a patch by Marcus Stollsteimer
+ [ruby-core:49585] [Bug #7405]
- * lib/rdoc: Update to RDoc 3.8 which contains fixes for documentation
- in trunk.
+Thu Nov 22 23:48:10 2012 Narihiro Nakamura <authornari@gmail.com>
-Thu Jun 30 02:53:26 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * gc.c (is_swept_object): extract from is_dead_object().
- * thread.c (rb_threadptr_execute_interrupts_common): remove
- meaningless native_thread_yield(). It never close a race.
+ * gc.c (rb_gcdebug_print_obj_condition): add the function for debug.
+ This function shows some conditions of given object (e.g.,
+ marked, in heap, swept).
-Thu Jun 30 02:41:47 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * gc.c (rb_gcdebug_sentinel): add the function for debug.
+ This function allow check to inadvertently free up an object.
- * thread.c (rb_thread_schedule_limits): minor optimization.
- eliminate machine context saving when running time is enough small.
+Thu Nov 22 23:45:18 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Thu Jun 30 02:28:11 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * array.c (rb_ary_shared_with_p): fix cache validity check.
+ If #pop or #shift has been called against $: or $", the array will
+ be still shared with the snapshot. We check array length for cache
+ validity.
+ [ruby-core:49518] [Bug #7383]
- * thread.c (rb_thread_schedule_rec): move interrupt_flag check to
- rb_thread_schedule().
- And also rename to rb_thread_schedule_limits() and remove
- sched_depth argument. It's no longer called recursive.
- * thread.c (rb_thread_schedule): add to check interrupt_flag as
- above explained.
+ * test/ruby/test_require.rb
+ (TestRequire#test_require_with_array_pop,
+ TestRequire#test_require_with_array_shift): add tests for above.
- * thread.c (rb_threadptr_execute_interrupts_rec): rename to
- rb_threadptr_execute_interrupts_common() and remove sched_depth
- argument. It's no longer called recursive.
+Thu Nov 22 21:48:48 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * thread.c (rb_thread_sleep): adapt the renaming.
- * thread.c (rb_threadptr_execute_interrupts): ditto.
- * thread.c (rb_thread_execute_interrupts): ditto.
+ * common.mk, win32/Makefile.sub (probes.dmyh): now be made in current
+ (=build) directory if build from the repository.
-Thu Jun 30 01:31:33 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Thu Nov 22 21:34:51 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * thread.c (thread_s_pass): change RDoc description and remove
- a sample code. The actual implementation never behave as explained by
- an example. It's a documentation bug.
+ * test/ruby/test_rubyoptions.rb: added a test.
-Thu Jun 30 00:54:33 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Thu Nov 22 20:32:07 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * thread.c (rb_thread_stop): change RDoc sample code. The old
- example is buggy and may cause deadlock. The patch is
- suggested by Heesob Park <phasis@gmail.com>. Thank you!
- [Bug #3606][ruby-core:31454]
+ * complex.c (string_to_c_strict, string_to_c): check NUL.
+ * rational.c (string_to_r_strict, string_to_r): ditto.
-Thu Jun 30 00:49:53 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Thu Nov 22 20:21:45 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * thread.c (rb_thread_wakeup): change RDoc sample code. The old
- example is buggy and may not display anything by a race.
- The patch is suggested by Heesob Park <phasis@gmail.com>.
- Thank you! [Bug #3606][ruby-core:31454]
+ * Makefile.in (.dmyh.h): removed $(VPATH). GNU make don't
+ recognize suffix rule with VPATH.
-Thu Jun 30 00:43:33 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Thu Nov 22 18:11:27 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * thread.c (rb_thread_run): change RDoc. The old example is buggy
- and may cause deadlock. The patch is suggested by Heesob Park
- <phasis@gmail.com>. Thank you! [Bug #3606][ruby-core:31454]
+ * common.mk, Makefile.in, win32/Makefile.sub (.dmyh.h): nmake merges
+ explicit rules for same target, but not merges explicit rules and
+ implicit rules -- always explicit rules win. So, need to add an
+ explicit rule for probes.h. [Bug #7421] [ruby-core:49839]
-Thu Jun 30 00:30:15 2011 Keiju Ishitsuka <keiju@ishitsuka.com>
+Thu Nov 22 18:01:28 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/cmath.rb: make same exception for Math. fix [Bug #3137].
+ * Makefile.in (probes.o): add -C to ignore #include in probes.d.
-Thu Jun 30 00:03:20 2011 Keiju Ishitsuka <keiju@ishitsuka.com>
+ * probes.d: include vm_opts.h instead of vm_core.h.
- * lib/irb/completion.rb: complement correctly string literal. fix
- [Bug #1145].
+ * vm_opts.h (VM_COLLECT_USAGE_DETAILS): move definition from vm_core.h.
-Wed Jun 29 23:42:51 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Thu Nov 22 17:45:17 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/date/date_core.c: avoided using timev.
- * ext/date/date_strftime.c: ditto.
- * ext/date/date_tmx.h: ditto.
+ * ext/nkf/nkf-utf8: Merge b0a6577a521d1bba5e19853f95d5c4b9be1072b5.
+ Support JIS X 0213 and some bugfixes.
+
+Thu Nov 22 17:39:37 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * tool/gen_dummy_probes.rb: don't change #include, #if and #endif
+ lines. [Bug #7370]
-Wed Jun 29 23:17:57 2011 WATANABE Hirofumi <eban@ruby-lang.org>
+Thu Nov 22 16:58:26 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/openssl/ossl.h (OPENSSL_SYS_WIN32): support for mingw(msys).
+ * Makefile.in: run preprocessor when making probe.h
+ * probes.d: define probe insn and insn__operand only when
+ VM_COLLECT_USAGE_DETAILS is 1. [Bug #7370]
-Wed Jun 29 23:09:14 2011 WATANABE Hirofumi <eban@ruby-lang.org>
+Thu Nov 22 16:20:49 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/tk/extconf.rb (intptr_t, uintptr_t): support for the latest ActiveTcl with mingw.
+ * vm.c: Don't define vm_collect_usage_operand() and
+ static void vm_collect_usage_insn() when disabling
+ VM_COLLECT_USAGE_DETAILS. (refix r37796)
-Wed Jun 29 22:49:10 2011 Keiju Ishitsuka <keiju@ishitsuka.com>
+Thu Nov 22 15:26:02 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/irb/cmd/help.rb: support RDoc 3.7. fix [Bug #3760].
+ * vm_insnhelper.h: partly revert r37631 (DTrace support).
+ "vm usage information is always collected, so uncomment the
+ functions." causes performance impact. [Bug #7370]
+ Off course this revert disables related probes.
-Wed Jun 29 22:04:14 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+Thu Nov 22 14:14:36 2012 Akinori MUSHA <knu@iDaemons.org>
- * lib/tracer.rb: Tracer.on only if required by -r command-line option.
- and consider --disable-gems option.
- * test/test_tracer.rb: add tests for it.
+ * re.c (rb_memsearch_ss): Apply performance improvement to short
+ byte array search for platforms without memmem(3).
+ [Feature #6311] [ruby-dev:45530]
-Wed Jun 29 13:55:36 2011 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Nov 22 12:52:19 2012 Akinori MUSHA <knu@iDaemons.org>
- * variable.c (rb_const_get_0): should not look for superclasses if
- the second optional argument is given for #const_get().
- fix [Bug #3422] [Bug #3423]
+ * test/ruby/test_string.rb (TestString#test_index): Add some
+ corner cases to tests for String#index, which might fail if ruby
+ directly used a buggy memmem(3) implementation.
-Wed Jun 29 12:07:27 2011 Eric Hodel <drbrain@segment7.net>
+Thu Nov 22 08:06:42 2012 Narihiro Nakamura <authornari@gmail.com>
- * math.c: Attach documentation for Math.
- * object.c: Document NIL, TRUE, FALSE.
- * io.c: Improve grammar in ARGF comment. Document STDIN/OUT/ERR.
- Document ARGF global constant.
- * lib/rake: Hide deprecated toplevel constants from RDoc (import from
- rake trunk).
- * lib/thwait.rb: Document ThWait.
- * lib/mathn.rb: Hide Math redefinition from RDoc
- * lib/sync.rb: Add a basic comment for Sync_m, Synchronizer_m, Sync,
- Synchronizer.
- * parse.y: Document SCRIPT_LINES__.
- * hash.c: Document ENV class and global constant.
- * vm.c: Document TOPLEVEL_BINDING.
- * version.c: Document RUBY_* constants.
- * ruby.c: Document DATA and ARGV.
+ * test/ruby/test_gc.rb (test_profiler_clear): fix wrong method
+ calls [Bug #7419] [ruby-core:49828].
-Wed Jun 29 10:13:12 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+Thu Nov 22 02:22:33 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * lib/matrix.rb: Matrix.zero can build rectangular matrices.
- Vector#r should be called #magnitude
+ * NEWS: edited (order etc).
-Wed Jun 29 10:11:08 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+Wed Nov 21 22:52:59 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/matrix.rb: Add Matrix#diagonal?, hermitian?, normal?,
- orthogonal?
- permutation?, symmetric?, {lower|upper}triangular?, unitary?, zero?
+ * ext/io/wait/wait.c (io_wait_readable): add alias wait_readable.
-Wed Jun 29 10:09:35 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+ * ext/io/wait/wait.c (io_wait_writable): this is easier to use than
+ IO.select for a single IO object and is immune to the
+ limitations/inefficiency of select() on platforms where poll/ppoll
+ is available. patched by Eric Wong. [Feature #4646]
- * lib/matrix.rb: Specialize Matrix#find_index to return [row, col]
- and accept the same optional argument as #each
+Wed Nov 21 22:27:52 2012 Narihiro Nakamura <authornari@gmail.com>
-Wed Jun 29 10:07:32 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+ * gc.c (garbage_collect): remove a duplicative probe.
- * lib/matrix.rb: Matrix#each{_with_index} can iterate over a subset
- of the Matrix
+Wed Nov 21 22:08:48 2012 Narihiro Nakamura <authornari@gmail.com>
-Wed Jun 29 06:21:02 2011 Koichi Sasada <ko1@atdot.net>
+ * gc.c (gc_profile_clear): realloc profile records if its size is
+ higher than the threshold, GC_PROFILE_RECORD_DEFAULT_SIZE * 2.
- * thread_pthread.c (native_stop_timer_thread): skip to close
- communication pipe to avoid timing bug (process termination timing).
- The communication pipe will closed by OS.
+Wed Nov 21 21:53:29 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Wed Jun 29 06:09:54 2011 Koichi Sasada <ko1@atdot.net>
+ * complex.c (nucomp_to_c): added.
- * error.c (rb_async_bug_errno): async-safe bug report function.
- In timer thread, signal handler should use it.
- The patch is contributed by Eric Wong <normalperson@yhbt.net>.
- Refs: [ruby-core:37644] and [ruby-core:37647]
+Wed Nov 21 21:35:38 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * thread_pthread.c: use rb_async_bug_errno().
- And replace all fprintf() to write().
+ * include/ruby/util.h: removed extra semicolon in definition of
+ macro.
+ * compile.c: ditto.
+ * cont.c: ditto.
+ * math.c: ditto.
+ * node.c: ditto.
+ * parse.y: ditto.
- * internal.h (rb_async_bug_errno): add decl. of above func.
+Wed Nov 21 18:46:37 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Tue Jun 28 23:46:08 2011 Keiju Ishitsuka <keiju@ishitsuka.com>
+ * rational.c (read_digits): due to a bit tighter rb_cstr_to_inum().
- * lib/tracer.rb: count only non-internal libraries in stack trace,
- ignoring custom_require.
+Wed Nov 21 16:13:37 2012 Koichi Sasada <ko1@atdot.net>
-Tue Jun 28 21:44:58 2011 Keiju Ishitsuka <keiju@ishitsuka.com>
+ * benchmark/bm_so_nsieve_bits.rb: add an encoding pragma because
+ this benchmark using strings (literals) as binary sequence.
+ Now, they are UTF-8 strings. [ruby-dev:46578]
- * lib/irb/ruby-lex.rb: recognize '\char' in ruby statement.
+Wed Nov 21 00:57:43 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Jun 28 20:39:29 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+ * file.c (Init_File): null device definition uses rb_define_const
+ instead of rb_file_const.
- * lib/debug.rb (var_list): Command 'var *' did not work on 1.9(!).
- global_variables, local_variables, and instance_variables returns
- Symbols from 1.9 and need to stringify before evaling it.
- See #4931.
+Wed Nov 21 00:28:18 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Jun 28 19:23:01 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/ruby/test_m17n_comb.rb (test_str_crypt): Use RbConfig to get
+ libc's directory. Patched by Vit Ondruch [ruby-core:49763] [Bug #7312]
- * signal.c: Now, USE_TRAP_SIGMASK depend on HAVE_PTHREAD_SIGMASK.
- The code have already depended on pthread_sigmask since r27464.
+Tue Nov 20 23:28:26 2012 Masaki Matsushita <glass.saga@gmail.com>
-Tue Jun 28 15:09:21 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * marshal.c: add marshal readahead. marshalized Array, Hash and Struct
+ have size at least number of its elements, marshal readahead will
+ read the certain readable length and buffer when it needs more bytes.
+ marshal readahead prevents many calls to IO#getbyte and IO#read,
+ then it enables performance improvement.
+ [ruby-dev:45637] [Feature #6440]
- * lib/benchmark.rb: merge eregon/benchmark.
- https://github.com/eregon/ruby/tree/benchmark
- patched by Benoit Daloze. [ruby-core:37593] [Bug #4940]
+Tue Nov 20 22:35:02 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/benchmark (Benchmark#bmbm): bmbm should be consistent with bm
- for the return value.
+ * Makefile.in (.d.h): replace char * to const char * because somehow
+ current dtrace removes const of function declaration in probes.d.
- * test/benchmark: remove preemptive test instead of skipping
- I removed the preemptive test I wrote for Feature #4197.
- I'll add it back when the implementation will be able to satisfy it.
+Tue Nov 20 21:41:04 2012 Koichi Sasada <ko1@atdot.net>
- * lib/benchmark (Benchmark#bmbm): remove useless explicit call,
- #format is an alias of #to_s test/benchmark: add a test for
- format of long time.
+ * include/ruby/debug.h: introduced.
+ Debugging/profiling features will be located.
- * lib/benchmark: fix label width: always add 1 to ensure there is a
- space delimiter even with times over 100s
- When I asked for Feature #4197, I wanted to make delimiting spaces
- consistent for #bm and #bmbm.
- But with times over 100s, the output contains no space between the
- label and the first time (user).
- Now both ensure there is always a space, even if that means 3 spaces
- with times under 10s (because it is formatted as %10.6f)
+ * vm_trace.c: expose C-level TracePoint APIs.
+ Note that they are experimental.
- * test/benchmark: let labels be a constant
- lib/benchmark (Benchmark#realtime): avoid creating an unused Proc
- lib/benchmark (Benchmark#benchmark): use ensure clause to restore
- STDOUT.sync, as in #bmbm
+ * vm_trace.c, include/ruby/debug.h: rename `rb_hook_flag_t'
+ to `rb_event_hook_flag_t'.
+ Macro names `RUBY_HOOK_FLAG_*' are also renamed to
+ `RUBY_EVENT_HOOK_FLAG_*'.
-Tue Jun 28 13:41:51 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * debug.h, vm_debug.h: rename debug.h to vm_debug.h.
- * thread_win32.c (native_stop_timer_thread): fixed commit miss of
- r32244. grep sources before changing the signature of a function.
+ * common.mk: ditto.
-Tue Jun 28 11:49:14 2011 Koichi Sasada <ko1@atdot.net>
+ * debug.c, main.c, vm_core.h: ditto.
- * thread_pthread.c (consume_communication_pipe):
- Make "buff" as static. (Maybe) "buff" can be shared between
- any caller (any threads) because no one use the read values.
- "buff" (1024 byte) on stack may cause stack overflow on
- several environment (we found a crash on FreeBSD).
- And remove const value "buff_size", and define CCP_READ_BUFF_SIZE
- macro.
+Tue Nov 20 21:12:37 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in (RUBY_DTRACE_AVAILABLE): only check dtrace availability.
+
+ * configure.in (RUBY_DTRACE_POSTPROCESS): restore.
+
+Tue Nov 20 21:22:44 2012 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * test/win32ole/test_win32ole_type.rb (test_implemented_ole_types):
+ IShellDispatch6 bundled in Windows 8. Thanks to phasis68 (Heesob
+ Park). [ruby-core:49580][Bug #7403]
+
+Tue Nov 20 21:06:41 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * complex.c: some improvements.
+ * rational.c: ditto.
+
+Tue Nov 20 21:01:16 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (incs): BSD make cannot deal with non-prefixed dependency
+ and prefixed target.
+
+Tue Nov 20 20:10:23 2012 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * array.c (rb_ary_bsearch): fix rdoc bug (O(n log n) -> O(log n)).
+ Patch by Charlie Somerville. [ruby-core:49661] [Bug #7409]
+
+ * range.c (range_bsearch): ditto.
+
+Tue Nov 20 19:02:44 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c: rename and add TracePoint APIs.
+ (1) TracePoint.new(...){...} creates a new trace point
+ but does not make it enable.
+ (2) TracePoint.trace(...){...} creates a new trace point
+ and enable it (same as old behavior).
+ (3) TracePoint#enable make it enable (renamed from TracePoint#retrace).
+ If block given, when enable only in block.
+ (4) TracePoint#disable make it disable (renamed from TracePoint#untrace).
+ If block given, when disable only in block.
+ (5) TracePoint#enabled? returns this trace is enable or not.
+ [Feature #6895]
+
+ * test/ruby/test_settracefunc.rb: add tests.
+
+Tue Nov 20 18:35:05 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c: add two methods:
+ (1) TracePoint#return_value which returns return
+ value on the :return and :c_return event.
+ (2) TracePoint#raised_exception which returns raised exception
+ value on the :raise event.
+ Each methods raise RuntimeError if it is called at unsupported
+ event.
+ Please review and give us feedback until next preview
+ release (Dec/2012) of Ruby 2.0.0.
+ [Feature #6895]
+
+ * insns.def, vm.c, vm_eval.c, vm_insnhelper.c, eval.c, thread.c:
+ ditto.
+
+ * vm_trace.c, vm_core.h: move definition of rb_trace_arg_t from
+ vm_trace.c to vm_core.h.
+ Caller fills rb_trace_arg_t and pass the pointer of this variable.
+
+ * test/ruby/test_settracefunc.rb: fix tests to test this change.
+
+Tue Nov 20 17:31:12 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: fix dtrace didn't work on darwin.
+
+ * configure.in (RUBY_DTRACE_AVAILABLE): unify RUBY_DTRACE_POSTPROCESS
+ and RUBY_DTRACE_BSD_BROKEN.
+
+Tue Nov 20 15:20:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * file.c (File.extname): Documentation for extname on dotfiles and
+ files ending with a dot. Also, added example for this.
+ [ruby-core:47852] [Bug #7112]
+
+Tue Nov 20 14:19:20 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/ruby/test_signal.rb (TestSignal#test_signame): fix windows
+ test failure. Process.kill on windows can't send a signal to
+ another process.
+
+Tue Nov 20 13:58:11 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (Init_IO): moved all rb_file_const() into file.c.
+ * file.c (Init_File): replace with rb_file_const() with
+ rb_define_const() because RDoc don't care rb_file_const.
+ [Bug #5530]
+
+Tue Nov 20 12:35:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * ruby.c (usage_msg): Fix typo [ruby-core:49205] [Bug #7327]
+
+Tue Nov 20 12:35:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * file.c (File::NULL): Document File::NULL constant
+ [ruby-core:49384] [Bug #7365]
+
+Tue Nov 20 12:05:15 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_read): Windows 8 fixed one of a bug of console
+ API.
+ based on the patch by Heesob Park at [ruby-core:49479] [Bug #7379]
+
+Tue Nov 20 11:14:33 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in (--enable-dtrace): always call RUBY_DTRACE_BSD_BROKEN
+ for portability.
+ As the note, FreeBSD 8 has DTrace as the optional
+ feature (it is enabled by the build option), but doesn't have USDT.
+ FreeBSD 9 has USDT but they are still optional. FreeBSD 10 will
+ enable them by default.
+ The variable $rb_cv_prog_dtrace_g is "yes" only on FreeBSD 9 with
+ optional DTrace or FreeBSD 10. If it is "no", you cannot know
+ whether it doesn't need -G or DTrace is disabled. (by checking
+ error code, you can know)
+
+Mon Nov 19 22:55:48 2012 Naohisa Goto <ngotogenome@gmail.com>
+
+ * configure.in (--enable-dtrace): change help message
+
+Tue Nov 20 11:05:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * lib/tracer.rb (Tracer.trace_func): printf to stdout
+ Patch by Michal Fojtik [ruby-core:45219] [Bug #6490]
+
+Mon Nov 19 21:24:18 2012 Naohisa Goto <ngotogenome@gmail.com>
+
+ * vm_dump.c: not to include probes.h because the code does not depend
+ on it.
+ * common.mk (vm_dump.$(OBJEXT)): remove dependency on probes.h
+
+Tue Nov 20 10:14:22 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_thread_s_check_interrupt): removed redundant
+ GET_THREAD().
+
+Tue Nov 20 10:12:46 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_threadptr_async_errinfo_active_p): added a small
+ comment.
+
+Tue Nov 20 10:05:56 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_thread_blocking_region_end): replaced GET_THREAD()
+ with ruby_thread_from_native(). We don't have GVL here.
+
+Tue Nov 20 09:56:15 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_threadptr_execute_interrupts) removed.
+ * thread.c (rb_threadptr_execute_interrupts_common) renamed to
+ rb_threadptr_execute_interrupts. I.e. unified
+ rb_threadptr_execute_interrupts and rb_threadptr_execute_interrupts_common.
+ * thread.c (rb_thread_schedule, rb_thread_execute_interrupts) s/_common//.
+
+Tue Nov 20 09:48:34 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * signal.c (rb_get_next_signal): removed pointless signal
+ disabling. pthread_sigmask() only changes current thread
+ mask.
+
+Tue Nov 20 09:36:55 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * signal.c (install_sighandler): added comments why we need
+ rb_disable_interrupt().
+
+Tue Nov 20 09:31:33 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * signal.c (rb_disable_interrupt, rb_enable_interrupt): removed
+ USE_TRAP_MASK.
+ * signal.c (trap_arg, trap_ensure): removed.
+ * signal.c (trap, sig_trap): removed pointless signal disabling.
+ We don't need it because we no longer run trap handler on signal
+ handler context.
+
+Tue Nov 20 09:20:49 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * prelude.rb: Moved Mutex#synchronize to
+ * thread.c (rb_mutex_synchronize_m): here. [Bug #4266]
+
+Tue Nov 20 08:36:15 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Jun 28 11:45:30 2011 Eric Hodel <drbrain@segment7.net>
+ * signal.c (sig_signame): implements Signal.signame method
+ [Feature #5613]
+ * test/ruby/test_signal.rb (test_signame): adds test for above
+ * NEWS: add an item about above
+
+Mon Nov 19 16:30:59 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * struct.c (rb_struct_each_pair): yield associated pairs so that
+ an unsplat argument can get both, for consistency with Hash,
+ OpenStruct, and etc. [ruby-dev:46533] [Bug #7382]
+
+Mon Nov 19 16:17:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (LIBS): libelf is need on only FreeBSD.
+
+Mon Nov 19 16:08:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (RUBYLIB): purelib option in runruby.rb is deprecated
+ since r28841, so set to an empty list to get rid of a bogus path in
+ child processes, which caused an insecure operation exception in
+ test/ruby/test_encoding.rb:test_unsafe.
+
+Mon Nov 19 15:40:50 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * .travis.yml (script): add OPTS=-v, requested by @_ko1.
+
+Mon Nov 19 15:09:07 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: fix didn't enable_dtrace=yes on auto.
+
+ * configure.in: see enable_dtrace for adding libelf on FreeBSD.
+
+ * common.mk: VPATH is not needed.
+
+Mon Nov 19 14:55:51 2012 Koichi Sasada <ko1@atdot.net>
+
+ * thread.c: add `Thread#backtrace_locations' method.
+ This method is similar to `caller_locations' method for
+ specific method.
+ And fix to accept `level' and `n' parameters for `Thread#backtrace'
+ and `Thread#backtrace_locations'.
+ `caller' (and `caller_locations') do not return `caller' method
+ frame.
+ However, `Thread#backtrace' (and `Thread#backtrace_locations')
+ return `Thread#backtrace' method frame itself
+ if `Thread.current.backtrace' was called.
+
+ * vm_backtrace.c: ditto.
+
+ * internal.h: ditto.
+
+ * test/ruby/test_backtrace.rb: add tests.
+
+Mon Nov 19 14:54:32 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * Makefile.in, common.mk (probes.h): moved to common.mk and changed to
+ see $(srcdir).
+
+ * common.mk (probes.dmyh): now created it on $(srcdir) always.
+
+ * win32/Makefile.sub (.SUFFIXES): removed common suffix.
+
+Mon Nov 19 10:00:10 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * Makefile.in (.SUFFIX): bsdmake needs .SUFFIX is defined before use.
+
+ * common.mk: fix path of probes.dmyh.
+
+ * common.mk (vm_dump.o): depend probes.h.
+
+ * configure.in: FreeBSD's USDT requires libelf.
+
+Mon Nov 19 01:11:59 2012 Naohisa Goto <ngotogenome@gmail.com>
+
+ * vm_core.h, probes_helper.h (RUBY_DTRACE_FUNC_ENTRY_HOOK,
+ RUBY_DTRACE_FUNC_RETURN_HOOK): move from vm_core.h to new file
+ probes_helper.h for narrowing dependency to probes.h.
+ * common.mk (VM_CORE_H_INCLUDES): remove dependency to probes.h.
+ * common.mk (vm.$(OBJEXT)): add dependency to probes_helper.h.
+ * vm.c, vm_insnhelper.c: include probes_helper.h.
+
+Sun Nov 18 16:33:00 2012 Naohisa Goto <ngotogenome@gmail.com>
+
+ * configure.in, Makefile.in, common.mk: support DTrace on Solaris 10,
+ based on r26235 by Yugui. On Solaris 10, low optimization level
+ may also be needed, e.g. optflags="-xO1" or "-xO0" with Oracle
+ SolarisStudio 12.3 cc.
+
+ * configure.in (--enable-dtrace): new option to enable/disable
+ DTrace support. By default, trying to enable if dtrace command
+ is found on the system. It is disabled when cross compiling.
+
+ * configure.in (RUBY_DTRACE_POSTPROCESS): new macro. checks whether
+ the dtrace on the system needs postprocessing with "dtrace -G".
+ The postprocessing is needed on Solaris 10 and other platforms.
+
+ * configure.in (RUBY_DTRACE_BSD_BROKEN): new macro. checks whether
+ the dtrace supports USDT.
+
+ * configure.in (DTRACE): move after RUBY_DTRACE_POSTPROCESS.
+
+ * configure.in (LD): On Solaris, /usr/ccs/bin/ld is preferred.
+
+ * configure.in, Makefile.in, common.mk (DTRACE_OBJ): new macro for
+ DTrace probe object generated by postprocessing with "dtrace -G".
+
+ * Makefile.in, common.mk (probes.$(OBJEXT)): DTrace probe object
+ generated by the postprocessing. New file probes.stamp is for
+ rebuilding related objects that may be modified by "dtrace -G".
+
+ * configure.in, Makefile.in, common.mk (DTRACE_GLOMMED_OBJ): new
+ macro for DTrace static library hacks.
+
+ * configure.in, Makefile.in (LIBRUBY_A_OBJS): ditto.
+
+ * Makefile.in, common.mk (ruby-glommed.$(OBJEXT)): new target with
+ rule for DTrace static library hacks.
+
+ * common.mk (DTRACE_DEPENDENT_OBJS): objects depended on probes.h.
+
+Sun Nov 18 09:31:47 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * complex.c (read_comp): mathn compliant.
+ * rational.c (read_num): ditto.
+
+Sun Nov 18 02:50:12 2012 Luis Lavena <luislavena@gmail.com>
+
+ * win32/file.c (replace_to_long_name): correct logic around wildcard
+ characters detection and ensure wide-chars are used as pattern.
+ [ruby-core:49451] [Bug #7374]
+
+Sun Nov 18 02:02:46 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * complex.c (read_comp): modified handling of polar form.
+
+Sun Nov 18 00:50:44 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * complex.c (read_comp): fixed handling of polar form.
+
+Sun Nov 18 00:14:46 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * complex.c (string_to_c_strict, string_to_c): rewrote without regexp.
+ * rational.c (string_to_r_strict, string_to_r): ditto.
+
+Sat Nov 17 23:53:05 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * complex.c (make_patterns): should not accept extra sign.
+
+Sat Nov 17 21:45:12 Luis Lavena <luislavena@gmail.com>
+
+ * win32/file.c (replace_to_long_name): skip expansion for all wildcard
+ characters.
+ [ruby-core:49451] [Bug #7374]
+
+ * test/ruby/test_file_exhaustive.rb: add more assertions to test.
+
+Sat Nov 17 12:14:50 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: use literal YAML style
+ when emitting multi-line strings. Thanks @atambo
+
+ * test/psych/test_yaml.rb: test for change.
+
+Sat Nov 17 12:03:41 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/scalar_scanner.rb: avoid raising exceptions when
+ parsing Floats and Integers. Thanks riffraff [ruby-core:44426]
+ * test/psych/test_numeric.rb: associated test
+
+Sat Nov 17 11:34:31 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * st.c (st_update): pass the key in st_table so that we can free
+ memory of the key in st_table when deleting.
+ [ruby-core:49220] [Bug #7330]
+
+ * test/-ext-/st/test_update.rb
+ (Bug::StTable#test_pass_objects_in_st_table): add a test.
+
+Sat Nov 17 11:26:36 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/core_ext.rb: move Kernel#y so that it can
+ manually be required as 'psych/y'.
+
+ * ext/psych/lib/psych/y.rb: ditto
+
+Sat Nov 17 08:13:48 2012 Benoit Daloze <eregontp@gmail.com>
+
+ * lib/abbrev.rb: fix r37113. Correct examples, fix style
+ and show explicit dependency (require 'abbrev').
+
+Sat Nov 17 07:35:15 2012 Luis Lavena <luislavena@gmail.com>
+
+ * win32/file.c (replace_to_long_name): skip automatic path expansion
+ when wildcard character is used. [ruby-core:49451] [Bug #7374]
+
+ * test/ruby/test_file_exhaustive.rb: add a test for above.
+
+Sat Nov 17 00:50:23 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * marshal.c (w_object): add flonum to arg->data to keep reference index
+ consistency. [ruby-core:49323] [Bug #7348]
+
+ * test/ruby/test_marshal.rb: add a test for above.
+
+Sat Nov 17 00:40:25 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (incs): dist files need probes.dmyh.
+
+ * common.mk (probes.dmyh): depends on generator script.
+
+ * Makefile.in, common.mk, configure.in, win32/Makefile.sub (probes.h):
+ select generating with dtrace or copying dummy file by suffix rules.
+
+Fri Nov 16 19:24:10 2012 Koichi Sasada <ko1@atdot.net>
+
+ * thread.c (rb_thread_call_without_gvl2): change the parameter of
+ `func' from `int *skip_interrupt' to `VALUE *flags'.
+ If (flags & RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS) is not zero,
+ then skip checking interrupt.
+ [ruby-core:46547]
+
+ * include/ruby/thread.h: ditto.
+
+Fri Nov 16 18:59:05 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * Makefile.in (no-dtrace-probes.h): dmyprobes.h is in srcdir.
+
+ * common.mk (dmyprobes.h): ditto.
+
+Fri Nov 16 17:57:15 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * Makefile.in (probes.h): split build commands for dtrace-available
+ and unavailable platforms.
+
+ * Makefile.in (incs): probes.h is a platform dependent file, so it
+ cannot be a part of prereq target. move it to all-incs.
+
+ * configure.in (DTRACE): move after AC_PROG_CC since cross_compiling
+ is set in it.
+
+ * configure.in (DTRACE): ignore non-prefixed version if
+ cross-compiling.
+
+ * Makefile.in, win32/Makefile.sub (probes.h): fix copying dmyprobes.h
+ path when outplace-build.
+
+Fri Nov 16 15:27:36 2012 Masaki Matsushita <glass.saga@gmail.com>
+
+ * lib/net/pop.rb (POP3.certs): fix typo in comment.
+ patch from no6v (Nobuhiro IMAI) <nov@yo.rim.or.jp>.
+ [ruby-dev:46519] [Bug #7355]
+
+Fri Nov 16 12:36:47 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * test/rake/helper.rb (Rake::TestCase#setup): revert r37669.
+ @orig_PWD should be the original pwd.
+
+ * test/rake/test_*.rb: don't use @orig_PWD to load libraries.
+ It should be specified with relative path from the file.
+
+Fri Nov 16 10:22:52 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * test/rake/helper.rb (Rake::TestCase#setup): @orig_PWD shouldn't be
+ Dir.pwd when the build directory is different from source directory.
+
+Fri Nov 16 09:41:08 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/rake/version.rb: workaround fix to build. see #7366
+ [ruby-dev:46522]
+
+Fri Nov 16 07:23:18 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rake*: Updated to rake 0.9.4
+ http://rake.rubyforge.org/doc/release_notes/rake-0_9_4_rdoc.html for
+ a list of changes in 0.9.4.
+
+ * test/rake*: ditto
- * lib/rake: Update rake to fix some bugs and hide deprecated features
- from RDoc.
- * lib/rake/version.rb: Bump version to 0.9.2.1 to distinguish it from
- the released version.
* NEWS: ditto
-Tue Jun 28 11:17:28 2011 Eric Hodel <drbrain@segment7.net>
+Fri Nov 16 06:58:52 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rake*: Updated to rake 0.9.3. See
+ http://rake.rubyforge.org/doc/release_notes/rake-0_9_3_rdoc.html for
+ a list of changes in 0.9.3.
+
+ * test/rake*: ditto
+
+ * bin/rake: ditto
- * lib/rdoc: Update to RDoc 3.7 (final)
* NEWS: ditto
-Tue Jun 28 10:18:42 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Nov 15 22:39:32 2012 Yusuke Endoh <mame@tsg.ne.jp>
- * process.c (rb_daemon): fix wrong #endif position.
+ * range.c (range_bsearch): fix some bugs: a documentation bug, a wrong
+ condition, missed break in switch/case, and workaround for GCC
+ optimization. See [ruby-core:49364] in detail. A great patch from
+ Heesob Park. [Bug #7352] [Feature #4766]
-Tue Jun 28 07:50:32 2011 Eric Hodel <drbrain@segment7.net>
+ * array.c (rb_ary_bsearch): fix similar bug (missed break).
- * object.c (Init_Object): Teach RDoc what Init_class_hierarchy does to
- hook up ri for BasicObject, Object, Module and Class.
+ * test/ruby/test_range.rb: add two test cases for above.
-Tue Jun 28 05:03:32 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+Thu Nov 15 22:41:57 2012 Koichi Sasada <ko1@atdot.net>
- * thread.c (rb_thread_local_aref): RDoc fix. Thread#[] example
- had a race. See #4480.
+ * vm_exec.h (GENTRY): GENTRY should be pointer size.
+ A patch by yoshidam (Yoshida Masato) [Bug #7332].
-Tue Jun 28 01:22:00 2011 Kenta Murata <mrkn@mrkn.jp>
+Thu Nov 15 13:20:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * ext/bigdecimal/bigdecimal.c (BigMath_s_log): move BigMath.log from
- bigdecimal/math.rb.
+ * man/erb.1: Fix grammar and copyright dates
+ * man/goruby.1: ditto
+ * man/irb.1: ditto
+ * man/rake.1: ditto
+ * man/ri.1: ditto
+ * man/ruby.1: ditto
+ Patch by Arthur Gunn
+ [Fixes Github #210]
- * ext/bigdecimal/lib/bigdecimal/math.rb: ditto.
+Thu Nov 15 11:35:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * test/bigdecimal/test_bigdecimal.rb: move test for BigMath.log from
- test/bigdecimal/test_bigmath.rb.
+ * man/ruby.1: Grammar edits for man page
+ Based on a patch by Michael Endsley [Fixes Github #183]
- * test/bigdecimal/test_bigmath.rb: ditto.
+Thu Nov 15 00:47:20 2012 Yusuke Endoh <mame@tsg.ne.jp>
-Tue Jun 28 01:19:52 2011 Keiju Ishitsuka <keiju@ishitsuka.com>
+ * array.c (rb_ary_bsearch): add Array#bsearch for binary search.
+ [ruby-core:36390] [Feature #4766]
- * lib/irb/ruby-lex.rb: fix [Bug #4232].
+ * test/ruby/test_array.rb: add a test for above.
-Tue Jun 28 00:14:13 2011 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * range.c (range_bsearch): add Range#bsearch for binary search.
+ [ruby-core:36390] [Feature #4766]
- * lib/drb/drb.rb: fix [Bug #4409]. add DRbServer#here?.
+ * test/ruby/test_range.rb: add a test for above
- * test/drb/test_drb.rb: ditto.
+ * NEWS: added the two new methods.
- * test/drb/drbtest.rb: ditto.
+Wed Nov 14 13:25:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * test/drb/ut_eq.rb: ditto.
+ * lib/fileutils.rb (chmod): Add "X" to modes, convert format to table
+ [ruby-core:48965] [Bug #7288]
-Tue Jun 28 00:08:43 2011 Keiju Ishitsuka <keiju@ishitsuka.com>
+Wed Nov 14 11:51:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * lib/irb/workspace.rb: fix BUG#4793.
+ * lib/csv.rb (init_comments): Document private method #init_comments.
+ Based on a patch from Vincent Batts [ruby-core:49172] [Bug #7319]
-Mon Jun 27 22:06:12 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Wed Nov 14 00:54:00 2012 Kenta Murata <mrkn@mrkn.jp>
- * thread_pthread.c (consume_communication_pipe): don't use C99
- style variable length array.
+ * Makefile.in (probes.h): create from probes.d
-Mon Jun 27 22:04:27 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Tue Nov 13 18:44:01 2012 Koichi Sasada <ko1@atdot.net>
- * thread_pthread.c (consume_communication_pipe): change return
- type to void. caller doesn't use it.
+ * vm_insnhelper.c (vm_call_cfunc_with_frame): don't use ci after
+ EXEC_EVENT_HOOK because ci can be overridden.
-Mon Jun 27 21:29:50 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * vm_eval.c: ditto.
- * thread_pthread.h (rb_global_vm_lock_struct): add volatile to
- gvl->waiting. now thread_timer() access it w/o lock.
+ * method.h: change invoker's parameters types.
-Mon Jun 27 21:16:11 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * vm_method.c (call_cfunc_invoker_func): ditto.
- * thread_pthread.c: s/__gvl_acquire/gvl_acquire_common/ and
- s/__gvl_release/gvl_release_common/.
+Tue Nov 13 18:01:54 2012 Shugo Maeda <shugo@ruby-lang.org>
-Mon Jun 27 11:41:47 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * eval.c (rb_mod_using): raise an ArgumentError if cyclic using is
+ detected. based on the patch by Charlie Somerville.
+ [ruby-core:49092] Bug #7308
- * thread_pthread.c (rb_thread_create_timer_thread):
- the type of return value of write(2) is ssize_t.
+ * test/ruby/test_refinement.rb: related test.
-Mon Jun 27 09:57:02 2011 Koichi Sasada <ko1@atdot.net>
+Tue Nov 13 17:40:04 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * thread_pthread.c (rb_thread_create_timer_thread):
- Fixes missing initialization of oflags.
+ * common.mk (vm_insnhelper.c): this target is useless and causes
+ ruby always need rebuild.
-Mon Jun 27 09:07:42 2011 Koichi Sasada <ko1@atdot.net>
+Tue Nov 13 17:35:49 2012 Koichi Sasada <ko1@atdot.net>
- * thread_pthread.c: Stop polling in the timer thread when there are
- no waiting thread. If there are 2 or more runnable threads,
- the timer thread does polling. Avoid polling makes power save
- for several computers (0.2W per a Ruby process, when I measured).
- If outside-event such as signal or Thread#kill was occurred
- when the timer thread does not do polling, then wake-up
- the timer thread using communication-pipe (the timer thread
- waits this communication-pipe with select(2)).
- The discussion about this modification can be found from the post
- [ruby-core:33456] and other related posts.
- Note that Eric Wong and KOSAKI Motohiro give us the huge
- contributions for this modification. Thanks.
+ * compile.c (insn_data_to_s_detail): remove debug lines.
- * thread_pthread.c (rb_thread_wakeup_timer_thread): add a function.
- This function wakes up the timer thread using communication-pipe.
+Tue Nov 13 17:28:47 2012 Koichi Sasada <ko1@atdot.net>
- * thread.c (rb_thread_stop_timer_thread): add a parameter which
- specify closing communication-pipe or not.
+ * vm_insnhelper.c (vm_caller_setup_args): save and restore
+ ci->argc and ci->blockptr before and after method invocations
+ because these method dispatches can override call_info.
- * thread.c (rb_thread_terminate_all): do not stop timer thread here
- (ruby_cleanup() terminate timer thread).
+ * bootstraptest/test_method.rb: add tests for this fix.
- * signal.c: wake up timer thread using
- rb_thread_wakeup_timer_thread() from signal handler.
+Tue Nov 13 16:38:02 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * eval.c (ruby_cleanup): use rb_thread_stop_timer_thread(1).
+ * common.mk (dmyprobes.h): always create for make dist.
- * process.c: use rb_thread_stop_timer_thread(0)
- (reuse communication-pipe).
+ * Makefile.in (probes.h): create or copy dmyprobes.h
- * thread_win32.c (rb_thread_wakeup_timer_thread): add a dummy
- function.
+ * win32/Makefile.sub: only do copy dmyprobes.h.
- * vm_core.h: add and fix decl. of functions.
+Tue Nov 13 15:37:21 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Mon Jun 27 08:01:19 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * Makefile.in (.SUFFIX): .SUFFIX is needed here for .d.h on bsd make.
- * ext/date/date_parse.c: should use ALLOCA_N.
+Tue Nov 13 15:34:35 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Jun 27 01:34:18 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * common.mk Makefile.in win32/Makefile.sub (.d.h): it's not common.
- * test/etc/test_etc.rb (TestEtc#test_get{pw,gr}nam): skip entries
- start with + sign, which means NIS. these are returned in the
- case that passwd and group entries in /etc/nsswitch.conf are set
- to use "nis" explicitly on Debian. fixed #3683
+Tue Nov 13 12:27:11 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Mon Jun 27 00:44:53 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * configure.in: disable dtrace because it doesn't work on FreeBSD.
- * parse.y (rb_parser_end_seen_p): fix documentation about return
- value. patched by Sho Hashimoto. [Bug #4511]
+ * common.mk (clean-local): rm probes.h.
-Mon Jun 27 00:40:47 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * common.mk (parse.o): depend $(PROBES_H_INCLUDES).
- * hash.c (rb_hash_reject): add documentation that Hash#reject
- without block returns enumerator.
- patched by Michael Edgar [Bug #4847] [ruby-core:36800]
+ * common.mk (.d.h): moved from Makefile.in and use BASERUBY.
-Sun Jun 26 23:49:21 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * tool/gen_dummy_probes.rb: reimplemented with ruby because sed is not
+ available on Windows Microsoft VC++ environment.
- * test/date/test_switch_hitter.rb: added a test.
+Tue Nov 13 12:30:26 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- Sun Jun 26 22:21:23 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * win32/README.win32: added mention about build directory. currently
+ we can not build ruby in win32 directory. this problem is reported
+ by Masahiro Kitajima <katonbo@katontech.com>.
- * ext/date/date_core.c: refactoring.
+Tue Nov 13 11:03:47 2012 Masaki Matsushita <glass.saga@gmail.com>
-Sun Jun 26 18:03:30 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
+ * re.c (rb_memsearch_ss): performance improvement by using memmem(3) if
+ possible. [ruby-dev:45530] [Feature #6311]
- * parse.y: comma at the end of line is no longer allowed.
- A patch from Yukihiro Matsumoto <matz AT ruby-lang.org>.
- (fixed #3456).
+ * configure.in: check existence of memmem(3) and that it is not broken.
-Sun Jun 26 13:35:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Tue Nov 13 06:50:02 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * vm_dump.c (rb_vm_bugreport): change CrashReporter suggestion messages
- on Mac. It should be placed after "-- C level backtrace" line.
- Suggested by Endoh-san.
+ * probes.d: add DTrace probe declarations. [ruby-core:27448]
- <before>
- -- See Crash Report log file under ~/Library/Logs/CrashReporter or ---------
- -- /Library/Logs/CrashReporter, for the more detail of ---------------------
- -- C level backtrace information -------------------------------------------
+ * array.c (empty_ary_alloc, ary_new): added array create DTrace probe.
- <after>
- -- C level backtrace information -------------------------------------------
+ * compile.c (rb_insns_name): allowing DTrace probes to access
+ instruction sequence name.
- See Crash Report log file under ~/Library/Logs/CrashReporter or
- /Library/Logs/CrashReporter, for the more detail of.
+ * Makefile.in: translate probes.d file to appropriate header file.
-Sun Jun 26 10:08:28 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * common.mk: declare dependencies on the DTrace header.
- * ext/openssl/extconf.rb
- * ext/openssl/ossl_missing.h/.c: add ASN1_put_eoc if missing.
+ * configure.in: add a test for existence of DTrace.
- * ext/openssl/ossl_asn1.c: introduce ossl_asn1_object_size and
- ossl_asn1_put_object to wrap functionality depending on OpenSSL
- version in use.
- Fixes [ Ruby 1.9 - Bug #4916 ] reported by Hiroshi Nakamura.
- [ruby-core:37286]
+ * eval.c (setup_exception): add a probe for when an exception is
+ raised.
-Sun Jun 26 01:00:15 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * gc.c: Add DTrace probes for mark begin and end, and sweep begin and
+ end.
- * ext/date/date_core.c (date_strftime_internal): removed meaningless braces.
- * ext/date/date_core.c (gengo): the value should be int.
+ * hash.c (empty_hash_alloc): Add a probe for hash allocation.
-Sat Jun 25 23:45:30 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+ * insns.def: Add probes for function entry and return.
- * vm_insnhelper.c (vm_search_superclass): avoid control frame
- stack overrun. currently super() in Proc created in a method
- defined by Module#define_method raise NoMethodError. [Bug #4881]
- * test/ruby/test_method.rb t_super_in_proc_from_define_method):
- add test for it.
+ * internal.h: function declaration for compile.c change.
-Sat Jun 25 23:23:14 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+ * load.c (rb_f_load): add probes for `load` entry and exit, require
+ entry and exit, and wrapping search_required for load path search.
- * thread.c (sleep_forever): now Kernel#sleep don't wakeup by
- signal handler execution. [Bug #4072]
+ * object.c (rb_obj_alloc): added a probe for general object creation.
-Sat Jun 25 23:14:47 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+ * parse.y (yycompile0): added a probe around parse and compile phase.
- * thread.c (rb_threadptr_check_signal): remove unnecessary th->status
- backup. fix race condition which may results unexpected main thread's
- status transition. see #4072
+ * string.c (empty_str_alloc, str_new): DTrace probes for string
+ allocation.
-Fri Jun 24 19:57:30 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+ * test/dtrace/*: tests for DTrace probes.
- * lib/webrick/httprequest.rb (setup_forwarded_info): Parsing request
- header failed when the request is from 2 or more Apache reverse
- proxies. It's said that all X-Forwarded-* headers will contain more
- than one (comma-separated) value if the original request already
- contained one of these headers. Since we could use these values as
- Host header, we choose the initial(first) value. See #4922.
+ * vm.c (vm_invoke_proc): add probes for function return on exception
+ raise, hash create, and instruction sequence execution.
- * test/webrick/test_httprequest.rb (test_forwarded): Test it.
+ * vm_core.h: add probe declarations for function entry and exit.
-Fri Jun 24 17:06:33 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_dump.c: add probes header file.
- * process.c (proc_daemon): should not start timer thread
- twice. fixed Bug#4920.
+ * vm_eval.c (vm_call0_cfunc, vm_call0_cfunc_with_frame): add probe on
+ function entry and return.
-Fri Jun 24 15:54:14 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+ * vm_exec.c: expose instruction number to instruction name function.
- * ext/openssl/ossl_ssl.c (ossl_ssl_shutdown): Try to shutdown SSL
- connection more gracefully. Call SSL_shutdown() max 4 times until it
- returns 1 (success). Bi-directional SSL close has several states but
- SSL_shutdown() kicks only 1 transition per call. Max 4 is from
- mod_ssl.c of Apache httpd that says 'max 2x pending + 2x data = 4'.
- See #4237.
+ * vm_insnhelper.c: add function entry and exit probes for cfunc
+ methods.
-Fri Jun 24 07:24:37 2011 Eric Hodel <drbrain@segment7.net>
+ * vm_insnhelper.h: vm usage information is always collected, so
+ uncomment the functions.
- * lib/rake/version.rb: Fixed VERSION to work with tool/rbinstall.rb
- * bin/rake: Import bin/rake from 0.9.2
- * tool/rbinstall.rb (install): Rake::VERSION is now in
- lib/rake/version.rb. Fixes `make install`
+Mon Nov 12 19:14:50 2012 Akinori MUSHA <knu@iDaemons.org>
-Fri Jun 24 07:11:37 2011 Eric Hodel <drbrain@segment7.net>
+ * configure.in (isinf, isnan): isinf() and isnan() are macros on
+ DragonFly which cannot be found by AC_REPLACE_FUNCS(). This
+ workaround enforces the fact that they exist on DragonFly.
- * lib/rake: Import Rake 0.9.2
+Mon Nov 12 15:59:38 2012 Shugo Maeda <shugo@ruby-lang.org>
-Fri Jun 24 00:44:15 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo),
+ vm_insnhelper.c (vm_search_method): revert r37616 because it's too
+ slow. [ruby-dev:46477]
- * ext/date/date_core.c (c_valid_{julian,gregorian}_p): fixed the range of month.
+ * test/ruby/test_refinement.rb (test_inline_method_cache): skip
+ the test until the bug is fixed efficiently.
-Fri Jun 24 00:14:23 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Mon Nov 12 14:28:01 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/date/date_core.c: trivial changes on text.
+ * win32/mkexports.rb (each_export): skip garbage generated by VS2012's
+ nmake.
+ reported and patched by Yoshida Masato at [Bug #7333] [ruby-dev:46484]
-Thu Jun 23 22:46:57 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+Sun Nov 11 18:58:55 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * ext/openssl/ossl_x509name.c: Add X509::Name#hash_old as a wrapper
- for X509_NAME_hash_old in OpenSSL 1.0.0. See #4805
+ * test/date/test_date_{parse,strptime}.rb: changed the format of
+ some extra messages.
- * test/openssl/test_x509name.rb (test_hash): Make test pass with
- OpenSSL 1.0.0.
+Sun Nov 11 18:41:34 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * NEWS: Add it.
+ * ext/date/date_parse.c (date__parse): revised the tight parser
+ (about handling of apostrophes).
-Thu Jun 23 19:30:53 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+Sun Nov 11 15:39:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_ssl_session.c (ossl_ssl_session_set_time): Check
- argument type with NUM2LONG if the arg is not a Time object.
- See #4919.
+ * hash.c (rb_hash_s_create): just warn for wrong elements now.
+ [ruby-dev:46440] [Bug #7300]
- * ext/openssl/ossl_ssl_session.c (ossl_ssl_session_set_timeout): Check
- type with NUM2LONG. Time as an arg is not allowed. See #4919.
+ * hash.c (rb_hash_s_create): refine error messages.
- * test/openssl/test_ssl_session.rb (test_session_time,
- test_session_timeout): Test it.
+ * error.c (rb_builtin_class_name): share for above.
-Wed Jun 23 13:30:30 2011 Shota Fukumori <sorah@tubusu.net>
+Sun Nov 11 15:12:18 2012 Shugo Maeda <shugo@ruby-lang.org>
- * signal.c(ruby_atomic_exchange): Fix definition style.
+ * eval.c (top_using): remove Kernel#using, and add main.using instead.
-Wed Jun 22 22:34:05 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+ * test/ruby/test_refinement.rb: related test.
- * ext/openssl/ossl_ssl.c (ossl_sslctx_session_new_cb): Return 0 to
- OpenSSL from the callback for SSL_CTX_sess_set_get_cb().
- Returning 0 means to OpenSSL that the session is still valid
- (since we created Ruby Session object) and was not freed by us with
- SSL_SESSION_free(). Call SSLContext#remove_session(sess) in
- session_get_cb block if you don't want OpenSSL to cache the session
- internally.
- This potential issue was pointed by Ippei Obayashi. See #4416.
+Sun Nov 11 13:41:01 2012 Shugo Maeda <shugo@ruby-lang.org>
- * test/openssl/test_ssl_session.rb (test_ctx_server_session_cb): Test
- it.
+ * eval.c (rb_using_refinement, rb_mod_using, f_using): clear method
+ cache only when using is called explicitly.
-Wed Jun 22 22:21:17 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * test/ruby/test_refinement.rb: related test.
- * ext/openssl/ossl_ssl_session.c: Respect T_BIGNUM time values. Patch by
- Tomoyuki Chikanaga.
- [ Ruby 1.9 - Bug #4919 ] [ruby-dev:43869]
+Sun Nov 11 12:56:34 2012 Masaki Matsushita <glass.saga@gmail.com>
-Wed Jun 22 21:29:25 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * lib/pstore.rb (PStore): fix not to replace ThreadError raised in
+ #transaction block with PStore::Error.
+ [ruby-core:39238] [Bug #5269]
- * ext/socket/depend (SOCK_HEADERS): use $(top_srcdir) instead of
- $(topdir). sorry!
+Sun Nov 11 11:36:19 2012 Shugo Maeda <shugo@ruby-lang.org>
-Wed Jun 22 19:47:03 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo):
+ add a new field for inline method cache.
- * cont.c (cont_capture): add volatile.
- On clang -O, it is needed to avoid the optimization.
- With this and llvm/clang's recent fix, clang 3.0 can
- build ruby-trunk with -O option.
+ * vm_insnhelper.c (vm_search_method): check rb_call_info_t::refinements
+ not to confuse inline method cache when module_eval is used with
+ refinements.
- * cont.c (cont_capture): use for-loop.
+ * test/ruby/test_refinement.rb: related test.
- * array.c (rb_ary_each): add volatile and use it.
+Sun Nov 11 08:45:45 2012 Martin Duerst <duerst@it.aoyama.ac.jp>
- * vm_insnhelper.c (vm_call_cfunc): ditto.
+ * ruby.c: removed a comma before "before"
-Wed Jun 22 18:20:46 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+Sat Nov 10 23:02:31 2012 Narihiro Nakamura <authornari@gmail.com>
- * ext/openssl/ossl_ssl.c (ossl_sslctx_session_remove_cb):
- OpenSSL::SSL::SSLContext#session_remove_cb was broken. It wrongly
- tried to call the session_*new*_cb callback.
+ * gc.c: move immutable fields from struct heaps_slot and struct
+ sorted_heaps_slot into struct heaps_header.
+ Based on a patch from Sokolov Yura [Feature #6199][ruby-core:43592]
- * test/openssl/test_ssl_session.rb (class OpenSSL): Test it.
+Sat Nov 10 19:28:16 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Wed Jun 22 17:37:49 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * complex.c: modified doc.
+ * rational.c: ditto.
- * ext/openssl/ossl.h: Introduced OSSL_BIO_reset macro for PEM/DER
- fallback scenarios.
+Sat Nov 10 18:20:10 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * ext/openssl/ossl_pkey_dsa.c
- * ext/openssl/ossl_x509req.c
- * ext/openssl/ossl_pkey_rsa.c
- * ext/openssl/ossl_pkey_ec.c
- * ext/openssl/ossl_ssl_session.c
- * ext/openssl/ossl_x509crl.c
- * ext/openssl/ossl_pkey.c
- * ext/openssl/ossl_pkey_dh.c
- * ext/openssl/ossl_x509cert.c
- * ext/openssl/ossl_pkcs7.c: Use OSSL_BIO_reset.
-
- * ext/openssl/ossl_ssl.c
- * ext/openssl/ossl_cipher.c
- * ext/openssl/ossl_pkey_ec.c
- * ext/openssl/ossl_pkcs12.c
- * ext/openssl/ossl_ssl_session.c: Replace rb_raise occurrences by
- ossl_raise. This automatically flushes OpenSSL's error queue.
+ * ext/date/date_parse.c: edited about era.
- * ext/openssl/ossl_pkcs7.c: Raise error if DER fallback for parsing
- fails.
+Sat Nov 10 12:13:41 2012 Kouhei Sutou <kou@cozmixng.org>
- * test/openssl/test_pkey_ec.rb
- * test/openssl/test_pkey_dsa.rb
- * test/openssl/test_pkey_rsa.rb: Add assertions that OpenSSL.errors is
- empty.
+ * tool/rbinstall.rb: Don't install *.gemspec under lib/.
+ [ruby-core:48966] [Bug #7289]
+ Reported by Vit Ondruch. Thanks!!!
- * test/openssl/test_pkey_rsa.rb: Remove initial OpenSSL.errors call in
- test_new.
- [ Ruby 1.9 - Bug #4885 ] [ruby-core:37134]
+Sat Nov 10 00:49:26 2012 Naohisa Goto <ngotogenome@gmail.com>
-Wed Jun 22 15:01:24 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * ruby_atomic.h: renamed from atomic.h to avoid header file name
+ conflict on Solaris 10. [ruby-dev:46414] [Bug #7287]
- * ext/openssl/ossl_ssl.c: Use SSL_MODE_RELEASE_BUFFERS if available.
- Thanks, Eric Wong, for providing the patch.
- [ Ruby 1.9 - Feature #4672 ] [ruby-core:36127]
+ * gc.c, signal.c, vm_core.h, common.mk: reflect the rename from
+ atomic.h to ruby_atomic.h.
-Wed Jun 22 14:47:53 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+Sat Nov 10 00:46:57 2012 Naohisa Goto <ngotogenome@gmail.com>
- * test/openssl/test_buffering.rb
- * test/openssl/test_pkcs12.rb: Inherit from Test::Unit::TestCase
- instead of MiniTest::Unit::TestCase. [ruby-core:37275]
+ * atomic.h: Revert r37491 which is a temporary workaround.
-Wed Jun 22 12:41:03 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+Sat Nov 10 00:33:31 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/openssl/ossl_ssl_session.c (ossl_ssl_session_to_der):
- OpenSSL::SSL::Session#to_der was broken. Fix buffer handling.
+ * siphash.h: check configure macros before include newer headers.
- * test/openssl/test_ssl_session.rb (test_session): Test it.
+Fri Nov 9 23:33:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jun 22 12:38:52 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+ * lib/erb.rb (ERB#run, ERB#result): eval under isolated bindings for
+ safe concurrent use. [ruby-core:47638] [Bug #7046]
- * test/openssl/test_ssl_session.rb: Split out SSL::Session related
- tests from test_ssl.rb
+Fri Nov 9 23:05:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jun 22 03:20:52 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+ * random.c (BYTE_ORDER): define using configured WORDS_BIGENDIAN.
- * ext/psych/lib/psych/visitors/to_ruby.rb: Fix cyclic references of
- objects. Thanks to CvX for reporting the bug and a test case.
- * test/psych/test_object.rb: test for cyclic object references.
+ * siphash.c (sip_init_state): use union to suppress warnings by gcc
+ 4.7.
-Wed Jun 22 02:39:54 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+Fri Nov 9 19:40:03 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/net/http.rb (Net::HTTP.post_form): Do not ignore query part of
- the given URI to post. See #655.
+ * array.c (rb_ary_splice): fix r37583 doesn't consider the case when
+ beg > array length.
- * test/net/http/test_http.rb, test/net/http/utils.rb: Test it.
+Fri Nov 9 16:11:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jun 22 01:28:13 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+ * random.c (rb_memhash): use siphash.
- * test/openssl/test_x509store.rb (test_set_errors): Redhat is
- distributing a patched version of OpenSSL that allows multiple CRL
- for a key (multi-crl.patch.) Make test pass on such env. See #4122,
- #4554.
+Fri Nov 9 16:08:46 2012 Sokolov Yura funny-falcon <funny.falcon@gmail.com>
-Tue Jun 21 21:50:37 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+ * array.c: speedup Array#unshift by using space in shared array.
+ [Feature #6638]
+ - when array owns its shared array (ARY_SHARED_NUM == 1), and there
+ is enough space then try unshift values directly into shared
+ array.
+ - when resulting array is big (~>64 items) then make it shared with
+ enough room for future #unshifts, and then insert into shared
+ array.
- * lib/webrick/httpresponse.rb (HTTPResponse#setup_header): Close
- HTTP/1.1 connection when returning an IO object as response body
- without setting HTTPResponse#chunked to true. See #855 no.1.
+ * array.c (rb_ary_splice): use shared array in rb_ary_slice.
+ [Feature #6638]
+ - use ary_ensure_room_for_push when rb_ary_slice used to add at the
+ end of array, cause rb_ary_concat use rb_ary_slice.
- * test/webrick/test_httpserver.rb: Test it.
+ * array.c (ary_ensure_room_for_push): make array really suitable for
+ queue. [Feature #6638]
+ when array is shared (which happens after Array#shift), and
+ ARY_SHARED_NUM == 1 (which is very often when array used as queue),
+ then make rb_ary_push push directly into shared array.
-Tue Jun 21 21:27:34 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * array.c (rb_ary_modify): steal shared array's container when
+ ARY_SHARED_NUM == 1. [Feature #6638]
+ - Do not allocate new memory in rb_ary_modify when ARY_SHARED_NUM == 1
+ and length almost same.
+ - Store ARY_CAPA instead of RARRAY_LEN in ary_make_shared, to make
+ it useful.
+ - Fix rb_ary_sort_bang accordantly.
- * internal.h: move rb_thread_io_blocking_region() declaration
- from intern.h to internal.h. It's still experimental API and
- need more discussion. [ruby-dev:43698]
- * include/ruby/intern.h: ditto.
+Fri Nov 9 16:00:00 2012 Zachary Scott <zzak@zacharyscott.net>
- * ext/socket/rubysocket.h: include internal.h.
- * ext/socket/depend: add internal.h dependency.
- * ext/socket/extconf.rb: add $INCFLAGS to topdir.
+ * ext/bigdecimal/bigdecimal.c: Documentation for BigDecimal
+ Based on a patch from Vincent Batts [ruby-core:49047] [Bug #7305]
-Tue Jun 21 20:38:47 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Fri Nov 9 15:25:42 2012 Akinori MUSHA <knu@iDaemons.org>
- * ext/date/date_core.c (datetime_s_*): canonicalize 24 o'clock.
+ * lib/shellwords.rb (Shellwords#shellescape): Add back my original
+ real world example with some enhancement.
-Tue Jun 21 19:46:23 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * lib/shellwords.rb (Shellwords#shelljoin): Undo part of the
+ previous rdoc change. This new example using a string-only
+ array was not in line with the description.
- * test/ruby/test_thread.rb (TestThread#test_priority): enable
- this test again. Current GVL respect thread priority rather
- than past.
+Fri Nov 9 12:58:13 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Jun 21 13:25:35 2011 TAKAO Kouji <kouji@takao7.net>
+ * string.c (rb_str_crypt): crypt(3) may return NULL.
+ Latest glibc (2.16?) crypt(3) actually returns NULL. [Bug #7312]
- * ext/readline/readline.c (readline_getc): applied a patch in
- #3827 by by Akio Tajima <artonx AT yahoo.co.jp>. (see #3827)
+Fri Nov 9 12:07:06 2012 Akinori MUSHA <knu@iDaemons.org>
-Tue Jun 21 13:16:31 2011 TAKAO Kouji <kouji@takao7.net>
+ * include/ruby/ruby.h (alloca), eval_intern.h (alloca), gc.c
+ (alloca): Make alloca() globally available by moving the
+ ultimate ifdef's to ruby/ruby.h. Gcc hides its builtin alloca()
+ when compiling with -ansi, and linking thus fails on platforms
+ that lack their own alloca() implementation in libc, which
+ include OpenBSD and some ports of NetBSD. We use alloca()
+ everywhere including from within third party C extensions, so
+ alloca() must be made globally available. [Bug #7307]
- * ext/readline/extconf.rb: fixed bug, specify --disable-libedit
- then disable libedit, does not specify then check readline and
- libedit if failed checking readline. (fixes #3375)
+ * addr2line.c (alloca): Replace the alloca() part with the
+ ultimate ifdef's. [Bug #7307]
-Mon Jun 20 22:52:07 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Fri Nov 9 09:30:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * process.c (before_exec): use sig_do_nothing instead of SIG_DFL
- for avoiding a race.
- * process.c (sig_do_nothing): new function.
+ * io.c (IO#new):
+ Fix indentation from r37444
+ [ruby-core:48052] [Bug #7179]
-Mon Jun 20 21:31:03 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Fri Nov 9 07:36:00 2012 Kenta Murata <mrkn@mrkn.jp>
- * thread_pthread.c (thread_timer): rename timeout_10ms to
- time_quantum. it's no longer 10ms.
+ * bignum.c (bigmul0): enable big_mul_toom3.
+ [ruby-core:48552] [Bug #7242]
-Mon Jun 20 18:46:02 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+ * bignum.c (bigmul1_toom3): fix incorrect calculation.
+ the patch is made by Heesob Park.
+ [ruby-core:48552] [Bug #7242]
- * ext/openssl/ossl_cipher.c, ext/openssl/lib/openssl/cipher.rb:
- Documentation fix by Ippei Obayashi. See #4419.
+Fri Nov 9 05:33:00 2012 Kenta Murata <mrkn@mrkn.jp>
-Mon Jun 20 15:41:33 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+ * bignum.c (bigmul0): disable big_mul_toom3 temporarily.
+ [ruby-core:48552] [Bug #7242]
- * lib/webrick/cookie.rb (WEBrick::Cookie.parse): Revert r31228.
- r31228 was for allowing the 'Cookie:' header which did not have no
- SP after ';' for separating cookie-pairs but RFC6265 requires single
- SP after ';' there. We allow multiple SPs here for compatibility
- with older WEBrick version.
+ * test/ruby/test_bignum.rb (test_mul_large_numbers):
+ add a test for bigmul1_toom3 suggested in [Bug #7242].
- * test/webrick/test_cookie.rb: Test it.
+Thu Nov 8 21:57:59 2012 Masaki Matsushita <glass.saga@gmail.com>
-Sun Jun 19 13:31:26 2011 Shota Fukumori <sorah@tubusu.net>
+ * re.c (rb_memsearch): performance improvement by using memchr().
+ [ruby-dev:45397] [Feature #6173]
- * NEWS: Introduce --hide-skip on test/unit.
+Thu Nov 8 19:02:50 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Jun 19 10:05:16 2011 Shota Fukumori <sorah@tubusu.net>
+ * lib/net/protocol.rb (Net::InternetMessageIO#each_crlf_line):
+ treat \r as newline as mame pointed. [ruby-dev:46425] [Bug #7278]
- * lib/test/unit/parallel.rb: Override Test::Unit::TestCase#on_parallel_worker?
- only when $0 == __FILE__.
+Thu Nov 8 11:32:11 2012 Akinori MUSHA <knu@iDaemons.org>
- * lib/test/unit/parallel.rb: Run Test::Unit::Worker.run only when
- $0 == __FILE__.
+ * configure.in (--with-opt-dir): Avoid nesting of double quotes
+ inside backquotes, since some traditional shells like PD KSH
+ (which OpenBSD's /bin/sh bases on) fail to parse them.
-Sat Jun 18 23:59:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Nov 8 09:34:00 2012 Kenta Murata <mrkn@cookpad.com>
- * io.c (fill_cbuf): finish reading at EOF, and the readconv has
- been cleared by another thread while io_fillbuf() is waiting at
- select(). a patch in [ruby-core:37197] by Hiroshi Shirosaki
- <h.shirosaki AT gmail.com>. fixed #3840
+ * numeric.c: Add a caution that the results of the comparing
+ operations of two NaNs are undefined.
+ [#1720] [ruby-dev:38725] [ruby-core:36966]
-Sat Jun 18 21:36:29 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Thu Nov 8 04:45:21 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * thread_pthread.c: remove GVL_DEBUG
+ * include/ruby/intern.h: Restore rb_enumeratorize as it was before
+ r37497 and introduce rb_enumeratorize_with_size instead. [#7302]
-Sat Jun 18 21:32:02 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * enumerator.c: ditto.
- * vm.c, vm_core.h (rb_vm_stack_to_heap): remove const.
- It makes compilations warnings.
+Wed Nov 7 15:22:37 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Sat Jun 18 18:54:15 2011 Koichi Sasada <ko1@atdot.net>
+ * numeric.c (ruby_float_step): fix r37514: it yielded with NaN
+ if the unit is infinity.
- * vm.c, vm_core.h (rb_vm_stack_to_heap): fix "const" place.
+Wed Nov 7 15:46:12 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Sat Jun 18 17:23:38 2011 Tanaka Akira <akr@fsij.org>
+ * lib/webrick.rb: fix typo. reported by Rohit Arondekar.
+ https://github.com/ruby/ruby/pull/211
- * eval.c, hash.c, load.c, proc.c, range.c, thread.c, time.c: don't
- declare internal functions.
+Wed Nov 7 15:34:12 2012 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
- * internal.h, vm_core.h: declare internal functions.
+ * lib/cgi/core.rb: alias CGI#http_header to CGI#header.
- * array.c: include internal.h.
+Wed Nov 7 12:49:39 2012 Shugo Maeda <shugo@ruby-lang.org>
- * common.mk: update dependency for array.o.
+ * eval.c (rb_mod_refine): set RMODULE_IS_REFINEMENT to a created
+ refinement module, and don't override method_added.
-Sat Jun 18 13:39:33 2011 Tanaka Akira <akr@fsij.org>
+ * vm_method.c (rb_method_entry_make): check redefinition of
+ optimized methods when a method is added to a refinement module.
+ [ruby-core:48970] [Bug #7290]
- * internal.h: declarations declared in include/ruby/*.h removed.
+ * test/ruby/test_refinement.rb: related test.
-Sat Jun 18 12:42:17 2011 Tanaka Akira <akr@fsij.org>
+Wed Nov 7 11:48:14 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * method.h, internal.h iseq.h: declare internal functions.
+ * misc/ruby-additional.el (ruby-mode-set-encoding): now encoding needs
+ to be set always explicitly actually. [Feature #6679]
- * compile.c, eval.c, iseq.c, object.c, parse.y, proc.c, process.c,
- thread.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c: don't
- declare internal functions.
+Wed Nov 7 09:15:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- Note that rb_method_entry_eq() is defined in vm_method.c but
- there was a declaration in proc.c with different const-ness.
- Now it is declared in method.h with same const-ness to the
- definition.
+ * object.c (rb_mod_const_get): avoid inadvertent symbol creation.
- * object.c (rb_mod_module_exec): don't declare functions declared in
- include/ruby/intern.h.
+Wed Nov 7 07:52:50 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jun 18 12:05:08 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * enum.c (rb_enum_cycle_size): prefix with rb.
- * include/ruby/backward/classext.h: for evil gems. fixed #4803
+Wed Nov 7 04:32:15 2012 Luis Lavena <luislavena@gmail.com>
-Sat Jun 18 11:12:13 2011 Tanaka Akira <akr@fsij.org>
+ * test/ruby/test_file_exhaustive.rb: Remove FIXME skip on Windows
+ specific test because the test in question was already fixed.
- * common.mk: update dependencies.
+Wed Nov 7 03:45:12 2012 Luis Lavena <luislavena@gmail.com>
-Sat Jun 18 11:09:03 2011 Tanaka Akira <akr@fsij.org>
+ * ext/zlib/extconf.rb: Recognize zlibwapi as linking library.
+ Patch by Daniel Berger.
- * io.c: suppress warnings.
+ [ruby-core:44979] [Feature #6421]
-Sat Jun 18 10:22:39 2011 Tanaka Akira <akr@fsij.org>
+Wed Nov 7 02:06:40 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * internal.h: declare more internal functions.
+ * enumerator.c: New method #size; constructor accepts size.
+ Have #to_enum accept a block
+ Warn when using deprecated form of constructor
+ Support #size for enumerators created from enumerators
+ Support for lazy.{map|flat_map|...}.size.
- * iseq.h (rb_method_get_iseq): declared.
+ * include/ruby/intern.h: RETURN_SIZED_ENUMERATOR for support of
+ sized enumerators.
- * compile.c, eval.c, eval_error.c, iseq.c, parse.y, proc.c, range.c,
- ruby.c, time.c, util.c, vm.c: don't declare internal functions.
+ * array.c: Support for various enumerator.size.
- * eval.c, parse.y, thread_pthread.c: non-existing function declarations
- removed.
+ * enum.c: ditto.
-Sat Jun 18 08:12:54 2011 Tanaka Akira <akr@fsij.org>
+ * hash.c: ditto.
- * common.mk: dependencies updated.
+ * numeric.c: ditto.
- * tool/update-deps: new file to assist update dependencies in
- common.mk.
+ * range.c: ditto.
-Sat Jun 18 07:27:27 2011 Tanaka Akira <akr@fsij.org>
+ * string.c: ditto.
- * internal.h: declare internal functions here.
+ * struct.c: ditto.
- * node.h: declare NODE dependent internal functions here.
+ * vm_eval.c: ditto.
- * iseq.h: declare rb_iseq_t dependent internal functions here.
+Tue Nov 6 20:40:28 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * vm_core.h: declare rb_thread_t dependent internal functions here.
+ * object.c (rb_mod_const_get): Fix constant missing exception class
+ and message to maintain backwards compatibility. Constant search
+ should start at Object when constant starts with '::'
- * bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
- enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
- iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
- proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
- thread.c, time.c, transcode.c, variable.c, vm.c,
- tool/compile_prelude.rb: don't declare internal functions declared
- in above headers. include above headers if required.
+ * test/ruby/test_module.rb: test for fixes
- Note that rb_thread_mark() was declared as
- void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
- void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
- the later in internal.h.
+Tue Nov 6 16:50:00 2012 Masaki Matsushita <glass.saga@gmail.com>
-Sat Jun 18 02:36:00 2011 Kenta Murata <mrkn@mrkn.jp>
+ * lib/tempfile.rb (Tempfile#inspect): fix confusing #inspect.
+ previous Tempfile#inspect says it is a File, but actually
+ it is not a File.
- * ext/bigdecimal/bigdecimal.c (VpNewRbClass): fix type of the 2nd
- argument.
+ t = Tempfile.new("foo") #=> #<File:/tmp/foo20121106-31970-1ffbum0>
+ t.is_a? File #=> false
- * ext/bigdecimal/bigdecimal.h: ditto.
+ now Tempfile#inspect returns like:
-Sat Jun 18 02:30:00 2011 Kenta Murata <mrkn@mrkn.jp>
+ t = Tempfile.new("foo")
+ #=> #<Tempfile:/tmp/foo20121106-31970-1ffbum0>
- * ext/bigdecimal/bigdecimal.c (BigMath_s_exp): move BigMath.exp from
- bigdecimal/math.rb.
+ [ruby-core:47544] [Bug #7027]
- * ext/bigdecimal/lib/bigdecimal/math.rb: ditto.
+Tue Nov 6 16:22:30 2012 Naohisa Goto <ngotogenome@gmail.com>
- * test/bigdecimal/test_bigdecimal.rb: move test for BigMath.exp from
- test/bigdecimal/test_bigmath.rb.
+ * atomic.h: add #include <sys/atomic.h> for the workaround of
+ header file name conflict of atomic.h with /usr/include/atomic.h
+ on Solaris 10. [ruby-dev:46414] [Bug #7287]
- * test/bigdecimal/test_bigmath.rb: ditto.
+Tue Nov 6 14:38:00 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Jun 18 00:20:54 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * test/win32ole/test_win32ole.rb: now source encoding is UTF-8, so
+ binary strings in old scripts are dangerous.
- * ext/date/date_core.c: do not define wnum[01].
+Tue Nov 6 14:25:09 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Jun 17 18:57:36 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/net/protocol.rb (Net::InternetMessageIO#each_crlf_line):
+ don't use /n in universal regexp. [ruby-dev:46394] [Bug #7278]
- * compile.c (iseq_compile_each): fix return value of obj[a,*b]=c.
+Tue Nov 6 09:42:26 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Jun 17 13:09:45 2011 Eric Hodel <drbrain@segment7.net>
+ * string.c (rb_str_b): Add String#b, returning a copied string
+ whose encoding is ASCII-8BIT. [ruby-dev:45992] [Feature #6767]
- * ext/curses/curses.c: Clean up documentation.
+Tue Nov 6 09:37:57 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Jun 17 09:25:14 2011 Eric Hodel <drbrain@segment7.net>
+ * ruby.c (load_file_internal): set default source encoding as
+ UTF-8 instead of US-ASCII. [ruby-core:46021] [Feature #6679]
- * ext/curses/curses.c: Document curses constants. Patch by Vincent
- Batts. [Ruby 1.9 - Bug #4880]
+ * parse.y (parser_initialize): set default parser encoding as
+ UTF-8 instead of US-ASCII.
-Fri Jun 17 09:11:05 2011 Eric Hodel <drbrain@segment7.net>
+Tue Nov 6 05:48:06 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * object.c: Document Module#method_added and #method_removed.
- Patch by Bryce Kerley. [Ruby 1.9 - Feature #4867]
+ * test/ruby/test_require.rb
+ (TestRequire#test_require_to_path_redefined_in_load_path,
+ TestRequire#test_require_to_str_redefined_in_load_path):
+ Suppress method redefined warning when test-all with RUBYOPT=-w.
-Fri Jun 17 08:50:16 2011 Eric Hodel <drbrain@segment7.net>
+Thu Nov 8 00:24:14 2012 Akinori MUSHA <knu@iDaemons.org>
- * io.c: Improve documentation of IO and File open and new.
- Patch by Roger Pack. [Ruby 1.9 - Bug #4790]
+ * ext/curses/view.rb: Do not fail if the file to view is shorter
+ than the screen height.
-Fri Jun 17 07:53:50 2011 Eric Hodel <drbrain@segment7.net>
+Mon Nov 5 11:40:00 2012 Mark Somerville <mark@scottishclmibs.com>
- * lib/csv.rb: Document #raw_encoding. Patch by David Czarnecki.
- [Ruby 1.9 - Bug #4874]
+ * thread_pthread.c (rb_reserved_fd_p): fix typo in macro check
+ that prevented the ifdef ever being true.
+ [Bug #7281] [ruby-core:48940]
-Fri Jun 17 07:46:50 2011 Eric Hodel <drbrain@segment7.net>
+Mon Nov 5 23:28:57 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * lib/benchmark.rb: Document Benchmark::Tms#memberwise. Patch by
- David Czarnecki. [Ruby 1.9 - Bug #4873]
+ * file.c (rb_get_path_check_to_string): extract from
+ rb_get_path_check(). We change the spec not to call to_path of
+ String object.
-Fri Jun 17 07:38:31 2011 Eric Hodel <drbrain@segment7.net>
+ * file.c (rb_get_path_check_convert): extract from rb_get_path_check().
- * lib/prettyprint.rb: Improve documentation. Patch by Ysiad
- Ferreiras. [#4834]
+ * file.c (rb_get_path_check): follow the above change.
-Fri Jun 17 07:23:03 2011 Eric Hodel <drbrain@segment7.net>
+ * file.c (rb_file_expand_path_fast): remove check_expand_path_args().
+ Instead we call it in load.c.
- * array.c (rb_ary_drop): Improve documentation. Patch by Caley Woods.
- [Ruby 1.9 - Bug #4858]
+ * file.c (rb_find_file_ext_safe): use rb_get_expanded_load_path() to
+ reduce expand cost.
-Fri Jun 17 06:11:31 2011 Eric Hodel <drbrain@segment7.net>
+ * file.c (rb_find_file_safe): ditto.
- * lib/webrick/log.rb: Improve documentation of BasicLog and Log.
- Patch by Olivier Brisse. [Ruby 1.9 - Bug #4833]
- * lib/webrick/httpstatus.rb: Improve documentation of
- WEBrick::HTTPStatus. Patch by Olivier Brisse.
- [Ruby 1.9 - Bug #4833]
+ * internal.h (rb_get_expanded_load_path): add a declaration.
-Fri Jun 17 04:48:22 2011 Koichi Sasada <ko1@atdot.net>
+ * internal.h (rb_get_path_check_to_string, rb_get_path_check_convert):
+ add declarations.
- * thread_pthread.c, thread_pthread.h: remove unused variables.
- (native_thread_data_t::gvl_cond, native_thread_data_t::gvl_next)
+ * load.c (rb_construct_expanded_load_path): fix for compatibility.
+ Same checks in rb_get_path_check() are added. We don't replace
+ $LOAD_PATH and ensure that String object of $LOAD_PATH are frozen.
+ We don't freeze non String object and expand it every time. We add
+ arguments for expanding load path partially and checking if load path
+ have relative paths or non String objects.
-Thu Jun 16 14:32:31 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * load.c (load_path_getcwd): get current working directory for checking
+ if it's changed when getting load path.
- * time.c (rb_time_new): prevent overflow by "* 1000".
+ * load.c (rb_get_expanded_load_path): fix for rebuilding cache properly.
+ We check if current working directory is changed and rebuild expanded
+ load path cache. We expand paths which start with ~ (User HOME) and
+ non String objects every time for compatibility. We make this
+ accessible from other source files.
-Fri Jun 17 03:07:36 2011 Koichi Sasada <ko1@atdot.net>
+ * load.c (rb_feature_provided): call rb_get_path() since we changed
+ rb_file_expand_path_fast() not to call it.
- * benchmark/bm_vm4_thread_create_join.rb,
- benchmark/bm_vm4_thread_mutex[1-3].rb: renamed to
- bm_thread_* (fix last rename).
+ * load.c (Init_load): initialize vm->load_path_check_cache.
-Fri Jun 17 02:26:47 2011 Koichi Sasada <ko1@atdot.net>
+ * vm.c (rb_vm_mark): mark vm->load_path_check_cache for GC.
- * thread_pthread.c (native_thread_create): fix debug message.
- (add last newline)
+ * vm_core.h (rb_vm_struct): add vm->load_path_check_cache to store data
+ to check load path cache validity.
-Thu Jun 16 23:40:49 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/ruby/test_require.rb (TestRequire): add tests for require
+ compatibility related to cached expanded load path.
+ [ruby-core:47970] [Bug #7158]
- * thread.c (rb_thread_schedule_rec): fix {UN,}LIKELY macro misuse.
- * gc.c (rb_newobj): ditto.
- * vm_insnhelper.c (vm_method_search): ditto.
+Mon Nov 5 23:26:05 2012 Greg Price <price@mit.edu>
-Thu Jun 16 20:06:15 2011 Shota Fukumori <sorah@tubusu.net>
+ * load.c (rb_get_expanded_load_path): cache the expanded load
+ path. This saves 4KB of allocation and some stats for every
+ element of the load path (so nearly a MB in my Rails app)
+ on every require.
- * test/testunit/test_parallel.rb: Fix Regexp for test.
+ * load.c (rb_construct_expanded_load_path): ensure that $LOAD_PATH
+ entries are frozen strings. The user must mutate $LOAD_PATH
+ itself rather than its individual entries.
- * test/testunit/tests_for_parallel/test_third.rb: Use
- Test::Unit::TestCase#on_parallel_worker? for detecting worker.
+ * vm_core.h (rb_vm_struct): add fields.
- * lib/test/unit/testcase.rb(Test::Unit::TestCase#on_parallel_worker?):
- New Method Test::Unit::TestCase#on_parallel_worker? returns true
- when a testcase is running on parallel worker.
- * lib/test/unit/parallel.rb(Test::Unit::TestCase#on_parallel_worker?):
- ditto.
+ * vm.c (rb_vm_mark): mark new fields.
-Thu Jun 16 19:27:12 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+ * ruby.c (process_options): modify $LOAD_PATH directly rather than
+ its elements.
+ Patch by Greg Price.
+ [ruby-core:47970] [Bug #7158]
- * test/test_securerandom.rb: Add testcase. This testcase does NOT aim
- to test cryptographically strongness and randomness. It includes
- the test for PID recycle issue of OpenSSL described in #4579 but
- it's disabled by default.
+Mon Nov 5 23:24:42 2012 Greg Price <price@mit.edu>
-Thu Jun 16 17:55:07 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * load.c (rb_feature_p, rb_provide_feature): index $LOADED_FEATURES
+ so that require isn't so slow.
- * test/ruby/test_io.rb (TestIO#test_copy_stream_socket): fix
- test hanging up issue. Patch by CHIKANAGA Tomoyuki.
+ * load.c (rb_provide_feature, get_loaded_features_index): ensure
+ that $LOADED_FEATURES entries are frozen strings. The user
+ must mutate $LOADED_FEATURES itself rather than its individual
+ entries.
-Thu Jun 16 15:17:39 2011 Eric Hodel <drbrain@segment7.net>
+ * load.c (reset_loaded_features_snapshot): add a new function to reset
+ vm->loaded_features_snapshot.
- * variable.c (const_missing): Add simple example of const_missing.
- Patch by Anuj Dutta. [Ruby 1.9 - Bug #4794]
+ * load.c (get_loaded_features_index_raw): add a new function to get
+ the loaded-features index.
-Thu Jun 16 15:09:29 2011 Eric Hodel <drbrain@segment7.net>
+ * load.c (features_index_add_single): add a new function to add to the
+ loaded-features index a single feature.
- * lib/monitor.rb: Improve documentation. Patch by Sandor Szucs.
- [Ruby 1.9 - Bug #4823]
+ * load.c (features_index_add): add a new function to add to the
+ loaded-features index all the required entries for `feature`.
-Thu Jun 16 14:54:09 2011 Eric Hodel <drbrain@segment7.net>
+ * vm_core.h (rb_vm_struct): add fields.
- * lib/webrick/utils.rb: Document WEBrick::Utils. Patch by Olivier
- Brisse. [Ruby 1.9 - Bug #4819]
+ * vm.c (rb_vm_mark): mark new fields.
-Thu Jun 16 14:26:46 2011 Eric Hodel <drbrain@segment7.net>
+ * include/ruby/intern.h (rb_hash_clear): declare function.
- * lib/webrick/httpservlet/erbhandler.rb: Allow the ERB document to
- alter the content-type of the response. [Ruby 1.9 - Bug #4685]
+ * hash.c (rb_hash_clear): make function non-static.
+ Patch by Greg Price.
+ [ruby-core:47970] [Bug #7158]
-Thu Jun 16 14:15:47 2011 Eric Hodel <drbrain@segment7.net>
+Mon Nov 5 23:23:51 2012 Greg Price <price@mit.edu>
- * lib/timeout.rb: Clarify timeout duration types. Patch by Alf Mikula.
- [Ruby 1.9 - Bug #4791]
- * lib/net/http.rb: ditto
+ * array.c (rb_ary_shared_with_p): new function.
+ Expose whether two arrays are shared (read-only, C only).
-Thu Jun 16 13:25:25 2011 Eric Hodel <drbrain@segment7.net>
+ * include/ruby/intern.h (rb_ary_shared_with_p): declare.
+ Patch by Greg Price.
+ [ruby-core:47970] [Bug #7158]
- * lib/rdoc*: Import RDoc 3.7 release candidate
+Mon Nov 5 23:21:14 2012 Greg Price <price@mit.edu>
-Thu Jun 16 11:35:09 2011 Shugo Maeda <shugo@ruby-lang.org>
+ * load.c (loaded_feature_path): clarify and briefly comment
+ function. These clarifications have no effect on the behavior
+ of the function.
- * lib/net/imap.rb (search_response): parses SEARCH responses from
- the Yahoo IMAP server correctly. patched by Mark Nadig. [Bug #4509]
+ * load.c (rb_feature_p): explain the search loop. Especially
+ useful because the logic is complicated as described in the
+ second paragraph.
+ Patch by Greg Price.
+ [ruby-core:47970] [Bug #7158]
-Thu Jun 16 09:12:38 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Nov 5 22:45:03 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * fix for build on solaris 10.
+ * ext/dl/win32/lib/Win32API.rb (Win32API#call): use 64bit pointer for x64
+ Windows. This would fix
+ TestSecureRandom#test_s_random_bytes_without_openssl error.
+ [ruby-core:47451] [Bug #6990]
-Thu Jun 16 09:08:39 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Nov 5 22:09:26 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * test/io/console/test_io_console.rb (TestIO_Console#test_sync):
- fix for daemon process.
+ * cygwin/GNUmakefile.in (uncommon.mk): link *.res.o.
+ EXTOBJES is defined in uncommon.mk. *.res.o setting should be below
+ uncommon.mk.
+ [ruby-core:48858] [Bug #7277]
-Thu Jun 16 07:58:01 2011 Shota Fukumori <sorah@tubusu.net>
+Mon Nov 5 11:35:11 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/testunit/test_parallel.rb(test_ignore_tzero): Test for r32109.
+ * thread_pthread.c (native_thread_init, native_thread_destroy):
+ removed HAVE_PTHREAD_CONDATTR_INIT check because this silly
+ #ifdef makes use-uninitialized-var issue and (2) native_cond_initialize()
+ already have a right platform and caller don't need any additional care.
+ [Bug #6825]
- * test/testunit/tests_for_parallel/test_third.rb: Use another way to
- detect that test is running on worker. This fixes sometimes
- TestParallel failing.
+Mon Nov 5 10:57:59 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Jun 16 07:20:06 2011 Shota Fukumori <sorah@tubusu.net>
+ * lib/cgi/core.rb: check if Tempfile is defined before use it.
- * lib/test/unit.rb(Test::Unit::Runner#_run_parallel): Ignore -j0
- because it makes blocking forever by IO.select.
+ * lib/cgi/core.rb: remove tempfiles only if tempfiles exist
-Thu Jun 16 03:08:11 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Nov 5 12:17:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * test/testunit/test_parallel.rb (TestParallel::TestParallelWorker#
- setup): now can run on Windows, probably.
+ * lib/uri/http.rb (URI::HTTP.build): Fix example
+ Patch by Carina C. Zona
+ [Fixes #209 Github]
- * test/testunit/test_parallel.rb (TestParallel::TestParallel#setup):
- ditto.
+Mon Nov 5 09:55:05 2012 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
+
+ * lib/cgi/core.rb: remove tempfile more early.
+
+Sun Nov 4 20:29:46 2012 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
+
+ * lib/cgi.rb, lib/cgi/*/rb: rename CGI#header to CGI#http_header,
+ add and update HTML5 tag generator. [Bug #7110]
+ Patch provided by Marcus Stollsteimer, thank you !
+
+Sun Nov 4 11:47:39 2012 Masaki Matsushita <glass.saga@gmail.com>
+
+ * lib/fileutils.rb (module FileUtils): repatch [ruby-core:39622]
+ [Feature #5337]. improve performance of FileUtils.compare_stream.
+ [ruby-core:47545] [Feature #7028]
-Thu Jun 16 03:00:26 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Sun Nov 4 11:27:54 2012 Masaki Matsushita <glass.saga@gmail.com>
- * thread.c (do_select): Windows: no need to poll if select(2) is
- cancelable.
+ * array.c (recursive_equal): fix to return true when self and other
+ are resized to same size and the current index become out of
+ range.
- * thread_win32.c (native_fd_select): new function to make select(2)
- cancelable.
+ * test/ruby/test_array.rb: add a test for the above.
- * thread_win32.c (rb_w32_check_interrupt): new function for checking
- interrupt.
+Sun Nov 4 10:19:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (rb_w32_select_with_thread): new function. cancelable
- select(2).
+ * dir.c (file_s_fnmatch): match with expanding braces if FNM_EXTGLOB
+ is set. [ruby-core:40037] [Feature #5422]
+
+Sat Nov 3 23:38:15 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * complex.c: modified doc.
+ * rational.c: ditto.
+
+Sat Nov 3 22:38:55 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: modified doc.
- * win32/win32.c (rb_w32_select): use above function internally.
+Sat Nov 3 18:35:55 2012 Kazuki Tsujimoto <kazuki@callcc.net>
-Wed Jun 15 23:30:45 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * vm.c (rb_vm_rewrite_ep_in_errinfo, vm_rewrite_ep_in_errinfo):
+ merge code and remove `rb_vm_rewrite_ep_in_errinfo'.
- * gc.c: fix a regression by r31690 on AIX because AIX malloc
- return NULL if it's passed 0. But some caller don't expect it.
- patch by Yutaka Kanemoto. [ruby-dev:43779]
- (vm_malloc_prepare): return calculated size.
- (vm_xmalloc): use above result.
- (vm_xcalloc): ditto.
+Sat Nov 3 18:15:24 2012 Kazuki Tsujimoto <kazuki@callcc.net>
-Wed Jun 15 23:11:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * vm.c, proc.c: avoid unnecessary `rb_vm_rewrite_ep_in_errinfo'
+ calls.
- * thread.c: remove BLOCKING_REGION_CORE() macro. It's no longer used
- since r32022.
+Sat Nov 3 17:53:43 2012 Kouhei Sutou <kou@cozmixng.org>
-Wed Jun 15 21:00:47 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * bin/testrb: Use only Test::Unit::AutoRunner in test-unit gem
+ compatible API to be available by both test/unit bundled in Ruby
+ and test-unit gem.
+ * lib/test/unit.rb (Test::Unit::AutoRunner): Move codes from testrb.
- * test/openssl/test_config.rb: execute based on the existence of the
- OpenSSL module.
+Sat Nov 3 14:56:21 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Wed Jun 15 12:35:11 2011 Tanaka Akira <akr@fsij.org>
+ * ext/date/date_parse.c (parse_eu): should capture apostrophe too.
- * test/ruby/test_io.rb (test_copy_stream_socket): wait a child process
- before SIGUSR1 handler is removed.
+Sat Nov 3 14:46:15 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * test/pathname/test_pathname.rb (define_assertion): use line number
- for test method names.
+ * ext/date/date_parse.c (date__parse): revised the tight parser.
-Wed Jun 15 10:37:43 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Sat Nov 3 14:43:42 2012 Kouhei Sutou <kou@cozmixng.org>
- * file.c (rb_stat_rdev): use DEVT2NUM.
+ * lib/rexml/xmldecl.rb (REXML::XMLDecl#content): Add missing \A
+ and \z.
- * file.c (rb_stat_rdev_major): ditto.
+Sat Nov 3 14:42:55 2012 Kouhei Sutou <kou@cozmixng.org>
- * file.c (rb_stat_rdev_minor): ditto.
+ * lib/rexml/output.rb (REXML::Output#initialize): Use normalized
+ encoding name.
-Wed Jun 15 05:12:59 2011 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Sat Nov 3 14:41:17 2012 Kouhei Sutou <kou@cozmixng.org>
- * ext/tk/tcltklib.c (lib_eventloop_core): revert the last change (it's
- the part for ruby_1_8), and use rb_thread_check_ints() when RUBY_VM
+ * lib/rexml/output.rb (REXML::Output): Don't output BOM in middle
+ of the output string.
+ * test/rexml/test_document.rb: Add a test for the above change.
+
+Sat Nov 3 14:09:55 2012 Kouhei Sutou <kou@cozmixng.org>
+
+ * NEWS: Add an item about REXML::Document#write.
+
+Sat Nov 3 13:46:49 2012 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_document.rb: Fix tests that expect encoding name
+ isn't normalized.
+
+Sat Nov 3 13:26:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * dir.c (Dir#glob):
+ Documentation for pattern section, backslash subsection
+ Patch by Eric Bouchut
+ [ruby-core:48528] [Bug #7230]
+
+Sat Nov 3 13:26:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * io.c (IO#new):
+ Documentation for IO#open modes and formatting
+ [ruby-core:48052] [Bug #7179]
+
+Sat Nov 3 13:01:02 2012 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_encoding.rb (EncodingTester#test_in_different_out):
+ Fix a test that expects encoding in XML declaration is changed by
+ Output's encoding. It is dropped feature.
+
+Sat Nov 3 12:49:45 2012 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/document.rb (REXML::Document#write): Document encoding
+ option. Now different encoding between XML file's encoding and
+ XML declaration's encoding is support.
+ [Feature #4872] (work in progress)
+ * lib/rexml/xmldecl.rb (REXML::XMLDecl#write): Always use XMLDecl's
+ encoding.
+ * test/rexml/test_document.rb: Update tests for the above change.
+
+Sat Nov 3 12:18:35 2012 Masaki Matsushita <glass.saga@gmail.com>
+
+ * array.c (recursive_equal): fix not to make invalid pointers when
+ self and other are resized to same size in #== of their elements.
+ [ruby-dev:46373] [Feature #6177]
+
+Sat Nov 3 12:06:15 2012 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_xml_declaration.rb (TestXmlDeclaration#test_*):
+ Remove needless prefix from test names.
+
+Sat Nov 3 12:04:52 2012 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_xml_declaration_parent_child.rb: Rename to ...
+ * test/rexml/test_xml_declaration.rb: ... this.
+
+Sat Nov 3 11:43:00 2012 Zachary Scott <zachary@zacharyscott.net>
+
+ * hash.c (rb_hash_delete): Correct grammar
+ Patch by Glenn Oppegard
+ [Fixes #208 Github]
+
+Sat Nov 3 11:28:28 2012 Narihiro Nakamura <authornari@gmail.com>
+
+ * NEWS: add a news about GC::Profiler.raw_data.
+
+Sat Nov 3 11:01:32 2012 Narihiro Nakamura <authornari@gmail.com>
+
+ * NEWS: add a news about rb_newobj_of() and NEWOBJ_OF().
+
+Sat Nov 3 10:17:41 2012 Narihiro Nakamura <authornari@gmail.com>
+
+ * eval.c (f_current_dirname): add the new method for Kernel.
+ This method almost same as File.dirname(__FILE__). One
+ different behavior is it returns nil when __FILE__ returns nil.
+ [Feature #3346]
+
+ * NEWS: ditto
+
+ * test/ruby/test_method.rb: related test.
+
+Sat Nov 3 09:03:34 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * test/ruby/test_refinement.rb (test_new_method_by_send,
+ test_new_method_by_method_object): add tests for Kernel#send and
+ Kernel#method with refinements.
+
+ * test/ruby/test_refinement.rb (test_symbol_to_proc): add a test
+ calling a proc created by Symbol#to_proc outside the scope where
+ a refinement is closed over.
+
+Sat Nov 3 04:14:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm.c (rb_vm_rewrite_ep_in_errinfo): rewrite all catch points in
+ errinfo, not only the topmost frame. based on the patch by
+ ktsj (Kazuki Tsujimoto) in [ruby-dev:45656]. [Bug #6460]
+
+Fri Nov 2 20:11:17 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (MakeMakefile#timestamp_file): remove @ which looks like
+ configure variables.
+
+ * lib/mkmf.rb (MakeMakefile#timestamp_file): use .-. instead of !, a
+ special character of NMAKE and BSD make. [Bug #7265]
+
+Fri Nov 2 17:55:39 2012 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/test/unit.rb (_run_parallel): Delete status line before showing
+ results. Patch by Hiroshi Shirosaki. [Bug #6897] [ruby-core:47250]
+
+ * lib/test/unit.rb (_run_parallel): Fix strange result when disabled retrying.
+ Patch by Hiroshi Shirosaki. [Bug #6897] [ruby-core:47250]
+
+Fri Nov 2 17:52:12 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * object.c (rb_mod_to_s): Module#{to_s,inspect}, when invoked on
+ a refinement, returns a string in the format #<refinement:C@M>,
+ where C is a refined class and M is a module at which the refinement
is defined.
-Wed Jun 15 04:42:47 2011 Koichi Sasada <ko1@atdot.net>
+ * eval.c (rb_mod_refine): store information on a refinement for the
+ above change.
+
+ * test/ruby/test_refinement.rb: related test.
- * benchmark/bm_vm3_thread_*.rb: renamed bm_vm3_thread_*.rb to
- benchmark/bm_vm_thread_*.rb.
+Fri Nov 2 16:57:52 2012 Shota Fukumori <sorah@tubusu.net>
-Wed Jun 15 04:28:39 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * vm_dump.c (rb_vm_bugreport): Because of many log directories,
+ making directory lists readable.
- * benchmark/bm_vm4_thread_pass.rb: rename bm_vm4* to
- bm_vm_thread_*. suggested by ko1.
- * benchmark/bm_vm4_pipe.rb: ditto.
- * benchmark/bm_vm4_alive_check1.rb: ditto.
- * benchmark/bm_vm4_pass_flood.rb: ditto.
+Fri Nov 2 16:44:00 2012 Kenta Murata <mrkn@mrkn.jp>
-Wed Jun 15 03:52:50 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * vm_dump.c (rb_vm_bugreport): add ~/Library/Logs/DiagnosticReports
+ in the locations list of crash reports.
- * benchmark/bm_vm4_pass_flood.rb: new benchmark for GVL fairness.
- * benchmark/bm_vm4_alive_check1.rb: ditto.
+Fri Nov 2 14:52:52 2012 Masaki Matsushita <glass.saga@gmail.com>
-Wed Jun 15 01:27:53 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * array.c (recursive_equal): performance improvement by avoiding
+ overhead to call rb_ary_elt().
+ [ruby-dev:45412] [Feature #6177]
- * thread_pthread.c (gvl_yield): fix live lock issue on 1-2 cpus
- system. It's additional fix for r32021.
- * thread_pthread.c (gvl_init): add switch_wait_cond.
- * thread_pthread.h (typedef struct rb_global_vm_lock_struct): ditto.
+Fri Nov 2 14:47:53 2012 Shugo Maeda <shugo@ruby-lang.org>
-Tue Jun 14 23:16:22 2011 Tanaka Akira <akr@fsij.org>
+ * string.c (sym_to_proc, sym_call): A Proc created by Symbol#to_proc
+ should close over the current refinements.
+ [ruby-dev:46345] [Bug #7261]
- * bootstraptest/runner.rb (show_progress): refine verbose mode.
- (exec_test): ditto.
+ * vm_eval.c (rb_call0, rb_search_method_entry,
+ rb_funcall_passing_block_with_refinements): add a new argument
+ `refinements' for the above changes.
-Tue Jun 14 23:02:36 2011 Tanaka Akira <akr@fsij.org>
+ * test/ruby/test_refinement.rb: related test.
- * bootstraptest/runner.rb (show_progress): extracted from assert_check.
- (assert_check): use show_progress.
- (assert_normal_exit): ditto.
- (assert_finish): ditto.
- (flunk): ditto.
+Fri Nov 2 08:24:28 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jun 14 22:51:42 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * proc.c (top_define_method): new method, main.define_method.
+ [ruby-core:45715] [Feature #6609]
- * test/date/test_*.rb: added tests.
+ * eval.c (top_include): fix a warning message, main is not a class or
+ module.
-Tue Jun 14 22:09:58 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Fri Nov 2 04:41:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/date/date_core.c: renamed some functions.
- * ext/date/date_core.c: modified doc.
+ * lib/mkmf.rb (MakeMakefile#timestamp_file): use ! instead of %, a GNU
+ make special character.
-Tue Jun 14 21:26:01 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+Fri Nov 2 04:40:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * cont.c (cont_save_thread): add new utility function.
- rb_context_t::saved_thread.machine_stack_start and
- machine_stack_end should be cleared immediately after a snapshot of
- current thread is stored to saved_thread. [ruby-dev:43680] [Bug #4855]
- this change aims to get rid of unnecessary GC mark at machine stack.
+ * test/ruby/test_process.rb (test_execopts_preserve_env_on_exec_failure):
+ use never existing file in the current temporary directory.
-Tue Jun 14 19:50:49 2011 Tanaka Akira <akr@fsij.org>
+Fri Nov 2 04:23:20 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * test/ruby/test_autoload.rb: remove temporary directory.
+ * tool/merger.rb: add feature to tag preview/rc.
-Tue Jun 14 11:05:03 2011 Narihiro Nakamura <narihiro@netlab.jp>
+Fri Nov 2 03:23:37 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * gc.c (rb_gc_set_params): call initial_expand_heap if
- initial_heap_min_slots is set.
+ * lib/mkmf.rb: fix for if config["libdir"] is nil.
-Tue Jun 14 11:02:08 2011 Narihiro Nakamura <narihiro@netlab.jp>
+Thu Nov 1 23:06:01 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * gc.c: use size_t.
+ * tool/make-snapshot: fix wrong regexp for releasing preview.
+ patched by mame.
-Tue Jun 14 01:10:38 2011 Yusuke Endoh <mame@tsg.ne.jp>
+Thu Nov 1 22:27:11 2012 Koichi Sasada <ko1@atdot.net>
- * test/coverage/test_coverage.rb: add a test for restart. a patch
- from Xavier Shay. [ruby-core:36745]
+ * NEWS: add a news about objspace,
+ ObjectSpace.reachable_objects_from.
-Tue Jun 14 01:05:10 2011 Yusuke Endoh <mame@tsg.ne.jp>
+Thu Nov 1 21:57:00 2012 Kenta Murata <mrkn@mrkn.jp>
- * ext/coverage/coverage.c: make it restartable. [ruby-core:36539]
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_new),
+ test/bigdecimal/test_bigdecimal.rb:
+ Fix exception message of BigDecimal constructor with a Float.
-Mon Jun 13 23:55:40 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Thu Nov 1 21:52:20 2012 Kenta Murata <mrkn@mrkn.jp>
- * thread.c (rb_thread_schedule_rec): call gvl_yield() unconditionally.
- * thread_pthread.c: remove HAVE_GVL_YIELD macro.
- * thread_win32.c (gvl_yield): new. this fallback logic was moved from
- rb_thread_schedule_rec().
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_add),
+ test/bigdecimal/test_bigdecimal.rb:
+ need to specify precision for converting Rational and Float.
+ [ruby-core:48045] [Bug #7176]
-Mon Jun 13 23:50:25 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Nov 1 21:42:20 2012 Yusuke Endoh <mame@tsg.ne.jp>
- * ext/io/console/console.c (console_dev): typo.
+ * test/ruby/test_process.rb: Revert r37404. My ubuntu box has
+ actually the directory named "/nonexistent"... Sorry.
-Mon Jun 13 23:38:23 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Nov 1 21:28:28 2012 Yusuke Endoh <mame@tsg.ne.jp>
- * parse.y (parser_parse_string): flush delayed token. based on a
- patch by Masaya Tarui in [ruby-dev:43762]. Bug #4544
+ * test/ruby/test_process.rb: Process.exec raised EACCES on Linux
+ 3.5.0-17-generic. This is a temporal fix to rescue that exception.
+ Needs kosaki's review.
- * parse.y (yylex): revert r24557. delayed token at the end of
- string should be flushed already by the above change.
+Thu Nov 1 21:19:56 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jun 13 23:33:31 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * iseq.c (set_relation): parent_iseq need to be set regardless iseq
+ type. fix r37397.
- * ext/io/console/console.c (console_dev): console should be
- unbuffered.
+Thu Nov 1 19:47:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/io/console/console.c (console_dev): take care of no-ctty
- case.
+ * thread_pthread.c (RUBY_STACK_MIN): may not a compile time constant.
+ fix r37079. [ruby-dev:46322] [Bug #7247]
-Mon Jun 13 23:06:12 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Thu Nov 1 16:44:36 2012 Shugo Maeda <shugo@ruby-lang.org>
- * thread_pthread.c: rewrite GVL completely. This fix improve some
- benchmark dramatically (e.g. vm3_thread_mutex result changed
- form 120.601sec to 3.426sec).
- * thread_win32.c: ditto.
- * thread_pthread.h: ditto.
- * vm_core.h: ditto.
- * thread.c: ditto.
+ * NEWS: add note for Module#refine, Module#refinements,
+ Module#using, and Kernel#using.
-Mon Jun 13 23:11:52 2011 Tanaka Akira <akr@fsij.org>
+Thu Nov 1 14:41:47 2012 Shugo Maeda <shugo@ruby-lang.org>
- * test/socket/test_unix.rb: don't use Thread.abort_on_exception.
+ * eval.c (rb_using_module): using should be used indirectly.
+ [ruby-dev:46326] [Feature #7251]
-Mon Jun 13 23:05:01 2011 Tanaka Akira <akr@fsij.org>
+Wed Oct 31 18:17:38 2012 Narihiro Nakamura <authornari@gmail.com>
- * ext/socket/unixsocket.c (unix_send_io): race condition fixed.
- (unix_recv_io): ditto.
- fixed by Eric Wong. [ruby-core:35574]
+ * gc.c (gc_profile_record): don't define unused variables when
+ GC_PROFILE_MORE_DETAIL is 0.
- * test/socket/test_unix.rb: test added for above problem.
+Wed Oct 31 18:10:53 2012 Narihiro Nakamura <authornari@gmail.com>
-Mon Jun 13 21:41:05 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * gc.c (gc_prof_mark_timer_stop): count is not initialized.
- * thread_win32.c (native_cond_signal): remove unnecessary rb_bug().
- It's additional fix for r32021. [Bug #4696]
+Wed Oct 31 09:28:24 2012 Eric Hodel <drbrain@segment7.net>
-Mon Jun 13 20:50:49 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * thread.c (rb_thread_call_without_gvl2): Note that ubf() may or may
+ not be called with the GVL. Hinted that rb_thread_call_with_gvl()
+ can be used to access ruby functionality.
- * test/openssl/test_ec.rb
- test/openssl/test_pkey_ec.rb: merge both files into test_pkey_ec.rb.
- Removed redundant group instantiation from PKey tests.
- * test/openssl/utils.rb: only create TEST_PKEY_EC_P256V1 if EC is
- defined.
+Wed Oct 31 09:06:54 2012 Eric Hodel <drbrain@segment7.net>
-Mon Jun 13 20:28:24 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * thread.c (rb_thread_call_without_gvl2): Update documentation to
+ natural English.
+ * thread.c (rb_thread_call_with_gvl): ditto.
- * test/openssl/digest.rb: remove MDC2 from test, it is not available
- by default in an OpenSSL installation.
+Wed Oct 31 02:53:07 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Mon Jun 13 20:18:55 2011 Koichi Sasada <ko1@atdot.net>
+ * ext/dl/lib/dl/struct.rb: fix strange require order. [ruby-dev:45702]
- * vm_core.h, vm_insnhelper.h: move decl. of
- ruby_vm_global_state_version and related macros
- from vm_core.h to vm_insnhelper.h.
+ * ext/dl/lib/dl/value.rb: ditto
- * vm.c (vm_clear_all_cache): added. This function is called
- when ruby_vm_global_state_version overflows.
- TODO: vm_clear_all_inline_method_cache() is only place holder.
- We need to implement it ASAP.
+ * test/dl/test_c_struct_entry.rb: remove strange require order from
+ tests.
- * vm_method.c (vm_clear_global_method_cache): added.
+ * test/dl/test_c_union_entity.rb: ditto
-Mon Jun 13 19:46:21 2011 Keiju Ishitsuka <keiju@ishitsuka.com>
+Tue Oct 30 23:59:32 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/cmath.rb: add new method Object#real?. fix #3137
+ * eval.c (rb_mod_refine): fix the error message when no block is
+ given. [ruby-dev:46319] [Bug #7244]
-Mon Jun 13 18:52:00 2011 Kenta Murata <mrkn@mrkn.jp>
+ * test/ruby/test_refinement.rb: related test.
- * ext/bigdecimal/bigdecimal.c (is_kind_of_BigDecimal): new function to
- examine the whether the object is kind of BigDecimal.
+Tue Oct 30 19:27:48 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Jun 13 18:49:00 2011 Kenta Murata <mrkn@mrkn.jp>
+ * process.c (redirect_dup2): set standard handles when new fd is stdio,
+ because if there is no allocated console at the moment Windows does
+ not automatically associate it for child process's standard handle.
+ this is adhoc workaround.
+ reported by Martin Thiede at [ruby-core:48542] [Bug #7239].
- * ext/bigdecimal/bigdecimal.c (BigDecimalCmp): use GetVpValueWithPrec
- for Float and Rational arguments.
+ * io.c (rb_cloexec_dup2): ditto.
- * test/bigdecimal/test_bigdecimal.rb (test_new, test_cmp, test_power):
- add and modify tests for the above change.
+Tue Oct 30 03:08:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/bigdecimal/bigdecimal.c (BigDecimalCmp): modify coding style to
- match ruby's standard.
+ * lib/rbconfig/obsolete.rb (Config): re-introduce warnings for a
+ lame-duck. [ruby-core:46836] [Bug #6809]
-Mon Jun 13 18:33:04 2011 Tanaka Akira <akr@fsij.org>
+Tue Oct 30 02:20:10 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/securerandom.rb (SecureRandom.random_bytes): modify PRNG state
- to prevent random number sequence repetition at forked child
- process which has same pid.
- reported by Eric Wong. [ruby-core:35765]
+ * thread.c: added Thread#thread_variable_(get|set),
+ Thread#thread_variable?, and Thread#thread_variables for operating
+ on variables that are local to threads. [ruby-core:47790]
-Mon Jun 13 17:02:34 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * vm.c: ditto
- * lib/net/http.rb (Net::HTTP#use_ssl?): require 'openssl' only when
- https is needed. fixes r31933.
+ * test/ruby/test_thread.rb: tests for thread variables.
-Mon Jun 13 14:35:00 2011 Kenta Murata <mrkn@mrkn.jp>
+Mon Oct 29 18:22:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/cmath.rb (CMath.cbrt): returns the principal value of the cube
- root of the argument. fix #3676
+ * ext/stringio/stringio.c (strio_close): close separately per each
+ instances, as well as IO.
- * test/test_cmath.rb (test_cbrt_returns_principal_value_of_cube_root):
- test for the above change.
+Mon Oct 29 10:22:00 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Mon Jun 13 14:17:00 2011 Kenta Murata <mrkn@mrkn.jp>
+ * ext/psych/lib/psych/handlers/recorder.rb: added a class for
+ recording YAML parse and emit events.
- * lib/test/unit.rb (Test::Unit::GlobOption#non_options): fix typo.
+ * ext/psych/lib/psych/handler.rb: adding a list of events so that
+ handler classes can more easily be meta-programmed.
-Mon Jun 13 13:04:20 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * test/psych/handlers/test_recorder.rb: tests for the change.
- * ext/openssl/ossl_digest.c: fix error for digests that have no oid
- (e.g. DSS1).
- * test/openssl/test_digest.c: add tests for this.
+Mon Oct 29 05:48:52 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Mon Jun 13 12:51:51 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/ostruct.rb: Add [] and []=, base on a patch by Thomas Sawyer.
+ Also accept {Open}Struct as argument to new.
+ Add #eql?, #hash & #each_pair
+ Protect new_ostruct_member
- * lib/yaml.rb: load psych only when syck is not loaded.
+Mon Oct 29 03:20:58 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Mon Jun 13 12:23:39 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/matrix.rb: Fix determinant_e [ruby-dev:46305] [Bug #7228]
-Mon Jun 13 12:23:39 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Sun Oct 28 23:52:25 2012 Kouhei Sutou <kou@cozmixng.org>
- * ext/psych/lib/psych/deprecated.rb (Object#to_yaml_properties):
- undef to_yaml_properties before redefine it.
+ * test/rexml/test_document.rb: Add tests for parsing XML encoded
+ by UTF-8 with BOM.
- * ext/syck/lib/syck/rubytypes.rb: ditto.
+Sun Oct 28 23:47:09 2012 Kouhei Sutou <kou@cozmixng.org>
-Mon Jun 13 11:30:10 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * lib/rexml/source.rb: Move encoding detection code to base class.
+ * lib/rexml/encoding.rb: Remove needless encoding detection code.
- * ext/openssl/ossl_digest.c: allow Digests to be created by sn, ln or
- oid.
- * test/openssl/test_digest.rb: add tests for this.
- [Ruby 1.9 - Feature #4412] [ruby-core:35319]
+Sun Oct 28 21:40:13 2012 Kouhei Sutou <kou@cozmixng.org>
-Mon Jun 13 10:54:03 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * lib/rexml/parsers/baseparser.rb: Fix a bug that UTF-8 is used
+ for UTF-16XX encoded XML that doesn't have encoding="UTF-16" in
+ XML declaration.
+ * test/rexml/test_document.rb: Add tests for the above change.
- * ext/openssl/pkey_dh.c: corrected documentation.
- * test/openssl/utils.rb: add test key for DH.
- * test/openssl/test_pkey_dh.rb: add tests.
+Sun Oct 28 21:37:34 2012 Kouhei Sutou <kou@cozmixng.org>
-Mon Jun 13 10:13:08 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * test/rexml/test_document.rb: Group tests that they parse
+ UTF-16XX encoded XML that has encoding="UTF-16" in XML declaration.
- * ext/openssl/pkey_dh.c: clarify difference between DH#public_key and
- DH#pub_key in documentation.
+Sun Oct 28 21:25:11 2012 Kouhei Sutou <kou@cozmixng.org>
-Mon Jun 13 05:50:43 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * lib/rexml/source.rb (REXML::IOSource#initialize): Reduce
+ @line_break initialize code. It should be done only in #encoding=.
+ * lib/rexml/parsers/baseparser.rb: Don't set UTF-16 encoding to
+ source by encoding="UTF-16" in XML declaration because UTF-16XX
+ source encoding should be set in Source#initialize or
+ IOSource#initialize. They should handle BOM. Parser should not
+ consider about it.
- * NEWS: introduce PKey.read.
+Sun Oct 28 21:18:37 2012 Kouhei Sutou <kou@cozmixng.org>
-Mon Jun 13 05:17:29 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * test/rexml/test_document.rb: Add tests for parsing XML encoded
+ by UTF-16 with BOM.
- * ext/openssl/ossl_pkey.c: added PKey.read module function that allows
- reading arbitrary public/private keys from DER-/PEM-encoded File or
- string instances.
- * ext/openssl/ossl_pkey_dh.c: improved documentation.
- * test/openssl/utils.rb: added EC test key.
- * test/openssl/test_pkey_rsa.rb
- test/openssl/test_pkey_dsa.rb: Test PKey.read. Reuse keys from
- OpenSSL::TestUtils.
- * test/openssl/test_pkey_ec.rb: Created test file for EC tests.
- Test PKey.read.
- [Ruby 1.9 - Feature #4424] [ruby-core:35330]
+Sun Oct 28 19:12:11 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Mon Jun 13 04:42:24 2011 Koichi Sasada <ko1@atdot.net>
+ * ext/date/date_parse.c (iso8601_{ext,bas}_time): should not match
+ empty string.
- * ext/objspace/objspace.c (total_i): fix to skip no ruby objects.
+Sun Oct 28 18:51:33 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Mon Jun 13 03:07:38 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/date/date_parse.c (date__parse): revised the tight parser.
- * test/benchmark/test_benchmark.rb (capture_output):
- replace '-' as space. On NetBSD, subtract between two Process.times
- after and before the short process may return negative value like:
- t0=Process.times; yield; t1=Process.times; p t1.utime-t0.utime
+Sun Oct 28 15:41:50 2012 Kouhei Sutou <kou@cozmixng.org>
-Mon Jun 13 02:40:23 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * lib/rexml/document.rb (REXML::Document#write): Add :encoding option
+ to support custom XML encoding.
+ [Feature #4872] (work in progress)
+ * test/rexml/test_document.rb: Add tests for the above change.
- * test/openssl/test_pkey_dsa.rb: Test for DSA#syssign/sysverify.
+Sun Oct 28 15:00:19 2012 Kouhei Sutou <kou@cozmixng.org>
-Mon Jun 13 01:59:19 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * lib/rexml/document.rb (REXML::Document#write): Remove needless
+ indent in document.
- * ext/openssl/ossl_pkey_dh.c: completed documentation.
- * ext/openssl/ossl_pkey_dsa.c: corrected examples. Improved parameter
- sections.
+Sun Oct 28 14:59:14 2012 Kouhei Sutou <kou@cozmixng.org>
-Mon Jun 13 00:25:10 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * lib/rexml/document.rb (REXML::Document#write): Accept options
+ Hash as argument.
+ * test/rexml/test_document.rb: Add tests for the above change.
- * ext/openssl/ossl_pkey_dsa.c: completed documentation.
+Sun Oct 28 14:09:44 2012 Kouhei Sutou <kou@cozmixng.org>
-Sun Jun 12 23:36:46 2011 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+ * lib/rexml/document.rb (REXML::Document#write): Fix wrong usage
+ in document.
- * lib/drb/drb.rb (kill_sub_thread): remove the method. [ruby-core:34185]
+Sun Oct 28 14:03:48 2012 Kouhei Sutou <kou@cozmixng.org>
-Sun Jun 12 21:01:56 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * lib/rexml/document.rb (REXML::Document#write): Fix wrong method
+ names in document.
- * ext/date/date_core.c (d_lite_marshal_load): should give converted value.
+Sun Oct 28 10:12:15 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Sun Jun 12 20:36:30 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: `tree` should return the
+ same thing on every call.
- * ext/date/date_core.c: edited doc.
+ * test/psych/visitors/test_yaml_tree.rb: related test.
-Sun Jun 12 18:12:07 2011 Koichi Sasada <ko1@atdot.net>
+Sun Oct 28 10:05:03 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * benchmark/bm_vm3_clearmethodcache.rb: added.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: YAML Tree object should
+ be able to take an emitter object as it's output.
-Sun Jun 12 17:40:29 2011 Koichi Sasada <ko1@atdot.net>
+ * test/psych/visitors/test_yaml_tree.rb: related test.
- * vm_method.c (rb_clear_cache*): update only vm state version.
+Sun Oct 28 08:23:16 2012 Koichi Sasada <ko1@atdot.net>
- * vm_method.c (rb_method_entry_get_without_cache, rb_method_entry):
- Fill method cache entry with vm state version, and
- check current vm state version for method (cache) look up.
- This modification speed-up invalidating of global method cache table.
- [Ruby 1.9 - Feature #3905] [ruby-core:36908]
+ * bignum.c (bignew_1): Bignum instances are frozen.
+ Feature #3222
-Sun Jun 12 16:19:48 2011 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * include/ruby/ruby.h: Fixnum instances are also frozen.
- * ext/tk/extconf.rb: fail on Mac OS X. [Bug #4853][ruby-dev:43655]
+ * class.c (singleton_class_of): check Bignum before
+ singleton checking.
-Sun Jun 12 15:56:08 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/ruby/test_bignum.rb: add a test.
- * thread.c: remove th->transition_for_lock. It's thread unsafe.
- [Bug #4723][ruby-dev:43563]
+ * test/ruby/test_fixnum.rb: ditto.
-Sun Jun 12 15:47:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/ruby/marshaltestlib.rb, test/ruby/test_eval.rb,
+ test/ruby/test_object.rb: catch up above changes.
- * thread.c: introduce spurious wakeup safe deadlock check.
- [Bug #4696][ruby-dev:43554]
+Sun Oct 28 04:38:06 2012 Koichi Sasada <ko1@atdot.net>
-Sun Jun 12 13:33:52 2011 Koichi Sasada <ko1@atdot.net>
+ * vm.c (vm_define_method): remove type and frozen checking.
+ Checking is done in `rb_singleton_class()'.
- * benchmark/bm_vm3_thread_mutex.rb: remove it.
+Sun Oct 28 00:49:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * benchmark/bm_vm3_thread_mutex[1-3].rb: added 3 benchmarks.
- 1: one thread with one mutex (no contention).
- 2: two threads with one mutex (contention).
- 3: 1000 threads with one mutex (huge number of contention)
- Above removed benchmark was type 3.
- Therefore, this commit adds type 1 and 2 benchmark.
+ * parse.y (assign_in_cond): warn for static content object assignments
+ in conditional statements. [ruby-dev:43083] [Feature #4299]
-Sun Jun 12 11:16:59 2011 Tanaka Akira <akr@fsij.org>
+Sat Oct 27 23:33:41 2012 Benoit Daloze <eregontp@gmail.com>
- * io.c: use select() appropriately for sendfile().
- Fixed by Eric Wong. [ruby-core:36150]
- (maygvl_copy_stream_wait_readwrite): removed.
- (nogvl_copy_stream_sendfile): use nogvl_copy_stream_wait_write and
- maygvl_copy_stream_wait_read instead of
- maygvl_copy_stream_wait_readwrite.
+ * gc.c (gc_profile_result, gc_profile_report): use internal structures
+ to avoid allocations and progressively print the output for #report.
+ [ruby-core:47163] [Bug #6865]
-Sun Jun 12 09:32:13 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Oct 27 11:01:10 2012 Koichi Sasada <ko1@atdot.net>
- * atomic.h (ATOMIC_OR): _InterlockedOr is not available on mingw.h
- * gc.c (rb_gc_set_params): VM_OBJSPACE is disabled on mingw.
+ * numeric.c (rb_float_new_in_heap), include/ruby/ruby.h:
+ make all Float objects frozen.
+ [ruby-dev:46081] [ruby-trunk - Feature #6936]
+ Most part of patch by NARUSE, Yui <naruse@ruby-lang.org>.
-Sun Jun 12 01:07:09 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * class.c (singleton_class_of): raise TypeError when
+ trying to define a singleton method on Float objects.
- * ext/date/date_core.c: edited doc.
+ * vm.c (vm_define_method): ditto.
-Sat Jun 11 23:18:00 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/ruby/marshaltestlib.rb: catch up above changes.
- * vm_core.h (RUBY_VM_SET_TIMER_INTERRUPT, RUBY_VM_SET_INTERRUPT,
- RUBY_VM_SET_FINALIZER_INTERRUPT): use atomic ops for preventing
- interrupt_flag bit lost. [Bug #4770][ruby-dev:43467]
- * thread.c (rb_threadptr_execute_interrupts_rec): ditto.
- * vm_core.h (typedef struct rb_thread_struct): change type of
- interrupt_flag to rb_atomic_t.
- * atomic.h: move atomic ops definition from signal.c.
- * signal.c: remove atomic ops definition.
- * common.mk (gc, signal, thread, cont): add to dependency to atomic.h.
+ * test/ruby/test_class.rb: ditto.
-Sat Jun 11 23:23:52 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * test/test_pp.rb: ditto.
- * ext/date/date_core.c: edited doc.
+Sat Oct 27 10:50:53 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Sat Jun 11 23:02:36 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+ * object.c (rb_mod_const_get): make sure the constant name is
+ converted to a string before searching. [ruby-core:48405]
- * ext/openssl/lib/openssl/buffering.rb (module OpenSSL):
- Buffering#each_byte should return String in accordance with IO in
- 1.9.
+Sat Oct 27 10:12:13 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
- * test/openssl/test_buffering.rb (class OpenSSL): add tests for getc
- and each_byte.
+ * iseq.c (rb_iseq_compile_with_option): Instead of testing
+ respond_to, just check if the argument is actually a file,
+ because by calling user-defined gets something weired can
+ happen. Patch by Glass_saga. [ruby-dev:40202] [Bug #2861]
-Sat Jun 11 22:41:37 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * parse.y (ripper_initialize): ditto.
- * time.c: a correction of doc for strftime (%v).
+Sat Oct 27 10:07:57 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jun 11 22:30:53 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * parse.y (enum lex_state_e): [EXPERIMENTAL] lex_state as bit field /
+ IS_lex_state() macro. based on the patch by Dave B in
+ [ruby-core:23503]. [Feature #1493]
- * ext/date/date_core.c: replaced doc for strftime based on Time's one.
+Sat Oct 27 10:05:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jun 11 22:07:56 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * include/ruby/win32.h (fstat): use _fstati64() instead of fstati64()
+ on mingw32.
- * ext/date/date_core.c (datetime_s_{iso8601,rfc3339,xmlschema,rfc2822,httpdate}):
- do not take argument comp.
+Sat Oct 27 06:28:33 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Sat Jun 11 21:58:31 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * object.c (rb_mod_const_get): const_get accepts qualified constant
+ strings. e.g. Object.const_get("Foo::Bar::Baz") [ruby-core:41404]
- * ext/date/date_core.c: added examples.
+ * test/ruby/test_module.rb: tests for new behavior
-Sat Jun 11 19:40:45 2011 Narihiro Nakamura <authornari@gmail.com>
+Fri Oct 26 13:24:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c: expand heap if initial_heap_min_slots is bigger than
- HEAP_MIN_SLOTS.
+ * parse.y (literal_concat_gen): merge fixed strings across
+ concatenated literals, after an interpolation.
-Sat Jun 11 19:42:50 2011 WATANABE Hirofumi <eban@ruby-lang.org>
+Thu Oct 25 17:48:54 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ChangeLog (vim): set shiftwidth to 2.
+ * win32/win32.c (has_redirection): should use shell (cmd.exe) when
+ the commandline contains '&'.
+ reported by Roger Pack at [ruby-core:47912] [Bug #7143], and
+ patched by Heesob Park at [ruby-core:47931].
-Sat Jun 11 19:27:06 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+Thu Oct 25 15:00:08 2012 Koichi Sasada <ko1@atdot.net>
- * ext/openssl/ossl_x509req.c: raise RequestError instead of
- CertificateError when Request#to_der gets an error from OpenSSL.
- Patch from Ippei Obayashi, see #4420. I cannot write a test for
- this... Request does not allow to create broken bytes...
+ * include/ruby/ruby.h, class.c: remove (revert)
+ `rb_add_method_cfunc_frameless()' API.
+ This API is not mature to become an official API.
+ For example, we can not use this API with
+ `rb_define_private_method()'.
-Sat Jun 11 19:34:51 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * method.h, vm_method.c (rb_add_method_cfunc_frameless): removed.
- * ext/date/date_core.c (Date::(ABBR_)?(MONTH|DAY)NAMES): should be usascii.
+Thu Oct 25 13:35:07 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Jun 11 19:24:33 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * tool/mkconfig.rb: remove string literal concatenation.
- * ext/date/date_core.c: rewrote doc.
+Wed Oct 24 18:49:16 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jun 11 19:04:15 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/objspace/objspace.c (type2sym, count_objects_size): use enum
+ instead of size_t which may be larger than actual values.
- * lib/test/unit.rb (Test::Unit::GlobOption#non_options): should run
- with 1.8.
+Wed Oct 24 17:41:24 2012 Koichi Sasada <ko1@atdot.net>
-Sat Jun 11 18:05:57 2011 WATANABE Hirofumi <eban@ruby-lang.org>
+ * benchmark/driver.rb: add `-x' or `--exclude' option
+ to specify exclude benchmark name pattern.
+ You can specify "-x foo" if you want to exclude the benchmarks
+ if the name of benchmark contains `foo'.
- * bootstraptest/runner.rb: should initialize $stress to avoid warnings.
+Wed Oct 24 11:57:24 2012 Narihiro Nakamura <authornari@gmail.com>
-Sat Jun 11 18:02:09 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (gc_prepare_free_objects): rename to match the behavior of
+ this function.
- * io.c (io_getc): should be 7bit if ascii. fixes #4557
+Wed Oct 24 11:55:19 2012 Koichi Sasada <ko1@atdot.net>
-Sat Jun 11 16:52:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/objspace/objspace.c (reachable_object_from_i): change data
+ structure of the result of reachable objects. Keys of table
+ contains object_id of each reachable objects. Value of table
+ is an object itself or an instance of InternalObjectWrapper.
+ To avoid duplication, we use st_table and object_id keys.
- * numeric.c (rb_enc_uint_chr): fix message format. Bug#4869
+ * ext/objspace/objspace.c (type2sym): bug fix.
+ Should use `i' instead of `type'.
-Sat Jun 11 16:28:25 2011 Kouhei Sutou <kou@cozmixng.org>
+Wed Oct 24 10:33:09 2012 Koichi Sasada <ko1@atdot.net>
- * lib/rexml/formatters/pretty.rb
- (REXML::Formatters::Pretty#write_text),
- test/rexml/test_core.rb
- (Tester#test_pretty_format_long_text_finite): don't ignore
- 'width' parameter in pretty formatter. fixes #4498
- Reported by Michael Frasca. Thanks!!!
+ * gc.c (garbage_collect, gc_marks): move the location of
+ clear and restore rb_objspace_t::mark_func_data
+ from garbage_collect() to gc_marks().
-Sat Jun 11 16:11:36 2011 Kouhei Sutou <kou@cozmixng.org>
+Wed Oct 24 10:17:45 2012 Koichi Sasada <ko1@atdot.net>
- * test/rexml/test_core.rb
- (Tester#test_pretty_format_long_text_finite): remove needless
- assert_nothing_raised.
+ * ext/objspace/objspace.c (Init_objspace): add a new method
+ `ObjectSpace::InternalObjectWrapper#internal_object_id' which returns
+ an object id of a wrapped internal object.
-Sat Jun 11 16:04:03 2011 Kouhei Sutou <kou@cozmixng.org>
+Wed Oct 24 08:55:04 2012 Koichi Sasada <ko1@atdot.net>
- * lib/rexml/parsers/xpathparser.rb
- (REXML::Parsers::XPathParser#parse),
- test/rexml/test_elements.rb
- (ElementsTester#test_each_with_frozen_condition):
- don't modify original XPath. fixes #4161
- Reported by Pavel Shved. Thanks!!!
+ * ext/objspace/objspace.c (ObjectSpace.reachable_objects_from):
+ internal object support.
+ If given object `obj' has references to internal objects
+ (such as T_NODE objects), then this method returns instances of
+ `ObjectSpace::InternalObjectWrapper' instead of that internal objects.
+ This instance contains a reference to an internal object and you can
+ check the type of internal object using
+ `ObjectSpace::InternalObjectWrapper#type' method.
+ Rdoc of `InternalObjectWrapper' is not prepared yet.
-Sat Jun 11 15:53:27 2011 Kouhei Sutou <kou@cozmixng.org>
+ * gc.c (rb_objspace_reachable_objects_from), gc.h: change
+ an interface of 'rb_objspace_reachable_objects_from()'
- * test/rexml/test_elements.rb (ElementsTester): remove needless
- prefix from test name.
+ * gc.c, gc.h: add two APIs
+ - rb_objspace_markable_object_p(obj): check markable or not.
+ - rb_objspace_internal_object_p(obj): check internal or not.
-Sat Jun 11 15:36:36 2011 Martin Duerst <duerst@it.aoyama.ac.jp>
- * common.mk: fixed a grammatical error
+Wed Oct 24 05:52:36 2012 Koichi Sasada <ko1@atdot.net>
-Sat Jun 11 14:20:16 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * vm_insnhelper.c (vm_call_method): remove `default' and
+ add a case for `VM_METHOD_TYPE_UNDEF'.
- * vm.c (thread_memsize): don't ignore size of th->local_storage.
+Wed Oct 24 05:41:18 2012 Koichi Sasada <ko1@atdot.net>
-Sat Jun 11 10:32:46 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * eval_error.c (error_print), vm_eval.c (eval_string_with_cref),
+ vm_trace.c (rb_suppress_tracing): use TH_PUSH_TAG() instead of
+ PUSH_TAG().
- * lib/mkmf.rb: should quote arch_hdrdir and libpath for the case
- installed prefix contains spaces.
+Wed Oct 24 05:17:52 2012 Koichi Sasada <ko1@atdot.net>
-Sat Jun 11 10:20:52 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_eval.c (vm_call0_body): remove RUBY_VM_CHECK_INTS()
+ after method invocation using rb_call0().
- * thread_pthread.c (native_cond_timeout): wrap conditionally used
- label.
+ * vm_eval.c (vm_call0_body): remove default section on top of
+ switch statement and add cases for `VM_METHOD_TYPE_CFUNC_FRAMELESS'
+ and `VM_METHOD_TYPE_UNDEF'.
- * thread_pthread.c (native_sleep): remove unused variable.
+ * vm_eval.c (vm_call0_body): remove useless brackets.
-Sat Jun 11 10:15:50 2011 Tanaka Akira <akr@fsij.org>
+Tue Oct 23 22:34:49 2012 Koichi Sasada <ko1@atdot.net>
- * thread.c (rb_thread_execute_interrupts): use GetThreadPtr to extract
- rb_thread_t from VALUE.
- reported by Motohiro KOSAKI. [ruby-dev:43700]
+ * thread.c (thread_raise_m): check interrupts after Thread#raise
+ if a target thread is the current thread because the behavior
+ of Thread.current.raise is expected to perform same as
+ Kernel.raise (by rubyspec).
-Sat Jun 11 10:00:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Oct 23 17:08:39 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ruby.c (ruby_process_options): add missing return type.
+ * ruby.c (usage, process_options): show more info in --help.
+ [EXPERIMENTAL] [ruby-core:48072] [Bug #7184]
-Fri Jun 10 23:18:09 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Tue Oct 23 14:20:43 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/tk/tcltklib.c (lib_eventloop_core): replace CHECK_INTS with
- rb_thread_check_ints(). Because current code can't be compiled.
+ * misc/ruby-electric.el using variable `last-command-event' instead of
+ obsolete `last-command-char', so that work with Emacs trunk.
+ a patch by Victor Deryagin <vderyagin AT gmail.com>.
-Fri Jun 10 16:38:13 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Tue Oct 23 14:06:47 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * encoding.c (rb_locale_charmap): When ruby process is run as Windows
- Service the console codepage is not set, GetConsoleCP returns 0.
- So on such environment, use GetACP().
- http://blogs.msdn.com/b/michkap/archive/2005/02/08/369197.aspx
- patched by Rafal Bigaj [ruby-core:36832] [Bug #4854]
+ * configure.in (visibility_option): visibility attribute is not
+ available before GCC 4, so do not use -fvisibility option in that
+ case. [ruby-core:48147] [Bug #7205]
-Fri Jun 10 14:34:24 2011 Koichi Sasada <ko1@atdot.net>
+Tue Oct 23 12:57:29 2012 Koichi Sasada <ko1@atdot.net>
- * common.mk: restore TESTRUN_SCRIPT to "$(srcdir)/test.rb".
- TESTRUN_SCRIPT is used by "make run", "make gdb" and so on.
+ * vm_core.h, vm_insnhelper.c, vm_eval.c (OPT_CALL_CFUNC_WITHOUT_FRAME):
+ add a new optimization and its macro `OPT_CALL_CFUNC_WITHOUT_FRAME'.
+ This optimization makes all cfunc method calls `frameless', which
+ is faster than ordinal cfunc method call.
+ If `frame' is needed (for example, it calls another method with
+ `rb_funcall()'), then build a frame. In other words, this
+ optimization delays frame building.
+ However, to delay the frame building, we need additional overheads:
+ (1) Store the last call information.
+ (2) Check the delayed frame building before the frame is needed.
+ (3) Overhead to build a delayed frame.
+ rb_thread_t::passed_ci is storage of delayed cfunc call information.
+ (1) is lightweight because it is only 1 assignment to `passed_ci'.
+ To achieve (2), we modify GET_THREAD() to check `passed_ci' every
+ time. It causes 10% overhead on my environment.
+ This optimization only works for cfunc methods which do not need
+ their `frame'.
+ After evaluation on my environment, this optimization does not
+ effective every time. Because of this evaluation results, this
+ optimization is disabled at default.
-Fri Jun 10 13:01:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_insnhelper.c, vm.c: add VM_PROFILE* macros to measure behaviour
+ of VM internals. I will extend this feature.
- * test/ruby/test_module.rb (TestModule#remove_rake_mixins): remove all
- module related to Rake.
+ * vm_method.c, method.h: change parameters of the `invoker' function.
+ Receive `func' pointer as the first parameter.
-Fri Jun 10 09:52:38 2011 Eric Hodel <drbrain@segment7.net>
+Tue Oct 23 06:21:05 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * encoding.c: Mention that Encoding.compatible? can work with more
- than just Strings.
+ * ext/psych/parser.c: just get the constant defined in Ruby.
-Fri Jun 10 02:25:53 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+ * ext/psych/lib/psych/syntax_error.rb: Psych::SyntaxError now inherits
+ from StandardError rather than SyntaxError. Thanks Eric Hodel!
- * ext/psych/lib/psych.rb: updating version to match released gem.
+ * test/psych/test_exception.rb: tests for change.
-Fri Jun 10 01:06:29 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Tue Oct 23 06:17:36 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/bigdecimal (BigDecimal_to_i): Integer#** may return flonum.
+ * ext/psych/lib/psych/scalar_scanner.rb: Cache symbols while
+ tokenizing. Thanks Kevin Menard!
-Fri Jun 10 00:35:12 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Tue Oct 23 06:15:40 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * complex.c (string_to_c_internal): uses rb_reg_nth_match;
- * rational.c (string_to_r_internal): ditto.
+ * ext/psych/lib/psych/scalar_scanner.rb: Updated the RegExp to catch
+ Strings earlier in the tokenization process. Thanks Kevin Menard!
-Fri Jun 10 00:25:03 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+Tue Oct 23 06:12:39 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * gc.c: remove an unused declaration.
+ * ext/psych/lib/psych/visitors/to_ruby.rb: Handle nil tags specially
+ to avoid slow method_missing calls. Thanks Kevin Menard!
-Fri Jun 10 00:24:04 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Tue Oct 23 06:07:57 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * rational.c (string_to_r): Rational#** may return flonum.
+ * ext/psych/lib/psych/scalar_scanner.rb: Ignore bad timestamps. If
+ something looks like a timestamp but has an invalid component, treat
+ it as a string instead of throwing an ArgumentError.
+ Thanks Rhett Sutphin!
-Thu Jun 9 23:57:53 2011 Tanaka Akira <akr@fsij.org>
+ * test/psych/test_scalar_scanner.rb: appropriate tests.
- * io.c: fix IO.copy_stream interrupt handling.
- based on the patch by Eric Wong. [ruby-core:36156]
+Tue Oct 23 06:04:07 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * vm_core.h (rb_thread_call_with_gvl): don't declare here.
+ * ext/psych/lib/psych/scalar_scanner.rb: Fix scalar_scanner to
+ understand strings starting with an underscore and containing only
+ digits. Thanks Kelley Reynolds.
- * thread.c: include internal.h.
- (rb_thread_execute_interrupts): new function.
+ * test/psych/test_scalar_scanner.rb: test for fix
- * internal.h (rb_thread_execute_interrupts): declared.
- (rb_thread_call_with_gvl): declared.
+Tue Oct 23 06:00:41 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Thu Jun 9 23:34:01 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+ * ext/psych/lib/psych.rb: Changed comment in psych.rb to update new
+ home page for libyaml. Thanks to Carolyn Ann.
- * gc.c (rb_objspace_call_finalizer): use rb_typeddata_is_kind_of() for
- type check to get rid of a double free when main Thread has singleton
- class. [ruby-core:36741] [Bug #4828]
- * thread.c (rb_obj_is_mutex): add a new utility function.
- * vm.c (rb_obj_is_thread): ditto.
+Sun Oct 21 19:12:59 2012 Kazuki Tsujimoto <kazuki@callcc.net>
-Thu Jun 9 22:53:49 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+ * vm_core.h (rb_vm_t::trace_running): add a new field
+ `trace_running' to store vm global tracing status.
- * test/ruby/test_thread.rb (TestThread#test_kill_thread_subclass):
- add test for Thread.kill with Thread subclass instance.
+ * vm_trace.c: fix SEGV bug. event_hook was free'd
+ even when the hook is still used in another thread.
+ [ruby-dev:46141] [Bug #7032]
-Thu Jun 9 22:31:47 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+Sun Oct 21 19:12:42 2012 Kazuki Tsujimoto <kazuki@callcc.net>
- * test/ruby/test_thread.rb (TestThread#test_kill_wrong_argument):
- test for [ruby-core:35086].
- partially forward porting r31402 from ruby_1_9_2 branch.
+ * vm_core.h (rb_vm_t::trace_flag): remove `trace_flag'
+ which is no longer used.
-Thu Jun 9 18:36:00 2011 Kenta Murata <mrkn@mrkn.jp>
+Sun Oct 21 18:34:27 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * string.c: Fix the ambiguous description of the behavior of
- rb_str_aref_m with a range. It returns nil when the beginning of
- the range is greater than the end of the string rather than the range.
+ * ext/date/date_parse.c (date__parse): uses more tight parser if
+ defined TIGHT_PARSER. now inactivated; because it introduces
+ incompatibilities and it is a bit slow.
-Thu Jun 9 10:57:03 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+Sat Oct 20 15:35:06 2012 Narihiro Nakamura <authornari@gmail.com>
- * ext/psych/lib/psych/visitors/to_ruby.rb: Hash subclasses can be read
- from YAML files.
- * ext/psych/lib/psych/visitors/yaml_tree.rb: Hash subclasses can be
- dumped to YAML files.
- * test/psych/test_hash.rb: corresponding test.
+ * include/ruby/ruby.h: add C APIs.
+ VALUE rb_newobj_of(VALUE klass, VALUE flags)
+ #define NEWOBJ_OF(obj,type,klass,flags)
+ These allow to change a allocation strategy depending on klass
+ or flags.
-Thu Jun 9 09:18:51 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+ * gc.c: ditto
- * ext/psych/lib/psych/visitors/to_ruby.rb: Ruby modules can be loaded
- from YAML files.
- * ext/psych/lib/psych/visitors/yaml_tree.rb: Ruby modules can be
- dumped to YAML files.
- * test/psych/test_class.rb: corresponding test.
+ * array.c: use new C API.
+ * bignum.c: ditto
+ * class.c: ditto
+ * complex.c: ditto
+ * ext/socket/ancdata.c: ditto
+ * ext/socket/option.c: ditto
+ * hash.c: ditto
+ * io.c: ditto
+ * marshal.c: ditto
+ * numeric.c: ditto
+ * object.c: ditto
+ * random.c: ditto
+ * range.c: ditto
+ * rational.c: ditto
+ * re.c: ditto
+ * string.c: ditto
+ * struct.c: ditto
+ [Feature #7177][Feature #7047]
-Thu Jun 9 09:05:04 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+Sat Oct 20 12:50:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * ext/psych/lib/psych/visitors/to_ruby.rb: Ruby classes can be loaded
- from YAML files.
- * ext/psych/lib/psych/visitors/yaml_tree.rb: Ruby classes can be
- dumped to YAML files.
- * test/psych/test_class.rb: corresponding test.
+ * ext/socket/socket.c: Documentation for Socket
+ Based on a patch by David Albert
+ [Bug #7105] [ruby-core:47828]
-Wed Jun 8 21:38:57 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+Sat Oct 20 11:00:00 2012 Zachary Scott <zachary@zacharyscott.net>
- * cont.c (root_fiber_alloc): set root fiber's status RUNNING.
- in cont_mark() only RUNNING fiber's machine stack is marked.
- root fiber's status should be RUNNING at the beginning regardless of
- FIBER_USE_NATIVE. [ruby-core:36735] fixes #4827
+ * lib/open-uri.rb: Documentation for OpenURI
-Tue Jun 7 20:50:11 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Sat Oct 20 06:18:34 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * doc/irb/irb.rd: fix typo. patch by Nobuhiro IMAI.
- [Bug #4843] [ruby-dev:43639]
- * doc/irb/irb.rd.ja: ditto.
- * doc/ChangeLog-YARV: ditto.
+ * hash.c (initialize_copy): unset the default proc if there isn't one
+ for the target hash, call to_hash, check frozen status.
-Tue Jun 7 18:52:55 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Oct 19 22:22:01 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rubygems/user_interaction.rb (Gem::StreamUI#tty?): IO#tty? of
- Windows has been fixed at r29969.
+ * vm.c (rb_vm_jump_tag_but_local_jump): pass through thrown objects.
+ [ruby-dev:46234] [Bug #7185]
- * test/rubygems/test_gem_stream_ui.rb: now can run tests.
+ * vm_eval.c (rb_eval_cmd): if state is non-zero, val should be nil and
+ rb_vm_jump_tag_but_local_jump() just jump tag.
-Tue Jun 7 18:36:41 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Oct 19 22:11:55 2012 Benoit Daloze <eregontp@gmail.com>
- * test/rubygems/test_gem.rb (TestGem#{test_self_user_home_userprofile,
- test_self_user_home_user_drive_and_path}): should simply ignore
- meaningless tests instead of skipping them.
+ * pack.c (pack_unpack): set encoding of the
+ 'H','h','B' and 'B' modifiers to US-ASCII.
-Tue Jun 7 18:15:00 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/ruby/test_pack.rb: tests for the above.
+ [ruby-core:47653][Bug #7050]
- * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_set_program_name):
- should show some messages when skipping tests.
+ * test/test_securerandom.rb: tests for SecureRandom.hex
+ from tenderlove. [ruby-core:46792][Bug #6799]
-Tue Jun 7 13:59:47 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Oct 19 19:29:11 2012 Koichi Sasada <ko1@atdot.net>
- * ext/date/date_core.c (date_s_today, datetime_s_now): check the
- result of localtime_r().
+ * method.h (rb_method_cfunc_t::invoker): add new field (func ptr)
+ `invoker'. `invoker' function invoke cfunc body
+ (rb_method_cfunc_t::func).
+ `invoker' is set at method definition timing.
+ With this change, the big `switch' (branch) in `call_cfunc()'
+ is no longer needed.
+ However, the performance benefit is only a bit.
-Tue Jun 7 13:36:51 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_core.h (rb_call_info_t::aux::func): add a new field to store
+ cfunc body function pointer.
- * ext/tk/extconf.rb: use $defs not $CPPFLAGS to get rid of
- command line escape issues on Windows. fixed #4835.
+ * vm_method.c (call_cfunc_invoker_func): add a new function which
+ returns a suitable invoke function.
-Tue Jun 7 03:18:45 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * vm_method.c (setup_method_cfunc_struct): added.
- * test/ruby/test_io.rb (TestIO#test_s_{,bin}write): do not create a
- file under /tmp. [Bug #4846]
+ * vm_method.c (rb_add_method): fix to set `invoker'.
-Mon Jun 6 22:51:43 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+ * vm_eval.c (vm_call0_body): catch up above changes.
- * cont.c: use #if FIBER_USE_NATIVE instead of #ifdef.
- you can suppress use of setcontext for Fiber with compile option
- -DFIBER_USE_NATIVE=0
+ * vm_insnhelper.c (call_cfunc): removed.
-Mon Jun 6 21:59:23 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * vm_insnhelper.c (vm_call_cfunc): fix to call cfunc body
+ with `invoker' function.
- * test/date/test_switch_hitter.rb: added a test.
+Fri Oct 19 16:55:58 2012 Koichi Sasada <ko1@atdot.net>
-Mon Jun 6 21:37:45 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * eval.c, vm_eval.c: use TH_PUSH_TAG() instead of PUSH_TAG().
- * ext/date/date_core.c: added notes.
+Fri Oct 19 11:13:55 2012 Koichi Sasada <ko1@atdot.net>
-Mon Jun 6 21:02:12 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * benchmark/driver.rb: remove unexpected `output'.
+ (commit miss)
- * ext/date/date_core.c: flattened format to strftimev.
- * ext/date/date_core.c (date_strftime_internal): taints run.
+Fri Oct 19 10:24:03 2012 Koichi Sasada <ko1@atdot.net>
-Mon Jun 6 15:10:17 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * vm_insnhelper.c (vm_search_method): remove needless local variable.
- * include/ruby/{defines,missing}.h (rb_infinity, rb_nan): move from
- defines.h to missing.h. (couldn't use RUBY_EXTERN there.)
+Fri Oct 19 10:22:26 2012 Koichi Sasada <ko1@atdot.net>
-Mon Jun 6 14:35:48 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * benchmark/bmx_temp.rb: removed.
+ This file should not be in repository.
- * test/rdoc/test_rdoc_markup_pre_process.rb (TestRDocMarkupPreProcess#
- {test_include_file,test_include_file_encoding_incompatible}): no
- need to write such workaround. don't hide the bug of ruby. (and the
- bug is already fixed.)
+Fri Oct 19 10:20:10 2012 Koichi Sasada <ko1@atdot.net>
-Mon Jun 6 14:11:11 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * benchmark/driver.rb: add new option `--ruby-arg [ARG]'
+ which is passed as a launch parameter for each ruby's execution.
+ ($ ruby [ARG] [File])
- * ext/date/date_core.c (valid_jd_sub): need to convert from VALUE to
- double.
+Thu Oct 18 18:42:35 2012 Koichi Sasada <ko1@atdot.net>
- * ext/date/date_core.c (offset_to_sec): get rid of a compiler warning.
+ * insns.def (opt_send_simple): move the location of
+ `opt_send_simple' to the place near `send' definition.
+ (to take care about icache locality).
-Mon Jun 6 14:09:08 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Oct 18 18:29:25 2012 Koichi Sasada <ko1@atdot.net>
- * include/ruby/defines.h (rb_infinity, rb_nan): export for Windows.
+ * insns.def (send): remove unused condition.
+ This condition will be true after r37258.
-Mon Jun 6 10:54:45 2011 Shota Fukumori <sorah@tubusu.net>
+ * vm_insnhelper.c (vm_caller_setup_args): remove `UNLIKELY' on
+ checking blockiseq (it seems `LIKELY').
- * lib/test/unit.rb(Test::Unit::Runner#puke):
- Add overriding from MiniTest::Unit#puke. This reverts minitest's fix
- that skip messages are hidden when not verbose mode (-v option).
- To hide skip messages, use --hide-skip option instead.
+Thu Oct 18 17:31:58 2012 Koichi Sasada <ko1@atdot.net>
-Mon Jun 6 10:52:13 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * insns.def (opt_send_simple): introduce new instruction used
+ when no need to care about block and splat.
- * lib/net/http.rb: don't use autoload.
+ * compile.c: use the `opt_send_simple' instruction.
-Mon Jun 6 09:39:43 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+Thu Oct 18 16:44:07 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/psych/parser.c (parse): release event objects to plug memory
- leak. Thanks Mark J. Titorenko!
+ * vm_method.c (rb_add_method_cfunc, rb_add_method_cfunc_frameless):
+ check arity earlier at definition time.
-Sun Jun 5 23:26:15 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Thu Oct 18 15:11:31 2012 Koichi Sasada <ko1@atdot.net>
- * eval.c: remove rb_thread_stop_timer_thread function declaration.
- Instead, include vm_core.h.
- * process.c: ditto.
+ * vm_insnhelper.c: add `inline' keyword to several functions.
+ Compilers (gcc) are conservative than I expected.
-Sun Jun 5 21:38:51 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Thu Oct 18 15:01:15 2012 Koichi Sasada <ko1@atdot.net>
- * thread_pthread.c (thread_timer): add to care a spurious wakeup.
- When native_cond_timedwait() return 0 by spurious wakeup, we
- don't have to neither 1) call timer_thread_function and 2)
- exit the timer thread.
+ * include/ruby/ruby.h: add a decl. of
+ `rb_define_frameless_method()'.
-Sun Jun 5 17:50:01 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Thu Oct 18 14:31:17 2012 Koichi Sasada <ko1@atdot.net>
- * ext/date/date_core.c (m_real_cwyear): new. derived from m_cwyear.
- * ext/date/date_strftime.c: trivial changes.
+ * compile.c (new_callinfo): set a temporary index of callinfo
+ (used in `iseq_set_sequence()') to rb_call_info_t::aux::index.
+ rb_call_info_t::argc is initialized by same value of
+ rb_call_info_t::orig_argc.
-Sun Jun 5 17:22:01 2011 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Thu Oct 18 14:11:08 2012 Koichi Sasada <ko1@atdot.net>
- * ext/tk/config_list.in: add new options for tcltklib.
+ * class.c (rb_define_frameless_method): rename from
+ rb_define_method_fast(). Defined method with this C API
+ does not make a method frame. It is bit lightweight than
+ ordinal C functions. Now only 0 or 1 argc are permitted.
-Sun Jun 5 10:06:50 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * method.h (VM_METHOD_TYPE_CFUNC_FRAMELESS): rename macro name
+ from VM_METHOD_TYPE_CFUNC_FAST.
- * ext/date/date_tmx.h: now does not place decoded data. allows to
- access indirectly via functions on demand.
- * ext/date/date_strftime.c: ditto.
- * ext/date/date_core.c: ditto.
- * ext/date/date_core.c ({d|dt}_lite_to_s): use strftime.
+ * vm_insnhelper.c, vm_method.c: rename related functions.
-Sun Jun 5 06:22:02 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * proc.c (rb_method_entry_arity): catch up above changes.
- * NEWS: wrote about changes of date.
+Thu Oct 18 10:30:34 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jun 4 16:59:26 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * parse.y (assignable_gen): fail if yyerror occurred. fix a bug in
+ r36973.
- * ext/date/date_core.c (d_lite_inspect): changed the format.
- * ext/date/date_core.c: refactoring and fixing some bugs.
+Thu Oct 18 09:23:03 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Sat Jun 4 04:04:41 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * hash.c (initialize_copy): duping should rehash the hash.
- * test/rubygems/test_gem_commands_which_command.rb:
- "missing" exists on ruby's top source directory. [Bug #4815]
+ * test/ruby/test_hash.rb: added a test to ensure rehash.
-Fri Jun 3 21:48:12 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Wed Oct 17 21:16:47 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * lib/rubygems/test_case.rb: Refix for test-all in separate directory.
- r31147 + r31151.
+ * common.mk (WPROGRAM): need same dependencies as PROGRAM.
-Fri Jun 3 20:58:47 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * cygwin/GNUmakefile.in (uncommon.mk): move include position
+ below WPROGRAM definition to be defined in uncommon.mk.
- * ext/date/date_core.c (d_lite_plus): get rid of compiler warnings.
+ * ext/extmk.rb (all, static): fix make rubyw.exe failure with make -jN.
+ If make of ruby.exe and rubyw.exe run in parallel, link dll and link
+ exe run in parallel, which causes link failure on mingw. To fix this,
+ we make ruby.exe and rubyw.exe in one make process.
+ [ruby-core:48007] [Bug #7165]
-Fri Jun 3 20:56:40 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Oct 17 16:25:34 2012 Koichi Sasada <ko1@atdot.net>
- * include/ruby/missing.h, numeric.c (round): moved prototype of round()
- from numeric.c to missing.h. (note: round() is C99 feature, so ruby
- provides it if not exist in C runtime.)
+ * benchmark/bm_vm2_method_missing.rb: add a benchmark to measure
+ performance of invoking `method_missing'.
-Fri Jun 3 20:42:04 2011 Shota Fukumori <sorah@tubusu.net>
+Wed Oct 17 16:23:17 2012 Koichi Sasada <ko1@atdot.net>
- * lib/test/unit/parallel.rb: Keep $stdin, $stdout before run testcase
- and restore after run. Because some test break $stdin, $stdout.
- Fixes [Bug #4433] [ruby-core:35353]
+ * vm_insnhelper.c (vm_getivar): fix to use `aux.index' instead of
+ `aux.opt_pc'.
-Fri Jun 3 19:58:14 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Oct 17 16:03:54 2012 Koichi Sasada <ko1@atdot.net>
- * io.c (io_fflush): windows -- call fsync() only when the FD is tied to
- file, because if the FD is pipe, it blocks.
+ * vm_insnhelper.c (vm_call_method_missing): make a refactoring
+ about method_missing process. Use `vm_call_method()' to invoke
+ `method_missing' method instead of `rb_funcall2()'.
+ In `vm_call_method()', set fastpath to `vm_call_method_missing()'
+ if it can be cached.
-Fri Jun 3 09:27:31 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * vm_core.h (rb_call_info_t): add new field
+ `rb_call_info_t::aux::missing_reason' to pass the reason to
+ `vm_call_method_missing()'.
- * lib/net/http.rb (URI::HTTP#request_uri): return nil when the uri
- is path-rootless form. Bug #4759
+Wed Oct 17 15:33:12 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jun 2 23:51:03 2011 James Edward Gray II <jeg2@ruby-lang.org>
+ * configure.in (opt-dir): allow multiple directories separated by
+ $PATH_SEPARATOR as well as dir_config in mkmf.rb. [ruby-core:47868]
+ [Bug #7120]
- * lib/csv.rb: Improve the line ending detection algorithm
- patch by Alexey).
+Wed Oct 17 15:08:13 2012 Shugo Maeda <shugo@ruby-lang.org>
-Thu Jun 2 20:05:57 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/net/imap.rb: fix Net::IMAP::ResponseParser to accept
+ message/delivery-status ([ruby-core:47920] [Bug #7146]),
+ message/rfc822 attachments ([ruby-core:47921] [Bug #7147]), and
+ (BODY ("MIXED")) ([ruby-core:47951] [Bug #7153]).
+ patched by Tony Arkles.
- * io.c (rb_io_s_write, rb_io_s_binwrite): return!!!
+ * test/net/imap/test_imap_response_parser.rb: related test.
-Thu Jun 2 16:29:34 2011 Shota Fukumori <sorah@tubusu.net>
+Wed Oct 17 11:04:48 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * io.c: Add File.write, File.binwrite. [Feature #1081] [ruby-core:21701]
+ * test/ruby/test_hash.rb (TestHash#test_dup_equality): added a new test
+ to show the problem of r37232.
- * test/ruby/test_io.rb: Test for File.write, File.binwrite.
+Wed Oct 17 10:48:40 2012 Shugo Maeda <shugo@ruby-lang.org>
- * NEWS: News for above.
+ * vm_insnhelper.c (vm_search_method): fix a build error that occurs
+ when OPT_INLINE_METHOD_CACHE is 0.
-Thu Jun 2 12:33:09 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Oct 17 08:46:47 2012 Koichi Sasada <ko1@atdot.net>
- * io.c (io_fflush, rb_io_flush): need to fsync() when ruby calls
- internal flush. [ruby-core:36670] [Bug #4813]
+ * benchmark/bm_vm2_dstr.rb: add a benchmark to measure
+ performance of dynamic generated string ("foo#{bar}baz").
-Thu Jun 2 07:56:24 2011 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Oct 17 08:32:46 2012 Koichi Sasada <ko1@atdot.net>
- * ext/tk/tcltklib.c: reduce CPU power required by an eventloop.
+ * compile.c (compile_dstr_fragments): use `putobject' instead of
+ `putstring' for all of strings used by NODE_DSTR because
+ ruby users can not grab this string.
+ For example, the string object of "baz" in "foo#{bar}baz"
+ is located by `putobject' (users can not touch "baz" object
+ directly). This change reduces GC pressure.
+ This improvement is suggested by Aaron Patterson.
-Tue May 31 21:28:33 2011 Tanaka Akira <akr@fsij.org>
+Wed Oct 17 08:02:57 2012 Koichi Sasada <ko1@atdot.net>
- * test/ruby/test_signal.rb (TestSignal#test_signal_requiring):
- redirect stderr to null device.
+ * thread.c (rb_threadptr_interrupt_mask): fix to check interrupt
+ after interrupt_mask changed.
-Thu Jun 2 00:45:26 2011 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Wed Oct 17 06:42:47 2012 Koichi Sasada <ko1@atdot.net>
- * ext/tk/extconf.rb: fix for uninitialized global variables.
- [Ruby 1.9 - Bug #4811]
+ * vm_insnhelper.c (vm_call_method): fix to return value immediately.
+ Remove CHECK_INTS() after that method dispatch.
-Wed Jun 1 21:57:08 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Wed Oct 17 06:25:56 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * thread_pthread.c (native_sleep): fix 1000times calculation error.
- this is a regression since r31457. [Bug #4808] [ruby-dev:43606]
+ * hash.c (initialize_copy): copy the underlying st_table on dup,
+ rather than copying the hash key by key. [ruby-core:48009]
-Wed Jun 1 17:19:16 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/ruby/test_hash.rb: relevant tests for initialize_copy
- * thread_pthread.c: remove unused macro.
+Wed Oct 17 06:17:44 2012 Koichi Sasada <ko1@atdot.net>
-Wed Jun 1 15:42:18 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_insnhelper.c (vm_call_iseq_setup_2): separate tailcall and normal
+ method frame setup functions.
+ Add checking interrupts at the tailcall setup function.
- * parse.y (peek_n): new macro to see next nth char.
+Wed Oct 17 05:35:37 2012 Koichi Sasada <ko1@atdot.net>
-Wed Jun 1 15:40:46 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * benchmark/bm_vm1_yield.rb: add a benchmark to measure `yield'
+ (invoke empty block) performance.
- * tool/rbinstall.rb (gem): fix for rubygems change.
+ * benchmark/bm_vm2_method_with_block.rb: add a benchmark to measure
+ method invocation with empty block.
-Wed Jun 1 14:07:57 2011 Ryan Davis <ryand-ruby@zenspider.com>
+Wed Oct 17 05:05:07 2012 Koichi Sasada <ko1@atdot.net>
- * lib/minitest/*: Imported minitest 2.2.2 (r6281)
- * test/minitest/*: ditto
+ * vm_insnhelper.c (vm_invoke_block): vm_caller_setup_args() can skip
+ when splat flag is not set.
-Wed Jun 1 12:35:50 2011 Ryan Davis <ryand-ruby@zenspider.com>
+Wed Oct 17 01:53:47 2012 Koichi Sasada <ko1@atdot.net>
- * lib/rubygems*: Import rubygems 1.8.5 (released @ 137c80f)
- * test/rubygems: Ditto
+ * vm_insnhelper.c (vm_getivar, vm_setivar): support index inline cache
+ with rb_call_info_t to speedup `attr' getter and setter.
+ Cached index is stored in rb_call_info_t::aux::index.
+ `index' == 0 means not cached. `index' > 0 means cached and cached
+ index is `index - 1'.
-Wed Jun 1 12:34:00 2011 Kenta Murata <mrkn@mrkn.jp>
+ * insns.def ((get|set)instancevariable): use new wrapper functions
+ vm_(get|set)instancevariable() defined in vm_insnhelper.c.
- * NEWS: add new features of bigdecimal.
+ * vm_core.h (rb_call_info_t::aux): introduce new union data because
+ opt_pc can share with index.
-Wed Jun 1 09:41:14 2011 Eric Hodel <drbrain@segment7.net>
+Tue Oct 16 22:24:44 2012 Koichi Sasada <ko1@atdot.net>
- * lib/cgi/util.rb: Improve documentation. Patch by Kuba Fietkiewicz.
- [Ruby 1.9 - Bug #4775]
- * lib/cgi/core.rb: ditto
+ * benchmark/driver.rb (show_results): Show speedup ratio
+ with first executables score at last of results
+ if two or more executables are given.
-Wed Jun 1 09:26:05 2011 Eric Hodel <drbrain@segment7.net>
+Tue Oct 16 21:59:01 2012 Koichi Sasada <ko1@atdot.net>
- * lib/mathn.rb: Improve documentation and attach it to Numeric.
- Modified from patch by Anil V. [Ruby 1.9 - Bug #4762]
+ * benchmark/driver.rb: some refactoring.
+ (1) Remove `average differential'.
+ In this benchmark driver, We should not care about `average'.
+ We use fastest score because this score should not include
+ any disturbances (affections of background process, etc).
+ If you care about timing affect, I recommend `median'
+ score with more than 5 examinations rather than simple
+ `average' score (`average' score was affected by error scores).
+ (2) Show log file name.
+ (3) Change default directory from './' to driver's directory.
-Wed Jun 1 09:21:30 2011 Eric Hodel <drbrain@segment7.net>
+Tue Oct 16 14:56:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/prime.rb: Indent examples enough to appear as code sections.
- Note that Prime is Enumerable. [#4762]
+ * file.c (rb_file_join): need to check again after any conversion run.
+ [ruby-core:48012] [Bug #7168]
-Wed Jun 1 07:34:57 2011 Eric Hodel <drbrain@segment7.net>
+Tue Oct 16 12:52:14 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * hash.c (key_i): Change rdoc from "the first occurrence" to "an
- occurrence" since first occurrence is not a specification of
- Hash#key. [Ruby 1.9 - Bug #4760]
+ * test/ruby/envutil.rb (Test::Unit::Assertions#assert_file):
+ rename from file_assertion.
-Wed Jun 1 07:26:19 2011 Eric Hodel <drbrain@segment7.net>
+Tue Oct 16 11:30:18 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/pty/pty.c (pty_check): Restore "not reached" comment.
- [Ruby 1.9 - Bug #4756]
+ * file.c (rb_file_join): hide the result under construction until
+ return.
-Wed Jun 1 07:21:40 2011 Eric Hodel <drbrain@segment7.net>
+ * file.c (rb_file_join): check nul-byte only for strings, since
+ FilePathStringValue() does it. [ruby-core:48012] [Bug #7168]
- * ext/zlib/zlib.c: Fix document-method declarations for set_sync and
- set_comment. [Ruby 1.9 - Bug #4695]
+ * file.c (rb_file_join): path names must be ASCII-compatible.
+ [ruby-core:48012] [Bug #7168]
-Wed Jun 1 06:43:13 2011 Masaya Tarui <tarui@ruby-lang.org>
+ * file.c (check_path_encoding): new function to ensure path name
+ encoding to be ASCII-compatible.
- * load.c (loaded_feature_path): cut nonsense loop execution to fix
- performance bug.
+Tue Oct 16 09:40:04 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Jun 1 01:16:02 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_regexp.rb
+ (TextRegexp#test_raw_hyphen_and_tk_char_type_after_range): use
+ Regexp.new instead of literal to ignore a parser warning.
- * class.c (rb_mix_module): implement Module#mix.
+Tue Oct 16 09:30:30 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Jun 1 01:15:12 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_regexp.rb
+ (TextRegexp#test_raw_hyphen_and_tk_char_type_after_range): ignoring
+ warnings are already set in setup method.
- * io.c (io_encoding_set): should honor already set ecflags since it
- might be set by mode option. fixed #4804
+Tue Oct 16 06:44:06 2012 Koichi Sasada <ko1@atdot.net>
-Wed Jun 1 00:34:04 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+ * vm_insnhelper.c (VM_CALLEE_SETUP_ARG): fix wrong condition.
- * ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec): remove unused
- variable.
+Tue Oct 16 06:29:18 2012 Koichi Sasada <ko1@atdot.net>
-Wed Jun 1 00:32:00 2011 Kenta Murata <mrkn@mrkn.jp>
+ * vm_insnhelper.c (vm_call_method): disable CI_SET_FASTPATH() if
+ this method call needs splat argument because cached functions
+ (vm_call_attrset, vm_call_ivar, vm_call_cfunc_fast_(unary|binary))
+ do not check an arity.
- * ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec): support instantiation from
- a Float through Rational.
+ * bootstraptest/test_method.rb: add a test to check an above issue.
- * ext/bigdecimal/bigdecimal.c (BigDecimal_new): ditto.
+Tue Oct 16 06:15:44 2012 Koichi Sasada <ko1@atdot.net>
- * test/bigdecimal/test_bigdecimal.rb (test_global_new_float): add a test for
- the above changes.
+ * method.h: introduce new method type VM_METHOD_TYPE_CFUNC_FAST.
+ This method is similar to VM_METHOD_TYPE_CFUNC methods, but
+ called cfunc without building new frame (does not push new control
+ frame). If error is occurred in cfunc, the backtrace only shows
+ caller frame and upper.
+ This kind of methods can be added by rb_define_method_fast().
+ This feature is similar to specialized instructions (opt_plus, etc),
+ but more flexible (but a bit slower).
- * test/bigdecimal/test_bigdecimal.rb (test_new_with_float): ditto.
+ * class.c (rb_define_method_fast): added.
+ Maybe it will be renamed soon.
-Wed Jun 1 00:07:00 2011 Kenta Murata <mrkn@mrkn.jp>
+ * vm_insnhelper.c (vm_call_method): support method type
+ VM_METHOD_TYPE_CFUNC_FAST.
- * ext/bigdecimal/bigdecimal.c (BigDecimal_coerce): support coerce with a
- Rational. The precision used for instantiate a BigDecimal from the
- given Rational is obtained from the receiver BigDecimal.
+ * proc.c (rb_method_entry_arity): catch up new method type.
- * test/bigdecimal/test_bigdecimal.rb (test_coerce): add a test for the
- above change.
+ * vm_method.c (rb_add_method_cfunc_fast): added.
-Tue May 31 23:49:08 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Tue Oct 16 02:32:29 2012 Koichi Sasada <ko1@atdot.net>
- * ext/date/date_core.c (offset_to_sec): fixed invalid validation.
+ * vm_insnhelper.h (CI_SET_FASTPATH): add new parameter `enabled'.
+ If `enable' is 0 then CI_SET_FASTPATH() doesn't work.
+ And add new configuration option OPT_CALL_FASTPATH. If this macro
+ was defined by 0, then CI_SET_FASTPATH() doesn't work any more.
-Tue May 31 23:43:00 2011 Kenta Murata <mrkn@mrkn.jp>
+ * vm_insnhelper.c (vm_call_method): Pass `0' for `enabled' parameter
+ of CI_SET_FASTPATH if this method is protected.
- * ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec): replace the algorithm for
- coercing from a Rational to stop requiring "bigdecimal/util.rb".
- [ruby-core:34318]
+Tue Oct 16 02:17:35 2012 Koichi Sasada <ko1@atdot.net>
- * ext/bigdecimal/bigdecimal.c (GetVpValue): refactoring.
+ * vm_core.h (VM_CALL_*): rename VM_CALL_*_BIT
+ to VM_CALL_* (remove `_BIT' suffix).
+ Add comments on each macros.
+ Remove unused macro VM_CALL_TAILRECURSION_BIT.
- * ext/bigdecimal/bigdecimal.c (BigDecimal_new): support instantiation from a
- Rational.
+ * compile.c, iseq.c, insns.def, vm_insnhelper.c: ditto.
- * test/bigdecimal/test_bigdecimal.rb (test_global_new_with_rational): add a
- test for the above change.
+Mon Oct 15 22:14:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/bigdecimal/test_bigdecimal.rb (test_new_with_rational): ditto.
+ * test/ruby/envutil.rb (Test::Unit::Assertions#file_assertion):
+ rewrite file assertions.
-Tue May 31 22:44:00 2011 Kenta Murata <mrkn@mrkn.jp>
+Mon Oct 15 09:41:17 2012 Koichi Sasada <ko1@atdot.net>
- * ext/bigdecimal/bigdecimal.c (BigDecimal_new): support instantiation a
- BigDecimal object from an Integer.
+ * vm_insnhelper.c (VM_CALLEE_SETUP_ARG): skip CI_SET_FASTPATH() if
+ it was called from vm_yield_setup_args().
- * test/bigdecimal/test_bigdecimal.rb (test_new_with_integer):
- add for testing the above change.
+Mon Oct 15 05:20:13 2012 Koichi Sasada <ko1@atdot.net>
- * ext/bigdecimal/bigdecimal.c (BigDecimal_global_new): replace its body
- with a BigDecimal_new call.
+ * vm_insnhelper.h CI_SET_FASTPATH: introduce new macro
+ `CI_SET_FASTPATH(ci, func)'. This macro set `ci->call' as `func'.
+ `func' (ci->call) is called at the last of `send'
+ (and `invokesuper') instruction.
+ `CI_SET_FASTPATH' does not set `ci->call' when the method
+ (stored in `ci->me') is `protected'.
- * test/bigdecimal/test_bigdecimal.rb (test_global_new_with_integer):
- add for testing the above change.
+ * vm_insnhelper.c (vm_call_method): use `CI_SET_FASTPATH'.
+ After several checking (visibility, argc checking), the result of
+ checking can be reused until re-definition of this method
+ with inline method cache.
-Tue May 31 22:24:39 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ Note that this optimization is now experimental.
+ If you find any problem about it, please tell us.
- * ext/date/date_core.c: use simple/complex mode instead of light/right mode.
- * test/date/*.rb: followed the above changes.
+Mon Oct 15 04:51:55 2012 Koichi Sasada <ko1@atdot.net>
-Tue May 31 21:28:33 2011 Tanaka Akira <akr@fsij.org>
+ * vm_insnhelper.c: refactoring.
+ - move all `call' related functions to the last of file.
+ - make functions for respective method types in vm_call_method().
+ (all functions have same function parameters)
- * test/ruby/test_signal.rb (TestSignal#test_signal_requiring):
- initialize SIGINT handler.
+ * vm_core.h: add `opt_pc' field in `rb_call_info_t'
+ as temporal variable.
-Tue May 31 17:03:24 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+ * vm_eval.c (vm_call0_body): catch up above changes.
- * lib/net/http.rb, lib/net/protocol.rb: Allow to configure to wait
- server returning '100 continue' response before sending HTTP request
- body. See NEWS for more detail. See #3622.
- Original patch is made by Eric Hodel <drbrain@segment7.net>.
+Mon Oct 15 03:51:46 2012 Koichi Sasada <ko1@atdot.net>
- * test/net/http/test_http.rb: test it.
+ * benchmark/bm_vm1_attr_ivar(_set).rb: added (for method dispatch speed).
- * NEWS: Add new feature.
+ * benchmark/bm_vm1_float_simple.rb: added (for flonum/float).
-Tue May 31 14:17:49 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Oct 15 02:51:16 2012 Koichi Sasada <ko1@atdot.net>
- * io.c (rb_io_s_pipe): potential bug. the mode of read IO is set as
- DEFAULT_TEXTMODE in call of io_set_encoding(), and of write IO is
- also set as it in call of io_new_instance() via rb_protect().
- so, if DEFAULT_TEXTMODE is not 0, we should check the result of
- extract_binmode() and avoid crush of default IO mode and the result.
+ * vm_eval.c (vm_call0_body): add new function.
+ `vm_call0()' makes call_info struct and calls `vm_call0_body()'
+ with this struct. In near future, `vm_call0()' will be removed
+ because all of `vm_call0()' users setup call_info struct by itself.
-Tue May 31 13:00:17 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+Mon Oct 15 01:38:06 2012 Koichi Sasada <ko1@atdot.net>
- * strftime.c (rb_strftime_with_timespec): improved style consistency.
- constified some variables.
+ * insns.def (send, invokesuper, invokeblock, opt_*), vm_core.h:
+ use only a `ci' (rb_call_info_t) parameter instead of using
+ parameters such as `op_id', 'op_argc', `blockiseq' and flag.
+ These information are stored in rb_call_info_t at the compile
+ time.
+ This technique simplifies parameter passing at related
+ function calls (~10% speedups for simple method invocation at
+ my machine).
+ `rb_call_info_t' also has new function pointer variable `call'.
+ This `call' variable enables to customize method (block)
+ invocation process for each place. However, it always call
+ `vm_call_general()' at this changes.
+ `rb_call_info_t' also has temporary variables for method
+ (block) invocation.
- * test/test_time.rb (TestTime#test_huge_precision): test for #4456.
+ * vm_core.h, compile.c, insns.def: introduce VM_CALL_ARGS_SKIP_SETUP
+ VM_CALL macro. This flag indicates that this call can skip
+ caller_setup (block arg and splat arg).
-Tue May 31 12:53:10 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * compile.c: catch up above changes.
- * test/io/wait/test_io_wait.rb (TestIOWait#{test_nread,test_ready?,
- test_wait}: give system some time to process the written data.
+ * iseq.c: catch up above changes (especially for TS_CALLINFO).
-Tue May 31 12:40:49 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * tool/instruction.rb: catch up above changes.
- * test/ruby/test_io.rb (TestIO#test_open_mode): MUST release resources
- explicitly. fix problem of r31671
+ * vm_insnhelper.c, vm_insnhelper.h: ditto. Macros and functions
+ parameters are changed.
-Tue May 31 10:49:55 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * vm_eval.c (vm_call0): ditto (it will be rewritten soon).
- * vm_exec.c: remove conditions for clang
- because clang version 3.0 (trunk 132165) doesn't need them.
+Sun Oct 14 12:30:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon May 30 22:19:33 2011 Tanaka Akira <akr@fsij.org>
+ * ruby.c (rb_f_sub, rb_f_gsub): pass the given block.
+ [ruby-core:47967] [Bug #7157]
- * test/ruby/test_signal.rb (TestSignal#test_signal_requiring): don't
- close stderr.
+Sat Oct 13 23:15:39 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon May 30 20:22:00 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * regparse.c (parse_char_class): should match with a hyphen after a
+ range in a character class.
- * test/ruby/test_signal.rb (TestSignal#test_signal_requiring): small
- but critical typo of r31642. sorry...
- [Bug #4798] [ruby-core:36550]
+ * test/ruby/test_regexp.rb (TestRegexp#test_char_class): fixed wrong
+ test.
-Mon May 30 15:44:16 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/ruby/test_regexp.rb (TestRegexp#check): now can accept the
+ error message.
- * insns.def (opt_mult): as r31805, volatile it.
- Without this, clang -O fails calculation.
+ * test/ruby/test_regexp.rb
+ (TextRegexp#test_raw_hyphen_and_tk_char_type_after_range): renamed
+ because the previous name was wrong.
- * numeric.c (fix_mul): ditto.
+ * test/ruby/test_regexp.rb
+ (TextRegexp#test_raw_hyphen_and_tk_char_type_after_range): added
+ more test pattern.
- * rational.c (f_imul): ditto.
+Sat Oct 13 03:01:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon May 30 10:26:51 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * file.c (realpath_rec): prevent link from GC while link_names refers
+ the content.
- * numeric.c (int_pow): make sure to assign the result of x * z.
- If xz is optimized out, the value won't overflow.
+Sat Oct 13 01:37:48 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun May 29 23:17:29 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/ruby/test_regexp.rb
+ (TestRegexp#test_raw_hyphen_and_type_char_after_range): added new
+ test. ref [ruby-core:47115] [Backport #6853]
- * re.c (rb_reg_match): fix rdoc of Regexp#=~.
- patched by Tsuyoshi Sawada. [Bug #4781]
+Fri Oct 12 21:55:08 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Sun May 29 23:10:42 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * include/ruby/win32.h (rb_w32_pow): set floating point precision
+ for mingw-w64 x86 pow(). This improves the precision of pow() on
+ Windows XP for TestFloat#test_round_with_precision failure.
+ [ruby-core:47911] [Bug #7142]
- * lib/webrick/https.rb (WEBrick::HTTPRequest#parse_uri):
- keep parse_uri as private. patched by okkez. [Bug #4773]
+Fri Oct 12 21:37:25 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Sun May 29 17:53:03 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+ * test/webrick/test_cgi.rb (TestWEBrickCGI#test_cgi): skip a test
+ depending on locale on Windows. ENV[] doesn't work properly if
+ console code page is not equal to file system encoding.
+ [ruby-core:47910] [Bug #7140]
- * numeric.c: add #include "internal.h" for rb_big_uminus() prototype.
+Fri Oct 12 20:40:29 2012 Tanaka Akira <akr@fsij.org>
-Sun May 29 15:09:05 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * process.c (posix_sh_cmds): the command name of colon is ":".
- * numeric.c (flo_round): fix for negative value.
+Fri Oct 12 18:18:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun May 29 02:16:53 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * file.c (rb_get_path_check): path name must not contain NUL bytes.
- * test/net/http/utils.rb (TestNetHTTPUtils#teardown): add nil check.
+Fri Oct 12 16:06:20 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun May 29 00:22:40 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * tool/merger.rb: now can merge revision(s) without --ticket again.
- * process.c (before_exec, after_exec): change from macro to function.
+Fri Oct 12 14:10:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat May 28 19:30:17 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * lib/mkmf.rb (dir_config, init_mkmf): use configured libdir value as
+ default library path. [ruby-core:43726] [Bug #6207]
- * process.c (before_exec, after_exec): change SIGPIPE handler to SIG_DFL
- before calling execve(). Because r31760 reintroduced an issue that
- system() may hang up (i.e. [ruby-dev:12261]).
- * process.c (save_sigpipe, restore_sigpipe): new.
+Fri Oct 12 05:25:00 2012 Zachary Scott <zzak@ruby-lang.org>
-Sat May 28 16:08:16 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * lib/timeout.rb (timeout):
+ Remove paragraph on wrong implementation detail.
+ [ruby-core:47739] [Bug #7088]
- * signal.c (Init_signal, default_handler): change default SIGPIPE handler
- from empty function to SIG_IGN. [ruby-dev:43215]
- * signal.c (sigpipe): removed.
+Thu Oct 11 23:09:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat May 28 03:04:27 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * string.c (rb_str_sub{seq,pos,str}, rb_str_each_{line,codepoint}):
+ prevent String copies from GC. [ruby-core:47881] [Bug #7135]
- * io.c (fill_cbuf): return MORE_CHAR_SUSPENDED when cbuf is not empty.
+Thu Oct 11 07:40:50 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Sat May 28 02:22:48 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * iseq.c (insn_operand_intern): cast op to rb_call_info_t* before
+ compare with iseq->callinfo_entries whose type is rb_call_info_t*.
- * string.c (rb_str_bytesize): rb_str_bytesize() should use LONG2NUM().
- Patch by Nikolai Weibull. [Bug #4789] [ruby-core:36511]
+Thu Oct 11 03:37:08 2012 Koichi Sasada <ko1@atdot.net>
-Sat May 28 02:06:26 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * bootstraptest/test_block.rb: add tests for block with super.
- * io.c (fill_cbuf): Fix test-all crash.
+Thu Oct 11 02:54:07 2012 Koichi Sasada <ko1@atdot.net>
-Sat May 28 00:58:40 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+ * vm_dump.c: fix debug prints to catch up recent changes
+ such as VM data structures.
- * lib/ostruct.rb (method_missing): Handle [] and []= correctly.
- Based on a patch by Caius Durling, bug #4179 [ruby-core:33792]
+Thu Oct 11 02:50:34 2012 Koichi Sasada <ko1@atdot.net>
-Fri May 27 23:56:54 2011 Kouhei Sutou <kou@cozmixng.org>
+ * iseq.c (insn_operand_intern): add support disasm TS_CALLINFO
+ operands.
- * test/rexml/test_core.rb (Tester::test_text_frozen): split frozen
- string test. refs #4783
+Wed Oct 10 15:12:48 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri May 27 22:46:23 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_process.rb (TestProcess#test_execopts_gid): skip on
+ windows because the platform does not have Process.group method.
+ patched by Jon Forums in [ruby-core:47878] [Bug #7133].
- * tool/rbinstall.rb (gem): install gemspec of json. fixed #4784
+Tue Oct 9 23:18:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri May 27 22:45:10 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/envutil.rb (assert_file, assert_file_not): more
+ descriptive assertions for File predicates.
- * io.c (validate_enc_binmode): do not clear textmode flag if
- default. fixed #4732
+Tue Oct 9 18:01:37 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (fill_cbuf): finish reading at EOF.
+ * array.c (rb_ary_sample): use rb_random_ulong_limited, since
+ precision of long may be larger than double.
-Fri May 27 11:31:51 2011 misfo <tedwardo2@gmail.com>
+ * random.c (rb_random_ulong_limited): new function to return a random
+ value from 0 upto limit as unsigned long, similarly to
+ rb_genrand_ulong_limited but with arbitrary RNG object.
- * lib/rexml/text.rb (REXML::Text#initialize): prevent an error
- when passing a frozen string to REXML::Text.new
+Tue Oct 9 17:13:27 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- dup the string passed in instead of cloning so that it's frozen
- state is ignored
+ * process.c (rb_execarg_addopt, rb_execarg_run_options): add :uid and
+ :gid options. [ruby-core:47414] [Feature #6975]
-Fri May 27 08:47:26 2011 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Tue Oct 9 14:36:11 2012 Koichi Sasada <ko1@atdot.net>
- * thread.c (ppoll): typo bug fix.
+ * iseq.c (iseq_free): fix memory leak.
+ rb_iseq_t::callinfo_entries should be freed.
-Fri May 27 08:35:04 2011 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Tue Oct 9 14:28:18 2012 Koichi Sasada <ko1@atdot.net>
- * ext/tk/lib/tk.rb: hang-up at exit before calling Tk.mainloop.
+ * vm_core.h (rb_call_info_t): add new type `rb_call_info_t'.
+ This data structure contains information including inline method
+ cache. After that, `struct iseq_inline_cache_entry' does not
+ need to contain inline cache for method invocation.
+ Other information will be added to this data structure.
- * ext/tk/lib/tk/extconf.rb: cannot make on MinGW [Ruby 1.9 - Bug #4141].
+ * vm_core.h (rb_iseq_t): add `callinfo_entries' and `callinfo_size'
+ members to `rb_iseq_t'.
-Thu May 27 00:34:07 2011 James Edward Gray II <jeg2@ruby-lang.org>
+ * insns.def, compile.c: Use CALL_INFO instead of IC.
- * lib/csv.rb: Enhance each() to support Enumerator.
+ * tool/instruction.rb: support CALL_INFO as operand type.
-Thu May 26 10:32:11 2011 James Edward Gray II <jeg2@ruby-lang.org>
+ * vm_insnhelper.c, vm_insnhelper.h: ditto.
- * lib/csv.rb: Documentation improvements from Ysiad Ferreiras.
- [Ruby 1.9 - Bug #4785]
+Sun Oct 7 23:54:33 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Thu May 26 15:42:02 2011 Cezary Baginski <cezary.baginski@gmail.com>
+ * ext/zlib/zlib.c (zstream_run_func): don't call inflate() when
+ z->stream.avail_in == 0. it return Z_BUF_ERROR.
+ but deflate() could be called with z->stream->avail_in == 0 because
+ it has hidden buffer in z->stream->state (opaque structure).
+ fix for gem install error. [ruby-dev:46149] [Bug #7040]
- * lib/xmlrpc/parser.rb (FaultException): fix to_s and inspect
+Mon Oct 8 23:55:41 2012 Shugo Maeda <shugo@ruby-lang.org>
- * test/xmlrpc/parser.rb: test for the above
+ * eval.c (rb_mod_refinements): new method Module#refinements.
-Wed May 25 11:54:31 2011 Eric Hodel <drbrain@segment7.net>
+ * test/ruby/test_refinement.rb: add new tests for the above changes.
- * ext/curses/curses.c: Remove color constants block.
- [Ruby 1.9 - Bug #4748]
+Mon Oct 8 23:02:19 2012 Shugo Maeda <shugo@ruby-lang.org>
-Wed May 25 09:56:45 2011 Eric Hodel <drbrain@segment7.net>
+ * eval.c, gc.c, iseq.c, node.h, vm_insnhelper.c, vm_insnhelper.h,
+ vm_method.c: rename omod and overlaid modules to refinements.
- * ext/curses/curses.c: Add missing documentation for button state, MIN
- and MAX comments. Add Curses. to TABSIZE= and ESCDELAY= methods.
- [Ruby 1.9 - Bug #4747]
+ * eval.c (hidden_identity_hash_new): renamed from identity_hash_new.
-Wed May 25 09:35:31 2011 Eric Hodel <drbrain@segment7.net>
+Sun Oct 7 04:50:00 2012 Zachary Scott <zzak@ruby-lang.org>
- * lib/benchmark.rb: Restore nodoc for Benchmark::Job and
- Benchmark::Report. [Ruby 1.9 - Bug #4726]
+ * lib/abbrev.rb: Documentation examples for Abbrev.
+ [ruby-core:47442] [Bug #6985]
-Wed May 25 09:29:38 2011 Eric Hodel <drbrain@segment7.net>
+Sun Oct 7 04:50:00 2012 Zachary Scott <zzak@ruby-lang.org>
- * lib/net/pop.rb: Hide implementation details from RDoc.
- [Ruby 1.9 - Bug #4711]
+ * thread.c (rb_thread_aref):
+ Grammar in Thread documentation.
+ Patch by Steve Klabnik [ruby-core:47799] [Bug #7099]
-Wed May 25 09:26:29 2011 Eric Hodel <drbrain@segment7.net>
+Sun Oct 7 04:37:00 2012 Zachary Scott <zzak@ruby-lang.org>
- * lib/net/ftp.rb: Add :nodoc: for private methods.
- [Ruby 1.9 - Bug #4710]
+ * string.c (rb_str_match):
+ Clarify behavior for captured strings and local variable assignment
+ Patch by Marcus Stollsteimer [ruby-core:47668] [Bug #7062]
-Wed May 25 09:19:17 2011 Eric Hodel <drbrain@segment7.net>
+Sat Oct 6 18:31:36 2012 Shugo Maeda <shugo@ruby-lang.org>
- * ext/zlib/zlib.c: Fix Document-method declarations. Improve
- Zlib::GzipFile's method catalog. [Ruby 1.9 - Bug #4695]
+ * vm_opts.h (OPT_GLOBAL_METHOD_CACHE): new build option to
+ enable/disable global method caching. [ruby-dev:46203] [Bug #7111]
-Wed May 25 08:22:12 2011 Eric Hodel <drbrain@segment7.net>
+ * vm_method.c (rb_method_entry_get_with_omod): don't use global
+ method cache if OPT_GLOBAL_METHOD_CACHE is 0.
- * lib/erb.rb: Hide documentation for implementation details of ERB.
- [Ruby 1.9 - Bug #4694]
+Sat Oct 6 16:32:04 2012 Shugo Maeda <shugo@ruby-lang.org>
-Wed May 25 07:58:14 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_method.c (search_method): check omod only once for performance.
- * lib/tempfile.rb (Tempfile.{mkdir,rmdir}): revert for backward
- compatibility.
+Sat Oct 6 09:42:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed May 25 07:13:12 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * enc/encdb.c, enc/utf_16_32.h (ENC_DUMMY_UNICODE): endian-less wide
+ UTF encodings are dummy but Unicode.
- * spec/README: update the description.
+ * encoding.c (rb_encdb_set_unicode): set Unicode flag.
-Wed May 25 07:12:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * template/encdb.h.tmpl: allow ENC_DUMMY variants.
- * lib/tempfile.rb (Tempfile.{lock,unlock}_tempfile): refactor.
+ * encoding.c (rb_enc_unicode_p): oniguruma provides Unicode flag.
-Tue May 24 17:30:36 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Fri Oct 5 17:18:42 JST 2012 TAKANO Mitsuhiro <tak@no32.tk>
- * spec/README: fix typo.
- patched by bowsersenior. https://github.com/ruby/ruby/pull/24
+ * template/Doxyfile.tmpl: remove SHOW_DIRECTORIES and
+ HTML_ALIGN_MEMBERS lines. They have been obsolete in
+ Doxygen version 1.8.2.
-Tue May 24 07:06:34 2011 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+Fri Oct 05 15:26:18 2012 Koichi Sasada <ko1@atdot.net>
- * ext/tk/lib/tk.rb: fail to start Tk.mainloop (exit immediately) on
- some environment (reported on [ruby-talk:381444]).
+ * ext/objspace/objspace.c: add ObjectSpace#reachable_objects_from.
+ This method returns an array of objects referenced by given object.
+ If given object is special objects such as true/false/nil/Fixnum etc
+ then it returns nil. See rdoc for details.
+ [ruby-core:39772]
- * ext/tk/lib/tk/canvas.rb: support creating a canvas item object from
- an item ID number.
+ * test/objspace/test_objspace.rb: add a test for this method.
- * ext/tk/lib/tk/image.rb: import documents which are pull-requested.
- [Ruby 1.9 - Feature #4595]
+ * gc.c: add rb_objspace_reachable_objects_from().
+ To make this function, add several member `mark_func_data'
+ to rb_objspace_t. If mark_func_data is not null, then
+ gc_mark() calls mark_func_data::mark_func.
- * ext/tk/lib/tk/extconf.rb: search directories for 64bit library (e.g.
- /usr/lib64), add some new configure options (see README.tcltklib),
- and bug fix.
+ * gc.h: export rb_objspace_reachable_objects_from().
- * ext/tk/lib/tk/README.tcltklib: modify docs for some new configure
- options.
+Thu Oct 4 23:40:04 2012 Narihiro Nakamura <authornari@gmail.com>
-Tue May 24 04:01:46 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+ * gc.c (init_heap): call init_mark_stack before to allocate
+ altstack. This change avoid the stack overflow at the signal
+ handler on 32bit, but I don't understand reason... [Feature #7095]
- * lib/yaml.rb: switch default YAML engine to Psych, old syck engine
- may be enabled via YAML::ENGINE.yamler = "syck". [ruby-core:36374]
+Thu Oct 4 22:39:27 2012 Koichi Sasada <ko1@atdot.net>
-Mon May 23 09:45:26 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+ * insns.def (getlocal, setlocal): remove old getlocal/setlocal
+ instructions and rename getdaynmic/setdynamic instructions
+ to getlocal/setlocal.
- * include/ruby/defines.h (CASEFOLD_FILESYSTEM): Revert r30508. Forgot to
- include this file in the commit r31692. __APPLE__ is not
- CASEFOLD_FILESYSTEM again, from this time.
+ * compile.c: ditto.
-Mon May 23 10:01:02 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * iseq.c: remove TS_DINDEX.
- * ext/openssl/ossl_asn1.c: Do not parse zero-tagged values as EOC. Do
- not let current length become negative for infinite length constructed
- values. Support constructed values of length zero. Added tests.
+ * vm_exec.h (dindex_t): remove type definition of `dindex_t'.
-Mon May 23 09:19:53 2011 Eric Hodel <drbrain@segment7.net>
+ * tool/instruction.rb: ditto.
- * lib/net/smtp.rb: Document Net::SMTP::Response. Patch by J.R. Garcia.
- [Ruby 1.9 - Bug #4768]
+Thu Oct 4 21:44:17 2012 Koichi Sasada <ko1@atdot.net>
-Mon May 23 09:03:52 2011 Shota Fukumori <sorah@tubusu.net>
+ * vm.c (vm_analysis_insn|operand|register): use st_insert
+ instead of using rb_hash_aset() because rb_hash_aset()
+ check $SAFE.
- * lib/test/unit/parallel.rb: Never Ignore SIGINT. When received
- Interrupt, immediately puts result and exit. [ruby-dev:43571]
+Thu Oct 4 21:15:26 2012 Koichi Sasada <ko1@atdot.net>
- * lib/test/unit.rb: When received Interrupt, wait results from workers
- and collect them. [ruby-dev:43571]
+ * vm.c (VM_COLLECT_USAGE_DETAILS): make new VM usage analysis
+ hooks (old macro name is COLLECT_USAGE_ANALYSIS).
+ This feature is only for VM developers. (I'm not sure I can use
+ `VM developers' (the plural form) in this sentence).
+ If VM_COLLECT_USAGE_DETAILS is not 0, VM enables the following
+ usage collection features:
+ (1) instruction: collect instruction usages.
+ (2) operand: collect operand usages.
+ (3) register: collect register usages.
+ The results are stored in
+ RubyVM::USAGE_ANALYSIS_INSN for (1, 2),
+ RubyVM::USAGE_ANALYSIS_INSN_BIGRAM for (1) and
+ RubyVM::USAGE_ANALYSIS_REGS for (3).
+ You can stop collecting usages with
+ RubyVM::USAGE_ANALYSIS_INSN_STOP(),
+ RubyVM::USAGE_ANALYSIS_OPERAND_STOP(),
+ RubyVM::USAGE_ANALYSIS_REGISTER_STOP()
+ for (1), (2), (3) respectively.
+ You can also change the hook functions by setting
+ C level global variables
+ `ruby_vm_collect_usage_func_(insn|operand|register)'
+ for (1), (2), (3) respectively.
+ See codes for more details.
-Mon May 23 09:08:07 2011 Eric Hodel <drbrain@segment7.net>
+ * tool/instruction.rb: fix macro names.
- * lib/mathn.rb: Improve documentation. Patch by Sandor Szucs.
- [Ruby 1.9 - Bug #4767]
+ * iseq.c (insn_operand_intern): make it export (used in vm.c).
+ fix to skip several processes if not needed (pointer is 0).
-Mon May 23 08:45:55 2011 Eric Hodel <drbrain@segment7.net>
+ * vm_dump.c: move codes for collection features to vm.c.
- * lib/ostruct.rb: Improve documentation. Patch by Franklin Webber.
- [Ruby 1.9 - Bug #4761]
+ * vm_exec.h: rename macro and function names.
-Mon May 23 08:35:24 2011 Eric Hodel <drbrain@segment7.net>
+ * vm_insnhelper.h: ditto.
- * hash.c: Improve documentation of Hash#key. Patch by Utkarsh
- Kukreti. [Ruby 1.9 - Bug #4760]
+Thu Oct 4 18:59:14 2012 Koichi Sasada <ko1@atdot.net>
-Mon May 23 08:32:59 2011 Eric Hodel <drbrain@segment7.net>
+ * test/ruby/test_settracefunc.rb (test_tracepoint):
+ remove unused test case.
+ (this test case is redefined by newer tests)
- * enumerator.c: Improve documentation. Patch by Dave Copeland.
- [Ruby 1.9 - Bug #4757]
+Thu Oct 4 17:24:51 2012 Narihiro Nakamura <authornari@gmail.com>
-Mon May 23 07:19:45 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * gc.c (rb_objspace_call_finalizer): call gc_mark_stacked_objects
+ at suitable point.
- * NEWS (openssl): Infinite length support. Different behavior of
- Constructive and Primitive constructors.
+Thu Oct 4 16:31:29 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon May 23 06:58:33 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * gc.c (rb_objspace_call_finalizer): mark self-referencing finalizers
+ before run finalizers, to fix SEGV from btest on 32bit.
- * ext/openssl/ossl_asn1.c: Forbid Constructives whose value is not an
- Array to prevent segfault. Added test.
+ * gc.c (gc_mark_stacked_objects): extract from gc_marks().
-Mon May 23 06:33:17 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+Thu Oct 4 11:43:28 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_asn1.c: Forbid Constructive without infinite
- length. This also prevents a segfault. Added test and improved
- documentation.
+ * thread_pthread.c (ruby_init_stack): round stack limit to page size
+ boundary to calculate stack size more precisely. [ruby-dev:46174]
+ [Bug #7084]
-Mon May 23 05:58:14 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+Wed Oct 3 19:51:57 2012 Narihiro Nakamura <authornari@gmail.com>
- * ext/openssl/ossl_asn1.c: Fix decoding of infinite length values.
- Simplified ossl_asn1_decode0 by splitting it into three separate
- functions. Add tests.
- [Ruby 1.9 - Bug #4374][ruby-core:35123]
+ * gc.c: Use the non-recursive marking instead of recursion. The
+ recursion marking of CRuby needs checking stack overflow and the
+ fail-safe system, but these systems not good at partial points,
+ for example, marking deep tree structures. [ruby-dev:46184]
+ [Feature #7095]
-Mon May 23 04:03:46 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * configure.in (GC_MARK_STACKFRAME_WORD): removed. It's used by
+ checking stack overflow of marking.
- * ext/openssl/ossl_asn1.c (ossl_asn1_initialize): Allow creation of
- Constructives with an explicit tag_class parameter without
- automatically setting tagging to :EXPLICIT. Fixes a bug when encoding
- infinite length primitive values.
+ * win32/Makefile.sub (GC_MARK_STACKFRAME_WORD): ditto.
-Mon May 23 04:03:46 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+Wed Oct 3 15:33:02 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_asn1.c (ossl_asn1_cons_to_der): Add an additional
- EOC for infinite length Constructives that are supposed to be encoded
- with explicit tagging. Also tabify method correctly.
+ * thread_pthread.c (ruby_init_stack): use getrlimit() for the main
+ thread on Mac OS X, since pthread_get_stack{addr,size}_np()
+ return the default value always, but not the ulimit value.
+ [ruby-dev:46174] [Bug #7084]
-Mon May 23 03:44:39 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+Wed Oct 3 11:43:15 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_asn1.c (ossl_asn1data_to_der): Remove redundant
- flag tmp_cons.
+ * io.c (rb_io_reopen): improvement to accept optional arguments.
+ a patch by Glass_saga (Masaki Matsushita) in [ruby-core:47806].
+ [Feature #7103]
-Mon May 23 00:35:00 2001 Kenta Murata <mrkn@mrkn.jp>
+Wed Oct 3 04:36:11 2012 Eric Hodel <drbrain@segment7.net>
- * bignum.c (dump_bignum, bigmul1_balance, big_split, biglsh_bang),
- (bigrsh_bang, big_split3, bigmul1_toom3, bigmul0): implement Toom3 (Toom-Cook)
- multiplication.
+ * ext/openssl/ossl_x509store.c (ossl_x509store_add_file): Added
+ documentation
+ * ext/openssl/ossl_x509store.c (ossl_x509store_set_default_paths):
+ ditto
+ * ext/openssl/ossl_x509store.c (ossl_x509store_add_cert): ditto
- * include/ruby/defines.h: add format prefixes for BDIGIT and BDIGIT_DBL.
+Wed Oct 3 02:23:37 2012 Shugo Maeda <shugo@ruby-lang.org>
-Sun May 22 23:24:02 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * error.c (exc_to_s, name_err_to_s, name_err_mesg_to_str): do not
+ taint messages.
- * ext/openssl/ossl_asn1.c: Instead of rb_intern use static symbols to
- improve performance.
+Tue Oct 2 16:47:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun May 22 21:56:51 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * eval.c (identity_hash_new): hide internal hashes for refinements.
- * ext/openssl/ossl_asn1.c: Use OpenSSL constants V_ASN1_xxx instead of
- hardcoded numbers for initializing class_tag_map.
+ * eval.c (rb_mod_refine): no default value.
-Sun May 22 21:29:29 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+Mon Oct 1 22:54:02 2012 Shugo Maeda <shugo@ruby-lang.org>
- * include/ruby/defines.h (CASEFOLD_FILESYSTEM): Revert r30508. See #4255.
- Now __APPLE__ is not CASEFOLD_FILESYSTEM again.
+ * eval.c (identity_hash_new): new function to create a new identity
+ hash.
- * load.c (loaded_feature_path, rb_feature_p, load_lock): Revert r30508.
- See #4255. Make $LOADED_FEATURES scanning case-sensitive again.
+ * eval.c (rb_overlay_module, rb_mod_using, rb_mod_refine): use
+ identity_hash_new().
-Sun May 22 18:59:27 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+Mon Oct 1 02:34:53 2012 Akinori MUSHA <knu@iDaemons.org>
- * ext/openssl/ossl_asn1.c(ossl_asn1_default_tag): avoid using RCLASS_SUPER
- to make it compilable. Plus, tabify and change variable definition style.
+ * configure.in (--with-opt-dir): Make this also work on DLDFLAGS
+ so LIBRUBY_SO links fine with libexecinfo installed in a
+ non-system directory.
-Sun May 22 18:26:43 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Sep 30 23:32:00 2012 Kenta Murata <mrkn@mrkn.jp>
- * gc.c (vm_xcalloc): use calloc provided by platforms.
- fixes #4754
+ * vm_dump.c (rb_vm_bugreport): add /Library/Logs/DiagnosticReports
+ in the list of locations of crash reports.
-Sun May 22 11:44:53 2011 Eric Hodel <drbrain@segment7.net>
+Sun Sep 30 21:18:03 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/pty/pty.c: Improve documentation. Patch by David Copeland.
- [Ruby 1.9 - Bug #4756]
+ * string.c (rb_str_concat): use memcpy to copy a string which contains
+ NUL characters. [ruby-core:47751] [Bug #7090]
-Sun May 22 11:26:39 2011 Eric Hodel <drbrain@segment7.net>
+Sat Sep 29 19:41:53 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * lib/timeout.rb: Improve documentation. Patch by David Copeland.
- [Ruby 1.9 - Bug #4755]
+ * test/ruby/envutil.rb (EnvUtil#invoke_ruby): kill child process
+ before Timeout::Error is raised. rmdir of mktmpdir fails with
+ EACCES if child process is alive on Windows.
-Sun May 22 11:21:41 2011 Eric Hodel <drbrain@segment7.net>
+ * test/thread/test_queue.rb (TestQueue): increase timeout.
+ This test takes long time on Windows XP.
- * lib/ipaddr.rb: Improve documentation. Patch by Sandor Szucs.
- [Ruby 1.9 - Bug #4753]
+Sat Sep 29 19:41:33 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Sun May 22 11:14:40 2011 Eric Hodel <drbrain@segment7.net>
+ * test/net/http/test_http.rb (TestNetHTTP#test_proxy_address):
+ clear environment variables. If http_proxy environment variable was
+ set, the test failed.
- * lib/forwardable.rb: Document def_delegator. Patch by Sandor Szucs.
- [Ruby 1.9 - Bug #4752]
+ * test/net/http/test_http.rb (TestNetHTTP#test_proxy_port): ditto.
-Sun May 22 11:11:41 2011 Eric Hodel <drbrain@segment7.net>
+Sat Sep 29 19:41:11 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * lib/fileutils.rb: Document block behavior of FileUtils.cd. Patch by
- Bil Kleb. [Ruby 1.9 - Bug #4751]
+ * test/drb/drbtest.rb (DRbCore#teardown):
+ Use Process.kill :KILL on Windows because Process.kill :INT silently
+ fails on Windows 7 and raises EINVAL on Windows XP for spawned
+ process with new_pgroup: false.
-Sun May 22 11:07:47 2011 Eric Hodel <drbrain@segment7.net>
+ * test/drb/drbtest.rb (DRbAry#teardown): ditto.
- * ext/curses/curses.c: Complete documentation. Patch by Vincent
- Batts. [Ruby 1.9 - Bug #4748]
+Sat Sep 29 19:40:32 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Sun May 22 09:29:43 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/ruby/test_unicode_escape.rb (TestUnicodeEscape#test_basic):
+ set script encoding to work with LANG=C. It would work on both
+ Windows and Unix. Refix of r37051.
- * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_set_program_name):
- use spawn. it prevent that other tests inherit renamed $0.
+Sat Sep 29 11:21:06 2012 Shugo Maeda <shugo@ruby-lang.org>
-Sun May 22 08:57:13 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * vm_insnhelper.c (rb_vm_using_modules): use using_modules before
+ klass to fix method lookup order, and use klass even if klass is
+ not a module to make refinements in class_eval invoked on classes
+ work.
- * ext/openssl/ossl_asn1.c: Default tag lookup in constant time via hash
- instead of previous linear algorithm.
- [Ruby 1.9 - Feature #4309][ruby-core:34813]
+ * eval.c (rb_using_module): accept a class as the second argument.
-Sun May 22 07:54:16 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * eval.c (rb_mod_using, f_using): raise a TypeError if the argument
+ is not a module.
- * ext/openssl/ossl_digest.c: Explain DSS and DSS1 in documentation.
+ * test/ruby/test_refinement.rb: add new tests for the above changes.
-Sun May 22 07:10:25 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+Sat Sep 29 02:18:57 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * test/openssl/test_pkey_dsa.rb: Add tests for sign/verify.
+ * test/ruby/test_unicode_escape.rb (TestUnicodeEscape#test_basic):
+ Use ruby only on Windows since the test fails on Unix with LANG=C.
+ [ruby-core:47709] [Bug #7076]
-Sun May 22 06:07:17 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+Fri Sep 28 22:19:31 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * test/openssl/test_x509cert.rb: Merge DSA-related tests from ruby_1_8
- branch.
+ * test/ruby/test_unicode_escape.rb (TestUnicodeEscape#test_basic):
+ echo command doesn't work properly against non-ascii character on
+ Windows with chcp 437. Instead we use ruby.
+ [ruby-core:47709] [Bug #7076]
-Sun May 22 04:11:12 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Fri Sep 28 17:54:31 2012 Koichi Sasada <ko1@atdot.net>
- * thread.c (Init_Thread): add a code comment why the meaningless
- line is necessary.
+ * vm_insnhelper.c (vm_setup_method): refactoring.
+ Remove src_argc and use iseq->arg_size directly.
-Sun May 22 01:35:12 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Fri Sep 28 17:26:27 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/date/date_core.c: modified documentation.
+ * lib/rubygems/installer.rb (check_that_user_bin_dir_is_in_path):
+ test_generate_bin_bindir_with_user_install_warning(TestGemInstaller)
+ fails on Windows with msys bash. It makes comparing paths
+ case-insensitive.
+ pick from upstream to fix a failure of test-all [ruby-core:47711]
+ https://github.com/rubygems/rubygems/commit/c474edb2f3704206f04da1c8c6cf9fb079d84abe
-Sat May 21 22:46:26 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Fri Sep 28 15:44:45 2012 Shugo Maeda <shugo@ruby-lang.org>
- * ext/date/date_strftime(date_strftime_with_tmx): "%v" means "%e-%b-%Y".
+ * vm_method.c (search_method): copy refinement iclasses to search
+ superclasses correctly.
-Sat May 21 22:14:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/ruby/test_refinement.rb: related test.
- * io.c (rb_io_extract_modeenc): accept combination hash and
- File::Constants. (eg. File.open('yo', :mode => File::WRONLY))
- [Feature #4742][ruby-core:36338]
- * test/ruby/test_io.rb (TestIO#test_open_mode): new test.
+Fri Sep 28 15:15:41 2012 Koichi Sasada <ko1@atdot.net>
-Sat May 21 21:44:14 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * insns.def (opt_checkenv): remove unused instruction `opt_checkenv'.
- * test/date/test_switch_hitter.rb: new.
+ * compile.c (iseq_compile_each): ditto.
-Sat May 21 21:18:29 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * node.h: remove unused node `NODE_OPTBLOCK'.
- * ext/date/date_{core,parse}.c: moved nearly all core code from ext/date/lib.
- * ext/date/lib/{date,date/format}.rb: removed nearly all code.
+ * ext/objspace/objspace.c, gc.c (gc_mark_children): ditto.
-Sat May 21 02:58:46 2011 Eric Hodel <drbrain@segment7.net>
+Fri Sep 28 13:14:34 2012 Koichi Sasada <ko1@atdot.net>
- * ext/.document: Add curses to documented extensions.
- * ext/curses/curses.c: Improve documentation. Patch by Vincent Batts.
- [Ruby 1.9 - Bug #4747]
+ * vm_core.h: now VM_DEBUG_BP_CHECK should be 1.
-Sat May 21 02:51:01 2011 Eric Hodel <drbrain@segment7.net>
+Fri Sep 28 12:51:54 2012 Koichi Sasada <ko1@atdot.net>
- * ext/bigdecimal/lib/bigdecimal/util.rb: Improve documentation. Patch
- by Pete Higgins. [Ruby 1.9 - Bug #4746]
+ * vm_core.h: remove rb_control_frame_t::bp (bp: base pointer).
+ `bp' can be calculate by `sp' (stack pointer) of previous frame.
+ Now, `bp_check' field is remained for debug. You can eliminate
+ this field by setting VM_DEBUG_BP_CHECK as 0.
-Sat May 21 02:44:10 2011 Eric Hodel <drbrain@segment7.net>
+ * vm_insnhelper.c (vm_base_ptr): add `vm_base_ptr(cfp).
+ This function calculates base pointer from cfp.
- * ext/bigdecimal/lib/bigdecimal/jacobian.rb: Document isEqual. Patch
- by Kuba Fietkiewicz. [Ruby 1.9 - Bug #4744]
+ * vm_insnhelper.c (vm_setup_method): push `recv' value on top of
+ value stack (before method parameters).
+ This change is for keeping consistency with normal method dispatch.
-Sat May 21 02:22:34 2011 Eric Hodel <drbrain@segment7.net>
+ * insns.def: fix to use vm_base_ptr().
- * ext/date/lib/date/format.rb: Document date formats. Patch by
- Clinton Nixon. [Ruby 1.9 - Bug #4743]
+ * vm.c (vm_exec): ditto.
-Fri May 20 05:15:19 2011 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+ * vm_dump.c: remove `bp' related dumps.
- * gc.c: Fix build on m68k by 'error: too few arguments to
- function 'mark_locations_array''.
+ * cont.c (fiber_init): fix to check VM_DEBUG_BP_CHECK.
-Fri May 20 04:23:42 2011 Eric Hodel <drbrain@segment7.net>
+Fri Sep 28 10:40:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/scanf.rb: Improve documentation. Patch by Gabe McArthur.
- [Ruby 1.9 - Bug #4735]
+ * io.c (rb_io_reopen): accept File::Constants as well as mode string.
+ based on the patch by Glass_saga (Masaki Matsushita) in
+ [ruby-core:47694]. [Feature #7067]
-Fri May 20 00:58:01 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Sep 27 18:36:51 2012 Shugo Maeda <shugo@ruby-lang.org>
- * enc/trans/ibm737-tbl.rb: greek code page. fixes #4738
+ * eval.c (rb_overlay_module, rb_mod_refine): accept a module as the
+ argument of Module#refine.
-Thu May 19 14:44:05 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * vm_method.c (search_method): if klass is an iclass, lookup the
+ original module of the iclass in omod in order to allow
+ refinements of modules.
- * test/ruby/test_signal.rb (test_signal_requiring): skip on Windows.
- we can send SIGINT only to pid 0 and the process itself.
+ * test/ruby/test_refinement.rb: add tests for the above changes.
-Thu May 19 09:07:08 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Sep 27 18:12:20 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib: revert r31635-r31638 and untabify with expand(1).
+ * ext/syslog/lib/syslog/logger.rb: add a formatter to the
+ Syslog::Logger object. [Bug #7065]
+ * test/syslog/test_syslog_logger.rb: ditto.
-Thu May 19 07:47:26 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+Wed Sep 26 16:39:57 2012 Koichi Sasada <ko1@atdot.net>
- * test/openssl/test_pkey_rsa.rb: Add tests for sign/verify.
+ * insns.def: add new instruction `opt_empty_p' for optimize `empty?'
+ method. Apply a patch proposed at [ruby-dev:46120]
+ [ruby-trunk - Feature #6972] by Glass_saga (Masaki Matsushita).
-Thu May 19 07:19:16 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * compile.c (iseq_specialized_instruction), vm.c, vm_insnhelper.h:
+ ditto.
- * ext/openssl/ossl_pkey.c: Add documentation.
+ * id.c, template/id.h.tmpl: ditto.
-Thu May 19 07:06:56 2011 Eric Hodel <drbrain@segment7.net>
+ * test/ruby/test_optimization.rb: test for this changes.
- * lib/benchmark.rb: Fix indentation.
- * lib/net/imap.rb: Fix indentation of regular expressions.
+Tue Sep 25 09:59:26 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu May 19 06:36:11 2011 Eric Hodel <drbrain@segment7.net>
+ * insns.def (invokesuper): klass in cfp is not valid in at_exit and
+ END blocks. [ruby-core:47680] [Bug #7064]
- * lib/net/imap.rb: Fix indentation of EOF for heredoc.
- * lib/debug.rb (Commands): Fix indentation of EOHELP for heredoc.
+Tue Sep 25 08:11:11 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Thu May 19 06:30:38 2011 Eric Hodel <drbrain@segment7.net>
+ * iseq.c (rb_iseq_defined_string): the index of defined_strings must
+ be the value of type - 1.
- * lib/mkmf.rb: Fix indentation of EOM for heredoc.
+Mon Sep 24 17:36:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu May 19 06:16:41 2011 Eric Hodel <drbrain@segment7.net>
+ * compile.c (defined_expr), insns.def (defined): share single frozen
+ strings. [EXPERIMENTAL] [ruby-core:47558][Feature #7035]
- * lib: Convert tabs to spaces for ruby files per
- http://redmine.ruby-lang.org/projects/ruby/wiki/DeveloperHowto#coding-style
- Patch by Steve Klabnik [Ruby 1.9 - Bug #4730]
- Patch by Jason Dew [Ruby 1.9 - Feature #4718]
+ * iseq.c (rb_iseq_defined_string): make expression strings.
-Thu May 19 06:06:07 2011 Eric Hodel <drbrain@segment7.net>
+Mon Sep 24 11:22:36 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/cgi/util.rb: Improve documentation. Patch by Clinton Nixon.
- [Ruby 1.9 - Bug #4733]
- * lib/cgi/core.rb: ditto
- * lib/cgi/cookie.rb: ditto
+ * tool/merger.rb: add --ticket option to add ticket number.
-Thu May 19 06:02:21 2011 Eric Hodel <drbrain@segment7.net>
+Sun Sep 23 21:51:59 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/tempfile.rb: Document Dir.mkdir and Dir.rmdir. Patch by Clinton
- Nixon. [Ruby 1.9 - Bug #4728]
+ * lib/mkmf.rb (String#unspace): unescape with backslashes. normal
+ makes need to escape spaces with backslashes. nmake is not the
+ case. [Bug #7036]
-Thu May 19 05:57:52 2011 Eric Hodel <drbrain@segment7.net>
+ * lib/mkmf.rb (create_makefile): use timestamp file dependencies for
+ directories.
- * encoding.c: Improve documentation for Encoding#default_external and
- Encoding#default_internal.
+ * lib/mkmf.rb: unexpand macros.
-Wed May 18 22:45:26 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/mkmf.rb (LIBPATHFLAG): no needs to escape library path here.
- * ext/io/console/lib/console/size.rb (IO#console_size): new
- method. (EXPERIMENTAL)
+ * lib/mkmf.rb (MakeMakefile#configuration): make prefix paths
+ internal to deal with in Makefile.
-Wed May 18 22:41:51 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/mkmf.rb (MakeMakefile#mkintpath): not a global function now.
- * internal.h: add for internal use only.
+Sun Sep 23 02:33:37 2012 Benoit Daloze <eregontp@gmail.com>
-Wed May 18 22:36:43 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * complex.c: Fix examples of r36993.
+ Keep the simple definition, mathematics define the result.
+ Based on patch by Robin Dupret. Fixes #188 on github.
- * eval.c (setup_exception): internal exception should be hidden
+Sat Sep 22 07:15:00 2012 Zachary Scott <zzak@ruby-lang.org>
-Wed May 18 20:25:04 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * ext/ripper/lib/ripper.rb:
+ Match sample output to Ripper.sexp from current trunk version.
+ [Bug #6929]
- * lib/timeout.rb (Timeout#timeout): don't leak "execution expired"
- exception. [Bug #4283] [ruby-core:34534].
+Thu Sep 20 23:05:11 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Wed May 18 06:09:24 2011 Eric Hodel <drbrain@segment7.net>
+ * thread_pthread.c (native_cond_initialize): destroy condattr
+ after using it. Patch by Stanislav Sedov. Thank you.
+ [Bug #7041] [ruby-core:47619]
- * lib/cmath.rb: Add some examples and improve documentation. Patch by
- Sandor Szucs. [Ruby 1.9 - Bug #4727]
+Thu Sep 20 22:53:02 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Wed May 18 05:40:31 2011 Eric Hodel <drbrain@segment7.net>
+ * thread_pthread.c (native_cond_initialize): clean up #ifdef condition.
- * lib/benchmark.rb: Remove nodoc from Benchmark::Job and
- Benchmark::Report. Patch by Sandor Szucs. [Ruby 1.9 - Bug #4726]
+Thu Sep 20 16:42:44 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Wed May 18 05:29:26 2011 Eric Hodel <drbrain@segment7.net>
+ * lib/drb/ssl.rb (DRb::DRbSSLSocket::SSLConfig::DEFAULT): add
+ SSLTmpDhCallback for configuration option.
- * lib/webrick/compat.rb: Improve documentation. Patch by Sandor
- Szucs. [Ruby 1.9 - Bug #4725]
+ * lib/drb/ssl.rb (setup_ssl_context): copy the value of tmp_dh_callback.
-Wed May 18 05:10:35 2011 Eric Hodel <drbrain@segment7.net>
+ * test/drb/ut_array_drbssl.rb: set tmp_dh_callback to suppress warning.
- * lib/tracer.rb: Improve documentation. Patch by Richard Ramsden.
- [Ruby 1.9 - Feature #4720]
+ * test/drb/ut_drb_drbssl.rb: ditto.
-Wed May 18 04:53:41 2011 Eric Hodel <drbrain@segment7.net>
+Thu Sep 20 10:56:08 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/cmath.rb: Improve documentation. Patch by Jason Dew.
- [Ruby 1.9 - Feature #4717]
+ * test/drb/ut_drb.rb: revert a part of r36987, and get rid of a warning
+ with another method. if the substitution is removed, the ExtSrv
+ object will be GC'ed and some tests will be blocked.
-Wed May 18 04:50:24 2011 Eric Hodel <drbrain@segment7.net>
+Thu Sep 20 07:20:00 2012 Zachary Scott <zzak@ruby-lang.org>
- * lib/net/ftp.rb: Improve documentation. Patch by Vincent Batts.
- [Ruby 1.9 - Bug #4710]
+ * complex.c: Examples for Complex Documentation.
+ Patch by Robin Dupret.
+ Fixes #184 on github.
-Wed May 18 03:14:49 2011 Eric Hodel <drbrain@segment7.net>
+Thu Sep 20 07:15:00 2012 Zachary Scott <zzak@ruby-lang.org>
- * test/test_singleton.rb: Add tests from lib/singleton.rb. Patch by
- Pete Higgins. [Ruby 1.9 - Bug #4715]
+ * ext/ripper/lib/ripper.rb: Documentation for Ripper.
+ +:void_stmt+ is meaningless
+ [Bug #6929] [ruby-core:47507]
-Wed May 18 03:03:07 2011 Eric Hodel <drbrain@segment7.net>
+Thu Sep 20 07:05:00 2012 Zachary Scott <zzak@ruby-lang.org>
- * lib/singleton.rb: Improve documentation. Patch by Pete Higgins.
- [Ruby 1.9 - Bug #4709]
+ * lib/csv.rb (Object#CSV, Array#to_csv, String#parse_csv):
+ Examples and documentation for CSV.
+ [Bug #6880] [ruby-core:47218]
-Tue May 17 21:24:04 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Thu Sep 20 00:42:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * thread.c (rb_mutex_lock): remove remove_signal_thread_list() call.
- It's meaningless because lock_interrupt doesn't call
- add_signal_thread_list().
+ * array.c (take_items), enum.c (enum_zip): raise TypeError at
+ non-enumerable objects, not NoMethodError. [ruby-dev:46145]
+ [Bug #7038]
-Tue May 17 20:20:49 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * vm_eval.c (rb_check_block_call): check_funcall variant with block
+ function.
- * vm_core.h (rb_thread_struct): add volatile to
- transition_for_lock because it is not protected by lock.
+Tue Sep 18 17:51:29 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue May 17 20:08:53 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/openssl/ossl_ssl.c (ossl_sslctx_attrs): add npn_select_db to
+ suppress warning: instance variable @npn_select_cb not initialized
- * LEGAL (missing/{elf,tgamma,lgamma_r}.c): they've been replaced by
- public domain implementations.
+Sun Sep 16 17:47:00 2012 Eric Hodel <drbrain@segment7.net>
- * LEGAL (vsnprintf.c): it has moved to srcdir from missing/.
+ * tool/change_maker.rb: Update svn detection for subversion 1.7's
+ single .svn directory.
- * LEGAL (missing/crypt.c): list its original license.
+Sun Sep 16 11:39:12 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue May 17 19:54:26 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * io.c (io_set_read_length): if the read length equals to the buffer
+ string size then nothing to do. or ensure the string modifiable
+ before setting the length only when the former is shorter. based on
+ the patch in [ruby-core:47541] by Hiroshi Shirosaki.
+ [ruby-core:46586] [Bug #6764]
- * LEGAL (configure): add missing/setproctitle.c
+Sun Sep 16 08:57:52 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue May 17 19:35:01 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- Fix FreeBSD test failure.
+ * configure.in (strict_warnflags): separate strict flags from
+ warnflags only for core. [ruby-dev:46105]
- * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_set_program_name):
- use ps -o command instead of ps -o cmd. FreeBSD doesn't support
- -o cmd option.
+Sun Sep 16 08:16:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue May 17 08:04:26 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * .editorconfig: add. [ruby-core:47548] [Feature #7030]
- * ext/openssl/ossl_digest.c: Add documentation.
+Sat Sep 15 01:56:40 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue May 17 07:14:58 2011 Eric Hodel <drbrain@segment7.net>
+ * ext/nkf/nkf-utf8/nkf.c: Merge upstream: 50a383c84.
+ [ruby-dev:46128] [Bug #7005]
- * lib/net/http.rb: Improve documentation of proxy configuration
- methods. Patch by Alf Mikula. [Ruby 1.9 - Bug #4714]
+Sat Sep 15 00:20:04 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue May 17 07:09:01 2011 Eric Hodel <drbrain@segment7.net>
+ * ext/nkf/nkf.c (rb_nkf_convert): suppress warning.
- * lib/net/pop.rb: Improve documentation. Patch by Vincent Batts.
- [Ruby 1.9 - Bug #4711]
- * lib/net/telnet.rb: ditto
+Fri Sep 14 04:05:00 2012 Zachary Scott <zzak@ruby-lang.org>
+
+ * array.c (rb_ary_diff, rb_ary_uniq):
+ Enhance documentation for array uniqueness
+ Based on a patch by Robin Dupret
+ [Bug #6872] [ruby-core:47209]
+
+Fri Sep 14 03:30:00 2012 Zachary Scott <zzak@ruby-lang.org>
+
+ * array.c (rb_ary_select):
+ Update documentation for Array#select
+ * enum.c (enum_find_all, enum_reject):
+ Update documentation for Enumerable#find_all and Enumerable#reject
+ Based on a patch by Jeff Saracco
+ [Bug #6908] [ruby-core:47285] [Fixes #166 on github]
+
+Fri Sep 14 00:20:00 2012 Zachary Scott <zzak@ruby-lang.org>
+
+ * signal.c (rb_f_kill):
+ Update documentation for Process.kill to reflect kill(2)
+ Patch by Richo Healey
+
+Thu Sep 13 21:40:49 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * lib/securerandom.rb (SecureRandom.random_bytes):
+ Use 64bit value as pointer for Windows x64 to fix SystemCallError.
+
+ * lib/securerandom.rb (SecureRandom.lastWin32ErrorMessage):
+ Set proper encoding to avoid invalid byte sequence error.
+ [ruby-core:47451] [Bug #6990]
+
+Thu Sep 13 11:20:00 2012 Zachary Scott <zzak@ruby-lang.org>
+
+ * lib/optparse.rb: Remove unreachable email address from documentation
+ [Bug #6996] [ruby-core:47459]
+
+Thu Sep 13 11:20:00 2012 Zachary Scott <zzak@ruby-lang.org>
+
+ * lib/xmlrpc.rb: Documentation for XMLRPC
+ * lib/xmlrpc/datetime.rb: ditto.
+ * lib/xmlrpc/parser.rb: ditto.
+ * lib/xmlrpc/client.rb: ditto.
+ * lib/xmlrpc/utils.rb: ditto.
+ * lib/xmlrpc/README.rdoc: ditto.
+ * lib/xmlrpc/create.rb: ditto.
+ * lib/xmlrpc/base64.rb: ditto.
+ * lib/xmlrpc/config.rb: ditto.
+ * lib/xmlrpc/httpserver.rb: ditto.
+ * lib/xmlrpc/server.rb: ditto.
+ * lib/xmlrpc/marshal.rb: ditto.
+ * lib/xmlrpc/README.txt: ditto.
+ [Bug #6909] [ruby-core:47286]
+
+Thu Sep 13 10:22:11 2012 Takashi Toyoshima <toyoshim@gmail.com>
+
+ * configure.in: Don't use PIE on Haiku because loader support is not
+ enough.
+
+Thu Sep 13 08:20:00 2012 Zachary Scott <zzak@ruby-lang.org>
+
+ * lib/shellwords.rb: Documentation for Shellwords.
+
+Thu Sep 13 08:00:00 2012 Zachary Scott <zzak@ruby-lang.org>
+
+ * ext/ripper/lib/ripper.rb: Documentation for Ripper.
+ * ext/ripper/lib/ripper/lexer.rb: ditto.
+ * ext/ripper/lib/ripper/sexp.rb: ditto.
+ * ext/ripper/lib/ripper/filter.rb: ditto.
+ * ext/ripper/lib/ripper/core.rb: ditto.
+ [Bug #6929] [ruby-core:47309]
+
+Wed Sep 12 22:59:07 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_method_missing, vm_call_method): reuse arguments
+ on the VM stack and get rid of ALLOCA.
+
+Wed Sep 12 22:45::00 2012 Zachary Scott <zzak@ruby-lang.org>
+
+ * ext/pathname/lib/pathname.rb: Documentation for Pathname.
+ * ext/pathname/pathname.c: ditto.
+ [Bug #6947] [ruby-core:47354]
+
+Mon Sep 10 10:19:34 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * enc/depend: fixed wrong change in a part of r34802.
+
+Sun Sep 9 22:02:50 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * ext/socket/basicsocket.c (rsock_bsock_send):
+ avoid unnecessary select() calls before doing I/O
+ Patch by Eric Wong. [Feature #4538] [ruby-core:35586]
+ * ext/socket/init.c (rsock_s_recvfrom): ditto.
+ * ext/socket/init.c (rsock_s_accept): ditto.
+ * ext/socket/udpsocket.c (udp_send): ditto.
+ * io.c (io_fflush): ditto.
+ * io.c (io_binwrite): ditto.
+ * io.c (rb_io_syswrite): ditto.
+
+Mon Sep 10 01:38:51 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (nogvl_close, maygvl_close, nogvl_fclose, maygvl_fclose):
+ suppress integer <-> pointer cast warnings.
+ [Feature #4570] [ruby-core:35711]
+
+Mon Sep 10 01:36:00 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (rb_io_close): notify fd close before releasing gvl.
+ * io.c (fptr_finalize): modify fptr->mode before releasing gvl.
+ remove unnecessary rb_thread_fd_close().
+ [Feature #4570] [ruby-core:35711]
+
+Mon Sep 10 00:16:34 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * process.c: exec() requires to be single threaded also on Haiku.
+ by Takashi Toyoshima <toyoshim@gmail.com>
+ https://github.com/ruby/ruby/pull/178
+
+Sun Sep 9 21:21:15 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * lib/thread.rb (Queue#pop): Fixed double registration issue when
+ mutex.sleep is interrupted. [Bug #5258] [ruby-dev:44448]
+ * lib/thread.rb (SizedQueue#push): ditto.
+
+ * test/thread/test_queue.rb (test_sized_queue_and_wakeup,
+ test_queue_pop_interrupt, test_sized_queue_pop_interrupt,
+ test_sized_queue_push_interrupt): new tests.
+
+Sun Sep 9 20:20:31 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * lib/sync.rb (Sync_m#sync_lock): Fixed wakeup/raise unsafe code.
+ Patched by Masaki Matsushita. [Bug #5355] [ruby-dev:44521]
+
+ * test/thread/test_sync.rb (test_sync_lock_and_wakeup,
+ test_sync_upgrade_and_wakeup, test_sync_lock_and_raise):
+ new test.
+
+Sun Sep 9 18:39:46 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * include/ruby/intern.h (rb_thread_blocking_region): Added
+ a comment of recommended alternative way.
+
+Sun Sep 9 18:37:05 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * lib/sync.rb (Sync_m): Removed RCS_ID.
+
+Sun Sep 9 18:21:03 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/ruby/test_io.rb (test_advise_pipe): new test to check
+ io.advise() against anonymous io object don't make crash.
+ made by Eric Wong. [Bug #6081] [ruby-core:42880]
+
+Sun Sep 9 16:47:12 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (nogvl_close, maygvl_close, nogvl_fclose, maygvl_fclose):
+ new functions.
+ * io.c (fptr_finalize): release GVL if possible.
+ Patched by Eric Wong. [Feature #4570] [ruby-core:35711]
+
+Sun Sep 9 16:08:48 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (io_bufread): removed unnecessary rb_thread_wait_fd().
+ Patch by Eric Wong. [Bug #6629] [ruby-core:45789]
+ * io.c (rb_io_sysread): ditto.
+ * io.c (copy_stream_fallback_body): ditto.
+
+Sun Sep 9 15:21:52 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_mutex_lock): stop multiple threads use
+ pthread_cond_timedwait() concurrently. [Bug #6278] [ruby-core:44275]
+
+Sat Sep 8 18:52:22 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * internal.h (struct rb_classext_struct): move allocator function into
+ rb_classext_t from ordinary method table. [ruby-dev:46121]
+ [Feature #6993]
+
+ * object.c (rb_obj_alloc): call allocator function directly.
+
+ * vm_method.c (rb_define_alloc_func, rb_undef_alloc_func)
+ (rb_get_alloc_func): use allocator function in rb_classext_t.
+
+Fri Sep 7 01:21:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/extmk.rb (extmake), lib/mkmf.rb (have_framework): fix splitting
+ options with an argument, not using NUL as special character.
+ [ruby-core:47447] [Bug #6987]
+
+Thu Sep 6 14:49:49 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * .gdbinit (rp): FLONUM support.
+
+ * include/ruby/ruby.h (ruby_special_consts): define FLONUM constants
+ always, so that they are available from gdb.
+
+ * include/ruby/ruby.h (RB_FLOAT_TYPE_P): merge FLONUM and non-FLONUM
+ versions. inline TYPE() comparison and FLONUM_P() should be
+ optimized away on non-FLONUM.
+
+Thu Sep 6 08:20:55 2012 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * lib/minitest/*: Imported minitest 3.4.0 (r7762)
+ * test/minitest/*: ditto
+
+Wed Sep 5 19:20:53 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * parse.y (rb_warn4S): renamed from rb_warn4(), because the case in
+ r36911 takes a string.
+
+ * parse.y (rb_warn4S): use ripper_warnS() for ripper.
+
+ * parse.y (ripper_warnS): now it is used.
+
+Wed Sep 5 15:51:52 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * .travis.yml (notifications): [experimental] update notification
+ template.
+
+Wed Sep 5 15:21:12 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * parse.y (rb_warn4): added as a rb_warn variant to warn with explicit
+ source file name and line in parse.y.
+
+ * parse.y (warn_unused_var): use rb_warn4 to suppress warning on ripper.
+
+Wed Sep 5 13:30:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (glob_make_pattern): names under recursive need to be single
+ basenames to match for each name. [ruby-core:47418] [Bug #6977]
+
+Tue Sep 4 20:55:17 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * test/ruby/envutil.rb (EnvUtil#invoke_ruby): show Timeout::Error
+ instead of IOError if the timeout has expired.
+
+ * test/test_pstore.rb
+ (PStoreTest#test_pstore_files_are_accessed_as_binary_files):
+ increase timeout because this test is slow on Windows.
+ [ruby-core:47402] [Bug #6965]
+
+Tue Sep 4 11:28:57 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * vm_eval.c (ruby_eval_string_from_file_protect): initializer
+ element is not computable at load time.
+
+Tue Sep 4 07:48:35 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * test/openssl/test_asn1_rb:
+ test/openssl/test_ssl_session.rb:
+ test/openssl/test_x509name.rb:
+ test/openssl/test_buffering.rb:
+ test/openssl/test_x509cert.rb:
+ test/openssl/test_ssl.rb: Refactor code that leads to warnings on
+ Ruby CI.
+
+Tue Sep 4 07:02:56 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * test/openssl/utils.rb: Use DSS1 as DSA signature digest for all
+ OpenSSL versions < 1.0.0.
+ [Feature #6946] [ruby-core:47405]
+
+Mon Sep 3 21:22:37 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/ruby.h (rb_float_value): suppress warnings.
+ [ruby-core:47406][Bug #6971]
+
+Mon Sep 3 14:49:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/matrix.rb (Vector#magnitude): accumulate squares of absolute
+ values to fix for complex vector. [ruby-dev:46100] [Bug #6966]
+
+Mon Sep 3 10:09:36 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/extconf.rb: Detect OpenSSL_FIPS macro
+ ext/openssl/ossl.c: Expose OpenSSL::OPENSSL_FIPS constant to
+ indicate whether OpenSSL runs in FIPS mode.
+ test/openssl/test_pkey_dh.rb: Generate 256 bit keys for
+ non-FIPS installations to improve test performance (e.g. for
+ rubyci).
+ test/openssl/utils.rb: Replace DSS1 as certificate signature
+ digest with SHA1 for FIPS installations when using DSA by
+ introducing TestUtils::DSA_SIGNATURE_DIGEST.
+ test/openssl/test_x509cert.rb:
+ test/openssl/test_x509crl.rb:
+ test/openssl/test_x509req.rb: Use DSA_SIGNATURE_DIGEST
+ NEWS: Introduce OpenSSL::OPENSSL_FIPS
+
+ These changes allow running the OpenSSL tests in FIPS mode
+ while keeping a high performance for non-FIPS installations.
+ Introduction of OpenSSL::OPENSSL_FIPS allows for applications
+ to react to special requirements when using OpenSSL in FIPS mode.
+ [Feature #6946] [ruby-core:47345]
+
+Sun Sep 2 21:46:28 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * test/openssl/utils.rb: Use a cached DH key instead of generating a
+ new one each time.
+
+Sun Sep 2 05:41:28 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/webrick/ssl.rb (WEBrick::Config::SSL): add new key
+ SSLTmpDhCallback to set SSLContext#tmp_dh_callback.
+
+ * lib/webrick/ssl.rb (WEBrick::GenericServer#setup_ssl_context):
+ follow above.
+
+Sat Sep 1 18:50:50 2012 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/set.rb (#initialize_copy, #eql): Use instance_variable_get
+ instead of instance_eval.
+
+Fri Aug 31 21:47:56 2012 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/test/unit/test-unit.gemspec: Make test/unit default gem.
+ [Feature #6875] [ruby-dev:46051]
+
+Fri Aug 31 18:35:02 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/extconf.rb: Check existence of OPENSSL_NPN_NEGOTIATED.
+ ext/ossl_ssl.c: Support Next Protocol Negotiation. Protocols to be
+ advertised by the server can be set in the SSLContext by using
+ SSLContext#npn_protocols=, protocol selection on the client is
+ supported by providing a selection callback with
+ SSLContext#npn_select_cb. The protocol that was finally negotiated
+ is available through SSL#npn_protocol.
+ test/openssl/test_ssl.rb: Add tests for Next Protocol Negotiation.
+ NEWS: add news about NPN support.
+ [Feature #6503] [ruby-core:45272]
+
+Fri Aug 31 17:38:43 2012 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/set.rb (Set#{each,reject!,select!}, SortedSet#each): Pass
+ the original block through instead of creating one that only
+ yields the passed argument.
+
+Fri Aug 31 16:23:20 2012 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/ipaddr.rb: Introduce several new error classes where only
+ ArgumentError and StandardError were used. IPAddr::Error is
+ their common ancestor class that inherits from ArgumentError for
+ backward compatibility. Submitted by Jon Daniel. Fixes #173 on
+ GitHub.
+
+Fri Aug 31 14:51:27 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/bigdecimal/test_bigdecimal.rb (TestBigDecimal#test_to_f): added
+ for previous commit.
+
+Fri Aug 31 14:32:05 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_to_f): use self's sign to
+ determine 0.0 and Inf's sign instead of internal double value's.
+ Reported by phasis68 (Heesob Park) at [ruby-core:47381] [Bug #6955]
+
+Fri Aug 31 14:31:17 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * template/id.h.tmpl, tool/id2token.rb: make id.h independent from
+ parse.h, and make parse.c dependent on it instead.
+
+Fri Aug 31 14:27:39 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (create_makefile): fix race conditions at install-ext.
+ target files need to depend on destination directory timestamp
+ files, not phony targets.
+
+Fri Aug 31 14:03:45 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_trace.c (clean_hooks): do not access freed memory.
+
+ * vm_trace.c (rb_threadptr_exec_event_hooks): fix uninitialized state
+ when no events is executed.
+
+Thu Aug 30 18:21:51 2012 Tanaka Akira <akr@fsij.org>
+
+ * io.c (rb_io_close): call rb_last_status_clear.
+
+Thu Aug 30 16:17:52 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_to_f): check underflow since
+ strtod() sets errno to ERANGE at underflow too. [ruby-core:47342]
+ [Bug #6944]
+
+Thu Aug 30 12:44:43 2012 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/set.rb (Set#{<,>,<=,>=}): Define comparison operators as
+ shorthand for the {proper_}{subset?,superset?} methods (finally).
+ Given a push by Alexander E. Fischer.
+
+Thu Aug 30 09:21:01 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/ftp.rb (URI::FTP#initialize): raise InvalidURIError if "//"
+ is not present [ruby-core:47344] [Bug #6945]
+
+Thu Aug 30 07:45:12 2012 Luis Lavena <luislavena@gmail.com>
+
+ * test/ruby/test_file_exhaustive.rb: fix test introduced in r36811 for
+ posix environments where HOME is not defined. [ruby-core:47322]
+
+Wed Aug 29 23:42:59 2012 Tanaka Akira <akr@fsij.org>
+
+ * internal.h (rb_last_status_clear): declared.
+
+ * process.c (rb_last_status_clear): exported.
+ (rb_f_system): call rb_last_status_clear.
+
+ * io.c (rb_f_backquote): call rb_last_status_clear.
+
+Wed Aug 29 22:01:15 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_f_system): check failures of waitpid.
+ [ruby-talk:398687]
+
+Wed Aug 29 15:03:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (LIBDIR_BASENAME): use configured libdir value to fix
+ --enable-load-relative on systems where libdir is not default value,
+ overridden in config.site files. [ruby-core:47267] [Bug #6903]
+
+ * ruby.c (ruby_init_loadpath_safe): ditto.
+
+Wed Aug 29 14:34:41 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c: SIZE_MAX is defined in stdint.h, so r36755 breaks
+ 32bit FreeBSD. [ruby-core:47360] [Bug #6948]
+
+Wed Aug 29 04:50:04 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * test/openssl/utils.rb
+ test/openssl/test_pair.rb
+ test/openssl/test_pkey_dh.rb: Use 1024 bit DH parameters to satisfy
+ OpenSSL FIPS requirements. Patch by Vit Ondruch.
+ [Bug #6938] [ruby-core:47326]
+
+Tue Aug 28 22:31:49 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * insns.def (checkmatch): suppress warnings. [ruby-core:47339]
+ [Bug #6930]
+
+Tue Aug 28 20:03:54 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: Fixing Haiku R1/alpha3 build with gcc-4.4.4.
+ - omit ANSI standard flags to compile socket extension where
+ anonymous union is required.
+ - remove redundant -be flags.
+ by Takashi Toyoshima <toyoshim@gmail.com>
+ https://github.com/ruby/ruby/pull/168
+
+Tue Aug 28 11:32:37 2012 Yuki Yugui Sonoda <yugui@google.com>
+
+ * nacl/GNUmakefile.in (.rbconfig.time): r36828 was incomplete.
+ It did not run correctly on clean build.
+
+Tue Aug 28 09:25:20 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/Makefile.sub (Makefile): make to depend on common.mk, to
+ stop and force to re-run make process when common.mk is changed.
+
+Mon Aug 27 20:19:49 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * test/etc/test_etc.rb (TestEtc#test_getgrgid): fix for non unique GID.
+ No unixen systems guarantee that GID is unique. Etc.getgrgid would
+ not return the first entry in the order of Etc.group for shared GID.
+ [ruby-core:47312] [Bug #6935]
+
+Mon Aug 27 18:19:36 2012 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h (rb_float_value): optimize it.
+ This technique was pointed by shinichiro.hamaji
+ <http://shinh.skr.jp/m/?date=20120825#p02>.
+
+Mon Aug 27 15:08:25 2012 Yuki Yugui Sonoda <yugui@google.com>
+
+ * common.mk (vm_trace.o): Added a missing dependency.
+
+Sun Aug 26 09:29:32 2012 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * nacl/GNUmakefile.in (package): make package should install
+ example.html for nacl build
+
+ Patch by Takashi Toyoshima <toyoshim AT gmail.com>.
+
+Sun Aug 26 09:22:33 2012 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * nacl/GNUmakefile.in (CC, LD, NM, AR, AS, RANLIB, OBJDUMP, OBJCOPY)
+ Rewrites these variables instead of PATH.
+ NaCl port uses a toolchain which is specified by NACL_SDK_ROOT
+ environment variable. Originally, NaCl build added the toolchain
+ under the NACL_SDK_ROOT to the PATH. But updating PATH doesn't work
+ on Mac.
+ (RBCONFIG): Replaces configs with the variable updates above.
+
+ * configure.in: Thus it is no longer necessary to check $PATH.
-Tue May 17 07:00:41 2011 Eric Hodel <drbrain@segment7.net>
+ Based on a patch by Takashi Toyoshima <toyoshim AT gmail.com>.
- * lib/net/http.rb: Fix nodoc for Net::HTTP::version_1_1?. Patch by
- Alf Mikula. [Ruby 1.9 - Bug #4713]
+Sun Aug 26 16:53:00 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue May 17 06:56:26 2011 Eric Hodel <drbrain@segment7.net>
+ * insns.def (checkmatch): suppress warnings. [ruby-core:47310]
+ [Bug #6930]
- * lib/optparse.rb: Add link to make_switch to improve documentation.
- Patch by David Copeland. [Ruby 1.9 - Bug #4708]
+ * vm_core.h (VM_FRAME_TYPE_FINISH_P): ditto.
-Tue May 17 06:50:40 2011 Eric Hodel <drbrain@segment7.net>
+Fri Aug 24 15:42:28 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/observer.rb: Improve documentation. Patch by David Copeland.
- [Ruby 1.9 - Bug #4707]
+ * lib/mkmf.rb (create_makefile): use timestamp for destination
+ directories to make them before making or copying files there.
+ [ruby-dev:46067] [Bug #6904]
-Tue May 17 06:42:53 2011 Eric Hodel <drbrain@segment7.net>
+Fri Aug 24 12:40:15 2012 Luis Lavena <luislavena@gmail.com>
- * lib/logger.rb: Improve documentation. Patch by David Copeland.
- [Ruby 1.9 - Bug #4706]
+ * configure.in (mingw): add shlwapi to the list of dependency
+ libs for Windows.
+ * win32/Makefile.sub (EXTSOLIBS): ditto.
-Tue May 17 06:28:14 2011 Eric Hodel <drbrain@segment7.net>
+ * internal.h: declare internal functions rb_w32_init_file,
+ rb_file_expand_path_internal and rb_file_expand_path_fast.
- * lib/gserver.rb: Improve documentation. Patch by David Copeland.
- [Ruby 1.9 - Bug #4705]
+ * file.c (Init_File): invoke Windows initialization rb_w32_init_file
-Tue May 17 06:21:15 2011 Eric Hodel <drbrain@segment7.net>
+ * win32/file.c (rb_file_load_path_internal): new function.
+ Windows-specific implementation that replaces file_expand_path.
+ [Bug #6836][ruby-core:46996]
- * lib/cgi.rb: Add toplevel documentation to class CGI
- * lib/cgi/session.rb: Add overview documentation to CGI::Cookie
- * lib/cgi/html.rb: Don't add CGI::TagMaker documentation to CGI.
- Patch by David Copeland. [Ruby 1.9 - Bug #4704]
- * lib/cgi/core.rb: Clean up CGI documentation. Patch by David
- Copeland. [Ruby 1.9 - Bug #4704]
- * lib/cgi/cookie.rb: Clean up CGI::Cookie documentation. Patch by
- David Copeland. [Ruby 1.9 - Bug #4704]
+ * win32/file.c (rb_w32_init_file): new function. Initialize codepage
+ cache for faster conversion encodings lookup.
-Tue May 17 05:52:30 2011 Eric Hodel <drbrain@segment7.net>
+ * file.c (file_expand_path): rename to rb_file_expand_path_internal.
+ Conditionally exclude from Windows.
- * ext/digest: Improve documentation of Digest, Digest::HMAC and
- Digest::SHA2. Patch by Pete Higgins. [Ruby 1.9 - Bug #4702]
+ * file.c (rb_file_expand_path_fast): new function. delegates to
+ rb_file_expand_path_internal without performing a hit to the
+ filesystem.
-Tue May 17 03:51:42 2011 Eric Hodel <drbrain@segment7.net>
+ * file.c (file_expand_path_1): use rb_file_expand_path_internal without
+ path expansion (used by require).
+ * file.c (rb_find_file_ext_safe): ditto.
+ * file.c (rb_find_file_safe): ditto.
- * lib/abbrev.rb: Hide copyright and revision information from RDoc.
- Inspired by patch from David Copeland, bug #4703.
+ * load.c (rb_get_expanded_load_path): use rb_file_expand_path_fast.
+ * load.c (rb_feature_provided): ditto.
-Tue May 17 03:33:21 2011 Eric Hodel <drbrain@segment7.net>
+ * file.c (rb_file_expand_path): use rb_file_expand_path_internal with
+ path expansion.
+ * file.c (rb_file_absolute_path): ditto.
- * lib/timeout.rb (module Timeout): Hide internal constants. Patch by
- Pete Higgins. [Ruby 1.9 - Bug #4701]
+ * test/ruby/test_file_exhaustive.rb: new tests to exercise
+ rb_file_expand_path_internal implementation and compliance with
+ existing behaviors.
-Mon May 16 11:21:09 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Aug 24 07:35:24 2012 Eric Hodel <drbrain@segment7.net>
- * configure.in, win32/Makefile.sub (RUBY_SO_NAME): add CPU as prefix
- of RUBY_SO_NAME on x64/ia64 mswin/mingw.
- [Feature #4602]
+ * lib/net/http/backward.rb (class Net): Restored Net::HTTPSession to
+ fix backwards-compatibility with ancient Net::HTTP. [Bug #6889]
-Mon May 16 08:00:05 2011 Eric Hodel <drbrain@segment7.net>
+Thu Aug 23 20:58:55 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * lib/rdoc.rb: Update to RDoc 3.6.1, allows OpenSSL::Digest to be
- found.
+ * common.mk: support `make id.h` without `rm .id.h.time` after
+ `rm id.h`.
-Mon May 16 05:49:54 2011 Eric Hodel <drbrain@segment7.net>
+Thu Aug 23 20:48:45 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/drb/acl.rb: Add documentation.
+ * test/ruby/test_fixnum.rb (TestFixnum#test_singleton_method): new test.
-Mon May 16 05:13:20 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * test/ruby/test_bignum.rb (TestBignum#test_singleton_method): ditto.
- * ext/openssl/ossl_asn1.c: Add documentation.
+ * test/ruby/test_float.rb (TestFloat#test_singleton_method): ditto.
-Mon May 16 00:32:05 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/ruby/test_symbol.rb (TestSymbol#test_singleton_method): ditto.
- * test/ruby/test_signal.rb (TestSignal#test_signal_process_group):
- skip if the platform doesn't have :pgroup capability. (i.e. skip
- if mswin32)
+Thu Aug 23 20:34:32 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun May 15 23:53:31 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * class.c (singleton_class_of): flonum can't have singleton class.
- * include/ruby/intern.h: resurrect old rb_fd_copy().
- * thread.c (rb_fd_copy): ditto.
+ * vm.c (vm_define_method): flonum can't have singleton method.
-Sun May 15 23:45:11 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Thu Aug 23 19:18:33 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * common.mk (win32/*): macro RUBY_H_INCLUDES is not defined there,
+ so need to move dependency rules under the definition of it.
+
+Thu Aug 23 19:16:20 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/Makefile.sub: refactoring. remove unused rules, and update
+ some rules which are not used usually to fit current macros.
+
+Thu Aug 23 16:46:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (rb_find_file_ext_safe, rb_find_file_safe): default to
+ US-ASCII for encdb and transdb.
+
+ * load.c (search_required): keep encoding of feature name. set
+ loading path to filesystem encoding. [Bug #6377][ruby-core:44750]
+
+ * ruby.c (add_modules, require_libraries): assume default external
+ encoding as well as ARGV.
+
+Thu Aug 23 16:20:04 2012 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h: introduce flonum technique for
+ 64bit CPU environment (sizeof(double) == sizeof(VALUE)).
+ flonum technique enables to avoid double object creation
+ if the double value d is in range about between
+ 1.72723e-77 < |d| <= 1.15792e+77 or 0.0.
+ flonum Float value is immediate and their lowest two bits
+ are b10.
+ If flonum is activated, then USE_FLONUM macro is 1.
+ I'll write detailed in this technique on
+ https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/Flonum_tech
+
+ * benchmark/bmx_temp.rb: add an benchmark for simple
+ Float calculation.
+
+ * gc.c (id2ref, rb_obj_id): add flonum Float support.
+
+ * include/ruby/intern.h: move decl of rb_float_new(double)
+ to include/ruby/ruby.h.
+
+ * insns.def, vm.c, vm_insnhelper.c: add flonum optimization
+ and simplify source code.
+
+ * vm_insnhelper.h (FLONUM_2_P): added.
+
+ * marshal.c: support flonum output.
+
+ * numeric.c (rb_float_new_in_heap): added.
+
+ * parse.y: support flonum.
+
+ * random.c: ditto.
+
+Thu Aug 23 16:12:40 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/mkmf.rb (create_makefile): add dependency to header files when
+ depend files don't exist. now we can remove simple (and often
+ wrong) depend files in most cases.
+
+Thu Aug 23 16:02:20 2012 Koichi Sasada <ko1@atdot.net>
+
+ * ext/date/depend: add dependency to $(ruby_headers).
+
+Thu Aug 23 12:51:39 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * insns.def (invokesuper): reverted r36640 partially to make super
+ in a thread work correctly. [ruby-core:47284] [Bug #6907]
+
+ * test/ruby/test_super.rb: related test.
+
+Thu Aug 23 12:30:20 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/configure.bat: support --with(out)?-ext(ensions) options.
+
+Thu Aug 23 11:52:04 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: Fixing Haiku build.
+ - -lbe is not required for linking
+ - stack protector doesn't work for now because of the default gcc's
+ bug
+ by Takashi Toyoshima <toyoshim@gmail.com>
+ https://github.com/ruby/ruby/pull/167
+
+ * signal.c (ruby_signal): haiku doesn't have SIGBUS.
+
+Thu Aug 23 11:32:44 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/open-uri/test_open-uri.rb (TestOpenURI#test_read_timeout): this
+ test expects that the server thread will be killed in sleep, but 0.01
+ sec is too short to reach there.
+
+Thu Aug 23 10:49:28 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: use the value of --with-opt-dir on building ruby
+ itself. [ruby-dev:46064] [Bug #6900]
+
+Thu Aug 23 10:36:35 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * common.mk (ID_H_TARGET): revert a part of r36724 and r36751. they
+ break mswin build from clean source.
+
+Thu Aug 23 02:37:35 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/syck: removed. Fixes [ruby-core:43360]
+
+ * test/syck: removed.
+
+ * lib/yaml.rb: only require psych, show a warning if people try to set
+ the engine to syck.
+
+Thu Aug 23 01:46:53 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * insns.def: search up the cf stack for an object that is an instance
+ of the recipient class. Fixes [ruby-core:47186]
+
+ * test/ruby/test_super.rb: related test.
+
+Wed Aug 22 19:46:24 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: [ruby-core:47266].
+
+Wed Aug 22 19:41:19 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: [ruby-core:47226].
+
+Wed Aug 22 16:57:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (configuration): extract least ruby headers list as
+ ruby_headers, so depend files can use default dependency
+ explicitly.
+
+Wed Aug 22 15:27:50 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_insnhelper.c (vm_setup_method): fix last commit of
+ vm_insnhelper.c (r36771). [ruby-dev:46065] [Bug #6901]
+ Should not disable tail call opt on FINISH_FRAME.
+ This flag should be propagated correctly.
+
+Wed Aug 22 14:05:23 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c: support TracePoint. [ruby-trunk - Feature #6895]
+
+ * test/ruby/test_settracefunc.rb: add tests for above.
+
+ * proc.c (rb_binding_new_with_cfp): add an internal function.
+
+ * vm.c (rb_vm_control_frame_id_and_class): add an internal function.
+
+ * vm_trace.c: add rb_add_event_hook2() and rb_thread_add_event_hook2().
+ Give us the good name for them!
+
+Wed Aug 22 11:38:16 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * .travis.yml (before_script): Turned out that make -j is broken.
+
+Wed Aug 22 11:23:35 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_setup_method): should not enable tail call
+ optimization for frames with VM_FRAME_FLAG_FINISH.
+ [ruby-dev:46065] [Bug #6901]
+
+Wed Aug 22 11:20:47 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/rubygems/test_case.rb: run test with psych if exist.
+
+Thu Aug 16 12:09:51 2012 Yuki Yugui Sonoda <yugui@google.com>
+
+ * nacl/pepper_main.c (init_loadpath): Pushes the correct load path on
+ other architectures than x86_64. Fixes #6873.
+
+Wed Aug 15 19:37:33 2012 Yuki Yugui Sonoda <yugui@google.com>
+
+ * configure.in (ac_cv_func_shutdown): shutdown(2) has a dummy
+ implementation but has no declaration and does not work in
+ NativeClient SDK pepper_20.
+
+Wed Aug 15 19:29:29 2012 Yuki Yugui Sonoda <yugui@google.com>
+
+ * common.mk (vm_backtrace.o): Added missing dependencies.
+
+ * ext/nkf/depend (nkf.o): ditto.
+
+ * ext/ripper/depend (ripper.o) ditto.
+
+Wed Aug 22 07:27:00 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/cgi/util.rb (CGI.escapeHTML): use &#39;
+ [ruby-core:47221] [Bug #6861]
+
+Tue Aug 21 21:59:22 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * lib/observer.rb: fix typo. https://github.com/ruby/ruby/pull/162 by
+ unsymbol (Philip Cunningham).
+
+Tue Aug 21 20:30:06 2012 Benoit Daloze <eregontp@gmail.com>
+
+ * test/fileutils/test_fileutils.rb (TestFileUtils#teardown):
+ do not assume cwd is TMPROOT and never remove current directory.
+ [ruby-core:47224][Bug #6884]
+
+Tue Aug 21 17:29:56 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * addr2line.c (fill_lines): need check and cast of the file size of
+ target binary because there are some platforms which off_t > size_t.
+
+Tue Aug 21 17:07:58 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * .travis.yml (compiler): [experimental] clang support.
+
+Tue Aug 21 15:44:27 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/dl/lib/dl/func.rb (DL::Function#bind): fixes an error in
+ test/dl/test_import.rb (DL::TestImport#test_carried_function)
+ introduced by r36718.
+ the instance of the anonymous class which wraps the block should have
+ same methods and instance variables of self.
+
+Tue Aug 21 14:29:22 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/Makefile.sub (scriptbin.mk): no need to include twice.
+
+Tue Aug 21 10:52:08 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/unit/test.rb (Test::Unit::ProxyError): new exception class to
+ wrap exceptions raised in workers in parallel test mode.
+
+ * test/unit/parallel.rb (Test::Unit::Worker#puke): use above wrapper
+ exception.
+ [Bug #6882] [ruby-dev:46054]
+
+Tue Aug 21 10:40:06 2012 Koichi Sasada <ko1@atdot.net>
+
+ * test_continuation.rb (tracing_with_thread_set_trace_func):
+ fix to use Thread#set_trace_func(nil), not set_trace_func(nil).
+
+Tue Aug 21 09:32:41 2012 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * lib/minitest/*: Imported minitest 3.3.0 (r7676)
+ * test/minitest/*: ditto
+
+Tue Aug 21 09:05:32 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/testunit/tests_for_parallel/ptest_forth.rb: added a test case
+ which causes an error.
+
+ * test/testunit/test_parallel.rb: follow above change.
+ see [Bug #6882]
+
+Tue Aug 21 05:43:00 2012 James Edward Gray II <james@graysoftinc.com>
+
+ * lib/csv.rb: Fixes #161 on github
+ * lib/csv.rb: You can now specify a pattern for :skip_lines.
+ Matching lines will not be passed to the CSV parser.
+ * lib/csv.rb: Patch by Christian Schwartz.
+
+Tue Aug 21 05:25:41 2012 Eric Hodel <drbrain@segment7.net>
+
+ * re.c (rb_reg_initialize_m): Forgot to update output for or'd-options
+ example.
+
+Tue Aug 21 05:18:03 2012 Eric Hodel <drbrain@segment7.net>
+
+ * re.c (rb_reg_initialize_m): Update example to show that regexp
+ options use | an not || to avoid confusion.
+
+Mon Aug 20 23:02:27 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y: more descriptive token names in syntax error messages.
+
+Mon Aug 20 20:36:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_call_method): follow iclasses as klass in cfp
+ but not included modules. [ruby-core:47241] [Bug #6891]
+
+ * vm_insnhelper.c (vm_call_bmethod): pass defined_class to follow
+ proper ancestors. [ruby-core:47241] [Bug #6891]
+
+Mon Aug 20 11:40:27 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * common.mk: fix failed to make with -j2.
+ https://gist.github.com/3397935
+
+Mon Aug 20 10:51:01 2012 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/test/unit.rb, lib/test/unit/parallel.rb:
+ generate error message (String) in parallel.rb instead of
+ marshalling Exception. Fixes [Bug #6882] [ruby-dev:46054]
+
+Sun Aug 19 01:24:32 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * enum.c: fix docs. https://github.com/ruby/ruby/pull/129 by
+ richardkmichael (Richard Michael).
+
+Sun Aug 19 00:47:26 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * lib/fileutils.rb: fix typo.
+ https://github.com/ruby/ruby/pull/155 by simonc (Simon COURTOIS).
+
+Sat Aug 18 09:57:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enc/depend: fix inplace-build condition. enc.mk is generated with
+ setting $srcdir to enc, but pwd is still top build directory.
+ [ruby-core:47236] [Bug #6888]
+
+Fri Aug 17 23:28:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * object.c (rb_any_to_s, rb_obj_inspect): preserve encodings of class
+ name and instance variable names.
+
+Fri Aug 17 12:39:33 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/dl/lib/dl/func.rb (DL::Function#bind): allow to return/break from
+ the callback method. (Fiddle already allows it.)
+ [Bug #6389] [ruby-dev:45604]
+
+Thu Aug 16 19:54:24 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c, vm_core.h: simplify tracing mechanism.
+
+ (1) add rb_hook_list_t data structure which includes
+ hooks, events (flag) and `need_clean' flag.
+ If the last flag is true, then clean the hooks list.
+ In other words, deleted hooks are contained by `hooks'.
+ Cleanup process should run before traversing the list.
+ (2) Change check mechanism
+ See EXEC_EVENT_HOOK() in vm_core.h.
+ (3) Add `raw' hooks APIs
+ Normal hooks are guarded from exception by rb_protect().
+ However, this protection is overhead for too simple
+ functions which never cause exceptions. `raw' hooks
+ are executed without protection and faster.
+ Now, we only provide registration APIs. All `raw'
+ hooks are kicked under protection (same as normal hooks).
+
+ * include/ruby/ruby.h: remove internal data definition and
+ macros.
+
+ * internal.h (ruby_suppress_tracing), vm_trace.c: rename
+ ruby_suppress_tracing() to rb_suppress_tracing()
+ and remove unused function parameter.
+
+ * parse.y: fix to use renamed rb_suppress_tracing().
+
+ * thread.c (thread_create_core): no need to set RUBY_VM_VM.
+
+ * vm.c (mark_event_hooks): move definition to vm_trace.c.
+
+ * vm.c (ruby_vm_event_flags): add a global variable.
+ This global variable represents all of Threads and VM's
+ event masks (T1#events | T2#events | ... | VM#events).
+ You can check the possibility kick trace func or not
+ with ruby_vm_event_flags.
+ ruby_vm_event_flags is maintained by vm_trace.c.
+
+ * cont.c (fiber_switch, rb_cont_call): restore tracing status.
+ [Feature #4347]
+
+ * test/ruby/test_continuation.rb: ditto.
+
+Thu Aug 16 19:15:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * object.c (rb_class_initialize): forbid inheriting uninitialized
+ class. another class tree not based on BasicObject cannot exist.
+ [ruby-core:47148][Bug #6863]
+
+Thu Aug 16 11:52:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/-ext-/test_printf.rb (Test_SPrintf#test_{taint,untrust}): use
+ plain object so that the results of to_s and inspect are infected.
+ [ruby-dev:46053] [Bug #6881]
+
+Thu Aug 16 09:46:07 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * strftime.c: remove unnecessary macros to check traditional C.
+ https://github.com/ruby/ruby/pull/46 by lateau (Daehyub Kim).
+
+ * vsnprintf.c: remove K&R.
+
+Wed Aug 15 20:47:49 2012 Benoit Daloze <eregontp@gmail.com>
+
+ * object.c (rb_obj_inspect): Kernel#inspect: do not call #to_s. A class
+ can now benefit from the nice default #inspect even if it defines #to_s.
+ Also, there is no more unexpected change in #inspect result.
+
+ * NEWS: Add note about the change.
+
+ * bignum.c, io.c, numeric.c, object.c, proc.c, vm.c (Init_*):
+ Adapt internal structures (by aliasing #inspect to #to_s) so they
+ don't rely on the removed behavior (#inspect calling overridden #to_s).
+
+ * test/ruby/test_object.rb (test_inspect): add tests for Kernel#inspect.
+
+ * lib/pp.rb (class PP): do not call #to_s anymore, as #inspect
+ no more does (mame).
+
+ * test/test_pp.rb (class PPInspectTest): remove related assertion (mame).
+ [ruby-core:43238][Feature #6130]
+
+ * test/drb/drbtest.rb (DRbCore#teardown, DRbAry#teardown):
+ adapt DRb tests with the new change (shirosaki).
+ [ruby-core:47182][Bug #6866]
+
+Wed Aug 15 18:05:37 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::Runner#failed): need to delete the
+ status line if the status is skipped and -q is specified.
+
+Wed Aug 15 16:26:52 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * sprintf.c (ruby__sfvextra): the result should be infected by the
+ given strings.
+
+ * sprintf.c (ruby__sfvwrite): set buffer length and exclude
+ uninitialized garbage to get correct coderange.
+
+Wed Aug 15 16:20:09 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (ID_H_TARGET): make timestamp file of id.h so that the
+ header will not be remade repetitively.
+
+Wed Aug 15 11:39:53 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_trace.c: separate trace_func related functions from
+ thread.c.
- * include/ruby/intern.h: remove rb_fd_copy() to rb_fd_dup() and
- rb_w32_fdcopy() to rb_w32_fd_dup().
- * win32/win32.c: ditto.
* thread.c: ditto.
-Sun May 15 22:26:39 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+ * common.mk: add vm_trace.o.
- * signal.c (rb_f_kill): accept '-SIGXXX' style signal with Symbol or
- implicit convertion with #to_str. [ruby-dev:43169] fixes #4362
- * test/ruby/test_signal.rb (test_signal_process_group): add a test
- for send signal to process group.
+ * inits.c: call Init_vm_trace().
-Sun May 15 21:22:35 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+Tue Aug 14 16:25:46 2012 Shugo Maeda <shugo@ruby-lang.org>
- * cont.c (cont_init): clear macihne_stack_start/end of saved thread to
- prevent mark machine stack of GC'ed Thread. root Fiber is not
- initialized by fiber_init().
- based on a patch by Serge Balyuk [ruby-core:35891] fixes #4612
- * test/ruby/test_fiber.rb (test_gc_root_fiber): add test for it.
+ * test/erb/test_erb.rb (test_html_escape): add assertions for the
+ cases where the argument is not a String.
-Sun May 15 21:04:29 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Aug 14 16:03:31 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * transcode.c (econv_init): revert r31353. [ruby-dev:43512]
+ * win32/win32.c (check_valid_dir): reject "..." as directory name.
+ [Bug #6851]
-Sun May 15 03:39:35 2011 Eric Hodel <drbrain@segment7.net>
+Tue Aug 14 16:02:51 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/zlib/zlib.c: Improve documentation. Patch by Vincent Batts.
- [Ruby 1.9 - Bug #4695]
+ * test/ruby/test_file_exhaustive.rb
+ (TestFileExhaustive#test_stat_dotted_prefix): added.
-Sun May 15 03:23:46 2011 Eric Hodel <drbrain@segment7.net>
+Tue Aug 14 15:39:09 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/erb.rb: Document ERB::Compiler. Patch by Simon Chiang.
- [Ruby 1.9 - Bug #4694]
+ * test/ruby/test_file_exhaustive.rb
+ (TestFileExhaustive#test_stat_drive_root): added.
-Sun May 15 00:58:47 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- fix mswin32 build error.
+Tue Aug 14 10:38:17 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * missing/setproctitle.c: add #ifdef HAVE_UNISTD_H.
- * win32/Makefile.sub (MISSING): add setproctitle.obj
+ * lib/erb.rb (ERB::Util.html_escape): fix r36687: call to_s before
+ passing it to CGI.escapeHTML.
-Sat May 14 22:45:28 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Mon Aug 13 13:13:19 2012 Shugo Maeda <shugo@ruby-lang.org>
- * missing/setproctitle.c: add to include "ruby/util.h".
+ * lib/erb.rb (ERB::Util.html_escape): use CGI.escapeHTML to escape
+ single quotes. [ruby-core:47138] [Bug #6861]
-Sat May 14 19:52:22 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Sun Aug 12 11:57:20 2012 Kazuki Tsujimoto <kazuki@callcc.net>
- * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_set_program_name):
- add for $0 test.
+ * vm.c (invoke_block_from_c): fix unintentional block passing.
+ [ruby-dev:45071] [Bug #5832]
-Sat May 14 19:50:46 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Fri Aug 10 08:41:28 2012 Eric Hodel <drbrain@segment7.net>
- * missing/setproctitle.c (compat_init_setproctitle): use
- ruby_strdup() instead of strdup().
+ * gc.c (gc_malloc_allocated_size): RDoc does not process macros, so
+ mention this method is only available when ruby is built with
+ CALC_EXACT_MALLOC_SIZE
+ * gc.c (gc_malloc_allocations): ditto
-Sat May 14 19:37:31 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Thu Aug 9 23:46:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * include/ruby/missing.h: add setproctitle() declaration.
- * missing/setproctitle.c: added.
- * configure.in: add check for missing/setproctitle.c.
+ * tool/mkrunnable.rb: see build_os instead of target arch for
+ cross-compiling.
- * ruby.c (ruby_process_options): add to call compat_init_setproctitle().
- * ruby.c (set_arg0): remove all platform specific code. it's
- moved to missing/setproctitle.c.
- * ruby.c (origarg): remove len field. It's no longer used.
- * ruby.c (get_arglen): removed.
+ * configure.in (MINIRUBY): use real path for include path.
- This patch makes a lot of cleanup set_arg0 related code and fixes
- [Feature #4689].
+ * template/fake.rb.in (builddir): remove duplications
-Sat May 14 17:42:21 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+Thu Aug 9 20:03:11 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * process.c (rb_proc_times): improve documentation.
- [ruby-core:35785] fixes #4581, reported by Andrew Grimm.
+ * test/ruby/test_file_exhaustive.rb
+ (TestFileExhaustive#test_stat_special_file): add a test.
+ GetFileAttributesExW fails to get attributes of special files
+ such as pagefile.sys.
-Sat May 14 12:12:54 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * win32/win32.c (check_valid_dir): for performance, check the path
+ by FindFirstFileW only if the path contains "..."
- * test/openssl/test_pkey_dsa.rb: Add basic tests and tests that
- ensure new public key PEM encoding behavior and ensure backward
- compatibility.
- [Ruby 1.9 - Bug #4422] [ruby-core:35328]
- * test/openssl/test_pkey_rsa.rb: Remove line with 'puts'.
+ * win32/win32.c (winnt_stat): use GetFileAttributesExW instead of
+ FindFirstFileW since GetFileAttributesExW is faster.
+ Based on the patch by Dusan D. Majkic.
+ [ruby-core:47083] [Feature #6845]
-Sat May 14 12:06:49 2011 Eric Hodel <drbrain@segment7.net>
+Thu Aug 9 18:33:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rdoc/context.rb (class RDoc): Fix infinite loop caused by
- re-encountering BasicObject.
+ * ruby.c (proc_options): show version only once even if -v and
+ --version are given together.
+ http://twitter.com/d6rkaiz/status/233491797085671424
-Sat May 14 10:32:36 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+Thu Aug 9 12:37:22 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/openssl/test_pkey_rsa.rb: Add tests that ensure new public key
- encoding behavior and also ensure backward compatibility.
- [Ruby 1.9 - Bug #4421] [ruby-core:35327]
+ * test/openssl/test_config.rb (OpenSSL#test_constants): skip this
+ test if platform is Mac OS X or Windows. [Bug #6830]
-Sat May 14 09:50:10 2011 Eric Hodel <drbrain@segment7.net>
+Wed Aug 8 22:51:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/yaml/dbm.rb: Add documentation. Patch by Justin Collins.
- [Ruby 1.9 - Bug #4693]
- * lib/yaml/store.rb: ditto
+ * vm_eval.c (eval_under): singletons other than special constants
+ don't need cref-scope hack.
-Sat May 14 09:31:43 2011 Eric Hodel <drbrain@segment7.net>
+Wed Aug 8 22:45:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rdoc.rb: Updated to RDoc 3.6
+ * common.mk (.y.h): split from .y.c rule to manage dependency on
+ parse.h. [ruby-core:46741] [Bug #6789]
-Sat May 14 07:30:29 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+ * common.mk (id.h): keep old file unless changed.
- * ext/psych/lib/psych.rb: released a new gem, so increasing version.
+Wed Aug 8 17:11:20 2012 Koichi Sasada <ko1@atdot.net>
-Sat May 14 05:08:32 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * compile.c (ADD_INSNL): make ADD_INSNL as alias of ADD_INSN1.
- * ext/openssl/ossl_digest.c
- * ext/openssl/ossl_pkey.c
- * ext/openssl/ossl_pkey.h
- * test/openssl/pkey/test_pkey_rsa.rb
- Reverted premature commit. Sorry for the noise!
+Wed Aug 8 17:08:14 2012 Koichi Sasada <ko1@atdot.net>
-Sat May 14 05:02:58 2011 Eric Hodel <drbrain@segment7.net>
+ * bootstrap/test_exception.rb: fix a last committed test.
- * lib/uri.rb: Add toplevel documentation. Patch by Vincent Batts.
- [Ruby 1.9 - Bug #4690]
+Wed Aug 8 16:27:58 2012 Koichi Sasada <ko1@atdot.net>
-Sat May 14 04:19:06 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * compile.c, insns.def (checkmatch):
+ remove checkincludearray instruction and
+ add new instruction checkmatch.
+ This change is to solve
+ [Bug #4438] "rescue args type check omitted".
- * NEWS: Describe altered behaviour for RSA and DSA public key
- encoding. [Ruby 1.9 - Bug #4421, Bug #4422]
- [ruby-core:35327,35328]
+ * iseq.c: increment ISEQ_MAJOR_VERSION because removal of
+ checkincludearray instruction.
-Sat May 14 02:57:52 2011 Eric Hodel <drbrain@segment7.net>
+ * vm_core.h: add several definitions for
+ the checkmatch instruction.
- * lib/ipaddr.rb (unless Socket): Document valid*? methods. Patch by
- Sebastian Martinez. [Ruby 1.9 - Feature #4687]
+ * vm_insnhelper.c (check_match): added.
-Sat May 14 02:54:04 2011 Eric Hodel <drbrain@segment7.net>
+ * bootstraptest/test_exception.rb: add a test.
- * lib/rexml/functions.rb: Add some documentation for REXML::Functions.
- Patch by Sebastian Martinez. [Ruby 1.9 - Feature #4688]
+ * test/ruby/test_exception.rb: ditto.
-Sat May 14 02:51:42 2011 Eric Hodel <drbrain@segment7.net>
+Wed Aug 8 05:51:20 2012 Eric Hodel <drbrain@segment7.net>
- * lib/resolv.rb: Hide private method and state-tracking constants from
- RDoc. Patch by Mark Turner. [Ruby 1.9 - Feature #4691]
+ * proc.c (method_clone): Added documentation. Patch by Robin Dupret.
+ Fixes #152 on github.
-Fri May 13 19:23:21 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
+Tue Aug 7 20:19:29 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * numeric.c (flo_coerce): Add #flo_coerce documentation.
- Patch by Sebastian Martinez.
- https://github.com/ruby/ruby/pull/21
+ * ext/readline/readline.c (Init_readline): rl_catch_signals=0 returns
+ back. Without this, on FreeBSD9 and readline 6.2 irb can't catch ^C.
+ [Bug #5423]
-Fri May 13 18:42:22 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
+Tue Aug 07 20:12:39 2012 Koichi Sasada <ko1@atdot.net>
- * README.EXT: fix typo. Patch by William Blackerby.
- https://github.com/ruby/ruby/pull/19
+ * vm_exec.c, insns.def (leave): solve problems on
+ OPT_CALL_THREADED_CODE.
+ Catch up finish frame structure on OPT_CALL_THREADED_CODE.
- * README.EXT.ja: ditto.
+ * vm_core.h: add rb_thread_t#retval for temporary space on
+ OPT_CALL_THREADED_CODE.
-Fri May 13 15:22:34 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * vm.c (th_init): clear rb_thread_t#retval as Qundef.
- * win32/win32.c (rb_w32_select): check invalid handle before doing
- select operations. see [ruby-dev:43513], [ruby-dev:43535]
+ * vm_dump.c (rb_vmdebug_debug_print_pre): fix debug print format.
-Fri May 13 08:34:00 2011 Eric Hodel <drbrain@segment7.net>
+Tue Aug 7 11:58:27 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/rdoc/rdoc.rb: Output summary after documentation report.
- * lib/rdoc/stats/normal.rb: Don't output information for users when
- we're not on a TTY
+ * test/ruby/test_require.rb (TestRequire#test_require_twice): added.
-Fri May 13 07:49:02 2011 Eric Hodel <drbrain@segment7.net>
+Tue Aug 7 11:35:37 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/fileutils.rb: Hide internal methods from RDoc. Patch by Darragh
- Curran. [Ruby 1.9 - Bug #4684]
+ * vm_method.c (rb_redefine_opt_method): use RCLASS_ORIGIN to avoid
+ SEGV when a module-prepended class is refined.
-Fri May 13 07:36:23 2011 Eric Hodel <drbrain@segment7.net>
+Tue Aug 7 10:46:37 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/webrick/httpservlet/erbhandler.rb: Add documentation.
+ * test/ruby/test_file_exhaustive.rb
+ (TestFileExhaustive#test_expand_path*): refactoring. split the method
+ into some chunks of the same kind of tests.
-Fri May 13 07:04:33 2011 Eric Hodel <drbrain@segment7.net>
+Tue Aug 7 00:31:09 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mathn.rb: Fix indentation. Patch by Jason Dew.
- [Ruby 1.9 - Feature #4682]
+ * class.c (rb_special_singleton_class_of): utility function.
-Fri May 13 06:50:43 2011 Eric Hodel <drbrain@segment7.net>
+ * vm_eval.c (eval_under): special deal for class variable scope with
+ instance_eval.
- * lib/mathn.rb: Add documentation. Patch by Jason Dew. [Ruby 1.9 -
- Feature #4667]
+ * vm_eval.c (rb_obj_instance_eval, rb_obj_instance_exec): allow method
+ definition in instance_eval of special constants. [ruby-core:28324]
+ [Bug #2788]
-Fri May 13 05:44:19 2011 Eric Hodel <drbrain@segment7.net>
+Tue Aug 7 00:23:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/logger.rb (class Logger): Document Logger#datetime_format.
- Patch by Sergio Gil Perez de la Manga. [Ruby 1.9 - Bug #4678]
+ * variable.c (CVAR_LOOKUP): split into helper functions.
-Fri May 13 05:39:11 2011 Eric Hodel <drbrain@segment7.net>
+Mon Aug 6 19:15:11 2012 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * re.c (Init_Regexp): Document option constants. Patch by Vincent
- Batts. [Ruby 1.9 - Bug #4677]
- * lib/uri/common.rb (module URI): Documentation for URI. Patch by
- Vincent Batts. [Ruby 1.9- Bug #4677]
- * lib/uri/ftp.rb (module URI): ditto
- * lib/uri/generic.rb (module URI): ditto
- * lib/uri/http.rb (module URI): ditto
- * lib/uri/https.rb (module URI): ditto
- * lib/uri/ldap.rb (module URI): ditto
- * lib/uri/ldaps.rb (module URI): ditto
- * lib/uri/mailto.rb (module URI): ditto
- * process.c (Init_process): Document Process constants. Patch by
- Vincent Batts. [Ruby 1.9- Bug #4677]
+ * test/win32ole/test_win32ole_variant.rb: setting WIN32OLE.locale
+ to pass some assertion. Thanks to Hiroshi Shirosaki.
+ [ruby-core:46873][Bug #6814]
-Fri May 13 05:16:38 2011 Eric Hodel <drbrain@segment7.net>
+Mon Aug 6 15:54:50 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/rss/atom.rb (module RSS): Document URIs. Patch by Mark Turner.
- [Ruby 1.9 - #4671]
- * lib/rss/rss.rb (module RSS): Document exception classes. Patch by
- Mark Turner. [Ruby 1.9 - #4671]
+ * internal.h, class.c, eval.c, insns.def: find the appropriate
+ receiver for super called in instance_eval. If such a receiver is
+ not found, raise NoMethodError. [ruby-dev:39772] [Bug #2402]
-Fri May 13 02:15:18 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Mon Aug 6 14:54:38 2012 Shugo Maeda <shugo@ruby-lang.org>
- * io.c (select_internal): remove unused variable (interrupt_flag).
+ * include/ruby/ruby.h, eval.c, vm_insnhelper.c: fix typo.
-Thu May 12 18:24:34 2011 Kouhei Sutou <kou@clear-code.com>
+Mon Aug 6 13:13:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in: limit to "T" type for prefix of external symbols
- because x86_64-w64-mingw32-gcc on Debian GNU/Linux generates the
- following symbol:
- 0000000068483390 D _GLOBAL__F__conftest_external
+ * vm_eval.c (vm_call_super): since cfp->klass is always class or
+ iclass, no search from method entry.
- Approved by nobu.
+ * insns.def (defined): now should use klass in the current control
+ frame to search superclass, not me->klass. reported by naruse.
-Thu May 12 14:50:52 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Aug 6 11:19:19 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/dl/test_base.rb (Fiddle::LIBC_SO): its always msvc*.dll on
- mswin/mingw.
+ * test/etc/test_etc.rb (TestEtc#test_getpwuid): `s' is never set to nil.
-Thu May 12 14:47:53 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Aug 6 11:08:48 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/mkmf.rb (Logging.postpone): copy only when temporary logfile
- exists.
+ * test/syslog/test_syslog_logger.rb: skip unless Syslog module is
+ available.
-Thu May 12 12:24:22 2011 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+Mon Aug 6 00:40:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_ssl.c: By trunk@31346, function check of SSLv2 is
- executed.
- However, the problem is not revised in this.
- This adds the control of using function of SSLv2 in made macro by
- function check.
+ * ext/bigdecimal/bigdecimal.c (BigMath_s_log): fix format specifier.
-Thu May 12 08:10:46 2011 Eric Hodel <drbrain@segment7.net>
+Mon Aug 6 00:39:24 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/set.rb (class Set): Add nodoc to internal-use methods. Patch
- by Pete Higgins. [Ruby 1.9 - Bug #4665]
+ * include/ruby/ruby.h (NUM2ULONG): optimize by inline as well as
+ NUM2LONG, and cast to unsigned long explicitly for the platforms
+ where SIZEOF_VALUE is larger than SIZEOF_LONG.
-Thu May 12 08:01:14 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * include/ruby/ruby.h (NUM2SSIZET): fix type to cast.
- * ext/openssl/ossl_pkey_ec.c: Allow encryption when PEM-encoding
- Elliptic Curve private keys.
- [ruby-core:35329] [Bug #4423]
+Sun Aug 5 21:10:36 2012 Narihiro Nakamura <authornari@gmail.com>
-Thu May 12 07:54:59 2011 Eric Hodel <drbrain@segment7.net>
+ * gc.c : if ENABLE_VM_OBJSPACE is 1, rest_sweep is not defined.
+ remove unused declarations. [ruby-core:47004] [Bug #6837]
- * object.c (rb_obj_equal): Add documentation. Patch by Vincent Batts.
- [Ruby 1.9 - Bug #4664]
- * lib/rexml: ditto
- * lib/mkmf.rb: ditto
- * ext/socket/lib/socket.rb: ditto
+Sun Aug 5 19:31:57 2012 Narihiro Nakamura <authornari@gmail.com>
-Thu May 12 07:30:08 2011 Eric Hodel <drbrain@segment7.net>
+ * gc.c: just move functions and so on. I don't touch any internal
+ implementation.
- * Various .document files: Update .document files to match files which
- have documentation.
+Sun Aug 5 13:22:29 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Thu May 12 07:18:45 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * configure.in: use gcc-4.2 prior to clang, gcc, and cc if exist for
+ the use of Snow Leopard's old clang. see also r36594, r36610, r36611.
- * ext/openssl/ossl_pkey_dsa.c: Use generic X.509 SubjectPublicKeyInfo
- format for PEM-encoding DSA public keys.
- [ruby-core:35328] [Bug #4422]
+Sun Aug 5 06:55:10 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Thu May 12 06:27:31 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+ * ext/date/date_{core,strftime}.c: [ruby-core:46990].
- * ext/openssl/ossl_pkey_rsa.c: Use generic X.509 SubjectPublicKeyInfo
- format for encoding RSA public keys.
- [ruby-core:35327] [Bug #4421]
+Sat Aug 4 22:56:20 2012 Narihiro Nakamura <authornari@gmail.com>
-Wed May 11 19:45:27 2011 Keiju Ishitsuka <keiju@ishitsuka.com>
+ * gc.c: use inline functions instead of macros, and close up
+ related codes for the profiler.
- * lib/forwardable.rb: support 'delegate :foo => :bar' for to meet
- by specification of RDOC.
+Sat Aug 4 20:37:56 2012 Narihiro Nakamura <authornari@gmail.com>
-Wed May 11 08:36:38 2011 Eric Hodel <drbrain@segment7.net>
+ * gc.c (gc_mark_children): use gc_mark_ptr instead of marking
+ a object directly.
- * lib/webrick: Add documentation for WEBrick::HTTPAuth
+Sat Aug 4 10:02:03 2012 Shugo Maeda <shugo@ruby-lang.org>
-Wed May 11 03:06:35 2011 Eric Hodel <drbrain@segment7.net>
+ * test/ruby/test_alias.rb (test_super_in_aliased_module_method):
+ add a test case for [ruby-dev:46028], which fails in 1.8.
- * lib/rss.rb: Add documentation for RSS. Patch by Steve Klabnik.
- [Ruby 1.9 - Bug #4663]
+Sat Aug 4 01:56:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue May 10 14:50:32 2011 Shota Fukumori <sorah@tubusu.net>
+ * vm_insnhelper.c (vm_search_normal_superclass): no longer needs
+ receiver, klass is always unique in the ancestors now.
- * lib/test/unit.rb: Add option for hiding skip messages when test
- ends. #4657
+Sat Aug 4 01:27:40 2012 Shugo Maeda <shugo@ruby-lang.org>
- * test/testunit/test_hideskip.rb, test/testunit/test4test_hideskip.rb:
- test for above.
+ * insns.def (invokesuper): reverted r36612 so that super in an
+ aliased method will not call the same method.
-Tue May 10 10:53:04 2011 Eric Hodel <drbrain@segment7.net>
+Fri Aug 3 19:26:10 2012 Shugo Maeda <shugo@ruby-lang.org>
- * common.mk (rdoc): Add rdoc-coverage rule
+ * insns.def (invokesuper): don't skip the same class. instead, use
+ rb_method_entry_get_with_omod() to avoid infinite loop when
+ super is used with refinements. [ruby-core:30450] [Bug #3351]
-Tue May 10 09:13:21 2011 Eric Hodel <drbrain@segment7.net>
+Fri Aug 3 19:21:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/webrick: Add Documentation
+ * configure.in: use clang prior to gcc only when self-compiling on
+ darwin. search default compilers on other platforms. [Bug #6816]
-Tue May 10 04:22:09 Eric Hodel <drbrain@segment7.net>
+Fri Aug 3 17:25:49 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/webrick/log.rb: Hide copyright info from ri
- * lib/webrick/httpstatus.rb: ditto
- * lib/webrick/htmlutils.rb: ditto
- * lib/webrick/httpversion.rb: ditto
- * lib/webrick/version.rb: ditto
- * lib/webrick/httpauth/userdb.rb: ditto
- * lib/webrick/httpauth/authenticator.rb: ditto
- * lib/webrick/accesslog.rb: ditto
+ * configure.in: move RUBY_MINGW32 after AC_PROG_CC.
+ RUBY_MINGW32 uses AC_TRY_CPP and it sets CC and CPP. [Bug #6816]
-Mon May 9 20:57:13 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * configure.in: don't use AC_PROG_CC in AS_CASE.
- * test/ruby/test_{complex,rational}.rb: added tests.
+Fri Aug 3 17:21:52 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon May 9 20:29:44 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * test/runner.rb: get rid of loading previously installed gems.
+ [ruby-dev:46025]
- * complex.c (string_to_c_internal): a refactoring.
+Fri Aug 3 16:40:01 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
-Mon May 9 18:33:05 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * .travis.yml (notifications): [experimental] IRC notifications.
- * string.c: Improve documentation for String#start_with? and
- String#end_with?. fixes #4652
- patched by Andrew Grimm <andrew.j.grimm at gmail.com>
+Thu Aug 2 20:32:29 2012 Shugo Maeda <shugo@ruby-lang.org>
-Mon May 9 13:49:00 2011 Kenta Murata <mrkn@mrkn.jp>
+ * eval.c (rb_mod_using): new method Module#using. [experimental]
- * complex.c (string_to_c_internal): support scientific notation.
- patched by Tinco Andringa. https://github.com/ruby/ruby/pull/16
- [ruby-core:36046][Bug #4655]
+ * eval.c (rb_mod_refine): new method Module#refine. [experimental]
-Mon May 9 11:52:48 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * eval.c (f_using): new method Kernel#using. [experimental]
- * numeric.c (int_ord): remove K&R style.
- patched by Daehyub Kim. https://github.com/ruby/ruby/pull/17
+Thu Aug 2 20:08:02 2012 Shugo Maeda <shugo@ruby-lang.org>
-Sun May 8 22:17:24 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * class.c, insns.def, method.h, proc.c, vm.c, vm_core.h, vm_eval.c,
+ vm_insnhelper.c, vm_insnhelper.h, vm_method.c: add klass to
+ rb_control_frame_t to implement super correctly.
- * test/ruby/test_{complex2,complexrational}.rb: use skip.
- * test/date/*.rb: ditto.
+Thu Aug 2 13:23:08 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Sun May 8 21:02:31 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * configure.in (AC_PROG_CC): AC_PROG_CC tries clang at first on
+ darwin. [Bug #6816]
- * test/ruby/test_{complex2,complexrational}.rb: NEVER SKIP.
+Thu Aug 2 11:39:25 2012 Narihiro Nakamura <authornari@gmail.com>
-Sun May 8 21:01:21 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * gc.c: return true or false. Patch by Dirkjan Bussink. [Bug #6821]
- * test/date/test_date_base.rb: fixed.
+ * test/ruby/test_gc.rb: add test-case for this bug.
-Sun May 8 20:54:11 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Thu Aug 2 10:51:12 2012 Martin Bosslet <Martin.Bosslet@gmail.com>
- * test/date/*.rb: NEVER SKIP.
+ * ext/openssl/lib/openssl/digest.rb
+ test/openssl/test_digest.rb: Add Digest module function to OpenSSL
+ module and test it. Patch provided by Eric Hodel.
+ [ruby-core:46908][Feature #6819]
-Sun May 8 20:37:33 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Wed Aug 1 22:29:12 2012 Benoit Daloze <eregontp@gmail.com>
- * test/date/*.rb: reverted 31432.
+ * ext/digest/digest.c (hexencode_str_new): return an ASCII string
-Sun May 8 20:32:43 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * test/digest: tests for all kind of digests encodings
+ [ruby-core:46792][Bug #6799]
- * test/date/*.rb: reverted 31483.
+Wed Aug 1 05:50:53 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Sun May 8 19:39:16 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_encoding):
+ Fix test_encoding failure on Windows.
+ With chcp 65001, 1252 and 437, test_encoding failed. Test result
+ depends on locale because LANG environment variable doesn't affect
+ locale on Windows.
+ [ruby-core:46872] [Bug #6813]
- * thread_pthread.c (native_cond_timedwait): add to care EINTR.
- * thread_pthread.c (thread_timer): remove EINTR check.
+Wed Aug 1 00:33:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun May 8 19:04:15 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * class.c (include_class_new): fix duplication of prepended module.
+ since m_tbl of prepended module is always zero, copy from its
+ copy iclass of original.
- * lib/time.rb (xmlschema): avoid passing any negative numbers.
+Tue Jul 31 18:22:34 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun May 8 18:40:03 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * variable.c (classname): tell if found name is permanent. search
+ tmp_classpath only if class id is set. [ruby-core:42865][Bug #6078]
- * ext/date/date_{parse,strptime}.c: introduced some macros.
+ * variable.c (rb_class_path): duplicate found temporary path.
-Sun May 8 17:17:13 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * variable.c (rb_set_class_path_string, rb_set_class_path): set class
+ id to find classpath.
- * test/date/*.rb: use skip /w messages.
+Tue Jul 31 10:36:12 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Sun May 8 17:04:55 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * ext/psych/lib/psych.rb: updated to released version.
- * ext/date/lib/date/format.rb (_httpdate): omitted to call zone_to_diff.
+ * ext/psych/psych.gemspec: ditto
-Sun May 8 16:56:19 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Tue Jul 31 06:18:06 2012 Eric Hodel <drbrain@segment7.net>
- * ext/date/date_core.c (date_s_test_*): use macros.
+ * time.c (time_sec): Remove extra wording about leap seconds and refer
+ directly to Wikipedia's leap second page for further information.
+ [Bug #6749]
-Sun May 8 10:24:16 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Mon Jul 30 23:01:47 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * thread_pthread.c: cleanup signal_thread_list related ifdef.
- 1) we don't have to use #ifdef FOO-PLATFORM directly 2) About
- half #ifdef didn't care symbian properly.
+ * lib/rubygems/platform.rb (Gem::Platform#initialize): Support pattern
+ like x86_64-netbsd6.99.7.
-Sun May 8 05:19:37 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Mon Jul 30 21:00:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/io/wait/test_io_wait.rb: Linux socketpair(2) only support
- AF_UNIX, but windows socketpair doesn't support it. we can't
- avoid platform check. sigh!
+ * variable.c (find_class_path): no retry when preferred is given.
-Sun May 8 00:13:05 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * variable.c (classname): if classid is set try it to find full
+ qualified class path, and then try arbitrary class path. try
+ tmp_classpath at last even if enclosing namespace is anonymous.
+ fix r36574. [ruby-core:42865][Bug #6078]
- * test/io/wait/test_io_wait.rb: use Socket.pair instead of pipe.
- Windows can only treat a socket.
+ * variable.c (rb_set_class_path_string, rb_set_class_path): set
+ tmp_classpath instead of classpath if the name is not permanent.
-Sat May 7 22:43:48 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Mon Jul 30 14:24:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * thread.c (rb_fd_zero): remove redundant zero fill.
+ * variable.c: store anonymous class path in tmp_classpath but not in
+ classpath. [ruby-core:42865][Bug #6078]
-Sat May 7 22:38:04 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Mon Jul 30 13:11:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * thread.c (rb_fd_init): remove volatile qualifier.
+ * configure.in (DLDFLAGS): on Darwin, deprecate -flat_namespace to get
+ rid of huge imported symbols table.
-Sat May 7 22:34:29 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * configure.in (LIBRUBY_RELATIVE): libruby_so is not made when
+ disable-shared, so no absolute path is used for it and executable
+ file is runnable anywhere.
- * thread.c (rb_fd_init_copy): new internal api. It provide efficient
- copy constructor semantics.
- * thread.c (do_select): use rb_fd_init_copy().
+Mon Jul 30 01:30:10 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Sat May 7 15:18:06 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- fix incorrect native_cond_signal call when deadlock was detected.
+ * common.mk: add a dependency. [ruby-core:46741] [Bug #6789]
- * thread.c (lock_func): decrement cond_waiting if timeout was happen.
+Sun Jul 29 15:44:47 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Sat May 7 18:28:37 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread.c (thread_create_core): hide th->async_errinfo_mask_stack from
+ ObjectSpace.each_object. refix of r36539.
- * thread_pthread.c (USE_MONOTONIC_COND): check the availability
- more strictly.
+Sun Jul 29 23:57:27 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * thread_pthread.h (rb_thread_cond_t): ditto.
+ * ext/socket/option.c (inet_ntop): use rb_w32_inet_ntop, instead of
+ inet_ntop directly, which is unavailable on older version Windows.
-Sat May 7 15:15:10 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * win32/win32.c (rb_w32_inet_ntop): type should be const.
- fix win32 native_cond_timedwait() makes SIGSEGV.
+Sun Jul 29 14:20:34 2012 Kazuki Tsujimoto <kazuki@callcc.net>
- * thread_win32.h (rb_thread_cond_struct): add prev field instead of
- last. (ie cond_event_entry is now using double linked list instead of
- single)
- * thread_win32.c (cond_event_entry): add prev field.
+ * thread.c (Init_Thread): does not need to set klass
+ explicitly.
- * thread_win32.c (__cond_timedwait): remove entry properly if timeout
- was happen.
+Sun Jul 29 06:21:04 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * thread_win32.c (native_cond_signal): change for double linked list.
- * thread_win32.c (native_cond_broadcast): ditto.
- * thread_win32.c (native_cond_initialize): ditto.
+ * win32/win32.c: suppress warning redeclared on mingw64.
+ *_s functions are declared if MINGW_HAS_SECURE_API is defined.
+ Follow up r36556.
-Sat May 7 12:41:04 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- fix mutex deadlock test hang-up.
+Sun Jul 29 00:28:46 2012 Narihiro Nakamura <authornari@gmail.com>
- * thread_win32.c (abs_timespec_to_timeout_ms): fix 1000x calculation
- mistake. (ie fix hang-up native_cond_timedwait())
+ * gc.c: remove unused initialization.
-Sat May 7 03:14:13 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Sat Jul 28 16:26:09 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- sleep_cond use monotonic time if possible.
+ * win32/win32.c (gmtime_r): use _gmtime64_s() with x86_64-w64-mingw32.
- * thread_pthread.c (native_thread_init): change sleep_cond
- attribute to monotonic.
- * thread_pthread.c (native_sleep): use native_cond_timeout().
+ * win32/win32.c (localtime_r): use _localtime64_s() with
+ x86_64-w64-mingw32. Since FileTimeToSystemTime() seems not work with
+ large value under x64. Mingw-w64 doesn't have these declaration.
+ [ruby-core:46780] [Bug #6794]
- * thread_pthread.c (native_cond_timeout): add overflow care.
- * thread_win32.c (native_cond_timeout): ditto.
+Fri Jul 27 18:25:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat May 7 02:49:12 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- fix win32 compile error.
+ * io.c (rb_io_check_io): make public.
- * thread_win32.c (RB_CONDATTR_CLOCK_MONOTONIC): define
- RB_CONDATTR_CLOCK_MONOTONIC always.
- * thread_pthread.c (RB_CONDATTR_CLOCK_MONOTONIC): ditto.
+ * process.c (check_exec_redirect): try conversion to IO on redirect
+ parameters. [ruby-core:44181] [Bug #6269]
-Sat May 7 02:29:41 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Fri Jul 27 17:58:12 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- mutex: deadlock check timeout use monotonic time.
+ * configure.in (RUBY_CPPOUTFILE): get rid of variable conflict so
+ CPPFLAGS is not duplicated. [ruby-core:43097] [Bug #6119]
- * thread_pthread.c (native_cond_timeout): new internal api.
- it calculate a proper time for argument of native_cond_timedwait().
- * thread_win32.c (native_cond_timeout): ditto.
+Fri Jul 27 12:12:36 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * thread_pthread.c (thread_timer): use native_cond_timeout()
- instead of get_ts.
- * thread.c (lock_func): ditto.
+ * win32/mkexports.rb: should not export DllMain().
+ reported by luis at [ruby-core:46743] [Bug #6790], solved by
+ Heesob Park, and confirmed by nobu.
- * thread_pthread.c (get_ts): removed. use native_cond_timeout().
- * thread.c (init_lock_timeout): ditto.
+Thu Jul 26 14:51:29 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
-Sat May 7 01:54:21 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/net/http/test_https.rb (TestNetHTTPS#test_session_reuse):
+ localhost is not (always) 127.0.0.1. Don't expect that.
- * thread_pthread.c (get_ts): add monotonic clock capability.
- * thread_pthread.c (rb_thread_create_timer_thread): use monotonic
- clock if possible.
+Thu Jul 26 07:18:38 2012 <kanemoto@ruby-lang.org>
-Sat May 7 01:43:37 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * ext/json/fbuffer/fbuffer.h: avoid compilation error on AIX by
+ -ansi -std=iso9899:199409 (r36038). [ruby-core:46744] [Bug #6791].
- * thread_pthread.h (rb_thread_cond_t): add clockid field. it's
- no longer an alias of pthread_cond_t.
- * thread_pthread.c: adapt new rb_thread_cond_t type.
- * thread.c (mutex_alloc): ditto.
- * thread_win32.c (native_cond_initialize): ditto.
- * configure.in: add check for pthread_cond_attr_setclock() and
- clockid_t type.
+Thu Jul 26 00:42:23 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Fri May 6 23:29:47 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * thread.c (thread_create_core, Init_Thread): hide
+ th->async_errinfo_queue and th->async_errinfo_mask_stack from
+ ObjectSpace.each_object.
- * thread.c (rb_wait_for_single_fd): use ppoll() instead of poll()
- if possible. based on a patch from Eric Wong. [ruby-core:36003].
+Wed Jul 25 17:41:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri May 6 23:13:43 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * complex.c, rational.c: compatible marshal loader for compatibilities
+ with 1.8. [ruby-core:45775] [Bug #6625]
- * configure.in: remove nanosleep check. we no longer use it.
- r20124 removed last usage.
+Wed Jul 25 17:17:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri May 6 22:35:56 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * atomic.h: prefer GCC atomic builtins than Windows APIs, if possible,
+ since they are generic.
- * ext/syck/rubyext.c (mktime_do): extra digits are not used.
+Wed Jul 25 11:16:57 2012 Eric Hodel <drbrain@segment7.net>
-Fri May 6 17:43:07 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/net/.document: Removed. All files in net/ should be included in
+ RDoc.
- * ext/syck/rubyext.c (mktime_do): remove unused variable offset.
+Wed Jul 25 10:00:23 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/syck/syck.h: use #ifdef instead of #if DEBUG.
+ * test/testunit/test_redefinition.rb: broken class/method names.
-Fri May 6 16:27:33 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Wed Jul 25 09:26:32 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/date/date_core.c (DAY_IN_NANOSECONDS): refix: 31438.
- check with LONG_MAX and cast as long; without this the calculation
- will be done as int and overflow.
+ * lib/cgi/html.rb: Use << instead of +=.
+ `a += b` is syntax sugar of `a = a + b`; it creates a new string
+ object. `a << b` is concatenation and doesn't create new object.
-Fri May 6 15:01:11 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
+Wed Jul 25 09:16:26 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/syck/rubyext.c (mktime_do): avoid buffer overrun, by
- silently ignoring lesser significant digits. Required buffer
- length can be computable so you might at first think of
- allocating enough memory space on the fly using alloca(). That
- is a wrong idea because when using alloca there is always risk
- of integer overflow. A function that accepts outer-process
- resources like this should not blindly trust its inputs. In
- this particular case we just want to generate milliseconds
- resolution by strtod() so the string in question needs no more
- length than what we originally have. Ignoring lesser
- significant digits should suffice I believe.
+ * lib/cgi/html.rb (element_init): suppress redefine warning.
+ Don't define methods if they are already defined.
-Fri May 6 14:25:53 2011 Tinco Andringa <mail@tinco.nl>
+Wed Jul 25 09:05:38 2012 Eric Hodel <drbrain@segment7.net>
- * ext/syck/rubyext.c (mktime_do): YAML.load time correctly parse
- usecs smaller than 1 fixes #4571
+ * lib/net/http.rb: Added SSL session reuse across connections for a
+ single instance to speed up connection. [Feature #5341]
+ * NEWS: ditto
+ * test/net/http/test_https.rb: Tests for #5341
-Thu May 5 22:23:34 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Wed Jul 25 06:54:24 2012 Eric Hodel <drbrain@segment7.net>
- * thread_pthread.c (native_mutex_reinitialize_atfork): removed
- unused macro.
- * thread_win32.c (native_mutex_reinitialize_atfork): ditto.
+ * doc/re.rdoc: Fix spelling
-Thu May 5 22:09:39 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jul 25 06:49:12 2012 Eric Hodel <drbrain@segment7.net>
- * ext/date/date_core.c (DAY_IN_NANOSECONDS): long long int is not
- available on all platforms.
+ * re.c (rb_reg_s_last_match): Update $~ to reference Regexp
+ documentation about "special global variables". [Bug #6723]
-Thu May 5 17:36:31 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+Wed Jul 25 06:28:56 2012 Eric Hodel <drbrain@segment7.net>
- * eval.c (frame_func_id): store result of method_entry_of_iseq() to
- cfp->me because method_entry_of_iseq() might become expensive.
+ * iseq.c: Added documentation. Patch by David Albert. [Bug #6785]
-Thu May 5 15:03:51 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+Wed Jul 25 03:05:06 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * eval.c (frame_func_id): __method__ return different name from
- methods defined by Module#define_method with a same block.
- [ruby-core:35386] fixes #4606
- * eval.c (method_entry_of_iseq): new helper function. search control
- frame stack for a method entry which has given iseq.
- * test/ruby/test_method.rb: add tests for #4606
+ * parse.y: added symbols and qsymbols productions for %i and %I
+ support. %i{ .. } returns a list of symbols without interpolation,
+ %I{ .. } returns a list of symbols with interpolation. Thanks to
+ Josh Susser for inspiration of this feature. [Feature #4985]
-Wed May 4 22:13:09 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * ext/ripper/eventids2.c: added ripper events for %i and %I.
- * benchmark/bm_vm4_pipe.rb: Reduced iterations. Too slow benchmark
- is bad.
- * benchmark/bm_vm4_thread_pass.rb: ditto.
+ * test/ripper/test_parser_events.rb: ripper tests
-Wed May 4 22:08:22 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/ripper/test_scanner_events.rb: ditto
- * test/date/test_date_base.rb: don't use no message skip().
+ * test/ruby/test_array.rb: test for %i and %I behavior
-Wed May 4 21:11:28 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Tue Jul 24 23:34:43 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * benchmark/bm_io_select2.rb: reduce number of using file
- descriptors. because gdb need some fds.
+ * include/ruby/win32.h (rb_w32_pow): add new function.
+ We use powl() instead of broken pow() for x64-mingw32. This workaround
+ fixes test failures related to floating point numeric.
+ [ruby-core:46686] [Bug #6784]
-Wed May 4 19:00:59 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Tue Jul 24 15:01:24 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * thread.c (rb_wait_for_single_fd): Fix wrong return value.
- * test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb
- (TestWaitForSingleFD#test_wait_for_closed_pipe): test for it.
+ * win32/win32.c (rb_w32_socket, rb_w32_socketpair): remember the family
+ in the high word of socklist value.
-Wed May 4 18:46:39 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * win32/win32.c (overlapped_socket_io, recvmsg, sendmsg, setfl): follow
+ above changes.
- * ext/-test-/wait_for_single_fd: New. for testing
- rb_wait_for_single_fd() internal function.
- The patch was written by Eric Wong. [ruby-core:35991]
+ * win32/win32.c (rb_w32_getsockname): set remembered family to the
+ argument when OS's function fails.
- * test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb: ditto.
+Tue Jul 24 12:35:13 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed May 4 12:46:25 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/ruby/test_dir_m17n.rb: remove a garbage.
- * thread.c (rb_wait_for_single_fd): Added POLLNVAL check.
- based on a patch from Eric Wong at [ruby-core:35991].
+ * test/ruby/test_dir_m17n.rb: convert from ascii-8bit to other encoding
+ with 8bit bytes always fails.
-Wed May 4 11:51:01 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Tue Jul 24 12:32:18 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * io.c (rb_f_select): remove useless ifdef.
+ * test/ruby/test_dir_m17n.rb: sorry, typo.
-Wed May 4 11:42:47 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Tue Jul 24 12:13:26 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/socket/init.c (wait_connectable): fix error handling code.
- RB_WAITFD_OUT is turned on even though an error occur.
+ * test/ruby/test_dir_m17n.rb: refactoring. RE should be in the left side
+ of the =~ operator, and compare the result with nil is meaningless.
-Wed May 4 10:12:39 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Tue Jul 24 11:35:20 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/readline/readline.c (readline_event): use rb_wait_for_single_fd().
- The patch was written by Eric Wong. [Ruby 1.9 - Feature #4531]
+ * test/ruby/test_pack.rb (test_pack_unpack_M): was redefined
+ accidentally.
-Wed May 4 10:10:28 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Tue Jul 24 09:31:18 2012 Eric Hodel <drbrain@segment7.net>
- * ext/socket/init.c (wait_connectable): use rb_wait_for_single_fd().
- The patch was written by Eric Wong. [Ruby 1.9 - Feature #4531]
+ * lib/rubygems: Updated to RubyGems 1.8.24, a bugfix release.
- * ext/socket/init.c (try_wait_connectable, wait_connectable_ensure):
- removed.
+Tue Jul 24 08:30:15 2012 Luis Lavena <luislavena@gmail.com>
-Wed May 4 10:07:48 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/ruby/test_dir_m17n.rb (create_and_check_raw_file_name): add new
+ helper method to ease encoding testing. Patch by Oleg Sukhodolsky.
+ [ruby-core:46589][Bug #6765]
- * ext/io/wait/wait.c (io_wait): use rb_wait_for_single_fd().
- The patch was written by Eric Wong. [Ruby 1.9 - Feature #4531]
+ * test/ruby/test_dir_m17n.rb (test_filename_extutf8): use filesystem
+ encoding when reading entries and comparing.
-Wed May 4 10:01:27 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/ruby/test_dir_m17n.rb (test_filename_utf8_raw_name): removed.
- * thread.c (rb_wait_for_single_fd): new. poll(2) based backend for
- rb_wait_for_single_fd().
- Now only Linux uses it.
+ * test/ruby/test_dir_m17n.rb (test_filename_utf8_raw_jp_name): split test.
- The patch was written by Eric Wong. [Ruby 1.9 - Feature #4531]
+Tue Jul 24 08:09:30 2012 Luis Lavena <luislavena@gmail.com>
-Wed May 4 09:56:57 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/win32ole/test_win32ole_method.rb (is_ruby64?): Correct platform
+ used to identify mingw-w64 (x64-mingw32). Patch by Hiroshi Shirosaki.
+ [ruby-core:46651][Bug #6782]
- * thread.c (rb_wait_for_single_fd): new.
- * thread.c (select_single): select(2) based backend for
- rb_wait_for_single_fd().
+Tue Jul 24 07:22:58 2012 Eric Hodel <drbrain@segment7.net>
- * io.c (make_writeconv): use rb_wait_for_single_fd() instead of
- rb_thread_fd_select().
- * io.c (rb_io_wait_readable): ditto.
- * thread.c (rb_thread_wait_fd_rw): ditto.
+ * time.c (time_sec): Updated description of leap seconds for accuracy.
+ Based on patch by Marcus Stollsteimer. [Bug #6749]
- * io.c (wait_readable): removed.
- * thread.c (init_set_fd): new helper function.
- * include/ruby/io.h (RB_WAITFD_IN, RB_WAITFD_PRI, RB_WAITFD_OUT):
- new constant for rb_single_wait_fd().
+Tue Jul 24 07:03:11 2012 Eric Hodel <drbrain@segment7.net>
- The patch was written by Eric Wong. [Ruby 1.9 - Feature #4531]
+ * string.c (rb_str_sub): Fixed wording of documentation to match the
+ replacement operation. Minor cleanup of markup. [Bug #6719]
+ * string.c (rb_str_sub_bang): Minor wording change for clarity, minor
+ cleanup of markup.
-Wed May 4 08:04:59 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+Mon Jul 23 23:58:40 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/psych/lib/psych/visitors/yaml_tree.rb: fix time dumping so that
- Syck can load UTC times that Psych dumps.
+ * enc/Makefile.in (TARGET_NAME, TARGET_ENTRY): needed for EXTDLDFLAGS
+ on some platforms. [ruby-core:46600] [Bug #6768]
-Wed May 4 07:33:00 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * enc/depend: no longer needs tweaking DLDFLAGS for TARGET names.
- * thread.c (rb_fd_copy): fix wrong argument.This issue was pointed
- out by Eric Wong. [ruby-core:35982]
+Mon Jul 23 22:48:19 2012 Tanaka Akira <akr@fsij.org>
-Tue May 3 20:29:33 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * lib/open-uri.rb: use respond_to? to test Tempfile.
+ [ruby-dev:45995] [Bug #6781] reported by hsbt (Hiroshi SHIBATA).
- * test/fileutils/test_fileutils.rb (TestFileUtils#test_chmod_symbol_mode):
- Skip sticky bit test if the platform is FreeBSD. It doesn't allow to
- change sticky bit if a target is regular file.
+Mon Jul 23 14:43:34 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue May 3 18:23:57 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+ * configure.in (LIBPATHENV): LIBPATH is used on AIX, but not
+ SHLIB_PATH which was carelessly copied from HP/UX. suggested by
+ Perry Smith at [ruby-core:46397]. [Bug #6728]
- * test/date/test_date.rb (TestDate#test_coerce):
- test for [ruby-core:35127].
+Mon Jul 23 01:55:08 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Tue May 3 04:27:53 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/uri/test_generic.rb (URI#test_find_proxy): add tests with
+ empty *_proxy env variables.
- * thread.c (rb_thread_select): preserve errno if no error
- occurred.
+Mon Jul 23 01:47:26 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Tue May 3 03:57:04 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/uri/test_generic.rb (URI#with_env): unset proxy related env
+ variables. [Bug #6774]
- * include/ruby/intern.h (rb_w32_fdcopy): add prototype. fixes
- #4640
+ * test/uri/test_generic.rb (URI#test_find_proxy): fix failures
+ when proxy related env variables already set. [Bug #6774]
-Mon May 2 01:02:04 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Sun Jul 22 23:58:48 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/fileutils.rb (FileUtils#chmod): accept symbolic mode argument.
- The patch was written by takkanm. [ruby-core:26029][Feature #2190]
+ * thread.c (rb_threadptr_execute_interrupts_common): increase
+ running_time_us on THREAD_TO_KILL like on THREAD_RUNNABLE.
+ This cause not to switch from a thread which is to be killed
+ on FreeBSD and Mac OS X. see also the test.
+ This issue maybe exist for long time but happens after r36430.
- * lib/fileutils.rb (FileUtils#fu_mode): new helper function.
- * lib/fileutils.rb (FileUtils#symbolic_modes_to_i): ditto.
- * lib/fileutils.rb (FileUtils#mode_mask): ditto.
- * lib/fileutils.rb (FileUtils#user_mask): ditto.
+Sat Jul 21 06:21:45 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * test/fileutils/test_fileutils.rb (TestFileUtils#test_chmod_symbol_mode):
- new test for the above symbolic mode.
- * test/fileutils/test_fileutils.rb (TestFileUtils#test_chmod_R): ditto.
+ * lib/net/http.rb: fixes for r36476. [Feature #6546]
+ http://u64.rubyci.org/~chkbuild/ruby-trunk/log/20120720T030101Z.diff.html.gz
-Mon May 2 00:36:12 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * lib/net/http.rb (Net::HTTP.newobj): return back for compatibility.
- * ext/socket/init.c (rsock_connect): add to care EINTR. based
- on a patch from Eric Wong at [ruby-core:35621][Bug #4555]
+ * lib/net/http.rb (Net::HTTP.new): set default_port if proxy port is
+ not given.
-Sun May 1 01:06:24 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * lib/net/http.rb (Net::HTTP#initialize): ditto.
- * thread.c (rb_thread_select): release GVL while waiting select().
+ * lib/net/http.rb (Net::HTTP#proxy?): return true or false.
-Sat Apr 30 23:10:15 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * lib/net/http.rb (Net::HTTP#proxy_address): check proxy_uri is not nil.
- * win32/win32.c (rb_w32_fdcopy): New. This can copy even though
- fdset size exceed FD_SETSIZE.
- * include/ruby/intern.h (rb_fd_copy): use rb_w32_fdcopy()
+ * lib/net/http.rb (Net::HTTP#proxy_port): ditto.
-Sat Apr 30 20:18:43 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Sat Jul 21 23:12:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * thread.c (do_select): Change argument type to rb_fdset_t.
- Now do_select() is free from unexpected hangup if
- HAVE_RB_FD_INIT=1 [Bug #4636]
+ * thread_pthread.c (ruby_init_stack): STACK_GROW_DIR_DETECTION is
+ necessary on platforms with unknown stack direction. [Bug #6761]
- * thread.c (rb_thread_fd_select, rb_thread_wait_fd_rw):
- adapt new argument type.
+Sat Jul 21 15:13:42 2012 Shota Fukumori <sorah@tubusu.net>
- * thread.c (rb_thread_select): make dummy implementation.
+ * lib/test/unit/testcase.rb (method_added): refactoring.
-Sat Apr 30 20:16:53 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Sat Jul 21 14:06:41 2012 Shota Fukumori <sorah@tubusu.net>
- * thread.c (rb_fd_copy): Change function argument. Now
- rb_fd_copy() has fully copy semantics.
- * include/ruby/intern.h: ditto.
+ * lib/test/unit/testcase.rb: warn when test_* method is redefined.
+ Patch by mame (Yusuke Endoh). [Feature #2643] [ruby-core:27790]
-Sat Apr 30 20:11:47 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/testunit/test_redefinition.rb: Test for above.
- * include/ruby/intern.h (rb_thread_select): mark as deprecated.
+ * test/testunit/test4test_redefinition.rb: Ditto.
- * ext/io/wait/wait.c (wait_readable): use rb_thread_fd_select
- instead of rb_thread_select.
- * ext/socket/init.c (wait_connectable0): ditto.
- * ext/readline/readline.c (readline_event): ditto.
- * io.c (rb_io_wait_readable, wait_readable, rb_io_wait_writable,
- wait_writable): ditto.
+Sat Jul 21 08:41:14 2012 Eric Hodel <drbrain@segment7.net>
-Sat Apr 30 20:06:36 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * lib/logger.rb: Updated example in Logger comment to match other
+ examples and fixed a bug. Patch by Marcus Stollsteimer.
+ [Bug #6759]
- * thread.c (do_select): remove useless ifdef. time calculation
- is not heavy weight.
+Fri Jul 20 17:20:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Apr 30 16:48:36 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * random.c (rb_random_real): refine error message.
- * benchmark/bm_io_select3.rb: New.
+Fri Jul 20 11:03:17 2012 Eric Hodel <drbrain@segment7.net>
-Sat Apr 30 16:27:09 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * NEWS: Updated net/http for automatic proxy detection (#6546) and
+ automatic gzip and deflate compression (#6492, #6494).
- * io.c (copy_stream_body, rb_io_s_copy_stream): move rb_fd_init()
- from copy_stream_body to rb_io_s_copy_stream. fds of passing
- rb_fd_term() have to be guaranteed initialized.
+Fri Jul 20 10:55:38 2012 Eric Hodel <drbrain@segment7.net>
-Sat Apr 30 16:13:17 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * lib/net/http.rb: Net::HTTP now automatically detects and uses
+ proxies from the environment. A proxy may also be specified as
+ before.
- * benchmark/bm_io_select.rb, benchmark/bm_io_select2.rb: New.
- based on a patch from Eric Wong at [Feature #4531]
+ Net::HTTP::Proxy still creates anonymous classes, but these classes
+ are only used to store configuration information. When an HTTP
+ instance is created the configuration is now copied.
-Sat Apr 30 03:25:53 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ Additionally, Net::HTTP::ProxyDelta is no longer used by Net::HTTP
- * test/io/wait/test_io_wait.rb: New. for testing ext/io/wait.
- the patch was written by Eric Wong. [Feature #4531]
+ [Feature #6546]
+ * lib/open-uri.rb: Moved URI::Generic#find_proxy to uri/generic.
+ * lib/uri/generic.rb: Imported find_proxy from open-uri.
+ * test/open-uri/test_open-uri.rb: Moved proxy-discovery tests to URI.
+ * test/uri/test_generic.rb: Imported proxy-discovery tests from
+ open-uri.
+ * test/net/http/test_http.rb: Added tests for proxy behavior.
-Sat Apr 30 00:34:56 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Fri Jul 20 09:34:11 2012 Eric Hodel <drbrain@segment7.net>
- * include/ruby/win32.h: remove redundant declaration of
- rb_w32_time_subtract().
+ * test/socket/test_socket.rb: Ignore IPv6 unique local addresses on OS
+ X (iCloud Back to my Mac addresses) for test_udp_socket since they do
+ not act as loopback addresses. [Bug #6692]
-Sat Apr 30 00:16:40 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Fri Jul 20 09:32:14 2012 Eric Hodel <drbrain@segment7.net>
- * thread_pthread.c (gvl_init): fix hangup if GVL_SIMPLE_LOCK=1.
- We don't have to call mutex_unlock() before initialize it!
+ * ext/socket/raddrinfo.c (addrinfo_ipv6_unique_local_p): Added
+ Addrinfo#ipv6_unique_local? to detect RFC 4193 unique local
+ addresses. Part of #6692
+ * ext/socket/rubysocket.h: Add IN6_IS_ADDR_UNIQUE_LOCAL macro if
+ missing.
+ * test/socket/test_addrinfo.rb: Test for ipv6_unique_local?
-Fri Apr 29 13:15:15 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Fri Jul 20 07:40:32 2012 Eric Hodel <drbrain@segment7.net>
- * thread_win32.c (native_cond_timedwait): New. r31373 caused
- win32 build failure.
+ * lib/net/http/response.rb: Automatically inflate gzip and
+ deflate-encoded response bodies. [Feature #6942]
+ * lib/net/http/generic_request.rb: Automatically accept gzip and
+ deflate content-encoding for requests. [Feature #6494]
+ * lib/net/http/request.rb: Updated documentation for #6494.
+ * lib/net/http.rb: Updated documentation for #6492 and #6494, removed
+ Content-Encoding handling now present in Net::HTTPResponse.
+ * test/net/http/test_httpresponse.rb: Tests for #6492
+ * test/net/http/test_http_request.rb: Tests for #6494
+ * test/open-uri/test_open-uri.rb (test_content_encoding): Updated test
+ for automatic content-encoding handling.
- * thread_win32.c (__cond_timedwait, abs_timespec_to_timeout_ms):
- New helper functions.
+Fri Jul 20 03:42:54 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * win32/win32.c (rb_w32_time_subtract): rename from subtract and
- remove static.
+ * thread_pthread.c: use #ifdef, not #if.
-Fri Apr 29 10:43:09 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Thu Jul 19 15:08:40 2012 Koichi Sasada <ko1@atdot.net>
- * benchmark/bm_vm4_pipe.rb: Add two new benchmark for GVL
- performance. They was written by Koichi Sasada.
- * benchmark/bm_vm4_thread_pass.rb: ditto.
+ * thread.c (rb_thread_s_control_interrupt,
+ rb_thread_s_check_interrupt): added for
+ Thread.control_interrupt and Thread.check_interrupt.
+ See details on rdoc.
+ I'll make an ticket for this feature.
-Fri Apr 29 10:25:31 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/ruby/test_thread.rb: add a test for Thread.control_interrupt.
- * vm_method.c (rb_clear_cache_by_class): Revert r29673. It made
- a segmentation fault regression. [Bug #4289][ruby-core:34554].
+ * thread.c (rb_threadptr_raise): make a new exception object
+ even if argc is 0.
-Fri Apr 29 10:24:51 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread.c (rb_thread_kill): kill thread immediately if target thread
+ is current thread.
- * io.c (make_writeconv): do not add textmode newline decorator if any
- newline decorator is set already. fixes #4618, fixes #4619
+ * vm_core.h (RUBY_VM_CHECK_INTS_BLOCKING): added.
+ CHECK_INTS while/after blocking operation.
-Fri Apr 29 10:17:42 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * vm_core.h (RUBY_VM_CHECK_INTS): require rb_thread_t ptr.
- * thread.c (lock_func): small cleanup.
+ * cont.c (fiber_switch): use replaced RUBY_VM_CHECK_INTS().
-Fri Apr 29 10:07:13 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * eval.c (ruby_cleanup): ditto.
- * thread.c (rb_mutex_lock, lock_func): Avoid busy loop and
- performance regression. bm_vm3_thread_mutex.rb performance
- change from 109.064sec to 16.331sec. [Feature #4607]
+ * insns.def: ditto.
- * thread.c (init_lock_timeout): New helper function.
+ * process.c (rb_waitpid): ditto.
-Thu Apr 28 16:15:49 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * vm_eval.c (vm_call0): ditto.
- * win32/{win32.c,dir.h} (rb_w32_uopendir): new API to pass UTF-8 path.
+ * vm_insnhelper.c (vm_call_method): ditto.
- * win32/win32.c (opendir_internal, rb_w32_opendir): extract and merge
- common part of rb_w32_opendir() and rb_w32_uopendir().
+Thu Jul 19 22:46:48 2012 Tanaka Akira <akr@fsij.org>
- * dir.c (do_opendir, glob_helper): encoding.
+ * test/ruby/test_io.rb: remove temporally files early.
- * dir.c (dir_initialize, do_opendir): convert path to UTF-8 and call
- rb_w32_uopendir() instead of rb_w32_opendir() on Windows.
- fixes #4491, reported by Joey Zhou.
+Thu Jul 19 15:38:35 2012 Shugo Maeda <shugo@ruby-lang.org>
-Thu Apr 28 15:32:53 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * variable.c (rb_mod_class_variables): return inherited variables
+ except when the optional argument is set to false.
+ [ruby-dev:44034] [Bug #4971]
- * test/dl/test_base.rb (DL::LIBC_SO): its always msvc*.dll on
- mswin/mingw.
+ * variable.c (rb_mod_constants): fix typo in documentation.
-Thu Apr 28 06:07:06 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Jul 19 14:30:43 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/csv.rb (CSV::open): suppress universal newline decorator.
- fixes #4603
+ * internal.h: move mark function declarations that should be private.
- * lib/csv.rb (CSV.read): no mode is needed.
+Thu Jul 19 14:18:22 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Thu Apr 28 06:06:56 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/socket/init.c (rsock_init_sock): need to update max fd on all
+ platforms.
- * io.c (rb_io_extract_modeenc, rb_f_backquote): set default text
- mode. fixes #4619
+Thu Jul 19 14:15:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (pipe_open): set universal newline decorator if needed.
+ * thread.c (rb_gc_mark_threads): remove deprecated function.
-Wed Apr 27 11:33:08 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Jul 19 13:28:03 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * enc/trans/emoji_iso2022_kddi.trans: ISO-2022-JP-KDDI doesn't have
- CP932 UDA. Another reason is emacs-mule: the implementation of
- stateless-iso-2022-jp doesn't support beyond 94x94 (0x7fxx);
- but CP932 UDA is in 7Fxx-92xx.
+ * test/net/http/test_http.rb (TestNetHTTPLocalBind#test_bind_to_local*):
+ re-enable the tests because now it's OK on windows.
-Wed Apr 27 07:42:44 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Jul 19 13:26:25 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * configure.in (STRIP): use proper toolchain. based on a patch
- from Jon Forums at [ruby-core:35909]. fixes #4617
+ * ext/socket/extconf.rb: now enable IPv6 by default on mswin.
-Wed Apr 27 01:20:59 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Thu Jul 19 09:33:46 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/date/date_core.c (date_zone_to_diff): renamed.
- * ext/date/date_parse.c: ditto.
- * ext/date/date_strptime.c: ditto.
+ * ext/psych/emitter.c (initialize): allow a configuration object to be
+ passed to the constructor so that mutation isn't required after
+ instantiation.
-Wed Apr 27 01:16:59 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/psych/lib/psych/handler.rb: add configuration object
- * encoding.c (enc_find): accept Encoding objects.
+ * ext/psych/lib/psych/visitors/emitter.rb: use configuration object if
+ extra configuration is present.
-Wed Apr 27 00:55:56 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Jul 19 08:20:25 2012 Tanaka Akira <akr@fsij.org>
- * transcode.c (econv_opts): add newline option.
+ * test/ruby/test_file.rb: remove temporally files early.
- * io.c (validate_enc_binmode, rb_io_extract_modeenc): set newline
- decorator according to open mode.
+Thu Jul 19 07:37:41 2012 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * transcode.c (rb_econv_prepare_options): new function, to prepare
- econv options with newline flags.
+ * test/drb/drbtest.rb: fixed: can't delete unix domain sockets problem.
- * include/ruby/encoding.h (ECONV_NEWLINE_DECORATOR_MASK): add.
+Thu Jul 19 03:41:20 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Wed Apr 27 00:51:01 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * bignum.c: Added #include <strings.h> for ffs(). Patch by Perry
+ Smith. Thank you. [Bug #6748]
- * file.c (rb_file_truncate): fix function.
+Thu Jul 19 01:56:02 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * include/ruby/win32.h (ftruncate, truncate, ftello, fseeko): non-64
- versions on mingw are useless because they use int32_t. fixes #4564
+ * include/ruby/intern.h (rb_num_zerodiv): Added NORETURN.
+ Patched by Xi Wang. [Bug #6736]
-Wed Apr 27 00:50:33 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Wed Jul 18 23:57:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/date/date_core.c: modified validation methods.
- * ext/date/lib/date.rb: ditto.
+ * pack.c (pack_pack): round down too long uuencode width. folding
+ width in uuencode format cannot be longer than 63 bytes.
-Wed Apr 27 00:00:37 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Wed Jul 18 23:04:18 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/date/date_core.c (dt_lite_set_tmx): should get df value.
+ * ext/dbm/dbm.c (fdbm_empty_p): fix wrong condition introduced in r36438.
-Tue Apr 26 22:34:04 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * ext/sdbm/init.c (fsdbm_empty_p): ditto.
- * ext/date/lib/date/format.rb (_iso8601): allowed day only civil
- date. disallowed separatorless day only ordinal date.
+Wed Jul 18 23:08:57 2012 Tanaka Akira <akr@fsij.org>
-Mon Apr 25 21:31:36 2011 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+ * test/ruby/test_beginendblock.rb: remove temporally files early.
- * ext/openssl/extconf.rb: Should check SSLv2_*method.
- openssl compiled with "no-ssl2" the extconf don't fail
- when running `make' having this compilation errors.
- Patched by Laurent Arnoud. fixes #4562, #4556
+Wed Jul 18 22:43:02 2012 Tanaka Akira <akr@fsij.org>
-Mon Apr 25 20:53:32 2011 Tajima, Akio <artonx@yahoo.co.jp>
+ * test/ruby/test_autoload.rb: remove temporally files early.
- * win32/win32.c (kill): accept 0 only sig is SIGINT #4596
+Wed Jul 18 21:59:46 2012 Tanaka Akira <akr@fsij.org>
-Mon Apr 25 19:59:47 2011 Tajima, Akio <artonx@yahoo.co.jp>
+ * test/ruby/test_argf.rb: use temporally directory.
- * win32/win32.c (kill): accept 0 as pid, fixes #4596
+Wed Jul 18 19:41:19 2012 Tanaka Akira <akr@fsij.org>
-Mon Apr 25 16:43:45 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/openssl/test_config.rb: remove temporally files early.
- * random.c (random_rand): remove unused variables.
+Wed Jul 18 17:45:26 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * struct.c (rb_struct_define_without_accessor): ditto.
+ * error.c (rb_builtin_type_name): map by index.
- * strftime.c (rb_strftime_with_timespec): ditto.
+Wed Jul 18 16:17:40 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * sprintf.c: ditto.
+ * lib/mkmf.rb (have_framework): get rid of separating -framework
+ option and its argument and dealing with the argument as a library
+ or an object name. if $LDFLAGS were an array...
- * time.c (time_asctime): remove useless GetTimeval().
+Wed Jul 18 16:09:10 2012 Shugo Maeda <shugo@ruby-lang.org>
- * thread_pthread.c: cast to (void *) for %p.
+ * ext/curses/extconf.rb: support PDCurses. patched by Luis Lavena.
+ [ruby-core:46485] [Feature #6735]
-Mon Apr 25 11:02:11 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Wed Jul 18 15:50:25 2012 Shugo Maeda <shugo@ruby-lang.org>
- * ext/ripper/lib/ripper/sexp.rb: fix rdoc around sexp.
- patched by Sho Hashimoto. fixes #4599
+ * parse.y (primary): allow an empty grouped expression as the
+ operand of the not operator (e.g., not ()).
+ [ruby-core:45976] [Bug #6674]
-Mon Apr 25 08:24:04 2011 Shota Fukumori <sorah@tubusu.net>
+ * parse.y (parser_yylex): show no warning for a grouped expression
+ as the operand of the not operator (e.g., not (a)) or as an
+ argument of a method call without parentheses (e.g., foo (a)).
+ [ruby-core:39050] [Bug #5214]
- * random.c (rb_f_rand, random_s_rand): RDocs for them.
+Wed Jul 18 15:33:21 2012 Koichi Sasada <ko1@atdot.net>
-Mon Apr 25 07:18:00 2011 Kenta Murata <mrkn@mrkn.jp>
+ * thread.c (rb_thread_call_without_gvl2): added.
+ it can skip last CHECK_INTS. See document for more details.
+ Document about it was updated a bit.
- * random.c (random_s_rand, Init_Random): Random.rand should behave as
- Random::DEFAULT.rand rather than Kernel#rand.
+ * include/ruby/thread.h (decl. of rb_thread_call_without_gvl2): added.
- * random.c (rand_range, random_rand): rand_range function extracted
- from random_rand function.
+ * thread.c (rb_thread_call_with_gvl): remove "EXPERIMENTAL!"
+ warning from a document.
- * random.c (rb_f_rand): accept a Range argument as Random#rand
- [ruby-dev:43427] #4605
+Wed Jul 18 14:53:21 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Apr 25 03:31:06 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * configure.in (EXTDLDFLAGS): split options for each extension
+ libraries, and unused in ruby.pc. [Bug #6734]
- * lib/time.rb: require 'date'.
- * ext/date/lib/date/format.rb: removed require line.
+ * lib/mkmf.rb (MakeMakefile#configuration): add EXTDLDFLAGS.
-Mon Apr 25 03:08:39 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Wed Jul 18 14:47:23 2012 Koichi Sasada <ko1@atdot.net>
- * ext/date/lib/date/format.rb: require 'date'.
+ * thread.c: fix last commit miss.
-Mon Apr 25 03:04:16 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Wed Jul 18 14:16:51 2012 Koichi Sasada <ko1@atdot.net>
- * ext/date/lib/date/format.rb (_iso8601): added a pattern.
+ * thread.c (rb_threadptr_async_errinfo_*): manage async errors queue.
+ Async events such as an exception throwed by Thread#raise,
+ Thread#kill and thread termination (after main thread termination)
+ will be queued to th->async_errinfo_queue.
+ - clear: clear the queue.
+ - enque: enque err object into queue.
+ - deque: deque err object from queue.
+ - active_p: return 1 if the queue should be checked.
+ rb_thread_t#thrown_errinfo was removed.
-Mon Apr 25 02:51:22 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * vm_core.h: add declarations of rb_threadptr_async_errinfo_*.
+ remove rb_thread_t#thrown_errinfo field and
+ add rb_thread_t#async_errinfo_queue (queue body: Array),
+ rb_thread_t#async_errinfo_queue_checked (flag),
+ rb_thread_t#async_errinfo_mask_stack(Array, not used yet).
- * ext/date/lib/date/format.rb: require 'date_core.so'.
- date/format needs methods which are now in date_core.so.
- This breaks make rdoc which uses Date._parse from time.rb.
+ * vm.c (rb_thread_mark): fix a mark function.
-Mon Apr 25 02:47:46 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * cont.c (rb_fiber_start): enque an error.
- * ext/date/lib/date/format.rb (_iso8601): fixed a bug of regex.
+ * process.c (after_fork): clear async errinfo queue.
-Mon Apr 25 02:12:26 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Wed Jul 18 14:25:55 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
- * ext/date/lib/date/format.rb: an adjustment of regex.
+ * pack.c: (ditto) bitwise operations are not char. Apply explicit
+ casts on them.
-Mon Apr 25 01:58:50 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Wed Jul 18 12:59:50 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
- * ext/date/lib/date/format.rb: omitted to call _parse.
+ * encoding.c (load_encoding): explicit cast to suppress warning.
+ Though the cast truncates some bits, from heuristic analysis I
+ believe it is OK to do so here.
-Mon Apr 25 01:03:03 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * bignum.c (rb_cstr_to_inum): ditto.
- * string.c (rb_to_id): remove unused variable.
+Wed Jul 18 12:55:54 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Apr 24 22:19:05 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * lib/benchmark.rb: Fix Benchmark.benchmark output with an empty
+ caption. patched by Benoit Daloze. [ruby-core:45719] [Bug #6610]
- * complex.c, rational.c: omitted some method calls.
+Wed Jul 18 10:00:54 2012 Eric Hodel <drbrain@segment7.net>
-Sun Apr 24 02:57:27 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * lib/debug.rb: Added toplevel documentation. Based on patch by Oscar
+ Del Ben. [Bug #6743], fixes #146 on github.
- * ext/date/date_parse.c (n2i): takes long.
+Wed Jul 18 09:33:59 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sun Apr 24 02:51:06 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * test/win32ole/test_win32ole_event.rb (TestWIN32OLE_EVENT): use
+ standard skip method to skip tests.
- * ext/date/date_parse.c: reverted.
+Wed Jul 18 09:26:45 2012 Eric Hodel <drbrain@segment7.net>
-Sun Apr 24 02:25:23 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/logger.rb: Updated typos and output to match modern Logger
+ output. Patch by Marcus Stollsteimer. [Bug #6738]
- * include/ruby/intern.h: pcc can't use __builtin_constant_p.
+Wed Jul 18 07:59:29 2012 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
- * vm_exec.c: change condition.
+ * lib/cgi/util.rb (CGI.escapeHTML,unescapeHTML): Add &apos; for HTML5
+ escaping.
+ [Feature #6620]
-Sun Apr 24 01:58:01 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Tue Jul 17 22:17:13 2012 Tanaka Akira <akr@fsij.org>
- * ext/date/date_core.c (leap_p): suppress warning: parentheses.
+ * lib/open-uri.rb: call io.close! for Tempfile.
- * ext/date/date_core.c (date_s__parse_internal): remove unused
- variable "str".
+Tue Jul 17 16:41:32 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/date/date_parse.c (parse_ddd_cb): use RSTRING_LENINT.
+ * proc.c (rb_proc_arity): return normal value (not -n-1) if it is not
+ a labmda, or it is a labmda and no arg_opts. [Bug #5694]
- * ext/date/date_strftime.c (date_strftime_with_tmx): remove unused
- variable.
+Tue Jul 17 03:56:34 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Sun Apr 24 00:34:23 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * ext/psych/lib/psych/visitors/to_ruby.rb: strings with YAML anchors
+ are properly referenced. Patched by Joe Rafaniello via Github:
+ https://github.com/tenderlove/psych/pull/69
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: ditto
+ * test/psych/test_alias_and_anchor.rb: test for change
- * ext/date/date_parse.c: removed some unused macros. use strchr()
- instead of index().
+Mon Jul 16 23:20:24 2012 Tanaka Akira <akr@fsij.org>
-Sat Apr 23 21:29:42 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * bignum.c (rb_integer_float_cmp): use FIXNUM_MIN and FIXNUM_MAX,
+ instead of LONG_MIN and LONG_MAX.
- * ext/date/date_core.c: replacement of implementation of
- _parse. [experimental]
- * ext/date/date_parse.c: new.
- * ext/date/lib/date/format.rb: removed ruby version of _parse.
+Mon Jul 16 22:50:41 2012 Tanaka Akira <akr@fsij.org>
-Fri Apr 22 12:04:15 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * numeric.c (flo_to_s): use the exponential form if the integer part
+ is longer than or equal DBL_DIG.
+ [ruby-dev:45960] [ruby-trunk - Bug #6741]
- * array.c (rb_ary_sort_bang): fix rdoc.
- patched by burningTyger. https://github.com/ruby/ruby/pull/11
+Mon Jul 16 22:01:00 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Fri Apr 22 11:49:49 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/readline/readline.c: fixed docs. [Bug #6740][ruby-core:46501]
+ patched by Nobuhiro IMAI.
- * lib/xmlrpc/create.rb (XMLRPC::Create#conv2value):
- XML-RPC's int is 32bit int, and Fixnum also may be beyond 32bit.
+Mon Jul 16 19:24:01 2012 Tanaka Akira <akr@fsij.org>
- * lib/xmlrpc/create.rb (XMLRPC::Create#conv2value):
- XML-RPC doesn't allow Infinity and NaN.
- http://www.xmlrpc.com/spec
+ * bignum.c (rb_integer_float_eq): new function.
+ (rb_big_eq): use rb_integer_float_eq.
-Fri Apr 22 04:16:14 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+ * internal.h (rb_integer_float_eq): declared.
- * ext/psych/parser.c (parse): strings from psych have proper taint
- markings.
+ * numeric.c (flo_eq): use rb_integer_float_eq.
+ (fix_equal): ditto.
- * test/psych/test_tainted.rb: test for string taint
+Mon Jul 16 19:02:31 2012 Tanaka Akira <akr@fsij.org>
-Thu Apr 21 01:30:02 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * bignum.c (rb_integer_float_cmp): rename a local variable.
- * random.c (rb_f_srand): fix rdoc: srand(0)'s 0 is a seed.
- [ruby-core:35833] fixes #4590
+Mon Jul 16 18:40:26 2012 Tanaka Akira <akr@fsij.org>
-Thu Apr 21 01:01:28 2011 Masaya Tarui <tarui@ruby-lang.org>
+ * bignum.c (rb_integer_float_cmp): renamed from rb_big_float_cmp.
- * win32/win32.c (CreateChild): maximum length of lpCommandLine is
- 32,768 characters, including the Unicode terminating null character.
+ * internal.h: follow the above change.
-Wed Apr 20 21:32:11 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * numeric.c: ditto.
- * ext/date/date_strptime.c (date__strptime_internal): do not
- overwrite local variables.
+Mon Jul 16 17:57:54 2012 Tanaka Akira <akr@fsij.org>
-Wed Apr 20 14:41:28 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * bignum.c (rb_big_float_cmp): compare an integer and float precisely.
+ [ruby-core:31376] [Bug #3589] reported by Tomasz Wegrzanowski.
- * string.c (rb_str_each_line): check string's length when compare
- separator and string. [ruby-core:35815] fixes #4586
+Mon Jul 16 17:29:45 2012 Tanaka Akira <akr@fsij.org>
-Wed Apr 20 00:02:13 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * bignum.c (rb_big_float_cmp): support fixnum for argument x.
- * misc/ruby-mode.el (ruby-parse-partial): use position of open paren.
+ * numeric.c (fix_equal): use rb_big_float_cmp.
+ (fix_cmp): ditto.
+ (fix_gt): ditto.
+ (fix_ge): ditto.
+ (fix_lt): ditto.
+ (fix_le): ditto.
+ (flo_eq): ditto.
+ (flo_cmp): use rb_big_float_cmp for fixnum argument.
+ (flo_gt): ditto.
+ (flo_ge): ditto.
+ (flo_lt): ditto.
+ (flo_le): ditto.
-Tue Apr 19 01:00:21 2011 Tajima Akio <artonx@yahoo.co.jp>
+Mon Jul 16 17:05:53 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * test/ruby/test_io.rb (TestIO#test_cross_thread_close_fd):
- skip cross thread pipe close if windows
+ * test/fileutils/test_fileutils.rb: add test for FileUtils#uptodate?
-Mon Apr 18 12:15:46 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Jul 16 16:56:12 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * test/ruby/test_range.rb (TestRange#test_step_ruby_core_35753):
- avoid float error. [ruby-core:35804]
+ * lib/fileutils.rb (FileUtils.uptodate?): remove useless parameter.
+ patched by Oscar Del Ben.[Bug #6708][ruby-core:46256]
-Sun Apr 17 00:20:14 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Mon Jul 16 15:37:56 2012 Tanaka Akira <akr@fsij.org>
- * ext/date/date_{core,strftime}.c: use struct tmx instead of vtm.
- * ext/date/date_tmx.h: new.
+ * bignum.c (rb_big_eq): use rb_big_float_cmp.
-Sat Apr 16 22:23:52 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Mon Jul 16 15:00:45 2012 Tanaka Akira <akr@fsij.org>
- * ext/date/date_strftime.c (date_strftime_wo_timespec): changed
- the way of validation of locale modifiers.
+ * internal.h (rb_big_float_cmp): declared.
-Sat Apr 16 21:55:12 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * bignum.c (rb_big_float_cmp): extracted from rb_big_cmp and big_op.
+ (rb_big_cmp): use rb_big_float_cmp.
+ (big_op): ditto.
- * ext/date/date_core.c: replacement of implementation of
- _strptime. [experimental]
- * ext/date/date_strptime.c: new.
- * ext/date/lib/date/format.rb: removed ruby version of _strptime.
+ * numeric.c (flo_cmp): use rb_big_float_cmp.
+ (flo_gt): ditto.
+ (flo_ge): ditto.
+ (flo_lt): ditto.
+ (flo_le): ditto.
-Sat Apr 16 10:18:30 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Mon Jul 16 14:14:21 2012 Tanaka Akira <akr@fsij.org>
- * vm.c (Init_VM): suppress warning: "OPT_BASIC_OPERATIONS" is not
- defined.
+ * bignum.c (enum big_op_t): new type.
+ (big_op): use enum big_op_t.
+ (big_gt): ditto.
+ (big_ge): ditto.
+ (big_lt): ditto.
+ (big_le): ditto.
-Fri Apr 15 23:41:18 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Sat Jul 14 18:18:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ruby.c (proc_options): suppress warning:
- "ALLOW_DEFAULT_SOURCE_ENCODING" is not defined.
+ * array.c (rb_get_values_at): fill with nil out of range.
+ [ruby-core:43678] [Bug #6203]
-Fri Apr 15 15:10:29 2011 Akinori MUSHA <knu@iDaemons.org>
+Sat Jul 14 17:17:55 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * lib/uri/generic.rb (#route_from_path): Fix a bug where
- URI('http://h/b/').route_to('http://h/b') wrongly returned './'
- (should be '../b'). [Bug #4476]
+ * cont.c (cont_restore_0): improve docs. [Bug #6706][ruby-core:46243]
+ patched by Oscar Del Ben via https://github.com/ruby/ruby/pull/140
-Fri Apr 15 14:58:06 2011 Akinori MUSHA <knu@iDaemons.org>
+Sat Jul 14 17:08:13 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/fileutils.rb (FileUtils#touch): Fix corrupted output when
- mtime is specified in addition to nocreate (and verbose).
- ref [ruby-dev:43401]
+ * hash.c (rb_hash_s_create): raise an exception, when input elements
+ are not one or two elements arrays. [ruby-core:39945] [Bug #5406]
-Thu Apr 14 23:43:43 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat Jul 14 16:16:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * numeric.c (ruby_float_step): wrong loop condition.
- fixes [ruby-core:35753], reported by Joey Zhou.
+ * lib/test/unit.rb (Test::Unit::Runner#_run_parallel): use
+ Array#uniq!.
- * test/ruby/test_range.rb (TestRange#test_step_ruby_core_35753):
- test above change.
+ * lib/test/unit.rb (Test::Unit::Runner#deal): deal tasks to workers.
-Thu Apr 14 22:48:12 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/test/unit.rb (Test::Unit::Runner#quit_workers): close and kill
+ all workers.
- * lib/test/unit.rb (Test::Unit::Options#setup_options): set possible
- values for completion. no conversion is needed.
+ * lib/test/unit.rb (Test::Unit::Runner#delete_worker): delete dead
+ worker from working set.
- * lib/test/unit.rb (Test::Unit::Runner::Worker#initialize): use
- positional arguments instead of keyword arguments.
+ * lib/test/unit.rb (Test::Unit::Runner#launch_worker): add new worker
+ to working set.
- * lib/test/unit.rb (Test::Unit::Runner#jobs_status): io/console may
- not be available. use 80 as the last resort if IO#winsize and
- COLUMNS are unavailable.
+ * lib/test/unit.rb (Test::Unit::Runner#launch_worker): extract.
- * lib/test/unit.rb (Test::Unit::Runner::Worker#died): rename using a
- verb.
+ * lib/test/unit.rb (Test::Unit::Runner#start_watchdog): extract.
- * lib/test/unit.rb (Test::Unit::Runner#_run_parallel): check if worker
- is signaled and use its exit status.
+ * lib/test/unit.rb (Test::Unit::Runner#_run_parallel): move
+ initializations with nothing to release outside begin/ensure.
- * lib/test/unit.rb (Test::Unit::Runner::Worker#dead): no longer @in
- and @out are separated.
+Sat Jul 14 16:04:24 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Apr 14 21:23:29 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * array.c (rb_ary_join): should not infected by separator if it is not
+ used. [ruby-core:42161][Bug #5902]
- * variable.c (rb_autoload_p): search superclasses as same as actual
- loading. fixes [ruby-core:35679]
+Sat Jul 14 02:31:55 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Apr 14 21:21:06 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * include/ruby/intern.h (rb_thread_blocking_region): fix declarations
+ prototypes without arguments in C++ have different meanings than C.
- * include/ruby/win32.h (frexp, modf): wrongly declared as pure in
- mingw math.h.
+Thu Jul 12 12:32:26 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * include/ruby/win32.h (ftruncate, truncate): mingw64 misses
- prototypes.
+ * test/runner.rb: skip default gems to get rid of loading old versions
+ before installation.
- * win32/win32.c (rb_w32_read): suppress warning.
+Thu Jul 12 11:44:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Apr 14 19:55:54 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * string.c (rb_str_new_frozen): since the result object should have
+ same tainted/untrusted bits with the original object, return new
+ object if the shared object unmatch. [ruby-core:39745][Bug #5374]
- * lib/fileutils.rb (FileUtils#touch): fix corrupted output when
- FileUtils.touch(:nocreate => true, :verbose => true) case.
- The patch was written by Hiroyuki Iwatsuki. [ruby-dev:43401]
+Thu Jul 12 10:46:39 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Thu Apr 14 16:01:45 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * test/net/http/test_http.rb (TestNetHTTPLocalBind#test_bind_to_local*):
+ cannot cross between network interfaces on Windows, so skip this test
+ until we find better test.
- * io.c (rb_f_syscall): suppress warning: "HAVE___SYSCALL" is not
- defined.
+Thu Jul 12 08:48:33 2012 Ryan Davis <ryand-ruby@zenspider.com>
-Thu Apr 14 00:41:09 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+ * lib/minitest/*: Imported minitest 3.2.0 (r7598)
+ * test/minitest/*: ditto
- * thread.c (thread_fd_close_i): IOError exception should be assigned
- to rb_thread_t::thrown_errinfo.
+Thu Jul 12 05:11:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Apr 13 20:12:26 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * insns.def (defined): use method entry and id in cfp for proper
+ superclass, since klass in iseq is shared by dynamically defined
+ methods from the same block. [ruby-core:45831][Bug #6644]
- * io.c (rb_io_fdatasync): remove unused variable.
+Thu Jul 12 01:49:07 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Apr 12 20:54:12 2011 Tanaka Akira <akr@fsij.org>
+ * lib/net/http.rb (Net::HTTP#connect): use local_host and local_port
+ if specified. patched by Ricardo Amorim [Feature #6617]
- * include/ruby/st.h: parenthesize macro arguments.
+Wed Jul 11 17:36:39 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Apr 12 19:19:50 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/extmk.rb: append ENCOBJS to DLDOBJS but not EXTSOLIBS which is
+ not a target, to compile enc/encinit.c.
- * lib/uri/common.rb: avoid race condition. fixes #4572
+Wed Jul 11 12:38:20 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Apr 12 18:07:13 2011 TAKAO Kouji <kouji@takao7.net>
+ * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_mul): nonstatic initializer
+ of an aggregate type is a C99ism.
- * ext/readline/extconf.rb: --disable-libedit to disable
- libedit. fixes #4550
+ * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_mul): get rid of VC++
+ warnings.
-Tue Apr 12 10:37:39 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Jul 9 16:11:30 2012 Yuki Yugui Sonoda <yugui@google.com>
- * include/ruby/win32.h: VC doesn't have ftruncate() and others, but
- ruby needs HAVE_ macros to use our emulation functions.
- (fix the problem of 31262)
+ * vm_eval.c (rb_eval_string_from_file,
+ rb_eval_string_from_file_protect): new functions to replace
+ rb_compile_main_from_string() and ruby_eval_main().
-Tue Apr 12 01:33:00 2011 Luis Lavena <luislavena@gmail.com>
+ * nacl/pepper_ruby.c: Follows the change in vm_eval.c
- * configure.in: properly evaluate existence of truncate, ftruncate
- and ftello for MinGW. [ruby-core:35678]
- * win32/win32.c: rename truncate, ftruncate and ftello to avoid
- redefinitions.
- * win32/win32.h: ditto.
+Mon Jul 9 14:05:42 2012 Yuki Yugui Sonoda <yugui@google.com>
-Mon Apr 11 21:51:52 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ Reverts a half of r36079. As we discussed on ruby-dev@ and IRC,
+ we do not need to disclose intermediate representation of program.
+ The program embedding CRuby should use rb_eval_string family.
+ * include/ruby/ruby.h (ruby_opaque_t): removed.
+ (ruby_compile_main_from_file, ruby_compile_main_from_string,
+ ruby_eval_main): removed.
- * io.c: revert r31230. Because it made a regression.
- [ruby-core:35631]
+ * eval.c (ruby_eval_main_internal): became ruby_exec_internal() again.
+ (ruby_eval_main): removed.
-Mon Apr 11 21:49:18 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * ruby.c (PREPARE_PARSE_MAIN) reverted.
+ (parse_and_compile_main, ruby_compile_main_from_file,
+ ruby_compile_main_from_string): removed
- * test/ruby/test_io.rb: Added TestIO#test_cross_thread_close_stdio
- and TestIO#test_cross_thread_close_fd.
- The patch was written by Eric Wong. [ruby-core:35669]
+Wed Jul 11 10:16:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Apr 11 21:15:54 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * include/ruby.h (HAVE_RUBY_THREAD_H): to show ruby/thread.h to be
+ available. fixup of r36355.
- * file.c (rb_group_member): kill 256K of stack usage.
- the patch was written by Eric Wong. [ruby-core:35699]
+Wed Jul 11 03:26:47 2012 Eric Hodel <drbrain@segment7.net>
-Mon Apr 11 07:24:13 2011 Eric Hodel <drbrain@segment7.net>
+ * ext/zlib/zlib.c: Added streaming support to inflate processing.
+ This allows zlib streams to be processed without huge memory growth.
+ [Feature #6612]
+ * NEWS: ditto
+ * ext/zlib/zlib.c (zstream_expand_buffer): Uses rb_yield when a block
+ is given for streaming support. Refactored to use
+ zstream_expand_buffer_into to remove duplicate code.
+ * ext/zlib/zlib.c (zstream_expand_buffer_protect): Added wrapper
+ function to pass jump state back through GVL-free section to allow
+ zstream clean-up before terminating the ruby call.
+ * ext/zlib/zlib.c (zstream_expand_buffer_without_gvl): Acquire GVL to
+ yield processed chunk of output stream.
+ * ext/zlib/zlib.c (zstream_detach_buffer): When a block is given,
+ returns Qnil mid-stream and yields the output buffer at the end of
+ the stream.
+ * test/zlib/test_zlib.rb: Updated tests
- * ext/openssl/ossl.c: Fix typo, document version constants.
+Tue Jul 10 22:57:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Apr 10 22:23:45 2011 Tanaka Akira <akr@fsij.org>
+ * include/ruby/thread.h: new header file for thread stuff.
- * include/ruby/ruby.h: parenthesize macro arguments.
+ * thread.c (rb_thread_call_without_gvl): export. [Feature#4328]
+ returns void* instead of VALUE. [Feature #5543]
-Sat Apr 9 23:31:47 2011 Shota Fukumori <sorah@tubusu.net>
+ * thread.c (rb_thread_blocking_region): deprecate. [ruby-core:46295]
- * ext/stringio/stringio.c (strio_each, strio_readlines):
- Use `NUM2LONG` instead of `FIX2INT`. Fixes [ruby-dev:43395].
+Tue Jul 10 10:48:59 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Apr 9 23:22:27 2011 Shota Fukumori <sorah@tubusu.net>
+ * include/ruby/win32.h (NT, NtInitialize): removed unused old macros.
- * ext/stringio/stringio.c (strio_each):
- Fix exception message and don't raise immediately if block is not
- given.
- Fixes [ruby-dev:43394].
+Tue Jul 10 10:43:37 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/stringio/test_stringio.rb (test_each_line_limit_0):
- Fix test for above.
+ * configure.in: removed --enable/disable-win95 options. (see r36342)
-Sat Apr 9 21:54:15 2011 Shota Fukumori <sorah@tubusu.net>
+Tue Jul 10 00:44:41 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/stringio/stringio.c (strio_each, strio_readlines):
- limit must not be zero. Fixes [ruby-dev:43392].
+ * include/ruby/ruby.h: Removed RUBY_GLOBAL_SETUP completely. It is
+ no meaning definition since r24894.
+ * main.c: ditto.
+ * nacl/pepper_main.c: ditto.
- * test/stringio/test_stringio.rb: Add tests for above.
+Mon Jul 9 23:59:36 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sat Apr 9 18:01:36 2011 Tanaka Akira <akr@fsij.org>
+ * dln.c: Simplify and make consistent an ifdef for Mac OS X.
+ * ext/socket/rubysocket.h: ditto.
+ * ext/tk/stubs.c: ditto.
+ * io.c: ditto.
+ * process.c: ditto.
+ * signal.c: ditto.
+ * vm_dump.c: ditto.
- * include/ruby/util.h: parenthesize macro arguments.
+Mon Jul 9 17:37:35 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Apr 8 16:01:56 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * win32/win32.c (win95_stat): removed unnecessary macro.
- * ext/stringio/stringio.c (strio_getline): check whether str is
- a string when str and lim are given.
- https://twitter.com/watson1978/status/56225052152168449
+Mon Jul 9 17:22:16 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Thu Apr 7 20:03:52 2011 Tanaka Akira <akr@fsij.org>
+ * win32/configure.bat, win32/setup.mak, win32/Makefile.sub: omitted
+ Win9x support. removed --enable/disable-win95 options.
- * include/ruby/io.h: parenthesize macro arguments.
+ * include/ruby/win32.h, file.c, win32/win32.c: ditto.
-Wed Apr 6 21:08:31 2011 Tanaka Akira <akr@fsij.org>
+ * win32/README.win32: ditto.
- * include/ruby/intern.h: parenthesize macro arguments.
+Mon Jul 9 13:28:34 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Apr 6 15:12:40 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * configure.in (DLDFLAGS): use TARGET_ENTRY to specify an entry point
+ instead of TARGET which may contain non-identifier characters.
- * ext/openssl/ossl_pkey_dh.c (ossl_dh_initialize):
- pop pushed error after each try of reading. fixes #4550
+ * lib/mkmf.rb (create_makefile): add TARGET_NAME which is the first
+ part consists of only word characters. [ruby-core:46248][Bug #6709]
- * ext/openssl/ossl_pkey_dsa.c (ossl_dsa_initialize): ditto.
+Sun Jul 8 07:36:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_pkey_ec.c (ossl_ec_initialize): ditto.
+ * parse.y (shadowing_lvar_gen, warn_unused_var): no warnings for
+ variables starting with _. [ruby-core:46160][Feature #6693]
-Wed Apr 6 11:36:44 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Sat Jul 7 23:07:30 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * ext/openssl/ossl_pkey_rsa.c (ossl_rsa_initialize):
- pop pushed error after each try of reading. fixes #4550
+ * test/csv/test_features.rb: add require for Tempfile.
+ * test/csv/test_serialization.rb: ditto.
-Tue Apr 5 20:33:43 2011 Tanaka Akira <akr@fsij.org>
+Fri Jul 6 06:49:50 2012 Eric Hodel <drbrain@segment7.net>
- * include/ruby/encoding.h: parenthesize macro arguments.
+ * array.c (rb_ary_aref): Added a description of the behavior of
+ index positioning. [Bug #6680]
+ * array.c (rb_ary_aset): ditto. Reordered sentences for clarity.
+ * string.c (rb_str_aref_m): Added a description of the behavior of
+ index positioning
-Mon Apr 4 22:02:16 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Fri Jul 6 05:38:44 2012 Eric Hodel <drbrain@segment7.net>
- * ext/io/nonblock/nonblock.c (io_nonblock_set): Avoid F_SETFL if
- we're not changing the O_NONBLOCK bit. F_SETFL is an expensive
- operation since it needs to affect all processes with the same
- file object.
- The patch is written by Eric Wong. [ruby-core:35556]
+ * string.c (rb_str_bytesize): Improve documentation. Patch by Oscar
+ Del Ben from github issue #138.
+ * string.c (rb_str_empty): ditto.
+ * string.c (rb_str_times): ditto.
+ * string.c (rb_str_dump): ditto.
+ * string.c (rb_str_center): ditto.
-Mon Apr 4 21:41:26 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Fri Jul 6 04:05:59 2012 Eric Hodel <drbrain@segment7.net>
- * io.c (rb_io_syswrite): While local FS writes are usually
- buffered, the buffers can be full or the file opened with
- O_SYNC. IO#syswrite can also be used on blocking IOs
- (pipe/socket) just like IO#write.
- The patch is written by Eric Wong. [ruby-core:35554]
+ * ext/zlib/zlib.c (zstream_expand_buffer_without_gvl): Use
+ ruby_xrealloc() to avoid crash with CALC_EXACT_MALLOC_SIZE.
-Mon Apr 4 11:50:40 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Jul 5 17:32:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/test_tempfile.rb: simply ignore platform dependent testcases
- instead of skipping.
+ * internal.h: move ThreadShield declarations from intern.h.
-Sun Apr 3 22:52:22 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+Thu Jul 5 16:00:24 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/syslog/syslog.c: improve rdoc.
- a patch by Jonas Pfenniger. [ruby-core:35592] fixes #4545
+ * thread.c (ThreadShield): rename from Barrier.
-Sun Apr 3 22:10:09 2011 Tanaka Akira <akr@fsij.org>
+Thu Jul 5 15:14:50 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/zlib/zlib.c: parenthesize macro arguments.
+ * bootstraptest/runner.rb (show_progress): refine error output. do not
+ count non-empty error message, but just warn.
-Sun Apr 3 21:33:58 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * bootstraptest/runner.rb (error): show errors immediately if tty.
- * configure.in: disable fdatasync again on Mac OS X.
- [ruby-core:35493][Bug #4500]
+Thu Jul 5 12:28:11 2012 Akinori MUSHA <knu@iDaemons.org>
-Sun Apr 3 21:16:20 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/net/http/test_httpresponses.rb: Add a test file for
+ Net::HTTPResponses and put a test case for the previous bug.
- * io.c (io_reopen): IO#close releases GVL if possible.
- close() may block for certain file types (NFS, SO_LINGER
- sockets, inotify), so let other threads run. The patch was
- created by Eric Wong [ruby-core:35555][Bug #4527]
+Thu Jul 5 06:33:52 2012 Mark Dodwell <mark@mkdynamic.co.uk>
- * io.c (fptr_finalize): ditto.
+ * lib/net/http/responses.rb: Fix 4xx classes to inherit correctly
+ from Net::HTTPClientError. [Bug #6700]
- * io.c (maygvl_fclose): new.
- * io.c (nogvl_fclose): ditto.
- * io.c (maygvl_close): ditto.
- * io.c (nogvl_close): ditto.
+Wed Jul 4 21:55:35 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Apr 1 22:25:50 2011 Tanaka Akira <akr@fsij.org>
+ * ruby.c (proc_options): warn only if -K and -w option is specified.
+ see also r36274 [Feature #5206]
- * ext/syslog/syslog.c: parenthesize macro arguments.
+Wed Jul 4 21:41:44 2012 Naohisa Goto <ngotogenome@gmail.com>
-Fri Apr 1 18:53:06 2011 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * gc.c, atomic.h (ATOMIC_SIZE_*): moved from gc.c to atomic.h
+ [ruby-dev:45909]
- * lib/webrick/cookie.rb (WEBrick::Cookie.parse): 'white space is
- permitted between tokens' according to RFC2965. Though 'Netscape
- spec' does not define the syntax clearly, make it tolerant as a
- server. As a real-world example, rest-client gem sends
- 'Cookie: foo=1;bar=2'
+Wed Jul 4 19:13:15 2012 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * test/webrick/test_cookie.rb (test_parse_non_whitespace): test it.
+ * test/win32ole/test_win32ole.rb (test_s_codepage_changed):
+ FileSystemObject only supports ANSI or UTF-16LE encoding.
+ Patch by h.shirosaki (Hiroshi Shirosaki) [ruby-trunk - Bug #6650]
-Fri Apr 1 13:19:20 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jul 4 11:52:12 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * vm_core.h (RUBY_VM_CHECK_INTS_TH): merge a patch by ko1
- in [ruby-dev:43373].
+ * gc.c (ATOMIC_SIZE_*): 64bit Windows support.
-Thu Mar 31 23:15:46 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jul 4 11:11:28 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * misc/ruby-mode.el (ruby-brace-to-do-end, ruby-do-end-to-brace):
- adjust space between block beginning and block arguments
+ * eval.c (rb_frame_callee, rb_f_callee_name): fix to return the
+ called id. this longstanding bug has been caused and blocked by
+ the structure of old rb_control_frame_t and rb_iseq_t.
-Thu Mar 31 20:42:05 2011 Tanaka Akira <akr@fsij.org>
+ * vm_insnhelper.c (vm_push_frame): set proper method entry.
- * ext/strscan/strscan.c: parenthesize macro arguments.
+Wed Jul 4 08:29:31 2012 Eric Hodel <drbrain@segment7.net>
-Thu Mar 31 18:06:12 2011 Shugo Maeda <shugo@ruby-lang.org>
+ * array.c (rb_ary_aref): Updated documentation to indicate the
+ starting index is an index into the array or string. Updated
+ examples to show behavior of indexes at the end of an array or
+ string. Based on patch by Marcus Stollsteimer. [Bug #6680]
+ * array.c (rb_ary_aset): ditto.
+ * string.c (rb_str_aref): ditto. Also added descriptive argument
+ names to call-seq section.
- * vm_insnhelper.c (vm_get_ev_const): should ignore crefs with
- the NODE_FL_CREF_PUSHED_BY_EVAL flag.
+Wed Jul 4 07:05:59 2012 Eric Hodel <drbrain@segment7.net>
-Thu Mar 31 16:49:56 2011 Shugo Maeda <shugo@ruby-lang.org>
+ * test/zlib/test_zlib.rb (test_inflate_partial_input): Added test for
+ inflating incomplete zlib streams.
- * vm_insnhelper.c (vm_get_ev_const): search root cref properly.
- [ruby-dev:43365]
+Tue Jul 3 23:14:16 2012 Naohisa Goto <ngotogenome@gmail.com>
-Thu Mar 31 14:50:25 2011 Shugo Maeda <shugo@ruby-lang.org>
+ * gc.c (ATOMIC_SIZE_EXCHANGE): fix function name on Solaris [Bug #6689]
+ [ruby-dev:45904]
- * eval.c (rb_mod_s_constants): should ignore crefs with
- the NODE_FL_CREF_PUSHED_BY_EVAL flag.
+Tue Jul 3 16:07:49 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Mar 30 22:55:47 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (vm_malloc_fixup, vm_xrealloc, vm_xfree, after_gc_sweep): use
+ atomic operations to update malloc_params.
- * misc/ruby-mode.el (ruby-toggle-block): toggle do/end and {}.
+Tue Jul 3 14:50:16 2012 Eric Hodel <drbrain@segment7.net>
- * misc/ruby-mode.el (ruby-move-to-block): move to opening of
- block.
+ * ext/zlib/zlib.c (zstream_run_func): Don't exit run loop for buffer
+ error. [Feature #6615]
+ * ext/zlib/zlib.c: Fix style to match existing functions.
-Wed Mar 30 14:35:15 2011 Shugo Maeda <shugo@ruby-lang.org>
+Tue Jul 3 12:05:51 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * vm_insnhelper.h (COPY_CREF): should copy
- the NODE_FL_CREF_PUSHED_BY_EVAL flag to hide constants from
- methods defined by class_eval. [ruby-dev:43365]
+ * ext/dl/cfunc.c (rb_dlcfunc_call): also needed the workaround for VC8
+ for x64. [ruby-dev:45875] [Bug #6676]
+ reported by aves_ramphastos (Seigo Ishigane)
-Wed Mar 30 00:24:53 2011 Tanaka Akira <akr@fsij.org>
+Tue Jul 3 11:56:46 2012 Eric Hodel <drbrain@segment7.net>
- * ext/stringio/stringio.c: parenthesize macro arguments.
+ * ext/zlib/zlib.c (zstream_detach_buffer): Refactored tainting of
+ output string, moving it from the callee to zstream_detach_buffer.
+ * ext/zlib/zlib.c (rb_zstream_finish): ditto
+ * ext/zlib/zlib.c (rb_zstream_flush_next_out): ditto
+ * ext/zlib/zlib.c (rb_deflate_deflate): ditto
+ * ext/zlib/zlib.c (rb_deflate_flush): ditto
+ * ext/zlib/zlib.c (rb_inflate_inflate): ditto
-Tue Mar 29 21:51:31 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+Tue Jul 3 11:16:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * object.c (rb_String): Kernel#String should call to_str before to_s.
+ * common.mk (runnable): make symbolic links to run in build directory.
-Tue Mar 29 10:28:08 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Jul 3 10:46:06 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * test/webrick/test_filehandler.rb
- (WEBrick::TestFileHandler#test_short_filename): the cgi doesn't exist
- on current directory.
+ * ruby.c (proc_options): warn if -K option is specified. [Feature #5206]
-Tue Mar 29 05:19:57 2011 Tanaka Akira <akr@fsij.org>
+Tue Jul 3 06:12:13 2012 Eric Hodel <drbrain@segment7.net>
- * ext/socket/raddrinfo.c: parenthesize macro arguments.
+ * object.c (Init_Object): Added RDoc location pointers for
+ Kernel#methods, Kernel#protected_methods, Kernel#private_methods and
+ Kernel#public_methods. [Bug #6666]
-Tue Mar 29 00:03:51 2011 Tajima Akio <artonx@yahoo.co.jp>
+Tue Jul 3 06:02:54 2012 Eric Hodel <drbrain@segment7.net>
- * test/webrick/test_filehandler.rb (test_short_filename):
- read real short filename by cmd because smb mounted files
- have different naming convention.
+ * ext/zlib/zlib.c (zstream_run): Process zlib streams without GVL.
+ [Feature #6615]
+ * NEWS: ditto.
-Mon Mar 28 11:38:08 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Jul 2 22:13:04 2012 Tanaka Akira <akr@fsij.org>
- * ext/date/date_core.c (date_s_today): use int for year.
+ * thread.c (rb_thread_aref): add explanation for why Thread#[] and
+ Thread#[]= are fiber-local and not thread-local.
+ reported by Julien A. [ruby-core:41606] [ruby-trunk - Bug #5750]
- * ext/date/date_core.c (datetime_s_now): ditto.
+Mon Jul 2 21:25:55 2012 Tanaka Akira <akr@fsij.org>
-Mon Mar 28 11:07:41 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * time.c (timew_out_of_timet_range): specialization for
+ SIZEOF_TIME_T == SIZEOF_INT64_T.
- * ext/extmk.rb: set MFLAGS from MAKEFLAGS when using nmake.
+Mon Jul 2 17:06:32 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Mar 28 11:07:00 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * class.c (rb_include_module): include modules after the origin.
- * common.mk (love): all you need is love.
+ * class.c (include_modules_at): skip prepended modules.
-Sun Mar 27 23:16:31 2011 Tanaka Akira <akr@fsij.org>
+ * class.c (rb_prepend_module): now basic.klass in ICLASS refers the
+ old original class/module. [ruby-dev:45868][Bug #6662]
- * ext/socket/ipsocket.c: parenthesize macro arguments.
+ * class.c (rb_mod_ancestors): ditto.
-Sun Mar 27 16:55:34 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_method.c (search_method): search method entry from the origin
+ iclass.
- * misc/ruby-mode.el (ruby-mode-map): remove unnecessary
- binding. fixes
- http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468952
+Mon Jul 2 05:54:58 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * misc/ruby-mode.el: suppress warnings at byte compile. fixes
- http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=502926
+ * ext/date/date_core.c: [ruby-core:46058].
-Sun Mar 27 11:18:35 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Mon Jul 2 05:35:43 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * ext/date/date_core.c: removed unused variables.
+ * ext/date/date_core.c (d_lite_marshal_load): accepts old dump.
-Sat Mar 26 15:16:09 2011 Tanaka Akira <akr@fsij.org>
+Mon Jul 2 03:21:53 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * ext/socket/getaddrinfo.c: parenthesize macro arguments.
+ * README.EXT.ja: fixed args of have_struct_member() ,
+ create_makefile() same as r35977. however, mkmf.rb include
+ no Japanese-docs, so Appendix C was not removed. [Bug #6597]
-Sat Mar 26 05:27:34 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Fri Jun 29 05:08:41 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/date/lib/date/format.rb (DateTime#strftime): removed because
- date_core defines it.
+ * lib/test/unit/parallel.rb: workaround fix for rubygems.
+ RubyGems can't find rake if the source directory is not equal to
+ the directory which is running the test. [Bug #6604]
-Fri Mar 25 21:59:45 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Thu Jun 28 20:33:15 2012 Luis Lavena <luislavena@gmail.com>
- * ext/date/date_core.c: should not force cast with macros.
+ * test/win32ole/test_win32ole.rb (test_s_codepage_changed):
+ FileSystemObject only supports ANSI or UTF-16LE encoding.
+ Patch by bosko (Bosko Ivanisevic) [ruby-trunk - Bug #6650]
-Fri Mar 25 21:56:10 2011 Tanaka Akira <akr@fsij.org>
+Thu Jun 28 09:27:09 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * ext/sdbm/init.c: parenthesize macro arguments.
+ * class.c (class_instance_method_list): consider prepended Class/Module
+ when recur != 0. [ruby-dev:45863] [Bug #6660]
-Fri Mar 25 19:39:40 2011 Ben Walton <bwalton@artsci.utoronto.ca>
+ * test/ruby/test_module.rb (test_prepend_instance_methods_false): add
+ a test for it.
- * test/test_syslog.rb:
- Skip syslog tests that rely on LOG_PERROR unless it's defined
- Instead of checking looking at the platform to determine if the tests
- relying on LOG_PERROR should be run, look for the definition of the
- constant as this will be robust against all platforms as long as the
- underlying syslog.c code sets it up correctly.
+Thu Jun 28 06:12:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- This specifically addresses failures on Solaris 9.
+ * class.c (rb_mod_ancestors): fix ancestors order.
+ [ruby-core:45919][Bug #6658] [ruby-dev:45861][Bug #6659]
- Use LOG_PID instead of LOG_PERROR in Syslog.open test
+Wed Jun 27 21:28:59 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- LOG_PERROR isn't a POSIX option for syslog, so it fails on platforms
- that don't define it. Solaris 9 and 10 are examples of this.
+ * lib/racc/parser.rb: NotImplementError is not exist.
- Use LOG_PID instead.
+ * lib/irb/output-method.rb (IRB::OutputMethod#print): ditto.
-Fri Mar 25 15:42:17 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Wed Jun 27 21:31:13 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/sdbm/_sdbm.c (sdbm_open): use size_t.
+ * class.c (rb_prepend_module): ancestors of prepending module also
+ should be included. [ruby-core:45914][Bug #6654]
- * ext/syck/bytecode.c: ditto.
+Wed Jun 27 21:01:32 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/sdbm/_sdbm.c (delpair): use ptrdiff_t.
+ * class.c (class_instance_method_list): m_tbl in prepended
+ class/module is NULL. [ruby-core:45915][Bug #6655]
- * ext/sdbm/init.c: use RSTRING_LENINT.
+Wed Jun 27 16:48:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/dl/handle.c: suppress warning: shorten-64-to-32.
+ * class.c (rb_prepend_module): prepend module into another module.
- * ext/strscan/strscan.c: ditto.
+ * eval.c (rb_mod_prepend): new method Module#prepend. [Feature #1102]
- * ext/syck/emitter.c: ditto.
+Wed Jun 27 09:15:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/syck/implicit.c: ditto.
+ * io.c (is_popen_fork): check if fork and raise NotImplementedError if
+ unavailable.
- * ext/syck/syck.c: ditto.
+ * io.c (rb_io_s_popen): allow environment variables hash and exec
+ options as flat parameters, not in an array arguments.
+ [Feature#6651] [EXPERIMENTAL]
- * ext/syck/token.c: ditto.
+ * process.c (rb_execarg_extract_options): extract exec options, but no
+ exceptions on non-exec options and returns them as a Hash.
-Fri Mar 25 12:14:58 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * process.c (rb_execarg_setenv): set environment variables.
- * ext/nkf/nkf-utf8/nkf.c: import nkf 7f18e30.
+Tue Jun 26 16:57:14 2012 Koichi Sasada <ko1@atdot.net>
-Fri Mar 25 11:49:29 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * thread_pthread.c (register_cached_thread_and_wait):
+ return immediately if malloc() failed.
+ [ruby-core:43960] [ruby-trunk - Bug #6235]
- * test/ruby/test_process.rb (TestProcess#test_no_curdir): skip silently
- on Windows, because this tests a platform specific feature and it'll
- never be supported on ruby on Windows.
+ * thread_pthread.c (USE_THREAD_CACHE): check already defined or not.
- * test/ruby/test_dir_m17n.rb
- (TestDir_M17N#test_filename_extutf8_invalid,
- TestDir_M17N#test_filename_as_bytes_extutf8): ditto.
+Tue Jun 26 10:01:56 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/open-uri/test_open-uri.rb
- (TestOpenURI#test_find_proxy_case_sensitive_env): ditto.
+ * io.c (rb_io_s_popen): revert r36213 "popen: shell commands with
+ envvar" because it disabled to let single command bypass shell.
- * test/dl/test_handle.rb (DL::TestHandle#test_NEXT,
- DL::TestHandle#test_DEFAULT): ditto.
+Mon Jun 25 17:49:28 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Mar 24 23:06:29 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * class.c (rb_mix_module): revert Module#mix.
- * vm_insnhelper.c (vm_get_ev_const): should not autoload in
- defined? mode.
+Mon Jun 25 16:57:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * variable.c (rb_const_defined_0): fix autoloading base.
- [ruby-core:35509]
+ * proc.c (rb_mod_define_method): allow method transplanting from a
+ module to either class or module. [ruby-core:34267][Feature #4254]
-Thu Mar 24 22:48:43 2011 Tanaka Akira <akr@fsij.org>
+Mon Jun 25 11:34:45 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/sdbm/_sdbm.c: parenthesize macro arguments.
+ * internal.h: use rb_pid_t instead of pid_t because of there is no
+ definition of pid_t here on Windows.
-Thu Mar 24 14:45:57 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Jun 25 00:25:01 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/openssl/ossl.c: suppress warning: shorten-64-to-32.
+ * configure.in (for stack end address): remove human68k specific
+ check. It is no longer supported.
- * ext/openssl/ossl.h: ditto.
+Sun Jun 24 23:02:17 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_asn1.c: ditto.
+ * io.c (pipe_open): merge win32 code using spawnv().
- * ext/openssl/ossl_bio.c: ditto.
+Sun Jun 24 22:53:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_bn.c: ditto.
+ * process.c (check_exec_fds): separate check_exec_fds_1() since
+ nonstatic initializer of an aggregate type is not allowed by C89.
- * ext/openssl/ossl_cipher.c: ditto.
+Sun Jun 24 07:47:17 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl_hmac.c: ditto.
+ * internal.h (rb_execarg): options field removed.
- * ext/openssl/ossl_ns_spki.c: ditto.
+ * process.c: follow the rb_execarg change.
- * ext/openssl/ossl_ocsp.c: ditto.
+Sat Jun 23 23:48:21 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl_pkcs5.c: ditto.
+ * process.c (proc_spawn_cmd): unused variable removed to suppress a
+ warning.
+ (save_env): ditto.
- * ext/openssl/ossl_pkey.c: ditto.
+ [ruby-core:45797] reported by Luis Lavena.
- * ext/openssl/ossl_pkey_dh.c: ditto.
+Sat Jun 23 23:19:31 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl_pkey_dsa.c: ditto.
+ * internal.h (rb_execarg): add new_pgroup_given and new_pgroup_flag
+ fields.
- * ext/openssl/ossl_pkey_ec.c: ditto.
+ * process.c (EXEC_OPTION_NEW_PGROUP): removed.
+ (proc_spawn_cmd): take a struct rb_execarg argument.
+ use the new fields.
+ (rb_execarg_addopt): use the new fields.
+ (rb_spawn_process): follow the proc_spawn_cmd change.
- * ext/openssl/ossl_pkey_rsa.c: ditto.
+ [ruby-core:45794] [ruby-trunk - Bug #6633] reported by Luis Lavena.
- * ext/openssl/ossl_rand.c: ditto.
+Sat Jun 23 20:26:36 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl_ssl.c: ditto.
+ * internal.h (rb_execarg): add fd_dup2, fd_close, fd_open,
+ fd_dup2_child fields.
- * ext/openssl/ossl_x509ext.c: ditto.
+ * process.c (EXEC_OPTION_DUP2): removed.
+ (EXEC_OPTION_CLOSE): removed.
+ (EXEC_OPTION_OPEN): removed.
+ (EXEC_OPTION_DUP2_CHILD): removed.
+ (mark_exec_arg): mark the new fields.
+ (check_exec_redirect1): change condition for default option.
+ (check_exec_redirect): take a struct rb_execarg argument.
+ use the new fields.
+ (rb_execarg_addopt): follow the check_exec_redirect change.
+ (check_exec_fds): use the new fields.
+ (save_redirect_fd): ditto.
- * ext/openssl/ossl_x509name.c: ditto.
+Sat Jun 23 19:01:18 2012 Tanaka Akira <akr@fsij.org>
-Thu Mar 24 11:48:19 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * process.c (rb_execarg_fixup): fix envopts condition.
- * ext/openssl/ossl_rand.c (ossl_rand_egd_bytes): use NUM2INT because
- the result is used with functions whose argument is int.
+Sat Jun 23 18:44:13 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl_ssl.c (ossl_sslctx_setup): ditto.
+ * process.c (check_exec_redirect1): extracted from
+ check_exec_redirect.
- * ext/openssl/ossl_x509store.c (ossl_x509store_set_purpose): ditto.
+Sat Jun 23 17:22:02 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl_x509store.c (ossl_x509store_set_trust): ditto.
+ * process.c (save_env): don't use EXEC_OPTION_UNSETENV_OTHERS.
+ (rb_execarg_run_options): ditto.
- * ext/openssl/ossl_x509store.c (ossl_x509stctx_set_purpose): ditto.
+Sat Jun 23 17:04:08 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl_x509store.c (ossl_x509stctx_set_trust): ditto.
+ * internal.h (rb_execarg): add env_modification field.
-Thu Mar 24 11:36:55 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * process.c (EXEC_OPTION_ENV): removed.
+ (mark_exec_arg): mark env_modification field.
+ (rb_exec_fillarg): update the new field, instead of options array.
+ (rb_execarg_fixup): use the new field.
+ (save_env): ditto.
+ (rb_execarg_run_options): ditto.
- * ext/openssl/ossl_x509name.c: id_aref's type is ID.
+Sat Jun 23 16:27:01 2012 Tanaka Akira <akr@fsij.org>
-Thu Mar 24 10:04:35 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * internal.h (rb_execarg): add rlimit_limits field.
- * ext/io/console/console.c (console_set_winsize):
- suppress warning: shorten-64-to-32.
+ * process.c (EXEC_OPTION_RLIMIT): removed.
+ (mark_exec_arg): mark rlimit_limits field.
+ (rb_execarg_addopt): update the new fields, instead of options array.
+ (run_exec_rlimit): use the new field.
+ (rb_execarg_run_options): clear sarg using MEMZERO. use the new
+ field.
-Thu Mar 24 09:56:19 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Sat Jun 23 14:29:25 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl_ocsp.c (ossl_ocspreq_verify): flags is VALUE,
- so it should use NUM2INT.
+ * internal.h (rb_execarg): add chdir_given and chdir_dir fields.
- * ext/openssl/ossl_ocsp.c (ossl_ocspbres_verify): ditto.
+ * process.c (EXEC_OPTION_CHDIR): removed.
+ (mark_exec_arg): mark chdir_dir field.
+ (rb_execarg_addopt): update the new fields, instead of options array.
+ (rb_execarg_run_options): use the new fields.
-Wed Mar 23 21:09:29 2011 Tanaka Akira <akr@fsij.org>
+Sat Jun 23 13:20:47 2012 Tanaka Akira <akr@fsij.org>
- * ext/readline/readline.c: parenthesize macro arguments.
+ * internal.h (rb_execarg): add close_others_given, close_others_do and
+ close_others_maxhint fields.
-Wed Mar 23 08:07:33 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * process.c (EXEC_OPTION_CLOSE_OTHERS): removed.
+ (rb_execarg_addopt): update the new fields, instead of options array.
+ (check_exec_fds): take eargp as an argument. update the
+ close_others_maxhint field.
+ (rb_execarg_fixup): follow the argument change of check_exec_fds.
+ (rb_execarg_run_options): use the new fields.
- * numeric.c (flo_round): fix inaccurate results.
+Sat Jun 23 10:41:59 2012 Tanaka Akira <akr@fsij.org>
-Wed Mar 23 00:12:16 2011 Tajima Akio <artonx@yahoo.co.jp>
+ * internal.h (rb_execarg): add unsetenv_others_given and
+ unsetenv_others_do fields.
- * win32/win32.c: wait process real termination after reading
- exit code. fixes #4518
+ * process.c (EXEC_OPTION_UNSETENV_OTHERS): removed.
+ (rb_execarg_addopt): update the new fields, instead of options array.
+ (rb_execarg_fixup): use the new fields.
-Tue Mar 22 21:20:10 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Sat Jun 23 09:35:47 2012 Tanaka Akira <akr@fsij.org>
- * lib/rubygems/test_case.rb: save current dir to @current_dir
- before Dir.chdir.
+ * process.c: use the variable name "soptions" for sargp->options.
-Tue Mar 22 20:10:04 2011 Tanaka Akira <akr@fsij.org>
+Sat Jun 23 09:17:49 2012 Tanaka Akira <akr@fsij.org>
- * ext/psych/parser.c: parenthesize macro arguments.
+ * process.c: use the name "sargp" for struct rb_execarg variables
+ consistently for saving process attributes.
-Tue Mar 22 20:10:01 2011 Tanaka Akira <akr@fsij.org>
+ * io.c: ditto.
- * ext/openssl/ruby_missing.h: parenthesize macro arguments.
+Sat Jun 23 07:59:57 2012 Tanaka Akira <akr@fsij.org>
-Tue Mar 22 13:33:22 2011 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * process.c: use the name "eargp" for struct rb_execarg variables
+ consistently except for saving process attributes.
- * ext/openssl/lib/openssl/buffering.rb: removed circular require of
- openssl.rb.
+ * io.c: ditto.
- * ext/openssl/lib/openssl/*: removed following comment for transition
- measures of avoiding circular require. No one claimed about this as
- far as I know.
- ##
- # Should we care what if somebody require this file directly?
- # require "openssl"
+ * ext/pty/pty.c: ditto.
-Tue Mar 22 10:57:36 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Wed Jun 20 18:27:03 2012 Yuki Yugui Sonoda <yugui@google.com>
- * test/runner.rb: set Gem::TestCase's @@project_dir.
+ * common.mk: Add missing dependencies.
- * lib/rubygems/test_case.rb: set Gem::TestCase's @@project_dir only
- when it is not defined.
+Fri Jun 22 20:27:39 2012 Tanaka Akira <akr@fsij.org>
-Tue Mar 22 09:38:19 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * internal.h (rb_execarg): add pgroup_given and pgroup_pgid fields.
- * numeric.c (flo_round): use pow instead of while-loop. fixes #4510
- patched by Alex Young [ruby-core:35526]
+ * process.c (EXEC_OPTION_PGROUP): removed.
+ (rb_execarg_addopt): update the new fields, instead of options array.
+ (run_exec_pgroup): take a struct rb_execarg argument. refer the new
+ fields.
+ (rb_execarg_run_options): follow run_exec_pgroup change.
-Tue Mar 22 06:47:46 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Fri Jun 22 18:48:51 2012 Kouhei Sutou <kou@cozmixng.org>
- * ext/date/date_strftime.c (date_strftime_wo_timespec):
- suppress warning: shorten-64-to-32.
+ * README.EXT, README.EXT.ja: use "sval" for the third argument
+ name of Data_Wrap_Struct().
+ Suggested by @satoh_fumiyasu. Thanks!!!
-Tue Mar 22 06:42:42 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Fri Jun 22 18:04:26 2012 Koichi Sasada <ko1@atdot.net>
- * ext/date/date_core.c: suppress warning: shorten-64-to-32.
+ * iseq.c, vm_eval.c: set th->base_block properly.
+ th->base_block is information for (a) parsing, (b) compiling
+ and (c) setting up the frame to execute the program passed by
+ `eval' method. For example, (1) parser need to know up-level
+ variables to detect it is variable or method without paren.
+ Befor (a), (b) and (c), VM set th->base_block by passed bindng
+ (or previous frame information). After execute (a), (b) and (c),
+ VM should clear th->base_block. However, if (a), (b) or (c)
+ raises an exception, then th->base_block is not cleared.
+ Problem is that the uncleared value th->balo_block is used for
+ irrelevant iseq compilation. It causes SEGV or critical error.
+ I tried to solve this problem: to clear them before exception,
+ but finally I found out that it is difficult to do it (Ruby
+ program can be run in many places).
+ Because of this background, I set th->base_block before
+ compiling iseq and restore it after compiling.
+ Basically, th->base_block is dirty hack (similar to global
+ variable) and this patch is also dirty.
-Tue Mar 22 06:41:37 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * bootstraptest/test_eval.rb: add a test for above.
- * lib/test/unit/parallel.rb: remove unused variable.
+ * internal.h: remove unused decl.
-Tue Mar 22 06:19:42 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * iseq.c (rb_iseq_compile_with_option): add base_block parameter.
+ set th->base_block before compilation and restore it after
+ compilation.
- * enc/utf_16le.c: suppress warning: shorten-64-to-32.
+ * ruby.c (require_libraries): pass 0 as base_block instead of
+ setting th->base_block
- * ext/dbm/dbm.c: ditto.
+ * tool/compile_prelude.rb (prelude_eval): apply above changes.
- * ext/gdbm/gdbm.c: ditto.
+ * vm.c, vm_eval.c: ditto.
- * parse.y (Init_ripper): suppress warning: unused value.
+ * vm_core.h: add comments.
-Mon Mar 21 11:21:32 2011 Shota Fukumori <sorah@tubusu.net>
+Fri Jun 22 18:19:38 2012 Tanaka Akira <akr@fsij.org>
- * lib/test/unit.rb: Refactoring. Unified if and elsif.
+ * process.c: pass struct rb_execarg value instead of its options
+ field for saving process attribute changing functions.
+ (save_redirect_fd): take a struct rb_execarg argument.
+ (run_exec_dup2): ditto.
+ (run_exec_close): ditto.
+ (run_exec_open): ditto.
+ (run_exec_dup2_child): ditto.
+ (run_exec_pgroup): ditto.
+ (run_exec_rlimit): ditto.
+ (save_env): ditto.
+ (rb_execarg_run_options): follow the above functions change.
-Sun Mar 20 23:09:34 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Fri Jun 22 17:55:48 2012 Koichi Sasada <ko1@atdot.net>
- * ext/date/date_strftime.c: checks duplicated modifiers.
+ * test/ruby/test_backtrace.rb: decrease recursion depth
+ to reduce consuming stack size.
-Sun Mar 20 22:32:30 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Fri Jun 22 13:36:50 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/date/date_strftime.c: removed unused code and arguments.
+ * random.c (random_init, random_load): cannot initialize frozen object
+ again, nor with tainted/untrusted object. [Bug #6540]
-Sun Mar 20 21:34:49 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Fri Jun 22 13:32:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/date/date_core.c: replacement of implementation of
- strftime. It has some limitations that is same as Time's
- one. [experimental]
- * ext/date/date_strftime.c: new.
- * ext/date/lib/date/format.rb: removed ruby version of strftime.
+ * error.c (rb_check_copyable): new function, to ensure the target is
+ not frozen and the source is not tainted nor untrusted.
-Sun Mar 20 12:43:12 2011 Tanaka Akira <akr@fsij.org>
+Fri Jun 22 05:55:20 2012 Eric Hodel <drbrain@segment7.net>
- * ext/openssl/ossl_x509store.c: parenthesize macro arguments.
+ * eval.c (ruby_cleanup): Fixed typo. Patch by Trever Dawe.
+ Fixes #131 (github). [ruby-trunk - Bug #6619]
-Sun Mar 20 01:39:48 2011 Tajima Akio <artonx@yahoo.co.jp>
+Thu Jun 21 21:16:58 2012 Tanaka Akira <akr@fsij.org>
- * hash.c (ruby_setenv): check env process block size with OS ver.
- * win32/win32.c: export rb_w32_osver for above patch.
- * include/ruby/win32.h: declare rb_w32_osver for Win32 Libs.
+ * process.c (rb_execarg_addopt): take a VALUE argument instead of
+ struct rb_execarg.
+ (rb_exec_arg_addopt): follow the rb_execarg_addopt change.
+ (check_exec_options_i): ditto.
-Sat Mar 19 18:35:05 2011 Tajima Akio <artonx@yahoo.co.jp>
+ * io.c (pipe_open): follow the rb_execarg_addopt change.
- * hash.c (ruby_setenv): calculate total env block size for win32.
- * test/ruby/test_env.rb: add test for above patch.
+ * internal.h (rb_execarg_addopt): follow the definition change.
-Sat Mar 19 17:14:46 2011 Tajima Akio <artonx@yahoo.co.jp>
+Thu Jun 21 20:34:19 2012 Tanaka Akira <akr@fsij.org>
- * hash.c (ruby_setenv): checking with max process environment
- block size for Win32. 32767 for 2000/XP, 2003. if failed to
- read the block, then checking with 5120 for earlier Windows.
+ * process.c (rb_exec_fillarg): take a VALUE argument instead of
+ struct rb_execarg.
+ (rb_check_exec_options): ditto.
+ (check_exec_options_i): ditto.
-Sat Mar 19 12:30:25 2011 Tanaka Akira <akr@fsij.org>
+Thu Jun 21 19:48:05 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl_x509revoked.c: parenthesize macro arguments.
+ * process.c (rb_exec_async_signal_safe): use rb_execarg_run_options
+ instead of rb_run_exec_options_err.
+ (rb_spawn_process): ditto.
-Fri Mar 18 20:44:36 2011 Tanaka Akira <akr@fsij.org>
+Thu Jun 21 19:02:43 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl_x509req.c: parenthesize macro arguments.
+ * process.c (rb_exec_fillarg): take a VALUE argument instead of
+ struct rb_execarg.
+ (rb_execarg_init): follow the rb_exec_fillarg change.
-Fri Mar 18 08:48:06 2011 Oleg Shaldybin <oleg.shaldybin@gmail.com>
+Thu Jun 21 18:36:43 2012 Tanaka Akira <akr@fsij.org>
- * lib/fileutils.rb (FileUtils::Entry_#copy_file): updated FileUtils.cp
- to still copy file permissions when :preserve is false (as cp does
- this even when -p isn't set).
+ * process.c (rb_execarg_init): take a VALUE argument instead of
+ struct rb_execarg.
+ (rb_execarg_new): follow the rb_execarg_init change.
+ (rb_exec_arg_init): ditto.
-Fri Mar 18 00:59:38 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * internal.h (rb_execarg_init): follow the definition change.
- * ext/win32ole/extconf.rb (create_docfile): removed. should not
- modify source directory unnecessarily, platform dependent
- documentation should be dealt with by rdoc. [ruby-core:35495]
+Thu Jun 21 17:20:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Mar 18 00:54:20 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * parse.y (new_args_tail_gen): fix GC problem of keyword rest
+ argument. the wrapped struct should be bound to the wrapping node
+ before assignment of child nodes, to get rid of the case the
+ children are referred by only the struct pointer which is not a
+ subject of GC. [ruby-core:45744]
- * include/ruby/ruby.h (rb_funcall_passing_block): add prototype.
- a patch by James M. Lawrence at [ruby-core:35501]
+Thu Jun 21 07:06:52 2012 Koichi Sasada <ko1@atdot.net>
-Wed Mar 17 06:23:31 2011 Tanaka Akira <akr@fsij.org>
+ * error.c (err_append): rename err_append() to compile_err_append()
+ and move definition body. err_append() is used only by compiling.
- * ext/openssl/ossl_x509name.c: parenthesize macro arguments.
+Thu Jun 21 06:21:54 2012 Tanaka Akira <akr@fsij.org>
-Wed Mar 16 20:36:56 2011 Tanaka Akira <akr@fsij.org>
+ * process.c (rb_execarg_fixup): take a VALUE argument instead of
+ struct rb_execarg.
- * ext/socket/ipsocket.c (init_inetsock_internal): raise an error on
- listen(2) failure.
- reported by Xavier Shay. [ruby-core:35505]
+ * internal.h (rb_execarg_fixup): follow the definition change.
-Wed Mar 16 15:06:21 2011 Eric Hodel <drbrain@segment7.net>
+ * io.c (pipe_open): follow rb_execarg_fixup change.
- * ext/openssl/lib/openssl/buffering.rb (module OpenSSL): #flush should
- not change sync mode on exception.
- * test/openssl/test_buffering.rb: added
+ * ext/pty/pty.c (establishShell): ditto.
-Wed Mar 16 13:45:28 2011 Eric Hodel <drbrain@segment7.net>
+Wed Jun 20 21:25:37 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl/lib/openssl/buffering.rb: de-nest Buffering module
+ * internal.h (struct rb_execarg): add umask_given and umask_mask
+ fields.
- * ext/openssl/lib/openssl/buffering.rb: add RDoc
+ * process.c (STATIC_ASSERT): removed.
+ (rb_execarg_addopt): follow the rb_execarg change.
+ (rb_execarg_run_options): ditto.
-Wed Mar 16 08:40:39 2011 Tanaka Akira <akr@fsij.org>
+Wed Jun 20 20:38:23 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl_x509ext.c: parenthesize macro arguments.
+ * internal.h (struct rb_execarg) moved and renamed from
+ struct rb_exec_arg in intern.h.
-Tue Mar 15 18:34:27 2011 Tanaka Akira <akr@fsij.org>
+ * include/ruby/intern.h (struct rb_exec_arg): refer Data object which
+ contains struct rb_execarg.
- * ext/openssl/ossl_x509crl.c: parenthesize macro arguments.
+ * process.c: use struct rb_execarg instead of struct rb_exec_arg
+ except functions declared in intern.h.
+ (rb_exec_arg_addopt): extract a pointer to struct rb_execarg from
+ struct rb_exec_arg.
+ (rb_exec_arg_init): ditto.
+ (rb_exec_arg_fixup): ditto.
+ (rb_run_exec_options_err): ditto.
+ (rb_run_exec_options): ditto.
+ (rb_exec_err): ditto.
+ (rb_exec): ditto.
-Tue Mar 15 09:49:03 2011 Shota Fukumori <sorah@tubusu.net>
+ * io.c: use struct rb_execarg instead of struct rb_exec_arg.
- * test/misc/test_ruby_mode.rb (test_singleton_class): Skip for Pending.
+ * ext/pty/pty.c: ditto.
-Mon Mar 14 21:20:44 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+Wed Jun 20 19:13:25 2012 Tanaka Akira <akr@fsij.org>
- * test/ruby/test_require.rb (test_require_too_long_filename):
- increase path length, because MAXPATHLEN is defined as 4096 on linux.
+ * internal.h (rb_execarg_new): declared.
+ (rb_execarg_get): ditto.
- * test/ruby/test_require.rb (test_require_path_home_1): ditto.
+ * process.c (mark_exec_arg): new function.
+ (free_exec_arg): ditto.
+ (memsize_exec_arg): ditto.
+ (exec_arg_data_type): defined.
+ (rb_execarg_new): new function.
+ (rb_execarg_get): ditto.
+ (rb_f_exec): use rb_execarg_new.
+ (rb_spawn_internal): ditto.
+ (rb_f_spawn): ditto.
- * test/ruby/test_require.rb (test_require_path_home_2): ditto.
+ * io.c (pipe_open_v): use rb_execarg_new.
+ (pipe_open_s): ditto.
-Mon Mar 14 19:54:37 2011 Tanaka Akira <akr@fsij.org>
+ * ext/pty/pty.c (establishShell): use rb_execarg_new.
- * ext/openssl/ossl_x509cert.c: parenthesize macro arguments.
+Wed Jun 20 16:36:14 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Mar 13 18:11:28 2011 Tanaka Akira <akr@fsij.org>
+ * missing/setproctitle.c (environ): use (*_NSGetEnviron()) instead of
+ environ on Darwin for namespace cleanness, same as [ruby-core:00537].
+ [ruby-core:45615] [Bug #6576]
- * ext/openssl/ossl_x509attr.c: parenthesize macro arguments.
+Wed Jun 20 11:33:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Mar 13 16:07:58 2011 Shota Fukumori <sorah@tubusu.net>
+ * process.c (rb_execarg_addopt): always make Fixnum, and ignore higher
+ bits in too large umask value.
- * lib/pstore.rb: Fix don't raise "nested transaction" when thread_safe
- is true. Patch by Masaki Matsushita (Glass_saga). [ruby-dev:43337]
+Wed Jun 20 11:24:35 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/test_pstore.rb: Test for above.
- Patch by Masaki Matsushita (Glass_saga) [ruby-dev:43337]
+ * lib/test/unit.rb (Test::Unit::Runner#_run_parallel): deal with
+ sudden-death of workers.
-Sat Mar 12 04:12:41 2011 Tanaka Akira <akr@fsij.org>
+Mon Jun 18 20:34:20 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/openssl/ossl_ssl_session.c: parenthesize macro arguments.
+ * time.c (init_leap_second_info): fix non-ANSI function declaration.
-Sat Mar 12 02:27:07 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Mon Jun 18 20:29:04 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/date/date_core.c ({d,dt}_lite_marshal_load): checks the given
- argument.
+ * ruby.c (rb_f_sub): use ansi style declaration.
+ * ruby.c (rb_f_gsub): ditto.
+ * ruby.c (rb_f_chomp): ditto.
-Sat Mar 12 01:26:24 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Mon Jun 18 20:26:23 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/date/date_core.c: changed some directives.
+ * random.c (rb_random_int32): get rid of "warning: constant 0x100000000
+ is so big it is long" warning.
-Sat Mar 12 01:16:02 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Mon Jun 18 20:07:23 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/date/date_core.c, ext/date/lib/*: moved rdoc descriptions.
+ * dir.c (dir_initialize): get rid of "unused return: argc = rb_scan_args()"
+ warning.
-Sat Mar 12 00:06:24 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Mon Jun 18 19:31:20 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/date/lib: moved from lib.
+ * include/ruby/missing.h: include math.h before checking INFINITY
+ and NAN. Otherwise, strange macro redefinition will occur.
-Fri Mar 11 23:32:38 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Mon Jun 18 19:12:37 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/date/delta*: removed undocumented delta.
+ * array.c (ary_reverse): use ansi style declaration.
-Fri Mar 11 18:42:43 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jun 19 18:43:50 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mkmf.rb (find_executable0): should exclude directories.
+ * include/ruby/backward/rubysig.h: fix visibility. [Bug #6607]
-Fri Mar 11 01:40:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Tue Jun 19 17:51:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * process.c (proc_getmaxgroups, proc_setmaxgroups): Process#maxgroups
- and Process#maxgroups= now raise NotImplementedError if the
- platform don't support supplementary groups concept.
+ * process.c (rb_execarg_run_options): do not call any methods in the
+ async-signal-safe function. mask has been checked with NUM2MODET()
+ already and converted with LONG2NUM().
-Fri Mar 11 01:25:03 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Tue Jun 19 11:59:56 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * process.c (get_sc_ngroups_max): return -1 if platform don't
- support NGROUPS_MAX.
+ * ext/readline/readline.c (Init_readline): don't set 0 to
+ rl_catch_signals and rl_catch_sigwinch. [Bug #5423]
-Thu Mar 10 22:28:15 2011 Tanaka Akira <akr@fsij.org>
+Tue Jun 19 11:52:59 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/openssl/ossl_ssl.h: parenthesize macro arguments.
+ * ext/readline/readline.c (readline_s_get_special_prefixes): suppress
+ warning: uninitialized instance variable.
-Thu Mar 10 21:59:37 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Tue Jun 19 11:43:16 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * parse.y (parser_encode_length): add exception as UTF8-MAC for
- magic comment's emacs newline specifier
- patched by James M. Lawrence [ruby-core:35476] fixes #4489
+ * ext/readline/readline.c (readline_getc): fix editline compatibility
+ broken by r36123. [Bug #6601]
-Thu Mar 10 16:00:22 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Jun 18 17:10:08 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * parse.y (parser_encode_length): fix typo: the length of
- "-dos" and "-mac" is not 5 but 4.
- patched by James M. Lawrence [ruby-core:35476] fixes #4489
+ * string.c (rb_str_subpos): split from rb_str_substr. returns
+ adjusted position for substring.
-Thu Mar 10 10:52:01 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Jun 18 10:42:57 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_require.rb: setting too long string to ENV causes
- Errno::EINVAL on Windows. long path name errors may causes over
- about 1024 bytes, then limit it about 4000 bytes.
+ * ext/readline/readline.c (readline_getc): deal with ESC just followed
+ by ASCII as meta prefix in incremental search mode. based on the
+ patch from rctay (Tay Ray Chuan) at [ruby-core:45682]. [Bug #6601]
-Thu Mar 10 10:09:35 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Sun Jun 17 22:23:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/test/unit.rb (Test::Unit::Runner::Worker#read): fix for the case
- when IO#read or IO#gets returns nil.
+ * dir.c (rb_file_directory_p): move documentation for Dir.exist? from
+ file.c so that the proper description will be shown instead of the
+ documentation of File.directory?. [ruby-core:45685]
-Thu Mar 10 07:12:03 2011 Ryan Davis <ryand-ruby@zenspider.com>
+Sun Jun 17 16:21:01 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rubygems*: Import rubygems 1.6.2 (release candidate @ 2026fbb5)
- * test/rubygems: Ditto
- * test/runner.rb: Added test to load path to fix test requires.
+ * thread_win32.h (rb_thread_lock_t): make a union for USE_WIN32_MUTEX.
+ this internal is used only in thread_win32.c, but has to be complete
+ to define rb_thread_t.
-Thu Mar 10 03:00:43 2011 Tanaka Akira <akr@fsij.org>
+ * thread_win32.c (native_mutex_lock, native_mutex_destroy): fix for
+ USE_WIN32_MUTEX.
- * ext/openssl/ossl_ssl.c: parenthesize macro arguments.
+ * thread_win32.c (native_cond_timedwait_ms): rename reserved pattern
+ name. user defined symbols should not start with __.
-Wed Mar 9 23:51:26 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+Sat Jun 16 19:24:01 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * test/ruby/test_io_m17n.rb (test_io_new_enc): "sjis" is now an alias
- of Windows-31J.
+ * ext/date/date_core.c: define date_sg_t.
-Wed Mar 9 23:06:13 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Jun 16 18:46:57 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * misc/ruby-mode.el (ruby-parse-partial): fix indent after aref.
+ * ext/date/date_tmx.h: offset in struct tmx_funcs is now int.
+ * ext/date/date_strftime.c: ditto.
+ * ext/date/date_core.c: ditto.
+
+Sat Jun 16 18:31:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (ruby_setup): set running state in the normal case before
+ popping a tag.
+
+Sat Jun 16 07:46:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::Runner#_run_parallel): format workers
+ results in the parent.
+
+Sat Jun 16 07:12:56 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/runruby.rb (File.realpath): return real path of expanded path.
+ [Bug #6598]
+
+Sat Jun 16 07:12:28 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * bootstraptest/runner.rb (main): ignore -j option for compatibility
+ with test/unit.
+
+Sat Jun 16 07:11:52 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::Runner#puke): modify only result and
+ drop useless reports, not override entirely.
+
+ * lib/test/unit/parallel.rb (Test::Unit::Worker#_run_suite): report
+ unformatted results. formatting messages is not a workers task.
-Wed Mar 9 12:50:24 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+ * lib/test/unit/parallel.rb (Test::Unit::Worker#puke): store raw
+ results.
- * ext/psych/lib/psych/visitors/yaml_tree.rb: Rescue exceptions when
- people implement the method method. Thanks Lin Jen-Shin.
- [ruby-core:35255]
+Sat Jun 16 01:27:14 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * test/psych/visitors/test_yaml_tree.rb: test for implementation of
- method method.
+ * ext/psych/lib/psych.rb: bumping psych to 1.3.3
+ * ext/psych/psych.gemspec: ditto
-Wed Mar 9 11:53:31 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Fri Jun 15 20:54:28 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * enc/shift_jis.c: Change SJIS as an alias of Windows-31J.
- [ruby-dev:43027] fixes #4280
+ * vm_backtrace.c (backtrace_collect): rename from backtreace_collect.
- * enc/shift_jis.c: Add PCK as an alias of Windows-31J.
+Fri Jun 15 19:22:13 2012 Koichi Sasada <ko1@atdot.net>
-Wed Mar 9 00:45:29 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_core.h: remove VM_FRAME_MAGIC_FINISH (finish frame type).
+ Before this commit:
+ `finish frame' was place holder which indicates that VM loop
+ needs to return function.
+ If a C method calls a Ruby methods (a method written by Ruby),
+ then VM loop will be (re-)invoked. When the Ruby method returns,
+ then also VM loop should be escaped. `finish frame' has only
+ one instruction `finish', which returns VM loop function.
+ VM loop function executes `finish' instruction, then VM loop
+ function returns itself.
+ With such mechanism, `leave' instruction (which returns one
+ frame from current scope) doesn't need to check that this `leave'
+ should also return from VM loop function.
+ Strictly, one branch can be removed from `leave' instruction.
+ Consideration:
+ However, pushing the `finish frame' needs costs because
+ it needs several memory accesses. The number of pushing
+ `finish frame' is greater than I had assumed. Of course,
+ pushing `finish frame' consumes additional control frame.
+ Moreover, recent processors has good branch prediction,
+ with which we can ignore such trivial checking.
+ After this commit:
+ Finally, I decide to remove `finish frame' and `finish'
+ instruction. Some parts of VM depend on `finish frame',
+ so the new frame flag VM_FRAME_FLAG_FINISH is introduced.
+ If this frame should escape from VM function loop, then
+ the result of VM_FRAME_TYPE_FINISH_P(cfp) is true.
+ `leave' instruction checks this flag every time.
+ I measured performance on it. However on my environments,
+ it improves some benchmarks and slows some benchmarks down.
+ Maybe it is because of C compiler optimization parameters.
+ I'll re-visit here if this cause problems.
- * ext/extmk.rb: nmake substitutes all occurrences in macro.
+ * insns.def (leave, finish): remove finish instruction.
- * ext/extmk.rb: workaround for nmake.
+ * vm.c, vm_eval.c, vm_exec.c, vm_backtrace.c, vm_dump.c:
+ apply above changes.
-Tue Mar 8 23:49:45 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Fri Jun 15 19:11:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * process.c (proc_setgroups): cleanup.
+ * lib/test/unit.rb (Test::Unit::Runner#puke): always add skipped
+ results to the report for parallel test. [Bug #6595]
-Tue Mar 8 23:40:30 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jun 15 09:01:35 2012 Yuki Yugui Sonoda <yugui@google.com>
- * test/misc/test_ruby_mode.rb: test for ruby-mode.el.
+ * nacl/pepper_main.c: Removed an unnecessary and erroneous inclusion.
-Tue Mar 8 23:27:38 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Thu Jun 14 22:59:56 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * process.c (get_sc_ngroups_max): try to use NGROUPS_MAX at first if
- _SC_NGROUP_MAX is not defined.
+ * configure.in (RUBY_CPPOUTFILE): check if output is really sent to
+ specified file to tell if -o option works. [ruby-dev:45742]
+ [Bug#6591]
-Tue Mar 8 23:10:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (RUBY_CPPOUTFILE): check if output file is actually
+ created. [ruby-dev:45742] [Bug#6591]
- * misc/ruby-mode.el (ruby-parse-partial): fix for array in block.
+Thu Jun 14 22:10:50 2012 Tanaka Akira <akr@fsij.org>
-Tue Mar 8 21:44:49 2011 Tanaka Akira <akr@fsij.org>
+ * process.c (proc_exec_sh): don't strip leading spaces of the script.
- * ext/openssl/ossl_rand.c: parenthesize macro arguments.
+Thu Jun 14 15:54:02 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Mar 8 16:45:31 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * file.c (rb_file_s_basename, rb_file_s_dirname): documentation fix.
+ File.basename and File.dirname support File::ALT_SEPARATOR.
- * hash.c (ruby_setenv): MSDN says that Windows XP or earlier limits
- the total size of environment block to 5,120 chars. and on such
- OS, putenv() causes SEGV. So, ruby should limit the size of an
- environment variable to 5,120 bytes for workaround.
+Thu Jun 14 11:10:10 2012 Yuki Yugui Sonoda <yugui@google.com>
-Tue Mar 8 15:57:20 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * nacl/pepper_main.c: Applies the new embedding API to pepper_ruby.
- * test/rubygems/test_gem_spec_fetcher.rb
- (TestGemSpecFetcher#test_cache_dir_escapes_windows_paths): cache_dir
- may have driveletter and `:' for base of cache_dir itself, so need
- to skip it for checking.
+Thu Jun 14 10:44:41 2012 Yuki Yugui Sonoda <yugui@google.com>
-Tue Mar 8 12:30:06 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * include/ruby/ruby.h: Grouped APIs for embedding CRuby interpreter.
+ (ruby_setup, ruby_compile_main_from_file,
+ ruby_compile_main_from_string, ruby_eval_main,
+ ruby_set_script_name): new APIs to embed CRuby.
+ (ruby_opaque_t) Opaque pointer to an internal data, to NODE or iseq
+ in particular.
+
+ * eval.c (ruby_setup): Similar to ruby_init but returns an error code
+ instead of exit(3) on error.
+ (ruby_eval_main): Similar to ruby_exec_node but returns the
+ evaluation result.
+ (ruby_eval_main_internal): renamed from ruby_exec_internal.
+
+ * ruby.c (toplevel_context): new helper function.
+ (PREPARE_EVAL_MAIN): moved.
+ (process_options): refactored with new functions.
+ (parse_and_compile_main) new helper function.
+ (ruby_compile_main_from_file, ruby_compile_main_from_string) new API
+ (ruby_set_script_name): new API.
+
+
+Thu Jun 14 10:39:48 2012 Yuki Yugui Sonoda <yugui@google.com>
+
+ * eval.c: Add doxygen comments.
+
+ * ruby.c: ditto.
+
+ * thread_pthread.c: ditto
+
+ * version.c: ditto.
+
+ * vm_core.h: ditto.
- * misc/ruby-mode.el (ruby-deep-indent-paren-p, ruby-calculate-indent):
- do not apply deep-indent inside parens at the beginning of
- expressions.
+Thu Jun 14 10:16:07 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Mar 8 09:32:48 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in: revert r36071 and add NetBSD to blacklist of -ansi.
- * common.mk (configure-ext, build-ext), ext/extmk.rb (extmake):
- support parallel-make under ext.
+Thu Jun 14 07:59:12 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Mar 8 09:25:23 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * thread_pthread.c (get_stack): Linux is the only OS which includes
+ the size of guard page into the stack size.
- * process.c (proc_setgroups): use getgrnam() if getgrnam_r() is
- not available.
+Thu Jun 14 06:21:00 2012 Eric Hodel <drbrain@segment7.net>
- * process.c: RARRAY_LEN() returns long int.
+ * lib/drb/drb.rb: Replace broken links to the English DRb book.
+ Patch by Zachary Scott. [ruby-trunk - Bug #6544]
-Tue Mar 8 09:07:03 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Jun 14 06:17:47 2012 Eric Hodel <drbrain@segment7.net>
- * configure.in (RUBY_REPLACE_TYPE): enclose in quotes for multiple
- type names.
+ * lib/observer.rb: Update broken link to the Programming Ruby book.
+ Patch by Zachary Scott. [ruby-trunk - Bug #6536]
+ * lib/drb/drb.rb: ditto.
-Tue Mar 8 01:43:11 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Jun 14 05:23:05 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * process.c (get_sc_ngroups_max): define to wrap sysconf(3).
- this also supports Windows which doesn't have sysconf(3).
+ * regparse.c (PFETCH_READY): suppress Wunused-but-set-variable.
- * process.c (maxgroups): use get_sc_ngroups_max.
+ * regparse.c (is_onechar_cclass): restructured to clarify that c is
+ used iff found == 1.
- * process.c (proc_setmaxgroups): ditto.
+Thu Jun 14 02:54:17 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Mar 8 01:16:49 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * configure.in: use -fbuiltin with -ansi -std=iso9899:199409.
+ This prevents errors introduced by disabling builtin functions,
+ which is the sub-effect of -ansi/-std.
+ Now NetBSD can use -ansi -std=iso9899:199409.
+ Maybe mingw, cygwin and darwin can also.
- * gc.c (rb_objspace): an initializer must be a constant.
+Thu Jun 14 02:53:30 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Mar 8 01:11:44 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * Makefile.in: don't remove macros. now name2ctype uses macros.
- * process.c (maxgroups): cast because sysconf(3)'s return value is long.
+ * tool/enc-unicode.rb: add comment why it uses Hash#index.
- * process.c (proc_setmaxgroups): ditto.
+ * enc/unicode/{name2ctype.kwd,name2ctype.src,name2ctype.h.blt}:
+ update to follow the current name2ctype.h.
+ FYI current Unicode version is 6.1.
- * process.c (proc_setgroups): cast because RARRAY_LEN() is long.
+Thu Jun 14 00:16:59 2012 Akinori MUSHA <knu@iDaemons.org>
-Tue Mar 8 00:02:47 2011 Tanaka Akira <akr@fsij.org>
+ * lib/net/http/responses.rb, lib/webrick/httpstatus.rb: Add HTTP
+ response codes added in RFCs 2817 and 4918. [ruby-core:45547]
+ [Feature #6569]
- * ext/openssl/ossl_pkey_rsa.c: parenthesize macro arguments.
+ * lib/net/http/responses.rb: Rename Net::HTTPMultipleChoice to
+ Net::HTTPMultipleChoices, leaving the former as alias to the
+ latter for backward compatibility. [ruby-core:45547]
+ [Feature #6569]
-Mon Mar 7 22:59:39 2011 Shota Fukumori <sorah@tubusu.net>
+ * lib/net/http/responses.rb: Add comments about unused,
+ still-in-draft and private extension response codes.
+ [ruby-core:45547] [Feature #6569]
- * lib/pstore.rb: Delete variable @transaction and fix #4474. Patch by
- Masaki Matsushita (Glass_saga).
+Wed Jun 13 22:44:32 2012 Naohisa Goto <ngotogenome@gmail.com>
- * test/test_pstore.rb(test_thread_safe): Add test for #4474.
+ * test/dl/test_func.rb (test_qsort1, test_qsort2): use TYPE_SIZE_T
+ for size_t variables. [ruby-dev:45733] [Bug #6584]
-Mon Mar 7 21:31:38 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Wed Jun 13 22:18:01 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * process.c (proc_setgroups): replace getgrnam() with getgrnam_r()
- because getgrnam() isn't thread safe.
+ * configure.in: remove -ansi and -std options for lgamma_r() and
+ finite().
-Mon Mar 7 20:49:12 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Wed Jun 13 21:46:34 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * process.c (proc_getmaxgroups, proc_setmaxgroups): reflect
- platform maxgroups limitation by default instead hardcoded 65536.
+ * configure.in: cygwin does not provide some declarations in strict
+ ANSI mode.
-Mon Mar 7 17:13:00 2011 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed Jun 13 20:19:59 2012 Tanaka Akira <akr@fsij.org>
- * gc.c (rb_gc_set_params): allow GC parameter configuration by
- environment variables. based on a patch from funny-falcon at
- https://gist.github.com/856296, but honors safe level.
+ * process.c (rb_fork_internal): move a variable declaration.
-Mon Mar 7 09:05:18 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jun 13 17:54:38 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
- * process.c: NUM2RLIM is defined but no getrlimit and setrlimit on
- mingw.
+ * regparse.c (PFETCH_READY): this line was to suppress warning,
+ but did emit warnings if -Wuninitialized was set. Assigning
+ NULL instead if pfetch_prev should suffice the situation.
-Mon Mar 7 08:38:14 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jun 13 17:51:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/date/date_core.c (DateTimeData): should not use bare 'long long'
- and 'long double', which are not defined by C89.
+ * configure.in: cygwin needs C99 for some stuff, e.g.,
+ pthread_attr_setstacksize, sched_yield.
- * ext/date/date_core.c (dt_lite_plus): get rid of overflow at casting
- down double to integer.
+Wed Jun 13 17:50:43 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Mar 7 00:21:11 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * Makefile.in (.c.i): add warnflags to make the result consistent with
+ compilation.
- * process.c (proc_getgroups): get rid of maxgroups dependency.
- ngroups can be calculated dynamically.
+Wed Jun 13 15:12:07 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
-Sun Mar 6 23:45:40 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * configure.in: On Windows platforms, system provided headers are
+ VC++ optimized. That is, C++ habits are often contaminated into
+ various headers. Most frequent situation is the use of //
+ comments. We bypass ANSI C mode for them. Otherwise extension
+ libs cannot include those headers.
- * configure.in: rlim_t use standard RUBY_REPLACE_TYPE mechanism.
+Wed Jun 13 13:39:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Mar 6 23:26:07 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * include/ruby/win32.h: get rid of C99 style one line comments.
- * process.c (proc_setmaxgroups): added negative value check.
- This was suggested by Daniel Berger. Thanks Daniel!
- [ruby-core:35426][Bug#4467]
+Wed Jun 13 13:39:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Mar 6 23:18:23 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * encoding.c (enc_alias_internal): use strdup defined as macro.
- * process.c (maxgroups, proc_setmaxgroups): increase max groups
- limitation up to 65536.
+Wed Jun 13 10:20:27 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Mar 6 22:20:59 2011 Tanaka Akira <akr@fsij.org>
+ * process.c (rb_exec_fillarg): get rid of SIZE_T_MAX which may need
+ more headers.
- * ext/openssl/ossl_pkey_ec.c: parenthesize macro arguments.
+ * process.c (rb_exec_fillarg): fix array element size. "continue" and
+ "readonly" exceeded the size.
-Sun Mar 6 21:49:04 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * process.c (rb_exec_fillarg): use shell if the first word is reserved
+ or special built-in name.
+ http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
- * sample/list.rb (MyElem#initialize): initialize @head
- explicitly. Otherwise -W2 option makes following warning.
- "warning: instance variable @head not initialized".
- This issue was founded by Andrew Grimm. Thanks Andrew!
- [ruby-core:35435][Bug#4471]
+ * process.c (rb_exec_fillarg): treat '=' only in the first word. if
+ the first word does not contain '=', it is the command name and
+ environment assignments cannot be anymore.
-Sun Mar 6 05:21:41 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Tue Jun 12 23:45:36 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * class.c: fix camelCase to snake_case in documentation code examples.
- patched by Andrew Grimm. fixes Bug #4469
+ * lib/mkmf.rb: add dummy clean-static target to prevent errors for the
+ case real clean-static target doesn't exist.
- * marshal.c: ditto.
+Tue Jun 12 22:49:42 2012 Naohisa Goto <ngotogenome@gmail.com>
+
+ * process.c (rb_exec_arg_fixup): fix compile error
+
+Tue Jun 12 21:40:13 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_exec_fillarg): treat '=' character as a meta
+ character to detect assignments preceding command name.
+
+Tue Jun 12 20:29:19 2012 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/intern.h (rb_exec_arg_init): deprecated.
+ (rb_exec_arg_addopt): ditto.
+ (rb_exec_arg_fixup): ditto.
+ (rb_run_exec_options): ditto.
+ (rb_run_exec_options_err): ditto.
+
+ * internal.h (rb_execarg_init): declared.
+ (rb_execarg_addopt): ditto.
+ (rb_execarg_fixup): ditto.
+ (rb_execarg_run_options): ditto.
+
+ * process.c: call rb_execarg_addopt, rb_execarg_fixup,
+ rb_execarg_run_options, rb_execarg_init.
+ (rb_execarg_addopt): renamed from rb_exec_arg_addopt.
+ (rb_exec_arg_addopt): stub to call rb_execarg_addopt.
+ (rb_execarg_init): renamed from rb_exec_arg_init.
+ (rb_exec_arg_init): stub to call rb_execarg_init.
+ (rb_execarg_fixup): renamed from rb_exec_arg_fixup.
+ (rb_exec_arg_fixup): stub to call rb_execarg_fixup.
+ (rb_execarg_run_options): renamed from rb_run_exec_options_err.
+ (rb_run_exec_options_err): stub to call rb_execarg_run_options.
+ (rb_run_exec_options): call rb_execarg_run_options.
+
+ * io.c: call rb_execarg_addopt, rb_execarg_fixup,
+ rb_execarg_run_options, rb_execarg_init.
+
+ * ext/pty/pty.c (establishShell): call rb_execarg_init and
+ rb_execarg_fixup.
+
+Tue Jun 12 18:39:59 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * configure.in: enable strict ANSI mode by default in case of GCC,
+ requested by _ko1.
+
+Tue Jun 12 06:40:23 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_exec_fillarg): detect '#' as a meta character.
+
+Mon Jun 11 22:15:44 2012 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/intern.h (rb_proc_exec_n): deprecated.
+ (rb_exec): ditto.
+ (rb_exec_err): ditto.
+ (rb_fork): ditto.
+ (rb_fork_err): ditto.
+
+Mon Jun 11 18:49:52 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: on checking libexecinfo, don't specify /use/local.
+ On FreeBSD people must specify --with-opt-dir or --with-execinfo-dir.
+
+Mon Jun 11 12:14:37 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_core.h: remove lfp (local frame pointer) and rename
+ dfp (dynamic frame pointer) to ep (environment pointer).
+ This change make VM `normal' (similar to other interpreters).
+ Before this commit:
+ Each frame has two env pointers lfp and dfp. lfp points
+ local environment which is method/class/toplevel frame.
+ lfp[0] is block pointer.
+ dfp is block local frame. dfp[0] points previous (parent)
+ environment pointer.
+ lfp == dfp when frame is method/class/toplevel.
+ You can get lfp from dfp by traversing previous environment
+ pointers.
+ After this commit:
+ Each frame has only `ep' to point respective environment.
+ If there is parent environment, then ep[0] points parent
+ environment (as dfp). If there are no more environment,
+ then ep[0] points block pointer (as lfp). We call such ep
+ as `LEP' (local EP). We add some macros to get LEP and to
+ detect LEP or not.
+ In short, we replace dfp and lfp with ep and LEP.
+ rb_block_t and rb_binding_t member `lfp' and `dfp' are removed
+ and member `ep' is added.
+ rename rb_thread_t's member `local_lfp' and `local_svar' to
+ `root_lep' and `root_svar'.
+ (VM_EP_PREV_EP(ep)): get previous environment pointer. This macro
+ assume that ep is not LEP.
+ (VM_EP_BLOCK_PTR(ep)): get block pointer. This macro assume
+ that ep is LEP.
+ (VM_EP_LEP_P(ep)): detect ep is LEP or not.
+ (VM_ENVVAL_BLOCK_PTR(ptr)): make block pointer.
+ (VM_ENVVAL_BLOCK_PTR_P(v)): detect v is block pointer.
+ (VM_ENVVAL_PREV_EP_PTR(ptr)): make prev environment pointer.
+ (VM_ENVVAL_PREV_EP_PTR_P(v)): detect v is prev env pointer.
+
+ * vm.c: apply above changes.
+ (VM_EP_LEP(ep)): get LEP.
+ (VM_CF_LEP(cfp)): get LEP of cfp->ep.
+ (VM_CF_PREV_EP(cfp)): utility function VM_EP_PREV_EP(cfp->ep).
+ (VM_CF_BLOCK_PTR(cfp)): utility function VM_EP_BLOCK_PTR(cfp->ep).
+
+ * vm.c, vm_eval.c, vm_insnhelper.c, vm_insnhelper.h, insns.def:
+ apply above changes.
+
+ * cont.c: ditto.
+
+ * eval.c, eval_intern.h: ditto.
* proc.c: ditto.
- * sample/biorhythm.rb: ditto.
+ * thread.c: ditto.
- * vm_eval.c: ditto.
+ * vm_dump.c: ditto.
- * vm_method.c: ditto.
+ * vm_exec.h: fix function name (on vm debug mode).
+Mon Jun 11 11:52:18 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
-Sun Mar 6 03:22:27 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * compile.c (iseq_set_sequence): nonstatic initializer of an
+ aggregate type is a C99ism.
- * io.c (io_cntl): use rb_thread_io_blocking_region() instead
- rb_thread_blocking_region().
+ * compile.c (enum compile_array_type_t): comma at the end of enum
+ list is a C99ism.
-Sat Mar 5 22:54:36 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+ * vm_backtrace.c (enum LOCATION_TYPE): ditto.
- * include/ruby/intern.h: fix a typo of prototype declaration.
- rb_mutex_try_lock -> rb_mutex_trylock [ruby-dev:43213]
+Mon Jun 11 06:31:33 2012 Tanaka Akira <akr@fsij.org>
-Sat Mar 5 19:44:03 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * process.c (rb_proc_exec_n): revert the function removed at r35889.
- * test/ruby/test_io.rb (TestIO#test_fcntl_lock): small clean up.
+Mon Jun 11 06:20:50 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Sat Mar 5 01:33:46 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * thread_pthread.c (rb_thread_create_timer_thread): assign return
+ value to the variable err.
- * io.c (io_cntl, nogvl_io_cntl): IO.fcntl() and IO.ioctl()
- release GVL during calling kernel interface.
- Suggested by Eric Wong. [ruby-core:35417][Bug #4463]
+Mon Jun 11 06:17:06 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * test/ruby/test_io.rb (TestIO#test_fcntl_lock): add new test for
- IO.fcntl().
+ * thread_pthread.c (native_cond_initialize): fix typo in r36022.
+ this cause a failure on FreeBSD 8.2 amd64.
+ http://fbsd.rubyci.org/~chkbuild/ruby-trunk/log/20120610T130201Z.diff.html.gz
-Fri Mar 4 23:09:12 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+Mon Jun 11 05:21:57 2012 Koichi Sasada <ko1@atdot.net>
- * test/testunit/test_parallel.rb
- (test_should_run_all_without_any_leaks): consider that the order of
- testcase could change. [ruby-dev:43300] [Bug #4466]
+ * .gdbinit (SDR): add SDR function. It's only for VM debugging.
-Fri Mar 4 22:01:14 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Sun Jun 10 21:50:45 2012 Yuki Sonoda (Yugui) <yugui@yugui.jp>
- * io.c (io_cntl): change 'cmd' type to int. ioctl and fcntl need to
- be passed int.
- * io.c (rb_io_ctl): ditto.
+ * nacl/nacl_config.rb: Fixed for 32bit hosts.
+
+Sun Jun 10 20:23:14 2012 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ Fixes threading on NativeClient.
+
+ * thread_pthread.c (timer_thread_sleep): Extracted out a function from
+ thread_timer(). Added an alternative implementation for platforms
+ that lacks select(2) or pipe(2).
+ (rb_thread_create_timer_thread, native_cond_initialize,
+ native_cond_destroy): Replaced wrong HAVE_XXX checks.
+
+ * configure.in (pthread_attr_init): New check.
+
+Sun Jun 10 21:30:11 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_exec_without_timer_thread): renamed from rb_exec_err.
+ (rb_exec_err): new stub function to call
+ rb_exec_without_timer_thread.
+ (rb_f_exec): call rb_exec_without_timer_thread.
+ (rb_exec): call rb_exec_without_timer_thread.
+
+Sun Jun 10 21:13:10 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_fork): call rb_fork_internal instead of rb_fork_err.
+
+Sun Jun 10 20:55:59 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_fork_ruby): call rb_fork_internal directly.
+
+Sun Jun 10 20:19:40 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_fork_ruby): new function.
+ (rb_f_fork): use rb_fork_ruby instead of rb_fork.
+ (rb_daemon): ditto.
+
+ * io.c (pipe_open): use rb_fork_ruby instead of rb_fork.
+
+ * internal.h (rb_fork_ruby): declared.
+
+Sun Jun 10 18:58:16 2012 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/net/http/response.rb: Remove a duplicated rdoc and leave a
+ pointer.
+
+ * lib/net/http/responses.rb: Add RFC numbers to base on.
+
+Sun Jun 10 18:31:42 2012 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * configure.in (RUBY_NACL): Warns if $PATH does not contain the path
+ to NativeClient SDK. PATH variable redefinition in GNUmakefile does
+ not work for GNU make 3.81.
+
+Sun Jun 10 17:54:36 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.h (IS_STACK_DIR_UPPER): utility macro.
+
+ * thread_pthread.c (get_stack): seems stack size does not include
+ guard size on Mac OS X.
+
+ * thread_pthread.c (ruby_init_stack): adjust stack size for offset of
+ addr from the bottom.
+
+Sun Jun 10 15:49:47 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (retry_fork): call after_fork except in a child process.
+ (rb_fork_internal): restrict after_fork call condition.
+
+Sun Jun 10 14:19:33 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: NetBSD 6 adds libexecinfo but it only works on amd64.
+ http://www.mail-archive.com/source-changes-full@netbsd.org/msg38729.html
+
+Sun Jun 10 12:43:23 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_f_exec): call rb_exec_async_signal_safe except on
+ Mac OS X. cf. the comment in before_exec_non_async_signal_safe.
+
+Sun Jun 10 12:15:18 2012 Tanaka Akira <akr@fsij.org>
+
+ * io.c (popen_exec): don't call rb_thread_atfork_before_exec. use
+ rb_exec_async_signal_safe instead of rb_exec_err.
+ (pipe_open): use rb_fork_async_signal_safe instead of rb_fork_err.
+
+Sun Jun 10 11:44:57 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_fork_internal): call after_fork only unless
+ chfunc_is_async_signal_safe.
+
+Sun Jun 10 11:33:01 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_pkey_ec.c
+ test/openssl/test_pkey_ec.rb: Add support for EC_POINT_mul.
+ Patch provided by Sambasiva Suda. Thanks!
+ [ruby-core:44408][ruby-trunk - Feature #6310]
+
+Sun Jun 10 10:48:15 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * lib/openssl/ssl.rb: Use a simple random number to generate the
+ session id. MD5, as was used before, causes problems when
+ using a FIPS version of OpenSSL. Issue was found by Jared
+ Jennings, thank you!
+ [ruby-trunk - Bug #6137]
+
+Sun Jun 10 10:27:34 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * NEWS: Add note about the new private key export behavior.
+
+Sun Jun 10 10:24:51 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_exec_async_signal_safe): exported.
-Fri Mar 4 21:10:40 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * ext/pty/extconf.rb: modify $INCFLAGS to include internal.h
- * configure.in: save warnflags. the patch is created by Eric Wong.
- [Bug #4465]
+ * ext/pty/pty.c: include internal.h.
+ (chfunc): don't call rb_thread_atfork_before_exec. use
+ rb_exec_async_signal_safe instead of rb_f_exec.
+ (establishShell): set up earg. use rb_fork_async_signal_safe
+ instead of rb_fork_err.
-Wed Mar 2 21:15:00 2011 Tanaka Akira <akr@fsij.org>
+ * internal.h (rb_exec_async_signal_safe): declared.
+ (rb_fork_async_signal_safe): declared.
- * ext/openssl/ossl_pkey_dsa.c: parenthesize macro arguments.
+Sun Jun 10 10:21:37 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Thu Mar 3 22:10:26 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/openssl/ossl.c
+ ext/openssl/ossl_pkey_rsa.c
+ ext/openssl/ossl_pkey_dsa.c
+ ext/openssl/ossl_pkey_ec.c: Forbid export passwords that are less
+ than four characters long, as OpenSSL itself does not allow this.
+ Issue found by Eric Hodel.
+ * ext/openssl/ossl_pkey_ec.c: Add export as an alias of to_pem,
+ following the PKey interface contract.
+ * test/openssl/test_pkey_dsa.rb
+ test/openssl/test_pkey_rsa.rb
+ test/openssl/test_pkey_ec.rb: Add tests that assert correct
+ behaviour when dealing with passwords that are less than four
+ characters long.
+ [ruby-core: 42281][ruby-trunk - Bug #5951]
+
+Sun Jun 10 10:14:26 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_f_exec): use rb_exec_arg_prepare.
+
+Sun Jun 10 06:43:51 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c: split after_exec into async-signal-safe part and rest.
+ (after_exec_async_signal_safe): extracted from after_exec.
+ (after_exec_non_async_signal_safe): ditto.
+ (after_exec): call them.
+ (rb_exec_async_signal_safe): call after_exec_async_signal_safe.
+ (rb_exec_err): call after_exec_non_async_signal_safe instead of
+ after_exec.
+
+Sun Jun 10 06:21:10 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * NEWS: document new features of Ruby OpenSSL.
+
+Sun Jun 10 03:09:41 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl.c: Fix error in example. Patch by David Albert.
+
+ Add/extend existing documentation. Examples now also cover RSA
+ signatures and PBKDF2.
+ [ruby-core: 45154][ruby-trunk - Bug #6475]
+
+
+Sun Jun 10 01:41:45 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_ssl.c: Introduce SSLContext#renegotiation_cb and
+ remove SSLContext#disable_client_renegotiation and related
+ functionality introduced in r35797. The new callback approach
+ gives clients maximum flexibility to decide on their own what to
+ do on renegotiation attempts.
+ Add documentation for SSL module and SSLError.
+ * test/openssl/test_ssl.rb: Add a test for
+ SSLContext#renegotiation_cb.
+
+Sun Jun 10 01:37:18 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_fork_internal): initialize exc.
+
+Sun Jun 10 00:19:25 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c: don't use non async-signal-safe functions in a child
+ process before exec, for invoking a command.
+ (rb_exec_atfork): call rb_exec_async_signal_safe only.
+ (retry_fork): take chfunc_is_async_signal_safe argument. call
+ before_fork and after_fork only unless chfunc_is_async_signal_safe.
+ (send_child_error): take chfunc_is_async_signal_safe argument.
+ send an exception only unless chfunc_is_async_signal_safe.
+ (recv_child_error): take chfunc_is_async_signal_safe argument.
+ receive an exception only unless chfunc_is_async_signal_safe.
+ (rb_fork_internal): renamed from rb_fork_err and take
+ chfunc_is_async_signal_safe argument.
+ use rb_protect only unless chfunc_is_async_signal_safe.
+ (rb_fork_err): call rb_fork_internal with false as
+ chfunc_is_async_signal_safe.
+ (rb_fork_async_signal_safe): call rb_fork_internal with true as
+ chfunc_is_async_signal_safe.
+ (rb_spawn_process): call rb_fork_async_signal_safe instead of
+ rb_fork_err.
+
+Sat Jun 9 23:57:03 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_fork_err): rewrite a complex "if" statement.
+
+Sat Jun 9 23:44:29 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (before_exec_async_signal_safe): extracted from
+ before_exec.
+ (before_exec_non_async_signal_safe): ditto.
+ (before_exec): call before_exec_async_signal_safe and
+ before_exec_non_async_signal_safe.
+ (rb_exec_async_signal_safe): call before_exec_async_signal_safe.
+ (rb_exec_err): call before_exec_non_async_signal_safe instead of
+ before_exec.
+
+Sat Jun 9 23:36:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * iseq.c (iseq_load, insn_operand_intern, rb_iseq_disasm)
+ (rb_iseq_parameters): use rb_id2str() instead of rb_id2name() to
+ keep encoding.
- * process.c (check_exec_redirect_fd, check_exec_redirect): raise
- ArgumentError if fd >= 3 on Windows because the feature is not
- supported.
+ * string.c (rb_str_symname_p): new function that checks if the string
+ is valid as a symbol name. split from sym_inspect().
- * test/ruby/test_process.rb (test_execopts_redirect): remove meaningless
+Sat Jun 9 22:27:05 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (retry_fork): rewrite a complex "for" statement by
+ simple statements.
+
+Sat Jun 9 21:50:04 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (retry_fork): extracted from rb_fork_err.
+ (send_child_error): ditto.
+ (recv_child_error): ditto.
+
+Sat Jun 9 17:21:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * iseq.c (iseq_load): type is a symbol, and invalid as ID in common.
+
+Sat Jun 9 10:57:14 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_exec_async_signal_safe): extracted from rb_exec_err.
+
+Sat Jun 9 09:31:07 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c: simplified because close_others option is always
+ enabled by default.
+ (rb_f_exec): don't need to set the option.
+ (rb_exec_arg_prepare): don't need to set the option. don't need
+ default_close_others argument.
+ (rb_spawn_internal): don't need to give default_close_others
+ argument for rb_exec_arg_prepare. don't need default_close_others
argument.
+ (rb_spawn_err): don't need to give default_close_others
+ argument for rb_spawn_internal.
+ (rb_spawn): don't need to give default_close_others
+ argument for rb_spawn_internal.
+ (rb_f_system): don't need to give default_close_others argument for
+ rb_spawn_internal.
+ (rb_f_spawn): don't need to give default_close_others argument for
+ rb_exec_arg_prepare.
+
+Sat Jun 9 09:00:58 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_proc_exec): call before_exec() here addition to
+ rb_exec_err.
+
+Sat Jun 9 08:30:52 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread_pthread.c (ruby_init_stack): use stack info if possible.
+
+Sat Jun 9 08:21:32 2012 Eric Hodel <drbrain@segment7.net>
+
+ * README.EXT (prepare extconf.rb): Added note to see MakeMakefile for
+ documentation of extconf.rb functions. Patch by Zachary Scott.
+ [ruby-trunk - Feature #6522]
+ * README.EXT (Appendix C): Removed in favor of MakeMakefile.
+ Patch by Zachary Scott.
+ * lib/mkmf.rb: Merged documentation from README.EXT Appendix C. Patch
+ by Zachary Scott.
+
+Sat Jun 9 08:16:47 2012 Eric Hodel <drbrain@segment7.net>
+
+ * doc/re.rdoc: Completed wording in the description of the =~ operator.
+ [ruby-trunk - Bug #6529]
+
+Sat Jun 9 08:09:38 2012 Eric Hodel <drbrain@segment7.net>
+
+ * string.c (rb_str_start_with): Removed "p" from start_with? examples
+ to match other String method examples. [ruby-trunk - Bug #6553]
+ * string.c (rb_str_end_with): Updated end_with? to use code markup
+ instead of italic.
+
+Sat Jun 9 07:56:03 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/benchmark.rb: Updated formatting of Benchmark documentation for
+ consistency. [ruby-trunk - Bug #6533]
+
+Sat Jun 9 07:46:26 2012 Eric Hodel <drbrain@segment7.net>
-Thu Mar 3 21:21:42 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/delegate.rb: Added documentation for Delegator#!. Patch by
+ Zachary Scott. [ruby-trunk - Feature #6534]
- * test/ruby/test_process.rb (test_execopts_redirect): redirecting fd
- >= 3 is not supported on Windows, so should not specify such options
- when calling spawn or others.
+Sat Jun 9 07:39:50 2012 Eric Hodel <drbrain@segment7.net>
-Thu Mar 3 18:59:04 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/net/http/responses.rb: Add RFC 6585 response codes. Patch by
+ Sangil Jung. [ruby-trunk - Feature #6480]
+ * lib/net/http/response.rb: ditto
+ * lib/net/http.rb: ditto
+ * lib/webrick/httpstatus.rb: ditto
- * string.c (rb_str_slice_bang): raise error when the string is frozen.
+Sat Jun 9 01:24:28 2012 Tanaka Akira <akr@fsij.org>
-Thu Mar 3 14:25:19 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * process.c (rb_exec_err): before_exec() call moved from proc_exec_cmd
+ and proc_exec_sh.
+ (rb_proc_exec): ditto.
- * strftime.c (STRFTIME): return 0 and ERANGE when precision is too
- large. [ruby-dev:43284] fixes #4456
+Sat Jun 9 01:11:07 2012 Tanaka Akira <akr@fsij.org>
-Thu Mar 3 00:46:51 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * include/ruby/intern.h (rb_exec_arg_init): declaration changed to
+ return a value.
- * addr2line.c (uleb128): cast the value to unsigned long.
+ * process.c (rb_exec_arg_init): return a value.
- * addr2line.c (fill_lines): print error when lseek fails.
+Fri Jun 8 23:44:14 2012 Tanaka Akira <akr@fsij.org>
-Thu Mar 3 00:36:29 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * process.c: don't check the availability of FD_CLOEXEC. It should
+ be available if fork() is available.
- * lib/rexml/encoding.rb (REXML::Encoding#encoding=): store @encoding
- a String which means the name of the encoding.
- this partially revert r29646.
+ * io.c: ditto.
- * lib/rexml/document.rb: follow above.
+Fri Jun 8 22:39:32 2012 Tanaka Akira <akr@fsij.org>
- * lib/rexml/output.rb: ditto.
+ * process.c (rb_fork_err): revert r35955. The condition needs !chfunc
+ to close ep[0] and ep[1]. The catched exception is re-raised
+ immediately after that if status is not NULL.
- * lib/rexml/parsers/baseparser.rb: ditto.
+Fri Jun 8 19:43:33 2012 Tanaka Akira <akr@fsij.org>
- * lib/rexml/source.rb: ditto.
+ * process.c (rb_exec_err): after_exec() call moved from proc_exec_cmd
+ and proc_exec_sh.
+ (rb_proc_exec): ditto.
- * lib/rexml/xmldecl.rb: ditto.
+Fri Jun 8 19:00:59 2012 Tanaka Akira <akr@fsij.org>
-Wed Mar 2 23:19:56 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * process.c (ARGV_COUNT): unused macro removed.
+ (ARGV_SIZE): ditto.
+ (ALLOC_ARGV): ditto.
+ (ALLOC_ARGV_WITH_STR): ditto.
- * string.c (str_byte_substr): return nil for negative length.
+Fri Jun 8 16:19:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Mar 2 21:15:00 2011 Tanaka Akira <akr@fsij.org>
+ * test/runner.rb (src_testdir): expand real path so that
+ TestGem#test_self_find_files does not fail by aliased load path when
+ srcdir contains a symbolic link.
- * ext/openssl/ossl_pkey_dh.c: parenthesize macro arguments.
+ * tool/runruby.rb (srcdir): ditto.
-Wed Mar 2 14:24:04 2011 Shota Fukumori <sorah@tubusu.net>
+Fri Jun 8 12:04:39 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/test/unit/parallel.rb: Fix name from `inclement_io` to
- `increment_io`.
+ * process.c (rb_fork_err): error state in the child process is prior
+ to exceptions in proc_syswait().
-Wed Mar 2 14:06:01 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * process.c (rb_fork_err): determine status on errors.
- * string.c (rb_str_slice_bang): move treatments which is only needed
- when the result is not nil.
+ * ext/pty/pty.c (establishShell): reraise exception if something
+ raised during sleep.
-Wed Mar 2 14:02:29 2011 Shota Fukumori <sorah@tubusu.net>
+ * ext/pty/pty.c (establishShell): now needs status to protect from
+ exceptions in rb_fork_err().
- * test/testunit/test_parallel.rb(TestParallel#spawn_runner):
- Fix outputing empty line in running test.
+Thu Jun 7 22:13:05 2012 Tanaka Akira <akr@fsij.org>
- * test/testunit/tests_for_parallel/test_third.rb: Remove `sleep`
+ * process.c (rb_fork_err): Fix the condition to use rb_protect.
-Tue Mar 1 22:29:10 2011 Tanaka Akira <akr@fsij.org>
+Thu Jun 7 20:29:12 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl_pkey.h: parenthesize macro arguments.
+ * include/ruby/intern.h: rb_exec_arg and related stuff moved back from
+ internal.h
-Tue Mar 1 22:02:35 2011 Shota Fukumori <sorah@tubusu.net>
+Thu Jun 07 15:53:03 2012 Koichi Sasada <ko1@atdot.net>
- * lib/test/unit/parallel.rb: Fix number.
+ * .gdbinit: add function `trace_machine_instructions' to trace
+ in native machine assemble.
+ See https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/MachineInstructionsTraceWithGDB
+ for more details.
-Tue Mar 1 21:48:22 2011 Shota Fukumori <sorah@tubusu.net>
+Wed Jun 6 21:31:21 2012 Tanaka Akira <akr@fsij.org>
- * lib/test/unit/parallel.rb: For Windows.
+ * process.c (proc_exec_cmd) renamed from proc_exec_v.
+ (proc_exec_sh): renamed from rb_proc_exec_e.
+ (proc_spawn_cmd_internal): renamed from proc_spawn_v.
+ (proc_spawn_cmd): renamed from proc_spawn_n.
+ (proc_spawn_sh): renamed from proc_spawn.
- * test/testunit/test_parallel.rb(TestParallelWorker#test_quit_in_test):
- Fix for above specification change.
- * test/testunit/test_parallel.rb(TestParallel#spawn_runner):
- Fix outputing empty line in running test.
+Wed Jun 6 21:18:47 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Mar 1 20:51:57 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * process.c (try_with_sh): please take care of the macro defined by
+ you.
- * test/ruby/test_system.rb (TestSystem#test_system_at):
- remove tests for [bug#4396]. because we decided to reject this
- ticket.
+Wed Jun 6 20:45:08 2012 Tanaka Akira <akr@fsij.org>
-Tue Mar 1 19:46:19 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * process.c (proc_exec_v): don't call dln_find_exe_r here because it
+ is not async-signal-safe and proc_exec_v is called in a child
+ process.
+ command_abspath field of rb_exec_arg.
+ (rb_exec_fillarg): call dln_find_exe_r and set command_abspath.
+ (rb_exec_err): Give the absolute path of the invoking command for
+ proc_exec_v, instead of the command name.
- * test/date/{test_date.rb,test_date_attr.rb}: [ruby-dev:43280]
+ * internal.h: add command_abspath field for rb_exec_arg.
-Tue Mar 1 18:40:38 2011 Ryan Davis <ryan@YPCMC09457>
+Wed Jun 6 20:08:01 2012 Tanaka Akira <akr@fsij.org>
- * lib/rubygems*: Import rubygems 1.6.0 (released version @ 58d8a0b9)
- * test/rubygems: Ditto
+ * process.c (try_with_sh): take envp argument.
+ (exec_with_sh): ditto. use it for execve.
+ (proc_exec_v): provide envp for try_with_sh.
-Tue Mar 1 16:22:22 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Jun 6 13:25:04 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * win32/win32.c: revert r30987 because it causes some failures in
- test-all, especially webrick.
+ * win32/win32.c, include/ruby/win32.h (rb_w32_wrap_io_handle): new API.
+ this API wraps an I/O handle (HANDLE or SOCKET) and returns fd.
+ the second parameter should be combination of O_*, for example,
+ O_RDWR | O_BINARY | O_NOINHERIT.
-Tue Mar 1 15:59:53 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * win32/win32.c, include/ruby/win32.h (rb_w32_unwrap_io_handle): new
+ API. this API unwraps an I/O handle and close the fd (not closes
+ the handle itself).
- * string.c (rb_str_byteslice): the resulted encoding should keep
- original encoding. this also fixes the encoding when the result
- shares internal string. [ruby-core:35376]
+ [Feature #4906] [ruby-core:37227]
-Tue Mar 1 13:25:00 2011 Kenta Murata <mrkn@mrkn.jp>
+Wed Jun 6 13:18:26 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/bigdecimal/bigdecimal.c (VpMemAlloc): CVE-2011-0188.
- Fixes a bug reported by Drew Yao <ayao at apple.com>
+ * win32/win32.c (rb_w32_close): of course, console handle is not socket.
-Tue Mar 1 10:34:39 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Wed Jun 6 12:37:43 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * string.c (rb_str_byteslice): Add String#byteslice. [ruby-core:35376]
+ * process.c (rb_run_exec_options_err): allocate a temporary buffer for
+ run_exec_dup2() for restoring fds on non-fork environments.
-Tue Mar 1 00:12:49 2011 Tajima Akio <artonx@yahoo.co.jp>
+Wed Jun 6 09:45:21 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * include/ruby/win32.h: define WIN32 if neither _WIN64 nor WIN32
- defined. it forces to use push/pop for pack(4) pragma.
+ * test/dl/test_c_{struct_entry,union_entity}.rb: sorry, typos.
-Mon Feb 28 23:52:13 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+Wed Jun 6 05:27:54 2012 Tanaka Akira <akr@fsij.org>
- * test/testunit/test_rake_integration.rb (test_with_rake_runner):
- use assert_in_out_err for suppress messages.
+ * process.c (rb_exec_fillarg): check use_shell field before accessing
+ a union field.
-Mon Feb 28 22:48:56 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Wed Jun 6 04:58:44 2012 Tanaka Akira <akr@fsij.org>
- * win32/win32.c (rb_w32_spawn): use shell if a commandline contain
- double-quote character.
- * win32/win32.c (is_internal_cmd): similar, use shell if a commandline
- contain caret character.
+ * process.c (rb_spawn_process): prog variable is not used for Unix.
- * test/ruby/test_system.rb (TestSystem#test_system_at): fix
- wrong test case. if system() invoke a command by using shell,
- system() never return nil. Also, "" quotation must not appear
- twice in a command line.
+Wed Jun 6 00:20:37 2012 Tanaka Akira <akr@fsij.org>
-Mon Feb 28 17:36:57 2011 Tanaka Akira <akr@fsij.org>
+ * internal.h (rb_exec_arg_init): change return type to void.
- * ext/openssl/ossl_pkcs7.c: parenthesize macro arguments.
+ * process.c (rb_exec_arg_init): don't return a value.
+ (rb_exec_arg_prepare): ditto.
+ (rb_spawn_process): don't take the prog argument. extract the
+ information from earg.
+ (rb_spawn_internal): follow rb_spawn_process change.
+ (rb_f_spawn): ditto.
-Mon Feb 28 16:48:42 2011 Tanaka Akira <akr@fsij.org>
+ * io.c (pipe_open): don't take the prog argument. extract the
+ information from eargp.
+ (pipe_open_v): follow pipe_open change.
+ (pipe_open_s): ditto.
- * ext/openssl/ossl_pkcs12.c: parenthesize macro arguments.
+Tue Jun 5 23:51:33 2012 Tanaka Akira <akr@fsij.org>
-Mon Feb 28 16:28:15 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * internal.h (rb_exec_arg): use union to represent command invocation
+ with/without shell.
- * string.c (tr_trans): when the hash for multibyte repl is empty,
- tr is inverse mode, and a character doesn't much the table, the
- character should be replaced by last replacement. Bug #4449
+ * process.c: follow the rb_exec_arg change.
-Mon Feb 28 16:38:56 2011 Tanaka Akira <akr@fsij.org>
+ * io.c (pipe_open): ditto.
- * ext/openssl/ossl_ocsp.c: parenthesize macro arguments.
+Tue Jun 5 22:28:46 2012 Tanaka Akira <akr@fsij.org>
-Mon Feb 28 13:02:15 2011 Danial Pearce <github@tigris.id.au>
+ * internal.h: rb_exec_arg and related stuff moved from intern.h
- * lib/tempfile.rb: Fix example file paths in docs for tempfile.
- https://github.com/ruby/ruby/pull/5
+ * include/ruby/intern.h (rb_proc_exec_n): removed.
-Mon Feb 28 12:56:18 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
+Tue Jun 5 21:57:22 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl/ossl_cipher.c (ossl_cipher_init): typo fix.
- https://github.com/ruby/ruby/pull/8
+ * process.c (rb_exec_arg_fixup): allocate a temporary buffer for
+ run_exec_dup2 here because it should be async-signal-safe.
+ (run_exec_dup2): use the temporary buffer.
+ (run_exec_dup2_tmpbuf_size): new function.
-Mon Feb 28 12:28:13 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * include/ruby/intern.h (rb_exec_arg): add dup2_tmpbuf field.
- * ext/date/date_core.c (datetime_s_now): localtime() and localtime_r()
- required time_t pointer as 1st parameter, and tv_sec member of struct
- timeval is long.
+Tue Jun 5 20:13:15 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Feb 28 11:57:40 2011 Shota Fukumori <sorah@tubusu.net>
+ * object.c (rb_obj_init_copy): should check if trusted too.
- * test/testunit/test_parallel.rb: Temporally disable test on Windows.
+Tue Jun 5 19:59:13 2012 Tanaka Akira <akr@fsij.org>
-Mon Feb 28 07:28:35 2011 Shota Fukumori <sorah@tubusu.net>
+ * process.c (strtok): declaration removed because it is not used.
- * lib/test/unit.rb(Test::Unit::Runner#after_worker_quit):
- method name more be natural English.
+Tue Jun 5 19:33:51 2012 Tanaka Akira <akr@fsij.org>
- * lib/test/unit.rb(Test::Unit::Runner::Worker.launch):
- IO.sync doesn't need. Should use "b" for mode.
+ * process.c (proc_spawn): don't detect simple command line here
+ because rb_exec_fillarg already did.
-Sun Feb 27 21:59:37 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Tue Jun 5 19:21:10 2012 Tanaka Akira <akr@fsij.org>
- * test/ruby/test_system.rb (TestSystem#test_system_redirect_win):
- add test for system().
+ * process.c (rb_exec_fillarg): bail out a loop eagerly.
-Sun Feb 27 18:00:09 2011 Shota Fukumori <sorah@tubusu.net>
+Tue Jun 5 19:15:14 2012 Tanaka Akira <akr@fsij.org>
- * lib/test/unit.rb: Refactoring; Worker never use Hash for internal
- storage.
+ * process.c: add comments about async-signal-safe.
- * lib/test/unit.rb: Never use Kernel#spawn. Use IO.popen instead.
+ * io.c: ditto.
-Sun Feb 27 13:16:48 2011 Tanaka Akira <akr@fsij.org>
+Tue Jun 5 09:25:10 2012 Eric Hodel <drbrain@segment7.net>
- * ext/openssl/ossl_ns_spki.c: parenthesize macro arguments.
+ * io.c: Edited documentation for IO and File open and new and
+ Kernel#open for consistency and clarity.
-Sat Feb 26 17:07:53 2011 Tadayoshi Funaba <tadf@dotrb.org>
+Mon Jun 4 21:53:56 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/date.rb: [Feature #4257]
+ * win32/win32.c (rb_w32_sysinit): let the system not display the
+ critical-error-handler message box and the Windows Error Reporting
+ dialog. [ruby-core:45389] [Bug #6535]
- * ext/date/extconf.rb: new
+Mon Jun 4 19:36:25 2012 Tanaka Akira <akr@fsij.org>
- * ext/date/date_core.c: new
+ * process.c (rb_exec_fillarg): allocate one more element before
+ beginning in argv_str for try_with_sh.
-Sat Feb 26 16:10:23 2011 Shota Fukumori <sorah@tubusu.net>
+ * internal.h (ARGVSTR2ARGC): adjust for the above change.
+ (ARGVSTR2ARGV): ditto.
- * lib/test/unit.rb: --jobs-status won't puts over 2 lines.
+Mon Jun 4 19:17:06 2012 Tanaka Akira <akr@fsij.org>
- * test/testunit/test_parallel.rb: Fix test for above.
+ * internal.h (ARGVSTR2ARGC): defined.
+ (ARGVSTR2ARGV): defined.
- * lib/test/*: refactoring.
+ * process.c (proc_exec_v): use ARGVSTR2ARGV.
+ (rb_spawn_process): use ARGVSTR2ARGC and ARGVSTR2ARGV.
-Sat Feb 26 07:10:05 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+ * io.c (pipe_open): use ARGVSTR2ARGV.
- * ext/psych/lib/psych/scalar_scanner.rb: fix parsing timezone's whose
- whose format is (+/-)hhmm. Thanks Goncalo Silva!
+Mon Jun 4 16:13:00 2012 Koichi Sasada <ko1@atdot.net>
- * test/psych/test_scalar_scanner.rb: test for bug.
+ * vm_insnhelper.h: remove magical code "lfp[0] & 0x02".
+ Current VM doesn't use this bit.
-Thu Feb 24 23:02:55 2011 Tanaka Akira <akr@fsij.org>
+ * vm_core.h (RUBY_VM_GET_BLOCK_PTR): added.
- * ext/openssl/ossl_hmac.c: parenthesize macro arguments.
+ * eval.c (rb_block_given_p): use RUBY_VM_GET_BLOCK_PTR().
-Thu Feb 24 22:53:10 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_eval.c (rb_f_block_given_p): ditto.
+
+Mon Jun 4 15:39:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (constat_apply): apply VT100 functions.
+ [ruby-core:44958] [Feature #6418]
+
+ * win32/win32.c (constat_parse): parse some VT100 escape sequence.
+
+Mon Jun 4 14:06:12 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * process.c (rb_exec_err): should preserve errno.
+
+Mon Jun 4 13:10:11 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/dl/test_c_{struct_entry,union_entity}.rb: broken require.
+
+Mon Jun 4 12:01:21 2012 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/test_backtrace.rb: fix test.
+ Windows path includes `:' character.
+
+Mon Jun 4 11:42:39 2012 Koichi Sasada <ko1@atdot.net>
+
+ * vm_core.h (rb_location_t): fix type and field name.
+ (1) rename rb_location_t to rb_iseq_location_t.
+ (2) rename field names of rb_iseq_location_t to adjust
+ RubyVM::Backtrace::Location methods.
+ (2-1) filename -> path
+ (2-2) filepath -> absolute_path
+ (2-3) basename -> base_label
+ (2-4) name -> label
+ (3) rename filed name rb_iseq_location_t#line_no to
+ rb_iseq_location_t#first_lineno to clear purpose of this field.
+ (4) The field names rb_binding_t#(filename|line_no) are also renamed
+ to rb_binding_t#(path|first_lineno).
+
+ * compile.c: apply above changes.
+
+ * iseq.c: ditto.
+
+ * proc.c: ditto.
+
+ * vm*.c: ditto.
+
+Mon Jun 4 11:40:28 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * marshal.c (r_object0): also load TYPE_USRMARSHAL, TYPE_DATA using
+ compatible loader.
+
+Mon Jun 4 11:33:42 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * process.c (rb_run_exec_options_err): restore save_env() call for
+ non-fork environments.
+
+ * process.c (rb_exec_err): restore environments after the failure of
+ exec to fix [ruby-core:44093] [Bug #6249] on non-fork environments
+
+Mon Jun 4 10:42:04 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * io.c (pipe_open): follow up changes in r35889.
+
+ * process.c (proc_spawn_n): now uses char ** instead of VALUE *.
+
+ * process.c (rb_spawn_process): prog is now VALUE of String, not char *.
+
+Mon Jun 4 06:12:43 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * marshal.c (r_object0): remove old warning for _alloc.
+
+Mon Jun 4 04:24:06 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * marshal.c: experimental test aborted.
+ * complex.c: ditto.
+ * rational.c: ditto.
+ * include/ruby/intern.h: ditto.
+
+Mon Jun 4 00:45:18 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_spawn_process): fix for Windows. not tested.
+
+Mon Jun 4 00:11:51 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_proc_exec_e): don't use ISSPACE(). \f, \r and \v
+ are not word separator in Bourne shell.
+
+Sun Jun 3 23:47:30 2012 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/intern.h (rb_exec_arg): remove argc and argv fields.
+ add use_shell, argv_str and argv_buf fields.
+
+ * process.c (rb_proc_exec_e): don't split shell command line arguments
+ here to avoid memory allocation in a child process.
+ (rb_exec_fillarg): split shell command line arguments here.
+ (proc_exec_v): takes argv_str argument instead of argv.
+ (rb_proc_exec_ne): removed.
+ (rb_proc_exec_n): removed.
+ (rb_run_exec_options_err): don't initialize the removed fields.
+ (rb_exec_err): don't initialize the removed fields.
+ call proc_exec_v directly instead of rb_proc_exec_ne.
+ (rb_spawn_process): use use_shell field.
+
+Sun Jun 3 21:53:00 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * GPL: update text of GPLv2. [ruby-core:44488] [Bug #6328]
+ http://www.gnu.org/licenses/gpl-2.0.txt
+
+Sun Jun 3 21:22:52 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_exec_getargs): remove rb_exec_arg argument.
+
+Sun Jun 3 21:14:26 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * marshal.c: calls directly rb_{Complex,Rational}_marshal_load().
+ But now disabled. [experimental]
+ * complex.c: followed the above.
+ * rational.c: ditto.
+ * include/ruby/intern.h: ditto.
- * common.mk (love): for the birthday.
+Sun Jun 3 21:18:17 2012 Tanaka Akira <akr@fsij.org>
-Thu Feb 24 22:51:54 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * process.c (rb_check_argv): use rb_str_new_frozen instead of
+ rb_str_new4.
- * vm.c (ruby_vm_destruct): run vm exit hooks after all objects are
- destructed.
+Sun Jun 3 20:10:52 2012 Tanaka Akira <akr@fsij.org>
-Thu Feb 24 14:40:33 2011 Shota Fukumori <sorah@tubusu.net>
+ * process.c (rb_proc_exec_e): extended version of rb_proc_exec() to
+ call execle().
+ (rb_proc_exec): use rb_proc_exec_e().
+ (rb_exec_err): use rb_proc_exec_e().
- * ChangeLog (vim): Modeline for vim
+Sun Jun 3 19:47:18 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Feb 24 13:39:25 2011 Shota Fukumori <sorah@tubusu.net>
+ * thread.c (vm_living_thread_num): suppress a warning.
- * common.mk: Use $RUNRUBY for worker process.
+Sun Jun 3 17:23:52 2012 Tanaka Akira <akr@fsij.org>
- * lib/test/unit.rb: Fix bug.
+ * use execve() to preserve environment variables when exec method is
+ failed. [ruby-core:44093] [ruby-trunk - Bug #6249]
- * lib/test/unit.rb: @options[:ruby](@opts[:ruby]) is now Array.
+ * include/ruby/intern.h (rb_exec_arg): add envp_str and envp_buf field
+ to store envp of execve().
- * test/testunit/parallel.rb: Fix for above.
+ * process.c (proc_exec_v): takes envp_str as an argument and use it
+ for execve().
+ (rb_proc_exec_ne): extended version of rb_proc_exec_n().
+ (rb_proc_exec_n): use rb_proc_exec_ne().
+ (rb_proc_exec): follow proc_exec_v() change.
+ (fill_envp_buf_i): new function.
+ (rb_exec_arg_fixup): set up envp_str and envp_buf.
+ (save_env_i): removed.
+ (save_env): removed.
+ (rb_run_exec_options_err): don't modify environment variables.
+ (rb_exec_err): use rb_proc_exec_ne().
-Thu Feb 24 10:05:55 2011 Shota Fukumori <sorah@tubusu.net>
+Sun Jun 3 16:33:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/testunit/tests_for_parallel/misc.rb: Fix bug in r30947.
+ * marshal.c: revert r35879 "now marshal_{load|dump} are external."
- * lib/test/unit.rb, lib/test/unit/assertions.rb: For this test.
+ * complex.c (nucomp_marshal__{dump,load}): should use rb_marshal_{dump,load}.
-Wed Feb 23 23:07:38 2011 Shota Fukumori <sorah@tubusu.net>
+ * rational.c (nurat_marshal__{dump,load}): ditto.
- * test/testunit/test_parallel.rb, test/testunit/parallel/*:
- Test for r30939.
+Sun Jun 3 14:13:58 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * lib/test/unit.rb: For test.
+ * ext/date/date_core.c: checks whether the object is frozen or not.
- * lib/test/parallel.rb: For test.
+Sun Jun 3 14:00:51 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * lib/test/unit/testcase.rb: For test.
+ * complex.c: wrote Complex#_dump and Complex::load. But now
+ disabled (due to compatibility) [experimental].
-Wed Feb 23 22:05:13 2011 Tanaka Akira <akr@fsij.org>
+ * rational.c: wrote Rational#_dump and Rational::load. ditto.
- * ext/openssl/ossl_engine.c: parenthesize macro arguments.
+Sun Jun 3 10:23:32 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Tue Feb 22 23:15:17 2011 Shota Fukumori <sorah@tubusu.net>
+ * complex.c (nucomp_marshal_load): [ruby-core:45394]
+ * rational.c (nurat_marshal_load): ditto.
- * lib/test/unit.rb: Fix --ruby option doesn't effect.
+Sun Jun 3 03:15:46 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/test/unit.rb: Fix typo.
+ * regparse.c (onig_number_of_names): suppress a warning.
-Tue Feb 22 21:39:28 2011 Tanaka Akira <akr@fsij.org>
+Sun Jun 3 01:36:52 2012 Koichi Sasada <ko1@atdot.net>
- * ext/openssl/ossl_digest.c: parenthesize macro arguments.
+ * vm_backtrace.c: change names.
+ (1) Class name: RubyVM::FrameInfo -> RubyVM::Backtrace::Location.
+ (2) Method name: RubyVM::FrameInfo.caller ->
+ Kernel.caller_locations.
+ (3) Instance methods of
+ RubyVM::FrameInfo (RubyVM::Backtrace::Location)
+ (3-1) name -> label
+ (3-2) basename -> base_label (basename is confusing with
+ File.basename)
+ (3-3) line_no -> lineno (We have already similar name
+ File#lineno, commented by kou [ruby-dev:45686]).
+ (3-4) filename -> path.
+ (3-5) filepath -> absolute_path.
+ (3-5) iseq -> removed (we will make other APIs to access iseq
+ and other information of frame for debugging).
-Tue Feb 22 14:34:26 2011 Shota Fukumori <sorah@tubusu.net>
+ * test/ruby/test_backtrace.rb: apply above changes.
+ And apply comment from kou [ruby-dev:45686].
- * lib/test/unit.rb: Fix merging miss.
+Sun Jun 3 00:49:11 2012 Koichi Sasada <ko1@atdot.net>
-Tue Feb 22 12:27:26 2011 Shota Fukumori <sorah@tubusu.net>
+ * common.mk: fix to build vm_backtrace.c only itself (vm_backtrace.c
+ is no longer included from vm.c). I hope this separation reduce
+ compile time of vm.c.
- * lib/test/unit.rb: Add new options; --jobs,-j,--ruby,--jobs-status,
- --no-retry.
- [Feature #4415] [ruby-dev:43226],[ruby-dev:43222],[ruby-core:35294]
+ * internal.h: ditto.
- * lib/test/unit/parallel.rb: Used at test/unit --jobs(-j) option.
+ * vm.c, vm_core.h, vm_dump.c, vm_eval.c: ditto.
- * test/csv/test_serialization.rb: test/unit parallel running ready.
+ * vm_eval.c: some functions (callee, etc) moved to vm_backtrace.c.
- * test/rake/test_file_task.rb: test/unit parallel running ready.
+Sun Jun 3 00:20:53 2012 Koichi Sasada <ko1@atdot.net>
-Tue Feb 22 06:09:10 2011 Eric Hodel <drbrain@segment7.net>
+ * vm_backtrace.c: added. Separate backtrace related functions to
+ this file.
- * ext/syslog/syslog.c: Apply documentation patch from mathew murphy.
- [Bug #4149]
+ * vm.c, common.mk: ditto.
-Tue Feb 22 03:09:10 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+Sat Jun 2 18:09:02 2012 Akinori MUSHA <knu@iDaemons.org>
- * ext/psych/lib/psych.rb: increase Psych to 1.1.0 for help with
- debugging.
+ * lib/ipaddr.rb: Inhibit zero-filled octets in an IPv4 address in
+ all platforms. [ruby-dev:45671]
-Tue Feb 22 03:04:46 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+ * lib/ipaddr.rb: Allow the x:x:x:x:x:x:d.d.d.d form not limited to
+ IPv4 mapped/compatible addresses. This change also makes it
+ possible for the parser to understand IPv4 mapped and compatible
+ IPv6 addresses in non-compressed form.
- * ext/psych/lib/psych/streaming.rb: refactor streaming methods to a
+ * lib/ipaddr.rb: Stop exposing IPSocket.valid*? methods which were
+ only usable on non-IPv6-ready platforms.
+
+Sat Jun 2 16:59:00 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_enc_cr_str_buf_cat): don't reset coderange as unknown.
+ the condition 'ptr_a8 && str_cr != ENC_CODERANGE_7BIT' means not
+ unknown, str is also ASCII-8BIT because str_encindex == ptr_encindex,
+ and nont (str_cr == ENC_CODERANGE_UNKNOWN) and
+ str_cr != ENC_CODERANGE_7BIT means str_cr is valid because ASCII-8BIT
+ can't be broken. [ruby-dev:45688] [Bug #6509]
+
+Sat Jun 2 07:04:48 2012 Eric Hodel <drbrain@segment7.net>
+
+ * doc/re.rdoc (Performance): Replaced incorrect example of reducing
+ backtracking through anchoring with reduced backtracking through a
+ range. [ruby-trunk - Bug #6525]
+
+Sat Jun 2 06:34:15 2012 Eric Hodel <drbrain@segment7.net>
+
+ * doc/re.rdoc (Performance): Removed useless sample output from final
+ performance example and switched from #match to #=~ for consistency.
+ [ruby-trunk - Bug #6524]
+
+Fri Jun 1 09:30:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * object.c (class_or_module_required): extract check for class or
module.
- * ext/psych/lib/psych/stream.rb: extracted streaming specific methods
- to a module.
- * ext/psych/lib/psych/json/stream.rb: JSON stream inherits from
- JSONTree and includes streaming methods.
- * ext/psych/lib/psych/visitors/json_tree.rb: JSON does not support
- object references, so remove object reference testing when building
- JSON trees.
-
-Tue Feb 22 02:41:51 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-
- * ext/psych/lib/psych/visitors/yaml_tree.rb (accept): use Hash#key?
- when looking up object references to err on the side of cache
- misses.
-
-Mon Feb 21 10:58:39 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-
- * ext/psych/lib/psych/json/yaml_events.rb: refactoring JSON event
- handling methods to a module for reuse.
- * ext/psych/lib/psych/json/tree_builder.rb: AST builder uses JSON
- event methods.
- * ext/psych/lib/psych/json/stream.rb: stream emitter uses JSON event
- methods.
-Mon Feb 21 10:54:29 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+Fri Jun 1 08:50:47 2012 Eric Hodel <drbrain@segment7.net>
- * ext/psych/lib/psych/json/stream.rb: do not emit custom tags in maps
- or sequences when emitting JSON.
- * ext/psych/lib/psych/json/tree_builder.rb: do not emit custom tags in
- sequences when emitting JSON.
- * test/psych/json/test_stream.rb: tests for custom stream emits.
- * test/psych/test_json_tree.rb: tests for JSON emits.
+ * array.c: Updated Array documentation formatting. Patch by Zachary
+ Scott. [ruby-trunk - Feature #6517]
-Mon Feb 21 10:05:10 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+Fri Jun 1 06:57:10 2012 Eric Hodel <drbrain@segment7.net>
- * ext/psych/lib/psych/json/ruby_events.rb: DRY up ruby event handling
- for JSON.
- * ext/psych/lib/psych/visitors/json_tree.rb: use ruby events module
- * ext/psych/lib/psych/json/stream.rb: ditto
+ * ext/dl/lib/dl/struct.rb (DL::CStructEntity#set_ctypes): Refactored
+ #set_ctypes using newer ruby features to simplify its implementation.
+ * test/dl/test_c_struct_entry.rb (class DL): Test to verify
+ refactoring.
-Mon Feb 21 10:01:01 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+Fri Jun 1 06:40:25 2012 Eric Hodel <drbrain@segment7.net>
- * ext/psych/lib/psych/json/stream.rb: fix JSON stream emits to use
- double quotes during stream.
- * test/psych/json/test_stream.rb: tests to reflect changes.
+ * object.c (Init_Object): Restored Kernel documentation based on
+ Pickaxe book documentation. Patch by Zachary Scott.
+ [ruby-trunk - Feature #6521]
-Mon Feb 21 00:38:56 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Fri Jun 1 06:29:42 2012 Eric Hodel <drbrain@segment7.net>
- * test/ruby/test_system.rb (TestSystem#test_system_at):
- add testcase for bug4396.
+ * object.c (rb_equal): Let Object be a link in #=== documentation.
+ Patch by Zachary Scott. [ruby-trunk - Feature #6518]
-Sun Feb 20 19:59:32 2011 Tanaka Akira <akr@fsij.org>
+Thu May 31 09:27:06 2012 Eric Hodel <drbrain@segment7.net>
- * ext/openssl/ossl_cipher.c: parenthesize macro arguments.
+ * ext/dl/lib/dl/struct.rb (DL::CStructEntity::size): Refactored ::size
+ to remove unused variables and simplify using newer ruby features.
+ * test/dl/test_c_struct_entry.rb: Test to validate refactoring
-Sun Feb 20 16:26:45 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu May 31 08:40:34 2012 Eric Hodel <drbrain@segment7.net>
- * thread.c (exec_recursive): prevent temporary objects from GC.
+ * ext/dl/lib/dl/struct.rb (DL::CUnionEntity#set_ctypes): Refactored
+ #set_types to reuse DL::CUnionEntity::size
+ * test/dl/test_c_union_entity.rb: Added test
- * prevent temporary objects from GC, and should not use
- RSTRING_PTR() for function calls since it evaluates the argument
- a couple of times.
+Thu May 31 08:20:14 2012 Eric Hodel <drbrain@segment7.net>
-Sun Feb 20 16:22:53 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/dl/lib/dl/struct.rb (DL::CUnionEntity::size): Fixed ::size to
+ return the size of the union.
+ * test/dl/test_c_union_entity.rb: Test for DL::CUnionEntity::size
- * file.c (rb_file_flock): use rb_thread_io_blocking_region for the
- time being.
+Thu May 31 07:45:43 2012 Eric Hodel <drbrain@segment7.net>
-Sun Feb 20 05:33:17 2011 Ryan Davis <ryand-ruby@zenspider.com>
+ * ext/dl: Added documentation. Patch by Vincent Batts.
+ [ruby-trunk - Bug #6496]
- * lib/minitest/*.rb: Imported minitest 2.0.2 r6207.
- * test/minitest/*: ditto
+Wed May 30 16:30:00 2012 Kenta Murata <mrkn@cookpad.com>
-Sun Feb 20 02:14:09 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * ext/bigdecimal/lib/bigdecimal/jacobian.rb,
+ ext/bigdecimal/lib/bigdecimal/newton.rb:
+ fix documentation comments.
+ Patch by alperakgun from github.com/shyouhei/ruby/pull/8
- * signal.c (sig_trap): avoid pthread_sigmask(xx, &mask, &mask) usage
- because FreeBSD don't permit it. If it's used, it behave as
- pthread_sigmask(xx, NULL, &mask).
+Wed May 30 16:20:00 2012 Kenta Murata <mrkn@cookpad.com>
- * signal.c (init_sigchld): ditto.
+ * ext/bigdecimal/lib/bigdecimal/jacobian.rb (Jacobian#dfdxi):
+ fix jacobian to get stuck in an infinite loop when a solution is not
+ found due to forget to increment nRetry counter.
+ Patch by alperakgun from github.com/shyouhei/ruby/pull/8
-Sun Feb 20 00:46:51 2011 Tanaka Akira <akr@fsij.org>
+Wed May 30 10:58:31 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_bn.c: parenthesize macro arguments.
+ * time.c (utc_offset_arg): utc offset can be precision in seconds.
+ e.g. old Europe/Lisbon (c.f. [ruby-dev:40066])
-Sat Feb 19 22:37:42 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+Wed May 30 06:20:29 2012 Eric Hodel <drbrain@segment7.net>
- * vm_insnhelper.c (vm_check_if_namespace): guard temporary object
- from GC.
+ * error.c (exc_set_backtrace): Updated documentation to indicate
+ set_backtrace allows a string as well as an array of strings.
+ [ruby-trunk - Bug #6501]
-Sat Feb 19 06:36:27 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+Tue May 29 17:28:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/test/unit.rb: partial revert of r30849. [ruby-core:32864]
+ * strftime.c (rb_strftime_with_timespec): support GNU extension triple
+ colons modifier. [EXPERIMENTAL]
- * test/testunit/test_rake_integration.rb: adding an integration test
- with the rake loader to prevent regressions.
+ * strftime.c (rb_strftime_with_timespec): check conversion with locale
+ modifier.
-Fri Feb 18 19:31:31 2011 Shugo Maeda <shugo@ruby-lang.org>
+ * strftime.c (rb_strftime_with_timespec): colons are valid only for
+ 'z' and must come just before it.
- * lib/fileutils.rb (FileUtils::remove_entry_secure): there is a
- race condition in the case where the given path is a directory,
- and some other user can move that directory, and create a
- symlink while this method is executing.
- Reported by: Nicholas Jefferson <nicholas at pythonic.com.au>
+Mon May 28 16:56:55 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Feb 18 00:28:39 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+ * lib/test/unit.rb (Test::Unit::Runner#_prepare_run): StatusLineOutput
+ needs job_status to be :replace.
- * compile.c (get_exception_sym2type): guard temporary object from GC.
+Mon May 28 13:35:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Feb 17 23:54:29 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+ * common.mk (do-install-*): fix dependencies. based on the patch by
+ nagachika at [ruby-dev:45683]. [Bug #6506]
- * iseq.c (prepare_iseq_build): initialize iseq_compile_data::err_info
- with nil. this fix exception in rb_iseq_load().
+Mon May 28 12:03:04 2012 Narihiro Nakamura <authornari@gmail.com>
-Thu Feb 17 22:32:35 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+ * gc.c (obj_free): doesn't free a method table if it doesn't
+ exist. [ruby-dev:44436]
+ * test/ruby/test_gc.rb (class TestGc): added the test case for
+ this issue.
- * test/ruby/test_marshal.rb (test_marshal_dump_extra_iv):
- fix a typo of local variable. [Bug #3720] [ruby-dev:42083]
+Sun May 27 23:37:48 2012 Koichi Sasada <ko1@atdot.net>
-Thu Feb 17 21:32:53 2011 Tanaka Akira <akr@fsij.org>
+ * benchmark/bm_vm1_lvar_init.rb: added.
+ This benchmark measures a initialize time of non-used variable.
- * ext/openssl/ossl.h: parenthesize macro arguments.
+ * benchmark/bm_vm1_lvar_set.rb: added.
+ This benchmark measures a local variables initialization time.
-Wed Feb 16 20:37:48 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * benchmark/bm_vm2_bigarray.rb: added.
+ This benchmark mesures a big array literal creation time.
- * eval_jump.c (rb_exec_end_proc): changed at_exit and END proc
- evaluation order. [Bug #4400] [ruby-core:35237]
- * eval_jump.c (rb_mark_end_proc): ditto.
+ * benchmark/bm_vm2_bighash.rb: added.
+ This benchmark mesures a big hash literal creation time.
- * test/ruby/test_beginendblock.rb (TestBeginEndBlock#test_nested_at_exit):
- added a test for nested at_exit.
- * test/ruby/test_beginendblock.rb (TestBeginEndBlock#test_beginendblock):
- changed the test to adopt new spec.
+ * benchmark/bm*: change notation "i=0" to "i = 0".
-Wed Feb 16 20:17:06 2011 Tanaka Akira <akr@fsij.org>
+Sun May 27 13:33:26 2012 Koichi Sasada <ko1@atdot.net>
- * ext/openssl/openssl_missing.h: parenthesize macro arguments.
+ * benchmark/driver.rb: fix to continue benchmarks when
+ an error is occurred.
-Tue Feb 15 21:37:45 2011 Tanaka Akira <akr@fsij.org>
+Sun May 27 11:27:50 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/gdbm/gdbm.c: parenthesize macro arguments.
+ * lib/test/unit.rb (Test::Unit::Runner#_prepare_run): fix operator
+ precedence, so that platform and TERM should be counted.
-Tue Feb 15 20:34:53 2011 Tanaka Akira <akr@fsij.org>
+Sun May 27 10:02:33 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * array.c (ary_join_1): fix array size.
+ * ext/date/date_strftime.c: allows %Ok and %Ol.
-Tue Feb 15 19:43:23 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Sun May 27 09:29:20 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * configure.in: fix and resubmit r30621. [ruby-dev:43203]
+ * ext/date/date_core.c: modified doc.
-Tue Feb 15 15:41:30 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Sat May 26 19:04:34 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * array.c (array_join): copy the encoding of the first element as
- an initial encoding.
+ * ext/date/date_core.c: added description.
- * array.c (array_join_0): ditto.
+Sat May 26 18:14:57 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * array.c (array_join_1): ditto.
+ * ext/date/date_strftime.c: reduced the code.
- * array.c (inspect_ary): ditto.
+Sat May 26 18:08:59 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * array.c (array_join_1): add an argument to check the appending is
- first one or not.
+ * time.c: modified doc.
+ * ext/date/date_core.c: ditto.
-Tue Feb 15 15:40:53 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Sat May 26 17:05:45 2012 Koichi Sasada <ko1@atdot.net>
- * hash.c (inspect_i): copy the encoding of the first key as
- an initial encoding.
+ * vm.c (backtrace_*): change type of lev and n from size_t to int.
+ Also set type of rb_backtrace_t#backtrace_size to int.
+ A patch from nobu.
-Mon Feb 14 15:00:16 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * vm_eval.c: ditto.
- * array.c (inspect_ary): don't taint the inspected result of a
- recursive array.
+Sat May 26 16:26:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Feb 15 15:43:29 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * file.c (realpath_rec): UNC prefix does not end with path separator,
+ so new separator is needed after it.
- * encoding.c (rb_enc_compatible): change the rule for empty strings:
- remove the special treatment of the US-ASCII encoded empty string.
- Now Encoding.compatible? usually respect the encoding of the
- receiver.
+Sat May 26 15:29:22 2012 Koichi Sasada <ko1@atdot.net>
-Tue Feb 15 15:39:37 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/ruby/test_backtrace.rb (test_caller_lev):
+ decrease recursion size.
- * string.c (rb_enc_cr_str_buf_cat): remove special treatment of
- ASCII-8BIT receivers.
+Sat May 26 13:50:48 2012 Koichi Sasada <ko1@atdot.net>
- * string.c (str_gsub): set initial encoding of the buffer as the
- same of the receiver. [ruby-core:35141]
+ * NEWS: add Kernel#caller's second argument.
-Tue Feb 15 09:49:33 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Sat May 26 13:40:29 2012 Koichi Sasada <ko1@atdot.net>
- * test/ruby/test_system.rb (TestSystem#test_system_at): use findstr
- command instead of find command, because the latter is confusing
- another famous Unix command.
+ * vm.c (RubyVM::FrameInfo): add a class to access each frame
+ information. You don't need to parse strings from caller().
+ FrameInfo has the following methods:
+ FrameInfo#name: method name, class name, etc with decorations.
+ FrameInfo#basename: name without decorations.
+ FrameInfo#line_no: line number.
+ FrameInfo#filename: file name.
+ FrameInfo#filepath: full filepath.
+ FrameInfo#iseq: iseq if it is iseq frame (defined by ruby script)
+ FrameInfo#to_s: return caller() method style string.
+ RubyVM::FrameInfo.caller(n, lev) returns array of FrameInfo objects.
+ The name "RubyVM::FrameInfo.caller" is long and ambiguous (it is
+ confusing with Kernel::caller() method), we need to change the name
+ before Ruby 2.0 release. Good names or comments are welcome.
-Mon Feb 14 23:01:19 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+ * test/ruby/test_backtrace.rb: add a test for above change.
- * thread.c (rb_thread_io_blocking_region): reset th->waiting_fd
- after blocking region, because remaining waiting_fd might
- cause unnecessary IOError.
+Sat May 26 12:18:09 2012 Koichi Sasada <ko1@atdot.net>
-Mon Feb 14 21:06:50 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
+ * vm.c (frame_info_to_str): add `break'.
- * configure.in: revert r30621. That revision introduced mkmf test
- failures and it turned out to be OK to revert. [ruby-dev:43203]
+ * vm.c (backtrace_object): remove lev and n parameter.
+ backtrace_object always returns all of backtrace information.
-Mon Feb 14 21:04:01 2011 Tanaka Akira <akr@fsij.org>
+ * vm.c (rb_backtrace_to_str_ary): fix to use backtrace_object().
+ This change improve performance of caller(lev, n).
- * ext/fiddle/conversions.h: parenthesize macro arguments.
+ * benchmark/bm_vm3_backtrace.rb: added to check above improvement.
+ FYI: measurement on my laptop, 1.9.3p229 needs 5.125 sec,
+ and current trunk only needs 0.299sec.
-Mon Feb 14 18:41:47 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Sat May 26 11:05:09 2012 Koichi Sasada <ko1@atdot.net>
- * win32/setup.mak (USE_RUBYGEMS): fixed r30835. It didn't work on
- mswin32 port. If you changed win32/configure.bat, you should change
- setup.mak too.
+ * vm.c (rb_frame_info_t): keep previous ISEQ frame info for CFUNC
+ frame info. And fix to cache a calculated line_no of ISEQ frame
+ info.
-Mon Feb 14 17:28:34 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Sat May 26 09:54:53 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * test/ruby/test_system.rb (TestSystem#test_system_at):
- added test. [ruby-core:35218] (#4393)
+ * ext/openssl/ossl_ssl.c: Allow disabling client-side renegotiation.
+ * test/openssl/test_ssl.rb: Simple tests for this.
-Mon Feb 14 13:15:35 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ Client-side renegotiation is still considered problematic, even
+ when used in the context of secure renegotiation (RI, RFC 5746).
+ The changes allow users to either completely disable client
+ renegotiation on the server, or to specify a maximum number of
+ handshakes allowed in total. The number of total handshakes is
+ counted in a callback set as SSL_set_info_callback. If the
+ maximum number of handshakes is exceeded an error will be raised
+ We do not support renegotiation in the OpenSSL extension, therefore
+ this feature can only be tested externally.
+ The feature is opt-in, the default setting will be to allow
+ unlimited client renegotiation, as was the case before.
- * win32/win32.c (is_internal_cmd): if the first char of prog is '@',
- execute it via shell. [ruby-core:35218] (#4393)
+Fri May 25 23:38:58 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Mon Feb 14 10:33:45 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/openssl/test_ssl.rb: Clarify the intention of errors to be
+ expected. Two errors are possible when connection is refused due
+ to a protocol version that was explicitly disallowed,
+ OpenSSL::SSL::SSLError or Errno::ECONNRESET, depending on the
+ OpenSSL version in use.
- * lib/test/unit.rb: revert r30863, because it causes too many noise.
+Fri May 25 22:19:40 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Mon Feb 14 07:34:55 2011 Tanaka Akira <akr@fsij.org>
+ * ext/openssl/ossl_ssl.c: Revert r35583
+ * test/openssl/test_ssl.rb: Handle ECONNRESET in code instead to avoid
+ the test failing in Ruby CI [1]
- * ext/curses/curses.c: parenthesize macro arguments.
+ [1] http://u64.rubyci.org/~chkbuild/ruby-trunk/log/20120507T190102Z.log.html.gz#test-all
-Sun Feb 13 19:41:47 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri May 25 19:51:36 2012 Koichi Sasada <ko1@atdot.net>
- * lib/test/unit.rb (Test::Unit::RequireFiles#non_options): skip
- test suites failed to load instead of mere messages.
+ * vm_eval.c (rb_f_caller): caller() method accepts second optional
+ argument `n' which specify how many frames should return.
+ For example, `caller(0, 1)' returns only one frame information
+ which calls caller() method. If there are less than n frame
+ information, then all frame information are returned. If n is 0,
+ then always return [].
+ This fix is part of [ruby-dev:42345] [Ruby 1.9-Feature#3917].
+ However, performance and features are not enough.
+ RDoc is also not available.
-Sun Feb 13 09:56:44 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_backtrace.rb: add a test for above.
- * test/openssl/test_config.rb (OpenSSL#test_freeze): fix error
- message assertion.
+Fri May 25 17:05:07 2012 Koichi Sasada <ko1@atdot.net>
- * test/io/nonblock/test_flush.rb (TestIONonblock#flush_test):
- return true to finish the test.
+ * vm.c (oldbt_init, vm_backtrace_str_ary): arg->data should
+ be initialized before calling `backtrace_each()'.
- * test/syck/test_string.rb (Syck::TestString#test_non_binary_string):
- use assert_not instead of refute, unless required minitest
- explicitly.
+Fri May 25 16:11:27 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/test_prime.rb (TestPrime::sieve.Integer): ditto.
+ * trunk/ext/-test-/printf/printf.c: change function names because of
+ conflict with msvcrt. fixed build error of mswin.
- * test/xmlrpc/webrick_testing.rb (WEBrick_Testing#start_server):
- catch IOError when server socket was closed.
+Fri May 25 10:52:52 2012 Koichi Sasada <ko1@atdot.net>
-Sun Feb 13 07:39:51 2011 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * vm.c: refactoring backtrace related functions.
+ (1) unify similar functions (rb_backtrace_each() and
+ backtrace_object()). backtrace_each() is a unified function.
+ variation:
+ a) backtrace_object(): create backtrace object.
+ b) vm_backtrace_str_ary(): create bt as an array of string.
+ c) vm_backtrace_print(): print backtrace to specified file.
+ d) rb_backtrace_print_as_bugreport(): print backtrace on
+ bugreport style.
+ (2) remove rb_backtrace_each(). Use backtrace_each() instead.
+ (3) change the type of lev parameter to size_t.
+ a) lev == 0 means current frame (exception, etc use it).
+ b) lev == 1 means upper frame (caller(0) use it).
- * enum.c (enum_inject): typo fixed. a patch from Gaku Ueda in
- [ruby-core:35216].
+ * vm_core.h, vm_dump.c, vm_eval.c: ditto.
-Sun Feb 13 00:48:47 2011 Tadayoshi Funaba <tadf@dotrb.org>
+ * vm.c (backtrace_object(), vm_backtrace_str_ary()): fix to return a
+ correct size of caller(lev) array.
+ Let n be a "caller(0).size" then ln as caller(lev).size should be
+ (n - lev). However, the previous implementation returns a wrong
+ size array (ln > n - lev). [ruby-dev:45673]
- * lib/date.rb (Date#===): [ruby-core:35127]
+ * test/ruby/test_backtrace.rb: add tests for backtrace.
-Sun Feb 13 00:29:18 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri May 25 08:51:39 2012 Eric Hodel <drbrain@segment7.net>
- * lib/test/unit.rb (Test::Unit::Options#process_args): always
- return options.
+ * enum.c (enum_count): Enumerable#count no longer uses #size when
+ counting elements. Patch by Nobuhiro IMAI. [ruby-trunk - Bug #6473]
- * lib/test/unit.rb (Test::Unit::RequireFiles#non_options): return
- if any test case get loaded.
+Fri May 25 01:15:39 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/test/unit.rb (Test::Unit::AutoRunner#initialize): do not add
- default directory if it is nil.
+ * sprintf.c (ruby__sfvextra): [EXPERIMENTAL] use inspect instead of
+ to_s if plus flag is given.
- * lib/test/unit.rb (Test::Unit::AutoRunner#process_args): return
- true if any test cases to run.
+ * vsnprintf.c (BSD_vfprintf): pass sign flag.
-Sat Feb 12 23:17:43 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri May 25 00:37:22 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/test/unit.rb (assert_include): add alias.
+ * test/rubygems/test_gem_indexer.rb (setup, teardown): save @tempdir
+ to remove it properly. [Bug #5348]
-Sat Feb 12 14:44:20 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu May 24 23:36:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * thread.c (rb_thread_io_blocking_region): new function to run
- blocking region with GIL released, for fd.
+ * vsnprintf.c (BSD_vfprintf): [EXPERIMENTAL] object representation in
+ rb_enc_vsprintf(). [Feature #5896]
- * thread.c (rb_thread_fd_close): implement. [ruby-core:35203]
+Thu May 24 15:33:01 2012 Koichi Sasada <ko1@atdot.net>
- * vm.c (th_init): rename from th_init2.
+ * vm_method.c (rb_method_defined_by): removed.
+ nobu pointed out that rb_method_basic_definition_p() is enough
+ for last commit.
-Sat Feb 12 14:41:36 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * error.c, eval_error.c: change for above.
- * lib/test/unit.rb (Test::Unit::AutoRunner#initialize): use
- default_dir if no test case given.
+Thu May 24 14:30:13 2012 Koichi Sasada <ko1@atdot.net>
- * lib/test/unit.rb (Test::Unit::Runner): rename from Test::Unit::Mini.
+ * vm.c: add RubyVM::Backtrace object (btobj).
+ Backtrace information contains an array consists of location
+ information for each frames by string.
+ RubyVM::Backtrace object is lightweight backtrace information,
+ which contains complete information to generate traditional style
+ backtrace (an array of strings) with faster generation.
+ If someone accesses to backtrace information via
+ Exception#backtrace, then convert a RubyVM::Backtrace object to
+ traditional style backtrace.
+ This change causes incompatibility on marshal dumped binary
+ of Exception. If you have any trouble on it, please tell us
+ before Ruby 2.0 release.
+ Note that RubyVM::Backtrace object should not expose Ruby level.
- * lib/test/unit.rb (Test::Unit::GlobOption#non_options): run tests
- under base directory if no argument given.
+ * error.c, eval.c, vm_eval.c: ditto.
-Sat Feb 12 08:03:12 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * internal.h: ditto.
- * test/ruby/test_settracefunc.rb (TestSetTraceFunc): ensure to use
- method_added hook defined in Module.
+ * eval_error.c: fix to skip "set_backtrace" method invocation in
+ creating an exception object if it call a normal set_backtrace
+ method (defined by core).
-Sat Feb 12 01:04:02 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_settracefunc.rb: fix for above change.
- * ruby.c (proc_options): enable rubygems if --gem option is given.
+ * vm_method.c (rb_method_defined_by): added. This function
+ checks that the given object responds with the given method
+ by the given cfunc.
- * ruby.c (process_options): load rubygems if it is disabled but
- --gem option is given.
+ * benchmark/bm_vm2_raise1.rb, benchmark/bm_vm2_raise2.rb:
+ add to measure exception creation speed. raise1 create
+ exception objects from shallow stack frame. raise2 create
+ exception objects from deep stack frame.
-Fri Feb 11 23:27:50 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+Thu May 24 12:07:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ruby.c (proc_options): add --gem=enabled as an alias of
- --enable=gems and --gem=disabled as an alias of --disable=gems.
- Gem named "enabled" or "disabled" has already been reserved
- legitimately for this purpose.
+ * io.c (io_strip_bom): check EOF. [Bug #6487][ruby-core:45203]
-Fri Feb 11 23:17:04 2011 Tanaka Akira <akr@fsij.org>
+Wed May 23 22:06:14 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/dl/cfunc.c: parenthesize macro arguments.
+ * lib/net/http/header.rb (Net::HTTPHeader#range): fix broken parser of
+ HTTP Range request. Old one can't parse invalid specs and multiple
+ specs correctly.
-Fri Feb 11 21:41:53 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed May 23 10:18:54 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * bin/testrb, test/runner.rb, lib/test/unit.rb: improve backward
- compatibility.
+ * win32/win32.c (finish_overlapped_socket, overlapped_socket_io):
+ replace ECONNABORTED to EPIPE in send, sendto and sendmsg to improve
+ BSD socket compatibility. this change removes a failure on the test
+ of net/ftp.
-Fri Feb 11 19:45:26 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed May 23 05:35:58 2012 Eric Hodel <drbrain@segment7.net>
- * eval.c (ruby_cleanup): use rb_ary_free to free internal object.
+ * lib/net/http.rb: Broke up Net::HTTP into individual files.
+ [ruby-trunk - Feature #6435]
+ * lib/net/http/backward.rb: ditto.
+ * lib/net/http/response.rb: ditto.
+ * lib/net/http/exceptions.rb: ditto.
+ * lib/net/http/responses.rb: ditto.
+ * lib/net/http/generic_request.rb: ditto.
+ * lib/net/http/header.rb: ditto.
+ * lib/net/http/request.rb: ditto.
+ * lib/net/http/proxy_delta.rb: ditto.
+ * lib/net/http/requests.rb: ditto.
- * gc.h (RUBY_FREE_UNLESS_NULL): get rid of double free.
- [ruby-core:35192]
+Wed May 23 05:15:11 2012 Eric Hodel <drbrain@segment7.net>
-Fri Feb 11 16:57:03 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * class.c (rb_mod_init_copy): Clear the cached inspect string of a
+ dup'd anonymous module or class. [ruby-trunk - Bug #6454]
+ * test/ruby/test_module.rb (class TestModule): ditto
- * test/ruby/test_transcode.rb (test_from_cp50221): fix wrong
- assertion and move back.
+Tue May 22 16:49:15 2012 Koichi Sasada <ko1@atdot.net>
-Fri Feb 11 14:33:18 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_core.h: add a data type rb_location_t to store iseq location
+ information.
+ rb_location_t#filename, filepath, name and line_no was moved from
+ rb_iseq_t. rb_location_t#basename is a new field which is
+ similar to `name' field without any decoration.
+ `name' field contains some decoration such as `block in foo'.
+ `basename' only contains `foo'.
+ rb_iseq_t contains memory object of rb_location_t.
- * lib/test/unit/assertions.rb (assert_no_match): alias for
- backward compatibility.
+ * iseq.c: setup rb_location_t for each rb_iseq_t memory objects.
-Fri Feb 11 12:06:48 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * compile.c, proc.c, vm.c, vm_dump.c, vm_eval.c, vm_insnhelper.c,
+ vm_method.c: support about it.
- * ruby.c (add_gems, require_libraries, proc_options): add
- --require and --gem options.
+Tue May 22 00:45:05 2012 Yusuke Endoh <mame@tsg.ne.jp>
-Fri Feb 11 12:03:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * struct.c (rb_struct_members): Refactoring. As Struct#members had
+ returned an array of String, the old code was needed to convert
+ Symbols to Strings. But it is almost unnecessary because the
+ method now returns an array of Symbols. A patch by Masaki
+ Matsushita <glass.saga at gmail dot com> [Feature #6218]
+ [ruby-dev:45451]
- * configure.in (rubygems): add --disable-rubygems option.
+Mon May 21 19:20:25 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Feb 11 11:39:03 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/net/ftp.rb (Net::FTP#retrbinary): close only if conn is not nil
+ because transfercmd may fail and return nil.
- * template/fake.rb.in (CROSS_COMPILING): get rid of NameError.
+ * lib/net/ftp.rb (Net::FTP#retrlines): ditto.
-Thu Feb 10 23:12:34 2011 Tanaka Akira <akr@fsij.org>
+Mon May 21 15:10:28 2012 Akinori MUSHA <knu@iDaemons.org>
- * ext/dl/dl.h: parenthesize macro arguments.
+ * ext/syslog/syslog.c: Classify constants and macros into several
+ sub-modules. (Syslog::Priority, Syslog::Level, Syslog::Option
+ and Syslog::Macros)
-Wed Feb 9 23:11:27 2011 Tanaka Akira <akr@fsij.org>
+ * ext/syslog/syslog.c (mSyslog_inspect): Use rb_sprintf().
- * ext/pty/pty.c: parenthesize macro arguments.
+ * ext/syslog/syslog.c (mSyslog_inspect): Make sure self is a
+ module before calling rb_class2name().
-Tue Feb 8 11:47:11 2011 Loren Sands-Ramshaw <lorensr@gmail.com>
+Mon May 21 12:44:11 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
- * array.c: documentation clarification in rotate, rotate!,
- index, and rindex. [ruby-core:35144]
+ * .travis.yml (install): It seems tcl/tk is skipped in Travis
+ CI. Trying to fix the situation.
-Wed Feb 9 09:45:43 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon May 21 12:11:25 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/rdoc/test_rdoc_encoding.rb: remove unnecessary (and wrong)
- platform-dependent hacks.
+ * enc/depend (ENCOBJS): add dependencies.
-Wed Feb 9 00:47:18 2011 Tanaka Akira <akr@fsij.org>
+ * enc/make_encmake.rb (target_encodings): extract dependencies.
- * ext/etc/etc.c: parenthesize macro arguments.
+Mon May 21 11:26:17 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Feb 8 19:38:00 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/net/ftp.rb (Net::FTP#transfercmd): rescue shutdown.
- * misc/ruby-mode.el (ruby-expr-beg): fix for invalid nest errors.
+Sun May 20 23:00:11 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Feb 8 19:22:59 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * ext/extmk.rb (extmake): reopen $stdout to NULL, since setting
+ $stdout cannot affect child processes.
- * configure.in (AC_MSG_CHECKING): fixed typo. the patch is
- created by Benoit Daloze. Thanks a lot. [Bug #4384][ruby-core:35148]
+Sun May 20 21:36:39 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Feb 8 16:04:03 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * enc/shift_jis.c (code_to_mbclen): return
+ ONIGERR_INVALID_CODE_POINT_VALUE if the code is invalid.
- * io.c (rb_io_s_sysopen): use NUM2MODET() instead NUM2UINT().
+ * string.c (tr_next): increment character until the code
+ is a valid character. [ruby-dev:45652] [Bug #6450]
-Tue Feb 8 15:59:23 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Sun May 20 12:25:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * process.c (rb_run_exec_options_err): use MODET2NUM() instead
- LONG2NUM().
+ * Makefile.in (LIBRUBY_SO): link EXTSOLIBS too.
-Tue Feb 8 13:59:56 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * ext/extmk.rb (mf.macro): use EXTSOLIBS instead of SOLIBS to get rid
+ of discard libraries needed by default. [Bug #6462]
- * configure.in: revert r30725. Now we have proper runtime fallback.
- Therefore, no need compile time disabling. (see r30762).
+Sat May 19 19:04:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Feb 8 01:00:21 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+ * ext/extmk.rb (command_output): ENCOBJS is needed for all linked
+ ruby, if --disable-shared and --with-static-linked-ext.
- * process.c (proc_setgroups): add GC guard to prevent intermediate
- variable from GC.
+ * ext/extmk.rb (command_output): dmyext is needed as DLDOBJS if no
+ static linked extensions.
-Tue Feb 8 00:56:33 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * Makefile.in, common.mk (PROGRAM): no extension libraries.
- * misc/ruby-mode.el (ruby-expr-beg, ruby-in-here-doc-p): tell
- singleton class definitions from here documents.
+ * common.mk (build-ext): pass macros for libruby.so.
- * misc/ruby-mode.el (ruby-expr-beg, ruby-parse-partial): keyword
- followed by colon is label.
+ * ext/extmk.rb (command_output): link extension libraries and encoding
+ libraries into libruby.so, not ruby executable.
-Mon Feb 7 22:56:16 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+ * ext/extmk.rb (command_output): fold long macro lines.
- * lib/benchmark.rb (Benchmark#bmbm): use ensure clause instead of
- Object#tap to restore STDOUT.sync.
+ * Makefile.in (LIBEXT): add macro.
-Mon Feb 7 22:34:20 2011 Tanaka Akira <akr@fsij.org>
+ * configure.in (ENCOBJS, EXTOBJS): use LIBEXT, not hardcoded suffix.
- * lib/net/http.rb (Net::HTTP#connect): support SNI (Server Name
- Indication) for HTTPS. [ruby-dev:43164]
- http://stackoverflow.com/questions/4685736/openssl-server-name-indication-support-in-ruby
+ * Makefile.in (LIBRUBY_A): fix typo. re-applying r35242.
-Mon Feb 7 16:05:32 2011 Eric Hodel <drbrain@segment7.net>
+Sat May 19 04:46:53 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/rdoc: Upgrade to RDoc 3.5.3 Fixes [Bug #4376]
+ * ext/openssl/extconf.rb: Use Logging::message instead of message.
+ * ext/zlib/extconf.rb: ditto.
-Mon Feb 7 11:46:59 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Fri May 18 18:13:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * common.mk (rdoc): add --encoding=UTF-8; ruby's rdoc must be UTF-8.
+ * lib/mkmf.rb (MakeMakefile#configuration): keep space at end of
+ OUTFLAG and COUTFLAG. [ruby-dev:45650]
-Mon Feb 7 10:21:50 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri May 18 17:39:42 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/rdoc/test_rdoc_options.rb (TestRDocOptions#test_check_files):
- there is no easy way to create owner unreadable file on Windows.
- So, skip the test.
+ * thread_pthread.c (rb_thread_create_timer_thread): Added error
+ check when failing fcntl(). [Bug #6147] [ruby-dev:45364]
-Sun Feb 6 13:48:29 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri May 18 17:41:00 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/json/lib/json/common.rb (JSON::MissingUnicodeSupport.iconv):
- should not drop rest of the result. use Iconv.conv instead.
+ * ext/extmk.rb (extmake): link archives only, skip script only
+ extension libraries.
-Sun Feb 6 12:46:02 2011 Eric Hodel <drbrain@segment7.net>
+Fri May 18 17:25:33 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * string.c (gsub): Ensure result encoding is the same as input
- encoding. [Bug #4340].
+ * cont.c: bump up fiber machine stack size when running on 64bit
+ arch. [Bug #6344] [ruby-dev:45554]
-Sun Feb 6 12:18:25 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri May 18 15:20:56 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * parse.y (words, qwords): dispatch array events. based on a
- patch from Michael Edgar. [Bug #4365].
+ * lib/uri/generic.rb (URI::Generic.build): duplicate args before adding
+ new items. (don't change arguments)
-Sun Feb 6 12:12:59 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/uri/generic.rb (URI::Generic.build): use URI::Generic::COMPONENT
+ if this method is called from URI::Generic.
- * test/fileutils/fileasserts.rb (FileAssertions): separate module.
+ * lib/uri/generic.rb (URI::Generic.build2): escape only if the item is
+ a String.
-Sun Feb 6 11:29:23 2011 Tanaka Akira <akr@fsij.org>
+ * lib/uri/generic.rb (URI::Generic.build2): use DEFAULT_PARSER because
+ it doesn't have parser method. [Bug #6420]
- * ext/dbm/dbm.c: parenthesize macro arguments.
+Fri May 18 15:54:07 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sat Feb 5 22:01:59 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * ext/zlib/extconf.rb: Use an exception instead of bare puts.
- * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert):
- revert r30796. r30797 and r30798 are an alternative fix.
- [ruby-dev:43174]
+Fri May 18 15:53:05 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sat Feb 5 21:47:09 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/psych/extconf.rb: Use an exception instead of bare abort.
- * parse.y (mlhs_basic): include mlhs_post for ripper. a patch
- from Michael Edgar at [ruby-core:35078].
+Fri May 18 15:51:32 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sat Feb 5 21:22:21 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/fiddle/extconf.rb: Use an exception instead of bare abort.
- * lib/test/unit/assertions.rb (assert_block): move from
- test/fileutils/fileasserts.rb.
+Fri May 18 15:49:35 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/fileutils/fileasserts.rb (assert_block): pass arguments
- as-is. [ruby-dev:43174]
+ * ext/readline/extconf.rb: Use an exception instead of bare exit.
-Sat Feb 5 16:47:54 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Fri May 18 15:38:11 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert):
- msg can be passed nil. [Bug #4371] [ruby-dev:43174]
+ * ext/ripper/extconf.rb: Use an exception instead of bare
+ Logging.message.
-Sat Feb 5 15:18:25 2011 Eric Hodel <drbrain@segment7.net>
+Fri May 18 15:23:06 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/rdoc: Upgrade to RDoc 3.5.2
+ * ext/openssl/extconf.rb: Clarify a message when hit Apple
+ OpenSSL issue.
-Sat Feb 5 12:05:27 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri May 18 15:14:32 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/syck/rubyext.c (syck_node_init_copy): SyckNode is not
- copiable. [ruby-core:35094]
+ * ext/extmk.rb: Show a message when extconf.rb raised an exception.
+ * ext/openssl/extconf.rb: Use exception raising instead of message
+ and/or abort. We want to display error message to console _and_
+ logging into mkmf.log.
-Sat Feb 5 11:48:47 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri May 18 06:14:07 2012 Eric Hodel <drbrain@segment7.net>
- * ext/openssl/ossl_cipher.c (ossl_cipher_alloc): leave data ptr
- NULL.
+ * ext/syslog/lib/syslog/logger.rb: Added Syslog::Logger which was
+ ported from the SyslogLogger gem. [ruby-trunk - Feature #5096]
+ * NEWS: ditto.
+ * test/syslog/test_syslog_logger.rb: ditto.
- * ext/openssl/ossl_cipher.c (ossl_cipher_new, ossl_cipher_initialize):
- allocate internal structure. [ruby-core:35094]
+Fri May 18 01:28:21 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/openssl/ossl_cipher.c (ossl_cipher_copy): ditto.
+ * ext/psych/parser.c (transcode_string): fix encoding index names.
+ Thanks markizko for reporting.
-Sat Feb 5 11:29:10 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu May 17 23:03:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/json/parser/parser.h (GET_PARSER): raise TypeError.
+ * configure.in: fix function name to be checked, to initialize
+ rb_thread_cond_t properly.
- * ext/json/parser/parser.rl (cParser_initialize): ditto.
+ * thread_pthread.c (native_cond_initialize, native_cond_destroy):
+ fix macro name.
- * ext/json/parser/parser.h (GET_PARSER): check if initialized.
- [ruby-core:35079]
+Thu May 17 12:53:07 2012 Yuki Yugui Sonoda <yugui@google.com>
- * ext/json/parser/parser.rl (cParser_initialize): ditto.
+ * thread.c, thread_pthread.c: Moved pthread-specific preprocessor
+ hacks to thread_pthread.c
-Sat Feb 5 10:09:31 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu May 17 12:18:47 2012 Yuki Yugui Sonoda <yugui@google.com>
- * load.c (rb_get_expanded_load_path): always expand load paths.
+ * io.c: Fix a mistake on merging the patch in the previous commit.
-Sat Feb 5 09:38:08 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu May 17 11:33:07 2012 Yuki Yugui Sonoda <yugui@google.com>
- * transcode.c (encoded_dup): extract.
+ Imports Ruby's port to NativeClient (a.k.a NaCl).
+ Patch by Google Inc. [ruby-core:45073].
-Sat Feb 5 03:37:47 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (RUBY_NACL): New M4 func to configure variables for
+ NaCl.
+ (RUBY_NACL_CHECK_PEPPER_TYPES): New M4 func to check the old names
+ of Pepper interface types.
+ (BTESTRUBY): New variable to specify which ruby should be run on
+ "make btest". NaCl can run the built binary by sel_ldr, but it need
+ rbconfig.rb. So this variable is distinguished from $MINIRUBY.
- * lib/fileutils.rb (FileUtils::LowMethods): make low level methods
- in NoWrite and DryRun to do nothing. [ruby-dev:43129]
+ * thread_pthread.c: Disabled some features on NaCl.
- * test/fileutils/fileasserts.rb: add message arguments.
+ * io.c: ditto.
- * test/fileutils/fileasserts.rb (Test::Unit::Assertions#assert_block):
- show the given message.
+ * process.c: ditto.
-Sat Feb 5 02:09:39 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * signal.c: ditto.
- * parse.y (lex_getline, parser_set_encode): set encoding of lines
- in SCRIPT_LINES__ as source encoding. [ruby-dev:43168]
+ * file.c: ditto.
-Sat Feb 5 02:08:37 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * missing/flock.c: ditto.
- * vm.c (ruby_thread_data_type): add prefix.
+ * nacl/pepper_main.c: An example implementation of Pepper application
+ that embeds Ruby.
-Sat Feb 5 00:59:54 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * nacl/example.html: An example of web page that uses the Pepper
+ application.
- * vm_core.h (GetThreadPtr): use TypedData_Get_Struct() instead
- CoreDataFromValue() because we need type check. Otherwise,
- type mismatch can cause segmentation fault crash.
- [ruby-core:35086] [Ruby 1.9-Bug#4367]
+ * nacl/nacl-config.rb: Detects variants of NaCl SDK.
- * vm.c (thread_data_type): remove static.
+ * nacl/GNUmakefile.in: Makefile template for NaCl specific build
+ process.
-Fri Feb 4 19:14:27 2011 Tanaka Akira <akr@fsij.org>
+ * nacl/package.rb: script for packaging a NaCl-Ruby embedding
+ application.
- * enc/trans/utf8_mac.trans: parenthesize macro arguments.
+ * nacl/reate_nmf.rb: Wrapper script of create_nmf.py
-Fri Feb 4 12:11:51 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * dln.c (dln_load): Added a hack to call on NaCl.
- * string.c (str_utf8_nth): fixed a condition of optimized lead
- byte counting. [Bug #4366][ruby-dev:43170]
+ * util.c (ruby_getcwd): Path to the current directory is not available
+ on NaCl.
-Fri Feb 4 01:50:13 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Thu May 17 10:54:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * string.c (count_utf8_lead_bytes_with_word): wrote function
- comments.
+ * ext/tk/extconf.rb: add -l options to $libs not $LDFLAGS,
+ to be passed to EXTLIBS in exts.mk.
-Fri Feb 4 00:14:55 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * enc/encinit.c.erb: use %-lines to adjust indent in the generated file.
- * ext/zlib/zlib.c (gzfile_reader_get_unused): no need to dup
- before rb_str_resurrect.
+ * lib/mkmf.rb (MakeMakefile#have_framework): combine -framework option
+ and its argument with an equal sign not to be separated in merge_libs.
-Thu Feb 3 20:04:44 2011 Tanaka Akira <akr@fsij.org>
+ * ext/tk/extconf.rb: ditto.
- * ext/curses/curses.c (CHECK): unused macro removed.
+ * ext/extmk.rb: EXTLDFLAGS also needs to be passed.
-Thu Feb 3 18:33:26 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Wed May 16 15:44:22 2012 Yuki Yugui Sonoda <yugui@google.com>
- * ext/zlib/zlib.c (gzfile_reader_get_unused): use rb_str_resurrect
- because gz->z.input is hidden string. [ruby-core:35057]
+ * configure.in: Fix an unbalanced quote.
-Thu Feb 3 16:34:10 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Wed May 16 15:43:10 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * enc/shift_jis.c (code_to_mbc): cast as int from the subtraction of
- pointers.
+ * ext/extmk.rb (exts.mk): use double quotes instead of single quotes
+ for commandline because it's not recognized as quotes on Windows.
- * enc/utf_16le.c (utf16le_mbc_enc_len): use ptrdiff_t.
+Wed May 16 15:15:55 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * enc/utf_32be.c (utf32be_left_adjust_char_head): ditto.
+ * configure.in (LD): enclose with single quotes but not double quotes
+ not to expand command substitution.
- * enc/utf_32le.c (utf32le_left_adjust_char_head): ditto.
+Wed May 16 14:19:51 2012 Yuki Yugui Sonoda <yugui@google.com>
-Thu Feb 3 16:31:43 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ Supports static linking of extensions and encodings again.
+ Fixes --with-static-linked-ext.
- * include/ruby/missing.h: don't use HAVE_STDDEF_H because it never
- defined by configure though configure.bat defines it.
+ Patch by Google Inc. [ruby-core:45073].
- * include/ruby/ruby.h: move include stddef.h to defines.h
+ * Makefile.in (ENCOBJS, EXTOBJS): New variables to specify static
+ linked libraries. Also reintroduces extinit.o, introduces encinit.o
+ introduces encinit.o
- * include/ruby/defines.h: ditto.
+ * common.mk: Builds static libraries rather than shared objects if
+ specified.
-Wed Feb 2 20:25:04 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * configure.in (LD): new substitution.
- * include/ruby/encoding.h (rb_enc_step_back): cast 4th argument 'n'
- as int because Ruby usually treats length value as long but
- onigenc_step_back's 4th argument is int.
+ * enc/depend: Supports static linked libraries
+ (libencs, libenc, libtrans): New target.
-Thu Feb 3 07:20:46 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+ * enc/encinit.c.erb: new template to generate the initialization of
+ statically linked encodings.
- * ext/psych/lib/psych/visitors/to_ruby.rb: use Regexp::NOENCODING
- rather than magic number.
+ * enc/make_encmake.rb (--module): new flag to specify whether static
+ or dynamic.
- * ext/syck/lib/syck/rubytypes.rb: ditto
+ * transcode_data.h (TRANS_INIT): New macro to get rid of the name
+ collision of encoding initializers and transcoder initializers.
-Thu Feb 3 07:16:11 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+ * ext/extmk.rb: Fixes the behavior on $extstatic is true.
- * re.c (Init_Regexp): added a constant for ARG_ENCODING_NONE
- [ruby-core:35054]
+ * lib/mkmf.rb (clean-static): new target to clean up static linked
+ libraries.
- * test/ruby/test_regexp.rb: corresponding test.
+ * ruby.c (process_options): New initializes statically linked
+ encodings here.
-Thu Feb 3 07:02:16 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+Wed May 16 14:30:43 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/psych/lib/psych/visitors/to_ruby.rb: ARG_ENCODING_NONE regular
- expressions can round trip. [ruby-core:34969]
+ * io.c: fixed a merge mistake of r33878, reported by nobu via IRC.
- * test/psych/test_yaml.rb: test for ARG_ENCODING_NONE regex
+Wed May 16 06:59:41 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * ext/sych/lib/syck/rubytypes.rb: ARG_ENCODING_NONE regular
- expressions can round trip.
+ * ext/date/date_strftime.c: should also be aware of flags on
+ complex specifier.
- * test/syck/test_yaml.rb: test for ARG_ENCODING_NONE regex
+Wed May 16 05:11:29 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Wed Feb 2 17:09:22 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * ext/psych/lib/psych/visitors/to_ruby.rb: fix a bug with string
+ subclass dumping and loading.
- * io.c (rb_io_fdatasync): Use fsync(2) if the underlying
- operating system does not support fdatasync(2).
+ * test/psych/test_array.rb: pertinent tests
-Wed Feb 2 14:51:08 2011 Eric Hodel <drbrain@segment7.net>
+ * test/psych/test_string.rb: ditto
- * lib/rdoc/markup/to_tt_only.rb: commit miss
- * test/rdoc/test_rdoc_markup_to_tt_only.rb: ditto
- * test/rdoc/test_rdoc_single_class.rb: ditto
+Wed May 16 01:31:21 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Wed Feb 2 09:27:53 2011 Eric Hodel <drbrain@segment7.net>
+ * ext/psych/lib/psych/visitors/to_ruby.rb: convert omap tagged maps to
+ Psych::Omap objects rather than hashes. [Bug #6425]
- * lib/rdoc: Upgrade to RDoc 3.5.1
+ * test/psych/test_omap.rb: pertinent test.
-Wed Feb 2 00:30:43 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Wed May 16 01:15:45 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * include/ruby/st.h (st_table): Added comment why we need __extension__.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: keep a reference to
+ custom coders so that GC does not impact dumped yaml reference ids.
-Tue Feb 1 20:45:44 2011 Tanaka Akira <akr@fsij.org>
+Tue May 15 23:59:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * enc/encdb.c: parenthesize macro arguments.
+ * lib/test/unit.rb (Test::Unit::Options#setup_options): add --color option.
-Tue Feb 1 15:12:26 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/test/unit.rb (Test::Unit::Runner#_prepare_run): defer color code
+ initialization to regard --color option.
- * test/ruby/test_require.rb (TestRequire#test_require_with_unc):
- use ``127.0.0.1'' instead of ``localhost'' as host name, because
- XP or earlier cannot resolv it as NBT hostname.
+Mon May 14 16:28:36 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Feb 1 13:20:39 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * parse.y (f_arglist): should reset lexical states after empty
+ argument list with no parenthesis as well as parenthesized list,
+ so that reserved name method definition work. [ruby-dev:45626]
+ [Bug #6403]
- * test/benchmark/test_benchmark.rb (#capture_bench_output):
- Added explicit sleep. Windows have imprecise time support.
- Thus Tms.new.Add!{} may be or may be not equal 0. The
- test failure started since r30747.
+Mon May 14 00:14:24 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Tue Feb 1 11:03:47 2011 Ryan Davis <ryan@lust.local>
+ * enumerator.c (lazy_take_func, lazy_take): multiple calls of
+ force/to_a method to Enumerator::Lazy#take should return same
+ results. [ruby-dev:45634] [Bug #6428]
- * lib/rubygems*: Import rubygems 1.5.0 (released version @ 1fb59d0)
- * test/rubygems: Ditto
+ * test/ruby/test_lazy_enumerator.rb (test_take_recycle): add test for
+ above.
-Tue Feb 1 08:01:39 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun May 13 23:38:31 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
- * ext/io/console/console.c (console_set_winsize): new method to set
- console size. [EXPERIMENTAL]
+ * test/ruby/test_io.rb (test_flush_in_finalizer1): don't use IO.for_fd
+ to close IO objects. it create IO object with already closed fd, and
+ cause occasional Errno::EBADF in following tests. [ruby-core:45020]
+ [Bug #6228]
- * ext/io/console/console.c (console_winsize): use GetWriteFD.
+Sun May 13 23:32:16 2012 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-Tue Feb 1 02:28:14 2011 Masaya Tarui <tarui@ruby-lnag.org>
+ * test/ruby/test_io.rb (TestIO): revert r35631. it broke the intent of
+ test_flush_in_finalizer1. [ruby-core:43951] [Bug #6228]
- * include/ruby/win32.h, win32/win32.c: add rb_w32_inet_ntop.
- inet_ntop's minimum supported client is Vista.
+Sun May 13 22:46:36 2012 Tanaka Akira <akr@fsij.org>
-Tue Feb 1 00:10:30 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/etc/etc.c (passwd_ensure): move endpwent() call from
+ passwd_iterate to close /etc/passwd on exception.
+ (group_ensure): move endgrent() call from group_iterate to close
+ /etc/group on exception.
- * lib/benchmark.rb: fix benchmark to work with current ruby.
- patched by Benoit Daloze [ruby-core:33846] [ruby-dev:43143]
- merged from https://github.com/eregon/ruby/commits/benchmark
+Sun May 13 18:10:43 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * lib/benchmark (Report#width): update documentation
- * lib/benchmark: document the return value of #benchmark and the
- :list attribute in Report
- * lib/benchmark (Tms#format): rename variables, use String#%
- instead of Kernel.format
- * lib/benchmark: remove undocumented Benchmark::times (an alias
- of Process::times used twice)
- * lib/benchmark (#benchmark): use label_width for the caption
- * lib/benchmark (Tms#initialize): rename variables
- * lib/benchmark: allow title to not be a String and call #to_s
- * lib/benchmark (Benchmark#bm): return an Array of the times with
- the labels
- * lib/benchmark: correct output for Benchmark#bmbm
- (remove the extra space)
- * lib/benchmark: add a few tests for Benchmark::Tms output
- * lib/benchmark: improve style (enumerators, ljust, unused vars)
- * lib/benchmark: add spec about output and return value
- * lib/benchmark: improve basic style and consistency
- no parenthesis for print and use interpolation instead of printf
- * lib/benchmark: remove unnecessary conversions and variables
- * lib/benchmark: correct indentation
- * lib/benchmark: rename the FMTSTR constant and variable to FORMAT
- * lib/benchmark: remove useless exception
+ * ext/date/date_strftime.c: removed unused code and changed the style.
- * test/benchmark: remove unused variable warnings
+Sun May 13 17:37:56 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Mon Jan 31 23:27:23 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+ * ext/date/date_strftime.c: refactored.
- * node.c (add_id): remove duplicated rb_id2str() call.
+Sun May 13 06:40:12 2012 Luis Lavena <luislavena@gmail.com>
-Sun Jan 30 17:19:46 2011 Tanaka Akira <akr@fsij.org>
+ * test/ruby/test_io.rb (class TestIO): Disable GC during IO tests to
+ avoid file descriptors being GC'ed. Suggestion by Tomoyuki Chikanaga
+ [ruby-core:43951][Bug #6228]
- * missing/langinfo.c: parenthesize macro arguments.
+Sat May 12 07:00:16 2012 Eric Hodel <drbrain@segment7.net>
-Mon Jan 31 21:57:39 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * ext/sdbm/init.c: Added documentation. Patch by Justin Collins,
+ cleanup by Zachary Scott. [ruby-trunk - #6410]
- * configure.in: revert r30698.
+Sat May 12 06:02:03 2012 Eric Hodel <drbrain@segment7.net>
-Mon Jan 31 21:32:44 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+ * lib/fileutils.rb (cp_r): Fixed cp_r example. Patch by TJ Koblentz
+ from pull request #114. [ruby-trunk - Bug #6411]
- * thread.c (thread_start_func_2): check deadlock condition before
- release thread stack. fix memory violation when deadlock detected.
- reported by Max Aller. [Bug #4009] [ruby-core:32982]
+Sat May 12 05:23:06 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Mon Jan 31 14:45:47 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+ * thread.c (rb_threadptr_execute_interrupts_common):
+ test_signal_requiring of test/ruby/test_signal.rb fail if the sub
+ process is killed on waiting IO in lex_io_gets in rb_load_file in
+ rb_load_internal in require.
+ This is because
+ (1) the process receive the killing signal in
+ rb_thread_io_blocking_region in rb_read_internal in lex_io_gets.
+ (2) set th->errinfo as INT2FIX(TAG_FATAL) at
+ rb_threadptr_execute_interrupts_common.
+ (3) escape rb_load_file in rb_load_internal and jump to EXEC_TAG()
+ without set loaded as TRUE.
+ (4) call first rb_exc_raise(GET_THREAD()->errinfo); because loaded
+ is FALSE as above. this errinfo should be an exception object
+ but this is INT2FIX(TAG_FATAL).
+ Don't call first rb_exc_raise if GET_THREAD()->errinfo is Fixnum.
- * lib/irb/locale.rb (IRB::Locale::#search_file):
- Gem might be undefined if --disable-gems. [ruby-core:34990]
+Fri May 11 14:23:11 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jan 31 12:26:14 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * parse.y (primary): begin/end block should be isolated from outside.
+ [ruby-dev:45631][Bug #6419]
- * addr2line.c: suppressed shorten-64-to-32 warnings.
- * regcomp.c: ditto.
- * regexec.c: ditto.
- * regint.h: ditto.
- * regparse.c: ditto.
- * regparse.h: ditto.
- * time.c: ditto.
- * variable.c: ditto.
+Fri May 11 14:09:47 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jan 31 04:45:12 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/bigdecimal/bigdecimal.c (PUSH): to prevent VALUE from GC,
+ must not cast it to unsigned long, which may be shorter than
+ VALUE, and the result can be mere garbage.
- * array.c (rb_ary_uniq_bang): call ARY_SET_LEN(ary, 0) before
- ary_resize_capa because ary_resize_capa expects resized length is
- smaller than current array length. call rb_ary_unshare before
- ary_resize_capa because ary_resize_capa lost the reference to
- original shared array. [ruby-core:34997]
+Fri May 11 09:51:07 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jan 30 17:19:46 2011 Tanaka Akira <akr@fsij.org>
+ * lib/test/unit.rb (Test::Unit::Runner#failed): no unnecessary
+ newlines if no reports to be displayed.
- * missing/crypt.c: parenthesize macro arguments.
+Thu May 10 10:55:35 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jan 30 16:40:27 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/minitest/test_minitest_mock.rb: Correct requiring path to
+ metametameta.rb.
- * test/rubygems/test_gem_security.rb (TestGemSecurity): valid only
- if OpenSSL is available.
+ * test/minitest/test_minitest_unit.rb: Correct requiring path to
+ metametameta.rb.
- * test/dl/test_dl2.rb (TestDL#test_sin): math functions do not
- work on x86_64 due to the design of DL2.
+Thu May 10 10:18:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/dl/test_func.rb (DL::TestFunc#test_{sinf,sin): ditto.
+ * parse.y (lex_state_name): returns name for lex_state_e, for debug
+ use.
-Sun Jan 30 16:09:22 2011 Tanaka Akira <akr@fsij.org>
+Wed May 9 16:36:01 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * strftime.c (rb_strftime_with_timespec): %G produces 4 digits.
+ * lib/mkmf.rb (MakeMakefile#pkg_config): check if libs resulted from
+ pkg-config works actually.
-Sun Jan 30 15:13:19 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed May 9 16:01:38 2012 Shugo Maeda <shugo@ruby-lang.org>
- * enc/emacs_mule.c (emacsmule_islead): 7bit range is also leading
- byte.
+ * lib/net/imap.rb (decode_utf7, encode_utf7): refactored by
+ Nobuyoshi Nakada, to use String#encode.
-Sun Jan 30 13:03:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed May 9 13:26:25 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * hash.c (rb_hash_fetch_m): use useful message for longer key, not a
- nonsense id value.
+ * test/rubygems/test_gem_remote_fetcher.rb: skip OpenSSL dependent
+ tests if not available.
- * string.c (rb_str_ellipsize): new function to ellipsize a string.
+Wed May 9 08:09:38 2012 Ryan Davis <ryand-ruby@zenspider.com>
- * include/ruby/encoding.h (rb_enc_step_back): new function to step
- back n characters.
+ * lib/minitest/*: Imported minitest 3.0.0 (r7435)
+ * test/minitest/*: ditto
+ * test/rubygems/*: Imported fixes for buggy use of assert_match
+ and deprecated assert_block
+ UNBUNCH YOUR PANTIES. THE TESTS DO NOT RUN CLEAN ON OSX.
-Sun Jan 30 12:53:38 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed May 9 06:28:59 2012 Eric Hodel <drbrain@segment7.net>
- * enc/emacs_mule.c (emacsmule_islead): fix inverse condition.
+ * re.c (rb_reg_equal): Removed incorrect example for Regexp#== with
+ "n" option. [ruby-talk - Bug #6415]
-Sun Jan 30 09:37:25 2011 Yutaka Kanemoto <kanemoto@ruby-lang.org>
+Wed May 9 06:23:33 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * io.c (struct argf): char behaves like an unsigned char
- by default on AIX.
+ * ext/date/date_core.c: reverted.
-Sun Jan 30 08:02:55 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Wed May 9 04:31:26 2012 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * configure.in: Mac OS X wrongly reports it has fdatasync(3).
+ * lib/rinda/ring.rb (lookup_ring_any): fix Rinda::RingFinger.primary
+ hungs forever. [ruby-talk:395364]
-Sun Jan 30 03:29:47 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Tue May 8 21:09:00 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * ext/openssl/ossl_bn.c (GetBNPtr): add missing nil case.
- patched by Martin Bosslet. [ruby-core:34987]
+ * include/ruby/win32.h (FD_SET): change function to macro.
+ To avoid buffer overflow when smaller FD_SETSIZE is used in ext
+ libraries.
-Sun Jan 30 01:02:28 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * win32/win32.c (rb_w32_fdset): this function is not used anymore.
+ But we leave this for compatibility.
- * include/ruby/ruby.h: Added NUM2MODET() and MODET2NUM() default
- definition.
- Because r30686 introduced win32 build failure.
+ * win32/win32.c (rb_w32_select_with_thread): fix SEGV when smaller
+ FD_SETSIZE is used in ext libraries. Dereference of fd_set pointer
+ causes SEGV.
+
+ * test/-ext-/win32/test_fd_setsize.rb(TestFdSetSize): add tests for
+ above.
+ * ext/-test-/win32/fd_setsize/depend: ditto.
+ * ext/-test-/win32/fd_setsize/extconf.rb: ditto.
+ * ext/-test-/win32/fd_setsize/fd_setsize.c: ditto.
+
+ [ruby-core:44588] [Bug #6352]
+
+Tue May 8 20:44:46 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * io.c (io_unread): fix IO#pos with mode 'r' bug on Windows.
+ If the end of reading buffer is CR, io_unread() needs to unread one
+ more byte.
+ [ruby-core:44874] [Bug #6401]
+
+ * test/ruby/test_io_m17n.rb (TestIO_M17N#test_pos_with_buffer_end_cr):
+ add a test for above.
+
+Tue May 8 13:38:17 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * ext/date/date_core.c: improving introduction in Date/DateTime
+ documentation. patched by Daniel Kaufman via Github.
+ https://github.com/ruby/ruby/pull/110
+
+Tue May 8 13:36:02 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (POSTLINK): default to : command to get rid of flag
+ only command, since BSD make does not work with it.
+
+Tue May 8 13:35:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (MiniTest#run_test): remove exact trace and get rid
+ of IndexError, which could caused by modified $@ sometimes.
+
+Tue May 8 11:21:27 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/minitest/metametameta.rb (MetaMetaMetaTestCase#assert_report):
+ support drive letter on Windows. yes, the original code is metameta.
+
+Tue May 8 08:54:48 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/abbrev.rb: Fixed typo in abbrev pattern documentation. Based on
+ patch by Mark Rushakoff. [ruby-trunk - #6346]
+
+Tue May 8 07:44:18 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/openssl/ossl_ssl.c (ossl_start_ssl): remove useless rb_sys_fail
+ before ossl_raise. this cause a test failure on Linux.
+ http://u64.rubyci.org/~chkbuild/ruby-trunk/log/20120507T190102Z.log.html.gz
+
+Tue May 8 05:35:18 2012 Eric Hodel <drbrain@segment7.net>
+
+ * object.c (Init_Object): Added reference to variable.c where
+ public_constant and private_constant documentation lives. [#6381]
+
+Tue May 8 04:47:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::Runner#output): prefer local output to
+ get rid of unexpected side effect in test/minitest/metametameta.rb.
+
+ * lib/test/unit.rb (MiniTest#run_test): show the running test in $0.
+
+ * lib/test/unit.rb (Test::Unit::StatusLineOutput): new class to output
+ in status line.
+
+ * test/testunit/test_hideskip.rb (TestHideSkip#test_hideskip):
+ MiniTest#puke now reports Skipped messages only if verbose mode.
+
+ * test/testunit/test_sorting.rb (TestTestUnitSorting#test_sorting):
+ ditto.
+
+ * lib/test/unit.rb (Test::Unit::Runner#puke): modify only result and
+ drop useless reports, not override entirely.
+
+ * bootstraptest/runner.rb (exec_test, show_progress): show rotators
+ and pass/fail counts.
+
+ * sample/test.rb (PROGRESS): refine output.
+
+Tue May 8 02:34:26 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/minitest/unit.rb (assert_match): refix of r35563.
+ r35563 breaks the intention of the original change.
+ https://github.com/seattlerb/minitest/commit/68858105b2eb11c85105ffac5f32b662c59397f3
+ * lib/minitest/unit.rb (refute_match): ditto.
+
+Mon May 7 21:19:17 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/json: Merge JSON 1.7.1.
+ https://github.com/flori/json/commit/e5b9a9465c1159fae533bca320d950b772bcb4ac
+
+Mon May 07 22:54:22 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_ssl.c: add support for option flags
+ OpenSSL::SSL::OP_NO_TLSv1_1
+ OpenSSL::SSL::OP_NO_TLSv1_2
+ to allow blocking specific TLS versions. Thanks to Justin Guyett for
+ pointing this out to me.
+ * test/openssl/test_ssl.rb: add tests to assert correct behavior when
+ blocking certain versions of TLS/SSL both on server and client side.
+ Also refactored tests to reduce boilerplate code a little.
+ * test/openssl/utils.rb: rescue Errno::ECONNRESET for tests where
+ client rejects the connection because a forbidden protocol version
+ was used.
+
+Mon May 7 20:14:15 2012 Tanaka Akira <akr@fsij.org>
+
+ * lib/securerandom.rb (random_bytes): call to_int method for the
+ argument at first.
+
+Mon May 7 17:54:12 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/minitest/unit.rb (assert_match): replace matcher only if both
+ matcher and obj are String. fix r35541. [Bug #6405]
+ DON'T COMMIT IF YOU CAN'T RUN TEST.
+ FIX AS SOON AS POSSIBLE YOU BREAK TESTS.
+ patched by ayumin.
+ https://github.com/seattlerb/minitest/pull/124
+
+ * lib/minitest/unit.rb (refute_match): ditto.
+
+Mon May 7 13:41:00 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * Makefile.in (PROGRAM), configure.in (POSTLINK): sign built program
+ using RUBY_CODESIGN identity.
+
+Mon May 7 13:03:55 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/imap.rb (body_type_attachment): parse body type
+ "ATTACHMENT". [ruby-core:44849] [Bug #6397]
+
+Mon May 7 10:49:36 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/bigdecimal/bigdecimal.c (Init_bigdecimal): define IDs before
+ they are used. [ruby-core:44900] [Bug #6406]
+
+Mon May 7 10:27:56 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/digest/rmd160/rmd160.c (RMD160_Update): fix for huge data.
+
+Mon May 7 10:23:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/fileutils/fileasserts.rb: use assert_equal, assert_match, and so on.
+
+ * test/ruby/enc/test_utf16.rb, test/ruby/enc/test_utf32.rb,
+ test/ruby/test_io_m17n.rb (assert_str_equal): ditto.
+
+ * test/rubygems/test_gem_remote_fetcher.rb
+ (assert_data_from_{server,proxy}): ditto.
+
+ * test/test_pstore.rb (test_thread_safe): ditto.
+
+Mon May 7 10:16:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/rubygems/test_gem_installer.rb (TestGemInstaller#test_dir): fix
+ argument order. expected value must come first.
+
+Mon May 07 09:14:11 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_ssl.c: support TLSv1.1 & TLSv1.2. Add
+ SSLContext#version to inspect the version that was negotiated for
+ a given connection.
+ * ext/openssl/extconf.rb: detect TLS 1.1 & 1.2 support.
+ * test/openssl/test_ssl.rb: add tests for TLS 1.1 & 1.2 given they
+ are supported by the native OpenSSL being used.
+
+Sun May 6 21:34:29 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (io_encoding_set): suppress warnings. [ruby-dev:45627]
+ this tmp1 is not required after r35538.
+
+ * addr2line.c: suppress warnings.
+
+Sun May 6 18:39:39 2012 Koichi Sasada <ko1@atdot.net>
+
+ * compile.c (iseq_compile_each): remove unused variable `size'.
+
+Sun May 6 14:50:03 2012 Tanaka Akira <akr@fsij.org>
+
+ * lib/securerandom.rb: show actual read length in an error message.
+
+Sat May 5 06:43:10 2012 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * lib/minitest/*: Imported minitest 2.12.1 (r7323)
+ * test/minitest/*: ditto
+
+Sat May 5 01:47:33 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * test/zlib/test_zlib.rb (test_inflate): add a test for Zlib.inflate.
+ patched by headius (Charles Nutter). [ruby-core:44859] [Bug #6398]
+
+ * test/zlib/test_zlib.rb (test_deflate): add a test for Zlib.deflate.
+
+Sat May 5 00:53:55 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (parse_mode_enc): remove warnings 'Ignoring internal encoding'.
+ [ruby-core:44455] [Bug #6324]
+
+ * io.c (io_encoding_set): ditto.
+
+Fri May 4 07:19:02 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/rdoc/parser.rb (RDoc.binary?): fix wrong regexp.
+ [ruby-core:44798] [Bug #6393]
+
+Fri May 4 01:33:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/rdoc/parser.rb (RDoc.alias_extension): a real file is irrelevant
+ to aliasing. [ruby-core:44796][Bug #6392]
+
+ * lib/rdoc/parser.rb (RDoc.zip?): non-existent file will not be a zip
+ file.
+
+ * lib/rdoc/parser.rb (RDoc.can_parse_by_name): accept aliased
+ extension file names.
+
+ * lib/rdoc/parser.rb (RDoc.binary?): binary read data may have
+ incomplete multibyte sequence. [ruby-core:44798][Bug #6393]
+
+Wed May 2 23:55:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::RequireFiles#non_options): expand
+ real path to get rid of loading same files via symlinks.
+
+Wed May 2 23:26:04 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * cont.c (rb_fiber_m_transfer): improve sample code in Fiber#transfer
+ documentation. emphasize the difference between transfer and resume.
+
+Wed May 2 23:21:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_yylex): allow spaces between lambda arrow and
+ parenthesis. [ruby-dev:45605][Feature #6390]
+
+Wed May 2 19:06:30 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * cont.c (rb_fiber_m_transfer): Improved Fiber documentation.
+ patched by Anuj Dutta. [ruby-core:44540][Bug #6343]
+
+Wed May 2 13:06:37 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * README, README.ja: reformatted using rdoc markup. based on the
+ patches by zzak (Zachary Scott) in [Feature #6388].
+
+ * README, README.ja: updated the author's mail address.
+
+Wed May 2 09:46:09 2012 Kouji Takao <kouji@takao7.net>
+
+ * ext/readline/readline.c (Readline.special_prefixes=)
+ (Readline.special_prefixes): new function. An original patch was
+ created by nagachika. [Feature #5784]
+
+Tue May 1 22:18:45 2012 Kouji Takao <kouji@takao7.net>
+
+ * ext/readline/readline.c (Readline.pre_input_hook)
+ (Readline.insert_text, Readline.redisplay): new function. An
+ original patch was created by nagachika. [Feature #5785]
+
+Tue May 1 15:46:48 2012 Koichi Sasada <ko1@atdot.net>
+
+ * common.mk: "$(Q)-..." doesn't work on nmake.
+
+Tue May 1 15:32:10 2012 Koichi Sasada <ko1@atdot.net>
+
+ * common.mk: replace '@' prefix to '$(Q)' to control build
+ process outputs.
+
+Tue May 1 14:17:59 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/openssl/deprecation.rb (OpenSSL.check_func): check if header is
+ available for macro compatibility.
+
+Tue May 1 10:53:54 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_settracefunc.rb: ignore traces from another threads
+ because Kernel.set_trace_func affects other threads.
+
+Tue May 1 06:04:14 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/digest/sha2/sha2.c (REVERSE32): explicitly cast since unsigned
+ long may be larger than sha2_word32.
+
+ * ext/digest/sha2/sha2.c (SHA{256,512,384}_{Final,End}): should clear
+ whole content, not pointer size.
+
+ * ext/digest/*/extconf.rb: use pkg_config to use same library with
+ openssl. [ruby-core:44755][Bug #6379]
+
+ * ext/openssl/deprecation.rb: extract check for broken Apple OpenSSL.
+
+Tue May 1 05:02:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (optflags): disable unsafe optimizations.
+ [ruby-core:44679][Bug #6370]
+
+Mon Apr 30 23:36:49 2012 Tanaka Akira <akr@fsij.org>
+
+ * lib/fileutils.rb (copy_metadata): use File.lchown and File.lchmod to
+ update meta data of symlinks.
+
+Mon Apr 30 23:05:53 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * test/ruby/test_continuation.rb (tracing_with_set_trace_func): don't
+ call Continuation from other threads. [ruby-dev:45596] [Bug #6382]
+
+Mon Apr 30 20:10:04 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/zlib/extconf.rb: detect z_crc_t type which will be defined
+ since zlib-1.2.7.
+
+ * ext/zlib/zlib.c (rb_zlib_crc_table): use z_crc_t if available.
+
+Mon Apr 30 09:02:15 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * ext/openssl/lib/openssl/ssl.rb: add hostname to "hostname does not
+ match server cert." error. patched by Wes Morgan via Github.
+ https://github.com/ruby/ruby/pull/122
+
+Mon Apr 30 04:43:53 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/json/yaml_events.rb: implicit styles should not
+ be changeable for JSON events.
+
+Sun Apr 29 06:12:02 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (assoc, parser_yylex): add syntax to splat keyword hash.
+ [ruby-core:44591][Feature #6353]
+
+ * compile.c (compile_array_): generate keyword splat insns.
+
+ * vm.c (m_core_hash_merge_kwd): merge keyword hash into intermediate
+ hash. leftward argument is prior currently.
+
+Fri Apr 27 12:34:23 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/dl/cfunc.c (rb_dlcfunc_call): should convert a Bignum value to
+ unsigned long long on Win64.
+ [ruby-core:44636][Bug #6364] reported by raylinn@gmail.com (ray linn)
+
+Fri Apr 27 10:58:17 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/readline/test_readline.rb (setup): avoid affected by user's
+ inputrc file. [ruby-dev:45584][Bug #6357]
+
+Fri Apr 27 01:45:05 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * thread.c (rb_threadptr_execute_interrupts_common):
+ handle timer_interrupt only on the first loop for the case to avoid
+ the infinite loop like following case:
+ * there is 2 Ruby threads (3 pthreads)
+ (1) main thread is waiting at gvl_yield:112 (native_cond_wait)
+ (2) sub thread works
+ (3) sub thread waits at gvl_yield:133 (native_mutex_unlock)
+ (4) main thread works
+ (5) main thread goes to gvl_acquire_common
+ (6) main thread call rb_wakeup_timer_thread
+ (7) timer thread set timer interrupt to the main thread
+ (8) main thread works
+ (9) main thread waits at gvl_acquire_common:64 (native_cond_wait)
+ (10) sub tread works
+ (11) set sub thread as the current thread
+ (12) run Ruby thread
+ (13) ...100ms
+ (14) sub thread goes to rb_threadptr_execute_interrupts_common
+ (15) sub thread call rb_thread_schedule_limits
+ (16) sub thread call gvl_release_common
+ (17) sub threads waits at gvl_yield:121 (native_cond_wait)
+ (18) main threads works
+ (19) main thread back to gvl_yield
+ (20) set main thread as the current thread
+ (21) main thread call gvl_yield
+ (22) main thread waits at gvl_yield:112 (native_cond_wait)
+ As described above, the main thread can't escape from
+ rb_threadptr_execute_interrupts_common.
+ See extended memo: http://bugs.ruby-lang.org/projects/ruby-trunk/wiki/R35480_ExtendedMemo
+
+Fri Apr 27 07:15:07 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/socket.c (sock_s_pack_sockaddr_un): support the longest
+ path in sockaddr_un, really.
+ reported by nagachika.
+ http://d.hatena.ne.jp/nagachika/20120426/ruby_trunk_changes_35474_35476
+
+Thu Apr 26 12:28:06 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/raddrinfo.c (init_unix_addrinfo): support the longest
+ path in sockaddr_un.
+ (inspect_sockaddr): ditto.
+ (addrinfo_mdump): ditto.
+ (addrinfo_mload): ditto.
+ (rsock_unixpath_str): new function.
+ (rsock_unixpath): removed.
+ (rsock_unixaddr): use rsock_unixpath_str.
+
+ * ext/socket/socket.c (sock_s_pack_sockaddr_un): support the longest
+ path in sockaddr_un.
+ (sock_s_unpack_sockaddr_un): ditto.
+ (sock_s_gethostbyaddr): unused variable removed.
+
+ * ext/socket/unixsocket.c (rsock_init_unixsock): support the longest
+ path in sockaddr_un.
+
+ * ext/socket/rubysocket.h (rsock_unixpath_str): declared.
+ (rsock_unixpath): removed.
+
+ * test/socket/test_unix.rb: comment out test_nul because abstract unix
+ sockets may contain NULs.
+
+Thu Apr 26 01:32:33 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * test/optparse/test_summary.rb (test_summary_containing_space): add
+ test for r35467. OptionParser#to_a shouldn't split banner by spaces.
+
+Wed Apr 25 23:02:46 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/raddrinfo.c (init_unix_addrinfo): refine error message
+ format.
+ (addrinfo_mload): show more information on "too long AF_UNIX path"
+ error.
+ (addrinfo_unix_path): ditto for "too short AF_UNIX address" and
+ "too long AF_UNIX address" error.
+
+Wed Apr 25 05:46:12 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/optparse.rb (OptionParser#to_a): split for each lines.
+ [ruby-dev:45568][Bug #6348]
+
+Tue Apr 24 21:57:53 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/raddrinfo.c (init_unix_addrinfo): show actual path length
+ when it is too long for Unix socket.
+
+ * ext/socket/unixsocket.c (rsock_init_unixsock): ditto.
+
+ * ext/socket/socket.c (sock_s_pack_sockaddr_un): ditto.
+
+Tue Apr 24 21:43:58 2012 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * lib/net/smtp.rb (check_continue): raise an error with an explanatory
+ message. [ruby-core:35854] [Feature #4598]
+
+Tue Apr 24 21:11:31 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/optparse.rb (OptionParser#to_a): should split by end-of-line,
+ and MUST TEST IT, MUST RUN THE TEST, MUST VERIFY BEFORE BACKPORT.
+ [ruby-dev:45568][Bug #6348]
+
+Tue Apr 24 19:59:31 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * enc/euc_jp.c: added EUC-JP-2004 and its alias EUC-JISX0213.
+ [ruby-dev:45571] [Feature #6349]
+ Requested by Kyouhei Yanagita <yanagi@shakenbu.org>.
+
+ * enc/trans/japanese_euc.trans: ditto.
+
+ * enc/trans/JIS/JISX0213-[12]%UCS@{BMP,SIP}.src: JIS X 0213:2004 ->
+ Unicode mapping table from NetBSD.
-Sat Jan 29 22:16:26 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * enc/trans/JIS/UCS@{BMP,SIP}%JISX0213-[12].src: Unicode -> JIS X
+ 0213:2004 mapping table from NetBSD.
- * array.c (rb_ary_join): [].join.encoding must be US-ASCII.
- [ruby-list:47790]
+ * tool/transcode-tblgen.rb: added SIP support.
-Sat Jan 29 20:22:39 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/ruby/test_transcode.rb: tests of above changes.
- * benchmark/driver.rb (BenchmarkDriver#measure): Show command line
- when abnormal exiting occur.
+Tue Apr 24 18:12:13 2012 Koichi Sasada <ko1@atdot.net>
-Sat Jan 29 10:53:16 2011 Yusuke Endoh <mame@tsg.ne.jp>
+ * compile.c: fix to output warning when the same literals
+ are available as a condition of same case clause.
+ And remove information ('#n') because we can find duplicated
+ condition with explicit line numbers.
+ [ruby-core:38343] [Ruby 1.9 - Bug #5068]
- * vm_insnhelper.c (vm_get_ev_const): no-scope reference to toplevel
- private constant has been prohibited incorrectly.
+ * test/ruby/test_syntax.rb: add a test for above.
- * test/ruby/test_module.rb (test_toplevel_private_constant): add a
+Tue Apr 24 17:03:51 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (waitpid): need to check the return value of
+ FindChildSlotByHandle() before passing poll_child_status().
+ this fixed a SEGV in test-all. reported by ko1 via IRC.
+
+Tue Apr 24 16:04:39 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_yylex): EXPR_BEG by keywords is a start point of
+ commands. [ruby-dev:45563][Bug #6347]
+
+ * parse.y (superclass): ditto for superclass.
+
+ * parse.y (parser_parse_string, parser_here_document): ditto for
+ string interpolation.
+
+ * parse.y (parser_yylex): ditto for singleton class.
+
+Tue Apr 24 15:51:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/optparse.rb (OptionParser#to_a): should split by end-of-line
+ [ruby-dev:45568][Bug #6348]
+
+ * lib/optparse.rb (OptionParser#to_a): String#to_a is no longer
+ defined. [ruby-dev:45568][Bug #6348]
+
+Tue Apr 24 12:46:50 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * hash.c, object.c, struct.c, lib/ostruct.rb: add to_h methods.
+ [Feature #6276]
+
+Tue Apr 24 10:54:34 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/drb/drbtest.rb ({DRbCore,DRbAry}#teardown): cannot pass SIGTERM
+ to another process on Windows, so use SIGINT instead.
+
+Tue Apr 24 00:25:39 2012 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * thread.c (rb_check_deadlock): refine an error message of deadlock
+ detection. [ruby-core:44336] [Bug #6288]
+
+Tue Apr 24 00:14:42 2012 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * parse.y (primary): remove wrong "fixpos" that caused incorrect
+ source_location of blocks. [ruby-core:42232] [Bug #5930]
+
+ * test/ruby/test_proc.rb: add a test for above.
+
+Mon Apr 23 22:56:08 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/iconv: deprecated. [Feature #6322]
+
+Mon Apr 23 22:07:00 2012 Tanaka Akira <akr@fsij.org>
+
+ * test/socket/test_unix.rb (bound_unix_socket): make temporary
+ filename shorter for less possibility of Unix socket path over
+ 107 bytes when TMPDIR has long path.
+
+Mon Apr 23 20:35:49 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (szInternalCmds, internal_match, internal_cmd_match):
+ get rid of a segmentation fault with GCC 4.7.0.
+ reported by raylinn@gmail.com (ray linn) at [ruby-core:44505]
+ [Bug #6333], and patched by mame.
+
+ * test/ruby/test_system.rb (TestSystem#test_system): test for it.
+
+Mon Apr 23 20:11:02 2012 Tanaka Akira <akr@fsij.org>
+
+ * lib/drb/ssl.rb: generate 1024 bits RSA key instead of 512 bits.
+ OpenSSL 1.0.1 rejects 512 bits RSA key for TLS1.2 with SHA512.
+ http://rt.openssl.org/Ticket/Display.html?id=2769&user=guest&pass=guest
+ reported by Bohuslav Kabrda.
+ [ruby-core:43844] [ruby-trunk - Bug #6221]
+
+Mon Apr 23 19:54:33 2012 Tanaka Akira <akr@fsij.org>
+
+ * test/drb/drbtest.rb: rescue Errno::ESRCH for Process.kill.
+ reported by NARUSE, Yui. [ruby-dev:45551]
+
+Mon Apr 23 14:16:45 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * .gdbinit (rb_ps_vm): follow st_table's packing change.
+
+Mon Apr 23 10:43:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in: disable rubygems not to load rbconfig.rb before
+ fake.rb. [ruby-core:44492][Bug #6329]
+
+Sun Apr 22 20:26:06 2012 Tanaka Akira <akr@fsij.org>
+
+ * lib/drb/extservm.rb (DRb::ExtServManager): don't use /bin/sh to
+ invoke service subprocess. mark detach threads for clean up.
+
+ * test/drb/drbtest.rb: clean up the service subprocess in teardown.
+
+ * test/drb/test_drb.rb: set @service_name for teardown.
+
+ * test/drb/test_drbunix.rb: ditto.
+
+ * test/drb/test_drbssl.rb: ditto.
+
+ [ruby-dev:45547]
+
+Sun Apr 22 07:51:29 2012 Tanaka Akira <akr@fsij.org>
+
+ * lib/drb/ssl.rb: close accepted TCP socket if SSL accept is failed.
+ [ruby-dev:45541]
+
+Sat Apr 21 14:36:49 2012 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+
+ * test/rinda/test_rinda.rb: fix sticks on some tests problem
+ [Bug #6272]
+
+Fri Apr 20 12:24:04 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/ssl_certs/AddTrustExternalCARoot.pem: Removed to avoid
+ conflict with ca-bundle.pem
+ * lib/rubygems/ssl_certs/VerisignClass3PublicPrimaryCertificationAuthority-G2.pem:
+ ditto.
+ * lib/rubygems/ssl_certs/Entrust_net-Secure-Server-Certification-Authority.pem:
+ ditto.
+
+Fri Apr 20 08:07:06 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems 1.8.23 which contains security
+ fixes:
+
+ RubyGems now disallows redirection from HTTPS to HTTP.
+
+ RubyGems now verifies SSL connections.
+
+ See https://github.com/rubygems/rubygems/blob/1.8/History.txt for
+ changes since 1.8.22.
+ * test/rubygems: ditto.
+
+Thu Apr 19 16:33:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * strftime.c (rb_strftime_with_timespec): fix carry-up bug and
+ overwrite '+' with '-' if negative offset less than a hour.
+ [ruby-core:44447][Bug #6323]
+
+Thu Apr 19 09:39:57 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/-test-/win32/dln/extconf.rb: need import library for ordinal
+ entry even on mingw. [ruby-core:44441][Bug #6320]
+
+Thu Apr 19 09:35:15 2012 Eric Hodel <drbrain@segment7.net>
+
+ * random.c (random_init): Clarify that the default seed is
+ Random.new_seed, not zero. Based on patch by Roger Pack.
+ [ruby-trunk - Bug #6313]
+ * random.c (rb_f_srand): ditto.
+
+Thu Apr 19 08:59:02 2012 Eric Hodel <drbrain@segment7.net>
+
+ * ext/curses/curses.c (window_nodelay): Fixed call-seq of nodelay to
+ include the '='.
+
+ Improved description window.nodelay=.
+
+Thu Apr 19 08:47:54 2012 Eric Hodel <drbrain@segment7.net>
+
+ * io.c (io_readpartial): Document the output buffer parameter is
+ overwritten with the read contents even when non-empty.
+ Patch by yu nobuoka. [ruby-trunk - Bug #6285]
+ * io.c (io_read_nonblock): ditto.
+ * io.c (io_read): ditto.
+ * io.c (rb_io_sysread): ditto.
+ * io.c (argf_read): ditto.
+ * io.c (argf_readpartial): ditto.
+ * ext/stringio/stringio.c (strio_read): ditto.
+ * test/ruby/test_argf.rb (class TestArgf): Add test for existing
+ behavior of read outbuf.
+ * test/ruby/test_io.rb (class TestIO): ditto.
+ * test/stringio/test_stringio.rb (class TestStringIO): ditto.
+
+Wed Apr 18 22:58:55 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (DOT, DOXYGEN): use AC_CHECK_PROGS instead of
+ AC_CHECK_PROG which needs the third argument. [ruby-core:44433]
+ [Bug #6316]
+
+ * configure.in (PKG_CONFIG): fix condition to skip older version
+ of pkg-config. continue in backticks does not affect outside.
+
+Wed Apr 18 13:59:40 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/file.c (INVALID_FILE_ATTRIBUTES): define for old SDK.
+
+Wed Apr 18 10:22:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * strftime.c (rb_strftime_with_timespec): add an interim digit for
+ the timezone offset which is less than an hour.
+
+Wed Apr 18 09:58:29 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/version.rb: Fixed init_with warning by calling into
+ yaml_initialize (for syck) from psych's init_with
+
+Wed Apr 18 09:03:43 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems 1.8.22 plus r33517 and r35337 which
+ were ported to the rubygems git repository.
+
+ See https://github.com/rubygems/rubygems/blob/1.8/History.txt for
+ changes since 1.8.11.
+
+ * test/rubygems: ditto.
+
+Tue Apr 17 22:18:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * strftime.c (rb_strftime_with_timespec): fix padding of time zone
+ offset. [ruby-dev:43287][Bug #4458]
+
+Tue Apr 17 13:11:14 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dln.c (rb_w32_check_imported): skip ordinal entries. based on a
+ patch by phasis68 (Heesob Park) at [ruby-core:44381].
+ [ruby-core:44371][Bug #6303]
+
+Mon Apr 16 18:22:14 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * spec/default.mspec: expand relative path for ruby_exe which uses
+ them with Dir.chdir; it breaks relative paths, for example
+ core/kernel/exec_spec.rb.
+
+Mon Apr 16 16:22:40 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (gmtime_r, localtime_r): POSIX compliant reentrant
+ versions.
+
+ * configure.in (RUBY_MSVCRT_VERSION): define on mingw too.
+
+ * win32/Makefile.sub (config.h): prefix RT_VER with RUBY and make
+ more descriptive to get rid of potential conflict.
+
+Mon Apr 16 15:19:39 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (NO_RUBY_VENDOR_LIB): fix missing comma.
+
+Mon Apr 16 12:17:12 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/matrix.rb (hermitian?): Bug fix, patch by George Koehler
+ [Bug #6290] [rubyspec:4b9573d7613]
+
+Mon Apr 16 09:42:50 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/rubygems/remote_fetcher.rb (Gem::RemoteFetcher#download): should
+ use File.identical? to check the identity of the files.
+ this fixed an error of a test on Windows.
+
+Sat Apr 14 12:55:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (UNREACHABLE): gcc 4.4 eliminates unreachable code
+ if -O3 is given.
+
+ * win32/win32.c (child_result): dropped colon.
+
+Sat Apr 14 10:45:18 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/webrick/server.rb (WEBrick::GenericServer#start):
+ partially revert r35315.
+
+ * test/webrick/test_server.rb (test_start_exception):
+ received signal is delivered to the main thread, so it is needed to
+ emulate it. patched by Eric Hodel. [ruby-core:44348] [Feature #6236]
+
+Sat Apr 14 09:35:45 2012 Eric Hodel <drbrain@segment7.net>
+
+ * variable.c (trace_ev): Removed "not reached" comment as this line is
+ reached.
+ * variable.c (rb_obj_remove_instance_variable): Replaced "not reached"
+ comment with the UNREACHABLE macro.
+ * variable.c (rb_mod_const_missing): ditto.
+ * variable.c (rb_mod_remove_cvar): ditto.
+ * enum.c (first_i): ditto.
+ * string.c (rb_str_aref): ditto.
+ * string.c (str_byte_aref): ditto.
+ * string.c (rb_to_id): ditto.
+ * io.c (rb_io_fmode_modestr): ditto.
+ * io.c (rb_io_oflags_modestr): ditto.
+ * pack.c (num2i32): ditto.
+ * vm_eval.c (rb_method_missing): ditto.
+ * vm_eval.c (rb_f_throw): ditto.
+ * dir.c (dir_read): ditto.
+ * win32/win32.c (child_result): ditto.
+ * struct.c (rb_struct_getmember): ditto.
+ * struct.c (rb_struct_set): ditto.
+ * struct.c (rb_struct_aref_id): ditto.
+ * eval.c (rb_f_raise): ditto.
+ * process.c (rb_f_exit_bang): ditto.
+ * process.c (rb_f_exit): ditto.
+ * process.c (rb_f_abort): ditto.
+ * ext/-test-/iter/break.c (iter_break_value): ditto.
+ * ext/pty/pty.c (pty_check): ditto.
+ * ext/openssl/ossl_pkey.c (ossl_pkey_new): ditto.
+ * ext/readline/readline.c (rb_remove_history): ditto.
+ * ext/stringio/stringio.c (strio_unimpl): ditto.
+ * numeric.c (num_sadded): ditto.
+ * numeric.c (num_init_copy): ditto.
+ * numeric.c (rb_num2ll): ditto.
+ * numeric.c (rb_num2ull): ditto.
+ * vm_insnhelper.c (call_cfunc): ditto.
+ * ruby.c (opt_W_getter): ditto.
+ * bignum.c (rb_big_coerce): ditto.
+ * file.c (rb_f_test): ditto.
+
+Sat Apr 14 08:38:20 2012 Eric Hodel <drbrain@segment7.net>
+
+ * encoding.c (rb_enc_codepoint_len): Use UNREACHABLE to avoid "control
+ reaches end of non-void function" warnings. [ruby-trunk - Bug #6066]
+ * re.c (name_to_backref_number): ditto.
+ * object.c (rb_Float): ditto.
+ * io.c (io_readpartial): ditto.
+ * io.c (io_read_nonblock): ditto.
+ * pack.c (rb_uv_to_utf8): ditto.
+ * proc.c (rb_method_entry_arity): ditto.
+ * vm_method.c (rb_f_notimplement): ditto.
+ * struct.c (rb_struct_aset_id): ditto.
+ * class.c (rb_scan_args): ditto.
+ * process.c (rlimit_resource_type): ditto.
+ * process.c (rlimit_resource_value): ditto.
+ * process.c (p_uid_switch): ditto.
+ * process.c (p_gid_switch): ditto.
+ * ext/digest/digest.c (rb_digest_instance_update): ditto.
+ * ext/digest/digest.c (rb_digest_instance_finish): ditto.
+ * ext/digest/digest.c (rb_digest_instance_reset): ditto.
+ * ext/digest/digest.c (rb_digest_instance_block_length): ditto.
+ * ext/bigdecimal/bigdecimal.c (BigDecimalCmp): ditto.
+ * ext/dl/handle.c (rb_dlhandle_close): ditto.
+ * ext/tk/tcltklib.c (pending_exception_check0): ditto.
+ * ext/tk/tcltklib.c (pending_exception_check1): ditto.
+ * ext/tk/tcltklib.c (ip_cancel_eval_core): ditto.
+ * ext/tk/tcltklib.c (lib_get_reltype_name): ditto.
+ * ext/tk/tcltklib.c (create_dummy_encoding_for_tk_core): ditto.
+ * ext/tk/tkutil/tkutil.c (tk_hash_kv): ditto.
+ * ext/openssl/ossl_ssl.c (ossl_ssl_session_reused): ditto.
+ * ext/openssl/ossl_pkey_ec.c (ossl_ec_key_dsa_verify_asn1): ditto.
+ * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_at_infinit): ditto.
+ * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_on_curve): ditto.
+ * ext/fiddle/conversions.c (generic_to_value): ditto.
+ * ext/socket/raddrinfo.c (rsock_io_socket_addrinfo): ditto.
+ * ext/socket/socket.c (sock_s_getnameinfo): ditto.
+ * ext/ripper/eventids2.c (ripper_token2eventid): ditto.
+ * cont.c (return_fiber): ditto.
+ * dmydln.c (dln_load): ditto.
+ * vm_insnhelper.c (vm_search_normal_superclass): ditto.
+ * bignum.c (big_fdiv): ditto.
+ * marshal.c (r_symlink): ditto.
+ * marshal.c (r_symbol): ditto.
+
+Fri Apr 13 17:12:09 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * hash.c (inspect_i): keep string's coderange.
+
+Fri Apr 13 15:26:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (rb_hash_aset, rb_hash_update, rb_hash_update_by): use
+ st_update() to reduce evaluation of hash values.
+
+Fri Apr 13 15:17:36 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/webrick/server.rb (WEBrick::GenericServer#stop): fix r35303;
+ this method is to deny new connections, not shutdown yet.
+
+ * lib/webrick/server.rb (WEBrick::GenericServer#start):
+ re-raise exception only when the exception is Interrupt (^C).
+
+Thu Apr 12 19:51:45 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: added some notes.
+
+Wed Apr 11 17:16:49 2012 Koichi Sasada <ko1@atdot.net>
+
+ * compile.c (compile_array, compile_array_):
+ Divide big array (or hash) literals into several blocks and
+ concatenate them. There was a problem that a big array (hash)
+ literal causes SystemStackError exception (stack overflow)
+ because VM push all contents of the literal onto VM stack to
+ make an array (or hash). To solve this issue, we make several
+ arrays (hashes) and concatenate them to make a big array (hash)
+ object. [ruby-dev:37701] [Bug #982]
+
+ * compile.c (iseq_compile_each, setup_args): use modified
+ compile_array.
+
+ * vm.c (m_core_hash_from_ary, m_core_hash_merge_ary,
+ m_core_hash_merge_ptr): added for above change.
+
+ * id.c (Init_id), parse.y: add core method ids.
+
+ * bootstraptest/test_literal.rb: add simple tests.
+
+ * bootstraptest/test_eval.rb: remove rescue clause to catch
+ SystemStackError exception.
+
+ * test/ruby/test_literal.rb: add tests to check no stack overflow.
+
+Thu Apr 12 07:10:37 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/uri/generic.rb (module URI): URI now downcases the scheme to
+ follow RFC 2396 section 3.1. [ruby-trunk - Feature #4551]
+ * test/uri/test_generic.rb (class URI): Test for above
+
+Thu Apr 12 06:15:44 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/net/protocol.rb (module Net): Added ReadTimeout to match
+ OpenTimeout. ReadTimeout is now raised by rbuf_fill instead of
+ Timeout::Error to help users distinguish what type of timeout
+ occurred. [ruby-trunk - Feature #6088]
+ * lib/net/pop.rb (module Net): Updated documentation for ReadTimeout
+ and OpenTimeout.
+ * lib/net/http.rb (module Net): ditto
+ * lib/net/smtp.rb (module Net): ditto
+ * lib/net/telnet.rb (module Net): Net::ReadTimeout is now raised in
+ waitfor to match Net::Protocol.
+ * test/net/http/test_http.rb: Updated Timeout::Error expectation to
+ Net::ReadTimeout.
+ * test/net/ftp/test_ftp.rb: ditto
+
+Thu Apr 12 05:27:01 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/webrick/server.rb (module WEBrick::GenericServer): A server
+ will now continue only when a StandardError subclass is raised. For
+ other exception types the error will be logged at the fatal level and
+ the server will safely stop. Based on a patch by Alex Young.
+ [ruby-trunk - Feature #6236]
+ * test/webrick/test_server.rb: Test for new exception handling
+ behavior. Join the server thread instead of busy-waiting for it to
+ shut down to remove race conditions.
+
+Thu Apr 12 03:50:44 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit:Runner::Worker#_run_suites):
+ call GC.start before running the test suites.
+
+Wed Apr 11 22:31:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (rb_check_id_cstr): new function to check if ID is
+ registered with NUL-terminated C string.
+
+ * sprintf.c (rb_str_format): avoid inadvertent symbol creation.
+
+Wed Apr 11 20:28:36 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * io.c (rb_io_eof): use eof() instead of io_fillbuf(). It's because
+ io_unread() doesn't work properly when reading CRLF with read(length)
+ and mode 'r'.
+ [ruby-core:44189][Bug #6271]
+
+ * test/ruby/test_io_m17n.rb (TestIO_M17N#test_read_crlf_and_eof):
test for above.
-Sat Jan 29 08:43:23 2011 Ryan Davis <ryand-ruby@zenspider.com>
+Wed Apr 11 07:38:33 2012 Eric Hodel <drbrain@segment7.net>
- * lib/rubygems*: Import rubygems 1.5.0 (release candidate @ 09893d9)
- * test/rubygems: Ditto
+ * ext/digest/sha2/lib/sha2.rb (Digest#block_length): Fixed method name
+ in documentation examples. Patch by naleski via
+ https://github.com/ruby/ruby/pull/115
-Sat Jan 29 02:02:37 2011 Yusuke Endoh <mame@tsg.ne.jp>
+Wed Apr 11 07:33:13 2012 Eric Hodel <drbrain@segment7.net>
- * variable.c (rb_mod_const_of, sv_i): Module#constant should exclude
- private constants. see [ruby-core:32912].
+ * pack.c (pack_pack): Warn when an invalid character is found in the
+ format string when $VERBOSE is true. [ruby-trunk - Feature #5219]
+ * pack.c (pack_unpack): ditto
+ * test/ruby/test_pack.rb (class TestPack): Test for warnings on
+ invalid format characters.
- * test/ruby/test_module.rb (test_constants_with_private_constant): add
- a test for above.
+Wed Apr 11 06:11:10 2012 Eric Hodel <drbrain@segment7.net>
-Sat Jan 29 01:36:41 2011 Yusuke Endoh <mame@tsg.ne.jp>
+ * string.c (rb_str_tr): Documented use of \ to escape characters.
+ [ruby-trunk - Bug #6161]
+ * string.c (rb_str_count): ditto
- * variable.c (rb_const_set): const_set should preserve constant
- visibility. see [ruby-core:32912].
+Wed Apr 11 05:14:51 2012 Eric Hodel <drbrain@segment7.net>
- * test/ruby/test_module.rb: add a test for above.
+ * lib/abbrev.rb: Clarified that Abbrev.abbrev returns a Hash instead
+ of an Array. Patch by Andrei Bocan. [ruby-trunk - Bug #6107]
-Sat Jan 29 01:24:57 2011 Yusuke Endoh <mame@tsg.ne.jp>
+Wed Apr 11 03:02:24 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * compile.c (NODE_CLASS, NODE_MODULE), insns.def (defineclass): raise
- an exception when "class Foo::Bar" is evaluated and Foo::Bar is
- private. To implement this, define_type of "defineclass" is added
- so that the instruction can distinguish whether the class definition
- is scoped (class Foo::Bar) or not (class Bar).
+ * ext/ripper/lib/ripper/sexp.rb: fix spelling. patched by
+ Jonathan Hinkle via https://github.com/ruby/ruby/pull/116
- * test/ruby/test_class.rb (test_redefine_private_class),
- test/ruby/test_module.rb
- (test_define_module_under_private_constant): add tests for above.
+Tue Apr 10 19:07:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jan 29 01:19:17 2011 Yusuke Endoh <mame@tsg.ne.jp>
+ * error.c (rb_enc_raise): new function to raise an exception with
+ the message in the given encoding. patched by now (Nikolai
+ Weibull) at [ruby-core:41160]. [Feature #5650]
- * constant.h, variable.c: to ensure compatibility, rb_const_get_* must
- not raise an exception even when the constant is private. Instead,
- rb_public_const_get_* and rb_public_const_defined_* are introduced,
- which raise an exception when the referring constant is private.
- see [ruby-core:32912].
+Tue Apr 10 18:19:32 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * vm_insnhelper.c (vm_get_ev_const): use rb_public_const_get_* instead
- of rb_const_get_* to follow the constant visibility when user code
- refers a constant.
+ * lib/net/http.rb (Net::HTTP#send_request_with_body_stream):
+ use IO.copy_stream for requests using body_stream.
+ patched by Eric Wong. [ruby-core:40898] [Feature #5605]
- * test/ruby/test_marshal.rb (test_marshal_private_class): add a test.
- This test had failed because of incompatibility of rb_const_get.
+Tue Apr 10 16:53:21 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jan 29 00:30:44 2011 Yusuke Endoh <mame@tsg.ne.jp>
+ * thread_pthread.c: add prototype declarations for older Mac OS X.
+ [ruby-core:43376][Bug #6170]
- * variable.c (set_const_visibility): fix typo. a patch from Tomoyuki
- Chikanaga in [ruby-core:32919].
+Tue Apr 10 15:35:21 2012 Koichi Sasada <ko1@atdot.net>
-Fri Jan 28 23:20:28 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * compile.c (iseq_set_sequence): show a hint if there are duplicated
+ "when" clauses. [ruby-core:41502] [ruby-trunk - Feature #5716]
- * test/gdbm/test_gdbm.rb (TestGDBM#test_s_open_no_create,
- TestGDBM2#test_writer_open_notexist): We only need to skip libgdbm
- 1.8.0, not all 1.8.x. 1.8.1 or later don't have GDBM_WRITER sickness.
+Tue Apr 10 09:57:00 2012 Eric Hodel <drbrain@segment7.net>
-Fri Jan 28 21:56:57 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * string.c (rb_str_split_m): Documented behavior of split on the empty
+ string. [ruby-trunk - Feature #3575]
- * ext/dbm/extconf.rb: Added new header places for Fedora13.
+Tue Apr 10 09:48:31 2012 Eric Hodel <drbrain@segment7.net>
-Fri Jan 28 21:49:30 2011 Tanaka Akira <akr@fsij.org>
+ * ext/zlib/zlib.c (rb_deflate_s_deflate): Fixed ruby example replacing
+ NO_FLUSH with FINISH. [ruby-trunk - Bug #6273]
- * ext/zlib/zlib.c: parenthesize macro arguments.
+Mon Apr 9 23:10:26 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jan 28 17:47:33 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * win32/win32.c (isUNCRoot, winnt_stat): support long UNC.
+ [ruby-core:30623][Feature #3399]
- * test/gdbm/test_gdbm.rb (TestGDBM2#test_writer_open_notexist):
- gdbm 1.8.x changed GDBM::WRITER behavior. Thus our testcase need
- to be changed too.
+Mon Apr 9 15:16:01 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jan 28 17:33:28 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * parse.y (string_content, parser_yylex): count brace nesting to
+ dispatch embexpr_end. [ruby-core:43775][Bug #6211]
- * test/gdbm/test_gdbm.rb (TestGDBM#test_s_open_no_create): skip
- the test if gdbm version is 1.8.x.
+Mon Apr 9 13:06:58 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Fri Jan 28 16:30:51 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * hash.c (rb_hash_set_default_proc): Accept nil, patch by Run Paint
+ [Feature #4234]
- * test/ruby/test_require.rb (TestRequire#test_require_too_long_filename):
- Added -w option because too long path error don't output a message
- by default since r30660. [Bug #4336] [ruby-dev:43134]
+ * test/ruby/test_hash.rb: test for above.
-Fri Jan 28 16:19:38 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Mon Apr 9 08:01:15 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * test/ruby/test_require.rb (TestRequire#test_require_path_home_{1,2}):
- Added -w option because too long path error don't output a message
- by default since r30660. [Bug #4336] [ruby-dev:43134]
+ * ext/date/date_strftime.c: gets the value with range() consistently.
+ * ext/date/date_strftime.c (range): now just replaces the given item.
-Fri Jan 28 16:04:54 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Mon Apr 9 06:58:01 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * test/ruby/test_require.rb (TestRequire#test_require_path_home_{1,2,3}):
- split from test_require_path_home.
+ * complex.c (nucomp_expt): [ruby-core:44170].
-Fri Jan 28 13:04:38 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Mon Apr 9 02:52:03 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * configure.in (--with-valgrind): Fixed r29683. Now this option
- is really default on.
+ * complex.c (nucomp_expt): the result of f_complex_new2 may be a fixnum
+ with mathn. [ruby-core:44170] [Bug #6267]
-Fri Jan 28 12:05:48 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Sun Apr 8 22:46:01 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * configure.in: Add #include<sys/stat.h> when struct stat is
- tested. Otherwise, incomplete type dereference error will occur.
+ * ext/json/generator/generator.c (generate_json_bignum):
+ add RB_GC_GUARD.
+ http://fb.rubyci.org/~chkbuild/ruby-trunk/log/20120407T210301Z.diff.html.gz
-Fri Jan 28 11:53:19 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Sun Apr 8 07:26:40 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * configure.in: redundant variable names made strange conftest
- error. Fixed it.
+ * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler): get keys
+ and fetch values from it to prevent @timeout_info's error
+ "can't add a new key into hash during iteration".
-Fri Jan 28 11:47:00 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Sun Apr 8 06:51:57 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * test/ruby/test_process.rb (TestProcess#test_too_long_path{,2}):
- should handle Errno::E2BIG, because this test checks crash of ruby,
- not the error type system.
+ * io.c (io_unread): cast as long the value for extra_max.
+ [ruby-core:44137] [Bug #6257]
-Fri Jan 28 11:23:54 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Sun Apr 8 06:46:48 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * io.c (rb_io_open): Use NUM2MODET() instead NUM2UINT().
- * io.c (rb_scan_open_args): ditto.
+ * lib/webrick/httpresponse.rb (WEBrick::HTTPResponse#send_body_io):
+ use readpartial to get data even if the response is streaming data and
+ each data is smaller than @buffer_size.
+ patched by yu nobuoka. [ruby-dev:45471] [Bug #6230]
-Fri Jan 28 10:58:20 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Sat Apr 7 22:35:36 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * configure.in: Added mode_t type checking.
- * process.c (rb_exec_arg_addopt): Use NUM2MODET() instead
- NUM2LONG because clang makes compile error by this narrowing
- conversion.
- * process.c (rb_run_exec_options_err): ditto.
+ * include/ruby/win32.h (rb_w32_aspawn_flags): add the declaration of
+ new function.
-Fri Jan 28 02:37:18 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * process.c (enum): add EXEC_OPTION_PGROUP and move the position
+ above for the usage in proc_spawn_n().
- * re.c (rb_reg_raise): add GC guard to prevent intermediate
- variable from GC.
+ * process.c (proc_spawn_n): add an argument to pass new option
+ `new_pgroup`. The option specifies CREATE_NEW_PROCESS_GROUP flag to
+ CreateProcessW(). This flag is necessary for the usage of
+ Process.kill on the subprocess on Windows.
-Fri Jan 28 02:35:41 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * process.c (rb_exec_arg_addopt): ditto.
- * hash.c (rb_hash_fetch_m): add GC guard to prevent intermediate
- variable from GC.
+ * process.c (rb_spawn_process): ditto.
-Fri Jan 28 01:33:51 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * process.c (documentation for rb_f_spawn): add documentation for new
+ option `new_pgroup` of spawn.
- * test/ruby/test_process.rb (TestProcess#test_too_long_path)
- TestProcess#test_too_long_path): Reduced string size from 100MB
- to 10MB. 100MB may cause no memory error. It isn't intended.
+ * test/ruby/test_process.rb (TestProcess#test_execopts_new_pgroup):
+ add tests for option `new_pgroup`.
-Fri Jan 28 01:27:42 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/ruby/test_thread.rb
+ (TestThreadGroup#test_thread_timer_and_interrupt):
+ add option `new_pgroup: true` to spawn on Windows. It's needed for
+ Process.kill on a subprocess.
- * test/ruby/test_process.rb (TestProcess#test_too_long_path2):
- Factored out from test_too_long_path. A test should only do
- one test.
+ * win32/win32.c (CreateChild): add an argument to pass
+ dwCreationFlags of CreateProcessW().
-Thu Jan 27 23:29:36 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/win32.c (rb_w32_spawn): ditto.
- * st.c (st_foreach): check if unpacked.
+ * win32/win32.c (rb_w32_aspawn_flags): add new function to pass
+ dwCreationFlags.
-Thu Jan 27 23:14:19 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/win32.c (rb_w32_aspawn): refactor to move the content to
+ rb_w32_aspawn_flags().
+ [ruby-core:43245][Bug #6131]
- * misc/ruby-mode.el (ruby-mode-map): remove deprecated binding.
- use M-; instead.
+Sat Apr 7 22:32:00 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Thu Jan 27 21:58:32 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/ruby/test_thread.rb
+ (TestThreadGroup#test_thread_timer_and_interrupt): skip on Windows.
+ Process.kill cannot kill a subprocess if CREATE_NEW_PROCESS_GROUP
+ flag is not specified in a call to CreateProcessW().
- * bignum.c (rb_str_to_inum): get rid of too huge alloca().
+ * win32/win32.c (CreateChild): revert the usage of
+ CREATE_NEW_PROCESS_GROUP flag for compatibility.
+ [ruby-core:43245][Bug #6131]
-Thu Jan 27 21:43:29 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Sat Apr 7 10:28:40 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * object.c (rb_str_to_dbl): rewrite again. use ALLOCV instead
- rb_str_tmp_new().
+ * ext/psych/lib/psych.rb: bumping up psych version to match release.
+ * ext/psych/psych.gemspec: ditto
-Thu Jan 27 21:41:47 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Sat Apr 7 02:07:00 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * win32/win32.c: get rid of STRNDUPA(). It's dangerous API.
+ * ext/psych/parser.c: fall back to any encoding if the external
+ encoding is wrong. [ruby-core:44163]
+ * test/psych/test_encoding.rb: fix test
-Thu Jan 27 21:31:57 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Fri Apr 6 16:24:24 2012 Martin Duerst <duerst@it.aoyama.ac.jp>
- * win32/win32.c (rb_w32_aspawn): get rid of too huge alloca().
- [Bug #4330] [ruby-core:34898]
+ * struct.c (documentation for rb_struct_members_m):
+ fix 'array of strings' to 'array of symbols'
+ [ruby-core:44152][Bug #6264]
-Thu Jan 27 20:30:18 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Fri Apr 6 14:27:04 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * win32/win32.c (rb_w32_spawn): get rid of too huge alloca().
+ * Makefile.in ($(LIBRUBY_A)): fix typo.
-Thu Jan 27 18:49:53 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Thu Apr 5 13:26:15 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (open_dir_handle): get rid of too huge alloca().
+ * missing/alloca.c (xmalloc, xfree): use ruby version, not
+ depending on RUBY_LIB_PREFIX. [ruby-dev:45492][Bug #6255]
-Thu Jan 27 18:34:58 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Wed Apr 4 13:06:39 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * file.c (w32_io_info): get rid of too huge alloca().
- [Bug #4313] [ruby-core:34830]
+ * lib/ftp/ftp.rb (Net::FTP#close): restore original read_timeout.
-Thu Jan 27 18:19:51 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Wed Apr 4 10:33:31 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * win32/win32.c (wstati64): get rid of too huge alloca().
- [Bug #4316] [ruby-core:34834]
+ * lib/ftp/ftp.rb (Net::FTP#close): ignore exceptions from shutdown and
+ read on closing.
-Thu Jan 27 15:11:52 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Apr 4 01:48:35 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * win32/win32.c (rb_w32_spawn, rb_w32_aspawn): get rid of too huge
- alloca(). this is the real fix of [ruby-core:34833].
+ * lib/ftp/ftp.rb (Net::FTP#close): close socket more gracefully.
-Thu Jan 27 12:46:25 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/ftp/ftp.rb (Net::BufferedSocket#shutdown): added.
- * process.c (ALLOC_ARGV_WITH_STR): fix void pointer arithmetic.
+ * test/net/ftp/test_ftp.rb (FTPTest#create_ftp_server): wait socket
+ with shutdown and read.
-Thu Jan 27 08:41:40 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Apr 3 19:00:52 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * process.c (proc_exec_v, rb_proc_exec_n, rb_proc_exec)
- (proc_spawn_n, proc_spawn): get rid of too huge alloca().
- [ruby-core:34827], [ruby-core:34833]
+ * test/net/ftp/test_ftp.rb (FTPTest#create_ftp_server): should wait
+ a little before closing socket because if the client call
+ Net::FTP#getmultiline the socket is suddenly closed by the server in
+ the getline loop.
-Thu Jan 27 08:32:17 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Apr 3 18:33:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * include/ruby/ruby.h (ALLOCV): new API for exception-safe
- temporary buffer. [ruby-core:34844]
+ * process.c (setreuid, setregid): suppress warnings.
+ [ruby-core:43374][Bug #6169]
- * string.c (rb_alloc_tmp_buffer, rb_free_tmp_buffer):
- implementation of the API.
+Tue Apr 3 10:18:27 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jan 27 08:22:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * enumerator.c (inspect_enumerator): suppress uninitialized
+ instance variable warnings. [ruby-dev:45449][Bug #6214]
+ patched by no6v (Nobuhiro IMAI).
- * dln_find.c (dln_find_1): use rb_warning and return immediately
- if fname is longer than buffer.
+Mon Apr 2 13:25:08 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jan 26 22:57:30 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+ * lib/optparse/ac.rb: autoconf-like options.
- * class.c (clone_method): add GC guard to prevent intermediate
- variable from GC. [Bug #4321] [ruby-dev:43107]
+Mon Apr 2 10:34:00 2012 eregon <eregontp@gmail.com>
-Wed Jan 26 22:45:16 2011 Tanaka Akira <akr@fsij.org>
+ * string.c (rb_str_start_with, rb_str_end_with): raise an error if
+ an argument is not convertible to a String.
+ [ruby-core:40623][Bug #5536]
- * template/id.h.tmpl: parenthesize macro arguments.
+Mon Apr 2 03:35:25 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Jan 26 22:28:49 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+ * lib/webrick/server.rb (WEBrick::GenericServer): close socket only if
+ the socket is not closed yet.
- * vm_eval.c (rb_throw_obj): add GC guard to prevent intermediate
- variable from GC. [Bug #4322] [ruby-dev:43108]
+Sun Apr 1 23:03:18 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Jan 26 17:08:59 2011 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * lib/net/ftp.rb (Net::BufferedSocket): should delegate send() to @io
+ for Net::FTP#abort and Net::FTP#status.
- * ext/openssl/ossl_asn1.c (ossl_asn1_decode0): OpenSSL::ASN1.decode
- should reject indefinite length primitive encodings as that is
- illegal. Patch by Martin Bosslet. See #4324.
+Sun Apr 1 00:41:56 2012 Shugo Maeda <shugo@ruby-lang.org>
-Wed Jan 26 10:36:28 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/net/ftp.rb: fixed the domain name in examples.
- * string.c (=~): documentation fix; the return value is nil when
- it doesn't match. patched by Andrei Kulakov [ruby-core:34562]
+Sat Mar 31 21:39:45 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Jan 25 08:41:58 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler): dup to prevent
+ @timeout_info's "can't add a new key into hash during iteration".
- * dln_find.c (dln_find_1): omit too long pathnames.
+Sat Mar 31 14:22:59 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jan 25 08:28:19 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * hash.c (hash_default_value): extract from rb_hash_aref(), to be
+ shared with rb_hash_shift(), so that overriding Hash#default
+ will be respected.
- * string.c (rb_str_resize): get rid of out-of-bound access.
+Sat Mar 31 14:16:02 2012 Sokolov Yura (funny-falcon) <funny.falcon@gmail.com>
-Tue Jan 25 07:48:22 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * hash.c: do not allocate st_table when it is not necessary.
- * test/ruby/test_thread.rb: remove unused variables.
+Sat Mar 31 13:42:39 2012 Shugo Maeda <shugo@ruby-lang.org>
-Tue Jan 25 07:45:44 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * lib/net/ftp.rb (read_timeout=, open_timeout=): supported timeout.
- * test/ruby/test_thread.rb (TestThread#test_condvar_nolock_2): get
- rid of method redefined.
+Sat Mar 31 13:20:40 2012 Sokolov Yura (funny-falcon) <funny.falcon@gmail.com>
-Tue Jan 25 07:00:52 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * hash.c: remove unnecessary checks for Qundef in hash iterations.
+ since hash use st_foreach_check for iterations, such checks are
+ needless.
- * string.c (rb_string_value_cstr): rb_str_modify can change
- RSTRING_PTR.
+Sat Mar 31 12:05:01 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Tue Jan 25 03:24:28 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * ext/openssl/ossl_x509cert.c: Fix doc typo.
- * test/ruby/test_thread.rb: Added various ConditionVariable tests.
+Sat Mar 31 10:13:24 2012 Sokolov Yura (funny-falcon) <funny.falcon@gmail.com>
-Mon Jan 24 22:26:33 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * st.c (st_foreach_check, st_foreach): remove ancient check. This
+ check are from initial ordered hash commit when first entry were
+ created with entry->fore = entry->back = entry.
- * object.c (rb_str_to_dbl): Fix again. use rb_str_tmp_new()
- instead ALLOC_N.
+ * st.c (st_delete): use real_entries in st_delete for packed tables
-Mon Jan 24 21:50:48 2011 Tanaka Akira <akr@fsij.org>
+Sat Mar 31 07:53:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_insnhelper.h: parenthesize macro arguments.
+ * st.c (st_foreach_check): remove the entry by replacing with never
+ when ST_DELETE.
-Mon Jan 24 21:28:34 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * hash.c (st_foreach_safe): since table is not for VALUE, Qundef is
+ not special value, so use 0 instead. therefore this function can be
+ applied to only st_table which 0 is invalid as keys, e.g., IDs.
- * object.c (rb_str_to_dbl): use ALLOC_N instead ALLOCA_N because
- ALLOC_N may cause stack overflow.
+ * hash.c: Qundef cannot be passed from st_foreach_check().
-Mon Jan 24 21:04:45 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * hash.c, marshal.c, object.c, variable.c: fix callback argument types
+ of iterators.
- * error.c (rb_invalid_str): prevent intermediate variable from GC.
- [ruby-core:34820]
+Thu Mar 29 23:50:15 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jan 23 23:01:54 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * st.c (st_update): pass pointer to key to the callback function.
- * test/io/console/test_io_console.rb: Don't run test if the system
- don't support io/console.
+Thu Mar 29 16:36:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Jan 23 22:17:07 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * st.c (st_update): add existing parameter to the callback function.
- * test/fiddle/test_fiddle.rb: Don't run test if the system don't support
- fiddle.
+Thu Mar 29 16:35:32 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/fiddle/test_function.rb: ditto.
- * test/fiddle/test_closure.rb: ditto.
+ * lib/test/unit.rb (terminal_width, del_status_line, put_status):
+ extract as methods.
-Sun Jan 23 11:39:18 2011 Tanaka Akira <akr@fsij.org>
+Thu Mar 29 10:20:18 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * vm_exec.h: parenthesize macro arguments.
+ * ext/openssl/ossl_pkcs7.c: fix crash when parsing garbage data.
+ * test/openssl/test_pkcs7.rb: assert correct behavior for it.
+ Thanks to Matt Venables for reporting the issue.
+ [ruby-core:43250][Bug #6134]
-Sun Jan 23 10:33:02 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Mar 29 10:16:05 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * template/fake.rb.in (ruby): suppress warnings.
+ * thread_win32.c (TIME_QUANTUM_USEC): 10ms(= old setting) [experimental]
+ cf. [Bug #6098]
-Sun Jan 23 08:00:09 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Mar 29 10:12:12 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * string.c (str_nth_len, str_utf8_nth): return the rest length together.
+ * thread.c (rb_threadptr_execute_interrupts_common): use defined
+ TIME_QUANTUM_USEC instead of a magic number. there is no meanings
+ to use different values for checking interval of interruption and
+ thread switching limits.
+ cf. [Bug #6098]
- * string.c (rb_str_substr): get rid of measure the length always
- to improve performance for huge string. [ruby-core:34648]
+Thu Mar 29 09:26:17 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Sun Jan 23 00:40:10 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/openssl/test_x509cert.rb: exclude test that fails when issuing
+ a certificate with RSA signature and DSS1 digest for earlier
+ OpenSSL versions when used in conjunction with OpenSSL 1.0.1.
+ Thanks, Vit Ondruch, for reporting the issue.
+ [ruby-core:42949][Bug #6089]
- * test/test_syslog.rb: Fix to make a lot of test failure if
- the platform doesn't support syslog.
+Thu Mar 29 08:25:35 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Sat Jan 22 11:49:55 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+ * NEWS: add note about unified behavior of encoding nil values in
+ instances of OpenSSL::ASN1::ASN1Data.
- * ext/psych/lib/psych/visitors/to_ruby.rb: fixing merge key support
- when multiple merge keys are specified.
+Thu Mar 29 07:45:36 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * test/psych/test_merge_keys.rb: tests for multi-merge key support
+ * ext/openssl/ossl_asn1.c: raise TypeError when trying to encode nil
+ values for Primitive instances.
+ * test/openssl/test_asn1.rb: Assert consistent behavior when
+ encoding nil values: Primitives raise TypeError, Constructives
+ raise NoMethodError.
+ Fixes [ruby-core:43009][Bug #6102]
-Sat Jan 22 11:33:04 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+Wed Mar 28 16:39:59 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/psych/lib/psych/visitors/to_ruby.rb: merge keys are actually
- part of YAML 1.1, so they should be supported. Remove warning and
- merge keys to parent. [ruby-core:34679]
+ * process.c (obj2uid, obj2gid): allow strings as input user/group id.
+ [ruby-core:40923][Feature #5610]
- * test/psych/test_merge_keys.rb: test for merge keys
+Wed Mar 28 15:06:18 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jan 22 10:25:19 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+ * marshal.c (r_symreal): default to ASCII-8BIT for non-ascii symbols,
+ otherwise it should be converted to US-ASCII in rb_intern_str() if
+ possible. [ruby-core:43762][Bug #6209]
- * ext/psych/parser.c (parse): add the file name to the exception when
- parse errors occur.
+Wed Mar 28 08:44:24 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * test/psych/test_parser.rb: test for parse error file name
+ * ext/psych/lib/psych.rb: updating version to match gem
+ * ext/psych/psych.gemspec: ditto
+ * ext/psych/lib/psych/visitors/to_ruby.rb: fixing deprecation warning
-Sat Jan 22 10:12:30 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+Tue Mar 27 23:44:11 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/psych/parser.c (parse): fix assertion error when reusing a
- parser after an exception has been raised
+ * io.c (io_unread): fixed memory leak. report by nagachika via IRC.
- * test/psych/test_parser.rb: test for assertion error
+Tue Mar 27 22:44:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jan 22 04:09:22 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+ * configure.in (verconf.h): separate load path specific stuff from
+ config.h.
- * ext/psych/lib/psych/nodes/node.rb: Make Psych::Nodes::Node
- enumerable.
+Tue Mar 27 22:43:40 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/psych/lib/psych/visitors/depth_first.rb: Add a depth-first
- visitor to enumerate over a YAML AST in a depth-first fashion
+ * win32/Makefile.sub: fix config.h path to include.
- * test/psych/nodes/test_enumerable.rb: test for enumerating nodes
+Tue Mar 27 17:08:08 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * test/psych/visitors/test_depth_first.rb: test for depth-first
- visitor
+ * win32/win32.c (check_if_dir): fix memory leak.
-Sat Jan 22 00:53:42 2011 Tanaka Akira <akr@fsij.org>
+Tue Mar 27 13:13:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_core.h: parenthesize macro arguments.
+ * string.c (str_new_empty): should copy also the encoding as an
+ empty substring. [ruby-dev:45441][Bug #6206]
-Fri Jan 21 18:15:09 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Mar 26 23:43:04 2012 Shugo Maeda <shugo@ruby-lang.org>
- * configure.in: should not use -Werror=* flags while conftests.
+ * lib/net/ftp.rb (parse227, parse228, parse229): don't use $~.
-Fri Jan 21 09:17:00 2011 Luis Lavena <luislavena@gmail.com>
+Mon Mar 26 23:34:40 2012 Shugo Maeda <shugo@ruby-lang.org>
- * configure.in: Fix incorrectly detected x86_64-w64-mingw32 due
- canonalization of target_os. Bug #3889 [ruby-core:32634]
+ * lib/net/ftp.rb (parse227, parse228, parse229): don't use local
+ variables defined by named capture for other Ruby implementations
+ such as Rubinius.
-Thu Jan 20 23:44:00 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Mon Mar 26 23:19:03 2012 Shugo Maeda <shugo@ruby-lang.org>
- * configure.in: Fix rb_cv_va_args_macro was broken. We are using
- -Werror=implicit-function-declaration compile option. therefore
- we need a function declaration explicitly.
+ * lib/net/ftp.rb (parse_pasv_port): refactored.
-Thu Jan 20 23:58:02 2011 Tanaka Akira <akr@fsij.org>
+Mon Mar 26 19:49:49 2012 Shugo Maeda <shugo@ruby-lang.org>
- * node.h: parenthesize macro arguments.
+ * test/net/ftp/test_ftp.rb: add the test, which was forgotten in the
+ previous commit.
-Thu Jan 20 23:25:28 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Mon Mar 26 19:37:27 2012 Shugo Maeda <shugo@ruby-lang.org>
- * configure.in: Add '#include <stdlib.h>' to
- rb_cv_localtime_overflow test too. It's reported by Tomoyuki
- Chikanaga. Thanks.
+ * lib/net/ftp.rb (parse227, parse228, parse229): refactored.
-Thu Jan 20 16:11:00 2011 Kenta Murata <mrkn@mrkn.jp>
+Mon Mar 26 11:46:23 2012 Shugo Maeda <shugo@ruby-lang.org>
- * README.EXT, README.EXT.ja: You shouldn't choose ``conftest.c'' as a
- name of a source file.
+ * enumerator.c (inspect_enumerator): show method arguments of
+ lazy enumerators correctly.
-Thu Jan 20 12:15:44 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Mon Mar 26 13:51:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in: Add stdlib.h inclusion into rb_cv_negative_time_t
- test because it's required for exit(3). The patch is
- created by Tomoyuki Chikanaga. [Bug #4287] [ruby-dev:43060]
+ * win32/win32.c (check_if_dir, check_if_wdir): fix for Visual C++
+ not to use S_ISDIR(). [Feature #2408][ruby-core:26925]
-Thu Jan 20 11:39:41 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ruby.c (load_file_internal): ditto.
- * test/webrick/utils.rb (TestWEBrick::RubyBin): test CGI does not need
- to load rubygems. if it activated, ruby raises LoadError about
- rbconfig.rb.
+Mon Mar 26 11:46:01 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jan 20 09:19:42 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+ * ruby.c (load_file_internal): bail out if the script is a directory.
+ [Feature #2408][ruby-core:26925]
- * ext/psych/lib/psych/visitors/json_tree.rb: Fix JSON emit for
- DateTime and Time classes.
+ * win32/win32.c (rb_w32_open, rb_w32_wopen): check if the file is a
+ directory when access denied, to set errno to EISDIR.
- * test/psych/test_json_tree.rb: test for JSON emit
+Sun Mar 25 18:13:14 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Jan 20 08:02:46 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+ * string.c (tr_setup_table): fix multiple non latin argument for
+ non latin (over 256 characters) tr-like methods.
+ [ruby-core:43371] [Bug #6167]
- * ext/psych/lib/psych/coder.rb (represent_object): arbitrary objects
- may be passed to the Psych::Coder object.
+Sun Mar 25 00:46:06 2012 Shugo Maeda <shugo@ruby-lang.org>
- * ext/psych/lib/psych/visitors/yaml_tree.rb: support for visiting
- arbitrary objects set on the coder.
+ * enumerator (lazy_initialize): set the instance variable "receiver"
+ to include the receiver to the return value of inspect on a lazy
+ enumerator directly created by Enumerator::Lazy.new.
- * test/psych/test_coder.rb: supporting test case.
+ * enumerator (RETURN_LAZY): don't set the instance variable "receiver".
-Thu Jan 20 06:03:17 2011 Tanaka Akira <akr@fsij.org>
+Sat Mar 24 23:59:00 2012 Shugo Maeda <shugo@ruby-lang.org>
- * method.h: parenthesize macro arguments.
+ * enumerator (enumerator_inspect): include the original receiver and
+ method name of Enumerator::Lazy in the result of inspect.
+ [ruby-core:43345] [Bug #6159]
-Wed Jan 19 13:16:05 2011 Eric Hodel <drbrain@segment7.net>
+ * enumerator (InitVM_Enumerator): don't use rb_define_alias for
+ some methods such as collect in order to make rb_frame_this_func()
+ return the correct method names.
- * lib/rubygems/commands/sources_command.rb: Finish removing code,
- (fixes sources command test).
+Sat Mar 24 22:22:18 2012 Sambasiva Rao Suda <sambasivarao@gmail.org>
-Wed Jan 19 13:04:16 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * time.c (time_init_1): Time.new will accept seconds as string or
+ int. [ruby-core:43569][Bug #6193]
- * proc.c (proc_call): Add gc guard to avoid segfault. The fix
- is created by Tomoyuki Chikanaga. [Bug #4238][ruby-dev:42963]
+Fri Mar 23 15:12:12 2012 Martin Duerst <duerst@it.aoyama.ac.jp>
-Wed Jan 19 12:31:28 2011 Eric Hodel <drbrain@segment7.net>
+ * transcode.c (documentation for str_encode): Explain
+ that transcoding to the same encoding is a no-op
+ (i.e. no exceptions, no replacements,...).
+ [ruby-core:43557][Bug #6190]
- * lib/rubygems.rb: Since gem_prelude requires rubygems, enable
- custom_require always.
+Fri Mar 23 13:19:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jan 19 12:08:08 2011 Eric Hodel <drbrain@segment7.net>
+ * bignum.c (rb_str_to_inum): must be ASCII compatible encoding as
+ well as String#hex and String#oct. [ruby-core:43566][Bug #6192]
- * lib/rubygems/commands/dependency_command.rb: Remove require of
- deleted file.
- * lib/rubygems/commands/fetch_command.rb: ditto
- * lib/rubygems/commands/setup_command.rb: ditto
- * lib/rubygems/commands/sources_command.rb: ditto
- * lib/rubygems/commands/specification_command.rb: ditto
+ * string.c (rb_must_asciicompat): check if ASCII compatible.
-Wed Jan 19 08:13:59 2011 Ryan Davis <ryand-ruby@zenspider.com>
+Thu Mar 22 23:14:36 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rubygems*: Import rubygems 1.5.0 (release candidate)
- * test/rubygems: Ditto
+ * transcode.c (str_encode_bang, encoded_dup): if nothing was
+ transcoded, just set encoding but leave coderange unchanged as
+ force_encoding. [ruby-core:43557][Bug #6190]
-Tue Jan 18 23:31:01 2011 Yusuke Endoh <mame@tsg.ne.jp>
+Thu Mar 22 22:30:44 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * parse.y: avoid NULL reference. [ruby-dev:43067]
+ * io.c (static int io_fflush): add the definition.
+ Use it in set_binary_mode_with_seek_cur().
-Wed Jan 19 02:54:04 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * io.c (set_binary_mode_with_seek_cur): refactoring to split the
+ content into io_unread(). Fix the possibility of buffer overflow.
- * vsnprintf.c (cvt): set first byte of buf to NUL for the case when
- no bytes are written to the buf. [ruby-dev:43062]
+ * io.c (io_unread): add new implementation for Windows. Previous one
+ caused invalid cursor position using IO#pos with OS text mode. New
+ one fixes the bug.
-Tue Jan 18 23:04:51 2011 Tanaka Akira <akr@fsij.org>
+ * test/ruby/test_io_m17n.rb
+ (TestIO_M17N#test_pos_dont_move_cursor_position): add a test for
+ above bug.
+ [ruby-core:43497] [Bug #6179]
- * gc.h: parenthesize macro arguments.
+Thu Mar 22 19:55:08 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Jan 18 18:31:14 2011 Keiju Ishitsuka <keiju@ishitsuka.com>
+ * win32/win32.c (rb_w32_fstat, rb_w32_fstati64): convert FILETIME
+ to time_t directly, not to be affected by TZ unnecessarily.
- * lib/irb/completion.rb: Irb tab completion support for XX::method
- forms.
+ * win32/win32.c (unixtime_to_filetime): convert time_t to FILETIME
+ simply.
-Tue Jan 18 15:05:55 2011 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Thu Mar 22 13:43:31 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/logger.rb: added RDoc document for logging message escape
- by Hal Brodigan. See #3869
+ * ext/openssl/ossl_pkey_rsa.c (rsa_generate): fix argument type.
+ [Bug #6094]
-Tue Jan 18 07:53:52 2011 Tanaka Akira <akr@fsij.org>
+Thu Mar 22 11:14:10 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * eval_intern.h: parenthesize macro arguments.
+ * test/ruby/test_io.rb (TestIO#test_pos_with_getc): updated.
+ see [ruby-core:43550]
-Tue Jan 18 04:42:44 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+Wed Mar 21 17:57:57 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/psych/lib/psych/parser.rb (Mark): Adding a class to wrap
- marker information
+ * regcomp.c: Merge Onigmo 3d855b30d574536d3ae600260208c6624ae4791c.
+ [Bug#6143] [Bug#6144] [Bug#6145]
- * ext/psych/parser.c (mark): Add a method to return the mark object
- for the parser
+Wed Mar 21 17:01:55 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/psych/test_parser.rb: tests for the Mark class.
+ * test/ruby/test_io.rb (TestIO#test_pos_with_getc): added.
+ see [Bug #6179][ruby-core:43518]
-Tue Jan 18 02:46:55 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+Mon Mar 19 17:18:51 2012 Shugo Maeda <shugo@ruby-lang.org>
- * ext/psych/lib/psych/visitors/json_tree.rb (visit_String): JSON
- strings should be dumped with double quotes. [ruby-core:34186]
+ * enumerator.c (lazy_flat_map_func): convert the block value to
+ Array if it doesn't respond to each. [ruby-core:43334]
+ [Bug #6155]
- * test/psych/test_json_tree.rb: test for double quotes
+Mon Mar 19 16:34:14 2012 Shugo Maeda <shugo@ruby-lang.org>
-Mon Jan 17 23:36:33 2011 Tanaka Akira <akr@fsij.org>
+ * enum.c (zip_i): variadic argument needs explicit cast on the
+ platforms where VALUE is longer than int.
- * array.c (rb_ary_times): less MEMCPY calls.
+Mon Mar 19 15:36:41 2012 Shugo Maeda <shugo@ruby-lang.org>
-Mon Jan 17 22:54:33 2011 Tanaka Akira <akr@fsij.org>
+ * enumerator.c (enumerable_lazy): add an example of take and first
+ to the documentation. [ruby-core:43344] [Bug #6158]
+ add the description of the behavior when a block is given to zip
+ or cycle.
- * debug.h: parenthesize macro arguments.
+Mon Mar 19 15:20:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jan 17 21:40:25 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * compile.c (iseq_specialized_instruction): DRY and replace chain
+ of if-else with switch for special instructions. based on a
+ patch by Vasfed. https://github.com/ruby/ruby/pull/105
- * ruby.c (process_options): revert r30549.
+Mon Mar 19 15:05:54 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
-Sun Jan 16 20:55:45 2011 Tanaka Akira <akr@fsij.org>
+ * test/test_pty.rb: same as r29280, skip tests when PTY allocation
+ failed (that's not our fault).
- * vsnprintf.c: parenthesize macro arguments.
+Sun Mar 18 23:21:17 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jan 15 11:57:30 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (aligned_free): fix condition for free. memalign() and
+ posix_memalign() are not defined together normally.
- * configure.in (warnflags): add -Werror=implicit-function-declaration
- if available.
+Sun Mar 18 18:31:45 2012 Yuki Sonoda (Yugui) <yugui@yugui.jp>
- * lib/mkmf.rb (init_mkmf): ignore warnings in mkmf tests.
+ * gc.c (aligned_malloc, aligned_free): added fallback implementations
+ for platforms like OSX Leopard.
- * test/mkmf/base.rb (setup, teardown): restore config values.
+Sun Mar 18 17:17:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/mkmf/test_flags.rb: split from test_find_executable.rb.
+ * bignum.c (rb_big_pow): estimate result bit size more precisely.
+ [ruby-core:30735][Feature #3429]
-Sat Jan 15 10:04:14 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Mar 18 17:17:36 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ruby.c (process_options): autoload rubygems.
+ * gc.c (free_method_entry_i): method entry may be in
+ unlinked_method_entry_list. [ruby-core:43383][Bug #6171]
- * tool/compile_prelude.rb (Prelude#initialize): ignore empty
- preludes.
+Sun Mar 18 15:27:31 2012 Tanaka Akira <akr@fsij.org>
- * ruby.c (ruby_init_prelude): get rid of global namespace
- pollution.
+ * compile.c: typo fix by Run Paint Run Run.
+ [ruby-core:28368] [Bug #2824]
-Sat Jan 15 09:42:12 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Mar 18 10:01:02 2012 Kazuki Tsujimoto <kazuki@callcc.net>
- * include/ruby/io.h: missing prototypes.
+ * lib/profiler.rb: support calling singleton methods of
+ an instance of BasicObject.
-Fri Jan 14 23:25:55 2011 Tanaka Akira <akr@fsij.org>
+Sat Mar 17 06:56:58 2012 Eric Hodel <drbrain@segment7.net>
- * vm_method.c: parenthesize macro arguments.
+ * object.c: Fix indentation of Class#inherited example.
-Fri Jan 14 15:32:29 2011 Shugo Maeda <shugo@ruby-lang.org>
+Sat Mar 17 01:46:05 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * test/net/imap/test_imap.rb: call neither logout nor disconnect
- unless connected. patch by Kazuhiro NISHIYAMA. [ruby-dev:42860]
+ * string.c (trnext): fix bug with string ending with '\\'.
+ [ruby-dev:45374][Bug #6160]
-Fri Jan 14 14:56:57 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/ruby/test_string.rb (TestString#test_delete): test for
+ above.
- * lib/net/imap.rb: use bytesize for binary strings.
- patched by Yoshimasa Niwa. [ruby-core:34222]
+Fri Mar 16 20:06:24 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jan 14 14:01:12 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * string.c (trnext): should advance char-wise.
+ [ruby-core:43335][Bug #6156]
- * pack.c (pack_unpack): the resulted string of unpack('M') must have
- ASCII-8BIT encoding (and ENC_CODERANGE_VALID). [ruby-core:34482]
+Fri Mar 16 17:42:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jan 14 13:38:58 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * parse.y (block_append_gen): fix unreachable warning line number.
+ should warn at the code, not jump.
- * ext/zlib/zlib.c (gzfile_check_footer): ISIZE (Input SIZE) in
- gzip's header is the size of uncompressed input data modulo 2^32.
- [ruby-core:34481] http://www.ietf.org/rfc/rfc1952.txt
+Fri Mar 16 17:33:08 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jan 14 11:36:25 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * enum.c (enum_take): allocate buffer array before iteration, as well
+ as enum_first did.
- * configure.in, win32/Makefile.sub (RUNRUBY): require path should
- include "." because rbconfig.rb is there.
+ * enum.c (enum_first): remove duplication.
-Fri Jan 14 10:40:11 2011 Ryan Davis <ryan@lust.local>
+Fri Mar 16 14:43:18 2012 Yuki Sonoda (Yugui) <yugui@yugui.jp>
- * gem_prelude.rb: Just require rubygems. Fixes rubygems 1.4.
- * lib/rubygems.rb: removed all Gem::Quickloader code.
- * ruby.c: renamed ruby_init_gems to ruby_init_prelude. Set
- $disable_rubygems since there is no fine grained mechanism to
- skip parts of the prelude. Open to suggestions on how to do this
- better.
- * test/*.rb: Load path isn't set up correctly, so add
- --disable-gems as needed to failing tests that are explicitly
- testing stderr w/ ==.
+ * load.c (ruby_init_ext): don't free the given pointer itself.
+ It is not guaranteed even that the pointer is on heap.
-Fri Jan 14 07:30:47 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Mar 16 14:37:57 2012 Shugo Maeda <shugo@ruby-lang.org>
- * io.c (argf_next_argv): go advance when the next file cannot be
- read. [ruby-core:34446]
+ * vm_eval.c (rb_mod_module_eval): fix the documentation of
+ class_eval to mention class variable lookup. [ruby-core:40649]
+ [Bug #5544]
-Thu Jan 13 20:49:19 2011 Tanaka Akira <akr@fsij.org>
+Fri Mar 16 14:27:11 2012 Shugo Maeda <shugo@ruby-lang.org>
- * vm_insnhelper.c: parenthesize macro arguments.
+ * vm_eval.c (rb_mod_module_eval): fix the documentation of
+ class_eval to mention constant lookup. [ruby-core:41718]
+ [Bug #5777]
-Thu Jan 13 13:21:00 2011 Kenta Murata <mrkn@mrkn.jp>
+Fri Mar 16 14:10:45 2012 Shugo Maeda <shugo@ruby-lang.org>
- * vm_dump.c: delete dashes to make lines 80 chars, Patched by
- Shota Fukumori (sora_h). [Bug #4275] [ruby-dev:43021]
+ * lib/net/imap.rb (initialize): raise Net::IMAP::Error when the
+ connection is closed without a greeting response.
+ [ruby-core:40938] [Bug #5616]
-Thu Jan 13 13:21:00 2011 Kenta Murata <mrkn@mrkn.jp>
+Fri Mar 16 13:50:12 2012 Shugo Maeda <shugo@ruby-lang.org>
- * vm_dump.c: fix misspelling of CrashReporter, Patched by Shota
- Fukumori (sora_h). [Bug #4275] [ruby-dev:43021]
+ * lib/net/imap.rb (rfc822_text): ignore [] after RFC822.
+ [ruby-core:40945] [Bug #5620]
-Thu Jan 13 06:27:29 2011 Ryan Davis <ryand-ruby@zenspider.com>
+Fri Mar 16 12:00:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * error.c: Exception#to_s should actually call to_s.
+ * vm_insnhelper.c (argument_error): use line number at the beginning
+ of lambda, not the first code of its body.
+ [ruby-core:43314][Bug #6151]
-Thu Jan 13 00:32:54 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * iseq.c (rb_iseq_first_lineno): constified.
- * addr2line.c (get_nth_dirname): decrement the directory index
- because the index specifies the index of given included_directories
- which is separated by NUL and its index is begun from 1.
- Note that 0 specifies the current directory of the compilation.
- see also http://www.dwarfstd.org/doc/dwarf-2.0.0.pdf
+Fri Mar 16 11:20:07 2012 Shugo Maeda <shugo@ruby-lang.org>
-Thu Jan 13 00:06:38 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * enumerator.c (lazy_take): don't enumerate an extra value.
+ [ruby-dev:45370] [Bug #6152]
- * io.c (rb_f_syscall): Add warning messages. [ruby-core:34062]
+Fri Mar 16 06:30:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jan 13 00:00:07 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * enumerator.c (lazy_zip_func): variadic argument needs explicit cast
+ on the platforms where VALUE is longer than int.
- * io.c (rb_f_syscall): Some syscall return unsigned or pointer value.
- Therefore we should only check the result is -1 or not.
- [ruby-core:34062]
+ * enumerator.c (lazy_init_iterator): no need to check overflow twice.
-Wed Jan 12 23:55:48 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Fri Mar 16 05:47:09 2012 Eric Hodel <drbrain@segment7.net>
- * io.c (rb_f_syscall): Add 64bit Linux support. Some syscall takes
- long type arguments.
+ * enumerator.c (lazy_init_iterator): Fix type error (int vs long).
-Wed Jan 12 19:37:10 2011 Tanaka Akira <akr@fsij.org>
+Thu Mar 15 23:13:36 2012 Shugo Maeda <shugo@ruby-lang.org>
- * vm_dump.c: parenthesize macro arguments.
+ * enum.c (rb_enum_values_pack): rename from enum_values_pack, and
+ remove static.
-Wed Jan 12 19:28:23 2011 Tanaka Akira <akr@fsij.org>
+ * enumerator.c (lazy_init_iterator, lazy_init_yielder,
+ lazy_select_func, lazy_reject_func, lazy_grep_func): handle
+ multiple values correctly.
- * vm.c (thread_free): reset ruby_current_thread if it points the
- thread to free.
- * gc.c (slot_sweep): don't call RUBY_VM_SET_FINALIZER_INTERRUPT if
- there is no current thread.
- [ruby-dev:43000]
+ * enumerator.c (lazy_grep): change the behavior when a block is
+ given, to be consistent with Enumerable#grep.
-Wed Jan 12 19:09:29 2011 Tanaka Akira <akr@fsij.org>
+Thu Mar 15 19:12:31 2012 Shugo Maeda <shugo@ruby-lang.org>
- * enum.c (sort_by_i): reenter check more strictly.
- (sort_by_cmp): ditto.
- [ruby-dev:43003] reported by Usaku NAKAMURA.
+ * enumerator.c (lazy_zip): rescue StopIteration returned by
+ Enumerator#next.
-Wed Jan 12 16:25:12 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+Thu Mar 15 18:19:53 2012 Shugo Maeda <shugo@ruby-lang.org>
- * lib/net/http.rb (Net::HTTP#connect): makes it timeout during
- SSL handshake too. [ruby-core:34203]
- Patch by Marc Slemko.
+ * enumerator.c (lazy_zip, lazy_cycle): Enumerator::Lazy#{zip,cycle}
+ should be eager when a block is given, to be consistent with
+ Enumerable#{zip,cycle}.
- * test/net/http/test_http.rb (TestNetHTTP_v1_2#test_timeout_during_HTTP_session):
- test for [ruby-core:34203]
+Thu Mar 15 17:45:27 2012 Shugo Maeda <shugo@ruby-lang.org>
- * test/net/http/test_https.rb (TestNetHTTPS#test_timeout_during_SSL_handshake):
- ditto.
+ * enumerator.c (InitVM_Enumerator): renamed Enumerable::Lazy to
+ Enumerator::Lazy.
-Wed Jan 12 16:24:53 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+Thu Mar 15 16:37:38 2012 Shugo Maeda <shugo@ruby-lang.org>
- * ext/readline/extconf.rb: new checks for RL_PROMPT_START_IGNORE
- and RL_PROMPT_END_IGNORE. [ruby-core:34331]
+ * enumerator.c (enumerable_lazy): added cycle to the documentation.
- * ext/readline/readline.c: enables USE_INSERT_IGNORE_ESCAPE only if
- RL_PROMPT_{START,END}_IGNORE are available to get rid of compilation
- error with libedit.
+Thu Mar 15 15:37:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jan 12 15:53:49 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+ * parse.y (parser_yylex): fix warning line number.
- * README.EXT.ja (rb_ensure): typo.
+Thu Mar 15 15:19:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jan 12 11:33:46 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * enumerator.c (lazy_cycle): check argument number overflow before
+ creating temporary array.
- * addr2line.c: OpenBSD uses the elf_abi.h header file instead of the
- elf.h header file. patched by Jeremy Evans [ruby-core:34384]
+Thu Mar 15 15:04:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Jan 12 03:59:36 2011 NARUSE, Yui <naruse@ruby-lang.org>
+ * util.c (ruby_strtod): no need to check same digit for hexdigit
+ twice. [ruby-dev:45363][Bug #6146]
- * test/webrick/test_cgi.rb: Removes usage of deprecated
- :RequestHandler option.
- patched by Peter Weldon [ruby-core:34010]
+ * parse.y (sym_check_asciionly): check ascii compatibility before
+ scanning for code range.
- * test/webrick/test_httpproxy.rb: ditto.
+ * parse.y (intern_str): set to us-ascii if ascii only.
+ [ruby-dev:45363][Bug #6146]
- * test/webrick/test_httpserver.rb: Add a test of the deprecation
- behaviour.
+ * file.c (ruby_enc_find_basename): allow NULL as alllen.
+ [ruby-dev:45363][Bug #6146]
-Wed Jan 12 08:37:07 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Mar 15 14:49:31 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * hash.c (hash_i): return different values for inverse hash.
- [ruby-core:34334]
+ * string.c (rb_str_conv_enc_opts): default to original encoding.
-Tue Jan 11 20:32:59 2011 Tanaka Akira <akr@fsij.org>
+Thu Mar 15 13:47:17 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * variable.c: parenthesize macro arguments.
+ * hash.c (env_str_new, rb_f_getenv, env_fetch): use rb_str_conv_enc()
+ instead of rb_str_encode() to simplify the code.
-Tue Jan 11 13:06:38 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Mar 15 12:44:50 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * array.c (rb_ary_resize): should care of embeded array when extending
- the array.
+ * win32/win32.c, include/ruby/win32.h (rb_w32_ugetenv): new API to
+ accept and to return UTF-8 strings.
- * array.c (rb_ary_resize): need to set capa when changing the real
- size of the array.
- these are latent bugs.
+ * win32/win32.c (rb_w32_getenv): follow above change.
-Mon Jan 10 22:46:43 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/win32.c (rb_w32_get_environ): returns UTF-8 environment area.
- * include/ruby/defines.h (CASEFOLD_FILESYSTEM): HFS+ is case
- insensitive.
+ * hash.c (env_str_new, rb_f_getenv, env_fetch): follow above changes.
+ [Bug #5570] [ruby-core:40737]
- * load.c (loaded_feature_path, rb_feature_p, load_lock): on a
- case-insensitive filesystem, loaded features search should
- ignore case. [ruby-core:34297]
+Thu Mar 15 10:57:27 2012 Shugo Maeda <shugo@ruby-lang.org>
-Mon Jan 10 21:34:12 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * enumerator.c (lazy_cycle): add Enumerable::Lazy#cycle.
- * common.mk (showflags): show LD commands.
+Thu Mar 15 10:31:40 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Jan 10 14:32:55 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_arity.rb (TestArity#err_mess): use assert_raise.
- * test/ruby/test_method.rb (TestMethod#test_define_method): method
- transplanting between class and module is impossible.
+Thu Mar 15 07:03:52 2012 Eric Hodel <drbrain@segment7.net>
-Mon Jan 10 13:51:17 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_eval.c (check_funcall): Raise ArgumentError if respond_to?
+ requires more than three arguments. [Bug #6000]
- * misc/rdoc-mode.el (rdoc-mode): show trailing whitespace.
+ * test/ruby/test_object.rb (class TestObject): Test for respond_to?
+ requiring more than three arguments.
-Mon Jan 10 11:22:02 2011 Tanaka Akira <akr@fsij.org>
+Thu Mar 15 06:08:06 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * util.c: parenthesize macro arguments.
+ * include/ruby/intern.h: Add rb_check_arity, rb_error_arity [#6085]
-Mon Jan 10 07:41:31 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * array.c: Use rb_check_arity / rb_error_arity
- * misc/README: mention rdoc-mode.el and ruby-style.el.
+ * class.c: ditto
-Sun Jan 9 20:37:21 2011 Tanaka Akira <akr@fsij.org>
+ * enumerator.c: ditto
- * transcode.c: parenthesize macro arguments.
+ * eval.c: ditto
-Sun Jan 9 16:31:53 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+ * file.c: ditto
- * io.c (Kernel.#syscall): implemented on LP64/LLP64 environments too.
- also uses __syscall if available for *BSD on 64bit architecture.
- [ruby-core:34062]
+ * hash.c: ditto
-Sun Jan 9 16:31:34 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+ * numeric.c: ditto
- * lib/irb/locale.rb (IRB::Locale::LOCALE_NAME_RE):
- some platform has a locale without territory but with
- encoding.
- (#each_sub_locale): ditto.
+ * proc.c: ditto
+
+ * process.c: ditto
+
+ * random.c: ditto
+
+ * re.c: ditto
+
+ * signal.c: ditto
+
+ * string.c: ditto
+
+ * struct.c: ditto
+
+ * transcode.c: ditto
+
+ * vm_eval.c: ditto
+
+ * vm_insnhelper.c: ditto & implementation of rb_error_arity
+
+ * test/ruby/test_arity.rb: tests for above
+
+Thu Mar 15 06:08:05 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * vm_insnhelper.c: improve number of arguments error in case of
+ optional parameters (issue #6085)
+
+ * include/ruby/intern.h: define UNLIMITED_ARGUMENTS
+
+ * test/ruby/test_arity.rb: test for above
+
+Thu Mar 15 00:58:04 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * enumerator.c (enumerable_lazy): fix the documentation of
+ Enumerable#lazy.
+
+Wed Mar 14 22:01:06 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * enumerator.c (lazy_init_iterator): break when Qundef is returned
+ to make obj.drop(3).take(2) work properly.
+
+ * enumerator.c (lazy_take_while): add Enumerable::Lazy#take_while.
+
+ * enumerator.c (lazy_drop): add Enumerable::Lazy#drop.
+
+ * enumerator.c (lazy_drop_while): add Enumerable::Lazy#drop_while.
+
+ * enumerator.c (InitVM_Enumerator): add Enumerable::Lazy#force as an
+ alias of to_a.
+
+Wed Mar 14 19:28:40 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * enumerator.c (lazy_take): add Enumerable::Lazy#take.
+
+Wed Mar 14 18:40:36 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * enumerator.c: use long for array indices.
+
+Wed Mar 14 18:25:18 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * enumerator.c: moved the comment of StopIteration.
+
+Wed Mar 14 17:55:29 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * numeric.c (flodivmod): must go through the same pass if HAVE_FMOD or
+ not. this is a bugfix of r35013.
+
+Wed Mar 14 16:41:55 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/test_tmpdir.rb (TestTmpdir#test_world_writable): skip on Windows.
+
+Wed Mar 14 15:09:23 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Sun Jan 9 14:47:50 2011 TAKAO Kouji <kouji@takao7.net>
+ * numeric.c: fix flodivmod for cornercases [Bug #6044]
+ add ruby_float_mod
- * ext/readline/readline.c: apply a patch from Nobuyoshi Nakada.
- fixed #3616 [ruby-core:31484] IRB + readline incorrectly counts
- non-printing characters in prompt
+ * insns.def (opt_mod): use ruby_float_mod
-Sat Jan 8 21:47:26 2011 Tanaka Akira <akr@fsij.org>
+ * internal.h: declare ruby_float_mod
- * enum.c (enum_sort_by): use rb_ary_resize.
- (ary_cutoff): removed.
+ * test/ruby/test_float.rb: tests for above
-Sat Jan 8 21:24:17 2011 Tanaka Akira <akr@fsij.org>
+ * test/ruby/envutil.rb: create helper assert_is_minus_zero
- * pack.c (swapf): compilation condition simplified.
- (swapd): ditto.
+Wed Mar 14 10:44:35 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jan 8 20:51:25 2011 Tanaka Akira <akr@fsij.org>
+ * enumerator.c (lazy_grep_func): should use === instead of =~, as
+ well as Enumerable#grep
- * pack.c (swapd): remove duplicated code.
+Wed Mar 14 08:15:54 2012 Shugo Maeda <shugo@ruby-lang.org>
-Sat Jan 8 19:28:55 2011 Tanaka Akira <akr@fsij.org>
+ * enumerator.c (lazy_flat_map_func): use each for non-Array objects.
- * thread.c: parenthesize macro arguments.
+Wed Mar 14 08:06:35 2012 Shugo Maeda <shugo@ruby-lang.org>
-Fri Jan 7 23:07:40 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * enumerator.c (lazy_zip): add Enumerable::Lazy#zip.
- * lib/mkmf.rb (configuration): backref needs to capture.
+ * enumerator.c (lazy_lazy): just returns self.
-Fri Jan 7 21:57:22 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Mar 14 07:48:36 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * misc/ruby-mode.el (ruby-mode-variables), misc/ruby-style.el:
- show trailing whitespace.
+ * ext/date/date_core.c (datetime_s_now): [ruby-core:43256].
- * misc/ruby-mode.el (ruby-font-lock-syntactic-keywords): highlight
- regexp after open bracket. [ruby-core:34183]
+Tue Mar 13 22:00:14 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Jan 7 00:37:35 2011 Tanaka Akira <akr@fsij.org>
+ * compile.c (iseq_set_arguments): keyword rest arg without keyword args.
- * string.c: parenthesize macro arguments.
+ * node.c (dump_node): dump kw_rest_arg too.
-Thu Jan 6 22:42:02 2011 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * parse.y (block_param, f_arg): more kwrest patterns.
+ [ruby-core:42455][Bug #5989]
- * bignum.c (bigmul1_karatsuba): avoid overflow that make assertion
- fail in certain case. this patch is contributed from Ray Chason
- <chasonr at gmail.com> in personal communication.
+ * parse.y (new_args_gen): no extra kw_rest_arg if no keyword rest arg.
-Thu Jan 6 20:55:49 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Mar 13 15:17:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mkmf.rb (create_makefile): ignore rest from first dot from
- TARGET to generate init function name.
- this is followup of r30464.
+ * parse.y (block_param, f_args): add rules for the case arguments
+ begin with kwrest. [ruby-core:42455][Bug #5989]
-Thu Jan 6 11:27:01 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+Tue Mar 13 12:37:53 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/psych/lib/psych/json/tree_builder.rb (start_mapping): tags
- should not be included in JSON mapping
+ * io.c (io_encoding_set): always warn if external encoding and internal
+ encoding are identical. [ruby-core:40727] [Bug #5568]
-Thu Jan 6 09:23:33 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+Tue Mar 13 12:37:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/net/protocol.rb (eof?): BufferedIO should proxy eof? to the
- underlying IO object.
+ * gc.c: add ObjectSpace::WeakMap. [ruby-dev:44565][Bug #5350]
-Thu Jan 6 09:12:31 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+ * lib/weakref.rb: use WeakMap instead of _id2ref.
- * lib/mkmf.rb (configuration): fixing gsub when multiple error flags
- are passed to GCC.
+Tue Mar 13 10:59:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Jan 6 05:25:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * tool/rbinstall.rb (prepare): skip if basedir is not defined.
+ [ruby-core:39135][Bug #5238]
- * array.c (rb_ary_modify): export.
+ * tool/rbinstall.rb (CONFIG.[]): check for mandatory
+ configurations.
-Thu Jan 6 05:14:41 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Mar 13 00:09:18 2012 Shugo Maeda <shugo@ruby-lang.org>
- * ext/stringio/stringio.c (get_strio, strio_set_string)
- (strio_reopen): check if frozen. [ruby-core:33648]
+ * enumerator.c (enumerable_lazy): added documentation.
-Thu Jan 6 05:10:58 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Mar 12 20:19:25 2012 Tanaka Akira <akr@fsij.org>
- * array.c (rb_ary_resize): new utility function. [ruby-dev:42912]
+ * lib/tmpdir.rb (Dir::tmpdir): test the current directory suitable for
+ temporary directory.
-Thu Jan 6 05:03:26 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Mar 12 20:08:16 2012 Tanaka Akira <akr@fsij.org>
- * dln.c (init_funcname_len): ignore rest from first dot.
- [ruby-dev:41774]
+ * lib/fileutils.rb (fu_have_symlink?): specify TypeError for rescue
+ clause.
-Thu Jan 6 02:55:48 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+Mon Mar 12 19:23:13 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/psych/lib/psych/visitors/yaml_tree.rb: use YAML 1.0 output
- format for serializing nil values. Thanks Eric Hodel!
+ * encoding.c (rb_find_encoding): new function find encoding from
+ arbitrary object as a pointer to rb_encoding, and return NULL if
+ not found.
- * test/psych/test_nil.rb: test for nil values
+ * io.c (io_encoding_set): just warn unsupported encodings, but not
+ exception. [ruby-core:40726] [Bug #5567]
-Wed Jan 5 14:21:34 2011 Mark Dodwell <hi@mkdynamic.co.uk>
+Mon Mar 12 19:03:32 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * string.c: fix rdoc typo.
- https://github.com/shyouhei/ruby/pull/3
+ * vm_method.c (Init_eval_method): respond_to? and
+ respond_to_missing? are public.
-Wed Jan 5 14:06:01 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Mar 12 14:56:52 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/rdoc/test_rdoc_options.rb (TestRDocOptions#test_check_files):
- skip on Windows because chmod 0 doesn't mean unreadable by owner.
+ * node.h (NEW_YIELD), parse.y (new_yield_gen): array-values flags
+ has been already obsolete. patch by Thomas Enebo.
+ [ruby-core:41929][Bug #5847]
-Wed Jan 5 13:56:54 2011 Akinori MUSHA <knu@iDaemons.org>
+Mon Mar 12 12:44:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/net/http.rb (Net::HTTP#get): A header hash given should not
- be modified.
+ * vm_method.c (Init_eval_method): copy basic methods to Exception.
+ [ruby-core:40287][Bug #5473]
-Wed Jan 5 12:10:08 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+Mon Mar 12 10:13:36 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/dl/{cfunc.c,dl.h,handle.c}, ext/fiddle/fiddle.{h,c}: Use _WIN32
- rather than checking for windows.h. Thanks Jon Forums!
- [ruby-core:33977]
+ * eval_jump.c (rb_exec_end_proc): remember the latest exit status.
+ [ruby-core:43173][Bug #5218]
-Sat Jan 1 17:02:50 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+Mon Mar 12 07:33:12 2012 Tanaka Akira <akr@fsij.org>
- * lib/irb/locale.rb (IRB::Locale#search_file): make it possible
- to load a localization from a gem.
- (IRB::Locale#lc_path): obsoleted because of the change of #search_file
- (IRB::Locale#each_localized_path): new private method, based on
- lc_path
- (IRB::Locale#find): follows the change of #search_file.
- (IRB::Locale#load): removed duplicate with #find.
+ * lib/tmpdir.rb: update document for changing
+ FileUtils.remove_entry_secure to FileUtils.remove_entry.
-Sat Jan 1 11:44:42 2011 Tanaka Akira <akr@fsij.org>
+ * NEWS: add incompatibility note for lib/tmpdir.rb.
- * strftime.c: parenthesize macro arguments.
+Mon Mar 12 07:19:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Jan 1 11:10:29 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/tmpdir.rb (Dir.tmpdir): should not use world-writable but
+ non-sticky directory.
- * ext/zlib/zlib.c: take care of platforms where long is bigger
- than int.
+ * lib/tmpdir.rb (Dir.mktmpdir): check the parent directory.
-Sat Jan 1 11:03:58 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Mar 12 07:04:11 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * NEWS (optparse): shell completion support.
+ * random.c (Init_Random): removed rb_Random_DEFAULT and register as
+ mark-object instead of global variable.
- * misc/README (rb_optparse.{bash,zsh}): for shell completion.
+Mon Mar 12 07:03:32 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * include/ruby/intern.h (VALUE rb_ary_print_on): I have never seen
- this function anywhere.
+ * random.c (random_s_rand): ensure default PRNG is re-initialized
+ after fork. patched by Eric Wong. [ruby-core:41209][Bug #5661]
-Sat Jan 1 04:20:11 2011 NARUSE, Yui <naruse@ruby-lang.org>
+Sun Mar 11 23:57:29 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * win32/win32.c (rb_w32_write_console): don't raise exception when
- the conversion is for writing to console.
- Patched by Heesob Park [ruby-core:33999]
+ * pack.c (pack_unpack): when unpack('M') occurs an illegal byte
+ sequence, output the "=" character and the following character in
+ the decoded data without any transformation.
+ [ruby-dev:44875] [Bug #5635]
-Fri Dec 31 12:02:06 2010 Tanaka Akira <akr@fsij.org>
+Sun Mar 11 22:32:43 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * enum.c (enum_sort_by): use less temporary objects.
+ * ext/json: Merge 164a75c8bd2007d32c4d7665d53140d8fc126dcd.
+ [ruby-core:41917] [Bug #5846]
-Fri Dec 31 11:46:47 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Mar 11 17:10:04 2012 Shota Fukumori <sorah@tubusu.net>
- * configure.in (warnflags), lib/mkmf.rb (configuration): turn
- warnings into errors only for bundled extensions.
- [ruby-core:33815]
+ * lib/test/unit.rb: Put error message into STDERR if failed to launch
+ worker (job) process. [ruby-dev:44802] [Bug #5577]
-Fri Dec 31 11:15:57 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/test/unit/parallel.rb: If failed to increment_io, exit with code
+ 2. [ruby-dev:44802] [Bug #5577]
- * ext/zlib/zlib.c (sizeof): zlib.h mistakenly assumes the result
- of sizeof to be int, not size_t.
+Sun Mar 11 15:46:45 2012 Shota Fukumori <sorah@tubusu.net>
-Fri Dec 31 10:27:34 2010 Tanaka Akira <akr@fsij.org>
+ * io.c: fix rdoc of `IO.binwrite` to show same as `IO.write` except
+ it opens file with mode "wb:ASCII-8BIT". [Bug #5782] [ruby-core:42592]
- * st.c: parenthesize macro arguments.
+Sat Mar 10 23:52:28 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Dec 31 03:23:26 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * st.c: pack tables also generic keys. patched by Sokolov Yura at
+ https://github.com/ruby/ruby/pull/84
- * vsnprintf.c (BSD__uqtoa): Fix overflow when long != quad_t.
- patched by Peter Weldon <peter.weldon AT null.net>
- [ruby-core:33985]
+ * st.c: add st_foreach_check for fixing iteration over packed table
+ and st_delete_safe. patched by Sokolov Yura at
+ https://github.com/ruby/ruby/pull/84
-Fri Dec 31 03:00:34 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * st.c: fix packed num_entries on delete_safe. patched by Sokolov
+ Yura at https://github.com/ruby/ruby/pull/84
- * Makefile.in: remove unnecessary semicolons.
+Fri Mar 9 14:29:32 2012 Shugo Maeda <shugo@ruby-lang.org>
-Thu Dec 30 23:09:47 2010 wanabe <s.wanabe@gmail.com>
+ * enumerator.c (lazy_flat_map): add Enumerable::Lazy#flat_map.
- * vm.c (vm_define_method): guard iseq from GC while method definition.
- [ruby-dev:42832]
+Fri Mar 9 06:29:22 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Thu Dec 30 20:18:32 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * ext/psych/lib/psych.rb (load, parse): stop parsing or loading after
+ the first document has been parsed.
- * win32/Makefile.sub: ditto.
+ * test/psych/test_stream.rb: pertinent tests.
-Thu Dec 30 20:57:09 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Fri Mar 9 06:17:05 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * Makefile.in: Check V=1 argument if run "make clean" or similar.
+ * ext/psych/lib/psych.rb (parse_stream, load_stream): if a block is
+ given, documents will be yielded to the block as they are parsed.
+ [ruby-core:42404] [Bug #5978]
-Thu Dec 30 20:41:50 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * ext/psych/lib/psych/handlers/document_stream.rb: add a handler that
+ yields documents as they are parsed
- * Makefile.in: Kill ugly line continuation.
+ * test/psych/test_stream.rb: corresponding tests.
-Thu Dec 30 11:49:40 2010 Tanaka Akira <akr@fsij.org>
+Fri Mar 9 00:35:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * sprintf.c: parenthesize macro arguments.
+ * enumerator.c (lazy_initialize, enumerable_lazy): no additional
+ arguments.
-Wed Dec 29 21:20:13 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Mar 9 00:30:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (maygvl_copy_stream_wait_readwrite): define if USE_SENDFILE
+ * enumerator.c: add Enumerable#lazy. based on the patch by
+ Innokenty Mikhailov at <https://github.com/ruby/ruby/pull/101>
+ [ruby-core:37164] [Feature #4890]
-Wed Dec 29 20:37:43 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Mar 9 00:25:59 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/extmk.rb: strip current directory prefix.
+ * enumerator.c (enumerator_each, generator_each): pass arguments to
+ the block with yielder.
- * enc/depend (clean): remove name2ctype.h when out-of-place build.
+Fri Mar 9 00:25:02 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/Makefile.sub (clean-enc): pass V to inferior make.
+ * array.c (rb_ary_cat): new function to concat objects into array.
-Wed Dec 29 18:23:46 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Mar 8 16:44:02 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * re.c (rb_reg_expr_str): need to escape if the coderange is invalid.
+ * .gdbinit (rb_numtable_entry): update for recent refactoring of
+ st_table.
-Wed Dec 29 10:06:51 2010 Tanaka Akira <akr@fsij.org>
+Wed Mar 7 22:41:50 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * signal.c: parenthesize macro arguments.
+ * lib/xmlrpc/client.rb (module XMLRPC): fix typo.
-Wed Dec 29 07:22:15 2010 Eric Hodel <drbrain@segment7.net>
+ * test/xmlrpc/test_client.rb (test_async_call): add test for
+ XMLRPC::Client#call_async to check above fix.
- * lib/rake/rdoctask.rb: Deprecate in favor of rdoc/task.
+Wed Mar 7 16:30:24 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Dec 29 07:07:06 2010 Eric Hodel <drbrain@segment7.net>
+ * error.c (rb_load_fail): should honor encoding.
- * lib/rdoc: Import RDoc 3.1
+ * load.c (load_failed): ditto.
-Tue Dec 28 18:36:38 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Mar 7 12:26:25 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * error.c, include/ruby/intern.h (rb_compile_error_with_enc): new
- function to raise syntax error, with source encoding'ed message.
+ * error.c (rb_load_fail): use path as a string, not char*.
- * parse.y (compile_error): use above function.
- [ruby-core:33951] (#4217)
+ * internal.h: (rb_load_fail): moved from ruby/intern.h.
-Tue Dec 28 07:37:38 2010 Tanaka Akira <akr@fsij.org>
+ * ruby.c (load_file_internal): fname cannot be NULL.
- * ruby.c: parenthesize macro arguments.
+Wed Mar 7 08:32:43 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Tue Dec 28 07:17:11 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * error.c (rb_loaderror_with_path): Adding the missing file as an
+ instance variable to the LoadError exception.
+ [ruby-core:39079]
- * NEWS: add ARGF.write and so on.
+ * load.c: call rb_loaderror_with_path so that the missing path is
+ added to the exception.
-Tue Dec 28 07:12:38 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * ruby.c: call rb_loaderror rather than raising our own LoadError
+ exception.
- * NEWS: add new magic-comment. (warn-indent) [ruby-core:25442]
+ * include/ruby/intern.h: add declaration for rb_loaderror_with_path.
-Tue Dec 28 04:32:37 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+ * test/ruby/test_require.rb: add supporting test for LoadError#path
+ method.
- * ext/fiddle/extconf.rb: check for windows.h while building fiddle.
- Thanks Jon Forums! [ruby-core:33923]
+Wed Mar 7 08:28:00 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Tue Dec 28 01:45:12 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * lib/xmlrpc/parser.rb: support i8 types. Thanks Stas Kelvich!
+ [ruby-core:29246] [Feature #3090]
- * NEWS: Add Zlib.deflate and Zlib.inflate.
- [ruby-dev:42833]
+ * test/xmlrpc/test_client.rb: supporting test
-Mon Dec 27 21:22:33 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Wed Mar 7 07:43:29 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * win32/configure.bat: Remove obsoleted coding rule. Now, we
- don't support to build on Windows 95/98 and Me.
+ * lib/xmlrpc/client.rb: assume servers that do not send a Content-Type
+ header are sending 'text/xml'. Thanks Nathan Leavitt!
+ [ruby-core:41204] [Bug #5660]
-Mon Dec 27 18:27:13 2010 Tanaka Akira <akr@fsij.org>
+ * test/xmlrpc/test_client.rb: supporting test
- * re.c: parenthesize macro arguments.
+Wed Mar 7 07:39:28 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Mon Dec 27 15:22:23 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/xmlrpc/test_client.rb: adding a test for performing an XMLRPC
+ call.
+ * test/xmlrpc/data/blog.xml: supporting XML document for the response.
- * win32/README.win32: note to need NT based OS to build ruby.
+Tue Mar 6 16:24:01 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Dec 27 12:14:46 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * parse.y (parser_tokadd_string): escape simple regexp meta
+ character terminators.
- * common.mk (EXTMK_ARGS): specify to pass macro V, because nmake
- doesn't pass it via MAKEFLAGS.
+Tue Mar 6 10:11:43 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Dec 27 10:33:43 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/io/console/console.c (set_rawmode): clear ECHOE and ECHOK
+ bits too.
- * ext/zlib/zlib.c (Init_zlib): Add Zlib.deflate and Zlib.inflate.
- [ruby-dev:42833]
+ * ext/io/console/console.c (echo_p): ignore ECHOE and ECHOK bits.
+ [ruby-dev:45309] [Bug #6116]
-Mon Dec 27 07:38:07 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * ext/io/console/console.c (console_raw): fix rdoc.
- * misc/rb_optparse.zsh: add compdef for generator.
+ * ext/io/console/console.c (console_set_echo): mentioned about
+ platform dependency.
-Mon Dec 27 07:32:07 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Tue Mar 6 07:18:10 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/optparse.rb (OptionParser#compsys): escape brackets too.
- [ruby-dev:42754]
+ * lib/xmlrpc/client.rb: switch net/http post2 calls to modern
+ `request_post` methods.
-Mon Dec 27 01:30:08 2010 Tanaka Akira <akr@fsij.org>
+Tue Mar 6 02:31:20 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/socket/mkconstants.rb: add IF_NAMESIZE.
- add a default for INET6_ADDRSTRLEN.
+ * ext/psych/lib/psych/core_ext.rb: only extend Kernel if IRB is loaded
+ in order to stop method pollution.
-Sun Dec 26 23:49:47 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Tue Mar 6 01:34:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/Makefile.sub: suppress a strange error message when RMALL
- found no such file.
- * win32/rmall.bat: new.
+ * parse.y (block_call): rules for block_call after block_call.
+ based on a patch by pasberth https://github.com/ruby/ruby/pull/102
+ [ruby-dev:45308][Bug #6115]
-Sun Dec 26 21:23:23 2010 <kosaki.motohiro@gmail.com>
+Tue Mar 6 01:24:13 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/Makefile.sub: fix 'nmake clean-enc' breakage since r28322.
+ * parse.y (block_command, block_call): simplified rules.
-Sun Dec 26 22:25:07 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Mar 5 18:28:35 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * ext/ripper/depend (ripper.y): fix messages with nmake.
- [ruby-dev:42896]
+ * test/ruby/test_regexp.rb (TestRegexp#test_source): fix typo.
+ * test/ruby/test_regexp.rb (TestRegexp#test_equal): ditto.
-Sun Dec 26 22:24:14 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Mar 5 17:11:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * file.c (file_expand_path): get rid of warnings caused by
- -Wdeclaration-after-statement on cygwin.
+ * ext/syck/lib/syck/rubytypes.rb (Exception.yaml_new): fix bug
+ that causes YAML serialization problem for Exception.
+ Exception#initialize doesn't use visible instance variable for
+ the exception message, so call the method with the message.
+ patched by Jingwen Owen Ou <jingweno AT gmail.com>.
+ http://github.com/ruby/ruby/pull/41
-Sun Dec 26 20:28:34 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Mon Mar 5 16:50:22 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * process.c (before_exec): add small comment.
+ * test/ruby/test_sleep.rb (TestSleep#test_sleep_5sec): syntax error.
-Sun Dec 26 20:52:21 2010 Tanaka Akira <akr@fsij.org>
+ * test/ruby/test_sleep.rb (TestSleep#test_sleep_5sec): call uname
+ only on linux because it's a workaround for linux only.
- * ext/socket/mkconstants.rb: define INET_ADDRSTRLEN as 16 if not
- available. fix compilation error on mswin32-60. reported by nobu.
+Mon Mar 5 12:44:12 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Dec 26 19:37:37 2010 Tanaka Akira <akr@fsij.org>
+ * st.c (unpack_entries): chain entries directly. based on a patch
+ by Sokolov Yura <funny.falcon AT gmail.com>.
- * ext/socket/option.c: define IFNAMSIZ if not available.
- fix compilation error on mingw32. reported by nobu.
+ * st.c (unpack_entries): use union instead of casted pointer.
+ patched by Sokolov Yura <funny.falcon AT gmail.com>.
-Sun Dec 26 12:16:29 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * st.c: use PACKED_ENT and FIND_ENTRY. patched by Sokolov
+ Yura <funny.falcon AT gmail.com>.
- * lib/rdoc/ri/paths.rb (RDoc::RI::Paths::HOMEDIR): no exception if
- HOME is not set. [ruby-core:33867]
+ * st.c (unpack_entries): reallocate bins if packed array size
+ is not same as initial bins size. based on a patch by
+ Sokolov Yura <funny.falcon AT gmail.com>.
-Sun Dec 26 11:39:11 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Mar 5 11:51:48 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * parse.y (stmt): missing ripper rule. i.e., `a::B ||= c 1'.
- http://twitter.com/#!/wannabe53/status/18797576396472321
- http://twitter.com/#!/wannabe53/status/18798416150663168
+ * ext/bigdecimal/lib/bigdecimal/math.rb: remove description about
+ BigMath#log. patched by Sho Hashimoto [ruby-dev:45307] [Bug #6112]
-Sun Dec 26 11:15:50 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * string.c (str_byteslice): fix typo.
- * test/with_different_ofs.rb (DifferentOFS): should not affect
- original classes.
+Sun Mar 4 23:21:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Dec 26 09:35:07 2010 Tanaka Akira <akr@fsij.org>
+ * parse.y (parser_tokadd_string): regexp engine doesn't need
+ terminators to be escaped. [ruby-core:40364][Bug #5484]
- * rational.c: parenthesize macro arguments.
+Sat Mar 3 22:51:46 2012 Tanaka Akira <akr@fsij.org>
-Sun Dec 26 09:22:19 2010 Tanaka Akira <akr@fsij.org>
+ * process.c (rb_run_exec_options_err): chdir at last to interpret
+ relative pathnames from the current directory of the parent process.
- * ext/socket/option.c (rb_if_indextoname): new function to abstract
- environments without if_indextoname.
- (inspect_ipv6_multicast_if): new function to inspect
- IPV6_MULTICAST_IF.
- Socket::Option.new(:INET6, :IPV6, :MULTICAST_IF,
- [2].pack("I!")).inspect is
- "#<Socket::Option: INET6 IPV6 MULTICAST_IF eth0>".
+Sat Mar 3 12:20:44 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Sun Dec 26 04:31:15 2010 Luis Lavena <luislavena@gmail.com>
+ * ext/date/date_strftime.c: reassigned some variables.
- * ext/dl/win32/registry.rb: Corrected RegCreateKeyExA signature.
- Patch by Rafal Michalski [ruby-core:33874] [Ruby 1.9-Bug#4203]
+Sat Mar 3 12:12:16 2012 Tadayoshi Funaba <tadf@dotrb.org>
-Sun Dec 26 02:31:58 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * ext/date/date_{parse,strptime}.c: [ruby-dev:45303].
- * io.c (advice_arg_check): Change argument check.
- Now, an unsupported advice makes NotImplementedError.
- [ruby-dev:42887] [Ruby 1.9-Feature#4204]
+Sat Mar 3 10:09:21 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Sun Dec 26 03:00:53 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * lib/xmlrpc/client.rb (initialize): net/http defaults to 1_2 in 1.8+,
+ so we can safely remove the call to enable it.
- * ext/socket/extconf.rb: Fix build error which was introduced r30372.
+Sat Mar 3 08:42:25 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Sun Dec 26 01:37:10 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/xmlrpc/client.rb (new2): use URI for uri parsing.
+ * test/xmlrpc/test_client.rb: test that query params are passed to the
+ client constructor.
- * ext/socket/extconf.rb: check the existence of if_indextoname().
+Sat Mar 3 08:20:10 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/socket/option.c: yesterday's akr's commits destroyed the build of
- some unrelated platforms (such as Windows).
+ * lib/xmlrpc/client.rb (new2): raises an ArgumentError on bad
+ arguments.
+ * test/xmlrpc/test_client.rb: tests for bad uris
-Sat Dec 25 23:29:11 2010 Tanaka Akira <akr@fsij.org>
+Sat Mar 3 08:08:11 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * ext/socket/option.c (inspect_ipv4_add_drop_membership): new function
- to inspect struct ip_mreq and struct ip_mreqn for
- IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP.
- Socket::Option.new(:INET, :IP, :ADD_MEMBERSHIP,
- [239,255,99,81, 0,0,0,0].pack("CCCCCCCC")).inspect is now
- "#<Socket::Option: INET IP ADD_MEMBERSHIP 239.255.99.81 0.0.0.0>".
- (inspect_ipv4_multicast_if): new function to inspect struct in_addr
- and struct ip_mreqn for IP_MULTICAST_IF.
- Socket::Option.new(:INET, :IP, :MULTICAST_IF,
- [192,168,0,7].pack("CCCC")).inspect is now
- "#<Socket::Option: INET IP MULTICAST_IF 192.168.0.7>".
+ * lib/xmlrpc/client.rb (new2): fix custom port specification when an
+ SSL uri is used.
+ * test/xmlrpc/test_client.rb: tests for XMLRPC::Client.new2
- * ext/socket/extconf.rb: check struct ip_mreq and struct ip_mreqn.
+Sat Mar 3 08:03:29 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Dec 25 22:49:10 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/syck/rubyext.c (mktime_do): use ISDIGIT().
+ [ruby-core:43060] [Bug #6108]
- * test/csv: DifferentOFS needs to be include in each classes.
+ * ext/syck/token.c (sycklex_yaml_utf8): cast as unsigned char.
+ [ruby-core:43060] [Bug #6108]
- * test/digest/test_digest_extend.rb (TestDigestExtend#setup):
- should not depend on the result of previous tests
+Sat Mar 3 06:57:14 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/with_different_ofs.rb (DifferentOFS::WithDifferentOFS): give
- name.
+ * configure.in (ruby_pc): make configurable. [Bug #6051]
- * test/with_different_ofs.rb (DifferentOFS): test suite for test
- suites affected by $,.
+Fri Mar 2 17:49:03 2012 Hiroshi Nakamura <nahi@ruby-lang.org>
- * test/digest/test_digest_extend.rb (TestDigestExtend): should not
- assume $, invariant.
+ * .travis.yml (branches): Enable TravisCI for ruby_1_9_3.
- * test/csv/test_data_converters.rb, test/csv/test_table.rb: don't
- call setup within tests.
+Fri Mar 2 17:13:33 2012 Hiroshi Nakamura <nahi@ruby-lang.org>
-Sat Dec 25 20:01:40 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/ruby/test_array.rb (test_combination2): Make the test case for
+ [ruby-core:29240] more descriptive.
+ cf. http://bugs.jruby.org/6518
+
+Fri Mar 2 16:37:11 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (file_expand_path): use wcscasecmp().
+
+Fri Mar 2 16:36:31 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread_pthread.c (native_cond_timeout): cast explicitly to suppress
+ a warning.
+
+Fri Mar 2 16:35:56 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (pipe_open): cmd is no longer used if fork is available.
+
+Thu Mar 1 16:13:18 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * internal.h (rb_file_const, rb_file_load_ok): moved functions for
+ internal use only.
+
+Thu Mar 1 15:40:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/makedirs.bat: new command to make intermediate
+ directories, and not to report any errors if the directory
+ already exists.
+
+ * win32/Makefile.sub (MAKEDIRS): enable command extensions.
+
+Thu Mar 1 01:25:43 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * regparse.c (is_onechar_cclass): optimize character class
+ Merge Onigmo 27278c12e6674043cc8affca6507e20e119a86ee.
+
+ * regparse.c (is_onechar_cclass): [bug] unexpected match occurs when a
+ char class contains no char
+
+ * enc/unicode.c (init_case_fold_table): define the sizes of case
+ folding tables in casefold.h
+
+Wed Feb 29 16:11:34 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/Makefile.sub (MAKEDIRS): use mkdir of cmd.exe instead of ruby.
+ [Bug #6103] [ruby-core:43012]
+
+ * win32/README.win32: added a notice about command extension of cmd.exe.
+
+Wed Feb 29 15:39:39 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_io.rb (TestIO#test_readpartial_locktmp): skip on
+ windows because of the platform restriction.
+
+Wed Feb 29 15:38:50 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/memory_status.rb (Memory): syntax error.
+
+Wed Feb 29 13:06:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/ruby/memory_status.rb: use /proc/self/status if it is in
+ the expected format.
+
+Wed Feb 29 06:14:51 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: reverted r34825.
+
+Tue Feb 28 23:20:01 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * Makefile.in (PLATFORM_DIR): add a variable for `win32` directory.
+ * Makefile.in (clean-platform): add new target.
+ It cleans `win32` directory.
+
+ * common.mk (clean): add a dependency for `win32` directory.
+ * common.mk (distclean): ditto.
+ * common.mk (distclean-platform): add new target.
+ It cleans `win32` directory.
+ * common.mk ($(PLATFORM_D)): add new target to make `win32` directory.
+ * common.mk (win32/win32.$(OBJEXT)): move win32.o into `win32`
+ directory.
+ * common.mk (win32/file.$(OBJEXT)): add new target for win32/file.c.
+
+ * configure.in: move win32.o into `win32` directory and add
+ win32/file.o to MISSING.
+
+ * file.c (file_load_ok, rb_file_load_ok): replace static
+ file_load_ok() with public rb_file_load_ok().
+ It's to link Windows implementation in win32/file.c.
+ * file.c (rb_find_file_ext_safe): ditto.
+ * file.c (rb_find_file_safe): ditto.
+
+ * win32/file.c (rb_file_load_ok): new file. Add Windows specific
+ optimized implementation of rb_file_load_ok(). We created a
+ separated file to avoid too many #ifdef macro which is unreadable.
+
+ * win32/Makefile.sub (PLATFORM_DIR): add a variable for `win32`
+ directory.
+ * win32/Makefile.sub (MISSING): move win32.obj into `win32`
+ directory and add win32/file.obj to MISSING.
+ * win32/Makefile.sub (MAKEDIRS): replace MINIRUBY with BASERUBY.
+ It's because miniruby doesn't exist when making `win32` directory.
+ * win32/Makefile.sub (clean-platform): add new target to clean `win32`
+ directory.
+ * win32/Makefile.sub ({$(srcdir)}.c{}.obj): make it not match
+ win32/file.c to build properly.
+ * win32/Makefile.sub (win32/win32.$(OBJEXT)): move win32.obj into
+ `win32` directory.
+
+ Patch created with Luis Lavena.
+ [ruby-core:42480] [Feature #5999]
+
+Tue Feb 28 20:27:25 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: [ruby-core:42998]
+
+Tue Feb 28 18:47:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (io_binwrite, rb_io_syswrite): use shared frozen source
+ strings.
+
+ * io.c (io_fread, io_getpartial, rb_io_sysread): set buffer size
+ after check if readable, which can cause thread switch.
+ [ruby-dev:45297][Bug #6099]
+
+Tue Feb 28 17:16:01 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/time.rb (Time#xmlschema): use strftime specifiers instead of
+ fractional exponential calculation which yields undesirable
+ result. [ruby-core:42997][Bug #6100]
+
+Tue Feb 28 14:15:29 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/net/protocol.rb: Add OpenTimeout subclass of Timeout::Error
+ * lib/net/pop.rb: Modernize Timeout usage. Patch by Eric Wong.
+ Use Net::OpenTimeout instead of Timeout::Error. [Bug #5765]
+ * lib/net/http.rb: ditto
+ * lib/net/smtp.rb: ditto
+ * lib/net/telnet.rb: ditto
- * io.c (pipe_open): Added rb_thread_atfork(). We must reinitialize
- GVL at new process creation.
+Tue Feb 28 13:51:12 2012 Eric Hodel <drbrain@segment7.net>
-Sat Dec 25 18:26:55 2010 Tanaka Akira <akr@fsij.org>
+ * lib/net/http.rb: Retry HTTP requests for additional network errors.
+ Introduce OpenTimeout subclass of Timeout::Error. [Bug #6001]
+ * test/net/http/test_http.rb: Reduce timeout to 0.01s for faster test
+ * test/net/http/test_https.rb: ditto
- * ext/socket/option.c (inspect_ipv6_mreq): new function to inspect
- struct ipv6_mreq for IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP.
- Socket::Option.new(:INET6, :IPV6, :JOIN_GROUP,
- [0xff12,0,0,0,0,0,0,1, 2].pack("nnnnnnnnI!")).inspect is now
- "#<Socket::Option: INET6 IPV6 JOIN_GROUP ff12::1 eth0>".
+Tue Feb 28 11:44:49 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/socket/extconf.rb: check struct ipv6_mreq.
+ * configure.in (debugflags): check if -ggdb is accepted.
+ [ruby-core:42875][Bug #6080]
-Sat Dec 25 18:04:30 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Feb 28 10:28:51 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/csv.rb (CSV.foreach): 'rb' mode is defaulted in open.
+ * ext/psych/lib/psych.rb: default open YAML files with utf8 external
+ encoding. [ruby-core:42967]
+ * test/psych/test_tainted.rb: ditto
- * lib/csv.rb (CSV#init_separators): cannonicalize encoding options
- as Encoding objects.
+Mon Feb 27 23:46:09 2012 Yukihiro Matsumoto <matz@ruby-lang.org>
-Sat Dec 25 18:30:34 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * parse.y (opt_bv_decl): allow newline at the end. [ruby-dev:45292]
- * thread.c (rb_thread_atfork): Add small comment why we need
- reset random seed.
+Mon Feb 27 20:43:05 2012 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Dec 25 17:33:55 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (rb_io_set_pos): add rdoc about textmode.
- * test/csv/base.rb (TestCSV.with_different_ofs): give name to
- anonymous classes.
+ * test/ruby/test_io.rb (TestIO#test_setpos): use binmode.
- * lib/csv.rb (CSV#init_separators): use IO#gets with length
- parameter to get rid of wrong convertion.
+Mon Feb 27 17:00:15 2012 Akinori MUSHA <knu@iDaemons.org>
- * lib/csv.rb (CSV::foreach, CSV#initialize): directly use encoding
+ * string.c (rb_str_crypt): Update rdoc and state that this
+ function is system dependent. Reviewed by nobu, thanks to
+ @takai.
- * lib/csv.rb, test/csv: should not assume $, invariant.
+Mon Feb 27 17:03:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Dec 25 16:08:06 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec): since methods
+ can be overridden, so should not make an assumption on the type
+ of results. [ruby-core:42969][Bug #6093]
- * signal.c: change rb_atomic_t definition from uchar to uint.
+Mon Feb 27 10:54:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Dec 25 15:04:05 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/mkmf.rb (try_cppflags, try_cflags, try_ldflags): replace the
+ target flags if the given flag is accepted.
- * test/csv/test_encodings.rb (TestEncodings#setup): fix evil test
- suite writing to the source directory.
+Mon Feb 27 10:53:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Dec 25 15:08:08 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/rubygems/test_gem_specification.rb (test_self_from_yaml_syck_default_key_bug):
+ ignore the test for too old versions.
- * ext/pty/pty.c (chfunc): Added rb_thread_atfork_before_exec().
- We must reinitialize GVL at new process creation. Otherwise
- we may meet an insane deadlock. [Bug#4121][ruby-dev:42686]
+Mon Feb 27 10:53:12 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Dec 25 14:27:09 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/test/unit.rb (Test::Unit::Runner#puke): skips with no
+ messages should be trivial.
- * io.c (rb_io_extract_encoding_option): accept Encoding object as
- encoding: optional argument. [ruby-dev:42884]
+Mon Feb 27 10:50:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Dec 25 13:37:55 2010 Ryan Davis <ryand-ruby@zenspider.com>
+ * io.c, process.c, time.c, ext: use rb_sys_fail_str instead of
+ rb_sys_fail.
- * lib/minitest/*.rb: Imported minitest 2.0.2 r6093.
+Mon Feb 27 10:48:49 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Dec 25 13:05:59 2010 Tanaka Akira <akr@fsij.org>
+ * ext/openssl/extconf.rb: suppress useless deprecation warnings
+ from OpenSSL added by Apple.
- * random.c: parenthesize macro arguments.
+Sun Feb 26 23:29:49 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Sat Dec 25 12:48:50 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * regparse.c (add_code_range_to_buf0): wrong condition of duplicated
+ warnings.
- * load.c (rb_f_require_relative): don't omit return type.
+Sun Feb 26 11:26:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Dec 25 11:06:00 2010 Eric Hodel <drbrain@segment7.net>
+ * compile.c (iseq_compile_each): call on special object instead of
+ self. since stabby lambda is a syntax, so it should not be
+ affected by the context. [ruby-core:42349][Bug #5966]
- * load.c (rb_f_require_relative): Add documentation.
+ * insns.def (send): no special deal for FCALL. self should be put
+ on TOS instead.
-Sat Dec 25 11:02:52 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Feb 26 05:35:43 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/zlib/zlib.c (gzreader_gets): support optional length
- parameter.
+ * error.c (report_bug): use buf and snprintf to avoid consuming stack.
+ [ruby-dev:45272] [Bug #6058]
- * ext/zlib/zlib.c (gzfile_read, gzfile_readpartial): length should
- be long.
+Sat Feb 25 17:41:19 2012 Tanaka Akira <akr@fsij.org>
-Sat Dec 25 10:51:03 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/dbm/extconf.rb (headers): try ambiguous headers at last.
- * ext/json/generator/generator.{c,h} (fbuffer_free_only_buffer):
- unused.
+Sat Feb 25 17:07:15 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/openssl/ossl_pkcs5.c (ossl_pkcs5_pbkdf2_hmac): add casts.
+ * lib/fileutils.rb: use chomp(?/) instead of sub to optimize and avoid
+ to regexping invalid string.
-Fri Dec 24 08:46:04 2010 Tanaka Akira <akr@fsij.org>
+Sat Feb 25 16:18:24 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * process.c: parenthesize macro arguments.
+ * complex.c (nucomp_marshal_load): raise error on invalid data.
+ reported by John Firebaugh [ruby-core:42860] [Bug #6076]
-Thu Dec 23 19:17:14 2010 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+Sat Feb 25 14:46:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/net/imap/cacert.pem: updated because it has been expired.
+ * ext/dl/dl.c (Init_dl): support intrinsic types, size_t, ptrdiff_t
+ and intptr_t. [ruby-core:42460][Feature #5992]
- * test/net/imap/server.crt: signed again because CA cert was expired.
+ * ext/fiddle/fiddle.c (Init_fiddle): ditto.
-Thu Dec 23 11:16:52 2010 Tanaka Akira <akr@fsij.org>
+ * ext/dl/lib/dl/cparser.rb (DL::CParser#parse_ctype): ditto.
- * parse.y: parenthesize macro arguments.
+Sat Feb 25 11:08:28 2012 Tanaka Akira <akr@fsij.org>
-Thu Dec 23 11:00:09 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/curses/curses.c (Init_curses): use rb_define_const once for
+ Curses::VERSION.
- * error.c (rb_check_type): check for type from extensions for ruby
- 1.8. see [ruby-core:33797].
+ * ext/dbm/dbm.c (Init_dbm): ditto for DBM::VERSION.
-Thu Dec 23 08:12:59 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+Sat Feb 25 10:34:22 2012 Tanaka Akira <akr@fsij.org>
- * lib/net/smtp.rb: refactoring Net::SMTP#esmtp= to use an
- attr_accessor
+ * ext/curses/curses.c (Init_curses): make Curses::VERSION
+ understandable without context.
-Thu Dec 23 06:35:41 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+ * ext/dbm/dbm.c (Init_dbm): ditto for DBM::VERSION.
- * lib/net/smtp.rb: Net::SMTP should close the SSL connection if the
- connection verification fails.
+Sat Feb 25 07:53:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Dec 23 01:47:58 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * parse.y (parser_tokadd_string): insert a backslash only if
+ quoted by single quotes. [ruby-dev:45281] [Bug #6069]
- * NEWS: remove #object_id. [ruby-dev:42840]
+Sat Feb 25 07:53:49 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Dec 22 08:56:39 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * dir.c (dir_inspect), io.c (rb_io_inspect): keep encoding of path.
+ [Bug #6072]
- * NEWS: add Module#private_constant and Module#public_constant.
- [ruby-dev:39685][ruby-core:32698]
+Sat Feb 25 07:53:40 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Dec 22 07:59:23 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * dir.c (dir_initialize): keep path in original encoding.
- * NEWS: add IO#advise. [ruby-core:33110] [Ruby 1.9-Feature#4038]
+ * error.c (syserr_initialize): prefer the encoding of message over
+ locale. [ruby-dev:45279][Bug #6071]
-Tue Dec 21 23:45:31 2010 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Feb 25 06:55:29 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (Init_GC): move back object_id to Kernel. [ruby-dev:42840]
+ * file.c (utime_internal): fix a variable missed to replace.
+ [ruby-core:42864] [Bug #6077]
-Tue Dec 21 12:45:16 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Feb 24 18:21:55 2012 Hiroshi Nakamura <nahi@ruby-lang.org>
- * configure.in (target_archs): remove temporary objects.
+ * test/zlib/test_zlib.rb (TestZlibGzipReader#test_encoding): Add
+ encoding testcases for GzipReader#read. read() emits
+ Encoding.default_external in contrast to read(size) emits BINARY.
+ See also: http://bugs.jruby.org/6208
- * enc/Makefile.in, enc/depend (clean): remove work directories.
+Fri Feb 24 17:56:39 2012 URABE Shyouhei <shyouhei@ruby-lang.org>
-Tue Dec 21 07:39:12 2010 Tanaka Akira <akr@fsij.org>
+ * test/ruby/test_literal.rb (TestRubyLiteral#test_special_const):
+ test for https://bugs.php.net/bug.php?id=61095
- * pack.c: parenthesize macro arguments.
+Fri Feb 24 16:48:29 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Dec 21 06:25:43 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * dir.c, file.c, io.c (rb_sys_fail_path): use rb_sys_fail_str.
- * test/rexml/test_contrib.rb (ContribTester#test_pos): should not
- use fixed path name for tests. [ruby-dev:42827]
+ * error.c: new functions to deal exceptions with string instances.
- * test/rexml/test_sax.rb (SAX2Tester#test_socket): should not use
- fixed port for tests. [ruby-dev:42828]
+ * dir.c, file.c, io.c: use rb_sys_fail_path.
-Tue Dec 21 06:10:18 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Feb 24 15:49:07 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * compile.c (setup_args), vm.c (invoke_block_from_c),
- vm_insnhelper.c (caller_setup_args): reverted r30241 and r30243
- except for the test.
+ * configure.in (__builtin_unreachable): check for clang.
+ [ruby-core:42849]
-Tue Dec 21 01:41:42 2010 Masaya Tarui <tarui@ruby-lnag.org>
+ * include/ruby/ruby.h (UNREACHABLE): fallback definition.
- * io.c : add an extra byte to buffer for the specification of read
- in Windows. see [ruby-core:33460] and r29980. and, we have to
- discuss how to do this one byte.
+Fri Feb 24 13:54:33 2012 Aaron Patterson <aaron@tenderlovemaking.com>
-Tue Dec 21 01:18:06 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * ext/psych/parser.c: prevent a memory leak by protecting calls to
+ handler callbacks.
+ * test/psych/test_parser.rb: test to demonstrate leak.
- * error.c: Fix build error for win32. This regression was
- introduced by r30271.
+Fri Feb 24 12:07:34 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Tue Dec 21 00:59:40 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * lib/net/http.rb: Fix documentation. Patched from Florian Mhun
+ via http://github.com/ruby/ruby/pull/96
- * thread.c (thread_cleanup_func): Moved interrupted_lock
- destroying code from native_thread_destroy() to
- thread_cleanup_func() because it's platform independent logic.
+Fri Feb 24 11:48:07 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * thread_win32.c (native_thread_destroy): ditto.
- * thread_pthread.c (native_thread_destroy): ditto.
+ * string.c (rb_str_prepend): Fix documentation for String#prepend.
+ Patched from Franck Verrot via http://github.com/ruby/ruby/pull/98
+ and Andrew Horsman via http://github.com/ruby/ruby/pull/55
-Tue Dec 21 00:46:20 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Fri Feb 24 10:08:33 2012 Eric Hodel <drbrain@segment7.net>
- * thread.c (thread_cleanup_func): Don't touch native threading
- resource at fork. Sadly this is purely bandaid. We need to
- implement proper fix later. [Bug #4169] [ruby-core:33767]
+ * lib/net/http.rb (Net::HTTP#transport_request): Fix infinite loop
+ upon EOFError or Errno::ECONNRESET where count is reset to 0.
+ * test/net/http/test_http.rb (class TestNetHTTPKeepAlive): Test for
+ above.
-Tue Dec 21 00:22:44 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Fri Feb 24 09:05:40 2012 Eric Hodel <drbrain@segment7.net>
- * error.c (exit_success_p): Check status code more carefully.
- status code may have garbage in upper bit.
+ * complex.c (Init_Complex): Document Complex::I. Patch by Sylvain
+ Daubert. [Feature #5623]
-Mon Dec 20 23:12:37 2010 Tanaka Akira <akr@fsij.org>
+Fri Feb 24 08:52:09 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * node.c: parenthesize macro arguments.
+ * parse.y (parser_tokadd_string, parser_yylex): insert a backslash
+ if the next character is non-ascii. [ruby-dev:45278] [Bug #6069]
-Mon Dec 20 20:04:41 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Fri Feb 24 08:13:20 2012 Eric Hodel <drbrain@segment7.net>
- * NEWS: add #__id__ and #object_id. [ruby-dev:42778]
+ * lib/profiler.rb: Add Profiler documentation by Gonzalo Rodriguez.
+ [Bug #5816]
-Mon Dec 20 20:03:21 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Fri Feb 24 08:08:38 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * thread_pthread.c (native_thread_destroy): Fixed gvl_cond leak.
+ * ext/psych/parser.c: set parser encoding based on the YAML input
+ rather than user configuration.
+ * test/psych/test_encoding.rb: corresponding tests.
+ * test/psych/test_parser.rb: ditto
+ * test/psych/test_tainted.rb: ditto
-Mon Dec 20 13:49:05 2010 Eric Hodel <drbrain@segment7.net>
+Fri Feb 24 08:02:52 2012 Eric Hodel <drbrain@segment7.net>
- * NEWS: Add item for RDoc 3.0.1
+ * hash.c (Init_Hash): Add section on how objects are used as Hash keys
+ and how to use custom classes as Hash keys.
- * lib/rdoc: Import RDoc 3.0.1, remove require for perl parser.
+Fri Feb 24 07:36:11 2012 Eric Hodel <drbrain@segment7.net>
-Mon Dec 20 12:15:32 2010 Eric Hodel <drbrain@segment7.net>
+ * object.c (rb_obj_eql): Improve equality documentation by adding an
+ example of equal? vs == and recommending eql? be aliased to == when
+ overridden.
- * lib/rdoc: Import RDoc 3.0.
+Fri Feb 24 07:21:15 2012 Eric Hodel <drbrain@segment7.net>
-Mon Dec 20 01:55:03 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * object.c (rb_obj_hash): Added note that the hash value is not
+ deterministic on Marc-Andre's suggestion. Expanded description of
+ the purpose of the hash method. [Bug #6068]
- * io.c (Init_IO): Added O_DIRECT. This feature was proposed by
- Run Paint Run Run.
- [Feature #4015] [ruby-core:33018]
+Thu Feb 23 23:01:21 2012 Tanaka Akira <akr@fsij.org>
-Sun Dec 19 19:15:23 2010 Tanaka Akira <akr@fsij.org>
+ * ext/dbm/extconf.rb: unused macro removed.
- * marshal.c: parenthesize macro arguments.
+Thu Feb 23 22:26:53 2012 Tanaka Akira <akr@fsij.org>
-Sat Dec 18 21:52:37 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * test/test_curses.rb: new file.
- * vsnprintf.c (BSD_vfprintf): suppress warning: "_WIN32" is not
- defined.
+Thu Feb 23 19:57:56 2012 Tanaka Akira <akr@fsij.org>
-Sat Dec 18 16:02:27 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/curses/rain.rb: trap SIGHUP, SIGINT, SIGQUIT and SIGTERM only.
- * compile.c (setup_args), vm.c (invoke_block_from_c),
- vm_insnhelper.c (caller_setup_args): fix of r30241. lambda block
- should check argument number.
+Thu Feb 23 19:56:48 2012 Tanaka Akira <akr@fsij.org>
-Sat Dec 18 14:42:29 2010 Tanaka Akira <akr@fsij.org>
+ * signal.c (sig_trap): show signal name on error.
- * load.c: parenthesize macro arguments.
+Thu Feb 23 12:21:48 2012 Tanaka Akira <akr@fsij.org>
-Sat Dec 18 10:07:04 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/dbm/extconf.rb: use DBM_SUFFIX only to detect header of
+ Berkeley DB.
- * compile.c (setup_args, iseq_compile_each): optimize AMPER LAMBDA
- combination as block.
+Thu Feb 23 10:00:18 2012 Eric Hodel <drbrain@segment7.net>
-Fri Dec 17 22:07:16 2010 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * io.c (rb_io_f_sync): Fix double-negative typo. [ruby-trunk - #5837]
- * gc.c (Init_GC): move #__id__ and #object_id to BasicObject.
- [ruby-dev:42778]
+Thu Feb 23 09:57:21 2012 Eric Hodel <drbrain@segment7.net>
-Fri Dec 17 19:35:13 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * load.c (rb_f_require): Add note to require for scope of items in the
+ loaded file. [ruby-trunk - #5910]
- * test/mkmf/base.rb (TestMkmf::FakeLog): capture output from mkmf.
+Thu Feb 23 03:58:08 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * test/mkmf/test_find_executable.rb (test_find_executable):
- suppress meaningless differences for chkbuild.
+ * lib/ostruct.rb (delete_field): Bug fix so previous value is
+ returned. Patch by Nick Recobra [Bug #6063]
-Fri Dec 17 13:26:54 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Feb 23 02:33:00 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/setup.mak (BASERUBY): quit with an error when BASERUBY was not
- able to set, just like configure.in does. [ruby-dev:42782]
+ * io.c (rb_io_extract_modeenc): fail only if conflicting
+ text/binary modes given explicitly. [ruby-dev:45268][Bug #6055]
-Fri Dec 17 07:04:09 2010 Tanaka Akira <akr@fsij.org>
+Wed Feb 22 23:27:08 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * iseq.c: parenthesize macro arguments.
+ * test/iconv/test_option.rb: enabled. [ruby-core:42802][Bug #6061]
-Fri Dec 17 04:18:37 2010 Eric Hodel <drbrain@segment7.net>
+Wed Feb 22 21:45:56 2012 Tanaka Akira <akr@fsij.org>
- * transcode.c (str_encode): Alter comment for better wording and ri
+ * ext/curses/curses.c: use defined() to suppress a warning.
+
+Wed Feb 22 21:44:29 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/curses/extconf.rb: refactored.
+
+Wed Feb 22 20:42:28 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/curses/extconf.rb: try to distinguish curses_version is a
+ function or variable.
+
+ * ext/curses/curses.c (Init_curses): refine Curses::VERSION.
+
+Wed Feb 22 19:47:03 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/curses/extconf.rb: show the chosen header and library.
+
+Wed Feb 22 19:22:31 2012 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * reverted 34739 for test/date.
+
+Wed Feb 22 19:08:55 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/curses/extconf.rb: refactored.
+
+Wed Feb 22 18:44:41 2012 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/test/unit.rb (setup_options): add option "--retry" as opposite
+ for "--no-retry"
+
+Wed Feb 22 18:34:02 2012 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/test/unit.rb (setup_options): add option "--show-skip" to
+ cancel "--hide-skip" (-q)
+
+Wed Feb 22 17:36:22 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (rb_io_s_foreach): argument check before making Enumerator.
+ [ruby-dev:31525]
+
+Wed Feb 22 17:07:35 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (rb_io_s_foreach): return enumerator including keyword
+ arguments. [ruby-dev:45267][Bug #6054]
+
+Wed Feb 22 12:15:16 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: allow llvm-gcc because it work fine with r34278.
+
+Wed Feb 22 10:57:08 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * regparse.c (fetch_token): don't use // comment.
+
+Wed Feb 22 10:32:11 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/mkmf/test_framework.rb: try CoreFoundation framework, than
+ Cocoa which is dependent on QuickTime SDK which has separated
+ since Xcode 4.3.
+
+Wed Feb 22 10:18:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (test-all, test-ruby): more dependencies.
+
+Wed Feb 22 06:48:55 2012 Eric Hodel <drbrain@segment7.net>
+
+ * file.c (rb_f_test): Fix formatting of Kernel#test rdoc.
+
+Wed Feb 22 06:12:15 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/dbm/extconf.rb: check DBM_SUFFIX for Mac OS X.
+ Its ndbm.h doesn't include db.h.
+
+Wed Feb 22 06:02:42 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/dbm/dbm.c (fdbm_initialize): disable Berkeley DB error messages.
+
+ * ext/dbm/extconf.rb: check DBC type for above.
+
+ [ruby-dev:45269]
+
+Tue Feb 21 20:23:47 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (rb_any_hash): treat Qundef like as other special constants.
+
+ * hash.c (hash_foreach_iter): fix signature.
+
+Tue Feb 21 19:39:34 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/curses/curses.c (Init_curses): use curses_version() for
+ Curses::VERSION.
+
+Tue Feb 21 18:21:25 2012 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c : remove gc_clear_mark_on_sweep_slots() and use
+ rest_sweep() instead of it, because some dead objects might be
+ marked in next the mark phase by false pointers.
+ [ruby-core:42672]
+
+Tue Feb 21 16:08:17 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * proc.c (rb_hash_proc): get wrapped pointer properly. [Bug #6048]
+
+Tue Feb 21 14:41:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * template/ruby.pc.in: added rubylibprefix, {rubylib,vendor,site}dir
+ and {ruby,vendor,site}archdir. [ruby-core:42766][Feature #6052]
+
+Tue Feb 21 09:13:25 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * proc.c (method_hash, proc_hash): Fix {Unbound}Method#hash
+ [Bug #6048]. Isolate hash computation for proc
+
+ * internal.h: Declaration for above
+
+ * vm_method.c (rb_method_definition_hash): Computation for
+ hash part of a method definition
+
+ * method.h: Declaration for above
+
+ * test/ruby/test_method.rb: Test for above
+
+Tue Feb 21 02:56:15 2012 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * enumerator.c (enumerator_rewind): update the documentation.
+ fixed: #6053
+
+Mon Feb 20 23:38:35 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * enc/depend: ignore mktable.c because it's not encoding library.
+ [ruby-core:42760] [Bug #6049]
+
+Mon Feb 20 21:40:53 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/curses/extconf.rb: fold too long lines.
+
+Mon Feb 20 21:16:48 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * lib/fileutils.rb: revert a line modified accidentally at r34669.
+ This fixes mingw test errors in TestDir_M17N.
+ [ruby-core:42728] [Feature #4970]
+
+Mon Feb 20 21:09:27 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/curses/curses.c (Init_curses): define Curses::VERSION.
+
+Mon Feb 20 21:08:00 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/curses/extconf.rb: restore $libs and $defs for each
+ header/library choice.
+
+Mon Feb 20 19:57:26 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/dbm/extconf.rb: weaken header/library consistency check if db is
+ "ndbm". It seems several (possibly historical) distributions
+ provide libndbm. However the content of libndbm vary: Berkeley DB,
+ GDBM or even 4.3BSD NDBM. (Mandriva, Tru64 UNIX, OpenSuSE,
+ SCO OpenServer, ...)
+ "ndbm" is not searched automatically now (dblib doesn't contain it)
+ but configure --with-dbm-type=ndbm choose libndbm and ndbm.h.
+
+Mon Feb 20 19:15:57 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/dbm/extconf.rb: refine variable names.
+
+Mon Feb 20 15:50:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in: check if -fstack-protector is really available.
+
+Sun Feb 19 23:43:38 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/dbm/extconf.rb: show header and library found.
+
+Sun Feb 19 23:01:01 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/dbm/dbm.c (Init_dbm): refine DBM::VERSION definition.
+
+ * ext/dbm/extconf.rb: provide RUBYDBM_GDBM_HEADER macro.
+
+Sun Feb 19 17:07:27 2012 Tanaka Akira <akr@fsij.org>
+
+ * test/dbm/test_dbm.rb (test_dbmfile_suffix): check pag and dir is
+ empty for 4.3BSD ndbm.
+
+Sun Feb 19 03:00:30 2012 Tanaka Akira <akr@fsij.org>
+
+ * test/dbm/test_dbm.rb (test_dbmfile_suffix): check magic numbers.
+
+Sun Feb 19 01:05:41 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/dbm/extconf.rb: detect GDBM's ndbm.h by testing dbm_clearerr is
+ an empty macro.
+
+Sun Feb 19 00:25:55 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/dbm/extconf.rb: don't choose 'dbm' if _GDB_H_ is defined which
+ is available since GDBM 1.9 because 'gdbm_compat' is appropriate
+ choice since GDBM 1.8.1.
+
+Sat Feb 18 23:27:00 2012 Kenta Murata <mrkn@mrkn.jp>
+
+ * random.c: remove a duplicated comment.
+
+Sat Feb 18 18:43:13 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/dbm/extconf.rb (dblib): prefer recent GDBM over older GDBM.
+ (have_declared_libvar): new function to check a declared variable
+ exists in a library.
+ (have_undeclared_libvar): renamed from renamed from have_libvar.
+ (headers.db_check2): check that GDBM version variable if GDBM header
+ is chosen.
+
+ * ext/dbm/dbm.c (Init_dbm): use HAVE_DECLARED_LIBVAR_GDBM_VERSION and
+ HAVE_UNDECLARED_LIBVAR_GDBM_VERSION macro.
+
+Sat Feb 18 13:53:01 2012 Tanaka Akira <akr@fsij.org>
+
+ * test/dbm/test_dbm.rb (test_dbmfile_suffix): DBM::VERSION should
+ be Berkeley DB if foo.db is created by DBM.open.
+
+Sat Feb 18 13:40:37 2012 Tanaka Akira <akr@fsij.org>
+
+ * test/dbm/test_dbm.rb (test_dbmfile_suffix): test dbm file suffix.
+
+Sat Feb 18 12:50:59 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/dbm/dbm.c (DBM::VERSION): define it by detecting _GDBM_H_ or
+ _DBM_IOERR.
+
+Sat Feb 18 07:52:45 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * tool/enc-unicode.rb: don't use 1.9 feature on tools.
+
+Sat Feb 18 02:48:39 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * lib/fileutils.rb: refactored FileUtil methods to use the
+ `define_command` API. Patch from 7rans <transfire@gmail.com>
+ * test/fileutils/test_dryrun.rb: corresponding test refactoring
+ * test/fileutils/test_nowrite.rb: ditto
+ * test/fileutils/test_verbose.rb: ditto
+
+Fri Feb 17 21:39:36 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/dbm/extconf.rb: remove dbm.
+
+Fri Feb 17 21:18:39 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/dbm/extconf.rb: refine header/library mismatch detection.
+ check only for ndbm.h except libc. check _GDBM_H_ for gdbm.
+ check _DBM_IOERR for the original ndbm.
+
+Fri Feb 17 20:30:44 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/dbm/extconf.rb: don't check libdbm. It is not a ndbm
+ implementation. (libdbm in Version 7 Unix is database library
+ for single database per process.)
+
+Fri Feb 17 15:38:53 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * Merge Onigmo-5.13.1. [ruby-dev:45057] [Feature #5820]
+ https://github.com/k-takata/Onigmo
+ cp reg{comp,enc,error,exec,parse,syntax}.c reg{enc,int,parse}.h
+ cp oniguruma.h
+ cp tool/enc-unicode.rb
+ cp -r enc/
+
+Fri Feb 17 15:20:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enum.c (enum_each_slice): arrays to be yielded can be newly
+ created in the block.
+
+ * enum.c: move work variables to objects not to let called blocks
+ access stack area out of scope. [Bug #5801]
+
+Fri Feb 17 12:35:55 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * tool/merger.rb: remove borders from the commit message which is used
+ when the commit doesn't change ChangeLog.
+
+Fri Feb 17 11:50:11 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (btest, btest-ruby, test-sample test-knownbugs)
+ (test-all, test-ruby): depend on prog.
+
+Fri Feb 17 09:56:22 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (create_header): log the content of header.
+
+Fri Feb 17 09:44:55 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * tool/transcode-tblgen.rb (import_ucm): don't use \h because the
+ script should work with ruby 1.8.
+
+ * tool/enc-unicode.rb: ditto.
+
+Fri Feb 17 07:33:29 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enum.c (id_lshift): use constant ID.
+
+Fri Feb 17 07:30:53 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/dbm/extconf.rb: refactored to split too long conditions.
+
+Fri Feb 17 00:23:25 2012 Tanaka Akira <akr@fsij.org>
+
+ * test/dbm/test_dbm.rb: fix skip condition for libgdbm 1.8.0 or prior.
+ reported by Bohuslav Kabrda.
+ [ruby-core:42685] [ruby-trunk - Bug #6036]
+
+Fri Feb 17 00:04:21 2012 Tanaka Akira <akr@fsij.org>
+
+ * ext/dbm/extconf.rb: check _DB_H_ macro unavailable except
+ Berkeley DB library.
+
+Thu Feb 16 05:41:35 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * insns.def (splatarray): make new array if flag is set.
+
+ * compile.c (iseq_compile_each): make new array with
+ splat. [ruby-core:21901][Feature #1125]
+
+Thu Feb 16 00:14:04 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * lib/abbrev.rb (Array#abbrev): add missing '"' in documentation.
+
+Wed Feb 15 22:20:19 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * cont.c (rb_fiber_reset_root_local_storage): add a new function to
+ restore rb_thread_t::local_storage.
+
+ * cont.c (rb_obj_is_fiber): add a new function to tell finalizer to
+ prevent fibers from destroy.
+
+ * gc.c (rb_objspace_call_finalizer): don't sweep fibers at finalizing
+ objspace.
+
+ * internal.h (rb_fiber_reset_root_local_storage, rb_obj_is_fiber):
+ add prototypes.
+
+ * vm.c (ruby_vm_destruct): reset main thread's local_storage before
+ free main thread. rb_thread_t::local_storage is replaced by fiber's
+ local storage when forked from fiber, and it should be already freed
+ when the fiber was destroyed. [ruby-core:41456] [Bug #5700]
+
+ * test/ruby/test_fiber.rb (test_fork_from_fiber): add test for fork
+ from fiber.
+
+Wed Feb 15 19:57:02 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/fiddle/closure.c (callback): deal with unsigned integers.
+ [ruby-core:42458][Bug #5991][Bug #6022]
+
+ * ext/fiddle/conversions.c (value_to_generic, generic_to_value):
+ ditto.
+
+ * ext/fiddle/closure.c (callback): same as r34506.
+
+Wed Feb 15 17:41:31 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (io_strsetbuf): call rb_str_modify to make str independent
+ before calling rb_str_set_len for r34580.
+
+Wed Feb 15 12:30:10 2012 Eric Hodel <drbrain@segment7.net>
+
+ * ext/zlib/zlib.c (Init_zlib): Added Zlib::TEXT and note that
+ Zlib::ASCII is deprecated in zlib 1.2.3 and newer.
+
+Wed Feb 15 12:24:40 2012 Eric Hodel <drbrain@segment7.net>
+
+ * ext/zlib/zlib.c: Move constant descriptions to constants. Remove
+ extra comment block at the top of Init_zlib().
+
+Wed Feb 15 12:30:46 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/ostruct.rb: Create getters and setters after dup.
+ [Bug #6028] [rubyspecs:0380bcc]
+
+Wed Feb 15 10:59:52 2012 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c (HEAP_BITMAP_LIMIT): HEAP_BITMAP_LIMIT is computed on the
+ basis of HEAP_SIZE because it must covers a whole heap block.
+ [ruby-trunk - Bug #6006]
+
+Wed Feb 15 09:27:45 2012 Eric Hodel <drbrain@segment7.net>
+
+ * ext/zlib/zlib.c (Init_zlib): Added Zlib::FIXED and Zlib::RLE
+ strategies.
+ * NEWS: Add note about the new Zlib constants.
+
+Wed Feb 15 09:11:36 2012 Eric Hodel <drbrain@segment7.net>
+
+ * ext/zlib/zlib.c: Improve documentation. [ruby-trunk - Bug #5948]
+
+Wed Feb 15 07:28:54 2012 Eric Hodel <drbrain@segment7.net>
+
+ * encoding.c (Init_Encoding): Add IO example of internal and external
+ encoding. Fixed a typo in the force_encoding example. [#5949]
+
+Wed Feb 15 06:58:21 2012 Eric Hodel <drbrain@segment7.net>
+
+ * encoding.c (Init_Encoding): Add Encoding documentation.
+ [ruby-trunk - Bug #5949]
+ * encoding.c (rb_set_default_external): Fix typo in documentation.
+
+Tue Feb 14 20:22:11 2012 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c (CEILDIV): rename to a appropriate name.
+
+Tue Feb 14 18:07:20 2012 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c (assign_heap_slot): SEGV happens cause on 64-bit platform
+ sometime there should be `objs-=2` instead of `objs--`.
+ [Bug #6006]
+ patched by Sokolov Yura. https://github.com/ruby/ruby/pull/92
+
+Tue Feb 14 16:00:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (io_setstrbuf): cut down the buffer if longer.
+
+Tue Feb 14 15:06:37 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit/assertions.rb (build_message): skip escaped
+ question marks.
+
+Tue Feb 14 12:10:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * variable.c (autoload_const_set, autoload_require): fix
+ signatures.
+
+Tue Feb 14 05:23:40 2012 Eric Hodel <drbrain@segment7.net>
+
+ * process.c (proc_wait): Change typo "SystemError" to
+ "SystemCallError". [ruby-trunk - Bug #5962]
+ * process.c (proc_wait2): ditto
+
+Tue Feb 14 05:18:24 2012 Eric Hodel <drbrain@segment7.net>
+
+ * enumerator.c: Document use of Enumerator.new for creating a lazy
+ enumeration for filtering/chaining. [ruby-trunk - Feature #707]
+
+Mon Feb 13 23:01:50 2012 Akinori MUSHA <knu@iDaemons.org>
+
+ * vm_method.c (rb_method_boundp):
+ obj.respond_to?(:a_protected_method) should return false because
+ calling a protected method may cause NoMethodError if called
+ from outside the class inheritance tree. Kernel#respond_to? is
+ mostly used to test if it is safe to call a method, so the false
+ positive should be avoided. [ruby-dev:40461] [ruby-dev:41739]
+ [ruby-dev:41837]
+
+Mon Feb 13 21:52:06 2012 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c (HEAP_OBJ_LIMIT, HEAP_BITMAP_LIMIT): HEAP_OBJ_LIMIT used
+ `sizeof(struct heaps_slot)` while heap is currently allocated
+ with `struct heaps_header`.
+ HEAP_BITMAP_LIMIT were calculated from
+ `HEAP_OBJ_LIMIT/sizeof(uintptr_t)` - one Byte for each object,
+ not one Bit. [Bug #6006]
+ patched by Sokolov Yura. https://github.com/ruby/ruby/pull/92
+
+Mon Feb 13 18:30:32 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (io_setstrbuf): defer resizing buffer string until data is
+ read actually.
+
+Mon Feb 13 10:24:39 2012 Loren Segal <lsegal@soen.ca>
+
+ * io.c (Init_IO): use directive hack to make ARGF documentable
+ in other tools. [ruby-core:42515][Bug #6007]
+
+Sun Feb 12 20:43:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/ruby.h (rb_event_hook_func_t): add argument names.
+
+Sun Feb 12 16:30:23 2012 Akinori MUSHA <knu@iDaemons.org>
+
+ * tool/merger.rb (#default_merge_branch): Add support for
+ Subversion 1.7 which adopted a whole new working directory
+ structure.
+
+Sun Feb 12 15:14:41 2012 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * benchmark/driver.rb: suppress unused/shadowing variable warnings.
+
+Sun Feb 12 03:14:40 2012 Eric Hodel <drbrain@segment7.net>
+
+ * vm_eval.c (check_funcall): Call respond_to? with matching arity for
+ legacy single-argument implementations. [ruby-trunk - Bug #6000]
+
+Sat Feb 11 12:04:05 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (defined_expr): guard the whole expression.
+ [ruby-dev:45021][Bug#5786]
+
+Sat Feb 11 08:34:42 2012 Eric Hodel <drbrain@segment7.net>
+
+ * ext/zlib/zlib.c (rb_inflate_add_dictionary): Added
+ Zlib::Inflate#add_dictionary to allow users to pre-specify
+ for using during #inflate. [ruby-trunk - Feature #5937]
+
+Sat Feb 11 08:23:02 2012 Eric Hodel <drbrain@segment7.net>
+
+ * ext/zlib/zlib.c (do_inflate): Inflate more data if buffered data
+ exists. Allows Zlib::Inflate#set_dictionary to work.
+ [ruby-trunk - Bug #5929]
+
+Sat Feb 11 06:00:48 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * dir.c (fnmatch): The * needs to be escaped to avoid formatting in
+ fnmatch comment.
+ patched by @dalton. https://github.com/ruby/ruby/pull/91
+
+Fri Feb 10 03:41:31 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/parser.c: removed external encoding setter, allow parser
+ to be reused.
+ * ext/psych/lib/psych/parser.rb: added external encoding setter.
+ * test/psych/test_parser.rb: test parser reuse
+
+Fri Feb 10 01:30:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/dl/dl.h (ALIGN_OF): use offsetof().
+
+ * ext/dl/dl.h (DLALIGN): round up at once and get rid of overflow.
+
+Fri Feb 10 00:47:07 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/ruby/envutil.rb (assert_no_memory_leak): new assertion to
+ check memory leak by invoking child ruby process and watch its
+ memory size.
+
+Thu Feb 9 23:41:44 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * test/pathname/test_pathname.rb (test_binread): add assertion to
+ check encoding.
+
+Thu Feb 9 16:48:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/dl/dl.c (Init_dl): fix mangled document.
+
+Thu Feb 9 16:10:34 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/memory_status.rb (Memory::Win32): 64bit support.
+
+Thu Feb 9 16:08:55 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/dl/lib/value.rb (DL::ValueUtil.{unsigned_value,signed_value}):
+ currently pack/unpack does not accept "q!" and "Q!".
+
+Thu Feb 9 16:01:29 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/fiddle/conversions.c (value_to_generic): src is not guaranteed as
+ a Bignum if the type is LONG_LONG. it may be a Fixnum if the value
+ is small.
+
+Thu Feb 9 11:32:36 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/dl/lib/types.rb: Win64 support.
+
+Thu Feb 9 04:12:29 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * test/pathname/test_pathname.rb: not read but binread.
+ patched by Benoit Daloze, [ruby-core:42440] [Bug #5984]
+
+Wed Feb 8 22:29:59 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_modify_expand): fix memory leak.
+
+Wed Feb 8 14:06:59 2012 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * ext/openssl/ossl_ssl.c: Add SSL constants and allow to unset SSL
+ option to prevent BEAST attack. See [Bug #5353].
+
+ In OpenSSL, OP_DONT_INSERT_EMPTY_FRAGMENTS is used to prevent
+ TLS-CBC-IV vulnerability described at
+ http://www.openssl.org/~bodo/tls-cbc.txt
+ It's known issue of TLSv1/SSLv3 but it attracts lots of attention
+ these days as BEAST attack. (CVE-2011-3389)
+
+ Until now ossl sets OP_ALL at SSLContext allocation and call
+ SSL_CTX_set_options at connection. SSL_CTX_set_options updates the
+ value by using |= so bits set by OP_ALL cannot be unset afterwards.
+
+ This commit changes to call SSL_CTX_set_options only 1 time for each
+ SSLContext. It sets the specified value if SSLContext#options= are
+ called and sets OP_ALL if not.
+
+ To help users to unset bits in OP_ALL, this commit also adds several
+ constant to SSL such as
+ OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS. These constants were
+ not exposed in Ruby because there's no way to unset bits in OP_ALL
+ before.
+
+ Following is an example to enable 0/n split for BEAST prevention.
+
+ ctx.options = OP_ALL & ~OP_DONT_INSERT_EMPTY_FRAGMENTS
+
+ * test/openssl/test_ssl.rb: Test above option exists.
+
+Wed Feb 8 13:12:02 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_x509name.c: Use the numerical representation of
+ unrecognized OIDs instead of the sn "UNDEF".
+
+ * test/openssl/test_x509name.rb: Add tests for the fixed behavior.
+
+ Patch provided by Paul Kehrer, thank you!
+ [ruby-core:41769] [Feature #5787]
+
+Wed Feb 8 09:49:58 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * tool/merger.rb: don't abort, update first.
+
+Wed Feb 8 09:47:33 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_asn1.c: Call INT2NUM only once for GeneralString.
+ Thanks to Mantas Mikulenas for noticing and providing a patch!
+ [ruby-core:42358] [Bug #5972]
+
+Wed Feb 8 09:19:00 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_cipher.c: Add warning about key as IV.
+
+Tue Feb 7 20:08:12 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * error.c (exc_inspect): Fix typo. patch from Trent Ogren
+ via https://github.com/ruby/ruby/pull/90
+
+Tue Feb 7 19:37:35 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * st.c: refactor packed entries using structs.
+
+Tue Feb 7 14:52:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * st.c (st_update): table can be unpacked in the callback.
+
+ * st.c (st_foreach): should not yield same pair when checking
+ after unpacking.
+
+Mon Feb 6 21:55:13 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * tool/merger.rb: abort if the working directory is dirty.
+
+ * tool/merger.rb: update the working directory after commit.
+
+Mon Feb 6 00:16:27 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * encoding.c (rb_enc_compatible): return ASCII-8BIT even if 2nd string
+ is ascii only string. [ruby-core:42354] [Bug #5968]
+
+Fri Feb 3 07:16:47 2012 Eric Hodel <drbrain@segment7.net>
+
+ * lib/webrick.rb: Moved proxy rewriting to WEBrick::HTTPProxy.
+ * lib/webrick/httpproxy.rb: Add examples of creating a proxy server
+ and response rewriting using HTTPProxy.
+
+Fri Feb 3 06:53:22 2012 Eric Hodel <drbrain@segment7.net>
+
+ * ext/openssl/ossl_x509store.c: Add class documentation for
+ OpenSSL::X509::Store
+
+Thu Feb 2 22:28:13 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * test/net/http/test_https_proxy.rb
+ (HTTPSProxyTest#test_https_proxy_authentication):
+ add workaround to avoid to hang up without openssl.
+ see [ruby-dev:45021][Bug #5786]
+
+ * test/resolv/test_dns.rb (TestResolvDNS#test_query_ipv4_address):
+ ditto.
+
+Thu Feb 2 21:48:18 2012 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/parsers/baseparser.rb: use meaningful names.
+
+Thu Feb 2 21:38:52 2012 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/parsers/baseparser.rb, test/rexml/test_namespace.rb:
+ fix the default xml namespace URI validation.
+ [ruby-dev:45169] [Bug #5956]
+ Reported by Miho Hiramatsu. Thanks!!!
+
+Thu Feb 2 17:51:02 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (argf_next_argv): reset ARGF.next_p on ARGV.replace.
+ r34409 breaks replacing ARGV.
+ [ruby-dev:45160] [Bug #5952]
+
+Thu Feb 2 16:21:01 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/net/http/test_http.rb (TestNetHTTPKeepAlive#*): remove debug
output.
-Fri Dec 17 00:05:40 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Thu Feb 2 01:24:34 2012 Yusuke Endoh <mame@tsg.ne.jp>
- * io.c (rb_io_advise): New API. IO#advise() allows to tell the
- ruby runtime how it expects to use a file handle. This feature
- can be improved a performance some situations.
- Note: This feature is mainly developed by Run Paint Run Run.
- Thank you! [ruby-core:33110] [Ruby 1.9-Feature#4038]
+ * parse.y (debug_lines, coverage): set file path encoding for coverage
+ result. [ruby-dev:44950]
- * io.c (do_io_advise): Helper function.
- * io.c (io_advise_sym_to_const): ditto.
+Wed Feb 1 14:38:31 2012 Akinori MUSHA <knu@iDaemons.org>
-Thu Dec 16 23:29:20 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/tempfile.rb (Tempfile#unlink, Tempfile::Remover#call): Just
+ call File.unlink and ignore ENOENT because existence check
+ before unlinking does not help in terms of race condition.
- * tool/rbinstall.rb (bin-comm): use transformed name.
- [ruby-dev:42777]
+ * lib/tempfile.rb (Tempfile#unlink, Tempfile::Remover#call): My
+ comment about thread safeness is obsolete.
-Thu Dec 16 21:52:07 2010 Tanaka Akira <akr@fsij.org>
+Wed Feb 1 09:50:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c: parenthesize macro arguments.
+ * doc/re.rdoc (Repetition): fix typo. reported by Ori Avtalion
+ and patched by Zachary Scott. [Bug #5947]
-Thu Dec 16 21:46:39 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Feb 1 06:38:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * tool/mkconfig.rb (RbConfig): honor ARCHFLAGS and RC_ARCHS to
- override embedded ARCH_FLAG value on universal-darwin.
+ * io.c (argf_close): skip stdin, which should be readable again.
+ [ruby-dev:45160] [Bug #5952]
-Thu Dec 16 19:50:12 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * io.c (argf_readlines): reinitialize after all read to be
+ readable again.
- * win32/{configure.bat,setup.mak,Makefile.sub} (PROGRAM_PREFIX,
- PROGRAM_SUFFIX): unite the differences of the names of macros of
- prefix and suffix.
- reported by HANEDA Norikatsu. [ruby-dev:42775]
+Tue Jan 31 21:27:43 2012 Narihiro Nakamura <authornari@gmail.com>
-Thu Dec 16 08:04:47 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (HEAP_ALIGN_LOG): HEAP_ALIGN_LOG should be page
+ size in OpenBSD. [ruby-core:42158][Bug #5901]
- * node.h (RNode): match the type of flags to RBasic, and renamed
- nd_file as nd_reserved.
+ * gc.c : avoid to redefine.
- * iseq.c (set_relation), vm_insnhelper.c (vm_cref_push): nd_file
- is always zero-cleared.
+Tue Jan 31 14:27:22 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Dec 16 07:22:30 2010 Ryan Davis <ryand-ruby@zenspider.com>
+ * test/ruby/envutil.rb (EnvUtil.invoke_ruby): yield also child pid
+ in block form.
- * lib/minitest/unit.rb: Imported minitest 2.0.1 r6079.
+Mon Jan 30 19:08:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Dec 15 20:45:02 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * vm_eval.c (vm_call0): should pass block to enumerators. patched
+ by Kazuki Tsujimoto. [ruby-dev:44961][Bug #5731]
- * lib/test/unit.rb (process_args): need to setup @help to print options.
+ * vm_eval.c (method_missing), vm_insnhelper.c (vm_call_method):
+ ditto. patched by satoshi shiba.
-Wed Dec 15 11:19:33 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Jan 30 12:31:05 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/zlib/test_zlib.rb (test_to_io): forgotten to fix with r30201.
+ * file.c (append_fspath): need to set the encoding to result always.
-Wed Dec 15 11:07:34 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jan 30 10:38:37 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * io.c (simple_sendfile): enable on Mac OS X.
+ * test/irb/test_completion.rb: skip if cannot load irb/completion
+ (maybe readline does not exist).
- * io.c (nogvl_copy_stream_sendfile): moved precheck of copy length.
+Sun Jan 29 22:47:19 2012 Yutaka Kanemoto <kanemoto@ruby-lang.org>
- * io.c (nogvl_copy_stream_sendfile): should wait for both of
- read/write fds.
+ * tool/config.{guess,sub}: updated to automake-1.11.2.
-Wed Dec 15 07:11:55 2010 Tanaka Akira <akr@fsij.org>
+Sun Jan 29 12:17:56 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * hash.c: parenthesize macro arguments.
+ * ext/readline/readline.c (readline_attempted_completion_function):
+ respect encodings. [Bug #5941]
-Wed Dec 15 04:02:00 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Sat Jan 28 09:33:33 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * ext/openssl/ossl_x509ext.c (ossl_x509extfactory_set_config):
- fix compile error when !HAVE_X509V3_SET_NCONF. Thanks
- Chikanaga-san. [ruby-dev:42761] [Ruby 1.9-Bug#4158]
+ * win32/win32.c (rb_w32_read): fix an issue that $stdin.read doesn't
+ terminate by CTRL-C on Windows.
+ [ruby-dev:45149] [Bug #5812]
-Wed Dec 15 03:41:31 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+Sat Jan 28 08:18:11 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * test/ripper/test_parser_events.rb (TestRipper#test_block_variables):
- Limit address space 100MB instead 100KB. Quite frankly, This
- margin is too narrow to contain ruby. [ruby-dev:42763] [Bug#4159]
+ * test/ruby/test_thread.rb
+ (TestThreadGroup#test_thread_timer_and_interrupt): skip exit status
+ assertion because we cannot get signal status on Windows.
-Tue Dec 14 23:53:52 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * win32/win32.c (CreateChild): create process group to receive the
+ signal by GenerateConsoleCtrlEvent().
- * io.c (simple_sendfile): improve linux compatibility on FreeBSD,
- and now it works. But without cpuset -l 0, it still gets stuck.
+ * win32/win32.c (kill): use CTRL_BREAK_EVENT instead of CTRL_C_EVENT
+ if a process group is specified. CTRL_C_EVENT signal cannot be
+ generated for process groups for the specification.
+ [ruby-dev:45149] [Bug #5812]
-Tue Dec 14 20:31:33 2010 Tanaka Akira <akr@fsij.org>
+Sat Jan 28 07:46:03 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * gc.c: parenthesize macro arguments.
+ * thread_win32.c (rb_w32_wait_events_blocking): use
+ ruby_thread_from_native() instead of GET_THREAD() because
+ GET_THREAD() doesn't always return the current thread and
+ WaitForMultipleObjects() at rb_w32_read() doesn't return by
+ Thread#kill. This fixes TestQueue#test_thr_kill failure on
+ Windows.
-Tue Dec 14 18:31:48 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * thread_win32.c (rb_w32_wait_events): use ruby_thread_from_native()
+ instead of GET_THREAD() for consistency with the above change.
- * lib/test/unit.rb: help messages.
+ * thread_win32.c (rb_w32_sleep): ditto.
-Tue Dec 14 18:19:03 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * thread_win32.c (rb_w32_Sleep): ditto.
+ [ruby-dev:45149] [Bug #5812]
- * common.mk (help): there is no reason to use the abbreviation for here.
+Sat Jan 28 07:28:48 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Tue Dec 14 15:03:46 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/zlib/test_zlib.rb (TestZlibGzipReader#test_reader_wrap): set
+ binmode explicitly for fixing test error on Windows. This is consistent
+ with r34243.
+ [ruby-dev:45149] [Bug #5812]
- * test/ruby/test_io.rb (test_reopen, test_reinitialize): should close
- the temporary files.
+Sat Jan 28 05:53:34 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Dec 14 14:24:15 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/irb/completion.rb (IRB::InputCompletor::CompletionProc):
+ ignore non-string name modules. [ruby-core:42244][Bug #5938]
- * test/ruby/test_io.rb (make_tempfile): change the prefix from 'foo'
- to 'test_io' because the old one is meaningless and inconvenient.
+Fri Jan 27 16:31:45 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/ruby/test_io.rb (test_binmode_after_closed): the temporary file
- maked by make_temfile is already closed.
+ * gc.c (HEAP_ALIGN, HEAP_ALIGN_MASK): DRY, let compiler calculate
+ from HEAP_ALIGN_LOG.
-Tue Dec 14 13:52:19 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Jan 26 11:03:37 2012 Eric Hodel <drbrain@segment7.net>
- * test/ruby/test_io.rb (test_flush_in_finalizer[12]): should close
- temporary file because it's only used for taking pathname and
- unlinking the file after the end of the test (in GC phase).
+ * lib/matrix.rb: Clean up extra whitespace in output documentation.
-Tue Dec 14 13:34:33 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Jan 26 03:24:02 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/zlib/zlib.c (gzfile_s_open): should close the IO if some error
- occurs in initializing.
+ * ext/io/console/console.c (io_getch): default delegating method
+ for StringIO. https://github.com/nobu/io-console/issues/4
-Tue Dec 14 13:04:16 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/stringio/stringio.c: moved some methods to hidden modules.
- * lib/net/http.rb (Net::HTTPRequest#send_request_body_data):
- set binmode to tempfile.
+Wed Jan 25 13:27:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Dec 14 12:55:46 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * file.c (rb_file_s_basename): ignore non-ascii extension in
+ different encoding, which cannot match.
- * test/zlib/test_zlib.rb (*): should close files associated with zlib.
+ * file.c (rmext): no extension to strip if empty string.
-Tue Dec 14 11:30:17 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * file.c (rb_enc_path_next, rb_enc_path_skip_prefix)
+ (rb_enc_path_last_separator, rb_enc_path_end)
+ (ruby_enc_find_basename, ruby_enc_find_extname): encoding-aware
+ path handling functions.
- * test/ruby/test_argf.rb (test_inplace_rename_impossible): unlink
- the renamed temporary file on no_safe_rename platforms.
+ * file.c (rb_home_dir, file_expand_path, rb_realpath_internal)
+ (rb_file_s_basename, rb_file_dirname, rb_file_s_extname)
+ (rb_file_join): should respect the encodings of arguments than
+ file system encoding. [ruby-dev:45145] [Bug #5919]
- * test/ruby/test_argf.rb (test_readlines_limit_0,
- test_each_line_limit_0): should close argf because the associated
- Tempfile object cannot unlink the temporary file when it's gc'ed
- on some platforms (Windows, etc.)
+ * dir.c (check_dirname, ruby_glob0): ditto.
-Tue Dec 14 11:27:07 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/pathname/pathname.c (path_sub_ext): ditto.
- * lib/minitest/unit.rb (Minitest::Unit#_run_suite): split test
- name and its time. Thiw allows to know test's name when you are
- running tests and meet a test which spends long time at realtime.
+Tue Jan 24 14:20:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Dec 14 11:25:20 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * vm.c (rb_iter_break_value): new function to break a block with
+ the value. [ruby-dev:45132] [Feature #5895]
- * configure.in: Add -Werror=declaration-after-statement to default
- warning flag. If you are using GCC, this flag is useful to
- prevent breaking VC build.
+Tue Jan 24 12:58:41 2012 Yukihiro Matsumoto <matz@ruby-lang.org>
-Tue Dec 14 10:25:57 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * object.c (rb_Hash): add Kernel#Hash conversion method like
+ Array() or Float(). a patch from Run Paint Run Run. Fix #3131
- * ext/openssl/ossl_asn1.c (ossl_asn1_decode0): how many gcc-c99isms
- must a man mend; before he can build with VC? r30178
+Tue Jan 24 11:38:05 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Mon Dec 13 21:26:33 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/uri/common.rb (URI.encode_www_form_component): initialize on
+ requiring to support JRuby, which runs parallel multithreads.
+ [ruby-core:42222] [Bug #5925]
- * io.c (simple_sendfile): disable the use of sendfile(2) on
- FreeBSD. It blocks on TestIO#test_copy_stream_socket.
+ * lib/uri/common.rb (URI.decode_www_form_component): initialize on
-Mon Dec 13 18:35:33 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Jan 23 20:33:11 2012 Jason Kay <geniture@me.com>
- * io.c: define USE_SENDFILE on FreeBSD or DragonFly BSD.
- Remove Mac OS X because its argument is different from them.
+ * lib/net/http.rb (Net::HTTP#connect): Writing entire packet at
+ once to avoid incomplete transmission. Current code using
+ writeline was causing sub-optimal conversing with a proxy due to
+ the connect tunnel request headers being split over multiple
+ packets. The modification I made allows the connect request to
+ be written as one packet, avoiding problems and optimizing the
+ conversation.
-Mon Dec 13 12:00:09 2010 Tanaka Akira <akr@fsij.org>
+ https://github.com/ruby/ruby/pull/72
+ [Feature #5460]
- * file.c: parenthesize macro arguments.
+Mon Jan 23 17:06:17 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Mon Dec 13 11:21:14 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/uri/mailto.rb (URI::MailTo.build): follow Array#to_s change of
+ Ruby 1.9; use Array#join. [Bug #5840]
- * io.c (simple_sendfile): added for BSD version of sendfile(2).
+Mon Jan 23 16:42:28 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Mon Dec 13 09:50:09 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * io.c (extract_binmode): raise an exception if binmode/textmode
+ is specified with both vmode and opthash.
+ [ruby-core:42199] [Bug #5918]
- * lib/net/http.rb (Net::HTTPRequest#set_form): Added to support
- both application/x-www-form-urlencoded and multipart/form-data.
- There is a similar API, Net::HTTPRequest#set_form_data, but
- to keep its compatibility this is newly added. [ruby-dev:42729]
+Mon Jan 23 16:35:27 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Dec 12 23:45:27 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (rb_io_extract_modeenc): set ASCII-8BIT if binmode is specified
+ with opthash. [ruby-core:42197] [Bug #5917]
- * compile.c (iseq_compile_each): fix for __goto__ and __label__
- where were totally broken.
+Mon Jan 23 10:08:00 2012 Kenta Murata <mrkn@cookpad.com>
-Sun Dec 12 22:45:43 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/cgi/test_cgi_util.rb (test_cgi_escape_preserve_encoding):
+ add a test for CGI::escape to preserve encoding.
- * common.mk (ID_H_INCLUDES): now id.h depends on vm_opts.h.
+ * test/cgi/test_cgi_util.rb (test_cgi_unescape_preserve_encoding):
+ add a test for CGI::unescape to preserve encoding.
-Sun Dec 12 20:42:47 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Mon Jan 23 00:45:34 2012 Akinori MUSHA <knu@iDaemons.org>
- * template/id.h.tmpl: suppress all warning: "SUPPORT_JOKE" is not
- defined. [ruby-dev:42730]
+ * misc/rdoc-mode.el (rdoc-imenu-create-index): Add imenu support
+ to rdoc-mode.
-Sun Dec 12 20:35:07 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * misc/rdoc-mode.el (rdoc-mode): Fix regexp patterns containing
+ "\s " where CR/LF is not supposed to match.
- * misc/rb_optparse.zsh: update how to install.
+Sun Jan 22 15:41:26 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * misc/rb_optparse.zsh: avoid error when setopt noclobber.
+ * parse.y (rb_intern3): split to registration check and new
+ registration.
- * lib/optparse.rb: fix typo. pointed out at
- <http://d.hatena.ne.jp/nagachika/20101207>.
+ * parse.y (rb_intern_str): make interned string shared with the
+ given string.
-Sun Dec 12 13:27:35 2010 Tanaka Akira <akr@fsij.org>
+ * parse.y (rb_intern3, rb_intern_str): check the coderange first.
- * eval_error.c: parenthesize macro arguments.
+Sat Jan 21 22:21:07 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Dec 12 11:53:24 2010 Tanaka Akira <akr@fsij.org>
+ * include/ruby/ruby.h (FIXNUM_P): simple flag should be int.
- * error.c: parenthesize macro arguments.
+Sat Jan 21 21:51:19 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Dec 12 04:01:58 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * encoding.c (rb_enc_compatible): fix segv on symbols.
+ [ruby-core:42204] [Bug #5921]
- * string.c (rb_str_inspect): fix: extra back slash is added when
- the string is dummy encoding and includes \x22 or \x5C.
+Sat Jan 21 11:43:45 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Dec 12 02:42:24 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+ * dir.c (dir_chdir, check_dirname): get rid of optimization-out.
- * ext/openssl/ossl_asn1.c: indefinite length BER to DER encoding is
- properly supported. Thanks Martin Bosslet! [ruby-core:33082]
+Fri Jan 20 20:47:37 2012 Kenta Murata <mrkn@cookpad.com>
-Sat Dec 11 17:43:34 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * lib/cgi/util.rb (CGI.escape): support a string with invalid byte
+ sequence. [Bug #5913]
- * ext/bigdecimal/bigdecimal.h: suppress "warning: 'VPrint' declared
- 'static' but never defined".
+ * test/cgi/test_cgi_util.rb
+ (test_cgi_escape_with_invalid_byte_sequence): test for the above
+ change.
-Sat Dec 11 09:24:57 2010 Tanaka Akira <akr@fsij.org>
+Fri Jan 20 17:37:37 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * encoding.c: parenthesize macro arguments.
+ * vm.c (vm_exec): remove workaround for LLVM because r34278 fixes it.
-Sat Dec 11 08:12:48 2010 Eric Hodel <drbrain@segment7.net>
+ * vm_insnhelper.c (vm_call_cfunc): ditto.
- * ext/openssl/ossl.c, ext/openssl/ossl_pkey_rsa.c: Document RSA, RSA
- encryption/decryption and PKCS #5 encryption/decryption.
+Fri Jan 20 14:31:43 2012 NARUSE, Yui <naruse@ruby-lang.org>
-Sat Dec 11 06:23:41 2010 Eric Hodel <drbrain@segment7.net>
+ * lib/net/http.rb (Net::HTTP#transport_request): retry a idempotent
+ request automatically. [ruby-dev:45030] [Bug #5790]
+ [ruby-core:41821] [Bug #5813]
- * ext/openssl/ossl_x509name.c: include Comparable to provide #==.
- Document OpenSSL::X509::Name#<=>. [Ruby 1.9-Feature#4116]
+ * lib/net/http.rb (Net::HTTP#keep_alive_timeout=): added to specify
+ the second to reconnect the TCP connection on Keep-Alive.
+ The default value is 2 second because current servers uses 2 sec.
+ http://ftp-admin.blogspot.com/2009/09/keepalivetimeout2.html
-Sat Dec 11 05:48:28 2010 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * lib/net/http.rb (Net::HTTP#begin_transport): reconnect TCP
+ connection on keep-alive timeout.
- * ext/tk/lib/multi-tk.rb: infinite loop on method_missing at loading.
- [ruby-dev:42716] [Ruby 1.9-Bug#4129]
+Thu Jan 19 07:53:09 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * ext/tk/lib/multi-tk.rb: when no eventloop is running, ruby freezes at
- exit.
+ * ext/date/date_strptime.c: moved detector of leftover.
-Sat Dec 11 02:23:15 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+Thu Jan 19 07:10:47 2012 Tadayoshi Funaba <tadf@dotrb.org>
- * ext/openssl/extconf.rb: try pkgconfig first, then fall back to
- normal have_library, etc. Thanks Erik Hollensbe. [ruby-core:32406]
+ * ext/date/date_parse.c: [ruby-core:42173].
-Fri Dec 10 22:33:39 2010 Tanaka Akira <akr@fsij.org>
+Wed Jan 18 18:11:02 2012 Akinori MUSHA <knu@iDaemons.org>
- * dln_find.c: parenthesize macro arguments.
+ * misc/rdoc-mode.el (rdoc-mode): Add provide so that requiring
+ this library succeeds.
-Fri Dec 10 20:05:42 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jan 18 18:06:45 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * template/id.h.tmpl (ruby_method_ids): suppress warnings.
- [ruby-dev:42730]
+ * ext/curses/curses.c (cWindow, cMouseEvent): made typed data.
-Fri Dec 10 18:29:20 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jan 18 12:49:15 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * ruby.c (ruby_init_loadpath_safe): relatively called non-shared
- binary cannot be found in PATH, so use given pathname.
+ * ext/psych/lib/psych/visitors/to_ruby.rb: Added support for loading
+ subclasses of String with ivars
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: Added support for dumping
+ subclasses of String with ivars
+ * test/psych/test_string.rb: corresponding tests
-Fri Dec 10 18:28:40 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jan 18 10:39:47 2012 Aaron Patterson <aaron@tenderlovemaking.com>
- * cygwin/GNUmakefile.in (SCRIPTPROGRAMS): ignore backup files and etc.
+ * ext/psych/lib/psych/visitors/to_ruby.rb: Added ability to load array
+ subclasses with ivars.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: Added ability to dump
+ array subclasses with ivars.
+ * test/psych/test_array.rb: corresponding tests
- * cygwin/GNUmakefile.in (scriptbin): set executable bit.
+Tue Jan 17 17:18:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * tool/rbinstall.rb (install_recursive): always skip default ignored
- files. if block is given, call it instead of calling install.
+ * configure.in (SPT_TYPE): enable as SPT_REUSEARGV on Darwin.
- * tool/rbinstall.rb (bin-comm): use install_recursive.
+ * missing/setproctitle.c (ruby_init_setproctitle): changed prefix.
-Fri Dec 10 18:12:31 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jan 17 12:32:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/mkmf/base.rb (TestMkmf#config_value): extract macro value from
- config.h.
+ * gc.c (aligned_malloc, aligned_free): covered missing defined
+ operators and fixes for cygwin.
- * test/mkmf/test_sizeof.rb (TestMkmf::TestSizeof#test_sizeof_builtin),
- (TestMkmf::TestSizeof#test_sizeof_struct): more tests.
+Tue Jan 17 10:54:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mkmf.rb (check_signedness): should use the prelude code.
- [ruby-dev:42731]
+ * st.c (do_hash): it's the time to remove cast to unsigned int.
- * lib/mkmf.rb (Logging.log_close): separate from Logging.logfile.
+Tue Jan 17 07:30:12 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * test/mkmf/base.rb (TestMkmf::MKMFLOG): show mkmf.log at failures.
+ * st.c (unpack_entries): Fix r34310: on unpacking, the position of
+ a hash must be do_hash-ed value.
- * test/mkmf/base.rb (TestMkmf#teardown): close log file for each tests.
+ * st.c (add_packed_direct): ditto.
-Fri Dec 10 11:36:43 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Mon Jan 16 16:41:53 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * compile.c (enum): remove a comma at end of enumerator list.
+ * lib/optparse.rb (Regexp): fix incorrect options when casting to
+ a Regexp, and suppress encoding option warnings.
+ https://github.com/ruby/ruby/pull/82
- * constant.h (rb_const_flag_t): ditto.
+Mon Jan 16 11:22:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * iseq.h (enum catch_type): ditto.
+ * win32/win32.c (rb_chsize): no need to get the current file size.
- * iseq.h (enum defined_type): ditto.
+Mon Jan 16 00:41:33 2012 Sokolov Yura <funny.falcon@gmail.com>
- * vm_core.h (enum iseq_type): ditto.
+ * st.c: st use function instead of macro. In my current
+ environment (Ubuntu 11.04 32bit gcc-4.5.2) it gives 4%
+ performance improvement.
- * vm_core.h (enum vm_special_object_type): ditto.
+ https://github.com/ruby/ruby/pull/77
-Fri Dec 10 10:47:53 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Sun Jan 15 14:09:48 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * sprintf.c (_HAVE_SANE_QUAD_): Don't forget LP64, r30156.
+ * object.c (rb_inspect): raise the result is not compatible with
+ the default external encoding. [ruby-core:42095] [Bug #5848]
+ If the default external encoding is ASCII compatible, the encoding of
+ inspected result must be compatible with it.
+ If the default external encoding is ASCII incompatible,
+ the result must be ASCII only.
-Fri Dec 10 10:37:17 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+Sun Jan 15 13:21:50 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * sprintf.c (_HAVE_SANE_QUAD_): if a certain platform has LONG_LONG in
- 8 byte, it might be sane quad. [ruby-core:33634]
+ * ext/json/parser/parser.rl (json_string_unescape): workaround fix
+ for over optimization of GCC 4.7. [ruby-core:42085] [Bug #5888]
+ http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51862
-Fri Dec 10 10:07:59 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Sat Jan 14 22:24:09 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/net/http.rb: remove version 1.1 features.
+ * ext/dl/callback/mkcallback.rb (gencallback): suppress unused
+ variables.
-Fri Dec 10 02:18:02 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+Sat Jan 14 21:56:43 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/openssl/ossl_x509store.c (ossl_x509stctx_cleanup): removing C
- implementation of `cleanup`.
+ * iseq.c (iseq_data_to_ary): check line info table boundary. line
+ number 0 means no line number info is needed. [ruby-dev:45130]
+ [Bug #5894]
- * ext/openssl/lib/openssl/x509.rb: adding ruby implementation of
- `cleanup`. OpenSSL::X509::StoreContext#cleanup is deprecated since
- reusing the underlying struct doesn't make sense. [ruby-dev:42546]
+Sat Jan 14 18:24:13 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Thu Dec 9 20:14:39 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * error.c (exc_equal): clear rb_thread_t::errinfo when ignore
+ an exception under rb_protect(). [ruby-core:41979] [Bug #5865]
- * parse.y (lvar_defined_gen, shadowing_lvar_gen, dvar_defined): no
- warnings for unused method and block arguments.
- [ruby-dev:42718] [ruby-dev:42724]
+Sat Jan 14 12:02:55 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Dec 9 19:25:49 2010 Tanaka Akira <akr@fsij.org>
+ * sprintf.c (rb_enc_vsprintf): relaxed the restriction. since the
+ implementation deeply depends on plain char, so wchar_t based
+ encodings are not supported.
- * dln.c: parenthesize macro arguments.
+Sat Jan 14 12:00:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Dec 9 18:51:06 2010 Tanaka Akira <akr@fsij.org>
+ * error.c (exc_equal): ignore exceptions during implicit
+ conversion. [ruby-core:41979] [Bug #5865]
- * lib/webrick/accesslog.rb (WEBrick::AccessLog#format): support
- %{remote}p for logging remote (client) port number.
- [ruby-dev:42670]
+Sat Jan 14 05:58:54 2012 Eric Hodel <drbrain@segment7.net>
-Thu Dec 9 11:00:30 2010 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * io.c (rb_io_s_read): Fix formatting of open_args comment. Reported
+ by Adam Prescott.
- * array.c (rb_ary_dup): should copy contents only. no instance
- variable, no class would be copied. it would affect methods
- #sort, #reject, #transpose, #uniq, #compact, and #shuffle.
- [ruby-core:33640]
+Fri Jan 13 18:41:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * array.c (rb_ary_reverse_m): ditto.
+ * sprintf.c (rb_enc_vsprintf): can be used for ASCII compatible
+ encodings only.
- * array.c (rb_ary_rotate_m): ditto.
+Fri Jan 13 18:29:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Dec 8 21:38:40 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * thread.c (rb_mutex_unlock_th): simplified.
- * ext/dl/lib/dl/struct.rb: clean a warning: assigned but unused
- variable. patched by Kouhei Yanagita. [ruby-dev:42722]
+ * thread.c (rb_barrier_waiting): fix potential overflows.
- * ext/dl/lib/dl/import.rb: ditto.
+Fri Jan 13 17:23:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Dec 8 21:36:16 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * load.c (load_unlock): update loading table at once.
- * parse.y (shadowing_lvar_gen): fix line number. [ruby-dev:42718]
+Fri Jan 13 16:44:45 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Dec 8 20:37:11 2010 Tanaka Akira <akr@fsij.org>
+ * error.c (exc_equal): try implicit conversion for delegator.
+ [ruby-core:41979] [Bug #5865]
- * dir.c: parenthesize macro arguments.
+Fri Jan 13 03:46:53 2012 Akinori MUSHA <knu@iDaemons.org>
-Tue Dec 7 22:37:15 2010 Masaya Tarui <tarui@ruby-lnag.org>
+ * lib/shellwords.rb (Shellwords#shellescape): shellescape() now
+ stringifies the given object using to_s.
- * io.c (io_read): duplicate string if shared. [ruby-dev:42719]
+ * lib/shellwords.rb (Shellwords#shelljoin): shelljoin() accepts
+ non-string objects in the given array, each of which is
+ stringified using to_s.
-Tue Dec 7 22:31:08 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/shellwords.rb: Fix rdoc markups.
- * lib/optparse.rb (OptionParser::Officious): separate completion
- options from --help. [ruby-dev:42690]
+Fri Jan 13 03:38:36 2012 Akinori MUSHA <knu@iDaemons.org>
- * lib/optparse.rb (OptionParser::Completion#candidate),
- (OptionParser::Switch#compsys): remove unused variables.
+ * lib/shellwords.rb (Shellwords#shellsplit): Fix a bug where
+ consecutive backslashes in double quotes are all removed except
+ the one at the tail.
-Tue Dec 7 22:05:25 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jan 13 03:28:00 2012 Luis Lavena <luislavena@gmail.com>
- * transcode.c (transcode_loop): call default handler of the given
- hash, method, proc or [] method as fallback. [ruby-dev:42692]
+ * ext/socket/extconf.rb (if ipv6): only define _WIN32_WINNT if was not
+ previously defined. This solve warnings with multiple defines in
+ command line with GCC 4.6.1
-Tue Dec 7 21:59:37 2010 Kouhei Sutou <kou@cozmixng.org>
+Thu Jan 12 18:44:31 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rexml/light/node.rb: remove circular require.
+ * lib/mkmf.rb: fix r33904 and revert r33905. initialize global
+ variables with init_mkmf before initializing constants.
+ [ruby-dev:45124] [Bug #5879]
-Tue Dec 7 21:56:01 2010 Kouhei Sutou <kou@cozmixng.org>
+Thu Jan 12 13:51:00 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * test/rexml/test_light.rb: really suppress a warning.
+ * cont.c (cont_restore_0): prevent optimizing out `sp'. sp is used for
+ reserving a memory space with ALLOCA_N for restoring machine stack
+ stored in cont->machine_stack, but clang optimized out it (and
+ maybe #5851 is also caused by this).
+ This affected TestContinuation#test_check_localvars.
-Tue Dec 7 21:51:57 2010 Kouhei Sutou <kou@cozmixng.org>
+ * cont.c (cont_restore_1): revert workaround introduced in r32201.
- * test/rexml/test_light.rb: suppress a warning.
+Thu Jan 12 02:14:43 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Tue Dec 7 21:14:03 2010 Tanaka Akira <akr@fsij.org>
+ * object.c: Added examples for Object#is_a? and
+ Object#instance_of? patched from Manoj Kumar.
+ [Bug #5880] [ruby-core:42057]
- * debug.c: parenthesize macro arguments.
+Thu Jan 12 00:57:48 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Tue Dec 7 21:06:38 2010 Kouhei Sutou <kou@cozmixng.org>
+ * lib/mkmf.rb: verbose-mode can use by RM, RMDIRS, etc.
+ (e.g. make V=1 realclean)
- * lib/rexml/doctype.rb, test/rexml/test_doctype.rb: suppress warnings.
- [ruby-core:33305]
- Reported by Aaron Patterson. Thanks!!!
+Wed Jan 11 23:40:21 2012 Naohisa Goto <ngoto@gen-info.osaka-u.ac.jp>
-Tue Dec 7 18:56:52 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * string.c (rb_str_concat): set array element after definition
+ to fix compile error with Fujitsu C Compiler 5.6 on Solaris 10
+ on Sparc. [Bug #5878] [ruby-dev:45123]
- * ext/nkf/lib/kconv.rb (String#kconv): fix typo and update rdoc.
- patched by Kouhei Yanagita [ruby-dev:42696]
+Wed Jan 11 22:52:51 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Tue Dec 7 20:32:11 2010 Kouhei Sutou <kou@cozmixng.org>
+ * gc.c (ruby_mimmalloc): don't set allocated size to header.
+ ruby_mimmalloc() doesn't increment allocated_size/allocations and
+ decrement them in ruby_xfree() cause inconsistency.
- * test/rexml/test_doctype.rb: add Accessor to test case name.
+ * gc.c (ruby_xfree): don't decrement allocated_size/allocations if
+ allocated size record is 0.
-Tue Dec 7 20:31:02 2010 Kouhei Sutou <kou@clear-code.com>
+Wed Jan 11 22:36:43 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * test/rexml/test_doctype.rb: Doctype -> DocType.
+ * test/readline/test_readline.rb (test_completion_proc_empty_result):
+ ensure clearance of Readline's line_buffer after the test.
-Tue Dec 7 20:29:23 2010 Kouhei Sutou <kou@clear-code.com>
+Tue Jan 10 21:57:38 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
- * test/rexml/test_doctype_mixin.rb: rename to ...
- * test/rexml/test_doctype.rb: ... this to remove needless name.
+ * ext/dbm/dbm.c (Init_dbm): fix a build error on mswin32.
+ use `extern __declspec(dllimport)` for dll link with VC.
+ [ruby-core:41996] [Bug #5869]
-Tue Dec 7 17:03:16 2010 Shugo Maeda <shugo@ruby-lang.org>
+Tue Jan 10 15:31:55 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/net/imap.rb (xlist): supported the XLIST command, which is an
- extension by Apple and Google. patch by Geoff Youngs.
- [ruby-core:33521]
+ * vm.c (vm_exec): refix r34162; suppress warning and add description.
-Tue Dec 7 08:00:44 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jan 10 15:13:58 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * configure.in, win32/Makefile.sub (WERRORFLAG): flag to treat
- warnings as errors.
+ * ext/readline/readline.c (readline_attempted_completion_function):
+ use rb_memerror().
- * lib/mkmf.rb (Logging.postpone): yield log file object.
+Tue Jan 10 12:49:42 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/mkmf.rb (xsystem): add options, :werror only right now.
+ * gc.c: in fact, i686-linux doesn't need to define _XOPEN_SOURCE 600.
- * lib/mkmf.rb (with_werror): check as if warnings are errors.
+Tue Jan 10 12:44:11 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/mkmf.rb (convertible_int): make declaration conflict
- warnings errors not to pass wrong type. [ruby-dev:42684]
+ * gc.c (ruby_mimmalloc): defined for objects need not rb_objspace,
+ but should return pointer suitable for ruby_xfree;
+ main vm and main thread.
+ patched by Sokolov Yura. https://github.com/ruby/ruby/pull/79
- * lib/mkmf.rb (COMMON_MACROS): get rid of conflicts.
+ * internal.h: ditto.
- * win32/Makefile.sub (WARNFLAGS): make declaration conflict
- warnings errors if possible.
+ * vm.c (Init_BareVM): use ruby_mimmalloc.
-Sun Dec 7 21:16:10 2010 Tanaka Akira <akr@fsij.org>
+ * ext/dl/cfunc.c: #include <ruby/util.h>.
- * cont.c: parenthesize macro arguments.
+ * ext/syslog/syslog.c: use xfree because it is allocated by
+ ruby_strdup.
-Tue Dec 7 00:27:14 2010 Masaya Tarui <tarui@ruby-lnag.org>
+Tue Jan 10 12:13:56 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * win32/win32.c (rb_w32_read): fixed more for readline,
- and so on. [ruby-core:33511]
+ * ext/readline/readline.c (readline_attempted_completion_function):
+ fix compile error.
-Mon Dec 6 23:18:22 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jan 10 10:41:11 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * test/mkmf/base.rb (TestMkmf#setup): run quietly.
+ * ext/readline/readline.c (readline_attempted_completion_function):
+ empty completion result does not mean memory error.
- * test/mkmf/test_find_executable.rb (test_find_executable): use
- configured results.
+Tue Jan 10 02:19:22 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * common.mk (test-build): test for build process.
+ * test/ruby/test_io.rb (test_autoclose_true_closed_by_finalizer,
+ test_autoclose_true_closed_by_finalizer): skip if IO objects are
+ not recycled yet. [ruby-dev:45098] [Bug #5850]
-Mon Dec 6 22:47:15 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jan 10 00:41:28 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * lib/optparse.rb (OptionParser#candidate): skip separators.
+ * lib/tempfile.rb (Tempfile#_close): clear @tempfile and @data[1] even
+ when exception is raised at @tempfile.close. [ruby-dev:45113]
- * sample/optparse/opttest.rb: should not override --help.
- [ruby-dev:42690]
+ * lib/tempfile.rb (Tempfile#unlink): fix a typo.
-Mon Dec 6 19:00:48 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Tue Jan 10 00:32:17 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * misc/rb_optparse.zsh: fix typos.
+ * gc.c (run_finalizer): clear rb_thread_t::errinfo when ignore
+ an exception under rb_protect(). [ruby-dev:45113]
-Mon Dec 6 18:59:04 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Mon Jan 9 23:37:43 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * NEWS: add new encodings.
+ * ext/readline/readline.c (readline_attempted_completion_function):
+ fix typos.
-Mon Dec 6 18:56:42 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Mon Jan 9 20:55:34 2012 Narihiro Nakamura <authornari@gmail.com>
- * test/ruby/test_string.rb (TestString#test_scan): add a test for
- [ruby-core:33338] #4087.
+ * gc.c : don't embed struct heaps_slot to a heap block because it
+ can causes copy-on-write of memory page on heap block when its
+ free_next is rewritten.
-Mon Dec 6 18:55:36 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+Mon Jan 9 20:26:33 2012 Tanaka Akira <akr@fsij.org>
- * test/uri/test_common.rb (TestCommon#test_encode_www_form): add
- tests for r30015.
+ * ext/pathname/pathname.c (path_entries): add document suggested by
+ the thread [ruby-core:41959] [Bug #5859].
-Mon Dec 6 10:39:54 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Jan 9 20:14:13 2012 Tanaka Akira <akr@fsij.org>
- * lib/uri/common.rb (URI::Parser#initialize_pattern):
- refix for restrict the pattern.
+ * ext/socket/lib/socket.rb (family_addrinfo): don't require protocol
+ equality. For example, protocol 0 and IPPROTO_TCP is not problem
+ for TCP.
-Mon Dec 6 09:45:11 2010 Eric Hodel <drbrain@segment7.net>
+Mon Jan 9 20:08:52 2012 Tanaka Akira <akr@fsij.org>
- * ext/openssl (OpenSSL): add toplevel documentation
- * ext/openssl/ossl_ssl.c (SSLContext, SSLSocket: add additional
- documentation
- * ext/openssl: move "let rdoc know about mOSSL" comments so they don't
- show up in output
+ * ext/socket/lib/socket.rb (family_addrinfo): return the given
+ addrinfo object.
+ Patch by Ippei Obayashi. [ruby-dev:45095] [Bug #5845]
-Mon Dec 6 09:16:46 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Jan 9 19:40:20 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/uri/common.rb (URI::Parser#initialize_pattern):
- workaround fix pattern of hostname for RFC 3986. [ruby-dev:42672]
+ * test/zlib/test_zlib.rb (TestZlibGzipWriter#test_writer_wrap): set
+ binmode explicitly.
-Mon Dec 6 09:14:38 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Jan 9 14:42:41 2012 Narihiro Nakamura <authornari@gmail.com>
- * lib/mkmf.rb (check_signedness): rename unused variable prelude.
+ * gc.c: free_slots is changed Singly linked list. clear
+ free_slots before sweep.
-Sun Dec 5 17:56:36 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jan 9 07:46:17 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * class.c (make_metaclass): fix probable typo. builtin type flag
- cannot be used with FL_TEST.
+ * gc.c: i686-linux needs to define _XOPEN_SOURCE 600 for posix_memalign.
-Sun Dec 5 12:09:27 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jan 9 04:24:59 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/irb/init.rb (IRB.parse_opts): fix typo. [ruby-core:33574]
+ * gc.c (rb_objspace_free): global_List is allocated with xmalloc.
+ patched by Sokolov Yura. https://github.com/ruby/ruby/pull/78
-Sun Dec 5 11:27:08 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * dln_find.c: remove useless replacement of free.
- * ruby.c (load_file_internal): decrement for ungotten line.
- [ruby-dev:42680]
+ * ext/readline/readline.c (readline_attempted_completion_function):
+ strings for readline must allocated with malloc.
-Sun Dec 5 10:32:11 2010 Tanaka Akira <akr@fsij.org>
+ * process.c (run_exec_dup2): use free; see also r20950.
- * complex.c: parenthesize macro arguments.
+ * re.c (onig_new_with_source): use malloc for oniguruma.
-Sat Dec 4 11:39:17 2010 Eric Hodel <drbrain@segment7.net>
+ * vm.c (ruby_vm_destruct): use free for VMs.
- * ext/openssl/ossl_x509ext.c (initialize): add documentation.
+ * vm.c (thread_free): use free for threads.
-Sat Dec 4 11:21:50 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jan 9 04:24:59 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * hash.c (rb_hash_update_by): new API for Hash#update.
+ * dln_find.c: remove useless replacement of free.
-Sat Dec 4 11:18:10 2010 Tanaka Akira <akr@fsij.org>
+ * ext/readline/readline.c (filename_completion_proc_call):
+ matches should use xfree.
- * class.c: parenthesize macro arguments.
+ * ext/readline/readline.c (username_completion_proc_call): ditto.
-Sat Dec 4 11:07:57 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jan 9 01:12:35 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * vm_core.h (rb_vm_inc_const_missing_count): missing prototype.
+ * numeric.c (rb_enc_uint_char): raise RangeError when added codepoint
+ is invalid. [Feature #5855] [Bug #5863] [Bug #5864]
-Sat Dec 4 08:50:10 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * string.c (rb_str_concat): ditto.
- * ext/iconv/iconv.c (Init_iconv): no warnings if $VERBOSE is nil.
+ * string.c (rb_str_concat): set encoding as ASCII-8BIT when the string
+ is US-ASCII and the argument is an integer greater than 127.
-Sat Dec 4 08:25:15 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * regenc.c (onigenc_mb2_code_to_mbclen): rearrange error code.
- * vm_insnhelper.c (vm_call_method): revert r30064 and r30071,
- because of [ruby-core:26761]. Bug#4106 rejected.
+ * enc/euc_jp.c (code_to_mbclen): ditto.
-Sat Dec 4 07:46:48 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * enc/shift_jis.c (code_to_mbclen): ditto.
- * lib/mkmf.rb (String#tr_cpp): substitute * with P like as
- autoconf.
+Sun Jan 8 20:31:45 2012 Narihiro Nakamura <narihiro@netlab.jp>
-Fri Dec 3 22:36:45 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c : consider header bytes which are used by malloc.
- * vm_insnhelper.c (vm_call_method): protected methods should be
- checked against the real class.
+Sun Jan 8 11:54:43 2012 Narihiro Nakamura <authornari@gmail.com>
-Fri Dec 3 20:23:31 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (aligned_free): support MinGW. Patch by Hiroshi Shirosaki.
- * lib/mkmf.rb (convertible_int): define printf format prefix too.
+Sun Jan 8 11:43:05 2012 Narihiro Nakamura <authornari@gmail.com>
- * lib/mkmf.rb (convertible_int): detect convertible integer type.
- port RUBY_REPLACE_INT from configure.in.
+ * gc.c (slot_sweep): add a assertion instead of a debug print.
- * lib/mkmf.rb (check_sizeof): should return integer always.
+Sun Jan 8 01:18:19 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Fri Dec 3 12:54:48 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/-ext-/old_thread_select/test_old_thread_select.rb:
+ avoid platform bug. [Bug #5858] [ruby-dev:45108]
- * win32/Makefile.sub (RCFLAGS): VC10 and after only. fixed the problem
- of r30015. [ruby-core:33530]
+Sun Jan 8 00:46:34 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Fri Dec 3 12:41:52 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+ * gc.c: get rid of implicit narrowing conversion.
- * gc.c (rb_objspace_free): With our "lazy-sweep" GC engine, it is
- possible for an object to survive until its surrounding object
- space is about to be freed. Those objects, if any, remains
- leaked for the rest of a process life. This is problematic
- because for instance a T_DATA object may have its own destructor
- to terminate something.
+Sun Jan 8 00:10:10 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * vm.c (ruby_vm_destruct): ruby_current_vm termination should be
- somewhere after rb_objspace_free for above reason.
+ * configure.in: check posix_memalign(3) and memalign(3).
-Fri Dec 3 12:17:19 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (aligned_malloc): use configure's result instead of
+ _POSIX_C_SOURCE and _XOPEN_SOURCE because they can't be used
+ to check availability at least on FreeBSD.
- * vm_insnhelper.c (vm_call_method): protected singleton methods should
- be visible from same real class methods. [ruby-core:33506]
+Sat Jan 7 22:25:50 2012 Narihiro Nakamura <authornari@gmail.com>
-Fri Dec 3 07:08:42 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c: use Bitmap Marking algorithm to avoid copy-on-write of
+ memory pages. See [ruby-dev:45085] [Feature #5839]
+ [ruby-core:41916].
- * ext/stringio/stringio.c (strio_getline): round upto next char
- boundary. [ruby-dev:42674]
+ * include/ruby/ruby.h : FL_MARK rename to FL_RESERVED1.
-Fri Dec 3 06:52:46 2010 Tanaka Akira <akr@fsij.org>
+ * node.h : ditto.
- * compile.c: parenthesize macro arguments.
+ * debug.c : ditto.
-Fri Dec 3 04:08:59 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * object.c (rb_obj_clone): FL_MARK move to a bitmap.
- * encoding.c (enc_alias_internal): use st_insert2 and change return
- value to int.
+ * class.c (rb_singleton_class_clone): ditto.
- * encoding.c (enc_alias): follow enc_alias_internal.
+Sat Jan 7 00:47:07 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Fri Dec 3 01:52:43 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * configure.in: always define CANONICALIZATION_FOR_MATHN.
+ [ruby-dev:45100] [Bug #5852]
- * encoding.c (enc_alias_internal): use xfree instead of free.
+Fri Jan 6 23:11:20 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Thu Dec 2 23:52:26 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+ * include/ruby/version.h: RUBY_API_VERSION 2.0.0
- * NEWS: entry for ruby_vm_at_exit().
+Fri Jan 6 12:24:11 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * eval.c (ruby_cleanup): bug fix around at_exit (1) timing was
- wrong. (2) execution order was opposite.
+ * object.c (rb_inspect): raises Encoding::CompatibilityError if the
+ result is incompatible with the default external encoding.
+ [ruby-core:41931] [Bug #5848]
-Thu Dec 2 23:05:14 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Jan 5 15:26:15 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * win32/Makefile.sub (RCFLAGS): -nologo switch is only available in
- newer versions of rc.exe. fixed the problem of r30012.
+ * win32/win32.c (check_valid_dir): strict checking of root.
+ GetDriveType() succeeds with non root directory as the argument,
+ even if MSDN says that the API needs the root directory.
+ this patch fixes a failure of test/ruby/test_file_exhaustive.rb.
-Thu Dec 2 21:28:07 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Jan 5 12:15:55 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/json/lib/json/add/rails.rb: removed.
+ * file.c (rb_file_join): separator is appended by array length - 1
+ times. patched by Benoit Daloze [ruby-core:41901] [Bug #5841]
-Thu Dec 2 21:22:05 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Jan 5 11:47:54 2012 NARUSE, Yui <naruse@ruby-lang.org>
- * encoding.c (enc_alias_internal): free the copied key and
- return NULL when given key is already registered.
+ * lib/uri/common.rb (URI::Parser#initialize_regexp):
+ use \A \z instead of ^ $. [Bug #5843]
- * encoding.c (enc_alias): call set_encoding_const only when the
- alias is not registered yet.
+Wed Jan 4 17:55:53 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Thu Dec 2 19:58:24 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+ * array.c (rb_ary_sample): add example for Array#sample
+ based on patch from https://github.com/ruby/ruby/pull/74
- * vm.c (ruby_vm_at_exit): new API. This enables extension libs to
- hook a VM termination. Right now, because the VM we have is
- process global, most extensions do not deallocate resources and
- leave them to Operating System's reaping userland processes. But
- in a future we plan to have multiple VMs to run simultaneously in
- a single process (MVM project). At that stage we can no longer
- rely on OSes and have to manage every resources to be reclaimed
- properly. So it is. For a forward-compatibility reason this API
- is introduced now, encouraging you to be as gentle as you can for
- your resources; that is, tidy up your room.
+Wed Jan 4 14:24:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * include/ruby/vm.h: ditto.
+ * string.c (str_nth_len): count ascii-only run at the end. this
+ bug appears only when single-byte-optimization is disabled due
+ to unknown coderange. [ruby-core:41896] [Bug #5836]
- * vm_core.h (rb_vm_struct): new field.
+Wed Jan 4 11:32:07 2012 NAKAMURA Usaku <usa@ruby-lang.org>
- * vm.c (vm_init2): initialize above new field.
+ * win32/win32.c (check_valid_dir): special case for a root directory.
+ Reported by Masateru OKAMOTO at [Bug #5819].
- * eval.c (ruby_cleanup): trigger those hooks.
+Wed Jan 4 00:19:54 2012 Kouhei Sutou <kou@cozmixng.org>
-Thu Dec 2 17:00:44 2010 Tanaka Akira <akr@fsij.org>
+ * lib/rexml/parsers/baseparser.rb: use private instead of _xxx
+ method name. This is Ruby code not Python code.
+ refs #5696
- * bignum.c: parenthesize macro arguments.
+Tue Jan 3 23:57:37 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Thu Dec 2 15:31:14 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/rexml/parsers/baseparser.rb: rexml BaseParser uses
+ instance_eval unnecessarily on listener add.
+ patch from Charles Nutter. [Bug #5696] [ruby-core:41437]
- * win32/win32.c (rb_w32_read): more fix. [ruby-core:33513]
+Tue Jan 3 20:44:13 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Thu Dec 2 13:41:43 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * README: add comment for Git user. patch from Arun Agrawal.
+ * README.ja: ditto.
- * win32/win32.c (rb_w32_read): workaround for console reading troubles.
- fixed [ruby-core:33511]
+Tue Jan 3 15:58:22 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Thu Dec 2 13:10:42 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * thread.c: changed documentation for "thread-local" variables.
+ patch from Julien Ammous.
- * lib/uri/common.rb (URI.encode_www_form):
- split key-value when the value is Array like object.
+Tue Jan 3 15:50:12 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Thu Dec 2 10:39:39 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * process.c: Fix typo. patch from Aviv Ben-Yosef.
- * lib/net/http.rb (Net::HTTP#set_form_data):
- use URI.encode_www_form for application/x-www-form-urlencoded.
+Tue Jan 3 13:43:37 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Thu Dec 2 10:38:40 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * tool/merger.rb: allow r0123 style revision number.
- * ext/extmk.rb: remove $makeflags.defined?, it should be $mflags.
+Tue Jan 3 11:17:55 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Thu Dec 2 10:19:47 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * tool/merger.rb (#version_up): version.h date should be Japanese
+ locale date.
- * win32/Makefile.sub (rc): suppress meaningless message.
+Mon Jan 2 22:08:00 2012 Akinori MUSHA <knu@iDaemons.org>
-Thu Dec 2 10:09:40 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * tool/file2lastrev.rb (VCS::detect): Add support for Subversion
+ 1.7 which adopted a whole new working directory structure.
- * ext/json/generator/extconf.rb: remove the lines which set -O3
- when -O option is not set.
- Note that -O3 doesn't always exist.
+ * tool/file2lastrev.rb (VCS::detect): Simply use .each instead of
+ .sort.reverse_each which looks too arbitrary. If you want SVN
+ to be tried first, then you just have to register it first as it
+ is right now.
- * ext/json/parser/extconf.rb: ditto.
+Mon Jan 2 20:53:36 2012 Tanaka Akira <akr@fsij.org>
-Thu Dec 2 10:01:59 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/securerandom.rb (random_bytes): use IO#read instead of
+ IO#readpartial to make the intent more clear.
- * ext/extmk.rb: define $makeflags.defined? like $mflags.
+Mon Jan 2 15:26:39 2012 Kazuki Tsujimoto <kazuki@callcc.net>
-Thu Dec 2 07:20:20 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_object.rb (test_send_with_block): add a normal case.
- * lib/test/unit.rb (Test::Unit::GCStressOption): --gc-stress
- option.
+Mon Jan 2 15:18:54 2012 Kazuki Tsujimoto <kazuki@callcc.net>
- * lib/test/unit.rb (Test::Unit::Mini#_run_suites): show the result
- even when interrupted on the way.
+ * test/ruby/test_object.rb (test_send_with_block): moved from
+ bootstraptest/test_flow.rb.
-Thu Dec 2 07:08:38 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jan 2 15:10:11 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * ext/io/console/console.c (setattr): should retry on EINTR.
- [ruby-dev:42666]
+ * lib/test/unit/parallel.rb: use pack("m0") instead of
+ pack("m").gsub("\n","").
+ * lib/test/unit.rb (Test::Unit::Runner::Worker#run): ditto.
-Thu Dec 2 02:30:50 2010 Eric Hodel <drbrain@segment7.net>
+Mon Jan 2 15:05:09 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * lib/net/http.rb: fixed positional wording to match revised order.
+ * lib/test/unit.rb (Test::Unit::Runner::Worker#run): use
+ File.basename with suffix instead of gsub.
-Thu Dec 2 01:24:39 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Jan 2 14:55:28 2012 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * ext/json/lib/json/common.rb: don't use iconv on 1.9.
- patched by Shota Fukumori [ruby-core:33164]
+ * lib/test/unit.rb (Test::Unit::Runner#_run_parallel): find may
+ return nil and nil can not dup.
-Thu Dec 2 01:02:03 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Sun Jan 1 12:23:10 2012 Akinori MUSHA <knu@iDaemons.org>
- * ext/json: Update github/flori/json from 1.4.2+ to
- e22b2f2bdfe6a9b0. this fixes some bugs.
+ * lib/shellwords.rb (Shellwords#shellescape): Drop the //n flag
+ that only causes warnings with no real effect. [Bug #5637]
-Thu Dec 2 00:05:44 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Sat Dec 31 06:28:37 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/net/http.rb: improve rdoc.
- This change the order of chapter because such overview should
- begin with simple examples.
- patched by Eric Hodel [ruby-core:33469]
+ * thread.c (rb_barrier_waiting): save the number of waiting threads
+ in RBASIC()->flags. [ruby-dev:45002] [Bug #5768]
-Wed Dec 1 22:01:49 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * thread.c (rb_barrier_wait): increment and decrement around
+ rb_mutex_lock, and use rb_barrier_waiting().
- * numeric.c (Init_Numeric): fixed a potential bug when using bccwin32
- ruby with Microsoft's dll, though we already gave up of supporting
- bccwin32. [ruby-core:33503]
+ * thread.c (rb_barrier_release): use rb_barrier_waiting().
-Wed Dec 1 21:43:21 2010 Tanaka Akira <akr@fsij.org>
+ * thread.c (rb_barrier_destroy): ditto.
- * array.c: parenthesize macro arguments.
+Mon Dec 26 17:20:10 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Dec 1 21:41:57 2010 Tanaka Akira <akr@fsij.org>
+ * vm.c (vm_exec): add guard to prevent optimization for LLVM clang.
- * test/socket/test_addrinfo.rb: extract Errno::EADDRINUSE as a method.
+Fri Dec 30 17:01:12 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * test/socket/test_socket.rb: ditto.
+ * vm_eval.c (rb_f_send): fix obj.send() documentation issue.
+ [Bug #5125] [ruby-core:38633]
-Wed Dec 1 15:08:32 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Dec 29 22:36:16 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * test/openssl/test_ssl.rb (test_not_started_session): non socket
- argument of SSLSocket.new is not supported on Windows.
+ * lib/test/unit.rb (Test::Unit::Runner::Worker#_run_parallels): fix
+ premature exit when all workers' status are :ready or :prepare.
+ [ruby-dev:45061] [Bug #5822]
-Wed Dec 1 14:36:36 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 29 01:51:13 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * string.c (rb_memhash): zero-filled strings should return
- different values. [ruby-core:33500]
+ * include/ruby/ruby.h: fix #error pragma. LLP64 platform is supported.
-Wed Dec 1 14:27:49 2010 Ryan Davis <ryand-ruby@zenspider.com>
+ * include/ruby/st.h: ditto.
- * lib/minitest/*.rb: Imported minitest 2.0.0 r5952.
- * test/minitest/*.rb: ditto.
- * lib/test/unit.rb: Compatibility fix for minitest changes.
+Wed Dec 28 11:22:45 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Dec 1 10:16:41 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/fileutils.rb (FileUtils::Entry_#entries): use utility method
+ instead of typoed regexp. [ruby-core:41829] [Bug #5817]
- * string.c (rb_str_inspect): fix typo (not 0xFD but 0xFE).
+Wed Dec 28 02:08:04 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Wed Dec 1 09:28:27 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * vm_insnhelper.c (unknown_keyword_error): add GC guard to prevent
+ intermediate object from GC.
- * addr2line.c: Follow .gnu_debuglink section.
- A user of distribution provided ruby will see line
- info if s/he has a debug package for ruby.
- patched by Shinichiro Hamaji [ruby-dev:42655]
+Tue Dec 27 22:34:54 2011 Shota Fukumori <sorah@tubusu.net>
-Wed Dec 1 01:29:15 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/test/unit.rb (Worker#close): "closing IO if IO is closed"
+ should be "closing IO if IO isn't closed"
- * string.c (rb_str_inspect): inspect as a dummy encoding string
- when a UTF-16/32 (not BE/LE) string does not have a BOM.
- Unicode and some RFCs say that a string labeled as UTF-16/32
- doesn't have a BOM, it should be considered big endian.
- But many Windows programs generates little endian UTF-16
- strings without a BOM. So String#inspect treats a string
- labeled UTF-16/32 without a BOM as a dummy encoding string.
- patched by Martin Duerst. [ruby-core:33461]
+Tue Dec 27 22:04:27 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Nov 30 17:04:10 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * st.c (st_update): new function to lookup the given key and
+ update the value. [ruby-dev:44998]
- * addr2line.c (parse_debug_line_cu): ignore DW_LNE_set_discriminator.
- To ignore, it needs to read a single unsigned LEB128 integer.
+Tue Dec 27 21:17:33 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Nov 30 16:29:19 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * node.h (rb_args_info): change pre_args_num and post_args_num as
+ int, to match with rb_iseq_t.
- * vm_dump.c: undef HAVE_BACKTRACE when the OS is FreeBSD (in other
- words backtrace() is libexecinfo) and it is optimized.
- This temporary hack may be also applied to other libexecinfo
- environments.
+ * parse.y (new_args_gen): check overflow.
-Tue Nov 30 16:23:23 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Dec 26 22:38:35 2011 Yusuke Endoh <mame@tsg.ne.jp>
- * lib/net/http.rb: improve rdoc.
- patched by Eric Hodel ref #4100
+ * vm_insnhelper.c (unknown_keyword_error): make it kind a error
+ message when unknown keyword is given. It require more work.
+ See [ruby-core:40518] and [ruby-core:40541] in detail.
-Tue Nov 30 12:23:52 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Dec 26 22:31:07 2011 Yusuke Endoh <mame@tsg.ne.jp>
- * win32/win32.c (rb_w32_read): read only 1 byte at once on console.
- workaround of Windows bug. see [ruby-core:33460].
- this is not the final solution.
+ * vm_core.h (struct rb_iseq_struct), compile.c (iseq_set_arguments),
+ iseq.c (rb_iseq_parameters), vm_insnhelper.c
+ (vm_callee_setup_arg_complex): support Method#parameters for keyword
+ arguments. The provisional spec is what Benoit Daloze proposed.
+ [ruby-core:40541]
-Tue Nov 30 11:39:13 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/ruby/test_keyword.rb: add a test for above.
- * lib/net/http.rb: improve rdoc.
- patched by mathew murphy [ruby-core:33472] ref #4100
+Mon Dec 26 22:15:27 2011 Yusuke Endoh <mame@tsg.ne.jp>
-Tue Nov 30 05:03:44 2010 Eric Hodel <drbrain@segment7.net>
+ * vm_core.h (struct rb_iseq_struct), compile.c (iseq_set_arguments,
+ iseq_compile_each), vm_insnhelper.c (vm_callee_setup_arg_complex):
+ implement keyword arguments. See [ruby-core:40290]
+ The feature is promised to be included in 2.0, but the detail spec
+ is still under discussion; this commit is a springboard for further
+ discussion. Please try it and give us feedback.
+ This commit includes fixes for some problems reported by Benoit
+ Daloze <eregontp AT gmail.com> [ruby-core:40518] and Marc-Andre
+ Lafortune <ruby-core-mailing-list AT marc-andre.ca>
+ [ruby-core:41772].
- * lib/uri/common.rb (encode_www_form, encode_www_form_component):
- Improve English in documentation.
+ * iseq.c (iseq_free, prepare_iseq_build): bookkeeping.
- * ext/openssl/ossl_ssl.c (ssl_version=, ciphers=): Document
- #ssl_version=, add documentation for #ciphers=.
+ * test/ruby/test_keyword.rb: add tests for keyword arguments.
-Mon Nov 29 22:55:24 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ripper/dummyparser.rb (class DummyParser): temporal fix for
+ ripper test.
- * lib/uri/common.rb (URI::WFKV_): get rid of backtrack explosion
- by nested repeat operators. [ruby-core:33464]
+Mon Dec 26 22:00:17 2011 Yusuke Endoh <mame@tsg.ne.jp>
-Mon Nov 29 22:53:13 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * node.h, node.c, parse.y: implement a parser part for keyword
+ arguments.
+ This is a preparation for keyword argument (see [ruby-core:40290]).
- * win32/Makefile.sub (scriptbin.mk): fix generated rules.
+ * gc.c (gc_mark_children): bookkeeping.
- * win32/win32.c (rb_w32_write_console): fix argument type.
+Mon Dec 26 21:03:18 2011 Yusuke Endoh <mame@tsg.ne.jp>
-Mon Nov 29 21:12:51 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * node.h, parse.y (new_args_gen), compile.c (iseq_set_arguments): use
+ struct rb_args_info instead of NODEs.
+ This is a preparation for keyword argument (see [ruby-core:40290]).
- * misc/ruby-mode.el (ruby-forward-sexp): stop after literal hash
- key labels.
+ * node.c (dump_node), gc.c (gc_mark_children, obj_free): bookkeeping.
- * misc/ruby-mode.el (ruby-font-lock-keywords): highlight literal
- hash key labels as symbols.
+Mon Dec 26 20:59:51 2011 Yusuke Endoh <mame@tsg.ne.jp>
-Mon Nov 29 18:31:31 2010 Martin Duerst <duerst@it.aoyama.ac.jp>
+ * node.h, parse.y (lambda, f_larglist): remove NEW_LAMBDA hack.
+ This is a preparation for keyword argument (see [ruby-core:40290]).
- * test/ruby/test_transcode.rb (test_unicode_public_review_issue_121):
- - Removed commented-out options that are no longer under discussion.
- - Added two more tests for forthcomming clarifications.
+Mon Dec 26 22:01:19 2011 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-Mon Nov 29 14:31:17 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * io.c (rb_sys_fail_path): move the definition.
+ Move above for using it in set_binary_mode_with_seek_cur().
- * win32/win32.c (rb_w32_isatty): use GetConsoleMode() to determine the
- fd is console or not, just like rb_w32_write_console(). [experimental]
+ * io.c (set_binary_mode_with_seek_cur): fix improper seek cursor.
+ Seeking file cursor with setting binary mode has possibility to
+ cause infinite loop. Fixed the bug and refined error handling.
+ Introduced at r34043.
-Mon Nov 29 14:19:40 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ And cleanups as below.
+ Remove unnecessary parentheses of `fptr`.
+ Use return value of setmode().
- * include/ruby/win32.h (rb_w32_write_console): wrong prototype.
+ * test/ruby/test_io_m17n.rb
+ (TestIO_M17N#test_seek_with_setting_binmode): add a test for above.
+ [ruby-core:41671] [Bug #5714]
-Mon Nov 29 14:10:55 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Dec 26 17:01:14 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (rb_w32_write_console): fixed indentation.
+ * common.mk (LIBRUBY_A): depends on main.o since r33774.
+ [ruby-core:41786] [Bug #5796]
-Sun Nov 28 22:13:39 2010 Koichi Sasada <ko1@atdot.net>
+Mon Dec 26 13:07:08 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * thread_pthread.c (NATIVE_MUTEX_LOCK_DEBUG): move and use it.
+ * test/ruby/test_io.rb (TestIO#test_autoclose): Tempfile.new doesn't
+ accept the block argument.
- * ChangeLog: fix my timezone.
+Mon Dec 26 13:06:52 2011 Shota Fukumori <sorah@tubusu.net>
-Mon Nov 28 21:58:58 2010 Koichi Sasada <ko1@atdot.net>
+ * lib/test/unit.rb: Avoid zombie processes on "--separate" option
+ added at r34121.
- * thread_pthread.c: remove pthread_atfork().
+Mon Dec 26 04:01:23 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Mon Nov 28 21:54:22 2010 Koichi Sasada <ko1@atdot.net>
+ * ext/openssl/ossl_cipher.c: Update and complete documentation.
- * thread_pthread.c (native_cond_*): Check return code.
- (Some OSes except Linux return error code).
+Sun Dec 25 23:16:11 2011 Shota Fukumori <sorah@tubusu.net>
-Sun Nov 28 21:46:21 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/testunit/test_parallel.rb (test_separate): Test for "--separate"
+ option (r34121)
- * thread_pthread.c (thread_start_func_1): initialize native thread
- data immediately before starting.
+Sun Dec 25 22:39:49 2011 Shota Fukumori <sorah@tubusu.net>
-Sun Nov 28 14:56:32 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/test/unit.rb (_run_parallel):
+ New option "--separate" for test/unit; when running tests with this
+ option, a job process will be restarted after one test file has done.
+ This means all test files will run with separated process.
- * io.c (struct argf): make lineno long, and reorder members.
+ * lib/test/unit/parallel.rb: Fix for above. Now parallel.rb puts
+ "ready!" for first ready, "ready" for afters.
-Sun Nov 28 14:55:42 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Dec 25 00:02:15 2011 Luis Lavena <luislavena@gmail.com>
- * thread_win32.c (gvl_release, gvl_init): suppress warnings.
+ * configure.in: change --with-ntver to --with-winnt-ver to be more
+ descriptive in the context. [ruby-core:41794]
-Sun Nov 28 14:48:24 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Dec 24 23:25:15 2011 Luis Lavena <luislavena@gmail.com>
- * thread_pthread.c (gvl_release, gvl_init): suppress warnings.
+ * configure.in: add --with-ntver option to match win32/configure.bat
+ functionality. Set 0x0501 as default. [ruby-core:35010]
+ [ruby-core:35035]
- * vm_core.h (rb_vm_gvl_destroy): add prototype.
+Sat Dec 24 12:38:53 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Nov 28 14:46:24 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * proc.c (proc_call): get rid of optimization-out by clang.
- * thread_pthread.c (gvl_reinit): register atfork handler only in
- the parent process, to get rid of dead lock.
+ * proc.c (rb_proc_call, rb_proc_call_with_block): ditto.
-Sun Nov 28 12:23:57 2010 Koichi Sasada <ko1@atdot.net>
+Sat Dec 24 10:56:32 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * thread.c, vm_core.h: make gvl_acquire/release/init/destruct
- APIs to modularize GVL implementation.
+ * ext/readline/readline.c (readline_readline): check if outstream
+ is closed to get rid of a bug of readline 6. [ruby-dev:45043]
+ [Bug #5803]
- * thread_pthread.c, thread_pthread.h: Two GVL implementations.
- (1) Simple locking GVL which is same as existing GVL.
- (2) Wake-up queued threads. The wake-up order is simple FIFO.
- (We can make several queues to support exact priorities, however
- this causes some issues such as priority inversion and so on.)
- This impl. prevents spin-loop (*1) caused on SMP environments.
- *1: Only one Ruby thread acquires GVL again and again.
- Bug #2359 [ruby-core:26694]
+Sat Dec 24 06:59:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * thread_win32.c, thread_win32.h: Using simple lock
- not by CRITICAL_SECTION but by Mutex.
- Bug #3890 [ruby-dev:42315]
+ * test/readline/test_readline.rb (test_line_buffer__point): use
+ lambda not to exit entire method by "return". or "next" for
+ proc. [ruby-dev:45042] [Bug #5802]
- * vm.c (ruby_vm_destruct): ditto.
+Sat Dec 24 01:20:39 2011 Kazuki Tsujimoto <kazuki@callcc.net>
-Sun Nov 28 04:40:00 2010 Luis Lavena <luislavena@gmail.com>
+ * vm_eval.c (send_internal): PASS_PASSED_BLOCK_TH must be placed
+ just before calling rb_call0.
- * io.c (io_fwrite): use rb_w32_write_console under Windows.
+ * bootstraptest/test_flow.rb: add a test for above.
- * win32/win32.c (rb_w32_write_console): added to write to write
- Unicode using WriteConsoleW for stdout/stderr. [ruby-core:33166]
+Sat Dec 24 00:55:16 2011 Tanaka Akira <akr@fsij.org>
-Sun Nov 28 03:58:47 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/tempfile.rb (Tempfile#initialize): warn if a block is given.
- * lib/net/http.rb: improve rdoc.
- patched by Mike Perham [ruby-core:33433]
+Fri Dec 23 16:14:30 2011 TAKAO Kouji <kouji@takao7.net>
-Sat Nov 27 19:12:10 2010 Tanaka Akira <akr@fsij.org>
+ * ext/readline/readline.c (readline_attempted_completion_function):
+ in Readline module with GNU Readline 6 case, Readline module
+ resets completion_append_character to " ", after it executes
+ completion. So, Readline module stores
+ completion_append_character, and Readline module always sets it
+ after Readline module executes completion. [ruby-dev:43456]
+ [Feature #4635]
- * time.c: parenthesize macro arguments.
+Fri Dec 23 15:59:05 2011 TAKAO Kouji <kouji@takao7.net>
-Sat Nov 27 18:08:18 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/readline/readline.c (Init_readline): libedit check
+ rl_getc_function only when rl_initialize() is called, and
+ using_history() call rl_initialize(). This assignment should be
+ placed before using_history(). [ruby-core:40641] [Bug #5539]
- * time.c (leap_year_v_p): fixed typo. [ruby-dev:42631]
+Fri Dec 23 10:14:47 2011 Tanaka Akira <akr@fsij.org>
-Sat Nov 27 17:57:08 2010 Tanaka Akira <akr@fsij.org>
+ * test/thread/test_queue.rb (test_thr_kill): show the number of loop
+ run when the test failed.
- * resolv.rb (Resolv::DNS): use the same DNS server when retry using
- TCP. reported by Julian Mehnle. [ruby-core:32970]
+Fri Dec 23 09:23:48 2011 Tanaka Akira <akr@fsij.org>
-Sat Nov 27 15:45:27 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/test_pty.rb (test_pty_check_default): call PTY.check until
+ "cat" command is finished.
- * vm_dump.c (rb_vm_bugreport): see CrashReport log on Mac OS X.
+Fri Dec 23 06:03:00 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * configure.in: link addr2line only for ELF.
+ * common.mk: add "check succeeded" message.
-Sat Nov 27 13:58:55 2010 Shugo Maeda <shugo@ruby-lang.org>
+ * README, README.ja: follow above change.
- * lib/optparse.rb (OptionParser#candidate): : was missing. Thanks,
- Shota Fukumori. [ruby-dev:42634]
+Fri Dec 23 06:00:39 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Sat Nov 27 12:07:05 2010 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * ext/bigdecimal/bigdecimal.h: add satisfy cc-mode comment.
+ * util.c: ditto.
- * man/ruby.1: Ruby man page from Arthur Gunn in [ruby-core:33412]
+Fri Dec 23 00:08:25 2011 Tanaka Akira <akr@fsij.org>
-Sat Nov 27 11:29:24 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/test_pty.rb (test_pty_check_default): "cat" may not terminated
+ in the 0.1 second.
- * lib/optparse.rb (OptionParser#candidate): get rid of 1.9 syntax
- so that BASERUBY can be 1.8.
+Thu Dec 22 23:37:25 2011 Tanaka Akira <akr@fsij.org>
-Sat Nov 27 08:16:21 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_thread.rb (test_condvar_timed_wait): don't test the
+ maximum sleep time. Ruby is not a real-time system.
- * addr2line.c (rb_dump_backtrace_with_lines): should close fd on
- edge case.
+Thu Dec 22 22:37:45 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Fri Nov 26 13:33:24 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * thread_pthread.c (ping_signal_thread_list): remove return value.
+ * thread_pthread.c (check_signal_thread_list): add a new function to
+ check if signal thread list is empty.
+ * thread_pthread.c (thread_timer): check signal thread list after
+ timer_thread_function(). main thread might be added into signal thread
+ list during timer_thread_function().
- * addr2line.c: apply a patch from shinichiro.h.
+Thu Dec 22 00:40:24 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Fri Nov 26 12:21:20 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/bigdecimal/bigdecimal.c (VpMult, VpCtoV, VpSqrt): remove assigned
+ but unused variables.
- * addr2line.c: added to show source filename and line number of
- functions in backtrace. [ruby-dev:42625]
- a patch from shinichiro.h <shinichiro.hamaji AT gmail.com>
+Wed Dec 21 18:28:22 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * addr2line.h: ditto.
+ * common.mk (newline.c, miniprelude.c): revert r33949 because the change
+ broke mswin build, and the changer said no reason about the change.
+ [ruby-dev:45016] [Bug #5783]
- * common.mk: add addr2line.$(OBJEXT).
+Wed Dec 21 12:35:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in: check dl_iterate_phdr.
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_s_allocate): follow
+ Allocation Framework. [Bug #5775]
- * vm_dump.c (rb_vm_bugreport): use rb_dump_backtrace_with_lines in
- addr2line.c when the binary is ELF.
+Wed Dec 21 02:25:36 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Fri Nov 26 12:12:50 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/psych/emitter.c: fixing clang warnings. Thanks Joey!
- * regcomp.c (setup_tree): restart setup_tree() for a node whose
- AnchorNode's type is ANCHOR_PREC_BEHIND or ANCHOR_PREC_BEHIND_NOT
- and divide_look_behind_alternatives() divided it to NT_ALT or
- NT_LIST. [ruby-core:33370]
+Wed Dec 21 01:06:00 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Fri Nov 26 11:40:11 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/bigdecimal/README: Update redmine.ruby-lang.org to bugs.ruby-lang.org
+ * ext/socket/ancdata.c: ditto
+ * test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb: ditto
+ * test/syck/test_yaml.rb: ditto
+ * doc/ChangeLog-1.9.3: ditto
- * vm_dump.c (dump_thread): get only required rights of the target
- thread because THREAD_ALL_ACCESS causes an access error on XP.
- reported by Masaya TARUI via IRC.
+Tue Dec 20 23:50:12 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
-Fri Nov 26 11:09:07 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * PStore content update perf optimization. Patch by Masaki Matsushita.
+ See #5248.
- * vm_dump.c (dump_thread): show the displacement from the beginning
- of the symbol.
+ * lib/pstore.rb (save_data):
-Fri Nov 26 10:48:23 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * Delete inadequate Marshal check.
- * vm_dump.c (dump_thread): follow the output of glibc.
- see [ruby-dev:42627]
+ * Deferred file truncation: when writing the new content, truncate
+ the saved file to the data size after writing the data, instead of
+ truncating whole bytes before writing data.
-Fri Nov 26 09:48:45 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * Deferred MD5 calculation: when comparing MD5 hash to check the
+ content modification, calculate MD5 hash of new data iif the
+ content length is differ from the old one.
- * re.c (rb_reg_initialize_str): should succeed the taint status from
- the origin. [ruby-core:33338]
+ * Compare content size with String#bytesize instead of String#size.
-Fri Nov 26 09:32:37 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Dec 20 21:00:30 2011 Tadayoshi Funaba <tadf@dotrb.org>
- * vm_dump.c (dump_thread): seems to be necessary the 3rd argument of
- SymGetLineFromAddr64(), even though MSDN says it can be zero.
+ * ext/date/date_core.c: uses to_integer instead.
+ * test/date/test_switch_hitter.rb: added a test.
-Fri Nov 26 09:03:38 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Tue Dec 20 15:04:18 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
- * regcomp.c (onig_is_prelude): added to check whether ruby is still
- in prelude (or other boot processes) or not.
+ * Make sure to clear $! when ignoring an exception
- * regcomp.c (optimize_node_left): use onig_is_prelude for printing.
+ * ext/openssl/ossl.c (ossl_pem_passwd_cb0, ossl_verify_cb):
+ pem_passwd_cb and verify_cb ignores the exception raised in a
+ callback proc so it should clear $! for subsequent execution.
- * regcomp.c (set_optimize_info_from_tree): ditto.
+ That's said, both subsequent processes for pem_passwd_cb and
+ verify_cb raises another exception before leaking $! to Ruby world.
+ We cannot test this fix in Ruby land.
- * regcomp.c (onig_compile): ditto.
+ * test/openssl/test_pkey_rsa.rb
+ (test_read_private_key_pem_pw_exception): Test for pem_passwd_cb +
+ exception.
- * regcomp.c (print_compiled_byte_code_list): print its address.
+Tue Dec 20 11:49:13 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * regcomp.c (print_indent_tree): print its contents tree of
- ANCHOR_PREC_READ(_NOT) and ANCHOR_PREC_BEHIND(_NOT).
+ * test/date/test_date_base.rb (test_jd): tests for
+ [ruby-dev:45008].
-Thu Nov 25 23:10:49 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Tue Dec 20 10:20:48 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * regcomp.c (print_distance_range): use PRIuSIZE.
+ * ext/date/date_core.c (wholenum): fix the type of the return value.
- * regcomp.c (print_optimize_info): use %ld because the type of
- calculated value of integers is long.
+Tue Dec 20 05:03:24 2011 Eric Hodel <drbrain@segment7.net>
- * regexec.c (onig_print_compiled_byte_code): add prototype.
+ * README.ja: Update redmine.ruby-lang.org to bugs.ruby-lang.org
+ * README: ditto
+ * common.mk: ditto
+ * man/erb.1: ditto
+ * man/irb.1: ditto
+ * man/ri.1: ditto
+ * man/ruby.1: ditto
+ * sparc.c: ditto
+ * tool/install-sh: ditto
- * regexec.c (match_at): add 2nd argument.
+Tue Dec 20 02:15:18 2011 Tadayoshi Funaba <tadf@dotrb.org>
-Thu Nov 25 10:29:55 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/date/date_core.c: [ruby-dev:45008].
- * ext/dl/callback/mkcallback.rb (gencallback): shouldn't assume that
- VALUE is the same size with long.
+Sun Dec 18 18:52:37 2011 Naohisa Goto <ngotogenome@gmail.com>
-Thu Nov 25 10:03:14 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * vm.c (vm_define_method): improve guard of iseq from GC. Fix
+ failure or segmentation fault in test_singleton_method(TestGc)
+ on sparc Solaris10 compiled with Oracle Solaris Studio 12.2.
+ [Bug #5762] [ruby-dev:45000] [Bug #4178]
- * test/win32ole/test_err_in_callback.rb (teardown): remove tmp file
- only when it exists.
+Sun Dec 18 14:34:31 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Nov 25 01:38:25 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/bigdecimal/bigdecimal.c (Init_bigdecimal): does not follow
+ allocation framework right now. [ruby-core:41710] [Bug #5773]
- * enc/trans/big5-hkscs-tbl.rb: Update table as HKSCS-2008.
- patched by oCameLo oTnTh [ruby-core:33256]
+Sun Dec 18 12:42:48 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * enc/big5.c: add alias Big5-HKSCS:2008 to Big5-HKSCS.
+ * ext/psych/lib/psych/visitors/to_ruby.rb: BigDecimals can be restored
+ from YAML.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: BigDecimals can be dumped
+ to YAML.
+ * test/psych/test_numeric.rb: tests for BigDecimal serialization
-Wed Nov 24 15:18:07 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+Sun Dec 18 12:03:13 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * vsnprintf (BSD_vfprintf): use QUADINT macro only when _HAVE_SANE_QUAD_
- macro is defined.
+ * ext/psych/lib/psych/scalar_scanner.rb: Strings that look like dates
+ should be treated as strings and not dates.
-Wed Nov 24 12:47:16 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/psych/test_scalar_scanner.rb: corresponding tests.
- * vsnprintf (BSD_vfprintf): added VC++ compatible size specifications
- (I, I32, I64).
+Sun Dec 18 09:43:21 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Wed Nov 24 11:19:13 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/thread/test_queue.rb (test_thr_kill): extend timeout.
+ this test takes a long time at slow machine.
- * string.c (rb_str_inspect): treat UTF-16 and UTF-32 as BE or LE.
+Sun Dec 18 09:36:51 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Wed Nov 24 06:35:32 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/ruby/envutil.rb (invoke_ruby): remove :timeout option before
+ pass it to Kernel#spawn.
- * enc/trans/utf_16_32.trans: add the UTF-32 converter.
+Fri Dec 16 17:18:38 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Nov 24 05:40:33 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * README, README.ja: 'make check' is preferable to 'make test'.
-Wed Nov 24 06:13:32 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 15 23:16:13 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * win32/win32.c (filecp, wstr_to_mbstr, mbstr_to_wstr):
- refactored.
+ * error.c (builtin_type_name): don't return pointer to the buffer of
+ temporary String object.
-Wed Nov 24 05:40:33 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Dec 15 17:56:58 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * enc/trans/utf_16_32.trans: add a converter from UTF-8 to UTF-16.
+ * io.c (argf_type): make typed data.
-Wed Nov 24 03:21:35 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Dec 15 17:40:28 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * enc/trans/utf_16_32.trans: raise error on unpaired upper
- surrogates.
+ * error.c (rb_check_type): fix typo.
-Wed Nov 24 01:40:23 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Dec 15 14:48:35 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * enc/utf_16_32.h: add UTF-16 and UTF-32 as a dummy encoding.
+ * ext/strscan/strscan.c: use typed data with
+ onig_region_memsize().
- * enc/trans/utf_16_32.trans: add a converter from UTF-16 to UTF-8.
+Thu Dec 15 14:33:33 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Nov 23 21:59:47 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * error.c (rb_check_typeddata): refine error message with
+ including expected struct name.
- * win32/win32.c (wlink, rb_w32_getppid): use typedef instead of
- repeating complicated function prototypes.
+Thu Dec 15 13:15:51 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Nov 23 18:54:03 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * regcomp.c (onig_region_memsize): implemented for memsize_of().
- * vm.c (rb_thread_mark): should mark self in control
- frames. [ruby-core:33289]
+ * ext/objspace/objspace.c (memsize_of): use it.
-Tue Nov 23 07:57:31 2010 Tadayoshi Funaba <tadf@dotrb.org>
+Thu Dec 15 10:44:54 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/date/delta/parser.{ry,rb}: fixed a bug of token scanner.
+ * array.c (rb_ary_reject_bang, rb_ary_delete_if): update rdoc.
+ documentation from Thomas Leitner <t_leitner AT gmx.at> in
+ [ruby-core:41616]. [Bug #5752]
-Tue Nov 23 07:29:24 2010 Tadayoshi Funaba <tadf@dotrb.org>
+Thu Dec 15 10:10:43 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * complex.c, rational.c ({nucomp,nurat}_expt): added a check.
+ * test/ruby/test_require.rb (test_race_exception): get rid of
+ not-guaranteed timing issue. [ruby-core:41655] [Bug #5754]
-Tue Nov 23 07:27:27 2010 Tadayoshi Funaba <tadf@dotrb.org>
+Wed Dec 14 21:58:42 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/date.rb (daynum): should be private.
+ * test/ruby/test_io_m17n.rb
+ (TestIO_M17N#test_{read_with_binmode_and_get[cs]}): only for Windows.
-Tue Nov 23 07:22:54 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Dec 14 19:57:23 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ChangeLog (change-log-indent-text): hanging indent.
+ * common.mk,Makefile.in,win32/Makefile.sub (ECHO1): move platform
+ specific hack from common.mk to Makefile.in (and win32/Makefile.sub).
+ [Bug #5711]
-Tue Nov 23 06:30:51 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/mkmf.rb: we can generate Makefile as we like.
- * configure.in (SITE_DIR, VENDOR_DIR),
- version.c (ruby_initial_load_paths): exclude directories that
- are configured without them from $LOAD_PATH. [ruby-core:33267]
+Wed Dec 14 19:22:33 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * configure.in (rubylibprefix): No ruby, No libprefix.
+ * win32/win32.c, include/ruby/win32.h (rb_w32_fd_is_text): new function.
-Tue Nov 23 01:05:27 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * win32/win32.c (init_stdhandle): set default mode of stdin as binmode.
- * vsnprintf.c (BSD_vfprintf): don't output floating point
- when the precision is 0. [ruby-dev:42615]
+ * io.c (set_binary_mode_with_seek_cur): new function to replace
+ SET_BINARY_MODE_WITH_SEEK_CUR macro. now returns previous mode of the
+ fd and take care of LF in rbuf.
-Mon Nov 22 21:30:57 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (do_writeconv): set text mode when needed.
- * string.c (rb_str_inspect): fix for ascii-compatible external
- encoding and different encoding string. [ruby-core:33283]
+ * io.c (io_read): need to change the mode of the IO to binmode
+ temporally when the length for IO#read, because IO#read with length
+ must behave so.
-Mon Nov 22 18:45:44 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_io_m17n.rb (TestIO_M17N#test_{read_with_length,
+ read_with_length_binmode,get[cs]_and_read_with_binmode,
+ read_with_binmode_and_get[cs],read_write_with_binmode}): tests for
+ above changes.
- * lib/mkmf.rb (create_makefile): should not duplicate rules.
- bug fix of r29842.
+ all patches are written by Hiroshi Shirosaki. [ruby-core:41496]
+ [Feature #5714]
-Mon Nov 22 18:04:40 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Wed Dec 14 15:28:31 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * enc/big5.c: split CP950 from Big5.
+ * transcode.c (str_encode): about the extension of :fallback
+ option since 1.9.3.
- * enc/big5.c: split CP951 from Big5-HKSCS.
+Wed Dec 14 12:19:59 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * enc/trans/big5.trans: import conversion table of Big5, Big5-HKSCS,
- CP950, and CP951 from ICU. they need fallback conversions.
- ref [ruby-core:33256]
- http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/
+ * load.c (load_unlock): release loading barrier and then remove it
+ from loading_table if it is not in-use. [Bug #5754]
- * tool/transcode-tblgen.rb (import_ucm): add to import ucm files.
+ * thread.c (rb_barrier_release, rb_barrier_destroy): return
+ whether any other threads are waiting on it.
-Mon Nov 22 18:33:30 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Dec 14 11:23:45 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * string.c (rb_str_inspect): append for each chars instead of bulk
- copy if encoding conversion is needed. [ruby-core:33283]
+ * thread_pthread.c (ubf_select): call rb_thread_wakeup_timer_thread()
+ only when it is not timer_thread. [Bug #5757] [ruby-dev:44985]
+ patched by Tomoyuki Chikanaga.
-Mon Nov 22 14:22:45 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Wed Dec 14 10:20:08 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * time.c (time_zone): use rb_locale_str_new_cstr to set encoding
- as locale and convert its content to internal encoding.
- [ruby-core:33278]
+ * load.c (load_lock): delete the loading barrier if it has been
+ destroyed.
-Mon Nov 22 11:58:11 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * thread.c (rb_barrier_wait): return nil for recursive lock
+ instead of false, to distinguish it from destroyed barrier.
- * string.c (rb_str_concat): set ENC_CODERANGE_VALID when the
- receiver is 7BIT and the argument is non ASCII.
+Wed Dec 14 01:24:55 2011 okkez <okkez000@gmail.com>
-Mon Nov 22 01:48:58 2010 Tadayoshi Funaba <tadf@dotrb.org>
+ * thread_pthread.c (rb_thread_create_timer_thread): fix memory
+ leak. [ruby-dev:44904] [Bug #5688]
- * lib/date.rb: some improvements for performance.
+Wed Dec 14 00:01:15 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Nov 20 07:45:50 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+ * parse.y (primary): point method name line. [ruby-core:40936]
+ [Bug #5614]
- * lib/mkmf.rb: adding compilation support for ObjC/ObjC++ extensions.
- Thanks Scott Gonyea! [ruby-core:33260]
+Tue Dec 13 23:43:48 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Sat Nov 20 01:57:55 2010 Akio Tajima <artonx@yahoo.co.jp>
+ * error.c (name_err_mesg_to_str): clear rb_thread_t::errinfo when
+ ignore exception under rb_protect(). [ruby-core:41612] [Bug #5755]
- * common.mk: add dependency(insns.inc) to compile.obj
+ * test/ruby/test_exception.rb (test_exception_in_name_error_to_str):
+ add a corresponding test.
-Fri Nov 19 23:05:48 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 13 16:13:29 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/Makefile.sub (insns_rules.mk): remove extra backslash.
+ * load.c (load_unlock): all threads requiring one file should
+ share same loading barrier, so it must be kept alive while those
+ are waiting on it. [ruby-core:41618] [Bug #5754]
- * cygwin/GNUmakefile.in, win32/Makefile.sub (clean): rc files are
- made at compile time, so should be removed by clean.
+Tue Dec 13 07:30:14 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Fri Nov 19 22:09:46 2010 Kouhei Sutou <kou@cozmixng.org>
+ * lib/webrick/httpresponse.rb (setup_header): 1xx responses
+ are allowed to have Keep-Alive connections.
- * test/rexml/test_core.rb
- (Tester#test_pretty_format_long_text_finite): skip a test that
- uses long string on small memory system. [ruby-dev:42599]
+ * test/webrick/test_httpresponse.rb: corresponding test.
-Fri Nov 19 21:07:06 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 13 07:13:28 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * lib/optparse.rb: shell completion support for zsh. based on
- <http://d.hatena.ne.jp/rubikitch/20071002/zshcomplete>
+ * lib/webrick/httpresponse.rb (setup_header): 204 and 304 responses
+ are allowed to have a Keep-Alive connection. [ruby-core:41581]
- * lib/optparse.rb: shell completion support for bash.
+ * test/webrick/test_httpresponse.rb: corresponding test.
-Fri Nov 19 00:00:00 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Dec 13 06:29:39 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * cygwin/GNUmakefile.in (SCRIPTPROGRAMS): no needs on cygwin.
+ * parse.y (parser_magic_comment): should pass the proper value.
+ [ruby-dev:44984][Bug #5753]
- * win32/Makefile.sub (scriptbin): create script binaries.
+Tue Dec 13 05:50:07 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Nov 18 23:21:23 2010 Kouhei Sutou <kou@cozmixng.org>
+ * vm_insnhelper.c (vm_yield_setup_block_args): splat single
+ argument if optional arguments are defined not only mandatory or
+ post arguments. [ruby-core:41557] [Bug #5730]
- * lib/rexml/formatters/pretty.rb (REXML::Formatters::Pretty#wrap):
- REXML::Formatters::Pretty#wrap used a recursive method call to
- format text. This switches it to use an iterative approach.
- [ruby-core:33245]
- Patch by Jeremy Evans. Thanks!!!
+Mon Dec 12 22:35:39 2011 Shugo Maeda <shugo@ruby-lang.org>
- * test/rexml/test_core.rb: add a test for it.
+ * parse.y (stmt_or_begin): changed the error message for BEGIN not
+ at toplevel. [ruby-dev:44963] [Bug #5738]
-Thu Nov 18 22:58:43 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Dec 12 17:29:01 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * include/ruby/io.h (rb_io_buffer_t): extract from rb_io_t.
+ * README: Fixed SupportedPlatforms URL in the README.
+ patched by eMxyzptlk. https://github.com/ruby/ruby/pull/62
-Thu Nov 18 07:37:44 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Dec 12 17:26:51 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * Makefile.in (reconfig): force reconfigure with previous options.
+ * load.c (rb_feature_p): lazy assigned load_path searched in
+ loading_table were not expanded, but all features, pushed to
+ loading table, are expanded. a patch by Yura Sokolov
+ <funny.falcon AT gmail.com> in [ruby-core:41545]. [Bug #5727]
- * common.mk (showconfig): show configure flags, like as
- `config.status --config' generated by recent autoconf.
+Mon Dec 12 15:41:03 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Nov 18 07:16:49 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/stringio/stringio.c (strio_truncate): fix typo. patched by
+ Nick Howard <ndh AT baroquebobcat.com>.
+ https://github.com/ruby/ruby/pull/65
- * missing/langinfo.c (strncasecmp): get rid of redefinition.
+Sun Dec 11 12:19:17 2011 Shugo Maeda <shugo@ruby-lang.org>
-Thu Nov 18 00:02:17 2010 James Edward Gray II <jeg2@ruby-lang.org>
+ * lib/net/imap.rb: includes the sequence number of UID in a error
+ message. suggested by art lussos.
+ [ruby-core:41413] [Feature #5692]
- * lib/csv.rb: Upgrading output encoding with ASCII content
- as needed. [ruby-core:33229]
+Sun Dec 11 11:42:10 2011 Kazuki Tsujimoto <kazuki@callcc.net>
-Wed Nov 17 23:19:21 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/syslog/syslog.c: fix a typo. [ruby-core:41585] [Bug #5740]
- * win32/configure.bat: remove quotes from arguments to be quoted.
+Sun Dec 11 10:48:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/mkmf.rb (create_makefile): use forward slashes in messages.
+ * error.c (exit_initialize): deal with true and false as well as
+ Kernel#exit. [ruby-dev:44951] [Bug #5728]
- * lib/mkmf.rb (create_makefile): make extension libraries messages
- brief.
+Sun Dec 11 10:37:47 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/Makefile.sub (MAKEDIRS): should not include silent flag.
+ * object.c (rb_check_to_int): new function to convert a VALUE to
+ an Integer if possible, but returns nil instead of raising an
+ exception otherwise.
- * common.mk (ext/ripper/ripper.c, ext/json/parser/parser.c): pass
- Q and ECHO. [ruby-core:33226]
+Sun Dec 11 10:34:39 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Nov 17 16:09:52 2010 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+ * process.c (rb_exit_status_code): extract from rb_f_exit_bang and
+ rb_f_exit. assume 0 to be success in Kernel#exit! too.
- * test/test_tracer.rb: new test case.
- minimal regression test for r29280.
+Fri Dec 9 19:24:31 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Nov 17 16:04:23 2010 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+ * enc/trans/iso-8859-16-tbl.rb: add ISO-8859-16 converter.
- * test/ruby/envutil.rb (Test::Unit::Assersions#assert_warn):
- new assertion to assert that a particular warning message is
- displayed.
- forward port from branches/ruby_1_9_2@29795.
+ * enc/trans/single_byte.trans: ditto.
-Wed Nov 17 15:16:48 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Fri Dec 9 14:28:40 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * regint.h (OnigOpInfoType): constify name.
+ * file.c (file_path_convert): don't convert it when the path string is
+ ascii only. [ruby-core:41556] [Bug #5733]
+ tests are contributed by nobu.
- * regcomp.c (op2name): constify return value.
+Fri Dec 9 08:00:15 2011 Luis Lavena <luislavena@gmail.com>
- * regcomp.c (onig_print_compiled_byte_code): use PRIuPTR and
- uintptr_t to clean warnings.
+ * include/ruby/win32.h: undef stat to silence mingw-w64 stat
+ redefinition warnings (GCC 4.6.3).
- * regcomp.c (print_indent_tree): use PRIxPTR and intptr_t.
+Thu Dec 8 23:38:24 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * regexec.c (match_at): use PRIdPTR and intptr_t.
+ * variable.c (set_const_visibility): clear inline-cache when constant's
+ visibility is modified. [ruby-dev:44929]
-Wed Nov 17 09:49:10 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/ruby/test_module.rb (test_private_constants_clear_inlinecache):
+ add test for it.
- * enc/shift_jis.c (property_name_to_ctype): fix memory leak.
+Thu Dec 8 23:26:11 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * enc/euc_jp.c (property_name_to_ctype): ditto.
+ * ext/extmk.rb (extract_makefile): should sort after map, not before
+ it. in this case there is no difference, but we should write better
+ code. this bad smell was caught by nagachika.
-Wed Nov 17 08:54:04 2010 James Edward Gray II <jeg2@ruby-lang.org>
+Thu Dec 8 22:31:13 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/csv.rb: Upgrading output encoding as needed. [ruby-core:33135]
+ * ext/extmk.rb (extract_makefile): need to sort the array of current
+ srcs before comparing to the sorted old srcs.
+ fixed the problem that the configuring stage of exts were always
+ run, introduced at r33801.
-Tue Nov 16 22:30:39 2010 Yusuke Endoh <mame@tsg.ne.jp>
+Thu Dec 8 13:26:24 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * vm_insnhelper.c (vm_throw): remove fear of undefined behavior :-)
- Coverity Scan found this bug.
+ * test/rexml/test_order.rb (OrderTester#test_more_ordering): use
+ Zlib::GzipReader.open instead of Zlib::GzipReader.new with File.new.
+ fixed a test error on Windows introduced at r33946.
-Tue Nov 16 09:33:00 2010 Kenta Murata <mrkn@mrkn.jp>
+Thu Dec 8 13:11:26 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/bigdecimal/lib/bigdecimal/util.rb (to_digits): avoid unused
- variables warning, reported by Aaron Patterson.
+ * test/ruby/test_process.rb (TestProcess#test_sete[gu]id): silently
+ skip if not implemented such functions (such as, on Windows).
+ fixed test errors on Windows introduced at r33953.
-Tue Nov 16 06:39:31 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Dec 8 12:57:50 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * pack.c (PACK_ITEM_ADJUST): return nil not result array and yield
- values if block is given. [ruby-core:33193]
+ * ext/socket/extconf.rb: forgotten to define HAVE_SOCKETPAIR for
+ windows.
+ fixed test errors on Windows introduced at r33947.
-Tue Nov 16 00:21:20 2010 Yusuke Endoh <mame@tsg.ne.jp>
+Thu Dec 8 12:11:06 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * regparse.c (and_cclass, or_cclass): fix memory leak. Coverity Scan
- found this bug. [ruby-dev:42579]
+ * configure.in (RUBY_WERROR_FLAG): append all warning flags which
+ are enabled to compile, so that printf format modifiers properly
+ fail. [ruby-core:41351] [Bug #5679]
-Tue Nov 16 00:07:32 2010 Yusuke Endoh <mame@tsg.ne.jp>
+Thu Dec 8 07:20:15 2011 Eric Hodel <drbrain@segment7.net>
- * gc.c (assign_heap_slot): fix fear of memory leak and memory
- violation. Coverity Scan found this bug.
+ * doc/re.rdoc: Document difference between match and =~, options with
+ Regexp.new and global variables. Patch by Sylvain Daubert.
+ [Ruby 1.9 - Bug #5709]
-Mon Nov 15 23:54:45 2010 Yusuke Endoh <mame@tsg.ne.jp>
+Thu Dec 8 06:53:10 2011 Eric Hodel <drbrain@segment7.net>
- * eval_intern.h (CHECK_STACK_OVERFLOW): it was not intended to add
- size_t to a pointer typed VALUE*. Coverity Scan found this defect.
+ * doc/re.rdoc: Fix example code to match documentation. Patch by
+ Jarno Lamberg. [Ruby 1.9 - Bug #5624]
-Mon Nov 15 23:41:21 2010 Yusuke Endoh <mame@tsg.ne.jp>
+Wed Dec 7 19:04:22 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * compile.c (iseq_set_exception_local_table, iseq_set_local_table,
- rb_iseq_build_from_ary): fix type inconsistency (which is benign
- because sizeof(ID) == sizeof(ID*), though). Coverity Scan found
- these bugs.
+ * configure.in (rpath): fix typo in the help string. a patch from
+ Yuji Yamano <yyamano AT kt.rim.or.jp> in [ruby-list:48568].
-Mon Nov 15 22:47:27 2010 Yusuke Endoh <mame@tsg.ne.jp>
+Wed Dec 7 18:55:56 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_eval.c (rb_funcall): ensure va_end after va_init_list. Coverity
- Scan found this bug.
+ * vm.c (vm_set_top_stack, vm_set_eval_stack): check for stack
+ overflow with stack_max before push new frame. [ruby-core:41520]
+ [Bug #5720]
-Mon Nov 15 08:36:12 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+ * vm.c (vm_set_main_stack): no stack overflow chances after
+ vm_set_eval_stack().
- * lib/racc/parser.rb (do_parse, yyparse): using class eval to define
- method and avoid __send__.
+Wed Dec 7 09:58:15 2011 Eric Hodel <drbrain@segment7.net>
-Mon Nov 15 06:43:48 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+ * ext/bigdecimal/bigdecimal.c: Document +@, -@, hash, INFINITY, Nan.
+ Patch by Sylvain Daubert. [Ruby 1.9 - Feature #5622]
- * etc/openssl/ossl_ssl.c (ossl_ssl_get_cert): raise exception if
- pointer is invalid. Thanks Ippei Obayashi! [ruby-dev:42573]
+Wed Dec 7 09:48:00 2011 Eric Hodel <drbrain@segment7.net>
-Sun Nov 14 17:57:45 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (Init_IO): Mention io/console methods. [Ruby 1.9 - Bug #5602]
+ * ext/io/console/console.c: Mention that io/console must be required
+ similar to lib/time.rb
- * enc/Makefile.in (distclean): should not remove sources which are
- distributed in tarball.
+Wed Dec 7 08:04:31 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Sun Nov 14 16:48:56 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/psych/lib/psych.rb (module Psych): parse and load methods take
+ an optional file name that is used when raising Psych::SyntaxError
+ exceptions
+ * ext/psych/lib/psych/syntax_error.rb (module Psych): allow nil file
+ names and handle nil file names in the exception message
+ * test/psych/test_exception.rb (module Psych): Tests for changes.
- * parse.y (parser_set_token_info): turn on/off with directives.
- [ruby-core:25442]
+Tue Dec 6 18:26:33 2011 Tanaka Akira <akr@fsij.org>
-Sun Nov 14 12:05:24 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/dbm/dbm.c: use db_version() instead of DB_VERSION_STRING to
+ detect runtime Berkeley DB version.
+ use dpversion instead of _QDBM_VERSION to detect runtime QDBM
+ version.
+ [ruby-dev:44948]
- * io.c (argf_readlines): forward to current_file for arguments
- check. http://twitter.com/nagachika/status/3634254856589312
+Tue Dec 6 12:30:41 2011 Tanaka Akira <akr@fsij.org>
-Sun Nov 14 08:48:06 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/dbm/extconf.rb: detect gdbm_version in libgdbm.
- * win32/setup.mak (-basic-vars-, -runtime-): suppress trailing
- space and compiler command line.
+ * ext/dbm/dbm.c: make DBM::VERSION more informative for gdbm, qdbm and
+ Berkeley DB 1.x. [ruby-dev:44944]
-Sun Nov 14 04:22:32 2010 Alexander Zavorine <alexandre.zavorine@nokia.com>
+Tue Dec 6 07:26:37 2011 Eric Hodel <drbrain@segment7.net>
- * symbian/setup (config.h): Added HAVE_LABS and HAVE_LLABS to config.h.
+ * range.c: Improve documentation for Range. Patch by Chris Zetter.
+ [Ruby 1.9 - Bug #5656]
- * symbian/configure.bat: Changed packaging version in line with API
- style 3 versioning.
+Mon Dec 5 19:08:04 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Nov 13 16:37:56 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * regparse.c (PFETCH_READY): separate gcc specific trick.
- * common.mk (showflags, help): emit messages at once.
+Mon Dec 5 19:01:59 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/Makefile.sub (MSG, EOM): remove surrounding quotes by %~I.
+ * process.c (proc_seteuid_m): fix argument.
-Sat Nov 13 01:31:30 2010 Akio Tajima <artonx@yahoo.co.jp>
+ * test/ruby/test_process.rb (test_geteuid): fix typo.
- * win32/Makefile.sub: reorder variable End Of Message (don't display it)
+ * test/ruby/test_process.rb (test_getegid, test_set[eg]uid): add.
-Fri Nov 12 20:52:34 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Dec 5 18:56:55 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * common.mk (showflags, help): use caret to quote leading spaces on
- Windows.
+ * bignum.c (big_rshift), compile.c (validate_label,
+ iseq_build_from_ary_exception), cont.c (cont_capture), dir.c
+ (dir_open_dir), gc.c (objspace_each_objects), io.c (pipe_open)
+ (rb_io_advise), parse.y (parser_compile_string)
+ (rb_parser_compile_file), proc.c (binding_free), process.c
+ (rb_proc_exec_n, rb_seteuid_core, proc_setegid, rb_setegid_core)
+ (p_uid_exchange, p_gid_exchange), regparse.c (strdup_with_null),
+ signal.c (sig_dfl), vm.c (rb_iseq_eval, rb_iseq_eval_main),
+ vm_insnhelper.c (vm_expandarray): suppress
+ unused-but-set-variable warnings.
- * Makefile.in, common.mk, cygwin/GNUmakefile.in, enc/depend,
- ext/ripper/depend, lib/mkmf.rb, win32/Makefile.sub: caddle up.
+ * class.c (rb_obj_methods), compile.c (iseq_compile_each),
+ iseq.c(iseq_load, rb_iseq_parameters), pack.c (pack_pack),
+ regcomp.c (is_not_included, update_string_node_case_fold),
+ transcode.c (rb_econv_open0, make_replacement),
+ vm_eval.c (raise_method_missing): remove unused variable.
-Fri Nov 12 16:35:31 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * signal.c (reserved_signal_p): static.
- * configure.in: support C level backtrace information on FreeBSD.
- When devel/libexecinfo is installed on FreeBSD, now ruby
- can show C level backtrace information.
- http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/libexecinfo/
+Mon Dec 5 14:27:23 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Nov 12 09:58:30 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * include/ruby/{subst.h,win32.h}, ext/socket/rubysocket.h: revert
+ r33876. [ruby-core:41475] [Bug #5706]
- * win32/setup.mak: use findstr.exe instead of find.exe, because all
- target build platforms should have findstr.exe, and, find.exe often
- means another command such as cygwin's.
+ * ext/socket/extconf.rb: the alternative hack for [Bug #5675].
-Fri Nov 12 00:30:19 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Dec 5 10:18:45 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * win32/Makefile.sub (config.h): need PRI_LL_PREFIX.
+ * ext/zlib/zlib.c (rb_gzreader_initialize): revert a part of r33937.
+ 1st, to change the mode of an IO is very sensitive problem, so
+ the maintainer of this library should judge it.
+ 2nd, usually Zlib::GzipReader.new is not called directly. #initialize
+ is called via .open, and in the method the I/O is opened in binary
+ mode, so there is no problem without changing the mode in #initialize.
-Thu Nov 11 23:38:32 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Dec 4 22:53:12 2011 Tanaka Akira <akr@fsij.org>
- * configure.in: ANSI C-conforming const and volatile are mandatory
+ * lib/tempfile.rb: don't use lock directory. [ruby-dev:39197]
- * configure.in (AC_C_CONST, AC_C_INLINE, AC_C_VOLATILE): check
- before used in other checks.
+Sun Dec 4 22:34:43 2011 Tanaka Akira <akr@fsij.org>
- * configure.in (RUBY_CHECK_PRINTF_PREFIX): should not break from
- RUBY_WERROR_FLAG, so that ac_c_werror_flag gets restored.
+ * lib/tempfile.rb (Tempfile::MAX_TRY): remove unused constant.
-Thu Nov 11 23:04:44 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Dec 4 12:11:28 2011 Kazuki Tsujimoto <kazuki@callcc.net>
- * ext/iconv/iconv.c (warn_deprecated): show caller position.
+ * lib/pp.rb: fix rdoc.
-Thu Nov 11 23:03:12 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Dec 4 12:03:16 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * io.c (argf_close): untie tied io before closing.
+ * lib/delegate.rb (Delegator#methods): Kernel#methods receives
+ zero or one argument. [ruby-core:37118] [Bug #4882]
- * io.c (argf_write): add ARGF.write and so on.
+Sun Dec 4 10:15:00 2011 Luis Lavena <luislavena@gmail.com>
- * io.c (argf_read_nonblock): add ARGF.read_nonblock.
+ * ext/zlib/zlib.c (rb_gzreader_initialize): use binary mode by default
+ under Windows. Patch by Hiroshi Shirosaki. [ruby-core:40706]
+ [Feature #5562]
-Thu Nov 11 21:49:06 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * include/ruby/encoding.h (void rb_econv_binmode): define NEWLINE
+ decorator.
- * lib/rdoc/stats.rb (RDoc#print): get rid of NaN.
+ * io.c (rb_cloexec_fcntl_dupfd): Introduce NEED_READCONV and
+ NEED_WRITECONV to replace universal newline decorator by CRLF only
+ when required to improve file reading and writing under Windows.
+ Patch by Hiroshi Shirosaki. [ruby-core:40706] [Feature #5562]
+ * io.c (do_writeconv): adjust binary mode if required.
+ * io.c (read_all, appendline, swallow, rb_io_getline_1): ditto.
+ * io.c (io_getc, rb_io_each_codepoint, rb_io_ungetc): ditto.
+ * io.c (rb_io_binmode, rb_io_ascii8bit_binmode): ditto.
+ * io.c (rb_io_extract_modeenc, rb_sysopen): ditto.
+ * io.c (pipe_open, prep_stdio, io_encoding_set): ditto.
+ * io.c (rb_io_s_pipe, copy_stream_body): ditto.
-Thu Nov 11 21:47:12 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_io_m17n.rb (EOT): add test for pipe and stdin in
+ binary mode.
- * common.mk (SHOWFLAGS): show compile flags.
+ * win32/win32.c (init_stdhandle): remove O_BINARY from stdhandle
+ initialization.
+ * win32/win32.c (rb_w32_write): use FTEXT mode accordingly.
- * common.mk: hide long command lines by default. verbose-mode is
- turned on by V=1 as before.
- http://jarp.does.notwork.org/diary/200605b.html#200605121
+Sat Dec 3 20:49:16 2011 Yusuke Endoh <mame@tsg.ne.jp>
-Thu Nov 11 21:32:09 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * variable.c (set_const_visibility): print a warning when no argument
+ is passwd to Module#private_constant. [ruby-list:48558]
- * lib/mkmf.rb (try_func): accept variable address.
+ * vm_method.c (set_method_visibility): ditto for
+ Module#private_class_method.
- * ext/win32ole/extconf.rb: libuuid is needed on cygwin.
+Sat Dec 3 20:43:14 2011 Yusuke Endoh <mame@tsg.ne.jp>
-Thu Nov 11 21:24:36 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * variable.c (set_const_visibility): Module#private_constant has
+ changed the visibility of only the first argument. Now it changes
+ all of them. [ruby-list:48558]
- * file.c (file_expand_path): use cygwin_conv_path on cygwin 1.7 or
- later.
+ * test/ruby/test_module.rb: add a test for above.
- * ruby.c (push_include_cygwin): ditto.
+Sat Dec 3 07:17:29 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Nov 11 20:49:48 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * Makefile.in (CFLAGS): append ARCH_FLAG.
- * include/ruby/ruby.h (PRI_LL_PREFIX): format type specifier for
- LONG_LONG may vary on platforms.
+ * configure.in (ARCH_FLAG): exclude from CFLAGS.
-Thu Nov 11 20:45:23 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (UNIVERSAL_INTS): include short int. fix for
+ test/mkmf.
- * configure.in (SYMBOL_PREFIX): separate from EXPORT_PREFIX.
+Fri Dec 2 15:48:08 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/mkexports.rb (Exports#each_export): use SYMBOL_PREFIX.
+ * ext/bigdecimal/bigdecimal.c (VpAllocReal): reduce extra frac.
-Wed Nov 10 07:20:10 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Dec 2 15:41:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * cygwin/GNUmakefile.in (scriptbin): make executable file from
- scripts with stub.
+ * configure.in: check whether -pie or -Wl,-pie is valid as
+ LDFLAGS. [ruby-core:41438] [Bug#5697]
- * ruby.c (load_file_internal): assume xflag for exe file as well
- as no-shebang file.
+ * configure.in: use $linker_flag for LDFLAGS option which is not
+ limited to particular platforms.
- * tool/rbinstall.rb: install script programs.
+Thu Dec 1 23:21:58 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * win32/mkexports.rb (Exports#initialize): alias ruby_sysinit for
- stub.
+ * thread_pthread.c (thread_timer): call prctl(PR_SET_NAME) only if
+ PR_SET_NAME is available.
- * win32/stub.c: stub for scripts. [EXPERIMENTAL]
+Thu Dec 1 22:31:16 2011 Tanaka Akira <akr@fsij.org>
-Tue Nov 9 21:57:45 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (linux_get_maxfd): change local variable name.
- * dln.c (init_funcname): allocate and build initialization
- funciton name at once.
+Thu Dec 1 16:59:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Tue Nov 9 21:14:54 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/socket/extconf.rb: add arguments for macro calls.
+ [ruby-core:41370] [Bug#5681]
- * configure.in (AC_FUNC_GETPGRP, AC_FUNC_SETPGRP): no need when
- not used.
+Thu Dec 1 16:20:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in (EXPORT_PREFIX): check generic prefix.
+ * lib/mkmf.rb (MakeMakefile#try_func): fix broken patch at r33834.
-Tue Nov 9 13:24:33 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Dec 1 14:43:17 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * regenc.c (onigenc_minimum_property_name_to_ctype):
- \p{...} should be case insensitive. [ruby-core:33000]
+ * ext/bigdecimal/bigdecimal.h (Real): suppress false warning from
+ clang. [ruby-core:41418] [Bug#5693]
- * regenc.c (onigenc_property_list_add_property):
- ditto.
+Thu Dec 1 10:31:55 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * enc/euc_jp.c (init_property_list, property_name_to_ctype):
- to lowercase property names.
+ * configure.in (LDFLAGS): -fstack-protector is always needed to
+ link static library created with it. [ruby-core:41387]
+ [Bug#5686]
- * enc/shift_jis.c (init_property_list, property_name_to_ctype):
- ditto.
+Thu Dec 1 07:03:51 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Nov 9 13:29:36 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * configure.in: add sys/prctl.h test.
+ * thread_pthread.c (thread_timer): call prctl(PR_SET_NAME) to change
+ thread name. It may help to debug.
- * win32/win32.c (overlapped_socket_io): get rid of a warning of 64bit
- mingw.
+Wed Nov 30 23:35:45 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Nov 9 10:44:19 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * variable.c (rb_path2class): don't raise NameError when the middle
+ constant of the path is not defined but defined on toplevel.
+ [ruby-core:41410] [Bug #5691]
- * util.c (ruby_strtod): this code uses FPU's rounding system.
- But x86's FPU calculates double precision floating-point
- numbers in 80bit precision, so it fails to round the value.
- So ensure the value is assigned a variable. [ruby-dev:42551]
- see also [ruby-math:00802]
- http://www.shudo.net/java-grandprix99/strictfp/
+Wed Nov 30 20:02:02 2011 Martin Duerst <duerst@it.aoyama.ac.jp>
-Tue Nov 9 07:30:15 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * transcode.c: Simplified rb_econv_binmode, avoided a warning on cygwin.
- * error.c (rb_syserr_new): new function to make SystemCallError
- instance without errno. [EXPERIMENTAL]
+Wed Nov 30 08:57:07 2011 Eric Hodel <drbrain@segment7.net>
- * error.c (rb_syserr_fail, rb_mod_syserr_fail): ditto.
+ * lib/mkmf.rb: Use MakeMakefile's rm_f to avoid conflict with Rake or
+ FileUtils.
+ * test/ruby/test_module.rb: Hide MakeMakefile's inclusion in Object
-Tue Nov 9 05:54:57 2010 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+Wed Nov 30 09:12:43 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * lib/*.rb: Remove unused variable warnings.
- Patch by Run Paint [ruby-core:30991]
+ * lib/rdoc/encoding.rb (RDoc::Encoding.read_file): fixup newline chars
+ on Windows.
+ see https://github.com/rdoc/rdoc/issues/87
- * lib/rubygems/*, lib/rdoc/*.rb, lib/rake/*.rb: ditto
+ * test/rdoc/test_rdoc_markup_pre_process.rb
+ (TestRDocMarkupPreProcess#test_include_file,
+ TestRDocMarkupPreProcess#test_include_file_encoding_incompatible):
+ follow above change.
-Mon Nov 8 18:26:03 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Wed Nov 30 09:09:37 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * util.c (ruby_hdtoa): fix type cast and bufsize.
+ * ext/psych/parser.c (parse): parse method can take an option file
+ name for use in exception messages.
+ * test/psych/test_parser.rb: corresponding tests.
-Mon Nov 8 15:40:56 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Tue Nov 29 09:07:59 2011 Eric Hodel <drbrain@segment7.net>
- * vsnprintf.c (BSD_vfprintf): fix precision specifier doesn't
- work well on %f. [ruby-dev:42552]
+ * lib/mkmf.rb: Fix indentations of constants at end of module.
+ Document some constants.
-Mon Nov 8 14:41:40 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Nov 29 09:58:23 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (get_wsa_extension_function): typos.
+ * io.c (rb_write_error2): suppress unused variable warning.
-Mon Nov 8 13:41:33 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Tue Nov 29 07:45:26 2011 Eric Hodel <drbrain@segment7.net>
- * tool/enc-unicode.rb,
- enc/unicode/name2ctype.h, enc/unicode/name2ctype.h.blt,
- enc/unicode/name2ctype.kwd, enc/unicode/name2ctype.src:
- Add Age property to regexp. [ruby-core:33019]
- patched by Ammar Ali, tested by Run Paint Run Run
+ * lib/mkmf.rb: Wrap comments to 78 columns and clean up formatting.
-Mon Nov 8 12:16:39 2010 Ben Walton <bwalton@artsci.utoronto.ca>
+Tue Nov 29 05:54:18 2011 Eric Hodel <drbrain@segment7.net>
- * configure.in: support -h for solaris linker when gcc not used
+ * lib/mkmf.rb: Wrap mkmf.rb in module MakeMakefile to clean up Object
+ documentation. [Ruby 1.9 - Feature #5658]
+ * ext/extmk.rb: Use MakeMakefile::CONFIG instead of Object::CONFIG
+ * test/mkmf/base.rb: ditto
-Mon Nov 8 11:47:39 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Nov 29 00:08:57 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
- * win32/win32.c (finish_overlapped_socket): refactoring.
+ * common.mk (INSTRUBY_ARGS): added --mantype to apply mdoc2man.rb
+ to man pages. Fixes #5598.
+ (do-install-nodoc, do-install-local, do-install-man,
+ dont-install-nodoc, dont-install-local, dont-install-man):
+ No longer needs --mantype.
-Mon Nov 8 11:02:21 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ Reported by Rainer Orth <ro AT cebitec.uni-bielefeld.de>,
+ patch by George Koehler <xkernigh AT netscape.net>.
- * win32/win32.c (get_proc_address): refactoring.
+Mon Nov 28 22:26:31 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * win32/win32.c (get_wsa_exetinsion_function): refactoring.
+ * test/rake/test_rake_directory_task.rb
+ (TestRakeDirectoryTask#test_directory_win32): shouldn't create any
+ file/directory on root directory. create on @tempdir (= Dir.pwd).
+ see https://github.com/jimweirich/rake/issues/91
-Mon Nov 8 09:45:35 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Nov 28 12:57:29 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * enc/trans/gbk-tbl.rb: Add euro sign. [ruby-core:33094]
- CP936, which is de facto definition of GBK, has it.
- http://msdn.microsoft.com/en-us/goglobal/cc305153.aspx
+ * io.c (rb_write_error2): fwrite() returns ssize_t.
-Mon Nov 8 07:26:20 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Nov 28 12:47:19 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * configure.in: check only the first symbol to get rid of
- duplication. [ruby-core:33084] #4031
+ * parse.y (nodetype, nodeline): static. these functions are for
+ debugging, and not intend to be public.
-Sun Nov 7 10:13:30 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Nov 28 12:37:54 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * configure.in (NM): check on all platforms. #4031
+ * gc.c (initial_params): static. it seems to be forgotten at r33501.
-Sun Nov 7 06:16:33 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+Mon Nov 28 12:32:24 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/openssl/test_ocsp.rb: adding test for r29699. Thanks Elise
- Huard! [ruby-core:32460]
+ * include/ruby/win32.h, win32/win32.c (GetCurrentThreadHandle): remove
+ unused old API.
-Sat Nov 6 07:33:08 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Nov 28 12:29:20 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * configure.in (rb_cv_export_prefix): check for prefixed
- underscore of exported symbols
+ * win32/mkexports.rb (Exports#initialize): remove old symbol name.
- * tool/rbinstall.rb (bin-comm): prepend prolog shell script if
- necessary.
+Mon Nov 28 12:15:28 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in (LIBRUBY_RELATIVE): use rpath token expansion.
+ * win32/mkexports.rb (Exports#read_substitution): need to read
+ from subst.h too. [Bug #5675]
-Sat Nov 6 07:24:01 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Nov 28 11:46:35 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * template/ruby.pc.in (arch, sitearch): reordered.
+ * io.c (rb_io_flush): release GVL during fsync() on Windows.
- * configure.in: keep failed file.
+Mon Nov 28 11:00:25 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Nov 6 07:03:49 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * include/ruby/subst.h: typo of r33876.
- * process.c (rb_fork_err): save errinfo before fdopen.
+Mon Nov 28 10:36:00 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Nov 6 00:43:58 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+ * include/ruby/subst.h: moved Windows specific substitutions from
+ win32.h.
- * ext/openssl/ossl_ocsp.c (ossl_ocspcid_initialize): an optional
- parameter may be used to specify the OpenSSL::OCSP::CertificateId on
- initialization. Thanks Elise Huard! [ruby-core:32460]
+ * ext/socket/rubysocket.h: include ruby/subst.h. [Bug #5675]
-Fri Nov 5 12:23:01 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Nov 28 10:20:58 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/ruby/test_{process,system}.rb (test_fallback_to_sh):
- meaningless and wrong tests where /bin/sh does not exist.
+ * win32/{Makeilfe.sub,win32.c} (FILE_COUNT, FILE_READPTR): move the
+ definitions from config.h to win32.c. I dared to have left such
+ macros, for other future compiler support.
+ [ruby-core:41313] [Bug #5674]
- * process.c (proc_spawn_v): should spawn, not exec.
+Mon Nov 28 09:28:30 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Nov 5 01:21:31 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/win32.c (rb_w32_uchmod): typo. [Bug#5671] [ruby-dev:44898]
- * process.c (proc_exec_v, proc_spawn_v): try to execute with sh if
- no shebang. [ruby-core:32745] [EXPERIMENTAL]
+ * test/ruby/test_file.rb (TestFile#test_chmod_m17n): test of above bug.
-Fri Nov 5 00:39:00 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Nov 27 21:25:33 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * io.c (rb_io_readlines, rb_io_each_line): limit must not be zero.
- a patch from Tomoyuki Chikanaga at [ruby-dev:42538]. #4024
+ * configure.in: added -fno-strict-overflow. it suppress annoying
+ -Wstrict-overflow warning.
-Fri Nov 5 00:14:15 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+Sun Nov 27 20:58:02 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/fiddle/extconf.rb: fixing ffi library location on windows.
- Thanks Usa! [ruby-core:32930]
+ * io.c (rb_write_error2): get rid of warning on linux. fwrite
+ of glibc is tagged __attribute__ ((__warn_unused_result__))
+ if _FORTIFY_SOURCE != 0.
+ * vm_dump.c (rb_vm_bugreport): ditto.
-Thu Nov 4 20:04:44 2010 Koichi Sasada <ko1@atdot.net>
+Sun Nov 27 19:09:02 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * gc.c (rb_newobj): force garbage_collect() if GC.stress == true.
+ * configure.in (stack_protector): disable on mingw. [Bug#5676]
-Thu Nov 4 19:48:22 2010 Koichi Sasada <ko1@atdot.net>
+ * Makefile.in (DLDFLAGS): also needs -fstack-protector.
+ [Bug#5676]
- * ChangeLog: missed to write a last ChangeLog.
+Sun Nov 27 14:13:33 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * gc.c (gc_finalize_deferred): removed.
+ * configure.in: add -fstack-protector into XLDFLAGS as well as
+ XCFLAGS if stack-protector is used.
- * gc.c (rb_gc_finalize_deferred): Do not invoke a free_unused_heaps().
+Sun Nov 27 13:09:25 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Thu Nov 4 19:45:27 2010 Koichi Sasada <ko1@atdot.net>
+ * configure.in: workaround to avoid MacOS X build error.
+ Maybe autoconf 2.61 is slightly buggy. [ruby-core:41316]
- * gc.c (run_final): do not need argument obj.
+Sun Nov 27 04:57:11 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Nov 4 19:26:10 2010 Koichi Sasada <ko1@atdot.net>
+ * configure.in (--no-undefined): r33840 breaks FreeBSD and DragonFly
+ with gcc 4.4 or later. Their environ is in /usr/libexec/ld-elf.so.1,
+ so it will be false negative.
- * gc.c (before_gc_sweep): fix commit miss.
+Sun Nov 27 04:55:45 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Nov 4 19:20:46 2010 Koichi Sasada <ko1@atdot.net>
+ * lib/net/http.rb (Net::HTTP::SSL_IVNAMES): rerefix 33701.
+ SSL_ATTRIBUTES stores names for set_params, they are symbol.
+ SSL_IVNAMES stores instance variable names.
- * gc.c (after_gc_sweep, before_gc_sweep):
- invoke rb_sweep_method_entry() as soon as possible.
+Sun Nov 27 00:16:07 2011 Tanaka Akira <akr@fsij.org>
-Thu Nov 4 19:13:58 2010 Koichi Sasada <ko1@atdot.net>
+ * io.c (copy_stream_body): use 0666 for permission argument for open.
+ [ruby-core:40865]
- * gc.c (after_gc_sweep, slot_sweep): finalizers should be invoked
- as soon as possible.
+Sat Nov 26 23:01:38 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Thu Nov 4 10:30:40 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+ * test/openssl/test_engine.rb: remove side effect of generic engine
+ load by explicitly loading software-based "openssl" engine for
+ all tests.
- * configure.in (--with-valgrind): Now this option is default on.
- You can still explicitly disable this feature by specifying
- --without-valgrind.
+Sat Nov 26 20:41:48 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Thu Nov 4 02:06:16 2010 Yusuke Endoh <mame@tsg.ne.jp>
+ * lib/net/http.rb (Net::HTTP.get_response): enable use_ssl
+ if given URI object is https.
+ patched by Mark Ferlatte [ruby-core:40665] [Bug #5545]
- * cont.c (fiber_t_alloc): raise an error when fiber is going to be
- initialized twice. [ruby-dev:42524]
+ * lib/net/http.rb (Net::HTTP.post_form): ditto.
-Thu Nov 4 02:04:25 2010 Yusuke Endoh <mame@tsg.ne.jp>
+Sat Nov 26 20:01:18 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * cont.c (rb_fiber_resume): raise an "double resume" error when root
- fiber is going to be resumed. [ruby-dev:42523]
+ * lib/net/http.rb (Net::HTTP::SSL_ATTRIBUTES): refix 33701.
+ store instance variable symbol names.
-Wed Nov 3 14:17:18 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Nov 26 15:40:25 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
- * lib/ostruct.rb (OpenStruct#delete_field): also undefine
- accessor methods. [ruby-core:33010]
+ * .travis.yml (script): should be ./configure
-Wed Nov 3 14:13:46 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Nov 26 15:39:18 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
- * string.c (rb_enc_cr_str_buf_cat): concatenation of valid
- encoding string and invalid encoding string should result
- invalid encoding. [ruby-core:33027]
+ * .travis.yml (before_script): wrong name, sorry.
-Wed Nov 3 08:58:59 2010 Koichi Sasada <ko1@atdot.net>
+Sat Nov 26 15:31:34 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
- * gc.c, vm.c, vm_core.h: remove USE_VALUE_CACHE option.
+ * .travis.yml (before-script): autoconf required.
-Wed Nov 3 07:47:25 2010 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Nov 26 15:24:05 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
- * lib/irb/ruby-lex.rb (RubyLex#identify_string): parse multiple
- regex options. a patch from Heesob Park in [ruby-core:32988].
+ * .travis.yml: Travis enable.
-Wed Nov 3 07:33:57 2010 Tanaka Akira <akr@fsij.org>
+Sat Nov 26 10:47:50 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * vm_method.c (rb_clear_cache_by_class): just return if the class has
- no method. reported by Eric Wong. [ruby-core:32689]
+ * ext/openssl/extconf.rb: remove checks for available functions.
+ * ext/openssl/missing.h: ditto.
+ Thanks, Tim Mooney for reporting this!
+ [Bug #5432] [ruby-core:40088]
-Tue Nov 2 22:50:25 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+Sat Nov 26 10:22:28 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * ext/psych/lib/psych/visitors/visitor.rb (initialize): push accessor
- methods to subclass that actually uses them.
+ * ext/openssl/ossl_ssl.c: add comment on where to find implementation
+ of OpenSSL::SSL::SSLSocket#session.
-Tue Nov 2 22:47:08 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+Sat Nov 26 05:00:25 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/psych/lib/psych/visitors/visitor.rb (accept): switch to
- a dispatch cache rather than case / when statement.
+ * configure.in (--no-undefined): RUBY_TRY_CFLAGS does nothing for
+ linker flags. use RUBY_TRY_LDFLAGS.
-Tue Nov 2 21:46:52 2010 Kouhei Sutou <kou@cozmixng.org>
+Fri Nov 25 11:37:07 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * NEWS: fix a typo.
+ * io.c (ioctl_narg_len, linux_iocparm_len): reinstantiate linux
+ specific narg length calculation.
+ * test/ruby/test_io.rb (test_ioctl_linux2): add new test for old and
+ unstructured ioctl.
-Tue Nov 2 20:10:32 2010 Tajima Akio <artonx@yahoo.co.jp>
+Fri Nov 25 10:39:14 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/rake/test_tasks.rb: clear env var which is used by the test.
- [ruby-dev:42508]
+ * Makefile.in (EXTLDFLAGS): export it.
+ * configure.in: add --no-undefined if --enable-shared is specified.
+ Gentoo enabled this option long time. Also, export EXTLDFALGS.
-Tue Nov 2 00:25:54 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Nov 25 08:48:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/socket/extconf.rb: win64 is just same with win32 about socket.
- notice: but wince is not same.
+ * configure.in: turn on PIE if --enable-shared is not specified.
-Mon Nov 1 21:25:57 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+Fri Nov 25 08:05:07 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * main.c: <stdlib.h> is needed, to introduce the getenv(3)
- prototype declaration. Without it a C compiler shall infer
- the getenv type as "int getenv(...);", but this is totally
- wrong, especially when your machine's sizeof(int) and
- sizeof(char*) differs. On such environment a return value
- of getenv(3), which is in fact a char*, might first casted
- into a int (loses data here), and then casted back to char*
- by automatic integral promotion to fit to the prototype of
- ruby_set_debug_option().
+ * configure.in: add -fstack-protector. It help to protect us from
+ stack smashing attack.
-Sun Oct 31 23:27:09 2010 Koichi Sasada <ko1@atdot.net>
+Fri Nov 25 08:03:28 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * gc.c (finalizer_table, objspace->final.table):
- Create finalizer_table at Init_heap().
- Remove all null checks of finalizer_table.
+ * configure.in: add -D_FORTIFY_SOURCE=2. It provide some compile
+ time and runtime check for security.
- * gc.c (mark_tbl): skip if no table entries.
+Fri Nov 25 08:00:23 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * gc.c (slot_swee): remove useless need_call_final check.
+ * lib/mkmf.rb: get rid of warnings of mkmf.rb if -Wmissing-declarations
+ and/or -Wold-style-definition warnings if specified.
+ Patch by Nikolai Weibull. Thank you! [Bug #5459] [ruby-core:40200]
-Sun Oct 31 22:32:08 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Nov 25 07:46:09 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * gc.c (rb_objspace_free): finalizers should be called separately
- from freeing objspace. [ruby-dev:42479]
+ * configure.in: add -Wall always.
-Sun Oct 31 22:24:14 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Nov 24 20:02:40 2011 Tanaka Akira <akr@fsij.org>
- * eval.c (ruby_cleanup): free current VM and its objspace even
- when exiting by SystemExit.
+ * test/openssl/test_engine.rb: use IO#reopen to restore stderr.
-Sun Oct 31 22:10:56 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Nov 24 19:59:56 2011 Tanaka Akira <akr@fsij.org>
- * compile.c (new_child_iseq): adjust argument types.
+ * io.c (rb_io_reopen): re-initialize buffering mode for stdout and
+ stderr.
- * iseq.c (prepare_iseq_build, rb_iseq_new),
- (rb_iseq_new_with_bopt_and_opt, rb_iseq_new_with_opt),
- (rb_iseq_new_with_bopt): ditto.
+Thu Nov 24 11:12:48 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * compile.c (iseq_set_exception_table): suppress warnings.
+ * io.c (rb_io_fsync,rb_io_fdatasync): release GVL during fsync().
+ fsync() and fdatasync() may take a long time on slow disks and/or
+ if there is much dirty data.
+ Patch by Eric Wong. [Feature #5665] [ruby-core:41247]
- * insns.def (putspecialobject, defined): ditto.
+Thu Nov 24 10:05:02 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * iseq.c (iseq_load): ditto.
+ * test/openssl/test_engine.rb: Suppress output from 'openssl'
+ engine's RC4 cipher.
+ [Bug #5633] [ruby-core:41026]
-Sun Oct 31 09:30:51 2010 Koichi Sasada <ko1@atdot.net>
+Thu Nov 24 08:05:02 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * vm_core.h: some refactoring.
- - move decl. of rb_compile_option_struct to iseq.h.
- - define enum iseq_type.
- - define enum vm_special_object_type.
+ * ext/openssl/ossl_pkey_dsa.c: remove redundant colon from error
+ message.
+ * ext/openssl/ossl_ssl.c: ditto.
+ * ext/openssl/ossl_pkey_rsa: ditto.
+ patched by Eric Hodel [Bug #5604] [ruby-core:40896]
- * compile.c: some refactoring.
- - apply above changes.
- - (struct iseq_link_element): change value of type.
- - remove unused decl.
- - fix comment.
- - rename iseq_build_body and iseq_build_exception to
- iseq_build_from_ary_body and iseq_build_from_ary_exception.
+Wed Nov 23 20:03:43 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * iseq.h: define enum catch_type and enum defined_type.
+ * io.c (ioctl_narg_len): don't use _IOC_SIZE macro on Linux.
+ On Linux some constants for ioctl(2) doesn't include the size of
+ its return value and 16bit value; for example FIONREAD 0x541B.
+ Moreover the manual, ioctl_list(2), says "Note that the size
+ bits are very unreliable: in lots of cases they are wrong,
+ either because of buggy macros using sizeof(sizeof(struct)),
+ or because of legacy values."
+ So we shouldn't use it.
- * insns.def: apply above changes.
+Tue Nov 22 18:07:32 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * iseq.c: define ISEQ_MAJOR_VERSION and ISEQ_MINOR_VERSION.
+ * win32/win32.c (_pioinfo): need to declare _pioinfo() before using
+ _osfhnd and other macros which uses _pioinfo() internally.
-Sat Oct 30 23:38:59 2010 Kouhei Sutou <kou@cozmixng.org>
+Tue Nov 22 17:49:45 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rexml/encoding.rb: untabify.
+ * win32/win32.c (_pioinfo): make an inline function.
-Sat Oct 30 21:06:37 2010 Kouhei Sutou <kou@cozmixng.org>
+Tue Nov 22 11:26:08 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * lib/rexml/encoding.rb: use Ruby native encoding mechanism.
- [ruby-dev:42464]
- * lib/rexml/encodings/: remove.
+Tue Nov 22 11:33:58 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/rexml/document.rb, lib/rexml/formatters/default.rb,
- lib/rexml/output.rb, lib/rexml/parseexception.rb,
- lib/rexml/parsers/baseparser.rb, lib/rexml/source.rb,
- lib/rexml/xmldecl.rb: use Ruby's native Encoding object.
+ * win32/win32.c (dupfd): argument of _osfhnd and so on should not
+ have side effect.
- * test/rexml/, test/rss/: follow the above encoding changes.
+Tue Nov 22 11:26:08 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * NEWS: add REXML's incompatible change about encoding.
+ * bignum.c (rb_big_divide): refix of r33536. Don't change behavior of Bignum#/.
+ [ruby-core:40429] [Bug #5490]
-Sat Oct 30 17:23:19 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 22 10:46:57 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * util.c (ruby_strtod): get rid of overflow/underflow as possible.
+ * numeric.c (ruby_float_step): improve floating point calculations.
+ [ruby-core:35753] [Bug #4576]
-Sat Oct 30 14:37:39 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * numeric.c (ruby_float_step): correct the error of floating point
+ numbers on the excluding case.
+ patched by Masahiro Tanaka [ruby-core:39608]
- * configure.in (ruby_pc): erase runtime-defined variables and
- check if generated pc file is valid.
+ * numeric.c (ruby_float_step): use the end value when the current
+ value is greater than or equal to the end value.
+ patched by Akira Tanaka [ruby-core:39612]
- * template/ruby.pc.in (DEFFILE): need for mingw.
+Tue Nov 22 06:59:21 2011 Tanaka Akira <akr@fsij.org>
- * template/ruby.pc.in (LIBRUBY): fix the order.
+ * test/ruby/test_io.rb (test_fcntl_dupfd): there is no known platform
+ which don't have F_DUPFD. [ruby-dev:44874]
-Sat Oct 30 11:33:54 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Nov 22 04:46:22 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * win32/Makefile.sub (ruby_pc): ignore missing variables.
+ * ext/psych/lib/psych.rb: remove autoload from psych
+ * ext/psych/lib/psych/json.rb: ditto
- * template/ruby.pc.in: add missing variables for mswin.
+Tue Nov 22 00:44:59 2011 Tanaka Akira <akr@fsij.org>
-Sat Oct 30 10:24:35 2010 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+ * test/ruby/test_io.rb (test_fcntl_dupfd): the argument of F_DUPFD is
+ minimum file descriptor.
- * object.c: Make BasicObject.new accept no parameter.
- Revert of r26135 [ruby-core:27080], as per [ruby-core:32952].
+Tue Nov 22 00:25:17 2011 Tanaka Akira <akr@fsij.org>
-Sat Oct 30 09:40:54 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (linux_get_maxfd): get rid of a warning.
- * enum.c: use constants in id.h.
+Mon Nov 21 23:39:14 2011 Tanaka Akira <akr@fsij.org>
-Sat Oct 30 09:08:27 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (linux_get_maxfd): new function to find maximum fd on Linux.
+ (rb_close_before_exec): use linux_get_maxfd.
- * ext/fiddle/closure.c (fiddle_closure): embed cif not reference
- so that the content surely get initialized. [ruby-dev:42480]
+Mon Nov 21 06:16:24 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Sat Oct 30 07:01:53 2010 Tanaka Akira <akr@fsij.org>
+ * cont.c (fiber_switch): ignore fiber context switch
+ because destination fiber is same as current fiber.
+ With out this, it may segv on FreeBSD 9.
+ patched by Koichi Sasada.
- * lib/resolv-replace.rb: suppress warning.
+Sun Nov 20 23:22:42 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * lib/open-uri.rb: ditto.
+ * ext/extmk.rb (extract_makefile, extmake): regenerate makefiles
+ if globbed source file list is changed.
-Sat Oct 30 06:32:52 2010 Tanaka Akira <akr@fsij.org>
+ * lib/mkmf.rb (create_makefile): store ORIG_SRCS.
- * test/pathname/test_pathname.rb (TestPathname#test_grpowned?): the
- group of the created file is inherited from the parent
- directory on BSDs and MacOS X. Linux also inherit the group if
- the setgid bit of the directory is set. It causes the test fail.
- fixed by Shota Fukumori. [ruby-dev:42458]
+Sun Nov 20 22:43:03 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Sat Oct 30 05:58:54 2010 Tanaka Akira <akr@fsij.org>
+ * enc/unicode.c (PROPERTY_NAME_MAX_SIZE): +1.
+ reported by Ken Takata. [ruby-dev:44894][Bug #5652]
- * lib/resolv.rb: retry via TCP if UDP reply is truncated.
- fixed by Julian Mehnle. [ruby-core:32407]
+Sun Nov 20 11:01:28 2011 Tanaka Akira <akr@fsij.org>
-Sat Oct 30 00:35:13 2010 Koichi Sasada <ko1@atdot.net>
+ * lib/set.rb (SortedSet.setup): remove old_init after initialize
+ method is redefined. The remove before redefinition makes the
+ warning prevention fragile. [ruby-dev:44892]
- * iseq.c (iseq_s_compile): fix optional argument.
- a patch from Yutaka HARA [ruby-core:32953] [Ruby 1.9-Bug#4001]
+Sun Nov 20 04:01:45 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Oct 30 00:24:42 2010 Koichi Sasada <ko1@atdot.net>
+ * Makefile.in (enc/unicode/name2ctype.h): remove duplicated
+ ifdefs.
- * ext/objspace/objspace.c (memsize_of): take care of
- T_CLASS/const_tbl.
- a patch from nagachika <nagachika00@gmail.com> [ruby-dev:42490]
+Sat Nov 19 19:31:47 2011 Tanaka Akira <akr@fsij.org>
-Fri Oct 29 23:32:36 2010 Koichi Sasada <ko1@atdot.net>
+ * time.c (TIME_COPY_GMT): copy vtm.utc_offset and vtm.zone too.
+ patch by Tomoyuki Chikanaga.
+ [ruby-dev:44827] [Bug #5586]
- * test/profile_test_all.rb: added.
- You can use test-all profiler with the following command:
- RUBY_TEST_ALL_PROFILE=true make test-all
- This command generates ./test_all_profile and you can analyze
- which tests consume memories.
+Sat Nov 19 16:36:57 2011 Tanaka Akira <akr@fsij.org>
- * test/runner.rb: ditto.
+ * test/net/http/test_http.rb: remove temporally files in ensure clause.
-Fri Oct 29 10:02:03 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Sat Nov 19 08:18:41 2011 Tanaka Akira <akr@fsij.org>
- * tool/enc-unicode.rb,
- enc/unicode/name2ctype.h, enc/unicode/name2ctype.h.blt,
- enc/unicode/name2ctype.kwd, enc/unicode/name2ctype.src:
- Add 'Unknown' Script.
- patched by Run Paint Run Run. [ruby-core:32937] #3998
+ * test/net/http/test_http.rb: remove temporally files.
-Fri Oct 29 05:13:34 2010 Koichi Sasada <ko1@atdot.net>
+Fri Nov 18 17:18:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/objspace/objspace.c (ObjectSpace.memsize_of_all): rename
- ObjectSpace.total_memsize_of_all_objects() to
- ObjectSpace.memsize_of_all([klass]).
- Accept Class object to filter the objects.
+ * ext/io/console/console.c (console_raw, console_set_raw)
+ (console_getch): optional parameters. [EXPERIMENTAL]
- * test/objspace/test_objspace.rb: fix test for above change.
+Fri Nov 18 16:12:11 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Oct 29 03:04:16 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/io/console/console.c (console_cooked, console_set_cooked):
+ new methods to reset cooked mode. [EXPERIMENTAL]
- * string.c (rb_str_dump): fix expected length. [ruby-core:32935]
+Fri Nov 18 13:20:26 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Thu Oct 28 23:31:39 2010 Koichi Sasada <ko1@atdot.net>
+ * test/unit/assertions.rb (MINI_DIR): quick dirty hack to get rid of
+ warnings when using assert/assert_respond_to.
- * gc.c (before_gc_sweep, run_final): fix decrement timing of final_num.
+Fri Nov 18 13:03:38 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Thu Oct 28 20:11:30 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * io.c (rb_cloexec_open): set O_NOINHERIT instead of O_CLOEXEC if it is
+ available (for Windows).
- * tool/enc-unicode.rb,
- enc/unicode/name2ctype.h, enc/unicode/name2ctype.h.blt,
- enc/unicode/name2ctype.kwd, enc/unicode/name2ctype.src:
- Update Oniguruma for Unicode 6.
- patched by Run Paint Run Run. [ruby-core:32923] #3989
+ * win32/win32.c (fcntl): on F_DUPFD, determine the inheritance of the
+ new handle by O_NOINHERIT flag of original fd.
-Thu Oct 28 20:06:25 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Fri Nov 18 08:00:41 2011 Ryan Davis <ryand-ruby@zenspider.com>
- * include/ruby/oniguruma.h (ONIGENC_CTYPE_SPECIAL_MASK):
- change mask from 128 to 256. [ruby-core:32931]
+ * lib/minitest/*: Imported minitest 2.8.1 (r6750)
+ * test/minitest/*: ditto
+ * configure.in: Improved gcc-llvm error message to help people migrate.
-Thu Oct 28 12:06:54 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Nov 17 20:43:34 2011 Tanaka Akira <akr@fsij.org>
- * lib/webrick/httprequest.rb (read_request_line): extend max
- length to 2083. This is from Internet Explorer's max uri
- length. http://support.microsoft.com/kb/208427 [ruby-core:32924]
+ * ext/dbm/extconf.rb: revert a part of the patch in [ruby-dev:41531].
+ don't use db.h with other headers. [ruby-dev:44884].
-Thu Oct 28 04:00:08 2010 Koichi Sasada <ko1@atdot.net>
+Thu Nov 17 20:23:03 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * gc.c (GC.stat): added. [ruby-dev:38607]
+ * benchmark/bm_io_select[23].rb: use Process::RLIMIT_NOFILE only when
+ it is defined. if it is not defined, assume 64 as the max of fds.
- * test/ruby/test_gc.rb: add a test for above.
+Thu Nov 17 10:36:46 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Thu Oct 28 03:13:06 2010 Koichi Sasada <ko1@atdot.net>
+ * ext/psych/lib/psych.rb (load_file): make sure opened yaml files are
+ also closed. [ruby-core:41088]
- * ext/objspace/objspace.c (memsize_of): fix rdoc.
+Wed Nov 16 18:13:52 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/objspace/objspace.c (total_memsize_of_all_objects): added.
+ * Makefile.in (LIBRUBY_A): check if generated linked library is
+ valid for extconf.
- * test/objspace/test_objspace.rb:
- - add a test for ObjectSpace.total_memsize_of_all_objects.
- - add two tests for ObjectSpace.memsize_of (for nil and Fixnum).
+Wed Nov 16 13:51:40 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Oct 27 23:55:27 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * bignum.c (rb_big2ulong): need to calc in unsigned long, because
+ the range of VALUE is larger than it on LLP64 platform, such as Win64.
+ this change fixes the failures of test/-ext-/num2int.
- * ext/iconv/iconv.c (Init_iconv): warn deprecated use.
+Wed Nov 16 12:02:47 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Oct 27 18:50:17 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/webrick/test_cgi.rb (TestWEBrickCGI#start_cgi_server): there are
+ no guarantee of existence of RbConfig::CONFIG['LIBPATHENV'].
+ it only exists in Unix-like environments.
- * bignum.c (rb_big2long, rb_big2ulong): rb2ulong() returns VALUE, but
- its real range is ulong. So, if the size of VALUE is bigger than
- ulong, upper bits are always zero even if the actual value is
- negative.
- fixed #3490
+ * test/webrick/test_filehandler.rb
+ (WEBrick::TestFileHandler#test_script_disclosure): ditto.
-Wed Oct 27 18:27:17 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+Wed Nov 16 11:34:20 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * test/ruby/test_io.rb (TestIO#pipe): should close write end of pipe
- before closing read end, to get rid of timing problem.
+ * io.c (argf_next_argv): wrong timing of setting ecflags.
+ fixed the failure of TestArgf#test_textmode introduced at r33662.
- * test/ruby/test_io_m17n.rb (TestIO_M17N#pipe): ditto.
+Wed Nov 16 10:45:00 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Oct 27 18:14:27 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/-test-/num2int/num2int.c: remove an unnecessary and wrong decl
+ of rb_stdout. it's declared in ruby.h correctly.
- * win32/win32.c (rb_w32_getppid): support Win64.
+Wed Nov 16 10:26:41 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Oct 27 15:07:19 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * bignum.c (rb_big2ull): add a cast to get rid of a VC++ warning.
- * thread_win32.c (w32_error): should get error no only once, because
- the result of the second getting will indicate the error of the
- first FormatMessage() call.
+Wed Nov 16 09:39:27 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Oct 27 13:51:25 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/minitest/unit.rb (assert_raises): experimental fix to run
+ correctly on chkbuild over 64bit linux. call exception_details only
+ when the detail is really needed to avoid create needless inspect
+ under ulimit-ed environment.
- * test/ruby/test_io.rb (TestIO#pipe): need to propagate exceptions
- in read/write thread. fix r29541.
+Wed Nov 16 06:34:30 2011 Tanaka Akira <akr@fsij.org>
- * test/ruby/test_io_m17n.rb (TestIO_M17N#pipe): ditto.
+ * test/ruby/test_thread.rb (test_condvar_timed_wait): use
+ assert_operator.
-Wed Oct 27 12:05:40 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Nov 15 21:56:25 2011 Tanaka Akira <akr@fsij.org>
- * class.c (clone_const): need to return value. fix r29602.
+ * test/ruby/test_sleep.rb (test_sleep_5sec): 0.1sec tolerance is too
+ small for busy environment.
-Wed Oct 27 11:58:58 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Nov 15 20:08:55 2011 Tanaka Akira <akr@fsij.org>
- * include/ruby/ruby.h (NUM2LONG_internal): add cast to get rid of a
- non GCC compiler warning. this is intentional type conversion.
+ * io.c, thread.c, ext/pty/pty.c, ext/fiddle/closure.c: use
+ __linux__ macro for consistency.
-Wed Oct 27 09:25:46 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Tue Nov 15 14:45:15 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * cont.c: apply documentation patch by Run Paint Run Run.
- [ruby-core:32915]
+ * include/ruby/ruby.h(NUM2LONG, NUM2INT, NUM2SHORT, NUM2LL,
+ INT2NUM, UINT2NUM, LONG2NUM, ULONG2NUM, NUM2CHR): wrap by
+ macros.
-Wed Oct 27 02:12:10 2010 Yusuke Endoh <mame@tsg.ne.jp>
+Tue Nov 15 13:38:14 2011 Naohisa Goto <ngotogenome@gmail.com>
- * object.c (Init_Object), constant.h, variable.c
- (rb_mod_private_constant, rb_mod_public_constant,
- set_const_visibility, rb_const_get_0): add Module#public_constant
- and private_constant. [ruby-dev:39685][ruby-core:32698]
+ * include/ruby/defines.h (FLUSH_REGISTER_WINDOWS): move sparc asm code
+ to a separate file sparc.c for preventing inlining optimization.
+ Patched by Jurij Smakov. [Bug #5244] [ruby-core:40685]
+ * sparc.c (rb_sparc_flush_register_windows): ditto.
+ * configure.in: ditto.
- * test/ruby/test_module.rb: add tests for above.
+Tue Nov 15 13:11:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Wed Oct 27 02:02:54 2010 Yusuke Endoh <mame@tsg.ne.jp>
+ * include/ruby/ruby.h: get rid of gcc specific rb_long2int(),
+ NUM2LONG(), NUM2INT(), NUM2SHORT(), NUM2LL(), INT2NUM(),
+ UINT2NUM(), LONG2NUM(), ULONG2NUM() and NUM2CHR()
+ implementation. Because 1) They don't make any better code
+ at all. 2) Inline function have a better debugger supoort.
- * class.c, constant.h, gc.c, method.h, object.c, variable.c,
- vm_insnhelper.c: use struct rb_constant_entry_t as entry of
- RCLASS_CONST_TBL. RCLASS_CONST_TBL has contained VALUE of constant
- directly. Now instead rb_const_entry_t is contained in
- RCLASS_CONST_TBL, rb_const_entry_t is managed by malloc, and
- have not only the value itself but also visibility flag.
- This is another preparation for private constant (see
- [ruby-dev:39685][ruby-core:32698]).
+Tue Nov 15 09:58:25 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Wed Oct 27 01:56:34 2010 Yusuke Endoh <mame@tsg.ne.jp>
+ * test/ruby/test_io.rb (TestIO#test_fcntl_dupfd): fix OpenBSD test
+ failure. [ruby-dev:44872]
- * class.c, gc.c, object.c, variable.c, vm_insnhelper.c,
- include/ruby/ruby.h: separate RCLASS_CONST_TBL from RCLASS_IV_TBL.
- RCLASS_IV_TBL has contained not only instance variable table but
- also constant table. Now the two table are separated to
- RCLASS_CONST_TBL and RCLASS_IV_TBL. This is a preparation for
- private constant (see [ruby-dev:39685][ruby-core:32698]).
+Tue Nov 15 09:50:21 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Tue Oct 26 18:51:00 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * regcomp.c (print_indent_tree): fix double printing of ENCLOSE_OPTION
+ children bug. patched by Suraj Kurapati. [ruby-core:40964]
- * lib/scanf.rb (extract_float): allow 2.e+2 style.
- [ruby-dev:42452] #3978
+Tue Nov 15 01:53:48 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Tue Oct 26 18:09:36 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_io.rb (test_fcntl_dupfd): fix test error on
+ SnowLeopard. Pointed out by CHIKANAGA Tomoyuki. [ruby-dev:44866]
- * Makefile.in (ASFLAGS): needs INCFLAGS.
+Mon Nov 14 22:06:02 2011 Tanaka Akira <akr@fsij.org>
- * configure.in (rb_cv_dynamic_alloca): check if extra source for
- dynamic size alloca.
+ * ext/openssl/ossl_pkey.c (ossl_pkey_new_from_file): set close-on-exec
+ flag.
- * missing/x86_64-chkstk.s (___chkstk): necessary for alloca of
- amd64-mingw32msvc-gcc on Ubuntu.
+ * ext/openssl/ossl_x509cert.c (rb_fd_fix_cloexec): ditto.
- * thread_win32.c (ruby_alloca_chkstk): check stack overflow
+Mon Nov 14 14:54:17 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Oct 26 18:04:53 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * bignum.c (rb_big2ull): fix 32bit platform breakage. we must
+ not assume sizeof(VALUE) == sizeof(LONG_LONG).
+ * test/-ext-/num2int/test_num2int.rb (class TestNum2int):
+ fix false assumption on 32bit platform.
- * template/ruby.pc.in (Libs): needs DLDFLAGS.
+Mon Nov 14 14:52:54 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Oct 26 12:47:10 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * numeric.c (rb_fix2ushort): fix typo. use num rb_num2ushort()
+ instead of num2uint().
- * common.mk (pkgconfig-data): moved from Makefile.in.
+Sun Nov 13 10:31:03 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * tool/rbinstall.rb: install pc file only if non-empty.
- [ruby-core:32901] #3983
+ * include/ruby/ruby.h: add #ifdef comment.
- * win32/Makefile.sub (ruby_pc): create pc file.
+Sun Nov 13 10:28:18 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Tue Oct 26 09:13:34 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * include/ruby/ruby.h: add NUM2SHORT(), NUM2USHORT() macros.
+ * numeric.c: ditto.
- * configure.in (rb_cv_gcc_atomic_builtins): check for atomic
- builtins, all are not available in Apple derivative gcc.
+ * test/-ext-/num2int/test_num2int.rb: add testcases for NUM2SHORT().
+ * ext/-test-/num2int/num2int.c: ditto.
-Tue Oct 26 00:29:26 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Nov 13 10:23:48 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * Makefile.in (pkgconfig-data): create pkg-config metadata file.
+ * bignum.c (rb_big2ull): fix off-by-twice bug of NUM2ULL.
+ * test/-ext-/num2int/test_num2int.rb (class TestNum2int):
+ fix a testcase too.
- * tool/rbinstall.rb: install pkg-config metadata file.
+Sun Nov 13 10:22:44 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * template/ruby.pc.in: template of pkg-config metadata file.
+ * test/-ext-/num2int/test_num2int.rb (class TestNum2int):
+ add FIXNUM tests.
-Mon Oct 25 16:38:07 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+Sun Nov 13 09:57:29 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * signal.c (rb_atomic_t): GCC (of at least recent versions)
- has ubiquitous support for atomic operations. On that
- compiler a C program can issue a memory barrier using these
- dedicated instructions. According to the GCC manual they
- cargo culted this feature form the Itanium ABI so chances
- are that other compilers could also support this feature.
- But so far GCC is the only compiler that I know to have it.
- Also note that this works on non-Itanium machines.
+ * numeric.c (check_uint): fix off-by-one bug of NUM2UINT.
+ * bignum.c (rb_big2ulong): fix off-by-one bug of NUM2ULONG.
-Mon Oct 25 06:21:35 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/-ext-/num2int/test_num2int.rb: add a testcase for NUM2INT()
+ NUM2UINT(), NUM2LONG(), NUM2ULONG(), NUM2LL and NUM2ULL().
+ * ext/-test-/num2int/depend: ditto.
+ * ext/-test-/num2int/extconf.rb: ditto.
+ * ext/-test-/num2int/num2int.c: ditto.
- * vsnprintf.c (BSD_vfprintf): prec digits fractal part should be
- appended to 0 if prec is given. [ruby-dev:42453] #3979
+Sun Nov 13 23:47:29 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Oct 25 02:57:21 2010 Koichi Sasada <ko1@atdot.net>
+ * ext/dbm/extconf.rb: use convertible_int.
- * common.mk (run.gdb): Quit gdb on 'make gdb' when
- no signals are received.
+Sun Nov 13 23:45:57 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Oct 25 00:25:23 2010 Tadayoshi Funaba <tadf@dotrb.org>
+ * lib/mkmf.rb (checking_for): should not modify the result.
- * lib/date.rb: some corrections of documentation.
+ * lib/mkmf.rb (have_struct_member): accept compiler options.
-Sun Oct 24 17:14:00 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/mkmf.rb (convertible_int): add restricted support of struct
+ member, and TYPEOF_ macro.
- * array.c, gc.c, hash.c, object.c, string.c, struct.c,
- transcode.c, variable.c, vm.c, vm_insnhelper.c, vm_method.c:
- replace calls to rb_error_frozen() with rb_check_frozen(). a
- patch from Run Paint Run Run at [ruby-core:32014]
+Sun Nov 13 23:21:24 2011 Tanaka Akira <akr@fsij.org>
- * include/ruby/intern.h (rb_check_frozen): optimize.
- [ruby-core:32878]
+ * ext/gdbm/gdbm.c (fgdbm_reorganize): set close-on-exec flag after
+ gdbm_reorganize(). gdbm_reorganize() opens a new database internally.
-Sun Oct 24 15:16:30 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Nov 13 19:57:18 2011 Tanaka Akira <akr@fsij.org>
- * lib/test/unit.rb (Test::Unit::Mini#run): abort if interrupted.
+ * ext/dbm/extconf.rb: rollback for each headers for each libraries.
- * lib/test/unit.rb (Test::Unit::Mini#run_test_suites): show the
- result even when interrupted on the way.
+Sun Nov 13 16:24:48 2011 Tanaka Akira <akr@fsij.org>
- * lib/test/unit.rb (Test::Unit::Mini#run_test_suites): ensure
- output sync mode to be restored.
+ * ext/dbm/extconf.rb: treat libc as a choice for a library which
+ provide ndbm API.
-Sun Oct 24 14:11:16 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Nov 13 15:40:43 2011 Tanaka Akira <akr@fsij.org>
- * vm.c (vm_define_method): defined method is run with the default
- public visibility regardless the visibility context of definition.
- [ruby-core:30638]
+ * ext/dbm/extconf.rb: duplicate $libs and $defs when save them.
-Sun Oct 24 12:08:54 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+Sun Nov 13 12:43:48 2011 Tanaka Akira <akr@fsij.org>
- * lib/test/unit.rb: make test/unit play nicely with the rake test
- loader. [ruby-core:32864]
+ * ext/dbm/extconf.rb: rollback $libs and $defs when db detection is
+ failed. It fixes -lgdbm -lqdbm when the system has qdbm and gdbm
+ without gdbm_compat.
-Sun Oct 24 00:25:13 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Nov 12 21:14:51 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/ruby/test_rubyoptions.rb (test_segv_test): follow up the
- change at r29556.
+ * test/webrick/test_cgi.rb (class TestWEBrickCGI): respect
+ RbConfig::CONFIG["LIBPATHENV"]. [Bug #5135] [ruby-core:38653]
+ * test/webrick/test_filehandler.rb (class WEBrick): ditto.
-Sat Oct 23 14:39:58 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Nov 12 20:57:29 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * lib/mkmf.rb: $extmk should be true for test/runner.
+ * test/ruby/test_io.rb (test_fcntl_dupfd): skip if Fcntl::DUPFD
+ is not defined. Pointed out by CHIKANAGA Tomoyuki. Thanks.
-Sat Oct 23 10:55:37 2010 Koichi Sasada <ko1@atdot.net>
+Sat Nov 12 17:26:10 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vm_dump.c (rb_vm_bugreport): fix to add bug outputs.
- - loaded script ($0)
- - loaded features ($")
- - process memory map on Linux (/proc/self/maps)
+ * io.c (do_ioctl, ioctl_narg_len, setup_narg, rb_ioctl): use
+ ioctl_req_t.
- * vm_dump.c (rb_vmdebug_stack_dump_raw): fix header message.
+Sat Nov 12 17:01:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Oct 22 14:50:13 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/dbm/extconf.rb (headers.db_check): reduce duplicated code.
- * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert):
- assertion message must not be nil.
+Sat Nov 12 15:59:42 2011 Tanaka Akira <akr@fsij.org>
-Fri Oct 22 13:59:50 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/dbm/extconf.rb: dbm_clearerr should be available in all ndbm
+ implementation. If it is not available, it is caused by
+ header/library mismatch such that Berkeley DB header & gdbm library.
- * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert):
- treat nil case. Please run test-all before commit such change.
+ * ext/dbm/dbm.c (fdbm_store): use dbm_clearerr() unconditionally.
+ gdbm 1.9 provides it as a real function instead of a empty macro.
-Thu Oct 21 23:58:14 2010 Koichi Sasada <ko1@atdot.net>
+Sat Nov 12 13:35:33 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * gc.c (gc_lazy_sweep): Variable declarations should be at
- the head of block.
+ * bootstraptest/runner.rb: don't suppress SIGINT.
+ [Feature #5612] [ruby-dev:44856]
-Thu Oct 21 23:56:54 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Nov 12 11:20:36 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * gc.c (objspace_each_objects, rb_objspace_each_objects): use
- struct.
+ * io.c (fcntl_narg_len): introduce narg calculation for fcntl instead
+ of hard coded 256.
+ * io.c (setup_narg): ditto.
- * gc.c (objspace_each_objects): fix return with no value.
+Sat Nov 12 11:19:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Thu Oct 21 23:47:12 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_io.rb (test_fcntl_dupfd): add another fcntl test.
- * dir.c (dir_initialize): remove useless intermediate variable.
+Sat Nov 12 11:18:17 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Thu Oct 21 16:07:20 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/ruby/test_io.rb (test_fcntl_lock_freebsd): add a testcase
+ of fcntl lock for freebsd.
- * io.c (rb_f_select): change rdoc.
- patched by Eito Katagiri [ruby-core:31805]
+Sat Nov 12 11:16:32 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Thu Oct 21 15:55:21 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * io.c (ioctl_narg_len): Linux doesn't have IOCPARM_LEN macro, but
+ has _IOC_SIZE. support it.
- * lib/webrick/httpauth/digestauth.rb
- (WEBrick::HTTPAuth::ProxyDigestAuth#check_uri): privated.
- [ruby-dev:42344]
+Sat Nov 12 11:13:18 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Thu Oct 21 15:50:25 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * io.c (rb_ioctl): don't expose our sanity check value to ruby script.
+ It may change string value meaning if the value is string.
+ (e.g. MacOS X has F_GETPATH ioctl)
+ * io.c (rb_fcntl): ditto.
- * io.c (rb_f_select): add correct rdoc.
- patched by Dave Thomas [ruby-core:32467]
+Sat Nov 12 11:06:02 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Thu Oct 21 15:42:01 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * io.c (ioctl_req_t): Type of req argument of ioctl() depend on platform.
+ Moreover almost all linux ioctl can't be represented by 32bit integer
+ (i.e. MSB is 1). We need wrap ioctl argument type.
+ [Bug #5429] [ruby-dev:44589]
+ * io.c (struct ioctl_arg): ditto.
+ * io.c (rb_ioctl): ditto.
+ * test/ruby/test_io.rb (test_ioctl_linux): add a testcase for ioctl
- * lib/net/telnet.rb (Net::Telnet#close): added.
- patched by Erik Hollensbe [ruby-dev:42260] #3830
+Sat Nov 12 11:00:42 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Thu Oct 21 13:08:00 2010 Narihiro Nakamura <authornari@gmail.com>
+ * io.c (struct io_cntl_arg): remove io_p member.
+ * io.c (nogvl_fcntl, do_fcntl, rb_fcntl): separated from ioctl functions.
+ * io.c (nogvl_io_cntl): remove fcntl depended logic.
+ * io.c (io_cntl): ditto.
+ * io.c (rb_io_ctl): ditto.
+ * io.c (rb_io_ioctl): ditto.
- * gc.c (rb_objspace_each_objects): don't lazy sweep in
- rb_objspace_each_objects. [Bug #3940] [ruby-dev:42369]
+Sat Nov 12 10:59:49 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Thu Oct 21 00:05:45 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (setup_narg): fix off by one bug.
- * test/ruby/test_io.rb (TestIO#pipe): get rid of deadlock on pipe.
- a patch from Tomoyuki Chikanaga at [ruby-dev:42435]. #3970
+Sat Nov 12 10:56:43 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/ruby/test_io_m17n.rb (TestIO_M17N#pipe): ditto.
+ * io.c (+setup_narg): factor out length calculation logic.
+ * io.c (rb_io_ctl): ditto.
-Wed Oct 20 23:54:36 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Nov 12 10:52:17 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/dbm/dbm.c: rdoc based on a patch by mathew meta AT
- pobox.com, at [ruby-core:32853].
+ * io.c (+ioctl_narg_len) new helper function.
+ * io.c (rb_io_ctl): don't use ioctl specific length check
+ if caller is fcntl.
-Wed Oct 20 10:47:21 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Fri Nov 11 23:00:46 2011 Tanaka Akira <akr@fsij.org>
- * util.c (ruby_strtod): reject 0x1.p+0. [ruby-dev:42432] #3966
+ * ext/dbm/extconf.rb: db_prefix is not required now.
-Wed Oct 20 10:00:57 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Fri Nov 11 21:13:30 2011 Tanaka Akira <akr@fsij.org>
- * vsnprintf.c (BSD_vfprintf): print floating point on "%#a".
- [ruby-dev:42431] Bug#3965
+ * ext/gdbm/gdbm.c (fgdbm_initialize): use GDBM_CLOEXEC if available.
-Tue Oct 19 19:30:11 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Fri Nov 11 21:00:05 2011 Tanaka Akira <akr@fsij.org>
- * vsnprintf.c (BSD_vfprintf): clear ALT flag for %a.
- [ruby-core:32841] [ruby-core:32848]
+ * ext/dbm/extconf.rb: fix dbm_pagfno and dbm_dirfno detection with
+ Berkeley DB. Macro definitions needs arguments to detect correctly.
+ SIZEOF_DSIZE needs -DDB_DBM_HSEARCH because db.h defines datum type
+ only if DB_DBM_HSEARCH is defined.
-Tue Oct 19 12:19:25 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Nov 11 18:41:57 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vsnprintf.c (BSD_vfprintf): fix over-count of field size.
+ * process.c (proc_seteuid): separate an internal wrapper function
+ from the method implementation.
-Tue Oct 19 03:08:52 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Nov 11 17:21:15 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * vsnprintf.c (BSD_vfprintf): use HEXPREFIX flag for prefix of %a.
- [ruby-core:32841]
+ * lib/mkmf.rb (have_library, find_library, have_func): allow
+ arguments of function to be checked.
-Mon Oct 18 13:18:01 2010 Akinori MUSHA <knu@iDaemons.org>
+Fri Nov 11 17:09:45 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/digest/digest.c (rb_digest_class_init): Define
- Digest::Class.new(). [Feature #3954]
+ * vm_dump.c (HAVE_BACKTRACE): fallback to 0.
-Mon Oct 18 12:58:40 2010 Tanaka Akira <akr@fsij.org>
+ * vm_dump.c (rb_vm_bugreport): show "Other runtime information"
+ header only when available.
- * pack.c (pack_pack): refine the document. [ruby-dev:42397]
- (pack_unpack): ditto.
+ * vm_dump.c (rb_vm_bugreport): get rid of modifying the content of
+ VM directly.
-Mon Oct 18 10:19:00 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * vm_dump.c (rb_vm_bugreport): check if vm is non-null.
+ Pointed out by Ikegami Daisuke <ikegami.da@gmail.com>.
+ Thank you.
- * lib/net/http.rb (transport_request): @socket may be nil.
- patched by Egbert Eich [ruby-core:32829]
+Fri Nov 11 12:36:37 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Mon Oct 18 09:57:28 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * io.c (pipe_open): Remove fflush(stdin). it's no effect.
+ Pointed out by Ikegami Daisuke <ikegami.da@gmail.com>.
+ Thank you.
- * sprintf.c (BSD_vfprintf): wrong padding around prefix and
- floating point with %a. [ruby-dev:42403] Bug #3956
+Fri Nov 11 07:33:30 2011 Eric Hodel <drbrain@segment7.net>
-Sun Oct 17 22:36:33 2010 Tadayoshi Funaba <tadf@dotrb.org>
+ * lib/net/http.rb (Net::HTTP::SSL_ATTRIBUTES): Use symbol keys instead
+ of string keys to avoid duplicating parameters in
+ OpenSSL::SSL:SSLContext#set_params.
- * lib/date/delta.rb: added an rdoc tag.
+Thu Nov 10 15:02:37 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Oct 17 10:47:12 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/mkmf.rb (have_library, have_func, have_var, have_header):
+ add compiler option parameter.
- * variable.c (rb_mod_remove_const): update rdoc.
- [ruby-core:31957]
+Thu Nov 10 07:45:16 2011 Eric Hodel <drbrain@segment7.net>
-Sun Oct 17 10:40:17 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/lib/openssl/ssl.rb (class OpenSSL::SSL::SSLContext):
+ Document #set_params.
- * class.c (rb_define_{class,module}_id_under): register to be
- marked, which probably are defined and used internally.
+Wed Nov 9 11:36:53 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Sat Oct 16 11:10:55 2010 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * thread_pthread.c (gvl_yield): don't prevent concurrent sched_yield().
+ [Bug #5130] [ruby-core:38647]
- * ext/win32ole/win32ole.c (ole_encoding2cp): set codepage 20936
- according to GB2312. [Bug #3937] [ruby-core:32758]
+Wed Nov 9 23:20:22 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Oct 16 10:54:57 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (rb_update_max_fd): fstat(2) can fail with other than
+ EBADF. [ruby-dev:44837] [Bug #5593]. Cf.
+ http://pubs.opengroup.org/onlinepubs/9699919799/functions/fstat.html
- * Makefile.in (CPP): already used in .c.i rule.
+ * io.c (rb_sysopen): max fd is updated in rb_sysopen_internal()
+ already.
- * cygwin/GNUmakefile.in (DLLWRAP, WINDRES): add --driver-name and
- --preprocessor options explicitly. [ruby-core:32776]
+Wed Nov 9 22:13:38 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Oct 16 10:06:08 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_file.rb (TestFile#test_utime_with_minus_time_segv):
+ fixed previous commit.
- * ext/sdbm/_sdbm.c (SEEDUPS, BADMESS): make settable using command
- line options.
+Wed Nov 9 19:53:45 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/sdbm/_sdbm.c (makroom): suppress unused result warning.
+ * test/ruby/test_file.rb (TestFile#test_utime_with_minus_time_segv):
+ add test for r33685.
- * ext/sdbm/extconf.rb: disable BADMESS, a library should not emit
- messages directly.
+Wed Nov 9 19:00:44 2011 Koichi Sasada <ko1@atdot.net>
-Sat Oct 16 08:39:03 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_fiber.rb: add tests for r33684 (Fiber#resume).
- * dln.c (dln_strerror): get English message first, instead of
- system default. see [ruby-dev:42358].
+Wed Nov 9 16:40:49 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Sat Oct 16 00:08:00 2010 Koichi Sasada <ko1@atdot.net>
+ * win32/win32.c (unixtime_to_filetime): should check the return value
+ of localtime(). reported by snowjail at gmail.com.
+ [ruby-dev:44838] [Bug #5596]
- * hash.c (rb_hash_aref): skip calling "default" method
- if it is not needed, for speed-up.
+Thu Nov 9 13:17:25 2011 Koichi Sasada <ko1@atdot.net>
-Fri Oct 15 23:36:25 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * cont.c (rb_fiber_m_transfer, rb_fiber_resume): prohibit using
+ "resume" after "transfer" method are used. You should not mix
+ "resume" fiber and "transfer" fiber.
+ [Bug #5526]
- * file.c (NUM2DEVT, DEVT2NUM, PRI_DEVT_PREFIX): fallback to
- unsigned int.
+ * NEWS: add information about this change.
-Fri Oct 15 22:54:46 2010 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Wed Nov 9 11:40:37 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/win32ole/win32ole.c (ole_hresult2msg): get English message first,
- instead of system default. [ruby-core:32765]
+ * template/Doxyfile.tmpl (INCLUDE_PATH): add srcdir and include.
+ [ruby-core:40843] [Bug #5597]
-Fri Oct 15 22:47:31 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Nov 9 11:02:54 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * include/ruby/ruby.h (VALUE): prefer long over uintptr_t,
- FIX2LONG expects VALUE to be long at least.
+ * thread.c (do_select): fix cast, tv_sec is time_t.
- * include/ruby/ruby.h (FIX2LONG): parenthesize the argument.
+Wed Nov 9 10:32:20 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Oct 15 20:30:30 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in: should not use test -e for portability.
+ [ruby-core:40841] [Bug #5594]
- * configure.in (dev_t): use RUBY_REPLACE_TYPE.
+Wed Nov 9 04:52:16 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * file.c (rb_stat_inspect): use PRI_DEVT_PREFIX.
+ * ext/psych/lib/psych/tree_builder.rb: dump complex numbers,
+ rationals, etc with reference ids.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: ditto
+ * ext/psych/lib/psych/visitors/to_ruby.rb: loading complex numbers,
+ rationals, etc with reference ids.
+ * test/psych/test_object_references.rb: corresponding tests
-Fri Oct 15 17:26:57 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Tue Nov 8 23:34:37 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * pack.c (pack_pack): simplify comparison of explicit_endian
- as pointed by nobu.
+ * ext/dbm/dbm.c (fdbm_fetch, fdbm_key, fdbm_delete, fdbm_store)
+ (fdbm_has_key, fdbm_has_value): get rid of overflow.
- * pack.c (pack_unpack): ditto.
+ * ext/gdbm/gdbm.c (rb_gdbm_fetch2, rb_gdbm_nextkey)
+ (rb_gdbm_delete, fgdbm_store, fgdbm_has_key): ditto.
-Fri Oct 15 16:40:37 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/dbm/dbm.c (fdbm_delete_if): hide intermediate objects.
- * pack.c (pack_pack): fix more than one modifiers appear in the
- format string. [ruby-core:32793]
+ * ext/gdbm/gdbm.c (fgdbm_delete_if): ditto.
- * pack.c (pack_unpack): ditto.
+ * ext/dbm/extconf.rb: check size of datum.dsize to get rid of
+ overflow.
-Thu Oct 14 23:20:42 2010 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Tue Nov 8 23:30:21 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * test/win32ole/test_folderitem2_invokeverb.rb: refactoring.
+ * addr2line.c (PATH_MAX): define if not defined. [ruby-core:40840]
-Thu Oct 14 22:18:29 2010 Koichi Sasada <ko1@atdot.net>
+Tue Nov 8 23:26:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * insns.def, iseq.c, vm_insnhelper.c: rename variable name
- (ip -> iseq).
+ * ext/tk/tcltklib.c (rb_thread_critical): fix type.
-Thu Oct 14 20:41:27 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/tk/tcltklib.c (eventloop_sleep, lib_eventloop_core): int is
+ enough for micro seconds. may need to check overflow in the
+ setter though.
- * pack.c (pack_pack): support endian modifiers: < and >.
- [ruby-dev:42376] Feature #3491
+ * ext/tk/tcltklib.c (RSTRING_LENINT): check overflow if necessary.
- * pack.c (pack_unpack): ditto.
+ * ext/tk/tcltklib.c (RbTk_ALLOC_N): wrapper for ckalloc() which
+ takes an int.
-Thu Oct 14 20:50:51 2010 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+ * ext/tk/tcltklib.c (ip_ruby_cmd_receiver_get, tcltklib_compile_info):
+ get rid overflow.
- * ext/win32ole/win32ole.c (reg_get_val): expand environment in
- the pathname. [Bug #3907]
+ * ext/tk/tcltklib.c (tcltklib_compile_info): constified.
-Thu Oct 14 07:35:07 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Tue Nov 8 20:50:45 2011 Tanaka Akira <akr@fsij.org>
- * file.c (DEVT2NUM): added. Size of dev_t is depend on the
- environment even if POSIX defines dev_t as unsigned integer.
- For example, OpenVMS, 64bit Solaris 9, and NetBSD 6 defines
- dev_t as 64bit unsigned integer.
+ * test/dbm/test_dbm.rb: split tests for read only database.
- * file.c (rb_stat_dev): use DEVT2NUM.
+ * test/gdbm/test_gdbm.rb: ditto.
- * file.c (rb_stat_dev_major): dev_t is not long. major(3)'s return
- value is int.
+Tue Nov 8 18:59:07 2011 Tanaka Akira <akr@fsij.org>
- * file.c (rb_stat_dev_minor): dev_t is not long. minor(3)'s return
- value is int.
+ * ext/pty/pty.c (MasterDevice): define only when used.
+ (SlaveDevice): ditto.
+ (deviceNo): ditto.
- * configure.in: check size of dev_t.
+Tue Nov 8 17:59:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Oct 14 07:22:12 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * include/ruby/ruby.h (rb_long2int): define as a macro always, so
+ that cpp conditionals can tell if it is provided.
- * array.c (rb_ary_and, rb_ary_or), class.c (rb_mod_init_copy),
- gc.c (undefine_final), time.c (time_mload): get rid of
- type-punning casts.
+Tue Nov 8 17:30:50 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Oct 14 04:16:41 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/mkmf.rb (cpp_command): remove multiple -arch flags since cpp
+ cannot work.
- * numeric.c (ruby_float_step): fix Numeric#step with infinity unit
- doesn't works well. [ruby-core:32779]
+Tue Nov 8 14:50:55 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Oct 13 23:16:46 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (io_fwrite): call rb_w32_write_console() only if FMODE_TTY is
+ set. this is the one of the reason of IO writing slowness of Windows
+ in 1.9.3 or later.
- * tool/enc-unicode.rb: get rid of lots of warnings.
+Tue Nov 8 11:01:04 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * iseq.c (insn_operand_intern, rb_iseq_disasm): fix format specifiers.
+ * ext/pty/pty.c (get_device_once): FreeBSD 8 supported O_CLOEXEC flag
+ for posix_openpt, but FreeBSD 9's posix_openpt doesn't support
+ O_CLOEXEC and fails if specified.
- * vm.c (thread_free): ditto.
+Tue Nov 8 02:36:45 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * numeric.c (check_uint): get rid of overflow on LLP64 platforms.
+ * include/ruby/encoding.h (ECONV_NEWLINE_DECORATOR_READ_MASK,
+ ECONV_NEWLINE_DECORATOR_WRITE_MASK): new macro.
- * insns.def (opt_case_dispatch): use st_data_t.
+ * io.c (rb_io_extract_modeenc, pipe_open, prep_stdio, argf_next_argv):
+ set TEXTMODE_NEWLINE_DECORATOR_ON_WRITE for textmode on creating IO
+ if the flag is available.
-Wed Oct 13 22:32:34 2010 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
+ * io.c (make_writeconv): drop decorators for reading.
- * lib/cgi/util.rb (CGI::unescape): bugfix to unescape the multibyte
- string. Thanks nobu and tDiary dev members. [Bug #3909]
+ * io.c (make_readconv): drop decorators for writing.
-Wed Oct 13 21:13:00 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * io.c (do_writeconv): existing writeconv is not the condition to raise
+ ArgumentError. should check textmode or not.
- * numeric.c (int_chr): raise error when the value is negative.
+ * test/ruby/test_io_m17n.rb
+ (TestIO_M17N#test_{cr,lf,crlf}_decorator_on_stdout): test above
+ changes.
-Wed Oct 13 19:24:08 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+Mon Nov 7 22:03:47 2011 Tanaka Akira <akr@fsij.org>
- * vm.c (ruby_vm_destruct): This function type was wrong; correct to the prototype.
+ * ext/gdbm/gdbm.c (fgdbm_initialize): set close-on-exec flag.
-Wed Oct 13 14:58:09 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Nov 7 20:31:52 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * numeric.c (rb_num_to_uint): fix 32bit logic.
+ * ext/psych/lib/psych/scalar_scanner.rb: make sure strings that look
+ like base 60 numbers are serialized as quoted strings.
+ * test/psych/test_string.rb: test for change.
-Wed Oct 13 12:53:43 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Nov 7 20:26:37 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * numeric.c (rb_num_to_uint): added to check the range of arguments.
- Mainly for negative value with NUM2UINT on 32bit environment.
+ * test/psych/test_yamlstore.rb: make test case inherit from MiniTest,
+ load psych/helper so that psych is loaded.
- * string.c (rb_str_concat): use rb_num_to_uint.
+Mon Nov 7 20:18:29 2011 Aaron Patterson <aaron@tenderlovemaking.com>
-Wed Oct 13 12:10:02 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/psych/test_yamldbm.rb: Test case should inherit from MiniTest,
+ load psych/helper so that psych and friends are loaded.
- * thread_win32.c (w32_error): get English message first, instead
- of system default. see [ruby-core:32765].
- [experimental]
+Mon Nov 7 20:15:44 2011 Tanaka Akira <akr@fsij.org>
-Wed Oct 13 11:04:03 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/dbm/extconf.rb: check dbm_pagfno() and dbm_dirfno().
- * debug.c (ruby_set_debug_option): define always for binary
- compatibility with debug env enabled binary.
+ * ext/dbm/dbm.c: use above to set close-on-exec flag.
- * signal.c (ruby_enable_coredump): ditto.
+Mon Nov 7 20:05:16 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Oct 13 10:52:51 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (io_fflush): remove fsync().
- * include/ruby/ruby.h (ruby_executable_node): missing prototype.
+ * io.c (rb_io_flush, rb_io_rewind): fsync() here.
-Wed Oct 13 05:23:04 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ these changes reduces fsync() calls to improve performance.
+ first reported at [ruby-list:48515] by ak7 at mail.goo.ne.jp .
+ [Bug #5585]
- * missing/strchr.c: add strlen's prototype.
+Mon Nov 7 19:43:10 2011 Tanaka Akira <akr@fsij.org>
- * missing/strstr.c: ditto.
+ * io.c (rb_close_before_exec): use F_MAXFD if available.
+ F_MAXFD is available on NetBSD since NetBSD 2.0.
-Wed Oct 13 00:21:17 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Nov 7 19:25:16 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/syck/rubyext.c (struct mktime_arg): constified.
+ * test/ruby/test_io_m17n.rb
+ (TestIO_M17N#test_default_stdout_stderr_mode): new test for
+ r33627-33629. see [backport #5565]
- * ext/syck/rubyext.c (mktime_do, mktime_r, rb_syck_mktime): fix
- function signatures.
+Mon Nov 7 01:14:22 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Wed Oct 13 00:18:18 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/debug.rb: add help for 'pp' and 'r[estart]'. patch
+ from Sho Hashimoto. [Bug #5093] [ruby-dev:44222]
- * st.c (MurmurMagic): get rid of literal overflow.
+Sun Nov 6 14:49:58 2011 Tanaka Akira <akr@fsij.org>
- * configure.in (RUBY_CHECK_PRINTF_PREFIX): check for printf format
- specifier if possible.
+ * ext/socket/rubysocket.h (rsock_recvmsg): declared.
-Tue Oct 12 23:58:19 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/socket/ancdata.c (rsock_recvmsg): extracted from
+ nogvl_recvmsg_func.
+ (nogvl_recvmsg_func): use rsock_recvmsg.
- * win32/win32.c (rb_w32_open_osfhandle, rb_w32_wopen, rb_w32_pipe):
- use uintptr_t instead of long for win64.
+ * ext/socket/unixsocket.c (recvmsg_blocking): use rsock_recvmsg.
- * win32/win32.c (socketpair_internal): suppress warnings.
+Sun Nov 6 03:22:36 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * win32/win32.c (ftruncate): use HANDLE instead of long for win64.
+ * test/openssl/test_engine.rb: add test for engine cipher. RC4 is used
+ because AES is not supported by the "openssl" engine currently.
- * vsnprintf.c (BSD_vfprintf): fix cast.
+Sun Nov 6 00:11:52 2011 Tanaka Akira <akr@fsij.org>
- * numeric.c (rb_num2fix): result of rb_num2long is SIGNED_VALUE.
+ * lib/test/unit.rb (Test::Unit::Options#non_options): options[:ruby]
+ should be an array. This fixes
+ "./ruby test/runner.rb test/testunit/test_parallel.rb"
+ [ruby-dev:44782]
- * compile.c (iseq_build_body), error.c (set_syserr, get_syserr),
- (syserr_initialize), gc.c (define_final, rb_gc_copy_finalizer),
- (run_final), hash.c (rb_hash_aref, rb_hash_lookup2),
- (rb_hash_fetch_m, rb_hash_clear, rb_hash_aset, eql_i),
- iseq.c (iseq_load, iseq_data_to_ary), marshal.c (r_symlink),
- thread.c (rb_thread_local_aref),
- variable.c (generic_ivar_remove, ivar_get, rb_const_get_0),
- (rb_cvar_get), vm.c (rb_vm_check_redefinition_opt_method),
- vm_insnhelper.c (vm_get_ev_const), vm_method.c (remove_method),
- ext/iconv/iconv.c (map_charset): use st_data_t.
+Sat Nov 5 20:30:30 2011 Martin Duerst <duerst@it.aoyama.ac.jp>
- * compile.c (iseq_build_body), insns.def (getglobal, setglobal),
- iseq.c (iseq_load, iseq_data_to_ary), util.c (valid_filename):
- use VALUE.
+ * insns.def: Some fixes and tweaks to English explanations
- * gc.c (obj_free, rb_objspace_call_finalizer): fix truncating
- cast.
+Sat Nov 5 19:11:50 2011 Tanaka Akira <akr@fsij.org>
- * gc.c (mark_current_machine_context): suppress warnings.
+ * io.c (rb_cloexec_fcntl_dupfd): don't clear try_dupfd_cloexec if
+ fcntl(F_DUPFD) failed as fcntl(F_DUPFD_CLOEXEC).
- * compile.c (iseq_compile_each): fix truncating cast.
+Sat Nov 5 18:05:12 2011 Tanaka Akira <akr@fsij.org>
- * cont.c (fiber_setcontext): missing variable definition.
+ * ext/socket/socket.c (rsock_socketpair0): refactored.
-Tue Oct 12 19:25:13 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Sat Nov 5 17:55:52 2011 Tanaka Akira <akr@fsij.org>
- * error.c (exc_to_s): use OBJ_INFECT.
+ * ext/socket/init.c (rsock_socket0): don't clear try_sock_cloexec if
+ SOCK_CLOEXEC is not a reason for EINVAL.
- * error.c (name_err_to_s): ditto.
+Sat Nov 5 16:27:52 2011 Kazuki Tsujimoto <kazuki@callcc.net>
- * error.c (name_err_mesg_to_str): ditto.
+ * ext/pathname/lib/pathname.rb, ext/tk/lib/multi-tk.rb,
+ ext/tk/sample/demos-en/widget, lib/benchmark.rb, lib/irb/cmd/fork.rb,
+ lib/mkmf.rb, lib/net/ftp.rb, lib/net/smtp.rb, lib/open3.rb,
+ lib/pstore.rb, lib/rexml/element.rb, lib/rexml/light/node.rb,
+ lib/rinda/tuplespace.rb, lib/rss/maker/base.rb,
+ lib/rss/maker/entry.rb, lib/scanf.rb, lib/set.rb, lib/shell.rb,
+ lib/shell/command-processor.rb, lib/shell/process-controller.rb,
+ lib/shell/system-command.rb, lib/uri/common.rb: remove unused block
+ arguments to avoid creating Proc objects.
- * error.c (syserr_initialize): ditto.
+Sat Nov 5 15:45:04 2011 Tanaka Akira <akr@fsij.org>
-Tue Oct 12 19:07:55 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/socket/init.c (rsock_socket0): extract single socket() call with
+ CLOEXEC handling from rsock_socket.
- * error.c (syserr_initialize): taint message if mesg is given
- and it is tainted.
+Sat Nov 5 13:49:40 2011 Kazuki Tsujimoto <kazuki@callcc.net>
-Tue Oct 12 18:25:43 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/pathname.rb (Pathname#find): return an enumerator if
+ no block is given.
- * io.c (rb_io_ungetc): always see Bignum. On 32bit valid value
- may be a Bignum. On 64bit for errors. [ruby-dev:42366]
+ * test/pathname/test_pathname.rb: add tests for above.
-Tue Oct 12 18:25:04 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ [ruby-dev:44797] [Feature #5572]
- * string.c (rb_str_concat): use unsigned int for GB18030.
+Sat Nov 5 11:18:12 2011 Tanaka Akira <akr@fsij.org>
-Tue Oct 12 17:53:49 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/socket/socket.c (rsock_socketpair0): don't clear
+ try_sock_cloexec if SOCK_CLOEXEC is not a reason for EINVAL.
- * numeric (check_uint): the mask must refer to VALUE.
+Fri Nov 4 14:08:19 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
-Tue Oct 12 17:47:10 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/openssl/ossl_pkey_rsa.c (rsa_generate): [SECURITY] Set RSA
+ exponent value correctly. Awful bug. This bug caused exponent of
+ generated key to be always '1'. By default, and regardless of e
+ given as a parameter.
- * numeric (check_uint): set MSB for negative value.
+ !!! Keys generated by this code (trunk after 2011-09-01) must be
+ re-generated !!! (ruby_1_9_3 is safe)
- * numeric (rb_num2uint): return value's type of rb_num2ulong
- is VALUE.
+ * test/openssl/test_pkey_rsa.rb: Add tests for default exponent and
+ specifying exponent by a parameter.
- * numeric (int_chr): variable i can't be negative.
+Fri Nov 4 01:31:25 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Tue Oct 12 16:04:37 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * test/openssl/test_engine.rb: add first tests for builtin "openssl"
+ engine.
- * win32/win32.c (rb_w32_strerror): get English message first, instead
- of system default. see [ruby-dev:42358].
- [experimental]
+Fri Nov 4 08:41:26 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Tue Oct 12 15:52:35 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/openssl/extconf.rb:
+ * ext/openssl/ossl_engine.c: add some missing OpenSSL engines.
+ Thanks, Yui Naruse, for providing the patch!
+ [Bug #5548] [ruby-core:40670]
- * win32/win32.c (rb_w32_strerror): unmap some range of errno for
- workaround of VC10's strerror() and sys_nerr problem.
- based on a patch from Akio Tajima, [ruby-dev:42355].
+Fri Nov 4 04:54:10 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Oct 12 15:36:09 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * win32/configure.bat: disable delayed expansion of enironment variable.
+ [Bug #5517] [ruby-core:40531]
- * io.c (rb_io_ungetc): use unsigned int for GB18030.
+Fri Nov 4 03:45:22 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Oct 12 15:14:21 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * io.c (make_writeconv): fixed typo of previous commit.
- * io.c (rb_io_putc): support multibyte characters.
- [ruby-core:30697]
+Fri Nov 4 01:56:30 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Tue Oct 12 15:10:31 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * io.c (make_writeconv): unversal_newline converter is for reading.
+ so, if the io is text mode and has ECONV_UNIVERSAL_NEWLINE_DECORATOR
+ flag, use crlf_newline converter for writing.
+ this change fixes the problem about the luck of CR up Kernel.p and
+ Kernel.puts to stdout/stderr on Windows.
- * numeric.c (rb_enc_uint_chr): split from int_chr.
+Fri Nov 4 01:04:48 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * numeric.c (int_chr): use rb_enc_uint_chr.
+ * ext/readline/readline.c (Init_readline): like r18313, libedit's
+ replace_history_entry may use offset instead of which.
+ so introduce history_replace_offset_func and initialize it.
- * include/ruby/encoding.h (rb_enc_uint_chr): added.
+ * ext/readline/readline.c (hist_set): use history_replace_offset_func.
-Tue Oct 12 14:04:41 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Fri Nov 4 00:53:35 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * numeric.c (int_chr): a codepoint of Ruby M17N must be 32bit
- unsigned int; GB18030 uses MSB. Also note that OnigCodePoint
- is defined as unsigned int.
+ * ext/readline/readline.c (Init_readline): fix wrong condition.
-Tue Oct 12 12:20:54 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+Thu Nov 3 23:53:04 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * vm_dump.c (dump_thread): foolish mistake.
+ * encoding.c (rb_locale_charmap): ignore calling nl_langinfo_codeset()
+ on Windows except cygwin. [experimental]
-Tue Oct 12 10:39:08 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Nov 3 22:45:09 2011 Tanaka Akira <akr@fsij.org>
- * configure.in (RUBY_MINGW32): canonicalize only on mingw.
+ * ext/socket/socket.c (rsock_socketpair0): extracted from
+ rsock_socketpair to set close-on-exec flag for each socketpair()
+ call.
-Mon Oct 11 20:20:23 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Nov 3 22:12:41 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * lib/net/http.rb (HTTP.get): specify ASCII-8BIT as the result
- encoding of Zlib::GzipReader.
- http://hibari.2ch.net/test/read.cgi/tech/1281473294/271
+ * ext/socket/init.c (rsock_socket): set close-on-exec flag when
+ SOCK_CLOEXEC is not available.
-Mon Oct 11 17:42:54 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Nov 3 08:36:00 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * error.c (syserr_initialize): use mesg's encoding when locale
- encoding is US-ASCII. If locale encoding is not US-ASCII,
- assume err has non ASCII characters. [ruby-dev:42358]
+ * test/openssl/test_engine.rb: call Engine::cleanup on exit.
+ Patch provided by Yui Naruse, thanks!
+ [Bug #5547] [ruby-core:40669]
-Mon Oct 11 14:03:54 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Wed Nov 2 21:36:00 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * error.c (syserr_initialize): set the encoding of Errno::*#message
- as locale. [ruby-dev:42358]
+ * complex.c (nucomp_rationalize): fix function. [ruby-core:40667]
+ [Bug #5546]
-Mon Oct 11 06:38:27 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Wed Nov 2 08:16:45 2011 Tanaka Akira <akr@fsij.org>
- * ext/stringio/stringio.c (strio_set_encoding):
- StringIO#set_encoding can get 2nd argument and optional hash
- for API compatibility to IO. [ruby-dev:42356]
+ * lib/webrick/utils.rb: fix fcntl call.
-Mon Oct 11 06:11:30 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/drb/unix.rb: ditto.
- * io.c (rb_io_set_encoding): use rb_funcall2 when the io is not
- a T_FILE. [ruby-dev:42356]
+Wed Nov 2 00:43:59 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Sun Oct 10 18:42:23 2010 Akinori MUSHA <knu@iDaemons.org>
+ * test/psych/test_yamldbm.rb: avoid platform dependency.
+ patch by Naohisa Goto. [ruby-dev:44763] [Bug #5535]
+ * test/syck/test_yamldbm.rb: ditto.
- * lib/set.rb (Set#replace): Apply a bit of optimization.
+Wed Nov 2 00:14:15 2011 Shugo Maeda <shugo@ruby-lang.org>
-Sun Oct 10 10:20:07 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_marshal.rb: renamed methods duplicated with those
+ of marshaltestlib.rb.
- * configure.in (RUBY_MINGW32): canonicalize as like mswin version.
+Tue Nov 1 22:08:27 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Oct 10 05:33:14 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in: reject llvm-gcc.
- * vm_core.h (rb_signal_buff_size, rb_signal_exec): moved
- declarations from thread.c.
+Tue Nov 1 21:39:00 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Sat Oct 9 16:54:28 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (rb_cloexec_pipe): remove workaround of r33587.
+ The bug of NetBSD is fixed on Mon Oct 31 21:31:29 UTC 2011.
+ http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=45545
- * configure.in (RSHIFT): quote to get rid of argument expansion
- for autoconf 2.68.
+Tue Nov 1 19:49:08 2011 Tanaka Akira <akr@fsij.org>
-Sat Oct 9 11:00:06 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (rb_io_reopen): call rb_fd_fix_cloexec instead of
+ rb_maygvl_fd_fix_cloexec.
- * thread.c (thread_reset_event_flags, exec_event_hooks): ignore
- hooks marked as removed.
+Tue Nov 1 19:00:30 2011 Tanaka Akira <akr@fsij.org>
- * thread.c (thread_exec_event_hooks): remove hooks to be removed.
+ * io.c (rb_io_reopen): call rb_maygvl_fd_fix_cloexec after freopen().
- * thread.c (rb_threadptr_remove_event_hook, rb_remove_event_hook):
- defer removing hooks if running the hooks. [ruby-dev:42350]
+Tue Nov 1 17:17:26 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Sat Oct 9 10:51:00 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * file.c (file_expand_path): reset coderange after expanding path.
- * thread.c (rb_threadptr_exec_event_hooks): suppress each event
- hooks separately.
+Tue Nov 1 14:55:29 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * thread.c (thread_suppress_tracing): split from
- ruby_suppress_tracing, accepting thread pointer and event mask.
+ * io.c (nogvl_io_cntl): rb_cloexec_fcntl_dupfd's 2nd argument is int.
-Sat Oct 9 08:16:01 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * process.c (move_fds_to_avoid_crash): ditto.
- * thread.c (rb_threadptr_remove_event_hook): fix typo.
+Tue Nov 1 13:14:33 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Oct 8 10:52:25 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vsnprintf.c (BSD_vfprintf): support 'll' prefix.
- * common.mk (RBCONFIG): depends on version.h due to
- RUBY_PATCHLEVEL. [ruby-core:32709]
+ * vsnprintf.c (__sfeof): rename to avoid the collision with NetBSD's
+ one.
-Fri Oct 8 00:24:54 2010 James Edward Gray II <jeg2@ruby-lang.org>
+ * vsnprintf.c (__sferror): ditto.
- * lib/csv.rb: Fixing documentation typos. [ruby-core:32712]
+ * vsnprintf.c (__sclearerr): ditto.
-Thu Oct 7 09:14:28 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * vsnprintf.c (__sfileno): ditto.
- * vm_exec.c (vm_exec_core): Treat clang as non gcc on this
- context: It has __asm__ but doesn't works well.
+Tue Nov 1 12:36:16 2011 Tanaka Akira <akr@fsij.org>
-Wed Oct 6 12:28:22 2010 Tanaka Akira <akr@fsij.org>
+ * internal.h (rb_maygvl_fd_fix_cloexec): change the visibility for
+ ext/socket.
- * lib/uri/generic.rb (URI::Generic#hostname): new method.
- (URI::Generic#hostname=): ditto.
+Tue Nov 1 12:00:53 2011 Tanaka Akira <akr@fsij.org>
- * lib/open-uri.rb: use URI#hostname
+ * io.c (rb_maygvl_fd_fix_cloexec): renamed from fd_set_cloexec.
- * lib/net/http.rb: ditto.
+ * internal.h (rb_maygvl_fd_fix_cloexec): declared.
+
+ * ext/socket/init.c (cloexec_accept): use rb_maygvl_fd_fix_cloexec.
+ (rsock_s_accept_nonblock): use rb_update_max_fd.
+ (rsock_s_accept): use rb_update_max_fd.
+
+Tue Nov 1 08:24:40 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/init.c (cloexec_accept): new function to use accept4 if
+ available.
+ (rsock_s_accept_nonblock): use cloexec_accept.
+ (accept_blocking): ditto.
+
+ * ext/socket/extconf.rb: check accept4.
+
+Tue Nov 1 07:31:55 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/ancdata.c (nogvl_recvmsg_func): use MSG_CMSG_CLOEXEC if
+ available.
+
+ * ext/socket/unixsocket.c (recvmsg_blocking): ditto.
+
+Tue Nov 1 05:59:41 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/socket.c (rsock_socketpair): use SOCK_CLOEXEC if
+ available.
+
+Tue Nov 1 02:56:17 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ruby.c (load_file_internal): convert the encoding of load path if
+ needed by platform. calling open() was replaced by rb_cloexec_open()
+ at r33549, but the function expected UTF-8 pathname on Windows.
+ (open() expected "locale" pathname.)
+ reported by taco via IRC.
+
+ * ruby.c (load_file): change the type of the 2nd parameter to pass its
+ encoding to load_file_internal().
+
+ * ruby.c (process_options, rb_load_file): follow above change.
+ NOTE: we should pass encoding information to rb_load_file().
+
+Mon Oct 31 23:49:38 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/socket.c (rsock_socketpair): extracted from
+ rsock_sock_s_socketpair.
+
+Mon Oct 31 23:31:53 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/init.c (rsock_socket): use SOCK_CLOEXEC if available.
+
+Mon Oct 31 21:47:44 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (rb_cloexec_pipe): NetBSD 6.0 will support pipe2(2),
+ but its return value is -1 or larger than 0.
+
+Mon Oct 31 22:04:54 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/dbm/dbm.c (fdbm_initialize): use O_CLOEXEC if available.
+
+Mon Oct 31 21:47:48 2011 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/intern.h (rb_fd_fix_cloexec): renamed from
+ rb_fd_set_cloexec.
+
+ * io.c: follow the above renaming.
+
+ * ext/pty/pty.c: ditto.
+
+ * ext/socket/init.c: ditto.
+
+ * ext/socket/socket.c: ditto.
+
+ * ext/socket/ancdata.c: ditto.
+
+ * ext/socket/unixsocket.c: ditto.
+
+Mon Oct 31 21:02:43 2011 Tanaka Akira <akr@fsij.org>
+
+ * lib/resolv.rb (Resolv::DNS): retry IO.select for premature wakeup.
+
+Mon Oct 31 20:14:22 2011 Tanaka Akira <akr@fsij.org>
+
+ * io.c (fd_set_cloexec): clear CLOEXEC flag for standard file
+ descriptors.
+ (rb_cloexec_dup): use rb_cloexec_fcntl_dupfd.
+ (rb_cloexec_fcntl_dupfd): use F_DUPFD_CLOEXEC if available.
+
+Mon Oct 31 19:14:11 2011 Tanaka Akira <akr@fsij.org>
+
+ * test/resolv/test_dns.rb: don't check maximum slept time.
+ ruby doesn't guarantee the maximum time because it is not a
+ realtime application.
+
+Mon Oct 31 13:10:06 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (setfl): extract from fcntl().
+
+ * win32/win32.c (dupfd): new function to support F_DUPFD. based on a
+ patch written by akr.
+
+ * win32/win32.c (fcntl): use above functions.
+
+ * include/ruby/win32.h (F_DUPFD): define. [experimental]
+
+ * include/ruby/win32.h (F_SETFL): change the value to correspond with
+ other platforms.
+
+Mon Oct 31 12:37:50 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/pty/pty.c (get_device_once): use O_CLOEXEC for posix_openpt if
+ available.
+
+Mon Oct 31 12:05:24 2011 Tanaka Akira <akr@fsij.org>
+
+ * io.c (rb_cloexec_dup2): check oldfd == newfd at first.
+ pointed by KOSAKI Motohiro. [ruby-dev:44713]
+
+Mon Oct 31 10:50:26 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * io.c (rb_cloexec_fcntl_dupfd): this function needs F_DUPFD.
+
+ * io.c (nogvl_io_cntl): use rb_cloexec_fcntl_dupfd() only if the
+ platform has F_DUPFD.
+
+Mon Oct 31 00:50:00 2011 Luis Lavena <luislavena@gmail.com>
+
+ * configure.in: check -fno-omit-frame-pointer acceptance and usage
+ under MinGW. [ruby-core:39957] [Bug #5407]
+
+Mon Oct 31 00:16:11 2011 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/intern.h (rb_cloexec_fcntl_dupfd): declared.
+
+ * io.c (rb_cloexec_fcntl_dupfd): new function.
+ (nogvl_io_cntl): use rb_cloexec_fcntl_dupfd.
+
+ * process.c (move_fds_to_avoid_crash): use rb_cloexec_fcntl_dupfd.
+
+Sun Oct 30 22:46:46 2011 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: check pipe2.
+
+ * io.c (rb_cloexec_pipe): use pipe2 if available.
+
+Sun Oct 30 22:32:44 2011 Tanaka Akira <akr@fsij.org>
+
+ * ruby.c (fill_standard_fds): use fstat() instead of fcntl(F_GETFD)
+ for MinGW. reported by Luis Lavena. [ruby-core:40526] [Bug #5516]
+
+Sun Oct 30 21:12:47 2011 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/intern.h (rb_cloexec_pipe): declared.
+
+ * io.c (rb_cloexec_pipe): new function.
+ (rb_pipe): use rb_cloexec_pipe.
+
+ * thread_pthread.c (rb_thread_create_timer_thread): use
+ rb_cloexec_pipe.
+
+Sun Oct 30 20:06:07 2011 Tanaka Akira <akr@fsij.org>
+
+ * io.c (rb_cloexec_dup): refine control flow.
+ (rb_cloexec_dup2): ditto.
+
+Sun Oct 30 18:45:50 2011 Tanaka Akira <akr@fsij.org>
+
+ * ruby.c (fill_standard_fds): new function to open closed standard
+ file descriptors.
+ (ruby_sysinit): call fill_standard_fds.
+
+Sun Oct 30 10:50:36 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/rbinstall.rb (install_recursive, bin-comm): split mere
+ string not path name. [ruby-core:40462] [Bug #5492]
+
+Sun Oct 30 10:47:20 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (rb_cloexec_dup, rb_cloexec_dup2): CLOEXEC has been set if
+ dup3 succeeded.
+
+Sun Oct 30 09:58:48 2011 Tanaka Akira <akr@fsij.org>
+
+ * io.c (rb_cloexec_dup): don't allocate standard file descriptors.
+
+Sun Oct 30 08:29:51 2011 Tanaka Akira <akr@fsij.org>
+
+ * io.c (rb_cloexec_dup2): don't set CLOEXEC for standard file
+ descriptors.
+
+Sun Oct 30 07:47:10 2011 Tanaka Akira <akr@fsij.org>
+
+ * configure.in: check dup3.
+
+ * io.c (rb_cloexec_dup2): use dup3 if available.
+
+Sat Oct 29 22:06:37 2011 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/intern.h (rb_cloexec_dup2): declared.
+
+ * io.c (rb_cloexec_dup2): new function.
+ (io_reopen): use rb_cloexec_dup2.
+
+Sat Oct 20 21:08:18 2011 Tajima Akio <artonx@yahoo.co.jp>
+
+ * win32/Makefile.sub (CONFIG_H): have stdint.h if VC2010.
+ [Bug #5243]
+
+Sat Oct 29 20:59:08 2011 Tanaka Akira <akr@fsij.org>
+
+ * io.c (rb_cloexec_dup): use F_DUPFD_CLOEXEC if available.
+
+Sat Oct 29 20:00:26 2011 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/intern.h (rb_cloexec_dup): declared.
+
+ * io.c (rb_cloexec_dup): new function.
+ (ruby_dup): use rb_cloexec_dup.
+
+ * ext/pty/pty.c (pty_getpty): use rb_cloexec_dup.
+
+ * ext/openssl/ossl_bio.c (ossl_obj2bio): ditto.
+
+Sat Oct 29 16:11:34 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/sdbm/_sdbm.c (sdbm_prep): use O_CLOEXEC if available.
+
+Sat Oct 29 14:26:56 2011 Tanaka Akira <akr@fsij.org>
+
+ * io.c (rb_cloexec_open): use O_CLOEXEC if available.
+
+Sat Oct 29 12:57:15 2011 Tanaka Akira <akr@fsij.org>
+
+ * process.c (ruby_setsid): use rb_cloexec_open.
+ (rb_daemon): ditto.
+
+ * ruby.c (load_file_internal): ditto.
+
+ * file.c (rb_file_s_truncate): ditto.
+ (file_load_ok): ditto.
+
+ * random.c (fill_random_seed): ditto.
+
+ * ext/pty/pty.c (chfunc): ditto.
+ (get_device_once): ditto.
+
+ * ext/io/console/console.c (console_dev): ditto.
+
+Sat Oct 29 10:40:19 2011 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/intern.h (rb_cloexec_open): declared.
+
+ * io.c (fd_set_cloexec): extracted from rb_fd_set_cloexec.
+ (rb_cloexec_open): new function.
+ (sysopen_func): use rb_cloexec_open.
+ (rb_sysopen_internal): use rb_update_max_fd instead of
+ rb_fd_set_cloexec.
+
+Sat Oct 29 09:05:07 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread_pthread.h: no Structured Exception Handling like macros.
+ [ruby-core:40432] [Bug #5491]
+
+Fri Oct 28 22:05:34 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/sdbm/_sdbm.c: RCS $Id$ removed.
+
+Thu Oct 27 18:58:00 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * parse.y (parser_nextc): set encoding for the buffer of ripper.
+
+Fri Oct 28 06:06:08 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/sdbm/_sdbm.c (sdbm_prep): set FD_CLOEXEC flags for file
+ descriptors.
+ (fd_set_cloexec): new function.
+
+Fri Oct 28 03:01:27 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * vm_insnhelper.c (vm_call_cfunc): adding back useless hack. For some
+ reason, this fixes CFP errors on OS X 10.7.
+
+Fri Oct 28 00:09:31 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/sdbm/_sdbm.c (sdbm_prep): refactored for less nesting.
+
+Thu Oct 27 18:28:18 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (RUBY_DEFINE_IF): revert r33534 partially to get
+ rid of AS_ECHO which is not available in autoconf 2.61.
+ [ruby-dev:44702]
+
+Thu Oct 27 16:10:46 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * bignum.c (rb_big_divide): raise ZeroDivisionError if divisor is
+ zero, as well as Fixnum. [ruby-core:40429] [Bug #5490]
+
+Thu Oct 27 14:56:22 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (RUBY_FUNC_ATTRIBUTE): unset temporary variable.
+
+ * configure.in (RUBY_STACK_GROW_DIRECTION): substitute CPU name as
+ shell variable name. based on the patch by The Written Word Inc. at
+ [ruby-core:40421]. [Bug #5488]
+
+Thu Oct 27 09:57:56 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * include/ruby/ruby.h (SIZE_MAX): define SIZE_MAX if not defined.
+ patched by The Written Word Inc. [ruby-core:40422] [Bug #5489]
+
+Thu Oct 27 08:47:38 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/psych/parser.c: remove unused variable.
+
+Thu Oct 27 08:38:41 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/extconf.rb: add -Wall flag by default when compiler is
+ GCC.
+
+Wed Oct 26 15:24:25 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (rb_file_join): honor input encodings than ASCII-8BIT.
+ [ruby-core:40338] [Bug #5483]
+
+Tue Oct 25 21:52:31 2011 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/defines.h: use "__sparc" instead of "sparc" and
+ "__sparc__".
+
+ * dln.c: ditto.
+
+ [ruby-dev:44694]
+
+Tue Oct 25 06:34:39 2011 Eric Hodel <drbrain@segment7.net>
+
+ * re.c (match_aref): Use <code> around indexing examples to prevent
+ hyperlinks. [ruby-talk:389396]
+
+Mon Oct 24 23:55:31 2011 Tanaka Akira <akr@fsij.org>
+
+ * complex.c: use "__sun" instead of "__sun__" to detect SunOS.
+
+ * math.c: ditto.
+
+ * hash.c: ditto.
+
+ * atomic.h: ditto.
+
+ * ext/io/wait/wait.c: ditto.
+
+ [ruby-dev:44693]
+
+Mon Oct 24 22:45:37 2011 Tanaka Akira <akr@fsij.org>
+
+ * io.c: use "__sun" instead of "sun" to detect SunOS.
+
+ * dln.c: ditto.
+
+ * cont.c: ditto.
+
+ * ext/sdbm/_sdbm.c: ditto.
+
+ [ruby-dev:44693]
+
+Mon Oct 24 22:38:08 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/pty/pty.c (get_device_once): delay rb_fd_set_cloexec() until
+ grantpt() on Solaris. grantpt() doesn't work with CLOEXEC on
+ Solaris 10.
+ reported by Naohisa GOTO. [ruby-dev:44688] [Bug #5475]
+
+Mon Oct 24 08:18:14 2011 Tanaka Akira <akr@fsij.org>
+
+ * io.c (copy_stream_fallback_body): check nil for EOF of read method.
+ patch by Eric Wong. [ruby-core:39134] [Bug #5237]
+
+Sun Oct 23 18:21:23 2011 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * ext/tk/MANUAL_tcltklib.eng: fix typo.
+
+Sun Oct 23 18:03:31 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * numeric.c (rb_infinity, rb_nan): aggregated member initializers
+ need braces.
+
+Sun Oct 23 16:43:43 2011 Naohisa Goto <ngotogenome@gmail.com>
+
+ * ext/io/wait/wait.c: ioctl(2) is declared in unistd.h on Solaris.
+
+Sun Oct 23 16:33:35 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * ext/tk/MANUAL_tcltklib.eng: fix typo. reported by Mimura-san.
+ [ruby-dev:44683] [Bug #5471]
+
+Sun Oct 23 08:01:29 2011 Tanaka Akira <akr@fsij.org>
+
+ * io.c (rb_fd_set_cloexec): set close-on-exec flag only if F_GETFD is
+ defined. reported by Luis Lavena. [ruby-core:40281] [Bug #5470]
+
+Sat Oct 22 19:48:50 2011 Tanaka Akira <akr@fsij.org>
+
+ * test/openssl/test_ssl.rb (test_multibyte_read_write): start server
+ for each length to avoid race condition.
+
+Sat Oct 22 18:49:24 2011 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/intern.h (rb_fd_set_cloexec): declared.
+
+ * io.c (rb_fd_set_cloexec): new function.
+ (ruby_dup): call rb_fd_set_cloexec to set close-on-exec flag.
+ (rb_sysopen_internal): ditto.
+ (rb_pipe): ditto.
+ (io_reopen): ditto.
+ (io_cntl): ditto.
+
+ * process.c (rb_f_exec): change the default :close_others option to
+ true.
+ (rb_f_system): ditto.
+ (move_fds_to_avoid_crash): call rb_fd_set_cloexec to set
+ close-on-exec flag.
+ (ruby_setsid): ditto.
+ (rb_daemon): ditto.
+
+ * thread_pthread.c (rb_thread_create_timer_thread): call
+ rb_fd_set_cloexec to set close-on-exec flag.
+
+ * ruby.c (load_file_internal): ditto.
+
+ * file.c (rb_file_s_truncate): ditto.
+ (file_load_ok): ditto.
+
+ * random.c (fill_random_seed): ditto.
+
+ * ext/pty/pty.c (chfunc): ditto.
+ (get_device_once): ditto.
+
+ * ext/openssl/ossl_bio.c (ossl_obj2bio): ditto.
+
+ * ext/socket/init.c (rsock_socket): ditto.
+ (rsock_s_accept_nonblock): ditto.
+ (rsock_s_accept): ditto.
+
+ * ext/socket/socket.c (rsock_sock_s_socketpair): ditto.
+
+ * ext/socket/ancdata.c (discard_cmsg): ditto.
+ (make_io_for_unix_rights): ditto.
+
+ * ext/socket/unixsocket.c (unix_recv_io): ditto.
+
+ * ext/io/console/console.c (console_dev): ditto.
+
+ [ruby-core:38140] [Feature #5041]
+
+Sat Oct 22 17:46:27 2011 Tanaka Akira <akr@fsij.org>
+
+ * lib/resolv.rb: fix a exception name in previous patch.
+
+Sat Oct 22 17:43:33 2011 Tanaka Akira <akr@fsij.org>
+
+ * lib/resolv.rb: make timeout configurable for DNS query.
+ patch by Eric Wong. [ruby-core:38533] [Feature #5100]
+
+Sat Oct 22 02:07:48 2011 Naohisa Goto <ngotogenome@gmail.com>
+
+ * numeric.c (rb_infinity, rb_nan): use union to prevent bus error
+ caused by misalignment. [Bug #5469] [ruby-dev:44657]
+
+ * include/ruby/missing.h (INFINITY, NAN): ditto
+
+Fri Oct 21 22:02:17 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (initial_params): pack in a struct.
+
+ * gc.c (rb_gc_set_params): set parameters always.
+ [ruby-dev:44648] [Bug #5467]
+
+Fri Oct 21 12:10:20 2011 Naohisa Goto <ngotogenome@gmail.com>
+
+ * atomic.h: change Solaris checking macro because atomic_ops can work
+ not only with Sun Studio but also with Fujitsu C Compiler.
+
+Fri Oct 21 02:11:00 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_ns_spki.c: Complete documentation.
+ * test/openssl/test_ns_spki.rb: Integrate SPKI#to_text.
+
+Thu Oct 20 22:47:28 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (socklist_insert, socklist_lookup, socklist_delete):
+ new functions to wrap of st_insert(), st_lookup() and st_delete() to
+ socklist.
+ allocating socklist is deferred until it is really needed.
+
+ * win32/win32.c (exit_handler): delete socklist only if it is
+ initialized.
+
+ * win32/win32.c (rb_w32_sysinit, StartSockets): refactoring: move
+ initialization of select_mutex to StartSockets().
+
+ * win32/win32.c (exit_handler): refactoring: delete select_mutex only
+ if winsock is used.
+
+Thu Oct 20 22:38:53 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_pkcs5.c: add note on timing attacks and general
+ documentation.
+
+Thu Oct 20 21:19:15 2011 Naohisa Goto <ngotogenome@gmail.com>
+
+ * vm_eval.c (check_funcall): set array elements one-by-one to fix
+ compile error with Fujitsu C Compiler 5.6 on Solaris 10 on Sparc.
+ [Bug #5464] [ruby-dev:44632]
+
+Thu Oct 20 13:09:35 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/defines.h (flush_register_windows): use software
+ trap on Debian Sparc 32-bit userspace. [Bug #5244]
+
+Thu Oct 20 12:28:22 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * test/openssl/test_pkcs5.rb: add RFC 6070 tests for PBKDF2 with
+ HMAC-SHA1
+
+Thu Oct 20 11:42:23 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * util.c (mmprepare): fix for fragmental size.
+
+ * util.c (mmswap_, mmrot3_): portability improvement.
+
+Thu Oct 20 05:58:02 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/openssl/ossl_ns_spki.c (Init_ossl_ns_spki): Stub documentation
+ for Netscape SPKI.
+
+Thu Oct 20 05:13:39 2011 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * lib/minitest/*: Imported minitest 2.6.2 (r6712)
+ * test/minitest/*: ditto
+
+Thu Oct 20 06:55:32 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * lib/openssl/buffering.rb: Force multi-byte strings to be treated as
+ binary data.
+ * test/openssl/test_ssl.rb: Add test for it.
+
+ Thanks to Niklas Baumstark for reporting the issue!
+
+ [Ruby 1.9 - Bug #5233] [ruby-core:39120]
+
+Wed Oct 19 17:06:54 2011 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * version.h (RUBY_VERSION): finally declare start of 2.0 work!
+
+Wed Oct 19 11:48:44 2011 Eric Hodel <drbrain@segment7.net>
+
+ * error.c (Init_Exception): Document $! and $@. Provide
+ recommendations for creating exceptions for a library.
+
+Wed Oct 19 11:25:46 2011 Eric Hodel <drbrain@segment7.net>
+
+ * error.c (Init_Exception): Add hierarchy of Exception subclasses.
+ Based on patch by Sylvain Daubert. [Ruby 1.9 - Bug #5438]
+
+Wed Oct 19 11:04:47 2011 Eric Hodel <drbrain@segment7.net>
+
+ * enum.c: Reformat block args to a single standard, { |args| ... }.
+ Patch by b t. [Ruby 1.9 - Bug #5393]
+
+Wed Oct 19 12:11:26 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_ssl.c: Remove set, but unused variables.
+ ext/openssl/ossl_pkey.c: ditto
+
+ * ext/openssl/ossl_pkey_dh.c: Make functions passed to
+ rb_thread_blocking_region return VALUE instead of void.
+ ext/openssl/ossl_pkey_dsa.c: ditto
+ ext/openssl/ossl_pkey_rsa.c: ditto
+
+Tue Oct 18 23:28:53 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (identhash): share with type_numhash.
+
+ * st.c (st_hashtype_num): rename from type_numhash.
+
+Tue Oct 18 23:07:30 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_core.h (ruby_current_thread): probeprofiler has been removed
+ long ago.
+
+Tue Oct 18 23:05:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/ripper/eventids2.c (ripper_init_eventids2): separate
+ initializations of IDs and objects.
+
+ * ext/ripper/tools/generate.rb (generate_eventids1): ditto.
+
+ * parse.y (Init_ripper, InitVM_ripper): fix inversed roles.
+
+Sun Oct 16 19:46:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/bigdecimal/bigdecimal.gemspec (files): fixed typo, and
+ removed nonexistent file.
+
+ * ext/bigdecimal/bigdecimal.gemspec (homepage): added.
+
+ * ext/io/console/io-console.gemspec (homepage): ditto.
+
+Fri Oct 14 12:13:57 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/pty/pty.c (pty_check): should return nil until the child
+ terminates or stops. [ruby-dev:44600] [Bug #2642]
+
+Fri Oct 14 11:19:37 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/intern.h (rb_ary_rotate): export.
+
+Fri Oct 14 05:58:05 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * atomic.h (ATOMIC_INC, ATOMIC_DEC): return old values.
+ [ruby-dev:44596] [Bug #5439]
+
+ * signal.c (ruby_atomic_exchange): no needs to define on the
+ platforms where atomic.h is available.
+
+Thu Oct 13 19:29:40 2011 Naohisa Goto <ngotogenome@gmail.com>
+
+ * atomic.h (ATOMIC_*): use atomic_ops(3C) when SunStudio on Solaris.
+ [ruby-dev:44596] [Bug #5439]
+
+Thu Oct 13 18:13:04 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * atomic.h(ATOMIC_SET): add cast to void to prevent misuse.
+ [ruby-dev:44596] [Bug #5439]
+
+Thu Oct 13 18:04:27 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (rb_gc_finalize_deferred, rb_objspace_call_finalizer):
+ should use ATOMIC_EXCHANGE() to check the previous value.
+ [ruby-dev:44596] [Bug #5439]
+
+Wed Oct 12 23:39:58 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * test/openssl/test_ssl.rb: Move duplicated tests for SSL::Session to
+ test_ssl_session.rb
+
+Tue Oct 11 08:49:40 2011 Eric Hodel <drbrain@segment7.net>
+
+ * array.c (rb_ary_initialize): Improve explanation of Array.new
+ parameters. Patch by Alvaro Pereyra Rabanal. [Ruby 1.9 - Bug #5425]
+ * array.c (rb_ary_s_try_convert): Fix typo (try => tries)
+ * array.c (rb_ary_rindex): Add spacing for block.
+ * array.c (rb_ary_uniq_bang): Describe block
+ * array.c (rb_ary_uniq): ditto
+
+Tue Oct 11 07:55:38 2011 Eric Hodel <drbrain@segment7.net>
+
+ * array.c: Add a description to Array, minor cleanups. Patch by
+ Andrea Singh. [Ruby 1.9 - Bug #5412]
+
+Tue Oct 11 06:09:52 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/pp.rb: Move PP documentation to top of class PP. Patch by
+ Sylvain Daubert. [Ruby 1.9 - Bug #5430]
+
+Tue Oct 11 06:06:29 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/coverage/coverage.c (Init_coverage): Change list format and
+ describe Coverage.result output. Patch by Sylvain Daubert.
+ [Ruby 1.9 - Bug #5428]
+
+Tue Oct 11 05:53:23 2011 Eric Hodel <drbrain@segment7.net>
+
+ * object.c (Init_Object): Add reference to BasicObject, brief
+ explanation of constant lookup. Based on patch by Alvaro Pereyra
+ Rabanal.
+ [Ruby 1.9 - Bug #5426]
+
+Sun Oct 9 11:06:52 2011 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * test/psych/test_yamldbm.rb: don't run test if the system
+ don't support yaml/dbm.
+
+ * test/syck/test_yamldbm.rb: ditto.
+
+Sat Oct 8 08:54:56 2011 Eric Hodel <drbrain@segment7.net>
+
+ * enum.c (group_by): Improve group_by description. Patch by b t.
+ [#5411]
+
+Sat Oct 8 03:17:51 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/shell.rb: Document some methods of Shell. Patch by Carol
+ Nichols. [Ruby 1.9 - Bug #5417]
+
+Fri Oct 7 17:54:28 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit/assertions.rb (assert_send, assert_not_send):
+ parenthesize non-empty arguments.
+
+Fri Oct 7 06:35:50 2011 Eric Hodel <drbrain@segment7.net>
+
+ * array.c: Use + for arguments described in documentation to allow
+ rdoc -C2 to work better. Remove <code> from method references to
+ allow cross-references in HTML documentation.
+
+Thu Oct 6 18:46:23 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * vm_eval.c (make_no_method_exception): fix typo.
+
+ * vm_insnhelper.c, vm_insnhelper.h: ditto.
+
+Thu Oct 6 16:29:30 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_eval.c (make_no_method_execption): extract from
+ raise_method_missing().
+
+ * vm_eval.c (send_internal): remove inadvertent symbol creation
+ from public_send. based on a patch by Jeremy Evans <code AT
+ jeremyevans.net> in [ruby-core:38576]. [Feature #5112]
+
+ * vm_insnhelper.c (vm_call_method): remove inadvertent symbol
+ creation from send and __send__, too.
+
+Thu Oct 6 14:59:11 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/time.rb: Clean up Time documentation. Patch by Jake Goulding.
+ [Ruby 1.9 - Bug #5416]
+
+Thu Oct 6 10:00:54 2011 Eric Hodel <drbrain@segment7.net>
+
+ * enum.c (group_by): Improve documentation based on patch by b t.
+
+Thu Oct 6 09:56:30 2011 Eric Hodel <drbrain@segment7.net>
+
+ * enum.c: Clean up wording in Enumerable documentation. Patch by b t.
+ [Ruby 1.9 - Bug #5411]
+
+Thu Oct 6 09:17:18 2011 Eric Hodel <drbrain@segment7.net>
+
+ * time.c (Init_Time): Remove editorial comments from Time
+ documentation, fix link.
+
+Thu Oct 6 09:14:20 2011 Eric Hodel <drbrain@segment7.net>
+
+ * time.c (Init_Time): Improve Time documentation. Patch by Shane
+ Emmons. [Ruby 1.9 - Bug #5404]
+ * lib/time.rb: Improve time.rb documentation including Time.strptime.
+ Patch by Shane Emmons. [Ruby 1.9 - Bug #5402]
+
+Thu Oct 6 08:54:05 2011 Eric Hodel <drbrain@segment7.net>
+
+ * random.c: Improve documentation of Random. Patch by Gregory
+ Parkhurst. [Ruby 1.9 - Bug #5410]
+
+Thu Oct 6 01:44:51 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * cont.c (cont_mark): mark original Thread object from saved_thread.
+ [ruby-dev:44571] [Bug #5386]
+
+Wed Oct 5 16:33:04 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_call_cfunc): remove useless hack.
+
+Wed Oct 5 05:56:39 2011 Eric Hodel <drbrain@segment7.net>
+
+ * hash.c (Init_Hash): Improve Hash documentation. Patch by Alvaro
+ Pereyra Rabanal. [Ruby 1.9 - Bug #5405]
+
+Wed Oct 5 05:47:59 2011 Eric Hodel <drbrain@segment7.net>
+
+ * random.c (Init_Random): Add a top-level comment for Random. Patch
+ by Brett Bim. [Ruby 1.9 - Bug #5403]
+
+Wed Oct 5 02:50:27 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/syntax_error.rb: Add file, line, offset, and
+ message attributes during parse failure.
+ * ext/psych/parser.c: Update parser to raise exception with correct
+ values.
+ * test/psych/test_exception.rb: corresponding tests.
+
+Wed Oct 5 01:52:16 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/parser.c (parse): Use context_mark for indicating error
+ line and column.
+
+Wed Oct 5 01:22:08 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/scalar_scanner.rb: use normal begin / rescue
+ since postfix rescue cannot receive the exception class. Thanks
+ nagachika!
+
+Tue Oct 4 21:10:08 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (class_alloc): allocate extra memory after containing
+ object setup to get rid of rare-but-potential memory leak.
+
+ * gc.c (gc_mark_children): skip marking extended members if ptr is
+ NULL.
+
+Tue Oct 4 16:17:50 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/time.rb (Time.strptime): use Time.at if d[:seconds] is set.
+ Reported by Christopher Eberz. [ruby-core:39903] Bug #5399
+
+Tue Oct 4 11:44:10 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * gc.c (rb_gc_set_params): ruby_verbose can be Qnil, so use RTEST.
+
+Tue Oct 4 08:33:41 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/etc/etc.c: Document Etc, Etc.sysconfdir, Etc.systmpdir. Patch
+ by mathew murphy. [Ruby 1.9 - Bug #5396]
+
+Tue Oct 4 08:21:51 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/shellwords.rb: Update toplevel comment with an example. Patch
+ by Samnang Chhun. [Ruby 1.9 - Bug #5388]
+
+Tue Oct 4 08:15:50 2011 Eric Hodel <drbrain@segment7.net>
+
+ * proc.c (proc_call): Update documentation to match argument handling
+ of proc/Proc.new/lambda/->()
+
+Tue Oct 4 07:59:16 2011 Eric Hodel <drbrain@segment7.net>
+
+ * proc.c (proc_call): Fix documentation of Proc#call vs Proc#===.
+ [Ruby 1.9 - Bug #5349]
+
+Tue Oct 4 07:43:18 2011 Eric Hodel <drbrain@segment7.net>
+
+ * array.c (rb_ary_initialize): Make Array.new description match
+ call-seq. Patch by Henry Maddocks. [Ruby 1.9 - Bug #5344]
+
+Tue Oct 4 07:35:23 2011 Eric Hodel <drbrain@segment7.net>
+
+ * array.c (rb_ary_initialize): Add output for examples. Patch by
+ Jonathan Mukai. [Ruby 1.9 - Bug #5216]
+
+Tue Oct 4 07:30:50 2011 Eric Hodel <drbrain@segment7.net>
+
+ * array.c (rb_ary_s_create): Add example results for Array::[]. Patch
+ by Jonathan Mukai. [Ruby 1.9 - Bug #5215]
+
+Tue Oct 4 07:15:17 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems 1.8.11. Move Deprecate into the
+ Gem namespace.
+
+Tue Oct 4 06:43:47 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych.rb: update psych version.
+ * ext/psych/psych.gemspec: generate new gemspec for new version.
+
+Tue Oct 4 06:29:55 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych.rb: calling `yaml` rather than `to_yaml`.
+ * ext/psych/lib/psych/nodes/node.rb: Rename `to_yaml` to just `yaml`
+ in order to avoid YAML::ENGINE switching from replacing this method.
+ * test/psych/helper.rb: fix tests for method name change.
+ * test/psych/test_document.rb: ditto
+ * test/psych/visitors/test_emitter.rb: ditto
+
+Tue Oct 4 06:20:19 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/scalar_scanner.rb: Match values against the
+ floating point spec defined in YAML to avoid erroneous parses.
+ * test/psych/test_numeric.rb: corresponding test.
+
+Tue Oct 4 05:59:24 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/to_ruby.rb: ToRuby visitor can be
+ constructed with a ScalarScanner.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: ScalarScanner can be
+ passed to the YAMLTree visitor.
+
+Tue Oct 4 05:47:23 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/to_ruby.rb: Define Regexp::NOENCODING
+ for 1.9.2 backwards compatibility.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: Fix Date string
+ generation for 1.9.2 backwards compatibility.
+
+Mon Oct 3 23:56:39 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * gc.c (rb_gc_set_params): output GC parameter change messages only
+ if -w/-v options are specified. these messages are output to stderr,
+ not to stdout. [ruby-core:39795] [Bug #5380]
+
+ * test/ruby/test_gc.rb (test_gc_parameter): add test for it.
+
+Sun Oct 2 20:05:32 2011 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * vm.c (rb_thread_mark), cont.c (cont_mark): revert r33369 and r33371
+ that may cause SEGV in certain environments.
+
+Sun Oct 2 12:14:06 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * test/psych/test_yamldbm.rb: add test case.
+ * test/syck/test_yamldbm.rb: ditto.
+
+Sun Oct 2 11:28:09 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * lib/yaml/store.rb: make initialize method signature match the
+ superclass signature.
+
+Sun Oct 2 10:44:01 2011 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * io.c: fix documentation of ARGF.lineno=.
+
+Sat Oct 1 20:03:19 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (have_framework): try as Objective-C.
+ https://twitter.com/nagachika/status/120294447660539904
+
+Sun Oct 2 08:43:25 2011 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * vm.c (rb_thread_mark), cont.c (cont_mark): self pointer should not
+ be marked by itself. Patch by Koichi Sasada.
+ [ruby-dev:44567] [Bug #5386]
+
+Sun Oct 2 00:42:14 2011 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * vm.c (rb_thread_mark): rb_thread_t needs self to be marked.
+ [ruby-dev:44566] [Bug #5386]
+
+Sat Oct 1 09:48:53 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * gc.c (add_heap_slots, init_heap): reset heaps_inc zero when
+ heap slots are expanded by environment variable RUBY_HEAP_MIN_SLOTS.
+ [ruby-core:39777] [Bug #5380]
+
+ * test/ruby/test_gc.rb (test_gc_parameter): add test for it.
+
+ * test/ruby/envutil.rb (assert_normal_exit): add :child_env option to
+ enable pass environment variables to child process.
+
+Thu Sep 29 13:17:51 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (ary_join_1): should not copy the encoding of non-string
+ element after string element. [ruby-core:39776] [Bug #5379]
+
+Thu Sep 29 11:53:56 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (slot_sweep, rb_gc_finalize_deferred)
+ (rb_objspace_call_finalizer, rb_gc): run finalizers
+ sequentially. [ruby-dev:44562]
+
+Thu Sep 29 20:37:38 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/gdbm/gdbm.c (rb_gdbm_fatal): adjust argument type.
+
+Thu Sep 29 20:10:42 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (is_id_value, is_live_object): extract from id2ref().
+
+ * gc.c (run_finalizer): use object instead of object id.
+
+Thu Sep 29 20:07:36 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * use RB_TYPE_P which is optimized for constant types, instead of
+ comparison with TYPE.
+
+Wed Sep 28 09:20:37 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (pthread_np.h): needs pthread.h to be included
+ previously on OpenBSD. a patch by George Koehler <xkernigh AT
+ netscape.net> at [ruby-core:39752]. [Bug #5376]
+
+Wed Sep 28 04:41:35 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * test/psych/test_yamlstore.rb: use tmpdir for tmpfile.
+ * test/syck/test_yamlstore.rb: ditto.
+
+Wed Sep 28 04:10:46 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * ext/bigdecimal/README: update report to.
+
+Tue Sep 28 04:05:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal_en.html: removed because this file isn't
+ maintained now.
+
+ * ext/bigdecimal/bigdecimal_ja.html: ditto.
+
+Tue Sep 27 09:55:40 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c: make native_fd_select().
+ * thread.c (do_select): remove #ifdef _WIN32. Instead, use
+ native_fd_select() always.
+
+Tue Sep 27 09:44:59 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (do_select): remove cygwin specific hack. It's layer
+ violation and too large hack.
+ * thread.c (cmp_tv, subtract_tv): removed.
+
+Tue Sep 27 03:50:19 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * test/rexml/test_sax.rb: add require 'rexml/document'.
+
+Tue Sep 27 03:32:27 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * test/psych/test_yamldbm.rb: fix #setup and #teardown.
+ [Bug #5370] [ruby-core:39730]
+ * test/syck/test_yamldbm.rb: ditto.
+
+Mon Sep 26 11:27:38 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/webrick/httputils.rb: Add MIME Type definition of .js and .svg.
+ patched by Hal Brodigan. [ruby-core:39704] [Bug #5365]
+
+Mon Sep 26 09:20:44 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: remove DJGPP support. It's not longer supported
+ since ruby 1.9.0.
+
+Mon Sep 26 09:07:46 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * include/ruby/defines.h: remove NextStep, OpenStep, Rhapsody
+ support. Last activity of their OSes are 7 years ago.
+ * configure.in: ditto.
+ * dir.c: ditto.
+ * ext/tk/extconf.rb: ditto.
+
+Mon Sep 26 09:02:49 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: remove a code for human68k. it's no longer
+ supported since r19677.
+
+Sun Sep 25 23:43:32 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_asn1.c: fix int_ossl_asn1_decode0_cons when being
+ fed arbitrary string values.
+ Clearly distinguish between the cases "universal, infinite and
+ not a SEQUENCE or SET" and "universal SEQUENCE or SET, possibly
+ infinite". Raise error for universal tags that are not infinite.
+ * test/openssl/test_asn1.rb: add a test for this.
+
+ Thanks to Hiroshi Yoshida for reporting this bug.
+ [Bug #5363] [ruby-dev:44542]
+
+Sun Sep 25 20:57:18 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * test/syck/test/yamldbm.rb: add test for Syck::DBM.
+ * test/psych/test_yamldbm.rb: add test for Psych::DBM.
+ * test/psych/test_yamlstore.rb: add test for Psych::PStore.
+
+Sun Sep 25 20:54:10 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * lib/yaml/dbm/dbm.rb: fix #update, add #key for using instead #index.
+ [Bug #5305][ruby-dev:44485]
+
+Sun Sep 25 16:54:33 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * encoding.c (require_enc): reject only loading from untrusted
+ load paths. [ruby-dev:44541] [Bug #5279]
+
+ * transcode.c (load_transcoder_entry): ditto.
+
+Sun Sep 25 16:45:05 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in: ignore all warnings from an arbitrary
+ header in /usr/local/include.
- reported by Adam Majer. [ruby-core:32056]
+Sun Sep 25 03:43:03 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Oct 6 11:52:12 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * enum.c (slice_before_i): use rb_attr_get to suppress wrong warning
+ for internal instance variable slicebefore_initial_state.
- * io.c (fptr_finalize): write_mutex might have been destroyed
- already in finalization phase, as the order of finalizers is not
- guaranteed. rb_mutex_t should be used in place of Mutex object
- in the future.
+Fri Sep 23 14:20:14 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Tue Oct 5 22:17:02 2010 wanabe <s.wanabe@gmail.com>
+ * ext/openssl/ossl_asn1.c: remove unused variable.
- * win32/mkexports.rb: revert r29320 and r29402.
+Fri Sep 23 13:46:59 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Mon Oct 4 12:43:47 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/openssl/test_ssl_session.rb: execute test_session_exts_read
+ only for OpenSSL versions >= 0.9.8k. Thanks, Eric Wong, for
+ reporting this.
+ [Bug #4961] [ruby-core:37726]
- * parse.y (regexp): dregexp has literal string only at the head
- and successors are array. [ruby-core:32682]
+Fri Sep 23 11:59:08 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
-Mon Oct 4 10:22:21 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/openssl/test_ssl_session.rb: ensure server calls callbacks in
+ test_ctx_server_session_cb. Thanks to Eric Wong for the patch.
+ [Bug #5336] [ruby-core:39619]
- * random.c (rand_init): This checks the value is in 32bit or not,
- so use int32_t, not int.
+Thu Sep 22 02:53:19 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Oct 4 09:47:39 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * vm_insnhelper.c (vm_call_cfunc): suppress a warning. note that
+ `volatile type *var' doesn't make var itself volatile.
- * random.c (rand_init): remove useless assignment.
+Thu Sep 22 01:52:48 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * re.c (update_char_offset): remove unused variable.
+ * thread_pthread.c (ubf_select): activate timer thread when interrupt
+ blocking thread.
+ A patch created by Koichi Sasada. [ruby-core:39634] [Bug #5343]
+ to cover race condition, timer thread periodically send SIGVTARLM to
+ threads in signal thread list. so you should activate timer thread
+ when interrupt a thread.
- * re.c (read_escaped_byte): ditto.
+Wed Sep 21 16:55:26 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Mon Oct 4 09:30:42 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/io/wait/test_io_wait.rb (TestIOWait#setup): of course, the
+ behavior of mingw is just same with mswin.
- * ext/openssl/lib/openssl/bn.rb (Integer#to_bn): OpenSSL::BN.new
- accepts only Strings, so call Integer#to_s(16).
- 16 is for an optimization. [ruby-dev:42336]
+Tue Sep 20 18:08:51 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Oct 4 07:57:51 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * vm_insnhelper.c (vm_get_cvar_base): reduce duplicated checks and
+ move a warning outside the loop.
- * cont.c (fiber_memsize): Return size.
- Before this change, fiber_memsize always returns 0.
+Mon Sep 19 18:55:51 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Mon Oct 4 07:16:55 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/fileutils.rb (module FileUtils): improve performance of
+ FileUtils.compare_stream. a patch by Masaki Matsushita.
+ [Feature #5337] [ruby-core:39622]
- * enc/unicode.c (onigenc_unicode_property_name_to_ctype):
- remove useless assignment.
+Mon Sep 19 18:42:58 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * vm.c (vm_make_proc_from_block): ditto.
+ * test/-ext-/old_thread_select/test_old_thread_select.rb:
+ select() with timeout may return early in old Linux kernels
+ with 250 Hz tickrate and no dynticks, so skip everything older
+ than 2.6.32 (which has long term support).
+ And, Make the timing assertions consistently use assert_operator with
+ timing difference in error message
+ Patch by Eric Wong. [Bug #5335] [ruby-core:39618]
- * variable.c (rb_ivar_count): ditto.
+Mon Sep 19 09:28:06 2011 Eric Hodel <drbrain@segment7.net>
-Mon Oct 4 06:40:24 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/openssl/test_ssl.rb (class OpenSSL): Test
+ OpenSSL::SSL::SSLSocket#session and #session=.
- * Makefile.in (clean-rdoc): Don't use \ in variable expansion.
- BSD make treats it as an escape character.
+Mon Sep 19 07:54:17 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Oct 4 00:01:53 2010 wanabe <s.wanabe@gmail.com>
+ * object.c (rb_obj_clone): singleton class should be attached
+ singleton object to. a patch by Satoshi Shiba <shiba AT rvm.jp>
+ at [ruby-dev:44460]. [Bug #5274]
- * tool/config.sub: revert r29320, r29324, r29347, r29354, r29365
- to automake-1.11.1. [ruby-core:32634]
+Sat Sep 17 23:34:10 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/mkexports.rb: no longer use 'mingw64'. a patch from Luis Lavena
- at [ruby-core:32678].
+ * parse.y (parser_data_type): inherit the core type in ripper so
+ that checks in core would work. [ruby-core:39591] [Bug #5331]
-Sun Oct 3 20:36:37 2010 Akio Tajima (arton) <artonx@yahoo.co.jp>
+Sat Sep 17 12:44:04 2011 Kazuki Tsujimoto <kazuki@callcc.net>
- * test/win32ole/test_folderitem2_invokeverb.rb: Change creating
- shortcut verb to 'Link' [Bug #3339]
+ * lib/find.rb (Find.find): add documentation that Find.find
+ without block returns an enumerator.
-Sun Oct 3 19:44:23 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Sep 15 11:39:43 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * configure.in (Makefile): get rid of duplicated ruby target when
- already there it was.
+ * gc.c (mark_entry, mark_key, mark_keyvalue): adjust callback
+ argument types.
-Sat Oct 2 22:59:32 2010 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+Thu Sep 15 01:44:10 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * test/win32ole/test_thread.rb: add for win32ole with Thread.
+ * ext/tk/*: Change encoding from EUC-JP to UTF-8
-Fri Oct 1 17:03:00 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+Wed Sep 14 11:43:37 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/webrick/test_httpproxy.rb (TestWEBrickHTTPProxy::test_upstream_proxy):
- My machine fails this test at this line, saying 503 service unavailable.
+ * thread.c (rb_fd_rcopy): added an argument guard.
+ Patch by NAKAMURA Usaku. [Bug #5306] [ruby-core:39435]
-Thu Sep 30 16:11:08 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+Tue Sep 13 20:21:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * win32/win32.c (rb_w32_getenv): should return NULL if specified name
- is empty. a patch from Heesob Park at [ruby-core:32650]
+ * lib/pstore.rb, test/test_pstore.rb: suppress warnings with -v.
-Thu Sep 30 15:18:23 2010 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * lib/pstore.rb (PStore): always open in binary mode even if
+ default encodings are set. [Bug #5311] [ruby-core:39503]
- * parse.y (command_asgn): allow command_call to be right hand side
- expression of chained assignment. [ruby-dev:42313]
+Tue Sep 13 05:37:15 2011 Yukihiro Matsumoto <matz@ruby-lang.org>
-Thu Sep 30 10:55:38 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * io.c (Init_IO): update BINARY comment. it should not change the
+ encoding of the result to ASCII-8BIT. [ruby-talk:387719]
- * hash.c (ruby_setenv): workaround for old Windows. a patch from
- Heesob Park. [ruby-core:32353]
+Mon Sep 12 19:55:00 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Thu Sep 30 09:29:06 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * thread.c (rb_thread_select): fix to ignore an argument
+ modification of rb_thread_fd_select().
+ based on a patch by Eric Wong. [Bug #5306] [ruby-core:39435]
+ * thread.c (rb_fd_rcopy): New. for reverse fd copy.
- * lib/uri/common.rb (URI.encode_www_form): change treatment of
- undefined value in given array as latest internet draft for
- application/www-form-urlencoded.
- http://tools.ietf.org/html/draft-hoehrmann-urlencoded-01
+ * test/-ext-/old_thread_select/test_old_thread_select.rb
+ (test_old_select_false_positive): test for bug5306.
-Thu Sep 30 09:34:03 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * ext/-test-/old_thread_select/old_thread_select.c (fdset2array):
+ New. convert fdsets to array.
+ * ext/-test-/old_thread_select/old_thread_select.c (old_thread_select):
+ return 'read', 'write', 'except' argument of rb_thread_select()
+ to ruby script.
- * vm_dump.c (dump_thread): fixed wrong type of return value of
- SymGetModuleBase64(). [ruby-dev:42306]
+Mon Sep 12 13:38:12 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Sep 29 21:04:05 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+ * README.EXT, README.EXT.ja (2.2.2), parse.y (rb_check_id): add
+ documents for rb_check_id().
- * test/ruby/test_rubyoptions.rb (TestRubyOptions::test_script_from_stdin):
- As usual, PTY is not always available.
+Mon Sep 12 12:53:39 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Wed Sep 29 18:38:14 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rake/file_list.rb (Rake::FileList#egrep): there is no need to
+ open files in binary mode.
+ see more details in https://github.com/jimweirich/rake/issues/74
- * tool/config.sub (x64): regularize only for pc vendor, and strip
- useless 64 suffix.
+Mon Sep 12 12:42:36 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Sep 29 17:53:02 2010 Kenta Murata <mrkn@mrkn.jp>
+ * test/ruby/test_exception.rb (TestException#test_exit_success_p):
+ assert also the cases when exiting with true and false.
- * ext/bigdecimal/bigdecimal.c (BIGDECIMAL_ENABLE_VPRINT):
- VPrint is usually disabled. It's only used in debugging.
+ * lib/test/unit/assertions.rb (assert_send): make arguments in
+ the default message clearer.
-Wed Sep 29 17:41:34 2010 Kenta Murata <mrkn@mrkn.jp>
+Sun Sep 11 05:23:14 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * ext/bigdecimal/bigdecimal.c (BigDecimal_save_limit):
- return the result of a block.
+ * lib/matrix.rb: Deal with subclasses of Matrix [redmine #5307]
- * test/bigdecimal/test_bigdecimal.rb (test_save_limit):
- add a test for the above change.
+Sat Sep 10 13:38:20 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Wed Sep 29 16:18:03 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * dir.c (dir_s_aref):
+ * dir.c (dir_entries): Two small documentation fixes.
+ A patch from Aaron Lerch. [Bug #5302] [ruby-core:39404]
- * vm_dump.c (dump_thread): remove unused optional arguments.
+Sat Sep 10 08:30:03 2011 Koichi Sasada <ko1@atdot.net>
-Wed Sep 29 13:26:30 2010 Kenta Murata <mrkn@mrkn.jp>
+ * gc.c (GC_PROFILE_MORE_DETAIL, CALC_EXACT_MALLOC_SIZE):
+ define macros only if they are not defined.
+ fixes: [Ruby 1.9 - Feature #5291]
- * ext/bigdecimal/bigdecimal.c (BigDecimal_save_rounding_mode):
- return the result of a block.
+Sat Sep 10 08:25:47 2011 Yukihiro Matsumoto <matz@ruby-lang.org>
- * test/bigdecimal/test_bigdecimal.rb (test_save_rounding_mode):
- add a test for the above change.
+ * parse.y (bv_decls): parse.y relies on $$ = $1 before action
+ routines. a patch from Michael Edgar. [Bug #5303]
+ [ruby-core:39429]
- * test/bigdecimal/test_bigdecimal.rb (test_save_exception_mode):
- add a test for the return value of BigDecimal.save_exception_mode.
+Sat Sep 10 01:37:55 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Wed Sep 29 12:45:30 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * sample/drb/dhasenc.rb: coding cookie of Emacs is coding,
+ not encoding.
- * ext/bigdecimal/bigdecimal.c (BigDecimal_div2, BigDecimal_add2,
- BigDecimal_sub2, BigDecimal_mult2, VpLimitRound): remove meaningless
- casts to get rid of compiler warnings.
+ * sample/mine.rb: ditto.
-Wed Sep 29 12:35:13 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Sep 9 21:56:40 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * ext/bigdecimal/bigdecimal.c (VPrint, VpToString): fix format.
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_sqrt): Fix comment.
+ BigDecimal#sqrt requires argument. Reported by Makoto Kishimoto.
+ Thanks for your contribution. [Bug #5267] [ruby-dev:44452]
-Wed Sep 29 12:31:12 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Sep 9 11:00:55 2011 Shota Fukumori <sorah@tubusu.net>
- * lib/rdoc/known_classes.rb (RDoc::KNOWN_CLASSES): add Encoding.
+ * test/rubygems/test_gem_commands_help_command.rb: Add one
+ `require` because if run test-all with test/unit parallel
+ running, sometimes this test fails by some constants not found.
+ The error reason is some worker doesn't require the file needed by
+ this test. This issue is related to [ruby-core:36168].
-Tue Sep 28 20:50:23 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Sep 9 10:22:03 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * tool/config.sub (x64): regularize same as mswin.
+ * thread.c (rb_thread_select): fix a typo to initialize efds
+ properly. [Bug #5299] [ruby-core:39380]
-Tue Sep 28 20:06:14 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Sep 9 02:02:09 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * vm_dump.c (rb_vm_bugreport): add windows support.
- based on patches from Peter Weldon at [ruby-core:32551]
+ * template/yarvarch.ja:
+ Change encoding from Shift_JIS to UTF-8
-Mon Sep 27 23:30:34 2010 Koichi Sasada <ko1@atdot.net>
+Thu Sep 9 01:14:00 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
- * insns.def (opt_case_dispatch), vm_insnhelper.c:
- execute the procedures of "when" clauses by bytecode
- instead of st_foreach() when the object does not hit
- prepared hash. [ruby-dev:42304]
+ * sample/drb/README.rd.ja:
+ * sample/drb/dhasenc.rb:
+ * sample/mine.rb:
+ Change encoding from EUC-JP to UTF-8
-Mon Sep 27 15:54:03 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+Thu Sep 8 21:03:22 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * test/net/http/test_https.rb: As always, localhost is not
- guaranteed to be resolved as 127.0.0.1. But a SSL
- certificate needs a socket to listen on a specific address
- where a CN resolves to. On situations where localhost is
- not 127.0.0.1, these tests are not possible.
+ * ext/nkf/nkf-utf8/nkf.c: import nkf 2.1.2 (be9c280)
+ Bump version number/release date only.
-Mon Sep 27 15:25:05 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+Thu Sep 8 12:43:18 2011 Narihiro Nakamura <authornari@gmail.com>
- * test/net/imap/test_imap.rb: resurrection of r29259.
- this change depends on minitest 1.7.1.
+ * gc.c (Init_GC): defined GC::Profiler.raw_data. based on the
+ patch by Eric Hodel. [ruby-core:37857] [Bug #4991]
- * lib/test/unit/assertions.rb: ditto.
+Thu Sep 8 09:02:53 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Sep 26 22:59:45 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (id2ref): objects which are unmarked but not in sweep_slots
+ are not dead.
- * tool/config.sub (x86_64-pc-mingw64): regularize.
+Thu Sep 8 07:44:25 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Sep 26 22:21:07 2010 wanabe <s.wanabe@gmail.com>
+ * transcode.c (rb_declare_transcoder, load_transcoder_entry): no
+ longer need to limit the length of transcoder library name.
- * ext/openssl/ossl_hmac.c (ossl_hmac_hexdigest, ossl_hmac_s_hexdigest),
- ext/openssl/ossl_pkey_ec.c (ossl_ec_group_set_seed),
- ext/openssl/ossl_ssl_session.c (ossl_ssl_session_to_der),
- ext/openssl/ossl_pkcs7.c (numberof): suppress warnings.
- [ruby-core:31932]
+Thu Sep 8 07:36:36 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Sun Sep 26 10:25:24 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/syck/lib/syck/types.rb: use toplevel Syck.
+ for the case someone define Syck::Syck (or YAML::Syck).
- * tool/config.{guess,sub}: updated to automake-1.11.1.
+Thu Sep 8 07:33:12 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Sep 25 22:48:30 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * gc.c (id2ref): unmarked object is already dead while lazy
+ sweeping, and to it cannot come back since other objects
+ referred from it might have been freed already.
- * configure.in (LIBRUBY_DLDFLAGS): fix quoting.
+Wed Sep 8 03:48:00 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Sat Sep 25 10:30:37 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/readline/README.ja:
+ Change encoding from EUC-JP to UTF-8
- * configure.in (LIBRUBY_DLDFLAGS): use -unexported_symbol only
- when available. http://trac.macports.org/ticket/26341
+Wed Sep 8 02:59:00 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Sat Sep 25 10:05:49 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ * test/rexml/test_encoding.rb:
+ Add require 'require 'rexml/document'
- * configure.in: Always add -mieee for Renesas SH4.
- Thanks, Nobuhiro Iwamatsu. [Feature #3874] [ruby-core:32548]
+Wed Sep 8 02:53:00 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Sat Sep 25 01:34:41 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/nkf/nkf-utf8/nkf.c:
+ Change encoding from ISO-2022 to UTF-8
- * Makefile.in (install-cross): target to install cross-compiling
- stuff.
+Wed Sep 7 23:41:24 2011 Kouhei Sutou <kou@cozmixng.org>
-Fri Sep 24 23:44:59 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/rexml/parsers/baseparser.rb, test/rexml/test_comment.rb:
+ allow a single hyphen in comment. [Bug #5278] [ruby-core:39289]
+ Reported by Thomas Fritzsche. Thanks!!!
- * string.c (sym_call), vm.c (invoke_block_from_c),
- vm_insnhelper.c (vm_yield_with_cfunc): pass given block.
- [ruby-core:32075]
+Wed Sep 7 17:27:18 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * vm_eval.c (rb_funcall_passing_block): new function to call
- method with passing given block.
+ * lib/yaml.rb: explicitly specify ::Object to avoid the collision with
+ Syck::Object.
-Fri Sep 24 15:50:43 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Tue Sep 6 21:06:49 2011 Shota Fukumori <sorah@tubusu.net>
- * string.c (rb_str_to_i): fix rdoc: String#to_i raises an
- exception when base is invalid. [ruby-core:31685]
+ * lib/test/unit.rb (_run_suites): Now reports are written the
+ following order: Skip, Failure, Error. [Feature #5282]
-Fri Sep 24 15:28:35 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * test_sorting.rb: test for above.
- * string.c (rb_str_rindex): use rb_enc_prev_char instead of repeated
- str_nth.
- patched by Michael Selig [ruby-core:32498]
+ * test4test_sorting.rb: Ditto.
-Fri Sep 24 14:19:12 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+ * lib/test/unit.rb (run): Put RUBY_DESCRIPTION before quitting.
+ [Feature #5282]
- * test/test_pty.rb: Same as 229281; existence of PTY class do not
- guarantee a successful pty operation.
+Tue Sep 6 21:13:47 2011 Masaya Tarui <tarui@ruby-lang.org>
-Fri Sep 24 06:25:55 2010 Ryan Davis <ryand-ruby@zenspider.com>
+ * win32/Makefile.sub (INSNS): change command line option -Ks to -Ku
+ for generate *.inc. because insns.def encoding has been changed SJIS
+ to UTF-8. if $BASERUBY is 1.9, -Ks cause an error. [Feature #5128]
+ (same as r33194)
- * lib/minitest/*.rb: Imported minitest 1.7.2 r5879.
- * test/minitest/*.rb: ditto.
+Tue Sep 6 15:55:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Sep 23 23:09:08 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * transcode.c (load_transcoder_entry): concatenate paths directly.
- * vm_insnhelper.c (vm_get_cref0): cref is stacked only in normal
- iseqs, so check if it is the case first.
+ * encoding.c (load_encoding): predefined encoding names are safe.
+ [ruby-dev:44469] [Bug #5279]
-Thu Sep 23 23:08:41 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * transcode.c (load_transcoder_entry): ditto.
- * tool/config.sub: mingw64 should use x86_64. [ruby-core:32514]
+Tue Sep 6 12:07:10 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Sep 23 21:40:40 2010 wanabe <s.wanabe@gmail.com>
+ * transcode.c: enabled econv newline option.
- * ext/socket/raddrinfo.c (init_addrinfo, inspect_sockaddr): suppress
- warnings. see [ruby-core:31932].
+Tue Sep 6 06:44:57 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Thu Sep 23 19:27:57 2010 wanabe <s.wanabe@gmail.com>
+ * numeric.c (dbl2ival): Fix Float#divmod and #round for 32 bit
+ platform. part 1 of [bug #5276]
- * thread_win32.c (w32_wait_events, w32_close_handle): suppress warnings.
- see [ruby-core:31932].
+Tue Sep 6 06:44:25 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Thu Sep 23 18:54:39 2010 wanabe <s.wanabe@gmail.com>
+ * numeric.c (flo_round): Fix criteria for 32 bits platform
+ part 2 of [bug #5276]
- * tool/config.sub: add mingw64.
+Tue Sep 6 05:37:11 2011 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
- * win32/mkexports.rb (Exports::Mingw64): added.
+ * test/rinda/test_rinda.rb (test_core_03_notify): Fixed test failures
+ [ruby-dev:44430] [Ruby 1.9 - Bug #372]
- * win32/mkexports.rb (Exports::Mingw32): renamed from Exports::Mingw.
+Mon Sep 5 20:59:30 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Thu Sep 23 09:01:28 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * insns.def: change encoding pragma for emacs (shift_jis to utf-8).
- * vm_insnhelper.c (vm_cref_push): no outer cref is needed for proc
- from method. Bug #3786, Bug #3860, [ruby-core:32501]
+Mon Sep 5 19:32:15 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Wed Sep 22 17:12:01 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * Makefile.in (INSNS): change command line option -Ks to -Ku for
+ generate *.inc. because insns.def encoding has been changed SJIS to
+ UTF-8. if $BASERUBY is 1.9, -Ks cause an error. [Feature #5128]
- * test/openssl/utils.rb (OpenSSL#silent): always restore $VERBOSE.
- [ruby-dev:42285]
+Mon Sep 5 18:10:56 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Wed Sep 22 16:59:40 2010 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+ * transcode.c (rb_econv_binmode): newline decorators are
+ exclusive.
- * test/test_prime.rb (TestPrime#test_new): the warning expected have
- not been displayed when $VERBOSE == nil. Patch by Shota Fukumori
- a.k.a. sora_h. [ruby-dev:42272]
- Recovers $stderr even if StringIO.new fails. Reported by unak.
+Mon Sep 5 15:03:37 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Sep 22 01:55:48 2010 Koichi Sasada <ko1@atdot.net>
+ * test/rubygems/test_gem_security.rb
+ (test_class_build_self_signed_cert): reset opt[:trust_dir] to apply
+ temporary Gem.user_home.
- * bootstraptest/test_method.rb: fix last commit.
+Mon Sep 5 10:04:35 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Wed Sep 22 01:49:52 2010 Koichi Sasada <ko1@atdot.net>
+ * README.ja, README.EXT.ja: resolve conflicts. [ruby-dev:44459]
- * bootstraptest/test_method.rb: add a test for [ruby-core:30534].
+Mon Sep 5 05:13:22 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Wed Sep 22 00:52:44 2010 WATANABE Hirofumi <eban@ruby-lang.org>
+ * numeric.c (flo_round): Make Float#round round big values [bug
+ #5272]
- * lib/rdoc/ri/store.rb (save_cache): remove duplicate entries.
+Mon Sep 5 04:28:25 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-Wed Sep 22 00:00:05 2010 Tanaka Akira <akr@fsij.org>
+ * numeric.c (int_round): Integer#round always returns an Integer [Bug
+ #5271]
- * ext/pathname/pathname.c (path_f_pathname): Pathname() translated
- from pathname.rb.
+Sun Sep 4 22:28:50 2011 Shugo Maeda <shugo@ruby-lang.org>
-Tue Sep 21 22:18:30 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/net/imap.rb (default_port, default_imap_port,
+ default_tls_port, default_ssl_port, default_imaps_port):
+ added methods for consistency with Net::POP.
+ based on the patch by art lussos. [ruby-core:38997] [Bug #5198]
- * tool/mkconfig.rb: fixed build problem on mswin64 introduced in r29278.
+Sun Sep 4 21:19:19 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-Tue Sep 21 02:42:35 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+ * Change encoding from EUC-JP to UTF-8. [Feature #5128]
- * test/pathname/test_pathname.rb (TestPathname#test_mkdir): fix typo.
+Sun Sep 4 00:47:39 2011 Kazuki Tsujimoto <kazuki@callcc.net>
-Mon Sep 20 23:23:05 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/ruby/test_fiber.rb (TestFiber#test_no_valid_cfp):
+ add a test. Unlike TestThread#test_no_valid_cfp,
+ this test succeeds even if win32ole is required (see r33153).
- * dir.c (bracket): get rid of scanning at the end of the pattern
- string, not to raise an exception while globbing command line.
- [ruby-core:32478]
+Sun Sep 4 00:11:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Sep 20 11:25:49 2010 Tanaka Akira <akr@fsij.org>
+ * variable.c (rb_const_set): show the previous definition
+ location. [EXPERIMENTAL]
- * ext/pathname/pathname.c (Init_pathname): Pathname#=~ undefinition
- translated from pathname.rb.
+Sat Sep 3 23:56:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Sep 20 02:34:11 2010 Kenta Murata <mrkn@mrkn.jp>
+ * configure.in (sizeof_struct_dirent_too_small): check if struct
+ dirent.d_name is too small.
- * ext/bigdecimal/bigdecimal.c (check_rounding_mode, BigDecimal_mode):
- raise ArgumentError instead of TypeError passing invalid modes.
+ * configure.in (RUBY_MINGW32): take tool prefix from CC.
- * test/bigdecimal/test_bigdecimal.rb (test_mode, test_round):
- change against the above modifications.
+Sat Sep 3 23:52:08 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sun Sep 19 22:08:39 2010 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+ * io.c (argf_next_argv): open in default text mode.
+ [ruby-core:39234] [Bug #5268]
- * lib/mkmf.rb (try_link): rdoc
- (try_compile): ditto
- (try_cpp): ditto
- (try_func): ditto
- (try_var): ditto
- (try_run): ditto
- (egrep_cpp): ditto
+Sat Sep 3 18:40:57 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
-Sun Sep 19 20:43:33 2010 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+ * lib/thread.rb (SizedQueue#max=): raise ArgumentError if max is not
+ positive number. patch by Masaki Matsushita.
+ [ruby-dev:44449] [Bug #5259]
- * configure.in (--disable-install-doc): disables capi too, in addition
- to rdoc.
- (--disable-install-rdoc): a new option for disabling only rdoc.
- (--disable-install-capi): a new option for disabling only capi.
+ * test/thread/test_queue.rb (test_sized_queue_initialize,
+ test_sized_queue_assign_max): add tests for it.
-Sun Sep 19 20:37:45 2010 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+Fri Sep 2 21:11:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * common.mk (clean): removes all documents on cleaning.o
- (CAPIOUT): new variable.
- (clean-capi, distclean-capi, realclean-capi): new targets
+ * io.c (validate_enc_binmode, prep_stdio): default to text mode on
+ dosish platforms. [ruby-core:38822] [Bug #5164]
- * Makefile.in (clean-capi, distclean-capi, realclean-capi): ditto.
+ * transcode.c (rb_econv_prepare_options): keep default ecflags
+ unchanged if no options.
- * win32/Makefile.sub (clean-capi, distclean-capi, realclean-capi):
+Fri Sep 2 14:36:47 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_search_const_defined_class): search
+ ancestors only when global scope. [ruby-core:39227] [Bug #5264]
+
+Fri Sep 2 09:58:08 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_tokadd_string, parser_yylex): ignore a backslash
+ which prefixes an non-ascii character, which has no escape
+ syntax. [ruby-core:39222] [Ruby 1.9 - Bug #5262]
+
+Fri Sep 2 04:05:25 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: emit strings tagged as
+ ascii-8bit as binary in YAML.
+ * test/psych/test_string.rb: corresponding test.
+
+Fri Sep 2 01:07:14 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * numeric.c (flo_round): substitute machine dependent magic number.
+
+Thu Sep 1 17:31:22 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * insns.def (defineclass), vm_insnhelper.c (vm_get_cvar_base): see
+ also inherited constants for classes without superclass and
+ modules. [ruby-core:37698] [Bug #3423]
+
+Thu Sep 1 16:18:44 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * Release GVL while OpenSSL's public key generation.
+
+ t = Thread.new { print "."; sleep 0.1 }
+ key = OpenSSL::PKey::RSA.new(2048)
+ #=> Thread t works in parallel with public key generation if
+ OS/machine allows it.
+
+ This works with OpenSSL >= 0.9.8. From this version, it has new
+ public key generation function which allows us to interrupt the
+ execution while pkey generation iterations.
+
+ * ext/openssl/extconf.rb: Check existence of OpenSSL's new public key
+ generation function. (DH_generate_parameters_ex,
+ DSA_generate_parameters_ex and RSA_generate_key_ex.
+
+ * ext/openssl/ossl_pkey.{h,c} (ossl_generate_cb_2,
+ ossl_generate_cb_stop): Added new callback function for OpenSSL pkey
+ generation which handles Thread interruption by Ruby.
+ ossl_generate_cb_stop is the unblock function(ubf) for Ruby which
+ sets a stop flag. New pkey generation callback ossl_generate_cb_2
+ checks the stop flag at each iterations of OpenSSL and interrupts
+ pkey generation when the flag is set.
+
+ * ext/openssl/ossl_pkey_dsa.c (dsa_generate): Call
+ rb_thread_blocking_region with the above unblock function to release
+ GVL while pkey generation.
+
+ * ext/openssl/ossl_pkey_rsa.c (rsa_generate): ditto.
+
+ * ext/openssl/ossl_pkey_dh.c (dh_generate): ditto.
+
+ * test/openssl/test_pkey_{dh,dsa,rsa}.rb: Test it.
+
+Thu Sep 1 14:06:54 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_thread.rb (TestThread#test_no_valid_cfp): skip when
+ win32ole is required. in such case, win32ole redefines
+ Thread#initialize, and the block argument becomes to be not the top
+ of the thread, then this testcase always fails.
+
+Thu Sep 1 10:20:50 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_io_m17n.rb (TestIO_M17N#test_{default_mode_on_dosish,
+ default_mode_on_unix,text_mode,binary_mode}): sorry for wrong test
+ committed in r33144. I'd misunderstood the spec of ruby's universal
+ newline.
+
+Thu Sep 1 09:27:57 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * variable.c (rb_autoloading_value): Fix the order of definitions.
+ It is used by autoload_defined_p.
+
+Wed Aug 31 17:28:23 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * variable.c (rb_autoload): There was a chance to run GC (from
+ rb_str_new2()) before finishing autoload_data_i construction. It
+ caused SEGV at rb_gc_mark() at autoload_i_mark.
+
+ * variable.c (rb_autoload_load): Move RB_GC_GUARD() to proper
+ position based on suggestion by CHIKANAGA Tomoyuki at
+ http://d.hatena.ne.jp/nagachika/20110826/ruby_trunk_changes_33070_33078
+
+ * variable.c (autoload_defined_p): Fix incompatible autoload behavior
+ that causes Rails crash. Class definition instruction defined in
+ 'defineclass' in insns.def always invokes rb_autoload_load for a
+ constant. It's invoked for every class definition regardless of
+ existence of autoload definition. rb_autoload_load checks if a
+ constant is defined as autoloaded, but new thread-safe autoload
+ returned different value if the constant is under autoloading.
+
+Wed Aug 31 17:20:56 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * Re-apply r33078, thread-safe autoload which is reverted at r33093.
+
+Wed Aug 31 16:28:04 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_io_m17n.rb (TestIO_M17N#test_{default_mode_on_dosish,
+ default_mode_on_unix,text_mode,binary_mode}): tests for [Bug #5164].
+
+Wed Aug 31 15:54:11 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/json: Merge json gem v1.5.4 (3dab4c5a6a97fac03dac).
+
+Wed Aug 31 13:09:41 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * numeric.c (flo_round): Avoid overflow by optimizing for trivial
+ cases [Bug #5227]
+
+Wed Aug 31 00:50:01 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_select_with_thread): and my typo. we all must
+ be more careful.
+
+Wed Aug 31 00:48:38 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * thread.c (rb_thread_select): critical typo in r33117.
+
+Wed Aug 31 00:30:49 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/-ext-/old_thread_select/test_old_thread_select.rb
+ (TestOldThreadSelect#test_old_select_read_timeout): if the machine
+ is fast enough, the time used by code around IO.select may be smaller
+ than Time implement threshold.
+
+Wed Aug 31 00:04:38 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/-test-/old_thread_select/old_thread_select.c (old_thread_select):
+ typo.
+
+ * test/-ext-/old_thread_select/test_old_thread_select.rb
+ (TestOldThreadSelect#test_old_select_signal_safe): use SIGINT instead
+ of SIGUSR1 because the former is general and the latter is platform
+ dependent.
+
+Tue Aug 30 23:59:36 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c, include/ruby/intern.h (rb_w32_fd_copy): implement
+ for rb_thread_select() in thread.c. the use of rb_fd_copy() is
+ introduced in r33117.
+ [Bug #5251] [ruby-core:39195]
+
+ * thread.c (rb_thread_select): must call rb_fd_init() before using
+ rb_fdset_t. see the implementations of rb_fd_init()s if you want to
+ know the reason.
+
+Tue Aug 30 22:34:45 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * test/dl/test_callback.rb (test_callback_with_string): prevents
+ temporary string from GC.
+
+Tue Aug 30 22:25:38 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_call_cfunc): revert r33112. RB_GC_GUARD macro
+ protect a VALUE from GC. It's not for general anti-optimizing
+ purpose.
+
+Tue Aug 30 11:06:19 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/json: Merge json gem 1.5.4+ (2149f4185c598fb97db1).
+ [Bug #5173] [ruby-core:38866]
+
+Tue Aug 30 09:57:50 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * lib/thread.rb (Queue#pop): fix a race against Thread.wakeup.
+ Patch by Masaki Matsushita <glass.saga at gmail dot com>
+ [Bug #5195] [ruby-dev:44400]
+
+Tue Aug 30 09:48:07 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * cont.c (fiber_entry): fix stack allocation failure on Debian
+ GNU/kFreeBSD.
+ Patch by Lucas Nussbaum <lucas at lucas-nussbaum dot net>.
+ [Bug #5241] [ruby-core:39147]
+
+Tue Aug 30 09:28:01 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_thread_select): rewrite by using
+ rb_thread_fd_select(). old one is EINTR unsafe.
+ Patch by Eric Wong. [Bug #5229] [ruby-core:39102]
+
+ * test/-ext-/old_thread_select/test_old_thread_select.rb:
+ a testcase for rb_thread_select().
+ * ext/-test-/old_thread_select/old_thread_select.c: ditto.
+ * ext/-test-/old_thread_select/depend: ditto.
+ * ext/-test-/old_thread_select/extconf.rb: ditto.
+
+Tue Aug 30 09:08:22 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: fix a build failure on GNU Hurd.
+ Patch by Samuel Thibault <sthibault at debian dot org>. Thank you!
+ [Bug #5250] [ruby-core:39185]
+
+Sun Aug 29 23:22:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * test/ruby/test_numeric.rb (test_num2long): modify a test against the
+ change by r33108.
+
+Sun Aug 29 09:58:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * numeric.c (bit_coerce): A Fixnum and a Bignum are only permitted for
+ bitwise arithmetic with a Fixnum. #1792
+
+ * test/ruby/test_fixnum.rb: add tests for the above change.
+
+ * bignum.c (bit_coerce): A Fixnum and a Bignum are only permitted for
+ bitwise arithmetic with a Bignum. #1792
+
+ * test/ruby/test_bignum.rb: add tests for the above change.
+
+Sun Aug 28 15:38:17 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * ext/date/date_parse.c (date_zone_to_diff): keep a temporary string
+ stored in variable while the contents buffer is being used.
+
+ * ext/date/date_parse.c (date_zone_to_diff): get rid of out of bounds
+ memory read. [ruby-dev:44409] [Bug #5213]
+
+Sun Aug 28 05:29:50 2011 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * lib/minitest/*: Imported minitest 2.5.1 (r6596)
+ * test/minitest/*: ditto
+
+Sat Aug 27 20:46:05 2011 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * vm.c (rb_vm_rewrite_dfp_in_errinfo): change return type
+ to suppress a warning.
+
+ * vm_core.h: ditto.
+
+Sat Aug 27 19:04:06 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * internal.h (rb_strftime_timespec): moved from time.c and define only
+ if ruby/encoding.h is included.
+
+ * internal.h (rb_strftime): ditto.
+
+Sat Aug 27 18:53:51 2011 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * proc.c (proc_new): force to rewrite errinfo when calling Proc.new in ensure.
+ [Bug #5234] [ruby-core:39125]
+ This code will be removed after changing throw mechanism (see r33064).
+
+ * vm.c (rb_vm_rewrite_dfp_in_errinfo): new function.
+
+ * vm.c (vm_make_env_each): changed accordingly.
+
+ * vm_core.h: ditto.
+
+ * bootstraptest/test_flow.rb: add tests for above.
+
+Sat Aug 27 18:44:06 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * internal.h (rb_strftime_timespec): move to time.c because it depends
+ encoding.h.
+
+Sat Aug 27 18:17:58 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * strftime.c (rb_strftime_with_timespec): get enc argument to specify
+ the encoding of the format. On Windows (at least Japanese Windows),
+ Time#strftime("%Z") includes non ASCII in locale encoding (CP932).
+ So convert locale to default internal. [ruby-core:39092] [Bug #5226]
+
+ * strftime.c (rb_strftime): ditto.
+
+ * strftime.c (rb_strftime_timespec): ditto.
+
+ * internal.h (rb_strftime_timespec): follow above.
+
+ * time.c (rb_strftime_alloc): ditto.
+
+ * time.c (strftimev): ditto.
+
+ * time.c (time_strftime): ditto.
+
+ * time.c (time_to_s): the resulted string of Time#to_s is always
+ ascii only, so this should be US-ASCII.
+
+ * time.c (time_asctime): ditto.
+
+Sat Aug 27 11:18:12 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * Revert r33078. It caused a Rails application NoMethodError.
+
+ /home/nahi/git/emptyApp/ruby/1.9.1/gems/rack-mount-0.6.14/lib/rack/mount/utils.rb:157: warning: toplevel constant ScanError referenced by Regin::Parser::ScanError
+ /home/nahi/git/emptyApp/ruby/1.9.1/gems/rack-mount-0.6.14/lib/rack/mount/vendor/regin/regin/parser.rb:17:in `parse_regexp': undefined method `scan_str' for #<Regin::Parser:0x00000002344548> (NoMethodError)
+
+Sat Aug 27 08:44:58 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc: Import RDoc 3.9.4. Typo and grammar fixes by Luke Gruber.
+ [Ruby 1.9 - Bug #5203]
+
+Sat Aug 27 07:53:34 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/open-uri.rb: Fix indentation of OpenURI::OpenRead#open. Use ++
+ instead of `' for method arguments in open-uri.rb
+
+Sat Aug 27 07:22:07 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/pathname/lib/pathname.rb: Fix typos and grammar mistakes. Patch
+ by Luke Gruber. [#5203]
+ * ext/pty/lib/expect.rb: ditto
+ * lib/mathn.rb: ditto
+ * lib/net/http.rb: ditto
+ * lib/open-uri.rb: ditto
+ * lib/ostruct.rb: ditto
+ * lib/tempfile.rb: ditto
+ * lib/thread.rb: ditto
+ * lib/weakref.rb: ditto
+ * sample/webrick/httpproxy.rb: ditto
+
+Sat Aug 27 04:03:18 2011 Koichi Sasada <ko1@atdot.net>
+
+ * iseq.c (iseq_data_to_ary): fix type of variable
+ (long -> unsigned long) to suppress a warning.
+
+Sat Aug 27 04:02:11 2011 Koichi Sasada <ko1@atdot.net>
+
+ * vm_core.h: add a decl. of rb_autoloading_value().
+
+Fri Aug 26 19:12:08 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * variable.c: Make autoload thread-safe. See #921.
+
+ What's the problem?
+ autoload is thread unsafe. When we define a constant to be
+ autoloaded, we expect the constant construction is invariant. But
+ current autoload implementation allows other threads to access the
+ constant while the first thread is loading a file.
+
+ What's happening inside?
+ The current implementation uses Qundef as a marker of autoload in
+ Constant table. Once the first thread find Qundef as a value at
+ constant lookup, it starts loading a defined feature. Generally a
+ loaded file overrides the Qundef in Constant table by module/class
+ declaration at very beginning lines of the file, so other threads
+ can see the new Module/Class object before feature loading is
+ finished. It breaks invariant construction.
+
+ How to solve?
+ To ensure invariant constant construction, we need to override
+ Qundef with defined Object after the feature loading. For keeping
+ Qundef in Constant table, I expanded autoload_data struct in
+ Module to have a slot for keeping the defined object while feature
+ loading. And changed Module's constant lookup/update logic a
+ little so that the slot is only visible from the thread which
+ invokes feature loading. (== the first thread which accessed the
+ autoload constant)
+
+ Evaluation?
+ All test passes (bootstrap test, test-all and RubySpec) and added
+ 8 tests for threading behavior. Extra logics are executed only
+ when Qundef is found, so no perf drop should happen except
+ autoloading.
+
+ * variable.c (rb_autoload): Prepare new autoload_data struct.
+
+ * variable.c (rb_autoload_load): Load feature and update Constant
+ table after feature loading is finished.
+
+ * variable.c (rb_const_get_0): When the fetched constant is under
+ autoloading, it returns the object only for the thread which starts
+ autoloading.
+
+ * variable.c (rb_const_defined_0): Ditto.
+
+ * variable.c (rb_const_set): When the specified constant is under
+ autoloading, it sets the object only for the thread which starts
+ autoloading. Otherwise, simply overrides Qundef with constant
+ override warning.
+
+ * vm_insnhelper.c (vm_get_ev_const): Apply same change as
+ rb_const_get_0 in variable.c.
+
+ * test/ruby/test_autoload.rb: Added tests for threading behavior.
+
+Fri Aug 26 10:10:37 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems 1.8.10. Fixes security issue in
+ creating ruby-format gemspecs. Fixes Gem.dir not being at the front
+ of Gem.path to fix uninstall and cleanup commands. Fixes gem
+ uninstall stopping on the first missing gem.
+
+Fri Aug 26 08:21:10 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * time.c (strftimev): Make Time#to_s default to US-ASCII encoding but
+ respect Encoding.default_internal. [ruby-core:39092]
+ * test/ruby/test_time.rb (class TestTime): Corresponding test.
+
+Thu Aug 25 09:43:16 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/openssl/lib/openssl/bn.rb: Hide copyright info from RDoc.
+ * ext/openssl/lib/openssl/digest.rb: ditto
+ * ext/openssl/lib/openssl/x509.rb: ditto
+ * ext/openssl/lib/openssl/cipher.rb: ditto
+
+Thu Aug 25 09:25:48 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/openssl/ossl_digest.c: Document OpenSSL::Digest::digest and add
+ an example to OpenSSL::Digest. Patch by Sylvain Daubert.
+ [Ruby 1.9 - Bug #5166]
+ * ext/openssl/lib/openssl/digest.rb (module OpenSSL): ditto
+
+Thu Aug 25 08:19:43 2011 Koichi Sasada <ko1@atdot.net>
+
+ * vm.c (vm_make_env_each): work around to solve Bug #2729.
+ fixes: Bug #2729
+ a patch from Kazuki Tsujimoto <kazuki@callcc.net>
+ This problem is caused by changing dfp (dynamic env pointer)
+ from saved dfp. Saved dfp is pointed env in VM stack. However,
+ the dfp can be moved because VM copies env from VM stack to
+ the heap. At this copying, dfp was also changed. To solve this
+ problem, I'll try to change throw mechanism (not save target dfp,
+ but save target cfp).
+
+ * bootstraptest/test_flow.rb: add a test for above.
+
+Thu Aug 25 07:57:33 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * numeric.c (int_round): Fix Integer#round [ruby-core:39096]
+
+Thu Aug 25 07:00:00 2011 Koichi Sasada <ko1@atdot.net>
+
+ * vm_insnhelper.h, vm_insnhelper.c, vm.c, vm_method.c, insns.def:
+ Manage a redefinition of special methods for each classes.
+ A patch from Joel Gouly <joel.gouly@gmail.com>. Thanks!
+
+Thu Aug 25 06:51:08 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych.rb: Fixing psych version number.
+ * ext/psych/psych.gemspec: updating the gemspec.
+
+Thu Aug 25 06:11:35 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/nodes/node.rb: default `to_yaml` encoding to be
+ UTF-8.
+ * test/psych/test_encoding.rb: test yaml dump encoding.
+
+Thu Aug 25 01:24:33 2011 Naohisa Goto <ngotogenome@gmail.com>
+
+ * test/fileutils/test_fileutils.rb (test_chmod_symbol_mode): Solaris
+ seems to behave the same as FreeBSD.
+
+Thu Aug 25 01:11:36 2011 Naohisa Goto <ngotogenome@gmail.com>
+
+ * test/ruby/test_rubyoptions.rb (test_script_from_stdin): slave pty
+ should be manipulated because master pty may not be a tty on some
+ environment (e.g. Solaris). [Bug:#5222] [ruby-dev:44420]
+
+Wed Aug 24 15:13:56 2011 Koichi Sasada <ko1@atdot.net>
+
+ * iseq.h, iseq.c, compile.c: Change the line number data structure
+ to solve an issue reported at [ruby-dev:44413] [Ruby 1.9 - Bug #5217].
+ Before this fix, each instruction has an information including
+ line number (iseq::iseq_insn_info_table). Instead of this data
+ structure, recording only line number changing places
+ (iseq::iseq_line_info_table).
+ The order of entries in iseq_line_info_table is ascending order of
+ iseq_line_info_table_entry::position. You can get a line number
+ by an iseq and a program counter with this data structure.
+ This fix reduces memory consumption of iseq (bytecode).
+ On my measurement, a rails application consumes 21.8MB for
+ iseq with this fix on the 32bit CPU. Without this fix, it
+ consumes 24.7MB for iseq [ruby-dev:44415].
+
+ * proc.c: ditto.
+
+ * vm_insnhelper.c: ditto.
+
+ * vm_method.c: ditto.
+
+ * vm.c (rb_vm_get_sourceline): change to use rb_iseq_line_no().
+
+Wed Aug 24 09:49:10 2011 Koichi Sasada <ko1@atdot.net>
+
+ * insns.def (defined): fix to checking class variable.
+ A patch by Magnus Holm <judofyr@gmail.com>. Thanks!
+
+ * test/ruby/test_variable.rb: add a test for above.
+
+Wed Aug 24 08:53:06 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc: Update to RDoc 3.9.3. Fixes RDoc with `ruby -Ku`. Allows
+ HTTPS image paths to be turned into <img> tags. Prevents special
+ markup inside <tt> from being processed.
+
+Wed Aug 24 07:57:43 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Update to RubyGems 1.8.9. Fixes uninstalling multiple
+ gems and gem cleanup.
+
+Wed Aug 24 06:45:20 2011 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * lib/minitest/*: Imported minitest 2.5.0 (r6557)
+ * test/minitest/*: ditto
+
+Wed Aug 24 00:38:22 2011 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * thread.c (update_coverage): skip coverage count up if the current
+ line is out of the way. rb_sourceline() is unreliable when source
+ code is big. [ruby-dev:44413]
+
+ * test/coverage/test_coverage.rb: add a test for above.
+
+Tue Aug 23 15:23:56 2011 Eric Hodel <drbrain@segment7.net>
+
+ * load.c (rb_f_require): Improve documentation of Kernel#require.
+ [Ruby 1.9 - Bug #5210]
+
+Tue Aug 23 11:27:26 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * ext/zlib/zlib.c (gzfile_read_header): Ensure that each section of
+ gzip header is readable to avoid SEGV.
+
+ * test/zlib/test_zlib.rb (test_corrupted_header): Test it.
+
+Mon Aug 22 23:43:33 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * sprintf.c (rb_str_format): add RB_GC_GUARD to prevent temporary
+ strings from GC.
+
+Sun Aug 21 17:49:53 2011 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * iseq.c (iseq_s_disasm): remove variable which is no longer used
+ since r33013.
+
+Sun Aug 21 14:20:58 2011 Naohisa Goto <ngotogenome@gmail.com>
+
+ * configure.in: use LD_LIBRARY_PATH_64 on 64-bit Solaris.
+
+Sat Aug 20 13:19:52 2011 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * iseq.c (iseq_s_disasm): fix a bug that may cause SEGV.
+
+ * test/ruby/test_method.rb (test_body): add a test for the above change.
+
+Sat Aug 20 10:43:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/stringio/stringio.c (strio_read): return new string if nil
+ is explicitly given as a buffer ([Bug #5207]), otherwise set the
+ encoding. also removed dead code.
+
+Fri Aug 19 14:25:51 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * process.c (proc_spawn_v, proc_spawn): should not wait the
+ spawned process.
+
+ * process.c (proc_spawn_v): fix missing argument, and try with
+ /bin/sh only if failed with ENOEXEC.
+
+Fri Aug 19 14:12:57 2011 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/imap.rb (idle): raises a Net::IMAP::Error when the
+ connection is closed. based on the patch by Hugo Barauna.
+ [Bug #5190] [ruby-core:38930]
+
+Fri Aug 19 13:18:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * configure.in: defines _DARWIN_UNLIMITED_SELECT if the target_os
+ is darwin.
+
+Fri Aug 19 13:14:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * thread.c: add a description for the behavior of select(2) on
+ Mac OS X 10.7 (Lion).
+
+Fri Aug 19 11:28:58 2011 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/imap.rb (msg_att): accepts extra space before ')'.
+ based on the patch by art lussos. [Bug #5163] [ruby-core:38820]
+
+Wed Aug 17 23:01:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (cannot_be_coerced_into_BigDecimal):
+ remove duplication.
+
+Wed Aug 17 15:27:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (cannot_be_coerced_into_BigDecimal):
+ add a new function for raising error when an object cannot coerce
+ into BigDecimal. [Bug #5172]
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimalValueWithPrec): use
+ cannot_be_coerced_into_BigDecimal function.
+
+ * ext/bigdecimal/bigdecimal.c (BigMath_s_exp): ditto.
+
+ * ext/bigdecimal/bigdecimal.c (BigMath_s_log): ditto.
+
+ * test/bigdecimal/test_bigdecimal.rb: test for the above changes.
+
+ * test/bigdecimal/testbase.rb (under_gc_stress): add a new utility
+ method to run tests under the condition of GC.stress = true.
+
+Wed Aug 17 10:16:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * rational.c (nurat_coerce): Rational#coerce should converts itself
+ into Complex if the argument is a Complex with non-zero imaginary
+ part. [Bug #5020] [ruby-dev:44088]
+
+ * test/ruby/test_rational.rb (test_coerce): test for the above change.
+
+Wed Aug 17 06:33:19 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_x509cert.c: Add class documentation for
+ OpenSSL::X509::Certificate.
+
+Wed Aug 17 04:54:25 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_pkey.c: corrected docs, OpenSSL::PKey::DH does
+ *not* support #sign/verify.
+
+Tue Aug 16 18:56:54 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm.c (ruby_threadptr_data_type): rename to hide.
+ [ruby-core:38972]
+
+Tue Aug 16 18:52:08 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/mkexports.rb (Exports::Mswin#each_export): exclude Init_
+ and _threadptr_ functions, as well as mingw.
+
+Tue Aug 16 09:31:44 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/dl: Add documentation. Patch by Vincent Batts.
+ [Ruby 1.9 - Bug #5192]
+
+Tue Aug 16 08:48:26 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/.document (fiddle): Remove duplicate entry
+ * ext/fiddle: Complete documentation of Fiddle. Patch by Vincent
+ Batts. [#5192]
+
+Tue Aug 16 08:00:15 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/socket: Make Socket documentation appear. Add documentation for
+ Socket, TCPServer, SOCKSSocket. Patch by Sylvain Daubert.
+ [Ruby 1.9 - Feature #5182]
+
+Mon Aug 15 09:58:55 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_ssl.c: Support disabling OpenSSL compression.
+
+ * test/openssl/test_ssl.rb: Add a test for it.
+ Thanks to Eric Wong for the patch.
+ [Ruby 1.9 - Feature #5183] [ruby-core:38911]
+
+Sun Aug 14 05:57:01 2011 Tanaka Akira <akr@fsij.org>
+
+ * test/socket/test_socket.rb (test_connect_timeout): added a test
+ based on a patch by Eric Wong. [ruby-core:38910]
+
+Sat Aug 13 22:17:27 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/mkconfig.rb: do not make the entries related to sitedir and
+ verdordir if disabled by --without options. [ruby-core:38922]
+ [Bug #5187]
+
+Sat Aug 13 17:03:22 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: [ruby-core:38861]
+
+Sat Aug 13 09:39:07 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * test/date/test_*.rb: added tests.
+
+Sat Aug 13 09:36:19 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * ext/date/date_parse.c (parse_ddd_cb): fix r32896. RB_GC_GUARD
+ insertion position was mistaken. [ruby-dev:44337] [Bug #5152]
+
+Sat Aug 13 09:26:24 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/core_ext.rb: Make Kernel#y private.
+ [ruby-core:38913]
+
+ * test/psych/test_yaml.rb: corresponding test.
+
+Sat Aug 13 09:05:16 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c (date_strftime_alloc): followed the change
+ of r32885.
+
+ * doc/NEWS-1.9.3: followed the above change.
+
+Sat Aug 13 08:55:38 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/scalar_scanner.rb: Only consider strings
+ with fewer than 2 dots to be numbers. [ruby-core:38915]
+
+Sat Aug 13 08:47:20 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: [ruby-core:38855].
+
+Sat Aug 13 03:41:37 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/uri/common.rb: Fix documentation of URI::Parser.new. Patch by
+ Steve Klabnik. [Ruby 1.9 - Bug #5177]
+
+Sat Aug 13 02:19:57 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/digest/digest.c: Add documentation for the Digest module. Patch
+ by Sylvain Daubert. [Ruby 1.9 - Bug #5167]
+
+Sat Aug 13 01:56:11 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rake: Update to Rake 0.9.2.2. Prevent pollution of toplevel
+ namespace by Commands. Remove unused variable and debugging
+ statement in tests.
+
+Fri Aug 12 11:39:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: Describe "no" configure option for site_ruby
+ and vendor_ruby. Patch by Vit Ondruch. [Bug #5187][ruby-core:38921]
+
+Fri Aug 12 09:00:24 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Import RubyGems 1.8.8. Fixes encoding of YAML gemspec
+ from gems. Github Issue #149
+
+Fri Aug 12 08:17:46 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/ipsocket.c (init_inetsock_internal): use SOMAXCONN for
+ listen backlog.
+
+ * ext/socket/unixsocket.c (rsock_init_unixsock): ditto.
+
+ * ext/socket/lib/socket.rb (Addrinfo#listen): ditto.
+ (Socket.tcp_server_sockets_port0): ditto.
+
+ * ext/socket/mkconstants.rb: define SOMAXCONN as 5 if not available.
+
+ [ruby-core:38493]
+
+Fri Aug 12 03:24:35 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc: Import RDoc 3.9.2. Fixes TIDYLINK for HTML output.
+
+Thu Aug 11 15:37:42 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * variable.c (autoload_delete): An autoload entry is still in a
+ RCLASS_IV_TBL, not in a RCLASS_CONST_TBL, so take back the table
+ changed in r29600. And an autoload entry keeps not a
+ rb_const_entry_t but a NODE so remove rb_const_entry_t thing added
+ in r29602.
+
+Thu Aug 11 15:07:36 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (link_command): use LIBRUBYARG in rbconfig for
+ unbundled extensions. [ruby-core:38802] [Bug #5147]
+
+ * lib/mkmf.rb (init_mkmf): revert r32902. [ruby-core:38903]
+
+Wed Aug 10 23:03:55 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/lib/socket.rb: fix argument check in the previous commit.
+
+Wed Aug 10 22:12:28 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/lib/socket.rb (Socket.tcp): add :connect_timeout option.
+ (Addrinfo#connect_from): add :timeout option.
+ (Addrinfo#connect): ditto.
+ (Addrinfo#connect_to): ditto.
+ [ruby-core:38538]
+
+Wed Aug 10 21:27:19 2011 Tanaka Akira <akr@fsij.org>
+
+ * lib/net/pop.rb: fix typo in document.
+
+ * lib/net/http.rb: ditto.
+
+ * lib/net/imap.rb: ditto.
+
+Wed Aug 10 19:30:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * complex.c (nucomp_rationalize): calls rationalize of real part if
+ imaginary part is exactly zero. The patch is made by Marc-Andre
+ Lafortune. fixes [Bug #5178] [ruby-core:38885]
+
+ * test/ruby/test_complex.rb (test_rationalize): add a test for the
+ above change.
+
+ * complex.c (nucomp_to_r): fix RDoc comment. The patch is made by
+ Marc-Andre Lafortune.
+
+Wed Aug 10 14:11:07 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (init_mkmf): set $LIBRUBYARG regardless of shared
+ option. [ruby-core:38802] [Bug #5147]
+
+Wed Aug 10 02:53:27 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http.rb: come back autoload. OpenSSL constant is used
+ some places, so it leads mistakes like HTTP.start.
+
+Tue Aug 9 22:57:45 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * ext/date/date_parse.c (date_zone_to_diff): add RB_GC_GUARD.
+ [ruby-dev:44337] [Bug #5152]
+
+ * ext/date/data_parse.c (parse_ddd_cb): ditto.
+
+Tue Aug 9 14:25:47 2011 Naohisa Goto <ngotogenome@gmail.com>
+
+ * ext/fiddle/conversions.c (generic_to_value): ffi_arg and ffi_sarg
+ should be used to handle shorter return value. fix [Bug #3861]
+ [ruby-core:32504]
+
+ * ext/fiddle/closure.c (callback): ditto
+
+ * ext/fiddle/conversions.h (fiddle_generic): ditto
+
+ * ext/fiddle/conversions.c (value_to_generic): char, short and int
+ are strictly distinguished on big-endian CPU, e.g. sparc64.
+
+Tue Aug 9 11:21:08 2011 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c (gc_lazy_sweep): if sweep target slots are not found, we
+ try heap_increment() because it might be able to expand the
+ heap. [Bug #5127] [ruby-dev:44285]
+
+ * gc.c (gc_clear_mark_on_sweep_slots): if a sweeping was
+ interrupted, we expand the heap if at all possible.
+
+Tue Aug 9 12:20:33 2011 Naohisa Goto <ngotogenome@gmail.com>
+
+ * test/fiddle/helper.rb (libc_so, libm_so): Solaris support added.
+ [ruby-core:38853] [Bug #5168]
+
+ * test/dl/test_base.rb (libc_so, libm_so): on Solaris, remove libc
+ and libm version numbers for detecting default libc and libm.
+
+Tue Aug 9 09:18:04 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/zlib/zlib.c (gzfile_wrap): Document encoding options.
+
+ * ext/zlib/zlib.c (rb_gzwriter_s_open): ditto
+
+ * ext/zlib/zlib.c (rb_gzreader_s_open): ditto
+
+Sun Aug 7 23:31:32 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * time.c (rb_strftime_alloc): raise ERANGE if width is too large.
+ Patch by Nobuyoshi Nakada. [Bug #4457] [ruby-dev:43285]
+
+ * test/ruby/test_time.rb (class TestTime): add a test for the
+ above change.
+
+Sun Aug 7 22:51:45 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * ext/openssl/ossl_asn1.c (decode_eoc): remove unused variables.
+ Patch by Eric Wong. [Feature #5157] [ruby-core:38798]
+
+ * ext/openssl/ossl_asn1.c (ossl_asn1_decode): ditto.
+
+ * ext/openssl/ossl_pkey.c (ossl_pkey_new_from_data): ditto.
+
+Sun Aug 7 22:37:08 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: add -Wunused-variable to default CFLAGS.
+ Patch by Eric Wong. [Feature #5157] [ruby-core:38798]
+
+Sun Aug 7 15:37:35 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/digest/sha2/sha2ossl.c: use original SHA384_Final on DragonFly.
+
+Sun Aug 7 14:08:16 2011 Kazuki Tsujimoto <kazuki@callcc.net>
+
+ * ext/objspace/objspace.c: fix typos in a document.
+
+Sun Aug 7 07:14:57 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * cont.c (HAVE_GETCONTEXT): see getcontext(3) because DragonFly BSD
+ x64 port doesn't have it.
+
+Sun Aug 7 00:42:55 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/tk/lib/tk/wm.rb (Tk::Wm.command): Add the missing receiver
+ before calling epath. patched by flori
+ https://github.com/flori/ruby/commit/aa9474d32e5f2c57f8b0e2e0c528a03f06a4d433
+
+Sat Aug 6 07:06:34 2011 Eric Hodel <drbrain@segment7.net>
+
+ * marshal.c (w_object): Fix exception message when _dump_data is not
+ defined on a T_DATA object.
+
+Fri Aug 5 22:16:20 2011 Naohisa Goto <ngotogenome@gmail.com>
+
+ * numeric.c (rb_infinity, rb_nan): use WORDS_BIGENDIAN to get endian.
+ fix [Bug #5160] [ruby-dev:44356]
+
+Fri Aug 5 17:14:11 2011 Akinori MUSHA <knu@iDaemons.org>
+
+ * test/test_syslog.rb (TestSyslog#test_log): Do not be too
+ specific about the log line format. Fixes #5081.
+
+Fri Aug 5 15:57:10 2011 Naohisa Goto <ngotogenome@gmail.com>
+
+ * complex.c (f_signbit): fix compile error in gcc4 on Solaris with
+ CFLAGS="-std=gnu99". [ruby-dev:44355] fix [Bug #5159]
+
+ * math.c: ditto.
+
+Fri Aug 5 15:55:33 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/ruby/test_object.rb: tests that respond_to? returns false.
+
+Fri Aug 5 13:32:43 2011 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/xmlrpc/client.rb, lib/xmlrpc/server.rb: should use
+ String#bytesize instead of String#size.
+
+Fri Aug 5 12:18:20 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_eval.c (check_funcall): try respond_to? first if redefined.
+ [Bug #5158]
+
+Fri Aug 5 09:48:22 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems: Import RubyGems 1.8.7:
+ Added missing require for `gem uninstall --format-executable`.
+
+ The correct name of the executable being uninstalled is now displayed
+ with --format-executable.
+
+ Fixed `gem unpack uninstalled_gem` default version picker.
+
+ RubyGems no longer claims a nonexistent gem can be uninstalled.
+
+ `gem which` no longer claims directories are requirable files.
+
+ `gem cleanup` continues cleaning up gems if one can't be uninstalled
+ due to permissions. Issue #82.
+
+ Gem repository directories are no longer created world-writable.
+ Patch by Sakuro OZAWA. [Ruby 1.9 - Bug #4930]
+
+Fri Aug 5 07:00:31 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/io/console/test_io_console.rb (test_noctty): daemon() on
+ Fedora Rawhide seems not to detach the controlling terminal,
+ when the argument noclose is non-zero. ref: [Bug #5135]
+
+Thu Aug 4 23:48:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * thread_pthread.c (native_cond_signal): retry to call pthread_cond_signal
+ and pthread_cond_broadcast if they return EAGAIN in
+ native_cond_signal and native_cond_broadcast, respectively.
+ It is for the pthread implementation of Mac OS X 10.7 (Lion).
+ fixes #5155. [ruby-dev:44342].
+
+ * thread_pthread.c (native_cond_broadcast): ditto.
+
+ * thread_pthread.c (struct cached_thread_entry): stop using
+ pthread_cond_t and its functions directly.
+
+ * thread_pthread.c (register_cached_thread_and_wait): ditto.
+
+ * thread_pthread.c (use_cached_thread): ditto.
+
+Thu Aug 4 20:29:41 2011 Naohisa Goto <ngotogenome@gmail.com>
+
+ * configure.in: when Solaris cc, use $(CC) to link shared libs.
+
+Thu Aug 4 20:19:11 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * error.c (report_bug): use a small message buffer instead of BUFSIZ.
+ It is needed for avoiding nested SIGSEGV on Linux.
+ Note: BUFSIZ is not proper buffer size. It's unrelated with maximum
+ filename length. :-/
+ [Bug #5139] [ruby-dev:44315]
+
+Thu Aug 4 16:08:45 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/rbinstall.rb (gem): install all gemspecs under lib and ext.
+
+ * tool/rbinstall.rb (Gem::Specification): may not be defined when
+ cross-compiling and BASERUBY is 1.8.
+
+Thu Aug 4 11:30:36 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * include/ruby/missing.h: define __syscall on OpenBSD as r32702.
+
+Thu Aug 4 03:02:54 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * tool/rbinstall.rb: use rubygems to load gemspecs, copy actual
+ gemspecs on install rather than generate fake ones for all gems.
+
+Thu Aug 4 02:45:10 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * configure.in: set CXX variable to the C++ compiler that matches the
+ C compiler specified by CC variable (e.g. use g++-4.2 for gcc-4.2).
+
+Thu Aug 4 02:21:10 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (link_command): use static library only for bundled
+ extensions. [Bug #5147]
+
+Thu Aug 4 02:02:10 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/psych.gemspec: installing psych as a gem.
+
+Wed Aug 3 16:01:35 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * util.c, include/ruby/util.h (ruby_add_suffix): remove the function.
+ [Bug #5153] [ruby-core:38736]
+
+ * io.c (argf_next_argv): remove the call of above function.
+
+ * ext/-test-/add_suffix, test/-ext-/test_add_suffix.rb: remove the test
+ extension module because this is only for testing ruby_add_suffix().
+
+ * LEGAL: remove the mention about a part of util.c, because now we
+ removed the part.
+
+ * io.c (argf_next_argv): now the new filename is not guaranteed to
+ use, so should check the return value of rename(2).
+
+ * test/ruby/test_argf.rb (TestArgf#test_inplace_rename_impossible):
+ now we expect same result with other platforms on no_safe_rename
+ platforms (=Windows).
+
+Wed Aug 3 09:18:08 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * test/xmlrpc/webrick_testing.rb (WEBrick_Testing#start_server):
+ Like r32795, bind address should be specified.
+
+Wed Aug 3 07:46:30 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * encoding.c (enc_find): mistakenly remained !. [Bug #5150]
+
+Wed Aug 3 00:11:08 2011 Tanaka Akira <akr@fsij.org>
+
+ * lib/prettyprint.rb: update document. [ruby-core:36776]
+
+Tue Aug 2 22:04:46 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * gc.c (init_heap): allocate sigaltstack after heaps are allocated.
+ [ruby-dev:44315] [Bug #5139]
+
+ * vm.c (thread_free): use free because objspace is not ready.
+
+ * vm.c (th_init): use malloc because objspace is not ready.
+
+Tue Aug 2 20:10:16 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * test/testunit/test_parallel.rb: pass "--ruby" option to
+ test/testunit/tests_for_parallel/runner.rb. [Bug #5132] [ruby-dev:44303]
+
+Tue Aug 2 15:53:37 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * encoding.c (str_to_encoding): rename from to_encoding and
+ use str_to_encindex.
+
+ * encoding.c (str_to_encindex): split from to_encoding.
+
+ * encoding.c (rb_to_encoding): use str_to_encoding.
+
+ * encoding.c (rb_obj_encoding): don't bypass rb_encoding*.
+ If it uses rb_encoding*, it bypass encindex. If it uses encindex,
+ it doesn't bypass.
+
+ * encoding.c (enc_find): add shortcut for encoding object, use
+ str_to_encindex, and avoid bypass rb_encoding*.
+
+Tue Aug 2 12:03:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (recursive_hash): hash value of emptied hash should be
+ equal to an empty hash. [ruby-core:38650]
+
+Tue Aug 2 11:42:15 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (rb_enc_symname2_p): :! is valid symbol. [Bug #5136]
+
+Tue Aug 2 07:33:29 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * test/net/http/test_http.rb (TestNetHTTP_version_1_1_methods#test_timeout_during_HTTP_session):
+ If you connect to localhost, you should listen localhost.
+
+ * test/net/http/test_https.rb (TestNetHTTPS#test_timeout_during_SSL_handshake):
ditto.
-Sun Sep 19 13:44:24 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Aug 2 06:18:15 2011 Luis Lavena <luislavena@gmail.com>
+
+ * lib/rubygems/installer.rb (class Gem): Correct path check on Windows
+ Possible fix for [Ruby 1.9 - Bug #5111]
+ * test/rubygems/test_gem_installer.rb (load Gem): ditto
+
+Mon Aug 1 20:12:03 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_process.rb (TestProcess#windows?): new method.
+
+ * test/ruby/test_process.rb (TestProcess#*): use above method.
+
+ * test/ruby/test_process.rb (TestProcess#test_execopts_redirect):
+ windows doesn't support FD_CLOEXEC.
+
+Mon Aug 1 15:45:23 2011 Eric Hodel <drbrain@segment7.net>
+
+ * test/rake/test_rake_functional.rb: Don't assume the binary name of
+ ruby is "ruby". [Ruby 1.9 - Bug #5114]
+ * test/rake/helper.rb: ditto
+
+Mon Aug 1 15:31:14 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * test/io/console/test_io_console.rb (TestIO_Console#test_sync):
+ Skip when PTY allocation failed (that's not our fault).
+
+Mon Aug 1 15:04:12 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * test/xmlrpc/test_webrick_server.rb (Test_Webrick#setup_http_server):
+ XMLRPC::Client.new3(), when called without host: argument, tries
+ to connect to a host where "localhost" resolves to. On the
+ other hand a WEBrick::HTTPServer.new(), when called without
+ BindAddress: argument, tries to listen all the address where
+ getaddrinfo(AF_UNSPEC) resolves to. This is a mismatch because
+ "localhost" might not resolve to one of those listening sockets.
+ We would better explicitly specify "localhost" here and if
+ failed, just skip the whole test.
+
+Mon Aug 1 14:24:56 2011 Eric Hodel <drbrain@segment7.net>
- * configure.in (LIBRUBY_SO): fix an oversight of replace
- RUBY_INSTALL_NAME with RUBY_SO_NAME. a patch from Jeremy Evans
- at [ruby-core:32474].
+ * lib/rdoc.rb: Import RDoc 3.9.1. Fixes bugs in the RDoc::Markup
+ parser.
-Sun Sep 19 07:48:20 2010 Tanaka Akira <akr@fsij.org>
+Mon Aug 1 12:00:35 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/pathname/pathname.c (path_unlink): Pathname#unlink and
- Pathname#delete translated from pathname.rb.
+ * insns.def (concatstrings): don't use initial ASCII-8BIT string.
+ [ruby-core:38635] [Bug #5126]
-Sun Sep 19 06:06:07 2010 Kenta Murata <mrkn@mrkn.jp>
+Sun Jul 31 22:57:16 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * enc/Makefile.in (ECHO1): Same as the recent fix in common.mk.
+ ":" in a make variable replacement cause a syntax error with
+ /usr/ccs/bin/make on Solaris. Uses $(NULLCMD) instead.
+
+Sun Jul 31 21:16:02 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * complex.c (f_signbit): gcc4 on Solaris DOES have signbit but does
+ not have it on header.
+
+ * math.c: ditto.
+
+Sun Jul 31 21:09:04 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
- * ext/bigdecimal/bigdecimal.c (check_rounding_mode): added for
- converting symbol to rounding mode number.
+ * common.mk (node_name.inc): Use $(Q) for consistency.
+
+ * Makefile.in (INSNS): ditto.
+
+Sun Jul 31 21:19:51 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * lib/mkmf.rb (configuration:ECHO1): Same as the recent fix in
+ common.mk.
+ ":" in a make variable replacement cause a syntax error with
+ /usr/ccs/bin/make on Solaris. Uses $(NULLCMD) instead.
- * ext/bigdecimal/bigdecimal.c (BigDecimal_mode, BigDecimal_round):
- support to specify rounding mode by symbol.
+Sun Jul 31 20:39:12 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
- * test/bigdecimal/test_bigdecimal.rb (test_mode, test_round):
- add tests for above changes.
+ * common.mk (ECHO1): nmake does not allow parenthesis in make variable
+ replacement.
-Sun Sep 19 05:14:35 2010 Kenta Murata <mrkn@mrkn.jp>
+Sun Jul 31 23:06:57 2011 Kazuki Tsujimoto <kazuki@callcc.net>
- * ext/bigdecimal/bigdecimal.c: fix rounding algorithms for half-down
- and half-even. This change is based on the patch created by Matthew
- Willson, the reporter of this bug. [Bug #3803] [ruby-core:32136]
+ * vm.c (check_env): print debug messages to stderr.
+ [Feature #4871] [ruby-dev:43743]
- * test/bigdecimal/test_bigdecimal.rb: add tests for above changes.
+Sun Jul 31 22:50:23 2011 Kazuki Tsujimoto <kazuki@callcc.net>
-Sat Sep 18 20:09:51 2010 Tanaka Akira <akr@fsij.org>
+ * vm.c (vm_make_env_each): don't save prev env value.
+ It is no longer used. [Feature #4871] [ruby-dev:43743]
- * ext/pathname/pathname.c (path_each_entry): Pathname#each_entry
- translated from pathname.rb.
+ * vm.c (check_env): changed accordingly.
-Fri Sep 17 23:44:07 2010 Kouhei Sutou <kou@cozmixng.org>
+Sun Jul 31 20:21:36 2011 "Yuki Sonoda (Yugui)" <yugui@yugui.jp>
- * lib/rexml/xpath_parser.rb, test/rexml/test_xpath.rb:
- add missing method availability check. [ruby-core:32447]
- Reported by Wiebe Cazemier. Thanks!!!
+ * common.mk (ECHO1): ":" in a make variable replacement cause a syntax
+ error with /usr/ccs/bin/make on Solaris. Uses $(NULLCMD) instead.
-Fri Sep 17 23:23:26 2010 Kouhei Sutou <kou@cozmixng.org>
+ * configure.in (NULLCMD): new check.
- * test/rexml/test_sax.rb: don't use thread and sleep to avoid slow test.
+ * Makefile.in (NULLCMD): Reflects checking in configure.
-Fri Sep 17 23:10:44 2010 Kouhei Sutou <kou@cozmixng.org>
+ * win32/Makefile.sub (NULLCMD): new assignment.
- * test/rexml/test_core.rb: enable.
+Sun Jul 31 18:58:59 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Sep 17 22:46:02 2010 Kouhei Sutou <kou@cozmixng.org>
+ * io.c (rb_pipe): pipe on cygwin can succeed half but fail
+ half.
- * test/rexml/: untabify.
+Sun Jul 31 11:31:07 2011 Kazuki Tsujimoto <kazuki@callcc.net>
-Fri Sep 17 22:29:56 2010 Kouhei Sutou <kou@cozmixng.org>
+ * vm.c: check if cfp is valid. [Bug #5083] [ruby-dev:44208]
- * test/rexml/: fix fixture data path. All REXML tests are worked.
+Sun Jul 31 09:18:28 2011 Eric Hodel <drbrain@segment7.net>
-Fri Sep 17 22:15:15 2010 Kouhei Sutou <kou@cozmixng.org>
+ * lib/rdoc: Update to RDoc 3.9. Fixed `ri []`, stopdoc creating an
+ object reference, nodoc for class aliases, verbatim === lines.
- * test/rexml/test_listener.rb: remove needless codes.
+Sun Jul 31 01:29:08 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Fri Sep 17 22:12:23 2010 Kouhei Sutou <kou@cozmixng.org>
+ * io.c (rb_io_each_byte): remove unused variable e.
- * test/rexml/: import REXML tests from
- http://www.germane-software.com/repos/rexml/trunk/test/.
- Many tests are failed temporary. I'll fix them quickly. Sorry.
+Sat Jul 31 01:23:45 2011 Kenta Murata <mrkn@mrkn.jp>
-Fri Sep 17 16:48:49 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+ * test/bigdecimal/test_bigdecimal.rb (test_version): removed.
- * test/io/console/test_io_console.rb (TestIO_Console::helper):
- PTY.open is not guaranteed to work. On my machine opening a
- pty is prohibited via process control group. On those cases
- exceptions shall occur, and that doesn't mean our fault.
- Skip those tests on such situations.
+Sat Jul 30 23:19:09 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Sep 17 08:30:27 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * defs/default_gems: separate from tool/rbinstall.rb.
- * lib/tracer.rb: count only non-internal libraries in stack trace,
- ignoring custom_require. [ruby-core:31858]
+Sat Jul 30 23:14:44 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Fri Sep 17 02:18:41 2010 Akinori MUSHA <knu@iDaemons.org>
+ * io.c (rb_io_each_byte): rbuf can be refreshed during yield.
+ [Bug #5119]
- * tool/mkconfig.rb: Fix build with m4 1.4.15 generating duplicate
- lines in config.status. According to nobu, the mswin32 port may
- depend on the piece of code in question, so the behavior is left
- unchanged on mswin32.
+Sat Jul 30 22:35:50 2011 Naohisa Goto <ngotogenome@gmail.com>
-Thu Sep 16 23:47:59 2010 Tanaka Akira <akr@fsij.org>
+ * strftime.c (NEEDS): avoid SEGV due to integer overflow in
+ sparc-solaris2.10 and i686-linux. fix [Bug #4456] [ruby-dev:43284]
- * ext/pathname/pathname.c (path_opendir): Pathname#opendir translated
- from pathname.rb.
+Sat Jul 30 17:26:26 2011 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-Thu Sep 16 21:40:37 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/win32ole/test_win32ole_variant.rb: use skip method to skip the test.
- * lib/test/unit.rb (Test::Unit::GlobOption): merged RejectOption.
+ * test/win32ole/test_win32ole_variant_outarg.rb: ditto.
- * test/runner.rb: utilize GlobOption.
+Sat Jul 30 14:27:00 2011 Kenta Murata <mrkn@mrkn.jp>
-Thu Sep 16 21:31:24 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_version): version 1.1.0.
- * lib/rdoc/ri/driver.rb (RDoc::RI::Driver.setup_options)
- (RDoc::RI::Driver.fixup_options): split from process_args.
- libraries should not parse ARGV inside, since it's a task of
- applications, not libraries.
+ * ext/bigdecimal/bigdecimal.gemspec: turn into a default gem.
-Thu Sep 16 21:02:30 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * tool/rbinstall.rb: ditto.
- * lib/rdoc/ri/paths.rb (RDoc::RI::Paths.each): HOMEDIR can be nil
- if $HOME is unset.
+Sat Jul 30 11:21:55 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Thu Sep 16 14:50:42 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+ * vm_core.h (ALT_STACK_SIZE): use MINSIGSTKSZ*2 instead of SIGSTKSZ*2.
+ [ruby-core:38607]
- * test/ruby/test_file_exhaustive.rb (TestFileExhaustive::test_expand_path):
- ENV["HOME"] might not be set. On those cases without it an
- exception raises here, which effectively disables later
- tests on this method.
+Sat Jul 30 10:39:14 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Thu Sep 16 08:30:28 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm.c (th_init): preallocate alternative stack.
+ NoMemoryError is better than rb_bug, of course.
+ Patch by Eric Wong. [ruby-core:38572][ruby-core:38594].
- * sprintf.c (rb_f_sprintf): fix rdoc. pointed out by Tomoyuki
- Chikanaga at [ruby-core:32395], and a patch from Daniel
- Bovensiepen at [ruby-core:32403].
+ * signal.c (rb_register_sigaltstack): ditto.
-Thu Sep 16 08:27:36 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * vm_core.h: moved ALT_STACK_SIZE definition from signal.c.
+ * vm.c (thread_free): use xfree() instead of free().
- * ext/etc/extconf.rb: use expanded sysconfdir with empty DESTDIR.
- [ruby-core:32394]
+Sat Jul 30 07:20:49 2011 Tanaka Akira <akr@fsij.org>
-Thu Sep 16 06:07:24 2010 Tanaka Akira <akr@fsij.org>
+ * ext/socket/lib/socket.rb (udp_server_sockets): unused variable
+ removed.
+ patch by Jeremy Evans. [ruby-core:38600]
- * ext/pathname/pathname.c (path_rmdir): Pathname#rmdir translated
- from pathname.rb.
+Fri Jul 29 23:56:32 2011 Tanaka Akira <akr@fsij.org>
-Thu Sep 16 00:36:25 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/securerandom.rb: call OpenSSL::Random.seed at the
+ SecureRandom.random_bytes call.
+ based on the patch by Masahiro Tomita. [ruby-dev:44270]
- * ext/readline/extconf.rb: Remove Readline 6 check because
- Ruby's license is now GPLv3 compatible. [ruby-core:28736]
+Fri Jul 29 23:53:48 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Sep 16 00:26:00 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * array.c (rb_ary_set_len): new function to set array length.
- * COPYING: change Ruby's License from a dual license with GPLv2
- to a dual license with 2-clause BSDL.
- [ruby-dev:42166] [ruby-core:31971]
- [ruby-dev:39167] [ruby-core:25272]
+ * vm_eval.c (method_missing): set the length of argv array, to mark
+ arguments.
- * COPYING.ja: ditto.
+ * vm_eval.c (rb_apply): get rid of too large alloca.
- * BSDL: added. this is from The FreeBSD License.
+Fri Jul 29 20:48:39 2011 Tanaka Akira <akr@fsij.org>
-Wed Sep 15 21:07:06 2010 Tanaka Akira <akr@fsij.org>
+ * ext/socket/mkconstants.rb: fix typos.
- * ext/pathname/pathname.c (path_mkdir): Pathname#mkdir translated
- from pathname.rb.
+Fri Jul 29 20:28:56 2011 Tanaka Akira <akr@fsij.org>
-Wed Sep 15 13:37:00 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+ * ext/socket/mkconstants.rb: use whitespaces as a separator.
- * test/net/imap/test_imap.rb: "localhost" not guaranteed to
- resolve to "127.0.0.1". On my machine it is "::1" instead.
- The problem is, you have to connect to the imaps server via
- the canonical name written in a server certificate, and that
- of the server.cert is "localhost". So you have to listen to
- the address of what "localhost" resolves to. I think this
- situation cannot be resolved in a handy manner because the
- test "test_imaps_post_connection_check" is actually
- expecting to connect to a server via an address other than
- the CN. On my machine several assertions won't pass because
- the test cannot connect to the server.
+Fri Jul 29 18:59:07 2011 Tanaka Akira <akr@fsij.org>
-Wed Sep 15 09:12:03 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/socket/mkconstants.rb: add documents for constants.
+ patch by Eric Hodel. [ruby-core:37853] [Bug #4989]
- * io.c (rb_io_puts): fix for wide char encoding strings.
- [ruby-dev:42212]
+Fri Jul 29 16:00:43 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Sep 15 07:27:52 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * configure.in (enable_pthread): use -pthread on OpenBSD without
+ explicit option. patched by Jeremy Evans. [ruby-core:38572]
- * string.c (rb_str_format_m): mentioned about Hash argument. a patch
- from Daniel Bovensiepen at [ruby-core:32386].
+Thu Jul 28 23:36:28 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * sprintf.c (get_hash): ditto, and fix typo.
+ * ext/fiddle/closure.c (callback): use rb_ary_tmp_new() instead of
+ xmalloc() to allocate an array for arguments of callback procedure,
+ to prevent arguments from being swept by GC. [ruby-core:38546]
+ [Bug #4929]
-Wed Sep 15 07:22:20 2010 Tanaka Akira <akr@fsij.org>
+Thu Jul 28 22:36:06 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
- * ext/pathname/pathname.c (path_entries): Pathname#entries translated
- from pathname.rb.
+ * ext/openssl/ossl_cipher.c (ossl_cipher_initialize): Avoid possible
+ SEGV from AES encryption/decryption. Processing data by
+ Cipher#update without initializing key (meaningless usage of Cipher
+ object since we don't offer a way to export a key) could cause SEGV.
-Wed Sep 15 02:13:44 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+ In OpenSSL, the EVP which has EVP_CIPH_RAND_KEY flag (such as DES3)
+ allows uninitialized key, but other EVPs (such as AES) does not
+ allow it. Calling EVP_CipherUpdate() without initializing key causes
+ SEGV so we set the data filled with "\0" as the key by default. See
+ #2768.
- * ext/fiddle/closure.c : Don't use FFI closure alloc on OpenBSD.
- Thanks Jeremy Evans! [ruby-core:32384]
+ * test/openssl/test_cipher.rb: test it.
-Tue Sep 14 20:17:48 2010 Tanaka Akira <akr@fsij.org>
+Thu Jul 28 14:25:08 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/pathname/pathname.c (path_s_getwd): Pathname.getwd and
- Pathname.pwd translated from pathname.rb.
+ * lib/rubygems/user_interaction.rb (Gem::StreamUI#tty?): typo.
-Tue Sep 14 05:13:04 2010 Tanaka Akira <akr@fsij.org>
+Thu Jul 28 12:32:53 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/pathname/pathname.c (path_s_glob): Pathname.glob translated
- from pathname.rb.
+ * ext/dl/callback/mkcallback.rb (gencallback): use PTR2NUM.
-Tue Sep 14 01:24:51 2010 Yutaka Kanemoto <kanemoto@ruby-lang.org>
+ * ext/dl/cptr.c (rb_dlptr_aref, rb_dlptr_aset): check NULL pointer
+ dereference.
- * ext/socket/raddrinfo.c (ruby_getaddrinfo__aix): suppress a
- warning.
+ * ext/dl/cptr.c (rb_dlptr_s_to_ptr): use rb_check_funcall.
-Mon Sep 13 20:48:30 2010 Tanaka Akira <akr@fsij.org>
+ * ext/dl/cptr.c (rb_dlptr_s_to_ptr): fix wrapping condition.
- * ext/pathname/pathname.c (path_zero_p): Pathname#zero? translated
- from pathname.rb.
+Thu Jul 28 04:53:31 2011 Eric Hodel <drbrain@segment7.net>
-Mon Sep 13 19:56:50 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/delegate.rb: Move file-level documentation to the appropriate
+ classes.
- * ext/socket/rubysocket.h (__DARWIN_ALIGNBYTES): workaround of a
- bug in system header of darwin 9. [ruby-core:32341]
+Thu Jul 28 02:15:04 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Sep 13 18:11:55 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/dl/cfunc.c (dlcfunc_mark), ext/dl/cptr.c (dlptr_mark):
+ workaround to mark wrapped object. this is not a true fix,
+ because [Bug #4929] is caused by the interface design of DL.
- * lib/mkmf.rb (try_do): fix typo. a patch from Peter Weldon
- at [ruby-core:32327].
+Thu Jul 28 00:28:15 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Mon Sep 13 10:12:09 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/fileutils/test_fileutils.rb: add OpenBSD case.
+ patched by Jeremy Evans [ruby-core:38530] see #5097
- * util.c (ruby_strtod): reject Float('0x0.').
- [ruby-dev:42239] Bug #3820
+ * test/ruby/test_process.rb: ditto.
-Mon Sep 13 09:23:58 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Wed Jul 27 22:46:59 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
- * ext/openssl/ossl_bn.c (ossl_bn_is_prime): fix comparison
- with rb_scan_args. Before this fix, OpenSSL::BN#prime?
- is fully broken. [ruby-dev:42225]
+ * test/rinda/test_rinda.rb (test_remote_array_and_hash):
+ add local variables to protect objects from GC. [ruby-dev:44253]
+ [Bug #5104]
-Mon Sep 13 06:45:24 2010 Tanaka Akira <akr@fsij.org>
+Wed Jul 27 17:55:54 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/pathname/pathname.c (path_writable_real_p):
- Pathname#writable_real? translated from pathname.rb.
+ * include/ruby/missing.h: define __syscall if the platform has
+ __syscall in the library but doesn't define it in headers
+ for example Mac OS X.
-Sun Sep 12 21:21:50 2010 Tadayoshi Funaba <tadf@dotrb.org>
+Wed Jul 27 15:39:14 2011 Eric Hodel <drbrain@segment7.net>
- * lib/date.rb: [ruby-core:32096] Thanks Colin Bartlett.
+ * object.c: Add usage documentation for BasicObject. Based on patch
+ by Thomas Sawyer. [Ruby 1.9 - Bug #5067]
-Sun Sep 12 19:30:27 2010 Tanaka Akira <akr@fsij.org>
+Wed Jul 27 12:24:17 2011 Eric Hodel <drbrain@segment7.net>
- * ext/pathname/pathname.c (path_world_writable_p):
- Pathname#world_writable? translated from pathname.rb.
+ * lib/rubygems/uninstaller.rb: Add missing require and update
+ messaging to avoid confusion with uninstall --format-executable.
+ [Ruby 1.9 - Bug #4062]
-Sun Sep 12 09:16:06 2010 Tanaka Akira <akr@fsij.org>
+Wed Jul 27 09:34:24 2011 Eric Hodel <drbrain@segment7.net>
- * ext/pathname/pathname.c (path_writable_p): Pathname#writable?
- translated from pathname.rb.
+ * lib/rubygems: Update to RubyGems 1.8.6.1.
-Sun Sep 12 08:36:15 2010 Tanaka Akira <akr@fsij.org>
+Wed Jul 27 09:27:59 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * process.c (rlimit_resource_name2int): support more limits:
- RLIMIT_MSGQUEUE, RLIMIT_NICE, RLIMIT_RTPRIO, RLIMIT_RTTIME and
- RLIMIT_SIGPENDING.
- (Init_process): ditto.
- patch by Run Paint Run Run. [ruby-core:32262]
+ * test/openssl/test_pkcs12.rb: Add test and intermediate certificates.
+ [ Ruby 1.9 - Feature #3793 ] [ruby-core:32088]
-Sun Sep 12 04:27:13 2010 Tanaka Akira <akr@fsij.org>
+Wed Jul 27 01:05:32 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * process.c (rlimit_resource_name2int): use STRCASECMP to avoid
- ALLOCA_N.
+ * eval_error.c (rb_print_undef_str): new function to raise
+ NameError for undefined method.
-Sat Sep 11 16:47:41 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * load.c (rb_mod_autoload_p), object.c (rb_mod_const_get),
+ variable.c (rb_f_untrace_var, set_const_visibility), vm_method.c
+ (rb_mod_{remove,undef,alias}_method, set_method_visibility):
+ remove inadvertent symbol creation. based on the first patch by
+ Jeremy Evans at [ruby-core:38447]. [Feature #5089]
- * hash.c (ruby_setenv): raise if putenv and SetEnvironmentVariable
- failed, because of the restriction of the size on Windows.
- based on a patch from Peter Weldon at [ruby-core:32304]. fix:
- Bug#3812, [ruby-core:32250]
+ * vm_method.c (obj_respond_to): fix the respond_to_missing? override
+ case. based on the patch by Jeremy Evans at [ruby-core:38417].
+ [Feature #5072]
-Sat Sep 11 15:19:57 2010 Eric Hodel <drbrain@segment7.net>
+ * parse.y (rb_check_id): make the given name a symbol or a string.
+ based on the second patch by Jeremy Evans at [ruby-core:38447]
- * lib/webrick/httpauth/digestauth.rb (WEBrick::Config::DigestAuth):
- Add documentation
+Wed Jul 27 00:50:00 2011 Kenta Murata <mrkn@mrkn.jp>
- * lib/webrick/config.rb (WEBrick::Config::DigestAuth): Add
- documentation
+ * ext/bigdecimal/lib/bigdecimal/util.rb (Rational#to_d):
+ zero or negative precision is error. fixes #5098.
+ [ruby-dev:44210]
-Sat Sep 11 12:32:05 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * test/bigdecimal/test_bigdecimal_util.rb: add test for the above
+ change.
- * include/ruby/intern.h (rb_set_kcode, rb_get_kcode): removed
- zombie prototype declarations. a patch from Eric Hodel
- at [ruby-core:32305].
+Wed Jul 27 00:48:00 2011 Kenta Murata <mrkn@mrkn.jp>
-Sat Sep 11 06:53:12 2010 Tanaka Akira <akr@fsij.org>
+ * ext/bigdecimal/lib/bigdecimal/util.rb (Float#to_d): modified for
+ specifying precision. fixes #5098. [ruby-dev:44210]
- * ext/pathname/pathname.c (path_symlink_p): Pathname#symlink?
- translated from pathname.rb.
+ * test/bigdecimal/test_bigdecimal_util.rb: add test for the above
+ change.
-Fri Sep 10 23:03:43 2010 Tanaka Akira <akr@fsij.org>
+Wed Jul 27 00:45:00 2011 Kenta Murata <mrkn@mrkn.jp>
- * ext/pathname/pathname.c (path_sticky_p): Pathname#sticky? translated
- from pathname.rb.
+ * ext/bigdecimal/lib/bigdecimal/util.rb (Integer#to_d): added
+ for symmetry to BigDecimal() function with an Integer.
+ fixes #5098. [ruby-dev:44210]
-Fri Sep 10 19:11:13 2010 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * test/bigdecimal/test_bigdecimal_util.rb: add test for the above
+ change.
- * lib/webrick/httprequest.rb (WEBrick::HTTPRequest#continue): add
- method for generating HTTP/1.1 100 continue response if the client
- expects it, otherwise does nothing. Patch by Brian Candler.
- ref #855.
+Wed Jul 27 00:30:00 2011 Kenta Murata <mrkn@mrkn.jp>
- * test/webrick/test_httprequest.rb: test added.
+ * ext/bigdecimal/lib/bigdecimal/util.rb (BigDecimal#to_d): added
+ for adapting other Numeric subclasses. [ruby-dev:44245]
-Fri Sep 10 17:49:34 2010 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * test/bigdecimal/test_bigdecimal_util.rb: test for the above change.
- * ext/openssl/lib/openssl/x509-internal.rb: removed unused local
- variable.
+Wed Jul 27 00:27:00 2011 Kenta Murata <mrkn@mrkn.jp>
- * test/openssl/*: less warnings while test running with -w.
+ * bigdecimal/bigdecimal.c (VpDup) a new function for duplicating
+ a BigDecimal.
-Fri Sep 10 16:49:20 2010 Akinori MUSHA <knu@iDaemons.org>
+ * bigdecimal/bigdecimal.c (BigDecimal_new): support generating a new
+ BigDecimal from another BigDecimal using BigDecimal global function
+ or constructor. [ruby-dev:44245]
- * class.c (rb_scan_args): Add support for optional keyword
- argument hash. [ruby-dev:42221] [ruby-dev:38048]
+Tue Jul 26 23:33:24 2011 Igor Zubkov <igor.zubkov@gmail.com>
- * README.EXT, README.EXT.ja: Update documentation accordingly.
+ * array.c: Fix typo. https://github.com/ruby/ruby/pull/36
- * dir.c (dir_initialize): Make use of the new rb_scan_args()
- feature.
+Mon Jul 25 23:51:01 2011 Yusuke Endoh <mame@tsg.ne.jp>
- * io.c (rb_io_s_popen, rb_scan_open_args, rb_io_initialize)
- (rb_io_s_pipe, open_key_args, io_s_foreach, io_s_readlines)
- (rb_io_s_read, rb_io_set_encoding): Ditto.
+ * proc.c: pre-allocate the unlinked_method_entry_list_entry struct to
+ avoid memory allocation during GC. based on a patch from Eric Wong.
+ [ruby-core:38498]
- * transcode.c (str_transcode, econv_args)
- (econv_primitive_convert): Ditto.
+Mon Jul 25 23:39:33 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/zlib/zlib.c (rb_gzreader_initialize): Ditto.
+ * test/rake/test_rake_directory_task.rb (TestRakeDirectoryTask#
+ test_directory_win32): fixed wrong test.
-Fri Sep 10 10:33:18 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Jul 25 22:36:11 2011 Yusuke Endoh <mame@tsg.ne.jp>
- * random.c (rb_genrand_ulong_limited): renamed from
- rb_rand_internal and now this is public API.
+ * proc.c (struct METHOD), gc.c (gc_marks), vm_method.c
+ (rb_gc_mark_unlinked_live_method_entries): fix SEGV bug.
+ rb_method_entry_t was free'd even when the method is still on the
+ stack if it is BMETHOD (i.e., Method#call). This is because
+ rb_method_entry_t is embedded in struct METHOD. This commit
+ separates them and marks the live method entries.
+ See [ruby-core:38449] in detail. fix [Bug #5047] [ruby-core:38171]
- * include/ruby/ruby.h (rb_genrand_ulong_limited): added.
+Mon Jul 25 22:14:37 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
- * bignum.c (big_sparse_p): use rb_genrand_ulong_limited.
+ * lib/xmlrpc/client.rb: Fix possible HTTP header formatting failure by
+ 'Basic' header. Long username caused the base64 String truncation in
+ HTTP header which is not allowed. See #5046.
-Fri Sep 10 13:07:22 2010 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * test/xmlrpc/test_webrick_server.rb: test it.
- * ext/digest/lib/digest.rb: removed unused exception variable
- assignment to avoid a warning.
+Mon Jul 25 15:04:33 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
-Fri Sep 10 07:29:14 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/openssl/lib/openssl.rb: End of transition period introduced by
+ [ruby-dev:38018]. From the next version of 1.9.3, you should use
+ require "openssl"
+ instead of
+ require "openssl/ssl"
+ and
+ require "openssl/x509"
- * ext/etc/etc.c (etc_systmpdir): assume system default tmpdir
- safe. [ruby-dev:42089]
+Mon Jul 25 13:46:38 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
-Fri Sep 10 07:03:23 2010 Tanaka Akira <akr@fsij.org>
+ * ext/openssl/lib/openssl/x509.rb: Cosmetic change: move definition
+ introduced in r30152 to x509-internal.rb.
- * ext/pathname/pathname.c (path_size_p): Pathname#size? translated from
- pathname.rb.
+Mon Jul 25 13:09:42 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
-Fri Sep 10 02:15:29 2010 Tanaka Akira <akr@fsij.org>
+ * ext/openssl/ossl_ssl.c (ossl_ssl_shutdown): Avoid randomly generated
+ SSLError from SSLSocket just after invoking SSLSocket#close.
+ OpenSSL's SSL_shutdown could try to send alert packet and it might
+ set SSLerr(global error stack) as the result. It causes the next
+ SSL read/write operation to fail by unrelated reason.
- * ext/socket/option.c (inspect_peercred): support OpenBSD-current.
- patch by Jeremy Evans. [ruby-core:32240]
+ By design, we're ignoring any error at SSL_shutdown() so we clear
+ global error stack after SSL_shutdown is called. See #5039.
-Thu Sep 9 23:25:53 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Jul 24 20:29:53 2011 Tanaka Akira <akr@fsij.org>
- * vm.c (vm_backtrace_each): skip allocator frames which have no
- name. [ruby-core:32231]
+ * ext/socket/extconf.rb: refine the recvmsg test.
-Thu Sep 9 22:39:08 2010 Tanaka Akira <akr@fsij.org>
+Sun Jul 24 20:02:31 2011 Tanaka Akira <akr@fsij.org>
- * ext/pathname/pathname.c (path_size): Pathname#size translated from
- pathname.rb.
+ * ext/socket/extconf.rb: fix the recvmsg test.
-Thu Sep 9 22:34:48 2010 wanabe <s.wanabe@gmail.com>
+Sun Jul 24 08:42:51 2011 Tanaka Akira <akr@fsij.org>
- * compile.c (case_when_optimizable_literal): When float value can be
- treated as integer, add to table hash of case that way.
- based on a patch from Ikuo KOBORI. [ruby-dev:42038]
+ * ext/socket/extconf.rb: test recvmsg allocates file descriptors for
+ fd passing even with MSG_PEEK.
- * insns.def (opt_case_dispatch): ditto.
+ * ext/socket/ancdata.c: use the above test result.
- * test/ruby/test_case.rb: add tests.
+Sun Jul 24 01:04:50 2011 Eric Hodel <drbrain@segment7.net>
-Thu Sep 9 17:15:15 2010 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * lib/rubygems/specification.rb: Restore behavior of
+ Gem::Specification#loaded. [Ruby 1.9 - Bug #5032]
- * test/net/http/test_https.rb (test_identity_verify_failure): follows
- the SSL hostname check error message of openssl.
+Sun Jul 24 00:05:00 2011 Jeremy Evans <merch-redmine@jeremyevans.net>
-Thu Sep 9 10:44:46 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * error.c (rb_name_error_str): new function to raise NameError
+ with the name string but not ID.
- * test/ruby/test_env.rb (test_aset): OpenBSD acts like NetBSD in
- that it ignores characters after = in ENV.
- patched by Jeremy Evans [ruby-core:32184]
+ * object.c, proc.c, variable.c: more removal of inadvertent symbol
+ creation. [Feature #5079]
-Thu Sep 9 09:02:01 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Sat Jul 23 21:14:00 2011 Tadayoshi Funaba <tadf@dotrb.org>
- * tool/rbinstall.rb (install?): gemspec filename should include
- its version. patched by Luis Lavena [ruby-core:32165]
+ * lib/cmath.rb (cbrt): should return a real number if possible.
-Wed Sep 8 22:46:31 2010 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Sat Jul 23 20:12:52 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/openssl/ossl_ssl.c (ssl_get_error): Thread context switch was
- blocked on Windows while blocking call for SSLSocket. Need to
- convert errno for letting rb_io_wait_readable detect EWOULDBLOCK.
- Patch by arton. ref #3794.
+ * test/rake/test_rake_functional.rb (setup): Use __FILE__ for the base
+ directory. Current directory is not the top source directory when
+ the building process runs on other than there.
-Wed Sep 8 20:56:57 2010 Tanaka Akira <akr@fsij.org>
+ * test/rake/test_rake_rake_test_loader.rb: ditto.
- * ext/pathname/pathname.c (path_setgid_p): Pathname#setgid? translated
- from pathname.rb.
+ * test/rake/test_rake_task_argument_parsing.rb
+ (test_terminal_width_using_hardcoded_80): hardcoded 80 is used
+ when app.unix? is false.
-Wed Sep 8 06:25:41 2010 Tanaka Akira <akr@fsij.org>
+Sat Jul 23 20:11:50 2011 Tadayoshi Funaba <tadf@dotrb.org>
- * ext/pathname/pathname.c (path_setuid_p): Pathname#setuid? translated
- from pathname.rb.
+ * ext/date/date_core.c: an issue that is same as [ruby-dev:44071].
+ * ext/date/date_strftime.c: identical to [ruby-dev:44112].
-Tue Sep 7 21:03:35 2010 Tanaka Akira <akr@fsij.org>
+Sat Jul 23 19:12:53 2011 Masaki Suketa <masaki.suketa@nifty.ne.jp>
- * ext/pathname/pathname.c (path_readable_real_p):
- Pathname#readable_real? translated from pathname.rb.
+ * test/win32ole/test_err_in_callback.rb (test_err_in_callback):
+ skip test if ADODB.connection is not available.
-Mon Sep 6 23:07:25 2010 Tanaka Akira <akr@fsij.org>
+Sat Jul 23 15:37:04 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/pathname/pathname.c (path_world_readable_p):
- Pathname#world_readable? translated from pathname.rb.
+ * parse.y (rb_enc_symname_type): :$a!, @a! and so on are not
+ valid symbols, so they should be inspected with quotes.
-Mon Sep 6 11:03:13 2010 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+Sat Jul 23 17:06:25 2011 Tanaka Akira <akr@fsij.org>
- * Fixed wrong check of missing functions. Patch by Adrian Quark.
- ref #3400
- The patch contains following comment:
- This patch should avoid unnecessary incompatibility with future
- versions of Openssl. Changes suggested by bmaher_at_amazon.com.
+ * io.c (rb_update_max_fd): validate fd.
-Mon Sep 6 10:46:55 2010 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+ * ext/socket/rubysocket.h (rsock_discard_cmsg_resource): add
+ msg_peek_p argument for the declaration.
- * Fixed exception message for SSL post connection check failure. Patch
- by Paul Betteridge. ref [Bug #3704]
+ * ext/socket/ancdata.c (discard_cmsg): add msg_peek_p argument.
+ assume FreeBSD, NetBSD and MacOS X doesn't generate passed fd
+ when MSG_PEEK.
+ (rsock_discard_cmsg_resource): add msg_peek_p argument.
+ (bsock_recvmsg_internal): call rsock_discard_cmsg_resource with
+ msg_peek_p argument.
-Mon Sep 6 10:31:59 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/socket/unixsocket.c (unix_recv_io): call
+ rsock_discard_cmsg_resource with msg_peek_p argument.
- * ext/readline/readline.c (readline_s_get_line_buffer):
- Readline.line_buffer should return locale string.
- [ruby-dev:42184] #3791
+Sat Jul 23 14:38:28 2011 Eric Hodel <drbrain@segment7.net>
-Mon Sep 6 09:47:24 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/rake*: Remove dependencies on flexmock and session gems.
+ [Ruby 1.9 - Bug #4987]
- * util.c (ruby_strtod): check there is at least 1 digit after
- "0x" before ".". [ruby-dev:42183] #3790
+Sat Jul 23 12:19:04 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Mon Sep 6 09:44:50 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * parse.y (rb_check_id): take care of attrset ID created
+ implicitly by local ID. [Bug #5084]
- * util.c (ruby_strtod): check integer overflow.
- [ruby-dev:42180] #3789
+ * parse.y (rb_check_id): conversion condition was inverse.
+ [Bug #5084]
-Mon Sep 6 06:17:21 2010 Tanaka Akira <akr@fsij.org>
+Fri Jul 22 21:46:54 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/pathname/pathname.c (path_readable_p): Pathname#readable?
- translated from pathname.rb.
+ * vm_insnhelper.c (vm_call_cfunc): added volatile for a workaround
+ of cfp consistency error problem on OS X 10.7 (Lion). It's
+ suspected llvm optimization bug.
+ [Bug #5074] [ruby-dev:44185]
-Sun Sep 5 23:02:34 2010 Tanaka Akira <akr@fsij.org>
+Fri Jul 22 21:18:20 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/pathname/pathname.c (path_owned_p): Pathname#owned?
- translated from pathname.rb.
+ * lib/uri/generic.rb (WFKV_): unroll the loop of regexp.
-Sat Sep 4 23:48:47 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * lib/uri/generic.rb (URI.decode_www_form_component): ditto.
- * file.c (rb_file_s_readlink): symlink target should be in
- filesystem encoding.
+Fri Jul 22 21:06:39 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Sep 4 10:40:50 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * object.c (rb_mod_{const,cvar}_defined, rb_obj_ivar_defined):
+ avoid inadvertent symbol creation in reflection methods. based
+ on a patch by Jeremy Evans at [ruby-core:38367]. [Feature #5072]
- * load.c (ruby_init_ext): export for golfers.
+ * vm_method.c (rb_mod_method_defined)
+ (rb_mod_{public,private,protected}_method_defined)
+ (obj_respond_to): ditto.
- * vm_core.h (rb_iseq_eval, rb_iseq_compile_with_option): ditto.
+ * parse.y (rb_check_id): new function returns already interned ID
+ or 0.
-Sun May 23 17:29:41 2010 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+Fri Jul 22 20:44:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * common.mk (capi): uses a timestamp file to get rid of
- generating twice.
+ * parse.y (rb_is_global_id, rb_is_attrset_id): add missing
+ predicates.
-Fri Jun 18 01:33:21 2010 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+Fri Jul 22 20:24:38 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * enc/Makefile.in (realclean): has been missing. necessary
- for make realclean-enc.
+ * test/ruby/test_object.rb (TestObject#test_respond_to_missing):
+ 2nd argument of respond_to_missing? is not optional.
-Fri Sep 3 23:51:26 2010 Tanaka Akira <akr@fsij.org>
+Fri Jul 22 19:05:47 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/pathname/pathname.c (path_socket_p): Pathname#socket?
- translated from pathname.rb.
+ * parse.y (rb_enc_symname2_p): get rid of potential out-of-bound
+ access.
-Fri Sep 3 06:40:44 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jul 22 13:55:59 2011 Eric Hodel <drbrain@segment7.net>
- * ext/pty/pty.c (chfunc): pass through exceptions.
+ * lib/net/http.rb: Net::HTTP#finish is used to manually close
+ connections. [Ruby 1.9 - Bug #5045]
- * io.c (rb_io_bufwrite, rb_io_bufread): added.
+Fri Jul 22 13:51:29 2011 Eric Hodel <drbrain@segment7.net>
- * process.c (rb_fork_err): protect from exceptions.
+ * ext/readline/readline.c: Add examples for Readline.completion_proc=.
+ [Ruby 1.9 - Bug #5057]
-Fri Sep 3 06:16:07 2010 Tanaka Akira <akr@fsij.org>
+Fri Jul 22 13:03:12 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * ext/pathname/pathname.c (path_pipe_p): Pathname#pipe?
- translated from pathname.rb.
+ * ext/openssl/ossl_hmac.c: Revert checking return type of
+ HMAC_Init_ex as it is not compatible with OpenSSL < 1.0.0.
-Fri Sep 3 06:14:40 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jul 22 12:10:21 2011 Eric Hodel <drbrain@segment7.net>
- * ext/pty/pty.c (chfunc): restore errno from SystemCallError and
- propagate proper exception to the parent. [ruby-dev:41965]
+ * tool/rbinstall.rb (default gems): Install executables into the fake
+ gem dir for Gem.bin_path. [#4485]
-Thu Sep 2 22:10:38 2010 Tanaka Akira <akr@fsij.org>
+Fri Jul 22 11:20:20 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * ext/pathname/pathname.c (path_file_p): Pathname#file?
- translated from pathname.rb.
+ * ext/openssl/ossl_digest.c: Check return value of EVP_DigestInit_ex.
+ * ext/openssl/ossl_hmac.c: Check return value of HMAC_Init_ex.
+ Thanks, Jared Jennings, for the patch.
+ [ Ruby 1.9 - Bug #4944 ] [ruby-core:37670]
-Thu Sep 2 09:12:02 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Jul 22 09:09:43 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * win32/win32.c (rb_w32_spawn, rb_w32_aspawn): don't forget to free
- memory.
+ * ext/openssl/ossl_engine.c: Avoid double free of ENGINE reference.
+ * test/openssl/test_engine.rb: Add a test for it.
+ Thanks to Ippei Obayashi for providing the patch.
+ [ Ruby 1.9 - Bug #5062 ] [ruby-dev:44173]
-Thu Sep 2 09:01:13 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+Fri Jul 22 06:37:13 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * win32/win32.c (CreateChild): unicodize.
+ * lib/csv.rb: Do not modify CSV.generate's argument [ruby-core:38356]
- * win32/win32.c (rb_w32_spawn, rb_w32_aspawn): convert arguments of
- CreateChild() from ACP to WideChar.
+Thu Jul 21 20:59:59 2011 Tanaka Akira <akr@fsij.org>
-Thu Sep 2 06:53:43 2010 Tanaka Akira <akr@fsij.org>
+ * ext/socket/ancdata.c (discard_cmsg): workaround for MacOS X Lion.
- * ext/pathname/pathname.c (path_directory_p): Pathname#directory?
- translated from pathname.rb.
+Thu Jul 21 20:02:11 2011 Yusuke Endoh <mame@tsg.ne.jp>
-Wed Sep 1 22:03:41 2010 Tanaka Akira <akr@fsij.org>
+ * thread.c (set_trace_func, thread_set_trace_func_m): reset tracing
+ state when set_trace_func hook is removed. This is workaround patch
+ to force to reset tracing state that is broken by continuation call.
+ a patch from James M. Lawrence. [Feature #4347] [ruby-core:34998]
- * ext/pathname/pathname.c (path_grpowned_p): Pathname#grpowned?
- translated from pathname.rb.
+ * test/ruby/test_continuation.rb (class TestContinuation): add a test
+ for above. a patch from James M. Lawrence.
-Wed Sep 1 17:39:02 2010 Ryan Davis <ryand-ruby@zenspider.com>
+Thu Jul 21 19:27:19 2011 Yusuke Endoh <mame@tsg.ne.jp>
- * lib/minitest/*.rb: Imported minitest 1.7.1 r5835.
- * test/minitest/*.rb: ditto.
+ * node.c (dump_node): add today's knowledge. "init arguments (m)" and
+ "init arguments (p)" of compile.c indicates a Ruby code that
+ evaluates multiple assignments that is in method or block
+ parameters: def foo((m1,m2), (m3,m4), *r, (p1,p2), (p3,p4)); end
+ The former (init arguments (m)) evaluates the multiple assignments
+ before rest argument, that are (m1,m2) and (m3,m4). The letter
+ (init arguments (p)) does ones after rest argument, that are
+ (p1,p2) and (p3, p4).
-Wed Sep 1 16:50:42 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Thu Jul 21 18:11:07 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * string.c (tr_setup_table): optimized. don't create hash objects
- when given pattern is ASCII only.
+ * enum.c (enum_inject): remove empty line to notify rdoc
+ Enumerable#reduce is alias. patched by milki@github.
+ https://github.com/ruby/ruby/pull/26
- * string.c (tr_find): ditto.
+Thu Jul 21 17:30:21 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Sep 1 14:35:29 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * array.c (rb_ary_delete_at_m): use simple array literal in rdoc.
+ patched by samuel tonini. [ruby-core:38310] [Bug #5066]
- * array.c (rb_ary_rotate_m): fix typo of rdoc.
- patched by Andrei Kulakov [ruby-core:31975]
+Thu Jul 21 17:14:21 2011 NARUSE, Yui <naruse@ruby-lang.org>
-Wed Sep 1 14:33:36 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * lib/webrick/httprequest.rb (WEBrick::HTTPRequest#each):
+ Allow HTTP/0.9 request which doesn't has any header or body.
+ patched by Felix Jodoin. [ruby-core:38040] [Bug #5022]
- * enum.c (enum_zip): fix typo of rdoc.
- patched by Andrei Kulakov [ruby-core:31974]
+Wed Jul 20 23:02:18 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-Wed Sep 1 12:56:36 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (rb_update_max_fd): remove parentheses. they are not in
+ macro.
- * thread.c (ruby_suppress_tracing): restore the state and invoke
- the func with normal state. a patch from Satoshi Shiba <shiba
- AT rvm.jp> at [ruby-dev:42162]. [ruby-core:31783]
+Wed Jul 20 22:22:23 2011 Tanaka Akira <akr@fsij.org>
-Tue Aug 31 21:10:23 2010 Tanaka Akira <akr@fsij.org>
+ * include/ruby/intern.h (rb_update_max_fd): declaration moved from
+ internal.h.
- * ext/pathname/pathname.c (path_exist_p): Pathname#exist? translated
- from pathname.rb.
+ * file.c: ditto.
-Tue Aug 31 17:32:34 2010 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+ * io.c: call rb_update_max_fd for each new fds.
- * ext/tk/stubs.c: fix [Bug #3771] "VC++ can't make ext/tk with enabling
- stubs". Thanks, Akio Tajima [ruby-dev:42159].
+ * process.c: ditto.
-Tue Aug 31 03:42:14 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * random.c: ditto.
- * string.c (tr_setup_table): fix bug in r29146.
- Initialize table even if cflag is 0; tr_find see whether
- del is empty or not.
+ * ruby.c: ditto.
- * string.c (tr_find): nodel can't be NULL; if NULL, it means
- it is not specified.
+ * ext/io/console/console.c: ditto.
-Mon Aug 30 21:29:21 2010 Tanaka Akira <akr@fsij.org>
+ * ext/openssl/ossl_bio.c: ditto.
- * ext/pathname/pathname.c (path_executable_real_p):
- Pathname#executable_real? translated from pathname.rb.
+ * ext/pty/pty.c: ditto.
-Mon Aug 30 15:00:13 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * ext/socket/init.c: ditto.
- * string.c (tr_setup_table): initialize negating table when
- negating string is given. [ruby-core:31851]
+ * ext/socket/socket.c: ditto.
- * string.c (tr_find): add a sentence for the time when
- target characters include negating one.
+ * ext/socket/ancdata.c: ditto.
- * string.c (rb_str_count): move definition.
+ * ext/socket/unixsocket.c: ditto.
-Mon Aug 30 07:32:41 2010 Tanaka Akira <akr@fsij.org>
+Wed Jul 20 15:16:22 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * ext/pathname/pathname.c (path_executable_p): Pathname#executable?
- translated from pathname.rb.
+ * ext/dl/handle.c (dlhandle_sym): clear previous error with dlerror()
+ before calling dlsym(). [ruby-dev:44091] [Bug #5021]
-Sun Aug 29 23:54:10 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Jul 20 07:16:26 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
- * lib/rdoc/parser/ruby.rb (RDoc#parse_call_parameters): don't
- include assignment. [Bug #3759], [ruby-dev:42154]
+ * NEWS: mention Kernel#warn. [ruby-core:38119] [Feature #5029]
- * lib/rdoc/parser/ruby.rb (RDoc#parse_class): ignore non-constant
- name singleton class. [Bug #3759], [ruby-dev:42154]
+Tue Jul 19 16:40:45 2011 TAKANO Mitsuhiro (takano32) <tak@no32.tk>
-Sun Aug 29 23:25:18 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * cont.c (cont_save_thread): fix missing semicolon.
- * file.c (rb_get_path_check): clarify error message for
- ASCII-incompatible path name.
+Tue Jul 19 16:25:15 2011 Tanaka Akira <akr@fsij.org>
-Sun Aug 29 16:02:54 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * io.c (UPDATE_MAXFD): removed.
- * common.mk (node_name.inc): remove command option -n and give
- file as stdin, because IronRuby 1.1 still doesn't support it.
- So now we can use ir.exe as BASERUBY.
+Tue Jul 19 16:07:45 2011 Tanaka Akira <akr@fsij.org>
- * tool/node_name.rb: read stdin with while gets.
+ * io.c (rb_update_max_fd): new function.
-Sun Aug 29 13:22:43 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * internal.h (rb_update_max_fd): declare rb_update_max_fd.
- * vm.c (rb_thread_method_id_and_class): curried proc has no
- method. [ruby-core:31871]
+ * thread_pthread.c (rb_thread_create_timer_thread): update max fd when
+ timer thread pipe is created.
-Sun Aug 29 12:51:33 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jul 18 13:36:47 2011 Aaron Patterson <aaron@tenderlovemaking.com>
- * load.c (rb_provide_feature): clarify error message for frozen
- $LOADED_FEATURES. based on a patch from Run Paint Run Run at
- [ruby-core:31913].
+ * ext/psych/lib/psych.rb: define a new BadAlias error class.
-Sun Aug 29 12:19:58 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * ext/psych/lib/psych/visitors/to_ruby.rb: raise an exception when
+ deserializing an alias that does not exist.
- * load.c (load_failed): should honor encoding. [ruby-core:31915]
+ * test/psych/test_merge_keys.rb: corresponding test.
-Sun Aug 29 09:35:10 2010 NARUSE, Yui <naruse@ruby-lang.org>
+Mon Jul 18 00:00:46 2011 Shugo Maeda <shugo@ruby-lang.org>
- * common.mk (clean): exclude *.inc. [ruby-dev:41931]
+ * ext/curses/curses.c: added the new class Curses::Pad, which
+ supports scrolling. patch by Eric Hodel. [Feature #4896]
+ [ruby-core:37206]
- * common.mk (distclean): include *.inc.
+Sun Jul 17 16:26:40 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * common.mk (help): change description about clean and distclean.
+ * error.c (rb_check_trusted): new function to check an object is
+ trusted.
-Sat Aug 29 06:34:52 2010 Tanaka Akira <akr@fsij.org>
+ * struct.c (rb_struct_modify), time.c (time_modify): check by the
+ above function to show proper class names. [Bug #5036]
- * ext/pathname/pathname.c (path_chardev_p): Pathname#chardev?
- translated from pathname.rb.
+Sun Jul 17 15:30:04 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Sat Aug 28 17:39:33 2010 Kenta Murata <mrkn@mrkn.jp>
+ * error.c (rb_warn_m): accept multiple args in like puts. rdoc
+ patch by Erik Price at [ruby-core:38119]. [Feature #5029]
- * ext/bigdecimal/bigdecimal.c (BigDecimal_save_exception_mode,
- BigDecimal_save_rounding_mode, BigDecimal_save_limit): added.
+Sun Jul 17 07:56:31 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
- * test/bigdecimal/test_bigdecimal.rb: added tests for the above
- features.
+ * test/openssl/test_ssl_session.rb: add PEM SSL session without TLS
+ extensions. Use this as the default for the tests to ensure
+ compatibility with OpenSSL 0.9.7.
+ [ Ruby 1.9 - Bug #4961 ] [ruby-core:37726]
-Sat Aug 28 08:11:05 2010 Tanaka Akira <akr@fsij.org>
+Sat Jul 16 17:29:20 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * ext/pathname/pathname.c (path_blockdev_p): Pathname#blockdev?
- translated from pathname.rb.
+ * configure.in (RUBY_UNIVERSAL_ARCH): restore arch flag.
+ Bug #4977
-Fri Aug 27 16:20:01 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+Sat Jul 16 06:27:51 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
- * string.c (rb_str_prepend): new method by Shota Fukumori (sora_h)
- [Feature #3765]
+ * lib/uri/common.rb (module): Remove optional parser argument to
+ Kernel#URI
+ [ruby-core:38061]
-Fri Aug 27 15:24:20 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * lib/uri/generic.rb (module): ditto
- * math.c (math_atan2): you should know that M_PI is not the feature
- of C90.
- fixed build failure caused by r29115.
+Sat Jul 16 03:19:45 2011 NAKAMURA Usaku <usa@ruby-lang.org>
-Fri Aug 27 15:26:33 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * win32/win32.c (is_socket, is_console): add prototypes to fix compile
+ problem with gcc introduced at r32549.
+ reported by Jon Forums. [Bug #5030] [ruby-core:38079]
- * file.c (null_device): move from io.c.
+Sat Jul 16 00:55:38 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Fri Aug 27 12:47:44 2010 Kenta Murata <mrkn@mrkn.jp>
+ * time.c (time_dup): used rb_obj_class() instead of CLASS_OF().
+ The patch is made by Kazuki Tsujimoto. [Bug #5012] [ruby-dev:44071]
- * math.c (math_atan2): change the behavior when x and y are zero.
- [ruby-dev:42090] [Bug #3736] [ruby-dev:42116]
+ * test/ruby/test_time.rb (TestTime#test_getlocal_dont_share_eigenclass):
+ added a new test for eigenclass of time object.
- * test/ruby/test_math.rb (test_atan2): add tests for the above
- changes.
+Fri Jul 15 19:11:00 2011 Kenta Murata <mrkn@mrkn.jp>
-Fri Aug 27 12:26:23 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+ * bignum.c (bigsub_int): add RB_GC_GUARD. This patch is made by
+ Makoto Kishimoto. fixes #4223 [ruby-dev:42907]
- * object.c (rb_obj_class): remove mention of obsolete method.
- a patch from Run Paint Run Run at [ruby-core:31842].
+ * bignum.c (bigadd_int): ditto.
-Fri Aug 27 12:25:03 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jul 15 14:27:53 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * io.c (null_device): the name of null device. [ruby-dev:41791]
+ * win32/win32.c, include/ruby/win32.h (rb_w32_io_cancelable_p): renamed
+ from rb_w32_has_cancel_io(). now it takes a parameter as fd to check
+ the fd is console or not, because we cannot cancel console input even
+ if we have cancel_io function.
-Fri Aug 27 07:57:34 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * io.c (WAIT_FD_IN_WIN32): call above function instead of the old one,
+ so now we can kill the thread which calls STDIN.gets.
+ the problem was reported by ko1 via IRC.
- * array.c (rb_ary_shuffle_bang): bail out from modification during
- shuffle.
+Fri Jul 15 09:10:41 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
- * array.c (rb_ary_sample): ditto.
+ * ext/digest/sha2/sha2.c (SHA256_Update, SHA512_Update): avoid Bus
+ Error caused by unalignment access on Sparc-Solaris (and possibly on
+ other similar environment.) This patch just do memcpy always instead
+ of checking architecture. I see no perf drop on my 64bit env. For
+ more details, see #4320.
-Fri Aug 27 05:11:51 2010 Tanaka Akira <akr@fsij.org>
+ * test/digest/test_digest.rb: add test for unalignment access.
- * ext/pathname/pathname.c (path_sysopen): Pathname#sysopen translated
- from pathname.rb.
+Fri Jul 15 01:51:25 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
-Thu Aug 26 22:53:56 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * regint.h (PLATFORM_UNALIGNED_WORD_ACCESS): Power PC does not
+ allow unaligned word access.
- * array.c (rb_ary_shuffle): rdoc fix. argument name was missing.
- a patch from Run Paint Run Run at [ruby-core:31848].
+ * st.c (UNALIGNED_WORD_ACCESS): x86_64 allows unaligned word
+ access as well as i386.
-Thu Aug 26 21:49:46 2010 Tanaka Akira <akr@fsij.org>
+Thu Jul 14 12:19:34 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
- * ext/pathname/pathname.c (path_readlines): Pathname#readlines
- translated from pathname.rb.
+ * ext/openssl/ossl.c (ossl_verify_cb): trap the exception from
+ verify callback of SSLContext and X509Store and make the
+ verification fail normally. Raising exception directly from callback
+ causes orphan resources in OpenSSL stack. Patched by Ippei Obayashi.
+ See #4445.
-Thu Aug 26 10:37:00 2010 NARUSE, Yui <naruse@ruby-lang.org>
+ * test/openssl/test_ssl.rb
+ (test_exception_in_verify_callback_is_ignored): test it.
- * regint.h (OnigStackIndex): the type should be intptr_t.
- Original Oniguruma assumes the size of long and that of void *
- are equal, but it's not true on LLP64 platform: mswin64.
- originally patched by shintaro kuwamoto [ruby-dev:42133]
+Tue Jul 12 23:41:49 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-Thu Aug 26 10:38:11 2010 Yutaka Kanemoto <kanemoto@ruby-lang.org>
+ * NEWS: add a description of Signal.trap change.
- * test/dl/test_base.rb: AIX does not have dynamically loadable lib[cm].
+Tue Jul 12 20:02:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/fiddle/helper.rb: AIX does not have dynamically loadable lib[cm].
+ * signal.c (reserved_signal_p): reverted a part of r32523.
+ chikanaga noticed trap(:CHLD) has some realworld usecase.
+ * test/ruby/test_signal.rb (TestSignal#test_reserved_signal):
+ ditto.
-Thu Aug 26 09:49:50 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jul 12 17:12:45 2011 Yukihiro Matsumoto <matz@ruby-lang.org>
- * array.c (rb_ary_shuffle_bang): check number of argument.
+ * vm_method.c (rb_add_method): should not call method_added hook
+ for undef operation. [Bug #5015]
-Tue Aug 26 09:11:40 2010 Kenta Murata <mrkn@mrkn.jp>
+Tue Jul 12 16:58:44 2011 Shota Fukumori <sorah@tubusu.net>
- * ext/bigdecimal/bigdecimal.c (Init_bigdecimal,
- rmpd_set_thread_local_exception_mode, VpGetException,
- VpSetException): thread-local exception mode.
+ * lib/test/unit.rb(Test::Unit::Options#process_args): Fix bug.
+ Fix process_args didn't return `@option` after r30939.
- * ext/bigdecimal/bigdecimal.c (Init_bigdecimal,
- rmpd_set_thread_local_precision_limit, VpGetPrecLimit,
- VpSetPrecLimit): thread-local precision limit.
+Tue Jul 12 14:07:46 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/bigdecimal/bigdecimal.c (Init_bigdecimal,
- rmpd_set_thread_local_rounding_mode, VpGetRoundMode,
- VpSetRoundMode, VpException, VpInternalRound):
- thread-local rounding mode.
+ * signal.c (install_sighandler): fixed a race.
- * ext/bigdecimal/bigdecimal.c (BigDecimal_mode, BigDecimal_round,
- VpIsRoundMode, VpGetRoundMode, VpSetRoundMode, VpActiveRound,
- VpMidRound, VpLeftRound), ext/bigdecimal/bigdecimal.h:
- use unsigned short for rounding mode.
+Tue Jul 12 13:49:32 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * test/bigdecimal/test_bigdecimal.rb (test_mode): add test for
- setting rounding mode.
+ * signal.c (sig_trap): don't permit to change a signal handler which
+ the interpreter reserved.
+ * signal.c (reserved_signal_p): ditto.
+ [Bug #2616] [ruby-core:27625]
- * test/bigdecimal/test_bigdecimal.rb (test_thread_local_mode):
- add test for setting mode thread-locally.
+ * test/ruby/test_signal.rb (TestSignal#test_reserved_signal):
+ added a test for reserved signal.
-Thu Aug 26 07:29:54 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jul 12 11:58:28 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * array.c (rb_ary_{shuffle_bang,sample}): use Random class object.
+ * win32/setup.mak: support x86-amd64 cross compile environment.
- * random.c (try_get_rnd): use default_rand for Random as same as
- singleton methods.
+Mon Jul 11 23:22:28 2011 Yutaka Kanemoto <kanemoto@ruby-lang.org>
- * random.c (rb_random_real): check the range of result.
+ * time.c: can't compile time.c on AIX due to missing declaration for
+ ffs(). It is declared in strings.h on AIX.
-Wed Aug 25 22:11:11 2010 Tanaka Akira <akr@fsij.org>
+Mon Jul 11 15:54:24 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/pathname/pathname.c (path_binread): Pathname#binread translated
- from pathname.rb.
+ * process.c: removed signal() macro. It's no longer used.
-Wed Aug 25 03:42:43 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Jul 11 15:02:24 2011 NAKAMURA Usaku <usa@ruby-lang.org>
- * ext/dl/cfunc.c (rb_dlcfunc_call): workaround for VC9 for x64.
- reported by kuwamoto shintaro in [ruby-dev:42125].
+ * numeric.c (rb_num2ull): use FIX2LONG instead of FIX2ULONG. see
+ rb_num2ulong(). fixed the problem of ObjectSpace._id2ref of IL32LLP64
+ platforms, introduced at r32433.
-Tue Aug 24 23:28:50 2010 Yusuke Endoh <mame@tsg.ne.jp>
+Mon Jul 11 05:38:05 2011 Yutaka Kanemoto <kanemoto@ruby-lang.org>
- * .gitignore: updated.
+ * thread_pthread.c (get_stack): need to adjust stack addr for
+ [Bug #1813] on AIX.
-Tue Aug 24 22:07:28 2010 Tanaka Akira <akr@fsij.org>
+Mon Jul 11 01:16:27 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
- * ext/pathname/pathname.c (path_read): Pathname#read translated from
- pathname.rb.
+ * thread_pthread.c (rb_thread_create_timer_thread): removed
+ rb_disable_interrupt()/rb_enable_interrupt().
+ * vm_core.h: ditto.
+ * process.c (static void before_exec): ditto.
+ * process.c (static void after_exec): ditto.
+ [Bug #4765] [ruby-dev:43571]
-Tue Aug 24 10:11:04 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * eval_intern.h: removed rb_trap_restore_mask().
+ * vm_eval.c (rb_throw_obj): ditto.
+ * eval.c (setup_exception): ditto.
- * configure.in: read API version from include/ruby/version.h.
+ * signal.c: removed trap_last_mask.
+ * signal.c (trap_restore_mask): removed.
+ * signal.c (init_sigchld): comment clarification why signal block
+ is needed. and removed trap_last_mask operation.
+ * signal.c (trap_ensure): removed trap_last_mask operation.
- * {bcc,win}32/setup.mak (-version-): ditto.
+ * signal.c (rb_disable_interrupt, rb_enable_interrupt): made
+ static and removed sigdelset(SIGVTALRM) and sigdelset(SIGSEGV).
- * version.h (RUBY_LIB_VERSION): use API version numbers.
+ * process.c (rb_syswait): removed implicit signal handler change.
-Tue Aug 24 07:07:28 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Jul 10 23:49:12 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
- * array.c (rb_ary_shuffle_bang, rb_ary_sample): add optional
- argument random. [ruby-dev:41923] [EXPERIMENTAL]
+ * docs/NEWS-1.9.3: moved from NEWS.
- * random.c (rb_random_{int32,real,bytes}): fallback to normal
- method invocation.
+ * docs/ChangeLog-1.9.3: merged ChangeLog for 1.9.3.
-Tue Aug 24 06:08:10 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+ * NEWS: NEWS for 1.9.4 that describes changes since 1.9.3
- * include/ruby/version.h (RUBY_API_VERSION_*): renamed and moved
- from version.h. [ruby-dev:42103]
+ * ChangeLog: new ChangeLog for 1.9.4.
-Tue Aug 24 05:58:18 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sun Jul 10 23:30:52 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
- * ChangeLog: flushed. [ruby-dev:42050]
+ * version.h (RUBY_VERSION): ruby_1_9_3 branch was forked.
For the changes before 1.9.3, see doc/ChangeLog-1.9.3
For the changes before 1.8.0, see doc/ChangeLog-1.8.0
diff --git a/GPL b/GPL
index 5b6e7c66c2..d159169d10 100644
--- a/GPL
+++ b/GPL
@@ -1,12 +1,12 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
- Preamble
+ Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
+the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
@@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
-
- GNU GENERAL PUBLIC LICENSE
+
+ GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
-
+
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
-
+
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@ impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
-
+
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
- NO WARRANTY
+ NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
@@ -303,10 +303,9 @@ the "copyright" line and a pointer to where the full notice is found.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
@@ -336,5 +335,5 @@ necessary. Here is a sample; alter the names:
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
+library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
diff --git a/KNOWNBUGS.rb b/KNOWNBUGS.rb
index 5c0e4d5156..b97a08d928 100644
--- a/KNOWNBUGS.rb
+++ b/KNOWNBUGS.rb
@@ -3,14 +3,3 @@
# So all tests will cause failure.
#
-assert_normal_exit %q{
- open("tst-remove-load.rb", "w") {|f|
- f << <<-'End'
- module Kernel
- remove_method :load
- end
- raise
- End
- }
- load "tst-remove-load.rb"
-}, '[ruby-dev:40234] [ruby-core:27959]', :timeout => 1
diff --git a/LEGAL b/LEGAL
index 0086b83665..65706459cd 100644
--- a/LEGAL
+++ b/LEGAL
@@ -148,7 +148,6 @@ util.c (partly):
REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
-util.c (partly):
win32/win32.[ch]:
You can apply the Artistic License to these files. (or GPL,
diff --git a/Makefile.in b/Makefile.in
index bcdaf5f7a9..72770604ce 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,18 +1,23 @@
SHELL = /bin/sh
NULLCMD = @NULLCMD@
+n=$(NULLCMD)
+ECHO1 = $(V:1=@$n)
RUNCMD = $(SHELL)
CHDIR = @CHDIR@
exec = exec
NULL = /dev/null
+PATH_SEPARATOR = @PATH_SEPARATOR@
#### Start of system configuration section. ####
srcdir = @srcdir@
top_srcdir = $(srcdir)
hdrdir = $(srcdir)/include
+PLATFORM_DIR = @PLATFORM_DIR@
CC = @CC@
CPP = @CPP@
+LD = @LD@
YACC = bison
PURIFY =
AUTOCONF = autoconf
@@ -48,40 +53,50 @@ empty =
OUTFLAG = @OUTFLAG@$(empty)
COUTFLAG = @COUTFLAG@$(empty)
ARCH_FLAG = @ARCH_FLAG@
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ $(ARCH_FLAG)
cflags = @cflags@
optflags = @optflags@
debugflags = @debugflags@
-warnflags = @warnflags@
+warnflags = @warnflags@ @strict_warnflags@
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(srcdir)
XCFLAGS = @XCFLAGS@
CPPFLAGS = @CPPFLAGS@ $(INCFLAGS)
LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@
-EXTLDFLAGS =
+EXTLDFLAGS = @EXTLDFLAGS@
XLDFLAGS = @XLDFLAGS@ $(EXTLDFLAGS)
-EXTLIBS =
+EXTLIBS =
LIBS = @LIBS@ $(EXTLIBS)
MISSING = @LIBOBJS@ @ALLOCA@
LDSHARED = @LIBRUBY_LDSHARED@
-DLDFLAGS = @LIBRUBY_DLDFLAGS@ $(EXTLDFLAGS) $(ARCH_FLAG)
+DLDFLAGS = @LIBRUBY_DLDFLAGS@ $(XLDFLAGS) $(ARCH_FLAG)
SOLIBS = @SOLIBS@
MAINLIBS = @MAINLIBS@
ARCHMINIOBJS = @MINIOBJS@
+DLNOBJ = @DLNOBJ@
+ENCOBJS = @ENCOBJS@
+EXTOBJS = @EXTOBJS@
BUILTIN_ENCOBJS = @BUILTIN_ENCOBJS@
BUILTIN_TRANSSRCS = @BUILTIN_TRANSSRCS@
BUILTIN_TRANSOBJS = @BUILTIN_TRANSOBJS@
+POSTLINK = @POSTLINK@
RUBY_BASE_NAME=@RUBY_BASE_NAME@
RUBY_PROGRAM_VERSION=@RUBY_PROGRAM_VERSION@
RUBY_INSTALL_NAME=@RUBY_INSTALL_NAME@
RUBY_SO_NAME=@RUBY_SO_NAME@
+RUBY_RELEASE_DATE=@RUBY_RELEASE_DATE@
EXEEXT = @EXEEXT@
+LIBEXT = @LIBEXT@
PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
RUBY = $(RUBY_INSTALL_NAME)
MINIRUBY = @MINIRUBY@\
$(MINIRUBYOPT)
-RUNRUBY = @RUNRUBY@ $(RUNRUBYOPT) -- $(RUN_OPTS)
+RUNRUBY_COMMAND = @RUNRUBY@ $(RUNRUBYOPT)
+RUNRUBY = $(RUNRUBY_COMMAND) -- $(RUN_OPTS)
+RUNRUBY_DEBUGGER = --debugger='gdb -x run.gdb --quiet --args'
XRUBY = @XRUBY@
+BTESTRUBY = @BTESTRUBY@\
+ $(MINIRUBYOPT)
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -105,6 +120,8 @@ LIBRUBY = @LIBRUBY@
LIBRUBYARG = @LIBRUBYARG@
LIBRUBYARG_STATIC = @LIBRUBYARG_STATIC@
LIBRUBYARG_SHARED = @LIBRUBYARG_SHARED@
+LIBRUBY_RELATIVE = @LIBRUBY_RELATIVE@
+LIBRUBY_A_OBJS = @LIBRUBY_A_OBJS@
THREAD_MODEL = @THREAD_MODEL@
@@ -133,6 +150,10 @@ OBJDUMP = @OBJDUMP@
OBJCOPY = @OBJCOPY@
VCS = @VCS@
VCSUP = @VCSUP@
+DTRACE = @DTRACE@
+DTRACE_EXT = @DTRACE_EXT@
+DTRACE_OBJ = @DTRACE_OBJ@
+DTRACE_GLOMMED_OBJ = @DTRACE_GLOMMED_OBJ@
OBJEXT = @OBJEXT@
ASMEXT = S
@@ -144,7 +165,13 @@ INSTALLED_LIST= .installed.list
MKMAIN_CMD = mkmain.sh
+NEWLINE_C = newline.c
+MINIPRELUDE_C = miniprelude.c
+
SRC_FILE = $<
+OS_SRC_FILE = $<
+DEST_FILE = $@
+OS_DEST_FILE = $@
MESSAGE_BEGIN = @for line in
MESSAGE_END = ; do echo "$$line"; done
@@ -152,6 +179,8 @@ MESSAGE_END = ; do echo "$$line"; done
configure_args = @configure_args@
#### End of variables
+.SUFFIXES: .inc .h .c .y .i .$(DTRACE_EXT)
+
all:
.DEFAULT: all
@@ -162,12 +191,13 @@ all:
miniruby$(EXEEXT):
@-if test -f $@; then $(MV) -f $@ $@.old; $(RM) $@.old; fi
$(ECHO) linking $@
- $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(DMYEXT) $(LIBS) $(OUTFLAG)$@
+ $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(DMYEXT) $(DTRACE_OBJ) $(LIBS) $(OUTFLAG)$@
$(PROGRAM):
@$(RM) $@
$(ECHO) linking $@
- $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) $(OUTFLAG)$@
+ $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) $(EXTLIBS) $(OUTFLAG)$@
+ $(Q) $(POSTLINK)
# We must `rm' the library each time this rule is invoked because "updating" a
# MAB library on Apple/NeXT (see --enable-fat-binary in configure) is not
@@ -175,13 +205,16 @@ $(PROGRAM):
$(LIBRUBY_A):
@$(RM) $@
$(ECHO) linking static-library $@
- $(Q) $(AR) $(ARFLAGS) $@ $(OBJS) $(DMYEXT)
+ $(Q) $(AR) $(ARFLAGS) $@ $(LIBRUBY_A_OBJS) $(DMYEXT)
@-$(RANLIB) $@ 2> /dev/null || true
+ $(ECHO) verifying static-library $@
+ @$(PURIFY) $(CC) $(XLDFLAGS) $(MAINOBJ) $(LIBRUBY_A) $(MAINLIBS) $(EXTLIBS) $(LIBS) $(OUTFLAG)conftest$(EXEEXT) $(LDFLAGS)
+ @$(RM) conftest$(EXEEXT) conftest.c
$(LIBRUBY_SO):
@-$(PRE_LIBRUBY_UPDATE)
$(ECHO) linking shared-library $@
- $(Q) $(LDSHARED) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(SOLIBS) $(OUTFLAG)$@
+ $(Q) $(LDSHARED) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(DTRACE_OBJ) $(SOLIBS) $(EXTSOLIBS) $(OUTFLAG)$@
-$(Q) $(OBJCOPY) -w -L '$(SYMBOL_PREFIX)Init_*' -L '$(SYMBOL_PREFIX)*_threadptr_*' $@
@-$(MINIRUBY) -e 'ARGV.each{|link| File.delete link if File.exist? link; \
File.symlink "$(LIBRUBY_SO)", link}' \
@@ -234,7 +267,8 @@ config.status-args = ./config.status --recheck
reconfig-exec-0 = exec 3>&1; exit `exec 4>&1; { "$$@" 3>&- 4>&-; echo $$? 1>&4; } | fgrep -v '(cached)' 1>&3`
reconfig-exec-1 = set -x; "$$@"
-reconfig config.status: $(srcdir)/configure $(srcdir)/enc/Makefile.in
+reconfig config.status: $(srcdir)/configure $(srcdir)/enc/Makefile.in \
+ $(srcdir)/include/ruby/version.h
@PWD= MINIRUBY="$(MINIRUBY)"; export MINIRUBY; \
set $(SHELL) $($@-args); $(reconfig-exec-$(V))
@@ -242,6 +276,7 @@ $(srcdir)/configure: $(srcdir)/configure.in
$(CHDIR) $(srcdir) && exec $(AUTOCONF)
incs: id.h
+all-incs: probes.h
# Things which should be considered:
# * with gperf v.s. without gperf
@@ -275,7 +310,7 @@ enc/unicode/name2ctype.h: enc/unicode/name2ctype.kwd
trap '$(RM) $@-1.h $@-2.h' 0 && \
set -x; \
sed '/^#ifdef USE_UNICODE_PROPERTIES/,/^#endif/d' $? | gperf $(NAME2CTYPE_OPTIONS) > $@-1.h && \
- gperf $(NAME2CTYPE_OPTIONS) < $? > $@-2.h && \
+ sed '/^#ifdef USE_UNICODE_PROPERTIES/d;/^#endif/d' $? | gperf $(NAME2CTYPE_OPTIONS) > $@-2.h && \
diff -DUSE_UNICODE_PROPERTIES $@-1.h $@-2.h > $@.tmp || :; \
$(MV) $@.tmp $@ && \
$(CP) $? $(?:.kwd=.src) && \
@@ -296,16 +331,47 @@ enc/unicode/name2ctype.h: enc/unicode/name2ctype.kwd
.c.i:
@$(ECHO) preprocessing $<
- $(Q) $(CPP) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -E $< > $@
+ $(Q) $(CPP) $(warnflags) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -E $< > $@
+
+.d.h:
+ @$(ECHO) translating probes $<
+ $(Q) $(DTRACE) -o $@.tmp -h -C $(INCFLAGS) -s $<
+ $(Q) sed -e 's/RUBY_/RUBY_DTRACE_/g' -e 's/PROBES_H_TMP/PROBES_H/g' -e 's/(char \*/(const char */g' -e 's/, char \*/, const char */g' $@.tmp > $@
+ $(Q) $(RM) $@.tmp
+
+.dmyh.h:
+ @$(ECHO) copying dummy $(DEST_FILE)
+ $(Q) $(CP) $(OS_SRC_FILE) $(OS_DEST_FILE)
+
+probes.@OBJEXT@: $(srcdir)/probes.d
+ @$(ECHO) processing probes in object files
+ $(Q) stamp="$*.stamp"; \
+ if test -f "$$stamp" -o -f "$@"; then \
+ $(RM) $(DTRACE_DEPENDENT_OBJS) "$$stamp"; \
+ for o in $(DTRACE_DEPENDENT_OBJS); do \
+ echo "rebuilding $$o which was modified by \"dtrace -G\""; \
+ $(MAKE) "$$o"; \
+ done; \
+ fi; \
+ touch "$$stamp"
+ $(RM) $@
+ $(Q) $(DTRACE) -G -C $(INCFLAGS) -s $(srcdir)/probes.d -o $@ $(DTRACE_DEPENDENT_OBJS)
+
+# DTrace static library hacks described here:
+# http://mail.opensolaris.org/pipermail/dtrace-discuss/2005-August/000207.html
+ruby-glommed.$(OBJEXT):
+ @$(ECHO) generating a glommed object with DTrace probes for static library
+ $(Q) $(LD) -r -o $@ $(OBJS) $(DTRACE_OBJ)
clean-local::
- $(Q)$(RM) ext/extinit.c ext/extinit.$(OBJEXT) ext/ripper/y.output
+ $(Q)$(RM) ext/extinit.c ext/extinit.$(OBJEXT) ext/ripper/y.output \
+ enc/encinit.c enc/encinit.$(OBJEXT)
-$(Q)$(RM) $(pkgconfig_DATA)
distclean-local::
$(Q)$(RM) ext/config.cache $(RBCONFIG) Doxyfile
-$(Q)$(RM) run.gdb
- -$(Q)$(RM) $(INSTALLED_LIST) $(arch_hdrdir)/ruby/config.h
+ -$(Q)$(RM) $(INSTALLED_LIST) $(arch_hdrdir)/ruby/config.h verconf.h
-$(Q)$(RMDIRS) $(arch_hdrdir)/ruby 2> /dev/null || true
clean-ext distclean-ext realclean-ext::
@@ -323,8 +389,10 @@ clean-ext distclean-ext realclean-ext::
$(RMDIRS) "ext/$$dir" 2> /dev/null || true;; \
esac; \
done
+ -$(Q)$(RM) ext/extinit.$(OBJEXT)
distclean-ext realclean-ext::
+ -$(Q)$(RM) ext/extinit.c
-$(Q)$(RMDIR) ext 2> /dev/null || true
clean-extout:
@@ -342,11 +410,16 @@ clean-capi distclean-capi realclean-capi:
@echo $(@:-capi=ing) capi
$(Q)$(RMALL) $(CAPIOUT)
+clean-platform:
+ @$(RM) $(PLATFORM_D)
+ -$(Q) $(RMDIR) $(PLATFORM_DIR) 2> /dev/null || true
ext/extinit.$(OBJEXT): ext/extinit.c $(SETUP)
$(ECHO) compiling $@
$(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c ext/extinit.c
+enc/encinit.$(OBJEXT): enc/encinit.c $(SETUP)
+
up::
@$(CHDIR) "$(srcdir)" && LC_TIME=C exec $(VCSUP)
@@ -382,4 +455,4 @@ $(INSNS): $(srcdir)/insns.def vm_opts.h \
$(srcdir)/defs/opt_operand.def $(srcdir)/defs/opt_insn_unif.def \
$(srcdir)/tool/instruction.rb $(srcdir)/tool/insns2vm.rb
$(ECHO) generating $@
- $(Q) $(BASERUBY) -Ks $(srcdir)/tool/insns2vm.rb $(INSNS2VMOPT) $@
+ $(Q) $(BASERUBY) -Ku $(srcdir)/tool/insns2vm.rb $(INSNS2VMOPT) $@
diff --git a/NEWS b/NEWS
index 7aea2bff40..45d6363498 100644
--- a/NEWS
+++ b/NEWS
@@ -8,317 +8,394 @@ Note that each entry is kept so brief that no reason behind or
reference information is supplied with. For a full list of changes
with all sufficient information, see the ChangeLog file.
-== Changes since the 1.9.2 release
-=== License
-
-* Ruby's License is changed from a dual license with GPLv2
- to a dual license with 2-clause BSDL.
+== Changes since the 1.9.3 release
=== C API updates
-
-* rb_scan_args() is enhanced with support for option hash argument
- extraction.
-
-* ruby_vm_at_exit() added. This enables extension libs to hook a VM
- termination.
+* NUM2SHORT() and NUM2USHORT() added. They are similar to NUM2INT, but short.
+* rb_newobj_of() and NEWOBJ_OF() added. They create a new object of a given class.
=== Library updates (outstanding ones only)
* builtin classes
- * ARGF
- * new methods:
- * ARGF.print
- * ARGF.printf
- * ARGF.putc
- * ARGF.puts
- * ARGF.read_nonblock
- * ARGF.to_write_io
- * ARGF.write
-
* Array
+ * added method:
+ * added Array#bsearch for binary search.
+ * incompatible changes:
+ * random parameter of Array#shuffle! and Array#sample now
+ will be called with one argument, maximum value.
+ * when given Range arguments, Array#values_at now returns nil for each
+ value that is out-of-range.
+
+ * Enumerable
+ * added method:
+ * added Enumerable#lazy method for lazy enumeration.
+
+ * Enumerator
+ * added method:
+ * added Enumerator#size for lazy size evaluation.
+ * extended method:
+ * Enumerator.new accept an argument for lazy size evaluation.
+
+ * ENV
+ * aliased method:
+ * ENV.to_h is a new alias for ENV.to_hash
+
+ * Fiber
+ * incompatible changes:
+ * Fiber#resume cannot resume a fiber which invokes "Fiber#transfer".
+
+ * File:
* extended method:
- * Array#pack supports endian modifiers
-
- * Bignum
- * Multiplication algorithm for Bignums with a large number of digits over
- 150 BDIGITs is changed in order to reduce its calculation time.
- Now such large Bignums are multiplied by using Toom-3 algorithm.
-
- * Encoding
- * new encodings:
- * CP950
- * CP951
- * UTF-16
- * UTF-32
- * change alias:
- * SJIS is Windows-31J
-
- * File
- * new constant:
- * File::NULL
- name of NULL device.
- * File::DIRECT
- name of O_DIRECT.
-
- * IO
+ * File.fnmatch? now expands braces in the pattern if
+ File::FNM_EXTGLOB option is given.
+
+ * GC
+ * improvements:
+ * introduced the bitmap marking which suppresses to copy a memory page
+ with Copy-on-Write.
+ * introduced the non-recursive marking which avoids unexpected stack overflow.
+
+ * GC::Profiler
+ * added method:
+ * added GC::Profiler.raw_data which returns raw profile data for GC.
+
+ * Hash
+ * added method:
+ * added Hash#to_h as explicit conversion method, like Array#to_a.
* extended method:
- * IO#putc supports multibyte characters
- * new methods:
- * IO#advise
- * IO.write(name, string, [offset] )
- Write `string` to file `name`.
- Opposite with File.read.
- * IO.binwrite(name, string, [offset] )
- binary version of IO.write.
+ * Hash#default_proc= can be passed nil to clear the default proc.
* Kernel
- * move #__id__ to BasicObject.
+ * added method:
+ * added Kernel#Hash conversion method like Array() or Float().
+ * added Kernel#using, which imports refinements into the current scope.
+ [experimental]
+ * added Kernel#__dir__ which returns a current dirname.
+ * added Kernel#caller_locations which returns an array of
+ frame information objects.
* extended method:
- * Kernel#rand supports range argument
+ * Kernel#warn accepts multiple args in like puts.
+ * Kernel#caller accepts second optional argument `n' which specify
+ required caller size.
+ * Kernel#to_enum and enum_for accept a block for lazy size evaluation.
+ * incompatible changes:
+ * system() and exec() closes non-standard file descriptors
+ (The default of :close_others option is changed to true by default.)
+ * respond_to? against a protected method now returns false unless
+ the second argument is true.
+ * __callee__ has returned to the original behavior, and now
+ returns the called name but not the original name in an
+ aliased method.
+ * Kernel#inspect does not call #to_s anymore
+ (it used to call redefined #to_s).
+
+ * LoadError
+ * added method:
+ * added LoadError#path method to return the file name that could not be
+ loaded.
* Module
- * new methods:
- * Module#private_constant
- * Module#public_constant
-
- * Random
+ * added method:
+ * added Module#prepend which is similar to Module#include,
+ however a method in the prepended module overrides the
+ corresponding method in the prepending module.
+ * added Module#refine, which extends a class or module locally.
+ [experimental]
+ * added Module#refinements, which returns refinements defined in the
+ receiver. [experimental]
+ * added Module#using, which imports refinements into the receiver.
+ [experimental]
* extended method:
- * Random.rand supports range argument
+ * Module#define_method accepts a UnboundMethod from a Module.
+ * Module#const_get accepts a qualified constant string, e.g.
+ Object.const_get("Foo::Bar::Baz")
- * String
- * extended method:
- * String#unpack supports endian modifiers
- * new method:
- * String#prepend
- * String#byteslice
+ * Mutex
+ * incompatible changes:
+ * Mutex#lock, Mutex#unlock, Mutex#try_lock, Mutex#synchronize
+ and Mutex#sleep are no longer allowed to be used from trap handler
+ and raise a ThreadError in such case.
+ * Mutex#sleep may spurious wakeup. Check after wakeup.
- * Time
- * extended method:
- * Time#strftime supports %:z and %::z.
+ * NilClass
+ * added method:
+ * added nil.to_h which returns {}
* Process
- * Process#maxgroups and Process#maxgroups= now raise NotImplementedError if
- the platform don't support supplementary groups concept.
+ * added method:
+ * added getsid for getting session id (unix only).
-* bigdecimal
+ * Range
+ * added method:
+ * added Range#size for lazy size evaluation.
+ * added Range#bsearch for binary search.
- * BigDecimal#power and BigDecimal#** support non-integral exponent.
+ * Signal
+ * added method:
+ * added Signal.signame which returns signal name
- * Kernel.BigDecimal and BigDecimal.new now accept instances of Integer,
- Rational, Float, and BigDecimal. If you pass a Rational or a Float to
- them, you must specify the precision to produce the digits of a BigDecimal.
+ * incompatible changes:
+ * Signal.trap raises ArgumentError when :SEGV, :BUS, :ILL, :FPE, :VTALRM
+ are specified.
- * The behavior of BigDecimal#coerce with a Rational is changed. It uses
- the precision of the receiver BigDecimal to produce the digits of a
- BigDecimal from the given Rational.
+ * String
+ * added method:
+ * added String#b returning a copied string whose encoding is ASCII-8BIT.
+ * change return value:
+ * String#lines now returns an array instead of an enumerator.
+ * String#chars now returns an array instead of an enumerator.
+ * String#codepoints now returns an array instead of an enumerator.
+ * String#bytes now returns an array instead of an enumerator.
+
+ * Struct
+ * added method:
+ * added Struct#to_h returning values with keys corresponding to the
+ instance variable names.
+
+ * Thread
+ * added method:
+ * added Thread#thread_variable_get for getting thread local variables
+ (these are different than Fiber local variables).
+ * added Thread#thread_variable_set for setting thread local variables.
+ * added Thread#thread_variables for getting a list of the thread local
+ variable keys.
+ * added Thread#thread_variable? for testing to see if a particular thread
+ variable has been set.
+ * added Thread#backtrace_locations which returns similar information of
+ Kernel#caller_locations.
+ * incompatible changes:
+ * Thread#join and Thread#value now raises a ThreadError if target thread
+ is the current or main thread.
-* bigdecimal/util
+ * Time
+ * change return value:
+ * Time#to_s returned encoding defaults to US-ASCII but automatically
+ transcodes to Encoding.default_internal if it is set.
- * BigDecimal#to_d and Integer#to_d are added.
+ * TracePoint
+ * new class. This class is replacement of set_trace_func.
+ Easy to use and efficient implementation.
- * Float#to_d accepts a precision.
+ * toplevel
+ * added method:
+ * added main.define_method which defines a global function.
- * Rational#to_d raises ArgumentError when passing zero or negative
- precision.
+* cgi
+ * Add HTML5 tag maker.
+ * CGI#header has been renamed to CGI#http_header and
+ aliased to CGI#header.
+ * When HTML5 tagmaker called, overwrite CGI#header,
+ CGI#header function is to create a <header> element.
- * Rational#to_d
+* iconv
+ * Iconv has been removed. Use String#encode instead.
- * Zero and an implicit precision is deprecated.
- This feature is removed at the next release of bigdecimal.
+* io/wait
+ * new features:
+ * added IO#wait_writable method.
+ * added IO#wait_readable method as alias of IO#wait.
- * A negative precision isn't supported.
- Be careful it is an incompatible change.
+* net/http
+ * new features:
+ * Proxies are now automatically detected from the http_proxy environment
+ variable. See Net::HTTP::new for details.
+ * gzip and deflate compression are now requested for all requests by
+ default. See Net::HTTP for details.
+ * SSL sessions are now reused across connections for a single instance.
+ This speeds up connection by using a previously negotiated session.
+ * new methods:
+ * Net::HTTP#local_host
+ * Net::HTTP#local_host=
+ * Net::HTTP#local_port
+ * Net::HTTP#local_port=
+ * extended method:
+ * Net::HTTP#connect uses local_host and local_port if specified.
-* date
+* net/imap
+ * new methods:
+ * Net::IMAP.default_port
+ * Net::IMAP.default_imap_port
+ * Net::IMAP.default_tls_port
+ * Net::IMAP.default_ssl_port
+ * Net::IMAP.default_imaps_port
- * Accepts flonum explicitly with limitations.
- * If the given offset is flonum, DateTime assumes its precision is
- at most second.
+* objspace
+ * new method:
+ * ObjectSpace.reachable_objects_from(obj)
- DateTime.new(2001,2,3,0,0,0,3.0/24) ==
- DateTime.new(2001,2,3,0,0,0,'+03:00')
- #=> true
+* openssl
+ * Consistently raise an error when trying to encode nil values. All instances
+ of OpenSSL::ASN1::Primitive now raise TypeError when calling to_der on an
+ instance whose value is nil. All instances of OpenSSL::ASN1::Constructive
+ raise NoMethodError in the same case. Constructing such values is still
+ permitted.
+ * TLS 1.1 & 1.2 support by setting OpenSSL::SSL::SSLContext#ssl_version to
+ :TLSv1_2, :TLSv1_2_server, :TLSv1_2_client or :TLSv1_1, :TLSv1_1_server
+ :TLSv1_1_client. The version being effectively used can be queried
+ with OpenSSL::SSL#ssl_version. Furthermore, it is also possible to
+ blacklist the new TLS versions with OpenSSL::SSL:OP_NO_TLSv1_1 and
+ OpenSSL::SSL::OP_NO_TLSv1_2.
+ * Added OpenSSL::SSL::SSLContext#renegotiation_cb. A user-defined callback
+ may be set which gets called whenever a new handshake is negotiated. This
+ also allows to programmatically decline (client) renegotiation attempts.
+ * Support for "0/n" splitting of records as BEAST mitigation via
+ OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS.
+ * OpenSSL requires passwords for decrypting PEM-encoded files to be at least
+ four characters long. This led to awkward situations where an export with
+ a password with fewer than four characters was possible, but accessing the
+ file afterwards failed. OpenSSL::PKey::RSA, OpenSSL::PKey::DSA and
+ OpenSSL::PKey::EC therefore now enforce the same check when exporting a
+ private key to PEM with a password - it has to be at least four characters
+ long.
+ * SSL/TLS support for the Next Protocol Negotiation extension. Supported
+ with OpenSSL 1.0.1 and higher.
+ * OpenSSL::OPENSSL_FIPS allows client applications to detect whether OpenSSL
+ is running in FIPS mode and to react to the special requirements this
+ might impy.
+
+* ostruct
+ * new methods:
+ * OpenStruct#[], []=
+ * OpenStruct#each_pair
+ * OpenStruct#eql?
+ * OpenStruct#hash
+ * OpenStruct#to_h converts the struct to a hash.
+ * extended method:
+ * OpenStruct.new also accepts an OpenStruct / Struct.
- * If the given operand for -/+ is flonum, DateTime assumes its
- precision is at most nanosecond.
+* pathname
+ * extended method:
+ * Pathname#find returns an enumerator if no block is given.
- DateTime.new(2001,2,3) + 0.5 == DateTime.new(2001,2,3,12)
- #=> true
+* rake
+ * rake has been updated to version 0.9.5.
- * Precision of offset is always at most second.
+ This version is backwards-compatible with previous rake versions and
+ contains many bug fixes.
- Rational('0.5') == Rational('0.500001') #=> false
- DateTime.new(2001,2,3,0,0,0,Rational('0.5')) ==
- DateTime.new(2001,2,3,0,0,0,Rational('0.500001'))
- #=> true
+ See
+ http://rake.rubyforge.org/doc/release_notes/rake-0_9_5_rdoc.html for a list
+ of changes in rake 0.9.3, 0.9.4 and 0.9.5.
- * Ignores long offset and far reform day (with warning).
+* rdoc
+ * rdoc has been updated to version 4.0
- * Now accepts only:
+ This version is largely backwards-compatible with previous rdoc versions.
+ The most notable change is an update to the ri data format (ri data must
+ be regenerated for gems shared across rdoc versions). Further API changes
+ are internal and won't affect most users.
- -1<=offset<=1 (-24:00..+24:00)
- 2298874<=start<=2426355 or -/+oo
- (proleptic Gregorian/Julian mean -/+oo)
+ See https://github.com/rdoc/rdoc/blob/master/History.rdoc for a list of
+ changes in rdoc 4.0.
- * A method strftime cannot produce huge output (same as Time's one).
+* resolv
+ * new methods:
+ * Resolv::DNS#timeouts=
+ * Resolv::DNS::Config#timeouts=
- * Even though Date/DateTime can handle far dates, the following gives
- an empty string:
+* rexml
+ * REXML::Document#write supports Hash arguments.
+ * REXML::Document#write supports new :encoding option. It changes
+ XML document encoding. Without :encoding option, encoding in
+ XML declaration is used for XML document encoding.
- DateTime.new(1<<10000).strftime('%Y') #=> ""
+* RubyGems
+ * Updated to 2.0.0.preview2
+
+ RubyGems 2.0.0 features the following improvements:
+
+ * Improved support for default gems shipping with ruby 2.0.0+
+ * A gem can have arbitrary metadata through Gem::Specification#metadata
+ * `gem search` now defaults to --remote and is anchored like gem list.
+ * Added --document to replace --rdoc and --ri. Use --no-document to
+ disable documentation, --document=rdoc to only generate rdoc.
+ * Only ri-format documentation is generated by default.
+ * `gem server` uses RDoc::Servlet from RDoc 4.0 to generate HTML
+ documentation.
+
+ For an expanded list of updates and bug fixes see:
+ https://github.com/rubygems/rubygems/blob/master/History.txt
+
+* shellwords
+ * Shellwords#shellescape() now stringifies the given object using to_s.
+ * Shellwords#shelljoin() accepts non-string objects in the given
+ array, each of which is stringified using to_s.
+
+* syslog
+ * Added Syslog::Logger which provides a Logger API atop Syslog.
+ * Syslog::Priority, Syslog::Level, Syslog::Option and Syslog::Macros
+ are introduced for easy detection of available constants on a
+ running system.
+
+* tmpdir
+ * incompatible changes:
+ * Dir.mktmpdir uses FileUtils.remove_entry instead of
+ FileUtils.remove_entry_secure. This means that applications should not
+ change the permission of the created temporary directory to make
+ accessible from other users.
- * Changed the format of inspect.
- * Changed the format of marshal (but, can load old dumps).
+* yaml
+ * Syck has been removed. YAML now completely depends on libyaml being
+ installed.
-* io/console
- * new methods:
- * IO#noecho {|io| }
- * IO#echo=
- * IO#echo?
- * IO#raw {|io| }
- * IO#raw!
- * IO#getch
- * IO#winsize
- * IO.console
-
-* matrix
- * new classes:
- * Matrix::EigenvalueDecomposition
- * Matrix::LUPDecomposition
- * new methods:
- * Matrix#diagonal?
- * Matrix#eigen
- * Matrix#eigensystem
- * Matrix#hermitian?
- * Matrix#lower_triangular?
- * Matrix#lup
- * Matrix#lup_decomposition
- * Matrix#normal?
- * Matrix#orthogonal?
- * Matrix#permutation?
- * Matrix#round
- * Matrix#symmetric?
- * Matrix#unitary?
- * Matrix#upper_triangular?
- * Matrix#zero?
- * Vector#magnitude, #norm
- * Vector#normalize
- * extended methods:
- * Matrix#each and #each_with_index can iterate on a subset of the elements
- * Matrix#find_index returns [row, column] and can iterate on a subset
- of the elements
- * Matrix#** implements Numeric exponents (using the eigensystem)
- * Matrix.zero can build rectangular matrices
-
-* minitest
- * Minitest has been updated to version 2.2.2.
- * For full details, see https://github.com/seattlerb/minitest/blob/master/History.txt
+* zlib
+ * Added streaming support for Zlib::Inflate and Zlib::Deflate. This allows
+ processing of a stream without the use of large amounts of memory.
+ * Added support for the new deflate strategies Zlib::RLE and Zlib::FIXED.
+ * Zlib streams are now processed without the GVL. This allows gzip, zlib and
+ deflate streams to be processed in parallel.
-* net/http
- * SNI (Server Name Indication) supported for HTTPS.
+=== Language changes
- * Allow to configure to wait server returning '100 continue' response
- before sending HTTP request body. Set Net::HTTP#continue_timeout AND pass
- 'expect' => '100-continue' to a extra HTTP header.
+ * Added %i and %I for symbol list creation (similar to %w and %W).
- For example, the following code sends HTTP header and waits for getting
- '100 continue' response before sending HTTP request body. When 0.5 [sec]
- timeout occurs or the server send '100 continue', the client sends HTTP
- request body.
- http.continue_timeout = 0.5
- http.request_post('/continue', 'body=BODY', 'expect' => '100-continue')
+ * Default source encoding is changed to UTF-8. (was US-ASCII)
- * new method:
- * Net::HTTPRequest#set_form): Added to support
- both application/x-www-form-urlencoded and multipart/form-data.
+=== Compatibility issues (excluding feature bug fixes)
-* openssl
- * PKey::RSA and PKey::DSA now use the generic X.509 encoding scheme
- (e.g. used in a X.509 certificate's Subject Public Key Info) when
- exporting public keys to DER or PEM. Backward compatibility is
- ensured by (already existing) fallbacks during creation.
- * OpenSSL::ASN1::Constructive#new and OpenSSL::ASN1::Primitive#new
- (and the constructors of their sub-classes) will no longer force
- tagging to be set to :EXPLICIT when tag and/or tag_class are passed
- as parameters. tagging must be set explicitly.
- * Support for infinite length encodings via infinite_length attribute.
- * OpenSSL::PKey.read( file | string [, pwd] ) allows to read arbitrary
- public/private keys in DER-/PEM-encoded form with an optional password
- for encrypted PEM encodings.
- * Add new method OpenSSL::X509::Name#hash_old as a wrapper of
- X509_NAME_hash_old() defined from OpenSSL 1.0.0. It returns OpenSSL 0.9.8
- compatible hash value.
-
-* optparse
- * support for bash/zsh completion.
-
-* Rake
- * Rake has been upgraded from 0.8.7 to 0.9.2.1. For full release notes see
- https://github.com/jimweirich/rake/blob/master/CHANGES
-
-* RDoc
- * RDoc has been upgraded from 2.5.8 to 3.8. For full release notes see
- http://docs.seattlerb.org/rdoc/History_txt.html
+ * Array#values_at
-* rexml
- * Support Ruby native encoding mechanism and iconv dependency is dropped.
+ See above.
-* RubyGems
- * RubyGems has been upgraded to version 1.8.6.1. For full release notes see
- http://rubygems.rubyforge.org/rubygems-update/History_txt.html
+ * String#lines
+ * String#chars
+ * String#codepoints
+ * String#bytes
-* stringio
- * extended method:
- * StringIO#set_encoding can get 2nd argument and optional hash.
-
-* test/unit
- * New arguments:
- * -j N, --jobs=N: Allow run N testcases at once.
- * --jobs-status: Show status of jobs when parallel running.
- * --no-retry: Don't retry testcases which failed when parallel running.
- * --ruby=RUBY: path to ruby for job(worker) process. optional.
- * --hide-skip: Hide skip messages. You'll see the number of skips at end of
- test result.
-
-* uri
- * new methods:
- * URI::Generic#hostname
- * URI::Generic#hostname=
+ These methods no longer return an Enumerator, although passing a
+ block is still supported for backwards compatibility.
-* webrick
- * new method:
- * WEBrick::HTTPRequest#continue for generating '100 continue' response.
- * new logging directive:
- * %{remote}p for remote (client) port number.
+ Code like str.lines.with_index(1) { |line, lineno| ... } no longer
+ works because str.lines returns an array. Replace lines with
+ each_line in such cases.
-* yaml
- * The default YAML engine is now Psych. You may downgrade to syck by setting
- YAML::ENGINE.yamler = 'syck'.
+ * Signal.trap
-* zlib
- * new methods:
- * Zlib.deflate
- * Zlib.inflate
+ See above.
-* FileUtils
- * extended method:
- * FileUtils#chmod supports symbolic mode argument.
+ * Merge Onigmo.
+ https://github.com/k-takata/Onigmo
-=== Language changes
+ * The :close_others option is true by default for system() and exec().
+ Also, the close-on-exec flag is set by default for all new file descriptors.
+ This means file descriptors doesn't inherit to spawned process unless
+ explicitly requested such as system(..., fd=>fd).
-* Regexps now support Unicode 6.0. (new characters and scripts)
+ * Kernel#respond_to? against a protected method now returns false
+ unless the second argument is true.
-* [experimental] Regexps now support Age property.
- Unlike Perl, current implementation takes interpretation of the
- interpretation of UTS #18.
- http://www.unicode.org/reports/tr18/
+ * Dir.mktmpdir in lib/tmpdir.rb
-* Turning on/off indentation warnings with directives.
- ("# -*- warn-indent: true -*-" / "# -*- warn-indent: false -*-")
+ See above.
-=== Compatibility issues (excluding feature bug fixes)
+ * OpenStruct new methods can conflict with custom attributes named
+ "each_pair", "eql?", "hash" or "to_h".
+
+ * Thread#join, Thread#value
+
+ See above.
- * Rational#to_d
+ * Mutex#lock, Mutex#unlock, Mutex#try_lock, Mutex#synchronize and Mutex#sleep
See above.
diff --git a/README b/README
index 3d2e636e4d..2de785d86e 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-* What's Ruby
+= What's Ruby
Ruby is the interpreted scripting language for quick and
easy object-oriented programming. It has many features to
@@ -6,113 +6,125 @@ process text files and to do system management tasks (as in
Perl). It is simple, straight-forward, and extensible.
-* Features of Ruby
+== Features of Ruby
- + Simple Syntax
- + *Normal* Object-Oriented features(ex. class, method calls)
- + *Advanced* Object-Oriented features(ex. Mix-in, Singleton-method)
- + Operator Overloading
- + Exception Handling
- + Iterators and Closures
- + Garbage Collection
- + Dynamic Loading of Object files(on some architecture)
- + Highly Portable (works on many Unix-like/POSIX compatible platforms
+* Simple Syntax
+* *Normal* Object-Oriented features(ex. class, method calls)
+* *Advanced* Object-Oriented features(ex. Mix-in, Singleton-method)
+* Operator Overloading
+* Exception Handling
+* Iterators and Closures
+* Garbage Collection
+* Dynamic Loading of Object files(on some architecture)
+* Highly Portable (works on many Unix-like/POSIX compatible platforms
as well as Windows, Mac OS X, BeOS etc.)
- cf. http://redmine.ruby-lang.org/wiki/ruby-19/SupportedPlatforms
+ cf. http://bugs.ruby-lang.org/projects/ruby-trunk/wiki/SupportedPlatforms
-* How to get Ruby
+== How to get Ruby
The Ruby distribution files can be found in the following FTP site:
- ftp://ftp.ruby-lang.org/pub/ruby/
+ftp://ftp.ruby-lang.org/pub/ruby/
The trunk of the Ruby source tree can be checked out with the
following command:
$ svn co http://svn.ruby-lang.org/repos/ruby/trunk/ ruby
+Or if you are using git then use following command:
+
+ $ git clone git://github.com/ruby/ruby.git
+
There are some other branches under development. Try the following
command and see the list of branches:
$ svn ls http://svn.ruby-lang.org/repos/ruby/branches/
+Or if you are using git then use following command:
+
+ $ git ls-remote git://github.com/ruby/ruby.git
-* Ruby home-page
+== Ruby home-page
The URL of the Ruby home-page is:
- http://www.ruby-lang.org/
+http://www.ruby-lang.org/
-* Mailing list
+== Mailing list
There is a mailing list to talk about Ruby.
To subscribe this list, please send the following phrase
- subscribe YourFirstName YourFamilyName
+ subscribe YourFirstName YourFamilyName
e.g.
subscribe Joseph Smith
-in the mail body (not subject) to the address <ruby-talk-ctl@ruby-lang.org>.
+in the mail body (not subject) to the address <mailto:ruby-talk-ctl@ruby-lang.org>.
-* How to compile and install
+== How to compile and install
This is what you need to do to compile and install Ruby:
- 1. If ./configure does not exist or is older than configure.in,
+0. If you want to use Microsoft Visual C++ to compile ruby,
+ read win32/README.win32 instead of this document.
+
+1. If +./configure+ does not exist or is older than configure.in,
run autoconf to (re)generate configure.
- 2. Run ./configure, which will generate config.h and Makefile.
+2. Run +./configure+, which will generate config.h and Makefile.
Some C compiler flags may be added by default depending on your
- environment. Specify optflags=.. and warnflags=.. as necessary
- to override them.
+ environment. Specify <tt>optflags=..</tt> and <tt>warnflags=..</tt> as
+ necessary to override them.
- 3. Edit defines.h if you need. Usually this step will not be needed.
+3. Edit +defines.h+ if you need. Usually this step will not be needed.
- 4. Remove comment mark(#) before the module names from ext/Setup (or
- add module names if not present), if you want to link modules
+4. Remove comment mark(<tt>#</tt>) before the module names from +ext/Setup+
+ (or add module names if not present), if you want to link modules
statically.
If you don't want to compile non static extension modules
(probably on architectures which does not allow dynamic loading),
- remove comment mark from the line "#option nodynamic" in
- ext/Setup.
+ remove comment mark from the line "<tt>#option nodynamic</tt>" in
+ +ext/Setup+.
+
+ Usually this step will not be needed.
- 5. Run make.
+5. Run +make+.
- 6. Optionally, run 'make test' to check whether the compiled Ruby
- interpreter works well. If you see the message "test succeeded",
+6. Optionally, run '<tt>make check</tt>' to check whether the compiled Ruby
+ interpreter works well. If you see the message "<tt>check succeeded</tt>",
your ruby works as it should (hopefully).
- 7. Run 'make install'
+7. Run '<tt>make install</tt>'
This command will create following directories and install files
onto them.
- * ${DESTDIR}${prefix}/bin
- * ${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}
- * ${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}
- * ${DESTDIR}${prefix}/lib
- * ${DESTDIR}${prefix}/lib/ruby
- * ${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}
- * ${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}
- * ${DESTDIR}${prefix}/lib/ruby/site_ruby
- * ${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}
- * ${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}
- * ${DESTDIR}${prefix}/lib/ruby/vendor_ruby
- * ${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}
- * ${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}
- * ${DESTDIR}${prefix}/lib/ruby/gems/${MAJOR}.${MINOR}.${TEENY}
- * ${DESTDIR}${prefix}/share/man/man1
- * ${DESTDIR}${prefix}/share/ri/${MAJOR}.${MINOR}.${TEENY}/system
-
- If Ruby's API version is `x.y.z', the ((|${MAJOR}|)) is `x', the
- ((|${MINOR}|)) is `y', and the ((|${TEENY}|)) is `z'.
-
- NOTE: teeny of the API version may be different from one of
+ * <tt>${DESTDIR}${prefix}/bin</tt>
+ * <tt>${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/site_ruby</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/vendor_ruby</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/gems/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/share/man/man1</tt>
+ * <tt>${DESTDIR}${prefix}/share/ri/${MAJOR}.${MINOR}.${TEENY}/system</tt>
+
+ If Ruby's API version is '_x.y.z_', the <tt>${MAJOR}</tt> is '_x_', the
+ <tt>${MINOR}</tt> is '_y_', and the <tt>${TEENY}</tt> is '_z_'.
+
+ *NOTE*: teeny of the API version may be different from one of
Ruby's program version
You may have to be a super user to install ruby.
@@ -121,20 +133,21 @@ If you fail to compile ruby, please send the detailed error report with
the error log and machine/OS type, to help others.
-* Copying
+== Copying
-See the file COPYING.
+See the file +COPYING+.
-* The Author
+== The Author
-Feel free to send comments and bug reports to the author. Here is the
+Feel free to send comments and bug reports to the author. Here is the
author's latest mail address:
- matz@netlab.jp
+<mailto:matz@ruby-lang.org>
-------------------------------------------------------
created at: Thu Aug 3 11:57:36 JST 1995
+--
Local variables:
-mode: indented-text
+mode: rdoc
end:
diff --git a/README.EXT b/README.EXT
index de63f54699..d81debcba9 100644
--- a/README.EXT
+++ b/README.EXT
@@ -149,7 +149,7 @@ To convert C data to Ruby values:
cast to VALUE.
-You can determine whether a VALUE is pointer or not by checking its LSB.
+You can determine whether a VALUE is pointer or not by checking its LSB.
Notice Ruby does not allow arbitrary pointer values to be a VALUE. They
should be pointers to the structures which Ruby knows about. The known
@@ -215,9 +215,9 @@ listed below:
rb_str_cat2(str, rb_vsprintf(format, ap)), respectively.
rb_enc_str_new(const char *ptr, long len, rb_encoding *enc)
-
+
Creates a new Ruby string with the specified encoding.
-
+
rb_usascii_str_new(const char *ptr, long len)
rb_usascii_str_new_cstr(const char *ptr)
@@ -284,6 +284,9 @@ listed below:
rb_ary_shift(VALUE ary)
rb_ary_unshift(VALUE ary, VALUE val)
+ rb_ary_cat(VALUE ary, const VALUE *ptr, long len)
+
+ Appends len elements of objects from ptr to the array.
2. Extending Ruby with C
@@ -315,17 +318,17 @@ To define nested classes or modules, use the functions below:
To define methods or singleton methods, use these functions:
- void rb_define_method(VALUE klass, const char *name,
+ void rb_define_method(VALUE klass, const char *name,
VALUE (*func)(), int argc)
- void rb_define_singleton_method(VALUE object, const char *name,
+ void rb_define_singleton_method(VALUE object, const char *name,
VALUE (*func)(), int argc)
The `argc' represents the number of the arguments to the C function,
which must be less than 17. But I doubt you'll need that many.
If `argc' is negative, it specifies the calling sequence, not number of
-the arguments.
+the arguments.
If argc is -1, the function will be called as:
@@ -345,14 +348,14 @@ actual arguments.
There are some more functions to define methods. One takes an ID
as the name of method to be defined. See 2.2.2 for IDs.
- void rb_define_method_id(VALUE klass, ID name,
+ void rb_define_method_id(VALUE klass, ID name,
VALUE (*func)(ANYARGS), int argc)
There are two functions to define private/protected methods:
- void rb_define_private_method(VALUE klass, const char *name,
+ void rb_define_private_method(VALUE klass, const char *name,
VALUE (*func)(), int argc)
- void rb_define_protected_method(VALUE klass, const char *name,
+ void rb_define_protected_method(VALUE klass, const char *name,
VALUE (*func)(), int argc)
At last, rb_define_module_function defines a module functions,
@@ -369,7 +372,7 @@ or
To define module functions, use:
- void rb_define_module_function(VALUE module, const char *name,
+ void rb_define_module_function(VALUE module, const char *name,
VALUE (*func)(), int argc)
In addition, function-like methods, which are private methods defined
@@ -418,7 +421,7 @@ evaluate the string as Ruby program. This function will do the job:
Evaluation is done under the current context, thus current local variables
of the innermost method (which is defined by Ruby) can be accessed.
-Note that the evaluation can raise an exception. There is a safer
+Note that the evaluation can raise an exception. There is a safer
function:
VALUE rb_eval_string_protect(const char *str, int *state)
@@ -442,11 +445,21 @@ or
You can get the ID value from a string within C code by using
rb_intern(const char *name)
+ rb_intern_str(VALUE name)
You can retrieve ID from Ruby object (Symbol or String) given as an
argument by using
rb_to_id(VALUE symbol)
+ rb_check_id(volatile VALUE *name)
+ rb_check_id_cstr(const char *name, long len, rb_encoding *enc)
+
+These functions try to convert the argument to a String if it was not
+a Symbol nor a String. The second function stores the converted
+result into *name, and returns 0 if the string is not a known symbol.
+After this function returned a non-zero value, *name is always a
+Symbol or a String, otherwise it is a String if the result is 0.
+The third function takes NUL-terminated C string, not Ruby VALUE.
You can convert C ID to Ruby Symbol by using
@@ -549,7 +562,7 @@ The prototypes of the getter and setter functions are as follows:
To wrap and objectify a C pointer as a Ruby object (so called
DATA), use Data_Wrap_Struct().
- Data_Wrap_Struct(klass, mark, free, ptr)
+ Data_Wrap_Struct(klass, mark, free, sval)
Data_Wrap_Struct() returns a created DATA object. The klass argument
is the class for the DATA object. The mark argument is the function
@@ -582,7 +595,7 @@ Data_Get_Struct().
A pointer to the structure will be assigned to the variable sval.
-See the example below for details.
+See the example below for details.
4. Example - Creating dbm extension
@@ -640,7 +653,7 @@ Init_dbm(void)
}
--
-The dbm extension wraps the dbm struct in the C environment using
+The dbm extension wraps the dbm struct in the C environment using
Data_Make_Struct.
--
@@ -742,10 +755,26 @@ need to put
at the top of the file. You can use the functions below to check
various conditions.
- have_library(lib, func): check whether library containing function exists.
- have_func(func, header): check whether function exists
- have_header(header): check whether header file exists
- create_makefile(target): generate Makefile
+ have_macro(macro[, headers[, opt]]): check whether macro is defined
+ have_library(lib[, func[, headers[, opt]]]): check whether library containing function exists
+ find_library(lib[, func, *paths]): find library from paths
+ have_func(func[, headers[, opt]): check whether function exists
+ have_var(var[, headers[, opt]]): check whether variable exists
+ have_header(header[, preheaders[, opt]]): check whether header file exists
+ find_header(header, *paths): find header from paths
+ have_framework(fw): check whether framework exists (for MacOS X)
+ have_struct_member(type, member[, headers[, opt]]): check whether struct has member
+ have_type(type[, headers[, opt]]): check whether type exists
+ find_type(type, opt, *headers): check whether type exists in headers
+ have_const(const[, headers[, opt]]): check whether constant is defined
+ check_sizeof(type[, headers[, opts]]): check size of type
+ check_signedness(type[, headers[, opts]]): check signedness of type
+ convertible_int(type[, headers[, opts]]): find convertible integer type
+ find_executable(bin[, path]): find excutable file path
+ create_header(header): generate configured header
+ create_makefile(target[, target_prefix]): generate Makefile
+
+See MakeMakefile for full documentation of these functions.
The value of the variables below will affect the Makefile.
@@ -869,7 +898,7 @@ utility functions
ruby interpreter implementation
dmyext.c
- dmydln.c
+ dmydln.c
dmyencoding.c
id.c
inits.c
@@ -905,7 +934,7 @@ class library
rational.c : Rational
re.c : Regexp, MatchData
signal.c : Signal
- sprintf.c :
+ sprintf.c :
string.c : String
struct.c : Struct
time.c : Time
@@ -920,7 +949,7 @@ multilingualization
enc/trans/* : codepoint mapping tables
goruby interpreter implementation
-
+
goruby.c
golf_prelude.rb : goruby specific libraries.
-> golf_prelude.c : automatically generated
@@ -968,7 +997,7 @@ sval, and returns the DATA encapsulating the pointer to memory region.
Data_Get_Struct(data, type, sval)
This macro retrieves the pointer value from DATA, and assigns it to
-the variable sval.
+the variable sval.
** Checking data types
@@ -1055,7 +1084,7 @@ The getter function must return the value for the access.
void rb_define_hooked_variable(const char *name, VALUE *var,
VALUE (*getter)(), VALUE (*setter)())
-Defines hooked variable. It's a virtual variable with a C variable.
+Defines hooked variable. It's a virtual variable with a C variable.
The getter is called as
VALUE getter(ID id, VALUE *var)
@@ -1213,7 +1242,7 @@ arguments.
Calls the function func1, supplying func2 as the block. func1 will be
called with the argument arg1. func2 receives the value from yield as
the first argument, arg2 as the second argument.
-
+
When rb_iterate is used in 1.9, func1 has to call some Ruby-level method.
This function is obsolete since 1.9; use rb_block_call instead.
@@ -1240,6 +1269,8 @@ Calls the function func with arg as the argument. If no exception
occured during func, it returns the result of func and *state is zero.
Otherwise, it returns Qnil and sets *state to nonzero. If state is
NULL, it is not set in both cases.
+You have to clear the error info with rb_set_errinfo(Qnil) when
+ignoring the caught exception.
void rb_jump_tag(int state)
@@ -1247,6 +1278,17 @@ Continues the exception caught by rb_protect() and rb_eval_string_protect().
state must be the returned value from those functions. This function
never return to the caller.
+ void rb_iter_break()
+
+Exits from the current innermost block. This function never return to
+the caller.
+
+ void rb_iter_break_value(VALUE value)
+
+Exits from the current innermost block with the value. The block will
+return the given argument value. This function never return to the
+caller.
+
** Exceptions and Errors
void rb_warn(const char *fmt, ...)
@@ -1367,101 +1409,6 @@ mere st.h.
Means that rb_add_event_hook() takes the third argument `data', to be
passed to the given event hook function.
-Appendix C. Functions Available in extconf.rb
-
-These functions are available in extconf.rb:
-
- have_macro(macro, headers)
-
-Checks whether macro is defined with header. Returns true if the macro
-is defined.
-
- have_library(lib, func)
-
-Checks whether the library exists, containing the specified function.
-Returns true if the library exists.
-
- find_library(lib, func, path...)
-
-Checks whether a library which contains the specified function exists in
-path. Returns true if the library exists.
-
- have_func(func, header)
-
-Checks whether func exists with header. Returns true if the function
-exists. To check functions in an additional library, you need to
-check that library first using have_library().
-
- have_var(var, header)
-
-Checks whether var exists with header. Returns true if the variable
-exists. To check variables in an additional library, you need to
-check that library first using have_library().
-
- have_header(header)
-
-Checks whether header exists. Returns true if the header file exists.
-
- find_header(header, path...)
-
-Checks whether header exists in path. Returns true if the header file
-exists.
-
- have_struct_member(type, member, header)
-
-Checks whether type has member with header. Returns true if the type
-is defined and has the member.
-
- have_type(type, header, opt)
-
-Checks whether type is defined with header. Returns true if the type
-is defined.
-
- check_sizeof(type, header)
-
-Checks the size of type in char with header. Returns the size if the
-type is defined, otherwise nil.
-
- create_makefile(target)
-
-Generates the Makefile for the extension library. If you don't invoke
-this method, the compilation will not be done.
-
- find_executable(bin, path)
-
-Finds command in path, which is File::PATH_SEPARATOR-separated list of
-directories. If path is nil or omitted, environment variable PATH
-will be used. Returns the path name of the command if it is found,
-otherwise nil.
-
- with_config(withval[, default=nil])
-
-Parses the command line options and returns the value specified by
---with-<withval>.
-
- enable_config(config, *defaults)
- disable_config(config, *defaults)
-
-Parses the command line options for boolean. Returns true if
---enable-<config> is given, or false if --disable-<config> is given.
-Otherwise, yields defaults to the given block and returns the result
-if it is called with a block, or returns defaults.
-
- dir_config(target[, default_dir])
- dir_config(target[, default_include, default_lib])
-
-Parses the command line options and adds the directories specified by
---with-<target>-dir, --with-<target>-include, and/or --with-<target>-lib
-to $CFLAGS and/or $LDFLAGS. --with-<target>-dir=/path is equivalent to
---with-<target>-include=/path/include --with-<target>-lib=/path/lib.
-Returns an array of the added directories ([include_dir, lib_dir]).
-
- pkg_config(pkg)
-
-Obtains the information for pkg by pkg-config command. The actual
-command name can be overridden by --with-pkg-config command line
-option.
-
/*
* Local variables:
* fill-column: 70
diff --git a/README.EXT.ja b/README.EXT.ja
index f2d7609ff5..4ae8b50221 100644
--- a/README.EXT.ja
+++ b/README.EXT.ja
@@ -1,53 +1,53 @@
.\" README.EXT.ja - -*- Text -*- created at: Mon Aug 7 16:45:54 JST 1995
-Rubyγĥ饤֥κޤ
+Rubyの拡張ライブラリの作り方を説明します.
-1μ
+1.基礎知識
-CѿˤϷꡤǡˤϷޤ󡥤Ǥ顤
-ȤХݥ󥿤intѿȡͤȤƼ
-갷ޤդRubyѿˤϷʤǡ˷
-ΰ㤤ΤᡤCRubyߤѴʤСߤ
-ǡ򥢥Ǥޤ
+Cの変数には型があり,データには型がありません.ですから,た
+とえばポインタをintの変数に代入すると,その値は整数として取
+り扱われます.逆にRubyの変数には型がなく,データに型がありま
+す.この違いのため,CとRubyは相互に変換しなければ,お互いの
+データをアクセスできません.
-RubyΥǡVALUEȤCηɽޤVALUEΥǡ
-ϤΥǡפʬΤäƤޤΥǡפ
-Τϥǡ(֥)μºݤι¤̣ƤơRuby
-Υ饹ȤϤޤäΤǤ
+RubyのデータはVALUEというCの型で表現されます.VALUE型のデー
+タはそのデータタイプを自分で知っています.このデータタイプと
+いうのはデータ(オブジェクト)の実際の構造を意味していて,Ruby
+のクラスとはまた違ったものです.
-VALUECˤȤäựΤǡФˤ
+VALUEからCにとって意味のあるデータを取り出すためには
- (1) VALUEΥǡפΤ
- (2) VALUECΥǡѴ
+ (1) VALUEのデータタイプを知る
+ (2) VALUEをCのデータに変換する
-ξɬפǤ(1)˺ȴְäǡѴԤ
-ơǰץबcore dumpޤ
+の両方が必要です.(1)を忘れると間違ったデータの変換が行われ
+て,最悪プログラムがcore dumpします.
-1.1 ǡ
+1.1 データタイプ
-Rubyˤϥ桼ȤǽΤʲΥפޤ
+Rubyにはユーザが使う可能性のある以下のタイプがあります.
T_NIL nil
- T_OBJECT ̾Υ֥
- T_CLASS 饹
- T_MODULE ⥸塼
- T_FLOAT ư
- T_STRING ʸ
- T_REGEXP ɽ
- T_ARRAY
- T_HASH Ϣ
- T_STRUCT (Ruby)¤
- T_BIGNUM ¿Ĺ
- T_FIXNUM Fixnum(31bitޤ63bitĹ)
- T_COMPLEX ʣǿ
- T_RATIONAL ͭ
- T_FILE
- T_TRUE
- T_FALSE
- T_DATA ǡ
- T_SYMBOL ܥ
-
-¾ѤƤʲΥפޤ
+ T_OBJECT 通常のオブジェクト
+ T_CLASS クラス
+ T_MODULE モジュール
+ T_FLOAT 浮動小数点数
+ T_STRING 文字列
+ T_REGEXP 正規表現
+ T_ARRAY 配列
+ T_HASH 連想配列
+ T_STRUCT (Rubyの)構造体
+ T_BIGNUM 多倍長整数
+ T_FIXNUM Fixnum(31bitまたは63bit長整数)
+ T_COMPLEX 複素数
+ T_RATIONAL 有理数
+ T_FILE 入出力
+ T_TRUE 真
+ T_FALSE 偽
+ T_DATA データ
+ T_SYMBOL シンボル
+
+その他に内部で利用されている以下のタイプがあります.
T_ICLASS
T_MATCH
@@ -55,249 +55,249 @@ Rubyˤϥ桼ȤǽΤʲΥפޤ
T_NODE
T_ZOMBIE
-ۤȤɤΥפCι¤ΤǼƤޤ
+ほとんどのタイプはCの構造体で実装されています.
-1.2 VALUEΥǡפå
+1.2 VALUEのデータタイプをチェックする
-ruby.hǤTYPE()ȤޥƤơVALUEΥǡ
-פΤ뤳ȤޤTYPE()ޥϾǾҲ𤷤T_XXXX
-η֤ޤVALUEΥǡפ˱ƽ
-ˤϡTYPE()ͤʬ뤳Ȥˤʤޤ
+ruby.hではTYPE()というマクロが定義されていて,VALUEのデータ
+タイプを知ることが出来ます.TYPE()マクロは上で紹介したT_XXXX
+の形式の定数を返します.VALUEのデータタイプに応じて処理する
+場合には,TYPE()の値で分岐することになります.
switch (TYPE(obj)) {
case T_FIXNUM:
- /* FIXNUMν */
+ /* FIXNUMの処理 */
break;
case T_STRING:
- /* ʸν */
+ /* 文字列の処理 */
break;
case T_ARRAY:
- /* ν */
+ /* 配列の処理 */
break;
default:
- /* 㳰ȯ */
+ /* 例外を発生させる */
rb_raise(rb_eTypeError, "not valid value");
break;
}
-ȥǡפåơʤ㳰ȯ
-ؿѰդƤޤ
+それとデータタイプをチェックして,正しくなければ例外を発生す
+る関数が用意されています.
void Check_Type(VALUE value, int type)
-δؿvaluetype̵С㳰ȯޤ
-Ϳ줿VALUEΥǡפɤå
-뤿ˤϡδؿȤޤ
+この関数はvalueがtypeで無ければ,例外を発生させます.引数と
+して与えられたVALUEのデータタイプが正しいかどうかチェックす
+るためには,この関数を使います.
-FIXNUMNIL˴ؤƤϤ®Ƚ̥ޥѰդƤޤ
+FIXNUMとNILに関してはより高速な判別マクロが用意されています.
FIXNUM_P(obj)
NIL_P(obj)
-1.3 VALUECΥǡѴ
-
-ǡפT_NILT_FALSET_TRUEǤǡϤ줾
-nilfalsetrueǤΥǡפΥ֥ȤϤҤ
-ĤĤ¸ߤޤ
-
-ǡפT_FIXNUMλ31bitޤ63bitΥ
-ǤlongΥ32bitΥץåȥեǤ
-31bitˡlongΥ64bitΥץåȥեǤ63bit
-ˤʤޤ. FIXNUM C Ѵ뤿ˤϥޥ
-FIX2INT()פޤϡFIX2LONG()פȤޤΥޥ
-Ѥݤˤϻ˥ǡפFIXNUMǤ뤳Ȥǧ
-ɬפޤŪ®ѴԤȤǤޤ
-FIX2LONG()פ㳰ȯޤ󤬡FIX2INT()פ
-̤intΥ˼ޤʤˤ㳰ȯޤ
-줫顤FIXNUM˸¤餺RubyΥǡѴ
-NUM2INT()פӡNUM2LONG()פȤޥޤ
-ΥޥϥޥϥǡפΥå̵ǻȤޤ
-(ѴǤʤˤ㳰ȯ)Ʊͤ˥å̵
-ǻȤѴޥdoubleФNUM2DBL()פޤ
-
-char* Ф硤 StringValue() StringValuePtr()
-Ȥޤ
-StringValue(var) var String
-Ǥв⤻Ǥʤ var var.to_str() η
-֤ޥStringValuePtr(var) Ʊͤ var
-String ֤Ƥ var ΥХɽФ char*
-֤ޥǤvar Ƥľ֤Τǡ
-var lvalue Ǥɬפޤ
-ޤStringValuePtr() StringValueCStr() Ȥ
-⤢ޤStringValueCStr(var) var String ֤
-Ƥ var ʸɽФ char* ֤ޤ֤
-ʸˤ nul ʸղäޤʤ nul
-ʸޤޤ ArgumentError ȯޤ
-StringValuePtr() Ǥϡ nul ʸݾڤϤʤ
- nul ʸޤޤƤǽ⤢ޤ
-
-ʳΥǡפбCι¤Τޤб
-빽¤ΤΤVALUEϤΤޤޥ㥹(Ѵ)й¤Τ
-ݥ󥿤ѴǤޤ
-
-¤Τϡstruct RXxxxxפȤ̾ruby.hƤ
-㤨ʸϡstruct RStringפǤºݤ˻Ȥǽ
-Τʸ󤯤餤Ȼפޤ
-
-ruby.hǤϹ¤Τإ㥹ȤޥRXXXXX()(ʸ
-ˤ)Ȥ̾󶡤Ƥޤ(: RSTRING())
-
-¤ΤǡФޥ󶡤Ƥޤʸ
-strĹ뤿ˤϡRSTRING_LEN(str)פȤʸstr
-char*Ȥ뤿ˤϡRSTRING_PTR(str)פȤޤ
-ˤϡ줾RARRAY_LEN(ary)סRARRAY_PTR(ary)פ
-ʤޤ
-
-Rubyι¤Τľܥ˵ĤʤФʤʤ
-Ȥϡʸι¤ΤȤϻȤǡľѹ
-ʤȤǤľѹ硤֥ȤƤ
-Ȥʤʤäơפ̥Хθˤʤޤ
-
-1.4 CΥǡVALUEѴ
-
-VALUEμºݤι¤
-
- * FIXNUMξ
-
- 1bitեȤơLSBΩƤ롥
-
- * ¾Υݥ󥿤ξ
-
- ΤޤVALUE˥㥹Ȥ롥
-
-ȤʤäƤޤäơLSBåVALUEFIXNUM
-狼櫓Ǥ(ݥ󥿤LSBΩäƤʤȤꤷ
-)
-
-Ǥ顤FIXNUMʳRubyΥ֥Ȥι¤ΤñVALUE
-˥㥹ȤVALUEѴޤǤդι¤
-ΤVALUE˥㥹Ƚ櫓ǤϤޤ󡥥㥹Ȥ
-RubyΤäƤ빽¤(ruby.hƤstruct RXxxx
-Τ)Ǥ
-
-FIXNUM˴ؤƤѴޥͳɬפޤC
-VALUEѴޥϰʲΤΤޤɬפ˱
-ƻȤʬƤ
-
- INT2FIX() Ȥ31bitޤ63bit˼ޤ뼫
-
- INT2NUM() ǤդVALUE
-
-INT2NUM()FIXNUMϰϤ˼ޤʤ硤BignumѴ
-Ƥޤ(٤)
-
-1.5 RubyΥǡ
-
-Ҥ٤̤ꡤRubyι¤Τ򥢥Ƥι
-ԤȤϴޤ󡥤ǡRubyΥǡˤ
-RubyѰդƤؿѤƤ
-
-ǤϤäȤȤǤʸ/
-ؿ򤢤ޤ(ǤϤʤǤ)
-
- ʸФؿ
+1.3 VALUEをCのデータに変換する
+
+データタイプがT_NIL,T_FALSE,T_TRUEである時,データはそれぞ
+れnil,false,trueです.このデータタイプのオブジェクトはひと
+つずつしか存在しません.
+
+データタイプがT_FIXNUMの時,これは31bitまたは63bitのサイズを
+持つ整数です.longのサイズが32bitのプラットフォームであれば
+31bitに,longのサイズが64bitのプラットフォームであれば63bit
+になります. FIXNUM を C の整数に変換するためにはマクロ
+「FIX2INT()」または「FIX2LONG()」を使います.これらのマクロ
+を使用する際には事前にデータタイプがFIXNUMであることを確認す
+る必要がありますが,比較的高速に変換を行うことができます.ま
+た,「FIX2LONG()」は例外を発生しませんが,「FIX2INT()」は変
+換結果がintのサイズに収まらない場合には例外を発生します.
+それから,FIXNUMに限らずRubyのデータを整数に変換する
+「NUM2INT()」および「NUM2LONG()」というマクロがあります.こ
+れらのマクロはマクロはデータタイプのチェック無しで使えます
+(整数に変換できない場合には例外が発生する).同様にチェック無
+で使える変換マクロはdoubleを取り出す「NUM2DBL()」があります.
+
+char* を取り出す場合, StringValue() と StringValuePtr()
+を使います.
+StringValue(var) は var が String
+であれば何もせず,そうでなければ var を var.to_str() の結果
+に置き換えるマクロ,StringValuePtr(var) は同様に var を
+String に置き換えてから var のバイト列表現に対する char* を
+返すマクロです.var の内容を直接置き換える処理が入るので,
+var は lvalue である必要があります.
+また,StringValuePtr() に類似した StringValueCStr() というマ
+クロもあります.StringValueCStr(var) は var を String に置き
+換えてから var の文字列表現に対する char* を返します.返され
+る文字列の末尾には nul 文字が付加されます.なお,途中に nul
+文字が含まれる場合は ArgumentError が発生します.
+一方,StringValuePtr() では,末尾に nul 文字がある保証はなく,
+途中に nul 文字が含まれている可能性もあります.
+
+それ以外のデータタイプは対応するCの構造体があります.対応す
+る構造体のあるVALUEはそのままキャスト(型変換)すれば構造体の
+ポインタに変換できます.
+
+構造体は「struct RXxxxx」という名前でruby.hで定義されていま
+す.例えば文字列は「struct RString」です.実際に使う可能性が
+あるのは文字列と配列くらいだと思います.
+
+ruby.hでは構造体へキャストするマクロも「RXXXXX()」(全部大文
+字にしたもの)という名前で提供されています(例: RSTRING()).
+
+構造体からデータを取り出すマクロが提供されています.文字列
+strの長さを得るためには「RSTRING_LEN(str)」とし,文字列strを
+char*として得るためには「RSTRING_PTR(str)」とします.配列の
+場合には,それぞれ「RARRAY_LEN(ary)」,「RARRAY_PTR(ary)」と
+なります.
+
+Rubyの構造体を直接アクセスする時に気をつけなければならないこ
+とは,配列や文字列の構造体の中身は参照するだけで,直接変更し
+ないことです.直接変更した場合,オブジェクトの内容の整合性が
+とれなくなって,思わぬバグの原因になります.
+
+1.4 CのデータをVALUEに変換する
+
+VALUEの実際の構造は
+
+ * FIXNUMの場合
+
+ 1bit左シフトして,LSBを立てる.
+
+ * その他のポインタの場合
+
+ そのままVALUEにキャストする.
+
+となっています.よって,LSBをチェックすればVALUEがFIXNUMかど
+うかわかるわけです(ポインタのLSBが立っていないことを仮定して
+いる).
+
+ですから,FIXNUM以外のRubyのオブジェクトの構造体は単にVALUE
+にキャストするだけでVALUEに変換出来ます.ただし,任意の構造
+体がVALUEにキャスト出来るわけではありません.キャストするの
+はRubyの知っている構造体(ruby.hで定義されているstruct RXxxx
+のもの)だけです.
+
+FIXNUMに関しては変換マクロを経由する必要があります.Cの整数
+からVALUEに変換するマクロは以下のものがあります.必要に応じ
+て使い分けてください.
+
+ INT2FIX() もとの整数が31bitまたは63bit以内に収まる自信
+ がある時
+ INT2NUM() 任意の整数からVALUEへ
+
+INT2NUM()は整数がFIXNUMの範囲に収まらない場合,Bignumに変換
+してくれます(が,少し遅い).
+
+1.5 Rubyのデータを操作する
+
+先程も述べた通り,Rubyの構造体をアクセスする時に内容の更新を
+行うことは勧められません.で,Rubyのデータを操作する時には
+Rubyが用意している関数を用いてください.
+
+ここではもっとも使われるであろう文字列と配列の生成/操作を行
+い関数をあげます(全部ではないです).
+
+ 文字列に対する関数
rb_str_new(const char *ptr, long len)
- Rubyʸ롥
+ 新しいRubyの文字列を生成する.
rb_str_new2(const char *ptr)
rb_str_new_cstr(const char *ptr)
- Cʸ󤫤Rubyʸ롥δؿεǽ
- rb_str_new(ptr, strlen(ptr))ƱǤ롥
+ Cの文字列からRubyの文字列を生成する.この関数の機能は
+ rb_str_new(ptr, strlen(ptr))と同等である.
rb_tainted_str_new(const char *ptr, long len)
- ޡղä줿Rubyʸ롥
- Υǡ˴Ťʸˤϱޡղä٤
- Ǥ롥
+ 汚染マークが付加された新しいRubyの文字列を生成する.外部
+ からのデータに基づく文字列には汚染マークが付加されるべき
+ である.
rb_tainted_str_new2(const char *ptr)
rb_tainted_str_new_cstr(const char *ptr)
- Cʸ󤫤ޡղä줿Rubyʸ롥
+ Cの文字列から汚染マークが付加されたRubyの文字列を生成する.
rb_sprintf(const char *format, ...)
rb_vsprintf(const char *format, va_list ap)
- Cʸformat³printf(3)ΥեޥåȤˤä
- Rubyʸ롥
+ Cの文字列formatと続く引数をprintf(3)のフォーマットにしたがって
+ 整形し,Rubyの文字列を生成する.
rb_str_cat(VALUE str, const char *ptr, long len)
- RubyʸstrlenХȤʸptrɲä롥
+ Rubyの文字列strにlenバイトの文字列ptrを追加する.
rb_str_cat2(VALUE str, const char* ptr)
- RubyʸstrCʸptrɲä롥δؿεǽ
- rb_str_cat(str, ptr, strlen(ptr))ƱǤ롥
+ Rubyの文字列strにCの文字列ptrを追加する.この関数の機能は
+ rb_str_cat(str, ptr, strlen(ptr))と同等である.
rb_str_catf(VALUE str, const char* format, ...)
rb_str_vcatf(VALUE str, const char* format, va_list ap)
- Cʸformat³printf(3)ΥեޥåȤˤä
- Rubyʸstrɲä롥δؿεǽϡ줾
- rb_str_cat2(str, rb_sprintf(format, ...))
- rb_str_cat2(str, rb_vsprintf(format, ap)) ƱǤ롥
+ Cの文字列formatと続く引数をprintf(3)のフォーマットにしたがって
+ 整形し,Rubyの文字列strに追加する.この関数の機能は,それぞれ
+ rb_str_cat2(str, rb_sprintf(format, ...)) や
+ rb_str_cat2(str, rb_vsprintf(format, ap)) と同等である.
rb_enc_str_new(const char *ptr, long len, rb_encoding *enc)
-
- ꤵ줿󥳡ǥ󥰤Rubyʸ.
-
+
+ 指定されたエンコーディングでRubyの文字列を生成する.
+
rb_usascii_str_new(const char *ptr, long len)
rb_usascii_str_new_cstr(const char *ptr)
- 󥳡ǥ󥰤US-ASCIIRubyʸ.
+ エンコーディングがUS-ASCIIのRubyの文字列を生成する.
rb_str_resize(VALUE str, long len)
- RubyʸΥlenХȤѹ롥strĹ
- ʤƥåȤƤʤФʤʤlenĹû
- ϡlenХȤۤʬƤϼΤƤ롥len
- ĹĹϡĹۤʬƤ¸
- ʤǥߤˤʤδؿθƤӽФˤä
- RSTRING_PTR(str)ѹ뤫⤷ʤȤա
+ Rubyの文字列のサイズをlenバイトに変更する.strの長さは前
+ 以てセットされていなければならない.lenが元の長さよりも短
+ い時は,lenバイトを越えた部分の内容は捨てられる.lenが元
+ の長さよりも長い時は,元の長さを越えた部分の内容は保存さ
+ れないでゴミになるだろう.この関数の呼び出しによって
+ RSTRING_PTR(str)が変更されるかもしれないことに注意.
rb_str_set_len(VALUE str, long len)
- RubyʸΥlenХȤ˥åȤ롥strѹ
- ǽǤʤ㳰ȯ롥RSTRING_LEN(str)Ȥ̵طˡ
- lenХȤޤǤƤ¸롥lenstr̤ۤƤ
- ƤϤʤʤ
+ Rubyの文字列のサイズをlenバイトにセットする.strが変更可
+ 能でなければ例外が発生する.RSTRING_LEN(str)とは無関係に,
+ lenバイトまでの内容は保存される.lenはstrの容量を越えてい
+ てはならない.
- Фؿ
+ 配列に対する関数
rb_ary_new()
- Ǥ0롥
+ 要素が0の配列を生成する.
rb_ary_new2(long len)
- Ǥ0롥lenʬΰ򤢤餫
- ƤƤ
+ 要素が0の配列を生成する.len要素分の領域をあらかじめ割り
+ 当てておく.
rb_ary_new3(long n, ...)
- ǻꤷnǤޤ롥
+ 引数で指定したn要素を含む配列を生成する.
rb_ary_new4(long n, VALUE *elts)
- ͿnǤ롥
+ 配列で与えたn要素の配列を生成する.
rb_ary_to_ary(VALUE obj)
- ֥ȤѴ.
- Object#to_aryƱǤ.
+ オブジェクトを配列に変換する.
+ Object#to_aryと同等である.
- ¾ˤؿ¿.
- aryϤʤФʤʤ. ʤ
- Ǥ.
+ 他にも配列を操作する関数が多数ある. これらは
+ 引数aryに配列を渡さなければならない. さもないと
+ コアを吐く.
rb_ary_aref(argc, VALUE *argv, VALUE ary)
- Array#[]Ʊ.
+ Array#[]と同等.
rb_ary_entry(VALUE ary, long offset)
@@ -312,412 +312,426 @@ RubyѰդƤؿѤƤ
rb_ary_shift(VALUE ary)
rb_ary_unshift(VALUE ary, VALUE val)
-2RubyεǽȤ
+ rb_ary_cat(VALUE ary, const VALUE *ptr, long len)
+
+ 配列aryにptrからlen個のオブジェクトを追加する.
-ŪRubyǽ񤱤뤳ȤCǤ񤱤ޤRubyΤΤCǵ
-ҤƤǤ顤ȤʤǤɡ
-Rubyγĥ˻ȤȤ¿ͽ¬뵡ǽ濴˾
-𤷤ޤ
+2.Rubyの機能を使う
-2.1 Ruby˵ǽɲä
+原理的にRubyで書けることはCでも書けます.RubyそのものがCで記
+述されているんですから,当然といえば当然なんですけど.ここで
+はRubyの拡張に使うことが多いだろうと予測される機能を中心に紹
+介します.
-Ruby󶡤ƤؿȤRuby󥿥ץ꥿˿ǽ
-ɲä뤳ȤǤޤRubyǤϰʲεǽɲäؿ
-󶡤Ƥޤ
+2.1 Rubyに機能を追加する
- * 饹⥸塼
- * ᥽åɡðۥ᥽åɤʤ
- *
+Rubyで提供されている関数を使えばRubyインタプリタに新しい機能
+を追加することができます.Rubyでは以下の機能を追加する関数が
+提供されています.
-ǤϽ˾Ҳ𤷤ޤ
+ * クラス,モジュール
+ * メソッド,特異メソッドなど
+ * 定数
-2.1.1 饹/⥸塼
+では順に紹介します.
-饹⥸塼뤿ˤϡʲδؿȤޤ
+2.1.1 クラス/モジュール定義
+
+クラスやモジュールを定義するためには,以下の関数を使います.
VALUE rb_define_class(const char *name, VALUE super)
VALUE rb_define_module(const char *name)
-δؿϿ줿饹⥸塼֤ޤ
-᥽åɤˤͤɬפʤΤǡۤȤɤξ
-ͤѿ˳ǼƤɬפǤ礦
+これらの関数は新しく定義されたクラスやモジュールを返します.
+メソッドや定数の定義にこれらの値が必要なので,ほとんどの場合
+は戻り値を変数に格納しておく必要があるでしょう.
-饹⥸塼¾Υ饹˥ͥȤ
-ϰʲδؿȤޤ
+クラスやモジュールを他のクラスの内部にネストして定義する時に
+は以下の関数を使います.
VALUE rb_define_class_under(VALUE outer, const char *name, VALUE super)
VALUE rb_define_module_under(VALUE outer, const char *name)
-2.1.2 ᥽å/ðۥ᥽å
+2.1.2 メソッド/特異メソッド定義
-᥽åɤðۥ᥽åɤˤϰʲδؿȤޤ
+メソッドや特異メソッドを定義するには以下の関数を使います.
- void rb_define_method(VALUE klass, const char *name,
+ void rb_define_method(VALUE klass, const char *name,
VALUE (*func)(), int argc)
- void rb_define_singleton_method(VALUE object, const char *name,
+ void rb_define_singleton_method(VALUE object, const char *name,
VALUE (*func)(), int argc)
-ǰΤȡðۥ᥽åɡפȤϡΥ֥
-ȤФƤͭʥ᥽åɤǤRubyǤϤ褯Smalltalkˤ
-륯饹᥽åɤȤơ饹Фðۥ᥽åɤȤ
+念のため説明すると「特異メソッド」とは,その特定のオブジェク
+トに対してだけ有効なメソッドです.RubyではよくSmalltalkにお
+けるクラスメソッドとして,クラスに対する特異メソッドが使われ
+ます.
-δؿ argcȤCδؿϤο(
-)ޤargc0ʾλϴؿ˰Ϥο
-̣ޤ16İʾΰϻȤޤ(פޤ͡
-ʤ)ºݤδؿˤƬΰȤselfͿޤ
-ǡꤷ1¿ĤȤˤʤޤ
+これらの関数の argcという引数はCの関数へ渡される引数の数(と
+形式)を決めます.argcが0以上の時は関数に引き渡す引数の数を意
+味します.16個以上の引数は使えません(が,要りませんよね,そ
+んなに).実際の関数には先頭の引数としてselfが与えられますの
+で,指定した数より1多い引数を持つことになります.
-argcλϰοǤϤʤꤷȤˤʤޤ
-argc-1λϰϤޤargc-2λϰ
-RubyȤϤޤ
+argcが負の時は引数の数ではなく,形式を指定したことになります.
+argcが-1の時は引数を配列に入れて渡されます.argcが-2の時は引
+数はRubyの配列として渡されます.
-᥽åɤؿϤޤĤޤ. ҤȤĤϥ᥽å
-̾ȤIDޤ. IDˤĤƤ2.2.2򻲾.
+メソッドを定義する関数はまだいくつかあります. ひとつはメソッド
+名としてIDを取ります. IDについては2.2.2を参照.
- void rb_define_method_id(VALUE klass, ID name,
+ void rb_define_method_id(VALUE klass, ID name,
VALUE (*func)(ANYARGS), int argc)
-private/protectedʥ᥽åɤդĤδؿޤ.
+private/protectedなメソッドを定義するふたつの関数があります.
- void rb_define_private_method(VALUE klass, const char *name,
+ void rb_define_private_method(VALUE klass, const char *name,
VALUE (*func)(), int argc)
- void rb_define_protected_method(VALUE klass, const char *name,
+ void rb_define_protected_method(VALUE klass, const char *name,
VALUE (*func)(), int argc)
-private᥽åɤȤϴؿǤƤӽФȤνʤ᥽
-ɤǤ
+privateメソッドとは関数形式でしか呼び出すことの出来ないメソッ
+ドです.
-Ǹˡ rb_define_moduleؿϥ⥸塼ؿޤ
-⥸塼ؿȤϥ⥸塼ðۥ᥽åɤǤꡤƱ
-private᥽åɤǤ⤢ΤǤ򤢤Math⥸塼
-sqrt()ʤɤޤΥ᥽åɤ
+最後に, rb_define_module関数はモジュール関数を定義します.
+モジュール関数とはモジュールの特異メソッドであり,同時に
+privateメソッドでもあるものです.例をあげるとMathモジュール
+のsqrt()などがあげられます.このメソッドは
Math.sqrt(4)
-ȤǤ
+という形式でも
include Math
sqrt(4)
-ȤǤȤޤ⥸塼ؿؿϰʲ
-̤Ǥ
+という形式でも使えます.モジュール関数を定義する関数は以下の
+通りです.
- void rb_define_module_function(VALUE module, const char *name,
+ void rb_define_module_function(VALUE module, const char *name,
VALUE (*func)(), int argc)
-ؿŪ᥽å(Kernel⥸塼private method)뤿
-δؿϰʲ̤Ǥ
+関数的メソッド(Kernelモジュールのprivate method)を定義するた
+めの関数は以下の通りです.
void rb_define_global_function(const char *name, VALUE (*func)(), int argc)
-᥽åɤ̾뤿δؿϰʲ̤Ǥ
+メソッドの別名を定義するための関数は以下の通りです.
void rb_define_alias(VALUE module, const char* new, const char* old);
-°μ᥽åɤˤ
+属性の取得・設定メソッドを定義するには
void rb_define_attr(VALUE klass, const char *name, int read, int write)
-饹᥽åallocateꤹ뤿δؿ
-ʲ̤Ǥ
+クラスメソッドallocateを定義したり削除したりするための関数は
+以下の通りです.
void rb_define_alloc_func(VALUE klass, VALUE (*func)(VALUE klass));
void rb_undef_alloc_func(VALUE klass);
-funcϥ饹ȤƼäơƤ줿
-󥹤֤ʤƤϤʤޤ󡥤Υ󥹥󥹤ϡ
-ʤɤޤޤʤǤֶפΤޤޤˤƤۤ
-褤Ǥ礦
+funcはクラスを引数として受け取って,新しく割り当てられたイン
+スタンスを返さなくてはなりません.このインスタンスは,外部リ
+ソースなどを含まない,できるだけ「空」のままにしておいたほう
+がよいでしょう.
-2.1.3
+2.1.3 定数定義
-ĥ饤֥꤬ɬפϤ餫Ƥɤ
-Ǥ礦ؿĤޤ
+拡張ライブラリが必要な定数はあらかじめ定義しておいた方が良い
+でしょう.定数を定義する関数は二つあります.
void rb_define_const(VALUE klass, const char *name, VALUE val)
void rb_define_global_const(const char *name, VALUE val)
-ԤΥ饹/⥸塼°Ρ
-ԤϥХΤǤ
+前者は特定のクラス/モジュールに属する定数を定義するもの,後
+者はグローバルな定数を定義するものです.
-2.2 RubyεǽCƤӽФ
+2.2 Rubyの機能をCから呼び出す
-ˡ1.5 RubyΥǡ٤ǰҲ𤷤褦ʴؿ
-ȤСRubyεǽ¸ƤؿľܸƤӽФȤ
+既に『1.5 Rubyのデータを操作する』で一部紹介したような関数を
+使えば,Rubyの機能を実現している関数を直接呼び出すことが出来
+ます.
-# Τ褦ʴؿΰɽϤޤΤȤޤ󡥥
-# 뤷ʤǤ͡
+# このような関数の一覧表はいまのところありません.ソースを見
+# るしかないですね.
-ʳˤRubyεǽƤӽФˡϤĤޤ
+それ以外にもRubyの機能を呼び出す方法はいくつかあります.
-2.2.1 RubyΥץeval
+2.2.1 Rubyのプログラムをevalする
-CRubyεǽƤӽФäȤñˡȤơʸ
-Ϳ줿RubyΥץɾʲδؿޤ
+CからRubyの機能を呼び出すもっとも簡単な方法として,文字列で
+与えられたRubyのプログラムを評価する以下の関数があります.
VALUE rb_eval_string(const char *str)
-ɾϸߤδĶǹԤޤĤޤꡤߤΥѿ
-ʤɤѤޤ
+この評価は現在の環境で行われます.つまり,現在のローカル変数
+などを受け継ぎます.
-ɾ㳰ȯ뤫⤷ʤȤդޤ礦.
-ʴؿ⤢ޤ.
+評価は例外を発生するかもしれないことに注意しましょう. より安全
+な関数もあります.
VALUE rb_eval_string_protect(const char *str, int *state)
-δؿϥ顼ȯnil֤ޤơˤ
-*stateϥˡʤ󥼥ˤʤޤ
+この関数はエラーが発生するとnilを返します.そして,成功時には
+*stateはゼロに,さもなくば非ゼロになります.
-2.2.2 IDޤϥܥ
+2.2.2 IDまたはシンボル
-CʸͳRubyΥ᥽åɤƤӽФȤǤ
-ˡRuby󥿥ץ꥿ǥ᥽åɤѿ̾ꤹ
-˻ȤƤIDˤĤƤޤ礦
+Cから文字列を経由せずにRubyのメソッドを呼び出すこともできま
+す.その前に,Rubyインタプリタ内でメソッドや変数名を指定する
+時に使われているIDについて説明しておきましょう.
-IDȤѿ̾᥽å̾ɽǤRubyǤ
+IDとは変数名,メソッド名を表す整数です.Rubyの中では
- :̻
- :"Ǥդʸ"
+ :識別子
+または
+ :"任意の文字列"
-ǥǤޤC餳뤿ˤϴؿ
+でアクセスできます.Cからこの整数を得るためには関数
rb_intern(const char *name)
+ rb_intern_str(VALUE name)
-ȤޤRubyȤͿ줿ܥ(ޤʸ
-)IDѴˤϰʲδؿȤޤ
+を使います.Rubyから引数として与えられたシンボル(または文字
+列)をIDに変換するには以下の関数を使います.
rb_to_id(VALUE symbol)
+ rb_check_id(volatile VALUE *name)
+ rb_check_id_cstr(const char *name, long len, rb_encoding *enc)
+
+もし引数がシンボルでも文字列でもなければ、to_strメソッドで文
+字列に変換しようとします.第二の関数はその変換結果を*nameに保
+存し,その名前が既知のシンボルでない場合は0を返します.この関
+数が0以外を返した場合は*nameは常にシンボルか文字列であり、0を
+返した場合は常に文字列です.第三の関数はRubyの文字列ではなく
+NUL終端されたCの文字列を使います.
-2.2.3 CRubyΥ᥽åɤƤӽФ
+2.2.3 CからRubyのメソッドを呼び出す
-CʸͳRubyΥ᥽åɤƤӽФˤϰʲ
-δؿȤޤ
+Cから文字列を経由せずにRubyのメソッドを呼び出すためには以下
+の関数を使います.
VALUE rb_funcall(VALUE recv, ID mid, int argc, ...)
-δؿϥ֥recvmidǻꤵ᥽åɤƤӽ
-ޤ¾˰λλ㤦ʲδؿ⤢ޤ
+この関数はオブジェクトrecvのmidで指定されるメソッドを呼び出
+します.その他に引数の指定の仕方が違う以下の関数もあります.
VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv)
VALUE rb_apply(VALUE recv, ID mid, VALUE args)
-applyˤϰȤRubyͿޤ
+applyには引数としてRubyの配列を与えます.
-2.2.4 ѿ/򻲾/
+2.2.4 変数/定数を参照/更新する
-CؿȤäƻȡǤΤϡ󥹥
-ǤѿϰΤΤCѿȤƥǤ
-ޤѿ򻲾ȤˡϸƤޤ
+Cから関数を使って参照・更新できるのは,定数,インスタンス変
+数です.大域変数は一部のものはCの大域変数としてアクセスでき
+ます.ローカル変数を参照する方法は公開していません.
-֥ȤΥ󥹥ѿ򻲾ȡؿϰʲ
+オブジェクトのインスタンス変数を参照・更新する関数は以下の通
+りです.
VALUE rb_ivar_get(VALUE obj, ID id)
VALUE rb_ivar_set(VALUE obj, ID id, VALUE val)
-idrb_intern()ΤȤäƤ
+idはrb_intern()で得られるものを使ってください.
-򻲾ȤˤϰʲδؿȤäƤ
+定数を参照するには以下の関数を使ってください.
VALUE rb_const_get(VALUE obj, ID id)
-򿷤뤿ˤϡ2.1.3 ٤ǾҲ
-ƤؿȤäƤ
+定数を新しく定義するためには『2.1.3 定数定義』で紹介さ
+れている関数を使ってください.
-3RubyCȤξͭ
+3.RubyとCとの情報共有
-CRubyδ֤ǾͭˡˤĤƲ⤷ޤ
+C言語とRubyの間で情報を共有する方法について解説します.
-3.1 C黲ȤǤRuby
+3.1 Cから参照できるRubyの定数
-ʲRubyCΥ٥뤫黲ȤǤޤ
+以下のRubyの定数はCのレベルから参照できます.
Qtrue
Qfalse
- ͡QfalseCǤ⵶Ȥߤʤޤ(Ĥޤ0)
+ 真偽値.QfalseはC言語でも偽とみなされます(つまり0).
Qnil
- C줫鸫nilס
+ C言語から見た「nil」.
-3.2 CRubyǶͭѿ
+3.2 CとRubyで共有される大域変数
-CRubyѿȤäƾͭǤޤͭǤ
-ѿˤϤĤμबޤΤʤǤäȤɤȤ
-ȻפΤrb_define_variable()Ǥ
+CとRubyで大域変数を使って情報を共有できます.共有できる大域
+変数にはいくつかの種類があります.そのなかでもっとも良く使わ
+れると思われるのはrb_define_variable()です.
void rb_define_variable(const char *name, VALUE *var)
-δؿRubyCȤǶͭѿޤѿ̾
-`$'ǻϤޤʤˤϼưŪɲäޤѿͤ
-ȼưŪRubyбѿͤѤޤ
+この関数はRubyとCとで共有する大域変数を定義します.変数名が
+`$'で始まらない時には自動的に追加されます.この変数の値を変
+更すると自動的にRubyの対応する変数の値も変わります.
-ޤRuby¦ϹǤʤѿ⤢ޤread only
-ѿϰʲδؿޤ
+またRuby側からは更新できない変数もあります.このread onlyの
+変数は以下の関数で定義します.
void rb_define_readonly_variable(const char *name, VALUE *var)
-ѿ¾hookĤѿǤޤhookդ
-ѿϰʲδؿѤޤhookդѿ
-ͤλȤhookǹԤɬפޤ
+これら変数の他にhookをつけた大域変数を定義できます.hook付き
+の大域変数は以下の関数を用いて定義します.hook付き大域変数の
+値の参照や設定はhookで行う必要があります.
void rb_define_hooked_variable(const char *name, VALUE *var,
VALUE (*getter)(), void (*setter)())
-δؿCδؿˤähookΤĤ줿ѿ
-ѿȤ줿ˤϴؿgetterѿͤåȤ
-ˤϴؿsetterƤФ롥hookꤷʤgetter
-setter0ꤷޤ
-# gettersetter0ʤrb_define_variable()Ʊˤʤ롥
+この関数はCの関数によってhookのつけられた大域変数を定義しま
+す.変数が参照された時には関数getterが,変数に値がセットされ
+た時には関数setterが呼ばれる.hookを指定しない場合はgetterや
+setterに0を指定します.
+# getterもsetterも0ならばrb_define_variable()と同じになる.
-gettersetterλͤϼ̤Ǥ
+getterとsetterの仕様は次の通りです.
VALUE (*getter)(ID id, VALUE *var);
void (*setter)(VALUE val, ID id, VALUE *var);
-줫顤бCѿʤRubyѿ
-ȤǤޤ. ѿͤϥեåؿΤߤˤäƼ
-ޤ.
+それから,対応するCの変数を持たないRubyの大域変数を定義する
+こともできます. その変数の値はフック関数のみによって取得・設定
+されます.
void rb_define_virtual_variable(const char *name,
VALUE (*getter)(), void (*setter)())
-δؿˤä줿RubyѿȤ줿ˤ
-getterѿͤåȤ줿ˤsetterƤФޤ
+この関数によって定義されたRubyの大域変数が参照された時には
+getterが,変数に値がセットされた時にはsetterが呼ばれます.
-gettersetterλͤϰʲ̤Ǥ
+getterとsetterの仕様は以下の通りです.
(*getter)(ID id);
(*setter)(VALUE val, ID id);
-3.3 CΥǡRuby֥Ȥˤ
+3.3 CのデータをRubyオブジェクトにする
-C줿ǡ(¤)RubyΥ֥ȤȤ
-갷礬ꤨޤΤ褦ʾˤϡDataȤ
-Ruby֥ȤCι¤(ؤΥݥ)򤯤ळȤRuby
-֥ȤȤƼ갷褦ˤʤޤ
+Cの世界で定義されたデータ(構造体)をRubyのオブジェクトとして
+取り扱いたい場合がありえます.このような場合には,Dataという
+RubyオブジェクトにCの構造体(へのポインタ)をくるむことでRuby
+オブジェクトとして取り扱えるようになります.
-Data֥Ȥƹ¤ΤRuby֥Ȥ˥ץ
-뤿ˤϡʲΥޥȤޤ
+Dataオブジェクトを生成して構造体をRubyオブジェクトにカプセル
+化するためには,以下のマクロを使います.
- Data_Wrap_Struct(klass, mark, free, ptr)
+ Data_Wrap_Struct(klass, mark, free, sval)
-Υޥͤ줿Data֥ȤǤ
+このマクロの戻り値は生成されたDataオブジェクトです.
-klassϤData֥ȤΥ饹Ǥptrϥץ벽
-Cι¤ΤؤΥݥ󥿤ǤmarkϤι¤ΤRubyΥ֥
-ȤؤλȤ˻ȤؿǤΤ褦ʻȤޤޤʤ
-ˤ0ꤷޤ
+klassはこのDataオブジェクトのクラスです.ptrはカプセル化する
+Cの構造体へのポインタです.markはこの構造体がRubyのオブジェ
+クトへの参照がある時に使う関数です.そのような参照を含まない
+時には0を指定します.
-# Τ褦ʻȤϴޤ
+# そのような参照は勧められません.
-freeϤι¤Τ⤦פˤʤä˸ƤФؿǤ
-ؿ١쥯ƤФޤ줬-1ξϡñ
-˳ޤ
+freeはこの構造体がもう不要になった時に呼ばれる関数です.この
+関数がガーベージコレクタから呼ばれます.これが-1の場合は,単
+純に開放されます.
-markfreeؿGC¹˸ƤӽФޤ.
-ʤ, GC¹Ruby֥ȤΥ϶ػߤ
-. ä, markfreeؿRuby֥ȤΥ
-ϹԤʤǤ.
+markおよびfree関数はGC実行中に呼び出されます.
+なお, GC実行中はRubyオブジェクトのアロケーションは禁止されま
+す. よって, markおよびfree関数でRubyオブジェクトのアロケーシ
+ョンは行わないでください.
-Cι¤ΤγData֥ȤƱ˹Ԥޥ
-ưʲΤΤ󶡤Ƥޤ
+Cの構造体の割当とDataオブジェクトの生成を同時に行うマクロと
+して以下のものが提供されています.
Data_Make_Struct(klass, type, mark, free, sval)
-Υޥͤ줿Data֥ȤǤ
+このマクロの戻り値は生成されたDataオブジェクトです.
-klass, mark, freeData_Wrap_StructƱƯ򤷤ޤtype
-ϳƤC¤ΤηǤƤ줿¤Τѿsval
-ޤѿη (type*) Ǥɬפޤ
+klass, mark, freeはData_Wrap_Structと同じ働きをします.type
+は割り当てるC構造体の型です.割り当てられた構造体は変数sval
+に代入されます.この変数の型は (type*) である必要があります.
-Data֥Ȥݥ󥿤ФΤϰʲΥޥѤ
+Dataオブジェクトからポインタを取り出すのは以下のマクロを用い
+ます.
Data_Get_Struct(obj, type, sval)
-Cι¤ΤؤΥݥ󥿤ѿsvalޤ
+Cの構造体へのポインタは変数svalに代入されます.
-DataλȤϤäʬˤΤǡ
-򻲾ȤƤ
+これらのDataの使い方はちょっと分かりにくいので,後で説明する
+例題を参照してください.
-4 - dbmѥå
+4.例題 - dbmパッケージを作る
-ޤǤǤȤꤢĥ饤֥ϺϤǤ
-Rubyextǥ쥯ȥˤǤ˴ޤޤƤdbm饤֥
-ʳŪޤ
+ここまでの説明でとりあえず拡張ライブラリは作れるはずです.
+Rubyのextディレクトリにすでに含まれているdbmライブラリを例に
+して段階的に説明します.
-(1) ǥ쥯ȥ
+(1) ディレクトリを作る
% mkdir ext/dbm
-Ruby 1.1ǤդΥǥ쥯ȥǥʥߥå饤֥
-뤳ȤǤ褦ˤʤޤRubyŪ˥󥯤
-RubyŸǥ쥯ȥβextǥ쥯ȥ˳ĥ
-饤֥ѤΥǥ쥯ȥɬפޤ̾Ŭ
-ǹޤ
+Ruby 1.1からは任意のディレクトリでダイナミックライブラリを作
+ることができるようになりました.Rubyに静的にリンクする場合に
+はRubyを展開したディレクトリの下,extディレクトリの中に拡張
+ライブラリ用のディレクトリを作る必要があります.名前は適当に
+選んで構いません.
-(2) ߷פ
+(2) 設計する
-ޤʤǤɡɤǽ¸뤫ɤޤ
-פɬפޤɤʥ饹Ĥ뤫Υ饹ˤ
-ɤʥ᥽åɤ뤫饹󶡤ʤɤˤĤ߷
+まあ,当然なんですけど,どういう機能を実現するかどうかまず設
+計する必要があります.どんなクラスをつくるか,そのクラスには
+どんなメソッドがあるか,クラスが提供する定数などについて設計
+します.
-(3) Cɤ
+(3) Cコードを書く
-ĥ饤֥ΤȤʤCΥ񤭤ޤCΥ
-ҤȤĤλˤϡ֥饤֥̾.cפ֤ɤǤ礦C
-Υʣξˤϵդˡ֥饤֥̾.cפȤե
-̾򤱤ɬפޤ֥ȥեȥ⥸塼
-Ū֥饤֥̾.oפȤե
-Ȥͤ뤫ǤޤҤ mkmf 饤֥Τ
-δؿѥפƥȤΤˡconftest.cפȤ
-ե̾Ѥ뤳ȤդƤե
-̾Ȥơconftest.cפѤƤϤʤޤ
+拡張ライブラリ本体となるC言語のソースを書きます.C言語のソー
+スがひとつの時には「ライブラリ名.c」を選ぶと良いでしょう.C
+言語のソースが複数の場合には逆に「ライブラリ名.c」というファ
+イル名は避ける必要があります.オブジェクトファイルとモジュー
+ル生成時に中間的に生成される「ライブラリ名.o」というファイル
+とが衝突するからです.また,後述する mkmf ライブラリのいくつ
+かの関数がコンパイルを要するテストのために「conftest.c」とい
+うファイル名を使用することに注意してください.ソースファイル
+名として「conftest.c」を使用してはなりません.
-Rubyϳĥ饤֥ɤˡInit_饤֥̾פ
-ؿưŪ˼¹Ԥޤdbm饤֥ξInit_dbm
-Ǥδؿǥ饹⥸塼롤᥽åɡʤɤ
-Ԥޤdbm.cѤޤ
+Rubyは拡張ライブラリをロードする時に「Init_ライブラリ名」と
+いう関数を自動的に実行します.dbmライブラリの場合「Init_dbm」
+です.この関数の中でクラス,モジュール,メソッド,定数などの
+定義を行います.dbm.cから一部引用します.
--
void
Init_dbm(void)
{
- /* DBM饹 */
+ /* DBMクラスを定義する */
cDBM = rb_define_class("DBM", rb_cObject);
- /* DBMEnumerate⥸塼򥤥󥯥롼ɤ */
+ /* DBMはEnumerateモジュールをインクルードする */
rb_include_module(cDBM, rb_mEnumerable);
- /* DBM饹Υ饹᥽åopen(): CǼ */
+ /* DBMクラスのクラスメソッドopen(): 引数はCの配列で受ける */
rb_define_singleton_method(cDBM, "open", fdbm_s_open, -1);
- /* DBM饹Υ᥽åclose(): Ϥʤ */
+ /* DBMクラスのメソッドclose(): 引数はなし */
rb_define_method(cDBM, "close", fdbm_close, 0);
- /* DBM饹Υ᥽å[]: 1 */
+ /* DBMクラスのメソッド[]: 引数は1個 */
rb_define_method(cDBM, "[]", fdbm_fetch, 1);
:
- /* DBMǡǼ륤󥹥ѿ̾ΤID */
+ /* DBMデータを格納するインスタンス変数名のためのID */
id_dbm = rb_intern("dbm");
}
--
-DBM饤֥dbmΥǡб륪֥ȤˤʤϤ
-顤CdbmRuby˼ɬפޤ
+DBMライブラリはdbmのデータと対応するオブジェクトになるはずで
+すから,Cの世界のdbmをRubyの世界に取り込む必要があります.
-dbm.cǤData_Make_StructʲΤ褦˻ȤäƤޤ
+dbm.cではData_Make_Structを以下のように使っています.
--
struct dbmdata {
@@ -729,12 +743,12 @@ struct dbmdata {
obj = Data_Make_Struct(klass, struct dbmdata, 0, free_dbm, dbmp);
--
-Ǥdbmstruct¤ΤؤΥݥ󥿤Data˥ץ벽Ƥ
-ޤDBM*ľܥץ벽ʤΤclose()ν
-ƤΤȤǤ
+ここではdbmstruct構造体へのポインタをDataにカプセル化してい
+ます.DBM*を直接カプセル化しないのはclose()した時の処理を考
+えてのことです.
-Data֥Ȥdbmstruct¤ΤΥݥ󥿤Ф
-˰ʲΥޥȤäƤޤ
+Dataオブジェクトからdbmstruct構造体のポインタを取り出すため
+に以下のマクロを使っています.
--
#define GetDBM(obj, dbmp) {\
@@ -743,14 +757,14 @@ Data֥Ȥdbmstruct¤ΤΥݥ󥿤Ф
}
--
-äʣʥޥǤפdbmdata¤ΤΥݥ
-μФȡcloseƤ뤫ɤΥåޤȤƤ
+ちょっと複雑なマクロですが,要するにdbmdata構造体のポインタ
+の取り出しと,closeされているかどうかのチェックをまとめてい
+るだけです.
-DBM饹ˤϤ᥽åɤޤʬह3
-μޤҤȤĤϰοΤΤǡ
-Ƥdelete᥽åɤޤdelete᥽åɤƤ
-fdbm_delete()ϤΤ褦ˤʤäƤޤ
+DBMクラスにはたくさんメソッドがありますが,分類すると3種類の
+引数の受け方があります.ひとつは引数の数が固定のもので,例と
+してはdeleteメソッドがあります.deleteメソッドを実装している
+fdbm_delete()はこのようになっています.
--
static VALUE
@@ -760,13 +774,13 @@ fdbm_delete(VALUE obj, VALUE keystr)
}
--
-οΥפ1self2ʹߤ᥽å
-ΰȤʤޤ
+引数の数が固定のタイプは第1引数がself,第2引数以降がメソッド
+の引数となります.
-οΤΤCǼΤRubyǼ
-ΤȤޤdbm饤֥ǡCǼ
-DBMΥ饹᥽åɤǤopen()ǤƤ
-fdbm_s_open()ϤʤäƤޤ
+引数の数が不定のものはCの配列で受けるものとRubyの配列で受け
+るものとがあります.dbmライブラリの中で,Cの配列で受けるもの
+はDBMのクラスメソッドであるopen()です.これを実装している関
+数fdbm_s_open()はこうなっています.
--
static VALUE
@@ -780,18 +794,18 @@ fdbm_s_open(int argc, VALUE *argv, VALUE klass)
}
--
-Υפδؿ1Ϳ줿ο2Ϳ
-줿äƤˤʤޤself3ȤͿ
+このタイプの関数は第1引数が与えられた引数の数,第2引数が与え
+られた引数の入っている配列になります.selfは第3引数として与
+えられます.
-Ϳ줿Ϥ뤿δؿopen()ǤȤ
-Ƥrb_scan_args()Ǥ3˻ꤷեޥåȤ˽
-4ѿʹߤ˻ꤷVALUEؤλȤͤƤ
-
+この配列で与えられた引数を解析するための関数がopen()でも使わ
+れているrb_scan_args()です.第3引数に指定したフォーマットに従
+い,第4変数以降に指定したVALUEへの参照に値を代入してくれま
+す.
-RubyȤƼ᥽åɤˤ
-Thread#initializeޤϤǤ
+引数をRubyの配列として受け取るメソッドの例には
+Thread#initializeがあります.実装はこうです.
--
static VALUE
@@ -801,141 +815,141 @@ thread_initialize(VALUE thread, VALUE args)
}
--
-1self2RubyǤ
+第1引数はself,第2引数はRubyの配列です.
-** ջ
+** 注意事項
-RubyȶͭϤʤRubyΥ֥ȤǼǽΤ
-CѿϰʲδؿȤäRuby󥿥ץ꥿ѿ¸
-򶵤ƤƤǤʤGCǥȥ֥򵯤ޤ
+Rubyと共有はしないがRubyのオブジェクトを格納する可能性のある
+Cの大域変数は以下の関数を使ってRubyインタプリタに変数の存在
+を教えてあげてください.でないとGCでトラブルを起こします.
void rb_global_variable(VALUE *var)
-(4) extconf.rbѰդ
+(4) extconf.rbを用意する
-Makefileοˤʤextconf.rbȤե
-ޤextconf.rbϥ饤֥ΥѥɬפʾΥ
-ʤɤԤȤŪǤޤ
+Makefileを作る場合の雛型になるextconf.rbというファイルを作り
+ます.extconf.rbはライブラリのコンパイルに必要な条件のチェッ
+クなどを行うことが目的です.まず,
require 'mkmf'
-extconf.rbƬ֤ޤextconf.rbǤϰʲRuby
-ȤȤޤ
+をextconf.rbの先頭に置きます.extconf.rbの中では以下のRuby関
+数を使うことが出来ます.
- have_library(lib, func): 饤֥¸ߥå
- have_func(func, header): ؿ¸ߥå
- have_header(header): إåե¸ߥå
- create_makefile(target): Makefile
+ have_library(lib, func): ライブラリの存在チェック
+ have_func(func, header): 関数の存在チェック
+ have_header(header): ヘッダファイルの存在チェック
+ create_makefile(target[, target_prefix]): Makefileの生成
-ʲѿȤȤǤޤ
+以下の変数を使うことができます.
- $CFLAGS: ѥɲŪ˻ꤹե饰(-Oʤ)
- $CPPFLAGS: ץץåɲŪ˻ꤹե饰(-I-Dʤ)
- $LDFLAGS: 󥯻ɲŪ˻ꤹե饰(-Lʤ)
- $objs: 󥯤륪֥ȥե̾Υꥹ
+ $CFLAGS: コンパイル時に追加的に指定するフラグ(-Oなど)
+ $CPPFLAGS: プリプロセッサに追加的に指定するフラグ(-Iや-Dなど)
+ $LDFLAGS: リンク時に追加的に指定するフラグ(-Lなど)
+ $objs: リンクされるオブジェクトファイル名のリスト
-֥ȥեΥꥹȤϡ̾ϥե򸡺
-ƼưŪޤmakeǥ褦
-Ū˻ꤹɬפޤ
+オブジェクトファイルのリストは,通常はソースファイルを検索し
+て自動的に生成されますが,makeの途中でソースを生成するような
+場合は明示的に指定する必要があります.
-饤֥򥳥ѥ뤹郎·鷺Υ饤֥򥳥
-ѥ뤷ʤˤcreate_makefileƤФʤMakefile
-줺ѥԤޤ
+ライブラリをコンパイルする条件が揃わず,そのライブラリをコン
+パイルしない時にはcreate_makefileを呼ばなければMakefileは生
+成されず,コンパイルも行われません.
-(5) dependѰդ
+(5) dependを用意する
-⤷ǥ쥯ȥdependȤե뤬¸ߤС
-Makefile¸طåƤޤ
+もし,ディレクトリにdependというファイルが存在すれば,
+Makefileが依存関係をチェックしてくれます.
% gcc -MM *.c > depend
-ʤɤǺ뤳Ȥޤä»̵Ǥ礦
+などで作ることが出来ます.あって損は無いでしょう.
-(6) Makefile
+(6) Makefileを生成する
-Makefileºݤ뤿ˤ
+Makefileを実際に生成するためには
ruby extconf.rb
-Ȥޤextconf.rb require 'mkmf' ιԤʤˤϥ顼
-ˤʤޤΤǡɲä
+とします.extconf.rbに require 'mkmf' の行がない場合にはエラー
+になりますので,引数を追加して
ruby -r mkmf extconf.rb
-ȤƤ
+としてください.
-site_ruby ǥ쥯ȥǤʤ
-vendor_ruby ǥ쥯ȥ˥󥹥ȡ뤹ˤ
-ʲΤ褦 --vendor ץäƤ
+site_ruby ディレクトリでなく,
+vendor_ruby ディレクトリにインストールする場合には
+以下のように --vendor オプションを加えてください.
ruby extconf.rb --vendor
-ǥ쥯ȥextʲѰդˤRubyΤmakeλ
-ưŪMakefileޤΤǡΥƥåפפǤ
+ディレクトリをext以下に用意した場合にはRuby全体のmakeの時に
+自動的にMakefileが生成されますので,このステップは不要です.
-(7) make
+(7) makeする
-ưŪ󥯥饤֥ˤϤξmakeƤ
-ɬפǤ make install ǥ󥹥ȡ뤵ޤ
+動的リンクライブラリを生成する場合にはその場でmakeしてくださ
+い.必要であれば make install でインストールされます.
-extʲ˥ǥ쥯ȥѰդϡRubyΥǥ쥯ȥ
-make¹ԤMakefilemakeɬפˤäƤϤΥ
-塼RubyؤΥ󥯤ޤǼưŪ˼¹ԤƤޤ
-extconf.rb񤭴ʤɤMakefileκɬפʻϤ
-Rubyǥ쥯ȥmakeƤ
+ext以下にディレクトリを用意した場合は,Rubyのディレクトリで
+makeを実行するとMakefileを生成からmake,必要によってはそのモ
+ジュールのRubyへのリンクまで自動的に実行してくれます.
+extconf.rbを書き換えるなどしてMakefileの再生成が必要な時はま
+たRubyディレクトリでmakeしてください.
-ĥ饤֥make installRuby饤֥Υǥ쥯ȥ
-˥ԡޤ⤷ĥ饤֥ȶĴƻȤRubyǵ
-Ҥ줿ץबꡤRuby饤֥֤ˤϡ
-ĥ饤֥ѤΥǥ쥯ȥβ lib Ȥǥ쥯ȥ
-ꡤ ĥ .rb Υե֤ƤƱ˥
-ȡ뤵ޤ
+拡張ライブラリはmake installでRubyライブラリのディレクトリの
+下にコピーされます.もし拡張ライブラリと協調して使うRubyで記
+述されたプログラムがあり,Rubyライブラリに置きたい場合には,
+拡張ライブラリ用のディレクトリの下に lib というディレクトリ
+を作り,そこに 拡張子 .rb のファイルを置いておけば同時にイン
+ストールされます.
-(8) ǥХå
+(8) デバッグ
-ޤǥХåʤưʤǤ礦͡ext/Setup˥ǥ
-ȥ̾񤯤Ū˥󥯤ΤǥǥХåȤ褦ˤ
-ޤʬѥ뤬٤ʤޤɡ
+まあ,デバッグしないと動かないでしょうね.ext/Setupにディレ
+クトリ名を書くと静的にリンクするのでデバッガが使えるようにな
+ります.その分コンパイルが遅くなりますけど.
-(9) Ǥ
+(9) できあがり
-ϤäȤʤꡤʤꡤʤꡤͳˤ
-ȤRubyκԤϳĥ饤֥˴ؤưڤθ
-ĥޤ
+後はこっそり使うなり,広く公開するなり,売るなり,ご自由にお
+使いください.Rubyの作者は拡張ライブラリに関して一切の権利を
+主張しません.
-Appendix A. RubyΥɤʬ
+Appendix A. Rubyのソースコードの分類
-RubyΥϤĤʬह뤳ȤޤΤ
-饤֥ʬϴŪ˳ĥ饤֥Ʊˤʤ
-ƤޤΥϺޤǤǤۤȤǤ
-פޤ
+Rubyのソースはいくつかに分類することが出来ます.このうちクラ
+スライブラリの部分は基本的に拡張ライブラリと同じ作り方になっ
+ています.これらのソースは今までの説明でほとんど理解できると
+思います.
-RubyΥ
+Ruby言語のコア
- class.c : 饹ȥ⥸塼
- error.c : 㳰饹㳰
- gc.c : ΰ
- load.c : 饤֥Υ
- object.c : ֥
- variable.c : ѿ
+ class.c : クラスとモジュール
+ error.c : 例外クラスと例外機構
+ gc.c : 記憶領域管理
+ load.c : ライブラリのロード
+ object.c : オブジェクト
+ variable.c : 変数と定数
-Rubyιʸϴ
- parse.y : ϴȹʸ
- -> parse.c : ư
- keywords : ͽ
- -> lex.c : ư
+Rubyの構文解析器
+ parse.y : 字句解析器と構文定義
+ -> parse.c : 自動生成
+ keywords : 予約語
+ -> lex.c : 自動生成
-Rubyɾ (̾YARV)
+Rubyの評価器 (通称YARV)
compile.c
eval.c
eval_error.c
eval_jump.c
eval_safe.c
- insns.def : ۵
- iseq.c : VM::ISeqμ
- thread.c : åɴȥƥڤؤ
- thread_win32.c : åɼ
- thread_pthread.c : Ʊ
+ insns.def : 仮想機械語の定義
+ iseq.c : VM::ISeqの実装
+ thread.c : スレッド管理とコンテキスト切り替え
+ thread_win32.c : スレッド実装
+ thread_pthread.c : 同上
vm.c
vm_dump.c
vm_eval.c
@@ -943,14 +957,14 @@ Rubyɾ (̾YARV)
vm_insnhelper.c
vm_method.c
- opt_insns_unif.def : ̿ͻ
- opt_operand.def : ŬΤ
+ opt_insns_unif.def : 命令融合
+ opt_operand.def : 最適化のための定義
- -> insn*.inc : ư
- -> opt*.inc : ư
- -> vm.inc : ư
+ -> insn*.inc : 自動生成
+ -> opt*.inc : 自動生成
+ -> vm.inc : 自動生成
-ɽ󥸥 ()
+正規表現エンジン (鬼車)
regex.c
regcomp.c
regenc.c
@@ -959,15 +973,15 @@ Rubyɾ (̾YARV)
regparse.c
regsyntax.c
-桼ƥƥؿ
+ユーティリティ関数
- debug.c : CǥХåѤΥǥХåܥ
- dln.c : ưŪǥ
- st.c : ѥϥåɽ
- strftime.c :
- util.c : ¾Υ桼ƥƥ
+ debug.c : Cデバッガ用のデバッグシンボル
+ dln.c : 動的ローディング
+ st.c : 汎用ハッシュ表
+ strftime.c : 時刻整形
+ util.c : その他のユーティリティ
-Rubyޥɤμ
+Rubyコマンドの実装
dmyext.c
dmydln.c
@@ -981,7 +995,7 @@ Rubyޥɤμ
gem_prelude.rb
prelude.rb
-饹饤֥
+クラスライブラリ
array.c : Array
bignum.c : Bignum
@@ -1000,79 +1014,79 @@ Rubyޥɤμ
pack.c : Array#pack, String#unpack
proc.c : Binding, Proc
process.c : Process
- random.c :
+ random.c : 乱数
range.c : Range
rational.c : Rational
re.c : Regexp, MatchData
signal.c : Signal
- sprintf.c :
+ sprintf.c :
string.c : String
struct.c : Struct
time.c : Time
- defs/known_errors.def : 㳰饹 Errno::*
- -> known_errors.inc : ư
+ defs/known_errors.def : 例外クラス Errno::*
+ -> known_errors.inc : 自動生成
-¿첽
+多言語化
encoding.c : Encoding
transcode.c : Encoding::Converter
- enc/*.c : 󥳡ǥ󥰥饹
- enc/trans/* : ɥݥбɽ
+ enc/*.c : エンコーディングクラス群
+ enc/trans/* : コードポイント対応表
+
+gorubyコマンドの実装
-gorubyޥɤμ
-
goruby.c
- golf_prelude.rb : gorubyͭΥ饤֥
- -> golf_prelude.c : ư
+ golf_prelude.rb : goruby固有のライブラリ
+ -> golf_prelude.c : 自動生成
-Appendix B. ĥѴؿե
+Appendix B. 拡張用関数リファレンス
-C줫RubyεǽѤAPIϰʲ̤Ǥ롥
+C言語からRubyの機能を利用するAPIは以下の通りである.
-**
+** 型
VALUE
- Ruby֥Ȥɽ뷿ɬפ˱ƥ㥹ȤѤ롥
- Ȥ߹߷ɽCηruby.h˵ҤƤRǻϤޤ빽¤
- ΤǤ롥VALUE򤳤˥㥹Ȥ뤿RǻϤޤ빽¤
- ̾ʸˤ̾ΥޥѰդƤ롥
+ Rubyオブジェクトを表現する型.必要に応じてキャストして用いる.
+ 組み込み型を表現するCの型はruby.hに記述してあるRで始まる構造
+ 体である.VALUE型をこれらにキャストするためにRで始まる構造体
+ 名を全て大文字にした名前のマクロが用意されている.
-** ѿ
+** 変数・定数
Qnil
- : nil֥
+ 定数: nilオブジェクト
Qtrue
- : true֥(Υǥե)
+ 定数: trueオブジェクト(真のデフォルト値)
Qfalse
- : false֥
+ 定数: falseオブジェクト
-** CǡΥץ벽
+** Cデータのカプセル化
Data_Wrap_Struct(VALUE klass, void (*mark)(), void (*free)(), void *sval)
- CǤդΥݥ󥿤򥫥ץ벽Ruby֥Ȥ֤
- Υݥ󥿤Ruby饢ʤʤäfreeǻꤷ
- ؿƤФ롥ޤΥݥ󥿤λؤǡ¾Ruby
- ȤؤƤ硤mark˻ꤹؿǥޡɬ
- 롥
+ Cの任意のポインタをカプセル化したRubyオブジェクトを返す.こ
+ のポインタがRubyからアクセスされなくなった時,freeで指定した
+ 関数が呼ばれる.また,このポインタの指すデータが他のRubyオブ
+ ジェクトを指している場合,markに指定する関数でマークする必要
+ がある.
Data_Make_Struct(klass, type, mark, free, sval)
- typeΥmallocѿsval塤򥫥ץ
- 벽ǡ֤ޥ
+ type型のメモリをmallocし,変数svalに代入した後,それをカプセ
+ ル化したデータを返すマクロ.
Data_Get_Struct(data, type, sval)
- datatypeΥݥ󥿤Фѿsvalޥ
+ dataからtype型のポインタを取り出し変数svalに代入するマクロ.
-** å
+** 型チェック
TYPE(value)
FIXNUM_P(value)
@@ -1080,7 +1094,7 @@ NIL_P(value)
void Check_Type(VALUE value, int type)
void Check_SafeStr(VALUE value)
-** Ѵ
+** 型変換
FIX2INT(value), INT2FIX(i)
FIX2LONG(value), LONG2FIX(l)
@@ -1100,105 +1114,105 @@ StringValuePtr(value)
StringValueCStr(value)
rb_str_new2(s)
-** 饹/⥸塼
+** クラス/モジュール定義
VALUE rb_define_class(const char *name, VALUE super)
- superΥ֥饹ȤƿRuby饹롥
+ superのサブクラスとして新しいRubyクラスを定義する.
VALUE rb_define_class_under(VALUE module, const char *name, VALUE super)
- superΥ֥饹ȤƿRuby饹module
- Ȥ롥
+ superのサブクラスとして新しいRubyクラスを定義し,moduleの
+ 定数として定義する.
VALUE rb_define_module(const char *name)
- Ruby⥸塼롥
+ 新しいRubyモジュールを定義する.
VALUE rb_define_module_under(VALUE module, const char *name)
- Ruby⥸塼moduleȤ롥
+ 新しいRubyモジュールを定義し,moduleの定数として定義する.
void rb_include_module(VALUE klass, VALUE module)
- ⥸塼򥤥󥯥롼ɤ롥classǤmodule򥤥
- 롼ɤƤˤϲ⤷ʤ(¿ť󥯥롼ɤζػ)
+ モジュールをインクルードする.classがすでにmoduleをインク
+ ルードしている時には何もしない(多重インクルードの禁止).
void rb_extend_object(VALUE object, VALUE module)
- ֥Ȥ⥸塼(Ƥ᥽å)dzĥ롥
+ オブジェクトをモジュール(で定義されているメソッド)で拡張する.
-** ѿ
+** 大域変数定義
void rb_define_variable(const char *name, VALUE *var)
- RubyCȤǶͭ륰Хѿ롥ѿ̾`$'
- ϤޤʤˤϼưŪɲä롥nameȤRubyμ̻
- ȤƵʤʸ(㤨` ')ޤˤRubyץ
- फϸʤʤ롥
+ RubyとCとで共有するグローバル変数を定義する.変数名が`$'で
+ 始まらない時には自動的に追加される.nameとしてRubyの識別子
+ として許されない文字(例えば` ')を含む場合にはRubyプログラ
+ ムからは見えなくなる.
void rb_define_readonly_variable(const char *name, VALUE *var)
- RubyCȤǶͭread onlyΥХѿ롥
- read onlyǤ뤳Ȱʳrb_define_variable()Ʊ
+ RubyとCとで共有するread onlyのグローバル変数を定義する.
+ read onlyであること以外はrb_define_variable()と同じ.
void rb_define_virtual_variable(const char *name,
VALUE (*getter)(), void (*setter)())
- ؿˤäƼ¸Rubyѿ롥ѿȤ줿
- ˤgetterѿͤåȤ줿ˤsetterƤФ
- 롥
+ 関数によって実現されるRuby変数を定義する.変数が参照された
+ 時にはgetterが,変数に値がセットされた時にはsetterが呼ばれ
+ る.
void rb_define_hooked_variable(const char *name, VALUE *var,
VALUE (*getter)(), void (*setter)())
- ؿˤähookΤĤ줿Хѿ롥ѿ
- Ȥ줿ˤgetterؿͤåȤ줿ˤ
- setterƤФ롥gettersetter0ꤷˤhook
- ꤷʤΤƱˤʤ롥
+ 関数によってhookのつけられたグローバル変数を定義する.変数
+ が参照された時にはgetterが,関数に値がセットされた時には
+ setterが呼ばれる.getterやsetterに0を指定した時にはhookを
+ 指定しないのと同じ事になる.
void rb_global_variable(VALUE *var)
- GCΤᡤRubyץफϥʤ, Ruby
- Ȥޤѿޡ롥
+ GCのため,Rubyプログラムからはアクセスされないが, Rubyオブ
+ ジェクトを含む大域変数をマークする.
-**
+** 定数
void rb_define_const(VALUE klass, const char *name, VALUE val)
- 롥
+ 定数を定義する.
void rb_define_global_const(const char *name, VALUE val)
- 롥
+ 大域定数を定義する.
rb_define_const(rb_cObject, name, val)
- Ʊ̣
+ と同じ意味.
-** ᥽å
+** メソッド定義
rb_define_method(VALUE klass, const char *name, VALUE (*func)(), int argc)
- ᥽åɤ롥argcselfοargc-1λ,
- ؿˤϰο(selfޤޤʤ)1, 2
- ȤͿ(3self)argc-2λ,
- 1self, 2args(argsϰޤRuby)
- Ϳ롥
-
+ メソッドを定義する.argcはselfを除く引数の数.argcが-1の時,
+ 関数には引数の数(selfを含まない)を第1引数, 引数の配列を第2
+ 引数とする形式で与えられる(第3引数はself).argcが-2の時,
+ 第1引数がself, 第2引数がargs(argsは引数を含むRubyの配列)と
+ いう形式で与えられる.
+
rb_define_private_method(VALUE klass, const char *name, VALUE (*func)(), int argc)
- private᥽åɤ롥rb_define_method()Ʊ
+ privateメソッドを定義する.引数はrb_define_method()と同じ.
rb_define_singleton_method(VALUE klass, const char *name, VALUE (*func)(), int argc)
- ðۥ᥽åɤ롥rb_define_method()Ʊ
+ 特異メソッドを定義する.引数はrb_define_method()と同じ.
rb_scan_args(int argc, VALUE *argv, const char *fmt, ...)
- argc, argvͿ줿ꤵ줿եޥåȤ˽äư
- ʬ򤷡³VALUEؤλȤ˥åȤޤΥեޥ
- ȤϡABNFǵҤȰʲ̤Ǥ
+ argc, argv形式で与えられた指定されたフォーマットに従って引
+ 数を分解し,続くVALUEへの参照にセットします.このフォーマッ
+ トは,ABNFで記述すると以下の通りです.
--
scan-arg-spec := param-arg-spec [option-hash-arg-spec] [block-arg-spec]
@@ -1210,186 +1224,198 @@ pre-opt-post-arg-spec := num-of-leading-mandatory-args num-of-optional-args num-
option-hash-arg-spec := sym-for-option-hash-arg
block-arg-spec := sym-for-block-arg
-num-of-leading-mandatory-args := DIGIT ; Ƭ֤άǽʰο
-num-of-optional-args := DIGIT ; ³֤άǽʰο
-sym-for-variable-length-args := "*" ; ³֤Ĺ
- ; RubyǼ뤿λ
-num-of-trailing-mandatory-args := DIGIT ; ü֤άǽʰο
-sym-for-option-hash-arg := ":" ; ץϥå
- ; λ; άǽʰ
- ; ¿ΰꤵ졤
- ; Ǹΰϥåʤޤ
- ; #to_hashѴǽˤξ
- ; 롥Ǹΰnil
- ; 硤Ĺ꤬ʤ
- ; άǽο¿
- ; ꤵ줿˼
-sym-for-block-arg := "&" ; ƥ졼֥å뤿
- ;
+num-of-leading-mandatory-args := DIGIT ; 先頭に置かれる省略不能な引数の数
+num-of-optional-args := DIGIT ; 続いて置かれる省略可能な引数の数
+sym-for-variable-length-args := "*" ; 続いて置かれる可変長引数を
+ ; Rubyの配列で取得するための指定
+num-of-trailing-mandatory-args := DIGIT ; 終端に置かれる省略不能な引数の数
+sym-for-option-hash-arg := ":" ; オプションハッシュを取得する
+ ; ための指定; 省略不能な引数の
+ ; 数よりも多くの引数が指定され,
+ ; 最後の引数がハッシュ(または
+ ; #to_hashで変換可能)の場合に
+ ; 取得される.最後の引数がnilの
+ ; 場合,可変長引数指定がなく,
+ ; 省略不能引数の数よりも多くの
+ ; 引数が指定された場合に取得される
+sym-for-block-arg := "&" ; イテレータブロックを取得するための
+ ; 指定
--
- եޥåȤ"12"ξ硤Ϻ1Ĥǡ3(1+2)ޤǵ
- Ȥ̣ˤʤޤäơեޥåʸ³
- 3ĤVALUEؤλȤ֤ɬפޤˤϼ
- ѿåȤޤѿؤλȤNULLꤹ
- ȤǤξϼͤϼΤƤޤʤ
- άǽά줿ѿͤnil(CΥ٥Ǥ
- Qnil)ˤʤޤ
+ フォーマットが"12"の場合,引数は最低1つで,3つ(1+2)まで許さ
+ れるという意味になります.従って,フォーマット文字列に続い
+ て3つのVALUEへの参照を置く必要があります.それらには取得した
+ 変数がセットされます.変数への参照の代わりにNULLを指定する
+ こともでき,その場合は取得した引数の値は捨てられます.なお,
+ 省略可能引数が省略された時の変数の値はnil(C言語のレベルでは
+ Qnil)になります.
- ֤ͤͿ줿οǤץϥå太ӥ
- ƥ졼֥åϿޤ
+ 返り値は与えられた引数の数です.オプションハッシュおよびイ
+ テレータブロックは数えません.
-** Ruby᥽åɸƤӽФ
+** Rubyメソッド呼び出し
VALUE rb_funcall(VALUE recv, ID mid, int narg, ...)
- ᥽åɸƤӽФʸ󤫤mid뤿ˤrb_intern()
- Ȥ
+ メソッド呼び出し.文字列からmidを得るためにはrb_intern()を
+ 使う.
VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv)
- ᥽åɸƤӽФargc, argvϤ
+ メソッド呼び出し.引数をargc, argv形式で渡す.
VALUE rb_eval_string(const char *str)
- ʸRubyץȤȤƥѥ롦¹Ԥ롥
+ 文字列をRubyスクリプトとしてコンパイル・実行する.
ID rb_intern(const char *name)
- ʸбID֤
+ 文字列に対応するIDを返す.
char *rb_id2name(ID id)
- IDбʸ֤(ǥХå)
+ IDに対応する文字列を返す(デバッグ用).
char *rb_class2name(VALUE klass)
- 饹֤̾(ǥХå)饹̾ʤ
- , ̤ä̾ĥ饹֤̾
+ クラスの名前を返す(デバッグ用).クラスが名前を持たない時に
+ は, 祖先を遡って名前を持つクラスの名前を返す.
int rb_respond_to(VALUE obj, ID id)
- objidǼ᥽åɤĤɤ֤
+ objがidで示されるメソッドを持つかどうかを返す.
-** 󥹥ѿ
+** インスタンス変数
VALUE rb_iv_get(VALUE obj, const char *name)
- objΥ󥹥ѿͤ롥`@'ǻϤޤʤ󥹥
- ѿ Rubyץफ饢Ǥʤֱ줿ץ
- ѿˤʤ롥ʸ̾ĥ饹(ޤ
- ⥸塼)Υ󥹥ѿȤƼƤ롥
+ objのインスタンス変数の値を得る.`@'で始まらないインスタン
+ ス変数は Rubyプログラムからアクセスできない「隠れた」イン
+ スタンス変数になる.定数は大文字の名前を持つクラス(または
+ モジュール)のインスタンス変数として実装されている.
VALUE rb_iv_set(VALUE obj, const char *name, VALUE val)
- objΥ󥹥ѿval˥åȤ롥
+ objのインスタンス変数をvalにセットする.
-** 湽¤
+** 制御構造
VALUE rb_block_call(VALUE obj, ID mid, int argc, VALUE * argv,
VALUE (*func) (ANYARGS), VALUE data2)
- func֥åȤꤷobj쥷Сargcargv
- Ȥmid᥽åɤƤӽФfuncyield줿͡
- data2롥ʣͤyield줿(CǤ
- rb_yield_values()rb_yield_values2(), rb_yield_splat())
- data2ArrayȤƥѥåƤ롥軰, Ͱargc
- argvˤäyield줿ͤФȤǤ롥
+ funcをブロックとして設定し,objをレシーバ,argcとargvを引数
+ としてmidメソッドを呼び出す.funcは第一引数にyieldされた値,
+ 第二引数にdata2を受け取る.複数の値がyieldされた場合(Cでは
+ rb_yield_values()とrb_yield_values2(), rb_yield_splat()),
+ data2はArrayとしてパックされている.第三, 第四引数のargcと
+ argvによってyieldされた値を取り出すことができる.
[OBSOLETE] VALUE rb_iterate(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2)
- func2֥åȤꤷ, func1򥤥ƥ졼ȤƸƤ֡
- func1ˤ arg1ȤϤ, func2ˤ1˥ƥ졼
- Ϳ줿, 2arg2Ϥ롥
-
- 1.9rb_iterateȤ, func1Ruby٥Υ᥽å
- ƤӽФʤФʤʤ.
- 1.9obsoleteȤʤä. rb_block_callѰդ줿.
+ func2をブロックとして設定し, func1をイテレータとして呼ぶ.
+ func1には arg1が引数として渡され, func2には第1引数にイテレー
+ タから与えられた値, 第2引数にarg2が渡される.
+
+ 1.9でrb_iterateを使う場合は, func1の中でRubyレベルのメソッド
+ を呼び出さなければならない.
+ 1.9でobsoleteとなった. 代わりにrb_block_callが用意された.
VALUE rb_yield(VALUE val)
- valͤȤƥƥ졼֥åƤӽФ
+ valを値としてイテレータブロックを呼び出す.
VALUE rb_rescue(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2)
- ؿfunc1arg1˸ƤӽФfunc1μ¹㳰ȯ
- ˤ func2arg2ȤƸƤ֡ͤ㳰ȯ
- ʤäfunc1, 㳰ȯˤfunc2
- ͤǤ롥
+ 関数func1をarg1を引数に呼び出す.func1の実行中に例外が発生
+ した時には func2をarg2を引数として呼ぶ.戻り値は例外が発生
+ しなかった時はfunc1の戻り値, 例外が発生した時にはfunc2の戻
+ り値である.
VALUE rb_ensure(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2)
- ؿfunc1arg1ȤƼ¹Ԥ, ¹Խλ(Ȥ㳰
- ȯƤ) func2arg2ȤƼ¹Ԥ롥ͤfunc1
- ͤǤ(㳰ȯʤ)
+ 関数func1をarg1を引数として実行し, 実行終了後(たとえ例外が
+ 発生しても) func2をarg2を引数として実行する.戻り値はfunc1
+ の戻り値である(例外が発生した時は戻らない).
VALUE rb_protect(VALUE (*func) (VALUE), VALUE arg, int *state)
- ؿfuncargȤƼ¹Ԥ, 㳰ȯʤФ
- ֤ͤ㳰ȯ, *state0򥻥åȤ
- Qnil֤
+ 関数funcをargを引数として実行し, 例外が発生しなければその戻
+ り値を返す.例外が発生した場合は, *stateに非0をセットして
+ Qnilを返す.
+ rb_jump_tag()を呼ばずに捕捉した例外を無視する場合には,
+ rb_set_errinfo(Qnil)でエラー情報をクリアしなければならない.
void rb_jump_tag(int state)
- rb_protect()rb_eval_string_protect()ª줿㳰
- 롥stateϤδؿ֤줿ͤǤʤФʤʤ
- δؿľܤθƤӽФʤ
+ rb_protect()やrb_eval_string_protect()で捕捉された例外を再
+ 送する.stateはそれらの関数から返された値でなければならない.
+ この関数は直接の呼び出し元に戻らない.
+
+void rb_iter_break()
+
+ 現在の最も内側のブロックを終了する.この関数は直接の呼び出
+ し元に戻らない.
+
+void rb_iter_break_value(VALUE value)
+
+ 現在の最も内側のブロックをvalueで終了する.ブロックは引数で
+ 与えられたvalueを返す.この関数は直接の呼び出し元に戻らない.
-** 㳰顼
+** 例外・エラー
void rb_warning(const char *fmt, ...)
- rb_verboseɸ२顼Ϥ˷ٹɽ롥
- printf()Ʊ
+ rb_verbose時に標準エラー出力に警告情報を表示する.引数は
+ printf()と同じ.
void rb_raise(rb_eRuntimeError, const char *fmt, ...)
- RuntimeError㳰ȯ롥printf()Ʊ
+ RuntimeError例外を発生させる.引数はprintf()と同じ.
void rb_raise(VALUE exception, const char *fmt, ...)
- exceptionǻꤷ㳰ȯ롥fmtʲΰ
- printf()Ʊ
+ exceptionで指定した例外を発生させる.fmt以下の引数は
+ printf()と同じ.
void rb_fatal(const char *fmt, ...)
- ̿Ū㳰ȯ롥̾㳰ϹԤʤ줺, 󥿡
- ץ꥿λ(ensureǻꤵ줿ɤϽλ
- ¹Ԥ)
+ 致命的例外を発生させる.通常の例外処理は行なわれず, インター
+ プリタが終了する(ただしensureで指定されたコードは終了前に
+ 実行される).
void rb_bug(const char *fmt, ...)
- 󥿡ץ꥿ʤɥץΥХǤȯϤΤʤ
- λƤ֡󥿡ץ꥿ϥפľ˽λ롥
- 㳰ϰڹԤʤʤ
+ インタープリタなどプログラムのバグでしか発生するはずのない
+ 状況の時呼ぶ.インタープリタはコアダンプし直ちに終了する.
+ 例外処理は一切行なわれない.
-** Rubyν¹
+** Rubyの初期化・実行
-Ruby򥢥ץꥱˤϰʲΥ󥿥ե
-Ȥ̾γĥ饤֥ˤɬפʤ
+Rubyをアプリケーションに埋め込む場合には以下のインタフェース
+を使う.通常の拡張ライブラリには必要ない.
void ruby_init()
- Ruby󥿥ץ꥿νԤʤ
+ Rubyインタプリタの初期化を行なう.
void ruby_options(int argc, char **argv)
- Ruby󥿥ץ꥿Υޥɥ饤νԤʤ
+ Rubyインタプリタのコマンドライン引数の処理を行なう.
void ruby_run()
- Ruby󥿥ץ꥿¹Ԥ롥
+ Rubyインタプリタを実行する.
void ruby_script(char *name)
- RubyΥץ̾($0)ꤹ롥
+ Rubyのスクリプト名($0)を設定する.
-** 󥿥ץ꥿Υ٥ȤΥեå
+** インタプリタのイベントのフック
void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data)
-ꤵ줿󥿥ץ꥿Υ٥ȤФեåؿɲäޤ
-eventsϰʲͤorǤʤФʤޤ:
+指定されたインタプリタのイベントに対するフック関数を追加します.
+eventsは以下の値のorでなければなりません:
RUBY_EVENT_LINE
RUBY_EVENT_CLASS
@@ -1401,167 +1427,167 @@ eventsϰʲͤorǤʤФʤޤ:
RUBY_EVENT_RAISE
RUBY_EVENT_ALL
-rb_event_hook_func_tϰʲ̤Ǥ:
+rb_event_hook_func_tの定義は以下の通りです:
typedef void (*rb_event_hook_func_t)(rb_event_t event, VALUE data,
VALUE self, ID id, VALUE klass)
-rb_add_event_hook() 3 data ϡեåؿ2
-Ϥޤ1.8ǤϸߤNODEؤΥݥ󥿤Ǥ
- RB_EVENT_HOOKS_HAVE_CALLBACK_DATA ⻲ȤƤ
+rb_add_event_hook() の第3引数 data は,フック関数の第2引数と
+して渡されます.これは1.8では現在のNODEへのポインタでした.以
+下の RB_EVENT_HOOKS_HAVE_CALLBACK_DATA も参照してください.
int rb_remove_event_hook(rb_event_hook_func_t func)
-ꤵ줿եåؿޤ
+指定されたフック関数を削除します.
-** ߴΤΥޥ
+** 互換性のためのマクロ
-APIθߴå뤿˰ʲΥޥǥեȤƤޤ
+APIの互換性をチェックするために以下のマクロがデフォルトで定義されています.
NORETURN_STYLE_NEW
- NORETURN ޥؿޥȤƤ뤳Ȥ̣롥
+ NORETURN マクロが関数型マクロとして定義されていることを意味する.
HAVE_RB_DEFINE_ALLOC_FUNC
- rb_define_alloc_func() ؿ󶡤Ƥ뤳ȡĤޤ
- allocation framework Ȥ뤳Ȥ̣롥
+ rb_define_alloc_func() 関数が提供されていること,つまり
+ allocation framework が使われることを意味する.
have_func("rb_define_alloc_func", "ruby.h")
- η̤Ʊ
+ の結果と同じ.
HAVE_RB_REG_NEW_STR
- String֥ȤRegexp֥Ȥ
- rb_reg_new_str() ؿ󶡤Ƥ뤳Ȥ̣롥
+ StringオブジェクトからRegexpオブジェクトを作る
+ rb_reg_new_str() 関数が提供されていることを意味する.
have_func("rb_reg_new_str", "ruby.h").
- η̤Ʊ
+ の結果と同じ.
HAVE_RB_IO_T
- rb_io_t 󶡤Ƥ뤳Ȥ̣롥
+ rb_io_t 型が提供されていることを意味する.
USE_SYMBOL_AS_METHOD_NAME
- ᥽å֤̾᥽åɡModule#methods, #singleton_methods
- ʤɤSymbol֤Ȥ̣롥
+ メソッド名を返すメソッド,Module#methods, #singleton_methods
+ などがSymbolを返すことを意味する.
HAVE_RUBY_*_H
- ruby.h Ƥ롥бإå󶡤Ƥ뤳
- ̣롥ȤСHAVE_RUBY_ST_H Ƥ
- ñʤ st.h ǤϤʤ ruby/st.h Ѥ롥
+ ruby.h で定義されている.対応するヘッダが提供されていること
+ を意味する.たとえば,HAVE_RUBY_ST_H が定義されている場合は
+ 単なる st.h ではなく ruby/st.h を使用する.
RB_EVENT_HOOKS_HAVE_CALLBACK_DATA
- rb_add_event_hook() եåؿϤ data 3Ȥ
- 뤳Ȥ̣롥
+ rb_add_event_hook() がフック関数に渡す data を第3引数として
+ 受け取ることを意味する.
-Appendix C. extconf.rbǻȤؿ
+Appendix C. extconf.rbで使える関数たち
-extconf.rbǤѲǽʥѥåδؿϰ
-̤Ǥ롥
+extconf.rbの中では利用可能なコンパイル条件チェックの関数は以
+下の通りである.
have_macro(macro, headers)
- إåեheader򥤥󥯥롼ɤƥޥmacro
- Ƥ뤫ɤå롥ޥƤtrue
- ֤
+ ヘッダファイルheaderをインクルードしてマクロmacroが定義さ
+ れているかどうかチェックする.マクロが定義されている時true
+ を返す.
have_library(lib, func)
- ؿfuncƤ饤֥lib¸ߤå롥
- 饤֥꤬¸ߤtrue֤
+ 関数funcを定義しているライブラリlibの存在をチェックする.
+ ライブラリが存在する時,trueを返す.
find_library(lib, func, path...)
- ؿfuncƤ饤֥lib¸ߤ -Lpath ɲ
- ʤå롥饤֥꤬դätrue֤
+ 関数funcを定義しているライブラリlibの存在を -Lpath を追加
+ しながらチェックする.ライブラリが見付かった時,trueを返す.
have_func(func, header)
- إåեheader򥤥󥯥롼ɤƴؿfunc¸ߤ
- å롥funcɸǤϥ󥯤ʤ饤֥ΤΤ
- ˤhave_libraryǤΥ饤֥åƤ
- ؿ¸ߤtrue֤
+ ヘッダファイルheaderをインクルードして関数funcの存在をチェ
+ ックする.funcが標準ではリンクされないライブラリ内のもので
+ ある時には先にhave_libraryでそのライブラリをチェックしてお
+ く事.関数が存在する時trueを返す.
have_var(var, header)
- إåեheader򥤥󥯥롼ɤѿvar¸ߤ
- 롥varɸǤϥ󥯤ʤ饤֥ΤΤǤ
- ˤhave_libraryǤΥ饤֥åƤ
- ѿ¸ߤtrue֤
+ ヘッダファイルheaderをインクルードして変数varの存在をチェッ
+ クする.varが標準ではリンクされないライブラリ内のものであ
+ る時には先にhave_libraryでそのライブラリをチェックしておく
+ 事.変数が存在する時trueを返す.
have_header(header)
- إåե¸ߤå롥إåե뤬¸ߤ
- true֤
+ ヘッダファイルの存在をチェックする.ヘッダファイルが存在す
+ る時trueを返す.
find_header(header, path...)
- إåեheader¸ߤ -Ipath ɲäʤå
- 롥إåե뤬դätrue֤
+ ヘッダファイルheaderの存在を -Ipath を追加しながらチェック
+ する.ヘッダファイルが見付かった時,trueを返す.
-have_struct_member(type, member, header)
+have_struct_member(type, member[, header[, opt]])
- إåեheader򥤥󥯥롼ɤƷtype˥member
- ¸ߤ뤫å롥typeƤơmember
- Ĥtrue֤
+ ヘッダファイルheaderをインクルードして型typeにメンバmember
+ が存在するかをチェックする.typeが定義されていて,memberを
+ 持つする時trueを返す.
have_type(type, header, opt)
- إåեheader򥤥󥯥롼ɤƷtype¸ߤ뤫
- å롥typeƤtrue֤
+ ヘッダファイルheaderをインクルードして型typeが存在するかを
+ チェックする.typeが定義されている時trueを返す.
check_sizeof(type, header)
- إåեheader򥤥󥯥롼ɤƷtypecharñ̥
- Ĵ٤롥typeƤΥ֤
- ƤʤȤnil֤
+ ヘッダファイルheaderをインクルードして型typeのchar単位サイ
+ ズを調べる.typeが定義されている時そのサイズを返す.定義さ
+ れていないときはnilを返す.
-create_makefile(target)
+create_makefile(target[, target_prefix])
- ĥ饤֥ѤMakefile롥δؿƤФʤ
- ФΥ饤֥ϥѥ뤵ʤtargetϥ⥸塼̾
- ɽ
+ 拡張ライブラリ用のMakefileを生成する.この関数を呼ばなけれ
+ ばそのライブラリはコンパイルされない.targetはモジュール名
+ を表す.
find_executable(command, path)
- ޥcommandFile::PATH_SEPARATORǶڤ줿ѥ̾
- ꥹpathõpathnilޤϾά줿ϡĶ
- ѿPATHͤѤ롥¹ԲǽʥޥɤĤä
- ϥѥޤե̾Ĥʤänil֤
+ コマンドcommandをFile::PATH_SEPARATORで区切られたパス名の
+ リストpathから探す.pathがnilまたは省略された場合は,環境
+ 変数PATHの値を使用する.実行可能なコマンドが見つかった場合
+ はパスを含むファイル名,見つからなかった場合はnilを返す.
with_config(withval[, default=nil])
- ޥɥ饤--with-<withval>ǻꤵ줿ץ
- 롥
+ コマンドライン上の--with-<withval>で指定されたオプション値
+ を得る.
enable_config(config, *defaults)
disable_config(config, *defaults)
- ޥɥ饤--enable-<config>ޤ
- --disable-<config>ǻꤵ줿ͤ롥
- --enable-<config>ꤵƤtrue
- --disable-<config>ꤵƤfalse֤
- ɤꤵƤʤϡ֥åĤǸƤӽФ
- *defaultsyield̡֥åʤʤ
- *defaults֤
+ コマンドライン上の--enable-<config>または
+ --disable-<config>で指定された真偽値を得る.
+ --enable-<config>が指定されていた場合はtrue,
+ --disable-<config>が指定されていた場合はfalseを返す.
+ どちらも指定されていない場合は,ブロックつきで呼び出されて
+ いる場合は*defaultsをyieldした結果,ブロックなしなら
+ *defaultsを返す.
dir_config(target[, default_dir])
dir_config(target[, default_include, default_lib])
- ޥɥ饤--with-<target>-dir, --with-<target>-include,
- --with-<target>-libΤ줫ǻꤵǥ쥯ȥ
- $CFLAGS $LDFLAGS ɲä롥--with-<target>-dir=/path
+ コマンドライン上の--with-<target>-dir, --with-<target>-include,
+ --with-<target>-libのいずれかで指定されるディレクトリを
+ $CFLAGS や $LDFLAGS に追加する.--with-<target>-dir=/pathは
--with-<target>-include=/path/include --with-<target>-lib=/path/lib
- Ǥ롥ɲä줿 include ǥ쥯ȥ lib ǥ
- ȥ֤ ([include_dir, lib_dir])
+ と等価である.追加された include ディレクトリと lib ディレ
+ クトリの配列を返す. ([include_dir, lib_dir])
pkg_config(pkg)
- pkg-configޥɤѥåpkgξ롥
- pkg-configμºݤΥޥ̾ϡ--with-pkg-configޥ
- 饤󥪥ץǻǽ
+ pkg-configコマンドからパッケージpkgの情報を得る.
+ pkg-configの実際のコマンド名は,--with-pkg-configコマンド
+ ラインオプションで指定可能.
/*
* Local variables:
diff --git a/README.ja b/README.ja
index dd7f67ca59..03c007af7c 100644
--- a/README.ja
+++ b/README.ja
@@ -1,185 +1,192 @@
-* RubyȤ
+= Rubyとは
-Rubyϥץ뤫ĶϤʥ֥ȻظץȸǤ
-RubyϺǽ餫ʥ֥ȻظȤ߷פƤ
-顤֥Ȼظץߥ󥰤ڤ˹Ԥ
-̾μ³Υץߥ󥰤ǽǤ
+Rubyはシンプルかつ強力なオブジェクト指向スクリプト言語です.
+Rubyは最初から純粋なオブジェクト指向言語として設計されていま
+すから,オブジェクト指向プログラミングを手軽に行う事が出来ま
+す.もちろん通常の手続き型のプログラミングも可能です.
-RubyϥƥȽطǽϤʤɤͥ졤PerlƱ餤
-Ǥ˥ץʸˡȡ㳰䥤ƥ졼ʤɤε
-ˤäơʬ䤹ץߥ󥰤ޤ
+Rubyはテキスト処理関係の能力などに優れ,Perlと同じくらい強力
+です.さらにシンプルな文法と,例外処理やイテレータなどの機構
+によって,より分かりやすいプログラミングが出来ます.
-* RubyĹ
+== Rubyの特長
- + ץʸˡ
- + ̤Υ֥Ȼظǽ(饹᥽åɥʤ)
- + üʥ֥Ȼظǽ(Mixin, ðۥ᥽åɤʤ)
- + 黻ҥС
- + 㳰ǽ
- + ƥ졼ȥ
- + ١쥯
- + ʥߥåǥ (ƥˤ)
- + ܿ⤤¿Unix-like/POSIXߴץåȥե
- ưǤʤWindows Mac OS XBeOSʤɤξǤư
- cf. http://redmine.ruby-lang.org/wiki/ruby-19/SupportedPlatformsJa
+* シンプルな文法
+* 普通のオブジェクト指向機能(クラス,メソッドコールなど)
+* 特殊なオブジェクト指向機能(Mixin, 特異メソッドなど)
+* 演算子オーバーロード
+* 例外処理機能
+* イテレータとクロージャ
+* ガーベージコレクタ
+* ダイナミックローディング (アーキテクチャによる)
+* 移植性が高い.多くのUnix-like/POSIX互換プラットフォーム上で
+ 動くだけでなく,Windows, Mac OS X,BeOSなどの上でも動く
+ cf. http://bugs.ruby-lang.org/projects/ruby-trunk/wiki/SupportedPlatformsJa
-* ˡ
+== 入手法
-** FTP
+=== FTPで
-ʲξˤƤޤ
+以下の場所においてあります.
- ftp://ftp.ruby-lang.org/pub/ruby/
+ftp://ftp.ruby-lang.org/pub/ruby/
-** Subversion
+=== Subversionで
-ȯüΥɤϼΥޥɤǼǤޤ
+開発先端のソースコードは次のコマンドで取得できます.
$ svn co http://svn.ruby-lang.org/repos/ruby/trunk/ ruby
-¾˳ȯΥ֥ΰϼΥޥɤǸޤ
+他に開発中のブランチの一覧は次のコマンドで見られます.
$ svn ls http://svn.ruby-lang.org/repos/ruby/branches/
+=== Gitで
-* ۡڡ
+SubversionのミラーをGitHubに公開しています.
+以下のコマンドでリポジトリを取得できます.
-RubyΥۡڡURL
+ $ git clone git://github.com/ruby/ruby.git
- http://www.ruby-lang.org/
+== ホームページ
+RubyのホームページのURLは
+http://www.ruby-lang.org/
-* ᡼󥰥ꥹ
+です.
-RubyΥ᡼󥰥ꥹȤޤô˾
- ruby-list-ctl@ruby-lang.org
+== メーリングリスト
-ޤʸ
+Rubyのメーリングリストがあります。参加希望の方は
+
+mailto:ruby-list-ctl@ruby-lang.org
+
+まで本文に
subscribe YourFirstName YourFamilyName
-
-Ƚ񤤤äƲ
-RubyȯԸ᡼󥰥ꥹȤ⤢ޤǤrubyΥ
-λͳĥʤɼˤĤƵƤޤ
-ô˾
+と書いて送って下さい。
+
+Ruby開発者向けメーリングリストもあります。こちらではrubyのバ
+グ、将来の仕様拡張など実装上の問題について議論されています。
+参加希望の方は
- ruby-dev-ctl@ruby-lang.org
+mailto:ruby-dev-ctl@ruby-lang.org
-ޤruby-listƱͤˡǥ᡼뤷Ƥ
+までruby-listと同様の方法でメールしてください。
-Rubyĥ⥸塼ˤĤä礦ruby-ext᡼󥰥ꥹȤ
-شطˤĤä礦ruby-math᡼󥰥ꥹȤ
-Ѹä礦ruby-talk᡼󥰥ꥹȤ⤢ޤˡ
-ϤɤƱǤ
+Ruby拡張モジュールについて話し合うruby-extメーリングリストと
+数学関係の話題について話し合うruby-mathメーリングリストと
+英語で話し合うruby-talkメーリングリストもあります。参加方法
+はどれも同じです。
-* ѥ롦󥹥ȡ
+== コンパイル・インストール
-ʲμǹԤäƤ
+以下の手順で行ってください.
- 1. ⤷configureե뤬Ĥʤ⤷
- configure.inŤ褦ʤ顢autoconf¹Ԥ
- configure
+1. もし +configure+ ファイルが見つからない、もしくは
+ +configure.in+ より古いようなら、 +autoconf+ を実行して
+ 新しく +configure+ を生成する
- 2. configure¹ԤMakefileʤɤ
+2. +configure+ を実行して +Makefile+ などを生成する
- ĶˤäƤϥǥեȤCѥѥץդ
- ޤconfigureץ optflags=.. warnflags=..
- Ǿ񤭤Ǥޤ
+ 環境によってはデフォルトのCコンパイラ用オプションが付き
+ ます. +configure+ オプションで <tt>optflags=..</tt> <tt>warnflags=..</tt> 等
+ で上書きできます.
- 3. (ɬפʤ)defines.hԽ
+3. (必要ならば)+defines.h+ を編集する
- ¿ʬɬ̵Ȼפޤ
+ 多分,必要無いと思います.
- 4. (ɬפʤ)ext/SetupŪ˥󥯤ĥ⥸塼
- ꤹ
+4. (必要ならば)+ext/Setup+ に静的にリンクする拡張モジュールを
+ 指定する
- ext/Setup˵Ҥ⥸塼Ū˥󥯤ޤ
+ +ext/Setup+ に記述したモジュールは静的にリンクされます.
- ʥߥåǥ󥰤򥵥ݡȤƤʤƥ
- ǤSetup1ܤΡoption nodynamicפȤԤΥ
- Ȥ򳰤ɬפޤޤΥƥ
- ĥ⥸塼Ѥ뤿ˤϡ餫Ū˥
- Ƥɬפޤ
+ ダイナミックローディングをサポートしていないアーキテク
+ チャでは +Setup+ の1行目の「<tt>option nodynamic</tt>」という行のコ
+ メントを外す必要があります.また,このアーキテクチャで
+ 拡張モジュールを利用するためには,あらかじめ静的にリン
+ クしておく必要があります.
- 5. make¹Ԥƥѥ뤹
+5. +make+ を実行してコンパイルする
- 6. make testǥƥȤԤ
+6. <tt>make check</tt>でテストを行う.
- test succeededפɽǤƥ
- ƤⴰݾڤƤǤϤޤ
+ 「<tt>check succeeded</tt>」と表示されれば成功です.ただしテスト
+ に成功しても完璧だと保証されている訳ではありません.
- 7. make install
+7. <tt>make install</tt>
- ʲΥǥ쥯ȥäơ˥ե򥤥󥹥ȡ
- 뤷ޤ
+ 以下のディレクトリを作って,そこにファイルをインストー
+ ルします.
- * ${DESTDIR}${prefix}/bin
- * ${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}
- * ${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}
- * ${DESTDIR}${prefix}/lib
- * ${DESTDIR}${prefix}/lib/ruby
- * ${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}
- * ${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}
- * ${DESTDIR}${prefix}/lib/ruby/site_ruby
- * ${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}
- * ${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}
- * ${DESTDIR}${prefix}/lib/ruby/vendor_ruby
- * ${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}
- * ${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}
- * ${DESTDIR}${prefix}/lib/ruby/gems/${MAJOR}.${MINOR}.${TEENY}
- * ${DESTDIR}${prefix}/share/man/man1
- * ${DESTDIR}${prefix}/share/ri/${MAJOR}.${MINOR}.${TEENY}/system
+ * <tt>${DESTDIR}${prefix}/bin</tt>
+ * <tt>${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/site_ruby</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/vendor_ruby</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/gems/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/share/man/man1</tt>
+ * <tt>${DESTDIR}${prefix}/share/ri/${MAJOR}.${MINOR}.${TEENY}/system</tt>
- RubyAPIС`x.y.z'ǤС((|${MAJOR}|))
- `x'ǡ((|${MINOR}|))`y'((|${TEENY}|))`z'Ǥ
+ RubyのAPIバージョンが'_x.y.z_'であれば,<tt>${MAJOR}</tt>は
+ '_x_'で,<tt>${MINOR}</tt>は'_y_',<tt>${TEENY}</tt>は'_z_'です.
- : APIСteenyϡRubyץΥС
- Ȥϰۤʤ뤳Ȥޤ
+ <b>注意</b>: APIバージョンの +teeny+ は,Rubyプログラムのバージョ
+ ンとは異なることがあります.
- rootǺȤɬפ뤫⤷ޤ
+ +root+ で作業する必要があるかもしれません.
-⤷ѥ˥顼ȯˤϥ顼Υȥ
-OSμޤǤܤݡȤԤäƤ
-¾Τˤʤޤ
+もし,コンパイル時にエラーが発生した場合にはエラーのログとマ
+シン,OSの種類を含むできるだけ詳しいレポートを作者に送ってく
+ださると他の方のためにもなります.
-* ܿ
+== 移植
-UNIXǤconfigureۤȤɤκۤۼƤϤ
-פ̸Ȥä(˰㤤ʤ)Ԥˤ
-ȤݡȤСǤ뤫Τޤ
+UNIXであれば +configure+ がほとんどの差異を吸収してくれるはずで
+すが,思わぬ見落としがあった場合(あるに違いない),作者にその
+ことをレポートすれば,解決できるかも知れません.
-ƥˤäȤ¸ΤGCǤRubyGCо
-Υƥ㤬setjmp()ޤgetcontext()ˤäƤΥ
-jmp_bufucontext_t˳Ǽ뤳Ȥȡjmp_buf
-ucontext_tȥå32bit饤ȤƤ뤳Ȥ
-ƤޤäԤΩʤб˺Ǥ
-ԤβŪñǡgc.cǥåޡƤ
-ʬ˥饤ȤΥХȿ餷ƥޡ륳ɤ
-ɲäǺѤߤޤdefined(__mc68000__)פdzƤ
-ʬ򻲹ͤˤƤ
+アーキテクチャにもっとも依存するのはGC部です.RubyのGCは対象
+のアーキテクチャが<tt>setjmp()</tt>または<tt>getcontext()</tt>によって全てのレ
+ジスタを +jmp_buf+ や +ucontext_t+ に格納することと, +jmp_buf+ や
++ucontext_t+ とスタックが32bitアラインメントされていることを仮定
+しています.特に前者が成立しない場合の対応は非常に困難でしょう.
+後者の解決は比較的簡単で, +gc.c+ でスタックをマークしている
+部分にアラインメントのバイト数だけずらしてマークするコードを
+追加するだけで済みます.<tt>defined(\_\_mc68000\_\_)</tt>で括られてい
+る部分を参考にしてください.
-쥸ɥCPUǤϡ쥸ɥ򥹥
-˥եå夹륢֥饳ɤɲäɬפ뤫
+レジスタウィンドウを持つCPUでは,レジスタウィンドウをスタッ
+クにフラッシュするアセンブラコードを追加する必要があるかも知
+れません.
-* ۾
+== 配布条件
-COPYING.jaե򻲾ȤƤ
++COPYING.ja+ ファイルを参照してください。
-*
+== 著者
-ȡХݡȤ¾ matz@netlab.jp ޤǡ
+コメント,バグレポートその他は mailto:matz@ruby-lang.jp まで.
-------------------------------------------------------
created at: Thu Aug 3 11:57:36 JST 1995
+--
Local variables:
-mode: indented-text
+mode: rdoc
end:
diff --git a/ToDo b/ToDo
deleted file mode 100644
index 7e5ef523a8..0000000000
--- a/ToDo
+++ /dev/null
@@ -1,124 +0,0 @@
-Language Spec.
-
-- Class#allocate - basicNew
-- class Foo::Bar<Baz .. end, module Boo::Bar .. end
-- raise exception by `` error
-- a +1 to be a+1, not a(+1).
-- clarify evaluation order of operator argument (=~, .., ...)
-- :symbol => value hash in the form of {symbol: value, ...} ??
-* operator !! for rescue. ???
-* objectify characters
-* ../... outside condition invokes operator method too.
-* ... inside condition turns off just before right condition.???
-* package or access control for global variables??
-* named arguments like foo(nation:="german") or foo(nation: "german").
-* method to retrieve argument information (needs new C API)
-* multiple return values, yield values. maybe incompatible ???
-* cascading method invocation ???
-* def Class#method .. end ??
-* def Foo::Bar::baz() .. end ??
-* I18N (or M17N) script/string/regexp
-* discourage use of symbol variables (e.g. $/, etc.) in manual
-* discourage use of Perlish features by giving warnings.
-* non confusing in-block local variable (is it possible?)
- + remove scope by block
- + variables appears within block may have independent values.
-* Regexp: make /o thread safe.
-* decide whether begin with rescue or ensure make do..while loop.
-* unify == and eql? again
-* to_i returns nil if str contains no digit.
-* jar like combined library package. -> RubyGems?
-* method combination, e.g. before, after, around, etc.
-* .. or something like defadvice in Emacs.
-* property - for methods, or for objects in general.
-* "in" modifier, to annotate, or to encourage assertion.
-* selector namespace - something like generic-flet in CLOS, to help RubyBehavior
-* private instance variable (as in Python?) @_foo in class Foo => @_Foo_foo
-* warn/error "bare word" method, like "foo", you should type "foo()"
-
-Hacking Interpreter
-
-- generational GC
-* non-blocking open (e.g. for named pipe) for thread
-* avoid blocking with gethostbyname/gethostbyaddr (use fork ???)
-* objectify interpreters ???
-* remove rb_eval() recursions
-* syntax tree -> bytecode ???
-* scrambled script, or script filter
-* setuid ruby
-* performance tune for in-block (dynamic) local variables.
-* give warnings to assign magic variables.
-* export rb_io_{addstr,printf,puts,print}
-* autoload should work with threads [ruby-talk:4589]
-* remove stdio dependency from IOs.
-* warn for inconsistent local variable usage (lv m and method m at the same time).
-* MicroRuby
-* Built-in Interactive Ruby.
-* Parser API
-* trap every method invocation, which can be enabled by e.g. trap_call :method.
-* unify Errno exceptions of same errno, or new exception comparison scheme.
-* 2.times{|i| if i==0 then a = 15 else puts eval("a") end} should print nil.
-* Thread#max_stack_size attribute (possible??)
-
-Standard Libraries
-
-- Module#define_method which takes a name and a body (block, proc or method).
-- Enume#inject
-- Array#fetch
-- IO::for_fd
-- Process::waitall [ruby-talk:4557]
-- Process::Status
-- File::lchown, File::lchmod; xxx - still need work for non existing platforms
-- move Time::times to Process.
-- Enumerable#sort_by for Schwartzian transformation
-- fork_and_kill_other_threads.
-- signal list (Signal::trap, Signal::list).
-- move NameError under StandardError.
-- Integer#to_s(base)
-- Hash::new{default}
-- hash etc. should handle self referenceing array/hash
-- Array#select(n1,n2...) works like Array#indexes(n1,n2...)
-- use Mersenne Twister RNG for random.
-- deprecate Array#indexes, and Array#indices.
-- remove dependency on MAXPATHLEN.
-- String#scanf(?)
-* Object#fmt(?)
-* Time::strptime
-* Integer[num], Float[num]; Fixnum[num]?
-* method to retrieve non-number trailer for to_i/to_f.
-* Stream or Port, abstract superclass of IO ?
-* String#{pred,prev}, String#downto
-* optional stepsize argument for succ()
-* Ruby module -- Ruby::Version, Ruby::Interpreter
-* introduce Boolean class; super of TrueClass, FalseClass
-* synchronized method - synchronized{...}, synchronized :foo, :bar
-* Array#&, Array#| to allow duplication. ???
-* way to specify immortal (fork endurance) thread;
-* or raise ForkException to every thread but fork caller.
-* new user-defined marshal scheme. _dump(dumper), _load(restorer)
-* library to load per-user profile seeking .ruby_profile or ruby.ini file.
-* warning framework (warn, warning for Ruby level)
-* marshal should not depend on sprintf (works bad with locale).
-* ternary arg pow: a.pow(b,c) == a**b%c
-* new caller(), e.g. call_stack; needs better name.
-* pointer share mechanism similar to one in String for Array.
-* require "1.6" etc. by /usr/lib/ruby/1.6/1.6.rb ;-)
-* save both "feature names" and "normalized path" in $"
-* implement Mutex_m (or MutexMixin) using Mutex.
-
-Extension Libraries
-
-* ptk.rb pTk wrapper that is compatible to tk.rb
-* Berkeley DB extension
-* BitVector
-* thread-safe fcgi
-
-Ruby Libraries
-
-- urllib.rb, nttplib.rb, etc.
-* format like perl's
-
-Tools
-
-* freeze or undump to bundle everything
-* bundle using zlib
diff --git a/addr2line.c b/addr2line.c
index 219d1d4b47..e102abba4f 100644
--- a/addr2line.c
+++ b/addr2line.c
@@ -1,6 +1,6 @@
/**********************************************************************
- addr2line.h -
+ addr2line.c -
$Author$
@@ -24,6 +24,7 @@
#include <fcntl.h>
#include <limits.h>
#include <stdio.h>
+#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
@@ -31,9 +32,26 @@
#include <sys/stat.h>
#include <unistd.h>
-#if defined(HAVE_ALLOCA_H)
-#include <alloca.h>
-#endif
+/* Make alloca work the best possible way. */
+#ifdef __GNUC__
+# ifndef atarist
+# ifndef alloca
+# define alloca __builtin_alloca
+# endif
+# endif /* atarist */
+#else
+# ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifdef _AIX
+#pragma alloca
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+void *alloca();
+# endif
+# endif /* AIX */
+# endif /* HAVE_ALLOCA_H */
+#endif /* __GNUC__ */
#ifdef HAVE_DL_ITERATE_PHDR
# ifndef _GNU_SOURCE
@@ -68,6 +86,9 @@
# define ElfW(x) Elf32##_##x
# endif
#endif
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
typedef struct {
const char *dirname;
@@ -84,7 +105,8 @@ typedef struct {
static char binary_filename[PATH_MAX];
static unsigned long
-uleb128(char **p) {
+uleb128(char **p)
+{
unsigned long r = 0;
int s = 0;
for (;;) {
@@ -100,7 +122,8 @@ uleb128(char **p) {
}
static long
-sleb128(char **p) {
+sleb128(char **p)
+{
long r = 0;
int s = 0;
for (;;) {
@@ -215,19 +238,19 @@ parse_debug_line_cu(int num_traces, void **traces,
int default_is_stmt, line_base;
unsigned int header_length, minimum_instruction_length, line_range,
opcode_base;
- unsigned char *standard_opcode_lengths;
+ /* unsigned char *standard_opcode_lengths; */
/* The registers. */
unsigned long addr = 0;
unsigned int file = 1;
unsigned int line = 1;
- unsigned int column = 0;
+ /* unsigned int column = 0; */
int is_stmt;
- int basic_block = 0;
- int end_sequence = 0;
- int prologue_end = 0;
- int epilogue_begin = 0;
- unsigned int isa = 0;
+ /* int basic_block = 0; */
+ /* int end_sequence = 0; */
+ /* int prologue_end = 0; */
+ /* int epilogue_begin = 0; */
+ /* unsigned int isa = 0; */
p = *debug_line;
@@ -263,7 +286,7 @@ parse_debug_line_cu(int num_traces, void **traces,
opcode_base = *(unsigned char *)p;
p++;
- standard_opcode_lengths = (unsigned char *)p - 1;
+ /* standard_opcode_lengths = (unsigned char *)p - 1; */
p += opcode_base - 1;
include_directories = p;
@@ -283,7 +306,7 @@ parse_debug_line_cu(int num_traces, void **traces,
do { \
fill_line(num_traces, traces, addr, file, line, \
include_directories, filenames, lines); \
- basic_block = prologue_end = epilogue_begin = 0; \
+ /*basic_block = prologue_end = epilogue_begin = 0;*/ \
} while (0)
while (p < cu_end) {
@@ -306,13 +329,13 @@ parse_debug_line_cu(int num_traces, void **traces,
file = (unsigned int)uleb128(&p);
break;
case DW_LNS_set_column:
- column = (unsigned int)uleb128(&p);
+ /*column = (unsigned int)*/(void)uleb128(&p);
break;
case DW_LNS_negate_stmt:
is_stmt = !is_stmt;
break;
case DW_LNS_set_basic_block:
- basic_block = 1;
+ /*basic_block = 1; */
break;
case DW_LNS_const_add_pc:
a = ((255 - opcode_base) / line_range) *
@@ -324,28 +347,28 @@ parse_debug_line_cu(int num_traces, void **traces,
addr += a;
break;
case DW_LNS_set_prologue_end:
- prologue_end = 1;
+ /* prologue_end = 1; */
break;
case DW_LNS_set_epilogue_begin:
- epilogue_begin = 1;
+ /* epilogue_begin = 1; */
break;
case DW_LNS_set_isa:
- isa = (unsigned int)uleb128(&p);
+ /* isa = (unsigned int)*/(void)uleb128(&p);
break;
case 0:
a = *(unsigned char *)p++;
op = *p++;
switch (op) {
case DW_LNE_end_sequence:
- end_sequence = 1;
+ /* end_sequence = 1; */
FILL_LINE();
addr = 0;
file = 1;
line = 1;
- column = 0;
+ /* column = 0; */
is_stmt = default_is_stmt;
- end_sequence = 0;
- isa = 0;
+ /* end_sequence = 0; */
+ /* isa = 0; */
break;
case DW_LNE_set_address:
addr = *(unsigned long *)p;
@@ -453,9 +476,16 @@ fill_lines(int num_traces, void **traces, char **syms, int check_debuglink,
fprintf(stderr, "lseek: %s\n", strerror(e));
return;
}
+#if SIZEOF_OFF_T > SIZEOF_SIZE_T
+ if (filesize > (off_t)SIZE_MAX) {
+ close(fd);
+ fprintf(stderr, "Too large file %s\n", binary_filename);
+ return;
+ }
+#endif
lseek(fd, 0, SEEK_SET);
/* async-signal unsafe */
- file = (char *)mmap(NULL, filesize, PROT_READ, MAP_SHARED, fd, 0);
+ file = (char *)mmap(NULL, (size_t)filesize, PROT_READ, MAP_SHARED, fd, 0);
if (file == MAP_FAILED) {
int e = errno;
close(fd);
@@ -465,7 +495,7 @@ fill_lines(int num_traces, void **traces, char **syms, int check_debuglink,
current_line->fd = fd;
current_line->mapped = file;
- current_line->mapped_size = filesize;
+ current_line->mapped_size = (size_t)filesize;
for (i = 0; i < num_traces; i++) {
const char *path;
diff --git a/array.c b/array.c
index 7360a68e68..2454b99d76 100644
--- a/array.c
+++ b/array.c
@@ -16,6 +16,7 @@
#include "ruby/st.h"
#include "ruby/encoding.h"
#include "internal.h"
+#include "probes.h"
#ifndef ARRAY_DEBUG
# define NDEBUG
@@ -26,7 +27,7 @@
VALUE rb_cArray;
-static ID id_cmp;
+static ID id_cmp, id_div, id_power;
#define ARY_DEFAULT_SIZE 16
#define ARY_MAX_SIZE (LONG_MAX / (int)sizeof(VALUE))
@@ -255,15 +256,24 @@ rb_ary_modify(VALUE ary)
rb_ary_modify_check(ary);
if (ARY_SHARED_P(ary)) {
long len = RARRAY_LEN(ary);
+ VALUE shared = ARY_SHARED(ary);
if (len <= RARRAY_EMBED_LEN_MAX) {
VALUE *ptr = ARY_HEAP_PTR(ary);
- VALUE shared = ARY_SHARED(ary);
FL_UNSET_SHARED(ary);
FL_SET_EMBED(ary);
MEMCPY(ARY_EMBED_PTR(ary), ptr, VALUE, len);
rb_ary_decrement_share(shared);
ARY_SET_EMBED_LEN(ary, len);
}
+ else if (ARY_SHARED_NUM(shared) == 1 && len > (RARRAY_LEN(shared)>>1)) {
+ long shift = RARRAY_PTR(ary) - RARRAY_PTR(shared);
+ ARY_SET_PTR(ary, RARRAY_PTR(shared));
+ ARY_SET_CAPA(ary, RARRAY_LEN(shared));
+ MEMMOVE(RARRAY_PTR(ary), RARRAY_PTR(ary)+shift, VALUE, len);
+ FL_UNSET_SHARED(ary);
+ FL_SET_EMBED(shared);
+ rb_ary_decrement_share(shared);
+ }
else {
VALUE *ptr = ALLOC_N(VALUE, len);
MEMCPY(ptr, RARRAY_PTR(ary), VALUE, len);
@@ -274,6 +284,48 @@ rb_ary_modify(VALUE ary)
}
}
+static void
+ary_ensure_room_for_push(VALUE ary, long add_len)
+{
+ long new_len = RARRAY_LEN(ary) + add_len;
+ long capa;
+
+ if (ARY_SHARED_P(ary)) {
+ if (new_len > RARRAY_EMBED_LEN_MAX) {
+ VALUE shared = ARY_SHARED(ary);
+ if (ARY_SHARED_NUM(shared) == 1) {
+ if (RARRAY_PTR(ary) - RARRAY_PTR(shared) + new_len <= RARRAY_LEN(shared)) {
+ rb_ary_modify_check(ary);
+ }
+ else {
+ /* if array is shared, than it is likely it participate in push/shift pattern */
+ rb_ary_modify(ary);
+ capa = ARY_CAPA(ary);
+ if (new_len > capa - (capa >> 6)) {
+ ary_double_capa(ary, new_len);
+ }
+ }
+ return;
+ }
+ }
+ }
+ rb_ary_modify(ary);
+ capa = ARY_CAPA(ary);
+ if (new_len > capa) {
+ ary_double_capa(ary, new_len);
+ }
+}
+
+/*
+ * call-seq:
+ * ary.freeze -> ary
+ *
+ * Calls Object#freeze on +ary+ to prevent any further
+ * modification. A RuntimeError will be raised if a modification
+ * attempt is made.
+ *
+ */
+
VALUE
rb_ary_freeze(VALUE ary)
{
@@ -284,8 +336,8 @@ rb_ary_freeze(VALUE ary)
* call-seq:
* ary.frozen? -> true or false
*
- * Return <code>true</code> if this array is frozen (or temporarily frozen
- * while being sorted).
+ * Return +true+ if this array is frozen (or temporarily frozen
+ * while being sorted). See also Object#frozen?
*/
static VALUE
@@ -295,11 +347,29 @@ rb_ary_frozen_p(VALUE ary)
return Qfalse;
}
+/* This can be used to take a snapshot of an array (with
+ e.g. rb_ary_replace) and check later whether the array has been
+ modified from the snapshot. The snapshot is cheap, though if
+ something does modify the array it will pay the cost of copying
+ it. If Array#pop or Array#shift has been called, the array will
+ be still shared with the snapshot, but the array length will
+ differ. */
+VALUE
+rb_ary_shared_with_p(VALUE ary1, VALUE ary2)
+{
+ if (!ARY_EMBED_P(ary1) && ARY_SHARED_P(ary1) &&
+ !ARY_EMBED_P(ary2) && ARY_SHARED_P(ary2) &&
+ RARRAY(ary1)->as.heap.aux.shared == RARRAY(ary2)->as.heap.aux.shared &&
+ RARRAY(ary1)->as.heap.len == RARRAY(ary2)->as.heap.len) {
+ return Qtrue;
+ }
+ return Qfalse;
+}
+
static VALUE
ary_alloc(VALUE klass)
{
- NEWOBJ(ary, struct RArray);
- OBJSETUP(ary, klass, T_ARRAY);
+ NEWOBJ_OF(ary, struct RArray, klass, T_ARRAY);
FL_SET_EMBED((VALUE)ary);
ARY_SET_EMBED_LEN((VALUE)ary, 0);
@@ -307,6 +377,16 @@ ary_alloc(VALUE klass)
}
static VALUE
+empty_ary_alloc(VALUE klass)
+{
+ if(RUBY_DTRACE_ARRAY_CREATE_ENABLED()) {
+ RUBY_DTRACE_ARRAY_CREATE(0, rb_sourcefile(), rb_sourceline());
+ }
+
+ return ary_alloc(klass);
+}
+
+static VALUE
ary_new(VALUE klass, long capa)
{
VALUE ary;
@@ -317,6 +397,11 @@ ary_new(VALUE klass, long capa)
if (capa > ARY_MAX_SIZE) {
rb_raise(rb_eArgError, "array size too big");
}
+
+ if(RUBY_DTRACE_ARRAY_CREATE_ENABLED()) {
+ RUBY_DTRACE_ARRAY_CREATE(capa, rb_sourcefile(), rb_sourceline());
+ }
+
ary = ary_alloc(klass);
if (capa > RARRAY_EMBED_LEN_MAX) {
FL_UNSET_EMBED(ary);
@@ -426,12 +511,12 @@ ary_make_shared(VALUE ary)
return ary;
}
else {
- NEWOBJ(shared, struct RArray);
- OBJSETUP(shared, 0, T_ARRAY);
+ NEWOBJ_OF(shared, struct RArray, 0, T_ARRAY);
FL_UNSET_EMBED(shared);
- ARY_SET_LEN((VALUE)shared, RARRAY_LEN(ary));
+ ARY_SET_LEN((VALUE)shared, ARY_CAPA(ary));
ARY_SET_PTR((VALUE)shared, RARRAY_PTR(ary));
+ rb_mem_clear(RARRAY_PTR(shared) + RARRAY_LEN(ary), ARY_CAPA(ary) - RARRAY_LEN(ary));
FL_SET_SHARED_ROOT(shared);
ARY_SET_SHARED_NUM((VALUE)shared, 1);
FL_SET_SHARED(ary);
@@ -478,10 +563,9 @@ rb_check_array_type(VALUE ary)
* call-seq:
* Array.try_convert(obj) -> array or nil
*
- * Try to convert <i>obj</i> into an array, using +to_ary+ method.
- * Returns converted array or +nil+ if <i>obj</i> cannot be converted
- * for any reason. This method can be used to check if an argument is an
- * array.
+ * Tries to convert +obj+ into an array, using +to_ary+ method. Returns the
+ * converted array or +nil+ if +obj+ cannot be converted for any reason.
+ * This method can be used to check if an argument is an array.
*
* Array.try_convert([1]) #=> [1]
* Array.try_convert("1") #=> nil
@@ -506,36 +590,54 @@ rb_ary_s_try_convert(VALUE dummy, VALUE ary)
* Array.new(array)
* Array.new(size) {|index| block }
*
- * Returns a new array. In the first form, the new array is
- * empty. In the second it is created with _size_ copies of _obj_
- * (that is, _size_ references to the same
- * _obj_). The third form creates a copy of the array
- * passed as a parameter (the array is generated by calling
- * to_ary on the parameter). In the last form, an array
- * of the given size is created. Each element in this array is
- * calculated by passing the element's index to the given block and
- * storing the return value.
- *
- * Array.new
- * Array.new(2)
- * Array.new(5, "A")
- *
- * # only one copy of the object is created
+ * Returns a new array.
+ *
+ * In the first form, if no arguments are sent, the new array will be empty.
+ * When a +size+ and an optional +obj+ are sent, an array is created with
+ * +size+ copies of +obj+. Take notice that all elements will reference the
+ * same object +obj+.
+ *
+ * The second form creates a copy of the array passed as a parameter (the
+ * array is generated by calling to_ary on the parameter).
+ *
+ * first_array = ["Matz", "Guido"]
+ *
+ * second_array = Array.new(first_array) #=> ["Matz", "Guido"]
+ *
+ * first_array.equal? second_array #=> false
+ *
+ * In the last form, an array of the given size is created. Each element in
+ * this array is created by passing the element's index to the given block
+ * and storing the return value.
+ *
+ * Array.new(3){ |index| index ** 2 }
+ * # => [0, 1, 4]
+ *
+ * == Common gotchas
+ *
+ * When sending the second parameter, the same object will be used as the
+ * value for all the array elements:
+ *
* a = Array.new(2, Hash.new)
+ * # => [{}, {}]
+ *
* a[0]['cat'] = 'feline'
- * a
+ * a # => [{"cat"=>"feline"}, {"cat"=>"feline"}]
+ *
* a[1]['cat'] = 'Felix'
- * a
+ * a # => [{"cat"=>"Felix"}, {"cat"=>"Felix"}]
+ *
+ * Since all the Array elements store the same hash, changes to one of them
+ * will affect them all.
+ *
+ * If multiple copies are what you want, you should use the block
+ * version which uses the result of that block each time an element
+ * of the array needs to be initialized:
*
- * # here multiple copies are created
* a = Array.new(2) { Hash.new }
* a[0]['cat'] = 'feline'
- * a
+ * a # => [{"cat"=>"feline"}, {}]
*
- * squares = Array.new(5) {|i| i*i}
- * squares
- *
- * copy = Array.new(squares)
*/
static VALUE
@@ -593,14 +695,13 @@ rb_ary_initialize(int argc, VALUE *argv, VALUE ary)
return ary;
}
-
/*
-* Returns a new array populated with the given objects.
-*
-* Array.[]( 1, 'a', /^A/ )
-* Array[ 1, 'a', /^A/ ]
-* [ 1, 'a', /^A/ ]
-*/
+ * Returns a new array populated with the given objects.
+ *
+ * Array.[]( 1, 'a', /^A/ ) # => [1, "a", /^A/]
+ * Array[ 1, 'a', /^A/ ] # => [1, "a", /^A/]
+ * [ 1, 'a', /^A/ ] # => [1, "a", /^A/]
+ */
static VALUE
rb_ary_s_create(int argc, VALUE *argv, VALUE klass)
@@ -704,8 +805,6 @@ ary_take_first_or_last(int argc, VALUE *argv, VALUE ary, enum ary_take_pos_flags
return ary_make_partial(ary, rb_cArray, offset, n);
}
-static VALUE rb_ary_push_1(VALUE ary, VALUE item);
-
/*
* call-seq:
* ary << obj -> ary
@@ -722,8 +821,12 @@ static VALUE rb_ary_push_1(VALUE ary, VALUE item);
VALUE
rb_ary_push(VALUE ary, VALUE item)
{
- rb_ary_modify(ary);
- return rb_ary_push_1(ary, item);
+ long idx = RARRAY_LEN(ary);
+
+ ary_ensure_room_for_push(ary, 1);
+ RARRAY_PTR(ary)[idx] = item;
+ ARY_SET_LEN(ary, idx + 1);
+ return ary;
}
static VALUE
@@ -739,27 +842,37 @@ rb_ary_push_1(VALUE ary, VALUE item)
return ary;
}
+VALUE
+rb_ary_cat(VALUE ary, const VALUE *ptr, long len)
+{
+ long oldlen = RARRAY_LEN(ary);
+
+ ary_ensure_room_for_push(ary, len);
+ MEMCPY(RARRAY_PTR(ary) + oldlen, ptr, VALUE, len);
+ ARY_SET_LEN(ary, oldlen + len);
+ return ary;
+}
+
/*
* call-seq:
* ary.push(obj, ... ) -> ary
*
- * Append---Pushes the given object(s) on to the end of this array. This
+ * Append --- Pushes the given object(s) on to the end of this array. This
* expression returns the array itself, so several appends
- * may be chained together.
+ * may be chained together. See also Array#pop for the opposite
+ * effect.
*
* a = [ "a", "b", "c" ]
* a.push("d", "e", "f")
* #=> ["a", "b", "c", "d", "e", "f"]
+ * [1, 2, 3,].push(4).push(5)
+ * #=> [1, 2, 3, 4, 5]
*/
static VALUE
rb_ary_push_m(int argc, VALUE *argv, VALUE ary)
{
- rb_ary_modify(ary);
- while (argc--) {
- rb_ary_push_1(ary, *argv++);
- }
- return ary;
+ return rb_ary_cat(ary, argv, argc);
}
VALUE
@@ -785,10 +898,11 @@ rb_ary_pop(VALUE ary)
* ary.pop(n) -> new_ary
*
* Removes the last element from +self+ and returns it, or
- * <code>nil</code> if the array is empty.
+ * +nil+ if the array is empty.
*
- * If a number _n_ is given, returns an array of the last n elements
- * (or less) just like <code>array.slice!(-n, n)</code> does.
+ * If a number +n+ is given, returns an array of the last +n+ elements
+ * (or less) just like <code>array.slice!(-n, n)</code> does. See also
+ * Array#push for the opposite effect.
*
* a = [ "a", "b", "c", "d" ]
* a.pop #=> "d"
@@ -844,12 +958,14 @@ rb_ary_shift(VALUE ary)
* ary.shift -> obj or nil
* ary.shift(n) -> new_ary
*
- * Returns the first element of +self+ and removes it (shifting all
- * other elements down by one). Returns <code>nil</code> if the array
+ * Removes the first element of +self+ and returns it (shifting all
+ * other elements down by one). Returns +nil+ if the array
* is empty.
*
- * If a number _n_ is given, returns an array of the first n elements
- * (or less) just like <code>array.slice!(0, n)</code> does.
+ * If a number +n+ is given, returns an array of the first +n+ elements
+ * (or less) just like <code>array.slice!(0, n)</code> does. With +ary+
+ * containing only the remainder elements, not including what was shifted to
+ * +new_ary+. See also Array#unshift for the opposite effect.
*
* args = [ "-m", "-q", "filename" ]
* args.shift #=> "-m"
@@ -887,12 +1003,61 @@ rb_ary_shift_m(int argc, VALUE *argv, VALUE ary)
return result;
}
+static void
+ary_ensure_room_for_unshift(VALUE ary, int argc)
+{
+ long len = RARRAY_LEN(ary);
+ long new_len = len + argc;
+ long capa;
+ VALUE *head, *sharedp;
+
+ if (ARY_SHARED_P(ary)) {
+ VALUE shared = ARY_SHARED(ary);
+ capa = RARRAY_LEN(shared);
+ if (ARY_SHARED_NUM(shared) == 1 && capa > new_len) {
+ head = RARRAY_PTR(ary);
+ sharedp = RARRAY_PTR(shared);
+ goto makeroom_if_need;
+ }
+ }
+
+ rb_ary_modify(ary);
+ capa = ARY_CAPA(ary);
+ if (capa - (capa >> 6) <= new_len) {
+ ary_double_capa(ary, new_len);
+ }
+
+ /* use shared array for big "queues" */
+ if (new_len > ARY_DEFAULT_SIZE * 4) {
+ /* make a room for unshifted items */
+ capa = ARY_CAPA(ary);
+ ary_make_shared(ary);
+
+ head = sharedp = RARRAY_PTR(ary);
+ goto makeroom;
+ makeroom_if_need:
+ if (head - sharedp < argc) {
+ long room;
+ makeroom:
+ room = capa - new_len;
+ room -= room >> 4;
+ MEMMOVE(sharedp + argc + room, head, VALUE, len);
+ head = sharedp + argc + room;
+ }
+ ARY_SET_PTR(ary, head - argc);
+ }
+ else {
+ /* sliding items */
+ MEMMOVE(RARRAY_PTR(ary) + argc, RARRAY_PTR(ary), VALUE, len);
+ }
+}
+
/*
* call-seq:
* ary.unshift(obj, ...) -> ary
*
- * Prepends objects to the front of +self+,
- * moving other elements upwards.
+ * Prepends objects to the front of +self+, moving other elements upwards.
+ * See also Array#shift for the opposite effect.
*
* a = [ "b", "c", "d" ]
* a.unshift("a") #=> ["a", "b", "c", "d"]
@@ -902,19 +1067,16 @@ rb_ary_shift_m(int argc, VALUE *argv, VALUE ary)
static VALUE
rb_ary_unshift_m(int argc, VALUE *argv, VALUE ary)
{
- long len;
+ long len = RARRAY_LEN(ary);
- rb_ary_modify(ary);
- if (argc == 0) return ary;
- if (ARY_CAPA(ary) <= (len = RARRAY_LEN(ary)) + argc) {
- ary_double_capa(ary, len + argc);
+ if (argc == 0) {
+ rb_ary_modify_check(ary);
+ return ary;
}
- /* sliding items */
- MEMMOVE(RARRAY_PTR(ary) + argc, RARRAY_PTR(ary), VALUE, len);
+ ary_ensure_room_for_unshift(ary, argc);
MEMCPY(RARRAY_PTR(ary), argv, VALUE, argc);
- ARY_INCREASE_LEN(ary, argc);
-
+ ARY_SET_LEN(ary, len + argc);
return ary;
}
@@ -970,13 +1132,16 @@ rb_ary_subseq(VALUE ary, long beg, long len)
* ary.slice(start, length) -> new_ary or nil
* ary.slice(range) -> new_ary or nil
*
- * Element Reference---Returns the element at _index_,
- * or returns a subarray starting at _start_ and
- * continuing for _length_ elements, or returns a subarray
- * specified by _range_.
- * Negative indices count backward from the end of the
- * array (-1 is the last element). Returns +nil+ if the index
- * (or starting index) are out of range.
+ * Element Reference --- Returns the element at +index+, or returns a
+ * subarray starting at the +start+ index and continuing for +length+
+ * elements, or returns a subarray specified by +range+ of indices.
+ *
+ * Negative indices count backward from the end of the array (-1 is the last
+ * element). For +start+ and +range+ cases the starting index is just before
+ * an element. Additionally, an empty array is returned when the starting
+ * index for an element range is at the end of the array.
+ *
+ * Returns +nil+ if the index (or starting index) are out of range.
*
* a = [ "a", "b", "c", "d", "e" ]
* a[2] + a[0] + a[1] #=> "cab"
@@ -988,6 +1153,7 @@ rb_ary_subseq(VALUE ary, long beg, long len)
* a[-3, 3] #=> [ "c", "d", "e" ]
* # special cases
* a[5] #=> nil
+ * a[6, 1] #=> nil
* a[5, 1] #=> []
* a[5..10] #=> []
*
@@ -1008,7 +1174,7 @@ rb_ary_aref(int argc, VALUE *argv, VALUE ary)
return rb_ary_subseq(ary, beg, len);
}
if (argc != 1) {
- rb_scan_args(argc, argv, "11", 0, 0);
+ rb_scan_args(argc, argv, "11", NULL, NULL);
}
arg = argv[0];
/* special case - speeding up */
@@ -1031,9 +1197,9 @@ rb_ary_aref(int argc, VALUE *argv, VALUE ary)
* call-seq:
* ary.at(index) -> obj or nil
*
- * Returns the element at _index_. A
- * negative index counts from the end of +self+. Returns +nil+
- * if the index is out of range. See also <code>Array#[]</code>.
+ * Returns the element at +index+. A negative index counts from the end of
+ * +self+. Returns +nil+ if the index is out of range. See also
+ * Array#[].
*
* a = [ "a", "b", "c", "d", "e" ]
* a.at(0) #=> "a"
@@ -1052,8 +1218,9 @@ rb_ary_at(VALUE ary, VALUE pos)
* ary.first(n) -> new_ary
*
* Returns the first element, or the first +n+ elements, of the array.
- * If the array is empty, the first form returns <code>nil</code>, and the
- * second form returns an empty array.
+ * If the array is empty, the first form returns +nil+, and the
+ * second form returns an empty array. See also Array#last for
+ * the opposite effect.
*
* a = [ "q", "r", "s", "t" ]
* a.first #=> "q"
@@ -1078,7 +1245,9 @@ rb_ary_first(int argc, VALUE *argv, VALUE ary)
* ary.last(n) -> new_ary
*
* Returns the last element(s) of +self+. If the array is empty,
- * the first form returns <code>nil</code>.
+ * the first form returns +nil+.
+ *
+ * See also Array#first for the opposite effect.
*
* a = [ "w", "x", "y", "z" ]
* a.last #=> "z"
@@ -1100,21 +1269,24 @@ rb_ary_last(int argc, VALUE *argv, VALUE ary)
/*
* call-seq:
* ary.fetch(index) -> obj
- * ary.fetch(index, default ) -> obj
- * ary.fetch(index) {|index| block } -> obj
+ * ary.fetch(index, default) -> obj
+ * ary.fetch(index) { |index| block } -> obj
+ *
+ * Tries to return the element at position +index+, but throws an IndexError
+ * exception if the referenced +index+ lies outside of the array bounds. This
+ * error can be prevented by supplying a second argument, which will act as a
+ * +default+ value.
*
- * Tries to return the element at position <i>index</i>. If the index
- * lies outside the array, the first form throws an
- * <code>IndexError</code> exception, the second form returns
- * <i>default</i>, and the third form returns the value of invoking
- * the block, passing in the index. Negative values of <i>index</i>
- * count from the end of the array.
+ * Alternatively, if a block is given it will only be executed when an
+ * invalid +index+ is referenced. Negative values of +index+ count from the
+ * end of the array.
*
* a = [ 11, 22, 33, 44 ]
* a.fetch(1) #=> 22
* a.fetch(-1) #=> 44
* a.fetch(4, 'cat') #=> "cat"
- * a.fetch(4) { |i| i*i } #=> 16
+ * a.fetch(100) { |i| puts "#{i} is out of bounds" }
+ * #=> "100 is out of bounds"
*/
static VALUE
@@ -1147,24 +1319,27 @@ rb_ary_fetch(int argc, VALUE *argv, VALUE ary)
/*
* call-seq:
- * ary.index(obj) -> int or nil
- * ary.index {|item| block} -> int or nil
- * ary.index -> an_enumerator
+ * ary.index(obj) -> int or nil
+ * ary.index { |item| block } -> int or nil
+ * ary.index -> Enumerator
+ *
+ * Returns the _index_ of the first object in +ary+ such that the object is
+ * <code>==</code> to +obj+.
*
- * Returns the index of the first object in +self+ such that the object is
- * <code>==</code> to <i>obj</i>. If a block is given instead of an
- * argument, returns index of first object for which <em>block</em> is true.
- * Returns <code>nil</code> if no match is found.
- * See also <code>Array#rindex</code>.
+ * If a block is given instead of an argument, returns the _index_ of the
+ * first object for which the block returns +true+. Returns +nil+ if no
+ * match is found.
*
- * If neither block nor argument is given, an enumerator is returned instead.
+ * See also Array#rindex.
+ *
+ * An Enumerator is returned if neither a block nor argument is given.
*
* a = [ "a", "b", "c" ]
- * a.index("b") #=> 1
- * a.index("z") #=> nil
- * a.index{|x|x=="b"} #=> 1
+ * a.index("b") #=> 1
+ * a.index("z") #=> nil
+ * a.index { |x| x == "b" } #=> 1
*
- * This is an alias of <code>#find_index</code>.
+ * This is an alias of Array#find_index.
*/
static VALUE
@@ -1194,23 +1369,26 @@ rb_ary_index(int argc, VALUE *argv, VALUE ary)
/*
* call-seq:
- * ary.rindex(obj) -> int or nil
- * ary.rindex {|item| block} -> int or nil
- * ary.rindex -> an_enumerator
+ * ary.rindex(obj) -> int or nil
+ * ary.rindex { |item| block } -> int or nil
+ * ary.rindex -> Enumerator
+ *
+ * Returns the _index_ of the last object in +self+ <code>==</code> to +obj+.
+ *
+ * If a block is given instead of an argument, returns the _index_ of the
+ * first object for which the block returns +true+, starting from the last
+ * object.
*
- * Returns the index of the last object in +self+
- * <code>==</code> to <i>obj</i>. If a block is given instead of an
- * argument, returns index of first object for which <em>block</em> is
- * true, starting from the last object.
- * Returns <code>nil</code> if no match is found.
- * See also <code>Array#index</code>.
+ * Returns +nil+ if no match is found.
*
- * If neither block nor argument is given, an enumerator is returned instead.
+ * See also Array#index.
+ *
+ * If neither block nor argument is given, an Enumerator is returned instead.
*
* a = [ "a", "b", "b", "b", "c" ]
- * a.rindex("b") #=> 3
- * a.rindex("z") #=> nil
- * a.rindex{|x|x=="b"} #=> 3
+ * a.rindex("b") #=> 3
+ * a.rindex("z") #=> nil
+ * a.rindex { |x| x == "b" } #=> 3
*/
static VALUE
@@ -1276,15 +1454,12 @@ rb_ary_splice(VALUE ary, long beg, long len, VALUE rpl)
rpl = rb_ary_to_ary(rpl);
rlen = RARRAY_LEN(rpl);
}
- rb_ary_modify(ary);
if (beg >= RARRAY_LEN(ary)) {
if (beg > ARY_MAX_SIZE - rlen) {
rb_raise(rb_eIndexError, "index %ld too big", beg);
}
+ ary_ensure_room_for_push(ary, rlen-len); /* len is 0 or negative */
len = beg + rlen;
- if (len >= ARY_CAPA(ary)) {
- ary_double_capa(ary, len);
- }
rb_mem_clear(RARRAY_PTR(ary) + RARRAY_LEN(ary), beg - RARRAY_LEN(ary));
if (rlen > 0) {
MEMCPY(RARRAY_PTR(ary) + beg, RARRAY_PTR(rpl), VALUE, rlen);
@@ -1294,6 +1469,7 @@ rb_ary_splice(VALUE ary, long beg, long len, VALUE rpl)
else {
long alen;
+ rb_ary_modify(ary);
alen = RARRAY_LEN(ary) + rlen - len;
if (alen >= ARY_CAPA(ary)) {
ary_double_capa(ary, alen);
@@ -1310,6 +1486,21 @@ rb_ary_splice(VALUE ary, long beg, long len, VALUE rpl)
}
}
+void
+rb_ary_set_len(VALUE ary, long len)
+{
+ long capa;
+
+ rb_ary_modify_check(ary);
+ if (ARY_SHARED_P(ary)) {
+ rb_raise(rb_eRuntimeError, "can't set length of shared ");
+ }
+ if (len > (capa = (long)ARY_CAPA(ary))) {
+ rb_bug("probable buffer overflow: %ld for %ld", len, capa);
+ }
+ ARY_SET_LEN(ary, len);
+}
+
/*!
* expands or shrinks \a ary to \a len elements.
* expanded region will be filled with Qnil.
@@ -1362,16 +1553,21 @@ rb_ary_resize(VALUE ary, long len)
* ary[start, length] = obj or other_ary or nil -> obj or other_ary or nil
* ary[range] = obj or other_ary or nil -> obj or other_ary or nil
*
- * Element Assignment---Sets the element at _index_,
- * or replaces a subarray starting at _start_ and
- * continuing for _length_ elements, or replaces a subarray
- * specified by _range_. If indices are greater than
- * the current capacity of the array, the array grows
- * automatically. A negative indices will count backward
- * from the end of the array. Inserts elements if _length_ is
- * zero. An +IndexError+ is raised if a negative index points
- * past the beginning of the array. See also
- * <code>Array#push</code>, and <code>Array#unshift</code>.
+ * Element Assignment --- Sets the element at +index+, or replaces a subarray
+ * from the +start+ index for +length+ elements, or replaces a subarray
+ * specified by the +range+ of indices.
+ *
+ * If indices are greater than the current capacity of the array, the array
+ * grows automatically. Elements are inserted into the array at +start+ if
+ * +length+ is zero.
+ *
+ * Negative indices will count backward from the end of the array. For
+ * +start+ and +range+ cases the starting index is just before an element.
+ *
+ * An IndexError is raised if a negative index points past the beginning of
+ * the array.
+ *
+ * See also Array#push, and Array#unshift.
*
* a = Array.new
* a[4] = "4"; #=> [nil, nil, nil, nil, "4"]
@@ -1382,6 +1578,8 @@ rb_ary_resize(VALUE ary, long len)
* a[-1] = "Z" #=> ["A", "Z"]
* a[1..-1] = nil #=> ["A", nil]
* a[1..-1] = [] #=> ["A"]
+ * a[0, 0] = [ 1, 2 ] #=> [1, 2, "A"]
+ * a[3, 0] = "B" #=> [1, 2, "A", "B"]
*/
static VALUE
@@ -1396,9 +1594,7 @@ rb_ary_aset(int argc, VALUE *argv, VALUE ary)
rb_ary_splice(ary, beg, len, argv[2]);
return argv[2];
}
- if (argc != 2) {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 2)", argc);
- }
+ rb_check_arity(argc, 2, 2);
rb_ary_modify_check(ary);
if (FIXNUM_P(argv[0])) {
offset = FIX2LONG(argv[0]);
@@ -1420,8 +1616,10 @@ fixnum:
* call-seq:
* ary.insert(index, obj...) -> ary
*
- * Inserts the given values before the element with the given index
- * (which may be negative).
+ * Inserts the given values before the element with the given +index+.
+ *
+ * Negative indices count backwards from the end of the array, where +-1+ is
+ * the last element.
*
* a = %w{ a b c d }
* a.insert(2, 99) #=> ["a", "b", 99, "c", "d"]
@@ -1433,9 +1631,7 @@ rb_ary_insert(int argc, VALUE *argv, VALUE ary)
{
long pos;
- if (argc < 1) {
- rb_raise(rb_eArgError, "wrong number of arguments (at least 1)");
- }
+ rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS);
rb_ary_modify_check(ary);
if (argc == 1) return ary;
pos = NUM2LONG(argv[0]);
@@ -1449,15 +1645,18 @@ rb_ary_insert(int argc, VALUE *argv, VALUE ary)
return ary;
}
+static VALUE
+rb_ary_length(VALUE ary);
+
/*
* call-seq:
- * ary.each {|item| block } -> ary
- * ary.each -> an_enumerator
+ * ary.each { |item| block } -> ary
+ * ary.each -> Enumerator
*
- * Calls <i>block</i> once for each element in +self+, passing that
- * element as a parameter.
+ * Calls the given block once for each element in +self+, passing that element
+ * as a parameter.
*
- * If no block is given, an enumerator is returned instead.
+ * An Enumerator is returned if no block is given.
*
* a = [ "a", "b", "c" ]
* a.each {|x| print x, " -- " }
@@ -1473,7 +1672,7 @@ rb_ary_each(VALUE array)
long i;
volatile VALUE ary = array;
- RETURN_ENUMERATOR(ary, 0, 0);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
for (i=0; i<RARRAY_LEN(ary); i++) {
rb_yield(RARRAY_PTR(ary)[i]);
}
@@ -1482,14 +1681,13 @@ rb_ary_each(VALUE array)
/*
* call-seq:
- * ary.each_index {|index| block } -> ary
- * ary.each_index -> an_enumerator
+ * ary.each_index { |index| block } -> ary
+ * ary.each_index -> Enumerator
*
- * Same as <code>Array#each</code>, but passes the index of the element
- * instead of the element itself.
- *
- * If no block is given, an enumerator is returned instead.
+ * Same as Array#each, but passes the +index+ of the element instead of the
+ * element itself.
*
+ * An Enumerator is returned if no block is given.
*
* a = [ "a", "b", "c" ]
* a.each_index {|x| print x, " -- " }
@@ -1503,7 +1701,7 @@ static VALUE
rb_ary_each_index(VALUE ary)
{
long i;
- RETURN_ENUMERATOR(ary, 0, 0);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
for (i=0; i<RARRAY_LEN(ary); i++) {
rb_yield(LONG2NUM(i));
@@ -1513,11 +1711,10 @@ rb_ary_each_index(VALUE ary)
/*
* call-seq:
- * ary.reverse_each {|item| block } -> ary
- * ary.reverse_each -> an_enumerator
+ * ary.reverse_each { |item| block } -> ary
+ * ary.reverse_each -> Enumerator
*
- * Same as <code>Array#each</code>, but traverses +self+ in reverse
- * order.
+ * Same as Array#each, but traverses +self+ in reverse order.
*
* a = [ "a", "b", "c" ]
* a.reverse_each {|x| print x, " " }
@@ -1532,7 +1729,7 @@ rb_ary_reverse_each(VALUE ary)
{
long len;
- RETURN_ENUMERATOR(ary, 0, 0);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
len = RARRAY_LEN(ary);
while (len--) {
rb_yield(RARRAY_PTR(ary)[len]);
@@ -1550,6 +1747,7 @@ rb_ary_reverse_each(VALUE ary)
* Returns the number of elements in +self+. May be zero.
*
* [ 1, 2, 3, 4, 5 ].length #=> 5
+ * [].length #=> 0
*/
static VALUE
@@ -1563,7 +1761,7 @@ rb_ary_length(VALUE ary)
* call-seq:
* ary.empty? -> true or false
*
- * Returns <code>true</code> if +self+ contains no elements.
+ * Returns +true+ if +self+ contains no elements.
*
* [].empty? #=> true
*/
@@ -1644,6 +1842,7 @@ ary_join_1(VALUE obj, VALUE ary, VALUE sep, long i, VALUE result, int *first)
case T_STRING:
str_join:
rb_str_buf_append(result, val);
+ *first = FALSE;
break;
case T_ARRAY:
obj = val;
@@ -1692,8 +1891,8 @@ rb_ary_join(VALUE ary, VALUE sep)
VALUE val, tmp, result;
if (RARRAY_LEN(ary) == 0) return rb_usascii_str_new(0, 0);
- if (OBJ_TAINTED(ary) || OBJ_TAINTED(sep)) taint = TRUE;
- if (OBJ_UNTRUSTED(ary) || OBJ_UNTRUSTED(sep)) untrust = TRUE;
+ if (OBJ_TAINTED(ary)) taint = TRUE;
+ if (OBJ_UNTRUSTED(ary)) untrust = TRUE;
if (!NIL_P(sep)) {
StringValue(sep);
@@ -1728,10 +1927,12 @@ rb_ary_join(VALUE ary, VALUE sep)
/*
* call-seq:
- * ary.join(sep=$,) -> str
+ * ary.join(separator=$,) -> str
*
* Returns a string created by converting each element of the array to
- * a string, separated by <i>sep</i>.
+ * a string, separated by the given +separator+.
+ * If the +separator+ is +nil+, it uses current $,.
+ * If both the +separator+ and $, are nil, it uses empty string.
*
* [ "a", "b", "c" ].join #=> "abc"
* [ "a", "b", "c" ].join("-") #=> "a-b-c"
@@ -1774,10 +1975,12 @@ inspect_ary(VALUE ary, VALUE dummy, int recur)
/*
* call-seq:
- * ary.to_s -> string
* ary.inspect -> string
+ * ary.to_s -> string
*
* Creates a string representation of +self+.
+ *
+ * [ "a", "b", "c" ].to_s #=> "[\"a\", \"b\", \"c\"]"
*/
static VALUE
@@ -1797,8 +2000,9 @@ rb_ary_to_s(VALUE ary)
* call-seq:
* ary.to_a -> ary
*
- * Returns +self+. If called on a subclass of Array, converts
- * the receiver to an Array object.
+ * Returns +self+.
+ *
+ * If called on a subclass of Array, converts the receiver to an Array object.
*/
static VALUE
@@ -1826,8 +2030,7 @@ rb_ary_to_ary_m(VALUE ary)
}
static void
-ary_reverse(p1, p2)
- VALUE *p1, *p2;
+ary_reverse(VALUE *p1, VALUE *p2)
{
while (p1 < p2) {
VALUE tmp = *p1;
@@ -1869,7 +2072,7 @@ rb_ary_reverse_bang(VALUE ary)
/*
* call-seq:
- * ary.reverse -> new_ary
+ * ary.reverse -> new_ary
*
* Returns a new array containing +self+'s elements in reverse order.
*
@@ -1921,11 +2124,13 @@ rb_ary_rotate(VALUE ary, long cnt)
/*
* call-seq:
- * ary.rotate!(cnt=1) -> ary
+ * ary.rotate!(count=1) -> ary
*
- * Rotates +self+ in place so that the element at +cnt+ comes first,
- * and returns +self+. If +cnt+ is negative then it rotates in
- * the opposite direction.
+ * Rotates +self+ in place so that the element at +count+ comes first, and
+ * returns +self+.
+ *
+ * If +count+ is negative then it rotates in the opposite direction, starting
+ * from the end of the array where +-1+ is the last element.
*
* a = [ "a", "b", "c", "d" ]
* a.rotate! #=> ["b", "c", "d", "a"]
@@ -1950,11 +2155,13 @@ rb_ary_rotate_bang(int argc, VALUE *argv, VALUE ary)
/*
* call-seq:
- * ary.rotate(cnt=1) -> new_ary
+ * ary.rotate(count=1) -> new_ary
+ *
+ * Returns a new array by rotating +self+ so that the element at +count+ is
+ * the first element of the new array.
*
- * Returns new array by rotating +self+ so that the element at
- * +cnt+ in +self+ is the first element of the new array. If +cnt+
- * is negative then it rotates in the opposite direction.
+ * If +count+ is negative then it rotates in the opposite direction, starting
+ * from the end of +self+ where +-1+ is the last element.
*
* a = [ "a", "b", "c", "d" ]
* a.rotate #=> ["b", "c", "d", "a"]
@@ -2001,7 +2208,7 @@ enum {
sort_optimizable_count
};
-#define STRING_P(s) (TYPE(s) == T_STRING && CLASS_OF(s) == rb_cString)
+#define STRING_P(s) (RB_TYPE_P((s), T_STRING) && CLASS_OF(s) == rb_cString)
#define SORT_OPTIMIZABLE_BIT(type) (1U << TOKEN_PASTE(sort_opt_,type))
#define SORT_OPTIMIZABLE(data, type) \
@@ -2061,17 +2268,22 @@ sort_2(const void *ap, const void *bp, void *dummy)
/*
* call-seq:
* ary.sort! -> ary
- * ary.sort! {| a,b | block } -> ary
+ * ary.sort! { |a, b| block } -> ary
+ *
+ * Sorts +self+ in place.
*
- * Sorts +self+. Comparisons for
- * the sort will be done using the <code><=></code> operator or using
- * an optional code block. The block implements a comparison between
- * <i>a</i> and <i>b</i>, returning -1, 0, or +1. See also
- * <code>Enumerable#sort_by</code>.
+ * Comparisons for the sort will be done using the <code><=></code> operator
+ * or using an optional code block.
+ *
+ * The block must implement a comparison between +a+ and +b+, and return
+ * +-1+, when +a+ follows +b+, +0+ when +a+ and +b+ are equivalent, or ++1+
+ * if +b+ follows +a+.
+ *
+ * See also Enumerable#sort_by.
*
* a = [ "d", "a", "e", "c", "b" ]
* a.sort! #=> ["a", "b", "c", "d", "e"]
- * a.sort! {|x,y| y <=> x } #=> ["e", "d", "c", "b", "a"]
+ * a.sort! { |x,y| y <=> x } #=> ["e", "d", "c", "b", "a"]
*/
VALUE
@@ -2082,12 +2294,13 @@ rb_ary_sort_bang(VALUE ary)
if (RARRAY_LEN(ary) > 1) {
VALUE tmp = ary_make_substitution(ary); /* only ary refers tmp */
struct ary_sort_data data;
+ long len = RARRAY_LEN(ary);
RBASIC(tmp)->klass = 0;
data.ary = tmp;
data.opt_methods = 0;
data.opt_inited = 0;
- ruby_qsort(RARRAY_PTR(tmp), RARRAY_LEN(tmp), sizeof(VALUE),
+ ruby_qsort(RARRAY_PTR(tmp), len, sizeof(VALUE),
rb_block_given_p()?sort_1:sort_2, &data);
if (ARY_EMBED_P(tmp)) {
@@ -2104,7 +2317,7 @@ rb_ary_sort_bang(VALUE ary)
if (ARY_HEAP_PTR(ary) == ARY_HEAP_PTR(tmp)) {
assert(!ARY_EMBED_P(ary));
FL_UNSET_SHARED(ary);
- ARY_SET_CAPA(ary, ARY_CAPA(tmp));
+ ARY_SET_CAPA(ary, RARRAY_LEN(tmp));
}
else {
assert(!ARY_SHARED_P(tmp));
@@ -2119,8 +2332,8 @@ rb_ary_sort_bang(VALUE ary)
xfree(ARY_HEAP_PTR(ary));
}
ARY_SET_PTR(ary, RARRAY_PTR(tmp));
- ARY_SET_HEAP_LEN(ary, RARRAY_LEN(tmp));
- ARY_SET_CAPA(ary, ARY_CAPA(tmp));
+ ARY_SET_HEAP_LEN(ary, len);
+ ARY_SET_CAPA(ary, RARRAY_LEN(tmp));
}
/* tmp was lost ownership for the ptr */
FL_UNSET(tmp, FL_FREEZE);
@@ -2137,17 +2350,23 @@ rb_ary_sort_bang(VALUE ary)
/*
* call-seq:
* ary.sort -> new_ary
- * ary.sort {| a,b | block } -> new_ary
+ * ary.sort { |a, b| block } -> new_ary
+ *
+ * Returns a new array created by sorting +self+.
+ *
+ * Comparisons for the sort will be done using the <code><=></code> operator
+ * or using an optional code block.
+ *
+ * The block must implement a comparison between +a+ and +b+, and return
+ * +-1+, when +a+ follows +b+, +0+ when +a+ and +b+ are equivalent, or ++1+
+ * if +b+ follows +a+.
*
- * Returns a new array created by sorting +self+. Comparisons for
- * the sort will be done using the <code><=></code> operator or using
- * an optional code block. The block implements a comparison between
- * <i>a</i> and <i>b</i>, returning -1, 0, or +1. See also
- * <code>Enumerable#sort_by</code>.
+ *
+ * See also Enumerable#sort_by.
*
* a = [ "d", "a", "e", "c", "b" ]
* a.sort #=> ["a", "b", "c", "d", "e"]
- * a.sort {|x,y| y <=> x } #=> ["e", "d", "c", "b", "a"]
+ * a.sort { |x,y| y <=> x } #=> ["e", "d", "c", "b", "a"]
*/
VALUE
@@ -2158,6 +2377,103 @@ rb_ary_sort(VALUE ary)
return ary;
}
+/*
+ * call-seq:
+ * ary.bsearch {|x| block } -> elem
+ *
+ * By using binary search, finds a value from this array which meets
+ * the given condition in O(log n) where n is the size of the array.
+ *
+ * You can use this method in two use cases: a find-minimum mode and
+ * a find-any mode. In either case, the elements of the array must be
+ * monotone (or sorted) with respect to the block.
+ *
+ * In find-minimum mode (this is a good choice for typical use case),
+ * the block must return true or false, and there must be an index i
+ * (0 <= i <= ary.size) so that:
+ *
+ * - the block returns false for any element whose index is less than
+ * i, and
+ * - the block returns true for any element whose index is greater
+ * than or equal to i.
+ *
+ * This method returns the i-th element. If i is equal to ary.size,
+ * it returns nil.
+ *
+ * ary = [0, 4, 7, 10, 12]
+ * ary.bsearch {|x| x >= 4 } #=> 4
+ * ary.bsearch {|x| x >= 6 } #=> 7
+ * ary.bsearch {|x| x >= -1 } #=> 0
+ * ary.bsearch {|x| x >= 100 } #=> nil
+ *
+ * In find-any mode (this behaves like libc's bsearch(3)), the block
+ * must return a number, and there must be two indices i and j
+ * (0 <= i <= j <= ary.size) so that:
+ *
+ * - the block returns a positive number for ary[k] if 0 <= k < i,
+ * - the block returns zero for ary[k] if i <= k < j, and
+ * - the block returns a negative number for ary[k] if
+ * j <= k < ary.size.
+ *
+ * Under this condition, this method returns any element whose index
+ * is within i...j. If i is equal to j (i.e., there is no element
+ * that satisfies the block), this method returns nil.
+ *
+ * ary = [0, 4, 7, 10, 12]
+ * # try to find v such that 4 <= v < 8
+ * ary.bsearch {|x| 1 - x / 4 } #=> 4 or 7
+ * # try to find v such that 8 <= v < 10
+ * ary.bsearch {|x| 4 - x / 2 } #=> nil
+ *
+ * You must not mix the two modes at a time; the block must always
+ * return either true/false, or always return a number. It is
+ * undefined which value is actually picked up at each iteration.
+ */
+
+static VALUE
+rb_ary_bsearch(VALUE ary)
+{
+ long low = 0, high = RARRAY_LEN(ary), mid;
+ int smaller = 0, satisfied = 0;
+ VALUE v, val;
+
+ while (low < high) {
+ mid = low + ((high - low) / 2);
+ val = rb_ary_entry(ary, mid);
+ v = rb_yield(val);
+ if (FIXNUM_P(v)) {
+ if (FIX2INT(v) == 0) return val;
+ smaller = FIX2INT(v) < 0;
+ }
+ else if (v == Qtrue) {
+ satisfied = 1;
+ smaller = 1;
+ }
+ else if (v == Qfalse || v == Qnil) {
+ smaller = 0;
+ }
+ else if (rb_obj_is_kind_of(v, rb_cNumeric)) {
+ switch (rb_cmpint(rb_funcall(v, id_cmp, 1, INT2FIX(0)), v, INT2FIX(0))) {
+ case 0: return val;
+ case 1: smaller = 1; break;
+ case -1: smaller = 0;
+ }
+ }
+ else {
+ smaller = RTEST(v);
+ }
+ if (smaller) {
+ high = mid;
+ }
+ else {
+ low = mid + 1;
+ }
+ }
+ if (low == RARRAY_LEN(ary)) return Qnil;
+ if (!satisfied) return Qnil;
+ return rb_ary_entry(ary, low);
+}
+
static VALUE
sort_by_i(VALUE i)
@@ -2167,13 +2483,13 @@ sort_by_i(VALUE i)
/*
* call-seq:
- * ary.sort_by! {| obj | block } -> ary
- * ary.sort_by! -> an_enumerator
+ * ary.sort_by! { |obj| block } -> ary
+ * ary.sort_by! -> Enumerator
*
* Sorts +self+ in place using a set of keys generated by mapping the
* values in +self+ through the given block.
*
- * If no block is given, an enumerator is returned instead.
+ * If no block is given, an Enumerator is returned instead.
*
*/
@@ -2182,7 +2498,7 @@ rb_ary_sort_by_bang(VALUE ary)
{
VALUE sorted;
- RETURN_ENUMERATOR(ary, 0, 0);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
rb_ary_modify(ary);
sorted = rb_block_call(ary, rb_intern("sort_by"), 0, 0, sort_by_i, 0);
rb_ary_replace(ary, sorted);
@@ -2192,20 +2508,22 @@ rb_ary_sort_by_bang(VALUE ary)
/*
* call-seq:
- * ary.collect {|item| block } -> new_ary
- * ary.map {|item| block } -> new_ary
- * ary.collect -> an_enumerator
- * ary.map -> an_enumerator
+ * ary.collect { |item| block } -> new_ary
+ * ary.map { |item| block } -> new_ary
+ * ary.collect -> Enumerator
+ * ary.map -> Enumerator
*
- * Invokes <i>block</i> once for each element of +self+. Creates a
- * new array containing the values returned by the block.
- * See also <code>Enumerable#collect</code>.
+ * Invokes the given block once for each element of +self+.
*
- * If no block is given, an enumerator is returned instead.
+ * Creates a new array containing the values returned by the block.
+ *
+ * See also Enumerable#collect.
+ *
+ * If no block is given, an Enumerator is returned instead.
*
* a = [ "a", "b", "c", "d" ]
- * a.collect {|x| x + "!" } #=> ["a!", "b!", "c!", "d!"]
- * a #=> ["a", "b", "c", "d"]
+ * a.map { |x| x + "!" } #=> ["a!", "b!", "c!", "d!"]
+ * a #=> ["a", "b", "c", "d"]
*/
static VALUE
@@ -2214,7 +2532,7 @@ rb_ary_collect(VALUE ary)
long i;
VALUE collect;
- RETURN_ENUMERATOR(ary, 0, 0);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
collect = rb_ary_new2(RARRAY_LEN(ary));
for (i = 0; i < RARRAY_LEN(ary); i++) {
rb_ary_push(collect, rb_yield(RARRAY_PTR(ary)[i]));
@@ -2227,18 +2545,19 @@ rb_ary_collect(VALUE ary)
* call-seq:
* ary.collect! {|item| block } -> ary
* ary.map! {|item| block } -> ary
- * ary.collect -> an_enumerator
- * ary.map -> an_enumerator
+ * ary.collect! -> Enumerator
+ * ary.map! -> Enumerator
*
- * Invokes the block once for each element of +self+, replacing the
- * element with the value returned by _block_.
- * See also <code>Enumerable#collect</code>.
+ * Invokes the given block once for each element of +self+, replacing the
+ * element with the value returned by the block.
*
- * If no block is given, an enumerator is returned instead.
+ * See also Enumerable#collect.
+ *
+ * If no block is given, an Enumerator is returned instead.
*
* a = [ "a", "b", "c", "d" ]
- * a.collect! {|x| x + "!" }
- * a #=> [ "a!", "b!", "c!", "d!" ]
+ * a.map! {|x| x + "!" }
+ * a #=> [ "a!", "b!", "c!", "d!" ]
*/
static VALUE
@@ -2246,7 +2565,7 @@ rb_ary_collect_bang(VALUE ary)
{
long i;
- RETURN_ENUMERATOR(ary, 0, 0);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
rb_ary_modify(ary);
for (i = 0; i < RARRAY_LEN(ary); i++) {
rb_ary_store(ary, i, rb_yield(RARRAY_PTR(ary)[i]));
@@ -2266,15 +2585,13 @@ rb_get_values_at(VALUE obj, long olen, int argc, VALUE *argv, VALUE (*func) (VAL
continue;
}
/* check if idx is Range */
- switch (rb_range_beg_len(argv[i], &beg, &len, olen, 0)) {
- case Qfalse:
- break;
- case Qnil:
- continue;
- default:
- for (j=0; j<len; j++) {
- rb_ary_push(result, (*func)(obj, j+beg));
+ if (rb_range_beg_len(argv[i], &beg, &len, olen, 1)) {
+ long end = olen < beg+len ? olen : beg+len;
+ for (j = beg; j < end; j++) {
+ rb_ary_push(result, (*func)(obj, j));
}
+ if (beg + len > j)
+ rb_ary_resize(result, RARRAY_LEN(result) + (beg + len) - j);
continue;
}
rb_ary_push(result, (*func)(obj, NUM2LONG(argv[i])));
@@ -2284,18 +2601,20 @@ rb_get_values_at(VALUE obj, long olen, int argc, VALUE *argv, VALUE (*func) (VAL
/*
* call-seq:
- * ary.values_at(selector,... ) -> new_ary
+ * ary.values_at(selector, ...) -> new_ary
+ *
+ * Returns an array containing the elements in +self+ corresponding to the
+ * given +selector+(s).
*
- * Returns an array containing the elements in
- * +self+ corresponding to the given selector(s). The selectors
- * may be either integer indices or ranges.
- * See also <code>Array#select</code>.
+ * The selectors may be either integer indices or ranges.
+ *
+ * See also Array#select.
*
* a = %w{ a b c d e f }
- * a.values_at(1, 3, 5)
- * a.values_at(1, 3, 5, 7)
- * a.values_at(-1, -3, -5, -7)
- * a.values_at(1..3, 2...5)
+ * a.values_at(1, 3, 5) # => ["b", "d", "f"]
+ * a.values_at(1, 3, 5, 7) # => ["b", "d", "f", nil]
+ * a.values_at(-1, -2, -2, -7) # => ["f", "e", "e", nil]
+ * a.values_at(4..6, 3...6) # => ["e", "f", nil, "d", "e", "f"]
*/
static VALUE
@@ -2307,17 +2626,20 @@ rb_ary_values_at(int argc, VALUE *argv, VALUE ary)
/*
* call-seq:
- * ary.select {|item| block } -> new_ary
- * ary.select -> an_enumerator
+ * ary.select { |item| block } -> new_ary
+ * ary.select -> Enumerator
+ *
+ * Returns a new array containing all elements of +ary+
+ * for which the given +block+ returns a true value.
*
- * Invokes the block passing in successive elements from +self+,
- * returning an array containing those elements for which the block
- * returns a true value (equivalent to <code>Enumerable#select</code>).
+ * If no block is given, an Enumerator is returned instead.
*
- * If no block is given, an enumerator is returned instead.
+ * [1,2,3,4,5].select { |num| num.even? } #=> [2, 4]
*
* a = %w{ a b c d e f }
- * a.select {|v| v =~ /[aeiou]/} #=> ["a", "e"]
+ * a.select { |v| v =~ /[aeiou]/ } #=> ["a", "e"]
+ *
+ * See also Enumerable#select.
*/
static VALUE
@@ -2326,7 +2648,7 @@ rb_ary_select(VALUE ary)
VALUE result;
long i;
- RETURN_ENUMERATOR(ary, 0, 0);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
result = rb_ary_new2(RARRAY_LEN(ary));
for (i = 0; i < RARRAY_LEN(ary); i++) {
if (RTEST(rb_yield(RARRAY_PTR(ary)[i]))) {
@@ -2338,16 +2660,17 @@ rb_ary_select(VALUE ary)
/*
* call-seq:
- * ary.select! {|item| block } -> new_ary or nil
- * ary.select! -> an_enumerator
+ * ary.select! {|item| block } -> ary or nil
+ * ary.select! -> Enumerator
+ *
+ * Invokes the given block passing in successive elements from +self+,
+ * deleting elements for which the block returns a +false+ value.
+ *
+ * If changes were made, it will return +self+, otherwise it returns +nil+.
*
- * Invokes the block passing in successive elements from
- * +self+, deleting elements for which the block returns a
- * false value. It returns +self+ if changes were made,
- * otherwise it returns <code>nil</code>.
- * See also <code>Array#keep_if</code>
+ * See also Array#keep_if
*
- * If no block is given, an enumerator is returned instead.
+ * If no block is given, an Enumerator is returned instead.
*
*/
@@ -2356,7 +2679,7 @@ rb_ary_select_bang(VALUE ary)
{
long i1, i2;
- RETURN_ENUMERATOR(ary, 0, 0);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
rb_ary_modify(ary);
for (i1 = i2 = 0; i1 < RARRAY_LEN(ary); i1++) {
VALUE v = RARRAY_PTR(ary)[i1];
@@ -2375,38 +2698,53 @@ rb_ary_select_bang(VALUE ary)
/*
* call-seq:
- * ary.keep_if {|item| block } -> ary
- * ary.keep_if -> an_enumerator
+ * ary.keep_if { |item| block } -> ary
+ * ary.keep_if -> Enumerator
+ *
+ * Deletes every element of +self+ for which the given block evaluates to
+ * +false+.
*
- * Deletes every element of +self+ for which <i>block</i> evaluates
- * to false.
- * See also <code>Array#select!</code>
+ * See also Array#select!
*
- * If no block is given, an enumerator is returned instead.
+ * If no block is given, an Enumerator is returned instead.
*
* a = %w{ a b c d e f }
- * a.keep_if {|v| v =~ /[aeiou]/} #=> ["a", "e"]
+ * a.keep_if { |v| v =~ /[aeiou]/ } #=> ["a", "e"]
*/
static VALUE
rb_ary_keep_if(VALUE ary)
{
- RETURN_ENUMERATOR(ary, 0, 0);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
rb_ary_select_bang(ary);
return ary;
}
+static void
+ary_resize_smaller(VALUE ary, long len)
+{
+ rb_ary_modify(ary);
+ if (RARRAY_LEN(ary) > len) {
+ ARY_SET_LEN(ary, len);
+ if (len * 2 < ARY_CAPA(ary) &&
+ ARY_CAPA(ary) > ARY_DEFAULT_SIZE) {
+ ary_resize_capa(ary, len * 2);
+ }
+ }
+}
+
/*
* call-seq:
- * ary.delete(obj) -> obj or nil
- * ary.delete(obj) { block } -> obj or nil
+ * ary.delete(obj) -> item or nil
+ * ary.delete(obj) { block } -> item or result of block
+ *
+ * Deletes all items from +self+ that are equal to +obj+.
*
- * Deletes items from +self+ that are equal to <i>obj</i>.
- * If any items are found, returns <i>obj</i>. If
- * the item is not found, returns <code>nil</code>. If the optional
- * code block is given, returns the result of <i>block</i> if the item
- * is not found. (To remove <code>nil</code> elements and
- * get an informative return value, use #compact!)
+ * Returns the last deleted item, or +nil+ if no matching item is found.
+ *
+ * If the optional code block is given, the result of the block is returned if
+ * the item is not found. (To remove +nil+ elements and get an informative
+ * return value, use Array#compact!)
*
* a = [ "a", "b", "b", "b", "c" ]
* a.delete("b") #=> "b"
@@ -2440,16 +2778,32 @@ rb_ary_delete(VALUE ary, VALUE item)
return Qnil;
}
- rb_ary_modify(ary);
- if (RARRAY_LEN(ary) > i2) {
- ARY_SET_LEN(ary, i2);
- if (i2 * 2 < ARY_CAPA(ary) &&
- ARY_CAPA(ary) > ARY_DEFAULT_SIZE) {
- ary_resize_capa(ary, i2*2);
+ ary_resize_smaller(ary, i2);
+
+ return v;
+}
+
+void
+rb_ary_delete_same(VALUE ary, VALUE item)
+{
+ long i1, i2;
+
+ for (i1 = i2 = 0; i1 < RARRAY_LEN(ary); i1++) {
+ VALUE e = RARRAY_PTR(ary)[i1];
+
+ if (e == item) {
+ continue;
}
+ if (i1 != i2) {
+ rb_ary_store(ary, i2, e);
+ }
+ i2++;
+ }
+ if (RARRAY_LEN(ary) == i2) {
+ return;
}
- return v;
+ ary_resize_smaller(ary, i2);
}
VALUE
@@ -2477,11 +2831,12 @@ rb_ary_delete_at(VALUE ary, long pos)
* call-seq:
* ary.delete_at(index) -> obj or nil
*
- * Deletes the element at the specified index, returning that element,
- * or <code>nil</code> if the index is out of range. See also
- * <code>Array#slice!</code>.
+ * Deletes the element at the specified +index+, returning that element, or
+ * +nil+ if the +index+ is out of range.
*
- * a = %w( ant bat cat dog )
+ * See also Array#slice!
+ *
+ * a = ["ant", "bat", "cat", "dog"]
* a.delete_at(2) #=> "cat"
* a #=> ["ant", "bat", "dog"]
* a.delete_at(99) #=> nil
@@ -2499,9 +2854,11 @@ rb_ary_delete_at_m(VALUE ary, VALUE pos)
* ary.slice!(start, length) -> new_ary or nil
* ary.slice!(range) -> new_ary or nil
*
- * Deletes the element(s) given by an index (optionally with a length)
- * or by a range. Returns the deleted object (or objects), or
- * <code>nil</code> if the index is out of range.
+ * Deletes the element(s) given by an +index+ (optionally up to +length+
+ * elements) or by a +range+.
+ *
+ * Returns the deleted object (or objects), or +nil+ if the +index+ is out of
+ * range.
*
* a = [ "a", "b", "c" ]
* a.slice!(1) #=> "b"
@@ -2599,36 +2956,38 @@ ary_reject_bang(VALUE ary)
/*
* call-seq:
- * ary.reject! {|item| block } -> ary or nil
- * ary.reject! -> an_enumerator
+ * ary.reject! { |item| block } -> ary or nil
+ * ary.reject! -> Enumerator
*
- * Equivalent to <code>Array#delete_if</code>, deleting elements from
- * +self+ for which the block evaluates to true, but returns
- * <code>nil</code> if no changes were made.
- * See also <code>Enumerable#reject</code> and <code>Array#delete_if</code>.
+ * Equivalent to Array#delete_if, deleting elements from +self+ for which the
+ * block evaluates to +true+, but returns +nil+ if no changes were made.
*
- * If no block is given, an enumerator is returned instead.
+ * The array is changed instantly every time the block is called, not after
+ * the iteration is over.
*
+ * See also Enumerable#reject and Array#delete_if.
+ *
+ * If no block is given, an Enumerator is returned instead.
*/
static VALUE
rb_ary_reject_bang(VALUE ary)
{
- RETURN_ENUMERATOR(ary, 0, 0);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
return ary_reject_bang(ary);
}
/*
* call-seq:
- * ary.reject {|item| block } -> new_ary
- * ary.reject -> an_enumerator
+ * ary.reject {|item| block } -> new_ary
+ * ary.reject -> Enumerator
*
- * Returns a new array containing the items in +self+
- * for which the block is not true.
- * See also <code>Array#delete_if</code>
+ * Returns a new array containing the items in +self+ for which the given
+ * block is not +true+.
*
- * If no block is given, an enumerator is returned instead.
+ * See also Array#delete_if
*
+ * If no block is given, an Enumerator is returned instead.
*/
static VALUE
@@ -2636,7 +2995,7 @@ rb_ary_reject(VALUE ary)
{
VALUE rejected_ary;
- RETURN_ENUMERATOR(ary, 0, 0);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
rejected_ary = rb_ary_new();
ary_reject(ary, rejected_ary);
return rejected_ary;
@@ -2644,14 +3003,17 @@ rb_ary_reject(VALUE ary)
/*
* call-seq:
- * ary.delete_if {|item| block } -> ary
- * ary.delete_if -> an_enumerator
+ * ary.delete_if { |item| block } -> ary
+ * ary.delete_if -> Enumerator
+ *
+ * Deletes every element of +self+ for which block evaluates to +true+.
+ *
+ * The array is changed instantly every time the block is called, not after
+ * the iteration is over.
*
- * Deletes every element of +self+ for which <i>block</i> evaluates
- * to true.
- * See also <code>Array#reject!</code>
+ * See also Array#reject!
*
- * If no block is given, an enumerator is returned instead.
+ * If no block is given, an Enumerator is returned instead.
*
* a = [ "a", "b", "c" ]
* a.delete_if {|x| x >= "b" } #=> ["a"]
@@ -2660,7 +3022,7 @@ rb_ary_reject(VALUE ary)
static VALUE
rb_ary_delete_if(VALUE ary)
{
- RETURN_ENUMERATOR(ary, 0, 0);
+ RETURN_SIZED_ENUMERATOR(ary, 0, 0, rb_ary_length);
ary_reject_bang(ary);
return ary;
}
@@ -2683,30 +3045,34 @@ take_items(VALUE obj, long n)
if (!NIL_P(result)) return rb_ary_subseq(result, 0, n);
result = rb_ary_new2(n);
args[0] = result; args[1] = (VALUE)n;
- rb_block_call(obj, rb_intern("each"), 0, 0, take_i, (VALUE)args);
+ if (rb_check_block_call(obj, rb_intern("each"), 0, 0, take_i, (VALUE)args) == Qundef)
+ Check_Type(obj, T_ARRAY);
return result;
}
/*
* call-seq:
- * ary.zip(arg, ...) -> new_ary
- * ary.zip(arg, ...) {| arr | block } -> nil
- *
- * Converts any arguments to arrays, then merges elements of
- * +self+ with corresponding elements from each argument. This
- * generates a sequence of <code>self.size</code> <em>n</em>-element
- * arrays, where <em>n</em> is one more that the count of arguments. If
- * the size of any argument is less than <code>enumObj.size</code>,
- * <code>nil</code> values are supplied. If a block is given, it is
- * invoked for each output array, otherwise an array of arrays is
- * returned.
+ * ary.zip(arg, ...) -> new_ary
+ * ary.zip(arg, ...) { |arr| block } -> nil
+ *
+ * Converts any arguments to arrays, then merges elements of +self+ with
+ * corresponding elements from each argument.
+ *
+ * This generates a sequence of <code>ary.size</code> _n_-element arrays,
+ * where _n_ is one more that the count of arguments.
+ *
+ * If the size of any argument is less than the size of the initial array,
+ * +nil+ values are supplied.
+ *
+ * If a block is given, it is invoked for each output +array+, otherwise an
+ * array of arrays is returned.
*
* a = [ 4, 5, 6 ]
* b = [ 7, 8, 9 ]
- * [1,2,3].zip(a, b) #=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
- * [1,2].zip(a,b) #=> [[1, 4, 7], [2, 5, 8]]
- * a.zip([1,2],[8]) #=> [[4,1,8], [5,2,nil], [6,nil,nil]]
+ * [1, 2, 3].zip(a, b) #=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
+ * [1, 2].zip(a, b) #=> [[1, 4, 7], [2, 5, 8]]
+ * a.zip([1, 2], [8]) #=> [[4, 1, 8], [5, 2, nil], [6, nil, nil]]
*/
static VALUE
@@ -2745,11 +3111,13 @@ rb_ary_zip(int argc, VALUE *argv, VALUE ary)
* call-seq:
* ary.transpose -> new_ary
*
- * Assumes that +self+ is an array of arrays and transposes the
- * rows and columns.
+ * Assumes that +self+ is an array of arrays and transposes the rows and
+ * columns.
*
* a = [[1,2], [3,4], [5,6]]
* a.transpose #=> [[1, 3, 5], [2, 4, 6]]
+ *
+ * If the length of the subarrays don't match, an IndexError is raised.
*/
static VALUE
@@ -2784,8 +3152,8 @@ rb_ary_transpose(VALUE ary)
* call-seq:
* ary.replace(other_ary) -> ary
*
- * Replaces the contents of +self+ with the contents of
- * <i>other_ary</i>, truncating or expanding if necessary.
+ * Replaces the contents of +self+ with the contents of +other_ary+,
+ * truncating or expanding if necessary.
*
* a = [ "a", "b", "c", "d", "e" ]
* a.replace([ "x", "y", "z" ]) #=> ["x", "y", "z"]
@@ -2863,27 +3231,32 @@ rb_ary_clear(VALUE ary)
/*
* call-seq:
- * ary.fill(obj) -> ary
- * ary.fill(obj, start [, length]) -> ary
- * ary.fill(obj, range ) -> ary
- * ary.fill {|index| block } -> ary
- * ary.fill(start [, length] ) {|index| block } -> ary
- * ary.fill(range) {|index| block } -> ary
+ * ary.fill(obj) -> ary
+ * ary.fill(obj, start [, length]) -> ary
+ * ary.fill(obj, range ) -> ary
+ * ary.fill { |index| block } -> ary
+ * ary.fill(start [, length] ) { |index| block } -> ary
+ * ary.fill(range) { |index| block } -> ary
*
* The first three forms set the selected elements of +self+ (which
- * may be the entire array) to <i>obj</i>. A <i>start</i> of
- * <code>nil</code> is equivalent to zero. A <i>length</i> of
- * <code>nil</code> is equivalent to <i>self.length</i>. The last three
- * forms fill the array with the value of the block. The block is
- * passed the absolute index of each element to be filled.
- * Negative values of <i>start</i> count from the end of the array.
+ * may be the entire array) to +obj+.
+ *
+ * A +start+ of +nil+ is equivalent to zero.
+ *
+ * A +length+ of +nil+ is equivalent to the length of the array.
+ *
+ * The last three forms fill the array with the value of the given block,
+ * which is passed the absolute index of each element to be filled.
+ *
+ * Negative values of +start+ count from the end of the array, where +-1+ is
+ * the last element.
*
* a = [ "a", "b", "c", "d" ]
* a.fill("x") #=> ["x", "x", "x", "x"]
* a.fill("z", 2, 2) #=> ["x", "x", "z", "z"]
* a.fill("y", 0..1) #=> ["y", "y", "z", "z"]
- * a.fill {|i| i*i} #=> [0, 1, 4, 9]
- * a.fill(-2) {|i| i*i*i} #=> [0, 1, 8, 27]
+ * a.fill { |i| i*i } #=> [0, 1, 4, 9]
+ * a.fill(-2) { |i| i*i*i } #=> [0, 1, 8, 27]
*/
static VALUE
@@ -2961,10 +3334,15 @@ rb_ary_fill(int argc, VALUE *argv, VALUE ary)
* call-seq:
* ary + other_ary -> new_ary
*
- * Concatenation---Returns a new array built by concatenating the
+ * Concatenation --- Returns a new array built by concatenating the
* two arrays together to produce a third array.
*
* [ 1, 2, 3 ] + [ 4, 5 ] #=> [ 1, 2, 3, 4, 5 ]
+ * a = [ "a", "b", "c" ]
+ * a + [ "d", "e", "f" ]
+ * a #=> [ "a", "b", "c", "d", "e", "f" ]
+ *
+ * See also Array#concat.
*/
VALUE
@@ -2986,12 +3364,16 @@ rb_ary_plus(VALUE x, VALUE y)
* call-seq:
* ary.concat(other_ary) -> ary
*
- * Appends the elements of <i>other_ary</i> to +self+.
+ * Appends the elements of +other_ary+ to +self+.
*
* [ "a", "b" ].concat( ["c", "d"] ) #=> [ "a", "b", "c", "d" ]
+ * a = [ 1, 2, 3 ]
+ * a.concat( [ 4, 5 ] )
+ * a #=> [ 1, 2, 3, 4, 5 ]
+ *
+ * See also Array#+.
*/
-
VALUE
rb_ary_concat(VALUE x, VALUE y)
{
@@ -3009,9 +3391,11 @@ rb_ary_concat(VALUE x, VALUE y)
* ary * int -> new_ary
* ary * str -> new_string
*
- * Repetition---With a String argument, equivalent to
- * self.join(str). Otherwise, returns a new array
- * built by concatenating the _int_ copies of +self+.
+ * Repetition --- With a String argument, equivalent to
+ * <code>ary.join(str)</code>.
+ *
+ * Otherwise, returns a new array built by concatenating the +int+ copies of
+ * +self+.
*
*
* [ 1, 2, 3 ] * 3 #=> [ 1, 2, 3, 1, 2, 3, 1, 2, 3 ]
@@ -3069,13 +3453,13 @@ rb_ary_times(VALUE ary, VALUE times)
* call-seq:
* ary.assoc(obj) -> new_ary or nil
*
- * Searches through an array whose elements are also arrays
- * comparing _obj_ with the first element of each contained array
- * using obj.==.
- * Returns the first contained array that matches (that
- * is, the first associated array),
- * or +nil+ if no match is found.
- * See also <code>Array#rassoc</code>.
+ * Searches through an array whose elements are also arrays comparing +obj+
+ * with the first element of each contained array using <code>obj.==</code>.
+ *
+ * Returns the first contained array that matches (that is, the first
+ * associated array), or +nil+ if no match is found.
+ *
+ * See also Array#rassoc
*
* s1 = [ "colors", "red", "blue", "green" ]
* s2 = [ "letters", "a", "b", "c" ]
@@ -3104,10 +3488,14 @@ rb_ary_assoc(VALUE ary, VALUE key)
* call-seq:
* ary.rassoc(obj) -> new_ary or nil
*
- * Searches through the array whose elements are also arrays. Compares
- * _obj_ with the second element of each contained array using
- * <code>==</code>. Returns the first contained array that matches. See
- * also <code>Array#assoc</code>.
+ * Searches through the array whose elements are also arrays.
+ *
+ * Compares +obj+ with the second element of each contained array using
+ * <code>obj.==</code>.
+ *
+ * Returns the first contained array that matches +obj+.
+ *
+ * See also Array#assoc.
*
* a = [ [ 1, "one"], [2, "two"], [3, "three"], ["ii", "two"] ]
* a.rassoc("two") #=> [2, "two"]
@@ -3122,7 +3510,7 @@ rb_ary_rassoc(VALUE ary, VALUE value)
for (i = 0; i < RARRAY_LEN(ary); ++i) {
v = RARRAY_PTR(ary)[i];
- if (TYPE(v) == T_ARRAY &&
+ if (RB_TYPE_P(v, T_ARRAY) &&
RARRAY_LEN(v) > 1 &&
rb_equal(RARRAY_PTR(v)[1], value))
return v;
@@ -3133,12 +3521,32 @@ rb_ary_rassoc(VALUE ary, VALUE value)
static VALUE
recursive_equal(VALUE ary1, VALUE ary2, int recur)
{
- long i;
+ long i, len1;
+ VALUE *p1, *p2;
if (recur) return Qtrue; /* Subtle! */
- for (i=0; i<RARRAY_LEN(ary1); i++) {
- if (!rb_equal(rb_ary_elt(ary1, i), rb_ary_elt(ary2, i)))
- return Qfalse;
+
+ p1 = RARRAY_PTR(ary1);
+ p2 = RARRAY_PTR(ary2);
+ len1 = RARRAY_LEN(ary1);
+
+ for (i = 0; i < len1; i++) {
+ if (*p1 != *p2) {
+ if (rb_equal(*p1, *p2)) {
+ len1 = RARRAY_LEN(ary1);
+ if (len1 != RARRAY_LEN(ary2))
+ return Qfalse;
+ if (len1 < i)
+ return Qtrue;
+ p1 = RARRAY_PTR(ary1) + i;
+ p2 = RARRAY_PTR(ary2) + i;
+ }
+ else {
+ return Qfalse;
+ }
+ }
+ p1++;
+ p2++;
}
return Qtrue;
}
@@ -3147,9 +3555,9 @@ recursive_equal(VALUE ary1, VALUE ary2, int recur)
* call-seq:
* ary == other_ary -> bool
*
- * Equality---Two arrays are equal if they contain the same number
- * of elements and if each element is equal to (according to
- * Object.==) the corresponding element in the other array.
+ * Equality --- Two arrays are equal if they contain the same number of
+ * elements and if each element is equal to (according to Object#==) the
+ * corresponding element in +other_ary+.
*
* [ "a", "c" ] == [ "a", "c", 7 ] #=> false
* [ "a", "c", 7 ] == [ "a", "c", 7 ] #=> true
@@ -3161,7 +3569,7 @@ static VALUE
rb_ary_equal(VALUE ary1, VALUE ary2)
{
if (ary1 == ary2) return Qtrue;
- if (TYPE(ary2) != T_ARRAY) {
+ if (!RB_TYPE_P(ary2, T_ARRAY)) {
if (!rb_respond_to(ary2, rb_intern("to_ary"))) {
return Qfalse;
}
@@ -3188,7 +3596,7 @@ recursive_eql(VALUE ary1, VALUE ary2, int recur)
* call-seq:
* ary.eql?(other) -> true or false
*
- * Returns <code>true</code> if +self+ and _other_ are the same object,
+ * Returns +true+ if +self+ and +other+ are the same object,
* or are both arrays with the same content.
*/
@@ -3196,7 +3604,7 @@ static VALUE
rb_ary_eql(VALUE ary1, VALUE ary2)
{
if (ary1 == ary2) return Qtrue;
- if (TYPE(ary2) != T_ARRAY) return Qfalse;
+ if (!RB_TYPE_P(ary2, T_ARRAY)) return Qfalse;
if (RARRAY_LEN(ary1) != RARRAY_LEN(ary2)) return Qfalse;
return rb_exec_recursive_paired(recursive_eql, ary1, ary2, ary2);
}
@@ -3226,8 +3634,10 @@ recursive_hash(VALUE ary, VALUE dummy, int recur)
* call-seq:
* ary.hash -> fixnum
*
- * Compute a hash-code for this array. Two arrays with the same content
- * will have the same hash code (and will compare using <code>eql?</code>).
+ * Compute a hash-code for this array.
+ *
+ * Two arrays with the same content will have the same hash code (and will
+ * compare using #eql?).
*/
static VALUE
@@ -3238,11 +3648,10 @@ rb_ary_hash(VALUE ary)
/*
* call-seq:
- * ary.include?(obj) -> true or false
+ * ary.include?(object) -> true or false
*
- * Returns <code>true</code> if the given object is present in
- * +self+ (that is, if any object <code>==</code> <i>anObject</i>),
- * <code>false</code> otherwise.
+ * Returns +true+ if the given +object+ is present in +self+ (that is, if any
+ * object <code>==</code> +object+), otherwise returns +false+.
*
* a = [ "a", "b", "c" ]
* a.include?("b") #=> true
@@ -3286,16 +3695,19 @@ recursive_cmp(VALUE ary1, VALUE ary2, int recur)
* call-seq:
* ary <=> other_ary -> -1, 0, +1 or nil
*
- * Comparison---Returns an integer (-1, 0,
- * or +1) if this array is less than, equal to, or greater than
- * <i>other_ary</i>. Each object in each array is compared
- * (using <=>). If any value isn't
- * equal, then that inequality is the return value. If all the
- * values found are equal, then the return is based on a
- * comparison of the array lengths. Thus, two arrays are
- * ``equal'' according to <code>Array#<=></code> if and only if they have
- * the same length and the value of each element is equal to the
- * value of the corresponding element in the other array.
+ * Comparison --- Returns an integer (+-1+, +0+, or <code>+1</code>) if this
+ * array is less than, equal to, or greater than +other_ary+.
+ *
+ * Each object in each array is compared (using the <=> operator).
+ *
+ * Arrays are compared in an "element-wise" manner; the first two elements
+ * that are not equal will determine the return value for the whole
+ * comparison.
+ *
+ * If all the values are equal, then the return is based on a comparison of
+ * the array lengths. Thus, two arrays are "equal" according to Array#<=> if,
+ * and only if, they have the same length and the value of each element is
+ * equal to the value of the corresponding element in the other array.
*
* [ "a", "a", "c" ] <=> [ "a", "b", "c" ] #=> -1
* [ 1, 2, 3, 4, 5, 6 ] <=> [ 1, 2 ] #=> +1
@@ -3381,12 +3793,16 @@ ary_recycle_hash(VALUE hash)
* call-seq:
* ary - other_ary -> new_ary
*
- * Array Difference---Returns a new array that is a copy of
- * the original array, removing any items that also appear in
- * <i>other_ary</i>. (If you need set-like behavior, see the
- * library class Set.)
+ * Array Difference
+ *
+ * Returns a new array that is a copy of the original array, removing any
+ * items that also appear in +other_ary+.
+ *
+ * It compares elements using their hash (returned by the Object#hash method).
*
* [ 1, 1, 2, 2, 3, 3, 4, 5 ] - [ 1, 2, 4 ] #=> [ 3, 3, 5 ]
+ *
+ * If you need set-like behavior, see the library class Set.
*/
static VALUE
@@ -3411,10 +3827,13 @@ rb_ary_diff(VALUE ary1, VALUE ary2)
* call-seq:
* ary & other_ary -> new_ary
*
- * Set Intersection---Returns a new array
- * containing elements common to the two arrays, with no duplicates.
+ * Set Intersection --- Returns a new array containing elements common to the
+ * two arrays, excluding any duplicates.
*
- * [ 1, 1, 3, 5 ] & [ 1, 2, 3 ] #=> [ 1, 3 ]
+ * [ 1, 1, 3, 5 ] & [ 1, 2, 3 ] #=> [ 1, 3 ]
+ * [ 'a', 'b', 'b', 'z' ] & [ 'a', 'b', 'c' ] #=> [ 'a', 'b' ]
+ *
+ * See also Array#uniq.
*/
@@ -3448,11 +3867,12 @@ rb_ary_and(VALUE ary1, VALUE ary2)
* call-seq:
* ary | other_ary -> new_ary
*
- * Set Union---Returns a new array by joining this array with
- * <i>other_ary</i>, removing duplicates.
+ * Set Union --- Returns a new array by joining +ary+ with +other_ary+,
+ * excluding any duplicates.
+ *
+ * [ "a", "b", "c" ] | [ "c", "d", "a" ] #=> [ "a", "b", "c", "d" ]
*
- * [ "a", "b", "c" ] | [ "c", "d", "a" ]
- * #=> [ "a", "b", "c", "d" ]
+ * See also Array#uniq.
*/
static VALUE
@@ -3491,18 +3911,25 @@ push_value(st_data_t key, st_data_t val, st_data_t ary)
/*
* call-seq:
- * ary.uniq! -> ary or nil
+ * ary.uniq! -> ary or nil
+ * ary.uniq! { |item| ... } -> ary or nil
*
* Removes duplicate elements from +self+.
- * Returns <code>nil</code> if no changes are made (that is, no
- * duplicates are found).
+ *
+ * If a block is given, it will use the return value of the block for
+ * comparison.
+ *
+ * Returns +nil+ if no changes are made (that is, no duplicates are found).
*
* a = [ "a", "a", "b", "b", "c" ]
- * a.uniq! #=> ["a", "b", "c"]
+ * a.uniq! # => ["a", "b", "c"]
+ *
* b = [ "a", "b", "c" ]
- * b.uniq! #=> nil
- * c = [ "a:def", "a:xyz", "b:abc", "b:xyz", "c:jkl" ]
- * c.uniq! {|s| s[/^\w+/]} #=> [ "a:def", "b:abc", "c:jkl" ]
+ * b.uniq! # => nil
+ *
+ * c = [["student","sam"], ["student","george"], ["teacher","matz"]]
+ * c.uniq! { |s| s.first } # => [["student", "sam"], ["teacher", "matz"]]
+ *
*/
static VALUE
@@ -3547,14 +3974,22 @@ rb_ary_uniq_bang(VALUE ary)
/*
* call-seq:
- * ary.uniq -> new_ary
+ * ary.uniq -> new_ary
+ * ary.uniq { |item| ... } -> new_ary
*
* Returns a new array by removing duplicate values in +self+.
*
+ * If a block is given, it will use the return value of the block for comparison.
+ *
+ * It compares elements using their hash (provided by the Object#hash method)
+ * then compares hashes with Object#eql?.
+ *
* a = [ "a", "a", "b", "b", "c" ]
- * a.uniq #=> ["a", "b", "c"]
- * c = [ "a:def", "a:xyz", "b:abc", "b:xyz", "c:jkl" ]
- * c.uniq {|s| s[/^\w+/]} #=> [ "a:def", "b:abc", "c:jkl" ]
+ * a.uniq # => ["a", "b", "c"]
+ *
+ * b = [["student","sam"], ["student","george"], ["teacher","matz"]]
+ * b.uniq { |s| s.first } # => [["student", "sam"], ["teacher", "matz"]]
+ *
*/
static VALUE
@@ -3590,8 +4025,8 @@ rb_ary_uniq(VALUE ary)
* ary.compact! -> ary or nil
*
* Removes +nil+ elements from the array.
- * Returns +nil+ if no changes were made, otherwise returns
- * </i>ary</i>.
+ *
+ * Returns +nil+ if no changes were made, otherwise returns the array.
*
* [ "a", nil, "b", nil, "c" ].compact! #=> [ "a", "b", "c" ]
* [ "a", "b", "c" ].compact! #=> nil
@@ -3643,18 +4078,22 @@ rb_ary_compact(VALUE ary)
/*
* call-seq:
- * ary.count -> int
- * ary.count(obj) -> int
+ * ary.count -> int
+ * ary.count(obj) -> int
* ary.count { |item| block } -> int
*
- * Returns the number of elements. If an argument is given, counts
- * the number of elements which equals to <i>obj</i>. If a block is
- * given, counts the number of elements yielding a true value.
+ * Returns the number of elements.
+ *
+ * If an argument is given, counts the number of elements which equal +obj+
+ * using <code>===</code>.
+ *
+ * If a block is given, counts the number of elements for which the block
+ * returns a true value.
*
* ary = [1, 2, 4, 2]
- * ary.count #=> 4
- * ary.count(2) #=> 2
- * ary.count{|x|x%2==0} #=> 3
+ * ary.count #=> 4
+ * ary.count(2) #=> 2
+ * ary.count { |x| x%2 == 0 } #=> 3
*
*/
@@ -3744,13 +4183,15 @@ flatten(VALUE ary, int level, int *modified)
/*
* call-seq:
- * ary.flatten! -> ary or nil
- * ary.flatten!(level) -> array or nil
+ * ary.flatten! -> Array or nil
+ * ary.flatten!(level) -> Array or nil
*
* Flattens +self+ in place.
- * Returns <code>nil</code> if no modifications were made (i.e.,
- * <i>ary</i> contains no subarrays.) If the optional <i>level</i>
- * argument determines the level of recursion to flatten.
+ *
+ * Returns +nil+ if no modifications were made (i.e., the array contains no
+ * subarrays.)
+ *
+ * The optional +level+ argument determines the level of recursion to flatten.
*
* a = [ 1, 2, [3, [4, 5] ] ]
* a.flatten! #=> [1, 2, 3, 4, 5]
@@ -3788,10 +4229,14 @@ rb_ary_flatten_bang(int argc, VALUE *argv, VALUE ary)
* ary.flatten -> new_ary
* ary.flatten(level) -> new_ary
*
- * Returns a new array that is a one-dimensional flattening of this
- * array (recursively). That is, for every element that is an array,
- * extract its elements into the new array. If the optional
- * <i>level</i> argument determines the level of recursion to flatten.
+ * Returns a new array that is a one-dimensional flattening of +self+
+ * (recursively).
+ *
+ * That is, for every element that is an array, extract its elements into
+ * the new array.
+ *
+ * The optional +level+ argument determines the level of recursion to
+ * flatten.
*
* s = [ 1, 2, 3 ] #=> [1, 2, 3]
* t = [ 4, 5, 6, [7, 8] ] #=> [4, 5, 6, [7, 8]]
@@ -3821,7 +4266,7 @@ rb_ary_flatten(int argc, VALUE *argv, VALUE ary)
(argc > 0 && !NIL_P((opts) = rb_check_hash_type(argv[argc-1])) && (--argc, 1))
static VALUE sym_random;
-#define RAND_UPTO(max) (long)(rb_random_real(randgen)*(max))
+#define RAND_UPTO(max) (long)rb_random_ulong_limited((randgen), (max)-1)
/*
* call-seq:
@@ -3829,7 +4274,8 @@ static VALUE sym_random;
* ary.shuffle!(random: rng) -> ary
*
* Shuffles elements in +self+ in place.
- * If +rng+ is given, it will be used as the random number generator.
+ *
+ * The optional +rng+ argument will be used as the random number generator.
*/
static VALUE
@@ -3841,9 +4287,7 @@ rb_ary_shuffle_bang(int argc, VALUE *argv, VALUE ary)
if (OPTHASH_GIVEN_P(opts)) {
randgen = rb_hash_lookup2(opts, sym_random, randgen);
}
- if (argc > 0) {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
- }
+ rb_check_arity(argc, 0, 0);
rb_ary_modify(ary);
i = RARRAY_LEN(ary);
ptr = RARRAY_PTR(ary);
@@ -3868,12 +4312,12 @@ rb_ary_shuffle_bang(int argc, VALUE *argv, VALUE ary)
* ary.shuffle -> new_ary
* ary.shuffle(random: rng) -> new_ary
*
- * Returns a new array with elements of this array shuffled.
+ * Returns a new array with elements of +self+ shuffled.
*
* a = [ 1, 2, 3 ] #=> [1, 2, 3]
* a.shuffle #=> [2, 3, 1]
*
- * If +rng+ is given, it will be used as the random number generator.
+ * The optional +rng+ argument will be used as the random number generator.
*
* a.shuffle(random: Random.new(1)) #=> [1, 3, 2]
*/
@@ -3894,13 +4338,20 @@ rb_ary_shuffle(int argc, VALUE *argv, VALUE ary)
* ary.sample(n) -> new_ary
* ary.sample(n, random: rng) -> new_ary
*
- * Choose a random element or +n+ random elements from the array. The elements
- * are chosen by using random and unique indices into the array in order to
- * ensure that an element doesn't repeat itself unless the array already
- * contained duplicate elements. If the array is empty the first form returns
- * <code>nil</code> and the second form returns an empty array.
+ * Choose a random element or +n+ random elements from the array.
+ *
+ * The elements are chosen by using random and unique indices into the array
+ * in order to ensure that an element doesn't repeat itself unless the array
+ * already contained duplicate elements.
+ *
+ * If the array is empty the first form returns +nil+ and the second form
+ * returns an empty array.
+ *
+ * The optional +rng+ argument will be used as the random number generator.
*
- * If +rng+ is given, it will be used as the random number generator.
+ * a = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
+ * a.sample #=> 7
+ * a.sample(4) #=> [6, 4, 2, 5]
*/
@@ -3910,7 +4361,7 @@ rb_ary_sample(int argc, VALUE *argv, VALUE ary)
VALUE nv, result, *ptr;
VALUE opts, randgen = rb_cRandom;
long n, len, i, j, k, idx[10];
- double rnds[numberof(idx)];
+ long rnds[numberof(idx)];
if (OPTHASH_GIVEN_P(opts)) {
randgen = rb_hash_lookup2(opts, sym_random, randgen);
@@ -3923,11 +4374,11 @@ rb_ary_sample(int argc, VALUE *argv, VALUE ary)
i = 0;
}
else {
- double x = rb_random_real(randgen);
- if ((len = RARRAY_LEN(ary)) == 0) return Qnil;
- i = (long)(x * len);
+ i = RAND_UPTO(len);
+ if ((len = RARRAY_LEN(ary)) <= i) return Qnil;
+ ptr = RARRAY_PTR(ary);
}
- return RARRAY_PTR(ary)[i];
+ return ptr[i];
}
rb_scan_args(argc, argv, "1", &nv);
n = NUM2LONG(nv);
@@ -3935,27 +4386,37 @@ rb_ary_sample(int argc, VALUE *argv, VALUE ary)
if (n > len) n = len;
if (n <= numberof(idx)) {
for (i = 0; i < n; ++i) {
- rnds[i] = rb_random_real(randgen);
+ rnds[i] = RAND_UPTO(len - i);
}
}
+ k = len;
len = RARRAY_LEN(ary);
ptr = RARRAY_PTR(ary);
+ if (len < k) {
+ if (n <= numberof(idx)) {
+ for (i = 0; i < n; ++i) {
+ if (rnds[i] >= len) {
+ return rb_ary_new2(0);
+ }
+ }
+ }
+ }
if (n > len) n = len;
switch (n) {
case 0:
return rb_ary_new2(0);
case 1:
- i = (long)(rnds[0] * len);
+ i = rnds[0];
return rb_ary_new4(1, &ptr[i]);
case 2:
- i = (long)(rnds[0] * len);
- j = (long)(rnds[1] * (len-1));
+ i = rnds[0];
+ j = rnds[1];
if (j >= i) j++;
return rb_ary_new3(2, ptr[i], ptr[j]);
case 3:
- i = (long)(rnds[0] * len);
- j = (long)(rnds[1] * (len-1));
- k = (long)(rnds[2] * (len-2));
+ i = rnds[0];
+ j = rnds[1];
+ k = rnds[2];
{
long l = j, g = i;
if (j >= i) l = i, g = ++j;
@@ -3966,9 +4427,9 @@ rb_ary_sample(int argc, VALUE *argv, VALUE ary)
if (n <= numberof(idx)) {
VALUE *ptr_result;
long sorted[numberof(idx)];
- sorted[0] = idx[0] = (long)(rnds[0] * len);
+ sorted[0] = idx[0] = rnds[0];
for (i=1; i<n; i++) {
- k = (long)(rnds[i] * --len);
+ k = rnds[i];
for (j = 0; j < i; ++j) {
if (k < sorted[j]) break;
++k;
@@ -4001,23 +4462,38 @@ rb_ary_sample(int argc, VALUE *argv, VALUE ary)
return result;
}
+static VALUE
+rb_ary_cycle_size(VALUE self, VALUE args)
+{
+ long mul;
+ VALUE n = Qnil;
+ if (args && (RARRAY_LEN(args) > 0)) {
+ n = RARRAY_PTR(args)[0];
+ }
+ if (RARRAY_LEN(self) == 0) return INT2FIX(0);
+ if (n == Qnil) return DBL2NUM(INFINITY);
+ mul = NUM2LONG(n);
+ if (mul <= 0) return INT2FIX(0);
+ return rb_funcall(rb_ary_length(self), '*', 1, LONG2FIX(mul));
+}
/*
* call-seq:
- * ary.cycle(n=nil) {|obj| block } -> nil
- * ary.cycle(n=nil) -> an_enumerator
+ * ary.cycle(n=nil) { |obj| block } -> nil
+ * ary.cycle(n=nil) -> Enumerator
*
- * Calls <i>block</i> for each element repeatedly _n_ times or
- * forever if none or +nil+ is given. If a non-positive number is
- * given or the array is empty, does nothing. Returns +nil+ if the
- * loop has finished without getting interrupted.
+ * Calls the given block for each element +n+ times or forever if +nil+ is
+ * given.
*
- * If no block is given, an enumerator is returned instead.
+ * Does nothing if a non-positive number is given or the array is empty.
*
+ * Returns +nil+ if the loop has finished without getting interrupted.
+ *
+ * If no block is given, an Enumerator is returned instead.
*
* a = ["a", "b", "c"]
- * a.cycle {|x| puts x } # print, a, b, c, a, b, c,.. forever.
- * a.cycle(2) {|x| puts x } # print, a, b, c, a, b, c.
+ * a.cycle { |x| puts x } # print, a, b, c, a, b, c,.. forever.
+ * a.cycle(2) { |x| puts x } # print, a, b, c, a, b, c.
*
*/
@@ -4029,7 +4505,7 @@ rb_ary_cycle(int argc, VALUE *argv, VALUE ary)
rb_scan_args(argc, argv, "01", &nv);
- RETURN_ENUMERATOR(ary, argc, argv);
+ RETURN_SIZED_ENUMERATOR(ary, argc, argv, rb_ary_cycle_size);
if (NIL_P(nv)) {
n = -1;
}
@@ -4052,7 +4528,9 @@ rb_ary_cycle(int argc, VALUE *argv, VALUE ary)
#define tmpary_discard(a) (ary_discard(a), RBASIC(a)->klass = rb_cArray)
/*
- * Recursively compute permutations of r elements of the set [0..n-1].
+ * Recursively compute permutations of +r+ elements of the set
+ * <code>[0..n-1]</code>.
+ *
* When we have a complete permutation of array indexes, copy the values
* at those indexes into a new array and yield that array.
*
@@ -4096,29 +4574,66 @@ permute0(long n, long r, long *p, long index, char *used, VALUE values)
}
/*
+ * Returns the product of from, from-1, ..., from - how_many + 1.
+ * http://en.wikipedia.org/wiki/Pochhammer_symbol
+ */
+static VALUE
+descending_factorial(long from, long how_many)
+{
+ VALUE cnt = LONG2FIX(how_many >= 0);
+ while(how_many-- > 0) {
+ cnt = rb_funcall(cnt, '*', 1, LONG2FIX(from--));
+ }
+ return cnt;
+}
+
+static VALUE
+binomial_coefficient(long comb, long size)
+{
+ if (comb > size-comb) {
+ comb = size-comb;
+ }
+ if (comb < 0) {
+ return LONG2FIX(0);
+ }
+ return rb_funcall(descending_factorial(size, comb), id_div, 1, descending_factorial(comb, comb));
+}
+
+static VALUE
+rb_ary_permutation_size(VALUE ary, VALUE args)
+{
+ long n = RARRAY_LEN(ary);
+ long k = (args && (RARRAY_LEN(args) > 0)) ? NUM2LONG(RARRAY_PTR(args)[0]) : n;
+
+ return descending_factorial(n, k);
+}
+
+/*
* call-seq:
* ary.permutation { |p| block } -> ary
- * ary.permutation -> an_enumerator
+ * ary.permutation -> Enumerator
* ary.permutation(n) { |p| block } -> ary
- * ary.permutation(n) -> an_enumerator
+ * ary.permutation(n) -> Enumerator
+ *
+ * When invoked with a block, yield all permutations of length +n+ of the
+ * elements of the array, then return the array itself.
*
- * When invoked with a block, yield all permutations of length <i>n</i>
- * of the elements of <i>ary</i>, then return the array itself.
- * If <i>n</i> is not specified, yield all permutations of all elements.
- * The implementation makes no guarantees about the order in which
- * the permutations are yielded.
+ * If +n+ is not specified, yield all permutations of all elements.
*
- * If no block is given, an enumerator is returned instead.
+ * The implementation makes no guarantees about the order in which the
+ * permutations are yielded.
+ *
+ * If no block is given, an Enumerator is returned instead.
*
* Examples:
*
- * a = [1, 2, 3]
- * a.permutation.to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
- * a.permutation(1).to_a #=> [[1],[2],[3]]
- * a.permutation(2).to_a #=> [[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]]
- * a.permutation(3).to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
- * a.permutation(0).to_a #=> [[]] # one permutation of length 0
- * a.permutation(4).to_a #=> [] # no permutations of length 4
+ * a = [1, 2, 3]
+ * a.permutation.to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
+ * a.permutation(1).to_a #=> [[1],[2],[3]]
+ * a.permutation(2).to_a #=> [[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]]
+ * a.permutation(3).to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
+ * a.permutation(0).to_a #=> [[]] # one permutation of length 0
+ * a.permutation(4).to_a #=> [] # no permutations of length 4
*/
static VALUE
@@ -4128,7 +4643,7 @@ rb_ary_permutation(int argc, VALUE *argv, VALUE ary)
long r, n, i;
n = RARRAY_LEN(ary); /* Array length */
- RETURN_ENUMERATOR(ary, argc, argv); /* Return enumerator if no block */
+ RETURN_SIZED_ENUMERATOR(ary, argc, argv, rb_ary_permutation_size); /* Return enumerator if no block */
rb_scan_args(argc, argv, "01", &num);
r = NIL_P(num) ? n : NUM2LONG(num); /* Permutation size from argument */
@@ -4161,17 +4676,27 @@ rb_ary_permutation(int argc, VALUE *argv, VALUE ary)
return ary;
}
+static VALUE
+rb_ary_combination_size(VALUE ary, VALUE args)
+{
+ long n = RARRAY_LEN(ary);
+ long k = NUM2LONG(RARRAY_PTR(args)[0]);
+
+ return binomial_coefficient(k, n);
+}
+
/*
* call-seq:
* ary.combination(n) { |c| block } -> ary
- * ary.combination(n) -> an_enumerator
+ * ary.combination(n) -> Enumerator
+ *
+ * When invoked with a block, yields all combinations of length +n+ of elements
+ * from the array and then returns the array itself.
*
- * When invoked with a block, yields all combinations of length <i>n</i>
- * of elements from <i>ary</i> and then returns <i>ary</i> itself.
- * The implementation makes no guarantees about the order in which
- * the combinations are yielded.
+ * The implementation makes no guarantees about the order in which the
+ * combinations are yielded.
*
- * If no block is given, an enumerator is returned instead.
+ * If no block is given, an Enumerator is returned instead.
*
* Examples:
*
@@ -4191,7 +4716,7 @@ rb_ary_combination(VALUE ary, VALUE num)
long n, i, len;
n = NUM2LONG(num);
- RETURN_ENUMERATOR(ary, 1, &num);
+ RETURN_SIZED_ENUMERATOR(ary, 1, &num, rb_ary_combination_size);
len = RARRAY_LEN(ary);
if (n < 0 || len < n) {
/* yield nothing */
@@ -4235,8 +4760,9 @@ rb_ary_combination(VALUE ary, VALUE num)
}
/*
- * Recursively compute repeated permutations of r elements of the set
- * [0..n-1].
+ * Recursively compute repeated permutations of +r+ elements of the set
+ * <code>[0..n-1]</code>.
+ *
* When we have a complete repeated permutation of array indexes, copy the
* values at those indexes into a new array and yield that array.
*
@@ -4273,17 +4799,31 @@ rpermute0(long n, long r, long *p, long index, VALUE values)
}
}
+static VALUE
+rb_ary_repeated_permutation_size(VALUE ary, VALUE args)
+{
+ long n = RARRAY_LEN(ary);
+ long k = NUM2LONG(RARRAY_PTR(args)[0]);
+
+ if (k < 0) {
+ return LONG2FIX(0);
+ }
+
+ return rb_funcall(LONG2NUM(n), id_power, 1, LONG2NUM(k));
+}
+
/*
* call-seq:
* ary.repeated_permutation(n) { |p| block } -> ary
- * ary.repeated_permutation(n) -> an_enumerator
+ * ary.repeated_permutation(n) -> Enumerator
+ *
+ * When invoked with a block, yield all repeated permutations of length +n+ of
+ * the elements of the array, then return the array itself.
*
- * When invoked with a block, yield all repeated permutations of length
- * <i>n</i> of the elements of <i>ary</i>, then return the array itself.
- * The implementation makes no guarantees about the order in which
- * the repeated permutations are yielded.
+ * The implementation makes no guarantees about the order in which the repeated
+ * permutations are yielded.
*
- * If no block is given, an enumerator is returned instead.
+ * If no block is given, an Enumerator is returned instead.
*
* Examples:
*
@@ -4301,7 +4841,7 @@ rb_ary_repeated_permutation(VALUE ary, VALUE num)
long r, n, i;
n = RARRAY_LEN(ary); /* Array length */
- RETURN_ENUMERATOR(ary, 1, &num); /* Return enumerator if no block */
+ RETURN_SIZED_ENUMERATOR(ary, 1, &num, rb_ary_repeated_permutation_size); /* Return Enumerator if no block */
r = NUM2LONG(num); /* Permutation size from argument */
if (r < 0) {
@@ -4352,30 +4892,41 @@ rcombinate0(long n, long r, long *p, long index, long rest, VALUE values)
}
}
+static VALUE
+rb_ary_repeated_combination_size(VALUE ary, VALUE args)
+{
+ long n = RARRAY_LEN(ary);
+ long k = NUM2LONG(RARRAY_PTR(args)[0]);
+ if (k == 0) {
+ return LONG2FIX(1);
+ }
+ return binomial_coefficient(k, n + k - 1);
+}
+
/*
* call-seq:
* ary.repeated_combination(n) { |c| block } -> ary
- * ary.repeated_combination(n) -> an_enumerator
+ * ary.repeated_combination(n) -> Enumerator
*
- * When invoked with a block, yields all repeated combinations of
- * length <i>n</i> of elements from <i>ary</i> and then returns
- * <i>ary</i> itself.
- * The implementation makes no guarantees about the order in which
- * the repeated combinations are yielded.
+ * When invoked with a block, yields all repeated combinations of length +n+ of
+ * elements from the array and then returns the array itself.
*
- * If no block is given, an enumerator is returned instead.
+ * The implementation makes no guarantees about the order in which the repeated
+ * combinations are yielded.
+ *
+ * If no block is given, an Enumerator is returned instead.
*
* Examples:
*
- * a = [1, 2, 3]
- * a.repeated_combination(1).to_a #=> [[1], [2], [3]]
- * a.repeated_combination(2).to_a #=> [[1,1],[1,2],[1,3],[2,2],[2,3],[3,3]]
- * a.repeated_combination(3).to_a #=> [[1,1,1],[1,1,2],[1,1,3],[1,2,2],[1,2,3],
- * # [1,3,3],[2,2,2],[2,2,3],[2,3,3],[3,3,3]]
- * a.repeated_combination(4).to_a #=> [[1,1,1,1],[1,1,1,2],[1,1,1,3],[1,1,2,2],[1,1,2,3],
- * # [1,1,3,3],[1,2,2,2],[1,2,2,3],[1,2,3,3],[1,3,3,3],
- * # [2,2,2,2],[2,2,2,3],[2,2,3,3],[2,3,3,3],[3,3,3,3]]
- * a.repeated_combination(0).to_a #=> [[]] # one combination of length 0
+ * a = [1, 2, 3]
+ * a.repeated_combination(1).to_a #=> [[1], [2], [3]]
+ * a.repeated_combination(2).to_a #=> [[1,1],[1,2],[1,3],[2,2],[2,3],[3,3]]
+ * a.repeated_combination(3).to_a #=> [[1,1,1],[1,1,2],[1,1,3],[1,2,2],[1,2,3],
+ * # [1,3,3],[2,2,2],[2,2,3],[2,3,3],[3,3,3]]
+ * a.repeated_combination(4).to_a #=> [[1,1,1,1],[1,1,1,2],[1,1,1,3],[1,1,2,2],[1,1,2,3],
+ * # [1,1,3,3],[1,2,2,2],[1,2,2,3],[1,2,3,3],[1,3,3,3],
+ * # [2,2,2,2],[2,2,2,3],[2,2,3,3],[2,3,3,3],[3,3,3,3]]
+ * a.repeated_combination(0).to_a #=> [[]] # one combination of length 0
*
*/
@@ -4385,7 +4936,7 @@ rb_ary_repeated_combination(VALUE ary, VALUE num)
long n, i, len;
n = NUM2LONG(num); /* Combination size from argument */
- RETURN_ENUMERATOR(ary, 1, &num); /* Return enumerator if no block */
+ RETURN_SIZED_ENUMERATOR(ary, 1, &num, rb_ary_repeated_combination_size); /* Return enumerator if no block */
len = RARRAY_LEN(ary);
if (n < 0) {
/* yield nothing */
@@ -4419,12 +4970,13 @@ rb_ary_repeated_combination(VALUE ary, VALUE num)
* ary.product(other_ary, ...) -> new_ary
* ary.product(other_ary, ...) { |p| block } -> ary
*
- * Returns an array of all combinations of elements from all arrays,
- * The length of the returned array is the product of the length
- * of +self+ and the argument arrays.
- * If given a block, <i>product</i> will yield all combinations
- * and return +self+ instead.
+ * Returns an array of all combinations of elements from all arrays.
+ *
+ * The length of the returned array is the product of the length of +self+ and
+ * the argument arrays.
*
+ * If given a block, #product will yield all combinations and return +self+
+ * instead.
*
* [1,2,3].product([4,5]) #=> [[1,4],[1,5],[2,4],[2,5],[3,4],[3,5]]
* [1,2].product([1,2]) #=> [[1,1],[1,2],[2,1],[2,2]]
@@ -4528,7 +5080,11 @@ done:
* call-seq:
* ary.take(n) -> new_ary
*
- * Returns first n elements from <i>ary</i>.
+ * Returns first +n+ elements from the array.
+ *
+ * If a negative number is given, raises an ArgumentError.
+ *
+ * See also Array#drop
*
* a = [1, 2, 3, 4, 5, 0]
* a.take(3) #=> [1, 2, 3]
@@ -4547,16 +5103,18 @@ rb_ary_take(VALUE obj, VALUE n)
/*
* call-seq:
- * ary.take_while {|arr| block } -> new_ary
- * ary.take_while -> an_enumerator
+ * ary.take_while { |arr| block } -> new_ary
+ * ary.take_while -> Enumerator
+ *
+ * Passes elements to the block until the block returns +nil+ or +false+, then
+ * stops iterating and returns an array of all prior elements.
*
- * Passes elements to the block until the block returns +nil+ or +false+,
- * then stops iterating and returns an array of all prior elements.
+ * If no block is given, an Enumerator is returned instead.
*
- * If no block is given, an enumerator is returned instead.
+ * See also Array#drop_while
*
* a = [1, 2, 3, 4, 5, 0]
- * a.take_while {|i| i < 3 } #=> [1, 2]
+ * a.take_while { |i| i < 3 } #=> [1, 2]
*
*/
@@ -4576,8 +5134,12 @@ rb_ary_take_while(VALUE ary)
* call-seq:
* ary.drop(n) -> new_ary
*
- * Drops first n elements from +ary+ and returns the rest of
- * the elements in an array.
+ * Drops first +n+ elements from +ary+ and returns the rest of the elements in
+ * an array.
+ *
+ * If a negative number is given, raises an ArgumentError.
+ *
+ * See also Array#take
*
* a = [1, 2, 3, 4, 5, 0]
* a.drop(3) #=> [4, 5, 0]
@@ -4600,14 +5162,16 @@ rb_ary_drop(VALUE ary, VALUE n)
/*
* call-seq:
- * ary.drop_while {|arr| block } -> new_ary
- * ary.drop_while -> an_enumerator
+ * ary.drop_while { |arr| block } -> new_ary
+ * ary.drop_while -> Enumerator
+ *
+ * Drops elements up to, but not including, the first element for which the
+ * block returns +nil+ or +false+ and returns an array containing the
+ * remaining elements.
*
- * Drops elements up to, but not including, the first element for
- * which the block returns +nil+ or +false+ and returns an array
- * containing the remaining elements.
+ * If no block is given, an Enumerator is returned instead.
*
- * If no block is given, an enumerator is returned instead.
+ * See also Array#take_while
*
* a = [1, 2, 3, 4, 5, 0]
* a.drop_while {|i| i < 3 } #=> [3, 4, 5, 0]
@@ -4626,13 +5190,233 @@ rb_ary_drop_while(VALUE ary)
return rb_ary_drop(ary, LONG2FIX(i));
}
-
-
-/* Arrays are ordered, integer-indexed collections of any object.
- * Array indexing starts at 0, as in C or Java. A negative index is
- * assumed to be relative to the end of the array---that is, an index of -1
- * indicates the last element of the array, -2 is the next to last
- * element in the array, and so on.
+/*
+ * Arrays are ordered, integer-indexed collections of any object.
+ *
+ * Array indexing starts at 0, as in C or Java. A negative index is assumed
+ * to be relative to the end of the array---that is, an index of -1 indicates
+ * the last element of the array, -2 is the next to last element in the
+ * array, and so on.
+ *
+ * == Creating Arrays
+ *
+ * A new array can be created by using the literal constructor
+ * <code>[]</code>. Arrays can contain different types of objects. For
+ * example, the array below contains an Integer, a String and a Float:
+ *
+ * ary = [1, "two", 3.0] #=> [1, "two", 3.0]
+ *
+ * An array can also be created by explicitly calling Array.new with zero, one
+ * (the initial size of the Array) or two arguments (the initial size and a
+ * default object).
+ *
+ * ary = Array.new #=> []
+ * Array.new(3) #=> [nil, nil, nil]
+ * Array.new(3, true) #=> [0, 0, 0]
+ *
+ * Note that the second argument populates the array with references to the
+ * same object. Therefore, it is only recommended in cases when you need to
+ * instantiate arrays with natively immutable objects such as Symbols,
+ * numbers, true or false.
+ *
+ * To create an array with separate objects a block can be passed instead.
+ * This method is safe to use with mutable objects such as hashes, strings or
+ * other arrays:
+ *
+ * Array.new(4) { Hash.new } #=> [{}, {}, {}, {}]
+ *
+ * This is also a quick way to build up multi-dimensional arrays:
+ *
+ * empty_table = Array.new(3) { Array.new(3) }
+ * #=> [[nil, nil, nil], [nil, nil, nil], [nil, nil, nil]]
+ *
+ * == Example Usage
+ *
+ * In addition to the methods it mixes in through the Enumerable module, the
+ * Array class has proprietary methods for accessing, searching and otherwise
+ * manipulating arrays.
+ *
+ * Some of the more common ones are illustrated below.
+ *
+ * == Accessing Elements
+ *
+ * Elements in an array can be retrieved using the Array#[] method. It can
+ * take a single integer argument (a numeric index), a pair of arguments
+ * (start and length) or a range.
+ *
+ * arr = [1, 2, 3, 4, 5, 6]
+ * arr[2] #=> 3
+ * arr[100] #=> nil
+ * arr[-3] #=> 4
+ * arr[2, 3] #=> [3, 4, 5]
+ * arr[1..4] #=> [2, 3, 4, 5]
+ *
+ * Another way to access a particular array element is by using the #at method
+ *
+ * arr.at(0) #=> 1
+ *
+ * The #slice method works in an identical manner to Array#[].
+ *
+ * To raise an error for indices outside of the array bounds or else to
+ * provide a default value when that happens, you can use #fetch.
+ *
+ * arr = ['a', 'b', 'c', 'd', 'e', 'f']
+ * arr.fetch(100) #=> IndexError: index 100 outside of array bounds: -6...6
+ * arr.fetch(100, "oops") #=> "oops"
+ *
+ * The special methods #first and #last will return the first and last
+ * elements of an array, respectively.
+ *
+ * arr.first #=> 1
+ * arr.last #=> 6
+ *
+ * To return the first +n+ elements of an array, use #take
+ *
+ * arr.take(3) #=> [1, 2, 3]
+ *
+ * #drop does the opposite of #take, by returning the elements after +n+
+ * elements have been dropped:
+ *
+ * arr.drop(3) #=> [4, 5, 6]
+ *
+ * == Obtaining Information about an Array
+ *
+ * Arrays keep track of their own length at all times. To query an array
+ * about the number of elements it contains, use #length, #count or #size.
+ *
+ * browsers = ['Chrome', 'Firefox', 'Safari', 'Opera', 'IE']
+ * browsers.length #=> 5
+ * browsers.count #=> 5
+ *
+ * To check whether an array contains any elements at all
+ *
+ * browsers.empty? #=> false
+ *
+ * To check whether a particular item is included in the array
+ *
+ * browsers.include?('Konqueror') #=> false
+ *
+ * == Adding Items to Arrays
+ *
+ * Items can be added to the end of an array by using either #push or #<<
+ *
+ * arr = [1, 2, 3, 4]
+ * arr.push(5) #=> [1, 2, 3, 4, 5]
+ * arr << 6 #=> [1, 2, 3, 4, 5, 6]
+ *
+ * #unshift will add a new item to the beginning of an array.
+ *
+ * arr.unshift(0) #=> [0, 1, 2, 3, 4, 5, 6]
+ *
+ * With #insert you can add a new element to an array at any position.
+ *
+ * arr.insert(3, 'apple') #=> [0, 1, 2, 'apple', 3, 4, 5, 6]
+ *
+ * Using the #insert method, you can also insert multiple values at once:
+ *
+ * arr.insert(3, 'orange', 'pear', 'grapefruit')
+ * #=> [0, 1, 2, "orange", "pear", "grapefruit", "apple", 3, 4, 5, 6]
+ *
+ * == Removing Items from an Array
+ *
+ * The method #pop removes the last element in an array and returns it:
+ *
+ * arr = [1, 2, 3, 4, 5, 6]
+ * arr.pop #=> 6
+ * arr #=> [1, 2, 3, 4, 5]
+ *
+ * To retrieve and at the same time remove the first item, use #shift:
+ *
+ * arr.shift #=> 1
+ * arr #=> [2, 3, 4, 5]
+ *
+ * To delete an element at a particular index:
+ *
+ * arr.delete_at(2) #=> 4
+ * arr #=> [2, 3, 5]
+ *
+ * To delete a particular element anywhere in an array, use #delete:
+ *
+ * arr = [1, 2, 2, 3]
+ * arr.delete(2) #=> [1, 3]
+ *
+ * A useful method if you need to remove +nil+ values from an array is
+ * #compact:
+ *
+ * arr = ['foo', 0, nil, 'bar', 7, 'baz', nil]
+ * arr.compact #=> ['foo', 0, 'bar', 7, 'baz']
+ * arr #=> ['foo', 0, nil, 'bar', 7, 'baz', nil]
+ * arr.compact! #=> ['foo', 0, 'bar', 7, 'baz']
+ * arr #=> ['foo', 0, 'bar', 7, 'baz']
+ *
+ * Another common need is to remove duplicate elements from an array.
+ *
+ * It has the non-destructive #uniq, and destructive method #uniq!
+ *
+ * arr = [2, 5, 6, 556, 6, 6, 8, 9, 0, 123, 556]
+ * arr.uniq #=> [2, 5, 6, 556, 8, 9, 0, 123]
+ *
+ * == Iterating over Arrays
+ *
+ * Like all classes that include the Enumerable module, Array has an each
+ * method, which defines what elements should be iterated over and how. In
+ * case of Array's #each, all elements in the Array instance are yielded to
+ * the supplied block in sequence.
+ *
+ * Note that this operation leaves the array unchanged.
+ *
+ * arr = [1, 2, 3, 4, 5]
+ * arr.each { |a| print a -= 10, " " }
+ * # prints: -9 -8 -7 -6 -5
+ * #=> [1, 2, 3, 4, 5]
+ *
+ * Another sometimes useful iterator is #reverse_each which will iterate over
+ * the elements in the array in reverse order.
+ *
+ * words = %w[rats live on no evil star]
+ * str = ""
+ * words.reverse_each { |word| str += "#{word.reverse} " }
+ * str #=> "rats live on no evil star "
+ *
+ * The #map method can be used to create a new array based on the original
+ * array, but with the values modified by the supplied block:
+ *
+ * arr.map { |a| 2*a } #=> [2, 4, 6, 8, 10]
+ * arr #=> [1, 2, 3, 4, 5]
+ * arr.map! { |a| a**2 } #=> [1, 4, 9, 16, 25]
+ * arr #=> [1, 4, 9, 16, 25]
+ *
+ * == Selecting Items from an Array
+ *
+ * Elements can be selected from an array according to criteria defined in a
+ * block. The selection can happen in a destructive or a non-destructive
+ * manner. While the destructive operations will modify the array they were
+ * called on, the non-destructive methods usually return a new array with the
+ * selected elements, but leave the original array unchanged.
+ *
+ * === Non-destructive Selection
+ *
+ * arr = [1, 2, 3, 4, 5, 6]
+ * arr.select { |a| a > 3 } #=> [4, 5, 6]
+ * arr.reject { |a| a < 3 } #=> [4, 5, 6]
+ * arr.drop_while { |a| a < 4 } #=> [4, 5, 6]
+ * arr #=> [1, 2, 3, 4, 5, 6]
+ *
+ * === Destructive Selection
+ *
+ * #select! and #reject! are the corresponding destructive methods to #select
+ * and #reject
+ *
+ * Similar to #select vs. #reject, #delete_if and #keep_if have the exact
+ * opposite result when supplied with the same block:
+ *
+ * arr.delete_if { |a| a < 4 } #=> [4, 5, 6]
+ * arr #=> [4, 5, 6]
+ *
+ * arr = [1, 2, 3, 4, 5, 6]
+ * arr.keep_if { |a| a < 4 } #=> [1, 2, 3]
+ * arr #=> [1, 2, 3]
+ *
*/
void
@@ -4644,7 +5428,7 @@ Init_Array(void)
rb_cArray = rb_define_class("Array", rb_cObject);
rb_include_module(rb_cArray, rb_mEnumerable);
- rb_define_alloc_func(rb_cArray, ary_alloc);
+ rb_define_alloc_func(rb_cArray, empty_ary_alloc);
rb_define_singleton_method(rb_cArray, "[]", rb_ary_s_create, -1);
rb_define_singleton_method(rb_cArray, "try_convert", rb_ary_s_try_convert, 1);
rb_define_method(rb_cArray, "initialize", rb_ary_initialize, -1);
@@ -4745,7 +5529,10 @@ Init_Array(void)
rb_define_method(rb_cArray, "take_while", rb_ary_take_while, 0);
rb_define_method(rb_cArray, "drop", rb_ary_drop, 1);
rb_define_method(rb_cArray, "drop_while", rb_ary_drop_while, 0);
+ rb_define_method(rb_cArray, "bsearch", rb_ary_bsearch, 0);
id_cmp = rb_intern("<=>");
sym_random = ID2SYM(rb_intern("random"));
+ id_div = rb_intern("div");
+ id_power = rb_intern("**");
}
diff --git a/atomic.h b/atomic.h
deleted file mode 100644
index 5b3fb99024..0000000000
--- a/atomic.h
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef RUBY_ATOMIC_H
-#define RUBY_ATOMIC_H
-
-#ifdef _WIN32
-#if defined _MSC_VER && _MSC_VER > 1200
-#pragma intrinsic(_InterlockedOr)
-#endif
-typedef LONG rb_atomic_t;
-
-# define ATOMIC_SET(var, val) InterlockedExchange(&(var), (val))
-# define ATOMIC_INC(var) InterlockedIncrement(&(var))
-# define ATOMIC_DEC(var) InterlockedDecrement(&(var))
-#if defined __GNUC__
-# define ATOMIC_OR(var, val) __asm__("lock\n\t" "orl\t%1, %0" : "=m"(var) : "Ir"(val))
-#elif defined _MSC_VER && _MSC_VER <= 1200
-# define ATOMIC_OR(var, val) rb_w32_atomic_or(&(var), (val))
-static inline void
-rb_w32_atomic_or(volatile rb_atomic_t *var, rb_atomic_t val)
-{
-#ifdef _M_IX86
- __asm mov eax, var;
- __asm mov ecx, val;
- __asm lock or [eax], ecx;
-#else
-#error unsupported architecture
-#endif
-}
-#else
-# define ATOMIC_OR(var, val) _InterlockedOr(&(var), (val))
-#endif
-# define ATOMIC_EXCHANGE(var, val) InterlockedExchange(&(var), (val))
-
-#elif defined HAVE_GCC_ATOMIC_BUILTINS
-/* @shyouhei hack to support atomic operations in case of gcc. Gcc
- * has its own pseudo-insns to support them. See info, or
- * http://gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html */
-
-typedef unsigned int rb_atomic_t; /* Anything OK */
-# define ATOMIC_SET(var, val) __sync_lock_test_and_set(&(var), (val))
-# define ATOMIC_INC(var) __sync_fetch_and_add(&(var), 1)
-# define ATOMIC_DEC(var) __sync_fetch_and_sub(&(var), 1)
-# define ATOMIC_OR(var, val) __sync_or_and_fetch(&(var), (val))
-# define ATOMIC_EXCHANGE(var, val) __sync_lock_test_and_set(&(var), (val))
-
-#else
-typedef int rb_atomic_t;
-extern rb_atomic_t ruby_atomic_exchange(rb_atomic_t *ptr, rb_atomic_t val);
-
-# define ATOMIC_SET(var, val) ((var) = (val))
-# define ATOMIC_INC(var) (++(var))
-# define ATOMIC_DEC(var) (--(var))
-# define ATOMIC_OR(var, val) ((var) |= (val))
-# define ATOMIC_EXCHANGE(var, val) ruby_atomic_exchange(&(var), (val))
-#endif
-
-#endif /* RUBY_ATOMIC_H */
diff --git a/benchmark/bm_app_mandelbrot.rb b/benchmark/bm_app_mandelbrot.rb
index 89069db7ab..801b75e8e2 100644
--- a/benchmark/bm_app_mandelbrot.rb
+++ b/benchmark/bm_app_mandelbrot.rb
@@ -3,7 +3,7 @@ require 'complex'
def mandelbrot? z
i = 0
while i<100
- i+=1
+ i += 1
z = z * z
return false if z.abs > 2
end
diff --git a/benchmark/bm_app_raise.rb b/benchmark/bm_app_raise.rb
index 01d2ae3219..5db8f95d50 100644
--- a/benchmark/bm_app_raise.rb
+++ b/benchmark/bm_app_raise.rb
@@ -1,6 +1,6 @@
-i=0
+i = 0
while i<300000
- i+=1
+ i += 1
begin
raise
rescue
diff --git a/benchmark/bm_app_strconcat.rb b/benchmark/bm_app_strconcat.rb
index 7b2f2da5a7..7eed7c1aed 100644
--- a/benchmark/bm_app_strconcat.rb
+++ b/benchmark/bm_app_strconcat.rb
@@ -1,5 +1,5 @@
-i=0
+i = 0
while i<2_000_000
"#{1+1} #{1+1} #{1+1}"
- i+=1
+ i += 1
end
diff --git a/benchmark/bm_io_select2.rb b/benchmark/bm_io_select2.rb
index 7b167af774..10e37d71b2 100644
--- a/benchmark/bm_io_select2.rb
+++ b/benchmark/bm_io_select2.rb
@@ -2,7 +2,11 @@
ios = []
nr = 1000000
-max = Process.getrlimit(Process::RLIMIT_NOFILE)[0]
+if defined?(Process::RLIMIT_NOFILE)
+ max = Process.getrlimit(Process::RLIMIT_NOFILE)[0]
+else
+ max = 64
+end
puts "max fd: #{max} (results not apparent with <= 1024 max fd)"
((max / 2) - 10).times do
diff --git a/benchmark/bm_io_select3.rb b/benchmark/bm_io_select3.rb
index fcdbb96e0e..7d0ba1f092 100644
--- a/benchmark/bm_io_select3.rb
+++ b/benchmark/bm_io_select3.rb
@@ -2,7 +2,11 @@
ios = []
nr = 100
-max = Process.getrlimit(Process::RLIMIT_NOFILE)[0]
+if defined?(Process::RLIMIT_NOFILE)
+ max = Process.getrlimit(Process::RLIMIT_NOFILE)[0]
+else
+ max = 64
+end
puts "max fd: #{max} (results not apparent with <= 1024 max fd)"
(max - 10).times do
diff --git a/benchmark/bm_loop_whileloop.rb b/benchmark/bm_loop_whileloop.rb
index 43d35e1131..0072822c06 100644
--- a/benchmark/bm_loop_whileloop.rb
+++ b/benchmark/bm_loop_whileloop.rb
@@ -1,4 +1,4 @@
-i=0
+i = 0
while i<30_000_000 # benchmark loop 1
- i+=1
+ i += 1
end
diff --git a/benchmark/bm_loop_whileloop2.rb b/benchmark/bm_loop_whileloop2.rb
index e514989661..47d02dffc4 100644
--- a/benchmark/bm_loop_whileloop2.rb
+++ b/benchmark/bm_loop_whileloop2.rb
@@ -1,4 +1,4 @@
-i=0
+i = 0
while i< 6_000_000 # benchmark loop 2
- i+=1
+ i += 1
end
diff --git a/benchmark/bm_so_concatenate.rb b/benchmark/bm_so_concatenate.rb
index 56b9410632..873214de7c 100644
--- a/benchmark/bm_so_concatenate.rb
+++ b/benchmark/bm_so_concatenate.rb
@@ -5,9 +5,9 @@
# based on code from Aristarkh A Zagorodnikov and Dat Nguyen
STUFF = "hello\n"
-i=0
+i = 0
while i<10
- i+=1
+ i += 1
hello = ''
4_000_000.times do |e|
hello << STUFF
diff --git a/benchmark/bm_so_exception.rb b/benchmark/bm_so_exception.rb
index d8b461290c..deb003a594 100644
--- a/benchmark/bm_so_exception.rb
+++ b/benchmark/bm_so_exception.rb
@@ -56,6 +56,6 @@ end
i = 1
max = NUM+1
while i < max
- i+=1
+ i += 1
some_function(i+1)
end
diff --git a/benchmark/bm_so_lists.rb b/benchmark/bm_so_lists.rb
index f8d26797aa..e8f4a2a5f7 100644
--- a/benchmark/bm_so_lists.rb
+++ b/benchmark/bm_so_lists.rb
@@ -40,7 +40,7 @@ end
i = 0
while i<NUM
- i+=1
+ i += 1
result = test_lists()
end
diff --git a/benchmark/bm_so_nsieve_bits.rb b/benchmark/bm_so_nsieve_bits.rb
index 019b8b6382..6f958ee44e 100644
--- a/benchmark/bm_so_nsieve_bits.rb
+++ b/benchmark/bm_so_nsieve_bits.rb
@@ -1,4 +1,5 @@
#!/usr/bin/ruby
+#coding: us-ascii
#
# The Great Computer Language Shootout
# http://shootout.alioth.debian.org/
diff --git a/benchmark/bm_so_random.rb b/benchmark/bm_so_random.rb
index 57f700b863..a66b9e8e63 100644
--- a/benchmark/bm_so_random.rb
+++ b/benchmark/bm_so_random.rb
@@ -12,9 +12,9 @@ end
N = 3_000_000
-i=0
+i = 0
while i<N
- i+=1
+ i +=1
gen_random(100.0)
end
# "%.9f" % gen_random(100.0)
diff --git a/benchmark/bm_so_sieve.rb b/benchmark/bm_so_sieve.rb
index 3f1b138bd1..43dc302648 100644
--- a/benchmark/bm_so_sieve.rb
+++ b/benchmark/bm_so_sieve.rb
@@ -4,12 +4,12 @@ count = i = j = 0
flags0 = Array.new(8192,1)
k = 0
while k < num
- k+=1
+ k += 1
count = 0
flags = flags0.dup
i = 2
while i<8192
- i+=1
+ i += 1
if flags[i]
# remove all multiples of prime: i
j = i*i
diff --git a/benchmark/bm_vm1_attr_ivar.rb b/benchmark/bm_vm1_attr_ivar.rb
new file mode 100644
index 0000000000..16906f3605
--- /dev/null
+++ b/benchmark/bm_vm1_attr_ivar.rb
@@ -0,0 +1,14 @@
+class C
+ attr_reader :a, :b
+ def initialize
+ @a = nil
+ @b = nil
+ end
+end
+obj = C.new
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ j = obj.a
+ k = obj.b
+end
diff --git a/benchmark/bm_vm1_attr_ivar_set.rb b/benchmark/bm_vm1_attr_ivar_set.rb
new file mode 100644
index 0000000000..7e7a6b48c0
--- /dev/null
+++ b/benchmark/bm_vm1_attr_ivar_set.rb
@@ -0,0 +1,14 @@
+class C
+ attr_accessor :a, :b
+ def initialize
+ @a = nil
+ @b = nil
+ end
+end
+obj = C.new
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ obj.a = 1
+ obj.b = 2
+end
diff --git a/benchmark/bm_vm1_block.rb b/benchmark/bm_vm1_block.rb
index 0a97883974..a9f56b15ea 100644
--- a/benchmark/bm_vm1_block.rb
+++ b/benchmark/bm_vm1_block.rb
@@ -2,9 +2,9 @@ def m
yield
end
-i=0
+i = 0
while i<30_000_000 # while loop 1
- i+=1
+ i += 1
m{
}
end
diff --git a/benchmark/bm_vm1_const.rb b/benchmark/bm_vm1_const.rb
index 066916dc31..ac59ebccf1 100644
--- a/benchmark/bm_vm1_const.rb
+++ b/benchmark/bm_vm1_const.rb
@@ -2,7 +2,7 @@ Const = 1
i = 0
while i<30_000_000 # while loop 1
- i+= 1
+ i += 1
j = Const
k = Const
end
diff --git a/benchmark/bm_vm1_ensure.rb b/benchmark/bm_vm1_ensure.rb
index b1948f7621..a1596145f2 100644
--- a/benchmark/bm_vm1_ensure.rb
+++ b/benchmark/bm_vm1_ensure.rb
@@ -1,6 +1,6 @@
-i=0
+i = 0
while i<30_000_000 # benchmark loop 1
- i+=1
+ i += 1
begin
begin
ensure
diff --git a/benchmark/bm_vm1_float_simple.rb b/benchmark/bm_vm1_float_simple.rb
new file mode 100644
index 0000000000..d4581439ff
--- /dev/null
+++ b/benchmark/bm_vm1_float_simple.rb
@@ -0,0 +1,7 @@
+i = 0.0; f = 0.0
+while i<30_000_000
+ i += 1
+ f += 0.1; f -= 0.1
+ f += 0.1; f -= 0.1
+ f += 0.1; f -= 0.1
+end
diff --git a/benchmark/bm_vm1_ivar.rb b/benchmark/bm_vm1_ivar.rb
index 3ba56427f4..68a73cf92f 100644
--- a/benchmark/bm_vm1_ivar.rb
+++ b/benchmark/bm_vm1_ivar.rb
@@ -2,7 +2,7 @@
i = 0
while i<30_000_000 # while loop 1
- i+= 1
+ i += 1
j = @a
k = @a
end
diff --git a/benchmark/bm_vm1_ivar_set.rb b/benchmark/bm_vm1_ivar_set.rb
index c8076c6ab6..bd81b06c34 100644
--- a/benchmark/bm_vm1_ivar_set.rb
+++ b/benchmark/bm_vm1_ivar_set.rb
@@ -1,6 +1,6 @@
i = 0
while i<30_000_000 # while loop 1
- i+= 1
+ i += 1
@a = 1
@b = 2
end
diff --git a/benchmark/bm_vm1_length.rb b/benchmark/bm_vm1_length.rb
index ccb773278f..353de3ab0e 100644
--- a/benchmark/bm_vm1_length.rb
+++ b/benchmark/bm_vm1_length.rb
@@ -1,8 +1,8 @@
a = 'abc'
b = [1, 2, 3]
-i=0
+i = 0
while i<30_000_000 # while loop 1
- i+=1
+ i += 1
a.length
b.length
end
diff --git a/benchmark/bm_vm1_lvar_init.rb b/benchmark/bm_vm1_lvar_init.rb
new file mode 100644
index 0000000000..36f2068811
--- /dev/null
+++ b/benchmark/bm_vm1_lvar_init.rb
@@ -0,0 +1,18 @@
+def m v
+ unless v
+ # unreachable code
+ v1 = v2 = v3 = v4 = v5 = v6 = v7 = v8 = v9 = v10 =
+ v11 = v12 = v13 = v14 = v15 = v16 = v17 = v18 = v19 = v20 =
+ v21 = v22 = v23 = v24 = v25 = v26 = v27 = v28 = v29 = v30 =
+ v31 = v32 = v33 = v34 = v35 = v36 = v37 = v38 = v39 = v40 =
+ v41 = v42 = v43 = v44 = v45 = v46 = v47 = v48 = v49 = v50 = 1
+ end
+end
+
+i = 0
+
+while i<30_000_000 # while loop 1
+ i += 1
+ m i
+end
+
diff --git a/benchmark/bm_vm1_lvar_set.rb b/benchmark/bm_vm1_lvar_set.rb
new file mode 100644
index 0000000000..222e864134
--- /dev/null
+++ b/benchmark/bm_vm1_lvar_set.rb
@@ -0,0 +1,5 @@
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ a = b = c = d = e = f = g = h = j = k = l = m = n = o = p = q = r = 1
+end
diff --git a/benchmark/bm_vm1_neq.rb b/benchmark/bm_vm1_neq.rb
index 9254a0ca9b..bbb4ae07a4 100644
--- a/benchmark/bm_vm1_neq.rb
+++ b/benchmark/bm_vm1_neq.rb
@@ -3,6 +3,6 @@ obj1 = Object.new
obj2 = Object.new
while i<30_000_000 # while loop 1
- i+= 1
+ i += 1
obj1 != obj2
end
diff --git a/benchmark/bm_vm1_not.rb b/benchmark/bm_vm1_not.rb
index ee9d0f3605..b09ecdcc21 100644
--- a/benchmark/bm_vm1_not.rb
+++ b/benchmark/bm_vm1_not.rb
@@ -2,6 +2,6 @@ i = 0
obj = Object.new
while i<30_000_000 # while loop 1
- i+= 1
+ i += 1
!obj
end
diff --git a/benchmark/bm_vm1_rescue.rb b/benchmark/bm_vm1_rescue.rb
index 3af12bb0f3..b0d3e2bdfa 100644
--- a/benchmark/bm_vm1_rescue.rb
+++ b/benchmark/bm_vm1_rescue.rb
@@ -1,6 +1,6 @@
-i=0
+i = 0
while i<30_000_000 # while loop 1
- i+=1
+ i += 1
begin
rescue
end
diff --git a/benchmark/bm_vm1_simplereturn.rb b/benchmark/bm_vm1_simplereturn.rb
index 8e9bcb0129..63f9f21675 100644
--- a/benchmark/bm_vm1_simplereturn.rb
+++ b/benchmark/bm_vm1_simplereturn.rb
@@ -1,9 +1,9 @@
def m
return 1
end
-i=0
+i = 0
while i<30_000_000 # while loop 1
- i+=1
+ i += 1
m
end
diff --git a/benchmark/bm_vm1_swap.rb b/benchmark/bm_vm1_swap.rb
index 611baf6b99..918f8b2112 100644
--- a/benchmark/bm_vm1_swap.rb
+++ b/benchmark/bm_vm1_swap.rb
@@ -1,8 +1,8 @@
a = 1
b = 2
-i=0
+i = 0
while i<30_000_000 # while loop 1
- i+=1
+ i += 1
a, b = b, a
end
diff --git a/benchmark/bm_vm1_yield.rb b/benchmark/bm_vm1_yield.rb
new file mode 100644
index 0000000000..775597cea6
--- /dev/null
+++ b/benchmark/bm_vm1_yield.rb
@@ -0,0 +1,10 @@
+def m
+ i = 0
+ while i<30_000_000 # while loop 1
+ i += 1
+ yield
+ end
+end
+
+m{}
+
diff --git a/benchmark/bm_vm2_array.rb b/benchmark/bm_vm2_array.rb
index 7713ae9f25..df9037c83c 100644
--- a/benchmark/bm_vm2_array.rb
+++ b/benchmark/bm_vm2_array.rb
@@ -1,5 +1,5 @@
-i=0
+i = 0
while i<6_000_000 # benchmark loop 2
- i+=1
+ i += 1
a = [1,2,3,4,5,6,7,8,9,10]
end
diff --git a/benchmark/bm_vm2_bigarray.rb b/benchmark/bm_vm2_bigarray.rb
new file mode 100644
index 0000000000..b02509d6a2
--- /dev/null
+++ b/benchmark/bm_vm2_bigarray.rb
@@ -0,0 +1,106 @@
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ a = [
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ ]
+end
diff --git a/benchmark/bm_vm2_bighash.rb b/benchmark/bm_vm2_bighash.rb
new file mode 100644
index 0000000000..5e3f437bb8
--- /dev/null
+++ b/benchmark/bm_vm2_bighash.rb
@@ -0,0 +1,5 @@
+i = 0
+while i<60_000 # benchmark loop 2
+ i += 1
+ a = {0=>0, 1=>1, 2=>2, 3=>3, 4=>4, 5=>5, 6=>6, 7=>7, 8=>8, 9=>9, 10=>10, 11=>11, 12=>12, 13=>13, 14=>14, 15=>15, 16=>16, 17=>17, 18=>18, 19=>19, 20=>20, 21=>21, 22=>22, 23=>23, 24=>24, 25=>25, 26=>26, 27=>27, 28=>28, 29=>29, 30=>30, 31=>31, 32=>32, 33=>33, 34=>34, 35=>35, 36=>36, 37=>37, 38=>38, 39=>39, 40=>40, 41=>41, 42=>42, 43=>43, 44=>44, 45=>45, 46=>46, 47=>47, 48=>48, 49=>49, 50=>50, 51=>51, 52=>52, 53=>53, 54=>54, 55=>55, 56=>56, 57=>57, 58=>58, 59=>59, 60=>60, 61=>61, 62=>62, 63=>63, 64=>64, 65=>65, 66=>66, 67=>67, 68=>68, 69=>69, 70=>70, 71=>71, 72=>72, 73=>73, 74=>74, 75=>75, 76=>76, 77=>77, 78=>78, 79=>79, 80=>80, 81=>81, 82=>82, 83=>83, 84=>84, 85=>85, 86=>86, 87=>87, 88=>88, 89=>89, 90=>90, 91=>91, 92=>92, 93=>93, 94=>94, 95=>95, 96=>96, 97=>97, 98=>98, 99=>99, 100=>100, 101=>101, 102=>102, 103=>103, 104=>104, 105=>105, 106=>106, 107=>107, 108=>108, 109=>109, 110=>110, 111=>111, 112=>112, 113=>113, 114=>114, 115=>115, 116=>116, 117=>117, 118=>118, 119=>119, 120=>120, 121=>121, 122=>122, 123=>123, 124=>124, 125=>125, 126=>126, 127=>127, 128=>128, 129=>129, 130=>130, 131=>131, 132=>132, 133=>133, 134=>134, 135=>135, 136=>136, 137=>137, 138=>138, 139=>139, 140=>140, 141=>141, 142=>142, 143=>143, 144=>144, 145=>145, 146=>146, 147=>147, 148=>148, 149=>149, 150=>150, 151=>151, 152=>152, 153=>153, 154=>154, 155=>155, 156=>156, 157=>157, 158=>158, 159=>159, 160=>160, 161=>161, 162=>162, 163=>163, 164=>164, 165=>165, 166=>166, 167=>167, 168=>168, 169=>169, 170=>170, 171=>171, 172=>172, 173=>173, 174=>174, 175=>175, 176=>176, 177=>177, 178=>178, 179=>179, 180=>180, 181=>181, 182=>182, 183=>183, 184=>184, 185=>185, 186=>186, 187=>187, 188=>188, 189=>189, 190=>190, 191=>191, 192=>192, 193=>193, 194=>194, 195=>195, 196=>196, 197=>197, 198=>198, 199=>199, 200=>200, 201=>201, 202=>202, 203=>203, 204=>204, 205=>205, 206=>206, 207=>207, 208=>208, 209=>209, 210=>210, 211=>211, 212=>212, 213=>213, 214=>214, 215=>215, 216=>216, 217=>217, 218=>218, 219=>219, 220=>220, 221=>221, 222=>222, 223=>223, 224=>224, 225=>225, 226=>226, 227=>227, 228=>228, 229=>229, 230=>230, 231=>231, 232=>232, 233=>233, 234=>234, 235=>235, 236=>236, 237=>237, 238=>238, 239=>239, 240=>240, 241=>241, 242=>242, 243=>243, 244=>244, 245=>245, 246=>246, 247=>247, 248=>248, 249=>249, 250=>250, 251=>251, 252=>252, 253=>253, 254=>254, 255=>255, 256=>256, 257=>257, 258=>258, 259=>259, 260=>260, 261=>261, 262=>262, 263=>263, 264=>264, 265=>265, 266=>266, 267=>267, 268=>268, 269=>269, 270=>270, 271=>271, 272=>272, 273=>273, 274=>274, 275=>275, 276=>276, 277=>277, 278=>278, 279=>279, 280=>280, 281=>281, 282=>282, 283=>283, 284=>284, 285=>285, 286=>286, 287=>287, 288=>288, 289=>289, 290=>290, 291=>291, 292=>292, 293=>293, 294=>294, 295=>295, 296=>296, 297=>297, 298=>298, 299=>299, 300=>300, 301=>301, 302=>302, 303=>303, 304=>304, 305=>305, 306=>306, 307=>307, 308=>308, 309=>309, 310=>310, 311=>311, 312=>312, 313=>313, 314=>314, 315=>315, 316=>316, 317=>317, 318=>318, 319=>319, 320=>320, 321=>321, 322=>322, 323=>323, 324=>324, 325=>325, 326=>326, 327=>327, 328=>328, 329=>329, 330=>330, 331=>331, 332=>332, 333=>333, 334=>334, 335=>335, 336=>336, 337=>337, 338=>338, 339=>339, 340=>340, 341=>341, 342=>342, 343=>343, 344=>344, 345=>345, 346=>346, 347=>347, 348=>348, 349=>349, 350=>350, 351=>351, 352=>352, 353=>353, 354=>354, 355=>355, 356=>356, 357=>357, 358=>358, 359=>359, 360=>360, 361=>361, 362=>362, 363=>363, 364=>364, 365=>365, 366=>366, 367=>367, 368=>368, 369=>369, 370=>370, 371=>371, 372=>372, 373=>373, 374=>374, 375=>375, 376=>376, 377=>377, 378=>378, 379=>379, 380=>380, 381=>381, 382=>382, 383=>383, 384=>384, 385=>385, 386=>386, 387=>387, 388=>388, 389=>389, 390=>390, 391=>391, 392=>392, 393=>393, 394=>394, 395=>395, 396=>396, 397=>397, 398=>398, 399=>399, 400=>400, 401=>401, 402=>402, 403=>403, 404=>404, 405=>405, 406=>406, 407=>407, 408=>408, 409=>409, 410=>410, 411=>411, 412=>412, 413=>413, 414=>414, 415=>415, 416=>416, 417=>417, 418=>418, 419=>419, 420=>420, 421=>421, 422=>422, 423=>423, 424=>424, 425=>425, 426=>426, 427=>427, 428=>428, 429=>429, 430=>430, 431=>431, 432=>432, 433=>433, 434=>434, 435=>435, 436=>436, 437=>437, 438=>438, 439=>439, 440=>440, 441=>441, 442=>442, 443=>443, 444=>444, 445=>445, 446=>446, 447=>447, 448=>448, 449=>449, 450=>450, 451=>451, 452=>452, 453=>453, 454=>454, 455=>455, 456=>456, 457=>457, 458=>458, 459=>459, 460=>460, 461=>461, 462=>462, 463=>463, 464=>464, 465=>465, 466=>466, 467=>467, 468=>468, 469=>469, 470=>470, 471=>471, 472=>472, 473=>473, 474=>474, 475=>475, 476=>476, 477=>477, 478=>478, 479=>479, 480=>480, 481=>481, 482=>482, 483=>483, 484=>484, 485=>485, 486=>486, 487=>487, 488=>488, 489=>489, 490=>490, 491=>491, 492=>492, 493=>493, 494=>494, 495=>495, 496=>496, 497=>497, 498=>498, 499=>499, 500=>500,}
+end
diff --git a/benchmark/bm_vm2_case.rb b/benchmark/bm_vm2_case.rb
index cd09788a85..adc6e4df0a 100644
--- a/benchmark/bm_vm2_case.rb
+++ b/benchmark/bm_vm2_case.rb
@@ -1,4 +1,4 @@
-i=0
+i = 0
while i<6_000_000 # while loop 2
case :foo
when :bar
@@ -8,7 +8,7 @@ while i<6_000_000 # while loop 2
when :boo
raise
when :foo
- i+=1
+ i += 1
end
end
diff --git a/benchmark/bm_vm2_defined_method.rb b/benchmark/bm_vm2_defined_method.rb
index 06c0d01baa..053ed6c912 100644
--- a/benchmark/bm_vm2_defined_method.rb
+++ b/benchmark/bm_vm2_defined_method.rb
@@ -2,8 +2,8 @@ class Object
define_method(:m){}
end
-i=0
+i = 0
while i<6_000_000 # benchmark loop 2
- i+=1
+ i += 1
m; m; m; m; m; m; m; m;
end
diff --git a/benchmark/bm_vm2_dstr.rb b/benchmark/bm_vm2_dstr.rb
new file mode 100644
index 0000000000..58c0f7bbc3
--- /dev/null
+++ b/benchmark/bm_vm2_dstr.rb
@@ -0,0 +1,6 @@
+i = 0
+x = y = 'z'
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ str = "foo#{x}bar#{y}baz"
+end
diff --git a/benchmark/bm_vm2_eval.rb b/benchmark/bm_vm2_eval.rb
index e72b4661ac..307cfc28ef 100644
--- a/benchmark/bm_vm2_eval.rb
+++ b/benchmark/bm_vm2_eval.rb
@@ -1,6 +1,6 @@
-i=0
+i = 0
while i<6_000_000 # benchmark loop 2
- i+=1
+ i += 1
eval("1")
end
diff --git a/benchmark/bm_vm2_method.rb b/benchmark/bm_vm2_method.rb
index f92e39a73f..a8ccff7138 100644
--- a/benchmark/bm_vm2_method.rb
+++ b/benchmark/bm_vm2_method.rb
@@ -2,8 +2,8 @@ def m
nil
end
-i=0
+i = 0
while i<6_000_000 # benchmark loop 2
- i+=1
+ i += 1
m; m; m; m; m; m; m; m;
end
diff --git a/benchmark/bm_vm2_method_missing.rb b/benchmark/bm_vm2_method_missing.rb
new file mode 100644
index 0000000000..2badc73101
--- /dev/null
+++ b/benchmark/bm_vm2_method_missing.rb
@@ -0,0 +1,12 @@
+class C
+ def method_missing mid
+ end
+end
+
+obj = C.new
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ obj.m; obj.m; obj.m; obj.m; obj.m; obj.m; obj.m; obj.m;
+end
diff --git a/benchmark/bm_vm2_method_with_block.rb b/benchmark/bm_vm2_method_with_block.rb
new file mode 100644
index 0000000000..b4efb4f520
--- /dev/null
+++ b/benchmark/bm_vm2_method_with_block.rb
@@ -0,0 +1,9 @@
+def m
+ nil
+end
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ m{}; m{}; m{}; m{}; m{}; m{}; m{}; m{};
+end
diff --git a/benchmark/bm_vm2_mutex.rb b/benchmark/bm_vm2_mutex.rb
index 01b1c478cb..7362f738c5 100644
--- a/benchmark/bm_vm2_mutex.rb
+++ b/benchmark/bm_vm2_mutex.rb
@@ -2,8 +2,8 @@ require 'thread'
m = Mutex.new
-i=0
+i = 0
while i<6_000_000 # benchmark loop 2
- i+=1
+ i += 1
m.synchronize{}
end
diff --git a/benchmark/bm_vm2_poly_method.rb b/benchmark/bm_vm2_poly_method.rb
index 921457d817..c82c0e4bce 100644
--- a/benchmark/bm_vm2_poly_method.rb
+++ b/benchmark/bm_vm2_poly_method.rb
@@ -12,9 +12,9 @@ end
o1 = C1.new
o2 = C2.new
-i=0
+i = 0
while i<6_000_000 # benchmark loop 2
o = (i % 2 == 0) ? o1 : o2
o.m; o.m; o.m; o.m; o.m; o.m; o.m; o.m
- i+=1
+ i += 1
end
diff --git a/benchmark/bm_vm2_poly_method_ov.rb b/benchmark/bm_vm2_poly_method_ov.rb
index bf09837dd7..aa5fd1dd38 100644
--- a/benchmark/bm_vm2_poly_method_ov.rb
+++ b/benchmark/bm_vm2_poly_method_ov.rb
@@ -12,9 +12,9 @@ end
o1 = C1.new
o2 = C2.new
-i=0
+i = 0
while i<6_000_000 # benchmark loop 2
o = (i % 2 == 0) ? o1 : o2
# o.m; o.m; o.m; o.m; o.m; o.m; o.m; o.m
- i+=1
+ i += 1
end
diff --git a/benchmark/bm_vm2_proc.rb b/benchmark/bm_vm2_proc.rb
index 3f51056bf9..65e5217371 100644
--- a/benchmark/bm_vm2_proc.rb
+++ b/benchmark/bm_vm2_proc.rb
@@ -6,9 +6,9 @@ pr = m{
a = 1
}
-i=0
+i = 0
while i<6_000_000 # benchmark loop 2
- i+=1
+ i += 1
pr.call
end
diff --git a/benchmark/bm_vm2_raise1.rb b/benchmark/bm_vm2_raise1.rb
new file mode 100644
index 0000000000..aa5387987f
--- /dev/null
+++ b/benchmark/bm_vm2_raise1.rb
@@ -0,0 +1,18 @@
+def rec n
+ if n > 0
+ rec n-1
+ else
+ raise
+ end
+end
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+
+ begin
+ rec 1
+ rescue
+ # ignore
+ end
+end
diff --git a/benchmark/bm_vm2_raise2.rb b/benchmark/bm_vm2_raise2.rb
new file mode 100644
index 0000000000..1f61c63157
--- /dev/null
+++ b/benchmark/bm_vm2_raise2.rb
@@ -0,0 +1,18 @@
+def rec n
+ if n > 0
+ rec n-1
+ else
+ raise
+ end
+end
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+
+ begin
+ rec 10
+ rescue
+ # ignore
+ end
+end
diff --git a/benchmark/bm_vm2_regexp.rb b/benchmark/bm_vm2_regexp.rb
index 428099e55a..55f9e957a3 100644
--- a/benchmark/bm_vm2_regexp.rb
+++ b/benchmark/bm_vm2_regexp.rb
@@ -1,6 +1,6 @@
-i=0
+i = 0
str = 'xxxhogexxx'
while i<6_000_000 # benchmark loop 2
/hoge/ =~ str
- i+=1
+ i += 1
end
diff --git a/benchmark/bm_vm2_send.rb b/benchmark/bm_vm2_send.rb
index 37c79fb1c3..6a3ab6fdab 100644
--- a/benchmark/bm_vm2_send.rb
+++ b/benchmark/bm_vm2_send.rb
@@ -5,8 +5,8 @@ end
o = C.new
-i=0
+i = 0
while i<6_000_000 # benchmark loop 2
- i+=1
+ i += 1
o.__send__ :m
end
diff --git a/benchmark/bm_vm2_super.rb b/benchmark/bm_vm2_super.rb
index d4f0b647de..afd8579e7b 100644
--- a/benchmark/bm_vm2_super.rb
+++ b/benchmark/bm_vm2_super.rb
@@ -16,5 +16,5 @@ obj = CC.new
i = 0
while i<6_000_000 # benchmark loop 2
obj.m
- i+=1
+ i += 1
end
diff --git a/benchmark/bm_vm2_unif1.rb b/benchmark/bm_vm2_unif1.rb
index 775f4d37e6..1774625942 100644
--- a/benchmark/bm_vm2_unif1.rb
+++ b/benchmark/bm_vm2_unif1.rb
@@ -3,6 +3,6 @@ def m a, b
end
while i<6_000_000 # benchmark loop 2
- i+=1
+ i += 1
m 100, 200
end
diff --git a/benchmark/bm_vm2_zsuper.rb b/benchmark/bm_vm2_zsuper.rb
index 7e90df1822..2a43e62217 100644
--- a/benchmark/bm_vm2_zsuper.rb
+++ b/benchmark/bm_vm2_zsuper.rb
@@ -16,5 +16,5 @@ obj = CC.new
while i<6_000_000 # benchmark loop 2
obj.m 10
- i+=1
+ i += 1
end
diff --git a/benchmark/bm_vm3_backtrace.rb b/benchmark/bm_vm3_backtrace.rb
new file mode 100644
index 0000000000..0fbf73e1ca
--- /dev/null
+++ b/benchmark/bm_vm3_backtrace.rb
@@ -0,0 +1,22 @@
+# get last backtrace
+
+begin
+ caller(0, 0)
+rescue ArgumentError
+ alias caller_orig caller
+ def caller lev, n
+ caller_orig(lev)[0..n]
+ end
+end
+
+def rec n
+ if n < 0
+ 100_000.times{
+ caller(0, 1)
+ }
+ else
+ rec(n-1)
+ end
+end
+
+rec 50
diff --git a/benchmark/bm_vm3_clearmethodcache.rb b/benchmark/bm_vm3_clearmethodcache.rb
index a25c372f06..9661323cd2 100644
--- a/benchmark/bm_vm3_clearmethodcache.rb
+++ b/benchmark/bm_vm3_clearmethodcache.rb
@@ -1,6 +1,6 @@
-i=0
+i = 0
while i<200_000
- i+=1
+ i += 1
Class.new{
def m; end
diff --git a/benchmark/bm_vm_thread_create_join.rb b/benchmark/bm_vm_thread_create_join.rb
index 325a66d587..393cd45df9 100644
--- a/benchmark/bm_vm_thread_create_join.rb
+++ b/benchmark/bm_vm_thread_create_join.rb
@@ -1,6 +1,6 @@
-i=0
+i = 0
while i<100_000 # benchmark loop 3
- i+=1
+ i += 1
Thread.new{
}.join
end
diff --git a/benchmark/bm_vm_thread_mutex1.rb b/benchmark/bm_vm_thread_mutex1.rb
index 588506e87c..5c9f85dfb7 100644
--- a/benchmark/bm_vm_thread_mutex1.rb
+++ b/benchmark/bm_vm_thread_mutex1.rb
@@ -7,9 +7,9 @@ max = 2000
lmax = max * max
(1..1).map{
Thread.new{
- i=0
+ i = 0
while i<lmax
- i+=1
+ i += 1
m.synchronize{
r += 1
}
diff --git a/benchmark/bm_vm_thread_mutex2.rb b/benchmark/bm_vm_thread_mutex2.rb
index d700b146d4..10de59054f 100644
--- a/benchmark/bm_vm_thread_mutex2.rb
+++ b/benchmark/bm_vm_thread_mutex2.rb
@@ -7,9 +7,9 @@ max = 2000
lmax = (max * max)/2
(1..2).map{
Thread.new{
- i=0
+ i = 0
while i<lmax
- i+=1
+ i += 1
m.synchronize{
r += 1
}
diff --git a/benchmark/bm_vm_thread_mutex3.rb b/benchmark/bm_vm_thread_mutex3.rb
index f502b6ac84..7f9a44b39d 100644
--- a/benchmark/bm_vm_thread_mutex3.rb
+++ b/benchmark/bm_vm_thread_mutex3.rb
@@ -6,9 +6,9 @@ r = 0
max = 2000
(1..max).map{
Thread.new{
- i=0
+ i = 0
while i<max
- i+=1
+ i += 1
m.synchronize{
r += 1
}
diff --git a/benchmark/bm_vm_thread_pass_flood.rb b/benchmark/bm_vm_thread_pass_flood.rb
index 56b5b0a956..27157d1a6f 100644
--- a/benchmark/bm_vm_thread_pass_flood.rb
+++ b/benchmark/bm_vm_thread_pass_flood.rb
@@ -2,7 +2,7 @@
Thread.new{loop{Thread.pass}}
}
-i=0
+i = 0
while i<10000
i += 1
end
diff --git a/benchmark/bmx_temp.rb b/benchmark/bmx_temp.rb
deleted file mode 100644
index 0b4b219ca2..0000000000
--- a/benchmark/bmx_temp.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-def m
- nil
-end
-
-i=0
-while i<800000 # benchmark loop 2
- i+=1
- m; m; m; m; m; m; m; m;
-end
diff --git a/benchmark/driver.rb b/benchmark/driver.rb
index 7dab292a15..695dc41aff 100644
--- a/benchmark/driver.rb
+++ b/benchmark/driver.rb
@@ -60,22 +60,25 @@ class BenchmarkDriver
if /(.+)::(.+)/ =~ e
# ex) ruby-a::/path/to/ruby-a
- v = $1.strip
- e = $2
+ label = $1.strip
+ path = $2
+ version = `#{path} -v`.chomp
else
- v = `#{e} -v`.chomp
- v.sub!(/ patchlevel \d+/, '')
+ path = e
+ version = label = `#{path} -v`.chomp
end
- [e, v]
+ [path, label, version]
}.compact
@dir = dir
@repeat = opt[:repeat] || 1
@repeat = 1 if @repeat < 1
@pattern = opt[:pattern] || nil
+ @exclude = opt[:exclude] || nil
@verbose = opt[:quiet] ? false : (opt[:verbose] || false)
@output = opt[:output] ? open(opt[:output], 'w') : nil
@loop_wl1 = @loop_wl2 = nil
+ @ruby_arg = opt[:ruby_arg] || nil
@opt = opt
# [[name, [[r-1-1, r-1-2, ...], [r-2-1, r-2-2, ...]]], ...]
@@ -84,14 +87,33 @@ class BenchmarkDriver
if @verbose
@start_time = Time.now
message @start_time
- @execs.each_with_index{|(e, v), i|
- message "target #{i}: #{v}"
+ @execs.each_with_index{|(path, label, version), i|
+ message "target #{i}: " + (label == version ? "#{label}" : "#{label} (#{version})") + " at \"#{path}\""
}
end
end
- def average results
- results.inject(:+) / results.length
+ def adjusted_results name, results
+ s = nil
+ results.each_with_index{|e, i|
+ r = e.min
+ case name
+ when /^vm1_/
+ if @loop_wl1
+ r -= @loop_wl1[i]
+ r = 0 if r < 0
+ s = '*'
+ end
+ when /^vm2_/
+ if @loop_wl2
+ r -= @loop_wl2[i]
+ r = 0 if r < 0
+ s = '*'
+ end
+ end
+ yield r
+ }
+ s
end
def show_results
@@ -103,7 +125,7 @@ class BenchmarkDriver
message
message PP.pp(@results, "", 79)
message
- message "Elapesed time: #{Time.now - @start_time} (sec)"
+ message "Elapsed time: #{Time.now - @start_time} (sec)"
end
output '-----------------------------------------------------------'
@@ -113,50 +135,49 @@ class BenchmarkDriver
output "minimum results in each #{@repeat} measurements."
end
- difference = "\taverage difference" if @execs.length == 2
- total_difference = 0
-
- output "name\t#{@execs.map{|(e, v)| v}.join("\t")}#{difference}"
+ output "Execution time (sec)"
+ output "name\t#{@execs.map{|(_, v)| v}.join("\t")}"
@results.each{|v, result|
rets = []
- s = nil
- result.each_with_index{|e, i|
- r = e.min
- case v
- when /^vm1_/
- if @loop_wl1
- r -= @loop_wl1[i]
- s = '*'
- end
- when /^vm2_/
- if @loop_wl2
- r -= @loop_wl2[i]
- s = '*'
- end
- end
+ s = adjusted_results(v, result){|r|
rets << sprintf("%.3f", r)
}
-
- if difference
- diff = average(result.last) - average(result.first)
- total_difference += diff
- rets << sprintf("%.3f", diff)
- end
-
output "#{v}#{s}\t#{rets.join("\t")}"
}
- if difference and @verbose
- output '-----------------------------------------------------------'
- output "average total difference is #{total_difference}"
+ if @execs.size > 1
+ output
+ output "Speedup ratio: compare with the result of `#{@execs[0][1]}' (greater is better)"
+ output "name\t#{@execs[1..-1].map{|(_, v)| v}.join("\t")}"
+ @results.each{|v, result|
+ rets = []
+ first_value = nil
+ s = adjusted_results(v, result){|r|
+ if first_value
+ if r == 0
+ rets << "Error"
+ else
+ rets << sprintf("%.3f", first_value/r)
+ end
+ else
+ first_value = r
+ end
+ }
+ output "#{v}#{s}\t#{rets.join("\t")}"
+ }
+ end
+
+ if @opt[:output]
+ output
+ output "Log file: #{@opt[:output]}"
end
end
def files
flag = {}
- vm1 = vm2 = wl1 = wl2 = false
@files = Dir.glob(File.join(@dir, 'bm*.rb')).map{|file|
next if @pattern && /#{@pattern}/ !~ File.basename(file)
+ next if @exclude && /#{@exclude}/ =~ File.basename(file)
case file
when /bm_(vm[12])_/, /bm_loop_(whileloop2?).rb/
flag[$1] = true
@@ -218,31 +239,35 @@ class BenchmarkDriver
end
def measure executable, file
- cmd = "#{executable} #{file}"
+ cmd = "#{executable} #{@ruby_arg} #{file}"
+
m = Benchmark.measure{
`#{cmd}`
}
if $? != 0
- raise "\`#{cmd}\' exited with abnormal status (#{$?})"
+ output "\`#{cmd}\' exited with abnormal status (#{$?})"
+ 0
+ else
+ m.real
end
-
- m.real
end
end
if __FILE__ == $0
opt = {
- :execs => ['ruby'],
- :dir => './',
+ :execs => [],
+ :dir => File.dirname(__FILE__),
:repeat => 1,
:output => "bmlog-#{Time.now.strftime('%Y%m%d-%H%M%S')}.#{$$}",
}
parser = OptionParser.new{|o|
o.on('-e', '--executables [EXECS]',
- "Specify benchmark one or more targets. (exec1; exec2; exec3, ...)"){|e|
- opt[:execs] = e.split(/;/)
+ "Specify benchmark one or more targets (e1::path1; e2::path2; e3::path3;...)"){|e|
+ e.split(/;/).each{|path|
+ opt[:execs] << path
+ }
}
o.on('-d', '--directory [DIRECTORY]', "Benchmark suites directory"){|d|
opt[:dir] = d
@@ -250,11 +275,17 @@ if __FILE__ == $0
o.on('-p', '--pattern [PATTERN]', "Benchmark name pattern"){|p|
opt[:pattern] = p
}
+ o.on('-x', '--exclude [PATTERN]', "Benchmark exclude pattern"){|e|
+ opt[:exclude] = e
+ }
o.on('-r', '--repeat-count [NUM]', "Repeat count"){|n|
opt[:repeat] = n.to_i
}
- o.on('-o', '--output-file [FILE]', "Output file"){|o|
- opt[:output] = o
+ o.on('-o', '--output-file [FILE]', "Output file"){|f|
+ opt[:output] = f
+ }
+ o.on('--ruby-arg [ARG]', "Optional argument for ruby"){|a|
+ opt[:ruby_arg] = a
}
o.on('-q', '--quiet', "Run without notify information except result table."){|q|
opt[:quiet] = q
diff --git a/benchmark/other-lang/fact.rb b/benchmark/other-lang/fact.rb
index 7e97b22b39..6cedc752cd 100644
--- a/benchmark/other-lang/fact.rb
+++ b/benchmark/other-lang/fact.rb
@@ -6,8 +6,8 @@ def fact(n)
end
end
-i=0
+i = 0
while i<10000
- i+=1
+ i += 1
fact(100)
end
diff --git a/benchmark/other-lang/loop.rb b/benchmark/other-lang/loop.rb
index d43cef61f3..b367b9dbf3 100644
--- a/benchmark/other-lang/loop.rb
+++ b/benchmark/other-lang/loop.rb
@@ -1,4 +1,4 @@
-i=0
+i = 0
while i<30000000
- i+=1
+ i += 1
end
diff --git a/bignum.c b/bignum.c
index 9c289f7a8e..666305756a 100644
--- a/bignum.c
+++ b/bignum.c
@@ -10,9 +10,13 @@
**********************************************************************/
#include "ruby/ruby.h"
+#include "ruby/thread.h"
#include "ruby/util.h"
#include "internal.h"
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
#include <math.h>
#include <float.h>
#include <ctype.h>
@@ -101,7 +105,7 @@ rb_cmpint(VALUE val, VALUE a, VALUE b)
if (l < 0) return -1;
return 0;
}
- if (TYPE(val) == T_BIGNUM) {
+ if (RB_TYPE_P(val, T_BIGNUM)) {
if (BIGZEROP(val)) return 0;
if (RBIGNUM_SIGN(val)) return 1;
return -1;
@@ -162,8 +166,7 @@ rb_big_resize(VALUE big, long len)
static VALUE
bignew_1(VALUE klass, long len, int sign)
{
- NEWOBJ(big, struct RBignum);
- OBJSETUP(big, klass, T_BIGNUM);
+ NEWOBJ_OF(big, struct RBignum, klass, T_BIGNUM);
RBIGNUM_SET_SIGN(big, sign?1:0);
if (len <= RBIGNUM_EMBED_LEN_MAX) {
RBASIC(big)->flags |= RBIGNUM_EMBED_FLAG;
@@ -173,7 +176,7 @@ bignew_1(VALUE klass, long len, int sign)
RBIGNUM(big)->as.heap.digits = ALLOC_N(BDIGIT, len);
RBIGNUM(big)->as.heap.len = len;
}
-
+ OBJ_FREEZE(big);
return (VALUE)big;
}
@@ -269,7 +272,7 @@ bigfixize(VALUE x)
static VALUE
bignorm(VALUE x)
{
- if (!FIXNUM_P(x) && TYPE(x) == T_BIGNUM) {
+ if (RB_TYPE_P(x, T_BIGNUM)) {
x = bigfixize(bigtrunc(x));
}
return x;
@@ -349,6 +352,14 @@ rb_int2inum(SIGNED_VALUE n)
* for each 0 <= i < num_longs.
* So buf is little endian at whole on a little endian machine.
* But buf is mixed endian on a big endian machine.
+ *
+ * The buf represents negative integers as two's complement.
+ * So, the most significant bit of the most significant word,
+ * (buf[num_longs-1]>>(SIZEOF_LONG*CHAR_BIT-1)),
+ * is the sign bit: 1 means negative and 0 means zero or positive.
+ *
+ * If given size of buf (num_longs) is not enough to represent val,
+ * higier words (including a sign bit) are ignored.
*/
void
rb_big_pack(VALUE val, unsigned long *buf, long num_longs)
@@ -391,7 +402,7 @@ rb_big_pack(VALUE val, unsigned long *buf, long num_longs)
}
}
-/* See rb_big_pack comment for endianness of buf. */
+/* See rb_big_pack comment for endianness and sign of buf. */
VALUE
rb_big_unpack(unsigned long *buf, long num_longs)
{
@@ -722,7 +733,7 @@ rb_cstr_to_inum(const char *str, int base, int badcheck)
if (badcheck) goto bad;
break;
}
- nondigit = c;
+ nondigit = (char) c;
continue;
}
else if ((c = conv_digit(c)) < 0) {
@@ -767,6 +778,7 @@ rb_str_to_inum(VALUE str, int base, int badcheck)
VALUE ret;
StringValue(str);
+ rb_must_asciicompat(str);
if (badcheck) {
s = StringValueCStr(str);
}
@@ -1026,7 +1038,8 @@ big2str_find_n1(VALUE x, int base)
bits = BITSPERDIG*RBIGNUM_LEN(x);
}
- return (long)ceil(bits/log_2[base - 2]);
+ /* @shyouhei note: vvvvvvvvvvvvv this cast is suspicious. But I believe it is OK, because if that cast loses data, this x value is too big, and should have raised RangeError. */
+ return (long)ceil(((double)bits)/log_2[base - 2]);
}
static long
@@ -1210,10 +1223,11 @@ rb_big2ulong(VALUE x)
VALUE num = big2ulong(x, "unsigned long", TRUE);
if (!RBIGNUM_SIGN(x)) {
- if ((long)num < 0) {
+ unsigned long v = (unsigned long)(-(long)num);
+
+ if (v <= LONG_MAX)
rb_raise(rb_eRangeError, "bignum out of range of unsigned long");
- }
- return (VALUE)(-(SIGNED_VALUE)num);
+ return (VALUE)v;
}
return num;
}
@@ -1256,8 +1270,14 @@ rb_big2ull(VALUE x)
{
unsigned LONG_LONG num = big2ull(x, "unsigned long long");
- if (!RBIGNUM_SIGN(x))
- return (VALUE)(-(SIGNED_VALUE)num);
+ if (!RBIGNUM_SIGN(x)) {
+ LONG_LONG v = -(LONG_LONG)num;
+
+ /* FIXNUM_MIN-1 .. LLONG_MIN mapped into 0xbfffffffffffffff .. LONG_MAX+1 */
+ if ((unsigned LONG_LONG)v <= LLONG_MAX)
+ rb_raise(rb_eRangeError, "bignum out of range of unsigned long long");
+ return v;
+ }
return num;
}
@@ -1414,6 +1434,88 @@ rb_big_to_f(VALUE x)
return DBL2NUM(rb_big2dbl(x));
}
+VALUE
+rb_integer_float_cmp(VALUE x, VALUE y)
+{
+ double yd = RFLOAT_VALUE(y);
+ double yi, yf;
+ VALUE rel;
+
+ if (isnan(yd))
+ return Qnil;
+ if (isinf(yd)) {
+ if (yd > 0.0) return INT2FIX(-1);
+ else return INT2FIX(1);
+ }
+ yf = modf(yd, &yi);
+ if (FIXNUM_P(x)) {
+#if SIZEOF_LONG * CHAR_BIT < DBL_MANT_DIG /* assume FLT_RADIX == 2 */
+ double xd = (double)FIX2LONG(x);
+ if (xd < yd)
+ return INT2FIX(-1);
+ if (xd > yd)
+ return INT2FIX(1);
+ return INT2FIX(0);
+#else
+ long xl, yl;
+ if (yi < FIXNUM_MIN)
+ return INT2FIX(1);
+ if (FIXNUM_MAX+1 <= yi)
+ return INT2FIX(-1);
+ xl = FIX2LONG(x);
+ yl = (long)yi;
+ if (xl < yl)
+ return INT2FIX(-1);
+ if (xl > yl)
+ return INT2FIX(1);
+ if (yf < 0.0)
+ return INT2FIX(1);
+ if (0.0 < yf)
+ return INT2FIX(-1);
+ return INT2FIX(0);
+#endif
+ }
+ y = rb_dbl2big(yi);
+ rel = rb_big_cmp(x, y);
+ if (yf == 0.0 || rel != INT2FIX(0))
+ return rel;
+ if (yf < 0.0)
+ return INT2FIX(1);
+ return INT2FIX(-1);
+}
+
+VALUE
+rb_integer_float_eq(VALUE x, VALUE y)
+{
+ double yd = RFLOAT_VALUE(y);
+ double yi, yf;
+
+ if (isnan(yd) || isinf(yd))
+ return Qfalse;
+ yf = modf(yd, &yi);
+ if (yf != 0)
+ return Qfalse;
+ if (FIXNUM_P(x)) {
+#if SIZEOF_LONG * CHAR_BIT < DBL_MANT_DIG /* assume FLT_RADIX == 2 */
+ double xd = (double)FIX2LONG(x);
+ if (xd != yd)
+ return Qfalse;
+ return Qtrue;
+#else
+ long xl, yl;
+ if (yi < LONG_MIN || LONG_MAX < yi)
+ return Qfalse;
+ xl = FIX2LONG(x);
+ yl = (long)yi;
+ if (xl != yl)
+ return Qfalse;
+ return Qtrue;
+#endif
+ }
+ y = rb_dbl2big(yi);
+ return rb_big_eq(x, y);
+}
+
/*
* call-seq:
* big <=> numeric -> -1, 0, +1 or nil
@@ -1439,15 +1541,7 @@ rb_big_cmp(VALUE x, VALUE y)
break;
case T_FLOAT:
- {
- double a = RFLOAT_VALUE(y);
-
- if (isinf(a)) {
- if (a > 0.0) return INT2FIX(-1);
- else return INT2FIX(1);
- }
- return rb_dbl_cmp(rb_big2dbl(x), a);
- }
+ return rb_integer_float_cmp(x, y);
default:
return rb_num_coerce_cmp(x, y, rb_intern("<=>"));
@@ -1470,8 +1564,15 @@ rb_big_cmp(VALUE x, VALUE y)
(RBIGNUM_SIGN(x) ? INT2FIX(-1) : INT2FIX(1));
}
+enum big_op_t {
+ big_op_gt,
+ big_op_ge,
+ big_op_lt,
+ big_op_le
+};
+
static VALUE
-big_op(VALUE x, VALUE y, int op)
+big_op(VALUE x, VALUE y, enum big_op_t op)
{
VALUE rel;
int n;
@@ -1483,26 +1584,17 @@ big_op(VALUE x, VALUE y, int op)
break;
case T_FLOAT:
- {
- double a = RFLOAT_VALUE(y);
-
- if (isinf(a)) {
- if (a > 0.0) rel = INT2FIX(-1);
- else rel = INT2FIX(1);
- break;
- }
- rel = rb_dbl_cmp(rb_big2dbl(x), a);
- break;
- }
+ rel = rb_integer_float_cmp(x, y);
+ break;
default:
{
ID id = 0;
switch (op) {
- case 0: id = '>'; break;
- case 1: id = rb_intern(">="); break;
- case 2: id = '<'; break;
- case 3: id = rb_intern("<="); break;
+ case big_op_gt: id = '>'; break;
+ case big_op_ge: id = rb_intern(">="); break;
+ case big_op_lt: id = '<'; break;
+ case big_op_le: id = rb_intern("<="); break;
}
return rb_num_coerce_relop(x, y, id);
}
@@ -1512,10 +1604,10 @@ big_op(VALUE x, VALUE y, int op)
n = FIX2INT(rel);
switch (op) {
- case 0: return n > 0 ? Qtrue : Qfalse;
- case 1: return n >= 0 ? Qtrue : Qfalse;
- case 2: return n < 0 ? Qtrue : Qfalse;
- case 3: return n <= 0 ? Qtrue : Qfalse;
+ case big_op_gt: return n > 0 ? Qtrue : Qfalse;
+ case big_op_ge: return n >= 0 ? Qtrue : Qfalse;
+ case big_op_lt: return n < 0 ? Qtrue : Qfalse;
+ case big_op_le: return n <= 0 ? Qtrue : Qfalse;
}
return Qundef;
}
@@ -1531,7 +1623,7 @@ big_op(VALUE x, VALUE y, int op)
static VALUE
big_gt(VALUE x, VALUE y)
{
- return big_op(x, y, 0);
+ return big_op(x, y, big_op_gt);
}
/*
@@ -1545,7 +1637,7 @@ big_gt(VALUE x, VALUE y)
static VALUE
big_ge(VALUE x, VALUE y)
{
- return big_op(x, y, 1);
+ return big_op(x, y, big_op_ge);
}
/*
@@ -1559,7 +1651,7 @@ big_ge(VALUE x, VALUE y)
static VALUE
big_lt(VALUE x, VALUE y)
{
- return big_op(x, y, 2);
+ return big_op(x, y, big_op_lt);
}
/*
@@ -1573,7 +1665,7 @@ big_lt(VALUE x, VALUE y)
static VALUE
big_le(VALUE x, VALUE y)
{
- return big_op(x, y, 3);
+ return big_op(x, y, big_op_le);
}
/*
@@ -1597,14 +1689,7 @@ rb_big_eq(VALUE x, VALUE y)
case T_BIGNUM:
break;
case T_FLOAT:
- {
- volatile double a, b;
-
- a = RFLOAT_VALUE(y);
- if (isnan(a) || isinf(a)) return Qfalse;
- b = rb_big2dbl(x);
- return (a == b)?Qtrue:Qfalse;
- }
+ return rb_integer_float_eq(x, y);
default:
return rb_equal(y, x);
}
@@ -1628,7 +1713,7 @@ rb_big_eq(VALUE x, VALUE y)
static VALUE
rb_big_eql(VALUE x, VALUE y)
{
- if (TYPE(y) != T_BIGNUM) return Qfalse;
+ if (!RB_TYPE_P(y, T_BIGNUM)) return Qfalse;
if (RBIGNUM_SIGN(x) != RBIGNUM_SIGN(y)) return Qfalse;
if (RBIGNUM_LEN(x) != RBIGNUM_LEN(y)) return Qfalse;
if (MEMCMP(BDIGITS(x),BDIGITS(y),BDIGIT,RBIGNUM_LEN(y)) != 0) return Qfalse;
@@ -2416,7 +2501,7 @@ bigmul1_toom3(VALUE x, VALUE y)
z2 = bigtrunc(bigadd(u2, u0, 0));
/* z3 <- (z2 - z3) / 2 + 2 * z(inf) == (z2 - z3) / 2 + 2 * u4 */
- z3 = bigadd(z2, z3, 0);
+ z3 = bigtrunc(bigadd(z2, z3, 0));
bigrsh_bang(BDIGITS(z3), RBIGNUM_LEN(z3), 1);
t = big_lshift(u4, 1); /* TODO: combining with next addition */
z3 = bigtrunc(bigadd(z3, t, 1));
@@ -2570,30 +2655,32 @@ rb_big_mul(VALUE x, VALUE y)
}
struct big_div_struct {
- long nx, ny;
+ long nx, ny, j, nyzero;
BDIGIT *yds, *zds;
- VALUE stop;
+ volatile VALUE stop;
};
-static VALUE
+static void *
bigdivrem1(void *ptr)
{
struct big_div_struct *bds = (struct big_div_struct*)ptr;
- long nx = bds->nx, ny = bds->ny;
- long i, j, nyzero;
+ long ny = bds->ny;
+ long i, j;
BDIGIT *yds = bds->yds, *zds = bds->zds;
BDIGIT_DBL t2;
BDIGIT_DBL_SIGNED num;
BDIGIT q;
- j = nx==ny?nx+1:nx;
- for (nyzero = 0; !yds[nyzero]; nyzero++);
+ j = bds->j;
do {
- if (bds->stop) return Qnil;
+ if (bds->stop) {
+ bds->j = j;
+ return 0;
+ }
if (zds[j] == yds[ny-1]) q = (BDIGIT)BIGRAD-1;
else q = (BDIGIT)((BIGUP(zds[j]) + zds[j-1])/yds[ny-1]);
if (q) {
- i = nyzero; num = 0; t2 = 0;
+ i = bds->nyzero; num = 0; t2 = 0;
do { /* multiply and subtract */
BDIGIT_DBL ee;
t2 += (BDIGIT_DBL)yds[i] * q;
@@ -2617,14 +2704,14 @@ bigdivrem1(void *ptr)
}
zds[j] = q;
} while (--j >= ny);
- return Qnil;
+ return 0;
}
static void
rb_big_stop(void *ptr)
{
- VALUE *stop = (VALUE*)ptr;
- *stop = Qtrue;
+ struct big_div_struct *bds = ptr;
+ bds->stop = Qtrue;
}
static VALUE
@@ -2708,8 +2795,17 @@ bigdivrem(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp)
bds.zds = zds;
bds.yds = yds;
bds.stop = Qfalse;
+ bds.j = nx==ny?nx+1:nx;
+ for (bds.nyzero = 0; !yds[bds.nyzero]; bds.nyzero++);
if (nx > 10000 || ny > 10000) {
- rb_thread_blocking_region(bigdivrem1, &bds, rb_big_stop, &bds.stop);
+ retry:
+ bds.stop = Qfalse;
+ rb_thread_call_without_gvl(bigdivrem1, &bds, rb_big_stop, &bds);
+
+ if (bds.stop == Qtrue) {
+ /* execute trap handler, but exception was not raised. */
+ goto retry;
+ }
}
else {
bigdivrem1(&bds);
@@ -2726,7 +2822,7 @@ bigdivrem(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp)
if (modp) { /* normalize remainder */
*modp = zz = rb_big_clone(z);
zds = BDIGITS(zz);
- while (--ny && !zds[ny]); ++ny;
+ while (ny > 1 && !zds[ny-1]) --ny;
if (dd) {
t2 = 0; i = ny;
while(i--) {
@@ -2774,12 +2870,13 @@ rb_big_divide(VALUE x, VALUE y, ID op)
case T_FLOAT:
{
- double div = rb_big2dbl(x) / RFLOAT_VALUE(y);
if (op == '/') {
- return DBL2NUM(div);
+ return DBL2NUM(rb_big2dbl(x) / RFLOAT_VALUE(y));
}
else {
- return rb_dbl2big(div);
+ double dy = RFLOAT_VALUE(y);
+ if (dy == 0.0) rb_num_zerodiv();
+ return rb_dbl2big(rb_big2dbl(x) / dy);
}
}
@@ -2959,32 +3056,31 @@ big_fdiv(VALUE x, VALUE y)
switch (TYPE(y)) {
case T_FIXNUM:
y = rb_int2big(FIX2LONG(y));
- case T_BIGNUM: {
+ case T_BIGNUM:
bigtrunc(y);
l = RBIGNUM_LEN(y) - 1;
ey = l * BITSPERDIG;
ey += bdigbitsize(BDIGITS(y)[l]);
ey -= DBL_BIGDIG * BITSPERDIG;
if (ey) y = big_shift(y, ey);
- bignum:
- bigdivrem(x, y, &z, 0);
- l = ex - ey;
-#if SIZEOF_LONG > SIZEOF_INT
- {
- /* Visual C++ can't be here */
- if (l > INT_MAX) return DBL2NUM(INFINITY);
- if (l < INT_MIN) return DBL2NUM(0.0);
- }
-#endif
- return DBL2NUM(ldexp(big2dbl(z), (int)l));
- }
+ break;
case T_FLOAT:
y = dbl2big(ldexp(frexp(RFLOAT_VALUE(y), &i), DBL_MANT_DIG));
ey = i - DBL_MANT_DIG;
- goto bignum;
+ break;
+ default:
+ rb_bug("big_fdiv");
+ }
+ bigdivrem(x, y, &z, 0);
+ l = ex - ey;
+#if SIZEOF_LONG > SIZEOF_INT
+ {
+ /* Visual C++ can't be here */
+ if (l > INT_MAX) return DBL2NUM(INFINITY);
+ if (l < INT_MIN) return DBL2NUM(0.0);
}
- rb_bug("big_fdiv");
- /* NOTREACHED */
+#endif
+ return DBL2NUM(ldexp(big2dbl(z), (int)l));
}
/*
@@ -3079,10 +3175,11 @@ rb_big_pow(VALUE x, VALUE y)
else {
VALUE z = 0;
SIGNED_VALUE mask;
- const long BIGLEN_LIMIT = 1024*1024 / SIZEOF_BDIGITS;
+ const long xlen = RBIGNUM_LEN(x) - 1;
+ const long xbits = ffs(RBIGNUM_DIGITS(x)[xlen]) + SIZEOF_BDIGITS*BITSPERDIG*xlen;
+ const long BIGLEN_LIMIT = BITSPERDIG*1024*1024;
- if ((RBIGNUM_LEN(x) > BIGLEN_LIMIT) ||
- (RBIGNUM_LEN(x) > BIGLEN_LIMIT / yy)) {
+ if ((xbits > BIGLEN_LIMIT) || (xbits * yy > BIGLEN_LIMIT)) {
rb_warn("in a**b, b may be too big");
d = (double)yy;
break;
@@ -3107,10 +3204,10 @@ rb_big_pow(VALUE x, VALUE y)
static inline VALUE
bit_coerce(VALUE x)
{
- while (!FIXNUM_P(x) && TYPE(x) != T_BIGNUM) {
- if (TYPE(x) == T_FLOAT) {
- rb_raise(rb_eTypeError, "can't convert Float into Integer");
- }
+ while (!FIXNUM_P(x) && !RB_TYPE_P(x, T_BIGNUM)) {
+ rb_raise(rb_eTypeError,
+ "can't convert %s into Integer for bitwise arithmetic",
+ rb_obj_classname(x));
x = rb_to_int(x);
}
return x;
@@ -3434,7 +3531,7 @@ rb_big_lshift(VALUE x, VALUE y)
}
break;
}
- else if (TYPE(y) == T_BIGNUM) {
+ else if (RB_TYPE_P(y, T_BIGNUM)) {
if (!RBIGNUM_SIGN(y)) {
VALUE t = check_shiftdown(y, x);
if (!NIL_P(t)) return t;
@@ -3498,7 +3595,7 @@ rb_big_rshift(VALUE x, VALUE y)
}
break;
}
- else if (TYPE(y) == T_BIGNUM) {
+ else if (RB_TYPE_P(y, T_BIGNUM)) {
if (RBIGNUM_SIGN(y)) {
VALUE t = check_shiftdown(y, x);
if (!NIL_P(t)) return t;
@@ -3534,9 +3631,10 @@ big_rshift(VALUE x, unsigned long shift)
return INT2FIX(-1);
}
if (!RBIGNUM_SIGN(x)) {
- save_x = x = rb_big_clone(x);
+ x = rb_big_clone(x);
get2comp(x);
}
+ save_x = x;
xds = BDIGITS(x);
i = RBIGNUM_LEN(x); j = i - s1;
if (j == 0) {
@@ -3556,6 +3654,7 @@ big_rshift(VALUE x, unsigned long shift)
if (!RBIGNUM_SIGN(x)) {
get2comp(z);
}
+ RB_GC_GUARD(save_x);
return z;
}
@@ -3586,7 +3685,7 @@ rb_big_aref(VALUE x, VALUE y)
VALUE shift;
long i, s1, s2;
- if (TYPE(y) == T_BIGNUM) {
+ if (RB_TYPE_P(y, T_BIGNUM)) {
if (!RBIGNUM_SIGN(y))
return INT2FIX(0);
bigtrunc(y);
@@ -3644,17 +3743,13 @@ static VALUE
rb_big_coerce(VALUE x, VALUE y)
{
if (FIXNUM_P(y)) {
- return rb_assoc_new(rb_int2big(FIX2LONG(y)), x);
- }
- else if (TYPE(y) == T_BIGNUM) {
- return rb_assoc_new(y, x);
+ y = rb_int2big(FIX2LONG(y));
}
- else {
+ else if (!RB_TYPE_P(y, T_BIGNUM)) {
rb_raise(rb_eTypeError, "can't coerce %s to Bignum",
rb_obj_classname(y));
}
- /* not reached */
- return Qnil;
+ return rb_assoc_new(y, x);
}
/*
@@ -3750,6 +3845,7 @@ Init_Bignum(void)
rb_cBignum = rb_define_class("Bignum", rb_cInteger);
rb_define_method(rb_cBignum, "to_s", rb_big_to_s, -1);
+ rb_define_alias(rb_cBignum, "inspect", "to_s");
rb_define_method(rb_cBignum, "coerce", rb_big_coerce, 1);
rb_define_method(rb_cBignum, "-@", rb_big_uminus, 0);
rb_define_method(rb_cBignum, "+", rb_big_plus, 1);
diff --git a/bin/rake b/bin/rake
index 0de43c97ec..6aad2f0df3 100755
--- a/bin/rake
+++ b/bin/rake
@@ -24,9 +24,14 @@
begin
require 'rubygems'
+ gem 'rake'
rescue LoadError
end
+module Rake
+ REDUCE_COMPAT = true if ARGV.include?("--reduce-compat")
+end
+
require 'rake'
Rake.application.run
diff --git a/bin/rdoc b/bin/rdoc
index 8fafd01b0f..aaa23292df 100755
--- a/bin/rdoc
+++ b/bin/rdoc
@@ -5,14 +5,23 @@
#
# Copyright (c) 2003 Dave Thomas
# Released under the same terms as Ruby
-#
-# $Revision$
+
+begin
+ gem 'rdoc'
+rescue NameError => e # --disable-gems
+ raise unless e.name == :gem
+rescue Gem::LoadError
+end
require 'rdoc/rdoc'
begin
r = RDoc::RDoc.new
r.document ARGV
+rescue Errno::ENOSPC
+ $stderr.puts 'Ran out of space creating documentation'
+ $stderr.puts
+ $stderr.puts 'Please free up some space and try again'
rescue SystemExit
raise
rescue Exception => e
diff --git a/bin/ri b/bin/ri
index 243557403c..7fbed0c099 100755
--- a/bin/ri
+++ b/bin/ri
@@ -1,5 +1,12 @@
#!/usr/bin/env ruby
+begin
+ gem 'rdoc'
+rescue NameError => e # --disable-gems
+ raise unless e.name == :gem
+rescue Gem::LoadError
+end
+
require 'rdoc/ri/driver'
RDoc::RI::Driver.run ARGV
diff --git a/bin/testrb b/bin/testrb
index e9046eb147..23a00b439f 100755
--- a/bin/testrb
+++ b/bin/testrb
@@ -1,10 +1,3 @@
#!/usr/bin/env ruby
require 'test/unit'
-tests = Test::Unit::AutoRunner.new(true)
-tests.options.banner.sub!(/\[options\]/, '\& tests...')
-unless tests.process_args(ARGV)
- abort tests.options.banner
-end
-files = tests.to_run
-$0 = files.size == 1 ? File.basename(files[0]) : files.to_s
-exit tests.run
+exit Test::Unit::AutoRunner.run(true)
diff --git a/bootstraptest/runner.rb b/bootstraptest/runner.rb
index df58ca58f3..0dd1e35a88 100755
--- a/bootstraptest/runner.rb
+++ b/bootstraptest/runner.rb
@@ -1,4 +1,4 @@
-"exec" "${RUBY-ruby}" "-x" "$0" "$@"; true # -*- mode: ruby; coding: utf-8 -*-
+"exec" "${RUBY-ruby}" "-x" "$0" "$@" || true # -*- mode: ruby; coding: utf-8 -*-
#!./ruby
# $Id$
@@ -61,6 +61,8 @@ def main
@ruby = File.expand_path('miniruby')
@verbose = false
$stress = false
+ @color = nil
+ @quiet = false
dir = nil
quiet = false
tests = nil
@@ -81,8 +83,13 @@ def main
true
when /\A(--stress|-s)/
$stress = true
+ when /\A--color(?:=(?:always|(auto)|(never)|(.*)))?\z/
+ warn "unknown --color argument: #$3" if $3
+ @color = $1 ? nil : !$2
+ true
when /\A(-q|--q(uiet))\z/
quiet = true
+ @quiet = true
true
when /\A(-v|--v(erbose))\z/
@verbose = true
@@ -92,12 +99,16 @@ Usage: #{File.basename($0, '.*')} --ruby=PATH [--sets=NAME,NAME,...]
--sets=NAME,NAME,... Name of test sets.
--dir=DIRECTORY Working directory.
default: /tmp/bootstraptestXXXXX.tmpwd
+ --color[=WHEN] Colorize the output. WHEN defaults to 'always'
+ or can be 'never' or 'auto'.
-s, --stress stress test.
-v, --verbose Output test name before exec.
-q, --quiet Don\'t print header message.
-h, --help Print this message and quit.
End
exit true
+ when /\A-j/
+ true
else
false
end
@@ -110,6 +121,24 @@ End
tests = Dir.glob("#{File.dirname($0)}/test_*.rb").sort if tests.empty?
pathes = tests.map {|path| File.expand_path(path) }
+ @progress = %w[- \\ | /]
+ @progress_bs = "\b" * @progress[0].size
+ @tty = $stderr.tty?
+ case @color
+ when nil
+ @color = @tty && /dumb/ !~ ENV["TERM"]
+ end
+ @tty &&= !@verbose
+ if @color
+ # dircolors-like style
+ colors = (colors = ENV['TEST_COLORS']) ? Hash[colors.scan(/(\w+)=([^:]*)/)] : {}
+ @passed = "\e[#{colors["pass"] || "32"}m"
+ @failed = "\e[#{colors["fail"] || "31"}m"
+ @reset = "\e[m"
+ @erase = "\r\e[2K\r"
+ else
+ @passed = @failed = @reset = @erase = ""
+ end
unless quiet
puts Time.now
if defined?(RUBY_DESCRIPTION)
@@ -135,11 +164,22 @@ def exec_test(pathes)
@errbuf = []
@location = nil
pathes.each do |path|
- $stderr.print "\n#{File.basename(path)} "
+ @basename = File.basename(path)
+ $stderr.print @basename, " "
$stderr.puts if @verbose
+ count = @count
+ error = @error
load File.expand_path(path)
+ if @tty
+ if @error == error
+ $stderr.print "#{@progress_bs}#{@passed}PASS #{@count-count}#{@reset}"
+ $stderr.print @erase if @quiet
+ else
+ $stderr.print "#{@progress_bs}#{@failed}FAIL #{@error-error}/#{@count-count}#{@reset}"
+ end
+ end
+ $stderr.puts unless @quiet
end
- $stderr.puts
if @error == 0
if @count == 0
$stderr.puts "No tests, no problem"
@@ -159,16 +199,30 @@ end
def show_progress(message = '')
if @verbose
$stderr.print "\##{@count} #{@location} "
+ elsif @tty
+ $stderr.print "#{@progress_bs}#{@progress[@count % @progress.size]}"
end
- faildesc = yield
+ faildesc, errout = with_stderr {yield}
if !faildesc
- $stderr.print '.'
+ if @tty
+ $stderr.print "#{@progress_bs}#{@progress[@count % @progress.size]}"
+ else
+ $stderr.print '.'
+ end
$stderr.puts if @verbose
else
- $stderr.print 'F'
+ $stderr.print "#{@failed}F#{@reset}"
$stderr.puts if @verbose
error faildesc, message
+ unless errout.empty?
+ $stderr.print "#{@failed}stderr output is not empty#{@reset}\n", adjust_indent(errout)
+ end
+ if @tty and !@verbose
+ $stderr.print @basename, " ", @progress[@count % @progress.size]
+ end
end
+rescue Interrupt
+ raise Interrupt
rescue Exception => err
$stderr.print 'E'
$stderr.puts if @verbose
@@ -342,6 +396,7 @@ def get_result_string(src, opt = '')
begin
`#{@ruby} -W0 #{opt} #{filename}`
ensure
+ raise Interrupt if $?.signaled? && $?.termsig == Signal.list["INT"]
raise CoreDumpError, "core dumped" if $? and $?.coredump?
end
else
@@ -349,6 +404,27 @@ def get_result_string(src, opt = '')
end
end
+def with_stderr
+ out = err = nil
+ begin
+ r, w = IO.pipe
+ stderr = $stderr.dup
+ $stderr.reopen(w)
+ w.close
+ reader = Thread.start {r.read}
+ begin
+ out = yield
+ ensure
+ $stderr.reopen(stderr)
+ err = reader.value
+ end
+ ensure
+ w.close rescue nil
+ r.close rescue nil
+ end
+ return out, err
+end
+
def newtest
@location = File.basename(caller(2).first)
@count += 1
@@ -356,7 +432,12 @@ def newtest
end
def error(msg, additional_message)
- @errbuf.push "\##{@count} #{@location}: #{msg} #{additional_message}"
+ msg = "#{@failed}\##{@count} #{@location}#{@reset}: #{msg} #{additional_message}"
+ if @tty
+ $stderr.puts "#{@erase}#{msg}"
+ else
+ @errbuf.push msg
+ end
@error += 1
end
diff --git a/bootstraptest/test_block.rb b/bootstraptest/test_block.rb
index ea6768cc25..6a2ccfc6da 100644
--- a/bootstraptest/test_block.rb
+++ b/bootstraptest/test_block.rb
@@ -565,3 +565,35 @@ assert_normal_exit %q{
t.test_for_bug
}, '[ruby-core:14395]'
+assert_equal 'true', %q{
+ class C0
+ def foo
+ block_given?
+ end
+ end
+
+ class C1 < C0
+ def foo
+ super
+ end
+ end
+
+ C1.new.foo{}
+}
+
+assert_equal 'true', %q{
+ class C0
+ def foo
+ block_given?
+ end
+ end
+
+ class C1 < C0
+ def foo
+ super()
+ end
+ end
+
+ C1.new.foo{}
+}
+
diff --git a/bootstraptest/test_eval.rb b/bootstraptest/test_eval.rb
index c347d50ac9..bf7478006d 100644
--- a/bootstraptest/test_eval.rb
+++ b/bootstraptest/test_eval.rb
@@ -264,24 +264,18 @@ assert_equal 'ok', %q{
}, '[ruby-core:16794]'
assert_equal 'ok', %q{
- begin
- nil.instance_eval {
- def a() :a end
- }
- rescue TypeError
- :ok
- end
-}, '[ruby-core:16796]'
+ nil.instance_eval {
+ def defd_using_instance_eval() :ok end
+ }
+ nil.defd_using_instance_eval
+}, '[ruby-core:28324]'
assert_equal 'ok', %q{
- begin
- nil.instance_exec {
- def a() :a end
- }
- rescue TypeError
- :ok
- end
-}, '[ruby-core:16796]'
+ nil.instance_exec {
+ def defd_using_instance_exec() :ok end
+ }
+ nil.defd_using_instance_exec
+}, '[ruby-core:28324]'
assert_normal_exit %q{
eval("", method(:proc).call {}.binding)
@@ -316,6 +310,15 @@ assert_normal_exit %q{
end
begin
eval "class C; @@h = #{hash.inspect}; end"
- rescue SystemStackError
end
}, '[ruby-core:25714]'
+
+assert_normal_exit %q{
+ begin
+ eval("# encoding:utf-16le\nfoo")
+ rescue Exception => e
+ p e
+ RubyVM::InstructionSequence.compile("p:hello")
+ end
+}, 'check escaping the internal value th->base_block'
+
diff --git a/bootstraptest/test_exception.rb b/bootstraptest/test_exception.rb
index f7d5eeaa07..35c8d25e37 100644
--- a/bootstraptest/test_exception.rb
+++ b/bootstraptest/test_exception.rb
@@ -414,3 +414,19 @@ assert_equal 'exception class/object expected', %q{
e.message
end
}, '[ruby-core:24767]'
+
+assert_equal 'ok', %q{
+ class C
+ def ===(o)
+ true
+ end
+ end
+ begin
+ begin
+ raise
+ rescue C.new
+ end
+ rescue TypeError
+ :ok
+ end
+}
diff --git a/bootstraptest/test_flow.rb b/bootstraptest/test_flow.rb
index 02062755aa..0390062a24 100644
--- a/bootstraptest/test_flow.rb
+++ b/bootstraptest/test_flow.rb
@@ -517,9 +517,75 @@ assert_equal %Q{ENSURE\n}, %q{
end
end
e = Bug2728.new
+}],
+ ['[ruby-core:28132]', %q{
+ class Bug2729
+ include Enumerable
+ def each
+ begin
+ yield :foo
+ ensure
+ proc {}.call
+ end
+ end
+ end
+ e = Bug2729.new
+}],
+ ['[ruby-core:39125]', %q{
+ class Bug5234
+ include Enumerable
+ def each
+ begin
+ yield :foo
+ ensure
+ proc
+ end
+ end
+ end
+ e = Bug5234.new
+}],
+ ['[ruby-dev:45656]', %q{
+ class Bug6460
+ include Enumerable
+ def each
+ begin
+ yield :foo
+ ensure
+ 1.times { Proc.new }
+ end
+ end
+ end
+ e = Bug6460.new
}]].each do |bug, src|
assert_equal "foo", src + %q{e.detect {true}}, bug
assert_equal "true", src + %q{e.any? {true}}, bug
assert_equal "false", src + %q{e.all? {false}}, bug
assert_equal "true", src + %q{e.include?(:foo)}, bug
end
+
+assert_equal "foo", %q{
+ class Bug6460
+ def m1
+ m2 {|e|
+ return e
+ }
+ end
+
+ def m2
+ begin
+ yield :foo
+ ensure
+ begin
+ begin
+ yield :foo
+ ensure
+ Proc.new
+ raise ''
+ end
+ rescue
+ end
+ end
+ end
+ end
+ Bug6460.new.m1
+}, '[ruby-dev:46372]'
diff --git a/bootstraptest/test_literal.rb b/bootstraptest/test_literal.rb
index ab028e2c1e..19200c1ee7 100644
--- a/bootstraptest/test_literal.rb
+++ b/bootstraptest/test_literal.rb
@@ -200,3 +200,25 @@ assert_equal 'ok', %q{
assert_equal 'ok', %q{
"#{}o""#{}k""#{}"
}, '[ruby-core:25284]'
+
+assert_equal 'ok', %q{ # long array literal
+ x = nil
+ eval "a = [#{(1..10_000).map{'x'}.join(", ")}]"
+ :ok
+}
+
+assert_equal 'ok', %q{ # long array literal (optimized)
+ eval "a = [#{(1..10_000).to_a.join(", ")}]"
+ :ok
+}
+
+assert_equal 'ok', %q{ # long hash literal
+ x = nil
+ eval "a = {#{(1..10_000).map{|n| "#{n} => x"}.join(', ')}}"
+ :ok
+}
+
+assert_equal 'ok', %q{ # long hash literal (optimized)
+ eval "a = {#{(1..10_000).map{|n| "#{n} => #{n}"}.join(', ')}}"
+ :ok
+}
diff --git a/bootstraptest/test_method.rb b/bootstraptest/test_method.rb
index 2baf33539d..ed22608aea 100644
--- a/bootstraptest/test_method.rb
+++ b/bootstraptest/test_method.rb
@@ -1184,3 +1184,81 @@ assert_equal 'ok', %q{
'ok'
}, '[ruby-core:30534]'
+# should not cache when splat
+assert_equal 'ok', %q{
+ class C
+ attr_reader :a
+ def initialize
+ @a = 1
+ end
+ end
+
+ def m *args
+ C.new.a(*args)
+ end
+
+ m()
+ begin
+ m(1)
+ rescue ArgumentError
+ 'ok'
+ end
+}
+
+assert_equal 'DC', %q{
+ $result = []
+
+ class C
+ def foo *args
+ $result << 'C'
+ end
+ end
+ class D
+ def foo *args
+ $result << 'D'
+ end
+ end
+
+ o1 = $o1 = C.new
+ o2 = $o2 = D.new
+
+ args = Object.new
+ def args.to_a
+ test1 $o2, nil
+ []
+ end
+ def test1 o, args
+ o.foo(*args)
+ end
+ test1 o1, args
+ $result.join
+}
+
+assert_equal 'DC', %q{
+ $result = []
+
+ class C
+ def foo *args
+ $result << 'C'
+ end
+ end
+ class D
+ def foo *args
+ $result << 'D'
+ end
+ end
+
+ o1 = $o1 = C.new
+ o2 = $o2 = D.new
+
+ block = Object.new
+ def block.to_proc
+ test2 $o2, %w(a, b, c), nil
+ Proc.new{}
+ end
+ def test2 o, args, block
+ o.foo(*args, &block)
+ end
+ test2 o1, [], block
+ $result.join
+}
diff --git a/bootstraptest/test_proc.rb b/bootstraptest/test_proc.rb
index 3d347004ea..c23394e8d2 100644
--- a/bootstraptest/test_proc.rb
+++ b/bootstraptest/test_proc.rb
@@ -456,3 +456,28 @@ assert_equal 'ok', %q{
end
}
+assert_equal 'ok', %q{
+ def x
+ binding
+ end
+ b = x{|a| a }
+ b.eval('yield("ok")')
+}, '[Bug #5634]'
+
+assert_equal 'ok', %q{
+ def x
+ binding
+ end
+ eval("x { 'ok' }").eval "yield"
+}, '[Bug #5634]'
+
+assert_equal 'ok', %q{
+ def x
+ binding
+ end
+ def m
+ x{ 'ok' }
+ end
+ eval('yield', m)
+}, '[Bug #5634]'
+
diff --git a/bootstraptest/test_syntax.rb b/bootstraptest/test_syntax.rb
index ef1c622ace..80eaa6416d 100644
--- a/bootstraptest/test_syntax.rb
+++ b/bootstraptest/test_syntax.rb
@@ -529,7 +529,7 @@ def assert_syntax_error expected, code, message = ''
end
assert_syntax_error "unterminated string meets end of file", '().."', '[ruby-dev:29732]'
assert_equal %q{[]}, %q{$&;[]}, '[ruby-dev:31068]'
-assert_syntax_error "syntax error, unexpected tSTAR, expecting '}'", %q{{*0}}, '[ruby-dev:31072]'
+assert_syntax_error "syntax error, unexpected *, expecting '}'", %q{{*0}}, '[ruby-dev:31072]'
assert_syntax_error "`@0' is not allowed as an instance variable name", %q{@0..0}, '[ruby-dev:31095]'
assert_syntax_error "identifier $00 is not valid to get", %q{$00..0}, '[ruby-dev:31100]'
assert_syntax_error "identifier $00 is not valid to set", %q{0..$00=1}
@@ -541,7 +541,7 @@ assert_equal %q{1}, %q{
assert_syntax_error "Can't set variable $1", %q{0..$1=1}, '[ruby-dev:31118]'
assert_valid_syntax %q{1.times{1+(1&&next)}}, '[ruby-dev:31119]'
assert_valid_syntax %q{x=-1;loop{x+=1&&redo if (x+=1).zero?}}, '[ruby-dev:31119]'
-assert_syntax_error %q{syntax error, unexpected $end}, %q{!}, '[ruby-dev:31243]'
+assert_syntax_error %q{syntax error, unexpected end-of-input}, %q{!}, '[ruby-dev:31243]'
assert_equal %q{[nil]}, %q{[()]}, '[ruby-dev:31252]'
assert_equal %q{true}, %q{!_=()}, '[ruby-dev:31263]'
assert_equal 'ok', %q{while true; redo; end if 1 == 2; :ok}, '[ruby-dev:31360]'
diff --git a/bootstraptest/test_thread.rb b/bootstraptest/test_thread.rb
index 2494cccbf3..19799ab4d3 100644
--- a/bootstraptest/test_thread.rb
+++ b/bootstraptest/test_thread.rb
@@ -380,7 +380,9 @@ assert_equal 'ok', %q{
assert_equal 'ok', %q{
begin
- 10000.times { Thread.new(true) {|x| x == false } }
+ 100.times{
+ (1..100).map{ Thread.new(true) {|x| x == false } }.each{|th| th.join}
+ }
rescue NoMemoryError, StandardError
end
:ok
diff --git a/class.c b/class.c
index df19812d15..e083bf633d 100644
--- a/class.c
+++ b/class.c
@@ -49,15 +49,16 @@ static ID id_attached;
static VALUE
class_alloc(VALUE flags, VALUE klass)
{
- rb_classext_t *ext = ALLOC(rb_classext_t);
- NEWOBJ(obj, struct RClass);
- OBJSETUP(obj, klass, flags);
- obj->ptr = ext;
+ NEWOBJ_OF(obj, struct RClass, klass, flags);
+ obj->ptr = ALLOC(rb_classext_t);
RCLASS_IV_TBL(obj) = 0;
RCLASS_CONST_TBL(obj) = 0;
RCLASS_M_TBL(obj) = 0;
RCLASS_SUPER(obj) = 0;
+ RCLASS_ORIGIN(obj) = (VALUE)obj;
RCLASS_IV_INDEX_TBL(obj) = 0;
+ RCLASS_REFINED_CLASS(obj) = Qnil;
+ RCLASS_EXT(obj)->allocator = 0;
return (VALUE)obj;
}
@@ -93,7 +94,7 @@ rb_class_boot(VALUE super)
void
rb_check_inheritable(VALUE super)
{
- if (TYPE(super) != T_CLASS) {
+ if (!RB_TYPE_P(super, T_CLASS)) {
rb_raise(rb_eTypeError, "superclass must be a Class (%s given)",
rb_obj_classname(super));
}
@@ -120,27 +121,26 @@ rb_class_new(VALUE super)
return rb_class_boot(super);
}
-struct clone_method_data {
- st_table *tbl;
- VALUE klass;
-};
-
-VALUE rb_iseq_clone(VALUE iseqval, VALUE newcbase);
-
-static int
-clone_method(ID mid, const rb_method_entry_t *me, struct clone_method_data *data)
+static void
+clone_method(VALUE klass, ID mid, const rb_method_entry_t *me)
{
VALUE newiseqval;
if (me->def && me->def->type == VM_METHOD_TYPE_ISEQ) {
rb_iseq_t *iseq;
- newiseqval = rb_iseq_clone(me->def->body.iseq->self, data->klass);
+ newiseqval = rb_iseq_clone(me->def->body.iseq->self, klass);
GetISeqPtr(newiseqval, iseq);
- rb_add_method(data->klass, mid, VM_METHOD_TYPE_ISEQ, iseq, me->flag);
+ rb_add_method(klass, mid, VM_METHOD_TYPE_ISEQ, iseq, me->flag);
RB_GC_GUARD(newiseqval);
}
else {
- rb_method_entry_set(data->klass, mid, me, me->flag);
+ rb_method_entry_set(klass, mid, me, me->flag);
}
+}
+
+static int
+clone_method_i(st_data_t key, st_data_t value, st_data_t data)
+{
+ clone_method((VALUE)data, (ID)key, (const rb_method_entry_t *)value);
return ST_CONTINUE;
}
@@ -169,6 +169,7 @@ rb_mod_init_copy(VALUE clone, VALUE orig)
rb_singleton_class_attached(RBASIC(clone)->klass, (VALUE)clone);
}
RCLASS_SUPER(clone) = RCLASS_SUPER(orig);
+ RCLASS_EXT(clone)->allocator = RCLASS_EXT(orig)->allocator;
if (RCLASS_IV_TBL(orig)) {
st_data_t id;
@@ -176,6 +177,8 @@ rb_mod_init_copy(VALUE clone, VALUE orig)
st_free_table(RCLASS_IV_TBL(clone));
}
RCLASS_IV_TBL(clone) = st_copy(RCLASS_IV_TBL(orig));
+ CONST_ID(id, "__tmp_classpath__");
+ st_delete(RCLASS_IV_TBL(clone), &id, 0);
CONST_ID(id, "__classpath__");
st_delete(RCLASS_IV_TBL(clone), &id, 0);
CONST_ID(id, "__classid__");
@@ -189,15 +192,11 @@ rb_mod_init_copy(VALUE clone, VALUE orig)
st_foreach(RCLASS_CONST_TBL(orig), clone_const_i, (st_data_t)RCLASS_CONST_TBL(clone));
}
if (RCLASS_M_TBL(orig)) {
- struct clone_method_data data;
-
if (RCLASS_M_TBL(clone)) {
rb_free_m_table(RCLASS_M_TBL(clone));
}
- data.tbl = RCLASS_M_TBL(clone) = st_init_numtable();
- data.klass = clone;
- st_foreach(RCLASS_M_TBL(orig), clone_method,
- (st_data_t)&data);
+ RCLASS_M_TBL(clone) = st_init_numtable();
+ st_foreach(RCLASS_M_TBL(orig), clone_method_i, (st_data_t)clone);
}
return clone;
@@ -227,18 +226,18 @@ rb_singleton_class_clone(VALUE obj)
if (!FL_TEST(klass, FL_SINGLETON))
return klass;
else {
- struct clone_method_data data;
/* copy singleton(unnamed) class */
- VALUE clone = class_alloc((RBASIC(klass)->flags & ~(FL_MARK)), 0);
+ VALUE clone = class_alloc(RBASIC(klass)->flags, 0);
if (BUILTIN_TYPE(obj) == T_CLASS) {
- RBASIC(clone)->klass = (VALUE)clone;
+ RBASIC(clone)->klass = clone;
}
else {
RBASIC(clone)->klass = rb_singleton_class_clone(klass);
}
RCLASS_SUPER(clone) = RCLASS_SUPER(klass);
+ RCLASS_EXT(clone)->allocator = RCLASS_EXT(klass)->allocator;
if (RCLASS_IV_TBL(klass)) {
RCLASS_IV_TBL(clone) = st_copy(RCLASS_IV_TBL(klass));
}
@@ -247,13 +246,10 @@ rb_singleton_class_clone(VALUE obj)
st_foreach(RCLASS_CONST_TBL(klass), clone_const_i, (st_data_t)RCLASS_CONST_TBL(clone));
}
RCLASS_M_TBL(clone) = st_init_numtable();
- data.tbl = RCLASS_M_TBL(clone);
- data.klass = (VALUE)clone;
- st_foreach(RCLASS_M_TBL(klass), clone_method,
- (st_data_t)&data);
- rb_singleton_class_attached(RBASIC(clone)->klass, (VALUE)clone);
+ st_foreach(RCLASS_M_TBL(klass), clone_method_i, (st_data_t)clone);
+ rb_singleton_class_attached(RBASIC(clone)->klass, clone);
FL_SET(clone, FL_SINGLETON);
- return (VALUE)clone;
+ return clone;
}
}
@@ -472,7 +468,7 @@ rb_define_class(const char *name, VALUE super)
id = rb_intern(name);
if (rb_const_defined(rb_cObject, id)) {
klass = rb_const_get(rb_cObject, id);
- if (TYPE(klass) != T_CLASS) {
+ if (!RB_TYPE_P(klass, T_CLASS)) {
rb_raise(rb_eTypeError, "%s is not a class", name);
}
if (rb_class_real(RCLASS_SUPER(klass)) != super) {
@@ -539,7 +535,7 @@ rb_define_class_id_under(VALUE outer, ID id, VALUE super)
if (rb_const_defined_at(outer, id)) {
klass = rb_const_get_at(outer, id);
- if (TYPE(klass) != T_CLASS) {
+ if (!RB_TYPE_P(klass, T_CLASS)) {
rb_raise(rb_eTypeError, "%s is not a class", rb_id2name(id));
}
if (rb_class_real(RCLASS_SUPER(klass)) != super) {
@@ -590,7 +586,7 @@ rb_define_module(const char *name)
id = rb_intern(name);
if (rb_const_defined(rb_cObject, id)) {
module = rb_const_get(rb_cObject, id);
- if (TYPE(module) == T_MODULE)
+ if (RB_TYPE_P(module, T_MODULE))
return module;
rb_raise(rb_eTypeError, "%s is not a module", rb_obj_classname(module));
}
@@ -614,7 +610,7 @@ rb_define_module_id_under(VALUE outer, ID id)
if (rb_const_defined_at(outer, id)) {
module = rb_const_get_at(outer, id);
- if (TYPE(module) == T_MODULE)
+ if (RB_TYPE_P(module, T_MODULE))
return module;
rb_raise(rb_eTypeError, "%s::%s is not a module",
rb_class2name(outer), rb_obj_classname(module));
@@ -627,8 +623,8 @@ rb_define_module_id_under(VALUE outer, ID id)
return module;
}
-static VALUE
-include_class_new(VALUE module, VALUE super)
+VALUE
+rb_include_class_new(VALUE module, VALUE super)
{
VALUE klass = class_alloc(T_ICLASS, rb_cClass);
@@ -643,9 +639,9 @@ include_class_new(VALUE module, VALUE super)
}
RCLASS_IV_TBL(klass) = RCLASS_IV_TBL(module);
RCLASS_CONST_TBL(klass) = RCLASS_CONST_TBL(module);
- RCLASS_M_TBL(klass) = RCLASS_M_TBL(module);
+ RCLASS_M_TBL(klass) = RCLASS_M_TBL(RCLASS_ORIGIN(module));
RCLASS_SUPER(klass) = super;
- if (TYPE(module) == T_ICLASS) {
+ if (RB_TYPE_P(module, T_ICLASS)) {
RBASIC(klass)->klass = RBASIC(module)->klass;
}
else {
@@ -657,10 +653,11 @@ include_class_new(VALUE module, VALUE super)
return (VALUE)klass;
}
+static int include_modules_at(VALUE klass, VALUE c, VALUE module);
+
void
rb_include_module(VALUE klass, VALUE module)
{
- VALUE p, c;
int changed = 0;
rb_frozen_class_p(klass);
@@ -668,17 +665,31 @@ rb_include_module(VALUE klass, VALUE module)
rb_secure(4);
}
- if (TYPE(module) != T_MODULE) {
+ if (!RB_TYPE_P(module, T_MODULE)) {
Check_Type(module, T_MODULE);
}
OBJ_INFECT(klass, module);
- c = klass;
+
+ changed = include_modules_at(klass, RCLASS_ORIGIN(klass), module);
+ if (changed < 0)
+ rb_raise(rb_eArgError, "cyclic include detected");
+ if (changed) rb_clear_cache();
+}
+
+static int
+include_modules_at(VALUE klass, VALUE c, VALUE module)
+{
+ VALUE p;
+ int changed = 0;
+
while (module) {
int superclass_seen = FALSE;
- if (RCLASS_M_TBL(klass) == RCLASS_M_TBL(module))
- rb_raise(rb_eArgError, "cyclic include detected");
+ if (RCLASS_ORIGIN(module) != module)
+ goto skip;
+ if (RCLASS_M_TBL(klass) && RCLASS_M_TBL(klass) == RCLASS_M_TBL(module))
+ return -1;
/* ignore if the module included already in superclasses */
for (p = RCLASS_SUPER(klass); p; p = RCLASS_SUPER(p)) {
switch (BUILTIN_TYPE(p)) {
@@ -695,12 +706,43 @@ rb_include_module(VALUE klass, VALUE module)
break;
}
}
- c = RCLASS_SUPER(c) = include_class_new(module, RCLASS_SUPER(c));
+ c = RCLASS_SUPER(c) = rb_include_class_new(module, RCLASS_SUPER(c));
if (RMODULE_M_TBL(module) && RMODULE_M_TBL(module)->num_entries)
changed = 1;
skip:
module = RCLASS_SUPER(module);
}
+
+ return changed;
+}
+
+void
+rb_prepend_module(VALUE klass, VALUE module)
+{
+ VALUE origin;
+ int changed = 0;
+
+ rb_frozen_class_p(klass);
+ if (!OBJ_UNTRUSTED(klass)) {
+ rb_secure(4);
+ }
+
+ Check_Type(module, T_MODULE);
+
+ OBJ_INFECT(klass, module);
+
+ origin = RCLASS_ORIGIN(klass);
+ if (origin == klass) {
+ origin = class_alloc(T_ICLASS, klass);
+ RCLASS_SUPER(origin) = RCLASS_SUPER(klass);
+ RCLASS_SUPER(klass) = origin;
+ RCLASS_ORIGIN(klass) = origin;
+ RCLASS_M_TBL(origin) = RCLASS_M_TBL(klass);
+ RCLASS_M_TBL(klass) = 0;
+ }
+ changed = include_modules_at(klass, klass, module);
+ if (changed < 0)
+ rb_raise(rb_eArgError, "cyclic prepend detected");
if (changed) rb_clear_cache();
}
@@ -795,7 +837,7 @@ rb_mod_ancestors(VALUE mod)
if (BUILTIN_TYPE(p) == T_ICLASS) {
rb_ary_push(ary, RBASIC(p)->klass);
}
- else {
+ else if (p == RCLASS_ORIGIN(p)) {
rb_ary_push(ary, p);
}
}
@@ -857,10 +899,6 @@ method_entry_i(st_data_t key, st_data_t value, st_data_t data)
st_table *list = (st_table *)data;
long type;
- if ((ID)key == ID_ALLOCATOR) {
- return ST_CONTINUE;
- }
-
if (!st_lookup(list, key, 0)) {
if (UNDEFINED_METHOD_ENTRY_P(me)) {
type = -1; /* none */
@@ -877,7 +915,7 @@ static VALUE
class_instance_method_list(int argc, VALUE *argv, VALUE mod, int obj, int (*func) (st_data_t, st_data_t, st_data_t))
{
VALUE ary;
- int recur;
+ int recur, prepended = 0;
st_table *list;
if (argc == 0) {
@@ -889,10 +927,15 @@ class_instance_method_list(int argc, VALUE *argv, VALUE mod, int obj, int (*func
recur = RTEST(r);
}
+ if (!recur && RCLASS_ORIGIN(mod) != mod) {
+ mod = RCLASS_ORIGIN(mod);
+ prepended = 1;
+ }
+
list = st_init_numtable();
for (; mod; mod = RCLASS_SUPER(mod)) {
- st_foreach(RCLASS_M_TBL(mod), method_entry_i, (st_data_t)list);
- if (BUILTIN_TYPE(mod) == T_ICLASS) continue;
+ if (RCLASS_M_TBL(mod)) st_foreach(RCLASS_M_TBL(mod), method_entry_i, (st_data_t)list);
+ if (BUILTIN_TYPE(mod) == T_ICLASS && !prepended) continue;
if (obj && FL_TEST(mod, FL_SINGLETON)) continue;
if (!recur) break;
}
@@ -991,11 +1034,13 @@ rb_class_public_instance_methods(int argc, VALUE *argv, VALUE mod)
/*
* call-seq:
- * obj.methods -> array
+ * obj.methods(all=true) -> array
*
* Returns a list of the names of public and protected methods of
* <i>obj</i>. This will include all the methods accessible in
* <i>obj</i>'s ancestors.
+ * If the <i>all</i> parameter is set to <code>false</code>, only those methods
+ * in the receiver will be listed.
*
* class Klass
* def klass_method()
@@ -1013,9 +1058,6 @@ rb_obj_methods(int argc, VALUE *argv, VALUE obj)
{
retry:
if (argc == 0) {
- VALUE args[1];
-
- args[0] = Qtrue;
return class_instance_method_list(argc, argv, CLASS_OF(obj), 1, ins_methods_i);
}
else {
@@ -1123,12 +1165,14 @@ rb_obj_singleton_methods(int argc, VALUE *argv, VALUE obj)
klass = CLASS_OF(obj);
list = st_init_numtable();
if (klass && FL_TEST(klass, FL_SINGLETON)) {
- st_foreach(RCLASS_M_TBL(klass), method_entry_i, (st_data_t)list);
+ if (RCLASS_M_TBL(klass))
+ st_foreach(RCLASS_M_TBL(klass), method_entry_i, (st_data_t)list);
klass = RCLASS_SUPER(klass);
}
if (RTEST(recur)) {
- while (klass && (FL_TEST(klass, FL_SINGLETON) || TYPE(klass) == T_ICLASS)) {
- st_foreach(RCLASS_M_TBL(klass), method_entry_i, (st_data_t)list);
+ while (klass && (FL_TEST(klass, FL_SINGLETON) || RB_TYPE_P(klass, T_ICLASS))) {
+ if (RCLASS_M_TBL(klass))
+ st_foreach(RCLASS_M_TBL(klass), method_entry_i, (st_data_t)list);
klass = RCLASS_SUPER(klass);
}
}
@@ -1240,6 +1284,20 @@ rb_undef_method(VALUE klass, const char *name)
}\
} while (0)
+static inline VALUE
+special_singleton_class_of(VALUE obj)
+{
+ SPECIAL_SINGLETON(Qnil, rb_cNilClass);
+ SPECIAL_SINGLETON(Qfalse, rb_cFalseClass);
+ SPECIAL_SINGLETON(Qtrue, rb_cTrueClass);
+ return Qnil;
+}
+
+VALUE
+rb_special_singleton_class(VALUE obj)
+{
+ return special_singleton_class_of(obj);
+}
/*!
* \internal
@@ -1255,14 +1313,20 @@ singleton_class_of(VALUE obj)
{
VALUE klass;
- if (FIXNUM_P(obj) || SYMBOL_P(obj)) {
+ if (FIXNUM_P(obj) || FLONUM_P(obj) || SYMBOL_P(obj)) {
rb_raise(rb_eTypeError, "can't define singleton");
}
- if (rb_special_const_p(obj)) {
- SPECIAL_SINGLETON(Qnil, rb_cNilClass);
- SPECIAL_SINGLETON(Qfalse, rb_cFalseClass);
- SPECIAL_SINGLETON(Qtrue, rb_cTrueClass);
- rb_bug("unknown immediate %p", (void *)obj);
+ if (SPECIAL_CONST_P(obj)) {
+ klass = special_singleton_class_of(obj);
+ if (NIL_P(klass))
+ rb_bug("unknown immediate %p", (void *)obj);
+ return klass;
+ }
+ else {
+ enum ruby_value_type type = BUILTIN_TYPE(obj);
+ if (type == T_FLOAT || type == T_BIGNUM) {
+ rb_raise(rb_eTypeError, "can't define singleton");
+ }
}
if (FL_TEST(RBASIC(obj)->klass, FL_SINGLETON) &&
@@ -1314,7 +1378,7 @@ rb_singleton_class(VALUE obj)
VALUE klass = singleton_class_of(obj);
/* ensures an exposed class belongs to its own eigenclass */
- if (TYPE(obj) == T_CLASS) (void)ENSURE_EIGENCLASS(klass);
+ if (RB_TYPE_P(obj, T_CLASS)) (void)ENSURE_EIGENCLASS(klass);
return klass;
}
@@ -1399,7 +1463,7 @@ rb_define_attr(VALUE klass, const char *name, int read, int write)
int
rb_obj_basic_to_s_p(VALUE obj)
{
- const rb_method_entry_t *me = rb_method_entry(CLASS_OF(obj), rb_intern("to_s"));
+ const rb_method_entry_t *me = rb_method_entry(CLASS_OF(obj), rb_intern("to_s"), 0);
if (me && me->def && me->def->type == VM_METHOD_TYPE_CFUNC &&
me->def->body.cfunc.func == rb_any_to_s)
return 1;
@@ -1472,7 +1536,7 @@ rb_scan_args(int argc, const VALUE *argv, const char *fmt, ...)
argc--;
}
else {
- hash = rb_check_convert_type(last, T_HASH, "Hash", "to_hash");
+ hash = rb_check_hash_type(last);
if (!NIL_P(hash))
argc--;
}
@@ -1530,18 +1594,12 @@ rb_scan_args(int argc, const VALUE *argv, const char *fmt, ...)
}
va_end(vargs);
- if (argi < argc)
- goto argc_error;
+ if (argi < argc) {
+ argc_error:
+ rb_error_arity(argc, n_mand, f_var ? UNLIMITED_ARGUMENTS : n_mand + n_opt);
+ }
return argc;
-
- argc_error:
- if (0 < n_opt)
- rb_raise(rb_eArgError, "wrong number of arguments (%d for %d..%d%s)",
- argc, n_mand, n_mand + n_opt, f_var ? "+" : "");
- else
- rb_raise(rb_eArgError, "wrong number of arguments (%d for %d%s)",
- argc, n_mand, f_var ? "+" : "");
}
/*!
diff --git a/common.mk b/common.mk
index ea244cca83..1738b95e0c 100644
--- a/common.mk
+++ b/common.mk
@@ -2,17 +2,15 @@ bin: $(PROGRAM) $(WPROGRAM)
lib: $(LIBRUBY)
dll: $(LIBRUBY_SO)
-.SUFFIXES: .inc .h .c .y .i
+.SUFFIXES: .inc .h .c .y .i .$(DTRACE_EXT)
# V=0 quiet, V=1 verbose. other values don't work.
V = 0
Q1 = $(V:1=)
Q = $(Q1:0=@)
-n=$(NULLCMD)
-ECHO1 = $(V:1=@$n)
ECHO = $(ECHO1:0=@echo)
-RUBYLIB = -
+RUBYLIB = $(PATH_SEPARATOR)
RUBYOPT = -
RUN_OPTS = --disable-gems
@@ -26,15 +24,16 @@ EXTCONF = extconf.rb
RBCONFIG = ./.rbconfig.time
LIBRUBY_EXTS = ./.libruby-with-ext.time
REVISION_H = ./.revision.time
+PLATFORM_D = ./$(PLATFORM_DIR)/.time
RDOCOUT = $(EXTOUT)/rdoc
CAPIOUT = doc/capi
-ID_H_TARGET = -id.h-
DMYEXT = dmyext.$(OBJEXT)
NORMALMAINOBJ = main.$(OBJEXT)
MAINOBJ = $(NORMALMAINOBJ)
-EXTOBJS =
+EXTOBJS =
DLDOBJS = $(DMYEXT)
+EXTSOLIBS =
MINIOBJS = $(ARCHMINIOBJS) dmyencoding.$(OBJEXT) dmyversion.$(OBJEXT) miniprelude.$(OBJEXT)
ENC_MK = enc.mk
@@ -91,18 +90,21 @@ COMMONOBJS = array.$(OBJEXT) \
iseq.$(OBJEXT) \
vm.$(OBJEXT) \
vm_dump.$(OBJEXT) \
+ vm_backtrace.$(OBJEXT) \
+ vm_trace.$(OBJEXT) \
thread.$(OBJEXT) \
cont.$(OBJEXT) \
$(BUILTIN_ENCOBJS) \
$(BUILTIN_TRANSOBJS) \
$(MISSING)
-EXPORTOBJS = dln.$(OBJEXT) \
+EXPORTOBJS = $(DLNOBJ) \
encoding.$(OBJEXT) \
version.$(OBJEXT) \
$(COMMONOBJS)
OBJS = $(EXPORTOBJS) prelude.$(OBJEXT)
+ALLOBJS = $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(DMYEXT)
GOLFOBJS = goruby.$(OBJEXT) golf_prelude.$(OBJEXT)
@@ -123,7 +125,8 @@ INSTRUBY = $(SUDO) $(MINIRUBY) $(srcdir)/tool/rbinstall.rb
INSTRUBY_ARGS = $(SCRIPT_ARGS) \
--data-mode=$(INSTALL_DATA_MODE) \
--prog-mode=$(INSTALL_PROG_MODE) \
- --installed-list $(INSTALLED_LIST)
+ --installed-list $(INSTALLED_LIST) \
+ --mantype="$(MANTYPE)"
INSTALL_PROG_MODE = 0755
INSTALL_DATA_MODE = 0644
@@ -141,7 +144,7 @@ COMPILE_PRELUDE = $(MINIRUBY) -I$(srcdir) $(srcdir)/tool/compile_prelude.rb
all: showflags main docs
-main: showflags encs exts
+main: showflags $(EXTSTATIC:static=lib)encs exts
@$(NULLCMD)
.PHONY: showflags
@@ -167,16 +170,17 @@ showconfig:
exts: build-ext
EXTS_MK = exts.mk
-$(EXTS_MK): $(MKFILES) incs $(PREP) $(RBCONFIG) $(LIBRUBY)
- @$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" --command-output=$(EXTS_MK) $(EXTMK_ARGS) configure
+$(EXTS_MK): $(MKFILES) all-incs $(PREP) $(RBCONFIG) $(LIBRUBY)
+ $(ECHO) generating makefile $@
+ $(Q)$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" --command-output=$(EXTS_MK) $(EXTMK_ARGS) configure
configure-ext: $(EXTS_MK)
build-ext: $(EXTS_MK)
- $(Q)$(MAKE) -f $(EXTS_MK) $(MFLAGS)
+ $(Q)$(MAKE) -f $(EXTS_MK) $(MFLAGS) $(EXTSTATIC) LIBRUBY_EXTS=$(LIBRUBY_EXTS) ENCOBJS="$(ENCOBJS)"
-$(MKMAIN_CMD): $(MKFILES) incs $(PREP) $(RBCONFIG) $(LIBRUBY)
- @$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" --command-output=$@ $(EXTMK_ARGS)
+$(MKMAIN_CMD): $(MKFILES) all-incs $(PREP) $(RBCONFIG) $(LIBRUBY)
+ $(Q)$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" --command-output=$@ $(EXTMK_ARGS)
prog: program wprogram
@@ -185,18 +189,20 @@ loadpath: $(PREP) PHONY
$(PREP): $(MKFILES)
-miniruby$(EXEEXT): config.status $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(DMYEXT) $(ARCHFILE)
+miniruby$(EXEEXT): config.status $(ALLOBJS) $(ARCHFILE) $(DTRACE_OBJ)
+
+objs: $(ALLOBJS)
GORUBY = go$(RUBY_INSTALL_NAME)
golf: $(LIBRUBY) $(GOLFOBJS) PHONY
$(Q) $(MAKE) $(MFLAGS) MAINOBJ="$(GOLFOBJS)" PROGRAM=$(GORUBY)$(EXEEXT) program
capi: $(CAPIOUT)/.timestamp PHONY
-doc/capi/.timestamp: Doxyfile $(PREP)
- $(Q) $(MAKEDIRS) doc/capi
+$(CAPIOUT)/.timestamp: Doxyfile $(PREP)
+ $(Q) $(MAKEDIRS) "$(@D)"
$(ECHO) generating capi
$(Q) $(DOXYGEN) -b
- $(Q) $(MINIRUBY) -e 'File.open("$(CAPIOUT)/.timestamp", "w"){|f| f.puts(Time.now)}'
+ $(Q) $(MINIRUBY) -e 'File.open(ARGV[0], "w"){|f| f.puts(Time.now)}' "$@"
Doxyfile: $(srcdir)/template/Doxyfile.tmpl $(PREP) $(srcdir)/tool/generic_erb.rb $(RBCONFIG)
$(ECHO) generating $@
@@ -206,9 +212,9 @@ Doxyfile: $(srcdir)/template/Doxyfile.tmpl $(PREP) $(srcdir)/tool/generic_erb.rb
program: showflags $(PROGRAM)
wprogram: showflags $(WPROGRAM)
-$(PROGRAM): $(LIBRUBY) $(MAINOBJ) $(OBJS) $(EXTOBJS) $(SETUP) $(PREP)
+$(PROGRAM) $(WPROGRAM): $(LIBRUBY) $(MAINOBJ) $(OBJS) $(EXTOBJS) $(SETUP) $(PREP)
-$(LIBRUBY_A): $(OBJS) $(DMYEXT) $(ARCHFILE)
+$(LIBRUBY_A): $(OBJS) $(MAINOBJ) $(DTRACE_OBJ) $(DTRACE_GLOMMED_OBJ) $(DMYEXT) $(ARCHFILE)
$(LIBRUBY_SO): $(OBJS) $(DLDOBJS) $(LIBRUBY_A) $(PREP) $(LIBRUBY_SO_UPDATE) $(BUILTIN_ENCOBJS)
@@ -216,11 +222,11 @@ $(LIBRUBY_EXTS):
@exit > $@
$(STATIC_RUBY)$(EXEEXT): $(MAINOBJ) $(DLDOBJS) $(EXTOBJS) $(LIBRUBY_A)
- @$(RM) $@
+ $(Q)$(RM) $@
$(PURIFY) $(CC) $(MAINOBJ) $(DLDOBJS) $(EXTOBJS) $(LIBRUBY_A) $(MAINLIBS) $(EXTLIBS) $(LIBS) $(OUTFLAG)$@ $(LDFLAGS) $(XLDFLAGS)
ruby.imp: $(EXPORTOBJS)
- @$(NM) -Pgp $(EXPORTOBJS) | \
+ $(Q)$(NM) -Pgp $(EXPORTOBJS) | \
awk 'BEGIN{print "#!"}; $$2~/^[BDT]$$/&&$$1!~/^(Init_|.*_threadptr_|\.)/{print $$1}' | \
sort -u -o $@
@@ -231,32 +237,32 @@ $(ruby_pc): $(srcdir)/template/ruby.pc.in config.status
install-all: docs pre-install-all do-install-all post-install-all
pre-install-all:: pre-install-local pre-install-ext pre-install-doc
-do-install-all: $(PROGRAM)
+do-install-all: all
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=all --rdoc-output="$(RDOCOUT)"
post-install-all:: post-install-local post-install-ext post-install-doc
@$(NULLCMD)
install-nodoc: pre-install-nodoc do-install-nodoc post-install-nodoc
pre-install-nodoc:: pre-install-local pre-install-ext
-do-install-nodoc: $(PREP)
- $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --mantype="$(MANTYPE)"
+do-install-nodoc: main
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS)
post-install-nodoc:: post-install-local post-install-ext
install-local: pre-install-local do-install-local post-install-local
pre-install-local:: pre-install-bin pre-install-lib pre-install-man
-do-install-local: $(PREP)
- $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=local --mantype="$(MANTYPE)"
+do-install-local: $(PROGRAM)
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=local
post-install-local:: post-install-bin post-install-lib post-install-man
install-ext: pre-install-ext do-install-ext post-install-ext
pre-install-ext:: pre-install-ext-arch pre-install-ext-comm
-do-install-ext: $(PREP)
+do-install-ext: exts
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext
post-install-ext:: post-install-ext-arch post-install-ext-comm
install-arch: pre-install-arch do-install-arch post-install-arch
pre-install-arch:: pre-install-bin pre-install-ext-arch
-do-install-arch: $(PREP)
+do-install-arch: main
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=bin --install=ext-arch
post-install-arch:: post-install-bin post-install-ext-arch
@@ -268,7 +274,7 @@ post-install-comm:: post-install-lib post-install-ext-comm post-install-man
install-bin: pre-install-bin do-install-bin post-install-bin
pre-install-bin:: install-prereq
-do-install-bin: $(PREP)
+do-install-bin: $(PROGRAM)
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=bin
post-install-bin::
@$(NULLCMD)
@@ -282,14 +288,14 @@ post-install-lib::
install-ext-comm: pre-install-ext-comm do-install-ext-comm post-install-ext-comm
pre-install-ext-comm:: install-prereq
-do-install-ext-comm: $(PREP)
+do-install-ext-comm: exts
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext-comm
post-install-ext-comm::
@$(NULLCMD)
install-ext-arch: pre-install-ext-arch do-install-ext-arch post-install-ext-arch
pre-install-ext-arch:: install-prereq
-do-install-ext-arch: $(PREP)
+do-install-ext-arch: exts
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=ext-arch
post-install-ext-arch::
@$(NULLCMD)
@@ -297,7 +303,7 @@ post-install-ext-arch::
install-man: pre-install-man do-install-man post-install-man
pre-install-man:: install-prereq
do-install-man: $(PREP)
- $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=man --mantype="$(MANTYPE)"
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=man
post-install-man::
@$(NULLCMD)
@@ -322,14 +328,14 @@ what-where-nodoc: no-install-nodoc
no-install-nodoc: pre-no-install-nodoc dont-install-nodoc post-no-install-nodoc
pre-no-install-nodoc:: pre-no-install-local pre-no-install-ext
dont-install-nodoc: $(PREP)
- $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --mantype="$(MANTYPE)"
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS)
post-no-install-nodoc:: post-no-install-local post-no-install-ext
what-where-local: no-install-local
no-install-local: pre-no-install-local dont-install-local post-no-install-local
pre-no-install-local:: pre-no-install-bin pre-no-install-lib pre-no-install-man
dont-install-local: $(PREP)
- $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=local --mantype="$(MANTYPE)"
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=local
post-no-install-local:: post-no-install-bin post-no-install-lib post-no-install-man
what-where-ext: no-install-ext
@@ -389,7 +395,7 @@ what-where-man: no-install-man
no-install-man: pre-no-install-man dont-install-man post-no-install-man
pre-no-install-man:: install-prereq
dont-install-man: $(PREP)
- $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=man --mantype="$(MANTYPE)"
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=man
post-no-install-man::
@$(NULLCMD)
@@ -402,11 +408,11 @@ post-install-doc::
rdoc: PHONY main
@echo Generating RDoc documentation
- $(Q) $(XRUBY) "$(srcdir)/bin/rdoc" --encoding=UTF-8 --no-force-update --all --ri --op "$(RDOCOUT)" $(RDOCFLAGS) "$(srcdir)"
+ $(Q) $(XRUBY) "$(srcdir)/bin/rdoc" --root "$(srcdir)" --encoding=UTF-8 --no-force-update --all --ri --op "$(RDOCOUT)" --debug $(RDOCFLAGS) "$(srcdir)"
rdoc-coverage: PHONY main
@echo Generating RDoc coverage report
- $(Q) $(XRUBY) "$(srcdir)/bin/rdoc" --encoding=UTF-8 --all --quiet -C $(RDOCFLAGS) "$(srcdir)"
+ $(Q) $(XRUBY) "$(srcdir)/bin/rdoc" --root "$(srcdir)" --encoding=UTF-8 --all --quiet -C $(RDOCFLAGS) "$(srcdir)"
nodoc: PHONY
@@ -425,85 +431,91 @@ install-prereq: $(CLEAR_INSTALLED_LIST) PHONY
clear-installed-list: PHONY
@> $(INSTALLED_LIST) set MAKE="$(MAKE)"
-clean: clean-ext clean-local clean-enc clean-golf clean-rdoc clean-capi clean-extout
+clean: clean-ext clean-local clean-enc clean-golf clean-rdoc clean-capi clean-extout clean-platform
clean-local:: PHONY
- @$(RM) $(OBJS) $(MINIOBJS) $(MAINOBJ) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY) $(LIBRUBY_ALIASES)
- @$(RM) $(PROGRAM) $(WPROGRAM) miniruby$(EXEEXT) dmyext.$(OBJEXT) $(ARCHFILE) .*.time
- @$(RM) y.tab.c y.output encdb.h transdb.h prelude.c config.log rbconfig.rb $(ruby_pc)
+ $(Q)$(RM) $(OBJS) $(MINIOBJS) $(MAINOBJ) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY) $(LIBRUBY_ALIASES)
+ $(Q)$(RM) $(PROGRAM) $(WPROGRAM) miniruby$(EXEEXT) dmyext.$(OBJEXT) $(ARCHFILE) .*.time
+ $(Q)$(RM) y.tab.c y.output encdb.h transdb.h prelude.c config.log rbconfig.rb $(ruby_pc) probes.h probes.$(OBJEXT) probes.stamp ruby-glommed.$(OBJEXT)
clean-ext:: PHONY
clean-golf: PHONY
- @$(RM) $(GORUBY)$(EXEEXT) $(GOLFOBJS)
+ $(Q)$(RM) $(GORUBY)$(EXEEXT) $(GOLFOBJS)
clean-rdoc: PHONY
clean-capi: PHONY
+clean-platform: PHONY
clean-extout: PHONY
clean-docs: clean-rdoc clean-capi
-distclean: distclean-ext distclean-local distclean-enc distclean-golf distclean-extout
+distclean: distclean-ext distclean-local distclean-enc distclean-golf distclean-extout distclean-platform
distclean-local:: clean-local
- @$(RM) $(MKFILES) yasmdata.rb *.inc
- @$(RM) config.cache config.status config.status.lineno $(PRELUDES)
- @$(RM) *~ *.bak *.stackdump core *.core gmon.out $(PREP)
+ $(Q)$(RM) $(MKFILES) yasmdata.rb *.inc
+ $(Q)$(RM) config.cache config.status config.status.lineno $(PRELUDES)
+ $(Q)$(RM) *~ *.bak *.stackdump core *.core gmon.out $(PREP)
distclean-ext:: PHONY
distclean-golf: clean-golf
- @$(RM) $(GOLFPRELUDES)
+ $(Q)$(RM) $(GOLFPRELUDES)
distclean-rdoc: PHONY
distclean-capi: PHONY
distclean-extout: clean-extout
+distclean-platform: clean-platform
realclean:: realclean-ext realclean-local realclean-enc realclean-golf realclean-extout
realclean-local:: distclean-local
- @$(RM) parse.c parse.h lex.c newline.c revision.h
+ $(Q)$(RM) parse.c parse.h lex.c newline.c revision.h
realclean-ext::
realclean-golf: distclean-golf
realclean-capi: PHONY
realclean-extout: distclean-extout
+clean-ext distclean-ext realclean-ext::
+ $(Q)$(RM) $(EXTS_MK)
+
clean-enc distclean-enc realclean-enc: PHONY
-check: test test-all
+check: main test test-all
+ $(ECHO) check succeeded
check-ruby: test test-ruby
-btest: miniruby$(EXEEXT) $(TEST_RUNNABLE)-btest
+btest: $(TEST_RUNNABLE)-btest
no-btest: PHONY
-yes-btest: PHONY
- $(BOOTSTRAPRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(MINIRUBY)" $(OPTS)
+yes-btest: miniruby$(EXEEXT) PHONY
+ $(BOOTSTRAPRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(BTESTRUBY)" $(OPTS) $(TESTOPTS)
-btest-ruby: miniruby$(EXEEXT) $(RBCONFIG) $(PROGRAM) $(TEST_RUNNABLE)-btest-ruby
+btest-ruby: $(TEST_RUNNABLE)-btest-ruby
no-btest-ruby: PHONY
-yes-btest-ruby: PHONY
- @$(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM) -I$(srcdir)/lib" -q $(OPTS)
+yes-btest-ruby: prog PHONY
+ $(Q)$(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM) -I$(srcdir)/lib" -q $(OPTS) $(TESTOPTS)
-test-sample: miniruby$(EXEEXT) $(RBCONFIG) $(PROGRAM) $(TEST_RUNNABLE)-test-sample
+test-sample: $(TEST_RUNNABLE)-test-sample
no-test-sample: PHONY
-yes-test-sample: PHONY
- @$(RUNRUBY) $(srcdir)/tool/rubytest.rb
+yes-test-sample: prog PHONY
+ $(Q)$(RUNRUBY) $(srcdir)/tool/rubytest.rb $(OPTS) $(TESTOPTS)
test-knownbugs: test-knownbug
-test-knownbug: miniruby$(EXEEXT) $(PROGRAM) $(RBCONFIG) $(TEST_RUNNABLE)-test-knownbug
+test-knownbug: $(TEST_RUNNABLE)-test-knownbug
no-test-knownbug: PHONY
-yes-test-knownbug: PHONY
- -$(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM)" $(OPTS) $(srcdir)/KNOWNBUGS.rb
+yes-test-knownbug: prog PHONY
+ -$(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM)" $(OPTS) $(TESTOPTS) $(srcdir)/KNOWNBUGS.rb
test: test-sample btest-ruby test-knownbug
test-all: $(TEST_RUNNABLE)-test-all
-yes-test-all: PHONY
- $(RUNRUBY) "$(srcdir)/test/runner.rb" --ruby="$(RUNRUBY)" $(TESTS)
+yes-test-all: prog PHONY
+ $(RUNRUBY) "$(srcdir)/test/runner.rb" --ruby="$(RUNRUBY)" $(TESTOPTS) $(TESTS)
TESTS_BUILD = mkmf
no-test-all: PHONY
- $(MINIRUBY) -I"$(srcdir)/lib" "$(srcdir)/test/runner.rb" $(TESTS_BUILD)
+ $(MINIRUBY) -I"$(srcdir)/lib" "$(srcdir)/test/runner.rb" $(TESTOPTS) $(TESTS_BUILD)
test-ruby: $(TEST_RUNNABLE)-test-ruby
no-test-ruby: PHONY
-yes-test-ruby: PHONY
- $(RUNRUBY) "$(srcdir)/test/runner.rb" ruby
+yes-test-ruby: prog encs PHONY
+ $(RUNRUBY) "$(srcdir)/test/runner.rb" -q $(TESTOPTS) -- ruby -ext-
extconf: $(PREP)
$(Q) $(MAKEDIRS) "$(EXTCONFDIR)"
$(RUNRUBY) -C "$(EXTCONFDIR)" $(EXTCONF) $(EXTCONFARGS)
$(RBCONFIG): $(srcdir)/tool/mkconfig.rb config.status $(srcdir)/version.h $(PREP)
- @$(MINIRUBY) $(srcdir)/tool/mkconfig.rb -timestamp=$@ \
+ $(Q)$(MINIRUBY) $(srcdir)/tool/mkconfig.rb -timestamp=$@ \
-install_name=$(RUBY_INSTALL_NAME) \
-so_name=$(RUBY_SO_NAME) rbconfig.rb
@@ -512,18 +524,27 @@ test-rubyspec-precheck:
test-rubyspec: test-rubyspec-precheck
$(RUNRUBY) $(srcdir)/spec/mspec/bin/mspec run -B $(srcdir)/spec/default.mspec $(MSPECOPT)
+RUNNABLE = $(LIBRUBY_RELATIVE:no=un)-runnable
+runnable: $(RUNNABLE) prog $(srcdir)/tool/mkrunnable.rb PHONY
+ $(Q) $(MINIRUBY) $(srcdir)/tool/mkrunnable.rb -v $(EXTOUT)
+yes-runnable: PHONY
+
encs: enc trans
-encs enc trans: showflags $(ENC_MK) $(LIBRUBY) $(PREP)
+libencs: libenc libtrans
+encs enc trans libencs libenc libtrans: showflags $(ENC_MK) $(LIBRUBY) $(PREP)
$(ECHO) making $@
- $(Q) $(MAKE) -f $(ENC_MK) RUBY="$(MINIRUBY)" MINIRUBY="$(MINIRUBY)" $(MFLAGS) $@
+ $(Q) $(MAKE) -f $(ENC_MK) V="$(V)" \
+ RUBY="$(MINIRUBY)" MINIRUBY="$(MINIRUBY)" \
+ $(MFLAGS) $@
+
-enc: {$(VPATH)}encdb.h
-trans: {$(VPATH)}transdb.h
+libenc enc: {$(VPATH)}encdb.h
+libtrans trans: {$(VPATH)}transdb.h
$(ENC_MK): $(srcdir)/enc/make_encmake.rb $(srcdir)/enc/Makefile.in $(srcdir)/enc/depend \
- $(srcdir)/lib/mkmf.rb $(RBCONFIG)
+ $(srcdir)/enc/encinit.c.erb $(srcdir)/lib/mkmf.rb $(RBCONFIG)
$(ECHO) generating $@
- $(Q) $(MINIRUBY) $(srcdir)/enc/make_encmake.rb --builtin-encs="$(BUILTIN_ENCOBJS)" --builtin-transes="$(BUILTIN_TRANSOBJS)" $@ $(ENCS)
+ $(Q) $(MINIRUBY) $(srcdir)/enc/make_encmake.rb --builtin-encs="$(BUILTIN_ENCOBJS)" --builtin-transes="$(BUILTIN_TRANSOBJS)" --module$(EXTSTATIC) $@ $(ENCS)
.PRECIOUS: $(MKFILES)
@@ -539,16 +560,18 @@ $(ENC_MK): $(srcdir)/enc/make_encmake.rb $(srcdir)/enc/Makefile.in $(srcdir)/enc
PHONY:
-{$(VPATH)}parse.c: {$(VPATH)}parse.y $(srcdir)/tool/ytab.sed
-parse.h {$(VPATH)}parse.h: {$(VPATH)}parse.c
+{$(VPATH)}parse.c: {$(VPATH)}parse.y $(srcdir)/tool/ytab.sed {$(VPATH)}id.h
+{$(VPATH)}parse.h: {$(VPATH)}parse.c
{$(srcdir)}.y.c:
- $(YACC) -d $(YFLAGS) -o y.tab.c $(SRC_FILE)
- sed -f $(srcdir)/tool/ytab.sed -e "/^#/s!y\.tab\.c!$@!" y.tab.c > $@.new
- @$(MV) $@.new $@
- sed -e "/^#line.*y\.tab\.h/d;/^#line.*parse\.y/d" y.tab.h > $(@:.c=.h).new
- @$(IFCHANGE) $(@:.c=.h) $(@:.c=.h).new
- @$(RM) y.tab.c y.tab.h
+ $(ECHO) generating $@
+ $(Q)$(BASERUBY) $(srcdir)/tool/id2token.rb --path-separator=$(PATH_SEPARATOR) --vpath=$(VPATH) id.h $(SRC_FILE) > parse.tmp.y
+ $(Q)$(YACC) -d $(YFLAGS) -o y.tab.c parse.tmp.y
+ $(Q)$(RM) parse.tmp.y
+ $(Q)sed -f $(srcdir)/tool/ytab.sed -e "/^#/s!parse\.tmp\.[iy]!parse.y!" -e "/^#/s!y\.tab\.c!$@!" y.tab.c > $@.new
+ $(Q)$(MV) $@.new $@
+ $(Q)sed -e "/^#line.*y\.tab\.h/d;/^#line.*parse.*\.y/d" y.tab.h > $(@:.c=.h)
+ $(Q)$(RM) y.tab.c y.tab.h
acosh.$(OBJEXT): {$(VPATH)}acosh.c
alloca.$(OBJEXT): {$(VPATH)}alloca.c {$(VPATH)}config.h
@@ -560,9 +583,12 @@ flock.$(OBJEXT): {$(VPATH)}flock.c
memcmp.$(OBJEXT): {$(VPATH)}memcmp.c
memmove.$(OBJEXT): {$(VPATH)}memmove.c
mkdir.$(OBJEXT): {$(VPATH)}mkdir.c
+setproctitle.$(OBJEXT): {$(VPATH)}setproctitle.c {$(VPATH)}util.h $(RUBY_H_INCLUDES)
strchr.$(OBJEXT): {$(VPATH)}strchr.c
strdup.$(OBJEXT): {$(VPATH)}strdup.c
strerror.$(OBJEXT): {$(VPATH)}strerror.c
+strlcat.$(OBJEXT): {$(VPATH)}strlcat.c
+strlcpy.$(OBJEXT): {$(VPATH)}strlcpy.c
strstr.$(OBJEXT): {$(VPATH)}strstr.c
strtod.$(OBJEXT): {$(VPATH)}strtod.c
strtol.$(OBJEXT): {$(VPATH)}strtol.c
@@ -572,7 +598,9 @@ dl_os2.$(OBJEXT): {$(VPATH)}dl_os2.c
ia64.$(OBJEXT): {$(VPATH)}ia64.s
$(CC) $(CFLAGS) -c $<
-win32.$(OBJEXT): {$(VPATH)}win32.c $(RUBY_H_INCLUDES)
+$(PLATFORM_D):
+ $(Q) $(MAKEDIRS) $(PLATFORM_DIR)
+ @exit > $@
###
@@ -580,18 +608,19 @@ RUBY_H_INCLUDES = {$(VPATH)}ruby.h {$(VPATH)}config.h {$(VPATH)}defines.h \
{$(VPATH)}intern.h {$(VPATH)}missing.h {$(VPATH)}st.h \
{$(VPATH)}subst.h
ENCODING_H_INCLUDES= {$(VPATH)}encoding.h {$(VPATH)}oniguruma.h
-ID_H_INCLUDES = {$(VPATH)}id.h {$(VPATH)}vm_opts.h
+ID_H_INCLUDES = {$(VPATH)}id.h
+PROBES_H_INCLUDES = {$(VPATH)}probes.h
VM_CORE_H_INCLUDES = {$(VPATH)}vm_core.h {$(VPATH)}thread_$(THREAD_MODEL).h \
- {$(VPATH)}node.h {$(VPATH)}method.h {$(VPATH)}atomic.h \
- $(ID_H_INCLUDES)
+ {$(VPATH)}node.h {$(VPATH)}method.h {$(VPATH)}ruby_atomic.h \
+ {$(VPATH)}vm_debug.h $(ID_H_INCLUDES)
+addr2line.$(OBJEXT): {$(VPATH)}addr2line.c {$(VPATH)}addr2line.h {$(VPATH)}config.h
array.$(OBJEXT): {$(VPATH)}array.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
- $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h
+ $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h $(PROBES_H_INCLUDES)
bignum.$(OBJEXT): {$(VPATH)}bignum.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
- {$(VPATH)}internal.h
+ {$(VPATH)}thread.h {$(VPATH)}internal.h
class.$(OBJEXT): {$(VPATH)}class.c $(RUBY_H_INCLUDES) \
- $(VM_CORE_H_INCLUDES) {$(VPATH)}debug.h {$(VPATH)}internal.h \
- {$(VPATH)}constant.h
+ $(VM_CORE_H_INCLUDES) {$(VPATH)}internal.h {$(VPATH)}constant.h
compar.$(OBJEXT): {$(VPATH)}compar.c $(RUBY_H_INCLUDES)
complex.$(OBJEXT): {$(VPATH)}complex.c $(RUBY_H_INCLUDES) \
{$(VPATH)}internal.h
@@ -610,59 +639,61 @@ encoding.$(OBJEXT): {$(VPATH)}encoding.c $(RUBY_H_INCLUDES) \
{$(VPATH)}internal.h
enum.$(OBJEXT): {$(VPATH)}enum.c $(RUBY_H_INCLUDES) {$(VPATH)}node.h \
{$(VPATH)}util.h $(ID_H_INCLUDES)
-enumerator.$(OBJEXT): {$(VPATH)}enumerator.c $(RUBY_H_INCLUDES)
+enumerator.$(OBJEXT): {$(VPATH)}enumerator.c $(RUBY_H_INCLUDES) \
+ {$(VPATH)}internal.h
error.$(OBJEXT): {$(VPATH)}error.c {$(VPATH)}known_errors.inc \
$(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES) $(ENCODING_H_INCLUDES) \
- {$(VPATH)}debug.h \
{$(VPATH)}internal.h
eval.$(OBJEXT): {$(VPATH)}eval.c {$(VPATH)}eval_intern.h {$(VPATH)}vm.h \
$(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES) {$(VPATH)}eval_error.c \
- {$(VPATH)}eval_jump.c {$(VPATH)}debug.h {$(VPATH)}gc.h {$(VPATH)}iseq.h \
- $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h
+ {$(VPATH)}eval_jump.c {$(VPATH)}gc.h {$(VPATH)}iseq.h \
+ $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h $(PROBES_H_INCLUDES)
load.$(OBJEXT): {$(VPATH)}load.c {$(VPATH)}eval_intern.h \
{$(VPATH)}util.h $(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES) \
- {$(VPATH)}dln.h {$(VPATH)}debug.h \
- {$(VPATH)}internal.h
+ {$(VPATH)}dln.h {$(VPATH)}internal.h $(PROBES_H_INCLUDES)
file.$(OBJEXT): {$(VPATH)}file.c $(RUBY_H_INCLUDES) {$(VPATH)}io.h \
$(ENCODING_H_INCLUDES) {$(VPATH)}util.h {$(VPATH)}dln.h \
{$(VPATH)}internal.h
gc.$(OBJEXT): {$(VPATH)}gc.c $(RUBY_H_INCLUDES) {$(VPATH)}re.h \
{$(VPATH)}regex.h $(ENCODING_H_INCLUDES) $(VM_CORE_H_INCLUDES) \
{$(VPATH)}gc.h {$(VPATH)}io.h {$(VPATH)}eval_intern.h {$(VPATH)}util.h \
- {$(VPATH)}debug.h {$(VPATH)}internal.h {$(VPATH)}constant.h
+ {$(VPATH)}internal.h {$(VPATH)}constant.h \
+ {$(VPATH)}thread.h $(PROBES_H_INCLUDES)
hash.$(OBJEXT): {$(VPATH)}hash.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
- $(ENCODING_H_INCLUDES)
+ $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h $(PROBES_H_INCLUDES)
inits.$(OBJEXT): {$(VPATH)}inits.c $(RUBY_H_INCLUDES) \
{$(VPATH)}internal.h
io.$(OBJEXT): {$(VPATH)}io.c $(RUBY_H_INCLUDES) {$(VPATH)}io.h \
- {$(VPATH)}util.h $(ENCODING_H_INCLUDES) {$(VPATH)}dln.h {$(VPATH)}internal.h
-main.$(OBJEXT): {$(VPATH)}main.c $(RUBY_H_INCLUDES) {$(VPATH)}debug.h \
- {$(VPATH)}node.h
+ {$(VPATH)}util.h $(ENCODING_H_INCLUDES) {$(VPATH)}dln.h \
+ {$(VPATH)}internal.h {$(VPATH)}thread.h
+main.$(OBJEXT): {$(VPATH)}main.c $(RUBY_H_INCLUDES) {$(VPATH)}node.h {$(VPATH)}vm_debug.h
marshal.$(OBJEXT): {$(VPATH)}marshal.c $(RUBY_H_INCLUDES) {$(VPATH)}io.h \
$(ENCODING_H_INCLUDES) {$(VPATH)}util.h {$(VPATH)}internal.h
math.$(OBJEXT): {$(VPATH)}math.c $(RUBY_H_INCLUDES) \
{$(VPATH)}internal.h
node.$(OBJEXT): {$(VPATH)}node.c $(RUBY_H_INCLUDES) \
- $(VM_CORE_H_INCLUDES) {$(VPATH)}debug.h
+ $(VM_CORE_H_INCLUDES)
numeric.$(OBJEXT): {$(VPATH)}numeric.c $(RUBY_H_INCLUDES) \
{$(VPATH)}util.h $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h
object.$(OBJEXT): {$(VPATH)}object.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
- {$(VPATH)}internal.h {$(VPATH)}constant.h
+ {$(VPATH)}internal.h {$(VPATH)}constant.h $(ENCODING_H_INCLUDES) $(PROBES_H_INCLUDES)
pack.$(OBJEXT): {$(VPATH)}pack.c $(RUBY_H_INCLUDES) {$(VPATH)}encoding.h \
{$(VPATH)}oniguruma.h
parse.$(OBJEXT): {$(VPATH)}parse.c $(RUBY_H_INCLUDES) {$(VPATH)}node.h \
$(ENCODING_H_INCLUDES) $(ID_H_INCLUDES) {$(VPATH)}regenc.h \
{$(VPATH)}regex.h {$(VPATH)}util.h {$(VPATH)}lex.c \
{$(VPATH)}defs/keywords {$(VPATH)}id.c {$(VPATH)}parse.y \
- {$(VPATH)}parse.h \
- {$(VPATH)}internal.h
+ {$(VPATH)}parse.h {$(VPATH)}vm_opts.h \
+ {$(VPATH)}internal.h $(PROBES_H_INCLUDES)
proc.$(OBJEXT): {$(VPATH)}proc.c {$(VPATH)}eval_intern.h \
$(RUBY_H_INCLUDES) {$(VPATH)}gc.h $(VM_CORE_H_INCLUDES) \
- {$(VPATH)}debug.h {$(VPATH)}internal.h {$(VPATH)}iseq.h
+ {$(VPATH)}internal.h {$(VPATH)}iseq.h
process.$(OBJEXT): {$(VPATH)}process.c $(RUBY_H_INCLUDES) \
{$(VPATH)}util.h {$(VPATH)}io.h $(ENCODING_H_INCLUDES) {$(VPATH)}dln.h \
- $(VM_CORE_H_INCLUDES) {$(VPATH)}debug.h {$(VPATH)}internal.h
-random.$(OBJEXT): {$(VPATH)}random.c $(RUBY_H_INCLUDES)
+ $(VM_CORE_H_INCLUDES) {$(VPATH)}internal.h \
+ {$(VPATH)}thread.h
+random.$(OBJEXT): {$(VPATH)}random.c $(RUBY_H_INCLUDES) \
+ {$(VPATH)}siphash.c {$(VPATH)}siphash.h
range.$(OBJEXT): {$(VPATH)}range.c $(RUBY_H_INCLUDES) \
$(ENCODING_H_INCLUDES) {$(VPATH)}internal.h
rational.$(OBJEXT): {$(VPATH)}rational.c $(RUBY_H_INCLUDES) {$(VPATH)}internal.h
@@ -685,28 +716,27 @@ regsyntax.$(OBJEXT): {$(VPATH)}regsyntax.c {$(VPATH)}regint.h \
{$(VPATH)}regenc.h {$(VPATH)}oniguruma.h $(RUBY_H_INCLUDES)
ruby.$(OBJEXT): {$(VPATH)}ruby.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
$(ENCODING_H_INCLUDES) {$(VPATH)}eval_intern.h $(VM_CORE_H_INCLUDES) \
- {$(VPATH)}dln.h {$(VPATH)}debug.h {$(VPATH)}internal.h
-safe.$(OBJEXT): {$(VPATH)}safe.c $(RUBY_H_INCLUDES) \
- $(VM_CORE_H_INCLUDES) {$(VPATH)}debug.h
+ {$(VPATH)}dln.h {$(VPATH)}internal.h
+safe.$(OBJEXT): {$(VPATH)}safe.c $(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES)
signal.$(OBJEXT): {$(VPATH)}signal.c $(RUBY_H_INCLUDES) \
- $(VM_CORE_H_INCLUDES) {$(VPATH)}debug.h
+ $(VM_CORE_H_INCLUDES)
sprintf.$(OBJEXT): {$(VPATH)}sprintf.c $(RUBY_H_INCLUDES) {$(VPATH)}re.h \
{$(VPATH)}regex.h {$(VPATH)}vsnprintf.c $(ENCODING_H_INCLUDES)
st.$(OBJEXT): {$(VPATH)}st.c $(RUBY_H_INCLUDES)
strftime.$(OBJEXT): {$(VPATH)}strftime.c $(RUBY_H_INCLUDES) \
- {$(VPATH)}timev.h
+ {$(VPATH)}timev.h $(ENCODING_H_INCLUDES)
string.$(OBJEXT): {$(VPATH)}string.c $(RUBY_H_INCLUDES) {$(VPATH)}re.h \
- {$(VPATH)}regex.h $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h
+ {$(VPATH)}regex.h $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h $(PROBES_H_INCLUDES)
struct.$(OBJEXT): {$(VPATH)}struct.c $(RUBY_H_INCLUDES) {$(VPATH)}internal.h
thread.$(OBJEXT): {$(VPATH)}thread.c {$(VPATH)}eval_intern.h \
$(RUBY_H_INCLUDES) {$(VPATH)}gc.h $(VM_CORE_H_INCLUDES) \
- {$(VPATH)}debug.h {$(VPATH)}thread_$(THREAD_MODEL).c $(ENCODING_H_INCLUDES) \
- {$(VPATH)}internal.h {$(VPATH)}io.h
+ {$(VPATH)}thread_$(THREAD_MODEL).c $(ENCODING_H_INCLUDES) \
+ {$(VPATH)}internal.h {$(VPATH)}io.h {$(VPATH)}thread.h
transcode.$(OBJEXT): {$(VPATH)}transcode.c $(RUBY_H_INCLUDES) \
$(ENCODING_H_INCLUDES) {$(VPATH)}transcode_data.h {$(VPATH)}internal.h
cont.$(OBJEXT): {$(VPATH)}cont.c $(RUBY_H_INCLUDES) \
$(VM_CORE_H_INCLUDES) {$(VPATH)}gc.h {$(VPATH)}eval_intern.h \
- {$(VPATH)}debug.h {$(VPATH)}internal.h
+ {$(VPATH)}internal.h
time.$(OBJEXT): {$(VPATH)}time.c $(RUBY_H_INCLUDES) \
$(ENCODING_H_INCLUDES) {$(VPATH)}timev.h {$(VPATH)}internal.h
util.$(OBJEXT): {$(VPATH)}util.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
@@ -715,58 +745,84 @@ variable.$(OBJEXT): {$(VPATH)}variable.c $(RUBY_H_INCLUDES) \
{$(VPATH)}node.h {$(VPATH)}util.h {$(VPATH)}encoding.h \
{$(VPATH)}oniguruma.h {$(VPATH)}internal.h {$(VPATH)}constant.h
version.$(OBJEXT): {$(VPATH)}version.c $(RUBY_H_INCLUDES) \
- {$(VPATH)}version.h $(srcdir)/version.h $(srcdir)/revision.h {$(VPATH)}config.h
+ {$(VPATH)}version.h $(srcdir)/version.h $(srcdir)/revision.h {$(VPATH)}config.h \
+ verconf.h
dmyversion.$(OBJEXT): {$(VPATH)}dmyversion.c version.$(OBJEXT)
compile.$(OBJEXT): {$(VPATH)}compile.c {$(VPATH)}iseq.h \
$(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES) {$(VPATH)}insns.inc \
- {$(VPATH)}insns_info.inc {$(VPATH)}optinsn.inc {$(VPATH)}debug.h \
+ {$(VPATH)}insns_info.inc {$(VPATH)}optinsn.inc \
{$(VPATH)}optunifs.inc {$(VPATH)}opt_sc.inc {$(VPATH)}insns.inc \
{$(VPATH)}internal.h
iseq.$(OBJEXT): {$(VPATH)}iseq.c {$(VPATH)}gc.h {$(VPATH)}iseq.h \
$(RUBY_H_INCLUDES) $(VM_CORE_H_INCLUDES) {$(VPATH)}insns.inc \
- {$(VPATH)}insns_info.inc {$(VPATH)}node_name.inc {$(VPATH)}debug.h {$(VPATH)}internal.h
+ {$(VPATH)}insns_info.inc {$(VPATH)}node_name.inc {$(VPATH)}internal.h
vm.$(OBJEXT): {$(VPATH)}vm.c {$(VPATH)}gc.h {$(VPATH)}iseq.h \
{$(VPATH)}eval_intern.h $(RUBY_H_INCLUDES) $(ENCODING_H_INCLUDES) \
$(VM_CORE_H_INCLUDES) {$(VPATH)}vm_method.c {$(VPATH)}vm_eval.c \
{$(VPATH)}vm_insnhelper.c {$(VPATH)}vm_insnhelper.h {$(VPATH)}vm_exec.c \
{$(VPATH)}vm_exec.h {$(VPATH)}insns.def {$(VPATH)}vmtc.inc \
- {$(VPATH)}vm.inc {$(VPATH)}insns.inc {$(VPATH)}debug.h \
- {$(VPATH)}internal.h {$(VPATH)}vm.h {$(VPATH)}constant.h
+ {$(VPATH)}vm.inc {$(VPATH)}insns.inc \
+ {$(VPATH)}internal.h {$(VPATH)}vm.h {$(VPATH)}constant.h \
+ $(PROBES_H_INCLUDES) {$(VPATH)}probes_helper.h
vm_dump.$(OBJEXT): {$(VPATH)}vm_dump.c $(RUBY_H_INCLUDES) \
- $(VM_CORE_H_INCLUDES) {$(VPATH)}debug.h {$(VPATH)}addr2line.h
+ $(VM_CORE_H_INCLUDES) {$(VPATH)}addr2line.h \
+ {$(VPATH)}internal.h
debug.$(OBJEXT): {$(VPATH)}debug.c $(RUBY_H_INCLUDES) \
$(ENCODING_H_INCLUDES) $(VM_CORE_H_INCLUDES) {$(VPATH)}eval_intern.h \
- {$(VPATH)}util.h {$(VPATH)}debug.h
-id.$(OBJEXT): {$(VPATH)}id.c $(RUBY_H_INCLUDES) $(ID_H_INCLUDES)
+ {$(VPATH)}util.h
+id.$(OBJEXT): {$(VPATH)}id.c $(RUBY_H_INCLUDES) $(ID_H_INCLUDES) {$(VPATH)}vm_opts.h
+vm_backtrace.$(OBJEXT): {$(VPATH)}vm_backtrace.c \
+ $(VM_CORE_H_INCLUDES) $(RUBY_H_INCLUDES) $(ENCODING_H_INCLUDES) \
+ {$(VPATH)}internal.h {$(VPATH)}iseq.h {$(VPATH)}debug.h
+vm_trace.$(OBJEXT): {$(VPATH)}vm_trace.c $(ENCODING_H_INCLUDES) \
+ $(VM_CORE_H_INCLUDES) $(RUBY_H_INCLUDES) {$(VPATH)}debug.h \
+ {$(VPATH)}internal.h
miniprelude.$(OBJEXT): {$(VPATH)}miniprelude.c $(RUBY_H_INCLUDES) \
- $(VM_CORE_H_INCLUDES) {$(VPATH)}debug.h {$(VPATH)}internal.h
+ $(VM_CORE_H_INCLUDES) {$(VPATH)}internal.h
prelude.$(OBJEXT): {$(VPATH)}prelude.c $(RUBY_H_INCLUDES) \
- $(VM_CORE_H_INCLUDES) {$(VPATH)}debug.h {$(VPATH)}internal.h
+ $(VM_CORE_H_INCLUDES) {$(VPATH)}internal.h
golf_prelude.$(OBJEXT): {$(VPATH)}golf_prelude.c $(RUBY_H_INCLUDES) \
- $(VM_CORE_H_INCLUDES) {$(VPATH)}debug.h {$(VPATH)}internal.h
+ $(VM_CORE_H_INCLUDES) {$(VPATH)}internal.h
goruby.$(OBJEXT): {$(VPATH)}goruby.c {$(VPATH)}main.c $(RUBY_H_INCLUDES) \
- {$(VPATH)}debug.h {$(VPATH)}node.h
+ {$(VPATH)}vm_debug.h {$(VPATH)}node.h
ascii.$(OBJEXT): {$(VPATH)}ascii.c {$(VPATH)}regenc.h {$(VPATH)}config.h \
- {$(VPATH)}oniguruma.h {$(VPATH)}missing.h
+ {$(VPATH)}oniguruma.h {$(VPATH)}missing.h $(RUBY_H_INCLUDES)
us_ascii.$(OBJEXT): {$(VPATH)}us_ascii.c {$(VPATH)}regenc.h \
- {$(VPATH)}config.h {$(VPATH)}oniguruma.h {$(VPATH)}missing.h
+ {$(VPATH)}config.h {$(VPATH)}oniguruma.h {$(VPATH)}missing.h $(RUBY_H_INCLUDES)
unicode.$(OBJEXT): {$(VPATH)}unicode.c {$(VPATH)}regint.h \
{$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}regenc.h \
{$(VPATH)}oniguruma.h {$(VPATH)}st.h {$(VPATH)}ruby.h \
- {$(VPATH)}missing.h {$(VPATH)}intern.h {$(VPATH)}enc/unicode/name2ctype.h \
- {$(VPATH)}subst.h
+ {$(VPATH)}missing.h {$(VPATH)}intern.h \
+ {$(VPATH)}enc/unicode/name2ctype.h {$(VPATH)}enc/unicode/casefold.h \
+ {$(VPATH)}subst.h $(RUBY_H_INCLUDES)
utf_8.$(OBJEXT): {$(VPATH)}utf_8.c {$(VPATH)}regenc.h {$(VPATH)}config.h \
- {$(VPATH)}oniguruma.h {$(VPATH)}missing.h
+ {$(VPATH)}oniguruma.h {$(VPATH)}missing.h $(RUBY_H_INCLUDES)
+
+win32/win32.$(OBJEXT): {$(VPATH)}win32/win32.c $(RUBY_H_INCLUDES) $(PLATFORM_D)
+win32/file.$(OBJEXT): {$(VPATH)}win32/file.c $(RUBY_H_INCLUDES) $(PLATFORM_D)
-newline.c: $(srcdir)/enc/trans/newline.trans $(srcdir)/tool/transcode-tblgen.rb
- $(Q) $(BASERUBY) "$(srcdir)/tool/transcode-tblgen.rb" -vo newline.c $(srcdir)/enc/trans/newline.trans
-newline.$(OBJEXT): {$(VPATH)}newline.c {$(VPATH)}defines.h \
+$(NEWLINE_C): $(srcdir)/enc/trans/newline.trans $(srcdir)/tool/transcode-tblgen.rb
+ $(Q) $(BASERUBY) "$(srcdir)/tool/transcode-tblgen.rb" -vo $@ $(srcdir)/enc/trans/newline.trans
+newline.$(OBJEXT): $(NEWLINE_C) {$(VPATH)}defines.h \
{$(VPATH)}intern.h {$(VPATH)}missing.h {$(VPATH)}st.h \
{$(VPATH)}transcode_data.h {$(VPATH)}ruby.h {$(VPATH)}config.h {$(VPATH)}subst.h
+DTRACE_DEPENDENT_OBJS = array.$(OBJEXT) \
+ eval.$(OBJEXT) \
+ gc.$(OBJEXT) \
+ hash.$(OBJEXT) \
+ load.$(OBJEXT) \
+ object.$(OBJEXT) \
+ parse.$(OBJEXT) \
+ string.$(OBJEXT) \
+ vm.$(OBJEXT)
+
+probes.$(OBJEXT): $(DTRACE_DEPENDENT_OBJS)
+ruby-glommed.$(OBJEXT): $(OBJS) $(DTRACE_OBJ)
+
$(OBJS): {$(VPATH)}config.h {$(VPATH)}missing.h
INSNS2VMOPT = --srcdir="$(srcdir)"
@@ -797,15 +853,16 @@ srcs-enc: $(ENC_MK)
$(ECHO) making srcs under enc
$(Q) $(MAKE) -f $(ENC_MK) RUBY="$(MINIRUBY)" MINIRUBY="$(MINIRUBY)" $(MFLAGS) srcs
+all-incs: incs
incs: $(INSNS) {$(VPATH)}node_name.inc {$(VPATH)}encdb.h {$(VPATH)}transdb.h {$(VPATH)}known_errors.inc \
- $(srcdir)/revision.h $(REVISION_H) enc/unicode/name2ctype.h
+ $(srcdir)/revision.h $(REVISION_H) enc/unicode/name2ctype.h {$(VPATH)}id.h {$(VPATH)}probes.dmyh
insns: $(INSNS)
-id.h: parse.h $(srcdir)/tool/generic_erb.rb $(srcdir)/template/id.h.tmpl
+id.h: $(srcdir)/tool/generic_erb.rb $(srcdir)/template/id.h.tmpl
$(ECHO) generating $@
$(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb --output=$@ \
- $(srcdir)/template/id.h.tmpl --vpath=$(VPATH) parse.h
+ $(srcdir)/template/$@.tmpl
node_name.inc: {$(VPATH)}node.h
$(ECHO) generating $@
@@ -819,16 +876,19 @@ transdb.h: $(PREP) srcs-enc $(srcdir)/tool/generic_erb.rb $(srcdir)/template/tra
$(ECHO) generating $@
$(Q) $(MINIRUBY) $(srcdir)/tool/generic_erb.rb -c -o $@ $(srcdir)/template/transdb.h.tmpl $(srcdir)/enc/trans enc/trans
+enc/encinit.c: $(ENC_MK) $(srcdir)/enc/encinit.c.erb
+
known_errors.inc: $(srcdir)/template/known_errors.inc.tmpl $(srcdir)/defs/known_errors.def
$(ECHO) generating $@
$(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb -c -o $@ $(srcdir)/template/known_errors.inc.tmpl $(srcdir)/defs/known_errors.def
-miniprelude.c: $(srcdir)/tool/compile_prelude.rb $(srcdir)/prelude.rb
+$(MINIPRELUDE_C): $(srcdir)/tool/compile_prelude.rb $(srcdir)/prelude.rb
$(ECHO) generating $@
$(Q) $(BASERUBY) -I$(srcdir) $(srcdir)/tool/compile_prelude.rb $(srcdir)/prelude.rb $@
prelude.c: $(srcdir)/tool/compile_prelude.rb $(RBCONFIG) \
- $(srcdir)/lib/rubygems/defaults.rb $(srcdir)/lib/rubygems/custom_require.rb \
+ $(srcdir)/lib/rubygems/defaults.rb \
+ $(srcdir)/lib/rubygems/core_ext/kernel_gem.rb \
$(PRELUDE_SCRIPTS) $(PREP)
$(ECHO) generating $@
$(Q) $(COMPILE_PRELUDE) $(PRELUDE_SCRIPTS) $@
@@ -837,6 +897,11 @@ golf_prelude.c: $(srcdir)/tool/compile_prelude.rb $(RBCONFIG) $(srcdir)/prelude.
$(ECHO) generating $@
$(Q) $(COMPILE_PRELUDE) $(srcdir)/golf_prelude.rb $@
+probes.dmyh: {$(srcdir)}probes.d $(srcdir)/tool/gen_dummy_probes.rb
+ $(BASERUBY) $(srcdir)/tool/gen_dummy_probes.rb $(srcdir)/probes.d > $@
+
+probes.h: {$(VPATH)}probes.$(DTRACE_EXT)
+
prereq: incs srcs preludes PHONY
preludes: {$(VPATH)}miniprelude.c
@@ -846,13 +911,13 @@ $(srcdir)/revision.h:
@exit > $@
$(REVISION_H): $(srcdir)/version.h $(srcdir)/ChangeLog $(srcdir)/tool/file2lastrev.rb $(REVISION_FORCE)
- @-$(BASERUBY) $(srcdir)/tool/file2lastrev.rb --revision.h "$(srcdir)" > "$(srcdir)/revision.tmp"
- @$(IFCHANGE) "--timestamp=$@" "$(srcdir)/revision.h" "$(srcdir)/revision.tmp"
+ -$(Q) $(BASERUBY) $(srcdir)/tool/file2lastrev.rb --revision.h "$(srcdir)" > revision.tmp
+ $(Q)$(IFCHANGE) "--timestamp=$@" "$(srcdir)/revision.h" revision.tmp
$(srcdir)/ext/ripper/ripper.c: parse.y
$(ECHO) generating $@
$(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f depend $(MFLAGS) \
- Q=$(Q) ECHO=$(ECHO) top_srcdir=../.. srcdir=. RUBY=$(BASERUBY)
+ Q=$(Q) ECHO=$(ECHO) top_srcdir=../.. srcdir=. VPATH=../.. RUBY="$(BASERUBY)"
$(srcdir)/ext/json/parser/parser.c: $(srcdir)/ext/json/parser/parser.rl
$(ECHO) generating $@
@@ -871,22 +936,22 @@ parse: miniruby$(EXEEXT) PHONY
$(MINIRUBY) $(srcdir)/tool/parse.rb $(TESTRUN_SCRIPT)
COMPARE_RUBY = $(BASERUBY)
-ITEM =
-OPTS =
+ITEM =
+OPTS =
benchmark: $(PROGRAM) PHONY
$(BASERUBY) $(srcdir)/benchmark/driver.rb -v \
- --executables="$(COMPARE_RUBY); $(RUNRUBY)" \
+ --executables="$(COMPARE_RUBY); built-ruby::$(RUNRUBY)" \
--pattern='bm_' --directory=$(srcdir)/benchmark $(OPTS)
benchmark-each: $(PROGRAM) PHONY
$(BASERUBY) $(srcdir)/benchmark/driver.rb -v \
- --executables="$(COMPARE_RUBY); $(RUNRUBY)" \
+ --executables="$(COMPARE_RUBY); built-ruby::$(RUNRUBY)" \
--pattern=$(ITEM) --directory=$(srcdir)/benchmark $(OPTS)
tbench: $(PROGRAM) PHONY
$(BASERUBY) $(srcdir)/benchmark/driver.rb -v \
- --executables="$(COMPARE_RUBY); $(RUNRUBY)" \
+ --executables="$(COMPARE_RUBY); built-ruby::$(RUNRUBY)" \
--pattern='bmx_' --directory=$(srcdir)/benchmark $(OPTS)
run.gdb:
@@ -907,13 +972,13 @@ gdb: miniruby$(EXEEXT) run.gdb PHONY
gdb -x run.gdb --quiet --args $(MINIRUBY) $(TESTRUN_SCRIPT)
gdb-ruby: $(PROGRAM) run.gdb PHONY
- gdb -x run.gdb --quiet --args $(PROGRAM) $(TESTRUN_SCRIPT)
+ $(Q) $(RUNRUBY_COMMAND) $(RUNRUBY_DEBUGGER) -- $(TESTRUN_SCRIPT)
dist:
$(BASERUBY) $(srcdir)/tool/make-snapshot tmp $(RELNAME)
up::
- -@$(MAKE) $(MFLAGS) REVISION_FORCE=PHONY "$(REVISION_H)"
+ -$(Q)$(MAKE) $(MFLAGS) REVISION_FORCE=PHONY "$(REVISION_H)"
info: info-program info-libruby_a info-libruby_so info-arch
info-program:
@@ -964,5 +1029,5 @@ help: PHONY
" golf: for golfers" \
"" \
"see DeveloperHowto for more detail: " \
- " http://redmine.ruby-lang.org/wiki/ruby/DeveloperHowto" \
+ " http://bugs.ruby-lang.org/wiki/ruby/DeveloperHowto" \
$(MESSAGE_END)
diff --git a/compile.c b/compile.c
index 53149cafb2..a93a230af5 100644
--- a/compile.c
+++ b/compile.c
@@ -51,7 +51,7 @@ typedef struct iseq_label_data {
typedef struct iseq_insn_data {
LINK_ELEMENT link;
enum ruby_vminsn_type insn_id;
- int line_no;
+ unsigned int line_no;
int operand_size;
int sc_state;
VALUE *operands;
@@ -128,7 +128,7 @@ struct iseq_compile_data_ensure_node_stack {
(ruby_debug_print_node(1, CPDEBUG, "", (NODE *)(node)), gl_node_level)), \
gl_node_level++)
-#define debug_node_end() gl_node_level --;
+#define debug_node_end() gl_node_level --
#else
@@ -165,11 +165,11 @@ r_value(VALUE value)
/* create new label */
#define NEW_LABEL(l) new_label_body(iseq, (l))
-#define iseq_filename(iseq) \
- (((rb_iseq_t*)DATA_PTR(iseq))->filename)
+#define iseq_path(iseq) \
+ (((rb_iseq_t*)DATA_PTR(iseq))->location.path)
-#define iseq_filepath(iseq) \
- (((rb_iseq_t*)DATA_PTR(iseq))->filepath)
+#define iseq_absolute_path(iseq) \
+ (((rb_iseq_t*)DATA_PTR(iseq))->location.absolute_path)
#define NEW_ISEQVAL(node, name, type, line_no) \
new_child_iseq(iseq, (node), (name), 0, (type), (line_no))
@@ -185,16 +185,14 @@ r_value(VALUE value)
#define ADD_INSN(seq, line, insn) \
ADD_ELEM((seq), (LINK_ELEMENT *) new_insn_body(iseq, (line), BIN(insn), 0))
-/* add an instruction with label operand */
-#define ADD_INSNL(seq, line, insn, label) \
- ADD_ELEM((seq), (LINK_ELEMENT *) \
- new_insn_body(iseq, (line), BIN(insn), 1, (VALUE)(label)))
-
/* add an instruction with some operands (1, 2, 3, 5) */
#define ADD_INSN1(seq, line, insn, op1) \
ADD_ELEM((seq), (LINK_ELEMENT *) \
new_insn_body(iseq, (line), BIN(insn), 1, (VALUE)(op1)))
+/* add an instruction with label operand (alias of ADD_INSN1) */
+#define ADD_INSNL(seq, line, insn, label) ADD_INSN1(seq, line, insn, label)
+
#define ADD_INSN2(seq, line, insn, op1, op2) \
ADD_ELEM((seq), (LINK_ELEMENT *) \
new_insn_body(iseq, (line), BIN(insn), 2, (VALUE)(op1), (VALUE)(op2)))
@@ -208,13 +206,13 @@ r_value(VALUE value)
ADD_SEND_R((seq), (line), (id), (argc), (VALUE)Qfalse, (VALUE)INT2FIX(0))
#define ADD_CALL_RECEIVER(seq, line) \
- ADD_INSN((seq), (line), putnil)
+ ADD_INSN((seq), (line), putself)
#define ADD_CALL(seq, line, id, argc) \
- ADD_SEND_R((seq), (line), (id), (argc), (VALUE)Qfalse, (VALUE)INT2FIX(VM_CALL_FCALL_BIT))
+ ADD_SEND_R((seq), (line), (id), (argc), (VALUE)Qfalse, (VALUE)INT2FIX(VM_CALL_FCALL))
#define ADD_CALL_WITH_BLOCK(seq, line, id, argc, block) \
- ADD_SEND_R((seq), (line), (id), (argc), (block), (VALUE)INT2FIX(VM_CALL_FCALL_BIT))
+ ADD_SEND_R((seq), (line), (id), (argc), (block), (VALUE)INT2FIX(VM_CALL_FCALL))
#define ADD_SEND_R(seq, line, id, argc, block, flag) \
ADD_ELEM((seq), (LINK_ELEMENT *) \
@@ -238,6 +236,9 @@ r_value(VALUE value)
#define ADD_LABEL(seq, label) \
ADD_ELEM((seq), (LINK_ELEMENT *) (label))
+#define APPEND_LABEL(seq, before, label) \
+ APPEND_ELEM((seq), (before), (LINK_ELEMENT *) (label))
+
#define ADD_ADJUST(seq, line, label) \
ADD_ELEM((seq), (LINK_ELEMENT *) new_adjust_body(iseq, (label), (line)))
@@ -248,7 +249,7 @@ r_value(VALUE value)
(rb_ary_push(iseq->compile_data->catch_table_ary, \
rb_ary_new3(5, (type), \
(VALUE)(ls) | 1, (VALUE)(le) | 1, \
- (iseqv), (VALUE)(lc) | 1)))
+ (VALUE)(iseqv), (VALUE)(lc) | 1)))
/* compile node */
#define COMPILE(anchor, desc, node) \
@@ -392,8 +393,23 @@ ADD_ELEM(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor, LINK_ELEMENT *elem)
anchor->last = elem;
verify_list("add", anchor);
}
+
+/*
+ * elem1, before, elem2 => elem1, before, elem, elem2
+ */
+static void
+APPEND_ELEM(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor, LINK_ELEMENT *before, LINK_ELEMENT *elem)
+{
+ elem->prev = before;
+ elem->next = before->next;
+ elem->next->prev = elem;
+ before->next = elem;
+ if (before == anchor->last) anchor->last = elem;
+ verify_list("add", anchor);
+}
#if CPDEBUG < 0
#define ADD_ELEM(anchor, elem) ADD_ELEM(iseq, (anchor), (elem))
+#define APPEND_ELEM(anchor, before, elem) ADD_ELEM(iseq, (anchor), (before), (elem))
#endif
static int
@@ -405,7 +421,7 @@ iseq_add_mark_object(rb_iseq_t *iseq, VALUE v)
return COMPILE_OK;
}
-#define ruby_sourcefile RSTRING_PTR(iseq->filename)
+#define ruby_sourcefile RSTRING_PTR(iseq->location.path)
static int
iseq_add_mark_object_compile_time(rb_iseq_t *iseq, VALUE v)
@@ -426,6 +442,7 @@ validate_label(st_data_t name, st_data_t label, st_data_t arg)
int ret;
COMPILE_ERROR((ruby_sourcefile, lobj->position,
"%s: undefined label", rb_id2name((ID)name)));
+ if (ret) break;
} while (0);
}
return ST_CONTINUE;
@@ -458,31 +475,36 @@ rb_iseq_compile_node(VALUE self, NODE *node)
iseq_set_arguments(iseq, ret, node->nd_args);
switch (iseq->type) {
- case ISEQ_TYPE_BLOCK: {
- LABEL *start = iseq->compile_data->start_label = NEW_LABEL(0);
- LABEL *end = iseq->compile_data->end_label = NEW_LABEL(0);
-
- ADD_LABEL(ret, start);
- COMPILE(ret, "block body", node->nd_body);
- ADD_LABEL(ret, end);
-
- /* wide range catch handler must put at last */
- ADD_CATCH_ENTRY(CATCH_TYPE_REDO, start, end, 0, start);
- ADD_CATCH_ENTRY(CATCH_TYPE_NEXT, start, end, 0, end);
- break;
- }
- case ISEQ_TYPE_CLASS: {
- ADD_TRACE(ret, FIX2INT(iseq->line_no), RUBY_EVENT_CLASS);
- COMPILE(ret, "scoped node", node->nd_body);
- ADD_TRACE(ret, nd_line(node), RUBY_EVENT_END);
- break;
- }
- case ISEQ_TYPE_METHOD: {
- ADD_TRACE(ret, FIX2INT(iseq->line_no), RUBY_EVENT_CALL);
- COMPILE(ret, "scoped node", node->nd_body);
- ADD_TRACE(ret, nd_line(node), RUBY_EVENT_RETURN);
- break;
- }
+ case ISEQ_TYPE_BLOCK:
+ {
+ LABEL *start = iseq->compile_data->start_label = NEW_LABEL(0);
+ LABEL *end = iseq->compile_data->end_label = NEW_LABEL(0);
+
+ ADD_LABEL(ret, start);
+ ADD_TRACE(ret, FIX2INT(iseq->location.first_lineno), RUBY_EVENT_B_CALL);
+ COMPILE(ret, "block body", node->nd_body);
+ ADD_TRACE(ret, nd_line(node), RUBY_EVENT_B_RETURN);
+ ADD_LABEL(ret, end);
+
+ /* wide range catch handler must put at last */
+ ADD_CATCH_ENTRY(CATCH_TYPE_REDO, start, end, 0, start);
+ ADD_CATCH_ENTRY(CATCH_TYPE_NEXT, start, end, 0, end);
+ break;
+ }
+ case ISEQ_TYPE_CLASS:
+ {
+ ADD_TRACE(ret, FIX2INT(iseq->location.first_lineno), RUBY_EVENT_CLASS);
+ COMPILE(ret, "scoped node", node->nd_body);
+ ADD_TRACE(ret, nd_line(node), RUBY_EVENT_END);
+ break;
+ }
+ case ISEQ_TYPE_METHOD:
+ {
+ ADD_TRACE(ret, FIX2INT(iseq->location.first_lineno), RUBY_EVENT_CALL);
+ COMPILE(ret, "scoped node", node->nd_body);
+ ADD_TRACE(ret, nd_line(node), RUBY_EVENT_RETURN);
+ break;
+ }
default: {
COMPILE(ret, "scoped node", node->nd_body);
break;
@@ -518,7 +540,7 @@ rb_iseq_compile_node(VALUE self, NODE *node)
}
if (iseq->type == ISEQ_TYPE_RESCUE || iseq->type == ISEQ_TYPE_ENSURE) {
- ADD_INSN2(ret, 0, getdynamic, INT2FIX(2), INT2FIX(0));
+ ADD_INSN2(ret, 0, getlocal, INT2FIX(2), INT2FIX(0));
ADD_INSN1(ret, 0, throw, INT2FIX(0) /* continue throw */ );
}
else {
@@ -918,20 +940,40 @@ new_insn_body(rb_iseq_t *iseq, int line_no, int insn_id, int argc, ...)
return new_insn_core(iseq, line_no, insn_id, argc, operands);
}
+static rb_call_info_t *
+new_callinfo(rb_iseq_t *iseq, ID mid, int argc, VALUE block, unsigned long flag)
+{
+ rb_call_info_t *ci = (rb_call_info_t *)compile_data_alloc(iseq, sizeof(rb_call_info_t));
+ ci->mid = mid;
+ ci->flag = flag;
+ ci->orig_argc = argc;
+ ci->argc = argc;
+
+ if (block) {
+ GetISeqPtr(block, ci->blockiseq);
+ }
+ else {
+ ci->blockiseq = 0;
+ if (!(ci->flag & (VM_CALL_ARGS_SPLAT | VM_CALL_ARGS_BLOCKARG))) {
+ ci->flag |= VM_CALL_ARGS_SKIP_SETUP;
+ }
+ }
+ ci->vmstat = 0;
+ ci->blockptr = 0;
+ ci->recv = Qundef;
+ ci->call = 0; /* TODO: should set default function? */
+
+ ci->aux.index = iseq->callinfo_size++;
+
+ return ci;
+}
+
static INSN *
-new_insn_send(rb_iseq_t *iseq, int line_no,
- VALUE id, VALUE argc, VALUE block, VALUE flag)
+new_insn_send(rb_iseq_t *iseq, int line_no, VALUE id, VALUE argc, VALUE block, VALUE flag)
{
- INSN *iobj = 0;
- VALUE *operands =
- (VALUE *)compile_data_alloc(iseq, sizeof(VALUE) * 5);
- operands[0] = id;
- operands[1] = argc;
- operands[2] = block;
- operands[3] = flag;
- operands[4] = INT2FIX(iseq->ic_size++);
- iobj = new_insn_core(iseq, line_no, BIN(send), 5, operands);
- return iobj;
+ VALUE *operands = (VALUE *)compile_data_alloc(iseq, sizeof(VALUE) * 1);
+ operands[0] = (VALUE)new_callinfo(iseq, SYM2ID(id), FIX2INT(argc), block, FIX2INT(flag));
+ return new_insn_core(iseq, line_no, BIN(send), 1, operands);
}
static VALUE
@@ -941,8 +983,9 @@ new_child_iseq(rb_iseq_t *iseq, NODE *node,
VALUE ret;
debugs("[new_child_iseq]> ---------------------------------------\n");
- ret = rb_iseq_new_with_opt(node, name, iseq_filename(iseq->self), iseq_filepath(iseq->self), INT2FIX(line_no),
- parent, type, iseq->compile_data->option);
+ ret = rb_iseq_new_with_opt(node, name,
+ iseq_path(iseq->self), iseq_absolute_path(iseq->self),
+ INT2FIX(line_no), parent, type, iseq->compile_data->option);
debugs("[new_child_iseq]< ---------------------------------------\n");
iseq_add_mark_object(iseq, ret);
return ret;
@@ -1014,6 +1057,17 @@ iseq_set_exception_local_table(rb_iseq_t *iseq)
}
static int
+get_lvar_level(rb_iseq_t *iseq)
+{
+ int lev = 0;
+ while (iseq != iseq->local_iseq) {
+ lev++;
+ iseq = iseq->parent_iseq;
+ }
+ return lev;
+}
+
+static int
get_dyna_var_idx_at_raw(rb_iseq_t *iseq, ID id)
{
int i;
@@ -1067,52 +1121,34 @@ iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *optargs, NODE *node_args)
debugs("iseq_set_arguments: %s\n", node_args ? "" : "0");
if (node_args) {
- NODE *node_aux = node_args->nd_next;
- NODE *node_opt = node_args->nd_opt;
+ struct rb_args_info *args = node_args->nd_ainfo;
ID rest_id = 0;
int last_comma = 0;
ID block_id = 0;
- NODE *node_init = 0;
if (nd_type(node_args) != NODE_ARGS) {
rb_bug("iseq_set_arguments: NODE_ARGS is expected, but %s",
ruby_node_name(nd_type(node_args)));
}
- /*
- * new argument information:
- * NODE_ARGS [m: int, o: NODE_OPT_ARG, ->]
- * NODE_ARGS_AUX [r: ID, b: ID, ->]
- * NODE_ARGS_AUX [Pst: id, Plen: int, init: NODE*]
- * optarg information:
- * NODE_OPT_ARGS [idx, expr, next ->]
- * init arg:
- * NODE_AND(m_init, p_init)
- * if "r" is 1, it's means "{|x,|}" type block parameter.
- */
- iseq->argc = (int)node_args->nd_frml;
+ iseq->argc = (int)args->pre_args_num;
debugs(" - argc: %d\n", iseq->argc);
- if (node_aux) {
- rest_id = node_aux->nd_rest;
- if (rest_id == 1) {
- last_comma = 1;
- rest_id = 0;
- }
- block_id = (ID)node_aux->nd_body;
- node_aux = node_aux->nd_next;
-
- if (node_aux) {
- ID post_start_id = node_aux->nd_pid;
- iseq->arg_post_start = get_dyna_var_idx_at_raw(iseq, post_start_id);
- iseq->arg_post_len = (int)node_aux->nd_plen;
- node_init = node_aux->nd_next;
- }
+ rest_id = args->rest_arg;
+ if (rest_id == 1) {
+ last_comma = 1;
+ rest_id = 0;
+ }
+ block_id = args->block_arg;
+
+ if (args->first_post_arg) {
+ iseq->arg_post_start = get_dyna_var_idx_at_raw(iseq, args->first_post_arg);
+ iseq->arg_post_len = args->post_args_num;
}
- if (node_opt) {
- NODE *node = node_opt;
+ if (args->opt_args) {
+ NODE *node = args->opt_args;
LABEL *label;
VALUE labels = rb_ary_tmp_new(1);
int i = 0, j;
@@ -1144,13 +1180,42 @@ iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *optargs, NODE *node_args)
iseq->arg_opts = 0;
}
- if (node_init) {
- if (node_init->nd_1st) { /* m_init */
- COMPILE_POPED(optargs, "init arguments (m)", node_init->nd_1st);
+ if (args->kw_args) {
+ NODE *node = args->kw_args;
+ VALUE keywords = rb_ary_tmp_new(1);
+ int i = 0, j;
+
+ iseq->arg_keyword = get_dyna_var_idx_at_raw(iseq, args->kw_rest_arg->nd_vid);
+ COMPILE(optargs, "kwarg", args->kw_rest_arg);
+ while (node) {
+ rb_ary_push(keywords, INT2FIX(node->nd_body->nd_vid));
+ COMPILE_POPED(optargs, "kwarg", node); /* nd_type(node) == NODE_KW_ARG */
+ node = node->nd_next;
+ i += 1;
}
- if (node_init->nd_2nd) { /* p_init */
- COMPILE_POPED(optargs, "init arguments (p)", node_init->nd_2nd);
+ iseq->arg_keyword_check = (args->kw_rest_arg->nd_vid & ID_SCOPE_MASK) == ID_JUNK;
+ iseq->arg_keywords = i;
+ iseq->arg_keyword_table = ALLOC_N(ID, i);
+ for (j = 0; j < i; j++) {
+ iseq->arg_keyword_table[j] = FIX2INT(RARRAY_PTR(keywords)[j]);
}
+ ADD_INSN(optargs, nd_line(args->kw_args), pop);
+ }
+ else if (args->kw_rest_arg) {
+ iseq->arg_keyword = get_dyna_var_idx_at_raw(iseq, args->kw_rest_arg->nd_vid);
+ COMPILE(optargs, "kwarg", args->kw_rest_arg);
+ iseq->arg_keyword_check = (args->kw_rest_arg->nd_vid & ID_SCOPE_MASK) == ID_JUNK;
+ ADD_INSN(optargs, nd_line(args->kw_rest_arg), pop);
+ }
+ else {
+ iseq->arg_keyword = -1;
+ }
+
+ if (args->pre_init) { /* m_init */
+ COMPILE_POPED(optargs, "init arguments (m)", args->pre_init);
+ }
+ if (args->post_init) { /* p_init */
+ COMPILE_POPED(optargs, "init arguments (p)", args->post_init);
}
if (rest_id) {
@@ -1170,11 +1235,15 @@ iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *optargs, NODE *node_args)
}
if (iseq->arg_opts != 0 || iseq->arg_post_len != 0 ||
- iseq->arg_rest != -1 || iseq->arg_block != -1) {
+ iseq->arg_rest != -1 || iseq->arg_block != -1 ||
+ iseq->arg_keyword != -1) {
iseq->arg_simple = 0;
/* set arg_size: size of arguments */
- if (iseq->arg_block != -1) {
+ if (iseq->arg_keyword != -1) {
+ iseq->arg_size = iseq->arg_keyword + 1;
+ }
+ else if (iseq->arg_block != -1) {
iseq->arg_size = iseq->arg_block + 1;
}
else if (iseq->arg_post_len) {
@@ -1263,7 +1332,7 @@ static st_index_t
cdhash_hash(VALUE a)
{
if (SPECIAL_CONST_P(a)) return (st_index_t)a;
- if (TYPE(a) == T_STRING) return rb_str_hash(a);
+ if (RB_TYPE_P(a, T_STRING)) return rb_str_hash(a);
{
VALUE hval = rb_hash(a);
return (st_index_t)FIX2LONG(hval);
@@ -1275,6 +1344,21 @@ static const struct st_hash_type cdhash_type = {
cdhash_hash,
};
+struct cdhash_set_label_struct {
+ VALUE hash;
+ int pos;
+ int len;
+};
+
+static int
+cdhash_set_label_i(VALUE key, VALUE val, void *ptr)
+{
+ struct cdhash_set_label_struct *data = (struct cdhash_set_label_struct *)ptr;
+ LABEL *lobj = (LABEL *)(val & ~1);
+ rb_hash_aset(data->hash, key, INT2FIX(lobj->position - (data->pos+data->len)));
+ return ST_CONTINUE;
+}
+
/**
ruby insn object list -> raw instruction sequence
*/
@@ -1283,7 +1367,8 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
{
LABEL *lobj;
INSN *iobj;
- struct iseq_insn_info_entry *insn_info_table;
+ struct iseq_line_info_entry *line_info_table;
+ unsigned int last_line = 0;
LINK_ELEMENT *list;
VALUE *generated_iseq;
@@ -1326,7 +1411,7 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
default:
dump_disasm_list(FIRST_ELEMENT(anchor));
dump_disasm_list(list);
- rb_compile_error(RSTRING_PTR(iseq->filename), line,
+ rb_compile_error(RSTRING_PTR(iseq->location.path), line,
"error: set_sequence");
break;
}
@@ -1335,9 +1420,11 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
/* make instruction sequence */
generated_iseq = ALLOC_N(VALUE, pos);
- insn_info_table = ALLOC_N(struct iseq_insn_info_entry, k);
+ line_info_table = ALLOC_N(struct iseq_line_info_entry, k);
iseq->ic_entries = ALLOC_N(struct iseq_inline_cache_entry, iseq->ic_size);
MEMZERO(iseq->ic_entries, struct iseq_inline_cache_entry, iseq->ic_size);
+ iseq->callinfo_entries = ALLOC_N(rb_call_info_t, iseq->callinfo_size);
+ /* MEMZERO(iseq->callinfo_entries, rb_call_info_t, iseq->callinfo_size); */
list = FIRST_ELEMENT(anchor);
k = pos = sp = 0;
@@ -1369,11 +1456,11 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
if (iobj->operand_size != len - 1) {
/* printf("operand size miss! (%d, %d)\n", iobj->operand_size, len); */
dump_disasm_list(list);
- rb_compile_error(RSTRING_PTR(iseq->filename), iobj->line_no,
+ rb_compile_error(RSTRING_PTR(iseq->location.path), iobj->line_no,
"operand size miss! (%d for %d)",
iobj->operand_size, len - 1);
xfree(generated_iseq);
- xfree(insn_info_table);
+ xfree(line_info_table);
return 0;
}
@@ -1386,50 +1473,29 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
/* label(destination position) */
lobj = (LABEL *)operands[j];
if (!lobj->set) {
- rb_compile_error(RSTRING_PTR(iseq->filename), iobj->line_no,
+ rb_compile_error(RSTRING_PTR(iseq->location.path), iobj->line_no,
"unknown label");
}
if (lobj->sp == -1) {
lobj->sp = sp;
}
- generated_iseq[pos + 1 + j] =
- lobj->position - (pos + len);
+ generated_iseq[pos + 1 + j] = lobj->position - (pos + len);
break;
}
case TS_CDHASH:
{
- /*
- * [obj, label, ...]
- */
- int i;
- VALUE lits = operands[j];
- VALUE map = rb_hash_new();
- RHASH_TBL(map)->type = &cdhash_type;
-
- for (i=0; i < RARRAY_LEN(lits); i+=2) {
- VALUE obj = rb_ary_entry(lits, i);
- VALUE lv = rb_ary_entry(lits, i+1);
- lobj = (LABEL *)(lv & ~1);
-
- if (!lobj->set) {
- rb_compile_error(RSTRING_PTR(iseq->filename), iobj->line_no,
- "unknown label");
- }
- if (!st_lookup(rb_hash_tbl(map), obj, 0)) {
- rb_hash_aset(map, obj, INT2FIX(lobj->position - (pos+len)));
- }
- else {
- rb_compile_warning(RSTRING_PTR(iseq->filename), iobj->line_no,
- "duplicated when clause is ignored");
- }
- }
+ VALUE map = operands[j];
+ struct cdhash_set_label_struct data;
+ data.hash = map;
+ data.pos = pos;
+ data.len = len;
+ rb_hash_foreach(map, cdhash_set_label_i, (VALUE)&data);
+
hide_obj(map);
generated_iseq[pos + 1 + j] = map;
- iseq_add_mark_object(iseq, map);
break;
}
case TS_LINDEX:
- case TS_DINDEX:
case TS_NUM: /* ulong */
generated_iseq[pos + 1 + j] = FIX2INT(operands[j]);
break;
@@ -1456,12 +1522,23 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
int ic_index = FIX2INT(operands[j]);
IC ic = &iseq->ic_entries[ic_index];
if (UNLIKELY(ic_index >= iseq->ic_size)) {
- rb_bug("iseq_set_sequence: ic_index overflow: index: %d, size: %d",
- ic_index, iseq->ic_size);
+ rb_bug("iseq_set_sequence: ic_index overflow: index: %d, size: %d", ic_index, iseq->ic_size);
}
generated_iseq[pos + 1 + j] = (VALUE)ic;
break;
}
+ case TS_CALLINFO: /* call info */
+ {
+ rb_call_info_t *base_ci = (rb_call_info_t *)operands[j];
+ rb_call_info_t *ci = &iseq->callinfo_entries[base_ci->aux.index];
+ *ci = *base_ci;
+
+ if (UNLIKELY(base_ci->aux.index >= iseq->callinfo_size)) {
+ rb_bug("iseq_set_sequence: ci_index overflow: index: %d, size: %d", base_ci->argc, iseq->callinfo_size);
+ }
+ generated_iseq[pos + 1 + j] = (VALUE)ci;
+ break;
+ }
case TS_ID: /* ID */
generated_iseq[pos + 1 + j] = SYM2ID(operands[j]);
break;
@@ -1473,18 +1550,19 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
}
break;
default:
- rb_compile_error(RSTRING_PTR(iseq->filename), iobj->line_no,
+ rb_compile_error(RSTRING_PTR(iseq->location.path), iobj->line_no,
"unknown operand type: %c", type);
xfree(generated_iseq);
- xfree(insn_info_table);
+ xfree(line_info_table);
return 0;
}
}
- insn_info_table[k].line_no = iobj->line_no;
- insn_info_table[k].position = pos;
- insn_info_table[k].sp = sp;
+ if (last_line != iobj->line_no) {
+ line_info_table[k].line_no = last_line = iobj->line_no;
+ line_info_table[k].position = pos;
+ k++;
+ }
pos += len;
- k++;
break;
}
case ISEQ_ELEMENT_LABEL:
@@ -1512,19 +1590,21 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
if (adjust->line_no != -1) {
if (orig_sp - sp > 0) {
- insn_info_table[k].line_no = adjust->line_no;
- insn_info_table[k].position = pos;
- insn_info_table[k].sp = sp;
- k++;
+ if (last_line != (unsigned int)adjust->line_no) {
+ line_info_table[k].line_no = last_line = adjust->line_no;
+ line_info_table[k].position = pos;
+ k++;
+ }
generated_iseq[pos++] = BIN(adjuststack);
generated_iseq[pos++] = orig_sp - sp;
}
else if (orig_sp - sp == 0) {
/* jump to next insn */
- insn_info_table[k].line_no = adjust->line_no;
- insn_info_table[k].position = pos;
- insn_info_table[k].sp = sp;
- k++;
+ if (last_line != (unsigned int)adjust->line_no) {
+ line_info_table[k].line_no = last_line = adjust->line_no;
+ line_info_table[k].position = pos;
+ k++;
+ }
generated_iseq[pos++] = BIN(jump);
generated_iseq[pos++] = 0;
}
@@ -1550,10 +1630,12 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
iseq->iseq = (void *)generated_iseq;
iseq->iseq_size = pos;
- iseq->insn_info_table = insn_info_table;
- iseq->insn_info_size = k;
iseq->stack_max = stack_max;
+ line_info_table = ruby_xrealloc(line_info_table, k * sizeof(struct iseq_line_info_entry));
+ iseq->line_info_table = line_info_table;
+ iseq->line_info_size = k;
+
return COMPILE_OK;
}
@@ -1787,15 +1869,16 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
* send ...
* leave
* =>
- * send ..., ... | VM_CALL_TAILCALL_BIT, ...
+ * send ..., ... | VM_CALL_TAILCALL, ...
* leave # unreachable
*/
INSN *piobj = (INSN *)get_prev_insn((INSN *)list);
- if (piobj->insn_id == BIN(send) &&
- piobj->operands[2] == 0 /* block */
- ) {
- piobj->operands[3] = FIXNUM_OR(piobj->operands[3], VM_CALL_TAILCALL_BIT);
+ if (piobj->insn_id == BIN(send) || piobj->insn_id == BIN(opt_send_simple)) {
+ rb_call_info_t *ci = (rb_call_info_t *)piobj->operands[0];
+ if (ci->blockiseq == 0) {
+ ci->flag |= VM_CALL_TAILCALL;
+ }
}
}
return COMPILE_OK;
@@ -1804,18 +1887,18 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
static int
insn_set_specialized_instruction(rb_iseq_t *iseq, INSN *iobj, int insn_id)
{
- int i, old_opsize = iobj->operand_size;
-
+ int old_opsize = iobj->operand_size;
iobj->insn_id = insn_id;
iobj->operand_size = insn_len(insn_id) - 1;
- /* printf("iobj->operand_size: %d\n", iobj->operand_size); */
if (iobj->operand_size > old_opsize) {
- iobj->operands = (VALUE *)compile_data_alloc(iseq, iobj->operand_size);
- }
-
- for (i=0; i<iobj->operand_size; i++) {
- iobj->operands[i] = INT2FIX(iseq->ic_size++);
+ VALUE *old_operands = iobj->operands;
+ if (insn_id != BIN(opt_neq)) {
+ rb_bug("insn_set_specialized_instruction: unknown insn: %d", insn_id);
+ }
+ iobj->operands = (VALUE *)compile_data_alloc(iseq, iobj->operand_size * sizeof(VALUE));
+ iobj->operands[0] = old_operands[0];
+ iobj->operands[1] = (VALUE)new_callinfo(iseq, idEq, 1, 0, 0);
}
return COMPILE_OK;
@@ -1825,72 +1908,43 @@ static int
iseq_specialized_instruction(rb_iseq_t *iseq, INSN *iobj)
{
if (iobj->insn_id == BIN(send)) {
- ID mid = SYM2ID(OPERAND_AT(iobj, 0));
- int argc = FIX2INT(OPERAND_AT(iobj, 1));
- VALUE block = OPERAND_AT(iobj, 2);
- VALUE flag = OPERAND_AT(iobj, 3);
-
- /* TODO: should be more sophisticated search */
- if (block == 0 && flag == INT2FIX(0)) {
- if (argc == 0) {
- if (mid == idLength) {
- insn_set_specialized_instruction(iseq, iobj, BIN(opt_length));
- }
- else if (mid == idSize) {
- insn_set_specialized_instruction(iseq, iobj, BIN(opt_size));
- }
- else if (mid == idSucc) {
- insn_set_specialized_instruction(iseq, iobj, BIN(opt_succ));
+ rb_call_info_t *ci = (rb_call_info_t *)OPERAND_AT(iobj, 0);
+
+#define SP_INSN(opt) insn_set_specialized_instruction(iseq, iobj, BIN(opt_##opt))
+ if (ci->blockiseq == 0 && (ci->flag & ~VM_CALL_ARGS_SKIP_SETUP) == 0) {
+ switch (ci->orig_argc) {
+ case 0:
+ switch (ci->mid) {
+ case idLength: SP_INSN(length); return COMPILE_OK;
+ case idSize: SP_INSN(size); return COMPILE_OK;
+ case idEmptyP: SP_INSN(empty_p);return COMPILE_OK;
+ case idSucc: SP_INSN(succ); return COMPILE_OK;
+ case idNot: SP_INSN(not); return COMPILE_OK;
}
- else if (mid == idNot) {
- insn_set_specialized_instruction(iseq, iobj, BIN(opt_not));
- }
- }
- else if (argc == 1) {
- if (0) {
- }
- else if (mid == idPLUS) {
- insn_set_specialized_instruction(iseq, iobj, BIN(opt_plus));
- }
- else if (mid == idMINUS) {
- insn_set_specialized_instruction(iseq, iobj, BIN(opt_minus));
- }
- else if (mid == idMULT) {
- insn_set_specialized_instruction(iseq, iobj, BIN(opt_mult));
- }
- else if (mid == idDIV) {
- insn_set_specialized_instruction(iseq, iobj, BIN(opt_div));
- }
- else if (mid == idMOD) {
- insn_set_specialized_instruction(iseq, iobj, BIN(opt_mod));
- }
- else if (mid == idEq) {
- insn_set_specialized_instruction(iseq, iobj, BIN(opt_eq));
- }
- else if (mid == idNeq) {
- insn_set_specialized_instruction(iseq, iobj, BIN(opt_neq));
- }
- else if (mid == idLT) {
- insn_set_specialized_instruction(iseq, iobj, BIN(opt_lt));
- }
- else if (mid == idLE) {
- insn_set_specialized_instruction(iseq, iobj, BIN(opt_le));
- }
- else if (mid == idGT) {
- insn_set_specialized_instruction(iseq, iobj, BIN(opt_gt));
- }
- else if (mid == idGE) {
- insn_set_specialized_instruction(iseq, iobj, BIN(opt_ge));
- }
- else if (mid == idLTLT) {
- insn_set_specialized_instruction(iseq, iobj, BIN(opt_ltlt));
- }
- else if (mid == idAREF) {
- insn_set_specialized_instruction(iseq, iobj, BIN(opt_aref));
+ break;
+ case 1:
+ switch (ci->mid) {
+ case idPLUS: SP_INSN(plus); return COMPILE_OK;
+ case idMINUS: SP_INSN(minus); return COMPILE_OK;
+ case idMULT: SP_INSN(mult); return COMPILE_OK;
+ case idDIV: SP_INSN(div); return COMPILE_OK;
+ case idMOD: SP_INSN(mod); return COMPILE_OK;
+ case idEq: SP_INSN(eq); return COMPILE_OK;
+ case idNeq: SP_INSN(neq); return COMPILE_OK;
+ case idLT: SP_INSN(lt); return COMPILE_OK;
+ case idLE: SP_INSN(le); return COMPILE_OK;
+ case idGT: SP_INSN(gt); return COMPILE_OK;
+ case idGE: SP_INSN(ge); return COMPILE_OK;
+ case idLTLT: SP_INSN(ltlt); return COMPILE_OK;
+ case idAREF: SP_INSN(aref); return COMPILE_OK;
}
+ break;
}
+ iobj->insn_id = BIN(opt_send_simple);
}
}
+#undef SP_INSN
+
return COMPILE_OK;
}
@@ -2039,7 +2093,7 @@ insn_set_sc_state(rb_iseq_t *iseq, INSN *iobj, int state)
dump_disasm_list((LINK_ELEMENT *)iobj);
dump_disasm_list((LINK_ELEMENT *)lobj);
printf("\n-- %d, %d\n", lobj->sc_state, nstate);
- rb_compile_error(RSTRING_PTR(iseq->filename), iobj->line_no,
+ rb_compile_error(RSTRING_PTR(iseq->location.path), iobj->line_no,
"insn_set_sc_state error\n");
return 0;
}
@@ -2141,7 +2195,7 @@ iseq_set_sequence_stackcaching(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
case SCS_XX:
goto normal_insn;
default:
- rb_compile_error(RSTRING_PTR(iseq->filename), iobj->line_no,
+ rb_compile_error(RSTRING_PTR(iseq->location.path), iobj->line_no,
"unreachable");
}
/* remove useless pop */
@@ -2172,10 +2226,8 @@ iseq_set_sequence_stackcaching(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
return COMPILE_OK;
}
-
-
static int
-compile_dstr_fragments(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int *cntp)
+compile_dstr_fragments(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *node, int *cntp)
{
NODE *list = node->nd_next;
VALUE lit = node->nd_lit;
@@ -2189,7 +2241,14 @@ compile_dstr_fragments(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int *cntp
}
while (list) {
- COMPILE(ret, "each string", list->nd_head);
+ node = list->nd_head;
+ if (nd_type(node) == NODE_STR) {
+ hide_obj(node->nd_lit);
+ ADD_INSN1(ret, nd_line(node), putobject, node->nd_lit);
+ }
+ else {
+ COMPILE(ret, "each string", node);
+ }
cnt++;
list = list->nd_next;
}
@@ -2261,65 +2320,155 @@ compile_branch_condition(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * cond,
return COMPILE_OK;
}
+enum compile_array_type_t {
+ COMPILE_ARRAY_TYPE_ARRAY,
+ COMPILE_ARRAY_TYPE_HASH,
+ COMPILE_ARRAY_TYPE_ARGS
+};
+
static int
compile_array_(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root,
- VALUE opt_p, int poped)
+ enum compile_array_type_t type, int poped)
{
NODE *node = node_root;
- int len = (int)node->nd_alen, line = (int)nd_line(node), i=0;
- DECL_ANCHOR(anchor);
-
- INIT_ANCHOR(anchor);
- if (nd_type(node) != NODE_ZARRAY) {
- while (node) {
- if (nd_type(node) != NODE_ARRAY) {
- rb_bug("compile_array: This node is not NODE_ARRAY, but %s",
- ruby_node_name(nd_type(node)));
- }
+ int line = (int)nd_line(node);
+ int len = 0;
- i++;
- if (opt_p && nd_type(node->nd_head) != NODE_LIT) {
- opt_p = Qfalse;
+ if (nd_type(node) == NODE_ZARRAY) {
+ if (!poped) {
+ switch (type) {
+ case COMPILE_ARRAY_TYPE_ARRAY: ADD_INSN1(ret, line, newarray, INT2FIX(0)); break;
+ case COMPILE_ARRAY_TYPE_HASH: ADD_INSN1(ret, line, newhash, INT2FIX(0)); break;
+ case COMPILE_ARRAY_TYPE_ARGS: /* do nothing */ break;
}
- COMPILE_(anchor, "array element", node->nd_head, poped);
- node = node->nd_next;
}
}
+ else {
+ int opt_p = 1;
+ int first = 1, i;
- if (len != i) {
- if (0) {
- rb_bug("node error: compile_array (%d: %d-%d)",
- (int)nd_line(node_root), len, i);
- }
- len = i;
- }
+ while (node) {
+ NODE *start_node = node, *end_node;
+ NODE *kw = 0;
+ const int max = 0x100;
+ DECL_ANCHOR(anchor);
+ INIT_ANCHOR(anchor);
+
+ for (i=0; i<max && node; i++, len++, node = node->nd_next) {
+ if (CPDEBUG > 0 && nd_type(node) != NODE_ARRAY) {
+ rb_bug("compile_array: This node is not NODE_ARRAY, but %s", ruby_node_name(nd_type(node)));
+ }
- if (opt_p == Qtrue) {
- if (!poped) {
- VALUE ary = rb_ary_tmp_new(len);
- node = node_root;
- while (node) {
- rb_ary_push(ary, node->nd_head->nd_lit);
- node = node->nd_next;
+ if (type == COMPILE_ARRAY_TYPE_HASH && !node->nd_head) {
+ opt_p = 0;
+ kw = node->nd_next;
+ node = kw->nd_next;
+ kw = kw->nd_head;
+ break;
+ }
+ if (opt_p && nd_type(node->nd_head) != NODE_LIT) {
+ opt_p = 0;
+ }
+
+ COMPILE_(anchor, "array element", node->nd_head, poped);
+ }
+
+ if (opt_p && type != COMPILE_ARRAY_TYPE_ARGS) {
+ if (!poped) {
+ VALUE ary = rb_ary_tmp_new(i);
+
+ end_node = node;
+ node = start_node;
+
+ while (node != end_node) {
+ rb_ary_push(ary, node->nd_head->nd_lit);
+ node = node->nd_next;
+ }
+ while (node && nd_type(node->nd_head) == NODE_LIT &&
+ node->nd_next && nd_type(node->nd_next->nd_head) == NODE_LIT) {
+ rb_ary_push(ary, node->nd_head->nd_lit);
+ node = node->nd_next;
+ rb_ary_push(ary, node->nd_head->nd_lit);
+ node = node->nd_next;
+ len++;
+ }
+
+ OBJ_FREEZE(ary);
+
+ iseq_add_mark_object_compile_time(iseq, ary);
+
+ if (first) {
+ first = 0;
+ if (type == COMPILE_ARRAY_TYPE_ARRAY) {
+ ADD_INSN1(ret, line, duparray, ary);
+ }
+ else { /* COMPILE_ARRAY_TYPE_HASH */
+ ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(ret, line, putobject, ary);
+ ADD_SEND(ret, line, ID2SYM(id_core_hash_from_ary), INT2FIX(1));
+ }
+ }
+ else {
+ if (type == COMPILE_ARRAY_TYPE_ARRAY) {
+ ADD_INSN1(ret, line, putobject, ary);
+ ADD_INSN(ret, line, concatarray);
+ }
+ else {
+ ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(ret, line, putobject, ary);
+ ADD_SEND(ret, line, ID2SYM(id_core_hash_merge_ary), INT2FIX(1));
+ }
+ }
+ }
+ }
+ else {
+ if (!poped) {
+ switch (type) {
+ case COMPILE_ARRAY_TYPE_ARRAY:
+ ADD_INSN1(anchor, line, newarray, INT2FIX(i));
+
+ if (first) {
+ first = 0;
+ }
+ else {
+ ADD_INSN(anchor, line, concatarray);
+ }
+ APPEND_LIST(ret, anchor);
+ break;
+ case COMPILE_ARRAY_TYPE_HASH:
+ if (first) {
+ first = 0;
+ ADD_INSN1(anchor, line, newhash, INT2FIX(i));
+ APPEND_LIST(ret, anchor);
+ }
+ else if (i > 0) {
+ ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN(ret, line, swap);
+ APPEND_LIST(ret, anchor);
+ ADD_SEND(ret, line, ID2SYM(id_core_hash_merge_ptr), INT2FIX(i + 1));
+ }
+ if (kw) {
+ ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN(ret, line, swap);
+ COMPILE(ret, "keyword splat", kw);
+ ADD_SEND(ret, line, ID2SYM(id_core_hash_merge_kwd), INT2FIX(2));
+ }
+ break;
+ case COMPILE_ARRAY_TYPE_ARGS:
+ APPEND_LIST(ret, anchor);
+ break;
+ }
+ }
}
- OBJ_FREEZE(ary);
- iseq_add_mark_object_compile_time(iseq, ary);
- ADD_INSN1(ret, nd_line(node_root), duparray, ary);
- }
- }
- else {
- if (!poped) {
- ADD_INSN1(anchor, line, newarray, INT2FIX(len));
}
- APPEND_LIST(ret, anchor);
}
return len;
}
static VALUE
-compile_array(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root, VALUE opt_p)
+compile_array(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root, enum compile_array_type_t type)
{
- return compile_array_(iseq, ret, node_root, opt_p, 0);
+ return compile_array_(iseq, ret, node_root, type, 0);
}
static VALUE
@@ -2329,7 +2478,7 @@ case_when_optimizable_literal(NODE * node)
case NODE_LIT: {
VALUE v = node->nd_lit;
double ival;
- if (TYPE(v) == T_FLOAT &&
+ if (RB_TYPE_P(v, T_FLOAT) &&
modf(RFLOAT_VALUE(v), &ival) == 0.0) {
return FIXABLE(ival) ? LONG2FIX((long)ival) : rb_dbl2big(ival);
}
@@ -2341,27 +2490,30 @@ case_when_optimizable_literal(NODE * node)
case NODE_STR:
return node->nd_lit;
}
- return Qfalse;
+ return Qundef;
}
-static VALUE
-when_vals(rb_iseq_t *iseq, LINK_ANCHOR *cond_seq, NODE *vals, LABEL *l1, VALUE special_literals)
+static int
+when_vals(rb_iseq_t *iseq, LINK_ANCHOR *cond_seq, NODE *vals, LABEL *l1, int only_special_literals, VALUE literals)
{
while (vals) {
- VALUE lit;
- NODE* val;
+ NODE* val = vals->nd_head;
+ VALUE lit = case_when_optimizable_literal(val);
- val = vals->nd_head;
-
- if (special_literals &&
- (lit = case_when_optimizable_literal(val)) != Qfalse) {
- rb_ary_push(special_literals, lit);
- rb_ary_push(special_literals, (VALUE)(l1) | 1);
+ if (lit == Qundef) {
+ only_special_literals = 0;
}
else {
- special_literals = Qfalse;
+ if (rb_hash_lookup(literals, lit) != Qnil) {
+ rb_compile_warning(RSTRING_PTR(iseq->location.path), nd_line(val), "duplicated when clause is ignored");
+ }
+ else {
+ rb_hash_aset(literals, lit, (VALUE)(l1) | 1);
+ }
}
+ ADD_INSN(cond_seq, nd_line(val), dup); /* dup target */
+
if (nd_type(val) == NODE_STR) {
debugp_param("nd_lit", val->nd_lit);
OBJ_FREEZE(val->nd_lit);
@@ -2370,12 +2522,12 @@ when_vals(rb_iseq_t *iseq, LINK_ANCHOR *cond_seq, NODE *vals, LABEL *l1, VALUE s
else {
COMPILE(cond_seq, "when cond", val);
}
- ADD_INSN1(cond_seq, nd_line(val), topn, INT2FIX(1));
- ADD_SEND(cond_seq, nd_line(val), ID2SYM(idEqq), INT2FIX(1));
+
+ ADD_INSN1(cond_seq, nd_line(vals), checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_CASE));
ADD_INSNL(cond_seq, nd_line(val), branchif, l1);
vals = vals->nd_next;
}
- return special_literals;
+ return only_special_literals;
}
static int
@@ -2384,15 +2536,16 @@ compile_massign_lhs(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *node)
switch (nd_type(node)) {
case NODE_ATTRASGN: {
INSN *iobj;
+ rb_call_info_t *ci;
VALUE dupidx;
COMPILE_POPED(ret, "masgn lhs (NODE_ATTRASGN)", node);
+
POP_ELEMENT(ret); /* pop pop insn */
iobj = (INSN *)POP_ELEMENT(ret); /* pop send insn */
-
- dupidx = iobj->operands[1];
- dupidx = FIXNUM_INC(dupidx, 1);
- iobj->operands[1] = dupidx;
+ ci = (rb_call_info_t *)iobj->operands[0];
+ ci->orig_argc += 1; ci->argc = ci->orig_argc;
+ dupidx = INT2FIX(ci->orig_argc);
ADD_INSN1(ret, nd_line(node), topn, dupidx);
ADD_ELEM(ret, (LINK_ELEMENT *)iobj);
@@ -2600,27 +2753,28 @@ compile_cpath(LINK_ANCHOR *ret, rb_iseq_t *iseq, NODE *cpath)
}
}
+#define defined_expr defined_expr0
static int
defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
NODE *node, LABEL **lfinish, VALUE needstr)
{
- const char *estr = 0;
+ enum defined_type expr_type = 0;
enum node_type type;
switch (type = nd_type(node)) {
/* easy literals */
case NODE_NIL:
- estr = "nil";
+ expr_type = DEFINED_NIL;
break;
case NODE_SELF:
- estr = "self";
+ expr_type = DEFINED_SELF;
break;
case NODE_TRUE:
- estr = "true";
+ expr_type = DEFINED_TRUE;
break;
case NODE_FALSE:
- estr = "false";
+ expr_type = DEFINED_FALSE;
break;
case NODE_ARRAY:{
@@ -2641,13 +2795,13 @@ defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
case NODE_AND:
case NODE_OR:
default:
- estr = "expression";
+ expr_type = DEFINED_EXPR;
break;
/* variables */
case NODE_LVAR:
case NODE_DVAR:
- estr = "local-variable";
+ expr_type = DEFINED_LVAR;
break;
case NODE_IVAR:
@@ -2721,21 +2875,9 @@ defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
ADD_INSNL(ret, nd_line(node), branchunless, lfinish[1]);
}
if (!self) {
- LABEL *lstart = NEW_LABEL(nd_line(node));
- LABEL *lend = NEW_LABEL(nd_line(node));
- VALUE rescue = NEW_CHILD_ISEQVAL(NEW_NIL(),
- rb_str_concat(rb_str_new2
- ("defined guard in "),
- iseq->name),
- ISEQ_TYPE_DEFINED_GUARD, 0);
-
defined_expr(iseq, ret, node->nd_recv, lfinish, Qfalse);
ADD_INSNL(ret, nd_line(node), branchunless, lfinish[1]);
-
- ADD_LABEL(ret, lstart);
COMPILE(ret, "defined/recv", node->nd_recv);
- ADD_LABEL(ret, lend);
- ADD_CATCH_ENTRY(CATCH_TYPE_RESCUE, lstart, lend, rescue, lfinish[1]);
ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_METHOD),
ID2SYM(node->nd_mid), needstr);
}
@@ -2781,16 +2923,14 @@ defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
case NODE_CDECL:
case NODE_CVDECL:
case NODE_CVASGN:
- estr = "assignment";
+ expr_type = DEFINED_ASGN;
break;
}
- if (estr != 0) {
+ if (expr_type) {
if (needstr != Qfalse) {
- VALUE str = rb_str_new2(estr);
- hide_obj(str);
- ADD_INSN1(ret, nd_line(node), putstring, str);
- iseq_add_mark_object_compile_time(iseq, str);
+ VALUE str = rb_iseq_defined_string(expr_type);
+ ADD_INSN1(ret, nd_line(node), putobject, str);
}
else {
ADD_INSN1(ret, nd_line(node), putobject, Qtrue);
@@ -2799,6 +2939,29 @@ defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
}
return 0;
}
+#undef defined_expr
+
+static int
+defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
+ NODE *node, LABEL **lfinish, VALUE needstr)
+{
+ LINK_ELEMENT *lcur = ret->last;
+ int done = defined_expr0(iseq, ret, node, lfinish, needstr);
+ if (lfinish[1]) {
+ int line = nd_line(node);
+ LABEL *lstart = NEW_LABEL(line);
+ LABEL *lend = NEW_LABEL(line);
+ VALUE rescue = NEW_CHILD_ISEQVAL(NEW_NIL(),
+ rb_str_concat(rb_str_new2
+ ("defined guard in "),
+ iseq->location.label),
+ ISEQ_TYPE_DEFINED_GUARD, 0);
+ APPEND_LABEL(ret, lcur, lstart);
+ ADD_LABEL(ret, lend);
+ ADD_CATCH_ENTRY(CATCH_TYPE_RESCUE, lstart, lend, rescue, lfinish[1]);
+ }
+ return done;
+}
#define BUFSIZE 0x100
@@ -2818,10 +2981,10 @@ make_name_for_block(rb_iseq_t *iseq)
}
if (level == 1) {
- return rb_sprintf("block in %s", RSTRING_PTR(ip->name));
+ return rb_sprintf("block in %s", RSTRING_PTR(ip->location.label));
}
else {
- return rb_sprintf("block (%d levels) in %s", level, RSTRING_PTR(ip->name));
+ return rb_sprintf("block (%d levels) in %s", level, RSTRING_PTR(ip->location.label));
}
}
@@ -2901,7 +3064,7 @@ setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *argn, VALUE *flag)
INIT_ANCHOR(args_splat);
if (argn && nd_type(argn) == NODE_BLOCK_PASS) {
COMPILE(arg_block, "block", argn->nd_body);
- *flag |= VM_CALL_ARGS_BLOCKARG_BIT;
+ *flag |= VM_CALL_ARGS_BLOCKARG;
argn = argn->nd_head;
}
@@ -2912,7 +3075,7 @@ setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *argn, VALUE *flag)
COMPILE(args, "args (splat)", argn->nd_head);
argc = INT2FIX(1);
nsplat++;
- *flag |= VM_CALL_ARGS_SPLAT_BIT;
+ *flag |= VM_CALL_ARGS_SPLAT;
break;
}
case NODE_ARGSCAT:
@@ -2935,11 +3098,10 @@ setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *argn, VALUE *flag)
}
INSERT_LIST(args_splat, tmp);
nsplat++;
- *flag |= VM_CALL_ARGS_SPLAT_BIT;
+ *flag |= VM_CALL_ARGS_SPLAT;
if (next_is_array) {
- argc = INT2FIX(compile_array(iseq, args, argn->nd_head, Qfalse) + 1);
- POP_ELEMENT(args);
+ argc = INT2FIX(compile_array(iseq, args, argn->nd_head, COMPILE_ARRAY_TYPE_ARGS) + 1);
}
else {
argn = argn->nd_head;
@@ -2948,8 +3110,7 @@ setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *argn, VALUE *flag)
break;
}
case NODE_ARRAY: {
- argc = INT2FIX(compile_array(iseq, args, argn, Qfalse));
- POP_ELEMENT(args);
+ argc = INT2FIX(compile_array(iseq, args, argn, COMPILE_ARRAY_TYPE_ARGS));
break;
}
default: {
@@ -2969,7 +3130,7 @@ setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *argn, VALUE *flag)
ADD_SEQ(args, args_splat);
}
- if (*flag & VM_CALL_ARGS_BLOCKARG_BIT) {
+ if (*flag & VM_CALL_ARGS_BLOCKARG) {
ADD_SEQ(args, arg_block);
}
return argc;
@@ -3055,11 +3216,15 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
DECL_ANCHOR(head);
DECL_ANCHOR(body_seq);
DECL_ANCHOR(cond_seq);
- VALUE special_literals = rb_ary_tmp_new(1);
+ int only_special_literals = 1;
+ VALUE literals = rb_hash_new();
INIT_ANCHOR(head);
INIT_ANCHOR(body_seq);
INIT_ANCHOR(cond_seq);
+
+ RHASH_TBL(literals)->type = &cdhash_type;
+
if (node->nd_head == 0) {
COMPILE_(ret, "when", node->nd_body, poped);
break;
@@ -3091,14 +3256,15 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
if (vals) {
switch (nd_type(vals)) {
case NODE_ARRAY:
- special_literals = when_vals(iseq, cond_seq, vals, l1, special_literals);
+ only_special_literals = when_vals(iseq, cond_seq, vals, l1, only_special_literals, literals);
break;
case NODE_SPLAT:
case NODE_ARGSCAT:
case NODE_ARGSPUSH:
- special_literals = 0;
+ only_special_literals = 0;
+ ADD_INSN (cond_seq, nd_line(vals), dup);
COMPILE(cond_seq, "when/cond splat", vals);
- ADD_INSN1(cond_seq, nd_line(vals), checkincludearray, Qtrue);
+ ADD_INSN1(cond_seq, nd_line(vals), checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_CASE | VM_CHECKMATCH_ARRAY));
ADD_INSNL(cond_seq, nd_line(vals), branchif, l1);
break;
default:
@@ -3133,11 +3299,11 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
ADD_INSNL(cond_seq, nd_line(tempnode), jump, endlabel);
}
- if (special_literals) {
+ if (only_special_literals) {
+ iseq_add_mark_object(iseq, literals);
+
ADD_INSN(ret, nd_line(tempnode), dup);
- ADD_INSN2(ret, nd_line(tempnode), opt_case_dispatch,
- special_literals, elselabel);
- iseq_add_mark_object_compile_time(iseq, special_literals);
+ ADD_INSN2(ret, nd_line(tempnode), opt_case_dispatch, literals, elselabel);
}
ADD_SEQ(ret, cond_seq);
@@ -3179,8 +3345,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
case NODE_ARGSPUSH:
ADD_INSN(ret, nd_line(vals), putnil);
COMPILE(ret, "when2/cond splat", vals);
- ADD_INSN1(ret, nd_line(vals), checkincludearray, Qfalse);
- ADD_INSN(ret, nd_line(vals), pop);
+ ADD_INSN1(ret, nd_line(vals), checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_WHEN | VM_CHECKMATCH_ARRAY));
ADD_INSNL(ret, nd_line(vals), branchif, l1);
break;
default:
@@ -3287,7 +3452,6 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
VALUE prevblock = iseq->compile_data->current_block;
LABEL *retry_label = NEW_LABEL(nd_line(node));
LABEL *retry_end_l = NEW_LABEL(nd_line(node));
- ID mid = 0;
ADD_LABEL(ret, retry_label);
if (nd_type(node) == NODE_FOR) {
@@ -3297,7 +3461,6 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
NEW_CHILD_ISEQVAL(node->nd_body, make_name_for_block(iseq),
ISEQ_TYPE_BLOCK, nd_line(node));
- mid = idEach;
ADD_SEND_R(ret, nd_line(node), ID2SYM(idEach), INT2FIX(0),
iseq->compile_data->current_block, INT2FIX(0));
}
@@ -3543,7 +3706,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
LABEL *lcont = NEW_LABEL(nd_line(node));
VALUE rescue = NEW_CHILD_ISEQVAL(
node->nd_resq,
- rb_str_concat(rb_str_new2("rescue in "), iseq->name),
+ rb_str_concat(rb_str_new2("rescue in "), iseq->location.label),
ISEQ_TYPE_RESCUE, nd_line(node));
ADD_LABEL(ret, lstart);
@@ -3579,9 +3742,9 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
switch (nd_type(narg)) {
case NODE_ARRAY:
while (narg) {
+ ADD_INSN2(ret, nd_line(node), getlocal, INT2FIX(2), INT2FIX(0));
COMPILE(ret, "rescue arg", narg->nd_head);
- ADD_INSN2(ret, nd_line(node), getdynamic, INT2FIX(2), INT2FIX(0));
- ADD_SEND(ret, nd_line(node), ID2SYM(idEqq), INT2FIX(1));
+ ADD_INSN1(ret, nd_line(node), checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_RESCUE));
ADD_INSNL(ret, nd_line(node), branchif, label_hit);
narg = narg->nd_next;
}
@@ -3589,11 +3752,9 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
case NODE_SPLAT:
case NODE_ARGSCAT:
case NODE_ARGSPUSH:
- ADD_INSN2(ret, nd_line(node), getdynamic, INT2FIX(2), INT2FIX(0));
+ ADD_INSN2(ret, nd_line(node), getlocal, INT2FIX(2), INT2FIX(0));
COMPILE(ret, "rescue/cond splat", narg);
- ADD_INSN1(ret, nd_line(node), checkincludearray, Qtrue);
- ADD_INSN(ret, nd_line(node), swap);
- ADD_INSN(ret, nd_line(node), pop);
+ ADD_INSN1(ret, nd_line(node), checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_RESCUE | VM_CHECKMATCH_ARRAY));
ADD_INSNL(ret, nd_line(node), branchif, label_hit);
break;
default:
@@ -3602,10 +3763,9 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
}
else {
- ADD_INSN1(ret, nd_line(node), putobject,
- rb_eStandardError);
- ADD_INSN2(ret, nd_line(node), getdynamic, INT2FIX(2), INT2FIX(0));
- ADD_SEND(ret, nd_line(node), ID2SYM(idEqq), INT2FIX(1));
+ ADD_INSN2(ret, nd_line(node), getlocal, INT2FIX(2), INT2FIX(0));
+ ADD_INSN1(ret, nd_line(node), putobject, rb_eStandardError);
+ ADD_INSN1(ret, nd_line(node), checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_RESCUE));
ADD_INSNL(ret, nd_line(node), branchif, label_hit);
}
ADD_INSNL(ret, nd_line(node), jump, label_miss);
@@ -3625,7 +3785,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
VALUE ensure = NEW_CHILD_ISEQVAL(node->nd_ensr,
rb_str_concat(rb_str_new2
("ensure in "),
- iseq->name),
+ iseq->location.label),
ISEQ_TYPE_ENSURE, nd_line(node));
LABEL *lstart = NEW_LABEL(nd_line(node));
LABEL *lend = NEW_LABEL(nd_line(node));
@@ -3700,7 +3860,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
if (!poped) {
ADD_INSN(ret, nd_line(node), dup);
}
- ADD_INSN1(ret, nd_line(node), setlocal, INT2FIX(idx));
+ ADD_INSN2(ret, nd_line(node), setlocal, INT2FIX(idx), INT2FIX(get_lvar_level(iseq)));
break;
}
@@ -3720,8 +3880,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
rb_bug("NODE_DASGN(_CURR): unknown id (%s)", rb_id2name(node->nd_vid));
}
- ADD_INSN2(ret, nd_line(node), setdynamic,
- INT2FIX(ls - idx), INT2FIX(lv));
+ ADD_INSN2(ret, nd_line(node), setlocal, INT2FIX(ls - idx), INT2FIX(lv));
break;
}
case NODE_GASGN:{
@@ -3847,7 +4006,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
if (!poped) {
ADD_INSN1(ret, nd_line(node), setn, FIXNUM_INC(argc, 2+boff));
}
- if (flag & VM_CALL_ARGS_SPLAT_BIT) {
+ if (flag & VM_CALL_ARGS_SPLAT) {
ADD_INSN1(ret, nd_line(node), newarray, INT2FIX(1));
if (boff > 0) {
ADD_INSN1(ret, nd_line(node), dupn, INT2FIX(3));
@@ -3884,7 +4043,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
if (!poped) {
ADD_INSN1(ret, nd_line(node), setn, FIXNUM_INC(argc, 2+boff));
}
- if (flag & VM_CALL_ARGS_SPLAT_BIT) {
+ if (flag & VM_CALL_ARGS_SPLAT) {
ADD_INSN1(ret, nd_line(node), newarray, INT2FIX(1));
if (boff > 0) {
ADD_INSN1(ret, nd_line(node), dupn, INT2FIX(3));
@@ -4143,10 +4302,10 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
switch (nd_type(node)) {
case NODE_VCALL:
- flag |= VM_CALL_VCALL_BIT;
+ flag |= VM_CALL_VCALL;
/* VCALL is funcall, so fall through */
case NODE_FCALL:
- flag |= VM_CALL_FCALL_BIT;
+ flag |= VM_CALL_FCALL;
}
ADD_SEND_R(ret, nd_line(node), ID2SYM(mid),
@@ -4173,13 +4332,14 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
/* NODE_ZSUPER */
int i;
rb_iseq_t *liseq = iseq->local_iseq;
+ int lvar_level = get_lvar_level(iseq);
argc = INT2FIX(liseq->argc);
/* normal arguments */
for (i = 0; i < liseq->argc; i++) {
int idx = liseq->local_size - i;
- ADD_INSN1(args, nd_line(node), getlocal, INT2FIX(idx));
+ ADD_INSN2(args, nd_line(node), getlocal, INT2FIX(idx), INT2FIX(lvar_level));
}
if (!liseq->arg_simple) {
@@ -4188,7 +4348,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
int j;
for (j = 0; j < liseq->arg_opts - 1; j++) {
int idx = liseq->local_size - (i + j);
- ADD_INSN1(args, nd_line(node), getlocal, INT2FIX(idx));
+ ADD_INSN2(args, nd_line(node), getlocal, INT2FIX(idx), INT2FIX(lvar_level));
}
i += j;
argc = INT2FIX(i);
@@ -4197,9 +4357,9 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
if (liseq->arg_rest != -1) {
/* rest argument */
int idx = liseq->local_size - liseq->arg_rest;
- ADD_INSN1(args, nd_line(node), getlocal, INT2FIX(idx));
+ ADD_INSN2(args, nd_line(node), getlocal, INT2FIX(idx), INT2FIX(lvar_level));
argc = INT2FIX(liseq->arg_rest + 1);
- flag |= VM_CALL_ARGS_SPLAT_BIT;
+ flag |= VM_CALL_ARGS_SPLAT;
}
if (liseq->arg_post_len) {
@@ -4211,7 +4371,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
int j;
for (j=0; j<post_len; j++) {
int idx = liseq->local_size - (post_start + j);
- ADD_INSN1(args, nd_line(node), getlocal, INT2FIX(idx));
+ ADD_INSN2(args, nd_line(node), getlocal, INT2FIX(idx), INT2FIX(lvar_level));
}
ADD_INSN1(args, nd_line(node), newarray, INT2FIX(j));
ADD_INSN (args, nd_line(node), concatarray);
@@ -4221,7 +4381,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
int j;
for (j=0; j<post_len; j++) {
int idx = liseq->local_size - (post_start + j);
- ADD_INSN1(args, nd_line(node), getlocal, INT2FIX(idx));
+ ADD_INSN2(args, nd_line(node), getlocal, INT2FIX(idx), INT2FIX(lvar_level));
}
argc = INT2FIX(post_len + post_start);
}
@@ -4230,11 +4390,10 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
/* dummy receiver */
- ADD_INSN1(ret, nd_line(node), putobject,
- nd_type(node) == NODE_ZSUPER ? Qfalse : Qtrue);
+ ADD_INSN1(ret, nd_line(node), putobject, nd_type(node) == NODE_ZSUPER ? Qfalse : Qtrue);
ADD_SEQ(ret, args);
- ADD_INSN3(ret, nd_line(node), invokesuper,
- argc, parent_block, LONG2FIX(flag));
+ ADD_INSN1(ret, nd_line(node), invokesuper, new_callinfo(iseq, 0, FIX2INT(argc), parent_block,
+ flag | VM_CALL_SUPER | VM_CALL_FCALL));
if (poped) {
ADD_INSN(ret, nd_line(node), pop);
@@ -4242,7 +4401,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
break;
}
case NODE_ARRAY:{
- compile_array_(iseq, ret, node, Qtrue, poped);
+ compile_array_(iseq, ret, node, COMPILE_ARRAY_TYPE_ARRAY, poped);
break;
}
case NODE_ZARRAY:{
@@ -4265,27 +4424,23 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
case NODE_HASH:{
DECL_ANCHOR(list);
- VALUE size = 0;
int type = node->nd_head ? nd_type(node->nd_head) : NODE_ZARRAY;
INIT_ANCHOR(list);
switch (type) {
- case NODE_ARRAY:{
- compile_array(iseq, list, node->nd_head, Qfalse);
- size = OPERAND_AT(POP_ELEMENT(list), 0);
+ case NODE_ARRAY:
+ compile_array(iseq, list, node->nd_head, COMPILE_ARRAY_TYPE_HASH);
ADD_SEQ(ret, list);
break;
- }
+
case NODE_ZARRAY:
- size = INT2FIX(0);
+ ADD_INSN1(ret, nd_line(node), newhash, INT2FIX(0));
break;
default:
rb_bug("can't make hash with this node: %s", ruby_node_name(type));
}
- ADD_INSN1(ret, nd_line(node), newhash, size);
-
if (poped) {
ADD_INSN(ret, nd_line(node), pop);
}
@@ -4347,7 +4502,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
ADD_SEQ(ret, args);
- ADD_INSN2(ret, nd_line(node), invokeblock, argc, LONG2FIX(flag));
+ ADD_INSN1(ret, nd_line(node), invokeblock, new_callinfo(iseq, 0, FIX2INT(argc), 0, flag));
if (poped) {
ADD_INSN(ret, nd_line(node), pop);
@@ -4360,7 +4515,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
int idx = iseq->local_iseq->local_size - get_local_var_idx(iseq, id);
debugs("id: %s idx: %d\n", rb_id2name(id), idx);
- ADD_INSN1(ret, nd_line(node), getlocal, INT2FIX(idx));
+ ADD_INSN2(ret, nd_line(node), getlocal, INT2FIX(idx), INT2FIX(get_lvar_level(iseq)));
}
break;
}
@@ -4372,7 +4527,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
if (idx < 0) {
rb_bug("unknown dvar (%s)", rb_id2name(node->nd_vid));
}
- ADD_INSN2(ret, nd_line(node), getdynamic, INT2FIX(ls - idx), INT2FIX(lv));
+ ADD_INSN2(ret, nd_line(node), getlocal, INT2FIX(ls - idx), INT2FIX(lv));
}
break;
}
@@ -4599,7 +4754,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
case NODE_SPLAT:{
COMPILE(ret, "splat", node->nd_head);
- ADD_INSN1(ret, nd_line(node), splatarray, Qfalse);
+ ADD_INSN1(ret, nd_line(node), splatarray, Qtrue);
if (poped) {
ADD_INSN(ret, nd_line(node), pop);
@@ -4712,7 +4867,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
case NODE_SCLASS:{
ID singletonclass;
VALUE iseqval =
- NEW_ISEQVAL(node->nd_body, rb_str_new2("singletonclass"),
+ NEW_ISEQVAL(node->nd_body, rb_str_new2("singleton class"),
ISEQ_TYPE_CLASS, nd_line(node));
COMPILE(ret, "sclass#recv", node->nd_recv);
@@ -4815,7 +4970,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
LABEL *lfin = NEW_LABEL(nd_line(node));
LABEL *ltrue = NEW_LABEL(nd_line(node));
VALUE key = rb_sprintf("flipflag/%s-%p-%d",
- RSTRING_PTR(iseq->name), (void *)iseq,
+ RSTRING_PTR(iseq->location.label), (void *)iseq,
iseq->compile_data->flip_cnt++);
hide_obj(key);
@@ -4876,7 +5031,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
case NODE_ERRINFO:{
if (!poped) {
if (iseq->type == ISEQ_TYPE_RESCUE) {
- ADD_INSN2(ret, nd_line(node), getdynamic, INT2FIX(2), INT2FIX(0));
+ ADD_INSN2(ret, nd_line(node), getlocal, INT2FIX(2), INT2FIX(0));
}
else {
rb_iseq_t *ip = iseq;
@@ -4889,7 +5044,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
level++;
}
if (ip) {
- ADD_INSN2(ret, nd_line(node), getdynamic, INT2FIX(2), INT2FIX(level));
+ ADD_INSN2(ret, nd_line(node), getlocal, INT2FIX(2), INT2FIX(level));
}
else {
ADD_INSN(ret, nd_line(node), putnil);
@@ -4934,6 +5089,38 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
break;
}
+ case NODE_KW_ARG:{
+ LABEL *default_label = NEW_LABEL(nd_line(node));
+ LABEL *end_label = NEW_LABEL(nd_line(node));
+ int idx, lv, ls;
+ ID id = node->nd_body->nd_vid;
+
+ ADD_INSN(ret, nd_line(node), dup);
+ ADD_INSN1(ret, nd_line(node), putobject, ID2SYM(id));
+ ADD_SEND(ret, nd_line(node), ID2SYM(rb_intern("key?")), INT2FIX(1));
+ ADD_INSNL(ret, nd_line(node), branchunless, default_label);
+ ADD_INSN(ret, nd_line(node), dup);
+ ADD_INSN1(ret, nd_line(node), putobject, ID2SYM(id));
+ ADD_SEND(ret, nd_line(node), ID2SYM(rb_intern("delete")), INT2FIX(1));
+ switch (nd_type(node->nd_body)) {
+ case NODE_LASGN:
+ idx = iseq->local_iseq->local_size - get_local_var_idx(iseq, id);
+ ADD_INSN2(ret, nd_line(node), setlocal, INT2FIX(idx), INT2FIX(get_lvar_level(iseq)));
+ break;
+ case NODE_DASGN:
+ case NODE_DASGN_CURR:
+ idx = get_dyna_var_idx(iseq, id, &lv, &ls);
+ ADD_INSN2(ret, nd_line(node), setlocal, INT2FIX(ls - idx), INT2FIX(lv));
+ break;
+ default:
+ rb_bug("iseq_compile_each (NODE_KW_ARG): unknown node: %s", ruby_node_name(nd_type(node->nd_body)));
+ }
+ ADD_INSNL(ret, nd_line(node), jump, end_label);
+ ADD_LABEL(ret, default_label);
+ COMPILE_POPED(ret, "keyword default argument", node->nd_body);
+ ADD_LABEL(ret, end_label);
+ break;
+ }
case NODE_DSYM:{
compile_dstr(iseq, ret, node);
if (!poped) {
@@ -4955,7 +5142,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
argc = setup_args(iseq, args, node->nd_args, &flag);
if (node->nd_recv == (NODE *) 1) {
- flag |= VM_CALL_FCALL_BIT;
+ flag |= VM_CALL_FCALL;
ADD_INSN(recv, nd_line(node), putself);
}
else {
@@ -4970,16 +5157,16 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
ADD_SEQ(ret, recv);
ADD_SEQ(ret, args);
- if (flag & VM_CALL_ARGS_BLOCKARG_BIT) {
+ if (flag & VM_CALL_ARGS_BLOCKARG) {
ADD_INSN1(ret, nd_line(node), topn, INT2FIX(1));
- if (flag & VM_CALL_ARGS_SPLAT_BIT) {
+ if (flag & VM_CALL_ARGS_SPLAT) {
ADD_INSN1(ret, nd_line(node), putobject, INT2FIX(-1));
ADD_SEND(ret, nd_line(node), ID2SYM(idAREF), INT2FIX(1));
}
ADD_INSN1(ret, nd_line(node), setn, FIXNUM_INC(argc, 3));
ADD_INSN (ret, nd_line(node), pop);
}
- else if (flag & VM_CALL_ARGS_SPLAT_BIT) {
+ else if (flag & VM_CALL_ARGS_SPLAT) {
ADD_INSN(ret, nd_line(node), dup);
ADD_INSN1(ret, nd_line(node), putobject, INT2FIX(-1));
ADD_SEND(ret, nd_line(node), ID2SYM(idAREF), INT2FIX(1));
@@ -4999,20 +5186,6 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
break;
}
- case NODE_OPTBLOCK:{
- /* for optimize */
- LABEL *redo_label = NEW_LABEL(0);
- LABEL *next_label = NEW_LABEL(0);
-
- iseq->compile_data->start_label = next_label;
- iseq->compile_data->redo_label = redo_label;
-
- ADD_LABEL(ret, redo_label);
- COMPILE_(ret, "optblock body", node->nd_head, 1 /* pop */ );
- ADD_LABEL(ret, next_label);
- ADD_INSN(ret, 0, opt_checkenv);
- break;
- }
case NODE_PRELUDE:{
COMPILE_POPED(ret, "prelude", node->nd_head);
COMPILE_(ret, "body", node->nd_body, poped);
@@ -5022,7 +5195,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
/* compile same as lambda{...} */
VALUE block = NEW_CHILD_ISEQVAL(node->nd_body, make_name_for_block(iseq), ISEQ_TYPE_BLOCK, nd_line(node));
VALUE argc = INT2FIX(0);
- ADD_CALL_RECEIVER(ret, nd_line(node));
+ ADD_INSN1(ret, nd_line(node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
ADD_CALL_WITH_BLOCK(ret, nd_line(node), ID2SYM(idLambda), argc, block);
if (poped) {
@@ -5086,18 +5259,20 @@ insn_data_to_s_detail(INSN *iobj)
{
rb_iseq_t *iseq = (rb_iseq_t *)OPERAND_AT(iobj, j);
VALUE val = Qnil;
- if (iseq) {
+ if (0 && iseq) { /* TODO: invalidate now */
val = iseq->self;
}
rb_str_concat(str, rb_inspect(val));
}
break;
case TS_LINDEX:
- case TS_DINDEX:
case TS_NUM: /* ulong */
case TS_VALUE: /* VALUE */
- rb_str_concat(str, rb_inspect(OPERAND_AT(iobj, j)));
- break;
+ {
+ VALUE v = OPERAND_AT(iobj, j);
+ rb_str_concat(str, rb_inspect(v));
+ break;
+ }
case TS_ID: /* ID */
rb_str_concat(str, rb_inspect(OPERAND_AT(iobj, j)));
break;
@@ -5106,10 +5281,17 @@ insn_data_to_s_detail(INSN *iobj)
struct rb_global_entry *entry = (struct rb_global_entry *)
(OPERAND_AT(iobj, j) & (~1));
rb_str_cat2(str, rb_id2name(entry->id));
+ break;
}
- case TS_IC: /* method cache */
+ case TS_IC: /* inline cache */
rb_str_catf(str, "<ic:%d>", FIX2INT(OPERAND_AT(iobj, j)));
break;
+ case TS_CALLINFO: /* call info */
+ {
+ rb_call_info_t *ci = (rb_call_info_t *)OPERAND_AT(iobj, j);
+ rb_str_catf(str, "<callinfo:%s, %d>", ci->mid ? rb_id2name(ci->mid) : "", ci->orig_argc);
+ break;
+ }
case TS_CDHASH: /* case/when condition cache */
rb_str_cat2(str, "<ch>");
break;
@@ -5141,8 +5323,7 @@ dump_disasm_list(struct iseq_link_element *link)
{
iobj = (INSN *)link;
str = insn_data_to_s_detail(iobj);
- printf("%04d %-65s(%4d)\n", pos, StringValueCStr(str),
- insn_data_line_no(iobj));
+ printf("%04d %-65s(%4d)\n", pos, StringValueCStr(str), insn_data_line_no(iobj));
pos += insn_data_length(iobj);
break;
}
@@ -5172,6 +5353,12 @@ dump_disasm_list(struct iseq_link_element *link)
printf("---------------------\n");
}
+const char *
+rb_insns_name(int i)
+{
+ return insn_name_info[i];
+}
+
VALUE
rb_insns_name_array(void)
{
@@ -5260,6 +5447,8 @@ iseq_build_from_ary_exception(rb_iseq_t *iseq, struct st_table *labels_table,
lcont = register_label(iseq, labels_table, ptr[4]);
sp = NUM2INT(ptr[5]);
+ (void)sp;
+
ADD_CATCH_ENTRY(type, lstart, lend, eiseqval, lcont);
}
return COMPILE_OK;
@@ -5279,6 +5468,23 @@ insn_make_insn_table(void)
return table;
}
+static VALUE
+iseq_build_load_iseq(rb_iseq_t *iseq, VALUE op)
+{
+ VALUE iseqval;
+ if (RB_TYPE_P(op, T_ARRAY)) {
+ iseqval = rb_iseq_load(op, iseq->self, Qnil);
+ }
+ else if (CLASS_OF(op) == rb_cISeq) {
+ iseqval = op;
+ }
+ else {
+ rb_raise(rb_eSyntaxError, "ISEQ is required");
+ }
+ iseq_add_mark_object(iseq, iseqval);
+ return iseqval;
+}
+
static int
iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
VALUE body, struct st_table *labels_table)
@@ -5288,6 +5494,7 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
long i, len = RARRAY_LEN(body);
int j;
int line_no = 0;
+
/*
* index -> LABEL *label
*/
@@ -5307,7 +5514,7 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
else if (FIXNUM_P(obj)) {
line_no = NUM2INT(obj);
}
- else if (TYPE(obj) == T_ARRAY) {
+ else if (RB_TYPE_P(obj, T_ARRAY)) {
VALUE *argv = 0;
int argc = RARRAY_LENINT(obj) - 1;
st_data_t insn_id;
@@ -5317,12 +5524,12 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
if (st_lookup(insn_table, (st_data_t)insn, &insn_id) == 0) {
/* TODO: exception */
RB_GC_GUARD(insn) = rb_inspect(insn);
- rb_compile_error(RSTRING_PTR(iseq->filename), line_no,
+ rb_compile_error(RSTRING_PTR(iseq->location.path), line_no,
"unknown instruction: %s", RSTRING_PTR(insn));
}
if (argc != insn_len((VALUE)insn_id)-1) {
- rb_compile_error(RSTRING_PTR(iseq->filename), line_no,
+ rb_compile_error(RSTRING_PTR(iseq->location.path), line_no,
"operand size mismatch");
}
@@ -5337,7 +5544,6 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
break;
}
case TS_LINDEX:
- case TS_DINDEX:
case TS_NUM:
(void)NUM2INT(op);
argv[j] = op;
@@ -5349,16 +5555,7 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
case TS_ISEQ:
{
if (op != Qnil) {
- if (TYPE(op) == T_ARRAY) {
- argv[j] = rb_iseq_load(op, iseq->self, Qnil);
- }
- else if (CLASS_OF(op) == rb_cISeq) {
- argv[j] = op;
- }
- else {
- rb_raise(rb_eSyntaxError, "ISEQ is required");
- }
- iseq_add_mark_object(iseq, argv[j]);
+ argv[j] = iseq_build_load_iseq(iseq, op);
}
else {
argv[j] = 0;
@@ -5371,8 +5568,30 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
break;
case TS_IC:
argv[j] = op;
- if (NUM2INT(op) >= iseq->ic_size)
+ if (NUM2INT(op) >= iseq->ic_size) {
iseq->ic_size = NUM2INT(op) + 1;
+ }
+ break;
+ case TS_CALLINFO:
+ {
+ ID mid = 0;
+ int orig_argc = 0;
+ VALUE block = 0;
+ unsigned long flag = 0;
+
+ if (!NIL_P(op)) {
+ VALUE vmid = rb_hash_aref(op, ID2SYM(rb_intern("mid")));
+ VALUE vflag = rb_hash_aref(op, ID2SYM(rb_intern("flag")));
+ VALUE vorig_argc = rb_hash_aref(op, ID2SYM(rb_intern("orig_argc")));
+ VALUE vblock = rb_hash_aref(op, ID2SYM(rb_intern("block")));
+
+ if (!NIL_P(vmid)) mid = SYM2ID(vmid);
+ if (!NIL_P(vflag)) flag = NUM2ULONG(vflag);
+ if (!NIL_P(vorig_argc)) orig_argc = FIX2INT(vorig_argc);
+ if (!NIL_P(vblock)) block = iseq_build_load_iseq(iseq, vblock);
+ }
+ argv[j] = (VALUE)new_callinfo(iseq, mid, orig_argc, block, flag);
+ }
break;
case TS_ID:
argv[j] = rb_convert_type(op, T_SYMBOL,
diff --git a/complex.c b/complex.c
index a21249681f..2efe6a4676 100644
--- a/complex.c
+++ b/complex.c
@@ -1,5 +1,5 @@
/*
- complex.c: Coded by Tadayoshi Funaba 2008-2011
+ complex.c: Coded by Tadayoshi Funaba 2008-2012
This implementation is based on Keiju Ishitsuka's Complex library
which is written in ruby.
@@ -21,7 +21,8 @@ VALUE rb_cComplex;
static ID id_abs, id_abs2, id_arg, id_cmp, id_conj, id_convert,
id_denominator, id_divmod, id_eqeq_p, id_expt, id_fdiv, id_floor,
id_idiv, id_imag, id_inspect, id_negate, id_numerator, id_quo,
- id_real, id_real_p, id_to_f, id_to_i, id_to_r, id_to_s;
+ id_real, id_real_p, id_to_f, id_to_i, id_to_r, id_to_s,
+ id_i_real, id_i_imag;
#define f_boolcast(x) ((x) ? Qtrue : Qfalse)
@@ -121,7 +122,7 @@ f_mul(VALUE x, VALUE y)
if (FIXNUM_P(y)) {
long iy = FIX2LONG(y);
if (iy == 0) {
- if (FIXNUM_P(x) || TYPE(x) == T_BIGNUM)
+ if (FIXNUM_P(x) || RB_TYPE_P(x, T_BIGNUM))
return ZERO;
}
else if (iy == 1)
@@ -130,7 +131,7 @@ f_mul(VALUE x, VALUE y)
else if (FIXNUM_P(x)) {
long ix = FIX2LONG(x);
if (ix == 0) {
- if (FIXNUM_P(y) || TYPE(y) == T_BIGNUM)
+ if (FIXNUM_P(y) || RB_TYPE_P(y, T_BIGNUM))
return ZERO;
}
else if (ix == 1)
@@ -166,14 +167,14 @@ fun1(real_p)
inline static VALUE
f_to_i(VALUE x)
{
- if (TYPE(x) == T_STRING)
+ if (RB_TYPE_P(x, T_STRING))
return rb_str_to_inum(x, 10, 0);
return rb_funcall(x, id_to_i, 0);
}
inline static VALUE
f_to_f(VALUE x)
{
- if (TYPE(x) == T_STRING)
+ if (RB_TYPE_P(x, T_STRING))
return DBL2NUM(rb_str_to_dbl(x, 0));
return rb_funcall(x, id_to_f, 0);
}
@@ -312,8 +313,7 @@ k_complex_p(VALUE x)
inline static VALUE
nucomp_s_new_internal(VALUE klass, VALUE real, VALUE imag)
{
- NEWOBJ(obj, struct RComplex);
- OBJSETUP(obj, klass, T_COMPLEX);
+ NEWOBJ_OF(obj, struct RComplex, klass, T_COMPLEX);
obj->real = real;
obj->imag = imag;
@@ -439,6 +439,8 @@ nucomp_s_canonicalize_internal(VALUE klass, VALUE real, VALUE imag)
* Complex.rectangular(real[, imag]) -> complex
*
* Returns a complex object which denotes the given rectangular form.
+ *
+ * Complex.rectangular(1, 2) #=> (1+2i)
*/
static VALUE
nucomp_s_new(int argc, VALUE *argv, VALUE klass)
@@ -478,6 +480,9 @@ f_complex_new2(VALUE klass, VALUE x, VALUE y)
* Complex(x[, y]) -> numeric
*
* Returns x+i*y;
+ *
+ * Complex(1, 2) #=> (1+2i)
+ * Complex('1+2i') #=> (1+2i)
*/
static VALUE
nucomp_f_complex(int argc, VALUE *argv, VALUE klass)
@@ -587,10 +592,10 @@ f_complex_polar(VALUE klass, VALUE x, VALUE y)
*
* Returns a complex object which denotes the given polar form.
*
- * Complex.polar(3, 0) #=> (3.0+0.0i)
- * Complex.polar(3, Math::PI/2) #=> (1.836909530733566e-16+3.0i)
- * Complex.polar(3, Math::PI) #=> (-3.0+3.673819061467132e-16i)
- * Complex.polar(3, -Math::PI/2) #=> (1.836909530733566e-16-3.0i)
+ * Complex.polar(3, 0) #=> (3.0+0.0i)
+ * Complex.polar(3, Math::PI/2) #=> (1.836909530733566e-16+3.0i)
+ * Complex.polar(3, Math::PI) #=> (-3.0+3.673819061467132e-16i)
+ * Complex.polar(3, -Math::PI/2) #=> (1.836909530733566e-16-3.0i)
*/
static VALUE
nucomp_s_polar(int argc, VALUE *argv, VALUE klass)
@@ -615,6 +620,9 @@ nucomp_s_polar(int argc, VALUE *argv, VALUE klass)
* cmp.real -> real
*
* Returns the real part.
+ *
+ * Complex(7).real #=> 7
+ * Complex(9, -4).real #=> 9
*/
static VALUE
nucomp_real(VALUE self)
@@ -629,6 +637,9 @@ nucomp_real(VALUE self)
* cmp.imaginary -> real
*
* Returns the imaginary part.
+ *
+ * Complex(7).imaginary #=> 0
+ * Complex(9, -4).imaginary #=> -4
*/
static VALUE
nucomp_imag(VALUE self)
@@ -642,6 +653,8 @@ nucomp_imag(VALUE self)
* -cmp -> complex
*
* Returns negation of the value.
+ *
+ * -Complex(1, 2) #=> (-1-2i)
*/
static VALUE
nucomp_negate(VALUE self)
@@ -679,6 +692,12 @@ f_addsub(VALUE self, VALUE other,
* cmp + numeric -> complex
*
* Performs addition.
+ *
+ * Complex(2, 3) + Complex(2, 3) #=> (4+6i)
+ * Complex(900) + Complex(1) #=> (901+0i)
+ * Complex(-2, 9) + Complex(-9, 2) #=> (-11+11i)
+ * Complex(9, 8) + 4 #=> (13+8i)
+ * Complex(20, 9) + 9.8 #=> (29.8+9i)
*/
static VALUE
nucomp_add(VALUE self, VALUE other)
@@ -691,6 +710,12 @@ nucomp_add(VALUE self, VALUE other)
* cmp - numeric -> complex
*
* Performs subtraction.
+ *
+ * Complex(2, 3) - Complex(2, 3) #=> (0+0i)
+ * Complex(900) - Complex(1) #=> (899+0i)
+ * Complex(-2, 9) - Complex(-9, 2) #=> (7+7i)
+ * Complex(9, 8) - 4 #=> (5+8i)
+ * Complex(20, 9) - 9.8 #=> (10.2+9i)
*/
static VALUE
nucomp_sub(VALUE self, VALUE other)
@@ -703,6 +728,12 @@ nucomp_sub(VALUE self, VALUE other)
* cmp * numeric -> complex
*
* Performs multiplication.
+ *
+ * Complex(2, 3) * Complex(2, 3) #=> (-5+12i)
+ * Complex(900) * Complex(1) #=> (900+0i)
+ * Complex(-2, 9) * Complex(-9, 2) #=> (0-85i)
+ * Complex(9, 8) * 4 #=> (36+32i)
+ * Complex(20, 9) * 9.8 #=> (196.0+88.2i)
*/
static VALUE
nucomp_mul(VALUE self, VALUE other)
@@ -790,10 +821,11 @@ f_divide(VALUE self, VALUE other,
*
* Performs division.
*
- * For example:
- *
- * Complex(10.0) / 3 #=> (3.3333333333333335+(0/1)*i)
- * Complex(10) / 3 #=> ((10/3)+(0/1)*i) # not (3+0i)
+ * Complex(2, 3) / Complex(2, 3) #=> ((1/1)+(0/1)*i)
+ * Complex(900) / Complex(1) #=> ((900/1)+(0/1)*i)
+ * Complex(-2, 9) / Complex(-9, 2) #=> ((36/85)-(77/85)*i)
+ * Complex(9, 8) / 4 #=> ((9/4)+(2/1)*i)
+ * Complex(20, 9) / 9.8 #=> (2.0408163265306123+0.9183673469387754i)
*/
static VALUE
nucomp_div(VALUE self, VALUE other)
@@ -809,9 +841,7 @@ nucomp_div(VALUE self, VALUE other)
*
* Performs division as each part is a float, never returns a float.
*
- * For example:
- *
- * Complex(11,22).fdiv(3) #=> (3.6666666666666665+7.333333333333333i)
+ * Complex(11, 22).fdiv(3) #=> (3.6666666666666665+7.333333333333333i)
*/
static VALUE
nucomp_fdiv(VALUE self, VALUE other)
@@ -831,10 +861,8 @@ f_reciprocal(VALUE x)
*
* Performs exponentiation.
*
- * For example:
- *
- * Complex('i') ** 2 #=> (-1+0i)
- * Complex(-8) ** Rational(1,3) #=> (1.0000000000000002+1.7320508075688772i)
+ * Complex('i') ** 2 #=> (-1+0i)
+ * Complex(-8) ** Rational(1, 3) #=> (1.0000000000000002+1.7320508075688772i)
*/
static VALUE
nucomp_expt(VALUE self, VALUE other)
@@ -887,7 +915,7 @@ nucomp_expt(VALUE self, VALUE other)
if (r)
break;
- x = f_complex_new2(CLASS_OF(self),
+ x = nucomp_s_new_internal(CLASS_OF(self),
f_sub(f_mul(dat->real, dat->real),
f_mul(dat->imag, dat->imag)),
f_mul(f_mul(TWO, dat->real), dat->imag));
@@ -920,6 +948,12 @@ nucomp_expt(VALUE self, VALUE other)
* cmp == object -> true or false
*
* Returns true if cmp equals object numerically.
+ *
+ * Complex(2, 3) == Complex(2, 3) #=> true
+ * Complex(5) == 5 #=> true
+ * Complex(0) == 0.0 #=> true
+ * Complex('1/3') == 0.33 #=> false
+ * Complex('1/2') == '1/2' #=> false
*/
static VALUE
nucomp_eqeq_p(VALUE self, VALUE other)
@@ -944,7 +978,7 @@ nucomp_coerce(VALUE self, VALUE other)
{
if (k_numeric_p(other) && f_real_p(other))
return rb_assoc_new(f_complex_new_bang1(CLASS_OF(self), other), self);
- if (TYPE(other) == T_COMPLEX)
+ if (RB_TYPE_P(other, T_COMPLEX))
return rb_assoc_new(other, self);
rb_raise(rb_eTypeError, "%s can't be coerced into %s",
@@ -958,6 +992,9 @@ nucomp_coerce(VALUE self, VALUE other)
* cmp.magnitude -> real
*
* Returns the absolute part of its polar form.
+ *
+ * Complex(-1).abs #=> 1
+ * Complex(3.0, -4.0).abs #=> 5.0
*/
static VALUE
nucomp_abs(VALUE self)
@@ -984,6 +1021,9 @@ nucomp_abs(VALUE self)
* cmp.abs2 -> real
*
* Returns square of the absolute value.
+ *
+ * Complex(-1).abs2 #=> 1
+ * Complex(3.0, -4.0).abs2 #=> 25.0
*/
static VALUE
nucomp_abs2(VALUE self)
@@ -1001,8 +1041,7 @@ nucomp_abs2(VALUE self)
*
* Returns the angle part of its polar form.
*
- * Complex.polar(3, Math::PI/2).arg #=> 1.5707963267948966
- *
+ * Complex.polar(3, Math::PI/2).arg #=> 1.5707963267948966
*/
static VALUE
nucomp_arg(VALUE self)
@@ -1017,6 +1056,8 @@ nucomp_arg(VALUE self)
* cmp.rectangular -> array
*
* Returns an array; [cmp.real, cmp.imag].
+ *
+ * Complex(1, 2).rectangular #=> [1, 2]
*/
static VALUE
nucomp_rect(VALUE self)
@@ -1030,6 +1071,8 @@ nucomp_rect(VALUE self)
* cmp.polar -> array
*
* Returns an array; [cmp.abs, cmp.arg].
+ *
+ * Complex(1, 2).polar #=> [2.23606797749979, 1.1071487177940904]
*/
static VALUE
nucomp_polar(VALUE self)
@@ -1043,6 +1086,8 @@ nucomp_polar(VALUE self)
* cmp.conjugate -> complex
*
* Returns the complex conjugate.
+ *
+ * Complex(1, 2).conjugate #=> (1-2i)
*/
static VALUE
nucomp_conj(VALUE self)
@@ -1110,8 +1155,6 @@ nucomp_denominator(VALUE self)
*
* Returns the numerator.
*
- * For example:
- *
* 1 2 3+4i <- numerator
* - + -i -> ----
* 2 3 6 <- denominator
@@ -1173,8 +1216,9 @@ nucomp_eql_p(VALUE self, VALUE other)
inline static VALUE
f_signbit(VALUE x)
{
-#if defined(HAVE_SIGNBIT) && defined(__GNUC__) && defined(__sun__)
- extern int signbit(double x);
+#if defined(HAVE_SIGNBIT) && defined(__GNUC__) && defined(__sun) && \
+ !defined(signbit)
+ extern int signbit(double);
#endif
switch (TYPE(x)) {
case T_FLOAT: {
@@ -1216,6 +1260,12 @@ f_format(VALUE self, VALUE (*func)(VALUE))
* cmp.to_s -> string
*
* Returns the value as a string.
+ *
+ * Complex(2).to_s #=> "2+0i"
+ * Complex('-8/6').to_s #=> "-4/3+0i"
+ * Complex('1/2i').to_s #=> "0+1/2i"
+ * Complex(0, Float::INFINITY).to_s #=> "0+Infinity*i"
+ * Complex(Float::NAN, Float::NAN).to_s #=> "NaN+NaN*i"
*/
static VALUE
nucomp_to_s(VALUE self)
@@ -1228,6 +1278,12 @@ nucomp_to_s(VALUE self)
* cmp.inspect -> string
*
* Returns the value as a string for inspection.
+ *
+ * Complex(2).inspect #=> "(2+0i)"
+ * Complex('-8/6').inspect #=> "((-4/3)+0i)"
+ * Complex('1/2i').inspect #=> "(0+(1/2)*i)"
+ * Complex(0, Float::INFINITY).inspect #=> "(0+Infinity*i)"
+ * Complex(Float::NAN, Float::NAN).inspect #=> "(NaN+NaN*i)"
*/
static VALUE
nucomp_inspect(VALUE self)
@@ -1243,13 +1299,31 @@ nucomp_inspect(VALUE self)
/* :nodoc: */
static VALUE
+nucomp_dumper(VALUE self)
+{
+ return self;
+}
+
+/* :nodoc: */
+static VALUE
+nucomp_loader(VALUE self, VALUE a)
+{
+ get_dat1(self);
+
+ dat->real = rb_ivar_get(a, id_i_real);
+ dat->imag = rb_ivar_get(a, id_i_imag);
+
+ return self;
+}
+
+/* :nodoc: */
+static VALUE
nucomp_marshal_dump(VALUE self)
{
VALUE a;
get_dat1(self);
a = rb_assoc_new(dat->real, dat->imag);
- rb_copy_generic_ivar(a, self);
return a;
}
@@ -1257,11 +1331,11 @@ nucomp_marshal_dump(VALUE self)
static VALUE
nucomp_marshal_load(VALUE self, VALUE a)
{
- get_dat1(self);
Check_Type(a, T_ARRAY);
- dat->real = RARRAY_PTR(a)[0];
- dat->imag = RARRAY_PTR(a)[1];
- rb_copy_generic_ivar(self, a);
+ if (RARRAY_LEN(a) != 2)
+ rb_raise(rb_eArgError, "marshaled complex must have an array whose length is 2 but %ld", RARRAY_LEN(a));
+ rb_ivar_set(self, id_i_real, RARRAY_PTR(a)[0]);
+ rb_ivar_set(self, id_i_imag, RARRAY_PTR(a)[1]);
return self;
}
@@ -1300,7 +1374,12 @@ rb_Complex(VALUE x, VALUE y)
* call-seq:
* cmp.to_i -> integer
*
- * Returns the value as an integer if possible.
+ * Returns the value as an integer if possible (the imaginary part
+ * should be exactly zero).
+ *
+ * Complex(1, 0).to_i #=> 1
+ * Complex(1, 0.0).to_i # RangeError
+ * Complex(1, 2).to_i # RangeError
*/
static VALUE
nucomp_to_i(VALUE self)
@@ -1319,7 +1398,12 @@ nucomp_to_i(VALUE self)
* call-seq:
* cmp.to_f -> float
*
- * Returns the value as a float if possible.
+ * Returns the value as a float if possible (the imaginary part should
+ * be exactly zero).
+ *
+ * Complex(1, 0).to_f #=> 1.0
+ * Complex(1, 0.0).to_f # RangeError
+ * Complex(1, 2).to_f # RangeError
*/
static VALUE
nucomp_to_f(VALUE self)
@@ -1338,7 +1422,14 @@ nucomp_to_f(VALUE self)
* call-seq:
* cmp.to_r -> rational
*
- * Returns the value as a rational if possible.
+ * Returns the value as a rational if possible (the imaginary part
+ * should be exactly zero).
+ *
+ * Complex(1, 0).to_r #=> (1/1)
+ * Complex(1, 0.0).to_r # RangeError
+ * Complex(1, 2).to_r # RangeError
+ *
+ * See rationalize.
*/
static VALUE
nucomp_to_r(VALUE self)
@@ -1357,14 +1448,43 @@ nucomp_to_r(VALUE self)
* call-seq:
* cmp.rationalize([eps]) -> rational
*
- * Returns the value as a rational if possible. An optional argument
- * eps is always ignored.
+ * Returns the value as a rational if possible (the imaginary part
+ * should be exactly zero).
+ *
+ * Complex(1.0/3, 0).rationalize #=> (1/3)
+ * Complex(1, 0.0).rationalize # RangeError
+ * Complex(1, 2).rationalize # RangeError
+ *
+ * See to_r.
*/
static VALUE
nucomp_rationalize(int argc, VALUE *argv, VALUE self)
{
+ get_dat1(self);
+
rb_scan_args(argc, argv, "01", NULL);
- return nucomp_to_r(self);
+
+ if (k_inexact_p(dat->imag) || f_nonzero_p(dat->imag)) {
+ VALUE s = f_to_s(self);
+ rb_raise(rb_eRangeError, "can't convert %s into Rational",
+ StringValuePtr(s));
+ }
+ return rb_funcall2(dat->real, rb_intern("rationalize"), argc, argv);
+}
+
+/*
+ * call-seq:
+ * complex.to_c -> self
+ *
+ * Returns self.
+ *
+ * Complex(2).to_c #=> (2+0i)
+ * Complex(-8, 6).to_c #=> (-8+6i)
+ */
+static VALUE
+nucomp_to_c(VALUE self)
+{
+ return self;
}
/*
@@ -1391,159 +1511,298 @@ numeric_to_c(VALUE self)
return rb_complex_new1(self);
}
-static VALUE comp_pat0, comp_pat1, comp_pat2, a_slash, a_dot_and_an_e,
- null_string, underscores_pat, an_underscore;
+#include <ctype.h>
+
+inline static int
+issign(int c)
+{
+ return (c == '-' || c == '+');
+}
+
+static int
+read_sign(const char **s,
+ char **b)
+{
+ int sign = '?';
-#define WS "\\s*"
-#define DIGITS "(?:[0-9](?:_[0-9]|[0-9])*)"
-#define NUMERATOR "(?:" DIGITS "?\\.)?" DIGITS "(?:[eE][-+]?" DIGITS ")?"
-#define DENOMINATOR DIGITS
-#define NUMBER "[-+]?" NUMERATOR "(?:\\/" DENOMINATOR ")?"
-#define NUMBERNOS NUMERATOR "(?:\\/" DENOMINATOR ")?"
-#define PATTERN0 "\\A" WS "(" NUMBER ")@(" NUMBER ")" WS
-#define PATTERN1 "\\A" WS "([-+])?(" NUMBER ")?[iIjJ]" WS
-#define PATTERN2 "\\A" WS "(" NUMBER ")(([-+])(" NUMBERNOS ")?[iIjJ])?" WS
+ if (issign(**s)) {
+ sign = **b = **s;
+ (*s)++;
+ (*b)++;
+ }
+ return sign;
+}
-static void
-make_patterns(void)
+inline static int
+isdecimal(int c)
{
- static const char comp_pat0_source[] = PATTERN0;
- static const char comp_pat1_source[] = PATTERN1;
- static const char comp_pat2_source[] = PATTERN2;
- static const char underscores_pat_source[] = "_+";
+ return isdigit((unsigned char)c);
+}
- if (comp_pat0) return;
+static int
+read_digits(const char **s, int strict,
+ char **b)
+{
+ int us = 1;
- comp_pat0 = rb_reg_new(comp_pat0_source, sizeof comp_pat0_source - 1, 0);
- rb_gc_register_mark_object(comp_pat0);
+ if (!isdecimal(**s))
+ return 0;
+
+ while (isdecimal(**s) || **s == '_') {
+ if (**s == '_') {
+ if (strict) {
+ if (us)
+ return 0;
+ }
+ us = 1;
+ }
+ else {
+ **b = **s;
+ (*b)++;
+ us = 0;
+ }
+ (*s)++;
+ }
+ if (us)
+ do {
+ (*s)--;
+ } while (**s == '_');
+ return 1;
+}
- comp_pat1 = rb_reg_new(comp_pat1_source, sizeof comp_pat1_source - 1, 0);
- rb_gc_register_mark_object(comp_pat1);
+inline static int
+islettere(int c)
+{
+ return (c == 'e' || c == 'E');
+}
- comp_pat2 = rb_reg_new(comp_pat2_source, sizeof comp_pat2_source - 1, 0);
- rb_gc_register_mark_object(comp_pat2);
+static int
+read_num(const char **s, int strict,
+ char **b)
+{
+ if (**s != '.') {
+ if (!read_digits(s, strict, b))
+ return 0;
+ }
- a_slash = rb_usascii_str_new2("/");
- rb_gc_register_mark_object(a_slash);
+ if (**s == '.') {
+ **b = **s;
+ (*s)++;
+ (*b)++;
+ if (!read_digits(s, strict, b)) {
+ (*b)--;
+ return 0;
+ }
+ }
- a_dot_and_an_e = rb_usascii_str_new2(".eE");
- rb_gc_register_mark_object(a_dot_and_an_e);
+ if (islettere(**s)) {
+ **b = **s;
+ (*s)++;
+ (*b)++;
+ read_sign(s, b);
+ if (!read_digits(s, strict, b)) {
+ (*b)--;
+ return 0;
+ }
+ }
+ return 1;
+}
- null_string = rb_usascii_str_new2("");
- rb_gc_register_mark_object(null_string);
+inline static int
+read_den(const char **s, int strict,
+ char **b)
+{
+ if (!read_digits(s, strict, b))
+ return 0;
+ return 1;
+}
- underscores_pat = rb_reg_new(underscores_pat_source,
- sizeof underscores_pat_source - 1, 0);
- rb_gc_register_mark_object(underscores_pat);
+static int
+read_rat_nos(const char **s, int strict,
+ char **b)
+{
+ if (!read_num(s, strict, b))
+ return 0;
+ if (**s == '/') {
+ **b = **s;
+ (*s)++;
+ (*b)++;
+ if (!read_den(s, strict, b)) {
+ (*b)--;
+ return 0;
+ }
+ }
+ return 1;
+}
- an_underscore = rb_usascii_str_new2("_");
- rb_gc_register_mark_object(an_underscore);
+static int
+read_rat(const char **s, int strict,
+ char **b)
+{
+ read_sign(s, b);
+ if (!read_rat_nos(s, strict, b))
+ return 0;
+ return 1;
}
-#define id_match rb_intern("match")
-#define f_match(x,y) rb_funcall((x), id_match, 1, (y))
+inline static int
+isimagunit(int c)
+{
+ return (c == 'i' || c == 'I' ||
+ c == 'j' || c == 'J');
+}
-#define id_gsub_bang rb_intern("gsub!")
-#define f_gsub_bang(x,y,z) rb_funcall((x), id_gsub_bang, 2, (y), (z))
+VALUE rb_cstr_to_rat(const char *, int);
static VALUE
-string_to_c_internal(VALUE self)
+str2num(char *s)
{
- VALUE s;
+ if (strchr(s, '/'))
+ return rb_cstr_to_rat(s, 0);
+ if (strpbrk(s, ".eE"))
+ return DBL2NUM(rb_cstr_to_dbl(s, 0));
+ return rb_cstr_to_inum(s, 10, 0);
+}
- s = self;
+static int
+read_comp(const char **s, int strict,
+ VALUE *ret, char **b)
+{
+ char *bb;
+ int sign;
+ VALUE num, num2;
- if (RSTRING_LEN(s) == 0)
- return rb_assoc_new(Qnil, self);
+ bb = *b;
- {
- VALUE m, sr, si, re, r, i;
- int po;
-
- m = f_match(comp_pat0, s);
- if (!NIL_P(m)) {
- sr = rb_reg_nth_match(1, m);
- si = rb_reg_nth_match(2, m);
- re = rb_reg_match_post(m);
- po = 1;
- }
- if (NIL_P(m)) {
- m = f_match(comp_pat1, s);
- if (!NIL_P(m)) {
- sr = Qnil;
- si = rb_reg_nth_match(1, m);
- if (NIL_P(si))
- si = rb_usascii_str_new2("");
- {
- VALUE t;
-
- t = rb_reg_nth_match(2, m);
- if (NIL_P(t))
- t = rb_usascii_str_new2("1");
- rb_str_concat(si, t);
- }
- re = rb_reg_match_post(m);
- po = 0;
- }
+ sign = read_sign(s, b);
+
+ if (isimagunit(**s)) {
+ (*s)++;
+ num = INT2FIX((sign == '-') ? -1 : + 1);
+ *ret = rb_complex_new2(ZERO, num);
+ return 1; /* e.g. "i" */
+ }
+
+ if (!read_rat_nos(s, strict, b)) {
+ **b = '\0';
+ num = str2num(bb);
+ *ret = rb_complex_new2(num, ZERO);
+ return 0; /* e.g. "-" */
+ }
+ **b = '\0';
+ num = str2num(bb);
+
+ if (isimagunit(**s)) {
+ (*s)++;
+ *ret = rb_complex_new2(ZERO, num);
+ return 1; /* e.g. "3i" */
+ }
+
+ if (**s == '@') {
+ int st;
+
+ (*s)++;
+ bb = *b;
+ st = read_rat(s, strict, b);
+ **b = '\0';
+ if (strlen(bb) < 1 ||
+ !isdecimal(*(bb + strlen(bb) - 1))) {
+ *ret = rb_complex_new2(num, ZERO);
+ return 0; /* e.g. "1@-" */
}
- if (NIL_P(m)) {
- m = f_match(comp_pat2, s);
- if (NIL_P(m))
- return rb_assoc_new(Qnil, self);
- sr = rb_reg_nth_match(1, m);
- if (NIL_P(rb_reg_nth_match(2, m)))
- si = Qnil;
- else {
- VALUE t;
-
- si = rb_reg_nth_match(3, m);
- t = rb_reg_nth_match(4, m);
- if (NIL_P(t))
- t = rb_usascii_str_new2("1");
- rb_str_concat(si, t);
+ num2 = str2num(bb);
+ *ret = rb_complex_polar(num, num2);
+ if (!st)
+ return 0; /* e.g. "1@2." */
+ else
+ return 1; /* e.g. "1@2" */
+ }
+
+ if (issign(**s)) {
+ bb = *b;
+ sign = read_sign(s, b);
+ if (isimagunit(**s))
+ num2 = INT2FIX((sign == '-') ? -1 : + 1);
+ else {
+ if (!read_rat_nos(s, strict, b)) {
+ *ret = rb_complex_new2(num, ZERO);
+ return 0; /* e.g. "1+xi" */
}
- re = rb_reg_match_post(m);
- po = 0;
+ **b = '\0';
+ num2 = str2num(bb);
}
- r = INT2FIX(0);
- i = INT2FIX(0);
- if (!NIL_P(sr)) {
- if (strchr(RSTRING_PTR(sr), '/'))
- r = f_to_r(sr);
- else if (strpbrk(RSTRING_PTR(sr), ".eE"))
- r = f_to_f(sr);
- else
- r = f_to_i(sr);
+ if (!isimagunit(**s)) {
+ *ret = rb_complex_new2(num, ZERO);
+ return 0; /* e.g. "1+3x" */
}
- if (!NIL_P(si)) {
- if (strchr(RSTRING_PTR(si), '/'))
- i = f_to_r(si);
- else if (strpbrk(RSTRING_PTR(si), ".eE"))
- i = f_to_f(si);
- else
- i = f_to_i(si);
- }
- if (po)
- return rb_assoc_new(rb_complex_polar(r, i), re);
- else
- return rb_assoc_new(rb_complex_new2(r, i), re);
+ (*s)++;
+ *ret = rb_complex_new2(num, num2);
+ return 1; /* e.g. "1+2i" */
}
+ /* !(@, - or +) */
+ {
+ *ret = rb_complex_new2(num, ZERO);
+ return 1; /* e.g. "3" */
+ }
+}
+
+inline static void
+skip_ws(const char **s)
+{
+ while (isspace((unsigned char)**s))
+ (*s)++;
+}
+
+static int
+parse_comp(const char *s, int strict,
+ VALUE *num)
+{
+ char *buf, *b;
+
+ buf = ALLOCA_N(char, strlen(s) + 1);
+ b = buf;
+
+ skip_ws(&s);
+ if (!read_comp(&s, strict, num, &b))
+ return 0;
+ skip_ws(&s);
+
+ if (strict)
+ if (*s != '\0')
+ return 0;
+ return 1;
}
static VALUE
string_to_c_strict(VALUE self)
{
- VALUE a = string_to_c_internal(self);
- if (NIL_P(RARRAY_PTR(a)[0]) || RSTRING_LEN(RARRAY_PTR(a)[1]) > 0) {
- VALUE s = f_inspect(self);
+ char *s;
+ VALUE num;
+
+ rb_must_asciicompat(self);
+
+ s = RSTRING_PTR(self);
+
+ if (!s || memchr(s, '\0', RSTRING_LEN(self)))
+ rb_raise(rb_eArgError, "string contains null byte");
+
+ if (s && s[RSTRING_LEN(self)]) {
+ rb_str_modify(self);
+ s = RSTRING_PTR(self);
+ s[RSTRING_LEN(self)] = '\0';
+ }
+
+ if (!s)
+ s = (char *)"";
+
+ if (!parse_comp(s, 1, &num)) {
+ VALUE ins = f_inspect(self);
rb_raise(rb_eArgError, "invalid value for convert(): %s",
- StringValuePtr(s));
+ StringValuePtr(ins));
}
- return RARRAY_PTR(a)[0];
-}
-#define id_gsub rb_intern("gsub")
-#define f_gsub(x,y,z) rb_funcall((x), id_gsub, 2, (y), (z))
+ return num;
+}
/*
* call-seq:
@@ -1554,8 +1813,6 @@ string_to_c_strict(VALUE self)
* sequences can be separated by an underscore. Returns zero for null
* or garbage string.
*
- * For example:
- *
* '9'.to_c #=> (9+0i)
* '2.5'.to_c #=> (2.5+0i)
* '2.5/1'.to_c #=> ((5/2)+0i)
@@ -1571,19 +1828,25 @@ string_to_c_strict(VALUE self)
static VALUE
string_to_c(VALUE self)
{
- VALUE s, a, backref;
+ char *s;
+ VALUE num;
- backref = rb_backref_get();
- rb_match_busy(backref);
+ rb_must_asciicompat(self);
- s = f_gsub(self, underscores_pat, an_underscore);
- a = string_to_c_internal(s);
+ s = RSTRING_PTR(self);
- rb_backref_set(backref);
+ if (s && s[RSTRING_LEN(self)]) {
+ rb_str_modify(self);
+ s = RSTRING_PTR(self);
+ s[RSTRING_LEN(self)] = '\0';
+ }
- if (!NIL_P(RARRAY_PTR(a)[0]))
- return RARRAY_PTR(a)[0];
- return rb_complex_new1(INT2FIX(0));
+ if (!s)
+ s = (char *)"";
+
+ (void)parse_comp(s, 0, &num);
+
+ return num;
}
static VALUE
@@ -1817,6 +2080,7 @@ float_arg(VALUE self)
void
Init_Complex(void)
{
+ VALUE compat;
#undef rb_intern
#define rb_intern(str) rb_intern_const(str)
@@ -1846,6 +2110,8 @@ Init_Complex(void)
id_to_i = rb_intern("to_i");
id_to_r = rb_intern("to_r");
id_to_s = rb_intern("to_s");
+ id_i_real = rb_intern("@real");
+ id_i_imag = rb_intern("@image"); /* @image, not @imag */
rb_cComplex = rb_define_class("Complex", rb_cNumeric);
@@ -1934,8 +2200,10 @@ Init_Complex(void)
rb_define_method(rb_cComplex, "to_s", nucomp_to_s, 0);
rb_define_method(rb_cComplex, "inspect", nucomp_inspect, 0);
- rb_define_method(rb_cComplex, "marshal_dump", nucomp_marshal_dump, 0);
- rb_define_method(rb_cComplex, "marshal_load", nucomp_marshal_load, 1);
+ rb_define_private_method(rb_cComplex, "marshal_dump", nucomp_marshal_dump, 0);
+ compat = rb_define_class_under(rb_cComplex, "compatible", rb_cObject);
+ rb_define_private_method(compat, "marshal_load", nucomp_marshal_load, 1);
+ rb_marshal_define_compat(rb_cComplex, compat, nucomp_dumper, nucomp_loader);
/* --- */
@@ -1943,11 +2211,10 @@ Init_Complex(void)
rb_define_method(rb_cComplex, "to_f", nucomp_to_f, 0);
rb_define_method(rb_cComplex, "to_r", nucomp_to_r, 0);
rb_define_method(rb_cComplex, "rationalize", nucomp_rationalize, -1);
+ rb_define_method(rb_cComplex, "to_c", nucomp_to_c, 0);
rb_define_method(rb_cNilClass, "to_c", nilclass_to_c, 0);
rb_define_method(rb_cNumeric, "to_c", numeric_to_c, 0);
- make_patterns();
-
rb_define_method(rb_cString, "to_c", string_to_c, 0);
rb_define_private_method(CLASS_OF(rb_cComplex), "convert", nucomp_s_convert, -1);
@@ -1971,6 +2238,9 @@ Init_Complex(void)
rb_define_method(rb_cFloat, "angle", float_arg, 0);
rb_define_method(rb_cFloat, "phase", float_arg, 0);
+ /*
+ * The imaginary unit.
+ */
rb_define_const(rb_cComplex, "I",
f_complex_new_bang2(rb_cComplex, ZERO, ONE));
}
diff --git a/configure.in b/configure.in
index ec51a9b4c0..c916cd5834 100644
--- a/configure.in
+++ b/configure.in
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
-dnl {
AC_INIT()
+{
AC_CONFIG_AUX_DIR(tool)
AC_PREREQ(2.60)
@@ -9,7 +9,7 @@ AC_DEFUN([RUBY_PREREQ_AC],
[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]), [$1]), [-1],
AC_MSG_ERROR([Autoconf version ]$1[ or higher is required]$2))])
-dnl environment section {
+{ # environment section
AC_ARG_WITH(baseruby,
AS_HELP_STRING([--with-baseruby=RUBY], [use RUBY as baseruby; RUBY is the pathname of ruby]),
@@ -19,8 +19,13 @@ AC_ARG_WITH(baseruby,
[
BASERUBY="ruby"
])
-test "`RUBYOPT=- $BASERUBY -e 'p 42' 2>/dev/null`" = 42 ||
+if test "`RUBYOPT=- $BASERUBY -e 'p 42' 2>/dev/null`" = 42; then
+ if test "`RUBYOPT=- $BASERUBY --disable=gems -e 'p 42' 2>/dev/null`" = 42; then
+ BASERUBY="$BASERUBY --disable=gems"
+ fi
+else
BASERUBY="echo executable host ruby is required. use --with-baseruby option.; false"
+fi
AC_SUBST(BASERUBY)
AC_DEFUN([RUBY_MINGW32],
@@ -33,7 +38,10 @@ AC_CACHE_CHECK(for mingw32 environment, rb_cv_mingw32,
#endif
], rb_cv_mingw32=yes,rb_cv_mingw32=no)
rm -f conftest*])
-test "$rb_cv_mingw32" = yes && target_os="mingw32"
+if test "$rb_cv_mingw32" = yes; then
+ target_os="mingw32"
+ : ${ac_tool_prefix:="`expr "$CC" : ['\(.*-\)g\?cc[^/]*$']`"}
+fi
])
AS_CASE(["$target_os"], [mingw*msvc], [
target_os="`echo ${target_os} | sed 's/msvc$//'`"
@@ -43,12 +51,93 @@ target_cpu=x64
])
])
+AC_DEFUN([RUBY_NACL],
+[
+ AS_CASE(["${host_os}"],
+[nacl], [
+ ac_cv_exeext=.nexe
+ host_vendor=chromium
+ ac_cv_host=chromium
+ AC_MSG_CHECKING([wheather \$NACL_SDK_ROOT is set])
+ if test x"${NACL_SDK_ROOT}" = x; then
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([You need to set \$NACL_SDK_ROOT environment variable to build for NativeClient])
+ fi
+ AC_MSG_RESULT([yes])
+
+ nacl_cv_build_variant=glibc
+ AC_ARG_WITH(newlib,
+ AS_HELP_STRING([--with-newlib], [uses newlib version of NativeClient SDK]),
+ [AS_CASE([$withval],
+ [no], [nacl_cv_build_variant=glibc],
+ [yes], [nacl_cv_build_variant=newlib])])
+
+ AS_CASE(["$build_cpu"],
+ [x86_64|i?86], [nacl_cv_cpu_nick=x86], [nacl_cv_cpu_nick=$build_cpu])
+ AS_CASE(["$build_os"],
+ [linux*], [nacl_cv_os_nick=linux],
+ [darwin*], [nacl_cv_os_nick=mac],
+ [cygwin*|mingw*], [nacl_cv_os_nick=win],
+ [nacl_cv_os_nick=$build_os])
+
+ host="$host_cpu-chromium-$host_os-"
+ ac_tool_prefix="$host_cpu-nacl-"
+
+ AC_MSG_CHECKING([NativeClient toolchain])
+ if test -d \
+ "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_${nacl_cv_cpu_nick}_${nacl_cv_build_variant}"; then
+ NACL_TOOLCHAIN="${nacl_cv_os_nick}_${nacl_cv_cpu_nick}_${nacl_cv_build_variant}"
+ else
+ AS_CASE(
+ ["${nacl_cv_build_variant}"],
+ [glibc], [if test \
+ -d "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_${nacl_cv_cpu_nick}_newlib" \
+ -a -d "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_${nacl_cv_cpu_nick}"; then
+ NACL_TOOLCHAIN="${nacl_cv_os_nick}_${nacl_cv_cpu_nick}"
+ fi],
+ [newlib], [ NACL_TOOLCHAIN="${nacl_cv_os_nick}_${nacl_cv_cpu_nick}" ])
+ fi
+ if test ! -e "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/${ac_tool_prefix}gcc"; then
+ if test "${build_cpu}" = i686 -a -e "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/nacl-gcc"; then
+ ac_tool_prefix=nacl-
+ fi
+ if test "${build_cpu}" = x86_64 -a -e "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/nacl-gcc"; then
+ ac_tool_prefix=nacl64-
+ fi
+ fi
+ if test -z "${NACL_TOOLCHAIN}"; then
+ AC_MSG_ERROR([Unrecognized --host and --build combination or NaCl SDK is not installed])
+ fi
+ AC_MSG_RESULT(${NACL_TOOLCHAIN})
+
+ AC_MSG_CHECKING([path to SDK])
+ if ! echo -- "${PATH}" | grep -F "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/bin" > /dev/null; then
+ PATH="${PATH}:${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/bin"
+ fi
+
+ AC_SUBST(NACL_TOOLCHAIN)
+ AC_SUBST(NACL_SDK_ROOT)
+ AC_SUBST(NACL_SDK_VARIANT, nacl_cv_build_variant)
+])])
+
+AC_DEFUN([RUBY_NACL_CHECK_PEPPER_TYPES],
+[AS_CASE(["${host_os}"],
+[nacl], [
+ AC_CHECK_TYPES([struct PPB_Core, struct PPB_Messaging, struct PPB_Var,
+ struct PPB_URLLoader, struct PPB_URLRequestInfo,
+ struct PPB_URLResponseInfo, struct PPB_FileRef,
+ struct PPP_Instance])
+])
+])
+
AC_DEFUN([RUBY_CPPOUTFILE],
[AC_CACHE_CHECK(whether ${CPP} accepts -o, rb_cv_cppoutfile,
-[cppflags=$CPPFLAGS
-CPPFLAGS='-o conftest.i'
-AC_TRY_CPP([], rb_cv_cppoutfile=yes, rb_cv_cppoutfile=no)
-CPPFLAGS=$cppflags
+[save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS='-o conftest-1.i'
+rb_cv_cppoutfile=no
+AC_TRY_CPP([test-for-cppout],
+ [grep test-for-cppout conftest-1.i > /dev/null && rb_cv_cppoutfile=yes])
+CPPFLAGS="$save_CPPFLAGS"
rm -f conftest*])
if test "$rb_cv_cppoutfile" = yes; then
CPPOUTFILE='-o conftest.i'
@@ -83,39 +172,30 @@ RUBY_PROGRAM_VERSION=`sed -n 's/^#define RUBY_VERSION "\(.*\)"/\1/p' $srcdir/ver
AC_SUBST(RUBY_PROGRAM_VERSION)
RUBY_RELEASE_DATE=`sed -n 's/^#define RUBY_RELEASE_DATE "\(.*\)"/\1/p' $srcdir/version.h`
AC_SUBST(RUBY_RELEASE_DATE)
-if test "$MAJOR" = "1"; then
- AC_DEFINE(CANONICALIZATION_FOR_MATHN)
-fi
-
-AC_CANONICAL_TARGET
-target_os=`echo $target_os | sed 's/linux-gnu$/linux/;s/linux-gnu/linux-/'`
-ac_install_sh='' # unusable for extension libraries.
-
+AC_DEFINE(CANONICALIZATION_FOR_MATHN)
dnl checks for alternative programs
+AC_CANONICAL_BUILD
AC_ARG_WITH(gcc,
AS_HELP_STRING([--without-gcc], [never use gcc]),
[
AS_CASE([$withval],
[no], [: ${CC=cc}],
[yes], [: ${CC=gcc}],
- [CC=$withval])
- AS_CASE([$withval], [no|yes],
- [with_gcc_specified=no],
- [with_gcc_specified=yes])])
-AS_CASE(["$target_os"], [darwin11.*],
- [if test -z "$CC"; then
- CC=gcc-4.2
- else
- if test "x$with_gcc_specified" = "xno" && $CC -v 2>&1 | grep -i LLVM > /dev/null; then
- CC=gcc-4.2
- fi
- fi])
+ [CC=$withval])])
dnl If the user switches compilers, we can't believe the cache
if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
then
AC_MSG_ERROR(cached CC is different -- throw away $cache_file
(it is also a good idea to do 'make clean' before compiling))
fi
+AS_CASE(["$build_os"],
+ [darwin11.*], [
+ AS_CASE(["x$CC"],
+ [xgcc-4.2|x/usr/bin/gcc-4.2], [: ${CXX=g++-4.2}],
+ [xgcc|x/usr/bin/gcc], [: ${CXX=g++}],
+ [xcc|x/usr/bin/cc], [: ${CXX=c++}],
+ [xclang|x/usr/bin/clang], [: ${CXX=clang++}])
+ ])
test -z "$CC" || ac_cv_prog_CC="$CC"
if test "$program_prefix" = NONE; then
@@ -126,6 +206,10 @@ RUBYW_BASE_NAME=`echo rubyw | sed "$program_transform_name"`
AC_SUBST(RUBY_BASE_NAME)
AC_SUBST(RUBYW_BASE_NAME)
+AC_CANONICAL_TARGET
+target_os=`echo $target_os | sed 's/linux-gnu$/linux/;s/linux-gnu/linux-/'`
+ac_install_sh='' # unusable for extension libraries.
+
AC_DEFUN([RUBY_APPEND_OPTION],
[# RUBY_APPEND_OPTION($1, $2)
AS_CASE([" [$]{$1-} "],
@@ -147,7 +231,7 @@ AC_DEFUN([RUBY_PREPEND_OPTIONS],
$1="[$]{rb_opts}[$]$1"; }])
AC_ARG_WITH(arch,
- AS_HELP_STRING([--with-arch=ARCHS],
+ AS_HELP_STRING([--with-arch=ARCHS],
[build an Apple/NeXT Multi Architecture Binary (MAB);
ARCHS is a comma-delimited list of architectures for
which to build; if this option is disabled or omitted
@@ -280,22 +364,31 @@ if test -z "${CXXFLAGS+set}"; then
cxxflags="$cxxflags "'${optflags} ${debugflags} ${warnflags}'
fi
+RUBY_NACL
+AS_CASE(["$host_os:$build_os"],
+[darwin*:darwin*], [
+ AC_CHECK_TOOLS(CC, [gcc-4.2 clang gcc cc])
+])
if test x"${build}" != x"${host}"; then
AC_CHECK_TOOL(CC, gcc)
fi
+
AC_PROG_CC
AC_PROG_CXX
+RUBY_MINGW32
AC_PROG_GCC_TRADITIONAL
AC_SUBST(GCC)
+AS_CASE(["$target_os"],
+[solaris*], [AC_PATH_TOOL([LD], [ld], [/usr/ccs/bin/ld], [/usr/ccs/bin:$PATH])],
+[AC_CHECK_TOOL([LD], [ld], [ld])])
+AC_SUBST(LD)
if test "$GCC" = yes; then
linker_flag=-Wl,
: ${optflags=-O3}
- AS_CASE(["$target_os"], [linux*|darwin*], [: ${debugflags=-ggdb}])
RUBY_APPEND_OPTIONS(XCFLAGS, ["-include ruby/config.h" "-include ruby/missing.h"])
else
linker_flag=
fi
-test $ac_cv_prog_cc_g = yes && : ${debugflags=-g}
RUBY_PROG_GNU_LD
RUBY_CPPOUTFILE
@@ -305,7 +398,6 @@ RUBY_CPPOUTFILE
AC_SUBST(OUTFLAG)
AC_SUBST(COUTFLAG)
-RUBY_MINGW32
RUBY_UNIVERSAL_ARCH
if test "$target_cpu" != "$host_cpu" -a "$GCC" = yes -a "$cross_compiling" = no -a "$universal_binary" = no; then
RUBY_DEFAULT_ARCH("$target_cpu")
@@ -347,6 +439,9 @@ AS_CASE(["$target_os"],
sed -n '/^[[ ]]*dll name: \(msvc.*\)\.dll$/{s//\1/p;q;}'`],
[rb_cv_msvcrt=msvcrt])
test "$rb_cv_msvcrt" = "" && rb_cv_msvcrt=msvcrt])
+ RT_VER=`echo "$rb_cv_msvcrt" | tr -cd [0-9]`
+ test "$RT_VER" = "" && RT_VER=60
+ AC_DEFINE_UNQUOTED(RUBY_MSVCRT_VERSION, $RT_VER)
])
: ${enable_shared=yes}
],
@@ -369,11 +464,48 @@ fi
MAKEDIRS="$MKDIR_P"
AC_SUBST(MAKEDIRS)
-AC_CHECK_PROG(DOT, dot)
-AC_CHECK_PROG(DOXYGEN, doxygen)
+AC_DEFUN([RUBY_DTRACE_AVAILABLE],
+[AC_CACHE_CHECK(whether dtrace USDT is available, rb_cv_dtrace_available,
+[
+ echo "provider conftest{ probe fire(); };" > conftest_provider.d
+ if $DTRACE -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null; then
+ # DTrace is available on the system
+ rb_cv_dtrace_available=yes
+ else
+ # DTrace is not available while dtrace command exists
+ # for example FreeBSD 8 or FreeBSD 9 without DTrace build option
+ rb_cv_dtrace_available=no
+ fi
+ rm -f conftest.[co] conftest_provider.[dho]
+])
+])
+
+AC_DEFUN([RUBY_DTRACE_POSTPROCESS],
+[AC_CACHE_CHECK(whether $DTRACE needs post processing, rb_cv_prog_dtrace_g,
+[
+ echo "int main(void){ return 0; }" > conftest.c
+ echo "provider conftest{};" > conftest_provider.d
+ $CC $CFLAGS -c -o conftest.o conftest.c
+ if $DTRACE -G -s conftest_provider.d conftest.o 2>/dev/null; then
+ rb_cv_prog_dtrace_g=yes
+ else
+ rb_cv_prog_dtrace_g=no
+ fi
+ rm -f conftest.o conftest.c conftest_provider.d conftest_provider.o
+])
+])
+
+AC_CHECK_PROG([DTRACE], [${ac_tool_prefix}dtrace], [${ac_tool_prefix}dtrace])
+if test "$cross_compiling:$ac_cv_prog_DTRACE" = no: -a -n "$ac_tool_prefix"; then
+ AC_CHECK_PROG([DTRACE], [dtrace], [dtrace])
+fi
+
+AC_CHECK_PROGS(DOT, dot)
+AC_CHECK_PROGS(DOXYGEN, doxygen)
+AS_CASE(["${host_os}"], [nacl], [AC_PATH_PROG(PYTHON, python)])
-AC_CHECK_PROG(PKG_CONFIG, pkg-config, [], [], [],
- [`$as_dir/$ac_word$ac_exec_ext --print-errors --version > /dev/null 2>&1 || continue`])
+AC_CHECK_PROG(PKG_CONFIG, pkg-config, [pkg-config], [], [],
+ [`"$as_dir/$ac_word$ac_exec_ext" --print-errors --version > /dev/null 2>&1 || echo "$as_dir/$ac_word$ac_exec_ext"`])
# checks for UNIX variants that set C preprocessor variables
AC_USE_SYSTEM_EXTENSIONS
@@ -400,7 +532,7 @@ $as_ln_s ../build . > /dev/null 2>&1 && cd build &&
for chdir in 'cd -P' 'PWD= cd'; do
/bin/sh -c "$chdir ../src && echo '$chdir' > cdcmd" 2> /dev/null && break
done)
-if test -e conf$$.dir/src/cdcmd; then
+if test -f conf$$.dir/src/cdcmd; then
read CHDIR < conf$$.dir/src/cdcmd 2> /dev/null
else
CHDIR=cd
@@ -409,10 +541,12 @@ rm -fr conf$$.dir
AC_MSG_RESULT([$CHDIR])
AC_SUBST(CHDIR)
-dnl }
-dnl compiler section {
+}
+{ # compiler section
AC_DEFUN([RUBY_WERROR_FLAG], [dnl
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $rb_cv_warnflags"
if test "${ac_c_werror_flag+set}"; then
rb_c_werror_flag="$ac_c_werror_flag"
else
@@ -420,6 +554,8 @@ else
fi
ac_c_werror_flag=yes
$1
+CFLAGS="$save_CFLAGS"
+save_CFLAGS=
if test "${rb_c_werror_flag+set}"; then
ac_c_werror_flag="$rb_c_werror_flag"
else
@@ -427,24 +563,21 @@ else
fi])
AC_DEFUN(RUBY_TRY_CFLAGS, [
- save_CFLAGS="$CFLAGS"
- CFLAGS="[$]CFLAGS $1"
- AC_MSG_CHECKING([whether ]$1[ is accepted])
+ AC_MSG_CHECKING([whether ]$1[ is accepted as CFLAGS])
RUBY_WERROR_FLAG([
+ CFLAGS="[$]CFLAGS $1"
AC_TRY_COMPILE([$4], [$5],
[$2
AC_MSG_RESULT(yes)],
[$3
AC_MSG_RESULT(no)])
])
- CFLAGS="$save_CFLAGS"
- save_CFLAGS=
])
AC_DEFUN(RUBY_TRY_LDFLAGS, [
save_LDFLAGS="$LDFLAGS"
LDFLAGS="[$]LDFLAGS $1"
- AC_MSG_CHECKING([whether $1 is accepted])
+ AC_MSG_CHECKING([whether $1 is accepted as LDFLAGS])
RUBY_WERROR_FLAG([
AC_TRY_LINK([$4], [$5],
[$2
@@ -461,6 +594,7 @@ if test "$GCC:${warnflags+set}:no" = yes::no; then
particular_werror_flags=yes
for wflag in -Wno-unused-parameter -Wno-parentheses -Wno-long-long \
-Wno-missing-field-initializers \
+ -Wunused-variable \
-Werror=pointer-arith \
-Werror=write-strings \
-Werror=declaration-after-statement \
@@ -473,27 +607,91 @@ if test "$GCC:${warnflags+set}:no" = yes::no; then
wflag=`echo x$wflag | sed 's/^x-Werror=/-W/;s/^x//'`
fi
ok=no
- RUBY_TRY_CFLAGS($wflag, [warnflags="${warnflags+$warnflags }$wflag" ok=yes])
+ RUBY_TRY_CFLAGS($wflag, [
+ RUBY_APPEND_OPTIONS(warnflags, $wflag)
+ ok=yes
+ ])
AS_CASE([$ok:$wflag], [no:-Werror=*], [
wflag=`echo x$wflag | sed 's/^x-Werror=/-W/'`
RUBY_TRY_CFLAGS($wflag, [
- warnflags="${warnflags+$warnflags }$wflag"
+ RUBY_APPEND_OPTIONS(warnflags, $wflag)
particular_werror_flags=no
])
])
done
- AS_CASE([" $warnflags "],[*" -Wno-missing-field-initializers "*], [wflag=-Wextra],
+ AS_CASE([" $warnflags "],[*" -Wno-missing-field-initializers "*], [wflag="-Wall -Wextra"],
[wflag=-Wall])
RUBY_TRY_CFLAGS($wflag, [warnflags="$wflag${warnflags+ $warnflags}"])
# Disable warnflags while conftest. -Werror=* flags might make bad OS capability guess.
rb_cv_warnflags="$warnflags"
warnflags=
fi
+if test "$GCC" = yes; then
+ test "${debugflags+set}" || {RUBY_TRY_CFLAGS(-ggdb3, [debugflags=-ggdb3])}
+ test "${debugflags+set}" || {RUBY_TRY_CFLAGS(-ggdb, [debugflags=-ggdb])}
+ test "${debugflags+set}" || {RUBY_TRY_CFLAGS(-g3, [debugflags=-g3])}
+
+ # -D_FORTIFY_SOURCE
+ RUBY_TRY_CFLAGS(-D_FORTIFY_SOURCE=2, [RUBY_APPEND_OPTION(XCFLAGS, -D_FORTIFY_SOURCE=2)])
+
+ # -fstack-protector
+ AS_CASE(["$target_os"],
+ [mingw*|nacl|haiku], [
+ stack_protector=no
+ ],
+ [
+ RUBY_TRY_CFLAGS(-fstack-protector, [stack_protector=yes], [stack_protector=no])
+ if test "x$stack_protector" = xyes; then
+ RUBY_TRY_LDFLAGS(-fstack-protector, [], [stack_protector=broken])
+ fi
+ ])
+ if test "x$stack_protector" = xyes; then
+ RUBY_APPEND_OPTION(XCFLAGS, -fstack-protector)
+ RUBY_APPEND_OPTION(XLDFLAGS, -fstack-protector)
+ RUBY_APPEND_OPTION(LDFLAGS, -fstack-protector)
+ fi
+
+ AS_CASE(["$target_os"],[mingw*], [
+ # On Windows platforms, system provided headers are VC++
+ # optimized. That is, C++ habits are often contaminated into
+ # various headers. Most frequent situation is the use of //
+ # comments. We bypass ANSI C mode for them. Otherwise
+ # extension libs cannot include those headers.
+ ],
+ [cygwin*|darwin*|netbsd*], [
+ # need lgamma_r(), finite()
+ ],
+ [haiku], [
+ # Haiku R1/alpha3 uses gcc-4.4.4 which can not handle anonymous union
+ # with ANSI standard flags. Anonumous union is required to compile
+ # socket extension where <net/if.h> uses anonymous union.
+ ],
+ [
+ # ANSI (no XCFLAGS because this is C only)
+ RUBY_TRY_CFLAGS(-ansi -std=iso9899:199409, [
+ RUBY_APPEND_OPTION(warnflags, -ansi -std=iso9899:199409)
+ RUBY_APPEND_OPTION(strict_warnflags, -ansi -std=iso9899:199409)
+ ])
+ ])
+
+ # suppress annoying -Wstrict-overflow warnings
+ RUBY_TRY_CFLAGS(-fno-strict-overflow, [RUBY_APPEND_OPTION(XCFLAGS, -fno-strict-overflow)])
+fi
+test $ac_cv_prog_cc_g = yes && : ${debugflags=-g}
+
if test "$GCC" = ""; then
- AS_CASE(["$target_os"],[aix*],[warnflags="-qinfo=por"])
+ AS_CASE(["$target_os"],[aix*],[warnflags="$warnflags -qinfo=por" rb_cv_warnflags="$rb_cv_warnflags -qinfo=por"])
fi
if test "$GCC" = yes; then
- RUBY_TRY_CFLAGS(-fvisibility=hidden, [RUBY_APPEND_OPTION(XCFLAGS, -fvisibility=hidden)])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+ @%:@if !(defined __GNUC__ && __GNUC__ >= 4)
+ @%:@error not GCC 4 or later
+ >>>not GCC 4 or later<<<
+ @%:@endif])],
+ [visibility_option=yes], [visibility_option=no])
+ if test "$visibility_option" = yes; then
+ RUBY_TRY_CFLAGS(-fvisibility=hidden, [visibility_option=yes], [visibility_option=no])
+ fi
AC_SUBST(WERRORFLAG, "-Werror")
if test "$visibility_option" = yes; then
RUBY_APPEND_OPTION(XCFLAGS, -fvisibility=hidden)
@@ -503,6 +701,19 @@ if test "$GCC" = yes; then
test "$visibility_option" = no || OBJCOPY=:
fi
+if test "$GCC" = yes; then
+ # optflags
+
+ AS_CASE(["$target_os"], [mingw*], [
+ RUBY_TRY_CFLAGS(-fno-omit-frame-pointer, [optflags="${optflags+$optflags }-fno-omit-frame-pointer"])
+ ])
+
+ # disable fast-math
+ for oflag in -fno-fast-math; do
+ RUBY_TRY_CFLAGS($oflag, [RUBY_APPEND_OPTION(optflags, $oflag)])
+ done
+fi
+
test -z "${ac_env_CFLAGS_set}" -a -n "${cflags+set}" && eval CFLAGS="\"$cflags $ARCH_FLAG\""
test -z "${ac_env_CXXFLAGS_set}" -a -n "${cxxflags+set}" && eval CXXFLAGS="\"$cxxflags $ARCH_FLAG\""
@@ -573,11 +784,8 @@ static ac__type_sizeof_ *rbcv_ptr;
done
done
}])
- m4_ifval([$2][$3], [case "${AS_TR_SH(ac_cv_sizeof_$1)}" in
- #(
- [SIZEOF_*]);;
- #(
- *)])
+ m4_ifval([$2][$3],
+ [test "${AS_TR_SH(ac_cv_sizeof_$1)@%:@SIZEOF_}" = "${AS_TR_SH(ac_cv_sizeof_$1)}" && ]){
test "$universal_binary" = yes && cross_compiling=yes
AC_COMPUTE_INT([t], AS_TR_CPP(SIZEOF_$1), [AC_INCLUDES_DEFAULT([$4])]
[${cond+$cond
@@ -591,7 +799,7 @@ ${cond+@%:@endif}
if test ${t-0} != 0; then
AS_TR_SH(ac_cv_sizeof_$1)="${AS_TR_SH(ac_cv_sizeof_$1)+${AS_TR_SH(ac_cv_sizeof_$1)-} }${t}"
fi
- m4_ifval([$2][$3], [;; esac])
+ }
: ${AS_TR_SH(ac_cv_sizeof_$1)=0}
])
{
@@ -721,12 +929,12 @@ if test "$rb_cv_have_prototypes" = yes; then
fi
AC_CACHE_CHECK(token paste string, rb_cv_tokenpaste,
- [AC_TRY_COMPILE([#define paste(a,b) a##b],
+ [AC_TRY_COMPILE([@%:@define paste(a,b) a@%:@@%:@b],
[int xy = 1; return paste(x,y);],
rb_cv_tokenpaste=ansi,
rb_cv_tokenpaste=knr)])
if test "$rb_cv_tokenpaste" = ansi; then
- AC_DEFINE(TOKEN_PASTE(x,y),[x##y])
+ AC_DEFINE(TOKEN_PASTE(x,y),[x@%:@@%:@y])
else
AC_DEFINE(TOKEN_PASTE(x,y),[x/**/y])
fi
@@ -796,12 +1004,12 @@ if test "$rb_cv_va_args_macro" = yes; then
fi
AC_DEFUN([RUBY_DEFINE_IF], [dnl
- m4_ifval([$1],[test "$1" && cat <<EOH >> confdefs.h
+ m4_ifval([$1], [AS_LITERAL_IF([$1], [], [test "X$1" = X || ])cat <<EOH >> confdefs.h
@%:@if $1
EOH
])dnl
-AC_DEFINE_UNQUOTED($2, $3)
- m4_ifval([$1],[test "$1" && cat <<EOH >> confdefs.h
+AC_DEFINE_UNQUOTED($2, $3)dnl
+ m4_ifval([$1], [AS_LITERAL_IF([$1], [], [test "X$1" = X || ])cat <<EOH >> confdefs.h
@%:@endif /* $1 */
EOH
])dnl
@@ -817,7 +1025,7 @@ m4_ifval([$3], dnl
[AS_VAR_PUSHDEF([rbcv],[$3])], dnl
[AS_VAR_PUSHDEF([rbcv],[rb_cv_func_][$1])]dnl
)dnl
-m4_ifval([$4], [rbcv_cond=[$4]; test "$rbcv_cond" || unset rbcv_cond])
+m4_ifval([$4], [rbcv_cond=["$4"]; test "$rbcv_cond" || unset rbcv_cond])
AC_CACHE_CHECK(for [$1] function attribute, rbcv,
[rbcv=x
RUBY_WERROR_FLAG([
@@ -834,10 +1042,11 @@ ${rbcv_cond+[@%:@endif]})
done
])])
if test "$rbcv" != x; then
- RUBY_DEFINE_IF([${rbcv_cond}], attrib[(x)], $rbcv)
+ RUBY_DEFINE_IF(m4_ifval([$4],[${rbcv_cond}]), attrib[(x)], $rbcv)
fi
-AS_VAR_POPDEF([attrib])
-AS_VAR_POPDEF([rbcv])
+m4_ifval([$4], [unset rbcv_cond])dnl
+AS_VAR_POPDEF([attrib])dnl
+AS_VAR_POPDEF([rbcv])dnl
])
RUBY_FUNC_ATTRIBUTE(noreturn, NORETURN)
@@ -876,6 +1085,18 @@ if test "$GCC" = yes; then
if test "$rb_cv_gcc_atomic_builtins" = yes; then
AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS)
fi
+
+ AC_CACHE_CHECK(for __builtin_unreachable, rb_cv_func___builtin_unreachable,
+ [RUBY_WERROR_FLAG(
+ [AC_TRY_LINK([@%:@include <stdlib.h>],
+ [exit(0); __builtin_unreachable();],
+ [rb_cv_func___builtin_unreachable=yes],
+ [rb_cv_func___builtin_unreachable=no])
+ ])
+ ])
+ if test "$rb_cv_func___builtin_unreachable" = yes; then
+ AC_DEFINE_UNQUOTED(UNREACHABLE, [__builtin_unreachable()])
+ fi
fi
AC_CACHE_CHECK(for exported function attribute, rb_cv_func_exported, [
@@ -893,16 +1114,20 @@ fi
RUBY_APPEND_OPTION(XCFLAGS, -DRUBY_EXPORT)
-dnl }
-dnl header and library section {
+}
+{ # header and library section
dnl Check whether we need to define sys_nerr locally
AC_CHECK_DECLS([sys_nerr], [], [], [$ac_includes_default
-#include <errno.h>])
+@%:@include <errno.h>])
-AC_ARG_ENABLE(win95,
- AS_HELP_STRING([--enable-win95], [enable Windows 95 series support]),
- [AS_CASE(["$enableval"],[yes|no],[enable_win95=$enableval],[unset enable_win95])])
+AC_ARG_WITH(winnt-ver,
+ AS_HELP_STRING([--with-winnt-ver=0xXXXX], [target Windows NT version (default to 0x0501)]),
+ [with_winnt_ver="$withval"], [with_winnt_ver="0x0501"])
+AS_CASE(["$target_os"],
+[mingw*], [
+ RUBY_APPEND_OPTION(CPPFLAGS, -D_WIN32_WINNT=$with_winnt_ver)
+])
AS_CASE(["$target_os"],
[freebsd*], [
@@ -931,16 +1156,14 @@ AC_ARG_ENABLE(pthread,
dnl Checks for libraries.
AS_CASE(["$target_os"],[*bsd*|dragonfly*],[],[ac_cv_func_daemon=no])
+POSTLINK=:
+AC_SUBST(POSTLINK)
AS_CASE(["$target_os"],
-[solaris*], [
- AC_DEFINE(SIZEOF_STRUCT_DIRENT_TOO_SMALL, 1)
- LIBS="-lm $LIBS"
- ],
[nextstep*], [ ],
[openstep*], [ ],
[rhapsody*], [ ],
[darwin*], [ RUBY_PREPEND_OPTION(LIBS, -lobjc)
- RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE)
+ RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT)
AC_MSG_CHECKING(whether Mac OS X 10.5 or later)
AC_TRY_CPP([#include <AvailabilityMacros.h>
#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1040
@@ -991,48 +1214,13 @@ main()
if test "$rb_cv_broken_crypt" = yes; then
AC_DEFINE(BROKEN_CRYPT, 1)
fi
+ if test "${RUBY_CODESIGN:+set}"; then
+ AC_CHECK_PROGS(codesign, codesign)
+ POSTLINK="$ac_cv_prog_codesign -s '$RUBY_CODESIGN' -f \$@"
+ fi
],
[hpux*], [ LIBS="-lm $LIBS"
ac_cv_c_inline=no],
-[human*], [ ac_cv_func_getpgrp_void=yes
- ac_cv_func_setitimer=no
- AC_CHECK_LIB(signal, _harderr)
- AC_CHECK_LIB(hmem, hmemset)
- AC_CHECK_FUNCS(select)
- AC_CACHE_CHECK(whether PD libc _dtos18 fail to convert big number,
- rb_cv_missing__dtos18,
- [AC_TRY_RUN([
-#include <stdio.h>
-int
-main()
-{
- char buf[256];
- sprintf(buf, "%g", 1e+300);
- return (strcmp (buf, "1e+300") ? 0 : 1);
-}
-],
- rb_cv_missing__dtos18=yes, rb_cv_missing__dtos18=no, rb_cv_missing__dtos18=no)])
- if test "$rb_cv_missing__dtos18" = yes; then
- AC_DEFINE(MISSING__DTOS18)
- fi
- AC_CACHE_CHECK(whether PD libc fconvert fail to round,
- rb_cv_missing_fconvert,
- [AC_TRY_RUN([
-#include <stdio.h>
-#include <math.h>
-int
-main()
-{
- char buf[256];
- sprintf(buf, "%f", log(exp(1.0)));
- return (strcmp (buf, "1.000000") ? 0 : 1);
-}
-],
- rb_cv_missing_fconvert=yes, rb_cv_missing_fconvert=no, rb_cv_missing_fconvert=no)])
- if test "$rb_cv_missing_fconvert" = yes; then
- AC_DEFINE(MISSING_FCONVERT)
- fi
- ],
[beos*|haiku*], [
ac_cv_func_link=no
ac_cv_func_sched_yield=no
@@ -1046,7 +1234,7 @@ main()
AC_CHECK_FUNCS(cygwin_conv_path)
AC_LIBOBJ([langinfo])
],
-[mingw*], [ LIBS="-lshell32 -lws2_32 -limagehlp $LIBS"
+[mingw*], [ LIBS="-lshell32 -lws2_32 -limagehlp -lshlwapi $LIBS"
ac_cv_header_a_out_h=no
ac_cv_header_pwd_h=no
ac_cv_header_utime_h=no
@@ -1075,21 +1263,12 @@ main()
rb_cv_negative_time_t=no
ac_cv_func_fcntl=yes
ac_cv_func_flock=yes
+ ac_cv_func_gmtime_r=yes
rb_cv_large_fd_select=yes
AC_LIBOBJ([langinfo])
- : ${enable_win95=maybe}
],
[os2-emx*], [ LIBS="-lm $LIBS"
ac_cv_lib_dir_opendir=no],
-[msdosdjgpp*], [
- LIBS="-lm $LIBS"
- ac_cv_func_getpgrp_void=yes
- ac_cv_func_setitimer=no
- ac_cv_sizeof_rlim_t=4
- ac_cv_func_fork=no
- ac_cv_func_setrlimit=no
- ac_cv_header_sys_socket_h=no
- ],
[bsdi*], [ LIBS="-lm $LIBS"
AC_DEFINE(BROKEN_SETREUID, 1)
AC_DEFINE(BROKEN_SETREGID, 1)
@@ -1101,24 +1280,29 @@ main()
ac_cv_func_close=no
],
[dragonfly*], [ LIBS="-lm $LIBS"
+ # isinf() and isnan() are macros on DragonFly.
+ ac_cv_func_isinf=yes
+ ac_cv_func_isnan=yes
],
[bow], [ ac_cv_func_setitimer=no
],
[superux*], [ ac_cv_func_setitimer=no
],
+[nacl], [
+ LIBS="-lm -lnosys $LIBS"
+ if test "${nacl_cv_build_variant}" = "newlib"; then
+ RUBY_APPEND_OPTION(CPPFLAGS, -DNACL_NEWLIB)
+ else
+ RUBY_APPEND_OPTION(XCFLAGS, -fPIC)
+ fi
+ ac_cv_func_shutdown=no
+ ],
[ LIBS="-lm $LIBS"])
AC_CHECK_LIB(crypt, crypt)
AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
AC_CHECK_LIB(socket, socketpair) # SunOS/Solaris
AC_CHECK_LIB(rt, clock_gettime) # GNU/Linux
-if test "${enable_win95}" = maybe; then
- AC_HAVE_LIBRARY(unicows, [enable_win95=yes], [enable_win95=no])
-fi
-if test "${enable_win95}" = yes; then
- AC_DEFINE(WIN95)
- LIBS="-lunicows $LIBS"
-fi
AS_CASE(["$target_cpu"],
[alpha*|sh4|sh4el|sh4eb], [AS_CASE(["$target_os"::"$GCC"],
@@ -1126,7 +1310,8 @@ AS_CASE(["$target_cpu"],
[CFLAGS="-mieee $CFLAGS"],
[osf*], # ccc
[CFLAGS="-ieee $CFLAGS"],
- )])
+ )],
+[sparc*], [AC_LIBOBJ([sparc])])
ac_cv_header_net_socket_h=${ac_cv_header_net_socket_h=no}
if test "$ac_cv_header_net_socket_h" = yes; then
@@ -1145,7 +1330,7 @@ AC_CHECK_HEADERS(limits.h sys/file.h sys/ioctl.h sys/syscall.h\
syscall.h pwd.h grp.h a.out.h utime.h direct.h sys/resource.h \
sys/mkdev.h sys/utime.h xti.h netinet/in_systm.h float.h ieeefp.h \
ucontext.h intrinsics.h langinfo.h locale.h sys/sendfile.h time.h \
- net/socket.h sys/socket.h)
+ net/socket.h sys/socket.h process.h sys/prctl.h)
AC_TYPE_SIZE_T
RUBY_CHECK_SIZEOF(size_t, [int long void*], [], [@%:@include <sys/types.h>])
@@ -1171,6 +1356,9 @@ AC_CHECK_MEMBERS([struct stat.st_ctimensec])
AC_CHECK_TYPES([struct timespec], [], [], [@%:@ifdef HAVE_TIME_H
@%:@include <time.h>
+@%:@endif
+@%:@ifdef HAVE_SYS_TIME_H
+@%:@include <sys/time.h>
@%:@endif])
AC_CHECK_TYPES([struct timezone], [], [], [@%:@ifdef HAVE_TIME_H
@@ -1233,74 +1421,42 @@ RUBY_DEFINT(intptr_t, void*)
RUBY_DEFINT(uintptr_t, void*, unsigned)
RUBY_DEFINT(ssize_t, size_t, [], [@%:@include <sys/types.h>]) dnl may differ from int, so not use AC_TYPE_SSIZE_T.
+RUBY_NACL_CHECK_PEPPER_TYPES
+
AC_CACHE_CHECK(for stack end address, rb_cv_stack_end_address,
[rb_cv_stack_end_address=no
-for addr in __libc_stack_end _SEND; do
AC_TRY_LINK(
- [extern void *$addr;],
- [if (!$addr) return 1;],
- [rb_cv_stack_end_address="$addr"; break])
-done])
+ [extern void *__libc_stack_end;],
+ [if (!__libc_stack_end) return 1;],
+ [rb_cv_stack_end_address="__libc_stack_end"])
+])
if test $rb_cv_stack_end_address != no; then
AC_DEFINE_UNQUOTED(STACK_END_ADDRESS, $rb_cv_stack_end_address)
fi
-AC_CACHE_CHECK(for gc_mark and gc_children stack frame approximate size(word), rb_cv_gc_mark_stackframe_word,
-[save_CFLAGS="$CFLAGS"
-CFLAGS="-O0"
-AC_TRY_RUN([
-int word;
-char *stack_start;
-
-void
-set_stackframe_word()
-{
- int dumy = 42;
- int diff;
-
- if (stack_start < (char *)&dumy) {
- diff = (int)((char *)&dumy - stack_start);
- }
- else {
- diff = (int)(stack_start - (char *)&dumy);
- }
- word = (diff/sizeof(void *));
- if ((diff % sizeof(void *)) != 0) {
- word++;
- }
-}
-
-void
-gc_mark_children(void *p1, void *p2, int lev)
-{
- void *obj = p2;
-
- set_stackframe_word(p1,p2,lev);
-}
-
-void
-gc_mark(void *p1, void *p2, int lev)
-{
- void *obj = p2;
-
- gc_mark_children(p1,p2,lev++);
-}
+AS_CASE(["$target_os"],
+[openbsd*], [
+ AC_CACHE_CHECK(for heap align log on openbsd, rb_cv_page_size_log,
+ [rb_cv_page_size_log=no
+ for page_log in 12 13; do
+ AC_TRY_RUN([
+#include <math.h>
+#include <unistd.h>
int
main() {
- int dumy = 42;
-
- stack_start = (char *)&dumy;
- gc_mark(0, 0, 255);
- return word;
+ if ((int)log2((double)sysconf(_SC_PAGESIZE)) != $page_log) return 1;
+ return 0;
}
-],
- [rb_cv_gc_mark_stackframe_word="$?"],
- [rb_cv_gc_mark_stackframe_word="$?"],
- [rb_cv_gc_mark_stackframe_word="30"])
-CFLAGS="$save_CFLAGS"])
-AC_DEFINE_UNQUOTED(GC_MARK_STACKFRAME_WORD, $rb_cv_gc_mark_stackframe_word)
-
+ ],
+ rb_cv_page_size_log="$page_log"; break)
+ done])
+ if test $rb_cv_page_size_log != no; then
+ AC_DEFINE_UNQUOTED(HEAP_ALIGN_LOG, $rb_cv_page_size_log)
+ else
+ AC_DEFINE_UNQUOTED(HEAP_ALIGN_LOG, 12)
+ fi
+])
dnl Checks for library functions.
AC_TYPE_GETGROUPS
@@ -1373,11 +1529,23 @@ AC_REPLACE_FUNCS(dup2 memmove strerror\
# for missing/setproctitle.c
AS_CASE(["$target_os"],
-[aix* | k*bsd*-gnu | kopensolaris*-gnu | linux*], [AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)],
+[aix* | k*bsd*-gnu | kopensolaris*-gnu | linux* | darwin*], [AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)],
[hpux*], [AC_DEFINE(SPT_TYPE,SPT_PSTAT) ],
[])
+AS_CASE(["$target_cpu-$target_os"], [[i[3-6]86-linux*]], [
+ AC_CACHE_CHECK([for __sync_val_compare_and_swap], [rb_cv_gcc_compiler_cas], [
+ AC_TRY_LINK([unsigned long atomic_var;],
+ [
+ __sync_val_compare_and_swap(&atomic_var, 0, 1);
+ ],
+ [rb_cv_gcc_compiler_cas=yes],
+ [rb_cv_gcc_compiler_cas=no])])
+ if test "$rb_cv_gcc_compiler_cas" = no; then
+ ARCH_FLAG="-march=i486"
+ fi])
+
AC_CACHE_CHECK(for signbit, rb_cv_have_signbit,
[AC_TRY_LINK([
#include <math.h>
@@ -1393,15 +1561,16 @@ AC_CHECK_FUNCS(fmod killpg wait4 waitpid fork spawnv syscall __syscall chroot ge
truncate ftruncate ftello chsize times utimes utimensat fcntl lockf lstat\
truncate64 ftruncate64 ftello64 fseeko fseeko64 \
link symlink readlink readdir_r fsync fdatasync fchown posix_fadvise\
- setitimer setruid seteuid setreuid setresuid setproctitle socketpair\
+ setitimer setruid seteuid setreuid setresuid socketpair\
setrgid setegid setregid setresgid issetugid pause lchown lchmod\
getpgrp setpgrp getpgid setpgid initgroups getgroups setgroups\
- getpriority getrlimit setrlimit sysconf close getgrnam_r\
+ getpriority getrlimit setrlimit sysconf close getpwnam_r getgrnam_r\
dlopen sigprocmask sigaction sigsetjmp _setjmp _longjmp\
- setsid telldir seekdir fchmod cosh sinh tanh log2 round\
+ getsid setsid telldir seekdir fchmod cosh sinh tanh log2 round llabs\
setuid setgid daemon select_large_fdset setenv unsetenv\
mktime timegm gmtime_r clock_gettime gettimeofday poll ppoll\
- pread sendfile shutdown sigaltstack dl_iterate_phdr)
+ pread sendfile shutdown sigaltstack dl_iterate_phdr\
+ dup3 pipe2 posix_memalign memalign ioctl)
AC_CACHE_CHECK(for unsetenv returns a value, rb_cv_unsetenv_return_value,
[AC_TRY_COMPILE([
@@ -1466,7 +1635,7 @@ if test "$use_setreuid" = yes; then
fi
AC_STRUCT_TIMEZONE
AC_CACHE_CHECK(for struct tm.tm_gmtoff, rb_cv_member_struct_tm_tm_gmtoff,
- [AC_TRY_COMPILE([#include <time.h>],
+ [AC_TRY_COMPILE([@%:@include <time.h>],
[struct tm t; t.tm_gmtoff = 3600;],
[rb_cv_member_struct_tm_tm_gmtoff=yes],
[rb_cv_member_struct_tm_tm_gmtoff=no])])
@@ -1670,6 +1839,7 @@ else
AC_DEFINE(RSHIFT(x,y), (((x)<0) ? ~((~(x))>>(int)(y)) : (x)>>(int)(y)))
fi
+# win32.c still use this. Don't remove it.
test "$rb_cv_fcnt" = "not found" && rb_cv_fcnt="not found (OK if using GNU libc)"
AC_CACHE_CHECK([read count field in FILE structures], rb_cv_fcnt,
[rb_cv_fcnt="not found (OK if using GNU libc)"
@@ -1687,8 +1857,9 @@ for fcnt in dnl
done])
AS_CASE("$rb_cv_fcnt",
["not found"*], [rb_cv_fcnt="not found"],
- [AC_DEFINE_UNQUOTED(FILE_COUNT, $rb_cv_fcnt)])
+ [AC_DEFINE_UNQUOTED(FILE_COUNT, $rb_cv_fcnt)])
+# win32.c still use this. Don't remove it.
AC_CACHE_CHECK([read buffer ptr field in FILE structures], rb_cv_frptr,
[for frptr in dnl
_IO_read_ptr dnl
@@ -1728,6 +1899,38 @@ fi
RUBY_CHECK_SIZEOF([struct stat.st_ino], [long "long long"], [], [@%:@include <sys/stat.h>])
+AC_CACHE_CHECK([whether struct dirent.d_name is too small], rb_cv_sizeof_struct_dirent_too_small,
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT([
+@%:@if defined _WIN32
+@%:@ error <<<struct direct in win32/dir.h has variable length d_name>>>
+@%:@elif defined HAVE_DIRENT_H
+@%:@ include <dirent.h>
+@%:@elif defined HAVE_DIRECT_H
+@%:@ include <direct.h>
+@%:@else
+@%:@ define dirent direct
+@%:@ if HAVE_SYS_NDIR_H
+@%:@ include <sys/ndir.h>
+@%:@ endif
+@%:@ if HAVE_SYS_DIR_H
+@%:@ include <sys/dir.h>
+@%:@ endif
+@%:@ if HAVE_NDIR_H
+@%:@ include <ndir.h>
+@%:@ endif
+@%:@endif
+@%:@include <stddef.h>
+@%:@define numberof(array) [(int)(sizeof(array) / sizeof((array)[0]))]
+struct dirent d;
+])],
+ [offsetof(struct dirent, [d_name[numberof(d.d_name)]]) - offsetof(struct dirent, d_name) < 256])],
+ [rb_cv_sizeof_struct_dirent_too_small=yes],
+ [rb_cv_sizeof_struct_dirent_too_small=no])])
+if test "$rb_cv_sizeof_struct_dirent_too_small" = yes; then
+ AC_DEFINE(SIZEOF_STRUCT_DIRENT_TOO_SMALL, 1)
+fi
+
if test "$ac_cv_func_sysconf" = yes; then
AC_DEFUN([RUBY_CHECK_SYSCONF], [dnl
AC_CACHE_CHECK([whether _SC_$1 is supported], rb_cv_have_sc_[]m4_tolower($1),
@@ -1745,7 +1948,8 @@ if test "$ac_cv_func_sysconf" = yes; then
fi
AC_DEFUN(RUBY_STACK_GROW_DIRECTION, [
- AC_CACHE_CHECK(stack growing direction on $1, rb_cv_stack_grow_dir_$1, [
+ AS_VAR_PUSHDEF([stack_grow_dir], [rb_cv_stack_grow_dir_$1])
+ AC_CACHE_CHECK(stack growing direction on $1, stack_grow_dir, [
AS_CASE(["$1"],
[m68*|x86*|x64|i?86|ia64|ppc*|sparc*|alpha*], [ $2=-1],
[hppa*], [ $2=+1],
@@ -1769,8 +1973,9 @@ int main()
}
], $2=-1, $2=+1, $2=0)
])
-eval rb_cv_stack_grow_dir_$1=\$$2])
-eval $2=\$rb_cv_stack_grow_dir_$1])
+eval stack_grow_dir=\$$2])
+eval $2=\$stack_grow_dir
+AS_VAR_POPDEF([stack_grow_dir])])
if test "${universal_binary-no}" = yes ; then
archflagpat=`eval echo '"'"${ARCH_FLAG}"'"' | sed 's/[[][|.*]]/\\&/g'`
save_CFLAGS="$CFLAGS" new_cflags=`echo "$CFLAGS" | sed "s|$archflagpat"'||'`
@@ -1791,7 +1996,7 @@ if test "${universal_binary-no}" = yes ; then
if test x$stack_dir = xno; then
for archs in ${universal_archnames}; do
archs=`echo $archs | sed 's/=.*//'`
- eval dir=\$rb_cv_stack_grow_dir_$archs
+ eval dir=\$[rb_cv_stack_grow_dir_]AS_TR_SH([$archs])
RUBY_DEFINE_IF([defined __${archs}__], STACK_GROW_DIRECTION, $dir)
done
else
@@ -1812,12 +2017,14 @@ if test x"$enable_pthread" = xyes; then
AC_DEFINE(_REENTRANT)
AC_DEFINE(_THREAD_SAFE)
AC_DEFINE(HAVE_LIBPTHREAD)
- AC_CHECK_HEADERS(pthread_np.h)
+ AC_CHECK_HEADERS(pthread_np.h, [], [], [@%:@include <pthread.h>])
AS_CASE([$pthread_lib],
[c], [],
[root], [],
[c_r], [MAINLIBS="-pthread $MAINLIBS"],
- [LIBS="-l$pthread_lib $LIBS"])
+ [AS_CASE(["$target_os"],
+ [openbsd*], [LIBS="-pthread $LIBS"],
+ [LIBS="-l$pthread_lib $LIBS"])])
else
AC_MSG_WARN("Don't know how to find pthread library on your system -- thread support disabled")
fi
@@ -1825,7 +2032,13 @@ if test x"$enable_pthread" = xyes; then
pthread_getattr_np pthread_attr_get_np pthread_attr_getstack\
pthread_get_stackaddr_np pthread_get_stacksize_np \
thr_stksegment pthread_stackseg_np pthread_getthrds_np \
- pthread_condattr_setclock pthread_sigmask)
+ pthread_cond_init pthread_condattr_setclock pthread_condattr_init \
+ pthread_sigmask)
+ if test "${host_os}" = "nacl"; then
+ ac_cv_func_pthread_attr_init=no
+ else
+ AC_CHECK_FUNCS(pthread_attr_init)
+ fi
fi
if test x"$ac_cv_header_ucontext_h" = xyes; then
if test x"$rb_with_pthread" = xyes; then
@@ -1898,25 +2111,9 @@ main(int argc, char *argv[])
test x$rb_cv_fork_with_pthread = xyes || AC_DEFINE(CANNOT_FORK_WITH_PTHREAD)
fi
-AS_CASE(["$target_os"],
-[freebsd*], [
- AC_CHECK_HEADERS([/usr/local/include/execinfo.h])
- if test "x$ac_cv_header__usr_local_include_execinfo_h" = xyes; then :
- RUBY_APPEND_OPTION(CPPFLAGS, -I/usr/local/include)
- LDFLAGS="${LDFLAGS:+$LDFLAGS }-L/usr/local/lib"
- DLDFLAGS="${DLDFLAGS:+$DLDFLAGS }-L/usr/local/lib"
- AC_CHECK_LIB([execinfo], [backtrace])
- fi])
-AC_CHECK_FUNCS(backtrace)
-
-AC_ARG_WITH(valgrind,
- AS_HELP_STRING([--without-valgrind],[disable valgrind memcheck support]),
- [], with_valgrind=yes)
-AS_IF([test x$with_valgrind != xno],
- [AC_CHECK_HEADERS(valgrind/memcheck.h)])
-dnl }
-dnl runtime section {
+}
+{ # runtime section
dnl wheather use dln_a_out or not
AC_ARG_WITH(dln-a-out,
@@ -1942,11 +2139,14 @@ if test "$rb_cv_binary_elf" = yes; then
if test "$with_dln_a_out" = yes; then
AC_MSG_ERROR(dln_a_out does not work with ELF)
fi
- AC_LIBOBJ([addr2line])
+ AC_CHECK_HEADERS([elf.h elf_abi.h])
+ if test $ac_cv_header_elf_h = yes -o $ac_cv_header_elf_abi_h = yes; then
+ AC_LIBOBJ([addr2line])
+ fi
fi
AS_CASE(["$target_os"],
-[linux* | gnu* | k*bsd*-gnu | bsdi* | kopensolaris*-gnu], [
+[linux* | gnu* | k*bsd*-gnu | bsdi* | kopensolaris*-gnu | nacl], [
if test "$rb_cv_binary_elf" = no; then
with_dln_a_out=yes
else
@@ -1973,7 +2173,7 @@ if test "$with_dln_a_out" != yes; then
AC_MSG_CHECKING(whether OS depend dynamic link works)
if test "$GCC" = yes; then
AS_CASE(["$target_os"],
- [nextstep*|openstep*|rhapsody*|darwin*], [
+ [darwin*], [
# The -fno-common is needed if we wish to embed the Ruby interpreter
# into a plugin module of some project (as opposed to embedding it
# within the project's application). The -I/usr/local/include is
@@ -1982,7 +2182,7 @@ if test "$with_dln_a_out" != yes; then
# mkmf.rb's have_header() to fail if the desired resource happens to be
# installed in the /usr/local tree.
RUBY_APPEND_OPTION(CCDLFLAGS, -fno-common)],
- [human*|bsdi*|beos*|haiku*|cygwin*|mingw*|aix*|interix*], [ ],
+ [bsdi*|beos*|haiku*|cygwin*|mingw*|aix*|interix*], [ ],
[
RUBY_APPEND_OPTION(CCDLFLAGS, -fPIC)])
else
@@ -1996,7 +2196,8 @@ if test "$with_dln_a_out" != yes; then
AC_ARG_ENABLE(rpath,
- AS_HELP_STRING([--disable-rpath], [embed run path into extension libraries]),
+ AS_HELP_STRING([--enable-rpath], [embed run path into extension libraries.
+ enabled by default on ELF platforms]),
[enable_rpath=$enableval], [enable_rpath="$rb_cv_binary_elf"])
if test "$enable_rpath" = yes; then
RPATHFLAG=" ${linker_flag}-R%1\$-s"
@@ -2004,7 +2205,7 @@ if test "$with_dln_a_out" != yes; then
AS_CASE(["$target_os"],
[hpux*], [ DLDFLAGS="$DLDFLAGS -E"
- : ${LDSHARED='ld -b'}
+ : ${LDSHARED='$(LD) -b'}
XLDFLAGS="$XLDFLAGS -Wl,-E"
: ${LIBPATHENV=SHLIB_PATH}
if test "$rb_cv_prog_gnu_ld" = no; then
@@ -2017,20 +2218,23 @@ if test "$with_dln_a_out" != yes; then
LDFLAGS="$LDFLAGS -Wl,-E"
fi
else
- : ${LDSHARED='ld -G'}
+ : ${LDSHARED='$(CC) -G'}
+ fi
+ if test "$ac_cv_sizeof_voidp" = 8; then
+ : ${LIBPATHENV=LD_LIBRARY_PATH_64}
fi
rb_cv_dlopen=yes],
- [sunos*], [ : ${LDSHARED='ld -assert nodefinitions'}
+ [sunos*], [ : ${LDSHARED='$(LD) -assert nodefinitions'}
rb_cv_dlopen=yes],
- [irix*], [ : ${LDSHARED='ld -shared'}
+ [irix*], [ : ${LDSHARED='$(LD) -shared'}
rb_cv_dlopen=yes],
- [sysv4*], [ : ${LDSHARED='ld -G'}
+ [sysv4*], [ : ${LDSHARED='$(LD) -G'}
rb_cv_dlopen=yes],
[nto-qnx*], [ : ${LDSHARED='$(CC) -shared'}
rb_cv_dlopen=yes],
- [esix*|uxpds*], [ : ${LDSHARED="ld -G"}
+ [esix*|uxpds*], [ : ${LDSHARED='$(LD) -G'}
rb_cv_dlopen=yes],
- [osf*], [ : ${LDSHARED="ld -shared -expect_unresolved \"*\""}
+ [osf*], [ : ${LDSHARED='$(LD) -shared -expect_unresolved "*"'}
rb_cv_dlopen=yes],
[bsdi3*], [ AS_CASE(["$CC"],
[*shlicc*], [ : ${LDSHARED='$(CC) -r'}
@@ -2051,7 +2255,7 @@ if test "$with_dln_a_out" != yes; then
LDFLAGS="$LDFLAGS -rdynamic"
DLDFLAGS="$DLDFLAGS "'-Wl,-soname,$(.TARGET)'
else
- test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED="ld -Bshareable"
+ test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED='$(LD) -Bshareable'
fi
rb_cv_dlopen=yes],
[openbsd*], [ : ${LDSHARED='$(CC) -shared ${CCDLFLAGS}'}
@@ -2059,23 +2263,14 @@ if test "$with_dln_a_out" != yes; then
LDFLAGS="$LDFLAGS -Wl,-E"
fi
rb_cv_dlopen=yes],
- [nextstep*], [ : ${LDSHARED='$(CC) -r -nostdlib'}
- LDFLAGS="$LDFLAGS -u libsys_s"
- rb_cv_dlopen=yes],
- [openstep*], [ : ${LDSHARED='$(CC) -dynamic -bundle -undefined suppress'}
- : ${LDFLAGS=""}
- rb_cv_dlopen=yes],
- [rhapsody*], [ : ${LDSHARED='$(CC) -dynamic -bundle -undefined suppress'}
- : ${LDFLAGS=""}
- rb_cv_dlopen=yes],
[darwin*], [ : ${LDSHARED='$(CC) -dynamic -bundle'}
- : ${DLDFLAGS="${linker_flag}-undefined${linker_flag:+,}dynamic_lookup ${linker_flag}-multiply_defined${linker_flag:+,}suppress ${linker_flag}-flat_namespace"}
+ : ${DLDFLAGS="${linker_flag}-undefined${linker_flag:+,}dynamic_lookup ${linker_flag}-multiply_defined${linker_flag:+,}suppress"}
: ${LDFLAGS=""}
: ${LIBPATHENV=DYLD_LIBRARY_PATH}
# /usr/local/include is always searched for
# some reason, but /usr/local/lib is not.
hdr=`find /usr/local/include -name \*.h -type f | sed 's:^/usr/local/include/::;q'`
- if test -n "$hdr" && $CC -E -include "$hdr" -xc /dev/null | fgrep -q "$hdr"; then
+ if test -n "$hdr" && $CC -E -include "$hdr" -xc /dev/null 2>/dev/null | fgrep -q "$hdr"; then
$CC -print-search-dirs | grep -q '^libraries:.*:/usr/local/lib/*' ||
echo " $LDFLAGS " | grep -q ' -L */usr/local/lib/* ' ||
LDFLAGS="${LDFLAGS:+$LDFLAGS }-L/usr/local/lib"
@@ -2083,46 +2278,43 @@ if test "$with_dln_a_out" != yes; then
rb_cv_dlopen=yes],
[aix*], [ : ${LDSHARED='$(CC)'}
LDSHARED="$LDSHARED ${linker_flag}-G"
- DLDFLAGS='-eInit_$(TARGET)'
+ EXTDLDFLAGS='-e$(TARGET_ENTRY)'
XLDFLAGS="${linker_flag}"'-bE:$(ARCHFILE)'" ${linker_flag}-brtl"
XLDFLAGS="$XLDFLAGS ${linker_flag}-blibpath:${prefix}/lib:${LIBPATH:-/usr/lib:/lib}"
: ${ARCHFILE="ruby.imp"}
TRY_LINK='$(CC) $(LDFLAGS) -oconftest $(INCFLAGS) -I$(hdrdir) $(CPPFLAGS)'
TRY_LINK="$TRY_LINK"' $(CFLAGS) $(src) $(LIBPATH) $(LOCAL_LIBS) $(LIBS)'
- : ${LIBPATHENV=SHLIB_PATH}
+ : ${LIBPATHENV=LIBPATH}
RPATHFLAG=" ${linker_flag}-blibpath:%1\$-s:${prefix}/lib:${LIBPATH:-/usr/lib:/lib}"
rb_cv_dlopen=yes],
- [human*], [ : ${DLDFLAGS=''}
- : ${LDSHARED=''}
- : ${LDFLAGS=''}
- : ${LINK_SO='ar cru $@ $(OBJS)'}
- rb_cv_dlopen=yes],
[beos*], [ AS_CASE(["$target_cpu"],
[powerpc*], [
- : ${LDSHARED="ld -xms"}
- DLDFLAGS="$DLDFLAGS "'-export Init_$(TARGET) -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o'
+ : ${LDSHARED='$(LD) -xms'}
+ EXTDLDFLAGS='-export $(TARGET_ENTRY)'
+ DLDFLAGS="$DLDFLAGS -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o"
LDFLAGS="$LDFLAGS -L/boot/home/config/lib -lbe -lroot"
],
[i586*], [
- : ${LDSHARED="ld -shared"}
- DLDFLAGS="$DLDFLAGS -L/boot/develop/lib/x86 -L/boot/home/config/lib \$(topdir)/_APP_ -lbe -lroot"
- LDFLAGS="$LDFLAGS -L/boot/develop/lib/x86 -L/boot/home/config/lib -lbe -lroot"
+ : ${LDSHARED='$(LD) -shared'}
+ DLDFLAGS="$DLDFLAGS -L/boot/develop/lib/x86 -L/boot/home/config/lib \$(topdir)/_APP_ -lroot"
+ LDFLAGS="$LDFLAGS -L/boot/develop/lib/x86 -L/boot/home/config/lib -lroot"
])
: ${LIBPATHENV=LIBRARY_PATH}
rb_cv_dlopen=yes],
[haiku*], [ AS_CASE(["$target_cpu"],
[powerpc*], [
- : ${LDSHARED="ld -xms"}
- DLDFLAGS="$DLDFLAGS "'-export Init_$(TARGET) -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o'
+ : ${LDSHARED='$(LD) -xms'}
+ EXTDLDFLAGS='-export $(TARGET_ENTRY)'
+ DLDFLAGS="$DLDFLAGS -lroot glue-noinit.a init_term_dyn.o start_dyn.o"
],
[i586*], [
- : ${LDSHARED="ld -shared"}
- DLDFLAGS="$DLDFLAGS -L/boot/develop/lib/x86 -lbe -lroot"
+ : ${LDSHARED='$(LD) -shared'}
+ DLDFLAGS="$DLDFLAGS -L/boot/develop/lib/x86 -lroot"
])
: ${LIBPATHENV=LIBRARY_PATH}
rb_cv_dlopen=yes ],
[nto-qnx*], [ DLDFLAGS="$DLDFLAGS -L/lib -L/usr/lib -L/usr/local/lib"
- : ${LDSHARED='ld -Bshareable -x'}
+ : ${LDSHARED='$(LD) -Bshareable -x'}
LDFLAGS="$LDFLAGS -L/lib -L/usr/lib -L/usr/local/lib"
rb_cv_dlopen=yes],
[cygwin*|mingw*], [
@@ -2131,12 +2323,13 @@ if test "$with_dln_a_out" != yes; then
DLDFLAGS="${DLDFLAGS} -Wl,--enable-auto-image-base,--enable-auto-import"
: ${LIBPATHENV=""}
rb_cv_dlopen=yes],
- [hiuxmpp], [ : ${LDSHARED='ld -r'}],
+ [hiuxmpp], [ : ${LDSHARED='$(LD) -r'}],
[atheos*], [ : ${LDSHARED='$(CC) -shared'}
rb_cv_dlopen=yes],
[os2-emx*], [ LDFLAGS="$LDFLAGS -Zomf"
],
- [ : ${LDSHARED='ld'}])
+ [nacl], [ LDSHARED='$(CC) -shared' ],
+ [ : ${LDSHARED='$(LD)'}])
AC_MSG_RESULT($rb_cv_dlopen)
fi
if test "${LDSHAREDXX}" = ""; then
@@ -2161,6 +2354,37 @@ AC_SUBST(RPATHFLAG)
AC_SUBST(LIBPATHENV, "${LIBPATHENV-LD_LIBRARY_PATH}")
AC_SUBST(TRY_LINK)
+AC_ARG_WITH(opt-dir,
+ AS_HELP_STRING([--with-opt-dir=DIR-LIST],
+ [add optional headers and libraries directories separated by $PATH_SEPARATOR]),
+ [
+ val=`echo "$PATH_SEPARATOR$withval" | sed "s|$PATH_SEPARATOR\([[^$PATH_SEPARATOR]*]\)| -I\1/include|g;s/^ //"`
+ CPPFLAGS="$CPPFLAGS $val"
+ set -x
+ val=`IFS="$PATH_SEPARATOR"
+ for dir in $withval; do
+ echo x ${LIBPATHFLAG} ${RPATHFLAG} |
+ sed "s/^x *//;s${IFS}"'%1\\$-s'"${IFS}${dir}/lib${IFS}g;s${IFS}%s${IFS}${dir}/lib${IFS}g"
+ done | tr '\012' ' '`
+ set +x
+ LDFLAGS="$LDFLAGS${LDFLAGS:+ }$val"
+ DLDFLAGS="$DLDFLAGS${DLDFLAGS:+ }$val"
+ ])
+
+AS_CASE(["$target_cpu-$target_os"],
+[*-freebsd*|x86_64-netbsd*], [
+ AC_CHECK_HEADERS([execinfo.h])
+ if test "x$ac_cv_header_execinfo_h" = xyes; then
+ AC_CHECK_LIB([execinfo], [backtrace])
+ fi])
+AC_CHECK_FUNCS(backtrace)
+
+AC_ARG_WITH(valgrind,
+ AS_HELP_STRING([--without-valgrind],[disable valgrind memcheck support]),
+ [], with_valgrind=yes)
+AS_IF([test x$with_valgrind != xno],
+ [AC_CHECK_HEADERS(valgrind/memcheck.h)])
+
dln_a_out_works=no
if test "$ac_cv_header_a_out_h" = yes; then
if test "$with_dln_a_out" = yes || test "$rb_cv_dlopen" = unknown; then
@@ -2192,7 +2416,7 @@ else
AS_CASE(["$target_os"],
[hpux*], [
DLEXT=sl],
- [nextstep*|openstep*|rhapsody*|darwin*], [
+ [darwin*], [
RUBY_APPEND_OPTION(XLDFLAGS, [-Wl,-u,_objc_msgSend])
DLEXT=bundle],
[os2-emx*], [
@@ -2208,10 +2432,13 @@ if test "$rb_cv_dlopen:$load_relative" = yes:yes; then
AC_CHECK_FUNCS(dladdr)
if test "$ac_cv_func_dladdr" = yes; then
LOAD_RELATIVE=1
- else
- unset load_relative
fi
fi
+if test x"$LOAD_RELATIVE" = x1; then
+ load_relative=yes
+else
+ unset load_relative
+fi
len=2 # .rb
n=`expr "$DLEXT" : '.*'`; test "$n" -gt "$len" && len=$n
@@ -2230,7 +2457,7 @@ fi
AS_CASE(["$target_os"],
[linux* | gnu* | k*bsd*-gnu | kopensolaris*-gnu], [
STRIP="$STRIP -S -x"],
- [nextstep* | openstep* | rhapsody* | darwin*], [
+ [darwin*], [
STRIP="$STRIP -A -n"])
AC_ARG_WITH(ext,
@@ -2244,11 +2471,15 @@ AC_SUBST(EXTSTATIC)dnl
AC_ARG_WITH(static-linked-ext,
AS_HELP_STRING([--with-static-linked-ext], [link external modules statically]),
[AS_CASE([$withval],[yes],[STATIC=;EXTSTATIC=static])])
+if test x"$EXTSTATIC" = xstatic; then
+ ENCOBJS='enc/encinit.$(OBJEXT) enc/libenc.$(LIBEXT) enc/libtrans.$(LIBEXT)'
+ EXTOBJS='ext/extinit.$(OBJEXT)'
+ AC_DEFINE_UNQUOTED(EXTSTATIC, 1)
+fi
+AC_SUBST(ENCOBJS)
+AC_SUBST(EXTOBJS)
AS_CASE(["$target_os"],
- [human*], [
- setup=Setup.x68
- ],
dnl OS/2 environment w/ Autoconf 2.1x for EMX
[os2-emx], [
setup=Setup.emx
@@ -2256,6 +2487,9 @@ AS_CASE(["$target_os"],
[*djgpp*], [
setup=Setup.dj
],
+ [nacl], [
+ setup=Setup.nacl
+ ],
[
setup=Setup
])
@@ -2266,8 +2500,9 @@ if test "$prefix" = NONE; then
prefix=$ac_default_prefix
fi
+BTESTRUBY='$(MINIRUBY)'
if test x"$cross_compiling" = xyes; then
- test x"$MINIRUBY" = x && MINIRUBY="${RUBY-$BASERUBY} -I`pwd` "-r'$(arch)-fake'
+ test x"$MINIRUBY" = x && MINIRUBY="${RUBY-$BASERUBY} -I`$CHDIR .; pwd` "-r'$(arch)-fake'
XRUBY_LIBDIR=`${RUBY-$BASERUBY} -rrbconfig -e ['puts RbConfig::CONFIG["libdir"]']`
XRUBY_RUBYLIBDIR=`${RUBY-$BASERUBY} -rrbconfig -e ['puts RbConfig::CONFIG["rubylibdir"]']`
XRUBY_RUBYHDRDIR=`${RUBY-$BASERUBY} -rrbconfig -e ['puts RbConfig::CONFIG["rubyhdrdir"]']`
@@ -2278,6 +2513,20 @@ if test x"$cross_compiling" = xyes; then
RUNRUBY='$(MINIRUBY) -I`cd $(srcdir)/lib; pwd`'
XRUBY='$(MINIRUBY)'
TEST_RUNNABLE=no
+
+ if test "$host_os" = "nacl"; then
+ if test "$build_cpu" = "$host_cpu" || test "${nacl_cv_cpu_nick}" = "x86" -a "$host_cpu" = "i686"; then
+ nacl_cv_sel_ldr='`$(MINIRUBY) $(srcdir)/nacl/nacl-config.rb sel_ldr`'
+ nacl_cv_irt_core='`$(MINIRUBY) $(srcdir)/nacl/nacl-config.rb irt_core`'
+ nacl_cv_runnable_ld='`$(MINIRUBY) $(srcdir)/nacl/nacl-config.rb runnable_ld`'
+ nacl_cv_host_lib='`$(MINIRUBY) $(srcdir)/nacl/nacl-config.rb host_lib`'
+ TEST_RUNNABLE=yes
+ BTESTRUBY="${nacl_cv_sel_ldr} -a -B ${nacl_cv_irt_core} -w 1:3 -w 2:4"
+ BTESTRUBY="$BTESTRUBY -- ${nacl_cv_runnable_ld} --library-path ${nacl_cv_host_lib}"
+ BTESTRUBY="$BTESTRUBY `pwd`/"'miniruby$(EXEEXT) -I`cd $(srcdir)/lib; pwd` -I.'
+ BTESTRUBY="$BTESTRUBY"' -I$(EXTOUT)/common 3>&1 4>&2 1>/dev/null 2>/dev/null '
+ fi
+ fi
else
MINIRUBY='./miniruby$(EXEEXT) -I$(srcdir)/lib -I.'
MINIRUBY="$MINIRUBY"' -I$(EXTOUT)/common'
@@ -2288,6 +2537,7 @@ else
fi
AC_SUBST(TEST_RUNNABLE)
AC_SUBST(MINIRUBY)
+AC_SUBST(BTESTRUBY)
AC_SUBST(PREP)
AC_SUBST(RUNRUBY)
AC_SUBST(XRUBY)
@@ -2301,7 +2551,7 @@ LIBRUBYARG='$(LIBRUBYARG_STATIC)'
SOLIBS=
AS_CASE(["$target_os"],
- [cygwin*|mingw*|beos*|haiku*|openstep*|nextstep*|rhapsody*|darwin*|os2-emx*], [
+ [cygwin*|mingw*|beos*|haiku*|darwin*|os2-emx*], [
: ${DLDLIBS=""}
],
[
@@ -2322,16 +2572,36 @@ AC_ARG_ENABLE(shared,
AS_HELP_STRING([--enable-shared], [build a shared library for Ruby]),
[enable_shared=$enableval])
libprefix='$(libdir)'
-LIBRUBY_RELATIVE=no
+LIBRUBY_RELATIVE=${load_relative-no}
AS_CASE("$enable_shared", [yes], [
LIBRUBY='$(LIBRUBY_SO)'
LIBRUBYARG_SHARED='-l$(RUBY_SO_NAME)'
LIBRUBYARG='$(LIBRUBYARG_SHARED)'
+ LIBRUBY_RELATIVE=no
test -z "$CCDLFLAGS" || CFLAGS="$CFLAGS $CCDLFLAGS"
ENABLE_SHARED=yes
if test "$rb_cv_binary_elf" = yes; then
SOLIBS='$(LIBS)'
fi
+
+ # libdir can be overridden in config.site file (on OpenSUSE at least).
+ libdir_basename=lib
+ if test "$bindir" = '${exec_prefix}/bin'; then
+ AS_CASE(["$libdir"], ['${exec_prefix}/'*], [libdir_basename=`basename "$libdir"`])
+ fi
+ AC_DEFINE_UNQUOTED(LIBDIR_BASENAME, ["${libdir_basename}"])
+
+ AS_CASE(["$target_os"],
+ [freebsd*|dragonfly*], [],
+ [
+ if test "$GCC" = yes; then
+ RUBY_TRY_LDFLAGS([${linker_flag}--no-undefined], [no_undefined=yes], [no_undefined=no])
+ if test "no_undefined" = yes; then
+ RUBY_APPEND_OPTION(EXTLDFLAGS, [${linker_flag}--no-undefined])
+ fi
+ fi
+ ])
+
AS_CASE(["$target_os"],
[sunos4*], [
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
@@ -2340,7 +2610,7 @@ AS_CASE("$enable_shared", [yes], [
LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR)'
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
if test "$load_relative" = yes; then
- LIBRUBY_RPATHFLAGS="'-Wl,-rpath,\$\${ORIGIN}/../lib'"
+ LIBRUBY_RPATHFLAGS="'-Wl,-rpath,\$\${ORIGIN}/../${libdir_basename}'"
LIBRUBY_RELATIVE=yes
fi
],
@@ -2397,7 +2667,7 @@ AS_CASE("$enable_shared", [yes], [
RUBY_SO_NAME="$RUBY_SO_NAME"'.$(MAJOR).$(MINOR).$(TEENY)'
LIBRUBY_LDSHARED='$(CC) -dynamiclib'
if test "$load_relative" = yes; then
- libprefix='@executable_path/../lib'
+ libprefix="@executable_path/../${libdir_basename}"
LIBRUBY_RELATIVE=yes
fi
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-install_name '${libprefix}'/$(LIBRUBY_SO)'
@@ -2413,9 +2683,33 @@ AS_CASE("$enable_shared", [yes], [
],
[interix*], [
LIBRUBYARG_SHARED='-L. -L${libdir} -l$(RUBY_SO_NAME)'
+ ],
+ [mingw*|cygwin*|mswin*], [
+ LIBRUBY_RELATIVE=yes
])
], [
LIBRUBYARG_SHARED=
+
+ # enable PIE if possible
+ pie=
+ AS_CASE(["$target_os"],
+ [haiku], [
+ # gcc supports PIE, but doesn't work correctly in Haiku
+ pie=no
+ ])
+ if test "$GCC" = yes -a -z "$EXTSTATIC" -a "x$pie" != xno; then
+ RUBY_TRY_CFLAGS(-fPIE, [pie=yes], [pie=no])
+ if test "$pie" = yes; then
+ RUBY_APPEND_OPTION(XCFLAGS, -fPIE)
+ for pie in -pie -Wl,-pie; do
+ RUBY_TRY_LDFLAGS([$pie], [], [pie=])
+ if test "x$pie" != x; then
+ RUBY_APPEND_OPTION(XLDFLAGS, $pie)
+ break
+ fi
+ done
+ fi
+ fi
])
if test "$enable_rpath" = yes; then
test -z "$LIBRUBY_RPATHFLAGS" || LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS "
@@ -2435,8 +2729,54 @@ if test "$EXEEXT" = .exe; then
AC_SUBST(EXECUTABLE_EXTS)
fi
-dnl }
-dnl build section {
+AC_ARG_ENABLE(dtrace,
+ AS_HELP_STRING([--enable-dtrace],
+ [enable DTrace for tracing inside ruby. enabled by default on systems having dtrace]),
+ [enable_dtrace=$enableval], [enable_dtrace=auto])
+
+if test "${enable_dtrace}" = "auto"; then
+ if test x"$DTRACE" != x -a x"$cross_compiling" != xyes; then
+ RUBY_DTRACE_AVAILABLE()
+ enable_dtrace=$rb_cv_dtrace_available
+ else
+ enable_dtrace=no
+ fi
+fi
+
+LIBRUBY_A_OBJS='$(OBJS)'
+if test "${enable_dtrace}" = "yes"; then
+ if test -z "$DTRACE"; then
+ AC_MSG_ERROR([dtrace(1) is missing])
+ elif test "$cross_compiling" = yes; then
+ AC_MSG_ERROR([--enable-dtrace, however, cross compiling])
+ else
+ RUBY_DTRACE_AVAILABLE()
+ enable_dtrace=$rb_cv_dtrace_available
+ if test "${enable_dtrace}" = "no"; then
+ AC_MSG_ERROR([--enable-dtrace, however, USDT is not available])
+ fi
+ RUBY_DTRACE_POSTPROCESS()
+ if test "$rb_cv_prog_dtrace_g" = 'yes'; then
+ DTRACE_OBJ='probes.$(OBJEXT)'
+ DTRACE_GLOMMED_OBJ='ruby-glommed.$(OBJEXT)'
+ LIBRUBY_A_OBJS='$(DTRACE_GLOMMED_OBJ)'
+ fi
+ AS_CASE("${target_os}", [freebsd*], [
+ # FreeBSD's dtrace requires libelf
+ LIBS="-lelf $LIBS"
+ ])
+ fi
+ DTRACE_EXT=d
+else
+ DTRACE_EXT=dmyh
+fi
+AC_SUBST(DTRACE_EXT)
+AC_SUBST(DTRACE_OBJ)
+AC_SUBST(DTRACE_GLOMMED_OBJ)
+AC_SUBST(LIBRUBY_A_OBJS)
+
+}
+{ # build section
dnl build rdoc index if requested
RDOCTARGET=""
@@ -2486,32 +2826,25 @@ AC_CACHE_CHECK([for prefix of external symbols], rb_cv_symbol_prefix, [
])
SYMBOL_PREFIX="$rb_cv_symbol_prefix"
test "x$SYMBOL_PREFIX" = xNONE && SYMBOL_PREFIX=''
+DLNOBJ=dln.o
+AC_ARG_ENABLE(dln,
+ AC_HELP_STRING([--disable-dln], [disable dynamic link feature]),
+ [test "$enableval" = yes || DLNOBJ=dmydln.o])
+AC_SUBST(DLNOBJ)
MINIDLNOBJ=dmydln.o
+
AS_CASE(["$target_os"],
[linux*], [
],
[netbsd*], [
RUBY_APPEND_OPTION(CFLAGS, -pipe)
],
- [nextstep*|openstep*], [
- RUBY_APPEND_OPTION(CPPFLAGS, -I/usr/local/include)
- ],
- [rhapsody*], [
- RUBY_APPEND_OPTIONS(CFLAGS, -pipe -no-precomp)
- ],
[darwin*], [
RUBY_APPEND_OPTION(CFLAGS, -pipe)
],
- [human*], [
- AC_LIBOBJ([x68.o])
- CFLAGS="$CFLAGS -fansi-only"
- XCFLAGS="$XCFLAGS -cc1-stack=262144 -cpp-stack=2694144"
- EXEEXT=.x
- OBJEXT=o
- ],
[os2-emx], [
AC_LIBOBJ([os2])
- CFLAGS="$CFLAGS -DOS2"
+ CFLAGS="$CFLAGS -DOS2"
LIBRUBY_A=`echo $LIBRUBY_A | sed 's/^lib//'`
LIBRUBY_SO=`echo $LIBRUBY_SO | sed 's/^lib//'`
LIBRUBY_ALIASES=`for i in $LIBRUBY_ALIASES; do echo "$i"; done | sed 's/^lib//'`
@@ -2536,7 +2869,7 @@ AS_CASE(["$target_os"],
CPPFLAGS="$CPPFLAGS -I/boot/home/config/include"
],
[cygwin*|mingw*], [
- RUBY_SO_NAME="${RUBY_SO_NAME}${MAJOR}${MINOR}${TEENY}"
+ RUBY_SO_NAME="${RUBY_SO_NAME}"'$(MAJOR)$(MINOR)$(TEENY)'
LIBRUBY_DLDFLAGS="${DLDFLAGS}"' -Wl,--out-implib=$(LIBRUBY)'
AS_CASE(["$target_os"],
[cygwin*], [
@@ -2556,11 +2889,13 @@ AS_CASE(["$target_os"],
fi
EXPORT_PREFIX=' '
DLDFLAGS="${DLDFLAGS}"' $(DEFFILE)'
- AC_LIBOBJ([win32])
+ AC_LIBOBJ([win32/win32])
+ AC_LIBOBJ([win32/file])
COMMON_LIBS=m
# COMMON_MACROS="WIN32_LEAN_AND_MEAN="
COMMON_HEADERS="winsock2.h windows.h"
THREAD_MODEL=win32
+ PLATFORM_DIR=win32
])
LIBRUBY_ALIASES=''
FIRSTMAKEFILE=GNUmakefile:cygwin/GNUmakefile.in
@@ -2578,8 +2913,8 @@ AS_CASE(["$target_os"],
XCFLAGS="$XCFLAGS -DYYMAXDEPTH=300"
YACC="$YACC -Nl40000 -Nm40000"
])],
- [*msdosdjgpp*], [
- FIRSTMAKEFILE=GNUmakefile:djgpp/GNUmakefile.in
+ [nacl], [
+ FIRSTMAKEFILE=GNUmakefile:nacl/GNUmakefile.in
])
MINIOBJS="$MINIDLNOBJ"
@@ -2594,7 +2929,7 @@ AC_ARG_ENABLE(debug-env,
[AC_DEFINE(RUBY_DEBUG_ENV)])
AS_CASE(["$FIRSTMAKEFILE"], [*GNUmakefile:*], [gnumake=yes], [
- AC_MSG_CHECKING([for if ${MAKE-make} is GNU make])
+ AC_MSG_CHECKING([if ${MAKE-make} is GNU make])
mkdir conftest.dir
echo "all:; @echo yes" > conftest.dir/GNUmakefile
echo "all:; @echo no" > conftest.dir/Makefile
@@ -2650,7 +2985,7 @@ if test "${universal_binary-no}" = yes ; then
archflagpat=`eval echo '"'"${ARCH_FLAG}"'"' | sed 's/[[][|.*]]/\\&/g'`
new_cflags=`echo "$CFLAGS" | sed "s|$archflagpat"'||'`
for archs in ${universal_archnames}; do
- cpu=${archs#*=}
+ cpu=${archs@%:@*=}
archs=${archs%=*}
CFLAGS="$new_cflags -arch $archs"
archs="__${archs}__"
@@ -2664,6 +2999,42 @@ if test "${universal_binary-no}" = yes ; then
])])
fi
+AC_CHECK_FUNC(memmem, [
+ AC_CACHE_CHECK(for broken memmem, rb_cv_broken_memmem, [
+ AC_TRY_RUN([
+#include <string.h>
+
+int
+main()
+{
+ char *str = "hogefugafoobar";
+ char *rs = "foo";
+ char *empty = "";
+ char *p;
+
+ p = memmem(str, strlen(str), rs, strlen(rs));
+ if (p == str+8) {
+ p = memmem(str, strlen(str), empty, strlen(empty));
+ if (p == str)
+ return 0;
+ else
+ return 1;
+ }
+ else {
+ return 1;
+ }
+}
+ ],
+ rb_cv_broken_memmem=no,
+ rb_cv_broken_memmem=yes,
+ rb_cv_broken_memmem=yes)
+ ])
+ if test "$rb_cv_broken_memmem" = no; then
+ AC_DEFINE(HAVE_MEMMEM, 1)
+ fi
+])
+
+
CPPFLAGS="$CPPFLAGS "'$(DEFS)'
test -z "$CPPFLAGS" || CPPFLAGS="$CPPFLAGS "; CPPFLAGS="$CPPFLAGS"'${cppflags}'
if test -n "${cflags+set}"; then
@@ -2676,9 +3047,9 @@ if test -n "${cxxflags+set}"; then
fi
if test "${ARCH_FLAG}"; then
archflagpat=`eval echo '"'"${ARCH_FLAG}"'"' | sed 's/[[][|.*]]/\\&/g'`
- CFLAGS=`echo "$CFLAGS" | sed "s|$archflagpat"'|$(ARCH_FLAG)|'`
- CXXFLAGS=`echo "$CXXFLAGS" | sed "s|$archflagpat"'|$(ARCH_FLAG)|'`
- LDFLAGS=`echo "$LDFLAGS" | sed "s|$archflagpat"'|$(ARCH_FLAG)|'`
+ CFLAGS=`echo "$CFLAGS" | sed "s| *$archflagpat"'||'`
+ CXXFLAGS=`echo "$CXXFLAGS" | sed "s| *$archflagpat"'||'`
+ LDFLAGS=`echo "$LDFLAGS" | sed "s| *$archflagpat"'||'`
fi
warnflags="$rb_cv_warnflags"
AC_SUBST(cppflags, [])dnl
@@ -2687,8 +3058,11 @@ AC_SUBST(cxxflags, ["$orig_cxxflags "'${optflags} ${debugflags} ${warnflags}'])d
AC_SUBST(optflags)dnl
AC_SUBST(debugflags)dnl
AC_SUBST(warnflags)dnl
+AC_SUBST(strict_warnflags)dnl
AC_SUBST(XCFLAGS)dnl
AC_SUBST(XLDFLAGS)dnl
+AC_SUBST(EXTLDFLAGS)dnl
+AC_SUBST(EXTDLDFLAGS)dnl
AC_SUBST(LIBRUBY_LDSHARED)
AC_SUBST(LIBRUBY_DLDFLAGS)
AC_SUBST(RUBY_INSTALL_NAME)
@@ -2713,6 +3087,7 @@ AC_SUBST(EXPORT_PREFIX)
AC_SUBST(SYMBOL_PREFIX)
AC_SUBST(MINIOBJS)
AC_SUBST(THREAD_MODEL)
+AC_SUBST(PLATFORM_DIR)
MAKEFILES="Makefile `echo $FIRSTMAKEFILE | sed 's/:.*//'`"
MAKEFILES="`echo $MAKEFILES`"
@@ -2766,17 +3141,19 @@ if test ${RUBY_LIB_VERSION_STYLE+set}; then
echo "#define RUBY_LIB_VERSION_STYLE $RUBY_LIB_VERSION_STYLE"
echo '#define STRINGIZE(x) x'
test -f revision.h -o -f "${srcdir}/revision.h" || echo '#define RUBY_REVISION 0'
+ echo '#include "verconf.h"'
echo '#include "version.h"'
echo 'ruby_version=RUBY_LIB_VERSION'
} > conftest.c
- ruby_version="`$CPP -I"${srcdir}" -I"${srcdir}/include" conftest.c | sed '/^ruby_version=/!d;s/ //g'`"
+ test -f verconf.h || > verconf.h
+ ruby_version="`$CPP -I. -I"${srcdir}" -I"${srcdir}/include" conftest.c | sed '/^ruby_version=/!d;s/ //g'`"
eval $ruby_version
else
RUBY_LIB_VERSION="\"${ruby_version}\""
fi
AC_ARG_WITH(sitedir,
- AS_HELP_STRING([--with-sitedir=DIR], [site libraries in DIR [[RUBY_LIB_PREFIX/site_ruby]]]),
+ AS_HELP_STRING([--with-sitedir=DIR], [site libraries in DIR [[RUBY_LIB_PREFIX/site_ruby]], "no" to disable site directory]),
[sitedir=$withval],
[sitedir='${rubylibprefix}/site_ruby'])
dir="${sitedir}"
@@ -2785,7 +3162,7 @@ until SITE_DIR=`eval echo \\"${dir}\\"`; test "x${dir}" = "x${SITE_DIR}"; do
done
AC_ARG_WITH(vendordir,
- AS_HELP_STRING([--with-vendordir=DIR], [vendor libraries in DIR [[RUBY_LIB_PREFIX/vendor_ruby]]]),
+ AS_HELP_STRING([--with-vendordir=DIR], [vendor libraries in DIR [[RUBY_LIB_PREFIX/vendor_ruby]], "no" to disable vendor directory]),
[vendordir=$withval],
[vendordir='${rubylibprefix}/vendor_ruby'])
dir="${vendordir}"
@@ -2831,21 +3208,21 @@ AS_CASE(["$RUBY_LIB_PREFIX"],
])
if test ${RUBY_LIB_VERSION_STYLE+set}; then
- AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION_STYLE, $RUBY_LIB_VERSION_STYLE)
+ AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION_STYLE, $RUBY_LIB_VERSION_STYLE !<verconf>!)
else
- AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION, [$RUBY_LIB_VERSION])
+ AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION, [$RUBY_LIB_VERSION] !<verconf>!)
fi
AC_DEFINE_UNQUOTED(RUBY_EXEC_PREFIX, "${RUBY_EXEC_PREFIX}")
-AC_DEFINE_UNQUOTED(RUBY_LIB_PREFIX, ${RUBY_LIB_PREFIX})
+AC_DEFINE_UNQUOTED(RUBY_LIB_PREFIX, ${RUBY_LIB_PREFIX} !<verconf>!)
if test "x$SITE_DIR" = xno; then
- AC_DEFINE(NO_RUBY_SITE_LIB)
+ AC_DEFINE(NO_RUBY_SITE_LIB, [] !<verconf>!)
else
- AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, ${RUBY_SITE_LIB_PATH})
+ AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, ${RUBY_SITE_LIB_PATH} !<verconf>!)
fi
if test "x$VENDOR_DIR" = xno; then
- AC_DEFINE(NO_RUBY_VENDOR_LIB)
+ AC_DEFINE(NO_RUBY_VENDOR_LIB, [] !<verconf>!)
else
- AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB, ${RUBY_VENDOR_LIB_PATH})
+ AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB, ${RUBY_VENDOR_LIB_PATH} !<verconf>!)
fi
AC_SUBST(arch)dnl
@@ -2863,7 +3240,7 @@ if test "${universal_binary-no}" = yes ; then
AC_TRY_COMPILE([const char arch[] = __ARCHITECTURE__;], [puts(arch);],
[rb_cv_architecture_available=yes], [rb_cv_architecture_available=no]))
if test "${rb_cv_architecture_available}" = yes; then
- AC_DEFINE_UNQUOTED(RUBY_PLATFORM_CPU, __ARCHITECTURE__)
+ AC_DEFINE_UNQUOTED(RUBY_PLATFORM_CPU, __ARCHITECTURE__ !<verconf>!)
else
for archs in ${universal_archnames}; do
cpu=`echo $archs | sed 's/.*=//'`
@@ -2871,28 +3248,28 @@ if test "${universal_binary-no}" = yes ; then
RUBY_DEFINE_IF([defined __${archs}__], RUBY_PLATFORM_CPU, ["${cpu}"])
done
fi
- ints='long int'
+ ints='long int short'
test "$ac_cv_type_long_long" = yes && ints="'long long' $ints"
AC_SUBST(UNIVERSAL_ARCHNAMES, "${universal_archnames}")
AC_SUBST(UNIVERSAL_INTS, "${ints}")
- AC_DEFINE_UNQUOTED(RUBY_PLATFORM_OS, "${target_os}")
- AC_DEFINE_UNQUOTED(RUBY_ARCH, "universal-"RUBY_PLATFORM_OS)
- AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS)
+ AC_DEFINE_UNQUOTED(RUBY_PLATFORM_OS, "${target_os}" !<verconf>!)
+ AC_DEFINE_UNQUOTED(RUBY_ARCH, "universal-"RUBY_PLATFORM_OS !<verconf>!)
+ AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS !<verconf>!)
else
arch="${target_cpu}-${target_os}"
- AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "${arch}")
+ AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "${arch}" !<verconf>!)
fi
unset sitearch
AS_CASE(["$target_os"],[mingw*],[sitearch="$target_cpu-$rb_cv_msvcrt"])
-test ${sitearch+set} && AC_DEFINE_UNQUOTED(RUBY_SITEARCH, "${sitearch}")
+test ${sitearch+set} && AC_DEFINE_UNQUOTED(RUBY_SITEARCH, "${sitearch}" !<verconf>!)
: ${sitearch='${arch}'}
AC_ARG_WITH(search-path,
AS_HELP_STRING([--with-search-path=DIR], [specify the additional search path]),
[search_path=$withval])
if test "$search_path" != ""; then
- AC_DEFINE_UNQUOTED(RUBY_SEARCH_PATH,"$search_path")
+ AC_DEFINE_UNQUOTED(RUBY_SEARCH_PATH,"$search_path" !<verconf>!)
fi
AC_ARG_WITH(rubyhdrdir,
@@ -2914,9 +3291,6 @@ AC_SUBST(rubyhdrdir)dnl
AC_SUBST(sitehdrdir)dnl
AC_SUBST(vendorhdrdir)dnl
-AC_ARG_WITH(opt-dir,
- AS_HELP_STRING([--with-opt-dir=DIR], [add optional headers and libraries DIR]))
-
AC_ARG_WITH(mantype,
AS_HELP_STRING([--with-mantype=TYPE], [specify man page type; TYPE is one of man and doc]),
[
@@ -2952,10 +3326,11 @@ guard=INCLUDE_RUBY_CONFIG_H
{
echo "#ifndef $guard"
echo "#define $guard 1"
- grep -v "^#define PACKAGE_" confdefs.h
+ grep -v "^#define PACKAGE_" confdefs.h | grep -v ' !<verconf>!$'
echo "#endif /* $guard */"
} | tr -d '\015' |
${srcdir}/tool/ifchange "${config_h}" -
+sed -n 's/ !<verconf>!$//p' confdefs.h | ${srcdir}/tool/ifchange verconf.h -
tr -d '\015' < largefile.h > confdefs.h
rm largefile.h
@@ -2985,20 +3360,25 @@ AC_MSG_RESULT($PACKAGE library version = $ruby_version)
AS_CASE([" $CPP "], [*" $CC "*], [CPP=`echo " $CPP " | sed "s| $CC |"' $(CC) |;s/^ *//;s/ *$//'`])
AC_CONFIG_FILES($FIRSTMAKEFILE)
-AC_CONFIG_FILES(Makefile, [{
- if test -d "$srcdir/.svn"; then
+AC_CONFIG_FILES(Makefile, [
+ tmpmk=confmk$$.tmp
+ {
+ if test ${VCS+set}; then
+ :
+ elif svn info "$srcdir" > /dev/null 2>&1; then
VCS='svn'
- VCSUP='$(VCS) up $(SVNUPOPTIONS)'
elif test -d "$srcdir/.git/svn"; then
VCS='git svn'
- VCSUP='$(VCS) rebase $(GITSVNREBASEOPTIONS)'
elif test -d "$srcdir/.git"; then
VCS='git'
- VCSUP='$(VCS) pull $(GITPULLOPTIONS)'
else
VCS='echo cannot'
- VCSUP='$(VCS)'
fi
+ AS_CASE("$VCS",
+ [svn], [VCSUP='$(VCS) up $(SVNUPOPTIONS)'],
+ ["git svn"], [VCSUP='$(VCS) rebase $(GITSVNREBASEOPTIONS)'],
+ [git], [VCSUP='$(VCS) pull $(GITPULLOPTIONS)'],
+ [VCSUP='$(VCS)'])
sed '/^MISSING/s/\$U\././g;/^VCS *=/s#@VCS@#'"$VCS"'#;/^VCSUP *=/s#@VCSUP@#'"$VCSUP"'#' Makefile
echo; test x"$EXEEXT" = x || echo 'miniruby: miniruby$(EXEEXT)'
if test "$gnumake" != yes; then
@@ -3007,15 +3387,26 @@ AC_CONFIG_FILES(Makefile, [{
else
echo 'distclean-local::; @$(RM) GNUmakefile uncommon.mk'
fi
- } > confmk$$.tmp && mv -f confmk$$.tmp Makefile &&
- {
- grep '^ruby:' Makefile > /dev/null ||
- ${MAKE-make} info-program | grep '^PROGRAM=ruby$' > /dev/null ||
- echo 'ruby: $(PROGRAM);' >> Makefile
- }],
+ } > $tmpmk && if ! grep '^ruby:' $tmpmk > /dev/null; then
+ if test "${gnumake}" = yes; then
+ tmpgmk=confgmk$$.tmp
+ {
+ echo "include $tmpmk"
+ echo "-include uncommon.mk"
+ } > $tmpgmk
+ else
+ tmpgmk=$tmpmk
+ fi &&
+ test -z "`${MAKE-make} -f $tmpgmk info-program | grep '^PROGRAM=ruby$'`" &&
+ echo 'ruby: $(PROGRAM);' >> $tmpmk
+ test "$tmpmk" = "$tmpgmk" || rm -f "$tmpgmk"
+ fi && mv -f $tmpmk Makefile],
[EXEEXT='$EXEEXT' gnumake='$gnumake'])
-ruby_pc="${RUBY_BASE_NAME}-${MAJOR}.${MINOR}.pc"
+AC_ARG_WITH([ruby-pc],
+ AC_HELP_STRING([pc file basename]),
+ [ruby_pc="$withval"],
+ [ruby_pc="${RUBY_BASE_NAME}-${MAJOR}.${MINOR}.pc"])
AC_SUBST(ruby_pc)
AC_SUBST(exec, [exec])
@@ -3035,5 +3426,5 @@ AC_CONFIG_FILES($ruby_pc:template/ruby.pc.in,
[ruby_pc='$ruby_pc' PKG_CONFIG='$PKG_CONFIG'])
AC_OUTPUT
-dnl }
-dnl }
+}
+}
diff --git a/constant.h b/constant.h
index 8232910737..9354241961 100644
--- a/constant.h
+++ b/constant.h
@@ -19,6 +19,8 @@ typedef enum {
typedef struct rb_const_entry_struct {
rb_const_flag_t flag;
VALUE value; /* should be mark */
+ VALUE file;
+ int line;
} rb_const_entry_t;
VALUE rb_mod_private_constant(int argc, VALUE *argv, VALUE obj);
diff --git a/cont.c b/cont.c
index 9092061bcc..084ea3edc6 100644
--- a/cont.c
+++ b/cont.c
@@ -15,7 +15,7 @@
#include "gc.h"
#include "eval_intern.h"
-#if ((defined(_WIN32) && _WIN32_WINNT >= 0x0400) || defined(HAVE_SETCONTEXT)) && !defined(__NetBSD__) && !defined(sun) && !defined(FIBER_USE_NATIVE)
+#if ((defined(_WIN32) && _WIN32_WINNT >= 0x0400) || (defined(HAVE_GETCONTEXT) && defined(HAVE_SETCONTEXT))) && !defined(__NetBSD__) && !defined(__sun) && !defined(FIBER_USE_NATIVE)
#define FIBER_USE_NATIVE 1
/* FIBER_USE_NATIVE enables Fiber performance improvement using system
@@ -47,8 +47,13 @@
#define RB_PAGE_SIZE (pagesize)
#define RB_PAGE_MASK (~(RB_PAGE_SIZE - 1))
static long pagesize;
-#define FIBER_MACHINE_STACK_ALLOCATION_SIZE (0x10000)
-#endif
+
+ #if SIZEOF_VOIDP==8
+ #define FIBER_MACHINE_STACK_ALLOCATION_SIZE (0x20000)
+ #else
+ #define FIBER_MACHINE_STACK_ALLOCATION_SIZE (0x10000)
+ #endif
+#endif /*FIBER_USE_NATIVE*/
#define CAPTURE_JUST_VALID_VM_STACK 1
@@ -103,6 +108,12 @@ typedef struct rb_fiber_struct {
enum fiber_status status;
struct rb_fiber_struct *prev_fiber;
struct rb_fiber_struct *next_fiber;
+ /* If a fiber invokes "transfer",
+ * then this fiber can't "resume" any more after that.
+ * You shouldn't mix "transfer" and "resume".
+ */
+ int transfered;
+
#if FIBER_USE_NATIVE
#ifdef _WIN32
void *fib_handle;
@@ -139,6 +150,7 @@ cont_mark(void *ptr)
rb_context_t *cont = ptr;
rb_gc_mark(cont->value);
rb_thread_mark(&cont->saved_thread);
+ rb_gc_mark(cont->saved_thread.self);
if (cont->vm_stack) {
#ifdef CAPTURE_JUST_VALID_VM_STACK
@@ -323,6 +335,17 @@ fiber_memsize(const void *ptr)
return size;
}
+VALUE
+rb_obj_is_fiber(VALUE obj)
+{
+ if (rb_typeddata_is_kind_of(obj, &fiber_data_type)) {
+ return Qtrue;
+ }
+ else {
+ return Qfalse;
+ }
+}
+
static void
cont_save_machine_stack(rb_thread_t *th, rb_context_t *cont)
{
@@ -382,8 +405,8 @@ cont_save_thread(rb_context_t *cont, rb_thread_t *th)
cont->saved_thread.machine_stack_start = 0;
cont->saved_thread.machine_stack_end = 0;
#ifdef __ia64
- cont->saved_thread.machine_register_stack_start = 0
- cont->saved_thread.machine_register_stack_end = 0
+ cont->saved_thread.machine_register_stack_start = 0;
+ cont->saved_thread.machine_register_stack_end = 0;
#endif
}
@@ -447,7 +470,7 @@ cont_capture(volatile int *stat)
}
else {
*stat = 0;
- return cont->self;
+ return contval;
}
}
@@ -520,8 +543,9 @@ fiber_entry(void *arg)
/*
* FreeBSD require a first (i.e. addr) argument of mmap(2) is not NULL
* if MAP_STACK is passed.
+ * http://www.FreeBSD.org/cgi/query-pr.cgi?pr=158755
*/
-#if defined(MAP_STACK) && !defined(__FreeBSD__)
+#if defined(MAP_STACK) && !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
#define FIBER_STACK_FLAGS (MAP_PRIVATE | MAP_ANON | MAP_STACK)
#else
#define FIBER_STACK_FLAGS (MAP_PRIVATE | MAP_ANON)
@@ -668,10 +692,9 @@ cont_restore_1(rb_context_t *cont)
}
#endif
if (cont->machine_stack_src) {
- size_t i;
FLUSH_REGISTER_WINDOWS;
- for (i = 0; i < cont->machine_stack_size; i++)
- cont->machine_stack_src[i] = cont->machine_stack[i];
+ MEMCPY(cont->machine_stack_src, cont->machine_stack,
+ VALUE, cont->machine_stack_size);
}
#ifdef __ia64
@@ -741,7 +764,7 @@ cont_restore_0(rb_context_t *cont, VALUE *addr_in_prev_frame)
if (&space[0] > end) {
# ifdef HAVE_ALLOCA
volatile VALUE *sp = ALLOCA_N(VALUE, &space[0] - end);
- (void)sp;
+ space[0] = *sp;
# else
cont_restore_0(cont, &space[0]);
# endif
@@ -757,7 +780,7 @@ cont_restore_0(rb_context_t *cont, VALUE *addr_in_prev_frame)
if (&space[STACK_PAD_SIZE] < end) {
# ifdef HAVE_ALLOCA
volatile VALUE *sp = ALLOCA_N(VALUE, end - &space[STACK_PAD_SIZE]);
- (void)sp;
+ space[0] = *sp;
# else
cont_restore_0(cont, &space[STACK_PAD_SIZE-1]);
# endif
@@ -770,17 +793,17 @@ cont_restore_0(rb_context_t *cont, VALUE *addr_in_prev_frame)
cont_restore_1(cont);
}
#ifdef __ia64
-#define cont_restore_0(cont, vp) register_stack_extend((cont), (vp), (VALUE*)rb_ia64_bsp());
+#define cont_restore_0(cont, vp) register_stack_extend((cont), (vp), (VALUE*)rb_ia64_bsp())
#endif
/*
* Document-class: Continuation
*
- * Continuation objects are generated by <code>Kernel#callcc</code>,
- * after having <code>require</code>d <i>continuation</i>. They hold
+ * Continuation objects are generated by Kernel#callcc,
+ * after having +require+d <i>continuation</i>. They hold
* a return address and execution context, allowing a nonlocal return
* to the end of the <code>callcc</code> block from anywhere within a
- * program. Continuations are somewhat analogous to a structured
+ * program. Continuations are somewhat analogous to a structured
* version of C's <code>setjmp/longjmp</code> (although they contain
* more state, so you might consider them closer to threads).
*
@@ -826,15 +849,15 @@ cont_restore_0(rb_context_t *cont, VALUE *addr_in_prev_frame)
* call-seq:
* callcc {|cont| block } -> obj
*
- * Generates a <code>Continuation</code> object, which it passes to
+ * Generates a Continuation object, which it passes to
* the associated block. You need to <code>require
* 'continuation'</code> before using this method. Performing a
- * <em>cont</em><code>.call</code> will cause the <code>callcc</code>
+ * <em>cont</em><code>.call</code> will cause the #callcc
* to return (as will falling through the end of the block). The
- * value returned by the <code>callcc</code> is the value of the
+ * value returned by the #callcc is the value of the
* block, or the value passed to <em>cont</em><code>.call</code>. See
- * class <code>Continuation</code> for more details. Also see
- * <code>Kernel::throw</code> for an alternative mechanism for
+ * class Continuation for more details. Also see
+ * Kernel#throw for an alternative mechanism for
* unwinding a call stack.
*/
@@ -906,6 +929,9 @@ rb_cont_call(int argc, VALUE *argv, VALUE contval)
cont->argc = argc;
cont->value = make_passing_arg(argc, argv);
+ /* restore `tracing' context. see [Feature #4347] */
+ th->trace_running = cont->saved_thread.trace_running;
+
cont_restore_0(cont, &contval);
return Qnil; /* unreachable */
}
@@ -1035,10 +1061,11 @@ fiber_init(VALUE fibval, VALUE proc)
th->cfp--;
th->cfp->pc = 0;
th->cfp->sp = th->stack + 1;
- th->cfp->bp = 0;
- th->cfp->lfp = th->stack;
- *th->cfp->lfp = 0;
- th->cfp->dfp = th->stack;
+#if VM_DEBUG_BP_CHECK
+ th->cfp->bp_check = 0;
+#endif
+ th->cfp->ep = th->stack;
+ *th->cfp->ep = VM_ENVVAL_BLOCK_PTR(0);
th->cfp->self = Qnil;
th->cfp->flag = 0;
th->cfp->iseq = 0;
@@ -1075,20 +1102,19 @@ return_fiber(void)
{
rb_fiber_t *fib;
VALUE curr = rb_fiber_current();
+ VALUE prev;
GetFiberPtr(curr, fib);
- if (fib->prev == Qnil) {
- rb_thread_t *th = GET_THREAD();
+ prev = fib->prev;
+ if (NIL_P(prev)) {
+ const VALUE root_fiber = GET_THREAD()->root_fiber;
- if (th->root_fiber != curr) {
- return th->root_fiber;
- }
- else {
+ if (root_fiber == curr) {
rb_raise(rb_eFiberError, "can't yield from root fiber");
}
+ return root_fiber;
}
else {
- VALUE prev = fib->prev;
fib->prev = Qnil;
return prev;
}
@@ -1133,21 +1159,21 @@ rb_fiber_start(void)
argv = (argc = cont->argc) > 1 ? RARRAY_PTR(args) : &args;
cont->value = Qnil;
th->errinfo = Qnil;
- th->local_lfp = proc->block.lfp;
- th->local_svar = Qnil;
+ th->root_lep = rb_vm_ep_local_ep(proc->block.ep);
+ th->root_svar = Qnil;
fib->status = RUNNING;
- cont->value = rb_vm_invoke_proc(th, proc, proc->block.self, argc, argv, 0);
+ cont->value = rb_vm_invoke_proc(th, proc, argc, argv, 0);
}
TH_POP_TAG();
if (state) {
if (state == TAG_RAISE) {
- th->thrown_errinfo = th->errinfo;
+ rb_threadptr_async_errinfo_enque(th, th->errinfo);
}
else {
- th->thrown_errinfo =
- rb_vm_make_jump_tag_but_local_jump(state, th->errinfo);
+ VALUE err = rb_vm_make_jump_tag_but_local_jump(state, th->errinfo);
+ rb_threadptr_async_errinfo_enque(th, err);
}
RUBY_VM_SET_INTERRUPT(th);
}
@@ -1204,10 +1230,10 @@ fiber_store(rb_fiber_t *next_fib)
#if !FIBER_USE_NATIVE
cont_save_machine_stack(th, &fib->cont);
+#endif
- if (ruby_setjmp(fib->cont.jmpbuf)) {
-#else /* FIBER_USE_NATIVE */
- {
+ if (FIBER_USE_NATIVE || ruby_setjmp(fib->cont.jmpbuf)) {
+#if FIBER_USE_NATIVE
fiber_setcontext(next_fib, fib);
#ifndef _WIN32
if (terminated_machine_stack.ptr) {
@@ -1252,6 +1278,13 @@ fiber_switch(VALUE fibval, int argc, VALUE *argv, int is_resume)
GetFiberPtr(fibval, fib);
cont = &fib->cont;
+ if (th->fiber == fibval) {
+ /* ignore fiber context switch
+ * because destination fiber is same as current fiber
+ */
+ return make_passing_arg(argc, argv);
+ }
+
if (cont->saved_thread.self != th->self) {
rb_raise(rb_eFiberError, "fiber called across threads");
}
@@ -1289,6 +1322,10 @@ fiber_switch(VALUE fibval, int argc, VALUE *argv, int is_resume)
if (is_resume) {
fib->prev = rb_fiber_current();
}
+ else {
+ /* restore `tracing' context. see [Feature #4347] */
+ th->trace_running = cont->saved_thread.trace_running;
+ }
cont->argc = argc;
cont->value = make_passing_arg(argc, argv);
@@ -1300,7 +1337,7 @@ fiber_switch(VALUE fibval, int argc, VALUE *argv, int is_resume)
rb_bug("rb_fiber_resume: unreachable");
}
#endif
- RUBY_VM_CHECK_INTS();
+ RUBY_VM_CHECK_INTS(th);
return value;
}
@@ -1320,6 +1357,9 @@ rb_fiber_resume(VALUE fibval, int argc, VALUE *argv)
if (fib->prev != Qnil || fib->cont.type == ROOT_FIBER_CONTEXT) {
rb_raise(rb_eFiberError, "double resume");
}
+ if (fib->transfered != 0) {
+ rb_raise(rb_eFiberError, "cannot resume transferred Fiber");
+ }
return fiber_switch(fibval, argc, argv, 1);
}
@@ -1330,6 +1370,19 @@ rb_fiber_yield(int argc, VALUE *argv)
return rb_fiber_transfer(return_fiber(), argc, argv);
}
+void
+rb_fiber_reset_root_local_storage(VALUE thval)
+{
+ rb_thread_t *th;
+ rb_fiber_t *fib;
+
+ GetThreadPtr(thval, th);
+ if (th->root_fiber && th->root_fiber != th->fiber) {
+ GetFiberPtr(th->root_fiber, fib);
+ th->local_storage = fib->cont.saved_thread.local_storage;
+ }
+}
+
/*
* call-seq:
* fiber.alive? -> true or false
@@ -1385,11 +1438,41 @@ rb_fiber_m_resume(int argc, VALUE *argv, VALUE fib)
* You cannot resume a fiber that transferred control to another one.
* This will cause a double resume error. You need to transfer control
* back to this fiber before it can yield and resume.
+ *
+ * Example:
+ *
+ * fiber1 = Fiber.new do
+ * puts "In Fiber 1"
+ * Fiber.yield
+ * end
+ *
+ * fiber2 = Fiber.new do
+ * puts "In Fiber 2"
+ * fiber1.transfer
+ * puts "Never see this message"
+ * end
+ *
+ * fiber3 = Fiber.new do
+ * puts "In Fiber 3"
+ * end
+ *
+ * fiber2.resume
+ * fiber3.resume
+ *
+ * <em>produces</em>
+ *
+ * In fiber 2
+ * In fiber 1
+ * In fiber 3
+ *
*/
static VALUE
-rb_fiber_m_transfer(int argc, VALUE *argv, VALUE fib)
+rb_fiber_m_transfer(int argc, VALUE *argv, VALUE fibval)
{
- return rb_fiber_transfer(fib, argc, argv);
+ rb_fiber_t *fib;
+ GetFiberPtr(fibval, fib);
+ fib->transfered = 1;
+ return rb_fiber_transfer(fibval, argc, argv);
}
/*
diff --git a/cygwin/GNUmakefile.in b/cygwin/GNUmakefile.in
index 19d1727dd7..5bd414d786 100644
--- a/cygwin/GNUmakefile.in
+++ b/cygwin/GNUmakefile.in
@@ -1,5 +1,4 @@
include Makefile
--include uncommon.mk
ENABLE_SHARED=@ENABLE_SHARED@
DLLWRAP = @DLLWRAP@ --target=@target_os@ --driver-name="$(CC)"
@@ -30,6 +29,9 @@ else
endif
WPROGRAM = $(RUBYW_INSTALL_NAME)$(EXEEXT)
+
+-include uncommon.mk
+
SOLIBS := $(DLL_BASE_NAME).res.@OBJEXT@ $(SOLIBS)
EXTOBJS += $(if $(filter-out $(RUBYW_INSTALL_NAME),$(@:$(EXEEXT)=)),$(RUBY_INSTALL_NAME),$(@:$(EXEEXT)=)).res.$(OBJEXT)
RCFILES = $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(DLL_BASE_NAME).rc
diff --git a/debug.c b/debug.c
index dcc710bc4a..4909a45d17 100644
--- a/debug.c
+++ b/debug.c
@@ -12,7 +12,7 @@
#include "ruby/ruby.h"
#include "ruby/encoding.h"
#include "ruby/util.h"
-#include "debug.h"
+#include "vm_debug.h"
#include "eval_intern.h"
#include "vm_core.h"
#include "id.h"
@@ -32,8 +32,8 @@ const union {
RUBY_ENC_CODERANGE_7BIT = ENC_CODERANGE_7BIT,
RUBY_ENC_CODERANGE_VALID = ENC_CODERANGE_VALID,
RUBY_ENC_CODERANGE_BROKEN = ENC_CODERANGE_BROKEN,
- RUBY_FL_MARK = FL_MARK,
- RUBY_FL_RESERVED = FL_RESERVED,
+ RUBY_FL_RESERVED1 = FL_RESERVED1,
+ RUBY_FL_RESERVED2 = FL_RESERVED2,
RUBY_FL_FINALIZE = FL_FINALIZE,
RUBY_FL_TAINT = FL_TAINT,
RUBY_FL_UNTRUSTED = FL_UNTRUSTED,
diff --git a/defs/default_gems b/defs/default_gems
index 030d84f6f5..e73e383b26 100644
--- a/defs/default_gems
+++ b/defs/default_gems
@@ -1,7 +1,5 @@
-# gem versioning file [executable files under bin]
-rake lib/rake/version.rb [rake]
-rdoc lib/rdoc.rb [rdoc ri]
-minitest lib/minitest/unit.rb
-json ext/json/lib/json/version.rb
-io-console ext/io/console/io-console.gemspec
-bigdecimal ext/bigdecimal/bigdecimal.gemspec
+# gem base directory versioning file [executable files under bin]
+rake lib/rake lib/rake/version.rb [rake]
+rdoc lib/rdoc lib/rdoc.rb [rdoc ri]
+minitest lib/minitest lib/minitest/unit.rb
+json ext/json ext/json/lib/json/version.rb
diff --git a/dir.c b/dir.c
index 128e2c8c8f..4d7208692e 100644
--- a/dir.c
+++ b/dir.c
@@ -30,12 +30,7 @@
# define NAMLEN(dirent) strlen((dirent)->d_name)
#else
# define dirent direct
-# if !defined __NeXT__
-# define NAMLEN(dirent) (dirent)->d_namlen
-# else
-# /* On some versions of NextStep, d_namlen is always zero, so avoid it. */
-# define NAMLEN(dirent) strlen((dirent)->d_name)
-# endif
+# define NAMLEN(dirent) (dirent)->d_namlen
# if HAVE_SYS_NDIR_H
# include <sys/ndir.h>
# endif
@@ -49,6 +44,10 @@
# include "win32/dir.h"
# endif
#endif
+#if defined(__native_client__) && defined(NACL_NEWLIB)
+# include "nacl/dirent.h"
+# include "nacl/stat.h"
+#endif
#include <errno.h>
@@ -80,10 +79,13 @@ char *strchr(char*,char);
#define opendir(p) rb_w32_uopendir(p)
#endif
+#define rb_sys_fail_path(path) rb_sys_fail_str(path)
+
#define FNM_NOESCAPE 0x01
#define FNM_PATHNAME 0x02
#define FNM_DOTMATCH 0x04
#define FNM_CASEFOLD 0x08
+#define FNM_EXTGLOB 0x10
#if CASEFOLD_FILESYSTEM
#define FNM_SYSCASE FNM_CASEFOLD
#else
@@ -387,7 +389,7 @@ dir_initialize(int argc, VALUE *argv, VALUE dir)
{
struct dir_data *dp;
rb_encoding *fsenc;
- VALUE dirname, opt;
+ VALUE dirname, opt, orig;
static VALUE sym_enc;
if (!sym_enc) {
@@ -395,7 +397,7 @@ dir_initialize(int argc, VALUE *argv, VALUE dir)
}
fsenc = rb_filesystem_encoding();
- argc = rb_scan_args(argc, argv, "1:", &dirname, &opt);
+ rb_scan_args(argc, argv, "1:", &dirname, &opt);
if (!NIL_P(opt)) {
VALUE enc = rb_hash_aref(opt, sym_enc);
@@ -405,7 +407,9 @@ dir_initialize(int argc, VALUE *argv, VALUE dir)
}
GlobPathValue(dirname, FALSE);
+ orig = rb_str_dup_frozen(dirname);
dirname = rb_str_encode_ospath(dirname);
+ dirname = rb_str_dup_frozen(dirname);
TypedData_Get_Struct(dir, struct dir_data, &dir_data_type, dp);
if (dp->dir) closedir(dp->dir);
@@ -419,10 +423,10 @@ dir_initialize(int argc, VALUE *argv, VALUE dir)
dp->dir = opendir(RSTRING_PTR(dirname));
}
if (dp->dir == NULL) {
- rb_sys_fail(RSTRING_PTR(dirname));
+ rb_sys_fail_path(orig);
}
}
- dp->path = rb_str_dup_frozen(dirname);
+ dp->path = orig;
return dir;
}
@@ -486,8 +490,12 @@ dir_inspect(VALUE dir)
TypedData_Get_Struct(dir, struct dir_data, &dir_data_type, dirp);
if (!NIL_P(dirp->path)) {
- const char *c = rb_obj_classname(dir);
- return rb_sprintf("#<%s:%s>", c, RSTRING_PTR(dirp->path));
+ VALUE str = rb_str_new_cstr("#<");
+ rb_str_append(str, rb_class_name(CLASS_OF(dir)));
+ rb_str_cat2(str, ":");
+ rb_str_append(str, dirp->path);
+ rb_str_cat2(str, ">");
+ return str;
}
return rb_funcall(dir, rb_intern("to_s"), 0, 0);
}
@@ -581,13 +589,10 @@ dir_read(VALUE dir)
if (READDIR(dirp->dir, dirp->enc, &STRUCT_DIRENT(entry), dp)) {
return rb_external_str_new_with_enc(dp->d_name, NAMLEN(dp), dirp->enc);
}
- else if (errno == 0) { /* end of stream */
- return Qnil;
- }
else {
- rb_sys_fail(0);
+ if (errno != 0) rb_sys_fail(0);
+ return Qnil; /* end of stream */
}
- return Qnil; /* not reached */
}
/*
@@ -754,9 +759,8 @@ dir_close(VALUE dir)
static void
dir_chdir(VALUE path)
{
- path = rb_str_encode_ospath(path);
if (chdir(RSTRING_PTR(path)) < 0)
- rb_sys_fail(RSTRING_PTR(path));
+ rb_sys_fail_path(path);
}
static int chdir_blocking = 0;
@@ -837,6 +841,7 @@ dir_s_chdir(int argc, VALUE *argv, VALUE obj)
rb_secure(2);
if (rb_scan_args(argc, argv, "01", &path) == 1) {
FilePathValue(path);
+ path = rb_str_encode_ospath(path);
}
else {
const char *dist = getenv("HOME");
@@ -854,9 +859,8 @@ dir_s_chdir(int argc, VALUE *argv, VALUE obj)
if (rb_block_given_p()) {
struct chdir_data args;
- char *cwd = my_getcwd();
- args.old_path = rb_tainted_str_new2(cwd); xfree(cwd);
+ args.old_path = rb_str_encode_ospath(rb_dir_getwd());
args.new_path = path;
args.done = FALSE;
return rb_ensure(chdir_yield, (VALUE)&args, chdir_restore, (VALUE)&args);
@@ -901,14 +905,21 @@ dir_s_getwd(VALUE dir)
static void
check_dirname(volatile VALUE *dir)
{
+ VALUE d = *dir;
char *path, *pend;
+ long len;
+ rb_encoding *enc;
rb_secure(2);
- FilePathValue(*dir);
- path = RSTRING_PTR(*dir);
- if (path && *(pend = rb_path_end(rb_path_skip_prefix(path)))) {
- *dir = rb_str_new(path, pend - path);
+ FilePathValue(d);
+ enc = rb_enc_get(d);
+ RSTRING_GETMEM(d, path, len);
+ pend = path + len;
+ pend = rb_enc_path_end(rb_enc_path_skip_prefix(path, pend, enc), pend, enc);
+ if (pend - path < len) {
+ d = rb_str_subseq(d, 0, pend - path);
}
+ *dir = rb_str_encode_ospath(d);
}
#if defined(HAVE_CHROOT)
@@ -925,10 +936,8 @@ static VALUE
dir_s_chroot(VALUE dir, VALUE path)
{
check_dirname(&path);
-
- path = rb_str_encode_ospath(path);
if (chroot(RSTRING_PTR(path)) == -1)
- rb_sys_fail(RSTRING_PTR(path));
+ rb_sys_fail_path(path);
return INT2FIX(0);
}
@@ -965,9 +974,8 @@ dir_s_mkdir(int argc, VALUE *argv, VALUE obj)
}
check_dirname(&path);
- path = rb_str_encode_ospath(path);
if (mkdir(RSTRING_PTR(path), mode) == -1)
- rb_sys_fail(RSTRING_PTR(path));
+ rb_sys_fail_path(path);
return INT2FIX(0);
}
@@ -985,9 +993,8 @@ static VALUE
dir_s_rmdir(VALUE obj, VALUE dir)
{
check_dirname(&dir);
- dir = rb_str_encode_ospath(dir);
if (rmdir(RSTRING_PTR(dir)) < 0)
- rb_sys_fail(RSTRING_PTR(dir));
+ rb_sys_fail_path(dir);
return INT2FIX(0);
}
@@ -1125,10 +1132,9 @@ find_dirsep(const char *p, const char *pend, int flags, rb_encoding *enc)
}
/* Remove escaping backslashes */
-static void
-remove_backslashes(char *p, rb_encoding *enc)
+static char *
+remove_backslashes(char *p, register const char *pend, rb_encoding *enc)
{
- register const char *pend = p + strlen(p);
char *t = p;
char *s = p;
@@ -1147,6 +1153,8 @@ remove_backslashes(char *p, rb_encoding *enc)
if (t != s)
memmove(t, s, p - s); /* move '\0' too */
+
+ return p;
}
/* Globing pattern */
@@ -1165,6 +1173,7 @@ glob_make_pattern(const char *p, const char *e, int flags, rb_encoding *enc)
{
struct glob_pattern *list, *tmp, **tail = &list;
int dirsep = 0; /* pattern is terminated with '/' */
+ int recursive = 0;
while (p < e && *p) {
tmp = GLOB_ALLOC(struct glob_pattern);
@@ -1175,13 +1184,14 @@ glob_make_pattern(const char *p, const char *e, int flags, rb_encoding *enc)
tmp->type = RECURSIVE;
tmp->str = 0;
dirsep = 1;
+ recursive = 1;
}
else {
const char *m = find_dirsep(p, e, flags, enc);
int magic = has_magic(p, m, flags, enc);
char *buf;
- if (!magic && *m) {
+ if (!magic && !recursive && *m) {
const char *m2;
while (!has_magic(m+1, m2 = find_dirsep(m+1, e, flags, enc), flags, enc) &&
*m2) {
@@ -1238,23 +1248,22 @@ glob_free_pattern(struct glob_pattern *list)
}
static char *
-join_path(const char *path, int dirsep, const char *name)
+join_path(const char *path, int dirsep, const char *name, size_t namlen)
{
long len = strlen(path);
- long len2 = strlen(name)+(dirsep?1:0)+1;
- char *buf = GLOB_ALLOC_N(char, len+len2);
+ char *buf = GLOB_ALLOC_N(char, len+namlen+(dirsep?1:0)+1);
if (!buf) return 0;
memcpy(buf, path, len);
if (dirsep) {
buf[len++] = '/';
}
- buf[len] = '\0';
- strlcat(buf+len, name, len2);
+ memcpy(buf+len, name, namlen);
+ buf[len+namlen] = '\0';
return buf;
}
-enum answer { YES, NO, UNKNOWN };
+enum answer {UNKNOWN = -1, NO, YES};
#ifndef S_ISDIR
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
@@ -1355,7 +1364,7 @@ glob_helper(
if (status) return status;
}
if (match_dir && isdir == YES) {
- char *tmp = join_path(path, dirsep, "");
+ char *tmp = join_path(path, dirsep, "", 0);
if (!tmp) return -1;
status = glob_call_func(func, tmp, arg, enc);
GLOB_FREE(tmp);
@@ -1373,15 +1382,24 @@ glob_helper(
if (dirp == NULL) return 0;
while (READDIR(dirp, enc, &STRUCT_DIRENT(entry), dp)) {
- char *buf = join_path(path, dirsep, dp->d_name);
+ char *buf;
enum answer new_isdir = UNKNOWN;
+ if (recursive && dp->d_name[0] == '.') {
+ /* RECURSIVE never match dot files unless FNM_DOTMATCH is set */
+ if (!(flags & FNM_DOTMATCH)) continue;
+
+ /* always skip current and parent directories not to recurse infinitely */
+ if (!dp->d_name[1]) continue;
+ if (dp->d_name[1] == '.' && !dp->d_name[2]) continue;
+ }
+
+ buf = join_path(path, dirsep, dp->d_name, NAMLEN(dp));
if (!buf) {
status = -1;
break;
}
- if (recursive && strcmp(dp->d_name, ".") != 0 && strcmp(dp->d_name, "..") != 0
- && fnmatch("*", rb_usascii_encoding(), dp->d_name, flags) == 0) {
+ if (recursive) {
#ifndef _WIN32
if (do_lstat(buf, &st, flags) == 0)
new_isdir = S_ISDIR(st.st_mode) ? YES : S_ISLNK(st.st_mode) ? UNKNOWN : NO;
@@ -1440,7 +1458,8 @@ glob_helper(
break;
}
memcpy(name, (*cur)->str, len);
- if (escape) remove_backslashes(name, enc);
+ if (escape)
+ len = remove_backslashes(name, name+len-1, enc) - name;
new_beg = new_end = GLOB_ALLOC_N(struct glob_pattern *, end - beg);
if (!new_beg) {
@@ -1456,7 +1475,7 @@ glob_helper(
}
}
- buf = join_path(path, dirsep, name);
+ buf = join_path(path, dirsep, name, len);
GLOB_FREE(name);
if (!buf) {
GLOB_FREE(new_beg);
@@ -1489,7 +1508,7 @@ ruby_glob0(const char *path, int flags, ruby_glob_func *func, VALUE arg, rb_enco
start = root = path;
flags |= FNM_SYSCASE;
#if defined DOSISH
- root = rb_path_skip_prefix(root);
+ root = rb_enc_path_skip_prefix(root, root + strlen(root), enc);
#endif
if (root && *root == '/') root++;
@@ -1765,7 +1784,7 @@ dir_s_aref(int argc, VALUE *argv, VALUE obj)
* <code>/ .* /x</code> in regexp. Note, this
* will not match Unix-like hidden files (dotfiles).
* In order to include those in the match results,
- * you must use something like "{*,.*}".
+ * you must use something like <code>"{*,.*}"</code>.
* <code>**</code>:: Matches directories recursively.
* <code>?</code>:: Matches any one character. Equivalent to
* <code>/.{1}/</code> in regexp.
@@ -1779,10 +1798,11 @@ dir_s_aref(int argc, VALUE *argv, VALUE obj)
* More than two literals may be specified.
* Equivalent to pattern alternation in
* regexp.
- * <code>\</code>:: Escapes the next metacharacter.
- * Note that this means you cannot use backslash in windows
- * as part of a glob, i.e. Dir["c:\\foo*"] will not work
- * use Dir["c:/foo*"] instead
+ * <code> \\ </code>:: Escapes the next metacharacter.
+ * Note that this means you cannot use backslash
+ * in windows as part of a glob,
+ * i.e. <code>Dir["c:\\foo*"]</code> will not work,
+ * use <code>Dir["c:/foo*"]</code> instead.
*
* Dir["config.?"] #=> ["config.h"]
* Dir.glob("config.?") #=> ["config.h"]
@@ -1837,9 +1857,8 @@ static VALUE
dir_open_dir(int argc, VALUE *argv)
{
VALUE dir = rb_funcall2(rb_cDir, rb_intern("open"), argc, argv);
- struct dir_data *dirp;
- TypedData_Get_Struct(dir, struct dir_data, &dir_data_type, dirp);
+ rb_check_typeddata(dir, &dir_data_type);
return dir;
}
@@ -1895,6 +1914,15 @@ dir_entries(int argc, VALUE *argv, VALUE io)
return rb_ensure(rb_Array, dir, dir_close, dir);
}
+static int
+fnmatch_brace(const char *pattern, VALUE val, void *enc)
+{
+ struct brace_args *arg = (struct brace_args *)val;
+ VALUE path = arg->value;
+
+ return (fnmatch(pattern, enc, RSTRING_PTR(path), arg->flags) == 0);
+}
+
/*
* call-seq:
* File.fnmatch( pattern, path, [flags] ) -> (true or false)
@@ -1911,7 +1939,7 @@ dir_entries(int argc, VALUE *argv, VALUE io)
* match all files beginning with
* <code>c</code>; <code>*c</code> will match
* all files ending with <code>c</code>; and
- * <code>*c*</code> will match all files that
+ * <code>\*c*</code> will match all files that
* have <code>c</code> in them (including at
* the beginning or end). Equivalent to
* <code>/ .* /x</code> in regexp.
@@ -1923,7 +1951,7 @@ dir_entries(int argc, VALUE *argv, VALUE io)
* Behaves exactly like character sets in
* Regexp, including set negation
* (<code>[^a-z]</code>).
- * <code>\</code>:: Escapes the next metacharacter.
+ * <code> \ </code>:: Escapes the next metacharacter.
*
* <i>flags</i> is a bitwise OR of the <code>FNM_xxx</code>
* parameters. The same glob pattern and flags are used by
@@ -1991,9 +2019,21 @@ file_s_fnmatch(int argc, VALUE *argv, VALUE obj)
StringValue(pattern);
FilePathStringValue(path);
- if (fnmatch(RSTRING_PTR(pattern), rb_enc_get(pattern), RSTRING_PTR(path),
- flags) == 0)
- return Qtrue;
+ if (flags & FNM_EXTGLOB) {
+ struct brace_args args;
+
+ args.value = path;
+ args.flags = flags;
+ if (ruby_brace_expand(RSTRING_PTR(pattern), flags, fnmatch_brace,
+ (VALUE)&args, rb_enc_get(pattern)) > 0)
+ return Qtrue;
+ }
+ else {
+ if (fnmatch(RSTRING_PTR(pattern), rb_enc_get(pattern), RSTRING_PTR(path),
+ flags) == 0)
+ return Qtrue;
+ }
+ RB_GC_GUARD(pattern);
return Qfalse;
}
@@ -2020,6 +2060,22 @@ dir_s_home(int argc, VALUE *argv, VALUE obj)
return rb_home_dir(u, rb_str_new(0, 0));
}
+#if 0
+/*
+ * call-seq:
+ * Dir.exist?(file_name) -> true or false
+ * Dir.exists?(file_name) -> true or false
+ *
+ * Returns <code>true</code> if the named file is a directory,
+ * <code>false</code> otherwise.
+ *
+ */
+VALUE
+rb_file_directory_p()
+{
+}
+#endif
+
/*
* Objects of class <code>Dir</code> are directory streams representing
* directories in the underlying file system. They provide a variety of
@@ -2068,8 +2124,8 @@ Init_Dir(void)
rb_define_singleton_method(rb_cDir,"glob", dir_s_glob, -1);
rb_define_singleton_method(rb_cDir,"[]", dir_s_aref, -1);
- rb_define_singleton_method(rb_cDir,"exist?", rb_file_directory_p, 1); /* in file.c */
- rb_define_singleton_method(rb_cDir,"exists?", rb_file_directory_p, 1); /* in file.c */
+ rb_define_singleton_method(rb_cDir,"exist?", rb_file_directory_p, 1);
+ rb_define_singleton_method(rb_cDir,"exists?", rb_file_directory_p, 1);
rb_define_singleton_method(rb_cFile,"fnmatch", file_s_fnmatch, -1);
rb_define_singleton_method(rb_cFile,"fnmatch?", file_s_fnmatch, -1);
@@ -2078,5 +2134,6 @@ Init_Dir(void)
rb_file_const("FNM_PATHNAME", INT2FIX(FNM_PATHNAME));
rb_file_const("FNM_DOTMATCH", INT2FIX(FNM_DOTMATCH));
rb_file_const("FNM_CASEFOLD", INT2FIX(FNM_CASEFOLD));
+ rb_file_const("FNM_EXTGLOB", INT2FIX(FNM_EXTGLOB));
rb_file_const("FNM_SYSCASE", INT2FIX(FNM_SYSCASE));
}
diff --git a/dln.c b/dln.c
index 961592d7b0..ed107551c7 100644
--- a/dln.c
+++ b/dln.c
@@ -75,7 +75,7 @@ void *xrealloc();
char *getenv();
#endif
-#if defined(__APPLE__) && defined(__MACH__) /* Mac OS X */
+#ifdef __APPLE__
# if defined(HAVE_DLOPEN)
/* Mac OS X with dlopen (10.3 or later) */
# define MACOSX_DLOPEN
@@ -228,7 +228,7 @@ load_header(int fd, struct exec *hdrp, long disp)
#define RELOC_TARGET_SIZE(r) ((r)->r_length)
#endif
-#if defined(sun) && defined(sparc)
+#if defined(__sun) && defined(__sparc)
/* Sparc (Sun 4) macros */
# undef relocation_info
# define relocation_info reloc_info_sparc
@@ -530,7 +530,7 @@ reloc_undef(int no, struct undef *undef, struct reloc_arg *arg)
{
int datum;
char *address;
-#if defined(sun) && defined(sparc)
+#if defined(__sun) && defined(__sparc)
unsigned int mask = 0;
#endif
@@ -539,7 +539,7 @@ reloc_undef(int no, struct undef *undef, struct reloc_arg *arg)
datum = arg->value;
if (R_PCREL(&(undef->reloc))) datum -= undef->base;
-#if defined(sun) && defined(sparc)
+#if defined(__sun) && defined(__sparc)
datum += undef->reloc.r_addend;
datum >>= R_RIGHTSHIFT(&(undef->reloc));
mask = (1 << R_BITSIZE(&(undef->reloc))) - 1;
@@ -763,7 +763,7 @@ load_1(int fd, long disp, const char *need_init)
while (rel < rel_end) {
char *address = (char*)(rel->r_address + block);
long datum = 0;
-#if defined(sun) && defined(sparc)
+#if defined(__sun) && defined(__sparc)
unsigned int mask = 0;
#endif
@@ -798,7 +798,7 @@ load_1(int fd, long disp, const char *need_init)
} /* end .. is static */
if (R_PCREL(rel)) datum -= block;
-#if defined(sun) && defined(sparc)
+#if defined(__sun) && defined(__sparc)
datum += rel->r_addend;
datum >>= R_RIGHTSHIFT(rel);
mask = (1 << R_BITSIZE(rel)) - 1;
@@ -1214,16 +1214,18 @@ rb_w32_check_imported(HMODULE ext, HMODULE mine)
while (desc->Name) {
PIMAGE_THUNK_DATA pint = (PIMAGE_THUNK_DATA)((char *)ext + desc->Characteristics);
PIMAGE_THUNK_DATA piat = (PIMAGE_THUNK_DATA)((char *)ext + desc->FirstThunk);
- while (piat->u1.Function) {
- PIMAGE_IMPORT_BY_NAME pii = (PIMAGE_IMPORT_BY_NAME)((char *)ext + (size_t)pint->u1.AddressOfData);
+ for (; piat->u1.Function; piat++, pint++) {
static const char prefix[] = "rb_";
- const char *name = (const char *)pii->Name;
+ PIMAGE_IMPORT_BY_NAME pii;
+ const char *name;
+
+ if (IMAGE_SNAP_BY_ORDINAL(pint->u1.Ordinal)) continue;
+ pii = (PIMAGE_IMPORT_BY_NAME)((char *)ext + (size_t)pint->u1.AddressOfData);
+ name = (const char *)pii->Name;
if (strncmp(name, prefix, sizeof(prefix) - 1) == 0) {
FARPROC addr = GetProcAddress(mine, name);
if (addr) return (FARPROC)piat->u1.Function == addr;
}
- piat++;
- pint++;
}
desc++;
}
@@ -1316,13 +1318,28 @@ dln_load(const char *file)
# define RTLD_GLOBAL 0
#endif
+#ifdef __native_client__
+ char* p, *orig;
+ if (file[0] == '.' && file[1] == '/') file+=2;
+ orig = strdup(file);
+ for (p = file; *p; ++p) {
+ if (*p == '/') *p = '_';
+ }
+#endif
/* Load file */
if ((handle = (void*)dlopen(file, RTLD_LAZY|RTLD_GLOBAL)) == NULL) {
+#ifdef __native_client__
+ free(orig);
+#endif
error = dln_strerror();
goto failed;
}
init_fct = (void(*)())(VALUE)dlsym(handle, buf);
+#ifdef __native_client__
+ strcpy(file, orig);
+ free(orig);
+#endif
#if defined __SYMBIAN32__
if (init_fct == NULL) {
init_fct = (void(*)())dlsym(handle, "1"); /* Some Symbian versions do not support symbol table in DLL, ordinal numbers only */
@@ -1383,7 +1400,7 @@ dln_load(const char *file)
}
#endif /* _AIX */
-#if defined(NeXT) || defined(MACOSX_DYLD)
+#if defined(MACOSX_DYLD)
#define DLN_DEFINED
/*----------------------------------------------------
By SHIROYAMA Takayuki Psi@fortune.nest.or.jp
@@ -1394,43 +1411,6 @@ dln_load(const char *file)
sunshine@sunshineco.com,
and... Miss ARAI Akino(^^;)
----------------------------------------------------*/
-#if defined(NeXT) && (NS_TARGET_MAJOR < 4)/* NeXTSTEP rld functions */
-
- {
- NXStream* s;
- unsigned long init_address;
- char *object_files[2] = {NULL, NULL};
-
- void (*init_fct)();
-
- object_files[0] = (char*)file;
-
- s = NXOpenFile(2,NX_WRITEONLY);
-
- /* Load object file, if return value ==0 , load failed*/
- if(rld_load(s, NULL, object_files, NULL) == 0) {
- NXFlush(s);
- NXClose(s);
- dln_loaderror("Failed to load %.200s", file);
- }
-
- /* lookup the initial function */
- if(rld_lookup(s, buf, &init_address) == 0) {
- NXFlush(s);
- NXClose(s);
- dln_loaderror("Failed to lookup Init function %.200s", file);
- }
-
- NXFlush(s);
- NXClose(s);
-
- /* Cannot call *init_address directory, so copy this value to
- function pointer */
- init_fct = (void(*)())init_address;
- (*init_fct)();
- return (void*)init_address;
- }
-#else/* OPENSTEP dyld functions */
{
int dyld_result;
NSObjectFileImage obj_file; /* handle, but not use it */
@@ -1457,7 +1437,6 @@ dln_load(const char *file)
return (void*)init_fct;
}
-#endif /* rld or dyld */
#endif
#if defined(__BEOS__) || defined(__HAIKU__)
diff --git a/dln_find.c b/dln_find.c
index 7ce3a957ed..d9166fac39 100644
--- a/dln_find.c
+++ b/dln_find.c
@@ -45,14 +45,6 @@ char *dln_argv0;
# include <strings.h>
#endif
-#ifndef xmalloc
-void *xmalloc();
-void *xcalloc();
-void *xrealloc();
-#endif
-
-#define free(x) xfree(x)
-
#include <stdio.h>
#if defined(_WIN32)
#include "missing/file.h"
diff --git a/dmydln.c b/dmydln.c
index 2c8aacc06a..25872efc98 100644
--- a/dmydln.c
+++ b/dmydln.c
@@ -4,4 +4,6 @@ void*
dln_load(const char *file)
{
rb_loaderror("this executable file can't load extension libraries");
+
+ UNREACHABLE;
}
diff --git a/dmyext.c b/dmyext.c
index 4d273f7faf..34ea7a02f4 100644
--- a/dmyext.c
+++ b/dmyext.c
@@ -2,3 +2,8 @@ void
Init_ext(void)
{
}
+
+void
+Init_enc(void)
+{
+}
diff --git a/doc/ChangeLog-1.9.3 b/doc/ChangeLog-1.9.3
index ef10d65db0..692b996335 100644
--- a/doc/ChangeLog-1.9.3
+++ b/doc/ChangeLog-1.9.3
@@ -1,3 +1,12154 @@
+Sun Jul 10 22:50:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (rmpd_power_by_big_decimal): fix
+ precision treatment errors.
+
+ * test/bigdecimal/test_bigdecimal.rb: add tests for the above change.
+ fix precision treatment errors.
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_power): precision argument
+ should be optional for its compatibility.
+
+Sun Jul 10 22:38:09 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (var_ref): distinguish vcall from local variable
+ references. based on a patch by Michael Edgar michael.j.edgar
+ AT dartmouth.edu. Bug #5002
+
+Sun Jul 10 21:51:29 2011 Koichi Sasada <ko1@atdot.net>
+
+ * internal.h: add comments (cautions).
+
+Sun Jul 10 20:59:38 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/test/unit.rb: Add new class variable `@@testfile_prefix`.
+ This is for changing test name prefix. (For testing)
+
+ * test/testunit/tests_for_parallel/ptest_first.rb: Renamed from
+ test_first.rb
+
+ * test/testunit/tests_for_parallel/ptest_second.rb: Renamed from
+ test_second.rb
+
+ * test/testunit/tests_for_parallel/ptest_third.rb: Renamed from
+ test_third.rb
+
+ * test/testunit/tests_for_parallel/ptest_forth.rb: Renamed from
+ test_forth.rb
+
+ * test/testunit/tests_for_parallel/runner.rb: Remove misc.rb
+
+ * test/testunit/tests_for_parallel/ptest_first.rb: ditto.
+
+ * test/testunit/tests_for_parallel/ptest_second.rb: ditto.
+
+ * test/testunit/tests_for_parallel/ptest_third.rb: ditto.
+
+ * test/testunit/tests_for_parallel/ptest_forth.rb: ditto.
+
+ * test/testunit/tests_for_parallel/misc.rb: Removed because no longer
+ needed.
+
+ * test/testunit/test_parallel.rb: Fix assertions for above.
+
+Sun Jul 10 16:57:08 2011 Koichi Sasada <ko1@atdot.net>
+
+ * vm_insnhelper.c (vm_throw): check a class frame.
+ Fixes Bug #4648.
+ The patch is contributed by Kazuki Tsujimoto.
+
+ * bootstraptest/test_proc.rb: add tests for above.
+
+Sun Jul 10 17:28:01 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c (mutex_debug): use exit(EXIT_FAILURE) instead of
+ exit(1).
+ * thread_pthread.c (add_signal_thread_list): ditto.
+ * thread.c (rb_thread_call_with_gvl): ditto.
+ * util.c (Bug): ditto.
+
+Sun Jul 10 15:58:12 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/json: Merge json gem 1.5.4+ (f7f78896607b6f6226cd).
+ [Bug #4700]
+
+Sun Jul 10 16:41:32 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * vm_core.h (typedef struct rb_vm_struct): create a new
+ 'inhibit_thread_creation' field.
+ * thread.c (rb_thread_terminate_all): set inhibit_thread_creation.
+ * thread.c (thread_s_new): don't permit to create new thread
+ if the VM is under destruction. Otherwise evil finalizer code
+ can make SEGV. [Bug #4992][ruby-core:37858]
+
+ * bootstraptest/test_objectspace.rb: new test for this fix.
+
+Sun Jul 10 16:06:16 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * signal.c (sigsegv): use abort() instead of exit() when nested
+ SEGV was happen. Because unnested SEGV use abort().
+ [Bug #5013][ruby-dev:44078]
+
+Sun Jul 10 15:30:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * load.c (rb_f_autoload): prevent to autoload for singleton
+ classes. fixes [Bug #4886] [ruby-dev:43816]
+
+ * bootstraptest/test_autoload.rb: add tests for the above change.
+
+Sun Jul 10 15:09:17 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/test/unit/assertions.rb: Import documentation patch by Justin
+ Collins. [ruby-core:37225] [Feature #4903]
+
+Sun Jul 10 14:57:36 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: canonicalizes nth and sf.
+
+Sun Jul 10 14:13:50 2011 Koichi Sasada <ko1@atdot.net>
+
+ * internal.h (rb_thread_call_with_gvl, rb_thread_call_without_gvl):
+ make them visible as experimental C APIs. fixes Feature #4328.
+
+Sun Jul 10 12:18:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_power): support non-integral
+ exponent. fixes [Bug #3271]
+
+ * ext/bigdecimal/bigdecimal.c (rmpd_power_by_big_decimal): ditto.
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_power_op): add a function to
+ only use for "**" operator.
+
+ * test/bigdecimal/test_bigdecimal.rb: add a bunch of tests for the
+ above changes.
+
+ * ext/bigdecimal/bigdecimal.c (is_integer): add an utility function.
+
+ * ext/bigdecimal/bigdecimal.c (is_negative): ditto.
+
+ * ext/bigdecimal/bigdecimal.c (is_positive): ditto.
+
+ * ext/bigdecimal/bigdecimal.c (is_zero): ditto.
+
+ * ext/bigdecimal/bigdecimal.c (is_one): ditto.
+
+ * ext/bigdecimal/bigdecimal.c (is_even): ditto.
+
+Sun Jul 10 12:08:39 2011 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * compile.c (when_vals): when a string literal is written on when
+ clause, skip string creation to make it faster. [ruby-dev:44068]
+ [Feature #5000]
+
+Sun Jul 10 11:35:29 2011 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * parse.y (reduce_nodes_gen): NODE_RETURN in rescue body must not be
+ reduced when there is an else clause. This caused bizarre behavior
+ in [Bug #4473] [ruby-core:35629] [ruby-core:37884].
+
+Sun Jul 10 09:46:14 2011 Masaya Tarui <tarui@ruby-lnag.org>
+
+ * range.c (range_max): fix behavior with excluded end value.
+ [Bug #4591]
+
+Sun Jul 10 09:13:18 2011 Eric Hodel <drbrain@segment7.net>
+
+ * NEWS: Fix RubyGems version. [Ruby 1.9 - Bug #5004]
+
+Sat Jul 9 20:01:59 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * internal.h: rb_rational_reciprocal is defined in rational.c.
+
+Sat Jul 9 19:48:31 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * internal.h: added declarations.
+ * complex.c: followed the above change.
+
+Sat Jul 9 17:24:41 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * NEWS: bigdecimal is not a builtin.
+
+Sat Jul 9 17:17:53 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: some improvements for performance.
+
+Sat Jul 9 16:56:01 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * atomic.h (ATOMIC_OR): _InterlockedOr is unavailable in VC6.
+
+ * numeric.c (ULLONG_MAX): fallback definition.
+
+Sat Jul 9 15:59:19 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_{read,write}): should be signed.
+ Bug #5001
+
+Sat Jul 9 14:02:20 2011 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
+
+ * lib/cgi/core.rb: fix multipart form parsing bug. [Bug #3866]
+
+Sat Jul 9 11:41:03 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/matrix.rb: Add Vector#normalize [ruby-dev:43829]
+
+Sat Jul 9 09:25:06 2011 Eric Hodel <drbrain@segment7.net>
+
+ * enumerator.c: Remove "enumeration sequenced by".
+ [Ruby 1.9 - Bug #4757]
+
+Sat Jul 9 09:14:56 2011 Eric Hodel <drbrain@segment7.net>
+
+ * io.c: Note that methods other than IO#gets may increase IO#lineno.
+ [Ruby 1.9 - Bug #4902]
+
+Sat Jul 9 08:39:39 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (RUN_OPT): disable gems.
+
+Sat Jul 9 08:37:05 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (rb_io_close): close(2) on a fd which is being read by
+ another thread causes deadlock on Mac OS X 10.5
+
+Fri Jul 8 21:20:39 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c: use USE_ELF instead of __ELF__ because Solaris
+ doesn't define it. USE_ELF is already provided by configure.
+ patched by Naohisa Goto. [ruby-dev:44066] [Bug #4998]
+
+ * addr2line.h: ditto.
+
+ * vm_dump.c: ditto.
+
+Fri Jul 8 16:40:38 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/json/parser/parser.rl (convert_encoding): should not modify
+ the argument.
+
+ * ext/json/parser/parser.rl (convert_encoding): no needs to use
+ force_encoding.
+
+Fri Jul 8 15:53:31 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * error.c (rb_bug): get rid of segfault after all threads
+ disposed.
+
+Fri Jul 8 15:01:06 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/openssl/ossl.h: include openssl/e_os2.h before checking the
+ definition of OPENSSL_SYS_WIN32.
+
+Fri Jul 8 14:40:39 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (wunlink): reverted a part of r32426. it was mistakenly
+ mixed.
+
+Fri Jul 8 14:29:47 2011 Narihiro Nakamura <authornari@gmail.com>
+
+ * configure.in: can't subtract void *.
+
+Fri Jul 8 14:33:26 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/Makefile.sub (config.h): define GC_MARK_STACKFRAME_WORD.
+ fixed build problem of r32438. the value (30) is temporary value.
+ maybe it's enough by 20~24 according to my observation.
+
+Fri Jul 8 13:47:39 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_mutex_unlock_all): folded into
+ rb_threadptr_unlock_all_locking_mutexes.
+ * thread.c (rb_threadptr_unlock_all_locking_mutexes) ditto.
+
+Fri Jul 8 13:36:02 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (thread_unlock_all_locking_mutexes): rename to
+ rb_threadptr_unlock_all_locking_mutexes and remove static.
+ * vm_core.h: add rb_threadptr_unlock_all_locking_mutexes declaration.
+ * thread.c (thread_start_func_2): adjust the above rename.
+
+ * eval.c (ruby_cleanup): call rb_threadptr_unlock_all_locking_mutexes
+ again after finalizer. [Bug #4988] [ruby-dev:44049]
+
+Fri Jul 8 13:06:09 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * cont.c (FIBER_MACHINE_STACK_ALLOCATION_SIZE): Fiber stack size
+ don't need to keep multiple number of sizeof(VALUE).
+
+Fri Jul 8 11:39:12 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (sudo-precheck): true command is not standard on
+ Windows.
+
+Fri Jul 8 10:39:52 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c (gvl_destroy): fix cond_t leak.
+
+Fri Jul 8 09:17:59 2011 Eric Hodel <drbrain@segment7.net>
+
+ * gc.c: Improve documentation
+
+Thu Jul 7 23:35:31 2011 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c: change water_mark value that may call
+ gc_mark(lev <= GC_LEVEL_MAX) in gc_mark().
+ In ruby_stack_check(), water_mark is a value that may call some
+ C function. Fixes Bug #3781
+
+ * configure.in: define GC_MARK_STACKFRAME_WORD that approximate
+ size of gc_mark() and gc_mark_children() stackframes.
+
+Thu Jul 7 17:55:05 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/testunit/test_parallel.rb (TestParallelWorker#teardown): wait
+ the child process even if the communication pipe is broken.
+
+Thu Jul 7 15:44:42 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * encoding.c (rb_enc_set_index, rb_enc_associate_index): should
+ check if frozen.
+
+ * parse.y (rb_intern3), ruby.c (process_options, ruby_script):
+ defer freezing after associating encodings.
+
+Thu Jul 7 15:16:51 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * numeric.c (rb_num2ull): use own switch sentence.
+ Current implementation can't convert 18446744073709551615.
+
+Thu Jul 7 06:56:15 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * cont.c (FIBER_STACK_FLAGS): workaround fix for r32420 on FreeBSD.
+
+Thu Jul 7 06:46:12 2011 Eric Hodel <drbrain@segment7.net>
+
+ * benchmark/driver.rb: Add difference column to report that averages
+ across all runs of a benchmark. [Ruby 1.9 - Feature #4982]
+
+Thu Jul 7 06:19:38 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems.rb: Reduce requires to improve `make benchmark`.
+ [#4962]
+ * lib/rubygems/specification.rb: Delay initialization of rubygems
+ until require is called.
+
+Thu Jul 7 04:31:26 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (arg): rescue_mod is in inverse order from other
+ modifiers. patched by michael.j.edgar AT dartmouth.edu at
+ [ruby-core:36248]. fixed #4716.
+
+Thu Jul 7 00:40:16 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (kill): check that the process exited or not before
+ terminating it. [Bug #4943]
+
+Wed Jul 6 23:13:19 2011 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * parse.y (opt_call_args): allow trailing comma after assoc
+ argument e.g. 'foo(bar:1,)'. fixed #3456
+
+Wed Jul 6 22:11:12 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * test/cgi/test_cgi_header.rb(test_cgi_header_nph): Validate date in
+ "Date:" header
+
+Wed Jul 6 21:29:33 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * cont.c (fiber_machine_stack_alloc): cleanup pointer arithmetic.
+ "size/sizeof(VALUE)" is ugly and easy confusing.
+ * cont.c (fiber_initialize_machine_stack_context): ditto.
+
+Wed Jul 6 21:24:53 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * cont.c (fiber_machine_stack_alloc): fix mprotect misuse. A stack
+ guard page should have PROT_NONE.
+ * cont.c (fiber_initialize_machine_stack_context):
+ th->machine_stack_maxsize shouldn't be included guard pages size.
+ [Bug #4983][ruby-dev:44043]
+
+Wed Jul 6 21:23:38 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * cont.c (fiber_machine_stack_alloc): use MAP_STACK if it's provided.
+
+Wed Jul 6 21:22:16 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * cont.c (fiber_machine_stack_alloc): use MAP_FAILED instead of -1.
+
+Wed Jul 6 21:21:05 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * cont.c (fiber_machine_stack_alloc): remove unnecessary cast.
+
+Wed Jul 6 18:10:13 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * test/cgi/test_cgi_header.rb(test_cgi_header_nph): Adding space after
+ comma.
+
+ * test/cgi/test_cgi_header.rb(test_cgi_header_nph): Remove variable
+ `now`. Suppress warning.
+
+Wed Jul 6 12:18:09 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * test/cgi/test_cgi_header.rb(test_cgi_header_nph): Fix bug depends to
+ time. The test fails if time past 1 second in line 136-145
+
+Tue Jul 5 15:28:04 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_here_document): should dispatch heredoc_end
+ scanner event on an empty here document. fixed Bug#4543.
+
+Tue Jul 5 13:49:26 2011 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * addr2line.c: fix r32407 to check HAVE_ALLOCA_H.
+
+Tue Jul 5 14:05:43 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/webrick/httpauth/digestauth.rb (_authenticate):
+ Literal texts in HTTP ABNF is case-insensitive (RFC2616 2.1),
+ and a sample implementation in RFC2617 also ignores the case
+ of algorithms. So now this ignores those cases.
+ [ruby-dev:43965] [Feature #4936]
+
+ * lib/webrick/httpauth/digestauth.rb (initialize):
+ Because of above, opera_hack is useless and removed.
+
+Tue Jul 5 01:30:01 2011 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * thread_pthread.c (native_sleep): cut the waiting time up to
+ 100,000,000 because Solaris cond_timedwait() return EINVAL if an
+ argument is greater than current_time + 100,000,000. This is
+ considered as a kind of spurious wakeup. The caller to native_sleep
+ should care about spurious wakeup.
+
+Tue Jul 5 01:24:26 2011 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * cont.c: disable FIBER_USE_NATIVE on Solaris because resuming any
+ Fiber caused SEGV. I haven't follow up the issue deeply, but it
+ works when disabling the feature.
+
+Tue Jul 5 01:22:46 2011 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * addr2line.c: include <alloca.h> to fix a build issue on Solaris.
+
+Tue Jul 5 00:49:05 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * ext/coverage/coverage.c: resurrect r32071 + add GC guard for
+ rb_coverages. [ruby-core:37352] [Bug #4927]
+ [ruby-core:36539] [Feature #4796]
+
+ * test/coverage/test_coverage.rb resurrect r32071.
+
+Mon Jul 4 22:24:46 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c (get_stack): For NetBSD/FreeBSD, use
+ pthread_attr_getstack() if possible. and, remove an assumption
+ of stack growing direction.
+
+Mon Jul 4 20:42:31 2011 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * ext/coverage/coverage.c: revert r32071. The commit caused SEGV on
+ some minor nonfree OS. I have no means of debugging the bug. My
+ personal opinion is that such OS should be unsupported unless there
+ is an active maintainer. [ruby-core:37352]
+
+ * test/coverage/test_coverage.rb: ditto.
+
+Mon Jul 4 07:14:12 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * thread_pthread.c (get_stack): the return address of get_stack
+ must be the highest address of the current thread's stack.
+
+Mon Jul 4 06:37:22 2011 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/intern.h, thread_pthread.c (rb_reserved_fd_p,
+ RB_RESERVED_FD_P): added. This C API is to limit to access
+ fds which are used by RubyVM internal. In this version of
+ CRuby, return 1 if fd is communication pipe.
+ If your application needs to close all file descriptors to
+ present resource leak, skip internal fds using this C API.
+ We also define a macro RB_RESERVED_FD_P(fd). So you can write
+ #ifndef RB_RESERVED_FD_P
+ #define RB_RESERVED_FD_P(fd) 0
+ #endif
+ for Ruby 1.9.2 or previous version to write compatible extensions.
+ See [ruby-core:37727]
+
+ * thread_win32.c (rb_reserved_fd_p): added (return 0 for any fds).
+
+ * io.c (rb_io_initialize): raise ArgumentError if given fd is reserved by Ruby.
+
+Sun Jul 3 23:43:56 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * ext/extmk.rb (extmake): suppresses outputs from extconf.rb.
+ (extmake) warns a failure in extconf.rb.
+
+Sun Jul 3 13:44:51 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (ary_reject_bang): should not remove elements which are
+ not yielded. [Bug #2545]
+
+Sun Jul 3 06:10:26 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c (get_stack): pthread_attr_getstack() doesn't
+ return stack start address, but stack base address. Thus,
+ we need to add stack size for getting stack start address.
+ And, we don't have to decrease guard size twice.
+ * thread_pthread.c (thread_start_func_1): don't use inaccurate
+ stack start guess if native_thread_init_stack() can be used.
+ [Bug #1813] [ruby-core:24540]
+
+Sun Jul 3 04:50:08 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c (get_stack): add to a care of guard page on Mac
+ OS X. [Bug #1813] [ruby-core:24540]
+ * signal.c (ruby_signal): SIGBUS use alternative stack too.
+ * signal.c (sigbus): On Mac, thread stack overflow makes SIGBUS
+ instead of SIGSEGV. thus, added stackoverflow check.
+ * signal.c (default_handler): get rid of compilation warning.
+ * signal.c (Init_signal): ditto.
+
+Sat Jul 02 08:59:20 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * test/openssl/test_ocsp.rb
+ * test/openssl/test_x509_cert.rb: Perform SHA-256 tests only if
+ supported by the available OpenSSL version. Versions < 0.9.8 don't
+ support it. [ruby-core:37724]
+
+Sat Jul 2 07:17:45 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_ary_reject_bang, rb_ary_delete_if): rejected
+ elements should be removed. fixed [Bug #2545]
+
+Sat Jul 2 01:57:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * NEWS: remove a description of Kernel#respond_to? because it has
+ been reverted at revision 28564.
+
+Sat Jul 2 00:58:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * NEWS: describe a change of multiplication of Bignum.
+
+Fri Jul 1 18:52:31 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * benchmark/bm_app_erb.rb: increase loop count. too short
+ measurement time makes less accuracy.
+ * benchmark/bm_app_factorial.rb: ditto.
+ * benchmark/bm_app_mandelbrot.rb: ditto.
+ * benchmark/bm_app_strconcat.rb: ditto.
+
+ * benchmark/bm_io_file_create.rb: ditto.
+ * benchmark/bm_io_file_read.rb: ditto.
+ * benchmark/bm_io_file_write.rb: ditto.
+
+ * benchmark/bm_so_concatenate.rb: ditto.
+ * benchmark/bm_so_lists.rb: ditto.
+ * benchmark/bm_so_matrix.rb: ditto.
+ * benchmark/bm_so_random.rb: ditto.
+ * benchmark/bm_so_sieve.rb: ditto.
+
+ * benchmark/bm_vm_thread_mutex1.rb: ditto.
+ * benchmark/bm_vm_thread_mutex2.rb: ditto.
+ * benchmark/bm_vm_thread_mutex3.rb: ditto.
+
+ * benchmark/bm_vm1_block.rb: cleanup.
+ * benchmark/bm_vm1_const.rb: cleanup.
+ * benchmark/bm_vm1_ensure.rb: cleanup.
+ * benchmark/bm_vm1_ivar.rb: cleanup.
+ * benchmark/bm_vm1_length.rb: cleanup.
+ * benchmark/bm_vm1_neq.rb: cleanup.
+ * benchmark/bm_vm1_not.rb: cleanup.
+ * benchmark/bm_vm1_rescue.rb: cleanup.
+ * benchmark/bm_vm1_simplereturn.rb: cleanup.
+ * benchmark/bm_vm1_swap.rb: cleanup.
+
+ * benchmark/bm_vm2_array.rb: cleanup.
+ * benchmark/bm_vm2_case.rb: cleanup.
+ * benchmark/bm_vm2_defined_method.rb: cleanup.
+ * benchmark/bm_vm2_eval.rb: cleanup.
+ * benchmark/bm_vm2_method.rb: cleanup.
+ * benchmark/bm_vm2_mutex.rb: cleanup.
+ * benchmark/bm_vm2_poly_method.rb: cleanup.
+ * benchmark/bm_vm2_poly_method_ov.rb: cleanup.
+ * benchmark/bm_vm2_proc.rb: cleanup.
+ * benchmark/bm_vm2_regexp.rb: cleanup.
+ * benchmark/bm_vm2_send.rb: cleanup.
+ * benchmark/bm_vm2_super.rb: cleanup.
+ * benchmark/bm_vm2_unif1.rb: cleanup.
+ * benchmark/bm_vm2_zsuper.rb: cleanup.
+
+ * benchmark/bm_vm_thread_alive_check1.rb: cleanup.
+
+Fri Jul 1 15:23:00 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/matrix: Add LUP decomposition
+
+Fri Jul 1 15:21:14 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/matrix.rb: Allow non integer exponents for Matrix#**
+
+Fri Jul 1 15:13:25 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/matrix: Add Eigenvalue Decomposition
+
+Fri Jul 1 15:10:22 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/matrix: Add Matrix#round
+
+Fri Jul 1 11:41:12 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (tr_trans): free heap ptr when the str is not embedded.
+ patched by Eric Wong. [Bug #4956] [ruby-core:37708]
+
+Fri Jul 1 11:07:43 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (do_select): fix memory leak.
+ Patch by Eric Wong. Thank you! [Bug #4953] [ruby-core:37702]
+
+Fri Jul 1 08:21:28 2011 Koichi Sasada <ko1@atdot.net>
+
+ * vm_insnhelper.c (vm_getivar): check vm state version
+ to invalidate inline cache (ivar index).
+ fixes Bug #4926.
+
+ * vm_insnhelper.c (vm_setivar): ditto.
+
+Fri Jul 1 08:03:15 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * error.c, thread_pthread.c (WRITE_CONST): suppress warnings
+ `ignoring return value'.
+
+Fri Jul 1 06:41:36 2011 Koichi Sasada <ko1@atdot.net>
+
+ * thread.c (rb_threadptr_check_signal): only wake up main thread.
+
+ * thread.c (rb_threadptr_execute_interrupts_common): check signal
+ delivery if it is main thread.
+ fixes [ruby-dev:44005] [Ruby 1.9 - Bug #4950]
+
+ * bootstraptest/test_fork.rb: add a test for above.
+
+ * signal.c (rb_get_next_signal): skip if signal_buff is empty.
+ (check signal_buff.size first)
+
+ * vm_core.h: remove unused variable rb_thread_t::exec_signal.
+
+ * thread.c (rb_thread_check_trap_pending): check
+ rb_signal_buff_size() because rb_thread_t::exec_signal
+ is no longer available.
+
+Fri Jul 1 03:28:25 2011 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * class.c (Init_class_hierarchy): should name BasicObject
+ explicitly.
+
+ * variable.c (rb_const_defined_0): should not check for
+ superclasses as const_get.
+
+Fri Jul 1 03:24:03 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: mathn is still alive (should die soon).
+
+Thu Jun 30 23:50:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * misc/ruby-mode.el (ruby-indent-beg-re): Fix broken regular
+ expression. Fixes #4546
+
+Thu Jun 30 23:43:30 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl.c/.h: Added ossl_x509_name_sk2ary.
+ * ext/openssl/ossl.c: Replaced ossl_x509_ary2k by generic macro to
+ simplify future conversions.
+ * ext/openssl/ossl_ssl.c: Implement SSLSocket#client_ca.
+ * test/openssl/test_ssl.rb: Add test for SSLSocket#client_ca.
+ Thanks to Ippei Obayashi for providing the patch!
+ [ Ruby 1.9 - Feature #4481 ] [ruby-core:35461]
+
+Thu Jun 30 22:38:58 2011 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/bm_vm2_defined_method.rb: added to measure performance of
+ bmethod (method defined by define_method()).
+
+Thu Jun 30 22:17:04 2011 Koichi Sasada <ko1@atdot.net>
+
+ * vm_insnhelper.c (vm_call_bmethod): fix to hook call/return event
+ for methods defined by define_method(). fixes Bug #4613.
+
+ * thread.c (call_trace_proc): Fix to skip if class is not given (0).
+ Note that ID and Class object are passed for call/return event
+ if the called method was defined by define_method().
+ If you are author of tracer/profiler/debugger, this may be an
+ important change. You should check passed class as zero or
+ non-zero instead of checking the event type.
+
+ * test/ruby/test_settracefunc.rb: add a test for above.
+
+Thu Jun 30 21:18:35 2011 Yutaka Kanemoto <kanemoto@ruby-lang.org>
+
+ * configure.in: Add warnflags for XL/C on AIX during configure
+ to avoid [Bug #3971]. See [ruby-core:32859]
+
+Thu Jun 30 21:16:04 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c (m_ajd): refers a constant.
+
+Thu Jun 30 20:54:25 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/io/console/io-console.gemspec: spin-off gem for 1.9.2.
+
+Thu Jun 30 20:36:23 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: trivial changes.
+
+Thu Jun 30 20:12:36 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/ruby/test_module.rb: tests for [Bug #3422] and [Bug #3423].
+
+Thu Jun 30 20:03:39 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: modified doc.
+
+Thu Jun 30 19:09:19 2011 Koichi Sasada <ko1@atdot.net>
+
+ * thread_pthread.c (thread_timer): ignore unknown errno.
+ (we observed that select(2) was canceled by errno=514 on
+ boron == Linux/Xen environment)
+
+Thu Jun 30 17:33:25 2011 Koichi Sasada <ko1@atdot.net>
+
+ * ext/objspace/objspace.c (ObjectSpace.count_tdata_objects):
+ Fix rdoc. Fixes Bug #3892.
+
+ * ext/objspace/objspace.c (ObjectSpace.count_tdata_objects):
+ Change key type if the klass of a object is zero (internal object).
+ Read rdoc for details.
+
+ * internal.h: export rb_objspace_data_type_name().
+
+Thu Jun 30 17:25:08 2011 Koichi Sasada <ko1@atdot.net>
+
+ * thread_pthread.c (ping_signal_thread_list, thread_timer):
+ fix to keep polling state if there are any ping-tasks.
+
+Thu Jun 30 12:25:34 2011 Koichi Sasada <ko1@atdot.net>
+
+ * thread_pthread.c (rb_thread_create_timer_thread): allocate
+ machine stack for the timer thread at least 12KB. FreeBSD 8.2
+ AMD64 causes machine stack overflow (SIGSEGV) only with
+ PTHREAD_STACK_MIN (maybe defined as 2KB).
+
+Thu Jun 30 09:36:37 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/weakref.rb: Attach documentation to WeakRef and add missing
+ documentation
+
+Thu Jun 30 09:30:14 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/yaml.rb: Document toplevel YAML and YAML::ENGINE to describe
+ Psych vs Syck engines.
+
+Thu Jun 30 09:21:52 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/cmath.rb: Hide handle_no_method_error from RDoc.
+ * error.c: Document or hide undocumented error classes.
+
+Thu Jun 30 07:49:04 2011 Eric Hodel <drbrain@segment7.net>
+
+ * hash.c: Document ENV
+
+Thu Jun 30 06:37:43 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby.c (ruby_init_loadpath_safe): ensure RUBYLIB_PREFIX stored
+ before RUBYLIB, even if MANGLED_PATH is enabled. fixed #1679.
+ MANGLED_PATH is disabled by the default and will be removed
+ completely in the future.
+
+Thu Jun 30 06:32:21 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/drb/drb.rb: Hide deprecated toplevel DRb constants.
+
+Thu Jun 30 06:17:02 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/cmath.rb (CMath.log): second argument: b can be nil.
+
+Thu Jun 30 06:23:28 2011 Eric Hodel <drbrain@segment7.net>
+
+ * thread.c (ruby_thread_s_pass): Fix typo.
+
+Thu Jun 30 06:16:53 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc: Update to RDoc 3.8 which contains fixes for documentation
+ in trunk.
+
+Thu Jun 30 02:53:26 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_threadptr_execute_interrupts_common): remove
+ meaningless native_thread_yield(). It never close a race.
+
+Thu Jun 30 02:41:47 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_thread_schedule_limits): minor optimization.
+ eliminate machine context saving when running time is enough small.
+
+Thu Jun 30 02:28:11 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_thread_schedule_rec): move interrupt_flag check to
+ rb_thread_schedule().
+ And also rename to rb_thread_schedule_limits() and remove
+ sched_depth argument. It's no longer called recursive.
+ * thread.c (rb_thread_schedule): add to check interrupt_flag as
+ above explained.
+
+ * thread.c (rb_threadptr_execute_interrupts_rec): rename to
+ rb_threadptr_execute_interrupts_common() and remove sched_depth
+ argument. It's no longer called recursive.
+
+ * thread.c (rb_thread_sleep): adapt the renaming.
+ * thread.c (rb_threadptr_execute_interrupts): ditto.
+ * thread.c (rb_thread_execute_interrupts): ditto.
+
+Thu Jun 30 01:31:33 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (thread_s_pass): change RDoc description and remove
+ a sample code. The actual implementation never behave as explained by
+ an example. It's a documentation bug.
+
+Thu Jun 30 00:54:33 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_thread_stop): change RDoc sample code. The old
+ example is buggy and may cause deadlock. The patch is
+ suggested by Heesob Park <phasis@gmail.com>. Thank you!
+ [Bug #3606][ruby-core:31454]
+
+Thu Jun 30 00:49:53 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_thread_wakeup): change RDoc sample code. The old
+ example is buggy and may not display anything by a race.
+ The patch is suggested by Heesob Park <phasis@gmail.com>.
+ Thank you! [Bug #3606][ruby-core:31454]
+
+Thu Jun 30 00:43:33 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_thread_run): change RDoc. The old example is buggy
+ and may cause deadlock. The patch is suggested by Heesob Park
+ <phasis@gmail.com>. Thank you! [Bug #3606][ruby-core:31454]
+
+Thu Jun 30 00:30:15 2011 Keiju Ishitsuka <keiju@ishitsuka.com>
+
+ * lib/cmath.rb: make same exception for Math. fix [Bug #3137].
+
+Thu Jun 30 00:03:20 2011 Keiju Ishitsuka <keiju@ishitsuka.com>
+
+ * lib/irb/completion.rb: complement correctly string literal. fix
+ [Bug #1145].
+
+Wed Jun 29 23:42:51 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: avoided using timev.
+ * ext/date/date_strftime.c: ditto.
+ * ext/date/date_tmx.h: ditto.
+
+Wed Jun 29 23:17:57 2011 WATANABE Hirofumi <eban@ruby-lang.org>
+
+ * ext/openssl/ossl.h (OPENSSL_SYS_WIN32): support for mingw(msys).
+
+Wed Jun 29 23:09:14 2011 WATANABE Hirofumi <eban@ruby-lang.org>
+
+ * ext/tk/extconf.rb (intptr_t, uintptr_t): support for the latest ActiveTcl with mingw.
+
+Wed Jun 29 22:49:10 2011 Keiju Ishitsuka <keiju@ishitsuka.com>
+
+ * lib/irb/cmd/help.rb: support RDoc 3.7. fix [Bug #3760].
+
+Wed Jun 29 22:04:14 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * lib/tracer.rb: Tracer.on only if required by -r command-line option.
+ and consider --disable-gems option.
+ * test/test_tracer.rb: add tests for it.
+
+Wed Jun 29 13:55:36 2011 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * variable.c (rb_const_get_0): should not look for superclasses if
+ the second optional argument is given for #const_get().
+ fix [Bug #3422] [Bug #3423]
+
+Wed Jun 29 12:07:27 2011 Eric Hodel <drbrain@segment7.net>
+
+ * math.c: Attach documentation for Math.
+ * object.c: Document NIL, TRUE, FALSE.
+ * io.c: Improve grammar in ARGF comment. Document STDIN/OUT/ERR.
+ Document ARGF global constant.
+ * lib/rake: Hide deprecated toplevel constants from RDoc (import from
+ rake trunk).
+ * lib/thwait.rb: Document ThWait.
+ * lib/mathn.rb: Hide Math redefinition from RDoc
+ * lib/sync.rb: Add a basic comment for Sync_m, Synchronizer_m, Sync,
+ Synchronizer.
+ * parse.y: Document SCRIPT_LINES__.
+ * hash.c: Document ENV class and global constant.
+ * vm.c: Document TOPLEVEL_BINDING.
+ * version.c: Document RUBY_* constants.
+ * ruby.c: Document DATA and ARGV.
+
+Wed Jun 29 10:13:12 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/matrix.rb: Matrix.zero can build rectangular matrices.
+ Vector#r should be called #magnitude
+
+Wed Jun 29 10:11:08 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/matrix.rb: Add Matrix#diagonal?, hermitian?, normal?,
+ orthogonal?
+ permutation?, symmetric?, {lower|upper}triangular?, unitary?, zero?
+
+Wed Jun 29 10:09:35 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/matrix.rb: Specialize Matrix#find_index to return [row, col]
+ and accept the same optional argument as #each
+
+Wed Jun 29 10:07:32 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/matrix.rb: Matrix#each{_with_index} can iterate over a subset
+ of the Matrix
+
+Wed Jun 29 06:21:02 2011 Koichi Sasada <ko1@atdot.net>
+
+ * thread_pthread.c (native_stop_timer_thread): skip to close
+ communication pipe to avoid timing bug (process termination timing).
+ The communication pipe will closed by OS.
+
+Wed Jun 29 06:09:54 2011 Koichi Sasada <ko1@atdot.net>
+
+ * error.c (rb_async_bug_errno): async-safe bug report function.
+ In timer thread, signal handler should use it.
+ The patch is contributed by Eric Wong <normalperson@yhbt.net>.
+ Refs: [ruby-core:37644] and [ruby-core:37647]
+
+ * thread_pthread.c: use rb_async_bug_errno().
+ And replace all fprintf() to write().
+
+ * internal.h (rb_async_bug_errno): add decl. of above func.
+
+Tue Jun 28 23:46:08 2011 Keiju Ishitsuka <keiju@ishitsuka.com>
+
+ * lib/tracer.rb: count only non-internal libraries in stack trace,
+ ignoring custom_require.
+
+Tue Jun 28 21:44:58 2011 Keiju Ishitsuka <keiju@ishitsuka.com>
+
+ * lib/irb/ruby-lex.rb: recognize '\char' in ruby statement.
+
+Tue Jun 28 20:39:29 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * lib/debug.rb (var_list): Command 'var *' did not work on 1.9(!).
+ global_variables, local_variables, and instance_variables returns
+ Symbols from 1.9 and need to stringify before evaling it.
+ See #4931.
+
+Tue Jun 28 19:23:01 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * signal.c: Now, USE_TRAP_SIGMASK depend on HAVE_PTHREAD_SIGMASK.
+ The code have already depended on pthread_sigmask since r27464.
+
+Tue Jun 28 15:09:21 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/benchmark.rb: merge eregon/benchmark.
+ https://github.com/eregon/ruby/tree/benchmark
+ patched by Benoit Daloze. [ruby-core:37593] [Bug #4940]
+
+ * lib/benchmark (Benchmark#bmbm): bmbm should be consistent with bm
+ for the return value.
+
+ * test/benchmark: remove preemptive test instead of skipping
+ I removed the preemptive test I wrote for Feature #4197.
+ I'll add it back when the implementation will be able to satisfy it.
+
+ * lib/benchmark (Benchmark#bmbm): remove useless explicit call,
+ #format is an alias of #to_s test/benchmark: add a test for
+ format of long time.
+
+ * lib/benchmark: fix label width: always add 1 to ensure there is a
+ space delimiter even with times over 100s
+ When I asked for Feature #4197, I wanted to make delimiting spaces
+ consistent for #bm and #bmbm.
+ But with times over 100s, the output contains no space between the
+ label and the first time (user).
+ Now both ensure there is always a space, even if that means 3 spaces
+ with times under 10s (because it is formatted as %10.6f)
+
+ * test/benchmark: let labels be a constant
+ lib/benchmark (Benchmark#realtime): avoid creating an unused Proc
+ lib/benchmark (Benchmark#benchmark): use ensure clause to restore
+ STDOUT.sync, as in #bmbm
+
+Tue Jun 28 13:41:51 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * thread_win32.c (native_stop_timer_thread): fixed commit miss of
+ r32244. grep sources before changing the signature of a function.
+
+Tue Jun 28 11:49:14 2011 Koichi Sasada <ko1@atdot.net>
+
+ * thread_pthread.c (consume_communication_pipe):
+ Make "buff" as static. (Maybe) "buff" can be shared between
+ any caller (any threads) because no one use the read values.
+ "buff" (1024 byte) on stack may cause stack overflow on
+ several environment (we found a crash on FreeBSD).
+ And remove const value "buff_size", and define CCP_READ_BUFF_SIZE
+ macro.
+
+Tue Jun 28 11:45:30 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rake: Update rake to fix some bugs and hide deprecated features
+ from RDoc.
+ * lib/rake/version.rb: Bump version to 0.9.2.1 to distinguish it from
+ the released version.
+ * NEWS: ditto
+
+Tue Jun 28 11:17:28 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc: Update to RDoc 3.7 (final)
+ * NEWS: ditto
+
+Tue Jun 28 10:18:42 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * process.c (rb_daemon): fix wrong #endif position.
+
+Tue Jun 28 07:50:32 2011 Eric Hodel <drbrain@segment7.net>
+
+ * object.c (Init_Object): Teach RDoc what Init_class_hierarchy does to
+ hook up ri for BasicObject, Object, Module and Class.
+
+Tue Jun 28 05:03:32 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * thread.c (rb_thread_local_aref): RDoc fix. Thread#[] example
+ had a race. See #4480.
+
+Tue Jun 28 01:22:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (BigMath_s_log): move BigMath.log from
+ bigdecimal/math.rb.
+
+ * ext/bigdecimal/lib/bigdecimal/math.rb: ditto.
+
+ * test/bigdecimal/test_bigdecimal.rb: move test for BigMath.log from
+ test/bigdecimal/test_bigmath.rb.
+
+ * test/bigdecimal/test_bigmath.rb: ditto.
+
+Tue Jun 28 01:19:52 2011 Keiju Ishitsuka <keiju@ishitsuka.com>
+
+ * lib/irb/ruby-lex.rb: fix [Bug #4232].
+
+Tue Jun 28 00:14:13 2011 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+
+ * lib/drb/drb.rb: fix [Bug #4409]. add DRbServer#here?.
+
+ * test/drb/test_drb.rb: ditto.
+
+ * test/drb/drbtest.rb: ditto.
+
+ * test/drb/ut_eq.rb: ditto.
+
+Tue Jun 28 00:08:43 2011 Keiju Ishitsuka <keiju@ishitsuka.com>
+
+ * lib/irb/workspace.rb: fix BUG#4793.
+
+Mon Jun 27 22:06:12 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c (consume_communication_pipe): don't use C99
+ style variable length array.
+
+Mon Jun 27 22:04:27 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c (consume_communication_pipe): change return
+ type to void. caller doesn't use it.
+
+Mon Jun 27 21:29:50 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.h (rb_global_vm_lock_struct): add volatile to
+ gvl->waiting. now thread_timer() access it w/o lock.
+
+Mon Jun 27 21:16:11 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c: s/__gvl_acquire/gvl_acquire_common/ and
+ s/__gvl_release/gvl_release_common/.
+
+Mon Jun 27 11:41:47 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * thread_pthread.c (rb_thread_create_timer_thread):
+ the type of return value of write(2) is ssize_t.
+
+Mon Jun 27 09:57:02 2011 Koichi Sasada <ko1@atdot.net>
+
+ * thread_pthread.c (rb_thread_create_timer_thread):
+ Fixes missing initialization of oflags.
+
+Mon Jun 27 09:07:42 2011 Koichi Sasada <ko1@atdot.net>
+
+ * thread_pthread.c: Stop polling in the timer thread when there are
+ no waiting thread. If there are 2 or more runnable threads,
+ the timer thread does polling. Avoid polling makes power save
+ for several computers (0.2W per a Ruby process, when I measured).
+ If outside-event such as signal or Thread#kill was occurred
+ when the timer thread does not do polling, then wake-up
+ the timer thread using communication-pipe (the timer thread
+ waits this communication-pipe with select(2)).
+ The discussion about this modification can be found from the post
+ [ruby-core:33456] and other related posts.
+ Note that Eric Wong and KOSAKI Motohiro give us the huge
+ contributions for this modification. Thanks.
+
+ * thread_pthread.c (rb_thread_wakeup_timer_thread): add a function.
+ This function wakes up the timer thread using communication-pipe.
+
+ * thread.c (rb_thread_stop_timer_thread): add a parameter which
+ specify closing communication-pipe or not.
+
+ * thread.c (rb_thread_terminate_all): do not stop timer thread here
+ (ruby_cleanup() terminate timer thread).
+
+ * signal.c: wake up timer thread using
+ rb_thread_wakeup_timer_thread() from signal handler.
+
+ * eval.c (ruby_cleanup): use rb_thread_stop_timer_thread(1).
+
+ * process.c: use rb_thread_stop_timer_thread(0)
+ (reuse communication-pipe).
+
+ * thread_win32.c (rb_thread_wakeup_timer_thread): add a dummy
+ function.
+
+ * vm_core.h: add and fix decl. of functions.
+
+Mon Jun 27 08:01:19 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_parse.c: should use ALLOCA_N.
+
+Mon Jun 27 01:34:18 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/etc/test_etc.rb (TestEtc#test_get{pw,gr}nam): skip entries
+ start with + sign, which means NIS. these are returned in the
+ case that passwd and group entries in /etc/nsswitch.conf are set
+ to use "nis" explicitly on Debian. fixed #3683
+
+Mon Jun 27 00:44:53 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * parse.y (rb_parser_end_seen_p): fix documentation about return
+ value. patched by Sho Hashimoto. [Bug #4511]
+
+Mon Jun 27 00:40:47 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * hash.c (rb_hash_reject): add documentation that Hash#reject
+ without block returns enumerator.
+ patched by Michael Edgar [Bug #4847] [ruby-core:36800]
+
+Sun Jun 26 23:49:21 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * test/date/test_switch_hitter.rb: added a test.
+
+ Sun Jun 26 22:21:23 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: refactoring.
+
+Sun Jun 26 18:03:30 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * parse.y: comma at the end of line is no longer allowed.
+ A patch from Yukihiro Matsumoto <matz AT ruby-lang.org>.
+ (fixed #3456).
+
+Sun Jun 26 13:35:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * vm_dump.c (rb_vm_bugreport): change CrashReporter suggestion messages
+ on Mac. It should be placed after "-- C level backtrace" line.
+ Suggested by Endoh-san.
+
+ <before>
+ -- See Crash Report log file under ~/Library/Logs/CrashReporter or ---------
+ -- /Library/Logs/CrashReporter, for the more detail of ---------------------
+ -- C level backtrace information -------------------------------------------
+
+ <after>
+ -- C level backtrace information -------------------------------------------
+
+ See Crash Report log file under ~/Library/Logs/CrashReporter or
+ /Library/Logs/CrashReporter, for the more detail of.
+
+Sun Jun 26 10:08:28 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/extconf.rb
+ * ext/openssl/ossl_missing.h/.c: add ASN1_put_eoc if missing.
+
+ * ext/openssl/ossl_asn1.c: introduce ossl_asn1_object_size and
+ ossl_asn1_put_object to wrap functionality depending on OpenSSL
+ version in use.
+ Fixes [ Ruby 1.9 - Bug #4916 ] reported by Hiroshi Nakamura.
+ [ruby-core:37286]
+
+Sun Jun 26 01:00:15 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c (date_strftime_internal): removed meaningless braces.
+ * ext/date/date_core.c (gengo): the value should be int.
+
+Sat Jun 25 23:45:30 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * vm_insnhelper.c (vm_search_superclass): avoid control frame
+ stack overrun. currently super() in Proc created in a method
+ defined by Module#define_method raise NoMethodError. [Bug #4881]
+ * test/ruby/test_method.rb t_super_in_proc_from_define_method):
+ add test for it.
+
+Sat Jun 25 23:23:14 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * thread.c (sleep_forever): now Kernel#sleep don't wakeup by
+ signal handler execution. [Bug #4072]
+
+Sat Jun 25 23:14:47 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * thread.c (rb_threadptr_check_signal): remove unnecessary th->status
+ backup. fix race condition which may results unexpected main thread's
+ status transition. see #4072
+
+Fri Jun 24 19:57:30 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * lib/webrick/httprequest.rb (setup_forwarded_info): Parsing request
+ header failed when the request is from 2 or more Apache reverse
+ proxies. It's said that all X-Forwarded-* headers will contain more
+ than one (comma-separated) value if the original request already
+ contained one of these headers. Since we could use these values as
+ Host header, we choose the initial(first) value. See #4922.
+
+ * test/webrick/test_httprequest.rb (test_forwarded): Test it.
+
+Fri Jun 24 17:06:33 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * process.c (proc_daemon): should not start timer thread
+ twice. fixed Bug#4920.
+
+Fri Jun 24 15:54:14 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * ext/openssl/ossl_ssl.c (ossl_ssl_shutdown): Try to shutdown SSL
+ connection more gracefully. Call SSL_shutdown() max 4 times until it
+ returns 1 (success). Bi-directional SSL close has several states but
+ SSL_shutdown() kicks only 1 transition per call. Max 4 is from
+ mod_ssl.c of Apache httpd that says 'max 2x pending + 2x data = 4'.
+ See #4237.
+
+Fri Jun 24 07:24:37 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rake/version.rb: Fixed VERSION to work with tool/rbinstall.rb
+ * bin/rake: Import bin/rake from 0.9.2
+ * tool/rbinstall.rb (install): Rake::VERSION is now in
+ lib/rake/version.rb. Fixes `make install`
+
+Fri Jun 24 07:11:37 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rake: Import Rake 0.9.2
+
+Fri Jun 24 00:44:15 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c (c_valid_{julian,gregorian}_p): fixed the range of month.
+
+Fri Jun 24 00:14:23 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: trivial changes on text.
+
+Thu Jun 23 22:46:57 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * ext/openssl/ossl_x509name.c: Add X509::Name#hash_old as a wrapper
+ for X509_NAME_hash_old in OpenSSL 1.0.0. See #4805
+
+ * test/openssl/test_x509name.rb (test_hash): Make test pass with
+ OpenSSL 1.0.0.
+
+ * NEWS: Add it.
+
+Thu Jun 23 19:30:53 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * ext/openssl/ossl_ssl_session.c (ossl_ssl_session_set_time): Check
+ argument type with NUM2LONG if the arg is not a Time object.
+ See #4919.
+
+ * ext/openssl/ossl_ssl_session.c (ossl_ssl_session_set_timeout): Check
+ type with NUM2LONG. Time as an arg is not allowed. See #4919.
+
+ * test/openssl/test_ssl_session.rb (test_session_time,
+ test_session_timeout): Test it.
+
+Wed Jun 23 13:30:30 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * signal.c(ruby_atomic_exchange): Fix definition style.
+
+Wed Jun 22 22:34:05 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * ext/openssl/ossl_ssl.c (ossl_sslctx_session_new_cb): Return 0 to
+ OpenSSL from the callback for SSL_CTX_sess_set_get_cb().
+ Returning 0 means to OpenSSL that the session is still valid
+ (since we created Ruby Session object) and was not freed by us with
+ SSL_SESSION_free(). Call SSLContext#remove_session(sess) in
+ session_get_cb block if you don't want OpenSSL to cache the session
+ internally.
+ This potential issue was pointed by Ippei Obayashi. See #4416.
+
+ * test/openssl/test_ssl_session.rb (test_ctx_server_session_cb): Test
+ it.
+
+Wed Jun 22 22:21:17 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_ssl_session.c: Respect T_BIGNUM time values. Patch by
+ Tomoyuki Chikanaga.
+ [ Ruby 1.9 - Bug #4919 ] [ruby-dev:43869]
+
+Wed Jun 22 21:29:25 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * ext/socket/depend (SOCK_HEADERS): use $(top_srcdir) instead of
+ $(topdir). sorry!
+
+Wed Jun 22 19:47:03 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * cont.c (cont_capture): add volatile.
+ On clang -O, it is needed to avoid the optimization.
+ With this and llvm/clang's recent fix, clang 3.0 can
+ build ruby-trunk with -O option.
+
+ * cont.c (cont_capture): use for-loop.
+
+ * array.c (rb_ary_each): add volatile and use it.
+
+ * vm_insnhelper.c (vm_call_cfunc): ditto.
+
+Wed Jun 22 18:20:46 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * ext/openssl/ossl_ssl.c (ossl_sslctx_session_remove_cb):
+ OpenSSL::SSL::SSLContext#session_remove_cb was broken. It wrongly
+ tried to call the session_*new*_cb callback.
+
+ * test/openssl/test_ssl_session.rb (class OpenSSL): Test it.
+
+Wed Jun 22 17:37:49 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl.h: Introduced OSSL_BIO_reset macro for PEM/DER
+ fallback scenarios.
+
+ * ext/openssl/ossl_pkey_dsa.c
+ * ext/openssl/ossl_x509req.c
+ * ext/openssl/ossl_pkey_rsa.c
+ * ext/openssl/ossl_pkey_ec.c
+ * ext/openssl/ossl_ssl_session.c
+ * ext/openssl/ossl_x509crl.c
+ * ext/openssl/ossl_pkey.c
+ * ext/openssl/ossl_pkey_dh.c
+ * ext/openssl/ossl_x509cert.c
+ * ext/openssl/ossl_pkcs7.c: Use OSSL_BIO_reset.
+
+ * ext/openssl/ossl_ssl.c
+ * ext/openssl/ossl_cipher.c
+ * ext/openssl/ossl_pkey_ec.c
+ * ext/openssl/ossl_pkcs12.c
+ * ext/openssl/ossl_ssl_session.c: Replace rb_raise occurrences by
+ ossl_raise. This automatically flushes OpenSSL's error queue.
+
+ * ext/openssl/ossl_pkcs7.c: Raise error if DER fallback for parsing
+ fails.
+
+ * test/openssl/test_pkey_ec.rb
+ * test/openssl/test_pkey_dsa.rb
+ * test/openssl/test_pkey_rsa.rb: Add assertions that OpenSSL.errors is
+ empty.
+
+ * test/openssl/test_pkey_rsa.rb: Remove initial OpenSSL.errors call in
+ test_new.
+ [ Ruby 1.9 - Bug #4885 ] [ruby-core:37134]
+
+Wed Jun 22 15:01:24 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_ssl.c: Use SSL_MODE_RELEASE_BUFFERS if available.
+ Thanks, Eric Wong, for providing the patch.
+ [ Ruby 1.9 - Feature #4672 ] [ruby-core:36127]
+
+Wed Jun 22 14:47:53 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * test/openssl/test_buffering.rb
+ * test/openssl/test_pkcs12.rb: Inherit from Test::Unit::TestCase
+ instead of MiniTest::Unit::TestCase. [ruby-core:37275]
+
+Wed Jun 22 12:41:03 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * ext/openssl/ossl_ssl_session.c (ossl_ssl_session_to_der):
+ OpenSSL::SSL::Session#to_der was broken. Fix buffer handling.
+
+ * test/openssl/test_ssl_session.rb (test_session): Test it.
+
+Wed Jun 22 12:38:52 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * test/openssl/test_ssl_session.rb: Split out SSL::Session related
+ tests from test_ssl.rb
+
+Wed Jun 22 03:20:52 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/to_ruby.rb: Fix cyclic references of
+ objects. Thanks to CvX for reporting the bug and a test case.
+ * test/psych/test_object.rb: test for cyclic object references.
+
+Wed Jun 22 02:39:54 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * lib/net/http.rb (Net::HTTP.post_form): Do not ignore query part of
+ the given URI to post. See #655.
+
+ * test/net/http/test_http.rb, test/net/http/utils.rb: Test it.
+
+Wed Jun 22 01:28:13 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * test/openssl/test_x509store.rb (test_set_errors): Redhat is
+ distributing a patched version of OpenSSL that allows multiple CRL
+ for a key (multi-crl.patch.) Make test pass on such env. See #4122,
+ #4554.
+
+Tue Jun 21 21:50:37 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * lib/webrick/httpresponse.rb (HTTPResponse#setup_header): Close
+ HTTP/1.1 connection when returning an IO object as response body
+ without setting HTTPResponse#chunked to true. See #855 no.1.
+
+ * test/webrick/test_httpserver.rb: Test it.
+
+Tue Jun 21 21:27:34 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * internal.h: move rb_thread_io_blocking_region() declaration
+ from intern.h to internal.h. It's still experimental API and
+ need more discussion. [ruby-dev:43698]
+ * include/ruby/intern.h: ditto.
+
+ * ext/socket/rubysocket.h: include internal.h.
+ * ext/socket/depend: add internal.h dependency.
+ * ext/socket/extconf.rb: add $INCFLAGS to topdir.
+
+Tue Jun 21 20:38:47 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c (datetime_s_*): canonicalize 24 o'clock.
+
+Tue Jun 21 19:46:23 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/ruby/test_thread.rb (TestThread#test_priority): enable
+ this test again. Current GVL respect thread priority rather
+ than past.
+
+Tue Jun 21 13:25:35 2011 TAKAO Kouji <kouji@takao7.net>
+
+ * ext/readline/readline.c (readline_getc): applied a patch in
+ #3827 by by Akio Tajima <artonx AT yahoo.co.jp>. (see #3827)
+
+Tue Jun 21 13:16:31 2011 TAKAO Kouji <kouji@takao7.net>
+
+ * ext/readline/extconf.rb: fixed bug, specify --disable-libedit
+ then disable libedit, does not specify then check readline and
+ libedit if failed checking readline. (fixes #3375)
+
+Mon Jun 20 22:52:07 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * process.c (before_exec): use sig_do_nothing instead of SIG_DFL
+ for avoiding a race.
+ * process.c (sig_do_nothing): new function.
+
+Mon Jun 20 21:31:03 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c (thread_timer): rename timeout_10ms to
+ time_quantum. it's no longer 10ms.
+
+Mon Jun 20 18:46:02 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * ext/openssl/ossl_cipher.c, ext/openssl/lib/openssl/cipher.rb:
+ Documentation fix by Ippei Obayashi. See #4419.
+
+Mon Jun 20 15:41:33 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * lib/webrick/cookie.rb (WEBrick::Cookie.parse): Revert r31228.
+ r31228 was for allowing the 'Cookie:' header which did not have no
+ SP after ';' for separating cookie-pairs but RFC6265 requires single
+ SP after ';' there. We allow multiple SPs here for compatibility
+ with older WEBrick version.
+
+ * test/webrick/test_cookie.rb: Test it.
+
+Sun Jun 19 13:31:26 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * NEWS: Introduce --hide-skip on test/unit.
+
+Sun Jun 19 10:05:16 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/test/unit/parallel.rb: Override Test::Unit::TestCase#on_parallel_worker?
+ only when $0 == __FILE__.
+
+ * lib/test/unit/parallel.rb: Run Test::Unit::Worker.run only when
+ $0 == __FILE__.
+
+Sat Jun 18 23:59:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (fill_cbuf): finish reading at EOF, and the readconv has
+ been cleared by another thread while io_fillbuf() is waiting at
+ select(). a patch in [ruby-core:37197] by Hiroshi Shirosaki
+ <h.shirosaki AT gmail.com>. fixed #3840
+
+Sat Jun 18 21:36:29 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c: remove GVL_DEBUG
+
+Sat Jun 18 21:32:02 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * vm.c, vm_core.h (rb_vm_stack_to_heap): remove const.
+ It makes compilations warnings.
+
+Sat Jun 18 18:54:15 2011 Koichi Sasada <ko1@atdot.net>
+
+ * vm.c, vm_core.h (rb_vm_stack_to_heap): fix "const" place.
+
+Sat Jun 18 17:23:38 2011 Tanaka Akira <akr@fsij.org>
+
+ * eval.c, hash.c, load.c, proc.c, range.c, thread.c, time.c: don't
+ declare internal functions.
+
+ * internal.h, vm_core.h: declare internal functions.
+
+ * array.c: include internal.h.
+
+ * common.mk: update dependency for array.o.
+
+Sat Jun 18 13:39:33 2011 Tanaka Akira <akr@fsij.org>
+
+ * internal.h: declarations declared in include/ruby/*.h removed.
+
+Sat Jun 18 12:42:17 2011 Tanaka Akira <akr@fsij.org>
+
+ * method.h, internal.h iseq.h: declare internal functions.
+
+ * compile.c, eval.c, iseq.c, object.c, parse.y, proc.c, process.c,
+ thread.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c: don't
+ declare internal functions.
+
+ Note that rb_method_entry_eq() is defined in vm_method.c but
+ there was a declaration in proc.c with different const-ness.
+ Now it is declared in method.h with same const-ness to the
+ definition.
+
+ * object.c (rb_mod_module_exec): don't declare functions declared in
+ include/ruby/intern.h.
+
+Sat Jun 18 12:05:08 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/backward/classext.h: for evil gems. fixed #4803
+
+Sat Jun 18 11:12:13 2011 Tanaka Akira <akr@fsij.org>
+
+ * common.mk: update dependencies.
+
+Sat Jun 18 11:09:03 2011 Tanaka Akira <akr@fsij.org>
+
+ * io.c: suppress warnings.
+
+Sat Jun 18 10:22:39 2011 Tanaka Akira <akr@fsij.org>
+
+ * internal.h: declare more internal functions.
+
+ * iseq.h (rb_method_get_iseq): declared.
+
+ * compile.c, eval.c, eval_error.c, iseq.c, parse.y, proc.c, range.c,
+ ruby.c, time.c, util.c, vm.c: don't declare internal functions.
+
+ * eval.c, parse.y, thread_pthread.c: non-existing function declarations
+ removed.
+
+Sat Jun 18 08:12:54 2011 Tanaka Akira <akr@fsij.org>
+
+ * common.mk: dependencies updated.
+
+ * tool/update-deps: new file to assist update dependencies in
+ common.mk.
+
+Sat Jun 18 07:27:27 2011 Tanaka Akira <akr@fsij.org>
+
+ * internal.h: declare internal functions here.
+
+ * node.h: declare NODE dependent internal functions here.
+
+ * iseq.h: declare rb_iseq_t dependent internal functions here.
+
+ * vm_core.h: declare rb_thread_t dependent internal functions here.
+
+ * bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
+ enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
+ iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
+ proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
+ thread.c, time.c, transcode.c, variable.c, vm.c,
+ tool/compile_prelude.rb: don't declare internal functions declared
+ in above headers. include above headers if required.
+
+ Note that rb_thread_mark() was declared as
+ void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
+ void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
+ the later in internal.h.
+
+Sat Jun 18 02:36:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (VpNewRbClass): fix type of the 2nd
+ argument.
+
+ * ext/bigdecimal/bigdecimal.h: ditto.
+
+Sat Jun 18 02:30:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (BigMath_s_exp): move BigMath.exp from
+ bigdecimal/math.rb.
+
+ * ext/bigdecimal/lib/bigdecimal/math.rb: ditto.
+
+ * test/bigdecimal/test_bigdecimal.rb: move test for BigMath.exp from
+ test/bigdecimal/test_bigmath.rb.
+
+ * test/bigdecimal/test_bigmath.rb: ditto.
+
+Sat Jun 18 00:20:54 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: do not define wnum[01].
+
+Fri Jun 17 18:57:36 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * compile.c (iseq_compile_each): fix return value of obj[a,*b]=c.
+
+Fri Jun 17 13:09:45 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/curses/curses.c: Clean up documentation.
+
+Fri Jun 17 09:25:14 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/curses/curses.c: Document curses constants. Patch by Vincent
+ Batts. [Ruby 1.9 - Bug #4880]
+
+Fri Jun 17 09:11:05 2011 Eric Hodel <drbrain@segment7.net>
+
+ * object.c: Document Module#method_added and #method_removed.
+ Patch by Bryce Kerley. [Ruby 1.9 - Feature #4867]
+
+Fri Jun 17 08:50:16 2011 Eric Hodel <drbrain@segment7.net>
+
+ * io.c: Improve documentation of IO and File open and new.
+ Patch by Roger Pack. [Ruby 1.9 - Bug #4790]
+
+Fri Jun 17 07:53:50 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/csv.rb: Document #raw_encoding. Patch by David Czarnecki.
+ [Ruby 1.9 - Bug #4874]
+
+Fri Jun 17 07:46:50 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/benchmark.rb: Document Benchmark::Tms#memberwise. Patch by
+ David Czarnecki. [Ruby 1.9 - Bug #4873]
+
+Fri Jun 17 07:38:31 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/prettyprint.rb: Improve documentation. Patch by Ysiad
+ Ferreiras. [#4834]
+
+Fri Jun 17 07:23:03 2011 Eric Hodel <drbrain@segment7.net>
+
+ * array.c (rb_ary_drop): Improve documentation. Patch by Caley Woods.
+ [Ruby 1.9 - Bug #4858]
+
+Fri Jun 17 06:11:31 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/webrick/log.rb: Improve documentation of BasicLog and Log.
+ Patch by Olivier Brisse. [Ruby 1.9 - Bug #4833]
+ * lib/webrick/httpstatus.rb: Improve documentation of
+ WEBrick::HTTPStatus. Patch by Olivier Brisse.
+ [Ruby 1.9 - Bug #4833]
+
+Fri Jun 17 04:48:22 2011 Koichi Sasada <ko1@atdot.net>
+
+ * thread_pthread.c, thread_pthread.h: remove unused variables.
+ (native_thread_data_t::gvl_cond, native_thread_data_t::gvl_next)
+
+Thu Jun 16 14:32:31 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * time.c (rb_time_new): prevent overflow by "* 1000".
+
+Fri Jun 17 03:07:36 2011 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/bm_vm4_thread_create_join.rb,
+ benchmark/bm_vm4_thread_mutex[1-3].rb: renamed to
+ bm_thread_* (fix last rename).
+
+Fri Jun 17 02:26:47 2011 Koichi Sasada <ko1@atdot.net>
+
+ * thread_pthread.c (native_thread_create): fix debug message.
+ (add last newline)
+
+Thu Jun 16 23:40:49 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_thread_schedule_rec): fix {UN,}LIKELY macro misuse.
+ * gc.c (rb_newobj): ditto.
+ * vm_insnhelper.c (vm_method_search): ditto.
+
+Thu Jun 16 20:06:15 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * test/testunit/test_parallel.rb: Fix Regexp for test.
+
+ * test/testunit/tests_for_parallel/test_third.rb: Use
+ Test::Unit::TestCase#on_parallel_worker? for detecting worker.
+
+ * lib/test/unit/testcase.rb(Test::Unit::TestCase#on_parallel_worker?):
+ New Method Test::Unit::TestCase#on_parallel_worker? returns true
+ when a testcase is running on parallel worker.
+ * lib/test/unit/parallel.rb(Test::Unit::TestCase#on_parallel_worker?):
+ ditto.
+
+Thu Jun 16 19:27:12 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * test/test_securerandom.rb: Add testcase. This testcase does NOT aim
+ to test cryptographically strongness and randomness. It includes
+ the test for PID recycle issue of OpenSSL described in #4579 but
+ it's disabled by default.
+
+Thu Jun 16 17:55:07 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/ruby/test_io.rb (TestIO#test_copy_stream_socket): fix
+ test hanging up issue. Patch by CHIKANAGA Tomoyuki.
+
+Thu Jun 16 15:17:39 2011 Eric Hodel <drbrain@segment7.net>
+
+ * variable.c (const_missing): Add simple example of const_missing.
+ Patch by Anuj Dutta. [Ruby 1.9 - Bug #4794]
+
+Thu Jun 16 15:09:29 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/monitor.rb: Improve documentation. Patch by Sandor Szucs.
+ [Ruby 1.9 - Bug #4823]
+
+Thu Jun 16 14:54:09 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/webrick/utils.rb: Document WEBrick::Utils. Patch by Olivier
+ Brisse. [Ruby 1.9 - Bug #4819]
+
+Thu Jun 16 14:26:46 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/webrick/httpservlet/erbhandler.rb: Allow the ERB document to
+ alter the content-type of the response. [Ruby 1.9 - Bug #4685]
+
+Thu Jun 16 14:15:47 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/timeout.rb: Clarify timeout duration types. Patch by Alf Mikula.
+ [Ruby 1.9 - Bug #4791]
+ * lib/net/http.rb: ditto
+
+Thu Jun 16 13:25:25 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc*: Import RDoc 3.7 release candidate
+
+Thu Jun 16 11:35:09 2011 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/imap.rb (search_response): parses SEARCH responses from
+ the Yahoo IMAP server correctly. patched by Mark Nadig. [Bug #4509]
+
+Thu Jun 16 09:12:38 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * fix for build on solaris 10.
+
+Thu Jun 16 09:08:39 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/io/console/test_io_console.rb (TestIO_Console#test_sync):
+ fix for daemon process.
+
+Thu Jun 16 07:58:01 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * test/testunit/test_parallel.rb(test_ignore_tzero): Test for r32109.
+
+ * test/testunit/tests_for_parallel/test_third.rb: Use another way to
+ detect that test is running on worker. This fixes sometimes
+ TestParallel failing.
+
+Thu Jun 16 07:20:06 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/test/unit.rb(Test::Unit::Runner#_run_parallel): Ignore -j0
+ because it makes blocking forever by IO.select.
+
+Thu Jun 16 03:08:11 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/testunit/test_parallel.rb (TestParallel::TestParallelWorker#
+ setup): now can run on Windows, probably.
+
+ * test/testunit/test_parallel.rb (TestParallel::TestParallel#setup):
+ ditto.
+
+Thu Jun 16 03:00:26 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * thread.c (do_select): Windows: no need to poll if select(2) is
+ cancelable.
+
+ * thread_win32.c (native_fd_select): new function to make select(2)
+ cancelable.
+
+ * thread_win32.c (rb_w32_check_interrupt): new function for checking
+ interrupt.
+
+ * win32/win32.c (rb_w32_select_with_thread): new function. cancelable
+ select(2).
+
+ * win32/win32.c (rb_w32_select): use above function internally.
+
+Wed Jun 15 23:30:45 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * gc.c: fix a regression by r31690 on AIX because AIX malloc
+ return NULL if it's passed 0. But some caller don't expect it.
+ patch by Yutaka Kanemoto. [ruby-dev:43779]
+ (vm_malloc_prepare): return calculated size.
+ (vm_xmalloc): use above result.
+ (vm_xcalloc): ditto.
+
+Wed Jun 15 23:11:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c: remove BLOCKING_REGION_CORE() macro. It's no longer used
+ since r32022.
+
+Wed Jun 15 21:00:47 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * test/openssl/test_config.rb: execute based on the existence of the
+ OpenSSL module.
+
+Wed Jun 15 12:35:11 2011 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/test_io.rb (test_copy_stream_socket): wait a child process
+ before SIGUSR1 handler is removed.
+
+ * test/pathname/test_pathname.rb (define_assertion): use line number
+ for test method names.
+
+Wed Jun 15 10:37:43 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * file.c (rb_stat_rdev): use DEVT2NUM.
+
+ * file.c (rb_stat_rdev_major): ditto.
+
+ * file.c (rb_stat_rdev_minor): ditto.
+
+Wed Jun 15 05:12:59 2011 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tk/tcltklib.c (lib_eventloop_core): revert the last change (it's
+ the part for ruby_1_8), and use rb_thread_check_ints() when RUBY_VM
+ is defined.
+
+Wed Jun 15 04:42:47 2011 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/bm_vm3_thread_*.rb: renamed bm_vm3_thread_*.rb to
+ benchmark/bm_vm_thread_*.rb.
+
+Wed Jun 15 04:28:39 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * benchmark/bm_vm4_thread_pass.rb: rename bm_vm4* to
+ bm_vm_thread_*. suggested by ko1.
+ * benchmark/bm_vm4_pipe.rb: ditto.
+ * benchmark/bm_vm4_alive_check1.rb: ditto.
+ * benchmark/bm_vm4_pass_flood.rb: ditto.
+
+Wed Jun 15 03:52:50 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * benchmark/bm_vm4_pass_flood.rb: new benchmark for GVL fairness.
+ * benchmark/bm_vm4_alive_check1.rb: ditto.
+
+Wed Jun 15 01:27:53 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c (gvl_yield): fix live lock issue on 1-2 cpus
+ system. It's additional fix for r32021.
+ * thread_pthread.c (gvl_init): add switch_wait_cond.
+ * thread_pthread.h (typedef struct rb_global_vm_lock_struct): ditto.
+
+Tue Jun 14 23:16:22 2011 Tanaka Akira <akr@fsij.org>
+
+ * bootstraptest/runner.rb (show_progress): refine verbose mode.
+ (exec_test): ditto.
+
+Tue Jun 14 23:02:36 2011 Tanaka Akira <akr@fsij.org>
+
+ * bootstraptest/runner.rb (show_progress): extracted from assert_check.
+ (assert_check): use show_progress.
+ (assert_normal_exit): ditto.
+ (assert_finish): ditto.
+ (flunk): ditto.
+
+Tue Jun 14 22:51:42 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * test/date/test_*.rb: added tests.
+
+Tue Jun 14 22:09:58 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: renamed some functions.
+ * ext/date/date_core.c: modified doc.
+
+Tue Jun 14 21:26:01 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * cont.c (cont_save_thread): add new utility function.
+ rb_context_t::saved_thread.machine_stack_start and
+ machine_stack_end should be cleared immediately after a snapshot of
+ current thread is stored to saved_thread. [ruby-dev:43680] [Bug #4855]
+ this change aims to get rid of unnecessary GC mark at machine stack.
+
+Tue Jun 14 19:50:49 2011 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/test_autoload.rb: remove temporary directory.
+
+Tue Jun 14 11:05:03 2011 Narihiro Nakamura <narihiro@netlab.jp>
+
+ * gc.c (rb_gc_set_params): call initial_expand_heap if
+ initial_heap_min_slots is set.
+
+Tue Jun 14 11:02:08 2011 Narihiro Nakamura <narihiro@netlab.jp>
+
+ * gc.c: use size_t.
+
+Tue Jun 14 01:10:38 2011 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * test/coverage/test_coverage.rb: add a test for restart. a patch
+ from Xavier Shay. [ruby-core:36745]
+
+Tue Jun 14 01:05:10 2011 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * ext/coverage/coverage.c: make it restartable. [ruby-core:36539]
+
+Mon Jun 13 23:55:40 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_thread_schedule_rec): call gvl_yield() unconditionally.
+ * thread_pthread.c: remove HAVE_GVL_YIELD macro.
+ * thread_win32.c (gvl_yield): new. this fallback logic was moved from
+ rb_thread_schedule_rec().
+
+Mon Jun 13 23:50:25 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/io/console/console.c (console_dev): typo.
+
+Mon Jun 13 23:38:23 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_parse_string): flush delayed token. based on a
+ patch by Masaya Tarui in [ruby-dev:43762]. Bug #4544
+
+ * parse.y (yylex): revert r24557. delayed token at the end of
+ string should be flushed already by the above change.
+
+Mon Jun 13 23:33:31 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/io/console/console.c (console_dev): console should be
+ unbuffered.
+
+ * ext/io/console/console.c (console_dev): take care of no-ctty
+ case.
+
+Mon Jun 13 23:06:12 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c: rewrite GVL completely. This fix improve some
+ benchmark dramatically (e.g. vm3_thread_mutex result changed
+ form 120.601sec to 3.426sec).
+ * thread_win32.c: ditto.
+ * thread_pthread.h: ditto.
+ * vm_core.h: ditto.
+ * thread.c: ditto.
+
+Mon Jun 13 23:11:52 2011 Tanaka Akira <akr@fsij.org>
+
+ * test/socket/test_unix.rb: don't use Thread.abort_on_exception.
+
+Mon Jun 13 23:05:01 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/unixsocket.c (unix_send_io): race condition fixed.
+ (unix_recv_io): ditto.
+ fixed by Eric Wong. [ruby-core:35574]
+
+ * test/socket/test_unix.rb: test added for above problem.
+
+Mon Jun 13 21:41:05 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_win32.c (native_cond_signal): remove unnecessary rb_bug().
+ It's additional fix for r32021. [Bug #4696]
+
+Mon Jun 13 20:50:49 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * test/openssl/test_ec.rb
+ test/openssl/test_pkey_ec.rb: merge both files into test_pkey_ec.rb.
+ Removed redundant group instantiation from PKey tests.
+ * test/openssl/utils.rb: only create TEST_PKEY_EC_P256V1 if EC is
+ defined.
+
+Mon Jun 13 20:28:24 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * test/openssl/digest.rb: remove MDC2 from test, it is not available
+ by default in an OpenSSL installation.
+
+Mon Jun 13 20:18:55 2011 Koichi Sasada <ko1@atdot.net>
+
+ * vm_core.h, vm_insnhelper.h: move decl. of
+ ruby_vm_global_state_version and related macros
+ from vm_core.h to vm_insnhelper.h.
+
+ * vm.c (vm_clear_all_cache): added. This function is called
+ when ruby_vm_global_state_version overflows.
+ TODO: vm_clear_all_inline_method_cache() is only place holder.
+ We need to implement it ASAP.
+
+ * vm_method.c (vm_clear_global_method_cache): added.
+
+Mon Jun 13 19:46:21 2011 Keiju Ishitsuka <keiju@ishitsuka.com>
+
+ * lib/cmath.rb: add new method Object#real?. fix #3137
+
+Mon Jun 13 18:52:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (is_kind_of_BigDecimal): new function to
+ examine the whether the object is kind of BigDecimal.
+
+Mon Jun 13 18:49:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimalCmp): use GetVpValueWithPrec
+ for Float and Rational arguments.
+
+ * test/bigdecimal/test_bigdecimal.rb (test_new, test_cmp, test_power):
+ add and modify tests for the above change.
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimalCmp): modify coding style to
+ match ruby's standard.
+
+Mon Jun 13 18:33:04 2011 Tanaka Akira <akr@fsij.org>
+
+ * lib/securerandom.rb (SecureRandom.random_bytes): modify PRNG state
+ to prevent random number sequence repetition at forked child
+ process which has same pid.
+ reported by Eric Wong. [ruby-core:35765]
+
+Mon Jun 13 17:02:34 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http.rb (Net::HTTP#use_ssl?): require 'openssl' only when
+ https is needed. fixes r31933.
+
+Mon Jun 13 14:35:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * lib/cmath.rb (CMath.cbrt): returns the principal value of the cube
+ root of the argument. fix #3676
+
+ * test/test_cmath.rb (test_cbrt_returns_principal_value_of_cube_root):
+ test for the above change.
+
+Mon Jun 13 14:17:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * lib/test/unit.rb (Test::Unit::GlobOption#non_options): fix typo.
+
+Mon Jun 13 13:04:20 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_digest.c: fix error for digests that have no oid
+ (e.g. DSS1).
+ * test/openssl/test_digest.c: add tests for this.
+
+Mon Jun 13 12:51:51 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/yaml.rb: load psych only when syck is not loaded.
+
+Mon Jun 13 12:23:39 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+Mon Jun 13 12:23:39 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/psych/lib/psych/deprecated.rb (Object#to_yaml_properties):
+ undef to_yaml_properties before redefine it.
+
+ * ext/syck/lib/syck/rubytypes.rb: ditto.
+
+Mon Jun 13 11:30:10 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_digest.c: allow Digests to be created by sn, ln or
+ oid.
+ * test/openssl/test_digest.rb: add tests for this.
+ [Ruby 1.9 - Feature #4412] [ruby-core:35319]
+
+Mon Jun 13 10:54:03 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/pkey_dh.c: corrected documentation.
+ * test/openssl/utils.rb: add test key for DH.
+ * test/openssl/test_pkey_dh.rb: add tests.
+
+Mon Jun 13 10:13:08 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/pkey_dh.c: clarify difference between DH#public_key and
+ DH#pub_key in documentation.
+
+Mon Jun 13 05:50:43 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * NEWS: introduce PKey.read.
+
+Mon Jun 13 05:17:29 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_pkey.c: added PKey.read module function that allows
+ reading arbitrary public/private keys from DER-/PEM-encoded File or
+ string instances.
+ * ext/openssl/ossl_pkey_dh.c: improved documentation.
+ * test/openssl/utils.rb: added EC test key.
+ * test/openssl/test_pkey_rsa.rb
+ test/openssl/test_pkey_dsa.rb: Test PKey.read. Reuse keys from
+ OpenSSL::TestUtils.
+ * test/openssl/test_pkey_ec.rb: Created test file for EC tests.
+ Test PKey.read.
+ [Ruby 1.9 - Feature #4424] [ruby-core:35330]
+
+Mon Jun 13 04:42:24 2011 Koichi Sasada <ko1@atdot.net>
+
+ * ext/objspace/objspace.c (total_i): fix to skip no ruby objects.
+
+Mon Jun 13 03:07:38 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * test/benchmark/test_benchmark.rb (capture_output):
+ replace '-' as space. On NetBSD, subtract between two Process.times
+ after and before the short process may return negative value like:
+ t0=Process.times; yield; t1=Process.times; p t1.utime-t0.utime
+
+Mon Jun 13 02:40:23 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * test/openssl/test_pkey_dsa.rb: Test for DSA#syssign/sysverify.
+
+Mon Jun 13 01:59:19 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_pkey_dh.c: completed documentation.
+ * ext/openssl/ossl_pkey_dsa.c: corrected examples. Improved parameter
+ sections.
+
+Mon Jun 13 00:25:10 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_pkey_dsa.c: completed documentation.
+
+Sun Jun 12 23:36:46 2011 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
+
+ * lib/drb/drb.rb (kill_sub_thread): remove the method. [ruby-core:34185]
+
+Sun Jun 12 21:01:56 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c (d_lite_marshal_load): should give converted value.
+
+Sun Jun 12 20:36:30 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: edited doc.
+
+Sun Jun 12 18:12:07 2011 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/bm_vm3_clearmethodcache.rb: added.
+
+Sun Jun 12 17:40:29 2011 Koichi Sasada <ko1@atdot.net>
+
+ * vm_method.c (rb_clear_cache*): update only vm state version.
+
+ * vm_method.c (rb_method_entry_get_without_cache, rb_method_entry):
+ Fill method cache entry with vm state version, and
+ check current vm state version for method (cache) look up.
+ This modification speed-up invalidating of global method cache table.
+ [Ruby 1.9 - Feature #3905] [ruby-core:36908]
+
+Sun Jun 12 16:19:48 2011 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tk/extconf.rb: fail on Mac OS X. [Bug #4853][ruby-dev:43655]
+
+Sun Jun 12 15:56:08 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c: remove th->transition_for_lock. It's thread unsafe.
+ [Bug #4723][ruby-dev:43563]
+
+Sun Jun 12 15:47:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c: introduce spurious wakeup safe deadlock check.
+ [Bug #4696][ruby-dev:43554]
+
+Sun Jun 12 13:33:52 2011 Koichi Sasada <ko1@atdot.net>
+
+ * benchmark/bm_vm3_thread_mutex.rb: remove it.
+
+ * benchmark/bm_vm3_thread_mutex[1-3].rb: added 3 benchmarks.
+ 1: one thread with one mutex (no contention).
+ 2: two threads with one mutex (contention).
+ 3: 1000 threads with one mutex (huge number of contention)
+ Above removed benchmark was type 3.
+ Therefore, this commit adds type 1 and 2 benchmark.
+
+Sun Jun 12 11:16:59 2011 Tanaka Akira <akr@fsij.org>
+
+ * io.c: use select() appropriately for sendfile().
+ Fixed by Eric Wong. [ruby-core:36150]
+ (maygvl_copy_stream_wait_readwrite): removed.
+ (nogvl_copy_stream_sendfile): use nogvl_copy_stream_wait_write and
+ maygvl_copy_stream_wait_read instead of
+ maygvl_copy_stream_wait_readwrite.
+
+Sun Jun 12 09:32:13 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * atomic.h (ATOMIC_OR): _InterlockedOr is not available on mingw.h
+ * gc.c (rb_gc_set_params): VM_OBJSPACE is disabled on mingw.
+
+Sun Jun 12 01:07:09 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: edited doc.
+
+Sat Jun 11 23:18:00 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * vm_core.h (RUBY_VM_SET_TIMER_INTERRUPT, RUBY_VM_SET_INTERRUPT,
+ RUBY_VM_SET_FINALIZER_INTERRUPT): use atomic ops for preventing
+ interrupt_flag bit lost. [Bug #4770][ruby-dev:43467]
+ * thread.c (rb_threadptr_execute_interrupts_rec): ditto.
+ * vm_core.h (typedef struct rb_thread_struct): change type of
+ interrupt_flag to rb_atomic_t.
+ * atomic.h: move atomic ops definition from signal.c.
+ * signal.c: remove atomic ops definition.
+ * common.mk (gc, signal, thread, cont): add to dependency to atomic.h.
+
+Sat Jun 11 23:23:52 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: edited doc.
+
+Sat Jun 11 23:02:36 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * ext/openssl/lib/openssl/buffering.rb (module OpenSSL):
+ Buffering#each_byte should return String in accordance with IO in
+ 1.9.
+
+ * test/openssl/test_buffering.rb (class OpenSSL): add tests for getc
+ and each_byte.
+
+Sat Jun 11 22:41:37 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * time.c: a correction of doc for strftime (%v).
+
+Sat Jun 11 22:30:53 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: replaced doc for strftime based on Time's one.
+
+Sat Jun 11 22:07:56 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c (datetime_s_{iso8601,rfc3339,xmlschema,rfc2822,httpdate}):
+ do not take argument comp.
+
+Sat Jun 11 21:58:31 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: added examples.
+
+Sat Jun 11 19:40:45 2011 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c: expand heap if initial_heap_min_slots is bigger than
+ HEAP_MIN_SLOTS.
+
+Sat Jun 11 19:42:50 2011 WATANABE Hirofumi <eban@ruby-lang.org>
+
+ * ChangeLog (vim): set shiftwidth to 2.
+
+Sat Jun 11 19:27:06 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * ext/openssl/ossl_x509req.c: raise RequestError instead of
+ CertificateError when Request#to_der gets an error from OpenSSL.
+ Patch from Ippei Obayashi, see #4420. I cannot write a test for
+ this... Request does not allow to create broken bytes...
+
+Sat Jun 11 19:34:51 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c (Date::(ABBR_)?(MONTH|DAY)NAMES): should be usascii.
+
+Sat Jun 11 19:24:33 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: rewrote doc.
+
+Sat Jun 11 19:04:15 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::GlobOption#non_options): should run
+ with 1.8.
+
+Sat Jun 11 18:05:57 2011 WATANABE Hirofumi <eban@ruby-lang.org>
+
+ * bootstraptest/runner.rb: should initialize $stress to avoid warnings.
+
+Sat Jun 11 18:02:09 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (io_getc): should be 7bit if ascii. fixes #4557
+
+Sat Jun 11 16:52:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * numeric.c (rb_enc_uint_chr): fix message format. Bug#4869
+
+Sat Jun 11 16:28:25 2011 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/formatters/pretty.rb
+ (REXML::Formatters::Pretty#write_text),
+ test/rexml/test_core.rb
+ (Tester#test_pretty_format_long_text_finite): don't ignore
+ 'width' parameter in pretty formatter. fixes #4498
+ Reported by Michael Frasca. Thanks!!!
+
+Sat Jun 11 16:11:36 2011 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_core.rb
+ (Tester#test_pretty_format_long_text_finite): remove needless
+ assert_nothing_raised.
+
+Sat Jun 11 16:04:03 2011 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/parsers/xpathparser.rb
+ (REXML::Parsers::XPathParser#parse),
+ test/rexml/test_elements.rb
+ (ElementsTester#test_each_with_frozen_condition):
+ don't modify original XPath. fixes #4161
+ Reported by Pavel Shved. Thanks!!!
+
+Sat Jun 11 15:53:27 2011 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_elements.rb (ElementsTester): remove needless
+ prefix from test name.
+
+Sat Jun 11 15:36:36 2011 Martin Duerst <duerst@it.aoyama.ac.jp>
+ * common.mk: fixed a grammatical error
+
+Sat Jun 11 14:20:16 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * vm.c (thread_memsize): don't ignore size of th->local_storage.
+
+Sat Jun 11 10:32:46 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb: should quote arch_hdrdir and libpath for the case
+ installed prefix contains spaces.
+
+Sat Jun 11 10:20:52 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread_pthread.c (native_cond_timeout): wrap conditionally used
+ label.
+
+ * thread_pthread.c (native_sleep): remove unused variable.
+
+Sat Jun 11 10:15:50 2011 Tanaka Akira <akr@fsij.org>
+
+ * thread.c (rb_thread_execute_interrupts): use GetThreadPtr to extract
+ rb_thread_t from VALUE.
+ reported by Motohiro KOSAKI. [ruby-dev:43700]
+
+Sat Jun 11 10:00:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby.c (ruby_process_options): add missing return type.
+
+Fri Jun 10 23:18:09 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * ext/tk/tcltklib.c (lib_eventloop_core): replace CHECK_INTS with
+ rb_thread_check_ints(). Because current code can't be compiled.
+
+Fri Jun 10 16:38:13 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * encoding.c (rb_locale_charmap): When ruby process is run as Windows
+ Service the console codepage is not set, GetConsoleCP returns 0.
+ So on such environment, use GetACP().
+ http://blogs.msdn.com/b/michkap/archive/2005/02/08/369197.aspx
+ patched by Rafal Bigaj [ruby-core:36832] [Bug #4854]
+
+Fri Jun 10 14:34:24 2011 Koichi Sasada <ko1@atdot.net>
+
+ * common.mk: restore TESTRUN_SCRIPT to "$(srcdir)/test.rb".
+ TESTRUN_SCRIPT is used by "make run", "make gdb" and so on.
+
+Fri Jun 10 13:01:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/ruby/test_module.rb (TestModule#remove_rake_mixins): remove all
+ module related to Rake.
+
+Fri Jun 10 09:52:38 2011 Eric Hodel <drbrain@segment7.net>
+
+ * encoding.c: Mention that Encoding.compatible? can work with more
+ than just Strings.
+
+Fri Jun 10 02:25:53 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych.rb: updating version to match released gem.
+
+Fri Jun 10 01:06:29 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/bigdecimal (BigDecimal_to_i): Integer#** may return flonum.
+
+Fri Jun 10 00:35:12 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * complex.c (string_to_c_internal): uses rb_reg_nth_match;
+ * rational.c (string_to_r_internal): ditto.
+
+Fri Jun 10 00:25:03 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * gc.c: remove an unused declaration.
+
+Fri Jun 10 00:24:04 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * rational.c (string_to_r): Rational#** may return flonum.
+
+Thu Jun 9 23:57:53 2011 Tanaka Akira <akr@fsij.org>
+
+ * io.c: fix IO.copy_stream interrupt handling.
+ based on the patch by Eric Wong. [ruby-core:36156]
+
+ * vm_core.h (rb_thread_call_with_gvl): don't declare here.
+
+ * thread.c: include internal.h.
+ (rb_thread_execute_interrupts): new function.
+
+ * internal.h (rb_thread_execute_interrupts): declared.
+ (rb_thread_call_with_gvl): declared.
+
+Thu Jun 9 23:34:01 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * gc.c (rb_objspace_call_finalizer): use rb_typeddata_is_kind_of() for
+ type check to get rid of a double free when main Thread has singleton
+ class. [ruby-core:36741] [Bug #4828]
+ * thread.c (rb_obj_is_mutex): add a new utility function.
+ * vm.c (rb_obj_is_thread): ditto.
+
+Thu Jun 9 22:53:49 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * test/ruby/test_thread.rb (TestThread#test_kill_thread_subclass):
+ add test for Thread.kill with Thread subclass instance.
+
+Thu Jun 9 22:31:47 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * test/ruby/test_thread.rb (TestThread#test_kill_wrong_argument):
+ test for [ruby-core:35086].
+ partially forward porting r31402 from ruby_1_9_2 branch.
+
+Thu Jun 9 18:36:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * string.c: Fix the ambiguous description of the behavior of
+ rb_str_aref_m with a range. It returns nil when the beginning of
+ the range is greater than the end of the string rather than the range.
+
+Thu Jun 9 10:57:03 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/to_ruby.rb: Hash subclasses can be read
+ from YAML files.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: Hash subclasses can be
+ dumped to YAML files.
+ * test/psych/test_hash.rb: corresponding test.
+
+Thu Jun 9 09:18:51 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/to_ruby.rb: Ruby modules can be loaded
+ from YAML files.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: Ruby modules can be
+ dumped to YAML files.
+ * test/psych/test_class.rb: corresponding test.
+
+Thu Jun 9 09:05:04 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/to_ruby.rb: Ruby classes can be loaded
+ from YAML files.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: Ruby classes can be
+ dumped to YAML files.
+ * test/psych/test_class.rb: corresponding test.
+
+Wed Jun 8 21:38:57 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * cont.c (root_fiber_alloc): set root fiber's status RUNNING.
+ in cont_mark() only RUNNING fiber's machine stack is marked.
+ root fiber's status should be RUNNING at the beginning regardless of
+ FIBER_USE_NATIVE. [ruby-core:36735] fixes #4827
+
+Tue Jun 7 20:50:11 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * doc/irb/irb.rd: fix typo. patch by Nobuhiro IMAI.
+ [Bug #4843] [ruby-dev:43639]
+ * doc/irb/irb.rd.ja: ditto.
+ * doc/ChangeLog-YARV: ditto.
+
+Tue Jun 7 18:52:55 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/rubygems/user_interaction.rb (Gem::StreamUI#tty?): IO#tty? of
+ Windows has been fixed at r29969.
+
+ * test/rubygems/test_gem_stream_ui.rb: now can run tests.
+
+Tue Jun 7 18:36:41 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/rubygems/test_gem.rb (TestGem#{test_self_user_home_userprofile,
+ test_self_user_home_user_drive_and_path}): should simply ignore
+ meaningless tests instead of skipping them.
+
+Tue Jun 7 18:15:00 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_set_program_name):
+ should show some messages when skipping tests.
+
+Tue Jun 7 13:59:47 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/date/date_core.c (date_s_today, datetime_s_now): check the
+ result of localtime_r().
+
+Tue Jun 7 13:36:51 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/tk/extconf.rb: use $defs not $CPPFLAGS to get rid of
+ command line escape issues on Windows. fixed #4835.
+
+Tue Jun 7 03:18:45 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * test/ruby/test_io.rb (TestIO#test_s_{,bin}write): do not create a
+ file under /tmp. [Bug #4846]
+
+Mon Jun 6 22:51:43 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * cont.c: use #if FIBER_USE_NATIVE instead of #ifdef.
+ you can suppress use of setcontext for Fiber with compile option
+ -DFIBER_USE_NATIVE=0
+
+Mon Jun 6 21:59:23 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * test/date/test_switch_hitter.rb: added a test.
+
+Mon Jun 6 21:37:45 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: added notes.
+
+Mon Jun 6 21:02:12 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: flattened format to strftimev.
+ * ext/date/date_core.c (date_strftime_internal): taints run.
+
+Mon Jun 6 15:10:17 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * include/ruby/{defines,missing}.h (rb_infinity, rb_nan): move from
+ defines.h to missing.h. (couldn't use RUBY_EXTERN there.)
+
+Mon Jun 6 14:35:48 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/rdoc/test_rdoc_markup_pre_process.rb (TestRDocMarkupPreProcess#
+ {test_include_file,test_include_file_encoding_incompatible}): no
+ need to write such workaround. don't hide the bug of ruby. (and the
+ bug is already fixed.)
+
+Mon Jun 6 14:11:11 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/date/date_core.c (valid_jd_sub): need to convert from VALUE to
+ double.
+
+ * ext/date/date_core.c (offset_to_sec): get rid of a compiler warning.
+
+Mon Jun 6 14:09:08 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * include/ruby/defines.h (rb_infinity, rb_nan): export for Windows.
+
+Mon Jun 6 10:54:45 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/test/unit.rb(Test::Unit::Runner#puke):
+ Add overriding from MiniTest::Unit#puke. This reverts minitest's fix
+ that skip messages are hidden when not verbose mode (-v option).
+ To hide skip messages, use --hide-skip option instead.
+
+Mon Jun 6 10:52:13 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http.rb: don't use autoload.
+
+Mon Jun 6 09:39:43 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/parser.c (parse): release event objects to plug memory
+ leak. Thanks Mark J. Titorenko!
+
+Sun Jun 5 23:26:15 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * eval.c: remove rb_thread_stop_timer_thread function declaration.
+ Instead, include vm_core.h.
+ * process.c: ditto.
+
+Sun Jun 5 21:38:51 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c (thread_timer): add to care a spurious wakeup.
+ When native_cond_timedwait() return 0 by spurious wakeup, we
+ don't have to neither 1) call timer_thread_function and 2)
+ exit the timer thread.
+
+Sun Jun 5 17:50:01 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c (m_real_cwyear): new. derived from m_cwyear.
+ * ext/date/date_strftime.c: trivial changes.
+
+Sun Jun 5 17:22:01 2011 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tk/config_list.in: add new options for tcltklib.
+
+Sun Jun 5 10:06:50 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_tmx.h: now does not place decoded data. allows to
+ access indirectly via functions on demand.
+ * ext/date/date_strftime.c: ditto.
+ * ext/date/date_core.c: ditto.
+ * ext/date/date_core.c ({d|dt}_lite_to_s): use strftime.
+
+Sun Jun 5 06:22:02 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * NEWS: wrote about changes of date.
+
+Sat Jun 4 16:59:26 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c (d_lite_inspect): changed the format.
+ * ext/date/date_core.c: refactoring and fixing some bugs.
+
+Sat Jun 4 11:30:57 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (check_mix_method_i, do_mix_method_i): not mix methods
+ renamed as nil.
+
+Sat Jun 4 04:04:41 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * test/rubygems/test_gem_commands_which_command.rb:
+ "missing" exists on ruby's top source directory. [Bug #4815]
+
+Fri Jun 3 21:48:12 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/rubygems/test_case.rb: Refix for test-all in separate directory.
+ r31147 + r31151.
+
+Fri Jun 3 20:58:47 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/date/date_core.c (d_lite_plus): get rid of compiler warnings.
+
+Fri Jun 3 20:56:40 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * include/ruby/missing.h, numeric.c (round): moved prototype of round()
+ from numeric.c to missing.h. (note: round() is C99 feature, so ruby
+ provides it if not exist in C runtime.)
+
+Fri Jun 3 20:42:04 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/test/unit/parallel.rb: Keep $stdin, $stdout before run testcase
+ and restore after run. Because some test break $stdin, $stdout.
+ Fixes [Bug #4433] [ruby-core:35353]
+
+Fri Jun 3 19:58:14 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * io.c (io_fflush): windows -- call fsync() only when the FD is tied to
+ file, because if the FD is pipe, it blocks.
+
+Fri Jun 3 09:27:31 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http.rb (URI::HTTP#request_uri): return nil when the uri
+ is path-rootless form. Bug #4759
+
+Thu Jun 2 23:51:03 2011 James Edward Gray II <jeg2@ruby-lang.org>
+
+ * lib/csv.rb: Improve the line ending detection algorithm
+ patch by Alexey).
+
+Thu Jun 2 20:05:57 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * io.c (rb_io_s_write, rb_io_s_binwrite): return!!!
+
+Thu Jun 2 16:29:34 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * io.c: Add File.write, File.binwrite. [Feature #1081] [ruby-core:21701]
+
+ * test/ruby/test_io.rb: Test for File.write, File.binwrite.
+
+ * NEWS: News for above.
+
+Thu Jun 2 12:33:09 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * io.c (io_fflush, rb_io_flush): need to fsync() when ruby calls
+ internal flush. [ruby-core:36670] [Bug #4813]
+
+Thu Jun 2 07:56:24 2011 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tk/tcltklib.c: reduce CPU power required by an eventloop.
+
+Tue May 31 21:28:33 2011 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/test_signal.rb (TestSignal#test_signal_requiring):
+ redirect stderr to null device.
+
+Thu Jun 2 00:45:26 2011 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tk/extconf.rb: fix for uninitialized global variables.
+ [Ruby 1.9 - Bug #4811]
+
+Wed Jun 1 21:57:08 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c (native_sleep): fix 1000times calculation error.
+ this is a regression since r31457. [Bug #4808] [ruby-dev:43606]
+
+Wed Jun 1 17:19:16 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c: remove unused macro.
+
+Wed Jun 1 15:42:18 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (peek_n): new macro to see next nth char.
+
+Wed Jun 1 15:40:46 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/rbinstall.rb (gem): fix for rubygems change.
+
+Wed Jun 1 14:07:57 2011 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * lib/minitest/*: Imported minitest 2.2.2 (r6281)
+ * test/minitest/*: ditto
+
+Wed Jun 1 12:35:50 2011 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * lib/rubygems*: Import rubygems 1.8.5 (released @ 137c80f)
+ * test/rubygems: Ditto
+
+Wed Jun 1 12:34:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * NEWS: add new features of bigdecimal.
+
+Wed Jun 1 09:41:14 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/cgi/util.rb: Improve documentation. Patch by Kuba Fietkiewicz.
+ [Ruby 1.9 - Bug #4775]
+ * lib/cgi/core.rb: ditto
+
+Wed Jun 1 09:26:05 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/mathn.rb: Improve documentation and attach it to Numeric.
+ Modified from patch by Anil V. [Ruby 1.9 - Bug #4762]
+
+Wed Jun 1 09:21:30 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/prime.rb: Indent examples enough to appear as code sections.
+ Note that Prime is Enumerable. [#4762]
+
+Wed Jun 1 07:34:57 2011 Eric Hodel <drbrain@segment7.net>
+
+ * hash.c (key_i): Change rdoc from "the first occurrence" to "an
+ occurrence" since first occurrence is not a specification of
+ Hash#key. [Ruby 1.9 - Bug #4760]
+
+Wed Jun 1 07:26:19 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/pty/pty.c (pty_check): Restore "not reached" comment.
+ [Ruby 1.9 - Bug #4756]
+
+Wed Jun 1 07:21:40 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/zlib/zlib.c: Fix document-method declarations for set_sync and
+ set_comment. [Ruby 1.9 - Bug #4695]
+
+Wed Jun 1 06:43:13 2011 Masaya Tarui <tarui@ruby-lang.org>
+
+ * load.c (loaded_feature_path): cut nonsense loop execution to fix
+ performance bug.
+
+Wed Jun 1 01:16:02 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (rb_mix_module): implement Module#mix.
+
+Wed Jun 1 01:15:12 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (io_encoding_set): should honor already set ecflags since it
+ might be set by mode option. fixed #4804
+
+Wed Jun 1 00:34:04 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec): remove unused
+ variable.
+
+Wed Jun 1 00:32:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec): support instantiation from
+ a Float through Rational.
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_new): ditto.
+
+ * test/bigdecimal/test_bigdecimal.rb (test_global_new_float): add a test for
+ the above changes.
+
+ * test/bigdecimal/test_bigdecimal.rb (test_new_with_float): ditto.
+
+Wed Jun 1 00:07:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_coerce): support coerce with a
+ Rational. The precision used for instantiate a BigDecimal from the
+ given Rational is obtained from the receiver BigDecimal.
+
+ * test/bigdecimal/test_bigdecimal.rb (test_coerce): add a test for the
+ above change.
+
+Tue May 31 23:49:08 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c (offset_to_sec): fixed invalid validation.
+
+Tue May 31 23:43:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec): replace the algorithm for
+ coercing from a Rational to stop requiring "bigdecimal/util.rb".
+ [ruby-core:34318]
+
+ * ext/bigdecimal/bigdecimal.c (GetVpValue): refactoring.
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_new): support instantiation from a
+ Rational.
+
+ * test/bigdecimal/test_bigdecimal.rb (test_global_new_with_rational): add a
+ test for the above change.
+
+ * test/bigdecimal/test_bigdecimal.rb (test_new_with_rational): ditto.
+
+Tue May 31 22:44:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_new): support instantiation a
+ BigDecimal object from an Integer.
+
+ * test/bigdecimal/test_bigdecimal.rb (test_new_with_integer):
+ add for testing the above change.
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_global_new): replace its body
+ with a BigDecimal_new call.
+
+ * test/bigdecimal/test_bigdecimal.rb (test_global_new_with_integer):
+ add for testing the above change.
+
+Tue May 31 22:24:39 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: use simple/complex mode instead of light/right mode.
+ * test/date/*.rb: followed the above changes.
+
+Tue May 31 21:28:33 2011 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/test_signal.rb (TestSignal#test_signal_requiring):
+ initialize SIGINT handler.
+
+Tue May 31 17:03:24 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * lib/net/http.rb, lib/net/protocol.rb: Allow to configure to wait
+ server returning '100 continue' response before sending HTTP request
+ body. See NEWS for more detail. See #3622.
+ Original patch is made by Eric Hodel <drbrain@segment7.net>.
+
+ * test/net/http/test_http.rb: test it.
+
+ * NEWS: Add new feature.
+
+Tue May 31 14:17:49 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * io.c (rb_io_s_pipe): potential bug. the mode of read IO is set as
+ DEFAULT_TEXTMODE in call of io_set_encoding(), and of write IO is
+ also set as it in call of io_new_instance() via rb_protect().
+ so, if DEFAULT_TEXTMODE is not 0, we should check the result of
+ extract_binmode() and avoid crush of default IO mode and the result.
+
+Tue May 31 13:00:17 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * strftime.c (rb_strftime_with_timespec): improved style consistency.
+ constified some variables.
+
+ * test/test_time.rb (TestTime#test_huge_precision): test for #4456.
+
+Tue May 31 12:53:10 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/io/wait/test_io_wait.rb (TestIOWait#{test_nread,test_ready?,
+ test_wait}: give system some time to process the written data.
+
+Tue May 31 12:40:49 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_io.rb (TestIO#test_open_mode): MUST release resources
+ explicitly. fix problem of r31671
+
+Tue May 31 10:49:55 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * vm_exec.c: remove conditions for clang
+ because clang version 3.0 (trunk 132165) doesn't need them.
+
+Mon May 30 22:19:33 2011 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/test_signal.rb (TestSignal#test_signal_requiring): don't
+ close stderr.
+
+Mon May 30 20:22:00 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_signal.rb (TestSignal#test_signal_requiring): small
+ but critical typo of r31642. sorry...
+ [Bug #4798] [ruby-core:36550]
+
+Mon May 30 15:44:16 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * insns.def (opt_mult): as r31805, volatile it.
+ Without this, clang -O fails calculation.
+
+ * numeric.c (fix_mul): ditto.
+
+ * rational.c (f_imul): ditto.
+
+Mon May 30 10:26:51 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * numeric.c (int_pow): make sure to assign the result of x * z.
+ If xz is optimized out, the value won't overflow.
+
+Sun May 29 23:17:29 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * re.c (rb_reg_match): fix rdoc of Regexp#=~.
+ patched by Tsuyoshi Sawada. [Bug #4781]
+
+Sun May 29 23:10:42 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/webrick/https.rb (WEBrick::HTTPRequest#parse_uri):
+ keep parse_uri as private. patched by okkez. [Bug #4773]
+
+Sun May 29 17:53:03 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * numeric.c: add #include "internal.h" for rb_big_uminus() prototype.
+
+Sun May 29 15:09:05 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * numeric.c (flo_round): fix for negative value.
+
+Sun May 29 02:16:53 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/net/http/utils.rb (TestNetHTTPUtils#teardown): add nil check.
+
+Sun May 29 00:22:40 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * process.c (before_exec, after_exec): change from macro to function.
+
+Sat May 28 19:30:17 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * process.c (before_exec, after_exec): change SIGPIPE handler to SIG_DFL
+ before calling execve(). Because r31760 reintroduced an issue that
+ system() may hang up (i.e. [ruby-dev:12261]).
+ * process.c (save_sigpipe, restore_sigpipe): new.
+
+Sat May 28 16:08:16 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * signal.c (Init_signal, default_handler): change default SIGPIPE handler
+ from empty function to SIG_IGN. [ruby-dev:43215]
+ * signal.c (sigpipe): removed.
+
+Sat May 28 03:04:27 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (fill_cbuf): return MORE_CHAR_SUSPENDED when cbuf is not empty.
+
+Sat May 28 02:22:48 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * string.c (rb_str_bytesize): rb_str_bytesize() should use LONG2NUM().
+ Patch by Nikolai Weibull. [Bug #4789] [ruby-core:36511]
+
+Sat May 28 02:06:26 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (fill_cbuf): Fix test-all crash.
+
+Sat May 28 00:58:40 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/ostruct.rb (method_missing): Handle [] and []= correctly.
+ Based on a patch by Caius Durling, bug #4179 [ruby-core:33792]
+
+Fri May 27 23:56:54 2011 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_core.rb (Tester::test_text_frozen): split frozen
+ string test. refs #4783
+
+Fri May 27 22:46:23 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/rbinstall.rb (gem): install gemspec of json. fixed #4784
+
+Fri May 27 22:45:10 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (validate_enc_binmode): do not clear textmode flag if
+ default. fixed #4732
+
+ * io.c (fill_cbuf): finish reading at EOF.
+
+Fri May 27 11:31:51 2011 misfo <tedwardo2@gmail.com>
+
+ * lib/rexml/text.rb (REXML::Text#initialize): prevent an error
+ when passing a frozen string to REXML::Text.new
+
+ dup the string passed in instead of cloning so that it's frozen
+ state is ignored
+
+Fri May 27 08:47:26 2011 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * thread.c (ppoll): typo bug fix.
+
+Fri May 27 08:35:04 2011 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tk/lib/tk.rb: hang-up at exit before calling Tk.mainloop.
+
+ * ext/tk/lib/tk/extconf.rb: cannot make on MinGW [Ruby 1.9 - Bug #4141].
+
+Thu May 27 00:34:07 2011 James Edward Gray II <jeg2@ruby-lang.org>
+
+ * lib/csv.rb: Enhance each() to support Enumerator.
+
+Thu May 26 10:32:11 2011 James Edward Gray II <jeg2@ruby-lang.org>
+
+ * lib/csv.rb: Documentation improvements from Ysiad Ferreiras.
+ [Ruby 1.9 - Bug #4785]
+
+Thu May 26 15:42:02 2011 Cezary Baginski <cezary.baginski@gmail.com>
+
+ * lib/xmlrpc/parser.rb (FaultException): fix to_s and inspect
+
+ * test/xmlrpc/parser.rb: test for the above
+
+Wed May 25 11:54:31 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/curses/curses.c: Remove color constants block.
+ [Ruby 1.9 - Bug #4748]
+
+Wed May 25 09:56:45 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/curses/curses.c: Add missing documentation for button state, MIN
+ and MAX comments. Add Curses. to TABSIZE= and ESCDELAY= methods.
+ [Ruby 1.9 - Bug #4747]
+
+Wed May 25 09:35:31 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/benchmark.rb: Restore nodoc for Benchmark::Job and
+ Benchmark::Report. [Ruby 1.9 - Bug #4726]
+
+Wed May 25 09:29:38 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/net/pop.rb: Hide implementation details from RDoc.
+ [Ruby 1.9 - Bug #4711]
+
+Wed May 25 09:26:29 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/net/ftp.rb: Add :nodoc: for private methods.
+ [Ruby 1.9 - Bug #4710]
+
+Wed May 25 09:19:17 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/zlib/zlib.c: Fix Document-method declarations. Improve
+ Zlib::GzipFile's method catalog. [Ruby 1.9 - Bug #4695]
+
+Wed May 25 08:22:12 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/erb.rb: Hide documentation for implementation details of ERB.
+ [Ruby 1.9 - Bug #4694]
+
+Wed May 25 07:58:14 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/tempfile.rb (Tempfile.{mkdir,rmdir}): revert for backward
+ compatibility.
+
+Wed May 25 07:13:12 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * spec/README: update the description.
+
+Wed May 25 07:12:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/tempfile.rb (Tempfile.{lock,unlock}_tempfile): refactor.
+
+Tue May 24 17:30:36 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * spec/README: fix typo.
+ patched by bowsersenior. https://github.com/ruby/ruby/pull/24
+
+Tue May 24 07:06:34 2011 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tk/lib/tk.rb: fail to start Tk.mainloop (exit immediately) on
+ some environment (reported on [ruby-talk:381444]).
+
+ * ext/tk/lib/tk/canvas.rb: support creating a canvas item object from
+ an item ID number.
+
+ * ext/tk/lib/tk/image.rb: import documents which are pull-requested.
+ [Ruby 1.9 - Feature #4595]
+
+ * ext/tk/lib/tk/extconf.rb: search directories for 64bit library (e.g.
+ /usr/lib64), add some new configure options (see README.tcltklib),
+ and bug fix.
+
+ * ext/tk/lib/tk/README.tcltklib: modify docs for some new configure
+ options.
+
+Tue May 24 04:01:46 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * lib/yaml.rb: switch default YAML engine to Psych, old syck engine
+ may be enabled via YAML::ENGINE.yamler = "syck". [ruby-core:36374]
+
+Mon May 23 09:45:26 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * include/ruby/defines.h (CASEFOLD_FILESYSTEM): Revert r30508. Forgot to
+ include this file in the commit r31692. __APPLE__ is not
+ CASEFOLD_FILESYSTEM again, from this time.
+
+Mon May 23 10:01:02 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_asn1.c: Do not parse zero-tagged values as EOC. Do
+ not let current length become negative for infinite length constructed
+ values. Support constructed values of length zero. Added tests.
+
+Mon May 23 09:19:53 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/net/smtp.rb: Document Net::SMTP::Response. Patch by J.R. Garcia.
+ [Ruby 1.9 - Bug #4768]
+
+Mon May 23 09:03:52 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/test/unit/parallel.rb: Never Ignore SIGINT. When received
+ Interrupt, immediately puts result and exit. [ruby-dev:43571]
+
+ * lib/test/unit.rb: When received Interrupt, wait results from workers
+ and collect them. [ruby-dev:43571]
+
+Mon May 23 09:08:07 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/mathn.rb: Improve documentation. Patch by Sandor Szucs.
+ [Ruby 1.9 - Bug #4767]
+
+Mon May 23 08:45:55 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/ostruct.rb: Improve documentation. Patch by Franklin Webber.
+ [Ruby 1.9 - Bug #4761]
+
+Mon May 23 08:35:24 2011 Eric Hodel <drbrain@segment7.net>
+
+ * hash.c: Improve documentation of Hash#key. Patch by Utkarsh
+ Kukreti. [Ruby 1.9 - Bug #4760]
+
+Mon May 23 08:32:59 2011 Eric Hodel <drbrain@segment7.net>
+
+ * enumerator.c: Improve documentation. Patch by Dave Copeland.
+ [Ruby 1.9 - Bug #4757]
+
+Mon May 23 07:19:45 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * NEWS (openssl): Infinite length support. Different behavior of
+ Constructive and Primitive constructors.
+
+Mon May 23 06:58:33 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_asn1.c: Forbid Constructives whose value is not an
+ Array to prevent segfault. Added test.
+
+Mon May 23 06:33:17 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_asn1.c: Forbid Constructive without infinite
+ length. This also prevents a segfault. Added test and improved
+ documentation.
+
+Mon May 23 05:58:14 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_asn1.c: Fix decoding of infinite length values.
+ Simplified ossl_asn1_decode0 by splitting it into three separate
+ functions. Add tests.
+ [Ruby 1.9 - Bug #4374][ruby-core:35123]
+
+Mon May 23 04:03:46 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_asn1.c (ossl_asn1_initialize): Allow creation of
+ Constructives with an explicit tag_class parameter without
+ automatically setting tagging to :EXPLICIT. Fixes a bug when encoding
+ infinite length primitive values.
+
+Mon May 23 04:03:46 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_asn1.c (ossl_asn1_cons_to_der): Add an additional
+ EOC for infinite length Constructives that are supposed to be encoded
+ with explicit tagging. Also tabify method correctly.
+
+Mon May 23 03:44:39 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_asn1.c (ossl_asn1data_to_der): Remove redundant
+ flag tmp_cons.
+
+Mon May 23 00:35:00 2001 Kenta Murata <mrkn@mrkn.jp>
+
+ * bignum.c (dump_bignum, bigmul1_balance, big_split, biglsh_bang),
+ (bigrsh_bang, big_split3, bigmul1_toom3, bigmul0): implement Toom3 (Toom-Cook)
+ multiplication.
+
+ * include/ruby/defines.h: add format prefixes for BDIGIT and BDIGIT_DBL.
+
+Sun May 22 23:24:02 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_asn1.c: Instead of rb_intern use static symbols to
+ improve performance.
+
+Sun May 22 21:56:51 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_asn1.c: Use OpenSSL constants V_ASN1_xxx instead of
+ hardcoded numbers for initializing class_tag_map.
+
+Sun May 22 21:29:29 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * include/ruby/defines.h (CASEFOLD_FILESYSTEM): Revert r30508. See #4255.
+ Now __APPLE__ is not CASEFOLD_FILESYSTEM again.
+
+ * load.c (loaded_feature_path, rb_feature_p, load_lock): Revert r30508.
+ See #4255. Make $LOADED_FEATURES scanning case-sensitive again.
+
+Sun May 22 18:59:27 2011 Hiroshi Nakamura <nahi@ruby-lang.org>
+
+ * ext/openssl/ossl_asn1.c(ossl_asn1_default_tag): avoid using RCLASS_SUPER
+ to make it compilable. Plus, tabify and change variable definition style.
+
+Sun May 22 18:26:43 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (vm_xcalloc): use calloc provided by platforms.
+ fixes #4754
+
+Sun May 22 11:44:53 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/pty/pty.c: Improve documentation. Patch by David Copeland.
+ [Ruby 1.9 - Bug #4756]
+
+Sun May 22 11:26:39 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/timeout.rb: Improve documentation. Patch by David Copeland.
+ [Ruby 1.9 - Bug #4755]
+
+Sun May 22 11:21:41 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/ipaddr.rb: Improve documentation. Patch by Sandor Szucs.
+ [Ruby 1.9 - Bug #4753]
+
+Sun May 22 11:14:40 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/forwardable.rb: Document def_delegator. Patch by Sandor Szucs.
+ [Ruby 1.9 - Bug #4752]
+
+Sun May 22 11:11:41 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/fileutils.rb: Document block behavior of FileUtils.cd. Patch by
+ Bil Kleb. [Ruby 1.9 - Bug #4751]
+
+Sun May 22 11:07:47 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/curses/curses.c: Complete documentation. Patch by Vincent
+ Batts. [Ruby 1.9 - Bug #4748]
+
+Sun May 22 09:29:43 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_set_program_name):
+ use spawn. it prevent that other tests inherit renamed $0.
+
+Sun May 22 08:57:13 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_asn1.c: Default tag lookup in constant time via hash
+ instead of previous linear algorithm.
+ [Ruby 1.9 - Feature #4309][ruby-core:34813]
+
+Sun May 22 07:54:16 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_digest.c: Explain DSS and DSS1 in documentation.
+
+Sun May 22 07:10:25 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * test/openssl/test_pkey_dsa.rb: Add tests for sign/verify.
+
+Sun May 22 06:07:17 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * test/openssl/test_x509cert.rb: Merge DSA-related tests from ruby_1_8
+ branch.
+
+Sun May 22 04:11:12 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (Init_Thread): add a code comment why the meaningless
+ line is necessary.
+
+Sun May 22 01:35:12 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: modified documentation.
+
+Sat May 21 22:46:26 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_strftime(date_strftime_with_tmx): "%v" means "%e-%b-%Y".
+
+Sat May 21 22:14:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (rb_io_extract_modeenc): accept combination hash and
+ File::Constants. (eg. File.open('yo', :mode => File::WRONLY))
+ [Feature #4742][ruby-core:36338]
+ * test/ruby/test_io.rb (TestIO#test_open_mode): new test.
+
+Sat May 21 21:44:14 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * test/date/test_switch_hitter.rb: new.
+
+Sat May 21 21:18:29 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_{core,parse}.c: moved nearly all core code from ext/date/lib.
+ * ext/date/lib/{date,date/format}.rb: removed nearly all code.
+
+Sat May 21 02:58:46 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/.document: Add curses to documented extensions.
+ * ext/curses/curses.c: Improve documentation. Patch by Vincent Batts.
+ [Ruby 1.9 - Bug #4747]
+
+Sat May 21 02:51:01 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/bigdecimal/lib/bigdecimal/util.rb: Improve documentation. Patch
+ by Pete Higgins. [Ruby 1.9 - Bug #4746]
+
+Sat May 21 02:44:10 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/bigdecimal/lib/bigdecimal/jacobian.rb: Document isEqual. Patch
+ by Kuba Fietkiewicz. [Ruby 1.9 - Bug #4744]
+
+Sat May 21 02:22:34 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/date/lib/date/format.rb: Document date formats. Patch by
+ Clinton Nixon. [Ruby 1.9 - Bug #4743]
+
+Fri May 20 05:15:19 2011 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+
+ * gc.c: Fix build on m68k by 'error: too few arguments to
+ function 'mark_locations_array''.
+
+Fri May 20 04:23:42 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/scanf.rb: Improve documentation. Patch by Gabe McArthur.
+ [Ruby 1.9 - Bug #4735]
+
+Fri May 20 00:58:01 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enc/trans/ibm737-tbl.rb: greek code page. fixes #4738
+
+Thu May 19 14:44:05 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_signal.rb (test_signal_requiring): skip on Windows.
+ we can send SIGINT only to pid 0 and the process itself.
+
+Thu May 19 09:07:08 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib: revert r31635-r31638 and untabify with expand(1).
+
+Thu May 19 07:47:26 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * test/openssl/test_pkey_rsa.rb: Add tests for sign/verify.
+
+Thu May 19 07:19:16 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_pkey.c: Add documentation.
+
+Thu May 19 07:06:56 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/benchmark.rb: Fix indentation.
+ * lib/net/imap.rb: Fix indentation of regular expressions.
+
+Thu May 19 06:36:11 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/net/imap.rb: Fix indentation of EOF for heredoc.
+ * lib/debug.rb (Commands): Fix indentation of EOHELP for heredoc.
+
+Thu May 19 06:30:38 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/mkmf.rb: Fix indentation of EOM for heredoc.
+
+Thu May 19 06:16:41 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib: Convert tabs to spaces for ruby files per
+ http://bugs.ruby-lang.org/projects/ruby/wiki/DeveloperHowto#coding-style
+ Patch by Steve Klabnik [Ruby 1.9 - Bug #4730]
+ Patch by Jason Dew [Ruby 1.9 - Feature #4718]
+
+Thu May 19 06:06:07 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/cgi/util.rb: Improve documentation. Patch by Clinton Nixon.
+ [Ruby 1.9 - Bug #4733]
+ * lib/cgi/core.rb: ditto
+ * lib/cgi/cookie.rb: ditto
+
+Thu May 19 06:02:21 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/tempfile.rb: Document Dir.mkdir and Dir.rmdir. Patch by Clinton
+ Nixon. [Ruby 1.9 - Bug #4728]
+
+Thu May 19 05:57:52 2011 Eric Hodel <drbrain@segment7.net>
+
+ * encoding.c: Improve documentation for Encoding#default_external and
+ Encoding#default_internal.
+
+Wed May 18 22:45:26 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/io/console/lib/console/size.rb (IO#console_size): new
+ method. (EXPERIMENTAL)
+
+Wed May 18 22:41:51 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * internal.h: add for internal use only.
+
+Wed May 18 22:36:43 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (setup_exception): internal exception should be hidden
+
+Wed May 18 20:25:04 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * lib/timeout.rb (Timeout#timeout): don't leak "execution expired"
+ exception. [Bug #4283] [ruby-core:34534].
+
+Wed May 18 06:09:24 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/cmath.rb: Add some examples and improve documentation. Patch by
+ Sandor Szucs. [Ruby 1.9 - Bug #4727]
+
+Wed May 18 05:40:31 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/benchmark.rb: Remove nodoc from Benchmark::Job and
+ Benchmark::Report. Patch by Sandor Szucs. [Ruby 1.9 - Bug #4726]
+
+Wed May 18 05:29:26 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/webrick/compat.rb: Improve documentation. Patch by Sandor
+ Szucs. [Ruby 1.9 - Bug #4725]
+
+Wed May 18 05:10:35 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/tracer.rb: Improve documentation. Patch by Richard Ramsden.
+ [Ruby 1.9 - Feature #4720]
+
+Wed May 18 04:53:41 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/cmath.rb: Improve documentation. Patch by Jason Dew.
+ [Ruby 1.9 - Feature #4717]
+
+Wed May 18 04:50:24 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/net/ftp.rb: Improve documentation. Patch by Vincent Batts.
+ [Ruby 1.9 - Bug #4710]
+
+Wed May 18 03:14:49 2011 Eric Hodel <drbrain@segment7.net>
+
+ * test/test_singleton.rb: Add tests from lib/singleton.rb. Patch by
+ Pete Higgins. [Ruby 1.9 - Bug #4715]
+
+Wed May 18 03:03:07 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/singleton.rb: Improve documentation. Patch by Pete Higgins.
+ [Ruby 1.9 - Bug #4709]
+
+Tue May 17 21:24:04 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_mutex_lock): remove remove_signal_thread_list() call.
+ It's meaningless because lock_interrupt doesn't call
+ add_signal_thread_list().
+
+Tue May 17 20:20:49 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * vm_core.h (rb_thread_struct): add volatile to
+ transition_for_lock because it is not protected by lock.
+
+Tue May 17 20:08:53 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * LEGAL (missing/{elf,tgamma,lgamma_r}.c): they've been replaced by
+ public domain implementations.
+
+ * LEGAL (vsnprintf.c): it has moved to srcdir from missing/.
+
+ * LEGAL (missing/crypt.c): list its original license.
+
+Tue May 17 19:54:26 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * LEGAL (configure): add missing/setproctitle.c
+
+Tue May 17 19:35:01 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ Fix FreeBSD test failure.
+
+ * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_set_program_name):
+ use ps -o command instead of ps -o cmd. FreeBSD doesn't support
+ -o cmd option.
+
+Tue May 17 08:04:26 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_digest.c: Add documentation.
+
+Tue May 17 07:14:58 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/net/http.rb: Improve documentation of proxy configuration
+ methods. Patch by Alf Mikula. [Ruby 1.9 - Bug #4714]
+
+Tue May 17 07:09:01 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/net/pop.rb: Improve documentation. Patch by Vincent Batts.
+ [Ruby 1.9 - Bug #4711]
+ * lib/net/telnet.rb: ditto
+
+Tue May 17 07:00:41 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/net/http.rb: Fix nodoc for Net::HTTP::version_1_1?. Patch by
+ Alf Mikula. [Ruby 1.9 - Bug #4713]
+
+Tue May 17 06:56:26 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/optparse.rb: Add link to make_switch to improve documentation.
+ Patch by David Copeland. [Ruby 1.9 - Bug #4708]
+
+Tue May 17 06:50:40 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/observer.rb: Improve documentation. Patch by David Copeland.
+ [Ruby 1.9 - Bug #4707]
+
+Tue May 17 06:42:53 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/logger.rb: Improve documentation. Patch by David Copeland.
+ [Ruby 1.9 - Bug #4706]
+
+Tue May 17 06:28:14 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/gserver.rb: Improve documentation. Patch by David Copeland.
+ [Ruby 1.9 - Bug #4705]
+
+Tue May 17 06:21:15 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/cgi.rb: Add toplevel documentation to class CGI
+ * lib/cgi/session.rb: Add overview documentation to CGI::Cookie
+ * lib/cgi/html.rb: Don't add CGI::TagMaker documentation to CGI.
+ Patch by David Copeland. [Ruby 1.9 - Bug #4704]
+ * lib/cgi/core.rb: Clean up CGI documentation. Patch by David
+ Copeland. [Ruby 1.9 - Bug #4704]
+ * lib/cgi/cookie.rb: Clean up CGI::Cookie documentation. Patch by
+ David Copeland. [Ruby 1.9 - Bug #4704]
+
+Tue May 17 05:52:30 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/digest: Improve documentation of Digest, Digest::HMAC and
+ Digest::SHA2. Patch by Pete Higgins. [Ruby 1.9 - Bug #4702]
+
+Tue May 17 03:51:42 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/abbrev.rb: Hide copyright and revision information from RDoc.
+ Inspired by patch from David Copeland, bug #4703.
+
+Tue May 17 03:33:21 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/timeout.rb (module Timeout): Hide internal constants. Patch by
+ Pete Higgins. [Ruby 1.9 - Bug #4701]
+
+Mon May 16 11:21:09 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * configure.in, win32/Makefile.sub (RUBY_SO_NAME): add CPU as prefix
+ of RUBY_SO_NAME on x64/ia64 mswin/mingw.
+ [Feature #4602]
+
+Mon May 16 08:00:05 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc.rb: Update to RDoc 3.6.1, allows OpenSSL::Digest to be
+ found.
+
+Mon May 16 05:49:54 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/drb/acl.rb: Add documentation.
+
+Mon May 16 05:13:20 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_asn1.c: Add documentation.
+
+Mon May 16 00:32:05 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/ruby/test_signal.rb (TestSignal#test_signal_process_group):
+ skip if the platform doesn't have :pgroup capability. (i.e. skip
+ if mswin32)
+
+Sun May 15 23:53:31 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * include/ruby/intern.h: resurrect old rb_fd_copy().
+ * thread.c (rb_fd_copy): ditto.
+
+Sun May 15 23:45:11 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * include/ruby/intern.h: remove rb_fd_copy() to rb_fd_dup() and
+ rb_w32_fdcopy() to rb_w32_fd_dup().
+ * win32/win32.c: ditto.
+ * thread.c: ditto.
+
+Sun May 15 22:26:39 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * signal.c (rb_f_kill): accept '-SIGXXX' style signal with Symbol or
+ implicit convertion with #to_str. [ruby-dev:43169] fixes #4362
+ * test/ruby/test_signal.rb (test_signal_process_group): add a test
+ for send signal to process group.
+
+Sun May 15 21:22:35 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * cont.c (cont_init): clear macihne_stack_start/end of saved thread to
+ prevent mark machine stack of GC'ed Thread. root Fiber is not
+ initialized by fiber_init().
+ based on a patch by Serge Balyuk [ruby-core:35891] fixes #4612
+ * test/ruby/test_fiber.rb (test_gc_root_fiber): add test for it.
+
+Sun May 15 21:04:29 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * transcode.c (econv_init): revert r31353. [ruby-dev:43512]
+
+Sun May 15 03:39:35 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/zlib/zlib.c: Improve documentation. Patch by Vincent Batts.
+ [Ruby 1.9 - Bug #4695]
+
+Sun May 15 03:23:46 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/erb.rb: Document ERB::Compiler. Patch by Simon Chiang.
+ [Ruby 1.9 - Bug #4694]
+
+Sun May 15 00:58:47 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ fix mswin32 build error.
+
+ * missing/setproctitle.c: add #ifdef HAVE_UNISTD_H.
+ * win32/Makefile.sub (MISSING): add setproctitle.obj
+
+Sat May 14 22:45:28 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * missing/setproctitle.c: add to include "ruby/util.h".
+
+Sat May 14 19:52:22 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_set_program_name):
+ add for $0 test.
+
+Sat May 14 19:50:46 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * missing/setproctitle.c (compat_init_setproctitle): use
+ ruby_strdup() instead of strdup().
+
+Sat May 14 19:37:31 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * include/ruby/missing.h: add setproctitle() declaration.
+ * missing/setproctitle.c: added.
+ * configure.in: add check for missing/setproctitle.c.
+
+ * ruby.c (ruby_process_options): add to call compat_init_setproctitle().
+ * ruby.c (set_arg0): remove all platform specific code. it's
+ moved to missing/setproctitle.c.
+ * ruby.c (origarg): remove len field. It's no longer used.
+ * ruby.c (get_arglen): removed.
+
+ This patch makes a lot of cleanup set_arg0 related code and fixes
+ [Feature #4689].
+
+Sat May 14 17:42:21 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * process.c (rb_proc_times): improve documentation.
+ [ruby-core:35785] fixes #4581, reported by Andrew Grimm.
+
+Sat May 14 12:12:54 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * test/openssl/test_pkey_dsa.rb: Add basic tests and tests that
+ ensure new public key PEM encoding behavior and ensure backward
+ compatibility.
+ [Ruby 1.9 - Bug #4422] [ruby-core:35328]
+ * test/openssl/test_pkey_rsa.rb: Remove line with 'puts'.
+
+Sat May 14 12:06:49 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc/context.rb (class RDoc): Fix infinite loop caused by
+ re-encountering BasicObject.
+
+Sat May 14 10:32:36 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * test/openssl/test_pkey_rsa.rb: Add tests that ensure new public key
+ encoding behavior and also ensure backward compatibility.
+ [Ruby 1.9 - Bug #4421] [ruby-core:35327]
+
+Sat May 14 09:50:10 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/yaml/dbm.rb: Add documentation. Patch by Justin Collins.
+ [Ruby 1.9 - Bug #4693]
+ * lib/yaml/store.rb: ditto
+
+Sat May 14 09:31:43 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc.rb: Updated to RDoc 3.6
+
+Sat May 14 07:30:29 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych.rb: released a new gem, so increasing version.
+
+Sat May 14 05:08:32 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_digest.c
+ * ext/openssl/ossl_pkey.c
+ * ext/openssl/ossl_pkey.h
+ * test/openssl/pkey/test_pkey_rsa.rb
+ Reverted premature commit. Sorry for the noise!
+
+Sat May 14 05:02:58 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/uri.rb: Add toplevel documentation. Patch by Vincent Batts.
+ [Ruby 1.9 - Bug #4690]
+
+Sat May 14 04:19:06 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * NEWS: Describe altered behaviour for RSA and DSA public key
+ encoding. [Ruby 1.9 - Bug #4421, Bug #4422]
+ [ruby-core:35327,35328]
+
+Sat May 14 02:57:52 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/ipaddr.rb (unless Socket): Document valid*? methods. Patch by
+ Sebastian Martinez. [Ruby 1.9 - Feature #4687]
+
+Sat May 14 02:54:04 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rexml/functions.rb: Add some documentation for REXML::Functions.
+ Patch by Sebastian Martinez. [Ruby 1.9 - Feature #4688]
+
+Sat May 14 02:51:42 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/resolv.rb: Hide private method and state-tracking constants from
+ RDoc. Patch by Mark Turner. [Ruby 1.9 - Feature #4691]
+
+Fri May 13 19:23:21 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * numeric.c (flo_coerce): Add #flo_coerce documentation.
+ Patch by Sebastian Martinez.
+ https://github.com/ruby/ruby/pull/21
+
+Fri May 13 18:42:22 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * README.EXT: fix typo. Patch by William Blackerby.
+ https://github.com/ruby/ruby/pull/19
+
+ * README.EXT.ja: ditto.
+
+Fri May 13 15:22:34 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_select): check invalid handle before doing
+ select operations. see [ruby-dev:43513], [ruby-dev:43535]
+
+Fri May 13 08:34:00 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc/rdoc.rb: Output summary after documentation report.
+ * lib/rdoc/stats/normal.rb: Don't output information for users when
+ we're not on a TTY
+
+Fri May 13 07:49:02 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/fileutils.rb: Hide internal methods from RDoc. Patch by Darragh
+ Curran. [Ruby 1.9 - Bug #4684]
+
+Fri May 13 07:36:23 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/webrick/httpservlet/erbhandler.rb: Add documentation.
+
+Fri May 13 07:04:33 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/mathn.rb: Fix indentation. Patch by Jason Dew.
+ [Ruby 1.9 - Feature #4682]
+
+Fri May 13 06:50:43 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/mathn.rb: Add documentation. Patch by Jason Dew. [Ruby 1.9 -
+ Feature #4667]
+
+Fri May 13 05:44:19 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/logger.rb (class Logger): Document Logger#datetime_format.
+ Patch by Sergio Gil Perez de la Manga. [Ruby 1.9 - Bug #4678]
+
+Fri May 13 05:39:11 2011 Eric Hodel <drbrain@segment7.net>
+
+ * re.c (Init_Regexp): Document option constants. Patch by Vincent
+ Batts. [Ruby 1.9 - Bug #4677]
+ * lib/uri/common.rb (module URI): Documentation for URI. Patch by
+ Vincent Batts. [Ruby 1.9- Bug #4677]
+ * lib/uri/ftp.rb (module URI): ditto
+ * lib/uri/generic.rb (module URI): ditto
+ * lib/uri/http.rb (module URI): ditto
+ * lib/uri/https.rb (module URI): ditto
+ * lib/uri/ldap.rb (module URI): ditto
+ * lib/uri/ldaps.rb (module URI): ditto
+ * lib/uri/mailto.rb (module URI): ditto
+ * process.c (Init_process): Document Process constants. Patch by
+ Vincent Batts. [Ruby 1.9- Bug #4677]
+
+Fri May 13 05:16:38 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rss/atom.rb (module RSS): Document URIs. Patch by Mark Turner.
+ [Ruby 1.9 - #4671]
+ * lib/rss/rss.rb (module RSS): Document exception classes. Patch by
+ Mark Turner. [Ruby 1.9 - #4671]
+
+Fri May 13 02:15:18 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (select_internal): remove unused variable (interrupt_flag).
+
+Thu May 12 18:24:34 2011 Kouhei Sutou <kou@clear-code.com>
+
+ * configure.in: limit to "T" type for prefix of external symbols
+ because x86_64-w64-mingw32-gcc on Debian GNU/Linux generates the
+ following symbol:
+ 0000000068483390 D _GLOBAL__F__conftest_external
+
+ Approved by nobu.
+
+Thu May 12 14:50:52 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/dl/test_base.rb (Fiddle::LIBC_SO): its always msvc*.dll on
+ mswin/mingw.
+
+Thu May 12 14:47:53 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/mkmf.rb (Logging.postpone): copy only when temporary logfile
+ exists.
+
+Thu May 12 12:24:22 2011 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+
+ * ext/openssl/ossl_ssl.c: By trunk@31346, function check of SSLv2 is
+ executed.
+ However, the problem is not revised in this.
+ This adds the control of using function of SSLv2 in made macro by
+ function check.
+
+Thu May 12 08:10:46 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/set.rb (class Set): Add nodoc to internal-use methods. Patch
+ by Pete Higgins. [Ruby 1.9 - Bug #4665]
+
+Thu May 12 08:01:14 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_pkey_ec.c: Allow encryption when PEM-encoding
+ Elliptic Curve private keys.
+ [ruby-core:35329] [Bug #4423]
+
+Thu May 12 07:54:59 2011 Eric Hodel <drbrain@segment7.net>
+
+ * object.c (rb_obj_equal): Add documentation. Patch by Vincent Batts.
+ [Ruby 1.9 - Bug #4664]
+ * lib/rexml: ditto
+ * lib/mkmf.rb: ditto
+ * ext/socket/lib/socket.rb: ditto
+
+Thu May 12 07:30:08 2011 Eric Hodel <drbrain@segment7.net>
+
+ * Various .document files: Update .document files to match files which
+ have documentation.
+
+Thu May 12 07:18:45 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_pkey_dsa.c: Use generic X.509 SubjectPublicKeyInfo
+ format for PEM-encoding DSA public keys.
+ [ruby-core:35328] [Bug #4422]
+
+Thu May 12 06:27:31 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_pkey_rsa.c: Use generic X.509 SubjectPublicKeyInfo
+ format for encoding RSA public keys.
+ [ruby-core:35327] [Bug #4421]
+
+Wed May 11 19:45:27 2011 Keiju Ishitsuka <keiju@ishitsuka.com>
+
+ * lib/forwardable.rb: support 'delegate :foo => :bar' for to meet
+ by specification of RDOC.
+
+Wed May 11 08:36:38 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/webrick: Add documentation for WEBrick::HTTPAuth
+
+Wed May 11 03:06:35 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rss.rb: Add documentation for RSS. Patch by Steve Klabnik.
+ [Ruby 1.9 - Bug #4663]
+
+Tue May 10 14:50:32 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/test/unit.rb: Add option for hiding skip messages when test
+ ends. #4657
+
+ * test/testunit/test_hideskip.rb, test/testunit/test4test_hideskip.rb:
+ test for above.
+
+Tue May 10 10:53:04 2011 Eric Hodel <drbrain@segment7.net>
+
+ * common.mk (rdoc): Add rdoc-coverage rule
+
+Tue May 10 09:13:21 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/webrick: Add Documentation
+
+Tue May 10 04:22:09 Eric Hodel <drbrain@segment7.net>
+
+ * lib/webrick/log.rb: Hide copyright info from ri
+ * lib/webrick/httpstatus.rb: ditto
+ * lib/webrick/htmlutils.rb: ditto
+ * lib/webrick/httpversion.rb: ditto
+ * lib/webrick/version.rb: ditto
+ * lib/webrick/httpauth/userdb.rb: ditto
+ * lib/webrick/httpauth/authenticator.rb: ditto
+ * lib/webrick/accesslog.rb: ditto
+
+Mon May 9 20:57:13 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * test/ruby/test_{complex,rational}.rb: added tests.
+
+Mon May 9 20:29:44 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * complex.c (string_to_c_internal): a refactoring.
+
+Mon May 9 18:33:05 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c: Improve documentation for String#start_with? and
+ String#end_with?. fixes #4652
+ patched by Andrew Grimm <andrew.j.grimm at gmail.com>
+
+Mon May 9 13:49:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * complex.c (string_to_c_internal): support scientific notation.
+ patched by Tinco Andringa. https://github.com/ruby/ruby/pull/16
+ [ruby-core:36046][Bug #4655]
+
+Mon May 9 11:52:48 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * numeric.c (int_ord): remove K&R style.
+ patched by Daehyub Kim. https://github.com/ruby/ruby/pull/17
+
+Sun May 8 22:17:24 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * test/ruby/test_{complex2,complexrational}.rb: use skip.
+ * test/date/*.rb: ditto.
+
+Sun May 8 21:02:31 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * test/ruby/test_{complex2,complexrational}.rb: NEVER SKIP.
+
+Sun May 8 21:01:21 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * test/date/test_date_base.rb: fixed.
+
+Sun May 8 20:54:11 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * test/date/*.rb: NEVER SKIP.
+
+Sun May 8 20:37:33 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * test/date/*.rb: reverted 31432.
+
+Sun May 8 20:32:43 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * test/date/*.rb: reverted 31483.
+
+Sun May 8 19:39:16 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c (native_cond_timedwait): add to care EINTR.
+ * thread_pthread.c (thread_timer): remove EINTR check.
+
+Sun May 8 19:04:15 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * lib/time.rb (xmlschema): avoid passing any negative numbers.
+
+Sun May 8 18:40:03 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_{parse,strptime}.c: introduced some macros.
+
+Sun May 8 17:17:13 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * test/date/*.rb: use skip /w messages.
+
+Sun May 8 17:04:55 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/lib/date/format.rb (_httpdate): omitted to call zone_to_diff.
+
+Sun May 8 16:56:19 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c (date_s_test_*): use macros.
+
+Sun May 8 10:24:16 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c: cleanup signal_thread_list related ifdef.
+ 1) we don't have to use #ifdef FOO-PLATFORM directly 2) About
+ half #ifdef didn't care symbian properly.
+
+Sun May 8 05:19:37 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/io/wait/test_io_wait.rb: Linux socketpair(2) only support
+ AF_UNIX, but windows socketpair doesn't support it. we can't
+ avoid platform check. sigh!
+
+Sun May 8 00:13:05 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/io/wait/test_io_wait.rb: use Socket.pair instead of pipe.
+ Windows can only treat a socket.
+
+Sat May 7 22:43:48 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_fd_zero): remove redundant zero fill.
+
+Sat May 7 22:38:04 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_fd_init): remove volatile qualifier.
+
+Sat May 7 22:34:29 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_fd_init_copy): new internal api. It provide efficient
+ copy constructor semantics.
+ * thread.c (do_select): use rb_fd_init_copy().
+
+Sat May 7 15:18:06 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ fix incorrect native_cond_signal call when deadlock was detected.
+
+ * thread.c (lock_func): decrement cond_waiting if timeout was happen.
+
+Sat May 7 18:28:37 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread_pthread.c (USE_MONOTONIC_COND): check the availability
+ more strictly.
+
+ * thread_pthread.h (rb_thread_cond_t): ditto.
+
+Sat May 7 15:15:10 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ fix win32 native_cond_timedwait() makes SIGSEGV.
+
+ * thread_win32.h (rb_thread_cond_struct): add prev field instead of
+ last. (ie cond_event_entry is now using double linked list instead of
+ single)
+ * thread_win32.c (cond_event_entry): add prev field.
+
+ * thread_win32.c (__cond_timedwait): remove entry properly if timeout
+ was happen.
+
+ * thread_win32.c (native_cond_signal): change for double linked list.
+ * thread_win32.c (native_cond_broadcast): ditto.
+ * thread_win32.c (native_cond_initialize): ditto.
+
+Sat May 7 12:41:04 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ fix mutex deadlock test hang-up.
+
+ * thread_win32.c (abs_timespec_to_timeout_ms): fix 1000x calculation
+ mistake. (ie fix hang-up native_cond_timedwait())
+
+Sat May 7 03:14:13 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ sleep_cond use monotonic time if possible.
+
+ * thread_pthread.c (native_thread_init): change sleep_cond
+ attribute to monotonic.
+ * thread_pthread.c (native_sleep): use native_cond_timeout().
+
+ * thread_pthread.c (native_cond_timeout): add overflow care.
+ * thread_win32.c (native_cond_timeout): ditto.
+
+Sat May 7 02:49:12 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+ fix win32 compile error.
+
+ * thread_win32.c (RB_CONDATTR_CLOCK_MONOTONIC): define
+ RB_CONDATTR_CLOCK_MONOTONIC always.
+ * thread_pthread.c (RB_CONDATTR_CLOCK_MONOTONIC): ditto.
+
+Sat May 7 02:29:41 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ mutex: deadlock check timeout use monotonic time.
+
+ * thread_pthread.c (native_cond_timeout): new internal api.
+ it calculate a proper time for argument of native_cond_timedwait().
+ * thread_win32.c (native_cond_timeout): ditto.
+
+ * thread_pthread.c (thread_timer): use native_cond_timeout()
+ instead of get_ts.
+ * thread.c (lock_func): ditto.
+
+ * thread_pthread.c (get_ts): removed. use native_cond_timeout().
+ * thread.c (init_lock_timeout): ditto.
+
+Sat May 7 01:54:21 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c (get_ts): add monotonic clock capability.
+ * thread_pthread.c (rb_thread_create_timer_thread): use monotonic
+ clock if possible.
+
+Sat May 7 01:43:37 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.h (rb_thread_cond_t): add clockid field. it's
+ no longer an alias of pthread_cond_t.
+ * thread_pthread.c: adapt new rb_thread_cond_t type.
+ * thread.c (mutex_alloc): ditto.
+ * thread_win32.c (native_cond_initialize): ditto.
+ * configure.in: add check for pthread_cond_attr_setclock() and
+ clockid_t type.
+
+Fri May 6 23:29:47 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_wait_for_single_fd): use ppoll() instead of poll()
+ if possible. based on a patch from Eric Wong. [ruby-core:36003].
+
+Fri May 6 23:13:43 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: remove nanosleep check. we no longer use it.
+ r20124 removed last usage.
+
+Fri May 6 22:35:56 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/syck/rubyext.c (mktime_do): extra digits are not used.
+
+Fri May 6 17:43:07 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/syck/rubyext.c (mktime_do): remove unused variable offset.
+
+ * ext/syck/syck.h: use #ifdef instead of #if DEBUG.
+
+Fri May 6 16:27:33 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/date/date_core.c (DAY_IN_NANOSECONDS): refix: 31438.
+ check with LONG_MAX and cast as long; without this the calculation
+ will be done as int and overflow.
+
+Fri May 6 15:01:11 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * ext/syck/rubyext.c (mktime_do): avoid buffer overrun, by
+ silently ignoring lesser significant digits. Required buffer
+ length can be computable so you might at first think of
+ allocating enough memory space on the fly using alloca(). That
+ is a wrong idea because when using alloca there is always risk
+ of integer overflow. A function that accepts outer-process
+ resources like this should not blindly trust its inputs. In
+ this particular case we just want to generate milliseconds
+ resolution by strtod() so the string in question needs no more
+ length than what we originally have. Ignoring lesser
+ significant digits should suffice I believe.
+
+Fri May 6 14:25:53 2011 Tinco Andringa <mail@tinco.nl>
+
+ * ext/syck/rubyext.c (mktime_do): YAML.load time correctly parse
+ usecs smaller than 1 fixes #4571
+
+Thu May 5 22:23:34 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c (native_mutex_reinitialize_atfork): removed
+ unused macro.
+ * thread_win32.c (native_mutex_reinitialize_atfork): ditto.
+
+Thu May 5 22:09:39 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/date/date_core.c (DAY_IN_NANOSECONDS): long long int is not
+ available on all platforms.
+
+Thu May 5 17:36:31 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * eval.c (frame_func_id): store result of method_entry_of_iseq() to
+ cfp->me because method_entry_of_iseq() might become expensive.
+
+Thu May 5 15:03:51 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * eval.c (frame_func_id): __method__ return different name from
+ methods defined by Module#define_method with a same block.
+ [ruby-core:35386] fixes #4606
+ * eval.c (method_entry_of_iseq): new helper function. search control
+ frame stack for a method entry which has given iseq.
+ * test/ruby/test_method.rb: add tests for #4606
+
+Wed May 4 22:13:09 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * benchmark/bm_vm4_pipe.rb: Reduced iterations. Too slow benchmark
+ is bad.
+ * benchmark/bm_vm4_thread_pass.rb: ditto.
+
+Wed May 4 22:08:22 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/date/test_date_base.rb: don't use no message skip().
+
+Wed May 4 21:11:28 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * benchmark/bm_io_select2.rb: reduce number of using file
+ descriptors. because gdb need some fds.
+
+Wed May 4 19:00:59 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_wait_for_single_fd): Fix wrong return value.
+ * test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb
+ (TestWaitForSingleFD#test_wait_for_closed_pipe): test for it.
+
+Wed May 4 18:46:39 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * ext/-test-/wait_for_single_fd: New. for testing
+ rb_wait_for_single_fd() internal function.
+ The patch was written by Eric Wong. [ruby-core:35991]
+
+ * test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb: ditto.
+
+Wed May 4 12:46:25 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_wait_for_single_fd): Added POLLNVAL check.
+ based on a patch from Eric Wong at [ruby-core:35991].
+
+Wed May 4 11:51:01 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (rb_f_select): remove useless ifdef.
+
+Wed May 4 11:42:47 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * ext/socket/init.c (wait_connectable): fix error handling code.
+ RB_WAITFD_OUT is turned on even though an error occur.
+
+Wed May 4 10:12:39 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * ext/readline/readline.c (readline_event): use rb_wait_for_single_fd().
+ The patch was written by Eric Wong. [Ruby 1.9 - Feature #4531]
+
+Wed May 4 10:10:28 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * ext/socket/init.c (wait_connectable): use rb_wait_for_single_fd().
+ The patch was written by Eric Wong. [Ruby 1.9 - Feature #4531]
+
+ * ext/socket/init.c (try_wait_connectable, wait_connectable_ensure):
+ removed.
+
+Wed May 4 10:07:48 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * ext/io/wait/wait.c (io_wait): use rb_wait_for_single_fd().
+ The patch was written by Eric Wong. [Ruby 1.9 - Feature #4531]
+
+Wed May 4 10:01:27 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_wait_for_single_fd): new. poll(2) based backend for
+ rb_wait_for_single_fd().
+ Now only Linux uses it.
+
+ The patch was written by Eric Wong. [Ruby 1.9 - Feature #4531]
+
+Wed May 4 09:56:57 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_wait_for_single_fd): new.
+ * thread.c (select_single): select(2) based backend for
+ rb_wait_for_single_fd().
+
+ * io.c (make_writeconv): use rb_wait_for_single_fd() instead of
+ rb_thread_fd_select().
+ * io.c (rb_io_wait_readable): ditto.
+ * thread.c (rb_thread_wait_fd_rw): ditto.
+
+ * io.c (wait_readable): removed.
+ * thread.c (init_set_fd): new helper function.
+ * include/ruby/io.h (RB_WAITFD_IN, RB_WAITFD_PRI, RB_WAITFD_OUT):
+ new constant for rb_single_wait_fd().
+
+ The patch was written by Eric Wong. [Ruby 1.9 - Feature #4531]
+
+Wed May 4 08:04:59 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: fix time dumping so that
+ Syck can load UTC times that Psych dumps.
+
+Wed May 4 07:33:00 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_fd_copy): fix wrong argument.This issue was pointed
+ out by Eric Wong. [ruby-core:35982]
+
+Tue May 3 20:29:33 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/fileutils/test_fileutils.rb (TestFileUtils#test_chmod_symbol_mode):
+ Skip sticky bit test if the platform is FreeBSD. It doesn't allow to
+ change sticky bit if a target is regular file.
+
+Tue May 3 18:23:57 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * test/date/test_date.rb (TestDate#test_coerce):
+ test for [ruby-core:35127].
+
+Tue May 3 04:27:53 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread.c (rb_thread_select): preserve errno if no error
+ occurred.
+
+Tue May 3 03:57:04 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/intern.h (rb_w32_fdcopy): add prototype. fixes
+ #4640
+
+Mon May 2 01:02:04 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * lib/fileutils.rb (FileUtils#chmod): accept symbolic mode argument.
+ The patch was written by takkanm. [ruby-core:26029][Feature #2190]
+
+ * lib/fileutils.rb (FileUtils#fu_mode): new helper function.
+ * lib/fileutils.rb (FileUtils#symbolic_modes_to_i): ditto.
+ * lib/fileutils.rb (FileUtils#mode_mask): ditto.
+ * lib/fileutils.rb (FileUtils#user_mask): ditto.
+
+ * test/fileutils/test_fileutils.rb (TestFileUtils#test_chmod_symbol_mode):
+ new test for the above symbolic mode.
+ * test/fileutils/test_fileutils.rb (TestFileUtils#test_chmod_R): ditto.
+
+Mon May 2 00:36:12 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * ext/socket/init.c (rsock_connect): add to care EINTR. based
+ on a patch from Eric Wong at [ruby-core:35621][Bug #4555]
+
+Sun May 1 01:06:24 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_thread_select): release GVL while waiting select().
+
+Sat Apr 30 23:10:15 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * win32/win32.c (rb_w32_fdcopy): New. This can copy even though
+ fdset size exceed FD_SETSIZE.
+ * include/ruby/intern.h (rb_fd_copy): use rb_w32_fdcopy()
+
+Sat Apr 30 20:18:43 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (do_select): Change argument type to rb_fdset_t.
+ Now do_select() is free from unexpected hangup if
+ HAVE_RB_FD_INIT=1 [Bug #4636]
+
+ * thread.c (rb_thread_fd_select, rb_thread_wait_fd_rw):
+ adapt new argument type.
+
+ * thread.c (rb_thread_select): make dummy implementation.
+
+Sat Apr 30 20:16:53 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_fd_copy): Change function argument. Now
+ rb_fd_copy() has fully copy semantics.
+ * include/ruby/intern.h: ditto.
+
+Sat Apr 30 20:11:47 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * include/ruby/intern.h (rb_thread_select): mark as deprecated.
+
+ * ext/io/wait/wait.c (wait_readable): use rb_thread_fd_select
+ instead of rb_thread_select.
+ * ext/socket/init.c (wait_connectable0): ditto.
+ * ext/readline/readline.c (readline_event): ditto.
+ * io.c (rb_io_wait_readable, wait_readable, rb_io_wait_writable,
+ wait_writable): ditto.
+
+Sat Apr 30 20:06:36 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (do_select): remove useless ifdef. time calculation
+ is not heavy weight.
+
+Sat Apr 30 16:48:36 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * benchmark/bm_io_select3.rb: New.
+
+Sat Apr 30 16:27:09 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (copy_stream_body, rb_io_s_copy_stream): move rb_fd_init()
+ from copy_stream_body to rb_io_s_copy_stream. fds of passing
+ rb_fd_term() have to be guaranteed initialized.
+
+Sat Apr 30 16:13:17 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * benchmark/bm_io_select.rb, benchmark/bm_io_select2.rb: New.
+ based on a patch from Eric Wong at [Feature #4531]
+
+Sat Apr 30 03:25:53 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/io/wait/test_io_wait.rb: New. for testing ext/io/wait.
+ the patch was written by Eric Wong. [Feature #4531]
+
+Sat Apr 30 00:34:56 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * include/ruby/win32.h: remove redundant declaration of
+ rb_w32_time_subtract().
+
+Sat Apr 30 00:16:40 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c (gvl_init): fix hangup if GVL_SIMPLE_LOCK=1.
+ We don't have to call mutex_unlock() before initialize it!
+
+Fri Apr 29 13:15:15 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_win32.c (native_cond_timedwait): New. r31373 caused
+ win32 build failure.
+
+ * thread_win32.c (__cond_timedwait, abs_timespec_to_timeout_ms):
+ New helper functions.
+
+ * win32/win32.c (rb_w32_time_subtract): rename from subtract and
+ remove static.
+
+Fri Apr 29 10:43:09 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * benchmark/bm_vm4_pipe.rb: Add two new benchmark for GVL
+ performance. They was written by Koichi Sasada.
+ * benchmark/bm_vm4_thread_pass.rb: ditto.
+
+Fri Apr 29 10:25:31 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * vm_method.c (rb_clear_cache_by_class): Revert r29673. It made
+ a segmentation fault regression. [Bug #4289][ruby-core:34554].
+
+Fri Apr 29 10:24:51 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (make_writeconv): do not add textmode newline decorator if any
+ newline decorator is set already. fixes #4618, fixes #4619
+
+Fri Apr 29 10:17:42 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (lock_func): small cleanup.
+
+Fri Apr 29 10:07:13 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_mutex_lock, lock_func): Avoid busy loop and
+ performance regression. bm_vm3_thread_mutex.rb performance
+ change from 109.064sec to 16.331sec. [Feature #4607]
+
+ * thread.c (init_lock_timeout): New helper function.
+
+Thu Apr 28 16:15:49 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/{win32.c,dir.h} (rb_w32_uopendir): new API to pass UTF-8 path.
+
+ * win32/win32.c (opendir_internal, rb_w32_opendir): extract and merge
+ common part of rb_w32_opendir() and rb_w32_uopendir().
+
+ * dir.c (do_opendir, glob_helper): encoding.
+
+ * dir.c (dir_initialize, do_opendir): convert path to UTF-8 and call
+ rb_w32_uopendir() instead of rb_w32_opendir() on Windows.
+ fixes #4491, reported by Joey Zhou.
+
+Thu Apr 28 15:32:53 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/dl/test_base.rb (DL::LIBC_SO): its always msvc*.dll on
+ mswin/mingw.
+
+Thu Apr 28 06:07:06 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/csv.rb (CSV::open): suppress universal newline decorator.
+ fixes #4603
+
+ * lib/csv.rb (CSV.read): no mode is needed.
+
+Thu Apr 28 06:06:56 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (rb_io_extract_modeenc, rb_f_backquote): set default text
+ mode. fixes #4619
+
+ * io.c (pipe_open): set universal newline decorator if needed.
+
+Wed Apr 27 11:33:08 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * enc/trans/emoji_iso2022_kddi.trans: ISO-2022-JP-KDDI doesn't have
+ CP932 UDA. Another reason is emacs-mule: the implementation of
+ stateless-iso-2022-jp doesn't support beyond 94x94 (0x7fxx);
+ but CP932 UDA is in 7Fxx-92xx.
+
+Wed Apr 27 07:42:44 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (STRIP): use proper toolchain. based on a patch
+ from Jon Forums at [ruby-core:35909]. fixes #4617
+
+Wed Apr 27 01:20:59 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c (date_zone_to_diff): renamed.
+ * ext/date/date_parse.c: ditto.
+ * ext/date/date_strptime.c: ditto.
+
+Wed Apr 27 01:16:59 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * encoding.c (enc_find): accept Encoding objects.
+
+Wed Apr 27 00:55:56 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * transcode.c (econv_opts): add newline option.
+
+ * io.c (validate_enc_binmode, rb_io_extract_modeenc): set newline
+ decorator according to open mode.
+
+ * transcode.c (rb_econv_prepare_options): new function, to prepare
+ econv options with newline flags.
+
+ * include/ruby/encoding.h (ECONV_NEWLINE_DECORATOR_MASK): add.
+
+Wed Apr 27 00:51:01 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (rb_file_truncate): fix function.
+
+ * include/ruby/win32.h (ftruncate, truncate, ftello, fseeko): non-64
+ versions on mingw are useless because they use int32_t. fixes #4564
+
+Wed Apr 27 00:50:33 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: modified validation methods.
+ * ext/date/lib/date.rb: ditto.
+
+Wed Apr 27 00:00:37 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c (dt_lite_set_tmx): should get df value.
+
+Tue Apr 26 22:34:04 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/lib/date/format.rb (_iso8601): allowed day only civil
+ date. disallowed separatorless day only ordinal date.
+
+Mon Apr 25 21:31:36 2011 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+
+ * ext/openssl/extconf.rb: Should check SSLv2_*method.
+ openssl compiled with "no-ssl2" the extconf don't fail
+ when running `make' having this compilation errors.
+ Patched by Laurent Arnoud. fixes #4562, #4556
+
+Mon Apr 25 20:53:32 2011 Tajima, Akio <artonx@yahoo.co.jp>
+
+ * win32/win32.c (kill): accept 0 only sig is SIGINT #4596
+
+Mon Apr 25 19:59:47 2011 Tajima, Akio <artonx@yahoo.co.jp>
+
+ * win32/win32.c (kill): accept 0 as pid, fixes #4596
+
+Mon Apr 25 16:43:45 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * random.c (random_rand): remove unused variables.
+
+ * struct.c (rb_struct_define_without_accessor): ditto.
+
+ * strftime.c (rb_strftime_with_timespec): ditto.
+
+ * sprintf.c: ditto.
+
+ * time.c (time_asctime): remove useless GetTimeval().
+
+ * thread_pthread.c: cast to (void *) for %p.
+
+Mon Apr 25 11:02:11 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/ripper/lib/ripper/sexp.rb: fix rdoc around sexp.
+ patched by Sho Hashimoto. fixes #4599
+
+Mon Apr 25 08:24:04 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * random.c (rb_f_rand, random_s_rand): RDocs for them.
+
+Mon Apr 25 07:18:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * random.c (random_s_rand, Init_Random): Random.rand should behave as
+ Random::DEFAULT.rand rather than Kernel#rand.
+
+ * random.c (rand_range, random_rand): rand_range function extracted
+ from random_rand function.
+
+ * random.c (rb_f_rand): accept a Range argument as Random#rand
+ [ruby-dev:43427] #4605
+
+Mon Apr 25 03:31:06 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * lib/time.rb: require 'date'.
+ * ext/date/lib/date/format.rb: removed require line.
+
+Mon Apr 25 03:08:39 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/lib/date/format.rb: require 'date'.
+
+Mon Apr 25 03:04:16 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/lib/date/format.rb (_iso8601): added a pattern.
+
+Mon Apr 25 02:51:22 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/date/lib/date/format.rb: require 'date_core.so'.
+ date/format needs methods which are now in date_core.so.
+ This breaks make rdoc which uses Date._parse from time.rb.
+
+Mon Apr 25 02:47:46 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/lib/date/format.rb (_iso8601): fixed a bug of regex.
+
+Mon Apr 25 02:12:26 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/lib/date/format.rb: an adjustment of regex.
+
+Mon Apr 25 01:58:50 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/lib/date/format.rb: omitted to call _parse.
+
+Mon Apr 25 01:03:03 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * string.c (rb_to_id): remove unused variable.
+
+Sun Apr 24 22:19:05 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * complex.c, rational.c: omitted some method calls.
+
+Sun Apr 24 02:57:27 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_parse.c (n2i): takes long.
+
+Sun Apr 24 02:51:06 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_parse.c: reverted.
+
+Sun Apr 24 02:25:23 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * include/ruby/intern.h: pcc can't use __builtin_constant_p.
+
+ * vm_exec.c: change condition.
+
+Sun Apr 24 01:58:01 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/date/date_core.c (leap_p): suppress warning: parentheses.
+
+ * ext/date/date_core.c (date_s__parse_internal): remove unused
+ variable "str".
+
+ * ext/date/date_parse.c (parse_ddd_cb): use RSTRING_LENINT.
+
+ * ext/date/date_strftime.c (date_strftime_with_tmx): remove unused
+ variable.
+
+Sun Apr 24 00:34:23 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_parse.c: removed some unused macros. use strchr()
+ instead of index().
+
+Sat Apr 23 21:29:42 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: replacement of implementation of
+ _parse. [experimental]
+ * ext/date/date_parse.c: new.
+ * ext/date/lib/date/format.rb: removed ruby version of _parse.
+
+Fri Apr 22 12:04:15 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * array.c (rb_ary_sort_bang): fix rdoc.
+ patched by burningTyger. https://github.com/ruby/ruby/pull/11
+
+Fri Apr 22 11:49:49 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/xmlrpc/create.rb (XMLRPC::Create#conv2value):
+ XML-RPC's int is 32bit int, and Fixnum also may be beyond 32bit.
+
+ * lib/xmlrpc/create.rb (XMLRPC::Create#conv2value):
+ XML-RPC doesn't allow Infinity and NaN.
+ http://www.xmlrpc.com/spec
+
+Fri Apr 22 04:16:14 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/parser.c (parse): strings from psych have proper taint
+ markings.
+
+ * test/psych/test_tainted.rb: test for string taint
+
+Thu Apr 21 01:30:02 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * random.c (rb_f_srand): fix rdoc: srand(0)'s 0 is a seed.
+ [ruby-core:35833] fixes #4590
+
+Thu Apr 21 01:01:28 2011 Masaya Tarui <tarui@ruby-lang.org>
+
+ * win32/win32.c (CreateChild): maximum length of lpCommandLine is
+ 32,768 characters, including the Unicode terminating null character.
+
+Wed Apr 20 21:32:11 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_strptime.c (date__strptime_internal): do not
+ overwrite local variables.
+
+Wed Apr 20 14:41:28 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_str_each_line): check string's length when compare
+ separator and string. [ruby-core:35815] fixes #4586
+
+Wed Apr 20 00:02:13 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * misc/ruby-mode.el (ruby-parse-partial): use position of open paren.
+
+Tue Apr 19 01:00:21 2011 Tajima Akio <artonx@yahoo.co.jp>
+
+ * test/ruby/test_io.rb (TestIO#test_cross_thread_close_fd):
+ skip cross thread pipe close if windows
+
+Mon Apr 18 12:15:46 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_range.rb (TestRange#test_step_ruby_core_35753):
+ avoid float error. [ruby-core:35804]
+
+Sun Apr 17 00:20:14 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_{core,strftime}.c: use struct tmx instead of vtm.
+ * ext/date/date_tmx.h: new.
+
+Sat Apr 16 22:23:52 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_strftime.c (date_strftime_wo_timespec): changed
+ the way of validation of locale modifiers.
+
+Sat Apr 16 21:55:12 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: replacement of implementation of
+ _strptime. [experimental]
+ * ext/date/date_strptime.c: new.
+ * ext/date/lib/date/format.rb: removed ruby version of _strptime.
+
+Sat Apr 16 10:18:30 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * vm.c (Init_VM): suppress warning: "OPT_BASIC_OPERATIONS" is not
+ defined.
+
+Fri Apr 15 23:41:18 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * ruby.c (proc_options): suppress warning:
+ "ALLOW_DEFAULT_SOURCE_ENCODING" is not defined.
+
+Fri Apr 15 15:10:29 2011 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/uri/generic.rb (#route_from_path): Fix a bug where
+ URI('http://h/b/').route_to('http://h/b') wrongly returned './'
+ (should be '../b'). [Bug #4476]
+
+Fri Apr 15 14:58:06 2011 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/fileutils.rb (FileUtils#touch): Fix corrupted output when
+ mtime is specified in addition to nocreate (and verbose).
+ ref [ruby-dev:43401]
+
+Thu Apr 14 23:43:43 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * numeric.c (ruby_float_step): wrong loop condition.
+ fixes [ruby-core:35753], reported by Joey Zhou.
+
+ * test/ruby/test_range.rb (TestRange#test_step_ruby_core_35753):
+ test above change.
+
+Thu Apr 14 22:48:12 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::Options#setup_options): set possible
+ values for completion. no conversion is needed.
+
+ * lib/test/unit.rb (Test::Unit::Runner::Worker#initialize): use
+ positional arguments instead of keyword arguments.
+
+ * lib/test/unit.rb (Test::Unit::Runner#jobs_status): io/console may
+ not be available. use 80 as the last resort if IO#winsize and
+ COLUMNS are unavailable.
+
+ * lib/test/unit.rb (Test::Unit::Runner::Worker#died): rename using a
+ verb.
+
+ * lib/test/unit.rb (Test::Unit::Runner#_run_parallel): check if worker
+ is signaled and use its exit status.
+
+ * lib/test/unit.rb (Test::Unit::Runner::Worker#dead): no longer @in
+ and @out are separated.
+
+Thu Apr 14 21:23:29 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * variable.c (rb_autoload_p): search superclasses as same as actual
+ loading. fixes [ruby-core:35679]
+
+Thu Apr 14 21:21:06 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/win32.h (frexp, modf): wrongly declared as pure in
+ mingw math.h.
+
+ * include/ruby/win32.h (ftruncate, truncate): mingw64 misses
+ prototypes.
+
+ * win32/win32.c (rb_w32_read): suppress warning.
+
+Thu Apr 14 19:55:54 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * lib/fileutils.rb (FileUtils#touch): fix corrupted output when
+ FileUtils.touch(:nocreate => true, :verbose => true) case.
+ The patch was written by Hiroyuki Iwatsuki. [ruby-dev:43401]
+
+Thu Apr 14 16:01:45 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * io.c (rb_f_syscall): suppress warning: "HAVE___SYSCALL" is not
+ defined.
+
+Thu Apr 14 00:41:09 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * thread.c (thread_fd_close_i): IOError exception should be assigned
+ to rb_thread_t::thrown_errinfo.
+
+Wed Apr 13 20:12:26 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * io.c (rb_io_fdatasync): remove unused variable.
+
+Tue Apr 12 20:54:12 2011 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/st.h: parenthesize macro arguments.
+
+Tue Apr 12 19:19:50 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/common.rb: avoid race condition. fixes #4572
+
+Tue Apr 12 18:07:13 2011 TAKAO Kouji <kouji@takao7.net>
+
+ * ext/readline/extconf.rb: --disable-libedit to disable
+ libedit. fixes #4550
+
+Tue Apr 12 10:37:39 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * include/ruby/win32.h: VC doesn't have ftruncate() and others, but
+ ruby needs HAVE_ macros to use our emulation functions.
+ (fix the problem of 31262)
+
+Tue Apr 12 01:33:00 2011 Luis Lavena <luislavena@gmail.com>
+
+ * configure.in: properly evaluate existence of truncate, ftruncate
+ and ftello for MinGW. [ruby-core:35678]
+ * win32/win32.c: rename truncate, ftruncate and ftello to avoid
+ redefinitions.
+ * win32/win32.h: ditto.
+
+Mon Apr 11 21:51:52 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c: revert r31230. Because it made a regression.
+ [ruby-core:35631]
+
+Mon Apr 11 21:49:18 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/ruby/test_io.rb: Added TestIO#test_cross_thread_close_stdio
+ and TestIO#test_cross_thread_close_fd.
+ The patch was written by Eric Wong. [ruby-core:35669]
+
+Mon Apr 11 21:15:54 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * file.c (rb_group_member): kill 256K of stack usage.
+ the patch was written by Eric Wong. [ruby-core:35699]
+
+Mon Apr 11 07:24:13 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/openssl/ossl.c: Fix typo, document version constants.
+
+Sun Apr 10 22:23:45 2011 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/ruby.h: parenthesize macro arguments.
+
+Sat Apr 9 23:31:47 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * ext/stringio/stringio.c (strio_each, strio_readlines):
+ Use `NUM2LONG` instead of `FIX2INT`. Fixes [ruby-dev:43395].
+
+Sat Apr 9 23:22:27 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * ext/stringio/stringio.c (strio_each):
+ Fix exception message and don't raise immediately if block is not
+ given.
+ Fixes [ruby-dev:43394].
+
+ * test/stringio/test_stringio.rb (test_each_line_limit_0):
+ Fix test for above.
+
+Sat Apr 9 21:54:15 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * ext/stringio/stringio.c (strio_each, strio_readlines):
+ limit must not be zero. Fixes [ruby-dev:43392].
+
+ * test/stringio/test_stringio.rb: Add tests for above.
+
+Sat Apr 9 18:01:36 2011 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/util.h: parenthesize macro arguments.
+
+Fri Apr 8 16:01:56 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/stringio/stringio.c (strio_getline): check whether str is
+ a string when str and lim are given.
+ https://twitter.com/watson1978/status/56225052152168449
+
+Thu Apr 7 20:03:52 2011 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/io.h: parenthesize macro arguments.
+
+Wed Apr 6 21:08:31 2011 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/intern.h: parenthesize macro arguments.
+
+Wed Apr 6 15:12:40 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/openssl/ossl_pkey_dh.c (ossl_dh_initialize):
+ pop pushed error after each try of reading. fixes #4550
+
+ * ext/openssl/ossl_pkey_dsa.c (ossl_dsa_initialize): ditto.
+
+ * ext/openssl/ossl_pkey_ec.c (ossl_ec_initialize): ditto.
+
+Wed Apr 6 11:36:44 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/openssl/ossl_pkey_rsa.c (ossl_rsa_initialize):
+ pop pushed error after each try of reading. fixes #4550
+
+Tue Apr 5 20:33:43 2011 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/encoding.h: parenthesize macro arguments.
+
+Mon Apr 4 22:02:16 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * ext/io/nonblock/nonblock.c (io_nonblock_set): Avoid F_SETFL if
+ we're not changing the O_NONBLOCK bit. F_SETFL is an expensive
+ operation since it needs to affect all processes with the same
+ file object.
+ The patch is written by Eric Wong. [ruby-core:35556]
+
+Mon Apr 4 21:41:26 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (rb_io_syswrite): While local FS writes are usually
+ buffered, the buffers can be full or the file opened with
+ O_SYNC. IO#syswrite can also be used on blocking IOs
+ (pipe/socket) just like IO#write.
+ The patch is written by Eric Wong. [ruby-core:35554]
+
+Mon Apr 4 11:50:40 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/test_tempfile.rb: simply ignore platform dependent testcases
+ instead of skipping.
+
+Sun Apr 3 22:52:22 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * ext/syslog/syslog.c: improve rdoc.
+ a patch by Jonas Pfenniger. [ruby-core:35592] fixes #4545
+
+Sun Apr 3 22:10:09 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/zlib/zlib.c: parenthesize macro arguments.
+
+Sun Apr 3 21:33:58 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: disable fdatasync again on Mac OS X.
+ [ruby-core:35493][Bug #4500]
+
+Sun Apr 3 21:16:20 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (io_reopen): IO#close releases GVL if possible.
+ close() may block for certain file types (NFS, SO_LINGER
+ sockets, inotify), so let other threads run. The patch was
+ created by Eric Wong [ruby-core:35555][Bug #4527]
+
+ * io.c (fptr_finalize): ditto.
+
+ * io.c (maygvl_fclose): new.
+ * io.c (nogvl_fclose): ditto.
+ * io.c (maygvl_close): ditto.
+ * io.c (nogvl_close): ditto.
+
+Fri Apr 1 22:25:50 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/syslog/syslog.c: parenthesize macro arguments.
+
+Fri Apr 1 18:53:06 2011 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+
+ * lib/webrick/cookie.rb (WEBrick::Cookie.parse): 'white space is
+ permitted between tokens' according to RFC2965. Though 'Netscape
+ spec' does not define the syntax clearly, make it tolerant as a
+ server. As a real-world example, rest-client gem sends
+ 'Cookie: foo=1;bar=2'
+
+ * test/webrick/test_cookie.rb (test_parse_non_whitespace): test it.
+
+Fri Apr 1 13:19:20 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_core.h (RUBY_VM_CHECK_INTS_TH): merge a patch by ko1
+ in [ruby-dev:43373].
+
+Thu Mar 31 23:15:46 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * misc/ruby-mode.el (ruby-brace-to-do-end, ruby-do-end-to-brace):
+ adjust space between block beginning and block arguments
+
+Thu Mar 31 20:42:05 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/strscan/strscan.c: parenthesize macro arguments.
+
+Thu Mar 31 18:06:12 2011 Shugo Maeda <shugo@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_get_ev_const): should ignore crefs with
+ the NODE_FL_CREF_PUSHED_BY_EVAL flag.
+
+Thu Mar 31 16:49:56 2011 Shugo Maeda <shugo@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_get_ev_const): search root cref properly.
+ [ruby-dev:43365]
+
+Thu Mar 31 14:50:25 2011 Shugo Maeda <shugo@ruby-lang.org>
+
+ * eval.c (rb_mod_s_constants): should ignore crefs with
+ the NODE_FL_CREF_PUSHED_BY_EVAL flag.
+
+Wed Mar 30 22:55:47 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * misc/ruby-mode.el (ruby-toggle-block): toggle do/end and {}.
+
+ * misc/ruby-mode.el (ruby-move-to-block): move to opening of
+ block.
+
+Wed Mar 30 14:35:15 2011 Shugo Maeda <shugo@ruby-lang.org>
+
+ * vm_insnhelper.h (COPY_CREF): should copy
+ the NODE_FL_CREF_PUSHED_BY_EVAL flag to hide constants from
+ methods defined by class_eval. [ruby-dev:43365]
+
+Wed Mar 30 00:24:53 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/stringio/stringio.c: parenthesize macro arguments.
+
+Tue Mar 29 21:51:31 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * object.c (rb_String): Kernel#String should call to_str before to_s.
+
+Tue Mar 29 10:28:08 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/webrick/test_filehandler.rb
+ (WEBrick::TestFileHandler#test_short_filename): the cgi doesn't exist
+ on current directory.
+
+Tue Mar 29 05:19:57 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/raddrinfo.c: parenthesize macro arguments.
+
+Tue Mar 29 00:03:51 2011 Tajima Akio <artonx@yahoo.co.jp>
+
+ * test/webrick/test_filehandler.rb (test_short_filename):
+ read real short filename by cmd because smb mounted files
+ have different naming convention.
+
+Mon Mar 28 11:38:08 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/date/date_core.c (date_s_today): use int for year.
+
+ * ext/date/date_core.c (datetime_s_now): ditto.
+
+Mon Mar 28 11:07:41 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/extmk.rb: set MFLAGS from MAKEFLAGS when using nmake.
+
+Mon Mar 28 11:07:00 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * common.mk (love): all you need is love.
+
+Sun Mar 27 23:16:31 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/ipsocket.c: parenthesize macro arguments.
+
+Sun Mar 27 16:55:34 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * misc/ruby-mode.el (ruby-mode-map): remove unnecessary
+ binding. fixes
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468952
+
+ * misc/ruby-mode.el: suppress warnings at byte compile. fixes
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=502926
+
+Sun Mar 27 11:18:35 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: removed unused variables.
+
+Sat Mar 26 15:16:09 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/getaddrinfo.c: parenthesize macro arguments.
+
+Sat Mar 26 05:27:34 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/date/lib/date/format.rb (DateTime#strftime): removed because
+ date_core defines it.
+
+Fri Mar 25 21:59:45 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: should not force cast with macros.
+
+Fri Mar 25 21:56:10 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/sdbm/init.c: parenthesize macro arguments.
+
+Fri Mar 25 19:39:40 2011 Ben Walton <bwalton@artsci.utoronto.ca>
+
+ * test/test_syslog.rb:
+ Skip syslog tests that rely on LOG_PERROR unless it's defined
+
+ Instead of checking looking at the platform to determine if the tests
+ relying on LOG_PERROR should be run, look for the definition of the
+ constant as this will be robust against all platforms as long as the
+ underlying syslog.c code sets it up correctly.
+
+ This specifically addresses failures on Solaris 9.
+
+ Use LOG_PID instead of LOG_PERROR in Syslog.open test
+
+ LOG_PERROR isn't a POSIX option for syslog, so it fails on platforms
+ that don't define it. Solaris 9 and 10 are examples of this.
+
+ Use LOG_PID instead.
+
+Fri Mar 25 15:42:17 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/sdbm/_sdbm.c (sdbm_open): use size_t.
+
+ * ext/syck/bytecode.c: ditto.
+
+ * ext/sdbm/_sdbm.c (delpair): use ptrdiff_t.
+
+ * ext/sdbm/init.c: use RSTRING_LENINT.
+
+ * ext/dl/handle.c: suppress warning: shorten-64-to-32.
+
+ * ext/strscan/strscan.c: ditto.
+
+ * ext/syck/emitter.c: ditto.
+
+ * ext/syck/implicit.c: ditto.
+
+ * ext/syck/syck.c: ditto.
+
+ * ext/syck/token.c: ditto.
+
+Fri Mar 25 12:14:58 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/nkf/nkf-utf8/nkf.c: import nkf 7f18e30.
+
+Fri Mar 25 11:49:29 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_process.rb (TestProcess#test_no_curdir): skip silently
+ on Windows, because this tests a platform specific feature and it'll
+ never be supported on ruby on Windows.
+
+ * test/ruby/test_dir_m17n.rb
+ (TestDir_M17N#test_filename_extutf8_invalid,
+ TestDir_M17N#test_filename_as_bytes_extutf8): ditto.
+
+ * test/open-uri/test_open-uri.rb
+ (TestOpenURI#test_find_proxy_case_sensitive_env): ditto.
+
+ * test/dl/test_handle.rb (DL::TestHandle#test_NEXT,
+ DL::TestHandle#test_DEFAULT): ditto.
+
+Thu Mar 24 23:06:29 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_get_ev_const): should not autoload in
+ defined? mode.
+
+ * variable.c (rb_const_defined_0): fix autoloading base.
+ [ruby-core:35509]
+
+Thu Mar 24 22:48:43 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/sdbm/_sdbm.c: parenthesize macro arguments.
+
+Thu Mar 24 14:45:57 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/openssl/ossl.c: suppress warning: shorten-64-to-32.
+
+ * ext/openssl/ossl.h: ditto.
+
+ * ext/openssl/ossl_asn1.c: ditto.
+
+ * ext/openssl/ossl_bio.c: ditto.
+
+ * ext/openssl/ossl_bn.c: ditto.
+
+ * ext/openssl/ossl_cipher.c: ditto.
+
+ * ext/openssl/ossl_hmac.c: ditto.
+
+ * ext/openssl/ossl_ns_spki.c: ditto.
+
+ * ext/openssl/ossl_ocsp.c: ditto.
+
+ * ext/openssl/ossl_pkcs5.c: ditto.
+
+ * ext/openssl/ossl_pkey.c: ditto.
+
+ * ext/openssl/ossl_pkey_dh.c: ditto.
+
+ * ext/openssl/ossl_pkey_dsa.c: ditto.
+
+ * ext/openssl/ossl_pkey_ec.c: ditto.
+
+ * ext/openssl/ossl_pkey_rsa.c: ditto.
+
+ * ext/openssl/ossl_rand.c: ditto.
+
+ * ext/openssl/ossl_ssl.c: ditto.
+
+ * ext/openssl/ossl_x509ext.c: ditto.
+
+ * ext/openssl/ossl_x509name.c: ditto.
+
+Thu Mar 24 11:48:19 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/openssl/ossl_rand.c (ossl_rand_egd_bytes): use NUM2INT because
+ the result is used with functions whose argument is int.
+
+ * ext/openssl/ossl_ssl.c (ossl_sslctx_setup): ditto.
+
+ * ext/openssl/ossl_x509store.c (ossl_x509store_set_purpose): ditto.
+
+ * ext/openssl/ossl_x509store.c (ossl_x509store_set_trust): ditto.
+
+ * ext/openssl/ossl_x509store.c (ossl_x509stctx_set_purpose): ditto.
+
+ * ext/openssl/ossl_x509store.c (ossl_x509stctx_set_trust): ditto.
+
+Thu Mar 24 11:36:55 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/openssl/ossl_x509name.c: id_aref's type is ID.
+
+Thu Mar 24 10:04:35 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/io/console/console.c (console_set_winsize):
+ suppress warning: shorten-64-to-32.
+
+Thu Mar 24 09:56:19 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/openssl/ossl_ocsp.c (ossl_ocspreq_verify): flags is VALUE,
+ so it should use NUM2INT.
+
+ * ext/openssl/ossl_ocsp.c (ossl_ocspbres_verify): ditto.
+
+Wed Mar 23 21:09:29 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/readline/readline.c: parenthesize macro arguments.
+
+Wed Mar 23 08:07:33 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * numeric.c (flo_round): fix inaccurate results.
+
+Wed Mar 23 00:12:16 2011 Tajima Akio <artonx@yahoo.co.jp>
+
+ * win32/win32.c: wait process real termination after reading
+ exit code. fixes #4518
+
+Tue Mar 22 21:20:10 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/rubygems/test_case.rb: save current dir to @current_dir
+ before Dir.chdir.
+
+Tue Mar 22 20:10:04 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/psych/parser.c: parenthesize macro arguments.
+
+Tue Mar 22 20:10:01 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ruby_missing.h: parenthesize macro arguments.
+
+Tue Mar 22 13:33:22 2011 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+
+ * ext/openssl/lib/openssl/buffering.rb: removed circular require of
+ openssl.rb.
+
+ * ext/openssl/lib/openssl/*: removed following comment for transition
+ measures of avoiding circular require. No one claimed about this as
+ far as I know.
+ ##
+ # Should we care what if somebody require this file directly?
+ # require "openssl"
+
+Tue Mar 22 10:57:36 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * test/runner.rb: set Gem::TestCase's @@project_dir.
+
+ * lib/rubygems/test_case.rb: set Gem::TestCase's @@project_dir only
+ when it is not defined.
+
+Tue Mar 22 09:38:19 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * numeric.c (flo_round): use pow instead of while-loop. fixes #4510
+ patched by Alex Young [ruby-core:35526]
+
+Tue Mar 22 06:47:46 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/date/date_strftime.c (date_strftime_wo_timespec):
+ suppress warning: shorten-64-to-32.
+
+Tue Mar 22 06:42:42 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/date/date_core.c: suppress warning: shorten-64-to-32.
+
+Tue Mar 22 06:41:37 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/test/unit/parallel.rb: remove unused variable.
+
+Tue Mar 22 06:19:42 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * enc/utf_16le.c: suppress warning: shorten-64-to-32.
+
+ * ext/dbm/dbm.c: ditto.
+
+ * ext/gdbm/gdbm.c: ditto.
+
+ * parse.y (Init_ripper): suppress warning: unused value.
+
+Mon Mar 21 11:21:32 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/test/unit.rb: Refactoring. Unified if and elsif.
+
+Sun Mar 20 23:09:34 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_strftime.c: checks duplicated modifiers.
+
+Sun Mar 20 22:32:30 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_strftime.c: removed unused code and arguments.
+
+Sun Mar 20 21:34:49 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: replacement of implementation of
+ strftime. It has some limitations that is same as Time's
+ one. [experimental]
+ * ext/date/date_strftime.c: new.
+ * ext/date/lib/date/format.rb: removed ruby version of strftime.
+
+Sun Mar 20 12:43:12 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_x509store.c: parenthesize macro arguments.
+
+Sun Mar 20 01:39:48 2011 Tajima Akio <artonx@yahoo.co.jp>
+
+ * hash.c (ruby_setenv): check env process block size with OS ver.
+ * win32/win32.c: export rb_w32_osver for above patch.
+ * include/ruby/win32.h: declare rb_w32_osver for Win32 Libs.
+
+Sat Mar 19 18:35:05 2011 Tajima Akio <artonx@yahoo.co.jp>
+
+ * hash.c (ruby_setenv): calculate total env block size for win32.
+ * test/ruby/test_env.rb: add test for above patch.
+
+Sat Mar 19 17:14:46 2011 Tajima Akio <artonx@yahoo.co.jp>
+
+ * hash.c (ruby_setenv): checking with max process environment
+ block size for Win32. 32767 for 2000/XP, 2003. if failed to
+ read the block, then checking with 5120 for earlier Windows.
+
+Sat Mar 19 12:30:25 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_x509revoked.c: parenthesize macro arguments.
+
+Fri Mar 18 20:44:36 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_x509req.c: parenthesize macro arguments.
+
+Fri Mar 18 08:48:06 2011 Oleg Shaldybin <oleg.shaldybin@gmail.com>
+
+ * lib/fileutils.rb (FileUtils::Entry_#copy_file): updated FileUtils.cp
+ to still copy file permissions when :preserve is false (as cp does
+ this even when -p isn't set).
+
+Fri Mar 18 00:59:38 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/win32ole/extconf.rb (create_docfile): removed. should not
+ modify source directory unnecessarily, platform dependent
+ documentation should be dealt with by rdoc. [ruby-core:35495]
+
+Fri Mar 18 00:54:20 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/ruby.h (rb_funcall_passing_block): add prototype.
+ a patch by James M. Lawrence at [ruby-core:35501]
+
+Wed Mar 17 06:23:31 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_x509name.c: parenthesize macro arguments.
+
+Wed Mar 16 20:36:56 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/ipsocket.c (init_inetsock_internal): raise an error on
+ listen(2) failure.
+ reported by Xavier Shay. [ruby-core:35505]
+
+Wed Mar 16 15:06:21 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/openssl/lib/openssl/buffering.rb (module OpenSSL): #flush should
+ not change sync mode on exception.
+ * test/openssl/test_buffering.rb: added
+
+Wed Mar 16 13:45:28 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/openssl/lib/openssl/buffering.rb: de-nest Buffering module
+
+ * ext/openssl/lib/openssl/buffering.rb: add RDoc
+
+Wed Mar 16 08:40:39 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_x509ext.c: parenthesize macro arguments.
+
+Tue Mar 15 18:34:27 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_x509crl.c: parenthesize macro arguments.
+
+Tue Mar 15 09:49:03 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * test/misc/test_ruby_mode.rb (test_singleton_class): Skip for Pending.
+
+Mon Mar 14 21:20:44 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * test/ruby/test_require.rb (test_require_too_long_filename):
+ increase path length, because MAXPATHLEN is defined as 4096 on linux.
+
+ * test/ruby/test_require.rb (test_require_path_home_1): ditto.
+
+ * test/ruby/test_require.rb (test_require_path_home_2): ditto.
+
+Mon Mar 14 19:54:37 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_x509cert.c: parenthesize macro arguments.
+
+Sun Mar 13 18:11:28 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_x509attr.c: parenthesize macro arguments.
+
+Sun Mar 13 16:07:58 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/pstore.rb: Fix don't raise "nested transaction" when thread_safe
+ is true. Patch by Masaki Matsushita (Glass_saga). [ruby-dev:43337]
+
+ * test/test_pstore.rb: Test for above.
+ Patch by Masaki Matsushita (Glass_saga) [ruby-dev:43337]
+
+Sat Mar 12 04:12:41 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_ssl_session.c: parenthesize macro arguments.
+
+Sat Mar 12 02:27:07 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c ({d,dt}_lite_marshal_load): checks the given
+ argument.
+
+Sat Mar 12 01:26:24 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c: changed some directives.
+
+Sat Mar 12 01:16:02 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c, ext/date/lib/*: moved rdoc descriptions.
+
+Sat Mar 12 00:06:24 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/lib: moved from lib.
+
+Fri Mar 11 23:32:38 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * lib/date/delta*: removed undocumented delta.
+
+Fri Mar 11 18:42:43 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (find_executable0): should exclude directories.
+
+Fri Mar 11 01:40:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * process.c (proc_getmaxgroups, proc_setmaxgroups): Process#maxgroups
+ and Process#maxgroups= now raise NotImplementedError if the
+ platform don't support supplementary groups concept.
+
+Fri Mar 11 01:25:03 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * process.c (get_sc_ngroups_max): return -1 if platform don't
+ support NGROUPS_MAX.
+
+Thu Mar 10 22:28:15 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_ssl.h: parenthesize macro arguments.
+
+Thu Mar 10 21:59:37 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * parse.y (parser_encode_length): add exception as UTF8-MAC for
+ magic comment's emacs newline specifier
+ patched by James M. Lawrence [ruby-core:35476] fixes #4489
+
+Thu Mar 10 16:00:22 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * parse.y (parser_encode_length): fix typo: the length of
+ "-dos" and "-mac" is not 5 but 4.
+ patched by James M. Lawrence [ruby-core:35476] fixes #4489
+
+Thu Mar 10 10:52:01 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_require.rb: setting too long string to ENV causes
+ Errno::EINVAL on Windows. long path name errors may causes over
+ about 1024 bytes, then limit it about 4000 bytes.
+
+Thu Mar 10 10:09:35 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::Runner::Worker#read): fix for the case
+ when IO#read or IO#gets returns nil.
+
+Thu Mar 10 07:12:03 2011 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * lib/rubygems*: Import rubygems 1.6.2 (release candidate @ 2026fbb5)
+ * test/rubygems: Ditto
+ * test/runner.rb: Added test to load path to fix test requires.
+
+Thu Mar 10 03:00:43 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_ssl.c: parenthesize macro arguments.
+
+Wed Mar 9 23:51:26 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * test/ruby/test_io_m17n.rb (test_io_new_enc): "sjis" is now an alias
+ of Windows-31J.
+
+Wed Mar 9 23:06:13 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * misc/ruby-mode.el (ruby-parse-partial): fix indent after aref.
+
+Wed Mar 9 12:50:24 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: Rescue exceptions when
+ people implement the method method. Thanks Lin Jen-Shin.
+ [ruby-core:35255]
+
+ * test/psych/visitors/test_yaml_tree.rb: test for implementation of
+ method method.
+
+Wed Mar 9 11:53:31 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * enc/shift_jis.c: Change SJIS as an alias of Windows-31J.
+ [ruby-dev:43027] fixes #4280
+
+ * enc/shift_jis.c: Add PCK as an alias of Windows-31J.
+
+Wed Mar 9 00:45:29 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/extmk.rb: nmake substitutes all occurrences in macro.
+
+ * ext/extmk.rb: workaround for nmake.
+
+Tue Mar 8 23:49:45 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * process.c (proc_setgroups): cleanup.
+
+Tue Mar 8 23:40:30 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/misc/test_ruby_mode.rb: test for ruby-mode.el.
+
+Tue Mar 8 23:27:38 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * process.c (get_sc_ngroups_max): try to use NGROUPS_MAX at first if
+ _SC_NGROUP_MAX is not defined.
+
+Tue Mar 8 23:10:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * misc/ruby-mode.el (ruby-parse-partial): fix for array in block.
+
+Tue Mar 8 21:44:49 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_rand.c: parenthesize macro arguments.
+
+Tue Mar 8 16:45:31 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * hash.c (ruby_setenv): MSDN says that Windows XP or earlier limits
+ the total size of environment block to 5,120 chars. and on such
+ OS, putenv() causes SEGV. So, ruby should limit the size of an
+ environment variable to 5,120 bytes for workaround.
+
+Tue Mar 8 15:57:20 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/rubygems/test_gem_spec_fetcher.rb
+ (TestGemSpecFetcher#test_cache_dir_escapes_windows_paths): cache_dir
+ may have driveletter and `:' for base of cache_dir itself, so need
+ to skip it for checking.
+
+Tue Mar 8 12:30:06 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * misc/ruby-mode.el (ruby-deep-indent-paren-p, ruby-calculate-indent):
+ do not apply deep-indent inside parens at the beginning of
+ expressions.
+
+Tue Mar 8 09:32:48 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (configure-ext, build-ext), ext/extmk.rb (extmake):
+ support parallel-make under ext.
+
+Tue Mar 8 09:25:23 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * process.c (proc_setgroups): use getgrnam() if getgrnam_r() is
+ not available.
+
+ * process.c: RARRAY_LEN() returns long int.
+
+Tue Mar 8 09:07:03 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (RUBY_REPLACE_TYPE): enclose in quotes for multiple
+ type names.
+
+Tue Mar 8 01:43:11 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * process.c (get_sc_ngroups_max): define to wrap sysconf(3).
+ this also supports Windows which doesn't have sysconf(3).
+
+ * process.c (maxgroups): use get_sc_ngroups_max.
+
+ * process.c (proc_setmaxgroups): ditto.
+
+Tue Mar 8 01:16:49 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * gc.c (rb_objspace): an initializer must be a constant.
+
+Tue Mar 8 01:11:44 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * process.c (maxgroups): cast because sysconf(3)'s return value is long.
+
+ * process.c (proc_setmaxgroups): ditto.
+
+ * process.c (proc_setgroups): cast because RARRAY_LEN() is long.
+
+Tue Mar 8 00:02:47 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_pkey_rsa.c: parenthesize macro arguments.
+
+Mon Mar 7 22:59:39 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/pstore.rb: Delete variable @transaction and fix #4474. Patch by
+ Masaki Matsushita (Glass_saga).
+
+ * test/test_pstore.rb(test_thread_safe): Add test for #4474.
+
+Mon Mar 7 21:31:38 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * process.c (proc_setgroups): replace getgrnam() with getgrnam_r()
+ because getgrnam() isn't thread safe.
+
+Mon Mar 7 20:49:12 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * process.c (proc_getmaxgroups, proc_setmaxgroups): reflect
+ platform maxgroups limitation by default instead hardcoded 65536.
+
+Mon Mar 7 17:13:00 2011 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * gc.c (rb_gc_set_params): allow GC parameter configuration by
+ environment variables. based on a patch from funny-falcon at
+ https://gist.github.com/856296, but honors safe level.
+
+Mon Mar 7 09:05:18 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * process.c: NUM2RLIM is defined but no getrlimit and setrlimit on
+ mingw.
+
+Mon Mar 7 08:38:14 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/date/date_core.c (DateTimeData): should not use bare 'long long'
+ and 'long double', which are not defined by C89.
+
+ * ext/date/date_core.c (dt_lite_plus): get rid of overflow at casting
+ down double to integer.
+
+Mon Mar 7 00:21:11 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * process.c (proc_getgroups): get rid of maxgroups dependency.
+ ngroups can be calculated dynamically.
+
+Sun Mar 6 23:45:40 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: rlim_t use standard RUBY_REPLACE_TYPE mechanism.
+
+Sun Mar 6 23:26:07 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * process.c (proc_setmaxgroups): added negative value check.
+ This was suggested by Daniel Berger. Thanks Daniel!
+ [ruby-core:35426][Bug#4467]
+
+Sun Mar 6 23:18:23 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * process.c (maxgroups, proc_setmaxgroups): increase max groups
+ limitation up to 65536.
+
+Sun Mar 6 22:20:59 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_pkey_ec.c: parenthesize macro arguments.
+
+Sun Mar 6 21:49:04 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * sample/list.rb (MyElem#initialize): initialize @head
+ explicitly. Otherwise -W2 option makes following warning.
+ "warning: instance variable @head not initialized".
+ This issue was founded by Andrew Grimm. Thanks Andrew!
+ [ruby-core:35435][Bug#4471]
+
+Sun Mar 6 05:21:41 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * class.c: fix camelCase to snake_case in documentation code examples.
+ patched by Andrew Grimm. fixes Bug #4469
+
+ * marshal.c: ditto.
+
+ * proc.c: ditto.
+
+ * sample/biorhythm.rb: ditto.
+
+ * vm_eval.c: ditto.
+
+ * vm_method.c: ditto.
+
+
+Sun Mar 6 03:22:27 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (io_cntl): use rb_thread_io_blocking_region() instead
+ rb_thread_blocking_region().
+
+Sat Mar 5 22:54:36 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * include/ruby/intern.h: fix a typo of prototype declaration.
+ rb_mutex_try_lock -> rb_mutex_trylock [ruby-dev:43213]
+
+Sat Mar 5 19:44:03 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/ruby/test_io.rb (TestIO#test_fcntl_lock): small clean up.
+
+Sat Mar 5 01:33:46 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (io_cntl, nogvl_io_cntl): IO.fcntl() and IO.ioctl()
+ release GVL during calling kernel interface.
+ Suggested by Eric Wong. [ruby-core:35417][Bug #4463]
+
+ * test/ruby/test_io.rb (TestIO#test_fcntl_lock): add new test for
+ IO.fcntl().
+
+Fri Mar 4 23:09:12 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * test/testunit/test_parallel.rb
+ (test_should_run_all_without_any_leaks): consider that the order of
+ testcase could change. [ruby-dev:43300] [Bug #4466]
+
+Fri Mar 4 22:01:14 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (io_cntl): change 'cmd' type to int. ioctl and fcntl need to
+ be passed int.
+ * io.c (rb_io_ctl): ditto.
+
+Fri Mar 4 21:10:40 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: save warnflags. the patch is created by Eric Wong.
+ [Bug #4465]
+
+Wed Mar 2 21:15:00 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_pkey_dsa.c: parenthesize macro arguments.
+
+Thu Mar 3 22:10:26 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * process.c (check_exec_redirect_fd, check_exec_redirect): raise
+ ArgumentError if fd >= 3 on Windows because the feature is not
+ supported.
+
+ * test/ruby/test_process.rb (test_execopts_redirect): remove meaningless
+ argument.
+
+Thu Mar 3 21:21:42 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_process.rb (test_execopts_redirect): redirecting fd
+ >= 3 is not supported on Windows, so should not specify such options
+ when calling spawn or others.
+
+Thu Mar 3 18:59:04 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_str_slice_bang): raise error when the string is frozen.
+
+Thu Mar 3 14:25:19 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * strftime.c (STRFTIME): return 0 and ERANGE when precision is too
+ large. [ruby-dev:43284] fixes #4456
+
+Thu Mar 3 00:46:51 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c (uleb128): cast the value to unsigned long.
+
+ * addr2line.c (fill_lines): print error when lseek fails.
+
+Thu Mar 3 00:36:29 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/rexml/encoding.rb (REXML::Encoding#encoding=): store @encoding
+ a String which means the name of the encoding.
+ this partially revert r29646.
+
+ * lib/rexml/document.rb: follow above.
+
+ * lib/rexml/output.rb: ditto.
+
+ * lib/rexml/parsers/baseparser.rb: ditto.
+
+ * lib/rexml/source.rb: ditto.
+
+ * lib/rexml/xmldecl.rb: ditto.
+
+Wed Mar 2 23:19:56 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (str_byte_substr): return nil for negative length.
+
+Wed Mar 2 21:15:00 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_pkey_dh.c: parenthesize macro arguments.
+
+Wed Mar 2 14:24:04 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/test/unit/parallel.rb: Fix name from `inclement_io` to
+ `increment_io`.
+
+Wed Mar 2 14:06:01 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_str_slice_bang): move treatments which is only needed
+ when the result is not nil.
+
+Wed Mar 2 14:02:29 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * test/testunit/test_parallel.rb(TestParallel#spawn_runner):
+ Fix outputing empty line in running test.
+
+ * test/testunit/tests_for_parallel/test_third.rb: Remove `sleep`
+
+Tue Mar 1 22:29:10 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_pkey.h: parenthesize macro arguments.
+
+Tue Mar 1 22:02:35 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/test/unit/parallel.rb: Fix number.
+
+Tue Mar 1 21:48:22 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/test/unit/parallel.rb: For Windows.
+
+ * test/testunit/test_parallel.rb(TestParallelWorker#test_quit_in_test):
+ Fix for above specification change.
+ * test/testunit/test_parallel.rb(TestParallel#spawn_runner):
+ Fix outputing empty line in running test.
+
+Tue Mar 1 20:51:57 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/ruby/test_system.rb (TestSystem#test_system_at):
+ remove tests for [bug#4396]. because we decided to reject this
+ ticket.
+
+Tue Mar 1 19:46:19 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * test/date/{test_date.rb,test_date_attr.rb}: [ruby-dev:43280]
+
+Tue Mar 1 18:40:38 2011 Ryan Davis <ryan@YPCMC09457>
+
+ * lib/rubygems*: Import rubygems 1.6.0 (released version @ 58d8a0b9)
+ * test/rubygems: Ditto
+
+Tue Mar 1 16:22:22 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c: revert r30987 because it causes some failures in
+ test-all, especially webrick.
+
+Tue Mar 1 15:59:53 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_str_byteslice): the resulted encoding should keep
+ original encoding. this also fixes the encoding when the result
+ shares internal string. [ruby-core:35376]
+
+Tue Mar 1 13:25:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (VpMemAlloc): CVE-2011-0188.
+ Fixes a bug reported by Drew Yao <ayao at apple.com>
+
+Tue Mar 1 10:34:39 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_str_byteslice): Add String#byteslice. [ruby-core:35376]
+
+Tue Mar 1 00:12:49 2011 Tajima Akio <artonx@yahoo.co.jp>
+
+ * include/ruby/win32.h: define WIN32 if neither _WIN64 nor WIN32
+ defined. it forces to use push/pop for pack(4) pragma.
+
+Mon Feb 28 23:52:13 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * test/testunit/test_rake_integration.rb (test_with_rake_runner):
+ use assert_in_out_err for suppress messages.
+
+Mon Feb 28 22:48:56 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * win32/win32.c (rb_w32_spawn): use shell if a commandline contain
+ double-quote character.
+ * win32/win32.c (is_internal_cmd): similar, use shell if a commandline
+ contain caret character.
+
+ * test/ruby/test_system.rb (TestSystem#test_system_at): fix
+ wrong test case. if system() invoke a command by using shell,
+ system() never return nil. Also, "" quotation must not appear
+ twice in a command line.
+
+Mon Feb 28 17:36:57 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_pkcs7.c: parenthesize macro arguments.
+
+Mon Feb 28 16:48:42 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_pkcs12.c: parenthesize macro arguments.
+
+Mon Feb 28 16:28:15 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (tr_trans): when the hash for multibyte repl is empty,
+ tr is inverse mode, and a character doesn't much the table, the
+ character should be replaced by last replacement. Bug #4449
+
+Mon Feb 28 16:38:56 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_ocsp.c: parenthesize macro arguments.
+
+Mon Feb 28 13:02:15 2011 Danial Pearce <github@tigris.id.au>
+
+ * lib/tempfile.rb: Fix example file paths in docs for tempfile.
+ https://github.com/ruby/ruby/pull/5
+
+Mon Feb 28 12:56:18 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * ext/openssl/ossl_cipher.c (ossl_cipher_init): typo fix.
+ https://github.com/ruby/ruby/pull/8
+
+Mon Feb 28 12:28:13 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/date/date_core.c (datetime_s_now): localtime() and localtime_r()
+ required time_t pointer as 1st parameter, and tv_sec member of struct
+ timeval is long.
+
+Mon Feb 28 11:57:40 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * test/testunit/test_parallel.rb: Temporally disable test on Windows.
+
+Mon Feb 28 07:28:35 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/test/unit.rb(Test::Unit::Runner#after_worker_quit):
+ method name more be natural English.
+
+ * lib/test/unit.rb(Test::Unit::Runner::Worker.launch):
+ IO.sync doesn't need. Should use "b" for mode.
+
+Sun Feb 27 21:59:37 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/ruby/test_system.rb (TestSystem#test_system_redirect_win):
+ add test for system().
+
+Sun Feb 27 18:00:09 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/test/unit.rb: Refactoring; Worker never use Hash for internal
+ storage.
+
+ * lib/test/unit.rb: Never use Kernel#spawn. Use IO.popen instead.
+
+Sun Feb 27 13:16:48 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_ns_spki.c: parenthesize macro arguments.
+
+Sat Feb 26 17:07:53 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * lib/date.rb: [Feature #4257]
+
+ * ext/date/extconf.rb: new
+
+ * ext/date/date_core.c: new
+
+Sat Feb 26 16:10:23 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/test/unit.rb: --jobs-status won't puts over 2 lines.
+
+ * test/testunit/test_parallel.rb: Fix test for above.
+
+ * lib/test/*: refactoring.
+
+Sat Feb 26 07:10:05 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/scalar_scanner.rb: fix parsing timezone's whose
+ whose format is (+/-)hhmm. Thanks Goncalo Silva!
+
+ * test/psych/test_scalar_scanner.rb: test for bug.
+
+Thu Feb 24 23:02:55 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_hmac.c: parenthesize macro arguments.
+
+Thu Feb 24 22:53:10 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (love): for the birthday.
+
+Thu Feb 24 22:51:54 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm.c (ruby_vm_destruct): run vm exit hooks after all objects are
+ destructed.
+
+Thu Feb 24 14:40:33 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * ChangeLog (vim): Modeline for vim
+
+Thu Feb 24 13:39:25 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * common.mk: Use $RUNRUBY for worker process.
+
+ * lib/test/unit.rb: Fix bug.
+
+ * lib/test/unit.rb: @options[:ruby](@opts[:ruby]) is now Array.
+
+ * test/testunit/parallel.rb: Fix for above.
+
+Thu Feb 24 10:05:55 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * test/testunit/tests_for_parallel/misc.rb: Fix bug in r30947.
+
+ * lib/test/unit.rb, lib/test/unit/assertions.rb: For this test.
+
+Wed Feb 23 23:07:38 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * test/testunit/test_parallel.rb, test/testunit/parallel/*:
+ Test for r30939.
+
+ * lib/test/unit.rb: For test.
+
+ * lib/test/parallel.rb: For test.
+
+ * lib/test/unit/testcase.rb: For test.
+
+Wed Feb 23 22:05:13 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_engine.c: parenthesize macro arguments.
+
+Tue Feb 22 23:15:17 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/test/unit.rb: Fix --ruby option doesn't effect.
+
+ * lib/test/unit.rb: Fix typo.
+
+Tue Feb 22 21:39:28 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_digest.c: parenthesize macro arguments.
+
+Tue Feb 22 14:34:26 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/test/unit.rb: Fix merging miss.
+
+Tue Feb 22 12:27:26 2011 Shota Fukumori <sorah@tubusu.net>
+
+ * lib/test/unit.rb: Add new options; --jobs,-j,--ruby,--jobs-status,
+ --no-retry.
+ [Feature #4415] [ruby-dev:43226],[ruby-dev:43222],[ruby-core:35294]
+
+ * lib/test/unit/parallel.rb: Used at test/unit --jobs(-j) option.
+
+ * test/csv/test_serialization.rb: test/unit parallel running ready.
+
+ * test/rake/test_file_task.rb: test/unit parallel running ready.
+
+Tue Feb 22 06:09:10 2011 Eric Hodel <drbrain@segment7.net>
+
+ * ext/syslog/syslog.c: Apply documentation patch from mathew murphy.
+ [Bug #4149]
+
+Tue Feb 22 03:09:10 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych.rb: increase Psych to 1.1.0 for help with
+ debugging.
+
+Tue Feb 22 03:04:46 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/streaming.rb: refactor streaming methods to a
+ module.
+ * ext/psych/lib/psych/stream.rb: extracted streaming specific methods
+ to a module.
+ * ext/psych/lib/psych/json/stream.rb: JSON stream inherits from
+ JSONTree and includes streaming methods.
+ * ext/psych/lib/psych/visitors/json_tree.rb: JSON does not support
+ object references, so remove object reference testing when building
+ JSON trees.
+
+Tue Feb 22 02:41:51 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/yaml_tree.rb (accept): use Hash#key?
+ when looking up object references to err on the side of cache
+ misses.
+
+Mon Feb 21 10:58:39 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/json/yaml_events.rb: refactoring JSON event
+ handling methods to a module for reuse.
+ * ext/psych/lib/psych/json/tree_builder.rb: AST builder uses JSON
+ event methods.
+ * ext/psych/lib/psych/json/stream.rb: stream emitter uses JSON event
+ methods.
+
+Mon Feb 21 10:54:29 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/json/stream.rb: do not emit custom tags in maps
+ or sequences when emitting JSON.
+ * ext/psych/lib/psych/json/tree_builder.rb: do not emit custom tags in
+ sequences when emitting JSON.
+ * test/psych/json/test_stream.rb: tests for custom stream emits.
+ * test/psych/test_json_tree.rb: tests for JSON emits.
+
+Mon Feb 21 10:05:10 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/json/ruby_events.rb: DRY up ruby event handling
+ for JSON.
+ * ext/psych/lib/psych/visitors/json_tree.rb: use ruby events module
+ * ext/psych/lib/psych/json/stream.rb: ditto
+
+Mon Feb 21 10:01:01 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/json/stream.rb: fix JSON stream emits to use
+ double quotes during stream.
+ * test/psych/json/test_stream.rb: tests to reflect changes.
+
+Mon Feb 21 00:38:56 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/ruby/test_system.rb (TestSystem#test_system_at):
+ add testcase for bug4396.
+
+Sun Feb 20 19:59:32 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_cipher.c: parenthesize macro arguments.
+
+Sun Feb 20 16:26:45 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread.c (exec_recursive): prevent temporary objects from GC.
+
+ * prevent temporary objects from GC, and should not use
+ RSTRING_PTR() for function calls since it evaluates the argument
+ a couple of times.
+
+Sun Feb 20 16:22:53 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (rb_file_flock): use rb_thread_io_blocking_region for the
+ time being.
+
+Sun Feb 20 05:33:17 2011 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * lib/minitest/*.rb: Imported minitest 2.0.2 r6207.
+ * test/minitest/*: ditto
+
+Sun Feb 20 02:14:09 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * signal.c (sig_trap): avoid pthread_sigmask(xx, &mask, &mask) usage
+ because FreeBSD don't permit it. If it's used, it behave as
+ pthread_sigmask(xx, NULL, &mask).
+
+ * signal.c (init_sigchld): ditto.
+
+Sun Feb 20 00:46:51 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl_bn.c: parenthesize macro arguments.
+
+Sat Feb 19 22:37:42 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * vm_insnhelper.c (vm_check_if_namespace): guard temporary object
+ from GC.
+
+Sat Feb 19 06:36:27 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * lib/test/unit.rb: partial revert of r30849. [ruby-core:32864]
+
+ * test/testunit/test_rake_integration.rb: adding an integration test
+ with the rake loader to prevent regressions.
+
+Fri Feb 18 19:31:31 2011 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/fileutils.rb (FileUtils::remove_entry_secure): there is a
+ race condition in the case where the given path is a directory,
+ and some other user can move that directory, and create a
+ symlink while this method is executing.
+ Reported by: Nicholas Jefferson <nicholas at pythonic.com.au>
+
+Fri Feb 18 00:28:39 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * compile.c (get_exception_sym2type): guard temporary object from GC.
+
+Thu Feb 17 23:54:29 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * iseq.c (prepare_iseq_build): initialize iseq_compile_data::err_info
+ with nil. this fix exception in rb_iseq_load().
+
+Thu Feb 17 22:32:35 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * test/ruby/test_marshal.rb (test_marshal_dump_extra_iv):
+ fix a typo of local variable. [Bug #3720] [ruby-dev:42083]
+
+Thu Feb 17 21:32:53 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/ossl.h: parenthesize macro arguments.
+
+Wed Feb 16 20:37:48 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * eval_jump.c (rb_exec_end_proc): changed at_exit and END proc
+ evaluation order. [Bug #4400] [ruby-core:35237]
+ * eval_jump.c (rb_mark_end_proc): ditto.
+
+ * test/ruby/test_beginendblock.rb (TestBeginEndBlock#test_nested_at_exit):
+ added a test for nested at_exit.
+ * test/ruby/test_beginendblock.rb (TestBeginEndBlock#test_beginendblock):
+ changed the test to adopt new spec.
+
+Wed Feb 16 20:17:06 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/openssl/openssl_missing.h: parenthesize macro arguments.
+
+Tue Feb 15 21:37:45 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/gdbm/gdbm.c: parenthesize macro arguments.
+
+Tue Feb 15 20:34:53 2011 Tanaka Akira <akr@fsij.org>
+
+ * array.c (ary_join_1): fix array size.
+
+Tue Feb 15 19:43:23 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: fix and resubmit r30621. [ruby-dev:43203]
+
+Tue Feb 15 15:41:30 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * array.c (array_join): copy the encoding of the first element as
+ an initial encoding.
+
+ * array.c (array_join_0): ditto.
+
+ * array.c (array_join_1): ditto.
+
+ * array.c (inspect_ary): ditto.
+
+ * array.c (array_join_1): add an argument to check the appending is
+ first one or not.
+
+Tue Feb 15 15:40:53 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * hash.c (inspect_i): copy the encoding of the first key as
+ an initial encoding.
+
+Mon Feb 14 15:00:16 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * array.c (inspect_ary): don't taint the inspected result of a
+ recursive array.
+
+Tue Feb 15 15:43:29 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * encoding.c (rb_enc_compatible): change the rule for empty strings:
+ remove the special treatment of the US-ASCII encoded empty string.
+ Now Encoding.compatible? usually respect the encoding of the
+ receiver.
+
+Tue Feb 15 15:39:37 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_enc_cr_str_buf_cat): remove special treatment of
+ ASCII-8BIT receivers.
+
+ * string.c (str_gsub): set initial encoding of the buffer as the
+ same of the receiver. [ruby-core:35141]
+
+Tue Feb 15 09:49:33 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_system.rb (TestSystem#test_system_at): use findstr
+ command instead of find command, because the latter is confusing
+ another famous Unix command.
+
+Mon Feb 14 23:01:19 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * thread.c (rb_thread_io_blocking_region): reset th->waiting_fd
+ after blocking region, because remaining waiting_fd might
+ cause unnecessary IOError.
+
+Mon Feb 14 21:06:50 2011 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * configure.in: revert r30621. That revision introduced mkmf test
+ failures and it turned out to be OK to revert. [ruby-dev:43203]
+
+Mon Feb 14 21:04:01 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/fiddle/conversions.h: parenthesize macro arguments.
+
+Mon Feb 14 18:41:47 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * win32/setup.mak (USE_RUBYGEMS): fixed r30835. It didn't work on
+ mswin32 port. If you changed win32/configure.bat, you should change
+ setup.mak too.
+
+Mon Feb 14 17:28:34 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/ruby/test_system.rb (TestSystem#test_system_at):
+ added test. [ruby-core:35218] (#4393)
+
+Mon Feb 14 13:15:35 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (is_internal_cmd): if the first char of prog is '@',
+ execute it via shell. [ruby-core:35218] (#4393)
+
+Mon Feb 14 10:33:45 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/test/unit.rb: revert r30863, because it causes too many noise.
+
+Mon Feb 14 07:34:55 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/curses/curses.c: parenthesize macro arguments.
+
+Sun Feb 13 19:41:47 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::RequireFiles#non_options): skip
+ test suites failed to load instead of mere messages.
+
+Sun Feb 13 09:56:44 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/openssl/test_config.rb (OpenSSL#test_freeze): fix error
+ message assertion.
+
+ * test/io/nonblock/test_flush.rb (TestIONonblock#flush_test):
+ return true to finish the test.
+
+ * test/syck/test_string.rb (Syck::TestString#test_non_binary_string):
+ use assert_not instead of refute, unless required minitest
+ explicitly.
+
+ * test/test_prime.rb (TestPrime::sieve.Integer): ditto.
+
+ * test/xmlrpc/webrick_testing.rb (WEBrick_Testing#start_server):
+ catch IOError when server socket was closed.
+
+Sun Feb 13 07:39:51 2011 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * enum.c (enum_inject): typo fixed. a patch from Gaku Ueda in
+ [ruby-core:35216].
+
+Sun Feb 13 00:48:47 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * lib/date.rb (Date#===): [ruby-core:35127]
+
+Sun Feb 13 00:29:18 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::Options#process_args): always
+ return options.
+
+ * lib/test/unit.rb (Test::Unit::RequireFiles#non_options): return
+ if any test case get loaded.
+
+ * lib/test/unit.rb (Test::Unit::AutoRunner#initialize): do not add
+ default directory if it is nil.
+
+ * lib/test/unit.rb (Test::Unit::AutoRunner#process_args): return
+ true if any test cases to run.
+
+Sat Feb 12 23:17:43 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (assert_include): add alias.
+
+Sat Feb 12 14:44:20 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread.c (rb_thread_io_blocking_region): new function to run
+ blocking region with GIL released, for fd.
+
+ * thread.c (rb_thread_fd_close): implement. [ruby-core:35203]
+
+ * vm.c (th_init): rename from th_init2.
+
+Sat Feb 12 14:41:36 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::AutoRunner#initialize): use
+ default_dir if no test case given.
+
+ * lib/test/unit.rb (Test::Unit::Runner): rename from Test::Unit::Mini.
+
+ * lib/test/unit.rb (Test::Unit::GlobOption#non_options): run tests
+ under base directory if no argument given.
+
+Sat Feb 12 08:03:12 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/ruby/test_settracefunc.rb (TestSetTraceFunc): ensure to use
+ method_added hook defined in Module.
+
+Sat Feb 12 01:04:02 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby.c (proc_options): enable rubygems if --gem option is given.
+
+ * ruby.c (process_options): load rubygems if it is disabled but
+ --gem option is given.
+
+Fri Feb 11 23:27:50 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * ruby.c (proc_options): add --gem=enabled as an alias of
+ --enable=gems and --gem=disabled as an alias of --disable=gems.
+ Gem named "enabled" or "disabled" has already been reserved
+ legitimately for this purpose.
+
+Fri Feb 11 23:17:04 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/dl/cfunc.c: parenthesize macro arguments.
+
+Fri Feb 11 21:41:53 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * bin/testrb, test/runner.rb, lib/test/unit.rb: improve backward
+ compatibility.
+
+Fri Feb 11 19:45:26 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (ruby_cleanup): use rb_ary_free to free internal object.
+
+ * gc.h (RUBY_FREE_UNLESS_NULL): get rid of double free.
+ [ruby-core:35192]
+
+Fri Feb 11 16:57:03 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/ruby/test_transcode.rb (test_from_cp50221): fix wrong
+ assertion and move back.
+
+Fri Feb 11 14:33:18 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit/assertions.rb (assert_no_match): alias for
+ backward compatibility.
+
+Fri Feb 11 12:06:48 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby.c (add_gems, require_libraries, proc_options): add
+ --require and --gem options.
+
+Fri Feb 11 12:03:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (rubygems): add --disable-rubygems option.
+
+Fri Feb 11 11:39:03 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * template/fake.rb.in (CROSS_COMPILING): get rid of NameError.
+
+Thu Feb 10 23:12:34 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/dl/dl.h: parenthesize macro arguments.
+
+Wed Feb 9 23:11:27 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/pty/pty.c: parenthesize macro arguments.
+
+Tue Feb 8 11:47:11 2011 Loren Sands-Ramshaw <lorensr@gmail.com>
+
+ * array.c: documentation clarification in rotate, rotate!,
+ index, and rindex. [ruby-core:35144]
+
+Wed Feb 9 09:45:43 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/rdoc/test_rdoc_encoding.rb: remove unnecessary (and wrong)
+ platform-dependent hacks.
+
+Wed Feb 9 00:47:18 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/etc/etc.c: parenthesize macro arguments.
+
+Tue Feb 8 19:38:00 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * misc/ruby-mode.el (ruby-expr-beg): fix for invalid nest errors.
+
+Tue Feb 8 19:22:59 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in (AC_MSG_CHECKING): fixed typo. the patch is
+ created by Benoit Daloze. Thanks a lot. [Bug #4384][ruby-core:35148]
+
+Tue Feb 8 16:04:03 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (rb_io_s_sysopen): use NUM2MODET() instead NUM2UINT().
+
+Tue Feb 8 15:59:23 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * process.c (rb_run_exec_options_err): use MODET2NUM() instead
+ LONG2NUM().
+
+Tue Feb 8 13:59:56 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: revert r30725. Now we have proper runtime fallback.
+ Therefore, no need compile time disabling. (see r30762).
+
+Tue Feb 8 01:00:21 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * process.c (proc_setgroups): add GC guard to prevent intermediate
+ variable from GC.
+
+Tue Feb 8 00:56:33 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * misc/ruby-mode.el (ruby-expr-beg, ruby-in-here-doc-p): tell
+ singleton class definitions from here documents.
+
+ * misc/ruby-mode.el (ruby-expr-beg, ruby-parse-partial): keyword
+ followed by colon is label.
+
+Mon Feb 7 22:56:16 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * lib/benchmark.rb (Benchmark#bmbm): use ensure clause instead of
+ Object#tap to restore STDOUT.sync.
+
+Mon Feb 7 22:34:20 2011 Tanaka Akira <akr@fsij.org>
+
+ * lib/net/http.rb (Net::HTTP#connect): support SNI (Server Name
+ Indication) for HTTPS. [ruby-dev:43164]
+ http://stackoverflow.com/questions/4685736/openssl-server-name-indication-support-in-ruby
+
+Mon Feb 7 16:05:32 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc: Upgrade to RDoc 3.5.3 Fixes [Bug #4376]
+
+Mon Feb 7 11:46:59 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * common.mk (rdoc): add --encoding=UTF-8; ruby's rdoc must be UTF-8.
+
+Mon Feb 7 10:21:50 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/rdoc/test_rdoc_options.rb (TestRDocOptions#test_check_files):
+ there is no easy way to create owner unreadable file on Windows.
+ So, skip the test.
+
+Sun Feb 6 13:48:29 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/json/lib/json/common.rb (JSON::MissingUnicodeSupport.iconv):
+ should not drop rest of the result. use Iconv.conv instead.
+
+Sun Feb 6 12:46:02 2011 Eric Hodel <drbrain@segment7.net>
+
+ * string.c (gsub): Ensure result encoding is the same as input
+ encoding. [Bug #4340].
+
+Sun Feb 6 12:18:25 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (words, qwords): dispatch array events. based on a
+ patch from Michael Edgar. [Bug #4365].
+
+Sun Feb 6 12:12:59 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/fileutils/fileasserts.rb (FileAssertions): separate module.
+
+Sun Feb 6 11:29:23 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/dbm/dbm.c: parenthesize macro arguments.
+
+Sat Feb 5 22:01:59 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert):
+ revert r30796. r30797 and r30798 are an alternative fix.
+ [ruby-dev:43174]
+
+Sat Feb 5 21:47:09 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (mlhs_basic): include mlhs_post for ripper. a patch
+ from Michael Edgar at [ruby-core:35078].
+
+Sat Feb 5 21:22:21 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit/assertions.rb (assert_block): move from
+ test/fileutils/fileasserts.rb.
+
+ * test/fileutils/fileasserts.rb (assert_block): pass arguments
+ as-is. [ruby-dev:43174]
+
+Sat Feb 5 16:47:54 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert):
+ msg can be passed nil. [Bug #4371] [ruby-dev:43174]
+
+Sat Feb 5 15:18:25 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc: Upgrade to RDoc 3.5.2
+
+Sat Feb 5 12:05:27 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/syck/rubyext.c (syck_node_init_copy): SyckNode is not
+ copiable. [ruby-core:35094]
+
+Sat Feb 5 11:48:47 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/openssl/ossl_cipher.c (ossl_cipher_alloc): leave data ptr
+ NULL.
+
+ * ext/openssl/ossl_cipher.c (ossl_cipher_new, ossl_cipher_initialize):
+ allocate internal structure. [ruby-core:35094]
+
+ * ext/openssl/ossl_cipher.c (ossl_cipher_copy): ditto.
+
+Sat Feb 5 11:29:10 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/json/parser/parser.h (GET_PARSER): raise TypeError.
+
+ * ext/json/parser/parser.rl (cParser_initialize): ditto.
+
+ * ext/json/parser/parser.h (GET_PARSER): check if initialized.
+ [ruby-core:35079]
+
+ * ext/json/parser/parser.rl (cParser_initialize): ditto.
+
+Sat Feb 5 10:09:31 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * load.c (rb_get_expanded_load_path): always expand load paths.
+
+Sat Feb 5 09:38:08 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * transcode.c (encoded_dup): extract.
+
+Sat Feb 5 03:37:47 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/fileutils.rb (FileUtils::LowMethods): make low level methods
+ in NoWrite and DryRun to do nothing. [ruby-dev:43129]
+
+ * test/fileutils/fileasserts.rb: add message arguments.
+
+ * test/fileutils/fileasserts.rb (Test::Unit::Assertions#assert_block):
+ show the given message.
+
+Sat Feb 5 02:09:39 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (lex_getline, parser_set_encode): set encoding of lines
+ in SCRIPT_LINES__ as source encoding. [ruby-dev:43168]
+
+Sat Feb 5 02:08:37 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm.c (ruby_thread_data_type): add prefix.
+
+Sat Feb 5 00:59:54 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * vm_core.h (GetThreadPtr): use TypedData_Get_Struct() instead
+ CoreDataFromValue() because we need type check. Otherwise,
+ type mismatch can cause segmentation fault crash.
+ [ruby-core:35086] [Ruby 1.9-Bug#4367]
+
+ * vm.c (thread_data_type): remove static.
+
+Fri Feb 4 19:14:27 2011 Tanaka Akira <akr@fsij.org>
+
+ * enc/trans/utf8_mac.trans: parenthesize macro arguments.
+
+Fri Feb 4 12:11:51 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * string.c (str_utf8_nth): fixed a condition of optimized lead
+ byte counting. [Bug #4366][ruby-dev:43170]
+
+Fri Feb 4 01:50:13 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * string.c (count_utf8_lead_bytes_with_word): wrote function
+ comments.
+
+Fri Feb 4 00:14:55 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/zlib/zlib.c (gzfile_reader_get_unused): no need to dup
+ before rb_str_resurrect.
+
+Thu Feb 3 20:04:44 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/curses/curses.c (CHECK): unused macro removed.
+
+Thu Feb 3 18:33:26 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/zlib/zlib.c (gzfile_reader_get_unused): use rb_str_resurrect
+ because gz->z.input is hidden string. [ruby-core:35057]
+
+Thu Feb 3 16:34:10 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * enc/shift_jis.c (code_to_mbc): cast as int from the subtraction of
+ pointers.
+
+ * enc/utf_16le.c (utf16le_mbc_enc_len): use ptrdiff_t.
+
+ * enc/utf_32be.c (utf32be_left_adjust_char_head): ditto.
+
+ * enc/utf_32le.c (utf32le_left_adjust_char_head): ditto.
+
+Thu Feb 3 16:31:43 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * include/ruby/missing.h: don't use HAVE_STDDEF_H because it never
+ defined by configure though configure.bat defines it.
+
+ * include/ruby/ruby.h: move include stddef.h to defines.h
+
+ * include/ruby/defines.h: ditto.
+
+Wed Feb 2 20:25:04 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * include/ruby/encoding.h (rb_enc_step_back): cast 4th argument 'n'
+ as int because Ruby usually treats length value as long but
+ onigenc_step_back's 4th argument is int.
+
+Thu Feb 3 07:20:46 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/to_ruby.rb: use Regexp::NOENCODING
+ rather than magic number.
+
+ * ext/syck/lib/syck/rubytypes.rb: ditto
+
+Thu Feb 3 07:16:11 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * re.c (Init_Regexp): added a constant for ARG_ENCODING_NONE
+ [ruby-core:35054]
+
+ * test/ruby/test_regexp.rb: corresponding test.
+
+Thu Feb 3 07:02:16 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/to_ruby.rb: ARG_ENCODING_NONE regular
+ expressions can round trip. [ruby-core:34969]
+
+ * test/psych/test_yaml.rb: test for ARG_ENCODING_NONE regex
+
+ * ext/sych/lib/syck/rubytypes.rb: ARG_ENCODING_NONE regular
+ expressions can round trip.
+
+ * test/syck/test_yaml.rb: test for ARG_ENCODING_NONE regex
+
+Wed Feb 2 17:09:22 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (rb_io_fdatasync): Use fsync(2) if the underlying
+ operating system does not support fdatasync(2).
+
+Wed Feb 2 14:51:08 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc/markup/to_tt_only.rb: commit miss
+ * test/rdoc/test_rdoc_markup_to_tt_only.rb: ditto
+ * test/rdoc/test_rdoc_single_class.rb: ditto
+
+Wed Feb 2 09:27:53 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc: Upgrade to RDoc 3.5.1
+
+Wed Feb 2 00:30:43 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * include/ruby/st.h (st_table): Added comment why we need __extension__.
+
+Tue Feb 1 20:45:44 2011 Tanaka Akira <akr@fsij.org>
+
+ * enc/encdb.c: parenthesize macro arguments.
+
+Tue Feb 1 15:12:26 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_require.rb (TestRequire#test_require_with_unc):
+ use ``127.0.0.1'' instead of ``localhost'' as host name, because
+ XP or earlier cannot resolv it as NBT hostname.
+
+Tue Feb 1 13:20:39 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/benchmark/test_benchmark.rb (#capture_bench_output):
+ Added explicit sleep. Windows have imprecise time support.
+ Thus Tms.new.Add!{} may be or may be not equal 0. The
+ test failure started since r30747.
+
+Tue Feb 1 11:03:47 2011 Ryan Davis <ryan@lust.local>
+
+ * lib/rubygems*: Import rubygems 1.5.0 (released version @ 1fb59d0)
+ * test/rubygems: Ditto
+
+Tue Feb 1 08:01:39 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/io/console/console.c (console_set_winsize): new method to set
+ console size. [EXPERIMENTAL]
+
+ * ext/io/console/console.c (console_winsize): use GetWriteFD.
+
+Tue Feb 1 02:28:14 2011 Masaya Tarui <tarui@ruby-lnag.org>
+
+ * include/ruby/win32.h, win32/win32.c: add rb_w32_inet_ntop.
+ inet_ntop's minimum supported client is Vista.
+
+Tue Feb 1 00:10:30 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/benchmark.rb: fix benchmark to work with current ruby.
+ patched by Benoit Daloze [ruby-core:33846] [ruby-dev:43143]
+ merged from https://github.com/eregon/ruby/commits/benchmark
+
+ * lib/benchmark (Report#width): update documentation
+ * lib/benchmark: document the return value of #benchmark and the
+ :list attribute in Report
+ * lib/benchmark (Tms#format): rename variables, use String#%
+ instead of Kernel.format
+ * lib/benchmark: remove undocumented Benchmark::times (an alias
+ of Process::times used twice)
+ * lib/benchmark (#benchmark): use label_width for the caption
+ * lib/benchmark (Tms#initialize): rename variables
+ * lib/benchmark: allow title to not be a String and call #to_s
+ * lib/benchmark (Benchmark#bm): return an Array of the times with
+ the labels
+ * lib/benchmark: correct output for Benchmark#bmbm
+ (remove the extra space)
+ * lib/benchmark: add a few tests for Benchmark::Tms output
+ * lib/benchmark: improve style (enumerators, ljust, unused vars)
+ * lib/benchmark: add spec about output and return value
+ * lib/benchmark: improve basic style and consistency
+ no parenthesis for print and use interpolation instead of printf
+ * lib/benchmark: remove unnecessary conversions and variables
+ * lib/benchmark: correct indentation
+ * lib/benchmark: rename the FMTSTR constant and variable to FORMAT
+ * lib/benchmark: remove useless exception
+
+ * test/benchmark: remove unused variable warnings
+
+Mon Jan 31 23:27:23 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * node.c (add_id): remove duplicated rb_id2str() call.
+
+Sun Jan 30 17:19:46 2011 Tanaka Akira <akr@fsij.org>
+
+ * missing/langinfo.c: parenthesize macro arguments.
+
+Mon Jan 31 21:57:39 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: revert r30698.
+
+Mon Jan 31 21:32:44 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * thread.c (thread_start_func_2): check deadlock condition before
+ release thread stack. fix memory violation when deadlock detected.
+ reported by Max Aller. [Bug #4009] [ruby-core:32982]
+
+Mon Jan 31 14:45:47 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * lib/irb/locale.rb (IRB::Locale::#search_file):
+ Gem might be undefined if --disable-gems. [ruby-core:34990]
+
+Mon Jan 31 12:26:14 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c: suppressed shorten-64-to-32 warnings.
+ * regcomp.c: ditto.
+ * regexec.c: ditto.
+ * regint.h: ditto.
+ * regparse.c: ditto.
+ * regparse.h: ditto.
+ * time.c: ditto.
+ * variable.c: ditto.
+
+Mon Jan 31 04:45:12 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * array.c (rb_ary_uniq_bang): call ARY_SET_LEN(ary, 0) before
+ ary_resize_capa because ary_resize_capa expects resized length is
+ smaller than current array length. call rb_ary_unshare before
+ ary_resize_capa because ary_resize_capa lost the reference to
+ original shared array. [ruby-core:34997]
+
+Sun Jan 30 17:19:46 2011 Tanaka Akira <akr@fsij.org>
+
+ * missing/crypt.c: parenthesize macro arguments.
+
+Sun Jan 30 16:40:27 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/rubygems/test_gem_security.rb (TestGemSecurity): valid only
+ if OpenSSL is available.
+
+ * test/dl/test_dl2.rb (TestDL#test_sin): math functions do not
+ work on x86_64 due to the design of DL2.
+
+ * test/dl/test_func.rb (DL::TestFunc#test_{sinf,sin): ditto.
+
+Sun Jan 30 16:09:22 2011 Tanaka Akira <akr@fsij.org>
+
+ * strftime.c (rb_strftime_with_timespec): %G produces 4 digits.
+
+Sun Jan 30 15:13:19 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enc/emacs_mule.c (emacsmule_islead): 7bit range is also leading
+ byte.
+
+Sun Jan 30 13:03:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (rb_hash_fetch_m): use useful message for longer key, not a
+ nonsense id value.
+
+ * string.c (rb_str_ellipsize): new function to ellipsize a string.
+
+ * include/ruby/encoding.h (rb_enc_step_back): new function to step
+ back n characters.
+
+Sun Jan 30 12:53:38 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enc/emacs_mule.c (emacsmule_islead): fix inverse condition.
+
+Sun Jan 30 09:37:25 2011 Yutaka Kanemoto <kanemoto@ruby-lang.org>
+
+ * io.c (struct argf): char behaves like an unsigned char
+ by default on AIX.
+
+Sun Jan 30 08:02:55 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: Mac OS X wrongly reports it has fdatasync(3).
+
+Sun Jan 30 03:29:47 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/openssl/ossl_bn.c (GetBNPtr): add missing nil case.
+ patched by Martin Bosslet. [ruby-core:34987]
+
+Sun Jan 30 01:02:28 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * include/ruby/ruby.h: Added NUM2MODET() and MODET2NUM() default
+ definition.
+ Because r30686 introduced win32 build failure.
+
+Sat Jan 29 22:16:26 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * array.c (rb_ary_join): [].join.encoding must be US-ASCII.
+ [ruby-list:47790]
+
+Sat Jan 29 20:22:39 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * benchmark/driver.rb (BenchmarkDriver#measure): Show command line
+ when abnormal exiting occur.
+
+Sat Jan 29 10:53:16 2011 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * vm_insnhelper.c (vm_get_ev_const): no-scope reference to toplevel
+ private constant has been prohibited incorrectly.
+
+ * test/ruby/test_module.rb (test_toplevel_private_constant): add a
+ test for above.
+
+Sat Jan 29 08:43:23 2011 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * lib/rubygems*: Import rubygems 1.5.0 (release candidate @ 09893d9)
+ * test/rubygems: Ditto
+
+Sat Jan 29 02:02:37 2011 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * variable.c (rb_mod_const_of, sv_i): Module#constant should exclude
+ private constants. see [ruby-core:32912].
+
+ * test/ruby/test_module.rb (test_constants_with_private_constant): add
+ a test for above.
+
+Sat Jan 29 01:36:41 2011 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * variable.c (rb_const_set): const_set should preserve constant
+ visibility. see [ruby-core:32912].
+
+ * test/ruby/test_module.rb: add a test for above.
+
+Sat Jan 29 01:24:57 2011 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * compile.c (NODE_CLASS, NODE_MODULE), insns.def (defineclass): raise
+ an exception when "class Foo::Bar" is evaluated and Foo::Bar is
+ private. To implement this, define_type of "defineclass" is added
+ so that the instruction can distinguish whether the class definition
+ is scoped (class Foo::Bar) or not (class Bar).
+
+ * test/ruby/test_class.rb (test_redefine_private_class),
+ test/ruby/test_module.rb
+ (test_define_module_under_private_constant): add tests for above.
+
+Sat Jan 29 01:19:17 2011 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * constant.h, variable.c: to ensure compatibility, rb_const_get_* must
+ not raise an exception even when the constant is private. Instead,
+ rb_public_const_get_* and rb_public_const_defined_* are introduced,
+ which raise an exception when the referring constant is private.
+ see [ruby-core:32912].
+
+ * vm_insnhelper.c (vm_get_ev_const): use rb_public_const_get_* instead
+ of rb_const_get_* to follow the constant visibility when user code
+ refers a constant.
+
+ * test/ruby/test_marshal.rb (test_marshal_private_class): add a test.
+ This test had failed because of incompatibility of rb_const_get.
+
+Sat Jan 29 00:30:44 2011 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * variable.c (set_const_visibility): fix typo. a patch from Tomoyuki
+ Chikanaga in [ruby-core:32919].
+
+Fri Jan 28 23:20:28 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/gdbm/test_gdbm.rb (TestGDBM#test_s_open_no_create,
+ TestGDBM2#test_writer_open_notexist): We only need to skip libgdbm
+ 1.8.0, not all 1.8.x. 1.8.1 or later don't have GDBM_WRITER sickness.
+
+Fri Jan 28 21:56:57 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * ext/dbm/extconf.rb: Added new header places for Fedora13.
+
+Fri Jan 28 21:49:30 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/zlib/zlib.c: parenthesize macro arguments.
+
+Fri Jan 28 17:47:33 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/gdbm/test_gdbm.rb (TestGDBM2#test_writer_open_notexist):
+ gdbm 1.8.x changed GDBM::WRITER behavior. Thus our testcase need
+ to be changed too.
+
+Fri Jan 28 17:33:28 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/gdbm/test_gdbm.rb (TestGDBM#test_s_open_no_create): skip
+ the test if gdbm version is 1.8.x.
+
+Fri Jan 28 16:30:51 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/ruby/test_require.rb (TestRequire#test_require_too_long_filename):
+ Added -w option because too long path error don't output a message
+ by default since r30660. [Bug #4336] [ruby-dev:43134]
+
+Fri Jan 28 16:19:38 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/ruby/test_require.rb (TestRequire#test_require_path_home_{1,2}):
+ Added -w option because too long path error don't output a message
+ by default since r30660. [Bug #4336] [ruby-dev:43134]
+
+Fri Jan 28 16:04:54 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/ruby/test_require.rb (TestRequire#test_require_path_home_{1,2,3}):
+ split from test_require_path_home.
+
+Fri Jan 28 13:04:38 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in (--with-valgrind): Fixed r29683. Now this option
+ is really default on.
+
+Fri Jan 28 12:05:48 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: Add #include<sys/stat.h> when struct stat is
+ tested. Otherwise, incomplete type dereference error will occur.
+
+Fri Jan 28 11:53:19 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: redundant variable names made strange conftest
+ error. Fixed it.
+
+Fri Jan 28 11:47:00 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_process.rb (TestProcess#test_too_long_path{,2}):
+ should handle Errno::E2BIG, because this test checks crash of ruby,
+ not the error type system.
+
+Fri Jan 28 11:23:54 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (rb_io_open): Use NUM2MODET() instead NUM2UINT().
+ * io.c (rb_scan_open_args): ditto.
+
+Fri Jan 28 10:58:20 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: Added mode_t type checking.
+ * process.c (rb_exec_arg_addopt): Use NUM2MODET() instead
+ NUM2LONG because clang makes compile error by this narrowing
+ conversion.
+ * process.c (rb_run_exec_options_err): ditto.
+
+Fri Jan 28 02:37:18 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * re.c (rb_reg_raise): add GC guard to prevent intermediate
+ variable from GC.
+
+Fri Jan 28 02:35:41 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * hash.c (rb_hash_fetch_m): add GC guard to prevent intermediate
+ variable from GC.
+
+Fri Jan 28 01:33:51 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/ruby/test_process.rb (TestProcess#test_too_long_path)
+ TestProcess#test_too_long_path): Reduced string size from 100MB
+ to 10MB. 100MB may cause no memory error. It isn't intended.
+
+Fri Jan 28 01:27:42 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/ruby/test_process.rb (TestProcess#test_too_long_path2):
+ Factored out from test_too_long_path. A test should only do
+ one test.
+
+Thu Jan 27 23:29:36 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * st.c (st_foreach): check if unpacked.
+
+Thu Jan 27 23:14:19 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * misc/ruby-mode.el (ruby-mode-map): remove deprecated binding.
+ use M-; instead.
+
+Thu Jan 27 21:58:32 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * bignum.c (rb_str_to_inum): get rid of too huge alloca().
+
+Thu Jan 27 21:43:29 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * object.c (rb_str_to_dbl): rewrite again. use ALLOCV instead
+ rb_str_tmp_new().
+
+Thu Jan 27 21:41:47 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * win32/win32.c: get rid of STRNDUPA(). It's dangerous API.
+
+Thu Jan 27 21:31:57 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * win32/win32.c (rb_w32_aspawn): get rid of too huge alloca().
+ [Bug #4330] [ruby-core:34898]
+
+Thu Jan 27 20:30:18 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * win32/win32.c (rb_w32_spawn): get rid of too huge alloca().
+
+Thu Jan 27 18:49:53 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * win32/win32.c (open_dir_handle): get rid of too huge alloca().
+
+Thu Jan 27 18:34:58 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * file.c (w32_io_info): get rid of too huge alloca().
+ [Bug #4313] [ruby-core:34830]
+
+Thu Jan 27 18:19:51 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * win32/win32.c (wstati64): get rid of too huge alloca().
+ [Bug #4316] [ruby-core:34834]
+
+Thu Jan 27 15:11:52 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_spawn, rb_w32_aspawn): get rid of too huge
+ alloca(). this is the real fix of [ruby-core:34833].
+
+Thu Jan 27 12:46:25 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * process.c (ALLOC_ARGV_WITH_STR): fix void pointer arithmetic.
+
+Thu Jan 27 08:41:40 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * process.c (proc_exec_v, rb_proc_exec_n, rb_proc_exec)
+ (proc_spawn_n, proc_spawn): get rid of too huge alloca().
+ [ruby-core:34827], [ruby-core:34833]
+
+Thu Jan 27 08:32:17 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/ruby.h (ALLOCV): new API for exception-safe
+ temporary buffer. [ruby-core:34844]
+
+ * string.c (rb_alloc_tmp_buffer, rb_free_tmp_buffer):
+ implementation of the API.
+
+Thu Jan 27 08:22:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dln_find.c (dln_find_1): use rb_warning and return immediately
+ if fname is longer than buffer.
+
+Wed Jan 26 22:57:30 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * class.c (clone_method): add GC guard to prevent intermediate
+ variable from GC. [Bug #4321] [ruby-dev:43107]
+
+Wed Jan 26 22:45:16 2011 Tanaka Akira <akr@fsij.org>
+
+ * template/id.h.tmpl: parenthesize macro arguments.
+
+Wed Jan 26 22:28:49 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * vm_eval.c (rb_throw_obj): add GC guard to prevent intermediate
+ variable from GC. [Bug #4322] [ruby-dev:43108]
+
+Wed Jan 26 17:08:59 2011 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+
+ * ext/openssl/ossl_asn1.c (ossl_asn1_decode0): OpenSSL::ASN1.decode
+ should reject indefinite length primitive encodings as that is
+ illegal. Patch by Martin Bosslet. See #4324.
+
+Wed Jan 26 10:36:28 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (=~): documentation fix; the return value is nil when
+ it doesn't match. patched by Andrei Kulakov [ruby-core:34562]
+
+Tue Jan 25 08:41:58 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dln_find.c (dln_find_1): omit too long pathnames.
+
+Tue Jan 25 08:28:19 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_resize): get rid of out-of-bound access.
+
+Tue Jan 25 07:48:22 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * test/ruby/test_thread.rb: remove unused variables.
+
+Tue Jan 25 07:45:44 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * test/ruby/test_thread.rb (TestThread#test_condvar_nolock_2): get
+ rid of method redefined.
+
+Tue Jan 25 07:00:52 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_string_value_cstr): rb_str_modify can change
+ RSTRING_PTR.
+
+Tue Jan 25 03:24:28 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/ruby/test_thread.rb: Added various ConditionVariable tests.
+
+Mon Jan 24 22:26:33 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * object.c (rb_str_to_dbl): Fix again. use rb_str_tmp_new()
+ instead ALLOC_N.
+
+Mon Jan 24 21:50:48 2011 Tanaka Akira <akr@fsij.org>
+
+ * vm_insnhelper.h: parenthesize macro arguments.
+
+Mon Jan 24 21:28:34 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * object.c (rb_str_to_dbl): use ALLOC_N instead ALLOCA_N because
+ ALLOC_N may cause stack overflow.
+
+Mon Jan 24 21:04:45 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * error.c (rb_invalid_str): prevent intermediate variable from GC.
+ [ruby-core:34820]
+
+Sun Jan 23 23:01:54 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/io/console/test_io_console.rb: Don't run test if the system
+ don't support io/console.
+
+Sun Jan 23 22:17:07 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/fiddle/test_fiddle.rb: Don't run test if the system don't support
+ fiddle.
+
+ * test/fiddle/test_function.rb: ditto.
+ * test/fiddle/test_closure.rb: ditto.
+
+Sun Jan 23 11:39:18 2011 Tanaka Akira <akr@fsij.org>
+
+ * vm_exec.h: parenthesize macro arguments.
+
+Sun Jan 23 10:33:02 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * template/fake.rb.in (ruby): suppress warnings.
+
+Sun Jan 23 08:00:09 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (str_nth_len, str_utf8_nth): return the rest length together.
+
+ * string.c (rb_str_substr): get rid of measure the length always
+ to improve performance for huge string. [ruby-core:34648]
+
+Sun Jan 23 00:40:10 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/test_syslog.rb: Fix to make a lot of test failure if
+ the platform doesn't support syslog.
+
+Sat Jan 22 11:49:55 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/to_ruby.rb: fixing merge key support
+ when multiple merge keys are specified.
+
+ * test/psych/test_merge_keys.rb: tests for multi-merge key support
+
+Sat Jan 22 11:33:04 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/to_ruby.rb: merge keys are actually
+ part of YAML 1.1, so they should be supported. Remove warning and
+ merge keys to parent. [ruby-core:34679]
+
+ * test/psych/test_merge_keys.rb: test for merge keys
+
+Sat Jan 22 10:25:19 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/parser.c (parse): add the file name to the exception when
+ parse errors occur.
+
+ * test/psych/test_parser.rb: test for parse error file name
+
+Sat Jan 22 10:12:30 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/parser.c (parse): fix assertion error when reusing a
+ parser after an exception has been raised
+
+ * test/psych/test_parser.rb: test for assertion error
+
+Sat Jan 22 04:09:22 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/nodes/node.rb: Make Psych::Nodes::Node
+ enumerable.
+
+ * ext/psych/lib/psych/visitors/depth_first.rb: Add a depth-first
+ visitor to enumerate over a YAML AST in a depth-first fashion
+
+ * test/psych/nodes/test_enumerable.rb: test for enumerating nodes
+
+ * test/psych/visitors/test_depth_first.rb: test for depth-first
+ visitor
+
+Sat Jan 22 00:53:42 2011 Tanaka Akira <akr@fsij.org>
+
+ * vm_core.h: parenthesize macro arguments.
+
+Fri Jan 21 18:15:09 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in: should not use -Werror=* flags while conftests.
+
+Fri Jan 21 09:17:00 2011 Luis Lavena <luislavena@gmail.com>
+
+ * configure.in: Fix incorrectly detected x86_64-w64-mingw32 due
+ canonalization of target_os. Bug #3889 [ruby-core:32634]
+
+Thu Jan 20 23:44:00 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: Fix rb_cv_va_args_macro was broken. We are using
+ -Werror=implicit-function-declaration compile option. therefore
+ we need a function declaration explicitly.
+
+Thu Jan 20 23:58:02 2011 Tanaka Akira <akr@fsij.org>
+
+ * node.h: parenthesize macro arguments.
+
+Thu Jan 20 23:25:28 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: Add '#include <stdlib.h>' to
+ rb_cv_localtime_overflow test too. It's reported by Tomoyuki
+ Chikanaga. Thanks.
+
+Thu Jan 20 16:11:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * README.EXT, README.EXT.ja: You shouldn't choose ``conftest.c'' as a
+ name of a source file.
+
+Thu Jan 20 12:15:44 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: Add stdlib.h inclusion into rb_cv_negative_time_t
+ test because it's required for exit(3). The patch is
+ created by Tomoyuki Chikanaga. [Bug #4287] [ruby-dev:43060]
+
+Thu Jan 20 11:39:41 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/webrick/utils.rb (TestWEBrick::RubyBin): test CGI does not need
+ to load rubygems. if it activated, ruby raises LoadError about
+ rbconfig.rb.
+
+Thu Jan 20 09:19:42 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/json_tree.rb: Fix JSON emit for
+ DateTime and Time classes.
+
+ * test/psych/test_json_tree.rb: test for JSON emit
+
+Thu Jan 20 08:02:46 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/coder.rb (represent_object): arbitrary objects
+ may be passed to the Psych::Coder object.
+
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: support for visiting
+ arbitrary objects set on the coder.
+
+ * test/psych/test_coder.rb: supporting test case.
+
+Thu Jan 20 06:03:17 2011 Tanaka Akira <akr@fsij.org>
+
+ * method.h: parenthesize macro arguments.
+
+Wed Jan 19 13:16:05 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/commands/sources_command.rb: Finish removing code,
+ (fixes sources command test).
+
+Wed Jan 19 13:04:16 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * proc.c (proc_call): Add gc guard to avoid segfault. The fix
+ is created by Tomoyuki Chikanaga. [Bug #4238][ruby-dev:42963]
+
+Wed Jan 19 12:31:28 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems.rb: Since gem_prelude requires rubygems, enable
+ custom_require always.
+
+Wed Jan 19 12:08:08 2011 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/commands/dependency_command.rb: Remove require of
+ deleted file.
+ * lib/rubygems/commands/fetch_command.rb: ditto
+ * lib/rubygems/commands/setup_command.rb: ditto
+ * lib/rubygems/commands/sources_command.rb: ditto
+ * lib/rubygems/commands/specification_command.rb: ditto
+
+Wed Jan 19 08:13:59 2011 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * lib/rubygems*: Import rubygems 1.5.0 (release candidate)
+ * test/rubygems: Ditto
+
+Tue Jan 18 23:31:01 2011 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * parse.y: avoid NULL reference. [ruby-dev:43067]
+
+Wed Jan 19 02:54:04 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * vsnprintf.c (cvt): set first byte of buf to NUL for the case when
+ no bytes are written to the buf. [ruby-dev:43062]
+
+Tue Jan 18 23:04:51 2011 Tanaka Akira <akr@fsij.org>
+
+ * gc.h: parenthesize macro arguments.
+
+Tue Jan 18 18:31:14 2011 Keiju Ishitsuka <keiju@ishitsuka.com>
+
+ * lib/irb/completion.rb: Irb tab completion support for XX::method
+ forms.
+
+Tue Jan 18 15:05:55 2011 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+
+ * lib/logger.rb: added RDoc document for logging message escape
+ by Hal Brodigan. See #3869
+
+Tue Jan 18 07:53:52 2011 Tanaka Akira <akr@fsij.org>
+
+ * eval_intern.h: parenthesize macro arguments.
+
+Tue Jan 18 04:42:44 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/parser.rb (Mark): Adding a class to wrap
+ marker information
+
+ * ext/psych/parser.c (mark): Add a method to return the mark object
+ for the parser
+
+ * test/psych/test_parser.rb: tests for the Mark class.
+
+Tue Jan 18 02:46:55 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/json_tree.rb (visit_String): JSON
+ strings should be dumped with double quotes. [ruby-core:34186]
+
+ * test/psych/test_json_tree.rb: test for double quotes
+
+Mon Jan 17 23:36:33 2011 Tanaka Akira <akr@fsij.org>
+
+ * array.c (rb_ary_times): less MEMCPY calls.
+
+Mon Jan 17 22:54:33 2011 Tanaka Akira <akr@fsij.org>
+
+ * debug.h: parenthesize macro arguments.
+
+Mon Jan 17 21:40:25 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby.c (process_options): revert r30549.
+
+Sun Jan 16 20:55:45 2011 Tanaka Akira <akr@fsij.org>
+
+ * vsnprintf.c: parenthesize macro arguments.
+
+Sat Jan 15 11:57:30 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (warnflags): add -Werror=implicit-function-declaration
+ if available.
+
+ * lib/mkmf.rb (init_mkmf): ignore warnings in mkmf tests.
+
+ * test/mkmf/base.rb (setup, teardown): restore config values.
+
+ * test/mkmf/test_flags.rb: split from test_find_executable.rb.
+
+Sat Jan 15 10:04:14 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby.c (process_options): autoload rubygems.
+
+ * tool/compile_prelude.rb (Prelude#initialize): ignore empty
+ preludes.
+
+ * ruby.c (ruby_init_prelude): get rid of global namespace
+ pollution.
+
+Sat Jan 15 09:42:12 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/io.h: missing prototypes.
+
+Fri Jan 14 23:25:55 2011 Tanaka Akira <akr@fsij.org>
+
+ * vm_method.c: parenthesize macro arguments.
+
+Fri Jan 14 15:32:29 2011 Shugo Maeda <shugo@ruby-lang.org>
+
+ * test/net/imap/test_imap.rb: call neither logout nor disconnect
+ unless connected. patch by Kazuhiro NISHIYAMA. [ruby-dev:42860]
+
+Fri Jan 14 14:56:57 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/imap.rb: use bytesize for binary strings.
+ patched by Yoshimasa Niwa. [ruby-core:34222]
+
+Fri Jan 14 14:01:12 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * pack.c (pack_unpack): the resulted string of unpack('M') must have
+ ASCII-8BIT encoding (and ENC_CODERANGE_VALID). [ruby-core:34482]
+
+Fri Jan 14 13:38:58 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/zlib/zlib.c (gzfile_check_footer): ISIZE (Input SIZE) in
+ gzip's header is the size of uncompressed input data modulo 2^32.
+ [ruby-core:34481] http://www.ietf.org/rfc/rfc1952.txt
+
+Fri Jan 14 11:36:25 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * configure.in, win32/Makefile.sub (RUNRUBY): require path should
+ include "." because rbconfig.rb is there.
+
+Fri Jan 14 10:40:11 2011 Ryan Davis <ryan@lust.local>
+
+ * gem_prelude.rb: Just require rubygems. Fixes rubygems 1.4.
+ * lib/rubygems.rb: removed all Gem::Quickloader code.
+ * ruby.c: renamed ruby_init_gems to ruby_init_prelude. Set
+ $disable_rubygems since there is no fine grained mechanism to
+ skip parts of the prelude. Open to suggestions on how to do this
+ better.
+ * test/*.rb: Load path isn't set up correctly, so add
+ --disable-gems as needed to failing tests that are explicitly
+ testing stderr w/ ==.
+
+Fri Jan 14 07:30:47 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (argf_next_argv): go advance when the next file cannot be
+ read. [ruby-core:34446]
+
+Thu Jan 13 20:49:19 2011 Tanaka Akira <akr@fsij.org>
+
+ * vm_insnhelper.c: parenthesize macro arguments.
+
+Thu Jan 13 13:21:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * vm_dump.c: delete dashes to make lines 80 chars, Patched by
+ Shota Fukumori (sora_h). [Bug #4275] [ruby-dev:43021]
+
+Thu Jan 13 13:21:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * vm_dump.c: fix misspelling of CrashReporter, Patched by Shota
+ Fukumori (sora_h). [Bug #4275] [ruby-dev:43021]
+
+Thu Jan 13 06:27:29 2011 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * error.c: Exception#to_s should actually call to_s.
+
+Thu Jan 13 00:32:54 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c (get_nth_dirname): decrement the directory index
+ because the index specifies the index of given included_directories
+ which is separated by NUL and its index is begun from 1.
+ Note that 0 specifies the current directory of the compilation.
+ see also http://www.dwarfstd.org/doc/dwarf-2.0.0.pdf
+
+Thu Jan 13 00:06:38 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (rb_f_syscall): Add warning messages. [ruby-core:34062]
+
+Thu Jan 13 00:00:07 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (rb_f_syscall): Some syscall return unsigned or pointer value.
+ Therefore we should only check the result is -1 or not.
+ [ruby-core:34062]
+
+Wed Jan 12 23:55:48 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (rb_f_syscall): Add 64bit Linux support. Some syscall takes
+ long type arguments.
+
+Wed Jan 12 19:37:10 2011 Tanaka Akira <akr@fsij.org>
+
+ * vm_dump.c: parenthesize macro arguments.
+
+Wed Jan 12 19:28:23 2011 Tanaka Akira <akr@fsij.org>
+
+ * vm.c (thread_free): reset ruby_current_thread if it points the
+ thread to free.
+ * gc.c (slot_sweep): don't call RUBY_VM_SET_FINALIZER_INTERRUPT if
+ there is no current thread.
+ [ruby-dev:43000]
+
+Wed Jan 12 19:09:29 2011 Tanaka Akira <akr@fsij.org>
+
+ * enum.c (sort_by_i): reenter check more strictly.
+ (sort_by_cmp): ditto.
+ [ruby-dev:43003] reported by Usaku NAKAMURA.
+
+Wed Jan 12 16:25:12 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * lib/net/http.rb (Net::HTTP#connect): makes it timeout during
+ SSL handshake too. [ruby-core:34203]
+ Patch by Marc Slemko.
+
+ * test/net/http/test_http.rb (TestNetHTTP_v1_2#test_timeout_during_HTTP_session):
+ test for [ruby-core:34203]
+
+ * test/net/http/test_https.rb (TestNetHTTPS#test_timeout_during_SSL_handshake):
+ ditto.
+
+Wed Jan 12 16:24:53 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * ext/readline/extconf.rb: new checks for RL_PROMPT_START_IGNORE
+ and RL_PROMPT_END_IGNORE. [ruby-core:34331]
+
+ * ext/readline/readline.c: enables USE_INSERT_IGNORE_ESCAPE only if
+ RL_PROMPT_{START,END}_IGNORE are available to get rid of compilation
+ error with libedit.
+
+Wed Jan 12 15:53:49 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * README.EXT.ja (rb_ensure): typo.
+
+Wed Jan 12 11:33:46 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c: OpenBSD uses the elf_abi.h header file instead of the
+ elf.h header file. patched by Jeremy Evans [ruby-core:34384]
+
+Wed Jan 12 03:59:36 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * test/webrick/test_cgi.rb: Removes usage of deprecated
+ :RequestHandler option.
+ patched by Peter Weldon [ruby-core:34010]
+
+ * test/webrick/test_httpproxy.rb: ditto.
+
+ * test/webrick/test_httpserver.rb: Add a test of the deprecation
+ behaviour.
+
+Wed Jan 12 08:37:07 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (hash_i): return different values for inverse hash.
+ [ruby-core:34334]
+
+Tue Jan 11 20:32:59 2011 Tanaka Akira <akr@fsij.org>
+
+ * variable.c: parenthesize macro arguments.
+
+Tue Jan 11 13:06:38 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * array.c (rb_ary_resize): should care of embeded array when extending
+ the array.
+
+ * array.c (rb_ary_resize): need to set capa when changing the real
+ size of the array.
+ these are latent bugs.
+
+Mon Jan 10 22:46:43 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/defines.h (CASEFOLD_FILESYSTEM): HFS+ is case
+ insensitive.
+
+ * load.c (loaded_feature_path, rb_feature_p, load_lock): on a
+ case-insensitive filesystem, loaded features search should
+ ignore case. [ruby-core:34297]
+
+Mon Jan 10 21:34:12 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (showflags): show LD commands.
+
+Mon Jan 10 14:32:55 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/ruby/test_method.rb (TestMethod#test_define_method): method
+ transplanting between class and module is impossible.
+
+Mon Jan 10 13:51:17 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * misc/rdoc-mode.el (rdoc-mode): show trailing whitespace.
+
+Mon Jan 10 11:22:02 2011 Tanaka Akira <akr@fsij.org>
+
+ * util.c: parenthesize macro arguments.
+
+Mon Jan 10 07:41:31 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * misc/README: mention rdoc-mode.el and ruby-style.el.
+
+Sun Jan 9 20:37:21 2011 Tanaka Akira <akr@fsij.org>
+
+ * transcode.c: parenthesize macro arguments.
+
+Sun Jan 9 16:31:53 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * io.c (Kernel.#syscall): implemented on LP64/LLP64 environments too.
+ also uses __syscall if available for *BSD on 64bit architecture.
+ [ruby-core:34062]
+
+Sun Jan 9 16:31:34 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * lib/irb/locale.rb (IRB::Locale::LOCALE_NAME_RE):
+ some platform has a locale without territory but with
+ encoding.
+ (#each_sub_locale): ditto.
+
+Sun Jan 9 14:47:50 2011 TAKAO Kouji <kouji@takao7.net>
+
+ * ext/readline/readline.c: apply a patch from Nobuyoshi Nakada.
+ fixed #3616 [ruby-core:31484] IRB + readline incorrectly counts
+ non-printing characters in prompt
+
+Sat Jan 8 21:47:26 2011 Tanaka Akira <akr@fsij.org>
+
+ * enum.c (enum_sort_by): use rb_ary_resize.
+ (ary_cutoff): removed.
+
+Sat Jan 8 21:24:17 2011 Tanaka Akira <akr@fsij.org>
+
+ * pack.c (swapf): compilation condition simplified.
+ (swapd): ditto.
+
+Sat Jan 8 20:51:25 2011 Tanaka Akira <akr@fsij.org>
+
+ * pack.c (swapd): remove duplicated code.
+
+Sat Jan 8 19:28:55 2011 Tanaka Akira <akr@fsij.org>
+
+ * thread.c: parenthesize macro arguments.
+
+Fri Jan 7 23:07:40 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (configuration): backref needs to capture.
+
+Fri Jan 7 21:57:22 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * misc/ruby-mode.el (ruby-mode-variables), misc/ruby-style.el:
+ show trailing whitespace.
+
+ * misc/ruby-mode.el (ruby-font-lock-syntactic-keywords): highlight
+ regexp after open bracket. [ruby-core:34183]
+
+Fri Jan 7 00:37:35 2011 Tanaka Akira <akr@fsij.org>
+
+ * string.c: parenthesize macro arguments.
+
+Thu Jan 6 22:42:02 2011 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * bignum.c (bigmul1_karatsuba): avoid overflow that make assertion
+ fail in certain case. this patch is contributed from Ray Chason
+ <chasonr at gmail.com> in personal communication.
+
+Thu Jan 6 20:55:49 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/mkmf.rb (create_makefile): ignore rest from first dot from
+ TARGET to generate init function name.
+ this is followup of r30464.
+
+Thu Jan 6 11:27:01 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/json/tree_builder.rb (start_mapping): tags
+ should not be included in JSON mapping
+
+Thu Jan 6 09:23:33 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * lib/net/protocol.rb (eof?): BufferedIO should proxy eof? to the
+ underlying IO object.
+
+Thu Jan 6 09:12:31 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * lib/mkmf.rb (configuration): fixing gsub when multiple error flags
+ are passed to GCC.
+
+Thu Jan 6 05:25:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_ary_modify): export.
+
+Thu Jan 6 05:14:41 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/stringio/stringio.c (get_strio, strio_set_string)
+ (strio_reopen): check if frozen. [ruby-core:33648]
+
+Thu Jan 6 05:10:58 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_ary_resize): new utility function. [ruby-dev:42912]
+
+Thu Jan 6 05:03:26 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dln.c (init_funcname_len): ignore rest from first dot.
+ [ruby-dev:41774]
+
+Thu Jan 6 02:55:48 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: use YAML 1.0 output
+ format for serializing nil values. Thanks Eric Hodel!
+
+ * test/psych/test_nil.rb: test for nil values
+
+Wed Jan 5 14:21:34 2011 Mark Dodwell <hi@mkdynamic.co.uk>
+
+ * string.c: fix rdoc typo.
+ https://github.com/shyouhei/ruby/pull/3
+
+Wed Jan 5 14:06:01 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/rdoc/test_rdoc_options.rb (TestRDocOptions#test_check_files):
+ skip on Windows because chmod 0 doesn't mean unreadable by owner.
+
+Wed Jan 5 13:56:54 2011 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/net/http.rb (Net::HTTP#get): A header hash given should not
+ be modified.
+
+Wed Jan 5 12:10:08 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/dl/{cfunc.c,dl.h,handle.c}, ext/fiddle/fiddle.{h,c}: Use _WIN32
+ rather than checking for windows.h. Thanks Jon Forums!
+ [ruby-core:33977]
+
+Sat Jan 1 17:02:50 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * lib/irb/locale.rb (IRB::Locale#search_file): make it possible
+ to load a localization from a gem.
+ (IRB::Locale#lc_path): obsoleted because of the change of #search_file
+ (IRB::Locale#each_localized_path): new private method, based on
+ lc_path
+ (IRB::Locale#find): follows the change of #search_file.
+ (IRB::Locale#load): removed duplicate with #find.
+
+Sat Jan 1 11:44:42 2011 Tanaka Akira <akr@fsij.org>
+
+ * strftime.c: parenthesize macro arguments.
+
+Sat Jan 1 11:10:29 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/zlib/zlib.c: take care of platforms where long is bigger
+ than int.
+
+Sat Jan 1 11:03:58 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * NEWS (optparse): shell completion support.
+
+ * misc/README (rb_optparse.{bash,zsh}): for shell completion.
+
+ * include/ruby/intern.h (VALUE rb_ary_print_on): I have never seen
+ this function anywhere.
+
+Sat Jan 1 04:20:11 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_write_console): don't raise exception when
+ the conversion is for writing to console.
+ Patched by Heesob Park [ruby-core:33999]
+
+Fri Dec 31 12:02:06 2010 Tanaka Akira <akr@fsij.org>
+
+ * enum.c (enum_sort_by): use less temporary objects.
+
+Fri Dec 31 11:46:47 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (warnflags), lib/mkmf.rb (configuration): turn
+ warnings into errors only for bundled extensions.
+ [ruby-core:33815]
+
+Fri Dec 31 11:15:57 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/zlib/zlib.c (sizeof): zlib.h mistakenly assumes the result
+ of sizeof to be int, not size_t.
+
+Fri Dec 31 10:27:34 2010 Tanaka Akira <akr@fsij.org>
+
+ * st.c: parenthesize macro arguments.
+
+Fri Dec 31 03:23:26 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * vsnprintf.c (BSD__uqtoa): Fix overflow when long != quad_t.
+ patched by Peter Weldon <peter.weldon AT null.net>
+ [ruby-core:33985]
+
+Fri Dec 31 03:00:34 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * Makefile.in: remove unnecessary semicolons.
+
+Thu Dec 30 23:09:47 2010 wanabe <s.wanabe@gmail.com>
+
+ * vm.c (vm_define_method): guard iseq from GC while method definition.
+ [ruby-dev:42832]
+
+Thu Dec 30 20:18:32 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * win32/Makefile.sub: ditto.
+
+Thu Dec 30 20:57:09 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * Makefile.in: Check V=1 argument if run "make clean" or similar.
+
+Thu Dec 30 20:41:50 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * Makefile.in: Kill ugly line continuation.
+
+Thu Dec 30 11:49:40 2010 Tanaka Akira <akr@fsij.org>
+
+ * sprintf.c: parenthesize macro arguments.
+
+Wed Dec 29 21:20:13 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (maygvl_copy_stream_wait_readwrite): define if USE_SENDFILE
+
+Wed Dec 29 20:37:43 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/extmk.rb: strip current directory prefix.
+
+ * enc/depend (clean): remove name2ctype.h when out-of-place build.
+
+ * win32/Makefile.sub (clean-enc): pass V to inferior make.
+
+Wed Dec 29 18:23:46 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * re.c (rb_reg_expr_str): need to escape if the coderange is invalid.
+
+Wed Dec 29 10:06:51 2010 Tanaka Akira <akr@fsij.org>
+
+ * signal.c: parenthesize macro arguments.
+
+Wed Dec 29 07:22:15 2010 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rake/rdoctask.rb: Deprecate in favor of rdoc/task.
+
+Wed Dec 29 07:07:06 2010 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc: Import RDoc 3.1
+
+Tue Dec 28 18:36:38 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * error.c, include/ruby/intern.h (rb_compile_error_with_enc): new
+ function to raise syntax error, with source encoding'ed message.
+
+ * parse.y (compile_error): use above function.
+ [ruby-core:33951] (#4217)
+
+Tue Dec 28 07:37:38 2010 Tanaka Akira <akr@fsij.org>
+
+ * ruby.c: parenthesize macro arguments.
+
+Tue Dec 28 07:17:11 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * NEWS: add ARGF.write and so on.
+
+Tue Dec 28 07:12:38 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * NEWS: add new magic-comment. (warn-indent) [ruby-core:25442]
+
+Tue Dec 28 04:32:37 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/fiddle/extconf.rb: check for windows.h while building fiddle.
+ Thanks Jon Forums! [ruby-core:33923]
+
+Tue Dec 28 01:45:12 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * NEWS: Add Zlib.deflate and Zlib.inflate.
+ [ruby-dev:42833]
+
+Mon Dec 27 21:22:33 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * win32/configure.bat: Remove obsoleted coding rule. Now, we
+ don't support to build on Windows 95/98 and Me.
+
+Mon Dec 27 18:27:13 2010 Tanaka Akira <akr@fsij.org>
+
+ * re.c: parenthesize macro arguments.
+
+Mon Dec 27 15:22:23 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/README.win32: note to need NT based OS to build ruby.
+
+Mon Dec 27 12:14:46 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * common.mk (EXTMK_ARGS): specify to pass macro V, because nmake
+ doesn't pass it via MAKEFLAGS.
+
+Mon Dec 27 10:33:43 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/zlib/zlib.c (Init_zlib): Add Zlib.deflate and Zlib.inflate.
+ [ruby-dev:42833]
+
+Mon Dec 27 07:38:07 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * misc/rb_optparse.zsh: add compdef for generator.
+
+Mon Dec 27 07:32:07 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * lib/optparse.rb (OptionParser#compsys): escape brackets too.
+ [ruby-dev:42754]
+
+Mon Dec 27 01:30:08 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/mkconstants.rb: add IF_NAMESIZE.
+ add a default for INET6_ADDRSTRLEN.
+
+Sun Dec 26 23:49:47 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * win32/Makefile.sub: suppress a strange error message when RMALL
+ found no such file.
+ * win32/rmall.bat: new.
+
+Sun Dec 26 21:23:23 2010 <kosaki.motohiro@gmail.com>
+
+ * win32/Makefile.sub: fix 'nmake clean-enc' breakage since r28322.
+
+Sun Dec 26 22:25:07 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/ripper/depend (ripper.y): fix messages with nmake.
+ [ruby-dev:42896]
+
+Sun Dec 26 22:24:14 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (file_expand_path): get rid of warnings caused by
+ -Wdeclaration-after-statement on cygwin.
+
+Sun Dec 26 20:28:34 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * process.c (before_exec): add small comment.
+
+Sun Dec 26 20:52:21 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/mkconstants.rb: define INET_ADDRSTRLEN as 16 if not
+ available. fix compilation error on mswin32-60. reported by nobu.
+
+Sun Dec 26 19:37:37 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/option.c: define IFNAMSIZ if not available.
+ fix compilation error on mingw32. reported by nobu.
+
+Sun Dec 26 12:16:29 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/rdoc/ri/paths.rb (RDoc::RI::Paths::HOMEDIR): no exception if
+ HOME is not set. [ruby-core:33867]
+
+Sun Dec 26 11:39:11 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (stmt): missing ripper rule. i.e., `a::B ||= c 1'.
+ http://twitter.com/#!/wannabe53/status/18797576396472321
+ http://twitter.com/#!/wannabe53/status/18798416150663168
+
+Sun Dec 26 11:15:50 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/with_different_ofs.rb (DifferentOFS): should not affect
+ original classes.
+
+Sun Dec 26 09:35:07 2010 Tanaka Akira <akr@fsij.org>
+
+ * rational.c: parenthesize macro arguments.
+
+Sun Dec 26 09:22:19 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/option.c (rb_if_indextoname): new function to abstract
+ environments without if_indextoname.
+ (inspect_ipv6_multicast_if): new function to inspect
+ IPV6_MULTICAST_IF.
+ Socket::Option.new(:INET6, :IPV6, :MULTICAST_IF,
+ [2].pack("I!")).inspect is
+ "#<Socket::Option: INET6 IPV6 MULTICAST_IF eth0>".
+
+Sun Dec 26 04:31:15 2010 Luis Lavena <luislavena@gmail.com>
+
+ * ext/dl/win32/registry.rb: Corrected RegCreateKeyExA signature.
+ Patch by Rafal Michalski [ruby-core:33874] [Ruby 1.9-Bug#4203]
+
+Sun Dec 26 02:31:58 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (advice_arg_check): Change argument check.
+ Now, an unsupported advice makes NotImplementedError.
+ [ruby-dev:42887] [Ruby 1.9-Feature#4204]
+
+Sun Dec 26 03:00:53 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * ext/socket/extconf.rb: Fix build error which was introduced r30372.
+
+Sun Dec 26 01:37:10 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/socket/extconf.rb: check the existence of if_indextoname().
+
+ * ext/socket/option.c: yesterday's akr's commits destroyed the build of
+ some unrelated platforms (such as Windows).
+
+Sat Dec 25 23:29:11 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/option.c (inspect_ipv4_add_drop_membership): new function
+ to inspect struct ip_mreq and struct ip_mreqn for
+ IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP.
+ Socket::Option.new(:INET, :IP, :ADD_MEMBERSHIP,
+ [239,255,99,81, 0,0,0,0].pack("CCCCCCCC")).inspect is now
+ "#<Socket::Option: INET IP ADD_MEMBERSHIP 239.255.99.81 0.0.0.0>".
+ (inspect_ipv4_multicast_if): new function to inspect struct in_addr
+ and struct ip_mreqn for IP_MULTICAST_IF.
+ Socket::Option.new(:INET, :IP, :MULTICAST_IF,
+ [192,168,0,7].pack("CCCC")).inspect is now
+ "#<Socket::Option: INET IP MULTICAST_IF 192.168.0.7>".
+
+ * ext/socket/extconf.rb: check struct ip_mreq and struct ip_mreqn.
+
+Sat Dec 25 22:49:10 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/csv: DifferentOFS needs to be include in each classes.
+
+ * test/digest/test_digest_extend.rb (TestDigestExtend#setup):
+ should not depend on the result of previous tests
+
+ * test/with_different_ofs.rb (DifferentOFS::WithDifferentOFS): give
+ name.
+
+ * test/with_different_ofs.rb (DifferentOFS): test suite for test
+ suites affected by $,.
+
+ * test/digest/test_digest_extend.rb (TestDigestExtend): should not
+ assume $, invariant.
+
+ * test/csv/test_data_converters.rb, test/csv/test_table.rb: don't
+ call setup within tests.
+
+Sat Dec 25 20:01:40 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (pipe_open): Added rb_thread_atfork(). We must reinitialize
+ GVL at new process creation.
+
+Sat Dec 25 18:26:55 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/option.c (inspect_ipv6_mreq): new function to inspect
+ struct ipv6_mreq for IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP.
+ Socket::Option.new(:INET6, :IPV6, :JOIN_GROUP,
+ [0xff12,0,0,0,0,0,0,1, 2].pack("nnnnnnnnI!")).inspect is now
+ "#<Socket::Option: INET6 IPV6 JOIN_GROUP ff12::1 eth0>".
+
+ * ext/socket/extconf.rb: check struct ipv6_mreq.
+
+Sat Dec 25 18:04:30 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/csv.rb (CSV.foreach): 'rb' mode is defaulted in open.
+
+ * lib/csv.rb (CSV#init_separators): cannonicalize encoding options
+ as Encoding objects.
+
+Sat Dec 25 18:30:34 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_thread_atfork): Add small comment why we need
+ reset random seed.
+
+Sat Dec 25 17:33:55 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/csv/base.rb (TestCSV.with_different_ofs): give name to
+ anonymous classes.
+
+ * lib/csv.rb (CSV#init_separators): use IO#gets with length
+ parameter to get rid of wrong convertion.
+
+ * lib/csv.rb (CSV::foreach, CSV#initialize): directly use encoding
+
+ * lib/csv.rb, test/csv: should not assume $, invariant.
+
+Sat Dec 25 16:08:06 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * signal.c: change rb_atomic_t definition from uchar to uint.
+
+Sat Dec 25 15:04:05 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/csv/test_encodings.rb (TestEncodings#setup): fix evil test
+ suite writing to the source directory.
+
+Sat Dec 25 15:08:08 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * ext/pty/pty.c (chfunc): Added rb_thread_atfork_before_exec().
+ We must reinitialize GVL at new process creation. Otherwise
+ we may meet an insane deadlock. [Bug#4121][ruby-dev:42686]
+
+Sat Dec 25 14:27:09 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (rb_io_extract_encoding_option): accept Encoding object as
+ encoding: optional argument. [ruby-dev:42884]
+
+Sat Dec 25 13:37:55 2010 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * lib/minitest/*.rb: Imported minitest 2.0.2 r6093.
+
+Sat Dec 25 13:05:59 2010 Tanaka Akira <akr@fsij.org>
+
+ * random.c: parenthesize macro arguments.
+
+Sat Dec 25 12:48:50 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * load.c (rb_f_require_relative): don't omit return type.
+
+Sat Dec 25 11:06:00 2010 Eric Hodel <drbrain@segment7.net>
+
+ * load.c (rb_f_require_relative): Add documentation.
+
+Sat Dec 25 11:02:52 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/zlib/zlib.c (gzreader_gets): support optional length
+ parameter.
+
+ * ext/zlib/zlib.c (gzfile_read, gzfile_readpartial): length should
+ be long.
+
+Sat Dec 25 10:51:03 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/json/generator/generator.{c,h} (fbuffer_free_only_buffer):
+ unused.
+
+ * ext/openssl/ossl_pkcs5.c (ossl_pkcs5_pbkdf2_hmac): add casts.
+
+Fri Dec 24 08:46:04 2010 Tanaka Akira <akr@fsij.org>
+
+ * process.c: parenthesize macro arguments.
+
+Thu Dec 23 19:17:14 2010 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * test/net/imap/cacert.pem: updated because it has been expired.
+
+ * test/net/imap/server.crt: signed again because CA cert was expired.
+
+Thu Dec 23 11:16:52 2010 Tanaka Akira <akr@fsij.org>
+
+ * parse.y: parenthesize macro arguments.
+
+Thu Dec 23 11:00:09 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * error.c (rb_check_type): check for type from extensions for ruby
+ 1.8. see [ruby-core:33797].
+
+Thu Dec 23 08:12:59 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * lib/net/smtp.rb: refactoring Net::SMTP#esmtp= to use an
+ attr_accessor
+
+Thu Dec 23 06:35:41 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * lib/net/smtp.rb: Net::SMTP should close the SSL connection if the
+ connection verification fails.
+
+Thu Dec 23 01:47:58 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * NEWS: remove #object_id. [ruby-dev:42840]
+
+Wed Dec 22 08:56:39 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * NEWS: add Module#private_constant and Module#public_constant.
+ [ruby-dev:39685][ruby-core:32698]
+
+Wed Dec 22 07:59:23 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * NEWS: add IO#advise. [ruby-core:33110] [Ruby 1.9-Feature#4038]
+
+Tue Dec 21 23:45:31 2010 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * gc.c (Init_GC): move back object_id to Kernel. [ruby-dev:42840]
+
+Tue Dec 21 12:45:16 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (target_archs): remove temporary objects.
+
+ * enc/Makefile.in, enc/depend (clean): remove work directories.
+
+Tue Dec 21 07:39:12 2010 Tanaka Akira <akr@fsij.org>
+
+ * pack.c: parenthesize macro arguments.
+
+Tue Dec 21 06:25:43 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/rexml/test_contrib.rb (ContribTester#test_pos): should not
+ use fixed path name for tests. [ruby-dev:42827]
+
+ * test/rexml/test_sax.rb (SAX2Tester#test_socket): should not use
+ fixed port for tests. [ruby-dev:42828]
+
+Tue Dec 21 06:10:18 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (setup_args), vm.c (invoke_block_from_c),
+ vm_insnhelper.c (caller_setup_args): reverted r30241 and r30243
+ except for the test.
+
+Tue Dec 21 01:41:42 2010 Masaya Tarui <tarui@ruby-lnag.org>
+
+ * io.c : add an extra byte to buffer for the specification of read
+ in Windows. see [ruby-core:33460] and r29980. and, we have to
+ discuss how to do this one byte.
+
+Tue Dec 21 01:18:06 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * error.c: Fix build error for win32. This regression was
+ introduced by r30271.
+
+Tue Dec 21 00:59:40 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (thread_cleanup_func): Moved interrupted_lock
+ destroying code from native_thread_destroy() to
+ thread_cleanup_func() because it's platform independent logic.
+
+ * thread_win32.c (native_thread_destroy): ditto.
+ * thread_pthread.c (native_thread_destroy): ditto.
+
+Tue Dec 21 00:46:20 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (thread_cleanup_func): Don't touch native threading
+ resource at fork. Sadly this is purely bandaid. We need to
+ implement proper fix later. [Bug #4169] [ruby-core:33767]
+
+Tue Dec 21 00:22:44 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * error.c (exit_success_p): Check status code more carefully.
+ status code may have garbage in upper bit.
+
+Mon Dec 20 23:12:37 2010 Tanaka Akira <akr@fsij.org>
+
+ * node.c: parenthesize macro arguments.
+
+Mon Dec 20 20:04:41 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * NEWS: add #__id__ and #object_id. [ruby-dev:42778]
+
+Mon Dec 20 20:03:21 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread_pthread.c (native_thread_destroy): Fixed gvl_cond leak.
+
+Mon Dec 20 13:49:05 2010 Eric Hodel <drbrain@segment7.net>
+
+ * NEWS: Add item for RDoc 3.0.1
+
+ * lib/rdoc: Import RDoc 3.0.1, remove require for perl parser.
+
+Mon Dec 20 12:15:32 2010 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rdoc: Import RDoc 3.0.
+
+Mon Dec 20 01:55:03 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (Init_IO): Added O_DIRECT. This feature was proposed by
+ Run Paint Run Run.
+ [Feature #4015] [ruby-core:33018]
+
+Sun Dec 19 19:15:23 2010 Tanaka Akira <akr@fsij.org>
+
+ * marshal.c: parenthesize macro arguments.
+
+Sat Dec 18 21:52:37 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * vsnprintf.c (BSD_vfprintf): suppress warning: "_WIN32" is not
+ defined.
+
+Sat Dec 18 16:02:27 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (setup_args), vm.c (invoke_block_from_c),
+ vm_insnhelper.c (caller_setup_args): fix of r30241. lambda block
+ should check argument number.
+
+Sat Dec 18 14:42:29 2010 Tanaka Akira <akr@fsij.org>
+
+ * load.c: parenthesize macro arguments.
+
+Sat Dec 18 10:07:04 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (setup_args, iseq_compile_each): optimize AMPER LAMBDA
+ combination as block.
+
+Fri Dec 17 22:07:16 2010 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * gc.c (Init_GC): move #__id__ and #object_id to BasicObject.
+ [ruby-dev:42778]
+
+Fri Dec 17 19:35:13 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/mkmf/base.rb (TestMkmf::FakeLog): capture output from mkmf.
+
+ * test/mkmf/test_find_executable.rb (test_find_executable):
+ suppress meaningless differences for chkbuild.
+
+Fri Dec 17 13:26:54 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/setup.mak (BASERUBY): quit with an error when BASERUBY was not
+ able to set, just like configure.in does. [ruby-dev:42782]
+
+Fri Dec 17 07:04:09 2010 Tanaka Akira <akr@fsij.org>
+
+ * iseq.c: parenthesize macro arguments.
+
+Fri Dec 17 04:18:37 2010 Eric Hodel <drbrain@segment7.net>
+
+ * transcode.c (str_encode): Alter comment for better wording and ri
+ output.
+
+Fri Dec 17 00:05:40 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * io.c (rb_io_advise): New API. IO#advise() allows to tell the
+ ruby runtime how it expects to use a file handle. This feature
+ can be improved a performance some situations.
+ Note: This feature is mainly developed by Run Paint Run Run.
+ Thank you! [ruby-core:33110] [Ruby 1.9-Feature#4038]
+
+ * io.c (do_io_advise): Helper function.
+ * io.c (io_advise_sym_to_const): ditto.
+
+Thu Dec 16 23:29:20 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/rbinstall.rb (bin-comm): use transformed name.
+ [ruby-dev:42777]
+
+Thu Dec 16 21:52:07 2010 Tanaka Akira <akr@fsij.org>
+
+ * io.c: parenthesize macro arguments.
+
+Thu Dec 16 21:46:39 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/mkconfig.rb (RbConfig): honor ARCHFLAGS and RC_ARCHS to
+ override embedded ARCH_FLAG value on universal-darwin.
+
+Thu Dec 16 19:50:12 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/{configure.bat,setup.mak,Makefile.sub} (PROGRAM_PREFIX,
+ PROGRAM_SUFFIX): unite the differences of the names of macros of
+ prefix and suffix.
+ reported by HANEDA Norikatsu. [ruby-dev:42775]
+
+Thu Dec 16 08:04:47 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * node.h (RNode): match the type of flags to RBasic, and renamed
+ nd_file as nd_reserved.
+
+ * iseq.c (set_relation), vm_insnhelper.c (vm_cref_push): nd_file
+ is always zero-cleared.
+
+Thu Dec 16 07:22:30 2010 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * lib/minitest/unit.rb: Imported minitest 2.0.1 r6079.
+
+Wed Dec 15 20:45:02 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/test/unit.rb (process_args): need to setup @help to print options.
+
+Wed Dec 15 11:19:33 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/zlib/test_zlib.rb (test_to_io): forgotten to fix with r30201.
+
+Wed Dec 15 11:07:34 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (simple_sendfile): enable on Mac OS X.
+
+ * io.c (nogvl_copy_stream_sendfile): moved precheck of copy length.
+
+ * io.c (nogvl_copy_stream_sendfile): should wait for both of
+ read/write fds.
+
+Wed Dec 15 07:11:55 2010 Tanaka Akira <akr@fsij.org>
+
+ * hash.c: parenthesize macro arguments.
+
+Wed Dec 15 04:02:00 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * ext/openssl/ossl_x509ext.c (ossl_x509extfactory_set_config):
+ fix compile error when !HAVE_X509V3_SET_NCONF. Thanks
+ Chikanaga-san. [ruby-dev:42761] [Ruby 1.9-Bug#4158]
+
+Wed Dec 15 03:41:31 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/ripper/test_parser_events.rb (TestRipper#test_block_variables):
+ Limit address space 100MB instead 100KB. Quite frankly, This
+ margin is too narrow to contain ruby. [ruby-dev:42763] [Bug#4159]
+
+Tue Dec 14 23:53:52 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (simple_sendfile): improve linux compatibility on FreeBSD,
+ and now it works. But without cpuset -l 0, it still gets stuck.
+
+Tue Dec 14 20:31:33 2010 Tanaka Akira <akr@fsij.org>
+
+ * gc.c: parenthesize macro arguments.
+
+Tue Dec 14 18:31:48 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/test/unit.rb: help messages.
+
+Tue Dec 14 18:19:03 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * common.mk (help): there is no reason to use the abbreviation for here.
+
+Tue Dec 14 15:03:46 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_io.rb (test_reopen, test_reinitialize): should close
+ the temporary files.
+
+Tue Dec 14 14:24:15 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_io.rb (make_tempfile): change the prefix from 'foo'
+ to 'test_io' because the old one is meaningless and inconvenient.
+
+ * test/ruby/test_io.rb (test_binmode_after_closed): the temporary file
+ maked by make_temfile is already closed.
+
+Tue Dec 14 13:52:19 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_io.rb (test_flush_in_finalizer[12]): should close
+ temporary file because it's only used for taking pathname and
+ unlinking the file after the end of the test (in GC phase).
+
+Tue Dec 14 13:34:33 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/zlib/zlib.c (gzfile_s_open): should close the IO if some error
+ occurs in initializing.
+
+Tue Dec 14 13:04:16 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http.rb (Net::HTTPRequest#send_request_body_data):
+ set binmode to tempfile.
+
+Tue Dec 14 12:55:46 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/zlib/test_zlib.rb (*): should close files associated with zlib.
+
+Tue Dec 14 11:30:17 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_argf.rb (test_inplace_rename_impossible): unlink
+ the renamed temporary file on no_safe_rename platforms.
+
+ * test/ruby/test_argf.rb (test_readlines_limit_0,
+ test_each_line_limit_0): should close argf because the associated
+ Tempfile object cannot unlink the temporary file when it's gc'ed
+ on some platforms (Windows, etc.)
+
+Tue Dec 14 11:27:07 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/minitest/unit.rb (Minitest::Unit#_run_suite): split test
+ name and its time. Thiw allows to know test's name when you are
+ running tests and meet a test which spends long time at realtime.
+
+Tue Dec 14 11:25:20 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: Add -Werror=declaration-after-statement to default
+ warning flag. If you are using GCC, this flag is useful to
+ prevent breaking VC build.
+
+Tue Dec 14 10:25:57 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/openssl/ossl_asn1.c (ossl_asn1_decode0): how many gcc-c99isms
+ must a man mend; before he can build with VC? r30178
+
+Mon Dec 13 21:26:33 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (simple_sendfile): disable the use of sendfile(2) on
+ FreeBSD. It blocks on TestIO#test_copy_stream_socket.
+
+Mon Dec 13 18:35:33 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c: define USE_SENDFILE on FreeBSD or DragonFly BSD.
+ Remove Mac OS X because its argument is different from them.
+
+Mon Dec 13 12:00:09 2010 Tanaka Akira <akr@fsij.org>
+
+ * file.c: parenthesize macro arguments.
+
+Mon Dec 13 11:21:14 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (simple_sendfile): added for BSD version of sendfile(2).
+
+Mon Dec 13 09:50:09 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http.rb (Net::HTTPRequest#set_form): Added to support
+ both application/x-www-form-urlencoded and multipart/form-data.
+ There is a similar API, Net::HTTPRequest#set_form_data, but
+ to keep its compatibility this is newly added. [ruby-dev:42729]
+
+Sun Dec 12 23:45:27 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (iseq_compile_each): fix for __goto__ and __label__
+ where were totally broken.
+
+Sun Dec 12 22:45:43 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (ID_H_INCLUDES): now id.h depends on vm_opts.h.
+
+Sun Dec 12 20:42:47 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * template/id.h.tmpl: suppress all warning: "SUPPORT_JOKE" is not
+ defined. [ruby-dev:42730]
+
+Sun Dec 12 20:35:07 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * misc/rb_optparse.zsh: update how to install.
+
+ * misc/rb_optparse.zsh: avoid error when setopt noclobber.
+
+ * lib/optparse.rb: fix typo. pointed out at
+ <http://d.hatena.ne.jp/nagachika/20101207>.
+
+Sun Dec 12 13:27:35 2010 Tanaka Akira <akr@fsij.org>
+
+ * eval_error.c: parenthesize macro arguments.
+
+Sun Dec 12 11:53:24 2010 Tanaka Akira <akr@fsij.org>
+
+ * error.c: parenthesize macro arguments.
+
+Sun Dec 12 04:01:58 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_str_inspect): fix: extra back slash is added when
+ the string is dummy encoding and includes \x22 or \x5C.
+
+Sun Dec 12 02:42:24 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/openssl/ossl_asn1.c: indefinite length BER to DER encoding is
+ properly supported. Thanks Martin Bosslet! [ruby-core:33082]
+
+Sat Dec 11 17:43:34 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * ext/bigdecimal/bigdecimal.h: suppress "warning: 'VPrint' declared
+ 'static' but never defined".
+
+Sat Dec 11 09:24:57 2010 Tanaka Akira <akr@fsij.org>
+
+ * encoding.c: parenthesize macro arguments.
+
+Sat Dec 11 08:12:48 2010 Eric Hodel <drbrain@segment7.net>
+
+ * ext/openssl/ossl.c, ext/openssl/ossl_pkey_rsa.c: Document RSA, RSA
+ encryption/decryption and PKCS #5 encryption/decryption.
+
+Sat Dec 11 06:23:41 2010 Eric Hodel <drbrain@segment7.net>
+
+ * ext/openssl/ossl_x509name.c: include Comparable to provide #==.
+ Document OpenSSL::X509::Name#<=>. [Ruby 1.9-Feature#4116]
+
+Sat Dec 11 05:48:28 2010 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tk/lib/multi-tk.rb: infinite loop on method_missing at loading.
+ [ruby-dev:42716] [Ruby 1.9-Bug#4129]
+
+ * ext/tk/lib/multi-tk.rb: when no eventloop is running, ruby freezes at
+ exit.
+
+Sat Dec 11 02:23:15 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/openssl/extconf.rb: try pkgconfig first, then fall back to
+ normal have_library, etc. Thanks Erik Hollensbe. [ruby-core:32406]
+
+Fri Dec 10 22:33:39 2010 Tanaka Akira <akr@fsij.org>
+
+ * dln_find.c: parenthesize macro arguments.
+
+Fri Dec 10 20:05:42 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * template/id.h.tmpl (ruby_method_ids): suppress warnings.
+ [ruby-dev:42730]
+
+Fri Dec 10 18:29:20 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby.c (ruby_init_loadpath_safe): relatively called non-shared
+ binary cannot be found in PATH, so use given pathname.
+
+Fri Dec 10 18:28:40 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * cygwin/GNUmakefile.in (SCRIPTPROGRAMS): ignore backup files and etc.
+
+ * cygwin/GNUmakefile.in (scriptbin): set executable bit.
+
+ * tool/rbinstall.rb (install_recursive): always skip default ignored
+ files. if block is given, call it instead of calling install.
+
+ * tool/rbinstall.rb (bin-comm): use install_recursive.
+
+Fri Dec 10 18:12:31 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/mkmf/base.rb (TestMkmf#config_value): extract macro value from
+ config.h.
+
+ * test/mkmf/test_sizeof.rb (TestMkmf::TestSizeof#test_sizeof_builtin),
+ (TestMkmf::TestSizeof#test_sizeof_struct): more tests.
+
+ * lib/mkmf.rb (check_signedness): should use the prelude code.
+ [ruby-dev:42731]
+
+ * lib/mkmf.rb (Logging.log_close): separate from Logging.logfile.
+
+ * test/mkmf/base.rb (TestMkmf::MKMFLOG): show mkmf.log at failures.
+
+ * test/mkmf/base.rb (TestMkmf#teardown): close log file for each tests.
+
+Fri Dec 10 11:36:43 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * compile.c (enum): remove a comma at end of enumerator list.
+
+ * constant.h (rb_const_flag_t): ditto.
+
+ * iseq.h (enum catch_type): ditto.
+
+ * iseq.h (enum defined_type): ditto.
+
+ * vm_core.h (enum iseq_type): ditto.
+
+ * vm_core.h (enum vm_special_object_type): ditto.
+
+Fri Dec 10 10:47:53 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * sprintf.c (_HAVE_SANE_QUAD_): Don't forget LP64, r30156.
+
+Fri Dec 10 10:37:17 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * sprintf.c (_HAVE_SANE_QUAD_): if a certain platform has LONG_LONG in
+ 8 byte, it might be sane quad. [ruby-core:33634]
+
+Fri Dec 10 10:07:59 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http.rb: remove version 1.1 features.
+
+Fri Dec 10 02:18:02 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/openssl/ossl_x509store.c (ossl_x509stctx_cleanup): removing C
+ implementation of `cleanup`.
+
+ * ext/openssl/lib/openssl/x509.rb: adding ruby implementation of
+ `cleanup`. OpenSSL::X509::StoreContext#cleanup is deprecated since
+ reusing the underlying struct doesn't make sense. [ruby-dev:42546]
+
+Thu Dec 9 20:14:39 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (lvar_defined_gen, shadowing_lvar_gen, dvar_defined): no
+ warnings for unused method and block arguments.
+ [ruby-dev:42718] [ruby-dev:42724]
+
+Thu Dec 9 19:25:49 2010 Tanaka Akira <akr@fsij.org>
+
+ * dln.c: parenthesize macro arguments.
+
+Thu Dec 9 18:51:06 2010 Tanaka Akira <akr@fsij.org>
+
+ * lib/webrick/accesslog.rb (WEBrick::AccessLog#format): support
+ %{remote}p for logging remote (client) port number.
+ [ruby-dev:42670]
+
+Thu Dec 9 11:00:30 2010 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * array.c (rb_ary_dup): should copy contents only. no instance
+ variable, no class would be copied. it would affect methods
+ #sort, #reject, #transpose, #uniq, #compact, and #shuffle.
+ [ruby-core:33640]
+
+ * array.c (rb_ary_reverse_m): ditto.
+
+ * array.c (rb_ary_rotate_m): ditto.
+
+Wed Dec 8 21:38:40 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/dl/lib/dl/struct.rb: clean a warning: assigned but unused
+ variable. patched by Kouhei Yanagita. [ruby-dev:42722]
+
+ * ext/dl/lib/dl/import.rb: ditto.
+
+Wed Dec 8 21:36:16 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (shadowing_lvar_gen): fix line number. [ruby-dev:42718]
+
+Wed Dec 8 20:37:11 2010 Tanaka Akira <akr@fsij.org>
+
+ * dir.c: parenthesize macro arguments.
+
+Tue Dec 7 22:37:15 2010 Masaya Tarui <tarui@ruby-lnag.org>
+
+ * io.c (io_read): duplicate string if shared. [ruby-dev:42719]
+
+Tue Dec 7 22:31:08 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/optparse.rb (OptionParser::Officious): separate completion
+ options from --help. [ruby-dev:42690]
+
+ * lib/optparse.rb (OptionParser::Completion#candidate),
+ (OptionParser::Switch#compsys): remove unused variables.
+
+Tue Dec 7 22:05:25 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * transcode.c (transcode_loop): call default handler of the given
+ hash, method, proc or [] method as fallback. [ruby-dev:42692]
+
+Tue Dec 7 21:59:37 2010 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/light/node.rb: remove circular require.
+
+Tue Dec 7 21:56:01 2010 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_light.rb: really suppress a warning.
+
+Tue Dec 7 21:51:57 2010 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_light.rb: suppress a warning.
+
+Tue Dec 7 21:14:03 2010 Tanaka Akira <akr@fsij.org>
+
+ * debug.c: parenthesize macro arguments.
+
+Tue Dec 7 21:06:38 2010 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/doctype.rb, test/rexml/test_doctype.rb: suppress warnings.
+ [ruby-core:33305]
+ Reported by Aaron Patterson. Thanks!!!
+
+Tue Dec 7 18:56:52 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/nkf/lib/kconv.rb (String#kconv): fix typo and update rdoc.
+ patched by Kouhei Yanagita [ruby-dev:42696]
+
+Tue Dec 7 20:32:11 2010 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_doctype.rb: add Accessor to test case name.
+
+Tue Dec 7 20:31:02 2010 Kouhei Sutou <kou@clear-code.com>
+
+ * test/rexml/test_doctype.rb: Doctype -> DocType.
+
+Tue Dec 7 20:29:23 2010 Kouhei Sutou <kou@clear-code.com>
+
+ * test/rexml/test_doctype_mixin.rb: rename to ...
+ * test/rexml/test_doctype.rb: ... this to remove needless name.
+
+Tue Dec 7 17:03:16 2010 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/imap.rb (xlist): supported the XLIST command, which is an
+ extension by Apple and Google. patch by Geoff Youngs.
+ [ruby-core:33521]
+
+Tue Dec 7 08:00:44 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in, win32/Makefile.sub (WERRORFLAG): flag to treat
+ warnings as errors.
+
+ * lib/mkmf.rb (Logging.postpone): yield log file object.
+
+ * lib/mkmf.rb (xsystem): add options, :werror only right now.
+
+ * lib/mkmf.rb (with_werror): check as if warnings are errors.
+
+ * lib/mkmf.rb (convertible_int): make declaration conflict
+ warnings errors not to pass wrong type. [ruby-dev:42684]
+
+ * lib/mkmf.rb (COMMON_MACROS): get rid of conflicts.
+
+ * win32/Makefile.sub (WARNFLAGS): make declaration conflict
+ warnings errors if possible.
+
+Sun Dec 7 21:16:10 2010 Tanaka Akira <akr@fsij.org>
+
+ * cont.c: parenthesize macro arguments.
+
+Tue Dec 7 00:27:14 2010 Masaya Tarui <tarui@ruby-lnag.org>
+
+ * win32/win32.c (rb_w32_read): fixed more for readline,
+ and so on. [ruby-core:33511]
+
+Mon Dec 6 23:18:22 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/mkmf/base.rb (TestMkmf#setup): run quietly.
+
+ * test/mkmf/test_find_executable.rb (test_find_executable): use
+ configured results.
+
+ * common.mk (test-build): test for build process.
+
+Mon Dec 6 22:47:15 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/optparse.rb (OptionParser#candidate): skip separators.
+
+ * sample/optparse/opttest.rb: should not override --help.
+ [ruby-dev:42690]
+
+Mon Dec 6 19:00:48 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * misc/rb_optparse.zsh: fix typos.
+
+Mon Dec 6 18:59:04 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * NEWS: add new encodings.
+
+Mon Dec 6 18:56:42 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * test/ruby/test_string.rb (TestString#test_scan): add a test for
+ [ruby-core:33338] #4087.
+
+Mon Dec 6 18:55:36 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * test/uri/test_common.rb (TestCommon#test_encode_www_form): add
+ tests for r30015.
+
+Mon Dec 6 10:39:54 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/common.rb (URI::Parser#initialize_pattern):
+ refix for restrict the pattern.
+
+Mon Dec 6 09:45:11 2010 Eric Hodel <drbrain@segment7.net>
+
+ * ext/openssl (OpenSSL): add toplevel documentation
+ * ext/openssl/ossl_ssl.c (SSLContext, SSLSocket: add additional
+ documentation
+ * ext/openssl: move "let rdoc know about mOSSL" comments so they don't
+ show up in output
+
+Mon Dec 6 09:16:46 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/common.rb (URI::Parser#initialize_pattern):
+ workaround fix pattern of hostname for RFC 3986. [ruby-dev:42672]
+
+Mon Dec 6 09:14:38 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/mkmf.rb (check_signedness): rename unused variable prelude.
+
+Sun Dec 5 17:56:36 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (make_metaclass): fix probable typo. builtin type flag
+ cannot be used with FL_TEST.
+
+Sun Dec 5 12:09:27 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/irb/init.rb (IRB.parse_opts): fix typo. [ruby-core:33574]
+
+Sun Dec 5 11:27:08 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby.c (load_file_internal): decrement for ungotten line.
+ [ruby-dev:42680]
+
+Sun Dec 5 10:32:11 2010 Tanaka Akira <akr@fsij.org>
+
+ * complex.c: parenthesize macro arguments.
+
+Sat Dec 4 11:39:17 2010 Eric Hodel <drbrain@segment7.net>
+
+ * ext/openssl/ossl_x509ext.c (initialize): add documentation.
+
+Sat Dec 4 11:21:50 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (rb_hash_update_by): new API for Hash#update.
+
+Sat Dec 4 11:18:10 2010 Tanaka Akira <akr@fsij.org>
+
+ * class.c: parenthesize macro arguments.
+
+Sat Dec 4 11:07:57 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_core.h (rb_vm_inc_const_missing_count): missing prototype.
+
+Sat Dec 4 08:50:10 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/iconv/iconv.c (Init_iconv): no warnings if $VERBOSE is nil.
+
+Sat Dec 4 08:25:15 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_call_method): revert r30064 and r30071,
+ because of [ruby-core:26761]. Bug#4106 rejected.
+
+Sat Dec 4 07:46:48 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (String#tr_cpp): substitute * with P like as
+ autoconf.
+
+Fri Dec 3 22:36:45 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_call_method): protected methods should be
+ checked against the real class.
+
+Fri Dec 3 20:23:31 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (convertible_int): define printf format prefix too.
+
+ * lib/mkmf.rb (convertible_int): detect convertible integer type.
+ port RUBY_REPLACE_INT from configure.in.
+
+ * lib/mkmf.rb (check_sizeof): should return integer always.
+
+Fri Dec 3 12:54:48 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/Makefile.sub (RCFLAGS): VC10 and after only. fixed the problem
+ of r30015. [ruby-core:33530]
+
+Fri Dec 3 12:41:52 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * gc.c (rb_objspace_free): With our "lazy-sweep" GC engine, it is
+ possible for an object to survive until its surrounding object
+ space is about to be freed. Those objects, if any, remains
+ leaked for the rest of a process life. This is problematic
+ because for instance a T_DATA object may have its own destructor
+ to terminate something.
+
+ * vm.c (ruby_vm_destruct): ruby_current_vm termination should be
+ somewhere after rb_objspace_free for above reason.
+
+Fri Dec 3 12:17:19 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_call_method): protected singleton methods should
+ be visible from same real class methods. [ruby-core:33506]
+
+Fri Dec 3 07:08:42 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/stringio/stringio.c (strio_getline): round upto next char
+ boundary. [ruby-dev:42674]
+
+Fri Dec 3 06:52:46 2010 Tanaka Akira <akr@fsij.org>
+
+ * compile.c: parenthesize macro arguments.
+
+Fri Dec 3 04:08:59 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * encoding.c (enc_alias_internal): use st_insert2 and change return
+ value to int.
+
+ * encoding.c (enc_alias): follow enc_alias_internal.
+
+Fri Dec 3 01:52:43 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * encoding.c (enc_alias_internal): use xfree instead of free.
+
+Thu Dec 2 23:52:26 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * NEWS: entry for ruby_vm_at_exit().
+
+ * eval.c (ruby_cleanup): bug fix around at_exit (1) timing was
+ wrong. (2) execution order was opposite.
+
+Thu Dec 2 23:05:14 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/Makefile.sub (RCFLAGS): -nologo switch is only available in
+ newer versions of rc.exe. fixed the problem of r30012.
+
+Thu Dec 2 21:28:07 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/json/lib/json/add/rails.rb: removed.
+
+Thu Dec 2 21:22:05 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * encoding.c (enc_alias_internal): free the copied key and
+ return NULL when given key is already registered.
+
+ * encoding.c (enc_alias): call set_encoding_const only when the
+ alias is not registered yet.
+
+Thu Dec 2 19:58:24 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * vm.c (ruby_vm_at_exit): new API. This enables extension libs to
+ hook a VM termination. Right now, because the VM we have is
+ process global, most extensions do not deallocate resources and
+ leave them to Operating System's reaping userland processes. But
+ in a future we plan to have multiple VMs to run simultaneously in
+ a single process (MVM project). At that stage we can no longer
+ rely on OSes and have to manage every resources to be reclaimed
+ properly. So it is. For a forward-compatibility reason this API
+ is introduced now, encouraging you to be as gentle as you can for
+ your resources; that is, tidy up your room.
+
+ * include/ruby/vm.h: ditto.
+
+ * vm_core.h (rb_vm_struct): new field.
+
+ * vm.c (vm_init2): initialize above new field.
+
+ * eval.c (ruby_cleanup): trigger those hooks.
+
+Thu Dec 2 17:00:44 2010 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c: parenthesize macro arguments.
+
+Thu Dec 2 15:31:14 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_read): more fix. [ruby-core:33513]
+
+Thu Dec 2 13:41:43 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_read): workaround for console reading troubles.
+ fixed [ruby-core:33511]
+
+Thu Dec 2 13:10:42 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/common.rb (URI.encode_www_form):
+ split key-value when the value is Array like object.
+
+Thu Dec 2 10:39:39 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http.rb (Net::HTTP#set_form_data):
+ use URI.encode_www_form for application/x-www-form-urlencoded.
+
+Thu Dec 2 10:38:40 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/extmk.rb: remove $makeflags.defined?, it should be $mflags.
+
+Thu Dec 2 10:19:47 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/Makefile.sub (rc): suppress meaningless message.
+
+Thu Dec 2 10:09:40 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/json/generator/extconf.rb: remove the lines which set -O3
+ when -O option is not set.
+ Note that -O3 doesn't always exist.
+
+ * ext/json/parser/extconf.rb: ditto.
+
+Thu Dec 2 10:01:59 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/extmk.rb: define $makeflags.defined? like $mflags.
+
+Thu Dec 2 07:20:20 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::GCStressOption): --gc-stress
+ option.
+
+ * lib/test/unit.rb (Test::Unit::Mini#_run_suites): show the result
+ even when interrupted on the way.
+
+Thu Dec 2 07:08:38 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/io/console/console.c (setattr): should retry on EINTR.
+ [ruby-dev:42666]
+
+Thu Dec 2 02:30:50 2010 Eric Hodel <drbrain@segment7.net>
+
+ * lib/net/http.rb: fixed positional wording to match revised order.
+
+Thu Dec 2 01:24:39 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/json/lib/json/common.rb: don't use iconv on 1.9.
+ patched by Shota Fukumori [ruby-core:33164]
+
+Thu Dec 2 01:02:03 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/json: Update github/flori/json from 1.4.2+ to
+ e22b2f2bdfe6a9b0. this fixes some bugs.
+
+Thu Dec 2 00:05:44 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http.rb: improve rdoc.
+ This change the order of chapter because such overview should
+ begin with simple examples.
+ patched by Eric Hodel [ruby-core:33469]
+
+Wed Dec 1 22:01:49 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * numeric.c (Init_Numeric): fixed a potential bug when using bccwin32
+ ruby with Microsoft's dll, though we already gave up of supporting
+ bccwin32. [ruby-core:33503]
+
+Wed Dec 1 21:43:21 2010 Tanaka Akira <akr@fsij.org>
+
+ * array.c: parenthesize macro arguments.
+
+Wed Dec 1 21:41:57 2010 Tanaka Akira <akr@fsij.org>
+
+ * test/socket/test_addrinfo.rb: extract Errno::EADDRINUSE as a method.
+
+ * test/socket/test_socket.rb: ditto.
+
+Wed Dec 1 15:08:32 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/openssl/test_ssl.rb (test_not_started_session): non socket
+ argument of SSLSocket.new is not supported on Windows.
+
+Wed Dec 1 14:36:36 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_memhash): zero-filled strings should return
+ different values. [ruby-core:33500]
+
+Wed Dec 1 14:27:49 2010 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * lib/minitest/*.rb: Imported minitest 2.0.0 r5952.
+ * test/minitest/*.rb: ditto.
+ * lib/test/unit.rb: Compatibility fix for minitest changes.
+
+Wed Dec 1 10:16:41 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_str_inspect): fix typo (not 0xFD but 0xFE).
+
+Wed Dec 1 09:28:27 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c: Follow .gnu_debuglink section.
+ A user of distribution provided ruby will see line
+ info if s/he has a debug package for ruby.
+ patched by Shinichiro Hamaji [ruby-dev:42655]
+
+Wed Dec 1 01:29:15 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_str_inspect): inspect as a dummy encoding string
+ when a UTF-16/32 (not BE/LE) string does not have a BOM.
+ Unicode and some RFCs say that a string labeled as UTF-16/32
+ doesn't have a BOM, it should be considered big endian.
+ But many Windows programs generates little endian UTF-16
+ strings without a BOM. So String#inspect treats a string
+ labeled UTF-16/32 without a BOM as a dummy encoding string.
+ patched by Martin Duerst. [ruby-core:33461]
+
+Tue Nov 30 17:04:10 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c (parse_debug_line_cu): ignore DW_LNE_set_discriminator.
+ To ignore, it needs to read a single unsigned LEB128 integer.
+
+Tue Nov 30 16:29:19 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * vm_dump.c: undef HAVE_BACKTRACE when the OS is FreeBSD (in other
+ words backtrace() is libexecinfo) and it is optimized.
+ This temporary hack may be also applied to other libexecinfo
+ environments.
+
+Tue Nov 30 16:23:23 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http.rb: improve rdoc.
+ patched by Eric Hodel ref #4100
+
+Tue Nov 30 12:23:52 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_read): read only 1 byte at once on console.
+ workaround of Windows bug. see [ruby-core:33460].
+ this is not the final solution.
+
+Tue Nov 30 11:39:13 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http.rb: improve rdoc.
+ patched by mathew murphy [ruby-core:33472] ref #4100
+
+Tue Nov 30 05:03:44 2010 Eric Hodel <drbrain@segment7.net>
+
+ * lib/uri/common.rb (encode_www_form, encode_www_form_component):
+ Improve English in documentation.
+
+ * ext/openssl/ossl_ssl.c (ssl_version=, ciphers=): Document
+ #ssl_version=, add documentation for #ciphers=.
+
+Mon Nov 29 22:55:24 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/uri/common.rb (URI::WFKV_): get rid of backtrack explosion
+ by nested repeat operators. [ruby-core:33464]
+
+Mon Nov 29 22:53:13 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/Makefile.sub (scriptbin.mk): fix generated rules.
+
+ * win32/win32.c (rb_w32_write_console): fix argument type.
+
+Mon Nov 29 21:12:51 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * misc/ruby-mode.el (ruby-forward-sexp): stop after literal hash
+ key labels.
+
+ * misc/ruby-mode.el (ruby-font-lock-keywords): highlight literal
+ hash key labels as symbols.
+
+Mon Nov 29 18:31:31 2010 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * test/ruby/test_transcode.rb (test_unicode_public_review_issue_121):
+ - Removed commented-out options that are no longer under discussion.
+ - Added two more tests for forthcomming clarifications.
+
+Mon Nov 29 14:31:17 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_isatty): use GetConsoleMode() to determine the
+ fd is console or not, just like rb_w32_write_console(). [experimental]
+
+Mon Nov 29 14:19:40 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * include/ruby/win32.h (rb_w32_write_console): wrong prototype.
+
+Mon Nov 29 14:10:55 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_write_console): fixed indentation.
+
+Sun Nov 28 22:13:39 2010 Koichi Sasada <ko1@atdot.net>
+
+ * thread_pthread.c (NATIVE_MUTEX_LOCK_DEBUG): move and use it.
+
+ * ChangeLog: fix my timezone.
+
+Mon Nov 28 21:58:58 2010 Koichi Sasada <ko1@atdot.net>
+
+ * thread_pthread.c: remove pthread_atfork().
+
+Mon Nov 28 21:54:22 2010 Koichi Sasada <ko1@atdot.net>
+
+ * thread_pthread.c (native_cond_*): Check return code.
+ (Some OSes except Linux return error code).
+
+Sun Nov 28 21:46:21 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread_pthread.c (thread_start_func_1): initialize native thread
+ data immediately before starting.
+
+Sun Nov 28 14:56:32 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (struct argf): make lineno long, and reorder members.
+
+Sun Nov 28 14:55:42 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread_win32.c (gvl_release, gvl_init): suppress warnings.
+
+Sun Nov 28 14:48:24 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread_pthread.c (gvl_release, gvl_init): suppress warnings.
+
+ * vm_core.h (rb_vm_gvl_destroy): add prototype.
+
+Sun Nov 28 14:46:24 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread_pthread.c (gvl_reinit): register atfork handler only in
+ the parent process, to get rid of dead lock.
+
+Sun Nov 28 12:23:57 2010 Koichi Sasada <ko1@atdot.net>
+
+ * thread.c, vm_core.h: make gvl_acquire/release/init/destruct
+ APIs to modularize GVL implementation.
+
+ * thread_pthread.c, thread_pthread.h: Two GVL implementations.
+ (1) Simple locking GVL which is same as existing GVL.
+ (2) Wake-up queued threads. The wake-up order is simple FIFO.
+ (We can make several queues to support exact priorities, however
+ this causes some issues such as priority inversion and so on.)
+ This impl. prevents spin-loop (*1) caused on SMP environments.
+ *1: Only one Ruby thread acquires GVL again and again.
+ Bug #2359 [ruby-core:26694]
+
+ * thread_win32.c, thread_win32.h: Using simple lock
+ not by CRITICAL_SECTION but by Mutex.
+ Bug #3890 [ruby-dev:42315]
+
+ * vm.c (ruby_vm_destruct): ditto.
+
+Sun Nov 28 04:40:00 2010 Luis Lavena <luislavena@gmail.com>
+
+ * io.c (io_fwrite): use rb_w32_write_console under Windows.
+
+ * win32/win32.c (rb_w32_write_console): added to write to write
+ Unicode using WriteConsoleW for stdout/stderr. [ruby-core:33166]
+
+Sun Nov 28 03:58:47 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http.rb: improve rdoc.
+ patched by Mike Perham [ruby-core:33433]
+
+Sat Nov 27 19:12:10 2010 Tanaka Akira <akr@fsij.org>
+
+ * time.c: parenthesize macro arguments.
+
+Sat Nov 27 18:08:18 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * time.c (leap_year_v_p): fixed typo. [ruby-dev:42631]
+
+Sat Nov 27 17:57:08 2010 Tanaka Akira <akr@fsij.org>
+
+ * resolv.rb (Resolv::DNS): use the same DNS server when retry using
+ TCP. reported by Julian Mehnle. [ruby-core:32970]
+
+Sat Nov 27 15:45:27 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_dump.c (rb_vm_bugreport): see CrashReport log on Mac OS X.
+
+ * configure.in: link addr2line only for ELF.
+
+Sat Nov 27 13:58:55 2010 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/optparse.rb (OptionParser#candidate): : was missing. Thanks,
+ Shota Fukumori. [ruby-dev:42634]
+
+Sat Nov 27 12:07:05 2010 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * man/ruby.1: Ruby man page from Arthur Gunn in [ruby-core:33412]
+
+Sat Nov 27 11:29:24 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/optparse.rb (OptionParser#candidate): get rid of 1.9 syntax
+ so that BASERUBY can be 1.8.
+
+Sat Nov 27 08:16:21 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * addr2line.c (rb_dump_backtrace_with_lines): should close fd on
+ edge case.
+
+Fri Nov 26 13:33:24 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c: apply a patch from shinichiro.h.
+
+Fri Nov 26 12:21:20 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * addr2line.c: added to show source filename and line number of
+ functions in backtrace. [ruby-dev:42625]
+ a patch from shinichiro.h <shinichiro.hamaji AT gmail.com>
+
+ * addr2line.h: ditto.
+
+ * common.mk: add addr2line.$(OBJEXT).
+
+ * configure.in: check dl_iterate_phdr.
+
+ * vm_dump.c (rb_vm_bugreport): use rb_dump_backtrace_with_lines in
+ addr2line.c when the binary is ELF.
+
+Fri Nov 26 12:12:50 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * regcomp.c (setup_tree): restart setup_tree() for a node whose
+ AnchorNode's type is ANCHOR_PREC_BEHIND or ANCHOR_PREC_BEHIND_NOT
+ and divide_look_behind_alternatives() divided it to NT_ALT or
+ NT_LIST. [ruby-core:33370]
+
+Fri Nov 26 11:40:11 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * vm_dump.c (dump_thread): get only required rights of the target
+ thread because THREAD_ALL_ACCESS causes an access error on XP.
+ reported by Masaya TARUI via IRC.
+
+Fri Nov 26 11:09:07 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * vm_dump.c (dump_thread): show the displacement from the beginning
+ of the symbol.
+
+Fri Nov 26 10:48:23 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * vm_dump.c (dump_thread): follow the output of glibc.
+ see [ruby-dev:42627]
+
+Fri Nov 26 09:48:45 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * re.c (rb_reg_initialize_str): should succeed the taint status from
+ the origin. [ruby-core:33338]
+
+Fri Nov 26 09:32:37 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * vm_dump.c (dump_thread): seems to be necessary the 3rd argument of
+ SymGetLineFromAddr64(), even though MSDN says it can be zero.
+
+Fri Nov 26 09:03:38 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * regcomp.c (onig_is_prelude): added to check whether ruby is still
+ in prelude (or other boot processes) or not.
+
+ * regcomp.c (optimize_node_left): use onig_is_prelude for printing.
+
+ * regcomp.c (set_optimize_info_from_tree): ditto.
+
+ * regcomp.c (onig_compile): ditto.
+
+ * regcomp.c (print_compiled_byte_code_list): print its address.
+
+ * regcomp.c (print_indent_tree): print its contents tree of
+ ANCHOR_PREC_READ(_NOT) and ANCHOR_PREC_BEHIND(_NOT).
+
+Thu Nov 25 23:10:49 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * regcomp.c (print_distance_range): use PRIuSIZE.
+
+ * regcomp.c (print_optimize_info): use %ld because the type of
+ calculated value of integers is long.
+
+ * regexec.c (onig_print_compiled_byte_code): add prototype.
+
+ * regexec.c (match_at): add 2nd argument.
+
+Thu Nov 25 10:29:55 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/dl/callback/mkcallback.rb (gencallback): shouldn't assume that
+ VALUE is the same size with long.
+
+Thu Nov 25 10:03:14 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/win32ole/test_err_in_callback.rb (teardown): remove tmp file
+ only when it exists.
+
+Thu Nov 25 01:38:25 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * enc/trans/big5-hkscs-tbl.rb: Update table as HKSCS-2008.
+ patched by oCameLo oTnTh [ruby-core:33256]
+
+ * enc/big5.c: add alias Big5-HKSCS:2008 to Big5-HKSCS.
+
+Wed Nov 24 15:18:07 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * vsnprintf (BSD_vfprintf): use QUADINT macro only when _HAVE_SANE_QUAD_
+ macro is defined.
+
+Wed Nov 24 12:47:16 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * vsnprintf (BSD_vfprintf): added VC++ compatible size specifications
+ (I, I32, I64).
+
+Wed Nov 24 11:19:13 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_str_inspect): treat UTF-16 and UTF-32 as BE or LE.
+
+Wed Nov 24 06:35:32 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * enc/trans/utf_16_32.trans: add the UTF-32 converter.
+
+Wed Nov 24 05:40:33 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+Wed Nov 24 06:13:32 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (filecp, wstr_to_mbstr, mbstr_to_wstr):
+ refactored.
+
+Wed Nov 24 05:40:33 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * enc/trans/utf_16_32.trans: add a converter from UTF-8 to UTF-16.
+
+Wed Nov 24 03:21:35 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * enc/trans/utf_16_32.trans: raise error on unpaired upper
+ surrogates.
+
+Wed Nov 24 01:40:23 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * enc/utf_16_32.h: add UTF-16 and UTF-32 as a dummy encoding.
+
+ * enc/trans/utf_16_32.trans: add a converter from UTF-16 to UTF-8.
+
+Tue Nov 23 21:59:47 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (wlink, rb_w32_getppid): use typedef instead of
+ repeating complicated function prototypes.
+
+Tue Nov 23 18:54:03 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm.c (rb_thread_mark): should mark self in control
+ frames. [ruby-core:33289]
+
+Tue Nov 23 07:57:31 2010 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * lib/date/delta/parser.{ry,rb}: fixed a bug of token scanner.
+
+Tue Nov 23 07:29:24 2010 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * complex.c, rational.c ({nucomp,nurat}_expt): added a check.
+
+Tue Nov 23 07:27:27 2010 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * lib/date.rb (daynum): should be private.
+
+Tue Nov 23 07:22:54 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ChangeLog (change-log-indent-text): hanging indent.
+
+Tue Nov 23 06:30:51 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (SITE_DIR, VENDOR_DIR),
+ version.c (ruby_initial_load_paths): exclude directories that
+ are configured without them from $LOAD_PATH. [ruby-core:33267]
+
+ * configure.in (rubylibprefix): No ruby, No libprefix.
+
+Tue Nov 23 01:05:27 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * vsnprintf.c (BSD_vfprintf): don't output floating point
+ when the precision is 0. [ruby-dev:42615]
+
+Mon Nov 22 21:30:57 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_inspect): fix for ascii-compatible external
+ encoding and different encoding string. [ruby-core:33283]
+
+Mon Nov 22 18:45:44 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (create_makefile): should not duplicate rules.
+ bug fix of r29842.
+
+Mon Nov 22 18:04:40 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * enc/big5.c: split CP950 from Big5.
+
+ * enc/big5.c: split CP951 from Big5-HKSCS.
+
+ * enc/trans/big5.trans: import conversion table of Big5, Big5-HKSCS,
+ CP950, and CP951 from ICU. they need fallback conversions.
+ ref [ruby-core:33256]
+ http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/
+
+ * tool/transcode-tblgen.rb (import_ucm): add to import ucm files.
+
+Mon Nov 22 18:33:30 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_inspect): append for each chars instead of bulk
+ copy if encoding conversion is needed. [ruby-core:33283]
+
+Mon Nov 22 14:22:45 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * time.c (time_zone): use rb_locale_str_new_cstr to set encoding
+ as locale and convert its content to internal encoding.
+ [ruby-core:33278]
+
+Mon Nov 22 11:58:11 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_str_concat): set ENC_CODERANGE_VALID when the
+ receiver is 7BIT and the argument is non ASCII.
+
+Mon Nov 22 01:48:58 2010 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * lib/date.rb: some improvements for performance.
+
+Sat Nov 20 07:45:50 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * lib/mkmf.rb: adding compilation support for ObjC/ObjC++ extensions.
+ Thanks Scott Gonyea! [ruby-core:33260]
+
+Sat Nov 20 01:57:55 2010 Akio Tajima <artonx@yahoo.co.jp>
+
+ * common.mk: add dependency(insns.inc) to compile.obj
+
+Fri Nov 19 23:05:48 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/Makefile.sub (insns_rules.mk): remove extra backslash.
+
+ * cygwin/GNUmakefile.in, win32/Makefile.sub (clean): rc files are
+ made at compile time, so should be removed by clean.
+
+Fri Nov 19 22:09:46 2010 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_core.rb
+ (Tester#test_pretty_format_long_text_finite): skip a test that
+ uses long string on small memory system. [ruby-dev:42599]
+
+Fri Nov 19 21:07:06 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/optparse.rb: shell completion support for zsh. based on
+ <http://d.hatena.ne.jp/rubikitch/20071002/zshcomplete>
+
+ * lib/optparse.rb: shell completion support for bash.
+
+Fri Nov 19 00:00:00 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * cygwin/GNUmakefile.in (SCRIPTPROGRAMS): no needs on cygwin.
+
+ * win32/Makefile.sub (scriptbin): create script binaries.
+
+Thu Nov 18 23:21:23 2010 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/formatters/pretty.rb (REXML::Formatters::Pretty#wrap):
+ REXML::Formatters::Pretty#wrap used a recursive method call to
+ format text. This switches it to use an iterative approach.
+ [ruby-core:33245]
+ Patch by Jeremy Evans. Thanks!!!
+
+ * test/rexml/test_core.rb: add a test for it.
+
+Thu Nov 18 22:58:43 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/io.h (rb_io_buffer_t): extract from rb_io_t.
+
+Thu Nov 18 07:37:44 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * Makefile.in (reconfig): force reconfigure with previous options.
+
+ * common.mk (showconfig): show configure flags, like as
+ `config.status --config' generated by recent autoconf.
+
+Thu Nov 18 07:16:49 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * missing/langinfo.c (strncasecmp): get rid of redefinition.
+
+Thu Nov 18 00:02:17 2010 James Edward Gray II <jeg2@ruby-lang.org>
+
+ * lib/csv.rb: Upgrading output encoding with ASCII content
+ as needed. [ruby-core:33229]
+
+Wed Nov 17 23:19:21 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/configure.bat: remove quotes from arguments to be quoted.
+
+ * lib/mkmf.rb (create_makefile): use forward slashes in messages.
+
+ * lib/mkmf.rb (create_makefile): make extension libraries messages
+ brief.
+
+ * win32/Makefile.sub (MAKEDIRS): should not include silent flag.
+
+ * common.mk (ext/ripper/ripper.c, ext/json/parser/parser.c): pass
+ Q and ECHO. [ruby-core:33226]
+
+Wed Nov 17 16:09:52 2010 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * test/test_tracer.rb: new test case.
+ minimal regression test for r29280.
+
+Wed Nov 17 16:04:23 2010 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * test/ruby/envutil.rb (Test::Unit::Assersions#assert_warn):
+ new assertion to assert that a particular warning message is
+ displayed.
+ forward port from branches/ruby_1_9_2@29795.
+
+Wed Nov 17 15:16:48 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * regint.h (OnigOpInfoType): constify name.
+
+ * regcomp.c (op2name): constify return value.
+
+ * regcomp.c (onig_print_compiled_byte_code): use PRIuPTR and
+ uintptr_t to clean warnings.
+
+ * regcomp.c (print_indent_tree): use PRIxPTR and intptr_t.
+
+ * regexec.c (match_at): use PRIdPTR and intptr_t.
+
+Wed Nov 17 09:49:10 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * enc/shift_jis.c (property_name_to_ctype): fix memory leak.
+
+ * enc/euc_jp.c (property_name_to_ctype): ditto.
+
+Wed Nov 17 08:54:04 2010 James Edward Gray II <jeg2@ruby-lang.org>
+
+ * lib/csv.rb: Upgrading output encoding as needed. [ruby-core:33135]
+
+Tue Nov 16 22:30:39 2010 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * vm_insnhelper.c (vm_throw): remove fear of undefined behavior :-)
+ Coverity Scan found this bug.
+
+Tue Nov 16 09:33:00 2010 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/lib/bigdecimal/util.rb (to_digits): avoid unused
+ variables warning, reported by Aaron Patterson.
+
+Tue Nov 16 06:39:31 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * pack.c (PACK_ITEM_ADJUST): return nil not result array and yield
+ values if block is given. [ruby-core:33193]
+
+Tue Nov 16 00:21:20 2010 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * regparse.c (and_cclass, or_cclass): fix memory leak. Coverity Scan
+ found this bug. [ruby-dev:42579]
+
+Tue Nov 16 00:07:32 2010 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * gc.c (assign_heap_slot): fix fear of memory leak and memory
+ violation. Coverity Scan found this bug.
+
+Mon Nov 15 23:54:45 2010 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * eval_intern.h (CHECK_STACK_OVERFLOW): it was not intended to add
+ size_t to a pointer typed VALUE*. Coverity Scan found this defect.
+
+Mon Nov 15 23:41:21 2010 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * compile.c (iseq_set_exception_local_table, iseq_set_local_table,
+ rb_iseq_build_from_ary): fix type inconsistency (which is benign
+ because sizeof(ID) == sizeof(ID*), though). Coverity Scan found
+ these bugs.
+
+Mon Nov 15 22:47:27 2010 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * vm_eval.c (rb_funcall): ensure va_end after va_init_list. Coverity
+ Scan found this bug.
+
+Mon Nov 15 08:36:12 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * lib/racc/parser.rb (do_parse, yyparse): using class eval to define
+ method and avoid __send__.
+
+Mon Nov 15 06:43:48 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * etc/openssl/ossl_ssl.c (ossl_ssl_get_cert): raise exception if
+ pointer is invalid. Thanks Ippei Obayashi! [ruby-dev:42573]
+
+Sun Nov 14 17:57:45 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enc/Makefile.in (distclean): should not remove sources which are
+ distributed in tarball.
+
+Sun Nov 14 16:48:56 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_set_token_info): turn on/off with directives.
+ [ruby-core:25442]
+
+Sun Nov 14 12:05:24 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (argf_readlines): forward to current_file for arguments
+ check. http://twitter.com/nagachika/status/3634254856589312
+
+Sun Nov 14 08:48:06 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/setup.mak (-basic-vars-, -runtime-): suppress trailing
+ space and compiler command line.
+
+Sun Nov 14 04:22:32 2010 Alexander Zavorine <alexandre.zavorine@nokia.com>
+
+ * symbian/setup (config.h): Added HAVE_LABS and HAVE_LLABS to config.h.
+
+ * symbian/configure.bat: Changed packaging version in line with API
+ style 3 versioning.
+
+Sat Nov 13 16:37:56 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (showflags, help): emit messages at once.
+
+ * win32/Makefile.sub (MSG, EOM): remove surrounding quotes by %~I.
+
+Sat Nov 13 01:31:30 2010 Akio Tajima <artonx@yahoo.co.jp>
+
+ * win32/Makefile.sub: reorder variable End Of Message (don't display it)
+
+Fri Nov 12 20:52:34 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (showflags, help): use caret to quote leading spaces on
+ Windows.
+
+ * Makefile.in, common.mk, cygwin/GNUmakefile.in, enc/depend,
+ ext/ripper/depend, lib/mkmf.rb, win32/Makefile.sub: caddle up.
+
+Fri Nov 12 16:35:31 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: support C level backtrace information on FreeBSD.
+ When devel/libexecinfo is installed on FreeBSD, now ruby
+ can show C level backtrace information.
+ http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/libexecinfo/
+
+Fri Nov 12 09:58:30 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/setup.mak: use findstr.exe instead of find.exe, because all
+ target build platforms should have findstr.exe, and, find.exe often
+ means another command such as cygwin's.
+
+Fri Nov 12 00:30:19 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/Makefile.sub (config.h): need PRI_LL_PREFIX.
+
+Thu Nov 11 23:38:32 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in: ANSI C-conforming const and volatile are mandatory
+
+ * configure.in (AC_C_CONST, AC_C_INLINE, AC_C_VOLATILE): check
+ before used in other checks.
+
+ * configure.in (RUBY_CHECK_PRINTF_PREFIX): should not break from
+ RUBY_WERROR_FLAG, so that ac_c_werror_flag gets restored.
+
+Thu Nov 11 23:04:44 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/iconv/iconv.c (warn_deprecated): show caller position.
+
+Thu Nov 11 23:03:12 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (argf_close): untie tied io before closing.
+
+ * io.c (argf_write): add ARGF.write and so on.
+
+ * io.c (argf_read_nonblock): add ARGF.read_nonblock.
+
+Thu Nov 11 21:49:06 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/rdoc/stats.rb (RDoc#print): get rid of NaN.
+
+Thu Nov 11 21:47:12 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (SHOWFLAGS): show compile flags.
+
+ * common.mk: hide long command lines by default. verbose-mode is
+ turned on by V=1 as before.
+ http://jarp.does.notwork.org/diary/200605b.html#200605121
+
+Thu Nov 11 21:32:09 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (try_func): accept variable address.
+
+ * ext/win32ole/extconf.rb: libuuid is needed on cygwin.
+
+Thu Nov 11 21:24:36 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (file_expand_path): use cygwin_conv_path on cygwin 1.7 or
+ later.
+
+ * ruby.c (push_include_cygwin): ditto.
+
+Thu Nov 11 20:49:48 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/ruby.h (PRI_LL_PREFIX): format type specifier for
+ LONG_LONG may vary on platforms.
+
+Thu Nov 11 20:45:23 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (SYMBOL_PREFIX): separate from EXPORT_PREFIX.
+
+ * win32/mkexports.rb (Exports#each_export): use SYMBOL_PREFIX.
+
+Wed Nov 10 07:20:10 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * cygwin/GNUmakefile.in (scriptbin): make executable file from
+ scripts with stub.
+
+ * ruby.c (load_file_internal): assume xflag for exe file as well
+ as no-shebang file.
+
+ * tool/rbinstall.rb: install script programs.
+
+ * win32/mkexports.rb (Exports#initialize): alias ruby_sysinit for
+ stub.
+
+ * win32/stub.c: stub for scripts. [EXPERIMENTAL]
+
+Tue Nov 9 21:57:45 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dln.c (init_funcname): allocate and build initialization
+ funciton name at once.
+
+Tue Nov 9 21:14:54 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (AC_FUNC_GETPGRP, AC_FUNC_SETPGRP): no need when
+ not used.
+
+ * configure.in (EXPORT_PREFIX): check generic prefix.
+
+Tue Nov 9 13:24:33 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * regenc.c (onigenc_minimum_property_name_to_ctype):
+ \p{...} should be case insensitive. [ruby-core:33000]
+
+ * regenc.c (onigenc_property_list_add_property):
+ ditto.
+
+ * enc/euc_jp.c (init_property_list, property_name_to_ctype):
+ to lowercase property names.
+
+ * enc/shift_jis.c (init_property_list, property_name_to_ctype):
+ ditto.
+
+Tue Nov 9 13:29:36 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (overlapped_socket_io): get rid of a warning of 64bit
+ mingw.
+
+Tue Nov 9 10:44:19 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * util.c (ruby_strtod): this code uses FPU's rounding system.
+ But x86's FPU calculates double precision floating-point
+ numbers in 80bit precision, so it fails to round the value.
+ So ensure the value is assigned a variable. [ruby-dev:42551]
+ see also [ruby-math:00802]
+ http://www.shudo.net/java-grandprix99/strictfp/
+
+Tue Nov 9 07:30:15 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * error.c (rb_syserr_new): new function to make SystemCallError
+ instance without errno. [EXPERIMENTAL]
+
+ * error.c (rb_syserr_fail, rb_mod_syserr_fail): ditto.
+
+Tue Nov 9 05:54:57 2010 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/*.rb: Remove unused variable warnings.
+ Patch by Run Paint [ruby-core:30991]
+
+ * lib/rubygems/*, lib/rdoc/*.rb, lib/rake/*.rb: ditto
+
+Mon Nov 8 18:26:03 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * util.c (ruby_hdtoa): fix type cast and bufsize.
+
+Mon Nov 8 15:40:56 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * vsnprintf.c (BSD_vfprintf): fix precision specifier doesn't
+ work well on %f. [ruby-dev:42552]
+
+Mon Nov 8 14:41:40 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (get_wsa_extension_function): typos.
+
+Mon Nov 8 13:41:33 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * tool/enc-unicode.rb,
+ enc/unicode/name2ctype.h, enc/unicode/name2ctype.h.blt,
+ enc/unicode/name2ctype.kwd, enc/unicode/name2ctype.src:
+ Add Age property to regexp. [ruby-core:33019]
+ patched by Ammar Ali, tested by Run Paint Run Run
+
+Mon Nov 8 12:16:39 2010 Ben Walton <bwalton@artsci.utoronto.ca>
+
+ * configure.in: support -h for solaris linker when gcc not used
+
+Mon Nov 8 11:47:39 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (finish_overlapped_socket): refactoring.
+
+Mon Nov 8 11:02:21 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (get_proc_address): refactoring.
+
+ * win32/win32.c (get_wsa_exetinsion_function): refactoring.
+
+Mon Nov 8 09:45:35 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * enc/trans/gbk-tbl.rb: Add euro sign. [ruby-core:33094]
+ CP936, which is de facto definition of GBK, has it.
+ http://msdn.microsoft.com/en-us/goglobal/cc305153.aspx
+
+Mon Nov 8 07:26:20 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in: check only the first symbol to get rid of
+ duplication. [ruby-core:33084] #4031
+
+Sun Nov 7 10:13:30 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (NM): check on all platforms. #4031
+
+Sun Nov 7 06:16:33 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * test/openssl/test_ocsp.rb: adding test for r29699. Thanks Elise
+ Huard! [ruby-core:32460]
+
+Sat Nov 6 07:33:08 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (rb_cv_export_prefix): check for prefixed
+ underscore of exported symbols
+
+ * tool/rbinstall.rb (bin-comm): prepend prolog shell script if
+ necessary.
+
+ * configure.in (LIBRUBY_RELATIVE): use rpath token expansion.
+
+Sat Nov 6 07:24:01 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * template/ruby.pc.in (arch, sitearch): reordered.
+
+ * configure.in: keep failed file.
+
+Sat Nov 6 07:03:49 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * process.c (rb_fork_err): save errinfo before fdopen.
+
+Sat Nov 6 00:43:58 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/openssl/ossl_ocsp.c (ossl_ocspcid_initialize): an optional
+ parameter may be used to specify the OpenSSL::OCSP::CertificateId on
+ initialization. Thanks Elise Huard! [ruby-core:32460]
+
+Fri Nov 5 12:23:01 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/ruby/test_{process,system}.rb (test_fallback_to_sh):
+ meaningless and wrong tests where /bin/sh does not exist.
+
+ * process.c (proc_spawn_v): should spawn, not exec.
+
+Fri Nov 5 01:21:31 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * process.c (proc_exec_v, proc_spawn_v): try to execute with sh if
+ no shebang. [ruby-core:32745] [EXPERIMENTAL]
+
+Fri Nov 5 00:39:00 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (rb_io_readlines, rb_io_each_line): limit must not be zero.
+ a patch from Tomoyuki Chikanaga at [ruby-dev:42538]. #4024
+
+Fri Nov 5 00:14:15 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/fiddle/extconf.rb: fixing ffi library location on windows.
+ Thanks Usa! [ruby-core:32930]
+
+Thu Nov 4 20:04:44 2010 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rb_newobj): force garbage_collect() if GC.stress == true.
+
+Thu Nov 4 19:48:22 2010 Koichi Sasada <ko1@atdot.net>
+
+ * ChangeLog: missed to write a last ChangeLog.
+
+ * gc.c (gc_finalize_deferred): removed.
+
+ * gc.c (rb_gc_finalize_deferred): Do not invoke a free_unused_heaps().
+
+Thu Nov 4 19:45:27 2010 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (run_final): do not need argument obj.
+
+Thu Nov 4 19:26:10 2010 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (before_gc_sweep): fix commit miss.
+
+Thu Nov 4 19:20:46 2010 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (after_gc_sweep, before_gc_sweep):
+ invoke rb_sweep_method_entry() as soon as possible.
+
+Thu Nov 4 19:13:58 2010 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (after_gc_sweep, slot_sweep): finalizers should be invoked
+ as soon as possible.
+
+Thu Nov 4 10:30:40 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * configure.in (--with-valgrind): Now this option is default on.
+ You can still explicitly disable this feature by specifying
+ --without-valgrind.
+
+Thu Nov 4 02:06:16 2010 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * cont.c (fiber_t_alloc): raise an error when fiber is going to be
+ initialized twice. [ruby-dev:42524]
+
+Thu Nov 4 02:04:25 2010 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * cont.c (rb_fiber_resume): raise an "double resume" error when root
+ fiber is going to be resumed. [ruby-dev:42523]
+
+Wed Nov 3 14:17:18 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/ostruct.rb (OpenStruct#delete_field): also undefine
+ accessor methods. [ruby-core:33010]
+
+Wed Nov 3 14:13:46 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_enc_cr_str_buf_cat): concatenation of valid
+ encoding string and invalid encoding string should result
+ invalid encoding. [ruby-core:33027]
+
+Wed Nov 3 08:58:59 2010 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c, vm.c, vm_core.h: remove USE_VALUE_CACHE option.
+
+Wed Nov 3 07:47:25 2010 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * lib/irb/ruby-lex.rb (RubyLex#identify_string): parse multiple
+ regex options. a patch from Heesob Park in [ruby-core:32988].
+
+Wed Nov 3 07:33:57 2010 Tanaka Akira <akr@fsij.org>
+
+ * vm_method.c (rb_clear_cache_by_class): just return if the class has
+ no method. reported by Eric Wong. [ruby-core:32689]
+
+Tue Nov 2 22:50:25 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/visitor.rb (initialize): push accessor
+ methods to subclass that actually uses them.
+
+Tue Nov 2 22:47:08 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/visitor.rb (accept): switch to
+ a dispatch cache rather than case / when statement.
+
+Tue Nov 2 21:46:52 2010 Kouhei Sutou <kou@cozmixng.org>
+
+ * NEWS: fix a typo.
+
+Tue Nov 2 20:10:32 2010 Tajima Akio <artonx@yahoo.co.jp>
+
+ * test/rake/test_tasks.rb: clear env var which is used by the test.
+ [ruby-dev:42508]
+
+Tue Nov 2 00:25:54 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/socket/extconf.rb: win64 is just same with win32 about socket.
+ notice: but wince is not same.
+
+Mon Nov 1 21:25:57 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * main.c: <stdlib.h> is needed, to introduce the getenv(3)
+ prototype declaration. Without it a C compiler shall infer
+ the getenv type as "int getenv(...);", but this is totally
+ wrong, especially when your machine's sizeof(int) and
+ sizeof(char*) differs. On such environment a return value
+ of getenv(3), which is in fact a char*, might first casted
+ into a int (loses data here), and then casted back to char*
+ by automatic integral promotion to fit to the prototype of
+ ruby_set_debug_option().
+
+Sun Oct 31 23:27:09 2010 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (finalizer_table, objspace->final.table):
+ Create finalizer_table at Init_heap().
+ Remove all null checks of finalizer_table.
+
+ * gc.c (mark_tbl): skip if no table entries.
+
+ * gc.c (slot_swee): remove useless need_call_final check.
+
+Sun Oct 31 22:32:08 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (rb_objspace_free): finalizers should be called separately
+ from freeing objspace. [ruby-dev:42479]
+
+Sun Oct 31 22:24:14 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (ruby_cleanup): free current VM and its objspace even
+ when exiting by SystemExit.
+
+Sun Oct 31 22:10:56 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (new_child_iseq): adjust argument types.
+
+ * iseq.c (prepare_iseq_build, rb_iseq_new),
+ (rb_iseq_new_with_bopt_and_opt, rb_iseq_new_with_opt),
+ (rb_iseq_new_with_bopt): ditto.
+
+ * compile.c (iseq_set_exception_table): suppress warnings.
+
+ * insns.def (putspecialobject, defined): ditto.
+
+ * iseq.c (iseq_load): ditto.
+
+Sun Oct 31 09:30:51 2010 Koichi Sasada <ko1@atdot.net>
+
+ * vm_core.h: some refactoring.
+ - move decl. of rb_compile_option_struct to iseq.h.
+ - define enum iseq_type.
+ - define enum vm_special_object_type.
+
+ * compile.c: some refactoring.
+ - apply above changes.
+ - (struct iseq_link_element): change value of type.
+ - remove unused decl.
+ - fix comment.
+ - rename iseq_build_body and iseq_build_exception to
+ iseq_build_from_ary_body and iseq_build_from_ary_exception.
+
+ * iseq.h: define enum catch_type and enum defined_type.
+
+ * insns.def: apply above changes.
+
+ * iseq.c: define ISEQ_MAJOR_VERSION and ISEQ_MINOR_VERSION.
+
+Sat Oct 30 23:38:59 2010 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/encoding.rb: untabify.
+
+Sat Oct 30 21:06:37 2010 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/encoding.rb: use Ruby native encoding mechanism.
+ [ruby-dev:42464]
+ * lib/rexml/encodings/: remove.
+
+ * lib/rexml/document.rb, lib/rexml/formatters/default.rb,
+ lib/rexml/output.rb, lib/rexml/parseexception.rb,
+ lib/rexml/parsers/baseparser.rb, lib/rexml/source.rb,
+ lib/rexml/xmldecl.rb: use Ruby's native Encoding object.
+
+ * test/rexml/, test/rss/: follow the above encoding changes.
+
+ * NEWS: add REXML's incompatible change about encoding.
+
+Sat Oct 30 17:23:19 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * util.c (ruby_strtod): get rid of overflow/underflow as possible.
+
+Sat Oct 30 14:37:39 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (ruby_pc): erase runtime-defined variables and
+ check if generated pc file is valid.
+
+ * template/ruby.pc.in (DEFFILE): need for mingw.
+
+ * template/ruby.pc.in (LIBRUBY): fix the order.
+
+Sat Oct 30 11:33:54 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/Makefile.sub (ruby_pc): ignore missing variables.
+
+ * template/ruby.pc.in: add missing variables for mswin.
+
+Sat Oct 30 10:24:35 2010 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * object.c: Make BasicObject.new accept no parameter.
+ Revert of r26135 [ruby-core:27080], as per [ruby-core:32952].
+
+Sat Oct 30 09:40:54 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * enum.c: use constants in id.h.
+
+Sat Oct 30 09:08:27 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/fiddle/closure.c (fiddle_closure): embed cif not reference
+ so that the content surely get initialized. [ruby-dev:42480]
+
+Sat Oct 30 07:01:53 2010 Tanaka Akira <akr@fsij.org>
+
+ * lib/resolv-replace.rb: suppress warning.
+
+ * lib/open-uri.rb: ditto.
+
+Sat Oct 30 06:32:52 2010 Tanaka Akira <akr@fsij.org>
+
+ * test/pathname/test_pathname.rb (TestPathname#test_grpowned?): the
+ group of the created file is inherited from the parent
+ directory on BSDs and MacOS X. Linux also inherit the group if
+ the setgid bit of the directory is set. It causes the test fail.
+ fixed by Shota Fukumori. [ruby-dev:42458]
+
+Sat Oct 30 05:58:54 2010 Tanaka Akira <akr@fsij.org>
+
+ * lib/resolv.rb: retry via TCP if UDP reply is truncated.
+ fixed by Julian Mehnle. [ruby-core:32407]
+
+Sat Oct 30 00:35:13 2010 Koichi Sasada <ko1@atdot.net>
+
+ * iseq.c (iseq_s_compile): fix optional argument.
+ a patch from Yutaka HARA [ruby-core:32953] [Ruby 1.9-Bug#4001]
+
+Sat Oct 30 00:24:42 2010 Koichi Sasada <ko1@atdot.net>
+
+ * ext/objspace/objspace.c (memsize_of): take care of
+ T_CLASS/const_tbl.
+ a patch from nagachika <nagachika00@gmail.com> [ruby-dev:42490]
+
+Fri Oct 29 23:32:36 2010 Koichi Sasada <ko1@atdot.net>
+
+ * test/profile_test_all.rb: added.
+ You can use test-all profiler with the following command:
+ RUBY_TEST_ALL_PROFILE=true make test-all
+ This command generates ./test_all_profile and you can analyze
+ which tests consume memories.
+
+ * test/runner.rb: ditto.
+
+Fri Oct 29 10:02:03 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * tool/enc-unicode.rb,
+ enc/unicode/name2ctype.h, enc/unicode/name2ctype.h.blt,
+ enc/unicode/name2ctype.kwd, enc/unicode/name2ctype.src:
+ Add 'Unknown' Script.
+ patched by Run Paint Run Run. [ruby-core:32937] #3998
+
+Fri Oct 29 05:13:34 2010 Koichi Sasada <ko1@atdot.net>
+
+ * ext/objspace/objspace.c (ObjectSpace.memsize_of_all): rename
+ ObjectSpace.total_memsize_of_all_objects() to
+ ObjectSpace.memsize_of_all([klass]).
+ Accept Class object to filter the objects.
+
+ * test/objspace/test_objspace.rb: fix test for above change.
+
+Fri Oct 29 03:04:16 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_dump): fix expected length. [ruby-core:32935]
+
+Thu Oct 28 23:31:39 2010 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (before_gc_sweep, run_final): fix decrement timing of final_num.
+
+Thu Oct 28 20:11:30 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * tool/enc-unicode.rb,
+ enc/unicode/name2ctype.h, enc/unicode/name2ctype.h.blt,
+ enc/unicode/name2ctype.kwd, enc/unicode/name2ctype.src:
+ Update Oniguruma for Unicode 6.
+ patched by Run Paint Run Run. [ruby-core:32923] #3989
+
+Thu Oct 28 20:06:25 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * include/ruby/oniguruma.h (ONIGENC_CTYPE_SPECIAL_MASK):
+ change mask from 128 to 256. [ruby-core:32931]
+
+Thu Oct 28 12:06:54 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/webrick/httprequest.rb (read_request_line): extend max
+ length to 2083. This is from Internet Explorer's max uri
+ length. http://support.microsoft.com/kb/208427 [ruby-core:32924]
+
+Thu Oct 28 04:00:08 2010 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (GC.stat): added. [ruby-dev:38607]
+
+ * test/ruby/test_gc.rb: add a test for above.
+
+Thu Oct 28 03:13:06 2010 Koichi Sasada <ko1@atdot.net>
+
+ * ext/objspace/objspace.c (memsize_of): fix rdoc.
+
+ * ext/objspace/objspace.c (total_memsize_of_all_objects): added.
+
+ * test/objspace/test_objspace.rb:
+ - add a test for ObjectSpace.total_memsize_of_all_objects.
+ - add two tests for ObjectSpace.memsize_of (for nil and Fixnum).
+
+Wed Oct 27 23:55:27 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/iconv/iconv.c (Init_iconv): warn deprecated use.
+
+Wed Oct 27 18:50:17 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * bignum.c (rb_big2long, rb_big2ulong): rb2ulong() returns VALUE, but
+ its real range is ulong. So, if the size of VALUE is bigger than
+ ulong, upper bits are always zero even if the actual value is
+ negative.
+ fixed #3490
+
+Wed Oct 27 18:27:17 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_io.rb (TestIO#pipe): should close write end of pipe
+ before closing read end, to get rid of timing problem.
+
+ * test/ruby/test_io_m17n.rb (TestIO_M17N#pipe): ditto.
+
+Wed Oct 27 18:14:27 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_getppid): support Win64.
+
+Wed Oct 27 15:07:19 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * thread_win32.c (w32_error): should get error no only once, because
+ the result of the second getting will indicate the error of the
+ first FormatMessage() call.
+
+Wed Oct 27 13:51:25 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_io.rb (TestIO#pipe): need to propagate exceptions
+ in read/write thread. fix r29541.
+
+ * test/ruby/test_io_m17n.rb (TestIO_M17N#pipe): ditto.
+
+Wed Oct 27 12:05:40 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * class.c (clone_const): need to return value. fix r29602.
+
+Wed Oct 27 11:58:58 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * include/ruby/ruby.h (NUM2LONG_internal): add cast to get rid of a
+ non GCC compiler warning. this is intentional type conversion.
+
+Wed Oct 27 09:25:46 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * cont.c: apply documentation patch by Run Paint Run Run.
+ [ruby-core:32915]
+
+Wed Oct 27 02:12:10 2010 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * object.c (Init_Object), constant.h, variable.c
+ (rb_mod_private_constant, rb_mod_public_constant,
+ set_const_visibility, rb_const_get_0): add Module#public_constant
+ and private_constant. [ruby-dev:39685][ruby-core:32698]
+
+ * test/ruby/test_module.rb: add tests for above.
+
+Wed Oct 27 02:02:54 2010 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * class.c, constant.h, gc.c, method.h, object.c, variable.c,
+ vm_insnhelper.c: use struct rb_constant_entry_t as entry of
+ RCLASS_CONST_TBL. RCLASS_CONST_TBL has contained VALUE of constant
+ directly. Now instead rb_const_entry_t is contained in
+ RCLASS_CONST_TBL, rb_const_entry_t is managed by malloc, and
+ have not only the value itself but also visibility flag.
+ This is another preparation for private constant (see
+ [ruby-dev:39685][ruby-core:32698]).
+
+Wed Oct 27 01:56:34 2010 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * class.c, gc.c, object.c, variable.c, vm_insnhelper.c,
+ include/ruby/ruby.h: separate RCLASS_CONST_TBL from RCLASS_IV_TBL.
+ RCLASS_IV_TBL has contained not only instance variable table but
+ also constant table. Now the two table are separated to
+ RCLASS_CONST_TBL and RCLASS_IV_TBL. This is a preparation for
+ private constant (see [ruby-dev:39685][ruby-core:32698]).
+
+Tue Oct 26 18:51:00 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/scanf.rb (extract_float): allow 2.e+2 style.
+ [ruby-dev:42452] #3978
+
+Tue Oct 26 18:09:36 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * Makefile.in (ASFLAGS): needs INCFLAGS.
+
+ * configure.in (rb_cv_dynamic_alloca): check if extra source for
+ dynamic size alloca.
+
+ * missing/x86_64-chkstk.s (___chkstk): necessary for alloca of
+ amd64-mingw32msvc-gcc on Ubuntu.
+
+ * thread_win32.c (ruby_alloca_chkstk): check stack overflow
+
+Tue Oct 26 18:04:53 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * template/ruby.pc.in (Libs): needs DLDFLAGS.
+
+Tue Oct 26 12:47:10 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (pkgconfig-data): moved from Makefile.in.
+
+ * tool/rbinstall.rb: install pc file only if non-empty.
+ [ruby-core:32901] #3983
+
+ * win32/Makefile.sub (ruby_pc): create pc file.
+
+Tue Oct 26 09:13:34 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (rb_cv_gcc_atomic_builtins): check for atomic
+ builtins, all are not available in Apple derivative gcc.
+
+Tue Oct 26 00:29:26 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * Makefile.in (pkgconfig-data): create pkg-config metadata file.
+
+ * tool/rbinstall.rb: install pkg-config metadata file.
+
+ * template/ruby.pc.in: template of pkg-config metadata file.
+
+Mon Oct 25 16:38:07 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * signal.c (rb_atomic_t): GCC (of at least recent versions)
+ has ubiquitous support for atomic operations. On that
+ compiler a C program can issue a memory barrier using these
+ dedicated instructions. According to the GCC manual they
+ cargo culted this feature form the Itanium ABI so chances
+ are that other compilers could also support this feature.
+ But so far GCC is the only compiler that I know to have it.
+ Also note that this works on non-Itanium machines.
+
+Mon Oct 25 06:21:35 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vsnprintf.c (BSD_vfprintf): prec digits fractal part should be
+ appended to 0 if prec is given. [ruby-dev:42453] #3979
+
+Mon Oct 25 02:57:21 2010 Koichi Sasada <ko1@atdot.net>
+
+ * common.mk (run.gdb): Quit gdb on 'make gdb' when
+ no signals are received.
+
+Mon Oct 25 00:25:23 2010 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * lib/date.rb: some corrections of documentation.
+
+Sun Oct 24 17:14:00 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c, gc.c, hash.c, object.c, string.c, struct.c,
+ transcode.c, variable.c, vm.c, vm_insnhelper.c, vm_method.c:
+ replace calls to rb_error_frozen() with rb_check_frozen(). a
+ patch from Run Paint Run Run at [ruby-core:32014]
+
+ * include/ruby/intern.h (rb_check_frozen): optimize.
+ [ruby-core:32878]
+
+Sun Oct 24 15:16:30 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::Mini#run): abort if interrupted.
+
+ * lib/test/unit.rb (Test::Unit::Mini#run_test_suites): show the
+ result even when interrupted on the way.
+
+ * lib/test/unit.rb (Test::Unit::Mini#run_test_suites): ensure
+ output sync mode to be restored.
+
+Sun Oct 24 14:11:16 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm.c (vm_define_method): defined method is run with the default
+ public visibility regardless the visibility context of definition.
+ [ruby-core:30638]
+
+Sun Oct 24 12:08:54 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * lib/test/unit.rb: make test/unit play nicely with the rake test
+ loader. [ruby-core:32864]
+
+Sun Oct 24 00:25:13 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/ruby/test_rubyoptions.rb (test_segv_test): follow up the
+ change at r29556.
+
+Sat Oct 23 14:39:58 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb: $extmk should be true for test/runner.
+
+Sat Oct 23 10:55:37 2010 Koichi Sasada <ko1@atdot.net>
+
+ * vm_dump.c (rb_vm_bugreport): fix to add bug outputs.
+ - loaded script ($0)
+ - loaded features ($")
+ - process memory map on Linux (/proc/self/maps)
+
+ * vm_dump.c (rb_vmdebug_stack_dump_raw): fix header message.
+
+Fri Oct 22 14:50:13 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert):
+ assertion message must not be nil.
+
+Fri Oct 22 13:59:50 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert):
+ treat nil case. Please run test-all before commit such change.
+
+Thu Oct 21 23:58:14 2010 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (gc_lazy_sweep): Variable declarations should be at
+ the head of block.
+
+Thu Oct 21 23:56:54 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (objspace_each_objects, rb_objspace_each_objects): use
+ struct.
+
+ * gc.c (objspace_each_objects): fix return with no value.
+
+Thu Oct 21 23:47:12 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (dir_initialize): remove useless intermediate variable.
+
+Thu Oct 21 16:07:20 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (rb_f_select): change rdoc.
+ patched by Eito Katagiri [ruby-core:31805]
+
+Thu Oct 21 15:55:21 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/webrick/httpauth/digestauth.rb
+ (WEBrick::HTTPAuth::ProxyDigestAuth#check_uri): privated.
+ [ruby-dev:42344]
+
+Thu Oct 21 15:50:25 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (rb_f_select): add correct rdoc.
+ patched by Dave Thomas [ruby-core:32467]
+
+Thu Oct 21 15:42:01 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/telnet.rb (Net::Telnet#close): added.
+ patched by Erik Hollensbe [ruby-dev:42260] #3830
+
+Thu Oct 21 13:08:00 2010 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c (rb_objspace_each_objects): don't lazy sweep in
+ rb_objspace_each_objects. [Bug #3940] [ruby-dev:42369]
+
+Thu Oct 21 00:05:45 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/ruby/test_io.rb (TestIO#pipe): get rid of deadlock on pipe.
+ a patch from Tomoyuki Chikanaga at [ruby-dev:42435]. #3970
+
+ * test/ruby/test_io_m17n.rb (TestIO_M17N#pipe): ditto.
+
+Wed Oct 20 23:54:36 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/dbm/dbm.c: rdoc based on a patch by mathew meta AT
+ pobox.com, at [ruby-core:32853].
+
+Wed Oct 20 10:47:21 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * util.c (ruby_strtod): reject 0x1.p+0. [ruby-dev:42432] #3966
+
+Wed Oct 20 10:00:57 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * vsnprintf.c (BSD_vfprintf): print floating point on "%#a".
+ [ruby-dev:42431] Bug#3965
+
+Tue Oct 19 19:30:11 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * vsnprintf.c (BSD_vfprintf): clear ALT flag for %a.
+ [ruby-core:32841] [ruby-core:32848]
+
+Tue Oct 19 12:19:25 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vsnprintf.c (BSD_vfprintf): fix over-count of field size.
+
+Tue Oct 19 03:08:52 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vsnprintf.c (BSD_vfprintf): use HEXPREFIX flag for prefix of %a.
+ [ruby-core:32841]
+
+Mon Oct 18 13:18:01 2010 Akinori MUSHA <knu@iDaemons.org>
+
+ * ext/digest/digest.c (rb_digest_class_init): Define
+ Digest::Class.new(). [Feature #3954]
+
+Mon Oct 18 12:58:40 2010 Tanaka Akira <akr@fsij.org>
+
+ * pack.c (pack_pack): refine the document. [ruby-dev:42397]
+ (pack_unpack): ditto.
+
+Mon Oct 18 10:19:00 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http.rb (transport_request): @socket may be nil.
+ patched by Egbert Eich [ruby-core:32829]
+
+Mon Oct 18 09:57:28 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * sprintf.c (BSD_vfprintf): wrong padding around prefix and
+ floating point with %a. [ruby-dev:42403] Bug #3956
+
+Sun Oct 17 22:36:33 2010 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * lib/date/delta.rb: added an rdoc tag.
+
+Sun Oct 17 10:47:12 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * variable.c (rb_mod_remove_const): update rdoc.
+ [ruby-core:31957]
+
+Sun Oct 17 10:40:17 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * class.c (rb_define_{class,module}_id_under): register to be
+ marked, which probably are defined and used internally.
+
+Sat Oct 16 11:10:55 2010 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (ole_encoding2cp): set codepage 20936
+ according to GB2312. [Bug #3937] [ruby-core:32758]
+
+Sat Oct 16 10:54:57 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * Makefile.in (CPP): already used in .c.i rule.
+
+ * cygwin/GNUmakefile.in (DLLWRAP, WINDRES): add --driver-name and
+ --preprocessor options explicitly. [ruby-core:32776]
+
+Sat Oct 16 10:06:08 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/sdbm/_sdbm.c (SEEDUPS, BADMESS): make settable using command
+ line options.
+
+ * ext/sdbm/_sdbm.c (makroom): suppress unused result warning.
+
+ * ext/sdbm/extconf.rb: disable BADMESS, a library should not emit
+ messages directly.
+
+Sat Oct 16 08:39:03 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dln.c (dln_strerror): get English message first, instead of
+ system default. see [ruby-dev:42358].
+
+Sat Oct 16 00:08:00 2010 Koichi Sasada <ko1@atdot.net>
+
+ * hash.c (rb_hash_aref): skip calling "default" method
+ if it is not needed, for speed-up.
+
+Fri Oct 15 23:36:25 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (NUM2DEVT, DEVT2NUM, PRI_DEVT_PREFIX): fallback to
+ unsigned int.
+
+Fri Oct 15 22:54:46 2010 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (ole_hresult2msg): get English message first,
+ instead of system default. [ruby-core:32765]
+
+Fri Oct 15 22:47:31 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/ruby.h (VALUE): prefer long over uintptr_t,
+ FIX2LONG expects VALUE to be long at least.
+
+ * include/ruby/ruby.h (FIX2LONG): parenthesize the argument.
+
+Fri Oct 15 20:30:30 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (dev_t): use RUBY_REPLACE_TYPE.
+
+ * file.c (rb_stat_inspect): use PRI_DEVT_PREFIX.
+
+Fri Oct 15 17:26:57 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * pack.c (pack_pack): simplify comparison of explicit_endian
+ as pointed by nobu.
+
+ * pack.c (pack_unpack): ditto.
+
+Fri Oct 15 16:40:37 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * pack.c (pack_pack): fix more than one modifiers appear in the
+ format string. [ruby-core:32793]
+
+ * pack.c (pack_unpack): ditto.
+
+Thu Oct 14 23:20:42 2010 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * test/win32ole/test_folderitem2_invokeverb.rb: refactoring.
+
+Thu Oct 14 22:18:29 2010 Koichi Sasada <ko1@atdot.net>
+
+ * insns.def, iseq.c, vm_insnhelper.c: rename variable name
+ (ip -> iseq).
+
+Thu Oct 14 20:41:27 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * pack.c (pack_pack): support endian modifiers: < and >.
+ [ruby-dev:42376] Feature #3491
+
+ * pack.c (pack_unpack): ditto.
+
+Thu Oct 14 20:50:51 2010 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (reg_get_val): expand environment in
+ the pathname. [Bug #3907]
+
+Thu Oct 14 07:35:07 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * file.c (DEVT2NUM): added. Size of dev_t is depend on the
+ environment even if POSIX defines dev_t as unsigned integer.
+ For example, OpenVMS, 64bit Solaris 9, and NetBSD 6 defines
+ dev_t as 64bit unsigned integer.
+
+ * file.c (rb_stat_dev): use DEVT2NUM.
+
+ * file.c (rb_stat_dev_major): dev_t is not long. major(3)'s return
+ value is int.
+
+ * file.c (rb_stat_dev_minor): dev_t is not long. minor(3)'s return
+ value is int.
+
+ * configure.in: check size of dev_t.
+
+Thu Oct 14 07:22:12 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_ary_and, rb_ary_or), class.c (rb_mod_init_copy),
+ gc.c (undefine_final), time.c (time_mload): get rid of
+ type-punning casts.
+
+Thu Oct 14 04:16:41 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * numeric.c (ruby_float_step): fix Numeric#step with infinity unit
+ doesn't works well. [ruby-core:32779]
+
+Wed Oct 13 23:16:46 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/enc-unicode.rb: get rid of lots of warnings.
+
+ * iseq.c (insn_operand_intern, rb_iseq_disasm): fix format specifiers.
+
+ * vm.c (thread_free): ditto.
+
+ * numeric.c (check_uint): get rid of overflow on LLP64 platforms.
+
+ * insns.def (opt_case_dispatch): use st_data_t.
+
+Wed Oct 13 22:32:34 2010 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
+
+ * lib/cgi/util.rb (CGI::unescape): bugfix to unescape the multibyte
+ string. Thanks nobu and tDiary dev members. [Bug #3909]
+
+Wed Oct 13 21:13:00 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * numeric.c (int_chr): raise error when the value is negative.
+
+Wed Oct 13 19:24:08 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * vm.c (ruby_vm_destruct): This function type was wrong; correct to the prototype.
+
+Wed Oct 13 14:58:09 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * numeric.c (rb_num_to_uint): fix 32bit logic.
+
+Wed Oct 13 12:53:43 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * numeric.c (rb_num_to_uint): added to check the range of arguments.
+ Mainly for negative value with NUM2UINT on 32bit environment.
+
+ * string.c (rb_str_concat): use rb_num_to_uint.
+
+Wed Oct 13 12:10:02 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * thread_win32.c (w32_error): get English message first, instead
+ of system default. see [ruby-core:32765].
+ [experimental]
+
+Wed Oct 13 11:04:03 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * debug.c (ruby_set_debug_option): define always for binary
+ compatibility with debug env enabled binary.
+
+ * signal.c (ruby_enable_coredump): ditto.
+
+Wed Oct 13 10:52:51 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/ruby.h (ruby_executable_node): missing prototype.
+
+Wed Oct 13 05:23:04 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * missing/strchr.c: add strlen's prototype.
+
+ * missing/strstr.c: ditto.
+
+Wed Oct 13 00:21:17 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/syck/rubyext.c (struct mktime_arg): constified.
+
+ * ext/syck/rubyext.c (mktime_do, mktime_r, rb_syck_mktime): fix
+ function signatures.
+
+Wed Oct 13 00:18:18 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * st.c (MurmurMagic): get rid of literal overflow.
+
+ * configure.in (RUBY_CHECK_PRINTF_PREFIX): check for printf format
+ specifier if possible.
+
+Tue Oct 12 23:58:19 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_open_osfhandle, rb_w32_wopen, rb_w32_pipe):
+ use uintptr_t instead of long for win64.
+
+ * win32/win32.c (socketpair_internal): suppress warnings.
+
+ * win32/win32.c (ftruncate): use HANDLE instead of long for win64.
+
+ * vsnprintf.c (BSD_vfprintf): fix cast.
+
+ * numeric.c (rb_num2fix): result of rb_num2long is SIGNED_VALUE.
+
+ * compile.c (iseq_build_body), error.c (set_syserr, get_syserr),
+ (syserr_initialize), gc.c (define_final, rb_gc_copy_finalizer),
+ (run_final), hash.c (rb_hash_aref, rb_hash_lookup2),
+ (rb_hash_fetch_m, rb_hash_clear, rb_hash_aset, eql_i),
+ iseq.c (iseq_load, iseq_data_to_ary), marshal.c (r_symlink),
+ thread.c (rb_thread_local_aref),
+ variable.c (generic_ivar_remove, ivar_get, rb_const_get_0),
+ (rb_cvar_get), vm.c (rb_vm_check_redefinition_opt_method),
+ vm_insnhelper.c (vm_get_ev_const), vm_method.c (remove_method),
+ ext/iconv/iconv.c (map_charset): use st_data_t.
+
+ * compile.c (iseq_build_body), insns.def (getglobal, setglobal),
+ iseq.c (iseq_load, iseq_data_to_ary), util.c (valid_filename):
+ use VALUE.
+
+ * gc.c (obj_free, rb_objspace_call_finalizer): fix truncating
+ cast.
+
+ * gc.c (mark_current_machine_context): suppress warnings.
+
+ * compile.c (iseq_compile_each): fix truncating cast.
+
+ * cont.c (fiber_setcontext): missing variable definition.
+
+Tue Oct 12 19:25:13 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * error.c (exc_to_s): use OBJ_INFECT.
+
+ * error.c (name_err_to_s): ditto.
+
+ * error.c (name_err_mesg_to_str): ditto.
+
+ * error.c (syserr_initialize): ditto.
+
+Tue Oct 12 19:07:55 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * error.c (syserr_initialize): taint message if mesg is given
+ and it is tainted.
+
+Tue Oct 12 18:25:43 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (rb_io_ungetc): always see Bignum. On 32bit valid value
+ may be a Bignum. On 64bit for errors. [ruby-dev:42366]
+
+Tue Oct 12 18:25:04 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_str_concat): use unsigned int for GB18030.
+
+Tue Oct 12 17:53:49 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * numeric (check_uint): the mask must refer to VALUE.
+
+Tue Oct 12 17:47:10 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * numeric (check_uint): set MSB for negative value.
+
+ * numeric (rb_num2uint): return value's type of rb_num2ulong
+ is VALUE.
+
+ * numeric (int_chr): variable i can't be negative.
+
+Tue Oct 12 16:04:37 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_strerror): get English message first, instead
+ of system default. see [ruby-dev:42358].
+ [experimental]
+
+Tue Oct 12 15:52:35 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_strerror): unmap some range of errno for
+ workaround of VC10's strerror() and sys_nerr problem.
+ based on a patch from Akio Tajima, [ruby-dev:42355].
+
+Tue Oct 12 15:36:09 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (rb_io_ungetc): use unsigned int for GB18030.
+
+Tue Oct 12 15:14:21 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (rb_io_putc): support multibyte characters.
+ [ruby-core:30697]
+
+Tue Oct 12 15:10:31 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * numeric.c (rb_enc_uint_chr): split from int_chr.
+
+ * numeric.c (int_chr): use rb_enc_uint_chr.
+
+ * include/ruby/encoding.h (rb_enc_uint_chr): added.
+
+Tue Oct 12 14:04:41 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * numeric.c (int_chr): a codepoint of Ruby M17N must be 32bit
+ unsigned int; GB18030 uses MSB. Also note that OnigCodePoint
+ is defined as unsigned int.
+
+Tue Oct 12 12:20:54 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * vm_dump.c (dump_thread): foolish mistake.
+
+Tue Oct 12 10:39:08 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (RUBY_MINGW32): canonicalize only on mingw.
+
+Mon Oct 11 20:20:23 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http.rb (HTTP.get): specify ASCII-8BIT as the result
+ encoding of Zlib::GzipReader.
+ http://hibari.2ch.net/test/read.cgi/tech/1281473294/271
+
+Mon Oct 11 17:42:54 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * error.c (syserr_initialize): use mesg's encoding when locale
+ encoding is US-ASCII. If locale encoding is not US-ASCII,
+ assume err has non ASCII characters. [ruby-dev:42358]
+
+Mon Oct 11 14:03:54 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * error.c (syserr_initialize): set the encoding of Errno::*#message
+ as locale. [ruby-dev:42358]
+
+Mon Oct 11 06:38:27 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/stringio/stringio.c (strio_set_encoding):
+ StringIO#set_encoding can get 2nd argument and optional hash
+ for API compatibility to IO. [ruby-dev:42356]
+
+Mon Oct 11 06:11:30 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (rb_io_set_encoding): use rb_funcall2 when the io is not
+ a T_FILE. [ruby-dev:42356]
+
+Sun Oct 10 18:42:23 2010 Akinori MUSHA <knu@iDaemons.org>
+
+ * lib/set.rb (Set#replace): Apply a bit of optimization.
+
+Sun Oct 10 10:20:07 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (RUBY_MINGW32): canonicalize as like mswin version.
+
+Sun Oct 10 05:33:14 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_core.h (rb_signal_buff_size, rb_signal_exec): moved
+ declarations from thread.c.
+
+Sat Oct 9 16:54:28 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (RSHIFT): quote to get rid of argument expansion
+ for autoconf 2.68.
+
+Sat Oct 9 11:00:06 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread.c (thread_reset_event_flags, exec_event_hooks): ignore
+ hooks marked as removed.
+
+ * thread.c (thread_exec_event_hooks): remove hooks to be removed.
+
+ * thread.c (rb_threadptr_remove_event_hook, rb_remove_event_hook):
+ defer removing hooks if running the hooks. [ruby-dev:42350]
+
+Sat Oct 9 10:51:00 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread.c (rb_threadptr_exec_event_hooks): suppress each event
+ hooks separately.
+
+ * thread.c (thread_suppress_tracing): split from
+ ruby_suppress_tracing, accepting thread pointer and event mask.
+
+Sat Oct 9 08:16:01 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread.c (rb_threadptr_remove_event_hook): fix typo.
+
+Fri Oct 8 10:52:25 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (RBCONFIG): depends on version.h due to
+ RUBY_PATCHLEVEL. [ruby-core:32709]
+
+Fri Oct 8 00:24:54 2010 James Edward Gray II <jeg2@ruby-lang.org>
+
+ * lib/csv.rb: Fixing documentation typos. [ruby-core:32712]
+
+Thu Oct 7 09:14:28 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * vm_exec.c (vm_exec_core): Treat clang as non gcc on this
+ context: It has __asm__ but doesn't works well.
+
+Wed Oct 6 12:28:22 2010 Tanaka Akira <akr@fsij.org>
+
+ * lib/uri/generic.rb (URI::Generic#hostname): new method.
+ (URI::Generic#hostname=): ditto.
+
+ * lib/open-uri.rb: use URI#hostname
+
+ * lib/net/http.rb: ditto.
+
+ reported by Adam Majer. [ruby-core:32056]
+
+Wed Oct 6 11:52:12 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (fptr_finalize): write_mutex might have been destroyed
+ already in finalization phase, as the order of finalizers is not
+ guaranteed. rb_mutex_t should be used in place of Mutex object
+ in the future.
+
+Tue Oct 5 22:17:02 2010 wanabe <s.wanabe@gmail.com>
+
+ * win32/mkexports.rb: revert r29320 and r29402.
+
+Mon Oct 4 12:43:47 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (regexp): dregexp has literal string only at the head
+ and successors are array. [ruby-core:32682]
+
+Mon Oct 4 10:22:21 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * random.c (rand_init): This checks the value is in 32bit or not,
+ so use int32_t, not int.
+
+Mon Oct 4 09:47:39 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * random.c (rand_init): remove useless assignment.
+
+ * re.c (update_char_offset): remove unused variable.
+
+ * re.c (read_escaped_byte): ditto.
+
+Mon Oct 4 09:30:42 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/openssl/lib/openssl/bn.rb (Integer#to_bn): OpenSSL::BN.new
+ accepts only Strings, so call Integer#to_s(16).
+ 16 is for an optimization. [ruby-dev:42336]
+
+Mon Oct 4 07:57:51 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * cont.c (fiber_memsize): Return size.
+ Before this change, fiber_memsize always returns 0.
+
+Mon Oct 4 07:16:55 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * enc/unicode.c (onigenc_unicode_property_name_to_ctype):
+ remove useless assignment.
+
+ * vm.c (vm_make_proc_from_block): ditto.
+
+ * variable.c (rb_ivar_count): ditto.
+
+Mon Oct 4 06:40:24 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * Makefile.in (clean-rdoc): Don't use \ in variable expansion.
+ BSD make treats it as an escape character.
+
+Mon Oct 4 00:01:53 2010 wanabe <s.wanabe@gmail.com>
+
+ * tool/config.sub: revert r29320, r29324, r29347, r29354, r29365
+ to automake-1.11.1. [ruby-core:32634]
+
+ * win32/mkexports.rb: no longer use 'mingw64'. a patch from Luis Lavena
+ at [ruby-core:32678].
+
+Sun Oct 3 20:36:37 2010 Akio Tajima (arton) <artonx@yahoo.co.jp>
+
+ * test/win32ole/test_folderitem2_invokeverb.rb: Change creating
+ shortcut verb to 'Link' [Bug #3339]
+
+Sun Oct 3 19:44:23 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (Makefile): get rid of duplicated ruby target when
+ already there it was.
+
+Sat Oct 2 22:59:32 2010 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * test/win32ole/test_thread.rb: add for win32ole with Thread.
+
+Fri Oct 1 17:03:00 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * test/webrick/test_httpproxy.rb (TestWEBrickHTTPProxy::test_upstream_proxy):
+ My machine fails this test at this line, saying 503 service unavailable.
+
+Thu Sep 30 16:11:08 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_getenv): should return NULL if specified name
+ is empty. a patch from Heesob Park at [ruby-core:32650]
+
+Thu Sep 30 15:18:23 2010 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * parse.y (command_asgn): allow command_call to be right hand side
+ expression of chained assignment. [ruby-dev:42313]
+
+Thu Sep 30 10:55:38 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * hash.c (ruby_setenv): workaround for old Windows. a patch from
+ Heesob Park. [ruby-core:32353]
+
+Thu Sep 30 09:29:06 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/uri/common.rb (URI.encode_www_form): change treatment of
+ undefined value in given array as latest internet draft for
+ application/www-form-urlencoded.
+ http://tools.ietf.org/html/draft-hoehrmann-urlencoded-01
+
+Thu Sep 30 09:34:03 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * vm_dump.c (dump_thread): fixed wrong type of return value of
+ SymGetModuleBase64(). [ruby-dev:42306]
+
+Wed Sep 29 21:04:05 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * test/ruby/test_rubyoptions.rb (TestRubyOptions::test_script_from_stdin):
+ As usual, PTY is not always available.
+
+Wed Sep 29 18:38:14 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/config.sub (x64): regularize only for pc vendor, and strip
+ useless 64 suffix.
+
+Wed Sep 29 17:53:02 2010 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (BIGDECIMAL_ENABLE_VPRINT):
+ VPrint is usually disabled. It's only used in debugging.
+
+Wed Sep 29 17:41:34 2010 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_save_limit):
+ return the result of a block.
+
+ * test/bigdecimal/test_bigdecimal.rb (test_save_limit):
+ add a test for the above change.
+
+Wed Sep 29 16:18:03 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * vm_dump.c (dump_thread): remove unused optional arguments.
+
+Wed Sep 29 13:26:30 2010 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_save_rounding_mode):
+ return the result of a block.
+
+ * test/bigdecimal/test_bigdecimal.rb (test_save_rounding_mode):
+ add a test for the above change.
+
+ * test/bigdecimal/test_bigdecimal.rb (test_save_exception_mode):
+ add a test for the return value of BigDecimal.save_exception_mode.
+
+Wed Sep 29 12:45:30 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_div2, BigDecimal_add2,
+ BigDecimal_sub2, BigDecimal_mult2, VpLimitRound): remove meaningless
+ casts to get rid of compiler warnings.
+
+Wed Sep 29 12:35:13 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/bigdecimal/bigdecimal.c (VPrint, VpToString): fix format.
+
+Wed Sep 29 12:31:12 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/rdoc/known_classes.rb (RDoc::KNOWN_CLASSES): add Encoding.
+
+Tue Sep 28 20:50:23 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/config.sub (x64): regularize same as mswin.
+
+Tue Sep 28 20:06:14 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * vm_dump.c (rb_vm_bugreport): add windows support.
+ based on patches from Peter Weldon at [ruby-core:32551]
+
+Mon Sep 27 23:30:34 2010 Koichi Sasada <ko1@atdot.net>
+
+ * insns.def (opt_case_dispatch), vm_insnhelper.c:
+ execute the procedures of "when" clauses by bytecode
+ instead of st_foreach() when the object does not hit
+ prepared hash. [ruby-dev:42304]
+
+Mon Sep 27 15:54:03 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * test/net/http/test_https.rb: As always, localhost is not
+ guaranteed to be resolved as 127.0.0.1. But a SSL
+ certificate needs a socket to listen on a specific address
+ where a CN resolves to. On situations where localhost is
+ not 127.0.0.1, these tests are not possible.
+
+Mon Sep 27 15:25:05 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * test/net/imap/test_imap.rb: resurrection of r29259.
+ this change depends on minitest 1.7.1.
+
+ * lib/test/unit/assertions.rb: ditto.
+
+Sun Sep 26 22:59:45 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/config.sub (x86_64-pc-mingw64): regularize.
+
+Sun Sep 26 22:21:07 2010 wanabe <s.wanabe@gmail.com>
+
+ * ext/openssl/ossl_hmac.c (ossl_hmac_hexdigest, ossl_hmac_s_hexdigest),
+ ext/openssl/ossl_pkey_ec.c (ossl_ec_group_set_seed),
+ ext/openssl/ossl_ssl_session.c (ossl_ssl_session_to_der),
+ ext/openssl/ossl_pkcs7.c (numberof): suppress warnings.
+ [ruby-core:31932]
+
+Sun Sep 26 10:25:24 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/config.{guess,sub}: updated to automake-1.11.1.
+
+Sat Sep 25 22:48:30 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (LIBRUBY_DLDFLAGS): fix quoting.
+
+Sat Sep 25 10:30:37 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (LIBRUBY_DLDFLAGS): use -unexported_symbol only
+ when available. http://trac.macports.org/ticket/26341
+
+Sat Sep 25 10:05:49 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: Always add -mieee for Renesas SH4.
+ Thanks, Nobuhiro Iwamatsu. [Feature #3874] [ruby-core:32548]
+
+Sat Sep 25 01:34:41 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * Makefile.in (install-cross): target to install cross-compiling
+ stuff.
+
+Fri Sep 24 23:44:59 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (sym_call), vm.c (invoke_block_from_c),
+ vm_insnhelper.c (vm_yield_with_cfunc): pass given block.
+ [ruby-core:32075]
+
+ * vm_eval.c (rb_funcall_passing_block): new function to call
+ method with passing given block.
+
+Fri Sep 24 15:50:43 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_str_to_i): fix rdoc: String#to_i raises an
+ exception when base is invalid. [ruby-core:31685]
+
+Fri Sep 24 15:28:35 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_str_rindex): use rb_enc_prev_char instead of repeated
+ str_nth.
+ patched by Michael Selig [ruby-core:32498]
+
+Fri Sep 24 14:19:12 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * test/test_pty.rb: Same as 229281; existence of PTY class do not
+ guarantee a successful pty operation.
+
+Fri Sep 24 06:25:55 2010 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * lib/minitest/*.rb: Imported minitest 1.7.2 r5879.
+ * test/minitest/*.rb: ditto.
+
+Thu Sep 23 23:09:08 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_get_cref0): cref is stacked only in normal
+ iseqs, so check if it is the case first.
+
+Thu Sep 23 23:08:41 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/config.sub: mingw64 should use x86_64. [ruby-core:32514]
+
+Thu Sep 23 21:40:40 2010 wanabe <s.wanabe@gmail.com>
+
+ * ext/socket/raddrinfo.c (init_addrinfo, inspect_sockaddr): suppress
+ warnings. see [ruby-core:31932].
+
+Thu Sep 23 19:27:57 2010 wanabe <s.wanabe@gmail.com>
+
+ * thread_win32.c (w32_wait_events, w32_close_handle): suppress warnings.
+ see [ruby-core:31932].
+
+Thu Sep 23 18:54:39 2010 wanabe <s.wanabe@gmail.com>
+
+ * tool/config.sub: add mingw64.
+
+ * win32/mkexports.rb (Exports::Mingw64): added.
+
+ * win32/mkexports.rb (Exports::Mingw32): renamed from Exports::Mingw.
+
+Thu Sep 23 09:01:28 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_cref_push): no outer cref is needed for proc
+ from method. Bug #3786, Bug #3860, [ruby-core:32501]
+
+Wed Sep 22 17:12:01 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * test/openssl/utils.rb (OpenSSL#silent): always restore $VERBOSE.
+ [ruby-dev:42285]
+
+Wed Sep 22 16:59:40 2010 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * test/test_prime.rb (TestPrime#test_new): the warning expected have
+ not been displayed when $VERBOSE == nil. Patch by Shota Fukumori
+ a.k.a. sora_h. [ruby-dev:42272]
+ Recovers $stderr even if StringIO.new fails. Reported by unak.
+
+Wed Sep 22 01:55:48 2010 Koichi Sasada <ko1@atdot.net>
+
+ * bootstraptest/test_method.rb: fix last commit.
+
+Wed Sep 22 01:49:52 2010 Koichi Sasada <ko1@atdot.net>
+
+ * bootstraptest/test_method.rb: add a test for [ruby-core:30534].
+
+Wed Sep 22 00:52:44 2010 WATANABE Hirofumi <eban@ruby-lang.org>
+
+ * lib/rdoc/ri/store.rb (save_cache): remove duplicate entries.
+
+Wed Sep 22 00:00:05 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_f_pathname): Pathname() translated
+ from pathname.rb.
+
+Tue Sep 21 22:18:30 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * tool/mkconfig.rb: fixed build problem on mswin64 introduced in r29278.
+
+Tue Sep 21 02:42:35 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * test/pathname/test_pathname.rb (TestPathname#test_mkdir): fix typo.
+
+Mon Sep 20 23:23:05 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (bracket): get rid of scanning at the end of the pattern
+ string, not to raise an exception while globbing command line.
+ [ruby-core:32478]
+
+Mon Sep 20 11:25:49 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (Init_pathname): Pathname#=~ undefinition
+ translated from pathname.rb.
+
+Mon Sep 20 02:34:11 2010 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (check_rounding_mode, BigDecimal_mode):
+ raise ArgumentError instead of TypeError passing invalid modes.
+
+ * test/bigdecimal/test_bigdecimal.rb (test_mode, test_round):
+ change against the above modifications.
+
+Sun Sep 19 22:08:39 2010 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * lib/mkmf.rb (try_link): rdoc
+ (try_compile): ditto
+ (try_cpp): ditto
+ (try_func): ditto
+ (try_var): ditto
+ (try_run): ditto
+ (egrep_cpp): ditto
+
+Sun Sep 19 20:43:33 2010 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * configure.in (--disable-install-doc): disables capi too, in addition
+ to rdoc.
+ (--disable-install-rdoc): a new option for disabling only rdoc.
+ (--disable-install-capi): a new option for disabling only capi.
+
+Sun Sep 19 20:37:45 2010 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * common.mk (clean): removes all documents on cleaning.o
+ (CAPIOUT): new variable.
+ (clean-capi, distclean-capi, realclean-capi): new targets
+
+ * Makefile.in (clean-capi, distclean-capi, realclean-capi): ditto.
+
+ * win32/Makefile.sub (clean-capi, distclean-capi, realclean-capi):
+ ditto.
+
+Sun Sep 19 13:44:24 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (LIBRUBY_SO): fix an oversight of replace
+ RUBY_INSTALL_NAME with RUBY_SO_NAME. a patch from Jeremy Evans
+ at [ruby-core:32474].
+
+Sun Sep 19 07:48:20 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_unlink): Pathname#unlink and
+ Pathname#delete translated from pathname.rb.
+
+Sun Sep 19 06:06:07 2010 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (check_rounding_mode): added for
+ converting symbol to rounding mode number.
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_mode, BigDecimal_round):
+ support to specify rounding mode by symbol.
+
+ * test/bigdecimal/test_bigdecimal.rb (test_mode, test_round):
+ add tests for above changes.
+
+Sun Sep 19 05:14:35 2010 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c: fix rounding algorithms for half-down
+ and half-even. This change is based on the patch created by Matthew
+ Willson, the reporter of this bug. [Bug #3803] [ruby-core:32136]
+
+ * test/bigdecimal/test_bigdecimal.rb: add tests for above changes.
+
+Sat Sep 18 20:09:51 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_each_entry): Pathname#each_entry
+ translated from pathname.rb.
+
+Fri Sep 17 23:44:07 2010 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/xpath_parser.rb, test/rexml/test_xpath.rb:
+ add missing method availability check. [ruby-core:32447]
+ Reported by Wiebe Cazemier. Thanks!!!
+
+Fri Sep 17 23:23:26 2010 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_sax.rb: don't use thread and sleep to avoid slow test.
+
+Fri Sep 17 23:10:44 2010 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_core.rb: enable.
+
+Fri Sep 17 22:46:02 2010 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/: untabify.
+
+Fri Sep 17 22:29:56 2010 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/: fix fixture data path. All REXML tests are worked.
+
+Fri Sep 17 22:15:15 2010 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/test_listener.rb: remove needless codes.
+
+Fri Sep 17 22:12:23 2010 Kouhei Sutou <kou@cozmixng.org>
+
+ * test/rexml/: import REXML tests from
+ http://www.germane-software.com/repos/rexml/trunk/test/.
+ Many tests are failed temporary. I'll fix them quickly. Sorry.
+
+Fri Sep 17 16:48:49 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * test/io/console/test_io_console.rb (TestIO_Console::helper):
+ PTY.open is not guaranteed to work. On my machine opening a
+ pty is prohibited via process control group. On those cases
+ exceptions shall occur, and that doesn't mean our fault.
+ Skip those tests on such situations.
+
+Fri Sep 17 08:30:27 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/tracer.rb: count only non-internal libraries in stack trace,
+ ignoring custom_require. [ruby-core:31858]
+
+Fri Sep 17 02:18:41 2010 Akinori MUSHA <knu@iDaemons.org>
+
+ * tool/mkconfig.rb: Fix build with m4 1.4.15 generating duplicate
+ lines in config.status. According to nobu, the mswin32 port may
+ depend on the piece of code in question, so the behavior is left
+ unchanged on mswin32.
+
+Thu Sep 16 23:47:59 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_opendir): Pathname#opendir translated
+ from pathname.rb.
+
+Thu Sep 16 21:40:37 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::GlobOption): merged RejectOption.
+
+ * test/runner.rb: utilize GlobOption.
+
+Thu Sep 16 21:31:24 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/rdoc/ri/driver.rb (RDoc::RI::Driver.setup_options)
+ (RDoc::RI::Driver.fixup_options): split from process_args.
+ libraries should not parse ARGV inside, since it's a task of
+ applications, not libraries.
+
+Thu Sep 16 21:02:30 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/rdoc/ri/paths.rb (RDoc::RI::Paths.each): HOMEDIR can be nil
+ if $HOME is unset.
+
+Thu Sep 16 14:50:42 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * test/ruby/test_file_exhaustive.rb (TestFileExhaustive::test_expand_path):
+ ENV["HOME"] might not be set. On those cases without it an
+ exception raises here, which effectively disables later
+ tests on this method.
+
+Thu Sep 16 08:30:28 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * sprintf.c (rb_f_sprintf): fix rdoc. pointed out by Tomoyuki
+ Chikanaga at [ruby-core:32395], and a patch from Daniel
+ Bovensiepen at [ruby-core:32403].
+
+Thu Sep 16 08:27:36 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/etc/extconf.rb: use expanded sysconfdir with empty DESTDIR.
+ [ruby-core:32394]
+
+Thu Sep 16 06:07:24 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_rmdir): Pathname#rmdir translated
+ from pathname.rb.
+
+Thu Sep 16 00:36:25 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/readline/extconf.rb: Remove Readline 6 check because
+ Ruby's license is now GPLv3 compatible. [ruby-core:28736]
+
+Thu Sep 16 00:26:00 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * COPYING: change Ruby's License from a dual license with GPLv2
+ to a dual license with 2-clause BSDL.
+ [ruby-dev:42166] [ruby-core:31971]
+ [ruby-dev:39167] [ruby-core:25272]
+
+ * COPYING.ja: ditto.
+
+ * BSDL: added. this is from The FreeBSD License.
+
+Wed Sep 15 21:07:06 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_mkdir): Pathname#mkdir translated
+ from pathname.rb.
+
+Wed Sep 15 13:37:00 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * test/net/imap/test_imap.rb: "localhost" not guaranteed to
+ resolve to "127.0.0.1". On my machine it is "::1" instead.
+ The problem is, you have to connect to the imaps server via
+ the canonical name written in a server certificate, and that
+ of the server.cert is "localhost". So you have to listen to
+ the address of what "localhost" resolves to. I think this
+ situation cannot be resolved in a handy manner because the
+ test "test_imaps_post_connection_check" is actually
+ expecting to connect to a server via an address other than
+ the CN. On my machine several assertions won't pass because
+ the test cannot connect to the server.
+
+Wed Sep 15 09:12:03 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (rb_io_puts): fix for wide char encoding strings.
+ [ruby-dev:42212]
+
+Wed Sep 15 07:27:52 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_format_m): mentioned about Hash argument. a patch
+ from Daniel Bovensiepen at [ruby-core:32386].
+
+ * sprintf.c (get_hash): ditto, and fix typo.
+
+Wed Sep 15 07:22:20 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_entries): Pathname#entries translated
+ from pathname.rb.
+
+Wed Sep 15 02:13:44 2010 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/fiddle/closure.c : Don't use FFI closure alloc on OpenBSD.
+ Thanks Jeremy Evans! [ruby-core:32384]
+
+Tue Sep 14 20:17:48 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_s_getwd): Pathname.getwd and
+ Pathname.pwd translated from pathname.rb.
+
+Tue Sep 14 05:13:04 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_s_glob): Pathname.glob translated
+ from pathname.rb.
+
+Tue Sep 14 01:24:51 2010 Yutaka Kanemoto <kanemoto@ruby-lang.org>
+
+ * ext/socket/raddrinfo.c (ruby_getaddrinfo__aix): suppress a
+ warning.
+
+Mon Sep 13 20:48:30 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_zero_p): Pathname#zero? translated
+ from pathname.rb.
+
+Mon Sep 13 19:56:50 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/socket/rubysocket.h (__DARWIN_ALIGNBYTES): workaround of a
+ bug in system header of darwin 9. [ruby-core:32341]
+
+Mon Sep 13 18:11:55 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (try_do): fix typo. a patch from Peter Weldon
+ at [ruby-core:32327].
+
+Mon Sep 13 10:12:09 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * util.c (ruby_strtod): reject Float('0x0.').
+ [ruby-dev:42239] Bug #3820
+
+Mon Sep 13 09:23:58 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/openssl/ossl_bn.c (ossl_bn_is_prime): fix comparison
+ with rb_scan_args. Before this fix, OpenSSL::BN#prime?
+ is fully broken. [ruby-dev:42225]
+
+Mon Sep 13 06:45:24 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_writable_real_p):
+ Pathname#writable_real? translated from pathname.rb.
+
+Sun Sep 12 21:21:50 2010 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * lib/date.rb: [ruby-core:32096] Thanks Colin Bartlett.
+
+Sun Sep 12 19:30:27 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_world_writable_p):
+ Pathname#world_writable? translated from pathname.rb.
+
+Sun Sep 12 09:16:06 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_writable_p): Pathname#writable?
+ translated from pathname.rb.
+
+Sun Sep 12 08:36:15 2010 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rlimit_resource_name2int): support more limits:
+ RLIMIT_MSGQUEUE, RLIMIT_NICE, RLIMIT_RTPRIO, RLIMIT_RTTIME and
+ RLIMIT_SIGPENDING.
+ (Init_process): ditto.
+ patch by Run Paint Run Run. [ruby-core:32262]
+
+Sun Sep 12 04:27:13 2010 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rlimit_resource_name2int): use STRCASECMP to avoid
+ ALLOCA_N.
+
+Sat Sep 11 16:47:41 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (ruby_setenv): raise if putenv and SetEnvironmentVariable
+ failed, because of the restriction of the size on Windows.
+ based on a patch from Peter Weldon at [ruby-core:32304]. fix:
+ Bug#3812, [ruby-core:32250]
+
+Sat Sep 11 15:19:57 2010 Eric Hodel <drbrain@segment7.net>
+
+ * lib/webrick/httpauth/digestauth.rb (WEBrick::Config::DigestAuth):
+ Add documentation
+
+ * lib/webrick/config.rb (WEBrick::Config::DigestAuth): Add
+ documentation
+
+Sat Sep 11 12:32:05 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/intern.h (rb_set_kcode, rb_get_kcode): removed
+ zombie prototype declarations. a patch from Eric Hodel
+ at [ruby-core:32305].
+
+Sat Sep 11 06:53:12 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_symlink_p): Pathname#symlink?
+ translated from pathname.rb.
+
+Fri Sep 10 23:03:43 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_sticky_p): Pathname#sticky? translated
+ from pathname.rb.
+
+Fri Sep 10 19:11:13 2010 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+
+ * lib/webrick/httprequest.rb (WEBrick::HTTPRequest#continue): add
+ method for generating HTTP/1.1 100 continue response if the client
+ expects it, otherwise does nothing. Patch by Brian Candler.
+ ref #855.
+
+ * test/webrick/test_httprequest.rb: test added.
+
+Fri Sep 10 17:49:34 2010 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+
+ * ext/openssl/lib/openssl/x509-internal.rb: removed unused local
+ variable.
+
+ * test/openssl/*: less warnings while test running with -w.
+
+Fri Sep 10 16:49:20 2010 Akinori MUSHA <knu@iDaemons.org>
+
+ * class.c (rb_scan_args): Add support for optional keyword
+ argument hash. [ruby-dev:42221] [ruby-dev:38048]
+
+ * README.EXT, README.EXT.ja: Update documentation accordingly.
+
+ * dir.c (dir_initialize): Make use of the new rb_scan_args()
+ feature.
+
+ * io.c (rb_io_s_popen, rb_scan_open_args, rb_io_initialize)
+ (rb_io_s_pipe, open_key_args, io_s_foreach, io_s_readlines)
+ (rb_io_s_read, rb_io_set_encoding): Ditto.
+
+ * transcode.c (str_transcode, econv_args)
+ (econv_primitive_convert): Ditto.
+
+ * ext/zlib/zlib.c (rb_gzreader_initialize): Ditto.
+
+Fri Sep 10 10:33:18 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * random.c (rb_genrand_ulong_limited): renamed from
+ rb_rand_internal and now this is public API.
+
+ * include/ruby/ruby.h (rb_genrand_ulong_limited): added.
+
+ * bignum.c (big_sparse_p): use rb_genrand_ulong_limited.
+
+Fri Sep 10 13:07:22 2010 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+
+ * ext/digest/lib/digest.rb: removed unused exception variable
+ assignment to avoid a warning.
+
+Fri Sep 10 07:29:14 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/etc/etc.c (etc_systmpdir): assume system default tmpdir
+ safe. [ruby-dev:42089]
+
+Fri Sep 10 07:03:23 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_size_p): Pathname#size? translated from
+ pathname.rb.
+
+Fri Sep 10 02:15:29 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/option.c (inspect_peercred): support OpenBSD-current.
+ patch by Jeremy Evans. [ruby-core:32240]
+
+Thu Sep 9 23:25:53 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm.c (vm_backtrace_each): skip allocator frames which have no
+ name. [ruby-core:32231]
+
+Thu Sep 9 22:39:08 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_size): Pathname#size translated from
+ pathname.rb.
+
+Thu Sep 9 22:34:48 2010 wanabe <s.wanabe@gmail.com>
+
+ * compile.c (case_when_optimizable_literal): When float value can be
+ treated as integer, add to table hash of case that way.
+ based on a patch from Ikuo KOBORI. [ruby-dev:42038]
+
+ * insns.def (opt_case_dispatch): ditto.
+
+ * test/ruby/test_case.rb: add tests.
+
+Thu Sep 9 17:15:15 2010 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+
+ * test/net/http/test_https.rb (test_identity_verify_failure): follows
+ the SSL hostname check error message of openssl.
+
+Thu Sep 9 10:44:46 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * test/ruby/test_env.rb (test_aset): OpenBSD acts like NetBSD in
+ that it ignores characters after = in ENV.
+ patched by Jeremy Evans [ruby-core:32184]
+
+Thu Sep 9 09:02:01 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * tool/rbinstall.rb (install?): gemspec filename should include
+ its version. patched by Luis Lavena [ruby-core:32165]
+
+Wed Sep 8 22:46:31 2010 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+
+ * ext/openssl/ossl_ssl.c (ssl_get_error): Thread context switch was
+ blocked on Windows while blocking call for SSLSocket. Need to
+ convert errno for letting rb_io_wait_readable detect EWOULDBLOCK.
+ Patch by arton. ref #3794.
+
+Wed Sep 8 20:56:57 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_setgid_p): Pathname#setgid? translated
+ from pathname.rb.
+
+Wed Sep 8 06:25:41 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_setuid_p): Pathname#setuid? translated
+ from pathname.rb.
+
+Tue Sep 7 21:03:35 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_readable_real_p):
+ Pathname#readable_real? translated from pathname.rb.
+
+Mon Sep 6 23:07:25 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_world_readable_p):
+ Pathname#world_readable? translated from pathname.rb.
+
+Mon Sep 6 11:03:13 2010 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+
+ * Fixed wrong check of missing functions. Patch by Adrian Quark.
+ ref #3400
+ The patch contains following comment:
+ This patch should avoid unnecessary incompatibility with future
+ versions of Openssl. Changes suggested by bmaher_at_amazon.com.
+
+Mon Sep 6 10:46:55 2010 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+
+ * Fixed exception message for SSL post connection check failure. Patch
+ by Paul Betteridge. ref [Bug #3704]
+
+Mon Sep 6 10:31:59 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/readline/readline.c (readline_s_get_line_buffer):
+ Readline.line_buffer should return locale string.
+ [ruby-dev:42184] #3791
+
+Mon Sep 6 09:47:24 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * util.c (ruby_strtod): check there is at least 1 digit after
+ "0x" before ".". [ruby-dev:42183] #3790
+
+Mon Sep 6 09:44:50 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * util.c (ruby_strtod): check integer overflow.
+ [ruby-dev:42180] #3789
+
+Mon Sep 6 06:17:21 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_readable_p): Pathname#readable?
+ translated from pathname.rb.
+
+Sun Sep 5 23:02:34 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_owned_p): Pathname#owned?
+ translated from pathname.rb.
+
+Sat Sep 4 23:48:47 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (rb_file_s_readlink): symlink target should be in
+ filesystem encoding.
+
+Sat Sep 4 10:40:50 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * load.c (ruby_init_ext): export for golfers.
+
+ * vm_core.h (rb_iseq_eval, rb_iseq_compile_with_option): ditto.
+
+Sun May 23 17:29:41 2010 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * common.mk (capi): uses a timestamp file to get rid of
+ generating twice.
+
+Fri Jun 18 01:33:21 2010 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * enc/Makefile.in (realclean): has been missing. necessary
+ for make realclean-enc.
+
+Fri Sep 3 23:51:26 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_socket_p): Pathname#socket?
+ translated from pathname.rb.
+
+Fri Sep 3 06:40:44 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/pty/pty.c (chfunc): pass through exceptions.
+
+ * io.c (rb_io_bufwrite, rb_io_bufread): added.
+
+ * process.c (rb_fork_err): protect from exceptions.
+
+Fri Sep 3 06:16:07 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_pipe_p): Pathname#pipe?
+ translated from pathname.rb.
+
+Fri Sep 3 06:14:40 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/pty/pty.c (chfunc): restore errno from SystemCallError and
+ propagate proper exception to the parent. [ruby-dev:41965]
+
+Thu Sep 2 22:10:38 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_file_p): Pathname#file?
+ translated from pathname.rb.
+
+Thu Sep 2 09:12:02 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_spawn, rb_w32_aspawn): don't forget to free
+ memory.
+
+Thu Sep 2 09:01:13 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (CreateChild): unicodize.
+
+ * win32/win32.c (rb_w32_spawn, rb_w32_aspawn): convert arguments of
+ CreateChild() from ACP to WideChar.
+
+Thu Sep 2 06:53:43 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_directory_p): Pathname#directory?
+ translated from pathname.rb.
+
+Wed Sep 1 22:03:41 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_grpowned_p): Pathname#grpowned?
+ translated from pathname.rb.
+
+Wed Sep 1 17:39:02 2010 Ryan Davis <ryand-ruby@zenspider.com>
+
+ * lib/minitest/*.rb: Imported minitest 1.7.1 r5835.
+ * test/minitest/*.rb: ditto.
+
+Wed Sep 1 16:50:42 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (tr_setup_table): optimized. don't create hash objects
+ when given pattern is ASCII only.
+
+ * string.c (tr_find): ditto.
+
+Wed Sep 1 14:35:29 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * array.c (rb_ary_rotate_m): fix typo of rdoc.
+ patched by Andrei Kulakov [ruby-core:31975]
+
+Wed Sep 1 14:33:36 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * enum.c (enum_zip): fix typo of rdoc.
+ patched by Andrei Kulakov [ruby-core:31974]
+
+Wed Sep 1 12:56:36 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread.c (ruby_suppress_tracing): restore the state and invoke
+ the func with normal state. a patch from Satoshi Shiba <shiba
+ AT rvm.jp> at [ruby-dev:42162]. [ruby-core:31783]
+
+Tue Aug 31 21:10:23 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_exist_p): Pathname#exist? translated
+ from pathname.rb.
+
+Tue Aug 31 17:32:34 2010 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tk/stubs.c: fix [Bug #3771] "VC++ can't make ext/tk with enabling
+ stubs". Thanks, Akio Tajima [ruby-dev:42159].
+
+Tue Aug 31 03:42:14 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (tr_setup_table): fix bug in r29146.
+ Initialize table even if cflag is 0; tr_find see whether
+ del is empty or not.
+
+ * string.c (tr_find): nodel can't be NULL; if NULL, it means
+ it is not specified.
+
+Mon Aug 30 21:29:21 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_executable_real_p):
+ Pathname#executable_real? translated from pathname.rb.
+
+Mon Aug 30 15:00:13 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (tr_setup_table): initialize negating table when
+ negating string is given. [ruby-core:31851]
+
+ * string.c (tr_find): add a sentence for the time when
+ target characters include negating one.
+
+ * string.c (rb_str_count): move definition.
+
+Mon Aug 30 07:32:41 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_executable_p): Pathname#executable?
+ translated from pathname.rb.
+
+Sun Aug 29 23:54:10 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/rdoc/parser/ruby.rb (RDoc#parse_call_parameters): don't
+ include assignment. [Bug #3759], [ruby-dev:42154]
+
+ * lib/rdoc/parser/ruby.rb (RDoc#parse_class): ignore non-constant
+ name singleton class. [Bug #3759], [ruby-dev:42154]
+
+Sun Aug 29 23:25:18 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (rb_get_path_check): clarify error message for
+ ASCII-incompatible path name.
+
+Sun Aug 29 16:02:54 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * common.mk (node_name.inc): remove command option -n and give
+ file as stdin, because IronRuby 1.1 still doesn't support it.
+ So now we can use ir.exe as BASERUBY.
+
+ * tool/node_name.rb: read stdin with while gets.
+
+Sun Aug 29 13:22:43 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm.c (rb_thread_method_id_and_class): curried proc has no
+ method. [ruby-core:31871]
+
+Sun Aug 29 12:51:33 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * load.c (rb_provide_feature): clarify error message for frozen
+ $LOADED_FEATURES. based on a patch from Run Paint Run Run at
+ [ruby-core:31913].
+
+Sun Aug 29 12:19:58 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * load.c (load_failed): should honor encoding. [ruby-core:31915]
+
+Sun Aug 29 09:35:10 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * common.mk (clean): exclude *.inc. [ruby-dev:41931]
+
+ * common.mk (distclean): include *.inc.
+
+ * common.mk (help): change description about clean and distclean.
+
+Sat Aug 29 06:34:52 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_chardev_p): Pathname#chardev?
+ translated from pathname.rb.
+
+Sat Aug 28 17:39:33 2010 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_save_exception_mode,
+ BigDecimal_save_rounding_mode, BigDecimal_save_limit): added.
+
+ * test/bigdecimal/test_bigdecimal.rb: added tests for the above
+ features.
+
+Sat Aug 28 08:11:05 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_blockdev_p): Pathname#blockdev?
+ translated from pathname.rb.
+
+Fri Aug 27 16:20:01 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * string.c (rb_str_prepend): new method by Shota Fukumori (sora_h)
+ [Feature #3765]
+
+Fri Aug 27 15:24:20 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * math.c (math_atan2): you should know that M_PI is not the feature
+ of C90.
+ fixed build failure caused by r29115.
+
+Fri Aug 27 15:26:33 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (null_device): move from io.c.
+
+Fri Aug 27 12:47:44 2010 Kenta Murata <mrkn@mrkn.jp>
+
+ * math.c (math_atan2): change the behavior when x and y are zero.
+ [ruby-dev:42090] [Bug #3736] [ruby-dev:42116]
+
+ * test/ruby/test_math.rb (test_atan2): add tests for the above
+ changes.
+
+Fri Aug 27 12:26:23 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * object.c (rb_obj_class): remove mention of obsolete method.
+ a patch from Run Paint Run Run at [ruby-core:31842].
+
+Fri Aug 27 12:25:03 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (null_device): the name of null device. [ruby-dev:41791]
+
+Fri Aug 27 07:57:34 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_ary_shuffle_bang): bail out from modification during
+ shuffle.
+
+ * array.c (rb_ary_sample): ditto.
+
+Fri Aug 27 05:11:51 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_sysopen): Pathname#sysopen translated
+ from pathname.rb.
+
+Thu Aug 26 22:53:56 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_ary_shuffle): rdoc fix. argument name was missing.
+ a patch from Run Paint Run Run at [ruby-core:31848].
+
+Thu Aug 26 21:49:46 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_readlines): Pathname#readlines
+ translated from pathname.rb.
+
+Thu Aug 26 10:37:00 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * regint.h (OnigStackIndex): the type should be intptr_t.
+ Original Oniguruma assumes the size of long and that of void *
+ are equal, but it's not true on LLP64 platform: mswin64.
+ originally patched by shintaro kuwamoto [ruby-dev:42133]
+
+Thu Aug 26 10:38:11 2010 Yutaka Kanemoto <kanemoto@ruby-lang.org>
+
+ * test/dl/test_base.rb: AIX does not have dynamically loadable lib[cm].
+
+ * test/fiddle/helper.rb: AIX does not have dynamically loadable lib[cm].
+
+Thu Aug 26 09:49:50 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_ary_shuffle_bang): check number of argument.
+
+Tue Aug 26 09:11:40 2010 Kenta Murata <mrkn@mrkn.jp>
+
+ * ext/bigdecimal/bigdecimal.c (Init_bigdecimal,
+ rmpd_set_thread_local_exception_mode, VpGetException,
+ VpSetException): thread-local exception mode.
+
+ * ext/bigdecimal/bigdecimal.c (Init_bigdecimal,
+ rmpd_set_thread_local_precision_limit, VpGetPrecLimit,
+ VpSetPrecLimit): thread-local precision limit.
+
+ * ext/bigdecimal/bigdecimal.c (Init_bigdecimal,
+ rmpd_set_thread_local_rounding_mode, VpGetRoundMode,
+ VpSetRoundMode, VpException, VpInternalRound):
+ thread-local rounding mode.
+
+ * ext/bigdecimal/bigdecimal.c (BigDecimal_mode, BigDecimal_round,
+ VpIsRoundMode, VpGetRoundMode, VpSetRoundMode, VpActiveRound,
+ VpMidRound, VpLeftRound), ext/bigdecimal/bigdecimal.h:
+ use unsigned short for rounding mode.
+
+ * test/bigdecimal/test_bigdecimal.rb (test_mode): add test for
+ setting rounding mode.
+
+ * test/bigdecimal/test_bigdecimal.rb (test_thread_local_mode):
+ add test for setting mode thread-locally.
+
+Thu Aug 26 07:29:54 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_ary_{shuffle_bang,sample}): use Random class object.
+
+ * random.c (try_get_rnd): use default_rand for Random as same as
+ singleton methods.
+
+ * random.c (rb_random_real): check the range of result.
+
+Wed Aug 25 22:11:11 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_binread): Pathname#binread translated
+ from pathname.rb.
+
+Wed Aug 25 03:42:43 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/dl/cfunc.c (rb_dlcfunc_call): workaround for VC9 for x64.
+ reported by kuwamoto shintaro in [ruby-dev:42125].
+
+Tue Aug 24 23:28:50 2010 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * .gitignore: updated.
+
+Tue Aug 24 22:07:28 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/pathname/pathname.c (path_read): Pathname#read translated from
+ pathname.rb.
+
+Tue Aug 24 10:11:04 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in: read API version from include/ruby/version.h.
+
+ * {bcc,win}32/setup.mak (-version-): ditto.
+
+ * version.h (RUBY_LIB_VERSION): use API version numbers.
+
+Tue Aug 24 07:07:28 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_ary_shuffle_bang, rb_ary_sample): add optional
+ argument random. [ruby-dev:41923] [EXPERIMENTAL]
+
+ * random.c (rb_random_{int32,real,bytes}): fallback to normal
+ method invocation.
+
+Tue Aug 24 06:08:10 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/version.h (RUBY_API_VERSION_*): renamed and moved
+ from version.h. [ruby-dev:42103]
+
+Tue Aug 24 05:58:18 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ChangeLog: flushed. [ruby-dev:42050]
+
Tue Aug 24 01:14:58 2010 Kenta Murata <mrkn@mrkn.jp>
* ext/bigdecimal/bigdecimal.c (BigDecimal_to_f): to_f must underflow
@@ -69282,7 +81433,7 @@ Mon Nov 8 22:20:19 2004 Dave Thomas <dave@pragprog.com>
Mon Nov 8 00:14:13 2004 WATANABE Hirofumi <eban@ruby-lang.org>
- * configure.in: add setup for mignw32 cross compiling.
+ * configure.in: add setup for mingw32 cross compiling.
[ruby-talk:119413]
Sun Nov 7 23:49:26 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
diff --git a/doc/NEWS-1.9.3 b/doc/NEWS-1.9.3
new file mode 100644
index 0000000000..f512fd8691
--- /dev/null
+++ b/doc/NEWS-1.9.3
@@ -0,0 +1,304 @@
+# -*- rd -*-
+= NEWS
+
+This document is a list of user visible feature changes made between
+releases except for bug fixes.
+
+Note that each entry is kept so brief that no reason behind or
+reference information is supplied with. For a full list of changes
+with all sufficient information, see the ChangeLog file.
+
+== Changes since the 1.9.2 release
+=== License
+
+* Ruby's License is changed from a dual license with GPLv2
+ to a dual license with 2-clause BSDL.
+
+=== C API updates
+
+* rb_scan_args() is enhanced with support for option hash argument
+ extraction.
+
+* ruby_vm_at_exit() added. This enables extension libs to hook a VM
+ termination.
+
+=== Library updates (outstanding ones only)
+
+* builtin classes
+
+ * ARGF
+ * new methods:
+ * ARGF.print
+ * ARGF.printf
+ * ARGF.putc
+ * ARGF.puts
+ * ARGF.read_nonblock
+ * ARGF.to_write_io
+ * ARGF.write
+
+ * Array
+ * extended method:
+ * Array#pack supports endian modifiers
+
+ * Bignum
+ * Multiplication algorithm for Bignums with a large number of digits over
+ 150 BDIGITs is changed in order to reduce its calculation time.
+ Now such large Bignums are multiplied by using Toom-3 algorithm.
+
+ * Encoding
+ * new encodings:
+ * CP950
+ * CP951
+ * UTF-16
+ * UTF-32
+ * change alias:
+ * SJIS is Windows-31J
+
+ * File
+ * new constant:
+ * File::NULL
+ name of NULL device.
+ * File::DIRECT
+ name of O_DIRECT.
+
+ * IO
+ * extended method:
+ * IO#putc supports multibyte characters
+ * new methods:
+ * IO#advise
+ * IO.write(name, string, [offset] )
+ Write `string` to file `name`.
+ Opposite with File.read.
+ * IO.binwrite(name, string, [offset] )
+ binary version of IO.write.
+
+ * Kernel
+ * move #__id__ to BasicObject.
+ * extended method:
+ * Kernel#rand supports range argument
+
+ * Module
+ * new methods:
+ * Module#private_constant
+ * Module#public_constant
+
+ * Random
+ * extended method:
+ * Random.rand supports range argument
+
+ * String
+ * extended method:
+ * String#unpack supports endian modifiers
+ * new method:
+ * String#prepend
+ * String#byteslice
+
+ * Time
+ * extended method:
+ * Time#strftime supports %:z and %::z.
+
+ * Process
+ * Process#maxgroups and Process#maxgroups= now raise NotImplementedError if
+ the platform don't support supplementary groups concept.
+
+* bigdecimal
+ * BigDecimal#power and BigDecimal#** support non-integral exponent.
+
+ * Kernel.BigDecimal and BigDecimal.new now accept instances of Integer,
+ Rational, and Float. If you pass a Rational or a Float to them, you must
+ specify the precision to produce the digits of a BigDecimal.
+
+ * The behavior of BigDecimal#coerce with a Rational is changed. It uses
+ the precision of the receiver BigDecimal to produce the digits of a
+ BigDecimal from the given Rational.
+
+* date
+
+ * Accepts flonum explicitly with limitations.
+ * If the given offset is flonum, DateTime assumes its precision is
+ at most second.
+
+ DateTime.new(2001,2,3,0,0,0,3.0/24) ==
+ DateTime.new(2001,2,3,0,0,0,'+03:00')
+ #=> true
+
+ * If the given operand for -/+ is flonum, DateTime assumes its
+ precision is at most nanosecond.
+
+ DateTime.new(2001,2,3) + 0.5 == DateTime.new(2001,2,3,12)
+ #=> true
+
+ * Precision of offset is always at most second.
+
+ Rational('0.5') == Rational('0.500001') #=> false
+ DateTime.new(2001,2,3,0,0,0,Rational('0.5')) ==
+ DateTime.new(2001,2,3,0,0,0,Rational('0.500001'))
+ #=> true
+
+ * Ignores long offset and far reform day (with warning).
+
+ * Now accepts only:
+
+ -1<=offset<=1 (-24:00..+24:00)
+ 2298874<=start<=2426355 or -/+oo
+ (proleptic Gregorian/Julian mean -/+oo)
+
+ * A method strftime cannot produce huge output (same as Time's one).
+
+ * Even though Date/DateTime can handle far dates, the following causes
+ an exception.
+
+ DateTime.new(1<<10000).strftime('%Y') # Errno::ERANGE
+
+ * Changed the format of inspect.
+ * Changed the format of marshal (but, can load old dumps).
+
+* io/console
+ * new methods:
+ * IO#noecho {|io| }
+ * IO#echo=
+ * IO#echo?
+ * IO#raw {|io| }
+ * IO#raw!
+ * IO#getch
+ * IO#winsize
+ * IO.console
+
+* matrix
+ * new classes:
+ * Matrix::EigenvalueDecomposition
+ * Matrix::LUPDecomposition
+ * new methods:
+ * Matrix#diagonal?
+ * Matrix#eigen
+ * Matrix#eigensystem
+ * Matrix#hermitian?
+ * Matrix#lower_triangular?
+ * Matrix#lup
+ * Matrix#lup_decomposition
+ * Matrix#normal?
+ * Matrix#orthogonal?
+ * Matrix#permutation?
+ * Matrix#round
+ * Matrix#symmetric?
+ * Matrix#unitary?
+ * Matrix#upper_triangular?
+ * Matrix#zero?
+ * Vector#magnitude, #norm
+ * Vector#normalize
+ * extended methods:
+ * Matrix#each and #each_with_index can iterate on a subset of the elements
+ * Matrix#find_index returns [row, column] and can iterate on a subset
+ of the elements
+ * Matrix#** implements Numeric exponents (using the eigensystem)
+ * Matrix.zero can build rectangular matrices
+
+* minitest
+ * Minitest has been updated to version 2.2.2.
+ * For full details, see https://github.com/seattlerb/minitest/blob/master/History.txt
+
+* net/http
+ * SNI (Server Name Indication) supported for HTTPS.
+
+ * Allow to configure to wait server returning '100 continue' response
+ before sending HTTP request body. Set Net::HTTP#continue_timeout AND pass
+ 'expect' => '100-continue' to a extra HTTP header.
+
+ For example, the following code sends HTTP header and waits for getting
+ '100 continue' response before sending HTTP request body. When 0.5 [sec]
+ timeout occurs or the server send '100 continue', the client sends HTTP
+ request body.
+ http.continue_timeout = 0.5
+ http.request_post('/continue', 'body=BODY', 'expect' => '100-continue')
+
+ * new method:
+ * Net::HTTPRequest#set_form: Added to support
+ both application/x-www-form-urlencoded and multipart/form-data.
+
+* openssl
+ * PKey::RSA and PKey::DSA now use the generic X.509 encoding scheme
+ (e.g. used in a X.509 certificate's Subject Public Key Info) when
+ exporting public keys to DER or PEM. Backward compatibility is
+ ensured by (already existing) fallbacks during creation.
+ * OpenSSL::ASN1::Constructive#new and OpenSSL::ASN1::Primitive#new
+ (and the constructors of their sub-classes) will no longer force
+ tagging to be set to :EXPLICIT when tag and/or tag_class are passed
+ as parameters. tagging must be set explicitly.
+ * Support for infinite length encodings via infinite_length attribute.
+ * OpenSSL::PKey.read( file | string [, pwd] ) allows to read arbitrary
+ public/private keys in DER-/PEM-encoded form with an optional password
+ for encrypted PEM encodings.
+ * Add new method OpenSSL::X509::Name#hash_old as a wrapper of
+ X509_NAME_hash_old() defined from OpenSSL 1.0.0. It returns OpenSSL 0.9.8
+ compatible hash value.
+
+* optparse
+ * support for bash/zsh completion.
+
+* Rake
+ * Rake has been upgraded from 0.8.7 to 0.9.2.1. For full release notes see
+ https://github.com/jimweirich/rake/blob/master/CHANGES
+
+* RDoc
+ * RDoc has been upgraded from 2.5.8 to 3.8. For full release notes see
+ http://docs.seattlerb.org/rdoc/History_txt.html
+
+* rexml
+ * Support Ruby native encoding mechanism and iconv dependency is dropped.
+
+* RubyGems
+ * RubyGems has been upgraded to version 1.8.5.1. For full release notes see
+ http://rubygems.rubyforge.org/rubygems-update/History_txt.html
+
+* stringio
+ * extended method:
+ * StringIO#set_encoding can get 2nd argument and optional hash.
+
+* test/unit
+ * New arguments:
+ * -j N, --jobs=N: Allow run N testcases at once.
+ * --jobs-status: Show status of jobs when parallel running.
+ * --no-retry: Don't retry testcases which failed when parallel running.
+ * --ruby=RUBY: path to ruby for job(worker) process. optional.
+ * --hide-skip: Hide skip messages. You'll see the number of skips at end of
+ test result.
+
+* uri
+ * new methods:
+ * URI::Generic#hostname
+ * URI::Generic#hostname=
+
+* webrick
+ * new method:
+ * WEBrick::HTTPRequest#continue for generating '100 continue' response.
+ * new logging directive:
+ * %{remote}p for remote (client) port number.
+
+* yaml
+ * The default YAML engine is now Psych. You may downgrade to syck by setting
+ YAML::ENGINE.yamler = 'syck'.
+
+* zlib
+ * new methods:
+ * Zlib.deflate
+ * Zlib.inflate
+
+* FileUtils
+ * extended method:
+ * FileUtils#chmod supports symbolic mode argument.
+
+=== Language changes
+
+* Regexps now support Unicode 6.0. (new characters and scripts)
+
+* [experimental] Regexps now support Age property.
+ Unlike Perl, current implementation takes interpretation of the
+ interpretation of UTS #18.
+ http://www.unicode.org/reports/tr18/
+
+* Turning on/off indentation warnings with directives.
+ ("# -*- warn-indent: true -*-" / "# -*- warn-indent: false -*-")
+
+=== Compatibility issues (excluding feature bug fixes)
+
+ None
diff --git a/doc/etc.rd.ja b/doc/etc.rd.ja
index 39a1efbff1..b36e05c994 100644
--- a/doc/etc.rd.ja
+++ b/doc/etc.rd.ja
@@ -1,75 +1,75 @@
# etc.rd.ja - -*- mode: rd; coding: euc-jp; -*- created at: Fri Jul 14 00:47:15 JST 1995
=begin
-= Etc(⥸塼)
+= Etc(モジュール)
-¹ԤƤOSξ뤿Υ⥸塼롥饹˥󥯥롼
-ƻȤȤǤ롥
+実行しているOSからの情報を得るためのモジュール.クラスにインクルード
+して使うこともできる.
== Module Function
--- getlogin
- ʬlogin֤̾줬Ԥgetpwuid()Ѥ
- ɤ
+ 自分のlogin名を返す.これが失敗した場合はgetpwuid()を用いると
+ 良い.
--- getpwnam(name)
- /etc/passwdե(뤤DBMեNISǡ١)
- name̾passwdȥ֤ͤpasswd¤
- ΤǰʲΥФġ
+ /etc/passwdファイル(あるいはDBMファイルやNISデータベース)を検
+ 索し,nameの名前を持つpasswdエントリを返す.戻り値はpasswd構造
+ 体で以下のメンバを持つ.
struct passwd
- name # 桼̾(ʸ)
- passwd # ѥ(ʸ)
- uid # 桼ID()
- gid # 롼ID()
- gecos # gecosե(ʸ)
- dir # ۡǥ쥯ȥ(ʸ)
- shell # 󥷥(ʸ)
- # ʹߤΥФϥƥˤäƤ󶡤ʤ
- change # ѥѹ()
- quota # ()
- age # ()
- class # 桼饹(ʸ)
- comment # (ʸ)
- expire # ͭ()
+ name # ユーザ名(文字列)
+ passwd # パスワード(文字列)
+ uid # ユーザID(整数)
+ gid # グループID(整数)
+ gecos # gecosフィールド(文字列)
+ dir # ホームディレクトリ(文字列)
+ shell # ログインシェル(文字列)
+ # 以降のメンバはシステムによっては提供されない.
+ change # パスワード変更時間(整数)
+ quota # クォータ(整数)
+ age # エージ(整数)
+ class # ユーザアクセスクラス(文字列)
+ comment # コメント(文字列)
+ expire # アカウント有効期限(整数)
end
- ܺ٤getpwnam(3)򻲾ȤΤȡ
+ 詳細はgetpwnam(3)を参照のこと.
--- getpwuid([uid])
- uid桼IDȤpasswdȥ֤ͤgetpwnam()
- ƱͤǤ롥άˤgetuid()ͤѤ롥ܺ٤
- getpwuid(3)򻲾ȤΤȡ
+ uidをユーザIDとするpasswdエントリを返す.戻り値はgetpwnam()と
+ 同様である.引数を省略した場合にはgetuid()の値を用いる.詳細は
+ getpwuid(3)を参照のこと.
--- getgrgid(gid)
- /etc/groupե(뤤ϡgetpwnam)򸡺gid򥰥롼
- IDȤ륰롼ץȥ֤ͤgroup¤Τǰʲ
- Фġ
+ /etc/groupファイル(あるいは…getpwnam参照)を検索し,gidをグルー
+ プIDとするグループエントリを返す.戻り値はgroup構造体で以下の
+ メンバを持つ.
struct group
- name # 롼̾(ʸ)
- passwd # 롼פΥѥ(ʸ)
- gid # 롼ID()
- mem # 롼ץ̾
+ name # グループ名(文字列)
+ passwd # グループのパスワード(文字列)
+ gid # グループID(整数)
+ mem # グループメンバ名の配列
end
- ܺ٤getgrgid(3)򻲾ȤΤȡ
+ 詳細はgetgrgid(3)を参照のこと.
--- getgrnam(name)
- nameȤ̾Υ롼ץȥ֤ͤgetgrgid()Ʊ
- ͤǤ롥ܺ٤getgrnam(3)򻲾ȡ
+ nameという名前のグループエントリを返す.戻り値はgetgrgid()と同
+ 様である.詳細はgetgrnam(3)を参照.
--- group
- ƤΥ롼ץȥ˥뤿Υƥ졼
+ 全てのグループエントリを順にアクセスするためのイテレータ.
--- passwd
- Ƥpasswdȥ˥뤿Υƥ졼
+ 全てのpasswdエントリを順にアクセスするためのイテレータ.
=end
diff --git a/doc/forwardable.rd.ja b/doc/forwardable.rd.ja
index 48186b111f..6a5ff2e236 100644
--- a/doc/forwardable.rd.ja
+++ b/doc/forwardable.rd.ja
@@ -5,11 +5,11 @@
=begin
= Forwardable
-饹Ф᥽åɤΰѾǽޤ.
+クラスに対しメソッドの委譲機能を定義します.
-== Ȥ
+== 使い方
-饹ФextendƻȤޤ.
+クラスに対してextendして使います.
class Foo
extend Forwardable
@@ -23,58 +23,58 @@
f.gets
f.content_at(1)
-== ᥽å
+== メソッド
--- Forwardable#def_instance_delegators(accessor, *methods)
- ((|methods|))Ϥ줿᥽åɤΥꥹȤ((|accessor|))Ѿ
- 褦ˤޤ.
+ ((|methods|))で渡されたメソッドのリストを((|accessorに|))委譲する
+ ようにします.
--- Forwardable#def_instance_delegator(accessor, method, ali = method)
- ((||method|))Ϥ줿᥽åɤ((|accessor|))˰Ѿ褦ˤ
- ޤ. ((|ali|))ȤϤ줿Ȥ, ᥽å((|ali|))Ƥ
- 줿Ȥˤ, ((|accessor|))Ф((|method|))ƤӽФޤ.
+ ((||method|))で渡されたメソッドを((|accessor|))に委譲するようにし
+ ます. ((|ali|))が引数として渡されたときは, メソッド((|ali|))が呼ば
+ れたときには, ((|accessor|))に対し((|method|))を呼び出します.
--- Forwardable#def_delegators(accessor, *methods)
- ((|Forwardable#def_instance_delegators|))̾Ǥ.
+ ((|Forwardable#def_instance_delegators|))の別名です.
--- Forwardable#def_delegator(accessor, method, ali = method)
- ((|Forwardable#def_instance_delegator|))̾Ǥ.
+ ((|Forwardable#def_instance_delegator|))の別名です.
= SingleForwardable
-֥ȤФ, ᥽åɤΰѾǽޤ.
+オブジェクトに対し, メソッドの委譲機能を定義します.
-== Ȥ
+== 使い方
-֥ȤФ((|extend|))ƻȤޤ.
+オブジェクトに対して((|extend|))して使います.
g = Goo.new
g.extend SingleForwardable
g.def_delegator("@out", :puts)
g.puts ...
-== ᥽å
+== メソッド
--- SingleForwardable#def_singleton_delegators(accessor, *methods)
- ((|methods|))Ϥ줿᥽åɤΥꥹȤ((|accessor|))˰Ѿ
- 褦ˤޤ.
+ ((|methods|))で渡されたメソッドのリストを((|accessor|))に委譲する
+ ようにします.
--- SingleForwardable#def_singleton_delegator(accessor, method, ali = method)
- ((|method|))Ϥ줿᥽åɤ((|accessor|))˰Ѿ褦ˤ
- . ((|ali|))ȤϤ줿Ȥ, ᥽å((|ali|))ƤФ
- Ȥˤ, ((|accessor|))Ф((|method|))ƤӽФޤ.
+ ((|method|))で渡されたメソッドを((|accessor|))に委譲するようにしま
+ す. ((|ali|))が引数として渡されたときは, メソッド((|ali|))が呼ばれ
+ たときには, ((|accessor|))に対し((|method|))を呼び出します.
--- SingleForwardable#def_delegators(accessor, *methods)
- ((|SingleForwardable#def_singleton_delegators|))̾Ǥ.
+ ((|SingleForwardable#def_singleton_delegators|))の別名です.
--- SingleForwardable#def_delegator(accessor, method, ali = method)
- ((|SingleForwardable#def_singleton_delegator|))̾Ǥ.
+ ((|SingleForwardable#def_singleton_delegator|))の別名です.
=end
diff --git a/doc/globals.rdoc b/doc/globals.rdoc
new file mode 100644
index 0000000000..379acea7cf
--- /dev/null
+++ b/doc/globals.rdoc
@@ -0,0 +1,61 @@
+# -*- mode: rdoc; coding: utf-8; fill-column: 74; -*-
+
+== Pre-defined variables
+
+$!:: The exception information message set by 'raise'.
+$@:: Array of backtrace of the last exception thrown.
+$&:: The string matched by the last successful match.
+$`:: The string to the left of the last successful match.
+$':: The string to the right of the last successful match.
+$+:: The highest group matched by the last successful match.
+$1:: The Nth group of the last successful match. May be > 1.
+$~:: The information about the last match in the current scope.
+$=:: The flag for case insensitive, nil by default.
+$/:: The input record separator, newline by default.
+$\:: The output record separator for the print and IO#write. Default is nil.
+$,:: The output field separator for the print and Array#join.
+$;:: The default separator for String#split.
+$.:: The current input line number of the last file that was read.
+$<:: The virtual concatenation file of the files given on command line (or from $stdin if no files were given).
+$>:: The default output for print, printf. $stdout by default.
+$_:: The last input line of string by gets or readline.
+$0:: Contains the name of the script being executed. May be assignable.
+$*:: Command line arguments given for the script sans args.
+$$:: The process number of the Ruby running this script.
+$?:: The status of the last executed child process.
+$::: Load path for scripts and binary modules by load or require.
+$":: The array contains the module names loaded by require.
+$DEBUG:: The status of the -d switch.
+$FILENAME:: Current input file from $<. Same as $<.filename.
+$LOAD_PATH:: The alias to the $:.
+$stderr:: The current standard error output.
+$stdin:: The current standard input.
+$stdout:: The current standard output.
+$VERBOSE:: The verbose flag, which is set by the -v switch.
+$-0:: The alias to $/.
+$-a:: True if option -a is set. Read-only variable.
+$-d:: The alias to $DEBUG.
+$-F:: The alias to $;.
+$-i:: In in-place-edit mode, this variable holds the extension, otherwise nil.
+$-I:: The alias to $:.
+$-l:: True if option -l is set. Read-only variable.
+$-p:: True if option -p is set. Read-only variable.
+$-v:: The alias to $VERBOSE.
+$-w:: True if option -w is set.
+
+== Pre-defined global constants
+
+TRUE:: The typical true value.
+FALSE:: The false itself.
+NIL:: The nil itself.
+STDIN:: The standard input. The default value for $stdin.
+STDOUT:: The standard output. The default value for $stdout.
+STDERR:: The standard error output. The default value for $stderr.
+ENV:: The hash contains current environment variables.
+ARGF:: The alias to the $<.
+ARGV:: The alias to the $*.
+DATA:: The file object of the script, pointing just after __END__.
+RUBY_VERSION:: The ruby version string (VERSION was deprecated).
+RUBY_RELEASE_DATE:: The release date string.
+RUBY_PLATFORM:: The platform identifier.
+
diff --git a/doc/irb/irb-tools.rd.ja b/doc/irb/irb-tools.rd.ja
index 7711f96e08..3c95faeb8a 100644
--- a/doc/irb/irb-tools.rd.ja
+++ b/doc/irb/irb-tools.rd.ja
@@ -1,70 +1,70 @@
-irbϢޤޥɤȥ饤֥
+irb関連おまけコマンドとライブラリ
$Release Version: 0.7.1 $
$Revision$
by Keiju ISHITSUKA(Nihon Rational Co.,Ltd.)
=begin
-:ޥ:
+:コマンド:
* rtags -- ruby tags command
-:ؿ饤֥:
+:関数ライブラリ:
* xmp -- irb version of gotoken xmp-function
-:饹饤֥:
+:クラスライブラリ:
* frame.rb -- frame tracer
* completion.rb -- irb completor
= rtags
-rtagsemacsڤviѤ, TAGեĤ륳ޥɤǤ.
+rtagsはemacs及びvi用の, TAGファイルをつくるコマンドです.
-== Ȥ
+== 使い方
rtags [-vi] file....
-ȥǥ쥯ȥemacsѤTAGSե뤬Ǥޤ. -viץ
-ĤˤviѤtagsեޤ.
+カレントディレクトリにemacs用のTAGSファイルができます. -viオプションを
+つけた時にはvi用のtagsファイルを作成します.
-emacsξ, ̾etags.elΤޤ޻Ȥޤ. ǽʤΤ,
+emacsの場合, 通常のetags.elがそのまま使えます. 検索可能なのは,
-* 饹
-* ᥽å
-* ðۥ᥽å
+* クラス
+* メソッド
+* 特異メソッド
* alias
-* attr줿(ѥ᡼ܥ뤫ʸƥ˸¤)
-* attr_XXX줿(ѥ᡼ܥ뤫ʸƥ˸¤)
+* attrで宣言されたアクセサ(パラメータがシンボルか文字列リテラルに限る)
+* attr_XXXで宣言されたアクセサ(パラメータがシンボルか文字列リテラルに限る)
-Ǥ.
+です.
-CʤɤǻȤäƤΤȰ㤦Τ, ץ꡼˴ؤʬ,
+Cなどで使っているのと違うのは, コンプリーションに関する部分で,
-ؿ̾,
+関数名は,
- ؿ̾(
+ 関数名(
-饹,
+クラスは,
- ::饹̾::....::饹̾
+ ::クラス名::....::クラス名
-᥽åɤ,
+メソッドは,
- ::饹̾::....::饹̾#᥽å̾
+ ::クラス名::....::クラス名#メソッド名
-ðۥ᥽å(饹᥽å)
+特異メソッド(クラスメソッド)は
- ::饹̾::....::饹̾.᥽å̾
+ ::クラス名::....::クラス名.メソッド名
-ǥץ꡼ԤʤȤǤ.
+でコンプリーションを行なうところです.
= xmp.rb
-Ȥxmpξ̸ߴСǤ. , ˽ŤΤǤȤxmp
-бǤʤ, ѤɤǤ礦.
+ごとけんxmpの上位互換バージョンです. ただ, 非常に重いのでごとけんxmpで
+は対応できない時に, 使用すると良いでしょう.
-== Ȥ
+== 使い方
-=== ؿȤƻȤ.
+=== 関数として使う.
require "irb/xmp"
xmp <<END
@@ -77,10 +77,10 @@ CʤɤǻȤäƤΤȰ㤦Τ, ץ꡼˴ؤʬ,
foo
==>1
-=== XMP󥹥󥹤Ѥ.
+=== XMPインスタンスを用いる.
-ξ, XMPƥȾĤΤ, ѿͤʤɤݻƤ
-ޤ.
+この場合は, XMPがコンテキスト情報を持つので, 変数の値などを保持してい
+ます.
require "irb/xmp"
xmp = XMP.new
@@ -99,50 +99,50 @@ CʤɤǻȤäƤΤȰ㤦Τ, ץ꡼˴ؤʬ,
foo
==>1
-== ƥȤ˴ؤ
+== コンテキストに関して
-XMP᥽åɷΥƥȤ, ƤӽФΥƥȤɾޤ.
-Ū˥ƥȤꤹȤΥƥȤɾޤ.
+XMPメソッド群のコンテキストは, 呼び出す前のコンテキストで評価されます.
+明示的にコンテキストを指定するとそのコンテキストで評価します.
-:
+例:
xmp "foo", an_binding
-::
-ޥåɤˤбƤޤ.
+:注:
+マルチスレッドには対応していません.
= frame.rb
-߼¹Υե졼갷Υ饹Ǥ.
+現在実行中のフレーム情報を取り扱うためのクラスです.
* IRB::Frame.top(n = 0)
- 夫nܤΥƥȤФޤ. n0Ǿ̤ˤʤޤ.
+ 上からn番目のコンテキストを取り出します. nは0が最上位になります.
* IRB::Frame.bottom(n = 0)
- nܤΥƥȤФޤ. n0Dz̤ˤʤޤ.
+ 下からn番目のコンテキストを取り出します. nは0が最下位になります.
* IRB::Frame.sender
- ˤʤäƤ륪֥ȤФޤ. Ȥ, Υ᥽
- ɤƤӽФ¦selfΤȤǤ.
+ センダになっているオブジェクトを取り出します. センダとは, そのメソッ
+ ドを呼び出した側のselfのことです.
-::
-set_trace_funcѤRubyμ¹Ԥȥ졼Ƥޤ. ޥåɤ
-бƤޤ.
+:注:
+set_trace_funcを用いてRubyの実行をトレースしています. マルチスレッドに
+は対応していません.
= completion.rb
-irbcompletionǽ󶡤ΤǤ.
+irbのcompletion機能を提供するものです.
-== Ȥ
+== 使い方
% irb -r irb/completion
-Ȥ뤫, ~/.irbrc
+とするか, ~/.irbrc 中に
require "irb/completion"
-Ƥ. irb¹ require "irb/completion" Ƥ褤Ǥ.
+を入れてください. irb実行中に require "irb/completion" してもよいです.
-irb¹ (TAB) 򲡤ȥץ졼󤷤ޤ.
+irb実行中に (TAB) を押すとコンプレーションします.
-ȥåץ٥(TAB)򲡤Ȥ٤Ƥιʸ, 饹, ᥽åɤθ䤬
-ޤ. 䤬ͣʤд䴰ޤ.
+トップレベルで(TAB)を押すとすべての構文要素, クラス, メソッドの候補がで
+ます. 候補が唯一ならば完全に補完します.
irb(main):001:0> in
in inspect instance_eval
@@ -153,8 +153,8 @@ irb¹ (TAB) 򲡤ȥץ졼󤷤ޤ.
irb(main):002:0> foo = Object.new
#<Object:0x4027146c>
- ((|ѿ̾.|))θ(TAB)򲡤, Υ֥ȤΥ᥽åɰǤ
- .
+ ((|変数名.|))の後に(TAB)を押すと, そのオブジェクトのメソッド一覧がでま
+ す.
irb(main):003:0> foo.
foo.== foo.frozen? foo.protected_methods
diff --git a/doc/irb/irb.rd.ja b/doc/irb/irb.rd.ja
index 6e3abd7b3c..6c213a178c 100644
--- a/doc/irb/irb.rd.ja
+++ b/doc/irb/irb.rd.ja
@@ -3,23 +3,23 @@ irb -- interactive ruby
$Revision$
by Keiju ISHITSUKA(keiju@ruby-lang.org)
=begin
-= irbȤ?
+= irbとは?
-irbinteractive rubyάǤ. rubyμɸϤñ/¹Ԥ
-ΥġǤ.
+irbはinteractive rubyの略です. rubyの式を標準入力から簡単に入力/実行する
+ためのツールです.
-= ư
+= 起動
% irb
-ǹԤʤޤ.
+で行ないます.
-= Ȥ
+= 使い方
-irbλȤ, RubyΤäƤФäƴñǤ. Ūˤ irb
-ޥɤ¹ԤǤ. irb¹Ԥ, ʲΤ褦ʥץ
-ȤɽƤޤ. , rubyμƲ. 뤷Ǽ¹
-ޤ.
+irbの使い方は, Rubyさえ知っていればいたって簡単です. 基本的には irb と
+いうコマンドを実行するだけです. irbを実行すると, 以下のようなプロンプ
+トが表れてきます. 後は, rubyの式を入れて下さい. 式が完結した時点で実行
+されます.
dim% irb
irb(main):001:0> 1+2
@@ -32,55 +32,55 @@ irbλȤ, RubyΤäƤФäƴñǤ. Ūˤ irb
nil
irb(main):007:0>
-ޤ, irbReadline⥸塼ˤбƤޤ. Readline⥸塼뤬
-󥹥ȡ뤵Ƥˤ, ȤΤɸưˤʤޤ.
+また, irbはReadlineモジュールにも対応しています. Readlineモジュールが
+インストールされている時には, それを使うのが標準の動作になります.
-= ޥɥץ
+= コマンドオプション
irb.rb [options] file_name opts
options:
- -f ~/.irbrc ɤ߹ޤʤ.
- -m bc⡼(ʬ, η׻Ǥ)
- -d $DEBUG trueˤ(ruby -d Ʊ)
- -Kc ruby -KcƱ
- -r load-module ruby -r Ʊ.
- --verbose 줫¹ԤԤɽ(ǥե)
- --noverbose 줫¹ԤԤɽʤ
- --echo ¹Է̤ɽ(ǥե)
- --noecho ¹Է̤ɽʤ
- --inspect ̽ϤinspectѤ(bc⡼ɰʳϥǥե).
- --noinspect ̽ϤinspectѤʤ.
- --readline readline饤֥Ѥ.
- --noreadline readline饤֥Ѥʤ. ǥեȤư,
- inf-ruby-modeʳreadline饤֥Ѥ褦
- Ȥ.
+ -f ~/.irbrc を読み込まない.
+ -m bcモード(分数, 行列の計算ができる)
+ -d $DEBUG をtrueにする(ruby -d と同じ)
+ -Kc ruby -Kcと同じ
+ -r load-module ruby -r と同じ.
+ --verbose これから実行する行を表示する(デフォルト)
+ --noverbose これから実行する行を表示しない
+ --echo 実行結果を表示する(デフォルト)
+ --noecho 実行結果を表示しない
+ --inspect 結果出力にinspectを用いる(bcモード以外はデフォルト).
+ --noinspect 結果出力にinspectを用いない.
+ --readline readlineライブラリを利用する.
+ --noreadline readlineライブラリを利用しない. デフォルトの動作は,
+ inf-ruby-mode以外でreadlineライブラリを利用しよう
+ とする.
--prompt prompt-mode
--prompt-mode prompt-mode
- ץץȥ⡼ɤؤޤ. Ƥ
- ץȥ⡼ɤ, default, simple, xmp, inf-ruby
- ѰդƤޤ. ǥեȤdefaultץץȥ⡼
- ɤˤʤäƤޤ.
+ プロンプトモードを切替えます. 現在定義されているプ
+ ロンプトモードは, default, simple, xmp, inf-rubyが
+ 用意されています. デフォルトはdefaultプロンプトモー
+ ドになっています.
- --inf-ruby-mode emacsinf-ruby-modeѤΥץץɽԤʤ.
- ˻꤬ʤ¤, readline饤֥ϻȤʤʤ.
+ --inf-ruby-mode emacsのinf-ruby-mode用のプロンプト表示を行なう. 特
+ に指定がない限り, readlineライブラリは使わなくなる.
--simple-prompt
- ˥ץʥץץȤѤ⡼ɤǤ.
- --noprompt ץץɽԤʤʤ.
- --tracer ޥɼ¹Ի˥ȥ졼Ԥʤ.
+ 非常にシンプルなプロンプトを用いるモードです.
+ --noprompt プロンプト表示を行なわない.
+ --tracer コマンド実行時にトレースを行なう.
--back-trace-limit n
- Хåȥ졼ɽХåȥ졼Ƭ n,
- nԤʤ. ǥեȤ16
- --irb_debug n irbΥǥХåǥХå٥nꤹ(Ѥ
- ̵Ǥ礦).
- -v, --version irbΥСɽ
+ バックトレース表示をバックトレースの頭から n, 後ろ
+ からnだけ行なう. デフォルトは16
+ --irb_debug n irbのデバッグデバッグレベルをnに設定する(利用しな
+ い方が無難でしょう).
+ -v, --version irbのバージョンを表示する
-= ե졼
+= コンフィギュレーション
-irbư``~/.irbrc''ɤ߹ߤޤ. ⤷¸ߤʤ,
-``.irbrc'', ``irb.rc'', ``_irbrc'', ``$irbrc''νloadߤޤ.
+irb起動時に``~/.irbrc''を読み込みます. もし存在しない場合は,
+``.irbrc'', ``irb.rc'', ``_irbrc'', ``$irbrc''の順にloadを試みます.
-ץꤹ, ʲΥޥɤǤǥեȤư
-Ǥޤ.
+オプションを設定する代わりに, 以下のコマンドでもデフォルトの動作を設定
+できます.
IRB.conf[:IRB_NAME]="irb"
IRB.conf[:MATH_MODE]=false
@@ -101,43 +101,43 @@ irbư``~/.irbrc''ɤ߹ߤޤ. ⤷¸ߤʤ,
IRB.conf[:DEBUG_LEVEL]=0
IRB.conf[:VERBOSE]=true
-== ץץȤ
+== プロンプトの設定
-ץץȤ򥫥ޥˤ,
+プロンプトをカスタマイズしたい時には,
IRB.conf[:PROMPT]
-Ѥޤ. 㤨, .irbrcDzΤ褦ʼ򵭽Ҥޤ:
+を用います. 例えば, .irbrcの中で下のような式を記述します:
- IRB.conf[:PROMPT][:MY_PROMPT] = { # ץץȥ⡼ɤ̾
- :PROMPT_I => nil, # ̾Υץץ
- :PROMPT_N => nil, # ³ԤΥץץ
- :PROMPT_S => nil, # ʸʤɤη³ԤΥץץ
- :PROMPT_C => nil, # ³ƤΥץץ
- :RETURN => " ==>%s\n" # ꥿Υץץ
+ IRB.conf[:PROMPT][:MY_PROMPT] = { # プロンプトモードの名前
+ :PROMPT_I => nil, # 通常のプロンプト
+ :PROMPT_N => nil, # 継続行のプロンプト
+ :PROMPT_S => nil, # 文字列などの継続行のプロンプト
+ :PROMPT_C => nil, # 式が継続している時のプロンプト
+ :RETURN => " ==>%s\n" # リターン時のプロンプト
}
-ץץȥ⡼ɤꤷˤ,
+プロンプトモードを指定したい時には,
irb --prompt my-prompt
-ǤΥץץȥ⡼ɤǵưޤ. ޤ, .irbrc˲򵭽ҤƤ
-OKǤ.
+でそのプロンプトモードで起動されます. または, .irbrcに下式を記述しても
+OKです.
IRB.conf[:PROMPT_MODE] = :MY_PROMPT
-PROMPT_I, PROMPT_N, PROMPT_S, PROMPT_C, եޥåȤꤷޤ.
+PROMPT_I, PROMPT_N, PROMPT_S, PROMPT_Cは, フォーマットを指定します.
- %N ưƤ륳ޥ̾Ϥ.
- %m main֥(self)to_sǽϤ.
- %M main֥(self)inspectƽϤ.
- %l ʸΥפɽ(", ', /, ], `]'%wλ)
- %NNi ǥȤΥ٥ɽ. NNϿprintf%NNdƱ.
- άǽ
- %NNn ֹɽޤ.
+ %N 起動しているコマンド名が出力される.
+ %m mainオブジェクト(self)がto_sで出力される.
+ %M mainオブジェクト(self)がinspectされて出力される.
+ %l 文字列中のタイプを表す(", ', /, ], `]'は%wの中の時)
+ %NNi インデントのレベルを表す. NNは数字が入りprintfの%NNdと同じ. 省
+ 略可能
+ %NNn 行番号を表します.
%% %
-㤨, ǥեȤΥץץȥ⡼ɤ:
+例えば, デフォルトのプロンプトモードは:
IRB.conf[:PROMPT_MODE][:DEFAULT] = {
:PROMPT_I => "%N(%m):%03n:%i> ",
@@ -147,175 +147,175 @@ PROMPT_I, PROMPT_N, PROMPT_S, PROMPT_C, եޥåȤꤷޤ.
:RETURN => "%s\n"
}
-ȤʤäƤޤ.
+となっています.
-RETURN, ߤΤȤprintfǤ. ͤѤ뤫Τޤ.
+RETURNは, 現在のところprintf形式です. 将来仕様が変わるかも知れません.
-== irb
+== サブirbの設定
-ޥɥ饤󥪥ץ󤪤IRB.conf()irbưΥǥեȤ
-Τ, `5. ޥ'ˤconfǸ̤()irb꤬
-褦ˤʤäƤޤ.
+コマンドラインオプションおよびIRB.confは(サブ)irb起動時のデフォルトの
+設定を決めるもので, `5. コマンド'にあるconfで個別の(サブ)irbの設定がで
+きるようになっています.
-IRB.conf[:IRB_RC]procꤵƤ, irbưˤ
-procirbΥƥȤȤƸƤӽФޤ. ˤäƸ̤Υ
-irbȤѤ뤳ȤǤ褦ˤʤޤ.
+IRB.conf[:IRB_RC]にprocが設定されていると, サブirbを起動する時にその
+procをirbのコンテキストを引数として呼び出します. これによって個別のサ
+ブirbごとに設定を変えることができるようになります.
-= ޥ
+= コマンド
-irbĥޥɤ, ñ̾Ƭ`irb_'Ĥ̾ξ
-ޤ. , ñ̾override줿ΤǤ.
+irb拡張コマンドは, 簡単な名前と頭に`irb_'をつけた名前と両方定義されて
+います. これは, 簡単な名前がoverrideされた時のためです.
--- exit, quit, irb_exit
- λ.
- irbξ, Υirbλ.
+ 終了する.
+ サブirbの場合, そのサブirbを終了する.
--- conf, irb_context
- irbθߤɽ. ѹ, conf˥å뤳
- ȤˤäƹԤʤ.
+ irbの現在の設定を表示する. 設定の変更は, confにメッセージを送るこ
+ とによって行なえる.
--- conf.eval_history = N
- ¹Է̤Υҥȥ굡ǽ.
- nnnil nn>0 ǤФοҥȥˤ롣nn==0λ
- ̵¤˵롢nilȥҥȥ굡ǽϤ(ǥե).
+ 実行結果のヒストリ機能の設定.
+ nnは整数かnilで nn>0 であればその数だけヒストリにためる。nn==0の時は
+ 無制限に記憶する、nilだとヒストリ機能はやめる(デフォルト).
--- Conf.back_trace_limit
- Хåȥ졼ɽХåȥ졼Ƭn, nԤʤ.
- ǥեȤ16
+ バックトレース表示をバックトレースの頭からn, 後ろからnだけ行なう.
+ デフォルトは16
--- conf.debug_level = N
- irbѤΥǥХå٥
+ irb用のデバッグレベルの設定
--- conf.ignore_eof = true/false
- ^DϤ줿ưꤹ. trueλ^D̵뤹, false
- irbλ.
+ ^Dが入力された時の動作を設定する. trueの時は^Dを無視する, falseの
+ 時はirbを終了する.
--- conf.ignore_sigint= true/false
- ^CϤ줿ưꤹ. false, irbλ. true
- ưϰʲΤ褦ˤʤ:
- : ޤϤΤ򥭥󥻥뤷ȥåץ٥.
- ¹: ¹Ԥߤ.
+ ^Cが入力された時の動作を設定する. false時は, irbを終了する. trueの
+ 時の動作は以下のようになる:
+ 入力中: これまで入力したものをキャンセルしトップレベルに戻る.
+ 実行中: 実行を中止する.
--- conf.inf_ruby_mode = true/false
- inf-ruby-modeѤΥץץɽԤʤ. ǥեȤfalse.
+ inf-ruby-mode用のプロンプト表示を行なう. デフォルトはfalse.
--- conf.inspect_mode = true/false/nil
- 󥹥ڥȥ⡼ɤꤹ.
- true: 󥹥ڥȤɽ.
- false: ̾printɽ.
- nil: ̾⡼ɤǤ, inspect modeȤʤ, math⡼ɤλ, non
- inspect modeȤʤ.
+ インスペクトモードを設定する.
+ true: インスペクトして表示する.
+ false: 通常のprintで表示する.
+ nil: 通常モードであれば, inspect modeとなり, mathモードの時は, non
+ inspect modeとなる.
--- conf.math_mode
- ȤΤ. bc⡼(ʬ, η׻Ǥޤ)ɤ?
+ 参照のみ. bcモード(分数, 行列の計算ができます)かどうか?
--- conf.use_loader = true/false
- load/requireirbfileɤ߹ߵǽѤ⡼ɤΥå(ǥե
- ȤѤʤ). Υ⡼ɤIRBΤȿǤ.
+ load/require時にirbのfile読み込み機能を用いるモードのスイッチ(デフォ
+ ルトは用いない). このモードはIRB全体に反映される.
--- conf.prompt_c
- ifľʤ, Ԥ³ƤΥץץ.
+ ifの直後など, 行が継続している時のプロンプト.
--- conf.prompt_i
- ̾Υץץ.
+ 通常のプロンプト.
--- conf.prompt_s
- ʸʤɤɽץץ.
+ 文字列中などを表すプロンプト.
--- conf.rc
- ~/.irbrcɤ߹ɤ?
+ ~/.irbrcを読み込んだかどうか?
--- conf.use_prompt = true/false
- ץץɽ뤫ɤ? ǥեȤǤϥץץȤɽ.
+ プロンプト表示するかどうか? デフォルトではプロンプトを表示する.
--- conf.use_readline = true/false/nil
- readlineȤɤ?
- true: readlineȤ.
- false: readlineȤʤ.
- nil: (ǥե)inf-ruby-modeʳreadline饤֥Ѥ
- Ȥ.
+ readlineを使うかどうか?
+ true: readlineを使う.
+ false: readlineを使わない.
+ nil: (デフォルト)inf-ruby-mode以外でreadlineライブラリを利用しよ
+ うとする.
#
#--- conf.verbose=T/F
-# irb餤ʥåϤ뤫?
+# irbからいろいろなメッセージを出力するか?
--- cws, chws, irb_cws, irb_chws, irb_change_workspace [obj]
- objselfȤ. objά줿Ȥ, home workspace, ʤ
- irbưȤmain objectselfȤ.
+ objをselfとする. objが省略されたときは, home workspace, すなわち
+ irbを起動したときのmain objectをselfとする.
--- pushws, irb_pushws, irb_push_workspace [obj]
- UNIX륳ޥɤpushdƱ.
+ UNIXシェルコマンドのpushdと同様.
--- popws, irb_popws, irb_pop_workspace
- UNIX륳ޥɤpopdƱ.
+ UNIXシェルコマンドのpopdと同様.
--- irb [obj]
- irbΩ. objꤵ줿, objselfȤ.
+ サブirbを立ちあげる. objが指定された時は, そのobjをselfとする.
--- jobs, irb_jobs
- irbΥꥹ
+ サブirbのリスト
--- fg n, irb_fg n
- ꤷirb˥å. n, ΤΤꤹ.
+ 指定したサブirbにスイッチする. nは, 次のものを指定する.
- irbֹ
- å
- irb֥
- self(irb objǵưobj)
+ irb番号
+ スレッド
+ irbオブジェクト
+ self(irb objで起動した時のobj)
--- kill n, irb_kill n
- irbkill. nfgƱ.
+ サブirbをkillする. nはfgと同じ.
--- source, irb_source path
- UNIX륳ޥɤsourceȻƤ. ߤδĶpathΥ
- ץȤɾ.
+ UNIXシェルコマンドのsourceと似ている. 現在の環境上でpath内のスクリ
+ プトを評価する.
--- irb_load path, prev
- Rubyloadirb.
+ Rubyのloadのirb版.
-= ƥѿ
+= システム変数
--- _
- η׻μ¹Է̤ФƤ(ѿ).
+ 前の計算の実行結果を覚えている(ローカル変数).
--- __
- ¹Է̤ФƤ.
- __[line_no]ǡιԤǼ¹Ԥ̤뤳ȤǤ. line_no
- ˤϡǿη̤-line_noη̤뤳ȤǤ.
+ 実行結果の履歴を覚えている.
+ __[line_no]で、その行で実行した結果を得ることができる. line_noが負の
+ 時には、最新の結果から-line_no前の結果を得ることができる.
-=
+= 使用例
-ʲΤ褦ʴǤ.
+以下のような感じです.
dim% ruby irb.rb
- irb(main):001:0> irb # irbΩ
- irb#1(main):001:0> jobs # irbΥꥹ
+ irb(main):001:0> irb # サブirbの立ちあげ
+ irb#1(main):001:0> jobs # サブirbのリスト
#0->irb on main (#<Thread:0x400fb7e4> : stop)
#1->irb#1 on main (#<Thread:0x40125d64> : running)
nil
- irb#1(main):002:0> fg 0 # jobΥå
+ irb#1(main):002:0> fg 0 # jobのスイッチ
nil
irb(main):002:0> class Foo;end
nil
- irb(main):003:0> irb Foo # Foo򥳥ƥȤirb
- # Ω
- irb#2(Foo):001:0> def foo # Foo#foo
+ irb(main):003:0> irb Foo # Fooをコンテキストしてirb
+ # 立ちあげ
+ irb#2(Foo):001:0> def foo # Foo#fooの定義
irb#2(Foo):002:1> print 1
irb#2(Foo):003:1> end
nil
- irb#2(Foo):004:0> fg 0 # job򥹥å
+ irb#2(Foo):004:0> fg 0 # jobをスイッチ
nil
- irb(main):004:0> jobs # jobΥꥹ
+ irb(main):004:0> jobs # jobのリスト
#0->irb on main (#<Thread:0x400fb7e4> : running)
#1->irb#1 on main (#<Thread:0x40125d64> : stop)
#2->irb#2 on Foo (#<Thread:0x4011d54c> : stop)
nil
- irb(main):005:0> Foo.instance_methods # Foo#foo
- # Ƥ
+ irb(main):005:0> Foo.instance_methods # Foo#fooがちゃんと定義さ
+ # れている
["foo"]
- irb(main):006:0> fg 2 # job򥹥å
+ irb(main):006:0> fg 2 # jobをスイッチ
nil
- irb#2(Foo):005:0> def bar # Foo#bar
+ irb#2(Foo):005:0> def bar # Foo#barを定義
irb#2(Foo):006:1> print "bar"
irb#2(Foo):007:1> end
nil
@@ -325,36 +325,36 @@ irbĥޥɤ, ñ̾Ƭ`irb_'Ĥ̾ξ
nil
irb(main):007:0> f = Foo.new
#<Foo:0x4010af3c>
- irb(main):008:0> irb f # FooΥ󥹥󥹤irb
- # Ω.
+ irb(main):008:0> irb f # Fooのインスタンスでirbを
+ # 立ちあげる.
irb#3(#<Foo:0x4010af3c>):001:0> jobs
#0->irb on main (#<Thread:0x400fb7e4> : stop)
#1->irb#1 on main (#<Thread:0x40125d64> : stop)
#2->irb#2 on Foo (#<Thread:0x4011d54c> : stop)
#3->irb#3 on #<Foo:0x4010af3c> (#<Thread:0x4010a1e0> : running)
nil
- irb#3(#<Foo:0x4010af3c>):002:0> foo # f.fooμ¹
+ irb#3(#<Foo:0x4010af3c>):002:0> foo # f.fooの実行
nil
- irb#3(#<Foo:0x4010af3c>):003:0> bar # f.barμ¹
+ irb#3(#<Foo:0x4010af3c>):003:0> bar # f.barの実行
barnil
- irb#3(#<Foo:0x4010af3c>):004:0> kill 1, 2, 3# jobkill
+ irb#3(#<Foo:0x4010af3c>):004:0> kill 1, 2, 3# jobのkill
nil
irb(main):009:0> jobs
#0->irb on main (#<Thread:0x400fb7e4> : running)
nil
- irb(main):010:0> exit # λ
+ irb(main):010:0> exit # 終了
dim%
-= Ѿ
+= 使用上の制限
-irb, ɾǤ(Ĥ)Ǥ༡¹ԤԤʤޤ.
-, rubyľܻȤä, 㴳ۤʤưԤʤ礬ޤ.
+irbは, 評価できる時点(式が閉じた時点)での逐次実行を行ないます. したがっ
+て, rubyを直接使った時と, 若干異なる動作を行なう場合があります.
-餫ˤʤäƤޤ.
+現在明らかになっている問題点を説明します.
-== ѿ
+== ローカル変数の宣言
-rubyǤ, ʲΥץϥ顼ˤʤޤ.
+rubyでは, 以下のプログラムはエラーになります.
eval "foo = 0"
foo
@@ -363,24 +363,24 @@ rubyǤ, ʲΥץϥ顼ˤʤޤ.
---
NameError
-Ȥ, irbѤ
+ところが, irbを用いると
>> eval "foo = 0"
=> 0
>> foo
=> 0
-Ȥʤ, 顼򵯤ޤ. , rubyǽ˥ץΤ򥳥
-ѥ뤷ƥѿꤹ뤫Ǥ. Ф, irbϼ¹Բǽ
-ʤ(Ĥ)ȼưŪɾƤ뤫Ǥ. 嵭Ǥ,
+となり, エラーを起こしません. これは, rubyが最初にスクリプト全体をコン
+パイルしてローカル変数を決定するからです. それに対し, irbは実行可能に
+なる(式が閉じる)と自動的に評価しているからです. 上記の例では,
evel "foo = 0"
-ԤʤäɾԤʤ, λѿ뤿,
-ѿfooƤ뤫Ǥ.
+を行なった時点で評価を行ない, その時点で変数が定義されるため, 次式で
+変数fooは定義されているからです.
-Τ褦rubyirbưΰ㤤褷, begin...enddzä
-ХåŪ˼¹ԤƲ:
+このようなrubyとirbの動作の違いを解決したい場合は, begin...endで括って
+バッチ的に実行して下さい:
>> begin
?> eval "foo = 0"
@@ -390,14 +390,14 @@ rubyǤ, ʲΥץϥ顼ˤʤޤ.
(irb):3
(irb_local_binding):1:in `eval'
-== ҥɥ
+== ヒアドキュメント
-ߤΤȤҥɥȤμԴǤ.
+現在のところヒアドキュメントの実装は不完全です.
-== ܥ
+== シンボル
-ܥǤ뤫ɤȽǤְ㤨뤳Ȥޤ. Ūˤϼλ
-ƤΤ˷³ԤȸʤȤޤ.
+シンボルであるかどうかの判断を間違えることがあります. 具体的には式が完了
+しているのに継続行と見なすことがあります.
=end
diff --git a/doc/pty/README.expect.ja b/doc/pty/README.expect.ja
index db84695ee5..7c0456f24f 100644
--- a/doc/pty/README.expect.ja
+++ b/doc/pty/README.expect.ja
@@ -1,21 +1,21 @@
README for expect
by A. Ito, 28 October, 1998
- Expect饤֥ϡtcl expect ѥåȻ褦ʵǽ
-IO饹ɲäޤ
+ Expectライブラリは,tcl の expect パッケージと似たような機能を
+IOクラスに追加します.
- ɲä᥽åɤλȤϼ̤Ǥ
+ 追加されるメソッドの使い方は次の通りです.
IO#expect(pattern,timeout=9999999)
-pattern String Regexp Υ󥹥󥹡timeout Fixnum
-Υ󥹥󥹤Ǥtimeout ϾάǤޤ
- Υ᥽åɤ֥åʤǸƤФ줿硤ޤ쥷ФǤ
-IO֥Ȥ pattern ˥ޥåѥɤߤޤ
-ޤԤޤѥ줿顤Υѥ˴ؤ
-֤ޤκǽǤϡpattern ˥ޥåޤǤɤߤ
-ޤ줿ƤʸǤ2ܰʹߤǤϡpattern ɽ
-˥󥫡äˡΥ󥫡˥ޥåʬǤ
-⤷ॢȤϡΥ᥽åɤnil֤ޤ
- Υ᥽åɤ֥åդǸƤФ줿ˤϡޥåǤ
-󤬥֥åȤϤ졤֥åɾޤ
+pattern は String か Regexp のインスタンス,timeout は Fixnum
+のインスタンスです.timeout は省略できます.
+ このメソッドがブロックなしで呼ばれた場合,まずレシーバである
+IOオブジェクトから pattern にマッチするパターンが読みこまれる
+まで待ちます.パターンが得られたら,そのパターンに関する配列を
+返します.配列の最初の要素は,pattern にマッチするまでに読みこ
+まれた内容の文字列です.2番目以降の要素は,pattern の正規表現
+の中にアンカーがあった場合に,そのアンカーにマッチする部分です.
+もしタイムアウトが起きた場合は,このメソッドはnilを返します.
+ このメソッドがブロック付きで呼ばれた場合には,マッチした要素の
+配列がブロック引数として渡され,ブロックが評価されます.
diff --git a/doc/pty/README.ja b/doc/pty/README.ja
index ca2a01442a..9b9d306bf7 100644
--- a/doc/pty/README.ja
+++ b/doc/pty/README.ja
@@ -1,76 +1,76 @@
-pty ĥ⥸塼 version 0.3 by A.ito
+pty 拡張モジュール version 0.3 by A.ito
-1. Ϥ
+1. はじめに
-γĥ⥸塼ϡtty (pty) ̤Ŭʥޥɤ
-¹Ԥ뵡ǽ ruby 󶡤ޤ
+この拡張モジュールは,仮想tty (pty) を通して適当なコマンドを
+実行する機能を ruby に提供します.
-2. 󥹥ȡ
+2. インストール
-Τ褦ˤƥ󥹥ȡ뤷Ƥ
+次のようにしてインストールしてください.
(1) ruby extconf.rb
- ¹Ԥ Makefile ޤ
+ を実行すると Makefile が生成されます.
-(2) make; make install ¹ԤƤ
+(2) make; make install を実行してください.
-3. Ǥ뤫
+3. 何ができるか
-γĥ⥸塼ϡPTY Ȥ⥸塼ޤ
-ˤϡΤ褦ʥ⥸塼ؿޤޤƤޤ
+この拡張モジュールは,PTY というモジュールを定義します.その中
+には,次のようなモジュール関数が含まれています.
getpty(command)
spawn(command)
- δؿϡttyݤꤵ줿ޥɤ򤽤βtty
- θǼ¹Ԥ֤ޤͤ3ĤǤʤ
- ǤǽǤϲttyɤ߽ФIO֥ȡ
- 2ܤϽ񤭤िIO֥ȡ3ܤϻҥץΥץ
- IDǤδؿƥ졼ȤƸƤФ줿硤
- Ǥϥ֥åѥ᡼ȤϤ졤ؿΤnil֤ޤ
-
- ҥץλߤˤϡ㳰ȯޤδ
- ֥åѥ᡼դǸƤФ줿ˤϡΥ֥å
- Τ㳰ȯޤҥץ˥Ƥ륹åɤϥ֥
- ȴȤ˽λޤ
+ この関数は,仮想ttyを確保し,指定されたコマンドをその仮想tty
+ の向こうで実行し,配列を返します.戻り値は3つの要素からなる
+ 配列です.最初の要素は仮想ttyから読み出すためのIOオブジェクト,
+ 2番目は書きこむためのIOオブジェクト,3番目は子プロセスのプロ
+ セスIDです.この関数がイテレータとして呼ばれた場合,これらの
+ 要素はブロックパラメータとして渡され,関数自体はnilを返します.
+
+ 子プロセスが終了したり停止した場合には,例外が発生します.この関
+ 数がブロックパラメータ付きで呼ばれた場合には,そのブロックの中で
+ のみ例外が発生します.子プロセスをモニターしているスレッドはブロッ
+ クを抜けるときに終了します.
protect_signal
reset_signal
- ѻͽǤ
+ 廃止予定です.
PTY.open
- ttyݤޥ¦бIO֥Ȥȥ졼¦
- бFile֥Ȥ֤ޤ֥åդǸƤӽФ
- 줿ϡǤϥ֥åѥ᡼ȤϤ졤֥
- ֤줿̤֤ޤޤΥޥIOȥ졼File
- ϡ֥åȴȤ˥ѤߤǤʤХޤ
+ 仮想ttyを確保し,マスター側に対応するIOオブジェクトとスレーブ側に
+ 対応するFileオブジェクトの配列を返します.ブロック付きで呼び出さ
+ れた場合は,これらの要素はブロックパラメータとして渡され,ブロッ
+ クから返された結果を返します.また、このマスターIOとスレーブFile
+ は、ブロックを抜けるときにクローズ済みでなければクローズされます.
PTY.check(pid[, raise=false])
- pidǻꤵ줿ҥץξ֤å¹Ǥnil
- ֤ޤλƤ뤫ߤƤ硢ǤС
- бProcess::Status֥Ȥ֤ޤǤ
- PTY::ChildExited㳰ȯޤ
+ pidで指定された子プロセスの状態をチェックし,実行中であればnilを
+ 返します.終了しているか停止している場合、第二引数が偽であれば、
+ 対応するProcess::Statusオブジェクトを返します。真であれば
+ PTY::ChildExited例外が発生します.
-4. ѤˤĤ
+4. 利用について
-ƣ§ͭޤ
+伊藤彰則が著作権を保有します.
-ץޤϥɥȤ˸ɽѤ줺
-ɽƤ˸¤ꡤïǤ⡤Υեȥ̵
-Ԥ̵ǤѡۡѤǤޤŪϸꤵƤޤ
-
+ソースプログラムまたはドキュメントに元の著作権表示が改変されずに
+表示されている場合に限り,誰でも,このソフトウェアを無償かつ著作
+権者に無断で利用・配布・改変できます.利用目的は限定されていませ
+ん.
-Υץѡۤ¾Υץ˴ط԰٤ˤ
-äʤ»ФƤ⡤ԤϰǤ餤ޤ
+このプログラムの利用・配布その他このプログラムに関係する行為によ
+って生じたいかなる損害に対しても,作者は一切責任を負いません.
-5. Х
+5. バグ報告等
-ХݡȤϴޤޤ
+バグレポートは歓迎します.
aito@ei5sun.yz.yamagata-u.ac.jp
-ޤŻҥ᡼ǥХݡȤ꤯
+まで電子メールでバグレポートをお送りください.
diff --git a/doc/rake/CHANGES b/doc/rake/CHANGES
index 3b1a02b812..1caac6f024 100644
--- a/doc/rake/CHANGES
+++ b/doc/rake/CHANGES
@@ -66,7 +66,7 @@
symbol/string differences. (Patch supplied by Edwin Pratomo)
* Fixed bug with rules involving multiple source (Patch supplied by
- Emanuel Indermhle)
+ Emanuel Indermühle)
* Switched from getoptlong to optparse (patches supplied by Edwin
Pratomo)
diff --git a/doc/re.rdoc b/doc/re.rdoc
index 0dfd8e5164..1c68533a8d 100644
--- a/doc/re.rdoc
+++ b/doc/re.rdoc
@@ -24,6 +24,36 @@ string matches itself.
Specifically, <tt>/st/</tt> requires that the string contains the letter
_s_ followed by the letter _t_, so it matches _haystack_, also.
+== <tt>=~</tt> and Regexp#match
+
+Pattern matching may be achieved by using <tt>=~</tt> operator or Regexp#match
+method.
+
+=== <tt>=~</tt> operator
+
+<tt>=~</tt> is Ruby's basic pattern-matching operator. When one operand is a
+regular expression and the other is a string then the regular expression is
+used as a pattern to match against the string. (This operator is equivalently
+defined by Regexp and String so the order of String and Regexp do not matter.
+Other classes may have different implementations of <tt>=~</tt>.) If a match
+is found, the operator returns index of first match in string, otherwise it
+returns +nil+.
+
+ /hay/ =~ 'haystack' #=> 0
+ 'haystack' =~ /hay/ #=> 0
+ /a/ =~ 'haystack' #=> 1
+ /u/ =~ 'haystack' #=> nil
+
+Using <tt>=~</tt> operator with a String and Regexp the <tt>$~</tt> global
+variable is set after a successful match. <tt>$~</tt> holds a MatchData
+object. Regexp.last_match is equivalent to <tt>$~</tt>.
+
+=== Regexp#match method
+
+#match method return a MatchData object :
+
+ /st/.match('haystack') #=> #<MatchData "st">
+
== Metacharacters and Escapes
The following are <i>metacharacters</i> <tt>(</tt>, <tt>)</tt>,
@@ -111,7 +141,7 @@ matches any character in the Unicode _Nd_ category.
* <tt>/[[:print:]]/</tt> - Like [:graph:], but includes the space character
* <tt>/[[:punct:]]/</tt> - Punctuation character
* <tt>/[[:space:]]/</tt> - Whitespace character (<tt>[:blank:]</tt>, newline,
- carriage return, etc.)
+ carriage return, etc.)
* <tt>/[[:upper:]]/</tt> - Uppercase alphabetical
* <tt>/[[:xdigit:]]/</tt> - Digit allowed in a hexadecimal number (i.e.,
0-9a-fA-F)
@@ -120,7 +150,7 @@ Ruby also supports the following non-POSIX character classes:
* <tt>/[[:word:]]/</tt> - A character in one of the following Unicode
general categories _Letter_, _Mark_, _Number_,
- <i>Connector_Punctuation<i/i>
+ <i>Connector_Punctuation</i>
* <tt>/[[:ascii:]]/</tt> - A character in the ASCII character set
# U+06F2 is "EXTENDED ARABIC-INDIC DIGIT TWO"
@@ -153,7 +183,7 @@ contrast, <i>lazy</i> matching makes the minimal amount of matches
necessary for overall success. A greedy metacharacter can be made lazy by
following it with <tt>?</tt>.
- # Both patterns below match the string. The fist uses a greedy
+ # Both patterns below match the string. The first uses a greedy
# quantifier so '.+' matches '<a><b>'; the second uses a lazy
# quantifier so '.+?' matches '<a>'.
/<.+>/.match("<a><b>") #=> #<MatchData "<a><b>">
@@ -169,7 +199,7 @@ jeopardises the overall match.
Parentheses can be used for <i>capturing</i>. The text enclosed by the
<i>n</i><sup>th</sup> group of parentheses can be subsequently referred to
with <i>n</i>. Within a pattern use the <i>backreference</i>
-<tt>\</tt><i>n</i>; outside of the pattern use
+<tt>\n</tt>; outside of the pattern use
<tt>MatchData[</tt><i>n</i><tt>]</tt>.
# 'at' is captured by the first group of parentheses, then referred to
@@ -220,7 +250,7 @@ quantified as one <i>atomic</i> whole.
The <tt>(?:</tt>...<tt>)</tt> construct provides grouping without
capturing. That is, it combines the terms it contains into an atomic whole
without creating a backreference. This benefits performance at the slight
-expense of readabilty.
+expense of readability.
# The group of parentheses captures 'n' and the second 'ti'. The
# second group is referred to later with the backreference \2
@@ -241,7 +271,7 @@ it matches becomes fixed for the remainder of the match, unless the entire
subexpression must be abandoned and subsequently revisited. In this
way <i>pat</i> is treated as a non-divisible whole. Atomic grouping is
typically used to optimise patterns so as to prevent the regular
-expression engine from backtracking needlesly.
+expression engine from backtracking needlessly.
# The <tt>"</tt> in the pattern below matches the first character of
# the string, then <tt>.*</tt> matches <i>Quote"</i>. This causes the
@@ -419,8 +449,8 @@ characters, <i>anchoring</i> the match to a specific position.
it matches just before newline
* <tt>\z</tt> - Matches end of string
* <tt>\G</tt> - Matches point where last match finished
-* <tt>\b</tt> - Matches word boundaries when outside brackets; backspace
- (0x08) inside brackets
+* <tt>\b</tt> - Matches word boundaries when outside brackets;
+ backspace (0x08) when inside brackets
* <tt>\B</tt> - Matches non-word boundaries
* <tt>(?=</tt><i>pat</i><tt>)</tt> - <i>Positive lookahead</i> assertion:
ensures that the following characters match <i>pat</i>, but doesn't
@@ -473,6 +503,13 @@ expression enclosed by the parentheses.
/a(?i:b)c/.match('aBc') #=> #<MatchData "aBc">
/a(?i:b)c/.match('abc') #=> #<MatchData "abc">
+Options may also be used with <tt>Regexp.new</tt>:
+
+ Regexp.new("abc", Regexp::IGNORECASE) #=> /abc/i
+ Regexp.new("abc", Regexp::MULTILINE) #=> /abc/m
+ Regexp.new("abc # Comment", Regexp::EXTENDED) #=> /abc # Comment/x
+ Regexp.new("abc", Regexp::IGNORECASE | Regexp::MULTILINE) #=> /abc/mi
+
== Free-Spacing Mode and Comments
As mentioned above, the <tt>x</tt> option enables <i>free-spacing</i>
@@ -525,6 +562,40 @@ regexp's encoding can be explicitly fixed by supplying
#=> Encoding::CompatibilityError: incompatible encoding regexp match
(ISO-8859-1 regexp with UTF-8 string)
+== Special global variables
+
+Pattern matching sets some global variables :
+* <tt>$~</tt> is equivalent to Regexp.last_match;
+* <tt>$&</tt> contains the complete matched text;
+* <tt>$`</tt> contains string before match;
+* <tt>$'</tt> contains string after match;
+* <tt>$1</tt>, <tt>$2</tt> and so on contain text matching first, second, etc
+ capture group;
+* <tt>$+</tt> contains last capture group.
+
+Example:
+
+ m = /s(\w{2}).*(c)/.match('haystack') #=> #<MatchData "stac" 1:"ta" 2:"c">
+ $~ #=> #<MatchData "stac" 1:"ta" 2:"c">
+ Regexp.latch_match #=> #<MatchData "stac" 1:"ta" 2:"c">
+
+ $& #=> "stac"
+ # same as m[0]
+ $` #=> "hay"
+ # same as m.pre_match
+ $' #=> "k"
+ # same as m.post_match
+ $1 #=> "ta"
+ # same as m[1]
+ $2 #=> "c"
+ # same as m[2]
+ $3 #=> nil
+ # no third group in pattern
+ $+ #=> "c"
+ # same as m[-1]
+
+These global variables are thread-local and method-local variables.
+
== Performance
Certain pathological combinations of constructs can lead to abysmally bad
@@ -533,8 +604,8 @@ performance.
Consider a string of 25 <i>a</i>s, a <i>d</i>, 4 <i>a</i>s, and a
<i>c</i>.
- s = 'a' * 25 + 'd' 'a' * 4 + 'c'
- #=> "aaaaaaaaaaaaaaaaaaaaaaaaadadadadac"
+ s = 'a' * 25 + 'd' + 'a' * 4 + 'c'
+ #=> "aaaaaaaaaaaaaaaaaaaaaaaaadaaaac"
The following patterns match instantly as you would expect:
@@ -544,7 +615,7 @@ The following patterns match instantly as you would expect:
However, the following pattern takes appreciably longer:
- /(b|a+)*c/ =~ s #=> 32
+ /(b|a+)*c/ =~ s #=> 26
This happens because an atom in the regexp is quantified by both an
immediate <tt>+</tt> and an enclosing <tt>*</tt> with nothing to
@@ -573,10 +644,10 @@ repeatedly so as to satisfy as many of the optional matches as it can
while still matching the mandatory 29. It is plain to us that none of the
optional matches can succeed, but this fact unfortunately eludes Ruby.
-One approach for improving performance is to anchor the match to the
-beginning of the string, thus significantly reducing the amount of
-backtracking needed.
+The best way to improve performance is to significantly reduce the amount of
+backtracking needed. For this case, instead of individually matching 29
+optional <i>a</i>s, a range of optional <i>a</i>s can be matched all at once
+with <i>a{0,29}</i>:
- Regexp.new('\A' 'a?' * 29 + 'a' * 29).match('a' * 29)
- #=> #<MatchData "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa">
+ Regexp.new('a{0,29}' + 'a' * 29) =~ 'a' * 29
diff --git a/doc/shell.rd.ja b/doc/shell.rd.ja
index 33e5a9ed9b..053b11fb99 100644
--- a/doc/shell.rd.ja
+++ b/doc/shell.rd.ja
@@ -5,142 +5,142 @@
=begin
-= Ū
+= 目的
-rubysh/cshΤ褦˥ޥɤμ¹Եڤӥե륿󥰤ڤ˹Ԥ.
-sh/cshʸrubyεǽѤƼ¸.
+ruby上でsh/cshのようにコマンドの実行及びフィルタリングを手軽に行う.
+sh/cshの制御文はrubyの機能を用いて実現する.
-= ʥ饹
+= 主なクラス一覧
== Shell
-Shell֥Ȥϥȥǥ쥯ȥ, ޥɼ¹ԤϤ
-Хѥˤʤޤ.
+Shellオブジェクトはカレントディレクトリを持ち, コマンド実行はそこからの
+相対パスになります.
--- Shell#cwd
--- Shell#dir
--- Shell#getwd
--- Shell#pwd
- ȥǥ쥯ȥ֤
+ カレントディレクトリを返す。
--- Shell#system_path
- ޥɥѥ֤
+ コマンドサーチパスの配列を返す。
--- Shell#umask
- umask֤
+ umaskを返す。
== Filter
-ޥɤμ¹Է̤Ϥ٤FilterȤƤޤ. Enumerableinclude
-Ƥޤ.
+コマンドの実行結果はすべてFilterとしてかえります. Enumerableをincludeし
+ています.
-= ʥ᥽åɰ
+= 主なメソッド一覧
-== ޥ
+== コマンド定義
-OSΥޥɤ¹ԤˤϤޤ, ShellΥ᥽åɤȤޤ.
+OS上のコマンドを実行するにはまず, Shellのメソッドとして定義します.
-) ޥɤʤȤľܼ¹ԤǤShell#systemޥɤ⤢ޤ.
+注) コマンドを定義しなくとも直接実行できるShell#systemコマンドもあります.
--- Shell.def_system_command(command, path = command)
- ShellΥ᥽åɤȤcommandϿޤ.
+ Shellのメソッドとしてcommandを登録します.
- )
+ 例)
Shell.def_system_command "ls"
- ls
+ ls を定義
Shell.def_system_command "sys_sort", "sort"
- sortޥɤsys_sortȤ
+ sortコマンドをsys_sortとして定義
--- Shell.undef_system_command(command)
- commandޤ.
+ commandを削除します.
--- Shell.alias_command(ali, command, *opts) {...}
- commandalias򤷤ޤ.
+ commandのaliasをします.
- )
+ 例)
Shell.alias_command "lsC", "ls", "-CBF", "--show-control-chars"
Shell.alias_command("lsC", "ls"){|*opts| ["-CBF", "--show-control-chars", *opts]}
--- Shell.unalias_command(ali)
- commandaliasޤ.
+ commandのaliasを削除します.
--- Shell.install_system_commands(pre = "sys_")
- system_pathˤƤμ¹ԲǽեShell. ᥽
- ̾ϸΥե̾ƬpreĤΤȤʤ.
+ system_path上にある全ての実行可能ファイルをShellに定義する. メソッ
+ ド名は元のファイル名の頭にpreをつけたものとなる.
-==
+== 生成
--- Shell.new
- ץΥȥǥ쥯ȥ򥫥ȥǥ쥯ȥȤShell
- ֥Ȥޤ.
+ プロセスのカレントディレクトリをカレントディレクトリとするShellオ
+ ブジェクトを生成します.
--- Shell.cd(path)
- path򥫥ȥǥ쥯ȥȤShell֥Ȥޤ.
+ pathをカレントディレクトリとするShellオブジェクトを生成します.
-== ץ
+== プロセス管理
--- Shell#jobs
- 塼󥰤Ƥjobΰ֤.
+ スケジューリングされているjobの一覧を返す.
--- Shell#kill sig, job
- job˥ʥsig
+ jobにシグナルsigを送る
-== ȥǥ쥯ȥ
+== カレントディレクトリ操作
--- Shell#cd(path, &block)
--- Shell#chdir
- ȥǥ쥯ȥpathˤ. ƥ졼ȤƸƤФ줿Ȥˤ
- ֥å¹Τߥȥǥ쥯ȥѹ.
+ カレントディレクトリをpathにする. イテレータとして呼ばれたときには
+ ブロック実行中のみカレントディレクトリを変更する.
--- Shell#pushd(path = nil, &block)
--- Shell#pushdir
- ȥǥ쥯ȥǥ쥯ȥꥹåˤĤ, ȥǥ쥯
- ȥpathˤ. pathά줿Ȥˤ, ȥǥ쥯ȥ
- ǥ쥯ȥꥹåΥȥåפ򴹤. ƥ졼ȤƸƤФ줿
- ˤ, ֥å¹Τpushd.
+ カレントディレクトリをディレクトリスタックにつみ, カレントディレク
+ トリをpathにする. pathが省略されたときには, カレントディレクトリと
+ ディレクトリスタックのトップを交換する. イテレータとして呼ばれたと
+ きには, ブロック実行中のみpushdする.
--- Shell#popd
--- Shell#popdir
- ǥ쥯ȥꥹåݥåפ, 򥫥ȥǥ쥯ȥˤ.
+ ディレクトリスタックからポップし, それをカレントディレクトリにする.
-== ե/ǥ쥯ȥ
+== ファイル/ディレクトリ操作
--- Shell#foreach(path = nil, &block)
- pathեʤ, File#foreach
- pathǥ쥯ȥʤ, Dir#foreach
+ pathがファイルなら, File#foreach
+ pathがディレクトリなら, Dir#foreach
--- Shell#open(path, mode)
- pathեʤ, File#open
- pathǥ쥯ȥʤ, Dir#open
+ pathがファイルなら, File#open
+ pathがディレクトリなら, Dir#open
--- Shell#unlink(path)
- pathեʤ, File#unlink
- pathǥ쥯ȥʤ, Dir#unlink
+ pathがファイルなら, File#unlink
+ pathがディレクトリなら, Dir#unlink
--- Shell#test(command, file1, file2)
--- Shell#[command, file1, file2]
- եƥȴؿtestƱ.
- )
+ ファイルテスト関数testと同じ.
+ 例)
sh[?e, "foo"]
sh[:e, "foo"]
sh["e", "foo"]
@@ -149,75 +149,75 @@ OSΥޥɤ¹ԤˤϤޤ, ShellΥ᥽åɤȤޤ.
--- Shell#mkdir(*path)
- Dir.mkdirƱ(ʣ)
+ Dir.mkdirと同じ(複数可)
--- Shell#rmdir(*path)
- Dir.rmdirƱ(ʣ)
+ Dir.rmdirと同じ(複数可)
-== ޥɼ¹
+== コマンド実行
--- System#system(command, *opts)
- command¹Ԥ.
- )
+ commandを実行する.
+ 例)
print sh.system("ls", "-l")
sh.system("ls", "-l") | sh.head > STDOUT
--- System#rehash
- ϥå夹
+ リハッシュする
--- Shell#transact &block
- ֥åǤshellselfȤƼ¹Ԥ.
- )
+ ブロック中ではshellをselfとして実行する.
+ 例)
sh.transact{system("ls", "-l") | head > STDOUT}
--- Shell#out(dev = STDOUT, &block)
- transactƤӽФη̤dev˽Ϥ.
+ transactを呼び出しその結果をdevに出力する.
-== ޥ
+== 内部コマンド
--- Shell#echo(*strings)
--- Shell#cat(*files)
--- Shell#glob(patten)
--- Shell#tee(file)
- ϼ¹Ԥ, ƤȤFilter֥Ȥ֤ޤ.
+ これらは実行すると, それらを内容とするFilterオブジェクトを返します.
--- Filter#each &block
- ե륿ΰԤĤblockϤ.
+ フィルタの一行ずつをblockに渡す.
--- Filter#<(src)
- srcե륿ϤȤ. src, ʸʤХե, IOǤ
- Ф򤽤ΤޤϤȤ.
+ srcをフィルタの入力とする. srcが, 文字列ならばファイルを, IOであれ
+ ばそれをそのまま入力とする.
--- Filter#>(to)
- srcե륿νϤȤ. to, ʸʤХե, IOǤ
- Ф򤽤Τޤ޽ϤȤ.
+ srcをフィルタの出力とする. toが, 文字列ならばファイルに, IOであれ
+ ばそれをそのまま出力とする.
--- Filter#>>(to)
- srcե륿ɲä. to, ʸʤХե, IOǤ
- 򤽤Τޤ޽ϤȤ.
+ srcをフィルタに追加する. toが, 文字列ならばファイルに, IOであれば
+ それをそのまま出力とする.
--- Filter#|(filter)
- ѥ׷
+ パイプ結合
--- Filter#+(filter)
- filter1 + filter2 filter1νϤθ, filter2νϤԤ.
+ filter1 + filter2 は filter1の出力の後, filter2の出力を行う.
--- Filter#to_a
--- Filter#to_s
-== ȹߥޥ
+== 組込みコマンド
--- Shell#atime(file)
--- Shell#basename(file, *opt)
@@ -239,7 +239,7 @@ OSΥޥɤ¹ԤˤϤޤ, ShellΥ᥽åɤȤޤ.
--- Shell#truncate(file, length)
--- Shell#utime(atime, mtime, *file)
- File饹ˤƱ̾Υ饹᥽åɤƱǤ.
+ これらはFileクラスにある同名のクラスメソッドと同じです.
--- Shell#blockdev?(file)
--- Shell#chardev?(file)
@@ -263,7 +263,7 @@ OSΥޥɤ¹ԤˤϤޤ, ShellΥ᥽åɤȤޤ.
--- Shell#writable_real?(file)
--- Shell#zero?(file)
- FileTest饹ˤƱ̾Υ饹᥽åɤƱǤ.
+ これらはFileTestクラスにある同名のクラスメソッドと同じです.
--- Shell#syscopy(filename_from, filename_to)
--- Shell#copy(filename_from, filename_to)
@@ -273,9 +273,9 @@ OSΥޥɤ¹ԤˤϤޤ, ShellΥ᥽åɤȤޤ.
--- Shell#makedirs(*filenames)
--- Shell#install(filename_from, filename_to, mode)
- FileTools饹ˤƱ̾Υ饹᥽åɤƱǤ.
+ これらはFileToolsクラスにある同名のクラスメソッドと同じです.
- ¾, ʲΤΤꥢƤޤ.
+ その他, 以下のものがエイリアスされています.
--- Shell#cmp <- Shell#compare
--- Shell#mv <- Shell#move
@@ -283,7 +283,7 @@ OSΥޥɤ¹ԤˤϤޤ, ShellΥ᥽åɤȤޤ.
--- Shell#rm_f <- Shell#safe_unlink
--- Shell#mkpath <- Shell#makedirs
-= ץ
+= サンプル
== ex1
diff --git a/enc/Makefile.in b/enc/Makefile.in
index 203a83dbfd..2c15e904dc 100644
--- a/enc/Makefile.in
+++ b/enc/Makefile.in
@@ -20,6 +20,7 @@ ENCSODIR = $(EXTOUT)/$(arch)/enc
TRANSSODIR = $(ENCSODIR)/trans
DLEXT = @DLEXT@
OBJEXT = @OBJEXT@
+LIBEXT = @LIBEXT@
BUILTIN_ENCS = ascii.c us_ascii.c\
unicode.c utf_8.c
@@ -32,7 +33,9 @@ LIBRUBYARG_SHARED = @LIBRUBYARG_SHARED@
LIBRUBYARG_STATIC = $(LIBRUBYARG_SHARED)
empty =
+AR = @AR@
CC = @CC@
+RANLIB = @RANLIB@
OUTFLAG = @OUTFLAG@$(empty)
COUTFLAG = @COUTFLAG@$(empty)
CFLAGS = $(CCDLFLAGS) @CFLAGS@ @ARCH_FLAG@
@@ -48,9 +51,13 @@ LDFLAGS = @LDFLAGS@
LDSHARED = @LDSHARED@
ldflags = $(LDFLAGS)
dldflags = @DLDFLAGS@
+extdldflags = @EXTDLDFLAGS@
archflag = @ARCH_FLAG@
-DLDFLAGS = $(ldflags) $(dldflags) $(archflag)
+DLDFLAGS = $(ldflags) $(dldflags) $(extdldflags) $(archflag)
RUBY = $(MINIRUBY)
+TARGET_NAME_ = $(@F) # BSD make seems unable to deal with @F with substitution
+TARGET_NAME = $(TARGET_NAME_:.@DLEXT@=)
+TARGET_ENTRY = @EXPORT_PREFIX@Init_$(TARGET_NAME)
WORKDIRS = @WORKDIRS@
diff --git a/enc/ascii.c b/enc/ascii.c
index 3d62ec9bf7..72150c037c 100644
--- a/enc/ascii.c
+++ b/enc/ascii.c
@@ -1,8 +1,9 @@
/**********************************************************************
- ascii.c - Oniguruma (regular expression library)
+ ascii.c - Onigmo (Oniguruma-mod) (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2006 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2011 K.Takata <kentkt AT csc DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -45,7 +46,9 @@ OnigEncodingDefine(ascii, ASCII) = {
onigenc_ascii_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match
+ onigenc_always_true_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
ENC_ALIAS("BINARY", "ASCII-8BIT")
ENC_REPLICATE("IBM437", "ASCII-8BIT")
diff --git a/enc/big5.c b/enc/big5.c
index c39329170e..9d7738d8f9 100644
--- a/enc/big5.c
+++ b/enc/big5.c
@@ -299,7 +299,9 @@ OnigEncodingDefine(big5, BIG5) = {
big5_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
big5_left_adjust_char_head,
- big5_is_allowed_reverse_match
+ big5_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
/*
@@ -331,7 +333,9 @@ OnigEncodingDefine(big5_hkscs, BIG5_HKSCS) = {
big5_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
big5_left_adjust_char_head,
- big5_is_allowed_reverse_match
+ big5_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
ENC_ALIAS("Big5-HKSCS:2008", "Big5-HKSCS")
@@ -363,5 +367,7 @@ OnigEncodingDefine(big5_uao, BIG5_UAO) = {
big5_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
big5_left_adjust_char_head,
- big5_is_allowed_reverse_match
+ big5_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
diff --git a/enc/cp949.c b/enc/cp949.c
index 3eb46c976a..bf1c2637a3 100644
--- a/enc/cp949.c
+++ b/enc/cp949.c
@@ -210,7 +210,9 @@ OnigEncodingDefine(cp949, CP949) = {
cp949_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
cp949_left_adjust_char_head,
- cp949_is_allowed_reverse_match
+ cp949_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
/*
* Name: CP949
diff --git a/enc/depend b/enc/depend
index 8e930d5053..9cc14fba44 100644
--- a/enc/depend
+++ b/enc/depend
@@ -1,44 +1,15 @@
-% inplace = File.identical?($srcdir, ".")
+% inplace = File.identical?($top_srcdir, ".")
% workdirs = %w"$(ENCSODIR) $(TRANSSODIR) enc enc/trans"
% CONFIG["WORKDIRS"] = workdirs.join(' ')
-% CONFIG["DLDFLAGS"].sub!(/(\A|\s)(-\S+(?:\s*\w*)?\$\(TARGET\)\S*)/, '\1')
-% dldflags = $2
% enable_shared = CONFIG['ENABLE_SHARED'] == 'yes'
% deffile = (true if /\$\(DEFFILE\)/ =~ CONFIG["LINK_SO"])
-% encs = Dir.open($srcdir) {|d| d.grep(/.+\.c\z/)} - BUILTIN_ENCS
-% encs.each {|e| e.chomp!(".c")}
-% encs.reject! {|e| !ENC_PATTERNS.any? {|p| File.fnmatch?(p, e)}} if !ENC_PATTERNS.empty?
-% encs.reject! {|e| NOENC_PATTERNS.any? {|p| File.fnmatch?(p, e)}}
-% alphanumeric_order = proc {|e| e.scan(/(\d+)|(\D+)/).map {|n,a| a||[n.size,n.to_i]}.flatten}
-% encs = encs.sort_by(&alphanumeric_order)
-% encs.unshift(encs.delete("encdb"))
-% atrans = []
-% trans = Dir.open($srcdir+"/trans") {|d|
-% d.select {|e|
-% if e.chomp!('.trans')
-% atrans << e
-% true
-% elsif e.chomp!('.c')
-% true
-% end
-% }
-% }
-% trans -= BUILTIN_TRANSES
-% atrans -= BUILTIN_TRANSES
-% trans.uniq!
-% atrans = atrans.sort_by(&alphanumeric_order)
-% trans = trans.sort_by(&alphanumeric_order)
-% trans.unshift(trans.delete("transdb"))
-% trans.compact!
-% trans |= atrans
-% trans.map! {|e| "trans/#{e}"}
-% dependencies = encs + trans
+% dependencies = ENCS + TRANS
% cleanlibs = Shellwords.shellwords(CONFIG["cleanlibs"] || "")
% cleanobjs = Shellwords.shellwords(CONFIG["cleanobjs"] || "")
% cleanobjs << "$*.def" if deffile
% rule_subst = CONFIG["RULE_SUBST"] || "%s"
% transvpath = rule_subst.dup.sub!(/\{[^{}]+\}/, '$(TRANSVPATH)/') || "enc/trans/%s"
-% transvpath_prefix = (rule_subst.dup.sub!(/\{[^{}]+\}/, '{$(TRANSVPATH)}') || "") % ""
+% transvpath_prefix = (rule_subst.dup.sub!(/\{[^{}]+\}/, '{$(TRANSVPATH)}') || "%s") % ""
% if File::ALT_SEPARATOR
% pathrep = proc {|path| path.gsub('/', File::ALT_SEPARATOR).gsub(/\$\(([@<?*]\w?|\w+)\)/, "$(\\1:/=\\#{File::ALT_SEPARATOR})")}
% else
@@ -54,31 +25,51 @@ else
''
end %> <%=CONFIG['LIBS']%> $(EXTLIBS)
-ENCOBJS = <%=encs.map {|e|"enc/#{e}.$(OBJEXT)"}.join(" \\\n\t ")%><%="\n" if encs.size>1%>
-ENCSOS = <%=encs.map {|e|"$(ENCSODIR)/#{e}.$(DLEXT)"}.join(" \\\n\t ")%><%="\n" if encs.size>1%>
+ENCOBJS = <%=ENCS.map {|e|"enc/#{e}.$(OBJEXT)"}.join(" \\\n\t ")%><%="\n" if ENCS.size>1%>
+ENCSOS = <%=ENCS.map {|e|"$(ENCSODIR)/#{e}.$(DLEXT)"}.join(" \\\n\t ")%><%="\n" if ENCS.size>1%>
ENCCLEANLIBS = <%=cleanlibs.map {|clean|
clean.gsub(/\$\*(\.\w+)?/) {"$(ENCOBJS#{$1 ? ":.#{CONFIG["OBJEXT"]}=#{$1}" : ""})"}
}.join(" ")%>
ENCCLEANOBJS = <%=cleanobjs.map {|clean|
clean.gsub(/\$\*(\.\w+)?/) {"$(ENCOBJS#{$1 ? ":.#{CONFIG["OBJEXT"]}=#{$1}" : ""})"}
}.join(" ")%>
+LIBENC=enc/libenc.$(LIBEXT)
TRANSVPATH = $(srcdir)/enc/trans
-TRANSCSRCS = <%=atrans.map {|e| transvpath % "#{e}.c"}.join(" \\\n\t ")%><%="\n" if trans.size>1%>
-TRANSOBJS = <%=trans.map {|e|"enc/#{e}.$(OBJEXT)"}.join(" \\\n\t ")%><%="\n" if trans.size>1%>
-TRANSSOS = <%=trans.map {|e|"$(ENCSODIR)/#{e}.$(DLEXT)"}.join(" \\\n\t ")%><%="\n" if trans.size>1%>
+TRANSCSRCS = <%=ATRANS.map {|e| transvpath % "#{e}.c"}.join(" \\\n\t ")%><%="\n" if TRANS.size>1%>
+TRANSOBJS = <%=TRANS.map {|e|"enc/#{e}.$(OBJEXT)"}.join(" \\\n\t ")%><%="\n" if TRANS.size>1%>
+TRANSSOS = <%=TRANS.map {|e|"$(ENCSODIR)/#{e}.$(DLEXT)"}.join(" \\\n\t ")%><%="\n" if TRANS.size>1%>
TRANSCLEANLIBS = <%=cleanlibs.map {|clean|
clean.gsub(/\$\*(\.\w+)?/) {"$(TRANSOBJS#{$1 ? ":.#{CONFIG["OBJEXT"]}=#{$1}" : ""})"}
}.join(" ")%>
TRANSCLEANOBJS = <%=cleanobjs.map {|clean|
clean.gsub(/\$\*(\.\w+)?/) {"$(TRANSOBJS#{$1 ? ":.#{CONFIG["OBJEXT"]}=#{$1}" : ""})"}
}.join(" ")%>
+LIBTRANS=enc/libtrans.$(LIBEXT)
encs: all
+% if MODULE_TYPE == :static
+all: libenc libtrans
+% else
all: enc trans
+%end
+libencs: libenc libtrans
enc: $(ENCSOS)
+libenc: $(LIBENC)
trans: $(TRANSSOS)
+libtrans: $(LIBTRANS)
+
+$(LIBENC): $(ENCOBJS)
+ @$(RM) $@
+ $(ECHO) linking statically-linked encoding library $@
+ $(Q) $(AR) <%=CONFIG['ARFLAGS'] || 'rcu' %> $@ $(ENCOBJS)
+ @-$(RANLIB) $@ 2> /dev/null || true
+$(LIBTRANS): $(TRANSOBJS)
+ @$(RM) $@
+ $(ECHO) linking statically-linked transcoder library $@
+ $(Q) $(AR) <%=CONFIG['ARFLAGS'] || 'rcu' %> $@ $(TRANSOBJS)
+ @-$(RANLIB) $@ 2> /dev/null || true
srcs: $(TRANSCSRCS)
@@ -86,20 +77,23 @@ srcs: $(TRANSCSRCS)
$(ECHO) generating table from $@
$(Q)$(MINIRUBY) "$(srcdir)/tool/transcode-tblgen.rb" -vo "$@" "$<"
-% unless encs.empty? or trans.empty?
+% unless ENCS.empty? or TRANS.empty?
-% unless encs.empty?
+% unless ENCS.empty?
$(ENCOBJS): regenc.h oniguruma.h config.h defines.h
% end
-% unless trans.empty?
+% ENC_DEPS.each do |e, deps|
+enc/<%=e%>.$(OBJEXT): <%=deps.map {|n| rule_subst % n}.join(' ')%>
+% end
+% unless TRANS.empty?
$(TRANSOBJS): ruby.h intern.h config.h defines.h missing.h encoding.h oniguruma.h st.h transcode_data.h
% end
-% atrans.each do |e|
+% ATRANS.each do |e|
% src = "#{e}.trans"
<%=transvpath % "#{e}.c"%>: <%= transvpath % "#{e}.trans"%>
% src = [*IO.read(File.join($srcdir, "trans", src)).scan(/^\s*require\s+[\'\"]([^\'\"]*)/).flatten.map{|c|c+".rb"}]
-<%=transvpath % "#{e}.c"%>: <%= src.map {|e| transvpath % "#{e}"}.join(" ")%> $(srcdir)/tool/transcode-tblgen.rb
+<%=transvpath % "#{e}.c"%>: <%= src.map {|s| transvpath % "#{s}"}.join(" ")%> $(srcdir)/tool/transcode-tblgen.rb
% end
% end
@@ -119,7 +113,6 @@ $(TRANSOBJS): ruby.h intern.h config.h defines.h missing.h encoding.h oniguruma.
$(ECHO) linking <%=mesg%> $(@F)
% cmd = link_so.sub(/\$\(OBJS\)/) {obj}
% base = File.basename(e)
-% cmd.sub!(/(?=\$\(DLDFLAGS\))/) {dldflags.sub(/\$\(TARGET\)/) {base} + " "} if dldflags
% if df
$(Q)echo> <%=df%> EXPORTS
$(Q)echo>> <%=df%> <%=EXPORT_PREFIX%>Init_<%=base%>
@@ -142,7 +135,7 @@ enc/encdb.$(OBJEXT): encdb.h
enc/trans/transdb.$(OBJEXT): transdb.h
clean:
-% %w[$(ENCSOS) $(ENCOBJS) $(ENCCLEANOBJS) $(ENCCLEANLIBS) $(TRANSSOS) $(TRANSOBJS) $(TRANSCLEANOBJS) $(TRANSCLEANLIBS)].each do |clean|
+% %w[$(ENCSOS) $(LIBENC) $(ENCOBJS) $(ENCCLEANOBJS) $(ENCCLEANLIBS) $(TRANSSOS) $(LIBTRANS) $(TRANSOBJS) $(TRANSCLEANOBJS) $(TRANSCLEANLIBS)].each do |clean|
$(Q)$(RM) <%=pathrep[clean]%>
% end
% @ignore_error = $nmake ? '' : ' 2> /dev/null || true'
@@ -150,8 +143,8 @@ clean:
$(Q)$(RM) enc/unicode/name2ctype.h
-$(Q)$(RMDIR) enc/unicode<%=@ignore_error%>
% end
-% workdirs.reverse_each do|dir|
- -$(Q)$(RMDIR) <%=pathrep[dir]%><%=@ignore_error%>
+% workdirs.reverse_each do|d|
+ -$(Q)$(RMDIR) <%=pathrep[d]%><%=@ignore_error%>
% end
clean-srcs:
@@ -160,3 +153,5 @@ clean-srcs:
$(Q)$(RM) enc/unicode/name2ctype.h
-$(Q)$(RMDIR) <%=pathrep['enc/unicode']%><%=@ignore_error%>
-$(Q)$(RMDIR) <%=pathrep['enc']%><%=@ignore_error%>
+
+<%# vim: set ft=eruby noexpandtab ts=8 sw=2 : -%>
diff --git a/enc/emacs_mule.c b/enc/emacs_mule.c
index e75e40b168..275c8f47dc 100644
--- a/enc/emacs_mule.c
+++ b/enc/emacs_mule.c
@@ -334,7 +334,8 @@ OnigEncodingDefine(emacs_mule, Emacs_Mule) = {
onigenc_not_support_get_ctype_code_range,
left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
- 0
+ 0,
+ ONIGENC_FLAG_NONE,
};
ENC_REPLICATE("stateless-ISO-2022-JP", "Emacs-Mule")
diff --git a/enc/encdb.c b/enc/encdb.c
index 958b33504e..32def53aeb 100644
--- a/enc/encdb.c
+++ b/enc/encdb.c
@@ -14,11 +14,13 @@ int rb_encdb_alias(const char *alias, const char *orig);
int rb_encdb_dummy(const char *name);
void rb_encdb_declare(const char *name);
void rb_enc_set_base(const char *name, const char *orig);
+void rb_encdb_set_unicode(int index);
#define ENC_REPLICATE(name, orig) rb_encdb_replicate((name), (orig))
#define ENC_ALIAS(name, orig) rb_encdb_alias((name), (orig))
#define ENC_DUMMY(name) rb_encdb_dummy(name)
#define ENC_DEFINE(name) rb_encdb_declare(name)
#define ENC_SET_BASE(name, orig) rb_enc_set_base((name), (orig))
+#define ENC_DUMMY_UNICODE(name) rb_encdb_set_unicode(ENC_DUMMY(name))
void
Init_encdb(void)
diff --git a/enc/encinit.c.erb b/enc/encinit.c.erb
new file mode 100644
index 0000000000..fd3ade0c4b
--- /dev/null
+++ b/enc/encinit.c.erb
@@ -0,0 +1,26 @@
+/* Copyright 2012 Google Inc. Some Rights Reserved.
+ * Author: yugui@google.com (Yugui Sonoda)
+ */
+#include <stdio.h>
+
+#define init(func, name) { \
+ extern void func(void); \
+ ruby_init_ext(name, func); \
+}
+
+void ruby_init_ext(const char *name, void (*init)(void));
+
+void
+Init_enc(void)
+{
+% ENCS.each do |enc|
+ init(Init_<%= enc %>, "enc/<%= enc %>.so");
+% end
+
+ init(Init_transdb, "enc/trans/transdb.so");
+% TRANS.each do |trans|
+% next if trans == 'trans/transdb'
+ init(Init_trans_<%= File.basename trans %>, "enc/<%= trans %>.so");
+% end
+}
+<%# vim: set ft=eruby sw=2 : -%>
diff --git a/enc/euc_jp.c b/enc/euc_jp.c
index 2666e60ae0..d794145b49 100644
--- a/enc/euc_jp.c
+++ b/enc/euc_jp.c
@@ -1,8 +1,9 @@
/**********************************************************************
- euc_jp.c - Oniguruma (regular expression library)
+ euc_jp.c - Onigmo (Oniguruma-mod) (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2011 K.Takata <kentkt AT csc DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,7 +30,6 @@
#include "regint.h"
-
#define eucjp_islead(c) ((UChar )((c) - 0xa1) > 0xfe - 0xa1)
static const int EncLen_EUCJP[] = {
@@ -114,6 +114,97 @@ static const signed char trans[][0x100] = {
#undef A
#undef F
+static const OnigPairCaseFoldCodes CaseFoldMap[] = {
+ /* Fullwidth Alphabet */
+ { 0xa3c1, 0xa3e1 },
+ { 0xa3c2, 0xa3e2 },
+ { 0xa3c3, 0xa3e3 },
+ { 0xa3c4, 0xa3e4 },
+ { 0xa3c5, 0xa3e5 },
+ { 0xa3c6, 0xa3e6 },
+ { 0xa3c7, 0xa3e7 },
+ { 0xa3c8, 0xa3e8 },
+ { 0xa3c9, 0xa3e9 },
+ { 0xa3ca, 0xa3ea },
+ { 0xa3cb, 0xa3eb },
+ { 0xa3cc, 0xa3ec },
+ { 0xa3cd, 0xa3ed },
+ { 0xa3ce, 0xa3ee },
+ { 0xa3cf, 0xa3ef },
+ { 0xa3d0, 0xa3f0 },
+ { 0xa3d1, 0xa3f1 },
+ { 0xa3d2, 0xa3f2 },
+ { 0xa3d3, 0xa3f3 },
+ { 0xa3d4, 0xa3f4 },
+ { 0xa3d5, 0xa3f5 },
+ { 0xa3d6, 0xa3f6 },
+ { 0xa3d7, 0xa3f7 },
+ { 0xa3d8, 0xa3f8 },
+ { 0xa3d9, 0xa3f9 },
+ { 0xa3da, 0xa3fa },
+
+ /* Greek */
+ { 0xa6a1, 0xa6c1 },
+ { 0xa6a2, 0xa6c2 },
+ { 0xa6a3, 0xa6c3 },
+ { 0xa6a4, 0xa6c4 },
+ { 0xa6a5, 0xa6c5 },
+ { 0xa6a6, 0xa6c6 },
+ { 0xa6a7, 0xa6c7 },
+ { 0xa6a8, 0xa6c8 },
+ { 0xa6a9, 0xa6c9 },
+ { 0xa6aa, 0xa6ca },
+ { 0xa6ab, 0xa6cb },
+ { 0xa6ac, 0xa6cc },
+ { 0xa6ad, 0xa6cd },
+ { 0xa6ae, 0xa6ce },
+ { 0xa6af, 0xa6cf },
+ { 0xa6b0, 0xa6d0 },
+ { 0xa6b1, 0xa6d1 },
+ { 0xa6b2, 0xa6d2 },
+ { 0xa6b3, 0xa6d3 },
+ { 0xa6b4, 0xa6d4 },
+ { 0xa6b5, 0xa6d5 },
+ { 0xa6b6, 0xa6d6 },
+ { 0xa6b7, 0xa6d7 },
+ { 0xa6b8, 0xa6d8 },
+
+ /* Cyrillic */
+ { 0xa7a1, 0xa7d1 },
+ { 0xa7a2, 0xa7d2 },
+ { 0xa7a3, 0xa7d3 },
+ { 0xa7a4, 0xa7d4 },
+ { 0xa7a5, 0xa7d5 },
+ { 0xa7a6, 0xa7d6 },
+ { 0xa7a7, 0xa7d7 },
+ { 0xa7a8, 0xa7d8 },
+ { 0xa7a9, 0xa7d9 },
+ { 0xa7aa, 0xa7da },
+ { 0xa7ab, 0xa7db },
+ { 0xa7ac, 0xa7dc },
+ { 0xa7ad, 0xa7dd },
+ { 0xa7ae, 0xa7de },
+ { 0xa7af, 0xa7df },
+ { 0xa7b0, 0xa7e0 },
+ { 0xa7b1, 0xa7e1 },
+ { 0xa7b2, 0xa7e2 },
+ { 0xa7b3, 0xa7e3 },
+ { 0xa7b4, 0xa7e4 },
+ { 0xa7b5, 0xa7e5 },
+ { 0xa7b6, 0xa7e6 },
+ { 0xa7b7, 0xa7e7 },
+ { 0xa7b8, 0xa7e8 },
+ { 0xa7b9, 0xa7e9 },
+ { 0xa7ba, 0xa7ea },
+ { 0xa7bb, 0xa7eb },
+ { 0xa7bc, 0xa7ec },
+ { 0xa7bd, 0xa7ed },
+ { 0xa7be, 0xa7ee },
+ { 0xa7bf, 0xa7ef },
+ { 0xa7c0, 0xa7f0 },
+ { 0xa7c1, 0xa7f1 },
+};
+
static int
mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc ARG_UNUSED)
{
@@ -138,7 +229,7 @@ mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
int c, i, len;
OnigCodePoint n;
- len = enclen(enc, p, end);
+ len = mbc_enc_len(p, end, enc);
n = (OnigCodePoint )*p++;
if (len == 1) return n;
@@ -154,9 +245,10 @@ static int
code_to_mbclen(OnigCodePoint code, OnigEncoding enc ARG_UNUSED)
{
if (ONIGENC_IS_CODE_ASCII(code)) return 1;
- else if (code > 0xffffff) return 0;
- else if ((code & 0xff0000) >= 0x800000) return 3;
- else if ((code & 0xff00) >= 0x8000) return 2;
+ else if (code > 0x00ffffff)
+ return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE;
+ else if ((code & 0xff808080) == 0x00808080) return 3;
+ else if ((code & 0xffff8080) == 0x00008080) return 2;
else
return ONIGERR_INVALID_CODE_POINT_VALUE;
}
@@ -190,10 +282,87 @@ code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
*p++ = (UChar )(code & 0xff);
#if 1
- if (enclen(enc, buf, p) != (p - buf))
+ if (mbc_enc_len(buf, p, enc) != (p - buf))
return ONIGERR_INVALID_CODE_POINT_VALUE;
#endif
- return (int)(p - buf);
+ return (int )(p - buf);
+}
+
+static int
+apply_all_case_fold(OnigCaseFoldType flag,
+ OnigApplyAllCaseFoldFunc f, void* arg, OnigEncoding enc)
+{
+ return onigenc_apply_all_case_fold_with_map(
+ sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,
+ flag, f, arg);
+}
+
+static OnigCodePoint
+get_lower_case(OnigCodePoint code)
+{
+ if (ONIGENC_IS_IN_RANGE(code, 0xa3c1, 0xa3da)) {
+ /* Fullwidth Alphabet */
+ return (OnigCodePoint )(code + 0x0020);
+ }
+ else if (ONIGENC_IS_IN_RANGE(code, 0xa6a1, 0xa6b8)) {
+ /* Greek */
+ return (OnigCodePoint )(code + 0x0020);
+ }
+ else if (ONIGENC_IS_IN_RANGE(code, 0xa7a1, 0xa7c1)) {
+ /* Cyrillic */
+ return (OnigCodePoint )(code + 0x0030);
+ }
+ return code;
+}
+
+static OnigCodePoint
+get_upper_case(OnigCodePoint code)
+{
+ if (ONIGENC_IS_IN_RANGE(code, 0xa3e1, 0xa3fa)) {
+ /* Fullwidth Alphabet */
+ return (OnigCodePoint )(code - 0x0020);
+ }
+ else if (ONIGENC_IS_IN_RANGE(code, 0xa6c1, 0xa6d8)) {
+ /* Greek */
+ return (OnigCodePoint )(code - 0x0020);
+ }
+ else if (ONIGENC_IS_IN_RANGE(code, 0xa7d1, 0xa7f1)) {
+ /* Cyrillic */
+ return (OnigCodePoint )(code - 0x0030);
+ }
+ return code;
+}
+
+static int
+get_case_fold_codes_by_str(OnigCaseFoldType flag,
+ const OnigUChar* p, const OnigUChar* end,
+ OnigCaseFoldCodeItem items[], OnigEncoding enc)
+{
+ int len;
+ OnigCodePoint code, code_lo, code_up;
+
+ code = mbc_to_code(p, end, enc);
+ if (ONIGENC_IS_ASCII_CODE(code))
+ return onigenc_ascii_get_case_fold_codes_by_str(flag, p, end, items, enc);
+
+ len = mbc_enc_len(p, end, enc);
+ code_lo = get_lower_case(code);
+ code_up = get_upper_case(code);
+
+ if (code != code_lo) {
+ items[0].byte_len = len;
+ items[0].code_len = 1;
+ items[0].code[0] = code_lo;
+ return 1;
+ }
+ else if (code != code_up) {
+ items[0].byte_len = len;
+ items[0].code_len = 1;
+ items[0].code[0] = code_up;
+ return 1;
+ }
+
+ return 0;
}
static int
@@ -201,7 +370,6 @@ mbc_case_fold(OnigCaseFoldType flag,
const UChar** pp, const UChar* end, UChar* lower,
OnigEncoding enc)
{
- int len;
const UChar* p = *pp;
if (ONIGENC_IS_MBC_ASCII(p)) {
@@ -210,12 +378,11 @@ mbc_case_fold(OnigCaseFoldType flag,
return 1;
}
else {
- int i;
+ OnigCodePoint code;
+ int len;
- len = enclen(enc, p, end);
- for (i = 0; i < len; i++) {
- *lower++ = *p++;
- }
+ code = get_lower_case(mbc_to_code(p, end, enc));
+ len = code_to_mbc(code, lower, enc);
(*pp) += len;
return len; /* return byte length of converted char to lower */
}
@@ -234,7 +401,7 @@ left_adjust_char_head(const UChar* start, const UChar* s, const UChar* end, Onig
p = s;
while (!eucjp_islead(*p) && p > start) p--;
- len = enclen(enc, p, end);
+ len = mbc_enc_len(p, end, enc);
if (p + len > s) return (UChar* )p;
p += len;
return (UChar* )(p + ((s - p) & ~1));
@@ -259,15 +426,83 @@ static hash_table_type* PropertyNameTable;
static const OnigCodePoint CR_Hiragana[] = {
1,
+#ifdef ENC_EUC_JIS_2004
+ 0xa4a1, 0xa4fb
+#else
0xa4a1, 0xa4f3
+#endif
}; /* CR_Hiragana */
+#ifdef ENC_EUC_JIS_2004
+static const OnigCodePoint CR_Katakana[] = {
+ 5,
+ 0x8ea6, 0x8eaf, /* JIS X 0201 Katakana */
+ 0x8eb1, 0x8edd, /* JIS X 0201 Katakana */
+ 0xa5a1, 0xa5fe,
+ 0xa6ee, 0xa6fe,
+ 0xa7f2, 0xa7f5,
+}; /* CR_Katakana */
+#else
static const OnigCodePoint CR_Katakana[] = {
3,
+ 0x8ea6, 0x8eaf, /* JIS X 0201 Katakana */
+ 0x8eb1, 0x8edd, /* JIS X 0201 Katakana */
0xa5a1, 0xa5f6,
- 0xaaa6, 0xaaaf,
- 0xaab1, 0xaadd
}; /* CR_Katakana */
+#endif
+
+#ifdef ENC_EUC_JIS_2004
+static const OnigCodePoint CR_Han[] = {
+ /* EUC-JIS-2004 (JIS X 0213:2004) */
+ 7,
+ /* plane 1 */
+ 0xa1b8, 0xa1b8,
+ 0xaea1, 0xfefe, /* Kanji level 1, 2 and 3 */
+ /* plane 2 */
+ 0x8fa1a1, 0x8fa1fe, /* row 1 */
+ 0x8fa3a1, 0x8fa5fe, /* row 3 .. 5 */
+ 0x8fa8a1, 0x8fa8fe, /* row 8 */
+ 0x8faca1, 0x8faffe, /* row 12 .. 15 */
+ 0x8feea1, 0x8ffef6, /* row 78 .. 94 */
+}; /* CR_Han */
+#else
+static const OnigCodePoint CR_Han[] = {
+ /* EUC-JP (JIS X 0208 based) */
+ 4,
+ 0xa1b8, 0xa1b8,
+ 0xb0a1, 0xcfd3, /* Kanji level 1 */
+ 0xd0a1, 0xf4a6, /* Kanji level 2 */
+ 0x8fb0a1, 0x8fedf3 /* JIS X 0212 Supplemental Kanji (row 16 .. 77) */
+}; /* CR_Han */
+#endif
+
+static const OnigCodePoint CR_Latin[] = {
+ 4,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0xa3c1, 0xa3da,
+ 0xa3e1, 0xa3fa,
+ /* TODO: add raw 8 .. 11 to support EUC-JIS-2004 */
+ /* TODO: add JIS X 0212 row 9 .. 11 */
+}; /* CR_Latin */
+
+static const OnigCodePoint CR_Greek[] = {
+ 2,
+ 0xa6a1, 0xa6b8,
+#ifdef ENC_EUC_JIS_2004
+ 0xa6c1, 0xa6d9,
+#else
+ 0xa6c1, 0xa6d8,
+ /* TODO: add JIS X 0212 row 6 */
+#endif
+}; /* CR_Greek */
+
+static const OnigCodePoint CR_Cyrillic[] = {
+ 2,
+ 0xa7a1, 0xa7c1,
+ 0xa7d1, 0xa7f1,
+ /* TODO: add JIS X 0212 row 7 */
+}; /* CR_Cyrillic */
static int
init_property_list(void)
@@ -276,6 +511,10 @@ init_property_list(void)
PROPERTY_LIST_ADD_PROP("hiragana", CR_Hiragana);
PROPERTY_LIST_ADD_PROP("katakana", CR_Katakana);
+ PROPERTY_LIST_ADD_PROP("han", CR_Han);
+ PROPERTY_LIST_ADD_PROP("latin", CR_Latin);
+ PROPERTY_LIST_ADD_PROP("greek", CR_Greek);
+ PROPERTY_LIST_ADD_PROP("cyrillic", CR_Cyrillic);
PropertyInited = 1;
end:
@@ -299,7 +538,7 @@ property_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end)
return onigenc_minimum_property_name_to_ctype(enc, s, e);
}
- return (int)ctype;
+ return (int )ctype;
}
static int
@@ -359,14 +598,15 @@ OnigEncodingDefine(euc_jp, EUC_JP) = {
code_to_mbclen,
code_to_mbc,
mbc_case_fold,
- onigenc_ascii_apply_all_case_fold,
- onigenc_ascii_get_case_fold_codes_by_str,
+ apply_all_case_fold,
+ get_case_fold_codes_by_str,
property_name_to_ctype,
is_code_ctype,
get_ctype_code_range,
left_adjust_char_head,
is_allowed_reverse_match,
- 0
+ 0,
+ ONIGENC_FLAG_NONE,
};
/*
* Name: EUC-JP
@@ -395,3 +635,10 @@ ENC_ALIAS("euc-jp-ms", "eucJP-ms")
* Link: http://msyk.at.webry.info/200511/article_2.html
*/
ENC_REPLICATE("CP51932", "EUC-JP")
+
+/*
+ * Name: EUC-JP-2004
+ * Link: http://ja.wikipedia.org/wiki/EUC-JP-2004
+ */
+ENC_REPLICATE("EUC-JP-2004", "EUC-JP") /* defined at JIS X 0213:2004 */
+ENC_ALIAS("EUC-JISX0213", "EUC-JP-2004") /* defined at JIS X 0213:2000, and obsolete at JIS X 0213:2004 */
diff --git a/enc/euc_kr.c b/enc/euc_kr.c
index af5f7828f0..55acf00168 100644
--- a/enc/euc_kr.c
+++ b/enc/euc_kr.c
@@ -187,6 +187,8 @@ OnigEncodingDefine(euc_kr, EUC_KR) = {
euckr_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
euckr_left_adjust_char_head,
- euckr_is_allowed_reverse_match
+ euckr_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
ENC_ALIAS("eucKR", "EUC-KR")
diff --git a/enc/euc_tw.c b/enc/euc_tw.c
index 5fed8a893d..6d193b745e 100644
--- a/enc/euc_tw.c
+++ b/enc/euc_tw.c
@@ -220,6 +220,8 @@ OnigEncodingDefine(euc_tw, EUC_TW) = {
euctw_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
euctw_left_adjust_char_head,
- euctw_is_allowed_reverse_match
+ euctw_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
ENC_ALIAS("eucTW", "EUC-TW")
diff --git a/enc/gb18030.c b/enc/gb18030.c
index 36e60af6b5..d4184333f5 100644
--- a/enc/gb18030.c
+++ b/enc/gb18030.c
@@ -596,6 +596,8 @@ OnigEncodingDefine(gb18030, GB18030) = {
gb18030_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
gb18030_left_adjust_char_head,
- gb18030_is_allowed_reverse_match
+ gb18030_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
diff --git a/enc/gbk.c b/enc/gbk.c
index ace7f378af..7be60a0de9 100644
--- a/enc/gbk.c
+++ b/enc/gbk.c
@@ -210,7 +210,9 @@ OnigEncodingDefine(gbk, GBK) = {
gbk_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
gbk_left_adjust_char_head,
- gbk_is_allowed_reverse_match
+ gbk_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
/*
* Name: GBK
diff --git a/enc/iso_2022_jp.h b/enc/iso_2022_jp.h
index 8cfad0be06..399c2f56a5 100644
--- a/enc/iso_2022_jp.h
+++ b/enc/iso_2022_jp.h
@@ -5,7 +5,12 @@ ENC_ALIAS("ISO2022-JP", "ISO-2022-JP");
ENC_REPLICATE("ISO-2022-JP-2", "ISO-2022-JP");
ENC_ALIAS("ISO2022-JP2", "ISO-2022-JP-2");
-/* Windows Codepage 50220
+/*
+ * Name: CP50220
+ * MIBenum: 2260
+ * Link: http://www.iana.org/assignments/charset-reg/CP50220
+ *
+ * Windows Codepage 50220
* a ISO-2022-JP variant.
* This includes
* * US-ASCII
diff --git a/enc/iso_8859_1.c b/enc/iso_8859_1.c
index a10a7679b8..92dc14f978 100644
--- a/enc/iso_8859_1.c
+++ b/enc/iso_8859_1.c
@@ -272,7 +272,9 @@ OnigEncodingDefine(iso_8859_1, ISO_8859_1) = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match
+ onigenc_always_true_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
ENC_ALIAS("ISO8859-1", "ISO-8859-1")
diff --git a/enc/iso_8859_10.c b/enc/iso_8859_10.c
index 1643278dfd..ec20a15baa 100644
--- a/enc/iso_8859_10.c
+++ b/enc/iso_8859_10.c
@@ -239,6 +239,8 @@ OnigEncodingDefine(iso_8859_10, ISO_8859_10) = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match
+ onigenc_always_true_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
ENC_ALIAS("ISO8859-10", "ISO-8859-10")
diff --git a/enc/iso_8859_11.c b/enc/iso_8859_11.c
index 257d9d8919..ec9840e127 100644
--- a/enc/iso_8859_11.c
+++ b/enc/iso_8859_11.c
@@ -92,7 +92,9 @@ OnigEncodingDefine(iso_8859_11, ISO_8859_11) = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match
+ onigenc_always_true_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
ENC_ALIAS("ISO8859-11", "ISO-8859-11")
diff --git a/enc/iso_8859_13.c b/enc/iso_8859_13.c
index f29cb2e281..4d7b328818 100644
--- a/enc/iso_8859_13.c
+++ b/enc/iso_8859_13.c
@@ -228,7 +228,9 @@ OnigEncodingDefine(iso_8859_13, ISO_8859_13) = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match
+ onigenc_always_true_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
ENC_ALIAS("ISO8859-13", "ISO-8859-13")
diff --git a/enc/iso_8859_14.c b/enc/iso_8859_14.c
index be83f93f80..1271c8a7a6 100644
--- a/enc/iso_8859_14.c
+++ b/enc/iso_8859_14.c
@@ -241,6 +241,8 @@ OnigEncodingDefine(iso_8859_14, ISO_8859_14) = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match
+ onigenc_always_true_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
ENC_ALIAS("ISO8859-14", "ISO-8859-14")
diff --git a/enc/iso_8859_15.c b/enc/iso_8859_15.c
index 2ec41b66c0..451033e158 100644
--- a/enc/iso_8859_15.c
+++ b/enc/iso_8859_15.c
@@ -235,6 +235,8 @@ OnigEncodingDefine(iso_8859_15, ISO_8859_15) = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match
+ onigenc_always_true_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
ENC_ALIAS("ISO8859-15", "ISO-8859-15")
diff --git a/enc/iso_8859_16.c b/enc/iso_8859_16.c
index 3ddc1d91c6..5234cf0e7f 100644
--- a/enc/iso_8859_16.c
+++ b/enc/iso_8859_16.c
@@ -237,6 +237,8 @@ OnigEncodingDefine(iso_8859_16, ISO_8859_16) = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match
+ onigenc_always_true_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
ENC_ALIAS("ISO8859-16", "ISO-8859-16")
diff --git a/enc/iso_8859_2.c b/enc/iso_8859_2.c
index 6c0d2d7dc1..f4cb9100df 100644
--- a/enc/iso_8859_2.c
+++ b/enc/iso_8859_2.c
@@ -237,7 +237,9 @@ OnigEncodingDefine(iso_8859_2, ISO_8859_2) = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match
+ onigenc_always_true_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
ENC_ALIAS("ISO8859-2", "ISO-8859-2")
diff --git a/enc/iso_8859_3.c b/enc/iso_8859_3.c
index 81c0c742b6..85572574b8 100644
--- a/enc/iso_8859_3.c
+++ b/enc/iso_8859_3.c
@@ -235,6 +235,8 @@ OnigEncodingDefine(iso_8859_3, ISO_8859_3) = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match
+ onigenc_always_true_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
ENC_ALIAS("ISO8859-3", "ISO-8859-3")
diff --git a/enc/iso_8859_4.c b/enc/iso_8859_4.c
index ec71c4bcbf..771a2cf6e7 100644
--- a/enc/iso_8859_4.c
+++ b/enc/iso_8859_4.c
@@ -237,6 +237,8 @@ OnigEncodingDefine(iso_8859_4, ISO_8859_4) = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match
+ onigenc_always_true_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
ENC_ALIAS("ISO8859-4", "ISO-8859-4")
diff --git a/enc/iso_8859_5.c b/enc/iso_8859_5.c
index 81cc8e5b32..4ee27b10d8 100644
--- a/enc/iso_8859_5.c
+++ b/enc/iso_8859_5.c
@@ -225,6 +225,8 @@ OnigEncodingDefine(iso_8859_5, ISO_8859_5) = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match
+ onigenc_always_true_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
ENC_ALIAS("ISO8859-5", "ISO-8859-5")
diff --git a/enc/iso_8859_6.c b/enc/iso_8859_6.c
index 7384061a1f..638a181dc2 100644
--- a/enc/iso_8859_6.c
+++ b/enc/iso_8859_6.c
@@ -92,7 +92,9 @@ OnigEncodingDefine(iso_8859_6, ISO_8859_6) = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match
+ onigenc_always_true_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
ENC_ALIAS("ISO8859-6", "ISO-8859-6")
diff --git a/enc/iso_8859_7.c b/enc/iso_8859_7.c
index 2f916171db..aa82f880f9 100644
--- a/enc/iso_8859_7.c
+++ b/enc/iso_8859_7.c
@@ -222,7 +222,9 @@ OnigEncodingDefine(iso_8859_7, ISO_8859_7) = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match
+ onigenc_always_true_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
ENC_ALIAS("ISO8859-7", "ISO-8859-7")
diff --git a/enc/iso_8859_8.c b/enc/iso_8859_8.c
index bd0754c2b1..87a6e7bc9b 100644
--- a/enc/iso_8859_8.c
+++ b/enc/iso_8859_8.c
@@ -92,7 +92,9 @@ OnigEncodingDefine(iso_8859_8, ISO_8859_8) = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match
+ onigenc_always_true_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
ENC_ALIAS("ISO8859-8", "ISO-8859-8")
diff --git a/enc/iso_8859_9.c b/enc/iso_8859_9.c
index 4d46e742e2..0adafa3ed4 100644
--- a/enc/iso_8859_9.c
+++ b/enc/iso_8859_9.c
@@ -228,7 +228,9 @@ OnigEncodingDefine(iso_8859_9, ISO_8859_9) = {
is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match
+ onigenc_always_true_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
ENC_ALIAS("ISO8859-9", "ISO-8859-9")
diff --git a/enc/koi8_r.c b/enc/koi8_r.c
index f5b7d22349..8ec48747f8 100644
--- a/enc/koi8_r.c
+++ b/enc/koi8_r.c
@@ -213,7 +213,9 @@ OnigEncodingDefine(koi8_r, KOI8_R) = {
koi8_r_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match
+ onigenc_always_true_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
ENC_ALIAS("CP878", "KOI8-R")
diff --git a/enc/koi8_u.c b/enc/koi8_u.c
index dfbaa9ac36..0e51b6eb80 100644
--- a/enc/koi8_u.c
+++ b/enc/koi8_u.c
@@ -217,5 +217,7 @@ OnigEncodingDefine(koi8_u, KOI8_U) = {
koi8_u_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match
+ onigenc_always_true_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
diff --git a/enc/make_encmake.rb b/enc/make_encmake.rb
index ed3680313f..b917eca0bd 100755
--- a/enc/make_encmake.rb
+++ b/enc/make_encmake.rb
@@ -15,6 +15,7 @@ BUILTIN_ENCS = []
BUILTIN_TRANSES = []
ENC_PATTERNS = []
NOENC_PATTERNS = []
+module_type = :dynamic
until ARGV.empty?
case ARGV[0]
@@ -30,11 +31,81 @@ until ARGV.empty?
when /\A--no-encs=/
NOENC_PATTERNS.concat $'.split
ARGV.shift
+ when /\A--module$/
+ ARGV.shift
+ when /\A--modulestatic$/
+ module_type = :static
+ ARGV.shift
else
break
end
end
+ALPHANUMERIC_ORDER = proc {|e| e.scan(/(\d+)|(\D+)/).map {|n,a| a||[n.size,n.to_i]}.flatten}
+def target_encodings
+ encs = Dir.open($srcdir) {|d| d.grep(/.+\.c\z/)} - BUILTIN_ENCS - ["mktable.c"]
+ encs.each {|e| e.chomp!(".c")}
+ encs.reject! {|e| !ENC_PATTERNS.any? {|p| File.fnmatch?(p, e)}} if !ENC_PATTERNS.empty?
+ encs.reject! {|e| NOENC_PATTERNS.any? {|p| File.fnmatch?(p, e)}}
+ encs = encs.sort_by(&ALPHANUMERIC_ORDER)
+ deps = Hash.new {[]}
+ inc_srcs = Hash.new {[]}
+ default_deps = %w[regenc.h oniguruma.h config.h defines.h]
+ db = encs.delete("encdb")
+ encs.each do |e|
+ File.foreach("#$srcdir/#{e}.c") do |l|
+ if /^\s*#\s*include\s+(?:"([^\"]+)"|<(ruby\/\sw+.h)>)/ =~ l
+ n = $1 || $2
+ if /\.c$/ =~ n
+ inc_srcs[e] <<= $`
+ n = "enc/#{n}"
+ end
+ deps[e] <<= n unless default_deps.include?(n)
+ end
+ end
+ end
+ class << inc_srcs; self; end.class_eval do
+ define_method(:expand) do |d|
+ d.map {|n| deps[n] | self.expand(self[n])}.flatten
+ end
+ end
+ inc_srcs.each do |e, d|
+ deps[e].concat(inc_srcs.expand(d))
+ end
+ encs.unshift(db)
+ return encs, deps
+end
+
+def target_transcoders
+ atrans = []
+ trans = Dir.open($srcdir+"/trans") {|d|
+ d.select {|e|
+ if e.chomp!('.trans')
+ atrans << e
+ true
+ elsif e.chomp!('.c')
+ true
+ end
+ }
+ }
+ trans -= BUILTIN_TRANSES
+ atrans -= BUILTIN_TRANSES
+ trans.uniq!
+ atrans = atrans.sort_by(&ALPHANUMERIC_ORDER)
+ trans = trans.sort_by(&ALPHANUMERIC_ORDER)
+ trans.unshift(trans.delete("transdb"))
+ trans.compact!
+ trans |= atrans
+ trans.map! {|e| "trans/#{e}"}
+
+ return atrans, trans
+end
+
+# Constants that "depend" needs.
+MODULE_TYPE = module_type
+ENCS, ENC_DEPS = target_encodings
+ATRANS, TRANS = target_transcoders
+
if File.exist?(depend = File.join($srcdir, "depend"))
erb = ERB.new(File.read(depend), nil, '%')
erb.filename = depend
@@ -48,3 +119,18 @@ mkin.gsub!(/@(#{CONFIG.keys.join('|')})@/) {CONFIG[$1]}
open(ARGV[0], 'wb') {|f|
f.puts mkin, dep
}
+if MODULE_TYPE == :static
+ erb = ERB.new(File.read(File.join($srcdir, "encinit.c.erb")), nil, '%-')
+ erb.filename = "enc/encinit.c.cerb"
+ tmp = erb.result(binding)
+ begin
+ Dir.mkdir 'enc'
+ rescue Errno::EEXIST
+ end
+ File.open("enc/encinit.c", "w") {|f|
+ f.puts "/* Automatically generated from enc/encinit.c.erb"
+ f.puts " * Do not edit."
+ f.puts " */"
+ f.puts tmp
+ }
+end
diff --git a/enc/mktable.c b/enc/mktable.c
new file mode 100644
index 0000000000..49acf628d0
--- /dev/null
+++ b/enc/mktable.c
@@ -0,0 +1,1162 @@
+/**********************************************************************
+ mktable.c
+**********************************************************************/
+/*-
+ * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <locale.h>
+
+#define __USE_ISOC99
+#include <ctype.h>
+
+#include "regenc.h"
+
+#define ASCII 0
+#define UNICODE_ISO_8859_1 1
+#define ISO_8859_1 2
+#define ISO_8859_2 3
+#define ISO_8859_3 4
+#define ISO_8859_4 5
+#define ISO_8859_5 6
+#define ISO_8859_6 7
+#define ISO_8859_7 8
+#define ISO_8859_8 9
+#define ISO_8859_9 10
+#define ISO_8859_10 11
+#define ISO_8859_11 12
+#define ISO_8859_13 13
+#define ISO_8859_14 14
+#define ISO_8859_15 15
+#define ISO_8859_16 16
+#define KOI8 17
+#define KOI8_R 18
+
+typedef struct {
+ int num;
+ const char* name;
+} ENC_INFO;
+
+static ENC_INFO Info[] = {
+ { ASCII, "ASCII" },
+ { UNICODE_ISO_8859_1, "UNICODE_ISO_8859_1" },
+ { ISO_8859_1, "ISO_8859_1" },
+ { ISO_8859_2, "ISO_8859_2" },
+ { ISO_8859_3, "ISO_8859_3" },
+ { ISO_8859_4, "ISO_8859_4" },
+ { ISO_8859_5, "ISO_8859_5" },
+ { ISO_8859_6, "ISO_8859_6" },
+ { ISO_8859_7, "ISO_8859_7" },
+ { ISO_8859_8, "ISO_8859_8" },
+ { ISO_8859_9, "ISO_8859_9" },
+ { ISO_8859_10, "ISO_8859_10" },
+ { ISO_8859_11, "ISO_8859_11" },
+ { ISO_8859_13, "ISO_8859_13" },
+ { ISO_8859_14, "ISO_8859_14" },
+ { ISO_8859_15, "ISO_8859_15" },
+ { ISO_8859_16, "ISO_8859_16" },
+ { KOI8, "KOI8" },
+ { KOI8_R, "KOI8_R" }
+};
+
+
+static int IsAlpha(int enc, int c)
+{
+ if (enc == ASCII)
+ return isalpha(c);
+
+ if (c >= 0x41 && c <= 0x5a) return 1;
+ if (c >= 0x61 && c <= 0x7a) return 1;
+
+ switch (enc) {
+ case UNICODE_ISO_8859_1:
+ case ISO_8859_1:
+ case ISO_8859_9:
+ if (c == 0xaa) return 1;
+ if (c == 0xb5) return 1;
+ if (c == 0xba) return 1;
+ if (c >= 0xc0 && c <= 0xd6) return 1;
+ if (c >= 0xd8 && c <= 0xf6) return 1;
+ if (c >= 0xf8 && c <= 0xff) return 1;
+ break;
+
+ case ISO_8859_2:
+ if (c == 0xa1 || c == 0xa3) return 1;
+ if (c == 0xa5 || c == 0xa6) return 1;
+ if (c >= 0xa9 && c <= 0xac) return 1;
+ if (c >= 0xae && c <= 0xaf) return 1;
+ if (c == 0xb1 || c == 0xb3) return 1;
+ if (c == 0xb5 || c == 0xb6) return 1;
+ if (c >= 0xb9 && c <= 0xbc) return 1;
+ if (c >= 0xbe && c <= 0xbf) return 1;
+ if (c >= 0xc0 && c <= 0xd6) return 1;
+ if (c >= 0xd8 && c <= 0xf6) return 1;
+ if (c >= 0xf8 && c <= 0xfe) return 1;
+ break;
+
+ case ISO_8859_3:
+ if (c == 0xa1) return 1;
+ if (c == 0xa6) return 1;
+ if (c >= 0xa9 && c <= 0xac) return 1;
+ if (c == 0xaf) return 1;
+ if (c == 0xb1) return 1;
+ if (c == 0xb5 || c == 0xb6) return 1;
+ if (c >= 0xb9 && c <= 0xbc) return 1;
+ if (c == 0xbf) return 1;
+ if (c >= 0xc0 && c <= 0xc2) return 1;
+ if (c >= 0xc4 && c <= 0xcf) return 1;
+ if (c >= 0xd1 && c <= 0xd6) return 1;
+ if (c >= 0xd8 && c <= 0xe2) return 1;
+ if (c >= 0xe4 && c <= 0xef) return 1;
+ if (c >= 0xf1 && c <= 0xf6) return 1;
+ if (c >= 0xf8 && c <= 0xfe) return 1;
+ break;
+
+ case ISO_8859_4:
+ if (c >= 0xa1 && c <= 0xa3) return 1;
+ if (c == 0xa5 || c == 0xa6) return 1;
+ if (c >= 0xa9 && c <= 0xac) return 1;
+ if (c == 0xae) return 1;
+ if (c == 0xb1 || c == 0xb3) return 1;
+ if (c == 0xb5 || c == 0xb6) return 1;
+ if (c >= 0xb9 && c <= 0xbf) return 1;
+ if (c >= 0xc0 && c <= 0xd6) return 1;
+ if (c >= 0xd8 && c <= 0xf6) return 1;
+ if (c >= 0xf8 && c <= 0xfe) return 1;
+ break;
+
+ case ISO_8859_5:
+ if (c >= 0xa1 && c <= 0xcf && c != 0xad) return 1;
+ if (c >= 0xd0 && c <= 0xff && c != 0xf0 && c != 0xfd) return 1;
+ break;
+
+ case ISO_8859_6:
+ if (c >= 0xc1 && c <= 0xda) return 1;
+ if (c >= 0xe0 && c <= 0xf2) return 1;
+ break;
+
+ case ISO_8859_7:
+ if (c == 0xb6) return 1;
+ if (c >= 0xb8 && c <= 0xba) return 1;
+ if (c == 0xbc) return 1;
+ if (c >= 0xbe && c <= 0xbf) return 1;
+ if (c == 0xc0) return 1;
+ if (c >= 0xc1 && c <= 0xdb && c != 0xd2) return 1;
+ if (c >= 0xdc && c <= 0xfe) return 1;
+ break;
+
+ case ISO_8859_8:
+ if (c == 0xb5) return 1;
+ if (c >= 0xe0 && c <= 0xfa) return 1;
+ break;
+
+ case ISO_8859_10:
+ if (c >= 0xa1 && c <= 0xa6) return 1;
+ if (c >= 0xa8 && c <= 0xac) return 1;
+ if (c == 0xae || c == 0xaf) return 1;
+ if (c >= 0xb1 && c <= 0xb6) return 1;
+ if (c >= 0xb8 && c <= 0xbc) return 1;
+ if (c >= 0xbe && c <= 0xff) return 1;
+ break;
+
+ case ISO_8859_11:
+ if (c >= 0xa1 && c <= 0xda) return 1;
+ if (c >= 0xdf && c <= 0xfb) return 1;
+ break;
+
+ case ISO_8859_13:
+ if (c == 0xa8) return 1;
+ if (c == 0xaa) return 1;
+ if (c == 0xaf) return 1;
+ if (c == 0xb5) return 1;
+ if (c == 0xb8) return 1;
+ if (c == 0xba) return 1;
+ if (c >= 0xbf && c <= 0xd6) return 1;
+ if (c >= 0xd8 && c <= 0xf6) return 1;
+ if (c >= 0xf8 && c <= 0xfe) return 1;
+ break;
+
+ case ISO_8859_14:
+ if (c == 0xa1 || c == 0xa2) return 1;
+ if (c == 0xa4 || c == 0xa5) return 1;
+ if (c == 0xa6 || c == 0xa8) return 1;
+ if (c >= 0xaa && c <= 0xac) return 1;
+ if (c >= 0xaf && c <= 0xb5) return 1;
+ if (c >= 0xb7 && c <= 0xff) return 1;
+ break;
+
+ case ISO_8859_15:
+ if (c == 0xaa) return 1;
+ if (c == 0xb5) return 1;
+ if (c == 0xba) return 1;
+ if (c >= 0xc0 && c <= 0xd6) return 1;
+ if (c >= 0xd8 && c <= 0xf6) return 1;
+ if (c >= 0xf8 && c <= 0xff) return 1;
+ if (c == 0xa6) return 1;
+ if (c == 0xa8) return 1;
+ if (c == 0xb4) return 1;
+ if (c == 0xb8) return 1;
+ if (c == 0xbc) return 1;
+ if (c == 0xbd) return 1;
+ if (c == 0xbe) return 1;
+ break;
+
+ case ISO_8859_16:
+ if (c == 0xa1) return 1;
+ if (c == 0xa2) return 1;
+ if (c == 0xa3) return 1;
+ if (c == 0xa6) return 1;
+ if (c == 0xa8) return 1;
+ if (c == 0xaa) return 1;
+ if (c == 0xac) return 1;
+ if (c == 0xae) return 1;
+ if (c == 0xaf) return 1;
+ if (c == 0xb2) return 1;
+ if (c == 0xb3) return 1;
+ if (c == 0xb4) return 1;
+ if (c >= 0xb8 && c <= 0xba) return 1;
+ if (c == 0xbc) return 1;
+ if (c == 0xbd) return 1;
+ if (c == 0xbe) return 1;
+ if (c == 0xbf) return 1;
+ if (c >= 0xc0 && c <= 0xde) return 1;
+ if (c >= 0xdf && c <= 0xff) return 1;
+ break;
+
+ case KOI8_R:
+ if (c == 0xa3 || c == 0xb3) return 1;
+ /* fall */
+ case KOI8:
+ if (c >= 0xc0 && c <= 0xff) return 1;
+ break;
+
+ default:
+ exit(-1);
+ }
+
+ return 0;
+}
+
+static int IsBlank(int enc, int c)
+{
+ if (enc == ASCII)
+ return isblank(c);
+
+ if (c == 0x09 || c == 0x20) return 1;
+
+ switch (enc) {
+ case UNICODE_ISO_8859_1:
+ case ISO_8859_1:
+ case ISO_8859_2:
+ case ISO_8859_3:
+ case ISO_8859_4:
+ case ISO_8859_5:
+ case ISO_8859_6:
+ case ISO_8859_7:
+ case ISO_8859_8:
+ case ISO_8859_9:
+ case ISO_8859_10:
+ case ISO_8859_11:
+ case ISO_8859_13:
+ case ISO_8859_14:
+ case ISO_8859_15:
+ case ISO_8859_16:
+ case KOI8:
+ if (c == 0xa0) return 1;
+ break;
+
+ case KOI8_R:
+ if (c == 0x9a) return 1;
+ break;
+
+ default:
+ exit(-1);
+ }
+
+ return 0;
+}
+
+static int IsCntrl(int enc, int c)
+{
+ if (enc == ASCII)
+ return iscntrl(c);
+
+ if (c >= 0x00 && c <= 0x1F) return 1;
+
+ switch (enc) {
+ case UNICODE_ISO_8859_1:
+ if (c == 0xad) return 1;
+ /* fall */
+ case ISO_8859_1:
+ case ISO_8859_2:
+ case ISO_8859_3:
+ case ISO_8859_4:
+ case ISO_8859_5:
+ case ISO_8859_6:
+ case ISO_8859_7:
+ case ISO_8859_8:
+ case ISO_8859_9:
+ case ISO_8859_10:
+ case ISO_8859_11:
+ case ISO_8859_13:
+ case ISO_8859_14:
+ case ISO_8859_15:
+ case ISO_8859_16:
+ case KOI8:
+ if (c >= 0x7f && c <= 0x9F) return 1;
+ break;
+
+
+ case KOI8_R:
+ if (c == 0x7f) return 1;
+ break;
+
+ default:
+ exit(-1);
+ }
+
+ return 0;
+}
+
+static int IsDigit(int enc ARG_UNUSED, int c)
+{
+ if (c >= 0x30 && c <= 0x39) return 1;
+ return 0;
+}
+
+static int IsGraph(int enc, int c)
+{
+ if (enc == ASCII)
+ return isgraph(c);
+
+ if (c >= 0x21 && c <= 0x7e) return 1;
+
+ switch (enc) {
+ case UNICODE_ISO_8859_1:
+ case ISO_8859_1:
+ case ISO_8859_2:
+ case ISO_8859_4:
+ case ISO_8859_5:
+ case ISO_8859_9:
+ case ISO_8859_10:
+ case ISO_8859_13:
+ case ISO_8859_14:
+ case ISO_8859_15:
+ case ISO_8859_16:
+ if (c >= 0xa1 && c <= 0xff) return 1;
+ break;
+
+ case ISO_8859_3:
+ if (c >= 0xa1) {
+ if (c == 0xa5 || c == 0xae || c == 0xbe || c == 0xc3 || c == 0xd0 ||
+ c == 0xe3 || c == 0xf0)
+ return 0;
+ else
+ return 1;
+ }
+ break;
+
+ case ISO_8859_6:
+ if (c == 0xa4 || c == 0xac || c == 0xad || c == 0xbb || c == 0xbf)
+ return 1;
+ if (c >= 0xc1 && c <= 0xda) return 1;
+ if (c >= 0xe0 && c <= 0xf2) return 1;
+ break;
+
+ case ISO_8859_7:
+ if (c >= 0xa1 && c <= 0xfe &&
+ c != 0xa4 && c != 0xa5 && c != 0xaa &&
+ c != 0xae && c != 0xd2) return 1;
+ break;
+
+ case ISO_8859_8:
+ if (c >= 0xa2 && c <= 0xfa) {
+ if (c >= 0xbf && c <= 0xde) return 0;
+ return 1;
+ }
+ break;
+
+ case ISO_8859_11:
+ if (c >= 0xa1 && c <= 0xda) return 1;
+ if (c >= 0xdf && c <= 0xfb) return 1;
+ break;
+
+ case KOI8:
+ if (c >= 0xc0 && c <= 0xff) return 1;
+ break;
+
+ case KOI8_R:
+ if (c >= 0x80 && c <= 0xff && c != 0x9a) return 1;
+ break;
+
+ default:
+ exit(-1);
+ }
+
+ return 0;
+}
+
+static int IsLower(int enc, int c)
+{
+ if (enc == ASCII)
+ return islower(c);
+
+ if (c >= 0x61 && c <= 0x7a) return 1;
+
+ switch (enc) {
+ case UNICODE_ISO_8859_1:
+ case ISO_8859_1:
+ case ISO_8859_9:
+ if (c == 0xaa) return 1;
+ if (c == 0xb5) return 1;
+ if (c == 0xba) return 1;
+ if (c >= 0xdf && c <= 0xf6) return 1;
+ if (c >= 0xf8 && c <= 0xff) return 1;
+ break;
+
+ case ISO_8859_2:
+ if (c == 0xb1 || c == 0xb3) return 1;
+ if (c == 0xb5 || c == 0xb6) return 1;
+ if (c >= 0xb9 && c <= 0xbc) return 1;
+ if (c >= 0xbe && c <= 0xbf) return 1;
+ if (c >= 0xdf && c <= 0xf6) return 1;
+ if (c >= 0xf8 && c <= 0xfe) return 1;
+ break;
+
+ case ISO_8859_3:
+ if (c == 0xb1) return 1;
+ if (c == 0xb5 || c == 0xb6) return 1;
+ if (c >= 0xb9 && c <= 0xbc) return 1;
+ if (c == 0xbf) return 1;
+ if (c == 0xdf) return 1;
+ if (c >= 0xe0 && c <= 0xe2) return 1;
+ if (c >= 0xe4 && c <= 0xef) return 1;
+ if (c >= 0xf1 && c <= 0xf6) return 1;
+ if (c >= 0xf8 && c <= 0xfe) return 1;
+ break;
+
+ case ISO_8859_4:
+ if (c == 0xa2) return 1;
+ if (c == 0xb1 || c == 0xb3) return 1;
+ if (c == 0xb5 || c == 0xb6) return 1;
+ if (c >= 0xb9 && c <= 0xbc) return 1;
+ if (c >= 0xbe && c <= 0xbf) return 1;
+ if (c == 0xdf) return 1;
+ if (c >= 0xe0 && c <= 0xf6) return 1;
+ if (c >= 0xf8 && c <= 0xfe) return 1;
+ break;
+
+ case ISO_8859_5:
+ if (c >= 0xd0 && c <= 0xff && c != 0xf0 && c != 0xfd) return 1;
+ break;
+
+ case ISO_8859_6:
+ break;
+
+ case ISO_8859_7:
+ if (c == 0xc0) return 1;
+ if (c >= 0xdc && c <= 0xfe) return 1;
+ break;
+
+ case ISO_8859_8:
+ if (c == 0xb5) return 1;
+ break;
+
+ case ISO_8859_10:
+ if (c >= 0xb1 && c <= 0xb6) return 1;
+ if (c >= 0xb8 && c <= 0xbc) return 1;
+ if (c == 0xbe || c == 0xbf) return 1;
+ if (c >= 0xdf && c <= 0xff) return 1;
+ break;
+
+ case ISO_8859_11:
+ break;
+
+ case ISO_8859_13:
+ if (c == 0xb5) return 1;
+ if (c == 0xb8) return 1;
+ if (c == 0xba) return 1;
+ if (c == 0xbf) return 1;
+ if (c >= 0xdf && c <= 0xf6) return 1;
+ if (c >= 0xf8 && c <= 0xfe) return 1;
+ break;
+
+ case ISO_8859_14:
+ if (c == 0xa2) return 1;
+ if (c == 0xa5) return 1;
+ if (c == 0xab) return 1;
+ if (c == 0xb1 || c == 0xb3 || c == 0xb5) return 1;
+ if (c >= 0xb8 && c <= 0xba) return 1;
+ if (c == 0xbc) return 1;
+ if (c == 0xbe || c == 0xbf) return 1;
+ if (c >= 0xdf && c <= 0xff) return 1;
+ break;
+
+ case ISO_8859_15:
+ if (c == 0xaa) return 1;
+ if (c == 0xb5) return 1;
+ if (c == 0xba) return 1;
+ if (c >= 0xdf && c <= 0xf6) return 1;
+ if (c >= 0xf8 && c <= 0xff) return 1;
+ if (c == 0xa8) return 1;
+ if (c == 0xb8) return 1;
+ if (c == 0xbd) return 1;
+ break;
+
+ case ISO_8859_16:
+ if (c == 0xa2) return 1;
+ if (c == 0xa8) return 1;
+ if (c == 0xae) return 1;
+ if (c == 0xb3) return 1;
+ if (c >= 0xb8 && c <= 0xba) return 1;
+ if (c == 0xbd) return 1;
+ if (c == 0xbf) return 1;
+ if (c >= 0xdf && c <= 0xff) return 1;
+ break;
+
+ case KOI8_R:
+ if (c == 0xa3) return 1;
+ /* fall */
+ case KOI8:
+ if (c >= 0xc0 && c <= 0xdf) return 1;
+ break;
+
+ default:
+ exit(-1);
+ }
+
+ return 0;
+}
+
+static int IsPrint(int enc, int c)
+{
+ if (enc == ASCII)
+ return isprint(c);
+
+ if (c >= 0x20 && c <= 0x7e) return 1;
+
+ switch (enc) {
+ case UNICODE_ISO_8859_1:
+ /* if (c >= 0x09 && c <= 0x0d) return 1; */
+ if (c == 0x85) return 1;
+ /* fall */
+ case ISO_8859_1:
+ case ISO_8859_2:
+ case ISO_8859_4:
+ case ISO_8859_5:
+ case ISO_8859_9:
+ case ISO_8859_10:
+ case ISO_8859_13:
+ case ISO_8859_14:
+ case ISO_8859_15:
+ case ISO_8859_16:
+ if (c >= 0xa0 && c <= 0xff) return 1;
+ break;
+
+ case ISO_8859_3:
+ if (c >= 0xa0) {
+ if (c == 0xa5 || c == 0xae || c == 0xbe || c == 0xc3 || c == 0xd0 ||
+ c == 0xe3 || c == 0xf0)
+ return 0;
+ else
+ return 1;
+ }
+ break;
+
+ case ISO_8859_6:
+ if (c == 0xa0) return 1;
+ if (c == 0xa4 || c == 0xac || c == 0xad || c == 0xbb || c == 0xbf)
+ return 1;
+ if (c >= 0xc1 && c <= 0xda) return 1;
+ if (c >= 0xe0 && c <= 0xf2) return 1;
+ break;
+
+ case ISO_8859_7:
+ if (c >= 0xa0 && c <= 0xfe &&
+ c != 0xa4 && c != 0xa5 && c != 0xaa &&
+ c != 0xae && c != 0xd2) return 1;
+ break;
+
+ case ISO_8859_8:
+ if (c >= 0xa0 && c <= 0xfa) {
+ if (c >= 0xbf && c <= 0xde) return 0;
+ if (c == 0xa1) return 0;
+ return 1;
+ }
+ break;
+
+ case ISO_8859_11:
+ if (c >= 0xa0 && c <= 0xda) return 1;
+ if (c >= 0xdf && c <= 0xfb) return 1;
+ break;
+
+ case KOI8:
+ if (c == 0xa0) return 1;
+ if (c >= 0xc0 && c <= 0xff) return 1;
+ break;
+
+ case KOI8_R:
+ if (c >= 0x80 && c <= 0xff) return 1;
+ break;
+
+ default:
+ exit(-1);
+ }
+
+ return 0;
+}
+
+static int IsPunct(int enc, int c)
+{
+ if (enc == ASCII)
+ return ispunct(c);
+
+ if (enc == UNICODE_ISO_8859_1) {
+ if (c == 0x24 || c == 0x2b || c == 0x5e || c == 0x60 ||
+ c == 0x7c || c == 0x7e) return 1;
+ if (c >= 0x3c && c <= 0x3e) return 1;
+ }
+
+ if (c >= 0x21 && c <= 0x2f) return 1;
+ if (c >= 0x3a && c <= 0x40) return 1;
+ if (c >= 0x5b && c <= 0x60) return 1;
+ if (c >= 0x7b && c <= 0x7e) return 1;
+
+ switch (enc) {
+ case ISO_8859_1:
+ case ISO_8859_9:
+ case ISO_8859_15:
+ if (c == 0xad) return 1;
+ /* fall */
+ case UNICODE_ISO_8859_1:
+ if (c == 0xa1) return 1;
+ if (c == 0xab) return 1;
+ if (c == 0xb7) return 1;
+ if (c == 0xbb) return 1;
+ if (c == 0xbf) return 1;
+ break;
+
+ case ISO_8859_2:
+ case ISO_8859_4:
+ case ISO_8859_5:
+ case ISO_8859_14:
+ if (c == 0xad) return 1;
+ break;
+
+ case ISO_8859_3:
+ case ISO_8859_10:
+ if (c == 0xad) return 1;
+ if (c == 0xb7) return 1;
+ if (c == 0xbd) return 1;
+ break;
+
+ case ISO_8859_6:
+ if (c == 0xac) return 1;
+ if (c == 0xad) return 1;
+ if (c == 0xbb) return 1;
+ if (c == 0xbf) return 1;
+ break;
+
+ case ISO_8859_7:
+ if (c == 0xa1 || c == 0xa2) return 1;
+ if (c == 0xab) return 1;
+ if (c == 0xaf) return 1;
+ if (c == 0xad) return 1;
+ if (c == 0xb7 || c == 0xbb) return 1;
+ break;
+
+ case ISO_8859_8:
+ if (c == 0xab) return 1;
+ if (c == 0xad) return 1;
+ if (c == 0xb7) return 1;
+ if (c == 0xbb) return 1;
+ if (c == 0xdf) return 1;
+ break;
+
+ case ISO_8859_13:
+ if (c == 0xa1 || c == 0xa5) return 1;
+ if (c == 0xab || c == 0xad) return 1;
+ if (c == 0xb4 || c == 0xb7) return 1;
+ if (c == 0xbb) return 1;
+ if (c == 0xff) return 1;
+ break;
+
+ case ISO_8859_16:
+ if (c == 0xa5) return 1;
+ if (c == 0xab) return 1;
+ if (c == 0xad) return 1;
+ if (c == 0xb5) return 1;
+ if (c == 0xb7) return 1;
+ if (c == 0xbb) return 1;
+ break;
+
+ case KOI8_R:
+ if (c == 0x9e) return 1;
+ break;
+
+ case ISO_8859_11:
+ case KOI8:
+ break;
+
+ default:
+ exit(-1);
+ }
+
+ return 0;
+}
+
+static int IsSpace(int enc, int c)
+{
+ if (enc == ASCII)
+ return isspace(c);
+
+ if (c >= 0x09 && c <= 0x0d) return 1;
+ if (c == 0x20) return 1;
+
+ switch (enc) {
+ case UNICODE_ISO_8859_1:
+ if (c == 0x85) return 1;
+ /* fall */
+ case ISO_8859_1:
+ case ISO_8859_2:
+ case ISO_8859_3:
+ case ISO_8859_4:
+ case ISO_8859_5:
+ case ISO_8859_6:
+ case ISO_8859_7:
+ case ISO_8859_8:
+ case ISO_8859_9:
+ case ISO_8859_10:
+ case ISO_8859_11:
+ case ISO_8859_13:
+ case ISO_8859_14:
+ case ISO_8859_15:
+ case ISO_8859_16:
+ case KOI8:
+ if (c == 0xa0) return 1;
+ break;
+
+ case KOI8_R:
+ if (c == 0x9a) return 1;
+ break;
+
+ default:
+ exit(-1);
+ }
+
+ return 0;
+}
+
+static int IsUpper(int enc, int c)
+{
+ if (enc == ASCII)
+ return isupper(c);
+
+ if (c >= 0x41 && c <= 0x5a) return 1;
+
+ switch (enc) {
+ case UNICODE_ISO_8859_1:
+ case ISO_8859_1:
+ case ISO_8859_9:
+ if (c >= 0xc0 && c <= 0xd6) return 1;
+ if (c >= 0xd8 && c <= 0xde) return 1;
+ break;
+
+ case ISO_8859_2:
+ if (c == 0xa1 || c == 0xa3) return 1;
+ if (c == 0xa5 || c == 0xa6) return 1;
+ if (c >= 0xa9 && c <= 0xac) return 1;
+ if (c >= 0xae && c <= 0xaf) return 1;
+ if (c >= 0xc0 && c <= 0xd6) return 1;
+ if (c >= 0xd8 && c <= 0xde) return 1;
+ break;
+
+ case ISO_8859_3:
+ if (c == 0xa1) return 1;
+ if (c == 0xa6) return 1;
+ if (c >= 0xa9 && c <= 0xac) return 1;
+ if (c == 0xaf) return 1;
+ if (c >= 0xc0 && c <= 0xc2) return 1;
+ if (c >= 0xc4 && c <= 0xcf) return 1;
+ if (c >= 0xd1 && c <= 0xd6) return 1;
+ if (c >= 0xd8 && c <= 0xde) return 1;
+ break;
+
+ case ISO_8859_4:
+ if (c == 0xa1 || c == 0xa3) return 1;
+ if (c == 0xa5 || c == 0xa6) return 1;
+ if (c >= 0xa9 && c <= 0xac) return 1;
+ if (c == 0xae) return 1;
+ if (c == 0xbd) return 1;
+ if (c >= 0xc0 && c <= 0xd6) return 1;
+ if (c >= 0xd8 && c <= 0xde) return 1;
+ break;
+
+ case ISO_8859_5:
+ if (c >= 0xa1 && c <= 0xcf && c != 0xad) return 1;
+ break;
+
+ case ISO_8859_6:
+ break;
+
+ case ISO_8859_7:
+ if (c == 0xb6) return 1;
+ if (c >= 0xb8 && c <= 0xba) return 1;
+ if (c == 0xbc) return 1;
+ if (c >= 0xbe && c <= 0xbf) return 1;
+ if (c >= 0xc1 && c <= 0xdb && c != 0xd2) return 1;
+ break;
+
+ case ISO_8859_8:
+ case ISO_8859_11:
+ break;
+
+ case ISO_8859_10:
+ if (c >= 0xa1 && c <= 0xa6) return 1;
+ if (c >= 0xa8 && c <= 0xac) return 1;
+ if (c == 0xae || c == 0xaf) return 1;
+ if (c >= 0xc0 && c <= 0xde) return 1;
+ break;
+
+ case ISO_8859_13:
+ if (c == 0xa8) return 1;
+ if (c == 0xaa) return 1;
+ if (c == 0xaf) return 1;
+ if (c >= 0xc0 && c <= 0xd6) return 1;
+ if (c >= 0xd8 && c <= 0xde) return 1;
+ break;
+
+ case ISO_8859_14:
+ if (c == 0xa1) return 1;
+ if (c == 0xa4 || c == 0xa6) return 1;
+ if (c == 0xa8) return 1;
+ if (c == 0xaa || c == 0xac) return 1;
+ if (c == 0xaf || c == 0xb0) return 1;
+ if (c == 0xb2 || c == 0xb4 || c == 0xb7) return 1;
+ if (c == 0xbb || c == 0xbd) return 1;
+ if (c >= 0xc0 && c <= 0xde) return 1;
+ break;
+
+ case ISO_8859_15:
+ if (c >= 0xc0 && c <= 0xd6) return 1;
+ if (c >= 0xd8 && c <= 0xde) return 1;
+ if (c == 0xa6) return 1;
+ if (c == 0xb4) return 1;
+ if (c == 0xbc) return 1;
+ if (c == 0xbe) return 1;
+ break;
+
+ case ISO_8859_16:
+ if (c == 0xa1) return 1;
+ if (c == 0xa3) return 1;
+ if (c == 0xa6) return 1;
+ if (c == 0xaa) return 1;
+ if (c == 0xac) return 1;
+ if (c == 0xaf) return 1;
+ if (c == 0xb2) return 1;
+ if (c == 0xb4) return 1;
+ if (c == 0xbc) return 1;
+ if (c == 0xbe) return 1;
+ if (c >= 0xc0 && c <= 0xde) return 1;
+ break;
+
+ case KOI8_R:
+ if (c == 0xb3) return 1;
+ /* fall */
+ case KOI8:
+ if (c >= 0xe0 && c <= 0xff) return 1;
+ break;
+
+ default:
+ exit(-1);
+ }
+
+ return 0;
+}
+
+static int IsXDigit(int enc, int c)
+{
+ if (enc == ASCII)
+ return isxdigit(c);
+
+ if (c >= 0x30 && c <= 0x39) return 1;
+ if (c >= 0x41 && c <= 0x46) return 1;
+ if (c >= 0x61 && c <= 0x66) return 1;
+ return 0;
+}
+
+static int IsWord(int enc, int c)
+{
+ if (enc == ASCII) {
+ return (isalpha(c) || isdigit(c) || c == 0x5f);
+ }
+
+ if (c >= 0x30 && c <= 0x39) return 1;
+ if (c >= 0x41 && c <= 0x5a) return 1;
+ if (c == 0x5f) return 1;
+ if (c >= 0x61 && c <= 0x7a) return 1;
+
+ switch (enc) {
+ case UNICODE_ISO_8859_1:
+ case ISO_8859_1:
+ case ISO_8859_9:
+ if (c == 0xaa) return 1;
+ if (c >= 0xb2 && c <= 0xb3) return 1;
+ if (c == 0xb5) return 1;
+ if (c >= 0xb9 && c <= 0xba) return 1;
+ if (c >= 0xbc && c <= 0xbe) return 1;
+ if (c >= 0xc0 && c <= 0xd6) return 1;
+ if (c >= 0xd8 && c <= 0xf6) return 1;
+ if (c >= 0xf8 && c <= 0xff) return 1;
+ break;
+
+ case ISO_8859_2:
+ if (c == 0xa1 || c == 0xa3) return 1;
+ if (c == 0xa5 || c == 0xa6) return 1;
+ if (c >= 0xa9 && c <= 0xac) return 1;
+ if (c >= 0xae && c <= 0xaf) return 1;
+ if (c == 0xb1 || c == 0xb3) return 1;
+ if (c == 0xb5 || c == 0xb6) return 1;
+ if (c >= 0xb9 && c <= 0xbc) return 1;
+ if (c >= 0xbe && c <= 0xbf) return 1;
+ if (c >= 0xc0 && c <= 0xd6) return 1;
+ if (c >= 0xd8 && c <= 0xf6) return 1;
+ if (c >= 0xf8 && c <= 0xfe) return 1;
+ break;
+
+ case ISO_8859_3:
+ if (c == 0xa1) return 1;
+ if (c == 0xa6) return 1;
+ if (c >= 0xa9 && c <= 0xac) return 1;
+ if (c == 0xaf) return 1;
+ if (c >= 0xb1 && c <= 0xb3) return 1;
+ if (c == 0xb5 || c == 0xb6) return 1;
+ if (c >= 0xb9 && c <= 0xbd) return 1;
+ if (c == 0xbf) return 1;
+ if (c >= 0xc0 && c <= 0xc2) return 1;
+ if (c >= 0xc4 && c <= 0xcf) return 1;
+ if (c >= 0xd1 && c <= 0xd6) return 1;
+ if (c >= 0xd8 && c <= 0xe2) return 1;
+ if (c >= 0xe4 && c <= 0xef) return 1;
+ if (c >= 0xf1 && c <= 0xf6) return 1;
+ if (c >= 0xf8 && c <= 0xfe) return 1;
+ break;
+
+ case ISO_8859_4:
+ if (c >= 0xa1 && c <= 0xa3) return 1;
+ if (c == 0xa5 || c == 0xa6) return 1;
+ if (c >= 0xa9 && c <= 0xac) return 1;
+ if (c == 0xae) return 1;
+ if (c == 0xb1 || c == 0xb3) return 1;
+ if (c == 0xb5 || c == 0xb6) return 1;
+ if (c >= 0xb9 && c <= 0xbf) return 1;
+ if (c >= 0xc0 && c <= 0xd6) return 1;
+ if (c >= 0xd8 && c <= 0xf6) return 1;
+ if (c >= 0xf8 && c <= 0xfe) return 1;
+ break;
+
+ case ISO_8859_5:
+ if (c >= 0xa1 && c <= 0xcf && c != 0xad) return 1;
+ if (c >= 0xd0 && c <= 0xff && c != 0xf0 && c != 0xfd) return 1;
+ break;
+
+ case ISO_8859_6:
+ if (c >= 0xc1 && c <= 0xda) return 1;
+ if (c >= 0xe0 && c <= 0xea) return 1;
+ if (c >= 0xeb && c <= 0xf2) return 1;
+ break;
+
+ case ISO_8859_7:
+ if (c == 0xb2 || c == 0xb3) return 1;
+ if (c == 0xb6) return 1;
+ if (c >= 0xb8 && c <= 0xba) return 1;
+ if (c >= 0xbc && c <= 0xbf) return 1;
+ if (c == 0xc0) return 1;
+ if (c >= 0xc1 && c <= 0xdb && c != 0xd2) return 1;
+ if (c >= 0xdc && c <= 0xfe) return 1;
+ break;
+
+ case ISO_8859_8:
+ if (c == 0xb2 || c == 0xb3 || c == 0xb5 || c == 0xb9) return 1;
+ if (c >= 0xbc && c <= 0xbe) return 1;
+ if (c >= 0xe0 && c <= 0xfa) return 1;
+ break;
+
+ case ISO_8859_10:
+ if (c >= 0xa1 && c <= 0xff) {
+ if (c != 0xa7 && c != 0xad && c != 0xb0 && c != 0xb7 && c != 0xbd)
+ return 1;
+ }
+ break;
+
+ case ISO_8859_11:
+ if (c >= 0xa1 && c <= 0xda) return 1;
+ if (c >= 0xdf && c <= 0xfb) return 1;
+ break;
+
+ case ISO_8859_13:
+ if (c == 0xa8) return 1;
+ if (c == 0xaa) return 1;
+ if (c == 0xaf) return 1;
+ if (c == 0xb2 || c == 0xb3 || c == 0xb5 || c == 0xb9) return 1;
+ if (c >= 0xbc && c <= 0xbe) return 1;
+ if (c == 0xb8) return 1;
+ if (c == 0xba) return 1;
+ if (c >= 0xbf && c <= 0xd6) return 1;
+ if (c >= 0xd8 && c <= 0xf6) return 1;
+ if (c >= 0xf8 && c <= 0xfe) return 1;
+ break;
+
+ case ISO_8859_14:
+ if (c >= 0xa1 && c <= 0xff) {
+ if (c == 0xa3 || c == 0xa7 || c == 0xa9 || c == 0xad || c == 0xae ||
+ c == 0xb6) return 0;
+ return 1;
+ }
+ break;
+
+ case ISO_8859_15:
+ if (c == 0xaa) return 1;
+ if (c >= 0xb2 && c <= 0xb3) return 1;
+ if (c == 0xb5) return 1;
+ if (c >= 0xb9 && c <= 0xba) return 1;
+ if (c >= 0xbc && c <= 0xbe) return 1;
+ if (c >= 0xc0 && c <= 0xd6) return 1;
+ if (c >= 0xd8 && c <= 0xf6) return 1;
+ if (c >= 0xf8 && c <= 0xff) return 1;
+ if (c == 0xa6) return 1;
+ if (c == 0xa8) return 1;
+ if (c == 0xb4) return 1;
+ if (c == 0xb8) return 1;
+ break;
+
+ case ISO_8859_16:
+ if (c == 0xa1) return 1;
+ if (c == 0xa2) return 1;
+ if (c == 0xa3) return 1;
+ if (c == 0xa6) return 1;
+ if (c == 0xa8) return 1;
+ if (c == 0xaa) return 1;
+ if (c == 0xac) return 1;
+ if (c == 0xae) return 1;
+ if (c == 0xaf) return 1;
+ if (c == 0xb2) return 1;
+ if (c == 0xb3) return 1;
+ if (c == 0xb4) return 1;
+ if (c >= 0xb8 && c <= 0xba) return 1;
+ if (c == 0xbc) return 1;
+ if (c == 0xbd) return 1;
+ if (c == 0xbe) return 1;
+ if (c == 0xbf) return 1;
+ if (c >= 0xc0 && c <= 0xde) return 1;
+ if (c >= 0xdf && c <= 0xff) return 1;
+ break;
+
+ case KOI8_R:
+ if (c == 0x9d) return 1;
+ if (c == 0xa3 || c == 0xb3) return 1;
+ /* fall */
+ case KOI8:
+ if (c >= 0xc0 && c <= 0xff) return 1;
+ break;
+
+ default:
+ exit(-1);
+ }
+
+ return 0;
+}
+
+static int IsAscii(int enc ARG_UNUSED, int c)
+{
+ if (c >= 0x00 && c <= 0x7f) return 1;
+ return 0;
+}
+
+static int IsNewline(int enc ARG_UNUSED, int c)
+{
+ if (c == 0x0a) return 1;
+ return 0;
+}
+
+static int exec(FILE* fp, ENC_INFO* einfo)
+{
+#define NCOL 8
+
+ int c, val, enc;
+
+ enc = einfo->num;
+
+ fprintf(fp, "static const unsigned short Enc%s_CtypeTable[256] = {\n",
+ einfo->name);
+
+ for (c = 0; c < 256; c++) {
+ val = 0;
+ if (IsNewline(enc, c)) val |= BIT_CTYPE_NEWLINE;
+ if (IsAlpha (enc, c)) val |= (BIT_CTYPE_ALPHA | BIT_CTYPE_ALNUM);
+ if (IsBlank (enc, c)) val |= BIT_CTYPE_BLANK;
+ if (IsCntrl (enc, c)) val |= BIT_CTYPE_CNTRL;
+ if (IsDigit (enc, c)) val |= (BIT_CTYPE_DIGIT | BIT_CTYPE_ALNUM);
+ if (IsGraph (enc, c)) val |= BIT_CTYPE_GRAPH;
+ if (IsLower (enc, c)) val |= BIT_CTYPE_LOWER;
+ if (IsPrint (enc, c)) val |= BIT_CTYPE_PRINT;
+ if (IsPunct (enc, c)) val |= BIT_CTYPE_PUNCT;
+ if (IsSpace (enc, c)) val |= BIT_CTYPE_SPACE;
+ if (IsUpper (enc, c)) val |= BIT_CTYPE_UPPER;
+ if (IsXDigit(enc, c)) val |= BIT_CTYPE_XDIGIT;
+ if (IsWord (enc, c)) val |= BIT_CTYPE_WORD;
+ if (IsAscii (enc, c)) val |= BIT_CTYPE_ASCII;
+
+ if (c % NCOL == 0) fputs(" ", fp);
+ fprintf(fp, "0x%04x", val);
+ if (c != 255) fputs(",", fp);
+ if (c != 0 && c % NCOL == (NCOL-1))
+ fputs("\n", fp);
+ else
+ fputs(" ", fp);
+ }
+ fprintf(fp, "};\n");
+ return 0;
+}
+
+extern int main(int argc ARG_UNUSED, char* argv[] ARG_UNUSED)
+{
+ int i;
+ FILE* fp = stdout;
+
+ setlocale(LC_ALL, "C");
+ /* setlocale(LC_ALL, "POSIX"); */
+ /* setlocale(LC_ALL, "en_GB.iso88591"); */
+ /* setlocale(LC_ALL, "de_BE.iso88591"); */
+ /* setlocale(LC_ALL, "fr_FR.iso88591"); */
+
+ for (i = 0; i < (int )(sizeof(Info)/sizeof(ENC_INFO)); i++) {
+ exec(fp, &Info[i]);
+ }
+
+ return 0;
+}
diff --git a/enc/shift_jis.c b/enc/shift_jis.c
index d1357b3212..e2bcaec189 100644
--- a/enc/shift_jis.c
+++ b/enc/shift_jis.c
@@ -1,8 +1,9 @@
/**********************************************************************
- sjis.c - Oniguruma (regular expression library)
+ sjis.c - Onigmo (Oniguruma-mod) (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2011 K.Takata <kentkt AT csc DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -67,6 +68,97 @@ static const char SJIS_CAN_BE_TRAIL_TABLE[256] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0
};
+static const OnigPairCaseFoldCodes CaseFoldMap[] = {
+ /* Fullwidth Alphabet */
+ { 0x8260, 0x8281 },
+ { 0x8261, 0x8282 },
+ { 0x8262, 0x8283 },
+ { 0x8263, 0x8284 },
+ { 0x8264, 0x8285 },
+ { 0x8265, 0x8286 },
+ { 0x8266, 0x8287 },
+ { 0x8267, 0x8288 },
+ { 0x8268, 0x8289 },
+ { 0x8269, 0x828a },
+ { 0x826a, 0x828b },
+ { 0x826b, 0x828c },
+ { 0x826c, 0x828d },
+ { 0x826d, 0x828e },
+ { 0x826e, 0x828f },
+ { 0x826f, 0x8290 },
+ { 0x8270, 0x8291 },
+ { 0x8271, 0x8292 },
+ { 0x8272, 0x8293 },
+ { 0x8273, 0x8294 },
+ { 0x8274, 0x8295 },
+ { 0x8275, 0x8296 },
+ { 0x8276, 0x8297 },
+ { 0x8277, 0x8298 },
+ { 0x8278, 0x8299 },
+ { 0x8279, 0x829a },
+
+ /* Greek */
+ { 0x839f, 0x83bf },
+ { 0x83a0, 0x83c0 },
+ { 0x83a1, 0x83c1 },
+ { 0x83a2, 0x83c2 },
+ { 0x83a3, 0x83c3 },
+ { 0x83a4, 0x83c4 },
+ { 0x83a5, 0x83c5 },
+ { 0x83a6, 0x83c6 },
+ { 0x83a7, 0x83c7 },
+ { 0x83a8, 0x83c8 },
+ { 0x83a9, 0x83c9 },
+ { 0x83aa, 0x83ca },
+ { 0x83ab, 0x83cb },
+ { 0x83ac, 0x83cc },
+ { 0x83ad, 0x83cd },
+ { 0x83ae, 0x83ce },
+ { 0x83af, 0x83cf },
+ { 0x83b0, 0x83d0 },
+ { 0x83b1, 0x83d1 },
+ { 0x83b2, 0x83d2 },
+ { 0x83b3, 0x83d3 },
+ { 0x83b4, 0x83d4 },
+ { 0x83b5, 0x83d5 },
+ { 0x83b6, 0x83d6 },
+
+ /* Cyrillic */
+ { 0x8440, 0x8470 },
+ { 0x8441, 0x8471 },
+ { 0x8442, 0x8472 },
+ { 0x8443, 0x8473 },
+ { 0x8444, 0x8474 },
+ { 0x8445, 0x8475 },
+ { 0x8446, 0x8476 },
+ { 0x8447, 0x8477 },
+ { 0x8448, 0x8478 },
+ { 0x8449, 0x8479 },
+ { 0x844a, 0x847a },
+ { 0x844b, 0x847b },
+ { 0x844c, 0x847c },
+ { 0x844d, 0x847d },
+ { 0x844e, 0x847e },
+ { 0x844f, 0x8480 },
+ { 0x8450, 0x8481 },
+ { 0x8451, 0x8482 },
+ { 0x8452, 0x8483 },
+ { 0x8453, 0x8484 },
+ { 0x8454, 0x8485 },
+ { 0x8455, 0x8486 },
+ { 0x8456, 0x8487 },
+ { 0x8457, 0x8488 },
+ { 0x8458, 0x8489 },
+ { 0x8459, 0x848a },
+ { 0x845a, 0x848b },
+ { 0x845b, 0x848c },
+ { 0x845c, 0x848d },
+ { 0x845d, 0x848e },
+ { 0x845e, 0x848f },
+ { 0x845f, 0x8490 },
+ { 0x8460, 0x8491 },
+};
+
#define SJIS_ISMB_FIRST(byte) (EncLen_SJIS[byte] > 1)
#define SJIS_ISMB_TRAIL(byte) SJIS_CAN_BE_TRAIL_TABLE[(byte)]
@@ -135,13 +227,16 @@ code_to_mbclen(OnigCodePoint code, OnigEncoding enc ARG_UNUSED)
if (EncLen_SJIS[(int )code] == 1)
return 1;
else
- return 0;
+ return ONIGERR_INVALID_CODE_POINT_VALUE;
}
else if (code <= 0xffff) {
+ int low = code & 0xff;
+ if (low < 0x40 || low == 0x7f || 0xfc < low)
+ return ONIGERR_INVALID_CODE_POINT_VALUE;
return 2;
}
else
- return ONIGERR_INVALID_CODE_POINT_VALUE;
+ return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE;
}
static OnigCodePoint
@@ -150,7 +245,7 @@ mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
int c, i, len;
OnigCodePoint n;
- len = enclen(enc, p, end);
+ len = mbc_enc_len(p, end, enc);
c = *p++;
n = c;
if (len == 1) return n;
@@ -172,10 +267,90 @@ code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
*p++ = (UChar )(code & 0xff);
#if 0
- if (enclen(enc, buf) != (p - buf))
+ if (mbc_enc_len(buf, p, enc) != (p - buf))
return REGERR_INVALID_CODE_POINT_VALUE;
#endif
- return (int)(p - buf);
+ return (int )(p - buf);
+}
+
+static int
+apply_all_case_fold(OnigCaseFoldType flag,
+ OnigApplyAllCaseFoldFunc f, void* arg, OnigEncoding enc)
+{
+ return onigenc_apply_all_case_fold_with_map(
+ sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,
+ flag, f, arg);
+}
+
+static OnigCodePoint
+get_lower_case(OnigCodePoint code)
+{
+ if (ONIGENC_IS_IN_RANGE(code, 0x8260, 0x8279)) {
+ /* Fullwidth Alphabet */
+ return (OnigCodePoint )(code + 0x0021);
+ }
+ else if (ONIGENC_IS_IN_RANGE(code, 0x839f, 0x83b6)) {
+ /* Greek */
+ return (OnigCodePoint )(code + 0x0020);
+ }
+ else if (ONIGENC_IS_IN_RANGE(code, 0x8440, 0x8460)) {
+ /* Cyrillic */
+ int d = (code >= 0x844f) ? 1 : 0;
+ return (OnigCodePoint )(code + (0x0030 + d));
+ }
+ return code;
+}
+
+static OnigCodePoint
+get_upper_case(OnigCodePoint code)
+{
+ if (ONIGENC_IS_IN_RANGE(code, 0x8281, 0x829a)) {
+ /* Fullwidth Alphabet */
+ return (OnigCodePoint )(code - 0x0021);
+ }
+ else if (ONIGENC_IS_IN_RANGE(code, 0x83bf, 0x83d6)) {
+ /* Greek */
+ return (OnigCodePoint )(code - 0x0020);
+ }
+ else if (ONIGENC_IS_IN_RANGE(code, 0x8470, 0x847e) ||
+ ONIGENC_IS_IN_RANGE(code, 0x8480, 0x8491)) {
+ /* Cyrillic */
+ int d = (code >= 0x8480) ? 1 : 0;
+ return (OnigCodePoint )(code - (0x0030 - d));
+ }
+ return code;
+}
+
+static int
+get_case_fold_codes_by_str(OnigCaseFoldType flag,
+ const OnigUChar* p, const OnigUChar* end,
+ OnigCaseFoldCodeItem items[], OnigEncoding enc)
+{
+ int len;
+ OnigCodePoint code, code_lo, code_up;
+
+ code = mbc_to_code(p, end, enc);
+ if (ONIGENC_IS_ASCII_CODE(code))
+ return onigenc_ascii_get_case_fold_codes_by_str(flag, p, end, items, enc);
+
+ len = mbc_enc_len(p, end, enc);
+ code_lo = get_lower_case(code);
+ code_up = get_upper_case(code);
+
+ if (code != code_lo) {
+ items[0].byte_len = len;
+ items[0].code_len = 1;
+ items[0].code[0] = code_lo;
+ return 1;
+ }
+ else if (code != code_up) {
+ items[0].byte_len = len;
+ items[0].code_len = 1;
+ items[0].code[0] = code_up;
+ return 1;
+ }
+
+ return 0;
}
static int
@@ -191,12 +366,11 @@ mbc_case_fold(OnigCaseFoldType flag,
return 1;
}
else {
- int i;
- int len = enclen(enc, p, end);
+ OnigCodePoint code;
+ int len;
- for (i = 0; i < len; i++) {
- *lower++ = *p++;
- }
+ code = get_lower_case(mbc_to_code(p, end, enc));
+ len = code_to_mbc(code, lower, enc);
(*pp) += len;
return len; /* return byte length of converted char to lower */
}
@@ -245,7 +419,7 @@ left_adjust_char_head(const UChar* start, const UChar* s, const UChar* end, Onig
}
}
}
- len = enclen(enc, p, end);
+ len = mbc_enc_len(p, end, enc);
if (p + len > s) return (UChar* )p;
p += len;
return (UChar* )(p + ((s - p) & ~1));
@@ -278,6 +452,47 @@ static const OnigCodePoint CR_Katakana[] = {
0x8380, 0x8396,
}; /* CR_Katakana */
+#ifdef ENC_CP932
+static const OnigCodePoint CR_Han[] = {
+ 6,
+ 0x8157, 0x8157,
+ 0x889f, 0x9872, /* Kanji level 1 */
+ 0x989f, 0x9ffc, /* Kanji level 2 */
+ 0xe040, 0xeaa4, /* Kanji level 2 */
+ 0xed40, 0xeeec, /* NEC-selected IBM extended characters (without symbols) */
+ 0xfa5c, 0xfc4b, /* IBM extended characters (without symbols) */
+}; /* CR_Han */
+#else
+static const OnigCodePoint CR_Han[] = {
+ 4,
+ 0x8157, 0x8157,
+ 0x889f, 0x9872, /* Kanji level 1 */
+ 0x989f, 0x9ffc, /* Kanji level 2 */
+ 0xe040, 0xeaa4, /* Kanji level 2 */
+}; /* CR_Han */
+#endif
+
+static const OnigCodePoint CR_Latin[] = {
+ 4,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x8260, 0x8279,
+ 0x8281, 0x829a,
+}; /* CR_Latin */
+
+static const OnigCodePoint CR_Greek[] = {
+ 2,
+ 0x839f, 0x83b6,
+ 0x83bf, 0x83d6,
+}; /* CR_Greek */
+
+static const OnigCodePoint CR_Cyrillic[] = {
+ 3,
+ 0x8440, 0x8460,
+ 0x8470, 0x847f,
+ 0x8480, 0x8491,
+}; /* CR_Cyrillic */
+
static int
init_property_list(void)
{
@@ -285,6 +500,10 @@ init_property_list(void)
PROPERTY_LIST_ADD_PROP("hiragana", CR_Hiragana);
PROPERTY_LIST_ADD_PROP("katakana", CR_Katakana);
+ PROPERTY_LIST_ADD_PROP("han", CR_Han);
+ PROPERTY_LIST_ADD_PROP("latin", CR_Latin);
+ PROPERTY_LIST_ADD_PROP("greek", CR_Greek);
+ PROPERTY_LIST_ADD_PROP("cyrillic", CR_Cyrillic);
PropertyInited = 1;
end:
@@ -308,7 +527,7 @@ property_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end)
return onigenc_minimum_property_name_to_ctype(enc, s, e);
}
- return (int)ctype;
+ return (int )ctype;
}
static int
@@ -357,6 +576,7 @@ get_ctype_code_range(OnigCtype ctype, OnigCodePoint* sb_out,
}
}
+#ifndef ENC_CP932
OnigEncodingDefine(shift_jis, Shift_JIS) = {
mbc_enc_len,
"Shift_JIS", /* name */
@@ -367,14 +587,15 @@ OnigEncodingDefine(shift_jis, Shift_JIS) = {
code_to_mbclen,
code_to_mbc,
mbc_case_fold,
- onigenc_ascii_apply_all_case_fold,
- onigenc_ascii_get_case_fold_codes_by_str,
+ apply_all_case_fold,
+ get_case_fold_codes_by_str,
property_name_to_ctype,
is_code_ctype,
get_ctype_code_range,
left_adjust_char_head,
is_allowed_reverse_match,
- 0
+ 0,
+ ONIGENC_FLAG_NONE,
};
/*
* Name: Shift_JIS
@@ -384,38 +605,10 @@ OnigEncodingDefine(shift_jis, Shift_JIS) = {
*/
/*
- * Name: Windows-31J
- * MIBenum: 2024
- * Link: http://www.iana.org/assignments/character-sets
- * Link: http://www.microsoft.com/globaldev/reference/dbcs/932.mspx
- * Link: http://ja.wikipedia.org/wiki/Windows-31J
- * Link: http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/windows-932-2000.ucm
- *
- * Windows Standard Character Set and its mapping to Unicode by Microsoft.
- * Since 1.9.3, SJIS is the alias of Windows-31J because its character
- * set is usually this one even if its mapping may differ.
- */
-ENC_REPLICATE("Windows-31J", "Shift_JIS")
-ENC_ALIAS("CP932", "Windows-31J")
-ENC_ALIAS("csWindows31J", "Windows-31J") /* IANA. IE6 don't accept Windows-31J but csWindows31J. */
-ENC_ALIAS("SJIS", "Windows-31J")
-
-/*
- * Name: PCK
- * Link: http://download.oracle.com/docs/cd/E19253-01/819-0606/x-2chn0/index.html
- * Link: http://download.oracle.com/docs/cd/E19253-01/819-0606/appb-pckwarn-1/index.html
- *
- * Solaris's SJIS variant. Its set is Windows Standard Character Set; it
- * consists JIS X 0201 Latin (US-ASCII), JIS X 0201 Katakana, JIS X 0208, NEC
- * special characters, NEC-selected IBM extended characters, and IBM extended
- * characters. Solaris's iconv seems to use SJIS-open.
- */
-ENC_ALIAS("PCK", "Windows-31J")
-
-/*
* Name: MacJapanese
* Link: http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/JAPANESE.TXT
* Link: http://ja.wikipedia.org/wiki/MacJapanese
*/
ENC_REPLICATE("MacJapanese", "Shift_JIS")
ENC_ALIAS("MacJapan", "MacJapanese")
+#endif
diff --git a/enc/trans/JIS/JISX0213-1%UCS@BMP.src b/enc/trans/JIS/JISX0213-1%UCS@BMP.src
new file mode 100644
index 0000000000..09377be66b
--- /dev/null
+++ b/enc/trans/JIS/JISX0213-1%UCS@BMP.src
@@ -0,0 +1,1926 @@
+# $NetBSD: JISX0213-1%UCS@BMP.src,v 1.1 2007/03/05 16:58:33 tnozaki Exp $
+
+TYPE ROWCOL
+NAME "JISX0213-1/UCS:BMP"
+SRC_ZONE 0x21-0x7E / 0x21-0x7E / 8
+OOB_MODE INVALID
+DST_INVALID 0xFFFE
+DST_UNIT_BITS 16
+
+BEGIN_MAP
+## JIS X 0213:2004 vs Unicode mapping table
+##
+## Date: 22 May 2006
+## License:
+## Copyright (C) 2001 earthian@tama.or.jp, All Rights Reserved.
+## Copyright (C) 2001 I'O, All Rights Reserved.
+## Copyright (C) 2006 Project X0213, All Rights Reserved.
+## You can use, modify, distribute this table freely.
+## Note:
+## 3-XXXX JIS X 0213:2004 plane 1 (GL encoding)
+## 4-XXXX JIS X 0213:2000 plane 2 (GL encoding)
+## [1983] JIS codepoint defined by JIS X 0208-1983
+## [1990] JIS codepoint defined by JIS X 0208-1990
+## [2000] JIS codepoint defined by JIS X 0213:2000
+## [2004] JIS codepoint defined by JIS X 0213:2004
+## [Unicode3.1] UCS codepoint defined by Unicode 3.1
+## [Unicode3.2] UCS codepoint defined by Unicode 3.2
+## Fullwidth UCS fullwidth form (U+Fxxx)
+## Windows Windows (CP932) mapping
+## Some 0213 character can't represent by one UCS character.
+## In this table, such characters are described as 'U+xxxx+xxxx'.
+##
+## JIS Unicode Name Note
+0x222F = 0xFF07 # 0x0027
+0x2230 = 0xFF02 # 0x0022
+0x2231 = 0xFF0D # 0x002D
+0x2232 = 0xFF5E # 0x007E
+0x2233 = 0x3033
+0x2234 = 0x3034
+0x2235 = 0x3035
+0x2236 = 0x303B
+0x2237 = 0x303C
+0x2238 = 0x30FF
+0x2239 = 0x309F
+0x2242 = 0x2284
+0x2243 = 0x2285
+0x2244 = 0x228A
+0x2245 = 0x228B
+0x2246 = 0x2209
+0x2247 = 0x2205
+0x2248 = 0x2305
+0x2249 = 0x2306
+0x2251 = 0x2295
+0x2252 = 0x2296
+0x2253 = 0x2297
+0x2254 = 0x2225
+0x2255 = 0x2226
+0x2256 = 0xFF5F
+0x2257 = 0xFF60
+0x2258 = 0x3018
+0x2259 = 0x3019
+0x225A = 0x3016
+0x225B = 0x3017
+0x226B = 0x2262
+0x226C = 0x2243
+0x226D = 0x2245
+0x226E = 0x2248
+0x226F = 0x2276
+0x2270 = 0x2277
+0x2271 = 0x2194
+0x227A = 0x266E
+0x227B = 0x266B
+0x227C = 0x266C
+0x227D = 0x2669
+0x2321 = 0x25B7
+0x2322 = 0x25B6
+0x2323 = 0x25C1
+0x2324 = 0x25C0
+0x2325 = 0x2197
+0x2326 = 0x2198
+0x2327 = 0x2196
+0x2328 = 0x2199
+0x2329 = 0x21C4
+0x232A = 0x21E8
+0x232B = 0x21E6
+0x232C = 0x21E7
+0x232D = 0x21E9
+0x232E = 0x2934
+0x232F = 0x2935
+0x233A = 0x29BF
+0x233B = 0x25C9
+0x233C = 0x303D
+0x233D = 0xFE46
+0x233E = 0xFE45
+0x233F = 0x25E6
+0x2340 = 0x2022
+0x235B = 0x2213
+0x235C = 0x2135
+0x235D = 0x210F
+0x235E = 0x33CB
+0x235F = 0x2113
+0x2360 = 0x2127
+0x237B = 0x30A0
+0x237C = 0x2013
+0x237D = 0x29FA
+0x237E = 0x29FB
+0x2474 = 0x3094
+0x2475 = 0x3095
+0x2476 = 0x3096
+#0x2477 = 0x304B + 0x309A
+#0x2478 = 0x304D + 0x309A
+#0x2479 = 0x304F + 0x309A
+#0x247A = 0x3051 + 0x309A
+#0x247B = 0x3053 + 0x309A
+#0x2577 = 0x30AB + 0x309A
+#0x2578 = 0x30AD + 0x309A
+#0x2579 = 0x30AF + 0x309A
+#0x257A = 0x30B1 + 0x309A
+#0x257B = 0x30B3 + 0x309A
+#0x257C = 0x30BB + 0x309A
+#0x257D = 0x30C4 + 0x309A
+#0x257E = 0x30C8 + 0x309A
+0x2639 = 0x2664
+0x263A = 0x2660
+0x263B = 0x2662
+0x263C = 0x2666
+0x263D = 0x2661
+0x263E = 0x2665
+0x263F = 0x2667
+0x2640 = 0x2663
+0x2659 = 0x03C2
+0x265A = 0x24F5
+0x265B = 0x24F6
+0x265C = 0x24F7
+0x265D = 0x24F8
+0x265E = 0x24F9
+0x265F = 0x24FA
+0x2660 = 0x24FB
+0x2661 = 0x24FC
+0x2662 = 0x24FD
+0x2663 = 0x24FE
+0x2664 = 0x2616
+0x2665 = 0x2617
+0x2666 = 0x3020
+0x2667 = 0x260E
+0x2668 = 0x2600
+0x2669 = 0x2601
+0x266A = 0x2602
+0x266B = 0x2603
+0x266C = 0x2668
+0x266D = 0x25B1
+0x266E = 0x31F0
+0x266F = 0x31F1
+0x2670 = 0x31F2
+0x2671 = 0x31F3
+0x2672 = 0x31F4
+0x2673 = 0x31F5
+0x2674 = 0x31F6
+0x2675 = 0x31F7
+0x2676 = 0x31F8
+0x2677 = 0x31F9
+#0x2678 = 0x31F7 + 0x309A
+0x2679 = 0x31FA
+0x267A = 0x31FB
+0x267B = 0x31FC
+0x267C = 0x31FD
+0x267D = 0x31FE
+0x267E = 0x31FF
+0x2742 = 0x23BE
+0x2743 = 0x23BF
+0x2744 = 0x23C0
+0x2745 = 0x23C1
+0x2746 = 0x23C2
+0x2747 = 0x23C3
+0x2748 = 0x23C4
+0x2749 = 0x23C5
+0x274A = 0x23C6
+0x274B = 0x23C7
+0x274C = 0x23C8
+0x274D = 0x23C9
+0x274E = 0x23CA
+0x274F = 0x23CB
+0x2750 = 0x23CC
+0x2772 = 0x30F7
+0x2773 = 0x30F8
+0x2774 = 0x30F9
+0x2775 = 0x30FA
+0x2776 = 0x22DA
+0x2777 = 0x22DB
+0x2778 = 0x2153
+0x2779 = 0x2154
+0x277A = 0x2155
+0x277B = 0x2713
+0x277C = 0x2318
+0x277D = 0x2423
+0x277E = 0x23CE
+0x2841 = 0x3251
+0x2842 = 0x3252
+0x2843 = 0x3253
+0x2844 = 0x3254
+0x2845 = 0x3255
+0x2846 = 0x3256
+0x2847 = 0x3257
+0x2848 = 0x3258
+0x2849 = 0x3259
+0x284A = 0x325A
+0x284B = 0x325B
+0x284C = 0x325C
+0x284D = 0x325D
+0x284E = 0x325E
+0x284F = 0x325F
+0x2850 = 0x32B1
+0x2851 = 0x32B2
+0x2852 = 0x32B3
+0x2853 = 0x32B4
+0x2854 = 0x32B5
+0x2855 = 0x32B6
+0x2856 = 0x32B7
+0x2857 = 0x32B8
+0x2858 = 0x32B9
+0x2859 = 0x32BA
+0x285A = 0x32BB
+0x285B = 0x32BC
+0x285C = 0x32BD
+0x285D = 0x32BE
+0x285E = 0x32BF
+0x2867 = 0x25D0
+0x2868 = 0x25D1
+0x2869 = 0x25D2
+0x286A = 0x25D3
+0x286B = 0x203C
+0x286C = 0x2047
+0x286D = 0x2048
+0x286E = 0x2049
+0x286F = 0x01CD
+0x2870 = 0x01CE
+0x2871 = 0x01D0
+0x2872 = 0x1E3E
+0x2873 = 0x1E3F
+0x2874 = 0x01F8
+0x2875 = 0x01F9
+0x2876 = 0x01D1
+0x2877 = 0x01D2
+0x2878 = 0x01D4
+0x2879 = 0x01D6
+0x287A = 0x01D8
+0x287B = 0x01DA
+0x287C = 0x01DC
+0x2921 = 0x20AC
+0x2922 = 0x00A0
+0x2923 = 0x00A1
+0x2924 = 0x00A4
+0x2925 = 0x00A6
+0x2926 = 0x00A9
+0x2927 = 0x00AA
+0x2928 = 0x00AB
+0x2929 = 0x00AD
+0x292A = 0x00AE
+0x292B = 0x00AF
+0x292C = 0x00B2
+0x292D = 0x00B3
+0x292E = 0x00B7
+0x292F = 0x00B8
+0x2930 = 0x00B9
+0x2931 = 0x00BA
+0x2932 = 0x00BB
+0x2933 = 0x00BC
+0x2934 = 0x00BD
+0x2935 = 0x00BE
+0x2936 = 0x00BF
+0x2937 = 0x00C0
+0x2938 = 0x00C1
+0x2939 = 0x00C2
+0x293A = 0x00C3
+0x293B = 0x00C4
+0x293C = 0x00C5
+0x293D = 0x00C6
+0x293E = 0x00C7
+0x293F = 0x00C8
+0x2940 = 0x00C9
+0x2941 = 0x00CA
+0x2942 = 0x00CB
+0x2943 = 0x00CC
+0x2944 = 0x00CD
+0x2945 = 0x00CE
+0x2946 = 0x00CF
+0x2947 = 0x00D0
+0x2948 = 0x00D1
+0x2949 = 0x00D2
+0x294A = 0x00D3
+0x294B = 0x00D4
+0x294C = 0x00D5
+0x294D = 0x00D6
+0x294E = 0x00D8
+0x294F = 0x00D9
+0x2950 = 0x00DA
+0x2951 = 0x00DB
+0x2952 = 0x00DC
+0x2953 = 0x00DD
+0x2954 = 0x00DE
+0x2955 = 0x00DF
+0x2956 = 0x00E0
+0x2957 = 0x00E1
+0x2958 = 0x00E2
+0x2959 = 0x00E3
+0x295A = 0x00E4
+0x295B = 0x00E5
+0x295C = 0x00E6
+0x295D = 0x00E7
+0x295E = 0x00E8
+0x295F = 0x00E9
+0x2960 = 0x00EA
+0x2961 = 0x00EB
+0x2962 = 0x00EC
+0x2963 = 0x00ED
+0x2964 = 0x00EE
+0x2965 = 0x00EF
+0x2966 = 0x00F0
+0x2967 = 0x00F1
+0x2968 = 0x00F2
+0x2969 = 0x00F3
+0x296A = 0x00F4
+0x296B = 0x00F5
+0x296C = 0x00F6
+0x296D = 0x00F8
+0x296E = 0x00F9
+0x296F = 0x00FA
+0x2970 = 0x00FB
+0x2971 = 0x00FC
+0x2972 = 0x00FD
+0x2973 = 0x00FE
+0x2974 = 0x00FF
+0x2975 = 0x0100
+0x2976 = 0x012A
+0x2977 = 0x016A
+0x2978 = 0x0112
+0x2979 = 0x014C
+0x297A = 0x0101
+0x297B = 0x012B
+0x297C = 0x016B
+0x297D = 0x0113
+0x297E = 0x014D
+0x2A21 = 0x0104
+0x2A22 = 0x02D8
+0x2A23 = 0x0141
+0x2A24 = 0x013D
+0x2A25 = 0x015A
+0x2A26 = 0x0160
+0x2A27 = 0x015E
+0x2A28 = 0x0164
+0x2A29 = 0x0179
+0x2A2A = 0x017D
+0x2A2B = 0x017B
+0x2A2C = 0x0105
+0x2A2D = 0x02DB
+0x2A2E = 0x0142
+0x2A2F = 0x013E
+0x2A30 = 0x015B
+0x2A31 = 0x02C7
+0x2A32 = 0x0161
+0x2A33 = 0x015F
+0x2A34 = 0x0165
+0x2A35 = 0x017A
+0x2A36 = 0x02DD
+0x2A37 = 0x017E
+0x2A38 = 0x017C
+0x2A39 = 0x0154
+0x2A3A = 0x0102
+0x2A3B = 0x0139
+0x2A3C = 0x0106
+0x2A3D = 0x010C
+0x2A3E = 0x0118
+0x2A3F = 0x011A
+0x2A40 = 0x010E
+0x2A41 = 0x0143
+0x2A42 = 0x0147
+0x2A43 = 0x0150
+0x2A44 = 0x0158
+0x2A45 = 0x016E
+0x2A46 = 0x0170
+0x2A47 = 0x0162
+0x2A48 = 0x0155
+0x2A49 = 0x0103
+0x2A4A = 0x013A
+0x2A4B = 0x0107
+0x2A4C = 0x010D
+0x2A4D = 0x0119
+0x2A4E = 0x011B
+0x2A4F = 0x010F
+0x2A50 = 0x0111
+0x2A51 = 0x0144
+0x2A52 = 0x0148
+0x2A53 = 0x0151
+0x2A54 = 0x0159
+0x2A55 = 0x016F
+0x2A56 = 0x0171
+0x2A57 = 0x0163
+0x2A58 = 0x02D9
+0x2A59 = 0x0108
+0x2A5A = 0x011C
+0x2A5B = 0x0124
+0x2A5C = 0x0134
+0x2A5D = 0x015C
+0x2A5E = 0x016C
+0x2A5F = 0x0109
+0x2A60 = 0x011D
+0x2A61 = 0x0125
+0x2A62 = 0x0135
+0x2A63 = 0x015D
+0x2A64 = 0x016D
+0x2A65 = 0x0271
+0x2A66 = 0x028B
+0x2A67 = 0x027E
+0x2A68 = 0x0283
+0x2A69 = 0x0292
+0x2A6A = 0x026C
+0x2A6B = 0x026E
+0x2A6C = 0x0279
+0x2A6D = 0x0288
+0x2A6E = 0x0256
+0x2A6F = 0x0273
+0x2A70 = 0x027D
+0x2A71 = 0x0282
+0x2A72 = 0x0290
+0x2A73 = 0x027B
+0x2A74 = 0x026D
+0x2A75 = 0x025F
+0x2A76 = 0x0272
+0x2A77 = 0x029D
+0x2A78 = 0x028E
+0x2A79 = 0x0261
+0x2A7A = 0x014B
+0x2A7B = 0x0270
+0x2A7C = 0x0281
+0x2A7D = 0x0127
+0x2A7E = 0x0295
+0x2B21 = 0x0294
+0x2B22 = 0x0266
+0x2B23 = 0x0298
+0x2B24 = 0x01C2
+0x2B25 = 0x0253
+0x2B26 = 0x0257
+0x2B27 = 0x0284
+0x2B28 = 0x0260
+0x2B29 = 0x0193
+0x2B2A = 0x0153
+0x2B2B = 0x0152
+0x2B2C = 0x0268
+0x2B2D = 0x0289
+0x2B2E = 0x0258
+0x2B2F = 0x0275
+0x2B30 = 0x0259
+0x2B31 = 0x025C
+0x2B32 = 0x025E
+0x2B33 = 0x0250
+0x2B34 = 0x026F
+0x2B35 = 0x028A
+0x2B36 = 0x0264
+0x2B37 = 0x028C
+0x2B38 = 0x0254
+0x2B39 = 0x0251
+0x2B3A = 0x0252
+0x2B3B = 0x028D
+0x2B3C = 0x0265
+0x2B3D = 0x02A2
+0x2B3E = 0x02A1
+0x2B3F = 0x0255
+0x2B40 = 0x0291
+0x2B41 = 0x027A
+0x2B42 = 0x0267
+0x2B43 = 0x025A
+#0x2B44 = 0x00E6 + 0x0300
+0x2B45 = 0x01FD
+0x2B46 = 0x1F70
+0x2B47 = 0x1F71
+#0x2B48 = 0x0254 + 0x0300
+#0x2B49 = 0x0254 + 0x0301
+#0x2B4A = 0x028C + 0x0300
+#0x2B4B = 0x028C + 0x0301
+#0x2B4C = 0x0259 + 0x0300
+#0x2B4D = 0x0259 + 0x0301
+#0x2B4E = 0x025A + 0x0300
+#0x2B4F = 0x025A + 0x0301
+0x2B50 = 0x1F72
+0x2B51 = 0x1F73
+0x2B52 = 0x0361
+0x2B53 = 0x02C8
+0x2B54 = 0x02CC
+0x2B55 = 0x02D0
+0x2B56 = 0x02D1
+0x2B57 = 0x0306
+0x2B58 = 0x203F
+0x2B59 = 0x030B
+0x2B5A = 0x0301
+0x2B5B = 0x0304
+0x2B5C = 0x0300
+0x2B5D = 0x030F
+0x2B5E = 0x030C
+0x2B5F = 0x0302
+0x2B60 = 0x02E5
+0x2B61 = 0x02E6
+0x2B62 = 0x02E7
+0x2B63 = 0x02E8
+0x2B64 = 0x02E9
+#0x2B65 = 0x02E9 + 0x02E5
+#0x2B66 = 0x02E5 + 0x02E9
+0x2B67 = 0x0325
+0x2B68 = 0x032C
+0x2B69 = 0x0339
+0x2B6A = 0x031C
+0x2B6B = 0x031F
+0x2B6C = 0x0320
+0x2B6D = 0x0308
+0x2B6E = 0x033D
+0x2B6F = 0x0329
+0x2B70 = 0x032F
+0x2B71 = 0x02DE
+0x2B72 = 0x0324
+0x2B73 = 0x0330
+0x2B74 = 0x033C
+0x2B75 = 0x0334
+0x2B76 = 0x031D
+0x2B77 = 0x031E
+0x2B78 = 0x0318
+0x2B79 = 0x0319
+0x2B7A = 0x032A
+0x2B7B = 0x033A
+0x2B7C = 0x033B
+0x2B7D = 0x0303
+0x2B7E = 0x031A
+0x2C21 = 0x2776
+0x2C22 = 0x2777
+0x2C23 = 0x2778
+0x2C24 = 0x2779
+0x2C25 = 0x277A
+0x2C26 = 0x277B
+0x2C27 = 0x277C
+0x2C28 = 0x277D
+0x2C29 = 0x277E
+0x2C2A = 0x277F
+0x2C2B = 0x24EB
+0x2C2C = 0x24EC
+0x2C2D = 0x24ED
+0x2C2E = 0x24EE
+0x2C2F = 0x24EF
+0x2C30 = 0x24F0
+0x2C31 = 0x24F1
+0x2C32 = 0x24F2
+0x2C33 = 0x24F3
+0x2C34 = 0x24F4
+0x2C35 = 0x2170
+0x2C36 = 0x2171
+0x2C37 = 0x2172
+0x2C38 = 0x2173
+0x2C39 = 0x2174
+0x2C3A = 0x2175
+0x2C3B = 0x2176
+0x2C3C = 0x2177
+0x2C3D = 0x2178
+0x2C3E = 0x2179
+0x2C3F = 0x217A
+0x2C40 = 0x217B
+0x2C41 = 0x24D0
+0x2C42 = 0x24D1
+0x2C43 = 0x24D2
+0x2C44 = 0x24D3
+0x2C45 = 0x24D4
+0x2C46 = 0x24D5
+0x2C47 = 0x24D6
+0x2C48 = 0x24D7
+0x2C49 = 0x24D8
+0x2C4A = 0x24D9
+0x2C4B = 0x24DA
+0x2C4C = 0x24DB
+0x2C4D = 0x24DC
+0x2C4E = 0x24DD
+0x2C4F = 0x24DE
+0x2C50 = 0x24DF
+0x2C51 = 0x24E0
+0x2C52 = 0x24E1
+0x2C53 = 0x24E2
+0x2C54 = 0x24E3
+0x2C55 = 0x24E4
+0x2C56 = 0x24E5
+0x2C57 = 0x24E6
+0x2C58 = 0x24E7
+0x2C59 = 0x24E8
+0x2C5A = 0x24E9
+0x2C5B = 0x32D0
+0x2C5C = 0x32D1
+0x2C5D = 0x32D2
+0x2C5E = 0x32D3
+0x2C5F = 0x32D4
+0x2C60 = 0x32D5
+0x2C61 = 0x32D6
+0x2C62 = 0x32D7
+0x2C63 = 0x32D8
+0x2C64 = 0x32D9
+0x2C65 = 0x32DA
+0x2C66 = 0x32DB
+0x2C67 = 0x32DC
+0x2C68 = 0x32DD
+0x2C69 = 0x32DE
+0x2C6A = 0x32DF
+0x2C6B = 0x32E0
+0x2C6C = 0x32E1
+0x2C6D = 0x32E2
+0x2C6E = 0x32E3
+0x2C6F = 0x32FA
+0x2C70 = 0x32E9
+0x2C71 = 0x32E5
+0x2C72 = 0x32ED
+0x2C73 = 0x32EC
+0x2C7D = 0x2051
+0x2C7E = 0x2042
+0x2D21 = 0x2460
+0x2D22 = 0x2461
+0x2D23 = 0x2462
+0x2D24 = 0x2463
+0x2D25 = 0x2464
+0x2D26 = 0x2465
+0x2D27 = 0x2466
+0x2D28 = 0x2467
+0x2D29 = 0x2468
+0x2D2A = 0x2469
+0x2D2B = 0x246A
+0x2D2C = 0x246B
+0x2D2D = 0x246C
+0x2D2E = 0x246D
+0x2D2F = 0x246E
+0x2D30 = 0x246F
+0x2D31 = 0x2470
+0x2D32 = 0x2471
+0x2D33 = 0x2472
+0x2D34 = 0x2473
+0x2D35 = 0x2160
+0x2D36 = 0x2161
+0x2D37 = 0x2162
+0x2D38 = 0x2163
+0x2D39 = 0x2164
+0x2D3A = 0x2165
+0x2D3B = 0x2166
+0x2D3C = 0x2167
+0x2D3D = 0x2168
+0x2D3E = 0x2169
+0x2D3F = 0x216A
+0x2D40 = 0x3349
+0x2D41 = 0x3314
+0x2D42 = 0x3322
+0x2D43 = 0x334D
+0x2D44 = 0x3318
+0x2D45 = 0x3327
+0x2D46 = 0x3303
+0x2D47 = 0x3336
+0x2D48 = 0x3351
+0x2D49 = 0x3357
+0x2D4A = 0x330D
+0x2D4B = 0x3326
+0x2D4C = 0x3323
+0x2D4D = 0x332B
+0x2D4E = 0x334A
+0x2D4F = 0x333B
+0x2D50 = 0x339C
+0x2D51 = 0x339D
+0x2D52 = 0x339E
+0x2D53 = 0x338E
+0x2D54 = 0x338F
+0x2D55 = 0x33C4
+0x2D56 = 0x33A1
+0x2D57 = 0x216B
+0x2D5F = 0x337B
+0x2D60 = 0x301D
+0x2D61 = 0x301F
+0x2D62 = 0x2116
+0x2D63 = 0x33CD
+0x2D64 = 0x2121
+0x2D65 = 0x32A4
+0x2D66 = 0x32A5
+0x2D67 = 0x32A6
+0x2D68 = 0x32A7
+0x2D69 = 0x32A8
+0x2D6A = 0x3231
+0x2D6B = 0x3232
+0x2D6C = 0x3239
+0x2D6D = 0x337E
+0x2D6E = 0x337D
+0x2D6F = 0x337C
+0x2D73 = 0x222E
+0x2D78 = 0x221F
+0x2D79 = 0x22BF
+0x2D7D = 0x2756
+0x2D7E = 0x261E
+0x2E21 = 0x4FF1
+0x2E23 = 0x3402
+0x2E24 = 0x4E28
+0x2E25 = 0x4E2F
+0x2E26 = 0x4E30
+0x2E27 = 0x4E8D
+0x2E28 = 0x4EE1
+0x2E29 = 0x4EFD
+0x2E2A = 0x4EFF
+0x2E2B = 0x4F03
+0x2E2C = 0x4F0B
+0x2E2D = 0x4F60
+0x2E2E = 0x4F48
+0x2E2F = 0x4F49
+0x2E30 = 0x4F56
+0x2E31 = 0x4F5F
+0x2E32 = 0x4F6A
+0x2E33 = 0x4F6C
+0x2E34 = 0x4F7E
+0x2E35 = 0x4F8A
+0x2E36 = 0x4F94
+0x2E37 = 0x4F97
+0x2E38 = 0xFA30
+0x2E39 = 0x4FC9
+0x2E3A = 0x4FE0
+0x2E3B = 0x5001
+0x2E3C = 0x5002
+0x2E3D = 0x500E
+0x2E3E = 0x5018
+0x2E3F = 0x5027
+0x2E40 = 0x502E
+0x2E41 = 0x5040
+0x2E42 = 0x503B
+0x2E43 = 0x5041
+0x2E44 = 0x5094
+0x2E45 = 0x50CC
+0x2E46 = 0x50F2
+0x2E47 = 0x50D0
+0x2E48 = 0x50E6
+0x2E49 = 0xFA31
+0x2E4A = 0x5106
+0x2E4B = 0x5103
+0x2E4C = 0x510B
+0x2E4D = 0x511E
+0x2E4E = 0x5135
+0x2E4F = 0x514A
+0x2E50 = 0xFA32
+0x2E51 = 0x5155
+0x2E52 = 0x5157
+0x2E53 = 0x34B5
+0x2E54 = 0x519D
+0x2E55 = 0x51C3
+0x2E56 = 0x51CA
+0x2E57 = 0x51DE
+0x2E58 = 0x51E2
+0x2E59 = 0x51EE
+0x2E5A = 0x5201
+0x2E5B = 0x34DB
+0x2E5C = 0x5213
+0x2E5D = 0x5215
+0x2E5E = 0x5249
+0x2E5F = 0x5257
+0x2E60 = 0x5261
+0x2E61 = 0x5293
+0x2E62 = 0x52C8
+0x2E63 = 0xFA33
+0x2E64 = 0x52CC
+0x2E65 = 0x52D0
+0x2E66 = 0x52D6
+0x2E67 = 0x52DB
+0x2E68 = 0xFA34
+0x2E69 = 0x52F0
+0x2E6A = 0x52FB
+0x2E6B = 0x5300
+0x2E6C = 0x5307
+0x2E6D = 0x531C
+0x2E6E = 0xFA35
+0x2E6F = 0x5361
+0x2E70 = 0x5363
+0x2E71 = 0x537D
+0x2E72 = 0x5393
+0x2E73 = 0x539D
+0x2E74 = 0x53B2
+0x2E75 = 0x5412
+0x2E76 = 0x5427
+0x2E77 = 0x544D
+0x2E78 = 0x549C
+0x2E79 = 0x546B
+0x2E7A = 0x5474
+0x2E7B = 0x547F
+0x2E7C = 0x5488
+0x2E7D = 0x5496
+0x2E7E = 0x54A1
+0x2F21 = 0x54A9
+0x2F22 = 0x54C6
+0x2F23 = 0x54FF
+0x2F24 = 0x550E
+0x2F25 = 0x552B
+0x2F26 = 0x5535
+0x2F27 = 0x5550
+0x2F28 = 0x555E
+0x2F29 = 0x5581
+0x2F2A = 0x5586
+0x2F2B = 0x558E
+0x2F2C = 0xFA36
+0x2F2D = 0x55AD
+0x2F2E = 0x55CE
+0x2F2F = 0xFA37
+0x2F30 = 0x5608
+0x2F31 = 0x560E
+0x2F32 = 0x563B
+0x2F33 = 0x5649
+0x2F34 = 0x5676
+0x2F35 = 0x5666
+0x2F36 = 0xFA38
+0x2F37 = 0x566F
+0x2F38 = 0x5671
+0x2F39 = 0x5672
+0x2F3A = 0x5699
+0x2F3B = 0x569E
+0x2F3C = 0x56A9
+0x2F3D = 0x56AC
+0x2F3E = 0x56B3
+0x2F3F = 0x56C9
+0x2F40 = 0x56CA
+0x2F41 = 0x570A
+0x2F43 = 0x5721
+0x2F44 = 0x572F
+0x2F45 = 0x5733
+0x2F46 = 0x5734
+0x2F47 = 0x5770
+0x2F48 = 0x5777
+0x2F49 = 0x577C
+0x2F4A = 0x579C
+0x2F4B = 0xFA0F
+0x2F4D = 0x57B8
+0x2F4E = 0x57C7
+0x2F4F = 0x57C8
+0x2F50 = 0x57CF
+0x2F51 = 0x57E4
+0x2F52 = 0x57ED
+0x2F53 = 0x57F5
+0x2F54 = 0x57F6
+0x2F55 = 0x57FF
+0x2F56 = 0x5809
+0x2F57 = 0xFA10
+0x2F58 = 0x5861
+0x2F59 = 0x5864
+0x2F5A = 0xFA39
+0x2F5B = 0x587C
+0x2F5C = 0x5889
+0x2F5D = 0x589E
+0x2F5E = 0xFA3A
+0x2F5F = 0x58A9
+0x2F61 = 0x58D2
+0x2F62 = 0x58CE
+0x2F63 = 0x58D4
+0x2F64 = 0x58DA
+0x2F65 = 0x58E0
+0x2F66 = 0x58E9
+0x2F67 = 0x590C
+0x2F68 = 0x8641
+0x2F69 = 0x595D
+0x2F6A = 0x596D
+0x2F6B = 0x598B
+0x2F6C = 0x5992
+0x2F6D = 0x59A4
+0x2F6E = 0x59C3
+0x2F6F = 0x59D2
+0x2F70 = 0x59DD
+0x2F71 = 0x5A13
+0x2F72 = 0x5A23
+0x2F73 = 0x5A67
+0x2F74 = 0x5A6D
+0x2F75 = 0x5A77
+0x2F76 = 0x5A7E
+0x2F77 = 0x5A84
+0x2F78 = 0x5A9E
+0x2F79 = 0x5AA7
+0x2F7A = 0x5AC4
+0x2F7C = 0x5B19
+0x2F7D = 0x5B25
+0x2F7E = 0x525D
+0x4F55 = 0x5B41
+0x4F56 = 0x5B56
+0x4F57 = 0x5B7D
+0x4F58 = 0x5B93
+0x4F59 = 0x5BD8
+0x4F5A = 0x5BEC
+0x4F5B = 0x5C12
+0x4F5C = 0x5C1E
+0x4F5D = 0x5C23
+0x4F5E = 0x5C2B
+0x4F5F = 0x378D
+0x4F60 = 0x5C62
+0x4F61 = 0xFA3B
+0x4F62 = 0xFA3C
+0x4F64 = 0x5C7A
+0x4F65 = 0x5C8F
+0x4F66 = 0x5C9F
+0x4F67 = 0x5CA3
+0x4F68 = 0x5CAA
+0x4F69 = 0x5CBA
+0x4F6A = 0x5CCB
+0x4F6B = 0x5CD0
+0x4F6C = 0x5CD2
+0x4F6D = 0x5CF4
+0x4F6F = 0x37E2
+0x4F70 = 0x5D0D
+0x4F71 = 0x5D27
+0x4F72 = 0xFA11
+0x4F73 = 0x5D46
+0x4F74 = 0x5D47
+0x4F75 = 0x5D53
+0x4F76 = 0x5D4A
+0x4F77 = 0x5D6D
+0x4F78 = 0x5D81
+0x4F79 = 0x5DA0
+0x4F7A = 0x5DA4
+0x4F7B = 0x5DA7
+0x4F7C = 0x5DB8
+0x4F7D = 0x5DCB
+0x4F7E = 0x541E
+0x7427 = 0x5653
+0x7428 = 0x5DE2
+0x7429 = 0x5E14
+0x742A = 0x5E18
+0x742B = 0x5E58
+0x742C = 0x5E5E
+0x742D = 0x5EBE
+0x742E = 0xF928
+0x742F = 0x5ECB
+0x7430 = 0x5EF9
+0x7431 = 0x5F00
+0x7432 = 0x5F02
+0x7433 = 0x5F07
+0x7434 = 0x5F1D
+0x7435 = 0x5F23
+0x7436 = 0x5F34
+0x7437 = 0x5F36
+0x7438 = 0x5F3D
+0x7439 = 0x5F40
+0x743A = 0x5F45
+0x743B = 0x5F54
+0x743C = 0x5F58
+0x743D = 0x5F64
+0x743E = 0x5F67
+0x743F = 0x5F7D
+0x7440 = 0x5F89
+0x7441 = 0x5F9C
+0x7442 = 0x5FA7
+0x7443 = 0x5FAF
+0x7444 = 0x5FB5
+0x7445 = 0x5FB7
+0x7446 = 0x5FC9
+0x7447 = 0x5FDE
+0x7448 = 0x5FE1
+0x7449 = 0x5FE9
+0x744A = 0x600D
+0x744B = 0x6014
+0x744C = 0x6018
+0x744D = 0x6033
+0x744E = 0x6035
+0x744F = 0x6047
+0x7450 = 0xFA3D
+0x7451 = 0x609D
+0x7452 = 0x609E
+0x7453 = 0x60CB
+0x7454 = 0x60D4
+0x7455 = 0x60D5
+0x7456 = 0x60DD
+0x7457 = 0x60F8
+0x7458 = 0x611C
+0x7459 = 0x612B
+0x745A = 0x6130
+0x745B = 0x6137
+0x745C = 0xFA3E
+0x745D = 0x618D
+0x745E = 0xFA3F
+0x745F = 0x61BC
+0x7460 = 0x61B9
+0x7461 = 0xFA40
+0x7462 = 0x6222
+0x7463 = 0x623E
+0x7464 = 0x6243
+0x7465 = 0x6256
+0x7466 = 0x625A
+0x7467 = 0x626F
+0x7468 = 0x6285
+0x7469 = 0x62C4
+0x746A = 0x62D6
+0x746B = 0x62FC
+0x746C = 0x630A
+0x746D = 0x6318
+0x746E = 0x6339
+0x746F = 0x6343
+0x7470 = 0x6365
+0x7471 = 0x637C
+0x7472 = 0x63E5
+0x7473 = 0x63ED
+0x7474 = 0x63F5
+0x7475 = 0x6410
+0x7476 = 0x6414
+0x7477 = 0x6422
+0x7478 = 0x6479
+0x7479 = 0x6451
+0x747A = 0x6460
+0x747B = 0x646D
+0x747C = 0x64CE
+0x747D = 0x64BE
+0x747E = 0x64BF
+0x7521 = 0x64C4
+0x7522 = 0x64CA
+0x7523 = 0x64D0
+0x7524 = 0x64F7
+0x7525 = 0x64FB
+0x7526 = 0x6522
+0x7527 = 0x6529
+0x7528 = 0xFA41
+0x7529 = 0x6567
+0x752A = 0x659D
+0x752B = 0xFA42
+0x752C = 0x6600
+0x752D = 0x6609
+0x752E = 0x6615
+0x752F = 0x661E
+0x7530 = 0x663A
+0x7531 = 0x6622
+0x7532 = 0x6624
+0x7533 = 0x662B
+0x7534 = 0x6630
+0x7535 = 0x6631
+0x7536 = 0x6633
+0x7537 = 0x66FB
+0x7538 = 0x6648
+0x7539 = 0x664C
+0x753B = 0x6659
+0x753C = 0x665A
+0x753D = 0x6661
+0x753E = 0x6665
+0x753F = 0x6673
+0x7540 = 0x6677
+0x7541 = 0x6678
+0x7542 = 0x668D
+0x7543 = 0xFA43
+0x7544 = 0x66A0
+0x7545 = 0x66B2
+0x7546 = 0x66BB
+0x7547 = 0x66C6
+0x7548 = 0x66C8
+0x7549 = 0x3B22
+0x754A = 0x66DB
+0x754B = 0x66E8
+0x754C = 0x66FA
+0x754D = 0x6713
+0x754E = 0xF929
+0x754F = 0x6733
+0x7550 = 0x6766
+0x7551 = 0x6747
+0x7552 = 0x6748
+0x7553 = 0x677B
+0x7554 = 0x6781
+0x7555 = 0x6793
+0x7556 = 0x6798
+0x7557 = 0x679B
+0x7558 = 0x67BB
+0x7559 = 0x67F9
+0x755A = 0x67C0
+0x755B = 0x67D7
+0x755C = 0x67FC
+0x755D = 0x6801
+0x755E = 0x6852
+0x755F = 0x681D
+0x7560 = 0x682C
+0x7561 = 0x6831
+0x7562 = 0x685B
+0x7563 = 0x6872
+0x7564 = 0x6875
+0x7565 = 0xFA44
+0x7566 = 0x68A3
+0x7567 = 0x68A5
+0x7568 = 0x68B2
+0x7569 = 0x68C8
+0x756A = 0x68D0
+0x756B = 0x68E8
+0x756C = 0x68ED
+0x756D = 0x68F0
+0x756E = 0x68F1
+0x756F = 0x68FC
+0x7570 = 0x690A
+0x7571 = 0x6949
+0x7573 = 0x6935
+0x7574 = 0x6942
+0x7575 = 0x6957
+0x7576 = 0x6963
+0x7577 = 0x6964
+0x7578 = 0x6968
+0x7579 = 0x6980
+0x757A = 0xFA14
+0x757B = 0x69A5
+0x757C = 0x69AD
+0x757D = 0x69CF
+0x757E = 0x3BB6
+0x7621 = 0x3BC3
+0x7622 = 0x69E2
+0x7623 = 0x69E9
+0x7624 = 0x69EA
+0x7625 = 0x69F5
+0x7626 = 0x69F6
+0x7627 = 0x6A0F
+0x7628 = 0x6A15
+0x762A = 0x6A3B
+0x762B = 0x6A3E
+0x762C = 0x6A45
+0x762D = 0x6A50
+0x762E = 0x6A56
+0x762F = 0x6A5B
+0x7630 = 0x6A6B
+0x7631 = 0x6A73
+0x7633 = 0x6A89
+0x7634 = 0x6A94
+0x7635 = 0x6A9D
+0x7636 = 0x6A9E
+0x7637 = 0x6AA5
+0x7638 = 0x6AE4
+0x7639 = 0x6AE7
+0x763A = 0x3C0F
+0x763B = 0xF91D
+0x763C = 0x6B1B
+0x763D = 0x6B1E
+0x763E = 0x6B2C
+0x763F = 0x6B35
+0x7640 = 0x6B46
+0x7641 = 0x6B56
+0x7642 = 0x6B60
+0x7643 = 0x6B65
+0x7644 = 0x6B67
+0x7645 = 0x6B77
+0x7646 = 0x6B82
+0x7647 = 0x6BA9
+0x7648 = 0x6BAD
+0x7649 = 0xF970
+0x764A = 0x6BCF
+0x764B = 0x6BD6
+0x764C = 0x6BD7
+0x764D = 0x6BFF
+0x764E = 0x6C05
+0x764F = 0x6C10
+0x7650 = 0x6C33
+0x7651 = 0x6C59
+0x7652 = 0x6C5C
+0x7653 = 0x6CAA
+0x7654 = 0x6C74
+0x7655 = 0x6C76
+0x7656 = 0x6C85
+0x7657 = 0x6C86
+0x7658 = 0x6C98
+0x7659 = 0x6C9C
+0x765A = 0x6CFB
+0x765B = 0x6CC6
+0x765C = 0x6CD4
+0x765D = 0x6CE0
+0x765E = 0x6CEB
+0x765F = 0x6CEE
+0x7661 = 0x6D04
+0x7662 = 0x6D0E
+0x7663 = 0x6D2E
+0x7664 = 0x6D31
+0x7665 = 0x6D39
+0x7666 = 0x6D3F
+0x7667 = 0x6D58
+0x7668 = 0x6D65
+0x7669 = 0xFA45
+0x766A = 0x6D82
+0x766B = 0x6D87
+0x766C = 0x6D89
+0x766D = 0x6D94
+0x766E = 0x6DAA
+0x766F = 0x6DAC
+0x7670 = 0x6DBF
+0x7671 = 0x6DC4
+0x7672 = 0x6DD6
+0x7673 = 0x6DDA
+0x7674 = 0x6DDB
+0x7675 = 0x6DDD
+0x7676 = 0x6DFC
+0x7677 = 0xFA46
+0x7678 = 0x6E34
+0x7679 = 0x6E44
+0x767A = 0x6E5C
+0x767B = 0x6E5E
+0x767C = 0x6EAB
+0x767D = 0x6EB1
+0x767E = 0x6EC1
+0x7721 = 0x6EC7
+0x7722 = 0x6ECE
+0x7723 = 0x6F10
+0x7724 = 0x6F1A
+0x7725 = 0xFA47
+0x7726 = 0x6F2A
+0x7727 = 0x6F2F
+0x7728 = 0x6F33
+0x7729 = 0x6F51
+0x772A = 0x6F59
+0x772B = 0x6F5E
+0x772C = 0x6F61
+0x772D = 0x6F62
+0x772E = 0x6F7E
+0x772F = 0x6F88
+0x7730 = 0x6F8C
+0x7731 = 0x6F8D
+0x7732 = 0x6F94
+0x7733 = 0x6FA0
+0x7734 = 0x6FA7
+0x7735 = 0x6FB6
+0x7736 = 0x6FBC
+0x7737 = 0x6FC7
+0x7738 = 0x6FCA
+0x7739 = 0x6FF9
+0x773A = 0x6FF0
+0x773B = 0x6FF5
+0x773C = 0x7005
+0x773D = 0x7006
+0x773E = 0x7028
+0x773F = 0x704A
+0x7740 = 0x705D
+0x7741 = 0x705E
+0x7742 = 0x704E
+0x7743 = 0x7064
+0x7744 = 0x7075
+0x7745 = 0x7085
+0x7746 = 0x70A4
+0x7747 = 0x70AB
+0x7748 = 0x70B7
+0x7749 = 0x70D4
+0x774A = 0x70D8
+0x774B = 0x70E4
+0x774C = 0x710F
+0x774D = 0x712B
+0x774E = 0x711E
+0x774F = 0x7120
+0x7750 = 0x712E
+0x7751 = 0x7130
+0x7752 = 0x7146
+0x7753 = 0x7147
+0x7754 = 0x7151
+0x7755 = 0xFA48
+0x7756 = 0x7152
+0x7757 = 0x715C
+0x7758 = 0x7160
+0x7759 = 0x7168
+0x775A = 0xFA15
+0x775B = 0x7185
+0x775C = 0x7187
+0x775D = 0x7192
+0x775E = 0x71C1
+0x775F = 0x71BA
+0x7760 = 0x71C4
+0x7761 = 0x71FE
+0x7762 = 0x7200
+0x7763 = 0x7215
+0x7764 = 0x7255
+0x7765 = 0x7256
+0x7766 = 0x3E3F
+0x7767 = 0x728D
+0x7768 = 0x729B
+0x7769 = 0x72BE
+0x776A = 0x72C0
+0x776B = 0x72FB
+0x776D = 0x7327
+0x776E = 0x7328
+0x776F = 0xFA16
+0x7770 = 0x7350
+0x7771 = 0x7366
+0x7772 = 0x737C
+0x7773 = 0x7395
+0x7774 = 0x739F
+0x7775 = 0x73A0
+0x7776 = 0x73A2
+0x7777 = 0x73A6
+0x7778 = 0x73AB
+0x7779 = 0x73C9
+0x777A = 0x73CF
+0x777B = 0x73D6
+0x777C = 0x73D9
+0x777D = 0x73E3
+0x777E = 0x73E9
+0x7821 = 0x7407
+0x7822 = 0x740A
+0x7823 = 0x741A
+0x7824 = 0x741B
+0x7825 = 0xFA4A
+0x7826 = 0x7426
+0x7827 = 0x7428
+0x7828 = 0x742A
+0x7829 = 0x742B
+0x782A = 0x742C
+0x782B = 0x742E
+0x782C = 0x742F
+0x782D = 0x7430
+0x782E = 0x7444
+0x782F = 0x7446
+0x7830 = 0x7447
+0x7831 = 0x744B
+0x7832 = 0x7457
+0x7833 = 0x7462
+0x7834 = 0x746B
+0x7835 = 0x746D
+0x7836 = 0x7486
+0x7837 = 0x7487
+0x7838 = 0x7489
+0x7839 = 0x7498
+0x783A = 0x749C
+0x783B = 0x749F
+0x783C = 0x74A3
+0x783D = 0x7490
+0x783E = 0x74A6
+0x783F = 0x74A8
+0x7840 = 0x74A9
+0x7841 = 0x74B5
+0x7842 = 0x74BF
+0x7843 = 0x74C8
+0x7844 = 0x74C9
+0x7845 = 0x74DA
+0x7846 = 0x74FF
+0x7847 = 0x7501
+0x7848 = 0x7517
+0x7849 = 0x752F
+0x784A = 0x756F
+0x784B = 0x7579
+0x784C = 0x7592
+0x784D = 0x3F72
+0x784E = 0x75CE
+0x784F = 0x75E4
+0x7850 = 0x7600
+0x7851 = 0x7602
+0x7852 = 0x7608
+0x7853 = 0x7615
+0x7854 = 0x7616
+0x7855 = 0x7619
+0x7856 = 0x761E
+0x7857 = 0x762D
+0x7858 = 0x7635
+0x7859 = 0x7643
+0x785A = 0x764B
+0x785B = 0x7664
+0x785C = 0x7665
+0x785D = 0x766D
+0x785E = 0x766F
+0x785F = 0x7671
+0x7860 = 0x7681
+0x7861 = 0x769B
+0x7862 = 0x769D
+0x7863 = 0x769E
+0x7864 = 0x76A6
+0x7865 = 0x76AA
+0x7866 = 0x76B6
+0x7867 = 0x76C5
+0x7868 = 0x76CC
+0x7869 = 0x76CE
+0x786A = 0x76D4
+0x786B = 0x76E6
+0x786C = 0x76F1
+0x786D = 0x76FC
+0x786E = 0x770A
+0x786F = 0x7719
+0x7870 = 0x7734
+0x7871 = 0x7736
+0x7872 = 0x7746
+0x7873 = 0x774D
+0x7874 = 0x774E
+0x7875 = 0x775C
+0x7876 = 0x775F
+0x7877 = 0x7762
+0x7878 = 0x777A
+0x7879 = 0x7780
+0x787A = 0x7794
+0x787B = 0x77AA
+0x787C = 0x77E0
+0x787D = 0x782D
+0x7921 = 0x7843
+0x7922 = 0x784E
+0x7923 = 0x784F
+0x7924 = 0x7851
+0x7925 = 0x7868
+0x7926 = 0x786E
+0x7927 = 0xFA4B
+0x7928 = 0x78B0
+0x792A = 0x78AD
+0x792B = 0x78E4
+0x792C = 0x78F2
+0x792D = 0x7900
+0x792E = 0x78F7
+0x792F = 0x791C
+0x7930 = 0x792E
+0x7931 = 0x7931
+0x7932 = 0x7934
+0x7933 = 0xFA4C
+0x7934 = 0xFA4D
+0x7935 = 0x7945
+0x7936 = 0x7946
+0x7937 = 0xFA4E
+0x7938 = 0xFA4F
+0x7939 = 0xFA50
+0x793A = 0x795C
+0x793B = 0xFA51
+0x793C = 0xFA19
+0x793D = 0xFA1A
+0x793E = 0x7979
+0x793F = 0xFA52
+0x7940 = 0xFA53
+0x7941 = 0xFA1B
+0x7942 = 0x7998
+0x7943 = 0x79B1
+0x7944 = 0x79B8
+0x7945 = 0x79C8
+0x7946 = 0x79CA
+0x7948 = 0x79D4
+0x7949 = 0x79DE
+0x794A = 0x79EB
+0x794B = 0x79ED
+0x794C = 0x7A03
+0x794D = 0xFA54
+0x794E = 0x7A39
+0x794F = 0x7A5D
+0x7950 = 0x7A6D
+0x7951 = 0xFA55
+0x7952 = 0x7A85
+0x7953 = 0x7AA0
+0x7955 = 0x7AB3
+0x7956 = 0x7ABB
+0x7957 = 0x7ACE
+0x7958 = 0x7AEB
+0x7959 = 0x7AFD
+0x795A = 0x7B12
+0x795B = 0x7B2D
+0x795C = 0x7B3B
+0x795D = 0x7B47
+0x795E = 0x7B4E
+0x795F = 0x7B60
+0x7960 = 0x7B6D
+0x7961 = 0x7B6F
+0x7962 = 0x7B72
+0x7963 = 0x7B9E
+0x7964 = 0xFA56
+0x7965 = 0x7BD7
+0x7966 = 0x7BD9
+0x7967 = 0x7C01
+0x7968 = 0x7C31
+0x7969 = 0x7C1E
+0x796A = 0x7C20
+0x796B = 0x7C33
+0x796C = 0x7C36
+0x796D = 0x4264
+0x796F = 0x7C59
+0x7970 = 0x7C6D
+0x7971 = 0x7C79
+0x7972 = 0x7C8F
+0x7973 = 0x7C94
+0x7974 = 0x7CA0
+0x7975 = 0x7CBC
+0x7976 = 0x7CD5
+0x7977 = 0x7CD9
+0x7978 = 0x7CDD
+0x7979 = 0x7D07
+0x797A = 0x7D08
+0x797B = 0x7D13
+0x797C = 0x7D1D
+0x797D = 0x7D23
+0x797E = 0x7D31
+0x7A21 = 0x7D41
+0x7A22 = 0x7D48
+0x7A23 = 0x7D53
+0x7A24 = 0x7D5C
+0x7A25 = 0x7D7A
+0x7A26 = 0x7D83
+0x7A27 = 0x7D8B
+0x7A28 = 0x7DA0
+0x7A29 = 0x7DA6
+0x7A2A = 0x7DC2
+0x7A2B = 0x7DCC
+0x7A2C = 0x7DD6
+0x7A2D = 0x7DE3
+0x7A2E = 0xFA57
+0x7A2F = 0x7E28
+0x7A30 = 0x7E08
+0x7A31 = 0x7E11
+0x7A32 = 0x7E15
+0x7A33 = 0xFA59
+0x7A34 = 0x7E47
+0x7A35 = 0x7E52
+0x7A36 = 0x7E61
+0x7A37 = 0x7E8A
+0x7A38 = 0x7E8D
+0x7A39 = 0x7F47
+0x7A3A = 0xFA5A
+0x7A3B = 0x7F91
+0x7A3C = 0x7F97
+0x7A3D = 0x7FBF
+0x7A3E = 0x7FCE
+0x7A3F = 0x7FDB
+0x7A40 = 0x7FDF
+0x7A41 = 0x7FEC
+0x7A42 = 0x7FEE
+0x7A43 = 0x7FFA
+0x7A44 = 0xFA5B
+0x7A45 = 0x8014
+0x7A46 = 0x8026
+0x7A47 = 0x8035
+0x7A48 = 0x8037
+0x7A49 = 0x803C
+0x7A4A = 0x80CA
+0x7A4B = 0x80D7
+0x7A4C = 0x80E0
+0x7A4D = 0x80F3
+0x7A4E = 0x8118
+0x7A4F = 0x814A
+0x7A50 = 0x8160
+0x7A51 = 0x8167
+0x7A52 = 0x8168
+0x7A53 = 0x816D
+0x7A54 = 0x81BB
+0x7A55 = 0x81CA
+0x7A56 = 0x81CF
+0x7A57 = 0x81D7
+0x7A58 = 0xFA5C
+0x7A59 = 0x4453
+0x7A5A = 0x445B
+0x7A5B = 0x8260
+0x7A5C = 0x8274
+0x7A5E = 0x828E
+0x7A5F = 0x82A1
+0x7A60 = 0x82A3
+0x7A61 = 0x82A4
+0x7A62 = 0x82A9
+0x7A63 = 0x82AE
+0x7A64 = 0x82B7
+0x7A65 = 0x82BE
+0x7A66 = 0x82BF
+0x7A67 = 0x82C6
+0x7A68 = 0x82D5
+0x7A69 = 0x82FD
+0x7A6A = 0x82FE
+0x7A6B = 0x8300
+0x7A6C = 0x8301
+0x7A6D = 0x8362
+0x7A6E = 0x8322
+0x7A6F = 0x832D
+0x7A70 = 0x833A
+0x7A71 = 0x8343
+0x7A72 = 0x8347
+0x7A73 = 0x8351
+0x7A74 = 0x8355
+0x7A75 = 0x837D
+0x7A76 = 0x8386
+0x7A77 = 0x8392
+0x7A78 = 0x8398
+0x7A79 = 0x83A7
+0x7A7A = 0x83A9
+0x7A7B = 0x83BF
+0x7A7C = 0x83C0
+0x7A7D = 0x83C7
+0x7A7E = 0x83CF
+0x7B21 = 0x83D1
+0x7B22 = 0x83E1
+0x7B23 = 0x83EA
+0x7B24 = 0x8401
+0x7B25 = 0x8406
+0x7B26 = 0x840A
+0x7B27 = 0xFA5F
+0x7B28 = 0x8448
+0x7B29 = 0x845F
+0x7B2A = 0x8470
+0x7B2B = 0x8473
+0x7B2C = 0x8485
+0x7B2D = 0x849E
+0x7B2E = 0x84AF
+0x7B2F = 0x84B4
+0x7B30 = 0x84BA
+0x7B31 = 0x84C0
+0x7B32 = 0x84C2
+0x7B34 = 0x8532
+0x7B35 = 0x851E
+0x7B36 = 0x8523
+0x7B37 = 0x852F
+0x7B38 = 0x8559
+0x7B39 = 0x8564
+0x7B3A = 0xFA1F
+0x7B3B = 0x85AD
+0x7B3C = 0x857A
+0x7B3D = 0x858C
+0x7B3E = 0x858F
+0x7B3F = 0x85A2
+0x7B40 = 0x85B0
+0x7B41 = 0x85CB
+0x7B42 = 0x85CE
+0x7B43 = 0x85ED
+0x7B44 = 0x8612
+0x7B45 = 0x85FF
+0x7B46 = 0x8604
+0x7B47 = 0x8605
+0x7B48 = 0x8610
+0x7B4A = 0x8618
+0x7B4B = 0x8629
+0x7B4C = 0x8638
+0x7B4D = 0x8657
+0x7B4E = 0x865B
+0x7B4F = 0xF936
+0x7B50 = 0x8662
+0x7B51 = 0x459D
+0x7B52 = 0x866C
+0x7B53 = 0x8675
+0x7B54 = 0x8698
+0x7B55 = 0x86B8
+0x7B56 = 0x86FA
+0x7B57 = 0x86FC
+0x7B58 = 0x86FD
+0x7B59 = 0x870B
+0x7B5A = 0x8771
+0x7B5B = 0x8787
+0x7B5C = 0x8788
+0x7B5D = 0x87AC
+0x7B5E = 0x87AD
+0x7B5F = 0x87B5
+0x7B60 = 0x45EA
+0x7B61 = 0x87D6
+0x7B62 = 0x87EC
+0x7B63 = 0x8806
+0x7B64 = 0x880A
+0x7B65 = 0x8810
+0x7B66 = 0x8814
+0x7B67 = 0x881F
+0x7B68 = 0x8898
+0x7B69 = 0x88AA
+0x7B6A = 0x88CA
+0x7B6B = 0x88CE
+0x7B6D = 0x88F5
+0x7B6E = 0x891C
+0x7B6F = 0xFA60
+0x7B70 = 0x8918
+0x7B71 = 0x8919
+0x7B72 = 0x891A
+0x7B73 = 0x8927
+0x7B74 = 0x8930
+0x7B75 = 0x8932
+0x7B76 = 0x8939
+0x7B77 = 0x8940
+0x7B78 = 0x8994
+0x7B79 = 0xFA61
+0x7B7A = 0x89D4
+0x7B7B = 0x89E5
+0x7B7C = 0x89F6
+0x7B7D = 0x8A12
+0x7B7E = 0x8A15
+0x7C21 = 0x8A22
+0x7C22 = 0x8A37
+0x7C23 = 0x8A47
+0x7C24 = 0x8A4E
+0x7C25 = 0x8A5D
+0x7C26 = 0x8A61
+0x7C27 = 0x8A75
+0x7C28 = 0x8A79
+0x7C29 = 0x8AA7
+0x7C2A = 0x8AD0
+0x7C2B = 0x8ADF
+0x7C2C = 0x8AF4
+0x7C2D = 0x8AF6
+0x7C2E = 0xFA22
+0x7C2F = 0xFA62
+0x7C30 = 0xFA63
+0x7C31 = 0x8B46
+0x7C32 = 0x8B54
+0x7C33 = 0x8B59
+0x7C34 = 0x8B69
+0x7C35 = 0x8B9D
+0x7C36 = 0x8C49
+0x7C37 = 0x8C68
+0x7C38 = 0xFA64
+0x7C39 = 0x8CE1
+0x7C3A = 0x8CF4
+0x7C3B = 0x8CF8
+0x7C3C = 0x8CFE
+0x7C3D = 0xFA65
+0x7C3E = 0x8D12
+0x7C3F = 0x8D1B
+0x7C40 = 0x8DAF
+0x7C41 = 0x8DCE
+0x7C42 = 0x8DD1
+0x7C43 = 0x8DD7
+0x7C44 = 0x8E20
+0x7C45 = 0x8E23
+0x7C46 = 0x8E3D
+0x7C47 = 0x8E70
+0x7C48 = 0x8E7B
+0x7C4A = 0x8EC0
+0x7C4B = 0x4844
+0x7C4C = 0x8EFA
+0x7C4D = 0x8F1E
+0x7C4E = 0x8F2D
+0x7C4F = 0x8F36
+0x7C50 = 0x8F54
+0x7C52 = 0x8FA6
+0x7C53 = 0x8FB5
+0x7C54 = 0x8FE4
+0x7C55 = 0x8FE8
+0x7C56 = 0x8FEE
+0x7C57 = 0x9008
+0x7C58 = 0x902D
+0x7C59 = 0xFA67
+0x7C5A = 0x9088
+0x7C5B = 0x9095
+0x7C5C = 0x9097
+0x7C5D = 0x9099
+0x7C5E = 0x909B
+0x7C5F = 0x90A2
+0x7C60 = 0x90B3
+0x7C61 = 0x90BE
+0x7C62 = 0x90C4
+0x7C63 = 0x90C5
+0x7C64 = 0x90C7
+0x7C65 = 0x90D7
+0x7C66 = 0x90DD
+0x7C67 = 0x90DE
+0x7C68 = 0x90EF
+0x7C69 = 0x90F4
+0x7C6A = 0xFA26
+0x7C6B = 0x9114
+0x7C6C = 0x9115
+0x7C6D = 0x9116
+0x7C6E = 0x9122
+0x7C6F = 0x9123
+0x7C70 = 0x9127
+0x7C71 = 0x912F
+0x7C72 = 0x9131
+0x7C73 = 0x9134
+0x7C74 = 0x913D
+0x7C75 = 0x9148
+0x7C76 = 0x915B
+0x7C77 = 0x9183
+0x7C78 = 0x919E
+0x7C79 = 0x91AC
+0x7C7A = 0x91B1
+0x7C7B = 0x91BC
+0x7C7C = 0x91D7
+0x7C7D = 0x91FB
+0x7C7E = 0x91E4
+0x7D21 = 0x91E5
+0x7D22 = 0x91ED
+0x7D23 = 0x91F1
+0x7D24 = 0x9207
+0x7D25 = 0x9210
+0x7D26 = 0x9238
+0x7D27 = 0x9239
+0x7D28 = 0x923A
+0x7D29 = 0x923C
+0x7D2A = 0x9240
+0x7D2B = 0x9243
+0x7D2C = 0x924F
+0x7D2D = 0x9278
+0x7D2E = 0x9288
+0x7D2F = 0x92C2
+0x7D30 = 0x92CB
+0x7D31 = 0x92CC
+0x7D32 = 0x92D3
+0x7D33 = 0x92E0
+0x7D34 = 0x92FF
+0x7D35 = 0x9304
+0x7D36 = 0x931F
+0x7D37 = 0x9321
+0x7D38 = 0x9325
+0x7D39 = 0x9348
+0x7D3A = 0x9349
+0x7D3B = 0x934A
+0x7D3C = 0x9364
+0x7D3D = 0x9365
+0x7D3E = 0x936A
+0x7D3F = 0x9370
+0x7D40 = 0x939B
+0x7D41 = 0x93A3
+0x7D42 = 0x93BA
+0x7D43 = 0x93C6
+0x7D44 = 0x93DE
+0x7D45 = 0x93DF
+0x7D46 = 0x9404
+0x7D47 = 0x93FD
+0x7D48 = 0x9433
+0x7D49 = 0x944A
+0x7D4A = 0x9463
+0x7D4B = 0x946B
+0x7D4C = 0x9471
+0x7D4D = 0x9472
+0x7D4E = 0x958E
+0x7D4F = 0x959F
+0x7D50 = 0x95A6
+0x7D51 = 0x95A9
+0x7D52 = 0x95AC
+0x7D53 = 0x95B6
+0x7D54 = 0x95BD
+0x7D55 = 0x95CB
+0x7D56 = 0x95D0
+0x7D57 = 0x95D3
+0x7D58 = 0x49B0
+0x7D59 = 0x95DA
+0x7D5A = 0x95DE
+0x7D5B = 0x9658
+0x7D5C = 0x9684
+0x7D5D = 0xF9DC
+0x7D5E = 0x969D
+0x7D5F = 0x96A4
+0x7D60 = 0x96A5
+0x7D61 = 0x96D2
+0x7D62 = 0x96DE
+0x7D63 = 0xFA68
+0x7D64 = 0x96E9
+0x7D65 = 0x96EF
+0x7D66 = 0x9733
+0x7D67 = 0x973B
+0x7D68 = 0x974D
+0x7D69 = 0x974E
+0x7D6A = 0x974F
+0x7D6B = 0x975A
+0x7D6C = 0x976E
+0x7D6D = 0x9773
+0x7D6E = 0x9795
+0x7D6F = 0x97AE
+0x7D70 = 0x97BA
+0x7D71 = 0x97C1
+0x7D72 = 0x97C9
+0x7D73 = 0x97DE
+0x7D74 = 0x97DB
+0x7D75 = 0x97F4
+0x7D76 = 0xFA69
+0x7D77 = 0x980A
+0x7D78 = 0x981E
+0x7D79 = 0x982B
+0x7D7A = 0x9830
+0x7D7B = 0xFA6A
+0x7D7C = 0x9852
+0x7D7D = 0x9853
+0x7D7E = 0x9856
+0x7E21 = 0x9857
+0x7E22 = 0x9859
+0x7E23 = 0x985A
+0x7E24 = 0xF9D0
+0x7E25 = 0x9865
+0x7E26 = 0x986C
+0x7E27 = 0x98BA
+0x7E28 = 0x98C8
+0x7E29 = 0x98E7
+0x7E2A = 0x9958
+0x7E2B = 0x999E
+0x7E2C = 0x9A02
+0x7E2D = 0x9A03
+0x7E2E = 0x9A24
+0x7E2F = 0x9A2D
+0x7E30 = 0x9A2E
+0x7E31 = 0x9A38
+0x7E32 = 0x9A4A
+0x7E33 = 0x9A4E
+0x7E34 = 0x9A52
+0x7E35 = 0x9AB6
+0x7E36 = 0x9AC1
+0x7E37 = 0x9AC3
+0x7E38 = 0x9ACE
+0x7E39 = 0x9AD6
+0x7E3A = 0x9AF9
+0x7E3B = 0x9B02
+0x7E3C = 0x9B08
+0x7E3D = 0x9B20
+0x7E3E = 0x4C17
+0x7E3F = 0x9B2D
+0x7E40 = 0x9B5E
+0x7E41 = 0x9B79
+0x7E42 = 0x9B66
+0x7E43 = 0x9B72
+0x7E44 = 0x9B75
+0x7E45 = 0x9B84
+0x7E46 = 0x9B8A
+0x7E47 = 0x9B8F
+0x7E48 = 0x9B9E
+0x7E49 = 0x9BA7
+0x7E4A = 0x9BC1
+0x7E4B = 0x9BCE
+0x7E4C = 0x9BE5
+0x7E4D = 0x9BF8
+0x7E4E = 0x9BFD
+0x7E4F = 0x9C00
+0x7E50 = 0x9C23
+0x7E51 = 0x9C41
+0x7E52 = 0x9C4F
+0x7E53 = 0x9C50
+0x7E54 = 0x9C53
+0x7E55 = 0x9C63
+0x7E56 = 0x9C65
+0x7E57 = 0x9C77
+0x7E58 = 0x9D1D
+0x7E59 = 0x9D1E
+0x7E5A = 0x9D43
+0x7E5B = 0x9D47
+0x7E5C = 0x9D52
+0x7E5D = 0x9D63
+0x7E5E = 0x9D70
+0x7E5F = 0x9D7C
+0x7E60 = 0x9D8A
+0x7E61 = 0x9D96
+0x7E62 = 0x9DC0
+0x7E63 = 0x9DAC
+0x7E64 = 0x9DBC
+0x7E65 = 0x9DD7
+0x7E67 = 0x9DE7
+0x7E68 = 0x9E07
+0x7E69 = 0x9E15
+0x7E6A = 0x9E7C
+0x7E6B = 0x9E9E
+0x7E6C = 0x9EA4
+0x7E6D = 0x9EAC
+0x7E6E = 0x9EAF
+0x7E6F = 0x9EB4
+0x7E70 = 0x9EB5
+0x7E71 = 0x9EC3
+0x7E72 = 0x9ED1
+0x7E73 = 0x9F10
+0x7E74 = 0x9F39
+0x7E75 = 0x9F57
+0x7E76 = 0x9F90
+0x7E77 = 0x9F94
+0x7E78 = 0x9F97
+0x7E79 = 0x9FA2
+0x7E7A = 0x59F8
+0x7E7B = 0x5C5B
+0x7E7C = 0x5E77
+0x7E7D = 0x7626
+0x7E7E = 0x7E6B
+END_MAP
diff --git a/enc/trans/JIS/JISX0213-1%UCS@SIP.src b/enc/trans/JIS/JISX0213-1%UCS@SIP.src
new file mode 100644
index 0000000000..da7eab62a7
--- /dev/null
+++ b/enc/trans/JIS/JISX0213-1%UCS@SIP.src
@@ -0,0 +1,60 @@
+# $NetBSD: JISX0213-1%UCS@SIP.src,v 1.1 2007/03/05 16:58:33 tnozaki Exp $
+
+TYPE ROWCOL
+NAME "JISX0213-1/UCS:SIP"
+SRC_ZONE 0x21-0x7E / 0x21-0x7E / 8
+OOB_MODE INVALID
+DST_INVALID 0xFFFE
+DST_UNIT_BITS 16
+
+BEGIN_MAP
+## JIS X 0213:2004 vs Unicode mapping table
+##
+## Date: 22 May 2006
+## License:
+## Copyright (C) 2001 earthian@tama.or.jp, All Rights Reserved.
+## Copyright (C) 2001 I'O, All Rights Reserved.
+## Copyright (C) 2006 Project X0213, All Rights Reserved.
+## You can use, modify, distribute this table freely.
+## Note:
+## 3-XXXX JIS X 0213:2004 plane 1 (GL encoding)
+## 4-XXXX JIS X 0213:2000 plane 2 (GL encoding)
+## [1983] JIS codepoint defined by JIS X 0208-1983
+## [1990] JIS codepoint defined by JIS X 0208-1990
+## [2000] JIS codepoint defined by JIS X 0213:2000
+## [2004] JIS codepoint defined by JIS X 0213:2004
+## [Unicode3.1] UCS codepoint defined by Unicode 3.1
+## [Unicode3.2] UCS codepoint defined by Unicode 3.2
+## Fullwidth UCS fullwidth form (U+Fxxx)
+## Windows Windows (CP932) mapping
+## Some 0213 character can't represent by one UCS character.
+## In this table, such characters are described as 'U+xxxx+xxxx'.
+##
+## JIS Unicode Name Note
+0x2E22 = 0x000B
+0x2F42 = 0x123D
+0x2F4C = 0x131B
+0x2F60 = 0x146E
+0x2F7B = 0x18BD
+0x4F54 = 0x0B9F
+0x4F63 = 0x16B4
+0x4F6E = 0x1E34
+0x753A = 0x31C4
+0x7572 = 0x35C4
+0x7629 = 0x373F
+0x7632 = 0x3763
+0x7660 = 0x3CFE
+0x776C = 0x47F1
+0x787E = 0x548E
+0x7929 = 0x550E
+0x7947 = 0x5771
+0x7954 = 0x59C4
+0x796E = 0x5DA1
+0x7A5D = 0x6AFF
+0x7B33 = 0x6E40
+0x7B49 = 0x70F4
+0x7B6C = 0x7684
+0x7C49 = 0x8277
+0x7C51 = 0x83CD
+0x7E66 = 0xA190
+END_MAP
diff --git a/enc/trans/JIS/JISX0213-2%UCS@BMP.src b/enc/trans/JIS/JISX0213-2%UCS@BMP.src
new file mode 100644
index 0000000000..e22ef8aa26
--- /dev/null
+++ b/enc/trans/JIS/JISX0213-2%UCS@BMP.src
@@ -0,0 +1,2193 @@
+# $NetBSD: JISX0213-2%UCS@BMP.src,v 1.1 2007/03/05 16:58:33 tnozaki Exp $
+
+TYPE ROWCOL
+NAME "JISX0213-2/UCS:BMP"
+SRC_ZONE 0x21-0x7E / 0x21-0x7E / 8
+OOB_MODE INVALID
+DST_INVALID 0xFFFE
+DST_UNIT_BITS 16
+
+BEGIN_MAP
+## JIS X 0213:2004 vs Unicode mapping table
+##
+## Date: 22 May 2006
+## License:
+## Copyright (C) 2001 earthian@tama.or.jp, All Rights Reserved.
+## Copyright (C) 2001 I'O, All Rights Reserved.
+## Copyright (C) 2006 Project X0213, All Rights Reserved.
+## You can use, modify, distribute this table freely.
+## Note:
+## 3-XXXX JIS X 0213:2004 plane 1 (GL encoding)
+## 4-XXXX JIS X 0213:2000 plane 2 (GL encoding)
+## [1983] JIS codepoint defined by JIS X 0208-1983
+## [1990] JIS codepoint defined by JIS X 0208-1990
+## [2000] JIS codepoint defined by JIS X 0213:2000
+## [2004] JIS codepoint defined by JIS X 0213:2004
+## [Unicode3.1] UCS codepoint defined by Unicode 3.1
+## [Unicode3.2] UCS codepoint defined by Unicode 3.2
+## Fullwidth UCS fullwidth form (U+Fxxx)
+## Windows Windows (CP932) mapping
+## Some 0213 character can't represent by one UCS character.
+## In this table, such characters are described as 'U+xxxx+xxxx'.
+##
+## JIS Unicode Name Note
+0x2122 = 0x4E02
+0x2123 = 0x4E0F
+0x2124 = 0x4E12
+0x2125 = 0x4E29
+0x2126 = 0x4E2B
+0x2127 = 0x4E2E
+0x2128 = 0x4E40
+0x2129 = 0x4E47
+0x212A = 0x4E48
+0x212C = 0x4E51
+0x212D = 0x3406
+0x212F = 0x4E5A
+0x2130 = 0x4E69
+0x2131 = 0x4E9D
+0x2132 = 0x342C
+0x2133 = 0x342E
+0x2134 = 0x4EB9
+0x2135 = 0x4EBB
+0x2137 = 0x4EBC
+0x2138 = 0x4EC3
+0x2139 = 0x4EC8
+0x213A = 0x4ED0
+0x213B = 0x4EEB
+0x213C = 0x4EDA
+0x213D = 0x4EF1
+0x213E = 0x4EF5
+0x213F = 0x4F00
+0x2140 = 0x4F16
+0x2141 = 0x4F64
+0x2142 = 0x4F37
+0x2143 = 0x4F3E
+0x2144 = 0x4F54
+0x2145 = 0x4F58
+0x2147 = 0x4F77
+0x2148 = 0x4F78
+0x2149 = 0x4F7A
+0x214A = 0x4F7D
+0x214B = 0x4F82
+0x214C = 0x4F85
+0x214D = 0x4F92
+0x214E = 0x4F9A
+0x214F = 0x4FE6
+0x2150 = 0x4FB2
+0x2151 = 0x4FBE
+0x2152 = 0x4FC5
+0x2153 = 0x4FCB
+0x2154 = 0x4FCF
+0x2155 = 0x4FD2
+0x2156 = 0x346A
+0x2157 = 0x4FF2
+0x2158 = 0x5000
+0x2159 = 0x5010
+0x215A = 0x5013
+0x215B = 0x501C
+0x215C = 0x501E
+0x215D = 0x5022
+0x215E = 0x3468
+0x215F = 0x5042
+0x2160 = 0x5046
+0x2161 = 0x504E
+0x2162 = 0x5053
+0x2163 = 0x5057
+0x2164 = 0x5063
+0x2165 = 0x5066
+0x2166 = 0x506A
+0x2167 = 0x5070
+0x2168 = 0x50A3
+0x2169 = 0x5088
+0x216A = 0x5092
+0x216B = 0x5093
+0x216C = 0x5095
+0x216D = 0x5096
+0x216E = 0x509C
+0x216F = 0x50AA
+0x2171 = 0x50B1
+0x2172 = 0x50BA
+0x2173 = 0x50BB
+0x2174 = 0x50C4
+0x2175 = 0x50C7
+0x2176 = 0x50F3
+0x2178 = 0x50CE
+0x217A = 0x50D4
+0x217B = 0x50D9
+0x217C = 0x50E1
+0x217D = 0x50E9
+0x217E = 0x3492
+0x2321 = 0x5108
+0x2323 = 0x5117
+0x2324 = 0x511B
+0x2326 = 0x5160
+0x2328 = 0x5173
+0x2329 = 0x5183
+0x232A = 0x518B
+0x232B = 0x34BC
+0x232C = 0x5198
+0x232D = 0x51A3
+0x232E = 0x51AD
+0x232F = 0x34C7
+0x2330 = 0x51BC
+0x2333 = 0x51F3
+0x2334 = 0x51F4
+0x2335 = 0x5202
+0x2336 = 0x5212
+0x2337 = 0x5216
+0x2339 = 0x5255
+0x233A = 0x525C
+0x233B = 0x526C
+0x233C = 0x5277
+0x233D = 0x5284
+0x233E = 0x5282
+0x2340 = 0x5298
+0x2342 = 0x52A4
+0x2343 = 0x52A6
+0x2344 = 0x52AF
+0x2345 = 0x52BA
+0x2346 = 0x52BB
+0x2347 = 0x52CA
+0x2348 = 0x351F
+0x2349 = 0x52D1
+0x234B = 0x52F7
+0x234C = 0x530A
+0x234D = 0x530B
+0x234E = 0x5324
+0x234F = 0x5335
+0x2350 = 0x533E
+0x2351 = 0x5342
+0x2354 = 0x5367
+0x2355 = 0x536C
+0x2356 = 0x537A
+0x2357 = 0x53A4
+0x2358 = 0x53B4
+0x235A = 0x53B7
+0x235B = 0x53C0
+0x235D = 0x355D
+0x235E = 0x355E
+0x235F = 0x53D5
+0x2360 = 0x53DA
+0x2361 = 0x3563
+0x2362 = 0x53F4
+0x2363 = 0x53F5
+0x2364 = 0x5455
+0x2365 = 0x5424
+0x2366 = 0x5428
+0x2367 = 0x356E
+0x2368 = 0x5443
+0x2369 = 0x5462
+0x236A = 0x5466
+0x236B = 0x546C
+0x236C = 0x548A
+0x236D = 0x548D
+0x236E = 0x5495
+0x236F = 0x54A0
+0x2370 = 0x54A6
+0x2371 = 0x54AD
+0x2372 = 0x54AE
+0x2373 = 0x54B7
+0x2374 = 0x54BA
+0x2375 = 0x54BF
+0x2376 = 0x54C3
+0x2378 = 0x54EC
+0x2379 = 0x54EF
+0x237A = 0x54F1
+0x237B = 0x54F3
+0x237C = 0x5500
+0x237D = 0x5501
+0x237E = 0x5509
+0x2421 = 0x553C
+0x2422 = 0x5541
+0x2423 = 0x35A6
+0x2424 = 0x5547
+0x2425 = 0x554A
+0x2426 = 0x35A8
+0x2427 = 0x5560
+0x2428 = 0x5561
+0x2429 = 0x5564
+0x242B = 0x557D
+0x242C = 0x5582
+0x242D = 0x5588
+0x242E = 0x5591
+0x242F = 0x35C5
+0x2430 = 0x55D2
+0x2433 = 0x55BF
+0x2434 = 0x55C9
+0x2435 = 0x55CC
+0x2436 = 0x55D1
+0x2437 = 0x55DD
+0x2438 = 0x35DA
+0x2439 = 0x55E2
+0x243B = 0x55E9
+0x243C = 0x5628
+0x243E = 0x5607
+0x243F = 0x5610
+0x2440 = 0x5630
+0x2441 = 0x5637
+0x2442 = 0x35F4
+0x2443 = 0x563D
+0x2444 = 0x563F
+0x2445 = 0x5640
+0x2446 = 0x5647
+0x2447 = 0x565E
+0x2448 = 0x5660
+0x2449 = 0x566D
+0x244A = 0x3605
+0x244B = 0x5688
+0x244C = 0x568C
+0x244D = 0x5695
+0x244E = 0x569A
+0x244F = 0x569D
+0x2450 = 0x56A8
+0x2451 = 0x56AD
+0x2452 = 0x56B2
+0x2453 = 0x56C5
+0x2454 = 0x56CD
+0x2455 = 0x56DF
+0x2456 = 0x56E8
+0x2457 = 0x56F6
+0x2458 = 0x56F7
+0x245A = 0x5715
+0x245B = 0x5723
+0x245D = 0x5729
+0x245F = 0x5745
+0x2460 = 0x5746
+0x2461 = 0x574C
+0x2462 = 0x574D
+0x2464 = 0x5768
+0x2465 = 0x576F
+0x2466 = 0x5773
+0x2467 = 0x5774
+0x2468 = 0x5775
+0x2469 = 0x577B
+0x246C = 0x57AC
+0x246D = 0x579A
+0x246E = 0x579D
+0x246F = 0x579E
+0x2470 = 0x57A8
+0x2471 = 0x57D7
+0x2473 = 0x57CC
+0x2476 = 0x57DE
+0x2477 = 0x57E6
+0x2478 = 0x57F0
+0x2479 = 0x364A
+0x247A = 0x57F8
+0x247B = 0x57FB
+0x247C = 0x57FD
+0x247D = 0x5804
+0x247E = 0x581E
+0x2521 = 0x5820
+0x2522 = 0x5827
+0x2523 = 0x5832
+0x2524 = 0x5839
+0x2526 = 0x5849
+0x2527 = 0x584C
+0x2528 = 0x5867
+0x2529 = 0x588A
+0x252A = 0x588B
+0x252B = 0x588D
+0x252C = 0x588F
+0x252D = 0x5890
+0x252E = 0x5894
+0x252F = 0x589D
+0x2530 = 0x58AA
+0x2531 = 0x58B1
+0x2533 = 0x58C3
+0x2534 = 0x58CD
+0x2535 = 0x58E2
+0x2536 = 0x58F3
+0x2537 = 0x58F4
+0x2538 = 0x5905
+0x2539 = 0x5906
+0x253A = 0x590B
+0x253B = 0x590D
+0x253C = 0x5914
+0x253D = 0x5924
+0x253F = 0x3691
+0x2540 = 0x593D
+0x2541 = 0x3699
+0x2542 = 0x5946
+0x2543 = 0x3696
+0x2545 = 0x595B
+0x2546 = 0x595F
+0x2548 = 0x5975
+0x2549 = 0x5976
+0x254A = 0x597C
+0x254B = 0x599F
+0x254C = 0x59AE
+0x254D = 0x59BC
+0x254E = 0x59C8
+0x254F = 0x59CD
+0x2550 = 0x59DE
+0x2551 = 0x59E3
+0x2552 = 0x59E4
+0x2553 = 0x59E7
+0x2554 = 0x59EE
+0x2557 = 0x36CF
+0x2558 = 0x5A0C
+0x2559 = 0x5A0D
+0x255A = 0x5A17
+0x255B = 0x5A27
+0x255C = 0x5A2D
+0x255D = 0x5A55
+0x255E = 0x5A65
+0x255F = 0x5A7A
+0x2560 = 0x5A8B
+0x2561 = 0x5A9C
+0x2562 = 0x5A9F
+0x2563 = 0x5AA0
+0x2564 = 0x5AA2
+0x2565 = 0x5AB1
+0x2566 = 0x5AB3
+0x2567 = 0x5AB5
+0x2568 = 0x5ABA
+0x2569 = 0x5ABF
+0x256A = 0x5ADA
+0x256B = 0x5ADC
+0x256C = 0x5AE0
+0x256D = 0x5AE5
+0x256E = 0x5AF0
+0x256F = 0x5AEE
+0x2570 = 0x5AF5
+0x2571 = 0x5B00
+0x2572 = 0x5B08
+0x2573 = 0x5B17
+0x2574 = 0x5B34
+0x2575 = 0x5B2D
+0x2576 = 0x5B4C
+0x2577 = 0x5B52
+0x2578 = 0x5B68
+0x2579 = 0x5B6F
+0x257A = 0x5B7C
+0x257B = 0x5B7F
+0x257C = 0x5B81
+0x257D = 0x5B84
+0x2821 = 0x5B96
+0x2822 = 0x5BAC
+0x2823 = 0x3761
+0x2824 = 0x5BC0
+0x2825 = 0x3762
+0x2826 = 0x5BCE
+0x2827 = 0x5BD6
+0x2828 = 0x376C
+0x2829 = 0x376B
+0x282A = 0x5BF1
+0x282B = 0x5BFD
+0x282C = 0x3775
+0x282D = 0x5C03
+0x282E = 0x5C29
+0x282F = 0x5C30
+0x2831 = 0x5C5F
+0x2832 = 0x5C63
+0x2833 = 0x5C67
+0x2834 = 0x5C68
+0x2835 = 0x5C69
+0x2836 = 0x5C70
+0x2839 = 0x5C7C
+0x283C = 0x5C88
+0x283D = 0x5C8A
+0x283E = 0x37C1
+0x2841 = 0x5CA0
+0x2842 = 0x5CA2
+0x2843 = 0x5CA6
+0x2844 = 0x5CA7
+0x2846 = 0x5CAD
+0x2847 = 0x5CB5
+0x2849 = 0x5CC9
+0x284C = 0x5D06
+0x284D = 0x5D10
+0x284E = 0x5D2B
+0x284F = 0x5D1D
+0x2850 = 0x5D20
+0x2851 = 0x5D24
+0x2852 = 0x5D26
+0x2853 = 0x5D31
+0x2854 = 0x5D39
+0x2855 = 0x5D42
+0x2856 = 0x37E8
+0x2857 = 0x5D61
+0x2858 = 0x5D6A
+0x2859 = 0x37F4
+0x285A = 0x5D70
+0x285C = 0x37FD
+0x285D = 0x5D88
+0x285E = 0x3800
+0x285F = 0x5D92
+0x2860 = 0x5D94
+0x2861 = 0x5D97
+0x2862 = 0x5D99
+0x2863 = 0x5DB0
+0x2864 = 0x5DB2
+0x2865 = 0x5DB4
+0x2867 = 0x5DB9
+0x2868 = 0x5DD1
+0x2869 = 0x5DD7
+0x286A = 0x5DD8
+0x286B = 0x5DE0
+0x286D = 0x5DE4
+0x286E = 0x5DE9
+0x286F = 0x382F
+0x2870 = 0x5E00
+0x2871 = 0x3836
+0x2872 = 0x5E12
+0x2873 = 0x5E15
+0x2874 = 0x3840
+0x2875 = 0x5E1F
+0x2876 = 0x5E2E
+0x2877 = 0x5E3E
+0x2878 = 0x5E49
+0x2879 = 0x385C
+0x287A = 0x5E56
+0x287B = 0x3861
+0x287C = 0x5E6B
+0x287D = 0x5E6C
+0x287E = 0x5E6D
+0x2C21 = 0x5E6E
+0x2C23 = 0x5EA5
+0x2C24 = 0x5EAA
+0x2C25 = 0x5EAC
+0x2C26 = 0x5EB9
+0x2C27 = 0x5EBF
+0x2C28 = 0x5EC6
+0x2C29 = 0x5ED2
+0x2C2A = 0x5ED9
+0x2C2C = 0x5EFD
+0x2C2D = 0x5F08
+0x2C2E = 0x5F0E
+0x2C2F = 0x5F1C
+0x2C31 = 0x5F1E
+0x2C32 = 0x5F47
+0x2C33 = 0x5F63
+0x2C34 = 0x5F72
+0x2C35 = 0x5F7E
+0x2C36 = 0x5F8F
+0x2C37 = 0x5FA2
+0x2C38 = 0x5FA4
+0x2C39 = 0x5FB8
+0x2C3A = 0x5FC4
+0x2C3B = 0x38FA
+0x2C3C = 0x5FC7
+0x2C3D = 0x5FCB
+0x2C3E = 0x5FD2
+0x2C3F = 0x5FD3
+0x2C40 = 0x5FD4
+0x2C41 = 0x5FE2
+0x2C42 = 0x5FEE
+0x2C43 = 0x5FEF
+0x2C44 = 0x5FF3
+0x2C45 = 0x5FFC
+0x2C46 = 0x3917
+0x2C47 = 0x6017
+0x2C48 = 0x6022
+0x2C49 = 0x6024
+0x2C4A = 0x391A
+0x2C4B = 0x604C
+0x2C4C = 0x607F
+0x2C4D = 0x608A
+0x2C4E = 0x6095
+0x2C4F = 0x60A8
+0x2C51 = 0x60B0
+0x2C52 = 0x60B1
+0x2C53 = 0x60BE
+0x2C54 = 0x60C8
+0x2C55 = 0x60D9
+0x2C56 = 0x60DB
+0x2C57 = 0x60EE
+0x2C58 = 0x60F2
+0x2C59 = 0x60F5
+0x2C5A = 0x6110
+0x2C5B = 0x6112
+0x2C5C = 0x6113
+0x2C5D = 0x6119
+0x2C5E = 0x611E
+0x2C5F = 0x613A
+0x2C60 = 0x396F
+0x2C61 = 0x6141
+0x2C62 = 0x6146
+0x2C63 = 0x6160
+0x2C64 = 0x617C
+0x2C66 = 0x6192
+0x2C67 = 0x6193
+0x2C68 = 0x6197
+0x2C69 = 0x6198
+0x2C6A = 0x61A5
+0x2C6B = 0x61A8
+0x2C6C = 0x61AD
+0x2C6E = 0x61D5
+0x2C6F = 0x61DD
+0x2C70 = 0x61DF
+0x2C71 = 0x61F5
+0x2C73 = 0x6215
+0x2C74 = 0x6223
+0x2C75 = 0x6229
+0x2C76 = 0x6246
+0x2C77 = 0x624C
+0x2C78 = 0x6251
+0x2C79 = 0x6252
+0x2C7A = 0x6261
+0x2C7B = 0x6264
+0x2C7C = 0x627B
+0x2C7D = 0x626D
+0x2C7E = 0x6273
+0x2D21 = 0x6299
+0x2D22 = 0x62A6
+0x2D23 = 0x62D5
+0x2D25 = 0x62FD
+0x2D26 = 0x6303
+0x2D27 = 0x630D
+0x2D28 = 0x6310
+0x2D2B = 0x6332
+0x2D2C = 0x6335
+0x2D2D = 0x633B
+0x2D2E = 0x633C
+0x2D2F = 0x6341
+0x2D30 = 0x6344
+0x2D31 = 0x634E
+0x2D33 = 0x6359
+0x2D36 = 0x636C
+0x2D37 = 0x6384
+0x2D38 = 0x6399
+0x2D3A = 0x6394
+0x2D3B = 0x63BD
+0x2D3C = 0x63F7
+0x2D3D = 0x63D4
+0x2D3E = 0x63D5
+0x2D3F = 0x63DC
+0x2D40 = 0x63E0
+0x2D41 = 0x63EB
+0x2D42 = 0x63EC
+0x2D43 = 0x63F2
+0x2D44 = 0x6409
+0x2D45 = 0x641E
+0x2D46 = 0x6425
+0x2D47 = 0x6429
+0x2D48 = 0x642F
+0x2D49 = 0x645A
+0x2D4A = 0x645B
+0x2D4B = 0x645D
+0x2D4C = 0x6473
+0x2D4D = 0x647D
+0x2D4E = 0x6487
+0x2D4F = 0x6491
+0x2D50 = 0x649D
+0x2D51 = 0x649F
+0x2D52 = 0x64CB
+0x2D53 = 0x64CC
+0x2D54 = 0x64D5
+0x2D55 = 0x64D7
+0x2D57 = 0x64E4
+0x2D58 = 0x64E5
+0x2D59 = 0x64FF
+0x2D5A = 0x6504
+0x2D5B = 0x3A6E
+0x2D5C = 0x650F
+0x2D5D = 0x6514
+0x2D5E = 0x6516
+0x2D5F = 0x3A73
+0x2D60 = 0x651E
+0x2D61 = 0x6532
+0x2D62 = 0x6544
+0x2D63 = 0x6554
+0x2D64 = 0x656B
+0x2D65 = 0x657A
+0x2D66 = 0x6581
+0x2D67 = 0x6584
+0x2D68 = 0x6585
+0x2D69 = 0x658A
+0x2D6A = 0x65B2
+0x2D6B = 0x65B5
+0x2D6C = 0x65B8
+0x2D6D = 0x65BF
+0x2D6E = 0x65C2
+0x2D6F = 0x65C9
+0x2D70 = 0x65D4
+0x2D71 = 0x3AD6
+0x2D72 = 0x65F2
+0x2D73 = 0x65F9
+0x2D74 = 0x65FC
+0x2D75 = 0x6604
+0x2D76 = 0x6608
+0x2D77 = 0x6621
+0x2D78 = 0x662A
+0x2D79 = 0x6645
+0x2D7A = 0x6651
+0x2D7B = 0x664E
+0x2D7C = 0x3AEA
+0x2D7E = 0x6657
+0x2E21 = 0x665B
+0x2E22 = 0x6663
+0x2E25 = 0x666A
+0x2E26 = 0x666B
+0x2E27 = 0x666C
+0x2E28 = 0x666D
+0x2E29 = 0x667B
+0x2E2A = 0x6680
+0x2E2B = 0x6690
+0x2E2C = 0x6692
+0x2E2D = 0x6699
+0x2E2E = 0x3B0E
+0x2E2F = 0x66AD
+0x2E30 = 0x66B1
+0x2E31 = 0x66B5
+0x2E32 = 0x3B1A
+0x2E33 = 0x66BF
+0x2E34 = 0x3B1C
+0x2E35 = 0x66EC
+0x2E36 = 0x3AD7
+0x2E37 = 0x6701
+0x2E38 = 0x6705
+0x2E39 = 0x6712
+0x2E3B = 0x6719
+0x2E3E = 0x674C
+0x2E3F = 0x674D
+0x2E40 = 0x6754
+0x2E41 = 0x675D
+0x2E45 = 0x6774
+0x2E46 = 0x6776
+0x2E48 = 0x6792
+0x2E4A = 0x8363
+0x2E4B = 0x6810
+0x2E4C = 0x67B0
+0x2E4D = 0x67B2
+0x2E4E = 0x67C3
+0x2E4F = 0x67C8
+0x2E50 = 0x67D2
+0x2E51 = 0x67D9
+0x2E52 = 0x67DB
+0x2E53 = 0x67F0
+0x2E54 = 0x67F7
+0x2E58 = 0x6818
+0x2E59 = 0x681F
+0x2E5A = 0x682D
+0x2E5C = 0x6833
+0x2E5D = 0x683B
+0x2E5E = 0x683E
+0x2E5F = 0x6844
+0x2E60 = 0x6845
+0x2E61 = 0x6849
+0x2E62 = 0x684C
+0x2E63 = 0x6855
+0x2E64 = 0x6857
+0x2E65 = 0x3B77
+0x2E66 = 0x686B
+0x2E67 = 0x686E
+0x2E68 = 0x687A
+0x2E69 = 0x687C
+0x2E6A = 0x6882
+0x2E6B = 0x6890
+0x2E6C = 0x6896
+0x2E6D = 0x3B6D
+0x2E6E = 0x6898
+0x2E6F = 0x6899
+0x2E70 = 0x689A
+0x2E71 = 0x689C
+0x2E72 = 0x68AA
+0x2E73 = 0x68AB
+0x2E74 = 0x68B4
+0x2E75 = 0x68BB
+0x2E76 = 0x68FB
+0x2E79 = 0xFA13
+0x2E7A = 0x68C3
+0x2E7B = 0x68C5
+0x2E7C = 0x68CC
+0x2E7D = 0x68CF
+0x2E7E = 0x68D6
+0x2F21 = 0x68D9
+0x2F22 = 0x68E4
+0x2F23 = 0x68E5
+0x2F24 = 0x68EC
+0x2F25 = 0x68F7
+0x2F26 = 0x6903
+0x2F27 = 0x6907
+0x2F28 = 0x3B87
+0x2F29 = 0x3B88
+0x2F2B = 0x693B
+0x2F2C = 0x3B8D
+0x2F2D = 0x6946
+0x2F2E = 0x6969
+0x2F2F = 0x696C
+0x2F30 = 0x6972
+0x2F31 = 0x697A
+0x2F32 = 0x697F
+0x2F33 = 0x6992
+0x2F34 = 0x3BA4
+0x2F35 = 0x6996
+0x2F36 = 0x6998
+0x2F37 = 0x69A6
+0x2F38 = 0x69B0
+0x2F39 = 0x69B7
+0x2F3A = 0x69BA
+0x2F3B = 0x69BC
+0x2F3C = 0x69C0
+0x2F3D = 0x69D1
+0x2F3E = 0x69D6
+0x2F41 = 0x6A30
+0x2F44 = 0x69E3
+0x2F45 = 0x69EE
+0x2F46 = 0x69EF
+0x2F47 = 0x69F3
+0x2F48 = 0x3BCD
+0x2F49 = 0x69F4
+0x2F4A = 0x69FE
+0x2F4B = 0x6A11
+0x2F4C = 0x6A1A
+0x2F4D = 0x6A1D
+0x2F4F = 0x6A32
+0x2F50 = 0x6A33
+0x2F51 = 0x6A34
+0x2F52 = 0x6A3F
+0x2F53 = 0x6A46
+0x2F54 = 0x6A49
+0x2F55 = 0x6A7A
+0x2F56 = 0x6A4E
+0x2F57 = 0x6A52
+0x2F58 = 0x6A64
+0x2F5A = 0x6A7E
+0x2F5B = 0x6A83
+0x2F5C = 0x6A8B
+0x2F5D = 0x3BF0
+0x2F5E = 0x6A91
+0x2F5F = 0x6A9F
+0x2F60 = 0x6AA1
+0x2F62 = 0x6AAB
+0x2F63 = 0x6ABD
+0x2F64 = 0x6AC6
+0x2F65 = 0x6AD4
+0x2F66 = 0x6AD0
+0x2F67 = 0x6ADC
+0x2F68 = 0x6ADD
+0x2F6B = 0x6AEC
+0x2F6C = 0x6AF1
+0x2F6D = 0x6AF2
+0x2F6E = 0x6AF3
+0x2F6F = 0x6AFD
+0x2F71 = 0x6B0B
+0x2F72 = 0x6B0F
+0x2F73 = 0x6B10
+0x2F74 = 0x6B11
+0x2F76 = 0x6B17
+0x2F77 = 0x3C26
+0x2F78 = 0x6B2F
+0x2F79 = 0x6B4A
+0x2F7A = 0x6B58
+0x2F7B = 0x6B6C
+0x2F7C = 0x6B75
+0x2F7D = 0x6B7A
+0x2F7E = 0x6B81
+0x6E21 = 0x6B9B
+0x6E22 = 0x6BAE
+0x6E24 = 0x6BBD
+0x6E25 = 0x6BBE
+0x6E26 = 0x6BC7
+0x6E27 = 0x6BC8
+0x6E28 = 0x6BC9
+0x6E29 = 0x6BDA
+0x6E2A = 0x6BE6
+0x6E2B = 0x6BE7
+0x6E2C = 0x6BEE
+0x6E2D = 0x6BF1
+0x6E2E = 0x6C02
+0x6E2F = 0x6C0A
+0x6E30 = 0x6C0E
+0x6E31 = 0x6C35
+0x6E32 = 0x6C36
+0x6E33 = 0x6C3A
+0x6E35 = 0x6C3F
+0x6E36 = 0x6C4D
+0x6E37 = 0x6C5B
+0x6E38 = 0x6C6D
+0x6E39 = 0x6C84
+0x6E3A = 0x6C89
+0x6E3B = 0x3CC3
+0x6E3C = 0x6C94
+0x6E3D = 0x6C95
+0x6E3E = 0x6C97
+0x6E3F = 0x6CAD
+0x6E40 = 0x6CC2
+0x6E41 = 0x6CD0
+0x6E42 = 0x3CD2
+0x6E43 = 0x6CD6
+0x6E44 = 0x6CDA
+0x6E45 = 0x6CDC
+0x6E46 = 0x6CE9
+0x6E47 = 0x6CEC
+0x6E48 = 0x6CED
+0x6E4A = 0x6D00
+0x6E4B = 0x6D0A
+0x6E4C = 0x6D24
+0x6E4D = 0x6D26
+0x6E4E = 0x6D27
+0x6E4F = 0x6C67
+0x6E50 = 0x6D2F
+0x6E51 = 0x6D3C
+0x6E52 = 0x6D5B
+0x6E53 = 0x6D5E
+0x6E54 = 0x6D60
+0x6E55 = 0x6D70
+0x6E56 = 0x6D80
+0x6E57 = 0x6D81
+0x6E58 = 0x6D8A
+0x6E59 = 0x6D8D
+0x6E5A = 0x6D91
+0x6E5B = 0x6D98
+0x6E5D = 0x6E17
+0x6E61 = 0x6DAB
+0x6E62 = 0x6DAE
+0x6E63 = 0x6DB4
+0x6E64 = 0x6DC2
+0x6E65 = 0x6D34
+0x6E66 = 0x6DC8
+0x6E67 = 0x6DCE
+0x6E68 = 0x6DCF
+0x6E69 = 0x6DD0
+0x6E6A = 0x6DDF
+0x6E6B = 0x6DE9
+0x6E6C = 0x6DF6
+0x6E6D = 0x6E36
+0x6E6E = 0x6E1E
+0x6E6F = 0x6E22
+0x6E70 = 0x6E27
+0x6E71 = 0x3D11
+0x6E72 = 0x6E32
+0x6E73 = 0x6E3C
+0x6E74 = 0x6E48
+0x6E75 = 0x6E49
+0x6E76 = 0x6E4B
+0x6E77 = 0x6E4C
+0x6E78 = 0x6E4F
+0x6E79 = 0x6E51
+0x6E7A = 0x6E53
+0x6E7B = 0x6E54
+0x6E7C = 0x6E57
+0x6E7D = 0x6E63
+0x6E7E = 0x3D1E
+0x6F21 = 0x6E93
+0x6F22 = 0x6EA7
+0x6F23 = 0x6EB4
+0x6F24 = 0x6EBF
+0x6F25 = 0x6EC3
+0x6F26 = 0x6ECA
+0x6F27 = 0x6ED9
+0x6F28 = 0x6F35
+0x6F29 = 0x6EEB
+0x6F2A = 0x6EF9
+0x6F2B = 0x6EFB
+0x6F2C = 0x6F0A
+0x6F2D = 0x6F0C
+0x6F2E = 0x6F18
+0x6F2F = 0x6F25
+0x6F30 = 0x6F36
+0x6F31 = 0x6F3C
+0x6F33 = 0x6F52
+0x6F34 = 0x6F57
+0x6F35 = 0x6F5A
+0x6F36 = 0x6F60
+0x6F37 = 0x6F68
+0x6F38 = 0x6F98
+0x6F39 = 0x6F7D
+0x6F3A = 0x6F90
+0x6F3B = 0x6F96
+0x6F3C = 0x6FBE
+0x6F3D = 0x6F9F
+0x6F3E = 0x6FA5
+0x6F3F = 0x6FAF
+0x6F40 = 0x3D64
+0x6F41 = 0x6FB5
+0x6F42 = 0x6FC8
+0x6F43 = 0x6FC9
+0x6F44 = 0x6FDA
+0x6F45 = 0x6FDE
+0x6F46 = 0x6FE9
+0x6F48 = 0x6FFC
+0x6F49 = 0x7000
+0x6F4A = 0x7007
+0x6F4B = 0x700A
+0x6F4C = 0x7023
+0x6F4E = 0x7039
+0x6F4F = 0x703A
+0x6F50 = 0x703C
+0x6F51 = 0x7043
+0x6F52 = 0x7047
+0x6F53 = 0x704B
+0x6F54 = 0x3D9A
+0x6F55 = 0x7054
+0x6F56 = 0x7065
+0x6F57 = 0x7069
+0x6F58 = 0x706C
+0x6F59 = 0x706E
+0x6F5A = 0x7076
+0x6F5B = 0x707E
+0x6F5C = 0x7081
+0x6F5D = 0x7086
+0x6F5E = 0x7095
+0x6F5F = 0x7097
+0x6F60 = 0x70BB
+0x6F62 = 0x709F
+0x6F63 = 0x70B1
+0x6F65 = 0x70EC
+0x6F66 = 0x70CA
+0x6F67 = 0x70D1
+0x6F68 = 0x70D3
+0x6F69 = 0x70DC
+0x6F6A = 0x7103
+0x6F6B = 0x7104
+0x6F6C = 0x7106
+0x6F6D = 0x7107
+0x6F6E = 0x7108
+0x6F6F = 0x710C
+0x6F70 = 0x3DC0
+0x6F71 = 0x712F
+0x6F72 = 0x7131
+0x6F73 = 0x7150
+0x6F74 = 0x714A
+0x6F75 = 0x7153
+0x6F76 = 0x715E
+0x6F77 = 0x3DD4
+0x6F78 = 0x7196
+0x6F79 = 0x7180
+0x6F7A = 0x719B
+0x6F7B = 0x71A0
+0x6F7C = 0x71A2
+0x6F7D = 0x71AE
+0x6F7E = 0x71AF
+0x7021 = 0x71B3
+0x7023 = 0x71CB
+0x7024 = 0x71D3
+0x7025 = 0x71D9
+0x7026 = 0x71DC
+0x7027 = 0x7207
+0x7028 = 0x3E05
+0x7029 = 0xFA49
+0x702A = 0x722B
+0x702B = 0x7234
+0x702C = 0x7238
+0x702D = 0x7239
+0x702E = 0x4E2C
+0x702F = 0x7242
+0x7030 = 0x7253
+0x7031 = 0x7257
+0x7032 = 0x7263
+0x7034 = 0x726E
+0x7035 = 0x726F
+0x7036 = 0x7278
+0x7037 = 0x727F
+0x7038 = 0x728E
+0x703A = 0x72AD
+0x703B = 0x72AE
+0x703C = 0x72B0
+0x703D = 0x72B1
+0x703E = 0x72C1
+0x703F = 0x3E60
+0x7040 = 0x72CC
+0x7041 = 0x3E66
+0x7042 = 0x3E68
+0x7043 = 0x72F3
+0x7044 = 0x72FA
+0x7045 = 0x7307
+0x7046 = 0x7312
+0x7047 = 0x7318
+0x7048 = 0x7319
+0x7049 = 0x3E83
+0x704A = 0x7339
+0x704B = 0x732C
+0x704C = 0x7331
+0x704D = 0x7333
+0x704E = 0x733D
+0x704F = 0x7352
+0x7050 = 0x3E94
+0x7051 = 0x736B
+0x7052 = 0x736C
+0x7054 = 0x736E
+0x7055 = 0x736F
+0x7056 = 0x7371
+0x7057 = 0x7377
+0x7058 = 0x7381
+0x7059 = 0x7385
+0x705A = 0x738A
+0x705B = 0x7394
+0x705C = 0x7398
+0x705D = 0x739C
+0x705E = 0x739E
+0x705F = 0x73A5
+0x7060 = 0x73A8
+0x7061 = 0x73B5
+0x7062 = 0x73B7
+0x7063 = 0x73B9
+0x7064 = 0x73BC
+0x7065 = 0x73BF
+0x7066 = 0x73C5
+0x7067 = 0x73CB
+0x7068 = 0x73E1
+0x7069 = 0x73E7
+0x706A = 0x73F9
+0x706B = 0x7413
+0x706C = 0x73FA
+0x706D = 0x7401
+0x706E = 0x7424
+0x706F = 0x7431
+0x7070 = 0x7439
+0x7071 = 0x7453
+0x7072 = 0x7440
+0x7073 = 0x7443
+0x7074 = 0x744D
+0x7075 = 0x7452
+0x7076 = 0x745D
+0x7077 = 0x7471
+0x7078 = 0x7481
+0x7079 = 0x7485
+0x707A = 0x7488
+0x707C = 0x7492
+0x707D = 0x7497
+0x707E = 0x7499
+0x7121 = 0x74A0
+0x7122 = 0x74A1
+0x7123 = 0x74A5
+0x7124 = 0x74AA
+0x7125 = 0x74AB
+0x7126 = 0x74B9
+0x7127 = 0x74BB
+0x7128 = 0x74BA
+0x7129 = 0x74D6
+0x712A = 0x74D8
+0x712B = 0x74DE
+0x712C = 0x74EF
+0x712D = 0x74EB
+0x712F = 0x74FA
+0x7131 = 0x7520
+0x7132 = 0x7524
+0x7133 = 0x752A
+0x7134 = 0x3F57
+0x7136 = 0x753D
+0x7137 = 0x753E
+0x7138 = 0x7540
+0x7139 = 0x7548
+0x713A = 0x754E
+0x713B = 0x7550
+0x713C = 0x7552
+0x713D = 0x756C
+0x713E = 0x7572
+0x713F = 0x7571
+0x7140 = 0x757A
+0x7141 = 0x757D
+0x7142 = 0x757E
+0x7143 = 0x7581
+0x7145 = 0x758C
+0x7146 = 0x3F75
+0x7147 = 0x75A2
+0x7148 = 0x3F77
+0x7149 = 0x75B0
+0x714A = 0x75B7
+0x714B = 0x75BF
+0x714C = 0x75C0
+0x714D = 0x75C6
+0x714E = 0x75CF
+0x714F = 0x75D3
+0x7150 = 0x75DD
+0x7151 = 0x75DF
+0x7152 = 0x75E0
+0x7153 = 0x75E7
+0x7154 = 0x75EC
+0x7155 = 0x75EE
+0x7156 = 0x75F1
+0x7157 = 0x75F9
+0x7158 = 0x7603
+0x7159 = 0x7618
+0x715A = 0x7607
+0x715B = 0x760F
+0x715C = 0x3FAE
+0x715E = 0x7613
+0x715F = 0x761B
+0x7160 = 0x761C
+0x7162 = 0x7625
+0x7163 = 0x7628
+0x7164 = 0x763C
+0x7165 = 0x7633
+0x7167 = 0x3FC9
+0x7168 = 0x7641
+0x716A = 0x7649
+0x716B = 0x7655
+0x716C = 0x3FD7
+0x716D = 0x766E
+0x716E = 0x7695
+0x716F = 0x769C
+0x7170 = 0x76A1
+0x7171 = 0x76A0
+0x7172 = 0x76A7
+0x7173 = 0x76A8
+0x7174 = 0x76AF
+0x7176 = 0x76C9
+0x7178 = 0x76E8
+0x7179 = 0x76EC
+0x717B = 0x7717
+0x717C = 0x771A
+0x717D = 0x772D
+0x717E = 0x7735
+0x7222 = 0x4039
+0x7225 = 0x7758
+0x7226 = 0x7760
+0x7227 = 0x776A
+0x7229 = 0x7772
+0x722A = 0x777C
+0x722B = 0x777D
+0x722D = 0x4058
+0x722E = 0x779A
+0x722F = 0x779F
+0x7230 = 0x77A2
+0x7231 = 0x77A4
+0x7232 = 0x77A9
+0x7233 = 0x77DE
+0x7234 = 0x77DF
+0x7235 = 0x77E4
+0x7236 = 0x77E6
+0x7237 = 0x77EA
+0x7238 = 0x77EC
+0x7239 = 0x4093
+0x723A = 0x77F0
+0x723B = 0x77F4
+0x723C = 0x77FB
+0x723E = 0x7805
+0x723F = 0x7806
+0x7240 = 0x7809
+0x7241 = 0x780D
+0x7242 = 0x7819
+0x7243 = 0x7821
+0x7244 = 0x782C
+0x7245 = 0x7847
+0x7246 = 0x7864
+0x7247 = 0x786A
+0x7249 = 0x788A
+0x724A = 0x7894
+0x724B = 0x78A4
+0x724C = 0x789D
+0x724D = 0x789E
+0x724E = 0x789F
+0x724F = 0x78BB
+0x7250 = 0x78C8
+0x7251 = 0x78CC
+0x7252 = 0x78CE
+0x7253 = 0x78D5
+0x7254 = 0x78E0
+0x7255 = 0x78E1
+0x7256 = 0x78E6
+0x7257 = 0x78F9
+0x7258 = 0x78FA
+0x7259 = 0x78FB
+0x725A = 0x78FE
+0x725C = 0x7910
+0x725D = 0x791B
+0x725E = 0x7930
+0x725F = 0x7925
+0x7260 = 0x793B
+0x7261 = 0x794A
+0x7262 = 0x7958
+0x7263 = 0x795B
+0x7264 = 0x4105
+0x7265 = 0x7967
+0x7266 = 0x7972
+0x7267 = 0x7994
+0x7268 = 0x7995
+0x7269 = 0x7996
+0x726A = 0x799B
+0x726B = 0x79A1
+0x726C = 0x79A9
+0x726D = 0x79B4
+0x726E = 0x79BB
+0x726F = 0x79C2
+0x7270 = 0x79C7
+0x7271 = 0x79CC
+0x7272 = 0x79CD
+0x7273 = 0x79D6
+0x7274 = 0x4148
+0x7277 = 0x414F
+0x7278 = 0x7A0A
+0x7279 = 0x7A11
+0x727A = 0x7A15
+0x727B = 0x7A1B
+0x727C = 0x7A1E
+0x727D = 0x4163
+0x727E = 0x7A2D
+0x7321 = 0x7A38
+0x7322 = 0x7A47
+0x7323 = 0x7A4C
+0x7324 = 0x7A56
+0x7325 = 0x7A59
+0x7326 = 0x7A5C
+0x7327 = 0x7A5F
+0x7328 = 0x7A60
+0x7329 = 0x7A67
+0x732A = 0x7A6A
+0x732B = 0x7A75
+0x732C = 0x7A78
+0x732D = 0x7A82
+0x732E = 0x7A8A
+0x732F = 0x7A90
+0x7330 = 0x7AA3
+0x7331 = 0x7AAC
+0x7333 = 0x41B4
+0x7334 = 0x7AB9
+0x7335 = 0x7ABC
+0x7336 = 0x7ABE
+0x7337 = 0x41BF
+0x7338 = 0x7ACC
+0x7339 = 0x7AD1
+0x733A = 0x7AE7
+0x733B = 0x7AE8
+0x733C = 0x7AF4
+0x733F = 0x7B07
+0x7341 = 0x7B3D
+0x7342 = 0x7B27
+0x7343 = 0x7B2A
+0x7344 = 0x7B2E
+0x7345 = 0x7B2F
+0x7346 = 0x7B31
+0x7347 = 0x41E6
+0x7348 = 0x41F3
+0x7349 = 0x7B7F
+0x734A = 0x7B41
+0x734B = 0x41EE
+0x734C = 0x7B55
+0x734D = 0x7B79
+0x734E = 0x7B64
+0x734F = 0x7B66
+0x7350 = 0x7B69
+0x7351 = 0x7B73
+0x7353 = 0x4207
+0x7354 = 0x7B90
+0x7355 = 0x7B91
+0x7356 = 0x7B9B
+0x7357 = 0x420E
+0x7358 = 0x7BAF
+0x7359 = 0x7BB5
+0x735A = 0x7BBC
+0x735B = 0x7BC5
+0x735C = 0x7BCA
+0x735F = 0x7BD4
+0x7360 = 0x7BD6
+0x7361 = 0x7BDA
+0x7362 = 0x7BEA
+0x7363 = 0x7BF0
+0x7364 = 0x7C03
+0x7365 = 0x7C0B
+0x7366 = 0x7C0E
+0x7367 = 0x7C0F
+0x7368 = 0x7C26
+0x7369 = 0x7C45
+0x736A = 0x7C4A
+0x736B = 0x7C51
+0x736C = 0x7C57
+0x736D = 0x7C5E
+0x736E = 0x7C61
+0x736F = 0x7C69
+0x7370 = 0x7C6E
+0x7371 = 0x7C6F
+0x7372 = 0x7C70
+0x7376 = 0x7CA6
+0x7378 = 0x7CB6
+0x7379 = 0x7CB7
+0x737A = 0x7CBF
+0x737C = 0x7CC4
+0x737E = 0x7CC8
+0x7421 = 0x7CCD
+0x7423 = 0x7CD7
+0x7425 = 0x7CE6
+0x7426 = 0x7CEB
+0x7428 = 0x7CF5
+0x7429 = 0x7D03
+0x742A = 0x7D09
+0x742B = 0x42C6
+0x742C = 0x7D12
+0x742D = 0x7D1E
+0x7430 = 0x7D3D
+0x7431 = 0x7D3E
+0x7432 = 0x7D40
+0x7433 = 0x7D47
+0x7436 = 0x42D6
+0x7437 = 0x7D59
+0x7438 = 0x7D5A
+0x7439 = 0x7D6A
+0x743A = 0x7D70
+0x743B = 0x42DD
+0x743C = 0x7D7F
+0x743E = 0x7D86
+0x743F = 0x7D88
+0x7440 = 0x7D8C
+0x7441 = 0x7D97
+0x7443 = 0x7D9D
+0x7444 = 0x7DA7
+0x7445 = 0x7DAA
+0x7446 = 0x7DB6
+0x7447 = 0x7DB7
+0x7448 = 0x7DC0
+0x7449 = 0x7DD7
+0x744A = 0x7DD9
+0x744B = 0x7DE6
+0x744C = 0x7DF1
+0x744D = 0x7DF9
+0x744E = 0x4302
+0x7450 = 0xFA58
+0x7451 = 0x7E10
+0x7452 = 0x7E17
+0x7453 = 0x7E1D
+0x7454 = 0x7E20
+0x7455 = 0x7E27
+0x7456 = 0x7E2C
+0x7457 = 0x7E45
+0x7458 = 0x7E73
+0x7459 = 0x7E75
+0x745A = 0x7E7E
+0x745B = 0x7E86
+0x745C = 0x7E87
+0x745D = 0x432B
+0x745E = 0x7E91
+0x745F = 0x7E98
+0x7460 = 0x7E9A
+0x7461 = 0x4343
+0x7462 = 0x7F3C
+0x7463 = 0x7F3B
+0x7464 = 0x7F3E
+0x7465 = 0x7F43
+0x7466 = 0x7F44
+0x7467 = 0x7F4F
+0x7468 = 0x34C1
+0x746A = 0x7F52
+0x746C = 0x7F61
+0x746D = 0x7F63
+0x746E = 0x7F64
+0x746F = 0x7F6D
+0x7470 = 0x7F7D
+0x7471 = 0x7F7E
+0x7473 = 0x7F90
+0x7474 = 0x517B
+0x7476 = 0x7F96
+0x7477 = 0x7F9C
+0x7478 = 0x7FAD
+0x747A = 0x7FC3
+0x747B = 0x7FCF
+0x747C = 0x7FE3
+0x747D = 0x7FE5
+0x747E = 0x7FEF
+0x7521 = 0x7FF2
+0x7522 = 0x8002
+0x7523 = 0x800A
+0x7524 = 0x8008
+0x7525 = 0x800E
+0x7526 = 0x8011
+0x7527 = 0x8016
+0x7528 = 0x8024
+0x7529 = 0x802C
+0x752A = 0x8030
+0x752B = 0x8043
+0x752C = 0x8066
+0x752D = 0x8071
+0x752E = 0x8075
+0x752F = 0x807B
+0x7530 = 0x8099
+0x7531 = 0x809C
+0x7532 = 0x80A4
+0x7533 = 0x80A7
+0x7534 = 0x80B8
+0x7536 = 0x80C5
+0x7537 = 0x80D5
+0x7538 = 0x80D8
+0x7539 = 0x80E6
+0x753B = 0x810D
+0x753C = 0x80F5
+0x753D = 0x80FB
+0x753E = 0x43EE
+0x753F = 0x8135
+0x7540 = 0x8116
+0x7541 = 0x811E
+0x7542 = 0x43F0
+0x7543 = 0x8124
+0x7544 = 0x8127
+0x7545 = 0x812C
+0x7547 = 0x813D
+0x7548 = 0x4408
+0x7549 = 0x8169
+0x754A = 0x4417
+0x754B = 0x8181
+0x754C = 0x441C
+0x754D = 0x8184
+0x754E = 0x8185
+0x754F = 0x4422
+0x7550 = 0x8198
+0x7551 = 0x81B2
+0x7552 = 0x81C1
+0x7553 = 0x81C3
+0x7554 = 0x81D6
+0x7555 = 0x81DB
+0x7557 = 0x81E4
+0x7559 = 0x81EC
+0x755B = 0x81FD
+0x755C = 0x81FF
+0x755E = 0x8204
+0x7560 = 0x8219
+0x7561 = 0x8221
+0x7562 = 0x8222
+0x7564 = 0x8232
+0x7565 = 0x8234
+0x7566 = 0x823C
+0x7567 = 0x8246
+0x7568 = 0x8249
+0x7569 = 0x8245
+0x756B = 0x824B
+0x756C = 0x4476
+0x756D = 0x824F
+0x756E = 0x447A
+0x756F = 0x8257
+0x7571 = 0x825C
+0x7572 = 0x8263
+0x7574 = 0xFA5D
+0x7575 = 0xFA5E
+0x7576 = 0x8279
+0x7577 = 0x4491
+0x7578 = 0x827D
+0x7579 = 0x827F
+0x757A = 0x8283
+0x757B = 0x828A
+0x757C = 0x8293
+0x757D = 0x82A7
+0x757E = 0x82A8
+0x7621 = 0x82B2
+0x7622 = 0x82B4
+0x7623 = 0x82BA
+0x7624 = 0x82BC
+0x7625 = 0x82E2
+0x7626 = 0x82E8
+0x7627 = 0x82F7
+0x7628 = 0x8307
+0x7629 = 0x8308
+0x762A = 0x830C
+0x762B = 0x8354
+0x762C = 0x831B
+0x762D = 0x831D
+0x762E = 0x8330
+0x762F = 0x833C
+0x7630 = 0x8344
+0x7631 = 0x8357
+0x7632 = 0x44BE
+0x7633 = 0x837F
+0x7634 = 0x44D4
+0x7635 = 0x44B3
+0x7636 = 0x838D
+0x7637 = 0x8394
+0x7638 = 0x8395
+0x7639 = 0x839B
+0x763A = 0x839D
+0x763B = 0x83C9
+0x763C = 0x83D0
+0x763D = 0x83D4
+0x763E = 0x83DD
+0x763F = 0x83E5
+0x7640 = 0x83F9
+0x7641 = 0x840F
+0x7642 = 0x8411
+0x7643 = 0x8415
+0x7645 = 0x8417
+0x7646 = 0x8439
+0x7647 = 0x844A
+0x7648 = 0x844F
+0x7649 = 0x8451
+0x764A = 0x8452
+0x764B = 0x8459
+0x764C = 0x845A
+0x764D = 0x845C
+0x764F = 0x8465
+0x7650 = 0x8476
+0x7651 = 0x8478
+0x7652 = 0x847C
+0x7653 = 0x8481
+0x7654 = 0x450D
+0x7655 = 0x84DC
+0x7656 = 0x8497
+0x7657 = 0x84A6
+0x7658 = 0x84BE
+0x7659 = 0x4508
+0x765A = 0x84CE
+0x765B = 0x84CF
+0x765C = 0x84D3
+0x765E = 0x84E7
+0x765F = 0x84EA
+0x7660 = 0x84EF
+0x7661 = 0x84F0
+0x7662 = 0x84F1
+0x7663 = 0x84FA
+0x7664 = 0x84FD
+0x7665 = 0x850C
+0x7666 = 0x851B
+0x7667 = 0x8524
+0x7668 = 0x8525
+0x7669 = 0x852B
+0x766A = 0x8534
+0x766B = 0x854F
+0x766C = 0x856F
+0x766D = 0x4525
+0x766E = 0x4543
+0x766F = 0x853E
+0x7670 = 0x8551
+0x7671 = 0x8553
+0x7672 = 0x855E
+0x7673 = 0x8561
+0x7674 = 0x8562
+0x7676 = 0x857B
+0x7677 = 0x857D
+0x7678 = 0x857F
+0x7679 = 0x8581
+0x767A = 0x8586
+0x767B = 0x8593
+0x767C = 0x859D
+0x767D = 0x859F
+0x7723 = 0x85B7
+0x7724 = 0x85BC
+0x7725 = 0x85C7
+0x7726 = 0x85CA
+0x7727 = 0x85D8
+0x7728 = 0x85D9
+0x7729 = 0x85DF
+0x772A = 0x85E1
+0x772B = 0x85E6
+0x772C = 0x85F6
+0x772D = 0x8600
+0x772E = 0x8611
+0x772F = 0x861E
+0x7730 = 0x8621
+0x7731 = 0x8624
+0x7732 = 0x8627
+0x7734 = 0x8639
+0x7735 = 0x863C
+0x7737 = 0x8640
+0x7738 = 0xFA20
+0x7739 = 0x8653
+0x773A = 0x8656
+0x773B = 0x866F
+0x773C = 0x8677
+0x773D = 0x867A
+0x773E = 0x8687
+0x773F = 0x8689
+0x7740 = 0x868D
+0x7741 = 0x8691
+0x7742 = 0x869C
+0x7743 = 0x869D
+0x7744 = 0x86A8
+0x7745 = 0xFA21
+0x7746 = 0x86B1
+0x7747 = 0x86B3
+0x7748 = 0x86C1
+0x7749 = 0x86C3
+0x774A = 0x86D1
+0x774B = 0x86D5
+0x774C = 0x86D7
+0x774D = 0x86E3
+0x774E = 0x86E6
+0x774F = 0x45B8
+0x7750 = 0x8705
+0x7751 = 0x8707
+0x7752 = 0x870E
+0x7753 = 0x8710
+0x7754 = 0x8713
+0x7755 = 0x8719
+0x7756 = 0x871F
+0x7757 = 0x8721
+0x7758 = 0x8723
+0x7759 = 0x8731
+0x775A = 0x873A
+0x775B = 0x873E
+0x775C = 0x8740
+0x775D = 0x8743
+0x775E = 0x8751
+0x775F = 0x8758
+0x7760 = 0x8764
+0x7761 = 0x8765
+0x7762 = 0x8772
+0x7763 = 0x877C
+0x7766 = 0x87A7
+0x7767 = 0x8789
+0x7768 = 0x878B
+0x7769 = 0x8793
+0x776A = 0x87A0
+0x776C = 0x45E5
+0x776D = 0x87BE
+0x776F = 0x87C1
+0x7770 = 0x87CE
+0x7771 = 0x87F5
+0x7772 = 0x87DF
+0x7774 = 0x87E3
+0x7775 = 0x87E5
+0x7776 = 0x87E6
+0x7777 = 0x87EA
+0x7778 = 0x87EB
+0x7779 = 0x87ED
+0x777A = 0x8801
+0x777B = 0x8803
+0x777C = 0x880B
+0x777D = 0x8813
+0x777E = 0x8828
+0x7821 = 0x882E
+0x7822 = 0x8832
+0x7823 = 0x883C
+0x7824 = 0x460F
+0x7825 = 0x884A
+0x7826 = 0x8858
+0x7827 = 0x885F
+0x7828 = 0x8864
+0x782B = 0x8869
+0x782D = 0x886F
+0x782E = 0x88A0
+0x782F = 0x88BC
+0x7830 = 0x88BD
+0x7831 = 0x88BE
+0x7832 = 0x88C0
+0x7833 = 0x88D2
+0x7835 = 0x88D1
+0x7836 = 0x88D3
+0x7837 = 0x88DB
+0x7838 = 0x88F0
+0x7839 = 0x88F1
+0x783A = 0x4641
+0x783B = 0x8901
+0x783D = 0x8937
+0x783F = 0x8942
+0x7840 = 0x8945
+0x7841 = 0x8949
+0x7843 = 0x4665
+0x7844 = 0x8962
+0x7845 = 0x8980
+0x7846 = 0x8989
+0x7847 = 0x8990
+0x7848 = 0x899F
+0x7849 = 0x89B0
+0x784A = 0x89B7
+0x784B = 0x89D6
+0x784C = 0x89D8
+0x784D = 0x89EB
+0x784E = 0x46A1
+0x784F = 0x89F1
+0x7850 = 0x89F3
+0x7851 = 0x89FD
+0x7852 = 0x89FF
+0x7853 = 0x46AF
+0x7854 = 0x8A11
+0x7855 = 0x8A14
+0x7857 = 0x8A21
+0x7858 = 0x8A35
+0x7859 = 0x8A3E
+0x785A = 0x8A45
+0x785B = 0x8A4D
+0x785C = 0x8A58
+0x785D = 0x8AAE
+0x785E = 0x8A90
+0x785F = 0x8AB7
+0x7860 = 0x8ABE
+0x7861 = 0x8AD7
+0x7862 = 0x8AFC
+0x7864 = 0x8B0A
+0x7865 = 0x8B05
+0x7866 = 0x8B0D
+0x7867 = 0x8B1C
+0x7868 = 0x8B1F
+0x7869 = 0x8B2D
+0x786A = 0x8B43
+0x786B = 0x470C
+0x786C = 0x8B51
+0x786D = 0x8B5E
+0x786E = 0x8B76
+0x786F = 0x8B7F
+0x7870 = 0x8B81
+0x7871 = 0x8B8B
+0x7872 = 0x8B94
+0x7873 = 0x8B95
+0x7874 = 0x8B9C
+0x7875 = 0x8B9E
+0x7876 = 0x8C39
+0x7878 = 0x8C3D
+0x787B = 0x8C45
+0x787C = 0x8C47
+0x787D = 0x8C4F
+0x787E = 0x8C54
+0x7921 = 0x8C57
+0x7922 = 0x8C69
+0x7923 = 0x8C6D
+0x7924 = 0x8C73
+0x7926 = 0x8C93
+0x7927 = 0x8C92
+0x7928 = 0x8C99
+0x7929 = 0x4764
+0x792A = 0x8C9B
+0x792B = 0x8CA4
+0x792C = 0x8CD6
+0x792D = 0x8CD5
+0x792E = 0x8CD9
+0x7930 = 0x8CF0
+0x7931 = 0x8CF1
+0x7933 = 0x8D09
+0x7934 = 0x8D0E
+0x7935 = 0x8D6C
+0x7936 = 0x8D84
+0x7937 = 0x8D95
+0x7938 = 0x8DA6
+0x793A = 0x8DC6
+0x793B = 0x8DC8
+0x793C = 0x8DD9
+0x793D = 0x8DEC
+0x793E = 0x8E0C
+0x793F = 0x47FD
+0x7940 = 0x8DFD
+0x7941 = 0x8E06
+0x7943 = 0x8E14
+0x7944 = 0x8E16
+0x7945 = 0x8E21
+0x7946 = 0x8E22
+0x7947 = 0x8E27
+0x7949 = 0x4816
+0x794A = 0x8E36
+0x794B = 0x8E39
+0x794C = 0x8E4B
+0x794D = 0x8E54
+0x794E = 0x8E62
+0x794F = 0x8E6C
+0x7950 = 0x8E6D
+0x7951 = 0x8E6F
+0x7952 = 0x8E98
+0x7953 = 0x8E9E
+0x7954 = 0x8EAE
+0x7955 = 0x8EB3
+0x7956 = 0x8EB5
+0x7957 = 0x8EB6
+0x7958 = 0x8EBB
+0x795A = 0x8ED1
+0x795B = 0x8ED4
+0x795C = 0x484E
+0x795D = 0x8EF9
+0x795F = 0x8F00
+0x7960 = 0x8F08
+0x7961 = 0x8F17
+0x7962 = 0x8F2B
+0x7963 = 0x8F40
+0x7964 = 0x8F4A
+0x7965 = 0x8F58
+0x7967 = 0x8FA4
+0x7968 = 0x8FB4
+0x7969 = 0xFA66
+0x796A = 0x8FB6
+0x796C = 0x8FC1
+0x796D = 0x8FC6
+0x796E = 0xFA24
+0x796F = 0x8FCA
+0x7970 = 0x8FCD
+0x7971 = 0x8FD3
+0x7972 = 0x8FD5
+0x7973 = 0x8FE0
+0x7974 = 0x8FF1
+0x7975 = 0x8FF5
+0x7976 = 0x8FFB
+0x7977 = 0x9002
+0x7978 = 0x900C
+0x7979 = 0x9037
+0x797B = 0x9043
+0x797C = 0x9044
+0x797D = 0x905D
+0x7A22 = 0x9085
+0x7A23 = 0x908C
+0x7A24 = 0x9090
+0x7A25 = 0x961D
+0x7A26 = 0x90A1
+0x7A27 = 0x48B5
+0x7A28 = 0x90B0
+0x7A29 = 0x90B6
+0x7A2A = 0x90C3
+0x7A2B = 0x90C8
+0x7A2D = 0x90DC
+0x7A2E = 0x90DF
+0x7A30 = 0x90F6
+0x7A31 = 0x90F2
+0x7A32 = 0x9100
+0x7A33 = 0x90EB
+0x7A34 = 0x90FE
+0x7A35 = 0x90FF
+0x7A36 = 0x9104
+0x7A37 = 0x9106
+0x7A38 = 0x9118
+0x7A39 = 0x911C
+0x7A3A = 0x911E
+0x7A3B = 0x9137
+0x7A3C = 0x9139
+0x7A3D = 0x913A
+0x7A3E = 0x9146
+0x7A3F = 0x9147
+0x7A40 = 0x9157
+0x7A41 = 0x9159
+0x7A42 = 0x9161
+0x7A43 = 0x9164
+0x7A44 = 0x9174
+0x7A45 = 0x9179
+0x7A46 = 0x9185
+0x7A47 = 0x918E
+0x7A48 = 0x91A8
+0x7A49 = 0x91AE
+0x7A4A = 0x91B3
+0x7A4B = 0x91B6
+0x7A4C = 0x91C3
+0x7A4D = 0x91C4
+0x7A4E = 0x91DA
+0x7A51 = 0x91EC
+0x7A52 = 0x91EE
+0x7A53 = 0x9201
+0x7A54 = 0x920A
+0x7A55 = 0x9216
+0x7A56 = 0x9217
+0x7A58 = 0x9233
+0x7A59 = 0x9242
+0x7A5A = 0x9247
+0x7A5B = 0x924A
+0x7A5C = 0x924E
+0x7A5D = 0x9251
+0x7A5E = 0x9256
+0x7A5F = 0x9259
+0x7A60 = 0x9260
+0x7A61 = 0x9261
+0x7A62 = 0x9265
+0x7A63 = 0x9267
+0x7A64 = 0x9268
+0x7A67 = 0x927C
+0x7A68 = 0x927D
+0x7A69 = 0x927F
+0x7A6A = 0x9289
+0x7A6B = 0x928D
+0x7A6C = 0x9297
+0x7A6D = 0x9299
+0x7A6E = 0x929F
+0x7A6F = 0x92A7
+0x7A70 = 0x92AB
+0x7A73 = 0x92B2
+0x7A74 = 0x92BF
+0x7A75 = 0x92C0
+0x7A76 = 0x92C6
+0x7A77 = 0x92CE
+0x7A78 = 0x92D0
+0x7A79 = 0x92D7
+0x7A7A = 0x92D9
+0x7A7B = 0x92E5
+0x7A7C = 0x92E7
+0x7A7D = 0x9311
+0x7B22 = 0x92F7
+0x7B23 = 0x92F9
+0x7B24 = 0x92FB
+0x7B25 = 0x9302
+0x7B26 = 0x930D
+0x7B27 = 0x9315
+0x7B28 = 0x931D
+0x7B29 = 0x931E
+0x7B2A = 0x9327
+0x7B2B = 0x9329
+0x7B2E = 0x9347
+0x7B2F = 0x9351
+0x7B30 = 0x9357
+0x7B31 = 0x935A
+0x7B32 = 0x936B
+0x7B33 = 0x9371
+0x7B34 = 0x9373
+0x7B35 = 0x93A1
+0x7B38 = 0x9388
+0x7B39 = 0x938B
+0x7B3A = 0x938F
+0x7B3B = 0x939E
+0x7B3C = 0x93F5
+0x7B3F = 0x93F1
+0x7B40 = 0x93C1
+0x7B41 = 0x93C7
+0x7B42 = 0x93DC
+0x7B43 = 0x93E2
+0x7B44 = 0x93E7
+0x7B45 = 0x9409
+0x7B46 = 0x940F
+0x7B47 = 0x9416
+0x7B48 = 0x9417
+0x7B49 = 0x93FB
+0x7B4A = 0x9432
+0x7B4B = 0x9434
+0x7B4C = 0x943B
+0x7B4D = 0x9445
+0x7B50 = 0x946D
+0x7B51 = 0x946F
+0x7B52 = 0x9578
+0x7B53 = 0x9579
+0x7B54 = 0x9586
+0x7B55 = 0x958C
+0x7B56 = 0x958D
+0x7B58 = 0x95AB
+0x7B59 = 0x95B4
+0x7B5B = 0x95C8
+0x7B5E = 0x962C
+0x7B5F = 0x9633
+0x7B60 = 0x9634
+0x7B62 = 0x963C
+0x7B63 = 0x9641
+0x7B64 = 0x9661
+0x7B66 = 0x9682
+0x7B68 = 0x969A
+0x7B6A = 0x49E7
+0x7B6B = 0x96A9
+0x7B6C = 0x96AF
+0x7B6D = 0x96B3
+0x7B6E = 0x96BA
+0x7B6F = 0x96BD
+0x7B70 = 0x49FA
+0x7B72 = 0x96D8
+0x7B73 = 0x96DA
+0x7B74 = 0x96DD
+0x7B75 = 0x4A04
+0x7B76 = 0x9714
+0x7B77 = 0x9723
+0x7B78 = 0x4A29
+0x7B79 = 0x9736
+0x7B7A = 0x9741
+0x7B7B = 0x9747
+0x7B7C = 0x9755
+0x7B7D = 0x9757
+0x7B7E = 0x975B
+0x7C21 = 0x976A
+0x7C24 = 0x9796
+0x7C25 = 0x979A
+0x7C26 = 0x979E
+0x7C27 = 0x97A2
+0x7C28 = 0x97B1
+0x7C29 = 0x97B2
+0x7C2A = 0x97BE
+0x7C2B = 0x97CC
+0x7C2C = 0x97D1
+0x7C2D = 0x97D4
+0x7C2E = 0x97D8
+0x7C2F = 0x97D9
+0x7C30 = 0x97E1
+0x7C31 = 0x97F1
+0x7C32 = 0x9804
+0x7C33 = 0x980D
+0x7C34 = 0x980E
+0x7C35 = 0x9814
+0x7C36 = 0x9816
+0x7C37 = 0x4ABC
+0x7C39 = 0x9823
+0x7C3A = 0x9832
+0x7C3B = 0x9833
+0x7C3C = 0x9825
+0x7C3D = 0x9847
+0x7C3E = 0x9866
+0x7C3F = 0x98AB
+0x7C40 = 0x98AD
+0x7C41 = 0x98B0
+0x7C43 = 0x98B7
+0x7C44 = 0x98B8
+0x7C45 = 0x98BB
+0x7C46 = 0x98BC
+0x7C47 = 0x98BF
+0x7C48 = 0x98C2
+0x7C49 = 0x98C7
+0x7C4A = 0x98CB
+0x7C4B = 0x98E0
+0x7C4D = 0x98E1
+0x7C4E = 0x98E3
+0x7C4F = 0x98E5
+0x7C50 = 0x98EA
+0x7C51 = 0x98F0
+0x7C52 = 0x98F1
+0x7C53 = 0x98F3
+0x7C54 = 0x9908
+0x7C55 = 0x4B3B
+0x7C57 = 0x9916
+0x7C58 = 0x9917
+0x7C5A = 0x991A
+0x7C5B = 0x991B
+0x7C5C = 0x991C
+0x7C5E = 0x9931
+0x7C5F = 0x9932
+0x7C60 = 0x9933
+0x7C61 = 0x993A
+0x7C62 = 0x993B
+0x7C63 = 0x993C
+0x7C64 = 0x9940
+0x7C65 = 0x9941
+0x7C66 = 0x9946
+0x7C67 = 0x994D
+0x7C68 = 0x994E
+0x7C69 = 0x995C
+0x7C6A = 0x995F
+0x7C6B = 0x9960
+0x7C6C = 0x99A3
+0x7C6D = 0x99A6
+0x7C6E = 0x99B9
+0x7C6F = 0x99BD
+0x7C70 = 0x99BF
+0x7C71 = 0x99C3
+0x7C72 = 0x99C9
+0x7C73 = 0x99D4
+0x7C74 = 0x99D9
+0x7C75 = 0x99DE
+0x7C77 = 0x99F0
+0x7C78 = 0x99F9
+0x7C79 = 0x99FC
+0x7C7A = 0x9A0A
+0x7C7B = 0x9A11
+0x7C7C = 0x9A16
+0x7C7D = 0x9A1A
+0x7C7E = 0x9A20
+0x7D21 = 0x9A31
+0x7D22 = 0x9A36
+0x7D23 = 0x9A44
+0x7D24 = 0x9A4C
+0x7D25 = 0x9A58
+0x7D26 = 0x4BC2
+0x7D27 = 0x9AAF
+0x7D28 = 0x4BCA
+0x7D29 = 0x9AB7
+0x7D2A = 0x4BD2
+0x7D2B = 0x9AB9
+0x7D2D = 0x9AC6
+0x7D2E = 0x9AD0
+0x7D2F = 0x9AD2
+0x7D30 = 0x9AD5
+0x7D31 = 0x4BE8
+0x7D32 = 0x9ADC
+0x7D33 = 0x9AE0
+0x7D34 = 0x9AE5
+0x7D35 = 0x9AE9
+0x7D36 = 0x9B03
+0x7D37 = 0x9B0C
+0x7D38 = 0x9B10
+0x7D39 = 0x9B12
+0x7D3A = 0x9B16
+0x7D3B = 0x9B1C # 0x9B1D
+0x7D3C = 0x9B2B
+0x7D3D = 0x9B33
+0x7D3E = 0x9B3D
+0x7D3F = 0x4C20
+0x7D40 = 0x9B4B
+0x7D41 = 0x9B63
+0x7D42 = 0x9B65
+0x7D43 = 0x9B6B
+0x7D44 = 0x9B6C
+0x7D45 = 0x9B73
+0x7D46 = 0x9B76
+0x7D47 = 0x9B77
+0x7D48 = 0x9BA6
+0x7D49 = 0x9BAC
+0x7D4A = 0x9BB1
+0x7D4D = 0x9BB2
+0x7D4E = 0x9BB8
+0x7D4F = 0x9BBE
+0x7D50 = 0x9BC7
+0x7D51 = 0x9BF3
+0x7D52 = 0x9BD8
+0x7D53 = 0x9BDD
+0x7D54 = 0x9BE7
+0x7D55 = 0x9BEA
+0x7D56 = 0x9BEB
+0x7D57 = 0x9BEF
+0x7D58 = 0x9BEE
+0x7D5A = 0x9BFA
+0x7D5C = 0x9BF7
+0x7D5E = 0x9C16
+0x7D5F = 0x9C18
+0x7D60 = 0x9C19
+0x7D61 = 0x9C1A
+0x7D62 = 0x9C1D
+0x7D63 = 0x9C22
+0x7D64 = 0x9C27
+0x7D65 = 0x9C29
+0x7D66 = 0x9C2A
+0x7D68 = 0x9C31
+0x7D69 = 0x9C36
+0x7D6A = 0x9C37
+0x7D6B = 0x9C45
+0x7D6C = 0x9C5C
+0x7D6E = 0x9C49
+0x7D6F = 0x9C4A
+0x7D71 = 0x9C54
+0x7D72 = 0x9C58
+0x7D73 = 0x9C5B
+0x7D74 = 0x9C5D
+0x7D75 = 0x9C5F
+0x7D76 = 0x9C69
+0x7D77 = 0x9C6A
+0x7D78 = 0x9C6B
+0x7D79 = 0x9C6D
+0x7D7A = 0x9C6E
+0x7D7B = 0x9C70
+0x7D7C = 0x9C72
+0x7D7D = 0x9C75
+0x7D7E = 0x9C7A
+0x7E21 = 0x9CE6
+0x7E22 = 0x9CF2
+0x7E23 = 0x9D0B
+0x7E24 = 0x9D02
+0x7E26 = 0x9D11
+0x7E27 = 0x9D17
+0x7E28 = 0x9D18
+0x7E2A = 0x4CC4
+0x7E2C = 0x9D32
+0x7E2D = 0x4CD1
+0x7E2E = 0x9D42
+0x7E2F = 0x9D4A
+0x7E30 = 0x9D5F
+0x7E31 = 0x9D62
+0x7E33 = 0x9D69
+0x7E34 = 0x9D6B
+0x7E36 = 0x9D73
+0x7E37 = 0x9D76
+0x7E38 = 0x9D77
+0x7E39 = 0x9D7E
+0x7E3A = 0x9D84
+0x7E3B = 0x9D8D
+0x7E3C = 0x9D99
+0x7E3D = 0x9DA1
+0x7E3E = 0x9DBF
+0x7E3F = 0x9DB5
+0x7E40 = 0x9DB9
+0x7E41 = 0x9DBD
+0x7E42 = 0x9DC3
+0x7E43 = 0x9DC7
+0x7E44 = 0x9DC9
+0x7E45 = 0x9DD6
+0x7E46 = 0x9DDA
+0x7E47 = 0x9DDF
+0x7E48 = 0x9DE0
+0x7E49 = 0x9DE3
+0x7E4A = 0x9DF4
+0x7E4B = 0x4D07
+0x7E4C = 0x9E0A
+0x7E4D = 0x9E02
+0x7E4E = 0x9E0D
+0x7E4F = 0x9E19
+0x7E50 = 0x9E1C
+0x7E51 = 0x9E1D
+0x7E52 = 0x9E7B
+0x7E54 = 0x9E80
+0x7E55 = 0x9E85
+0x7E56 = 0x9E9B
+0x7E57 = 0x9EA8
+0x7E59 = 0x9EBD
+0x7E5B = 0x9EDF
+0x7E5C = 0x9EE7
+0x7E5D = 0x9EEE
+0x7E5E = 0x9EFF
+0x7E5F = 0x9F02
+0x7E60 = 0x4D77
+0x7E61 = 0x9F03
+0x7E62 = 0x9F17
+0x7E63 = 0x9F19
+0x7E64 = 0x9F2F
+0x7E65 = 0x9F37
+0x7E66 = 0x9F3A
+0x7E67 = 0x9F3D
+0x7E68 = 0x9F41
+0x7E69 = 0x9F45
+0x7E6A = 0x9F46
+0x7E6B = 0x9F53
+0x7E6C = 0x9F55
+0x7E6D = 0x9F58
+0x7E6F = 0x9F5D
+0x7E71 = 0x9F69
+0x7E73 = 0x9F6D
+0x7E74 = 0x9F70
+0x7E75 = 0x9F75
+END_MAP
diff --git a/enc/trans/JIS/JISX0213-2%UCS@SIP.src b/enc/trans/JIS/JISX0213-2%UCS@SIP.src
new file mode 100644
index 0000000000..15f8d317e6
--- /dev/null
+++ b/enc/trans/JIS/JISX0213-2%UCS@SIP.src
@@ -0,0 +1,311 @@
+# $NetBSD: JISX0213-2%UCS@SIP.src,v 1.1 2007/03/05 16:58:33 tnozaki Exp $
+
+TYPE ROWCOL
+NAME "JISX0213-2/UCS:SIP"
+SRC_ZONE 0x21-0x7E / 0x21-0x7E / 8
+OOB_MODE INVALID
+DST_INVALID 0xFFFE
+DST_UNIT_BITS 16
+
+BEGIN_MAP
+## JIS X 0213:2004 vs Unicode mapping table
+##
+## Date: 22 May 2006
+## License:
+## Copyright (C) 2001 earthian@tama.or.jp, All Rights Reserved.
+## Copyright (C) 2001 I'O, All Rights Reserved.
+## Copyright (C) 2006 Project X0213, All Rights Reserved.
+## You can use, modify, distribute this table freely.
+## Note:
+## 3-XXXX JIS X 0213:2004 plane 1 (GL encoding)
+## 4-XXXX JIS X 0213:2000 plane 2 (GL encoding)
+## [1983] JIS codepoint defined by JIS X 0208-1983
+## [1990] JIS codepoint defined by JIS X 0208-1990
+## [2000] JIS codepoint defined by JIS X 0213:2000
+## [2004] JIS codepoint defined by JIS X 0213:2004
+## [Unicode3.1] UCS codepoint defined by Unicode 3.1
+## [Unicode3.2] UCS codepoint defined by Unicode 3.2
+## Fullwidth UCS fullwidth form (U+Fxxx)
+## Windows Windows (CP932) mapping
+## Some 0213 character can't represent by one UCS character.
+## In this table, such characters are described as 'U+xxxx+xxxx'.
+##
+## JIS Unicode Name Note
+0x2121 = 0x0089
+0x212B = 0x00A2
+0x212E = 0x00A4
+0x2136 = 0x01A2
+0x2146 = 0x0213
+0x2170 = 0x032B
+0x2177 = 0x0381
+0x2179 = 0x0371
+0x2322 = 0x03F9
+0x2325 = 0x044A
+0x2327 = 0x0509
+0x2331 = 0x05D6
+0x2332 = 0x0628
+0x2338 = 0x074F
+0x233F = 0x0807
+0x2341 = 0x083A
+0x234A = 0x08B9
+0x2352 = 0x097C
+0x2353 = 0x099D
+0x2359 = 0x0AD3
+0x235C = 0x0B1D
+0x2377 = 0x0D45
+0x242A = 0x0DE1
+0x2431 = 0x0E95
+0x2432 = 0x0E6D
+0x243A = 0x0E64
+0x243D = 0x0F5F
+0x2459 = 0x1201
+0x245C = 0x1255
+0x245E = 0x127B
+0x2463 = 0x1274
+0x246A = 0x12E4
+0x246B = 0x12D7
+0x2472 = 0x12FD
+0x2474 = 0x1336
+0x2475 = 0x1344
+0x2525 = 0x13C4
+0x2532 = 0x146D
+0x253E = 0x15D7
+0x2544 = 0x6C29
+0x2547 = 0x1647
+0x2555 = 0x1706
+0x2556 = 0x1742
+0x257E = 0x19C3
+0x2830 = 0x1C56
+0x2837 = 0x1D2D
+0x2838 = 0x1D45
+0x283A = 0x1D78
+0x283B = 0x1D62
+0x283F = 0x1DA1
+0x2840 = 0x1D9C
+0x2845 = 0x1D92
+0x2848 = 0x1DB7
+0x284A = 0x1DE0
+0x284B = 0x1E33
+0x285B = 0x1F1E
+0x2866 = 0x1F76
+0x286C = 0x1FFA
+0x2C22 = 0x217B
+0x2C2B = 0x231E
+0x2C30 = 0x23AD
+0x2C50 = 0x26F3
+0x2C65 = 0x285B
+0x2C6D = 0x28AB
+0x2C72 = 0x298F
+0x2D24 = 0x2AB8
+0x2D29 = 0x2B4F
+0x2D2A = 0x2B50
+0x2D32 = 0x2B46
+0x2D34 = 0x2C1D
+0x2D35 = 0x2BA6
+0x2D39 = 0x2C24
+0x2D56 = 0x2DE1
+0x2D7D = 0x31C3
+0x2E23 = 0x31F5
+0x2E24 = 0x31B6
+0x2E3A = 0x3372
+0x2E3C = 0x33D3
+0x2E3D = 0x33D2
+0x2E42 = 0x33D0
+0x2E43 = 0x33E4
+0x2E44 = 0x33D5
+0x2E47 = 0x33DA
+0x2E49 = 0x33DF
+0x2E55 = 0x344A
+0x2E56 = 0x3451
+0x2E57 = 0x344B
+0x2E5B = 0x3465
+0x2E77 = 0x34E4
+0x2E78 = 0x355A
+0x2F2A = 0x3594
+0x2F3F = 0x3639
+0x2F40 = 0x3647
+0x2F42 = 0x3638
+0x2F43 = 0x363A
+0x2F4E = 0x371C
+0x2F59 = 0x370C
+0x2F61 = 0x3764
+0x2F69 = 0x37FF
+0x2F6A = 0x37E7
+0x2F70 = 0x3824
+0x2F75 = 0x383D
+0x6E23 = 0x3A98
+0x6E34 = 0x3C7F
+0x6E49 = 0x3D00
+0x6E5C = 0x3D40
+0x6E5E = 0x3DFA
+0x6E5F = 0x3DF9
+0x6E60 = 0x3DD3
+0x6F32 = 0x3F7E
+0x6F47 = 0x4096
+0x6F4D = 0x4103
+0x6F61 = 0x41C6
+0x6F64 = 0x41FE
+0x7022 = 0x43BC
+0x7033 = 0x4629
+0x7039 = 0x46A5
+0x7053 = 0x4896
+0x707B = 0x4A4D
+0x712E = 0x4B56
+0x7130 = 0x4B6F
+0x7135 = 0x4C16
+0x7144 = 0x4D14
+0x715D = 0x4E0E
+0x7161 = 0x4E37
+0x7166 = 0x4E6A
+0x7169 = 0x4E8B
+0x7175 = 0x504A
+0x7177 = 0x5055
+0x717A = 0x5122
+0x7221 = 0x51A9
+0x7223 = 0x51E5
+0x7224 = 0x51CD
+0x7228 = 0x521E
+0x722C = 0x524C
+0x723D = 0x542E
+0x7248 = 0x54D9
+0x725B = 0x55A7
+0x7275 = 0x57A9
+0x7276 = 0x57B4
+0x7332 = 0x59D4
+0x733D = 0x5AE4
+0x733E = 0x5AE3
+0x7340 = 0x5AF1
+0x7352 = 0x5BB2
+0x735D = 0x5C4B
+0x735E = 0x5C64
+0x7373 = 0x5E2E
+0x7374 = 0x5E56
+0x7375 = 0x5E65
+0x7377 = 0x5E62
+0x737B = 0x5ED8
+0x737D = 0x5EC2
+0x7422 = 0x5EE8
+0x7424 = 0x5F23
+0x7427 = 0x5F5C
+0x742E = 0x5FE0
+0x742F = 0x5FD4
+0x7434 = 0x600C
+0x7435 = 0x5FFB
+0x743D = 0x6017
+0x7442 = 0x6060
+0x744F = 0x60ED
+0x7469 = 0x6270
+0x746B = 0x6286
+0x7472 = 0x634C
+0x7475 = 0x3D0E
+0x7479 = 0x6402
+0x7535 = 0x667E
+0x753A = 0x66B0
+0x7546 = 0x671D
+0x7556 = 0x68DD
+0x7558 = 0x68EA
+0x755A = 0x6951
+0x755D = 0x696F
+0x755F = 0x69DD
+0x7563 = 0x6A1E
+0x756A = 0x6A58
+0x7570 = 0x6A8C
+0x7573 = 0x6AB7
+0x7644 = 0x6C73
+0x764E = 0x6CDD
+0x765D = 0x6E65
+0x7675 = 0x6F94
+0x767E = 0x6FF8
+0x7721 = 0x6FF6
+0x7722 = 0x6FF7
+0x7733 = 0x710D
+0x7736 = 0x7139
+0x7764 = 0x73DB
+0x7765 = 0x73DA
+0x776B = 0x73FE
+0x776E = 0x7410
+0x7773 = 0x7449
+0x7829 = 0x7615
+0x782A = 0x7614
+0x782C = 0x7631
+0x7834 = 0x7693
+0x783C = 0x770E
+0x783E = 0x7723
+0x7842 = 0x7752
+0x7856 = 0x7985
+0x7863 = 0x7A84
+0x7877 = 0x7BB3
+0x7879 = 0x7BBE
+0x787A = 0x7BC7
+0x7925 = 0x7CB8
+0x792F = 0x7DA0
+0x7932 = 0x7E10
+0x7939 = 0x7FB7
+0x7942 = 0x808A
+0x7948 = 0x80BB
+0x7959 = 0x8282
+0x795E = 0x82F3
+0x7966 = 0x840C
+0x796B = 0x8455
+0x797A = 0x856B
+0x797E = 0x85C8
+0x7A21 = 0x85C9
+0x7A2C = 0x86D7
+0x7A2F = 0x86FA
+0x7A4F = 0x8949
+0x7A50 = 0x8946
+0x7A57 = 0x896B
+0x7A65 = 0x8987
+0x7A66 = 0x8988
+0x7A71 = 0x89BA
+0x7A72 = 0x89BB
+0x7A7E = 0x8A1E
+0x7B21 = 0x8A29
+0x7B2C = 0x8A71
+0x7B2D = 0x8A43
+0x7B36 = 0x8A99
+0x7B37 = 0x8ACD
+0x7B3D = 0x8AE4
+0x7B3E = 0x8ADD
+0x7B4E = 0x8BC1
+0x7B4F = 0x8BEF
+0x7B57 = 0x8D10
+0x7B5A = 0x8D71
+0x7B5C = 0x8DFB
+0x7B5D = 0x8E1F
+0x7B61 = 0x8E36
+0x7B65 = 0x8E89
+0x7B67 = 0x8EEB
+0x7B69 = 0x8F32
+0x7B71 = 0x8FF8
+0x7C22 = 0x92A0
+0x7C23 = 0x92B1
+0x7C38 = 0x9490
+0x7C42 = 0x95CF
+0x7C4C = 0x967F
+0x7C56 = 0x96F0
+0x7C59 = 0x9719
+0x7C5D = 0x9750
+0x7C76 = 0x98C6
+0x7D2C = 0x9A72
+0x7D4B = 0x9DDB
+0x7D4C = 0x9E3D
+0x7D59 = 0x9E15
+0x7D5B = 0x9E8A
+0x7D5D = 0x9E49
+0x7D67 = 0x9EC4
+0x7D6D = 0x9EE9
+0x7D70 = 0x9EDB
+0x7E25 = 0x9FCE
+0x7E29 = 0xA02F
+0x7E2B = 0xA01A
+0x7E32 = 0xA0F9
+0x7E35 = 0xA082
+0x7E53 = 0x2218
+0x7E58 = 0xA38C
+0x7E5A = 0xA437
+0x7E6E = 0xA5F1
+0x7E70 = 0xA602
+0x7E72 = 0xA61A
+0x7E76 = 0xA6B2
+END_MAP
diff --git a/enc/trans/JIS/UCS@BMP%JISX0213-1.src b/enc/trans/JIS/UCS@BMP%JISX0213-1.src
new file mode 100644
index 0000000000..953e361738
--- /dev/null
+++ b/enc/trans/JIS/UCS@BMP%JISX0213-1.src
@@ -0,0 +1,1922 @@
+# $NetBSD: UCS@BMP%JISX0213-1.src,v 1.1 2007/03/05 16:58:33 tnozaki Exp $
+
+TYPE ROWCOL
+NAME "UCS:BMP/JISX0213-1"
+SRC_ZONE 0x007E - 0xFF60
+OOB_MODE INVALID
+DST_INVALID 0xFFFF
+DST_UNIT_BITS 16
+
+BEGIN_MAP
+## Shift_JIS-2004 (JIS X 0213:2004) vs Unicode mapping table
+##
+## Date: 12 Feb 2005 10:15:00 GMT
+## License:
+## Copyright (C) 2001 earthian@tama.or.jp, All Rights Reserved.
+## Copyright (C) 2001 I'O, All Rights Reserved.
+## You can use, modify, distribute this table freely.
+## Note:
+## [1983] JIS codepoint defined by JIS X 0208-1983
+## [1990] JIS codepoint defined by JIS X 0208-1990
+## [2000] JIS codepoint defined by JIS X 0213:2000
+## [2004] JIS codepoint defined by JIS X 0213:2004
+## [Unicode3.1] UCS codepoint defined by Unicode 3.1
+## [Unicode3.2] UCS codepoint defined by Unicode 3.2
+## Fullwidth UCS fullwidth form (U+Fxxx)
+## Windows Windows (CP932) mapping
+## Some 0213 character can't represent by one UCS character.
+## In this table, such characters are described as 'U+xxxx+xxxx'.
+##
+0x00A0 = 0x2922
+0x00A1 = 0x2923
+0x00A4 = 0x2924
+0x00A6 = 0x2925
+0x00A9 = 0x2926
+0x00AA = 0x2927
+0x00AB = 0x2928
+0x00AD = 0x2929
+0x00AE = 0x292A
+0x00AF = 0x292B
+0x00B2 = 0x292C
+0x00B3 = 0x292D
+0x00B7 = 0x292E
+0x00B8 = 0x292F
+0x00B9 = 0x2930
+0x00BA = 0x2931
+0x00BB = 0x2932
+0x00BC = 0x2933
+0x00BD = 0x2934
+0x00BE = 0x2935
+0x00BF = 0x2936
+0x00C0 = 0x2937
+0x00C1 = 0x2938
+0x00C2 = 0x2939
+0x00C3 = 0x293A
+0x00C4 = 0x293B
+0x00C5 = 0x293C
+0x00C6 = 0x293D
+0x00C7 = 0x293E
+0x00C8 = 0x293F
+0x00C9 = 0x2940
+0x00CA = 0x2941
+0x00CB = 0x2942
+0x00CC = 0x2943
+0x00CD = 0x2944
+0x00CE = 0x2945
+0x00CF = 0x2946
+0x00D0 = 0x2947
+0x00D1 = 0x2948
+0x00D2 = 0x2949
+0x00D3 = 0x294A
+0x00D4 = 0x294B
+0x00D5 = 0x294C
+0x00D6 = 0x294D
+0x00D8 = 0x294E
+0x00D9 = 0x294F
+0x00DA = 0x2950
+0x00DB = 0x2951
+0x00DC = 0x2952
+0x00DD = 0x2953
+0x00DE = 0x2954
+0x00DF = 0x2955
+0x00E0 = 0x2956
+0x00E1 = 0x2957
+0x00E2 = 0x2958
+0x00E3 = 0x2959
+0x00E4 = 0x295A
+0x00E5 = 0x295B
+#0x00E6 + 0x0300 = 0x2B44
+0x00E6 = 0x295C
+0x00E7 = 0x295D
+0x00E8 = 0x295E
+0x00E9 = 0x295F
+0x00EA = 0x2960
+0x00EB = 0x2961
+0x00EC = 0x2962
+0x00ED = 0x2963
+0x00EE = 0x2964
+0x00EF = 0x2965
+0x00F0 = 0x2966
+0x00F1 = 0x2967
+0x00F2 = 0x2968
+0x00F3 = 0x2969
+0x00F4 = 0x296A
+0x00F5 = 0x296B
+0x00F6 = 0x296C
+0x00F8 = 0x296D
+0x00F9 = 0x296E
+0x00FA = 0x296F
+0x00FB = 0x2970
+0x00FC = 0x2971
+0x00FD = 0x2972
+0x00FE = 0x2973
+0x00FF = 0x2974
+0x0100 = 0x2975
+0x0101 = 0x297A
+0x0102 = 0x2A3A
+0x0103 = 0x2A49
+0x0104 = 0x2A21
+0x0105 = 0x2A2C
+0x0106 = 0x2A3C
+0x0107 = 0x2A4B
+0x0108 = 0x2A59
+0x0109 = 0x2A5F
+0x010C = 0x2A3D
+0x010D = 0x2A4C
+0x010E = 0x2A40
+0x010F = 0x2A4F
+0x0111 = 0x2A50
+0x0112 = 0x2978
+0x0113 = 0x297D
+0x0118 = 0x2A3E
+0x0119 = 0x2A4D
+0x011A = 0x2A3F
+0x011B = 0x2A4E
+0x011C = 0x2A5A
+0x011D = 0x2A60
+0x0124 = 0x2A5B
+0x0125 = 0x2A61
+0x0127 = 0x2A7D
+0x012A = 0x2976
+0x012B = 0x297B
+0x0134 = 0x2A5C
+0x0135 = 0x2A62
+0x0139 = 0x2A3B
+0x013A = 0x2A4A
+0x013D = 0x2A24
+0x013E = 0x2A2F
+0x0141 = 0x2A23
+0x0142 = 0x2A2E
+0x0143 = 0x2A41
+0x0144 = 0x2A51
+0x0147 = 0x2A42
+0x0148 = 0x2A52
+0x014B = 0x2A7A
+0x014C = 0x2979
+0x014D = 0x297E
+0x0150 = 0x2A43
+0x0151 = 0x2A53
+0x0152 = 0x2B2B
+0x0153 = 0x2B2A
+0x0154 = 0x2A39
+0x0155 = 0x2A48
+0x0158 = 0x2A44
+0x0159 = 0x2A54
+0x015A = 0x2A25
+0x015B = 0x2A30
+0x015C = 0x2A5D
+0x015D = 0x2A63
+0x015E = 0x2A27
+0x015F = 0x2A33
+0x0160 = 0x2A26
+0x0161 = 0x2A32
+0x0162 = 0x2A47
+0x0163 = 0x2A57
+0x0164 = 0x2A28
+0x0165 = 0x2A34
+0x016A = 0x2977
+0x016B = 0x297C
+0x016C = 0x2A5E
+0x016D = 0x2A64
+0x016E = 0x2A45
+0x016F = 0x2A55
+0x0170 = 0x2A46
+0x0171 = 0x2A56
+0x0179 = 0x2A29
+0x017A = 0x2A35
+0x017B = 0x2A2B
+0x017C = 0x2A38
+0x017D = 0x2A2A
+0x017E = 0x2A37
+0x0193 = 0x2B29
+0x01C2 = 0x2B24
+0x01CD = 0x286F
+0x01CE = 0x2870
+0x01D0 = 0x2871
+0x01D1 = 0x2876
+0x01D2 = 0x2877
+0x01D4 = 0x2878
+0x01D6 = 0x2879
+0x01D8 = 0x287A
+0x01DA = 0x287B
+0x01DC = 0x287C
+0x01F8 = 0x2874
+0x01F9 = 0x2875
+0x01FD = 0x2B45
+0x0250 = 0x2B33
+0x0251 = 0x2B39
+0x0252 = 0x2B3A
+0x0253 = 0x2B25
+#0x0254 + 0x0300 = 0x2B48
+#0x0254 + 0x0301 = 0x2B49
+0x0254 = 0x2B38
+0x0255 = 0x2B3F
+0x0256 = 0x2A6E
+0x0257 = 0x2B26
+0x0258 = 0x2B2E
+#0x0259 + 0x0300 = 0x2B4C
+#0x0259 + 0x0301 = 0x2B4D
+0x0259 = 0x2B30
+#0x025A + 0x0300 = 0x2B4E
+#0x025A + 0x0301 = 0x2B4F
+0x025A = 0x2B43
+0x025C = 0x2B31
+0x025E = 0x2B32
+0x025F = 0x2A75
+0x0260 = 0x2B28
+0x0261 = 0x2A79
+0x0264 = 0x2B36
+0x0265 = 0x2B3C
+0x0266 = 0x2B22
+0x0267 = 0x2B42
+0x0268 = 0x2B2C
+0x026C = 0x2A6A
+0x026D = 0x2A74
+0x026E = 0x2A6B
+0x026F = 0x2B34
+0x0270 = 0x2A7B
+0x0271 = 0x2A65
+0x0272 = 0x2A76
+0x0273 = 0x2A6F
+0x0275 = 0x2B2F
+0x0279 = 0x2A6C
+0x027A = 0x2B41
+0x027B = 0x2A73
+0x027D = 0x2A70
+0x027E = 0x2A67
+0x0281 = 0x2A7C
+0x0282 = 0x2A71
+0x0283 = 0x2A68
+0x0284 = 0x2B27
+0x0288 = 0x2A6D
+0x0289 = 0x2B2D
+0x028A = 0x2B35
+0x028B = 0x2A66
+#0x028C + 0x0300 = 0x2B4A
+#0x028C + 0x0301 = 0x2B4B
+0x028C = 0x2B37
+0x028D = 0x2B3B
+0x028E = 0x2A78
+0x0290 = 0x2A72
+0x0291 = 0x2B40
+0x0292 = 0x2A69
+0x0294 = 0x2B21
+0x0295 = 0x2A7E
+0x0298 = 0x2B23
+0x029D = 0x2A77
+0x02A1 = 0x2B3E
+0x02A2 = 0x2B3D
+0x02C7 = 0x2A31
+0x02C8 = 0x2B53
+0x02CC = 0x2B54
+0x02D0 = 0x2B55
+0x02D1 = 0x2B56
+0x02D8 = 0x2A22
+0x02D9 = 0x2A58
+0x02DB = 0x2A2D
+0x02DD = 0x2A36
+0x02DE = 0x2B71
+#0x02E5 + 0x02E9 = 0x2B66
+0x02E5 = 0x2B60
+0x02E6 = 0x2B61
+0x02E7 = 0x2B62
+0x02E8 = 0x2B63
+#0x02E9 + 0x02E5 = 0x2B65
+0x02E9 = 0x2B64
+0x0300 = 0x2B5C
+0x0301 = 0x2B5A
+0x0302 = 0x2B5F
+0x0303 = 0x2B7D
+0x0304 = 0x2B5B
+0x0306 = 0x2B57
+0x0308 = 0x2B6D
+0x030B = 0x2B59
+0x030C = 0x2B5E
+0x030F = 0x2B5D
+0x0318 = 0x2B78
+0x0319 = 0x2B79
+0x031A = 0x2B7E
+0x031C = 0x2B6A
+0x031D = 0x2B76
+0x031E = 0x2B77
+0x031F = 0x2B6B
+0x0320 = 0x2B6C
+0x0324 = 0x2B72
+0x0325 = 0x2B67
+0x0329 = 0x2B6F
+0x032A = 0x2B7A
+0x032C = 0x2B68
+0x032F = 0x2B70
+0x0330 = 0x2B73
+0x0334 = 0x2B75
+0x0339 = 0x2B69
+0x033A = 0x2B7B
+0x033B = 0x2B7C
+0x033C = 0x2B74
+0x033D = 0x2B6E
+0x0361 = 0x2B52
+0x03C2 = 0x2659
+0x1E3E = 0x2872
+0x1E3F = 0x2873
+0x1F70 = 0x2B46
+0x1F71 = 0x2B47
+0x1F72 = 0x2B50
+0x1F73 = 0x2B51
+0x2013 = 0x237C
+0x2022 = 0x2340
+0x203C = 0x286B
+0x203F = 0x2B58
+0x2042 = 0x2C7E
+0x2047 = 0x286C
+0x2048 = 0x286D
+0x2049 = 0x286E
+0x2051 = 0x2C7D
+0x20AC = 0x2921
+0x210F = 0x235D
+0x2113 = 0x235F
+0x2116 = 0x2D62
+0x2121 = 0x2D64
+0x2127 = 0x2360
+0x2135 = 0x235C
+0x2153 = 0x2778
+0x2154 = 0x2779
+0x2155 = 0x277A
+0x2160 = 0x2D35
+0x2161 = 0x2D36
+0x2162 = 0x2D37
+0x2163 = 0x2D38
+0x2164 = 0x2D39
+0x2165 = 0x2D3A
+0x2166 = 0x2D3B
+0x2167 = 0x2D3C
+0x2168 = 0x2D3D
+0x2169 = 0x2D3E
+0x216A = 0x2D3F
+0x216B = 0x2D57
+0x2170 = 0x2C35
+0x2171 = 0x2C36
+0x2172 = 0x2C37
+0x2173 = 0x2C38
+0x2174 = 0x2C39
+0x2175 = 0x2C3A
+0x2176 = 0x2C3B
+0x2177 = 0x2C3C
+0x2178 = 0x2C3D
+0x2179 = 0x2C3E
+0x217A = 0x2C3F
+0x217B = 0x2C40
+0x2194 = 0x2271
+0x2196 = 0x2327
+0x2197 = 0x2325
+0x2198 = 0x2326
+0x2199 = 0x2328
+0x21C4 = 0x2329
+0x21E6 = 0x232B
+0x21E7 = 0x232C
+0x21E8 = 0x232A
+0x21E9 = 0x232D
+0x2205 = 0x2247
+0x2209 = 0x2246
+0x2213 = 0x235B
+0x221F = 0x2D78
+0x2225 = 0x2254
+0x2226 = 0x2255
+0x222E = 0x2D73
+0x2243 = 0x226C
+0x2245 = 0x226D
+0x2248 = 0x226E
+0x2262 = 0x226B
+0x2276 = 0x226F
+0x2277 = 0x2270
+0x2284 = 0x2242
+0x2285 = 0x2243
+0x228A = 0x2244
+0x228B = 0x2245
+0x2295 = 0x2251
+0x2296 = 0x2252
+0x2297 = 0x2253
+0x22BF = 0x2D79
+0x22DA = 0x2776
+0x22DB = 0x2777
+0x2305 = 0x2248
+0x2306 = 0x2249
+0x2318 = 0x277C
+0x23BE = 0x2742
+0x23BF = 0x2743
+0x23C0 = 0x2744
+0x23C1 = 0x2745
+0x23C2 = 0x2746
+0x23C3 = 0x2747
+0x23C4 = 0x2748
+0x23C5 = 0x2749
+0x23C6 = 0x274A
+0x23C7 = 0x274B
+0x23C8 = 0x274C
+0x23C9 = 0x274D
+0x23CA = 0x274E
+0x23CB = 0x274F
+0x23CC = 0x2750
+0x23CE = 0x277E
+0x2423 = 0x277D
+0x2460 = 0x2D21
+0x2461 = 0x2D22
+0x2462 = 0x2D23
+0x2463 = 0x2D24
+0x2464 = 0x2D25
+0x2465 = 0x2D26
+0x2466 = 0x2D27
+0x2467 = 0x2D28
+0x2468 = 0x2D29
+0x2469 = 0x2D2A
+0x246A = 0x2D2B
+0x246B = 0x2D2C
+0x246C = 0x2D2D
+0x246D = 0x2D2E
+0x246E = 0x2D2F
+0x246F = 0x2D30
+0x2470 = 0x2D31
+0x2471 = 0x2D32
+0x2472 = 0x2D33
+0x2473 = 0x2D34
+0x24D0 = 0x2C41
+0x24D1 = 0x2C42
+0x24D2 = 0x2C43
+0x24D3 = 0x2C44
+0x24D4 = 0x2C45
+0x24D5 = 0x2C46
+0x24D6 = 0x2C47
+0x24D7 = 0x2C48
+0x24D8 = 0x2C49
+0x24D9 = 0x2C4A
+0x24DA = 0x2C4B
+0x24DB = 0x2C4C
+0x24DC = 0x2C4D
+0x24DD = 0x2C4E
+0x24DE = 0x2C4F
+0x24DF = 0x2C50
+0x24E0 = 0x2C51
+0x24E1 = 0x2C52
+0x24E2 = 0x2C53
+0x24E3 = 0x2C54
+0x24E4 = 0x2C55
+0x24E5 = 0x2C56
+0x24E6 = 0x2C57
+0x24E7 = 0x2C58
+0x24E8 = 0x2C59
+0x24E9 = 0x2C5A
+0x24EB = 0x2C2B
+0x24EC = 0x2C2C
+0x24ED = 0x2C2D
+0x24EE = 0x2C2E
+0x24EF = 0x2C2F
+0x24F0 = 0x2C30
+0x24F1 = 0x2C31
+0x24F2 = 0x2C32
+0x24F3 = 0x2C33
+0x24F4 = 0x2C34
+0x24F5 = 0x265A
+0x24F6 = 0x265B
+0x24F7 = 0x265C
+0x24F8 = 0x265D
+0x24F9 = 0x265E
+0x24FA = 0x265F
+0x24FB = 0x2660
+0x24FC = 0x2661
+0x24FD = 0x2662
+0x24FE = 0x2663
+0x25B1 = 0x266D
+0x25B6 = 0x2322
+0x25B7 = 0x2321
+0x25C0 = 0x2324
+0x25C1 = 0x2323
+0x25C9 = 0x233B
+0x25D0 = 0x2867
+0x25D1 = 0x2868
+0x25D2 = 0x2869
+0x25D3 = 0x286A
+0x25E6 = 0x233F
+0x2600 = 0x2668
+0x2601 = 0x2669
+0x2602 = 0x266A
+0x2603 = 0x266B
+0x260E = 0x2667
+0x2616 = 0x2664
+0x2617 = 0x2665
+0x261E = 0x2D7E
+0x2660 = 0x263A
+0x2661 = 0x263D
+0x2662 = 0x263B
+0x2663 = 0x2640
+0x2664 = 0x2639
+0x2665 = 0x263E
+0x2666 = 0x263C
+0x2667 = 0x263F
+0x2668 = 0x266C
+0x2669 = 0x227D
+0x266B = 0x227B
+0x266C = 0x227C
+0x266E = 0x227A
+0x2713 = 0x277B
+0x2756 = 0x2D7D
+0x2776 = 0x2C21
+0x2777 = 0x2C22
+0x2778 = 0x2C23
+0x2779 = 0x2C24
+0x277A = 0x2C25
+0x277B = 0x2C26
+0x277C = 0x2C27
+0x277D = 0x2C28
+0x277E = 0x2C29
+0x277F = 0x2C2A
+0x2934 = 0x232E
+0x2935 = 0x232F
+0x29BF = 0x233A
+0x29FA = 0x237D
+0x29FB = 0x237E
+0x3016 = 0x225A
+0x3017 = 0x225B
+0x3018 = 0x2258
+0x3019 = 0x2259
+0x301D = 0x2D60
+0x301F = 0x2D61
+0x3020 = 0x2666
+0x3033 = 0x2233
+0x3034 = 0x2234
+0x3035 = 0x2235
+0x303B = 0x2236
+0x303C = 0x2237
+0x303D = 0x233C
+#0x304B + 0x309A = 0x2477
+#0x304D + 0x309A = 0x2478
+#0x304F + 0x309A = 0x2479
+#0x3051 + 0x309A = 0x247A
+#0x3053 + 0x309A = 0x247B
+0x3094 = 0x2474
+0x3095 = 0x2475
+0x3096 = 0x2476
+0x309F = 0x2239
+0x30A0 = 0x237B
+#0x30AB + 0x309A = 0x2577
+#0x30AD + 0x309A = 0x2578
+#0x30AF + 0x309A = 0x2579
+#0x30B1 + 0x309A = 0x257A
+#0x30B3 + 0x309A = 0x257B
+#0x30BB + 0x309A = 0x257C
+#0x30C4 + 0x309A = 0x257D
+#0x30C8 + 0x309A = 0x257E
+0x30F7 = 0x2772
+0x30F8 = 0x2773
+0x30F9 = 0x2774
+0x30FA = 0x2775
+0x30FF = 0x2238
+0x31F0 = 0x266E
+0x31F1 = 0x266F
+0x31F2 = 0x2670
+0x31F3 = 0x2671
+0x31F4 = 0x2672
+0x31F5 = 0x2673
+0x31F6 = 0x2674
+#0x31F7 + 0x309A = 0x2678
+0x31F7 = 0x2675
+0x31F8 = 0x2676
+0x31F9 = 0x2677
+0x31FA = 0x2679
+0x31FB = 0x267A
+0x31FC = 0x267B
+0x31FD = 0x267C
+0x31FE = 0x267D
+0x31FF = 0x267E
+0x3231 = 0x2D6A
+0x3232 = 0x2D6B
+0x3239 = 0x2D6C
+0x3251 = 0x2841
+0x3252 = 0x2842
+0x3253 = 0x2843
+0x3254 = 0x2844
+0x3255 = 0x2845
+0x3256 = 0x2846
+0x3257 = 0x2847
+0x3258 = 0x2848
+0x3259 = 0x2849
+0x325A = 0x284A
+0x325B = 0x284B
+0x325C = 0x284C
+0x325D = 0x284D
+0x325E = 0x284E
+0x325F = 0x284F
+0x32A4 = 0x2D65
+0x32A5 = 0x2D66
+0x32A6 = 0x2D67
+0x32A7 = 0x2D68
+0x32A8 = 0x2D69
+0x32B1 = 0x2850
+0x32B2 = 0x2851
+0x32B3 = 0x2852
+0x32B4 = 0x2853
+0x32B5 = 0x2854
+0x32B6 = 0x2855
+0x32B7 = 0x2856
+0x32B8 = 0x2857
+0x32B9 = 0x2858
+0x32BA = 0x2859
+0x32BB = 0x285A
+0x32BC = 0x285B
+0x32BD = 0x285C
+0x32BE = 0x285D
+0x32BF = 0x285E
+0x32D0 = 0x2C5B
+0x32D1 = 0x2C5C
+0x32D2 = 0x2C5D
+0x32D3 = 0x2C5E
+0x32D4 = 0x2C5F
+0x32D5 = 0x2C60
+0x32D6 = 0x2C61
+0x32D7 = 0x2C62
+0x32D8 = 0x2C63
+0x32D9 = 0x2C64
+0x32DA = 0x2C65
+0x32DB = 0x2C66
+0x32DC = 0x2C67
+0x32DD = 0x2C68
+0x32DE = 0x2C69
+0x32DF = 0x2C6A
+0x32E0 = 0x2C6B
+0x32E1 = 0x2C6C
+0x32E2 = 0x2C6D
+0x32E3 = 0x2C6E
+0x32E5 = 0x2C71
+0x32E9 = 0x2C70
+0x32EC = 0x2C73
+0x32ED = 0x2C72
+0x32FA = 0x2C6F
+0x3303 = 0x2D46
+0x330D = 0x2D4A
+0x3314 = 0x2D41
+0x3318 = 0x2D44
+0x3322 = 0x2D42
+0x3323 = 0x2D4C
+0x3326 = 0x2D4B
+0x3327 = 0x2D45
+0x332B = 0x2D4D
+0x3336 = 0x2D47
+0x333B = 0x2D4F
+0x3349 = 0x2D40
+0x334A = 0x2D4E
+0x334D = 0x2D43
+0x3351 = 0x2D48
+0x3357 = 0x2D49
+0x337B = 0x2D5F
+0x337C = 0x2D6F
+0x337D = 0x2D6E
+0x337E = 0x2D6D
+0x338E = 0x2D53
+0x338F = 0x2D54
+0x339C = 0x2D50
+0x339D = 0x2D51
+0x339E = 0x2D52
+0x33A1 = 0x2D56
+0x33C4 = 0x2D55
+0x33CB = 0x235E
+0x33CD = 0x2D63
+0x3402 = 0x2E23
+0x34B5 = 0x2E53
+0x34DB = 0x2E5B
+0x378D = 0x4F5F
+0x37E2 = 0x4F6F
+0x3B22 = 0x7549
+0x3BB6 = 0x757E
+0x3BC3 = 0x7621
+0x3C0F = 0x763A
+0x3E3F = 0x7766
+0x3F72 = 0x784D
+0x4264 = 0x796D
+0x4453 = 0x7A59
+0x445B = 0x7A5A
+0x459D = 0x7B51
+0x45EA = 0x7B60
+0x4844 = 0x7C4B
+0x49B0 = 0x7D58
+0x4C17 = 0x7E3E
+0x4E28 = 0x2E24
+0x4E2F = 0x2E25
+0x4E30 = 0x2E26
+0x4E8D = 0x2E27
+0x4EE1 = 0x2E28
+0x4EFD = 0x2E29
+0x4EFF = 0x2E2A
+0x4F03 = 0x2E2B
+0x4F0B = 0x2E2C
+0x4F48 = 0x2E2E
+0x4F49 = 0x2E2F
+0x4F56 = 0x2E30
+0x4F5F = 0x2E31
+0x4F60 = 0x2E2D
+0x4F6A = 0x2E32
+0x4F6C = 0x2E33
+0x4F7E = 0x2E34
+0x4F8A = 0x2E35
+0x4F94 = 0x2E36
+0x4F97 = 0x2E37
+0x4FC9 = 0x2E39
+0x4FE0 = 0x2E3A
+0x4FF1 = 0x2E21
+0x5001 = 0x2E3B
+0x5002 = 0x2E3C
+0x500E = 0x2E3D
+0x5018 = 0x2E3E
+0x5027 = 0x2E3F
+0x502E = 0x2E40
+0x503B = 0x2E42
+0x5040 = 0x2E41
+0x5041 = 0x2E43
+0x5094 = 0x2E44
+0x50CC = 0x2E45
+0x50D0 = 0x2E47
+0x50E6 = 0x2E48
+0x50F2 = 0x2E46
+0x5103 = 0x2E4B
+0x5106 = 0x2E4A
+0x510B = 0x2E4C
+0x511E = 0x2E4D
+0x5135 = 0x2E4E
+0x514A = 0x2E4F
+0x5155 = 0x2E51
+0x5157 = 0x2E52
+0x519D = 0x2E54
+0x51C3 = 0x2E55
+0x51CA = 0x2E56
+0x51DE = 0x2E57
+0x51E2 = 0x2E58
+0x51EE = 0x2E59
+0x5201 = 0x2E5A
+0x5213 = 0x2E5C
+0x5215 = 0x2E5D
+0x5249 = 0x2E5E
+0x5257 = 0x2E5F
+0x525D = 0x2F7E
+0x5261 = 0x2E60
+0x5293 = 0x2E61
+0x52C8 = 0x2E62
+0x52CC = 0x2E64
+0x52D0 = 0x2E65
+0x52D6 = 0x2E66
+0x52DB = 0x2E67
+0x52F0 = 0x2E69
+0x52FB = 0x2E6A
+0x5300 = 0x2E6B
+0x5307 = 0x2E6C
+0x531C = 0x2E6D
+0x5361 = 0x2E6F
+0x5363 = 0x2E70
+0x537D = 0x2E71
+0x5393 = 0x2E72
+0x539D = 0x2E73
+0x53B2 = 0x2E74
+0x5412 = 0x2E75
+0x541E = 0x4F7E
+0x5427 = 0x2E76
+0x544D = 0x2E77
+0x546B = 0x2E79
+0x5474 = 0x2E7A
+0x547F = 0x2E7B
+0x5488 = 0x2E7C
+0x5496 = 0x2E7D
+0x549C = 0x2E78
+0x54A1 = 0x2E7E
+0x54A9 = 0x2F21
+0x54C6 = 0x2F22
+0x54FF = 0x2F23
+0x550E = 0x2F24
+0x552B = 0x2F25
+0x5535 = 0x2F26
+0x5550 = 0x2F27
+0x555E = 0x2F28
+0x5581 = 0x2F29
+0x5586 = 0x2F2A
+0x558E = 0x2F2B
+0x55AD = 0x2F2D
+0x55CE = 0x2F2E
+0x5608 = 0x2F30
+0x560E = 0x2F31
+0x563B = 0x2F32
+0x5649 = 0x2F33
+0x5653 = 0x7427
+0x5666 = 0x2F35
+0x566F = 0x2F37
+0x5671 = 0x2F38
+0x5672 = 0x2F39
+0x5676 = 0x2F34
+0x5699 = 0x2F3A
+0x569E = 0x2F3B
+0x56A9 = 0x2F3C
+0x56AC = 0x2F3D
+0x56B3 = 0x2F3E
+0x56C9 = 0x2F3F
+0x56CA = 0x2F40
+0x570A = 0x2F41
+0x5721 = 0x2F43
+0x572F = 0x2F44
+0x5733 = 0x2F45
+0x5734 = 0x2F46
+0x5770 = 0x2F47
+0x5777 = 0x2F48
+0x577C = 0x2F49
+0x579C = 0x2F4A
+0x57B8 = 0x2F4D
+0x57C7 = 0x2F4E
+0x57C8 = 0x2F4F
+0x57CF = 0x2F50
+0x57E4 = 0x2F51
+0x57ED = 0x2F52
+0x57F5 = 0x2F53
+0x57F6 = 0x2F54
+0x57FF = 0x2F55
+0x5809 = 0x2F56
+0x5861 = 0x2F58
+0x5864 = 0x2F59
+0x587C = 0x2F5B
+0x5889 = 0x2F5C
+0x589E = 0x2F5D
+0x58A9 = 0x2F5F
+0x58CE = 0x2F62
+0x58D2 = 0x2F61
+0x58D4 = 0x2F63
+0x58DA = 0x2F64
+0x58E0 = 0x2F65
+0x58E9 = 0x2F66
+0x590C = 0x2F67
+0x595D = 0x2F69
+0x596D = 0x2F6A
+0x598B = 0x2F6B
+0x5992 = 0x2F6C
+0x59A4 = 0x2F6D
+0x59C3 = 0x2F6E
+0x59D2 = 0x2F6F
+0x59DD = 0x2F70
+0x59F8 = 0x7E7A
+0x5A13 = 0x2F71
+0x5A23 = 0x2F72
+0x5A67 = 0x2F73
+0x5A6D = 0x2F74
+0x5A77 = 0x2F75
+0x5A7E = 0x2F76
+0x5A84 = 0x2F77
+0x5A9E = 0x2F78
+0x5AA7 = 0x2F79
+0x5AC4 = 0x2F7A
+0x5B19 = 0x2F7C
+0x5B25 = 0x2F7D
+0x5B41 = 0x4F55
+0x5B56 = 0x4F56
+0x5B7D = 0x4F57
+0x5B93 = 0x4F58
+0x5BD8 = 0x4F59
+0x5BEC = 0x4F5A
+0x5C12 = 0x4F5B
+0x5C1E = 0x4F5C
+0x5C23 = 0x4F5D
+0x5C2B = 0x4F5E
+0x5C5B = 0x7E7B
+0x5C62 = 0x4F60
+0x5C7A = 0x4F64
+0x5C8F = 0x4F65
+0x5C9F = 0x4F66
+0x5CA3 = 0x4F67
+0x5CAA = 0x4F68
+0x5CBA = 0x4F69
+0x5CCB = 0x4F6A
+0x5CD0 = 0x4F6B
+0x5CD2 = 0x4F6C
+0x5CF4 = 0x4F6D
+0x5D0D = 0x4F70
+0x5D27 = 0x4F71
+0x5D46 = 0x4F73
+0x5D47 = 0x4F74
+0x5D4A = 0x4F76
+0x5D53 = 0x4F75
+0x5D6D = 0x4F77
+0x5D81 = 0x4F78
+0x5DA0 = 0x4F79
+0x5DA4 = 0x4F7A
+0x5DA7 = 0x4F7B
+0x5DB8 = 0x4F7C
+0x5DCB = 0x4F7D
+0x5DE2 = 0x7428
+0x5E14 = 0x7429
+0x5E18 = 0x742A
+0x5E58 = 0x742B
+0x5E5E = 0x742C
+0x5E77 = 0x7E7C
+0x5EBE = 0x742D
+0x5ECB = 0x742F
+0x5EF9 = 0x7430
+0x5F00 = 0x7431
+0x5F02 = 0x7432
+0x5F07 = 0x7433
+0x5F1D = 0x7434
+0x5F23 = 0x7435
+0x5F34 = 0x7436
+0x5F36 = 0x7437
+0x5F3D = 0x7438
+0x5F40 = 0x7439
+0x5F45 = 0x743A
+0x5F54 = 0x743B
+0x5F58 = 0x743C
+0x5F64 = 0x743D
+0x5F67 = 0x743E
+0x5F7D = 0x743F
+0x5F89 = 0x7440
+0x5F9C = 0x7441
+0x5FA7 = 0x7442
+0x5FAF = 0x7443
+0x5FB5 = 0x7444
+0x5FB7 = 0x7445
+0x5FC9 = 0x7446
+0x5FDE = 0x7447
+0x5FE1 = 0x7448
+0x5FE9 = 0x7449
+0x600D = 0x744A
+0x6014 = 0x744B
+0x6018 = 0x744C
+0x6033 = 0x744D
+0x6035 = 0x744E
+0x6047 = 0x744F
+0x609D = 0x7451
+0x609E = 0x7452
+0x60CB = 0x7453
+0x60D4 = 0x7454
+0x60D5 = 0x7455
+0x60DD = 0x7456
+0x60F8 = 0x7457
+0x611C = 0x7458
+0x612B = 0x7459
+0x6130 = 0x745A
+0x6137 = 0x745B
+0x618D = 0x745D
+0x61B9 = 0x7460
+0x61BC = 0x745F
+0x6222 = 0x7462
+0x623E = 0x7463
+0x6243 = 0x7464
+0x6256 = 0x7465
+0x625A = 0x7466
+0x626F = 0x7467
+0x6285 = 0x7468
+0x62C4 = 0x7469
+0x62D6 = 0x746A
+0x62FC = 0x746B
+0x630A = 0x746C
+0x6318 = 0x746D
+0x6339 = 0x746E
+0x6343 = 0x746F
+0x6365 = 0x7470
+0x637C = 0x7471
+0x63E5 = 0x7472
+0x63ED = 0x7473
+0x63F5 = 0x7474
+0x6410 = 0x7475
+0x6414 = 0x7476
+0x6422 = 0x7477
+0x6451 = 0x7479
+0x6460 = 0x747A
+0x646D = 0x747B
+0x6479 = 0x7478
+0x64BE = 0x747D
+0x64BF = 0x747E
+0x64C4 = 0x7521
+0x64CA = 0x7522
+0x64CE = 0x747C
+0x64D0 = 0x7523
+0x64F7 = 0x7524
+0x64FB = 0x7525
+0x6522 = 0x7526
+0x6529 = 0x7527
+0x6567 = 0x7529
+0x659D = 0x752A
+0x6600 = 0x752C
+0x6609 = 0x752D
+0x6615 = 0x752E
+0x661E = 0x752F
+0x6622 = 0x7531
+0x6624 = 0x7532
+0x662B = 0x7533
+0x6630 = 0x7534
+0x6631 = 0x7535
+0x6633 = 0x7536
+0x663A = 0x7530
+0x6648 = 0x7538
+0x664C = 0x7539
+0x6659 = 0x753B
+0x665A = 0x753C
+0x6661 = 0x753D
+0x6665 = 0x753E
+0x6673 = 0x753F
+0x6677 = 0x7540
+0x6678 = 0x7541
+0x668D = 0x7542
+0x66A0 = 0x7544
+0x66B2 = 0x7545
+0x66BB = 0x7546
+0x66C6 = 0x7547
+0x66C8 = 0x7548
+0x66DB = 0x754A
+0x66E8 = 0x754B
+0x66FA = 0x754C
+0x66FB = 0x7537
+0x6713 = 0x754D
+0x6733 = 0x754F
+0x6747 = 0x7551
+0x6748 = 0x7552
+0x6766 = 0x7550
+0x677B = 0x7553
+0x6781 = 0x7554
+0x6793 = 0x7555
+0x6798 = 0x7556
+0x679B = 0x7557
+0x67BB = 0x7558
+0x67C0 = 0x755A
+0x67D7 = 0x755B
+0x67F9 = 0x7559
+0x67FC = 0x755C
+0x6801 = 0x755D
+0x681D = 0x755F
+0x682C = 0x7560
+0x6831 = 0x7561
+0x6852 = 0x755E
+0x685B = 0x7562
+0x6872 = 0x7563
+0x6875 = 0x7564
+0x68A3 = 0x7566
+0x68A5 = 0x7567
+0x68B2 = 0x7568
+0x68C8 = 0x7569
+0x68D0 = 0x756A
+0x68E8 = 0x756B
+0x68ED = 0x756C
+0x68F0 = 0x756D
+0x68F1 = 0x756E
+0x68FC = 0x756F
+0x690A = 0x7570
+0x6935 = 0x7573
+0x6942 = 0x7574
+0x6949 = 0x7571
+0x6957 = 0x7575
+0x6963 = 0x7576
+0x6964 = 0x7577
+0x6968 = 0x7578
+0x6980 = 0x7579
+0x69A5 = 0x757B
+0x69AD = 0x757C
+0x69CF = 0x757D
+0x69E2 = 0x7622
+0x69E9 = 0x7623
+0x69EA = 0x7624
+0x69F5 = 0x7625
+0x69F6 = 0x7626
+0x6A0F = 0x7627
+0x6A15 = 0x7628
+0x6A3B = 0x762A
+0x6A3E = 0x762B
+0x6A45 = 0x762C
+0x6A50 = 0x762D
+0x6A56 = 0x762E
+0x6A5B = 0x762F
+0x6A6B = 0x7630
+0x6A73 = 0x7631
+0x6A89 = 0x7633
+0x6A94 = 0x7634
+0x6A9D = 0x7635
+0x6A9E = 0x7636
+0x6AA5 = 0x7637
+0x6AE4 = 0x7638
+0x6AE7 = 0x7639
+0x6B1B = 0x763C
+0x6B1E = 0x763D
+0x6B2C = 0x763E
+0x6B35 = 0x763F
+0x6B46 = 0x7640
+0x6B56 = 0x7641
+0x6B60 = 0x7642
+0x6B65 = 0x7643
+0x6B67 = 0x7644
+0x6B77 = 0x7645
+0x6B82 = 0x7646
+0x6BA9 = 0x7647
+0x6BAD = 0x7648
+0x6BCF = 0x764A
+0x6BD6 = 0x764B
+0x6BD7 = 0x764C
+0x6BFF = 0x764D
+0x6C05 = 0x764E
+0x6C10 = 0x764F
+0x6C33 = 0x7650
+0x6C59 = 0x7651
+0x6C5C = 0x7652
+0x6C74 = 0x7654
+0x6C76 = 0x7655
+0x6C85 = 0x7656
+0x6C86 = 0x7657
+0x6C98 = 0x7658
+0x6C9C = 0x7659
+0x6CAA = 0x7653
+0x6CC6 = 0x765B
+0x6CD4 = 0x765C
+0x6CE0 = 0x765D
+0x6CEB = 0x765E
+0x6CEE = 0x765F
+0x6CFB = 0x765A
+0x6D04 = 0x7661
+0x6D0E = 0x7662
+0x6D2E = 0x7663
+0x6D31 = 0x7664
+0x6D39 = 0x7665
+0x6D3F = 0x7666
+0x6D58 = 0x7667
+0x6D65 = 0x7668
+0x6D82 = 0x766A
+0x6D87 = 0x766B
+0x6D89 = 0x766C
+0x6D94 = 0x766D
+0x6DAA = 0x766E
+0x6DAC = 0x766F
+0x6DBF = 0x7670
+0x6DC4 = 0x7671
+0x6DD6 = 0x7672
+0x6DDA = 0x7673
+0x6DDB = 0x7674
+0x6DDD = 0x7675
+0x6DFC = 0x7676
+0x6E34 = 0x7678
+0x6E44 = 0x7679
+0x6E5C = 0x767A
+0x6E5E = 0x767B
+0x6EAB = 0x767C
+0x6EB1 = 0x767D
+0x6EC1 = 0x767E
+0x6EC7 = 0x7721
+0x6ECE = 0x7722
+0x6F10 = 0x7723
+0x6F1A = 0x7724
+0x6F2A = 0x7726
+0x6F2F = 0x7727
+0x6F33 = 0x7728
+0x6F51 = 0x7729
+0x6F59 = 0x772A
+0x6F5E = 0x772B
+0x6F61 = 0x772C
+0x6F62 = 0x772D
+0x6F7E = 0x772E
+0x6F88 = 0x772F
+0x6F8C = 0x7730
+0x6F8D = 0x7731
+0x6F94 = 0x7732
+0x6FA0 = 0x7733
+0x6FA7 = 0x7734
+0x6FB6 = 0x7735
+0x6FBC = 0x7736
+0x6FC7 = 0x7737
+0x6FCA = 0x7738
+0x6FF0 = 0x773A
+0x6FF5 = 0x773B
+0x6FF9 = 0x7739
+0x7005 = 0x773C
+0x7006 = 0x773D
+0x7028 = 0x773E
+0x704A = 0x773F
+0x704E = 0x7742
+0x705D = 0x7740
+0x705E = 0x7741
+0x7064 = 0x7743
+0x7075 = 0x7744
+0x7085 = 0x7745
+0x70A4 = 0x7746
+0x70AB = 0x7747
+0x70B7 = 0x7748
+0x70D4 = 0x7749
+0x70D8 = 0x774A
+0x70E4 = 0x774B
+0x710F = 0x774C
+0x711E = 0x774E
+0x7120 = 0x774F
+0x712B = 0x774D
+0x712E = 0x7750
+0x7130 = 0x7751
+0x7146 = 0x7752
+0x7147 = 0x7753
+0x7151 = 0x7754
+0x7152 = 0x7756
+0x715C = 0x7757
+0x7160 = 0x7758
+0x7168 = 0x7759
+0x7185 = 0x775B
+0x7187 = 0x775C
+0x7192 = 0x775D
+0x71BA = 0x775F
+0x71C1 = 0x775E
+0x71C4 = 0x7760
+0x71FE = 0x7761
+0x7200 = 0x7762
+0x7215 = 0x7763
+0x7255 = 0x7764
+0x7256 = 0x7765
+0x728D = 0x7767
+0x729B = 0x7768
+0x72BE = 0x7769
+0x72C0 = 0x776A
+0x72FB = 0x776B
+0x7327 = 0x776D
+0x7328 = 0x776E
+0x7350 = 0x7770
+0x7366 = 0x7771
+0x737C = 0x7772
+0x7395 = 0x7773
+0x739F = 0x7774
+0x73A0 = 0x7775
+0x73A2 = 0x7776
+0x73A6 = 0x7777
+0x73AB = 0x7778
+0x73C9 = 0x7779
+0x73CF = 0x777A
+0x73D6 = 0x777B
+0x73D9 = 0x777C
+0x73E3 = 0x777D
+0x73E9 = 0x777E
+0x7407 = 0x7821
+0x740A = 0x7822
+0x741A = 0x7823
+0x741B = 0x7824
+0x7426 = 0x7826
+0x7428 = 0x7827
+0x742A = 0x7828
+0x742B = 0x7829
+0x742C = 0x782A
+0x742E = 0x782B
+0x742F = 0x782C
+0x7430 = 0x782D
+0x7444 = 0x782E
+0x7446 = 0x782F
+0x7447 = 0x7830
+0x744B = 0x7831
+0x7457 = 0x7832
+0x7462 = 0x7833
+0x746B = 0x7834
+0x746D = 0x7835
+0x7486 = 0x7836
+0x7487 = 0x7837
+0x7489 = 0x7838
+0x7490 = 0x783D
+0x7498 = 0x7839
+0x749C = 0x783A
+0x749F = 0x783B
+0x74A3 = 0x783C
+0x74A6 = 0x783E
+0x74A8 = 0x783F
+0x74A9 = 0x7840
+0x74B5 = 0x7841
+0x74BF = 0x7842
+0x74C8 = 0x7843
+0x74C9 = 0x7844
+0x74DA = 0x7845
+0x74FF = 0x7846
+0x7501 = 0x7847
+0x7517 = 0x7848
+0x752F = 0x7849
+0x756F = 0x784A
+0x7579 = 0x784B
+0x7592 = 0x784C
+0x75CE = 0x784E
+0x75E4 = 0x784F
+0x7600 = 0x7850
+0x7602 = 0x7851
+0x7608 = 0x7852
+0x7615 = 0x7853
+0x7616 = 0x7854
+0x7619 = 0x7855
+0x761E = 0x7856
+0x7626 = 0x7E7D
+0x762D = 0x7857
+0x7635 = 0x7858
+0x7643 = 0x7859
+0x764B = 0x785A
+0x7664 = 0x785B
+0x7665 = 0x785C
+0x766D = 0x785D
+0x766F = 0x785E
+0x7671 = 0x785F
+0x7681 = 0x7860
+0x769B = 0x7861
+0x769D = 0x7862
+0x769E = 0x7863
+0x76A6 = 0x7864
+0x76AA = 0x7865
+0x76B6 = 0x7866
+0x76C5 = 0x7867
+0x76CC = 0x7868
+0x76CE = 0x7869
+0x76D4 = 0x786A
+0x76E6 = 0x786B
+0x76F1 = 0x786C
+0x76FC = 0x786D
+0x770A = 0x786E
+0x7719 = 0x786F
+0x7734 = 0x7870
+0x7736 = 0x7871
+0x7746 = 0x7872
+0x774D = 0x7873
+0x774E = 0x7874
+0x775C = 0x7875
+0x775F = 0x7876
+0x7762 = 0x7877
+0x777A = 0x7878
+0x7780 = 0x7879
+0x7794 = 0x787A
+0x77AA = 0x787B
+0x77E0 = 0x787C
+0x782D = 0x787D
+0x7843 = 0x7921
+0x784E = 0x7922
+0x784F = 0x7923
+0x7851 = 0x7924
+0x7868 = 0x7925
+0x786E = 0x7926
+0x78AD = 0x792A
+0x78B0 = 0x7928
+0x78E4 = 0x792B
+0x78F2 = 0x792C
+0x78F7 = 0x792E
+0x7900 = 0x792D
+0x791C = 0x792F
+0x792E = 0x7930
+0x7931 = 0x7931
+0x7934 = 0x7932
+0x7945 = 0x7935
+0x7946 = 0x7936
+0x795C = 0x793A
+0x7979 = 0x793E
+0x7998 = 0x7942
+0x79B1 = 0x7943
+0x79B8 = 0x7944
+0x79C8 = 0x7945
+0x79CA = 0x7946
+0x79D4 = 0x7948
+0x79DE = 0x7949
+0x79EB = 0x794A
+0x79ED = 0x794B
+0x7A03 = 0x794C
+0x7A39 = 0x794E
+0x7A5D = 0x794F
+0x7A6D = 0x7950
+0x7A85 = 0x7952
+0x7AA0 = 0x7953
+0x7AB3 = 0x7955
+0x7ABB = 0x7956
+0x7ACE = 0x7957
+0x7AEB = 0x7958
+0x7AFD = 0x7959
+0x7B12 = 0x795A
+0x7B2D = 0x795B
+0x7B3B = 0x795C
+0x7B47 = 0x795D
+0x7B4E = 0x795E
+0x7B60 = 0x795F
+0x7B6D = 0x7960
+0x7B6F = 0x7961
+0x7B72 = 0x7962
+0x7B9E = 0x7963
+0x7BD7 = 0x7965
+0x7BD9 = 0x7966
+0x7C01 = 0x7967
+0x7C1E = 0x7969
+0x7C20 = 0x796A
+0x7C31 = 0x7968
+0x7C33 = 0x796B
+0x7C36 = 0x796C
+0x7C59 = 0x796F
+0x7C6D = 0x7970
+0x7C79 = 0x7971
+0x7C8F = 0x7972
+0x7C94 = 0x7973
+0x7CA0 = 0x7974
+0x7CBC = 0x7975
+0x7CD5 = 0x7976
+0x7CD9 = 0x7977
+0x7CDD = 0x7978
+0x7D07 = 0x7979
+0x7D08 = 0x797A
+0x7D13 = 0x797B
+0x7D1D = 0x797C
+0x7D23 = 0x797D
+0x7D31 = 0x797E
+0x7D41 = 0x7A21
+0x7D48 = 0x7A22
+0x7D53 = 0x7A23
+0x7D5C = 0x7A24
+0x7D7A = 0x7A25
+0x7D83 = 0x7A26
+0x7D8B = 0x7A27
+0x7DA0 = 0x7A28
+0x7DA6 = 0x7A29
+0x7DC2 = 0x7A2A
+0x7DCC = 0x7A2B
+0x7DD6 = 0x7A2C
+0x7DE3 = 0x7A2D
+0x7E08 = 0x7A30
+0x7E11 = 0x7A31
+0x7E15 = 0x7A32
+0x7E28 = 0x7A2F
+0x7E47 = 0x7A34
+0x7E52 = 0x7A35
+0x7E61 = 0x7A36
+0x7E6B = 0x7E7E
+0x7E8A = 0x7A37
+0x7E8D = 0x7A38
+0x7F47 = 0x7A39
+0x7F91 = 0x7A3B
+0x7F97 = 0x7A3C
+0x7FBF = 0x7A3D
+0x7FCE = 0x7A3E
+0x7FDB = 0x7A3F
+0x7FDF = 0x7A40
+0x7FEC = 0x7A41
+0x7FEE = 0x7A42
+0x7FFA = 0x7A43
+0x8014 = 0x7A45
+0x8026 = 0x7A46
+0x8035 = 0x7A47
+0x8037 = 0x7A48
+0x803C = 0x7A49
+0x80CA = 0x7A4A
+0x80D7 = 0x7A4B
+0x80E0 = 0x7A4C
+0x80F3 = 0x7A4D
+0x8118 = 0x7A4E
+0x814A = 0x7A4F
+0x8160 = 0x7A50
+0x8167 = 0x7A51
+0x8168 = 0x7A52
+0x816D = 0x7A53
+0x81BB = 0x7A54
+0x81CA = 0x7A55
+0x81CF = 0x7A56
+0x81D7 = 0x7A57
+0x8260 = 0x7A5B
+0x8274 = 0x7A5C
+0x828E = 0x7A5E
+0x82A1 = 0x7A5F
+0x82A3 = 0x7A60
+0x82A4 = 0x7A61
+0x82A9 = 0x7A62
+0x82AE = 0x7A63
+0x82B7 = 0x7A64
+0x82BE = 0x7A65
+0x82BF = 0x7A66
+0x82C6 = 0x7A67
+0x82D5 = 0x7A68
+0x82FD = 0x7A69
+0x82FE = 0x7A6A
+0x8300 = 0x7A6B
+0x8301 = 0x7A6C
+0x8322 = 0x7A6E
+0x832D = 0x7A6F
+0x833A = 0x7A70
+0x8343 = 0x7A71
+0x8347 = 0x7A72
+0x8351 = 0x7A73
+0x8355 = 0x7A74
+0x8362 = 0x7A6D
+0x837D = 0x7A75
+0x8386 = 0x7A76
+0x8392 = 0x7A77
+0x8398 = 0x7A78
+0x83A7 = 0x7A79
+0x83A9 = 0x7A7A
+0x83BF = 0x7A7B
+0x83C0 = 0x7A7C
+0x83C7 = 0x7A7D
+0x83CF = 0x7A7E
+0x83D1 = 0x7B21
+0x83E1 = 0x7B22
+0x83EA = 0x7B23
+0x8401 = 0x7B24
+0x8406 = 0x7B25
+0x840A = 0x7B26
+0x8448 = 0x7B28
+0x845F = 0x7B29
+0x8470 = 0x7B2A
+0x8473 = 0x7B2B
+0x8485 = 0x7B2C
+0x849E = 0x7B2D
+0x84AF = 0x7B2E
+0x84B4 = 0x7B2F
+0x84BA = 0x7B30
+0x84C0 = 0x7B31
+0x84C2 = 0x7B32
+0x851E = 0x7B35
+0x8523 = 0x7B36
+0x852F = 0x7B37
+0x8532 = 0x7B34
+0x8559 = 0x7B38
+0x8564 = 0x7B39
+0x857A = 0x7B3C
+0x858C = 0x7B3D
+0x858F = 0x7B3E
+0x85A2 = 0x7B3F
+0x85AD = 0x7B3B
+0x85B0 = 0x7B40
+0x85CB = 0x7B41
+0x85CE = 0x7B42
+0x85ED = 0x7B43
+0x85FF = 0x7B45
+0x8604 = 0x7B46
+0x8605 = 0x7B47
+0x8610 = 0x7B48
+0x8612 = 0x7B44
+0x8618 = 0x7B4A
+0x8629 = 0x7B4B
+0x8638 = 0x7B4C
+0x8641 = 0x2F68
+0x8657 = 0x7B4D
+0x865B = 0x7B4E
+0x8662 = 0x7B50
+0x866C = 0x7B52
+0x8675 = 0x7B53
+0x8698 = 0x7B54
+0x86B8 = 0x7B55
+0x86FA = 0x7B56
+0x86FC = 0x7B57
+0x86FD = 0x7B58
+0x870B = 0x7B59
+0x8771 = 0x7B5A
+0x8787 = 0x7B5B
+0x8788 = 0x7B5C
+0x87AC = 0x7B5D
+0x87AD = 0x7B5E
+0x87B5 = 0x7B5F
+0x87D6 = 0x7B61
+0x87EC = 0x7B62
+0x8806 = 0x7B63
+0x880A = 0x7B64
+0x8810 = 0x7B65
+0x8814 = 0x7B66
+0x881F = 0x7B67
+0x8898 = 0x7B68
+0x88AA = 0x7B69
+0x88CA = 0x7B6A
+0x88CE = 0x7B6B
+0x88F5 = 0x7B6D
+0x8918 = 0x7B70
+0x8919 = 0x7B71
+0x891A = 0x7B72
+0x891C = 0x7B6E
+0x8927 = 0x7B73
+0x8930 = 0x7B74
+0x8932 = 0x7B75
+0x8939 = 0x7B76
+0x8940 = 0x7B77
+0x8994 = 0x7B78
+0x89D4 = 0x7B7A
+0x89E5 = 0x7B7B
+0x89F6 = 0x7B7C
+0x8A12 = 0x7B7D
+0x8A15 = 0x7B7E
+0x8A22 = 0x7C21
+0x8A37 = 0x7C22
+0x8A47 = 0x7C23
+0x8A4E = 0x7C24
+0x8A5D = 0x7C25
+0x8A61 = 0x7C26
+0x8A75 = 0x7C27
+0x8A79 = 0x7C28
+0x8AA7 = 0x7C29
+0x8AD0 = 0x7C2A
+0x8ADF = 0x7C2B
+0x8AF4 = 0x7C2C
+0x8AF6 = 0x7C2D
+0x8B46 = 0x7C31
+0x8B54 = 0x7C32
+0x8B59 = 0x7C33
+0x8B69 = 0x7C34
+0x8B9D = 0x7C35
+0x8C49 = 0x7C36
+0x8C68 = 0x7C37
+0x8CE1 = 0x7C39
+0x8CF4 = 0x7C3A
+0x8CF8 = 0x7C3B
+0x8CFE = 0x7C3C
+0x8D12 = 0x7C3E
+0x8D1B = 0x7C3F
+0x8DAF = 0x7C40
+0x8DCE = 0x7C41
+0x8DD1 = 0x7C42
+0x8DD7 = 0x7C43
+0x8E20 = 0x7C44
+0x8E23 = 0x7C45
+0x8E3D = 0x7C46
+0x8E70 = 0x7C47
+0x8E7B = 0x7C48
+0x8EC0 = 0x7C4A
+0x8EFA = 0x7C4C
+0x8F1E = 0x7C4D
+0x8F2D = 0x7C4E
+0x8F36 = 0x7C4F
+0x8F54 = 0x7C50
+0x8FA6 = 0x7C52
+0x8FB5 = 0x7C53
+0x8FE4 = 0x7C54
+0x8FE8 = 0x7C55
+0x8FEE = 0x7C56
+0x9008 = 0x7C57
+0x902D = 0x7C58
+0x9088 = 0x7C5A
+0x9095 = 0x7C5B
+0x9097 = 0x7C5C
+0x9099 = 0x7C5D
+0x909B = 0x7C5E
+0x90A2 = 0x7C5F
+0x90B3 = 0x7C60
+0x90BE = 0x7C61
+0x90C4 = 0x7C62
+0x90C5 = 0x7C63
+0x90C7 = 0x7C64
+0x90D7 = 0x7C65
+0x90DD = 0x7C66
+0x90DE = 0x7C67
+0x90EF = 0x7C68
+0x90F4 = 0x7C69
+0x9114 = 0x7C6B
+0x9115 = 0x7C6C
+0x9116 = 0x7C6D
+0x9122 = 0x7C6E
+0x9123 = 0x7C6F
+0x9127 = 0x7C70
+0x912F = 0x7C71
+0x9131 = 0x7C72
+0x9134 = 0x7C73
+0x913D = 0x7C74
+0x9148 = 0x7C75
+0x915B = 0x7C76
+0x9183 = 0x7C77
+0x919E = 0x7C78
+0x91AC = 0x7C79
+0x91B1 = 0x7C7A
+0x91BC = 0x7C7B
+0x91D7 = 0x7C7C
+0x91E4 = 0x7C7E
+0x91E5 = 0x7D21
+0x91ED = 0x7D22
+0x91F1 = 0x7D23
+0x91FB = 0x7C7D
+0x9207 = 0x7D24
+0x9210 = 0x7D25
+0x9238 = 0x7D26
+0x9239 = 0x7D27
+0x923A = 0x7D28
+0x923C = 0x7D29
+0x9240 = 0x7D2A
+0x9243 = 0x7D2B
+0x924F = 0x7D2C
+0x9278 = 0x7D2D
+0x9288 = 0x7D2E
+0x92C2 = 0x7D2F
+0x92CB = 0x7D30
+0x92CC = 0x7D31
+0x92D3 = 0x7D32
+0x92E0 = 0x7D33
+0x92FF = 0x7D34
+0x9304 = 0x7D35
+0x931F = 0x7D36
+0x9321 = 0x7D37
+0x9325 = 0x7D38
+0x9348 = 0x7D39
+0x9349 = 0x7D3A
+0x934A = 0x7D3B
+0x9364 = 0x7D3C
+0x9365 = 0x7D3D
+0x936A = 0x7D3E
+0x9370 = 0x7D3F
+0x939B = 0x7D40
+0x93A3 = 0x7D41
+0x93BA = 0x7D42
+0x93C6 = 0x7D43
+0x93DE = 0x7D44
+0x93DF = 0x7D45
+0x93FD = 0x7D47
+0x9404 = 0x7D46
+0x9433 = 0x7D48
+0x944A = 0x7D49
+0x9463 = 0x7D4A
+0x946B = 0x7D4B
+0x9471 = 0x7D4C
+0x9472 = 0x7D4D
+0x958E = 0x7D4E
+0x959F = 0x7D4F
+0x95A6 = 0x7D50
+0x95A9 = 0x7D51
+0x95AC = 0x7D52
+0x95B6 = 0x7D53
+0x95BD = 0x7D54
+0x95CB = 0x7D55
+0x95D0 = 0x7D56
+0x95D3 = 0x7D57
+0x95DA = 0x7D59
+0x95DE = 0x7D5A
+0x9658 = 0x7D5B
+0x9684 = 0x7D5C
+0x969D = 0x7D5E
+0x96A4 = 0x7D5F
+0x96A5 = 0x7D60
+0x96D2 = 0x7D61
+0x96DE = 0x7D62
+0x96E9 = 0x7D64
+0x96EF = 0x7D65
+0x9733 = 0x7D66
+0x973B = 0x7D67
+0x974D = 0x7D68
+0x974E = 0x7D69
+0x974F = 0x7D6A
+0x975A = 0x7D6B
+0x976E = 0x7D6C
+0x9773 = 0x7D6D
+0x9795 = 0x7D6E
+0x97AE = 0x7D6F
+0x97BA = 0x7D70
+0x97C1 = 0x7D71
+0x97C9 = 0x7D72
+0x97DB = 0x7D74
+0x97DE = 0x7D73
+0x97F4 = 0x7D75
+0x980A = 0x7D77
+0x981E = 0x7D78
+0x982B = 0x7D79
+0x9830 = 0x7D7A
+0x9852 = 0x7D7C
+0x9853 = 0x7D7D
+0x9856 = 0x7D7E
+0x9857 = 0x7E21
+0x9859 = 0x7E22
+0x985A = 0x7E23
+0x9865 = 0x7E25
+0x986C = 0x7E26
+0x98BA = 0x7E27
+0x98C8 = 0x7E28
+0x98E7 = 0x7E29
+0x9958 = 0x7E2A
+0x999E = 0x7E2B
+0x9A02 = 0x7E2C
+0x9A03 = 0x7E2D
+0x9A24 = 0x7E2E
+0x9A2D = 0x7E2F
+0x9A2E = 0x7E30
+0x9A38 = 0x7E31
+0x9A4A = 0x7E32
+0x9A4E = 0x7E33
+0x9A52 = 0x7E34
+0x9AB6 = 0x7E35
+0x9AC1 = 0x7E36
+0x9AC3 = 0x7E37
+0x9ACE = 0x7E38
+0x9AD6 = 0x7E39
+0x9AF9 = 0x7E3A
+0x9B02 = 0x7E3B
+0x9B08 = 0x7E3C
+0x9B20 = 0x7E3D
+0x9B2D = 0x7E3F
+0x9B5E = 0x7E40
+0x9B66 = 0x7E42
+0x9B72 = 0x7E43
+0x9B75 = 0x7E44
+0x9B79 = 0x7E41
+0x9B84 = 0x7E45
+0x9B8A = 0x7E46
+0x9B8F = 0x7E47
+0x9B9E = 0x7E48
+0x9BA7 = 0x7E49
+0x9BC1 = 0x7E4A
+0x9BCE = 0x7E4B
+0x9BE5 = 0x7E4C
+0x9BF8 = 0x7E4D
+0x9BFD = 0x7E4E
+0x9C00 = 0x7E4F
+0x9C23 = 0x7E50
+0x9C41 = 0x7E51
+0x9C4F = 0x7E52
+0x9C50 = 0x7E53
+0x9C53 = 0x7E54
+0x9C63 = 0x7E55
+0x9C65 = 0x7E56
+0x9C77 = 0x7E57
+0x9D1D = 0x7E58
+0x9D1E = 0x7E59
+0x9D43 = 0x7E5A
+0x9D47 = 0x7E5B
+0x9D52 = 0x7E5C
+0x9D63 = 0x7E5D
+0x9D70 = 0x7E5E
+0x9D7C = 0x7E5F
+0x9D8A = 0x7E60
+0x9D96 = 0x7E61
+0x9DAC = 0x7E63
+0x9DBC = 0x7E64
+0x9DC0 = 0x7E62
+0x9DD7 = 0x7E65
+0x9DE7 = 0x7E67
+0x9E07 = 0x7E68
+0x9E15 = 0x7E69
+0x9E7C = 0x7E6A
+0x9E9E = 0x7E6B
+0x9EA4 = 0x7E6C
+0x9EAC = 0x7E6D
+0x9EAF = 0x7E6E
+0x9EB4 = 0x7E6F
+0x9EB5 = 0x7E70
+0x9EC3 = 0x7E71
+0x9ED1 = 0x7E72
+0x9F10 = 0x7E73
+0x9F39 = 0x7E74
+0x9F57 = 0x7E75
+0x9F90 = 0x7E76
+0x9F94 = 0x7E77
+0x9F97 = 0x7E78
+0x9FA2 = 0x7E79
+0xF91D = 0x763B
+0xF928 = 0x742E
+0xF929 = 0x754E
+0xF936 = 0x7B4F
+0xF970 = 0x7649
+0xF9D0 = 0x7E24
+0xF9DC = 0x7D5D
+0xFA0F = 0x2F4B
+0xFA10 = 0x2F57
+0xFA11 = 0x4F72
+0xFA14 = 0x757A
+0xFA15 = 0x775A
+0xFA16 = 0x776F
+0xFA19 = 0x793C
+0xFA1A = 0x793D
+0xFA1B = 0x7941
+0xFA1F = 0x7B3A
+0xFA22 = 0x7C2E
+0xFA26 = 0x7C6A
+0xFA30 = 0x2E38
+0xFA31 = 0x2E49
+0xFA32 = 0x2E50
+0xFA33 = 0x2E63
+0xFA34 = 0x2E68
+0xFA35 = 0x2E6E
+0xFA36 = 0x2F2C
+0xFA37 = 0x2F2F
+0xFA38 = 0x2F36
+0xFA39 = 0x2F5A
+0xFA3A = 0x2F5E
+0xFA3B = 0x4F61
+0xFA3C = 0x4F62
+0xFA3D = 0x7450
+0xFA3E = 0x745C
+0xFA3F = 0x745E
+0xFA40 = 0x7461
+0xFA41 = 0x7528
+0xFA42 = 0x752B
+0xFA43 = 0x7543
+0xFA44 = 0x7565
+0xFA45 = 0x7669
+0xFA46 = 0x7677
+0xFA47 = 0x7725
+0xFA48 = 0x7755
+0xFA4A = 0x7825
+0xFA4B = 0x7927
+0xFA4C = 0x7933
+0xFA4D = 0x7934
+0xFA4E = 0x7937
+0xFA4F = 0x7938
+0xFA50 = 0x7939
+0xFA51 = 0x793B
+0xFA52 = 0x793F
+0xFA53 = 0x7940
+0xFA54 = 0x794D
+0xFA55 = 0x7951
+0xFA56 = 0x7964
+0xFA57 = 0x7A2E
+0xFA59 = 0x7A33
+0xFA5A = 0x7A3A
+0xFA5B = 0x7A44
+0xFA5C = 0x7A58
+0xFA5F = 0x7B27
+0xFA60 = 0x7B6F
+0xFA61 = 0x7B79
+0xFA62 = 0x7C2F
+0xFA63 = 0x7C30
+0xFA64 = 0x7C38
+0xFA65 = 0x7C3D
+0xFA67 = 0x7C59
+0xFA68 = 0x7D63
+0xFA69 = 0x7D76
+0xFA6A = 0x7D7B
+0xFE45 = 0x233E
+0xFE46 = 0x233D
+0xFF02 = 0x2230 # 0x0022
+0xFF07 = 0x222F # 0x0027
+0xFF0D = 0x2231 # 0x002D
+0xFF5E = 0x2232 # 0x007E
+0xFF5F = 0x2256
+0xFF60 = 0x2257
+END_MAP
diff --git a/enc/trans/JIS/UCS@BMP%JISX0213-2.src b/enc/trans/JIS/UCS@BMP%JISX0213-2.src
new file mode 100644
index 0000000000..ba53d7d72f
--- /dev/null
+++ b/enc/trans/JIS/UCS@BMP%JISX0213-2.src
@@ -0,0 +1,2189 @@
+# $NetBSD: UCS@BMP%JISX0213-2.src,v 1.1 2007/03/05 16:58:33 tnozaki Exp $
+
+TYPE ROWCOL
+NAME "UCS:BMP/JISX0213-2"
+SRC_ZONE 0x3406 - 0xFA66
+OOB_MODE INVALID
+DST_INVALID 0xFFFF
+DST_UNIT_BITS 16
+
+BEGIN_MAP
+## Shift_JIS-2004 (JIS X 0213:2004) vs Unicode mapping table
+##
+## Date: 12 Feb 2005 10:15:00 GMT
+## License:
+## Copyright (C) 2001 earthian@tama.or.jp, All Rights Reserved.
+## Copyright (C) 2001 I'O, All Rights Reserved.
+## You can use, modify, distribute this table freely.
+## Note:
+## [1983] JIS codepoint defined by JIS X 0208-1983
+## [1990] JIS codepoint defined by JIS X 0208-1990
+## [2000] JIS codepoint defined by JIS X 0213:2000
+## [2004] JIS codepoint defined by JIS X 0213:2004
+## [Unicode3.1] UCS codepoint defined by Unicode 3.1
+## [Unicode3.2] UCS codepoint defined by Unicode 3.2
+## Fullwidth UCS fullwidth form (U+Fxxx)
+## Windows Windows (CP932) mapping
+## Some 0213 character can't represent by one UCS character.
+## In this table, such characters are described as 'U+xxxx+xxxx'.
+##
+0x3406 = 0x212D
+0x342C = 0x2132
+0x342E = 0x2133
+0x3468 = 0x215E
+0x346A = 0x2156
+0x3492 = 0x217E
+0x34BC = 0x232B
+0x34C1 = 0x7468
+0x34C7 = 0x232F
+0x351F = 0x2348
+0x355D = 0x235D
+0x355E = 0x235E
+0x3563 = 0x2361
+0x356E = 0x2367
+0x35A6 = 0x2423
+0x35A8 = 0x2426
+0x35C5 = 0x242F
+0x35DA = 0x2438
+0x35F4 = 0x2442
+0x3605 = 0x244A
+0x364A = 0x2479
+0x3691 = 0x253F
+0x3696 = 0x2543
+0x3699 = 0x2541
+0x36CF = 0x2557
+0x3761 = 0x2823
+0x3762 = 0x2825
+0x376B = 0x2829
+0x376C = 0x2828
+0x3775 = 0x282C
+0x37C1 = 0x283E
+0x37E8 = 0x2856
+0x37F4 = 0x2859
+0x37FD = 0x285C
+0x3800 = 0x285E
+0x382F = 0x286F
+0x3836 = 0x2871
+0x3840 = 0x2874
+0x385C = 0x2879
+0x3861 = 0x287B
+0x38FA = 0x2C3B
+0x3917 = 0x2C46
+0x391A = 0x2C4A
+0x396F = 0x2C60
+0x3A6E = 0x2D5B
+0x3A73 = 0x2D5F
+0x3AD6 = 0x2D71
+0x3AD7 = 0x2E36
+0x3AEA = 0x2D7C
+0x3B0E = 0x2E2E
+0x3B1A = 0x2E32
+0x3B1C = 0x2E34
+0x3B6D = 0x2E6D
+0x3B77 = 0x2E65
+0x3B87 = 0x2F28
+0x3B88 = 0x2F29
+0x3B8D = 0x2F2C
+0x3BA4 = 0x2F34
+0x3BCD = 0x2F48
+0x3BF0 = 0x2F5D
+0x3C26 = 0x2F77
+0x3CC3 = 0x6E3B
+0x3CD2 = 0x6E42
+0x3D11 = 0x6E71
+0x3D1E = 0x6E7E
+0x3D64 = 0x6F40
+0x3D9A = 0x6F54
+0x3DC0 = 0x6F70
+0x3DD4 = 0x6F77
+0x3E05 = 0x7028
+0x3E60 = 0x703F
+0x3E66 = 0x7041
+0x3E68 = 0x7042
+0x3E83 = 0x7049
+0x3E94 = 0x7050
+0x3F57 = 0x7134
+0x3F75 = 0x7146
+0x3F77 = 0x7148
+0x3FAE = 0x715C
+0x3FC9 = 0x7167
+0x3FD7 = 0x716C
+0x4039 = 0x7222
+0x4058 = 0x722D
+0x4093 = 0x7239
+0x4105 = 0x7264
+0x4148 = 0x7274
+0x414F = 0x7277
+0x4163 = 0x727D
+0x41B4 = 0x7333
+0x41BF = 0x7337
+0x41E6 = 0x7347
+0x41EE = 0x734B
+0x41F3 = 0x7348
+0x4207 = 0x7353
+0x420E = 0x7357
+0x42C6 = 0x742B
+0x42D6 = 0x7436
+0x42DD = 0x743B
+0x4302 = 0x744E
+0x432B = 0x745D
+0x4343 = 0x7461
+0x43EE = 0x753E
+0x43F0 = 0x7542
+0x4408 = 0x7548
+0x4417 = 0x754A
+0x441C = 0x754C
+0x4422 = 0x754F
+0x4476 = 0x756C
+0x447A = 0x756E
+0x4491 = 0x7577
+0x44B3 = 0x7635
+0x44BE = 0x7632
+0x44D4 = 0x7634
+0x4508 = 0x7659
+0x450D = 0x7654
+0x4525 = 0x766D
+0x4543 = 0x766E
+0x45B8 = 0x774F
+0x45E5 = 0x776C
+0x460F = 0x7824
+0x4641 = 0x783A
+0x4665 = 0x7843
+0x46A1 = 0x784E
+0x46AF = 0x7853
+0x470C = 0x786B
+0x4764 = 0x7929
+0x47FD = 0x793F
+0x4816 = 0x7949
+0x484E = 0x795C
+0x48B5 = 0x7A27
+0x49E7 = 0x7B6A
+0x49FA = 0x7B70
+0x4A04 = 0x7B75
+0x4A29 = 0x7B78
+0x4ABC = 0x7C37
+0x4B3B = 0x7C55
+0x4BC2 = 0x7D26
+0x4BCA = 0x7D28
+0x4BD2 = 0x7D2A
+0x4BE8 = 0x7D31
+0x4C20 = 0x7D3F
+0x4CC4 = 0x7E2A
+0x4CD1 = 0x7E2D
+0x4D07 = 0x7E4B
+0x4D77 = 0x7E60
+0x4E02 = 0x2122
+0x4E0F = 0x2123
+0x4E12 = 0x2124
+0x4E29 = 0x2125
+0x4E2B = 0x2126
+0x4E2C = 0x702E
+0x4E2E = 0x2127
+0x4E40 = 0x2128
+0x4E47 = 0x2129
+0x4E48 = 0x212A
+0x4E51 = 0x212C
+0x4E5A = 0x212F
+0x4E69 = 0x2130
+0x4E9D = 0x2131
+0x4EB9 = 0x2134
+0x4EBB = 0x2135
+0x4EBC = 0x2137
+0x4EC3 = 0x2138
+0x4EC8 = 0x2139
+0x4ED0 = 0x213A
+0x4EDA = 0x213C
+0x4EEB = 0x213B
+0x4EF1 = 0x213D
+0x4EF5 = 0x213E
+0x4F00 = 0x213F
+0x4F16 = 0x2140
+0x4F37 = 0x2142
+0x4F3E = 0x2143
+0x4F54 = 0x2144
+0x4F58 = 0x2145
+0x4F64 = 0x2141
+0x4F77 = 0x2147
+0x4F78 = 0x2148
+0x4F7A = 0x2149
+0x4F7D = 0x214A
+0x4F82 = 0x214B
+0x4F85 = 0x214C
+0x4F92 = 0x214D
+0x4F9A = 0x214E
+0x4FB2 = 0x2150
+0x4FBE = 0x2151
+0x4FC5 = 0x2152
+0x4FCB = 0x2153
+0x4FCF = 0x2154
+0x4FD2 = 0x2155
+0x4FE6 = 0x214F
+0x4FF2 = 0x2157
+0x5000 = 0x2158
+0x5010 = 0x2159
+0x5013 = 0x215A
+0x501C = 0x215B
+0x501E = 0x215C
+0x5022 = 0x215D
+0x5042 = 0x215F
+0x5046 = 0x2160
+0x504E = 0x2161
+0x5053 = 0x2162
+0x5057 = 0x2163
+0x5063 = 0x2164
+0x5066 = 0x2165
+0x506A = 0x2166
+0x5070 = 0x2167
+0x5088 = 0x2169
+0x5092 = 0x216A
+0x5093 = 0x216B
+0x5095 = 0x216C
+0x5096 = 0x216D
+0x509C = 0x216E
+0x50A3 = 0x2168
+0x50AA = 0x216F
+0x50B1 = 0x2171
+0x50BA = 0x2172
+0x50BB = 0x2173
+0x50C4 = 0x2174
+0x50C7 = 0x2175
+0x50CE = 0x2178
+0x50D4 = 0x217A
+0x50D9 = 0x217B
+0x50E1 = 0x217C
+0x50E9 = 0x217D
+0x50F3 = 0x2176
+0x5108 = 0x2321
+0x5117 = 0x2323
+0x511B = 0x2324
+0x5160 = 0x2326
+0x5173 = 0x2328
+0x517B = 0x7474
+0x5183 = 0x2329
+0x518B = 0x232A
+0x5198 = 0x232C
+0x51A3 = 0x232D
+0x51AD = 0x232E
+0x51BC = 0x2330
+0x51F3 = 0x2333
+0x51F4 = 0x2334
+0x5202 = 0x2335
+0x5212 = 0x2336
+0x5216 = 0x2337
+0x5255 = 0x2339
+0x525C = 0x233A
+0x526C = 0x233B
+0x5277 = 0x233C
+0x5282 = 0x233E
+0x5284 = 0x233D
+0x5298 = 0x2340
+0x52A4 = 0x2342
+0x52A6 = 0x2343
+0x52AF = 0x2344
+0x52BA = 0x2345
+0x52BB = 0x2346
+0x52CA = 0x2347
+0x52D1 = 0x2349
+0x52F7 = 0x234B
+0x530A = 0x234C
+0x530B = 0x234D
+0x5324 = 0x234E
+0x5335 = 0x234F
+0x533E = 0x2350
+0x5342 = 0x2351
+0x5367 = 0x2354
+0x536C = 0x2355
+0x537A = 0x2356
+0x53A4 = 0x2357
+0x53B4 = 0x2358
+0x53B7 = 0x235A
+0x53C0 = 0x235B
+0x53D5 = 0x235F
+0x53DA = 0x2360
+0x53F4 = 0x2362
+0x53F5 = 0x2363
+0x5424 = 0x2365
+0x5428 = 0x2366
+0x5443 = 0x2368
+0x5455 = 0x2364
+0x5462 = 0x2369
+0x5466 = 0x236A
+0x546C = 0x236B
+0x548A = 0x236C
+0x548D = 0x236D
+0x5495 = 0x236E
+0x54A0 = 0x236F
+0x54A6 = 0x2370
+0x54AD = 0x2371
+0x54AE = 0x2372
+0x54B7 = 0x2373
+0x54BA = 0x2374
+0x54BF = 0x2375
+0x54C3 = 0x2376
+0x54EC = 0x2378
+0x54EF = 0x2379
+0x54F1 = 0x237A
+0x54F3 = 0x237B
+0x5500 = 0x237C
+0x5501 = 0x237D
+0x5509 = 0x237E
+0x553C = 0x2421
+0x5541 = 0x2422
+0x5547 = 0x2424
+0x554A = 0x2425
+0x5560 = 0x2427
+0x5561 = 0x2428
+0x5564 = 0x2429
+0x557D = 0x242B
+0x5582 = 0x242C
+0x5588 = 0x242D
+0x5591 = 0x242E
+0x55BF = 0x2433
+0x55C9 = 0x2434
+0x55CC = 0x2435
+0x55D1 = 0x2436
+0x55D2 = 0x2430
+0x55DD = 0x2437
+0x55E2 = 0x2439
+0x55E9 = 0x243B
+0x5607 = 0x243E
+0x5610 = 0x243F
+0x5628 = 0x243C
+0x5630 = 0x2440
+0x5637 = 0x2441
+0x563D = 0x2443
+0x563F = 0x2444
+0x5640 = 0x2445
+0x5647 = 0x2446
+0x565E = 0x2447
+0x5660 = 0x2448
+0x566D = 0x2449
+0x5688 = 0x244B
+0x568C = 0x244C
+0x5695 = 0x244D
+0x569A = 0x244E
+0x569D = 0x244F
+0x56A8 = 0x2450
+0x56AD = 0x2451
+0x56B2 = 0x2452
+0x56C5 = 0x2453
+0x56CD = 0x2454
+0x56DF = 0x2455
+0x56E8 = 0x2456
+0x56F6 = 0x2457
+0x56F7 = 0x2458
+0x5715 = 0x245A
+0x5723 = 0x245B
+0x5729 = 0x245D
+0x5745 = 0x245F
+0x5746 = 0x2460
+0x574C = 0x2461
+0x574D = 0x2462
+0x5768 = 0x2464
+0x576F = 0x2465
+0x5773 = 0x2466
+0x5774 = 0x2467
+0x5775 = 0x2468
+0x577B = 0x2469
+0x579A = 0x246D
+0x579D = 0x246E
+0x579E = 0x246F
+0x57A8 = 0x2470
+0x57AC = 0x246C
+0x57CC = 0x2473
+0x57D7 = 0x2471
+0x57DE = 0x2476
+0x57E6 = 0x2477
+0x57F0 = 0x2478
+0x57F8 = 0x247A
+0x57FB = 0x247B
+0x57FD = 0x247C
+0x5804 = 0x247D
+0x581E = 0x247E
+0x5820 = 0x2521
+0x5827 = 0x2522
+0x5832 = 0x2523
+0x5839 = 0x2524
+0x5849 = 0x2526
+0x584C = 0x2527
+0x5867 = 0x2528
+0x588A = 0x2529
+0x588B = 0x252A
+0x588D = 0x252B
+0x588F = 0x252C
+0x5890 = 0x252D
+0x5894 = 0x252E
+0x589D = 0x252F
+0x58AA = 0x2530
+0x58B1 = 0x2531
+0x58C3 = 0x2533
+0x58CD = 0x2534
+0x58E2 = 0x2535
+0x58F3 = 0x2536
+0x58F4 = 0x2537
+0x5905 = 0x2538
+0x5906 = 0x2539
+0x590B = 0x253A
+0x590D = 0x253B
+0x5914 = 0x253C
+0x5924 = 0x253D
+0x593D = 0x2540
+0x5946 = 0x2542
+0x595B = 0x2545
+0x595F = 0x2546
+0x5975 = 0x2548
+0x5976 = 0x2549
+0x597C = 0x254A
+0x599F = 0x254B
+0x59AE = 0x254C
+0x59BC = 0x254D
+0x59C8 = 0x254E
+0x59CD = 0x254F
+0x59DE = 0x2550
+0x59E3 = 0x2551
+0x59E4 = 0x2552
+0x59E7 = 0x2553
+0x59EE = 0x2554
+0x5A0C = 0x2558
+0x5A0D = 0x2559
+0x5A17 = 0x255A
+0x5A27 = 0x255B
+0x5A2D = 0x255C
+0x5A55 = 0x255D
+0x5A65 = 0x255E
+0x5A7A = 0x255F
+0x5A8B = 0x2560
+0x5A9C = 0x2561
+0x5A9F = 0x2562
+0x5AA0 = 0x2563
+0x5AA2 = 0x2564
+0x5AB1 = 0x2565
+0x5AB3 = 0x2566
+0x5AB5 = 0x2567
+0x5ABA = 0x2568
+0x5ABF = 0x2569
+0x5ADA = 0x256A
+0x5ADC = 0x256B
+0x5AE0 = 0x256C
+0x5AE5 = 0x256D
+0x5AEE = 0x256F
+0x5AF0 = 0x256E
+0x5AF5 = 0x2570
+0x5B00 = 0x2571
+0x5B08 = 0x2572
+0x5B17 = 0x2573
+0x5B2D = 0x2575
+0x5B34 = 0x2574
+0x5B4C = 0x2576
+0x5B52 = 0x2577
+0x5B68 = 0x2578
+0x5B6F = 0x2579
+0x5B7C = 0x257A
+0x5B7F = 0x257B
+0x5B81 = 0x257C
+0x5B84 = 0x257D
+0x5B96 = 0x2821
+0x5BAC = 0x2822
+0x5BC0 = 0x2824
+0x5BCE = 0x2826
+0x5BD6 = 0x2827
+0x5BF1 = 0x282A
+0x5BFD = 0x282B
+0x5C03 = 0x282D
+0x5C29 = 0x282E
+0x5C30 = 0x282F
+0x5C5F = 0x2831
+0x5C63 = 0x2832
+0x5C67 = 0x2833
+0x5C68 = 0x2834
+0x5C69 = 0x2835
+0x5C70 = 0x2836
+0x5C7C = 0x2839
+0x5C88 = 0x283C
+0x5C8A = 0x283D
+0x5CA0 = 0x2841
+0x5CA2 = 0x2842
+0x5CA6 = 0x2843
+0x5CA7 = 0x2844
+0x5CAD = 0x2846
+0x5CB5 = 0x2847
+0x5CC9 = 0x2849
+0x5D06 = 0x284C
+0x5D10 = 0x284D
+0x5D1D = 0x284F
+0x5D20 = 0x2850
+0x5D24 = 0x2851
+0x5D26 = 0x2852
+0x5D2B = 0x284E
+0x5D31 = 0x2853
+0x5D39 = 0x2854
+0x5D42 = 0x2855
+0x5D61 = 0x2857
+0x5D6A = 0x2858
+0x5D70 = 0x285A
+0x5D88 = 0x285D
+0x5D92 = 0x285F
+0x5D94 = 0x2860
+0x5D97 = 0x2861
+0x5D99 = 0x2862
+0x5DB0 = 0x2863
+0x5DB2 = 0x2864
+0x5DB4 = 0x2865
+0x5DB9 = 0x2867
+0x5DD1 = 0x2868
+0x5DD7 = 0x2869
+0x5DD8 = 0x286A
+0x5DE0 = 0x286B
+0x5DE4 = 0x286D
+0x5DE9 = 0x286E
+0x5E00 = 0x2870
+0x5E12 = 0x2872
+0x5E15 = 0x2873
+0x5E1F = 0x2875
+0x5E2E = 0x2876
+0x5E3E = 0x2877
+0x5E49 = 0x2878
+0x5E56 = 0x287A
+0x5E6B = 0x287C
+0x5E6C = 0x287D
+0x5E6D = 0x287E
+0x5E6E = 0x2C21
+0x5EA5 = 0x2C23
+0x5EAA = 0x2C24
+0x5EAC = 0x2C25
+0x5EB9 = 0x2C26
+0x5EBF = 0x2C27
+0x5EC6 = 0x2C28
+0x5ED2 = 0x2C29
+0x5ED9 = 0x2C2A
+0x5EFD = 0x2C2C
+0x5F08 = 0x2C2D
+0x5F0E = 0x2C2E
+0x5F1C = 0x2C2F
+0x5F1E = 0x2C31
+0x5F47 = 0x2C32
+0x5F63 = 0x2C33
+0x5F72 = 0x2C34
+0x5F7E = 0x2C35
+0x5F8F = 0x2C36
+0x5FA2 = 0x2C37
+0x5FA4 = 0x2C38
+0x5FB8 = 0x2C39
+0x5FC4 = 0x2C3A
+0x5FC7 = 0x2C3C
+0x5FCB = 0x2C3D
+0x5FD2 = 0x2C3E
+0x5FD3 = 0x2C3F
+0x5FD4 = 0x2C40
+0x5FE2 = 0x2C41
+0x5FEE = 0x2C42
+0x5FEF = 0x2C43
+0x5FF3 = 0x2C44
+0x5FFC = 0x2C45
+0x6017 = 0x2C47
+0x6022 = 0x2C48
+0x6024 = 0x2C49
+0x604C = 0x2C4B
+0x607F = 0x2C4C
+0x608A = 0x2C4D
+0x6095 = 0x2C4E
+0x60A8 = 0x2C4F
+0x60B0 = 0x2C51
+0x60B1 = 0x2C52
+0x60BE = 0x2C53
+0x60C8 = 0x2C54
+0x60D9 = 0x2C55
+0x60DB = 0x2C56
+0x60EE = 0x2C57
+0x60F2 = 0x2C58
+0x60F5 = 0x2C59
+0x6110 = 0x2C5A
+0x6112 = 0x2C5B
+0x6113 = 0x2C5C
+0x6119 = 0x2C5D
+0x611E = 0x2C5E
+0x613A = 0x2C5F
+0x6141 = 0x2C61
+0x6146 = 0x2C62
+0x6160 = 0x2C63
+0x617C = 0x2C64
+0x6192 = 0x2C66
+0x6193 = 0x2C67
+0x6197 = 0x2C68
+0x6198 = 0x2C69
+0x61A5 = 0x2C6A
+0x61A8 = 0x2C6B
+0x61AD = 0x2C6C
+0x61D5 = 0x2C6E
+0x61DD = 0x2C6F
+0x61DF = 0x2C70
+0x61F5 = 0x2C71
+0x6215 = 0x2C73
+0x6223 = 0x2C74
+0x6229 = 0x2C75
+0x6246 = 0x2C76
+0x624C = 0x2C77
+0x6251 = 0x2C78
+0x6252 = 0x2C79
+0x6261 = 0x2C7A
+0x6264 = 0x2C7B
+0x626D = 0x2C7D
+0x6273 = 0x2C7E
+0x627B = 0x2C7C
+0x6299 = 0x2D21
+0x62A6 = 0x2D22
+0x62D5 = 0x2D23
+0x62FD = 0x2D25
+0x6303 = 0x2D26
+0x630D = 0x2D27
+0x6310 = 0x2D28
+0x6332 = 0x2D2B
+0x6335 = 0x2D2C
+0x633B = 0x2D2D
+0x633C = 0x2D2E
+0x6341 = 0x2D2F
+0x6344 = 0x2D30
+0x634E = 0x2D31
+0x6359 = 0x2D33
+0x636C = 0x2D36
+0x6384 = 0x2D37
+0x6394 = 0x2D3A
+0x6399 = 0x2D38
+0x63BD = 0x2D3B
+0x63D4 = 0x2D3D
+0x63D5 = 0x2D3E
+0x63DC = 0x2D3F
+0x63E0 = 0x2D40
+0x63EB = 0x2D41
+0x63EC = 0x2D42
+0x63F2 = 0x2D43
+0x63F7 = 0x2D3C
+0x6409 = 0x2D44
+0x641E = 0x2D45
+0x6425 = 0x2D46
+0x6429 = 0x2D47
+0x642F = 0x2D48
+0x645A = 0x2D49
+0x645B = 0x2D4A
+0x645D = 0x2D4B
+0x6473 = 0x2D4C
+0x647D = 0x2D4D
+0x6487 = 0x2D4E
+0x6491 = 0x2D4F
+0x649D = 0x2D50
+0x649F = 0x2D51
+0x64CB = 0x2D52
+0x64CC = 0x2D53
+0x64D5 = 0x2D54
+0x64D7 = 0x2D55
+0x64E4 = 0x2D57
+0x64E5 = 0x2D58
+0x64FF = 0x2D59
+0x6504 = 0x2D5A
+0x650F = 0x2D5C
+0x6514 = 0x2D5D
+0x6516 = 0x2D5E
+0x651E = 0x2D60
+0x6532 = 0x2D61
+0x6544 = 0x2D62
+0x6554 = 0x2D63
+0x656B = 0x2D64
+0x657A = 0x2D65
+0x6581 = 0x2D66
+0x6584 = 0x2D67
+0x6585 = 0x2D68
+0x658A = 0x2D69
+0x65B2 = 0x2D6A
+0x65B5 = 0x2D6B
+0x65B8 = 0x2D6C
+0x65BF = 0x2D6D
+0x65C2 = 0x2D6E
+0x65C9 = 0x2D6F
+0x65D4 = 0x2D70
+0x65F2 = 0x2D72
+0x65F9 = 0x2D73
+0x65FC = 0x2D74
+0x6604 = 0x2D75
+0x6608 = 0x2D76
+0x6621 = 0x2D77
+0x662A = 0x2D78
+0x6645 = 0x2D79
+0x664E = 0x2D7B
+0x6651 = 0x2D7A
+0x6657 = 0x2D7E
+0x665B = 0x2E21
+0x6663 = 0x2E22
+0x666A = 0x2E25
+0x666B = 0x2E26
+0x666C = 0x2E27
+0x666D = 0x2E28
+0x667B = 0x2E29
+0x6680 = 0x2E2A
+0x6690 = 0x2E2B
+0x6692 = 0x2E2C
+0x6699 = 0x2E2D
+0x66AD = 0x2E2F
+0x66B1 = 0x2E30
+0x66B5 = 0x2E31
+0x66BF = 0x2E33
+0x66EC = 0x2E35
+0x6701 = 0x2E37
+0x6705 = 0x2E38
+0x6712 = 0x2E39
+0x6719 = 0x2E3B
+0x674C = 0x2E3E
+0x674D = 0x2E3F
+0x6754 = 0x2E40
+0x675D = 0x2E41
+0x6774 = 0x2E45
+0x6776 = 0x2E46
+0x6792 = 0x2E48
+0x67B0 = 0x2E4C
+0x67B2 = 0x2E4D
+0x67C3 = 0x2E4E
+0x67C8 = 0x2E4F
+0x67D2 = 0x2E50
+0x67D9 = 0x2E51
+0x67DB = 0x2E52
+0x67F0 = 0x2E53
+0x67F7 = 0x2E54
+0x6810 = 0x2E4B
+0x6818 = 0x2E58
+0x681F = 0x2E59
+0x682D = 0x2E5A
+0x6833 = 0x2E5C
+0x683B = 0x2E5D
+0x683E = 0x2E5E
+0x6844 = 0x2E5F
+0x6845 = 0x2E60
+0x6849 = 0x2E61
+0x684C = 0x2E62
+0x6855 = 0x2E63
+0x6857 = 0x2E64
+0x686B = 0x2E66
+0x686E = 0x2E67
+0x687A = 0x2E68
+0x687C = 0x2E69
+0x6882 = 0x2E6A
+0x6890 = 0x2E6B
+0x6896 = 0x2E6C
+0x6898 = 0x2E6E
+0x6899 = 0x2E6F
+0x689A = 0x2E70
+0x689C = 0x2E71
+0x68AA = 0x2E72
+0x68AB = 0x2E73
+0x68B4 = 0x2E74
+0x68BB = 0x2E75
+0x68C3 = 0x2E7A
+0x68C5 = 0x2E7B
+0x68CC = 0x2E7C
+0x68CF = 0x2E7D
+0x68D6 = 0x2E7E
+0x68D9 = 0x2F21
+0x68E4 = 0x2F22
+0x68E5 = 0x2F23
+0x68EC = 0x2F24
+0x68F7 = 0x2F25
+0x68FB = 0x2E76
+0x6903 = 0x2F26
+0x6907 = 0x2F27
+0x693B = 0x2F2B
+0x6946 = 0x2F2D
+0x6969 = 0x2F2E
+0x696C = 0x2F2F
+0x6972 = 0x2F30
+0x697A = 0x2F31
+0x697F = 0x2F32
+0x6992 = 0x2F33
+0x6996 = 0x2F35
+0x6998 = 0x2F36
+0x69A6 = 0x2F37
+0x69B0 = 0x2F38
+0x69B7 = 0x2F39
+0x69BA = 0x2F3A
+0x69BC = 0x2F3B
+0x69C0 = 0x2F3C
+0x69D1 = 0x2F3D
+0x69D6 = 0x2F3E
+0x69E3 = 0x2F44
+0x69EE = 0x2F45
+0x69EF = 0x2F46
+0x69F3 = 0x2F47
+0x69F4 = 0x2F49
+0x69FE = 0x2F4A
+0x6A11 = 0x2F4B
+0x6A1A = 0x2F4C
+0x6A1D = 0x2F4D
+0x6A30 = 0x2F41
+0x6A32 = 0x2F4F
+0x6A33 = 0x2F50
+0x6A34 = 0x2F51
+0x6A3F = 0x2F52
+0x6A46 = 0x2F53
+0x6A49 = 0x2F54
+0x6A4E = 0x2F56
+0x6A52 = 0x2F57
+0x6A64 = 0x2F58
+0x6A7A = 0x2F55
+0x6A7E = 0x2F5A
+0x6A83 = 0x2F5B
+0x6A8B = 0x2F5C
+0x6A91 = 0x2F5E
+0x6A9F = 0x2F5F
+0x6AA1 = 0x2F60
+0x6AAB = 0x2F62
+0x6ABD = 0x2F63
+0x6AC6 = 0x2F64
+0x6AD0 = 0x2F66
+0x6AD4 = 0x2F65
+0x6ADC = 0x2F67
+0x6ADD = 0x2F68
+0x6AEC = 0x2F6B
+0x6AF1 = 0x2F6C
+0x6AF2 = 0x2F6D
+0x6AF3 = 0x2F6E
+0x6AFD = 0x2F6F
+0x6B0B = 0x2F71
+0x6B0F = 0x2F72
+0x6B10 = 0x2F73
+0x6B11 = 0x2F74
+0x6B17 = 0x2F76
+0x6B2F = 0x2F78
+0x6B4A = 0x2F79
+0x6B58 = 0x2F7A
+0x6B6C = 0x2F7B
+0x6B75 = 0x2F7C
+0x6B7A = 0x2F7D
+0x6B81 = 0x2F7E
+0x6B9B = 0x6E21
+0x6BAE = 0x6E22
+0x6BBD = 0x6E24
+0x6BBE = 0x6E25
+0x6BC7 = 0x6E26
+0x6BC8 = 0x6E27
+0x6BC9 = 0x6E28
+0x6BDA = 0x6E29
+0x6BE6 = 0x6E2A
+0x6BE7 = 0x6E2B
+0x6BEE = 0x6E2C
+0x6BF1 = 0x6E2D
+0x6C02 = 0x6E2E
+0x6C0A = 0x6E2F
+0x6C0E = 0x6E30
+0x6C35 = 0x6E31
+0x6C36 = 0x6E32
+0x6C3A = 0x6E33
+0x6C3F = 0x6E35
+0x6C4D = 0x6E36
+0x6C5B = 0x6E37
+0x6C67 = 0x6E4F
+0x6C6D = 0x6E38
+0x6C84 = 0x6E39
+0x6C89 = 0x6E3A
+0x6C94 = 0x6E3C
+0x6C95 = 0x6E3D
+0x6C97 = 0x6E3E
+0x6CAD = 0x6E3F
+0x6CC2 = 0x6E40
+0x6CD0 = 0x6E41
+0x6CD6 = 0x6E43
+0x6CDA = 0x6E44
+0x6CDC = 0x6E45
+0x6CE9 = 0x6E46
+0x6CEC = 0x6E47
+0x6CED = 0x6E48
+0x6D00 = 0x6E4A
+0x6D0A = 0x6E4B
+0x6D24 = 0x6E4C
+0x6D26 = 0x6E4D
+0x6D27 = 0x6E4E
+0x6D2F = 0x6E50
+0x6D34 = 0x6E65
+0x6D3C = 0x6E51
+0x6D5B = 0x6E52
+0x6D5E = 0x6E53
+0x6D60 = 0x6E54
+0x6D70 = 0x6E55
+0x6D80 = 0x6E56
+0x6D81 = 0x6E57
+0x6D8A = 0x6E58
+0x6D8D = 0x6E59
+0x6D91 = 0x6E5A
+0x6D98 = 0x6E5B
+0x6DAB = 0x6E61
+0x6DAE = 0x6E62
+0x6DB4 = 0x6E63
+0x6DC2 = 0x6E64
+0x6DC8 = 0x6E66
+0x6DCE = 0x6E67
+0x6DCF = 0x6E68
+0x6DD0 = 0x6E69
+0x6DDF = 0x6E6A
+0x6DE9 = 0x6E6B
+0x6DF6 = 0x6E6C
+0x6E17 = 0x6E5D
+0x6E1E = 0x6E6E
+0x6E22 = 0x6E6F
+0x6E27 = 0x6E70
+0x6E32 = 0x6E72
+0x6E36 = 0x6E6D
+0x6E3C = 0x6E73
+0x6E48 = 0x6E74
+0x6E49 = 0x6E75
+0x6E4B = 0x6E76
+0x6E4C = 0x6E77
+0x6E4F = 0x6E78
+0x6E51 = 0x6E79
+0x6E53 = 0x6E7A
+0x6E54 = 0x6E7B
+0x6E57 = 0x6E7C
+0x6E63 = 0x6E7D
+0x6E93 = 0x6F21
+0x6EA7 = 0x6F22
+0x6EB4 = 0x6F23
+0x6EBF = 0x6F24
+0x6EC3 = 0x6F25
+0x6ECA = 0x6F26
+0x6ED9 = 0x6F27
+0x6EEB = 0x6F29
+0x6EF9 = 0x6F2A
+0x6EFB = 0x6F2B
+0x6F0A = 0x6F2C
+0x6F0C = 0x6F2D
+0x6F18 = 0x6F2E
+0x6F25 = 0x6F2F
+0x6F35 = 0x6F28
+0x6F36 = 0x6F30
+0x6F3C = 0x6F31
+0x6F52 = 0x6F33
+0x6F57 = 0x6F34
+0x6F5A = 0x6F35
+0x6F60 = 0x6F36
+0x6F68 = 0x6F37
+0x6F7D = 0x6F39
+0x6F90 = 0x6F3A
+0x6F96 = 0x6F3B
+0x6F98 = 0x6F38
+0x6F9F = 0x6F3D
+0x6FA5 = 0x6F3E
+0x6FAF = 0x6F3F
+0x6FB5 = 0x6F41
+0x6FBE = 0x6F3C
+0x6FC8 = 0x6F42
+0x6FC9 = 0x6F43
+0x6FDA = 0x6F44
+0x6FDE = 0x6F45
+0x6FE9 = 0x6F46
+0x6FFC = 0x6F48
+0x7000 = 0x6F49
+0x7007 = 0x6F4A
+0x700A = 0x6F4B
+0x7023 = 0x6F4C
+0x7039 = 0x6F4E
+0x703A = 0x6F4F
+0x703C = 0x6F50
+0x7043 = 0x6F51
+0x7047 = 0x6F52
+0x704B = 0x6F53
+0x7054 = 0x6F55
+0x7065 = 0x6F56
+0x7069 = 0x6F57
+0x706C = 0x6F58
+0x706E = 0x6F59
+0x7076 = 0x6F5A
+0x707E = 0x6F5B
+0x7081 = 0x6F5C
+0x7086 = 0x6F5D
+0x7095 = 0x6F5E
+0x7097 = 0x6F5F
+0x709F = 0x6F62
+0x70B1 = 0x6F63
+0x70BB = 0x6F60
+0x70CA = 0x6F66
+0x70D1 = 0x6F67
+0x70D3 = 0x6F68
+0x70DC = 0x6F69
+0x70EC = 0x6F65
+0x7103 = 0x6F6A
+0x7104 = 0x6F6B
+0x7106 = 0x6F6C
+0x7107 = 0x6F6D
+0x7108 = 0x6F6E
+0x710C = 0x6F6F
+0x712F = 0x6F71
+0x7131 = 0x6F72
+0x714A = 0x6F74
+0x7150 = 0x6F73
+0x7153 = 0x6F75
+0x715E = 0x6F76
+0x7180 = 0x6F79
+0x7196 = 0x6F78
+0x719B = 0x6F7A
+0x71A0 = 0x6F7B
+0x71A2 = 0x6F7C
+0x71AE = 0x6F7D
+0x71AF = 0x6F7E
+0x71B3 = 0x7021
+0x71CB = 0x7023
+0x71D3 = 0x7024
+0x71D9 = 0x7025
+0x71DC = 0x7026
+0x7207 = 0x7027
+0x722B = 0x702A
+0x7234 = 0x702B
+0x7238 = 0x702C
+0x7239 = 0x702D
+0x7242 = 0x702F
+0x7253 = 0x7030
+0x7257 = 0x7031
+0x7263 = 0x7032
+0x726E = 0x7034
+0x726F = 0x7035
+0x7278 = 0x7036
+0x727F = 0x7037
+0x728E = 0x7038
+0x72AD = 0x703A
+0x72AE = 0x703B
+0x72B0 = 0x703C
+0x72B1 = 0x703D
+0x72C1 = 0x703E
+0x72CC = 0x7040
+0x72F3 = 0x7043
+0x72FA = 0x7044
+0x7307 = 0x7045
+0x7312 = 0x7046
+0x7318 = 0x7047
+0x7319 = 0x7048
+0x732C = 0x704B
+0x7331 = 0x704C
+0x7333 = 0x704D
+0x7339 = 0x704A
+0x733D = 0x704E
+0x7352 = 0x704F
+0x736B = 0x7051
+0x736C = 0x7052
+0x736E = 0x7054
+0x736F = 0x7055
+0x7371 = 0x7056
+0x7377 = 0x7057
+0x7381 = 0x7058
+0x7385 = 0x7059
+0x738A = 0x705A
+0x7394 = 0x705B
+0x7398 = 0x705C
+0x739C = 0x705D
+0x739E = 0x705E
+0x73A5 = 0x705F
+0x73A8 = 0x7060
+0x73B5 = 0x7061
+0x73B7 = 0x7062
+0x73B9 = 0x7063
+0x73BC = 0x7064
+0x73BF = 0x7065
+0x73C5 = 0x7066
+0x73CB = 0x7067
+0x73E1 = 0x7068
+0x73E7 = 0x7069
+0x73F9 = 0x706A
+0x73FA = 0x706C
+0x7401 = 0x706D
+0x7413 = 0x706B
+0x7424 = 0x706E
+0x7431 = 0x706F
+0x7439 = 0x7070
+0x7440 = 0x7072
+0x7443 = 0x7073
+0x744D = 0x7074
+0x7452 = 0x7075
+0x7453 = 0x7071
+0x745D = 0x7076
+0x7471 = 0x7077
+0x7481 = 0x7078
+0x7485 = 0x7079
+0x7488 = 0x707A
+0x7492 = 0x707C
+0x7497 = 0x707D
+0x7499 = 0x707E
+0x74A0 = 0x7121
+0x74A1 = 0x7122
+0x74A5 = 0x7123
+0x74AA = 0x7124
+0x74AB = 0x7125
+0x74B9 = 0x7126
+0x74BA = 0x7128
+0x74BB = 0x7127
+0x74D6 = 0x7129
+0x74D8 = 0x712A
+0x74DE = 0x712B
+0x74EB = 0x712D
+0x74EF = 0x712C
+0x74FA = 0x712F
+0x7520 = 0x7131
+0x7524 = 0x7132
+0x752A = 0x7133
+0x753D = 0x7136
+0x753E = 0x7137
+0x7540 = 0x7138
+0x7548 = 0x7139
+0x754E = 0x713A
+0x7550 = 0x713B
+0x7552 = 0x713C
+0x756C = 0x713D
+0x7571 = 0x713F
+0x7572 = 0x713E
+0x757A = 0x7140
+0x757D = 0x7141
+0x757E = 0x7142
+0x7581 = 0x7143
+0x758C = 0x7145
+0x75A2 = 0x7147
+0x75B0 = 0x7149
+0x75B7 = 0x714A
+0x75BF = 0x714B
+0x75C0 = 0x714C
+0x75C6 = 0x714D
+0x75CF = 0x714E
+0x75D3 = 0x714F
+0x75DD = 0x7150
+0x75DF = 0x7151
+0x75E0 = 0x7152
+0x75E7 = 0x7153
+0x75EC = 0x7154
+0x75EE = 0x7155
+0x75F1 = 0x7156
+0x75F9 = 0x7157
+0x7603 = 0x7158
+0x7607 = 0x715A
+0x760F = 0x715B
+0x7613 = 0x715E
+0x7618 = 0x7159
+0x761B = 0x715F
+0x761C = 0x7160
+0x7625 = 0x7162
+0x7628 = 0x7163
+0x7633 = 0x7165
+0x763C = 0x7164
+0x7641 = 0x7168
+0x7649 = 0x716A
+0x7655 = 0x716B
+0x766E = 0x716D
+0x7695 = 0x716E
+0x769C = 0x716F
+0x76A0 = 0x7171
+0x76A1 = 0x7170
+0x76A7 = 0x7172
+0x76A8 = 0x7173
+0x76AF = 0x7174
+0x76C9 = 0x7176
+0x76E8 = 0x7178
+0x76EC = 0x7179
+0x7717 = 0x717B
+0x771A = 0x717C
+0x772D = 0x717D
+0x7735 = 0x717E
+0x7758 = 0x7225
+0x7760 = 0x7226
+0x776A = 0x7227
+0x7772 = 0x7229
+0x777C = 0x722A
+0x777D = 0x722B
+0x779A = 0x722E
+0x779F = 0x722F
+0x77A2 = 0x7230
+0x77A4 = 0x7231
+0x77A9 = 0x7232
+0x77DE = 0x7233
+0x77DF = 0x7234
+0x77E4 = 0x7235
+0x77E6 = 0x7236
+0x77EA = 0x7237
+0x77EC = 0x7238
+0x77F0 = 0x723A
+0x77F4 = 0x723B
+0x77FB = 0x723C
+0x7805 = 0x723E
+0x7806 = 0x723F
+0x7809 = 0x7240
+0x780D = 0x7241
+0x7819 = 0x7242
+0x7821 = 0x7243
+0x782C = 0x7244
+0x7847 = 0x7245
+0x7864 = 0x7246
+0x786A = 0x7247
+0x788A = 0x7249
+0x7894 = 0x724A
+0x789D = 0x724C
+0x789E = 0x724D
+0x789F = 0x724E
+0x78A4 = 0x724B
+0x78BB = 0x724F
+0x78C8 = 0x7250
+0x78CC = 0x7251
+0x78CE = 0x7252
+0x78D5 = 0x7253
+0x78E0 = 0x7254
+0x78E1 = 0x7255
+0x78E6 = 0x7256
+0x78F9 = 0x7257
+0x78FA = 0x7258
+0x78FB = 0x7259
+0x78FE = 0x725A
+0x7910 = 0x725C
+0x791B = 0x725D
+0x7925 = 0x725F
+0x7930 = 0x725E
+0x793B = 0x7260
+0x794A = 0x7261
+0x7958 = 0x7262
+0x795B = 0x7263
+0x7967 = 0x7265
+0x7972 = 0x7266
+0x7994 = 0x7267
+0x7995 = 0x7268
+0x7996 = 0x7269
+0x799B = 0x726A
+0x79A1 = 0x726B
+0x79A9 = 0x726C
+0x79B4 = 0x726D
+0x79BB = 0x726E
+0x79C2 = 0x726F
+0x79C7 = 0x7270
+0x79CC = 0x7271
+0x79CD = 0x7272
+0x79D6 = 0x7273
+0x7A0A = 0x7278
+0x7A11 = 0x7279
+0x7A15 = 0x727A
+0x7A1B = 0x727B
+0x7A1E = 0x727C
+0x7A2D = 0x727E
+0x7A38 = 0x7321
+0x7A47 = 0x7322
+0x7A4C = 0x7323
+0x7A56 = 0x7324
+0x7A59 = 0x7325
+0x7A5C = 0x7326
+0x7A5F = 0x7327
+0x7A60 = 0x7328
+0x7A67 = 0x7329
+0x7A6A = 0x732A
+0x7A75 = 0x732B
+0x7A78 = 0x732C
+0x7A82 = 0x732D
+0x7A8A = 0x732E
+0x7A90 = 0x732F
+0x7AA3 = 0x7330
+0x7AAC = 0x7331
+0x7AB9 = 0x7334
+0x7ABC = 0x7335
+0x7ABE = 0x7336
+0x7ACC = 0x7338
+0x7AD1 = 0x7339
+0x7AE7 = 0x733A
+0x7AE8 = 0x733B
+0x7AF4 = 0x733C
+0x7B07 = 0x733F
+0x7B27 = 0x7342
+0x7B2A = 0x7343
+0x7B2E = 0x7344
+0x7B2F = 0x7345
+0x7B31 = 0x7346
+0x7B3D = 0x7341
+0x7B41 = 0x734A
+0x7B55 = 0x734C
+0x7B64 = 0x734E
+0x7B66 = 0x734F
+0x7B69 = 0x7350
+0x7B73 = 0x7351
+0x7B79 = 0x734D
+0x7B7F = 0x7349
+0x7B90 = 0x7354
+0x7B91 = 0x7355
+0x7B9B = 0x7356
+0x7BAF = 0x7358
+0x7BB5 = 0x7359
+0x7BBC = 0x735A
+0x7BC5 = 0x735B
+0x7BCA = 0x735C
+0x7BD4 = 0x735F
+0x7BD6 = 0x7360
+0x7BDA = 0x7361
+0x7BEA = 0x7362
+0x7BF0 = 0x7363
+0x7C03 = 0x7364
+0x7C0B = 0x7365
+0x7C0E = 0x7366
+0x7C0F = 0x7367
+0x7C26 = 0x7368
+0x7C45 = 0x7369
+0x7C4A = 0x736A
+0x7C51 = 0x736B
+0x7C57 = 0x736C
+0x7C5E = 0x736D
+0x7C61 = 0x736E
+0x7C69 = 0x736F
+0x7C6E = 0x7370
+0x7C6F = 0x7371
+0x7C70 = 0x7372
+0x7CA6 = 0x7376
+0x7CB6 = 0x7378
+0x7CB7 = 0x7379
+0x7CBF = 0x737A
+0x7CC4 = 0x737C
+0x7CC8 = 0x737E
+0x7CCD = 0x7421
+0x7CD7 = 0x7423
+0x7CE6 = 0x7425
+0x7CEB = 0x7426
+0x7CF5 = 0x7428
+0x7D03 = 0x7429
+0x7D09 = 0x742A
+0x7D12 = 0x742C
+0x7D1E = 0x742D
+0x7D3D = 0x7430
+0x7D3E = 0x7431
+0x7D40 = 0x7432
+0x7D47 = 0x7433
+0x7D59 = 0x7437
+0x7D5A = 0x7438
+0x7D6A = 0x7439
+0x7D70 = 0x743A
+0x7D7F = 0x743C
+0x7D86 = 0x743E
+0x7D88 = 0x743F
+0x7D8C = 0x7440
+0x7D97 = 0x7441
+0x7D9D = 0x7443
+0x7DA7 = 0x7444
+0x7DAA = 0x7445
+0x7DB6 = 0x7446
+0x7DB7 = 0x7447
+0x7DC0 = 0x7448
+0x7DD7 = 0x7449
+0x7DD9 = 0x744A
+0x7DE6 = 0x744B
+0x7DF1 = 0x744C
+0x7DF9 = 0x744D
+0x7E10 = 0x7451
+0x7E17 = 0x7452
+0x7E1D = 0x7453
+0x7E20 = 0x7454
+0x7E27 = 0x7455
+0x7E2C = 0x7456
+0x7E45 = 0x7457
+0x7E73 = 0x7458
+0x7E75 = 0x7459
+0x7E7E = 0x745A
+0x7E86 = 0x745B
+0x7E87 = 0x745C
+0x7E91 = 0x745E
+0x7E98 = 0x745F
+0x7E9A = 0x7460
+0x7F3B = 0x7463
+0x7F3C = 0x7462
+0x7F3E = 0x7464
+0x7F43 = 0x7465
+0x7F44 = 0x7466
+0x7F4F = 0x7467
+0x7F52 = 0x746A
+0x7F61 = 0x746C
+0x7F63 = 0x746D
+0x7F64 = 0x746E
+0x7F6D = 0x746F
+0x7F7D = 0x7470
+0x7F7E = 0x7471
+0x7F90 = 0x7473
+0x7F96 = 0x7476
+0x7F9C = 0x7477
+0x7FAD = 0x7478
+0x7FC3 = 0x747A
+0x7FCF = 0x747B
+0x7FE3 = 0x747C
+0x7FE5 = 0x747D
+0x7FEF = 0x747E
+0x7FF2 = 0x7521
+0x8002 = 0x7522
+0x8008 = 0x7524
+0x800A = 0x7523
+0x800E = 0x7525
+0x8011 = 0x7526
+0x8016 = 0x7527
+0x8024 = 0x7528
+0x802C = 0x7529
+0x8030 = 0x752A
+0x8043 = 0x752B
+0x8066 = 0x752C
+0x8071 = 0x752D
+0x8075 = 0x752E
+0x807B = 0x752F
+0x8099 = 0x7530
+0x809C = 0x7531
+0x80A4 = 0x7532
+0x80A7 = 0x7533
+0x80B8 = 0x7534
+0x80C5 = 0x7536
+0x80D5 = 0x7537
+0x80D8 = 0x7538
+0x80E6 = 0x7539
+0x80F5 = 0x753C
+0x80FB = 0x753D
+0x810D = 0x753B
+0x8116 = 0x7540
+0x811E = 0x7541
+0x8124 = 0x7543
+0x8127 = 0x7544
+0x812C = 0x7545
+0x8135 = 0x753F
+0x813D = 0x7547
+0x8169 = 0x7549
+0x8181 = 0x754B
+0x8184 = 0x754D
+0x8185 = 0x754E
+0x8198 = 0x7550
+0x81B2 = 0x7551
+0x81C1 = 0x7552
+0x81C3 = 0x7553
+0x81D6 = 0x7554
+0x81DB = 0x7555
+0x81E4 = 0x7557
+0x81EC = 0x7559
+0x81FD = 0x755B
+0x81FF = 0x755C
+0x8204 = 0x755E
+0x8219 = 0x7560
+0x8221 = 0x7561
+0x8222 = 0x7562
+0x8232 = 0x7564
+0x8234 = 0x7565
+0x823C = 0x7566
+0x8245 = 0x7569
+0x8246 = 0x7567
+0x8249 = 0x7568
+0x824B = 0x756B
+0x824F = 0x756D
+0x8257 = 0x756F
+0x825C = 0x7571
+0x8263 = 0x7572
+0x8279 = 0x7576
+0x827D = 0x7578
+0x827F = 0x7579
+0x8283 = 0x757A
+0x828A = 0x757B
+0x8293 = 0x757C
+0x82A7 = 0x757D
+0x82A8 = 0x757E
+0x82B2 = 0x7621
+0x82B4 = 0x7622
+0x82BA = 0x7623
+0x82BC = 0x7624
+0x82E2 = 0x7625
+0x82E8 = 0x7626
+0x82F7 = 0x7627
+0x8307 = 0x7628
+0x8308 = 0x7629
+0x830C = 0x762A
+0x831B = 0x762C
+0x831D = 0x762D
+0x8330 = 0x762E
+0x833C = 0x762F
+0x8344 = 0x7630
+0x8354 = 0x762B
+0x8357 = 0x7631
+0x8363 = 0x2E4A
+0x837F = 0x7633
+0x838D = 0x7636
+0x8394 = 0x7637
+0x8395 = 0x7638
+0x839B = 0x7639
+0x839D = 0x763A
+0x83C9 = 0x763B
+0x83D0 = 0x763C
+0x83D4 = 0x763D
+0x83DD = 0x763E
+0x83E5 = 0x763F
+0x83F9 = 0x7640
+0x840F = 0x7641
+0x8411 = 0x7642
+0x8415 = 0x7643
+0x8417 = 0x7645
+0x8439 = 0x7646
+0x844A = 0x7647
+0x844F = 0x7648
+0x8451 = 0x7649
+0x8452 = 0x764A
+0x8459 = 0x764B
+0x845A = 0x764C
+0x845C = 0x764D
+0x8465 = 0x764F
+0x8476 = 0x7650
+0x8478 = 0x7651
+0x847C = 0x7652
+0x8481 = 0x7653
+0x8497 = 0x7656
+0x84A6 = 0x7657
+0x84BE = 0x7658
+0x84CE = 0x765A
+0x84CF = 0x765B
+0x84D3 = 0x765C
+0x84DC = 0x7655
+0x84E7 = 0x765E
+0x84EA = 0x765F
+0x84EF = 0x7660
+0x84F0 = 0x7661
+0x84F1 = 0x7662
+0x84FA = 0x7663
+0x84FD = 0x7664
+0x850C = 0x7665
+0x851B = 0x7666
+0x8524 = 0x7667
+0x8525 = 0x7668
+0x852B = 0x7669
+0x8534 = 0x766A
+0x853E = 0x766F
+0x854F = 0x766B
+0x8551 = 0x7670
+0x8553 = 0x7671
+0x855E = 0x7672
+0x8561 = 0x7673
+0x8562 = 0x7674
+0x856F = 0x766C
+0x857B = 0x7676
+0x857D = 0x7677
+0x857F = 0x7678
+0x8581 = 0x7679
+0x8586 = 0x767A
+0x8593 = 0x767B
+0x859D = 0x767C
+0x859F = 0x767D
+0x85B7 = 0x7723
+0x85BC = 0x7724
+0x85C7 = 0x7725
+0x85CA = 0x7726
+0x85D8 = 0x7727
+0x85D9 = 0x7728
+0x85DF = 0x7729
+0x85E1 = 0x772A
+0x85E6 = 0x772B
+0x85F6 = 0x772C
+0x8600 = 0x772D
+0x8611 = 0x772E
+0x861E = 0x772F
+0x8621 = 0x7730
+0x8624 = 0x7731
+0x8627 = 0x7732
+0x8639 = 0x7734
+0x863C = 0x7735
+0x8640 = 0x7737
+0x8653 = 0x7739
+0x8656 = 0x773A
+0x866F = 0x773B
+0x8677 = 0x773C
+0x867A = 0x773D
+0x8687 = 0x773E
+0x8689 = 0x773F
+0x868D = 0x7740
+0x8691 = 0x7741
+0x869C = 0x7742
+0x869D = 0x7743
+0x86A8 = 0x7744
+0x86B1 = 0x7746
+0x86B3 = 0x7747
+0x86C1 = 0x7748
+0x86C3 = 0x7749
+0x86D1 = 0x774A
+0x86D5 = 0x774B
+0x86D7 = 0x774C
+0x86E3 = 0x774D
+0x86E6 = 0x774E
+0x8705 = 0x7750
+0x8707 = 0x7751
+0x870E = 0x7752
+0x8710 = 0x7753
+0x8713 = 0x7754
+0x8719 = 0x7755
+0x871F = 0x7756
+0x8721 = 0x7757
+0x8723 = 0x7758
+0x8731 = 0x7759
+0x873A = 0x775A
+0x873E = 0x775B
+0x8740 = 0x775C
+0x8743 = 0x775D
+0x8751 = 0x775E
+0x8758 = 0x775F
+0x8764 = 0x7760
+0x8765 = 0x7761
+0x8772 = 0x7762
+0x877C = 0x7763
+0x8789 = 0x7767
+0x878B = 0x7768
+0x8793 = 0x7769
+0x87A0 = 0x776A
+0x87A7 = 0x7766
+0x87BE = 0x776D
+0x87C1 = 0x776F
+0x87CE = 0x7770
+0x87DF = 0x7772
+0x87E3 = 0x7774
+0x87E5 = 0x7775
+0x87E6 = 0x7776
+0x87EA = 0x7777
+0x87EB = 0x7778
+0x87ED = 0x7779
+0x87F5 = 0x7771
+0x8801 = 0x777A
+0x8803 = 0x777B
+0x880B = 0x777C
+0x8813 = 0x777D
+0x8828 = 0x777E
+0x882E = 0x7821
+0x8832 = 0x7822
+0x883C = 0x7823
+0x884A = 0x7825
+0x8858 = 0x7826
+0x885F = 0x7827
+0x8864 = 0x7828
+0x8869 = 0x782B
+0x886F = 0x782D
+0x88A0 = 0x782E
+0x88BC = 0x782F
+0x88BD = 0x7830
+0x88BE = 0x7831
+0x88C0 = 0x7832
+0x88D1 = 0x7835
+0x88D2 = 0x7833
+0x88D3 = 0x7836
+0x88DB = 0x7837
+0x88F0 = 0x7838
+0x88F1 = 0x7839
+0x8901 = 0x783B
+0x8937 = 0x783D
+0x8942 = 0x783F
+0x8945 = 0x7840
+0x8949 = 0x7841
+0x8962 = 0x7844
+0x8980 = 0x7845
+0x8989 = 0x7846
+0x8990 = 0x7847
+0x899F = 0x7848
+0x89B0 = 0x7849
+0x89B7 = 0x784A
+0x89D6 = 0x784B
+0x89D8 = 0x784C
+0x89EB = 0x784D
+0x89F1 = 0x784F
+0x89F3 = 0x7850
+0x89FD = 0x7851
+0x89FF = 0x7852
+0x8A11 = 0x7854
+0x8A14 = 0x7855
+0x8A21 = 0x7857
+0x8A35 = 0x7858
+0x8A3E = 0x7859
+0x8A45 = 0x785A
+0x8A4D = 0x785B
+0x8A58 = 0x785C
+0x8A90 = 0x785E
+0x8AAE = 0x785D
+0x8AB7 = 0x785F
+0x8ABE = 0x7860
+0x8AD7 = 0x7861
+0x8AFC = 0x7862
+0x8B05 = 0x7865
+0x8B0A = 0x7864
+0x8B0D = 0x7866
+0x8B1C = 0x7867
+0x8B1F = 0x7868
+0x8B2D = 0x7869
+0x8B43 = 0x786A
+0x8B51 = 0x786C
+0x8B5E = 0x786D
+0x8B76 = 0x786E
+0x8B7F = 0x786F
+0x8B81 = 0x7870
+0x8B8B = 0x7871
+0x8B94 = 0x7872
+0x8B95 = 0x7873
+0x8B9C = 0x7874
+0x8B9E = 0x7875
+0x8C39 = 0x7876
+0x8C3D = 0x7878
+0x8C45 = 0x787B
+0x8C47 = 0x787C
+0x8C4F = 0x787D
+0x8C54 = 0x787E
+0x8C57 = 0x7921
+0x8C69 = 0x7922
+0x8C6D = 0x7923
+0x8C73 = 0x7924
+0x8C92 = 0x7927
+0x8C93 = 0x7926
+0x8C99 = 0x7928
+0x8C9B = 0x792A
+0x8CA4 = 0x792B
+0x8CD5 = 0x792D
+0x8CD6 = 0x792C
+0x8CD9 = 0x792E
+0x8CF0 = 0x7930
+0x8CF1 = 0x7931
+0x8D09 = 0x7933
+0x8D0E = 0x7934
+0x8D6C = 0x7935
+0x8D84 = 0x7936
+0x8D95 = 0x7937
+0x8DA6 = 0x7938
+0x8DC6 = 0x793A
+0x8DC8 = 0x793B
+0x8DD9 = 0x793C
+0x8DEC = 0x793D
+0x8DFD = 0x7940
+0x8E06 = 0x7941
+0x8E0C = 0x793E
+0x8E14 = 0x7943
+0x8E16 = 0x7944
+0x8E21 = 0x7945
+0x8E22 = 0x7946
+0x8E27 = 0x7947
+0x8E36 = 0x794A
+0x8E39 = 0x794B
+0x8E4B = 0x794C
+0x8E54 = 0x794D
+0x8E62 = 0x794E
+0x8E6C = 0x794F
+0x8E6D = 0x7950
+0x8E6F = 0x7951
+0x8E98 = 0x7952
+0x8E9E = 0x7953
+0x8EAE = 0x7954
+0x8EB3 = 0x7955
+0x8EB5 = 0x7956
+0x8EB6 = 0x7957
+0x8EBB = 0x7958
+0x8ED1 = 0x795A
+0x8ED4 = 0x795B
+0x8EF9 = 0x795D
+0x8F00 = 0x795F
+0x8F08 = 0x7960
+0x8F17 = 0x7961
+0x8F2B = 0x7962
+0x8F40 = 0x7963
+0x8F4A = 0x7964
+0x8F58 = 0x7965
+0x8FA4 = 0x7967
+0x8FB4 = 0x7968
+0x8FB6 = 0x796A
+0x8FC1 = 0x796C
+0x8FC6 = 0x796D
+0x8FCA = 0x796F
+0x8FCD = 0x7970
+0x8FD3 = 0x7971
+0x8FD5 = 0x7972
+0x8FE0 = 0x7973
+0x8FF1 = 0x7974
+0x8FF5 = 0x7975
+0x8FFB = 0x7976
+0x9002 = 0x7977
+0x900C = 0x7978
+0x9037 = 0x7979
+0x9043 = 0x797B
+0x9044 = 0x797C
+0x905D = 0x797D
+0x9085 = 0x7A22
+0x908C = 0x7A23
+0x9090 = 0x7A24
+0x90A1 = 0x7A26
+0x90B0 = 0x7A28
+0x90B6 = 0x7A29
+0x90C3 = 0x7A2A
+0x90C8 = 0x7A2B
+0x90DC = 0x7A2D
+0x90DF = 0x7A2E
+0x90EB = 0x7A33
+0x90F2 = 0x7A31
+0x90F6 = 0x7A30
+0x90FE = 0x7A34
+0x90FF = 0x7A35
+0x9100 = 0x7A32
+0x9104 = 0x7A36
+0x9106 = 0x7A37
+0x9118 = 0x7A38
+0x911C = 0x7A39
+0x911E = 0x7A3A
+0x9137 = 0x7A3B
+0x9139 = 0x7A3C
+0x913A = 0x7A3D
+0x9146 = 0x7A3E
+0x9147 = 0x7A3F
+0x9157 = 0x7A40
+0x9159 = 0x7A41
+0x9161 = 0x7A42
+0x9164 = 0x7A43
+0x9174 = 0x7A44
+0x9179 = 0x7A45
+0x9185 = 0x7A46
+0x918E = 0x7A47
+0x91A8 = 0x7A48
+0x91AE = 0x7A49
+0x91B3 = 0x7A4A
+0x91B6 = 0x7A4B
+0x91C3 = 0x7A4C
+0x91C4 = 0x7A4D
+0x91DA = 0x7A4E
+0x91EC = 0x7A51
+0x91EE = 0x7A52
+0x9201 = 0x7A53
+0x920A = 0x7A54
+0x9216 = 0x7A55
+0x9217 = 0x7A56
+0x9233 = 0x7A58
+0x9242 = 0x7A59
+0x9247 = 0x7A5A
+0x924A = 0x7A5B
+0x924E = 0x7A5C
+0x9251 = 0x7A5D
+0x9256 = 0x7A5E
+0x9259 = 0x7A5F
+0x9260 = 0x7A60
+0x9261 = 0x7A61
+0x9265 = 0x7A62
+0x9267 = 0x7A63
+0x9268 = 0x7A64
+0x927C = 0x7A67
+0x927D = 0x7A68
+0x927F = 0x7A69
+0x9289 = 0x7A6A
+0x928D = 0x7A6B
+0x9297 = 0x7A6C
+0x9299 = 0x7A6D
+0x929F = 0x7A6E
+0x92A7 = 0x7A6F
+0x92AB = 0x7A70
+0x92B2 = 0x7A73
+0x92BF = 0x7A74
+0x92C0 = 0x7A75
+0x92C6 = 0x7A76
+0x92CE = 0x7A77
+0x92D0 = 0x7A78
+0x92D7 = 0x7A79
+0x92D9 = 0x7A7A
+0x92E5 = 0x7A7B
+0x92E7 = 0x7A7C
+0x92F7 = 0x7B22
+0x92F9 = 0x7B23
+0x92FB = 0x7B24
+0x9302 = 0x7B25
+0x930D = 0x7B26
+0x9311 = 0x7A7D
+0x9315 = 0x7B27
+0x931D = 0x7B28
+0x931E = 0x7B29
+0x9327 = 0x7B2A
+0x9329 = 0x7B2B
+0x9347 = 0x7B2E
+0x9351 = 0x7B2F
+0x9357 = 0x7B30
+0x935A = 0x7B31
+0x936B = 0x7B32
+0x9371 = 0x7B33
+0x9373 = 0x7B34
+0x9388 = 0x7B38
+0x938B = 0x7B39
+0x938F = 0x7B3A
+0x939E = 0x7B3B
+0x93A1 = 0x7B35
+0x93C1 = 0x7B40
+0x93C7 = 0x7B41
+0x93DC = 0x7B42
+0x93E2 = 0x7B43
+0x93E7 = 0x7B44
+0x93F1 = 0x7B3F
+0x93F5 = 0x7B3C
+0x93FB = 0x7B49
+0x9409 = 0x7B45
+0x940F = 0x7B46
+0x9416 = 0x7B47
+0x9417 = 0x7B48
+0x9432 = 0x7B4A
+0x9434 = 0x7B4B
+0x943B = 0x7B4C
+0x9445 = 0x7B4D
+0x946D = 0x7B50
+0x946F = 0x7B51
+0x9578 = 0x7B52
+0x9579 = 0x7B53
+0x9586 = 0x7B54
+0x958C = 0x7B55
+0x958D = 0x7B56
+0x95AB = 0x7B58
+0x95B4 = 0x7B59
+0x95C8 = 0x7B5B
+0x961D = 0x7A25
+0x962C = 0x7B5E
+0x9633 = 0x7B5F
+0x9634 = 0x7B60
+0x963C = 0x7B62
+0x9641 = 0x7B63
+0x9661 = 0x7B64
+0x9682 = 0x7B66
+0x969A = 0x7B68
+0x96A9 = 0x7B6B
+0x96AF = 0x7B6C
+0x96B3 = 0x7B6D
+0x96BA = 0x7B6E
+0x96BD = 0x7B6F
+0x96D8 = 0x7B72
+0x96DA = 0x7B73
+0x96DD = 0x7B74
+0x9714 = 0x7B76
+0x9723 = 0x7B77
+0x9736 = 0x7B79
+0x9741 = 0x7B7A
+0x9747 = 0x7B7B
+0x9755 = 0x7B7C
+0x9757 = 0x7B7D
+0x975B = 0x7B7E
+0x976A = 0x7C21
+0x9796 = 0x7C24
+0x979A = 0x7C25
+0x979E = 0x7C26
+0x97A2 = 0x7C27
+0x97B1 = 0x7C28
+0x97B2 = 0x7C29
+0x97BE = 0x7C2A
+0x97CC = 0x7C2B
+0x97D1 = 0x7C2C
+0x97D4 = 0x7C2D
+0x97D8 = 0x7C2E
+0x97D9 = 0x7C2F
+0x97E1 = 0x7C30
+0x97F1 = 0x7C31
+0x9804 = 0x7C32
+0x980D = 0x7C33
+0x980E = 0x7C34
+0x9814 = 0x7C35
+0x9816 = 0x7C36
+0x9823 = 0x7C39
+0x9825 = 0x7C3C
+0x9832 = 0x7C3A
+0x9833 = 0x7C3B
+0x9847 = 0x7C3D
+0x9866 = 0x7C3E
+0x98AB = 0x7C3F
+0x98AD = 0x7C40
+0x98B0 = 0x7C41
+0x98B7 = 0x7C43
+0x98B8 = 0x7C44
+0x98BB = 0x7C45
+0x98BC = 0x7C46
+0x98BF = 0x7C47
+0x98C2 = 0x7C48
+0x98C7 = 0x7C49
+0x98CB = 0x7C4A
+0x98E0 = 0x7C4B
+0x98E1 = 0x7C4D
+0x98E3 = 0x7C4E
+0x98E5 = 0x7C4F
+0x98EA = 0x7C50
+0x98F0 = 0x7C51
+0x98F1 = 0x7C52
+0x98F3 = 0x7C53
+0x9908 = 0x7C54
+0x9916 = 0x7C57
+0x9917 = 0x7C58
+0x991A = 0x7C5A
+0x991B = 0x7C5B
+0x991C = 0x7C5C
+0x9931 = 0x7C5E
+0x9932 = 0x7C5F
+0x9933 = 0x7C60
+0x993A = 0x7C61
+0x993B = 0x7C62
+0x993C = 0x7C63
+0x9940 = 0x7C64
+0x9941 = 0x7C65
+0x9946 = 0x7C66
+0x994D = 0x7C67
+0x994E = 0x7C68
+0x995C = 0x7C69
+0x995F = 0x7C6A
+0x9960 = 0x7C6B
+0x99A3 = 0x7C6C
+0x99A6 = 0x7C6D
+0x99B9 = 0x7C6E
+0x99BD = 0x7C6F
+0x99BF = 0x7C70
+0x99C3 = 0x7C71
+0x99C9 = 0x7C72
+0x99D4 = 0x7C73
+0x99D9 = 0x7C74
+0x99DE = 0x7C75
+0x99F0 = 0x7C77
+0x99F9 = 0x7C78
+0x99FC = 0x7C79
+0x9A0A = 0x7C7A
+0x9A11 = 0x7C7B
+0x9A16 = 0x7C7C
+0x9A1A = 0x7C7D
+0x9A20 = 0x7C7E
+0x9A31 = 0x7D21
+0x9A36 = 0x7D22
+0x9A44 = 0x7D23
+0x9A4C = 0x7D24
+0x9A58 = 0x7D25
+0x9AAF = 0x7D27
+0x9AB7 = 0x7D29
+0x9AB9 = 0x7D2B
+0x9AC6 = 0x7D2D
+0x9AD0 = 0x7D2E
+0x9AD2 = 0x7D2F
+0x9AD5 = 0x7D30
+0x9ADC = 0x7D32
+0x9AE0 = 0x7D33
+0x9AE5 = 0x7D34
+0x9AE9 = 0x7D35
+0x9B03 = 0x7D36
+0x9B0C = 0x7D37
+0x9B10 = 0x7D38
+0x9B12 = 0x7D39
+0x9B16 = 0x7D3A
+0x9B1C = 0x7D3B # 0x9B1D
+0x9B2B = 0x7D3C
+0x9B33 = 0x7D3D
+0x9B3D = 0x7D3E
+0x9B4B = 0x7D40
+0x9B63 = 0x7D41
+0x9B65 = 0x7D42
+0x9B6B = 0x7D43
+0x9B6C = 0x7D44
+0x9B73 = 0x7D45
+0x9B76 = 0x7D46
+0x9B77 = 0x7D47
+0x9BA6 = 0x7D48
+0x9BAC = 0x7D49
+0x9BB1 = 0x7D4A
+0x9BB2 = 0x7D4D
+0x9BB8 = 0x7D4E
+0x9BBE = 0x7D4F
+0x9BC7 = 0x7D50
+0x9BD8 = 0x7D52
+0x9BDD = 0x7D53
+0x9BE7 = 0x7D54
+0x9BEA = 0x7D55
+0x9BEB = 0x7D56
+0x9BEE = 0x7D58
+0x9BEF = 0x7D57
+0x9BF3 = 0x7D51
+0x9BF7 = 0x7D5C
+0x9BFA = 0x7D5A
+0x9C16 = 0x7D5E
+0x9C18 = 0x7D5F
+0x9C19 = 0x7D60
+0x9C1A = 0x7D61
+0x9C1D = 0x7D62
+0x9C22 = 0x7D63
+0x9C27 = 0x7D64
+0x9C29 = 0x7D65
+0x9C2A = 0x7D66
+0x9C31 = 0x7D68
+0x9C36 = 0x7D69
+0x9C37 = 0x7D6A
+0x9C45 = 0x7D6B
+0x9C49 = 0x7D6E
+0x9C4A = 0x7D6F
+0x9C54 = 0x7D71
+0x9C58 = 0x7D72
+0x9C5B = 0x7D73
+0x9C5C = 0x7D6C
+0x9C5D = 0x7D74
+0x9C5F = 0x7D75
+0x9C69 = 0x7D76
+0x9C6A = 0x7D77
+0x9C6B = 0x7D78
+0x9C6D = 0x7D79
+0x9C6E = 0x7D7A
+0x9C70 = 0x7D7B
+0x9C72 = 0x7D7C
+0x9C75 = 0x7D7D
+0x9C7A = 0x7D7E
+0x9CE6 = 0x7E21
+0x9CF2 = 0x7E22
+0x9D02 = 0x7E24
+0x9D0B = 0x7E23
+0x9D11 = 0x7E26
+0x9D17 = 0x7E27
+0x9D18 = 0x7E28
+0x9D32 = 0x7E2C
+0x9D42 = 0x7E2E
+0x9D4A = 0x7E2F
+0x9D5F = 0x7E30
+0x9D62 = 0x7E31
+0x9D69 = 0x7E33
+0x9D6B = 0x7E34
+0x9D73 = 0x7E36
+0x9D76 = 0x7E37
+0x9D77 = 0x7E38
+0x9D7E = 0x7E39
+0x9D84 = 0x7E3A
+0x9D8D = 0x7E3B
+0x9D99 = 0x7E3C
+0x9DA1 = 0x7E3D
+0x9DB5 = 0x7E3F
+0x9DB9 = 0x7E40
+0x9DBD = 0x7E41
+0x9DBF = 0x7E3E
+0x9DC3 = 0x7E42
+0x9DC7 = 0x7E43
+0x9DC9 = 0x7E44
+0x9DD6 = 0x7E45
+0x9DDA = 0x7E46
+0x9DDF = 0x7E47
+0x9DE0 = 0x7E48
+0x9DE3 = 0x7E49
+0x9DF4 = 0x7E4A
+0x9E02 = 0x7E4D
+0x9E0A = 0x7E4C
+0x9E0D = 0x7E4E
+0x9E19 = 0x7E4F
+0x9E1C = 0x7E50
+0x9E1D = 0x7E51
+0x9E7B = 0x7E52
+0x9E80 = 0x7E54
+0x9E85 = 0x7E55
+0x9E9B = 0x7E56
+0x9EA8 = 0x7E57
+0x9EBD = 0x7E59
+0x9EDF = 0x7E5B
+0x9EE7 = 0x7E5C
+0x9EEE = 0x7E5D
+0x9EFF = 0x7E5E
+0x9F02 = 0x7E5F
+0x9F03 = 0x7E61
+0x9F17 = 0x7E62
+0x9F19 = 0x7E63
+0x9F2F = 0x7E64
+0x9F37 = 0x7E65
+0x9F3A = 0x7E66
+0x9F3D = 0x7E67
+0x9F41 = 0x7E68
+0x9F45 = 0x7E69
+0x9F46 = 0x7E6A
+0x9F53 = 0x7E6B
+0x9F55 = 0x7E6C
+0x9F58 = 0x7E6D
+0x9F5D = 0x7E6F
+0x9F69 = 0x7E71
+0x9F6D = 0x7E73
+0x9F70 = 0x7E74
+0x9F75 = 0x7E75
+0xFA13 = 0x2E79
+0xFA20 = 0x7738
+0xFA21 = 0x7745
+0xFA24 = 0x796E
+0xFA49 = 0x7029
+0xFA58 = 0x7450
+0xFA5D = 0x7574
+0xFA5E = 0x7575
+0xFA66 = 0x7969
+END_MAP
diff --git a/enc/trans/JIS/UCS@SIP%JISX0213-1.src b/enc/trans/JIS/UCS@SIP%JISX0213-1.src
new file mode 100644
index 0000000000..f4469c60d7
--- /dev/null
+++ b/enc/trans/JIS/UCS@SIP%JISX0213-1.src
@@ -0,0 +1,56 @@
+# $NetBSD: UCS@SIP%JISX0213-1.src,v 1.1 2007/03/05 16:58:34 tnozaki Exp $
+
+TYPE ROWCOL
+NAME "UCS:SIP/JISX0213-1"
+SRC_ZONE 0x000B - 0xA190
+OOB_MODE INVALID
+DST_INVALID 0xFFFF
+DST_UNIT_BITS 16
+
+BEGIN_MAP
+## Shift_JIS-2004 (JIS X 0213:2004) vs Unicode mapping table
+##
+## Date: 12 Feb 2005 10:15:00 GMT
+## License:
+## Copyright (C) 2001 earthian@tama.or.jp, All Rights Reserved.
+## Copyright (C) 2001 I'O, All Rights Reserved.
+## You can use, modify, distribute this table freely.
+## Note:
+## [1983] JIS codepoint defined by JIS X 0208-1983
+## [1990] JIS codepoint defined by JIS X 0208-1990
+## [2000] JIS codepoint defined by JIS X 0213:2000
+## [2004] JIS codepoint defined by JIS X 0213:2004
+## [Unicode3.1] UCS codepoint defined by Unicode 3.1
+## [Unicode3.2] UCS codepoint defined by Unicode 3.2
+## Fullwidth UCS fullwidth form (U+Fxxx)
+## Windows Windows (CP932) mapping
+## Some 0213 character can't represent by one UCS character.
+## In this table, such characters are described as 'U+xxxx+xxxx'.
+##
+0x000B = 0x2E22
+0x0B9F = 0x4F54
+0x123D = 0x2F42
+0x131B = 0x2F4C
+0x146E = 0x2F60
+0x16B4 = 0x4F63
+0x18BD = 0x2F7B
+0x1E34 = 0x4F6E
+0x31C4 = 0x753A
+0x35C4 = 0x7572
+0x373F = 0x7629
+0x3763 = 0x7632
+0x3CFE = 0x7660
+0x47F1 = 0x776C
+0x548E = 0x787E
+0x550E = 0x7929
+0x5771 = 0x7947
+0x59C4 = 0x7954
+0x5DA1 = 0x796E
+0x6AFF = 0x7A5D
+0x6E40 = 0x7B33
+0x70F4 = 0x7B49
+0x7684 = 0x7B6C
+0x8277 = 0x7C49
+0x83CD = 0x7C51
+0xA190 = 0x7E66
+END_MAP
diff --git a/enc/trans/JIS/UCS@SIP%JISX0213-2.src b/enc/trans/JIS/UCS@SIP%JISX0213-2.src
new file mode 100644
index 0000000000..7a33430ee9
--- /dev/null
+++ b/enc/trans/JIS/UCS@SIP%JISX0213-2.src
@@ -0,0 +1,307 @@
+# $NetBSD: UCS@SIP%JISX0213-2.src,v 1.1 2007/03/05 16:58:34 tnozaki Exp $
+
+TYPE ROWCOL
+NAME "UCS:SIP/JISX0213-2"
+SRC_ZONE 0x0089 - 0xA6B2
+OOB_MODE INVALID
+DST_INVALID 0xFFFF
+DST_UNIT_BITS 16
+
+BEGIN_MAP
+## Shift_JIS-2004 (JIS X 0213:2004) vs Unicode mapping table
+##
+## Date: 12 Feb 2005 10:15:00 GMT
+## License:
+## Copyright (C) 2001 earthian@tama.or.jp, All Rights Reserved.
+## Copyright (C) 2001 I'O, All Rights Reserved.
+## You can use, modify, distribute this table freely.
+## Note:
+## [1983] JIS codepoint defined by JIS X 0208-1983
+## [1990] JIS codepoint defined by JIS X 0208-1990
+## [2000] JIS codepoint defined by JIS X 0213:2000
+## [2004] JIS codepoint defined by JIS X 0213:2004
+## [Unicode3.1] UCS codepoint defined by Unicode 3.1
+## [Unicode3.2] UCS codepoint defined by Unicode 3.2
+## Fullwidth UCS fullwidth form (U+Fxxx)
+## Windows Windows (CP932) mapping
+## Some 0213 character can't represent by one UCS character.
+## In this table, such characters are described as 'U+xxxx+xxxx'.
+##
+0x0089 = 0x2121
+0x00A2 = 0x212B
+0x00A4 = 0x212E
+0x01A2 = 0x2136
+0x0213 = 0x2146
+0x032B = 0x2170
+0x0371 = 0x2179
+0x0381 = 0x2177
+0x03F9 = 0x2322
+0x044A = 0x2325
+0x0509 = 0x2327
+0x05D6 = 0x2331
+0x0628 = 0x2332
+0x074F = 0x2338
+0x0807 = 0x233F
+0x083A = 0x2341
+0x08B9 = 0x234A
+0x097C = 0x2352
+0x099D = 0x2353
+0x0AD3 = 0x2359
+0x0B1D = 0x235C
+0x0D45 = 0x2377
+0x0DE1 = 0x242A
+0x0E64 = 0x243A
+0x0E6D = 0x2432
+0x0E95 = 0x2431
+0x0F5F = 0x243D
+0x1201 = 0x2459
+0x1255 = 0x245C
+0x1274 = 0x2463
+0x127B = 0x245E
+0x12D7 = 0x246B
+0x12E4 = 0x246A
+0x12FD = 0x2472
+0x1336 = 0x2474
+0x1344 = 0x2475
+0x13C4 = 0x2525
+0x146D = 0x2532
+0x15D7 = 0x253E
+0x1647 = 0x2547
+0x1706 = 0x2555
+0x1742 = 0x2556
+0x19C3 = 0x257E
+0x1C56 = 0x2830
+0x1D2D = 0x2837
+0x1D45 = 0x2838
+0x1D62 = 0x283B
+0x1D78 = 0x283A
+0x1D92 = 0x2845
+0x1D9C = 0x2840
+0x1DA1 = 0x283F
+0x1DB7 = 0x2848
+0x1DE0 = 0x284A
+0x1E33 = 0x284B
+0x1F1E = 0x285B
+0x1F76 = 0x2866
+0x1FFA = 0x286C
+0x217B = 0x2C22
+0x2218 = 0x7E53
+0x231E = 0x2C2B
+0x23AD = 0x2C30
+0x26F3 = 0x2C50
+0x285B = 0x2C65
+0x28AB = 0x2C6D
+0x298F = 0x2C72
+0x2AB8 = 0x2D24
+0x2B46 = 0x2D32
+0x2B4F = 0x2D29
+0x2B50 = 0x2D2A
+0x2BA6 = 0x2D35
+0x2C1D = 0x2D34
+0x2C24 = 0x2D39
+0x2DE1 = 0x2D56
+0x31B6 = 0x2E24
+0x31C3 = 0x2D7D
+0x31F5 = 0x2E23
+0x3372 = 0x2E3A
+0x33D0 = 0x2E42
+0x33D2 = 0x2E3D
+0x33D3 = 0x2E3C
+0x33D5 = 0x2E44
+0x33DA = 0x2E47
+0x33DF = 0x2E49
+0x33E4 = 0x2E43
+0x344A = 0x2E55
+0x344B = 0x2E57
+0x3451 = 0x2E56
+0x3465 = 0x2E5B
+0x34E4 = 0x2E77
+0x355A = 0x2E78
+0x3594 = 0x2F2A
+0x3638 = 0x2F42
+0x3639 = 0x2F3F
+0x363A = 0x2F43
+0x3647 = 0x2F40
+0x370C = 0x2F59
+0x371C = 0x2F4E
+0x3764 = 0x2F61
+0x37E7 = 0x2F6A
+0x37FF = 0x2F69
+0x3824 = 0x2F70
+0x383D = 0x2F75
+0x3A98 = 0x6E23
+0x3C7F = 0x6E34
+0x3D00 = 0x6E49
+0x3D0E = 0x7475
+0x3D40 = 0x6E5C
+0x3DD3 = 0x6E60
+0x3DF9 = 0x6E5F
+0x3DFA = 0x6E5E
+0x3F7E = 0x6F32
+0x4096 = 0x6F47
+0x4103 = 0x6F4D
+0x41C6 = 0x6F61
+0x41FE = 0x6F64
+0x43BC = 0x7022
+0x4629 = 0x7033
+0x46A5 = 0x7039
+0x4896 = 0x7053
+0x4A4D = 0x707B
+0x4B56 = 0x712E
+0x4B6F = 0x7130
+0x4C16 = 0x7135
+0x4D14 = 0x7144
+0x4E0E = 0x715D
+0x4E37 = 0x7161
+0x4E6A = 0x7166
+0x4E8B = 0x7169
+0x504A = 0x7175
+0x5055 = 0x7177
+0x5122 = 0x717A
+0x51A9 = 0x7221
+0x51CD = 0x7224
+0x51E5 = 0x7223
+0x521E = 0x7228
+0x524C = 0x722C
+0x542E = 0x723D
+0x54D9 = 0x7248
+0x55A7 = 0x725B
+0x57A9 = 0x7275
+0x57B4 = 0x7276
+0x59D4 = 0x7332
+0x5AE3 = 0x733E
+0x5AE4 = 0x733D
+0x5AF1 = 0x7340
+0x5BB2 = 0x7352
+0x5C4B = 0x735D
+0x5C64 = 0x735E
+0x5E2E = 0x7373
+0x5E56 = 0x7374
+0x5E62 = 0x7377
+0x5E65 = 0x7375
+0x5EC2 = 0x737D
+0x5ED8 = 0x737B
+0x5EE8 = 0x7422
+0x5F23 = 0x7424
+0x5F5C = 0x7427
+0x5FD4 = 0x742F
+0x5FE0 = 0x742E
+0x5FFB = 0x7435
+0x600C = 0x7434
+0x6017 = 0x743D
+0x6060 = 0x7442
+0x60ED = 0x744F
+0x6270 = 0x7469
+0x6286 = 0x746B
+0x634C = 0x7472
+0x6402 = 0x7479
+0x667E = 0x7535
+0x66B0 = 0x753A
+0x671D = 0x7546
+0x68DD = 0x7556
+0x68EA = 0x7558
+0x6951 = 0x755A
+0x696F = 0x755D
+0x69DD = 0x755F
+0x6A1E = 0x7563
+0x6A58 = 0x756A
+0x6A8C = 0x7570
+0x6AB7 = 0x7573
+0x6C29 = 0x2544
+0x6C73 = 0x7644
+0x6CDD = 0x764E
+0x6E65 = 0x765D
+0x6F94 = 0x7675
+0x6FF6 = 0x7721
+0x6FF7 = 0x7722
+0x6FF8 = 0x767E
+0x710D = 0x7733
+0x7139 = 0x7736
+0x73DA = 0x7765
+0x73DB = 0x7764
+0x73FE = 0x776B
+0x7410 = 0x776E
+0x7449 = 0x7773
+0x7614 = 0x782A
+0x7615 = 0x7829
+0x7631 = 0x782C
+0x7693 = 0x7834
+0x770E = 0x783C
+0x7723 = 0x783E
+0x7752 = 0x7842
+0x7985 = 0x7856
+0x7A84 = 0x7863
+0x7BB3 = 0x7877
+0x7BBE = 0x7879
+0x7BC7 = 0x787A
+0x7CB8 = 0x7925
+0x7DA0 = 0x792F
+0x7E10 = 0x7932
+0x7FB7 = 0x7939
+0x808A = 0x7942
+0x80BB = 0x7948
+0x8282 = 0x7959
+0x82F3 = 0x795E
+0x840C = 0x7966
+0x8455 = 0x796B
+0x856B = 0x797A
+0x85C8 = 0x797E
+0x85C9 = 0x7A21
+0x86D7 = 0x7A2C
+0x86FA = 0x7A2F
+0x8946 = 0x7A50
+0x8949 = 0x7A4F
+0x896B = 0x7A57
+0x8987 = 0x7A65
+0x8988 = 0x7A66
+0x89BA = 0x7A71
+0x89BB = 0x7A72
+0x8A1E = 0x7A7E
+0x8A29 = 0x7B21
+0x8A43 = 0x7B2D
+0x8A71 = 0x7B2C
+0x8A99 = 0x7B36
+0x8ACD = 0x7B37
+0x8ADD = 0x7B3E
+0x8AE4 = 0x7B3D
+0x8BC1 = 0x7B4E
+0x8BEF = 0x7B4F
+0x8D10 = 0x7B57
+0x8D71 = 0x7B5A
+0x8DFB = 0x7B5C
+0x8E1F = 0x7B5D
+0x8E36 = 0x7B61
+0x8E89 = 0x7B65
+0x8EEB = 0x7B67
+0x8F32 = 0x7B69
+0x8FF8 = 0x7B71
+0x92A0 = 0x7C22
+0x92B1 = 0x7C23
+0x9490 = 0x7C38
+0x95CF = 0x7C42
+0x967F = 0x7C4C
+0x96F0 = 0x7C56
+0x9719 = 0x7C59
+0x9750 = 0x7C5D
+0x98C6 = 0x7C76
+0x9A72 = 0x7D2C
+0x9DDB = 0x7D4B
+0x9E15 = 0x7D59
+0x9E3D = 0x7D4C
+0x9E49 = 0x7D5D
+0x9E8A = 0x7D5B
+0x9EC4 = 0x7D67
+0x9EDB = 0x7D70
+0x9EE9 = 0x7D6D
+0x9FCE = 0x7E25
+0xA01A = 0x7E2B
+0xA02F = 0x7E29
+0xA082 = 0x7E35
+0xA0F9 = 0x7E32
+0xA38C = 0x7E58
+0xA437 = 0x7E5A
+0xA5F1 = 0x7E6E
+0xA602 = 0x7E70
+0xA61A = 0x7E72
+0xA6B2 = 0x7E76
+END_MAP
diff --git a/enc/trans/big5.trans b/enc/trans/big5.trans
index 9dacfd1f7e..c85ada3731 100644
--- a/enc/trans/big5.trans
+++ b/enc/trans/big5.trans
@@ -26,8 +26,7 @@
<%= transcode_generated_code %>
-void
-Init_big5(void)
+TRANS_INIT(big5)
{
<%= transcode_register_code %>
}
diff --git a/enc/trans/chinese.trans b/enc/trans/chinese.trans
index 0662a3bebc..282c91aba7 100644
--- a/enc/trans/chinese.trans
+++ b/enc/trans/chinese.trans
@@ -25,8 +25,7 @@
<%= transcode_generated_code %>
-void
-Init_chinese(void)
+TRANS_INIT(chinese)
{
<%= transcode_register_code %>
}
diff --git a/enc/trans/emoji.trans b/enc/trans/emoji.trans
index 1cf13743a2..25d9fdd4d8 100644
--- a/enc/trans/emoji.trans
+++ b/enc/trans/emoji.trans
@@ -30,8 +30,7 @@
<%= transcode_generated_code %>
-void
-Init_emoji(void)
+TRANS_INIT(emoji)
{
<%= transcode_register_code %>
}
diff --git a/enc/trans/emoji_iso2022_kddi.trans b/enc/trans/emoji_iso2022_kddi.trans
index ccf3139d3c..ea180c1e42 100644
--- a/enc/trans/emoji_iso2022_kddi.trans
+++ b/enc/trans/emoji_iso2022_kddi.trans
@@ -208,8 +208,7 @@ rb_iso2022jp_kddi_encoder = {
iso2022jp_kddi_encoder_reset_sequence_size, finish_iso2022jp_kddi_encoder
};
-void
-Init_emoji_iso2022_kddi(void)
+TRANS_INIT(emoji_iso2022_kddi)
{
rb_register_transcoder(&rb_iso2022jp_kddi_decoder);
rb_register_transcoder(&rb_iso2022jp_kddi_encoder);
diff --git a/enc/trans/emoji_sjis_docomo.trans b/enc/trans/emoji_sjis_docomo.trans
index 36e6e20339..5dd9c7a1e3 100644
--- a/enc/trans/emoji_sjis_docomo.trans
+++ b/enc/trans/emoji_sjis_docomo.trans
@@ -26,8 +26,7 @@
<%= transcode_generated_code %>
-void
-Init_emoji_sjis_docomo(void)
+TRANS_INIT(emoji_sjis_docomo)
{
<%= transcode_register_code %>
}
diff --git a/enc/trans/emoji_sjis_kddi.trans b/enc/trans/emoji_sjis_kddi.trans
index 654bed134e..6df62f14d1 100644
--- a/enc/trans/emoji_sjis_kddi.trans
+++ b/enc/trans/emoji_sjis_kddi.trans
@@ -27,8 +27,7 @@
<%= transcode_generated_code %>
-void
-Init_emoji_sjis_kddi(void)
+TRANS_INIT(emoji_sjis_kddi)
{
<%= transcode_register_code %>
}
diff --git a/enc/trans/emoji_sjis_softbank.trans b/enc/trans/emoji_sjis_softbank.trans
index c152d99c76..c520035347 100644
--- a/enc/trans/emoji_sjis_softbank.trans
+++ b/enc/trans/emoji_sjis_softbank.trans
@@ -26,8 +26,7 @@
<%= transcode_generated_code %>
-void
-Init_emoji_sjis_softbank(void)
+TRANS_INIT(emoji_sjis_softbank)
{
<%= transcode_register_code %>
}
diff --git a/enc/trans/escape.trans b/enc/trans/escape.trans
index a2fbebac33..550e4ac767 100644
--- a/enc/trans/escape.trans
+++ b/enc/trans/escape.trans
@@ -85,8 +85,7 @@ rb_escape_xml_attr_quote = {
escape_xml_attr_quote_finish
};
-void
-Init_escape(void)
+TRANS_INIT(escape)
{
<%= transcode_register_code %>
rb_register_transcoder(&rb_escape_xml_attr_quote);
diff --git a/enc/trans/gb18030.trans b/enc/trans/gb18030.trans
index c7da4c64b4..94c866eb39 100644
--- a/enc/trans/gb18030.trans
+++ b/enc/trans/gb18030.trans
@@ -176,8 +176,7 @@ rb_to_GB18030 = {
};
-void
-Init_gb18030(void)
+TRANS_INIT(gb18030)
{
rb_register_transcoder(&rb_from_GB18030);
rb_register_transcoder(&rb_to_GB18030);
diff --git a/enc/trans/gbk.trans b/enc/trans/gbk.trans
index 0df148198e..3c2cf0c1af 100644
--- a/enc/trans/gbk.trans
+++ b/enc/trans/gbk.trans
@@ -9,8 +9,7 @@
<%= transcode_generated_code %>
-void
-Init_gbk(void)
+TRANS_INIT(gbk)
{
<%= transcode_register_code %>
}
diff --git a/enc/trans/iso-8859-16-tbl.rb b/enc/trans/iso-8859-16-tbl.rb
new file mode 100644
index 0000000000..27f1e49935
--- /dev/null
+++ b/enc/trans/iso-8859-16-tbl.rb
@@ -0,0 +1,98 @@
+ISO_8859_16_TO_UCS_TBL = [
+ ["A0", 0x00A0],
+ ["A1", 0x0104],
+ ["A2", 0x0105],
+ ["A3", 0x0141],
+ ["A4", 0x20AC],
+ ["A5", 0x201E],
+ ["A6", 0x0160],
+ ["A7", 0x00A7],
+ ["A8", 0x0161],
+ ["A9", 0x00A9],
+ ["AA", 0x0218],
+ ["AB", 0x00AB],
+ ["AC", 0x0179],
+ ["AD", 0x00AD],
+ ["AE", 0x017A],
+ ["AF", 0x017B],
+ ["B0", 0x00B0],
+ ["B1", 0x00B1],
+ ["B2", 0x010C],
+ ["B3", 0x0142],
+ ["B4", 0x017D],
+ ["B5", 0x201D],
+ ["B6", 0x00B6],
+ ["B7", 0x00B7],
+ ["B8", 0x017E],
+ ["B9", 0x010D],
+ ["BA", 0x0219],
+ ["BB", 0x00BB],
+ ["BC", 0x0152],
+ ["BD", 0x0153],
+ ["BE", 0x0178],
+ ["BF", 0x017C],
+ ["C0", 0x00C0],
+ ["C1", 0x00C1],
+ ["C2", 0x00C2],
+ ["C3", 0x0102],
+ ["C4", 0x00C4],
+ ["C5", 0x0106],
+ ["C6", 0x00C6],
+ ["C7", 0x00C7],
+ ["C8", 0x00C8],
+ ["C9", 0x00C9],
+ ["CA", 0x00CA],
+ ["CB", 0x00CB],
+ ["CC", 0x00CC],
+ ["CD", 0x00CD],
+ ["CE", 0x00CE],
+ ["CF", 0x00CF],
+ ["D0", 0x0110],
+ ["D1", 0x0143],
+ ["D2", 0x00D2],
+ ["D3", 0x00D3],
+ ["D4", 0x00D4],
+ ["D5", 0x0150],
+ ["D6", 0x00D6],
+ ["D7", 0x015A],
+ ["D8", 0x0170],
+ ["D9", 0x00D9],
+ ["DA", 0x00DA],
+ ["DB", 0x00DB],
+ ["DC", 0x00DC],
+ ["DD", 0x0118],
+ ["DE", 0x021A],
+ ["DF", 0x00DF],
+ ["E0", 0x00E0],
+ ["E1", 0x00E1],
+ ["E2", 0x00E2],
+ ["E3", 0x0103],
+ ["E4", 0x00E4],
+ ["E5", 0x0107],
+ ["E6", 0x00E6],
+ ["E7", 0x00E7],
+ ["E8", 0x00E8],
+ ["E9", 0x00E9],
+ ["EA", 0x00EA],
+ ["EB", 0x00EB],
+ ["EC", 0x00EC],
+ ["ED", 0x00ED],
+ ["EE", 0x00EE],
+ ["EF", 0x00EF],
+ ["F0", 0x0111],
+ ["F1", 0x0144],
+ ["F2", 0x00F2],
+ ["F3", 0x00F3],
+ ["F4", 0x00F4],
+ ["F5", 0x0151],
+ ["F6", 0x00F6],
+ ["F7", 0x015B],
+ ["F8", 0x0171],
+ ["F9", 0x00F9],
+ ["FA", 0x00FA],
+ ["FB", 0x00FB],
+ ["FC", 0x00FC],
+ ["FD", 0x0119],
+ ["FE", 0x021B],
+ ["FF", 0x00FF],
+]
diff --git a/enc/trans/iso2022.trans b/enc/trans/iso2022.trans
index 3f40cce3c8..a441f1596d 100644
--- a/enc/trans/iso2022.trans
+++ b/enc/trans/iso2022.trans
@@ -553,8 +553,7 @@ rb_cp50220_encoder = {
iso2022jp_encoder_reset_sequence_size, finish_cp50220_encoder
};
-void
-Init_iso2022(void)
+TRANS_INIT(iso2022)
{
rb_register_transcoder(&rb_iso2022jp_decoder);
rb_register_transcoder(&rb_iso2022jp_encoder);
diff --git a/enc/trans/japanese.trans b/enc/trans/japanese.trans
index ce5d0bb70f..7ff024fa8d 100644
--- a/enc/trans/japanese.trans
+++ b/enc/trans/japanese.trans
@@ -90,8 +90,7 @@ rb_sjis2eucjp = {
NULL, NULL, NULL, fun_so_sjis2eucjp
};
-void
-Init_japanese(void)
+TRANS_INIT(japanese)
{
rb_register_transcoder(&rb_eucjp2sjis);
rb_register_transcoder(&rb_sjis2eucjp);
diff --git a/enc/trans/japanese_euc.trans b/enc/trans/japanese_euc.trans
index a976fe57d3..0f63272321 100644
--- a/enc/trans/japanese_euc.trans
+++ b/enc/trans/japanese_euc.trans
@@ -18,6 +18,12 @@
citrus_decode_mapsrc("euc", 0x8080, "JISX0208VDC:NEC/UCS,CP932VDC:NEC_IBM/UCS,JISX0208:MS/UCS") +
citrus_decode_mapsrc("euc", 0x0080, "JISX0201-KANA/UCS")
+ transcode_tblgen "EUC-JP-2004", "UTF-8",
+ [["{00-7f}", :nomap]] +
+ citrus_decode_mapsrc("euc", 0x8080, "JISX0208:1990/UCS,JISX0213-1/UCS@BMP,JISX0213-1/UCS@SIP") +
+ citrus_decode_mapsrc("euc", 0x0080, "JISX0201-KANA/UCS") +
+ citrus_decode_mapsrc("euc", 0x8000, "JISX0213-2/UCS@BMP,JISX0213-2/UCS@SIP")
+
transcode_tblgen "UTF-8", "EUC-JP",
[["{00-7f}", :nomap]] +
@@ -35,12 +41,17 @@
[["{00-7f}", :nomap]] +
citrus_decode_mapsrc("euc", 0x8080, "UCS/JISX0208:MS,UCS/JISX0208VDC:NEC,UCS/CP932VDC:NEC_IBM") +
citrus_decode_mapsrc("euc", 0x0080, "UCS/JISX0201-KANA")
+
+ transcode_tblgen "UTF-8", "EUC-JP-2004",
+ [["{00-7f}", :nomap]] +
+ citrus_decode_mapsrc("euc", 0x8080, "UCS/JISX0208:1990,UCS@BMP/JISX0213-1,UCS@SIP/JISX0213-1") +
+ citrus_decode_mapsrc("euc", 0x0080, "UCS/JISX0201-KANA") +
+ citrus_decode_mapsrc("euc", 0x8000, "UCS@BMP/JISX0213-2,UCS@SIP/JISX0213-2")
%>
<%= transcode_generated_code %>
-void
-Init_japanese_euc(void)
+TRANS_INIT(japanese_euc)
{
<%= transcode_register_code %>
}
diff --git a/enc/trans/japanese_sjis.trans b/enc/trans/japanese_sjis.trans
index 00eace27a3..8e1e13056d 100644
--- a/enc/trans/japanese_sjis.trans
+++ b/enc/trans/japanese_sjis.trans
@@ -27,8 +27,7 @@
<%= transcode_generated_code %>
-void
-Init_japanese_sjis(void)
+TRANS_INIT(japanese_sjis)
{
<%= transcode_register_code %>
}
diff --git a/enc/trans/korean.trans b/enc/trans/korean.trans
index ef1cdfcb8e..fda1a3eeda 100644
--- a/enc/trans/korean.trans
+++ b/enc/trans/korean.trans
@@ -12,8 +12,7 @@
<%= transcode_generated_code %>
-void
-Init_korean(void)
+TRANS_INIT(korean)
{
<%= transcode_register_code %>
}
diff --git a/enc/trans/single_byte.trans b/enc/trans/single_byte.trans
index 1bf1001720..50f568cb94 100644
--- a/enc/trans/single_byte.trans
+++ b/enc/trans/single_byte.trans
@@ -43,6 +43,7 @@
transcode_tblgen_singlebyte "ISO-8859-13"
transcode_tblgen_singlebyte "ISO-8859-14"
transcode_tblgen_singlebyte "ISO-8859-15"
+ transcode_tblgen_singlebyte "ISO-8859-16"
transcode_tblgen_singlebyte "WINDOWS-874"
transcode_tblgen_singlebyte "WINDOWS-1250"
transcode_tblgen_singlebyte "WINDOWS-1251"
@@ -83,8 +84,7 @@
<%= transcode_generated_code %>
-void
-Init_single_byte(void)
+TRANS_INIT(single_byte)
{
<%= transcode_register_code %>
}
diff --git a/enc/trans/utf8_mac.trans b/enc/trans/utf8_mac.trans
index 8ea0afd73f..11ce35e212 100644
--- a/enc/trans/utf8_mac.trans
+++ b/enc/trans/utf8_mac.trans
@@ -233,8 +233,7 @@ rb_from_UTF8_MAC = {
from_utf8_mac_finish
};
-void
-Init_utf8_mac(void)
+TRANS_INIT(utf8_mac)
{
<%= transcode_register_code %>
rb_register_transcoder(&rb_from_UTF8_MAC);
diff --git a/enc/trans/utf_16_32.trans b/enc/trans/utf_16_32.trans
index c841df035f..632c8808ef 100644
--- a/enc/trans/utf_16_32.trans
+++ b/enc/trans/utf_16_32.trans
@@ -539,8 +539,7 @@ rb_to_UTF_32 = {
NULL, NULL, NULL, fun_so_to_utf_32
};
-void
-Init_utf_16_32(void)
+TRANS_INIT(utf_16_32)
{
rb_register_transcoder(&rb_from_UTF_16BE);
rb_register_transcoder(&rb_to_UTF_16BE);
diff --git a/enc/unicode.c b/enc/unicode.c
index beb5fa39f0..20990c1e54 100644
--- a/enc/unicode.c
+++ b/enc/unicode.c
@@ -38,7 +38,7 @@
static const unsigned short EncUNICODE_ISO_8859_1_CtypeTable[256] = {
0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,
- 0x4008, 0x428c, 0x4289, 0x4288, 0x4288, 0x4288, 0x4008, 0x4008,
+ 0x4008, 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008,
0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,
0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,
0x4284, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,
@@ -103,1937 +103,8 @@ typedef struct {
CodePointList2 to;
} CaseUnfold_13_Type;
-static const CaseFold_11_Type CaseFold[] = {
- { 0x0041, {1, {0x0061}}},
- { 0x0042, {1, {0x0062}}},
- { 0x0043, {1, {0x0063}}},
- { 0x0044, {1, {0x0064}}},
- { 0x0045, {1, {0x0065}}},
- { 0x0046, {1, {0x0066}}},
- { 0x0047, {1, {0x0067}}},
- { 0x0048, {1, {0x0068}}},
- { 0x004a, {1, {0x006a}}},
- { 0x004b, {1, {0x006b}}},
- { 0x004c, {1, {0x006c}}},
- { 0x004d, {1, {0x006d}}},
- { 0x004e, {1, {0x006e}}},
- { 0x004f, {1, {0x006f}}},
- { 0x0050, {1, {0x0070}}},
- { 0x0051, {1, {0x0071}}},
- { 0x0052, {1, {0x0072}}},
- { 0x0053, {1, {0x0073}}},
- { 0x0054, {1, {0x0074}}},
- { 0x0055, {1, {0x0075}}},
- { 0x0056, {1, {0x0076}}},
- { 0x0057, {1, {0x0077}}},
- { 0x0058, {1, {0x0078}}},
- { 0x0059, {1, {0x0079}}},
- { 0x005a, {1, {0x007a}}},
- { 0x00b5, {1, {0x03bc}}},
- { 0x00c0, {1, {0x00e0}}},
- { 0x00c1, {1, {0x00e1}}},
- { 0x00c2, {1, {0x00e2}}},
- { 0x00c3, {1, {0x00e3}}},
- { 0x00c4, {1, {0x00e4}}},
- { 0x00c5, {1, {0x00e5}}},
- { 0x00c6, {1, {0x00e6}}},
- { 0x00c7, {1, {0x00e7}}},
- { 0x00c8, {1, {0x00e8}}},
- { 0x00c9, {1, {0x00e9}}},
- { 0x00ca, {1, {0x00ea}}},
- { 0x00cb, {1, {0x00eb}}},
- { 0x00cc, {1, {0x00ec}}},
- { 0x00cd, {1, {0x00ed}}},
- { 0x00ce, {1, {0x00ee}}},
- { 0x00cf, {1, {0x00ef}}},
- { 0x00d0, {1, {0x00f0}}},
- { 0x00d1, {1, {0x00f1}}},
- { 0x00d2, {1, {0x00f2}}},
- { 0x00d3, {1, {0x00f3}}},
- { 0x00d4, {1, {0x00f4}}},
- { 0x00d5, {1, {0x00f5}}},
- { 0x00d6, {1, {0x00f6}}},
- { 0x00d8, {1, {0x00f8}}},
- { 0x00d9, {1, {0x00f9}}},
- { 0x00da, {1, {0x00fa}}},
- { 0x00db, {1, {0x00fb}}},
- { 0x00dc, {1, {0x00fc}}},
- { 0x00dd, {1, {0x00fd}}},
- { 0x00de, {1, {0x00fe}}},
- { 0x00df, {2, {0x0073, 0x0073}}},
- { 0x0100, {1, {0x0101}}},
- { 0x0102, {1, {0x0103}}},
- { 0x0104, {1, {0x0105}}},
- { 0x0106, {1, {0x0107}}},
- { 0x0108, {1, {0x0109}}},
- { 0x010a, {1, {0x010b}}},
- { 0x010c, {1, {0x010d}}},
- { 0x010e, {1, {0x010f}}},
- { 0x0110, {1, {0x0111}}},
- { 0x0112, {1, {0x0113}}},
- { 0x0114, {1, {0x0115}}},
- { 0x0116, {1, {0x0117}}},
- { 0x0118, {1, {0x0119}}},
- { 0x011a, {1, {0x011b}}},
- { 0x011c, {1, {0x011d}}},
- { 0x011e, {1, {0x011f}}},
- { 0x0120, {1, {0x0121}}},
- { 0x0122, {1, {0x0123}}},
- { 0x0124, {1, {0x0125}}},
- { 0x0126, {1, {0x0127}}},
- { 0x0128, {1, {0x0129}}},
- { 0x012a, {1, {0x012b}}},
- { 0x012c, {1, {0x012d}}},
- { 0x012e, {1, {0x012f}}},
- { 0x0132, {1, {0x0133}}},
- { 0x0134, {1, {0x0135}}},
- { 0x0136, {1, {0x0137}}},
- { 0x0139, {1, {0x013a}}},
- { 0x013b, {1, {0x013c}}},
- { 0x013d, {1, {0x013e}}},
- { 0x013f, {1, {0x0140}}},
- { 0x0141, {1, {0x0142}}},
- { 0x0143, {1, {0x0144}}},
- { 0x0145, {1, {0x0146}}},
- { 0x0147, {1, {0x0148}}},
- { 0x0149, {2, {0x02bc, 0x006e}}},
- { 0x014a, {1, {0x014b}}},
- { 0x014c, {1, {0x014d}}},
- { 0x014e, {1, {0x014f}}},
- { 0x0150, {1, {0x0151}}},
- { 0x0152, {1, {0x0153}}},
- { 0x0154, {1, {0x0155}}},
- { 0x0156, {1, {0x0157}}},
- { 0x0158, {1, {0x0159}}},
- { 0x015a, {1, {0x015b}}},
- { 0x015c, {1, {0x015d}}},
- { 0x015e, {1, {0x015f}}},
- { 0x0160, {1, {0x0161}}},
- { 0x0162, {1, {0x0163}}},
- { 0x0164, {1, {0x0165}}},
- { 0x0166, {1, {0x0167}}},
- { 0x0168, {1, {0x0169}}},
- { 0x016a, {1, {0x016b}}},
- { 0x016c, {1, {0x016d}}},
- { 0x016e, {1, {0x016f}}},
- { 0x0170, {1, {0x0171}}},
- { 0x0172, {1, {0x0173}}},
- { 0x0174, {1, {0x0175}}},
- { 0x0176, {1, {0x0177}}},
- { 0x0178, {1, {0x00ff}}},
- { 0x0179, {1, {0x017a}}},
- { 0x017b, {1, {0x017c}}},
- { 0x017d, {1, {0x017e}}},
- { 0x017f, {1, {0x0073}}},
- { 0x0181, {1, {0x0253}}},
- { 0x0182, {1, {0x0183}}},
- { 0x0184, {1, {0x0185}}},
- { 0x0186, {1, {0x0254}}},
- { 0x0187, {1, {0x0188}}},
- { 0x0189, {1, {0x0256}}},
- { 0x018a, {1, {0x0257}}},
- { 0x018b, {1, {0x018c}}},
- { 0x018e, {1, {0x01dd}}},
- { 0x018f, {1, {0x0259}}},
- { 0x0190, {1, {0x025b}}},
- { 0x0191, {1, {0x0192}}},
- { 0x0193, {1, {0x0260}}},
- { 0x0194, {1, {0x0263}}},
- { 0x0196, {1, {0x0269}}},
- { 0x0197, {1, {0x0268}}},
- { 0x0198, {1, {0x0199}}},
- { 0x019c, {1, {0x026f}}},
- { 0x019d, {1, {0x0272}}},
- { 0x019f, {1, {0x0275}}},
- { 0x01a0, {1, {0x01a1}}},
- { 0x01a2, {1, {0x01a3}}},
- { 0x01a4, {1, {0x01a5}}},
- { 0x01a6, {1, {0x0280}}},
- { 0x01a7, {1, {0x01a8}}},
- { 0x01a9, {1, {0x0283}}},
- { 0x01ac, {1, {0x01ad}}},
- { 0x01ae, {1, {0x0288}}},
- { 0x01af, {1, {0x01b0}}},
- { 0x01b1, {1, {0x028a}}},
- { 0x01b2, {1, {0x028b}}},
- { 0x01b3, {1, {0x01b4}}},
- { 0x01b5, {1, {0x01b6}}},
- { 0x01b7, {1, {0x0292}}},
- { 0x01b8, {1, {0x01b9}}},
- { 0x01bc, {1, {0x01bd}}},
- { 0x01c4, {1, {0x01c6}}},
- { 0x01c5, {1, {0x01c6}}},
- { 0x01c7, {1, {0x01c9}}},
- { 0x01c8, {1, {0x01c9}}},
- { 0x01ca, {1, {0x01cc}}},
- { 0x01cb, {1, {0x01cc}}},
- { 0x01cd, {1, {0x01ce}}},
- { 0x01cf, {1, {0x01d0}}},
- { 0x01d1, {1, {0x01d2}}},
- { 0x01d3, {1, {0x01d4}}},
- { 0x01d5, {1, {0x01d6}}},
- { 0x01d7, {1, {0x01d8}}},
- { 0x01d9, {1, {0x01da}}},
- { 0x01db, {1, {0x01dc}}},
- { 0x01de, {1, {0x01df}}},
- { 0x01e0, {1, {0x01e1}}},
- { 0x01e2, {1, {0x01e3}}},
- { 0x01e4, {1, {0x01e5}}},
- { 0x01e6, {1, {0x01e7}}},
- { 0x01e8, {1, {0x01e9}}},
- { 0x01ea, {1, {0x01eb}}},
- { 0x01ec, {1, {0x01ed}}},
- { 0x01ee, {1, {0x01ef}}},
- { 0x01f0, {2, {0x006a, 0x030c}}},
- { 0x01f1, {1, {0x01f3}}},
- { 0x01f2, {1, {0x01f3}}},
- { 0x01f4, {1, {0x01f5}}},
- { 0x01f6, {1, {0x0195}}},
- { 0x01f7, {1, {0x01bf}}},
- { 0x01f8, {1, {0x01f9}}},
- { 0x01fa, {1, {0x01fb}}},
- { 0x01fc, {1, {0x01fd}}},
- { 0x01fe, {1, {0x01ff}}},
- { 0x0200, {1, {0x0201}}},
- { 0x0202, {1, {0x0203}}},
- { 0x0204, {1, {0x0205}}},
- { 0x0206, {1, {0x0207}}},
- { 0x0208, {1, {0x0209}}},
- { 0x020a, {1, {0x020b}}},
- { 0x020c, {1, {0x020d}}},
- { 0x020e, {1, {0x020f}}},
- { 0x0210, {1, {0x0211}}},
- { 0x0212, {1, {0x0213}}},
- { 0x0214, {1, {0x0215}}},
- { 0x0216, {1, {0x0217}}},
- { 0x0218, {1, {0x0219}}},
- { 0x021a, {1, {0x021b}}},
- { 0x021c, {1, {0x021d}}},
- { 0x021e, {1, {0x021f}}},
- { 0x0220, {1, {0x019e}}},
- { 0x0222, {1, {0x0223}}},
- { 0x0224, {1, {0x0225}}},
- { 0x0226, {1, {0x0227}}},
- { 0x0228, {1, {0x0229}}},
- { 0x022a, {1, {0x022b}}},
- { 0x022c, {1, {0x022d}}},
- { 0x022e, {1, {0x022f}}},
- { 0x0230, {1, {0x0231}}},
- { 0x0232, {1, {0x0233}}},
- { 0x023b, {1, {0x023c}}},
- { 0x023d, {1, {0x019a}}},
- { 0x0241, {1, {0x0294}}},
- { 0x0345, {1, {0x03b9}}},
- { 0x0386, {1, {0x03ac}}},
- { 0x0388, {1, {0x03ad}}},
- { 0x0389, {1, {0x03ae}}},
- { 0x038a, {1, {0x03af}}},
- { 0x038c, {1, {0x03cc}}},
- { 0x038e, {1, {0x03cd}}},
- { 0x038f, {1, {0x03ce}}},
- { 0x0390, {3, {0x03b9, 0x0308, 0x0301}}},
- { 0x0391, {1, {0x03b1}}},
- { 0x0392, {1, {0x03b2}}},
- { 0x0393, {1, {0x03b3}}},
- { 0x0394, {1, {0x03b4}}},
- { 0x0395, {1, {0x03b5}}},
- { 0x0396, {1, {0x03b6}}},
- { 0x0397, {1, {0x03b7}}},
- { 0x0398, {1, {0x03b8}}},
- { 0x0399, {1, {0x03b9}}},
- { 0x039a, {1, {0x03ba}}},
- { 0x039b, {1, {0x03bb}}},
- { 0x039c, {1, {0x03bc}}},
- { 0x039d, {1, {0x03bd}}},
- { 0x039e, {1, {0x03be}}},
- { 0x039f, {1, {0x03bf}}},
- { 0x03a0, {1, {0x03c0}}},
- { 0x03a1, {1, {0x03c1}}},
- { 0x03a3, {1, {0x03c3}}},
- { 0x03a4, {1, {0x03c4}}},
- { 0x03a5, {1, {0x03c5}}},
- { 0x03a6, {1, {0x03c6}}},
- { 0x03a7, {1, {0x03c7}}},
- { 0x03a8, {1, {0x03c8}}},
- { 0x03a9, {1, {0x03c9}}},
- { 0x03aa, {1, {0x03ca}}},
- { 0x03ab, {1, {0x03cb}}},
- { 0x03b0, {3, {0x03c5, 0x0308, 0x0301}}},
- { 0x03c2, {1, {0x03c3}}},
- { 0x03d0, {1, {0x03b2}}},
- { 0x03d1, {1, {0x03b8}}},
- { 0x03d5, {1, {0x03c6}}},
- { 0x03d6, {1, {0x03c0}}},
- { 0x03d8, {1, {0x03d9}}},
- { 0x03da, {1, {0x03db}}},
- { 0x03dc, {1, {0x03dd}}},
- { 0x03de, {1, {0x03df}}},
- { 0x03e0, {1, {0x03e1}}},
- { 0x03e2, {1, {0x03e3}}},
- { 0x03e4, {1, {0x03e5}}},
- { 0x03e6, {1, {0x03e7}}},
- { 0x03e8, {1, {0x03e9}}},
- { 0x03ea, {1, {0x03eb}}},
- { 0x03ec, {1, {0x03ed}}},
- { 0x03ee, {1, {0x03ef}}},
- { 0x03f0, {1, {0x03ba}}},
- { 0x03f1, {1, {0x03c1}}},
- { 0x03f4, {1, {0x03b8}}},
- { 0x03f5, {1, {0x03b5}}},
- { 0x03f7, {1, {0x03f8}}},
- { 0x03f9, {1, {0x03f2}}},
- { 0x03fa, {1, {0x03fb}}},
- { 0x0400, {1, {0x0450}}},
- { 0x0401, {1, {0x0451}}},
- { 0x0402, {1, {0x0452}}},
- { 0x0403, {1, {0x0453}}},
- { 0x0404, {1, {0x0454}}},
- { 0x0405, {1, {0x0455}}},
- { 0x0406, {1, {0x0456}}},
- { 0x0407, {1, {0x0457}}},
- { 0x0408, {1, {0x0458}}},
- { 0x0409, {1, {0x0459}}},
- { 0x040a, {1, {0x045a}}},
- { 0x040b, {1, {0x045b}}},
- { 0x040c, {1, {0x045c}}},
- { 0x040d, {1, {0x045d}}},
- { 0x040e, {1, {0x045e}}},
- { 0x040f, {1, {0x045f}}},
- { 0x0410, {1, {0x0430}}},
- { 0x0411, {1, {0x0431}}},
- { 0x0412, {1, {0x0432}}},
- { 0x0413, {1, {0x0433}}},
- { 0x0414, {1, {0x0434}}},
- { 0x0415, {1, {0x0435}}},
- { 0x0416, {1, {0x0436}}},
- { 0x0417, {1, {0x0437}}},
- { 0x0418, {1, {0x0438}}},
- { 0x0419, {1, {0x0439}}},
- { 0x041a, {1, {0x043a}}},
- { 0x041b, {1, {0x043b}}},
- { 0x041c, {1, {0x043c}}},
- { 0x041d, {1, {0x043d}}},
- { 0x041e, {1, {0x043e}}},
- { 0x041f, {1, {0x043f}}},
- { 0x0420, {1, {0x0440}}},
- { 0x0421, {1, {0x0441}}},
- { 0x0422, {1, {0x0442}}},
- { 0x0423, {1, {0x0443}}},
- { 0x0424, {1, {0x0444}}},
- { 0x0425, {1, {0x0445}}},
- { 0x0426, {1, {0x0446}}},
- { 0x0427, {1, {0x0447}}},
- { 0x0428, {1, {0x0448}}},
- { 0x0429, {1, {0x0449}}},
- { 0x042a, {1, {0x044a}}},
- { 0x042b, {1, {0x044b}}},
- { 0x042c, {1, {0x044c}}},
- { 0x042d, {1, {0x044d}}},
- { 0x042e, {1, {0x044e}}},
- { 0x042f, {1, {0x044f}}},
- { 0x0460, {1, {0x0461}}},
- { 0x0462, {1, {0x0463}}},
- { 0x0464, {1, {0x0465}}},
- { 0x0466, {1, {0x0467}}},
- { 0x0468, {1, {0x0469}}},
- { 0x046a, {1, {0x046b}}},
- { 0x046c, {1, {0x046d}}},
- { 0x046e, {1, {0x046f}}},
- { 0x0470, {1, {0x0471}}},
- { 0x0472, {1, {0x0473}}},
- { 0x0474, {1, {0x0475}}},
- { 0x0476, {1, {0x0477}}},
- { 0x0478, {1, {0x0479}}},
- { 0x047a, {1, {0x047b}}},
- { 0x047c, {1, {0x047d}}},
- { 0x047e, {1, {0x047f}}},
- { 0x0480, {1, {0x0481}}},
- { 0x048a, {1, {0x048b}}},
- { 0x048c, {1, {0x048d}}},
- { 0x048e, {1, {0x048f}}},
- { 0x0490, {1, {0x0491}}},
- { 0x0492, {1, {0x0493}}},
- { 0x0494, {1, {0x0495}}},
- { 0x0496, {1, {0x0497}}},
- { 0x0498, {1, {0x0499}}},
- { 0x049a, {1, {0x049b}}},
- { 0x049c, {1, {0x049d}}},
- { 0x049e, {1, {0x049f}}},
- { 0x04a0, {1, {0x04a1}}},
- { 0x04a2, {1, {0x04a3}}},
- { 0x04a4, {1, {0x04a5}}},
- { 0x04a6, {1, {0x04a7}}},
- { 0x04a8, {1, {0x04a9}}},
- { 0x04aa, {1, {0x04ab}}},
- { 0x04ac, {1, {0x04ad}}},
- { 0x04ae, {1, {0x04af}}},
- { 0x04b0, {1, {0x04b1}}},
- { 0x04b2, {1, {0x04b3}}},
- { 0x04b4, {1, {0x04b5}}},
- { 0x04b6, {1, {0x04b7}}},
- { 0x04b8, {1, {0x04b9}}},
- { 0x04ba, {1, {0x04bb}}},
- { 0x04bc, {1, {0x04bd}}},
- { 0x04be, {1, {0x04bf}}},
- { 0x04c1, {1, {0x04c2}}},
- { 0x04c3, {1, {0x04c4}}},
- { 0x04c5, {1, {0x04c6}}},
- { 0x04c7, {1, {0x04c8}}},
- { 0x04c9, {1, {0x04ca}}},
- { 0x04cb, {1, {0x04cc}}},
- { 0x04cd, {1, {0x04ce}}},
- { 0x04d0, {1, {0x04d1}}},
- { 0x04d2, {1, {0x04d3}}},
- { 0x04d4, {1, {0x04d5}}},
- { 0x04d6, {1, {0x04d7}}},
- { 0x04d8, {1, {0x04d9}}},
- { 0x04da, {1, {0x04db}}},
- { 0x04dc, {1, {0x04dd}}},
- { 0x04de, {1, {0x04df}}},
- { 0x04e0, {1, {0x04e1}}},
- { 0x04e2, {1, {0x04e3}}},
- { 0x04e4, {1, {0x04e5}}},
- { 0x04e6, {1, {0x04e7}}},
- { 0x04e8, {1, {0x04e9}}},
- { 0x04ea, {1, {0x04eb}}},
- { 0x04ec, {1, {0x04ed}}},
- { 0x04ee, {1, {0x04ef}}},
- { 0x04f0, {1, {0x04f1}}},
- { 0x04f2, {1, {0x04f3}}},
- { 0x04f4, {1, {0x04f5}}},
- { 0x04f6, {1, {0x04f7}}},
- { 0x04f8, {1, {0x04f9}}},
- { 0x0500, {1, {0x0501}}},
- { 0x0502, {1, {0x0503}}},
- { 0x0504, {1, {0x0505}}},
- { 0x0506, {1, {0x0507}}},
- { 0x0508, {1, {0x0509}}},
- { 0x050a, {1, {0x050b}}},
- { 0x050c, {1, {0x050d}}},
- { 0x050e, {1, {0x050f}}},
- { 0x0531, {1, {0x0561}}},
- { 0x0532, {1, {0x0562}}},
- { 0x0533, {1, {0x0563}}},
- { 0x0534, {1, {0x0564}}},
- { 0x0535, {1, {0x0565}}},
- { 0x0536, {1, {0x0566}}},
- { 0x0537, {1, {0x0567}}},
- { 0x0538, {1, {0x0568}}},
- { 0x0539, {1, {0x0569}}},
- { 0x053a, {1, {0x056a}}},
- { 0x053b, {1, {0x056b}}},
- { 0x053c, {1, {0x056c}}},
- { 0x053d, {1, {0x056d}}},
- { 0x053e, {1, {0x056e}}},
- { 0x053f, {1, {0x056f}}},
- { 0x0540, {1, {0x0570}}},
- { 0x0541, {1, {0x0571}}},
- { 0x0542, {1, {0x0572}}},
- { 0x0543, {1, {0x0573}}},
- { 0x0544, {1, {0x0574}}},
- { 0x0545, {1, {0x0575}}},
- { 0x0546, {1, {0x0576}}},
- { 0x0547, {1, {0x0577}}},
- { 0x0548, {1, {0x0578}}},
- { 0x0549, {1, {0x0579}}},
- { 0x054a, {1, {0x057a}}},
- { 0x054b, {1, {0x057b}}},
- { 0x054c, {1, {0x057c}}},
- { 0x054d, {1, {0x057d}}},
- { 0x054e, {1, {0x057e}}},
- { 0x054f, {1, {0x057f}}},
- { 0x0550, {1, {0x0580}}},
- { 0x0551, {1, {0x0581}}},
- { 0x0552, {1, {0x0582}}},
- { 0x0553, {1, {0x0583}}},
- { 0x0554, {1, {0x0584}}},
- { 0x0555, {1, {0x0585}}},
- { 0x0556, {1, {0x0586}}},
- { 0x0587, {2, {0x0565, 0x0582}}},
- { 0x10a0, {1, {0x2d00}}},
- { 0x10a1, {1, {0x2d01}}},
- { 0x10a2, {1, {0x2d02}}},
- { 0x10a3, {1, {0x2d03}}},
- { 0x10a4, {1, {0x2d04}}},
- { 0x10a5, {1, {0x2d05}}},
- { 0x10a6, {1, {0x2d06}}},
- { 0x10a7, {1, {0x2d07}}},
- { 0x10a8, {1, {0x2d08}}},
- { 0x10a9, {1, {0x2d09}}},
- { 0x10aa, {1, {0x2d0a}}},
- { 0x10ab, {1, {0x2d0b}}},
- { 0x10ac, {1, {0x2d0c}}},
- { 0x10ad, {1, {0x2d0d}}},
- { 0x10ae, {1, {0x2d0e}}},
- { 0x10af, {1, {0x2d0f}}},
- { 0x10b0, {1, {0x2d10}}},
- { 0x10b1, {1, {0x2d11}}},
- { 0x10b2, {1, {0x2d12}}},
- { 0x10b3, {1, {0x2d13}}},
- { 0x10b4, {1, {0x2d14}}},
- { 0x10b5, {1, {0x2d15}}},
- { 0x10b6, {1, {0x2d16}}},
- { 0x10b7, {1, {0x2d17}}},
- { 0x10b8, {1, {0x2d18}}},
- { 0x10b9, {1, {0x2d19}}},
- { 0x10ba, {1, {0x2d1a}}},
- { 0x10bb, {1, {0x2d1b}}},
- { 0x10bc, {1, {0x2d1c}}},
- { 0x10bd, {1, {0x2d1d}}},
- { 0x10be, {1, {0x2d1e}}},
- { 0x10bf, {1, {0x2d1f}}},
- { 0x10c0, {1, {0x2d20}}},
- { 0x10c1, {1, {0x2d21}}},
- { 0x10c2, {1, {0x2d22}}},
- { 0x10c3, {1, {0x2d23}}},
- { 0x10c4, {1, {0x2d24}}},
- { 0x10c5, {1, {0x2d25}}},
- { 0x1e00, {1, {0x1e01}}},
- { 0x1e02, {1, {0x1e03}}},
- { 0x1e04, {1, {0x1e05}}},
- { 0x1e06, {1, {0x1e07}}},
- { 0x1e08, {1, {0x1e09}}},
- { 0x1e0a, {1, {0x1e0b}}},
- { 0x1e0c, {1, {0x1e0d}}},
- { 0x1e0e, {1, {0x1e0f}}},
- { 0x1e10, {1, {0x1e11}}},
- { 0x1e12, {1, {0x1e13}}},
- { 0x1e14, {1, {0x1e15}}},
- { 0x1e16, {1, {0x1e17}}},
- { 0x1e18, {1, {0x1e19}}},
- { 0x1e1a, {1, {0x1e1b}}},
- { 0x1e1c, {1, {0x1e1d}}},
- { 0x1e1e, {1, {0x1e1f}}},
- { 0x1e20, {1, {0x1e21}}},
- { 0x1e22, {1, {0x1e23}}},
- { 0x1e24, {1, {0x1e25}}},
- { 0x1e26, {1, {0x1e27}}},
- { 0x1e28, {1, {0x1e29}}},
- { 0x1e2a, {1, {0x1e2b}}},
- { 0x1e2c, {1, {0x1e2d}}},
- { 0x1e2e, {1, {0x1e2f}}},
- { 0x1e30, {1, {0x1e31}}},
- { 0x1e32, {1, {0x1e33}}},
- { 0x1e34, {1, {0x1e35}}},
- { 0x1e36, {1, {0x1e37}}},
- { 0x1e38, {1, {0x1e39}}},
- { 0x1e3a, {1, {0x1e3b}}},
- { 0x1e3c, {1, {0x1e3d}}},
- { 0x1e3e, {1, {0x1e3f}}},
- { 0x1e40, {1, {0x1e41}}},
- { 0x1e42, {1, {0x1e43}}},
- { 0x1e44, {1, {0x1e45}}},
- { 0x1e46, {1, {0x1e47}}},
- { 0x1e48, {1, {0x1e49}}},
- { 0x1e4a, {1, {0x1e4b}}},
- { 0x1e4c, {1, {0x1e4d}}},
- { 0x1e4e, {1, {0x1e4f}}},
- { 0x1e50, {1, {0x1e51}}},
- { 0x1e52, {1, {0x1e53}}},
- { 0x1e54, {1, {0x1e55}}},
- { 0x1e56, {1, {0x1e57}}},
- { 0x1e58, {1, {0x1e59}}},
- { 0x1e5a, {1, {0x1e5b}}},
- { 0x1e5c, {1, {0x1e5d}}},
- { 0x1e5e, {1, {0x1e5f}}},
- { 0x1e60, {1, {0x1e61}}},
- { 0x1e62, {1, {0x1e63}}},
- { 0x1e64, {1, {0x1e65}}},
- { 0x1e66, {1, {0x1e67}}},
- { 0x1e68, {1, {0x1e69}}},
- { 0x1e6a, {1, {0x1e6b}}},
- { 0x1e6c, {1, {0x1e6d}}},
- { 0x1e6e, {1, {0x1e6f}}},
- { 0x1e70, {1, {0x1e71}}},
- { 0x1e72, {1, {0x1e73}}},
- { 0x1e74, {1, {0x1e75}}},
- { 0x1e76, {1, {0x1e77}}},
- { 0x1e78, {1, {0x1e79}}},
- { 0x1e7a, {1, {0x1e7b}}},
- { 0x1e7c, {1, {0x1e7d}}},
- { 0x1e7e, {1, {0x1e7f}}},
- { 0x1e80, {1, {0x1e81}}},
- { 0x1e82, {1, {0x1e83}}},
- { 0x1e84, {1, {0x1e85}}},
- { 0x1e86, {1, {0x1e87}}},
- { 0x1e88, {1, {0x1e89}}},
- { 0x1e8a, {1, {0x1e8b}}},
- { 0x1e8c, {1, {0x1e8d}}},
- { 0x1e8e, {1, {0x1e8f}}},
- { 0x1e90, {1, {0x1e91}}},
- { 0x1e92, {1, {0x1e93}}},
- { 0x1e94, {1, {0x1e95}}},
- { 0x1e96, {2, {0x0068, 0x0331}}},
- { 0x1e97, {2, {0x0074, 0x0308}}},
- { 0x1e98, {2, {0x0077, 0x030a}}},
- { 0x1e99, {2, {0x0079, 0x030a}}},
- { 0x1e9a, {2, {0x0061, 0x02be}}},
- { 0x1e9b, {1, {0x1e61}}},
- { 0x1ea0, {1, {0x1ea1}}},
- { 0x1ea2, {1, {0x1ea3}}},
- { 0x1ea4, {1, {0x1ea5}}},
- { 0x1ea6, {1, {0x1ea7}}},
- { 0x1ea8, {1, {0x1ea9}}},
- { 0x1eaa, {1, {0x1eab}}},
- { 0x1eac, {1, {0x1ead}}},
- { 0x1eae, {1, {0x1eaf}}},
- { 0x1eb0, {1, {0x1eb1}}},
- { 0x1eb2, {1, {0x1eb3}}},
- { 0x1eb4, {1, {0x1eb5}}},
- { 0x1eb6, {1, {0x1eb7}}},
- { 0x1eb8, {1, {0x1eb9}}},
- { 0x1eba, {1, {0x1ebb}}},
- { 0x1ebc, {1, {0x1ebd}}},
- { 0x1ebe, {1, {0x1ebf}}},
- { 0x1ec0, {1, {0x1ec1}}},
- { 0x1ec2, {1, {0x1ec3}}},
- { 0x1ec4, {1, {0x1ec5}}},
- { 0x1ec6, {1, {0x1ec7}}},
- { 0x1ec8, {1, {0x1ec9}}},
- { 0x1eca, {1, {0x1ecb}}},
- { 0x1ecc, {1, {0x1ecd}}},
- { 0x1ece, {1, {0x1ecf}}},
- { 0x1ed0, {1, {0x1ed1}}},
- { 0x1ed2, {1, {0x1ed3}}},
- { 0x1ed4, {1, {0x1ed5}}},
- { 0x1ed6, {1, {0x1ed7}}},
- { 0x1ed8, {1, {0x1ed9}}},
- { 0x1eda, {1, {0x1edb}}},
- { 0x1edc, {1, {0x1edd}}},
- { 0x1ede, {1, {0x1edf}}},
- { 0x1ee0, {1, {0x1ee1}}},
- { 0x1ee2, {1, {0x1ee3}}},
- { 0x1ee4, {1, {0x1ee5}}},
- { 0x1ee6, {1, {0x1ee7}}},
- { 0x1ee8, {1, {0x1ee9}}},
- { 0x1eea, {1, {0x1eeb}}},
- { 0x1eec, {1, {0x1eed}}},
- { 0x1eee, {1, {0x1eef}}},
- { 0x1ef0, {1, {0x1ef1}}},
- { 0x1ef2, {1, {0x1ef3}}},
- { 0x1ef4, {1, {0x1ef5}}},
- { 0x1ef6, {1, {0x1ef7}}},
- { 0x1ef8, {1, {0x1ef9}}},
- { 0x1f08, {1, {0x1f00}}},
- { 0x1f09, {1, {0x1f01}}},
- { 0x1f0a, {1, {0x1f02}}},
- { 0x1f0b, {1, {0x1f03}}},
- { 0x1f0c, {1, {0x1f04}}},
- { 0x1f0d, {1, {0x1f05}}},
- { 0x1f0e, {1, {0x1f06}}},
- { 0x1f0f, {1, {0x1f07}}},
- { 0x1f18, {1, {0x1f10}}},
- { 0x1f19, {1, {0x1f11}}},
- { 0x1f1a, {1, {0x1f12}}},
- { 0x1f1b, {1, {0x1f13}}},
- { 0x1f1c, {1, {0x1f14}}},
- { 0x1f1d, {1, {0x1f15}}},
- { 0x1f28, {1, {0x1f20}}},
- { 0x1f29, {1, {0x1f21}}},
- { 0x1f2a, {1, {0x1f22}}},
- { 0x1f2b, {1, {0x1f23}}},
- { 0x1f2c, {1, {0x1f24}}},
- { 0x1f2d, {1, {0x1f25}}},
- { 0x1f2e, {1, {0x1f26}}},
- { 0x1f2f, {1, {0x1f27}}},
- { 0x1f38, {1, {0x1f30}}},
- { 0x1f39, {1, {0x1f31}}},
- { 0x1f3a, {1, {0x1f32}}},
- { 0x1f3b, {1, {0x1f33}}},
- { 0x1f3c, {1, {0x1f34}}},
- { 0x1f3d, {1, {0x1f35}}},
- { 0x1f3e, {1, {0x1f36}}},
- { 0x1f3f, {1, {0x1f37}}},
- { 0x1f48, {1, {0x1f40}}},
- { 0x1f49, {1, {0x1f41}}},
- { 0x1f4a, {1, {0x1f42}}},
- { 0x1f4b, {1, {0x1f43}}},
- { 0x1f4c, {1, {0x1f44}}},
- { 0x1f4d, {1, {0x1f45}}},
- { 0x1f50, {2, {0x03c5, 0x0313}}},
- { 0x1f52, {3, {0x03c5, 0x0313, 0x0300}}},
- { 0x1f54, {3, {0x03c5, 0x0313, 0x0301}}},
- { 0x1f56, {3, {0x03c5, 0x0313, 0x0342}}},
- { 0x1f59, {1, {0x1f51}}},
- { 0x1f5b, {1, {0x1f53}}},
- { 0x1f5d, {1, {0x1f55}}},
- { 0x1f5f, {1, {0x1f57}}},
- { 0x1f68, {1, {0x1f60}}},
- { 0x1f69, {1, {0x1f61}}},
- { 0x1f6a, {1, {0x1f62}}},
- { 0x1f6b, {1, {0x1f63}}},
- { 0x1f6c, {1, {0x1f64}}},
- { 0x1f6d, {1, {0x1f65}}},
- { 0x1f6e, {1, {0x1f66}}},
- { 0x1f6f, {1, {0x1f67}}},
- { 0x1f80, {2, {0x1f00, 0x03b9}}},
- { 0x1f81, {2, {0x1f01, 0x03b9}}},
- { 0x1f82, {2, {0x1f02, 0x03b9}}},
- { 0x1f83, {2, {0x1f03, 0x03b9}}},
- { 0x1f84, {2, {0x1f04, 0x03b9}}},
- { 0x1f85, {2, {0x1f05, 0x03b9}}},
- { 0x1f86, {2, {0x1f06, 0x03b9}}},
- { 0x1f87, {2, {0x1f07, 0x03b9}}},
- { 0x1f88, {2, {0x1f00, 0x03b9}}},
- { 0x1f89, {2, {0x1f01, 0x03b9}}},
- { 0x1f8a, {2, {0x1f02, 0x03b9}}},
- { 0x1f8b, {2, {0x1f03, 0x03b9}}},
- { 0x1f8c, {2, {0x1f04, 0x03b9}}},
- { 0x1f8d, {2, {0x1f05, 0x03b9}}},
- { 0x1f8e, {2, {0x1f06, 0x03b9}}},
- { 0x1f8f, {2, {0x1f07, 0x03b9}}},
- { 0x1f90, {2, {0x1f20, 0x03b9}}},
- { 0x1f91, {2, {0x1f21, 0x03b9}}},
- { 0x1f92, {2, {0x1f22, 0x03b9}}},
- { 0x1f93, {2, {0x1f23, 0x03b9}}},
- { 0x1f94, {2, {0x1f24, 0x03b9}}},
- { 0x1f95, {2, {0x1f25, 0x03b9}}},
- { 0x1f96, {2, {0x1f26, 0x03b9}}},
- { 0x1f97, {2, {0x1f27, 0x03b9}}},
- { 0x1f98, {2, {0x1f20, 0x03b9}}},
- { 0x1f99, {2, {0x1f21, 0x03b9}}},
- { 0x1f9a, {2, {0x1f22, 0x03b9}}},
- { 0x1f9b, {2, {0x1f23, 0x03b9}}},
- { 0x1f9c, {2, {0x1f24, 0x03b9}}},
- { 0x1f9d, {2, {0x1f25, 0x03b9}}},
- { 0x1f9e, {2, {0x1f26, 0x03b9}}},
- { 0x1f9f, {2, {0x1f27, 0x03b9}}},
- { 0x1fa0, {2, {0x1f60, 0x03b9}}},
- { 0x1fa1, {2, {0x1f61, 0x03b9}}},
- { 0x1fa2, {2, {0x1f62, 0x03b9}}},
- { 0x1fa3, {2, {0x1f63, 0x03b9}}},
- { 0x1fa4, {2, {0x1f64, 0x03b9}}},
- { 0x1fa5, {2, {0x1f65, 0x03b9}}},
- { 0x1fa6, {2, {0x1f66, 0x03b9}}},
- { 0x1fa7, {2, {0x1f67, 0x03b9}}},
- { 0x1fa8, {2, {0x1f60, 0x03b9}}},
- { 0x1fa9, {2, {0x1f61, 0x03b9}}},
- { 0x1faa, {2, {0x1f62, 0x03b9}}},
- { 0x1fab, {2, {0x1f63, 0x03b9}}},
- { 0x1fac, {2, {0x1f64, 0x03b9}}},
- { 0x1fad, {2, {0x1f65, 0x03b9}}},
- { 0x1fae, {2, {0x1f66, 0x03b9}}},
- { 0x1faf, {2, {0x1f67, 0x03b9}}},
- { 0x1fb2, {2, {0x1f70, 0x03b9}}},
- { 0x1fb3, {2, {0x03b1, 0x03b9}}},
- { 0x1fb4, {2, {0x03ac, 0x03b9}}},
- { 0x1fb6, {2, {0x03b1, 0x0342}}},
- { 0x1fb7, {3, {0x03b1, 0x0342, 0x03b9}}},
- { 0x1fb8, {1, {0x1fb0}}},
- { 0x1fb9, {1, {0x1fb1}}},
- { 0x1fba, {1, {0x1f70}}},
- { 0x1fbb, {1, {0x1f71}}},
- { 0x1fbc, {2, {0x03b1, 0x03b9}}},
- { 0x1fbe, {1, {0x03b9}}},
- { 0x1fc2, {2, {0x1f74, 0x03b9}}},
- { 0x1fc3, {2, {0x03b7, 0x03b9}}},
- { 0x1fc4, {2, {0x03ae, 0x03b9}}},
- { 0x1fc6, {2, {0x03b7, 0x0342}}},
- { 0x1fc7, {3, {0x03b7, 0x0342, 0x03b9}}},
- { 0x1fc8, {1, {0x1f72}}},
- { 0x1fc9, {1, {0x1f73}}},
- { 0x1fca, {1, {0x1f74}}},
- { 0x1fcb, {1, {0x1f75}}},
- { 0x1fcc, {2, {0x03b7, 0x03b9}}},
- { 0x1fd2, {3, {0x03b9, 0x0308, 0x0300}}},
- { 0x1fd3, {3, {0x03b9, 0x0308, 0x0301}}},
- { 0x1fd6, {2, {0x03b9, 0x0342}}},
- { 0x1fd7, {3, {0x03b9, 0x0308, 0x0342}}},
- { 0x1fd8, {1, {0x1fd0}}},
- { 0x1fd9, {1, {0x1fd1}}},
- { 0x1fda, {1, {0x1f76}}},
- { 0x1fdb, {1, {0x1f77}}},
- { 0x1fe2, {3, {0x03c5, 0x0308, 0x0300}}},
- { 0x1fe3, {3, {0x03c5, 0x0308, 0x0301}}},
- { 0x1fe4, {2, {0x03c1, 0x0313}}},
- { 0x1fe6, {2, {0x03c5, 0x0342}}},
- { 0x1fe7, {3, {0x03c5, 0x0308, 0x0342}}},
- { 0x1fe8, {1, {0x1fe0}}},
- { 0x1fe9, {1, {0x1fe1}}},
- { 0x1fea, {1, {0x1f7a}}},
- { 0x1feb, {1, {0x1f7b}}},
- { 0x1fec, {1, {0x1fe5}}},
- { 0x1ff2, {2, {0x1f7c, 0x03b9}}},
- { 0x1ff3, {2, {0x03c9, 0x03b9}}},
- { 0x1ff4, {2, {0x03ce, 0x03b9}}},
- { 0x1ff6, {2, {0x03c9, 0x0342}}},
- { 0x1ff7, {3, {0x03c9, 0x0342, 0x03b9}}},
- { 0x1ff8, {1, {0x1f78}}},
- { 0x1ff9, {1, {0x1f79}}},
- { 0x1ffa, {1, {0x1f7c}}},
- { 0x1ffb, {1, {0x1f7d}}},
- { 0x1ffc, {2, {0x03c9, 0x03b9}}},
- { 0x2126, {1, {0x03c9}}},
- { 0x212a, {1, {0x006b}}},
- { 0x212b, {1, {0x00e5}}},
- { 0x2160, {1, {0x2170}}},
- { 0x2161, {1, {0x2171}}},
- { 0x2162, {1, {0x2172}}},
- { 0x2163, {1, {0x2173}}},
- { 0x2164, {1, {0x2174}}},
- { 0x2165, {1, {0x2175}}},
- { 0x2166, {1, {0x2176}}},
- { 0x2167, {1, {0x2177}}},
- { 0x2168, {1, {0x2178}}},
- { 0x2169, {1, {0x2179}}},
- { 0x216a, {1, {0x217a}}},
- { 0x216b, {1, {0x217b}}},
- { 0x216c, {1, {0x217c}}},
- { 0x216d, {1, {0x217d}}},
- { 0x216e, {1, {0x217e}}},
- { 0x216f, {1, {0x217f}}},
- { 0x24b6, {1, {0x24d0}}},
- { 0x24b7, {1, {0x24d1}}},
- { 0x24b8, {1, {0x24d2}}},
- { 0x24b9, {1, {0x24d3}}},
- { 0x24ba, {1, {0x24d4}}},
- { 0x24bb, {1, {0x24d5}}},
- { 0x24bc, {1, {0x24d6}}},
- { 0x24bd, {1, {0x24d7}}},
- { 0x24be, {1, {0x24d8}}},
- { 0x24bf, {1, {0x24d9}}},
- { 0x24c0, {1, {0x24da}}},
- { 0x24c1, {1, {0x24db}}},
- { 0x24c2, {1, {0x24dc}}},
- { 0x24c3, {1, {0x24dd}}},
- { 0x24c4, {1, {0x24de}}},
- { 0x24c5, {1, {0x24df}}},
- { 0x24c6, {1, {0x24e0}}},
- { 0x24c7, {1, {0x24e1}}},
- { 0x24c8, {1, {0x24e2}}},
- { 0x24c9, {1, {0x24e3}}},
- { 0x24ca, {1, {0x24e4}}},
- { 0x24cb, {1, {0x24e5}}},
- { 0x24cc, {1, {0x24e6}}},
- { 0x24cd, {1, {0x24e7}}},
- { 0x24ce, {1, {0x24e8}}},
- { 0x24cf, {1, {0x24e9}}},
- { 0x2c00, {1, {0x2c30}}},
- { 0x2c01, {1, {0x2c31}}},
- { 0x2c02, {1, {0x2c32}}},
- { 0x2c03, {1, {0x2c33}}},
- { 0x2c04, {1, {0x2c34}}},
- { 0x2c05, {1, {0x2c35}}},
- { 0x2c06, {1, {0x2c36}}},
- { 0x2c07, {1, {0x2c37}}},
- { 0x2c08, {1, {0x2c38}}},
- { 0x2c09, {1, {0x2c39}}},
- { 0x2c0a, {1, {0x2c3a}}},
- { 0x2c0b, {1, {0x2c3b}}},
- { 0x2c0c, {1, {0x2c3c}}},
- { 0x2c0d, {1, {0x2c3d}}},
- { 0x2c0e, {1, {0x2c3e}}},
- { 0x2c0f, {1, {0x2c3f}}},
- { 0x2c10, {1, {0x2c40}}},
- { 0x2c11, {1, {0x2c41}}},
- { 0x2c12, {1, {0x2c42}}},
- { 0x2c13, {1, {0x2c43}}},
- { 0x2c14, {1, {0x2c44}}},
- { 0x2c15, {1, {0x2c45}}},
- { 0x2c16, {1, {0x2c46}}},
- { 0x2c17, {1, {0x2c47}}},
- { 0x2c18, {1, {0x2c48}}},
- { 0x2c19, {1, {0x2c49}}},
- { 0x2c1a, {1, {0x2c4a}}},
- { 0x2c1b, {1, {0x2c4b}}},
- { 0x2c1c, {1, {0x2c4c}}},
- { 0x2c1d, {1, {0x2c4d}}},
- { 0x2c1e, {1, {0x2c4e}}},
- { 0x2c1f, {1, {0x2c4f}}},
- { 0x2c20, {1, {0x2c50}}},
- { 0x2c21, {1, {0x2c51}}},
- { 0x2c22, {1, {0x2c52}}},
- { 0x2c23, {1, {0x2c53}}},
- { 0x2c24, {1, {0x2c54}}},
- { 0x2c25, {1, {0x2c55}}},
- { 0x2c26, {1, {0x2c56}}},
- { 0x2c27, {1, {0x2c57}}},
- { 0x2c28, {1, {0x2c58}}},
- { 0x2c29, {1, {0x2c59}}},
- { 0x2c2a, {1, {0x2c5a}}},
- { 0x2c2b, {1, {0x2c5b}}},
- { 0x2c2c, {1, {0x2c5c}}},
- { 0x2c2d, {1, {0x2c5d}}},
- { 0x2c2e, {1, {0x2c5e}}},
- { 0x2c80, {1, {0x2c81}}},
- { 0x2c82, {1, {0x2c83}}},
- { 0x2c84, {1, {0x2c85}}},
- { 0x2c86, {1, {0x2c87}}},
- { 0x2c88, {1, {0x2c89}}},
- { 0x2c8a, {1, {0x2c8b}}},
- { 0x2c8c, {1, {0x2c8d}}},
- { 0x2c8e, {1, {0x2c8f}}},
- { 0x2c90, {1, {0x2c91}}},
- { 0x2c92, {1, {0x2c93}}},
- { 0x2c94, {1, {0x2c95}}},
- { 0x2c96, {1, {0x2c97}}},
- { 0x2c98, {1, {0x2c99}}},
- { 0x2c9a, {1, {0x2c9b}}},
- { 0x2c9c, {1, {0x2c9d}}},
- { 0x2c9e, {1, {0x2c9f}}},
- { 0x2ca0, {1, {0x2ca1}}},
- { 0x2ca2, {1, {0x2ca3}}},
- { 0x2ca4, {1, {0x2ca5}}},
- { 0x2ca6, {1, {0x2ca7}}},
- { 0x2ca8, {1, {0x2ca9}}},
- { 0x2caa, {1, {0x2cab}}},
- { 0x2cac, {1, {0x2cad}}},
- { 0x2cae, {1, {0x2caf}}},
- { 0x2cb0, {1, {0x2cb1}}},
- { 0x2cb2, {1, {0x2cb3}}},
- { 0x2cb4, {1, {0x2cb5}}},
- { 0x2cb6, {1, {0x2cb7}}},
- { 0x2cb8, {1, {0x2cb9}}},
- { 0x2cba, {1, {0x2cbb}}},
- { 0x2cbc, {1, {0x2cbd}}},
- { 0x2cbe, {1, {0x2cbf}}},
- { 0x2cc0, {1, {0x2cc1}}},
- { 0x2cc2, {1, {0x2cc3}}},
- { 0x2cc4, {1, {0x2cc5}}},
- { 0x2cc6, {1, {0x2cc7}}},
- { 0x2cc8, {1, {0x2cc9}}},
- { 0x2cca, {1, {0x2ccb}}},
- { 0x2ccc, {1, {0x2ccd}}},
- { 0x2cce, {1, {0x2ccf}}},
- { 0x2cd0, {1, {0x2cd1}}},
- { 0x2cd2, {1, {0x2cd3}}},
- { 0x2cd4, {1, {0x2cd5}}},
- { 0x2cd6, {1, {0x2cd7}}},
- { 0x2cd8, {1, {0x2cd9}}},
- { 0x2cda, {1, {0x2cdb}}},
- { 0x2cdc, {1, {0x2cdd}}},
- { 0x2cde, {1, {0x2cdf}}},
- { 0x2ce0, {1, {0x2ce1}}},
- { 0x2ce2, {1, {0x2ce3}}},
- { 0xfb00, {2, {0x0066, 0x0066}}},
- { 0xfb01, {2, {0x0066, 0x0069}}},
- { 0xfb02, {2, {0x0066, 0x006c}}},
- { 0xfb03, {3, {0x0066, 0x0066, 0x0069}}},
- { 0xfb04, {3, {0x0066, 0x0066, 0x006c}}},
- { 0xfb05, {2, {0x0073, 0x0074}}},
- { 0xfb06, {2, {0x0073, 0x0074}}},
- { 0xfb13, {2, {0x0574, 0x0576}}},
- { 0xfb14, {2, {0x0574, 0x0565}}},
- { 0xfb15, {2, {0x0574, 0x056b}}},
- { 0xfb16, {2, {0x057e, 0x0576}}},
- { 0xfb17, {2, {0x0574, 0x056d}}},
- { 0xff21, {1, {0xff41}}},
- { 0xff22, {1, {0xff42}}},
- { 0xff23, {1, {0xff43}}},
- { 0xff24, {1, {0xff44}}},
- { 0xff25, {1, {0xff45}}},
- { 0xff26, {1, {0xff46}}},
- { 0xff27, {1, {0xff47}}},
- { 0xff28, {1, {0xff48}}},
- { 0xff29, {1, {0xff49}}},
- { 0xff2a, {1, {0xff4a}}},
- { 0xff2b, {1, {0xff4b}}},
- { 0xff2c, {1, {0xff4c}}},
- { 0xff2d, {1, {0xff4d}}},
- { 0xff2e, {1, {0xff4e}}},
- { 0xff2f, {1, {0xff4f}}},
- { 0xff30, {1, {0xff50}}},
- { 0xff31, {1, {0xff51}}},
- { 0xff32, {1, {0xff52}}},
- { 0xff33, {1, {0xff53}}},
- { 0xff34, {1, {0xff54}}},
- { 0xff35, {1, {0xff55}}},
- { 0xff36, {1, {0xff56}}},
- { 0xff37, {1, {0xff57}}},
- { 0xff38, {1, {0xff58}}},
- { 0xff39, {1, {0xff59}}},
- { 0xff3a, {1, {0xff5a}}},
- { 0x10400, {1, {0x10428}}},
- { 0x10401, {1, {0x10429}}},
- { 0x10402, {1, {0x1042a}}},
- { 0x10403, {1, {0x1042b}}},
- { 0x10404, {1, {0x1042c}}},
- { 0x10405, {1, {0x1042d}}},
- { 0x10406, {1, {0x1042e}}},
- { 0x10407, {1, {0x1042f}}},
- { 0x10408, {1, {0x10430}}},
- { 0x10409, {1, {0x10431}}},
- { 0x1040a, {1, {0x10432}}},
- { 0x1040b, {1, {0x10433}}},
- { 0x1040c, {1, {0x10434}}},
- { 0x1040d, {1, {0x10435}}},
- { 0x1040e, {1, {0x10436}}},
- { 0x1040f, {1, {0x10437}}},
- { 0x10410, {1, {0x10438}}},
- { 0x10411, {1, {0x10439}}},
- { 0x10412, {1, {0x1043a}}},
- { 0x10413, {1, {0x1043b}}},
- { 0x10414, {1, {0x1043c}}},
- { 0x10415, {1, {0x1043d}}},
- { 0x10416, {1, {0x1043e}}},
- { 0x10417, {1, {0x1043f}}},
- { 0x10418, {1, {0x10440}}},
- { 0x10419, {1, {0x10441}}},
- { 0x1041a, {1, {0x10442}}},
- { 0x1041b, {1, {0x10443}}},
- { 0x1041c, {1, {0x10444}}},
- { 0x1041d, {1, {0x10445}}},
- { 0x1041e, {1, {0x10446}}},
- { 0x1041f, {1, {0x10447}}},
- { 0x10420, {1, {0x10448}}},
- { 0x10421, {1, {0x10449}}},
- { 0x10422, {1, {0x1044a}}},
- { 0x10423, {1, {0x1044b}}},
- { 0x10424, {1, {0x1044c}}},
- { 0x10425, {1, {0x1044d}}},
- { 0x10426, {1, {0x1044e}}},
- { 0x10427, {1, {0x1044f}}}
-};
-
-static const CaseFold_11_Type CaseFold_Locale[] = {
- { 0x0049, {1, {0x0069}}},
- { 0x0130, {2, {0x0069, 0x0307}}}
-};
-
-static const CaseUnfold_11_Type CaseUnfold_11[] = {
- { 0x0061, {1, {0x0041 }}},
- { 0x0062, {1, {0x0042 }}},
- { 0x0063, {1, {0x0043 }}},
- { 0x0064, {1, {0x0044 }}},
- { 0x0065, {1, {0x0045 }}},
- { 0x0066, {1, {0x0046 }}},
- { 0x0067, {1, {0x0047 }}},
- { 0x0068, {1, {0x0048 }}},
- { 0x006a, {1, {0x004a }}},
- { 0x006b, {2, {0x212a, 0x004b }}},
- { 0x006c, {1, {0x004c }}},
- { 0x006d, {1, {0x004d }}},
- { 0x006e, {1, {0x004e }}},
- { 0x006f, {1, {0x004f }}},
- { 0x0070, {1, {0x0050 }}},
- { 0x0071, {1, {0x0051 }}},
- { 0x0072, {1, {0x0052 }}},
- { 0x0073, {2, {0x0053, 0x017f }}},
- { 0x0074, {1, {0x0054 }}},
- { 0x0075, {1, {0x0055 }}},
- { 0x0076, {1, {0x0056 }}},
- { 0x0077, {1, {0x0057 }}},
- { 0x0078, {1, {0x0058 }}},
- { 0x0079, {1, {0x0059 }}},
- { 0x007a, {1, {0x005a }}},
- { 0x00e0, {1, {0x00c0 }}},
- { 0x00e1, {1, {0x00c1 }}},
- { 0x00e2, {1, {0x00c2 }}},
- { 0x00e3, {1, {0x00c3 }}},
- { 0x00e4, {1, {0x00c4 }}},
- { 0x00e5, {2, {0x212b, 0x00c5 }}},
- { 0x00e6, {1, {0x00c6 }}},
- { 0x00e7, {1, {0x00c7 }}},
- { 0x00e8, {1, {0x00c8 }}},
- { 0x00e9, {1, {0x00c9 }}},
- { 0x00ea, {1, {0x00ca }}},
- { 0x00eb, {1, {0x00cb }}},
- { 0x00ec, {1, {0x00cc }}},
- { 0x00ed, {1, {0x00cd }}},
- { 0x00ee, {1, {0x00ce }}},
- { 0x00ef, {1, {0x00cf }}},
- { 0x00f0, {1, {0x00d0 }}},
- { 0x00f1, {1, {0x00d1 }}},
- { 0x00f2, {1, {0x00d2 }}},
- { 0x00f3, {1, {0x00d3 }}},
- { 0x00f4, {1, {0x00d4 }}},
- { 0x00f5, {1, {0x00d5 }}},
- { 0x00f6, {1, {0x00d6 }}},
- { 0x00f8, {1, {0x00d8 }}},
- { 0x00f9, {1, {0x00d9 }}},
- { 0x00fa, {1, {0x00da }}},
- { 0x00fb, {1, {0x00db }}},
- { 0x00fc, {1, {0x00dc }}},
- { 0x00fd, {1, {0x00dd }}},
- { 0x00fe, {1, {0x00de }}},
- { 0x00ff, {1, {0x0178 }}},
- { 0x0101, {1, {0x0100 }}},
- { 0x0103, {1, {0x0102 }}},
- { 0x0105, {1, {0x0104 }}},
- { 0x0107, {1, {0x0106 }}},
- { 0x0109, {1, {0x0108 }}},
- { 0x010b, {1, {0x010a }}},
- { 0x010d, {1, {0x010c }}},
- { 0x010f, {1, {0x010e }}},
- { 0x0111, {1, {0x0110 }}},
- { 0x0113, {1, {0x0112 }}},
- { 0x0115, {1, {0x0114 }}},
- { 0x0117, {1, {0x0116 }}},
- { 0x0119, {1, {0x0118 }}},
- { 0x011b, {1, {0x011a }}},
- { 0x011d, {1, {0x011c }}},
- { 0x011f, {1, {0x011e }}},
- { 0x0121, {1, {0x0120 }}},
- { 0x0123, {1, {0x0122 }}},
- { 0x0125, {1, {0x0124 }}},
- { 0x0127, {1, {0x0126 }}},
- { 0x0129, {1, {0x0128 }}},
- { 0x012b, {1, {0x012a }}},
- { 0x012d, {1, {0x012c }}},
- { 0x012f, {1, {0x012e }}},
- { 0x0133, {1, {0x0132 }}},
- { 0x0135, {1, {0x0134 }}},
- { 0x0137, {1, {0x0136 }}},
- { 0x013a, {1, {0x0139 }}},
- { 0x013c, {1, {0x013b }}},
- { 0x013e, {1, {0x013d }}},
- { 0x0140, {1, {0x013f }}},
- { 0x0142, {1, {0x0141 }}},
- { 0x0144, {1, {0x0143 }}},
- { 0x0146, {1, {0x0145 }}},
- { 0x0148, {1, {0x0147 }}},
- { 0x014b, {1, {0x014a }}},
- { 0x014d, {1, {0x014c }}},
- { 0x014f, {1, {0x014e }}},
- { 0x0151, {1, {0x0150 }}},
- { 0x0153, {1, {0x0152 }}},
- { 0x0155, {1, {0x0154 }}},
- { 0x0157, {1, {0x0156 }}},
- { 0x0159, {1, {0x0158 }}},
- { 0x015b, {1, {0x015a }}},
- { 0x015d, {1, {0x015c }}},
- { 0x015f, {1, {0x015e }}},
- { 0x0161, {1, {0x0160 }}},
- { 0x0163, {1, {0x0162 }}},
- { 0x0165, {1, {0x0164 }}},
- { 0x0167, {1, {0x0166 }}},
- { 0x0169, {1, {0x0168 }}},
- { 0x016b, {1, {0x016a }}},
- { 0x016d, {1, {0x016c }}},
- { 0x016f, {1, {0x016e }}},
- { 0x0171, {1, {0x0170 }}},
- { 0x0173, {1, {0x0172 }}},
- { 0x0175, {1, {0x0174 }}},
- { 0x0177, {1, {0x0176 }}},
- { 0x017a, {1, {0x0179 }}},
- { 0x017c, {1, {0x017b }}},
- { 0x017e, {1, {0x017d }}},
- { 0x0183, {1, {0x0182 }}},
- { 0x0185, {1, {0x0184 }}},
- { 0x0188, {1, {0x0187 }}},
- { 0x018c, {1, {0x018b }}},
- { 0x0192, {1, {0x0191 }}},
- { 0x0195, {1, {0x01f6 }}},
- { 0x0199, {1, {0x0198 }}},
- { 0x019a, {1, {0x023d }}},
- { 0x019e, {1, {0x0220 }}},
- { 0x01a1, {1, {0x01a0 }}},
- { 0x01a3, {1, {0x01a2 }}},
- { 0x01a5, {1, {0x01a4 }}},
- { 0x01a8, {1, {0x01a7 }}},
- { 0x01ad, {1, {0x01ac }}},
- { 0x01b0, {1, {0x01af }}},
- { 0x01b4, {1, {0x01b3 }}},
- { 0x01b6, {1, {0x01b5 }}},
- { 0x01b9, {1, {0x01b8 }}},
- { 0x01bd, {1, {0x01bc }}},
- { 0x01bf, {1, {0x01f7 }}},
- { 0x01c6, {2, {0x01c4, 0x01c5 }}},
- { 0x01c9, {2, {0x01c7, 0x01c8 }}},
- { 0x01cc, {2, {0x01ca, 0x01cb }}},
- { 0x01ce, {1, {0x01cd }}},
- { 0x01d0, {1, {0x01cf }}},
- { 0x01d2, {1, {0x01d1 }}},
- { 0x01d4, {1, {0x01d3 }}},
- { 0x01d6, {1, {0x01d5 }}},
- { 0x01d8, {1, {0x01d7 }}},
- { 0x01da, {1, {0x01d9 }}},
- { 0x01dc, {1, {0x01db }}},
- { 0x01dd, {1, {0x018e }}},
- { 0x01df, {1, {0x01de }}},
- { 0x01e1, {1, {0x01e0 }}},
- { 0x01e3, {1, {0x01e2 }}},
- { 0x01e5, {1, {0x01e4 }}},
- { 0x01e7, {1, {0x01e6 }}},
- { 0x01e9, {1, {0x01e8 }}},
- { 0x01eb, {1, {0x01ea }}},
- { 0x01ed, {1, {0x01ec }}},
- { 0x01ef, {1, {0x01ee }}},
- { 0x01f3, {2, {0x01f1, 0x01f2 }}},
- { 0x01f5, {1, {0x01f4 }}},
- { 0x01f9, {1, {0x01f8 }}},
- { 0x01fb, {1, {0x01fa }}},
- { 0x01fd, {1, {0x01fc }}},
- { 0x01ff, {1, {0x01fe }}},
- { 0x0201, {1, {0x0200 }}},
- { 0x0203, {1, {0x0202 }}},
- { 0x0205, {1, {0x0204 }}},
- { 0x0207, {1, {0x0206 }}},
- { 0x0209, {1, {0x0208 }}},
- { 0x020b, {1, {0x020a }}},
- { 0x020d, {1, {0x020c }}},
- { 0x020f, {1, {0x020e }}},
- { 0x0211, {1, {0x0210 }}},
- { 0x0213, {1, {0x0212 }}},
- { 0x0215, {1, {0x0214 }}},
- { 0x0217, {1, {0x0216 }}},
- { 0x0219, {1, {0x0218 }}},
- { 0x021b, {1, {0x021a }}},
- { 0x021d, {1, {0x021c }}},
- { 0x021f, {1, {0x021e }}},
- { 0x0223, {1, {0x0222 }}},
- { 0x0225, {1, {0x0224 }}},
- { 0x0227, {1, {0x0226 }}},
- { 0x0229, {1, {0x0228 }}},
- { 0x022b, {1, {0x022a }}},
- { 0x022d, {1, {0x022c }}},
- { 0x022f, {1, {0x022e }}},
- { 0x0231, {1, {0x0230 }}},
- { 0x0233, {1, {0x0232 }}},
- { 0x023c, {1, {0x023b }}},
- { 0x0253, {1, {0x0181 }}},
- { 0x0254, {1, {0x0186 }}},
- { 0x0256, {1, {0x0189 }}},
- { 0x0257, {1, {0x018a }}},
- { 0x0259, {1, {0x018f }}},
- { 0x025b, {1, {0x0190 }}},
- { 0x0260, {1, {0x0193 }}},
- { 0x0263, {1, {0x0194 }}},
- { 0x0268, {1, {0x0197 }}},
- { 0x0269, {1, {0x0196 }}},
- { 0x026f, {1, {0x019c }}},
- { 0x0272, {1, {0x019d }}},
- { 0x0275, {1, {0x019f }}},
- { 0x0280, {1, {0x01a6 }}},
- { 0x0283, {1, {0x01a9 }}},
- { 0x0288, {1, {0x01ae }}},
- { 0x028a, {1, {0x01b1 }}},
- { 0x028b, {1, {0x01b2 }}},
- { 0x0292, {1, {0x01b7 }}},
- { 0x0294, {1, {0x0241 }}},
- { 0x03ac, {1, {0x0386 }}},
- { 0x03ad, {1, {0x0388 }}},
- { 0x03ae, {1, {0x0389 }}},
- { 0x03af, {1, {0x038a }}},
- { 0x03b1, {1, {0x0391 }}},
- { 0x03b2, {2, {0x0392, 0x03d0 }}},
- { 0x03b3, {1, {0x0393 }}},
- { 0x03b4, {1, {0x0394 }}},
- { 0x03b5, {2, {0x03f5, 0x0395 }}},
- { 0x03b6, {1, {0x0396 }}},
- { 0x03b7, {1, {0x0397 }}},
- { 0x03b8, {3, {0x03f4, 0x0398, 0x03d1 }}},
- { 0x03b9, {3, {0x1fbe, 0x0399, 0x0345 }}},
- { 0x03ba, {2, {0x03f0, 0x039a }}},
- { 0x03bb, {1, {0x039b }}},
- { 0x03bc, {2, {0x00b5, 0x039c }}},
- { 0x03bd, {1, {0x039d }}},
- { 0x03be, {1, {0x039e }}},
- { 0x03bf, {1, {0x039f }}},
- { 0x03c0, {2, {0x03a0, 0x03d6 }}},
- { 0x03c1, {2, {0x03f1, 0x03a1 }}},
- { 0x03c3, {2, {0x03a3, 0x03c2 }}},
- { 0x03c4, {1, {0x03a4 }}},
- { 0x03c5, {1, {0x03a5 }}},
- { 0x03c6, {2, {0x03a6, 0x03d5 }}},
- { 0x03c7, {1, {0x03a7 }}},
- { 0x03c8, {1, {0x03a8 }}},
- { 0x03c9, {2, {0x03a9, 0x2126 }}},
- { 0x03ca, {1, {0x03aa }}},
- { 0x03cb, {1, {0x03ab }}},
- { 0x03cc, {1, {0x038c }}},
- { 0x03cd, {1, {0x038e }}},
- { 0x03ce, {1, {0x038f }}},
- { 0x03d9, {1, {0x03d8 }}},
- { 0x03db, {1, {0x03da }}},
- { 0x03dd, {1, {0x03dc }}},
- { 0x03df, {1, {0x03de }}},
- { 0x03e1, {1, {0x03e0 }}},
- { 0x03e3, {1, {0x03e2 }}},
- { 0x03e5, {1, {0x03e4 }}},
- { 0x03e7, {1, {0x03e6 }}},
- { 0x03e9, {1, {0x03e8 }}},
- { 0x03eb, {1, {0x03ea }}},
- { 0x03ed, {1, {0x03ec }}},
- { 0x03ef, {1, {0x03ee }}},
- { 0x03f2, {1, {0x03f9 }}},
- { 0x03f8, {1, {0x03f7 }}},
- { 0x03fb, {1, {0x03fa }}},
- { 0x0430, {1, {0x0410 }}},
- { 0x0431, {1, {0x0411 }}},
- { 0x0432, {1, {0x0412 }}},
- { 0x0433, {1, {0x0413 }}},
- { 0x0434, {1, {0x0414 }}},
- { 0x0435, {1, {0x0415 }}},
- { 0x0436, {1, {0x0416 }}},
- { 0x0437, {1, {0x0417 }}},
- { 0x0438, {1, {0x0418 }}},
- { 0x0439, {1, {0x0419 }}},
- { 0x043a, {1, {0x041a }}},
- { 0x043b, {1, {0x041b }}},
- { 0x043c, {1, {0x041c }}},
- { 0x043d, {1, {0x041d }}},
- { 0x043e, {1, {0x041e }}},
- { 0x043f, {1, {0x041f }}},
- { 0x0440, {1, {0x0420 }}},
- { 0x0441, {1, {0x0421 }}},
- { 0x0442, {1, {0x0422 }}},
- { 0x0443, {1, {0x0423 }}},
- { 0x0444, {1, {0x0424 }}},
- { 0x0445, {1, {0x0425 }}},
- { 0x0446, {1, {0x0426 }}},
- { 0x0447, {1, {0x0427 }}},
- { 0x0448, {1, {0x0428 }}},
- { 0x0449, {1, {0x0429 }}},
- { 0x044a, {1, {0x042a }}},
- { 0x044b, {1, {0x042b }}},
- { 0x044c, {1, {0x042c }}},
- { 0x044d, {1, {0x042d }}},
- { 0x044e, {1, {0x042e }}},
- { 0x044f, {1, {0x042f }}},
- { 0x0450, {1, {0x0400 }}},
- { 0x0451, {1, {0x0401 }}},
- { 0x0452, {1, {0x0402 }}},
- { 0x0453, {1, {0x0403 }}},
- { 0x0454, {1, {0x0404 }}},
- { 0x0455, {1, {0x0405 }}},
- { 0x0456, {1, {0x0406 }}},
- { 0x0457, {1, {0x0407 }}},
- { 0x0458, {1, {0x0408 }}},
- { 0x0459, {1, {0x0409 }}},
- { 0x045a, {1, {0x040a }}},
- { 0x045b, {1, {0x040b }}},
- { 0x045c, {1, {0x040c }}},
- { 0x045d, {1, {0x040d }}},
- { 0x045e, {1, {0x040e }}},
- { 0x045f, {1, {0x040f }}},
- { 0x0461, {1, {0x0460 }}},
- { 0x0463, {1, {0x0462 }}},
- { 0x0465, {1, {0x0464 }}},
- { 0x0467, {1, {0x0466 }}},
- { 0x0469, {1, {0x0468 }}},
- { 0x046b, {1, {0x046a }}},
- { 0x046d, {1, {0x046c }}},
- { 0x046f, {1, {0x046e }}},
- { 0x0471, {1, {0x0470 }}},
- { 0x0473, {1, {0x0472 }}},
- { 0x0475, {1, {0x0474 }}},
- { 0x0477, {1, {0x0476 }}},
- { 0x0479, {1, {0x0478 }}},
- { 0x047b, {1, {0x047a }}},
- { 0x047d, {1, {0x047c }}},
- { 0x047f, {1, {0x047e }}},
- { 0x0481, {1, {0x0480 }}},
- { 0x048b, {1, {0x048a }}},
- { 0x048d, {1, {0x048c }}},
- { 0x048f, {1, {0x048e }}},
- { 0x0491, {1, {0x0490 }}},
- { 0x0493, {1, {0x0492 }}},
- { 0x0495, {1, {0x0494 }}},
- { 0x0497, {1, {0x0496 }}},
- { 0x0499, {1, {0x0498 }}},
- { 0x049b, {1, {0x049a }}},
- { 0x049d, {1, {0x049c }}},
- { 0x049f, {1, {0x049e }}},
- { 0x04a1, {1, {0x04a0 }}},
- { 0x04a3, {1, {0x04a2 }}},
- { 0x04a5, {1, {0x04a4 }}},
- { 0x04a7, {1, {0x04a6 }}},
- { 0x04a9, {1, {0x04a8 }}},
- { 0x04ab, {1, {0x04aa }}},
- { 0x04ad, {1, {0x04ac }}},
- { 0x04af, {1, {0x04ae }}},
- { 0x04b1, {1, {0x04b0 }}},
- { 0x04b3, {1, {0x04b2 }}},
- { 0x04b5, {1, {0x04b4 }}},
- { 0x04b7, {1, {0x04b6 }}},
- { 0x04b9, {1, {0x04b8 }}},
- { 0x04bb, {1, {0x04ba }}},
- { 0x04bd, {1, {0x04bc }}},
- { 0x04bf, {1, {0x04be }}},
- { 0x04c2, {1, {0x04c1 }}},
- { 0x04c4, {1, {0x04c3 }}},
- { 0x04c6, {1, {0x04c5 }}},
- { 0x04c8, {1, {0x04c7 }}},
- { 0x04ca, {1, {0x04c9 }}},
- { 0x04cc, {1, {0x04cb }}},
- { 0x04ce, {1, {0x04cd }}},
- { 0x04d1, {1, {0x04d0 }}},
- { 0x04d3, {1, {0x04d2 }}},
- { 0x04d5, {1, {0x04d4 }}},
- { 0x04d7, {1, {0x04d6 }}},
- { 0x04d9, {1, {0x04d8 }}},
- { 0x04db, {1, {0x04da }}},
- { 0x04dd, {1, {0x04dc }}},
- { 0x04df, {1, {0x04de }}},
- { 0x04e1, {1, {0x04e0 }}},
- { 0x04e3, {1, {0x04e2 }}},
- { 0x04e5, {1, {0x04e4 }}},
- { 0x04e7, {1, {0x04e6 }}},
- { 0x04e9, {1, {0x04e8 }}},
- { 0x04eb, {1, {0x04ea }}},
- { 0x04ed, {1, {0x04ec }}},
- { 0x04ef, {1, {0x04ee }}},
- { 0x04f1, {1, {0x04f0 }}},
- { 0x04f3, {1, {0x04f2 }}},
- { 0x04f5, {1, {0x04f4 }}},
- { 0x04f7, {1, {0x04f6 }}},
- { 0x04f9, {1, {0x04f8 }}},
- { 0x0501, {1, {0x0500 }}},
- { 0x0503, {1, {0x0502 }}},
- { 0x0505, {1, {0x0504 }}},
- { 0x0507, {1, {0x0506 }}},
- { 0x0509, {1, {0x0508 }}},
- { 0x050b, {1, {0x050a }}},
- { 0x050d, {1, {0x050c }}},
- { 0x050f, {1, {0x050e }}},
- { 0x0561, {1, {0x0531 }}},
- { 0x0562, {1, {0x0532 }}},
- { 0x0563, {1, {0x0533 }}},
- { 0x0564, {1, {0x0534 }}},
- { 0x0565, {1, {0x0535 }}},
- { 0x0566, {1, {0x0536 }}},
- { 0x0567, {1, {0x0537 }}},
- { 0x0568, {1, {0x0538 }}},
- { 0x0569, {1, {0x0539 }}},
- { 0x056a, {1, {0x053a }}},
- { 0x056b, {1, {0x053b }}},
- { 0x056c, {1, {0x053c }}},
- { 0x056d, {1, {0x053d }}},
- { 0x056e, {1, {0x053e }}},
- { 0x056f, {1, {0x053f }}},
- { 0x0570, {1, {0x0540 }}},
- { 0x0571, {1, {0x0541 }}},
- { 0x0572, {1, {0x0542 }}},
- { 0x0573, {1, {0x0543 }}},
- { 0x0574, {1, {0x0544 }}},
- { 0x0575, {1, {0x0545 }}},
- { 0x0576, {1, {0x0546 }}},
- { 0x0577, {1, {0x0547 }}},
- { 0x0578, {1, {0x0548 }}},
- { 0x0579, {1, {0x0549 }}},
- { 0x057a, {1, {0x054a }}},
- { 0x057b, {1, {0x054b }}},
- { 0x057c, {1, {0x054c }}},
- { 0x057d, {1, {0x054d }}},
- { 0x057e, {1, {0x054e }}},
- { 0x057f, {1, {0x054f }}},
- { 0x0580, {1, {0x0550 }}},
- { 0x0581, {1, {0x0551 }}},
- { 0x0582, {1, {0x0552 }}},
- { 0x0583, {1, {0x0553 }}},
- { 0x0584, {1, {0x0554 }}},
- { 0x0585, {1, {0x0555 }}},
- { 0x0586, {1, {0x0556 }}},
- { 0x1e01, {1, {0x1e00 }}},
- { 0x1e03, {1, {0x1e02 }}},
- { 0x1e05, {1, {0x1e04 }}},
- { 0x1e07, {1, {0x1e06 }}},
- { 0x1e09, {1, {0x1e08 }}},
- { 0x1e0b, {1, {0x1e0a }}},
- { 0x1e0d, {1, {0x1e0c }}},
- { 0x1e0f, {1, {0x1e0e }}},
- { 0x1e11, {1, {0x1e10 }}},
- { 0x1e13, {1, {0x1e12 }}},
- { 0x1e15, {1, {0x1e14 }}},
- { 0x1e17, {1, {0x1e16 }}},
- { 0x1e19, {1, {0x1e18 }}},
- { 0x1e1b, {1, {0x1e1a }}},
- { 0x1e1d, {1, {0x1e1c }}},
- { 0x1e1f, {1, {0x1e1e }}},
- { 0x1e21, {1, {0x1e20 }}},
- { 0x1e23, {1, {0x1e22 }}},
- { 0x1e25, {1, {0x1e24 }}},
- { 0x1e27, {1, {0x1e26 }}},
- { 0x1e29, {1, {0x1e28 }}},
- { 0x1e2b, {1, {0x1e2a }}},
- { 0x1e2d, {1, {0x1e2c }}},
- { 0x1e2f, {1, {0x1e2e }}},
- { 0x1e31, {1, {0x1e30 }}},
- { 0x1e33, {1, {0x1e32 }}},
- { 0x1e35, {1, {0x1e34 }}},
- { 0x1e37, {1, {0x1e36 }}},
- { 0x1e39, {1, {0x1e38 }}},
- { 0x1e3b, {1, {0x1e3a }}},
- { 0x1e3d, {1, {0x1e3c }}},
- { 0x1e3f, {1, {0x1e3e }}},
- { 0x1e41, {1, {0x1e40 }}},
- { 0x1e43, {1, {0x1e42 }}},
- { 0x1e45, {1, {0x1e44 }}},
- { 0x1e47, {1, {0x1e46 }}},
- { 0x1e49, {1, {0x1e48 }}},
- { 0x1e4b, {1, {0x1e4a }}},
- { 0x1e4d, {1, {0x1e4c }}},
- { 0x1e4f, {1, {0x1e4e }}},
- { 0x1e51, {1, {0x1e50 }}},
- { 0x1e53, {1, {0x1e52 }}},
- { 0x1e55, {1, {0x1e54 }}},
- { 0x1e57, {1, {0x1e56 }}},
- { 0x1e59, {1, {0x1e58 }}},
- { 0x1e5b, {1, {0x1e5a }}},
- { 0x1e5d, {1, {0x1e5c }}},
- { 0x1e5f, {1, {0x1e5e }}},
- { 0x1e61, {2, {0x1e9b, 0x1e60 }}},
- { 0x1e63, {1, {0x1e62 }}},
- { 0x1e65, {1, {0x1e64 }}},
- { 0x1e67, {1, {0x1e66 }}},
- { 0x1e69, {1, {0x1e68 }}},
- { 0x1e6b, {1, {0x1e6a }}},
- { 0x1e6d, {1, {0x1e6c }}},
- { 0x1e6f, {1, {0x1e6e }}},
- { 0x1e71, {1, {0x1e70 }}},
- { 0x1e73, {1, {0x1e72 }}},
- { 0x1e75, {1, {0x1e74 }}},
- { 0x1e77, {1, {0x1e76 }}},
- { 0x1e79, {1, {0x1e78 }}},
- { 0x1e7b, {1, {0x1e7a }}},
- { 0x1e7d, {1, {0x1e7c }}},
- { 0x1e7f, {1, {0x1e7e }}},
- { 0x1e81, {1, {0x1e80 }}},
- { 0x1e83, {1, {0x1e82 }}},
- { 0x1e85, {1, {0x1e84 }}},
- { 0x1e87, {1, {0x1e86 }}},
- { 0x1e89, {1, {0x1e88 }}},
- { 0x1e8b, {1, {0x1e8a }}},
- { 0x1e8d, {1, {0x1e8c }}},
- { 0x1e8f, {1, {0x1e8e }}},
- { 0x1e91, {1, {0x1e90 }}},
- { 0x1e93, {1, {0x1e92 }}},
- { 0x1e95, {1, {0x1e94 }}},
- { 0x1ea1, {1, {0x1ea0 }}},
- { 0x1ea3, {1, {0x1ea2 }}},
- { 0x1ea5, {1, {0x1ea4 }}},
- { 0x1ea7, {1, {0x1ea6 }}},
- { 0x1ea9, {1, {0x1ea8 }}},
- { 0x1eab, {1, {0x1eaa }}},
- { 0x1ead, {1, {0x1eac }}},
- { 0x1eaf, {1, {0x1eae }}},
- { 0x1eb1, {1, {0x1eb0 }}},
- { 0x1eb3, {1, {0x1eb2 }}},
- { 0x1eb5, {1, {0x1eb4 }}},
- { 0x1eb7, {1, {0x1eb6 }}},
- { 0x1eb9, {1, {0x1eb8 }}},
- { 0x1ebb, {1, {0x1eba }}},
- { 0x1ebd, {1, {0x1ebc }}},
- { 0x1ebf, {1, {0x1ebe }}},
- { 0x1ec1, {1, {0x1ec0 }}},
- { 0x1ec3, {1, {0x1ec2 }}},
- { 0x1ec5, {1, {0x1ec4 }}},
- { 0x1ec7, {1, {0x1ec6 }}},
- { 0x1ec9, {1, {0x1ec8 }}},
- { 0x1ecb, {1, {0x1eca }}},
- { 0x1ecd, {1, {0x1ecc }}},
- { 0x1ecf, {1, {0x1ece }}},
- { 0x1ed1, {1, {0x1ed0 }}},
- { 0x1ed3, {1, {0x1ed2 }}},
- { 0x1ed5, {1, {0x1ed4 }}},
- { 0x1ed7, {1, {0x1ed6 }}},
- { 0x1ed9, {1, {0x1ed8 }}},
- { 0x1edb, {1, {0x1eda }}},
- { 0x1edd, {1, {0x1edc }}},
- { 0x1edf, {1, {0x1ede }}},
- { 0x1ee1, {1, {0x1ee0 }}},
- { 0x1ee3, {1, {0x1ee2 }}},
- { 0x1ee5, {1, {0x1ee4 }}},
- { 0x1ee7, {1, {0x1ee6 }}},
- { 0x1ee9, {1, {0x1ee8 }}},
- { 0x1eeb, {1, {0x1eea }}},
- { 0x1eed, {1, {0x1eec }}},
- { 0x1eef, {1, {0x1eee }}},
- { 0x1ef1, {1, {0x1ef0 }}},
- { 0x1ef3, {1, {0x1ef2 }}},
- { 0x1ef5, {1, {0x1ef4 }}},
- { 0x1ef7, {1, {0x1ef6 }}},
- { 0x1ef9, {1, {0x1ef8 }}},
- { 0x1f00, {1, {0x1f08 }}},
- { 0x1f01, {1, {0x1f09 }}},
- { 0x1f02, {1, {0x1f0a }}},
- { 0x1f03, {1, {0x1f0b }}},
- { 0x1f04, {1, {0x1f0c }}},
- { 0x1f05, {1, {0x1f0d }}},
- { 0x1f06, {1, {0x1f0e }}},
- { 0x1f07, {1, {0x1f0f }}},
- { 0x1f10, {1, {0x1f18 }}},
- { 0x1f11, {1, {0x1f19 }}},
- { 0x1f12, {1, {0x1f1a }}},
- { 0x1f13, {1, {0x1f1b }}},
- { 0x1f14, {1, {0x1f1c }}},
- { 0x1f15, {1, {0x1f1d }}},
- { 0x1f20, {1, {0x1f28 }}},
- { 0x1f21, {1, {0x1f29 }}},
- { 0x1f22, {1, {0x1f2a }}},
- { 0x1f23, {1, {0x1f2b }}},
- { 0x1f24, {1, {0x1f2c }}},
- { 0x1f25, {1, {0x1f2d }}},
- { 0x1f26, {1, {0x1f2e }}},
- { 0x1f27, {1, {0x1f2f }}},
- { 0x1f30, {1, {0x1f38 }}},
- { 0x1f31, {1, {0x1f39 }}},
- { 0x1f32, {1, {0x1f3a }}},
- { 0x1f33, {1, {0x1f3b }}},
- { 0x1f34, {1, {0x1f3c }}},
- { 0x1f35, {1, {0x1f3d }}},
- { 0x1f36, {1, {0x1f3e }}},
- { 0x1f37, {1, {0x1f3f }}},
- { 0x1f40, {1, {0x1f48 }}},
- { 0x1f41, {1, {0x1f49 }}},
- { 0x1f42, {1, {0x1f4a }}},
- { 0x1f43, {1, {0x1f4b }}},
- { 0x1f44, {1, {0x1f4c }}},
- { 0x1f45, {1, {0x1f4d }}},
- { 0x1f51, {1, {0x1f59 }}},
- { 0x1f53, {1, {0x1f5b }}},
- { 0x1f55, {1, {0x1f5d }}},
- { 0x1f57, {1, {0x1f5f }}},
- { 0x1f60, {1, {0x1f68 }}},
- { 0x1f61, {1, {0x1f69 }}},
- { 0x1f62, {1, {0x1f6a }}},
- { 0x1f63, {1, {0x1f6b }}},
- { 0x1f64, {1, {0x1f6c }}},
- { 0x1f65, {1, {0x1f6d }}},
- { 0x1f66, {1, {0x1f6e }}},
- { 0x1f67, {1, {0x1f6f }}},
- { 0x1f70, {1, {0x1fba }}},
- { 0x1f71, {1, {0x1fbb }}},
- { 0x1f72, {1, {0x1fc8 }}},
- { 0x1f73, {1, {0x1fc9 }}},
- { 0x1f74, {1, {0x1fca }}},
- { 0x1f75, {1, {0x1fcb }}},
- { 0x1f76, {1, {0x1fda }}},
- { 0x1f77, {1, {0x1fdb }}},
- { 0x1f78, {1, {0x1ff8 }}},
- { 0x1f79, {1, {0x1ff9 }}},
- { 0x1f7a, {1, {0x1fea }}},
- { 0x1f7b, {1, {0x1feb }}},
- { 0x1f7c, {1, {0x1ffa }}},
- { 0x1f7d, {1, {0x1ffb }}},
- { 0x1fb0, {1, {0x1fb8 }}},
- { 0x1fb1, {1, {0x1fb9 }}},
- { 0x1fd0, {1, {0x1fd8 }}},
- { 0x1fd1, {1, {0x1fd9 }}},
- { 0x1fe0, {1, {0x1fe8 }}},
- { 0x1fe1, {1, {0x1fe9 }}},
- { 0x1fe5, {1, {0x1fec }}},
- { 0x2170, {1, {0x2160 }}},
- { 0x2171, {1, {0x2161 }}},
- { 0x2172, {1, {0x2162 }}},
- { 0x2173, {1, {0x2163 }}},
- { 0x2174, {1, {0x2164 }}},
- { 0x2175, {1, {0x2165 }}},
- { 0x2176, {1, {0x2166 }}},
- { 0x2177, {1, {0x2167 }}},
- { 0x2178, {1, {0x2168 }}},
- { 0x2179, {1, {0x2169 }}},
- { 0x217a, {1, {0x216a }}},
- { 0x217b, {1, {0x216b }}},
- { 0x217c, {1, {0x216c }}},
- { 0x217d, {1, {0x216d }}},
- { 0x217e, {1, {0x216e }}},
- { 0x217f, {1, {0x216f }}},
- { 0x24d0, {1, {0x24b6 }}},
- { 0x24d1, {1, {0x24b7 }}},
- { 0x24d2, {1, {0x24b8 }}},
- { 0x24d3, {1, {0x24b9 }}},
- { 0x24d4, {1, {0x24ba }}},
- { 0x24d5, {1, {0x24bb }}},
- { 0x24d6, {1, {0x24bc }}},
- { 0x24d7, {1, {0x24bd }}},
- { 0x24d8, {1, {0x24be }}},
- { 0x24d9, {1, {0x24bf }}},
- { 0x24da, {1, {0x24c0 }}},
- { 0x24db, {1, {0x24c1 }}},
- { 0x24dc, {1, {0x24c2 }}},
- { 0x24dd, {1, {0x24c3 }}},
- { 0x24de, {1, {0x24c4 }}},
- { 0x24df, {1, {0x24c5 }}},
- { 0x24e0, {1, {0x24c6 }}},
- { 0x24e1, {1, {0x24c7 }}},
- { 0x24e2, {1, {0x24c8 }}},
- { 0x24e3, {1, {0x24c9 }}},
- { 0x24e4, {1, {0x24ca }}},
- { 0x24e5, {1, {0x24cb }}},
- { 0x24e6, {1, {0x24cc }}},
- { 0x24e7, {1, {0x24cd }}},
- { 0x24e8, {1, {0x24ce }}},
- { 0x24e9, {1, {0x24cf }}},
- { 0x2c30, {1, {0x2c00 }}},
- { 0x2c31, {1, {0x2c01 }}},
- { 0x2c32, {1, {0x2c02 }}},
- { 0x2c33, {1, {0x2c03 }}},
- { 0x2c34, {1, {0x2c04 }}},
- { 0x2c35, {1, {0x2c05 }}},
- { 0x2c36, {1, {0x2c06 }}},
- { 0x2c37, {1, {0x2c07 }}},
- { 0x2c38, {1, {0x2c08 }}},
- { 0x2c39, {1, {0x2c09 }}},
- { 0x2c3a, {1, {0x2c0a }}},
- { 0x2c3b, {1, {0x2c0b }}},
- { 0x2c3c, {1, {0x2c0c }}},
- { 0x2c3d, {1, {0x2c0d }}},
- { 0x2c3e, {1, {0x2c0e }}},
- { 0x2c3f, {1, {0x2c0f }}},
- { 0x2c40, {1, {0x2c10 }}},
- { 0x2c41, {1, {0x2c11 }}},
- { 0x2c42, {1, {0x2c12 }}},
- { 0x2c43, {1, {0x2c13 }}},
- { 0x2c44, {1, {0x2c14 }}},
- { 0x2c45, {1, {0x2c15 }}},
- { 0x2c46, {1, {0x2c16 }}},
- { 0x2c47, {1, {0x2c17 }}},
- { 0x2c48, {1, {0x2c18 }}},
- { 0x2c49, {1, {0x2c19 }}},
- { 0x2c4a, {1, {0x2c1a }}},
- { 0x2c4b, {1, {0x2c1b }}},
- { 0x2c4c, {1, {0x2c1c }}},
- { 0x2c4d, {1, {0x2c1d }}},
- { 0x2c4e, {1, {0x2c1e }}},
- { 0x2c4f, {1, {0x2c1f }}},
- { 0x2c50, {1, {0x2c20 }}},
- { 0x2c51, {1, {0x2c21 }}},
- { 0x2c52, {1, {0x2c22 }}},
- { 0x2c53, {1, {0x2c23 }}},
- { 0x2c54, {1, {0x2c24 }}},
- { 0x2c55, {1, {0x2c25 }}},
- { 0x2c56, {1, {0x2c26 }}},
- { 0x2c57, {1, {0x2c27 }}},
- { 0x2c58, {1, {0x2c28 }}},
- { 0x2c59, {1, {0x2c29 }}},
- { 0x2c5a, {1, {0x2c2a }}},
- { 0x2c5b, {1, {0x2c2b }}},
- { 0x2c5c, {1, {0x2c2c }}},
- { 0x2c5d, {1, {0x2c2d }}},
- { 0x2c5e, {1, {0x2c2e }}},
- { 0x2c81, {1, {0x2c80 }}},
- { 0x2c83, {1, {0x2c82 }}},
- { 0x2c85, {1, {0x2c84 }}},
- { 0x2c87, {1, {0x2c86 }}},
- { 0x2c89, {1, {0x2c88 }}},
- { 0x2c8b, {1, {0x2c8a }}},
- { 0x2c8d, {1, {0x2c8c }}},
- { 0x2c8f, {1, {0x2c8e }}},
- { 0x2c91, {1, {0x2c90 }}},
- { 0x2c93, {1, {0x2c92 }}},
- { 0x2c95, {1, {0x2c94 }}},
- { 0x2c97, {1, {0x2c96 }}},
- { 0x2c99, {1, {0x2c98 }}},
- { 0x2c9b, {1, {0x2c9a }}},
- { 0x2c9d, {1, {0x2c9c }}},
- { 0x2c9f, {1, {0x2c9e }}},
- { 0x2ca1, {1, {0x2ca0 }}},
- { 0x2ca3, {1, {0x2ca2 }}},
- { 0x2ca5, {1, {0x2ca4 }}},
- { 0x2ca7, {1, {0x2ca6 }}},
- { 0x2ca9, {1, {0x2ca8 }}},
- { 0x2cab, {1, {0x2caa }}},
- { 0x2cad, {1, {0x2cac }}},
- { 0x2caf, {1, {0x2cae }}},
- { 0x2cb1, {1, {0x2cb0 }}},
- { 0x2cb3, {1, {0x2cb2 }}},
- { 0x2cb5, {1, {0x2cb4 }}},
- { 0x2cb7, {1, {0x2cb6 }}},
- { 0x2cb9, {1, {0x2cb8 }}},
- { 0x2cbb, {1, {0x2cba }}},
- { 0x2cbd, {1, {0x2cbc }}},
- { 0x2cbf, {1, {0x2cbe }}},
- { 0x2cc1, {1, {0x2cc0 }}},
- { 0x2cc3, {1, {0x2cc2 }}},
- { 0x2cc5, {1, {0x2cc4 }}},
- { 0x2cc7, {1, {0x2cc6 }}},
- { 0x2cc9, {1, {0x2cc8 }}},
- { 0x2ccb, {1, {0x2cca }}},
- { 0x2ccd, {1, {0x2ccc }}},
- { 0x2ccf, {1, {0x2cce }}},
- { 0x2cd1, {1, {0x2cd0 }}},
- { 0x2cd3, {1, {0x2cd2 }}},
- { 0x2cd5, {1, {0x2cd4 }}},
- { 0x2cd7, {1, {0x2cd6 }}},
- { 0x2cd9, {1, {0x2cd8 }}},
- { 0x2cdb, {1, {0x2cda }}},
- { 0x2cdd, {1, {0x2cdc }}},
- { 0x2cdf, {1, {0x2cde }}},
- { 0x2ce1, {1, {0x2ce0 }}},
- { 0x2ce3, {1, {0x2ce2 }}},
- { 0x2d00, {1, {0x10a0 }}},
- { 0x2d01, {1, {0x10a1 }}},
- { 0x2d02, {1, {0x10a2 }}},
- { 0x2d03, {1, {0x10a3 }}},
- { 0x2d04, {1, {0x10a4 }}},
- { 0x2d05, {1, {0x10a5 }}},
- { 0x2d06, {1, {0x10a6 }}},
- { 0x2d07, {1, {0x10a7 }}},
- { 0x2d08, {1, {0x10a8 }}},
- { 0x2d09, {1, {0x10a9 }}},
- { 0x2d0a, {1, {0x10aa }}},
- { 0x2d0b, {1, {0x10ab }}},
- { 0x2d0c, {1, {0x10ac }}},
- { 0x2d0d, {1, {0x10ad }}},
- { 0x2d0e, {1, {0x10ae }}},
- { 0x2d0f, {1, {0x10af }}},
- { 0x2d10, {1, {0x10b0 }}},
- { 0x2d11, {1, {0x10b1 }}},
- { 0x2d12, {1, {0x10b2 }}},
- { 0x2d13, {1, {0x10b3 }}},
- { 0x2d14, {1, {0x10b4 }}},
- { 0x2d15, {1, {0x10b5 }}},
- { 0x2d16, {1, {0x10b6 }}},
- { 0x2d17, {1, {0x10b7 }}},
- { 0x2d18, {1, {0x10b8 }}},
- { 0x2d19, {1, {0x10b9 }}},
- { 0x2d1a, {1, {0x10ba }}},
- { 0x2d1b, {1, {0x10bb }}},
- { 0x2d1c, {1, {0x10bc }}},
- { 0x2d1d, {1, {0x10bd }}},
- { 0x2d1e, {1, {0x10be }}},
- { 0x2d1f, {1, {0x10bf }}},
- { 0x2d20, {1, {0x10c0 }}},
- { 0x2d21, {1, {0x10c1 }}},
- { 0x2d22, {1, {0x10c2 }}},
- { 0x2d23, {1, {0x10c3 }}},
- { 0x2d24, {1, {0x10c4 }}},
- { 0x2d25, {1, {0x10c5 }}},
- { 0xff41, {1, {0xff21 }}},
- { 0xff42, {1, {0xff22 }}},
- { 0xff43, {1, {0xff23 }}},
- { 0xff44, {1, {0xff24 }}},
- { 0xff45, {1, {0xff25 }}},
- { 0xff46, {1, {0xff26 }}},
- { 0xff47, {1, {0xff27 }}},
- { 0xff48, {1, {0xff28 }}},
- { 0xff49, {1, {0xff29 }}},
- { 0xff4a, {1, {0xff2a }}},
- { 0xff4b, {1, {0xff2b }}},
- { 0xff4c, {1, {0xff2c }}},
- { 0xff4d, {1, {0xff2d }}},
- { 0xff4e, {1, {0xff2e }}},
- { 0xff4f, {1, {0xff2f }}},
- { 0xff50, {1, {0xff30 }}},
- { 0xff51, {1, {0xff31 }}},
- { 0xff52, {1, {0xff32 }}},
- { 0xff53, {1, {0xff33 }}},
- { 0xff54, {1, {0xff34 }}},
- { 0xff55, {1, {0xff35 }}},
- { 0xff56, {1, {0xff36 }}},
- { 0xff57, {1, {0xff37 }}},
- { 0xff58, {1, {0xff38 }}},
- { 0xff59, {1, {0xff39 }}},
- { 0xff5a, {1, {0xff3a }}},
- { 0x10428, {1, {0x10400 }}},
- { 0x10429, {1, {0x10401 }}},
- { 0x1042a, {1, {0x10402 }}},
- { 0x1042b, {1, {0x10403 }}},
- { 0x1042c, {1, {0x10404 }}},
- { 0x1042d, {1, {0x10405 }}},
- { 0x1042e, {1, {0x10406 }}},
- { 0x1042f, {1, {0x10407 }}},
- { 0x10430, {1, {0x10408 }}},
- { 0x10431, {1, {0x10409 }}},
- { 0x10432, {1, {0x1040a }}},
- { 0x10433, {1, {0x1040b }}},
- { 0x10434, {1, {0x1040c }}},
- { 0x10435, {1, {0x1040d }}},
- { 0x10436, {1, {0x1040e }}},
- { 0x10437, {1, {0x1040f }}},
- { 0x10438, {1, {0x10410 }}},
- { 0x10439, {1, {0x10411 }}},
- { 0x1043a, {1, {0x10412 }}},
- { 0x1043b, {1, {0x10413 }}},
- { 0x1043c, {1, {0x10414 }}},
- { 0x1043d, {1, {0x10415 }}},
- { 0x1043e, {1, {0x10416 }}},
- { 0x1043f, {1, {0x10417 }}},
- { 0x10440, {1, {0x10418 }}},
- { 0x10441, {1, {0x10419 }}},
- { 0x10442, {1, {0x1041a }}},
- { 0x10443, {1, {0x1041b }}},
- { 0x10444, {1, {0x1041c }}},
- { 0x10445, {1, {0x1041d }}},
- { 0x10446, {1, {0x1041e }}},
- { 0x10447, {1, {0x1041f }}},
- { 0x10448, {1, {0x10420 }}},
- { 0x10449, {1, {0x10421 }}},
- { 0x1044a, {1, {0x10422 }}},
- { 0x1044b, {1, {0x10423 }}},
- { 0x1044c, {1, {0x10424 }}},
- { 0x1044d, {1, {0x10425 }}},
- { 0x1044e, {1, {0x10426 }}},
- { 0x1044f, {1, {0x10427 }}}
-};
-
-static const CaseUnfold_11_Type CaseUnfold_11_Locale[] = {
- { 0x0069, {1, {0x0049 }}}
-};
-
-static const CaseUnfold_12_Type CaseUnfold_12[] = {
- { {0x0061, 0x02be}, {1, {0x1e9a }}},
- { {0x0066, 0x0066}, {1, {0xfb00 }}},
- { {0x0066, 0x0069}, {1, {0xfb01 }}},
- { {0x0066, 0x006c}, {1, {0xfb02 }}},
- { {0x0068, 0x0331}, {1, {0x1e96 }}},
- { {0x006a, 0x030c}, {1, {0x01f0 }}},
- { {0x0073, 0x0073}, {1, {0x00df }}},
- { {0x0073, 0x0074}, {2, {0xfb05, 0xfb06 }}},
- { {0x0074, 0x0308}, {1, {0x1e97 }}},
- { {0x0077, 0x030a}, {1, {0x1e98 }}},
- { {0x0079, 0x030a}, {1, {0x1e99 }}},
- { {0x02bc, 0x006e}, {1, {0x0149 }}},
- { {0x03ac, 0x03b9}, {1, {0x1fb4 }}},
- { {0x03ae, 0x03b9}, {1, {0x1fc4 }}},
- { {0x03b1, 0x0342}, {1, {0x1fb6 }}},
- { {0x03b1, 0x03b9}, {2, {0x1fb3, 0x1fbc }}},
- { {0x03b7, 0x0342}, {1, {0x1fc6 }}},
- { {0x03b7, 0x03b9}, {2, {0x1fc3, 0x1fcc }}},
- { {0x03b9, 0x0342}, {1, {0x1fd6 }}},
- { {0x03c1, 0x0313}, {1, {0x1fe4 }}},
- { {0x03c5, 0x0313}, {1, {0x1f50 }}},
- { {0x03c5, 0x0342}, {1, {0x1fe6 }}},
- { {0x03c9, 0x0342}, {1, {0x1ff6 }}},
- { {0x03c9, 0x03b9}, {2, {0x1ff3, 0x1ffc }}},
- { {0x03ce, 0x03b9}, {1, {0x1ff4 }}},
- { {0x0565, 0x0582}, {1, {0x0587 }}},
- { {0x0574, 0x0565}, {1, {0xfb14 }}},
- { {0x0574, 0x056b}, {1, {0xfb15 }}},
- { {0x0574, 0x056d}, {1, {0xfb17 }}},
- { {0x0574, 0x0576}, {1, {0xfb13 }}},
- { {0x057e, 0x0576}, {1, {0xfb16 }}},
- { {0x1f00, 0x03b9}, {2, {0x1f88, 0x1f80 }}},
- { {0x1f01, 0x03b9}, {2, {0x1f81, 0x1f89 }}},
- { {0x1f02, 0x03b9}, {2, {0x1f82, 0x1f8a }}},
- { {0x1f03, 0x03b9}, {2, {0x1f83, 0x1f8b }}},
- { {0x1f04, 0x03b9}, {2, {0x1f84, 0x1f8c }}},
- { {0x1f05, 0x03b9}, {2, {0x1f85, 0x1f8d }}},
- { {0x1f06, 0x03b9}, {2, {0x1f86, 0x1f8e }}},
- { {0x1f07, 0x03b9}, {2, {0x1f87, 0x1f8f }}},
- { {0x1f20, 0x03b9}, {2, {0x1f90, 0x1f98 }}},
- { {0x1f21, 0x03b9}, {2, {0x1f91, 0x1f99 }}},
- { {0x1f22, 0x03b9}, {2, {0x1f92, 0x1f9a }}},
- { {0x1f23, 0x03b9}, {2, {0x1f93, 0x1f9b }}},
- { {0x1f24, 0x03b9}, {2, {0x1f94, 0x1f9c }}},
- { {0x1f25, 0x03b9}, {2, {0x1f95, 0x1f9d }}},
- { {0x1f26, 0x03b9}, {2, {0x1f96, 0x1f9e }}},
- { {0x1f27, 0x03b9}, {2, {0x1f97, 0x1f9f }}},
- { {0x1f60, 0x03b9}, {2, {0x1fa0, 0x1fa8 }}},
- { {0x1f61, 0x03b9}, {2, {0x1fa1, 0x1fa9 }}},
- { {0x1f62, 0x03b9}, {2, {0x1fa2, 0x1faa }}},
- { {0x1f63, 0x03b9}, {2, {0x1fa3, 0x1fab }}},
- { {0x1f64, 0x03b9}, {2, {0x1fa4, 0x1fac }}},
- { {0x1f65, 0x03b9}, {2, {0x1fa5, 0x1fad }}},
- { {0x1f66, 0x03b9}, {2, {0x1fa6, 0x1fae }}},
- { {0x1f67, 0x03b9}, {2, {0x1fa7, 0x1faf }}},
- { {0x1f70, 0x03b9}, {1, {0x1fb2 }}},
- { {0x1f74, 0x03b9}, {1, {0x1fc2 }}},
- { {0x1f7c, 0x03b9}, {1, {0x1ff2 }}}
-};
+#include "enc/unicode/casefold.h"
-static const CaseUnfold_12_Type CaseUnfold_12_Locale[] = {
- { {0x0069, 0x0307}, {1, {0x0130 }}}
-};
-
-static const CaseUnfold_13_Type CaseUnfold_13[] = {
- { {0x0066, 0x0066, 0x0069}, {1, {0xfb03 }}},
- { {0x0066, 0x0066, 0x006c}, {1, {0xfb04 }}},
- { {0x03b1, 0x0342, 0x03b9}, {1, {0x1fb7 }}},
- { {0x03b7, 0x0342, 0x03b9}, {1, {0x1fc7 }}},
- { {0x03b9, 0x0308, 0x0300}, {1, {0x1fd2 }}},
- { {0x03b9, 0x0308, 0x0301}, {2, {0x0390, 0x1fd3 }}},
- { {0x03b9, 0x0308, 0x0342}, {1, {0x1fd7 }}},
- { {0x03c5, 0x0308, 0x0300}, {1, {0x1fe2 }}},
- { {0x03c5, 0x0308, 0x0301}, {2, {0x03b0, 0x1fe3 }}},
- { {0x03c5, 0x0308, 0x0342}, {1, {0x1fe7 }}},
- { {0x03c5, 0x0313, 0x0300}, {1, {0x1f52 }}},
- { {0x03c5, 0x0313, 0x0301}, {1, {0x1f54 }}},
- { {0x03c5, 0x0313, 0x0342}, {1, {0x1f56 }}},
- { {0x03c9, 0x0342, 0x03b9}, {1, {0x1ff7 }}}
-};
#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
#define CODE_RANGES_NUM numberof(CodeRanges)
@@ -2080,7 +151,7 @@ onigenc_utf16_32_get_ctype_code_range(OnigCtype ctype, OnigCodePoint* sb_out,
#include "ruby/st.h"
-#define PROPERTY_NAME_MAX_SIZE MAX_WORD_LENGTH
+#define PROPERTY_NAME_MAX_SIZE (MAX_WORD_LENGTH + 1)
extern int
onigenc_unicode_property_name_to_ctype(OnigEncoding enc, UChar* name, UChar* end)
@@ -2099,7 +170,7 @@ onigenc_unicode_property_name_to_ctype(OnigEncoding enc, UChar* name, UChar* end
if (code >= 0x80)
return ONIGERR_INVALID_CHAR_PROPERTY_NAME;
- buf[len++] = (UChar )TOLOWER((unsigned char)code);
+ buf[len++] = ONIGENC_ASCII_CODE_TO_LOWER_CASE(code);
if (len >= PROPERTY_NAME_MAX_SIZE)
return ONIGERR_INVALID_CHAR_PROPERTY_NAME;
}
@@ -2167,7 +238,7 @@ static int init_case_fold_table(void)
THREAD_ATOMIC_START;
- FoldTable = st_init_numtable_with_size(1200);
+ FoldTable = st_init_numtable_with_size(FOLD_TABLE_SIZE);
if (ONIG_IS_NULL(FoldTable)) return ONIGERR_MEMORY;
for (i = 0; i < numberof(CaseFold); i++) {
p = &CaseFold[i];
@@ -2178,7 +249,7 @@ static int init_case_fold_table(void)
st_add_direct(FoldTable, (st_data_t )p->from, (st_data_t )&(p->to));
}
- Unfold1Table = st_init_numtable_with_size(1000);
+ Unfold1Table = st_init_numtable_with_size(UNFOLD1_TABLE_SIZE);
if (ONIG_IS_NULL(Unfold1Table)) return ONIGERR_MEMORY;
for (i = 0; i < numberof(CaseUnfold_11); i++) {
@@ -2190,7 +261,7 @@ static int init_case_fold_table(void)
st_add_direct(Unfold1Table, (st_data_t )p1->from, (st_data_t )&(p1->to));
}
- Unfold2Table = st_init_table_with_size(&type_code2_hash, 200);
+ Unfold2Table = st_init_table_with_size(&type_code2_hash, UNFOLD2_TABLE_SIZE);
if (ONIG_IS_NULL(Unfold2Table)) return ONIGERR_MEMORY;
for (i = 0; i < numberof(CaseUnfold_12); i++) {
@@ -2202,7 +273,7 @@ static int init_case_fold_table(void)
st_add_direct(Unfold2Table, (st_data_t )p2->from, (st_data_t )(&p2->to));
}
- Unfold3Table = st_init_table_with_size(&type_code3_hash, 30);
+ Unfold3Table = st_init_table_with_size(&type_code3_hash, UNFOLD3_TABLE_SIZE);
if (ONIG_IS_NULL(Unfold3Table)) return ONIGERR_MEMORY;
for (i = 0; i < numberof(CaseUnfold_13); i++) {
diff --git a/enc/unicode/casefold.h b/enc/unicode/casefold.h
new file mode 100644
index 0000000000..b9559de4a3
--- /dev/null
+++ b/enc/unicode/casefold.h
@@ -0,0 +1,2238 @@
+/* DO NOT EDIT THIS FILE. */
+/* Generated by tool/CaseFolding.py */
+
+static const CaseFold_11_Type CaseFold[] = {
+ { 0x0041, {1, {0x0061}}},
+ { 0x0042, {1, {0x0062}}},
+ { 0x0043, {1, {0x0063}}},
+ { 0x0044, {1, {0x0064}}},
+ { 0x0045, {1, {0x0065}}},
+ { 0x0046, {1, {0x0066}}},
+ { 0x0047, {1, {0x0067}}},
+ { 0x0048, {1, {0x0068}}},
+ { 0x004a, {1, {0x006a}}},
+ { 0x004b, {1, {0x006b}}},
+ { 0x004c, {1, {0x006c}}},
+ { 0x004d, {1, {0x006d}}},
+ { 0x004e, {1, {0x006e}}},
+ { 0x004f, {1, {0x006f}}},
+ { 0x0050, {1, {0x0070}}},
+ { 0x0051, {1, {0x0071}}},
+ { 0x0052, {1, {0x0072}}},
+ { 0x0053, {1, {0x0073}}},
+ { 0x0054, {1, {0x0074}}},
+ { 0x0055, {1, {0x0075}}},
+ { 0x0056, {1, {0x0076}}},
+ { 0x0057, {1, {0x0077}}},
+ { 0x0058, {1, {0x0078}}},
+ { 0x0059, {1, {0x0079}}},
+ { 0x005a, {1, {0x007a}}},
+ { 0x00b5, {1, {0x03bc}}},
+ { 0x00c0, {1, {0x00e0}}},
+ { 0x00c1, {1, {0x00e1}}},
+ { 0x00c2, {1, {0x00e2}}},
+ { 0x00c3, {1, {0x00e3}}},
+ { 0x00c4, {1, {0x00e4}}},
+ { 0x00c5, {1, {0x00e5}}},
+ { 0x00c6, {1, {0x00e6}}},
+ { 0x00c7, {1, {0x00e7}}},
+ { 0x00c8, {1, {0x00e8}}},
+ { 0x00c9, {1, {0x00e9}}},
+ { 0x00ca, {1, {0x00ea}}},
+ { 0x00cb, {1, {0x00eb}}},
+ { 0x00cc, {1, {0x00ec}}},
+ { 0x00cd, {1, {0x00ed}}},
+ { 0x00ce, {1, {0x00ee}}},
+ { 0x00cf, {1, {0x00ef}}},
+ { 0x00d0, {1, {0x00f0}}},
+ { 0x00d1, {1, {0x00f1}}},
+ { 0x00d2, {1, {0x00f2}}},
+ { 0x00d3, {1, {0x00f3}}},
+ { 0x00d4, {1, {0x00f4}}},
+ { 0x00d5, {1, {0x00f5}}},
+ { 0x00d6, {1, {0x00f6}}},
+ { 0x00d8, {1, {0x00f8}}},
+ { 0x00d9, {1, {0x00f9}}},
+ { 0x00da, {1, {0x00fa}}},
+ { 0x00db, {1, {0x00fb}}},
+ { 0x00dc, {1, {0x00fc}}},
+ { 0x00dd, {1, {0x00fd}}},
+ { 0x00de, {1, {0x00fe}}},
+ { 0x00df, {2, {0x0073, 0x0073}}},
+ { 0x0100, {1, {0x0101}}},
+ { 0x0102, {1, {0x0103}}},
+ { 0x0104, {1, {0x0105}}},
+ { 0x0106, {1, {0x0107}}},
+ { 0x0108, {1, {0x0109}}},
+ { 0x010a, {1, {0x010b}}},
+ { 0x010c, {1, {0x010d}}},
+ { 0x010e, {1, {0x010f}}},
+ { 0x0110, {1, {0x0111}}},
+ { 0x0112, {1, {0x0113}}},
+ { 0x0114, {1, {0x0115}}},
+ { 0x0116, {1, {0x0117}}},
+ { 0x0118, {1, {0x0119}}},
+ { 0x011a, {1, {0x011b}}},
+ { 0x011c, {1, {0x011d}}},
+ { 0x011e, {1, {0x011f}}},
+ { 0x0120, {1, {0x0121}}},
+ { 0x0122, {1, {0x0123}}},
+ { 0x0124, {1, {0x0125}}},
+ { 0x0126, {1, {0x0127}}},
+ { 0x0128, {1, {0x0129}}},
+ { 0x012a, {1, {0x012b}}},
+ { 0x012c, {1, {0x012d}}},
+ { 0x012e, {1, {0x012f}}},
+ { 0x0132, {1, {0x0133}}},
+ { 0x0134, {1, {0x0135}}},
+ { 0x0136, {1, {0x0137}}},
+ { 0x0139, {1, {0x013a}}},
+ { 0x013b, {1, {0x013c}}},
+ { 0x013d, {1, {0x013e}}},
+ { 0x013f, {1, {0x0140}}},
+ { 0x0141, {1, {0x0142}}},
+ { 0x0143, {1, {0x0144}}},
+ { 0x0145, {1, {0x0146}}},
+ { 0x0147, {1, {0x0148}}},
+ { 0x0149, {2, {0x02bc, 0x006e}}},
+ { 0x014a, {1, {0x014b}}},
+ { 0x014c, {1, {0x014d}}},
+ { 0x014e, {1, {0x014f}}},
+ { 0x0150, {1, {0x0151}}},
+ { 0x0152, {1, {0x0153}}},
+ { 0x0154, {1, {0x0155}}},
+ { 0x0156, {1, {0x0157}}},
+ { 0x0158, {1, {0x0159}}},
+ { 0x015a, {1, {0x015b}}},
+ { 0x015c, {1, {0x015d}}},
+ { 0x015e, {1, {0x015f}}},
+ { 0x0160, {1, {0x0161}}},
+ { 0x0162, {1, {0x0163}}},
+ { 0x0164, {1, {0x0165}}},
+ { 0x0166, {1, {0x0167}}},
+ { 0x0168, {1, {0x0169}}},
+ { 0x016a, {1, {0x016b}}},
+ { 0x016c, {1, {0x016d}}},
+ { 0x016e, {1, {0x016f}}},
+ { 0x0170, {1, {0x0171}}},
+ { 0x0172, {1, {0x0173}}},
+ { 0x0174, {1, {0x0175}}},
+ { 0x0176, {1, {0x0177}}},
+ { 0x0178, {1, {0x00ff}}},
+ { 0x0179, {1, {0x017a}}},
+ { 0x017b, {1, {0x017c}}},
+ { 0x017d, {1, {0x017e}}},
+ { 0x017f, {1, {0x0073}}},
+ { 0x0181, {1, {0x0253}}},
+ { 0x0182, {1, {0x0183}}},
+ { 0x0184, {1, {0x0185}}},
+ { 0x0186, {1, {0x0254}}},
+ { 0x0187, {1, {0x0188}}},
+ { 0x0189, {1, {0x0256}}},
+ { 0x018a, {1, {0x0257}}},
+ { 0x018b, {1, {0x018c}}},
+ { 0x018e, {1, {0x01dd}}},
+ { 0x018f, {1, {0x0259}}},
+ { 0x0190, {1, {0x025b}}},
+ { 0x0191, {1, {0x0192}}},
+ { 0x0193, {1, {0x0260}}},
+ { 0x0194, {1, {0x0263}}},
+ { 0x0196, {1, {0x0269}}},
+ { 0x0197, {1, {0x0268}}},
+ { 0x0198, {1, {0x0199}}},
+ { 0x019c, {1, {0x026f}}},
+ { 0x019d, {1, {0x0272}}},
+ { 0x019f, {1, {0x0275}}},
+ { 0x01a0, {1, {0x01a1}}},
+ { 0x01a2, {1, {0x01a3}}},
+ { 0x01a4, {1, {0x01a5}}},
+ { 0x01a6, {1, {0x0280}}},
+ { 0x01a7, {1, {0x01a8}}},
+ { 0x01a9, {1, {0x0283}}},
+ { 0x01ac, {1, {0x01ad}}},
+ { 0x01ae, {1, {0x0288}}},
+ { 0x01af, {1, {0x01b0}}},
+ { 0x01b1, {1, {0x028a}}},
+ { 0x01b2, {1, {0x028b}}},
+ { 0x01b3, {1, {0x01b4}}},
+ { 0x01b5, {1, {0x01b6}}},
+ { 0x01b7, {1, {0x0292}}},
+ { 0x01b8, {1, {0x01b9}}},
+ { 0x01bc, {1, {0x01bd}}},
+ { 0x01c4, {1, {0x01c6}}},
+ { 0x01c5, {1, {0x01c6}}},
+ { 0x01c7, {1, {0x01c9}}},
+ { 0x01c8, {1, {0x01c9}}},
+ { 0x01ca, {1, {0x01cc}}},
+ { 0x01cb, {1, {0x01cc}}},
+ { 0x01cd, {1, {0x01ce}}},
+ { 0x01cf, {1, {0x01d0}}},
+ { 0x01d1, {1, {0x01d2}}},
+ { 0x01d3, {1, {0x01d4}}},
+ { 0x01d5, {1, {0x01d6}}},
+ { 0x01d7, {1, {0x01d8}}},
+ { 0x01d9, {1, {0x01da}}},
+ { 0x01db, {1, {0x01dc}}},
+ { 0x01de, {1, {0x01df}}},
+ { 0x01e0, {1, {0x01e1}}},
+ { 0x01e2, {1, {0x01e3}}},
+ { 0x01e4, {1, {0x01e5}}},
+ { 0x01e6, {1, {0x01e7}}},
+ { 0x01e8, {1, {0x01e9}}},
+ { 0x01ea, {1, {0x01eb}}},
+ { 0x01ec, {1, {0x01ed}}},
+ { 0x01ee, {1, {0x01ef}}},
+ { 0x01f0, {2, {0x006a, 0x030c}}},
+ { 0x01f1, {1, {0x01f3}}},
+ { 0x01f2, {1, {0x01f3}}},
+ { 0x01f4, {1, {0x01f5}}},
+ { 0x01f6, {1, {0x0195}}},
+ { 0x01f7, {1, {0x01bf}}},
+ { 0x01f8, {1, {0x01f9}}},
+ { 0x01fa, {1, {0x01fb}}},
+ { 0x01fc, {1, {0x01fd}}},
+ { 0x01fe, {1, {0x01ff}}},
+ { 0x0200, {1, {0x0201}}},
+ { 0x0202, {1, {0x0203}}},
+ { 0x0204, {1, {0x0205}}},
+ { 0x0206, {1, {0x0207}}},
+ { 0x0208, {1, {0x0209}}},
+ { 0x020a, {1, {0x020b}}},
+ { 0x020c, {1, {0x020d}}},
+ { 0x020e, {1, {0x020f}}},
+ { 0x0210, {1, {0x0211}}},
+ { 0x0212, {1, {0x0213}}},
+ { 0x0214, {1, {0x0215}}},
+ { 0x0216, {1, {0x0217}}},
+ { 0x0218, {1, {0x0219}}},
+ { 0x021a, {1, {0x021b}}},
+ { 0x021c, {1, {0x021d}}},
+ { 0x021e, {1, {0x021f}}},
+ { 0x0220, {1, {0x019e}}},
+ { 0x0222, {1, {0x0223}}},
+ { 0x0224, {1, {0x0225}}},
+ { 0x0226, {1, {0x0227}}},
+ { 0x0228, {1, {0x0229}}},
+ { 0x022a, {1, {0x022b}}},
+ { 0x022c, {1, {0x022d}}},
+ { 0x022e, {1, {0x022f}}},
+ { 0x0230, {1, {0x0231}}},
+ { 0x0232, {1, {0x0233}}},
+ { 0x023a, {1, {0x2c65}}},
+ { 0x023b, {1, {0x023c}}},
+ { 0x023d, {1, {0x019a}}},
+ { 0x023e, {1, {0x2c66}}},
+ { 0x0241, {1, {0x0242}}},
+ { 0x0243, {1, {0x0180}}},
+ { 0x0244, {1, {0x0289}}},
+ { 0x0245, {1, {0x028c}}},
+ { 0x0246, {1, {0x0247}}},
+ { 0x0248, {1, {0x0249}}},
+ { 0x024a, {1, {0x024b}}},
+ { 0x024c, {1, {0x024d}}},
+ { 0x024e, {1, {0x024f}}},
+ { 0x0345, {1, {0x03b9}}},
+ { 0x0370, {1, {0x0371}}},
+ { 0x0372, {1, {0x0373}}},
+ { 0x0376, {1, {0x0377}}},
+ { 0x0386, {1, {0x03ac}}},
+ { 0x0388, {1, {0x03ad}}},
+ { 0x0389, {1, {0x03ae}}},
+ { 0x038a, {1, {0x03af}}},
+ { 0x038c, {1, {0x03cc}}},
+ { 0x038e, {1, {0x03cd}}},
+ { 0x038f, {1, {0x03ce}}},
+ { 0x0390, {3, {0x03b9, 0x0308, 0x0301}}},
+ { 0x0391, {1, {0x03b1}}},
+ { 0x0392, {1, {0x03b2}}},
+ { 0x0393, {1, {0x03b3}}},
+ { 0x0394, {1, {0x03b4}}},
+ { 0x0395, {1, {0x03b5}}},
+ { 0x0396, {1, {0x03b6}}},
+ { 0x0397, {1, {0x03b7}}},
+ { 0x0398, {1, {0x03b8}}},
+ { 0x0399, {1, {0x03b9}}},
+ { 0x039a, {1, {0x03ba}}},
+ { 0x039b, {1, {0x03bb}}},
+ { 0x039c, {1, {0x03bc}}},
+ { 0x039d, {1, {0x03bd}}},
+ { 0x039e, {1, {0x03be}}},
+ { 0x039f, {1, {0x03bf}}},
+ { 0x03a0, {1, {0x03c0}}},
+ { 0x03a1, {1, {0x03c1}}},
+ { 0x03a3, {1, {0x03c3}}},
+ { 0x03a4, {1, {0x03c4}}},
+ { 0x03a5, {1, {0x03c5}}},
+ { 0x03a6, {1, {0x03c6}}},
+ { 0x03a7, {1, {0x03c7}}},
+ { 0x03a8, {1, {0x03c8}}},
+ { 0x03a9, {1, {0x03c9}}},
+ { 0x03aa, {1, {0x03ca}}},
+ { 0x03ab, {1, {0x03cb}}},
+ { 0x03b0, {3, {0x03c5, 0x0308, 0x0301}}},
+ { 0x03c2, {1, {0x03c3}}},
+ { 0x03cf, {1, {0x03d7}}},
+ { 0x03d0, {1, {0x03b2}}},
+ { 0x03d1, {1, {0x03b8}}},
+ { 0x03d5, {1, {0x03c6}}},
+ { 0x03d6, {1, {0x03c0}}},
+ { 0x03d8, {1, {0x03d9}}},
+ { 0x03da, {1, {0x03db}}},
+ { 0x03dc, {1, {0x03dd}}},
+ { 0x03de, {1, {0x03df}}},
+ { 0x03e0, {1, {0x03e1}}},
+ { 0x03e2, {1, {0x03e3}}},
+ { 0x03e4, {1, {0x03e5}}},
+ { 0x03e6, {1, {0x03e7}}},
+ { 0x03e8, {1, {0x03e9}}},
+ { 0x03ea, {1, {0x03eb}}},
+ { 0x03ec, {1, {0x03ed}}},
+ { 0x03ee, {1, {0x03ef}}},
+ { 0x03f0, {1, {0x03ba}}},
+ { 0x03f1, {1, {0x03c1}}},
+ { 0x03f4, {1, {0x03b8}}},
+ { 0x03f5, {1, {0x03b5}}},
+ { 0x03f7, {1, {0x03f8}}},
+ { 0x03f9, {1, {0x03f2}}},
+ { 0x03fa, {1, {0x03fb}}},
+ { 0x03fd, {1, {0x037b}}},
+ { 0x03fe, {1, {0x037c}}},
+ { 0x03ff, {1, {0x037d}}},
+ { 0x0400, {1, {0x0450}}},
+ { 0x0401, {1, {0x0451}}},
+ { 0x0402, {1, {0x0452}}},
+ { 0x0403, {1, {0x0453}}},
+ { 0x0404, {1, {0x0454}}},
+ { 0x0405, {1, {0x0455}}},
+ { 0x0406, {1, {0x0456}}},
+ { 0x0407, {1, {0x0457}}},
+ { 0x0408, {1, {0x0458}}},
+ { 0x0409, {1, {0x0459}}},
+ { 0x040a, {1, {0x045a}}},
+ { 0x040b, {1, {0x045b}}},
+ { 0x040c, {1, {0x045c}}},
+ { 0x040d, {1, {0x045d}}},
+ { 0x040e, {1, {0x045e}}},
+ { 0x040f, {1, {0x045f}}},
+ { 0x0410, {1, {0x0430}}},
+ { 0x0411, {1, {0x0431}}},
+ { 0x0412, {1, {0x0432}}},
+ { 0x0413, {1, {0x0433}}},
+ { 0x0414, {1, {0x0434}}},
+ { 0x0415, {1, {0x0435}}},
+ { 0x0416, {1, {0x0436}}},
+ { 0x0417, {1, {0x0437}}},
+ { 0x0418, {1, {0x0438}}},
+ { 0x0419, {1, {0x0439}}},
+ { 0x041a, {1, {0x043a}}},
+ { 0x041b, {1, {0x043b}}},
+ { 0x041c, {1, {0x043c}}},
+ { 0x041d, {1, {0x043d}}},
+ { 0x041e, {1, {0x043e}}},
+ { 0x041f, {1, {0x043f}}},
+ { 0x0420, {1, {0x0440}}},
+ { 0x0421, {1, {0x0441}}},
+ { 0x0422, {1, {0x0442}}},
+ { 0x0423, {1, {0x0443}}},
+ { 0x0424, {1, {0x0444}}},
+ { 0x0425, {1, {0x0445}}},
+ { 0x0426, {1, {0x0446}}},
+ { 0x0427, {1, {0x0447}}},
+ { 0x0428, {1, {0x0448}}},
+ { 0x0429, {1, {0x0449}}},
+ { 0x042a, {1, {0x044a}}},
+ { 0x042b, {1, {0x044b}}},
+ { 0x042c, {1, {0x044c}}},
+ { 0x042d, {1, {0x044d}}},
+ { 0x042e, {1, {0x044e}}},
+ { 0x042f, {1, {0x044f}}},
+ { 0x0460, {1, {0x0461}}},
+ { 0x0462, {1, {0x0463}}},
+ { 0x0464, {1, {0x0465}}},
+ { 0x0466, {1, {0x0467}}},
+ { 0x0468, {1, {0x0469}}},
+ { 0x046a, {1, {0x046b}}},
+ { 0x046c, {1, {0x046d}}},
+ { 0x046e, {1, {0x046f}}},
+ { 0x0470, {1, {0x0471}}},
+ { 0x0472, {1, {0x0473}}},
+ { 0x0474, {1, {0x0475}}},
+ { 0x0476, {1, {0x0477}}},
+ { 0x0478, {1, {0x0479}}},
+ { 0x047a, {1, {0x047b}}},
+ { 0x047c, {1, {0x047d}}},
+ { 0x047e, {1, {0x047f}}},
+ { 0x0480, {1, {0x0481}}},
+ { 0x048a, {1, {0x048b}}},
+ { 0x048c, {1, {0x048d}}},
+ { 0x048e, {1, {0x048f}}},
+ { 0x0490, {1, {0x0491}}},
+ { 0x0492, {1, {0x0493}}},
+ { 0x0494, {1, {0x0495}}},
+ { 0x0496, {1, {0x0497}}},
+ { 0x0498, {1, {0x0499}}},
+ { 0x049a, {1, {0x049b}}},
+ { 0x049c, {1, {0x049d}}},
+ { 0x049e, {1, {0x049f}}},
+ { 0x04a0, {1, {0x04a1}}},
+ { 0x04a2, {1, {0x04a3}}},
+ { 0x04a4, {1, {0x04a5}}},
+ { 0x04a6, {1, {0x04a7}}},
+ { 0x04a8, {1, {0x04a9}}},
+ { 0x04aa, {1, {0x04ab}}},
+ { 0x04ac, {1, {0x04ad}}},
+ { 0x04ae, {1, {0x04af}}},
+ { 0x04b0, {1, {0x04b1}}},
+ { 0x04b2, {1, {0x04b3}}},
+ { 0x04b4, {1, {0x04b5}}},
+ { 0x04b6, {1, {0x04b7}}},
+ { 0x04b8, {1, {0x04b9}}},
+ { 0x04ba, {1, {0x04bb}}},
+ { 0x04bc, {1, {0x04bd}}},
+ { 0x04be, {1, {0x04bf}}},
+ { 0x04c0, {1, {0x04cf}}},
+ { 0x04c1, {1, {0x04c2}}},
+ { 0x04c3, {1, {0x04c4}}},
+ { 0x04c5, {1, {0x04c6}}},
+ { 0x04c7, {1, {0x04c8}}},
+ { 0x04c9, {1, {0x04ca}}},
+ { 0x04cb, {1, {0x04cc}}},
+ { 0x04cd, {1, {0x04ce}}},
+ { 0x04d0, {1, {0x04d1}}},
+ { 0x04d2, {1, {0x04d3}}},
+ { 0x04d4, {1, {0x04d5}}},
+ { 0x04d6, {1, {0x04d7}}},
+ { 0x04d8, {1, {0x04d9}}},
+ { 0x04da, {1, {0x04db}}},
+ { 0x04dc, {1, {0x04dd}}},
+ { 0x04de, {1, {0x04df}}},
+ { 0x04e0, {1, {0x04e1}}},
+ { 0x04e2, {1, {0x04e3}}},
+ { 0x04e4, {1, {0x04e5}}},
+ { 0x04e6, {1, {0x04e7}}},
+ { 0x04e8, {1, {0x04e9}}},
+ { 0x04ea, {1, {0x04eb}}},
+ { 0x04ec, {1, {0x04ed}}},
+ { 0x04ee, {1, {0x04ef}}},
+ { 0x04f0, {1, {0x04f1}}},
+ { 0x04f2, {1, {0x04f3}}},
+ { 0x04f4, {1, {0x04f5}}},
+ { 0x04f6, {1, {0x04f7}}},
+ { 0x04f8, {1, {0x04f9}}},
+ { 0x04fa, {1, {0x04fb}}},
+ { 0x04fc, {1, {0x04fd}}},
+ { 0x04fe, {1, {0x04ff}}},
+ { 0x0500, {1, {0x0501}}},
+ { 0x0502, {1, {0x0503}}},
+ { 0x0504, {1, {0x0505}}},
+ { 0x0506, {1, {0x0507}}},
+ { 0x0508, {1, {0x0509}}},
+ { 0x050a, {1, {0x050b}}},
+ { 0x050c, {1, {0x050d}}},
+ { 0x050e, {1, {0x050f}}},
+ { 0x0510, {1, {0x0511}}},
+ { 0x0512, {1, {0x0513}}},
+ { 0x0514, {1, {0x0515}}},
+ { 0x0516, {1, {0x0517}}},
+ { 0x0518, {1, {0x0519}}},
+ { 0x051a, {1, {0x051b}}},
+ { 0x051c, {1, {0x051d}}},
+ { 0x051e, {1, {0x051f}}},
+ { 0x0520, {1, {0x0521}}},
+ { 0x0522, {1, {0x0523}}},
+ { 0x0524, {1, {0x0525}}},
+ { 0x0526, {1, {0x0527}}},
+ { 0x0531, {1, {0x0561}}},
+ { 0x0532, {1, {0x0562}}},
+ { 0x0533, {1, {0x0563}}},
+ { 0x0534, {1, {0x0564}}},
+ { 0x0535, {1, {0x0565}}},
+ { 0x0536, {1, {0x0566}}},
+ { 0x0537, {1, {0x0567}}},
+ { 0x0538, {1, {0x0568}}},
+ { 0x0539, {1, {0x0569}}},
+ { 0x053a, {1, {0x056a}}},
+ { 0x053b, {1, {0x056b}}},
+ { 0x053c, {1, {0x056c}}},
+ { 0x053d, {1, {0x056d}}},
+ { 0x053e, {1, {0x056e}}},
+ { 0x053f, {1, {0x056f}}},
+ { 0x0540, {1, {0x0570}}},
+ { 0x0541, {1, {0x0571}}},
+ { 0x0542, {1, {0x0572}}},
+ { 0x0543, {1, {0x0573}}},
+ { 0x0544, {1, {0x0574}}},
+ { 0x0545, {1, {0x0575}}},
+ { 0x0546, {1, {0x0576}}},
+ { 0x0547, {1, {0x0577}}},
+ { 0x0548, {1, {0x0578}}},
+ { 0x0549, {1, {0x0579}}},
+ { 0x054a, {1, {0x057a}}},
+ { 0x054b, {1, {0x057b}}},
+ { 0x054c, {1, {0x057c}}},
+ { 0x054d, {1, {0x057d}}},
+ { 0x054e, {1, {0x057e}}},
+ { 0x054f, {1, {0x057f}}},
+ { 0x0550, {1, {0x0580}}},
+ { 0x0551, {1, {0x0581}}},
+ { 0x0552, {1, {0x0582}}},
+ { 0x0553, {1, {0x0583}}},
+ { 0x0554, {1, {0x0584}}},
+ { 0x0555, {1, {0x0585}}},
+ { 0x0556, {1, {0x0586}}},
+ { 0x0587, {2, {0x0565, 0x0582}}},
+ { 0x10a0, {1, {0x2d00}}},
+ { 0x10a1, {1, {0x2d01}}},
+ { 0x10a2, {1, {0x2d02}}},
+ { 0x10a3, {1, {0x2d03}}},
+ { 0x10a4, {1, {0x2d04}}},
+ { 0x10a5, {1, {0x2d05}}},
+ { 0x10a6, {1, {0x2d06}}},
+ { 0x10a7, {1, {0x2d07}}},
+ { 0x10a8, {1, {0x2d08}}},
+ { 0x10a9, {1, {0x2d09}}},
+ { 0x10aa, {1, {0x2d0a}}},
+ { 0x10ab, {1, {0x2d0b}}},
+ { 0x10ac, {1, {0x2d0c}}},
+ { 0x10ad, {1, {0x2d0d}}},
+ { 0x10ae, {1, {0x2d0e}}},
+ { 0x10af, {1, {0x2d0f}}},
+ { 0x10b0, {1, {0x2d10}}},
+ { 0x10b1, {1, {0x2d11}}},
+ { 0x10b2, {1, {0x2d12}}},
+ { 0x10b3, {1, {0x2d13}}},
+ { 0x10b4, {1, {0x2d14}}},
+ { 0x10b5, {1, {0x2d15}}},
+ { 0x10b6, {1, {0x2d16}}},
+ { 0x10b7, {1, {0x2d17}}},
+ { 0x10b8, {1, {0x2d18}}},
+ { 0x10b9, {1, {0x2d19}}},
+ { 0x10ba, {1, {0x2d1a}}},
+ { 0x10bb, {1, {0x2d1b}}},
+ { 0x10bc, {1, {0x2d1c}}},
+ { 0x10bd, {1, {0x2d1d}}},
+ { 0x10be, {1, {0x2d1e}}},
+ { 0x10bf, {1, {0x2d1f}}},
+ { 0x10c0, {1, {0x2d20}}},
+ { 0x10c1, {1, {0x2d21}}},
+ { 0x10c2, {1, {0x2d22}}},
+ { 0x10c3, {1, {0x2d23}}},
+ { 0x10c4, {1, {0x2d24}}},
+ { 0x10c5, {1, {0x2d25}}},
+ { 0x10c7, {1, {0x2d27}}},
+ { 0x10cd, {1, {0x2d2d}}},
+ { 0x1e00, {1, {0x1e01}}},
+ { 0x1e02, {1, {0x1e03}}},
+ { 0x1e04, {1, {0x1e05}}},
+ { 0x1e06, {1, {0x1e07}}},
+ { 0x1e08, {1, {0x1e09}}},
+ { 0x1e0a, {1, {0x1e0b}}},
+ { 0x1e0c, {1, {0x1e0d}}},
+ { 0x1e0e, {1, {0x1e0f}}},
+ { 0x1e10, {1, {0x1e11}}},
+ { 0x1e12, {1, {0x1e13}}},
+ { 0x1e14, {1, {0x1e15}}},
+ { 0x1e16, {1, {0x1e17}}},
+ { 0x1e18, {1, {0x1e19}}},
+ { 0x1e1a, {1, {0x1e1b}}},
+ { 0x1e1c, {1, {0x1e1d}}},
+ { 0x1e1e, {1, {0x1e1f}}},
+ { 0x1e20, {1, {0x1e21}}},
+ { 0x1e22, {1, {0x1e23}}},
+ { 0x1e24, {1, {0x1e25}}},
+ { 0x1e26, {1, {0x1e27}}},
+ { 0x1e28, {1, {0x1e29}}},
+ { 0x1e2a, {1, {0x1e2b}}},
+ { 0x1e2c, {1, {0x1e2d}}},
+ { 0x1e2e, {1, {0x1e2f}}},
+ { 0x1e30, {1, {0x1e31}}},
+ { 0x1e32, {1, {0x1e33}}},
+ { 0x1e34, {1, {0x1e35}}},
+ { 0x1e36, {1, {0x1e37}}},
+ { 0x1e38, {1, {0x1e39}}},
+ { 0x1e3a, {1, {0x1e3b}}},
+ { 0x1e3c, {1, {0x1e3d}}},
+ { 0x1e3e, {1, {0x1e3f}}},
+ { 0x1e40, {1, {0x1e41}}},
+ { 0x1e42, {1, {0x1e43}}},
+ { 0x1e44, {1, {0x1e45}}},
+ { 0x1e46, {1, {0x1e47}}},
+ { 0x1e48, {1, {0x1e49}}},
+ { 0x1e4a, {1, {0x1e4b}}},
+ { 0x1e4c, {1, {0x1e4d}}},
+ { 0x1e4e, {1, {0x1e4f}}},
+ { 0x1e50, {1, {0x1e51}}},
+ { 0x1e52, {1, {0x1e53}}},
+ { 0x1e54, {1, {0x1e55}}},
+ { 0x1e56, {1, {0x1e57}}},
+ { 0x1e58, {1, {0x1e59}}},
+ { 0x1e5a, {1, {0x1e5b}}},
+ { 0x1e5c, {1, {0x1e5d}}},
+ { 0x1e5e, {1, {0x1e5f}}},
+ { 0x1e60, {1, {0x1e61}}},
+ { 0x1e62, {1, {0x1e63}}},
+ { 0x1e64, {1, {0x1e65}}},
+ { 0x1e66, {1, {0x1e67}}},
+ { 0x1e68, {1, {0x1e69}}},
+ { 0x1e6a, {1, {0x1e6b}}},
+ { 0x1e6c, {1, {0x1e6d}}},
+ { 0x1e6e, {1, {0x1e6f}}},
+ { 0x1e70, {1, {0x1e71}}},
+ { 0x1e72, {1, {0x1e73}}},
+ { 0x1e74, {1, {0x1e75}}},
+ { 0x1e76, {1, {0x1e77}}},
+ { 0x1e78, {1, {0x1e79}}},
+ { 0x1e7a, {1, {0x1e7b}}},
+ { 0x1e7c, {1, {0x1e7d}}},
+ { 0x1e7e, {1, {0x1e7f}}},
+ { 0x1e80, {1, {0x1e81}}},
+ { 0x1e82, {1, {0x1e83}}},
+ { 0x1e84, {1, {0x1e85}}},
+ { 0x1e86, {1, {0x1e87}}},
+ { 0x1e88, {1, {0x1e89}}},
+ { 0x1e8a, {1, {0x1e8b}}},
+ { 0x1e8c, {1, {0x1e8d}}},
+ { 0x1e8e, {1, {0x1e8f}}},
+ { 0x1e90, {1, {0x1e91}}},
+ { 0x1e92, {1, {0x1e93}}},
+ { 0x1e94, {1, {0x1e95}}},
+ { 0x1e96, {2, {0x0068, 0x0331}}},
+ { 0x1e97, {2, {0x0074, 0x0308}}},
+ { 0x1e98, {2, {0x0077, 0x030a}}},
+ { 0x1e99, {2, {0x0079, 0x030a}}},
+ { 0x1e9a, {2, {0x0061, 0x02be}}},
+ { 0x1e9b, {1, {0x1e61}}},
+ { 0x1e9e, {2, {0x0073, 0x0073}}},
+ { 0x1ea0, {1, {0x1ea1}}},
+ { 0x1ea2, {1, {0x1ea3}}},
+ { 0x1ea4, {1, {0x1ea5}}},
+ { 0x1ea6, {1, {0x1ea7}}},
+ { 0x1ea8, {1, {0x1ea9}}},
+ { 0x1eaa, {1, {0x1eab}}},
+ { 0x1eac, {1, {0x1ead}}},
+ { 0x1eae, {1, {0x1eaf}}},
+ { 0x1eb0, {1, {0x1eb1}}},
+ { 0x1eb2, {1, {0x1eb3}}},
+ { 0x1eb4, {1, {0x1eb5}}},
+ { 0x1eb6, {1, {0x1eb7}}},
+ { 0x1eb8, {1, {0x1eb9}}},
+ { 0x1eba, {1, {0x1ebb}}},
+ { 0x1ebc, {1, {0x1ebd}}},
+ { 0x1ebe, {1, {0x1ebf}}},
+ { 0x1ec0, {1, {0x1ec1}}},
+ { 0x1ec2, {1, {0x1ec3}}},
+ { 0x1ec4, {1, {0x1ec5}}},
+ { 0x1ec6, {1, {0x1ec7}}},
+ { 0x1ec8, {1, {0x1ec9}}},
+ { 0x1eca, {1, {0x1ecb}}},
+ { 0x1ecc, {1, {0x1ecd}}},
+ { 0x1ece, {1, {0x1ecf}}},
+ { 0x1ed0, {1, {0x1ed1}}},
+ { 0x1ed2, {1, {0x1ed3}}},
+ { 0x1ed4, {1, {0x1ed5}}},
+ { 0x1ed6, {1, {0x1ed7}}},
+ { 0x1ed8, {1, {0x1ed9}}},
+ { 0x1eda, {1, {0x1edb}}},
+ { 0x1edc, {1, {0x1edd}}},
+ { 0x1ede, {1, {0x1edf}}},
+ { 0x1ee0, {1, {0x1ee1}}},
+ { 0x1ee2, {1, {0x1ee3}}},
+ { 0x1ee4, {1, {0x1ee5}}},
+ { 0x1ee6, {1, {0x1ee7}}},
+ { 0x1ee8, {1, {0x1ee9}}},
+ { 0x1eea, {1, {0x1eeb}}},
+ { 0x1eec, {1, {0x1eed}}},
+ { 0x1eee, {1, {0x1eef}}},
+ { 0x1ef0, {1, {0x1ef1}}},
+ { 0x1ef2, {1, {0x1ef3}}},
+ { 0x1ef4, {1, {0x1ef5}}},
+ { 0x1ef6, {1, {0x1ef7}}},
+ { 0x1ef8, {1, {0x1ef9}}},
+ { 0x1efa, {1, {0x1efb}}},
+ { 0x1efc, {1, {0x1efd}}},
+ { 0x1efe, {1, {0x1eff}}},
+ { 0x1f08, {1, {0x1f00}}},
+ { 0x1f09, {1, {0x1f01}}},
+ { 0x1f0a, {1, {0x1f02}}},
+ { 0x1f0b, {1, {0x1f03}}},
+ { 0x1f0c, {1, {0x1f04}}},
+ { 0x1f0d, {1, {0x1f05}}},
+ { 0x1f0e, {1, {0x1f06}}},
+ { 0x1f0f, {1, {0x1f07}}},
+ { 0x1f18, {1, {0x1f10}}},
+ { 0x1f19, {1, {0x1f11}}},
+ { 0x1f1a, {1, {0x1f12}}},
+ { 0x1f1b, {1, {0x1f13}}},
+ { 0x1f1c, {1, {0x1f14}}},
+ { 0x1f1d, {1, {0x1f15}}},
+ { 0x1f28, {1, {0x1f20}}},
+ { 0x1f29, {1, {0x1f21}}},
+ { 0x1f2a, {1, {0x1f22}}},
+ { 0x1f2b, {1, {0x1f23}}},
+ { 0x1f2c, {1, {0x1f24}}},
+ { 0x1f2d, {1, {0x1f25}}},
+ { 0x1f2e, {1, {0x1f26}}},
+ { 0x1f2f, {1, {0x1f27}}},
+ { 0x1f38, {1, {0x1f30}}},
+ { 0x1f39, {1, {0x1f31}}},
+ { 0x1f3a, {1, {0x1f32}}},
+ { 0x1f3b, {1, {0x1f33}}},
+ { 0x1f3c, {1, {0x1f34}}},
+ { 0x1f3d, {1, {0x1f35}}},
+ { 0x1f3e, {1, {0x1f36}}},
+ { 0x1f3f, {1, {0x1f37}}},
+ { 0x1f48, {1, {0x1f40}}},
+ { 0x1f49, {1, {0x1f41}}},
+ { 0x1f4a, {1, {0x1f42}}},
+ { 0x1f4b, {1, {0x1f43}}},
+ { 0x1f4c, {1, {0x1f44}}},
+ { 0x1f4d, {1, {0x1f45}}},
+ { 0x1f50, {2, {0x03c5, 0x0313}}},
+ { 0x1f52, {3, {0x03c5, 0x0313, 0x0300}}},
+ { 0x1f54, {3, {0x03c5, 0x0313, 0x0301}}},
+ { 0x1f56, {3, {0x03c5, 0x0313, 0x0342}}},
+ { 0x1f59, {1, {0x1f51}}},
+ { 0x1f5b, {1, {0x1f53}}},
+ { 0x1f5d, {1, {0x1f55}}},
+ { 0x1f5f, {1, {0x1f57}}},
+ { 0x1f68, {1, {0x1f60}}},
+ { 0x1f69, {1, {0x1f61}}},
+ { 0x1f6a, {1, {0x1f62}}},
+ { 0x1f6b, {1, {0x1f63}}},
+ { 0x1f6c, {1, {0x1f64}}},
+ { 0x1f6d, {1, {0x1f65}}},
+ { 0x1f6e, {1, {0x1f66}}},
+ { 0x1f6f, {1, {0x1f67}}},
+ { 0x1f80, {2, {0x1f00, 0x03b9}}},
+ { 0x1f81, {2, {0x1f01, 0x03b9}}},
+ { 0x1f82, {2, {0x1f02, 0x03b9}}},
+ { 0x1f83, {2, {0x1f03, 0x03b9}}},
+ { 0x1f84, {2, {0x1f04, 0x03b9}}},
+ { 0x1f85, {2, {0x1f05, 0x03b9}}},
+ { 0x1f86, {2, {0x1f06, 0x03b9}}},
+ { 0x1f87, {2, {0x1f07, 0x03b9}}},
+ { 0x1f88, {2, {0x1f00, 0x03b9}}},
+ { 0x1f89, {2, {0x1f01, 0x03b9}}},
+ { 0x1f8a, {2, {0x1f02, 0x03b9}}},
+ { 0x1f8b, {2, {0x1f03, 0x03b9}}},
+ { 0x1f8c, {2, {0x1f04, 0x03b9}}},
+ { 0x1f8d, {2, {0x1f05, 0x03b9}}},
+ { 0x1f8e, {2, {0x1f06, 0x03b9}}},
+ { 0x1f8f, {2, {0x1f07, 0x03b9}}},
+ { 0x1f90, {2, {0x1f20, 0x03b9}}},
+ { 0x1f91, {2, {0x1f21, 0x03b9}}},
+ { 0x1f92, {2, {0x1f22, 0x03b9}}},
+ { 0x1f93, {2, {0x1f23, 0x03b9}}},
+ { 0x1f94, {2, {0x1f24, 0x03b9}}},
+ { 0x1f95, {2, {0x1f25, 0x03b9}}},
+ { 0x1f96, {2, {0x1f26, 0x03b9}}},
+ { 0x1f97, {2, {0x1f27, 0x03b9}}},
+ { 0x1f98, {2, {0x1f20, 0x03b9}}},
+ { 0x1f99, {2, {0x1f21, 0x03b9}}},
+ { 0x1f9a, {2, {0x1f22, 0x03b9}}},
+ { 0x1f9b, {2, {0x1f23, 0x03b9}}},
+ { 0x1f9c, {2, {0x1f24, 0x03b9}}},
+ { 0x1f9d, {2, {0x1f25, 0x03b9}}},
+ { 0x1f9e, {2, {0x1f26, 0x03b9}}},
+ { 0x1f9f, {2, {0x1f27, 0x03b9}}},
+ { 0x1fa0, {2, {0x1f60, 0x03b9}}},
+ { 0x1fa1, {2, {0x1f61, 0x03b9}}},
+ { 0x1fa2, {2, {0x1f62, 0x03b9}}},
+ { 0x1fa3, {2, {0x1f63, 0x03b9}}},
+ { 0x1fa4, {2, {0x1f64, 0x03b9}}},
+ { 0x1fa5, {2, {0x1f65, 0x03b9}}},
+ { 0x1fa6, {2, {0x1f66, 0x03b9}}},
+ { 0x1fa7, {2, {0x1f67, 0x03b9}}},
+ { 0x1fa8, {2, {0x1f60, 0x03b9}}},
+ { 0x1fa9, {2, {0x1f61, 0x03b9}}},
+ { 0x1faa, {2, {0x1f62, 0x03b9}}},
+ { 0x1fab, {2, {0x1f63, 0x03b9}}},
+ { 0x1fac, {2, {0x1f64, 0x03b9}}},
+ { 0x1fad, {2, {0x1f65, 0x03b9}}},
+ { 0x1fae, {2, {0x1f66, 0x03b9}}},
+ { 0x1faf, {2, {0x1f67, 0x03b9}}},
+ { 0x1fb2, {2, {0x1f70, 0x03b9}}},
+ { 0x1fb3, {2, {0x03b1, 0x03b9}}},
+ { 0x1fb4, {2, {0x03ac, 0x03b9}}},
+ { 0x1fb6, {2, {0x03b1, 0x0342}}},
+ { 0x1fb7, {3, {0x03b1, 0x0342, 0x03b9}}},
+ { 0x1fb8, {1, {0x1fb0}}},
+ { 0x1fb9, {1, {0x1fb1}}},
+ { 0x1fba, {1, {0x1f70}}},
+ { 0x1fbb, {1, {0x1f71}}},
+ { 0x1fbc, {2, {0x03b1, 0x03b9}}},
+ { 0x1fbe, {1, {0x03b9}}},
+ { 0x1fc2, {2, {0x1f74, 0x03b9}}},
+ { 0x1fc3, {2, {0x03b7, 0x03b9}}},
+ { 0x1fc4, {2, {0x03ae, 0x03b9}}},
+ { 0x1fc6, {2, {0x03b7, 0x0342}}},
+ { 0x1fc7, {3, {0x03b7, 0x0342, 0x03b9}}},
+ { 0x1fc8, {1, {0x1f72}}},
+ { 0x1fc9, {1, {0x1f73}}},
+ { 0x1fca, {1, {0x1f74}}},
+ { 0x1fcb, {1, {0x1f75}}},
+ { 0x1fcc, {2, {0x03b7, 0x03b9}}},
+ { 0x1fd2, {3, {0x03b9, 0x0308, 0x0300}}},
+ { 0x1fd3, {3, {0x03b9, 0x0308, 0x0301}}},
+ { 0x1fd6, {2, {0x03b9, 0x0342}}},
+ { 0x1fd7, {3, {0x03b9, 0x0308, 0x0342}}},
+ { 0x1fd8, {1, {0x1fd0}}},
+ { 0x1fd9, {1, {0x1fd1}}},
+ { 0x1fda, {1, {0x1f76}}},
+ { 0x1fdb, {1, {0x1f77}}},
+ { 0x1fe2, {3, {0x03c5, 0x0308, 0x0300}}},
+ { 0x1fe3, {3, {0x03c5, 0x0308, 0x0301}}},
+ { 0x1fe4, {2, {0x03c1, 0x0313}}},
+ { 0x1fe6, {2, {0x03c5, 0x0342}}},
+ { 0x1fe7, {3, {0x03c5, 0x0308, 0x0342}}},
+ { 0x1fe8, {1, {0x1fe0}}},
+ { 0x1fe9, {1, {0x1fe1}}},
+ { 0x1fea, {1, {0x1f7a}}},
+ { 0x1feb, {1, {0x1f7b}}},
+ { 0x1fec, {1, {0x1fe5}}},
+ { 0x1ff2, {2, {0x1f7c, 0x03b9}}},
+ { 0x1ff3, {2, {0x03c9, 0x03b9}}},
+ { 0x1ff4, {2, {0x03ce, 0x03b9}}},
+ { 0x1ff6, {2, {0x03c9, 0x0342}}},
+ { 0x1ff7, {3, {0x03c9, 0x0342, 0x03b9}}},
+ { 0x1ff8, {1, {0x1f78}}},
+ { 0x1ff9, {1, {0x1f79}}},
+ { 0x1ffa, {1, {0x1f7c}}},
+ { 0x1ffb, {1, {0x1f7d}}},
+ { 0x1ffc, {2, {0x03c9, 0x03b9}}},
+ { 0x2126, {1, {0x03c9}}},
+ { 0x212a, {1, {0x006b}}},
+ { 0x212b, {1, {0x00e5}}},
+ { 0x2132, {1, {0x214e}}},
+ { 0x2160, {1, {0x2170}}},
+ { 0x2161, {1, {0x2171}}},
+ { 0x2162, {1, {0x2172}}},
+ { 0x2163, {1, {0x2173}}},
+ { 0x2164, {1, {0x2174}}},
+ { 0x2165, {1, {0x2175}}},
+ { 0x2166, {1, {0x2176}}},
+ { 0x2167, {1, {0x2177}}},
+ { 0x2168, {1, {0x2178}}},
+ { 0x2169, {1, {0x2179}}},
+ { 0x216a, {1, {0x217a}}},
+ { 0x216b, {1, {0x217b}}},
+ { 0x216c, {1, {0x217c}}},
+ { 0x216d, {1, {0x217d}}},
+ { 0x216e, {1, {0x217e}}},
+ { 0x216f, {1, {0x217f}}},
+ { 0x2183, {1, {0x2184}}},
+ { 0x24b6, {1, {0x24d0}}},
+ { 0x24b7, {1, {0x24d1}}},
+ { 0x24b8, {1, {0x24d2}}},
+ { 0x24b9, {1, {0x24d3}}},
+ { 0x24ba, {1, {0x24d4}}},
+ { 0x24bb, {1, {0x24d5}}},
+ { 0x24bc, {1, {0x24d6}}},
+ { 0x24bd, {1, {0x24d7}}},
+ { 0x24be, {1, {0x24d8}}},
+ { 0x24bf, {1, {0x24d9}}},
+ { 0x24c0, {1, {0x24da}}},
+ { 0x24c1, {1, {0x24db}}},
+ { 0x24c2, {1, {0x24dc}}},
+ { 0x24c3, {1, {0x24dd}}},
+ { 0x24c4, {1, {0x24de}}},
+ { 0x24c5, {1, {0x24df}}},
+ { 0x24c6, {1, {0x24e0}}},
+ { 0x24c7, {1, {0x24e1}}},
+ { 0x24c8, {1, {0x24e2}}},
+ { 0x24c9, {1, {0x24e3}}},
+ { 0x24ca, {1, {0x24e4}}},
+ { 0x24cb, {1, {0x24e5}}},
+ { 0x24cc, {1, {0x24e6}}},
+ { 0x24cd, {1, {0x24e7}}},
+ { 0x24ce, {1, {0x24e8}}},
+ { 0x24cf, {1, {0x24e9}}},
+ { 0x2c00, {1, {0x2c30}}},
+ { 0x2c01, {1, {0x2c31}}},
+ { 0x2c02, {1, {0x2c32}}},
+ { 0x2c03, {1, {0x2c33}}},
+ { 0x2c04, {1, {0x2c34}}},
+ { 0x2c05, {1, {0x2c35}}},
+ { 0x2c06, {1, {0x2c36}}},
+ { 0x2c07, {1, {0x2c37}}},
+ { 0x2c08, {1, {0x2c38}}},
+ { 0x2c09, {1, {0x2c39}}},
+ { 0x2c0a, {1, {0x2c3a}}},
+ { 0x2c0b, {1, {0x2c3b}}},
+ { 0x2c0c, {1, {0x2c3c}}},
+ { 0x2c0d, {1, {0x2c3d}}},
+ { 0x2c0e, {1, {0x2c3e}}},
+ { 0x2c0f, {1, {0x2c3f}}},
+ { 0x2c10, {1, {0x2c40}}},
+ { 0x2c11, {1, {0x2c41}}},
+ { 0x2c12, {1, {0x2c42}}},
+ { 0x2c13, {1, {0x2c43}}},
+ { 0x2c14, {1, {0x2c44}}},
+ { 0x2c15, {1, {0x2c45}}},
+ { 0x2c16, {1, {0x2c46}}},
+ { 0x2c17, {1, {0x2c47}}},
+ { 0x2c18, {1, {0x2c48}}},
+ { 0x2c19, {1, {0x2c49}}},
+ { 0x2c1a, {1, {0x2c4a}}},
+ { 0x2c1b, {1, {0x2c4b}}},
+ { 0x2c1c, {1, {0x2c4c}}},
+ { 0x2c1d, {1, {0x2c4d}}},
+ { 0x2c1e, {1, {0x2c4e}}},
+ { 0x2c1f, {1, {0x2c4f}}},
+ { 0x2c20, {1, {0x2c50}}},
+ { 0x2c21, {1, {0x2c51}}},
+ { 0x2c22, {1, {0x2c52}}},
+ { 0x2c23, {1, {0x2c53}}},
+ { 0x2c24, {1, {0x2c54}}},
+ { 0x2c25, {1, {0x2c55}}},
+ { 0x2c26, {1, {0x2c56}}},
+ { 0x2c27, {1, {0x2c57}}},
+ { 0x2c28, {1, {0x2c58}}},
+ { 0x2c29, {1, {0x2c59}}},
+ { 0x2c2a, {1, {0x2c5a}}},
+ { 0x2c2b, {1, {0x2c5b}}},
+ { 0x2c2c, {1, {0x2c5c}}},
+ { 0x2c2d, {1, {0x2c5d}}},
+ { 0x2c2e, {1, {0x2c5e}}},
+ { 0x2c60, {1, {0x2c61}}},
+ { 0x2c62, {1, {0x026b}}},
+ { 0x2c63, {1, {0x1d7d}}},
+ { 0x2c64, {1, {0x027d}}},
+ { 0x2c67, {1, {0x2c68}}},
+ { 0x2c69, {1, {0x2c6a}}},
+ { 0x2c6b, {1, {0x2c6c}}},
+ { 0x2c6d, {1, {0x0251}}},
+ { 0x2c6e, {1, {0x0271}}},
+ { 0x2c6f, {1, {0x0250}}},
+ { 0x2c70, {1, {0x0252}}},
+ { 0x2c72, {1, {0x2c73}}},
+ { 0x2c75, {1, {0x2c76}}},
+ { 0x2c7e, {1, {0x023f}}},
+ { 0x2c7f, {1, {0x0240}}},
+ { 0x2c80, {1, {0x2c81}}},
+ { 0x2c82, {1, {0x2c83}}},
+ { 0x2c84, {1, {0x2c85}}},
+ { 0x2c86, {1, {0x2c87}}},
+ { 0x2c88, {1, {0x2c89}}},
+ { 0x2c8a, {1, {0x2c8b}}},
+ { 0x2c8c, {1, {0x2c8d}}},
+ { 0x2c8e, {1, {0x2c8f}}},
+ { 0x2c90, {1, {0x2c91}}},
+ { 0x2c92, {1, {0x2c93}}},
+ { 0x2c94, {1, {0x2c95}}},
+ { 0x2c96, {1, {0x2c97}}},
+ { 0x2c98, {1, {0x2c99}}},
+ { 0x2c9a, {1, {0x2c9b}}},
+ { 0x2c9c, {1, {0x2c9d}}},
+ { 0x2c9e, {1, {0x2c9f}}},
+ { 0x2ca0, {1, {0x2ca1}}},
+ { 0x2ca2, {1, {0x2ca3}}},
+ { 0x2ca4, {1, {0x2ca5}}},
+ { 0x2ca6, {1, {0x2ca7}}},
+ { 0x2ca8, {1, {0x2ca9}}},
+ { 0x2caa, {1, {0x2cab}}},
+ { 0x2cac, {1, {0x2cad}}},
+ { 0x2cae, {1, {0x2caf}}},
+ { 0x2cb0, {1, {0x2cb1}}},
+ { 0x2cb2, {1, {0x2cb3}}},
+ { 0x2cb4, {1, {0x2cb5}}},
+ { 0x2cb6, {1, {0x2cb7}}},
+ { 0x2cb8, {1, {0x2cb9}}},
+ { 0x2cba, {1, {0x2cbb}}},
+ { 0x2cbc, {1, {0x2cbd}}},
+ { 0x2cbe, {1, {0x2cbf}}},
+ { 0x2cc0, {1, {0x2cc1}}},
+ { 0x2cc2, {1, {0x2cc3}}},
+ { 0x2cc4, {1, {0x2cc5}}},
+ { 0x2cc6, {1, {0x2cc7}}},
+ { 0x2cc8, {1, {0x2cc9}}},
+ { 0x2cca, {1, {0x2ccb}}},
+ { 0x2ccc, {1, {0x2ccd}}},
+ { 0x2cce, {1, {0x2ccf}}},
+ { 0x2cd0, {1, {0x2cd1}}},
+ { 0x2cd2, {1, {0x2cd3}}},
+ { 0x2cd4, {1, {0x2cd5}}},
+ { 0x2cd6, {1, {0x2cd7}}},
+ { 0x2cd8, {1, {0x2cd9}}},
+ { 0x2cda, {1, {0x2cdb}}},
+ { 0x2cdc, {1, {0x2cdd}}},
+ { 0x2cde, {1, {0x2cdf}}},
+ { 0x2ce0, {1, {0x2ce1}}},
+ { 0x2ce2, {1, {0x2ce3}}},
+ { 0x2ceb, {1, {0x2cec}}},
+ { 0x2ced, {1, {0x2cee}}},
+ { 0x2cf2, {1, {0x2cf3}}},
+ { 0xa640, {1, {0xa641}}},
+ { 0xa642, {1, {0xa643}}},
+ { 0xa644, {1, {0xa645}}},
+ { 0xa646, {1, {0xa647}}},
+ { 0xa648, {1, {0xa649}}},
+ { 0xa64a, {1, {0xa64b}}},
+ { 0xa64c, {1, {0xa64d}}},
+ { 0xa64e, {1, {0xa64f}}},
+ { 0xa650, {1, {0xa651}}},
+ { 0xa652, {1, {0xa653}}},
+ { 0xa654, {1, {0xa655}}},
+ { 0xa656, {1, {0xa657}}},
+ { 0xa658, {1, {0xa659}}},
+ { 0xa65a, {1, {0xa65b}}},
+ { 0xa65c, {1, {0xa65d}}},
+ { 0xa65e, {1, {0xa65f}}},
+ { 0xa660, {1, {0xa661}}},
+ { 0xa662, {1, {0xa663}}},
+ { 0xa664, {1, {0xa665}}},
+ { 0xa666, {1, {0xa667}}},
+ { 0xa668, {1, {0xa669}}},
+ { 0xa66a, {1, {0xa66b}}},
+ { 0xa66c, {1, {0xa66d}}},
+ { 0xa680, {1, {0xa681}}},
+ { 0xa682, {1, {0xa683}}},
+ { 0xa684, {1, {0xa685}}},
+ { 0xa686, {1, {0xa687}}},
+ { 0xa688, {1, {0xa689}}},
+ { 0xa68a, {1, {0xa68b}}},
+ { 0xa68c, {1, {0xa68d}}},
+ { 0xa68e, {1, {0xa68f}}},
+ { 0xa690, {1, {0xa691}}},
+ { 0xa692, {1, {0xa693}}},
+ { 0xa694, {1, {0xa695}}},
+ { 0xa696, {1, {0xa697}}},
+ { 0xa722, {1, {0xa723}}},
+ { 0xa724, {1, {0xa725}}},
+ { 0xa726, {1, {0xa727}}},
+ { 0xa728, {1, {0xa729}}},
+ { 0xa72a, {1, {0xa72b}}},
+ { 0xa72c, {1, {0xa72d}}},
+ { 0xa72e, {1, {0xa72f}}},
+ { 0xa732, {1, {0xa733}}},
+ { 0xa734, {1, {0xa735}}},
+ { 0xa736, {1, {0xa737}}},
+ { 0xa738, {1, {0xa739}}},
+ { 0xa73a, {1, {0xa73b}}},
+ { 0xa73c, {1, {0xa73d}}},
+ { 0xa73e, {1, {0xa73f}}},
+ { 0xa740, {1, {0xa741}}},
+ { 0xa742, {1, {0xa743}}},
+ { 0xa744, {1, {0xa745}}},
+ { 0xa746, {1, {0xa747}}},
+ { 0xa748, {1, {0xa749}}},
+ { 0xa74a, {1, {0xa74b}}},
+ { 0xa74c, {1, {0xa74d}}},
+ { 0xa74e, {1, {0xa74f}}},
+ { 0xa750, {1, {0xa751}}},
+ { 0xa752, {1, {0xa753}}},
+ { 0xa754, {1, {0xa755}}},
+ { 0xa756, {1, {0xa757}}},
+ { 0xa758, {1, {0xa759}}},
+ { 0xa75a, {1, {0xa75b}}},
+ { 0xa75c, {1, {0xa75d}}},
+ { 0xa75e, {1, {0xa75f}}},
+ { 0xa760, {1, {0xa761}}},
+ { 0xa762, {1, {0xa763}}},
+ { 0xa764, {1, {0xa765}}},
+ { 0xa766, {1, {0xa767}}},
+ { 0xa768, {1, {0xa769}}},
+ { 0xa76a, {1, {0xa76b}}},
+ { 0xa76c, {1, {0xa76d}}},
+ { 0xa76e, {1, {0xa76f}}},
+ { 0xa779, {1, {0xa77a}}},
+ { 0xa77b, {1, {0xa77c}}},
+ { 0xa77d, {1, {0x1d79}}},
+ { 0xa77e, {1, {0xa77f}}},
+ { 0xa780, {1, {0xa781}}},
+ { 0xa782, {1, {0xa783}}},
+ { 0xa784, {1, {0xa785}}},
+ { 0xa786, {1, {0xa787}}},
+ { 0xa78b, {1, {0xa78c}}},
+ { 0xa78d, {1, {0x0265}}},
+ { 0xa790, {1, {0xa791}}},
+ { 0xa792, {1, {0xa793}}},
+ { 0xa7a0, {1, {0xa7a1}}},
+ { 0xa7a2, {1, {0xa7a3}}},
+ { 0xa7a4, {1, {0xa7a5}}},
+ { 0xa7a6, {1, {0xa7a7}}},
+ { 0xa7a8, {1, {0xa7a9}}},
+ { 0xa7aa, {1, {0x0266}}},
+ { 0xfb00, {2, {0x0066, 0x0066}}},
+ { 0xfb01, {2, {0x0066, 0x0069}}},
+ { 0xfb02, {2, {0x0066, 0x006c}}},
+ { 0xfb03, {3, {0x0066, 0x0066, 0x0069}}},
+ { 0xfb04, {3, {0x0066, 0x0066, 0x006c}}},
+ { 0xfb05, {2, {0x0073, 0x0074}}},
+ { 0xfb06, {2, {0x0073, 0x0074}}},
+ { 0xfb13, {2, {0x0574, 0x0576}}},
+ { 0xfb14, {2, {0x0574, 0x0565}}},
+ { 0xfb15, {2, {0x0574, 0x056b}}},
+ { 0xfb16, {2, {0x057e, 0x0576}}},
+ { 0xfb17, {2, {0x0574, 0x056d}}},
+ { 0xff21, {1, {0xff41}}},
+ { 0xff22, {1, {0xff42}}},
+ { 0xff23, {1, {0xff43}}},
+ { 0xff24, {1, {0xff44}}},
+ { 0xff25, {1, {0xff45}}},
+ { 0xff26, {1, {0xff46}}},
+ { 0xff27, {1, {0xff47}}},
+ { 0xff28, {1, {0xff48}}},
+ { 0xff29, {1, {0xff49}}},
+ { 0xff2a, {1, {0xff4a}}},
+ { 0xff2b, {1, {0xff4b}}},
+ { 0xff2c, {1, {0xff4c}}},
+ { 0xff2d, {1, {0xff4d}}},
+ { 0xff2e, {1, {0xff4e}}},
+ { 0xff2f, {1, {0xff4f}}},
+ { 0xff30, {1, {0xff50}}},
+ { 0xff31, {1, {0xff51}}},
+ { 0xff32, {1, {0xff52}}},
+ { 0xff33, {1, {0xff53}}},
+ { 0xff34, {1, {0xff54}}},
+ { 0xff35, {1, {0xff55}}},
+ { 0xff36, {1, {0xff56}}},
+ { 0xff37, {1, {0xff57}}},
+ { 0xff38, {1, {0xff58}}},
+ { 0xff39, {1, {0xff59}}},
+ { 0xff3a, {1, {0xff5a}}},
+ { 0x10400, {1, {0x10428}}},
+ { 0x10401, {1, {0x10429}}},
+ { 0x10402, {1, {0x1042a}}},
+ { 0x10403, {1, {0x1042b}}},
+ { 0x10404, {1, {0x1042c}}},
+ { 0x10405, {1, {0x1042d}}},
+ { 0x10406, {1, {0x1042e}}},
+ { 0x10407, {1, {0x1042f}}},
+ { 0x10408, {1, {0x10430}}},
+ { 0x10409, {1, {0x10431}}},
+ { 0x1040a, {1, {0x10432}}},
+ { 0x1040b, {1, {0x10433}}},
+ { 0x1040c, {1, {0x10434}}},
+ { 0x1040d, {1, {0x10435}}},
+ { 0x1040e, {1, {0x10436}}},
+ { 0x1040f, {1, {0x10437}}},
+ { 0x10410, {1, {0x10438}}},
+ { 0x10411, {1, {0x10439}}},
+ { 0x10412, {1, {0x1043a}}},
+ { 0x10413, {1, {0x1043b}}},
+ { 0x10414, {1, {0x1043c}}},
+ { 0x10415, {1, {0x1043d}}},
+ { 0x10416, {1, {0x1043e}}},
+ { 0x10417, {1, {0x1043f}}},
+ { 0x10418, {1, {0x10440}}},
+ { 0x10419, {1, {0x10441}}},
+ { 0x1041a, {1, {0x10442}}},
+ { 0x1041b, {1, {0x10443}}},
+ { 0x1041c, {1, {0x10444}}},
+ { 0x1041d, {1, {0x10445}}},
+ { 0x1041e, {1, {0x10446}}},
+ { 0x1041f, {1, {0x10447}}},
+ { 0x10420, {1, {0x10448}}},
+ { 0x10421, {1, {0x10449}}},
+ { 0x10422, {1, {0x1044a}}},
+ { 0x10423, {1, {0x1044b}}},
+ { 0x10424, {1, {0x1044c}}},
+ { 0x10425, {1, {0x1044d}}},
+ { 0x10426, {1, {0x1044e}}},
+ { 0x10427, {1, {0x1044f}}},
+};
+
+static const CaseFold_11_Type CaseFold_Locale[] = {
+ { 0x0049, {1, {0x0069}}},
+ { 0x0130, {2, {0x0069, 0x0307}}},
+};
+
+static const CaseUnfold_11_Type CaseUnfold_11[] = {
+ { 0x0061, {1, {0x0041 }}},
+ { 0x0062, {1, {0x0042 }}},
+ { 0x0063, {1, {0x0043 }}},
+ { 0x0064, {1, {0x0044 }}},
+ { 0x0065, {1, {0x0045 }}},
+ { 0x0066, {1, {0x0046 }}},
+ { 0x0067, {1, {0x0047 }}},
+ { 0x0068, {1, {0x0048 }}},
+ { 0x006a, {1, {0x004a }}},
+ { 0x006b, {2, {0x004b, 0x212a }}},
+ { 0x006c, {1, {0x004c }}},
+ { 0x006d, {1, {0x004d }}},
+ { 0x006e, {1, {0x004e }}},
+ { 0x006f, {1, {0x004f }}},
+ { 0x0070, {1, {0x0050 }}},
+ { 0x0071, {1, {0x0051 }}},
+ { 0x0072, {1, {0x0052 }}},
+ { 0x0073, {2, {0x0053, 0x017f }}},
+ { 0x0074, {1, {0x0054 }}},
+ { 0x0075, {1, {0x0055 }}},
+ { 0x0076, {1, {0x0056 }}},
+ { 0x0077, {1, {0x0057 }}},
+ { 0x0078, {1, {0x0058 }}},
+ { 0x0079, {1, {0x0059 }}},
+ { 0x007a, {1, {0x005a }}},
+ { 0x00e0, {1, {0x00c0 }}},
+ { 0x00e1, {1, {0x00c1 }}},
+ { 0x00e2, {1, {0x00c2 }}},
+ { 0x00e3, {1, {0x00c3 }}},
+ { 0x00e4, {1, {0x00c4 }}},
+ { 0x00e5, {2, {0x00c5, 0x212b }}},
+ { 0x00e6, {1, {0x00c6 }}},
+ { 0x00e7, {1, {0x00c7 }}},
+ { 0x00e8, {1, {0x00c8 }}},
+ { 0x00e9, {1, {0x00c9 }}},
+ { 0x00ea, {1, {0x00ca }}},
+ { 0x00eb, {1, {0x00cb }}},
+ { 0x00ec, {1, {0x00cc }}},
+ { 0x00ed, {1, {0x00cd }}},
+ { 0x00ee, {1, {0x00ce }}},
+ { 0x00ef, {1, {0x00cf }}},
+ { 0x00f0, {1, {0x00d0 }}},
+ { 0x00f1, {1, {0x00d1 }}},
+ { 0x00f2, {1, {0x00d2 }}},
+ { 0x00f3, {1, {0x00d3 }}},
+ { 0x00f4, {1, {0x00d4 }}},
+ { 0x00f5, {1, {0x00d5 }}},
+ { 0x00f6, {1, {0x00d6 }}},
+ { 0x00f8, {1, {0x00d8 }}},
+ { 0x00f9, {1, {0x00d9 }}},
+ { 0x00fa, {1, {0x00da }}},
+ { 0x00fb, {1, {0x00db }}},
+ { 0x00fc, {1, {0x00dc }}},
+ { 0x00fd, {1, {0x00dd }}},
+ { 0x00fe, {1, {0x00de }}},
+ { 0x00ff, {1, {0x0178 }}},
+ { 0x0101, {1, {0x0100 }}},
+ { 0x0103, {1, {0x0102 }}},
+ { 0x0105, {1, {0x0104 }}},
+ { 0x0107, {1, {0x0106 }}},
+ { 0x0109, {1, {0x0108 }}},
+ { 0x010b, {1, {0x010a }}},
+ { 0x010d, {1, {0x010c }}},
+ { 0x010f, {1, {0x010e }}},
+ { 0x0111, {1, {0x0110 }}},
+ { 0x0113, {1, {0x0112 }}},
+ { 0x0115, {1, {0x0114 }}},
+ { 0x0117, {1, {0x0116 }}},
+ { 0x0119, {1, {0x0118 }}},
+ { 0x011b, {1, {0x011a }}},
+ { 0x011d, {1, {0x011c }}},
+ { 0x011f, {1, {0x011e }}},
+ { 0x0121, {1, {0x0120 }}},
+ { 0x0123, {1, {0x0122 }}},
+ { 0x0125, {1, {0x0124 }}},
+ { 0x0127, {1, {0x0126 }}},
+ { 0x0129, {1, {0x0128 }}},
+ { 0x012b, {1, {0x012a }}},
+ { 0x012d, {1, {0x012c }}},
+ { 0x012f, {1, {0x012e }}},
+ { 0x0133, {1, {0x0132 }}},
+ { 0x0135, {1, {0x0134 }}},
+ { 0x0137, {1, {0x0136 }}},
+ { 0x013a, {1, {0x0139 }}},
+ { 0x013c, {1, {0x013b }}},
+ { 0x013e, {1, {0x013d }}},
+ { 0x0140, {1, {0x013f }}},
+ { 0x0142, {1, {0x0141 }}},
+ { 0x0144, {1, {0x0143 }}},
+ { 0x0146, {1, {0x0145 }}},
+ { 0x0148, {1, {0x0147 }}},
+ { 0x014b, {1, {0x014a }}},
+ { 0x014d, {1, {0x014c }}},
+ { 0x014f, {1, {0x014e }}},
+ { 0x0151, {1, {0x0150 }}},
+ { 0x0153, {1, {0x0152 }}},
+ { 0x0155, {1, {0x0154 }}},
+ { 0x0157, {1, {0x0156 }}},
+ { 0x0159, {1, {0x0158 }}},
+ { 0x015b, {1, {0x015a }}},
+ { 0x015d, {1, {0x015c }}},
+ { 0x015f, {1, {0x015e }}},
+ { 0x0161, {1, {0x0160 }}},
+ { 0x0163, {1, {0x0162 }}},
+ { 0x0165, {1, {0x0164 }}},
+ { 0x0167, {1, {0x0166 }}},
+ { 0x0169, {1, {0x0168 }}},
+ { 0x016b, {1, {0x016a }}},
+ { 0x016d, {1, {0x016c }}},
+ { 0x016f, {1, {0x016e }}},
+ { 0x0171, {1, {0x0170 }}},
+ { 0x0173, {1, {0x0172 }}},
+ { 0x0175, {1, {0x0174 }}},
+ { 0x0177, {1, {0x0176 }}},
+ { 0x017a, {1, {0x0179 }}},
+ { 0x017c, {1, {0x017b }}},
+ { 0x017e, {1, {0x017d }}},
+ { 0x0180, {1, {0x0243 }}},
+ { 0x0183, {1, {0x0182 }}},
+ { 0x0185, {1, {0x0184 }}},
+ { 0x0188, {1, {0x0187 }}},
+ { 0x018c, {1, {0x018b }}},
+ { 0x0192, {1, {0x0191 }}},
+ { 0x0195, {1, {0x01f6 }}},
+ { 0x0199, {1, {0x0198 }}},
+ { 0x019a, {1, {0x023d }}},
+ { 0x019e, {1, {0x0220 }}},
+ { 0x01a1, {1, {0x01a0 }}},
+ { 0x01a3, {1, {0x01a2 }}},
+ { 0x01a5, {1, {0x01a4 }}},
+ { 0x01a8, {1, {0x01a7 }}},
+ { 0x01ad, {1, {0x01ac }}},
+ { 0x01b0, {1, {0x01af }}},
+ { 0x01b4, {1, {0x01b3 }}},
+ { 0x01b6, {1, {0x01b5 }}},
+ { 0x01b9, {1, {0x01b8 }}},
+ { 0x01bd, {1, {0x01bc }}},
+ { 0x01bf, {1, {0x01f7 }}},
+ { 0x01c6, {2, {0x01c4, 0x01c5 }}},
+ { 0x01c9, {2, {0x01c7, 0x01c8 }}},
+ { 0x01cc, {2, {0x01ca, 0x01cb }}},
+ { 0x01ce, {1, {0x01cd }}},
+ { 0x01d0, {1, {0x01cf }}},
+ { 0x01d2, {1, {0x01d1 }}},
+ { 0x01d4, {1, {0x01d3 }}},
+ { 0x01d6, {1, {0x01d5 }}},
+ { 0x01d8, {1, {0x01d7 }}},
+ { 0x01da, {1, {0x01d9 }}},
+ { 0x01dc, {1, {0x01db }}},
+ { 0x01dd, {1, {0x018e }}},
+ { 0x01df, {1, {0x01de }}},
+ { 0x01e1, {1, {0x01e0 }}},
+ { 0x01e3, {1, {0x01e2 }}},
+ { 0x01e5, {1, {0x01e4 }}},
+ { 0x01e7, {1, {0x01e6 }}},
+ { 0x01e9, {1, {0x01e8 }}},
+ { 0x01eb, {1, {0x01ea }}},
+ { 0x01ed, {1, {0x01ec }}},
+ { 0x01ef, {1, {0x01ee }}},
+ { 0x01f3, {2, {0x01f1, 0x01f2 }}},
+ { 0x01f5, {1, {0x01f4 }}},
+ { 0x01f9, {1, {0x01f8 }}},
+ { 0x01fb, {1, {0x01fa }}},
+ { 0x01fd, {1, {0x01fc }}},
+ { 0x01ff, {1, {0x01fe }}},
+ { 0x0201, {1, {0x0200 }}},
+ { 0x0203, {1, {0x0202 }}},
+ { 0x0205, {1, {0x0204 }}},
+ { 0x0207, {1, {0x0206 }}},
+ { 0x0209, {1, {0x0208 }}},
+ { 0x020b, {1, {0x020a }}},
+ { 0x020d, {1, {0x020c }}},
+ { 0x020f, {1, {0x020e }}},
+ { 0x0211, {1, {0x0210 }}},
+ { 0x0213, {1, {0x0212 }}},
+ { 0x0215, {1, {0x0214 }}},
+ { 0x0217, {1, {0x0216 }}},
+ { 0x0219, {1, {0x0218 }}},
+ { 0x021b, {1, {0x021a }}},
+ { 0x021d, {1, {0x021c }}},
+ { 0x021f, {1, {0x021e }}},
+ { 0x0223, {1, {0x0222 }}},
+ { 0x0225, {1, {0x0224 }}},
+ { 0x0227, {1, {0x0226 }}},
+ { 0x0229, {1, {0x0228 }}},
+ { 0x022b, {1, {0x022a }}},
+ { 0x022d, {1, {0x022c }}},
+ { 0x022f, {1, {0x022e }}},
+ { 0x0231, {1, {0x0230 }}},
+ { 0x0233, {1, {0x0232 }}},
+ { 0x023c, {1, {0x023b }}},
+ { 0x023f, {1, {0x2c7e }}},
+ { 0x0240, {1, {0x2c7f }}},
+ { 0x0242, {1, {0x0241 }}},
+ { 0x0247, {1, {0x0246 }}},
+ { 0x0249, {1, {0x0248 }}},
+ { 0x024b, {1, {0x024a }}},
+ { 0x024d, {1, {0x024c }}},
+ { 0x024f, {1, {0x024e }}},
+ { 0x0250, {1, {0x2c6f }}},
+ { 0x0251, {1, {0x2c6d }}},
+ { 0x0252, {1, {0x2c70 }}},
+ { 0x0253, {1, {0x0181 }}},
+ { 0x0254, {1, {0x0186 }}},
+ { 0x0256, {1, {0x0189 }}},
+ { 0x0257, {1, {0x018a }}},
+ { 0x0259, {1, {0x018f }}},
+ { 0x025b, {1, {0x0190 }}},
+ { 0x0260, {1, {0x0193 }}},
+ { 0x0263, {1, {0x0194 }}},
+ { 0x0265, {1, {0xa78d }}},
+ { 0x0266, {1, {0xa7aa }}},
+ { 0x0268, {1, {0x0197 }}},
+ { 0x0269, {1, {0x0196 }}},
+ { 0x026b, {1, {0x2c62 }}},
+ { 0x026f, {1, {0x019c }}},
+ { 0x0271, {1, {0x2c6e }}},
+ { 0x0272, {1, {0x019d }}},
+ { 0x0275, {1, {0x019f }}},
+ { 0x027d, {1, {0x2c64 }}},
+ { 0x0280, {1, {0x01a6 }}},
+ { 0x0283, {1, {0x01a9 }}},
+ { 0x0288, {1, {0x01ae }}},
+ { 0x0289, {1, {0x0244 }}},
+ { 0x028a, {1, {0x01b1 }}},
+ { 0x028b, {1, {0x01b2 }}},
+ { 0x028c, {1, {0x0245 }}},
+ { 0x0292, {1, {0x01b7 }}},
+ { 0x0371, {1, {0x0370 }}},
+ { 0x0373, {1, {0x0372 }}},
+ { 0x0377, {1, {0x0376 }}},
+ { 0x037b, {1, {0x03fd }}},
+ { 0x037c, {1, {0x03fe }}},
+ { 0x037d, {1, {0x03ff }}},
+ { 0x03ac, {1, {0x0386 }}},
+ { 0x03ad, {1, {0x0388 }}},
+ { 0x03ae, {1, {0x0389 }}},
+ { 0x03af, {1, {0x038a }}},
+ { 0x03b1, {1, {0x0391 }}},
+ { 0x03b2, {2, {0x0392, 0x03d0 }}},
+ { 0x03b3, {1, {0x0393 }}},
+ { 0x03b4, {1, {0x0394 }}},
+ { 0x03b5, {2, {0x0395, 0x03f5 }}},
+ { 0x03b6, {1, {0x0396 }}},
+ { 0x03b7, {1, {0x0397 }}},
+ { 0x03b8, {3, {0x0398, 0x03d1, 0x03f4 }}},
+ { 0x03b9, {3, {0x0345, 0x0399, 0x1fbe }}},
+ { 0x03ba, {2, {0x039a, 0x03f0 }}},
+ { 0x03bb, {1, {0x039b }}},
+ { 0x03bc, {2, {0x00b5, 0x039c }}},
+ { 0x03bd, {1, {0x039d }}},
+ { 0x03be, {1, {0x039e }}},
+ { 0x03bf, {1, {0x039f }}},
+ { 0x03c0, {2, {0x03a0, 0x03d6 }}},
+ { 0x03c1, {2, {0x03a1, 0x03f1 }}},
+ { 0x03c3, {2, {0x03a3, 0x03c2 }}},
+ { 0x03c4, {1, {0x03a4 }}},
+ { 0x03c5, {1, {0x03a5 }}},
+ { 0x03c6, {2, {0x03a6, 0x03d5 }}},
+ { 0x03c7, {1, {0x03a7 }}},
+ { 0x03c8, {1, {0x03a8 }}},
+ { 0x03c9, {2, {0x03a9, 0x2126 }}},
+ { 0x03ca, {1, {0x03aa }}},
+ { 0x03cb, {1, {0x03ab }}},
+ { 0x03cc, {1, {0x038c }}},
+ { 0x03cd, {1, {0x038e }}},
+ { 0x03ce, {1, {0x038f }}},
+ { 0x03d7, {1, {0x03cf }}},
+ { 0x03d9, {1, {0x03d8 }}},
+ { 0x03db, {1, {0x03da }}},
+ { 0x03dd, {1, {0x03dc }}},
+ { 0x03df, {1, {0x03de }}},
+ { 0x03e1, {1, {0x03e0 }}},
+ { 0x03e3, {1, {0x03e2 }}},
+ { 0x03e5, {1, {0x03e4 }}},
+ { 0x03e7, {1, {0x03e6 }}},
+ { 0x03e9, {1, {0x03e8 }}},
+ { 0x03eb, {1, {0x03ea }}},
+ { 0x03ed, {1, {0x03ec }}},
+ { 0x03ef, {1, {0x03ee }}},
+ { 0x03f2, {1, {0x03f9 }}},
+ { 0x03f8, {1, {0x03f7 }}},
+ { 0x03fb, {1, {0x03fa }}},
+ { 0x0430, {1, {0x0410 }}},
+ { 0x0431, {1, {0x0411 }}},
+ { 0x0432, {1, {0x0412 }}},
+ { 0x0433, {1, {0x0413 }}},
+ { 0x0434, {1, {0x0414 }}},
+ { 0x0435, {1, {0x0415 }}},
+ { 0x0436, {1, {0x0416 }}},
+ { 0x0437, {1, {0x0417 }}},
+ { 0x0438, {1, {0x0418 }}},
+ { 0x0439, {1, {0x0419 }}},
+ { 0x043a, {1, {0x041a }}},
+ { 0x043b, {1, {0x041b }}},
+ { 0x043c, {1, {0x041c }}},
+ { 0x043d, {1, {0x041d }}},
+ { 0x043e, {1, {0x041e }}},
+ { 0x043f, {1, {0x041f }}},
+ { 0x0440, {1, {0x0420 }}},
+ { 0x0441, {1, {0x0421 }}},
+ { 0x0442, {1, {0x0422 }}},
+ { 0x0443, {1, {0x0423 }}},
+ { 0x0444, {1, {0x0424 }}},
+ { 0x0445, {1, {0x0425 }}},
+ { 0x0446, {1, {0x0426 }}},
+ { 0x0447, {1, {0x0427 }}},
+ { 0x0448, {1, {0x0428 }}},
+ { 0x0449, {1, {0x0429 }}},
+ { 0x044a, {1, {0x042a }}},
+ { 0x044b, {1, {0x042b }}},
+ { 0x044c, {1, {0x042c }}},
+ { 0x044d, {1, {0x042d }}},
+ { 0x044e, {1, {0x042e }}},
+ { 0x044f, {1, {0x042f }}},
+ { 0x0450, {1, {0x0400 }}},
+ { 0x0451, {1, {0x0401 }}},
+ { 0x0452, {1, {0x0402 }}},
+ { 0x0453, {1, {0x0403 }}},
+ { 0x0454, {1, {0x0404 }}},
+ { 0x0455, {1, {0x0405 }}},
+ { 0x0456, {1, {0x0406 }}},
+ { 0x0457, {1, {0x0407 }}},
+ { 0x0458, {1, {0x0408 }}},
+ { 0x0459, {1, {0x0409 }}},
+ { 0x045a, {1, {0x040a }}},
+ { 0x045b, {1, {0x040b }}},
+ { 0x045c, {1, {0x040c }}},
+ { 0x045d, {1, {0x040d }}},
+ { 0x045e, {1, {0x040e }}},
+ { 0x045f, {1, {0x040f }}},
+ { 0x0461, {1, {0x0460 }}},
+ { 0x0463, {1, {0x0462 }}},
+ { 0x0465, {1, {0x0464 }}},
+ { 0x0467, {1, {0x0466 }}},
+ { 0x0469, {1, {0x0468 }}},
+ { 0x046b, {1, {0x046a }}},
+ { 0x046d, {1, {0x046c }}},
+ { 0x046f, {1, {0x046e }}},
+ { 0x0471, {1, {0x0470 }}},
+ { 0x0473, {1, {0x0472 }}},
+ { 0x0475, {1, {0x0474 }}},
+ { 0x0477, {1, {0x0476 }}},
+ { 0x0479, {1, {0x0478 }}},
+ { 0x047b, {1, {0x047a }}},
+ { 0x047d, {1, {0x047c }}},
+ { 0x047f, {1, {0x047e }}},
+ { 0x0481, {1, {0x0480 }}},
+ { 0x048b, {1, {0x048a }}},
+ { 0x048d, {1, {0x048c }}},
+ { 0x048f, {1, {0x048e }}},
+ { 0x0491, {1, {0x0490 }}},
+ { 0x0493, {1, {0x0492 }}},
+ { 0x0495, {1, {0x0494 }}},
+ { 0x0497, {1, {0x0496 }}},
+ { 0x0499, {1, {0x0498 }}},
+ { 0x049b, {1, {0x049a }}},
+ { 0x049d, {1, {0x049c }}},
+ { 0x049f, {1, {0x049e }}},
+ { 0x04a1, {1, {0x04a0 }}},
+ { 0x04a3, {1, {0x04a2 }}},
+ { 0x04a5, {1, {0x04a4 }}},
+ { 0x04a7, {1, {0x04a6 }}},
+ { 0x04a9, {1, {0x04a8 }}},
+ { 0x04ab, {1, {0x04aa }}},
+ { 0x04ad, {1, {0x04ac }}},
+ { 0x04af, {1, {0x04ae }}},
+ { 0x04b1, {1, {0x04b0 }}},
+ { 0x04b3, {1, {0x04b2 }}},
+ { 0x04b5, {1, {0x04b4 }}},
+ { 0x04b7, {1, {0x04b6 }}},
+ { 0x04b9, {1, {0x04b8 }}},
+ { 0x04bb, {1, {0x04ba }}},
+ { 0x04bd, {1, {0x04bc }}},
+ { 0x04bf, {1, {0x04be }}},
+ { 0x04c2, {1, {0x04c1 }}},
+ { 0x04c4, {1, {0x04c3 }}},
+ { 0x04c6, {1, {0x04c5 }}},
+ { 0x04c8, {1, {0x04c7 }}},
+ { 0x04ca, {1, {0x04c9 }}},
+ { 0x04cc, {1, {0x04cb }}},
+ { 0x04ce, {1, {0x04cd }}},
+ { 0x04cf, {1, {0x04c0 }}},
+ { 0x04d1, {1, {0x04d0 }}},
+ { 0x04d3, {1, {0x04d2 }}},
+ { 0x04d5, {1, {0x04d4 }}},
+ { 0x04d7, {1, {0x04d6 }}},
+ { 0x04d9, {1, {0x04d8 }}},
+ { 0x04db, {1, {0x04da }}},
+ { 0x04dd, {1, {0x04dc }}},
+ { 0x04df, {1, {0x04de }}},
+ { 0x04e1, {1, {0x04e0 }}},
+ { 0x04e3, {1, {0x04e2 }}},
+ { 0x04e5, {1, {0x04e4 }}},
+ { 0x04e7, {1, {0x04e6 }}},
+ { 0x04e9, {1, {0x04e8 }}},
+ { 0x04eb, {1, {0x04ea }}},
+ { 0x04ed, {1, {0x04ec }}},
+ { 0x04ef, {1, {0x04ee }}},
+ { 0x04f1, {1, {0x04f0 }}},
+ { 0x04f3, {1, {0x04f2 }}},
+ { 0x04f5, {1, {0x04f4 }}},
+ { 0x04f7, {1, {0x04f6 }}},
+ { 0x04f9, {1, {0x04f8 }}},
+ { 0x04fb, {1, {0x04fa }}},
+ { 0x04fd, {1, {0x04fc }}},
+ { 0x04ff, {1, {0x04fe }}},
+ { 0x0501, {1, {0x0500 }}},
+ { 0x0503, {1, {0x0502 }}},
+ { 0x0505, {1, {0x0504 }}},
+ { 0x0507, {1, {0x0506 }}},
+ { 0x0509, {1, {0x0508 }}},
+ { 0x050b, {1, {0x050a }}},
+ { 0x050d, {1, {0x050c }}},
+ { 0x050f, {1, {0x050e }}},
+ { 0x0511, {1, {0x0510 }}},
+ { 0x0513, {1, {0x0512 }}},
+ { 0x0515, {1, {0x0514 }}},
+ { 0x0517, {1, {0x0516 }}},
+ { 0x0519, {1, {0x0518 }}},
+ { 0x051b, {1, {0x051a }}},
+ { 0x051d, {1, {0x051c }}},
+ { 0x051f, {1, {0x051e }}},
+ { 0x0521, {1, {0x0520 }}},
+ { 0x0523, {1, {0x0522 }}},
+ { 0x0525, {1, {0x0524 }}},
+ { 0x0527, {1, {0x0526 }}},
+ { 0x0561, {1, {0x0531 }}},
+ { 0x0562, {1, {0x0532 }}},
+ { 0x0563, {1, {0x0533 }}},
+ { 0x0564, {1, {0x0534 }}},
+ { 0x0565, {1, {0x0535 }}},
+ { 0x0566, {1, {0x0536 }}},
+ { 0x0567, {1, {0x0537 }}},
+ { 0x0568, {1, {0x0538 }}},
+ { 0x0569, {1, {0x0539 }}},
+ { 0x056a, {1, {0x053a }}},
+ { 0x056b, {1, {0x053b }}},
+ { 0x056c, {1, {0x053c }}},
+ { 0x056d, {1, {0x053d }}},
+ { 0x056e, {1, {0x053e }}},
+ { 0x056f, {1, {0x053f }}},
+ { 0x0570, {1, {0x0540 }}},
+ { 0x0571, {1, {0x0541 }}},
+ { 0x0572, {1, {0x0542 }}},
+ { 0x0573, {1, {0x0543 }}},
+ { 0x0574, {1, {0x0544 }}},
+ { 0x0575, {1, {0x0545 }}},
+ { 0x0576, {1, {0x0546 }}},
+ { 0x0577, {1, {0x0547 }}},
+ { 0x0578, {1, {0x0548 }}},
+ { 0x0579, {1, {0x0549 }}},
+ { 0x057a, {1, {0x054a }}},
+ { 0x057b, {1, {0x054b }}},
+ { 0x057c, {1, {0x054c }}},
+ { 0x057d, {1, {0x054d }}},
+ { 0x057e, {1, {0x054e }}},
+ { 0x057f, {1, {0x054f }}},
+ { 0x0580, {1, {0x0550 }}},
+ { 0x0581, {1, {0x0551 }}},
+ { 0x0582, {1, {0x0552 }}},
+ { 0x0583, {1, {0x0553 }}},
+ { 0x0584, {1, {0x0554 }}},
+ { 0x0585, {1, {0x0555 }}},
+ { 0x0586, {1, {0x0556 }}},
+ { 0x1d79, {1, {0xa77d }}},
+ { 0x1d7d, {1, {0x2c63 }}},
+ { 0x1e01, {1, {0x1e00 }}},
+ { 0x1e03, {1, {0x1e02 }}},
+ { 0x1e05, {1, {0x1e04 }}},
+ { 0x1e07, {1, {0x1e06 }}},
+ { 0x1e09, {1, {0x1e08 }}},
+ { 0x1e0b, {1, {0x1e0a }}},
+ { 0x1e0d, {1, {0x1e0c }}},
+ { 0x1e0f, {1, {0x1e0e }}},
+ { 0x1e11, {1, {0x1e10 }}},
+ { 0x1e13, {1, {0x1e12 }}},
+ { 0x1e15, {1, {0x1e14 }}},
+ { 0x1e17, {1, {0x1e16 }}},
+ { 0x1e19, {1, {0x1e18 }}},
+ { 0x1e1b, {1, {0x1e1a }}},
+ { 0x1e1d, {1, {0x1e1c }}},
+ { 0x1e1f, {1, {0x1e1e }}},
+ { 0x1e21, {1, {0x1e20 }}},
+ { 0x1e23, {1, {0x1e22 }}},
+ { 0x1e25, {1, {0x1e24 }}},
+ { 0x1e27, {1, {0x1e26 }}},
+ { 0x1e29, {1, {0x1e28 }}},
+ { 0x1e2b, {1, {0x1e2a }}},
+ { 0x1e2d, {1, {0x1e2c }}},
+ { 0x1e2f, {1, {0x1e2e }}},
+ { 0x1e31, {1, {0x1e30 }}},
+ { 0x1e33, {1, {0x1e32 }}},
+ { 0x1e35, {1, {0x1e34 }}},
+ { 0x1e37, {1, {0x1e36 }}},
+ { 0x1e39, {1, {0x1e38 }}},
+ { 0x1e3b, {1, {0x1e3a }}},
+ { 0x1e3d, {1, {0x1e3c }}},
+ { 0x1e3f, {1, {0x1e3e }}},
+ { 0x1e41, {1, {0x1e40 }}},
+ { 0x1e43, {1, {0x1e42 }}},
+ { 0x1e45, {1, {0x1e44 }}},
+ { 0x1e47, {1, {0x1e46 }}},
+ { 0x1e49, {1, {0x1e48 }}},
+ { 0x1e4b, {1, {0x1e4a }}},
+ { 0x1e4d, {1, {0x1e4c }}},
+ { 0x1e4f, {1, {0x1e4e }}},
+ { 0x1e51, {1, {0x1e50 }}},
+ { 0x1e53, {1, {0x1e52 }}},
+ { 0x1e55, {1, {0x1e54 }}},
+ { 0x1e57, {1, {0x1e56 }}},
+ { 0x1e59, {1, {0x1e58 }}},
+ { 0x1e5b, {1, {0x1e5a }}},
+ { 0x1e5d, {1, {0x1e5c }}},
+ { 0x1e5f, {1, {0x1e5e }}},
+ { 0x1e61, {2, {0x1e60, 0x1e9b }}},
+ { 0x1e63, {1, {0x1e62 }}},
+ { 0x1e65, {1, {0x1e64 }}},
+ { 0x1e67, {1, {0x1e66 }}},
+ { 0x1e69, {1, {0x1e68 }}},
+ { 0x1e6b, {1, {0x1e6a }}},
+ { 0x1e6d, {1, {0x1e6c }}},
+ { 0x1e6f, {1, {0x1e6e }}},
+ { 0x1e71, {1, {0x1e70 }}},
+ { 0x1e73, {1, {0x1e72 }}},
+ { 0x1e75, {1, {0x1e74 }}},
+ { 0x1e77, {1, {0x1e76 }}},
+ { 0x1e79, {1, {0x1e78 }}},
+ { 0x1e7b, {1, {0x1e7a }}},
+ { 0x1e7d, {1, {0x1e7c }}},
+ { 0x1e7f, {1, {0x1e7e }}},
+ { 0x1e81, {1, {0x1e80 }}},
+ { 0x1e83, {1, {0x1e82 }}},
+ { 0x1e85, {1, {0x1e84 }}},
+ { 0x1e87, {1, {0x1e86 }}},
+ { 0x1e89, {1, {0x1e88 }}},
+ { 0x1e8b, {1, {0x1e8a }}},
+ { 0x1e8d, {1, {0x1e8c }}},
+ { 0x1e8f, {1, {0x1e8e }}},
+ { 0x1e91, {1, {0x1e90 }}},
+ { 0x1e93, {1, {0x1e92 }}},
+ { 0x1e95, {1, {0x1e94 }}},
+ { 0x1ea1, {1, {0x1ea0 }}},
+ { 0x1ea3, {1, {0x1ea2 }}},
+ { 0x1ea5, {1, {0x1ea4 }}},
+ { 0x1ea7, {1, {0x1ea6 }}},
+ { 0x1ea9, {1, {0x1ea8 }}},
+ { 0x1eab, {1, {0x1eaa }}},
+ { 0x1ead, {1, {0x1eac }}},
+ { 0x1eaf, {1, {0x1eae }}},
+ { 0x1eb1, {1, {0x1eb0 }}},
+ { 0x1eb3, {1, {0x1eb2 }}},
+ { 0x1eb5, {1, {0x1eb4 }}},
+ { 0x1eb7, {1, {0x1eb6 }}},
+ { 0x1eb9, {1, {0x1eb8 }}},
+ { 0x1ebb, {1, {0x1eba }}},
+ { 0x1ebd, {1, {0x1ebc }}},
+ { 0x1ebf, {1, {0x1ebe }}},
+ { 0x1ec1, {1, {0x1ec0 }}},
+ { 0x1ec3, {1, {0x1ec2 }}},
+ { 0x1ec5, {1, {0x1ec4 }}},
+ { 0x1ec7, {1, {0x1ec6 }}},
+ { 0x1ec9, {1, {0x1ec8 }}},
+ { 0x1ecb, {1, {0x1eca }}},
+ { 0x1ecd, {1, {0x1ecc }}},
+ { 0x1ecf, {1, {0x1ece }}},
+ { 0x1ed1, {1, {0x1ed0 }}},
+ { 0x1ed3, {1, {0x1ed2 }}},
+ { 0x1ed5, {1, {0x1ed4 }}},
+ { 0x1ed7, {1, {0x1ed6 }}},
+ { 0x1ed9, {1, {0x1ed8 }}},
+ { 0x1edb, {1, {0x1eda }}},
+ { 0x1edd, {1, {0x1edc }}},
+ { 0x1edf, {1, {0x1ede }}},
+ { 0x1ee1, {1, {0x1ee0 }}},
+ { 0x1ee3, {1, {0x1ee2 }}},
+ { 0x1ee5, {1, {0x1ee4 }}},
+ { 0x1ee7, {1, {0x1ee6 }}},
+ { 0x1ee9, {1, {0x1ee8 }}},
+ { 0x1eeb, {1, {0x1eea }}},
+ { 0x1eed, {1, {0x1eec }}},
+ { 0x1eef, {1, {0x1eee }}},
+ { 0x1ef1, {1, {0x1ef0 }}},
+ { 0x1ef3, {1, {0x1ef2 }}},
+ { 0x1ef5, {1, {0x1ef4 }}},
+ { 0x1ef7, {1, {0x1ef6 }}},
+ { 0x1ef9, {1, {0x1ef8 }}},
+ { 0x1efb, {1, {0x1efa }}},
+ { 0x1efd, {1, {0x1efc }}},
+ { 0x1eff, {1, {0x1efe }}},
+ { 0x1f00, {1, {0x1f08 }}},
+ { 0x1f01, {1, {0x1f09 }}},
+ { 0x1f02, {1, {0x1f0a }}},
+ { 0x1f03, {1, {0x1f0b }}},
+ { 0x1f04, {1, {0x1f0c }}},
+ { 0x1f05, {1, {0x1f0d }}},
+ { 0x1f06, {1, {0x1f0e }}},
+ { 0x1f07, {1, {0x1f0f }}},
+ { 0x1f10, {1, {0x1f18 }}},
+ { 0x1f11, {1, {0x1f19 }}},
+ { 0x1f12, {1, {0x1f1a }}},
+ { 0x1f13, {1, {0x1f1b }}},
+ { 0x1f14, {1, {0x1f1c }}},
+ { 0x1f15, {1, {0x1f1d }}},
+ { 0x1f20, {1, {0x1f28 }}},
+ { 0x1f21, {1, {0x1f29 }}},
+ { 0x1f22, {1, {0x1f2a }}},
+ { 0x1f23, {1, {0x1f2b }}},
+ { 0x1f24, {1, {0x1f2c }}},
+ { 0x1f25, {1, {0x1f2d }}},
+ { 0x1f26, {1, {0x1f2e }}},
+ { 0x1f27, {1, {0x1f2f }}},
+ { 0x1f30, {1, {0x1f38 }}},
+ { 0x1f31, {1, {0x1f39 }}},
+ { 0x1f32, {1, {0x1f3a }}},
+ { 0x1f33, {1, {0x1f3b }}},
+ { 0x1f34, {1, {0x1f3c }}},
+ { 0x1f35, {1, {0x1f3d }}},
+ { 0x1f36, {1, {0x1f3e }}},
+ { 0x1f37, {1, {0x1f3f }}},
+ { 0x1f40, {1, {0x1f48 }}},
+ { 0x1f41, {1, {0x1f49 }}},
+ { 0x1f42, {1, {0x1f4a }}},
+ { 0x1f43, {1, {0x1f4b }}},
+ { 0x1f44, {1, {0x1f4c }}},
+ { 0x1f45, {1, {0x1f4d }}},
+ { 0x1f51, {1, {0x1f59 }}},
+ { 0x1f53, {1, {0x1f5b }}},
+ { 0x1f55, {1, {0x1f5d }}},
+ { 0x1f57, {1, {0x1f5f }}},
+ { 0x1f60, {1, {0x1f68 }}},
+ { 0x1f61, {1, {0x1f69 }}},
+ { 0x1f62, {1, {0x1f6a }}},
+ { 0x1f63, {1, {0x1f6b }}},
+ { 0x1f64, {1, {0x1f6c }}},
+ { 0x1f65, {1, {0x1f6d }}},
+ { 0x1f66, {1, {0x1f6e }}},
+ { 0x1f67, {1, {0x1f6f }}},
+ { 0x1f70, {1, {0x1fba }}},
+ { 0x1f71, {1, {0x1fbb }}},
+ { 0x1f72, {1, {0x1fc8 }}},
+ { 0x1f73, {1, {0x1fc9 }}},
+ { 0x1f74, {1, {0x1fca }}},
+ { 0x1f75, {1, {0x1fcb }}},
+ { 0x1f76, {1, {0x1fda }}},
+ { 0x1f77, {1, {0x1fdb }}},
+ { 0x1f78, {1, {0x1ff8 }}},
+ { 0x1f79, {1, {0x1ff9 }}},
+ { 0x1f7a, {1, {0x1fea }}},
+ { 0x1f7b, {1, {0x1feb }}},
+ { 0x1f7c, {1, {0x1ffa }}},
+ { 0x1f7d, {1, {0x1ffb }}},
+ { 0x1fb0, {1, {0x1fb8 }}},
+ { 0x1fb1, {1, {0x1fb9 }}},
+ { 0x1fd0, {1, {0x1fd8 }}},
+ { 0x1fd1, {1, {0x1fd9 }}},
+ { 0x1fe0, {1, {0x1fe8 }}},
+ { 0x1fe1, {1, {0x1fe9 }}},
+ { 0x1fe5, {1, {0x1fec }}},
+ { 0x214e, {1, {0x2132 }}},
+ { 0x2170, {1, {0x2160 }}},
+ { 0x2171, {1, {0x2161 }}},
+ { 0x2172, {1, {0x2162 }}},
+ { 0x2173, {1, {0x2163 }}},
+ { 0x2174, {1, {0x2164 }}},
+ { 0x2175, {1, {0x2165 }}},
+ { 0x2176, {1, {0x2166 }}},
+ { 0x2177, {1, {0x2167 }}},
+ { 0x2178, {1, {0x2168 }}},
+ { 0x2179, {1, {0x2169 }}},
+ { 0x217a, {1, {0x216a }}},
+ { 0x217b, {1, {0x216b }}},
+ { 0x217c, {1, {0x216c }}},
+ { 0x217d, {1, {0x216d }}},
+ { 0x217e, {1, {0x216e }}},
+ { 0x217f, {1, {0x216f }}},
+ { 0x2184, {1, {0x2183 }}},
+ { 0x24d0, {1, {0x24b6 }}},
+ { 0x24d1, {1, {0x24b7 }}},
+ { 0x24d2, {1, {0x24b8 }}},
+ { 0x24d3, {1, {0x24b9 }}},
+ { 0x24d4, {1, {0x24ba }}},
+ { 0x24d5, {1, {0x24bb }}},
+ { 0x24d6, {1, {0x24bc }}},
+ { 0x24d7, {1, {0x24bd }}},
+ { 0x24d8, {1, {0x24be }}},
+ { 0x24d9, {1, {0x24bf }}},
+ { 0x24da, {1, {0x24c0 }}},
+ { 0x24db, {1, {0x24c1 }}},
+ { 0x24dc, {1, {0x24c2 }}},
+ { 0x24dd, {1, {0x24c3 }}},
+ { 0x24de, {1, {0x24c4 }}},
+ { 0x24df, {1, {0x24c5 }}},
+ { 0x24e0, {1, {0x24c6 }}},
+ { 0x24e1, {1, {0x24c7 }}},
+ { 0x24e2, {1, {0x24c8 }}},
+ { 0x24e3, {1, {0x24c9 }}},
+ { 0x24e4, {1, {0x24ca }}},
+ { 0x24e5, {1, {0x24cb }}},
+ { 0x24e6, {1, {0x24cc }}},
+ { 0x24e7, {1, {0x24cd }}},
+ { 0x24e8, {1, {0x24ce }}},
+ { 0x24e9, {1, {0x24cf }}},
+ { 0x2c30, {1, {0x2c00 }}},
+ { 0x2c31, {1, {0x2c01 }}},
+ { 0x2c32, {1, {0x2c02 }}},
+ { 0x2c33, {1, {0x2c03 }}},
+ { 0x2c34, {1, {0x2c04 }}},
+ { 0x2c35, {1, {0x2c05 }}},
+ { 0x2c36, {1, {0x2c06 }}},
+ { 0x2c37, {1, {0x2c07 }}},
+ { 0x2c38, {1, {0x2c08 }}},
+ { 0x2c39, {1, {0x2c09 }}},
+ { 0x2c3a, {1, {0x2c0a }}},
+ { 0x2c3b, {1, {0x2c0b }}},
+ { 0x2c3c, {1, {0x2c0c }}},
+ { 0x2c3d, {1, {0x2c0d }}},
+ { 0x2c3e, {1, {0x2c0e }}},
+ { 0x2c3f, {1, {0x2c0f }}},
+ { 0x2c40, {1, {0x2c10 }}},
+ { 0x2c41, {1, {0x2c11 }}},
+ { 0x2c42, {1, {0x2c12 }}},
+ { 0x2c43, {1, {0x2c13 }}},
+ { 0x2c44, {1, {0x2c14 }}},
+ { 0x2c45, {1, {0x2c15 }}},
+ { 0x2c46, {1, {0x2c16 }}},
+ { 0x2c47, {1, {0x2c17 }}},
+ { 0x2c48, {1, {0x2c18 }}},
+ { 0x2c49, {1, {0x2c19 }}},
+ { 0x2c4a, {1, {0x2c1a }}},
+ { 0x2c4b, {1, {0x2c1b }}},
+ { 0x2c4c, {1, {0x2c1c }}},
+ { 0x2c4d, {1, {0x2c1d }}},
+ { 0x2c4e, {1, {0x2c1e }}},
+ { 0x2c4f, {1, {0x2c1f }}},
+ { 0x2c50, {1, {0x2c20 }}},
+ { 0x2c51, {1, {0x2c21 }}},
+ { 0x2c52, {1, {0x2c22 }}},
+ { 0x2c53, {1, {0x2c23 }}},
+ { 0x2c54, {1, {0x2c24 }}},
+ { 0x2c55, {1, {0x2c25 }}},
+ { 0x2c56, {1, {0x2c26 }}},
+ { 0x2c57, {1, {0x2c27 }}},
+ { 0x2c58, {1, {0x2c28 }}},
+ { 0x2c59, {1, {0x2c29 }}},
+ { 0x2c5a, {1, {0x2c2a }}},
+ { 0x2c5b, {1, {0x2c2b }}},
+ { 0x2c5c, {1, {0x2c2c }}},
+ { 0x2c5d, {1, {0x2c2d }}},
+ { 0x2c5e, {1, {0x2c2e }}},
+ { 0x2c61, {1, {0x2c60 }}},
+ { 0x2c65, {1, {0x023a }}},
+ { 0x2c66, {1, {0x023e }}},
+ { 0x2c68, {1, {0x2c67 }}},
+ { 0x2c6a, {1, {0x2c69 }}},
+ { 0x2c6c, {1, {0x2c6b }}},
+ { 0x2c73, {1, {0x2c72 }}},
+ { 0x2c76, {1, {0x2c75 }}},
+ { 0x2c81, {1, {0x2c80 }}},
+ { 0x2c83, {1, {0x2c82 }}},
+ { 0x2c85, {1, {0x2c84 }}},
+ { 0x2c87, {1, {0x2c86 }}},
+ { 0x2c89, {1, {0x2c88 }}},
+ { 0x2c8b, {1, {0x2c8a }}},
+ { 0x2c8d, {1, {0x2c8c }}},
+ { 0x2c8f, {1, {0x2c8e }}},
+ { 0x2c91, {1, {0x2c90 }}},
+ { 0x2c93, {1, {0x2c92 }}},
+ { 0x2c95, {1, {0x2c94 }}},
+ { 0x2c97, {1, {0x2c96 }}},
+ { 0x2c99, {1, {0x2c98 }}},
+ { 0x2c9b, {1, {0x2c9a }}},
+ { 0x2c9d, {1, {0x2c9c }}},
+ { 0x2c9f, {1, {0x2c9e }}},
+ { 0x2ca1, {1, {0x2ca0 }}},
+ { 0x2ca3, {1, {0x2ca2 }}},
+ { 0x2ca5, {1, {0x2ca4 }}},
+ { 0x2ca7, {1, {0x2ca6 }}},
+ { 0x2ca9, {1, {0x2ca8 }}},
+ { 0x2cab, {1, {0x2caa }}},
+ { 0x2cad, {1, {0x2cac }}},
+ { 0x2caf, {1, {0x2cae }}},
+ { 0x2cb1, {1, {0x2cb0 }}},
+ { 0x2cb3, {1, {0x2cb2 }}},
+ { 0x2cb5, {1, {0x2cb4 }}},
+ { 0x2cb7, {1, {0x2cb6 }}},
+ { 0x2cb9, {1, {0x2cb8 }}},
+ { 0x2cbb, {1, {0x2cba }}},
+ { 0x2cbd, {1, {0x2cbc }}},
+ { 0x2cbf, {1, {0x2cbe }}},
+ { 0x2cc1, {1, {0x2cc0 }}},
+ { 0x2cc3, {1, {0x2cc2 }}},
+ { 0x2cc5, {1, {0x2cc4 }}},
+ { 0x2cc7, {1, {0x2cc6 }}},
+ { 0x2cc9, {1, {0x2cc8 }}},
+ { 0x2ccb, {1, {0x2cca }}},
+ { 0x2ccd, {1, {0x2ccc }}},
+ { 0x2ccf, {1, {0x2cce }}},
+ { 0x2cd1, {1, {0x2cd0 }}},
+ { 0x2cd3, {1, {0x2cd2 }}},
+ { 0x2cd5, {1, {0x2cd4 }}},
+ { 0x2cd7, {1, {0x2cd6 }}},
+ { 0x2cd9, {1, {0x2cd8 }}},
+ { 0x2cdb, {1, {0x2cda }}},
+ { 0x2cdd, {1, {0x2cdc }}},
+ { 0x2cdf, {1, {0x2cde }}},
+ { 0x2ce1, {1, {0x2ce0 }}},
+ { 0x2ce3, {1, {0x2ce2 }}},
+ { 0x2cec, {1, {0x2ceb }}},
+ { 0x2cee, {1, {0x2ced }}},
+ { 0x2cf3, {1, {0x2cf2 }}},
+ { 0x2d00, {1, {0x10a0 }}},
+ { 0x2d01, {1, {0x10a1 }}},
+ { 0x2d02, {1, {0x10a2 }}},
+ { 0x2d03, {1, {0x10a3 }}},
+ { 0x2d04, {1, {0x10a4 }}},
+ { 0x2d05, {1, {0x10a5 }}},
+ { 0x2d06, {1, {0x10a6 }}},
+ { 0x2d07, {1, {0x10a7 }}},
+ { 0x2d08, {1, {0x10a8 }}},
+ { 0x2d09, {1, {0x10a9 }}},
+ { 0x2d0a, {1, {0x10aa }}},
+ { 0x2d0b, {1, {0x10ab }}},
+ { 0x2d0c, {1, {0x10ac }}},
+ { 0x2d0d, {1, {0x10ad }}},
+ { 0x2d0e, {1, {0x10ae }}},
+ { 0x2d0f, {1, {0x10af }}},
+ { 0x2d10, {1, {0x10b0 }}},
+ { 0x2d11, {1, {0x10b1 }}},
+ { 0x2d12, {1, {0x10b2 }}},
+ { 0x2d13, {1, {0x10b3 }}},
+ { 0x2d14, {1, {0x10b4 }}},
+ { 0x2d15, {1, {0x10b5 }}},
+ { 0x2d16, {1, {0x10b6 }}},
+ { 0x2d17, {1, {0x10b7 }}},
+ { 0x2d18, {1, {0x10b8 }}},
+ { 0x2d19, {1, {0x10b9 }}},
+ { 0x2d1a, {1, {0x10ba }}},
+ { 0x2d1b, {1, {0x10bb }}},
+ { 0x2d1c, {1, {0x10bc }}},
+ { 0x2d1d, {1, {0x10bd }}},
+ { 0x2d1e, {1, {0x10be }}},
+ { 0x2d1f, {1, {0x10bf }}},
+ { 0x2d20, {1, {0x10c0 }}},
+ { 0x2d21, {1, {0x10c1 }}},
+ { 0x2d22, {1, {0x10c2 }}},
+ { 0x2d23, {1, {0x10c3 }}},
+ { 0x2d24, {1, {0x10c4 }}},
+ { 0x2d25, {1, {0x10c5 }}},
+ { 0x2d27, {1, {0x10c7 }}},
+ { 0x2d2d, {1, {0x10cd }}},
+ { 0xa641, {1, {0xa640 }}},
+ { 0xa643, {1, {0xa642 }}},
+ { 0xa645, {1, {0xa644 }}},
+ { 0xa647, {1, {0xa646 }}},
+ { 0xa649, {1, {0xa648 }}},
+ { 0xa64b, {1, {0xa64a }}},
+ { 0xa64d, {1, {0xa64c }}},
+ { 0xa64f, {1, {0xa64e }}},
+ { 0xa651, {1, {0xa650 }}},
+ { 0xa653, {1, {0xa652 }}},
+ { 0xa655, {1, {0xa654 }}},
+ { 0xa657, {1, {0xa656 }}},
+ { 0xa659, {1, {0xa658 }}},
+ { 0xa65b, {1, {0xa65a }}},
+ { 0xa65d, {1, {0xa65c }}},
+ { 0xa65f, {1, {0xa65e }}},
+ { 0xa661, {1, {0xa660 }}},
+ { 0xa663, {1, {0xa662 }}},
+ { 0xa665, {1, {0xa664 }}},
+ { 0xa667, {1, {0xa666 }}},
+ { 0xa669, {1, {0xa668 }}},
+ { 0xa66b, {1, {0xa66a }}},
+ { 0xa66d, {1, {0xa66c }}},
+ { 0xa681, {1, {0xa680 }}},
+ { 0xa683, {1, {0xa682 }}},
+ { 0xa685, {1, {0xa684 }}},
+ { 0xa687, {1, {0xa686 }}},
+ { 0xa689, {1, {0xa688 }}},
+ { 0xa68b, {1, {0xa68a }}},
+ { 0xa68d, {1, {0xa68c }}},
+ { 0xa68f, {1, {0xa68e }}},
+ { 0xa691, {1, {0xa690 }}},
+ { 0xa693, {1, {0xa692 }}},
+ { 0xa695, {1, {0xa694 }}},
+ { 0xa697, {1, {0xa696 }}},
+ { 0xa723, {1, {0xa722 }}},
+ { 0xa725, {1, {0xa724 }}},
+ { 0xa727, {1, {0xa726 }}},
+ { 0xa729, {1, {0xa728 }}},
+ { 0xa72b, {1, {0xa72a }}},
+ { 0xa72d, {1, {0xa72c }}},
+ { 0xa72f, {1, {0xa72e }}},
+ { 0xa733, {1, {0xa732 }}},
+ { 0xa735, {1, {0xa734 }}},
+ { 0xa737, {1, {0xa736 }}},
+ { 0xa739, {1, {0xa738 }}},
+ { 0xa73b, {1, {0xa73a }}},
+ { 0xa73d, {1, {0xa73c }}},
+ { 0xa73f, {1, {0xa73e }}},
+ { 0xa741, {1, {0xa740 }}},
+ { 0xa743, {1, {0xa742 }}},
+ { 0xa745, {1, {0xa744 }}},
+ { 0xa747, {1, {0xa746 }}},
+ { 0xa749, {1, {0xa748 }}},
+ { 0xa74b, {1, {0xa74a }}},
+ { 0xa74d, {1, {0xa74c }}},
+ { 0xa74f, {1, {0xa74e }}},
+ { 0xa751, {1, {0xa750 }}},
+ { 0xa753, {1, {0xa752 }}},
+ { 0xa755, {1, {0xa754 }}},
+ { 0xa757, {1, {0xa756 }}},
+ { 0xa759, {1, {0xa758 }}},
+ { 0xa75b, {1, {0xa75a }}},
+ { 0xa75d, {1, {0xa75c }}},
+ { 0xa75f, {1, {0xa75e }}},
+ { 0xa761, {1, {0xa760 }}},
+ { 0xa763, {1, {0xa762 }}},
+ { 0xa765, {1, {0xa764 }}},
+ { 0xa767, {1, {0xa766 }}},
+ { 0xa769, {1, {0xa768 }}},
+ { 0xa76b, {1, {0xa76a }}},
+ { 0xa76d, {1, {0xa76c }}},
+ { 0xa76f, {1, {0xa76e }}},
+ { 0xa77a, {1, {0xa779 }}},
+ { 0xa77c, {1, {0xa77b }}},
+ { 0xa77f, {1, {0xa77e }}},
+ { 0xa781, {1, {0xa780 }}},
+ { 0xa783, {1, {0xa782 }}},
+ { 0xa785, {1, {0xa784 }}},
+ { 0xa787, {1, {0xa786 }}},
+ { 0xa78c, {1, {0xa78b }}},
+ { 0xa791, {1, {0xa790 }}},
+ { 0xa793, {1, {0xa792 }}},
+ { 0xa7a1, {1, {0xa7a0 }}},
+ { 0xa7a3, {1, {0xa7a2 }}},
+ { 0xa7a5, {1, {0xa7a4 }}},
+ { 0xa7a7, {1, {0xa7a6 }}},
+ { 0xa7a9, {1, {0xa7a8 }}},
+ { 0xff41, {1, {0xff21 }}},
+ { 0xff42, {1, {0xff22 }}},
+ { 0xff43, {1, {0xff23 }}},
+ { 0xff44, {1, {0xff24 }}},
+ { 0xff45, {1, {0xff25 }}},
+ { 0xff46, {1, {0xff26 }}},
+ { 0xff47, {1, {0xff27 }}},
+ { 0xff48, {1, {0xff28 }}},
+ { 0xff49, {1, {0xff29 }}},
+ { 0xff4a, {1, {0xff2a }}},
+ { 0xff4b, {1, {0xff2b }}},
+ { 0xff4c, {1, {0xff2c }}},
+ { 0xff4d, {1, {0xff2d }}},
+ { 0xff4e, {1, {0xff2e }}},
+ { 0xff4f, {1, {0xff2f }}},
+ { 0xff50, {1, {0xff30 }}},
+ { 0xff51, {1, {0xff31 }}},
+ { 0xff52, {1, {0xff32 }}},
+ { 0xff53, {1, {0xff33 }}},
+ { 0xff54, {1, {0xff34 }}},
+ { 0xff55, {1, {0xff35 }}},
+ { 0xff56, {1, {0xff36 }}},
+ { 0xff57, {1, {0xff37 }}},
+ { 0xff58, {1, {0xff38 }}},
+ { 0xff59, {1, {0xff39 }}},
+ { 0xff5a, {1, {0xff3a }}},
+ { 0x10428, {1, {0x10400 }}},
+ { 0x10429, {1, {0x10401 }}},
+ { 0x1042a, {1, {0x10402 }}},
+ { 0x1042b, {1, {0x10403 }}},
+ { 0x1042c, {1, {0x10404 }}},
+ { 0x1042d, {1, {0x10405 }}},
+ { 0x1042e, {1, {0x10406 }}},
+ { 0x1042f, {1, {0x10407 }}},
+ { 0x10430, {1, {0x10408 }}},
+ { 0x10431, {1, {0x10409 }}},
+ { 0x10432, {1, {0x1040a }}},
+ { 0x10433, {1, {0x1040b }}},
+ { 0x10434, {1, {0x1040c }}},
+ { 0x10435, {1, {0x1040d }}},
+ { 0x10436, {1, {0x1040e }}},
+ { 0x10437, {1, {0x1040f }}},
+ { 0x10438, {1, {0x10410 }}},
+ { 0x10439, {1, {0x10411 }}},
+ { 0x1043a, {1, {0x10412 }}},
+ { 0x1043b, {1, {0x10413 }}},
+ { 0x1043c, {1, {0x10414 }}},
+ { 0x1043d, {1, {0x10415 }}},
+ { 0x1043e, {1, {0x10416 }}},
+ { 0x1043f, {1, {0x10417 }}},
+ { 0x10440, {1, {0x10418 }}},
+ { 0x10441, {1, {0x10419 }}},
+ { 0x10442, {1, {0x1041a }}},
+ { 0x10443, {1, {0x1041b }}},
+ { 0x10444, {1, {0x1041c }}},
+ { 0x10445, {1, {0x1041d }}},
+ { 0x10446, {1, {0x1041e }}},
+ { 0x10447, {1, {0x1041f }}},
+ { 0x10448, {1, {0x10420 }}},
+ { 0x10449, {1, {0x10421 }}},
+ { 0x1044a, {1, {0x10422 }}},
+ { 0x1044b, {1, {0x10423 }}},
+ { 0x1044c, {1, {0x10424 }}},
+ { 0x1044d, {1, {0x10425 }}},
+ { 0x1044e, {1, {0x10426 }}},
+ { 0x1044f, {1, {0x10427 }}},
+};
+
+static const CaseUnfold_11_Type CaseUnfold_11_Locale[] = {
+ { 0x0069, {1, {0x0049 }}},
+};
+
+static const CaseUnfold_12_Type CaseUnfold_12[] = {
+ { {0x0061, 0x02be}, {1, {0x1e9a }}},
+ { {0x0066, 0x0066}, {1, {0xfb00 }}},
+ { {0x0066, 0x0069}, {1, {0xfb01 }}},
+ { {0x0066, 0x006c}, {1, {0xfb02 }}},
+ { {0x0068, 0x0331}, {1, {0x1e96 }}},
+ { {0x006a, 0x030c}, {1, {0x01f0 }}},
+ { {0x0073, 0x0073}, {2, {0x00df, 0x1e9e }}},
+ { {0x0073, 0x0074}, {2, {0xfb05, 0xfb06 }}},
+ { {0x0074, 0x0308}, {1, {0x1e97 }}},
+ { {0x0077, 0x030a}, {1, {0x1e98 }}},
+ { {0x0079, 0x030a}, {1, {0x1e99 }}},
+ { {0x02bc, 0x006e}, {1, {0x0149 }}},
+ { {0x03ac, 0x03b9}, {1, {0x1fb4 }}},
+ { {0x03ae, 0x03b9}, {1, {0x1fc4 }}},
+ { {0x03b1, 0x0342}, {1, {0x1fb6 }}},
+ { {0x03b1, 0x03b9}, {2, {0x1fb3, 0x1fbc }}},
+ { {0x03b7, 0x0342}, {1, {0x1fc6 }}},
+ { {0x03b7, 0x03b9}, {2, {0x1fc3, 0x1fcc }}},
+ { {0x03b9, 0x0342}, {1, {0x1fd6 }}},
+ { {0x03c1, 0x0313}, {1, {0x1fe4 }}},
+ { {0x03c5, 0x0313}, {1, {0x1f50 }}},
+ { {0x03c5, 0x0342}, {1, {0x1fe6 }}},
+ { {0x03c9, 0x0342}, {1, {0x1ff6 }}},
+ { {0x03c9, 0x03b9}, {2, {0x1ff3, 0x1ffc }}},
+ { {0x03ce, 0x03b9}, {1, {0x1ff4 }}},
+ { {0x0565, 0x0582}, {1, {0x0587 }}},
+ { {0x0574, 0x0565}, {1, {0xfb14 }}},
+ { {0x0574, 0x056b}, {1, {0xfb15 }}},
+ { {0x0574, 0x056d}, {1, {0xfb17 }}},
+ { {0x0574, 0x0576}, {1, {0xfb13 }}},
+ { {0x057e, 0x0576}, {1, {0xfb16 }}},
+ { {0x1f00, 0x03b9}, {2, {0x1f80, 0x1f88 }}},
+ { {0x1f01, 0x03b9}, {2, {0x1f81, 0x1f89 }}},
+ { {0x1f02, 0x03b9}, {2, {0x1f82, 0x1f8a }}},
+ { {0x1f03, 0x03b9}, {2, {0x1f83, 0x1f8b }}},
+ { {0x1f04, 0x03b9}, {2, {0x1f84, 0x1f8c }}},
+ { {0x1f05, 0x03b9}, {2, {0x1f85, 0x1f8d }}},
+ { {0x1f06, 0x03b9}, {2, {0x1f86, 0x1f8e }}},
+ { {0x1f07, 0x03b9}, {2, {0x1f87, 0x1f8f }}},
+ { {0x1f20, 0x03b9}, {2, {0x1f90, 0x1f98 }}},
+ { {0x1f21, 0x03b9}, {2, {0x1f91, 0x1f99 }}},
+ { {0x1f22, 0x03b9}, {2, {0x1f92, 0x1f9a }}},
+ { {0x1f23, 0x03b9}, {2, {0x1f93, 0x1f9b }}},
+ { {0x1f24, 0x03b9}, {2, {0x1f94, 0x1f9c }}},
+ { {0x1f25, 0x03b9}, {2, {0x1f95, 0x1f9d }}},
+ { {0x1f26, 0x03b9}, {2, {0x1f96, 0x1f9e }}},
+ { {0x1f27, 0x03b9}, {2, {0x1f97, 0x1f9f }}},
+ { {0x1f60, 0x03b9}, {2, {0x1fa0, 0x1fa8 }}},
+ { {0x1f61, 0x03b9}, {2, {0x1fa1, 0x1fa9 }}},
+ { {0x1f62, 0x03b9}, {2, {0x1fa2, 0x1faa }}},
+ { {0x1f63, 0x03b9}, {2, {0x1fa3, 0x1fab }}},
+ { {0x1f64, 0x03b9}, {2, {0x1fa4, 0x1fac }}},
+ { {0x1f65, 0x03b9}, {2, {0x1fa5, 0x1fad }}},
+ { {0x1f66, 0x03b9}, {2, {0x1fa6, 0x1fae }}},
+ { {0x1f67, 0x03b9}, {2, {0x1fa7, 0x1faf }}},
+ { {0x1f70, 0x03b9}, {1, {0x1fb2 }}},
+ { {0x1f74, 0x03b9}, {1, {0x1fc2 }}},
+ { {0x1f7c, 0x03b9}, {1, {0x1ff2 }}},
+};
+
+static const CaseUnfold_12_Type CaseUnfold_12_Locale[] = {
+ { {0x0069, 0x0307}, {1, {0x0130 }}},
+};
+
+static const CaseUnfold_13_Type CaseUnfold_13[] = {
+ { {0x0066, 0x0066, 0x0069}, {1, {0xfb03 }}},
+ { {0x0066, 0x0066, 0x006c}, {1, {0xfb04 }}},
+ { {0x03b1, 0x0342, 0x03b9}, {1, {0x1fb7 }}},
+ { {0x03b7, 0x0342, 0x03b9}, {1, {0x1fc7 }}},
+ { {0x03b9, 0x0308, 0x0300}, {1, {0x1fd2 }}},
+ { {0x03b9, 0x0308, 0x0301}, {2, {0x0390, 0x1fd3 }}},
+ { {0x03b9, 0x0308, 0x0342}, {1, {0x1fd7 }}},
+ { {0x03c5, 0x0308, 0x0300}, {1, {0x1fe2 }}},
+ { {0x03c5, 0x0308, 0x0301}, {2, {0x03b0, 0x1fe3 }}},
+ { {0x03c5, 0x0308, 0x0342}, {1, {0x1fe7 }}},
+ { {0x03c5, 0x0313, 0x0300}, {1, {0x1f52 }}},
+ { {0x03c5, 0x0313, 0x0301}, {1, {0x1f54 }}},
+ { {0x03c5, 0x0313, 0x0342}, {1, {0x1f56 }}},
+ { {0x03c9, 0x0342, 0x03b9}, {1, {0x1ff7 }}},
+};
+
+#define FOLD_TABLE_SIZE 1357
+#define UNFOLD1_TABLE_SIZE 1207
+#define UNFOLD2_TABLE_SIZE 88
+#define UNFOLD3_TABLE_SIZE 23
diff --git a/enc/unicode/name2ctype.h b/enc/unicode/name2ctype.h
index a45ea59a4b..2e80edf525 100644
--- a/enc/unicode/name2ctype.h
+++ b/enc/unicode/name2ctype.h
@@ -36,7 +36,4273 @@ error "gperf generated tables don't work with this execution character set. Plea
#define long size_t
-#ifdef USE_UNICODE_PROPERTIES
+/* 'NEWLINE': [[:NEWLINE:]] */
+static const OnigCodePoint CR_NEWLINE[] = {
+ 1,
+ 0x000a, 0x000a,
+}; /* CR_NEWLINE */
+
+/* 'Alpha': [[:Alpha:]] */
+static const OnigCodePoint CR_Alpha[] = {
+ 540,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0345, 0x0345,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05b0, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0657,
+ 0x0659, 0x065f,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06e1, 0x06e8,
+ 0x06ed, 0x06ef,
+ 0x06fa, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x073f,
+ 0x074d, 0x07b1,
+ 0x07ca, 0x07ea,
+ 0x07f4, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x0817,
+ 0x081a, 0x082c,
+ 0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08e9,
+ 0x08f0, 0x08fe,
+ 0x0900, 0x093b,
+ 0x093d, 0x094c,
+ 0x094e, 0x0950,
+ 0x0955, 0x0963,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bd, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09cc,
+ 0x09ce, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09f0, 0x09f1,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4c,
+ 0x0a51, 0x0a51,
+ 0x0a59, 0x0a5c,
+ 0x0a5e, 0x0a5e,
+ 0x0a70, 0x0a75,
+ 0x0a81, 0x0a83,
+ 0x0a85, 0x0a8d,
+ 0x0a8f, 0x0a91,
+ 0x0a93, 0x0aa8,
+ 0x0aaa, 0x0ab0,
+ 0x0ab2, 0x0ab3,
+ 0x0ab5, 0x0ab9,
+ 0x0abd, 0x0ac5,
+ 0x0ac7, 0x0ac9,
+ 0x0acb, 0x0acc,
+ 0x0ad0, 0x0ad0,
+ 0x0ae0, 0x0ae3,
+ 0x0b01, 0x0b03,
+ 0x0b05, 0x0b0c,
+ 0x0b0f, 0x0b10,
+ 0x0b13, 0x0b28,
+ 0x0b2a, 0x0b30,
+ 0x0b32, 0x0b33,
+ 0x0b35, 0x0b39,
+ 0x0b3d, 0x0b44,
+ 0x0b47, 0x0b48,
+ 0x0b4b, 0x0b4c,
+ 0x0b56, 0x0b57,
+ 0x0b5c, 0x0b5d,
+ 0x0b5f, 0x0b63,
+ 0x0b71, 0x0b71,
+ 0x0b82, 0x0b83,
+ 0x0b85, 0x0b8a,
+ 0x0b8e, 0x0b90,
+ 0x0b92, 0x0b95,
+ 0x0b99, 0x0b9a,
+ 0x0b9c, 0x0b9c,
+ 0x0b9e, 0x0b9f,
+ 0x0ba3, 0x0ba4,
+ 0x0ba8, 0x0baa,
+ 0x0bae, 0x0bb9,
+ 0x0bbe, 0x0bc2,
+ 0x0bc6, 0x0bc8,
+ 0x0bca, 0x0bcc,
+ 0x0bd0, 0x0bd0,
+ 0x0bd7, 0x0bd7,
+ 0x0c01, 0x0c03,
+ 0x0c05, 0x0c0c,
+ 0x0c0e, 0x0c10,
+ 0x0c12, 0x0c28,
+ 0x0c2a, 0x0c33,
+ 0x0c35, 0x0c39,
+ 0x0c3d, 0x0c44,
+ 0x0c46, 0x0c48,
+ 0x0c4a, 0x0c4c,
+ 0x0c55, 0x0c56,
+ 0x0c58, 0x0c59,
+ 0x0c60, 0x0c63,
+ 0x0c82, 0x0c83,
+ 0x0c85, 0x0c8c,
+ 0x0c8e, 0x0c90,
+ 0x0c92, 0x0ca8,
+ 0x0caa, 0x0cb3,
+ 0x0cb5, 0x0cb9,
+ 0x0cbd, 0x0cc4,
+ 0x0cc6, 0x0cc8,
+ 0x0cca, 0x0ccc,
+ 0x0cd5, 0x0cd6,
+ 0x0cde, 0x0cde,
+ 0x0ce0, 0x0ce3,
+ 0x0cf1, 0x0cf2,
+ 0x0d02, 0x0d03,
+ 0x0d05, 0x0d0c,
+ 0x0d0e, 0x0d10,
+ 0x0d12, 0x0d3a,
+ 0x0d3d, 0x0d44,
+ 0x0d46, 0x0d48,
+ 0x0d4a, 0x0d4c,
+ 0x0d4e, 0x0d4e,
+ 0x0d57, 0x0d57,
+ 0x0d60, 0x0d63,
+ 0x0d7a, 0x0d7f,
+ 0x0d82, 0x0d83,
+ 0x0d85, 0x0d96,
+ 0x0d9a, 0x0db1,
+ 0x0db3, 0x0dbb,
+ 0x0dbd, 0x0dbd,
+ 0x0dc0, 0x0dc6,
+ 0x0dcf, 0x0dd4,
+ 0x0dd6, 0x0dd6,
+ 0x0dd8, 0x0ddf,
+ 0x0df2, 0x0df3,
+ 0x0e01, 0x0e3a,
+ 0x0e40, 0x0e46,
+ 0x0e4d, 0x0e4d,
+ 0x0e81, 0x0e82,
+ 0x0e84, 0x0e84,
+ 0x0e87, 0x0e88,
+ 0x0e8a, 0x0e8a,
+ 0x0e8d, 0x0e8d,
+ 0x0e94, 0x0e97,
+ 0x0e99, 0x0e9f,
+ 0x0ea1, 0x0ea3,
+ 0x0ea5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ecd, 0x0ecd,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f00,
+ 0x0f40, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f81,
+ 0x0f88, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x1000, 0x1036,
+ 0x1038, 0x1038,
+ 0x103b, 0x103f,
+ 0x1050, 0x1062,
+ 0x1065, 0x1068,
+ 0x106e, 0x1086,
+ 0x108e, 0x108e,
+ 0x109c, 0x109d,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135f, 0x135f,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1713,
+ 0x1720, 0x1733,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17b3,
+ 0x17b6, 0x17c8,
+ 0x17d7, 0x17d7,
+ 0x17dc, 0x17dc,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x1938,
+ 0x1950, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x1a00, 0x1a1b,
+ 0x1a20, 0x1a5e,
+ 0x1a61, 0x1a74,
+ 0x1aa7, 0x1aa7,
+ 0x1b00, 0x1b33,
+ 0x1b35, 0x1b43,
+ 0x1b45, 0x1b4b,
+ 0x1b80, 0x1ba9,
+ 0x1bac, 0x1baf,
+ 0x1bba, 0x1be5,
+ 0x1be7, 0x1bf1,
+ 0x1c00, 0x1c35,
+ 0x1c4d, 0x1c4f,
+ 0x1c5a, 0x1c7d,
+ 0x1ce9, 0x1cec,
+ 0x1cee, 0x1cf3,
+ 0x1cf5, 0x1cf6,
+ 0x1d00, 0x1dbf,
+ 0x1e00, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fbc,
+ 0x1fbe, 0x1fbe,
+ 0x1fc2, 0x1fc4,
+ 0x1fc6, 0x1fcc,
+ 0x1fd0, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fe0, 0x1fec,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffc,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210a, 0x2113,
+ 0x2115, 0x2115,
+ 0x2119, 0x211d,
+ 0x2124, 0x2124,
+ 0x2126, 0x2126,
+ 0x2128, 0x2128,
+ 0x212a, 0x212d,
+ 0x212f, 0x2139,
+ 0x213c, 0x213f,
+ 0x2145, 0x2149,
+ 0x214e, 0x214e,
+ 0x2160, 0x2188,
+ 0x24b6, 0x24e9,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2ce4,
+ 0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
+ 0x2d6f, 0x2d6f,
+ 0x2d80, 0x2d96,
+ 0x2da0, 0x2da6,
+ 0x2da8, 0x2dae,
+ 0x2db0, 0x2db6,
+ 0x2db8, 0x2dbe,
+ 0x2dc0, 0x2dc6,
+ 0x2dc8, 0x2dce,
+ 0x2dd0, 0x2dd6,
+ 0x2dd8, 0x2dde,
+ 0x2de0, 0x2dff,
+ 0x2e2f, 0x2e2f,
+ 0x3005, 0x3007,
+ 0x3021, 0x3029,
+ 0x3031, 0x3035,
+ 0x3038, 0x303c,
+ 0x3041, 0x3096,
+ 0x309d, 0x309f,
+ 0x30a1, 0x30fa,
+ 0x30fc, 0x30ff,
+ 0x3105, 0x312d,
+ 0x3131, 0x318e,
+ 0x31a0, 0x31ba,
+ 0x31f0, 0x31ff,
+ 0x3400, 0x4db5,
+ 0x4e00, 0x9fcc,
+ 0xa000, 0xa48c,
+ 0xa4d0, 0xa4fd,
+ 0xa500, 0xa60c,
+ 0xa610, 0xa61f,
+ 0xa62a, 0xa62b,
+ 0xa640, 0xa66e,
+ 0xa674, 0xa67b,
+ 0xa67f, 0xa697,
+ 0xa69f, 0xa6ef,
+ 0xa717, 0xa71f,
+ 0xa722, 0xa788,
+ 0xa78b, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa801,
+ 0xa803, 0xa805,
+ 0xa807, 0xa80a,
+ 0xa80c, 0xa827,
+ 0xa840, 0xa873,
+ 0xa880, 0xa8c3,
+ 0xa8f2, 0xa8f7,
+ 0xa8fb, 0xa8fb,
+ 0xa90a, 0xa92a,
+ 0xa930, 0xa952,
+ 0xa960, 0xa97c,
+ 0xa980, 0xa9b2,
+ 0xa9b4, 0xa9bf,
+ 0xa9cf, 0xa9cf,
+ 0xaa00, 0xaa36,
+ 0xaa40, 0xaa4d,
+ 0xaa60, 0xaa76,
+ 0xaa7a, 0xaa7a,
+ 0xaa80, 0xaabe,
+ 0xaac0, 0xaac0,
+ 0xaac2, 0xaac2,
+ 0xaadb, 0xaadd,
+ 0xaae0, 0xaaef,
+ 0xaaf2, 0xaaf5,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabea,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb28,
+ 0xfb2a, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11045,
+ 0x11082, 0x110b8,
+ 0x110d0, 0x110e8,
+ 0x11100, 0x11132,
+ 0x11180, 0x111bf,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116b5,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f93, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Alpha */
+
+/* 'Blank': [[:Blank:]] */
+static const OnigCodePoint CR_Blank[] = {
+ 9,
+ 0x0009, 0x0009,
+ 0x0020, 0x0020,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x180e, 0x180e,
+ 0x2000, 0x200a,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Blank */
+
+/* 'Cntrl': [[:Cntrl:]] */
+static const OnigCodePoint CR_Cntrl[] = {
+ 2,
+ 0x0000, 0x001f,
+ 0x007f, 0x009f,
+}; /* CR_Cntrl */
+
+/* 'Digit': [[:Digit:]] */
+static const OnigCodePoint CR_Digit[] = {
+ 42,
+ 0x0030, 0x0039,
+ 0x0660, 0x0669,
+ 0x06f0, 0x06f9,
+ 0x07c0, 0x07c9,
+ 0x0966, 0x096f,
+ 0x09e6, 0x09ef,
+ 0x0a66, 0x0a6f,
+ 0x0ae6, 0x0aef,
+ 0x0b66, 0x0b6f,
+ 0x0be6, 0x0bef,
+ 0x0c66, 0x0c6f,
+ 0x0ce6, 0x0cef,
+ 0x0d66, 0x0d6f,
+ 0x0e50, 0x0e59,
+ 0x0ed0, 0x0ed9,
+ 0x0f20, 0x0f29,
+ 0x1040, 0x1049,
+ 0x1090, 0x1099,
+ 0x17e0, 0x17e9,
+ 0x1810, 0x1819,
+ 0x1946, 0x194f,
+ 0x19d0, 0x19d9,
+ 0x1a80, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1b50, 0x1b59,
+ 0x1bb0, 0x1bb9,
+ 0x1c40, 0x1c49,
+ 0x1c50, 0x1c59,
+ 0xa620, 0xa629,
+ 0xa8d0, 0xa8d9,
+ 0xa900, 0xa909,
+ 0xa9d0, 0xa9d9,
+ 0xaa50, 0xaa59,
+ 0xabf0, 0xabf9,
+ 0xff10, 0xff19,
+ 0x104a0, 0x104a9,
+ 0x11066, 0x1106f,
+ 0x110f0, 0x110f9,
+ 0x11136, 0x1113f,
+ 0x111d0, 0x111d9,
+ 0x116c0, 0x116c9,
+ 0x1d7ce, 0x1d7ff,
+}; /* CR_Digit */
+
+/* 'Graph': [[:Graph:]] */
+static const OnigCodePoint CR_Graph[] = {
+ 544,
+ 0x0021, 0x007e,
+ 0x00a1, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x058f, 0x058f,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0604,
+ 0x0606, 0x061b,
+ 0x061e, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09fb,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3c, 0x0a3c,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4d,
+ 0x0a51, 0x0a51,
+ 0x0a59, 0x0a5c,
+ 0x0a5e, 0x0a5e,
+ 0x0a66, 0x0a75,
+ 0x0a81, 0x0a83,
+ 0x0a85, 0x0a8d,
+ 0x0a8f, 0x0a91,
+ 0x0a93, 0x0aa8,
+ 0x0aaa, 0x0ab0,
+ 0x0ab2, 0x0ab3,
+ 0x0ab5, 0x0ab9,
+ 0x0abc, 0x0ac5,
+ 0x0ac7, 0x0ac9,
+ 0x0acb, 0x0acd,
+ 0x0ad0, 0x0ad0,
+ 0x0ae0, 0x0ae3,
+ 0x0ae6, 0x0af1,
+ 0x0b01, 0x0b03,
+ 0x0b05, 0x0b0c,
+ 0x0b0f, 0x0b10,
+ 0x0b13, 0x0b28,
+ 0x0b2a, 0x0b30,
+ 0x0b32, 0x0b33,
+ 0x0b35, 0x0b39,
+ 0x0b3c, 0x0b44,
+ 0x0b47, 0x0b48,
+ 0x0b4b, 0x0b4d,
+ 0x0b56, 0x0b57,
+ 0x0b5c, 0x0b5d,
+ 0x0b5f, 0x0b63,
+ 0x0b66, 0x0b77,
+ 0x0b82, 0x0b83,
+ 0x0b85, 0x0b8a,
+ 0x0b8e, 0x0b90,
+ 0x0b92, 0x0b95,
+ 0x0b99, 0x0b9a,
+ 0x0b9c, 0x0b9c,
+ 0x0b9e, 0x0b9f,
+ 0x0ba3, 0x0ba4,
+ 0x0ba8, 0x0baa,
+ 0x0bae, 0x0bb9,
+ 0x0bbe, 0x0bc2,
+ 0x0bc6, 0x0bc8,
+ 0x0bca, 0x0bcd,
+ 0x0bd0, 0x0bd0,
+ 0x0bd7, 0x0bd7,
+ 0x0be6, 0x0bfa,
+ 0x0c01, 0x0c03,
+ 0x0c05, 0x0c0c,
+ 0x0c0e, 0x0c10,
+ 0x0c12, 0x0c28,
+ 0x0c2a, 0x0c33,
+ 0x0c35, 0x0c39,
+ 0x0c3d, 0x0c44,
+ 0x0c46, 0x0c48,
+ 0x0c4a, 0x0c4d,
+ 0x0c55, 0x0c56,
+ 0x0c58, 0x0c59,
+ 0x0c60, 0x0c63,
+ 0x0c66, 0x0c6f,
+ 0x0c78, 0x0c7f,
+ 0x0c82, 0x0c83,
+ 0x0c85, 0x0c8c,
+ 0x0c8e, 0x0c90,
+ 0x0c92, 0x0ca8,
+ 0x0caa, 0x0cb3,
+ 0x0cb5, 0x0cb9,
+ 0x0cbc, 0x0cc4,
+ 0x0cc6, 0x0cc8,
+ 0x0cca, 0x0ccd,
+ 0x0cd5, 0x0cd6,
+ 0x0cde, 0x0cde,
+ 0x0ce0, 0x0ce3,
+ 0x0ce6, 0x0cef,
+ 0x0cf1, 0x0cf2,
+ 0x0d02, 0x0d03,
+ 0x0d05, 0x0d0c,
+ 0x0d0e, 0x0d10,
+ 0x0d12, 0x0d3a,
+ 0x0d3d, 0x0d44,
+ 0x0d46, 0x0d48,
+ 0x0d4a, 0x0d4e,
+ 0x0d57, 0x0d57,
+ 0x0d60, 0x0d63,
+ 0x0d66, 0x0d75,
+ 0x0d79, 0x0d7f,
+ 0x0d82, 0x0d83,
+ 0x0d85, 0x0d96,
+ 0x0d9a, 0x0db1,
+ 0x0db3, 0x0dbb,
+ 0x0dbd, 0x0dbd,
+ 0x0dc0, 0x0dc6,
+ 0x0dca, 0x0dca,
+ 0x0dcf, 0x0dd4,
+ 0x0dd6, 0x0dd6,
+ 0x0dd8, 0x0ddf,
+ 0x0df2, 0x0df4,
+ 0x0e01, 0x0e3a,
+ 0x0e3f, 0x0e5b,
+ 0x0e81, 0x0e82,
+ 0x0e84, 0x0e84,
+ 0x0e87, 0x0e88,
+ 0x0e8a, 0x0e8a,
+ 0x0e8d, 0x0e8d,
+ 0x0e94, 0x0e97,
+ 0x0e99, 0x0e9f,
+ 0x0ea1, 0x0ea3,
+ 0x0ea5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ec8, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fbe, 0x0fcc,
+ 0x0fce, 0x0fda,
+ 0x1000, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135d, 0x137c,
+ 0x1380, 0x1399,
+ 0x13a0, 0x13f4,
+ 0x1400, 0x167f,
+ 0x1681, 0x169c,
+ 0x16a0, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+ 0x1720, 0x1736,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17dd,
+ 0x17e0, 0x17e9,
+ 0x17f0, 0x17f9,
+ 0x1800, 0x180d,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1940, 0x1940,
+ 0x1944, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19da,
+ 0x19de, 0x1a1b,
+ 0x1a1e, 0x1a5e,
+ 0x1a60, 0x1a7c,
+ 0x1a7f, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa0, 0x1aad,
+ 0x1b00, 0x1b4b,
+ 0x1b50, 0x1b7c,
+ 0x1b80, 0x1bf3,
+ 0x1bfc, 0x1c37,
+ 0x1c3b, 0x1c49,
+ 0x1c4d, 0x1c7f,
+ 0x1cc0, 0x1cc7,
+ 0x1cd0, 0x1cf6,
+ 0x1d00, 0x1de6,
+ 0x1dfc, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fc4,
+ 0x1fc6, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fdd, 0x1fef,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffe,
+ 0x200b, 0x2027,
+ 0x202a, 0x202e,
+ 0x2030, 0x205e,
+ 0x2060, 0x2064,
+ 0x206a, 0x2071,
+ 0x2074, 0x208e,
+ 0x2090, 0x209c,
+ 0x20a0, 0x20b9,
+ 0x20d0, 0x20f0,
+ 0x2100, 0x2189,
+ 0x2190, 0x23f3,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x2460, 0x26ff,
+ 0x2701, 0x2b4c,
+ 0x2b50, 0x2b59,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2cf3,
+ 0x2cf9, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
+ 0x2d6f, 0x2d70,
+ 0x2d7f, 0x2d96,
+ 0x2da0, 0x2da6,
+ 0x2da8, 0x2dae,
+ 0x2db0, 0x2db6,
+ 0x2db8, 0x2dbe,
+ 0x2dc0, 0x2dc6,
+ 0x2dc8, 0x2dce,
+ 0x2dd0, 0x2dd6,
+ 0x2dd8, 0x2dde,
+ 0x2de0, 0x2e3b,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+ 0x2ff0, 0x2ffb,
+ 0x3001, 0x303f,
+ 0x3041, 0x3096,
+ 0x3099, 0x30ff,
+ 0x3105, 0x312d,
+ 0x3131, 0x318e,
+ 0x3190, 0x31ba,
+ 0x31c0, 0x31e3,
+ 0x31f0, 0x321e,
+ 0x3220, 0x32fe,
+ 0x3300, 0x4db5,
+ 0x4dc0, 0x9fcc,
+ 0xa000, 0xa48c,
+ 0xa490, 0xa4c6,
+ 0xa4d0, 0xa62b,
+ 0xa640, 0xa697,
+ 0xa69f, 0xa6f7,
+ 0xa700, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa82b,
+ 0xa830, 0xa839,
+ 0xa840, 0xa877,
+ 0xa880, 0xa8c4,
+ 0xa8ce, 0xa8d9,
+ 0xa8e0, 0xa8fb,
+ 0xa900, 0xa953,
+ 0xa95f, 0xa97c,
+ 0xa980, 0xa9cd,
+ 0xa9cf, 0xa9d9,
+ 0xa9de, 0xa9df,
+ 0xaa00, 0xaa36,
+ 0xaa40, 0xaa4d,
+ 0xaa50, 0xaa59,
+ 0xaa5c, 0xaa7b,
+ 0xaa80, 0xaac2,
+ 0xaadb, 0xaaf6,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabed,
+ 0xabf0, 0xabf9,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xe000, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbc1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfd,
+ 0xfe00, 0xfe19,
+ 0xfe20, 0xfe26,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xfeff, 0xfeff,
+ 0xff01, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfff9, 0xfffd,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1018a,
+ 0x10190, 0x1019b,
+ 0x101d0, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x103c3,
+ 0x103c8, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10857, 0x1085f,
+ 0x10900, 0x1091b,
+ 0x1091f, 0x10939,
+ 0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x10a60, 0x10a7f,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b7f,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x11080, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d1dd,
+ 0x1d200, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1d360, 0x1d371,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
+ 0x1f000, 0x1f02b,
+ 0x1f030, 0x1f093,
+ 0x1f0a0, 0x1f0ae,
+ 0x1f0b1, 0x1f0be,
+ 0x1f0c1, 0x1f0cf,
+ 0x1f0d1, 0x1f0df,
+ 0x1f100, 0x1f10a,
+ 0x1f110, 0x1f12e,
+ 0x1f130, 0x1f16b,
+ 0x1f170, 0x1f19a,
+ 0x1f1e6, 0x1f202,
+ 0x1f210, 0x1f23a,
+ 0x1f240, 0x1f248,
+ 0x1f250, 0x1f251,
+ 0x1f300, 0x1f320,
+ 0x1f330, 0x1f335,
+ 0x1f337, 0x1f37c,
+ 0x1f380, 0x1f393,
+ 0x1f3a0, 0x1f3c4,
+ 0x1f3c6, 0x1f3ca,
+ 0x1f3e0, 0x1f3f0,
+ 0x1f400, 0x1f43e,
+ 0x1f440, 0x1f440,
+ 0x1f442, 0x1f4f7,
+ 0x1f4f9, 0x1f4fc,
+ 0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
+ 0x1f550, 0x1f567,
+ 0x1f5fb, 0x1f640,
+ 0x1f645, 0x1f64f,
+ 0x1f680, 0x1f6c5,
+ 0x1f700, 0x1f773,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+ 0xf0000, 0xffffd,
+ 0x100000, 0x10fffd,
+}; /* CR_Graph */
+
+/* 'Lower': [[:Lower:]] */
+static const OnigCodePoint CR_Lower[] = {
+ 618,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00df, 0x00f6,
+ 0x00f8, 0x00ff,
+ 0x0101, 0x0101,
+ 0x0103, 0x0103,
+ 0x0105, 0x0105,
+ 0x0107, 0x0107,
+ 0x0109, 0x0109,
+ 0x010b, 0x010b,
+ 0x010d, 0x010d,
+ 0x010f, 0x010f,
+ 0x0111, 0x0111,
+ 0x0113, 0x0113,
+ 0x0115, 0x0115,
+ 0x0117, 0x0117,
+ 0x0119, 0x0119,
+ 0x011b, 0x011b,
+ 0x011d, 0x011d,
+ 0x011f, 0x011f,
+ 0x0121, 0x0121,
+ 0x0123, 0x0123,
+ 0x0125, 0x0125,
+ 0x0127, 0x0127,
+ 0x0129, 0x0129,
+ 0x012b, 0x012b,
+ 0x012d, 0x012d,
+ 0x012f, 0x012f,
+ 0x0131, 0x0131,
+ 0x0133, 0x0133,
+ 0x0135, 0x0135,
+ 0x0137, 0x0138,
+ 0x013a, 0x013a,
+ 0x013c, 0x013c,
+ 0x013e, 0x013e,
+ 0x0140, 0x0140,
+ 0x0142, 0x0142,
+ 0x0144, 0x0144,
+ 0x0146, 0x0146,
+ 0x0148, 0x0149,
+ 0x014b, 0x014b,
+ 0x014d, 0x014d,
+ 0x014f, 0x014f,
+ 0x0151, 0x0151,
+ 0x0153, 0x0153,
+ 0x0155, 0x0155,
+ 0x0157, 0x0157,
+ 0x0159, 0x0159,
+ 0x015b, 0x015b,
+ 0x015d, 0x015d,
+ 0x015f, 0x015f,
+ 0x0161, 0x0161,
+ 0x0163, 0x0163,
+ 0x0165, 0x0165,
+ 0x0167, 0x0167,
+ 0x0169, 0x0169,
+ 0x016b, 0x016b,
+ 0x016d, 0x016d,
+ 0x016f, 0x016f,
+ 0x0171, 0x0171,
+ 0x0173, 0x0173,
+ 0x0175, 0x0175,
+ 0x0177, 0x0177,
+ 0x017a, 0x017a,
+ 0x017c, 0x017c,
+ 0x017e, 0x0180,
+ 0x0183, 0x0183,
+ 0x0185, 0x0185,
+ 0x0188, 0x0188,
+ 0x018c, 0x018d,
+ 0x0192, 0x0192,
+ 0x0195, 0x0195,
+ 0x0199, 0x019b,
+ 0x019e, 0x019e,
+ 0x01a1, 0x01a1,
+ 0x01a3, 0x01a3,
+ 0x01a5, 0x01a5,
+ 0x01a8, 0x01a8,
+ 0x01aa, 0x01ab,
+ 0x01ad, 0x01ad,
+ 0x01b0, 0x01b0,
+ 0x01b4, 0x01b4,
+ 0x01b6, 0x01b6,
+ 0x01b9, 0x01ba,
+ 0x01bd, 0x01bf,
+ 0x01c6, 0x01c6,
+ 0x01c9, 0x01c9,
+ 0x01cc, 0x01cc,
+ 0x01ce, 0x01ce,
+ 0x01d0, 0x01d0,
+ 0x01d2, 0x01d2,
+ 0x01d4, 0x01d4,
+ 0x01d6, 0x01d6,
+ 0x01d8, 0x01d8,
+ 0x01da, 0x01da,
+ 0x01dc, 0x01dd,
+ 0x01df, 0x01df,
+ 0x01e1, 0x01e1,
+ 0x01e3, 0x01e3,
+ 0x01e5, 0x01e5,
+ 0x01e7, 0x01e7,
+ 0x01e9, 0x01e9,
+ 0x01eb, 0x01eb,
+ 0x01ed, 0x01ed,
+ 0x01ef, 0x01f0,
+ 0x01f3, 0x01f3,
+ 0x01f5, 0x01f5,
+ 0x01f9, 0x01f9,
+ 0x01fb, 0x01fb,
+ 0x01fd, 0x01fd,
+ 0x01ff, 0x01ff,
+ 0x0201, 0x0201,
+ 0x0203, 0x0203,
+ 0x0205, 0x0205,
+ 0x0207, 0x0207,
+ 0x0209, 0x0209,
+ 0x020b, 0x020b,
+ 0x020d, 0x020d,
+ 0x020f, 0x020f,
+ 0x0211, 0x0211,
+ 0x0213, 0x0213,
+ 0x0215, 0x0215,
+ 0x0217, 0x0217,
+ 0x0219, 0x0219,
+ 0x021b, 0x021b,
+ 0x021d, 0x021d,
+ 0x021f, 0x021f,
+ 0x0221, 0x0221,
+ 0x0223, 0x0223,
+ 0x0225, 0x0225,
+ 0x0227, 0x0227,
+ 0x0229, 0x0229,
+ 0x022b, 0x022b,
+ 0x022d, 0x022d,
+ 0x022f, 0x022f,
+ 0x0231, 0x0231,
+ 0x0233, 0x0239,
+ 0x023c, 0x023c,
+ 0x023f, 0x0240,
+ 0x0242, 0x0242,
+ 0x0247, 0x0247,
+ 0x0249, 0x0249,
+ 0x024b, 0x024b,
+ 0x024d, 0x024d,
+ 0x024f, 0x0293,
+ 0x0295, 0x02b8,
+ 0x02c0, 0x02c1,
+ 0x02e0, 0x02e4,
+ 0x0345, 0x0345,
+ 0x0371, 0x0371,
+ 0x0373, 0x0373,
+ 0x0377, 0x0377,
+ 0x037a, 0x037d,
+ 0x0390, 0x0390,
+ 0x03ac, 0x03ce,
+ 0x03d0, 0x03d1,
+ 0x03d5, 0x03d7,
+ 0x03d9, 0x03d9,
+ 0x03db, 0x03db,
+ 0x03dd, 0x03dd,
+ 0x03df, 0x03df,
+ 0x03e1, 0x03e1,
+ 0x03e3, 0x03e3,
+ 0x03e5, 0x03e5,
+ 0x03e7, 0x03e7,
+ 0x03e9, 0x03e9,
+ 0x03eb, 0x03eb,
+ 0x03ed, 0x03ed,
+ 0x03ef, 0x03f3,
+ 0x03f5, 0x03f5,
+ 0x03f8, 0x03f8,
+ 0x03fb, 0x03fc,
+ 0x0430, 0x045f,
+ 0x0461, 0x0461,
+ 0x0463, 0x0463,
+ 0x0465, 0x0465,
+ 0x0467, 0x0467,
+ 0x0469, 0x0469,
+ 0x046b, 0x046b,
+ 0x046d, 0x046d,
+ 0x046f, 0x046f,
+ 0x0471, 0x0471,
+ 0x0473, 0x0473,
+ 0x0475, 0x0475,
+ 0x0477, 0x0477,
+ 0x0479, 0x0479,
+ 0x047b, 0x047b,
+ 0x047d, 0x047d,
+ 0x047f, 0x047f,
+ 0x0481, 0x0481,
+ 0x048b, 0x048b,
+ 0x048d, 0x048d,
+ 0x048f, 0x048f,
+ 0x0491, 0x0491,
+ 0x0493, 0x0493,
+ 0x0495, 0x0495,
+ 0x0497, 0x0497,
+ 0x0499, 0x0499,
+ 0x049b, 0x049b,
+ 0x049d, 0x049d,
+ 0x049f, 0x049f,
+ 0x04a1, 0x04a1,
+ 0x04a3, 0x04a3,
+ 0x04a5, 0x04a5,
+ 0x04a7, 0x04a7,
+ 0x04a9, 0x04a9,
+ 0x04ab, 0x04ab,
+ 0x04ad, 0x04ad,
+ 0x04af, 0x04af,
+ 0x04b1, 0x04b1,
+ 0x04b3, 0x04b3,
+ 0x04b5, 0x04b5,
+ 0x04b7, 0x04b7,
+ 0x04b9, 0x04b9,
+ 0x04bb, 0x04bb,
+ 0x04bd, 0x04bd,
+ 0x04bf, 0x04bf,
+ 0x04c2, 0x04c2,
+ 0x04c4, 0x04c4,
+ 0x04c6, 0x04c6,
+ 0x04c8, 0x04c8,
+ 0x04ca, 0x04ca,
+ 0x04cc, 0x04cc,
+ 0x04ce, 0x04cf,
+ 0x04d1, 0x04d1,
+ 0x04d3, 0x04d3,
+ 0x04d5, 0x04d5,
+ 0x04d7, 0x04d7,
+ 0x04d9, 0x04d9,
+ 0x04db, 0x04db,
+ 0x04dd, 0x04dd,
+ 0x04df, 0x04df,
+ 0x04e1, 0x04e1,
+ 0x04e3, 0x04e3,
+ 0x04e5, 0x04e5,
+ 0x04e7, 0x04e7,
+ 0x04e9, 0x04e9,
+ 0x04eb, 0x04eb,
+ 0x04ed, 0x04ed,
+ 0x04ef, 0x04ef,
+ 0x04f1, 0x04f1,
+ 0x04f3, 0x04f3,
+ 0x04f5, 0x04f5,
+ 0x04f7, 0x04f7,
+ 0x04f9, 0x04f9,
+ 0x04fb, 0x04fb,
+ 0x04fd, 0x04fd,
+ 0x04ff, 0x04ff,
+ 0x0501, 0x0501,
+ 0x0503, 0x0503,
+ 0x0505, 0x0505,
+ 0x0507, 0x0507,
+ 0x0509, 0x0509,
+ 0x050b, 0x050b,
+ 0x050d, 0x050d,
+ 0x050f, 0x050f,
+ 0x0511, 0x0511,
+ 0x0513, 0x0513,
+ 0x0515, 0x0515,
+ 0x0517, 0x0517,
+ 0x0519, 0x0519,
+ 0x051b, 0x051b,
+ 0x051d, 0x051d,
+ 0x051f, 0x051f,
+ 0x0521, 0x0521,
+ 0x0523, 0x0523,
+ 0x0525, 0x0525,
+ 0x0527, 0x0527,
+ 0x0561, 0x0587,
+ 0x1d00, 0x1dbf,
+ 0x1e01, 0x1e01,
+ 0x1e03, 0x1e03,
+ 0x1e05, 0x1e05,
+ 0x1e07, 0x1e07,
+ 0x1e09, 0x1e09,
+ 0x1e0b, 0x1e0b,
+ 0x1e0d, 0x1e0d,
+ 0x1e0f, 0x1e0f,
+ 0x1e11, 0x1e11,
+ 0x1e13, 0x1e13,
+ 0x1e15, 0x1e15,
+ 0x1e17, 0x1e17,
+ 0x1e19, 0x1e19,
+ 0x1e1b, 0x1e1b,
+ 0x1e1d, 0x1e1d,
+ 0x1e1f, 0x1e1f,
+ 0x1e21, 0x1e21,
+ 0x1e23, 0x1e23,
+ 0x1e25, 0x1e25,
+ 0x1e27, 0x1e27,
+ 0x1e29, 0x1e29,
+ 0x1e2b, 0x1e2b,
+ 0x1e2d, 0x1e2d,
+ 0x1e2f, 0x1e2f,
+ 0x1e31, 0x1e31,
+ 0x1e33, 0x1e33,
+ 0x1e35, 0x1e35,
+ 0x1e37, 0x1e37,
+ 0x1e39, 0x1e39,
+ 0x1e3b, 0x1e3b,
+ 0x1e3d, 0x1e3d,
+ 0x1e3f, 0x1e3f,
+ 0x1e41, 0x1e41,
+ 0x1e43, 0x1e43,
+ 0x1e45, 0x1e45,
+ 0x1e47, 0x1e47,
+ 0x1e49, 0x1e49,
+ 0x1e4b, 0x1e4b,
+ 0x1e4d, 0x1e4d,
+ 0x1e4f, 0x1e4f,
+ 0x1e51, 0x1e51,
+ 0x1e53, 0x1e53,
+ 0x1e55, 0x1e55,
+ 0x1e57, 0x1e57,
+ 0x1e59, 0x1e59,
+ 0x1e5b, 0x1e5b,
+ 0x1e5d, 0x1e5d,
+ 0x1e5f, 0x1e5f,
+ 0x1e61, 0x1e61,
+ 0x1e63, 0x1e63,
+ 0x1e65, 0x1e65,
+ 0x1e67, 0x1e67,
+ 0x1e69, 0x1e69,
+ 0x1e6b, 0x1e6b,
+ 0x1e6d, 0x1e6d,
+ 0x1e6f, 0x1e6f,
+ 0x1e71, 0x1e71,
+ 0x1e73, 0x1e73,
+ 0x1e75, 0x1e75,
+ 0x1e77, 0x1e77,
+ 0x1e79, 0x1e79,
+ 0x1e7b, 0x1e7b,
+ 0x1e7d, 0x1e7d,
+ 0x1e7f, 0x1e7f,
+ 0x1e81, 0x1e81,
+ 0x1e83, 0x1e83,
+ 0x1e85, 0x1e85,
+ 0x1e87, 0x1e87,
+ 0x1e89, 0x1e89,
+ 0x1e8b, 0x1e8b,
+ 0x1e8d, 0x1e8d,
+ 0x1e8f, 0x1e8f,
+ 0x1e91, 0x1e91,
+ 0x1e93, 0x1e93,
+ 0x1e95, 0x1e9d,
+ 0x1e9f, 0x1e9f,
+ 0x1ea1, 0x1ea1,
+ 0x1ea3, 0x1ea3,
+ 0x1ea5, 0x1ea5,
+ 0x1ea7, 0x1ea7,
+ 0x1ea9, 0x1ea9,
+ 0x1eab, 0x1eab,
+ 0x1ead, 0x1ead,
+ 0x1eaf, 0x1eaf,
+ 0x1eb1, 0x1eb1,
+ 0x1eb3, 0x1eb3,
+ 0x1eb5, 0x1eb5,
+ 0x1eb7, 0x1eb7,
+ 0x1eb9, 0x1eb9,
+ 0x1ebb, 0x1ebb,
+ 0x1ebd, 0x1ebd,
+ 0x1ebf, 0x1ebf,
+ 0x1ec1, 0x1ec1,
+ 0x1ec3, 0x1ec3,
+ 0x1ec5, 0x1ec5,
+ 0x1ec7, 0x1ec7,
+ 0x1ec9, 0x1ec9,
+ 0x1ecb, 0x1ecb,
+ 0x1ecd, 0x1ecd,
+ 0x1ecf, 0x1ecf,
+ 0x1ed1, 0x1ed1,
+ 0x1ed3, 0x1ed3,
+ 0x1ed5, 0x1ed5,
+ 0x1ed7, 0x1ed7,
+ 0x1ed9, 0x1ed9,
+ 0x1edb, 0x1edb,
+ 0x1edd, 0x1edd,
+ 0x1edf, 0x1edf,
+ 0x1ee1, 0x1ee1,
+ 0x1ee3, 0x1ee3,
+ 0x1ee5, 0x1ee5,
+ 0x1ee7, 0x1ee7,
+ 0x1ee9, 0x1ee9,
+ 0x1eeb, 0x1eeb,
+ 0x1eed, 0x1eed,
+ 0x1eef, 0x1eef,
+ 0x1ef1, 0x1ef1,
+ 0x1ef3, 0x1ef3,
+ 0x1ef5, 0x1ef5,
+ 0x1ef7, 0x1ef7,
+ 0x1ef9, 0x1ef9,
+ 0x1efb, 0x1efb,
+ 0x1efd, 0x1efd,
+ 0x1eff, 0x1f07,
+ 0x1f10, 0x1f15,
+ 0x1f20, 0x1f27,
+ 0x1f30, 0x1f37,
+ 0x1f40, 0x1f45,
+ 0x1f50, 0x1f57,
+ 0x1f60, 0x1f67,
+ 0x1f70, 0x1f7d,
+ 0x1f80, 0x1f87,
+ 0x1f90, 0x1f97,
+ 0x1fa0, 0x1fa7,
+ 0x1fb0, 0x1fb4,
+ 0x1fb6, 0x1fb7,
+ 0x1fbe, 0x1fbe,
+ 0x1fc2, 0x1fc4,
+ 0x1fc6, 0x1fc7,
+ 0x1fd0, 0x1fd3,
+ 0x1fd6, 0x1fd7,
+ 0x1fe0, 0x1fe7,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ff7,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x210a, 0x210a,
+ 0x210e, 0x210f,
+ 0x2113, 0x2113,
+ 0x212f, 0x212f,
+ 0x2134, 0x2134,
+ 0x2139, 0x2139,
+ 0x213c, 0x213d,
+ 0x2146, 0x2149,
+ 0x214e, 0x214e,
+ 0x2170, 0x217f,
+ 0x2184, 0x2184,
+ 0x24d0, 0x24e9,
+ 0x2c30, 0x2c5e,
+ 0x2c61, 0x2c61,
+ 0x2c65, 0x2c66,
+ 0x2c68, 0x2c68,
+ 0x2c6a, 0x2c6a,
+ 0x2c6c, 0x2c6c,
+ 0x2c71, 0x2c71,
+ 0x2c73, 0x2c74,
+ 0x2c76, 0x2c7d,
+ 0x2c81, 0x2c81,
+ 0x2c83, 0x2c83,
+ 0x2c85, 0x2c85,
+ 0x2c87, 0x2c87,
+ 0x2c89, 0x2c89,
+ 0x2c8b, 0x2c8b,
+ 0x2c8d, 0x2c8d,
+ 0x2c8f, 0x2c8f,
+ 0x2c91, 0x2c91,
+ 0x2c93, 0x2c93,
+ 0x2c95, 0x2c95,
+ 0x2c97, 0x2c97,
+ 0x2c99, 0x2c99,
+ 0x2c9b, 0x2c9b,
+ 0x2c9d, 0x2c9d,
+ 0x2c9f, 0x2c9f,
+ 0x2ca1, 0x2ca1,
+ 0x2ca3, 0x2ca3,
+ 0x2ca5, 0x2ca5,
+ 0x2ca7, 0x2ca7,
+ 0x2ca9, 0x2ca9,
+ 0x2cab, 0x2cab,
+ 0x2cad, 0x2cad,
+ 0x2caf, 0x2caf,
+ 0x2cb1, 0x2cb1,
+ 0x2cb3, 0x2cb3,
+ 0x2cb5, 0x2cb5,
+ 0x2cb7, 0x2cb7,
+ 0x2cb9, 0x2cb9,
+ 0x2cbb, 0x2cbb,
+ 0x2cbd, 0x2cbd,
+ 0x2cbf, 0x2cbf,
+ 0x2cc1, 0x2cc1,
+ 0x2cc3, 0x2cc3,
+ 0x2cc5, 0x2cc5,
+ 0x2cc7, 0x2cc7,
+ 0x2cc9, 0x2cc9,
+ 0x2ccb, 0x2ccb,
+ 0x2ccd, 0x2ccd,
+ 0x2ccf, 0x2ccf,
+ 0x2cd1, 0x2cd1,
+ 0x2cd3, 0x2cd3,
+ 0x2cd5, 0x2cd5,
+ 0x2cd7, 0x2cd7,
+ 0x2cd9, 0x2cd9,
+ 0x2cdb, 0x2cdb,
+ 0x2cdd, 0x2cdd,
+ 0x2cdf, 0x2cdf,
+ 0x2ce1, 0x2ce1,
+ 0x2ce3, 0x2ce4,
+ 0x2cec, 0x2cec,
+ 0x2cee, 0x2cee,
+ 0x2cf3, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0xa641, 0xa641,
+ 0xa643, 0xa643,
+ 0xa645, 0xa645,
+ 0xa647, 0xa647,
+ 0xa649, 0xa649,
+ 0xa64b, 0xa64b,
+ 0xa64d, 0xa64d,
+ 0xa64f, 0xa64f,
+ 0xa651, 0xa651,
+ 0xa653, 0xa653,
+ 0xa655, 0xa655,
+ 0xa657, 0xa657,
+ 0xa659, 0xa659,
+ 0xa65b, 0xa65b,
+ 0xa65d, 0xa65d,
+ 0xa65f, 0xa65f,
+ 0xa661, 0xa661,
+ 0xa663, 0xa663,
+ 0xa665, 0xa665,
+ 0xa667, 0xa667,
+ 0xa669, 0xa669,
+ 0xa66b, 0xa66b,
+ 0xa66d, 0xa66d,
+ 0xa681, 0xa681,
+ 0xa683, 0xa683,
+ 0xa685, 0xa685,
+ 0xa687, 0xa687,
+ 0xa689, 0xa689,
+ 0xa68b, 0xa68b,
+ 0xa68d, 0xa68d,
+ 0xa68f, 0xa68f,
+ 0xa691, 0xa691,
+ 0xa693, 0xa693,
+ 0xa695, 0xa695,
+ 0xa697, 0xa697,
+ 0xa723, 0xa723,
+ 0xa725, 0xa725,
+ 0xa727, 0xa727,
+ 0xa729, 0xa729,
+ 0xa72b, 0xa72b,
+ 0xa72d, 0xa72d,
+ 0xa72f, 0xa731,
+ 0xa733, 0xa733,
+ 0xa735, 0xa735,
+ 0xa737, 0xa737,
+ 0xa739, 0xa739,
+ 0xa73b, 0xa73b,
+ 0xa73d, 0xa73d,
+ 0xa73f, 0xa73f,
+ 0xa741, 0xa741,
+ 0xa743, 0xa743,
+ 0xa745, 0xa745,
+ 0xa747, 0xa747,
+ 0xa749, 0xa749,
+ 0xa74b, 0xa74b,
+ 0xa74d, 0xa74d,
+ 0xa74f, 0xa74f,
+ 0xa751, 0xa751,
+ 0xa753, 0xa753,
+ 0xa755, 0xa755,
+ 0xa757, 0xa757,
+ 0xa759, 0xa759,
+ 0xa75b, 0xa75b,
+ 0xa75d, 0xa75d,
+ 0xa75f, 0xa75f,
+ 0xa761, 0xa761,
+ 0xa763, 0xa763,
+ 0xa765, 0xa765,
+ 0xa767, 0xa767,
+ 0xa769, 0xa769,
+ 0xa76b, 0xa76b,
+ 0xa76d, 0xa76d,
+ 0xa76f, 0xa778,
+ 0xa77a, 0xa77a,
+ 0xa77c, 0xa77c,
+ 0xa77f, 0xa77f,
+ 0xa781, 0xa781,
+ 0xa783, 0xa783,
+ 0xa785, 0xa785,
+ 0xa787, 0xa787,
+ 0xa78c, 0xa78c,
+ 0xa78e, 0xa78e,
+ 0xa791, 0xa791,
+ 0xa793, 0xa793,
+ 0xa7a1, 0xa7a1,
+ 0xa7a3, 0xa7a3,
+ 0xa7a5, 0xa7a5,
+ 0xa7a7, 0xa7a7,
+ 0xa7a9, 0xa7a9,
+ 0xa7f8, 0xa7fa,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff41, 0xff5a,
+ 0x10428, 0x1044f,
+ 0x1d41a, 0x1d433,
+ 0x1d44e, 0x1d454,
+ 0x1d456, 0x1d467,
+ 0x1d482, 0x1d49b,
+ 0x1d4b6, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d4cf,
+ 0x1d4ea, 0x1d503,
+ 0x1d51e, 0x1d537,
+ 0x1d552, 0x1d56b,
+ 0x1d586, 0x1d59f,
+ 0x1d5ba, 0x1d5d3,
+ 0x1d5ee, 0x1d607,
+ 0x1d622, 0x1d63b,
+ 0x1d656, 0x1d66f,
+ 0x1d68a, 0x1d6a5,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6e1,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d71b,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d755,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d78f,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7c9,
+ 0x1d7cb, 0x1d7cb,
+}; /* CR_Lower */
+
+/* 'Print': [[:Print:]] */
+static const OnigCodePoint CR_Print[] = {
+ 541,
+ 0x0020, 0x007e,
+ 0x00a0, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x058f, 0x058f,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0604,
+ 0x0606, 0x061b,
+ 0x061e, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09fb,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3c, 0x0a3c,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4d,
+ 0x0a51, 0x0a51,
+ 0x0a59, 0x0a5c,
+ 0x0a5e, 0x0a5e,
+ 0x0a66, 0x0a75,
+ 0x0a81, 0x0a83,
+ 0x0a85, 0x0a8d,
+ 0x0a8f, 0x0a91,
+ 0x0a93, 0x0aa8,
+ 0x0aaa, 0x0ab0,
+ 0x0ab2, 0x0ab3,
+ 0x0ab5, 0x0ab9,
+ 0x0abc, 0x0ac5,
+ 0x0ac7, 0x0ac9,
+ 0x0acb, 0x0acd,
+ 0x0ad0, 0x0ad0,
+ 0x0ae0, 0x0ae3,
+ 0x0ae6, 0x0af1,
+ 0x0b01, 0x0b03,
+ 0x0b05, 0x0b0c,
+ 0x0b0f, 0x0b10,
+ 0x0b13, 0x0b28,
+ 0x0b2a, 0x0b30,
+ 0x0b32, 0x0b33,
+ 0x0b35, 0x0b39,
+ 0x0b3c, 0x0b44,
+ 0x0b47, 0x0b48,
+ 0x0b4b, 0x0b4d,
+ 0x0b56, 0x0b57,
+ 0x0b5c, 0x0b5d,
+ 0x0b5f, 0x0b63,
+ 0x0b66, 0x0b77,
+ 0x0b82, 0x0b83,
+ 0x0b85, 0x0b8a,
+ 0x0b8e, 0x0b90,
+ 0x0b92, 0x0b95,
+ 0x0b99, 0x0b9a,
+ 0x0b9c, 0x0b9c,
+ 0x0b9e, 0x0b9f,
+ 0x0ba3, 0x0ba4,
+ 0x0ba8, 0x0baa,
+ 0x0bae, 0x0bb9,
+ 0x0bbe, 0x0bc2,
+ 0x0bc6, 0x0bc8,
+ 0x0bca, 0x0bcd,
+ 0x0bd0, 0x0bd0,
+ 0x0bd7, 0x0bd7,
+ 0x0be6, 0x0bfa,
+ 0x0c01, 0x0c03,
+ 0x0c05, 0x0c0c,
+ 0x0c0e, 0x0c10,
+ 0x0c12, 0x0c28,
+ 0x0c2a, 0x0c33,
+ 0x0c35, 0x0c39,
+ 0x0c3d, 0x0c44,
+ 0x0c46, 0x0c48,
+ 0x0c4a, 0x0c4d,
+ 0x0c55, 0x0c56,
+ 0x0c58, 0x0c59,
+ 0x0c60, 0x0c63,
+ 0x0c66, 0x0c6f,
+ 0x0c78, 0x0c7f,
+ 0x0c82, 0x0c83,
+ 0x0c85, 0x0c8c,
+ 0x0c8e, 0x0c90,
+ 0x0c92, 0x0ca8,
+ 0x0caa, 0x0cb3,
+ 0x0cb5, 0x0cb9,
+ 0x0cbc, 0x0cc4,
+ 0x0cc6, 0x0cc8,
+ 0x0cca, 0x0ccd,
+ 0x0cd5, 0x0cd6,
+ 0x0cde, 0x0cde,
+ 0x0ce0, 0x0ce3,
+ 0x0ce6, 0x0cef,
+ 0x0cf1, 0x0cf2,
+ 0x0d02, 0x0d03,
+ 0x0d05, 0x0d0c,
+ 0x0d0e, 0x0d10,
+ 0x0d12, 0x0d3a,
+ 0x0d3d, 0x0d44,
+ 0x0d46, 0x0d48,
+ 0x0d4a, 0x0d4e,
+ 0x0d57, 0x0d57,
+ 0x0d60, 0x0d63,
+ 0x0d66, 0x0d75,
+ 0x0d79, 0x0d7f,
+ 0x0d82, 0x0d83,
+ 0x0d85, 0x0d96,
+ 0x0d9a, 0x0db1,
+ 0x0db3, 0x0dbb,
+ 0x0dbd, 0x0dbd,
+ 0x0dc0, 0x0dc6,
+ 0x0dca, 0x0dca,
+ 0x0dcf, 0x0dd4,
+ 0x0dd6, 0x0dd6,
+ 0x0dd8, 0x0ddf,
+ 0x0df2, 0x0df4,
+ 0x0e01, 0x0e3a,
+ 0x0e3f, 0x0e5b,
+ 0x0e81, 0x0e82,
+ 0x0e84, 0x0e84,
+ 0x0e87, 0x0e88,
+ 0x0e8a, 0x0e8a,
+ 0x0e8d, 0x0e8d,
+ 0x0e94, 0x0e97,
+ 0x0e99, 0x0e9f,
+ 0x0ea1, 0x0ea3,
+ 0x0ea5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ec8, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fbe, 0x0fcc,
+ 0x0fce, 0x0fda,
+ 0x1000, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135d, 0x137c,
+ 0x1380, 0x1399,
+ 0x13a0, 0x13f4,
+ 0x1400, 0x169c,
+ 0x16a0, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+ 0x1720, 0x1736,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17dd,
+ 0x17e0, 0x17e9,
+ 0x17f0, 0x17f9,
+ 0x1800, 0x180e,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1940, 0x1940,
+ 0x1944, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19da,
+ 0x19de, 0x1a1b,
+ 0x1a1e, 0x1a5e,
+ 0x1a60, 0x1a7c,
+ 0x1a7f, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa0, 0x1aad,
+ 0x1b00, 0x1b4b,
+ 0x1b50, 0x1b7c,
+ 0x1b80, 0x1bf3,
+ 0x1bfc, 0x1c37,
+ 0x1c3b, 0x1c49,
+ 0x1c4d, 0x1c7f,
+ 0x1cc0, 0x1cc7,
+ 0x1cd0, 0x1cf6,
+ 0x1d00, 0x1de6,
+ 0x1dfc, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fc4,
+ 0x1fc6, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fdd, 0x1fef,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffe,
+ 0x2000, 0x2027,
+ 0x202a, 0x2064,
+ 0x206a, 0x2071,
+ 0x2074, 0x208e,
+ 0x2090, 0x209c,
+ 0x20a0, 0x20b9,
+ 0x20d0, 0x20f0,
+ 0x2100, 0x2189,
+ 0x2190, 0x23f3,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x2460, 0x26ff,
+ 0x2701, 0x2b4c,
+ 0x2b50, 0x2b59,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2cf3,
+ 0x2cf9, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
+ 0x2d6f, 0x2d70,
+ 0x2d7f, 0x2d96,
+ 0x2da0, 0x2da6,
+ 0x2da8, 0x2dae,
+ 0x2db0, 0x2db6,
+ 0x2db8, 0x2dbe,
+ 0x2dc0, 0x2dc6,
+ 0x2dc8, 0x2dce,
+ 0x2dd0, 0x2dd6,
+ 0x2dd8, 0x2dde,
+ 0x2de0, 0x2e3b,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+ 0x2ff0, 0x2ffb,
+ 0x3000, 0x303f,
+ 0x3041, 0x3096,
+ 0x3099, 0x30ff,
+ 0x3105, 0x312d,
+ 0x3131, 0x318e,
+ 0x3190, 0x31ba,
+ 0x31c0, 0x31e3,
+ 0x31f0, 0x321e,
+ 0x3220, 0x32fe,
+ 0x3300, 0x4db5,
+ 0x4dc0, 0x9fcc,
+ 0xa000, 0xa48c,
+ 0xa490, 0xa4c6,
+ 0xa4d0, 0xa62b,
+ 0xa640, 0xa697,
+ 0xa69f, 0xa6f7,
+ 0xa700, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa82b,
+ 0xa830, 0xa839,
+ 0xa840, 0xa877,
+ 0xa880, 0xa8c4,
+ 0xa8ce, 0xa8d9,
+ 0xa8e0, 0xa8fb,
+ 0xa900, 0xa953,
+ 0xa95f, 0xa97c,
+ 0xa980, 0xa9cd,
+ 0xa9cf, 0xa9d9,
+ 0xa9de, 0xa9df,
+ 0xaa00, 0xaa36,
+ 0xaa40, 0xaa4d,
+ 0xaa50, 0xaa59,
+ 0xaa5c, 0xaa7b,
+ 0xaa80, 0xaac2,
+ 0xaadb, 0xaaf6,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabed,
+ 0xabf0, 0xabf9,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xe000, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbc1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfd,
+ 0xfe00, 0xfe19,
+ 0xfe20, 0xfe26,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xfeff, 0xfeff,
+ 0xff01, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfff9, 0xfffd,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1018a,
+ 0x10190, 0x1019b,
+ 0x101d0, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x103c3,
+ 0x103c8, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10857, 0x1085f,
+ 0x10900, 0x1091b,
+ 0x1091f, 0x10939,
+ 0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x10a60, 0x10a7f,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b7f,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x11080, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d1dd,
+ 0x1d200, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1d360, 0x1d371,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
+ 0x1f000, 0x1f02b,
+ 0x1f030, 0x1f093,
+ 0x1f0a0, 0x1f0ae,
+ 0x1f0b1, 0x1f0be,
+ 0x1f0c1, 0x1f0cf,
+ 0x1f0d1, 0x1f0df,
+ 0x1f100, 0x1f10a,
+ 0x1f110, 0x1f12e,
+ 0x1f130, 0x1f16b,
+ 0x1f170, 0x1f19a,
+ 0x1f1e6, 0x1f202,
+ 0x1f210, 0x1f23a,
+ 0x1f240, 0x1f248,
+ 0x1f250, 0x1f251,
+ 0x1f300, 0x1f320,
+ 0x1f330, 0x1f335,
+ 0x1f337, 0x1f37c,
+ 0x1f380, 0x1f393,
+ 0x1f3a0, 0x1f3c4,
+ 0x1f3c6, 0x1f3ca,
+ 0x1f3e0, 0x1f3f0,
+ 0x1f400, 0x1f43e,
+ 0x1f440, 0x1f440,
+ 0x1f442, 0x1f4f7,
+ 0x1f4f9, 0x1f4fc,
+ 0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
+ 0x1f550, 0x1f567,
+ 0x1f5fb, 0x1f640,
+ 0x1f645, 0x1f64f,
+ 0x1f680, 0x1f6c5,
+ 0x1f700, 0x1f773,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+ 0xf0000, 0xffffd,
+ 0x100000, 0x10fffd,
+}; /* CR_Print */
+
+/* 'Punct': [[:Punct:]] */
+static const OnigCodePoint CR_Punct[] = {
+ 140,
+ 0x0021, 0x0023,
+ 0x0025, 0x002a,
+ 0x002c, 0x002f,
+ 0x003a, 0x003b,
+ 0x003f, 0x0040,
+ 0x005b, 0x005d,
+ 0x005f, 0x005f,
+ 0x007b, 0x007b,
+ 0x007d, 0x007d,
+ 0x00a1, 0x00a1,
+ 0x00a7, 0x00a7,
+ 0x00ab, 0x00ab,
+ 0x00b6, 0x00b7,
+ 0x00bb, 0x00bb,
+ 0x00bf, 0x00bf,
+ 0x037e, 0x037e,
+ 0x0387, 0x0387,
+ 0x055a, 0x055f,
+ 0x0589, 0x058a,
+ 0x05be, 0x05be,
+ 0x05c0, 0x05c0,
+ 0x05c3, 0x05c3,
+ 0x05c6, 0x05c6,
+ 0x05f3, 0x05f4,
+ 0x0609, 0x060a,
+ 0x060c, 0x060d,
+ 0x061b, 0x061b,
+ 0x061e, 0x061f,
+ 0x066a, 0x066d,
+ 0x06d4, 0x06d4,
+ 0x0700, 0x070d,
+ 0x07f7, 0x07f9,
+ 0x0830, 0x083e,
+ 0x085e, 0x085e,
+ 0x0964, 0x0965,
+ 0x0970, 0x0970,
+ 0x0af0, 0x0af0,
+ 0x0df4, 0x0df4,
+ 0x0e4f, 0x0e4f,
+ 0x0e5a, 0x0e5b,
+ 0x0f04, 0x0f12,
+ 0x0f14, 0x0f14,
+ 0x0f3a, 0x0f3d,
+ 0x0f85, 0x0f85,
+ 0x0fd0, 0x0fd4,
+ 0x0fd9, 0x0fda,
+ 0x104a, 0x104f,
+ 0x10fb, 0x10fb,
+ 0x1360, 0x1368,
+ 0x1400, 0x1400,
+ 0x166d, 0x166e,
+ 0x169b, 0x169c,
+ 0x16eb, 0x16ed,
+ 0x1735, 0x1736,
+ 0x17d4, 0x17d6,
+ 0x17d8, 0x17da,
+ 0x1800, 0x180a,
+ 0x1944, 0x1945,
+ 0x1a1e, 0x1a1f,
+ 0x1aa0, 0x1aa6,
+ 0x1aa8, 0x1aad,
+ 0x1b5a, 0x1b60,
+ 0x1bfc, 0x1bff,
+ 0x1c3b, 0x1c3f,
+ 0x1c7e, 0x1c7f,
+ 0x1cc0, 0x1cc7,
+ 0x1cd3, 0x1cd3,
+ 0x2010, 0x2027,
+ 0x2030, 0x2043,
+ 0x2045, 0x2051,
+ 0x2053, 0x205e,
+ 0x207d, 0x207e,
+ 0x208d, 0x208e,
+ 0x2329, 0x232a,
+ 0x2768, 0x2775,
+ 0x27c5, 0x27c6,
+ 0x27e6, 0x27ef,
+ 0x2983, 0x2998,
+ 0x29d8, 0x29db,
+ 0x29fc, 0x29fd,
+ 0x2cf9, 0x2cfc,
+ 0x2cfe, 0x2cff,
+ 0x2d70, 0x2d70,
+ 0x2e00, 0x2e2e,
+ 0x2e30, 0x2e3b,
+ 0x3001, 0x3003,
+ 0x3008, 0x3011,
+ 0x3014, 0x301f,
+ 0x3030, 0x3030,
+ 0x303d, 0x303d,
+ 0x30a0, 0x30a0,
+ 0x30fb, 0x30fb,
+ 0xa4fe, 0xa4ff,
+ 0xa60d, 0xa60f,
+ 0xa673, 0xa673,
+ 0xa67e, 0xa67e,
+ 0xa6f2, 0xa6f7,
+ 0xa874, 0xa877,
+ 0xa8ce, 0xa8cf,
+ 0xa8f8, 0xa8fa,
+ 0xa92e, 0xa92f,
+ 0xa95f, 0xa95f,
+ 0xa9c1, 0xa9cd,
+ 0xa9de, 0xa9df,
+ 0xaa5c, 0xaa5f,
+ 0xaade, 0xaadf,
+ 0xaaf0, 0xaaf1,
+ 0xabeb, 0xabeb,
+ 0xfd3e, 0xfd3f,
+ 0xfe10, 0xfe19,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe61,
+ 0xfe63, 0xfe63,
+ 0xfe68, 0xfe68,
+ 0xfe6a, 0xfe6b,
+ 0xff01, 0xff03,
+ 0xff05, 0xff0a,
+ 0xff0c, 0xff0f,
+ 0xff1a, 0xff1b,
+ 0xff1f, 0xff20,
+ 0xff3b, 0xff3d,
+ 0xff3f, 0xff3f,
+ 0xff5b, 0xff5b,
+ 0xff5d, 0xff5d,
+ 0xff5f, 0xff65,
+ 0x10100, 0x10102,
+ 0x1039f, 0x1039f,
+ 0x103d0, 0x103d0,
+ 0x10857, 0x10857,
+ 0x1091f, 0x1091f,
+ 0x1093f, 0x1093f,
+ 0x10a50, 0x10a58,
+ 0x10a7f, 0x10a7f,
+ 0x10b39, 0x10b3f,
+ 0x11047, 0x1104d,
+ 0x110bb, 0x110bc,
+ 0x110be, 0x110c1,
+ 0x11140, 0x11143,
+ 0x111c5, 0x111c8,
+ 0x12470, 0x12473,
+}; /* CR_Punct */
+
+/* 'Space': [[:Space:]] */
+static const OnigCodePoint CR_Space[] = {
+ 11,
+ 0x0009, 0x000d,
+ 0x0020, 0x0020,
+ 0x0085, 0x0085,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x180e, 0x180e,
+ 0x2000, 0x200a,
+ 0x2028, 0x2029,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Space */
+
+/* 'Upper': [[:Upper:]] */
+static const OnigCodePoint CR_Upper[] = {
+ 610,
+ 0x0041, 0x005a,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00de,
+ 0x0100, 0x0100,
+ 0x0102, 0x0102,
+ 0x0104, 0x0104,
+ 0x0106, 0x0106,
+ 0x0108, 0x0108,
+ 0x010a, 0x010a,
+ 0x010c, 0x010c,
+ 0x010e, 0x010e,
+ 0x0110, 0x0110,
+ 0x0112, 0x0112,
+ 0x0114, 0x0114,
+ 0x0116, 0x0116,
+ 0x0118, 0x0118,
+ 0x011a, 0x011a,
+ 0x011c, 0x011c,
+ 0x011e, 0x011e,
+ 0x0120, 0x0120,
+ 0x0122, 0x0122,
+ 0x0124, 0x0124,
+ 0x0126, 0x0126,
+ 0x0128, 0x0128,
+ 0x012a, 0x012a,
+ 0x012c, 0x012c,
+ 0x012e, 0x012e,
+ 0x0130, 0x0130,
+ 0x0132, 0x0132,
+ 0x0134, 0x0134,
+ 0x0136, 0x0136,
+ 0x0139, 0x0139,
+ 0x013b, 0x013b,
+ 0x013d, 0x013d,
+ 0x013f, 0x013f,
+ 0x0141, 0x0141,
+ 0x0143, 0x0143,
+ 0x0145, 0x0145,
+ 0x0147, 0x0147,
+ 0x014a, 0x014a,
+ 0x014c, 0x014c,
+ 0x014e, 0x014e,
+ 0x0150, 0x0150,
+ 0x0152, 0x0152,
+ 0x0154, 0x0154,
+ 0x0156, 0x0156,
+ 0x0158, 0x0158,
+ 0x015a, 0x015a,
+ 0x015c, 0x015c,
+ 0x015e, 0x015e,
+ 0x0160, 0x0160,
+ 0x0162, 0x0162,
+ 0x0164, 0x0164,
+ 0x0166, 0x0166,
+ 0x0168, 0x0168,
+ 0x016a, 0x016a,
+ 0x016c, 0x016c,
+ 0x016e, 0x016e,
+ 0x0170, 0x0170,
+ 0x0172, 0x0172,
+ 0x0174, 0x0174,
+ 0x0176, 0x0176,
+ 0x0178, 0x0179,
+ 0x017b, 0x017b,
+ 0x017d, 0x017d,
+ 0x0181, 0x0182,
+ 0x0184, 0x0184,
+ 0x0186, 0x0187,
+ 0x0189, 0x018b,
+ 0x018e, 0x0191,
+ 0x0193, 0x0194,
+ 0x0196, 0x0198,
+ 0x019c, 0x019d,
+ 0x019f, 0x01a0,
+ 0x01a2, 0x01a2,
+ 0x01a4, 0x01a4,
+ 0x01a6, 0x01a7,
+ 0x01a9, 0x01a9,
+ 0x01ac, 0x01ac,
+ 0x01ae, 0x01af,
+ 0x01b1, 0x01b3,
+ 0x01b5, 0x01b5,
+ 0x01b7, 0x01b8,
+ 0x01bc, 0x01bc,
+ 0x01c4, 0x01c4,
+ 0x01c7, 0x01c7,
+ 0x01ca, 0x01ca,
+ 0x01cd, 0x01cd,
+ 0x01cf, 0x01cf,
+ 0x01d1, 0x01d1,
+ 0x01d3, 0x01d3,
+ 0x01d5, 0x01d5,
+ 0x01d7, 0x01d7,
+ 0x01d9, 0x01d9,
+ 0x01db, 0x01db,
+ 0x01de, 0x01de,
+ 0x01e0, 0x01e0,
+ 0x01e2, 0x01e2,
+ 0x01e4, 0x01e4,
+ 0x01e6, 0x01e6,
+ 0x01e8, 0x01e8,
+ 0x01ea, 0x01ea,
+ 0x01ec, 0x01ec,
+ 0x01ee, 0x01ee,
+ 0x01f1, 0x01f1,
+ 0x01f4, 0x01f4,
+ 0x01f6, 0x01f8,
+ 0x01fa, 0x01fa,
+ 0x01fc, 0x01fc,
+ 0x01fe, 0x01fe,
+ 0x0200, 0x0200,
+ 0x0202, 0x0202,
+ 0x0204, 0x0204,
+ 0x0206, 0x0206,
+ 0x0208, 0x0208,
+ 0x020a, 0x020a,
+ 0x020c, 0x020c,
+ 0x020e, 0x020e,
+ 0x0210, 0x0210,
+ 0x0212, 0x0212,
+ 0x0214, 0x0214,
+ 0x0216, 0x0216,
+ 0x0218, 0x0218,
+ 0x021a, 0x021a,
+ 0x021c, 0x021c,
+ 0x021e, 0x021e,
+ 0x0220, 0x0220,
+ 0x0222, 0x0222,
+ 0x0224, 0x0224,
+ 0x0226, 0x0226,
+ 0x0228, 0x0228,
+ 0x022a, 0x022a,
+ 0x022c, 0x022c,
+ 0x022e, 0x022e,
+ 0x0230, 0x0230,
+ 0x0232, 0x0232,
+ 0x023a, 0x023b,
+ 0x023d, 0x023e,
+ 0x0241, 0x0241,
+ 0x0243, 0x0246,
+ 0x0248, 0x0248,
+ 0x024a, 0x024a,
+ 0x024c, 0x024c,
+ 0x024e, 0x024e,
+ 0x0370, 0x0370,
+ 0x0372, 0x0372,
+ 0x0376, 0x0376,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x038f,
+ 0x0391, 0x03a1,
+ 0x03a3, 0x03ab,
+ 0x03cf, 0x03cf,
+ 0x03d2, 0x03d4,
+ 0x03d8, 0x03d8,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03e2,
+ 0x03e4, 0x03e4,
+ 0x03e6, 0x03e6,
+ 0x03e8, 0x03e8,
+ 0x03ea, 0x03ea,
+ 0x03ec, 0x03ec,
+ 0x03ee, 0x03ee,
+ 0x03f4, 0x03f4,
+ 0x03f7, 0x03f7,
+ 0x03f9, 0x03fa,
+ 0x03fd, 0x042f,
+ 0x0460, 0x0460,
+ 0x0462, 0x0462,
+ 0x0464, 0x0464,
+ 0x0466, 0x0466,
+ 0x0468, 0x0468,
+ 0x046a, 0x046a,
+ 0x046c, 0x046c,
+ 0x046e, 0x046e,
+ 0x0470, 0x0470,
+ 0x0472, 0x0472,
+ 0x0474, 0x0474,
+ 0x0476, 0x0476,
+ 0x0478, 0x0478,
+ 0x047a, 0x047a,
+ 0x047c, 0x047c,
+ 0x047e, 0x047e,
+ 0x0480, 0x0480,
+ 0x048a, 0x048a,
+ 0x048c, 0x048c,
+ 0x048e, 0x048e,
+ 0x0490, 0x0490,
+ 0x0492, 0x0492,
+ 0x0494, 0x0494,
+ 0x0496, 0x0496,
+ 0x0498, 0x0498,
+ 0x049a, 0x049a,
+ 0x049c, 0x049c,
+ 0x049e, 0x049e,
+ 0x04a0, 0x04a0,
+ 0x04a2, 0x04a2,
+ 0x04a4, 0x04a4,
+ 0x04a6, 0x04a6,
+ 0x04a8, 0x04a8,
+ 0x04aa, 0x04aa,
+ 0x04ac, 0x04ac,
+ 0x04ae, 0x04ae,
+ 0x04b0, 0x04b0,
+ 0x04b2, 0x04b2,
+ 0x04b4, 0x04b4,
+ 0x04b6, 0x04b6,
+ 0x04b8, 0x04b8,
+ 0x04ba, 0x04ba,
+ 0x04bc, 0x04bc,
+ 0x04be, 0x04be,
+ 0x04c0, 0x04c1,
+ 0x04c3, 0x04c3,
+ 0x04c5, 0x04c5,
+ 0x04c7, 0x04c7,
+ 0x04c9, 0x04c9,
+ 0x04cb, 0x04cb,
+ 0x04cd, 0x04cd,
+ 0x04d0, 0x04d0,
+ 0x04d2, 0x04d2,
+ 0x04d4, 0x04d4,
+ 0x04d6, 0x04d6,
+ 0x04d8, 0x04d8,
+ 0x04da, 0x04da,
+ 0x04dc, 0x04dc,
+ 0x04de, 0x04de,
+ 0x04e0, 0x04e0,
+ 0x04e2, 0x04e2,
+ 0x04e4, 0x04e4,
+ 0x04e6, 0x04e6,
+ 0x04e8, 0x04e8,
+ 0x04ea, 0x04ea,
+ 0x04ec, 0x04ec,
+ 0x04ee, 0x04ee,
+ 0x04f0, 0x04f0,
+ 0x04f2, 0x04f2,
+ 0x04f4, 0x04f4,
+ 0x04f6, 0x04f6,
+ 0x04f8, 0x04f8,
+ 0x04fa, 0x04fa,
+ 0x04fc, 0x04fc,
+ 0x04fe, 0x04fe,
+ 0x0500, 0x0500,
+ 0x0502, 0x0502,
+ 0x0504, 0x0504,
+ 0x0506, 0x0506,
+ 0x0508, 0x0508,
+ 0x050a, 0x050a,
+ 0x050c, 0x050c,
+ 0x050e, 0x050e,
+ 0x0510, 0x0510,
+ 0x0512, 0x0512,
+ 0x0514, 0x0514,
+ 0x0516, 0x0516,
+ 0x0518, 0x0518,
+ 0x051a, 0x051a,
+ 0x051c, 0x051c,
+ 0x051e, 0x051e,
+ 0x0520, 0x0520,
+ 0x0522, 0x0522,
+ 0x0524, 0x0524,
+ 0x0526, 0x0526,
+ 0x0531, 0x0556,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x1e00, 0x1e00,
+ 0x1e02, 0x1e02,
+ 0x1e04, 0x1e04,
+ 0x1e06, 0x1e06,
+ 0x1e08, 0x1e08,
+ 0x1e0a, 0x1e0a,
+ 0x1e0c, 0x1e0c,
+ 0x1e0e, 0x1e0e,
+ 0x1e10, 0x1e10,
+ 0x1e12, 0x1e12,
+ 0x1e14, 0x1e14,
+ 0x1e16, 0x1e16,
+ 0x1e18, 0x1e18,
+ 0x1e1a, 0x1e1a,
+ 0x1e1c, 0x1e1c,
+ 0x1e1e, 0x1e1e,
+ 0x1e20, 0x1e20,
+ 0x1e22, 0x1e22,
+ 0x1e24, 0x1e24,
+ 0x1e26, 0x1e26,
+ 0x1e28, 0x1e28,
+ 0x1e2a, 0x1e2a,
+ 0x1e2c, 0x1e2c,
+ 0x1e2e, 0x1e2e,
+ 0x1e30, 0x1e30,
+ 0x1e32, 0x1e32,
+ 0x1e34, 0x1e34,
+ 0x1e36, 0x1e36,
+ 0x1e38, 0x1e38,
+ 0x1e3a, 0x1e3a,
+ 0x1e3c, 0x1e3c,
+ 0x1e3e, 0x1e3e,
+ 0x1e40, 0x1e40,
+ 0x1e42, 0x1e42,
+ 0x1e44, 0x1e44,
+ 0x1e46, 0x1e46,
+ 0x1e48, 0x1e48,
+ 0x1e4a, 0x1e4a,
+ 0x1e4c, 0x1e4c,
+ 0x1e4e, 0x1e4e,
+ 0x1e50, 0x1e50,
+ 0x1e52, 0x1e52,
+ 0x1e54, 0x1e54,
+ 0x1e56, 0x1e56,
+ 0x1e58, 0x1e58,
+ 0x1e5a, 0x1e5a,
+ 0x1e5c, 0x1e5c,
+ 0x1e5e, 0x1e5e,
+ 0x1e60, 0x1e60,
+ 0x1e62, 0x1e62,
+ 0x1e64, 0x1e64,
+ 0x1e66, 0x1e66,
+ 0x1e68, 0x1e68,
+ 0x1e6a, 0x1e6a,
+ 0x1e6c, 0x1e6c,
+ 0x1e6e, 0x1e6e,
+ 0x1e70, 0x1e70,
+ 0x1e72, 0x1e72,
+ 0x1e74, 0x1e74,
+ 0x1e76, 0x1e76,
+ 0x1e78, 0x1e78,
+ 0x1e7a, 0x1e7a,
+ 0x1e7c, 0x1e7c,
+ 0x1e7e, 0x1e7e,
+ 0x1e80, 0x1e80,
+ 0x1e82, 0x1e82,
+ 0x1e84, 0x1e84,
+ 0x1e86, 0x1e86,
+ 0x1e88, 0x1e88,
+ 0x1e8a, 0x1e8a,
+ 0x1e8c, 0x1e8c,
+ 0x1e8e, 0x1e8e,
+ 0x1e90, 0x1e90,
+ 0x1e92, 0x1e92,
+ 0x1e94, 0x1e94,
+ 0x1e9e, 0x1e9e,
+ 0x1ea0, 0x1ea0,
+ 0x1ea2, 0x1ea2,
+ 0x1ea4, 0x1ea4,
+ 0x1ea6, 0x1ea6,
+ 0x1ea8, 0x1ea8,
+ 0x1eaa, 0x1eaa,
+ 0x1eac, 0x1eac,
+ 0x1eae, 0x1eae,
+ 0x1eb0, 0x1eb0,
+ 0x1eb2, 0x1eb2,
+ 0x1eb4, 0x1eb4,
+ 0x1eb6, 0x1eb6,
+ 0x1eb8, 0x1eb8,
+ 0x1eba, 0x1eba,
+ 0x1ebc, 0x1ebc,
+ 0x1ebe, 0x1ebe,
+ 0x1ec0, 0x1ec0,
+ 0x1ec2, 0x1ec2,
+ 0x1ec4, 0x1ec4,
+ 0x1ec6, 0x1ec6,
+ 0x1ec8, 0x1ec8,
+ 0x1eca, 0x1eca,
+ 0x1ecc, 0x1ecc,
+ 0x1ece, 0x1ece,
+ 0x1ed0, 0x1ed0,
+ 0x1ed2, 0x1ed2,
+ 0x1ed4, 0x1ed4,
+ 0x1ed6, 0x1ed6,
+ 0x1ed8, 0x1ed8,
+ 0x1eda, 0x1eda,
+ 0x1edc, 0x1edc,
+ 0x1ede, 0x1ede,
+ 0x1ee0, 0x1ee0,
+ 0x1ee2, 0x1ee2,
+ 0x1ee4, 0x1ee4,
+ 0x1ee6, 0x1ee6,
+ 0x1ee8, 0x1ee8,
+ 0x1eea, 0x1eea,
+ 0x1eec, 0x1eec,
+ 0x1eee, 0x1eee,
+ 0x1ef0, 0x1ef0,
+ 0x1ef2, 0x1ef2,
+ 0x1ef4, 0x1ef4,
+ 0x1ef6, 0x1ef6,
+ 0x1ef8, 0x1ef8,
+ 0x1efa, 0x1efa,
+ 0x1efc, 0x1efc,
+ 0x1efe, 0x1efe,
+ 0x1f08, 0x1f0f,
+ 0x1f18, 0x1f1d,
+ 0x1f28, 0x1f2f,
+ 0x1f38, 0x1f3f,
+ 0x1f48, 0x1f4d,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f5f,
+ 0x1f68, 0x1f6f,
+ 0x1fb8, 0x1fbb,
+ 0x1fc8, 0x1fcb,
+ 0x1fd8, 0x1fdb,
+ 0x1fe8, 0x1fec,
+ 0x1ff8, 0x1ffb,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210b, 0x210d,
+ 0x2110, 0x2112,
+ 0x2115, 0x2115,
+ 0x2119, 0x211d,
+ 0x2124, 0x2124,
+ 0x2126, 0x2126,
+ 0x2128, 0x2128,
+ 0x212a, 0x212d,
+ 0x2130, 0x2133,
+ 0x213e, 0x213f,
+ 0x2145, 0x2145,
+ 0x2160, 0x216f,
+ 0x2183, 0x2183,
+ 0x24b6, 0x24cf,
+ 0x2c00, 0x2c2e,
+ 0x2c60, 0x2c60,
+ 0x2c62, 0x2c64,
+ 0x2c67, 0x2c67,
+ 0x2c69, 0x2c69,
+ 0x2c6b, 0x2c6b,
+ 0x2c6d, 0x2c70,
+ 0x2c72, 0x2c72,
+ 0x2c75, 0x2c75,
+ 0x2c7e, 0x2c80,
+ 0x2c82, 0x2c82,
+ 0x2c84, 0x2c84,
+ 0x2c86, 0x2c86,
+ 0x2c88, 0x2c88,
+ 0x2c8a, 0x2c8a,
+ 0x2c8c, 0x2c8c,
+ 0x2c8e, 0x2c8e,
+ 0x2c90, 0x2c90,
+ 0x2c92, 0x2c92,
+ 0x2c94, 0x2c94,
+ 0x2c96, 0x2c96,
+ 0x2c98, 0x2c98,
+ 0x2c9a, 0x2c9a,
+ 0x2c9c, 0x2c9c,
+ 0x2c9e, 0x2c9e,
+ 0x2ca0, 0x2ca0,
+ 0x2ca2, 0x2ca2,
+ 0x2ca4, 0x2ca4,
+ 0x2ca6, 0x2ca6,
+ 0x2ca8, 0x2ca8,
+ 0x2caa, 0x2caa,
+ 0x2cac, 0x2cac,
+ 0x2cae, 0x2cae,
+ 0x2cb0, 0x2cb0,
+ 0x2cb2, 0x2cb2,
+ 0x2cb4, 0x2cb4,
+ 0x2cb6, 0x2cb6,
+ 0x2cb8, 0x2cb8,
+ 0x2cba, 0x2cba,
+ 0x2cbc, 0x2cbc,
+ 0x2cbe, 0x2cbe,
+ 0x2cc0, 0x2cc0,
+ 0x2cc2, 0x2cc2,
+ 0x2cc4, 0x2cc4,
+ 0x2cc6, 0x2cc6,
+ 0x2cc8, 0x2cc8,
+ 0x2cca, 0x2cca,
+ 0x2ccc, 0x2ccc,
+ 0x2cce, 0x2cce,
+ 0x2cd0, 0x2cd0,
+ 0x2cd2, 0x2cd2,
+ 0x2cd4, 0x2cd4,
+ 0x2cd6, 0x2cd6,
+ 0x2cd8, 0x2cd8,
+ 0x2cda, 0x2cda,
+ 0x2cdc, 0x2cdc,
+ 0x2cde, 0x2cde,
+ 0x2ce0, 0x2ce0,
+ 0x2ce2, 0x2ce2,
+ 0x2ceb, 0x2ceb,
+ 0x2ced, 0x2ced,
+ 0x2cf2, 0x2cf2,
+ 0xa640, 0xa640,
+ 0xa642, 0xa642,
+ 0xa644, 0xa644,
+ 0xa646, 0xa646,
+ 0xa648, 0xa648,
+ 0xa64a, 0xa64a,
+ 0xa64c, 0xa64c,
+ 0xa64e, 0xa64e,
+ 0xa650, 0xa650,
+ 0xa652, 0xa652,
+ 0xa654, 0xa654,
+ 0xa656, 0xa656,
+ 0xa658, 0xa658,
+ 0xa65a, 0xa65a,
+ 0xa65c, 0xa65c,
+ 0xa65e, 0xa65e,
+ 0xa660, 0xa660,
+ 0xa662, 0xa662,
+ 0xa664, 0xa664,
+ 0xa666, 0xa666,
+ 0xa668, 0xa668,
+ 0xa66a, 0xa66a,
+ 0xa66c, 0xa66c,
+ 0xa680, 0xa680,
+ 0xa682, 0xa682,
+ 0xa684, 0xa684,
+ 0xa686, 0xa686,
+ 0xa688, 0xa688,
+ 0xa68a, 0xa68a,
+ 0xa68c, 0xa68c,
+ 0xa68e, 0xa68e,
+ 0xa690, 0xa690,
+ 0xa692, 0xa692,
+ 0xa694, 0xa694,
+ 0xa696, 0xa696,
+ 0xa722, 0xa722,
+ 0xa724, 0xa724,
+ 0xa726, 0xa726,
+ 0xa728, 0xa728,
+ 0xa72a, 0xa72a,
+ 0xa72c, 0xa72c,
+ 0xa72e, 0xa72e,
+ 0xa732, 0xa732,
+ 0xa734, 0xa734,
+ 0xa736, 0xa736,
+ 0xa738, 0xa738,
+ 0xa73a, 0xa73a,
+ 0xa73c, 0xa73c,
+ 0xa73e, 0xa73e,
+ 0xa740, 0xa740,
+ 0xa742, 0xa742,
+ 0xa744, 0xa744,
+ 0xa746, 0xa746,
+ 0xa748, 0xa748,
+ 0xa74a, 0xa74a,
+ 0xa74c, 0xa74c,
+ 0xa74e, 0xa74e,
+ 0xa750, 0xa750,
+ 0xa752, 0xa752,
+ 0xa754, 0xa754,
+ 0xa756, 0xa756,
+ 0xa758, 0xa758,
+ 0xa75a, 0xa75a,
+ 0xa75c, 0xa75c,
+ 0xa75e, 0xa75e,
+ 0xa760, 0xa760,
+ 0xa762, 0xa762,
+ 0xa764, 0xa764,
+ 0xa766, 0xa766,
+ 0xa768, 0xa768,
+ 0xa76a, 0xa76a,
+ 0xa76c, 0xa76c,
+ 0xa76e, 0xa76e,
+ 0xa779, 0xa779,
+ 0xa77b, 0xa77b,
+ 0xa77d, 0xa77e,
+ 0xa780, 0xa780,
+ 0xa782, 0xa782,
+ 0xa784, 0xa784,
+ 0xa786, 0xa786,
+ 0xa78b, 0xa78b,
+ 0xa78d, 0xa78d,
+ 0xa790, 0xa790,
+ 0xa792, 0xa792,
+ 0xa7a0, 0xa7a0,
+ 0xa7a2, 0xa7a2,
+ 0xa7a4, 0xa7a4,
+ 0xa7a6, 0xa7a6,
+ 0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
+ 0xff21, 0xff3a,
+ 0x10400, 0x10427,
+ 0x1d400, 0x1d419,
+ 0x1d434, 0x1d44d,
+ 0x1d468, 0x1d481,
+ 0x1d49c, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b5,
+ 0x1d4d0, 0x1d4e9,
+ 0x1d504, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d538, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d56c, 0x1d585,
+ 0x1d5a0, 0x1d5b9,
+ 0x1d5d4, 0x1d5ed,
+ 0x1d608, 0x1d621,
+ 0x1d63c, 0x1d655,
+ 0x1d670, 0x1d689,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6e2, 0x1d6fa,
+ 0x1d71c, 0x1d734,
+ 0x1d756, 0x1d76e,
+ 0x1d790, 0x1d7a8,
+ 0x1d7ca, 0x1d7ca,
+}; /* CR_Upper */
+
+/* 'XDigit': [[:XDigit:]] */
+static const OnigCodePoint CR_XDigit[] = {
+ 3,
+ 0x0030, 0x0039,
+ 0x0041, 0x0046,
+ 0x0061, 0x0066,
+}; /* CR_XDigit */
+
+/* 'Word': [[:Word:]] */
+static const OnigCodePoint CR_Word[] = {
+ 564,
+ 0x0030, 0x0039,
+ 0x0041, 0x005a,
+ 0x005f, 0x005f,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0300, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x0483, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0669,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06df, 0x06e8,
+ 0x06ea, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0840, 0x085b,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0963,
+ 0x0966, 0x096f,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09f1,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3c, 0x0a3c,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4d,
+ 0x0a51, 0x0a51,
+ 0x0a59, 0x0a5c,
+ 0x0a5e, 0x0a5e,
+ 0x0a66, 0x0a75,
+ 0x0a81, 0x0a83,
+ 0x0a85, 0x0a8d,
+ 0x0a8f, 0x0a91,
+ 0x0a93, 0x0aa8,
+ 0x0aaa, 0x0ab0,
+ 0x0ab2, 0x0ab3,
+ 0x0ab5, 0x0ab9,
+ 0x0abc, 0x0ac5,
+ 0x0ac7, 0x0ac9,
+ 0x0acb, 0x0acd,
+ 0x0ad0, 0x0ad0,
+ 0x0ae0, 0x0ae3,
+ 0x0ae6, 0x0aef,
+ 0x0b01, 0x0b03,
+ 0x0b05, 0x0b0c,
+ 0x0b0f, 0x0b10,
+ 0x0b13, 0x0b28,
+ 0x0b2a, 0x0b30,
+ 0x0b32, 0x0b33,
+ 0x0b35, 0x0b39,
+ 0x0b3c, 0x0b44,
+ 0x0b47, 0x0b48,
+ 0x0b4b, 0x0b4d,
+ 0x0b56, 0x0b57,
+ 0x0b5c, 0x0b5d,
+ 0x0b5f, 0x0b63,
+ 0x0b66, 0x0b6f,
+ 0x0b71, 0x0b71,
+ 0x0b82, 0x0b83,
+ 0x0b85, 0x0b8a,
+ 0x0b8e, 0x0b90,
+ 0x0b92, 0x0b95,
+ 0x0b99, 0x0b9a,
+ 0x0b9c, 0x0b9c,
+ 0x0b9e, 0x0b9f,
+ 0x0ba3, 0x0ba4,
+ 0x0ba8, 0x0baa,
+ 0x0bae, 0x0bb9,
+ 0x0bbe, 0x0bc2,
+ 0x0bc6, 0x0bc8,
+ 0x0bca, 0x0bcd,
+ 0x0bd0, 0x0bd0,
+ 0x0bd7, 0x0bd7,
+ 0x0be6, 0x0bef,
+ 0x0c01, 0x0c03,
+ 0x0c05, 0x0c0c,
+ 0x0c0e, 0x0c10,
+ 0x0c12, 0x0c28,
+ 0x0c2a, 0x0c33,
+ 0x0c35, 0x0c39,
+ 0x0c3d, 0x0c44,
+ 0x0c46, 0x0c48,
+ 0x0c4a, 0x0c4d,
+ 0x0c55, 0x0c56,
+ 0x0c58, 0x0c59,
+ 0x0c60, 0x0c63,
+ 0x0c66, 0x0c6f,
+ 0x0c82, 0x0c83,
+ 0x0c85, 0x0c8c,
+ 0x0c8e, 0x0c90,
+ 0x0c92, 0x0ca8,
+ 0x0caa, 0x0cb3,
+ 0x0cb5, 0x0cb9,
+ 0x0cbc, 0x0cc4,
+ 0x0cc6, 0x0cc8,
+ 0x0cca, 0x0ccd,
+ 0x0cd5, 0x0cd6,
+ 0x0cde, 0x0cde,
+ 0x0ce0, 0x0ce3,
+ 0x0ce6, 0x0cef,
+ 0x0cf1, 0x0cf2,
+ 0x0d02, 0x0d03,
+ 0x0d05, 0x0d0c,
+ 0x0d0e, 0x0d10,
+ 0x0d12, 0x0d3a,
+ 0x0d3d, 0x0d44,
+ 0x0d46, 0x0d48,
+ 0x0d4a, 0x0d4e,
+ 0x0d57, 0x0d57,
+ 0x0d60, 0x0d63,
+ 0x0d66, 0x0d6f,
+ 0x0d7a, 0x0d7f,
+ 0x0d82, 0x0d83,
+ 0x0d85, 0x0d96,
+ 0x0d9a, 0x0db1,
+ 0x0db3, 0x0dbb,
+ 0x0dbd, 0x0dbd,
+ 0x0dc0, 0x0dc6,
+ 0x0dca, 0x0dca,
+ 0x0dcf, 0x0dd4,
+ 0x0dd6, 0x0dd6,
+ 0x0dd8, 0x0ddf,
+ 0x0df2, 0x0df3,
+ 0x0e01, 0x0e3a,
+ 0x0e40, 0x0e4e,
+ 0x0e50, 0x0e59,
+ 0x0e81, 0x0e82,
+ 0x0e84, 0x0e84,
+ 0x0e87, 0x0e88,
+ 0x0e8a, 0x0e8a,
+ 0x0e8d, 0x0e8d,
+ 0x0e94, 0x0e97,
+ 0x0e99, 0x0e9f,
+ 0x0ea1, 0x0ea3,
+ 0x0ea5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ec8, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f00,
+ 0x0f18, 0x0f19,
+ 0x0f20, 0x0f29,
+ 0x0f35, 0x0f35,
+ 0x0f37, 0x0f37,
+ 0x0f39, 0x0f39,
+ 0x0f3e, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f84,
+ 0x0f86, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fc6, 0x0fc6,
+ 0x1000, 0x1049,
+ 0x1050, 0x109d,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135d, 0x135f,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+ 0x1720, 0x1734,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17d3,
+ 0x17d7, 0x17d7,
+ 0x17dc, 0x17dd,
+ 0x17e0, 0x17e9,
+ 0x180b, 0x180d,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1946, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19d9,
+ 0x1a00, 0x1a1b,
+ 0x1a20, 0x1a5e,
+ 0x1a60, 0x1a7c,
+ 0x1a7f, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa7, 0x1aa7,
+ 0x1b00, 0x1b4b,
+ 0x1b50, 0x1b59,
+ 0x1b6b, 0x1b73,
+ 0x1b80, 0x1bf3,
+ 0x1c00, 0x1c37,
+ 0x1c40, 0x1c49,
+ 0x1c4d, 0x1c7d,
+ 0x1cd0, 0x1cd2,
+ 0x1cd4, 0x1cf6,
+ 0x1d00, 0x1de6,
+ 0x1dfc, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fbc,
+ 0x1fbe, 0x1fbe,
+ 0x1fc2, 0x1fc4,
+ 0x1fc6, 0x1fcc,
+ 0x1fd0, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fe0, 0x1fec,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffc,
+ 0x203f, 0x2040,
+ 0x2054, 0x2054,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x20d0, 0x20f0,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210a, 0x2113,
+ 0x2115, 0x2115,
+ 0x2119, 0x211d,
+ 0x2124, 0x2124,
+ 0x2126, 0x2126,
+ 0x2128, 0x2128,
+ 0x212a, 0x212d,
+ 0x212f, 0x2139,
+ 0x213c, 0x213f,
+ 0x2145, 0x2149,
+ 0x214e, 0x214e,
+ 0x2160, 0x2188,
+ 0x24b6, 0x24e9,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2ce4,
+ 0x2ceb, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
+ 0x2d6f, 0x2d6f,
+ 0x2d7f, 0x2d96,
+ 0x2da0, 0x2da6,
+ 0x2da8, 0x2dae,
+ 0x2db0, 0x2db6,
+ 0x2db8, 0x2dbe,
+ 0x2dc0, 0x2dc6,
+ 0x2dc8, 0x2dce,
+ 0x2dd0, 0x2dd6,
+ 0x2dd8, 0x2dde,
+ 0x2de0, 0x2dff,
+ 0x2e2f, 0x2e2f,
+ 0x3005, 0x3007,
+ 0x3021, 0x302f,
+ 0x3031, 0x3035,
+ 0x3038, 0x303c,
+ 0x3041, 0x3096,
+ 0x3099, 0x309a,
+ 0x309d, 0x309f,
+ 0x30a1, 0x30fa,
+ 0x30fc, 0x30ff,
+ 0x3105, 0x312d,
+ 0x3131, 0x318e,
+ 0x31a0, 0x31ba,
+ 0x31f0, 0x31ff,
+ 0x3400, 0x4db5,
+ 0x4e00, 0x9fcc,
+ 0xa000, 0xa48c,
+ 0xa4d0, 0xa4fd,
+ 0xa500, 0xa60c,
+ 0xa610, 0xa62b,
+ 0xa640, 0xa672,
+ 0xa674, 0xa67d,
+ 0xa67f, 0xa697,
+ 0xa69f, 0xa6f1,
+ 0xa717, 0xa71f,
+ 0xa722, 0xa788,
+ 0xa78b, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa827,
+ 0xa840, 0xa873,
+ 0xa880, 0xa8c4,
+ 0xa8d0, 0xa8d9,
+ 0xa8e0, 0xa8f7,
+ 0xa8fb, 0xa8fb,
+ 0xa900, 0xa92d,
+ 0xa930, 0xa953,
+ 0xa960, 0xa97c,
+ 0xa980, 0xa9c0,
+ 0xa9cf, 0xa9d9,
+ 0xaa00, 0xaa36,
+ 0xaa40, 0xaa4d,
+ 0xaa50, 0xaa59,
+ 0xaa60, 0xaa76,
+ 0xaa7a, 0xaa7b,
+ 0xaa80, 0xaac2,
+ 0xaadb, 0xaadd,
+ 0xaae0, 0xaaef,
+ 0xaaf2, 0xaaf6,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabea,
+ 0xabec, 0xabed,
+ 0xabf0, 0xabf9,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb28,
+ 0xfb2a, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe00, 0xfe0f,
+ 0xfe20, 0xfe26,
+ 0xfe33, 0xfe34,
+ 0xfe4d, 0xfe4f,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff10, 0xff19,
+ 0xff21, 0xff3a,
+ 0xff3f, 0xff3f,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x101fd, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a3f,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11046,
+ 0x11066, 0x1106f,
+ 0x11080, 0x110ba,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x1113f,
+ 0x11180, 0x111c4,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d165, 0x1d169,
+ 0x1d16d, 0x1d172,
+ 0x1d17b, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0x1d242, 0x1d244,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0100, 0xe01ef,
+}; /* CR_Word */
+
+/* 'Alnum': [[:Alnum:]] */
+static const OnigCodePoint CR_Alnum[] = {
+ 566,
+ 0x0030, 0x0039,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0345, 0x0345,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05b0, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0657,
+ 0x0659, 0x0669,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06e1, 0x06e8,
+ 0x06ed, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x073f,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07ea,
+ 0x07f4, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x0817,
+ 0x081a, 0x082c,
+ 0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08e9,
+ 0x08f0, 0x08fe,
+ 0x0900, 0x093b,
+ 0x093d, 0x094c,
+ 0x094e, 0x0950,
+ 0x0955, 0x0963,
+ 0x0966, 0x096f,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bd, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09cc,
+ 0x09ce, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09f1,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4c,
+ 0x0a51, 0x0a51,
+ 0x0a59, 0x0a5c,
+ 0x0a5e, 0x0a5e,
+ 0x0a66, 0x0a75,
+ 0x0a81, 0x0a83,
+ 0x0a85, 0x0a8d,
+ 0x0a8f, 0x0a91,
+ 0x0a93, 0x0aa8,
+ 0x0aaa, 0x0ab0,
+ 0x0ab2, 0x0ab3,
+ 0x0ab5, 0x0ab9,
+ 0x0abd, 0x0ac5,
+ 0x0ac7, 0x0ac9,
+ 0x0acb, 0x0acc,
+ 0x0ad0, 0x0ad0,
+ 0x0ae0, 0x0ae3,
+ 0x0ae6, 0x0aef,
+ 0x0b01, 0x0b03,
+ 0x0b05, 0x0b0c,
+ 0x0b0f, 0x0b10,
+ 0x0b13, 0x0b28,
+ 0x0b2a, 0x0b30,
+ 0x0b32, 0x0b33,
+ 0x0b35, 0x0b39,
+ 0x0b3d, 0x0b44,
+ 0x0b47, 0x0b48,
+ 0x0b4b, 0x0b4c,
+ 0x0b56, 0x0b57,
+ 0x0b5c, 0x0b5d,
+ 0x0b5f, 0x0b63,
+ 0x0b66, 0x0b6f,
+ 0x0b71, 0x0b71,
+ 0x0b82, 0x0b83,
+ 0x0b85, 0x0b8a,
+ 0x0b8e, 0x0b90,
+ 0x0b92, 0x0b95,
+ 0x0b99, 0x0b9a,
+ 0x0b9c, 0x0b9c,
+ 0x0b9e, 0x0b9f,
+ 0x0ba3, 0x0ba4,
+ 0x0ba8, 0x0baa,
+ 0x0bae, 0x0bb9,
+ 0x0bbe, 0x0bc2,
+ 0x0bc6, 0x0bc8,
+ 0x0bca, 0x0bcc,
+ 0x0bd0, 0x0bd0,
+ 0x0bd7, 0x0bd7,
+ 0x0be6, 0x0bef,
+ 0x0c01, 0x0c03,
+ 0x0c05, 0x0c0c,
+ 0x0c0e, 0x0c10,
+ 0x0c12, 0x0c28,
+ 0x0c2a, 0x0c33,
+ 0x0c35, 0x0c39,
+ 0x0c3d, 0x0c44,
+ 0x0c46, 0x0c48,
+ 0x0c4a, 0x0c4c,
+ 0x0c55, 0x0c56,
+ 0x0c58, 0x0c59,
+ 0x0c60, 0x0c63,
+ 0x0c66, 0x0c6f,
+ 0x0c82, 0x0c83,
+ 0x0c85, 0x0c8c,
+ 0x0c8e, 0x0c90,
+ 0x0c92, 0x0ca8,
+ 0x0caa, 0x0cb3,
+ 0x0cb5, 0x0cb9,
+ 0x0cbd, 0x0cc4,
+ 0x0cc6, 0x0cc8,
+ 0x0cca, 0x0ccc,
+ 0x0cd5, 0x0cd6,
+ 0x0cde, 0x0cde,
+ 0x0ce0, 0x0ce3,
+ 0x0ce6, 0x0cef,
+ 0x0cf1, 0x0cf2,
+ 0x0d02, 0x0d03,
+ 0x0d05, 0x0d0c,
+ 0x0d0e, 0x0d10,
+ 0x0d12, 0x0d3a,
+ 0x0d3d, 0x0d44,
+ 0x0d46, 0x0d48,
+ 0x0d4a, 0x0d4c,
+ 0x0d4e, 0x0d4e,
+ 0x0d57, 0x0d57,
+ 0x0d60, 0x0d63,
+ 0x0d66, 0x0d6f,
+ 0x0d7a, 0x0d7f,
+ 0x0d82, 0x0d83,
+ 0x0d85, 0x0d96,
+ 0x0d9a, 0x0db1,
+ 0x0db3, 0x0dbb,
+ 0x0dbd, 0x0dbd,
+ 0x0dc0, 0x0dc6,
+ 0x0dcf, 0x0dd4,
+ 0x0dd6, 0x0dd6,
+ 0x0dd8, 0x0ddf,
+ 0x0df2, 0x0df3,
+ 0x0e01, 0x0e3a,
+ 0x0e40, 0x0e46,
+ 0x0e4d, 0x0e4d,
+ 0x0e50, 0x0e59,
+ 0x0e81, 0x0e82,
+ 0x0e84, 0x0e84,
+ 0x0e87, 0x0e88,
+ 0x0e8a, 0x0e8a,
+ 0x0e8d, 0x0e8d,
+ 0x0e94, 0x0e97,
+ 0x0e99, 0x0e9f,
+ 0x0ea1, 0x0ea3,
+ 0x0ea5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ecd, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f00,
+ 0x0f20, 0x0f29,
+ 0x0f40, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f81,
+ 0x0f88, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x1000, 0x1036,
+ 0x1038, 0x1038,
+ 0x103b, 0x1049,
+ 0x1050, 0x1062,
+ 0x1065, 0x1068,
+ 0x106e, 0x1086,
+ 0x108e, 0x108e,
+ 0x1090, 0x1099,
+ 0x109c, 0x109d,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135f, 0x135f,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1713,
+ 0x1720, 0x1733,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17b3,
+ 0x17b6, 0x17c8,
+ 0x17d7, 0x17d7,
+ 0x17dc, 0x17dc,
+ 0x17e0, 0x17e9,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x1938,
+ 0x1946, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19d9,
+ 0x1a00, 0x1a1b,
+ 0x1a20, 0x1a5e,
+ 0x1a61, 0x1a74,
+ 0x1a80, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa7, 0x1aa7,
+ 0x1b00, 0x1b33,
+ 0x1b35, 0x1b43,
+ 0x1b45, 0x1b4b,
+ 0x1b50, 0x1b59,
+ 0x1b80, 0x1ba9,
+ 0x1bac, 0x1be5,
+ 0x1be7, 0x1bf1,
+ 0x1c00, 0x1c35,
+ 0x1c40, 0x1c49,
+ 0x1c4d, 0x1c7d,
+ 0x1ce9, 0x1cec,
+ 0x1cee, 0x1cf3,
+ 0x1cf5, 0x1cf6,
+ 0x1d00, 0x1dbf,
+ 0x1e00, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fbc,
+ 0x1fbe, 0x1fbe,
+ 0x1fc2, 0x1fc4,
+ 0x1fc6, 0x1fcc,
+ 0x1fd0, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fe0, 0x1fec,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffc,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210a, 0x2113,
+ 0x2115, 0x2115,
+ 0x2119, 0x211d,
+ 0x2124, 0x2124,
+ 0x2126, 0x2126,
+ 0x2128, 0x2128,
+ 0x212a, 0x212d,
+ 0x212f, 0x2139,
+ 0x213c, 0x213f,
+ 0x2145, 0x2149,
+ 0x214e, 0x214e,
+ 0x2160, 0x2188,
+ 0x24b6, 0x24e9,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2ce4,
+ 0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
+ 0x2d6f, 0x2d6f,
+ 0x2d80, 0x2d96,
+ 0x2da0, 0x2da6,
+ 0x2da8, 0x2dae,
+ 0x2db0, 0x2db6,
+ 0x2db8, 0x2dbe,
+ 0x2dc0, 0x2dc6,
+ 0x2dc8, 0x2dce,
+ 0x2dd0, 0x2dd6,
+ 0x2dd8, 0x2dde,
+ 0x2de0, 0x2dff,
+ 0x2e2f, 0x2e2f,
+ 0x3005, 0x3007,
+ 0x3021, 0x3029,
+ 0x3031, 0x3035,
+ 0x3038, 0x303c,
+ 0x3041, 0x3096,
+ 0x309d, 0x309f,
+ 0x30a1, 0x30fa,
+ 0x30fc, 0x30ff,
+ 0x3105, 0x312d,
+ 0x3131, 0x318e,
+ 0x31a0, 0x31ba,
+ 0x31f0, 0x31ff,
+ 0x3400, 0x4db5,
+ 0x4e00, 0x9fcc,
+ 0xa000, 0xa48c,
+ 0xa4d0, 0xa4fd,
+ 0xa500, 0xa60c,
+ 0xa610, 0xa62b,
+ 0xa640, 0xa66e,
+ 0xa674, 0xa67b,
+ 0xa67f, 0xa697,
+ 0xa69f, 0xa6ef,
+ 0xa717, 0xa71f,
+ 0xa722, 0xa788,
+ 0xa78b, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa801,
+ 0xa803, 0xa805,
+ 0xa807, 0xa80a,
+ 0xa80c, 0xa827,
+ 0xa840, 0xa873,
+ 0xa880, 0xa8c3,
+ 0xa8d0, 0xa8d9,
+ 0xa8f2, 0xa8f7,
+ 0xa8fb, 0xa8fb,
+ 0xa900, 0xa92a,
+ 0xa930, 0xa952,
+ 0xa960, 0xa97c,
+ 0xa980, 0xa9b2,
+ 0xa9b4, 0xa9bf,
+ 0xa9cf, 0xa9d9,
+ 0xaa00, 0xaa36,
+ 0xaa40, 0xaa4d,
+ 0xaa50, 0xaa59,
+ 0xaa60, 0xaa76,
+ 0xaa7a, 0xaa7a,
+ 0xaa80, 0xaabe,
+ 0xaac0, 0xaac0,
+ 0xaac2, 0xaac2,
+ 0xaadb, 0xaadd,
+ 0xaae0, 0xaaef,
+ 0xaaf2, 0xaaf5,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabea,
+ 0xabf0, 0xabf9,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb28,
+ 0xfb2a, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff10, 0xff19,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11045,
+ 0x11066, 0x1106f,
+ 0x11082, 0x110b8,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11132,
+ 0x11136, 0x1113f,
+ 0x11180, 0x111bf,
+ 0x111c1, 0x111c4,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b5,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f93, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Alnum */
+
+/* 'ASCII': [[:ASCII:]] */
+static const OnigCodePoint CR_ASCII[] = {
+ 1,
+ 0x0000, 0x007f,
+}; /* CR_ASCII */
+
#ifdef USE_UNICODE_PROPERTIES
/* 'Any': - */
static const OnigCodePoint CR_Any[] = {
@@ -46,7 +4312,7 @@ static const OnigCodePoint CR_Any[] = {
/* 'Assigned': - */
static const OnigCodePoint CR_Assigned[] = {
- 501,
+ 539,
0x0000, 0x0377,
0x037a, 0x037e,
0x0384, 0x038a,
@@ -57,10 +4323,11 @@ static const OnigCodePoint CR_Assigned[] = {
0x0559, 0x055f,
0x0561, 0x0587,
0x0589, 0x058a,
+ 0x058f, 0x058f,
0x0591, 0x05c7,
0x05d0, 0x05ea,
0x05f0, 0x05f4,
- 0x0600, 0x0603,
+ 0x0600, 0x0604,
0x0606, 0x061b,
0x061e, 0x070d,
0x070f, 0x074a,
@@ -70,6 +4337,9 @@ static const OnigCodePoint CR_Assigned[] = {
0x0830, 0x083e,
0x0840, 0x085b,
0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
0x0900, 0x0977,
0x0979, 0x097f,
0x0981, 0x0983,
@@ -114,8 +4384,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x0acb, 0x0acd,
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0af1, 0x0af1,
+ 0x0ae6, 0x0af1,
0x0b01, 0x0b03,
0x0b05, 0x0b0c,
0x0b0f, 0x0b10,
@@ -215,7 +4484,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x0ec6, 0x0ec6,
0x0ec8, 0x0ecd,
0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f47,
0x0f49, 0x0f6c,
0x0f71, 0x0f97,
@@ -223,8 +4492,9 @@ static const OnigCodePoint CR_Assigned[] = {
0x0fbe, 0x0fcc,
0x0fce, 0x0fda,
0x1000, 0x10c5,
- 0x10d0, 0x10fc,
- 0x1100, 0x1248,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -277,13 +4547,12 @@ static const OnigCodePoint CR_Assigned[] = {
0x1aa0, 0x1aad,
0x1b00, 0x1b4b,
0x1b50, 0x1b7c,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1bf3,
+ 0x1b80, 0x1bf3,
0x1bfc, 0x1c37,
0x1c3b, 0x1c49,
0x1c4d, 0x1c7f,
- 0x1cd0, 0x1cf2,
+ 0x1cc0, 0x1cc7,
+ 0x1cd0, 0x1cf6,
0x1d00, 0x1de6,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
@@ -312,15 +4581,15 @@ static const OnigCodePoint CR_Assigned[] = {
0x2400, 0x2426,
0x2440, 0x244a,
0x2460, 0x26ff,
- 0x2701, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x2b4c,
+ 0x2701, 0x2b4c,
0x2b50, 0x2b59,
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
- 0x2c60, 0x2cf1,
+ 0x2c60, 0x2cf3,
0x2cf9, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d70,
0x2d7f, 0x2d96,
0x2da0, 0x2da6,
@@ -331,7 +4600,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x2dc8, 0x2dce,
0x2dd0, 0x2dd6,
0x2dd8, 0x2dde,
- 0x2de0, 0x2e31,
+ 0x2de0, 0x2e3b,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
0x2f00, 0x2fd5,
@@ -346,17 +4615,16 @@ static const OnigCodePoint CR_Assigned[] = {
0x31f0, 0x321e,
0x3220, 0x32fe,
0x3300, 0x4db5,
- 0x4dc0, 0x9fcb,
+ 0x4dc0, 0x9fcc,
0xa000, 0xa48c,
0xa490, 0xa4c6,
0xa4d0, 0xa62b,
- 0xa640, 0xa673,
- 0xa67c, 0xa697,
- 0xa6a0, 0xa6f7,
+ 0xa640, 0xa697,
+ 0xa69f, 0xa6f7,
0xa700, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa82b,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa82b,
0xa830, 0xa839,
0xa840, 0xa877,
0xa880, 0xa8c4,
@@ -372,7 +4640,7 @@ static const OnigCodePoint CR_Assigned[] = {
0xaa50, 0xaa59,
0xaa5c, 0xaa7b,
0xaa80, 0xaac2,
- 0xaadb, 0xaadf,
+ 0xaadb, 0xaaf6,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -383,8 +4651,7 @@ static const OnigCodePoint CR_Assigned[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xd800, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xd800, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -446,6 +4713,8 @@ static const OnigCodePoint CR_Assigned[] = {
0x10900, 0x1091b,
0x1091f, 0x10939,
0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a13,
@@ -464,11 +4733,22 @@ static const OnigCodePoint CR_Assigned[] = {
0x11000, 0x1104d,
0x11052, 0x1106f,
0x11080, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
0x12000, 0x1236e,
0x12400, 0x12462,
0x12470, 0x12473,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
0x1d000, 0x1d0f5,
0x1d100, 0x1d126,
@@ -497,6 +4777,40 @@ static const OnigCodePoint CR_Assigned[] = {
0x1d552, 0x1d6a5,
0x1d6a8, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
@@ -505,7 +4819,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x1f0d1, 0x1f0df,
0x1f100, 0x1f10a,
0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
+ 0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
0x1f1e6, 0x1f202,
0x1f210, 0x1f23a,
@@ -523,19 +4837,9 @@ static const OnigCodePoint CR_Assigned[] = {
0x1f442, 0x1f4f7,
0x1f4f9, 0x1f4fc,
0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
+ 0x1f5fb, 0x1f640,
0x1f645, 0x1f64f,
0x1f680, 0x1f6c5,
0x1f700, 0x1f773,
@@ -552,44 +4856,560 @@ static const OnigCodePoint CR_Assigned[] = {
/* 'C': Major Category */
static const OnigCodePoint CR_C[] = {
- 20,
+ 541,
0x0000, 0x001f,
0x007f, 0x009f,
0x00ad, 0x00ad,
- 0x0600, 0x0603,
+ 0x0378, 0x0379,
+ 0x037f, 0x0383,
+ 0x038b, 0x038b,
+ 0x038d, 0x038d,
+ 0x03a2, 0x03a2,
+ 0x0528, 0x0530,
+ 0x0557, 0x0558,
+ 0x0560, 0x0560,
+ 0x0588, 0x0588,
+ 0x058b, 0x058e,
+ 0x0590, 0x0590,
+ 0x05c8, 0x05cf,
+ 0x05eb, 0x05ef,
+ 0x05f5, 0x0605,
+ 0x061c, 0x061d,
0x06dd, 0x06dd,
- 0x070f, 0x070f,
- 0x17b4, 0x17b5,
+ 0x070e, 0x070f,
+ 0x074b, 0x074c,
+ 0x07b2, 0x07bf,
+ 0x07fb, 0x07ff,
+ 0x082e, 0x082f,
+ 0x083f, 0x083f,
+ 0x085c, 0x085d,
+ 0x085f, 0x089f,
+ 0x08a1, 0x08a1,
+ 0x08ad, 0x08e3,
+ 0x08ff, 0x08ff,
+ 0x0978, 0x0978,
+ 0x0980, 0x0980,
+ 0x0984, 0x0984,
+ 0x098d, 0x098e,
+ 0x0991, 0x0992,
+ 0x09a9, 0x09a9,
+ 0x09b1, 0x09b1,
+ 0x09b3, 0x09b5,
+ 0x09ba, 0x09bb,
+ 0x09c5, 0x09c6,
+ 0x09c9, 0x09ca,
+ 0x09cf, 0x09d6,
+ 0x09d8, 0x09db,
+ 0x09de, 0x09de,
+ 0x09e4, 0x09e5,
+ 0x09fc, 0x0a00,
+ 0x0a04, 0x0a04,
+ 0x0a0b, 0x0a0e,
+ 0x0a11, 0x0a12,
+ 0x0a29, 0x0a29,
+ 0x0a31, 0x0a31,
+ 0x0a34, 0x0a34,
+ 0x0a37, 0x0a37,
+ 0x0a3a, 0x0a3b,
+ 0x0a3d, 0x0a3d,
+ 0x0a43, 0x0a46,
+ 0x0a49, 0x0a4a,
+ 0x0a4e, 0x0a50,
+ 0x0a52, 0x0a58,
+ 0x0a5d, 0x0a5d,
+ 0x0a5f, 0x0a65,
+ 0x0a76, 0x0a80,
+ 0x0a84, 0x0a84,
+ 0x0a8e, 0x0a8e,
+ 0x0a92, 0x0a92,
+ 0x0aa9, 0x0aa9,
+ 0x0ab1, 0x0ab1,
+ 0x0ab4, 0x0ab4,
+ 0x0aba, 0x0abb,
+ 0x0ac6, 0x0ac6,
+ 0x0aca, 0x0aca,
+ 0x0ace, 0x0acf,
+ 0x0ad1, 0x0adf,
+ 0x0ae4, 0x0ae5,
+ 0x0af2, 0x0b00,
+ 0x0b04, 0x0b04,
+ 0x0b0d, 0x0b0e,
+ 0x0b11, 0x0b12,
+ 0x0b29, 0x0b29,
+ 0x0b31, 0x0b31,
+ 0x0b34, 0x0b34,
+ 0x0b3a, 0x0b3b,
+ 0x0b45, 0x0b46,
+ 0x0b49, 0x0b4a,
+ 0x0b4e, 0x0b55,
+ 0x0b58, 0x0b5b,
+ 0x0b5e, 0x0b5e,
+ 0x0b64, 0x0b65,
+ 0x0b78, 0x0b81,
+ 0x0b84, 0x0b84,
+ 0x0b8b, 0x0b8d,
+ 0x0b91, 0x0b91,
+ 0x0b96, 0x0b98,
+ 0x0b9b, 0x0b9b,
+ 0x0b9d, 0x0b9d,
+ 0x0ba0, 0x0ba2,
+ 0x0ba5, 0x0ba7,
+ 0x0bab, 0x0bad,
+ 0x0bba, 0x0bbd,
+ 0x0bc3, 0x0bc5,
+ 0x0bc9, 0x0bc9,
+ 0x0bce, 0x0bcf,
+ 0x0bd1, 0x0bd6,
+ 0x0bd8, 0x0be5,
+ 0x0bfb, 0x0c00,
+ 0x0c04, 0x0c04,
+ 0x0c0d, 0x0c0d,
+ 0x0c11, 0x0c11,
+ 0x0c29, 0x0c29,
+ 0x0c34, 0x0c34,
+ 0x0c3a, 0x0c3c,
+ 0x0c45, 0x0c45,
+ 0x0c49, 0x0c49,
+ 0x0c4e, 0x0c54,
+ 0x0c57, 0x0c57,
+ 0x0c5a, 0x0c5f,
+ 0x0c64, 0x0c65,
+ 0x0c70, 0x0c77,
+ 0x0c80, 0x0c81,
+ 0x0c84, 0x0c84,
+ 0x0c8d, 0x0c8d,
+ 0x0c91, 0x0c91,
+ 0x0ca9, 0x0ca9,
+ 0x0cb4, 0x0cb4,
+ 0x0cba, 0x0cbb,
+ 0x0cc5, 0x0cc5,
+ 0x0cc9, 0x0cc9,
+ 0x0cce, 0x0cd4,
+ 0x0cd7, 0x0cdd,
+ 0x0cdf, 0x0cdf,
+ 0x0ce4, 0x0ce5,
+ 0x0cf0, 0x0cf0,
+ 0x0cf3, 0x0d01,
+ 0x0d04, 0x0d04,
+ 0x0d0d, 0x0d0d,
+ 0x0d11, 0x0d11,
+ 0x0d3b, 0x0d3c,
+ 0x0d45, 0x0d45,
+ 0x0d49, 0x0d49,
+ 0x0d4f, 0x0d56,
+ 0x0d58, 0x0d5f,
+ 0x0d64, 0x0d65,
+ 0x0d76, 0x0d78,
+ 0x0d80, 0x0d81,
+ 0x0d84, 0x0d84,
+ 0x0d97, 0x0d99,
+ 0x0db2, 0x0db2,
+ 0x0dbc, 0x0dbc,
+ 0x0dbe, 0x0dbf,
+ 0x0dc7, 0x0dc9,
+ 0x0dcb, 0x0dce,
+ 0x0dd5, 0x0dd5,
+ 0x0dd7, 0x0dd7,
+ 0x0de0, 0x0df1,
+ 0x0df5, 0x0e00,
+ 0x0e3b, 0x0e3e,
+ 0x0e5c, 0x0e80,
+ 0x0e83, 0x0e83,
+ 0x0e85, 0x0e86,
+ 0x0e89, 0x0e89,
+ 0x0e8b, 0x0e8c,
+ 0x0e8e, 0x0e93,
+ 0x0e98, 0x0e98,
+ 0x0ea0, 0x0ea0,
+ 0x0ea4, 0x0ea4,
+ 0x0ea6, 0x0ea6,
+ 0x0ea8, 0x0ea9,
+ 0x0eac, 0x0eac,
+ 0x0eba, 0x0eba,
+ 0x0ebe, 0x0ebf,
+ 0x0ec5, 0x0ec5,
+ 0x0ec7, 0x0ec7,
+ 0x0ece, 0x0ecf,
+ 0x0eda, 0x0edb,
+ 0x0ee0, 0x0eff,
+ 0x0f48, 0x0f48,
+ 0x0f6d, 0x0f70,
+ 0x0f98, 0x0f98,
+ 0x0fbd, 0x0fbd,
+ 0x0fcd, 0x0fcd,
+ 0x0fdb, 0x0fff,
+ 0x10c6, 0x10c6,
+ 0x10c8, 0x10cc,
+ 0x10ce, 0x10cf,
+ 0x1249, 0x1249,
+ 0x124e, 0x124f,
+ 0x1257, 0x1257,
+ 0x1259, 0x1259,
+ 0x125e, 0x125f,
+ 0x1289, 0x1289,
+ 0x128e, 0x128f,
+ 0x12b1, 0x12b1,
+ 0x12b6, 0x12b7,
+ 0x12bf, 0x12bf,
+ 0x12c1, 0x12c1,
+ 0x12c6, 0x12c7,
+ 0x12d7, 0x12d7,
+ 0x1311, 0x1311,
+ 0x1316, 0x1317,
+ 0x135b, 0x135c,
+ 0x137d, 0x137f,
+ 0x139a, 0x139f,
+ 0x13f5, 0x13ff,
+ 0x169d, 0x169f,
+ 0x16f1, 0x16ff,
+ 0x170d, 0x170d,
+ 0x1715, 0x171f,
+ 0x1737, 0x173f,
+ 0x1754, 0x175f,
+ 0x176d, 0x176d,
+ 0x1771, 0x1771,
+ 0x1774, 0x177f,
+ 0x17de, 0x17df,
+ 0x17ea, 0x17ef,
+ 0x17fa, 0x17ff,
+ 0x180f, 0x180f,
+ 0x181a, 0x181f,
+ 0x1878, 0x187f,
+ 0x18ab, 0x18af,
+ 0x18f6, 0x18ff,
+ 0x191d, 0x191f,
+ 0x192c, 0x192f,
+ 0x193c, 0x193f,
+ 0x1941, 0x1943,
+ 0x196e, 0x196f,
+ 0x1975, 0x197f,
+ 0x19ac, 0x19af,
+ 0x19ca, 0x19cf,
+ 0x19db, 0x19dd,
+ 0x1a1c, 0x1a1d,
+ 0x1a5f, 0x1a5f,
+ 0x1a7d, 0x1a7e,
+ 0x1a8a, 0x1a8f,
+ 0x1a9a, 0x1a9f,
+ 0x1aae, 0x1aff,
+ 0x1b4c, 0x1b4f,
+ 0x1b7d, 0x1b7f,
+ 0x1bf4, 0x1bfb,
+ 0x1c38, 0x1c3a,
+ 0x1c4a, 0x1c4c,
+ 0x1c80, 0x1cbf,
+ 0x1cc8, 0x1ccf,
+ 0x1cf7, 0x1cff,
+ 0x1de7, 0x1dfb,
+ 0x1f16, 0x1f17,
+ 0x1f1e, 0x1f1f,
+ 0x1f46, 0x1f47,
+ 0x1f4e, 0x1f4f,
+ 0x1f58, 0x1f58,
+ 0x1f5a, 0x1f5a,
+ 0x1f5c, 0x1f5c,
+ 0x1f5e, 0x1f5e,
+ 0x1f7e, 0x1f7f,
+ 0x1fb5, 0x1fb5,
+ 0x1fc5, 0x1fc5,
+ 0x1fd4, 0x1fd5,
+ 0x1fdc, 0x1fdc,
+ 0x1ff0, 0x1ff1,
+ 0x1ff5, 0x1ff5,
+ 0x1fff, 0x1fff,
0x200b, 0x200f,
0x202a, 0x202e,
- 0x2060, 0x2064,
- 0x206a, 0x206f,
- 0xd800, 0xf8ff,
- 0xfeff, 0xfeff,
- 0xfff9, 0xfffb,
+ 0x2060, 0x206f,
+ 0x2072, 0x2073,
+ 0x208f, 0x208f,
+ 0x209d, 0x209f,
+ 0x20ba, 0x20cf,
+ 0x20f1, 0x20ff,
+ 0x218a, 0x218f,
+ 0x23f4, 0x23ff,
+ 0x2427, 0x243f,
+ 0x244b, 0x245f,
+ 0x2700, 0x2700,
+ 0x2b4d, 0x2b4f,
+ 0x2b5a, 0x2bff,
+ 0x2c2f, 0x2c2f,
+ 0x2c5f, 0x2c5f,
+ 0x2cf4, 0x2cf8,
+ 0x2d26, 0x2d26,
+ 0x2d28, 0x2d2c,
+ 0x2d2e, 0x2d2f,
+ 0x2d68, 0x2d6e,
+ 0x2d71, 0x2d7e,
+ 0x2d97, 0x2d9f,
+ 0x2da7, 0x2da7,
+ 0x2daf, 0x2daf,
+ 0x2db7, 0x2db7,
+ 0x2dbf, 0x2dbf,
+ 0x2dc7, 0x2dc7,
+ 0x2dcf, 0x2dcf,
+ 0x2dd7, 0x2dd7,
+ 0x2ddf, 0x2ddf,
+ 0x2e3c, 0x2e7f,
+ 0x2e9a, 0x2e9a,
+ 0x2ef4, 0x2eff,
+ 0x2fd6, 0x2fef,
+ 0x2ffc, 0x2fff,
+ 0x3040, 0x3040,
+ 0x3097, 0x3098,
+ 0x3100, 0x3104,
+ 0x312e, 0x3130,
+ 0x318f, 0x318f,
+ 0x31bb, 0x31bf,
+ 0x31e4, 0x31ef,
+ 0x321f, 0x321f,
+ 0x32ff, 0x32ff,
+ 0x4db6, 0x4dbf,
+ 0x9fcd, 0x9fff,
+ 0xa48d, 0xa48f,
+ 0xa4c7, 0xa4cf,
+ 0xa62c, 0xa63f,
+ 0xa698, 0xa69e,
+ 0xa6f8, 0xa6ff,
+ 0xa78f, 0xa78f,
+ 0xa794, 0xa79f,
+ 0xa7ab, 0xa7f7,
+ 0xa82c, 0xa82f,
+ 0xa83a, 0xa83f,
+ 0xa878, 0xa87f,
+ 0xa8c5, 0xa8cd,
+ 0xa8da, 0xa8df,
+ 0xa8fc, 0xa8ff,
+ 0xa954, 0xa95e,
+ 0xa97d, 0xa97f,
+ 0xa9ce, 0xa9ce,
+ 0xa9da, 0xa9dd,
+ 0xa9e0, 0xa9ff,
+ 0xaa37, 0xaa3f,
+ 0xaa4e, 0xaa4f,
+ 0xaa5a, 0xaa5b,
+ 0xaa7c, 0xaa7f,
+ 0xaac3, 0xaada,
+ 0xaaf7, 0xab00,
+ 0xab07, 0xab08,
+ 0xab0f, 0xab10,
+ 0xab17, 0xab1f,
+ 0xab27, 0xab27,
+ 0xab2f, 0xabbf,
+ 0xabee, 0xabef,
+ 0xabfa, 0xabff,
+ 0xd7a4, 0xd7af,
+ 0xd7c7, 0xd7ca,
+ 0xd7fc, 0xf8ff,
+ 0xfa6e, 0xfa6f,
+ 0xfada, 0xfaff,
+ 0xfb07, 0xfb12,
+ 0xfb18, 0xfb1c,
+ 0xfb37, 0xfb37,
+ 0xfb3d, 0xfb3d,
+ 0xfb3f, 0xfb3f,
+ 0xfb42, 0xfb42,
+ 0xfb45, 0xfb45,
+ 0xfbc2, 0xfbd2,
+ 0xfd40, 0xfd4f,
+ 0xfd90, 0xfd91,
+ 0xfdc8, 0xfdef,
+ 0xfdfe, 0xfdff,
+ 0xfe1a, 0xfe1f,
+ 0xfe27, 0xfe2f,
+ 0xfe53, 0xfe53,
+ 0xfe67, 0xfe67,
+ 0xfe6c, 0xfe6f,
+ 0xfe75, 0xfe75,
+ 0xfefd, 0xff00,
+ 0xffbf, 0xffc1,
+ 0xffc8, 0xffc9,
+ 0xffd0, 0xffd1,
+ 0xffd8, 0xffd9,
+ 0xffdd, 0xffdf,
+ 0xffe7, 0xffe7,
+ 0xffef, 0xfffb,
+ 0xfffe, 0xffff,
+ 0x1000c, 0x1000c,
+ 0x10027, 0x10027,
+ 0x1003b, 0x1003b,
+ 0x1003e, 0x1003e,
+ 0x1004e, 0x1004f,
+ 0x1005e, 0x1007f,
+ 0x100fb, 0x100ff,
+ 0x10103, 0x10106,
+ 0x10134, 0x10136,
+ 0x1018b, 0x1018f,
+ 0x1019c, 0x101cf,
+ 0x101fe, 0x1027f,
+ 0x1029d, 0x1029f,
+ 0x102d1, 0x102ff,
+ 0x1031f, 0x1031f,
+ 0x10324, 0x1032f,
+ 0x1034b, 0x1037f,
+ 0x1039e, 0x1039e,
+ 0x103c4, 0x103c7,
+ 0x103d6, 0x103ff,
+ 0x1049e, 0x1049f,
+ 0x104aa, 0x107ff,
+ 0x10806, 0x10807,
+ 0x10809, 0x10809,
+ 0x10836, 0x10836,
+ 0x10839, 0x1083b,
+ 0x1083d, 0x1083e,
+ 0x10856, 0x10856,
+ 0x10860, 0x108ff,
+ 0x1091c, 0x1091e,
+ 0x1093a, 0x1093e,
+ 0x10940, 0x1097f,
+ 0x109b8, 0x109bd,
+ 0x109c0, 0x109ff,
+ 0x10a04, 0x10a04,
+ 0x10a07, 0x10a0b,
+ 0x10a14, 0x10a14,
+ 0x10a18, 0x10a18,
+ 0x10a34, 0x10a37,
+ 0x10a3b, 0x10a3e,
+ 0x10a48, 0x10a4f,
+ 0x10a59, 0x10a5f,
+ 0x10a80, 0x10aff,
+ 0x10b36, 0x10b38,
+ 0x10b56, 0x10b57,
+ 0x10b73, 0x10b77,
+ 0x10b80, 0x10bff,
+ 0x10c49, 0x10e5f,
+ 0x10e7f, 0x10fff,
+ 0x1104e, 0x11051,
+ 0x11070, 0x1107f,
0x110bd, 0x110bd,
+ 0x110c2, 0x110cf,
+ 0x110e9, 0x110ef,
+ 0x110fa, 0x110ff,
+ 0x11135, 0x11135,
+ 0x11144, 0x1117f,
+ 0x111c9, 0x111cf,
+ 0x111da, 0x1167f,
+ 0x116b8, 0x116bf,
+ 0x116ca, 0x11fff,
+ 0x1236f, 0x123ff,
+ 0x12463, 0x1246f,
+ 0x12474, 0x12fff,
+ 0x1342f, 0x167ff,
+ 0x16a39, 0x16eff,
+ 0x16f45, 0x16f4f,
+ 0x16f7f, 0x16f8e,
+ 0x16fa0, 0x1afff,
+ 0x1b002, 0x1cfff,
+ 0x1d0f6, 0x1d0ff,
+ 0x1d127, 0x1d128,
0x1d173, 0x1d17a,
- 0xe0001, 0xe0001,
- 0xe0020, 0xe007f,
- 0xf0000, 0xffffd,
- 0x100000, 0x10ffff,
+ 0x1d1de, 0x1d1ff,
+ 0x1d246, 0x1d2ff,
+ 0x1d357, 0x1d35f,
+ 0x1d372, 0x1d3ff,
+ 0x1d455, 0x1d455,
+ 0x1d49d, 0x1d49d,
+ 0x1d4a0, 0x1d4a1,
+ 0x1d4a3, 0x1d4a4,
+ 0x1d4a7, 0x1d4a8,
+ 0x1d4ad, 0x1d4ad,
+ 0x1d4ba, 0x1d4ba,
+ 0x1d4bc, 0x1d4bc,
+ 0x1d4c4, 0x1d4c4,
+ 0x1d506, 0x1d506,
+ 0x1d50b, 0x1d50c,
+ 0x1d515, 0x1d515,
+ 0x1d51d, 0x1d51d,
+ 0x1d53a, 0x1d53a,
+ 0x1d53f, 0x1d53f,
+ 0x1d545, 0x1d545,
+ 0x1d547, 0x1d549,
+ 0x1d551, 0x1d551,
+ 0x1d6a6, 0x1d6a7,
+ 0x1d7cc, 0x1d7cd,
+ 0x1d800, 0x1edff,
+ 0x1ee04, 0x1ee04,
+ 0x1ee20, 0x1ee20,
+ 0x1ee23, 0x1ee23,
+ 0x1ee25, 0x1ee26,
+ 0x1ee28, 0x1ee28,
+ 0x1ee33, 0x1ee33,
+ 0x1ee38, 0x1ee38,
+ 0x1ee3a, 0x1ee3a,
+ 0x1ee3c, 0x1ee41,
+ 0x1ee43, 0x1ee46,
+ 0x1ee48, 0x1ee48,
+ 0x1ee4a, 0x1ee4a,
+ 0x1ee4c, 0x1ee4c,
+ 0x1ee50, 0x1ee50,
+ 0x1ee53, 0x1ee53,
+ 0x1ee55, 0x1ee56,
+ 0x1ee58, 0x1ee58,
+ 0x1ee5a, 0x1ee5a,
+ 0x1ee5c, 0x1ee5c,
+ 0x1ee5e, 0x1ee5e,
+ 0x1ee60, 0x1ee60,
+ 0x1ee63, 0x1ee63,
+ 0x1ee65, 0x1ee66,
+ 0x1ee6b, 0x1ee6b,
+ 0x1ee73, 0x1ee73,
+ 0x1ee78, 0x1ee78,
+ 0x1ee7d, 0x1ee7d,
+ 0x1ee7f, 0x1ee7f,
+ 0x1ee8a, 0x1ee8a,
+ 0x1ee9c, 0x1eea0,
+ 0x1eea4, 0x1eea4,
+ 0x1eeaa, 0x1eeaa,
+ 0x1eebc, 0x1eeef,
+ 0x1eef2, 0x1efff,
+ 0x1f02c, 0x1f02f,
+ 0x1f094, 0x1f09f,
+ 0x1f0af, 0x1f0b0,
+ 0x1f0bf, 0x1f0c0,
+ 0x1f0d0, 0x1f0d0,
+ 0x1f0e0, 0x1f0ff,
+ 0x1f10b, 0x1f10f,
+ 0x1f12f, 0x1f12f,
+ 0x1f16c, 0x1f16f,
+ 0x1f19b, 0x1f1e5,
+ 0x1f203, 0x1f20f,
+ 0x1f23b, 0x1f23f,
+ 0x1f249, 0x1f24f,
+ 0x1f252, 0x1f2ff,
+ 0x1f321, 0x1f32f,
+ 0x1f336, 0x1f336,
+ 0x1f37d, 0x1f37f,
+ 0x1f394, 0x1f39f,
+ 0x1f3c5, 0x1f3c5,
+ 0x1f3cb, 0x1f3df,
+ 0x1f3f1, 0x1f3ff,
+ 0x1f43f, 0x1f43f,
+ 0x1f441, 0x1f441,
+ 0x1f4f8, 0x1f4f8,
+ 0x1f4fd, 0x1f4ff,
+ 0x1f53e, 0x1f53f,
+ 0x1f544, 0x1f54f,
+ 0x1f568, 0x1f5fa,
+ 0x1f641, 0x1f644,
+ 0x1f650, 0x1f67f,
+ 0x1f6c6, 0x1f6ff,
+ 0x1f774, 0x1ffff,
+ 0x2a6d7, 0x2a6ff,
+ 0x2b735, 0x2b73f,
+ 0x2b81e, 0x2f7ff,
+ 0x2fa1e, 0xe00ff,
+ 0xe01f0, 0x10ffff,
}; /* CR_C */
/* 'Cc': General Category */
-static const OnigCodePoint CR_Cc[] = {
- 2,
- 0x0000, 0x001f,
- 0x007f, 0x009f,
-}; /* CR_Cc */
+#define CR_Cc CR_Cntrl
/* 'Cf': General Category */
static const OnigCodePoint CR_Cf[] = {
- 15,
+ 14,
0x00ad, 0x00ad,
- 0x0600, 0x0603,
+ 0x0600, 0x0604,
0x06dd, 0x06dd,
0x070f, 0x070f,
- 0x17b4, 0x17b5,
0x200b, 0x200f,
0x202a, 0x202e,
0x2060, 0x2064,
@@ -604,7 +5424,7 @@ static const OnigCodePoint CR_Cf[] = {
/* 'Cn': General Category */
static const OnigCodePoint CR_Cn[] = {
- 501,
+ 539,
0x0378, 0x0379,
0x037f, 0x0383,
0x038b, 0x038b,
@@ -614,11 +5434,12 @@ static const OnigCodePoint CR_Cn[] = {
0x0557, 0x0558,
0x0560, 0x0560,
0x0588, 0x0588,
- 0x058b, 0x0590,
+ 0x058b, 0x058e,
+ 0x0590, 0x0590,
0x05c8, 0x05cf,
0x05eb, 0x05ef,
0x05f5, 0x05ff,
- 0x0604, 0x0605,
+ 0x0605, 0x0605,
0x061c, 0x061d,
0x070e, 0x070e,
0x074b, 0x074c,
@@ -627,7 +5448,10 @@ static const OnigCodePoint CR_Cn[] = {
0x082e, 0x082f,
0x083f, 0x083f,
0x085c, 0x085d,
- 0x085f, 0x08ff,
+ 0x085f, 0x089f,
+ 0x08a1, 0x08a1,
+ 0x08ad, 0x08e3,
+ 0x08ff, 0x08ff,
0x0978, 0x0978,
0x0980, 0x0980,
0x0984, 0x0984,
@@ -672,7 +5496,6 @@ static const OnigCodePoint CR_Cn[] = {
0x0ace, 0x0acf,
0x0ad1, 0x0adf,
0x0ae4, 0x0ae5,
- 0x0af0, 0x0af0,
0x0af2, 0x0b00,
0x0b04, 0x0b04,
0x0b0d, 0x0b0e,
@@ -773,15 +5596,16 @@ static const OnigCodePoint CR_Cn[] = {
0x0ec7, 0x0ec7,
0x0ece, 0x0ecf,
0x0eda, 0x0edb,
- 0x0ede, 0x0eff,
+ 0x0ee0, 0x0eff,
0x0f48, 0x0f48,
0x0f6d, 0x0f70,
0x0f98, 0x0f98,
0x0fbd, 0x0fbd,
0x0fcd, 0x0fcd,
0x0fdb, 0x0fff,
- 0x10c6, 0x10cf,
- 0x10fd, 0x10ff,
+ 0x10c6, 0x10c6,
+ 0x10c8, 0x10cc,
+ 0x10ce, 0x10cf,
0x1249, 0x1249,
0x124e, 0x124f,
0x1257, 0x1257,
@@ -835,13 +5659,12 @@ static const OnigCodePoint CR_Cn[] = {
0x1aae, 0x1aff,
0x1b4c, 0x1b4f,
0x1b7d, 0x1b7f,
- 0x1bab, 0x1bad,
- 0x1bba, 0x1bbf,
0x1bf4, 0x1bfb,
0x1c38, 0x1c3a,
0x1c4a, 0x1c4c,
- 0x1c80, 0x1ccf,
- 0x1cf3, 0x1cff,
+ 0x1c80, 0x1cbf,
+ 0x1cc8, 0x1ccf,
+ 0x1cf7, 0x1cff,
0x1de7, 0x1dfb,
0x1f16, 0x1f17,
0x1f1e, 0x1f1f,
@@ -870,15 +5693,15 @@ static const OnigCodePoint CR_Cn[] = {
0x2427, 0x243f,
0x244b, 0x245f,
0x2700, 0x2700,
- 0x27cb, 0x27cb,
- 0x27cd, 0x27cd,
0x2b4d, 0x2b4f,
0x2b5a, 0x2bff,
0x2c2f, 0x2c2f,
0x2c5f, 0x2c5f,
- 0x2cf2, 0x2cf8,
- 0x2d26, 0x2d2f,
- 0x2d66, 0x2d6e,
+ 0x2cf4, 0x2cf8,
+ 0x2d26, 0x2d26,
+ 0x2d28, 0x2d2c,
+ 0x2d2e, 0x2d2f,
+ 0x2d68, 0x2d6e,
0x2d71, 0x2d7e,
0x2d97, 0x2d9f,
0x2da7, 0x2da7,
@@ -889,7 +5712,7 @@ static const OnigCodePoint CR_Cn[] = {
0x2dcf, 0x2dcf,
0x2dd7, 0x2dd7,
0x2ddf, 0x2ddf,
- 0x2e32, 0x2e7f,
+ 0x2e3c, 0x2e7f,
0x2e9a, 0x2e9a,
0x2ef4, 0x2eff,
0x2fd6, 0x2fef,
@@ -904,16 +5727,15 @@ static const OnigCodePoint CR_Cn[] = {
0x321f, 0x321f,
0x32ff, 0x32ff,
0x4db6, 0x4dbf,
- 0x9fcc, 0x9fff,
+ 0x9fcd, 0x9fff,
0xa48d, 0xa48f,
0xa4c7, 0xa4cf,
0xa62c, 0xa63f,
- 0xa674, 0xa67b,
- 0xa698, 0xa69f,
+ 0xa698, 0xa69e,
0xa6f8, 0xa6ff,
0xa78f, 0xa78f,
- 0xa792, 0xa79f,
- 0xa7aa, 0xa7f9,
+ 0xa794, 0xa79f,
+ 0xa7ab, 0xa7f7,
0xa82c, 0xa82f,
0xa83a, 0xa83f,
0xa878, 0xa87f,
@@ -930,7 +5752,7 @@ static const OnigCodePoint CR_Cn[] = {
0xaa5a, 0xaa5b,
0xaa7c, 0xaa7f,
0xaac3, 0xaada,
- 0xaae0, 0xab00,
+ 0xaaf7, 0xab00,
0xab07, 0xab08,
0xab0f, 0xab10,
0xab17, 0xab1f,
@@ -941,7 +5763,6 @@ static const OnigCodePoint CR_Cn[] = {
0xd7a4, 0xd7af,
0xd7c7, 0xd7ca,
0xd7fc, 0xd7ff,
- 0xfa2e, 0xfa2f,
0xfa6e, 0xfa6f,
0xfada, 0xfaff,
0xfb07, 0xfb12,
@@ -1003,7 +5824,9 @@ static const OnigCodePoint CR_Cn[] = {
0x10860, 0x108ff,
0x1091c, 0x1091e,
0x1093a, 0x1093e,
- 0x10940, 0x109ff,
+ 0x10940, 0x1097f,
+ 0x109b8, 0x109bd,
+ 0x109c0, 0x109ff,
0x10a04, 0x10a04,
0x10a07, 0x10a0b,
0x10a14, 0x10a14,
@@ -1021,12 +5844,23 @@ static const OnigCodePoint CR_Cn[] = {
0x10e7f, 0x10fff,
0x1104e, 0x11051,
0x11070, 0x1107f,
- 0x110c2, 0x11fff,
+ 0x110c2, 0x110cf,
+ 0x110e9, 0x110ef,
+ 0x110fa, 0x110ff,
+ 0x11135, 0x11135,
+ 0x11144, 0x1117f,
+ 0x111c9, 0x111cf,
+ 0x111da, 0x1167f,
+ 0x116b8, 0x116bf,
+ 0x116ca, 0x11fff,
0x1236f, 0x123ff,
0x12463, 0x1246f,
0x12474, 0x12fff,
0x1342f, 0x167ff,
- 0x16a39, 0x1afff,
+ 0x16a39, 0x16eff,
+ 0x16f45, 0x16f4f,
+ 0x16f7f, 0x16f8e,
+ 0x16fa0, 0x1afff,
0x1b002, 0x1cfff,
0x1d0f6, 0x1d0ff,
0x1d127, 0x1d128,
@@ -1054,7 +5888,41 @@ static const OnigCodePoint CR_Cn[] = {
0x1d551, 0x1d551,
0x1d6a6, 0x1d6a7,
0x1d7cc, 0x1d7cd,
- 0x1d800, 0x1efff,
+ 0x1d800, 0x1edff,
+ 0x1ee04, 0x1ee04,
+ 0x1ee20, 0x1ee20,
+ 0x1ee23, 0x1ee23,
+ 0x1ee25, 0x1ee26,
+ 0x1ee28, 0x1ee28,
+ 0x1ee33, 0x1ee33,
+ 0x1ee38, 0x1ee38,
+ 0x1ee3a, 0x1ee3a,
+ 0x1ee3c, 0x1ee41,
+ 0x1ee43, 0x1ee46,
+ 0x1ee48, 0x1ee48,
+ 0x1ee4a, 0x1ee4a,
+ 0x1ee4c, 0x1ee4c,
+ 0x1ee50, 0x1ee50,
+ 0x1ee53, 0x1ee53,
+ 0x1ee55, 0x1ee56,
+ 0x1ee58, 0x1ee58,
+ 0x1ee5a, 0x1ee5a,
+ 0x1ee5c, 0x1ee5c,
+ 0x1ee5e, 0x1ee5e,
+ 0x1ee60, 0x1ee60,
+ 0x1ee63, 0x1ee63,
+ 0x1ee65, 0x1ee66,
+ 0x1ee6b, 0x1ee6b,
+ 0x1ee73, 0x1ee73,
+ 0x1ee78, 0x1ee78,
+ 0x1ee7d, 0x1ee7d,
+ 0x1ee7f, 0x1ee7f,
+ 0x1ee8a, 0x1ee8a,
+ 0x1ee9c, 0x1eea0,
+ 0x1eea4, 0x1eea4,
+ 0x1eeaa, 0x1eeaa,
+ 0x1eebc, 0x1eeef,
+ 0x1eef2, 0x1efff,
0x1f02c, 0x1f02f,
0x1f094, 0x1f09f,
0x1f0af, 0x1f0b0,
@@ -1063,7 +5931,7 @@ static const OnigCodePoint CR_Cn[] = {
0x1f0e0, 0x1f0ff,
0x1f10b, 0x1f10f,
0x1f12f, 0x1f12f,
- 0x1f16a, 0x1f16f,
+ 0x1f16c, 0x1f16f,
0x1f19b, 0x1f1e5,
0x1f203, 0x1f20f,
0x1f23b, 0x1f23f,
@@ -1080,19 +5948,9 @@ static const OnigCodePoint CR_Cn[] = {
0x1f441, 0x1f441,
0x1f4f8, 0x1f4f8,
0x1f4fd, 0x1f4ff,
- 0x1f53e, 0x1f54f,
+ 0x1f53e, 0x1f53f,
+ 0x1f544, 0x1f54f,
0x1f568, 0x1f5fa,
- 0x1f600, 0x1f600,
- 0x1f611, 0x1f611,
- 0x1f615, 0x1f615,
- 0x1f617, 0x1f617,
- 0x1f619, 0x1f619,
- 0x1f61b, 0x1f61b,
- 0x1f61f, 0x1f61f,
- 0x1f626, 0x1f627,
- 0x1f62c, 0x1f62c,
- 0x1f62e, 0x1f62f,
- 0x1f634, 0x1f634,
0x1f641, 0x1f644,
0x1f650, 0x1f67f,
0x1f6c6, 0x1f6ff,
@@ -1124,7 +5982,7 @@ static const OnigCodePoint CR_Cs[] = {
/* 'L': Major Category */
static const OnigCodePoint CR_L[] = {
- 435,
+ 486,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -1172,6 +6030,8 @@ static const OnigCodePoint CR_L[] = {
0x0824, 0x0824,
0x0828, 0x0828,
0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
0x0904, 0x0939,
0x093d, 0x093d,
0x0950, 0x0950,
@@ -1277,7 +6137,7 @@ static const OnigCodePoint CR_L[] = {
0x0ebd, 0x0ebd,
0x0ec0, 0x0ec4,
0x0ec6, 0x0ec6,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f00,
0x0f40, 0x0f47,
0x0f49, 0x0f6c,
@@ -1292,9 +6152,10 @@ static const OnigCodePoint CR_L[] = {
0x1075, 0x1081,
0x108e, 0x108e,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
+ 0x10fc, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -1341,12 +6202,13 @@ static const OnigCodePoint CR_L[] = {
0x1b45, 0x1b4b,
0x1b83, 0x1ba0,
0x1bae, 0x1baf,
- 0x1bc0, 0x1be5,
+ 0x1bba, 0x1be5,
0x1c00, 0x1c23,
0x1c4d, 0x1c4f,
0x1c5a, 0x1c7d,
0x1ce9, 0x1cec,
0x1cee, 0x1cf1,
+ 0x1cf5, 0x1cf6,
0x1d00, 0x1dbf,
0x1e00, 0x1f15,
0x1f18, 0x1f1d,
@@ -1388,8 +6250,11 @@ static const OnigCodePoint CR_L[] = {
0x2c30, 0x2c5e,
0x2c60, 0x2ce4,
0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d6f,
0x2d80, 0x2d96,
0x2da0, 0x2da6,
@@ -1413,7 +6278,7 @@ static const OnigCodePoint CR_L[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
@@ -1425,9 +6290,9 @@ static const OnigCodePoint CR_L[] = {
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa801,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa822,
@@ -1452,6 +6317,8 @@ static const OnigCodePoint CR_L[] = {
0xaac0, 0xaac0,
0xaac2, 0xaac2,
0xaadb, 0xaadd,
+ 0xaae0, 0xaaea,
+ 0xaaf2, 0xaaf4,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -1461,8 +6328,7 @@ static const OnigCodePoint CR_L[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -1511,6 +6377,8 @@ static const OnigCodePoint CR_L[] = {
0x1083f, 0x10855,
0x10900, 0x10915,
0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a00,
0x10a10, 0x10a13,
0x10a15, 0x10a17,
@@ -1522,9 +6390,17 @@ static const OnigCodePoint CR_L[] = {
0x10c00, 0x10c48,
0x11003, 0x11037,
0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
0x12000, 0x1236e,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f50,
+ 0x16f93, 0x16f9f,
0x1b000, 0x1b001,
0x1d400, 0x1d454,
0x1d456, 0x1d49c,
@@ -1556,19 +6432,168 @@ static const OnigCodePoint CR_L[] = {
0x1d78a, 0x1d7a8,
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
0x2f800, 0x2fa1d,
}; /* CR_L */
+/* 'LC': General Category */
+static const OnigCodePoint CR_LC[] = {
+ 113,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00b5, 0x00b5,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x01ba,
+ 0x01bc, 0x01bf,
+ 0x01c4, 0x0293,
+ 0x0295, 0x02af,
+ 0x0370, 0x0373,
+ 0x0376, 0x0377,
+ 0x037b, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0561, 0x0587,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x1d00, 0x1d2b,
+ 0x1d6b, 0x1d77,
+ 0x1d79, 0x1d9a,
+ 0x1e00, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fbc,
+ 0x1fbe, 0x1fbe,
+ 0x1fc2, 0x1fc4,
+ 0x1fc6, 0x1fcc,
+ 0x1fd0, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fe0, 0x1fec,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffc,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210a, 0x2113,
+ 0x2115, 0x2115,
+ 0x2119, 0x211d,
+ 0x2124, 0x2124,
+ 0x2126, 0x2126,
+ 0x2128, 0x2128,
+ 0x212a, 0x212d,
+ 0x212f, 0x2134,
+ 0x2139, 0x2139,
+ 0x213c, 0x213f,
+ 0x2145, 0x2149,
+ 0x214e, 0x214e,
+ 0x2183, 0x2184,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2c7b,
+ 0x2c7e, 0x2ce4,
+ 0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0xa640, 0xa66d,
+ 0xa680, 0xa697,
+ 0xa722, 0xa76f,
+ 0xa771, 0xa787,
+ 0xa78b, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7fa, 0xa7fa,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0x10400, 0x1044f,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+}; /* CR_LC */
+
/* 'Ll': General Category */
static const OnigCodePoint CR_Ll[] = {
- 609,
+ 611,
0x0061, 0x007a,
- 0x00aa, 0x00aa,
0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
0x00df, 0x00f6,
0x00f8, 0x00ff,
0x0101, 0x0101,
@@ -1834,7 +6859,7 @@ static const OnigCodePoint CR_Ll[] = {
0x0527, 0x0527,
0x0561, 0x0587,
0x1d00, 0x1d2b,
- 0x1d62, 0x1d77,
+ 0x1d6b, 0x1d77,
0x1d79, 0x1d9a,
0x1e01, 0x1e01,
0x1e03, 0x1e03,
@@ -1998,7 +7023,7 @@ static const OnigCodePoint CR_Ll[] = {
0x2c6c, 0x2c6c,
0x2c71, 0x2c71,
0x2c73, 0x2c74,
- 0x2c76, 0x2c7c,
+ 0x2c76, 0x2c7b,
0x2c81, 0x2c81,
0x2c83, 0x2c83,
0x2c85, 0x2c85,
@@ -2051,7 +7076,10 @@ static const OnigCodePoint CR_Ll[] = {
0x2ce3, 0x2ce4,
0x2cec, 0x2cec,
0x2cee, 0x2cee,
+ 0x2cf3, 0x2cf3,
0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
0xa641, 0xa641,
0xa643, 0xa643,
0xa645, 0xa645,
@@ -2136,6 +7164,7 @@ static const OnigCodePoint CR_Ll[] = {
0xa78c, 0xa78c,
0xa78e, 0xa78e,
0xa791, 0xa791,
+ 0xa793, 0xa793,
0xa7a1, 0xa7a1,
0xa7a3, 0xa7a3,
0xa7a5, 0xa7a5,
@@ -2178,7 +7207,7 @@ static const OnigCodePoint CR_Ll[] = {
/* 'Lm': General Category */
static const OnigCodePoint CR_Lm[] = {
- 49,
+ 52,
0x02b0, 0x02c1,
0x02c6, 0x02d1,
0x02e0, 0x02e4,
@@ -2202,13 +7231,13 @@ static const OnigCodePoint CR_Lm[] = {
0x1843, 0x1843,
0x1aa7, 0x1aa7,
0x1c78, 0x1c7d,
- 0x1d2c, 0x1d61,
+ 0x1d2c, 0x1d6a,
0x1d78, 0x1d78,
0x1d9b, 0x1dbf,
0x2071, 0x2071,
0x207f, 0x207f,
0x2090, 0x209c,
- 0x2c7d, 0x2c7d,
+ 0x2c7c, 0x2c7d,
0x2d6f, 0x2d6f,
0x2e2f, 0x2e2f,
0x3005, 0x3005,
@@ -2223,16 +7252,21 @@ static const OnigCodePoint CR_Lm[] = {
0xa717, 0xa71f,
0xa770, 0xa770,
0xa788, 0xa788,
+ 0xa7f8, 0xa7f9,
0xa9cf, 0xa9cf,
0xaa70, 0xaa70,
0xaadd, 0xaadd,
+ 0xaaf3, 0xaaf4,
0xff70, 0xff70,
0xff9e, 0xff9f,
+ 0x16f93, 0x16f9f,
}; /* CR_Lm */
/* 'Lo': General Category */
static const OnigCodePoint CR_Lo[] = {
- 323,
+ 371,
+ 0x00aa, 0x00aa,
+ 0x00ba, 0x00ba,
0x01bb, 0x01bb,
0x01c0, 0x01c3,
0x0294, 0x0294,
@@ -2253,6 +7287,8 @@ static const OnigCodePoint CR_Lo[] = {
0x07ca, 0x07ea,
0x0800, 0x0815,
0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
0x0904, 0x0939,
0x093d, 0x093d,
0x0950, 0x0950,
@@ -2357,7 +7393,7 @@ static const OnigCodePoint CR_Lo[] = {
0x0eb2, 0x0eb3,
0x0ebd, 0x0ebd,
0x0ec0, 0x0ec4,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f00,
0x0f40, 0x0f47,
0x0f49, 0x0f6c,
@@ -2372,7 +7408,7 @@ static const OnigCodePoint CR_Lo[] = {
0x1075, 0x1081,
0x108e, 0x108e,
0x10d0, 0x10fa,
- 0x1100, 0x1248,
+ 0x10fd, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -2418,14 +7454,15 @@ static const OnigCodePoint CR_Lo[] = {
0x1b45, 0x1b4b,
0x1b83, 0x1ba0,
0x1bae, 0x1baf,
- 0x1bc0, 0x1be5,
+ 0x1bba, 0x1be5,
0x1c00, 0x1c23,
0x1c4d, 0x1c4f,
0x1c5a, 0x1c77,
0x1ce9, 0x1cec,
0x1cee, 0x1cf1,
+ 0x1cf5, 0x1cf6,
0x2135, 0x2138,
- 0x2d30, 0x2d65,
+ 0x2d30, 0x2d67,
0x2d80, 0x2d96,
0x2da0, 0x2da6,
0x2da8, 0x2dae,
@@ -2446,7 +7483,7 @@ static const OnigCodePoint CR_Lo[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xa000, 0xa014,
0xa016, 0xa48c,
0xa4d0, 0xa4f7,
@@ -2480,6 +7517,8 @@ static const OnigCodePoint CR_Lo[] = {
0xaac0, 0xaac0,
0xaac2, 0xaac2,
0xaadb, 0xaadc,
+ 0xaae0, 0xaaea,
+ 0xaaf2, 0xaaf2,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -2489,8 +7528,7 @@ static const OnigCodePoint CR_Lo[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb1d, 0xfb1d,
0xfb1f, 0xfb28,
@@ -2537,6 +7575,8 @@ static const OnigCodePoint CR_Lo[] = {
0x1083f, 0x10855,
0x10900, 0x10915,
0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a00,
0x10a10, 0x10a13,
0x10a15, 0x10a17,
@@ -2548,10 +7588,50 @@ static const OnigCodePoint CR_Lo[] = {
0x10c00, 0x10c48,
0x11003, 0x11037,
0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
0x12000, 0x1236e,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f50,
0x1b000, 0x1b001,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -2575,7 +7655,7 @@ static const OnigCodePoint CR_Lt[] = {
/* 'Lu': General Category */
static const OnigCodePoint CR_Lu[] = {
- 603,
+ 608,
0x0041, 0x005a,
0x00c0, 0x00d6,
0x00d8, 0x00de,
@@ -2844,6 +7924,8 @@ static const OnigCodePoint CR_Lu[] = {
0x0526, 0x0526,
0x0531, 0x0556,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x1e00, 0x1e00,
0x1e02, 0x1e02,
0x1e04, 0x1e04,
@@ -3058,6 +8140,7 @@ static const OnigCodePoint CR_Lu[] = {
0x2ce2, 0x2ce2,
0x2ceb, 0x2ceb,
0x2ced, 0x2ced,
+ 0x2cf2, 0x2cf2,
0xa640, 0xa640,
0xa642, 0xa642,
0xa644, 0xa644,
@@ -3141,11 +8224,13 @@ static const OnigCodePoint CR_Lu[] = {
0xa78b, 0xa78b,
0xa78d, 0xa78d,
0xa790, 0xa790,
+ 0xa792, 0xa792,
0xa7a0, 0xa7a0,
0xa7a2, 0xa7a2,
0xa7a4, 0xa7a4,
0xa7a6, 0xa7a6,
0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
0xff21, 0xff3a,
0x10400, 0x10427,
0x1d400, 0x1d419,
@@ -3183,7 +8268,7 @@ static const OnigCodePoint CR_Lu[] = {
/* 'M': Major Category */
static const OnigCodePoint CR_M[] = {
- 193,
+ 204,
0x0300, 0x036f,
0x0483, 0x0489,
0x0591, 0x05bd,
@@ -3207,6 +8292,7 @@ static const OnigCodePoint CR_M[] = {
0x0825, 0x0827,
0x0829, 0x082d,
0x0859, 0x085b,
+ 0x08e4, 0x08fe,
0x0900, 0x0903,
0x093a, 0x093c,
0x093e, 0x094f,
@@ -3301,7 +8387,7 @@ static const OnigCodePoint CR_M[] = {
0x1732, 0x1734,
0x1752, 0x1753,
0x1772, 0x1773,
- 0x17b6, 0x17d3,
+ 0x17b4, 0x17d3,
0x17dd, 0x17dd,
0x180b, 0x180d,
0x18a9, 0x18a9,
@@ -3317,13 +8403,13 @@ static const OnigCodePoint CR_M[] = {
0x1b34, 0x1b44,
0x1b6b, 0x1b73,
0x1b80, 0x1b82,
- 0x1ba1, 0x1baa,
+ 0x1ba1, 0x1bad,
0x1be6, 0x1bf3,
0x1c24, 0x1c37,
0x1cd0, 0x1cd2,
0x1cd4, 0x1ce8,
0x1ced, 0x1ced,
- 0x1cf2, 0x1cf2,
+ 0x1cf2, 0x1cf4,
0x1dc0, 0x1de6,
0x1dfc, 0x1dff,
0x20d0, 0x20f0,
@@ -3333,7 +8419,8 @@ static const OnigCodePoint CR_M[] = {
0x302a, 0x302f,
0x3099, 0x309a,
0xa66f, 0xa672,
- 0xa67c, 0xa67d,
+ 0xa674, 0xa67d,
+ 0xa69f, 0xa69f,
0xa6f0, 0xa6f1,
0xa802, 0xa802,
0xa806, 0xa806,
@@ -3355,6 +8442,8 @@ static const OnigCodePoint CR_M[] = {
0xaab7, 0xaab8,
0xaabe, 0xaabf,
0xaac1, 0xaac1,
+ 0xaaeb, 0xaaef,
+ 0xaaf5, 0xaaf6,
0xabe3, 0xabea,
0xabec, 0xabed,
0xfb1e, 0xfb1e,
@@ -3370,6 +8459,13 @@ static const OnigCodePoint CR_M[] = {
0x11038, 0x11046,
0x11080, 0x11082,
0x110b0, 0x110ba,
+ 0x11100, 0x11102,
+ 0x11127, 0x11134,
+ 0x11180, 0x11182,
+ 0x111b3, 0x111c0,
+ 0x116ab, 0x116b7,
+ 0x16f51, 0x16f7e,
+ 0x16f8f, 0x16f92,
0x1d165, 0x1d169,
0x1d16d, 0x1d172,
0x1d17b, 0x1d182,
@@ -3381,7 +8477,7 @@ static const OnigCodePoint CR_M[] = {
/* 'Mc': General Category */
static const OnigCodePoint CR_Mc[] = {
- 113,
+ 126,
0x0903, 0x0903,
0x093b, 0x093b,
0x093e, 0x0940,
@@ -3463,6 +8559,7 @@ static const OnigCodePoint CR_Mc[] = {
0x1ba1, 0x1ba1,
0x1ba6, 0x1ba7,
0x1baa, 0x1baa,
+ 0x1bac, 0x1bad,
0x1be7, 0x1be7,
0x1bea, 0x1bec,
0x1bee, 0x1bee,
@@ -3470,7 +8567,8 @@ static const OnigCodePoint CR_Mc[] = {
0x1c24, 0x1c2b,
0x1c34, 0x1c35,
0x1ce1, 0x1ce1,
- 0x1cf2, 0x1cf2,
+ 0x1cf2, 0x1cf3,
+ 0x302e, 0x302f,
0xa823, 0xa824,
0xa827, 0xa827,
0xa880, 0xa881,
@@ -3484,6 +8582,9 @@ static const OnigCodePoint CR_Mc[] = {
0xaa33, 0xaa34,
0xaa4d, 0xaa4d,
0xaa7b, 0xaa7b,
+ 0xaaeb, 0xaaeb,
+ 0xaaee, 0xaaef,
+ 0xaaf5, 0xaaf5,
0xabe3, 0xabe4,
0xabe6, 0xabe7,
0xabe9, 0xabea,
@@ -3493,6 +8594,14 @@ static const OnigCodePoint CR_Mc[] = {
0x11082, 0x11082,
0x110b0, 0x110b2,
0x110b7, 0x110b8,
+ 0x1112c, 0x1112c,
+ 0x11182, 0x11182,
+ 0x111b3, 0x111b5,
+ 0x111bf, 0x111c0,
+ 0x116ac, 0x116ac,
+ 0x116ae, 0x116af,
+ 0x116b6, 0x116b6,
+ 0x16f51, 0x16f7e,
0x1d165, 0x1d166,
0x1d16d, 0x1d172,
}; /* CR_Mc */
@@ -3508,7 +8617,7 @@ static const OnigCodePoint CR_Me[] = {
/* 'Mn': General Category */
static const OnigCodePoint CR_Mn[] = {
- 203,
+ 220,
0x0300, 0x036f,
0x0483, 0x0487,
0x0591, 0x05bd,
@@ -3532,6 +8641,7 @@ static const OnigCodePoint CR_Mn[] = {
0x0825, 0x0827,
0x0829, 0x082d,
0x0859, 0x085b,
+ 0x08e4, 0x08fe,
0x0900, 0x0902,
0x093a, 0x093a,
0x093c, 0x093c,
@@ -3617,6 +8727,7 @@ static const OnigCodePoint CR_Mn[] = {
0x1732, 0x1734,
0x1752, 0x1753,
0x1772, 0x1773,
+ 0x17b4, 0x17b5,
0x17b7, 0x17bd,
0x17c6, 0x17c6,
0x17c9, 0x17d3,
@@ -3644,6 +8755,7 @@ static const OnigCodePoint CR_Mn[] = {
0x1b80, 0x1b81,
0x1ba2, 0x1ba5,
0x1ba8, 0x1ba9,
+ 0x1bab, 0x1bab,
0x1be6, 0x1be6,
0x1be8, 0x1be9,
0x1bed, 0x1bed,
@@ -3654,6 +8766,7 @@ static const OnigCodePoint CR_Mn[] = {
0x1cd4, 0x1ce0,
0x1ce2, 0x1ce8,
0x1ced, 0x1ced,
+ 0x1cf4, 0x1cf4,
0x1dc0, 0x1de6,
0x1dfc, 0x1dff,
0x20d0, 0x20dc,
@@ -3662,10 +8775,11 @@ static const OnigCodePoint CR_Mn[] = {
0x2cef, 0x2cf1,
0x2d7f, 0x2d7f,
0x2de0, 0x2dff,
- 0x302a, 0x302f,
+ 0x302a, 0x302d,
0x3099, 0x309a,
0xa66f, 0xa66f,
- 0xa67c, 0xa67d,
+ 0xa674, 0xa67d,
+ 0xa69f, 0xa69f,
0xa6f0, 0xa6f1,
0xa802, 0xa802,
0xa806, 0xa806,
@@ -3689,6 +8803,8 @@ static const OnigCodePoint CR_Mn[] = {
0xaab7, 0xaab8,
0xaabe, 0xaabf,
0xaac1, 0xaac1,
+ 0xaaec, 0xaaed,
+ 0xaaf6, 0xaaf6,
0xabe5, 0xabe5,
0xabe8, 0xabe8,
0xabed, 0xabed,
@@ -3706,6 +8822,16 @@ static const OnigCodePoint CR_Mn[] = {
0x11080, 0x11081,
0x110b3, 0x110b6,
0x110b9, 0x110ba,
+ 0x11100, 0x11102,
+ 0x11127, 0x1112b,
+ 0x1112d, 0x11134,
+ 0x11180, 0x11181,
+ 0x111b6, 0x111be,
+ 0x116ab, 0x116ab,
+ 0x116ad, 0x116ad,
+ 0x116b0, 0x116b5,
+ 0x116b7, 0x116b7,
+ 0x16f8f, 0x16f92,
0x1d167, 0x1d169,
0x1d17b, 0x1d182,
0x1d185, 0x1d18b,
@@ -3716,7 +8842,7 @@ static const OnigCodePoint CR_Mn[] = {
/* 'N': Major Category */
static const OnigCodePoint CR_N[] = {
- 83,
+ 88,
0x0030, 0x0039,
0x00b2, 0x00b3,
0x00b9, 0x00b9,
@@ -3768,6 +8894,7 @@ static const OnigCodePoint CR_N[] = {
0x3038, 0x303a,
0x3192, 0x3195,
0x3220, 0x3229,
+ 0x3248, 0x324f,
0x3251, 0x325f,
0x3280, 0x3289,
0x32b1, 0x32bf,
@@ -3796,6 +8923,10 @@ static const OnigCodePoint CR_N[] = {
0x10b78, 0x10b7f,
0x10e60, 0x10e7e,
0x11052, 0x1106f,
+ 0x110f0, 0x110f9,
+ 0x11136, 0x1113f,
+ 0x111d0, 0x111d9,
+ 0x116c0, 0x116c9,
0x12400, 0x12462,
0x1d360, 0x1d371,
0x1d7ce, 0x1d7ff,
@@ -3803,47 +8934,7 @@ static const OnigCodePoint CR_N[] = {
}; /* CR_N */
/* 'Nd': General Category */
-static const OnigCodePoint CR_Nd[] = {
- 38,
- 0x0030, 0x0039,
- 0x0660, 0x0669,
- 0x06f0, 0x06f9,
- 0x07c0, 0x07c9,
- 0x0966, 0x096f,
- 0x09e6, 0x09ef,
- 0x0a66, 0x0a6f,
- 0x0ae6, 0x0aef,
- 0x0b66, 0x0b6f,
- 0x0be6, 0x0bef,
- 0x0c66, 0x0c6f,
- 0x0ce6, 0x0cef,
- 0x0d66, 0x0d6f,
- 0x0e50, 0x0e59,
- 0x0ed0, 0x0ed9,
- 0x0f20, 0x0f29,
- 0x1040, 0x1049,
- 0x1090, 0x1099,
- 0x17e0, 0x17e9,
- 0x1810, 0x1819,
- 0x1946, 0x194f,
- 0x19d0, 0x19d9,
- 0x1a80, 0x1a89,
- 0x1a90, 0x1a99,
- 0x1b50, 0x1b59,
- 0x1bb0, 0x1bb9,
- 0x1c40, 0x1c49,
- 0x1c50, 0x1c59,
- 0xa620, 0xa629,
- 0xa8d0, 0xa8d9,
- 0xa900, 0xa909,
- 0xa9d0, 0xa9d9,
- 0xaa50, 0xaa59,
- 0xabf0, 0xabf9,
- 0xff10, 0xff19,
- 0x104a0, 0x104a9,
- 0x11066, 0x1106f,
- 0x1d7ce, 0x1d7ff,
-}; /* CR_Nd */
+#define CR_Nd CR_Digit
/* 'Nl': General Category */
static const OnigCodePoint CR_Nl[] = {
@@ -3864,7 +8955,7 @@ static const OnigCodePoint CR_Nl[] = {
/* 'No': General Category */
static const OnigCodePoint CR_No[] = {
- 41,
+ 42,
0x00b2, 0x00b3,
0x00b9, 0x00b9,
0x00bc, 0x00be,
@@ -3888,6 +8979,7 @@ static const OnigCodePoint CR_No[] = {
0x2cfd, 0x2cfd,
0x3192, 0x3195,
0x3220, 0x3229,
+ 0x3248, 0x324f,
0x3251, 0x325f,
0x3280, 0x3289,
0x32b1, 0x32bf,
@@ -3909,142 +9001,7 @@ static const OnigCodePoint CR_No[] = {
}; /* CR_No */
/* 'P': Major Category */
-static const OnigCodePoint CR_P[] = {
- 133,
- 0x0021, 0x0023,
- 0x0025, 0x002a,
- 0x002c, 0x002f,
- 0x003a, 0x003b,
- 0x003f, 0x0040,
- 0x005b, 0x005d,
- 0x005f, 0x005f,
- 0x007b, 0x007b,
- 0x007d, 0x007d,
- 0x00a1, 0x00a1,
- 0x00ab, 0x00ab,
- 0x00b7, 0x00b7,
- 0x00bb, 0x00bb,
- 0x00bf, 0x00bf,
- 0x037e, 0x037e,
- 0x0387, 0x0387,
- 0x055a, 0x055f,
- 0x0589, 0x058a,
- 0x05be, 0x05be,
- 0x05c0, 0x05c0,
- 0x05c3, 0x05c3,
- 0x05c6, 0x05c6,
- 0x05f3, 0x05f4,
- 0x0609, 0x060a,
- 0x060c, 0x060d,
- 0x061b, 0x061b,
- 0x061e, 0x061f,
- 0x066a, 0x066d,
- 0x06d4, 0x06d4,
- 0x0700, 0x070d,
- 0x07f7, 0x07f9,
- 0x0830, 0x083e,
- 0x085e, 0x085e,
- 0x0964, 0x0965,
- 0x0970, 0x0970,
- 0x0df4, 0x0df4,
- 0x0e4f, 0x0e4f,
- 0x0e5a, 0x0e5b,
- 0x0f04, 0x0f12,
- 0x0f3a, 0x0f3d,
- 0x0f85, 0x0f85,
- 0x0fd0, 0x0fd4,
- 0x0fd9, 0x0fda,
- 0x104a, 0x104f,
- 0x10fb, 0x10fb,
- 0x1361, 0x1368,
- 0x1400, 0x1400,
- 0x166d, 0x166e,
- 0x169b, 0x169c,
- 0x16eb, 0x16ed,
- 0x1735, 0x1736,
- 0x17d4, 0x17d6,
- 0x17d8, 0x17da,
- 0x1800, 0x180a,
- 0x1944, 0x1945,
- 0x1a1e, 0x1a1f,
- 0x1aa0, 0x1aa6,
- 0x1aa8, 0x1aad,
- 0x1b5a, 0x1b60,
- 0x1bfc, 0x1bff,
- 0x1c3b, 0x1c3f,
- 0x1c7e, 0x1c7f,
- 0x1cd3, 0x1cd3,
- 0x2010, 0x2027,
- 0x2030, 0x2043,
- 0x2045, 0x2051,
- 0x2053, 0x205e,
- 0x207d, 0x207e,
- 0x208d, 0x208e,
- 0x2329, 0x232a,
- 0x2768, 0x2775,
- 0x27c5, 0x27c6,
- 0x27e6, 0x27ef,
- 0x2983, 0x2998,
- 0x29d8, 0x29db,
- 0x29fc, 0x29fd,
- 0x2cf9, 0x2cfc,
- 0x2cfe, 0x2cff,
- 0x2d70, 0x2d70,
- 0x2e00, 0x2e2e,
- 0x2e30, 0x2e31,
- 0x3001, 0x3003,
- 0x3008, 0x3011,
- 0x3014, 0x301f,
- 0x3030, 0x3030,
- 0x303d, 0x303d,
- 0x30a0, 0x30a0,
- 0x30fb, 0x30fb,
- 0xa4fe, 0xa4ff,
- 0xa60d, 0xa60f,
- 0xa673, 0xa673,
- 0xa67e, 0xa67e,
- 0xa6f2, 0xa6f7,
- 0xa874, 0xa877,
- 0xa8ce, 0xa8cf,
- 0xa8f8, 0xa8fa,
- 0xa92e, 0xa92f,
- 0xa95f, 0xa95f,
- 0xa9c1, 0xa9cd,
- 0xa9de, 0xa9df,
- 0xaa5c, 0xaa5f,
- 0xaade, 0xaadf,
- 0xabeb, 0xabeb,
- 0xfd3e, 0xfd3f,
- 0xfe10, 0xfe19,
- 0xfe30, 0xfe52,
- 0xfe54, 0xfe61,
- 0xfe63, 0xfe63,
- 0xfe68, 0xfe68,
- 0xfe6a, 0xfe6b,
- 0xff01, 0xff03,
- 0xff05, 0xff0a,
- 0xff0c, 0xff0f,
- 0xff1a, 0xff1b,
- 0xff1f, 0xff20,
- 0xff3b, 0xff3d,
- 0xff3f, 0xff3f,
- 0xff5b, 0xff5b,
- 0xff5d, 0xff5d,
- 0xff5f, 0xff65,
- 0x10100, 0x10101,
- 0x1039f, 0x1039f,
- 0x103d0, 0x103d0,
- 0x10857, 0x10857,
- 0x1091f, 0x1091f,
- 0x1093f, 0x1093f,
- 0x10a50, 0x10a58,
- 0x10a7f, 0x10a7f,
- 0x10b39, 0x10b3f,
- 0x11047, 0x1104d,
- 0x110bb, 0x110bc,
- 0x110be, 0x110c1,
- 0x12470, 0x12473,
-}; /* CR_P */
+#define CR_P CR_Punct
/* 'Pc': General Category */
static const OnigCodePoint CR_Pc[] = {
@@ -4059,7 +9016,7 @@ static const OnigCodePoint CR_Pc[] = {
/* 'Pd': General Category */
static const OnigCodePoint CR_Pd[] = {
- 15,
+ 16,
0x002d, 0x002d,
0x058a, 0x058a,
0x05be, 0x05be,
@@ -4068,6 +9025,7 @@ static const OnigCodePoint CR_Pd[] = {
0x2010, 0x2015,
0x2e17, 0x2e17,
0x2e1a, 0x2e1a,
+ 0x2e3a, 0x2e3b,
0x301c, 0x301c,
0x3030, 0x3030,
0x30a0, 0x30a0,
@@ -4185,7 +9143,7 @@ static const OnigCodePoint CR_Pi[] = {
/* 'Po': General Category */
static const OnigCodePoint CR_Po[] = {
- 128,
+ 135,
0x0021, 0x0023,
0x0025, 0x0027,
0x002a, 0x002a,
@@ -4195,7 +9153,8 @@ static const OnigCodePoint CR_Po[] = {
0x003f, 0x0040,
0x005c, 0x005c,
0x00a1, 0x00a1,
- 0x00b7, 0x00b7,
+ 0x00a7, 0x00a7,
+ 0x00b6, 0x00b7,
0x00bf, 0x00bf,
0x037e, 0x037e,
0x0387, 0x0387,
@@ -4217,16 +9176,18 @@ static const OnigCodePoint CR_Po[] = {
0x085e, 0x085e,
0x0964, 0x0965,
0x0970, 0x0970,
+ 0x0af0, 0x0af0,
0x0df4, 0x0df4,
0x0e4f, 0x0e4f,
0x0e5a, 0x0e5b,
0x0f04, 0x0f12,
+ 0x0f14, 0x0f14,
0x0f85, 0x0f85,
0x0fd0, 0x0fd4,
0x0fd9, 0x0fda,
0x104a, 0x104f,
0x10fb, 0x10fb,
- 0x1361, 0x1368,
+ 0x1360, 0x1368,
0x166d, 0x166e,
0x16eb, 0x16ed,
0x1735, 0x1736,
@@ -4242,6 +9203,7 @@ static const OnigCodePoint CR_Po[] = {
0x1bfc, 0x1bff,
0x1c3b, 0x1c3f,
0x1c7e, 0x1c7f,
+ 0x1cc0, 0x1cc7,
0x1cd3, 0x1cd3,
0x2016, 0x2017,
0x2020, 0x2027,
@@ -4262,7 +9224,7 @@ static const OnigCodePoint CR_Po[] = {
0x2e1b, 0x2e1b,
0x2e1e, 0x2e1f,
0x2e2a, 0x2e2e,
- 0x2e30, 0x2e31,
+ 0x2e30, 0x2e39,
0x3001, 0x3003,
0x303d, 0x303d,
0x30fb, 0x30fb,
@@ -4280,6 +9242,7 @@ static const OnigCodePoint CR_Po[] = {
0xa9de, 0xa9df,
0xaa5c, 0xaa5f,
0xaade, 0xaadf,
+ 0xaaf0, 0xaaf1,
0xabeb, 0xabeb,
0xfe10, 0xfe16,
0xfe19, 0xfe19,
@@ -4301,7 +9264,7 @@ static const OnigCodePoint CR_Po[] = {
0xff3c, 0xff3c,
0xff61, 0xff61,
0xff64, 0xff65,
- 0x10100, 0x10101,
+ 0x10100, 0x10102,
0x1039f, 0x1039f,
0x103d0, 0x103d0,
0x10857, 0x10857,
@@ -4313,6 +9276,8 @@ static const OnigCodePoint CR_Po[] = {
0x11047, 0x1104d,
0x110bb, 0x110bc,
0x110be, 0x110c1,
+ 0x11140, 0x11143,
+ 0x111c5, 0x111c8,
0x12470, 0x12473,
}; /* CR_Po */
@@ -4395,7 +9360,7 @@ static const OnigCodePoint CR_Ps[] = {
/* 'S': Major Category */
static const OnigCodePoint CR_S[] = {
- 208,
+ 198,
0x0024, 0x0024,
0x002b, 0x002b,
0x003c, 0x003e,
@@ -4403,11 +9368,11 @@ static const OnigCodePoint CR_S[] = {
0x0060, 0x0060,
0x007c, 0x007c,
0x007e, 0x007e,
- 0x00a2, 0x00a9,
+ 0x00a2, 0x00a6,
+ 0x00a8, 0x00a9,
0x00ac, 0x00ac,
0x00ae, 0x00b1,
0x00b4, 0x00b4,
- 0x00b6, 0x00b6,
0x00b8, 0x00b8,
0x00d7, 0x00d7,
0x00f7, 0x00f7,
@@ -4420,6 +9385,7 @@ static const OnigCodePoint CR_S[] = {
0x0384, 0x0385,
0x03f6, 0x03f6,
0x0482, 0x0482,
+ 0x058f, 0x058f,
0x0606, 0x0608,
0x060b, 0x060b,
0x060e, 0x060f,
@@ -4436,7 +9402,8 @@ static const OnigCodePoint CR_S[] = {
0x0d79, 0x0d79,
0x0e3f, 0x0e3f,
0x0f01, 0x0f03,
- 0x0f13, 0x0f17,
+ 0x0f13, 0x0f13,
+ 0x0f15, 0x0f17,
0x0f1a, 0x0f1f,
0x0f34, 0x0f34,
0x0f36, 0x0f36,
@@ -4446,7 +9413,6 @@ static const OnigCodePoint CR_S[] = {
0x0fce, 0x0fcf,
0x0fd5, 0x0fd8,
0x109e, 0x109f,
- 0x1360, 0x1360,
0x1390, 0x1399,
0x17db, 0x17db,
0x1940, 0x1940,
@@ -4486,9 +9452,7 @@ static const OnigCodePoint CR_S[] = {
0x2500, 0x26ff,
0x2701, 0x2767,
0x2794, 0x27c4,
- 0x27c7, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x27e5,
+ 0x27c7, 0x27e5,
0x27f0, 0x2982,
0x2999, 0x29d7,
0x29dc, 0x29fb,
@@ -4509,7 +9473,8 @@ static const OnigCodePoint CR_S[] = {
0x3196, 0x319f,
0x31c0, 0x31e3,
0x3200, 0x321e,
- 0x322a, 0x3250,
+ 0x322a, 0x3247,
+ 0x3250, 0x3250,
0x3260, 0x327f,
0x328a, 0x32b0,
0x32c0, 0x32fe,
@@ -4538,7 +9503,6 @@ static const OnigCodePoint CR_S[] = {
0xffe0, 0xffe6,
0xffe8, 0xffee,
0xfffc, 0xfffd,
- 0x10102, 0x10102,
0x10137, 0x1013f,
0x10179, 0x10189,
0x10190, 0x1019b,
@@ -4563,6 +9527,7 @@ static const OnigCodePoint CR_S[] = {
0x1d789, 0x1d789,
0x1d7a9, 0x1d7a9,
0x1d7c3, 0x1d7c3,
+ 0x1eef0, 0x1eef1,
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
@@ -4570,7 +9535,7 @@ static const OnigCodePoint CR_S[] = {
0x1f0c1, 0x1f0cf,
0x1f0d1, 0x1f0df,
0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
+ 0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
0x1f1e6, 0x1f202,
0x1f210, 0x1f23a,
@@ -4588,19 +9553,9 @@ static const OnigCodePoint CR_S[] = {
0x1f442, 0x1f4f7,
0x1f4f9, 0x1f4fc,
0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
+ 0x1f5fb, 0x1f640,
0x1f645, 0x1f64f,
0x1f680, 0x1f6c5,
0x1f700, 0x1f773,
@@ -4608,9 +9563,10 @@ static const OnigCodePoint CR_S[] = {
/* 'Sc': General Category */
static const OnigCodePoint CR_Sc[] = {
- 16,
+ 17,
0x0024, 0x0024,
0x00a2, 0x00a5,
+ 0x058f, 0x058f,
0x060b, 0x060b,
0x09f2, 0x09f3,
0x09fb, 0x09fb,
@@ -4661,7 +9617,7 @@ static const OnigCodePoint CR_Sk[] = {
/* 'Sm': General Category */
static const OnigCodePoint CR_Sm[] = {
- 66,
+ 65,
0x002b, 0x002b,
0x003c, 0x003e,
0x007c, 0x007c,
@@ -4699,9 +9655,7 @@ static const OnigCodePoint CR_Sm[] = {
0x25f8, 0x25ff,
0x266f, 0x266f,
0x27c0, 0x27c4,
- 0x27c7, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x27e5,
+ 0x27c7, 0x27e5,
0x27f0, 0x27ff,
0x2900, 0x2982,
0x2999, 0x29d7,
@@ -4728,16 +9682,16 @@ static const OnigCodePoint CR_Sm[] = {
0x1d789, 0x1d789,
0x1d7a9, 0x1d7a9,
0x1d7c3, 0x1d7c3,
+ 0x1eef0, 0x1eef1,
}; /* CR_Sm */
/* 'So': General Category */
static const OnigCodePoint CR_So[] = {
- 164,
- 0x00a6, 0x00a7,
+ 153,
+ 0x00a6, 0x00a6,
0x00a9, 0x00a9,
0x00ae, 0x00ae,
0x00b0, 0x00b0,
- 0x00b6, 0x00b6,
0x0482, 0x0482,
0x060e, 0x060f,
0x06de, 0x06de,
@@ -4751,7 +9705,8 @@ static const OnigCodePoint CR_So[] = {
0x0c7f, 0x0c7f,
0x0d79, 0x0d79,
0x0f01, 0x0f03,
- 0x0f13, 0x0f17,
+ 0x0f13, 0x0f13,
+ 0x0f15, 0x0f17,
0x0f1a, 0x0f1f,
0x0f34, 0x0f34,
0x0f36, 0x0f36,
@@ -4761,7 +9716,6 @@ static const OnigCodePoint CR_So[] = {
0x0fce, 0x0fcf,
0x0fd5, 0x0fd8,
0x109e, 0x109f,
- 0x1360, 0x1360,
0x1390, 0x1399,
0x1940, 0x1940,
0x19de, 0x19ff,
@@ -4825,7 +9779,8 @@ static const OnigCodePoint CR_So[] = {
0x3196, 0x319f,
0x31c0, 0x31e3,
0x3200, 0x321e,
- 0x322a, 0x3250,
+ 0x322a, 0x3247,
+ 0x3250, 0x3250,
0x3260, 0x327f,
0x328a, 0x32b0,
0x32c0, 0x32fe,
@@ -4841,7 +9796,6 @@ static const OnigCodePoint CR_So[] = {
0xffe8, 0xffe8,
0xffed, 0xffee,
0xfffc, 0xfffd,
- 0x10102, 0x10102,
0x10137, 0x1013f,
0x10179, 0x10189,
0x10190, 0x1019b,
@@ -4863,7 +9817,7 @@ static const OnigCodePoint CR_So[] = {
0x1f0c1, 0x1f0cf,
0x1f0d1, 0x1f0df,
0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
+ 0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
0x1f1e6, 0x1f202,
0x1f210, 0x1f23a,
@@ -4881,19 +9835,9 @@ static const OnigCodePoint CR_So[] = {
0x1f442, 0x1f4f7,
0x1f4f9, 0x1f4fc,
0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
+ 0x1f5fb, 0x1f640,
0x1f645, 0x1f64f,
0x1f680, 0x1f6c5,
0x1f700, 0x1f773,
@@ -4940,7 +9884,7 @@ static const OnigCodePoint CR_Zs[] = {
/* 'Math': Derived Property */
static const OnigCodePoint CR_Math[] = {
- 106,
+ 138,
0x002b, 0x002b,
0x003c, 0x003e,
0x005e, 0x005e,
@@ -5009,9 +9953,7 @@ static const OnigCodePoint CR_Math[] = {
0x2642, 0x2642,
0x2660, 0x2663,
0x266d, 0x266f,
- 0x27c0, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x27ff,
+ 0x27c0, 0x27ff,
0x2900, 0x2aff,
0x2b30, 0x2b44,
0x2b47, 0x2b4c,
@@ -5047,1729 +9989,54 @@ static const OnigCodePoint CR_Math[] = {
0x1d552, 0x1d6a5,
0x1d6a8, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
}; /* CR_Math */
/* 'Alphabetic': Derived Property */
-static const OnigCodePoint CR_Alphabetic[] = {
- 486,
- 0x0041, 0x005a,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x02c1,
- 0x02c6, 0x02d1,
- 0x02e0, 0x02e4,
- 0x02ec, 0x02ec,
- 0x02ee, 0x02ee,
- 0x0345, 0x0345,
- 0x0370, 0x0374,
- 0x0376, 0x0377,
- 0x037a, 0x037d,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03f5,
- 0x03f7, 0x0481,
- 0x048a, 0x0527,
- 0x0531, 0x0556,
- 0x0559, 0x0559,
- 0x0561, 0x0587,
- 0x05b0, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f2,
- 0x0610, 0x061a,
- 0x0620, 0x0657,
- 0x0659, 0x065f,
- 0x066e, 0x06d3,
- 0x06d5, 0x06dc,
- 0x06e1, 0x06e8,
- 0x06ed, 0x06ef,
- 0x06fa, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x073f,
- 0x074d, 0x07b1,
- 0x07ca, 0x07ea,
- 0x07f4, 0x07f5,
- 0x07fa, 0x07fa,
- 0x0800, 0x0817,
- 0x081a, 0x082c,
- 0x0840, 0x0858,
- 0x0900, 0x093b,
- 0x093d, 0x094c,
- 0x094e, 0x0950,
- 0x0955, 0x0963,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bd, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09cc,
- 0x09ce, 0x09ce,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09f0, 0x09f1,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4c,
- 0x0a51, 0x0a51,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a70, 0x0a75,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abd, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acc,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae3,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3d, 0x0b44,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4c,
- 0x0b56, 0x0b57,
- 0x0b5c, 0x0b5d,
- 0x0b5f, 0x0b63,
- 0x0b71, 0x0b71,
- 0x0b82, 0x0b83,
- 0x0b85, 0x0b8a,
- 0x0b8e, 0x0b90,
- 0x0b92, 0x0b95,
- 0x0b99, 0x0b9a,
- 0x0b9c, 0x0b9c,
- 0x0b9e, 0x0b9f,
- 0x0ba3, 0x0ba4,
- 0x0ba8, 0x0baa,
- 0x0bae, 0x0bb9,
- 0x0bbe, 0x0bc2,
- 0x0bc6, 0x0bc8,
- 0x0bca, 0x0bcc,
- 0x0bd0, 0x0bd0,
- 0x0bd7, 0x0bd7,
- 0x0c01, 0x0c03,
- 0x0c05, 0x0c0c,
- 0x0c0e, 0x0c10,
- 0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
- 0x0c3d, 0x0c44,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4c,
- 0x0c55, 0x0c56,
- 0x0c58, 0x0c59,
- 0x0c60, 0x0c63,
- 0x0c82, 0x0c83,
- 0x0c85, 0x0c8c,
- 0x0c8e, 0x0c90,
- 0x0c92, 0x0ca8,
- 0x0caa, 0x0cb3,
- 0x0cb5, 0x0cb9,
- 0x0cbd, 0x0cc4,
- 0x0cc6, 0x0cc8,
- 0x0cca, 0x0ccc,
- 0x0cd5, 0x0cd6,
- 0x0cde, 0x0cde,
- 0x0ce0, 0x0ce3,
- 0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d3a,
- 0x0d3d, 0x0d44,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4c,
- 0x0d4e, 0x0d4e,
- 0x0d57, 0x0d57,
- 0x0d60, 0x0d63,
- 0x0d7a, 0x0d7f,
- 0x0d82, 0x0d83,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df3,
- 0x0e01, 0x0e3a,
- 0x0e40, 0x0e46,
- 0x0e4d, 0x0e4d,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ecd, 0x0ecd,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f00,
- 0x0f40, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f71, 0x0f81,
- 0x0f88, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x1000, 0x1036,
- 0x1038, 0x1038,
- 0x103b, 0x103f,
- 0x1050, 0x1062,
- 0x1065, 0x1068,
- 0x106e, 0x1086,
- 0x108e, 0x108e,
- 0x109c, 0x109d,
- 0x10a0, 0x10c5,
- 0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135f, 0x135f,
- 0x1380, 0x138f,
- 0x13a0, 0x13f4,
- 0x1401, 0x166c,
- 0x166f, 0x167f,
- 0x1681, 0x169a,
- 0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
- 0x1700, 0x170c,
- 0x170e, 0x1713,
- 0x1720, 0x1733,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17b3,
- 0x17b6, 0x17c8,
- 0x17d7, 0x17d7,
- 0x17dc, 0x17dc,
- 0x1820, 0x1877,
- 0x1880, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191c,
- 0x1920, 0x192b,
- 0x1930, 0x1938,
- 0x1950, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x1a00, 0x1a1b,
- 0x1a20, 0x1a5e,
- 0x1a61, 0x1a74,
- 0x1aa7, 0x1aa7,
- 0x1b00, 0x1b33,
- 0x1b35, 0x1b43,
- 0x1b45, 0x1b4b,
- 0x1b80, 0x1ba9,
- 0x1bae, 0x1baf,
- 0x1bc0, 0x1be5,
- 0x1be7, 0x1bf1,
- 0x1c00, 0x1c35,
- 0x1c4d, 0x1c4f,
- 0x1c5a, 0x1c7d,
- 0x1ce9, 0x1cec,
- 0x1cee, 0x1cf2,
- 0x1d00, 0x1dbf,
- 0x1e00, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fbc,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fcc,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fe0, 0x1fec,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffc,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x209c,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x212f, 0x2139,
- 0x213c, 0x213f,
- 0x2145, 0x2149,
- 0x214e, 0x214e,
- 0x2160, 0x2188,
- 0x24b6, 0x24e9,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2ce4,
- 0x2ceb, 0x2cee,
- 0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
- 0x2d6f, 0x2d6f,
- 0x2d80, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2de0, 0x2dff,
- 0x2e2f, 0x2e2f,
- 0x3005, 0x3007,
- 0x3021, 0x3029,
- 0x3031, 0x3035,
- 0x3038, 0x303c,
- 0x3041, 0x3096,
- 0x309d, 0x309f,
- 0x30a1, 0x30fa,
- 0x30fc, 0x30ff,
- 0x3105, 0x312d,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa61f,
- 0xa62a, 0xa62b,
- 0xa640, 0xa66e,
- 0xa67f, 0xa697,
- 0xa6a0, 0xa6ef,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa801,
- 0xa803, 0xa805,
- 0xa807, 0xa80a,
- 0xa80c, 0xa827,
- 0xa840, 0xa873,
- 0xa880, 0xa8c3,
- 0xa8f2, 0xa8f7,
- 0xa8fb, 0xa8fb,
- 0xa90a, 0xa92a,
- 0xa930, 0xa952,
- 0xa960, 0xa97c,
- 0xa980, 0xa9b2,
- 0xa9b4, 0xa9bf,
- 0xa9cf, 0xa9cf,
- 0xaa00, 0xaa36,
- 0xaa40, 0xaa4d,
- 0xaa60, 0xaa76,
- 0xaa7a, 0xaa7a,
- 0xaa80, 0xaabe,
- 0xaac0, 0xaac0,
- 0xaac2, 0xaac2,
- 0xaadb, 0xaadd,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xabc0, 0xabea,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb28,
- 0xfb2a, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3d,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfb,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xff21, 0xff3a,
- 0xff41, 0xff5a,
- 0xff66, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10140, 0x10174,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x10300, 0x1031e,
- 0x10330, 0x1034a,
- 0x10380, 0x1039d,
- 0x103a0, 0x103c3,
- 0x103c8, 0x103cf,
- 0x103d1, 0x103d5,
- 0x10400, 0x1049d,
- 0x10800, 0x10805,
- 0x10808, 0x10808,
- 0x1080a, 0x10835,
- 0x10837, 0x10838,
- 0x1083c, 0x1083c,
- 0x1083f, 0x10855,
- 0x10900, 0x10915,
- 0x10920, 0x10939,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x10a60, 0x10a7c,
- 0x10b00, 0x10b35,
- 0x10b40, 0x10b55,
- 0x10b60, 0x10b72,
- 0x10c00, 0x10c48,
- 0x11000, 0x11045,
- 0x11082, 0x110b8,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x13000, 0x1342e,
- 0x16800, 0x16a38,
- 0x1b000, 0x1b001,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d6c0,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6fa,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d734,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d76e,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d7a8,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7cb,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2f800, 0x2fa1d,
-}; /* CR_Alphabetic */
+#define CR_Alphabetic CR_Alpha
/* 'Lowercase': Derived Property */
-static const OnigCodePoint CR_Lowercase[] = {
- 612,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
- 0x00df, 0x00f6,
- 0x00f8, 0x00ff,
- 0x0101, 0x0101,
- 0x0103, 0x0103,
- 0x0105, 0x0105,
- 0x0107, 0x0107,
- 0x0109, 0x0109,
- 0x010b, 0x010b,
- 0x010d, 0x010d,
- 0x010f, 0x010f,
- 0x0111, 0x0111,
- 0x0113, 0x0113,
- 0x0115, 0x0115,
- 0x0117, 0x0117,
- 0x0119, 0x0119,
- 0x011b, 0x011b,
- 0x011d, 0x011d,
- 0x011f, 0x011f,
- 0x0121, 0x0121,
- 0x0123, 0x0123,
- 0x0125, 0x0125,
- 0x0127, 0x0127,
- 0x0129, 0x0129,
- 0x012b, 0x012b,
- 0x012d, 0x012d,
- 0x012f, 0x012f,
- 0x0131, 0x0131,
- 0x0133, 0x0133,
- 0x0135, 0x0135,
- 0x0137, 0x0138,
- 0x013a, 0x013a,
- 0x013c, 0x013c,
- 0x013e, 0x013e,
- 0x0140, 0x0140,
- 0x0142, 0x0142,
- 0x0144, 0x0144,
- 0x0146, 0x0146,
- 0x0148, 0x0149,
- 0x014b, 0x014b,
- 0x014d, 0x014d,
- 0x014f, 0x014f,
- 0x0151, 0x0151,
- 0x0153, 0x0153,
- 0x0155, 0x0155,
- 0x0157, 0x0157,
- 0x0159, 0x0159,
- 0x015b, 0x015b,
- 0x015d, 0x015d,
- 0x015f, 0x015f,
- 0x0161, 0x0161,
- 0x0163, 0x0163,
- 0x0165, 0x0165,
- 0x0167, 0x0167,
- 0x0169, 0x0169,
- 0x016b, 0x016b,
- 0x016d, 0x016d,
- 0x016f, 0x016f,
- 0x0171, 0x0171,
- 0x0173, 0x0173,
- 0x0175, 0x0175,
- 0x0177, 0x0177,
- 0x017a, 0x017a,
- 0x017c, 0x017c,
- 0x017e, 0x0180,
- 0x0183, 0x0183,
- 0x0185, 0x0185,
- 0x0188, 0x0188,
- 0x018c, 0x018d,
- 0x0192, 0x0192,
- 0x0195, 0x0195,
- 0x0199, 0x019b,
- 0x019e, 0x019e,
- 0x01a1, 0x01a1,
- 0x01a3, 0x01a3,
- 0x01a5, 0x01a5,
- 0x01a8, 0x01a8,
- 0x01aa, 0x01ab,
- 0x01ad, 0x01ad,
- 0x01b0, 0x01b0,
- 0x01b4, 0x01b4,
- 0x01b6, 0x01b6,
- 0x01b9, 0x01ba,
- 0x01bd, 0x01bf,
- 0x01c6, 0x01c6,
- 0x01c9, 0x01c9,
- 0x01cc, 0x01cc,
- 0x01ce, 0x01ce,
- 0x01d0, 0x01d0,
- 0x01d2, 0x01d2,
- 0x01d4, 0x01d4,
- 0x01d6, 0x01d6,
- 0x01d8, 0x01d8,
- 0x01da, 0x01da,
- 0x01dc, 0x01dd,
- 0x01df, 0x01df,
- 0x01e1, 0x01e1,
- 0x01e3, 0x01e3,
- 0x01e5, 0x01e5,
- 0x01e7, 0x01e7,
- 0x01e9, 0x01e9,
- 0x01eb, 0x01eb,
- 0x01ed, 0x01ed,
- 0x01ef, 0x01f0,
- 0x01f3, 0x01f3,
- 0x01f5, 0x01f5,
- 0x01f9, 0x01f9,
- 0x01fb, 0x01fb,
- 0x01fd, 0x01fd,
- 0x01ff, 0x01ff,
- 0x0201, 0x0201,
- 0x0203, 0x0203,
- 0x0205, 0x0205,
- 0x0207, 0x0207,
- 0x0209, 0x0209,
- 0x020b, 0x020b,
- 0x020d, 0x020d,
- 0x020f, 0x020f,
- 0x0211, 0x0211,
- 0x0213, 0x0213,
- 0x0215, 0x0215,
- 0x0217, 0x0217,
- 0x0219, 0x0219,
- 0x021b, 0x021b,
- 0x021d, 0x021d,
- 0x021f, 0x021f,
- 0x0221, 0x0221,
- 0x0223, 0x0223,
- 0x0225, 0x0225,
- 0x0227, 0x0227,
- 0x0229, 0x0229,
- 0x022b, 0x022b,
- 0x022d, 0x022d,
- 0x022f, 0x022f,
- 0x0231, 0x0231,
- 0x0233, 0x0239,
- 0x023c, 0x023c,
- 0x023f, 0x0240,
- 0x0242, 0x0242,
- 0x0247, 0x0247,
- 0x0249, 0x0249,
- 0x024b, 0x024b,
- 0x024d, 0x024d,
- 0x024f, 0x0293,
- 0x0295, 0x02b8,
- 0x02c0, 0x02c1,
- 0x02e0, 0x02e4,
- 0x0345, 0x0345,
- 0x0371, 0x0371,
- 0x0373, 0x0373,
- 0x0377, 0x0377,
- 0x037a, 0x037d,
- 0x0390, 0x0390,
- 0x03ac, 0x03ce,
- 0x03d0, 0x03d1,
- 0x03d5, 0x03d7,
- 0x03d9, 0x03d9,
- 0x03db, 0x03db,
- 0x03dd, 0x03dd,
- 0x03df, 0x03df,
- 0x03e1, 0x03e1,
- 0x03e3, 0x03e3,
- 0x03e5, 0x03e5,
- 0x03e7, 0x03e7,
- 0x03e9, 0x03e9,
- 0x03eb, 0x03eb,
- 0x03ed, 0x03ed,
- 0x03ef, 0x03f3,
- 0x03f5, 0x03f5,
- 0x03f8, 0x03f8,
- 0x03fb, 0x03fc,
- 0x0430, 0x045f,
- 0x0461, 0x0461,
- 0x0463, 0x0463,
- 0x0465, 0x0465,
- 0x0467, 0x0467,
- 0x0469, 0x0469,
- 0x046b, 0x046b,
- 0x046d, 0x046d,
- 0x046f, 0x046f,
- 0x0471, 0x0471,
- 0x0473, 0x0473,
- 0x0475, 0x0475,
- 0x0477, 0x0477,
- 0x0479, 0x0479,
- 0x047b, 0x047b,
- 0x047d, 0x047d,
- 0x047f, 0x047f,
- 0x0481, 0x0481,
- 0x048b, 0x048b,
- 0x048d, 0x048d,
- 0x048f, 0x048f,
- 0x0491, 0x0491,
- 0x0493, 0x0493,
- 0x0495, 0x0495,
- 0x0497, 0x0497,
- 0x0499, 0x0499,
- 0x049b, 0x049b,
- 0x049d, 0x049d,
- 0x049f, 0x049f,
- 0x04a1, 0x04a1,
- 0x04a3, 0x04a3,
- 0x04a5, 0x04a5,
- 0x04a7, 0x04a7,
- 0x04a9, 0x04a9,
- 0x04ab, 0x04ab,
- 0x04ad, 0x04ad,
- 0x04af, 0x04af,
- 0x04b1, 0x04b1,
- 0x04b3, 0x04b3,
- 0x04b5, 0x04b5,
- 0x04b7, 0x04b7,
- 0x04b9, 0x04b9,
- 0x04bb, 0x04bb,
- 0x04bd, 0x04bd,
- 0x04bf, 0x04bf,
- 0x04c2, 0x04c2,
- 0x04c4, 0x04c4,
- 0x04c6, 0x04c6,
- 0x04c8, 0x04c8,
- 0x04ca, 0x04ca,
- 0x04cc, 0x04cc,
- 0x04ce, 0x04cf,
- 0x04d1, 0x04d1,
- 0x04d3, 0x04d3,
- 0x04d5, 0x04d5,
- 0x04d7, 0x04d7,
- 0x04d9, 0x04d9,
- 0x04db, 0x04db,
- 0x04dd, 0x04dd,
- 0x04df, 0x04df,
- 0x04e1, 0x04e1,
- 0x04e3, 0x04e3,
- 0x04e5, 0x04e5,
- 0x04e7, 0x04e7,
- 0x04e9, 0x04e9,
- 0x04eb, 0x04eb,
- 0x04ed, 0x04ed,
- 0x04ef, 0x04ef,
- 0x04f1, 0x04f1,
- 0x04f3, 0x04f3,
- 0x04f5, 0x04f5,
- 0x04f7, 0x04f7,
- 0x04f9, 0x04f9,
- 0x04fb, 0x04fb,
- 0x04fd, 0x04fd,
- 0x04ff, 0x04ff,
- 0x0501, 0x0501,
- 0x0503, 0x0503,
- 0x0505, 0x0505,
- 0x0507, 0x0507,
- 0x0509, 0x0509,
- 0x050b, 0x050b,
- 0x050d, 0x050d,
- 0x050f, 0x050f,
- 0x0511, 0x0511,
- 0x0513, 0x0513,
- 0x0515, 0x0515,
- 0x0517, 0x0517,
- 0x0519, 0x0519,
- 0x051b, 0x051b,
- 0x051d, 0x051d,
- 0x051f, 0x051f,
- 0x0521, 0x0521,
- 0x0523, 0x0523,
- 0x0525, 0x0525,
- 0x0527, 0x0527,
- 0x0561, 0x0587,
- 0x1d00, 0x1dbf,
- 0x1e01, 0x1e01,
- 0x1e03, 0x1e03,
- 0x1e05, 0x1e05,
- 0x1e07, 0x1e07,
- 0x1e09, 0x1e09,
- 0x1e0b, 0x1e0b,
- 0x1e0d, 0x1e0d,
- 0x1e0f, 0x1e0f,
- 0x1e11, 0x1e11,
- 0x1e13, 0x1e13,
- 0x1e15, 0x1e15,
- 0x1e17, 0x1e17,
- 0x1e19, 0x1e19,
- 0x1e1b, 0x1e1b,
- 0x1e1d, 0x1e1d,
- 0x1e1f, 0x1e1f,
- 0x1e21, 0x1e21,
- 0x1e23, 0x1e23,
- 0x1e25, 0x1e25,
- 0x1e27, 0x1e27,
- 0x1e29, 0x1e29,
- 0x1e2b, 0x1e2b,
- 0x1e2d, 0x1e2d,
- 0x1e2f, 0x1e2f,
- 0x1e31, 0x1e31,
- 0x1e33, 0x1e33,
- 0x1e35, 0x1e35,
- 0x1e37, 0x1e37,
- 0x1e39, 0x1e39,
- 0x1e3b, 0x1e3b,
- 0x1e3d, 0x1e3d,
- 0x1e3f, 0x1e3f,
- 0x1e41, 0x1e41,
- 0x1e43, 0x1e43,
- 0x1e45, 0x1e45,
- 0x1e47, 0x1e47,
- 0x1e49, 0x1e49,
- 0x1e4b, 0x1e4b,
- 0x1e4d, 0x1e4d,
- 0x1e4f, 0x1e4f,
- 0x1e51, 0x1e51,
- 0x1e53, 0x1e53,
- 0x1e55, 0x1e55,
- 0x1e57, 0x1e57,
- 0x1e59, 0x1e59,
- 0x1e5b, 0x1e5b,
- 0x1e5d, 0x1e5d,
- 0x1e5f, 0x1e5f,
- 0x1e61, 0x1e61,
- 0x1e63, 0x1e63,
- 0x1e65, 0x1e65,
- 0x1e67, 0x1e67,
- 0x1e69, 0x1e69,
- 0x1e6b, 0x1e6b,
- 0x1e6d, 0x1e6d,
- 0x1e6f, 0x1e6f,
- 0x1e71, 0x1e71,
- 0x1e73, 0x1e73,
- 0x1e75, 0x1e75,
- 0x1e77, 0x1e77,
- 0x1e79, 0x1e79,
- 0x1e7b, 0x1e7b,
- 0x1e7d, 0x1e7d,
- 0x1e7f, 0x1e7f,
- 0x1e81, 0x1e81,
- 0x1e83, 0x1e83,
- 0x1e85, 0x1e85,
- 0x1e87, 0x1e87,
- 0x1e89, 0x1e89,
- 0x1e8b, 0x1e8b,
- 0x1e8d, 0x1e8d,
- 0x1e8f, 0x1e8f,
- 0x1e91, 0x1e91,
- 0x1e93, 0x1e93,
- 0x1e95, 0x1e9d,
- 0x1e9f, 0x1e9f,
- 0x1ea1, 0x1ea1,
- 0x1ea3, 0x1ea3,
- 0x1ea5, 0x1ea5,
- 0x1ea7, 0x1ea7,
- 0x1ea9, 0x1ea9,
- 0x1eab, 0x1eab,
- 0x1ead, 0x1ead,
- 0x1eaf, 0x1eaf,
- 0x1eb1, 0x1eb1,
- 0x1eb3, 0x1eb3,
- 0x1eb5, 0x1eb5,
- 0x1eb7, 0x1eb7,
- 0x1eb9, 0x1eb9,
- 0x1ebb, 0x1ebb,
- 0x1ebd, 0x1ebd,
- 0x1ebf, 0x1ebf,
- 0x1ec1, 0x1ec1,
- 0x1ec3, 0x1ec3,
- 0x1ec5, 0x1ec5,
- 0x1ec7, 0x1ec7,
- 0x1ec9, 0x1ec9,
- 0x1ecb, 0x1ecb,
- 0x1ecd, 0x1ecd,
- 0x1ecf, 0x1ecf,
- 0x1ed1, 0x1ed1,
- 0x1ed3, 0x1ed3,
- 0x1ed5, 0x1ed5,
- 0x1ed7, 0x1ed7,
- 0x1ed9, 0x1ed9,
- 0x1edb, 0x1edb,
- 0x1edd, 0x1edd,
- 0x1edf, 0x1edf,
- 0x1ee1, 0x1ee1,
- 0x1ee3, 0x1ee3,
- 0x1ee5, 0x1ee5,
- 0x1ee7, 0x1ee7,
- 0x1ee9, 0x1ee9,
- 0x1eeb, 0x1eeb,
- 0x1eed, 0x1eed,
- 0x1eef, 0x1eef,
- 0x1ef1, 0x1ef1,
- 0x1ef3, 0x1ef3,
- 0x1ef5, 0x1ef5,
- 0x1ef7, 0x1ef7,
- 0x1ef9, 0x1ef9,
- 0x1efb, 0x1efb,
- 0x1efd, 0x1efd,
- 0x1eff, 0x1f07,
- 0x1f10, 0x1f15,
- 0x1f20, 0x1f27,
- 0x1f30, 0x1f37,
- 0x1f40, 0x1f45,
- 0x1f50, 0x1f57,
- 0x1f60, 0x1f67,
- 0x1f70, 0x1f7d,
- 0x1f80, 0x1f87,
- 0x1f90, 0x1f97,
- 0x1fa0, 0x1fa7,
- 0x1fb0, 0x1fb4,
- 0x1fb6, 0x1fb7,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fc7,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fd7,
- 0x1fe0, 0x1fe7,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ff7,
- 0x2090, 0x2094,
- 0x210a, 0x210a,
- 0x210e, 0x210f,
- 0x2113, 0x2113,
- 0x212f, 0x212f,
- 0x2134, 0x2134,
- 0x2139, 0x2139,
- 0x213c, 0x213d,
- 0x2146, 0x2149,
- 0x214e, 0x214e,
- 0x2170, 0x217f,
- 0x2184, 0x2184,
- 0x24d0, 0x24e9,
- 0x2c30, 0x2c5e,
- 0x2c61, 0x2c61,
- 0x2c65, 0x2c66,
- 0x2c68, 0x2c68,
- 0x2c6a, 0x2c6a,
- 0x2c6c, 0x2c6c,
- 0x2c71, 0x2c71,
- 0x2c73, 0x2c74,
- 0x2c76, 0x2c7d,
- 0x2c81, 0x2c81,
- 0x2c83, 0x2c83,
- 0x2c85, 0x2c85,
- 0x2c87, 0x2c87,
- 0x2c89, 0x2c89,
- 0x2c8b, 0x2c8b,
- 0x2c8d, 0x2c8d,
- 0x2c8f, 0x2c8f,
- 0x2c91, 0x2c91,
- 0x2c93, 0x2c93,
- 0x2c95, 0x2c95,
- 0x2c97, 0x2c97,
- 0x2c99, 0x2c99,
- 0x2c9b, 0x2c9b,
- 0x2c9d, 0x2c9d,
- 0x2c9f, 0x2c9f,
- 0x2ca1, 0x2ca1,
- 0x2ca3, 0x2ca3,
- 0x2ca5, 0x2ca5,
- 0x2ca7, 0x2ca7,
- 0x2ca9, 0x2ca9,
- 0x2cab, 0x2cab,
- 0x2cad, 0x2cad,
- 0x2caf, 0x2caf,
- 0x2cb1, 0x2cb1,
- 0x2cb3, 0x2cb3,
- 0x2cb5, 0x2cb5,
- 0x2cb7, 0x2cb7,
- 0x2cb9, 0x2cb9,
- 0x2cbb, 0x2cbb,
- 0x2cbd, 0x2cbd,
- 0x2cbf, 0x2cbf,
- 0x2cc1, 0x2cc1,
- 0x2cc3, 0x2cc3,
- 0x2cc5, 0x2cc5,
- 0x2cc7, 0x2cc7,
- 0x2cc9, 0x2cc9,
- 0x2ccb, 0x2ccb,
- 0x2ccd, 0x2ccd,
- 0x2ccf, 0x2ccf,
- 0x2cd1, 0x2cd1,
- 0x2cd3, 0x2cd3,
- 0x2cd5, 0x2cd5,
- 0x2cd7, 0x2cd7,
- 0x2cd9, 0x2cd9,
- 0x2cdb, 0x2cdb,
- 0x2cdd, 0x2cdd,
- 0x2cdf, 0x2cdf,
- 0x2ce1, 0x2ce1,
- 0x2ce3, 0x2ce4,
- 0x2cec, 0x2cec,
- 0x2cee, 0x2cee,
- 0x2d00, 0x2d25,
- 0xa641, 0xa641,
- 0xa643, 0xa643,
- 0xa645, 0xa645,
- 0xa647, 0xa647,
- 0xa649, 0xa649,
- 0xa64b, 0xa64b,
- 0xa64d, 0xa64d,
- 0xa64f, 0xa64f,
- 0xa651, 0xa651,
- 0xa653, 0xa653,
- 0xa655, 0xa655,
- 0xa657, 0xa657,
- 0xa659, 0xa659,
- 0xa65b, 0xa65b,
- 0xa65d, 0xa65d,
- 0xa65f, 0xa65f,
- 0xa661, 0xa661,
- 0xa663, 0xa663,
- 0xa665, 0xa665,
- 0xa667, 0xa667,
- 0xa669, 0xa669,
- 0xa66b, 0xa66b,
- 0xa66d, 0xa66d,
- 0xa681, 0xa681,
- 0xa683, 0xa683,
- 0xa685, 0xa685,
- 0xa687, 0xa687,
- 0xa689, 0xa689,
- 0xa68b, 0xa68b,
- 0xa68d, 0xa68d,
- 0xa68f, 0xa68f,
- 0xa691, 0xa691,
- 0xa693, 0xa693,
- 0xa695, 0xa695,
- 0xa697, 0xa697,
- 0xa723, 0xa723,
- 0xa725, 0xa725,
- 0xa727, 0xa727,
- 0xa729, 0xa729,
- 0xa72b, 0xa72b,
- 0xa72d, 0xa72d,
- 0xa72f, 0xa731,
- 0xa733, 0xa733,
- 0xa735, 0xa735,
- 0xa737, 0xa737,
- 0xa739, 0xa739,
- 0xa73b, 0xa73b,
- 0xa73d, 0xa73d,
- 0xa73f, 0xa73f,
- 0xa741, 0xa741,
- 0xa743, 0xa743,
- 0xa745, 0xa745,
- 0xa747, 0xa747,
- 0xa749, 0xa749,
- 0xa74b, 0xa74b,
- 0xa74d, 0xa74d,
- 0xa74f, 0xa74f,
- 0xa751, 0xa751,
- 0xa753, 0xa753,
- 0xa755, 0xa755,
- 0xa757, 0xa757,
- 0xa759, 0xa759,
- 0xa75b, 0xa75b,
- 0xa75d, 0xa75d,
- 0xa75f, 0xa75f,
- 0xa761, 0xa761,
- 0xa763, 0xa763,
- 0xa765, 0xa765,
- 0xa767, 0xa767,
- 0xa769, 0xa769,
- 0xa76b, 0xa76b,
- 0xa76d, 0xa76d,
- 0xa76f, 0xa778,
- 0xa77a, 0xa77a,
- 0xa77c, 0xa77c,
- 0xa77f, 0xa77f,
- 0xa781, 0xa781,
- 0xa783, 0xa783,
- 0xa785, 0xa785,
- 0xa787, 0xa787,
- 0xa78c, 0xa78c,
- 0xa78e, 0xa78e,
- 0xa791, 0xa791,
- 0xa7a1, 0xa7a1,
- 0xa7a3, 0xa7a3,
- 0xa7a5, 0xa7a5,
- 0xa7a7, 0xa7a7,
- 0xa7a9, 0xa7a9,
- 0xa7fa, 0xa7fa,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xff41, 0xff5a,
- 0x10428, 0x1044f,
- 0x1d41a, 0x1d433,
- 0x1d44e, 0x1d454,
- 0x1d456, 0x1d467,
- 0x1d482, 0x1d49b,
- 0x1d4b6, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d4cf,
- 0x1d4ea, 0x1d503,
- 0x1d51e, 0x1d537,
- 0x1d552, 0x1d56b,
- 0x1d586, 0x1d59f,
- 0x1d5ba, 0x1d5d3,
- 0x1d5ee, 0x1d607,
- 0x1d622, 0x1d63b,
- 0x1d656, 0x1d66f,
- 0x1d68a, 0x1d6a5,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6e1,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d71b,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d755,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d78f,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7c9,
- 0x1d7cb, 0x1d7cb,
-}; /* CR_Lowercase */
+#define CR_Lowercase CR_Lower
/* 'Uppercase': Derived Property */
-static const OnigCodePoint CR_Uppercase[] = {
- 605,
- 0x0041, 0x005a,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00de,
- 0x0100, 0x0100,
- 0x0102, 0x0102,
- 0x0104, 0x0104,
- 0x0106, 0x0106,
- 0x0108, 0x0108,
- 0x010a, 0x010a,
- 0x010c, 0x010c,
- 0x010e, 0x010e,
- 0x0110, 0x0110,
- 0x0112, 0x0112,
- 0x0114, 0x0114,
- 0x0116, 0x0116,
- 0x0118, 0x0118,
- 0x011a, 0x011a,
- 0x011c, 0x011c,
- 0x011e, 0x011e,
- 0x0120, 0x0120,
- 0x0122, 0x0122,
- 0x0124, 0x0124,
- 0x0126, 0x0126,
- 0x0128, 0x0128,
- 0x012a, 0x012a,
- 0x012c, 0x012c,
- 0x012e, 0x012e,
- 0x0130, 0x0130,
- 0x0132, 0x0132,
- 0x0134, 0x0134,
- 0x0136, 0x0136,
- 0x0139, 0x0139,
- 0x013b, 0x013b,
- 0x013d, 0x013d,
- 0x013f, 0x013f,
- 0x0141, 0x0141,
- 0x0143, 0x0143,
- 0x0145, 0x0145,
- 0x0147, 0x0147,
- 0x014a, 0x014a,
- 0x014c, 0x014c,
- 0x014e, 0x014e,
- 0x0150, 0x0150,
- 0x0152, 0x0152,
- 0x0154, 0x0154,
- 0x0156, 0x0156,
- 0x0158, 0x0158,
- 0x015a, 0x015a,
- 0x015c, 0x015c,
- 0x015e, 0x015e,
- 0x0160, 0x0160,
- 0x0162, 0x0162,
- 0x0164, 0x0164,
- 0x0166, 0x0166,
- 0x0168, 0x0168,
- 0x016a, 0x016a,
- 0x016c, 0x016c,
- 0x016e, 0x016e,
- 0x0170, 0x0170,
- 0x0172, 0x0172,
- 0x0174, 0x0174,
- 0x0176, 0x0176,
- 0x0178, 0x0179,
- 0x017b, 0x017b,
- 0x017d, 0x017d,
- 0x0181, 0x0182,
- 0x0184, 0x0184,
- 0x0186, 0x0187,
- 0x0189, 0x018b,
- 0x018e, 0x0191,
- 0x0193, 0x0194,
- 0x0196, 0x0198,
- 0x019c, 0x019d,
- 0x019f, 0x01a0,
- 0x01a2, 0x01a2,
- 0x01a4, 0x01a4,
- 0x01a6, 0x01a7,
- 0x01a9, 0x01a9,
- 0x01ac, 0x01ac,
- 0x01ae, 0x01af,
- 0x01b1, 0x01b3,
- 0x01b5, 0x01b5,
- 0x01b7, 0x01b8,
- 0x01bc, 0x01bc,
- 0x01c4, 0x01c4,
- 0x01c7, 0x01c7,
- 0x01ca, 0x01ca,
- 0x01cd, 0x01cd,
- 0x01cf, 0x01cf,
- 0x01d1, 0x01d1,
- 0x01d3, 0x01d3,
- 0x01d5, 0x01d5,
- 0x01d7, 0x01d7,
- 0x01d9, 0x01d9,
- 0x01db, 0x01db,
- 0x01de, 0x01de,
- 0x01e0, 0x01e0,
- 0x01e2, 0x01e2,
- 0x01e4, 0x01e4,
- 0x01e6, 0x01e6,
- 0x01e8, 0x01e8,
- 0x01ea, 0x01ea,
- 0x01ec, 0x01ec,
- 0x01ee, 0x01ee,
- 0x01f1, 0x01f1,
- 0x01f4, 0x01f4,
- 0x01f6, 0x01f8,
- 0x01fa, 0x01fa,
- 0x01fc, 0x01fc,
- 0x01fe, 0x01fe,
- 0x0200, 0x0200,
- 0x0202, 0x0202,
- 0x0204, 0x0204,
- 0x0206, 0x0206,
- 0x0208, 0x0208,
- 0x020a, 0x020a,
- 0x020c, 0x020c,
- 0x020e, 0x020e,
- 0x0210, 0x0210,
- 0x0212, 0x0212,
- 0x0214, 0x0214,
- 0x0216, 0x0216,
- 0x0218, 0x0218,
- 0x021a, 0x021a,
- 0x021c, 0x021c,
- 0x021e, 0x021e,
- 0x0220, 0x0220,
- 0x0222, 0x0222,
- 0x0224, 0x0224,
- 0x0226, 0x0226,
- 0x0228, 0x0228,
- 0x022a, 0x022a,
- 0x022c, 0x022c,
- 0x022e, 0x022e,
- 0x0230, 0x0230,
- 0x0232, 0x0232,
- 0x023a, 0x023b,
- 0x023d, 0x023e,
- 0x0241, 0x0241,
- 0x0243, 0x0246,
- 0x0248, 0x0248,
- 0x024a, 0x024a,
- 0x024c, 0x024c,
- 0x024e, 0x024e,
- 0x0370, 0x0370,
- 0x0372, 0x0372,
- 0x0376, 0x0376,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x038f,
- 0x0391, 0x03a1,
- 0x03a3, 0x03ab,
- 0x03cf, 0x03cf,
- 0x03d2, 0x03d4,
- 0x03d8, 0x03d8,
- 0x03da, 0x03da,
- 0x03dc, 0x03dc,
- 0x03de, 0x03de,
- 0x03e0, 0x03e0,
- 0x03e2, 0x03e2,
- 0x03e4, 0x03e4,
- 0x03e6, 0x03e6,
- 0x03e8, 0x03e8,
- 0x03ea, 0x03ea,
- 0x03ec, 0x03ec,
- 0x03ee, 0x03ee,
- 0x03f4, 0x03f4,
- 0x03f7, 0x03f7,
- 0x03f9, 0x03fa,
- 0x03fd, 0x042f,
- 0x0460, 0x0460,
- 0x0462, 0x0462,
- 0x0464, 0x0464,
- 0x0466, 0x0466,
- 0x0468, 0x0468,
- 0x046a, 0x046a,
- 0x046c, 0x046c,
- 0x046e, 0x046e,
- 0x0470, 0x0470,
- 0x0472, 0x0472,
- 0x0474, 0x0474,
- 0x0476, 0x0476,
- 0x0478, 0x0478,
- 0x047a, 0x047a,
- 0x047c, 0x047c,
- 0x047e, 0x047e,
- 0x0480, 0x0480,
- 0x048a, 0x048a,
- 0x048c, 0x048c,
- 0x048e, 0x048e,
- 0x0490, 0x0490,
- 0x0492, 0x0492,
- 0x0494, 0x0494,
- 0x0496, 0x0496,
- 0x0498, 0x0498,
- 0x049a, 0x049a,
- 0x049c, 0x049c,
- 0x049e, 0x049e,
- 0x04a0, 0x04a0,
- 0x04a2, 0x04a2,
- 0x04a4, 0x04a4,
- 0x04a6, 0x04a6,
- 0x04a8, 0x04a8,
- 0x04aa, 0x04aa,
- 0x04ac, 0x04ac,
- 0x04ae, 0x04ae,
- 0x04b0, 0x04b0,
- 0x04b2, 0x04b2,
- 0x04b4, 0x04b4,
- 0x04b6, 0x04b6,
- 0x04b8, 0x04b8,
- 0x04ba, 0x04ba,
- 0x04bc, 0x04bc,
- 0x04be, 0x04be,
- 0x04c0, 0x04c1,
- 0x04c3, 0x04c3,
- 0x04c5, 0x04c5,
- 0x04c7, 0x04c7,
- 0x04c9, 0x04c9,
- 0x04cb, 0x04cb,
- 0x04cd, 0x04cd,
- 0x04d0, 0x04d0,
- 0x04d2, 0x04d2,
- 0x04d4, 0x04d4,
- 0x04d6, 0x04d6,
- 0x04d8, 0x04d8,
- 0x04da, 0x04da,
- 0x04dc, 0x04dc,
- 0x04de, 0x04de,
- 0x04e0, 0x04e0,
- 0x04e2, 0x04e2,
- 0x04e4, 0x04e4,
- 0x04e6, 0x04e6,
- 0x04e8, 0x04e8,
- 0x04ea, 0x04ea,
- 0x04ec, 0x04ec,
- 0x04ee, 0x04ee,
- 0x04f0, 0x04f0,
- 0x04f2, 0x04f2,
- 0x04f4, 0x04f4,
- 0x04f6, 0x04f6,
- 0x04f8, 0x04f8,
- 0x04fa, 0x04fa,
- 0x04fc, 0x04fc,
- 0x04fe, 0x04fe,
- 0x0500, 0x0500,
- 0x0502, 0x0502,
- 0x0504, 0x0504,
- 0x0506, 0x0506,
- 0x0508, 0x0508,
- 0x050a, 0x050a,
- 0x050c, 0x050c,
- 0x050e, 0x050e,
- 0x0510, 0x0510,
- 0x0512, 0x0512,
- 0x0514, 0x0514,
- 0x0516, 0x0516,
- 0x0518, 0x0518,
- 0x051a, 0x051a,
- 0x051c, 0x051c,
- 0x051e, 0x051e,
- 0x0520, 0x0520,
- 0x0522, 0x0522,
- 0x0524, 0x0524,
- 0x0526, 0x0526,
- 0x0531, 0x0556,
- 0x10a0, 0x10c5,
- 0x1e00, 0x1e00,
- 0x1e02, 0x1e02,
- 0x1e04, 0x1e04,
- 0x1e06, 0x1e06,
- 0x1e08, 0x1e08,
- 0x1e0a, 0x1e0a,
- 0x1e0c, 0x1e0c,
- 0x1e0e, 0x1e0e,
- 0x1e10, 0x1e10,
- 0x1e12, 0x1e12,
- 0x1e14, 0x1e14,
- 0x1e16, 0x1e16,
- 0x1e18, 0x1e18,
- 0x1e1a, 0x1e1a,
- 0x1e1c, 0x1e1c,
- 0x1e1e, 0x1e1e,
- 0x1e20, 0x1e20,
- 0x1e22, 0x1e22,
- 0x1e24, 0x1e24,
- 0x1e26, 0x1e26,
- 0x1e28, 0x1e28,
- 0x1e2a, 0x1e2a,
- 0x1e2c, 0x1e2c,
- 0x1e2e, 0x1e2e,
- 0x1e30, 0x1e30,
- 0x1e32, 0x1e32,
- 0x1e34, 0x1e34,
- 0x1e36, 0x1e36,
- 0x1e38, 0x1e38,
- 0x1e3a, 0x1e3a,
- 0x1e3c, 0x1e3c,
- 0x1e3e, 0x1e3e,
- 0x1e40, 0x1e40,
- 0x1e42, 0x1e42,
- 0x1e44, 0x1e44,
- 0x1e46, 0x1e46,
- 0x1e48, 0x1e48,
- 0x1e4a, 0x1e4a,
- 0x1e4c, 0x1e4c,
- 0x1e4e, 0x1e4e,
- 0x1e50, 0x1e50,
- 0x1e52, 0x1e52,
- 0x1e54, 0x1e54,
- 0x1e56, 0x1e56,
- 0x1e58, 0x1e58,
- 0x1e5a, 0x1e5a,
- 0x1e5c, 0x1e5c,
- 0x1e5e, 0x1e5e,
- 0x1e60, 0x1e60,
- 0x1e62, 0x1e62,
- 0x1e64, 0x1e64,
- 0x1e66, 0x1e66,
- 0x1e68, 0x1e68,
- 0x1e6a, 0x1e6a,
- 0x1e6c, 0x1e6c,
- 0x1e6e, 0x1e6e,
- 0x1e70, 0x1e70,
- 0x1e72, 0x1e72,
- 0x1e74, 0x1e74,
- 0x1e76, 0x1e76,
- 0x1e78, 0x1e78,
- 0x1e7a, 0x1e7a,
- 0x1e7c, 0x1e7c,
- 0x1e7e, 0x1e7e,
- 0x1e80, 0x1e80,
- 0x1e82, 0x1e82,
- 0x1e84, 0x1e84,
- 0x1e86, 0x1e86,
- 0x1e88, 0x1e88,
- 0x1e8a, 0x1e8a,
- 0x1e8c, 0x1e8c,
- 0x1e8e, 0x1e8e,
- 0x1e90, 0x1e90,
- 0x1e92, 0x1e92,
- 0x1e94, 0x1e94,
- 0x1e9e, 0x1e9e,
- 0x1ea0, 0x1ea0,
- 0x1ea2, 0x1ea2,
- 0x1ea4, 0x1ea4,
- 0x1ea6, 0x1ea6,
- 0x1ea8, 0x1ea8,
- 0x1eaa, 0x1eaa,
- 0x1eac, 0x1eac,
- 0x1eae, 0x1eae,
- 0x1eb0, 0x1eb0,
- 0x1eb2, 0x1eb2,
- 0x1eb4, 0x1eb4,
- 0x1eb6, 0x1eb6,
- 0x1eb8, 0x1eb8,
- 0x1eba, 0x1eba,
- 0x1ebc, 0x1ebc,
- 0x1ebe, 0x1ebe,
- 0x1ec0, 0x1ec0,
- 0x1ec2, 0x1ec2,
- 0x1ec4, 0x1ec4,
- 0x1ec6, 0x1ec6,
- 0x1ec8, 0x1ec8,
- 0x1eca, 0x1eca,
- 0x1ecc, 0x1ecc,
- 0x1ece, 0x1ece,
- 0x1ed0, 0x1ed0,
- 0x1ed2, 0x1ed2,
- 0x1ed4, 0x1ed4,
- 0x1ed6, 0x1ed6,
- 0x1ed8, 0x1ed8,
- 0x1eda, 0x1eda,
- 0x1edc, 0x1edc,
- 0x1ede, 0x1ede,
- 0x1ee0, 0x1ee0,
- 0x1ee2, 0x1ee2,
- 0x1ee4, 0x1ee4,
- 0x1ee6, 0x1ee6,
- 0x1ee8, 0x1ee8,
- 0x1eea, 0x1eea,
- 0x1eec, 0x1eec,
- 0x1eee, 0x1eee,
- 0x1ef0, 0x1ef0,
- 0x1ef2, 0x1ef2,
- 0x1ef4, 0x1ef4,
- 0x1ef6, 0x1ef6,
- 0x1ef8, 0x1ef8,
- 0x1efa, 0x1efa,
- 0x1efc, 0x1efc,
- 0x1efe, 0x1efe,
- 0x1f08, 0x1f0f,
- 0x1f18, 0x1f1d,
- 0x1f28, 0x1f2f,
- 0x1f38, 0x1f3f,
- 0x1f48, 0x1f4d,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f5f,
- 0x1f68, 0x1f6f,
- 0x1fb8, 0x1fbb,
- 0x1fc8, 0x1fcb,
- 0x1fd8, 0x1fdb,
- 0x1fe8, 0x1fec,
- 0x1ff8, 0x1ffb,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210b, 0x210d,
- 0x2110, 0x2112,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x2130, 0x2133,
- 0x213e, 0x213f,
- 0x2145, 0x2145,
- 0x2160, 0x216f,
- 0x2183, 0x2183,
- 0x24b6, 0x24cf,
- 0x2c00, 0x2c2e,
- 0x2c60, 0x2c60,
- 0x2c62, 0x2c64,
- 0x2c67, 0x2c67,
- 0x2c69, 0x2c69,
- 0x2c6b, 0x2c6b,
- 0x2c6d, 0x2c70,
- 0x2c72, 0x2c72,
- 0x2c75, 0x2c75,
- 0x2c7e, 0x2c80,
- 0x2c82, 0x2c82,
- 0x2c84, 0x2c84,
- 0x2c86, 0x2c86,
- 0x2c88, 0x2c88,
- 0x2c8a, 0x2c8a,
- 0x2c8c, 0x2c8c,
- 0x2c8e, 0x2c8e,
- 0x2c90, 0x2c90,
- 0x2c92, 0x2c92,
- 0x2c94, 0x2c94,
- 0x2c96, 0x2c96,
- 0x2c98, 0x2c98,
- 0x2c9a, 0x2c9a,
- 0x2c9c, 0x2c9c,
- 0x2c9e, 0x2c9e,
- 0x2ca0, 0x2ca0,
- 0x2ca2, 0x2ca2,
- 0x2ca4, 0x2ca4,
- 0x2ca6, 0x2ca6,
- 0x2ca8, 0x2ca8,
- 0x2caa, 0x2caa,
- 0x2cac, 0x2cac,
- 0x2cae, 0x2cae,
- 0x2cb0, 0x2cb0,
- 0x2cb2, 0x2cb2,
- 0x2cb4, 0x2cb4,
- 0x2cb6, 0x2cb6,
- 0x2cb8, 0x2cb8,
- 0x2cba, 0x2cba,
- 0x2cbc, 0x2cbc,
- 0x2cbe, 0x2cbe,
- 0x2cc0, 0x2cc0,
- 0x2cc2, 0x2cc2,
- 0x2cc4, 0x2cc4,
- 0x2cc6, 0x2cc6,
- 0x2cc8, 0x2cc8,
- 0x2cca, 0x2cca,
- 0x2ccc, 0x2ccc,
- 0x2cce, 0x2cce,
- 0x2cd0, 0x2cd0,
- 0x2cd2, 0x2cd2,
- 0x2cd4, 0x2cd4,
- 0x2cd6, 0x2cd6,
- 0x2cd8, 0x2cd8,
- 0x2cda, 0x2cda,
- 0x2cdc, 0x2cdc,
- 0x2cde, 0x2cde,
- 0x2ce0, 0x2ce0,
- 0x2ce2, 0x2ce2,
- 0x2ceb, 0x2ceb,
- 0x2ced, 0x2ced,
- 0xa640, 0xa640,
- 0xa642, 0xa642,
- 0xa644, 0xa644,
- 0xa646, 0xa646,
- 0xa648, 0xa648,
- 0xa64a, 0xa64a,
- 0xa64c, 0xa64c,
- 0xa64e, 0xa64e,
- 0xa650, 0xa650,
- 0xa652, 0xa652,
- 0xa654, 0xa654,
- 0xa656, 0xa656,
- 0xa658, 0xa658,
- 0xa65a, 0xa65a,
- 0xa65c, 0xa65c,
- 0xa65e, 0xa65e,
- 0xa660, 0xa660,
- 0xa662, 0xa662,
- 0xa664, 0xa664,
- 0xa666, 0xa666,
- 0xa668, 0xa668,
- 0xa66a, 0xa66a,
- 0xa66c, 0xa66c,
- 0xa680, 0xa680,
- 0xa682, 0xa682,
- 0xa684, 0xa684,
- 0xa686, 0xa686,
- 0xa688, 0xa688,
- 0xa68a, 0xa68a,
- 0xa68c, 0xa68c,
- 0xa68e, 0xa68e,
- 0xa690, 0xa690,
- 0xa692, 0xa692,
- 0xa694, 0xa694,
- 0xa696, 0xa696,
- 0xa722, 0xa722,
- 0xa724, 0xa724,
- 0xa726, 0xa726,
- 0xa728, 0xa728,
- 0xa72a, 0xa72a,
- 0xa72c, 0xa72c,
- 0xa72e, 0xa72e,
- 0xa732, 0xa732,
- 0xa734, 0xa734,
- 0xa736, 0xa736,
- 0xa738, 0xa738,
- 0xa73a, 0xa73a,
- 0xa73c, 0xa73c,
- 0xa73e, 0xa73e,
- 0xa740, 0xa740,
- 0xa742, 0xa742,
- 0xa744, 0xa744,
- 0xa746, 0xa746,
- 0xa748, 0xa748,
- 0xa74a, 0xa74a,
- 0xa74c, 0xa74c,
- 0xa74e, 0xa74e,
- 0xa750, 0xa750,
- 0xa752, 0xa752,
- 0xa754, 0xa754,
- 0xa756, 0xa756,
- 0xa758, 0xa758,
- 0xa75a, 0xa75a,
- 0xa75c, 0xa75c,
- 0xa75e, 0xa75e,
- 0xa760, 0xa760,
- 0xa762, 0xa762,
- 0xa764, 0xa764,
- 0xa766, 0xa766,
- 0xa768, 0xa768,
- 0xa76a, 0xa76a,
- 0xa76c, 0xa76c,
- 0xa76e, 0xa76e,
- 0xa779, 0xa779,
- 0xa77b, 0xa77b,
- 0xa77d, 0xa77e,
- 0xa780, 0xa780,
- 0xa782, 0xa782,
- 0xa784, 0xa784,
- 0xa786, 0xa786,
- 0xa78b, 0xa78b,
- 0xa78d, 0xa78d,
- 0xa790, 0xa790,
- 0xa7a0, 0xa7a0,
- 0xa7a2, 0xa7a2,
- 0xa7a4, 0xa7a4,
- 0xa7a6, 0xa7a6,
- 0xa7a8, 0xa7a8,
- 0xff21, 0xff3a,
- 0x10400, 0x10427,
- 0x1d400, 0x1d419,
- 0x1d434, 0x1d44d,
- 0x1d468, 0x1d481,
- 0x1d49c, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b5,
- 0x1d4d0, 0x1d4e9,
- 0x1d504, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d538, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d56c, 0x1d585,
- 0x1d5a0, 0x1d5b9,
- 0x1d5d4, 0x1d5ed,
- 0x1d608, 0x1d621,
- 0x1d63c, 0x1d655,
- 0x1d670, 0x1d689,
- 0x1d6a8, 0x1d6c0,
- 0x1d6e2, 0x1d6fa,
- 0x1d71c, 0x1d734,
- 0x1d756, 0x1d76e,
- 0x1d790, 0x1d7a8,
- 0x1d7ca, 0x1d7ca,
-}; /* CR_Uppercase */
+#define CR_Uppercase CR_Upper
/* 'Cased': Derived Property */
static const OnigCodePoint CR_Cased[] = {
- 112,
+ 119,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -6797,6 +10064,8 @@ static const OnigCodePoint CR_Cased[] = {
0x0531, 0x0556,
0x0561, 0x0587,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x1d00, 0x1dbf,
0x1e00, 0x1f15,
0x1f18, 0x1f1d,
@@ -6817,7 +10086,9 @@ static const OnigCodePoint CR_Cased[] = {
0x1fe0, 0x1fec,
0x1ff2, 0x1ff4,
0x1ff6, 0x1ffc,
- 0x2090, 0x2094,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
0x2102, 0x2102,
0x2107, 0x2107,
0x210a, 0x2113,
@@ -6839,14 +10110,17 @@ static const OnigCodePoint CR_Cased[] = {
0x2c30, 0x2c5e,
0x2c60, 0x2ce4,
0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
0xa640, 0xa66d,
0xa680, 0xa697,
0xa722, 0xa787,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa7fa,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa7fa,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
0xff21, 0xff3a,
@@ -6886,7 +10160,7 @@ static const OnigCodePoint CR_Cased[] = {
/* 'Case_Ignorable': Derived Property */
static const OnigCodePoint CR_Case_Ignorable[] = {
- 277,
+ 295,
0x0027, 0x0027,
0x002e, 0x002e,
0x003a, 0x003a,
@@ -6910,7 +10184,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x05c4, 0x05c5,
0x05c7, 0x05c7,
0x05f4, 0x05f4,
- 0x0600, 0x0603,
+ 0x0600, 0x0604,
0x0610, 0x061a,
0x0640, 0x0640,
0x064b, 0x065f,
@@ -6926,6 +10200,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x07fa, 0x07fa,
0x0816, 0x082d,
0x0859, 0x085b,
+ 0x08e4, 0x08fe,
0x0900, 0x0902,
0x093a, 0x093a,
0x093c, 0x093c,
@@ -7045,6 +10320,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x1b80, 0x1b81,
0x1ba2, 0x1ba5,
0x1ba8, 0x1ba9,
+ 0x1bab, 0x1bab,
0x1be6, 0x1be6,
0x1be8, 0x1be9,
0x1bed, 0x1bed,
@@ -7056,7 +10332,8 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x1cd4, 0x1ce0,
0x1ce2, 0x1ce8,
0x1ced, 0x1ced,
- 0x1d2c, 0x1d61,
+ 0x1cf4, 0x1cf4,
+ 0x1d2c, 0x1d6a,
0x1d78, 0x1d78,
0x1d9b, 0x1de6,
0x1dfc, 0x1dff,
@@ -7077,14 +10354,14 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x207f, 0x207f,
0x2090, 0x209c,
0x20d0, 0x20f0,
- 0x2c7d, 0x2c7d,
+ 0x2c7c, 0x2c7d,
0x2cef, 0x2cf1,
0x2d6f, 0x2d6f,
0x2d7f, 0x2d7f,
0x2de0, 0x2dff,
0x2e2f, 0x2e2f,
0x3005, 0x3005,
- 0x302a, 0x302f,
+ 0x302a, 0x302d,
0x3031, 0x3035,
0x303b, 0x303b,
0x3099, 0x309e,
@@ -7093,12 +10370,14 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0xa4f8, 0xa4fd,
0xa60c, 0xa60c,
0xa66f, 0xa672,
- 0xa67c, 0xa67d,
+ 0xa674, 0xa67d,
0xa67f, 0xa67f,
+ 0xa69f, 0xa69f,
0xa6f0, 0xa6f1,
0xa700, 0xa721,
0xa770, 0xa770,
0xa788, 0xa78a,
+ 0xa7f8, 0xa7f9,
0xa802, 0xa802,
0xa806, 0xa806,
0xa80b, 0xa80b,
@@ -7124,6 +10403,9 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0xaabe, 0xaabf,
0xaac1, 0xaac1,
0xaadd, 0xaadd,
+ 0xaaec, 0xaaed,
+ 0xaaf3, 0xaaf4,
+ 0xaaf6, 0xaaf6,
0xabe5, 0xabe5,
0xabe8, 0xabe8,
0xabed, 0xabed,
@@ -7156,6 +10438,16 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x110b3, 0x110b6,
0x110b9, 0x110ba,
0x110bd, 0x110bd,
+ 0x11100, 0x11102,
+ 0x11127, 0x1112b,
+ 0x1112d, 0x11134,
+ 0x11180, 0x11181,
+ 0x111b6, 0x111be,
+ 0x116ab, 0x116ab,
+ 0x116ad, 0x116ad,
+ 0x116b0, 0x116b5,
+ 0x116b7, 0x116b7,
+ 0x16f8f, 0x16f9f,
0x1d167, 0x1d169,
0x1d173, 0x1d182,
0x1d185, 0x1d18b,
@@ -7168,7 +10460,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
/* 'Changes_When_Lowercased': Derived Property */
static const OnigCodePoint CR_Changes_When_Lowercased[] = {
- 566,
+ 571,
0x0041, 0x005a,
0x00c0, 0x00d6,
0x00d8, 0x00de,
@@ -7436,6 +10728,8 @@ static const OnigCodePoint CR_Changes_When_Lowercased[] = {
0x0526, 0x0526,
0x0531, 0x0556,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x1e00, 0x1e00,
0x1e02, 0x1e02,
0x1e04, 0x1e04,
@@ -7645,6 +10939,7 @@ static const OnigCodePoint CR_Changes_When_Lowercased[] = {
0x2ce2, 0x2ce2,
0x2ceb, 0x2ceb,
0x2ced, 0x2ced,
+ 0x2cf2, 0x2cf2,
0xa640, 0xa640,
0xa642, 0xa642,
0xa644, 0xa644,
@@ -7728,18 +11023,20 @@ static const OnigCodePoint CR_Changes_When_Lowercased[] = {
0xa78b, 0xa78b,
0xa78d, 0xa78d,
0xa790, 0xa790,
+ 0xa792, 0xa792,
0xa7a0, 0xa7a0,
0xa7a2, 0xa7a2,
0xa7a4, 0xa7a4,
0xa7a6, 0xa7a6,
0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
0xff21, 0xff3a,
0x10400, 0x10427,
}; /* CR_Changes_When_Lowercased */
/* 'Changes_When_Uppercased': Derived Property */
static const OnigCodePoint CR_Changes_When_Uppercased[] = {
- 582,
+ 586,
0x0061, 0x007a,
0x00b5, 0x00b5,
0x00df, 0x00f6,
@@ -7889,7 +11186,7 @@ static const OnigCodePoint CR_Changes_When_Uppercased[] = {
0x025b, 0x025b,
0x0260, 0x0260,
0x0263, 0x0263,
- 0x0265, 0x0265,
+ 0x0265, 0x0266,
0x0268, 0x0269,
0x026b, 0x026b,
0x026f, 0x026f,
@@ -8230,7 +11527,10 @@ static const OnigCodePoint CR_Changes_When_Uppercased[] = {
0x2ce3, 0x2ce3,
0x2cec, 0x2cec,
0x2cee, 0x2cee,
+ 0x2cf3, 0x2cf3,
0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
0xa641, 0xa641,
0xa643, 0xa643,
0xa645, 0xa645,
@@ -8313,6 +11613,7 @@ static const OnigCodePoint CR_Changes_When_Uppercased[] = {
0xa787, 0xa787,
0xa78c, 0xa78c,
0xa791, 0xa791,
+ 0xa793, 0xa793,
0xa7a1, 0xa7a1,
0xa7a3, 0xa7a3,
0xa7a5, 0xa7a5,
@@ -8326,7 +11627,7 @@ static const OnigCodePoint CR_Changes_When_Uppercased[] = {
/* 'Changes_When_Titlecased': Derived Property */
static const OnigCodePoint CR_Changes_When_Titlecased[] = {
- 583,
+ 587,
0x0061, 0x007a,
0x00b5, 0x00b5,
0x00df, 0x00f6,
@@ -8477,7 +11778,7 @@ static const OnigCodePoint CR_Changes_When_Titlecased[] = {
0x025b, 0x025b,
0x0260, 0x0260,
0x0263, 0x0263,
- 0x0265, 0x0265,
+ 0x0265, 0x0266,
0x0268, 0x0269,
0x026b, 0x026b,
0x026f, 0x026f,
@@ -8818,7 +12119,10 @@ static const OnigCodePoint CR_Changes_When_Titlecased[] = {
0x2ce3, 0x2ce3,
0x2cec, 0x2cec,
0x2cee, 0x2cee,
+ 0x2cf3, 0x2cf3,
0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
0xa641, 0xa641,
0xa643, 0xa643,
0xa645, 0xa645,
@@ -8901,6 +12205,7 @@ static const OnigCodePoint CR_Changes_When_Titlecased[] = {
0xa787, 0xa787,
0xa78c, 0xa78c,
0xa791, 0xa791,
+ 0xa793, 0xa793,
0xa7a1, 0xa7a1,
0xa7a3, 0xa7a3,
0xa7a5, 0xa7a5,
@@ -8914,7 +12219,7 @@ static const OnigCodePoint CR_Changes_When_Titlecased[] = {
/* 'Changes_When_Casefolded': Derived Property */
static const OnigCodePoint CR_Changes_When_Casefolded[] = {
- 577,
+ 582,
0x0041, 0x005a,
0x00b5, 0x00b5,
0x00c0, 0x00d6,
@@ -9189,6 +12494,8 @@ static const OnigCodePoint CR_Changes_When_Casefolded[] = {
0x0531, 0x0556,
0x0587, 0x0587,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x1e00, 0x1e00,
0x1e02, 0x1e02,
0x1e04, 0x1e04,
@@ -9400,6 +12707,7 @@ static const OnigCodePoint CR_Changes_When_Casefolded[] = {
0x2ce2, 0x2ce2,
0x2ceb, 0x2ceb,
0x2ced, 0x2ced,
+ 0x2cf2, 0x2cf2,
0xa640, 0xa640,
0xa642, 0xa642,
0xa644, 0xa644,
@@ -9483,11 +12791,13 @@ static const OnigCodePoint CR_Changes_When_Casefolded[] = {
0xa78b, 0xa78b,
0xa78d, 0xa78d,
0xa790, 0xa790,
+ 0xa792, 0xa792,
0xa7a0, 0xa7a0,
0xa7a2, 0xa7a2,
0xa7a4, 0xa7a4,
0xa7a6, 0xa7a6,
0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
0xff21, 0xff3a,
@@ -9496,7 +12806,7 @@ static const OnigCodePoint CR_Changes_When_Casefolded[] = {
/* 'Changes_When_Casemapped': Derived Property */
static const OnigCodePoint CR_Changes_When_Casemapped[] = {
- 99,
+ 104,
0x0041, 0x005a,
0x0061, 0x007a,
0x00b5, 0x00b5,
@@ -9517,7 +12827,7 @@ static const OnigCodePoint CR_Changes_When_Casemapped[] = {
0x025b, 0x025b,
0x0260, 0x0260,
0x0263, 0x0263,
- 0x0265, 0x0265,
+ 0x0265, 0x0266,
0x0268, 0x0269,
0x026b, 0x026b,
0x026f, 0x026f,
@@ -9545,6 +12855,8 @@ static const OnigCodePoint CR_Changes_When_Casemapped[] = {
0x0531, 0x0556,
0x0561, 0x0587,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x1d79, 0x1d79,
0x1d7d, 0x1d7d,
0x1e00, 0x1e9b,
@@ -9582,15 +12894,18 @@ static const OnigCodePoint CR_Changes_When_Casemapped[] = {
0x2c75, 0x2c76,
0x2c7e, 0x2ce3,
0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
0xa640, 0xa66d,
0xa680, 0xa697,
0xa722, 0xa72f,
0xa732, 0xa76f,
0xa779, 0xa787,
0xa78b, 0xa78d,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
0xff21, 0xff3a,
@@ -9600,7 +12915,7 @@ static const OnigCodePoint CR_Changes_When_Casemapped[] = {
/* 'ID_Start': Derived Property */
static const OnigCodePoint CR_ID_Start[] = {
- 437,
+ 488,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -9648,6 +12963,8 @@ static const OnigCodePoint CR_ID_Start[] = {
0x0824, 0x0824,
0x0828, 0x0828,
0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
0x0904, 0x0939,
0x093d, 0x093d,
0x0950, 0x0950,
@@ -9753,7 +13070,7 @@ static const OnigCodePoint CR_ID_Start[] = {
0x0ebd, 0x0ebd,
0x0ec0, 0x0ec4,
0x0ec6, 0x0ec6,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f00,
0x0f40, 0x0f47,
0x0f49, 0x0f6c,
@@ -9768,9 +13085,10 @@ static const OnigCodePoint CR_ID_Start[] = {
0x1075, 0x1081,
0x108e, 0x108e,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
+ 0x10fc, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -9818,12 +13136,13 @@ static const OnigCodePoint CR_ID_Start[] = {
0x1b45, 0x1b4b,
0x1b83, 0x1ba0,
0x1bae, 0x1baf,
- 0x1bc0, 0x1be5,
+ 0x1bba, 0x1be5,
0x1c00, 0x1c23,
0x1c4d, 0x1c4f,
0x1c5a, 0x1c7d,
0x1ce9, 0x1cec,
0x1cee, 0x1cf1,
+ 0x1cf5, 0x1cf6,
0x1d00, 0x1dbf,
0x1e00, 0x1f15,
0x1f18, 0x1f1d,
@@ -9864,8 +13183,11 @@ static const OnigCodePoint CR_ID_Start[] = {
0x2c30, 0x2c5e,
0x2c60, 0x2ce4,
0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d6f,
0x2d80, 0x2d96,
0x2da0, 0x2da6,
@@ -9889,7 +13211,7 @@ static const OnigCodePoint CR_ID_Start[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
@@ -9901,9 +13223,9 @@ static const OnigCodePoint CR_ID_Start[] = {
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa801,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa822,
@@ -9928,6 +13250,8 @@ static const OnigCodePoint CR_ID_Start[] = {
0xaac0, 0xaac0,
0xaac2, 0xaac2,
0xaadb, 0xaadd,
+ 0xaae0, 0xaaea,
+ 0xaaf2, 0xaaf4,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -9937,8 +13261,7 @@ static const OnigCodePoint CR_ID_Start[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -9988,6 +13311,8 @@ static const OnigCodePoint CR_ID_Start[] = {
0x1083f, 0x10855,
0x10900, 0x10915,
0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a00,
0x10a10, 0x10a13,
0x10a15, 0x10a17,
@@ -9999,10 +13324,18 @@ static const OnigCodePoint CR_ID_Start[] = {
0x10c00, 0x10c48,
0x11003, 0x11037,
0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
0x12000, 0x1236e,
0x12400, 0x12462,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f50,
+ 0x16f93, 0x16f9f,
0x1b000, 0x1b001,
0x1d400, 0x1d454,
0x1d456, 0x1d49c,
@@ -10034,6 +13367,39 @@ static const OnigCodePoint CR_ID_Start[] = {
0x1d78a, 0x1d7a8,
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -10042,7 +13408,7 @@ static const OnigCodePoint CR_ID_Start[] = {
/* 'ID_Continue': Derived Property */
static const OnigCodePoint CR_ID_Continue[] = {
- 514,
+ 564,
0x0030, 0x0039,
0x0041, 0x005a,
0x005f, 0x005f,
@@ -10091,6 +13457,9 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x07fa, 0x07fa,
0x0800, 0x082d,
0x0840, 0x085b,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
0x0900, 0x0963,
0x0966, 0x096f,
0x0971, 0x0977,
@@ -10238,7 +13607,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x0ec6, 0x0ec6,
0x0ec8, 0x0ecd,
0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f00,
0x0f18, 0x0f19,
0x0f20, 0x0f29,
@@ -10254,9 +13623,10 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1000, 0x1049,
0x1050, 0x109d,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
+ 0x10fc, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -10288,8 +13658,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1760, 0x176c,
0x176e, 0x1770,
0x1772, 0x1773,
- 0x1780, 0x17b3,
- 0x17b6, 0x17d3,
+ 0x1780, 0x17d3,
0x17d7, 0x17d7,
0x17dc, 0x17dd,
0x17e0, 0x17e9,
@@ -10315,14 +13684,12 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1b00, 0x1b4b,
0x1b50, 0x1b59,
0x1b6b, 0x1b73,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1bf3,
+ 0x1b80, 0x1bf3,
0x1c00, 0x1c37,
0x1c40, 0x1c49,
0x1c4d, 0x1c7d,
0x1cd0, 0x1cd2,
- 0x1cd4, 0x1cf2,
+ 0x1cd4, 0x1cf6,
0x1d00, 0x1de6,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
@@ -10367,9 +13734,11 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
0x2c60, 0x2ce4,
- 0x2ceb, 0x2cf1,
+ 0x2ceb, 0x2cf3,
0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d6f,
0x2d7f, 0x2d96,
0x2da0, 0x2da6,
@@ -10394,21 +13763,21 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
0xa610, 0xa62b,
0xa640, 0xa66f,
- 0xa67c, 0xa67d,
+ 0xa674, 0xa67d,
0xa67f, 0xa697,
- 0xa6a0, 0xa6f1,
+ 0xa69f, 0xa6f1,
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa827,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa827,
0xa840, 0xa873,
0xa880, 0xa8c4,
0xa8d0, 0xa8d9,
@@ -10426,6 +13795,8 @@ static const OnigCodePoint CR_ID_Continue[] = {
0xaa7a, 0xaa7b,
0xaa80, 0xaac2,
0xaadb, 0xaadd,
+ 0xaae0, 0xaaef,
+ 0xaaf2, 0xaaf6,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -10437,8 +13808,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -10495,6 +13865,8 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1083f, 0x10855,
0x10900, 0x10915,
0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a13,
@@ -10510,10 +13882,21 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x11000, 0x11046,
0x11066, 0x1106f,
0x11080, 0x110ba,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x1113f,
+ 0x11180, 0x111c4,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
0x12000, 0x1236e,
0x12400, 0x12462,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
0x1d165, 0x1d169,
0x1d16d, 0x1d172,
@@ -10552,6 +13935,39 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -10561,7 +13977,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
/* 'XID_Start': Derived Property */
static const OnigCodePoint CR_XID_Start[] = {
- 444,
+ 495,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -10609,6 +14025,8 @@ static const OnigCodePoint CR_XID_Start[] = {
0x0824, 0x0824,
0x0828, 0x0828,
0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
0x0904, 0x0939,
0x093d, 0x093d,
0x0950, 0x0950,
@@ -10714,7 +14132,7 @@ static const OnigCodePoint CR_XID_Start[] = {
0x0ebd, 0x0ebd,
0x0ec0, 0x0ec4,
0x0ec6, 0x0ec6,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f00,
0x0f40, 0x0f47,
0x0f49, 0x0f6c,
@@ -10729,9 +14147,10 @@ static const OnigCodePoint CR_XID_Start[] = {
0x1075, 0x1081,
0x108e, 0x108e,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
+ 0x10fc, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -10779,12 +14198,13 @@ static const OnigCodePoint CR_XID_Start[] = {
0x1b45, 0x1b4b,
0x1b83, 0x1ba0,
0x1bae, 0x1baf,
- 0x1bc0, 0x1be5,
+ 0x1bba, 0x1be5,
0x1c00, 0x1c23,
0x1c4d, 0x1c4f,
0x1c5a, 0x1c7d,
0x1ce9, 0x1cec,
0x1cee, 0x1cf1,
+ 0x1cf5, 0x1cf6,
0x1d00, 0x1dbf,
0x1e00, 0x1f15,
0x1f18, 0x1f1d,
@@ -10825,8 +14245,11 @@ static const OnigCodePoint CR_XID_Start[] = {
0x2c30, 0x2c5e,
0x2c60, 0x2ce4,
0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d6f,
0x2d80, 0x2d96,
0x2da0, 0x2da6,
@@ -10850,7 +14273,7 @@ static const OnigCodePoint CR_XID_Start[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
@@ -10862,9 +14285,9 @@ static const OnigCodePoint CR_XID_Start[] = {
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa801,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa822,
@@ -10889,6 +14312,8 @@ static const OnigCodePoint CR_XID_Start[] = {
0xaac0, 0xaac0,
0xaac2, 0xaac2,
0xaadb, 0xaadd,
+ 0xaae0, 0xaaea,
+ 0xaaf2, 0xaaf4,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -10898,8 +14323,7 @@ static const OnigCodePoint CR_XID_Start[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -10956,6 +14380,8 @@ static const OnigCodePoint CR_XID_Start[] = {
0x1083f, 0x10855,
0x10900, 0x10915,
0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a00,
0x10a10, 0x10a13,
0x10a15, 0x10a17,
@@ -10967,10 +14393,18 @@ static const OnigCodePoint CR_XID_Start[] = {
0x10c00, 0x10c48,
0x11003, 0x11037,
0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
0x12000, 0x1236e,
0x12400, 0x12462,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f50,
+ 0x16f93, 0x16f9f,
0x1b000, 0x1b001,
0x1d400, 0x1d454,
0x1d456, 0x1d49c,
@@ -11002,6 +14436,39 @@ static const OnigCodePoint CR_XID_Start[] = {
0x1d78a, 0x1d7a8,
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -11010,7 +14477,7 @@ static const OnigCodePoint CR_XID_Start[] = {
/* 'XID_Continue': Derived Property */
static const OnigCodePoint CR_XID_Continue[] = {
- 521,
+ 571,
0x0030, 0x0039,
0x0041, 0x005a,
0x005f, 0x005f,
@@ -11059,6 +14526,9 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x07fa, 0x07fa,
0x0800, 0x082d,
0x0840, 0x085b,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
0x0900, 0x0963,
0x0966, 0x096f,
0x0971, 0x0977,
@@ -11206,7 +14676,7 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x0ec6, 0x0ec6,
0x0ec8, 0x0ecd,
0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f00,
0x0f18, 0x0f19,
0x0f20, 0x0f29,
@@ -11222,9 +14692,10 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1000, 0x1049,
0x1050, 0x109d,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
+ 0x10fc, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -11256,8 +14727,7 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1760, 0x176c,
0x176e, 0x1770,
0x1772, 0x1773,
- 0x1780, 0x17b3,
- 0x17b6, 0x17d3,
+ 0x1780, 0x17d3,
0x17d7, 0x17d7,
0x17dc, 0x17dd,
0x17e0, 0x17e9,
@@ -11283,14 +14753,12 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1b00, 0x1b4b,
0x1b50, 0x1b59,
0x1b6b, 0x1b73,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1bf3,
+ 0x1b80, 0x1bf3,
0x1c00, 0x1c37,
0x1c40, 0x1c49,
0x1c4d, 0x1c7d,
0x1cd0, 0x1cd2,
- 0x1cd4, 0x1cf2,
+ 0x1cd4, 0x1cf6,
0x1d00, 0x1de6,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
@@ -11335,9 +14803,11 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
0x2c60, 0x2ce4,
- 0x2ceb, 0x2cf1,
+ 0x2ceb, 0x2cf3,
0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d6f,
0x2d7f, 0x2d96,
0x2da0, 0x2da6,
@@ -11363,21 +14833,21 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
0xa610, 0xa62b,
0xa640, 0xa66f,
- 0xa67c, 0xa67d,
+ 0xa674, 0xa67d,
0xa67f, 0xa697,
- 0xa6a0, 0xa6f1,
+ 0xa69f, 0xa6f1,
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa827,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa827,
0xa840, 0xa873,
0xa880, 0xa8c4,
0xa8d0, 0xa8d9,
@@ -11395,6 +14865,8 @@ static const OnigCodePoint CR_XID_Continue[] = {
0xaa7a, 0xaa7b,
0xaa80, 0xaac2,
0xaadb, 0xaadd,
+ 0xaae0, 0xaaef,
+ 0xaaf2, 0xaaf6,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -11406,8 +14878,7 @@ static const OnigCodePoint CR_XID_Continue[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -11470,6 +14941,8 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1083f, 0x10855,
0x10900, 0x10915,
0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a13,
@@ -11485,10 +14958,21 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x11000, 0x11046,
0x11066, 0x1106f,
0x11080, 0x110ba,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x1113f,
+ 0x11180, 0x111c4,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
0x12000, 0x1236e,
0x12400, 0x12462,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
0x1d165, 0x1d169,
0x1d16d, 0x1d172,
@@ -11527,6 +15011,39 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -11556,7 +15073,7 @@ static const OnigCodePoint CR_Default_Ignorable_Code_Point[] = {
/* 'Grapheme_Extend': Derived Property */
static const OnigCodePoint CR_Grapheme_Extend[] = {
- 215,
+ 232,
0x0300, 0x036f,
0x0483, 0x0489,
0x0591, 0x05bd,
@@ -11580,6 +15097,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x0825, 0x0827,
0x0829, 0x082d,
0x0859, 0x085b,
+ 0x08e4, 0x08fe,
0x0900, 0x0902,
0x093a, 0x093a,
0x093c, 0x093c,
@@ -11675,6 +15193,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x1732, 0x1734,
0x1752, 0x1753,
0x1772, 0x1773,
+ 0x17b4, 0x17b5,
0x17b7, 0x17bd,
0x17c6, 0x17c6,
0x17c9, 0x17d3,
@@ -11702,6 +15221,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x1b80, 0x1b81,
0x1ba2, 0x1ba5,
0x1ba8, 0x1ba9,
+ 0x1bab, 0x1bab,
0x1be6, 0x1be6,
0x1be8, 0x1be9,
0x1bed, 0x1bed,
@@ -11712,6 +15232,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x1cd4, 0x1ce0,
0x1ce2, 0x1ce8,
0x1ced, 0x1ced,
+ 0x1cf4, 0x1cf4,
0x1dc0, 0x1de6,
0x1dfc, 0x1dff,
0x200c, 0x200d,
@@ -11722,7 +15243,8 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x302a, 0x302f,
0x3099, 0x309a,
0xa66f, 0xa672,
- 0xa67c, 0xa67d,
+ 0xa674, 0xa67d,
+ 0xa69f, 0xa69f,
0xa6f0, 0xa6f1,
0xa802, 0xa802,
0xa806, 0xa806,
@@ -11746,6 +15268,8 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0xaab7, 0xaab8,
0xaabe, 0xaabf,
0xaac1, 0xaac1,
+ 0xaaec, 0xaaed,
+ 0xaaf6, 0xaaf6,
0xabe5, 0xabe5,
0xabe8, 0xabe8,
0xabed, 0xabed,
@@ -11764,6 +15288,16 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x11080, 0x11081,
0x110b3, 0x110b6,
0x110b9, 0x110ba,
+ 0x11100, 0x11102,
+ 0x11127, 0x1112b,
+ 0x1112d, 0x11134,
+ 0x11180, 0x11181,
+ 0x111b6, 0x111be,
+ 0x116ab, 0x116ab,
+ 0x116ad, 0x116ad,
+ 0x116b0, 0x116b5,
+ 0x116b7, 0x116b7,
+ 0x16f8f, 0x16f92,
0x1d165, 0x1d165,
0x1d167, 0x1d169,
0x1d16e, 0x1d172,
@@ -11776,7 +15310,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
/* 'Grapheme_Base': Derived Property */
static const OnigCodePoint CR_Grapheme_Base[] = {
- 596,
+ 643,
0x0020, 0x007e,
0x00a0, 0x00ac,
0x00ae, 0x02ff,
@@ -11791,6 +15325,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x0559, 0x055f,
0x0561, 0x0587,
0x0589, 0x058a,
+ 0x058f, 0x058f,
0x05be, 0x05be,
0x05c0, 0x05c0,
0x05c3, 0x05c3,
@@ -11819,6 +15354,8 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x0830, 0x083e,
0x0840, 0x0858,
0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
0x0903, 0x0939,
0x093b, 0x093b,
0x093d, 0x0940,
@@ -11867,8 +15404,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x0acb, 0x0acc,
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae1,
- 0x0ae6, 0x0aef,
- 0x0af1, 0x0af1,
+ 0x0ae6, 0x0af1,
0x0b02, 0x0b03,
0x0b05, 0x0b0c,
0x0b0f, 0x0b10,
@@ -11968,7 +15504,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x0ec0, 0x0ec4,
0x0ec6, 0x0ec6,
0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f17,
0x0f1a, 0x0f34,
0x0f36, 0x0f36,
@@ -11993,8 +15529,9 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1087, 0x108c,
0x108e, 0x109c,
0x109e, 0x10c5,
- 0x10d0, 0x10fc,
- 0x1100, 0x1248,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -12067,8 +15604,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1b82, 0x1ba1,
0x1ba6, 0x1ba7,
0x1baa, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1be5,
+ 0x1bac, 0x1be5,
0x1be7, 0x1be7,
0x1bea, 0x1bec,
0x1bee, 0x1bee,
@@ -12077,10 +15613,12 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1c34, 0x1c35,
0x1c3b, 0x1c49,
0x1c4d, 0x1c7f,
+ 0x1cc0, 0x1cc7,
0x1cd3, 0x1cd3,
0x1ce1, 0x1ce1,
0x1ce9, 0x1cec,
- 0x1cee, 0x1cf2,
+ 0x1cee, 0x1cf3,
+ 0x1cf5, 0x1cf6,
0x1d00, 0x1dbf,
0x1e00, 0x1f15,
0x1f18, 0x1f1d,
@@ -12110,15 +15648,16 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x2400, 0x2426,
0x2440, 0x244a,
0x2460, 0x26ff,
- 0x2701, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x2b4c,
+ 0x2701, 0x2b4c,
0x2b50, 0x2b59,
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
0x2c60, 0x2cee,
+ 0x2cf2, 0x2cf3,
0x2cf9, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d70,
0x2d80, 0x2d96,
0x2da0, 0x2da6,
@@ -12129,7 +15668,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x2dc8, 0x2dce,
0x2dd0, 0x2dd6,
0x2dd8, 0x2dde,
- 0x2e00, 0x2e31,
+ 0x2e00, 0x2e3b,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
0x2f00, 0x2fd5,
@@ -12145,7 +15684,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x31f0, 0x321e,
0x3220, 0x32fe,
0x3300, 0x4db5,
- 0x4dc0, 0x9fcb,
+ 0x4dc0, 0x9fcc,
0xa000, 0xa48c,
0xa490, 0xa4c6,
0xa4d0, 0xa62b,
@@ -12155,9 +15694,9 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0xa6a0, 0xa6ef,
0xa6f2, 0xa6f7,
0xa700, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa801,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa824,
@@ -12191,7 +15730,8 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0xaab9, 0xaabd,
0xaac0, 0xaac0,
0xaac2, 0xaac2,
- 0xaadb, 0xaadf,
+ 0xaadb, 0xaaeb,
+ 0xaaee, 0xaaf5,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -12204,8 +15744,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -12267,6 +15806,8 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x10900, 0x1091b,
0x1091f, 0x10939,
0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a00,
0x10a10, 0x10a13,
0x10a15, 0x10a17,
@@ -12288,11 +15829,27 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x110b7, 0x110b8,
0x110bb, 0x110bc,
0x110be, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11103, 0x11126,
+ 0x1112c, 0x1112c,
+ 0x11136, 0x11143,
+ 0x11182, 0x111b5,
+ 0x111bf, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116aa,
+ 0x116ac, 0x116ac,
+ 0x116ae, 0x116af,
+ 0x116b6, 0x116b6,
+ 0x116c0, 0x116c9,
0x12000, 0x1236e,
0x12400, 0x12462,
0x12470, 0x12473,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f93, 0x16f9f,
0x1b000, 0x1b001,
0x1d000, 0x1d0f5,
0x1d100, 0x1d126,
@@ -12327,6 +15884,40 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1d552, 0x1d6a5,
0x1d6a8, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
@@ -12335,7 +15926,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1f0d1, 0x1f0df,
0x1f100, 0x1f10a,
0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
+ 0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
0x1f1e6, 0x1f202,
0x1f210, 0x1f23a,
@@ -12353,19 +15944,9 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1f442, 0x1f4f7,
0x1f4f9, 0x1f4fc,
0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
+ 0x1f5fb, 0x1f640,
0x1f645, 0x1f64f,
0x1f680, 0x1f6c5,
0x1f700, 0x1f773,
@@ -12377,7 +15958,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
/* 'Grapheme_Link': Derived Property */
static const OnigCodePoint CR_Grapheme_Link[] = {
- 29,
+ 33,
0x094d, 0x094d,
0x09cd, 0x09cd,
0x0a4d, 0x0a4d,
@@ -12396,22 +15977,26 @@ static const OnigCodePoint CR_Grapheme_Link[] = {
0x17d2, 0x17d2,
0x1a60, 0x1a60,
0x1b44, 0x1b44,
- 0x1baa, 0x1baa,
+ 0x1baa, 0x1bab,
0x1bf2, 0x1bf3,
0x2d7f, 0x2d7f,
0xa806, 0xa806,
0xa8c4, 0xa8c4,
0xa953, 0xa953,
0xa9c0, 0xa9c0,
+ 0xaaf6, 0xaaf6,
0xabed, 0xabed,
0x10a3f, 0x10a3f,
0x11046, 0x11046,
0x110b9, 0x110b9,
+ 0x11133, 0x11134,
+ 0x111c0, 0x111c0,
+ 0x116b6, 0x116b6,
}; /* CR_Grapheme_Link */
/* 'Common': Script */
static const OnigCodePoint CR_Common[] = {
- 169,
+ 157,
0x0000, 0x0040,
0x005b, 0x0060,
0x007b, 0x00a9,
@@ -12434,7 +16019,6 @@ static const OnigCodePoint CR_Common[] = {
0x0660, 0x0669,
0x06dd, 0x06dd,
0x0964, 0x0965,
- 0x0970, 0x0970,
0x0e3f, 0x0e3f,
0x0fd5, 0x0fd8,
0x10fb, 0x10fb,
@@ -12445,7 +16029,8 @@ static const OnigCodePoint CR_Common[] = {
0x1cd3, 0x1cd3,
0x1ce1, 0x1ce1,
0x1ce9, 0x1cec,
- 0x1cee, 0x1cf2,
+ 0x1cee, 0x1cf3,
+ 0x1cf5, 0x1cf6,
0x2000, 0x200b,
0x200e, 0x2064,
0x206a, 0x2070,
@@ -12462,12 +16047,10 @@ static const OnigCodePoint CR_Common[] = {
0x2400, 0x2426,
0x2440, 0x244a,
0x2460, 0x26ff,
- 0x2701, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x27ff,
+ 0x2701, 0x27ff,
0x2900, 0x2b4c,
0x2b50, 0x2b59,
- 0x2e00, 0x2e31,
+ 0x2e00, 0x2e3b,
0x2ff0, 0x2ffb,
0x3000, 0x3004,
0x3006, 0x3006,
@@ -12544,7 +16127,7 @@ static const OnigCodePoint CR_Common[] = {
0x1f0d1, 0x1f0df,
0x1f100, 0x1f10a,
0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
+ 0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
0x1f1e6, 0x1f1ff,
0x1f201, 0x1f202,
@@ -12563,19 +16146,9 @@ static const OnigCodePoint CR_Common[] = {
0x1f442, 0x1f4f7,
0x1f4f9, 0x1f4fc,
0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
+ 0x1f5fb, 0x1f640,
0x1f645, 0x1f64f,
0x1f680, 0x1f6c5,
0x1f700, 0x1f773,
@@ -12610,9 +16183,9 @@ static const OnigCodePoint CR_Latin[] = {
0x2c60, 0x2c7f,
0xa722, 0xa787,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa7ff,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa7ff,
0xfb00, 0xfb06,
0xff21, 0xff3a,
0xff41, 0xff5a,
@@ -12664,17 +16237,18 @@ static const OnigCodePoint CR_Cyrillic[] = {
0x1d2b, 0x1d2b,
0x1d78, 0x1d78,
0x2de0, 0x2dff,
- 0xa640, 0xa673,
- 0xa67c, 0xa697,
+ 0xa640, 0xa697,
+ 0xa69f, 0xa69f,
}; /* CR_Cyrillic */
/* 'Armenian': Script */
static const OnigCodePoint CR_Armenian[] = {
- 5,
+ 6,
0x0531, 0x0556,
0x0559, 0x055f,
0x0561, 0x0587,
0x058a, 0x058a,
+ 0x058f, 0x058f,
0xfb13, 0xfb17,
}; /* CR_Armenian */
@@ -12694,8 +16268,8 @@ static const OnigCodePoint CR_Hebrew[] = {
/* 'Arabic': Script */
static const OnigCodePoint CR_Arabic[] = {
- 19,
- 0x0600, 0x0603,
+ 56,
+ 0x0600, 0x0604,
0x0606, 0x060b,
0x060d, 0x061a,
0x061e, 0x061e,
@@ -12706,6 +16280,9 @@ static const OnigCodePoint CR_Arabic[] = {
0x0671, 0x06dc,
0x06de, 0x06ff,
0x0750, 0x077f,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
0xfb50, 0xfbc1,
0xfbd3, 0xfd3d,
0xfd50, 0xfd8f,
@@ -12714,6 +16291,40 @@ static const OnigCodePoint CR_Arabic[] = {
0xfe70, 0xfe74,
0xfe76, 0xfefc,
0x10e60, 0x10e7e,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
}; /* CR_Arabic */
/* 'Syriac': Script */
@@ -12732,11 +16343,10 @@ static const OnigCodePoint CR_Thaana[] = {
/* 'Devanagari': Script */
static const OnigCodePoint CR_Devanagari[] = {
- 6,
+ 5,
0x0900, 0x0950,
0x0953, 0x0963,
- 0x0966, 0x096f,
- 0x0971, 0x0977,
+ 0x0966, 0x0977,
0x0979, 0x097f,
0xa8e0, 0xa8fb,
}; /* CR_Devanagari */
@@ -12783,7 +16393,7 @@ static const OnigCodePoint CR_Gurmukhi[] = {
/* 'Gujarati': Script */
static const OnigCodePoint CR_Gujarati[] = {
- 14,
+ 13,
0x0a81, 0x0a83,
0x0a85, 0x0a8d,
0x0a8f, 0x0a91,
@@ -12796,8 +16406,7 @@ static const OnigCodePoint CR_Gujarati[] = {
0x0acb, 0x0acd,
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0af1, 0x0af1,
+ 0x0ae6, 0x0af1,
}; /* CR_Gujarati */
/* 'Oriya': Script */
@@ -12937,7 +16546,7 @@ static const OnigCodePoint CR_Lao[] = {
0x0ec6, 0x0ec6,
0x0ec8, 0x0ecd,
0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
}; /* CR_Lao */
/* 'Tibetan': Script */
@@ -12961,11 +16570,15 @@ static const OnigCodePoint CR_Myanmar[] = {
/* 'Georgian': Script */
static const OnigCodePoint CR_Georgian[] = {
- 4,
+ 8,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
+ 0x10fc, 0x10ff,
0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
}; /* CR_Georgian */
/* 'Hangul': Script */
@@ -13102,7 +16715,7 @@ static const OnigCodePoint CR_Bopomofo[] = {
/* 'Han': Script */
static const OnigCodePoint CR_Han[] = {
- 16,
+ 15,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
0x2f00, 0x2fd5,
@@ -13111,9 +16724,8 @@ static const OnigCodePoint CR_Han[] = {
0x3021, 0x3029,
0x3038, 0x303b,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0x4e00, 0x9fcc,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
@@ -13149,7 +16761,7 @@ static const OnigCodePoint CR_Deseret[] = {
/* 'Inherited': Script */
static const OnigCodePoint CR_Inherited[] = {
- 24,
+ 25,
0x0300, 0x036f,
0x0485, 0x0486,
0x064b, 0x0655,
@@ -13160,6 +16772,7 @@ static const OnigCodePoint CR_Inherited[] = {
0x1cd4, 0x1ce0,
0x1ce2, 0x1ce8,
0x1ced, 0x1ced,
+ 0x1cf4, 0x1cf4,
0x1dc0, 0x1de6,
0x1dfc, 0x1dff,
0x200c, 0x200d,
@@ -13280,7 +16893,7 @@ static const OnigCodePoint CR_Buginese[] = {
static const OnigCodePoint CR_Coptic[] = {
3,
0x03e2, 0x03ef,
- 0x2c80, 0x2cf1,
+ 0x2c80, 0x2cf3,
0x2cf9, 0x2cff,
}; /* CR_Coptic */
@@ -13303,7 +16916,7 @@ static const OnigCodePoint CR_Glagolitic[] = {
/* 'Tifinagh': Script */
static const OnigCodePoint CR_Tifinagh[] = {
3,
- 0x2d30, 0x2d65,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d70,
0x2d7f, 0x2d7f,
}; /* CR_Tifinagh */
@@ -13371,8 +16984,8 @@ static const OnigCodePoint CR_Nko[] = {
/* 'Sundanese': Script */
static const OnigCodePoint CR_Sundanese[] = {
2,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
+ 0x1b80, 0x1bbf,
+ 0x1cc0, 0x1cc7,
}; /* CR_Sundanese */
/* 'Lepcha': Script */
@@ -13503,7 +17116,8 @@ static const OnigCodePoint CR_Javanese[] = {
/* 'Meetei_Mayek': Script */
static const OnigCodePoint CR_Meetei_Mayek[] = {
- 2,
+ 3,
+ 0xaae0, 0xaaf6,
0xabc0, 0xabed,
0xabf0, 0xabf9,
}; /* CR_Meetei_Mayek */
@@ -13568,21 +17182,57 @@ static const OnigCodePoint CR_Mandaic[] = {
0x085e, 0x085e,
}; /* CR_Mandaic */
+/* 'Chakma': Script */
+static const OnigCodePoint CR_Chakma[] = {
+ 2,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+}; /* CR_Chakma */
+
+/* 'Meroitic_Cursive': Script */
+static const OnigCodePoint CR_Meroitic_Cursive[] = {
+ 2,
+ 0x109a0, 0x109b7,
+ 0x109be, 0x109bf,
+}; /* CR_Meroitic_Cursive */
+
+/* 'Meroitic_Hieroglyphs': Script */
+static const OnigCodePoint CR_Meroitic_Hieroglyphs[] = {
+ 1,
+ 0x10980, 0x1099f,
+}; /* CR_Meroitic_Hieroglyphs */
+
+/* 'Miao': Script */
+static const OnigCodePoint CR_Miao[] = {
+ 3,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+}; /* CR_Miao */
+
+/* 'Sharada': Script */
+static const OnigCodePoint CR_Sharada[] = {
+ 2,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+}; /* CR_Sharada */
+
+/* 'Sora_Sompeng': Script */
+static const OnigCodePoint CR_Sora_Sompeng[] = {
+ 2,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+}; /* CR_Sora_Sompeng */
+
+/* 'Takri': Script */
+static const OnigCodePoint CR_Takri[] = {
+ 2,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+}; /* CR_Takri */
+
/* 'White_Space': Binary Property */
-static const OnigCodePoint CR_White_Space[] = {
- 11,
- 0x0009, 0x000d,
- 0x0020, 0x0020,
- 0x0085, 0x0085,
- 0x00a0, 0x00a0,
- 0x1680, 0x1680,
- 0x180e, 0x180e,
- 0x2000, 0x200a,
- 0x2028, 0x2029,
- 0x202f, 0x202f,
- 0x205f, 0x205f,
- 0x3000, 0x3000,
-}; /* CR_White_Space */
+#define CR_White_Space CR_Space
/* 'Bidi_Control': Binary Property */
static const OnigCodePoint CR_Bidi_Control[] = {
@@ -13599,7 +17249,7 @@ static const OnigCodePoint CR_Join_Control[] = {
/* 'Dash': Binary Property */
static const OnigCodePoint CR_Dash[] = {
- 19,
+ 20,
0x002d, 0x002d,
0x058a, 0x058a,
0x05be, 0x05be,
@@ -13612,6 +17262,7 @@ static const OnigCodePoint CR_Dash[] = {
0x2212, 0x2212,
0x2e17, 0x2e17,
0x2e1a, 0x2e1a,
+ 0x2e3a, 0x2e3b,
0x301c, 0x301c,
0x3030, 0x3030,
0x30a0, 0x30a0,
@@ -13655,7 +17306,7 @@ static const OnigCodePoint CR_Quotation_Mark[] = {
/* 'Terminal_Punctuation': Binary Property */
static const OnigCodePoint CR_Terminal_Punctuation[] = {
- 67,
+ 70,
0x0021, 0x0021,
0x002c, 0x002c,
0x002e, 0x002e,
@@ -13705,6 +17356,7 @@ static const OnigCodePoint CR_Terminal_Punctuation[] = {
0xa9c7, 0xa9c9,
0xaa5d, 0xaa5f,
0xaadf, 0xaadf,
+ 0xaaf0, 0xaaf1,
0xabeb, 0xabeb,
0xfe50, 0xfe52,
0xfe54, 0xfe57,
@@ -13722,12 +17374,14 @@ static const OnigCodePoint CR_Terminal_Punctuation[] = {
0x10b3a, 0x10b3f,
0x11047, 0x1104d,
0x110be, 0x110c1,
+ 0x11141, 0x11143,
+ 0x111c5, 0x111c6,
0x12470, 0x12473,
}; /* CR_Terminal_Punctuation */
/* 'Other_Math': Binary Property */
static const OnigCodePoint CR_Other_Math[] = {
- 100,
+ 133,
0x005e, 0x005e,
0x03d0, 0x03d2,
0x03d5, 0x03d5,
@@ -13828,6 +17482,39 @@ static const OnigCodePoint CR_Other_Math[] = {
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
}; /* CR_Other_Math */
/* 'Hex_Digit': Binary Property */
@@ -13842,16 +17529,11 @@ static const OnigCodePoint CR_Hex_Digit[] = {
}; /* CR_Hex_Digit */
/* 'ASCII_Hex_Digit': Binary Property */
-static const OnigCodePoint CR_ASCII_Hex_Digit[] = {
- 3,
- 0x0030, 0x0039,
- 0x0041, 0x0046,
- 0x0061, 0x0066,
-}; /* CR_ASCII_Hex_Digit */
+#define CR_ASCII_Hex_Digit CR_XDigit
/* 'Other_Alphabetic': Binary Property */
static const OnigCodePoint CR_Other_Alphabetic[] = {
- 145,
+ 158,
0x0345, 0x0345,
0x05b0, 0x05bd,
0x05bf, 0x05bf,
@@ -13873,6 +17555,8 @@ static const OnigCodePoint CR_Other_Alphabetic[] = {
0x081b, 0x0823,
0x0825, 0x0827,
0x0829, 0x082c,
+ 0x08e4, 0x08e9,
+ 0x08f0, 0x08fe,
0x0900, 0x0903,
0x093a, 0x093b,
0x093e, 0x094c,
@@ -13969,11 +17653,14 @@ static const OnigCodePoint CR_Other_Alphabetic[] = {
0x1b35, 0x1b43,
0x1b80, 0x1b82,
0x1ba1, 0x1ba9,
+ 0x1bac, 0x1bad,
0x1be7, 0x1bf1,
0x1c24, 0x1c35,
- 0x1cf2, 0x1cf2,
+ 0x1cf2, 0x1cf3,
0x24b6, 0x24e9,
0x2de0, 0x2dff,
+ 0xa674, 0xa67b,
+ 0xa69f, 0xa69f,
0xa823, 0xa827,
0xa880, 0xa881,
0xa8b4, 0xa8c3,
@@ -13988,6 +17675,8 @@ static const OnigCodePoint CR_Other_Alphabetic[] = {
0xaab2, 0xaab4,
0xaab7, 0xaab8,
0xaabe, 0xaabe,
+ 0xaaeb, 0xaaef,
+ 0xaaf5, 0xaaf5,
0xabe3, 0xabea,
0xfb1e, 0xfb1e,
0x10a01, 0x10a03,
@@ -13997,18 +17686,23 @@ static const OnigCodePoint CR_Other_Alphabetic[] = {
0x11038, 0x11045,
0x11082, 0x11082,
0x110b0, 0x110b8,
+ 0x11100, 0x11102,
+ 0x11127, 0x11132,
+ 0x11180, 0x11182,
+ 0x111b3, 0x111bf,
+ 0x116ab, 0x116b5,
+ 0x16f51, 0x16f7e,
}; /* CR_Other_Alphabetic */
/* 'Ideographic': Binary Property */
static const OnigCodePoint CR_Ideographic[] = {
- 12,
+ 11,
0x3006, 0x3007,
0x3021, 0x3029,
0x3038, 0x303a,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0x4e00, 0x9fcc,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
@@ -14018,7 +17712,7 @@ static const OnigCodePoint CR_Ideographic[] = {
/* 'Diacritic': Binary Property */
static const OnigCodePoint CR_Diacritic[] = {
- 117,
+ 125,
0x005e, 0x005e,
0x0060, 0x0060,
0x00a8, 0x00a8,
@@ -14047,6 +17741,7 @@ static const OnigCodePoint CR_Diacritic[] = {
0x07a6, 0x07b0,
0x07eb, 0x07f5,
0x0818, 0x0819,
+ 0x08e4, 0x08fe,
0x093c, 0x093c,
0x094d, 0x094d,
0x0951, 0x0954,
@@ -14089,11 +17784,12 @@ static const OnigCodePoint CR_Diacritic[] = {
0x1b34, 0x1b34,
0x1b44, 0x1b44,
0x1b6b, 0x1b73,
- 0x1baa, 0x1baa,
+ 0x1baa, 0x1bab,
0x1c36, 0x1c37,
0x1c78, 0x1c7d,
0x1cd0, 0x1ce8,
0x1ced, 0x1ced,
+ 0x1cf4, 0x1cf4,
0x1d2c, 0x1d6a,
0x1dc4, 0x1dcf,
0x1dfd, 0x1dff,
@@ -14114,6 +17810,7 @@ static const OnigCodePoint CR_Diacritic[] = {
0xa6f0, 0xa6f1,
0xa717, 0xa721,
0xa788, 0xa788,
+ 0xa7f8, 0xa7f9,
0xa8c4, 0xa8c4,
0xa8e0, 0xa8f1,
0xa92b, 0xa92e,
@@ -14122,6 +17819,7 @@ static const OnigCodePoint CR_Diacritic[] = {
0xa9c0, 0xa9c0,
0xaa7b, 0xaa7b,
0xaabf, 0xaac2,
+ 0xaaf6, 0xaaf6,
0xabec, 0xabed,
0xfb1e, 0xfb1e,
0xfe20, 0xfe26,
@@ -14131,6 +17829,10 @@ static const OnigCodePoint CR_Diacritic[] = {
0xff9e, 0xff9f,
0xffe3, 0xffe3,
0x110b9, 0x110ba,
+ 0x11133, 0x11134,
+ 0x111c0, 0x111c0,
+ 0x116b6, 0x116b7,
+ 0x16f8f, 0x16f9f,
0x1d167, 0x1d169,
0x1d16d, 0x1d172,
0x1d17b, 0x1d182,
@@ -14140,13 +17842,14 @@ static const OnigCodePoint CR_Diacritic[] = {
/* 'Extender': Binary Property */
static const OnigCodePoint CR_Extender[] = {
- 20,
+ 22,
0x00b7, 0x00b7,
0x02d0, 0x02d1,
0x0640, 0x0640,
0x07fa, 0x07fa,
0x0e46, 0x0e46,
0x0ec6, 0x0ec6,
+ 0x180a, 0x180a,
0x1843, 0x1843,
0x1aa7, 0x1aa7,
0x1c36, 0x1c36,
@@ -14160,25 +17863,31 @@ static const OnigCodePoint CR_Extender[] = {
0xa9cf, 0xa9cf,
0xaa70, 0xaa70,
0xaadd, 0xaadd,
+ 0xaaf3, 0xaaf4,
0xff70, 0xff70,
}; /* CR_Extender */
/* 'Other_Lowercase': Binary Property */
static const OnigCodePoint CR_Other_Lowercase[] = {
- 13,
+ 18,
+ 0x00aa, 0x00aa,
+ 0x00ba, 0x00ba,
0x02b0, 0x02b8,
0x02c0, 0x02c1,
0x02e0, 0x02e4,
0x0345, 0x0345,
0x037a, 0x037a,
- 0x1d2c, 0x1d61,
+ 0x1d2c, 0x1d6a,
0x1d78, 0x1d78,
0x1d9b, 0x1dbf,
- 0x2090, 0x2094,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
0x2170, 0x217f,
0x24d0, 0x24e9,
- 0x2c7d, 0x2c7d,
+ 0x2c7c, 0x2c7d,
0xa770, 0xa770,
+ 0xa7f8, 0xa7f9,
}; /* CR_Other_Lowercase */
/* 'Other_Uppercase': Binary Property */
@@ -14213,7 +17922,7 @@ static const OnigCodePoint CR_Noncharacter_Code_Point[] = {
/* 'Other_Grapheme_Extend': Binary Property */
static const OnigCodePoint CR_Other_Grapheme_Extend[] = {
- 16,
+ 17,
0x09be, 0x09be,
0x09d7, 0x09d7,
0x0b3e, 0x0b3e,
@@ -14227,6 +17936,7 @@ static const OnigCodePoint CR_Other_Grapheme_Extend[] = {
0x0dcf, 0x0dcf,
0x0ddf, 0x0ddf,
0x200c, 0x200d,
+ 0x302e, 0x302f,
0xff9e, 0xff9f,
0x1d165, 0x1d165,
0x1d16e, 0x1d172,
@@ -14257,7 +17967,7 @@ static const OnigCodePoint CR_Radical[] = {
static const OnigCodePoint CR_Unified_Ideograph[] = {
12,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xfa0e, 0xfa0f,
0xfa11, 0xfa11,
0xfa13, 0xfa14,
@@ -14272,9 +17982,10 @@ static const OnigCodePoint CR_Unified_Ideograph[] = {
/* 'Other_Default_Ignorable_Code_Point': Binary Property */
static const OnigCodePoint CR_Other_Default_Ignorable_Code_Point[] = {
- 10,
+ 11,
0x034f, 0x034f,
0x115f, 0x1160,
+ 0x17b4, 0x17b5,
0x2065, 0x2069,
0x3164, 0x3164,
0xffa0, 0xffa0,
@@ -14364,7 +18075,7 @@ static const OnigCodePoint CR_Other_ID_Continue[] = {
/* 'STerm': Binary Property */
static const OnigCodePoint CR_STerm[] = {
- 47,
+ 50,
0x0021, 0x0021,
0x002e, 0x002e,
0x003f, 0x003f,
@@ -14402,6 +18113,7 @@ static const OnigCodePoint CR_STerm[] = {
0xa92f, 0xa92f,
0xa9c8, 0xa9c9,
0xaa5d, 0xaa5f,
+ 0xaaf0, 0xaaf1,
0xabeb, 0xabeb,
0xfe52, 0xfe52,
0xfe56, 0xfe57,
@@ -14412,6 +18124,8 @@ static const OnigCodePoint CR_STerm[] = {
0x10a56, 0x10a57,
0x11047, 0x11048,
0x110be, 0x110c1,
+ 0x11141, 0x11143,
+ 0x111c5, 0x111c6,
}; /* CR_STerm */
/* 'Variation_Selector': Binary Property */
@@ -14467,7 +18181,7 @@ static const OnigCodePoint CR_Pattern_Syntax[] = {
/* 'Unknown': Script */
static const OnigCodePoint CR_Unknown[] = {
- 499,
+ 537,
0x0378, 0x0379,
0x037f, 0x0383,
0x038b, 0x038b,
@@ -14477,11 +18191,12 @@ static const OnigCodePoint CR_Unknown[] = {
0x0557, 0x0558,
0x0560, 0x0560,
0x0588, 0x0588,
- 0x058b, 0x0590,
+ 0x058b, 0x058e,
+ 0x0590, 0x0590,
0x05c8, 0x05cf,
0x05eb, 0x05ef,
0x05f5, 0x05ff,
- 0x0604, 0x0605,
+ 0x0605, 0x0605,
0x061c, 0x061d,
0x070e, 0x070e,
0x074b, 0x074c,
@@ -14490,7 +18205,10 @@ static const OnigCodePoint CR_Unknown[] = {
0x082e, 0x082f,
0x083f, 0x083f,
0x085c, 0x085d,
- 0x085f, 0x08ff,
+ 0x085f, 0x089f,
+ 0x08a1, 0x08a1,
+ 0x08ad, 0x08e3,
+ 0x08ff, 0x08ff,
0x0978, 0x0978,
0x0980, 0x0980,
0x0984, 0x0984,
@@ -14535,7 +18253,6 @@ static const OnigCodePoint CR_Unknown[] = {
0x0ace, 0x0acf,
0x0ad1, 0x0adf,
0x0ae4, 0x0ae5,
- 0x0af0, 0x0af0,
0x0af2, 0x0b00,
0x0b04, 0x0b04,
0x0b0d, 0x0b0e,
@@ -14636,15 +18353,16 @@ static const OnigCodePoint CR_Unknown[] = {
0x0ec7, 0x0ec7,
0x0ece, 0x0ecf,
0x0eda, 0x0edb,
- 0x0ede, 0x0eff,
+ 0x0ee0, 0x0eff,
0x0f48, 0x0f48,
0x0f6d, 0x0f70,
0x0f98, 0x0f98,
0x0fbd, 0x0fbd,
0x0fcd, 0x0fcd,
0x0fdb, 0x0fff,
- 0x10c6, 0x10cf,
- 0x10fd, 0x10ff,
+ 0x10c6, 0x10c6,
+ 0x10c8, 0x10cc,
+ 0x10ce, 0x10cf,
0x1249, 0x1249,
0x124e, 0x124f,
0x1257, 0x1257,
@@ -14698,13 +18416,12 @@ static const OnigCodePoint CR_Unknown[] = {
0x1aae, 0x1aff,
0x1b4c, 0x1b4f,
0x1b7d, 0x1b7f,
- 0x1bab, 0x1bad,
- 0x1bba, 0x1bbf,
0x1bf4, 0x1bfb,
0x1c38, 0x1c3a,
0x1c4a, 0x1c4c,
- 0x1c80, 0x1ccf,
- 0x1cf3, 0x1cff,
+ 0x1c80, 0x1cbf,
+ 0x1cc8, 0x1ccf,
+ 0x1cf7, 0x1cff,
0x1de7, 0x1dfb,
0x1f16, 0x1f17,
0x1f1e, 0x1f1f,
@@ -14733,15 +18450,15 @@ static const OnigCodePoint CR_Unknown[] = {
0x2427, 0x243f,
0x244b, 0x245f,
0x2700, 0x2700,
- 0x27cb, 0x27cb,
- 0x27cd, 0x27cd,
0x2b4d, 0x2b4f,
0x2b5a, 0x2bff,
0x2c2f, 0x2c2f,
0x2c5f, 0x2c5f,
- 0x2cf2, 0x2cf8,
- 0x2d26, 0x2d2f,
- 0x2d66, 0x2d6e,
+ 0x2cf4, 0x2cf8,
+ 0x2d26, 0x2d26,
+ 0x2d28, 0x2d2c,
+ 0x2d2e, 0x2d2f,
+ 0x2d68, 0x2d6e,
0x2d71, 0x2d7e,
0x2d97, 0x2d9f,
0x2da7, 0x2da7,
@@ -14752,7 +18469,7 @@ static const OnigCodePoint CR_Unknown[] = {
0x2dcf, 0x2dcf,
0x2dd7, 0x2dd7,
0x2ddf, 0x2ddf,
- 0x2e32, 0x2e7f,
+ 0x2e3c, 0x2e7f,
0x2e9a, 0x2e9a,
0x2ef4, 0x2eff,
0x2fd6, 0x2fef,
@@ -14767,16 +18484,15 @@ static const OnigCodePoint CR_Unknown[] = {
0x321f, 0x321f,
0x32ff, 0x32ff,
0x4db6, 0x4dbf,
- 0x9fcc, 0x9fff,
+ 0x9fcd, 0x9fff,
0xa48d, 0xa48f,
0xa4c7, 0xa4cf,
0xa62c, 0xa63f,
- 0xa674, 0xa67b,
- 0xa698, 0xa69f,
+ 0xa698, 0xa69e,
0xa6f8, 0xa6ff,
0xa78f, 0xa78f,
- 0xa792, 0xa79f,
- 0xa7aa, 0xa7f9,
+ 0xa794, 0xa79f,
+ 0xa7ab, 0xa7f7,
0xa82c, 0xa82f,
0xa83a, 0xa83f,
0xa878, 0xa87f,
@@ -14793,7 +18509,7 @@ static const OnigCodePoint CR_Unknown[] = {
0xaa5a, 0xaa5b,
0xaa7c, 0xaa7f,
0xaac3, 0xaada,
- 0xaae0, 0xab00,
+ 0xaaf7, 0xab00,
0xab07, 0xab08,
0xab0f, 0xab10,
0xab17, 0xab1f,
@@ -14804,7 +18520,6 @@ static const OnigCodePoint CR_Unknown[] = {
0xd7a4, 0xd7af,
0xd7c7, 0xd7ca,
0xd7fc, 0xf8ff,
- 0xfa2e, 0xfa2f,
0xfa6e, 0xfa6f,
0xfada, 0xfaff,
0xfb07, 0xfb12,
@@ -14866,7 +18581,9 @@ static const OnigCodePoint CR_Unknown[] = {
0x10860, 0x108ff,
0x1091c, 0x1091e,
0x1093a, 0x1093e,
- 0x10940, 0x109ff,
+ 0x10940, 0x1097f,
+ 0x109b8, 0x109bd,
+ 0x109c0, 0x109ff,
0x10a04, 0x10a04,
0x10a07, 0x10a0b,
0x10a14, 0x10a14,
@@ -14884,12 +18601,23 @@ static const OnigCodePoint CR_Unknown[] = {
0x10e7f, 0x10fff,
0x1104e, 0x11051,
0x11070, 0x1107f,
- 0x110c2, 0x11fff,
+ 0x110c2, 0x110cf,
+ 0x110e9, 0x110ef,
+ 0x110fa, 0x110ff,
+ 0x11135, 0x11135,
+ 0x11144, 0x1117f,
+ 0x111c9, 0x111cf,
+ 0x111da, 0x1167f,
+ 0x116b8, 0x116bf,
+ 0x116ca, 0x11fff,
0x1236f, 0x123ff,
0x12463, 0x1246f,
0x12474, 0x12fff,
0x1342f, 0x167ff,
- 0x16a39, 0x1afff,
+ 0x16a39, 0x16eff,
+ 0x16f45, 0x16f4f,
+ 0x16f7f, 0x16f8e,
+ 0x16fa0, 0x1afff,
0x1b002, 0x1cfff,
0x1d0f6, 0x1d0ff,
0x1d127, 0x1d128,
@@ -14917,7 +18645,41 @@ static const OnigCodePoint CR_Unknown[] = {
0x1d551, 0x1d551,
0x1d6a6, 0x1d6a7,
0x1d7cc, 0x1d7cd,
- 0x1d800, 0x1efff,
+ 0x1d800, 0x1edff,
+ 0x1ee04, 0x1ee04,
+ 0x1ee20, 0x1ee20,
+ 0x1ee23, 0x1ee23,
+ 0x1ee25, 0x1ee26,
+ 0x1ee28, 0x1ee28,
+ 0x1ee33, 0x1ee33,
+ 0x1ee38, 0x1ee38,
+ 0x1ee3a, 0x1ee3a,
+ 0x1ee3c, 0x1ee41,
+ 0x1ee43, 0x1ee46,
+ 0x1ee48, 0x1ee48,
+ 0x1ee4a, 0x1ee4a,
+ 0x1ee4c, 0x1ee4c,
+ 0x1ee50, 0x1ee50,
+ 0x1ee53, 0x1ee53,
+ 0x1ee55, 0x1ee56,
+ 0x1ee58, 0x1ee58,
+ 0x1ee5a, 0x1ee5a,
+ 0x1ee5c, 0x1ee5c,
+ 0x1ee5e, 0x1ee5e,
+ 0x1ee60, 0x1ee60,
+ 0x1ee63, 0x1ee63,
+ 0x1ee65, 0x1ee66,
+ 0x1ee6b, 0x1ee6b,
+ 0x1ee73, 0x1ee73,
+ 0x1ee78, 0x1ee78,
+ 0x1ee7d, 0x1ee7d,
+ 0x1ee7f, 0x1ee7f,
+ 0x1ee8a, 0x1ee8a,
+ 0x1ee9c, 0x1eea0,
+ 0x1eea4, 0x1eea4,
+ 0x1eeaa, 0x1eeaa,
+ 0x1eebc, 0x1eeef,
+ 0x1eef2, 0x1efff,
0x1f02c, 0x1f02f,
0x1f094, 0x1f09f,
0x1f0af, 0x1f0b0,
@@ -14926,7 +18688,7 @@ static const OnigCodePoint CR_Unknown[] = {
0x1f0e0, 0x1f0ff,
0x1f10b, 0x1f10f,
0x1f12f, 0x1f12f,
- 0x1f16a, 0x1f16f,
+ 0x1f16c, 0x1f16f,
0x1f19b, 0x1f1e5,
0x1f203, 0x1f20f,
0x1f23b, 0x1f23f,
@@ -14943,19 +18705,9 @@ static const OnigCodePoint CR_Unknown[] = {
0x1f441, 0x1f441,
0x1f4f8, 0x1f4f8,
0x1f4fd, 0x1f4ff,
- 0x1f53e, 0x1f54f,
+ 0x1f53e, 0x1f53f,
+ 0x1f544, 0x1f54f,
0x1f568, 0x1f5fa,
- 0x1f600, 0x1f600,
- 0x1f611, 0x1f611,
- 0x1f615, 0x1f615,
- 0x1f617, 0x1f617,
- 0x1f619, 0x1f619,
- 0x1f61b, 0x1f61b,
- 0x1f61f, 0x1f61f,
- 0x1f626, 0x1f627,
- 0x1f62c, 0x1f62c,
- 0x1f62e, 0x1f62f,
- 0x1f634, 0x1f634,
0x1f641, 0x1f644,
0x1f650, 0x1f67f,
0x1f6c6, 0x1f6ff,
@@ -14968,8 +18720,6 @@ static const OnigCodePoint CR_Unknown[] = {
0xe0080, 0xe00ff,
0xe01f0, 0x10ffff,
}; /* CR_Unknown */
-#endif /* USE_UNICODE_PROPERTIES */
-#endif /* USE_UNICODE_PROPERTIES */
/* 'Age_1_1': Derived Age 1.1 */
static const OnigCodePoint CR_Age_1_1[] = {
@@ -19854,554 +23604,10 @@ static const OnigCodePoint CR_Age_6_0[] = {
0xefffe, 0x10ffff,
}; /* CR_Age_6_0 */
-/* 'NEWLINE': [[:NEWLINE:]] */
-static const OnigCodePoint CR_NEWLINE[] = {
- 1,
- 0x000a, 0x000a,
-}; /* CR_NEWLINE */
-
-/* 'Alpha': [[:Alpha:]] */
-#define CR_Alpha CR_Alphabetic
-
-/* 'Blank': [[:Blank:]] */
-static const OnigCodePoint CR_Blank[] = {
- 9,
- 0x0009, 0x0009,
- 0x0020, 0x0020,
- 0x00a0, 0x00a0,
- 0x1680, 0x1680,
- 0x180e, 0x180e,
- 0x2000, 0x200a,
- 0x202f, 0x202f,
- 0x205f, 0x205f,
- 0x3000, 0x3000,
-}; /* CR_Blank */
-
-/* 'Cntrl': [[:Cntrl:]] */
-#define CR_Cntrl CR_Cc
-
-/* 'Digit': [[:Digit:]] */
-#define CR_Digit CR_Nd
-
-/* 'Graph': [[:Graph:]] */
-static const OnigCodePoint CR_Graph[] = {
- 506,
- 0x0021, 0x007e,
- 0x00a1, 0x0377,
- 0x037a, 0x037e,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x0527,
- 0x0531, 0x0556,
- 0x0559, 0x055f,
- 0x0561, 0x0587,
- 0x0589, 0x058a,
- 0x0591, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f4,
- 0x0600, 0x0603,
- 0x0606, 0x061b,
- 0x061e, 0x070d,
- 0x070f, 0x074a,
- 0x074d, 0x07b1,
- 0x07c0, 0x07fa,
- 0x0800, 0x082d,
- 0x0830, 0x083e,
- 0x0840, 0x085b,
- 0x085e, 0x085e,
- 0x0900, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bc, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09ce,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09e6, 0x09fb,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3c, 0x0a3c,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a51, 0x0a51,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a75,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abc, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acd,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0af1, 0x0af1,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3c, 0x0b44,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4d,
- 0x0b56, 0x0b57,
- 0x0b5c, 0x0b5d,
- 0x0b5f, 0x0b63,
- 0x0b66, 0x0b77,
- 0x0b82, 0x0b83,
- 0x0b85, 0x0b8a,
- 0x0b8e, 0x0b90,
- 0x0b92, 0x0b95,
- 0x0b99, 0x0b9a,
- 0x0b9c, 0x0b9c,
- 0x0b9e, 0x0b9f,
- 0x0ba3, 0x0ba4,
- 0x0ba8, 0x0baa,
- 0x0bae, 0x0bb9,
- 0x0bbe, 0x0bc2,
- 0x0bc6, 0x0bc8,
- 0x0bca, 0x0bcd,
- 0x0bd0, 0x0bd0,
- 0x0bd7, 0x0bd7,
- 0x0be6, 0x0bfa,
- 0x0c01, 0x0c03,
- 0x0c05, 0x0c0c,
- 0x0c0e, 0x0c10,
- 0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
- 0x0c3d, 0x0c44,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4d,
- 0x0c55, 0x0c56,
- 0x0c58, 0x0c59,
- 0x0c60, 0x0c63,
- 0x0c66, 0x0c6f,
- 0x0c78, 0x0c7f,
- 0x0c82, 0x0c83,
- 0x0c85, 0x0c8c,
- 0x0c8e, 0x0c90,
- 0x0c92, 0x0ca8,
- 0x0caa, 0x0cb3,
- 0x0cb5, 0x0cb9,
- 0x0cbc, 0x0cc4,
- 0x0cc6, 0x0cc8,
- 0x0cca, 0x0ccd,
- 0x0cd5, 0x0cd6,
- 0x0cde, 0x0cde,
- 0x0ce0, 0x0ce3,
- 0x0ce6, 0x0cef,
- 0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d3a,
- 0x0d3d, 0x0d44,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4e,
- 0x0d57, 0x0d57,
- 0x0d60, 0x0d63,
- 0x0d66, 0x0d75,
- 0x0d79, 0x0d7f,
- 0x0d82, 0x0d83,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0dca, 0x0dca,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df4,
- 0x0e01, 0x0e3a,
- 0x0e3f, 0x0e5b,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ec8, 0x0ecd,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f71, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fbe, 0x0fcc,
- 0x0fce, 0x0fda,
- 0x1000, 0x10c5,
- 0x10d0, 0x10fc,
- 0x1100, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135d, 0x137c,
- 0x1380, 0x1399,
- 0x13a0, 0x13f4,
- 0x1400, 0x167f,
- 0x1681, 0x169c,
- 0x16a0, 0x16f0,
- 0x1700, 0x170c,
- 0x170e, 0x1714,
- 0x1720, 0x1736,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17dd,
- 0x17e0, 0x17e9,
- 0x17f0, 0x17f9,
- 0x1800, 0x180d,
- 0x1810, 0x1819,
- 0x1820, 0x1877,
- 0x1880, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191c,
- 0x1920, 0x192b,
- 0x1930, 0x193b,
- 0x1940, 0x1940,
- 0x1944, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x19d0, 0x19da,
- 0x19de, 0x1a1b,
- 0x1a1e, 0x1a5e,
- 0x1a60, 0x1a7c,
- 0x1a7f, 0x1a89,
- 0x1a90, 0x1a99,
- 0x1aa0, 0x1aad,
- 0x1b00, 0x1b4b,
- 0x1b50, 0x1b7c,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1bf3,
- 0x1bfc, 0x1c37,
- 0x1c3b, 0x1c49,
- 0x1c4d, 0x1c7f,
- 0x1cd0, 0x1cf2,
- 0x1d00, 0x1de6,
- 0x1dfc, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fc4,
- 0x1fc6, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fdd, 0x1fef,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffe,
- 0x200b, 0x2027,
- 0x202a, 0x202e,
- 0x2030, 0x205e,
- 0x2060, 0x2064,
- 0x206a, 0x2071,
- 0x2074, 0x208e,
- 0x2090, 0x209c,
- 0x20a0, 0x20b9,
- 0x20d0, 0x20f0,
- 0x2100, 0x2189,
- 0x2190, 0x23f3,
- 0x2400, 0x2426,
- 0x2440, 0x244a,
- 0x2460, 0x26ff,
- 0x2701, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x2b4c,
- 0x2b50, 0x2b59,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2cf1,
- 0x2cf9, 0x2d25,
- 0x2d30, 0x2d65,
- 0x2d6f, 0x2d70,
- 0x2d7f, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2de0, 0x2e31,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3001, 0x303f,
- 0x3041, 0x3096,
- 0x3099, 0x30ff,
- 0x3105, 0x312d,
- 0x3131, 0x318e,
- 0x3190, 0x31ba,
- 0x31c0, 0x31e3,
- 0x31f0, 0x321e,
- 0x3220, 0x32fe,
- 0x3300, 0x4db5,
- 0x4dc0, 0x9fcb,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa4d0, 0xa62b,
- 0xa640, 0xa673,
- 0xa67c, 0xa697,
- 0xa6a0, 0xa6f7,
- 0xa700, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa82b,
- 0xa830, 0xa839,
- 0xa840, 0xa877,
- 0xa880, 0xa8c4,
- 0xa8ce, 0xa8d9,
- 0xa8e0, 0xa8fb,
- 0xa900, 0xa953,
- 0xa95f, 0xa97c,
- 0xa980, 0xa9cd,
- 0xa9cf, 0xa9d9,
- 0xa9de, 0xa9df,
- 0xaa00, 0xaa36,
- 0xaa40, 0xaa4d,
- 0xaa50, 0xaa59,
- 0xaa5c, 0xaa7b,
- 0xaa80, 0xaac2,
- 0xaadb, 0xaadf,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xabc0, 0xabed,
- 0xabf0, 0xabf9,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xe000, 0xfa2d,
- 0xfa30, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbc1,
- 0xfbd3, 0xfd3f,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfd,
- 0xfe00, 0xfe19,
- 0xfe20, 0xfe26,
- 0xfe30, 0xfe52,
- 0xfe54, 0xfe66,
- 0xfe68, 0xfe6b,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xfeff, 0xfeff,
- 0xff01, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0xffe0, 0xffe6,
- 0xffe8, 0xffee,
- 0xfff9, 0xfffd,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10100, 0x10102,
- 0x10107, 0x10133,
- 0x10137, 0x1018a,
- 0x10190, 0x1019b,
- 0x101d0, 0x101fd,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x10300, 0x1031e,
- 0x10320, 0x10323,
- 0x10330, 0x1034a,
- 0x10380, 0x1039d,
- 0x1039f, 0x103c3,
- 0x103c8, 0x103d5,
- 0x10400, 0x1049d,
- 0x104a0, 0x104a9,
- 0x10800, 0x10805,
- 0x10808, 0x10808,
- 0x1080a, 0x10835,
- 0x10837, 0x10838,
- 0x1083c, 0x1083c,
- 0x1083f, 0x10855,
- 0x10857, 0x1085f,
- 0x10900, 0x1091b,
- 0x1091f, 0x10939,
- 0x1093f, 0x1093f,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a47,
- 0x10a50, 0x10a58,
- 0x10a60, 0x10a7f,
- 0x10b00, 0x10b35,
- 0x10b39, 0x10b55,
- 0x10b58, 0x10b72,
- 0x10b78, 0x10b7f,
- 0x10c00, 0x10c48,
- 0x10e60, 0x10e7e,
- 0x11000, 0x1104d,
- 0x11052, 0x1106f,
- 0x11080, 0x110c1,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x12470, 0x12473,
- 0x13000, 0x1342e,
- 0x16800, 0x16a38,
- 0x1b000, 0x1b001,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d129, 0x1d1dd,
- 0x1d200, 0x1d245,
- 0x1d300, 0x1d356,
- 0x1d360, 0x1d371,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d7cb,
- 0x1d7ce, 0x1d7ff,
- 0x1f000, 0x1f02b,
- 0x1f030, 0x1f093,
- 0x1f0a0, 0x1f0ae,
- 0x1f0b1, 0x1f0be,
- 0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0df,
- 0x1f100, 0x1f10a,
- 0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
- 0x1f170, 0x1f19a,
- 0x1f1e6, 0x1f202,
- 0x1f210, 0x1f23a,
- 0x1f240, 0x1f248,
- 0x1f250, 0x1f251,
- 0x1f300, 0x1f320,
- 0x1f330, 0x1f335,
- 0x1f337, 0x1f37c,
- 0x1f380, 0x1f393,
- 0x1f3a0, 0x1f3c4,
- 0x1f3c6, 0x1f3ca,
- 0x1f3e0, 0x1f3f0,
- 0x1f400, 0x1f43e,
- 0x1f440, 0x1f440,
- 0x1f442, 0x1f4f7,
- 0x1f4f9, 0x1f4fc,
- 0x1f500, 0x1f53d,
- 0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
- 0x1f645, 0x1f64f,
- 0x1f680, 0x1f6c5,
- 0x1f700, 0x1f773,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2f800, 0x2fa1d,
- 0xe0001, 0xe0001,
- 0xe0020, 0xe007f,
- 0xe0100, 0xe01ef,
- 0xf0000, 0xffffd,
- 0x100000, 0x10fffd,
-}; /* CR_Graph */
-
-/* 'Lower': [[:Lower:]] */
-#define CR_Lower CR_Lowercase
-
-/* 'Print': [[:Print:]] */
-static const OnigCodePoint CR_Print[] = {
- 503,
- 0x0020, 0x007e,
- 0x00a0, 0x0377,
+/* 'Age_6_1': Derived Age 6.1 */
+static const OnigCodePoint CR_Age_6_1[] = {
+ 549,
+ 0x0000, 0x0377,
0x037a, 0x037e,
0x0384, 0x038a,
0x038c, 0x038c,
@@ -20411,10 +23617,11 @@ static const OnigCodePoint CR_Print[] = {
0x0559, 0x055f,
0x0561, 0x0587,
0x0589, 0x058a,
+ 0x058f, 0x058f,
0x0591, 0x05c7,
0x05d0, 0x05ea,
0x05f0, 0x05f4,
- 0x0600, 0x0603,
+ 0x0600, 0x0604,
0x0606, 0x061b,
0x061e, 0x070d,
0x070f, 0x074a,
@@ -20424,6 +23631,9 @@ static const OnigCodePoint CR_Print[] = {
0x0830, 0x083e,
0x0840, 0x085b,
0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
0x0900, 0x0977,
0x0979, 0x097f,
0x0981, 0x0983,
@@ -20468,8 +23678,7 @@ static const OnigCodePoint CR_Print[] = {
0x0acb, 0x0acd,
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0af1, 0x0af1,
+ 0x0ae6, 0x0af1,
0x0b01, 0x0b03,
0x0b05, 0x0b0c,
0x0b0f, 0x0b10,
@@ -20569,7 +23778,7 @@ static const OnigCodePoint CR_Print[] = {
0x0ec6, 0x0ec6,
0x0ec8, 0x0ecd,
0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f47,
0x0f49, 0x0f6c,
0x0f71, 0x0f97,
@@ -20577,8 +23786,9 @@ static const OnigCodePoint CR_Print[] = {
0x0fbe, 0x0fcc,
0x0fce, 0x0fda,
0x1000, 0x10c5,
- 0x10d0, 0x10fc,
- 0x1100, 0x1248,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -20631,13 +23841,12 @@ static const OnigCodePoint CR_Print[] = {
0x1aa0, 0x1aad,
0x1b00, 0x1b4b,
0x1b50, 0x1b7c,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1bf3,
+ 0x1b80, 0x1bf3,
0x1bfc, 0x1c37,
0x1c3b, 0x1c49,
0x1c4d, 0x1c7f,
- 0x1cd0, 0x1cf2,
+ 0x1cc0, 0x1cc7,
+ 0x1cd0, 0x1cf6,
0x1d00, 0x1de6,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
@@ -20655,8 +23864,7 @@ static const OnigCodePoint CR_Print[] = {
0x1fdd, 0x1fef,
0x1ff2, 0x1ff4,
0x1ff6, 0x1ffe,
- 0x2000, 0x2027,
- 0x202a, 0x2064,
+ 0x2000, 0x2064,
0x206a, 0x2071,
0x2074, 0x208e,
0x2090, 0x209c,
@@ -20667,15 +23875,15 @@ static const OnigCodePoint CR_Print[] = {
0x2400, 0x2426,
0x2440, 0x244a,
0x2460, 0x26ff,
- 0x2701, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x2b4c,
+ 0x2701, 0x2b4c,
0x2b50, 0x2b59,
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
- 0x2c60, 0x2cf1,
+ 0x2c60, 0x2cf3,
0x2cf9, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d70,
0x2d7f, 0x2d96,
0x2da0, 0x2da6,
@@ -20686,7 +23894,7 @@ static const OnigCodePoint CR_Print[] = {
0x2dc8, 0x2dce,
0x2dd0, 0x2dd6,
0x2dd8, 0x2dde,
- 0x2de0, 0x2e31,
+ 0x2de0, 0x2e3b,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
0x2f00, 0x2fd5,
@@ -20701,17 +23909,16 @@ static const OnigCodePoint CR_Print[] = {
0x31f0, 0x321e,
0x3220, 0x32fe,
0x3300, 0x4db5,
- 0x4dc0, 0x9fcb,
+ 0x4dc0, 0x9fcc,
0xa000, 0xa48c,
0xa490, 0xa4c6,
0xa4d0, 0xa62b,
- 0xa640, 0xa673,
- 0xa67c, 0xa697,
- 0xa6a0, 0xa6f7,
+ 0xa640, 0xa697,
+ 0xa69f, 0xa6f7,
0xa700, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa82b,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa82b,
0xa830, 0xa839,
0xa840, 0xa877,
0xa880, 0xa8c4,
@@ -20727,7 +23934,7 @@ static const OnigCodePoint CR_Print[] = {
0xaa50, 0xaa59,
0xaa5c, 0xaa7b,
0xaa80, 0xaac2,
- 0xaadb, 0xaadf,
+ 0xaadb, 0xaaf6,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -20738,8 +23945,7 @@ static const OnigCodePoint CR_Print[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xe000, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xd800, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -20752,7 +23958,7 @@ static const OnigCodePoint CR_Print[] = {
0xfbd3, 0xfd3f,
0xfd50, 0xfd8f,
0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfd,
+ 0xfdd0, 0xfdfd,
0xfe00, 0xfe19,
0xfe20, 0xfe26,
0xfe30, 0xfe52,
@@ -20768,8 +23974,7 @@ static const OnigCodePoint CR_Print[] = {
0xffda, 0xffdc,
0xffe0, 0xffe6,
0xffe8, 0xffee,
- 0xfff9, 0xfffd,
- 0x10000, 0x1000b,
+ 0xfff9, 0x1000b,
0x1000d, 0x10026,
0x10028, 0x1003a,
0x1003c, 0x1003d,
@@ -20801,6 +24006,8 @@ static const OnigCodePoint CR_Print[] = {
0x10900, 0x1091b,
0x1091f, 0x10939,
0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a13,
@@ -20819,11 +24026,22 @@ static const OnigCodePoint CR_Print[] = {
0x11000, 0x1104d,
0x11052, 0x1106f,
0x11080, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
0x12000, 0x1236e,
0x12400, 0x12462,
0x12470, 0x12473,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
0x1d000, 0x1d0f5,
0x1d100, 0x1d126,
@@ -20852,6 +24070,40 @@ static const OnigCodePoint CR_Print[] = {
0x1d552, 0x1d6a5,
0x1d6a8, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
@@ -20860,7 +24112,7 @@ static const OnigCodePoint CR_Print[] = {
0x1f0d1, 0x1f0df,
0x1f100, 0x1f10a,
0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
+ 0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
0x1f1e6, 0x1f202,
0x1f210, 0x1f23a,
@@ -20878,1083 +24130,1368 @@ static const OnigCodePoint CR_Print[] = {
0x1f442, 0x1f4f7,
0x1f4f9, 0x1f4fc,
0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
+ 0x1f5fb, 0x1f640,
0x1f645, 0x1f64f,
0x1f680, 0x1f6c5,
0x1f700, 0x1f773,
- 0x20000, 0x2a6d6,
+ 0x1fffe, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
0x2f800, 0x2fa1d,
+ 0x2fffe, 0x2ffff,
+ 0x3fffe, 0x3ffff,
+ 0x4fffe, 0x4ffff,
+ 0x5fffe, 0x5ffff,
+ 0x6fffe, 0x6ffff,
+ 0x7fffe, 0x7ffff,
+ 0x8fffe, 0x8ffff,
+ 0x9fffe, 0x9ffff,
+ 0xafffe, 0xaffff,
+ 0xbfffe, 0xbffff,
+ 0xcfffe, 0xcffff,
+ 0xdfffe, 0xdffff,
0xe0001, 0xe0001,
0xe0020, 0xe007f,
0xe0100, 0xe01ef,
- 0xf0000, 0xffffd,
- 0x100000, 0x10fffd,
-}; /* CR_Print */
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_6_1 */
-/* 'Punct': [[:Punct:]] */
-#define CR_Punct CR_P
+/* 'In_Basic_Latin': Block */
+#define CR_In_Basic_Latin CR_ASCII
-/* 'Space': [[:Space:]] */
-#define CR_Space CR_White_Space
+/* 'In_Latin_1_Supplement': Block */
+static const OnigCodePoint CR_In_Latin_1_Supplement[] = {
+ 1,
+ 0x0080, 0x00ff,
+}; /* CR_In_Latin_1_Supplement */
-/* 'Upper': [[:Upper:]] */
-#define CR_Upper CR_Uppercase
+/* 'In_Latin_Extended_A': Block */
+static const OnigCodePoint CR_In_Latin_Extended_A[] = {
+ 1,
+ 0x0100, 0x017f,
+}; /* CR_In_Latin_Extended_A */
-/* 'XDigit': [[:XDigit:]] */
-#define CR_XDigit CR_ASCII_Hex_Digit
+/* 'In_Latin_Extended_B': Block */
+static const OnigCodePoint CR_In_Latin_Extended_B[] = {
+ 1,
+ 0x0180, 0x024f,
+}; /* CR_In_Latin_Extended_B */
-/* 'Word': [[:Word:]] */
-static const OnigCodePoint CR_Word[] = {
- 514,
- 0x0030, 0x0039,
- 0x0041, 0x005a,
- 0x005f, 0x005f,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x02c1,
- 0x02c6, 0x02d1,
- 0x02e0, 0x02e4,
- 0x02ec, 0x02ec,
- 0x02ee, 0x02ee,
- 0x0300, 0x0374,
- 0x0376, 0x0377,
- 0x037a, 0x037d,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03f5,
- 0x03f7, 0x0481,
- 0x0483, 0x0527,
- 0x0531, 0x0556,
- 0x0559, 0x0559,
- 0x0561, 0x0587,
- 0x0591, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f2,
- 0x0610, 0x061a,
- 0x0620, 0x0669,
- 0x066e, 0x06d3,
- 0x06d5, 0x06dc,
- 0x06df, 0x06e8,
- 0x06ea, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x074a,
- 0x074d, 0x07b1,
- 0x07c0, 0x07f5,
- 0x07fa, 0x07fa,
- 0x0800, 0x082d,
- 0x0840, 0x085b,
- 0x0900, 0x0963,
- 0x0966, 0x096f,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bc, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09ce,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09e6, 0x09f1,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3c, 0x0a3c,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a51, 0x0a51,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a75,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abc, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acd,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3c, 0x0b44,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4d,
- 0x0b56, 0x0b57,
- 0x0b5c, 0x0b5d,
- 0x0b5f, 0x0b63,
- 0x0b66, 0x0b6f,
- 0x0b71, 0x0b71,
- 0x0b82, 0x0b83,
- 0x0b85, 0x0b8a,
- 0x0b8e, 0x0b90,
- 0x0b92, 0x0b95,
- 0x0b99, 0x0b9a,
- 0x0b9c, 0x0b9c,
- 0x0b9e, 0x0b9f,
- 0x0ba3, 0x0ba4,
- 0x0ba8, 0x0baa,
- 0x0bae, 0x0bb9,
- 0x0bbe, 0x0bc2,
- 0x0bc6, 0x0bc8,
- 0x0bca, 0x0bcd,
- 0x0bd0, 0x0bd0,
- 0x0bd7, 0x0bd7,
- 0x0be6, 0x0bef,
- 0x0c01, 0x0c03,
- 0x0c05, 0x0c0c,
- 0x0c0e, 0x0c10,
- 0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
- 0x0c3d, 0x0c44,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4d,
- 0x0c55, 0x0c56,
- 0x0c58, 0x0c59,
- 0x0c60, 0x0c63,
- 0x0c66, 0x0c6f,
- 0x0c82, 0x0c83,
- 0x0c85, 0x0c8c,
- 0x0c8e, 0x0c90,
- 0x0c92, 0x0ca8,
- 0x0caa, 0x0cb3,
- 0x0cb5, 0x0cb9,
- 0x0cbc, 0x0cc4,
- 0x0cc6, 0x0cc8,
- 0x0cca, 0x0ccd,
- 0x0cd5, 0x0cd6,
- 0x0cde, 0x0cde,
- 0x0ce0, 0x0ce3,
- 0x0ce6, 0x0cef,
- 0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d3a,
- 0x0d3d, 0x0d44,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4e,
- 0x0d57, 0x0d57,
- 0x0d60, 0x0d63,
- 0x0d66, 0x0d6f,
- 0x0d7a, 0x0d7f,
- 0x0d82, 0x0d83,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0dca, 0x0dca,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df3,
- 0x0e01, 0x0e3a,
- 0x0e40, 0x0e4e,
- 0x0e50, 0x0e59,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ec8, 0x0ecd,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f00,
- 0x0f18, 0x0f19,
- 0x0f20, 0x0f29,
- 0x0f35, 0x0f35,
- 0x0f37, 0x0f37,
- 0x0f39, 0x0f39,
- 0x0f3e, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f71, 0x0f84,
- 0x0f86, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fc6, 0x0fc6,
- 0x1000, 0x1049,
- 0x1050, 0x109d,
- 0x10a0, 0x10c5,
- 0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135d, 0x135f,
- 0x1380, 0x138f,
- 0x13a0, 0x13f4,
- 0x1401, 0x166c,
- 0x166f, 0x167f,
- 0x1681, 0x169a,
- 0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
- 0x1700, 0x170c,
- 0x170e, 0x1714,
- 0x1720, 0x1734,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17b3,
- 0x17b6, 0x17d3,
- 0x17d7, 0x17d7,
- 0x17dc, 0x17dd,
- 0x17e0, 0x17e9,
- 0x180b, 0x180d,
- 0x1810, 0x1819,
- 0x1820, 0x1877,
- 0x1880, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191c,
- 0x1920, 0x192b,
- 0x1930, 0x193b,
- 0x1946, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x19d0, 0x19d9,
- 0x1a00, 0x1a1b,
- 0x1a20, 0x1a5e,
- 0x1a60, 0x1a7c,
- 0x1a7f, 0x1a89,
- 0x1a90, 0x1a99,
- 0x1aa7, 0x1aa7,
- 0x1b00, 0x1b4b,
- 0x1b50, 0x1b59,
- 0x1b6b, 0x1b73,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1bf3,
- 0x1c00, 0x1c37,
- 0x1c40, 0x1c49,
- 0x1c4d, 0x1c7d,
- 0x1cd0, 0x1cd2,
- 0x1cd4, 0x1cf2,
- 0x1d00, 0x1de6,
- 0x1dfc, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fbc,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fcc,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fe0, 0x1fec,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffc,
- 0x203f, 0x2040,
- 0x2054, 0x2054,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x209c,
- 0x20d0, 0x20f0,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x212f, 0x2139,
- 0x213c, 0x213f,
- 0x2145, 0x2149,
- 0x214e, 0x214e,
- 0x2160, 0x2188,
- 0x24b6, 0x24e9,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2ce4,
- 0x2ceb, 0x2cf1,
- 0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
- 0x2d6f, 0x2d6f,
- 0x2d7f, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
+/* 'In_IPA_Extensions': Block */
+static const OnigCodePoint CR_In_IPA_Extensions[] = {
+ 1,
+ 0x0250, 0x02af,
+}; /* CR_In_IPA_Extensions */
+
+/* 'In_Spacing_Modifier_Letters': Block */
+static const OnigCodePoint CR_In_Spacing_Modifier_Letters[] = {
+ 1,
+ 0x02b0, 0x02ff,
+}; /* CR_In_Spacing_Modifier_Letters */
+
+/* 'In_Combining_Diacritical_Marks': Block */
+static const OnigCodePoint CR_In_Combining_Diacritical_Marks[] = {
+ 1,
+ 0x0300, 0x036f,
+}; /* CR_In_Combining_Diacritical_Marks */
+
+/* 'In_Greek_and_Coptic': Block */
+static const OnigCodePoint CR_In_Greek_and_Coptic[] = {
+ 1,
+ 0x0370, 0x03ff,
+}; /* CR_In_Greek_and_Coptic */
+
+/* 'In_Cyrillic': Block */
+static const OnigCodePoint CR_In_Cyrillic[] = {
+ 1,
+ 0x0400, 0x04ff,
+}; /* CR_In_Cyrillic */
+
+/* 'In_Cyrillic_Supplement': Block */
+static const OnigCodePoint CR_In_Cyrillic_Supplement[] = {
+ 1,
+ 0x0500, 0x052f,
+}; /* CR_In_Cyrillic_Supplement */
+
+/* 'In_Armenian': Block */
+static const OnigCodePoint CR_In_Armenian[] = {
+ 1,
+ 0x0530, 0x058f,
+}; /* CR_In_Armenian */
+
+/* 'In_Hebrew': Block */
+static const OnigCodePoint CR_In_Hebrew[] = {
+ 1,
+ 0x0590, 0x05ff,
+}; /* CR_In_Hebrew */
+
+/* 'In_Arabic': Block */
+static const OnigCodePoint CR_In_Arabic[] = {
+ 1,
+ 0x0600, 0x06ff,
+}; /* CR_In_Arabic */
+
+/* 'In_Syriac': Block */
+static const OnigCodePoint CR_In_Syriac[] = {
+ 1,
+ 0x0700, 0x074f,
+}; /* CR_In_Syriac */
+
+/* 'In_Arabic_Supplement': Block */
+static const OnigCodePoint CR_In_Arabic_Supplement[] = {
+ 1,
+ 0x0750, 0x077f,
+}; /* CR_In_Arabic_Supplement */
+
+/* 'In_Thaana': Block */
+static const OnigCodePoint CR_In_Thaana[] = {
+ 1,
+ 0x0780, 0x07bf,
+}; /* CR_In_Thaana */
+
+/* 'In_NKo': Block */
+static const OnigCodePoint CR_In_NKo[] = {
+ 1,
+ 0x07c0, 0x07ff,
+}; /* CR_In_NKo */
+
+/* 'In_Samaritan': Block */
+static const OnigCodePoint CR_In_Samaritan[] = {
+ 1,
+ 0x0800, 0x083f,
+}; /* CR_In_Samaritan */
+
+/* 'In_Mandaic': Block */
+static const OnigCodePoint CR_In_Mandaic[] = {
+ 1,
+ 0x0840, 0x085f,
+}; /* CR_In_Mandaic */
+
+/* 'In_Arabic_Extended_A': Block */
+static const OnigCodePoint CR_In_Arabic_Extended_A[] = {
+ 1,
+ 0x08a0, 0x08ff,
+}; /* CR_In_Arabic_Extended_A */
+
+/* 'In_Devanagari': Block */
+static const OnigCodePoint CR_In_Devanagari[] = {
+ 1,
+ 0x0900, 0x097f,
+}; /* CR_In_Devanagari */
+
+/* 'In_Bengali': Block */
+static const OnigCodePoint CR_In_Bengali[] = {
+ 1,
+ 0x0980, 0x09ff,
+}; /* CR_In_Bengali */
+
+/* 'In_Gurmukhi': Block */
+static const OnigCodePoint CR_In_Gurmukhi[] = {
+ 1,
+ 0x0a00, 0x0a7f,
+}; /* CR_In_Gurmukhi */
+
+/* 'In_Gujarati': Block */
+static const OnigCodePoint CR_In_Gujarati[] = {
+ 1,
+ 0x0a80, 0x0aff,
+}; /* CR_In_Gujarati */
+
+/* 'In_Oriya': Block */
+static const OnigCodePoint CR_In_Oriya[] = {
+ 1,
+ 0x0b00, 0x0b7f,
+}; /* CR_In_Oriya */
+
+/* 'In_Tamil': Block */
+static const OnigCodePoint CR_In_Tamil[] = {
+ 1,
+ 0x0b80, 0x0bff,
+}; /* CR_In_Tamil */
+
+/* 'In_Telugu': Block */
+static const OnigCodePoint CR_In_Telugu[] = {
+ 1,
+ 0x0c00, 0x0c7f,
+}; /* CR_In_Telugu */
+
+/* 'In_Kannada': Block */
+static const OnigCodePoint CR_In_Kannada[] = {
+ 1,
+ 0x0c80, 0x0cff,
+}; /* CR_In_Kannada */
+
+/* 'In_Malayalam': Block */
+static const OnigCodePoint CR_In_Malayalam[] = {
+ 1,
+ 0x0d00, 0x0d7f,
+}; /* CR_In_Malayalam */
+
+/* 'In_Sinhala': Block */
+static const OnigCodePoint CR_In_Sinhala[] = {
+ 1,
+ 0x0d80, 0x0dff,
+}; /* CR_In_Sinhala */
+
+/* 'In_Thai': Block */
+static const OnigCodePoint CR_In_Thai[] = {
+ 1,
+ 0x0e00, 0x0e7f,
+}; /* CR_In_Thai */
+
+/* 'In_Lao': Block */
+static const OnigCodePoint CR_In_Lao[] = {
+ 1,
+ 0x0e80, 0x0eff,
+}; /* CR_In_Lao */
+
+/* 'In_Tibetan': Block */
+static const OnigCodePoint CR_In_Tibetan[] = {
+ 1,
+ 0x0f00, 0x0fff,
+}; /* CR_In_Tibetan */
+
+/* 'In_Myanmar': Block */
+static const OnigCodePoint CR_In_Myanmar[] = {
+ 1,
+ 0x1000, 0x109f,
+}; /* CR_In_Myanmar */
+
+/* 'In_Georgian': Block */
+static const OnigCodePoint CR_In_Georgian[] = {
+ 1,
+ 0x10a0, 0x10ff,
+}; /* CR_In_Georgian */
+
+/* 'In_Hangul_Jamo': Block */
+static const OnigCodePoint CR_In_Hangul_Jamo[] = {
+ 1,
+ 0x1100, 0x11ff,
+}; /* CR_In_Hangul_Jamo */
+
+/* 'In_Ethiopic': Block */
+static const OnigCodePoint CR_In_Ethiopic[] = {
+ 1,
+ 0x1200, 0x137f,
+}; /* CR_In_Ethiopic */
+
+/* 'In_Ethiopic_Supplement': Block */
+static const OnigCodePoint CR_In_Ethiopic_Supplement[] = {
+ 1,
+ 0x1380, 0x139f,
+}; /* CR_In_Ethiopic_Supplement */
+
+/* 'In_Cherokee': Block */
+static const OnigCodePoint CR_In_Cherokee[] = {
+ 1,
+ 0x13a0, 0x13ff,
+}; /* CR_In_Cherokee */
+
+/* 'In_Unified_Canadian_Aboriginal_Syllabics': Block */
+static const OnigCodePoint CR_In_Unified_Canadian_Aboriginal_Syllabics[] = {
+ 1,
+ 0x1400, 0x167f,
+}; /* CR_In_Unified_Canadian_Aboriginal_Syllabics */
+
+/* 'In_Ogham': Block */
+static const OnigCodePoint CR_In_Ogham[] = {
+ 1,
+ 0x1680, 0x169f,
+}; /* CR_In_Ogham */
+
+/* 'In_Runic': Block */
+static const OnigCodePoint CR_In_Runic[] = {
+ 1,
+ 0x16a0, 0x16ff,
+}; /* CR_In_Runic */
+
+/* 'In_Tagalog': Block */
+static const OnigCodePoint CR_In_Tagalog[] = {
+ 1,
+ 0x1700, 0x171f,
+}; /* CR_In_Tagalog */
+
+/* 'In_Hanunoo': Block */
+static const OnigCodePoint CR_In_Hanunoo[] = {
+ 1,
+ 0x1720, 0x173f,
+}; /* CR_In_Hanunoo */
+
+/* 'In_Buhid': Block */
+static const OnigCodePoint CR_In_Buhid[] = {
+ 1,
+ 0x1740, 0x175f,
+}; /* CR_In_Buhid */
+
+/* 'In_Tagbanwa': Block */
+static const OnigCodePoint CR_In_Tagbanwa[] = {
+ 1,
+ 0x1760, 0x177f,
+}; /* CR_In_Tagbanwa */
+
+/* 'In_Khmer': Block */
+static const OnigCodePoint CR_In_Khmer[] = {
+ 1,
+ 0x1780, 0x17ff,
+}; /* CR_In_Khmer */
+
+/* 'In_Mongolian': Block */
+static const OnigCodePoint CR_In_Mongolian[] = {
+ 1,
+ 0x1800, 0x18af,
+}; /* CR_In_Mongolian */
+
+/* 'In_Unified_Canadian_Aboriginal_Syllabics_Extended': Block */
+static const OnigCodePoint CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended[] = {
+ 1,
+ 0x18b0, 0x18ff,
+}; /* CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended */
+
+/* 'In_Limbu': Block */
+static const OnigCodePoint CR_In_Limbu[] = {
+ 1,
+ 0x1900, 0x194f,
+}; /* CR_In_Limbu */
+
+/* 'In_Tai_Le': Block */
+static const OnigCodePoint CR_In_Tai_Le[] = {
+ 1,
+ 0x1950, 0x197f,
+}; /* CR_In_Tai_Le */
+
+/* 'In_New_Tai_Lue': Block */
+static const OnigCodePoint CR_In_New_Tai_Lue[] = {
+ 1,
+ 0x1980, 0x19df,
+}; /* CR_In_New_Tai_Lue */
+
+/* 'In_Khmer_Symbols': Block */
+static const OnigCodePoint CR_In_Khmer_Symbols[] = {
+ 1,
+ 0x19e0, 0x19ff,
+}; /* CR_In_Khmer_Symbols */
+
+/* 'In_Buginese': Block */
+static const OnigCodePoint CR_In_Buginese[] = {
+ 1,
+ 0x1a00, 0x1a1f,
+}; /* CR_In_Buginese */
+
+/* 'In_Tai_Tham': Block */
+static const OnigCodePoint CR_In_Tai_Tham[] = {
+ 1,
+ 0x1a20, 0x1aaf,
+}; /* CR_In_Tai_Tham */
+
+/* 'In_Balinese': Block */
+static const OnigCodePoint CR_In_Balinese[] = {
+ 1,
+ 0x1b00, 0x1b7f,
+}; /* CR_In_Balinese */
+
+/* 'In_Sundanese': Block */
+static const OnigCodePoint CR_In_Sundanese[] = {
+ 1,
+ 0x1b80, 0x1bbf,
+}; /* CR_In_Sundanese */
+
+/* 'In_Batak': Block */
+static const OnigCodePoint CR_In_Batak[] = {
+ 1,
+ 0x1bc0, 0x1bff,
+}; /* CR_In_Batak */
+
+/* 'In_Lepcha': Block */
+static const OnigCodePoint CR_In_Lepcha[] = {
+ 1,
+ 0x1c00, 0x1c4f,
+}; /* CR_In_Lepcha */
+
+/* 'In_Ol_Chiki': Block */
+#define CR_In_Ol_Chiki CR_Ol_Chiki
+
+/* 'In_Sundanese_Supplement': Block */
+static const OnigCodePoint CR_In_Sundanese_Supplement[] = {
+ 1,
+ 0x1cc0, 0x1ccf,
+}; /* CR_In_Sundanese_Supplement */
+
+/* 'In_Vedic_Extensions': Block */
+static const OnigCodePoint CR_In_Vedic_Extensions[] = {
+ 1,
+ 0x1cd0, 0x1cff,
+}; /* CR_In_Vedic_Extensions */
+
+/* 'In_Phonetic_Extensions': Block */
+static const OnigCodePoint CR_In_Phonetic_Extensions[] = {
+ 1,
+ 0x1d00, 0x1d7f,
+}; /* CR_In_Phonetic_Extensions */
+
+/* 'In_Phonetic_Extensions_Supplement': Block */
+static const OnigCodePoint CR_In_Phonetic_Extensions_Supplement[] = {
+ 1,
+ 0x1d80, 0x1dbf,
+}; /* CR_In_Phonetic_Extensions_Supplement */
+
+/* 'In_Combining_Diacritical_Marks_Supplement': Block */
+static const OnigCodePoint CR_In_Combining_Diacritical_Marks_Supplement[] = {
+ 1,
+ 0x1dc0, 0x1dff,
+}; /* CR_In_Combining_Diacritical_Marks_Supplement */
+
+/* 'In_Latin_Extended_Additional': Block */
+static const OnigCodePoint CR_In_Latin_Extended_Additional[] = {
+ 1,
+ 0x1e00, 0x1eff,
+}; /* CR_In_Latin_Extended_Additional */
+
+/* 'In_Greek_Extended': Block */
+static const OnigCodePoint CR_In_Greek_Extended[] = {
+ 1,
+ 0x1f00, 0x1fff,
+}; /* CR_In_Greek_Extended */
+
+/* 'In_General_Punctuation': Block */
+static const OnigCodePoint CR_In_General_Punctuation[] = {
+ 1,
+ 0x2000, 0x206f,
+}; /* CR_In_General_Punctuation */
+
+/* 'In_Superscripts_and_Subscripts': Block */
+static const OnigCodePoint CR_In_Superscripts_and_Subscripts[] = {
+ 1,
+ 0x2070, 0x209f,
+}; /* CR_In_Superscripts_and_Subscripts */
+
+/* 'In_Currency_Symbols': Block */
+static const OnigCodePoint CR_In_Currency_Symbols[] = {
+ 1,
+ 0x20a0, 0x20cf,
+}; /* CR_In_Currency_Symbols */
+
+/* 'In_Combining_Diacritical_Marks_for_Symbols': Block */
+static const OnigCodePoint CR_In_Combining_Diacritical_Marks_for_Symbols[] = {
+ 1,
+ 0x20d0, 0x20ff,
+}; /* CR_In_Combining_Diacritical_Marks_for_Symbols */
+
+/* 'In_Letterlike_Symbols': Block */
+static const OnigCodePoint CR_In_Letterlike_Symbols[] = {
+ 1,
+ 0x2100, 0x214f,
+}; /* CR_In_Letterlike_Symbols */
+
+/* 'In_Number_Forms': Block */
+static const OnigCodePoint CR_In_Number_Forms[] = {
+ 1,
+ 0x2150, 0x218f,
+}; /* CR_In_Number_Forms */
+
+/* 'In_Arrows': Block */
+static const OnigCodePoint CR_In_Arrows[] = {
+ 1,
+ 0x2190, 0x21ff,
+}; /* CR_In_Arrows */
+
+/* 'In_Mathematical_Operators': Block */
+static const OnigCodePoint CR_In_Mathematical_Operators[] = {
+ 1,
+ 0x2200, 0x22ff,
+}; /* CR_In_Mathematical_Operators */
+
+/* 'In_Miscellaneous_Technical': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Technical[] = {
+ 1,
+ 0x2300, 0x23ff,
+}; /* CR_In_Miscellaneous_Technical */
+
+/* 'In_Control_Pictures': Block */
+static const OnigCodePoint CR_In_Control_Pictures[] = {
+ 1,
+ 0x2400, 0x243f,
+}; /* CR_In_Control_Pictures */
+
+/* 'In_Optical_Character_Recognition': Block */
+static const OnigCodePoint CR_In_Optical_Character_Recognition[] = {
+ 1,
+ 0x2440, 0x245f,
+}; /* CR_In_Optical_Character_Recognition */
+
+/* 'In_Enclosed_Alphanumerics': Block */
+static const OnigCodePoint CR_In_Enclosed_Alphanumerics[] = {
+ 1,
+ 0x2460, 0x24ff,
+}; /* CR_In_Enclosed_Alphanumerics */
+
+/* 'In_Box_Drawing': Block */
+static const OnigCodePoint CR_In_Box_Drawing[] = {
+ 1,
+ 0x2500, 0x257f,
+}; /* CR_In_Box_Drawing */
+
+/* 'In_Block_Elements': Block */
+static const OnigCodePoint CR_In_Block_Elements[] = {
+ 1,
+ 0x2580, 0x259f,
+}; /* CR_In_Block_Elements */
+
+/* 'In_Geometric_Shapes': Block */
+static const OnigCodePoint CR_In_Geometric_Shapes[] = {
+ 1,
+ 0x25a0, 0x25ff,
+}; /* CR_In_Geometric_Shapes */
+
+/* 'In_Miscellaneous_Symbols': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Symbols[] = {
+ 1,
+ 0x2600, 0x26ff,
+}; /* CR_In_Miscellaneous_Symbols */
+
+/* 'In_Dingbats': Block */
+static const OnigCodePoint CR_In_Dingbats[] = {
+ 1,
+ 0x2700, 0x27bf,
+}; /* CR_In_Dingbats */
+
+/* 'In_Miscellaneous_Mathematical_Symbols_A': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Mathematical_Symbols_A[] = {
+ 1,
+ 0x27c0, 0x27ef,
+}; /* CR_In_Miscellaneous_Mathematical_Symbols_A */
+
+/* 'In_Supplemental_Arrows_A': Block */
+static const OnigCodePoint CR_In_Supplemental_Arrows_A[] = {
+ 1,
+ 0x27f0, 0x27ff,
+}; /* CR_In_Supplemental_Arrows_A */
+
+/* 'In_Braille_Patterns': Block */
+#define CR_In_Braille_Patterns CR_Braille
+
+/* 'In_Supplemental_Arrows_B': Block */
+static const OnigCodePoint CR_In_Supplemental_Arrows_B[] = {
+ 1,
+ 0x2900, 0x297f,
+}; /* CR_In_Supplemental_Arrows_B */
+
+/* 'In_Miscellaneous_Mathematical_Symbols_B': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Mathematical_Symbols_B[] = {
+ 1,
+ 0x2980, 0x29ff,
+}; /* CR_In_Miscellaneous_Mathematical_Symbols_B */
+
+/* 'In_Supplemental_Mathematical_Operators': Block */
+static const OnigCodePoint CR_In_Supplemental_Mathematical_Operators[] = {
+ 1,
+ 0x2a00, 0x2aff,
+}; /* CR_In_Supplemental_Mathematical_Operators */
+
+/* 'In_Miscellaneous_Symbols_and_Arrows': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Symbols_and_Arrows[] = {
+ 1,
+ 0x2b00, 0x2bff,
+}; /* CR_In_Miscellaneous_Symbols_and_Arrows */
+
+/* 'In_Glagolitic': Block */
+static const OnigCodePoint CR_In_Glagolitic[] = {
+ 1,
+ 0x2c00, 0x2c5f,
+}; /* CR_In_Glagolitic */
+
+/* 'In_Latin_Extended_C': Block */
+static const OnigCodePoint CR_In_Latin_Extended_C[] = {
+ 1,
+ 0x2c60, 0x2c7f,
+}; /* CR_In_Latin_Extended_C */
+
+/* 'In_Coptic': Block */
+static const OnigCodePoint CR_In_Coptic[] = {
+ 1,
+ 0x2c80, 0x2cff,
+}; /* CR_In_Coptic */
+
+/* 'In_Georgian_Supplement': Block */
+static const OnigCodePoint CR_In_Georgian_Supplement[] = {
+ 1,
+ 0x2d00, 0x2d2f,
+}; /* CR_In_Georgian_Supplement */
+
+/* 'In_Tifinagh': Block */
+static const OnigCodePoint CR_In_Tifinagh[] = {
+ 1,
+ 0x2d30, 0x2d7f,
+}; /* CR_In_Tifinagh */
+
+/* 'In_Ethiopic_Extended': Block */
+static const OnigCodePoint CR_In_Ethiopic_Extended[] = {
+ 1,
+ 0x2d80, 0x2ddf,
+}; /* CR_In_Ethiopic_Extended */
+
+/* 'In_Cyrillic_Extended_A': Block */
+static const OnigCodePoint CR_In_Cyrillic_Extended_A[] = {
+ 1,
0x2de0, 0x2dff,
- 0x2e2f, 0x2e2f,
- 0x3005, 0x3007,
- 0x3021, 0x302f,
- 0x3031, 0x3035,
- 0x3038, 0x303c,
- 0x3041, 0x3096,
- 0x3099, 0x309a,
- 0x309d, 0x309f,
- 0x30a1, 0x30fa,
- 0x30fc, 0x30ff,
- 0x3105, 0x312d,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
+}; /* CR_In_Cyrillic_Extended_A */
+
+/* 'In_Supplemental_Punctuation': Block */
+static const OnigCodePoint CR_In_Supplemental_Punctuation[] = {
+ 1,
+ 0x2e00, 0x2e7f,
+}; /* CR_In_Supplemental_Punctuation */
+
+/* 'In_CJK_Radicals_Supplement': Block */
+static const OnigCodePoint CR_In_CJK_Radicals_Supplement[] = {
+ 1,
+ 0x2e80, 0x2eff,
+}; /* CR_In_CJK_Radicals_Supplement */
+
+/* 'In_Kangxi_Radicals': Block */
+static const OnigCodePoint CR_In_Kangxi_Radicals[] = {
+ 1,
+ 0x2f00, 0x2fdf,
+}; /* CR_In_Kangxi_Radicals */
+
+/* 'In_Ideographic_Description_Characters': Block */
+static const OnigCodePoint CR_In_Ideographic_Description_Characters[] = {
+ 1,
+ 0x2ff0, 0x2fff,
+}; /* CR_In_Ideographic_Description_Characters */
+
+/* 'In_CJK_Symbols_and_Punctuation': Block */
+static const OnigCodePoint CR_In_CJK_Symbols_and_Punctuation[] = {
+ 1,
+ 0x3000, 0x303f,
+}; /* CR_In_CJK_Symbols_and_Punctuation */
+
+/* 'In_Hiragana': Block */
+static const OnigCodePoint CR_In_Hiragana[] = {
+ 1,
+ 0x3040, 0x309f,
+}; /* CR_In_Hiragana */
+
+/* 'In_Katakana': Block */
+static const OnigCodePoint CR_In_Katakana[] = {
+ 1,
+ 0x30a0, 0x30ff,
+}; /* CR_In_Katakana */
+
+/* 'In_Bopomofo': Block */
+static const OnigCodePoint CR_In_Bopomofo[] = {
+ 1,
+ 0x3100, 0x312f,
+}; /* CR_In_Bopomofo */
+
+/* 'In_Hangul_Compatibility_Jamo': Block */
+static const OnigCodePoint CR_In_Hangul_Compatibility_Jamo[] = {
+ 1,
+ 0x3130, 0x318f,
+}; /* CR_In_Hangul_Compatibility_Jamo */
+
+/* 'In_Kanbun': Block */
+static const OnigCodePoint CR_In_Kanbun[] = {
+ 1,
+ 0x3190, 0x319f,
+}; /* CR_In_Kanbun */
+
+/* 'In_Bopomofo_Extended': Block */
+static const OnigCodePoint CR_In_Bopomofo_Extended[] = {
+ 1,
+ 0x31a0, 0x31bf,
+}; /* CR_In_Bopomofo_Extended */
+
+/* 'In_CJK_Strokes': Block */
+static const OnigCodePoint CR_In_CJK_Strokes[] = {
+ 1,
+ 0x31c0, 0x31ef,
+}; /* CR_In_CJK_Strokes */
+
+/* 'In_Katakana_Phonetic_Extensions': Block */
+static const OnigCodePoint CR_In_Katakana_Phonetic_Extensions[] = {
+ 1,
0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa62b,
- 0xa640, 0xa672,
- 0xa67c, 0xa67d,
- 0xa67f, 0xa697,
- 0xa6a0, 0xa6f1,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa827,
- 0xa840, 0xa873,
- 0xa880, 0xa8c4,
- 0xa8d0, 0xa8d9,
- 0xa8e0, 0xa8f7,
- 0xa8fb, 0xa8fb,
- 0xa900, 0xa92d,
- 0xa930, 0xa953,
- 0xa960, 0xa97c,
- 0xa980, 0xa9c0,
- 0xa9cf, 0xa9d9,
- 0xaa00, 0xaa36,
- 0xaa40, 0xaa4d,
- 0xaa50, 0xaa59,
- 0xaa60, 0xaa76,
- 0xaa7a, 0xaa7b,
- 0xaa80, 0xaac2,
- 0xaadb, 0xaadd,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xabc0, 0xabea,
- 0xabec, 0xabed,
- 0xabf0, 0xabf9,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb28,
- 0xfb2a, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3d,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfb,
+}; /* CR_In_Katakana_Phonetic_Extensions */
+
+/* 'In_Enclosed_CJK_Letters_and_Months': Block */
+static const OnigCodePoint CR_In_Enclosed_CJK_Letters_and_Months[] = {
+ 1,
+ 0x3200, 0x32ff,
+}; /* CR_In_Enclosed_CJK_Letters_and_Months */
+
+/* 'In_CJK_Compatibility': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility[] = {
+ 1,
+ 0x3300, 0x33ff,
+}; /* CR_In_CJK_Compatibility */
+
+/* 'In_CJK_Unified_Ideographs_Extension_A': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_A[] = {
+ 1,
+ 0x3400, 0x4dbf,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_A */
+
+/* 'In_Yijing_Hexagram_Symbols': Block */
+static const OnigCodePoint CR_In_Yijing_Hexagram_Symbols[] = {
+ 1,
+ 0x4dc0, 0x4dff,
+}; /* CR_In_Yijing_Hexagram_Symbols */
+
+/* 'In_CJK_Unified_Ideographs': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs[] = {
+ 1,
+ 0x4e00, 0x9fff,
+}; /* CR_In_CJK_Unified_Ideographs */
+
+/* 'In_Yi_Syllables': Block */
+static const OnigCodePoint CR_In_Yi_Syllables[] = {
+ 1,
+ 0xa000, 0xa48f,
+}; /* CR_In_Yi_Syllables */
+
+/* 'In_Yi_Radicals': Block */
+static const OnigCodePoint CR_In_Yi_Radicals[] = {
+ 1,
+ 0xa490, 0xa4cf,
+}; /* CR_In_Yi_Radicals */
+
+/* 'In_Lisu': Block */
+#define CR_In_Lisu CR_Lisu
+
+/* 'In_Vai': Block */
+static const OnigCodePoint CR_In_Vai[] = {
+ 1,
+ 0xa500, 0xa63f,
+}; /* CR_In_Vai */
+
+/* 'In_Cyrillic_Extended_B': Block */
+static const OnigCodePoint CR_In_Cyrillic_Extended_B[] = {
+ 1,
+ 0xa640, 0xa69f,
+}; /* CR_In_Cyrillic_Extended_B */
+
+/* 'In_Bamum': Block */
+static const OnigCodePoint CR_In_Bamum[] = {
+ 1,
+ 0xa6a0, 0xa6ff,
+}; /* CR_In_Bamum */
+
+/* 'In_Modifier_Tone_Letters': Block */
+static const OnigCodePoint CR_In_Modifier_Tone_Letters[] = {
+ 1,
+ 0xa700, 0xa71f,
+}; /* CR_In_Modifier_Tone_Letters */
+
+/* 'In_Latin_Extended_D': Block */
+static const OnigCodePoint CR_In_Latin_Extended_D[] = {
+ 1,
+ 0xa720, 0xa7ff,
+}; /* CR_In_Latin_Extended_D */
+
+/* 'In_Syloti_Nagri': Block */
+static const OnigCodePoint CR_In_Syloti_Nagri[] = {
+ 1,
+ 0xa800, 0xa82f,
+}; /* CR_In_Syloti_Nagri */
+
+/* 'In_Common_Indic_Number_Forms': Block */
+static const OnigCodePoint CR_In_Common_Indic_Number_Forms[] = {
+ 1,
+ 0xa830, 0xa83f,
+}; /* CR_In_Common_Indic_Number_Forms */
+
+/* 'In_Phags_pa': Block */
+static const OnigCodePoint CR_In_Phags_pa[] = {
+ 1,
+ 0xa840, 0xa87f,
+}; /* CR_In_Phags_pa */
+
+/* 'In_Saurashtra': Block */
+static const OnigCodePoint CR_In_Saurashtra[] = {
+ 1,
+ 0xa880, 0xa8df,
+}; /* CR_In_Saurashtra */
+
+/* 'In_Devanagari_Extended': Block */
+static const OnigCodePoint CR_In_Devanagari_Extended[] = {
+ 1,
+ 0xa8e0, 0xa8ff,
+}; /* CR_In_Devanagari_Extended */
+
+/* 'In_Kayah_Li': Block */
+#define CR_In_Kayah_Li CR_Kayah_Li
+
+/* 'In_Rejang': Block */
+static const OnigCodePoint CR_In_Rejang[] = {
+ 1,
+ 0xa930, 0xa95f,
+}; /* CR_In_Rejang */
+
+/* 'In_Hangul_Jamo_Extended_A': Block */
+static const OnigCodePoint CR_In_Hangul_Jamo_Extended_A[] = {
+ 1,
+ 0xa960, 0xa97f,
+}; /* CR_In_Hangul_Jamo_Extended_A */
+
+/* 'In_Javanese': Block */
+static const OnigCodePoint CR_In_Javanese[] = {
+ 1,
+ 0xa980, 0xa9df,
+}; /* CR_In_Javanese */
+
+/* 'In_Cham': Block */
+static const OnigCodePoint CR_In_Cham[] = {
+ 1,
+ 0xaa00, 0xaa5f,
+}; /* CR_In_Cham */
+
+/* 'In_Myanmar_Extended_A': Block */
+static const OnigCodePoint CR_In_Myanmar_Extended_A[] = {
+ 1,
+ 0xaa60, 0xaa7f,
+}; /* CR_In_Myanmar_Extended_A */
+
+/* 'In_Tai_Viet': Block */
+static const OnigCodePoint CR_In_Tai_Viet[] = {
+ 1,
+ 0xaa80, 0xaadf,
+}; /* CR_In_Tai_Viet */
+
+/* 'In_Meetei_Mayek_Extensions': Block */
+static const OnigCodePoint CR_In_Meetei_Mayek_Extensions[] = {
+ 1,
+ 0xaae0, 0xaaff,
+}; /* CR_In_Meetei_Mayek_Extensions */
+
+/* 'In_Ethiopic_Extended_A': Block */
+static const OnigCodePoint CR_In_Ethiopic_Extended_A[] = {
+ 1,
+ 0xab00, 0xab2f,
+}; /* CR_In_Ethiopic_Extended_A */
+
+/* 'In_Meetei_Mayek': Block */
+static const OnigCodePoint CR_In_Meetei_Mayek[] = {
+ 1,
+ 0xabc0, 0xabff,
+}; /* CR_In_Meetei_Mayek */
+
+/* 'In_Hangul_Syllables': Block */
+static const OnigCodePoint CR_In_Hangul_Syllables[] = {
+ 1,
+ 0xac00, 0xd7af,
+}; /* CR_In_Hangul_Syllables */
+
+/* 'In_Hangul_Jamo_Extended_B': Block */
+static const OnigCodePoint CR_In_Hangul_Jamo_Extended_B[] = {
+ 1,
+ 0xd7b0, 0xd7ff,
+}; /* CR_In_Hangul_Jamo_Extended_B */
+
+/* 'In_High_Surrogates': Block */
+static const OnigCodePoint CR_In_High_Surrogates[] = {
+ 1,
+ 0xd800, 0xdb7f,
+}; /* CR_In_High_Surrogates */
+
+/* 'In_High_Private_Use_Surrogates': Block */
+static const OnigCodePoint CR_In_High_Private_Use_Surrogates[] = {
+ 1,
+ 0xdb80, 0xdbff,
+}; /* CR_In_High_Private_Use_Surrogates */
+
+/* 'In_Low_Surrogates': Block */
+static const OnigCodePoint CR_In_Low_Surrogates[] = {
+ 1,
+ 0xdc00, 0xdfff,
+}; /* CR_In_Low_Surrogates */
+
+/* 'In_Private_Use_Area': Block */
+static const OnigCodePoint CR_In_Private_Use_Area[] = {
+ 1,
+ 0xe000, 0xf8ff,
+}; /* CR_In_Private_Use_Area */
+
+/* 'In_CJK_Compatibility_Ideographs': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility_Ideographs[] = {
+ 1,
+ 0xf900, 0xfaff,
+}; /* CR_In_CJK_Compatibility_Ideographs */
+
+/* 'In_Alphabetic_Presentation_Forms': Block */
+static const OnigCodePoint CR_In_Alphabetic_Presentation_Forms[] = {
+ 1,
+ 0xfb00, 0xfb4f,
+}; /* CR_In_Alphabetic_Presentation_Forms */
+
+/* 'In_Arabic_Presentation_Forms_A': Block */
+static const OnigCodePoint CR_In_Arabic_Presentation_Forms_A[] = {
+ 1,
+ 0xfb50, 0xfdff,
+}; /* CR_In_Arabic_Presentation_Forms_A */
+
+/* 'In_Variation_Selectors': Block */
+static const OnigCodePoint CR_In_Variation_Selectors[] = {
+ 1,
0xfe00, 0xfe0f,
- 0xfe20, 0xfe26,
- 0xfe33, 0xfe34,
- 0xfe4d, 0xfe4f,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xff10, 0xff19,
- 0xff21, 0xff3a,
- 0xff3f, 0xff3f,
- 0xff41, 0xff5a,
- 0xff66, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10140, 0x10174,
- 0x101fd, 0x101fd,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x10300, 0x1031e,
- 0x10330, 0x1034a,
- 0x10380, 0x1039d,
- 0x103a0, 0x103c3,
- 0x103c8, 0x103cf,
- 0x103d1, 0x103d5,
- 0x10400, 0x1049d,
- 0x104a0, 0x104a9,
- 0x10800, 0x10805,
- 0x10808, 0x10808,
- 0x1080a, 0x10835,
- 0x10837, 0x10838,
- 0x1083c, 0x1083c,
- 0x1083f, 0x10855,
- 0x10900, 0x10915,
- 0x10920, 0x10939,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a3f,
- 0x10a60, 0x10a7c,
- 0x10b00, 0x10b35,
- 0x10b40, 0x10b55,
- 0x10b60, 0x10b72,
- 0x10c00, 0x10c48,
- 0x11000, 0x11046,
- 0x11066, 0x1106f,
- 0x11080, 0x110ba,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x13000, 0x1342e,
- 0x16800, 0x16a38,
- 0x1b000, 0x1b001,
- 0x1d165, 0x1d169,
- 0x1d16d, 0x1d172,
- 0x1d17b, 0x1d182,
- 0x1d185, 0x1d18b,
- 0x1d1aa, 0x1d1ad,
- 0x1d242, 0x1d244,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d6c0,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6fa,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d734,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d76e,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d7a8,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7cb,
- 0x1d7ce, 0x1d7ff,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2f800, 0x2fa1d,
+}; /* CR_In_Variation_Selectors */
+
+/* 'In_Vertical_Forms': Block */
+static const OnigCodePoint CR_In_Vertical_Forms[] = {
+ 1,
+ 0xfe10, 0xfe1f,
+}; /* CR_In_Vertical_Forms */
+
+/* 'In_Combining_Half_Marks': Block */
+static const OnigCodePoint CR_In_Combining_Half_Marks[] = {
+ 1,
+ 0xfe20, 0xfe2f,
+}; /* CR_In_Combining_Half_Marks */
+
+/* 'In_CJK_Compatibility_Forms': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility_Forms[] = {
+ 1,
+ 0xfe30, 0xfe4f,
+}; /* CR_In_CJK_Compatibility_Forms */
+
+/* 'In_Small_Form_Variants': Block */
+static const OnigCodePoint CR_In_Small_Form_Variants[] = {
+ 1,
+ 0xfe50, 0xfe6f,
+}; /* CR_In_Small_Form_Variants */
+
+/* 'In_Arabic_Presentation_Forms_B': Block */
+static const OnigCodePoint CR_In_Arabic_Presentation_Forms_B[] = {
+ 1,
+ 0xfe70, 0xfeff,
+}; /* CR_In_Arabic_Presentation_Forms_B */
+
+/* 'In_Halfwidth_and_Fullwidth_Forms': Block */
+static const OnigCodePoint CR_In_Halfwidth_and_Fullwidth_Forms[] = {
+ 1,
+ 0xff00, 0xffef,
+}; /* CR_In_Halfwidth_and_Fullwidth_Forms */
+
+/* 'In_Specials': Block */
+static const OnigCodePoint CR_In_Specials[] = {
+ 1,
+ 0xfff0, 0xffff,
+}; /* CR_In_Specials */
+
+/* 'In_Linear_B_Syllabary': Block */
+static const OnigCodePoint CR_In_Linear_B_Syllabary[] = {
+ 1,
+ 0x10000, 0x1007f,
+}; /* CR_In_Linear_B_Syllabary */
+
+/* 'In_Linear_B_Ideograms': Block */
+static const OnigCodePoint CR_In_Linear_B_Ideograms[] = {
+ 1,
+ 0x10080, 0x100ff,
+}; /* CR_In_Linear_B_Ideograms */
+
+/* 'In_Aegean_Numbers': Block */
+static const OnigCodePoint CR_In_Aegean_Numbers[] = {
+ 1,
+ 0x10100, 0x1013f,
+}; /* CR_In_Aegean_Numbers */
+
+/* 'In_Ancient_Greek_Numbers': Block */
+static const OnigCodePoint CR_In_Ancient_Greek_Numbers[] = {
+ 1,
+ 0x10140, 0x1018f,
+}; /* CR_In_Ancient_Greek_Numbers */
+
+/* 'In_Ancient_Symbols': Block */
+static const OnigCodePoint CR_In_Ancient_Symbols[] = {
+ 1,
+ 0x10190, 0x101cf,
+}; /* CR_In_Ancient_Symbols */
+
+/* 'In_Phaistos_Disc': Block */
+static const OnigCodePoint CR_In_Phaistos_Disc[] = {
+ 1,
+ 0x101d0, 0x101ff,
+}; /* CR_In_Phaistos_Disc */
+
+/* 'In_Lycian': Block */
+static const OnigCodePoint CR_In_Lycian[] = {
+ 1,
+ 0x10280, 0x1029f,
+}; /* CR_In_Lycian */
+
+/* 'In_Carian': Block */
+static const OnigCodePoint CR_In_Carian[] = {
+ 1,
+ 0x102a0, 0x102df,
+}; /* CR_In_Carian */
+
+/* 'In_Old_Italic': Block */
+static const OnigCodePoint CR_In_Old_Italic[] = {
+ 1,
+ 0x10300, 0x1032f,
+}; /* CR_In_Old_Italic */
+
+/* 'In_Gothic': Block */
+static const OnigCodePoint CR_In_Gothic[] = {
+ 1,
+ 0x10330, 0x1034f,
+}; /* CR_In_Gothic */
+
+/* 'In_Ugaritic': Block */
+static const OnigCodePoint CR_In_Ugaritic[] = {
+ 1,
+ 0x10380, 0x1039f,
+}; /* CR_In_Ugaritic */
+
+/* 'In_Old_Persian': Block */
+static const OnigCodePoint CR_In_Old_Persian[] = {
+ 1,
+ 0x103a0, 0x103df,
+}; /* CR_In_Old_Persian */
+
+/* 'In_Deseret': Block */
+#define CR_In_Deseret CR_Deseret
+
+/* 'In_Shavian': Block */
+#define CR_In_Shavian CR_Shavian
+
+/* 'In_Osmanya': Block */
+static const OnigCodePoint CR_In_Osmanya[] = {
+ 1,
+ 0x10480, 0x104af,
+}; /* CR_In_Osmanya */
+
+/* 'In_Cypriot_Syllabary': Block */
+static const OnigCodePoint CR_In_Cypriot_Syllabary[] = {
+ 1,
+ 0x10800, 0x1083f,
+}; /* CR_In_Cypriot_Syllabary */
+
+/* 'In_Imperial_Aramaic': Block */
+static const OnigCodePoint CR_In_Imperial_Aramaic[] = {
+ 1,
+ 0x10840, 0x1085f,
+}; /* CR_In_Imperial_Aramaic */
+
+/* 'In_Phoenician': Block */
+static const OnigCodePoint CR_In_Phoenician[] = {
+ 1,
+ 0x10900, 0x1091f,
+}; /* CR_In_Phoenician */
+
+/* 'In_Lydian': Block */
+static const OnigCodePoint CR_In_Lydian[] = {
+ 1,
+ 0x10920, 0x1093f,
+}; /* CR_In_Lydian */
+
+/* 'In_Meroitic_Hieroglyphs': Block */
+#define CR_In_Meroitic_Hieroglyphs CR_Meroitic_Hieroglyphs
+
+/* 'In_Meroitic_Cursive': Block */
+static const OnigCodePoint CR_In_Meroitic_Cursive[] = {
+ 1,
+ 0x109a0, 0x109ff,
+}; /* CR_In_Meroitic_Cursive */
+
+/* 'In_Kharoshthi': Block */
+static const OnigCodePoint CR_In_Kharoshthi[] = {
+ 1,
+ 0x10a00, 0x10a5f,
+}; /* CR_In_Kharoshthi */
+
+/* 'In_Old_South_Arabian': Block */
+#define CR_In_Old_South_Arabian CR_Old_South_Arabian
+
+/* 'In_Avestan': Block */
+static const OnigCodePoint CR_In_Avestan[] = {
+ 1,
+ 0x10b00, 0x10b3f,
+}; /* CR_In_Avestan */
+
+/* 'In_Inscriptional_Parthian': Block */
+static const OnigCodePoint CR_In_Inscriptional_Parthian[] = {
+ 1,
+ 0x10b40, 0x10b5f,
+}; /* CR_In_Inscriptional_Parthian */
+
+/* 'In_Inscriptional_Pahlavi': Block */
+static const OnigCodePoint CR_In_Inscriptional_Pahlavi[] = {
+ 1,
+ 0x10b60, 0x10b7f,
+}; /* CR_In_Inscriptional_Pahlavi */
+
+/* 'In_Old_Turkic': Block */
+static const OnigCodePoint CR_In_Old_Turkic[] = {
+ 1,
+ 0x10c00, 0x10c4f,
+}; /* CR_In_Old_Turkic */
+
+/* 'In_Rumi_Numeral_Symbols': Block */
+static const OnigCodePoint CR_In_Rumi_Numeral_Symbols[] = {
+ 1,
+ 0x10e60, 0x10e7f,
+}; /* CR_In_Rumi_Numeral_Symbols */
+
+/* 'In_Brahmi': Block */
+static const OnigCodePoint CR_In_Brahmi[] = {
+ 1,
+ 0x11000, 0x1107f,
+}; /* CR_In_Brahmi */
+
+/* 'In_Kaithi': Block */
+static const OnigCodePoint CR_In_Kaithi[] = {
+ 1,
+ 0x11080, 0x110cf,
+}; /* CR_In_Kaithi */
+
+/* 'In_Sora_Sompeng': Block */
+static const OnigCodePoint CR_In_Sora_Sompeng[] = {
+ 1,
+ 0x110d0, 0x110ff,
+}; /* CR_In_Sora_Sompeng */
+
+/* 'In_Chakma': Block */
+static const OnigCodePoint CR_In_Chakma[] = {
+ 1,
+ 0x11100, 0x1114f,
+}; /* CR_In_Chakma */
+
+/* 'In_Sharada': Block */
+static const OnigCodePoint CR_In_Sharada[] = {
+ 1,
+ 0x11180, 0x111df,
+}; /* CR_In_Sharada */
+
+/* 'In_Takri': Block */
+static const OnigCodePoint CR_In_Takri[] = {
+ 1,
+ 0x11680, 0x116cf,
+}; /* CR_In_Takri */
+
+/* 'In_Cuneiform': Block */
+static const OnigCodePoint CR_In_Cuneiform[] = {
+ 1,
+ 0x12000, 0x123ff,
+}; /* CR_In_Cuneiform */
+
+/* 'In_Cuneiform_Numbers_and_Punctuation': Block */
+static const OnigCodePoint CR_In_Cuneiform_Numbers_and_Punctuation[] = {
+ 1,
+ 0x12400, 0x1247f,
+}; /* CR_In_Cuneiform_Numbers_and_Punctuation */
+
+/* 'In_Egyptian_Hieroglyphs': Block */
+static const OnigCodePoint CR_In_Egyptian_Hieroglyphs[] = {
+ 1,
+ 0x13000, 0x1342f,
+}; /* CR_In_Egyptian_Hieroglyphs */
+
+/* 'In_Bamum_Supplement': Block */
+static const OnigCodePoint CR_In_Bamum_Supplement[] = {
+ 1,
+ 0x16800, 0x16a3f,
+}; /* CR_In_Bamum_Supplement */
+
+/* 'In_Miao': Block */
+static const OnigCodePoint CR_In_Miao[] = {
+ 1,
+ 0x16f00, 0x16f9f,
+}; /* CR_In_Miao */
+
+/* 'In_Kana_Supplement': Block */
+static const OnigCodePoint CR_In_Kana_Supplement[] = {
+ 1,
+ 0x1b000, 0x1b0ff,
+}; /* CR_In_Kana_Supplement */
+
+/* 'In_Byzantine_Musical_Symbols': Block */
+static const OnigCodePoint CR_In_Byzantine_Musical_Symbols[] = {
+ 1,
+ 0x1d000, 0x1d0ff,
+}; /* CR_In_Byzantine_Musical_Symbols */
+
+/* 'In_Musical_Symbols': Block */
+static const OnigCodePoint CR_In_Musical_Symbols[] = {
+ 1,
+ 0x1d100, 0x1d1ff,
+}; /* CR_In_Musical_Symbols */
+
+/* 'In_Ancient_Greek_Musical_Notation': Block */
+static const OnigCodePoint CR_In_Ancient_Greek_Musical_Notation[] = {
+ 1,
+ 0x1d200, 0x1d24f,
+}; /* CR_In_Ancient_Greek_Musical_Notation */
+
+/* 'In_Tai_Xuan_Jing_Symbols': Block */
+static const OnigCodePoint CR_In_Tai_Xuan_Jing_Symbols[] = {
+ 1,
+ 0x1d300, 0x1d35f,
+}; /* CR_In_Tai_Xuan_Jing_Symbols */
+
+/* 'In_Counting_Rod_Numerals': Block */
+static const OnigCodePoint CR_In_Counting_Rod_Numerals[] = {
+ 1,
+ 0x1d360, 0x1d37f,
+}; /* CR_In_Counting_Rod_Numerals */
+
+/* 'In_Mathematical_Alphanumeric_Symbols': Block */
+static const OnigCodePoint CR_In_Mathematical_Alphanumeric_Symbols[] = {
+ 1,
+ 0x1d400, 0x1d7ff,
+}; /* CR_In_Mathematical_Alphanumeric_Symbols */
+
+/* 'In_Arabic_Mathematical_Alphabetic_Symbols': Block */
+static const OnigCodePoint CR_In_Arabic_Mathematical_Alphabetic_Symbols[] = {
+ 1,
+ 0x1ee00, 0x1eeff,
+}; /* CR_In_Arabic_Mathematical_Alphabetic_Symbols */
+
+/* 'In_Mahjong_Tiles': Block */
+static const OnigCodePoint CR_In_Mahjong_Tiles[] = {
+ 1,
+ 0x1f000, 0x1f02f,
+}; /* CR_In_Mahjong_Tiles */
+
+/* 'In_Domino_Tiles': Block */
+static const OnigCodePoint CR_In_Domino_Tiles[] = {
+ 1,
+ 0x1f030, 0x1f09f,
+}; /* CR_In_Domino_Tiles */
+
+/* 'In_Playing_Cards': Block */
+static const OnigCodePoint CR_In_Playing_Cards[] = {
+ 1,
+ 0x1f0a0, 0x1f0ff,
+}; /* CR_In_Playing_Cards */
+
+/* 'In_Enclosed_Alphanumeric_Supplement': Block */
+static const OnigCodePoint CR_In_Enclosed_Alphanumeric_Supplement[] = {
+ 1,
+ 0x1f100, 0x1f1ff,
+}; /* CR_In_Enclosed_Alphanumeric_Supplement */
+
+/* 'In_Enclosed_Ideographic_Supplement': Block */
+static const OnigCodePoint CR_In_Enclosed_Ideographic_Supplement[] = {
+ 1,
+ 0x1f200, 0x1f2ff,
+}; /* CR_In_Enclosed_Ideographic_Supplement */
+
+/* 'In_Miscellaneous_Symbols_And_Pictographs': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Symbols_And_Pictographs[] = {
+ 1,
+ 0x1f300, 0x1f5ff,
+}; /* CR_In_Miscellaneous_Symbols_And_Pictographs */
+
+/* 'In_Emoticons': Block */
+static const OnigCodePoint CR_In_Emoticons[] = {
+ 1,
+ 0x1f600, 0x1f64f,
+}; /* CR_In_Emoticons */
+
+/* 'In_Transport_And_Map_Symbols': Block */
+static const OnigCodePoint CR_In_Transport_And_Map_Symbols[] = {
+ 1,
+ 0x1f680, 0x1f6ff,
+}; /* CR_In_Transport_And_Map_Symbols */
+
+/* 'In_Alchemical_Symbols': Block */
+static const OnigCodePoint CR_In_Alchemical_Symbols[] = {
+ 1,
+ 0x1f700, 0x1f77f,
+}; /* CR_In_Alchemical_Symbols */
+
+/* 'In_CJK_Unified_Ideographs_Extension_B': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_B[] = {
+ 1,
+ 0x20000, 0x2a6df,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_B */
+
+/* 'In_CJK_Unified_Ideographs_Extension_C': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_C[] = {
+ 1,
+ 0x2a700, 0x2b73f,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_C */
+
+/* 'In_CJK_Unified_Ideographs_Extension_D': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_D[] = {
+ 1,
+ 0x2b740, 0x2b81f,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_D */
+
+/* 'In_CJK_Compatibility_Ideographs_Supplement': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility_Ideographs_Supplement[] = {
+ 1,
+ 0x2f800, 0x2fa1f,
+}; /* CR_In_CJK_Compatibility_Ideographs_Supplement */
+
+/* 'In_Tags': Block */
+static const OnigCodePoint CR_In_Tags[] = {
+ 1,
+ 0xe0000, 0xe007f,
+}; /* CR_In_Tags */
+
+/* 'In_Variation_Selectors_Supplement': Block */
+static const OnigCodePoint CR_In_Variation_Selectors_Supplement[] = {
+ 1,
0xe0100, 0xe01ef,
-}; /* CR_Word */
+}; /* CR_In_Variation_Selectors_Supplement */
-/* 'Alnum': [[:Alnum:]] */
-static const OnigCodePoint CR_Alnum[] = {
- 509,
- 0x0030, 0x0039,
- 0x0041, 0x005a,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x02c1,
- 0x02c6, 0x02d1,
- 0x02e0, 0x02e4,
- 0x02ec, 0x02ec,
- 0x02ee, 0x02ee,
- 0x0345, 0x0345,
- 0x0370, 0x0374,
- 0x0376, 0x0377,
- 0x037a, 0x037d,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03f5,
- 0x03f7, 0x0481,
- 0x048a, 0x0527,
- 0x0531, 0x0556,
- 0x0559, 0x0559,
- 0x0561, 0x0587,
- 0x05b0, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f2,
- 0x0610, 0x061a,
- 0x0620, 0x0657,
- 0x0659, 0x0669,
- 0x066e, 0x06d3,
- 0x06d5, 0x06dc,
- 0x06e1, 0x06e8,
- 0x06ed, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x073f,
- 0x074d, 0x07b1,
- 0x07c0, 0x07ea,
- 0x07f4, 0x07f5,
- 0x07fa, 0x07fa,
- 0x0800, 0x0817,
- 0x081a, 0x082c,
- 0x0840, 0x0858,
- 0x0900, 0x093b,
- 0x093d, 0x094c,
- 0x094e, 0x0950,
- 0x0955, 0x0963,
- 0x0966, 0x096f,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bd, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09cc,
- 0x09ce, 0x09ce,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09e6, 0x09f1,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4c,
- 0x0a51, 0x0a51,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a75,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abd, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acc,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3d, 0x0b44,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4c,
- 0x0b56, 0x0b57,
- 0x0b5c, 0x0b5d,
- 0x0b5f, 0x0b63,
- 0x0b66, 0x0b6f,
- 0x0b71, 0x0b71,
- 0x0b82, 0x0b83,
- 0x0b85, 0x0b8a,
- 0x0b8e, 0x0b90,
- 0x0b92, 0x0b95,
- 0x0b99, 0x0b9a,
- 0x0b9c, 0x0b9c,
- 0x0b9e, 0x0b9f,
- 0x0ba3, 0x0ba4,
- 0x0ba8, 0x0baa,
- 0x0bae, 0x0bb9,
- 0x0bbe, 0x0bc2,
- 0x0bc6, 0x0bc8,
- 0x0bca, 0x0bcc,
- 0x0bd0, 0x0bd0,
- 0x0bd7, 0x0bd7,
- 0x0be6, 0x0bef,
- 0x0c01, 0x0c03,
- 0x0c05, 0x0c0c,
- 0x0c0e, 0x0c10,
- 0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
- 0x0c3d, 0x0c44,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4c,
- 0x0c55, 0x0c56,
- 0x0c58, 0x0c59,
- 0x0c60, 0x0c63,
- 0x0c66, 0x0c6f,
- 0x0c82, 0x0c83,
- 0x0c85, 0x0c8c,
- 0x0c8e, 0x0c90,
- 0x0c92, 0x0ca8,
- 0x0caa, 0x0cb3,
- 0x0cb5, 0x0cb9,
- 0x0cbd, 0x0cc4,
- 0x0cc6, 0x0cc8,
- 0x0cca, 0x0ccc,
- 0x0cd5, 0x0cd6,
- 0x0cde, 0x0cde,
- 0x0ce0, 0x0ce3,
- 0x0ce6, 0x0cef,
- 0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d3a,
- 0x0d3d, 0x0d44,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4c,
- 0x0d4e, 0x0d4e,
- 0x0d57, 0x0d57,
- 0x0d60, 0x0d63,
- 0x0d66, 0x0d6f,
- 0x0d7a, 0x0d7f,
- 0x0d82, 0x0d83,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df3,
- 0x0e01, 0x0e3a,
- 0x0e40, 0x0e46,
- 0x0e4d, 0x0e4d,
- 0x0e50, 0x0e59,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ecd, 0x0ecd,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f00,
- 0x0f20, 0x0f29,
- 0x0f40, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f71, 0x0f81,
- 0x0f88, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x1000, 0x1036,
- 0x1038, 0x1038,
- 0x103b, 0x1049,
- 0x1050, 0x1062,
- 0x1065, 0x1068,
- 0x106e, 0x1086,
- 0x108e, 0x108e,
- 0x1090, 0x1099,
- 0x109c, 0x109d,
- 0x10a0, 0x10c5,
- 0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135f, 0x135f,
- 0x1380, 0x138f,
- 0x13a0, 0x13f4,
- 0x1401, 0x166c,
- 0x166f, 0x167f,
- 0x1681, 0x169a,
- 0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
- 0x1700, 0x170c,
- 0x170e, 0x1713,
- 0x1720, 0x1733,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17b3,
- 0x17b6, 0x17c8,
- 0x17d7, 0x17d7,
- 0x17dc, 0x17dc,
- 0x17e0, 0x17e9,
- 0x1810, 0x1819,
- 0x1820, 0x1877,
- 0x1880, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191c,
- 0x1920, 0x192b,
- 0x1930, 0x1938,
- 0x1946, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x19d0, 0x19d9,
- 0x1a00, 0x1a1b,
- 0x1a20, 0x1a5e,
- 0x1a61, 0x1a74,
- 0x1a80, 0x1a89,
- 0x1a90, 0x1a99,
- 0x1aa7, 0x1aa7,
- 0x1b00, 0x1b33,
- 0x1b35, 0x1b43,
- 0x1b45, 0x1b4b,
- 0x1b50, 0x1b59,
- 0x1b80, 0x1ba9,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1be5,
- 0x1be7, 0x1bf1,
- 0x1c00, 0x1c35,
- 0x1c40, 0x1c49,
- 0x1c4d, 0x1c7d,
- 0x1ce9, 0x1cec,
- 0x1cee, 0x1cf2,
- 0x1d00, 0x1dbf,
- 0x1e00, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fbc,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fcc,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fe0, 0x1fec,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffc,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x209c,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x212f, 0x2139,
- 0x213c, 0x213f,
- 0x2145, 0x2149,
- 0x214e, 0x214e,
- 0x2160, 0x2188,
- 0x24b6, 0x24e9,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2ce4,
- 0x2ceb, 0x2cee,
- 0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
- 0x2d6f, 0x2d6f,
- 0x2d80, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2de0, 0x2dff,
- 0x2e2f, 0x2e2f,
- 0x3005, 0x3007,
- 0x3021, 0x3029,
- 0x3031, 0x3035,
- 0x3038, 0x303c,
- 0x3041, 0x3096,
- 0x309d, 0x309f,
- 0x30a1, 0x30fa,
- 0x30fc, 0x30ff,
- 0x3105, 0x312d,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa62b,
- 0xa640, 0xa66e,
- 0xa67f, 0xa697,
- 0xa6a0, 0xa6ef,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa801,
- 0xa803, 0xa805,
- 0xa807, 0xa80a,
- 0xa80c, 0xa827,
- 0xa840, 0xa873,
- 0xa880, 0xa8c3,
- 0xa8d0, 0xa8d9,
- 0xa8f2, 0xa8f7,
- 0xa8fb, 0xa8fb,
- 0xa900, 0xa92a,
- 0xa930, 0xa952,
- 0xa960, 0xa97c,
- 0xa980, 0xa9b2,
- 0xa9b4, 0xa9bf,
- 0xa9cf, 0xa9d9,
- 0xaa00, 0xaa36,
- 0xaa40, 0xaa4d,
- 0xaa50, 0xaa59,
- 0xaa60, 0xaa76,
- 0xaa7a, 0xaa7a,
- 0xaa80, 0xaabe,
- 0xaac0, 0xaac0,
- 0xaac2, 0xaac2,
- 0xaadb, 0xaadd,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xabc0, 0xabea,
- 0xabf0, 0xabf9,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb28,
- 0xfb2a, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3d,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfb,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xff10, 0xff19,
- 0xff21, 0xff3a,
- 0xff41, 0xff5a,
- 0xff66, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10140, 0x10174,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x10300, 0x1031e,
- 0x10330, 0x1034a,
- 0x10380, 0x1039d,
- 0x103a0, 0x103c3,
- 0x103c8, 0x103cf,
- 0x103d1, 0x103d5,
- 0x10400, 0x1049d,
- 0x104a0, 0x104a9,
- 0x10800, 0x10805,
- 0x10808, 0x10808,
- 0x1080a, 0x10835,
- 0x10837, 0x10838,
- 0x1083c, 0x1083c,
- 0x1083f, 0x10855,
- 0x10900, 0x10915,
- 0x10920, 0x10939,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x10a60, 0x10a7c,
- 0x10b00, 0x10b35,
- 0x10b40, 0x10b55,
- 0x10b60, 0x10b72,
- 0x10c00, 0x10c48,
- 0x11000, 0x11045,
- 0x11066, 0x1106f,
- 0x11082, 0x110b8,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x13000, 0x1342e,
- 0x16800, 0x16a38,
- 0x1b000, 0x1b001,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d6c0,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6fa,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d734,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d76e,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d7a8,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7cb,
- 0x1d7ce, 0x1d7ff,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2f800, 0x2fa1d,
-}; /* CR_Alnum */
+/* 'In_Supplementary_Private_Use_Area_A': Block */
+static const OnigCodePoint CR_In_Supplementary_Private_Use_Area_A[] = {
+ 1,
+ 0xf0000, 0xfffff,
+}; /* CR_In_Supplementary_Private_Use_Area_A */
-/* 'ASCII': [[:ASCII:]] */
-static const OnigCodePoint CR_ASCII[] = {
+/* 'In_Supplementary_Private_Use_Area_B': Block */
+static const OnigCodePoint CR_In_Supplementary_Private_Use_Area_B[] = {
1,
- 0x0000, 0x007f,
-}; /* CR_ASCII */
+ 0x100000, 0x10ffff,
+}; /* CR_In_Supplementary_Private_Use_Area_B */
+
+/* 'In_No_Block': Block */
+static const OnigCodePoint CR_In_No_Block[] = {
+ 36,
+ 0x0860, 0x089f,
+ 0x1ab0, 0x1aff,
+ 0x1c80, 0x1cbf,
+ 0x2fe0, 0x2fef,
+ 0xa9e0, 0xa9ff,
+ 0xab30, 0xabbf,
+ 0x10200, 0x1027f,
+ 0x102e0, 0x102ff,
+ 0x10350, 0x1037f,
+ 0x103e0, 0x103ff,
+ 0x104b0, 0x107ff,
+ 0x10860, 0x108ff,
+ 0x10940, 0x1097f,
+ 0x10a80, 0x10aff,
+ 0x10b80, 0x10bff,
+ 0x10c50, 0x10e5f,
+ 0x10e80, 0x10fff,
+ 0x11150, 0x1117f,
+ 0x111e0, 0x1167f,
+ 0x116d0, 0x11fff,
+ 0x12480, 0x12fff,
+ 0x13430, 0x167ff,
+ 0x16a40, 0x16eff,
+ 0x16fa0, 0x1afff,
+ 0x1b100, 0x1cfff,
+ 0x1d250, 0x1d2ff,
+ 0x1d380, 0x1d3ff,
+ 0x1d800, 0x1edff,
+ 0x1ef00, 0x1efff,
+ 0x1f650, 0x1f67f,
+ 0x1f780, 0x1ffff,
+ 0x2a6e0, 0x2a6ff,
+ 0x2b820, 0x2f7ff,
+ 0x2fa20, 0xdffff,
+ 0xe0080, 0xe00ff,
+ 0xe01f0, 0xeffff,
+}; /* CR_In_No_Block */
+#endif /* USE_UNICODE_PROPERTIES */
static const OnigCodePoint* const CodeRanges[] = {
CR_NEWLINE,
@@ -21973,7 +25510,6 @@ static const OnigCodePoint* const CodeRanges[] = {
CR_Alnum,
CR_ASCII,
#ifdef USE_UNICODE_PROPERTIES
-#ifdef USE_UNICODE_PROPERTIES
CR_Any,
CR_Assigned,
CR_C,
@@ -21983,6 +25519,7 @@ static const OnigCodePoint* const CodeRanges[] = {
CR_Co,
CR_Cs,
CR_L,
+ CR_LC,
CR_Ll,
CR_Lm,
CR_Lo,
@@ -22127,6 +25664,13 @@ static const OnigCodePoint* const CodeRanges[] = {
CR_Batak,
CR_Brahmi,
CR_Mandaic,
+ CR_Chakma,
+ CR_Meroitic_Cursive,
+ CR_Meroitic_Hieroglyphs,
+ CR_Miao,
+ CR_Sharada,
+ CR_Sora_Sompeng,
+ CR_Takri,
CR_White_Space,
CR_Bidi_Control,
CR_Join_Control,
@@ -22172,7 +25716,228 @@ static const OnigCodePoint* const CodeRanges[] = {
CR_Age_5_1,
CR_Age_5_2,
CR_Age_6_0,
-#endif /* USE_UNICODE_PROPERTIES */
+ CR_Age_6_1,
+ CR_In_Basic_Latin,
+ CR_In_Latin_1_Supplement,
+ CR_In_Latin_Extended_A,
+ CR_In_Latin_Extended_B,
+ CR_In_IPA_Extensions,
+ CR_In_Spacing_Modifier_Letters,
+ CR_In_Combining_Diacritical_Marks,
+ CR_In_Greek_and_Coptic,
+ CR_In_Cyrillic,
+ CR_In_Cyrillic_Supplement,
+ CR_In_Armenian,
+ CR_In_Hebrew,
+ CR_In_Arabic,
+ CR_In_Syriac,
+ CR_In_Arabic_Supplement,
+ CR_In_Thaana,
+ CR_In_NKo,
+ CR_In_Samaritan,
+ CR_In_Mandaic,
+ CR_In_Arabic_Extended_A,
+ CR_In_Devanagari,
+ CR_In_Bengali,
+ CR_In_Gurmukhi,
+ CR_In_Gujarati,
+ CR_In_Oriya,
+ CR_In_Tamil,
+ CR_In_Telugu,
+ CR_In_Kannada,
+ CR_In_Malayalam,
+ CR_In_Sinhala,
+ CR_In_Thai,
+ CR_In_Lao,
+ CR_In_Tibetan,
+ CR_In_Myanmar,
+ CR_In_Georgian,
+ CR_In_Hangul_Jamo,
+ CR_In_Ethiopic,
+ CR_In_Ethiopic_Supplement,
+ CR_In_Cherokee,
+ CR_In_Unified_Canadian_Aboriginal_Syllabics,
+ CR_In_Ogham,
+ CR_In_Runic,
+ CR_In_Tagalog,
+ CR_In_Hanunoo,
+ CR_In_Buhid,
+ CR_In_Tagbanwa,
+ CR_In_Khmer,
+ CR_In_Mongolian,
+ CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended,
+ CR_In_Limbu,
+ CR_In_Tai_Le,
+ CR_In_New_Tai_Lue,
+ CR_In_Khmer_Symbols,
+ CR_In_Buginese,
+ CR_In_Tai_Tham,
+ CR_In_Balinese,
+ CR_In_Sundanese,
+ CR_In_Batak,
+ CR_In_Lepcha,
+ CR_In_Ol_Chiki,
+ CR_In_Sundanese_Supplement,
+ CR_In_Vedic_Extensions,
+ CR_In_Phonetic_Extensions,
+ CR_In_Phonetic_Extensions_Supplement,
+ CR_In_Combining_Diacritical_Marks_Supplement,
+ CR_In_Latin_Extended_Additional,
+ CR_In_Greek_Extended,
+ CR_In_General_Punctuation,
+ CR_In_Superscripts_and_Subscripts,
+ CR_In_Currency_Symbols,
+ CR_In_Combining_Diacritical_Marks_for_Symbols,
+ CR_In_Letterlike_Symbols,
+ CR_In_Number_Forms,
+ CR_In_Arrows,
+ CR_In_Mathematical_Operators,
+ CR_In_Miscellaneous_Technical,
+ CR_In_Control_Pictures,
+ CR_In_Optical_Character_Recognition,
+ CR_In_Enclosed_Alphanumerics,
+ CR_In_Box_Drawing,
+ CR_In_Block_Elements,
+ CR_In_Geometric_Shapes,
+ CR_In_Miscellaneous_Symbols,
+ CR_In_Dingbats,
+ CR_In_Miscellaneous_Mathematical_Symbols_A,
+ CR_In_Supplemental_Arrows_A,
+ CR_In_Braille_Patterns,
+ CR_In_Supplemental_Arrows_B,
+ CR_In_Miscellaneous_Mathematical_Symbols_B,
+ CR_In_Supplemental_Mathematical_Operators,
+ CR_In_Miscellaneous_Symbols_and_Arrows,
+ CR_In_Glagolitic,
+ CR_In_Latin_Extended_C,
+ CR_In_Coptic,
+ CR_In_Georgian_Supplement,
+ CR_In_Tifinagh,
+ CR_In_Ethiopic_Extended,
+ CR_In_Cyrillic_Extended_A,
+ CR_In_Supplemental_Punctuation,
+ CR_In_CJK_Radicals_Supplement,
+ CR_In_Kangxi_Radicals,
+ CR_In_Ideographic_Description_Characters,
+ CR_In_CJK_Symbols_and_Punctuation,
+ CR_In_Hiragana,
+ CR_In_Katakana,
+ CR_In_Bopomofo,
+ CR_In_Hangul_Compatibility_Jamo,
+ CR_In_Kanbun,
+ CR_In_Bopomofo_Extended,
+ CR_In_CJK_Strokes,
+ CR_In_Katakana_Phonetic_Extensions,
+ CR_In_Enclosed_CJK_Letters_and_Months,
+ CR_In_CJK_Compatibility,
+ CR_In_CJK_Unified_Ideographs_Extension_A,
+ CR_In_Yijing_Hexagram_Symbols,
+ CR_In_CJK_Unified_Ideographs,
+ CR_In_Yi_Syllables,
+ CR_In_Yi_Radicals,
+ CR_In_Lisu,
+ CR_In_Vai,
+ CR_In_Cyrillic_Extended_B,
+ CR_In_Bamum,
+ CR_In_Modifier_Tone_Letters,
+ CR_In_Latin_Extended_D,
+ CR_In_Syloti_Nagri,
+ CR_In_Common_Indic_Number_Forms,
+ CR_In_Phags_pa,
+ CR_In_Saurashtra,
+ CR_In_Devanagari_Extended,
+ CR_In_Kayah_Li,
+ CR_In_Rejang,
+ CR_In_Hangul_Jamo_Extended_A,
+ CR_In_Javanese,
+ CR_In_Cham,
+ CR_In_Myanmar_Extended_A,
+ CR_In_Tai_Viet,
+ CR_In_Meetei_Mayek_Extensions,
+ CR_In_Ethiopic_Extended_A,
+ CR_In_Meetei_Mayek,
+ CR_In_Hangul_Syllables,
+ CR_In_Hangul_Jamo_Extended_B,
+ CR_In_High_Surrogates,
+ CR_In_High_Private_Use_Surrogates,
+ CR_In_Low_Surrogates,
+ CR_In_Private_Use_Area,
+ CR_In_CJK_Compatibility_Ideographs,
+ CR_In_Alphabetic_Presentation_Forms,
+ CR_In_Arabic_Presentation_Forms_A,
+ CR_In_Variation_Selectors,
+ CR_In_Vertical_Forms,
+ CR_In_Combining_Half_Marks,
+ CR_In_CJK_Compatibility_Forms,
+ CR_In_Small_Form_Variants,
+ CR_In_Arabic_Presentation_Forms_B,
+ CR_In_Halfwidth_and_Fullwidth_Forms,
+ CR_In_Specials,
+ CR_In_Linear_B_Syllabary,
+ CR_In_Linear_B_Ideograms,
+ CR_In_Aegean_Numbers,
+ CR_In_Ancient_Greek_Numbers,
+ CR_In_Ancient_Symbols,
+ CR_In_Phaistos_Disc,
+ CR_In_Lycian,
+ CR_In_Carian,
+ CR_In_Old_Italic,
+ CR_In_Gothic,
+ CR_In_Ugaritic,
+ CR_In_Old_Persian,
+ CR_In_Deseret,
+ CR_In_Shavian,
+ CR_In_Osmanya,
+ CR_In_Cypriot_Syllabary,
+ CR_In_Imperial_Aramaic,
+ CR_In_Phoenician,
+ CR_In_Lydian,
+ CR_In_Meroitic_Hieroglyphs,
+ CR_In_Meroitic_Cursive,
+ CR_In_Kharoshthi,
+ CR_In_Old_South_Arabian,
+ CR_In_Avestan,
+ CR_In_Inscriptional_Parthian,
+ CR_In_Inscriptional_Pahlavi,
+ CR_In_Old_Turkic,
+ CR_In_Rumi_Numeral_Symbols,
+ CR_In_Brahmi,
+ CR_In_Kaithi,
+ CR_In_Sora_Sompeng,
+ CR_In_Chakma,
+ CR_In_Sharada,
+ CR_In_Takri,
+ CR_In_Cuneiform,
+ CR_In_Cuneiform_Numbers_and_Punctuation,
+ CR_In_Egyptian_Hieroglyphs,
+ CR_In_Bamum_Supplement,
+ CR_In_Miao,
+ CR_In_Kana_Supplement,
+ CR_In_Byzantine_Musical_Symbols,
+ CR_In_Musical_Symbols,
+ CR_In_Ancient_Greek_Musical_Notation,
+ CR_In_Tai_Xuan_Jing_Symbols,
+ CR_In_Counting_Rod_Numerals,
+ CR_In_Mathematical_Alphanumeric_Symbols,
+ CR_In_Arabic_Mathematical_Alphabetic_Symbols,
+ CR_In_Mahjong_Tiles,
+ CR_In_Domino_Tiles,
+ CR_In_Playing_Cards,
+ CR_In_Enclosed_Alphanumeric_Supplement,
+ CR_In_Enclosed_Ideographic_Supplement,
+ CR_In_Miscellaneous_Symbols_And_Pictographs,
+ CR_In_Emoticons,
+ CR_In_Transport_And_Map_Symbols,
+ CR_In_Alchemical_Symbols,
+ CR_In_CJK_Unified_Ideographs_Extension_B,
+ CR_In_CJK_Unified_Ideographs_Extension_C,
+ CR_In_CJK_Unified_Ideographs_Extension_D,
+ CR_In_CJK_Compatibility_Ideographs_Supplement,
+ CR_In_Tags,
+ CR_In_Variation_Selectors_Supplement,
+ CR_In_Supplementary_Private_Use_Area_A,
+ CR_In_Supplementary_Private_Use_Area_B,
+ CR_In_No_Block,
#endif /* USE_UNICODE_PROPERTIES */
};
struct uniname2ctype_struct {
@@ -22182,19 +25947,19 @@ struct uniname2ctype_struct {
static const struct uniname2ctype_struct *uniname2ctype_p(const char *, unsigned int);
#ifndef USE_UNICODE_PROPERTIES
-#define TOTAL_KEYWORDS 15
+#define TOTAL_KEYWORDS 14
#define MIN_WORD_LENGTH 4
-#define MAX_WORD_LENGTH 7
-#define MIN_HASH_VALUE 7
-#define MAX_HASH_VALUE 21
-/* maximum key range = 15, duplicates = 0 */
+#define MAX_WORD_LENGTH 6
+#define MIN_HASH_VALUE 6
+#define MAX_HASH_VALUE 19
+/* maximum key range = 14, duplicates = 0 */
#else /* USE_UNICODE_PROPERTIES */
-#define TOTAL_KEYWORDS 387
+#define TOTAL_KEYWORDS 625
#define MIN_WORD_LENGTH 1
-#define MAX_WORD_LENGTH 30
+#define MAX_WORD_LENGTH 44
#define MIN_HASH_VALUE 3
-#define MAX_HASH_VALUE 1741
-/* maximum key range = 1739, duplicates = 0 */
+#define MAX_HASH_VALUE 4167
+/* maximum key range = 4165, duplicates = 0 */
#endif /* USE_UNICODE_PROPERTIES */
#ifdef __GNUC__
@@ -22216,33 +25981,33 @@ uniname2ctype_hash (str, len)
#endif /* USE_UNICODE_PROPERTIES */
{
#ifndef USE_UNICODE_PROPERTIES
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 3, 13, 6,
- 4, 22, 22, 11, 22, 1, 22, 22, 10, 22,
- 2, 22, 1, 22, 10, 8, 4, 7, 22, 3,
- 4, 22, 22, 22, 22, 22, 22, 22
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 3, 11, 5,
+ 4, 20, 20, 9, 20, 1, 20, 20, 10, 20,
+ 2, 20, 1, 20, 1, 7, 4, 6, 20, 1,
+ 4, 20, 20, 20, 20, 20, 20, 20
#else /* USE_UNICODE_PROPERTIES */
- 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742,
- 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742,
- 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742,
- 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742,
- 1742, 1742, 1742, 1742, 1742, 1742, 2, 1742, 9, 1,
- 2, 18, 5, 3, 4, 1742, 1742, 1742, 1742, 1742,
- 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742,
- 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742,
- 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742,
- 1742, 1742, 1742, 1742, 1742, 1742, 1742, 8, 280, 6,
- 96, 67, 362, 294, 38, 9, 63, 517, 2, 213,
- 1, 4, 192, 3, 10, 57, 31, 316, 1, 549,
- 330, 567, 36, 1742, 1742, 1742, 1742, 1742
+ 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168,
+ 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168,
+ 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168,
+ 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168,
+ 4168, 4168, 4168, 4168, 4168, 4168, 1, 4168, 13, 1,
+ 3, 28, 31, 10, 27, 4168, 4168, 4168, 4168, 4168,
+ 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168,
+ 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168,
+ 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168,
+ 4168, 4168, 4168, 4168, 4168, 4168, 4168, 13, 854, 14,
+ 443, 19, 7, 570, 335, 4, 66, 1159, 102, 34,
+ 1, 178, 474, 1, 192, 2, 64, 1117, 491, 264,
+ 256, 1305, 3, 4168, 4168, 4168, 4168, 4168
#endif /* USE_UNICODE_PROPERTIES */
};
#ifndef USE_UNICODE_PROPERTIES
@@ -22290,823 +26055,1298 @@ uniname2ctype_hash (str, len)
struct uniname2ctype_pool_t
{
#ifndef USE_UNICODE_PROPERTIES
+ char uniname2ctype_pool_str6[sizeof("word")];
char uniname2ctype_pool_str7[sizeof("print")];
char uniname2ctype_pool_str8[sizeof("punct")];
char uniname2ctype_pool_str9[sizeof("alpha")];
char uniname2ctype_pool_str10[sizeof("alnum")];
char uniname2ctype_pool_str11[sizeof("xdigit")];
- char uniname2ctype_pool_str12[sizeof("newline")];
- char uniname2ctype_pool_str13[sizeof("upper")];
- char uniname2ctype_pool_str14[sizeof("ascii")];
- char uniname2ctype_pool_str15[sizeof("cntrl")];
- char uniname2ctype_pool_str16[sizeof("space")];
- char uniname2ctype_pool_str17[sizeof("word")];
- char uniname2ctype_pool_str18[sizeof("lower")];
- char uniname2ctype_pool_str19[sizeof("graph")];
- char uniname2ctype_pool_str20[sizeof("digit")];
- char uniname2ctype_pool_str21[sizeof("blank")];
+ char uniname2ctype_pool_str12[sizeof("upper")];
+ char uniname2ctype_pool_str13[sizeof("ascii")];
+ char uniname2ctype_pool_str14[sizeof("cntrl")];
+ char uniname2ctype_pool_str15[sizeof("space")];
+ char uniname2ctype_pool_str16[sizeof("lower")];
+ char uniname2ctype_pool_str17[sizeof("graph")];
+ char uniname2ctype_pool_str18[sizeof("digit")];
+ char uniname2ctype_pool_str19[sizeof("blank")];
#else /* USE_UNICODE_PROPERTIES */
char uniname2ctype_pool_str3[sizeof("n")];
- char uniname2ctype_pool_str5[sizeof("l")];
- char uniname2ctype_pool_str7[sizeof("nl")];
- char uniname2ctype_pool_str8[sizeof("ll")];
- char uniname2ctype_pool_str10[sizeof("cn")];
- char uniname2ctype_pool_str11[sizeof("no")];
- char uniname2ctype_pool_str12[sizeof("lo")];
- char uniname2ctype_pool_str13[sizeof("c")];
- char uniname2ctype_pool_str16[sizeof("co")];
- char uniname2ctype_pool_str20[sizeof("cc")];
- char uniname2ctype_pool_str21[sizeof("lao")];
- char uniname2ctype_pool_str22[sizeof("laoo")];
- char uniname2ctype_pool_str23[sizeof("lana")];
- char uniname2ctype_pool_str26[sizeof("ci")];
- char uniname2ctype_pool_str29[sizeof("qaac")];
- char uniname2ctype_pool_str30[sizeof("vai")];
- char uniname2ctype_pool_str31[sizeof("vaii")];
- char uniname2ctype_pool_str32[sizeof("qaai")];
- char uniname2ctype_pool_str34[sizeof("control")];
- char uniname2ctype_pool_str37[sizeof("cari")];
- char uniname2ctype_pool_str40[sizeof("carian")];
- char uniname2ctype_pool_str42[sizeof("zl")];
- char uniname2ctype_pool_str44[sizeof("oriya")];
- char uniname2ctype_pool_str46[sizeof("latn")];
- char uniname2ctype_pool_str47[sizeof("cntrl")];
- char uniname2ctype_pool_str48[sizeof("latin")];
- char uniname2ctype_pool_str51[sizeof("han")];
- char uniname2ctype_pool_str53[sizeof("arabic")];
- char uniname2ctype_pool_str54[sizeof("ital")];
- char uniname2ctype_pool_str55[sizeof("hano")];
- char uniname2ctype_pool_str60[sizeof("hani")];
- char uniname2ctype_pool_str63[sizeof("hanunoo")];
- char uniname2ctype_pool_str66[sizeof("lt")];
- char uniname2ctype_pool_str67[sizeof("so")];
- char uniname2ctype_pool_str69[sizeof("hira")];
- char uniname2ctype_pool_str70[sizeof("nchar")];
- char uniname2ctype_pool_str71[sizeof("sc")];
- char uniname2ctype_pool_str73[sizeof("z")];
- char uniname2ctype_pool_str74[sizeof("oalpha")];
- char uniname2ctype_pool_str75[sizeof("tavt")];
- char uniname2ctype_pool_str76[sizeof("cans")];
- char uniname2ctype_pool_str84[sizeof("java")];
- char uniname2ctype_pool_str88[sizeof("zinh")];
- char uniname2ctype_pool_str89[sizeof("thaa")];
- char uniname2ctype_pool_str90[sizeof("thai")];
- char uniname2ctype_pool_str91[sizeof("variationselector")];
- char uniname2ctype_pool_str92[sizeof("sinhala")];
- char uniname2ctype_pool_str93[sizeof("joinc")];
- char uniname2ctype_pool_str94[sizeof("ascii")];
- char uniname2ctype_pool_str95[sizeof("initialpunctuation")];
- char uniname2ctype_pool_str98[sizeof("other")];
- char uniname2ctype_pool_str99[sizeof("joincontrol")];
- char uniname2ctype_pool_str100[sizeof("thaana")];
- char uniname2ctype_pool_str101[sizeof("avst")];
- char uniname2ctype_pool_str103[sizeof("olower")];
- char uniname2ctype_pool_str105[sizeof("othernumber")];
- char uniname2ctype_pool_str106[sizeof("otherletter")];
- char uniname2ctype_pool_str109[sizeof("sinh")];
- char uniname2ctype_pool_str112[sizeof("tale")];
- char uniname2ctype_pool_str114[sizeof("connectorpunctuation")];
- char uniname2ctype_pool_str115[sizeof("s")];
- char uniname2ctype_pool_str116[sizeof("di")];
- char uniname2ctype_pool_str117[sizeof("vs")];
- char uniname2ctype_pool_str119[sizeof("oidc")];
- char uniname2ctype_pool_str120[sizeof("idc")];
- char uniname2ctype_pool_str121[sizeof("odi")];
- char uniname2ctype_pool_str122[sizeof("cs")];
- char uniname2ctype_pool_str123[sizeof("avestan")];
- char uniname2ctype_pool_str124[sizeof("dia")];
- char uniname2ctype_pool_str125[sizeof("cher")];
- char uniname2ctype_pool_str126[sizeof("inscriptionalparthian")];
- char uniname2ctype_pool_str128[sizeof("shavian")];
- char uniname2ctype_pool_str137[sizeof("radical")];
- char uniname2ctype_pool_str143[sizeof("loe")];
- char uniname2ctype_pool_str147[sizeof("diacritic")];
- char uniname2ctype_pool_str148[sizeof("zzzz")];
- char uniname2ctype_pool_str149[sizeof("ethi")];
- char uniname2ctype_pool_str151[sizeof("canadianaboriginal")];
- char uniname2ctype_pool_str152[sizeof("zs")];
- char uniname2ctype_pool_str153[sizeof("othersymbol")];
- char uniname2ctype_pool_str156[sizeof("olditalic")];
- char uniname2ctype_pool_str161[sizeof("inscriptionalpahlavi")];
- char uniname2ctype_pool_str162[sizeof("taiviet")];
- char uniname2ctype_pool_str163[sizeof("lineseparator")];
- char uniname2ctype_pool_str166[sizeof("otheridstart")];
- char uniname2ctype_pool_str170[sizeof("oids")];
- char uniname2ctype_pool_str171[sizeof("asciihexdigit")];
- char uniname2ctype_pool_str172[sizeof("inherited")];
- char uniname2ctype_pool_str174[sizeof("otherlowercase")];
- char uniname2ctype_pool_str175[sizeof("terminalpunctuation")];
- char uniname2ctype_pool_str176[sizeof("deva")];
- char uniname2ctype_pool_str179[sizeof("otheralphabetic")];
- char uniname2ctype_pool_str180[sizeof("ideo")];
- char uniname2ctype_pool_str181[sizeof("noncharactercodepoint")];
- char uniname2ctype_pool_str183[sizeof("otheridcontinue")];
- char uniname2ctype_pool_str187[sizeof("taile")];
- char uniname2ctype_pool_str190[sizeof("oldpersian")];
- char uniname2ctype_pool_str192[sizeof("devanagari")];
- char uniname2ctype_pool_str193[sizeof("letter")];
- char uniname2ctype_pool_str195[sizeof("nd")];
- char uniname2ctype_pool_str197[sizeof("idst")];
- char uniname2ctype_pool_str198[sizeof("dsrt")];
- char uniname2ctype_pool_str200[sizeof("titlecaseletter")];
- char uniname2ctype_pool_str202[sizeof("po")];
- char uniname2ctype_pool_str203[sizeof("dash")];
- char uniname2ctype_pool_str206[sizeof("pc")];
- char uniname2ctype_pool_str209[sizeof("letternumber")];
- char uniname2ctype_pool_str212[sizeof("pi")];
- char uniname2ctype_pool_str215[sizeof("javanese")];
- char uniname2ctype_pool_str217[sizeof("mn")];
- char uniname2ctype_pool_str218[sizeof("idstart")];
- char uniname2ctype_pool_str220[sizeof("idcontinue")];
- char uniname2ctype_pool_str222[sizeof("ids")];
- char uniname2ctype_pool_str223[sizeof("alpha")];
- char uniname2ctype_pool_str227[sizeof("mc")];
- char uniname2ctype_pool_str229[sizeof("coptic")];
- char uniname2ctype_pool_str234[sizeof("mongolian")];
- char uniname2ctype_pool_str235[sizeof("common")];
- char uniname2ctype_pool_str236[sizeof("armn")];
- char uniname2ctype_pool_str237[sizeof("copt")];
- char uniname2ctype_pool_str243[sizeof("cprt")];
- char uniname2ctype_pool_str244[sizeof("armi")];
- char uniname2ctype_pool_str245[sizeof("phli")];
- char uniname2ctype_pool_str246[sizeof("prti")];
- char uniname2ctype_pool_str250[sizeof("armenian")];
- char uniname2ctype_pool_str251[sizeof("sd")];
- char uniname2ctype_pool_str252[sizeof("mandaic")];
- char uniname2ctype_pool_str255[sizeof("phoenician")];
- char uniname2ctype_pool_str258[sizeof("taml")];
- char uniname2ctype_pool_str261[sizeof("tamil")];
- char uniname2ctype_pool_str268[sizeof("cased")];
- char uniname2ctype_pool_str269[sizeof("cham")];
- char uniname2ctype_pool_str270[sizeof("idsbinaryoperator")];
- char uniname2ctype_pool_str271[sizeof("lepc")];
- char uniname2ctype_pool_str275[sizeof("otherdefaultignorablecodepoint")];
- char uniname2ctype_pool_str278[sizeof("print")];
- char uniname2ctype_pool_str286[sizeof("osma")];
- char uniname2ctype_pool_str292[sizeof("samr")];
- char uniname2ctype_pool_str294[sizeof("math")];
- char uniname2ctype_pool_str296[sizeof("linb")];
- char uniname2ctype_pool_str297[sizeof("closepunctuation")];
- char uniname2ctype_pool_str301[sizeof("otherpunctuation")];
- char uniname2ctype_pool_str303[sizeof("bali")];
- char uniname2ctype_pool_str306[sizeof("omath")];
- char uniname2ctype_pool_str307[sizeof("samaritan")];
- char uniname2ctype_pool_str308[sizeof("ps")];
- char uniname2ctype_pool_str310[sizeof("arab")];
- char uniname2ctype_pool_str311[sizeof("brai")];
- char uniname2ctype_pool_str314[sizeof("taitham")];
- char uniname2ctype_pool_str317[sizeof("linearb")];
- char uniname2ctype_pool_str321[sizeof("lepcha")];
- char uniname2ctype_pool_str322[sizeof("mand")];
- char uniname2ctype_pool_str324[sizeof("mtei")];
- char uniname2ctype_pool_str325[sizeof("term")];
- char uniname2ctype_pool_str326[sizeof("glagolitic")];
- char uniname2ctype_pool_str327[sizeof("privateuse")];
- char uniname2ctype_pool_str328[sizeof("pe")];
- char uniname2ctype_pool_str335[sizeof("deseret")];
- char uniname2ctype_pool_str340[sizeof("brah")];
- char uniname2ctype_pool_str341[sizeof("runr")];
- char uniname2ctype_pool_str343[sizeof("othermath")];
- char uniname2ctype_pool_str344[sizeof("runic")];
- char uniname2ctype_pool_str345[sizeof("hang")];
- char uniname2ctype_pool_str346[sizeof("ethiopic")];
- char uniname2ctype_pool_str349[sizeof("me")];
- char uniname2ctype_pool_str350[sizeof("patws")];
- char uniname2ctype_pool_str353[sizeof("separator")];
- char uniname2ctype_pool_str355[sizeof("tibt")];
- char uniname2ctype_pool_str356[sizeof("gothic")];
- char uniname2ctype_pool_str358[sizeof("tagbanwa")];
- char uniname2ctype_pool_str359[sizeof("sarb")];
- char uniname2ctype_pool_str361[sizeof("talu")];
- char uniname2ctype_pool_str367[sizeof("tibetan")];
- char uniname2ctype_pool_str371[sizeof("goth")];
- char uniname2ctype_pool_str372[sizeof("rjng")];
- char uniname2ctype_pool_str373[sizeof("hangul")];
- char uniname2ctype_pool_str374[sizeof("bengali")];
- char uniname2ctype_pool_str375[sizeof("hiragana")];
- char uniname2ctype_pool_str376[sizeof("braille")];
- char uniname2ctype_pool_str379[sizeof("geor")];
- char uniname2ctype_pool_str380[sizeof("age=1.1")];
- char uniname2ctype_pool_str381[sizeof("age=2.1")];
- char uniname2ctype_pool_str382[sizeof("age=5.1")];
- char uniname2ctype_pool_str383[sizeof("age=5.2")];
- char uniname2ctype_pool_str384[sizeof("age=4.1")];
- char uniname2ctype_pool_str385[sizeof("p")];
- char uniname2ctype_pool_str386[sizeof("pd")];
- char uniname2ctype_pool_str388[sizeof("lisu")];
- char uniname2ctype_pool_str389[sizeof("age=2.0")];
- char uniname2ctype_pool_str390[sizeof("age=5.0")];
- char uniname2ctype_pool_str391[sizeof("age=6.0")];
- char uniname2ctype_pool_str392[sizeof("age=4.0")];
- char uniname2ctype_pool_str393[sizeof("graph")];
- char uniname2ctype_pool_str395[sizeof("saur")];
- char uniname2ctype_pool_str396[sizeof("space")];
- char uniname2ctype_pool_str397[sizeof("age=3.1")];
- char uniname2ctype_pool_str398[sizeof("age=3.2")];
- char uniname2ctype_pool_str399[sizeof("hebr")];
- char uniname2ctype_pool_str402[sizeof("bidic")];
- char uniname2ctype_pool_str405[sizeof("age=3.0")];
- char uniname2ctype_pool_str408[sizeof("bidicontrol")];
- char uniname2ctype_pool_str413[sizeof("logicalorderexception")];
- char uniname2ctype_pool_str420[sizeof("telu")];
- char uniname2ctype_pool_str422[sizeof("zp")];
- char uniname2ctype_pool_str427[sizeof("m")];
- char uniname2ctype_pool_str430[sizeof("lm")];
- char uniname2ctype_pool_str432[sizeof("idstrinaryoperator")];
- char uniname2ctype_pool_str433[sizeof("balinese")];
- char uniname2ctype_pool_str434[sizeof("uideo")];
- char uniname2ctype_pool_str436[sizeof("spaceseparator")];
- char uniname2ctype_pool_str438[sizeof("grext")];
- char uniname2ctype_pool_str442[sizeof("alnum")];
- char uniname2ctype_pool_str443[sizeof("oldturkic")];
- char uniname2ctype_pool_str445[sizeof("xidc")];
- char uniname2ctype_pool_str446[sizeof("idsb")];
- char uniname2ctype_pool_str447[sizeof("ahex")];
- char uniname2ctype_pool_str452[sizeof("format")];
- char uniname2ctype_pool_str456[sizeof("caseignorable")];
- char uniname2ctype_pool_str457[sizeof("tifinagh")];
- char uniname2ctype_pool_str459[sizeof("sundanese")];
- char uniname2ctype_pool_str462[sizeof("ext")];
- char uniname2ctype_pool_str464[sizeof("saurashtra")];
- char uniname2ctype_pool_str465[sizeof("patternwhitespace")];
- char uniname2ctype_pool_str466[sizeof("digit")];
- char uniname2ctype_pool_str474[sizeof("sund")];
- char uniname2ctype_pool_str480[sizeof("decimalnumber")];
- char uniname2ctype_pool_str484[sizeof("bopo")];
- char uniname2ctype_pool_str485[sizeof("sm")];
- char uniname2ctype_pool_str488[sizeof("otheruppercase")];
- char uniname2ctype_pool_str493[sizeof("ideographic")];
- char uniname2ctype_pool_str496[sizeof("xids")];
- char uniname2ctype_pool_str497[sizeof("unassigned")];
- char uniname2ctype_pool_str502[sizeof("phagspa")];
- char uniname2ctype_pool_str506[sizeof("alphabetic")];
- char uniname2ctype_pool_str508[sizeof("limb")];
- char uniname2ctype_pool_str512[sizeof("xdigit")];
- char uniname2ctype_pool_str513[sizeof("xidstart")];
- char uniname2ctype_pool_str516[sizeof("mong")];
- char uniname2ctype_pool_str518[sizeof("xidcontinue")];
- char uniname2ctype_pool_str521[sizeof("assigned")];
- char uniname2ctype_pool_str523[sizeof("ogam")];
- char uniname2ctype_pool_str529[sizeof("nko")];
- char uniname2ctype_pool_str530[sizeof("nkoo")];
- char uniname2ctype_pool_str533[sizeof("olck")];
- char uniname2ctype_pool_str534[sizeof("deprecated")];
- char uniname2ctype_pool_str535[sizeof("brahmi")];
- char uniname2ctype_pool_str536[sizeof("phag")];
- char uniname2ctype_pool_str538[sizeof("kana")];
- char uniname2ctype_pool_str540[sizeof("kali")];
- char uniname2ctype_pool_str542[sizeof("changeswhenlowercased")];
- char uniname2ctype_pool_str543[sizeof("extender")];
- char uniname2ctype_pool_str550[sizeof("dep")];
- char uniname2ctype_pool_str554[sizeof("olchiki")];
- char uniname2ctype_pool_str562[sizeof("cwl")];
- char uniname2ctype_pool_str563[sizeof("graphemebase")];
- char uniname2ctype_pool_str565[sizeof("phnx")];
- char uniname2ctype_pool_str573[sizeof("orkh")];
- char uniname2ctype_pool_str576[sizeof("punct")];
- char uniname2ctype_pool_str577[sizeof("khar")];
- char uniname2ctype_pool_str580[sizeof("lower")];
- char uniname2ctype_pool_str586[sizeof("sterm")];
- char uniname2ctype_pool_str587[sizeof("yi")];
- char uniname2ctype_pool_str588[sizeof("lyci")];
- char uniname2ctype_pool_str589[sizeof("cyrl")];
- char uniname2ctype_pool_str591[sizeof("lycian")];
- char uniname2ctype_pool_str592[sizeof("finalpunctuation")];
- char uniname2ctype_pool_str593[sizeof("orya")];
- char uniname2ctype_pool_str594[sizeof("graphemeextend")];
- char uniname2ctype_pool_str596[sizeof("kaithi")];
- char uniname2ctype_pool_str597[sizeof("xpeo")];
- char uniname2ctype_pool_str598[sizeof("yiii")];
- char uniname2ctype_pool_str599[sizeof("kthi")];
- char uniname2ctype_pool_str601[sizeof("cyrillic")];
- char uniname2ctype_pool_str602[sizeof("glag")];
- char uniname2ctype_pool_str605[sizeof("oupper")];
- char uniname2ctype_pool_str617[sizeof("tagb")];
- char uniname2ctype_pool_str620[sizeof("cwt")];
- char uniname2ctype_pool_str623[sizeof("number")];
- char uniname2ctype_pool_str625[sizeof("tglg")];
- char uniname2ctype_pool_str626[sizeof("knda")];
- char uniname2ctype_pool_str627[sizeof("lowercaseletter")];
- char uniname2ctype_pool_str628[sizeof("changeswhentitlecased")];
- char uniname2ctype_pool_str629[sizeof("softdotted")];
- char uniname2ctype_pool_str632[sizeof("ugar")];
- char uniname2ctype_pool_str634[sizeof("sylo")];
- char uniname2ctype_pool_str636[sizeof("lu")];
- char uniname2ctype_pool_str640[sizeof("tagalog")];
- char uniname2ctype_pool_str643[sizeof("kharoshthi")];
- char uniname2ctype_pool_str644[sizeof("syrc")];
- char uniname2ctype_pool_str645[sizeof("kannada")];
- char uniname2ctype_pool_str646[sizeof("beng")];
- char uniname2ctype_pool_str647[sizeof("lowercase")];
- char uniname2ctype_pool_str656[sizeof("shaw")];
- char uniname2ctype_pool_str659[sizeof("patternsyntax")];
- char uniname2ctype_pool_str660[sizeof("syriac")];
- char uniname2ctype_pool_str663[sizeof("word")];
- char uniname2ctype_pool_str667[sizeof("imperialaramaic")];
- char uniname2ctype_pool_str672[sizeof("ugaritic")];
- char uniname2ctype_pool_str675[sizeof("enclosingmark")];
- char uniname2ctype_pool_str677[sizeof("georgian")];
- char uniname2ctype_pool_str678[sizeof("lydi")];
- char uniname2ctype_pool_str681[sizeof("lydian")];
- char uniname2ctype_pool_str686[sizeof("sylotinagri")];
- char uniname2ctype_pool_str687[sizeof("gujr")];
- char uniname2ctype_pool_str692[sizeof("tfng")];
- char uniname2ctype_pool_str696[sizeof("currencysymbol")];
- char uniname2ctype_pool_str701[sizeof("newline")];
- char uniname2ctype_pool_str705[sizeof("bopomofo")];
- char uniname2ctype_pool_str706[sizeof("ogrext")];
- char uniname2ctype_pool_str707[sizeof("cherokee")];
- char uniname2ctype_pool_str708[sizeof("gujarati")];
- char uniname2ctype_pool_str710[sizeof("newtailue")];
- char uniname2ctype_pool_str716[sizeof("dashpunctuation")];
- char uniname2ctype_pool_str718[sizeof("oldsoutharabian")];
- char uniname2ctype_pool_str725[sizeof("upper")];
- char uniname2ctype_pool_str732[sizeof("cf")];
- char uniname2ctype_pool_str734[sizeof("buhd")];
- char uniname2ctype_pool_str735[sizeof("rejang")];
- char uniname2ctype_pool_str736[sizeof("othergraphemeextend")];
- char uniname2ctype_pool_str739[sizeof("modifierletter")];
- char uniname2ctype_pool_str745[sizeof("nonspacingmark")];
- char uniname2ctype_pool_str749[sizeof("changeswhencasemapped")];
- char uniname2ctype_pool_str752[sizeof("mark")];
- char uniname2ctype_pool_str757[sizeof("surrogate")];
- char uniname2ctype_pool_str765[sizeof("paragraphseparator")];
- char uniname2ctype_pool_str767[sizeof("ogham")];
- char uniname2ctype_pool_str768[sizeof("hex")];
- char uniname2ctype_pool_str772[sizeof("uppercaseletter")];
- char uniname2ctype_pool_str777[sizeof("hexdigit")];
- char uniname2ctype_pool_str778[sizeof("cwcm")];
- char uniname2ctype_pool_str781[sizeof("grbase")];
- char uniname2ctype_pool_str782[sizeof("khmr")];
- char uniname2ctype_pool_str788[sizeof("unifiedideograph")];
- char uniname2ctype_pool_str792[sizeof("uppercase")];
- char uniname2ctype_pool_str793[sizeof("khmer")];
- char uniname2ctype_pool_str795[sizeof("spacingmark")];
- char uniname2ctype_pool_str797[sizeof("whitespace")];
- char uniname2ctype_pool_str806[sizeof("patsyn")];
- char uniname2ctype_pool_str816[sizeof("cypriot")];
- char uniname2ctype_pool_str818[sizeof("openpunctuation")];
- char uniname2ctype_pool_str821[sizeof("bamu")];
- char uniname2ctype_pool_str831[sizeof("buhid")];
- char uniname2ctype_pool_str840[sizeof("batk")];
- char uniname2ctype_pool_str851[sizeof("symbol")];
- char uniname2ctype_pool_str856[sizeof("changeswhenuppercased")];
- char uniname2ctype_pool_str857[sizeof("osmanya")];
- char uniname2ctype_pool_str861[sizeof("limbu")];
- char uniname2ctype_pool_str868[sizeof("punctuation")];
- char uniname2ctype_pool_str872[sizeof("hyphen")];
- char uniname2ctype_pool_str888[sizeof("mathsymbol")];
- char uniname2ctype_pool_str892[sizeof("grek")];
- char uniname2ctype_pool_str898[sizeof("changeswhencasefolded")];
- char uniname2ctype_pool_str902[sizeof("quotationmark")];
- char uniname2ctype_pool_str903[sizeof("bugi")];
- char uniname2ctype_pool_str916[sizeof("cuneiform")];
- char uniname2ctype_pool_str918[sizeof("pf")];
- char uniname2ctype_pool_str927[sizeof("cwcf")];
- char uniname2ctype_pool_str932[sizeof("bamum")];
- char uniname2ctype_pool_str940[sizeof("guru")];
- char uniname2ctype_pool_str944[sizeof("wspace")];
- char uniname2ctype_pool_str951[sizeof("meeteimayek")];
- char uniname2ctype_pool_str976[sizeof("defaultignorablecodepoint")];
- char uniname2ctype_pool_str980[sizeof("modifiersymbol")];
- char uniname2ctype_pool_str999[sizeof("mlym")];
- char uniname2ctype_pool_str1007[sizeof("mymr")];
- char uniname2ctype_pool_str1020[sizeof("malayalam")];
- char uniname2ctype_pool_str1026[sizeof("myanmar")];
- char uniname2ctype_pool_str1032[sizeof("telugu")];
- char uniname2ctype_pool_str1033[sizeof("buginese")];
- char uniname2ctype_pool_str1037[sizeof("xsux")];
- char uniname2ctype_pool_str1093[sizeof("sk")];
- char uniname2ctype_pool_str1097[sizeof("katakana")];
- char uniname2ctype_pool_str1124[sizeof("egyp")];
- char uniname2ctype_pool_str1146[sizeof("any")];
- char uniname2ctype_pool_str1148[sizeof("kayahli")];
- char uniname2ctype_pool_str1190[sizeof("cwu")];
- char uniname2ctype_pool_str1263[sizeof("qmark")];
- char uniname2ctype_pool_str1329[sizeof("blank")];
- char uniname2ctype_pool_str1347[sizeof("grlink")];
- char uniname2ctype_pool_str1358[sizeof("batak")];
- char uniname2ctype_pool_str1395[sizeof("unknown")];
- char uniname2ctype_pool_str1410[sizeof("greek")];
- char uniname2ctype_pool_str1463[sizeof("graphemelink")];
- char uniname2ctype_pool_str1470[sizeof("gurmukhi")];
- char uniname2ctype_pool_str1556[sizeof("hebrew")];
- char uniname2ctype_pool_str1621[sizeof("egyptianhieroglyphs")];
- char uniname2ctype_pool_str1741[sizeof("zyyy")];
+ char uniname2ctype_pool_str5[sizeof("s")];
+ char uniname2ctype_pool_str7[sizeof("z")];
+ char uniname2ctype_pool_str9[sizeof("zs")];
+ char uniname2ctype_pool_str16[sizeof("zzzz")];
+ char uniname2ctype_pool_str18[sizeof("cn")];
+ char uniname2ctype_pool_str20[sizeof("cs")];
+ char uniname2ctype_pool_str24[sizeof("ci")];
+ char uniname2ctype_pool_str29[sizeof("c")];
+ char uniname2ctype_pool_str30[sizeof("cf")];
+ char uniname2ctype_pool_str32[sizeof("sc")];
+ char uniname2ctype_pool_str34[sizeof("cans")];
+ char uniname2ctype_pool_str35[sizeof("qaai")];
+ char uniname2ctype_pool_str38[sizeof("mn")];
+ char uniname2ctype_pool_str42[sizeof("ascii")];
+ char uniname2ctype_pool_str44[sizeof("cc")];
+ char uniname2ctype_pool_str45[sizeof("qaac")];
+ char uniname2ctype_pool_str49[sizeof("inavestan")];
+ char uniname2ctype_pool_str52[sizeof("inspecials")];
+ char uniname2ctype_pool_str62[sizeof("inipaextensions")];
+ char uniname2ctype_pool_str64[sizeof("mc")];
+ char uniname2ctype_pool_str66[sizeof("insamaritan")];
+ char uniname2ctype_pool_str69[sizeof("m")];
+ char uniname2ctype_pool_str72[sizeof("sm")];
+ char uniname2ctype_pool_str74[sizeof("me")];
+ char uniname2ctype_pool_str82[sizeof("inarmenian")];
+ char uniname2ctype_pool_str84[sizeof("incuneiform")];
+ char uniname2ctype_pool_str86[sizeof("mandaic")];
+ char uniname2ctype_pool_str90[sizeof("inancientsymbols")];
+ char uniname2ctype_pool_str92[sizeof("incuneiformnumbersandpunctuation")];
+ char uniname2ctype_pool_str96[sizeof("inthai")];
+ char uniname2ctype_pool_str99[sizeof("inmusicalsymbols")];
+ char uniname2ctype_pool_str100[sizeof("inmiscellaneoussymbols")];
+ char uniname2ctype_pool_str106[sizeof("incham")];
+ char uniname2ctype_pool_str109[sizeof("inmiscellaneoussymbolsandarrows")];
+ char uniname2ctype_pool_str113[sizeof("initialpunctuation")];
+ char uniname2ctype_pool_str114[sizeof("inmiscellaneoussymbolsandpictographs")];
+ char uniname2ctype_pool_str116[sizeof("inthaana")];
+ char uniname2ctype_pool_str124[sizeof("taile")];
+ char uniname2ctype_pool_str125[sizeof("mtei")];
+ char uniname2ctype_pool_str132[sizeof("lc")];
+ char uniname2ctype_pool_str133[sizeof("lana")];
+ char uniname2ctype_pool_str134[sizeof("inlycian")];
+ char uniname2ctype_pool_str135[sizeof("intransportandmapsymbols")];
+ char uniname2ctype_pool_str136[sizeof("incontrolpictures")];
+ char uniname2ctype_pool_str142[sizeof("sinhala")];
+ char uniname2ctype_pool_str151[sizeof("incommonindicnumberforms")];
+ char uniname2ctype_pool_str156[sizeof("inmiscellaneousmathematicalsymbolsa")];
+ char uniname2ctype_pool_str158[sizeof("sterm")];
+ char uniname2ctype_pool_str167[sizeof("inmyanmarextendeda")];
+ char uniname2ctype_pool_str172[sizeof("lm")];
+ char uniname2ctype_pool_str175[sizeof("taiviet")];
+ char uniname2ctype_pool_str179[sizeof("inlinearbideograms")];
+ char uniname2ctype_pool_str180[sizeof("intaitham")];
+ char uniname2ctype_pool_str184[sizeof("latn")];
+ char uniname2ctype_pool_str186[sizeof("latin")];
+ char uniname2ctype_pool_str187[sizeof("ital")];
+ char uniname2ctype_pool_str189[sizeof("alnum")];
+ char uniname2ctype_pool_str199[sizeof("inmalayalam")];
+ char uniname2ctype_pool_str201[sizeof("intaile")];
+ char uniname2ctype_pool_str202[sizeof("tale")];
+ char uniname2ctype_pool_str205[sizeof("l")];
+ char uniname2ctype_pool_str207[sizeof("nl")];
+ char uniname2ctype_pool_str209[sizeof("zl")];
+ char uniname2ctype_pool_str216[sizeof("intamil")];
+ char uniname2ctype_pool_str217[sizeof("taml")];
+ char uniname2ctype_pool_str218[sizeof("inlatinextendeda")];
+ char uniname2ctype_pool_str220[sizeof("inlatinextendedc")];
+ char uniname2ctype_pool_str223[sizeof("inrunic")];
+ char uniname2ctype_pool_str224[sizeof("incarian")];
+ char uniname2ctype_pool_str225[sizeof("insyriac")];
+ char uniname2ctype_pool_str227[sizeof("cari")];
+ char uniname2ctype_pool_str230[sizeof("inmeeteimayekextensions")];
+ char uniname2ctype_pool_str231[sizeof("osma")];
+ char uniname2ctype_pool_str232[sizeof("lt")];
+ char uniname2ctype_pool_str233[sizeof("miao")];
+ char uniname2ctype_pool_str234[sizeof("insharada")];
+ char uniname2ctype_pool_str239[sizeof("incyrillic")];
+ char uniname2ctype_pool_str240[sizeof("carian")];
+ char uniname2ctype_pool_str244[sizeof("armn")];
+ char uniname2ctype_pool_str245[sizeof("samr")];
+ char uniname2ctype_pool_str247[sizeof("armi")];
+ char uniname2ctype_pool_str248[sizeof("inideographicdescriptioncharacters")];
+ char uniname2ctype_pool_str252[sizeof("inosmanya")];
+ char uniname2ctype_pool_str253[sizeof("armenian")];
+ char uniname2ctype_pool_str254[sizeof("inmyanmar")];
+ char uniname2ctype_pool_str255[sizeof("samaritan")];
+ char uniname2ctype_pool_str256[sizeof("arabic")];
+ char uniname2ctype_pool_str259[sizeof("incherokee")];
+ char uniname2ctype_pool_str261[sizeof("connectorpunctuation")];
+ char uniname2ctype_pool_str263[sizeof("merc")];
+ char uniname2ctype_pool_str264[sizeof("inmiscellaneoustechnical")];
+ char uniname2ctype_pool_str268[sizeof("inenclosedalphanumerics")];
+ char uniname2ctype_pool_str279[sizeof("inemoticons")];
+ char uniname2ctype_pool_str281[sizeof("joinc")];
+ char uniname2ctype_pool_str288[sizeof("cntrl")];
+ char uniname2ctype_pool_str301[sizeof("inenclosedcjklettersandmonths")];
+ char uniname2ctype_pool_str303[sizeof("cwcf")];
+ char uniname2ctype_pool_str304[sizeof("inruminumeralsymbols")];
+ char uniname2ctype_pool_str308[sizeof("ll")];
+ char uniname2ctype_pool_str313[sizeof("term")];
+ char uniname2ctype_pool_str316[sizeof("inlatinextendedadditional")];
+ char uniname2ctype_pool_str320[sizeof("tamil")];
+ char uniname2ctype_pool_str321[sizeof("loe")];
+ char uniname2ctype_pool_str329[sizeof("newtailue")];
+ char uniname2ctype_pool_str330[sizeof("cwcm")];
+ char uniname2ctype_pool_str339[sizeof("inenclosedalphanumericsupplement")];
+ char uniname2ctype_pool_str346[sizeof("sinh")];
+ char uniname2ctype_pool_str347[sizeof("zinh")];
+ char uniname2ctype_pool_str349[sizeof("meroiticcursive")];
+ char uniname2ctype_pool_str353[sizeof("han")];
+ char uniname2ctype_pool_str357[sizeof("hani")];
+ char uniname2ctype_pool_str358[sizeof("inopticalcharacterrecognition")];
+ char uniname2ctype_pool_str359[sizeof("no")];
+ char uniname2ctype_pool_str360[sizeof("so")];
+ char uniname2ctype_pool_str364[sizeof("innewtailue")];
+ char uniname2ctype_pool_str365[sizeof("insinhala")];
+ char uniname2ctype_pool_str367[sizeof("innko")];
+ char uniname2ctype_pool_str372[sizeof("co")];
+ char uniname2ctype_pool_str375[sizeof("shavian")];
+ char uniname2ctype_pool_str378[sizeof("terminalpunctuation")];
+ char uniname2ctype_pool_str386[sizeof("intaixuanjingsymbols")];
+ char uniname2ctype_pool_str387[sizeof("inethiopic")];
+ char uniname2ctype_pool_str389[sizeof("sora")];
+ char uniname2ctype_pool_str398[sizeof("inarrows")];
+ char uniname2ctype_pool_str400[sizeof("cham")];
+ char uniname2ctype_pool_str403[sizeof("inlowsurrogates")];
+ char uniname2ctype_pool_str405[sizeof("oriya")];
+ char uniname2ctype_pool_str406[sizeof("ext")];
+ char uniname2ctype_pool_str409[sizeof("cwt")];
+ char uniname2ctype_pool_str412[sizeof("common")];
+ char uniname2ctype_pool_str414[sizeof("inmiao")];
+ char uniname2ctype_pool_str420[sizeof("thai")];
+ char uniname2ctype_pool_str425[sizeof("intifinagh")];
+ char uniname2ctype_pool_str426[sizeof("ethi")];
+ char uniname2ctype_pool_str427[sizeof("mero")];
+ char uniname2ctype_pool_str428[sizeof("chakma")];
+ char uniname2ctype_pool_str429[sizeof("thaa")];
+ char uniname2ctype_pool_str430[sizeof("inscriptionalparthian")];
+ char uniname2ctype_pool_str432[sizeof("tifinagh")];
+ char uniname2ctype_pool_str436[sizeof("titlecaseletter")];
+ char uniname2ctype_pool_str445[sizeof("thaana")];
+ char uniname2ctype_pool_str449[sizeof("asciihexdigit")];
+ char uniname2ctype_pool_str450[sizeof("math")];
+ char uniname2ctype_pool_str453[sizeof("di")];
+ char uniname2ctype_pool_str454[sizeof("ids")];
+ char uniname2ctype_pool_str460[sizeof("lo")];
+ char uniname2ctype_pool_str468[sizeof("inlao")];
+ char uniname2ctype_pool_str470[sizeof("taitham")];
+ char uniname2ctype_pool_str474[sizeof("lao")];
+ char uniname2ctype_pool_str475[sizeof("laoo")];
+ char uniname2ctype_pool_str476[sizeof("dia")];
+ char uniname2ctype_pool_str478[sizeof("idc")];
+ char uniname2ctype_pool_str480[sizeof("ps")];
+ char uniname2ctype_pool_str481[sizeof("insundanese")];
+ char uniname2ctype_pool_str484[sizeof("pi")];
+ char uniname2ctype_pool_str485[sizeof("cwl")];
+ char uniname2ctype_pool_str490[sizeof("pf")];
+ char uniname2ctype_pool_str495[sizeof("mand")];
+ char uniname2ctype_pool_str496[sizeof("insylotinagri")];
+ char uniname2ctype_pool_str497[sizeof("vs")];
+ char uniname2ctype_pool_str503[sizeof("mongolian")];
+ char uniname2ctype_pool_str504[sizeof("pc")];
+ char uniname2ctype_pool_str506[sizeof("inmandaic")];
+ char uniname2ctype_pool_str509[sizeof("invai")];
+ char uniname2ctype_pool_str511[sizeof("lineseparator")];
+ char uniname2ctype_pool_str514[sizeof("pe")];
+ char uniname2ctype_pool_str515[sizeof("vai")];
+ char uniname2ctype_pool_str516[sizeof("vaii")];
+ char uniname2ctype_pool_str517[sizeof("idst")];
+ char uniname2ctype_pool_str520[sizeof("indominotiles")];
+ char uniname2ctype_pool_str521[sizeof("inshavian")];
+ char uniname2ctype_pool_str522[sizeof("inspacingmodifierletters")];
+ char uniname2ctype_pool_str524[sizeof("format")];
+ char uniname2ctype_pool_str528[sizeof("inphaistosdisc")];
+ char uniname2ctype_pool_str531[sizeof("hano")];
+ char uniname2ctype_pool_str532[sizeof("space")];
+ char uniname2ctype_pool_str542[sizeof("indeseret")];
+ char uniname2ctype_pool_str545[sizeof("inolchiki")];
+ char uniname2ctype_pool_str548[sizeof("hira")];
+ char uniname2ctype_pool_str553[sizeof("joincontrol")];
+ char uniname2ctype_pool_str555[sizeof("idcontinue")];
+ char uniname2ctype_pool_str558[sizeof("inmahjongtiles")];
+ char uniname2ctype_pool_str560[sizeof("patws")];
+ char uniname2ctype_pool_str563[sizeof("inlydian")];
+ char uniname2ctype_pool_str564[sizeof("cher")];
+ char uniname2ctype_pool_str568[sizeof("inhiragana")];
+ char uniname2ctype_pool_str572[sizeof("inogham")];
+ char uniname2ctype_pool_str574[sizeof("avst")];
+ char uniname2ctype_pool_str575[sizeof("inscriptionalpahlavi")];
+ char uniname2ctype_pool_str579[sizeof("incoptic")];
+ char uniname2ctype_pool_str587[sizeof("java")];
+ char uniname2ctype_pool_str589[sizeof("inmathematicalalphanumericsymbols")];
+ char uniname2ctype_pool_str594[sizeof("letter")];
+ char uniname2ctype_pool_str604[sizeof("injavanese")];
+ char uniname2ctype_pool_str608[sizeof("avestan")];
+ char uniname2ctype_pool_str612[sizeof("age=1.1")];
+ char uniname2ctype_pool_str613[sizeof("lepc")];
+ char uniname2ctype_pool_str614[sizeof("age=2.1")];
+ char uniname2ctype_pool_str616[sizeof("inlepcha")];
+ char uniname2ctype_pool_str617[sizeof("javanese")];
+ char uniname2ctype_pool_str618[sizeof("shaw")];
+ char uniname2ctype_pool_str619[sizeof("finalpunctuation")];
+ char uniname2ctype_pool_str620[sizeof("alpha")];
+ char uniname2ctype_pool_str621[sizeof("age=5.1")];
+ char uniname2ctype_pool_str622[sizeof("inmongolian")];
+ char uniname2ctype_pool_str623[sizeof("age=5.2")];
+ char uniname2ctype_pool_str626[sizeof("age=2.0")];
+ char uniname2ctype_pool_str627[sizeof("ahex")];
+ char uniname2ctype_pool_str630[sizeof("ingeneralpunctuation")];
+ char uniname2ctype_pool_str631[sizeof("oids")];
+ char uniname2ctype_pool_str632[sizeof("odi")];
+ char uniname2ctype_pool_str633[sizeof("age=5.0")];
+ char uniname2ctype_pool_str636[sizeof("tavt")];
+ char uniname2ctype_pool_str637[sizeof("intaiviet")];
+ char uniname2ctype_pool_str638[sizeof("age=6.1")];
+ char uniname2ctype_pool_str639[sizeof("age=3.1")];
+ char uniname2ctype_pool_str640[sizeof("insundanesesupplement")];
+ char uniname2ctype_pool_str641[sizeof("age=3.2")];
+ char uniname2ctype_pool_str642[sizeof("age=4.1")];
+ char uniname2ctype_pool_str643[sizeof("oidc")];
+ char uniname2ctype_pool_str646[sizeof("tfng")];
+ char uniname2ctype_pool_str647[sizeof("insmallformvariants")];
+ char uniname2ctype_pool_str648[sizeof("ideo")];
+ char uniname2ctype_pool_str649[sizeof("intags")];
+ char uniname2ctype_pool_str650[sizeof("age=6.0")];
+ char uniname2ctype_pool_str651[sizeof("age=3.0")];
+ char uniname2ctype_pool_str653[sizeof("whitespace")];
+ char uniname2ctype_pool_str654[sizeof("age=4.0")];
+ char uniname2ctype_pool_str655[sizeof("inolditalic")];
+ char uniname2ctype_pool_str660[sizeof("oalpha")];
+ char uniname2ctype_pool_str668[sizeof("ingujarati")];
+ char uniname2ctype_pool_str672[sizeof("control")];
+ char uniname2ctype_pool_str679[sizeof("diacritic")];
+ char uniname2ctype_pool_str682[sizeof("tagbanwa")];
+ char uniname2ctype_pool_str690[sizeof("inphoenician")];
+ char uniname2ctype_pool_str701[sizeof("ininscriptionalparthian")];
+ char uniname2ctype_pool_str703[sizeof("ininscriptionalpahlavi")];
+ char uniname2ctype_pool_str704[sizeof("coptic")];
+ char uniname2ctype_pool_str705[sizeof("dsrt")];
+ char uniname2ctype_pool_str706[sizeof("inmodifiertoneletters")];
+ char uniname2ctype_pool_str709[sizeof("xids")];
+ char uniname2ctype_pool_str713[sizeof("hanunoo")];
+ char uniname2ctype_pool_str715[sizeof("inoldturkic")];
+ char uniname2ctype_pool_str721[sizeof("xidc")];
+ char uniname2ctype_pool_str725[sizeof("idstart")];
+ char uniname2ctype_pool_str729[sizeof("inimperialaramaic")];
+ char uniname2ctype_pool_str730[sizeof("invariationselectors")];
+ char uniname2ctype_pool_str734[sizeof("copt")];
+ char uniname2ctype_pool_str737[sizeof("caseignorable")];
+ char uniname2ctype_pool_str738[sizeof("prti")];
+ char uniname2ctype_pool_str739[sizeof("nchar")];
+ char uniname2ctype_pool_str746[sizeof("deseret")];
+ char uniname2ctype_pool_str747[sizeof("decimalnumber")];
+ char uniname2ctype_pool_str748[sizeof("cprt")];
+ char uniname2ctype_pool_str750[sizeof("inlatin1supplement")];
+ char uniname2ctype_pool_str771[sizeof("imperialaramaic")];
+ char uniname2ctype_pool_str776[sizeof("privateuse")];
+ char uniname2ctype_pool_str777[sizeof("casedletter")];
+ char uniname2ctype_pool_str778[sizeof("lowercase")];
+ char uniname2ctype_pool_str780[sizeof("spaceseparator")];
+ char uniname2ctype_pool_str784[sizeof("radical")];
+ char uniname2ctype_pool_str787[sizeof("mong")];
+ char uniname2ctype_pool_str788[sizeof("canadianaboriginal")];
+ char uniname2ctype_pool_str792[sizeof("letternumber")];
+ char uniname2ctype_pool_str796[sizeof("insorasompeng")];
+ char uniname2ctype_pool_str797[sizeof("dash")];
+ char uniname2ctype_pool_str798[sizeof("wspace")];
+ char uniname2ctype_pool_str799[sizeof("ogam")];
+ char uniname2ctype_pool_str802[sizeof("invariationselectorssupplement")];
+ char uniname2ctype_pool_str803[sizeof("print")];
+ char uniname2ctype_pool_str811[sizeof("otheridcontinue")];
+ char uniname2ctype_pool_str815[sizeof("ingurmukhi")];
+ char uniname2ctype_pool_str818[sizeof("closepunctuation")];
+ char uniname2ctype_pool_str823[sizeof("olditalic")];
+ char uniname2ctype_pool_str824[sizeof("noncharactercodepoint")];
+ char uniname2ctype_pool_str826[sizeof("sharada")];
+ char uniname2ctype_pool_str827[sizeof("ingeometricshapes")];
+ char uniname2ctype_pool_str830[sizeof("otheralphabetic")];
+ char uniname2ctype_pool_str831[sizeof("patternwhitespace")];
+ char uniname2ctype_pool_str832[sizeof("po")];
+ char uniname2ctype_pool_str833[sizeof("rjng")];
+ char uniname2ctype_pool_str835[sizeof("ingreekandcoptic")];
+ char uniname2ctype_pool_str841[sizeof("xdigit")];
+ char uniname2ctype_pool_str850[sizeof("gothic")];
+ char uniname2ctype_pool_str851[sizeof("inoldsoutharabian")];
+ char uniname2ctype_pool_str852[sizeof("xidstart")];
+ char uniname2ctype_pool_str854[sizeof("inrejang")];
+ char uniname2ctype_pool_str860[sizeof("idsbinaryoperator")];
+ char uniname2ctype_pool_str867[sizeof("olower")];
+ char uniname2ctype_pool_str869[sizeof("hex")];
+ char uniname2ctype_pool_str870[sizeof("inenclosedideographicsupplement")];
+ char uniname2ctype_pool_str874[sizeof("inalphabeticpresentationforms")];
+ char uniname2ctype_pool_str879[sizeof("inbasiclatin")];
+ char uniname2ctype_pool_str884[sizeof("othersymbol")];
+ char uniname2ctype_pool_str889[sizeof("nd")];
+ char uniname2ctype_pool_str890[sizeof("sd")];
+ char uniname2ctype_pool_str900[sizeof("omath")];
+ char uniname2ctype_pool_str901[sizeof("separator")];
+ char uniname2ctype_pool_str907[sizeof("inarabic")];
+ char uniname2ctype_pool_str912[sizeof("xidcontinue")];
+ char uniname2ctype_pool_str913[sizeof("otheridstart")];
+ char uniname2ctype_pool_str914[sizeof("grext")];
+ char uniname2ctype_pool_str917[sizeof("otherlowercase")];
+ char uniname2ctype_pool_str919[sizeof("phli")];
+ char uniname2ctype_pool_str920[sizeof("cased")];
+ char uniname2ctype_pool_str923[sizeof("hang")];
+ char uniname2ctype_pool_str931[sizeof("xpeo")];
+ char uniname2ctype_pool_str933[sizeof("lower")];
+ char uniname2ctype_pool_str936[sizeof("modifierletter")];
+ char uniname2ctype_pool_str938[sizeof("inphoneticextensions")];
+ char uniname2ctype_pool_str939[sizeof("inarabicpresentationformsa")];
+ char uniname2ctype_pool_str943[sizeof("innumberforms")];
+ char uniname2ctype_pool_str945[sizeof("oldpersian")];
+ char uniname2ctype_pool_str946[sizeof("incyrillicextendeda")];
+ char uniname2ctype_pool_str947[sizeof("inverticalforms")];
+ char uniname2ctype_pool_str949[sizeof("p")];
+ char uniname2ctype_pool_str950[sizeof("inbyzantinemusicalsymbols")];
+ char uniname2ctype_pool_str951[sizeof("inmathematicaloperators")];
+ char uniname2ctype_pool_str952[sizeof("intibetan")];
+ char uniname2ctype_pool_str953[sizeof("zp")];
+ char uniname2ctype_pool_str956[sizeof("ingeorgian")];
+ char uniname2ctype_pool_str960[sizeof("inbraillepatterns")];
+ char uniname2ctype_pool_str962[sizeof("lepcha")];
+ char uniname2ctype_pool_str963[sizeof("geor")];
+ char uniname2ctype_pool_str964[sizeof("invedicextensions")];
+ char uniname2ctype_pool_str965[sizeof("linb")];
+ char uniname2ctype_pool_str966[sizeof("other")];
+ char uniname2ctype_pool_str970[sizeof("deva")];
+ char uniname2ctype_pool_str972[sizeof("indevanagari")];
+ char uniname2ctype_pool_str973[sizeof("othernumber")];
+ char uniname2ctype_pool_str974[sizeof("bamum")];
+ char uniname2ctype_pool_str976[sizeof("shrd")];
+ char uniname2ctype_pool_str977[sizeof("bali")];
+ char uniname2ctype_pool_str981[sizeof("devanagari")];
+ char uniname2ctype_pool_str983[sizeof("extender")];
+ char uniname2ctype_pool_str988[sizeof("inherited")];
+ char uniname2ctype_pool_str989[sizeof("glagolitic")];
+ char uniname2ctype_pool_str990[sizeof("tibt")];
+ char uniname2ctype_pool_str994[sizeof("inbalinese")];
+ char uniname2ctype_pool_str996[sizeof("ingothic")];
+ char uniname2ctype_pool_str997[sizeof("inmiscellaneousmathematicalsymbolsb")];
+ char uniname2ctype_pool_str998[sizeof("limb")];
+ char uniname2ctype_pool_str1000[sizeof("bengali")];
+ char uniname2ctype_pool_str1003[sizeof("phoenician")];
+ char uniname2ctype_pool_str1004[sizeof("insuperscriptsandsubscripts")];
+ char uniname2ctype_pool_str1006[sizeof("inmeroitichieroglyphs")];
+ char uniname2ctype_pool_str1007[sizeof("tibetan")];
+ char uniname2ctype_pool_str1010[sizeof("inphoneticextensionssupplement")];
+ char uniname2ctype_pool_str1016[sizeof("balinese")];
+ char uniname2ctype_pool_str1021[sizeof("lowercaseletter")];
+ char uniname2ctype_pool_str1031[sizeof("indingbats")];
+ char uniname2ctype_pool_str1035[sizeof("inprivateusearea")];
+ char uniname2ctype_pool_str1039[sizeof("assigned")];
+ char uniname2ctype_pool_str1044[sizeof("patternsyntax")];
+ char uniname2ctype_pool_str1051[sizeof("inhangulsyllables")];
+ char uniname2ctype_pool_str1065[sizeof("sarb")];
+ char uniname2ctype_pool_str1067[sizeof("brai")];
+ char uniname2ctype_pool_str1069[sizeof("insupplementalmathematicaloperators")];
+ char uniname2ctype_pool_str1070[sizeof("phnx")];
+ char uniname2ctype_pool_str1072[sizeof("ingreekextended")];
+ char uniname2ctype_pool_str1074[sizeof("otherletter")];
+ char uniname2ctype_pool_str1076[sizeof("arab")];
+ char uniname2ctype_pool_str1078[sizeof("inlatinextendedd")];
+ char uniname2ctype_pool_str1081[sizeof("word")];
+ char uniname2ctype_pool_str1084[sizeof("inphagspa")];
+ char uniname2ctype_pool_str1087[sizeof("inblockelements")];
+ char uniname2ctype_pool_str1092[sizeof("ethiopic")];
+ char uniname2ctype_pool_str1094[sizeof("inethiopicextendeda")];
+ char uniname2ctype_pool_str1107[sizeof("brahmi")];
+ char uniname2ctype_pool_str1110[sizeof("logicalorderexception")];
+ char uniname2ctype_pool_str1114[sizeof("inoldpersian")];
+ char uniname2ctype_pool_str1129[sizeof("inletterlikesymbols")];
+ char uniname2ctype_pool_str1133[sizeof("sorasompeng")];
+ char uniname2ctype_pool_str1135[sizeof("hiragana")];
+ char uniname2ctype_pool_str1142[sizeof("inhanguljamoextendeda")];
+ char uniname2ctype_pool_str1147[sizeof("othermath")];
+ char uniname2ctype_pool_str1150[sizeof("digit")];
+ char uniname2ctype_pool_str1151[sizeof("goth")];
+ char uniname2ctype_pool_str1156[sizeof("ogham")];
+ char uniname2ctype_pool_str1162[sizeof("sundanese")];
+ char uniname2ctype_pool_str1170[sizeof("saurashtra")];
+ char uniname2ctype_pool_str1173[sizeof("linearb")];
+ char uniname2ctype_pool_str1179[sizeof("graphemebase")];
+ char uniname2ctype_pool_str1185[sizeof("inunifiedcanadianaboriginalsyllabics")];
+ char uniname2ctype_pool_str1186[sizeof("cuneiform")];
+ char uniname2ctype_pool_str1188[sizeof("inkannada")];
+ char uniname2ctype_pool_str1190[sizeof("kana")];
+ char uniname2ctype_pool_str1195[sizeof("inancientgreeknumbers")];
+ char uniname2ctype_pool_str1196[sizeof("incjkstrokes")];
+ char uniname2ctype_pool_str1198[sizeof("inglagolitic")];
+ char uniname2ctype_pool_str1202[sizeof("inancientgreekmusicalnotation")];
+ char uniname2ctype_pool_str1212[sizeof("inchakma")];
+ char uniname2ctype_pool_str1215[sizeof("plrd")];
+ char uniname2ctype_pool_str1219[sizeof("inbrahmi")];
+ char uniname2ctype_pool_str1224[sizeof("cakm")];
+ char uniname2ctype_pool_str1225[sizeof("incjkcompatibilityforms")];
+ char uniname2ctype_pool_str1229[sizeof("lisu")];
+ char uniname2ctype_pool_str1230[sizeof("incjkcompatibilityideographs")];
+ char uniname2ctype_pool_str1231[sizeof("intagalog")];
+ char uniname2ctype_pool_str1244[sizeof("inkaithi")];
+ char uniname2ctype_pool_str1245[sizeof("insupplementalarrowsa")];
+ char uniname2ctype_pool_str1249[sizeof("takri")];
+ char uniname2ctype_pool_str1253[sizeof("ideographic")];
+ char uniname2ctype_pool_str1256[sizeof("hexdigit")];
+ char uniname2ctype_pool_str1259[sizeof("glag")];
+ char uniname2ctype_pool_str1261[sizeof("softdotted")];
+ char uniname2ctype_pool_str1262[sizeof("variationselector")];
+ char uniname2ctype_pool_str1264[sizeof("inkatakana")];
+ char uniname2ctype_pool_str1265[sizeof("meeteimayek")];
+ char uniname2ctype_pool_str1274[sizeof("otherpunctuation")];
+ char uniname2ctype_pool_str1279[sizeof("inhanguljamo")];
+ char uniname2ctype_pool_str1282[sizeof("kali")];
+ char uniname2ctype_pool_str1289[sizeof("braille")];
+ char uniname2ctype_pool_str1298[sizeof("incombininghalfmarks")];
+ char uniname2ctype_pool_str1300[sizeof("talu")];
+ char uniname2ctype_pool_str1302[sizeof("incjkcompatibilityideographssupplement")];
+ char uniname2ctype_pool_str1306[sizeof("telu")];
+ char uniname2ctype_pool_str1307[sizeof("idsb")];
+ char uniname2ctype_pool_str1310[sizeof("tglg")];
+ char uniname2ctype_pool_str1313[sizeof("inmeeteimayek")];
+ char uniname2ctype_pool_str1315[sizeof("yi")];
+ char uniname2ctype_pool_str1318[sizeof("phagspa")];
+ char uniname2ctype_pool_str1321[sizeof("yiii")];
+ char uniname2ctype_pool_str1323[sizeof("inarabicmathematicalalphabeticsymbols")];
+ char uniname2ctype_pool_str1328[sizeof("saur")];
+ char uniname2ctype_pool_str1330[sizeof("ogrext")];
+ char uniname2ctype_pool_str1334[sizeof("bidic")];
+ char uniname2ctype_pool_str1341[sizeof("inkanasupplement")];
+ char uniname2ctype_pool_str1343[sizeof("runic")];
+ char uniname2ctype_pool_str1344[sizeof("inalchemicalsymbols")];
+ char uniname2ctype_pool_str1350[sizeof("georgian")];
+ char uniname2ctype_pool_str1351[sizeof("inugaritic")];
+ char uniname2ctype_pool_str1354[sizeof("insaurashtra")];
+ char uniname2ctype_pool_str1356[sizeof("inhighprivateusesurrogates")];
+ char uniname2ctype_pool_str1362[sizeof("pd")];
+ char uniname2ctype_pool_str1372[sizeof("incountingrodnumerals")];
+ char uniname2ctype_pool_str1377[sizeof("inarabicextendeda")];
+ char uniname2ctype_pool_str1389[sizeof("inkharoshthi")];
+ char uniname2ctype_pool_str1393[sizeof("idstrinaryoperator")];
+ char uniname2ctype_pool_str1396[sizeof("phag")];
+ char uniname2ctype_pool_str1398[sizeof("brah")];
+ char uniname2ctype_pool_str1402[sizeof("mark")];
+ char uniname2ctype_pool_str1404[sizeof("hebr")];
+ char uniname2ctype_pool_str1411[sizeof("inkhmersymbols")];
+ char uniname2ctype_pool_str1413[sizeof("dep")];
+ char uniname2ctype_pool_str1416[sizeof("inkhmer")];
+ char uniname2ctype_pool_str1422[sizeof("deprecated")];
+ char uniname2ctype_pool_str1424[sizeof("rejang")];
+ char uniname2ctype_pool_str1429[sizeof("lyci")];
+ char uniname2ctype_pool_str1431[sizeof("intakri")];
+ char uniname2ctype_pool_str1432[sizeof("takr")];
+ char uniname2ctype_pool_str1435[sizeof("incyrillicsupplement")];
+ char uniname2ctype_pool_str1436[sizeof("changeswhencasefolded")];
+ char uniname2ctype_pool_str1438[sizeof("indevanagariextended")];
+ char uniname2ctype_pool_str1442[sizeof("lycian")];
+ char uniname2ctype_pool_str1443[sizeof("inbengali")];
+ char uniname2ctype_pool_str1448[sizeof("beng")];
+ char uniname2ctype_pool_str1450[sizeof("graph")];
+ char uniname2ctype_pool_str1452[sizeof("inyijinghexagramsymbols")];
+ char uniname2ctype_pool_str1457[sizeof("olck")];
+ char uniname2ctype_pool_str1460[sizeof("inarabicsupplement")];
+ char uniname2ctype_pool_str1462[sizeof("inbuginese")];
+ char uniname2ctype_pool_str1463[sizeof("changeswhencasemapped")];
+ char uniname2ctype_pool_str1468[sizeof("olchiki")];
+ char uniname2ctype_pool_str1478[sizeof("inaegeannumbers")];
+ char uniname2ctype_pool_str1479[sizeof("mlym")];
+ char uniname2ctype_pool_str1480[sizeof("alphabetic")];
+ char uniname2ctype_pool_str1492[sizeof("sylotinagri")];
+ char uniname2ctype_pool_str1498[sizeof("changeswhentitlecased")];
+ char uniname2ctype_pool_str1504[sizeof("tagalog")];
+ char uniname2ctype_pool_str1505[sizeof("tagb")];
+ char uniname2ctype_pool_str1506[sizeof("runr")];
+ char uniname2ctype_pool_str1510[sizeof("malayalam")];
+ char uniname2ctype_pool_str1512[sizeof("inoriya")];
+ char uniname2ctype_pool_str1516[sizeof("intagbanwa")];
+ char uniname2ctype_pool_str1517[sizeof("syrc")];
+ char uniname2ctype_pool_str1519[sizeof("nko")];
+ char uniname2ctype_pool_str1520[sizeof("nkoo")];
+ char uniname2ctype_pool_str1523[sizeof("inethiopicextended")];
+ char uniname2ctype_pool_str1525[sizeof("kaithi")];
+ char uniname2ctype_pool_str1530[sizeof("mathsymbol")];
+ char uniname2ctype_pool_str1531[sizeof("inyiradicals")];
+ char uniname2ctype_pool_str1536[sizeof("insupplementaryprivateuseareaa")];
+ char uniname2ctype_pool_str1540[sizeof("osmanya")];
+ char uniname2ctype_pool_str1546[sizeof("syriac")];
+ char uniname2ctype_pool_str1548[sizeof("otherdefaultignorablecodepoint")];
+ char uniname2ctype_pool_str1561[sizeof("number")];
+ char uniname2ctype_pool_str1565[sizeof("inlinearbsyllabary")];
+ char uniname2ctype_pool_str1566[sizeof("kthi")];
+ char uniname2ctype_pool_str1567[sizeof("sund")];
+ char uniname2ctype_pool_str1569[sizeof("mymr")];
+ char uniname2ctype_pool_str1571[sizeof("incombiningdiacriticalmarks")];
+ char uniname2ctype_pool_str1578[sizeof("enclosingmark")];
+ char uniname2ctype_pool_str1581[sizeof("incombiningdiacriticalmarksforsymbols")];
+ char uniname2ctype_pool_str1583[sizeof("inethiopicsupplement")];
+ char uniname2ctype_pool_str1590[sizeof("unassigned")];
+ char uniname2ctype_pool_str1591[sizeof("sylo")];
+ char uniname2ctype_pool_str1595[sizeof("combiningmark")];
+ char uniname2ctype_pool_str1598[sizeof("myanmar")];
+ char uniname2ctype_pool_str1605[sizeof("graphemeextend")];
+ char uniname2ctype_pool_str1606[sizeof("bidicontrol")];
+ char uniname2ctype_pool_str1609[sizeof("inhalfwidthandfullwidthforms")];
+ char uniname2ctype_pool_str1617[sizeof("cyrl")];
+ char uniname2ctype_pool_str1620[sizeof("knda")];
+ char uniname2ctype_pool_str1634[sizeof("inunifiedcanadianaboriginalsyllabicsextended")];
+ char uniname2ctype_pool_str1635[sizeof("xsux")];
+ char uniname2ctype_pool_str1636[sizeof("modifiersymbol")];
+ char uniname2ctype_pool_str1643[sizeof("incombiningdiacriticalmarkssupplement")];
+ char uniname2ctype_pool_str1645[sizeof("inhanunoo")];
+ char uniname2ctype_pool_str1648[sizeof("inbuhid")];
+ char uniname2ctype_pool_str1649[sizeof("kannada")];
+ char uniname2ctype_pool_str1658[sizeof("inhebrew")];
+ char uniname2ctype_pool_str1662[sizeof("grbase")];
+ char uniname2ctype_pool_str1664[sizeof("spacingmark")];
+ char uniname2ctype_pool_str1670[sizeof("inkatakanaphoneticextensions")];
+ char uniname2ctype_pool_str1676[sizeof("hangul")];
+ char uniname2ctype_pool_str1683[sizeof("incjksymbolsandpunctuation")];
+ char uniname2ctype_pool_str1688[sizeof("bopo")];
+ char uniname2ctype_pool_str1692[sizeof("orya")];
+ char uniname2ctype_pool_str1699[sizeof("inbopomofo")];
+ char uniname2ctype_pool_str1701[sizeof("kharoshthi")];
+ char uniname2ctype_pool_str1703[sizeof("khar")];
+ char uniname2ctype_pool_str1709[sizeof("changeswhenlowercased")];
+ char uniname2ctype_pool_str1724[sizeof("khmr")];
+ char uniname2ctype_pool_str1725[sizeof("punct")];
+ char uniname2ctype_pool_str1729[sizeof("symbol")];
+ char uniname2ctype_pool_str1732[sizeof("cherokee")];
+ char uniname2ctype_pool_str1737[sizeof("cyrillic")];
+ char uniname2ctype_pool_str1759[sizeof("inkangxiradicals")];
+ char uniname2ctype_pool_str1761[sizeof("hebrew")];
+ char uniname2ctype_pool_str1780[sizeof("inarabicpresentationformsb")];
+ char uniname2ctype_pool_str1787[sizeof("incyrillicextendedb")];
+ char uniname2ctype_pool_str1790[sizeof("ugaritic")];
+ char uniname2ctype_pool_str1829[sizeof("incurrencysymbols")];
+ char uniname2ctype_pool_str1831[sizeof("meroitichieroglyphs")];
+ char uniname2ctype_pool_str1835[sizeof("inhighsurrogates")];
+ char uniname2ctype_pool_str1853[sizeof("nonspacingmark")];
+ char uniname2ctype_pool_str1858[sizeof("lydi")];
+ char uniname2ctype_pool_str1864[sizeof("patsyn")];
+ char uniname2ctype_pool_str1868[sizeof("orkh")];
+ char uniname2ctype_pool_str1871[sizeof("lydian")];
+ char uniname2ctype_pool_str1896[sizeof("ugar")];
+ char uniname2ctype_pool_str1899[sizeof("othergraphemeextend")];
+ char uniname2ctype_pool_str1900[sizeof("inlatinextendedb")];
+ char uniname2ctype_pool_str1904[sizeof("bopomofo")];
+ char uniname2ctype_pool_str1917[sizeof("khmer")];
+ char uniname2ctype_pool_str1925[sizeof("uideo")];
+ char uniname2ctype_pool_str1932[sizeof("otheruppercase")];
+ char uniname2ctype_pool_str1944[sizeof("grek")];
+ char uniname2ctype_pool_str1949[sizeof("gujr")];
+ char uniname2ctype_pool_str1970[sizeof("gujarati")];
+ char uniname2ctype_pool_str1983[sizeof("inhanguljamoextendedb")];
+ char uniname2ctype_pool_str1988[sizeof("defaultignorablecodepoint")];
+ char uniname2ctype_pool_str2005[sizeof("inplayingcards")];
+ char uniname2ctype_pool_str2022[sizeof("bamu")];
+ char uniname2ctype_pool_str2028[sizeof("inkanbun")];
+ char uniname2ctype_pool_str2033[sizeof("incjkradicalssupplement")];
+ char uniname2ctype_pool_str2046[sizeof("cypriot")];
+ char uniname2ctype_pool_str2051[sizeof("inbamum")];
+ char uniname2ctype_pool_str2053[sizeof("inmeroiticcursive")];
+ char uniname2ctype_pool_str2055[sizeof("oldturkic")];
+ char uniname2ctype_pool_str2086[sizeof("insupplementalarrowsb")];
+ char uniname2ctype_pool_str2087[sizeof("surrogate")];
+ char uniname2ctype_pool_str2094[sizeof("batk")];
+ char uniname2ctype_pool_str2102[sizeof("inbatak")];
+ char uniname2ctype_pool_str2119[sizeof("inlimbu")];
+ char uniname2ctype_pool_str2123[sizeof("incypriotsyllabary")];
+ char uniname2ctype_pool_str2129[sizeof("dashpunctuation")];
+ char uniname2ctype_pool_str2130[sizeof("innoblock")];
+ char uniname2ctype_pool_str2141[sizeof("hyphen")];
+ char uniname2ctype_pool_str2162[sizeof("insupplementalpunctuation")];
+ char uniname2ctype_pool_str2165[sizeof("ingeorgiansupplement")];
+ char uniname2ctype_pool_str2178[sizeof("oupper")];
+ char uniname2ctype_pool_str2189[sizeof("paragraphseparator")];
+ char uniname2ctype_pool_str2194[sizeof("inbamumsupplement")];
+ char uniname2ctype_pool_str2299[sizeof("uppercase")];
+ char uniname2ctype_pool_str2313[sizeof("currencysymbol")];
+ char uniname2ctype_pool_str2322[sizeof("sk")];
+ char uniname2ctype_pool_str2338[sizeof("lu")];
+ char uniname2ctype_pool_str2342[sizeof("openpunctuation")];
+ char uniname2ctype_pool_str2349[sizeof("inlisu")];
+ char uniname2ctype_pool_str2371[sizeof("qmark")];
+ char uniname2ctype_pool_str2372[sizeof("egyp")];
+ char uniname2ctype_pool_str2377[sizeof("insupplementaryprivateuseareab")];
+ char uniname2ctype_pool_str2379[sizeof("limbu")];
+ char uniname2ctype_pool_str2400[sizeof("inegyptianhieroglyphs")];
+ char uniname2ctype_pool_str2401[sizeof("unifiedideograph")];
+ char uniname2ctype_pool_str2413[sizeof("intelugu")];
+ char uniname2ctype_pool_str2429[sizeof("katakana")];
+ char uniname2ctype_pool_str2442[sizeof("inhangulcompatibilityjamo")];
+ char uniname2ctype_pool_str2454[sizeof("upper")];
+ char uniname2ctype_pool_str2495[sizeof("inkayahli")];
+ char uniname2ctype_pool_str2515[sizeof("cwu")];
+ char uniname2ctype_pool_str2523[sizeof("incjkcompatibility")];
+ char uniname2ctype_pool_str2542[sizeof("uppercaseletter")];
+ char uniname2ctype_pool_str2549[sizeof("bugi")];
+ char uniname2ctype_pool_str2588[sizeof("buginese")];
+ char uniname2ctype_pool_str2627[sizeof("any")];
+ char uniname2ctype_pool_str2651[sizeof("inyisyllables")];
+ char uniname2ctype_pool_str2671[sizeof("inbopomofoextended")];
+ char uniname2ctype_pool_str2710[sizeof("inboxdrawing")];
+ char uniname2ctype_pool_str2724[sizeof("changeswhenuppercased")];
+ char uniname2ctype_pool_str2727[sizeof("unknown")];
+ char uniname2ctype_pool_str2737[sizeof("quotationmark")];
+ char uniname2ctype_pool_str2753[sizeof("buhd")];
+ char uniname2ctype_pool_str2785[sizeof("punctuation")];
+ char uniname2ctype_pool_str2888[sizeof("oldsoutharabian")];
+ char uniname2ctype_pool_str2925[sizeof("kayahli")];
+ char uniname2ctype_pool_str2940[sizeof("incjkunifiedideographs")];
+ char uniname2ctype_pool_str2961[sizeof("incjkunifiedideographsextensiona")];
+ char uniname2ctype_pool_str2962[sizeof("incjkunifiedideographsextensionc")];
+ char uniname2ctype_pool_str2995[sizeof("telugu")];
+ char uniname2ctype_pool_str3000[sizeof("guru")];
+ char uniname2ctype_pool_str3104[sizeof("greek")];
+ char uniname2ctype_pool_str3189[sizeof("grlink")];
+ char uniname2ctype_pool_str3197[sizeof("buhid")];
+ char uniname2ctype_pool_str3254[sizeof("batak")];
+ char uniname2ctype_pool_str3292[sizeof("blank")];
+ char uniname2ctype_pool_str3391[sizeof("incjkunifiedideographsextensiond")];
+ char uniname2ctype_pool_str3459[sizeof("graphemelink")];
+ char uniname2ctype_pool_str3480[sizeof("egyptianhieroglyphs")];
+ char uniname2ctype_pool_str3802[sizeof("incjkunifiedideographsextensionb")];
+ char uniname2ctype_pool_str3922[sizeof("zyyy")];
+ char uniname2ctype_pool_str4167[sizeof("gurmukhi")];
#endif /* USE_UNICODE_PROPERTIES */
};
static const struct uniname2ctype_pool_t uniname2ctype_pool_contents =
{
#ifndef USE_UNICODE_PROPERTIES
+ "word",
"print",
"punct",
+ "alpha",
+ "alnum",
+ "xdigit",
+ "upper",
#else /* USE_UNICODE_PROPERTIES */
"n",
- "l",
- "nl",
- "ll",
+ "s",
+ "z",
+ "zs",
+ "zzzz",
"cn",
- "no",
- "lo",
+ "cs",
+ "ci",
"c",
- "co",
+ "cf",
+ "sc",
+ "cans",
+ "qaai",
+ "mn",
+#endif /* USE_UNICODE_PROPERTIES */
+ "ascii",
+#ifdef USE_UNICODE_PROPERTIES
"cc",
- "lao",
- "laoo",
- "lana",
- "ci",
"qaac",
- "vai",
- "vaii",
- "qaai",
- "control",
+ "inavestan",
+ "inspecials",
+ "inipaextensions",
+ "mc",
+ "insamaritan",
+ "m",
+ "sm",
+ "me",
+ "inarmenian",
+ "incuneiform",
+ "mandaic",
+ "inancientsymbols",
+ "incuneiformnumbersandpunctuation",
+ "inthai",
+ "inmusicalsymbols",
+ "inmiscellaneoussymbols",
+ "incham",
+ "inmiscellaneoussymbolsandarrows",
+ "initialpunctuation",
+ "inmiscellaneoussymbolsandpictographs",
+ "inthaana",
+ "taile",
+ "mtei",
+ "lc",
+ "lana",
+ "inlycian",
+ "intransportandmapsymbols",
+ "incontrolpictures",
+ "sinhala",
+ "incommonindicnumberforms",
+ "inmiscellaneousmathematicalsymbolsa",
+ "sterm",
+ "inmyanmarextendeda",
+ "lm",
+ "taiviet",
+ "inlinearbideograms",
+ "intaitham",
+ "latn",
+ "latin",
+ "ital",
+ "alnum",
+ "inmalayalam",
+ "intaile",
+ "tale",
+ "l",
+ "nl",
+ "zl",
+ "intamil",
+ "taml",
+ "inlatinextendeda",
+ "inlatinextendedc",
+ "inrunic",
+ "incarian",
+ "insyriac",
"cari",
+ "inmeeteimayekextensions",
+ "osma",
+ "lt",
+ "miao",
+ "insharada",
+ "incyrillic",
"carian",
- "zl",
- "oriya",
- "latn",
+ "armn",
+ "samr",
+ "armi",
+ "inideographicdescriptioncharacters",
+ "inosmanya",
+ "armenian",
+ "inmyanmar",
+ "samaritan",
+ "arabic",
+ "incherokee",
+ "connectorpunctuation",
+ "merc",
+ "inmiscellaneoustechnical",
+ "inenclosedalphanumerics",
+ "inemoticons",
+ "joinc",
+#endif /* USE_UNICODE_PROPERTIES */
"cntrl",
- "latin",
+#ifdef USE_UNICODE_PROPERTIES
+ "inenclosedcjklettersandmonths",
+ "cwcf",
+ "inruminumeralsymbols",
+ "ll",
+ "term",
+ "inlatinextendedadditional",
+ "tamil",
+ "loe",
+ "newtailue",
+ "cwcm",
+ "inenclosedalphanumericsupplement",
+ "sinh",
+ "zinh",
+ "meroiticcursive",
"han",
- "arabic",
- "ital",
- "hano",
"hani",
- "hanunoo",
- "lt",
+ "inopticalcharacterrecognition",
+ "no",
"so",
- "hira",
- "nchar",
- "sc",
- "z",
- "oalpha",
- "tavt",
- "cans",
- "java",
- "zinh",
- "thaa",
+ "innewtailue",
+ "insinhala",
+ "innko",
+ "co",
+ "shavian",
+ "terminalpunctuation",
+ "intaixuanjingsymbols",
+ "inethiopic",
+ "sora",
+ "inarrows",
+ "cham",
+ "inlowsurrogates",
+ "oriya",
+ "ext",
+ "cwt",
+ "common",
+ "inmiao",
"thai",
- "variationselector",
- "sinhala",
- "joinc",
- "ascii",
- "initialpunctuation",
- "other",
- "joincontrol",
+ "intifinagh",
+ "ethi",
+ "mero",
+ "chakma",
+ "thaa",
+ "inscriptionalparthian",
+ "tifinagh",
+ "titlecaseletter",
"thaana",
- "avst",
- "olower",
- "othernumber",
- "otherletter",
- "sinh",
- "tale",
- "connectorpunctuation",
- "s",
+ "asciihexdigit",
+ "math",
"di",
- "vs",
- "oidc",
- "idc",
- "odi",
- "cs",
- "avestan",
+ "ids",
+ "lo",
+ "inlao",
+ "taitham",
+ "lao",
+ "laoo",
"dia",
- "cher",
- "inscriptionalparthian",
- "shavian",
- "radical",
- "loe",
- "diacritic",
- "zzzz",
- "ethi",
- "canadianaboriginal",
- "zs",
- "othersymbol",
- "olditalic",
- "inscriptionalpahlavi",
- "taiviet",
+ "idc",
+ "ps",
+ "insundanese",
+ "pi",
+ "cwl",
+ "pf",
+ "mand",
+ "insylotinagri",
+ "vs",
+ "mongolian",
+ "pc",
+ "inmandaic",
+ "invai",
"lineseparator",
- "otheridstart",
- "oids",
- "asciihexdigit",
- "inherited",
- "otherlowercase",
- "terminalpunctuation",
- "deva",
- "otheralphabetic",
- "ideo",
- "noncharactercodepoint",
- "otheridcontinue",
- "taile",
- "oldpersian",
- "devanagari",
- "letter",
- "nd",
+ "pe",
+ "vai",
+ "vaii",
"idst",
- "dsrt",
- "titlecaseletter",
- "po",
- "dash",
- "pc",
- "letternumber",
- "pi",
- "javanese",
- "mn",
- "idstart",
- "idcontinue",
- "ids",
+ "indominotiles",
+ "inshavian",
+ "inspacingmodifierletters",
+ "format",
+ "inphaistosdisc",
+ "hano",
#endif /* USE_UNICODE_PROPERTIES */
- "alpha",
+ "space",
#ifdef USE_UNICODE_PROPERTIES
- "mc",
- "coptic",
- "mongolian",
- "common",
- "armn",
- "copt",
- "cprt",
- "armi",
- "phli",
- "prti",
- "armenian",
- "sd",
- "mandaic",
- "phoenician",
- "taml",
- "tamil",
- "cased",
- "cham",
- "idsbinaryoperator",
- "lepc",
- "otherdefaultignorablecodepoint",
- "print",
- "osma",
- "samr",
- "math",
- "linb",
- "closepunctuation",
- "otherpunctuation",
- "bali",
- "omath",
- "samaritan",
- "ps",
- "arab",
- "brai",
- "taitham",
- "linearb",
- "lepcha",
- "mand",
- "mtei",
- "term",
- "glagolitic",
- "privateuse",
- "pe",
- "deseret",
- "brah",
- "runr",
- "othermath",
- "runic",
- "hang",
- "ethiopic",
- "me",
+ "indeseret",
+ "inolchiki",
+ "hira",
+ "joincontrol",
+ "idcontinue",
+ "inmahjongtiles",
"patws",
- "separator",
- "tibt",
- "gothic",
- "tagbanwa",
- "sarb",
- "talu",
- "tibetan",
- "goth",
- "rjng",
- "hangul",
- "bengali",
- "hiragana",
- "braille",
- "geor",
+ "inlydian",
+ "cher",
+ "inhiragana",
+ "inogham",
+ "avst",
+ "inscriptionalpahlavi",
+ "incoptic",
+ "java",
+ "inmathematicalalphanumericsymbols",
+ "letter",
+ "injavanese",
+ "avestan",
"age=1.1",
+ "lepc",
"age=2.1",
+ "inlepcha",
+ "javanese",
+ "shaw",
+ "finalpunctuation",
+ "alpha",
"age=5.1",
+ "inmongolian",
"age=5.2",
- "age=4.1",
- "p",
- "pd",
- "lisu",
"age=2.0",
+ "ahex",
+ "ingeneralpunctuation",
+ "oids",
+ "odi",
"age=5.0",
- "age=6.0",
- "age=4.0",
- "graph",
- "saur",
- "space",
+ "tavt",
+ "intaiviet",
+ "age=6.1",
"age=3.1",
+ "insundanesesupplement",
"age=3.2",
- "hebr",
- "bidic",
+ "age=4.1",
+ "oidc",
+ "tfng",
+ "insmallformvariants",
+ "ideo",
+ "intags",
+ "age=6.0",
"age=3.0",
- "bidicontrol",
- "logicalorderexception",
- "telu",
- "zp",
- "m",
- "lm",
- "idstrinaryoperator",
- "balinese",
- "uideo",
- "spaceseparator",
- "grext",
-#endif /* USE_UNICODE_PROPERTIES */
- "alnum",
-#ifdef USE_UNICODE_PROPERTIES
- "oldturkic",
+ "whitespace",
+ "age=4.0",
+ "inolditalic",
+ "oalpha",
+ "ingujarati",
+ "control",
+ "diacritic",
+ "tagbanwa",
+ "inphoenician",
+ "ininscriptionalparthian",
+ "ininscriptionalpahlavi",
+ "coptic",
+ "dsrt",
+ "inmodifiertoneletters",
+ "xids",
+ "hanunoo",
+ "inoldturkic",
"xidc",
- "idsb",
- "ahex",
- "format",
+ "idstart",
+ "inimperialaramaic",
+ "invariationselectors",
+ "copt",
"caseignorable",
- "tifinagh",
- "sundanese",
- "ext",
- "saurashtra",
- "patternwhitespace",
- "digit",
- "sund",
+ "prti",
+ "nchar",
+ "deseret",
"decimalnumber",
- "bopo",
- "sm",
- "otheruppercase",
- "ideographic",
- "xids",
- "unassigned",
- "phagspa",
- "alphabetic",
- "limb",
-#endif /* USE_UNICODE_PROPERTIES */
+ "cprt",
+ "inlatin1supplement",
+ "imperialaramaic",
+ "privateuse",
+ "casedletter",
+ "lowercase",
+ "spaceseparator",
+ "radical",
+ "mong",
+ "canadianaboriginal",
+ "letternumber",
+ "insorasompeng",
+ "dash",
+ "wspace",
+ "ogam",
+ "invariationselectorssupplement",
+ "print",
+ "otheridcontinue",
+ "ingurmukhi",
+ "closepunctuation",
+ "olditalic",
+ "noncharactercodepoint",
+ "sharada",
+ "ingeometricshapes",
+ "otheralphabetic",
+ "patternwhitespace",
+ "po",
+ "rjng",
+ "ingreekandcoptic",
"xdigit",
-#ifdef USE_UNICODE_PROPERTIES
+ "gothic",
+ "inoldsoutharabian",
"xidstart",
- "mong",
+ "inrejang",
+ "idsbinaryoperator",
+ "olower",
+ "hex",
+ "inenclosedideographicsupplement",
+ "inalphabeticpresentationforms",
+ "inbasiclatin",
+ "othersymbol",
+ "nd",
+ "sd",
+ "omath",
+ "separator",
+ "inarabic",
"xidcontinue",
+ "otheridstart",
+ "grext",
+ "otherlowercase",
+ "phli",
+ "cased",
+ "hang",
+ "xpeo",
+#endif /* USE_UNICODE_PROPERTIES */
+ "lower",
+#ifndef USE_UNICODE_PROPERTIES
+ "graph",
+#else /* USE_UNICODE_PROPERTIES */
+ "modifierletter",
+ "inphoneticextensions",
+ "inarabicpresentationformsa",
+ "innumberforms",
+ "oldpersian",
+ "incyrillicextendeda",
+ "inverticalforms",
+ "p",
+ "inbyzantinemusicalsymbols",
+ "inmathematicaloperators",
+ "intibetan",
+ "zp",
+ "ingeorgian",
+ "inbraillepatterns",
+ "lepcha",
+ "geor",
+ "invedicextensions",
+ "linb",
+ "other",
+ "deva",
+ "indevanagari",
+ "othernumber",
+ "bamum",
+ "shrd",
+ "bali",
+ "devanagari",
+ "extender",
+ "inherited",
+ "glagolitic",
+ "tibt",
+ "inbalinese",
+ "ingothic",
+ "inmiscellaneousmathematicalsymbolsb",
+ "limb",
+ "bengali",
+ "phoenician",
+ "insuperscriptsandsubscripts",
+ "inmeroitichieroglyphs",
+ "tibetan",
+ "inphoneticextensionssupplement",
+ "balinese",
+ "lowercaseletter",
+ "indingbats",
+ "inprivateusearea",
"assigned",
- "ogam",
- "nko",
- "nkoo",
- "olck",
- "deprecated",
+ "patternsyntax",
+ "inhangulsyllables",
+ "sarb",
+ "brai",
+ "insupplementalmathematicaloperators",
+ "phnx",
+ "ingreekextended",
+ "otherletter",
+ "arab",
+ "inlatinextendedd",
+ "word",
+ "inphagspa",
+ "inblockelements",
+ "ethiopic",
+ "inethiopicextendeda",
"brahmi",
- "phag",
+ "logicalorderexception",
+ "inoldpersian",
+ "inletterlikesymbols",
+ "sorasompeng",
+ "hiragana",
+ "inhanguljamoextendeda",
+ "othermath",
+#endif /* USE_UNICODE_PROPERTIES */
+ "digit",
+#ifndef USE_UNICODE_PROPERTIES
+ "blank"
+#else /* USE_UNICODE_PROPERTIES */
+ "goth",
+ "ogham",
+ "sundanese",
+ "saurashtra",
+ "linearb",
+ "graphemebase",
+ "inunifiedcanadianaboriginalsyllabics",
+ "cuneiform",
+ "inkannada",
"kana",
+ "inancientgreeknumbers",
+ "incjkstrokes",
+ "inglagolitic",
+ "inancientgreekmusicalnotation",
+ "inchakma",
+ "plrd",
+ "inbrahmi",
+ "cakm",
+ "incjkcompatibilityforms",
+ "lisu",
+ "incjkcompatibilityideographs",
+ "intagalog",
+ "inkaithi",
+ "insupplementalarrowsa",
+ "takri",
+ "ideographic",
+ "hexdigit",
+ "glag",
+ "softdotted",
+ "variationselector",
+ "inkatakana",
+ "meeteimayek",
+ "otherpunctuation",
+ "inhanguljamo",
"kali",
- "changeswhenlowercased",
- "extender",
- "dep",
- "olchiki",
- "cwl",
- "graphemebase",
- "phnx",
- "orkh",
- "punct",
- "khar",
- "lower",
- "sterm",
+ "braille",
+ "incombininghalfmarks",
+ "talu",
+ "incjkcompatibilityideographssupplement",
+ "telu",
+ "idsb",
+ "tglg",
+ "inmeeteimayek",
"yi",
+ "phagspa",
+ "yiii",
+ "inarabicmathematicalalphabeticsymbols",
+ "saur",
+ "ogrext",
+ "bidic",
+ "inkanasupplement",
+ "runic",
+ "inalchemicalsymbols",
+ "georgian",
+ "inugaritic",
+ "insaurashtra",
+ "inhighprivateusesurrogates",
+ "pd",
+ "incountingrodnumerals",
+ "inarabicextendeda",
+ "inkharoshthi",
+ "idstrinaryoperator",
+ "phag",
+ "brah",
+ "mark",
+ "hebr",
+ "inkhmersymbols",
+ "dep",
+ "inkhmer",
+ "deprecated",
+ "rejang",
"lyci",
- "cyrl",
+ "intakri",
+ "takr",
+ "incyrillicsupplement",
+ "changeswhencasefolded",
+ "indevanagariextended",
"lycian",
- "finalpunctuation",
- "orya",
- "graphemeextend",
- "kaithi",
- "xpeo",
- "yiii",
- "kthi",
- "cyrillic",
- "glag",
- "oupper",
- "tagb",
- "cwt",
- "number",
- "tglg",
- "knda",
- "lowercaseletter",
+ "inbengali",
+ "beng",
+ "graph",
+ "inyijinghexagramsymbols",
+ "olck",
+ "inarabicsupplement",
+ "inbuginese",
+ "changeswhencasemapped",
+ "olchiki",
+ "inaegeannumbers",
+ "mlym",
+ "alphabetic",
+ "sylotinagri",
"changeswhentitlecased",
- "softdotted",
- "ugar",
- "sylo",
- "lu",
"tagalog",
- "kharoshthi",
+ "tagb",
+ "runr",
+ "malayalam",
+ "inoriya",
+ "intagbanwa",
"syrc",
- "kannada",
- "beng",
- "lowercase",
- "shaw",
- "patternsyntax",
+ "nko",
+ "nkoo",
+ "inethiopicextended",
+ "kaithi",
+ "mathsymbol",
+ "inyiradicals",
+ "insupplementaryprivateuseareaa",
+ "osmanya",
"syriac",
- "word",
- "imperialaramaic",
- "ugaritic",
+ "otherdefaultignorablecodepoint",
+ "number",
+ "inlinearbsyllabary",
+ "kthi",
+ "sund",
+ "mymr",
+ "incombiningdiacriticalmarks",
"enclosingmark",
- "georgian",
+ "incombiningdiacriticalmarksforsymbols",
+ "inethiopicsupplement",
+ "unassigned",
+ "sylo",
+ "combiningmark",
+ "myanmar",
+ "graphemeextend",
+ "bidicontrol",
+ "inhalfwidthandfullwidthforms",
+ "cyrl",
+ "knda",
+ "inunifiedcanadianaboriginalsyllabicsextended",
+ "xsux",
+ "modifiersymbol",
+ "incombiningdiacriticalmarkssupplement",
+ "inhanunoo",
+ "inbuhid",
+ "kannada",
+ "inhebrew",
+ "grbase",
+ "spacingmark",
+ "inkatakanaphoneticextensions",
+ "hangul",
+ "incjksymbolsandpunctuation",
+ "bopo",
+ "orya",
+ "inbopomofo",
+ "kharoshthi",
+ "khar",
+ "changeswhenlowercased",
+ "khmr",
+ "punct",
+ "symbol",
+ "cherokee",
+ "cyrillic",
+ "inkangxiradicals",
+ "hebrew",
+ "inarabicpresentationformsb",
+ "incyrillicextendedb",
+ "ugaritic",
+ "incurrencysymbols",
+ "meroitichieroglyphs",
+ "inhighsurrogates",
+ "nonspacingmark",
"lydi",
+ "patsyn",
+ "orkh",
"lydian",
- "sylotinagri",
- "gujr",
- "tfng",
- "currencysymbol",
-#endif /* USE_UNICODE_PROPERTIES */
- "newline",
-#ifdef USE_UNICODE_PROPERTIES
+ "ugar",
+ "othergraphemeextend",
+ "inlatinextendedb",
"bopomofo",
- "ogrext",
- "cherokee",
+ "khmer",
+ "uideo",
+ "otheruppercase",
+ "grek",
+ "gujr",
"gujarati",
- "newtailue",
- "dashpunctuation",
- "oldsoutharabian",
-#endif /* USE_UNICODE_PROPERTIES */
- "upper",
-#ifndef USE_UNICODE_PROPERTIES
- "ascii",
- "cntrl",
- "space",
- "word",
- "lower",
- "graph",
- "digit",
- "blank"
-#else /* USE_UNICODE_PROPERTIES */
- "cf",
- "buhd",
- "rejang",
- "othergraphemeextend",
- "modifierletter",
- "nonspacingmark",
- "changeswhencasemapped",
- "mark",
+ "inhanguljamoextendedb",
+ "defaultignorablecodepoint",
+ "inplayingcards",
+ "bamu",
+ "inkanbun",
+ "incjkradicalssupplement",
+ "cypriot",
+ "inbamum",
+ "inmeroiticcursive",
+ "oldturkic",
+ "insupplementalarrowsb",
"surrogate",
+ "batk",
+ "inbatak",
+ "inlimbu",
+ "incypriotsyllabary",
+ "dashpunctuation",
+ "innoblock",
+ "hyphen",
+ "insupplementalpunctuation",
+ "ingeorgiansupplement",
+ "oupper",
"paragraphseparator",
- "ogham",
- "hex",
- "uppercaseletter",
- "hexdigit",
- "cwcm",
- "grbase",
- "khmr",
- "unifiedideograph",
+ "inbamumsupplement",
"uppercase",
- "khmer",
- "spacingmark",
- "whitespace",
- "patsyn",
- "cypriot",
+ "currencysymbol",
+ "sk",
+ "lu",
"openpunctuation",
- "bamu",
- "buhid",
- "batk",
- "symbol",
- "changeswhenuppercased",
- "osmanya",
+ "inlisu",
+ "qmark",
+ "egyp",
+ "insupplementaryprivateuseareab",
"limbu",
- "punctuation",
- "hyphen",
- "mathsymbol",
- "grek",
- "changeswhencasefolded",
- "quotationmark",
+ "inegyptianhieroglyphs",
+ "unifiedideograph",
+ "intelugu",
+ "katakana",
+ "inhangulcompatibilityjamo",
+ "upper",
+ "inkayahli",
+ "cwu",
+ "incjkcompatibility",
+ "uppercaseletter",
"bugi",
- "cuneiform",
- "pf",
- "cwcf",
- "bamum",
- "guru",
- "wspace",
- "meeteimayek",
- "defaultignorablecodepoint",
- "modifiersymbol",
- "mlym",
- "mymr",
- "malayalam",
- "myanmar",
- "telugu",
"buginese",
- "xsux",
- "sk",
- "katakana",
- "egyp",
"any",
+ "inyisyllables",
+ "inbopomofoextended",
+ "inboxdrawing",
+ "changeswhenuppercased",
+ "unknown",
+ "quotationmark",
+ "buhd",
+ "punctuation",
+ "oldsoutharabian",
"kayahli",
- "cwu",
- "qmark",
- "blank",
+ "incjkunifiedideographs",
+ "incjkunifiedideographsextensiona",
+ "incjkunifiedideographsextensionc",
+ "telugu",
+ "guru",
+ "greek",
"grlink",
+ "buhid",
"batak",
- "unknown",
- "greek",
+ "blank",
+ "incjkunifiedideographsextensiond",
"graphemelink",
- "gurmukhi",
- "hebrew",
"egyptianhieroglyphs",
- "zyyy"
+ "incjkunifiedideographsextensionb",
+ "zyyy",
+ "gurmukhi"
#endif /* USE_UNICODE_PROPERTIES */
};
#define uniname2ctype_pool ((const char *) &uniname2ctype_pool_contents)
@@ -23125,681 +27365,1289 @@ uniname2ctype_p (str, len)
{
#ifdef USE_UNICODE_PROPERTIES
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3, 33},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3, 34},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str5, 23},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str5, 46},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str7, 35},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str8, 24},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str7, 51},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str10, 20},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str11, 36},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str12, 26},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str13, 17},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str16, 21},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str9, 54},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str16, 208},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str18, 20},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str20, 22},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str20, 18},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str21, 93},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str22, 93},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str23, 150},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str24, 60},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str29, 17},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str30, 19},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str32, 47},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str34, 101},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str35, 114},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str26, 59},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str38, 33},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str42, 14},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str44, 18},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str45, 128},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str49, 401},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str29, 127},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str30, 142},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str31, 142},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str32, 113},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str52, 377},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str62, 226},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str34, 18},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str64, 31},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str66, 239},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str37, 147},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str69, 30},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str40, 147},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str72, 49},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str42, 51},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str74, 32},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str82, 232},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str44, 86},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str84, 412},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str46, 74},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str47, 3},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str48, 74},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str51, 108},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str86, 168},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str90, 382},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str53, 79},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str54, 110},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str55, 115},
- {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str60, 108},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str92, 413},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str96, 252},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str63, 115},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str99, 419},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str100, 304},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str106, 355},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str66, 27},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str67, 49},
- {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str69, 105},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str70, 184},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str71, 46},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str109, 312},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str113, 43},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str114, 430},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str73, 50},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str74, 178},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str75, 151},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str76, 100},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str116, 237},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str84, 157},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str124, 120},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str125, 159},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str132, 24},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str133, 151},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str134, 384},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str135, 432},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str136, 298},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str142, 92},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str151, 347},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str156, 306},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str158, 204},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str167, 356},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str172, 26},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str175, 152},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str88, 113},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str89, 81},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str90, 92},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str91, 197},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str92, 91},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str93, 170},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str94, 14},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str95, 42},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str179, 379},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str180, 276},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str184, 75},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str186, 75},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str187, 111},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str189, 13},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str199, 250},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str201, 272},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str202, 120},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str98, 17},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str99, 170},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str100, 81},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str101, 152},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str205, 23},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str207, 36},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str209, 52},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str216, 247},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str217, 88},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str218, 224},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str103, 182},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str220, 314},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str223, 263},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str224, 385},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str225, 235},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str105, 36},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str106, 26},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str227, 148},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str109, 91},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str230, 358},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str231, 124},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str232, 28},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str233, 172},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str234, 410},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str239, 230},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str240, 148},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str244, 78},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str245, 155},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str247, 160},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str248, 323},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str252, 392},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str253, 78},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str254, 255},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str255, 155},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str256, 80},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str112, 119},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str259, 260},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str114, 38},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str115, 45},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str116, 69},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str117, 197},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str261, 39},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str119, 195},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str120, 66},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str121, 190},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str122, 22},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str123, 152},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str124, 180},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str125, 99},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str126, 161},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str263, 170},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str264, 297},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str268, 300},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str128, 122},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str137, 188},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str143, 193},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str279, 431},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str281, 178},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str288, 3},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str147, 180},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str148, 200},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str149, 98},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str301, 333},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str151, 100},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str152, 53},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str153, 49},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str156, 110},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str303, 64},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str304, 405},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str308, 25},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str161, 162},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str162, 151},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str163, 51},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str313, 182},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str166, 194},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str316, 287},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str170, 194},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str171, 177},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str172, 113},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str320, 88},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str321, 201},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str329, 129},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str330, 65},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str339, 428},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str346, 92},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str347, 114},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str349, 170},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str353, 109},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str357, 109},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str358, 299},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str359, 37},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str360, 50},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str364, 273},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str365, 251},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str174, 182},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str175, 174},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str176, 82},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str367, 238},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str372, 21},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str179, 178},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str180, 179},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str181, 184},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str375, 123},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str378, 182},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str386, 421},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str387, 258},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str183, 195},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str389, 174},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str398, 295},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str400, 150},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str403, 365},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str405, 87},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str406, 189},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str409, 63},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str412, 74},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str414, 416},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str420, 93},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str425, 317},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str426, 99},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str427, 171},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str428, 169},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str429, 82},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str430, 162},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str432, 131},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str436, 28},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str445, 82},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str187, 119},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str449, 185},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str450, 55},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str190, 132},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str453, 70},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str454, 66},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str460, 27},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str468, 253},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str192, 82},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str193, 23},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str470, 151},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str474, 94},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str475, 94},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str476, 188},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str195, 34},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str478, 67},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str197, 187},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str198, 112},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str480, 45},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str481, 278},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str484, 43},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str485, 61},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str490, 42},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str495, 168},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str496, 346},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str497, 205},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str503, 105},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str504, 39},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str200, 27},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str506, 240},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str509, 341},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str202, 43},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str203, 171},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str511, 52},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str206, 38},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str514, 41},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str515, 143},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str516, 143},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str517, 195},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str209, 35},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str520, 426},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str521, 391},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str522, 227},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str524, 19},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str528, 383},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str531, 116},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str532, 9},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str542, 390},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str212, 42},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str545, 281},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str215, 157},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str548, 106},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str553, 178},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str217, 32},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str218, 65},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str555, 67},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str558, 425},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str220, 66},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str560, 206},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str563, 396},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str564, 100},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str568, 325},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str572, 262},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str222, 65},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str223, 1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str574, 153},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str575, 163},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str227, 30},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str579, 315},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str587, 158},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str229, 127},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str589, 423},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str234, 104},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str235, 73},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str236, 77},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str237, 127},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str243, 124},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str244, 159},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str245, 162},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str246, 161},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str594, 23},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str604, 354},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str608, 153},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str250, 77},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str251, 192},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str252, 167},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str612, 209},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str613, 141},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str614, 211},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str616, 280},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str617, 158},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str618, 123},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str619, 42},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str620, 1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str621, 218},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str622, 269},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str623, 219},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str255, 136},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str626, 210},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str627, 185},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str258, 87},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str630, 289},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str631, 202},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str632, 198},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str633, 217},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str261, 87},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str268, 58},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str269, 149},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str270, 186},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str271, 140},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str636, 152},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str637, 357},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str638, 221},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str639, 213},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str640, 282},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str641, 214},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str642, 216},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str643, 203},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str646, 131},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str647, 374},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str648, 187},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str649, 438},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str650, 220},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str651, 212},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str653, 176},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str654, 215},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str655, 386},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str660, 186},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str668, 245},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str275, 190},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str672, 18},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str679, 188},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str278, 7},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str682, 118},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str286, 123},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str292, 154},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str690, 395},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str294, 54},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str701, 402},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str296, 120},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str297, 40},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str703, 403},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str704, 128},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str705, 113},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str706, 344},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str709, 68},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str713, 116},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str715, 404},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str721, 69},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str725, 66},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str301, 43},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str729, 394},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str730, 370},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str734, 128},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str737, 60},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str738, 162},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str739, 192},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str746, 113},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str747, 35},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str748, 125},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str303, 134},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str750, 223},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str306, 175},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str307, 154},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str308, 44},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str771, 160},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str776, 21},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str777, 24},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str778, 57},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str310, 79},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str311, 125},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str780, 54},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str784, 196},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str314, 150},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str787, 105},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str788, 101},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str792, 36},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str796, 408},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str797, 179},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str798, 176},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str799, 102},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str317, 120},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str802, 439},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str803, 7},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str811, 203},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str321, 140},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str322, 167},
- {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str324, 158},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str325, 174},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str326, 129},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str327, 21},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str328, 40},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str335, 112},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str815, 244},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str818, 41},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str340, 166},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str341, 102},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str823, 111},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str824, 192},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str343, 175},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str344, 102},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str345, 97},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str346, 98},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str826, 173},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str827, 303},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str349, 31},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str350, 198},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str353, 50},
- {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str355, 94},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str356, 111},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str830, 186},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str831, 206},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str832, 44},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str833, 146},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str358, 117},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str359, 160},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str835, 229},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str841, 11},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str850, 112},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str851, 400},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str852, 68},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str361, 128},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str854, 352},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str367, 94},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str860, 194},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str867, 190},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str869, 184},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str870, 429},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str371, 111},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str372, 145},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str373, 97},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str374, 83},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str375, 105},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str376, 125},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str874, 368},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str879, 222},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str884, 50},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str889, 35},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str890, 200},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str900, 183},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str901, 51},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str907, 234},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str912, 69},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str913, 202},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str914, 71},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str379, 96},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str380, 201},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str381, 203},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str382, 210},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str383, 211},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str384, 208},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str385, 37},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str386, 39},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str917, 190},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str388, 155},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str389, 202},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str390, 209},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str391, 212},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str392, 207},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str393, 5},
- {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str395, 143},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str396, 9},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str397, 205},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str398, 206},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str399, 78},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str402, 169},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str919, 163},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str920, 59},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str405, 204},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str923, 98},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str931, 133},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str933, 6},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str408, 169},
- {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str413, 193},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str420, 88},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str936, 26},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str422, 52},
- {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str427, 29},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str938, 284},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str939, 369},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str943, 294},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str945, 133},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str946, 319},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str947, 371},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str949, 38},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str950, 418},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str951, 296},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str952, 254},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str953, 53},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str430, 25},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str956, 256},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str960, 308},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str432, 187},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str433, 134},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str434, 189},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str962, 141},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str963, 97},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str964, 283},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str965, 121},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str966, 17},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str970, 83},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str436, 53},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str972, 242},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str973, 37},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str974, 157},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str438, 70},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str976, 173},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str977, 135},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str442, 13},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str443, 163},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str981, 83},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str445, 68},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str446, 186},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str447, 177},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str983, 189},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str452, 19},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str988, 114},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str989, 130},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str990, 95},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str456, 59},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str457, 130},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str994, 277},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str459, 139},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str996, 387},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str997, 310},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str998, 119},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1000, 84},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str462, 181},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1003, 137},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1004, 290},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str464, 143},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str465, 198},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str466, 4},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str474, 139},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1006, 397},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1007, 95},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1010, 285},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str480, 34},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1016, 135},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1021, 25},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1031, 305},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str484, 107},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str485, 48},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str488, 183},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1035, 366},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1039, 16},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str493, 179},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str496, 67},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str497, 20},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1044, 207},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1051, 361},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str502, 137},
- {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str506, 55},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1065, 161},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str508, 118},
- {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str512, 11},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str513, 67},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str516, 104},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1067, 126},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str518, 68},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str521, 16},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1069, 311},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1070, 137},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str523, 101},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str529, 138},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str530, 138},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str533, 141},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str534, 191},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str535, 166},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str536, 137},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1072, 288},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str538, 106},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1074, 27},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str540, 144},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1076, 80},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str542, 60},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str543, 181},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str550, 191},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1078, 345},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1081, 12},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1084, 348},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1087, 302},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1092, 99},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1094, 359},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str554, 141},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str562, 60},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str563, 71},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1107, 167},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1110, 201},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1114, 389},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1129, 293},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1133, 174},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str565, 136},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str573, 163},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1135, 106},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1142, 353},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1147, 183},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str576, 8},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str577, 133},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1150, 4},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1151, 112},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1156, 102},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1162, 140},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1170, 144},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str580, 6},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1173, 121},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1179, 72},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str586, 196},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str587, 109},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str588, 146},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str589, 76},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1185, 261},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1186, 136},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str591, 146},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str592, 41},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str593, 86},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str594, 70},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1188, 249},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str596, 164},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str597, 132},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str598, 109},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str599, 164},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1190, 107},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1195, 381},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1196, 331},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str601, 76},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str602, 129},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str605, 183},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1198, 313},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1202, 420},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1212, 409},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str617, 117},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1215, 172},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1219, 406},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1224, 169},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1225, 373},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1229, 156},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1230, 367},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1231, 264},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1244, 407},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1245, 307},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1249, 175},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1253, 187},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str620, 62},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1256, 184},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str623, 33},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1259, 130},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1261, 200},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1262, 205},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str625, 114},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str626, 89},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str627, 24},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str628, 62},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str629, 192},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1264, 326},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1265, 159},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1274, 44},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1279, 257},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str632, 121},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1282, 145},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1289, 126},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1298, 372},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str634, 131},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1300, 129},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str636, 28},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1302, 437},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str640, 114},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1306, 89},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1307, 194},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str643, 133},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str644, 80},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str645, 89},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str646, 83},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str647, 56},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str656, 122},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1310, 115},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str659, 199},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str660, 80},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1313, 360},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1315, 110},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str663, 12},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1318, 138},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1321, 110},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1323, 424},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1328, 144},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1330, 193},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str667, 159},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1334, 177},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1341, 417},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1343, 103},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1344, 433},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1350, 97},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1351, 388},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1354, 349},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1356, 364},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1362, 40},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1372, 422},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str672, 121},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1377, 241},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str675, 31},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1389, 399},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1393, 195},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1396, 138},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str677, 96},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str678, 148},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1398, 167},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1402, 30},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1404, 79},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1411, 274},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1413, 199},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str681, 148},
- {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str686, 131},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str687, 85},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1416, 268},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1422, 199},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1424, 146},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str692, 130},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1429, 147},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1431, 411},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1432, 175},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1435, 231},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1436, 64},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1438, 350},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str696, 46},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1442, 147},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1443, 243},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str701, 0},
- {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str705, 107},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str706, 185},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str707, 99},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str708, 85},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1448, 84},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str710, 128},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str716, 39},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1450, 5},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str718, 160},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str725, 10},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str732, 19},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1452, 336},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1457, 142},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1460, 236},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str734, 116},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str735, 145},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str736, 185},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1462, 275},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1463, 65},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1468, 142},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1478, 380},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1479, 91},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1480, 56},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str739, 25},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1492, 132},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1498, 63},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str745, 32},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1504, 115},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1505, 118},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1506, 103},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1510, 91},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1512, 246},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str749, 64},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1516, 267},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1517, 81},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1519, 139},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1520, 139},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str752, 29},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1523, 318},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1525, 165},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str757, 22},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str765, 52},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1530, 49},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1531, 339},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1536, 440},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1540, 124},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1546, 81},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1548, 198},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1561, 34},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1565, 378},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1566, 165},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1567, 140},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1569, 96},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1571, 228},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1578, 32},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1581, 292},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str767, 101},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str768, 176},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1583, 259},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1590, 20},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1591, 132},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str772, 28},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1595, 30},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1598, 96},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1605, 71},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1606, 177},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1609, 376},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1617, 77},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1620, 90},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str777, 176},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str778, 64},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1634, 270},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1635, 136},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1636, 48},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1643, 286},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1645, 265},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str781, 71},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str782, 103},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1648, 266},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1649, 90},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1658, 233},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1662, 72},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1664, 31},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str788, 189},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1670, 332},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1676, 98},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1683, 324},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1688, 108},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str792, 57},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str793, 103},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1692, 87},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1699, 327},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str795, 30},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1701, 134},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str797, 168},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str806, 199},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1703, 134},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1709, 61},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1724, 104},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1725, 8},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1729, 46},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1732, 100},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1737, 77},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str816, 124},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1759, 322},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str818, 44},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1761, 79},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1780, 375},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1787, 342},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str821, 156},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1790, 122},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str831, 116},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str840, 165},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1829, 291},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str851, 45},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1831, 171},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1835, 363},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1853, 33},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str856, 61},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str857, 123},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1858, 149},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1864, 207},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str861, 118},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1868, 164},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1871, 149},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str868, 37},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1896, 122},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1899, 193},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1900, 225},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str872, 172},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1904, 108},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1917, 104},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1925, 197},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str888, 48},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1932, 191},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1944, 76},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1949, 86},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1970, 86},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str892, 75},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1983, 362},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1988, 70},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2005, 427},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2022, 157},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str898, 63},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2028, 329},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2033, 321},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str902, 173},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str903, 126},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2046, 125},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2051, 343},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2053, 398},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2055, 164},
+ {-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},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str916, 135},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2086, 309},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2087, 22},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2094, 166},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2102, 279},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2119, 271},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2123, 393},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2129, 40},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2130, 442},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str918, 41},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str927, 63},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2141, 180},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2162, 320},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2165, 316},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2178, 191},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2189, 53},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str932, 156},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str940, 84},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2194, 415},
+ {-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}, {-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}, {-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}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2299, 58},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2313, 47},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2322, 48},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2338, 29},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str944, 168},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2342, 45},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str951, 158},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2349, 340},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2371, 181},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2372, 154},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2377, 441},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2379, 119},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2400, 414},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2401, 197},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2413, 248},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str976, 69},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2429, 107},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str980, 47},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2442, 328},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2454, 10},
+ {-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}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str999, 90},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2495, 351},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2515, 62},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1007, 95},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2523, 334},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2542, 29},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2549, 127},
+ {-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}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2588, 127},
+ {-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}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2627, 15},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2651, 338},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2671, 330},
+ {-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}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2710, 301},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2724, 62},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2727, 208},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2737, 181},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2753, 117},
+ {-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2785, 38},
+ {-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}, {-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}, {-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}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1020, 90},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2888, 161},
+ {-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}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2925, 145},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1026, 95},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2940, 337},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2961, 335},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2962, 435},
+ {-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},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1032, 88},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1033, 126},
- {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1037, 135},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2995, 89},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3000, 85},
{-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}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1093, 47},
- {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1097, 106},
{-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},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1124, 153},
+ {-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3104, 76},
+ {-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}, {-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}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1146, 15},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3189, 73},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3197, 117},
+ {-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}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3254, 166},
+ {-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}, {-1}, {-1}, {-1}, {-1},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1148, 144},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3292, 2},
{-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}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1190, 61},
{-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}, {-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3391, 436},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1263, 173},
{-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}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3459, 73},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1329, 2},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3480, 154},
+ {-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}, {-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}, {-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}, {-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}, {-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}, {-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}, {-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},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1347, 72},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1358, 165},
{-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}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1395, 200},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1410, 75},
{-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}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
#endif /* USE_UNICODE_PROPERTIES */
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
#ifndef USE_UNICODE_PROPERTIES
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str6, 12},
{(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str7, 7},
{(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str8, 8},
{(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str9, 1},
{(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str10, 13},
{(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str11, 11},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str12, 0},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str13, 10},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str14, 14},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str15, 3},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str16, 9},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str17, 12},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str18, 6},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str19, 5},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str20, 4},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str21, 2}
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str12, 10},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str13, 14},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str14, 3},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str15, 9},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str16, 6},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str17, 5},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str18, 4},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str19, 2}
#else /* USE_UNICODE_PROPERTIES */
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1463, 72},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1470, 84},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3802, 434},
+ {-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}, {-1}, {-1}, {-1}, {-1},
@@ -23809,17 +28657,15 @@ uniname2ctype_p (str, len)
{-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},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1556, 78},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3922, 74},
{-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}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1621, 153},
{-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},
@@ -23833,8 +28679,18 @@ uniname2ctype_p (str, len)
{-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},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1741, 73}
+ {-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}, {-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}, {-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str4167, 85}
#endif /* USE_UNICODE_PROPERTIES */
};
diff --git a/enc/unicode/name2ctype.h.blt b/enc/unicode/name2ctype.h.blt
index a45ea59a4b..2e80edf525 100644
--- a/enc/unicode/name2ctype.h.blt
+++ b/enc/unicode/name2ctype.h.blt
@@ -36,7 +36,4273 @@ error "gperf generated tables don't work with this execution character set. Plea
#define long size_t
-#ifdef USE_UNICODE_PROPERTIES
+/* 'NEWLINE': [[:NEWLINE:]] */
+static const OnigCodePoint CR_NEWLINE[] = {
+ 1,
+ 0x000a, 0x000a,
+}; /* CR_NEWLINE */
+
+/* 'Alpha': [[:Alpha:]] */
+static const OnigCodePoint CR_Alpha[] = {
+ 540,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0345, 0x0345,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05b0, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0657,
+ 0x0659, 0x065f,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06e1, 0x06e8,
+ 0x06ed, 0x06ef,
+ 0x06fa, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x073f,
+ 0x074d, 0x07b1,
+ 0x07ca, 0x07ea,
+ 0x07f4, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x0817,
+ 0x081a, 0x082c,
+ 0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08e9,
+ 0x08f0, 0x08fe,
+ 0x0900, 0x093b,
+ 0x093d, 0x094c,
+ 0x094e, 0x0950,
+ 0x0955, 0x0963,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bd, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09cc,
+ 0x09ce, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09f0, 0x09f1,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4c,
+ 0x0a51, 0x0a51,
+ 0x0a59, 0x0a5c,
+ 0x0a5e, 0x0a5e,
+ 0x0a70, 0x0a75,
+ 0x0a81, 0x0a83,
+ 0x0a85, 0x0a8d,
+ 0x0a8f, 0x0a91,
+ 0x0a93, 0x0aa8,
+ 0x0aaa, 0x0ab0,
+ 0x0ab2, 0x0ab3,
+ 0x0ab5, 0x0ab9,
+ 0x0abd, 0x0ac5,
+ 0x0ac7, 0x0ac9,
+ 0x0acb, 0x0acc,
+ 0x0ad0, 0x0ad0,
+ 0x0ae0, 0x0ae3,
+ 0x0b01, 0x0b03,
+ 0x0b05, 0x0b0c,
+ 0x0b0f, 0x0b10,
+ 0x0b13, 0x0b28,
+ 0x0b2a, 0x0b30,
+ 0x0b32, 0x0b33,
+ 0x0b35, 0x0b39,
+ 0x0b3d, 0x0b44,
+ 0x0b47, 0x0b48,
+ 0x0b4b, 0x0b4c,
+ 0x0b56, 0x0b57,
+ 0x0b5c, 0x0b5d,
+ 0x0b5f, 0x0b63,
+ 0x0b71, 0x0b71,
+ 0x0b82, 0x0b83,
+ 0x0b85, 0x0b8a,
+ 0x0b8e, 0x0b90,
+ 0x0b92, 0x0b95,
+ 0x0b99, 0x0b9a,
+ 0x0b9c, 0x0b9c,
+ 0x0b9e, 0x0b9f,
+ 0x0ba3, 0x0ba4,
+ 0x0ba8, 0x0baa,
+ 0x0bae, 0x0bb9,
+ 0x0bbe, 0x0bc2,
+ 0x0bc6, 0x0bc8,
+ 0x0bca, 0x0bcc,
+ 0x0bd0, 0x0bd0,
+ 0x0bd7, 0x0bd7,
+ 0x0c01, 0x0c03,
+ 0x0c05, 0x0c0c,
+ 0x0c0e, 0x0c10,
+ 0x0c12, 0x0c28,
+ 0x0c2a, 0x0c33,
+ 0x0c35, 0x0c39,
+ 0x0c3d, 0x0c44,
+ 0x0c46, 0x0c48,
+ 0x0c4a, 0x0c4c,
+ 0x0c55, 0x0c56,
+ 0x0c58, 0x0c59,
+ 0x0c60, 0x0c63,
+ 0x0c82, 0x0c83,
+ 0x0c85, 0x0c8c,
+ 0x0c8e, 0x0c90,
+ 0x0c92, 0x0ca8,
+ 0x0caa, 0x0cb3,
+ 0x0cb5, 0x0cb9,
+ 0x0cbd, 0x0cc4,
+ 0x0cc6, 0x0cc8,
+ 0x0cca, 0x0ccc,
+ 0x0cd5, 0x0cd6,
+ 0x0cde, 0x0cde,
+ 0x0ce0, 0x0ce3,
+ 0x0cf1, 0x0cf2,
+ 0x0d02, 0x0d03,
+ 0x0d05, 0x0d0c,
+ 0x0d0e, 0x0d10,
+ 0x0d12, 0x0d3a,
+ 0x0d3d, 0x0d44,
+ 0x0d46, 0x0d48,
+ 0x0d4a, 0x0d4c,
+ 0x0d4e, 0x0d4e,
+ 0x0d57, 0x0d57,
+ 0x0d60, 0x0d63,
+ 0x0d7a, 0x0d7f,
+ 0x0d82, 0x0d83,
+ 0x0d85, 0x0d96,
+ 0x0d9a, 0x0db1,
+ 0x0db3, 0x0dbb,
+ 0x0dbd, 0x0dbd,
+ 0x0dc0, 0x0dc6,
+ 0x0dcf, 0x0dd4,
+ 0x0dd6, 0x0dd6,
+ 0x0dd8, 0x0ddf,
+ 0x0df2, 0x0df3,
+ 0x0e01, 0x0e3a,
+ 0x0e40, 0x0e46,
+ 0x0e4d, 0x0e4d,
+ 0x0e81, 0x0e82,
+ 0x0e84, 0x0e84,
+ 0x0e87, 0x0e88,
+ 0x0e8a, 0x0e8a,
+ 0x0e8d, 0x0e8d,
+ 0x0e94, 0x0e97,
+ 0x0e99, 0x0e9f,
+ 0x0ea1, 0x0ea3,
+ 0x0ea5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ecd, 0x0ecd,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f00,
+ 0x0f40, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f81,
+ 0x0f88, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x1000, 0x1036,
+ 0x1038, 0x1038,
+ 0x103b, 0x103f,
+ 0x1050, 0x1062,
+ 0x1065, 0x1068,
+ 0x106e, 0x1086,
+ 0x108e, 0x108e,
+ 0x109c, 0x109d,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135f, 0x135f,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1713,
+ 0x1720, 0x1733,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17b3,
+ 0x17b6, 0x17c8,
+ 0x17d7, 0x17d7,
+ 0x17dc, 0x17dc,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x1938,
+ 0x1950, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x1a00, 0x1a1b,
+ 0x1a20, 0x1a5e,
+ 0x1a61, 0x1a74,
+ 0x1aa7, 0x1aa7,
+ 0x1b00, 0x1b33,
+ 0x1b35, 0x1b43,
+ 0x1b45, 0x1b4b,
+ 0x1b80, 0x1ba9,
+ 0x1bac, 0x1baf,
+ 0x1bba, 0x1be5,
+ 0x1be7, 0x1bf1,
+ 0x1c00, 0x1c35,
+ 0x1c4d, 0x1c4f,
+ 0x1c5a, 0x1c7d,
+ 0x1ce9, 0x1cec,
+ 0x1cee, 0x1cf3,
+ 0x1cf5, 0x1cf6,
+ 0x1d00, 0x1dbf,
+ 0x1e00, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fbc,
+ 0x1fbe, 0x1fbe,
+ 0x1fc2, 0x1fc4,
+ 0x1fc6, 0x1fcc,
+ 0x1fd0, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fe0, 0x1fec,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffc,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210a, 0x2113,
+ 0x2115, 0x2115,
+ 0x2119, 0x211d,
+ 0x2124, 0x2124,
+ 0x2126, 0x2126,
+ 0x2128, 0x2128,
+ 0x212a, 0x212d,
+ 0x212f, 0x2139,
+ 0x213c, 0x213f,
+ 0x2145, 0x2149,
+ 0x214e, 0x214e,
+ 0x2160, 0x2188,
+ 0x24b6, 0x24e9,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2ce4,
+ 0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
+ 0x2d6f, 0x2d6f,
+ 0x2d80, 0x2d96,
+ 0x2da0, 0x2da6,
+ 0x2da8, 0x2dae,
+ 0x2db0, 0x2db6,
+ 0x2db8, 0x2dbe,
+ 0x2dc0, 0x2dc6,
+ 0x2dc8, 0x2dce,
+ 0x2dd0, 0x2dd6,
+ 0x2dd8, 0x2dde,
+ 0x2de0, 0x2dff,
+ 0x2e2f, 0x2e2f,
+ 0x3005, 0x3007,
+ 0x3021, 0x3029,
+ 0x3031, 0x3035,
+ 0x3038, 0x303c,
+ 0x3041, 0x3096,
+ 0x309d, 0x309f,
+ 0x30a1, 0x30fa,
+ 0x30fc, 0x30ff,
+ 0x3105, 0x312d,
+ 0x3131, 0x318e,
+ 0x31a0, 0x31ba,
+ 0x31f0, 0x31ff,
+ 0x3400, 0x4db5,
+ 0x4e00, 0x9fcc,
+ 0xa000, 0xa48c,
+ 0xa4d0, 0xa4fd,
+ 0xa500, 0xa60c,
+ 0xa610, 0xa61f,
+ 0xa62a, 0xa62b,
+ 0xa640, 0xa66e,
+ 0xa674, 0xa67b,
+ 0xa67f, 0xa697,
+ 0xa69f, 0xa6ef,
+ 0xa717, 0xa71f,
+ 0xa722, 0xa788,
+ 0xa78b, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa801,
+ 0xa803, 0xa805,
+ 0xa807, 0xa80a,
+ 0xa80c, 0xa827,
+ 0xa840, 0xa873,
+ 0xa880, 0xa8c3,
+ 0xa8f2, 0xa8f7,
+ 0xa8fb, 0xa8fb,
+ 0xa90a, 0xa92a,
+ 0xa930, 0xa952,
+ 0xa960, 0xa97c,
+ 0xa980, 0xa9b2,
+ 0xa9b4, 0xa9bf,
+ 0xa9cf, 0xa9cf,
+ 0xaa00, 0xaa36,
+ 0xaa40, 0xaa4d,
+ 0xaa60, 0xaa76,
+ 0xaa7a, 0xaa7a,
+ 0xaa80, 0xaabe,
+ 0xaac0, 0xaac0,
+ 0xaac2, 0xaac2,
+ 0xaadb, 0xaadd,
+ 0xaae0, 0xaaef,
+ 0xaaf2, 0xaaf5,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabea,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb28,
+ 0xfb2a, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11045,
+ 0x11082, 0x110b8,
+ 0x110d0, 0x110e8,
+ 0x11100, 0x11132,
+ 0x11180, 0x111bf,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116b5,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f93, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Alpha */
+
+/* 'Blank': [[:Blank:]] */
+static const OnigCodePoint CR_Blank[] = {
+ 9,
+ 0x0009, 0x0009,
+ 0x0020, 0x0020,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x180e, 0x180e,
+ 0x2000, 0x200a,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Blank */
+
+/* 'Cntrl': [[:Cntrl:]] */
+static const OnigCodePoint CR_Cntrl[] = {
+ 2,
+ 0x0000, 0x001f,
+ 0x007f, 0x009f,
+}; /* CR_Cntrl */
+
+/* 'Digit': [[:Digit:]] */
+static const OnigCodePoint CR_Digit[] = {
+ 42,
+ 0x0030, 0x0039,
+ 0x0660, 0x0669,
+ 0x06f0, 0x06f9,
+ 0x07c0, 0x07c9,
+ 0x0966, 0x096f,
+ 0x09e6, 0x09ef,
+ 0x0a66, 0x0a6f,
+ 0x0ae6, 0x0aef,
+ 0x0b66, 0x0b6f,
+ 0x0be6, 0x0bef,
+ 0x0c66, 0x0c6f,
+ 0x0ce6, 0x0cef,
+ 0x0d66, 0x0d6f,
+ 0x0e50, 0x0e59,
+ 0x0ed0, 0x0ed9,
+ 0x0f20, 0x0f29,
+ 0x1040, 0x1049,
+ 0x1090, 0x1099,
+ 0x17e0, 0x17e9,
+ 0x1810, 0x1819,
+ 0x1946, 0x194f,
+ 0x19d0, 0x19d9,
+ 0x1a80, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1b50, 0x1b59,
+ 0x1bb0, 0x1bb9,
+ 0x1c40, 0x1c49,
+ 0x1c50, 0x1c59,
+ 0xa620, 0xa629,
+ 0xa8d0, 0xa8d9,
+ 0xa900, 0xa909,
+ 0xa9d0, 0xa9d9,
+ 0xaa50, 0xaa59,
+ 0xabf0, 0xabf9,
+ 0xff10, 0xff19,
+ 0x104a0, 0x104a9,
+ 0x11066, 0x1106f,
+ 0x110f0, 0x110f9,
+ 0x11136, 0x1113f,
+ 0x111d0, 0x111d9,
+ 0x116c0, 0x116c9,
+ 0x1d7ce, 0x1d7ff,
+}; /* CR_Digit */
+
+/* 'Graph': [[:Graph:]] */
+static const OnigCodePoint CR_Graph[] = {
+ 544,
+ 0x0021, 0x007e,
+ 0x00a1, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x058f, 0x058f,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0604,
+ 0x0606, 0x061b,
+ 0x061e, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09fb,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3c, 0x0a3c,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4d,
+ 0x0a51, 0x0a51,
+ 0x0a59, 0x0a5c,
+ 0x0a5e, 0x0a5e,
+ 0x0a66, 0x0a75,
+ 0x0a81, 0x0a83,
+ 0x0a85, 0x0a8d,
+ 0x0a8f, 0x0a91,
+ 0x0a93, 0x0aa8,
+ 0x0aaa, 0x0ab0,
+ 0x0ab2, 0x0ab3,
+ 0x0ab5, 0x0ab9,
+ 0x0abc, 0x0ac5,
+ 0x0ac7, 0x0ac9,
+ 0x0acb, 0x0acd,
+ 0x0ad0, 0x0ad0,
+ 0x0ae0, 0x0ae3,
+ 0x0ae6, 0x0af1,
+ 0x0b01, 0x0b03,
+ 0x0b05, 0x0b0c,
+ 0x0b0f, 0x0b10,
+ 0x0b13, 0x0b28,
+ 0x0b2a, 0x0b30,
+ 0x0b32, 0x0b33,
+ 0x0b35, 0x0b39,
+ 0x0b3c, 0x0b44,
+ 0x0b47, 0x0b48,
+ 0x0b4b, 0x0b4d,
+ 0x0b56, 0x0b57,
+ 0x0b5c, 0x0b5d,
+ 0x0b5f, 0x0b63,
+ 0x0b66, 0x0b77,
+ 0x0b82, 0x0b83,
+ 0x0b85, 0x0b8a,
+ 0x0b8e, 0x0b90,
+ 0x0b92, 0x0b95,
+ 0x0b99, 0x0b9a,
+ 0x0b9c, 0x0b9c,
+ 0x0b9e, 0x0b9f,
+ 0x0ba3, 0x0ba4,
+ 0x0ba8, 0x0baa,
+ 0x0bae, 0x0bb9,
+ 0x0bbe, 0x0bc2,
+ 0x0bc6, 0x0bc8,
+ 0x0bca, 0x0bcd,
+ 0x0bd0, 0x0bd0,
+ 0x0bd7, 0x0bd7,
+ 0x0be6, 0x0bfa,
+ 0x0c01, 0x0c03,
+ 0x0c05, 0x0c0c,
+ 0x0c0e, 0x0c10,
+ 0x0c12, 0x0c28,
+ 0x0c2a, 0x0c33,
+ 0x0c35, 0x0c39,
+ 0x0c3d, 0x0c44,
+ 0x0c46, 0x0c48,
+ 0x0c4a, 0x0c4d,
+ 0x0c55, 0x0c56,
+ 0x0c58, 0x0c59,
+ 0x0c60, 0x0c63,
+ 0x0c66, 0x0c6f,
+ 0x0c78, 0x0c7f,
+ 0x0c82, 0x0c83,
+ 0x0c85, 0x0c8c,
+ 0x0c8e, 0x0c90,
+ 0x0c92, 0x0ca8,
+ 0x0caa, 0x0cb3,
+ 0x0cb5, 0x0cb9,
+ 0x0cbc, 0x0cc4,
+ 0x0cc6, 0x0cc8,
+ 0x0cca, 0x0ccd,
+ 0x0cd5, 0x0cd6,
+ 0x0cde, 0x0cde,
+ 0x0ce0, 0x0ce3,
+ 0x0ce6, 0x0cef,
+ 0x0cf1, 0x0cf2,
+ 0x0d02, 0x0d03,
+ 0x0d05, 0x0d0c,
+ 0x0d0e, 0x0d10,
+ 0x0d12, 0x0d3a,
+ 0x0d3d, 0x0d44,
+ 0x0d46, 0x0d48,
+ 0x0d4a, 0x0d4e,
+ 0x0d57, 0x0d57,
+ 0x0d60, 0x0d63,
+ 0x0d66, 0x0d75,
+ 0x0d79, 0x0d7f,
+ 0x0d82, 0x0d83,
+ 0x0d85, 0x0d96,
+ 0x0d9a, 0x0db1,
+ 0x0db3, 0x0dbb,
+ 0x0dbd, 0x0dbd,
+ 0x0dc0, 0x0dc6,
+ 0x0dca, 0x0dca,
+ 0x0dcf, 0x0dd4,
+ 0x0dd6, 0x0dd6,
+ 0x0dd8, 0x0ddf,
+ 0x0df2, 0x0df4,
+ 0x0e01, 0x0e3a,
+ 0x0e3f, 0x0e5b,
+ 0x0e81, 0x0e82,
+ 0x0e84, 0x0e84,
+ 0x0e87, 0x0e88,
+ 0x0e8a, 0x0e8a,
+ 0x0e8d, 0x0e8d,
+ 0x0e94, 0x0e97,
+ 0x0e99, 0x0e9f,
+ 0x0ea1, 0x0ea3,
+ 0x0ea5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ec8, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fbe, 0x0fcc,
+ 0x0fce, 0x0fda,
+ 0x1000, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135d, 0x137c,
+ 0x1380, 0x1399,
+ 0x13a0, 0x13f4,
+ 0x1400, 0x167f,
+ 0x1681, 0x169c,
+ 0x16a0, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+ 0x1720, 0x1736,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17dd,
+ 0x17e0, 0x17e9,
+ 0x17f0, 0x17f9,
+ 0x1800, 0x180d,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1940, 0x1940,
+ 0x1944, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19da,
+ 0x19de, 0x1a1b,
+ 0x1a1e, 0x1a5e,
+ 0x1a60, 0x1a7c,
+ 0x1a7f, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa0, 0x1aad,
+ 0x1b00, 0x1b4b,
+ 0x1b50, 0x1b7c,
+ 0x1b80, 0x1bf3,
+ 0x1bfc, 0x1c37,
+ 0x1c3b, 0x1c49,
+ 0x1c4d, 0x1c7f,
+ 0x1cc0, 0x1cc7,
+ 0x1cd0, 0x1cf6,
+ 0x1d00, 0x1de6,
+ 0x1dfc, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fc4,
+ 0x1fc6, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fdd, 0x1fef,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffe,
+ 0x200b, 0x2027,
+ 0x202a, 0x202e,
+ 0x2030, 0x205e,
+ 0x2060, 0x2064,
+ 0x206a, 0x2071,
+ 0x2074, 0x208e,
+ 0x2090, 0x209c,
+ 0x20a0, 0x20b9,
+ 0x20d0, 0x20f0,
+ 0x2100, 0x2189,
+ 0x2190, 0x23f3,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x2460, 0x26ff,
+ 0x2701, 0x2b4c,
+ 0x2b50, 0x2b59,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2cf3,
+ 0x2cf9, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
+ 0x2d6f, 0x2d70,
+ 0x2d7f, 0x2d96,
+ 0x2da0, 0x2da6,
+ 0x2da8, 0x2dae,
+ 0x2db0, 0x2db6,
+ 0x2db8, 0x2dbe,
+ 0x2dc0, 0x2dc6,
+ 0x2dc8, 0x2dce,
+ 0x2dd0, 0x2dd6,
+ 0x2dd8, 0x2dde,
+ 0x2de0, 0x2e3b,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+ 0x2ff0, 0x2ffb,
+ 0x3001, 0x303f,
+ 0x3041, 0x3096,
+ 0x3099, 0x30ff,
+ 0x3105, 0x312d,
+ 0x3131, 0x318e,
+ 0x3190, 0x31ba,
+ 0x31c0, 0x31e3,
+ 0x31f0, 0x321e,
+ 0x3220, 0x32fe,
+ 0x3300, 0x4db5,
+ 0x4dc0, 0x9fcc,
+ 0xa000, 0xa48c,
+ 0xa490, 0xa4c6,
+ 0xa4d0, 0xa62b,
+ 0xa640, 0xa697,
+ 0xa69f, 0xa6f7,
+ 0xa700, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa82b,
+ 0xa830, 0xa839,
+ 0xa840, 0xa877,
+ 0xa880, 0xa8c4,
+ 0xa8ce, 0xa8d9,
+ 0xa8e0, 0xa8fb,
+ 0xa900, 0xa953,
+ 0xa95f, 0xa97c,
+ 0xa980, 0xa9cd,
+ 0xa9cf, 0xa9d9,
+ 0xa9de, 0xa9df,
+ 0xaa00, 0xaa36,
+ 0xaa40, 0xaa4d,
+ 0xaa50, 0xaa59,
+ 0xaa5c, 0xaa7b,
+ 0xaa80, 0xaac2,
+ 0xaadb, 0xaaf6,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabed,
+ 0xabf0, 0xabf9,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xe000, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbc1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfd,
+ 0xfe00, 0xfe19,
+ 0xfe20, 0xfe26,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xfeff, 0xfeff,
+ 0xff01, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfff9, 0xfffd,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1018a,
+ 0x10190, 0x1019b,
+ 0x101d0, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x103c3,
+ 0x103c8, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10857, 0x1085f,
+ 0x10900, 0x1091b,
+ 0x1091f, 0x10939,
+ 0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x10a60, 0x10a7f,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b7f,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x11080, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d1dd,
+ 0x1d200, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1d360, 0x1d371,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
+ 0x1f000, 0x1f02b,
+ 0x1f030, 0x1f093,
+ 0x1f0a0, 0x1f0ae,
+ 0x1f0b1, 0x1f0be,
+ 0x1f0c1, 0x1f0cf,
+ 0x1f0d1, 0x1f0df,
+ 0x1f100, 0x1f10a,
+ 0x1f110, 0x1f12e,
+ 0x1f130, 0x1f16b,
+ 0x1f170, 0x1f19a,
+ 0x1f1e6, 0x1f202,
+ 0x1f210, 0x1f23a,
+ 0x1f240, 0x1f248,
+ 0x1f250, 0x1f251,
+ 0x1f300, 0x1f320,
+ 0x1f330, 0x1f335,
+ 0x1f337, 0x1f37c,
+ 0x1f380, 0x1f393,
+ 0x1f3a0, 0x1f3c4,
+ 0x1f3c6, 0x1f3ca,
+ 0x1f3e0, 0x1f3f0,
+ 0x1f400, 0x1f43e,
+ 0x1f440, 0x1f440,
+ 0x1f442, 0x1f4f7,
+ 0x1f4f9, 0x1f4fc,
+ 0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
+ 0x1f550, 0x1f567,
+ 0x1f5fb, 0x1f640,
+ 0x1f645, 0x1f64f,
+ 0x1f680, 0x1f6c5,
+ 0x1f700, 0x1f773,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+ 0xf0000, 0xffffd,
+ 0x100000, 0x10fffd,
+}; /* CR_Graph */
+
+/* 'Lower': [[:Lower:]] */
+static const OnigCodePoint CR_Lower[] = {
+ 618,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00df, 0x00f6,
+ 0x00f8, 0x00ff,
+ 0x0101, 0x0101,
+ 0x0103, 0x0103,
+ 0x0105, 0x0105,
+ 0x0107, 0x0107,
+ 0x0109, 0x0109,
+ 0x010b, 0x010b,
+ 0x010d, 0x010d,
+ 0x010f, 0x010f,
+ 0x0111, 0x0111,
+ 0x0113, 0x0113,
+ 0x0115, 0x0115,
+ 0x0117, 0x0117,
+ 0x0119, 0x0119,
+ 0x011b, 0x011b,
+ 0x011d, 0x011d,
+ 0x011f, 0x011f,
+ 0x0121, 0x0121,
+ 0x0123, 0x0123,
+ 0x0125, 0x0125,
+ 0x0127, 0x0127,
+ 0x0129, 0x0129,
+ 0x012b, 0x012b,
+ 0x012d, 0x012d,
+ 0x012f, 0x012f,
+ 0x0131, 0x0131,
+ 0x0133, 0x0133,
+ 0x0135, 0x0135,
+ 0x0137, 0x0138,
+ 0x013a, 0x013a,
+ 0x013c, 0x013c,
+ 0x013e, 0x013e,
+ 0x0140, 0x0140,
+ 0x0142, 0x0142,
+ 0x0144, 0x0144,
+ 0x0146, 0x0146,
+ 0x0148, 0x0149,
+ 0x014b, 0x014b,
+ 0x014d, 0x014d,
+ 0x014f, 0x014f,
+ 0x0151, 0x0151,
+ 0x0153, 0x0153,
+ 0x0155, 0x0155,
+ 0x0157, 0x0157,
+ 0x0159, 0x0159,
+ 0x015b, 0x015b,
+ 0x015d, 0x015d,
+ 0x015f, 0x015f,
+ 0x0161, 0x0161,
+ 0x0163, 0x0163,
+ 0x0165, 0x0165,
+ 0x0167, 0x0167,
+ 0x0169, 0x0169,
+ 0x016b, 0x016b,
+ 0x016d, 0x016d,
+ 0x016f, 0x016f,
+ 0x0171, 0x0171,
+ 0x0173, 0x0173,
+ 0x0175, 0x0175,
+ 0x0177, 0x0177,
+ 0x017a, 0x017a,
+ 0x017c, 0x017c,
+ 0x017e, 0x0180,
+ 0x0183, 0x0183,
+ 0x0185, 0x0185,
+ 0x0188, 0x0188,
+ 0x018c, 0x018d,
+ 0x0192, 0x0192,
+ 0x0195, 0x0195,
+ 0x0199, 0x019b,
+ 0x019e, 0x019e,
+ 0x01a1, 0x01a1,
+ 0x01a3, 0x01a3,
+ 0x01a5, 0x01a5,
+ 0x01a8, 0x01a8,
+ 0x01aa, 0x01ab,
+ 0x01ad, 0x01ad,
+ 0x01b0, 0x01b0,
+ 0x01b4, 0x01b4,
+ 0x01b6, 0x01b6,
+ 0x01b9, 0x01ba,
+ 0x01bd, 0x01bf,
+ 0x01c6, 0x01c6,
+ 0x01c9, 0x01c9,
+ 0x01cc, 0x01cc,
+ 0x01ce, 0x01ce,
+ 0x01d0, 0x01d0,
+ 0x01d2, 0x01d2,
+ 0x01d4, 0x01d4,
+ 0x01d6, 0x01d6,
+ 0x01d8, 0x01d8,
+ 0x01da, 0x01da,
+ 0x01dc, 0x01dd,
+ 0x01df, 0x01df,
+ 0x01e1, 0x01e1,
+ 0x01e3, 0x01e3,
+ 0x01e5, 0x01e5,
+ 0x01e7, 0x01e7,
+ 0x01e9, 0x01e9,
+ 0x01eb, 0x01eb,
+ 0x01ed, 0x01ed,
+ 0x01ef, 0x01f0,
+ 0x01f3, 0x01f3,
+ 0x01f5, 0x01f5,
+ 0x01f9, 0x01f9,
+ 0x01fb, 0x01fb,
+ 0x01fd, 0x01fd,
+ 0x01ff, 0x01ff,
+ 0x0201, 0x0201,
+ 0x0203, 0x0203,
+ 0x0205, 0x0205,
+ 0x0207, 0x0207,
+ 0x0209, 0x0209,
+ 0x020b, 0x020b,
+ 0x020d, 0x020d,
+ 0x020f, 0x020f,
+ 0x0211, 0x0211,
+ 0x0213, 0x0213,
+ 0x0215, 0x0215,
+ 0x0217, 0x0217,
+ 0x0219, 0x0219,
+ 0x021b, 0x021b,
+ 0x021d, 0x021d,
+ 0x021f, 0x021f,
+ 0x0221, 0x0221,
+ 0x0223, 0x0223,
+ 0x0225, 0x0225,
+ 0x0227, 0x0227,
+ 0x0229, 0x0229,
+ 0x022b, 0x022b,
+ 0x022d, 0x022d,
+ 0x022f, 0x022f,
+ 0x0231, 0x0231,
+ 0x0233, 0x0239,
+ 0x023c, 0x023c,
+ 0x023f, 0x0240,
+ 0x0242, 0x0242,
+ 0x0247, 0x0247,
+ 0x0249, 0x0249,
+ 0x024b, 0x024b,
+ 0x024d, 0x024d,
+ 0x024f, 0x0293,
+ 0x0295, 0x02b8,
+ 0x02c0, 0x02c1,
+ 0x02e0, 0x02e4,
+ 0x0345, 0x0345,
+ 0x0371, 0x0371,
+ 0x0373, 0x0373,
+ 0x0377, 0x0377,
+ 0x037a, 0x037d,
+ 0x0390, 0x0390,
+ 0x03ac, 0x03ce,
+ 0x03d0, 0x03d1,
+ 0x03d5, 0x03d7,
+ 0x03d9, 0x03d9,
+ 0x03db, 0x03db,
+ 0x03dd, 0x03dd,
+ 0x03df, 0x03df,
+ 0x03e1, 0x03e1,
+ 0x03e3, 0x03e3,
+ 0x03e5, 0x03e5,
+ 0x03e7, 0x03e7,
+ 0x03e9, 0x03e9,
+ 0x03eb, 0x03eb,
+ 0x03ed, 0x03ed,
+ 0x03ef, 0x03f3,
+ 0x03f5, 0x03f5,
+ 0x03f8, 0x03f8,
+ 0x03fb, 0x03fc,
+ 0x0430, 0x045f,
+ 0x0461, 0x0461,
+ 0x0463, 0x0463,
+ 0x0465, 0x0465,
+ 0x0467, 0x0467,
+ 0x0469, 0x0469,
+ 0x046b, 0x046b,
+ 0x046d, 0x046d,
+ 0x046f, 0x046f,
+ 0x0471, 0x0471,
+ 0x0473, 0x0473,
+ 0x0475, 0x0475,
+ 0x0477, 0x0477,
+ 0x0479, 0x0479,
+ 0x047b, 0x047b,
+ 0x047d, 0x047d,
+ 0x047f, 0x047f,
+ 0x0481, 0x0481,
+ 0x048b, 0x048b,
+ 0x048d, 0x048d,
+ 0x048f, 0x048f,
+ 0x0491, 0x0491,
+ 0x0493, 0x0493,
+ 0x0495, 0x0495,
+ 0x0497, 0x0497,
+ 0x0499, 0x0499,
+ 0x049b, 0x049b,
+ 0x049d, 0x049d,
+ 0x049f, 0x049f,
+ 0x04a1, 0x04a1,
+ 0x04a3, 0x04a3,
+ 0x04a5, 0x04a5,
+ 0x04a7, 0x04a7,
+ 0x04a9, 0x04a9,
+ 0x04ab, 0x04ab,
+ 0x04ad, 0x04ad,
+ 0x04af, 0x04af,
+ 0x04b1, 0x04b1,
+ 0x04b3, 0x04b3,
+ 0x04b5, 0x04b5,
+ 0x04b7, 0x04b7,
+ 0x04b9, 0x04b9,
+ 0x04bb, 0x04bb,
+ 0x04bd, 0x04bd,
+ 0x04bf, 0x04bf,
+ 0x04c2, 0x04c2,
+ 0x04c4, 0x04c4,
+ 0x04c6, 0x04c6,
+ 0x04c8, 0x04c8,
+ 0x04ca, 0x04ca,
+ 0x04cc, 0x04cc,
+ 0x04ce, 0x04cf,
+ 0x04d1, 0x04d1,
+ 0x04d3, 0x04d3,
+ 0x04d5, 0x04d5,
+ 0x04d7, 0x04d7,
+ 0x04d9, 0x04d9,
+ 0x04db, 0x04db,
+ 0x04dd, 0x04dd,
+ 0x04df, 0x04df,
+ 0x04e1, 0x04e1,
+ 0x04e3, 0x04e3,
+ 0x04e5, 0x04e5,
+ 0x04e7, 0x04e7,
+ 0x04e9, 0x04e9,
+ 0x04eb, 0x04eb,
+ 0x04ed, 0x04ed,
+ 0x04ef, 0x04ef,
+ 0x04f1, 0x04f1,
+ 0x04f3, 0x04f3,
+ 0x04f5, 0x04f5,
+ 0x04f7, 0x04f7,
+ 0x04f9, 0x04f9,
+ 0x04fb, 0x04fb,
+ 0x04fd, 0x04fd,
+ 0x04ff, 0x04ff,
+ 0x0501, 0x0501,
+ 0x0503, 0x0503,
+ 0x0505, 0x0505,
+ 0x0507, 0x0507,
+ 0x0509, 0x0509,
+ 0x050b, 0x050b,
+ 0x050d, 0x050d,
+ 0x050f, 0x050f,
+ 0x0511, 0x0511,
+ 0x0513, 0x0513,
+ 0x0515, 0x0515,
+ 0x0517, 0x0517,
+ 0x0519, 0x0519,
+ 0x051b, 0x051b,
+ 0x051d, 0x051d,
+ 0x051f, 0x051f,
+ 0x0521, 0x0521,
+ 0x0523, 0x0523,
+ 0x0525, 0x0525,
+ 0x0527, 0x0527,
+ 0x0561, 0x0587,
+ 0x1d00, 0x1dbf,
+ 0x1e01, 0x1e01,
+ 0x1e03, 0x1e03,
+ 0x1e05, 0x1e05,
+ 0x1e07, 0x1e07,
+ 0x1e09, 0x1e09,
+ 0x1e0b, 0x1e0b,
+ 0x1e0d, 0x1e0d,
+ 0x1e0f, 0x1e0f,
+ 0x1e11, 0x1e11,
+ 0x1e13, 0x1e13,
+ 0x1e15, 0x1e15,
+ 0x1e17, 0x1e17,
+ 0x1e19, 0x1e19,
+ 0x1e1b, 0x1e1b,
+ 0x1e1d, 0x1e1d,
+ 0x1e1f, 0x1e1f,
+ 0x1e21, 0x1e21,
+ 0x1e23, 0x1e23,
+ 0x1e25, 0x1e25,
+ 0x1e27, 0x1e27,
+ 0x1e29, 0x1e29,
+ 0x1e2b, 0x1e2b,
+ 0x1e2d, 0x1e2d,
+ 0x1e2f, 0x1e2f,
+ 0x1e31, 0x1e31,
+ 0x1e33, 0x1e33,
+ 0x1e35, 0x1e35,
+ 0x1e37, 0x1e37,
+ 0x1e39, 0x1e39,
+ 0x1e3b, 0x1e3b,
+ 0x1e3d, 0x1e3d,
+ 0x1e3f, 0x1e3f,
+ 0x1e41, 0x1e41,
+ 0x1e43, 0x1e43,
+ 0x1e45, 0x1e45,
+ 0x1e47, 0x1e47,
+ 0x1e49, 0x1e49,
+ 0x1e4b, 0x1e4b,
+ 0x1e4d, 0x1e4d,
+ 0x1e4f, 0x1e4f,
+ 0x1e51, 0x1e51,
+ 0x1e53, 0x1e53,
+ 0x1e55, 0x1e55,
+ 0x1e57, 0x1e57,
+ 0x1e59, 0x1e59,
+ 0x1e5b, 0x1e5b,
+ 0x1e5d, 0x1e5d,
+ 0x1e5f, 0x1e5f,
+ 0x1e61, 0x1e61,
+ 0x1e63, 0x1e63,
+ 0x1e65, 0x1e65,
+ 0x1e67, 0x1e67,
+ 0x1e69, 0x1e69,
+ 0x1e6b, 0x1e6b,
+ 0x1e6d, 0x1e6d,
+ 0x1e6f, 0x1e6f,
+ 0x1e71, 0x1e71,
+ 0x1e73, 0x1e73,
+ 0x1e75, 0x1e75,
+ 0x1e77, 0x1e77,
+ 0x1e79, 0x1e79,
+ 0x1e7b, 0x1e7b,
+ 0x1e7d, 0x1e7d,
+ 0x1e7f, 0x1e7f,
+ 0x1e81, 0x1e81,
+ 0x1e83, 0x1e83,
+ 0x1e85, 0x1e85,
+ 0x1e87, 0x1e87,
+ 0x1e89, 0x1e89,
+ 0x1e8b, 0x1e8b,
+ 0x1e8d, 0x1e8d,
+ 0x1e8f, 0x1e8f,
+ 0x1e91, 0x1e91,
+ 0x1e93, 0x1e93,
+ 0x1e95, 0x1e9d,
+ 0x1e9f, 0x1e9f,
+ 0x1ea1, 0x1ea1,
+ 0x1ea3, 0x1ea3,
+ 0x1ea5, 0x1ea5,
+ 0x1ea7, 0x1ea7,
+ 0x1ea9, 0x1ea9,
+ 0x1eab, 0x1eab,
+ 0x1ead, 0x1ead,
+ 0x1eaf, 0x1eaf,
+ 0x1eb1, 0x1eb1,
+ 0x1eb3, 0x1eb3,
+ 0x1eb5, 0x1eb5,
+ 0x1eb7, 0x1eb7,
+ 0x1eb9, 0x1eb9,
+ 0x1ebb, 0x1ebb,
+ 0x1ebd, 0x1ebd,
+ 0x1ebf, 0x1ebf,
+ 0x1ec1, 0x1ec1,
+ 0x1ec3, 0x1ec3,
+ 0x1ec5, 0x1ec5,
+ 0x1ec7, 0x1ec7,
+ 0x1ec9, 0x1ec9,
+ 0x1ecb, 0x1ecb,
+ 0x1ecd, 0x1ecd,
+ 0x1ecf, 0x1ecf,
+ 0x1ed1, 0x1ed1,
+ 0x1ed3, 0x1ed3,
+ 0x1ed5, 0x1ed5,
+ 0x1ed7, 0x1ed7,
+ 0x1ed9, 0x1ed9,
+ 0x1edb, 0x1edb,
+ 0x1edd, 0x1edd,
+ 0x1edf, 0x1edf,
+ 0x1ee1, 0x1ee1,
+ 0x1ee3, 0x1ee3,
+ 0x1ee5, 0x1ee5,
+ 0x1ee7, 0x1ee7,
+ 0x1ee9, 0x1ee9,
+ 0x1eeb, 0x1eeb,
+ 0x1eed, 0x1eed,
+ 0x1eef, 0x1eef,
+ 0x1ef1, 0x1ef1,
+ 0x1ef3, 0x1ef3,
+ 0x1ef5, 0x1ef5,
+ 0x1ef7, 0x1ef7,
+ 0x1ef9, 0x1ef9,
+ 0x1efb, 0x1efb,
+ 0x1efd, 0x1efd,
+ 0x1eff, 0x1f07,
+ 0x1f10, 0x1f15,
+ 0x1f20, 0x1f27,
+ 0x1f30, 0x1f37,
+ 0x1f40, 0x1f45,
+ 0x1f50, 0x1f57,
+ 0x1f60, 0x1f67,
+ 0x1f70, 0x1f7d,
+ 0x1f80, 0x1f87,
+ 0x1f90, 0x1f97,
+ 0x1fa0, 0x1fa7,
+ 0x1fb0, 0x1fb4,
+ 0x1fb6, 0x1fb7,
+ 0x1fbe, 0x1fbe,
+ 0x1fc2, 0x1fc4,
+ 0x1fc6, 0x1fc7,
+ 0x1fd0, 0x1fd3,
+ 0x1fd6, 0x1fd7,
+ 0x1fe0, 0x1fe7,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ff7,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x210a, 0x210a,
+ 0x210e, 0x210f,
+ 0x2113, 0x2113,
+ 0x212f, 0x212f,
+ 0x2134, 0x2134,
+ 0x2139, 0x2139,
+ 0x213c, 0x213d,
+ 0x2146, 0x2149,
+ 0x214e, 0x214e,
+ 0x2170, 0x217f,
+ 0x2184, 0x2184,
+ 0x24d0, 0x24e9,
+ 0x2c30, 0x2c5e,
+ 0x2c61, 0x2c61,
+ 0x2c65, 0x2c66,
+ 0x2c68, 0x2c68,
+ 0x2c6a, 0x2c6a,
+ 0x2c6c, 0x2c6c,
+ 0x2c71, 0x2c71,
+ 0x2c73, 0x2c74,
+ 0x2c76, 0x2c7d,
+ 0x2c81, 0x2c81,
+ 0x2c83, 0x2c83,
+ 0x2c85, 0x2c85,
+ 0x2c87, 0x2c87,
+ 0x2c89, 0x2c89,
+ 0x2c8b, 0x2c8b,
+ 0x2c8d, 0x2c8d,
+ 0x2c8f, 0x2c8f,
+ 0x2c91, 0x2c91,
+ 0x2c93, 0x2c93,
+ 0x2c95, 0x2c95,
+ 0x2c97, 0x2c97,
+ 0x2c99, 0x2c99,
+ 0x2c9b, 0x2c9b,
+ 0x2c9d, 0x2c9d,
+ 0x2c9f, 0x2c9f,
+ 0x2ca1, 0x2ca1,
+ 0x2ca3, 0x2ca3,
+ 0x2ca5, 0x2ca5,
+ 0x2ca7, 0x2ca7,
+ 0x2ca9, 0x2ca9,
+ 0x2cab, 0x2cab,
+ 0x2cad, 0x2cad,
+ 0x2caf, 0x2caf,
+ 0x2cb1, 0x2cb1,
+ 0x2cb3, 0x2cb3,
+ 0x2cb5, 0x2cb5,
+ 0x2cb7, 0x2cb7,
+ 0x2cb9, 0x2cb9,
+ 0x2cbb, 0x2cbb,
+ 0x2cbd, 0x2cbd,
+ 0x2cbf, 0x2cbf,
+ 0x2cc1, 0x2cc1,
+ 0x2cc3, 0x2cc3,
+ 0x2cc5, 0x2cc5,
+ 0x2cc7, 0x2cc7,
+ 0x2cc9, 0x2cc9,
+ 0x2ccb, 0x2ccb,
+ 0x2ccd, 0x2ccd,
+ 0x2ccf, 0x2ccf,
+ 0x2cd1, 0x2cd1,
+ 0x2cd3, 0x2cd3,
+ 0x2cd5, 0x2cd5,
+ 0x2cd7, 0x2cd7,
+ 0x2cd9, 0x2cd9,
+ 0x2cdb, 0x2cdb,
+ 0x2cdd, 0x2cdd,
+ 0x2cdf, 0x2cdf,
+ 0x2ce1, 0x2ce1,
+ 0x2ce3, 0x2ce4,
+ 0x2cec, 0x2cec,
+ 0x2cee, 0x2cee,
+ 0x2cf3, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0xa641, 0xa641,
+ 0xa643, 0xa643,
+ 0xa645, 0xa645,
+ 0xa647, 0xa647,
+ 0xa649, 0xa649,
+ 0xa64b, 0xa64b,
+ 0xa64d, 0xa64d,
+ 0xa64f, 0xa64f,
+ 0xa651, 0xa651,
+ 0xa653, 0xa653,
+ 0xa655, 0xa655,
+ 0xa657, 0xa657,
+ 0xa659, 0xa659,
+ 0xa65b, 0xa65b,
+ 0xa65d, 0xa65d,
+ 0xa65f, 0xa65f,
+ 0xa661, 0xa661,
+ 0xa663, 0xa663,
+ 0xa665, 0xa665,
+ 0xa667, 0xa667,
+ 0xa669, 0xa669,
+ 0xa66b, 0xa66b,
+ 0xa66d, 0xa66d,
+ 0xa681, 0xa681,
+ 0xa683, 0xa683,
+ 0xa685, 0xa685,
+ 0xa687, 0xa687,
+ 0xa689, 0xa689,
+ 0xa68b, 0xa68b,
+ 0xa68d, 0xa68d,
+ 0xa68f, 0xa68f,
+ 0xa691, 0xa691,
+ 0xa693, 0xa693,
+ 0xa695, 0xa695,
+ 0xa697, 0xa697,
+ 0xa723, 0xa723,
+ 0xa725, 0xa725,
+ 0xa727, 0xa727,
+ 0xa729, 0xa729,
+ 0xa72b, 0xa72b,
+ 0xa72d, 0xa72d,
+ 0xa72f, 0xa731,
+ 0xa733, 0xa733,
+ 0xa735, 0xa735,
+ 0xa737, 0xa737,
+ 0xa739, 0xa739,
+ 0xa73b, 0xa73b,
+ 0xa73d, 0xa73d,
+ 0xa73f, 0xa73f,
+ 0xa741, 0xa741,
+ 0xa743, 0xa743,
+ 0xa745, 0xa745,
+ 0xa747, 0xa747,
+ 0xa749, 0xa749,
+ 0xa74b, 0xa74b,
+ 0xa74d, 0xa74d,
+ 0xa74f, 0xa74f,
+ 0xa751, 0xa751,
+ 0xa753, 0xa753,
+ 0xa755, 0xa755,
+ 0xa757, 0xa757,
+ 0xa759, 0xa759,
+ 0xa75b, 0xa75b,
+ 0xa75d, 0xa75d,
+ 0xa75f, 0xa75f,
+ 0xa761, 0xa761,
+ 0xa763, 0xa763,
+ 0xa765, 0xa765,
+ 0xa767, 0xa767,
+ 0xa769, 0xa769,
+ 0xa76b, 0xa76b,
+ 0xa76d, 0xa76d,
+ 0xa76f, 0xa778,
+ 0xa77a, 0xa77a,
+ 0xa77c, 0xa77c,
+ 0xa77f, 0xa77f,
+ 0xa781, 0xa781,
+ 0xa783, 0xa783,
+ 0xa785, 0xa785,
+ 0xa787, 0xa787,
+ 0xa78c, 0xa78c,
+ 0xa78e, 0xa78e,
+ 0xa791, 0xa791,
+ 0xa793, 0xa793,
+ 0xa7a1, 0xa7a1,
+ 0xa7a3, 0xa7a3,
+ 0xa7a5, 0xa7a5,
+ 0xa7a7, 0xa7a7,
+ 0xa7a9, 0xa7a9,
+ 0xa7f8, 0xa7fa,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff41, 0xff5a,
+ 0x10428, 0x1044f,
+ 0x1d41a, 0x1d433,
+ 0x1d44e, 0x1d454,
+ 0x1d456, 0x1d467,
+ 0x1d482, 0x1d49b,
+ 0x1d4b6, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d4cf,
+ 0x1d4ea, 0x1d503,
+ 0x1d51e, 0x1d537,
+ 0x1d552, 0x1d56b,
+ 0x1d586, 0x1d59f,
+ 0x1d5ba, 0x1d5d3,
+ 0x1d5ee, 0x1d607,
+ 0x1d622, 0x1d63b,
+ 0x1d656, 0x1d66f,
+ 0x1d68a, 0x1d6a5,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6e1,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d71b,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d755,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d78f,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7c9,
+ 0x1d7cb, 0x1d7cb,
+}; /* CR_Lower */
+
+/* 'Print': [[:Print:]] */
+static const OnigCodePoint CR_Print[] = {
+ 541,
+ 0x0020, 0x007e,
+ 0x00a0, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x058f, 0x058f,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0604,
+ 0x0606, 0x061b,
+ 0x061e, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09fb,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3c, 0x0a3c,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4d,
+ 0x0a51, 0x0a51,
+ 0x0a59, 0x0a5c,
+ 0x0a5e, 0x0a5e,
+ 0x0a66, 0x0a75,
+ 0x0a81, 0x0a83,
+ 0x0a85, 0x0a8d,
+ 0x0a8f, 0x0a91,
+ 0x0a93, 0x0aa8,
+ 0x0aaa, 0x0ab0,
+ 0x0ab2, 0x0ab3,
+ 0x0ab5, 0x0ab9,
+ 0x0abc, 0x0ac5,
+ 0x0ac7, 0x0ac9,
+ 0x0acb, 0x0acd,
+ 0x0ad0, 0x0ad0,
+ 0x0ae0, 0x0ae3,
+ 0x0ae6, 0x0af1,
+ 0x0b01, 0x0b03,
+ 0x0b05, 0x0b0c,
+ 0x0b0f, 0x0b10,
+ 0x0b13, 0x0b28,
+ 0x0b2a, 0x0b30,
+ 0x0b32, 0x0b33,
+ 0x0b35, 0x0b39,
+ 0x0b3c, 0x0b44,
+ 0x0b47, 0x0b48,
+ 0x0b4b, 0x0b4d,
+ 0x0b56, 0x0b57,
+ 0x0b5c, 0x0b5d,
+ 0x0b5f, 0x0b63,
+ 0x0b66, 0x0b77,
+ 0x0b82, 0x0b83,
+ 0x0b85, 0x0b8a,
+ 0x0b8e, 0x0b90,
+ 0x0b92, 0x0b95,
+ 0x0b99, 0x0b9a,
+ 0x0b9c, 0x0b9c,
+ 0x0b9e, 0x0b9f,
+ 0x0ba3, 0x0ba4,
+ 0x0ba8, 0x0baa,
+ 0x0bae, 0x0bb9,
+ 0x0bbe, 0x0bc2,
+ 0x0bc6, 0x0bc8,
+ 0x0bca, 0x0bcd,
+ 0x0bd0, 0x0bd0,
+ 0x0bd7, 0x0bd7,
+ 0x0be6, 0x0bfa,
+ 0x0c01, 0x0c03,
+ 0x0c05, 0x0c0c,
+ 0x0c0e, 0x0c10,
+ 0x0c12, 0x0c28,
+ 0x0c2a, 0x0c33,
+ 0x0c35, 0x0c39,
+ 0x0c3d, 0x0c44,
+ 0x0c46, 0x0c48,
+ 0x0c4a, 0x0c4d,
+ 0x0c55, 0x0c56,
+ 0x0c58, 0x0c59,
+ 0x0c60, 0x0c63,
+ 0x0c66, 0x0c6f,
+ 0x0c78, 0x0c7f,
+ 0x0c82, 0x0c83,
+ 0x0c85, 0x0c8c,
+ 0x0c8e, 0x0c90,
+ 0x0c92, 0x0ca8,
+ 0x0caa, 0x0cb3,
+ 0x0cb5, 0x0cb9,
+ 0x0cbc, 0x0cc4,
+ 0x0cc6, 0x0cc8,
+ 0x0cca, 0x0ccd,
+ 0x0cd5, 0x0cd6,
+ 0x0cde, 0x0cde,
+ 0x0ce0, 0x0ce3,
+ 0x0ce6, 0x0cef,
+ 0x0cf1, 0x0cf2,
+ 0x0d02, 0x0d03,
+ 0x0d05, 0x0d0c,
+ 0x0d0e, 0x0d10,
+ 0x0d12, 0x0d3a,
+ 0x0d3d, 0x0d44,
+ 0x0d46, 0x0d48,
+ 0x0d4a, 0x0d4e,
+ 0x0d57, 0x0d57,
+ 0x0d60, 0x0d63,
+ 0x0d66, 0x0d75,
+ 0x0d79, 0x0d7f,
+ 0x0d82, 0x0d83,
+ 0x0d85, 0x0d96,
+ 0x0d9a, 0x0db1,
+ 0x0db3, 0x0dbb,
+ 0x0dbd, 0x0dbd,
+ 0x0dc0, 0x0dc6,
+ 0x0dca, 0x0dca,
+ 0x0dcf, 0x0dd4,
+ 0x0dd6, 0x0dd6,
+ 0x0dd8, 0x0ddf,
+ 0x0df2, 0x0df4,
+ 0x0e01, 0x0e3a,
+ 0x0e3f, 0x0e5b,
+ 0x0e81, 0x0e82,
+ 0x0e84, 0x0e84,
+ 0x0e87, 0x0e88,
+ 0x0e8a, 0x0e8a,
+ 0x0e8d, 0x0e8d,
+ 0x0e94, 0x0e97,
+ 0x0e99, 0x0e9f,
+ 0x0ea1, 0x0ea3,
+ 0x0ea5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ec8, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fbe, 0x0fcc,
+ 0x0fce, 0x0fda,
+ 0x1000, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135d, 0x137c,
+ 0x1380, 0x1399,
+ 0x13a0, 0x13f4,
+ 0x1400, 0x169c,
+ 0x16a0, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+ 0x1720, 0x1736,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17dd,
+ 0x17e0, 0x17e9,
+ 0x17f0, 0x17f9,
+ 0x1800, 0x180e,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1940, 0x1940,
+ 0x1944, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19da,
+ 0x19de, 0x1a1b,
+ 0x1a1e, 0x1a5e,
+ 0x1a60, 0x1a7c,
+ 0x1a7f, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa0, 0x1aad,
+ 0x1b00, 0x1b4b,
+ 0x1b50, 0x1b7c,
+ 0x1b80, 0x1bf3,
+ 0x1bfc, 0x1c37,
+ 0x1c3b, 0x1c49,
+ 0x1c4d, 0x1c7f,
+ 0x1cc0, 0x1cc7,
+ 0x1cd0, 0x1cf6,
+ 0x1d00, 0x1de6,
+ 0x1dfc, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fc4,
+ 0x1fc6, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fdd, 0x1fef,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffe,
+ 0x2000, 0x2027,
+ 0x202a, 0x2064,
+ 0x206a, 0x2071,
+ 0x2074, 0x208e,
+ 0x2090, 0x209c,
+ 0x20a0, 0x20b9,
+ 0x20d0, 0x20f0,
+ 0x2100, 0x2189,
+ 0x2190, 0x23f3,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x2460, 0x26ff,
+ 0x2701, 0x2b4c,
+ 0x2b50, 0x2b59,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2cf3,
+ 0x2cf9, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
+ 0x2d6f, 0x2d70,
+ 0x2d7f, 0x2d96,
+ 0x2da0, 0x2da6,
+ 0x2da8, 0x2dae,
+ 0x2db0, 0x2db6,
+ 0x2db8, 0x2dbe,
+ 0x2dc0, 0x2dc6,
+ 0x2dc8, 0x2dce,
+ 0x2dd0, 0x2dd6,
+ 0x2dd8, 0x2dde,
+ 0x2de0, 0x2e3b,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+ 0x2ff0, 0x2ffb,
+ 0x3000, 0x303f,
+ 0x3041, 0x3096,
+ 0x3099, 0x30ff,
+ 0x3105, 0x312d,
+ 0x3131, 0x318e,
+ 0x3190, 0x31ba,
+ 0x31c0, 0x31e3,
+ 0x31f0, 0x321e,
+ 0x3220, 0x32fe,
+ 0x3300, 0x4db5,
+ 0x4dc0, 0x9fcc,
+ 0xa000, 0xa48c,
+ 0xa490, 0xa4c6,
+ 0xa4d0, 0xa62b,
+ 0xa640, 0xa697,
+ 0xa69f, 0xa6f7,
+ 0xa700, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa82b,
+ 0xa830, 0xa839,
+ 0xa840, 0xa877,
+ 0xa880, 0xa8c4,
+ 0xa8ce, 0xa8d9,
+ 0xa8e0, 0xa8fb,
+ 0xa900, 0xa953,
+ 0xa95f, 0xa97c,
+ 0xa980, 0xa9cd,
+ 0xa9cf, 0xa9d9,
+ 0xa9de, 0xa9df,
+ 0xaa00, 0xaa36,
+ 0xaa40, 0xaa4d,
+ 0xaa50, 0xaa59,
+ 0xaa5c, 0xaa7b,
+ 0xaa80, 0xaac2,
+ 0xaadb, 0xaaf6,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabed,
+ 0xabf0, 0xabf9,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xe000, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbc1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfd,
+ 0xfe00, 0xfe19,
+ 0xfe20, 0xfe26,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xfeff, 0xfeff,
+ 0xff01, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfff9, 0xfffd,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1018a,
+ 0x10190, 0x1019b,
+ 0x101d0, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x103c3,
+ 0x103c8, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10857, 0x1085f,
+ 0x10900, 0x1091b,
+ 0x1091f, 0x10939,
+ 0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x10a60, 0x10a7f,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b7f,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x11080, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d1dd,
+ 0x1d200, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1d360, 0x1d371,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
+ 0x1f000, 0x1f02b,
+ 0x1f030, 0x1f093,
+ 0x1f0a0, 0x1f0ae,
+ 0x1f0b1, 0x1f0be,
+ 0x1f0c1, 0x1f0cf,
+ 0x1f0d1, 0x1f0df,
+ 0x1f100, 0x1f10a,
+ 0x1f110, 0x1f12e,
+ 0x1f130, 0x1f16b,
+ 0x1f170, 0x1f19a,
+ 0x1f1e6, 0x1f202,
+ 0x1f210, 0x1f23a,
+ 0x1f240, 0x1f248,
+ 0x1f250, 0x1f251,
+ 0x1f300, 0x1f320,
+ 0x1f330, 0x1f335,
+ 0x1f337, 0x1f37c,
+ 0x1f380, 0x1f393,
+ 0x1f3a0, 0x1f3c4,
+ 0x1f3c6, 0x1f3ca,
+ 0x1f3e0, 0x1f3f0,
+ 0x1f400, 0x1f43e,
+ 0x1f440, 0x1f440,
+ 0x1f442, 0x1f4f7,
+ 0x1f4f9, 0x1f4fc,
+ 0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
+ 0x1f550, 0x1f567,
+ 0x1f5fb, 0x1f640,
+ 0x1f645, 0x1f64f,
+ 0x1f680, 0x1f6c5,
+ 0x1f700, 0x1f773,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+ 0xf0000, 0xffffd,
+ 0x100000, 0x10fffd,
+}; /* CR_Print */
+
+/* 'Punct': [[:Punct:]] */
+static const OnigCodePoint CR_Punct[] = {
+ 140,
+ 0x0021, 0x0023,
+ 0x0025, 0x002a,
+ 0x002c, 0x002f,
+ 0x003a, 0x003b,
+ 0x003f, 0x0040,
+ 0x005b, 0x005d,
+ 0x005f, 0x005f,
+ 0x007b, 0x007b,
+ 0x007d, 0x007d,
+ 0x00a1, 0x00a1,
+ 0x00a7, 0x00a7,
+ 0x00ab, 0x00ab,
+ 0x00b6, 0x00b7,
+ 0x00bb, 0x00bb,
+ 0x00bf, 0x00bf,
+ 0x037e, 0x037e,
+ 0x0387, 0x0387,
+ 0x055a, 0x055f,
+ 0x0589, 0x058a,
+ 0x05be, 0x05be,
+ 0x05c0, 0x05c0,
+ 0x05c3, 0x05c3,
+ 0x05c6, 0x05c6,
+ 0x05f3, 0x05f4,
+ 0x0609, 0x060a,
+ 0x060c, 0x060d,
+ 0x061b, 0x061b,
+ 0x061e, 0x061f,
+ 0x066a, 0x066d,
+ 0x06d4, 0x06d4,
+ 0x0700, 0x070d,
+ 0x07f7, 0x07f9,
+ 0x0830, 0x083e,
+ 0x085e, 0x085e,
+ 0x0964, 0x0965,
+ 0x0970, 0x0970,
+ 0x0af0, 0x0af0,
+ 0x0df4, 0x0df4,
+ 0x0e4f, 0x0e4f,
+ 0x0e5a, 0x0e5b,
+ 0x0f04, 0x0f12,
+ 0x0f14, 0x0f14,
+ 0x0f3a, 0x0f3d,
+ 0x0f85, 0x0f85,
+ 0x0fd0, 0x0fd4,
+ 0x0fd9, 0x0fda,
+ 0x104a, 0x104f,
+ 0x10fb, 0x10fb,
+ 0x1360, 0x1368,
+ 0x1400, 0x1400,
+ 0x166d, 0x166e,
+ 0x169b, 0x169c,
+ 0x16eb, 0x16ed,
+ 0x1735, 0x1736,
+ 0x17d4, 0x17d6,
+ 0x17d8, 0x17da,
+ 0x1800, 0x180a,
+ 0x1944, 0x1945,
+ 0x1a1e, 0x1a1f,
+ 0x1aa0, 0x1aa6,
+ 0x1aa8, 0x1aad,
+ 0x1b5a, 0x1b60,
+ 0x1bfc, 0x1bff,
+ 0x1c3b, 0x1c3f,
+ 0x1c7e, 0x1c7f,
+ 0x1cc0, 0x1cc7,
+ 0x1cd3, 0x1cd3,
+ 0x2010, 0x2027,
+ 0x2030, 0x2043,
+ 0x2045, 0x2051,
+ 0x2053, 0x205e,
+ 0x207d, 0x207e,
+ 0x208d, 0x208e,
+ 0x2329, 0x232a,
+ 0x2768, 0x2775,
+ 0x27c5, 0x27c6,
+ 0x27e6, 0x27ef,
+ 0x2983, 0x2998,
+ 0x29d8, 0x29db,
+ 0x29fc, 0x29fd,
+ 0x2cf9, 0x2cfc,
+ 0x2cfe, 0x2cff,
+ 0x2d70, 0x2d70,
+ 0x2e00, 0x2e2e,
+ 0x2e30, 0x2e3b,
+ 0x3001, 0x3003,
+ 0x3008, 0x3011,
+ 0x3014, 0x301f,
+ 0x3030, 0x3030,
+ 0x303d, 0x303d,
+ 0x30a0, 0x30a0,
+ 0x30fb, 0x30fb,
+ 0xa4fe, 0xa4ff,
+ 0xa60d, 0xa60f,
+ 0xa673, 0xa673,
+ 0xa67e, 0xa67e,
+ 0xa6f2, 0xa6f7,
+ 0xa874, 0xa877,
+ 0xa8ce, 0xa8cf,
+ 0xa8f8, 0xa8fa,
+ 0xa92e, 0xa92f,
+ 0xa95f, 0xa95f,
+ 0xa9c1, 0xa9cd,
+ 0xa9de, 0xa9df,
+ 0xaa5c, 0xaa5f,
+ 0xaade, 0xaadf,
+ 0xaaf0, 0xaaf1,
+ 0xabeb, 0xabeb,
+ 0xfd3e, 0xfd3f,
+ 0xfe10, 0xfe19,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe61,
+ 0xfe63, 0xfe63,
+ 0xfe68, 0xfe68,
+ 0xfe6a, 0xfe6b,
+ 0xff01, 0xff03,
+ 0xff05, 0xff0a,
+ 0xff0c, 0xff0f,
+ 0xff1a, 0xff1b,
+ 0xff1f, 0xff20,
+ 0xff3b, 0xff3d,
+ 0xff3f, 0xff3f,
+ 0xff5b, 0xff5b,
+ 0xff5d, 0xff5d,
+ 0xff5f, 0xff65,
+ 0x10100, 0x10102,
+ 0x1039f, 0x1039f,
+ 0x103d0, 0x103d0,
+ 0x10857, 0x10857,
+ 0x1091f, 0x1091f,
+ 0x1093f, 0x1093f,
+ 0x10a50, 0x10a58,
+ 0x10a7f, 0x10a7f,
+ 0x10b39, 0x10b3f,
+ 0x11047, 0x1104d,
+ 0x110bb, 0x110bc,
+ 0x110be, 0x110c1,
+ 0x11140, 0x11143,
+ 0x111c5, 0x111c8,
+ 0x12470, 0x12473,
+}; /* CR_Punct */
+
+/* 'Space': [[:Space:]] */
+static const OnigCodePoint CR_Space[] = {
+ 11,
+ 0x0009, 0x000d,
+ 0x0020, 0x0020,
+ 0x0085, 0x0085,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x180e, 0x180e,
+ 0x2000, 0x200a,
+ 0x2028, 0x2029,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Space */
+
+/* 'Upper': [[:Upper:]] */
+static const OnigCodePoint CR_Upper[] = {
+ 610,
+ 0x0041, 0x005a,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00de,
+ 0x0100, 0x0100,
+ 0x0102, 0x0102,
+ 0x0104, 0x0104,
+ 0x0106, 0x0106,
+ 0x0108, 0x0108,
+ 0x010a, 0x010a,
+ 0x010c, 0x010c,
+ 0x010e, 0x010e,
+ 0x0110, 0x0110,
+ 0x0112, 0x0112,
+ 0x0114, 0x0114,
+ 0x0116, 0x0116,
+ 0x0118, 0x0118,
+ 0x011a, 0x011a,
+ 0x011c, 0x011c,
+ 0x011e, 0x011e,
+ 0x0120, 0x0120,
+ 0x0122, 0x0122,
+ 0x0124, 0x0124,
+ 0x0126, 0x0126,
+ 0x0128, 0x0128,
+ 0x012a, 0x012a,
+ 0x012c, 0x012c,
+ 0x012e, 0x012e,
+ 0x0130, 0x0130,
+ 0x0132, 0x0132,
+ 0x0134, 0x0134,
+ 0x0136, 0x0136,
+ 0x0139, 0x0139,
+ 0x013b, 0x013b,
+ 0x013d, 0x013d,
+ 0x013f, 0x013f,
+ 0x0141, 0x0141,
+ 0x0143, 0x0143,
+ 0x0145, 0x0145,
+ 0x0147, 0x0147,
+ 0x014a, 0x014a,
+ 0x014c, 0x014c,
+ 0x014e, 0x014e,
+ 0x0150, 0x0150,
+ 0x0152, 0x0152,
+ 0x0154, 0x0154,
+ 0x0156, 0x0156,
+ 0x0158, 0x0158,
+ 0x015a, 0x015a,
+ 0x015c, 0x015c,
+ 0x015e, 0x015e,
+ 0x0160, 0x0160,
+ 0x0162, 0x0162,
+ 0x0164, 0x0164,
+ 0x0166, 0x0166,
+ 0x0168, 0x0168,
+ 0x016a, 0x016a,
+ 0x016c, 0x016c,
+ 0x016e, 0x016e,
+ 0x0170, 0x0170,
+ 0x0172, 0x0172,
+ 0x0174, 0x0174,
+ 0x0176, 0x0176,
+ 0x0178, 0x0179,
+ 0x017b, 0x017b,
+ 0x017d, 0x017d,
+ 0x0181, 0x0182,
+ 0x0184, 0x0184,
+ 0x0186, 0x0187,
+ 0x0189, 0x018b,
+ 0x018e, 0x0191,
+ 0x0193, 0x0194,
+ 0x0196, 0x0198,
+ 0x019c, 0x019d,
+ 0x019f, 0x01a0,
+ 0x01a2, 0x01a2,
+ 0x01a4, 0x01a4,
+ 0x01a6, 0x01a7,
+ 0x01a9, 0x01a9,
+ 0x01ac, 0x01ac,
+ 0x01ae, 0x01af,
+ 0x01b1, 0x01b3,
+ 0x01b5, 0x01b5,
+ 0x01b7, 0x01b8,
+ 0x01bc, 0x01bc,
+ 0x01c4, 0x01c4,
+ 0x01c7, 0x01c7,
+ 0x01ca, 0x01ca,
+ 0x01cd, 0x01cd,
+ 0x01cf, 0x01cf,
+ 0x01d1, 0x01d1,
+ 0x01d3, 0x01d3,
+ 0x01d5, 0x01d5,
+ 0x01d7, 0x01d7,
+ 0x01d9, 0x01d9,
+ 0x01db, 0x01db,
+ 0x01de, 0x01de,
+ 0x01e0, 0x01e0,
+ 0x01e2, 0x01e2,
+ 0x01e4, 0x01e4,
+ 0x01e6, 0x01e6,
+ 0x01e8, 0x01e8,
+ 0x01ea, 0x01ea,
+ 0x01ec, 0x01ec,
+ 0x01ee, 0x01ee,
+ 0x01f1, 0x01f1,
+ 0x01f4, 0x01f4,
+ 0x01f6, 0x01f8,
+ 0x01fa, 0x01fa,
+ 0x01fc, 0x01fc,
+ 0x01fe, 0x01fe,
+ 0x0200, 0x0200,
+ 0x0202, 0x0202,
+ 0x0204, 0x0204,
+ 0x0206, 0x0206,
+ 0x0208, 0x0208,
+ 0x020a, 0x020a,
+ 0x020c, 0x020c,
+ 0x020e, 0x020e,
+ 0x0210, 0x0210,
+ 0x0212, 0x0212,
+ 0x0214, 0x0214,
+ 0x0216, 0x0216,
+ 0x0218, 0x0218,
+ 0x021a, 0x021a,
+ 0x021c, 0x021c,
+ 0x021e, 0x021e,
+ 0x0220, 0x0220,
+ 0x0222, 0x0222,
+ 0x0224, 0x0224,
+ 0x0226, 0x0226,
+ 0x0228, 0x0228,
+ 0x022a, 0x022a,
+ 0x022c, 0x022c,
+ 0x022e, 0x022e,
+ 0x0230, 0x0230,
+ 0x0232, 0x0232,
+ 0x023a, 0x023b,
+ 0x023d, 0x023e,
+ 0x0241, 0x0241,
+ 0x0243, 0x0246,
+ 0x0248, 0x0248,
+ 0x024a, 0x024a,
+ 0x024c, 0x024c,
+ 0x024e, 0x024e,
+ 0x0370, 0x0370,
+ 0x0372, 0x0372,
+ 0x0376, 0x0376,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x038f,
+ 0x0391, 0x03a1,
+ 0x03a3, 0x03ab,
+ 0x03cf, 0x03cf,
+ 0x03d2, 0x03d4,
+ 0x03d8, 0x03d8,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03e2,
+ 0x03e4, 0x03e4,
+ 0x03e6, 0x03e6,
+ 0x03e8, 0x03e8,
+ 0x03ea, 0x03ea,
+ 0x03ec, 0x03ec,
+ 0x03ee, 0x03ee,
+ 0x03f4, 0x03f4,
+ 0x03f7, 0x03f7,
+ 0x03f9, 0x03fa,
+ 0x03fd, 0x042f,
+ 0x0460, 0x0460,
+ 0x0462, 0x0462,
+ 0x0464, 0x0464,
+ 0x0466, 0x0466,
+ 0x0468, 0x0468,
+ 0x046a, 0x046a,
+ 0x046c, 0x046c,
+ 0x046e, 0x046e,
+ 0x0470, 0x0470,
+ 0x0472, 0x0472,
+ 0x0474, 0x0474,
+ 0x0476, 0x0476,
+ 0x0478, 0x0478,
+ 0x047a, 0x047a,
+ 0x047c, 0x047c,
+ 0x047e, 0x047e,
+ 0x0480, 0x0480,
+ 0x048a, 0x048a,
+ 0x048c, 0x048c,
+ 0x048e, 0x048e,
+ 0x0490, 0x0490,
+ 0x0492, 0x0492,
+ 0x0494, 0x0494,
+ 0x0496, 0x0496,
+ 0x0498, 0x0498,
+ 0x049a, 0x049a,
+ 0x049c, 0x049c,
+ 0x049e, 0x049e,
+ 0x04a0, 0x04a0,
+ 0x04a2, 0x04a2,
+ 0x04a4, 0x04a4,
+ 0x04a6, 0x04a6,
+ 0x04a8, 0x04a8,
+ 0x04aa, 0x04aa,
+ 0x04ac, 0x04ac,
+ 0x04ae, 0x04ae,
+ 0x04b0, 0x04b0,
+ 0x04b2, 0x04b2,
+ 0x04b4, 0x04b4,
+ 0x04b6, 0x04b6,
+ 0x04b8, 0x04b8,
+ 0x04ba, 0x04ba,
+ 0x04bc, 0x04bc,
+ 0x04be, 0x04be,
+ 0x04c0, 0x04c1,
+ 0x04c3, 0x04c3,
+ 0x04c5, 0x04c5,
+ 0x04c7, 0x04c7,
+ 0x04c9, 0x04c9,
+ 0x04cb, 0x04cb,
+ 0x04cd, 0x04cd,
+ 0x04d0, 0x04d0,
+ 0x04d2, 0x04d2,
+ 0x04d4, 0x04d4,
+ 0x04d6, 0x04d6,
+ 0x04d8, 0x04d8,
+ 0x04da, 0x04da,
+ 0x04dc, 0x04dc,
+ 0x04de, 0x04de,
+ 0x04e0, 0x04e0,
+ 0x04e2, 0x04e2,
+ 0x04e4, 0x04e4,
+ 0x04e6, 0x04e6,
+ 0x04e8, 0x04e8,
+ 0x04ea, 0x04ea,
+ 0x04ec, 0x04ec,
+ 0x04ee, 0x04ee,
+ 0x04f0, 0x04f0,
+ 0x04f2, 0x04f2,
+ 0x04f4, 0x04f4,
+ 0x04f6, 0x04f6,
+ 0x04f8, 0x04f8,
+ 0x04fa, 0x04fa,
+ 0x04fc, 0x04fc,
+ 0x04fe, 0x04fe,
+ 0x0500, 0x0500,
+ 0x0502, 0x0502,
+ 0x0504, 0x0504,
+ 0x0506, 0x0506,
+ 0x0508, 0x0508,
+ 0x050a, 0x050a,
+ 0x050c, 0x050c,
+ 0x050e, 0x050e,
+ 0x0510, 0x0510,
+ 0x0512, 0x0512,
+ 0x0514, 0x0514,
+ 0x0516, 0x0516,
+ 0x0518, 0x0518,
+ 0x051a, 0x051a,
+ 0x051c, 0x051c,
+ 0x051e, 0x051e,
+ 0x0520, 0x0520,
+ 0x0522, 0x0522,
+ 0x0524, 0x0524,
+ 0x0526, 0x0526,
+ 0x0531, 0x0556,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x1e00, 0x1e00,
+ 0x1e02, 0x1e02,
+ 0x1e04, 0x1e04,
+ 0x1e06, 0x1e06,
+ 0x1e08, 0x1e08,
+ 0x1e0a, 0x1e0a,
+ 0x1e0c, 0x1e0c,
+ 0x1e0e, 0x1e0e,
+ 0x1e10, 0x1e10,
+ 0x1e12, 0x1e12,
+ 0x1e14, 0x1e14,
+ 0x1e16, 0x1e16,
+ 0x1e18, 0x1e18,
+ 0x1e1a, 0x1e1a,
+ 0x1e1c, 0x1e1c,
+ 0x1e1e, 0x1e1e,
+ 0x1e20, 0x1e20,
+ 0x1e22, 0x1e22,
+ 0x1e24, 0x1e24,
+ 0x1e26, 0x1e26,
+ 0x1e28, 0x1e28,
+ 0x1e2a, 0x1e2a,
+ 0x1e2c, 0x1e2c,
+ 0x1e2e, 0x1e2e,
+ 0x1e30, 0x1e30,
+ 0x1e32, 0x1e32,
+ 0x1e34, 0x1e34,
+ 0x1e36, 0x1e36,
+ 0x1e38, 0x1e38,
+ 0x1e3a, 0x1e3a,
+ 0x1e3c, 0x1e3c,
+ 0x1e3e, 0x1e3e,
+ 0x1e40, 0x1e40,
+ 0x1e42, 0x1e42,
+ 0x1e44, 0x1e44,
+ 0x1e46, 0x1e46,
+ 0x1e48, 0x1e48,
+ 0x1e4a, 0x1e4a,
+ 0x1e4c, 0x1e4c,
+ 0x1e4e, 0x1e4e,
+ 0x1e50, 0x1e50,
+ 0x1e52, 0x1e52,
+ 0x1e54, 0x1e54,
+ 0x1e56, 0x1e56,
+ 0x1e58, 0x1e58,
+ 0x1e5a, 0x1e5a,
+ 0x1e5c, 0x1e5c,
+ 0x1e5e, 0x1e5e,
+ 0x1e60, 0x1e60,
+ 0x1e62, 0x1e62,
+ 0x1e64, 0x1e64,
+ 0x1e66, 0x1e66,
+ 0x1e68, 0x1e68,
+ 0x1e6a, 0x1e6a,
+ 0x1e6c, 0x1e6c,
+ 0x1e6e, 0x1e6e,
+ 0x1e70, 0x1e70,
+ 0x1e72, 0x1e72,
+ 0x1e74, 0x1e74,
+ 0x1e76, 0x1e76,
+ 0x1e78, 0x1e78,
+ 0x1e7a, 0x1e7a,
+ 0x1e7c, 0x1e7c,
+ 0x1e7e, 0x1e7e,
+ 0x1e80, 0x1e80,
+ 0x1e82, 0x1e82,
+ 0x1e84, 0x1e84,
+ 0x1e86, 0x1e86,
+ 0x1e88, 0x1e88,
+ 0x1e8a, 0x1e8a,
+ 0x1e8c, 0x1e8c,
+ 0x1e8e, 0x1e8e,
+ 0x1e90, 0x1e90,
+ 0x1e92, 0x1e92,
+ 0x1e94, 0x1e94,
+ 0x1e9e, 0x1e9e,
+ 0x1ea0, 0x1ea0,
+ 0x1ea2, 0x1ea2,
+ 0x1ea4, 0x1ea4,
+ 0x1ea6, 0x1ea6,
+ 0x1ea8, 0x1ea8,
+ 0x1eaa, 0x1eaa,
+ 0x1eac, 0x1eac,
+ 0x1eae, 0x1eae,
+ 0x1eb0, 0x1eb0,
+ 0x1eb2, 0x1eb2,
+ 0x1eb4, 0x1eb4,
+ 0x1eb6, 0x1eb6,
+ 0x1eb8, 0x1eb8,
+ 0x1eba, 0x1eba,
+ 0x1ebc, 0x1ebc,
+ 0x1ebe, 0x1ebe,
+ 0x1ec0, 0x1ec0,
+ 0x1ec2, 0x1ec2,
+ 0x1ec4, 0x1ec4,
+ 0x1ec6, 0x1ec6,
+ 0x1ec8, 0x1ec8,
+ 0x1eca, 0x1eca,
+ 0x1ecc, 0x1ecc,
+ 0x1ece, 0x1ece,
+ 0x1ed0, 0x1ed0,
+ 0x1ed2, 0x1ed2,
+ 0x1ed4, 0x1ed4,
+ 0x1ed6, 0x1ed6,
+ 0x1ed8, 0x1ed8,
+ 0x1eda, 0x1eda,
+ 0x1edc, 0x1edc,
+ 0x1ede, 0x1ede,
+ 0x1ee0, 0x1ee0,
+ 0x1ee2, 0x1ee2,
+ 0x1ee4, 0x1ee4,
+ 0x1ee6, 0x1ee6,
+ 0x1ee8, 0x1ee8,
+ 0x1eea, 0x1eea,
+ 0x1eec, 0x1eec,
+ 0x1eee, 0x1eee,
+ 0x1ef0, 0x1ef0,
+ 0x1ef2, 0x1ef2,
+ 0x1ef4, 0x1ef4,
+ 0x1ef6, 0x1ef6,
+ 0x1ef8, 0x1ef8,
+ 0x1efa, 0x1efa,
+ 0x1efc, 0x1efc,
+ 0x1efe, 0x1efe,
+ 0x1f08, 0x1f0f,
+ 0x1f18, 0x1f1d,
+ 0x1f28, 0x1f2f,
+ 0x1f38, 0x1f3f,
+ 0x1f48, 0x1f4d,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f5f,
+ 0x1f68, 0x1f6f,
+ 0x1fb8, 0x1fbb,
+ 0x1fc8, 0x1fcb,
+ 0x1fd8, 0x1fdb,
+ 0x1fe8, 0x1fec,
+ 0x1ff8, 0x1ffb,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210b, 0x210d,
+ 0x2110, 0x2112,
+ 0x2115, 0x2115,
+ 0x2119, 0x211d,
+ 0x2124, 0x2124,
+ 0x2126, 0x2126,
+ 0x2128, 0x2128,
+ 0x212a, 0x212d,
+ 0x2130, 0x2133,
+ 0x213e, 0x213f,
+ 0x2145, 0x2145,
+ 0x2160, 0x216f,
+ 0x2183, 0x2183,
+ 0x24b6, 0x24cf,
+ 0x2c00, 0x2c2e,
+ 0x2c60, 0x2c60,
+ 0x2c62, 0x2c64,
+ 0x2c67, 0x2c67,
+ 0x2c69, 0x2c69,
+ 0x2c6b, 0x2c6b,
+ 0x2c6d, 0x2c70,
+ 0x2c72, 0x2c72,
+ 0x2c75, 0x2c75,
+ 0x2c7e, 0x2c80,
+ 0x2c82, 0x2c82,
+ 0x2c84, 0x2c84,
+ 0x2c86, 0x2c86,
+ 0x2c88, 0x2c88,
+ 0x2c8a, 0x2c8a,
+ 0x2c8c, 0x2c8c,
+ 0x2c8e, 0x2c8e,
+ 0x2c90, 0x2c90,
+ 0x2c92, 0x2c92,
+ 0x2c94, 0x2c94,
+ 0x2c96, 0x2c96,
+ 0x2c98, 0x2c98,
+ 0x2c9a, 0x2c9a,
+ 0x2c9c, 0x2c9c,
+ 0x2c9e, 0x2c9e,
+ 0x2ca0, 0x2ca0,
+ 0x2ca2, 0x2ca2,
+ 0x2ca4, 0x2ca4,
+ 0x2ca6, 0x2ca6,
+ 0x2ca8, 0x2ca8,
+ 0x2caa, 0x2caa,
+ 0x2cac, 0x2cac,
+ 0x2cae, 0x2cae,
+ 0x2cb0, 0x2cb0,
+ 0x2cb2, 0x2cb2,
+ 0x2cb4, 0x2cb4,
+ 0x2cb6, 0x2cb6,
+ 0x2cb8, 0x2cb8,
+ 0x2cba, 0x2cba,
+ 0x2cbc, 0x2cbc,
+ 0x2cbe, 0x2cbe,
+ 0x2cc0, 0x2cc0,
+ 0x2cc2, 0x2cc2,
+ 0x2cc4, 0x2cc4,
+ 0x2cc6, 0x2cc6,
+ 0x2cc8, 0x2cc8,
+ 0x2cca, 0x2cca,
+ 0x2ccc, 0x2ccc,
+ 0x2cce, 0x2cce,
+ 0x2cd0, 0x2cd0,
+ 0x2cd2, 0x2cd2,
+ 0x2cd4, 0x2cd4,
+ 0x2cd6, 0x2cd6,
+ 0x2cd8, 0x2cd8,
+ 0x2cda, 0x2cda,
+ 0x2cdc, 0x2cdc,
+ 0x2cde, 0x2cde,
+ 0x2ce0, 0x2ce0,
+ 0x2ce2, 0x2ce2,
+ 0x2ceb, 0x2ceb,
+ 0x2ced, 0x2ced,
+ 0x2cf2, 0x2cf2,
+ 0xa640, 0xa640,
+ 0xa642, 0xa642,
+ 0xa644, 0xa644,
+ 0xa646, 0xa646,
+ 0xa648, 0xa648,
+ 0xa64a, 0xa64a,
+ 0xa64c, 0xa64c,
+ 0xa64e, 0xa64e,
+ 0xa650, 0xa650,
+ 0xa652, 0xa652,
+ 0xa654, 0xa654,
+ 0xa656, 0xa656,
+ 0xa658, 0xa658,
+ 0xa65a, 0xa65a,
+ 0xa65c, 0xa65c,
+ 0xa65e, 0xa65e,
+ 0xa660, 0xa660,
+ 0xa662, 0xa662,
+ 0xa664, 0xa664,
+ 0xa666, 0xa666,
+ 0xa668, 0xa668,
+ 0xa66a, 0xa66a,
+ 0xa66c, 0xa66c,
+ 0xa680, 0xa680,
+ 0xa682, 0xa682,
+ 0xa684, 0xa684,
+ 0xa686, 0xa686,
+ 0xa688, 0xa688,
+ 0xa68a, 0xa68a,
+ 0xa68c, 0xa68c,
+ 0xa68e, 0xa68e,
+ 0xa690, 0xa690,
+ 0xa692, 0xa692,
+ 0xa694, 0xa694,
+ 0xa696, 0xa696,
+ 0xa722, 0xa722,
+ 0xa724, 0xa724,
+ 0xa726, 0xa726,
+ 0xa728, 0xa728,
+ 0xa72a, 0xa72a,
+ 0xa72c, 0xa72c,
+ 0xa72e, 0xa72e,
+ 0xa732, 0xa732,
+ 0xa734, 0xa734,
+ 0xa736, 0xa736,
+ 0xa738, 0xa738,
+ 0xa73a, 0xa73a,
+ 0xa73c, 0xa73c,
+ 0xa73e, 0xa73e,
+ 0xa740, 0xa740,
+ 0xa742, 0xa742,
+ 0xa744, 0xa744,
+ 0xa746, 0xa746,
+ 0xa748, 0xa748,
+ 0xa74a, 0xa74a,
+ 0xa74c, 0xa74c,
+ 0xa74e, 0xa74e,
+ 0xa750, 0xa750,
+ 0xa752, 0xa752,
+ 0xa754, 0xa754,
+ 0xa756, 0xa756,
+ 0xa758, 0xa758,
+ 0xa75a, 0xa75a,
+ 0xa75c, 0xa75c,
+ 0xa75e, 0xa75e,
+ 0xa760, 0xa760,
+ 0xa762, 0xa762,
+ 0xa764, 0xa764,
+ 0xa766, 0xa766,
+ 0xa768, 0xa768,
+ 0xa76a, 0xa76a,
+ 0xa76c, 0xa76c,
+ 0xa76e, 0xa76e,
+ 0xa779, 0xa779,
+ 0xa77b, 0xa77b,
+ 0xa77d, 0xa77e,
+ 0xa780, 0xa780,
+ 0xa782, 0xa782,
+ 0xa784, 0xa784,
+ 0xa786, 0xa786,
+ 0xa78b, 0xa78b,
+ 0xa78d, 0xa78d,
+ 0xa790, 0xa790,
+ 0xa792, 0xa792,
+ 0xa7a0, 0xa7a0,
+ 0xa7a2, 0xa7a2,
+ 0xa7a4, 0xa7a4,
+ 0xa7a6, 0xa7a6,
+ 0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
+ 0xff21, 0xff3a,
+ 0x10400, 0x10427,
+ 0x1d400, 0x1d419,
+ 0x1d434, 0x1d44d,
+ 0x1d468, 0x1d481,
+ 0x1d49c, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b5,
+ 0x1d4d0, 0x1d4e9,
+ 0x1d504, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d538, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d56c, 0x1d585,
+ 0x1d5a0, 0x1d5b9,
+ 0x1d5d4, 0x1d5ed,
+ 0x1d608, 0x1d621,
+ 0x1d63c, 0x1d655,
+ 0x1d670, 0x1d689,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6e2, 0x1d6fa,
+ 0x1d71c, 0x1d734,
+ 0x1d756, 0x1d76e,
+ 0x1d790, 0x1d7a8,
+ 0x1d7ca, 0x1d7ca,
+}; /* CR_Upper */
+
+/* 'XDigit': [[:XDigit:]] */
+static const OnigCodePoint CR_XDigit[] = {
+ 3,
+ 0x0030, 0x0039,
+ 0x0041, 0x0046,
+ 0x0061, 0x0066,
+}; /* CR_XDigit */
+
+/* 'Word': [[:Word:]] */
+static const OnigCodePoint CR_Word[] = {
+ 564,
+ 0x0030, 0x0039,
+ 0x0041, 0x005a,
+ 0x005f, 0x005f,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0300, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x0483, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0669,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06df, 0x06e8,
+ 0x06ea, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0840, 0x085b,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0963,
+ 0x0966, 0x096f,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09f1,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3c, 0x0a3c,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4d,
+ 0x0a51, 0x0a51,
+ 0x0a59, 0x0a5c,
+ 0x0a5e, 0x0a5e,
+ 0x0a66, 0x0a75,
+ 0x0a81, 0x0a83,
+ 0x0a85, 0x0a8d,
+ 0x0a8f, 0x0a91,
+ 0x0a93, 0x0aa8,
+ 0x0aaa, 0x0ab0,
+ 0x0ab2, 0x0ab3,
+ 0x0ab5, 0x0ab9,
+ 0x0abc, 0x0ac5,
+ 0x0ac7, 0x0ac9,
+ 0x0acb, 0x0acd,
+ 0x0ad0, 0x0ad0,
+ 0x0ae0, 0x0ae3,
+ 0x0ae6, 0x0aef,
+ 0x0b01, 0x0b03,
+ 0x0b05, 0x0b0c,
+ 0x0b0f, 0x0b10,
+ 0x0b13, 0x0b28,
+ 0x0b2a, 0x0b30,
+ 0x0b32, 0x0b33,
+ 0x0b35, 0x0b39,
+ 0x0b3c, 0x0b44,
+ 0x0b47, 0x0b48,
+ 0x0b4b, 0x0b4d,
+ 0x0b56, 0x0b57,
+ 0x0b5c, 0x0b5d,
+ 0x0b5f, 0x0b63,
+ 0x0b66, 0x0b6f,
+ 0x0b71, 0x0b71,
+ 0x0b82, 0x0b83,
+ 0x0b85, 0x0b8a,
+ 0x0b8e, 0x0b90,
+ 0x0b92, 0x0b95,
+ 0x0b99, 0x0b9a,
+ 0x0b9c, 0x0b9c,
+ 0x0b9e, 0x0b9f,
+ 0x0ba3, 0x0ba4,
+ 0x0ba8, 0x0baa,
+ 0x0bae, 0x0bb9,
+ 0x0bbe, 0x0bc2,
+ 0x0bc6, 0x0bc8,
+ 0x0bca, 0x0bcd,
+ 0x0bd0, 0x0bd0,
+ 0x0bd7, 0x0bd7,
+ 0x0be6, 0x0bef,
+ 0x0c01, 0x0c03,
+ 0x0c05, 0x0c0c,
+ 0x0c0e, 0x0c10,
+ 0x0c12, 0x0c28,
+ 0x0c2a, 0x0c33,
+ 0x0c35, 0x0c39,
+ 0x0c3d, 0x0c44,
+ 0x0c46, 0x0c48,
+ 0x0c4a, 0x0c4d,
+ 0x0c55, 0x0c56,
+ 0x0c58, 0x0c59,
+ 0x0c60, 0x0c63,
+ 0x0c66, 0x0c6f,
+ 0x0c82, 0x0c83,
+ 0x0c85, 0x0c8c,
+ 0x0c8e, 0x0c90,
+ 0x0c92, 0x0ca8,
+ 0x0caa, 0x0cb3,
+ 0x0cb5, 0x0cb9,
+ 0x0cbc, 0x0cc4,
+ 0x0cc6, 0x0cc8,
+ 0x0cca, 0x0ccd,
+ 0x0cd5, 0x0cd6,
+ 0x0cde, 0x0cde,
+ 0x0ce0, 0x0ce3,
+ 0x0ce6, 0x0cef,
+ 0x0cf1, 0x0cf2,
+ 0x0d02, 0x0d03,
+ 0x0d05, 0x0d0c,
+ 0x0d0e, 0x0d10,
+ 0x0d12, 0x0d3a,
+ 0x0d3d, 0x0d44,
+ 0x0d46, 0x0d48,
+ 0x0d4a, 0x0d4e,
+ 0x0d57, 0x0d57,
+ 0x0d60, 0x0d63,
+ 0x0d66, 0x0d6f,
+ 0x0d7a, 0x0d7f,
+ 0x0d82, 0x0d83,
+ 0x0d85, 0x0d96,
+ 0x0d9a, 0x0db1,
+ 0x0db3, 0x0dbb,
+ 0x0dbd, 0x0dbd,
+ 0x0dc0, 0x0dc6,
+ 0x0dca, 0x0dca,
+ 0x0dcf, 0x0dd4,
+ 0x0dd6, 0x0dd6,
+ 0x0dd8, 0x0ddf,
+ 0x0df2, 0x0df3,
+ 0x0e01, 0x0e3a,
+ 0x0e40, 0x0e4e,
+ 0x0e50, 0x0e59,
+ 0x0e81, 0x0e82,
+ 0x0e84, 0x0e84,
+ 0x0e87, 0x0e88,
+ 0x0e8a, 0x0e8a,
+ 0x0e8d, 0x0e8d,
+ 0x0e94, 0x0e97,
+ 0x0e99, 0x0e9f,
+ 0x0ea1, 0x0ea3,
+ 0x0ea5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ec8, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f00,
+ 0x0f18, 0x0f19,
+ 0x0f20, 0x0f29,
+ 0x0f35, 0x0f35,
+ 0x0f37, 0x0f37,
+ 0x0f39, 0x0f39,
+ 0x0f3e, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f84,
+ 0x0f86, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fc6, 0x0fc6,
+ 0x1000, 0x1049,
+ 0x1050, 0x109d,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135d, 0x135f,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+ 0x1720, 0x1734,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17d3,
+ 0x17d7, 0x17d7,
+ 0x17dc, 0x17dd,
+ 0x17e0, 0x17e9,
+ 0x180b, 0x180d,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1946, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19d9,
+ 0x1a00, 0x1a1b,
+ 0x1a20, 0x1a5e,
+ 0x1a60, 0x1a7c,
+ 0x1a7f, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa7, 0x1aa7,
+ 0x1b00, 0x1b4b,
+ 0x1b50, 0x1b59,
+ 0x1b6b, 0x1b73,
+ 0x1b80, 0x1bf3,
+ 0x1c00, 0x1c37,
+ 0x1c40, 0x1c49,
+ 0x1c4d, 0x1c7d,
+ 0x1cd0, 0x1cd2,
+ 0x1cd4, 0x1cf6,
+ 0x1d00, 0x1de6,
+ 0x1dfc, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fbc,
+ 0x1fbe, 0x1fbe,
+ 0x1fc2, 0x1fc4,
+ 0x1fc6, 0x1fcc,
+ 0x1fd0, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fe0, 0x1fec,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffc,
+ 0x203f, 0x2040,
+ 0x2054, 0x2054,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x20d0, 0x20f0,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210a, 0x2113,
+ 0x2115, 0x2115,
+ 0x2119, 0x211d,
+ 0x2124, 0x2124,
+ 0x2126, 0x2126,
+ 0x2128, 0x2128,
+ 0x212a, 0x212d,
+ 0x212f, 0x2139,
+ 0x213c, 0x213f,
+ 0x2145, 0x2149,
+ 0x214e, 0x214e,
+ 0x2160, 0x2188,
+ 0x24b6, 0x24e9,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2ce4,
+ 0x2ceb, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
+ 0x2d6f, 0x2d6f,
+ 0x2d7f, 0x2d96,
+ 0x2da0, 0x2da6,
+ 0x2da8, 0x2dae,
+ 0x2db0, 0x2db6,
+ 0x2db8, 0x2dbe,
+ 0x2dc0, 0x2dc6,
+ 0x2dc8, 0x2dce,
+ 0x2dd0, 0x2dd6,
+ 0x2dd8, 0x2dde,
+ 0x2de0, 0x2dff,
+ 0x2e2f, 0x2e2f,
+ 0x3005, 0x3007,
+ 0x3021, 0x302f,
+ 0x3031, 0x3035,
+ 0x3038, 0x303c,
+ 0x3041, 0x3096,
+ 0x3099, 0x309a,
+ 0x309d, 0x309f,
+ 0x30a1, 0x30fa,
+ 0x30fc, 0x30ff,
+ 0x3105, 0x312d,
+ 0x3131, 0x318e,
+ 0x31a0, 0x31ba,
+ 0x31f0, 0x31ff,
+ 0x3400, 0x4db5,
+ 0x4e00, 0x9fcc,
+ 0xa000, 0xa48c,
+ 0xa4d0, 0xa4fd,
+ 0xa500, 0xa60c,
+ 0xa610, 0xa62b,
+ 0xa640, 0xa672,
+ 0xa674, 0xa67d,
+ 0xa67f, 0xa697,
+ 0xa69f, 0xa6f1,
+ 0xa717, 0xa71f,
+ 0xa722, 0xa788,
+ 0xa78b, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa827,
+ 0xa840, 0xa873,
+ 0xa880, 0xa8c4,
+ 0xa8d0, 0xa8d9,
+ 0xa8e0, 0xa8f7,
+ 0xa8fb, 0xa8fb,
+ 0xa900, 0xa92d,
+ 0xa930, 0xa953,
+ 0xa960, 0xa97c,
+ 0xa980, 0xa9c0,
+ 0xa9cf, 0xa9d9,
+ 0xaa00, 0xaa36,
+ 0xaa40, 0xaa4d,
+ 0xaa50, 0xaa59,
+ 0xaa60, 0xaa76,
+ 0xaa7a, 0xaa7b,
+ 0xaa80, 0xaac2,
+ 0xaadb, 0xaadd,
+ 0xaae0, 0xaaef,
+ 0xaaf2, 0xaaf6,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabea,
+ 0xabec, 0xabed,
+ 0xabf0, 0xabf9,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb28,
+ 0xfb2a, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe00, 0xfe0f,
+ 0xfe20, 0xfe26,
+ 0xfe33, 0xfe34,
+ 0xfe4d, 0xfe4f,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff10, 0xff19,
+ 0xff21, 0xff3a,
+ 0xff3f, 0xff3f,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x101fd, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a3f,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11046,
+ 0x11066, 0x1106f,
+ 0x11080, 0x110ba,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x1113f,
+ 0x11180, 0x111c4,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d165, 0x1d169,
+ 0x1d16d, 0x1d172,
+ 0x1d17b, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0x1d242, 0x1d244,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0100, 0xe01ef,
+}; /* CR_Word */
+
+/* 'Alnum': [[:Alnum:]] */
+static const OnigCodePoint CR_Alnum[] = {
+ 566,
+ 0x0030, 0x0039,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0345, 0x0345,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05b0, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0657,
+ 0x0659, 0x0669,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06e1, 0x06e8,
+ 0x06ed, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x073f,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07ea,
+ 0x07f4, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x0817,
+ 0x081a, 0x082c,
+ 0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08e9,
+ 0x08f0, 0x08fe,
+ 0x0900, 0x093b,
+ 0x093d, 0x094c,
+ 0x094e, 0x0950,
+ 0x0955, 0x0963,
+ 0x0966, 0x096f,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bd, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09cc,
+ 0x09ce, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09f1,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4c,
+ 0x0a51, 0x0a51,
+ 0x0a59, 0x0a5c,
+ 0x0a5e, 0x0a5e,
+ 0x0a66, 0x0a75,
+ 0x0a81, 0x0a83,
+ 0x0a85, 0x0a8d,
+ 0x0a8f, 0x0a91,
+ 0x0a93, 0x0aa8,
+ 0x0aaa, 0x0ab0,
+ 0x0ab2, 0x0ab3,
+ 0x0ab5, 0x0ab9,
+ 0x0abd, 0x0ac5,
+ 0x0ac7, 0x0ac9,
+ 0x0acb, 0x0acc,
+ 0x0ad0, 0x0ad0,
+ 0x0ae0, 0x0ae3,
+ 0x0ae6, 0x0aef,
+ 0x0b01, 0x0b03,
+ 0x0b05, 0x0b0c,
+ 0x0b0f, 0x0b10,
+ 0x0b13, 0x0b28,
+ 0x0b2a, 0x0b30,
+ 0x0b32, 0x0b33,
+ 0x0b35, 0x0b39,
+ 0x0b3d, 0x0b44,
+ 0x0b47, 0x0b48,
+ 0x0b4b, 0x0b4c,
+ 0x0b56, 0x0b57,
+ 0x0b5c, 0x0b5d,
+ 0x0b5f, 0x0b63,
+ 0x0b66, 0x0b6f,
+ 0x0b71, 0x0b71,
+ 0x0b82, 0x0b83,
+ 0x0b85, 0x0b8a,
+ 0x0b8e, 0x0b90,
+ 0x0b92, 0x0b95,
+ 0x0b99, 0x0b9a,
+ 0x0b9c, 0x0b9c,
+ 0x0b9e, 0x0b9f,
+ 0x0ba3, 0x0ba4,
+ 0x0ba8, 0x0baa,
+ 0x0bae, 0x0bb9,
+ 0x0bbe, 0x0bc2,
+ 0x0bc6, 0x0bc8,
+ 0x0bca, 0x0bcc,
+ 0x0bd0, 0x0bd0,
+ 0x0bd7, 0x0bd7,
+ 0x0be6, 0x0bef,
+ 0x0c01, 0x0c03,
+ 0x0c05, 0x0c0c,
+ 0x0c0e, 0x0c10,
+ 0x0c12, 0x0c28,
+ 0x0c2a, 0x0c33,
+ 0x0c35, 0x0c39,
+ 0x0c3d, 0x0c44,
+ 0x0c46, 0x0c48,
+ 0x0c4a, 0x0c4c,
+ 0x0c55, 0x0c56,
+ 0x0c58, 0x0c59,
+ 0x0c60, 0x0c63,
+ 0x0c66, 0x0c6f,
+ 0x0c82, 0x0c83,
+ 0x0c85, 0x0c8c,
+ 0x0c8e, 0x0c90,
+ 0x0c92, 0x0ca8,
+ 0x0caa, 0x0cb3,
+ 0x0cb5, 0x0cb9,
+ 0x0cbd, 0x0cc4,
+ 0x0cc6, 0x0cc8,
+ 0x0cca, 0x0ccc,
+ 0x0cd5, 0x0cd6,
+ 0x0cde, 0x0cde,
+ 0x0ce0, 0x0ce3,
+ 0x0ce6, 0x0cef,
+ 0x0cf1, 0x0cf2,
+ 0x0d02, 0x0d03,
+ 0x0d05, 0x0d0c,
+ 0x0d0e, 0x0d10,
+ 0x0d12, 0x0d3a,
+ 0x0d3d, 0x0d44,
+ 0x0d46, 0x0d48,
+ 0x0d4a, 0x0d4c,
+ 0x0d4e, 0x0d4e,
+ 0x0d57, 0x0d57,
+ 0x0d60, 0x0d63,
+ 0x0d66, 0x0d6f,
+ 0x0d7a, 0x0d7f,
+ 0x0d82, 0x0d83,
+ 0x0d85, 0x0d96,
+ 0x0d9a, 0x0db1,
+ 0x0db3, 0x0dbb,
+ 0x0dbd, 0x0dbd,
+ 0x0dc0, 0x0dc6,
+ 0x0dcf, 0x0dd4,
+ 0x0dd6, 0x0dd6,
+ 0x0dd8, 0x0ddf,
+ 0x0df2, 0x0df3,
+ 0x0e01, 0x0e3a,
+ 0x0e40, 0x0e46,
+ 0x0e4d, 0x0e4d,
+ 0x0e50, 0x0e59,
+ 0x0e81, 0x0e82,
+ 0x0e84, 0x0e84,
+ 0x0e87, 0x0e88,
+ 0x0e8a, 0x0e8a,
+ 0x0e8d, 0x0e8d,
+ 0x0e94, 0x0e97,
+ 0x0e99, 0x0e9f,
+ 0x0ea1, 0x0ea3,
+ 0x0ea5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ecd, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f00,
+ 0x0f20, 0x0f29,
+ 0x0f40, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f81,
+ 0x0f88, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x1000, 0x1036,
+ 0x1038, 0x1038,
+ 0x103b, 0x1049,
+ 0x1050, 0x1062,
+ 0x1065, 0x1068,
+ 0x106e, 0x1086,
+ 0x108e, 0x108e,
+ 0x1090, 0x1099,
+ 0x109c, 0x109d,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135f, 0x135f,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1713,
+ 0x1720, 0x1733,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17b3,
+ 0x17b6, 0x17c8,
+ 0x17d7, 0x17d7,
+ 0x17dc, 0x17dc,
+ 0x17e0, 0x17e9,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x1938,
+ 0x1946, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19d9,
+ 0x1a00, 0x1a1b,
+ 0x1a20, 0x1a5e,
+ 0x1a61, 0x1a74,
+ 0x1a80, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa7, 0x1aa7,
+ 0x1b00, 0x1b33,
+ 0x1b35, 0x1b43,
+ 0x1b45, 0x1b4b,
+ 0x1b50, 0x1b59,
+ 0x1b80, 0x1ba9,
+ 0x1bac, 0x1be5,
+ 0x1be7, 0x1bf1,
+ 0x1c00, 0x1c35,
+ 0x1c40, 0x1c49,
+ 0x1c4d, 0x1c7d,
+ 0x1ce9, 0x1cec,
+ 0x1cee, 0x1cf3,
+ 0x1cf5, 0x1cf6,
+ 0x1d00, 0x1dbf,
+ 0x1e00, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fbc,
+ 0x1fbe, 0x1fbe,
+ 0x1fc2, 0x1fc4,
+ 0x1fc6, 0x1fcc,
+ 0x1fd0, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fe0, 0x1fec,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffc,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210a, 0x2113,
+ 0x2115, 0x2115,
+ 0x2119, 0x211d,
+ 0x2124, 0x2124,
+ 0x2126, 0x2126,
+ 0x2128, 0x2128,
+ 0x212a, 0x212d,
+ 0x212f, 0x2139,
+ 0x213c, 0x213f,
+ 0x2145, 0x2149,
+ 0x214e, 0x214e,
+ 0x2160, 0x2188,
+ 0x24b6, 0x24e9,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2ce4,
+ 0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
+ 0x2d6f, 0x2d6f,
+ 0x2d80, 0x2d96,
+ 0x2da0, 0x2da6,
+ 0x2da8, 0x2dae,
+ 0x2db0, 0x2db6,
+ 0x2db8, 0x2dbe,
+ 0x2dc0, 0x2dc6,
+ 0x2dc8, 0x2dce,
+ 0x2dd0, 0x2dd6,
+ 0x2dd8, 0x2dde,
+ 0x2de0, 0x2dff,
+ 0x2e2f, 0x2e2f,
+ 0x3005, 0x3007,
+ 0x3021, 0x3029,
+ 0x3031, 0x3035,
+ 0x3038, 0x303c,
+ 0x3041, 0x3096,
+ 0x309d, 0x309f,
+ 0x30a1, 0x30fa,
+ 0x30fc, 0x30ff,
+ 0x3105, 0x312d,
+ 0x3131, 0x318e,
+ 0x31a0, 0x31ba,
+ 0x31f0, 0x31ff,
+ 0x3400, 0x4db5,
+ 0x4e00, 0x9fcc,
+ 0xa000, 0xa48c,
+ 0xa4d0, 0xa4fd,
+ 0xa500, 0xa60c,
+ 0xa610, 0xa62b,
+ 0xa640, 0xa66e,
+ 0xa674, 0xa67b,
+ 0xa67f, 0xa697,
+ 0xa69f, 0xa6ef,
+ 0xa717, 0xa71f,
+ 0xa722, 0xa788,
+ 0xa78b, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa801,
+ 0xa803, 0xa805,
+ 0xa807, 0xa80a,
+ 0xa80c, 0xa827,
+ 0xa840, 0xa873,
+ 0xa880, 0xa8c3,
+ 0xa8d0, 0xa8d9,
+ 0xa8f2, 0xa8f7,
+ 0xa8fb, 0xa8fb,
+ 0xa900, 0xa92a,
+ 0xa930, 0xa952,
+ 0xa960, 0xa97c,
+ 0xa980, 0xa9b2,
+ 0xa9b4, 0xa9bf,
+ 0xa9cf, 0xa9d9,
+ 0xaa00, 0xaa36,
+ 0xaa40, 0xaa4d,
+ 0xaa50, 0xaa59,
+ 0xaa60, 0xaa76,
+ 0xaa7a, 0xaa7a,
+ 0xaa80, 0xaabe,
+ 0xaac0, 0xaac0,
+ 0xaac2, 0xaac2,
+ 0xaadb, 0xaadd,
+ 0xaae0, 0xaaef,
+ 0xaaf2, 0xaaf5,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabea,
+ 0xabf0, 0xabf9,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb28,
+ 0xfb2a, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff10, 0xff19,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11045,
+ 0x11066, 0x1106f,
+ 0x11082, 0x110b8,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11132,
+ 0x11136, 0x1113f,
+ 0x11180, 0x111bf,
+ 0x111c1, 0x111c4,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b5,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f93, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Alnum */
+
+/* 'ASCII': [[:ASCII:]] */
+static const OnigCodePoint CR_ASCII[] = {
+ 1,
+ 0x0000, 0x007f,
+}; /* CR_ASCII */
+
#ifdef USE_UNICODE_PROPERTIES
/* 'Any': - */
static const OnigCodePoint CR_Any[] = {
@@ -46,7 +4312,7 @@ static const OnigCodePoint CR_Any[] = {
/* 'Assigned': - */
static const OnigCodePoint CR_Assigned[] = {
- 501,
+ 539,
0x0000, 0x0377,
0x037a, 0x037e,
0x0384, 0x038a,
@@ -57,10 +4323,11 @@ static const OnigCodePoint CR_Assigned[] = {
0x0559, 0x055f,
0x0561, 0x0587,
0x0589, 0x058a,
+ 0x058f, 0x058f,
0x0591, 0x05c7,
0x05d0, 0x05ea,
0x05f0, 0x05f4,
- 0x0600, 0x0603,
+ 0x0600, 0x0604,
0x0606, 0x061b,
0x061e, 0x070d,
0x070f, 0x074a,
@@ -70,6 +4337,9 @@ static const OnigCodePoint CR_Assigned[] = {
0x0830, 0x083e,
0x0840, 0x085b,
0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
0x0900, 0x0977,
0x0979, 0x097f,
0x0981, 0x0983,
@@ -114,8 +4384,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x0acb, 0x0acd,
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0af1, 0x0af1,
+ 0x0ae6, 0x0af1,
0x0b01, 0x0b03,
0x0b05, 0x0b0c,
0x0b0f, 0x0b10,
@@ -215,7 +4484,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x0ec6, 0x0ec6,
0x0ec8, 0x0ecd,
0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f47,
0x0f49, 0x0f6c,
0x0f71, 0x0f97,
@@ -223,8 +4492,9 @@ static const OnigCodePoint CR_Assigned[] = {
0x0fbe, 0x0fcc,
0x0fce, 0x0fda,
0x1000, 0x10c5,
- 0x10d0, 0x10fc,
- 0x1100, 0x1248,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -277,13 +4547,12 @@ static const OnigCodePoint CR_Assigned[] = {
0x1aa0, 0x1aad,
0x1b00, 0x1b4b,
0x1b50, 0x1b7c,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1bf3,
+ 0x1b80, 0x1bf3,
0x1bfc, 0x1c37,
0x1c3b, 0x1c49,
0x1c4d, 0x1c7f,
- 0x1cd0, 0x1cf2,
+ 0x1cc0, 0x1cc7,
+ 0x1cd0, 0x1cf6,
0x1d00, 0x1de6,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
@@ -312,15 +4581,15 @@ static const OnigCodePoint CR_Assigned[] = {
0x2400, 0x2426,
0x2440, 0x244a,
0x2460, 0x26ff,
- 0x2701, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x2b4c,
+ 0x2701, 0x2b4c,
0x2b50, 0x2b59,
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
- 0x2c60, 0x2cf1,
+ 0x2c60, 0x2cf3,
0x2cf9, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d70,
0x2d7f, 0x2d96,
0x2da0, 0x2da6,
@@ -331,7 +4600,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x2dc8, 0x2dce,
0x2dd0, 0x2dd6,
0x2dd8, 0x2dde,
- 0x2de0, 0x2e31,
+ 0x2de0, 0x2e3b,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
0x2f00, 0x2fd5,
@@ -346,17 +4615,16 @@ static const OnigCodePoint CR_Assigned[] = {
0x31f0, 0x321e,
0x3220, 0x32fe,
0x3300, 0x4db5,
- 0x4dc0, 0x9fcb,
+ 0x4dc0, 0x9fcc,
0xa000, 0xa48c,
0xa490, 0xa4c6,
0xa4d0, 0xa62b,
- 0xa640, 0xa673,
- 0xa67c, 0xa697,
- 0xa6a0, 0xa6f7,
+ 0xa640, 0xa697,
+ 0xa69f, 0xa6f7,
0xa700, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa82b,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa82b,
0xa830, 0xa839,
0xa840, 0xa877,
0xa880, 0xa8c4,
@@ -372,7 +4640,7 @@ static const OnigCodePoint CR_Assigned[] = {
0xaa50, 0xaa59,
0xaa5c, 0xaa7b,
0xaa80, 0xaac2,
- 0xaadb, 0xaadf,
+ 0xaadb, 0xaaf6,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -383,8 +4651,7 @@ static const OnigCodePoint CR_Assigned[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xd800, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xd800, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -446,6 +4713,8 @@ static const OnigCodePoint CR_Assigned[] = {
0x10900, 0x1091b,
0x1091f, 0x10939,
0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a13,
@@ -464,11 +4733,22 @@ static const OnigCodePoint CR_Assigned[] = {
0x11000, 0x1104d,
0x11052, 0x1106f,
0x11080, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
0x12000, 0x1236e,
0x12400, 0x12462,
0x12470, 0x12473,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
0x1d000, 0x1d0f5,
0x1d100, 0x1d126,
@@ -497,6 +4777,40 @@ static const OnigCodePoint CR_Assigned[] = {
0x1d552, 0x1d6a5,
0x1d6a8, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
@@ -505,7 +4819,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x1f0d1, 0x1f0df,
0x1f100, 0x1f10a,
0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
+ 0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
0x1f1e6, 0x1f202,
0x1f210, 0x1f23a,
@@ -523,19 +4837,9 @@ static const OnigCodePoint CR_Assigned[] = {
0x1f442, 0x1f4f7,
0x1f4f9, 0x1f4fc,
0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
+ 0x1f5fb, 0x1f640,
0x1f645, 0x1f64f,
0x1f680, 0x1f6c5,
0x1f700, 0x1f773,
@@ -552,44 +4856,560 @@ static const OnigCodePoint CR_Assigned[] = {
/* 'C': Major Category */
static const OnigCodePoint CR_C[] = {
- 20,
+ 541,
0x0000, 0x001f,
0x007f, 0x009f,
0x00ad, 0x00ad,
- 0x0600, 0x0603,
+ 0x0378, 0x0379,
+ 0x037f, 0x0383,
+ 0x038b, 0x038b,
+ 0x038d, 0x038d,
+ 0x03a2, 0x03a2,
+ 0x0528, 0x0530,
+ 0x0557, 0x0558,
+ 0x0560, 0x0560,
+ 0x0588, 0x0588,
+ 0x058b, 0x058e,
+ 0x0590, 0x0590,
+ 0x05c8, 0x05cf,
+ 0x05eb, 0x05ef,
+ 0x05f5, 0x0605,
+ 0x061c, 0x061d,
0x06dd, 0x06dd,
- 0x070f, 0x070f,
- 0x17b4, 0x17b5,
+ 0x070e, 0x070f,
+ 0x074b, 0x074c,
+ 0x07b2, 0x07bf,
+ 0x07fb, 0x07ff,
+ 0x082e, 0x082f,
+ 0x083f, 0x083f,
+ 0x085c, 0x085d,
+ 0x085f, 0x089f,
+ 0x08a1, 0x08a1,
+ 0x08ad, 0x08e3,
+ 0x08ff, 0x08ff,
+ 0x0978, 0x0978,
+ 0x0980, 0x0980,
+ 0x0984, 0x0984,
+ 0x098d, 0x098e,
+ 0x0991, 0x0992,
+ 0x09a9, 0x09a9,
+ 0x09b1, 0x09b1,
+ 0x09b3, 0x09b5,
+ 0x09ba, 0x09bb,
+ 0x09c5, 0x09c6,
+ 0x09c9, 0x09ca,
+ 0x09cf, 0x09d6,
+ 0x09d8, 0x09db,
+ 0x09de, 0x09de,
+ 0x09e4, 0x09e5,
+ 0x09fc, 0x0a00,
+ 0x0a04, 0x0a04,
+ 0x0a0b, 0x0a0e,
+ 0x0a11, 0x0a12,
+ 0x0a29, 0x0a29,
+ 0x0a31, 0x0a31,
+ 0x0a34, 0x0a34,
+ 0x0a37, 0x0a37,
+ 0x0a3a, 0x0a3b,
+ 0x0a3d, 0x0a3d,
+ 0x0a43, 0x0a46,
+ 0x0a49, 0x0a4a,
+ 0x0a4e, 0x0a50,
+ 0x0a52, 0x0a58,
+ 0x0a5d, 0x0a5d,
+ 0x0a5f, 0x0a65,
+ 0x0a76, 0x0a80,
+ 0x0a84, 0x0a84,
+ 0x0a8e, 0x0a8e,
+ 0x0a92, 0x0a92,
+ 0x0aa9, 0x0aa9,
+ 0x0ab1, 0x0ab1,
+ 0x0ab4, 0x0ab4,
+ 0x0aba, 0x0abb,
+ 0x0ac6, 0x0ac6,
+ 0x0aca, 0x0aca,
+ 0x0ace, 0x0acf,
+ 0x0ad1, 0x0adf,
+ 0x0ae4, 0x0ae5,
+ 0x0af2, 0x0b00,
+ 0x0b04, 0x0b04,
+ 0x0b0d, 0x0b0e,
+ 0x0b11, 0x0b12,
+ 0x0b29, 0x0b29,
+ 0x0b31, 0x0b31,
+ 0x0b34, 0x0b34,
+ 0x0b3a, 0x0b3b,
+ 0x0b45, 0x0b46,
+ 0x0b49, 0x0b4a,
+ 0x0b4e, 0x0b55,
+ 0x0b58, 0x0b5b,
+ 0x0b5e, 0x0b5e,
+ 0x0b64, 0x0b65,
+ 0x0b78, 0x0b81,
+ 0x0b84, 0x0b84,
+ 0x0b8b, 0x0b8d,
+ 0x0b91, 0x0b91,
+ 0x0b96, 0x0b98,
+ 0x0b9b, 0x0b9b,
+ 0x0b9d, 0x0b9d,
+ 0x0ba0, 0x0ba2,
+ 0x0ba5, 0x0ba7,
+ 0x0bab, 0x0bad,
+ 0x0bba, 0x0bbd,
+ 0x0bc3, 0x0bc5,
+ 0x0bc9, 0x0bc9,
+ 0x0bce, 0x0bcf,
+ 0x0bd1, 0x0bd6,
+ 0x0bd8, 0x0be5,
+ 0x0bfb, 0x0c00,
+ 0x0c04, 0x0c04,
+ 0x0c0d, 0x0c0d,
+ 0x0c11, 0x0c11,
+ 0x0c29, 0x0c29,
+ 0x0c34, 0x0c34,
+ 0x0c3a, 0x0c3c,
+ 0x0c45, 0x0c45,
+ 0x0c49, 0x0c49,
+ 0x0c4e, 0x0c54,
+ 0x0c57, 0x0c57,
+ 0x0c5a, 0x0c5f,
+ 0x0c64, 0x0c65,
+ 0x0c70, 0x0c77,
+ 0x0c80, 0x0c81,
+ 0x0c84, 0x0c84,
+ 0x0c8d, 0x0c8d,
+ 0x0c91, 0x0c91,
+ 0x0ca9, 0x0ca9,
+ 0x0cb4, 0x0cb4,
+ 0x0cba, 0x0cbb,
+ 0x0cc5, 0x0cc5,
+ 0x0cc9, 0x0cc9,
+ 0x0cce, 0x0cd4,
+ 0x0cd7, 0x0cdd,
+ 0x0cdf, 0x0cdf,
+ 0x0ce4, 0x0ce5,
+ 0x0cf0, 0x0cf0,
+ 0x0cf3, 0x0d01,
+ 0x0d04, 0x0d04,
+ 0x0d0d, 0x0d0d,
+ 0x0d11, 0x0d11,
+ 0x0d3b, 0x0d3c,
+ 0x0d45, 0x0d45,
+ 0x0d49, 0x0d49,
+ 0x0d4f, 0x0d56,
+ 0x0d58, 0x0d5f,
+ 0x0d64, 0x0d65,
+ 0x0d76, 0x0d78,
+ 0x0d80, 0x0d81,
+ 0x0d84, 0x0d84,
+ 0x0d97, 0x0d99,
+ 0x0db2, 0x0db2,
+ 0x0dbc, 0x0dbc,
+ 0x0dbe, 0x0dbf,
+ 0x0dc7, 0x0dc9,
+ 0x0dcb, 0x0dce,
+ 0x0dd5, 0x0dd5,
+ 0x0dd7, 0x0dd7,
+ 0x0de0, 0x0df1,
+ 0x0df5, 0x0e00,
+ 0x0e3b, 0x0e3e,
+ 0x0e5c, 0x0e80,
+ 0x0e83, 0x0e83,
+ 0x0e85, 0x0e86,
+ 0x0e89, 0x0e89,
+ 0x0e8b, 0x0e8c,
+ 0x0e8e, 0x0e93,
+ 0x0e98, 0x0e98,
+ 0x0ea0, 0x0ea0,
+ 0x0ea4, 0x0ea4,
+ 0x0ea6, 0x0ea6,
+ 0x0ea8, 0x0ea9,
+ 0x0eac, 0x0eac,
+ 0x0eba, 0x0eba,
+ 0x0ebe, 0x0ebf,
+ 0x0ec5, 0x0ec5,
+ 0x0ec7, 0x0ec7,
+ 0x0ece, 0x0ecf,
+ 0x0eda, 0x0edb,
+ 0x0ee0, 0x0eff,
+ 0x0f48, 0x0f48,
+ 0x0f6d, 0x0f70,
+ 0x0f98, 0x0f98,
+ 0x0fbd, 0x0fbd,
+ 0x0fcd, 0x0fcd,
+ 0x0fdb, 0x0fff,
+ 0x10c6, 0x10c6,
+ 0x10c8, 0x10cc,
+ 0x10ce, 0x10cf,
+ 0x1249, 0x1249,
+ 0x124e, 0x124f,
+ 0x1257, 0x1257,
+ 0x1259, 0x1259,
+ 0x125e, 0x125f,
+ 0x1289, 0x1289,
+ 0x128e, 0x128f,
+ 0x12b1, 0x12b1,
+ 0x12b6, 0x12b7,
+ 0x12bf, 0x12bf,
+ 0x12c1, 0x12c1,
+ 0x12c6, 0x12c7,
+ 0x12d7, 0x12d7,
+ 0x1311, 0x1311,
+ 0x1316, 0x1317,
+ 0x135b, 0x135c,
+ 0x137d, 0x137f,
+ 0x139a, 0x139f,
+ 0x13f5, 0x13ff,
+ 0x169d, 0x169f,
+ 0x16f1, 0x16ff,
+ 0x170d, 0x170d,
+ 0x1715, 0x171f,
+ 0x1737, 0x173f,
+ 0x1754, 0x175f,
+ 0x176d, 0x176d,
+ 0x1771, 0x1771,
+ 0x1774, 0x177f,
+ 0x17de, 0x17df,
+ 0x17ea, 0x17ef,
+ 0x17fa, 0x17ff,
+ 0x180f, 0x180f,
+ 0x181a, 0x181f,
+ 0x1878, 0x187f,
+ 0x18ab, 0x18af,
+ 0x18f6, 0x18ff,
+ 0x191d, 0x191f,
+ 0x192c, 0x192f,
+ 0x193c, 0x193f,
+ 0x1941, 0x1943,
+ 0x196e, 0x196f,
+ 0x1975, 0x197f,
+ 0x19ac, 0x19af,
+ 0x19ca, 0x19cf,
+ 0x19db, 0x19dd,
+ 0x1a1c, 0x1a1d,
+ 0x1a5f, 0x1a5f,
+ 0x1a7d, 0x1a7e,
+ 0x1a8a, 0x1a8f,
+ 0x1a9a, 0x1a9f,
+ 0x1aae, 0x1aff,
+ 0x1b4c, 0x1b4f,
+ 0x1b7d, 0x1b7f,
+ 0x1bf4, 0x1bfb,
+ 0x1c38, 0x1c3a,
+ 0x1c4a, 0x1c4c,
+ 0x1c80, 0x1cbf,
+ 0x1cc8, 0x1ccf,
+ 0x1cf7, 0x1cff,
+ 0x1de7, 0x1dfb,
+ 0x1f16, 0x1f17,
+ 0x1f1e, 0x1f1f,
+ 0x1f46, 0x1f47,
+ 0x1f4e, 0x1f4f,
+ 0x1f58, 0x1f58,
+ 0x1f5a, 0x1f5a,
+ 0x1f5c, 0x1f5c,
+ 0x1f5e, 0x1f5e,
+ 0x1f7e, 0x1f7f,
+ 0x1fb5, 0x1fb5,
+ 0x1fc5, 0x1fc5,
+ 0x1fd4, 0x1fd5,
+ 0x1fdc, 0x1fdc,
+ 0x1ff0, 0x1ff1,
+ 0x1ff5, 0x1ff5,
+ 0x1fff, 0x1fff,
0x200b, 0x200f,
0x202a, 0x202e,
- 0x2060, 0x2064,
- 0x206a, 0x206f,
- 0xd800, 0xf8ff,
- 0xfeff, 0xfeff,
- 0xfff9, 0xfffb,
+ 0x2060, 0x206f,
+ 0x2072, 0x2073,
+ 0x208f, 0x208f,
+ 0x209d, 0x209f,
+ 0x20ba, 0x20cf,
+ 0x20f1, 0x20ff,
+ 0x218a, 0x218f,
+ 0x23f4, 0x23ff,
+ 0x2427, 0x243f,
+ 0x244b, 0x245f,
+ 0x2700, 0x2700,
+ 0x2b4d, 0x2b4f,
+ 0x2b5a, 0x2bff,
+ 0x2c2f, 0x2c2f,
+ 0x2c5f, 0x2c5f,
+ 0x2cf4, 0x2cf8,
+ 0x2d26, 0x2d26,
+ 0x2d28, 0x2d2c,
+ 0x2d2e, 0x2d2f,
+ 0x2d68, 0x2d6e,
+ 0x2d71, 0x2d7e,
+ 0x2d97, 0x2d9f,
+ 0x2da7, 0x2da7,
+ 0x2daf, 0x2daf,
+ 0x2db7, 0x2db7,
+ 0x2dbf, 0x2dbf,
+ 0x2dc7, 0x2dc7,
+ 0x2dcf, 0x2dcf,
+ 0x2dd7, 0x2dd7,
+ 0x2ddf, 0x2ddf,
+ 0x2e3c, 0x2e7f,
+ 0x2e9a, 0x2e9a,
+ 0x2ef4, 0x2eff,
+ 0x2fd6, 0x2fef,
+ 0x2ffc, 0x2fff,
+ 0x3040, 0x3040,
+ 0x3097, 0x3098,
+ 0x3100, 0x3104,
+ 0x312e, 0x3130,
+ 0x318f, 0x318f,
+ 0x31bb, 0x31bf,
+ 0x31e4, 0x31ef,
+ 0x321f, 0x321f,
+ 0x32ff, 0x32ff,
+ 0x4db6, 0x4dbf,
+ 0x9fcd, 0x9fff,
+ 0xa48d, 0xa48f,
+ 0xa4c7, 0xa4cf,
+ 0xa62c, 0xa63f,
+ 0xa698, 0xa69e,
+ 0xa6f8, 0xa6ff,
+ 0xa78f, 0xa78f,
+ 0xa794, 0xa79f,
+ 0xa7ab, 0xa7f7,
+ 0xa82c, 0xa82f,
+ 0xa83a, 0xa83f,
+ 0xa878, 0xa87f,
+ 0xa8c5, 0xa8cd,
+ 0xa8da, 0xa8df,
+ 0xa8fc, 0xa8ff,
+ 0xa954, 0xa95e,
+ 0xa97d, 0xa97f,
+ 0xa9ce, 0xa9ce,
+ 0xa9da, 0xa9dd,
+ 0xa9e0, 0xa9ff,
+ 0xaa37, 0xaa3f,
+ 0xaa4e, 0xaa4f,
+ 0xaa5a, 0xaa5b,
+ 0xaa7c, 0xaa7f,
+ 0xaac3, 0xaada,
+ 0xaaf7, 0xab00,
+ 0xab07, 0xab08,
+ 0xab0f, 0xab10,
+ 0xab17, 0xab1f,
+ 0xab27, 0xab27,
+ 0xab2f, 0xabbf,
+ 0xabee, 0xabef,
+ 0xabfa, 0xabff,
+ 0xd7a4, 0xd7af,
+ 0xd7c7, 0xd7ca,
+ 0xd7fc, 0xf8ff,
+ 0xfa6e, 0xfa6f,
+ 0xfada, 0xfaff,
+ 0xfb07, 0xfb12,
+ 0xfb18, 0xfb1c,
+ 0xfb37, 0xfb37,
+ 0xfb3d, 0xfb3d,
+ 0xfb3f, 0xfb3f,
+ 0xfb42, 0xfb42,
+ 0xfb45, 0xfb45,
+ 0xfbc2, 0xfbd2,
+ 0xfd40, 0xfd4f,
+ 0xfd90, 0xfd91,
+ 0xfdc8, 0xfdef,
+ 0xfdfe, 0xfdff,
+ 0xfe1a, 0xfe1f,
+ 0xfe27, 0xfe2f,
+ 0xfe53, 0xfe53,
+ 0xfe67, 0xfe67,
+ 0xfe6c, 0xfe6f,
+ 0xfe75, 0xfe75,
+ 0xfefd, 0xff00,
+ 0xffbf, 0xffc1,
+ 0xffc8, 0xffc9,
+ 0xffd0, 0xffd1,
+ 0xffd8, 0xffd9,
+ 0xffdd, 0xffdf,
+ 0xffe7, 0xffe7,
+ 0xffef, 0xfffb,
+ 0xfffe, 0xffff,
+ 0x1000c, 0x1000c,
+ 0x10027, 0x10027,
+ 0x1003b, 0x1003b,
+ 0x1003e, 0x1003e,
+ 0x1004e, 0x1004f,
+ 0x1005e, 0x1007f,
+ 0x100fb, 0x100ff,
+ 0x10103, 0x10106,
+ 0x10134, 0x10136,
+ 0x1018b, 0x1018f,
+ 0x1019c, 0x101cf,
+ 0x101fe, 0x1027f,
+ 0x1029d, 0x1029f,
+ 0x102d1, 0x102ff,
+ 0x1031f, 0x1031f,
+ 0x10324, 0x1032f,
+ 0x1034b, 0x1037f,
+ 0x1039e, 0x1039e,
+ 0x103c4, 0x103c7,
+ 0x103d6, 0x103ff,
+ 0x1049e, 0x1049f,
+ 0x104aa, 0x107ff,
+ 0x10806, 0x10807,
+ 0x10809, 0x10809,
+ 0x10836, 0x10836,
+ 0x10839, 0x1083b,
+ 0x1083d, 0x1083e,
+ 0x10856, 0x10856,
+ 0x10860, 0x108ff,
+ 0x1091c, 0x1091e,
+ 0x1093a, 0x1093e,
+ 0x10940, 0x1097f,
+ 0x109b8, 0x109bd,
+ 0x109c0, 0x109ff,
+ 0x10a04, 0x10a04,
+ 0x10a07, 0x10a0b,
+ 0x10a14, 0x10a14,
+ 0x10a18, 0x10a18,
+ 0x10a34, 0x10a37,
+ 0x10a3b, 0x10a3e,
+ 0x10a48, 0x10a4f,
+ 0x10a59, 0x10a5f,
+ 0x10a80, 0x10aff,
+ 0x10b36, 0x10b38,
+ 0x10b56, 0x10b57,
+ 0x10b73, 0x10b77,
+ 0x10b80, 0x10bff,
+ 0x10c49, 0x10e5f,
+ 0x10e7f, 0x10fff,
+ 0x1104e, 0x11051,
+ 0x11070, 0x1107f,
0x110bd, 0x110bd,
+ 0x110c2, 0x110cf,
+ 0x110e9, 0x110ef,
+ 0x110fa, 0x110ff,
+ 0x11135, 0x11135,
+ 0x11144, 0x1117f,
+ 0x111c9, 0x111cf,
+ 0x111da, 0x1167f,
+ 0x116b8, 0x116bf,
+ 0x116ca, 0x11fff,
+ 0x1236f, 0x123ff,
+ 0x12463, 0x1246f,
+ 0x12474, 0x12fff,
+ 0x1342f, 0x167ff,
+ 0x16a39, 0x16eff,
+ 0x16f45, 0x16f4f,
+ 0x16f7f, 0x16f8e,
+ 0x16fa0, 0x1afff,
+ 0x1b002, 0x1cfff,
+ 0x1d0f6, 0x1d0ff,
+ 0x1d127, 0x1d128,
0x1d173, 0x1d17a,
- 0xe0001, 0xe0001,
- 0xe0020, 0xe007f,
- 0xf0000, 0xffffd,
- 0x100000, 0x10ffff,
+ 0x1d1de, 0x1d1ff,
+ 0x1d246, 0x1d2ff,
+ 0x1d357, 0x1d35f,
+ 0x1d372, 0x1d3ff,
+ 0x1d455, 0x1d455,
+ 0x1d49d, 0x1d49d,
+ 0x1d4a0, 0x1d4a1,
+ 0x1d4a3, 0x1d4a4,
+ 0x1d4a7, 0x1d4a8,
+ 0x1d4ad, 0x1d4ad,
+ 0x1d4ba, 0x1d4ba,
+ 0x1d4bc, 0x1d4bc,
+ 0x1d4c4, 0x1d4c4,
+ 0x1d506, 0x1d506,
+ 0x1d50b, 0x1d50c,
+ 0x1d515, 0x1d515,
+ 0x1d51d, 0x1d51d,
+ 0x1d53a, 0x1d53a,
+ 0x1d53f, 0x1d53f,
+ 0x1d545, 0x1d545,
+ 0x1d547, 0x1d549,
+ 0x1d551, 0x1d551,
+ 0x1d6a6, 0x1d6a7,
+ 0x1d7cc, 0x1d7cd,
+ 0x1d800, 0x1edff,
+ 0x1ee04, 0x1ee04,
+ 0x1ee20, 0x1ee20,
+ 0x1ee23, 0x1ee23,
+ 0x1ee25, 0x1ee26,
+ 0x1ee28, 0x1ee28,
+ 0x1ee33, 0x1ee33,
+ 0x1ee38, 0x1ee38,
+ 0x1ee3a, 0x1ee3a,
+ 0x1ee3c, 0x1ee41,
+ 0x1ee43, 0x1ee46,
+ 0x1ee48, 0x1ee48,
+ 0x1ee4a, 0x1ee4a,
+ 0x1ee4c, 0x1ee4c,
+ 0x1ee50, 0x1ee50,
+ 0x1ee53, 0x1ee53,
+ 0x1ee55, 0x1ee56,
+ 0x1ee58, 0x1ee58,
+ 0x1ee5a, 0x1ee5a,
+ 0x1ee5c, 0x1ee5c,
+ 0x1ee5e, 0x1ee5e,
+ 0x1ee60, 0x1ee60,
+ 0x1ee63, 0x1ee63,
+ 0x1ee65, 0x1ee66,
+ 0x1ee6b, 0x1ee6b,
+ 0x1ee73, 0x1ee73,
+ 0x1ee78, 0x1ee78,
+ 0x1ee7d, 0x1ee7d,
+ 0x1ee7f, 0x1ee7f,
+ 0x1ee8a, 0x1ee8a,
+ 0x1ee9c, 0x1eea0,
+ 0x1eea4, 0x1eea4,
+ 0x1eeaa, 0x1eeaa,
+ 0x1eebc, 0x1eeef,
+ 0x1eef2, 0x1efff,
+ 0x1f02c, 0x1f02f,
+ 0x1f094, 0x1f09f,
+ 0x1f0af, 0x1f0b0,
+ 0x1f0bf, 0x1f0c0,
+ 0x1f0d0, 0x1f0d0,
+ 0x1f0e0, 0x1f0ff,
+ 0x1f10b, 0x1f10f,
+ 0x1f12f, 0x1f12f,
+ 0x1f16c, 0x1f16f,
+ 0x1f19b, 0x1f1e5,
+ 0x1f203, 0x1f20f,
+ 0x1f23b, 0x1f23f,
+ 0x1f249, 0x1f24f,
+ 0x1f252, 0x1f2ff,
+ 0x1f321, 0x1f32f,
+ 0x1f336, 0x1f336,
+ 0x1f37d, 0x1f37f,
+ 0x1f394, 0x1f39f,
+ 0x1f3c5, 0x1f3c5,
+ 0x1f3cb, 0x1f3df,
+ 0x1f3f1, 0x1f3ff,
+ 0x1f43f, 0x1f43f,
+ 0x1f441, 0x1f441,
+ 0x1f4f8, 0x1f4f8,
+ 0x1f4fd, 0x1f4ff,
+ 0x1f53e, 0x1f53f,
+ 0x1f544, 0x1f54f,
+ 0x1f568, 0x1f5fa,
+ 0x1f641, 0x1f644,
+ 0x1f650, 0x1f67f,
+ 0x1f6c6, 0x1f6ff,
+ 0x1f774, 0x1ffff,
+ 0x2a6d7, 0x2a6ff,
+ 0x2b735, 0x2b73f,
+ 0x2b81e, 0x2f7ff,
+ 0x2fa1e, 0xe00ff,
+ 0xe01f0, 0x10ffff,
}; /* CR_C */
/* 'Cc': General Category */
-static const OnigCodePoint CR_Cc[] = {
- 2,
- 0x0000, 0x001f,
- 0x007f, 0x009f,
-}; /* CR_Cc */
+#define CR_Cc CR_Cntrl
/* 'Cf': General Category */
static const OnigCodePoint CR_Cf[] = {
- 15,
+ 14,
0x00ad, 0x00ad,
- 0x0600, 0x0603,
+ 0x0600, 0x0604,
0x06dd, 0x06dd,
0x070f, 0x070f,
- 0x17b4, 0x17b5,
0x200b, 0x200f,
0x202a, 0x202e,
0x2060, 0x2064,
@@ -604,7 +5424,7 @@ static const OnigCodePoint CR_Cf[] = {
/* 'Cn': General Category */
static const OnigCodePoint CR_Cn[] = {
- 501,
+ 539,
0x0378, 0x0379,
0x037f, 0x0383,
0x038b, 0x038b,
@@ -614,11 +5434,12 @@ static const OnigCodePoint CR_Cn[] = {
0x0557, 0x0558,
0x0560, 0x0560,
0x0588, 0x0588,
- 0x058b, 0x0590,
+ 0x058b, 0x058e,
+ 0x0590, 0x0590,
0x05c8, 0x05cf,
0x05eb, 0x05ef,
0x05f5, 0x05ff,
- 0x0604, 0x0605,
+ 0x0605, 0x0605,
0x061c, 0x061d,
0x070e, 0x070e,
0x074b, 0x074c,
@@ -627,7 +5448,10 @@ static const OnigCodePoint CR_Cn[] = {
0x082e, 0x082f,
0x083f, 0x083f,
0x085c, 0x085d,
- 0x085f, 0x08ff,
+ 0x085f, 0x089f,
+ 0x08a1, 0x08a1,
+ 0x08ad, 0x08e3,
+ 0x08ff, 0x08ff,
0x0978, 0x0978,
0x0980, 0x0980,
0x0984, 0x0984,
@@ -672,7 +5496,6 @@ static const OnigCodePoint CR_Cn[] = {
0x0ace, 0x0acf,
0x0ad1, 0x0adf,
0x0ae4, 0x0ae5,
- 0x0af0, 0x0af0,
0x0af2, 0x0b00,
0x0b04, 0x0b04,
0x0b0d, 0x0b0e,
@@ -773,15 +5596,16 @@ static const OnigCodePoint CR_Cn[] = {
0x0ec7, 0x0ec7,
0x0ece, 0x0ecf,
0x0eda, 0x0edb,
- 0x0ede, 0x0eff,
+ 0x0ee0, 0x0eff,
0x0f48, 0x0f48,
0x0f6d, 0x0f70,
0x0f98, 0x0f98,
0x0fbd, 0x0fbd,
0x0fcd, 0x0fcd,
0x0fdb, 0x0fff,
- 0x10c6, 0x10cf,
- 0x10fd, 0x10ff,
+ 0x10c6, 0x10c6,
+ 0x10c8, 0x10cc,
+ 0x10ce, 0x10cf,
0x1249, 0x1249,
0x124e, 0x124f,
0x1257, 0x1257,
@@ -835,13 +5659,12 @@ static const OnigCodePoint CR_Cn[] = {
0x1aae, 0x1aff,
0x1b4c, 0x1b4f,
0x1b7d, 0x1b7f,
- 0x1bab, 0x1bad,
- 0x1bba, 0x1bbf,
0x1bf4, 0x1bfb,
0x1c38, 0x1c3a,
0x1c4a, 0x1c4c,
- 0x1c80, 0x1ccf,
- 0x1cf3, 0x1cff,
+ 0x1c80, 0x1cbf,
+ 0x1cc8, 0x1ccf,
+ 0x1cf7, 0x1cff,
0x1de7, 0x1dfb,
0x1f16, 0x1f17,
0x1f1e, 0x1f1f,
@@ -870,15 +5693,15 @@ static const OnigCodePoint CR_Cn[] = {
0x2427, 0x243f,
0x244b, 0x245f,
0x2700, 0x2700,
- 0x27cb, 0x27cb,
- 0x27cd, 0x27cd,
0x2b4d, 0x2b4f,
0x2b5a, 0x2bff,
0x2c2f, 0x2c2f,
0x2c5f, 0x2c5f,
- 0x2cf2, 0x2cf8,
- 0x2d26, 0x2d2f,
- 0x2d66, 0x2d6e,
+ 0x2cf4, 0x2cf8,
+ 0x2d26, 0x2d26,
+ 0x2d28, 0x2d2c,
+ 0x2d2e, 0x2d2f,
+ 0x2d68, 0x2d6e,
0x2d71, 0x2d7e,
0x2d97, 0x2d9f,
0x2da7, 0x2da7,
@@ -889,7 +5712,7 @@ static const OnigCodePoint CR_Cn[] = {
0x2dcf, 0x2dcf,
0x2dd7, 0x2dd7,
0x2ddf, 0x2ddf,
- 0x2e32, 0x2e7f,
+ 0x2e3c, 0x2e7f,
0x2e9a, 0x2e9a,
0x2ef4, 0x2eff,
0x2fd6, 0x2fef,
@@ -904,16 +5727,15 @@ static const OnigCodePoint CR_Cn[] = {
0x321f, 0x321f,
0x32ff, 0x32ff,
0x4db6, 0x4dbf,
- 0x9fcc, 0x9fff,
+ 0x9fcd, 0x9fff,
0xa48d, 0xa48f,
0xa4c7, 0xa4cf,
0xa62c, 0xa63f,
- 0xa674, 0xa67b,
- 0xa698, 0xa69f,
+ 0xa698, 0xa69e,
0xa6f8, 0xa6ff,
0xa78f, 0xa78f,
- 0xa792, 0xa79f,
- 0xa7aa, 0xa7f9,
+ 0xa794, 0xa79f,
+ 0xa7ab, 0xa7f7,
0xa82c, 0xa82f,
0xa83a, 0xa83f,
0xa878, 0xa87f,
@@ -930,7 +5752,7 @@ static const OnigCodePoint CR_Cn[] = {
0xaa5a, 0xaa5b,
0xaa7c, 0xaa7f,
0xaac3, 0xaada,
- 0xaae0, 0xab00,
+ 0xaaf7, 0xab00,
0xab07, 0xab08,
0xab0f, 0xab10,
0xab17, 0xab1f,
@@ -941,7 +5763,6 @@ static const OnigCodePoint CR_Cn[] = {
0xd7a4, 0xd7af,
0xd7c7, 0xd7ca,
0xd7fc, 0xd7ff,
- 0xfa2e, 0xfa2f,
0xfa6e, 0xfa6f,
0xfada, 0xfaff,
0xfb07, 0xfb12,
@@ -1003,7 +5824,9 @@ static const OnigCodePoint CR_Cn[] = {
0x10860, 0x108ff,
0x1091c, 0x1091e,
0x1093a, 0x1093e,
- 0x10940, 0x109ff,
+ 0x10940, 0x1097f,
+ 0x109b8, 0x109bd,
+ 0x109c0, 0x109ff,
0x10a04, 0x10a04,
0x10a07, 0x10a0b,
0x10a14, 0x10a14,
@@ -1021,12 +5844,23 @@ static const OnigCodePoint CR_Cn[] = {
0x10e7f, 0x10fff,
0x1104e, 0x11051,
0x11070, 0x1107f,
- 0x110c2, 0x11fff,
+ 0x110c2, 0x110cf,
+ 0x110e9, 0x110ef,
+ 0x110fa, 0x110ff,
+ 0x11135, 0x11135,
+ 0x11144, 0x1117f,
+ 0x111c9, 0x111cf,
+ 0x111da, 0x1167f,
+ 0x116b8, 0x116bf,
+ 0x116ca, 0x11fff,
0x1236f, 0x123ff,
0x12463, 0x1246f,
0x12474, 0x12fff,
0x1342f, 0x167ff,
- 0x16a39, 0x1afff,
+ 0x16a39, 0x16eff,
+ 0x16f45, 0x16f4f,
+ 0x16f7f, 0x16f8e,
+ 0x16fa0, 0x1afff,
0x1b002, 0x1cfff,
0x1d0f6, 0x1d0ff,
0x1d127, 0x1d128,
@@ -1054,7 +5888,41 @@ static const OnigCodePoint CR_Cn[] = {
0x1d551, 0x1d551,
0x1d6a6, 0x1d6a7,
0x1d7cc, 0x1d7cd,
- 0x1d800, 0x1efff,
+ 0x1d800, 0x1edff,
+ 0x1ee04, 0x1ee04,
+ 0x1ee20, 0x1ee20,
+ 0x1ee23, 0x1ee23,
+ 0x1ee25, 0x1ee26,
+ 0x1ee28, 0x1ee28,
+ 0x1ee33, 0x1ee33,
+ 0x1ee38, 0x1ee38,
+ 0x1ee3a, 0x1ee3a,
+ 0x1ee3c, 0x1ee41,
+ 0x1ee43, 0x1ee46,
+ 0x1ee48, 0x1ee48,
+ 0x1ee4a, 0x1ee4a,
+ 0x1ee4c, 0x1ee4c,
+ 0x1ee50, 0x1ee50,
+ 0x1ee53, 0x1ee53,
+ 0x1ee55, 0x1ee56,
+ 0x1ee58, 0x1ee58,
+ 0x1ee5a, 0x1ee5a,
+ 0x1ee5c, 0x1ee5c,
+ 0x1ee5e, 0x1ee5e,
+ 0x1ee60, 0x1ee60,
+ 0x1ee63, 0x1ee63,
+ 0x1ee65, 0x1ee66,
+ 0x1ee6b, 0x1ee6b,
+ 0x1ee73, 0x1ee73,
+ 0x1ee78, 0x1ee78,
+ 0x1ee7d, 0x1ee7d,
+ 0x1ee7f, 0x1ee7f,
+ 0x1ee8a, 0x1ee8a,
+ 0x1ee9c, 0x1eea0,
+ 0x1eea4, 0x1eea4,
+ 0x1eeaa, 0x1eeaa,
+ 0x1eebc, 0x1eeef,
+ 0x1eef2, 0x1efff,
0x1f02c, 0x1f02f,
0x1f094, 0x1f09f,
0x1f0af, 0x1f0b0,
@@ -1063,7 +5931,7 @@ static const OnigCodePoint CR_Cn[] = {
0x1f0e0, 0x1f0ff,
0x1f10b, 0x1f10f,
0x1f12f, 0x1f12f,
- 0x1f16a, 0x1f16f,
+ 0x1f16c, 0x1f16f,
0x1f19b, 0x1f1e5,
0x1f203, 0x1f20f,
0x1f23b, 0x1f23f,
@@ -1080,19 +5948,9 @@ static const OnigCodePoint CR_Cn[] = {
0x1f441, 0x1f441,
0x1f4f8, 0x1f4f8,
0x1f4fd, 0x1f4ff,
- 0x1f53e, 0x1f54f,
+ 0x1f53e, 0x1f53f,
+ 0x1f544, 0x1f54f,
0x1f568, 0x1f5fa,
- 0x1f600, 0x1f600,
- 0x1f611, 0x1f611,
- 0x1f615, 0x1f615,
- 0x1f617, 0x1f617,
- 0x1f619, 0x1f619,
- 0x1f61b, 0x1f61b,
- 0x1f61f, 0x1f61f,
- 0x1f626, 0x1f627,
- 0x1f62c, 0x1f62c,
- 0x1f62e, 0x1f62f,
- 0x1f634, 0x1f634,
0x1f641, 0x1f644,
0x1f650, 0x1f67f,
0x1f6c6, 0x1f6ff,
@@ -1124,7 +5982,7 @@ static const OnigCodePoint CR_Cs[] = {
/* 'L': Major Category */
static const OnigCodePoint CR_L[] = {
- 435,
+ 486,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -1172,6 +6030,8 @@ static const OnigCodePoint CR_L[] = {
0x0824, 0x0824,
0x0828, 0x0828,
0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
0x0904, 0x0939,
0x093d, 0x093d,
0x0950, 0x0950,
@@ -1277,7 +6137,7 @@ static const OnigCodePoint CR_L[] = {
0x0ebd, 0x0ebd,
0x0ec0, 0x0ec4,
0x0ec6, 0x0ec6,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f00,
0x0f40, 0x0f47,
0x0f49, 0x0f6c,
@@ -1292,9 +6152,10 @@ static const OnigCodePoint CR_L[] = {
0x1075, 0x1081,
0x108e, 0x108e,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
+ 0x10fc, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -1341,12 +6202,13 @@ static const OnigCodePoint CR_L[] = {
0x1b45, 0x1b4b,
0x1b83, 0x1ba0,
0x1bae, 0x1baf,
- 0x1bc0, 0x1be5,
+ 0x1bba, 0x1be5,
0x1c00, 0x1c23,
0x1c4d, 0x1c4f,
0x1c5a, 0x1c7d,
0x1ce9, 0x1cec,
0x1cee, 0x1cf1,
+ 0x1cf5, 0x1cf6,
0x1d00, 0x1dbf,
0x1e00, 0x1f15,
0x1f18, 0x1f1d,
@@ -1388,8 +6250,11 @@ static const OnigCodePoint CR_L[] = {
0x2c30, 0x2c5e,
0x2c60, 0x2ce4,
0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d6f,
0x2d80, 0x2d96,
0x2da0, 0x2da6,
@@ -1413,7 +6278,7 @@ static const OnigCodePoint CR_L[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
@@ -1425,9 +6290,9 @@ static const OnigCodePoint CR_L[] = {
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa801,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa822,
@@ -1452,6 +6317,8 @@ static const OnigCodePoint CR_L[] = {
0xaac0, 0xaac0,
0xaac2, 0xaac2,
0xaadb, 0xaadd,
+ 0xaae0, 0xaaea,
+ 0xaaf2, 0xaaf4,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -1461,8 +6328,7 @@ static const OnigCodePoint CR_L[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -1511,6 +6377,8 @@ static const OnigCodePoint CR_L[] = {
0x1083f, 0x10855,
0x10900, 0x10915,
0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a00,
0x10a10, 0x10a13,
0x10a15, 0x10a17,
@@ -1522,9 +6390,17 @@ static const OnigCodePoint CR_L[] = {
0x10c00, 0x10c48,
0x11003, 0x11037,
0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
0x12000, 0x1236e,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f50,
+ 0x16f93, 0x16f9f,
0x1b000, 0x1b001,
0x1d400, 0x1d454,
0x1d456, 0x1d49c,
@@ -1556,19 +6432,168 @@ static const OnigCodePoint CR_L[] = {
0x1d78a, 0x1d7a8,
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
0x2f800, 0x2fa1d,
}; /* CR_L */
+/* 'LC': General Category */
+static const OnigCodePoint CR_LC[] = {
+ 113,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00b5, 0x00b5,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x01ba,
+ 0x01bc, 0x01bf,
+ 0x01c4, 0x0293,
+ 0x0295, 0x02af,
+ 0x0370, 0x0373,
+ 0x0376, 0x0377,
+ 0x037b, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0561, 0x0587,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x1d00, 0x1d2b,
+ 0x1d6b, 0x1d77,
+ 0x1d79, 0x1d9a,
+ 0x1e00, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fbc,
+ 0x1fbe, 0x1fbe,
+ 0x1fc2, 0x1fc4,
+ 0x1fc6, 0x1fcc,
+ 0x1fd0, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fe0, 0x1fec,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffc,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210a, 0x2113,
+ 0x2115, 0x2115,
+ 0x2119, 0x211d,
+ 0x2124, 0x2124,
+ 0x2126, 0x2126,
+ 0x2128, 0x2128,
+ 0x212a, 0x212d,
+ 0x212f, 0x2134,
+ 0x2139, 0x2139,
+ 0x213c, 0x213f,
+ 0x2145, 0x2149,
+ 0x214e, 0x214e,
+ 0x2183, 0x2184,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2c7b,
+ 0x2c7e, 0x2ce4,
+ 0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0xa640, 0xa66d,
+ 0xa680, 0xa697,
+ 0xa722, 0xa76f,
+ 0xa771, 0xa787,
+ 0xa78b, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7fa, 0xa7fa,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0x10400, 0x1044f,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+}; /* CR_LC */
+
/* 'Ll': General Category */
static const OnigCodePoint CR_Ll[] = {
- 609,
+ 611,
0x0061, 0x007a,
- 0x00aa, 0x00aa,
0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
0x00df, 0x00f6,
0x00f8, 0x00ff,
0x0101, 0x0101,
@@ -1834,7 +6859,7 @@ static const OnigCodePoint CR_Ll[] = {
0x0527, 0x0527,
0x0561, 0x0587,
0x1d00, 0x1d2b,
- 0x1d62, 0x1d77,
+ 0x1d6b, 0x1d77,
0x1d79, 0x1d9a,
0x1e01, 0x1e01,
0x1e03, 0x1e03,
@@ -1998,7 +7023,7 @@ static const OnigCodePoint CR_Ll[] = {
0x2c6c, 0x2c6c,
0x2c71, 0x2c71,
0x2c73, 0x2c74,
- 0x2c76, 0x2c7c,
+ 0x2c76, 0x2c7b,
0x2c81, 0x2c81,
0x2c83, 0x2c83,
0x2c85, 0x2c85,
@@ -2051,7 +7076,10 @@ static const OnigCodePoint CR_Ll[] = {
0x2ce3, 0x2ce4,
0x2cec, 0x2cec,
0x2cee, 0x2cee,
+ 0x2cf3, 0x2cf3,
0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
0xa641, 0xa641,
0xa643, 0xa643,
0xa645, 0xa645,
@@ -2136,6 +7164,7 @@ static const OnigCodePoint CR_Ll[] = {
0xa78c, 0xa78c,
0xa78e, 0xa78e,
0xa791, 0xa791,
+ 0xa793, 0xa793,
0xa7a1, 0xa7a1,
0xa7a3, 0xa7a3,
0xa7a5, 0xa7a5,
@@ -2178,7 +7207,7 @@ static const OnigCodePoint CR_Ll[] = {
/* 'Lm': General Category */
static const OnigCodePoint CR_Lm[] = {
- 49,
+ 52,
0x02b0, 0x02c1,
0x02c6, 0x02d1,
0x02e0, 0x02e4,
@@ -2202,13 +7231,13 @@ static const OnigCodePoint CR_Lm[] = {
0x1843, 0x1843,
0x1aa7, 0x1aa7,
0x1c78, 0x1c7d,
- 0x1d2c, 0x1d61,
+ 0x1d2c, 0x1d6a,
0x1d78, 0x1d78,
0x1d9b, 0x1dbf,
0x2071, 0x2071,
0x207f, 0x207f,
0x2090, 0x209c,
- 0x2c7d, 0x2c7d,
+ 0x2c7c, 0x2c7d,
0x2d6f, 0x2d6f,
0x2e2f, 0x2e2f,
0x3005, 0x3005,
@@ -2223,16 +7252,21 @@ static const OnigCodePoint CR_Lm[] = {
0xa717, 0xa71f,
0xa770, 0xa770,
0xa788, 0xa788,
+ 0xa7f8, 0xa7f9,
0xa9cf, 0xa9cf,
0xaa70, 0xaa70,
0xaadd, 0xaadd,
+ 0xaaf3, 0xaaf4,
0xff70, 0xff70,
0xff9e, 0xff9f,
+ 0x16f93, 0x16f9f,
}; /* CR_Lm */
/* 'Lo': General Category */
static const OnigCodePoint CR_Lo[] = {
- 323,
+ 371,
+ 0x00aa, 0x00aa,
+ 0x00ba, 0x00ba,
0x01bb, 0x01bb,
0x01c0, 0x01c3,
0x0294, 0x0294,
@@ -2253,6 +7287,8 @@ static const OnigCodePoint CR_Lo[] = {
0x07ca, 0x07ea,
0x0800, 0x0815,
0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
0x0904, 0x0939,
0x093d, 0x093d,
0x0950, 0x0950,
@@ -2357,7 +7393,7 @@ static const OnigCodePoint CR_Lo[] = {
0x0eb2, 0x0eb3,
0x0ebd, 0x0ebd,
0x0ec0, 0x0ec4,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f00,
0x0f40, 0x0f47,
0x0f49, 0x0f6c,
@@ -2372,7 +7408,7 @@ static const OnigCodePoint CR_Lo[] = {
0x1075, 0x1081,
0x108e, 0x108e,
0x10d0, 0x10fa,
- 0x1100, 0x1248,
+ 0x10fd, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -2418,14 +7454,15 @@ static const OnigCodePoint CR_Lo[] = {
0x1b45, 0x1b4b,
0x1b83, 0x1ba0,
0x1bae, 0x1baf,
- 0x1bc0, 0x1be5,
+ 0x1bba, 0x1be5,
0x1c00, 0x1c23,
0x1c4d, 0x1c4f,
0x1c5a, 0x1c77,
0x1ce9, 0x1cec,
0x1cee, 0x1cf1,
+ 0x1cf5, 0x1cf6,
0x2135, 0x2138,
- 0x2d30, 0x2d65,
+ 0x2d30, 0x2d67,
0x2d80, 0x2d96,
0x2da0, 0x2da6,
0x2da8, 0x2dae,
@@ -2446,7 +7483,7 @@ static const OnigCodePoint CR_Lo[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xa000, 0xa014,
0xa016, 0xa48c,
0xa4d0, 0xa4f7,
@@ -2480,6 +7517,8 @@ static const OnigCodePoint CR_Lo[] = {
0xaac0, 0xaac0,
0xaac2, 0xaac2,
0xaadb, 0xaadc,
+ 0xaae0, 0xaaea,
+ 0xaaf2, 0xaaf2,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -2489,8 +7528,7 @@ static const OnigCodePoint CR_Lo[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb1d, 0xfb1d,
0xfb1f, 0xfb28,
@@ -2537,6 +7575,8 @@ static const OnigCodePoint CR_Lo[] = {
0x1083f, 0x10855,
0x10900, 0x10915,
0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a00,
0x10a10, 0x10a13,
0x10a15, 0x10a17,
@@ -2548,10 +7588,50 @@ static const OnigCodePoint CR_Lo[] = {
0x10c00, 0x10c48,
0x11003, 0x11037,
0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
0x12000, 0x1236e,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f50,
0x1b000, 0x1b001,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -2575,7 +7655,7 @@ static const OnigCodePoint CR_Lt[] = {
/* 'Lu': General Category */
static const OnigCodePoint CR_Lu[] = {
- 603,
+ 608,
0x0041, 0x005a,
0x00c0, 0x00d6,
0x00d8, 0x00de,
@@ -2844,6 +7924,8 @@ static const OnigCodePoint CR_Lu[] = {
0x0526, 0x0526,
0x0531, 0x0556,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x1e00, 0x1e00,
0x1e02, 0x1e02,
0x1e04, 0x1e04,
@@ -3058,6 +8140,7 @@ static const OnigCodePoint CR_Lu[] = {
0x2ce2, 0x2ce2,
0x2ceb, 0x2ceb,
0x2ced, 0x2ced,
+ 0x2cf2, 0x2cf2,
0xa640, 0xa640,
0xa642, 0xa642,
0xa644, 0xa644,
@@ -3141,11 +8224,13 @@ static const OnigCodePoint CR_Lu[] = {
0xa78b, 0xa78b,
0xa78d, 0xa78d,
0xa790, 0xa790,
+ 0xa792, 0xa792,
0xa7a0, 0xa7a0,
0xa7a2, 0xa7a2,
0xa7a4, 0xa7a4,
0xa7a6, 0xa7a6,
0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
0xff21, 0xff3a,
0x10400, 0x10427,
0x1d400, 0x1d419,
@@ -3183,7 +8268,7 @@ static const OnigCodePoint CR_Lu[] = {
/* 'M': Major Category */
static const OnigCodePoint CR_M[] = {
- 193,
+ 204,
0x0300, 0x036f,
0x0483, 0x0489,
0x0591, 0x05bd,
@@ -3207,6 +8292,7 @@ static const OnigCodePoint CR_M[] = {
0x0825, 0x0827,
0x0829, 0x082d,
0x0859, 0x085b,
+ 0x08e4, 0x08fe,
0x0900, 0x0903,
0x093a, 0x093c,
0x093e, 0x094f,
@@ -3301,7 +8387,7 @@ static const OnigCodePoint CR_M[] = {
0x1732, 0x1734,
0x1752, 0x1753,
0x1772, 0x1773,
- 0x17b6, 0x17d3,
+ 0x17b4, 0x17d3,
0x17dd, 0x17dd,
0x180b, 0x180d,
0x18a9, 0x18a9,
@@ -3317,13 +8403,13 @@ static const OnigCodePoint CR_M[] = {
0x1b34, 0x1b44,
0x1b6b, 0x1b73,
0x1b80, 0x1b82,
- 0x1ba1, 0x1baa,
+ 0x1ba1, 0x1bad,
0x1be6, 0x1bf3,
0x1c24, 0x1c37,
0x1cd0, 0x1cd2,
0x1cd4, 0x1ce8,
0x1ced, 0x1ced,
- 0x1cf2, 0x1cf2,
+ 0x1cf2, 0x1cf4,
0x1dc0, 0x1de6,
0x1dfc, 0x1dff,
0x20d0, 0x20f0,
@@ -3333,7 +8419,8 @@ static const OnigCodePoint CR_M[] = {
0x302a, 0x302f,
0x3099, 0x309a,
0xa66f, 0xa672,
- 0xa67c, 0xa67d,
+ 0xa674, 0xa67d,
+ 0xa69f, 0xa69f,
0xa6f0, 0xa6f1,
0xa802, 0xa802,
0xa806, 0xa806,
@@ -3355,6 +8442,8 @@ static const OnigCodePoint CR_M[] = {
0xaab7, 0xaab8,
0xaabe, 0xaabf,
0xaac1, 0xaac1,
+ 0xaaeb, 0xaaef,
+ 0xaaf5, 0xaaf6,
0xabe3, 0xabea,
0xabec, 0xabed,
0xfb1e, 0xfb1e,
@@ -3370,6 +8459,13 @@ static const OnigCodePoint CR_M[] = {
0x11038, 0x11046,
0x11080, 0x11082,
0x110b0, 0x110ba,
+ 0x11100, 0x11102,
+ 0x11127, 0x11134,
+ 0x11180, 0x11182,
+ 0x111b3, 0x111c0,
+ 0x116ab, 0x116b7,
+ 0x16f51, 0x16f7e,
+ 0x16f8f, 0x16f92,
0x1d165, 0x1d169,
0x1d16d, 0x1d172,
0x1d17b, 0x1d182,
@@ -3381,7 +8477,7 @@ static const OnigCodePoint CR_M[] = {
/* 'Mc': General Category */
static const OnigCodePoint CR_Mc[] = {
- 113,
+ 126,
0x0903, 0x0903,
0x093b, 0x093b,
0x093e, 0x0940,
@@ -3463,6 +8559,7 @@ static const OnigCodePoint CR_Mc[] = {
0x1ba1, 0x1ba1,
0x1ba6, 0x1ba7,
0x1baa, 0x1baa,
+ 0x1bac, 0x1bad,
0x1be7, 0x1be7,
0x1bea, 0x1bec,
0x1bee, 0x1bee,
@@ -3470,7 +8567,8 @@ static const OnigCodePoint CR_Mc[] = {
0x1c24, 0x1c2b,
0x1c34, 0x1c35,
0x1ce1, 0x1ce1,
- 0x1cf2, 0x1cf2,
+ 0x1cf2, 0x1cf3,
+ 0x302e, 0x302f,
0xa823, 0xa824,
0xa827, 0xa827,
0xa880, 0xa881,
@@ -3484,6 +8582,9 @@ static const OnigCodePoint CR_Mc[] = {
0xaa33, 0xaa34,
0xaa4d, 0xaa4d,
0xaa7b, 0xaa7b,
+ 0xaaeb, 0xaaeb,
+ 0xaaee, 0xaaef,
+ 0xaaf5, 0xaaf5,
0xabe3, 0xabe4,
0xabe6, 0xabe7,
0xabe9, 0xabea,
@@ -3493,6 +8594,14 @@ static const OnigCodePoint CR_Mc[] = {
0x11082, 0x11082,
0x110b0, 0x110b2,
0x110b7, 0x110b8,
+ 0x1112c, 0x1112c,
+ 0x11182, 0x11182,
+ 0x111b3, 0x111b5,
+ 0x111bf, 0x111c0,
+ 0x116ac, 0x116ac,
+ 0x116ae, 0x116af,
+ 0x116b6, 0x116b6,
+ 0x16f51, 0x16f7e,
0x1d165, 0x1d166,
0x1d16d, 0x1d172,
}; /* CR_Mc */
@@ -3508,7 +8617,7 @@ static const OnigCodePoint CR_Me[] = {
/* 'Mn': General Category */
static const OnigCodePoint CR_Mn[] = {
- 203,
+ 220,
0x0300, 0x036f,
0x0483, 0x0487,
0x0591, 0x05bd,
@@ -3532,6 +8641,7 @@ static const OnigCodePoint CR_Mn[] = {
0x0825, 0x0827,
0x0829, 0x082d,
0x0859, 0x085b,
+ 0x08e4, 0x08fe,
0x0900, 0x0902,
0x093a, 0x093a,
0x093c, 0x093c,
@@ -3617,6 +8727,7 @@ static const OnigCodePoint CR_Mn[] = {
0x1732, 0x1734,
0x1752, 0x1753,
0x1772, 0x1773,
+ 0x17b4, 0x17b5,
0x17b7, 0x17bd,
0x17c6, 0x17c6,
0x17c9, 0x17d3,
@@ -3644,6 +8755,7 @@ static const OnigCodePoint CR_Mn[] = {
0x1b80, 0x1b81,
0x1ba2, 0x1ba5,
0x1ba8, 0x1ba9,
+ 0x1bab, 0x1bab,
0x1be6, 0x1be6,
0x1be8, 0x1be9,
0x1bed, 0x1bed,
@@ -3654,6 +8766,7 @@ static const OnigCodePoint CR_Mn[] = {
0x1cd4, 0x1ce0,
0x1ce2, 0x1ce8,
0x1ced, 0x1ced,
+ 0x1cf4, 0x1cf4,
0x1dc0, 0x1de6,
0x1dfc, 0x1dff,
0x20d0, 0x20dc,
@@ -3662,10 +8775,11 @@ static const OnigCodePoint CR_Mn[] = {
0x2cef, 0x2cf1,
0x2d7f, 0x2d7f,
0x2de0, 0x2dff,
- 0x302a, 0x302f,
+ 0x302a, 0x302d,
0x3099, 0x309a,
0xa66f, 0xa66f,
- 0xa67c, 0xa67d,
+ 0xa674, 0xa67d,
+ 0xa69f, 0xa69f,
0xa6f0, 0xa6f1,
0xa802, 0xa802,
0xa806, 0xa806,
@@ -3689,6 +8803,8 @@ static const OnigCodePoint CR_Mn[] = {
0xaab7, 0xaab8,
0xaabe, 0xaabf,
0xaac1, 0xaac1,
+ 0xaaec, 0xaaed,
+ 0xaaf6, 0xaaf6,
0xabe5, 0xabe5,
0xabe8, 0xabe8,
0xabed, 0xabed,
@@ -3706,6 +8822,16 @@ static const OnigCodePoint CR_Mn[] = {
0x11080, 0x11081,
0x110b3, 0x110b6,
0x110b9, 0x110ba,
+ 0x11100, 0x11102,
+ 0x11127, 0x1112b,
+ 0x1112d, 0x11134,
+ 0x11180, 0x11181,
+ 0x111b6, 0x111be,
+ 0x116ab, 0x116ab,
+ 0x116ad, 0x116ad,
+ 0x116b0, 0x116b5,
+ 0x116b7, 0x116b7,
+ 0x16f8f, 0x16f92,
0x1d167, 0x1d169,
0x1d17b, 0x1d182,
0x1d185, 0x1d18b,
@@ -3716,7 +8842,7 @@ static const OnigCodePoint CR_Mn[] = {
/* 'N': Major Category */
static const OnigCodePoint CR_N[] = {
- 83,
+ 88,
0x0030, 0x0039,
0x00b2, 0x00b3,
0x00b9, 0x00b9,
@@ -3768,6 +8894,7 @@ static const OnigCodePoint CR_N[] = {
0x3038, 0x303a,
0x3192, 0x3195,
0x3220, 0x3229,
+ 0x3248, 0x324f,
0x3251, 0x325f,
0x3280, 0x3289,
0x32b1, 0x32bf,
@@ -3796,6 +8923,10 @@ static const OnigCodePoint CR_N[] = {
0x10b78, 0x10b7f,
0x10e60, 0x10e7e,
0x11052, 0x1106f,
+ 0x110f0, 0x110f9,
+ 0x11136, 0x1113f,
+ 0x111d0, 0x111d9,
+ 0x116c0, 0x116c9,
0x12400, 0x12462,
0x1d360, 0x1d371,
0x1d7ce, 0x1d7ff,
@@ -3803,47 +8934,7 @@ static const OnigCodePoint CR_N[] = {
}; /* CR_N */
/* 'Nd': General Category */
-static const OnigCodePoint CR_Nd[] = {
- 38,
- 0x0030, 0x0039,
- 0x0660, 0x0669,
- 0x06f0, 0x06f9,
- 0x07c0, 0x07c9,
- 0x0966, 0x096f,
- 0x09e6, 0x09ef,
- 0x0a66, 0x0a6f,
- 0x0ae6, 0x0aef,
- 0x0b66, 0x0b6f,
- 0x0be6, 0x0bef,
- 0x0c66, 0x0c6f,
- 0x0ce6, 0x0cef,
- 0x0d66, 0x0d6f,
- 0x0e50, 0x0e59,
- 0x0ed0, 0x0ed9,
- 0x0f20, 0x0f29,
- 0x1040, 0x1049,
- 0x1090, 0x1099,
- 0x17e0, 0x17e9,
- 0x1810, 0x1819,
- 0x1946, 0x194f,
- 0x19d0, 0x19d9,
- 0x1a80, 0x1a89,
- 0x1a90, 0x1a99,
- 0x1b50, 0x1b59,
- 0x1bb0, 0x1bb9,
- 0x1c40, 0x1c49,
- 0x1c50, 0x1c59,
- 0xa620, 0xa629,
- 0xa8d0, 0xa8d9,
- 0xa900, 0xa909,
- 0xa9d0, 0xa9d9,
- 0xaa50, 0xaa59,
- 0xabf0, 0xabf9,
- 0xff10, 0xff19,
- 0x104a0, 0x104a9,
- 0x11066, 0x1106f,
- 0x1d7ce, 0x1d7ff,
-}; /* CR_Nd */
+#define CR_Nd CR_Digit
/* 'Nl': General Category */
static const OnigCodePoint CR_Nl[] = {
@@ -3864,7 +8955,7 @@ static const OnigCodePoint CR_Nl[] = {
/* 'No': General Category */
static const OnigCodePoint CR_No[] = {
- 41,
+ 42,
0x00b2, 0x00b3,
0x00b9, 0x00b9,
0x00bc, 0x00be,
@@ -3888,6 +8979,7 @@ static const OnigCodePoint CR_No[] = {
0x2cfd, 0x2cfd,
0x3192, 0x3195,
0x3220, 0x3229,
+ 0x3248, 0x324f,
0x3251, 0x325f,
0x3280, 0x3289,
0x32b1, 0x32bf,
@@ -3909,142 +9001,7 @@ static const OnigCodePoint CR_No[] = {
}; /* CR_No */
/* 'P': Major Category */
-static const OnigCodePoint CR_P[] = {
- 133,
- 0x0021, 0x0023,
- 0x0025, 0x002a,
- 0x002c, 0x002f,
- 0x003a, 0x003b,
- 0x003f, 0x0040,
- 0x005b, 0x005d,
- 0x005f, 0x005f,
- 0x007b, 0x007b,
- 0x007d, 0x007d,
- 0x00a1, 0x00a1,
- 0x00ab, 0x00ab,
- 0x00b7, 0x00b7,
- 0x00bb, 0x00bb,
- 0x00bf, 0x00bf,
- 0x037e, 0x037e,
- 0x0387, 0x0387,
- 0x055a, 0x055f,
- 0x0589, 0x058a,
- 0x05be, 0x05be,
- 0x05c0, 0x05c0,
- 0x05c3, 0x05c3,
- 0x05c6, 0x05c6,
- 0x05f3, 0x05f4,
- 0x0609, 0x060a,
- 0x060c, 0x060d,
- 0x061b, 0x061b,
- 0x061e, 0x061f,
- 0x066a, 0x066d,
- 0x06d4, 0x06d4,
- 0x0700, 0x070d,
- 0x07f7, 0x07f9,
- 0x0830, 0x083e,
- 0x085e, 0x085e,
- 0x0964, 0x0965,
- 0x0970, 0x0970,
- 0x0df4, 0x0df4,
- 0x0e4f, 0x0e4f,
- 0x0e5a, 0x0e5b,
- 0x0f04, 0x0f12,
- 0x0f3a, 0x0f3d,
- 0x0f85, 0x0f85,
- 0x0fd0, 0x0fd4,
- 0x0fd9, 0x0fda,
- 0x104a, 0x104f,
- 0x10fb, 0x10fb,
- 0x1361, 0x1368,
- 0x1400, 0x1400,
- 0x166d, 0x166e,
- 0x169b, 0x169c,
- 0x16eb, 0x16ed,
- 0x1735, 0x1736,
- 0x17d4, 0x17d6,
- 0x17d8, 0x17da,
- 0x1800, 0x180a,
- 0x1944, 0x1945,
- 0x1a1e, 0x1a1f,
- 0x1aa0, 0x1aa6,
- 0x1aa8, 0x1aad,
- 0x1b5a, 0x1b60,
- 0x1bfc, 0x1bff,
- 0x1c3b, 0x1c3f,
- 0x1c7e, 0x1c7f,
- 0x1cd3, 0x1cd3,
- 0x2010, 0x2027,
- 0x2030, 0x2043,
- 0x2045, 0x2051,
- 0x2053, 0x205e,
- 0x207d, 0x207e,
- 0x208d, 0x208e,
- 0x2329, 0x232a,
- 0x2768, 0x2775,
- 0x27c5, 0x27c6,
- 0x27e6, 0x27ef,
- 0x2983, 0x2998,
- 0x29d8, 0x29db,
- 0x29fc, 0x29fd,
- 0x2cf9, 0x2cfc,
- 0x2cfe, 0x2cff,
- 0x2d70, 0x2d70,
- 0x2e00, 0x2e2e,
- 0x2e30, 0x2e31,
- 0x3001, 0x3003,
- 0x3008, 0x3011,
- 0x3014, 0x301f,
- 0x3030, 0x3030,
- 0x303d, 0x303d,
- 0x30a0, 0x30a0,
- 0x30fb, 0x30fb,
- 0xa4fe, 0xa4ff,
- 0xa60d, 0xa60f,
- 0xa673, 0xa673,
- 0xa67e, 0xa67e,
- 0xa6f2, 0xa6f7,
- 0xa874, 0xa877,
- 0xa8ce, 0xa8cf,
- 0xa8f8, 0xa8fa,
- 0xa92e, 0xa92f,
- 0xa95f, 0xa95f,
- 0xa9c1, 0xa9cd,
- 0xa9de, 0xa9df,
- 0xaa5c, 0xaa5f,
- 0xaade, 0xaadf,
- 0xabeb, 0xabeb,
- 0xfd3e, 0xfd3f,
- 0xfe10, 0xfe19,
- 0xfe30, 0xfe52,
- 0xfe54, 0xfe61,
- 0xfe63, 0xfe63,
- 0xfe68, 0xfe68,
- 0xfe6a, 0xfe6b,
- 0xff01, 0xff03,
- 0xff05, 0xff0a,
- 0xff0c, 0xff0f,
- 0xff1a, 0xff1b,
- 0xff1f, 0xff20,
- 0xff3b, 0xff3d,
- 0xff3f, 0xff3f,
- 0xff5b, 0xff5b,
- 0xff5d, 0xff5d,
- 0xff5f, 0xff65,
- 0x10100, 0x10101,
- 0x1039f, 0x1039f,
- 0x103d0, 0x103d0,
- 0x10857, 0x10857,
- 0x1091f, 0x1091f,
- 0x1093f, 0x1093f,
- 0x10a50, 0x10a58,
- 0x10a7f, 0x10a7f,
- 0x10b39, 0x10b3f,
- 0x11047, 0x1104d,
- 0x110bb, 0x110bc,
- 0x110be, 0x110c1,
- 0x12470, 0x12473,
-}; /* CR_P */
+#define CR_P CR_Punct
/* 'Pc': General Category */
static const OnigCodePoint CR_Pc[] = {
@@ -4059,7 +9016,7 @@ static const OnigCodePoint CR_Pc[] = {
/* 'Pd': General Category */
static const OnigCodePoint CR_Pd[] = {
- 15,
+ 16,
0x002d, 0x002d,
0x058a, 0x058a,
0x05be, 0x05be,
@@ -4068,6 +9025,7 @@ static const OnigCodePoint CR_Pd[] = {
0x2010, 0x2015,
0x2e17, 0x2e17,
0x2e1a, 0x2e1a,
+ 0x2e3a, 0x2e3b,
0x301c, 0x301c,
0x3030, 0x3030,
0x30a0, 0x30a0,
@@ -4185,7 +9143,7 @@ static const OnigCodePoint CR_Pi[] = {
/* 'Po': General Category */
static const OnigCodePoint CR_Po[] = {
- 128,
+ 135,
0x0021, 0x0023,
0x0025, 0x0027,
0x002a, 0x002a,
@@ -4195,7 +9153,8 @@ static const OnigCodePoint CR_Po[] = {
0x003f, 0x0040,
0x005c, 0x005c,
0x00a1, 0x00a1,
- 0x00b7, 0x00b7,
+ 0x00a7, 0x00a7,
+ 0x00b6, 0x00b7,
0x00bf, 0x00bf,
0x037e, 0x037e,
0x0387, 0x0387,
@@ -4217,16 +9176,18 @@ static const OnigCodePoint CR_Po[] = {
0x085e, 0x085e,
0x0964, 0x0965,
0x0970, 0x0970,
+ 0x0af0, 0x0af0,
0x0df4, 0x0df4,
0x0e4f, 0x0e4f,
0x0e5a, 0x0e5b,
0x0f04, 0x0f12,
+ 0x0f14, 0x0f14,
0x0f85, 0x0f85,
0x0fd0, 0x0fd4,
0x0fd9, 0x0fda,
0x104a, 0x104f,
0x10fb, 0x10fb,
- 0x1361, 0x1368,
+ 0x1360, 0x1368,
0x166d, 0x166e,
0x16eb, 0x16ed,
0x1735, 0x1736,
@@ -4242,6 +9203,7 @@ static const OnigCodePoint CR_Po[] = {
0x1bfc, 0x1bff,
0x1c3b, 0x1c3f,
0x1c7e, 0x1c7f,
+ 0x1cc0, 0x1cc7,
0x1cd3, 0x1cd3,
0x2016, 0x2017,
0x2020, 0x2027,
@@ -4262,7 +9224,7 @@ static const OnigCodePoint CR_Po[] = {
0x2e1b, 0x2e1b,
0x2e1e, 0x2e1f,
0x2e2a, 0x2e2e,
- 0x2e30, 0x2e31,
+ 0x2e30, 0x2e39,
0x3001, 0x3003,
0x303d, 0x303d,
0x30fb, 0x30fb,
@@ -4280,6 +9242,7 @@ static const OnigCodePoint CR_Po[] = {
0xa9de, 0xa9df,
0xaa5c, 0xaa5f,
0xaade, 0xaadf,
+ 0xaaf0, 0xaaf1,
0xabeb, 0xabeb,
0xfe10, 0xfe16,
0xfe19, 0xfe19,
@@ -4301,7 +9264,7 @@ static const OnigCodePoint CR_Po[] = {
0xff3c, 0xff3c,
0xff61, 0xff61,
0xff64, 0xff65,
- 0x10100, 0x10101,
+ 0x10100, 0x10102,
0x1039f, 0x1039f,
0x103d0, 0x103d0,
0x10857, 0x10857,
@@ -4313,6 +9276,8 @@ static const OnigCodePoint CR_Po[] = {
0x11047, 0x1104d,
0x110bb, 0x110bc,
0x110be, 0x110c1,
+ 0x11140, 0x11143,
+ 0x111c5, 0x111c8,
0x12470, 0x12473,
}; /* CR_Po */
@@ -4395,7 +9360,7 @@ static const OnigCodePoint CR_Ps[] = {
/* 'S': Major Category */
static const OnigCodePoint CR_S[] = {
- 208,
+ 198,
0x0024, 0x0024,
0x002b, 0x002b,
0x003c, 0x003e,
@@ -4403,11 +9368,11 @@ static const OnigCodePoint CR_S[] = {
0x0060, 0x0060,
0x007c, 0x007c,
0x007e, 0x007e,
- 0x00a2, 0x00a9,
+ 0x00a2, 0x00a6,
+ 0x00a8, 0x00a9,
0x00ac, 0x00ac,
0x00ae, 0x00b1,
0x00b4, 0x00b4,
- 0x00b6, 0x00b6,
0x00b8, 0x00b8,
0x00d7, 0x00d7,
0x00f7, 0x00f7,
@@ -4420,6 +9385,7 @@ static const OnigCodePoint CR_S[] = {
0x0384, 0x0385,
0x03f6, 0x03f6,
0x0482, 0x0482,
+ 0x058f, 0x058f,
0x0606, 0x0608,
0x060b, 0x060b,
0x060e, 0x060f,
@@ -4436,7 +9402,8 @@ static const OnigCodePoint CR_S[] = {
0x0d79, 0x0d79,
0x0e3f, 0x0e3f,
0x0f01, 0x0f03,
- 0x0f13, 0x0f17,
+ 0x0f13, 0x0f13,
+ 0x0f15, 0x0f17,
0x0f1a, 0x0f1f,
0x0f34, 0x0f34,
0x0f36, 0x0f36,
@@ -4446,7 +9413,6 @@ static const OnigCodePoint CR_S[] = {
0x0fce, 0x0fcf,
0x0fd5, 0x0fd8,
0x109e, 0x109f,
- 0x1360, 0x1360,
0x1390, 0x1399,
0x17db, 0x17db,
0x1940, 0x1940,
@@ -4486,9 +9452,7 @@ static const OnigCodePoint CR_S[] = {
0x2500, 0x26ff,
0x2701, 0x2767,
0x2794, 0x27c4,
- 0x27c7, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x27e5,
+ 0x27c7, 0x27e5,
0x27f0, 0x2982,
0x2999, 0x29d7,
0x29dc, 0x29fb,
@@ -4509,7 +9473,8 @@ static const OnigCodePoint CR_S[] = {
0x3196, 0x319f,
0x31c0, 0x31e3,
0x3200, 0x321e,
- 0x322a, 0x3250,
+ 0x322a, 0x3247,
+ 0x3250, 0x3250,
0x3260, 0x327f,
0x328a, 0x32b0,
0x32c0, 0x32fe,
@@ -4538,7 +9503,6 @@ static const OnigCodePoint CR_S[] = {
0xffe0, 0xffe6,
0xffe8, 0xffee,
0xfffc, 0xfffd,
- 0x10102, 0x10102,
0x10137, 0x1013f,
0x10179, 0x10189,
0x10190, 0x1019b,
@@ -4563,6 +9527,7 @@ static const OnigCodePoint CR_S[] = {
0x1d789, 0x1d789,
0x1d7a9, 0x1d7a9,
0x1d7c3, 0x1d7c3,
+ 0x1eef0, 0x1eef1,
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
@@ -4570,7 +9535,7 @@ static const OnigCodePoint CR_S[] = {
0x1f0c1, 0x1f0cf,
0x1f0d1, 0x1f0df,
0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
+ 0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
0x1f1e6, 0x1f202,
0x1f210, 0x1f23a,
@@ -4588,19 +9553,9 @@ static const OnigCodePoint CR_S[] = {
0x1f442, 0x1f4f7,
0x1f4f9, 0x1f4fc,
0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
+ 0x1f5fb, 0x1f640,
0x1f645, 0x1f64f,
0x1f680, 0x1f6c5,
0x1f700, 0x1f773,
@@ -4608,9 +9563,10 @@ static const OnigCodePoint CR_S[] = {
/* 'Sc': General Category */
static const OnigCodePoint CR_Sc[] = {
- 16,
+ 17,
0x0024, 0x0024,
0x00a2, 0x00a5,
+ 0x058f, 0x058f,
0x060b, 0x060b,
0x09f2, 0x09f3,
0x09fb, 0x09fb,
@@ -4661,7 +9617,7 @@ static const OnigCodePoint CR_Sk[] = {
/* 'Sm': General Category */
static const OnigCodePoint CR_Sm[] = {
- 66,
+ 65,
0x002b, 0x002b,
0x003c, 0x003e,
0x007c, 0x007c,
@@ -4699,9 +9655,7 @@ static const OnigCodePoint CR_Sm[] = {
0x25f8, 0x25ff,
0x266f, 0x266f,
0x27c0, 0x27c4,
- 0x27c7, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x27e5,
+ 0x27c7, 0x27e5,
0x27f0, 0x27ff,
0x2900, 0x2982,
0x2999, 0x29d7,
@@ -4728,16 +9682,16 @@ static const OnigCodePoint CR_Sm[] = {
0x1d789, 0x1d789,
0x1d7a9, 0x1d7a9,
0x1d7c3, 0x1d7c3,
+ 0x1eef0, 0x1eef1,
}; /* CR_Sm */
/* 'So': General Category */
static const OnigCodePoint CR_So[] = {
- 164,
- 0x00a6, 0x00a7,
+ 153,
+ 0x00a6, 0x00a6,
0x00a9, 0x00a9,
0x00ae, 0x00ae,
0x00b0, 0x00b0,
- 0x00b6, 0x00b6,
0x0482, 0x0482,
0x060e, 0x060f,
0x06de, 0x06de,
@@ -4751,7 +9705,8 @@ static const OnigCodePoint CR_So[] = {
0x0c7f, 0x0c7f,
0x0d79, 0x0d79,
0x0f01, 0x0f03,
- 0x0f13, 0x0f17,
+ 0x0f13, 0x0f13,
+ 0x0f15, 0x0f17,
0x0f1a, 0x0f1f,
0x0f34, 0x0f34,
0x0f36, 0x0f36,
@@ -4761,7 +9716,6 @@ static const OnigCodePoint CR_So[] = {
0x0fce, 0x0fcf,
0x0fd5, 0x0fd8,
0x109e, 0x109f,
- 0x1360, 0x1360,
0x1390, 0x1399,
0x1940, 0x1940,
0x19de, 0x19ff,
@@ -4825,7 +9779,8 @@ static const OnigCodePoint CR_So[] = {
0x3196, 0x319f,
0x31c0, 0x31e3,
0x3200, 0x321e,
- 0x322a, 0x3250,
+ 0x322a, 0x3247,
+ 0x3250, 0x3250,
0x3260, 0x327f,
0x328a, 0x32b0,
0x32c0, 0x32fe,
@@ -4841,7 +9796,6 @@ static const OnigCodePoint CR_So[] = {
0xffe8, 0xffe8,
0xffed, 0xffee,
0xfffc, 0xfffd,
- 0x10102, 0x10102,
0x10137, 0x1013f,
0x10179, 0x10189,
0x10190, 0x1019b,
@@ -4863,7 +9817,7 @@ static const OnigCodePoint CR_So[] = {
0x1f0c1, 0x1f0cf,
0x1f0d1, 0x1f0df,
0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
+ 0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
0x1f1e6, 0x1f202,
0x1f210, 0x1f23a,
@@ -4881,19 +9835,9 @@ static const OnigCodePoint CR_So[] = {
0x1f442, 0x1f4f7,
0x1f4f9, 0x1f4fc,
0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
+ 0x1f5fb, 0x1f640,
0x1f645, 0x1f64f,
0x1f680, 0x1f6c5,
0x1f700, 0x1f773,
@@ -4940,7 +9884,7 @@ static const OnigCodePoint CR_Zs[] = {
/* 'Math': Derived Property */
static const OnigCodePoint CR_Math[] = {
- 106,
+ 138,
0x002b, 0x002b,
0x003c, 0x003e,
0x005e, 0x005e,
@@ -5009,9 +9953,7 @@ static const OnigCodePoint CR_Math[] = {
0x2642, 0x2642,
0x2660, 0x2663,
0x266d, 0x266f,
- 0x27c0, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x27ff,
+ 0x27c0, 0x27ff,
0x2900, 0x2aff,
0x2b30, 0x2b44,
0x2b47, 0x2b4c,
@@ -5047,1729 +9989,54 @@ static const OnigCodePoint CR_Math[] = {
0x1d552, 0x1d6a5,
0x1d6a8, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
}; /* CR_Math */
/* 'Alphabetic': Derived Property */
-static const OnigCodePoint CR_Alphabetic[] = {
- 486,
- 0x0041, 0x005a,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x02c1,
- 0x02c6, 0x02d1,
- 0x02e0, 0x02e4,
- 0x02ec, 0x02ec,
- 0x02ee, 0x02ee,
- 0x0345, 0x0345,
- 0x0370, 0x0374,
- 0x0376, 0x0377,
- 0x037a, 0x037d,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03f5,
- 0x03f7, 0x0481,
- 0x048a, 0x0527,
- 0x0531, 0x0556,
- 0x0559, 0x0559,
- 0x0561, 0x0587,
- 0x05b0, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f2,
- 0x0610, 0x061a,
- 0x0620, 0x0657,
- 0x0659, 0x065f,
- 0x066e, 0x06d3,
- 0x06d5, 0x06dc,
- 0x06e1, 0x06e8,
- 0x06ed, 0x06ef,
- 0x06fa, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x073f,
- 0x074d, 0x07b1,
- 0x07ca, 0x07ea,
- 0x07f4, 0x07f5,
- 0x07fa, 0x07fa,
- 0x0800, 0x0817,
- 0x081a, 0x082c,
- 0x0840, 0x0858,
- 0x0900, 0x093b,
- 0x093d, 0x094c,
- 0x094e, 0x0950,
- 0x0955, 0x0963,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bd, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09cc,
- 0x09ce, 0x09ce,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09f0, 0x09f1,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4c,
- 0x0a51, 0x0a51,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a70, 0x0a75,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abd, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acc,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae3,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3d, 0x0b44,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4c,
- 0x0b56, 0x0b57,
- 0x0b5c, 0x0b5d,
- 0x0b5f, 0x0b63,
- 0x0b71, 0x0b71,
- 0x0b82, 0x0b83,
- 0x0b85, 0x0b8a,
- 0x0b8e, 0x0b90,
- 0x0b92, 0x0b95,
- 0x0b99, 0x0b9a,
- 0x0b9c, 0x0b9c,
- 0x0b9e, 0x0b9f,
- 0x0ba3, 0x0ba4,
- 0x0ba8, 0x0baa,
- 0x0bae, 0x0bb9,
- 0x0bbe, 0x0bc2,
- 0x0bc6, 0x0bc8,
- 0x0bca, 0x0bcc,
- 0x0bd0, 0x0bd0,
- 0x0bd7, 0x0bd7,
- 0x0c01, 0x0c03,
- 0x0c05, 0x0c0c,
- 0x0c0e, 0x0c10,
- 0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
- 0x0c3d, 0x0c44,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4c,
- 0x0c55, 0x0c56,
- 0x0c58, 0x0c59,
- 0x0c60, 0x0c63,
- 0x0c82, 0x0c83,
- 0x0c85, 0x0c8c,
- 0x0c8e, 0x0c90,
- 0x0c92, 0x0ca8,
- 0x0caa, 0x0cb3,
- 0x0cb5, 0x0cb9,
- 0x0cbd, 0x0cc4,
- 0x0cc6, 0x0cc8,
- 0x0cca, 0x0ccc,
- 0x0cd5, 0x0cd6,
- 0x0cde, 0x0cde,
- 0x0ce0, 0x0ce3,
- 0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d3a,
- 0x0d3d, 0x0d44,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4c,
- 0x0d4e, 0x0d4e,
- 0x0d57, 0x0d57,
- 0x0d60, 0x0d63,
- 0x0d7a, 0x0d7f,
- 0x0d82, 0x0d83,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df3,
- 0x0e01, 0x0e3a,
- 0x0e40, 0x0e46,
- 0x0e4d, 0x0e4d,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ecd, 0x0ecd,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f00,
- 0x0f40, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f71, 0x0f81,
- 0x0f88, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x1000, 0x1036,
- 0x1038, 0x1038,
- 0x103b, 0x103f,
- 0x1050, 0x1062,
- 0x1065, 0x1068,
- 0x106e, 0x1086,
- 0x108e, 0x108e,
- 0x109c, 0x109d,
- 0x10a0, 0x10c5,
- 0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135f, 0x135f,
- 0x1380, 0x138f,
- 0x13a0, 0x13f4,
- 0x1401, 0x166c,
- 0x166f, 0x167f,
- 0x1681, 0x169a,
- 0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
- 0x1700, 0x170c,
- 0x170e, 0x1713,
- 0x1720, 0x1733,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17b3,
- 0x17b6, 0x17c8,
- 0x17d7, 0x17d7,
- 0x17dc, 0x17dc,
- 0x1820, 0x1877,
- 0x1880, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191c,
- 0x1920, 0x192b,
- 0x1930, 0x1938,
- 0x1950, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x1a00, 0x1a1b,
- 0x1a20, 0x1a5e,
- 0x1a61, 0x1a74,
- 0x1aa7, 0x1aa7,
- 0x1b00, 0x1b33,
- 0x1b35, 0x1b43,
- 0x1b45, 0x1b4b,
- 0x1b80, 0x1ba9,
- 0x1bae, 0x1baf,
- 0x1bc0, 0x1be5,
- 0x1be7, 0x1bf1,
- 0x1c00, 0x1c35,
- 0x1c4d, 0x1c4f,
- 0x1c5a, 0x1c7d,
- 0x1ce9, 0x1cec,
- 0x1cee, 0x1cf2,
- 0x1d00, 0x1dbf,
- 0x1e00, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fbc,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fcc,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fe0, 0x1fec,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffc,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x209c,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x212f, 0x2139,
- 0x213c, 0x213f,
- 0x2145, 0x2149,
- 0x214e, 0x214e,
- 0x2160, 0x2188,
- 0x24b6, 0x24e9,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2ce4,
- 0x2ceb, 0x2cee,
- 0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
- 0x2d6f, 0x2d6f,
- 0x2d80, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2de0, 0x2dff,
- 0x2e2f, 0x2e2f,
- 0x3005, 0x3007,
- 0x3021, 0x3029,
- 0x3031, 0x3035,
- 0x3038, 0x303c,
- 0x3041, 0x3096,
- 0x309d, 0x309f,
- 0x30a1, 0x30fa,
- 0x30fc, 0x30ff,
- 0x3105, 0x312d,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa61f,
- 0xa62a, 0xa62b,
- 0xa640, 0xa66e,
- 0xa67f, 0xa697,
- 0xa6a0, 0xa6ef,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa801,
- 0xa803, 0xa805,
- 0xa807, 0xa80a,
- 0xa80c, 0xa827,
- 0xa840, 0xa873,
- 0xa880, 0xa8c3,
- 0xa8f2, 0xa8f7,
- 0xa8fb, 0xa8fb,
- 0xa90a, 0xa92a,
- 0xa930, 0xa952,
- 0xa960, 0xa97c,
- 0xa980, 0xa9b2,
- 0xa9b4, 0xa9bf,
- 0xa9cf, 0xa9cf,
- 0xaa00, 0xaa36,
- 0xaa40, 0xaa4d,
- 0xaa60, 0xaa76,
- 0xaa7a, 0xaa7a,
- 0xaa80, 0xaabe,
- 0xaac0, 0xaac0,
- 0xaac2, 0xaac2,
- 0xaadb, 0xaadd,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xabc0, 0xabea,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb28,
- 0xfb2a, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3d,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfb,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xff21, 0xff3a,
- 0xff41, 0xff5a,
- 0xff66, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10140, 0x10174,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x10300, 0x1031e,
- 0x10330, 0x1034a,
- 0x10380, 0x1039d,
- 0x103a0, 0x103c3,
- 0x103c8, 0x103cf,
- 0x103d1, 0x103d5,
- 0x10400, 0x1049d,
- 0x10800, 0x10805,
- 0x10808, 0x10808,
- 0x1080a, 0x10835,
- 0x10837, 0x10838,
- 0x1083c, 0x1083c,
- 0x1083f, 0x10855,
- 0x10900, 0x10915,
- 0x10920, 0x10939,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x10a60, 0x10a7c,
- 0x10b00, 0x10b35,
- 0x10b40, 0x10b55,
- 0x10b60, 0x10b72,
- 0x10c00, 0x10c48,
- 0x11000, 0x11045,
- 0x11082, 0x110b8,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x13000, 0x1342e,
- 0x16800, 0x16a38,
- 0x1b000, 0x1b001,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d6c0,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6fa,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d734,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d76e,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d7a8,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7cb,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2f800, 0x2fa1d,
-}; /* CR_Alphabetic */
+#define CR_Alphabetic CR_Alpha
/* 'Lowercase': Derived Property */
-static const OnigCodePoint CR_Lowercase[] = {
- 612,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
- 0x00df, 0x00f6,
- 0x00f8, 0x00ff,
- 0x0101, 0x0101,
- 0x0103, 0x0103,
- 0x0105, 0x0105,
- 0x0107, 0x0107,
- 0x0109, 0x0109,
- 0x010b, 0x010b,
- 0x010d, 0x010d,
- 0x010f, 0x010f,
- 0x0111, 0x0111,
- 0x0113, 0x0113,
- 0x0115, 0x0115,
- 0x0117, 0x0117,
- 0x0119, 0x0119,
- 0x011b, 0x011b,
- 0x011d, 0x011d,
- 0x011f, 0x011f,
- 0x0121, 0x0121,
- 0x0123, 0x0123,
- 0x0125, 0x0125,
- 0x0127, 0x0127,
- 0x0129, 0x0129,
- 0x012b, 0x012b,
- 0x012d, 0x012d,
- 0x012f, 0x012f,
- 0x0131, 0x0131,
- 0x0133, 0x0133,
- 0x0135, 0x0135,
- 0x0137, 0x0138,
- 0x013a, 0x013a,
- 0x013c, 0x013c,
- 0x013e, 0x013e,
- 0x0140, 0x0140,
- 0x0142, 0x0142,
- 0x0144, 0x0144,
- 0x0146, 0x0146,
- 0x0148, 0x0149,
- 0x014b, 0x014b,
- 0x014d, 0x014d,
- 0x014f, 0x014f,
- 0x0151, 0x0151,
- 0x0153, 0x0153,
- 0x0155, 0x0155,
- 0x0157, 0x0157,
- 0x0159, 0x0159,
- 0x015b, 0x015b,
- 0x015d, 0x015d,
- 0x015f, 0x015f,
- 0x0161, 0x0161,
- 0x0163, 0x0163,
- 0x0165, 0x0165,
- 0x0167, 0x0167,
- 0x0169, 0x0169,
- 0x016b, 0x016b,
- 0x016d, 0x016d,
- 0x016f, 0x016f,
- 0x0171, 0x0171,
- 0x0173, 0x0173,
- 0x0175, 0x0175,
- 0x0177, 0x0177,
- 0x017a, 0x017a,
- 0x017c, 0x017c,
- 0x017e, 0x0180,
- 0x0183, 0x0183,
- 0x0185, 0x0185,
- 0x0188, 0x0188,
- 0x018c, 0x018d,
- 0x0192, 0x0192,
- 0x0195, 0x0195,
- 0x0199, 0x019b,
- 0x019e, 0x019e,
- 0x01a1, 0x01a1,
- 0x01a3, 0x01a3,
- 0x01a5, 0x01a5,
- 0x01a8, 0x01a8,
- 0x01aa, 0x01ab,
- 0x01ad, 0x01ad,
- 0x01b0, 0x01b0,
- 0x01b4, 0x01b4,
- 0x01b6, 0x01b6,
- 0x01b9, 0x01ba,
- 0x01bd, 0x01bf,
- 0x01c6, 0x01c6,
- 0x01c9, 0x01c9,
- 0x01cc, 0x01cc,
- 0x01ce, 0x01ce,
- 0x01d0, 0x01d0,
- 0x01d2, 0x01d2,
- 0x01d4, 0x01d4,
- 0x01d6, 0x01d6,
- 0x01d8, 0x01d8,
- 0x01da, 0x01da,
- 0x01dc, 0x01dd,
- 0x01df, 0x01df,
- 0x01e1, 0x01e1,
- 0x01e3, 0x01e3,
- 0x01e5, 0x01e5,
- 0x01e7, 0x01e7,
- 0x01e9, 0x01e9,
- 0x01eb, 0x01eb,
- 0x01ed, 0x01ed,
- 0x01ef, 0x01f0,
- 0x01f3, 0x01f3,
- 0x01f5, 0x01f5,
- 0x01f9, 0x01f9,
- 0x01fb, 0x01fb,
- 0x01fd, 0x01fd,
- 0x01ff, 0x01ff,
- 0x0201, 0x0201,
- 0x0203, 0x0203,
- 0x0205, 0x0205,
- 0x0207, 0x0207,
- 0x0209, 0x0209,
- 0x020b, 0x020b,
- 0x020d, 0x020d,
- 0x020f, 0x020f,
- 0x0211, 0x0211,
- 0x0213, 0x0213,
- 0x0215, 0x0215,
- 0x0217, 0x0217,
- 0x0219, 0x0219,
- 0x021b, 0x021b,
- 0x021d, 0x021d,
- 0x021f, 0x021f,
- 0x0221, 0x0221,
- 0x0223, 0x0223,
- 0x0225, 0x0225,
- 0x0227, 0x0227,
- 0x0229, 0x0229,
- 0x022b, 0x022b,
- 0x022d, 0x022d,
- 0x022f, 0x022f,
- 0x0231, 0x0231,
- 0x0233, 0x0239,
- 0x023c, 0x023c,
- 0x023f, 0x0240,
- 0x0242, 0x0242,
- 0x0247, 0x0247,
- 0x0249, 0x0249,
- 0x024b, 0x024b,
- 0x024d, 0x024d,
- 0x024f, 0x0293,
- 0x0295, 0x02b8,
- 0x02c0, 0x02c1,
- 0x02e0, 0x02e4,
- 0x0345, 0x0345,
- 0x0371, 0x0371,
- 0x0373, 0x0373,
- 0x0377, 0x0377,
- 0x037a, 0x037d,
- 0x0390, 0x0390,
- 0x03ac, 0x03ce,
- 0x03d0, 0x03d1,
- 0x03d5, 0x03d7,
- 0x03d9, 0x03d9,
- 0x03db, 0x03db,
- 0x03dd, 0x03dd,
- 0x03df, 0x03df,
- 0x03e1, 0x03e1,
- 0x03e3, 0x03e3,
- 0x03e5, 0x03e5,
- 0x03e7, 0x03e7,
- 0x03e9, 0x03e9,
- 0x03eb, 0x03eb,
- 0x03ed, 0x03ed,
- 0x03ef, 0x03f3,
- 0x03f5, 0x03f5,
- 0x03f8, 0x03f8,
- 0x03fb, 0x03fc,
- 0x0430, 0x045f,
- 0x0461, 0x0461,
- 0x0463, 0x0463,
- 0x0465, 0x0465,
- 0x0467, 0x0467,
- 0x0469, 0x0469,
- 0x046b, 0x046b,
- 0x046d, 0x046d,
- 0x046f, 0x046f,
- 0x0471, 0x0471,
- 0x0473, 0x0473,
- 0x0475, 0x0475,
- 0x0477, 0x0477,
- 0x0479, 0x0479,
- 0x047b, 0x047b,
- 0x047d, 0x047d,
- 0x047f, 0x047f,
- 0x0481, 0x0481,
- 0x048b, 0x048b,
- 0x048d, 0x048d,
- 0x048f, 0x048f,
- 0x0491, 0x0491,
- 0x0493, 0x0493,
- 0x0495, 0x0495,
- 0x0497, 0x0497,
- 0x0499, 0x0499,
- 0x049b, 0x049b,
- 0x049d, 0x049d,
- 0x049f, 0x049f,
- 0x04a1, 0x04a1,
- 0x04a3, 0x04a3,
- 0x04a5, 0x04a5,
- 0x04a7, 0x04a7,
- 0x04a9, 0x04a9,
- 0x04ab, 0x04ab,
- 0x04ad, 0x04ad,
- 0x04af, 0x04af,
- 0x04b1, 0x04b1,
- 0x04b3, 0x04b3,
- 0x04b5, 0x04b5,
- 0x04b7, 0x04b7,
- 0x04b9, 0x04b9,
- 0x04bb, 0x04bb,
- 0x04bd, 0x04bd,
- 0x04bf, 0x04bf,
- 0x04c2, 0x04c2,
- 0x04c4, 0x04c4,
- 0x04c6, 0x04c6,
- 0x04c8, 0x04c8,
- 0x04ca, 0x04ca,
- 0x04cc, 0x04cc,
- 0x04ce, 0x04cf,
- 0x04d1, 0x04d1,
- 0x04d3, 0x04d3,
- 0x04d5, 0x04d5,
- 0x04d7, 0x04d7,
- 0x04d9, 0x04d9,
- 0x04db, 0x04db,
- 0x04dd, 0x04dd,
- 0x04df, 0x04df,
- 0x04e1, 0x04e1,
- 0x04e3, 0x04e3,
- 0x04e5, 0x04e5,
- 0x04e7, 0x04e7,
- 0x04e9, 0x04e9,
- 0x04eb, 0x04eb,
- 0x04ed, 0x04ed,
- 0x04ef, 0x04ef,
- 0x04f1, 0x04f1,
- 0x04f3, 0x04f3,
- 0x04f5, 0x04f5,
- 0x04f7, 0x04f7,
- 0x04f9, 0x04f9,
- 0x04fb, 0x04fb,
- 0x04fd, 0x04fd,
- 0x04ff, 0x04ff,
- 0x0501, 0x0501,
- 0x0503, 0x0503,
- 0x0505, 0x0505,
- 0x0507, 0x0507,
- 0x0509, 0x0509,
- 0x050b, 0x050b,
- 0x050d, 0x050d,
- 0x050f, 0x050f,
- 0x0511, 0x0511,
- 0x0513, 0x0513,
- 0x0515, 0x0515,
- 0x0517, 0x0517,
- 0x0519, 0x0519,
- 0x051b, 0x051b,
- 0x051d, 0x051d,
- 0x051f, 0x051f,
- 0x0521, 0x0521,
- 0x0523, 0x0523,
- 0x0525, 0x0525,
- 0x0527, 0x0527,
- 0x0561, 0x0587,
- 0x1d00, 0x1dbf,
- 0x1e01, 0x1e01,
- 0x1e03, 0x1e03,
- 0x1e05, 0x1e05,
- 0x1e07, 0x1e07,
- 0x1e09, 0x1e09,
- 0x1e0b, 0x1e0b,
- 0x1e0d, 0x1e0d,
- 0x1e0f, 0x1e0f,
- 0x1e11, 0x1e11,
- 0x1e13, 0x1e13,
- 0x1e15, 0x1e15,
- 0x1e17, 0x1e17,
- 0x1e19, 0x1e19,
- 0x1e1b, 0x1e1b,
- 0x1e1d, 0x1e1d,
- 0x1e1f, 0x1e1f,
- 0x1e21, 0x1e21,
- 0x1e23, 0x1e23,
- 0x1e25, 0x1e25,
- 0x1e27, 0x1e27,
- 0x1e29, 0x1e29,
- 0x1e2b, 0x1e2b,
- 0x1e2d, 0x1e2d,
- 0x1e2f, 0x1e2f,
- 0x1e31, 0x1e31,
- 0x1e33, 0x1e33,
- 0x1e35, 0x1e35,
- 0x1e37, 0x1e37,
- 0x1e39, 0x1e39,
- 0x1e3b, 0x1e3b,
- 0x1e3d, 0x1e3d,
- 0x1e3f, 0x1e3f,
- 0x1e41, 0x1e41,
- 0x1e43, 0x1e43,
- 0x1e45, 0x1e45,
- 0x1e47, 0x1e47,
- 0x1e49, 0x1e49,
- 0x1e4b, 0x1e4b,
- 0x1e4d, 0x1e4d,
- 0x1e4f, 0x1e4f,
- 0x1e51, 0x1e51,
- 0x1e53, 0x1e53,
- 0x1e55, 0x1e55,
- 0x1e57, 0x1e57,
- 0x1e59, 0x1e59,
- 0x1e5b, 0x1e5b,
- 0x1e5d, 0x1e5d,
- 0x1e5f, 0x1e5f,
- 0x1e61, 0x1e61,
- 0x1e63, 0x1e63,
- 0x1e65, 0x1e65,
- 0x1e67, 0x1e67,
- 0x1e69, 0x1e69,
- 0x1e6b, 0x1e6b,
- 0x1e6d, 0x1e6d,
- 0x1e6f, 0x1e6f,
- 0x1e71, 0x1e71,
- 0x1e73, 0x1e73,
- 0x1e75, 0x1e75,
- 0x1e77, 0x1e77,
- 0x1e79, 0x1e79,
- 0x1e7b, 0x1e7b,
- 0x1e7d, 0x1e7d,
- 0x1e7f, 0x1e7f,
- 0x1e81, 0x1e81,
- 0x1e83, 0x1e83,
- 0x1e85, 0x1e85,
- 0x1e87, 0x1e87,
- 0x1e89, 0x1e89,
- 0x1e8b, 0x1e8b,
- 0x1e8d, 0x1e8d,
- 0x1e8f, 0x1e8f,
- 0x1e91, 0x1e91,
- 0x1e93, 0x1e93,
- 0x1e95, 0x1e9d,
- 0x1e9f, 0x1e9f,
- 0x1ea1, 0x1ea1,
- 0x1ea3, 0x1ea3,
- 0x1ea5, 0x1ea5,
- 0x1ea7, 0x1ea7,
- 0x1ea9, 0x1ea9,
- 0x1eab, 0x1eab,
- 0x1ead, 0x1ead,
- 0x1eaf, 0x1eaf,
- 0x1eb1, 0x1eb1,
- 0x1eb3, 0x1eb3,
- 0x1eb5, 0x1eb5,
- 0x1eb7, 0x1eb7,
- 0x1eb9, 0x1eb9,
- 0x1ebb, 0x1ebb,
- 0x1ebd, 0x1ebd,
- 0x1ebf, 0x1ebf,
- 0x1ec1, 0x1ec1,
- 0x1ec3, 0x1ec3,
- 0x1ec5, 0x1ec5,
- 0x1ec7, 0x1ec7,
- 0x1ec9, 0x1ec9,
- 0x1ecb, 0x1ecb,
- 0x1ecd, 0x1ecd,
- 0x1ecf, 0x1ecf,
- 0x1ed1, 0x1ed1,
- 0x1ed3, 0x1ed3,
- 0x1ed5, 0x1ed5,
- 0x1ed7, 0x1ed7,
- 0x1ed9, 0x1ed9,
- 0x1edb, 0x1edb,
- 0x1edd, 0x1edd,
- 0x1edf, 0x1edf,
- 0x1ee1, 0x1ee1,
- 0x1ee3, 0x1ee3,
- 0x1ee5, 0x1ee5,
- 0x1ee7, 0x1ee7,
- 0x1ee9, 0x1ee9,
- 0x1eeb, 0x1eeb,
- 0x1eed, 0x1eed,
- 0x1eef, 0x1eef,
- 0x1ef1, 0x1ef1,
- 0x1ef3, 0x1ef3,
- 0x1ef5, 0x1ef5,
- 0x1ef7, 0x1ef7,
- 0x1ef9, 0x1ef9,
- 0x1efb, 0x1efb,
- 0x1efd, 0x1efd,
- 0x1eff, 0x1f07,
- 0x1f10, 0x1f15,
- 0x1f20, 0x1f27,
- 0x1f30, 0x1f37,
- 0x1f40, 0x1f45,
- 0x1f50, 0x1f57,
- 0x1f60, 0x1f67,
- 0x1f70, 0x1f7d,
- 0x1f80, 0x1f87,
- 0x1f90, 0x1f97,
- 0x1fa0, 0x1fa7,
- 0x1fb0, 0x1fb4,
- 0x1fb6, 0x1fb7,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fc7,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fd7,
- 0x1fe0, 0x1fe7,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ff7,
- 0x2090, 0x2094,
- 0x210a, 0x210a,
- 0x210e, 0x210f,
- 0x2113, 0x2113,
- 0x212f, 0x212f,
- 0x2134, 0x2134,
- 0x2139, 0x2139,
- 0x213c, 0x213d,
- 0x2146, 0x2149,
- 0x214e, 0x214e,
- 0x2170, 0x217f,
- 0x2184, 0x2184,
- 0x24d0, 0x24e9,
- 0x2c30, 0x2c5e,
- 0x2c61, 0x2c61,
- 0x2c65, 0x2c66,
- 0x2c68, 0x2c68,
- 0x2c6a, 0x2c6a,
- 0x2c6c, 0x2c6c,
- 0x2c71, 0x2c71,
- 0x2c73, 0x2c74,
- 0x2c76, 0x2c7d,
- 0x2c81, 0x2c81,
- 0x2c83, 0x2c83,
- 0x2c85, 0x2c85,
- 0x2c87, 0x2c87,
- 0x2c89, 0x2c89,
- 0x2c8b, 0x2c8b,
- 0x2c8d, 0x2c8d,
- 0x2c8f, 0x2c8f,
- 0x2c91, 0x2c91,
- 0x2c93, 0x2c93,
- 0x2c95, 0x2c95,
- 0x2c97, 0x2c97,
- 0x2c99, 0x2c99,
- 0x2c9b, 0x2c9b,
- 0x2c9d, 0x2c9d,
- 0x2c9f, 0x2c9f,
- 0x2ca1, 0x2ca1,
- 0x2ca3, 0x2ca3,
- 0x2ca5, 0x2ca5,
- 0x2ca7, 0x2ca7,
- 0x2ca9, 0x2ca9,
- 0x2cab, 0x2cab,
- 0x2cad, 0x2cad,
- 0x2caf, 0x2caf,
- 0x2cb1, 0x2cb1,
- 0x2cb3, 0x2cb3,
- 0x2cb5, 0x2cb5,
- 0x2cb7, 0x2cb7,
- 0x2cb9, 0x2cb9,
- 0x2cbb, 0x2cbb,
- 0x2cbd, 0x2cbd,
- 0x2cbf, 0x2cbf,
- 0x2cc1, 0x2cc1,
- 0x2cc3, 0x2cc3,
- 0x2cc5, 0x2cc5,
- 0x2cc7, 0x2cc7,
- 0x2cc9, 0x2cc9,
- 0x2ccb, 0x2ccb,
- 0x2ccd, 0x2ccd,
- 0x2ccf, 0x2ccf,
- 0x2cd1, 0x2cd1,
- 0x2cd3, 0x2cd3,
- 0x2cd5, 0x2cd5,
- 0x2cd7, 0x2cd7,
- 0x2cd9, 0x2cd9,
- 0x2cdb, 0x2cdb,
- 0x2cdd, 0x2cdd,
- 0x2cdf, 0x2cdf,
- 0x2ce1, 0x2ce1,
- 0x2ce3, 0x2ce4,
- 0x2cec, 0x2cec,
- 0x2cee, 0x2cee,
- 0x2d00, 0x2d25,
- 0xa641, 0xa641,
- 0xa643, 0xa643,
- 0xa645, 0xa645,
- 0xa647, 0xa647,
- 0xa649, 0xa649,
- 0xa64b, 0xa64b,
- 0xa64d, 0xa64d,
- 0xa64f, 0xa64f,
- 0xa651, 0xa651,
- 0xa653, 0xa653,
- 0xa655, 0xa655,
- 0xa657, 0xa657,
- 0xa659, 0xa659,
- 0xa65b, 0xa65b,
- 0xa65d, 0xa65d,
- 0xa65f, 0xa65f,
- 0xa661, 0xa661,
- 0xa663, 0xa663,
- 0xa665, 0xa665,
- 0xa667, 0xa667,
- 0xa669, 0xa669,
- 0xa66b, 0xa66b,
- 0xa66d, 0xa66d,
- 0xa681, 0xa681,
- 0xa683, 0xa683,
- 0xa685, 0xa685,
- 0xa687, 0xa687,
- 0xa689, 0xa689,
- 0xa68b, 0xa68b,
- 0xa68d, 0xa68d,
- 0xa68f, 0xa68f,
- 0xa691, 0xa691,
- 0xa693, 0xa693,
- 0xa695, 0xa695,
- 0xa697, 0xa697,
- 0xa723, 0xa723,
- 0xa725, 0xa725,
- 0xa727, 0xa727,
- 0xa729, 0xa729,
- 0xa72b, 0xa72b,
- 0xa72d, 0xa72d,
- 0xa72f, 0xa731,
- 0xa733, 0xa733,
- 0xa735, 0xa735,
- 0xa737, 0xa737,
- 0xa739, 0xa739,
- 0xa73b, 0xa73b,
- 0xa73d, 0xa73d,
- 0xa73f, 0xa73f,
- 0xa741, 0xa741,
- 0xa743, 0xa743,
- 0xa745, 0xa745,
- 0xa747, 0xa747,
- 0xa749, 0xa749,
- 0xa74b, 0xa74b,
- 0xa74d, 0xa74d,
- 0xa74f, 0xa74f,
- 0xa751, 0xa751,
- 0xa753, 0xa753,
- 0xa755, 0xa755,
- 0xa757, 0xa757,
- 0xa759, 0xa759,
- 0xa75b, 0xa75b,
- 0xa75d, 0xa75d,
- 0xa75f, 0xa75f,
- 0xa761, 0xa761,
- 0xa763, 0xa763,
- 0xa765, 0xa765,
- 0xa767, 0xa767,
- 0xa769, 0xa769,
- 0xa76b, 0xa76b,
- 0xa76d, 0xa76d,
- 0xa76f, 0xa778,
- 0xa77a, 0xa77a,
- 0xa77c, 0xa77c,
- 0xa77f, 0xa77f,
- 0xa781, 0xa781,
- 0xa783, 0xa783,
- 0xa785, 0xa785,
- 0xa787, 0xa787,
- 0xa78c, 0xa78c,
- 0xa78e, 0xa78e,
- 0xa791, 0xa791,
- 0xa7a1, 0xa7a1,
- 0xa7a3, 0xa7a3,
- 0xa7a5, 0xa7a5,
- 0xa7a7, 0xa7a7,
- 0xa7a9, 0xa7a9,
- 0xa7fa, 0xa7fa,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xff41, 0xff5a,
- 0x10428, 0x1044f,
- 0x1d41a, 0x1d433,
- 0x1d44e, 0x1d454,
- 0x1d456, 0x1d467,
- 0x1d482, 0x1d49b,
- 0x1d4b6, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d4cf,
- 0x1d4ea, 0x1d503,
- 0x1d51e, 0x1d537,
- 0x1d552, 0x1d56b,
- 0x1d586, 0x1d59f,
- 0x1d5ba, 0x1d5d3,
- 0x1d5ee, 0x1d607,
- 0x1d622, 0x1d63b,
- 0x1d656, 0x1d66f,
- 0x1d68a, 0x1d6a5,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6e1,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d71b,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d755,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d78f,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7c9,
- 0x1d7cb, 0x1d7cb,
-}; /* CR_Lowercase */
+#define CR_Lowercase CR_Lower
/* 'Uppercase': Derived Property */
-static const OnigCodePoint CR_Uppercase[] = {
- 605,
- 0x0041, 0x005a,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00de,
- 0x0100, 0x0100,
- 0x0102, 0x0102,
- 0x0104, 0x0104,
- 0x0106, 0x0106,
- 0x0108, 0x0108,
- 0x010a, 0x010a,
- 0x010c, 0x010c,
- 0x010e, 0x010e,
- 0x0110, 0x0110,
- 0x0112, 0x0112,
- 0x0114, 0x0114,
- 0x0116, 0x0116,
- 0x0118, 0x0118,
- 0x011a, 0x011a,
- 0x011c, 0x011c,
- 0x011e, 0x011e,
- 0x0120, 0x0120,
- 0x0122, 0x0122,
- 0x0124, 0x0124,
- 0x0126, 0x0126,
- 0x0128, 0x0128,
- 0x012a, 0x012a,
- 0x012c, 0x012c,
- 0x012e, 0x012e,
- 0x0130, 0x0130,
- 0x0132, 0x0132,
- 0x0134, 0x0134,
- 0x0136, 0x0136,
- 0x0139, 0x0139,
- 0x013b, 0x013b,
- 0x013d, 0x013d,
- 0x013f, 0x013f,
- 0x0141, 0x0141,
- 0x0143, 0x0143,
- 0x0145, 0x0145,
- 0x0147, 0x0147,
- 0x014a, 0x014a,
- 0x014c, 0x014c,
- 0x014e, 0x014e,
- 0x0150, 0x0150,
- 0x0152, 0x0152,
- 0x0154, 0x0154,
- 0x0156, 0x0156,
- 0x0158, 0x0158,
- 0x015a, 0x015a,
- 0x015c, 0x015c,
- 0x015e, 0x015e,
- 0x0160, 0x0160,
- 0x0162, 0x0162,
- 0x0164, 0x0164,
- 0x0166, 0x0166,
- 0x0168, 0x0168,
- 0x016a, 0x016a,
- 0x016c, 0x016c,
- 0x016e, 0x016e,
- 0x0170, 0x0170,
- 0x0172, 0x0172,
- 0x0174, 0x0174,
- 0x0176, 0x0176,
- 0x0178, 0x0179,
- 0x017b, 0x017b,
- 0x017d, 0x017d,
- 0x0181, 0x0182,
- 0x0184, 0x0184,
- 0x0186, 0x0187,
- 0x0189, 0x018b,
- 0x018e, 0x0191,
- 0x0193, 0x0194,
- 0x0196, 0x0198,
- 0x019c, 0x019d,
- 0x019f, 0x01a0,
- 0x01a2, 0x01a2,
- 0x01a4, 0x01a4,
- 0x01a6, 0x01a7,
- 0x01a9, 0x01a9,
- 0x01ac, 0x01ac,
- 0x01ae, 0x01af,
- 0x01b1, 0x01b3,
- 0x01b5, 0x01b5,
- 0x01b7, 0x01b8,
- 0x01bc, 0x01bc,
- 0x01c4, 0x01c4,
- 0x01c7, 0x01c7,
- 0x01ca, 0x01ca,
- 0x01cd, 0x01cd,
- 0x01cf, 0x01cf,
- 0x01d1, 0x01d1,
- 0x01d3, 0x01d3,
- 0x01d5, 0x01d5,
- 0x01d7, 0x01d7,
- 0x01d9, 0x01d9,
- 0x01db, 0x01db,
- 0x01de, 0x01de,
- 0x01e0, 0x01e0,
- 0x01e2, 0x01e2,
- 0x01e4, 0x01e4,
- 0x01e6, 0x01e6,
- 0x01e8, 0x01e8,
- 0x01ea, 0x01ea,
- 0x01ec, 0x01ec,
- 0x01ee, 0x01ee,
- 0x01f1, 0x01f1,
- 0x01f4, 0x01f4,
- 0x01f6, 0x01f8,
- 0x01fa, 0x01fa,
- 0x01fc, 0x01fc,
- 0x01fe, 0x01fe,
- 0x0200, 0x0200,
- 0x0202, 0x0202,
- 0x0204, 0x0204,
- 0x0206, 0x0206,
- 0x0208, 0x0208,
- 0x020a, 0x020a,
- 0x020c, 0x020c,
- 0x020e, 0x020e,
- 0x0210, 0x0210,
- 0x0212, 0x0212,
- 0x0214, 0x0214,
- 0x0216, 0x0216,
- 0x0218, 0x0218,
- 0x021a, 0x021a,
- 0x021c, 0x021c,
- 0x021e, 0x021e,
- 0x0220, 0x0220,
- 0x0222, 0x0222,
- 0x0224, 0x0224,
- 0x0226, 0x0226,
- 0x0228, 0x0228,
- 0x022a, 0x022a,
- 0x022c, 0x022c,
- 0x022e, 0x022e,
- 0x0230, 0x0230,
- 0x0232, 0x0232,
- 0x023a, 0x023b,
- 0x023d, 0x023e,
- 0x0241, 0x0241,
- 0x0243, 0x0246,
- 0x0248, 0x0248,
- 0x024a, 0x024a,
- 0x024c, 0x024c,
- 0x024e, 0x024e,
- 0x0370, 0x0370,
- 0x0372, 0x0372,
- 0x0376, 0x0376,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x038f,
- 0x0391, 0x03a1,
- 0x03a3, 0x03ab,
- 0x03cf, 0x03cf,
- 0x03d2, 0x03d4,
- 0x03d8, 0x03d8,
- 0x03da, 0x03da,
- 0x03dc, 0x03dc,
- 0x03de, 0x03de,
- 0x03e0, 0x03e0,
- 0x03e2, 0x03e2,
- 0x03e4, 0x03e4,
- 0x03e6, 0x03e6,
- 0x03e8, 0x03e8,
- 0x03ea, 0x03ea,
- 0x03ec, 0x03ec,
- 0x03ee, 0x03ee,
- 0x03f4, 0x03f4,
- 0x03f7, 0x03f7,
- 0x03f9, 0x03fa,
- 0x03fd, 0x042f,
- 0x0460, 0x0460,
- 0x0462, 0x0462,
- 0x0464, 0x0464,
- 0x0466, 0x0466,
- 0x0468, 0x0468,
- 0x046a, 0x046a,
- 0x046c, 0x046c,
- 0x046e, 0x046e,
- 0x0470, 0x0470,
- 0x0472, 0x0472,
- 0x0474, 0x0474,
- 0x0476, 0x0476,
- 0x0478, 0x0478,
- 0x047a, 0x047a,
- 0x047c, 0x047c,
- 0x047e, 0x047e,
- 0x0480, 0x0480,
- 0x048a, 0x048a,
- 0x048c, 0x048c,
- 0x048e, 0x048e,
- 0x0490, 0x0490,
- 0x0492, 0x0492,
- 0x0494, 0x0494,
- 0x0496, 0x0496,
- 0x0498, 0x0498,
- 0x049a, 0x049a,
- 0x049c, 0x049c,
- 0x049e, 0x049e,
- 0x04a0, 0x04a0,
- 0x04a2, 0x04a2,
- 0x04a4, 0x04a4,
- 0x04a6, 0x04a6,
- 0x04a8, 0x04a8,
- 0x04aa, 0x04aa,
- 0x04ac, 0x04ac,
- 0x04ae, 0x04ae,
- 0x04b0, 0x04b0,
- 0x04b2, 0x04b2,
- 0x04b4, 0x04b4,
- 0x04b6, 0x04b6,
- 0x04b8, 0x04b8,
- 0x04ba, 0x04ba,
- 0x04bc, 0x04bc,
- 0x04be, 0x04be,
- 0x04c0, 0x04c1,
- 0x04c3, 0x04c3,
- 0x04c5, 0x04c5,
- 0x04c7, 0x04c7,
- 0x04c9, 0x04c9,
- 0x04cb, 0x04cb,
- 0x04cd, 0x04cd,
- 0x04d0, 0x04d0,
- 0x04d2, 0x04d2,
- 0x04d4, 0x04d4,
- 0x04d6, 0x04d6,
- 0x04d8, 0x04d8,
- 0x04da, 0x04da,
- 0x04dc, 0x04dc,
- 0x04de, 0x04de,
- 0x04e0, 0x04e0,
- 0x04e2, 0x04e2,
- 0x04e4, 0x04e4,
- 0x04e6, 0x04e6,
- 0x04e8, 0x04e8,
- 0x04ea, 0x04ea,
- 0x04ec, 0x04ec,
- 0x04ee, 0x04ee,
- 0x04f0, 0x04f0,
- 0x04f2, 0x04f2,
- 0x04f4, 0x04f4,
- 0x04f6, 0x04f6,
- 0x04f8, 0x04f8,
- 0x04fa, 0x04fa,
- 0x04fc, 0x04fc,
- 0x04fe, 0x04fe,
- 0x0500, 0x0500,
- 0x0502, 0x0502,
- 0x0504, 0x0504,
- 0x0506, 0x0506,
- 0x0508, 0x0508,
- 0x050a, 0x050a,
- 0x050c, 0x050c,
- 0x050e, 0x050e,
- 0x0510, 0x0510,
- 0x0512, 0x0512,
- 0x0514, 0x0514,
- 0x0516, 0x0516,
- 0x0518, 0x0518,
- 0x051a, 0x051a,
- 0x051c, 0x051c,
- 0x051e, 0x051e,
- 0x0520, 0x0520,
- 0x0522, 0x0522,
- 0x0524, 0x0524,
- 0x0526, 0x0526,
- 0x0531, 0x0556,
- 0x10a0, 0x10c5,
- 0x1e00, 0x1e00,
- 0x1e02, 0x1e02,
- 0x1e04, 0x1e04,
- 0x1e06, 0x1e06,
- 0x1e08, 0x1e08,
- 0x1e0a, 0x1e0a,
- 0x1e0c, 0x1e0c,
- 0x1e0e, 0x1e0e,
- 0x1e10, 0x1e10,
- 0x1e12, 0x1e12,
- 0x1e14, 0x1e14,
- 0x1e16, 0x1e16,
- 0x1e18, 0x1e18,
- 0x1e1a, 0x1e1a,
- 0x1e1c, 0x1e1c,
- 0x1e1e, 0x1e1e,
- 0x1e20, 0x1e20,
- 0x1e22, 0x1e22,
- 0x1e24, 0x1e24,
- 0x1e26, 0x1e26,
- 0x1e28, 0x1e28,
- 0x1e2a, 0x1e2a,
- 0x1e2c, 0x1e2c,
- 0x1e2e, 0x1e2e,
- 0x1e30, 0x1e30,
- 0x1e32, 0x1e32,
- 0x1e34, 0x1e34,
- 0x1e36, 0x1e36,
- 0x1e38, 0x1e38,
- 0x1e3a, 0x1e3a,
- 0x1e3c, 0x1e3c,
- 0x1e3e, 0x1e3e,
- 0x1e40, 0x1e40,
- 0x1e42, 0x1e42,
- 0x1e44, 0x1e44,
- 0x1e46, 0x1e46,
- 0x1e48, 0x1e48,
- 0x1e4a, 0x1e4a,
- 0x1e4c, 0x1e4c,
- 0x1e4e, 0x1e4e,
- 0x1e50, 0x1e50,
- 0x1e52, 0x1e52,
- 0x1e54, 0x1e54,
- 0x1e56, 0x1e56,
- 0x1e58, 0x1e58,
- 0x1e5a, 0x1e5a,
- 0x1e5c, 0x1e5c,
- 0x1e5e, 0x1e5e,
- 0x1e60, 0x1e60,
- 0x1e62, 0x1e62,
- 0x1e64, 0x1e64,
- 0x1e66, 0x1e66,
- 0x1e68, 0x1e68,
- 0x1e6a, 0x1e6a,
- 0x1e6c, 0x1e6c,
- 0x1e6e, 0x1e6e,
- 0x1e70, 0x1e70,
- 0x1e72, 0x1e72,
- 0x1e74, 0x1e74,
- 0x1e76, 0x1e76,
- 0x1e78, 0x1e78,
- 0x1e7a, 0x1e7a,
- 0x1e7c, 0x1e7c,
- 0x1e7e, 0x1e7e,
- 0x1e80, 0x1e80,
- 0x1e82, 0x1e82,
- 0x1e84, 0x1e84,
- 0x1e86, 0x1e86,
- 0x1e88, 0x1e88,
- 0x1e8a, 0x1e8a,
- 0x1e8c, 0x1e8c,
- 0x1e8e, 0x1e8e,
- 0x1e90, 0x1e90,
- 0x1e92, 0x1e92,
- 0x1e94, 0x1e94,
- 0x1e9e, 0x1e9e,
- 0x1ea0, 0x1ea0,
- 0x1ea2, 0x1ea2,
- 0x1ea4, 0x1ea4,
- 0x1ea6, 0x1ea6,
- 0x1ea8, 0x1ea8,
- 0x1eaa, 0x1eaa,
- 0x1eac, 0x1eac,
- 0x1eae, 0x1eae,
- 0x1eb0, 0x1eb0,
- 0x1eb2, 0x1eb2,
- 0x1eb4, 0x1eb4,
- 0x1eb6, 0x1eb6,
- 0x1eb8, 0x1eb8,
- 0x1eba, 0x1eba,
- 0x1ebc, 0x1ebc,
- 0x1ebe, 0x1ebe,
- 0x1ec0, 0x1ec0,
- 0x1ec2, 0x1ec2,
- 0x1ec4, 0x1ec4,
- 0x1ec6, 0x1ec6,
- 0x1ec8, 0x1ec8,
- 0x1eca, 0x1eca,
- 0x1ecc, 0x1ecc,
- 0x1ece, 0x1ece,
- 0x1ed0, 0x1ed0,
- 0x1ed2, 0x1ed2,
- 0x1ed4, 0x1ed4,
- 0x1ed6, 0x1ed6,
- 0x1ed8, 0x1ed8,
- 0x1eda, 0x1eda,
- 0x1edc, 0x1edc,
- 0x1ede, 0x1ede,
- 0x1ee0, 0x1ee0,
- 0x1ee2, 0x1ee2,
- 0x1ee4, 0x1ee4,
- 0x1ee6, 0x1ee6,
- 0x1ee8, 0x1ee8,
- 0x1eea, 0x1eea,
- 0x1eec, 0x1eec,
- 0x1eee, 0x1eee,
- 0x1ef0, 0x1ef0,
- 0x1ef2, 0x1ef2,
- 0x1ef4, 0x1ef4,
- 0x1ef6, 0x1ef6,
- 0x1ef8, 0x1ef8,
- 0x1efa, 0x1efa,
- 0x1efc, 0x1efc,
- 0x1efe, 0x1efe,
- 0x1f08, 0x1f0f,
- 0x1f18, 0x1f1d,
- 0x1f28, 0x1f2f,
- 0x1f38, 0x1f3f,
- 0x1f48, 0x1f4d,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f5f,
- 0x1f68, 0x1f6f,
- 0x1fb8, 0x1fbb,
- 0x1fc8, 0x1fcb,
- 0x1fd8, 0x1fdb,
- 0x1fe8, 0x1fec,
- 0x1ff8, 0x1ffb,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210b, 0x210d,
- 0x2110, 0x2112,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x2130, 0x2133,
- 0x213e, 0x213f,
- 0x2145, 0x2145,
- 0x2160, 0x216f,
- 0x2183, 0x2183,
- 0x24b6, 0x24cf,
- 0x2c00, 0x2c2e,
- 0x2c60, 0x2c60,
- 0x2c62, 0x2c64,
- 0x2c67, 0x2c67,
- 0x2c69, 0x2c69,
- 0x2c6b, 0x2c6b,
- 0x2c6d, 0x2c70,
- 0x2c72, 0x2c72,
- 0x2c75, 0x2c75,
- 0x2c7e, 0x2c80,
- 0x2c82, 0x2c82,
- 0x2c84, 0x2c84,
- 0x2c86, 0x2c86,
- 0x2c88, 0x2c88,
- 0x2c8a, 0x2c8a,
- 0x2c8c, 0x2c8c,
- 0x2c8e, 0x2c8e,
- 0x2c90, 0x2c90,
- 0x2c92, 0x2c92,
- 0x2c94, 0x2c94,
- 0x2c96, 0x2c96,
- 0x2c98, 0x2c98,
- 0x2c9a, 0x2c9a,
- 0x2c9c, 0x2c9c,
- 0x2c9e, 0x2c9e,
- 0x2ca0, 0x2ca0,
- 0x2ca2, 0x2ca2,
- 0x2ca4, 0x2ca4,
- 0x2ca6, 0x2ca6,
- 0x2ca8, 0x2ca8,
- 0x2caa, 0x2caa,
- 0x2cac, 0x2cac,
- 0x2cae, 0x2cae,
- 0x2cb0, 0x2cb0,
- 0x2cb2, 0x2cb2,
- 0x2cb4, 0x2cb4,
- 0x2cb6, 0x2cb6,
- 0x2cb8, 0x2cb8,
- 0x2cba, 0x2cba,
- 0x2cbc, 0x2cbc,
- 0x2cbe, 0x2cbe,
- 0x2cc0, 0x2cc0,
- 0x2cc2, 0x2cc2,
- 0x2cc4, 0x2cc4,
- 0x2cc6, 0x2cc6,
- 0x2cc8, 0x2cc8,
- 0x2cca, 0x2cca,
- 0x2ccc, 0x2ccc,
- 0x2cce, 0x2cce,
- 0x2cd0, 0x2cd0,
- 0x2cd2, 0x2cd2,
- 0x2cd4, 0x2cd4,
- 0x2cd6, 0x2cd6,
- 0x2cd8, 0x2cd8,
- 0x2cda, 0x2cda,
- 0x2cdc, 0x2cdc,
- 0x2cde, 0x2cde,
- 0x2ce0, 0x2ce0,
- 0x2ce2, 0x2ce2,
- 0x2ceb, 0x2ceb,
- 0x2ced, 0x2ced,
- 0xa640, 0xa640,
- 0xa642, 0xa642,
- 0xa644, 0xa644,
- 0xa646, 0xa646,
- 0xa648, 0xa648,
- 0xa64a, 0xa64a,
- 0xa64c, 0xa64c,
- 0xa64e, 0xa64e,
- 0xa650, 0xa650,
- 0xa652, 0xa652,
- 0xa654, 0xa654,
- 0xa656, 0xa656,
- 0xa658, 0xa658,
- 0xa65a, 0xa65a,
- 0xa65c, 0xa65c,
- 0xa65e, 0xa65e,
- 0xa660, 0xa660,
- 0xa662, 0xa662,
- 0xa664, 0xa664,
- 0xa666, 0xa666,
- 0xa668, 0xa668,
- 0xa66a, 0xa66a,
- 0xa66c, 0xa66c,
- 0xa680, 0xa680,
- 0xa682, 0xa682,
- 0xa684, 0xa684,
- 0xa686, 0xa686,
- 0xa688, 0xa688,
- 0xa68a, 0xa68a,
- 0xa68c, 0xa68c,
- 0xa68e, 0xa68e,
- 0xa690, 0xa690,
- 0xa692, 0xa692,
- 0xa694, 0xa694,
- 0xa696, 0xa696,
- 0xa722, 0xa722,
- 0xa724, 0xa724,
- 0xa726, 0xa726,
- 0xa728, 0xa728,
- 0xa72a, 0xa72a,
- 0xa72c, 0xa72c,
- 0xa72e, 0xa72e,
- 0xa732, 0xa732,
- 0xa734, 0xa734,
- 0xa736, 0xa736,
- 0xa738, 0xa738,
- 0xa73a, 0xa73a,
- 0xa73c, 0xa73c,
- 0xa73e, 0xa73e,
- 0xa740, 0xa740,
- 0xa742, 0xa742,
- 0xa744, 0xa744,
- 0xa746, 0xa746,
- 0xa748, 0xa748,
- 0xa74a, 0xa74a,
- 0xa74c, 0xa74c,
- 0xa74e, 0xa74e,
- 0xa750, 0xa750,
- 0xa752, 0xa752,
- 0xa754, 0xa754,
- 0xa756, 0xa756,
- 0xa758, 0xa758,
- 0xa75a, 0xa75a,
- 0xa75c, 0xa75c,
- 0xa75e, 0xa75e,
- 0xa760, 0xa760,
- 0xa762, 0xa762,
- 0xa764, 0xa764,
- 0xa766, 0xa766,
- 0xa768, 0xa768,
- 0xa76a, 0xa76a,
- 0xa76c, 0xa76c,
- 0xa76e, 0xa76e,
- 0xa779, 0xa779,
- 0xa77b, 0xa77b,
- 0xa77d, 0xa77e,
- 0xa780, 0xa780,
- 0xa782, 0xa782,
- 0xa784, 0xa784,
- 0xa786, 0xa786,
- 0xa78b, 0xa78b,
- 0xa78d, 0xa78d,
- 0xa790, 0xa790,
- 0xa7a0, 0xa7a0,
- 0xa7a2, 0xa7a2,
- 0xa7a4, 0xa7a4,
- 0xa7a6, 0xa7a6,
- 0xa7a8, 0xa7a8,
- 0xff21, 0xff3a,
- 0x10400, 0x10427,
- 0x1d400, 0x1d419,
- 0x1d434, 0x1d44d,
- 0x1d468, 0x1d481,
- 0x1d49c, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b5,
- 0x1d4d0, 0x1d4e9,
- 0x1d504, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d538, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d56c, 0x1d585,
- 0x1d5a0, 0x1d5b9,
- 0x1d5d4, 0x1d5ed,
- 0x1d608, 0x1d621,
- 0x1d63c, 0x1d655,
- 0x1d670, 0x1d689,
- 0x1d6a8, 0x1d6c0,
- 0x1d6e2, 0x1d6fa,
- 0x1d71c, 0x1d734,
- 0x1d756, 0x1d76e,
- 0x1d790, 0x1d7a8,
- 0x1d7ca, 0x1d7ca,
-}; /* CR_Uppercase */
+#define CR_Uppercase CR_Upper
/* 'Cased': Derived Property */
static const OnigCodePoint CR_Cased[] = {
- 112,
+ 119,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -6797,6 +10064,8 @@ static const OnigCodePoint CR_Cased[] = {
0x0531, 0x0556,
0x0561, 0x0587,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x1d00, 0x1dbf,
0x1e00, 0x1f15,
0x1f18, 0x1f1d,
@@ -6817,7 +10086,9 @@ static const OnigCodePoint CR_Cased[] = {
0x1fe0, 0x1fec,
0x1ff2, 0x1ff4,
0x1ff6, 0x1ffc,
- 0x2090, 0x2094,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
0x2102, 0x2102,
0x2107, 0x2107,
0x210a, 0x2113,
@@ -6839,14 +10110,17 @@ static const OnigCodePoint CR_Cased[] = {
0x2c30, 0x2c5e,
0x2c60, 0x2ce4,
0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
0xa640, 0xa66d,
0xa680, 0xa697,
0xa722, 0xa787,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa7fa,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa7fa,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
0xff21, 0xff3a,
@@ -6886,7 +10160,7 @@ static const OnigCodePoint CR_Cased[] = {
/* 'Case_Ignorable': Derived Property */
static const OnigCodePoint CR_Case_Ignorable[] = {
- 277,
+ 295,
0x0027, 0x0027,
0x002e, 0x002e,
0x003a, 0x003a,
@@ -6910,7 +10184,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x05c4, 0x05c5,
0x05c7, 0x05c7,
0x05f4, 0x05f4,
- 0x0600, 0x0603,
+ 0x0600, 0x0604,
0x0610, 0x061a,
0x0640, 0x0640,
0x064b, 0x065f,
@@ -6926,6 +10200,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x07fa, 0x07fa,
0x0816, 0x082d,
0x0859, 0x085b,
+ 0x08e4, 0x08fe,
0x0900, 0x0902,
0x093a, 0x093a,
0x093c, 0x093c,
@@ -7045,6 +10320,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x1b80, 0x1b81,
0x1ba2, 0x1ba5,
0x1ba8, 0x1ba9,
+ 0x1bab, 0x1bab,
0x1be6, 0x1be6,
0x1be8, 0x1be9,
0x1bed, 0x1bed,
@@ -7056,7 +10332,8 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x1cd4, 0x1ce0,
0x1ce2, 0x1ce8,
0x1ced, 0x1ced,
- 0x1d2c, 0x1d61,
+ 0x1cf4, 0x1cf4,
+ 0x1d2c, 0x1d6a,
0x1d78, 0x1d78,
0x1d9b, 0x1de6,
0x1dfc, 0x1dff,
@@ -7077,14 +10354,14 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x207f, 0x207f,
0x2090, 0x209c,
0x20d0, 0x20f0,
- 0x2c7d, 0x2c7d,
+ 0x2c7c, 0x2c7d,
0x2cef, 0x2cf1,
0x2d6f, 0x2d6f,
0x2d7f, 0x2d7f,
0x2de0, 0x2dff,
0x2e2f, 0x2e2f,
0x3005, 0x3005,
- 0x302a, 0x302f,
+ 0x302a, 0x302d,
0x3031, 0x3035,
0x303b, 0x303b,
0x3099, 0x309e,
@@ -7093,12 +10370,14 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0xa4f8, 0xa4fd,
0xa60c, 0xa60c,
0xa66f, 0xa672,
- 0xa67c, 0xa67d,
+ 0xa674, 0xa67d,
0xa67f, 0xa67f,
+ 0xa69f, 0xa69f,
0xa6f0, 0xa6f1,
0xa700, 0xa721,
0xa770, 0xa770,
0xa788, 0xa78a,
+ 0xa7f8, 0xa7f9,
0xa802, 0xa802,
0xa806, 0xa806,
0xa80b, 0xa80b,
@@ -7124,6 +10403,9 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0xaabe, 0xaabf,
0xaac1, 0xaac1,
0xaadd, 0xaadd,
+ 0xaaec, 0xaaed,
+ 0xaaf3, 0xaaf4,
+ 0xaaf6, 0xaaf6,
0xabe5, 0xabe5,
0xabe8, 0xabe8,
0xabed, 0xabed,
@@ -7156,6 +10438,16 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x110b3, 0x110b6,
0x110b9, 0x110ba,
0x110bd, 0x110bd,
+ 0x11100, 0x11102,
+ 0x11127, 0x1112b,
+ 0x1112d, 0x11134,
+ 0x11180, 0x11181,
+ 0x111b6, 0x111be,
+ 0x116ab, 0x116ab,
+ 0x116ad, 0x116ad,
+ 0x116b0, 0x116b5,
+ 0x116b7, 0x116b7,
+ 0x16f8f, 0x16f9f,
0x1d167, 0x1d169,
0x1d173, 0x1d182,
0x1d185, 0x1d18b,
@@ -7168,7 +10460,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
/* 'Changes_When_Lowercased': Derived Property */
static const OnigCodePoint CR_Changes_When_Lowercased[] = {
- 566,
+ 571,
0x0041, 0x005a,
0x00c0, 0x00d6,
0x00d8, 0x00de,
@@ -7436,6 +10728,8 @@ static const OnigCodePoint CR_Changes_When_Lowercased[] = {
0x0526, 0x0526,
0x0531, 0x0556,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x1e00, 0x1e00,
0x1e02, 0x1e02,
0x1e04, 0x1e04,
@@ -7645,6 +10939,7 @@ static const OnigCodePoint CR_Changes_When_Lowercased[] = {
0x2ce2, 0x2ce2,
0x2ceb, 0x2ceb,
0x2ced, 0x2ced,
+ 0x2cf2, 0x2cf2,
0xa640, 0xa640,
0xa642, 0xa642,
0xa644, 0xa644,
@@ -7728,18 +11023,20 @@ static const OnigCodePoint CR_Changes_When_Lowercased[] = {
0xa78b, 0xa78b,
0xa78d, 0xa78d,
0xa790, 0xa790,
+ 0xa792, 0xa792,
0xa7a0, 0xa7a0,
0xa7a2, 0xa7a2,
0xa7a4, 0xa7a4,
0xa7a6, 0xa7a6,
0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
0xff21, 0xff3a,
0x10400, 0x10427,
}; /* CR_Changes_When_Lowercased */
/* 'Changes_When_Uppercased': Derived Property */
static const OnigCodePoint CR_Changes_When_Uppercased[] = {
- 582,
+ 586,
0x0061, 0x007a,
0x00b5, 0x00b5,
0x00df, 0x00f6,
@@ -7889,7 +11186,7 @@ static const OnigCodePoint CR_Changes_When_Uppercased[] = {
0x025b, 0x025b,
0x0260, 0x0260,
0x0263, 0x0263,
- 0x0265, 0x0265,
+ 0x0265, 0x0266,
0x0268, 0x0269,
0x026b, 0x026b,
0x026f, 0x026f,
@@ -8230,7 +11527,10 @@ static const OnigCodePoint CR_Changes_When_Uppercased[] = {
0x2ce3, 0x2ce3,
0x2cec, 0x2cec,
0x2cee, 0x2cee,
+ 0x2cf3, 0x2cf3,
0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
0xa641, 0xa641,
0xa643, 0xa643,
0xa645, 0xa645,
@@ -8313,6 +11613,7 @@ static const OnigCodePoint CR_Changes_When_Uppercased[] = {
0xa787, 0xa787,
0xa78c, 0xa78c,
0xa791, 0xa791,
+ 0xa793, 0xa793,
0xa7a1, 0xa7a1,
0xa7a3, 0xa7a3,
0xa7a5, 0xa7a5,
@@ -8326,7 +11627,7 @@ static const OnigCodePoint CR_Changes_When_Uppercased[] = {
/* 'Changes_When_Titlecased': Derived Property */
static const OnigCodePoint CR_Changes_When_Titlecased[] = {
- 583,
+ 587,
0x0061, 0x007a,
0x00b5, 0x00b5,
0x00df, 0x00f6,
@@ -8477,7 +11778,7 @@ static const OnigCodePoint CR_Changes_When_Titlecased[] = {
0x025b, 0x025b,
0x0260, 0x0260,
0x0263, 0x0263,
- 0x0265, 0x0265,
+ 0x0265, 0x0266,
0x0268, 0x0269,
0x026b, 0x026b,
0x026f, 0x026f,
@@ -8818,7 +12119,10 @@ static const OnigCodePoint CR_Changes_When_Titlecased[] = {
0x2ce3, 0x2ce3,
0x2cec, 0x2cec,
0x2cee, 0x2cee,
+ 0x2cf3, 0x2cf3,
0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
0xa641, 0xa641,
0xa643, 0xa643,
0xa645, 0xa645,
@@ -8901,6 +12205,7 @@ static const OnigCodePoint CR_Changes_When_Titlecased[] = {
0xa787, 0xa787,
0xa78c, 0xa78c,
0xa791, 0xa791,
+ 0xa793, 0xa793,
0xa7a1, 0xa7a1,
0xa7a3, 0xa7a3,
0xa7a5, 0xa7a5,
@@ -8914,7 +12219,7 @@ static const OnigCodePoint CR_Changes_When_Titlecased[] = {
/* 'Changes_When_Casefolded': Derived Property */
static const OnigCodePoint CR_Changes_When_Casefolded[] = {
- 577,
+ 582,
0x0041, 0x005a,
0x00b5, 0x00b5,
0x00c0, 0x00d6,
@@ -9189,6 +12494,8 @@ static const OnigCodePoint CR_Changes_When_Casefolded[] = {
0x0531, 0x0556,
0x0587, 0x0587,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x1e00, 0x1e00,
0x1e02, 0x1e02,
0x1e04, 0x1e04,
@@ -9400,6 +12707,7 @@ static const OnigCodePoint CR_Changes_When_Casefolded[] = {
0x2ce2, 0x2ce2,
0x2ceb, 0x2ceb,
0x2ced, 0x2ced,
+ 0x2cf2, 0x2cf2,
0xa640, 0xa640,
0xa642, 0xa642,
0xa644, 0xa644,
@@ -9483,11 +12791,13 @@ static const OnigCodePoint CR_Changes_When_Casefolded[] = {
0xa78b, 0xa78b,
0xa78d, 0xa78d,
0xa790, 0xa790,
+ 0xa792, 0xa792,
0xa7a0, 0xa7a0,
0xa7a2, 0xa7a2,
0xa7a4, 0xa7a4,
0xa7a6, 0xa7a6,
0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
0xff21, 0xff3a,
@@ -9496,7 +12806,7 @@ static const OnigCodePoint CR_Changes_When_Casefolded[] = {
/* 'Changes_When_Casemapped': Derived Property */
static const OnigCodePoint CR_Changes_When_Casemapped[] = {
- 99,
+ 104,
0x0041, 0x005a,
0x0061, 0x007a,
0x00b5, 0x00b5,
@@ -9517,7 +12827,7 @@ static const OnigCodePoint CR_Changes_When_Casemapped[] = {
0x025b, 0x025b,
0x0260, 0x0260,
0x0263, 0x0263,
- 0x0265, 0x0265,
+ 0x0265, 0x0266,
0x0268, 0x0269,
0x026b, 0x026b,
0x026f, 0x026f,
@@ -9545,6 +12855,8 @@ static const OnigCodePoint CR_Changes_When_Casemapped[] = {
0x0531, 0x0556,
0x0561, 0x0587,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x1d79, 0x1d79,
0x1d7d, 0x1d7d,
0x1e00, 0x1e9b,
@@ -9582,15 +12894,18 @@ static const OnigCodePoint CR_Changes_When_Casemapped[] = {
0x2c75, 0x2c76,
0x2c7e, 0x2ce3,
0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
0xa640, 0xa66d,
0xa680, 0xa697,
0xa722, 0xa72f,
0xa732, 0xa76f,
0xa779, 0xa787,
0xa78b, 0xa78d,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
0xff21, 0xff3a,
@@ -9600,7 +12915,7 @@ static const OnigCodePoint CR_Changes_When_Casemapped[] = {
/* 'ID_Start': Derived Property */
static const OnigCodePoint CR_ID_Start[] = {
- 437,
+ 488,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -9648,6 +12963,8 @@ static const OnigCodePoint CR_ID_Start[] = {
0x0824, 0x0824,
0x0828, 0x0828,
0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
0x0904, 0x0939,
0x093d, 0x093d,
0x0950, 0x0950,
@@ -9753,7 +13070,7 @@ static const OnigCodePoint CR_ID_Start[] = {
0x0ebd, 0x0ebd,
0x0ec0, 0x0ec4,
0x0ec6, 0x0ec6,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f00,
0x0f40, 0x0f47,
0x0f49, 0x0f6c,
@@ -9768,9 +13085,10 @@ static const OnigCodePoint CR_ID_Start[] = {
0x1075, 0x1081,
0x108e, 0x108e,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
+ 0x10fc, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -9818,12 +13136,13 @@ static const OnigCodePoint CR_ID_Start[] = {
0x1b45, 0x1b4b,
0x1b83, 0x1ba0,
0x1bae, 0x1baf,
- 0x1bc0, 0x1be5,
+ 0x1bba, 0x1be5,
0x1c00, 0x1c23,
0x1c4d, 0x1c4f,
0x1c5a, 0x1c7d,
0x1ce9, 0x1cec,
0x1cee, 0x1cf1,
+ 0x1cf5, 0x1cf6,
0x1d00, 0x1dbf,
0x1e00, 0x1f15,
0x1f18, 0x1f1d,
@@ -9864,8 +13183,11 @@ static const OnigCodePoint CR_ID_Start[] = {
0x2c30, 0x2c5e,
0x2c60, 0x2ce4,
0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d6f,
0x2d80, 0x2d96,
0x2da0, 0x2da6,
@@ -9889,7 +13211,7 @@ static const OnigCodePoint CR_ID_Start[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
@@ -9901,9 +13223,9 @@ static const OnigCodePoint CR_ID_Start[] = {
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa801,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa822,
@@ -9928,6 +13250,8 @@ static const OnigCodePoint CR_ID_Start[] = {
0xaac0, 0xaac0,
0xaac2, 0xaac2,
0xaadb, 0xaadd,
+ 0xaae0, 0xaaea,
+ 0xaaf2, 0xaaf4,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -9937,8 +13261,7 @@ static const OnigCodePoint CR_ID_Start[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -9988,6 +13311,8 @@ static const OnigCodePoint CR_ID_Start[] = {
0x1083f, 0x10855,
0x10900, 0x10915,
0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a00,
0x10a10, 0x10a13,
0x10a15, 0x10a17,
@@ -9999,10 +13324,18 @@ static const OnigCodePoint CR_ID_Start[] = {
0x10c00, 0x10c48,
0x11003, 0x11037,
0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
0x12000, 0x1236e,
0x12400, 0x12462,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f50,
+ 0x16f93, 0x16f9f,
0x1b000, 0x1b001,
0x1d400, 0x1d454,
0x1d456, 0x1d49c,
@@ -10034,6 +13367,39 @@ static const OnigCodePoint CR_ID_Start[] = {
0x1d78a, 0x1d7a8,
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -10042,7 +13408,7 @@ static const OnigCodePoint CR_ID_Start[] = {
/* 'ID_Continue': Derived Property */
static const OnigCodePoint CR_ID_Continue[] = {
- 514,
+ 564,
0x0030, 0x0039,
0x0041, 0x005a,
0x005f, 0x005f,
@@ -10091,6 +13457,9 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x07fa, 0x07fa,
0x0800, 0x082d,
0x0840, 0x085b,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
0x0900, 0x0963,
0x0966, 0x096f,
0x0971, 0x0977,
@@ -10238,7 +13607,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x0ec6, 0x0ec6,
0x0ec8, 0x0ecd,
0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f00,
0x0f18, 0x0f19,
0x0f20, 0x0f29,
@@ -10254,9 +13623,10 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1000, 0x1049,
0x1050, 0x109d,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
+ 0x10fc, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -10288,8 +13658,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1760, 0x176c,
0x176e, 0x1770,
0x1772, 0x1773,
- 0x1780, 0x17b3,
- 0x17b6, 0x17d3,
+ 0x1780, 0x17d3,
0x17d7, 0x17d7,
0x17dc, 0x17dd,
0x17e0, 0x17e9,
@@ -10315,14 +13684,12 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1b00, 0x1b4b,
0x1b50, 0x1b59,
0x1b6b, 0x1b73,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1bf3,
+ 0x1b80, 0x1bf3,
0x1c00, 0x1c37,
0x1c40, 0x1c49,
0x1c4d, 0x1c7d,
0x1cd0, 0x1cd2,
- 0x1cd4, 0x1cf2,
+ 0x1cd4, 0x1cf6,
0x1d00, 0x1de6,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
@@ -10367,9 +13734,11 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
0x2c60, 0x2ce4,
- 0x2ceb, 0x2cf1,
+ 0x2ceb, 0x2cf3,
0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d6f,
0x2d7f, 0x2d96,
0x2da0, 0x2da6,
@@ -10394,21 +13763,21 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
0xa610, 0xa62b,
0xa640, 0xa66f,
- 0xa67c, 0xa67d,
+ 0xa674, 0xa67d,
0xa67f, 0xa697,
- 0xa6a0, 0xa6f1,
+ 0xa69f, 0xa6f1,
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa827,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa827,
0xa840, 0xa873,
0xa880, 0xa8c4,
0xa8d0, 0xa8d9,
@@ -10426,6 +13795,8 @@ static const OnigCodePoint CR_ID_Continue[] = {
0xaa7a, 0xaa7b,
0xaa80, 0xaac2,
0xaadb, 0xaadd,
+ 0xaae0, 0xaaef,
+ 0xaaf2, 0xaaf6,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -10437,8 +13808,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -10495,6 +13865,8 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1083f, 0x10855,
0x10900, 0x10915,
0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a13,
@@ -10510,10 +13882,21 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x11000, 0x11046,
0x11066, 0x1106f,
0x11080, 0x110ba,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x1113f,
+ 0x11180, 0x111c4,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
0x12000, 0x1236e,
0x12400, 0x12462,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
0x1d165, 0x1d169,
0x1d16d, 0x1d172,
@@ -10552,6 +13935,39 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -10561,7 +13977,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
/* 'XID_Start': Derived Property */
static const OnigCodePoint CR_XID_Start[] = {
- 444,
+ 495,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -10609,6 +14025,8 @@ static const OnigCodePoint CR_XID_Start[] = {
0x0824, 0x0824,
0x0828, 0x0828,
0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
0x0904, 0x0939,
0x093d, 0x093d,
0x0950, 0x0950,
@@ -10714,7 +14132,7 @@ static const OnigCodePoint CR_XID_Start[] = {
0x0ebd, 0x0ebd,
0x0ec0, 0x0ec4,
0x0ec6, 0x0ec6,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f00,
0x0f40, 0x0f47,
0x0f49, 0x0f6c,
@@ -10729,9 +14147,10 @@ static const OnigCodePoint CR_XID_Start[] = {
0x1075, 0x1081,
0x108e, 0x108e,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
+ 0x10fc, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -10779,12 +14198,13 @@ static const OnigCodePoint CR_XID_Start[] = {
0x1b45, 0x1b4b,
0x1b83, 0x1ba0,
0x1bae, 0x1baf,
- 0x1bc0, 0x1be5,
+ 0x1bba, 0x1be5,
0x1c00, 0x1c23,
0x1c4d, 0x1c4f,
0x1c5a, 0x1c7d,
0x1ce9, 0x1cec,
0x1cee, 0x1cf1,
+ 0x1cf5, 0x1cf6,
0x1d00, 0x1dbf,
0x1e00, 0x1f15,
0x1f18, 0x1f1d,
@@ -10825,8 +14245,11 @@ static const OnigCodePoint CR_XID_Start[] = {
0x2c30, 0x2c5e,
0x2c60, 0x2ce4,
0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d6f,
0x2d80, 0x2d96,
0x2da0, 0x2da6,
@@ -10850,7 +14273,7 @@ static const OnigCodePoint CR_XID_Start[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
@@ -10862,9 +14285,9 @@ static const OnigCodePoint CR_XID_Start[] = {
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa801,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa822,
@@ -10889,6 +14312,8 @@ static const OnigCodePoint CR_XID_Start[] = {
0xaac0, 0xaac0,
0xaac2, 0xaac2,
0xaadb, 0xaadd,
+ 0xaae0, 0xaaea,
+ 0xaaf2, 0xaaf4,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -10898,8 +14323,7 @@ static const OnigCodePoint CR_XID_Start[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -10956,6 +14380,8 @@ static const OnigCodePoint CR_XID_Start[] = {
0x1083f, 0x10855,
0x10900, 0x10915,
0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a00,
0x10a10, 0x10a13,
0x10a15, 0x10a17,
@@ -10967,10 +14393,18 @@ static const OnigCodePoint CR_XID_Start[] = {
0x10c00, 0x10c48,
0x11003, 0x11037,
0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
0x12000, 0x1236e,
0x12400, 0x12462,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f50,
+ 0x16f93, 0x16f9f,
0x1b000, 0x1b001,
0x1d400, 0x1d454,
0x1d456, 0x1d49c,
@@ -11002,6 +14436,39 @@ static const OnigCodePoint CR_XID_Start[] = {
0x1d78a, 0x1d7a8,
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -11010,7 +14477,7 @@ static const OnigCodePoint CR_XID_Start[] = {
/* 'XID_Continue': Derived Property */
static const OnigCodePoint CR_XID_Continue[] = {
- 521,
+ 571,
0x0030, 0x0039,
0x0041, 0x005a,
0x005f, 0x005f,
@@ -11059,6 +14526,9 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x07fa, 0x07fa,
0x0800, 0x082d,
0x0840, 0x085b,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
0x0900, 0x0963,
0x0966, 0x096f,
0x0971, 0x0977,
@@ -11206,7 +14676,7 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x0ec6, 0x0ec6,
0x0ec8, 0x0ecd,
0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f00,
0x0f18, 0x0f19,
0x0f20, 0x0f29,
@@ -11222,9 +14692,10 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1000, 0x1049,
0x1050, 0x109d,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
+ 0x10fc, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -11256,8 +14727,7 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1760, 0x176c,
0x176e, 0x1770,
0x1772, 0x1773,
- 0x1780, 0x17b3,
- 0x17b6, 0x17d3,
+ 0x1780, 0x17d3,
0x17d7, 0x17d7,
0x17dc, 0x17dd,
0x17e0, 0x17e9,
@@ -11283,14 +14753,12 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1b00, 0x1b4b,
0x1b50, 0x1b59,
0x1b6b, 0x1b73,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1bf3,
+ 0x1b80, 0x1bf3,
0x1c00, 0x1c37,
0x1c40, 0x1c49,
0x1c4d, 0x1c7d,
0x1cd0, 0x1cd2,
- 0x1cd4, 0x1cf2,
+ 0x1cd4, 0x1cf6,
0x1d00, 0x1de6,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
@@ -11335,9 +14803,11 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
0x2c60, 0x2ce4,
- 0x2ceb, 0x2cf1,
+ 0x2ceb, 0x2cf3,
0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d6f,
0x2d7f, 0x2d96,
0x2da0, 0x2da6,
@@ -11363,21 +14833,21 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
0xa610, 0xa62b,
0xa640, 0xa66f,
- 0xa67c, 0xa67d,
+ 0xa674, 0xa67d,
0xa67f, 0xa697,
- 0xa6a0, 0xa6f1,
+ 0xa69f, 0xa6f1,
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa827,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa827,
0xa840, 0xa873,
0xa880, 0xa8c4,
0xa8d0, 0xa8d9,
@@ -11395,6 +14865,8 @@ static const OnigCodePoint CR_XID_Continue[] = {
0xaa7a, 0xaa7b,
0xaa80, 0xaac2,
0xaadb, 0xaadd,
+ 0xaae0, 0xaaef,
+ 0xaaf2, 0xaaf6,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -11406,8 +14878,7 @@ static const OnigCodePoint CR_XID_Continue[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -11470,6 +14941,8 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1083f, 0x10855,
0x10900, 0x10915,
0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a13,
@@ -11485,10 +14958,21 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x11000, 0x11046,
0x11066, 0x1106f,
0x11080, 0x110ba,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x1113f,
+ 0x11180, 0x111c4,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
0x12000, 0x1236e,
0x12400, 0x12462,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
0x1d165, 0x1d169,
0x1d16d, 0x1d172,
@@ -11527,6 +15011,39 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -11556,7 +15073,7 @@ static const OnigCodePoint CR_Default_Ignorable_Code_Point[] = {
/* 'Grapheme_Extend': Derived Property */
static const OnigCodePoint CR_Grapheme_Extend[] = {
- 215,
+ 232,
0x0300, 0x036f,
0x0483, 0x0489,
0x0591, 0x05bd,
@@ -11580,6 +15097,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x0825, 0x0827,
0x0829, 0x082d,
0x0859, 0x085b,
+ 0x08e4, 0x08fe,
0x0900, 0x0902,
0x093a, 0x093a,
0x093c, 0x093c,
@@ -11675,6 +15193,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x1732, 0x1734,
0x1752, 0x1753,
0x1772, 0x1773,
+ 0x17b4, 0x17b5,
0x17b7, 0x17bd,
0x17c6, 0x17c6,
0x17c9, 0x17d3,
@@ -11702,6 +15221,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x1b80, 0x1b81,
0x1ba2, 0x1ba5,
0x1ba8, 0x1ba9,
+ 0x1bab, 0x1bab,
0x1be6, 0x1be6,
0x1be8, 0x1be9,
0x1bed, 0x1bed,
@@ -11712,6 +15232,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x1cd4, 0x1ce0,
0x1ce2, 0x1ce8,
0x1ced, 0x1ced,
+ 0x1cf4, 0x1cf4,
0x1dc0, 0x1de6,
0x1dfc, 0x1dff,
0x200c, 0x200d,
@@ -11722,7 +15243,8 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x302a, 0x302f,
0x3099, 0x309a,
0xa66f, 0xa672,
- 0xa67c, 0xa67d,
+ 0xa674, 0xa67d,
+ 0xa69f, 0xa69f,
0xa6f0, 0xa6f1,
0xa802, 0xa802,
0xa806, 0xa806,
@@ -11746,6 +15268,8 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0xaab7, 0xaab8,
0xaabe, 0xaabf,
0xaac1, 0xaac1,
+ 0xaaec, 0xaaed,
+ 0xaaf6, 0xaaf6,
0xabe5, 0xabe5,
0xabe8, 0xabe8,
0xabed, 0xabed,
@@ -11764,6 +15288,16 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x11080, 0x11081,
0x110b3, 0x110b6,
0x110b9, 0x110ba,
+ 0x11100, 0x11102,
+ 0x11127, 0x1112b,
+ 0x1112d, 0x11134,
+ 0x11180, 0x11181,
+ 0x111b6, 0x111be,
+ 0x116ab, 0x116ab,
+ 0x116ad, 0x116ad,
+ 0x116b0, 0x116b5,
+ 0x116b7, 0x116b7,
+ 0x16f8f, 0x16f92,
0x1d165, 0x1d165,
0x1d167, 0x1d169,
0x1d16e, 0x1d172,
@@ -11776,7 +15310,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
/* 'Grapheme_Base': Derived Property */
static const OnigCodePoint CR_Grapheme_Base[] = {
- 596,
+ 643,
0x0020, 0x007e,
0x00a0, 0x00ac,
0x00ae, 0x02ff,
@@ -11791,6 +15325,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x0559, 0x055f,
0x0561, 0x0587,
0x0589, 0x058a,
+ 0x058f, 0x058f,
0x05be, 0x05be,
0x05c0, 0x05c0,
0x05c3, 0x05c3,
@@ -11819,6 +15354,8 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x0830, 0x083e,
0x0840, 0x0858,
0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
0x0903, 0x0939,
0x093b, 0x093b,
0x093d, 0x0940,
@@ -11867,8 +15404,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x0acb, 0x0acc,
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae1,
- 0x0ae6, 0x0aef,
- 0x0af1, 0x0af1,
+ 0x0ae6, 0x0af1,
0x0b02, 0x0b03,
0x0b05, 0x0b0c,
0x0b0f, 0x0b10,
@@ -11968,7 +15504,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x0ec0, 0x0ec4,
0x0ec6, 0x0ec6,
0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f17,
0x0f1a, 0x0f34,
0x0f36, 0x0f36,
@@ -11993,8 +15529,9 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1087, 0x108c,
0x108e, 0x109c,
0x109e, 0x10c5,
- 0x10d0, 0x10fc,
- 0x1100, 0x1248,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -12067,8 +15604,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1b82, 0x1ba1,
0x1ba6, 0x1ba7,
0x1baa, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1be5,
+ 0x1bac, 0x1be5,
0x1be7, 0x1be7,
0x1bea, 0x1bec,
0x1bee, 0x1bee,
@@ -12077,10 +15613,12 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1c34, 0x1c35,
0x1c3b, 0x1c49,
0x1c4d, 0x1c7f,
+ 0x1cc0, 0x1cc7,
0x1cd3, 0x1cd3,
0x1ce1, 0x1ce1,
0x1ce9, 0x1cec,
- 0x1cee, 0x1cf2,
+ 0x1cee, 0x1cf3,
+ 0x1cf5, 0x1cf6,
0x1d00, 0x1dbf,
0x1e00, 0x1f15,
0x1f18, 0x1f1d,
@@ -12110,15 +15648,16 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x2400, 0x2426,
0x2440, 0x244a,
0x2460, 0x26ff,
- 0x2701, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x2b4c,
+ 0x2701, 0x2b4c,
0x2b50, 0x2b59,
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
0x2c60, 0x2cee,
+ 0x2cf2, 0x2cf3,
0x2cf9, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d70,
0x2d80, 0x2d96,
0x2da0, 0x2da6,
@@ -12129,7 +15668,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x2dc8, 0x2dce,
0x2dd0, 0x2dd6,
0x2dd8, 0x2dde,
- 0x2e00, 0x2e31,
+ 0x2e00, 0x2e3b,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
0x2f00, 0x2fd5,
@@ -12145,7 +15684,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x31f0, 0x321e,
0x3220, 0x32fe,
0x3300, 0x4db5,
- 0x4dc0, 0x9fcb,
+ 0x4dc0, 0x9fcc,
0xa000, 0xa48c,
0xa490, 0xa4c6,
0xa4d0, 0xa62b,
@@ -12155,9 +15694,9 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0xa6a0, 0xa6ef,
0xa6f2, 0xa6f7,
0xa700, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa801,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa824,
@@ -12191,7 +15730,8 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0xaab9, 0xaabd,
0xaac0, 0xaac0,
0xaac2, 0xaac2,
- 0xaadb, 0xaadf,
+ 0xaadb, 0xaaeb,
+ 0xaaee, 0xaaf5,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -12204,8 +15744,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -12267,6 +15806,8 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x10900, 0x1091b,
0x1091f, 0x10939,
0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a00,
0x10a10, 0x10a13,
0x10a15, 0x10a17,
@@ -12288,11 +15829,27 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x110b7, 0x110b8,
0x110bb, 0x110bc,
0x110be, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11103, 0x11126,
+ 0x1112c, 0x1112c,
+ 0x11136, 0x11143,
+ 0x11182, 0x111b5,
+ 0x111bf, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116aa,
+ 0x116ac, 0x116ac,
+ 0x116ae, 0x116af,
+ 0x116b6, 0x116b6,
+ 0x116c0, 0x116c9,
0x12000, 0x1236e,
0x12400, 0x12462,
0x12470, 0x12473,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f93, 0x16f9f,
0x1b000, 0x1b001,
0x1d000, 0x1d0f5,
0x1d100, 0x1d126,
@@ -12327,6 +15884,40 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1d552, 0x1d6a5,
0x1d6a8, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
@@ -12335,7 +15926,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1f0d1, 0x1f0df,
0x1f100, 0x1f10a,
0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
+ 0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
0x1f1e6, 0x1f202,
0x1f210, 0x1f23a,
@@ -12353,19 +15944,9 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1f442, 0x1f4f7,
0x1f4f9, 0x1f4fc,
0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
+ 0x1f5fb, 0x1f640,
0x1f645, 0x1f64f,
0x1f680, 0x1f6c5,
0x1f700, 0x1f773,
@@ -12377,7 +15958,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
/* 'Grapheme_Link': Derived Property */
static const OnigCodePoint CR_Grapheme_Link[] = {
- 29,
+ 33,
0x094d, 0x094d,
0x09cd, 0x09cd,
0x0a4d, 0x0a4d,
@@ -12396,22 +15977,26 @@ static const OnigCodePoint CR_Grapheme_Link[] = {
0x17d2, 0x17d2,
0x1a60, 0x1a60,
0x1b44, 0x1b44,
- 0x1baa, 0x1baa,
+ 0x1baa, 0x1bab,
0x1bf2, 0x1bf3,
0x2d7f, 0x2d7f,
0xa806, 0xa806,
0xa8c4, 0xa8c4,
0xa953, 0xa953,
0xa9c0, 0xa9c0,
+ 0xaaf6, 0xaaf6,
0xabed, 0xabed,
0x10a3f, 0x10a3f,
0x11046, 0x11046,
0x110b9, 0x110b9,
+ 0x11133, 0x11134,
+ 0x111c0, 0x111c0,
+ 0x116b6, 0x116b6,
}; /* CR_Grapheme_Link */
/* 'Common': Script */
static const OnigCodePoint CR_Common[] = {
- 169,
+ 157,
0x0000, 0x0040,
0x005b, 0x0060,
0x007b, 0x00a9,
@@ -12434,7 +16019,6 @@ static const OnigCodePoint CR_Common[] = {
0x0660, 0x0669,
0x06dd, 0x06dd,
0x0964, 0x0965,
- 0x0970, 0x0970,
0x0e3f, 0x0e3f,
0x0fd5, 0x0fd8,
0x10fb, 0x10fb,
@@ -12445,7 +16029,8 @@ static const OnigCodePoint CR_Common[] = {
0x1cd3, 0x1cd3,
0x1ce1, 0x1ce1,
0x1ce9, 0x1cec,
- 0x1cee, 0x1cf2,
+ 0x1cee, 0x1cf3,
+ 0x1cf5, 0x1cf6,
0x2000, 0x200b,
0x200e, 0x2064,
0x206a, 0x2070,
@@ -12462,12 +16047,10 @@ static const OnigCodePoint CR_Common[] = {
0x2400, 0x2426,
0x2440, 0x244a,
0x2460, 0x26ff,
- 0x2701, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x27ff,
+ 0x2701, 0x27ff,
0x2900, 0x2b4c,
0x2b50, 0x2b59,
- 0x2e00, 0x2e31,
+ 0x2e00, 0x2e3b,
0x2ff0, 0x2ffb,
0x3000, 0x3004,
0x3006, 0x3006,
@@ -12544,7 +16127,7 @@ static const OnigCodePoint CR_Common[] = {
0x1f0d1, 0x1f0df,
0x1f100, 0x1f10a,
0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
+ 0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
0x1f1e6, 0x1f1ff,
0x1f201, 0x1f202,
@@ -12563,19 +16146,9 @@ static const OnigCodePoint CR_Common[] = {
0x1f442, 0x1f4f7,
0x1f4f9, 0x1f4fc,
0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
+ 0x1f5fb, 0x1f640,
0x1f645, 0x1f64f,
0x1f680, 0x1f6c5,
0x1f700, 0x1f773,
@@ -12610,9 +16183,9 @@ static const OnigCodePoint CR_Latin[] = {
0x2c60, 0x2c7f,
0xa722, 0xa787,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa7ff,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa7ff,
0xfb00, 0xfb06,
0xff21, 0xff3a,
0xff41, 0xff5a,
@@ -12664,17 +16237,18 @@ static const OnigCodePoint CR_Cyrillic[] = {
0x1d2b, 0x1d2b,
0x1d78, 0x1d78,
0x2de0, 0x2dff,
- 0xa640, 0xa673,
- 0xa67c, 0xa697,
+ 0xa640, 0xa697,
+ 0xa69f, 0xa69f,
}; /* CR_Cyrillic */
/* 'Armenian': Script */
static const OnigCodePoint CR_Armenian[] = {
- 5,
+ 6,
0x0531, 0x0556,
0x0559, 0x055f,
0x0561, 0x0587,
0x058a, 0x058a,
+ 0x058f, 0x058f,
0xfb13, 0xfb17,
}; /* CR_Armenian */
@@ -12694,8 +16268,8 @@ static const OnigCodePoint CR_Hebrew[] = {
/* 'Arabic': Script */
static const OnigCodePoint CR_Arabic[] = {
- 19,
- 0x0600, 0x0603,
+ 56,
+ 0x0600, 0x0604,
0x0606, 0x060b,
0x060d, 0x061a,
0x061e, 0x061e,
@@ -12706,6 +16280,9 @@ static const OnigCodePoint CR_Arabic[] = {
0x0671, 0x06dc,
0x06de, 0x06ff,
0x0750, 0x077f,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
0xfb50, 0xfbc1,
0xfbd3, 0xfd3d,
0xfd50, 0xfd8f,
@@ -12714,6 +16291,40 @@ static const OnigCodePoint CR_Arabic[] = {
0xfe70, 0xfe74,
0xfe76, 0xfefc,
0x10e60, 0x10e7e,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
}; /* CR_Arabic */
/* 'Syriac': Script */
@@ -12732,11 +16343,10 @@ static const OnigCodePoint CR_Thaana[] = {
/* 'Devanagari': Script */
static const OnigCodePoint CR_Devanagari[] = {
- 6,
+ 5,
0x0900, 0x0950,
0x0953, 0x0963,
- 0x0966, 0x096f,
- 0x0971, 0x0977,
+ 0x0966, 0x0977,
0x0979, 0x097f,
0xa8e0, 0xa8fb,
}; /* CR_Devanagari */
@@ -12783,7 +16393,7 @@ static const OnigCodePoint CR_Gurmukhi[] = {
/* 'Gujarati': Script */
static const OnigCodePoint CR_Gujarati[] = {
- 14,
+ 13,
0x0a81, 0x0a83,
0x0a85, 0x0a8d,
0x0a8f, 0x0a91,
@@ -12796,8 +16406,7 @@ static const OnigCodePoint CR_Gujarati[] = {
0x0acb, 0x0acd,
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0af1, 0x0af1,
+ 0x0ae6, 0x0af1,
}; /* CR_Gujarati */
/* 'Oriya': Script */
@@ -12937,7 +16546,7 @@ static const OnigCodePoint CR_Lao[] = {
0x0ec6, 0x0ec6,
0x0ec8, 0x0ecd,
0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
}; /* CR_Lao */
/* 'Tibetan': Script */
@@ -12961,11 +16570,15 @@ static const OnigCodePoint CR_Myanmar[] = {
/* 'Georgian': Script */
static const OnigCodePoint CR_Georgian[] = {
- 4,
+ 8,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
+ 0x10fc, 0x10ff,
0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
}; /* CR_Georgian */
/* 'Hangul': Script */
@@ -13102,7 +16715,7 @@ static const OnigCodePoint CR_Bopomofo[] = {
/* 'Han': Script */
static const OnigCodePoint CR_Han[] = {
- 16,
+ 15,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
0x2f00, 0x2fd5,
@@ -13111,9 +16724,8 @@ static const OnigCodePoint CR_Han[] = {
0x3021, 0x3029,
0x3038, 0x303b,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0x4e00, 0x9fcc,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
@@ -13149,7 +16761,7 @@ static const OnigCodePoint CR_Deseret[] = {
/* 'Inherited': Script */
static const OnigCodePoint CR_Inherited[] = {
- 24,
+ 25,
0x0300, 0x036f,
0x0485, 0x0486,
0x064b, 0x0655,
@@ -13160,6 +16772,7 @@ static const OnigCodePoint CR_Inherited[] = {
0x1cd4, 0x1ce0,
0x1ce2, 0x1ce8,
0x1ced, 0x1ced,
+ 0x1cf4, 0x1cf4,
0x1dc0, 0x1de6,
0x1dfc, 0x1dff,
0x200c, 0x200d,
@@ -13280,7 +16893,7 @@ static const OnigCodePoint CR_Buginese[] = {
static const OnigCodePoint CR_Coptic[] = {
3,
0x03e2, 0x03ef,
- 0x2c80, 0x2cf1,
+ 0x2c80, 0x2cf3,
0x2cf9, 0x2cff,
}; /* CR_Coptic */
@@ -13303,7 +16916,7 @@ static const OnigCodePoint CR_Glagolitic[] = {
/* 'Tifinagh': Script */
static const OnigCodePoint CR_Tifinagh[] = {
3,
- 0x2d30, 0x2d65,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d70,
0x2d7f, 0x2d7f,
}; /* CR_Tifinagh */
@@ -13371,8 +16984,8 @@ static const OnigCodePoint CR_Nko[] = {
/* 'Sundanese': Script */
static const OnigCodePoint CR_Sundanese[] = {
2,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
+ 0x1b80, 0x1bbf,
+ 0x1cc0, 0x1cc7,
}; /* CR_Sundanese */
/* 'Lepcha': Script */
@@ -13503,7 +17116,8 @@ static const OnigCodePoint CR_Javanese[] = {
/* 'Meetei_Mayek': Script */
static const OnigCodePoint CR_Meetei_Mayek[] = {
- 2,
+ 3,
+ 0xaae0, 0xaaf6,
0xabc0, 0xabed,
0xabf0, 0xabf9,
}; /* CR_Meetei_Mayek */
@@ -13568,21 +17182,57 @@ static const OnigCodePoint CR_Mandaic[] = {
0x085e, 0x085e,
}; /* CR_Mandaic */
+/* 'Chakma': Script */
+static const OnigCodePoint CR_Chakma[] = {
+ 2,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+}; /* CR_Chakma */
+
+/* 'Meroitic_Cursive': Script */
+static const OnigCodePoint CR_Meroitic_Cursive[] = {
+ 2,
+ 0x109a0, 0x109b7,
+ 0x109be, 0x109bf,
+}; /* CR_Meroitic_Cursive */
+
+/* 'Meroitic_Hieroglyphs': Script */
+static const OnigCodePoint CR_Meroitic_Hieroglyphs[] = {
+ 1,
+ 0x10980, 0x1099f,
+}; /* CR_Meroitic_Hieroglyphs */
+
+/* 'Miao': Script */
+static const OnigCodePoint CR_Miao[] = {
+ 3,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+}; /* CR_Miao */
+
+/* 'Sharada': Script */
+static const OnigCodePoint CR_Sharada[] = {
+ 2,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+}; /* CR_Sharada */
+
+/* 'Sora_Sompeng': Script */
+static const OnigCodePoint CR_Sora_Sompeng[] = {
+ 2,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+}; /* CR_Sora_Sompeng */
+
+/* 'Takri': Script */
+static const OnigCodePoint CR_Takri[] = {
+ 2,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+}; /* CR_Takri */
+
/* 'White_Space': Binary Property */
-static const OnigCodePoint CR_White_Space[] = {
- 11,
- 0x0009, 0x000d,
- 0x0020, 0x0020,
- 0x0085, 0x0085,
- 0x00a0, 0x00a0,
- 0x1680, 0x1680,
- 0x180e, 0x180e,
- 0x2000, 0x200a,
- 0x2028, 0x2029,
- 0x202f, 0x202f,
- 0x205f, 0x205f,
- 0x3000, 0x3000,
-}; /* CR_White_Space */
+#define CR_White_Space CR_Space
/* 'Bidi_Control': Binary Property */
static const OnigCodePoint CR_Bidi_Control[] = {
@@ -13599,7 +17249,7 @@ static const OnigCodePoint CR_Join_Control[] = {
/* 'Dash': Binary Property */
static const OnigCodePoint CR_Dash[] = {
- 19,
+ 20,
0x002d, 0x002d,
0x058a, 0x058a,
0x05be, 0x05be,
@@ -13612,6 +17262,7 @@ static const OnigCodePoint CR_Dash[] = {
0x2212, 0x2212,
0x2e17, 0x2e17,
0x2e1a, 0x2e1a,
+ 0x2e3a, 0x2e3b,
0x301c, 0x301c,
0x3030, 0x3030,
0x30a0, 0x30a0,
@@ -13655,7 +17306,7 @@ static const OnigCodePoint CR_Quotation_Mark[] = {
/* 'Terminal_Punctuation': Binary Property */
static const OnigCodePoint CR_Terminal_Punctuation[] = {
- 67,
+ 70,
0x0021, 0x0021,
0x002c, 0x002c,
0x002e, 0x002e,
@@ -13705,6 +17356,7 @@ static const OnigCodePoint CR_Terminal_Punctuation[] = {
0xa9c7, 0xa9c9,
0xaa5d, 0xaa5f,
0xaadf, 0xaadf,
+ 0xaaf0, 0xaaf1,
0xabeb, 0xabeb,
0xfe50, 0xfe52,
0xfe54, 0xfe57,
@@ -13722,12 +17374,14 @@ static const OnigCodePoint CR_Terminal_Punctuation[] = {
0x10b3a, 0x10b3f,
0x11047, 0x1104d,
0x110be, 0x110c1,
+ 0x11141, 0x11143,
+ 0x111c5, 0x111c6,
0x12470, 0x12473,
}; /* CR_Terminal_Punctuation */
/* 'Other_Math': Binary Property */
static const OnigCodePoint CR_Other_Math[] = {
- 100,
+ 133,
0x005e, 0x005e,
0x03d0, 0x03d2,
0x03d5, 0x03d5,
@@ -13828,6 +17482,39 @@ static const OnigCodePoint CR_Other_Math[] = {
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
}; /* CR_Other_Math */
/* 'Hex_Digit': Binary Property */
@@ -13842,16 +17529,11 @@ static const OnigCodePoint CR_Hex_Digit[] = {
}; /* CR_Hex_Digit */
/* 'ASCII_Hex_Digit': Binary Property */
-static const OnigCodePoint CR_ASCII_Hex_Digit[] = {
- 3,
- 0x0030, 0x0039,
- 0x0041, 0x0046,
- 0x0061, 0x0066,
-}; /* CR_ASCII_Hex_Digit */
+#define CR_ASCII_Hex_Digit CR_XDigit
/* 'Other_Alphabetic': Binary Property */
static const OnigCodePoint CR_Other_Alphabetic[] = {
- 145,
+ 158,
0x0345, 0x0345,
0x05b0, 0x05bd,
0x05bf, 0x05bf,
@@ -13873,6 +17555,8 @@ static const OnigCodePoint CR_Other_Alphabetic[] = {
0x081b, 0x0823,
0x0825, 0x0827,
0x0829, 0x082c,
+ 0x08e4, 0x08e9,
+ 0x08f0, 0x08fe,
0x0900, 0x0903,
0x093a, 0x093b,
0x093e, 0x094c,
@@ -13969,11 +17653,14 @@ static const OnigCodePoint CR_Other_Alphabetic[] = {
0x1b35, 0x1b43,
0x1b80, 0x1b82,
0x1ba1, 0x1ba9,
+ 0x1bac, 0x1bad,
0x1be7, 0x1bf1,
0x1c24, 0x1c35,
- 0x1cf2, 0x1cf2,
+ 0x1cf2, 0x1cf3,
0x24b6, 0x24e9,
0x2de0, 0x2dff,
+ 0xa674, 0xa67b,
+ 0xa69f, 0xa69f,
0xa823, 0xa827,
0xa880, 0xa881,
0xa8b4, 0xa8c3,
@@ -13988,6 +17675,8 @@ static const OnigCodePoint CR_Other_Alphabetic[] = {
0xaab2, 0xaab4,
0xaab7, 0xaab8,
0xaabe, 0xaabe,
+ 0xaaeb, 0xaaef,
+ 0xaaf5, 0xaaf5,
0xabe3, 0xabea,
0xfb1e, 0xfb1e,
0x10a01, 0x10a03,
@@ -13997,18 +17686,23 @@ static const OnigCodePoint CR_Other_Alphabetic[] = {
0x11038, 0x11045,
0x11082, 0x11082,
0x110b0, 0x110b8,
+ 0x11100, 0x11102,
+ 0x11127, 0x11132,
+ 0x11180, 0x11182,
+ 0x111b3, 0x111bf,
+ 0x116ab, 0x116b5,
+ 0x16f51, 0x16f7e,
}; /* CR_Other_Alphabetic */
/* 'Ideographic': Binary Property */
static const OnigCodePoint CR_Ideographic[] = {
- 12,
+ 11,
0x3006, 0x3007,
0x3021, 0x3029,
0x3038, 0x303a,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0x4e00, 0x9fcc,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
@@ -14018,7 +17712,7 @@ static const OnigCodePoint CR_Ideographic[] = {
/* 'Diacritic': Binary Property */
static const OnigCodePoint CR_Diacritic[] = {
- 117,
+ 125,
0x005e, 0x005e,
0x0060, 0x0060,
0x00a8, 0x00a8,
@@ -14047,6 +17741,7 @@ static const OnigCodePoint CR_Diacritic[] = {
0x07a6, 0x07b0,
0x07eb, 0x07f5,
0x0818, 0x0819,
+ 0x08e4, 0x08fe,
0x093c, 0x093c,
0x094d, 0x094d,
0x0951, 0x0954,
@@ -14089,11 +17784,12 @@ static const OnigCodePoint CR_Diacritic[] = {
0x1b34, 0x1b34,
0x1b44, 0x1b44,
0x1b6b, 0x1b73,
- 0x1baa, 0x1baa,
+ 0x1baa, 0x1bab,
0x1c36, 0x1c37,
0x1c78, 0x1c7d,
0x1cd0, 0x1ce8,
0x1ced, 0x1ced,
+ 0x1cf4, 0x1cf4,
0x1d2c, 0x1d6a,
0x1dc4, 0x1dcf,
0x1dfd, 0x1dff,
@@ -14114,6 +17810,7 @@ static const OnigCodePoint CR_Diacritic[] = {
0xa6f0, 0xa6f1,
0xa717, 0xa721,
0xa788, 0xa788,
+ 0xa7f8, 0xa7f9,
0xa8c4, 0xa8c4,
0xa8e0, 0xa8f1,
0xa92b, 0xa92e,
@@ -14122,6 +17819,7 @@ static const OnigCodePoint CR_Diacritic[] = {
0xa9c0, 0xa9c0,
0xaa7b, 0xaa7b,
0xaabf, 0xaac2,
+ 0xaaf6, 0xaaf6,
0xabec, 0xabed,
0xfb1e, 0xfb1e,
0xfe20, 0xfe26,
@@ -14131,6 +17829,10 @@ static const OnigCodePoint CR_Diacritic[] = {
0xff9e, 0xff9f,
0xffe3, 0xffe3,
0x110b9, 0x110ba,
+ 0x11133, 0x11134,
+ 0x111c0, 0x111c0,
+ 0x116b6, 0x116b7,
+ 0x16f8f, 0x16f9f,
0x1d167, 0x1d169,
0x1d16d, 0x1d172,
0x1d17b, 0x1d182,
@@ -14140,13 +17842,14 @@ static const OnigCodePoint CR_Diacritic[] = {
/* 'Extender': Binary Property */
static const OnigCodePoint CR_Extender[] = {
- 20,
+ 22,
0x00b7, 0x00b7,
0x02d0, 0x02d1,
0x0640, 0x0640,
0x07fa, 0x07fa,
0x0e46, 0x0e46,
0x0ec6, 0x0ec6,
+ 0x180a, 0x180a,
0x1843, 0x1843,
0x1aa7, 0x1aa7,
0x1c36, 0x1c36,
@@ -14160,25 +17863,31 @@ static const OnigCodePoint CR_Extender[] = {
0xa9cf, 0xa9cf,
0xaa70, 0xaa70,
0xaadd, 0xaadd,
+ 0xaaf3, 0xaaf4,
0xff70, 0xff70,
}; /* CR_Extender */
/* 'Other_Lowercase': Binary Property */
static const OnigCodePoint CR_Other_Lowercase[] = {
- 13,
+ 18,
+ 0x00aa, 0x00aa,
+ 0x00ba, 0x00ba,
0x02b0, 0x02b8,
0x02c0, 0x02c1,
0x02e0, 0x02e4,
0x0345, 0x0345,
0x037a, 0x037a,
- 0x1d2c, 0x1d61,
+ 0x1d2c, 0x1d6a,
0x1d78, 0x1d78,
0x1d9b, 0x1dbf,
- 0x2090, 0x2094,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
0x2170, 0x217f,
0x24d0, 0x24e9,
- 0x2c7d, 0x2c7d,
+ 0x2c7c, 0x2c7d,
0xa770, 0xa770,
+ 0xa7f8, 0xa7f9,
}; /* CR_Other_Lowercase */
/* 'Other_Uppercase': Binary Property */
@@ -14213,7 +17922,7 @@ static const OnigCodePoint CR_Noncharacter_Code_Point[] = {
/* 'Other_Grapheme_Extend': Binary Property */
static const OnigCodePoint CR_Other_Grapheme_Extend[] = {
- 16,
+ 17,
0x09be, 0x09be,
0x09d7, 0x09d7,
0x0b3e, 0x0b3e,
@@ -14227,6 +17936,7 @@ static const OnigCodePoint CR_Other_Grapheme_Extend[] = {
0x0dcf, 0x0dcf,
0x0ddf, 0x0ddf,
0x200c, 0x200d,
+ 0x302e, 0x302f,
0xff9e, 0xff9f,
0x1d165, 0x1d165,
0x1d16e, 0x1d172,
@@ -14257,7 +17967,7 @@ static const OnigCodePoint CR_Radical[] = {
static const OnigCodePoint CR_Unified_Ideograph[] = {
12,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xfa0e, 0xfa0f,
0xfa11, 0xfa11,
0xfa13, 0xfa14,
@@ -14272,9 +17982,10 @@ static const OnigCodePoint CR_Unified_Ideograph[] = {
/* 'Other_Default_Ignorable_Code_Point': Binary Property */
static const OnigCodePoint CR_Other_Default_Ignorable_Code_Point[] = {
- 10,
+ 11,
0x034f, 0x034f,
0x115f, 0x1160,
+ 0x17b4, 0x17b5,
0x2065, 0x2069,
0x3164, 0x3164,
0xffa0, 0xffa0,
@@ -14364,7 +18075,7 @@ static const OnigCodePoint CR_Other_ID_Continue[] = {
/* 'STerm': Binary Property */
static const OnigCodePoint CR_STerm[] = {
- 47,
+ 50,
0x0021, 0x0021,
0x002e, 0x002e,
0x003f, 0x003f,
@@ -14402,6 +18113,7 @@ static const OnigCodePoint CR_STerm[] = {
0xa92f, 0xa92f,
0xa9c8, 0xa9c9,
0xaa5d, 0xaa5f,
+ 0xaaf0, 0xaaf1,
0xabeb, 0xabeb,
0xfe52, 0xfe52,
0xfe56, 0xfe57,
@@ -14412,6 +18124,8 @@ static const OnigCodePoint CR_STerm[] = {
0x10a56, 0x10a57,
0x11047, 0x11048,
0x110be, 0x110c1,
+ 0x11141, 0x11143,
+ 0x111c5, 0x111c6,
}; /* CR_STerm */
/* 'Variation_Selector': Binary Property */
@@ -14467,7 +18181,7 @@ static const OnigCodePoint CR_Pattern_Syntax[] = {
/* 'Unknown': Script */
static const OnigCodePoint CR_Unknown[] = {
- 499,
+ 537,
0x0378, 0x0379,
0x037f, 0x0383,
0x038b, 0x038b,
@@ -14477,11 +18191,12 @@ static const OnigCodePoint CR_Unknown[] = {
0x0557, 0x0558,
0x0560, 0x0560,
0x0588, 0x0588,
- 0x058b, 0x0590,
+ 0x058b, 0x058e,
+ 0x0590, 0x0590,
0x05c8, 0x05cf,
0x05eb, 0x05ef,
0x05f5, 0x05ff,
- 0x0604, 0x0605,
+ 0x0605, 0x0605,
0x061c, 0x061d,
0x070e, 0x070e,
0x074b, 0x074c,
@@ -14490,7 +18205,10 @@ static const OnigCodePoint CR_Unknown[] = {
0x082e, 0x082f,
0x083f, 0x083f,
0x085c, 0x085d,
- 0x085f, 0x08ff,
+ 0x085f, 0x089f,
+ 0x08a1, 0x08a1,
+ 0x08ad, 0x08e3,
+ 0x08ff, 0x08ff,
0x0978, 0x0978,
0x0980, 0x0980,
0x0984, 0x0984,
@@ -14535,7 +18253,6 @@ static const OnigCodePoint CR_Unknown[] = {
0x0ace, 0x0acf,
0x0ad1, 0x0adf,
0x0ae4, 0x0ae5,
- 0x0af0, 0x0af0,
0x0af2, 0x0b00,
0x0b04, 0x0b04,
0x0b0d, 0x0b0e,
@@ -14636,15 +18353,16 @@ static const OnigCodePoint CR_Unknown[] = {
0x0ec7, 0x0ec7,
0x0ece, 0x0ecf,
0x0eda, 0x0edb,
- 0x0ede, 0x0eff,
+ 0x0ee0, 0x0eff,
0x0f48, 0x0f48,
0x0f6d, 0x0f70,
0x0f98, 0x0f98,
0x0fbd, 0x0fbd,
0x0fcd, 0x0fcd,
0x0fdb, 0x0fff,
- 0x10c6, 0x10cf,
- 0x10fd, 0x10ff,
+ 0x10c6, 0x10c6,
+ 0x10c8, 0x10cc,
+ 0x10ce, 0x10cf,
0x1249, 0x1249,
0x124e, 0x124f,
0x1257, 0x1257,
@@ -14698,13 +18416,12 @@ static const OnigCodePoint CR_Unknown[] = {
0x1aae, 0x1aff,
0x1b4c, 0x1b4f,
0x1b7d, 0x1b7f,
- 0x1bab, 0x1bad,
- 0x1bba, 0x1bbf,
0x1bf4, 0x1bfb,
0x1c38, 0x1c3a,
0x1c4a, 0x1c4c,
- 0x1c80, 0x1ccf,
- 0x1cf3, 0x1cff,
+ 0x1c80, 0x1cbf,
+ 0x1cc8, 0x1ccf,
+ 0x1cf7, 0x1cff,
0x1de7, 0x1dfb,
0x1f16, 0x1f17,
0x1f1e, 0x1f1f,
@@ -14733,15 +18450,15 @@ static const OnigCodePoint CR_Unknown[] = {
0x2427, 0x243f,
0x244b, 0x245f,
0x2700, 0x2700,
- 0x27cb, 0x27cb,
- 0x27cd, 0x27cd,
0x2b4d, 0x2b4f,
0x2b5a, 0x2bff,
0x2c2f, 0x2c2f,
0x2c5f, 0x2c5f,
- 0x2cf2, 0x2cf8,
- 0x2d26, 0x2d2f,
- 0x2d66, 0x2d6e,
+ 0x2cf4, 0x2cf8,
+ 0x2d26, 0x2d26,
+ 0x2d28, 0x2d2c,
+ 0x2d2e, 0x2d2f,
+ 0x2d68, 0x2d6e,
0x2d71, 0x2d7e,
0x2d97, 0x2d9f,
0x2da7, 0x2da7,
@@ -14752,7 +18469,7 @@ static const OnigCodePoint CR_Unknown[] = {
0x2dcf, 0x2dcf,
0x2dd7, 0x2dd7,
0x2ddf, 0x2ddf,
- 0x2e32, 0x2e7f,
+ 0x2e3c, 0x2e7f,
0x2e9a, 0x2e9a,
0x2ef4, 0x2eff,
0x2fd6, 0x2fef,
@@ -14767,16 +18484,15 @@ static const OnigCodePoint CR_Unknown[] = {
0x321f, 0x321f,
0x32ff, 0x32ff,
0x4db6, 0x4dbf,
- 0x9fcc, 0x9fff,
+ 0x9fcd, 0x9fff,
0xa48d, 0xa48f,
0xa4c7, 0xa4cf,
0xa62c, 0xa63f,
- 0xa674, 0xa67b,
- 0xa698, 0xa69f,
+ 0xa698, 0xa69e,
0xa6f8, 0xa6ff,
0xa78f, 0xa78f,
- 0xa792, 0xa79f,
- 0xa7aa, 0xa7f9,
+ 0xa794, 0xa79f,
+ 0xa7ab, 0xa7f7,
0xa82c, 0xa82f,
0xa83a, 0xa83f,
0xa878, 0xa87f,
@@ -14793,7 +18509,7 @@ static const OnigCodePoint CR_Unknown[] = {
0xaa5a, 0xaa5b,
0xaa7c, 0xaa7f,
0xaac3, 0xaada,
- 0xaae0, 0xab00,
+ 0xaaf7, 0xab00,
0xab07, 0xab08,
0xab0f, 0xab10,
0xab17, 0xab1f,
@@ -14804,7 +18520,6 @@ static const OnigCodePoint CR_Unknown[] = {
0xd7a4, 0xd7af,
0xd7c7, 0xd7ca,
0xd7fc, 0xf8ff,
- 0xfa2e, 0xfa2f,
0xfa6e, 0xfa6f,
0xfada, 0xfaff,
0xfb07, 0xfb12,
@@ -14866,7 +18581,9 @@ static const OnigCodePoint CR_Unknown[] = {
0x10860, 0x108ff,
0x1091c, 0x1091e,
0x1093a, 0x1093e,
- 0x10940, 0x109ff,
+ 0x10940, 0x1097f,
+ 0x109b8, 0x109bd,
+ 0x109c0, 0x109ff,
0x10a04, 0x10a04,
0x10a07, 0x10a0b,
0x10a14, 0x10a14,
@@ -14884,12 +18601,23 @@ static const OnigCodePoint CR_Unknown[] = {
0x10e7f, 0x10fff,
0x1104e, 0x11051,
0x11070, 0x1107f,
- 0x110c2, 0x11fff,
+ 0x110c2, 0x110cf,
+ 0x110e9, 0x110ef,
+ 0x110fa, 0x110ff,
+ 0x11135, 0x11135,
+ 0x11144, 0x1117f,
+ 0x111c9, 0x111cf,
+ 0x111da, 0x1167f,
+ 0x116b8, 0x116bf,
+ 0x116ca, 0x11fff,
0x1236f, 0x123ff,
0x12463, 0x1246f,
0x12474, 0x12fff,
0x1342f, 0x167ff,
- 0x16a39, 0x1afff,
+ 0x16a39, 0x16eff,
+ 0x16f45, 0x16f4f,
+ 0x16f7f, 0x16f8e,
+ 0x16fa0, 0x1afff,
0x1b002, 0x1cfff,
0x1d0f6, 0x1d0ff,
0x1d127, 0x1d128,
@@ -14917,7 +18645,41 @@ static const OnigCodePoint CR_Unknown[] = {
0x1d551, 0x1d551,
0x1d6a6, 0x1d6a7,
0x1d7cc, 0x1d7cd,
- 0x1d800, 0x1efff,
+ 0x1d800, 0x1edff,
+ 0x1ee04, 0x1ee04,
+ 0x1ee20, 0x1ee20,
+ 0x1ee23, 0x1ee23,
+ 0x1ee25, 0x1ee26,
+ 0x1ee28, 0x1ee28,
+ 0x1ee33, 0x1ee33,
+ 0x1ee38, 0x1ee38,
+ 0x1ee3a, 0x1ee3a,
+ 0x1ee3c, 0x1ee41,
+ 0x1ee43, 0x1ee46,
+ 0x1ee48, 0x1ee48,
+ 0x1ee4a, 0x1ee4a,
+ 0x1ee4c, 0x1ee4c,
+ 0x1ee50, 0x1ee50,
+ 0x1ee53, 0x1ee53,
+ 0x1ee55, 0x1ee56,
+ 0x1ee58, 0x1ee58,
+ 0x1ee5a, 0x1ee5a,
+ 0x1ee5c, 0x1ee5c,
+ 0x1ee5e, 0x1ee5e,
+ 0x1ee60, 0x1ee60,
+ 0x1ee63, 0x1ee63,
+ 0x1ee65, 0x1ee66,
+ 0x1ee6b, 0x1ee6b,
+ 0x1ee73, 0x1ee73,
+ 0x1ee78, 0x1ee78,
+ 0x1ee7d, 0x1ee7d,
+ 0x1ee7f, 0x1ee7f,
+ 0x1ee8a, 0x1ee8a,
+ 0x1ee9c, 0x1eea0,
+ 0x1eea4, 0x1eea4,
+ 0x1eeaa, 0x1eeaa,
+ 0x1eebc, 0x1eeef,
+ 0x1eef2, 0x1efff,
0x1f02c, 0x1f02f,
0x1f094, 0x1f09f,
0x1f0af, 0x1f0b0,
@@ -14926,7 +18688,7 @@ static const OnigCodePoint CR_Unknown[] = {
0x1f0e0, 0x1f0ff,
0x1f10b, 0x1f10f,
0x1f12f, 0x1f12f,
- 0x1f16a, 0x1f16f,
+ 0x1f16c, 0x1f16f,
0x1f19b, 0x1f1e5,
0x1f203, 0x1f20f,
0x1f23b, 0x1f23f,
@@ -14943,19 +18705,9 @@ static const OnigCodePoint CR_Unknown[] = {
0x1f441, 0x1f441,
0x1f4f8, 0x1f4f8,
0x1f4fd, 0x1f4ff,
- 0x1f53e, 0x1f54f,
+ 0x1f53e, 0x1f53f,
+ 0x1f544, 0x1f54f,
0x1f568, 0x1f5fa,
- 0x1f600, 0x1f600,
- 0x1f611, 0x1f611,
- 0x1f615, 0x1f615,
- 0x1f617, 0x1f617,
- 0x1f619, 0x1f619,
- 0x1f61b, 0x1f61b,
- 0x1f61f, 0x1f61f,
- 0x1f626, 0x1f627,
- 0x1f62c, 0x1f62c,
- 0x1f62e, 0x1f62f,
- 0x1f634, 0x1f634,
0x1f641, 0x1f644,
0x1f650, 0x1f67f,
0x1f6c6, 0x1f6ff,
@@ -14968,8 +18720,6 @@ static const OnigCodePoint CR_Unknown[] = {
0xe0080, 0xe00ff,
0xe01f0, 0x10ffff,
}; /* CR_Unknown */
-#endif /* USE_UNICODE_PROPERTIES */
-#endif /* USE_UNICODE_PROPERTIES */
/* 'Age_1_1': Derived Age 1.1 */
static const OnigCodePoint CR_Age_1_1[] = {
@@ -19854,554 +23604,10 @@ static const OnigCodePoint CR_Age_6_0[] = {
0xefffe, 0x10ffff,
}; /* CR_Age_6_0 */
-/* 'NEWLINE': [[:NEWLINE:]] */
-static const OnigCodePoint CR_NEWLINE[] = {
- 1,
- 0x000a, 0x000a,
-}; /* CR_NEWLINE */
-
-/* 'Alpha': [[:Alpha:]] */
-#define CR_Alpha CR_Alphabetic
-
-/* 'Blank': [[:Blank:]] */
-static const OnigCodePoint CR_Blank[] = {
- 9,
- 0x0009, 0x0009,
- 0x0020, 0x0020,
- 0x00a0, 0x00a0,
- 0x1680, 0x1680,
- 0x180e, 0x180e,
- 0x2000, 0x200a,
- 0x202f, 0x202f,
- 0x205f, 0x205f,
- 0x3000, 0x3000,
-}; /* CR_Blank */
-
-/* 'Cntrl': [[:Cntrl:]] */
-#define CR_Cntrl CR_Cc
-
-/* 'Digit': [[:Digit:]] */
-#define CR_Digit CR_Nd
-
-/* 'Graph': [[:Graph:]] */
-static const OnigCodePoint CR_Graph[] = {
- 506,
- 0x0021, 0x007e,
- 0x00a1, 0x0377,
- 0x037a, 0x037e,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x0527,
- 0x0531, 0x0556,
- 0x0559, 0x055f,
- 0x0561, 0x0587,
- 0x0589, 0x058a,
- 0x0591, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f4,
- 0x0600, 0x0603,
- 0x0606, 0x061b,
- 0x061e, 0x070d,
- 0x070f, 0x074a,
- 0x074d, 0x07b1,
- 0x07c0, 0x07fa,
- 0x0800, 0x082d,
- 0x0830, 0x083e,
- 0x0840, 0x085b,
- 0x085e, 0x085e,
- 0x0900, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bc, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09ce,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09e6, 0x09fb,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3c, 0x0a3c,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a51, 0x0a51,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a75,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abc, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acd,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0af1, 0x0af1,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3c, 0x0b44,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4d,
- 0x0b56, 0x0b57,
- 0x0b5c, 0x0b5d,
- 0x0b5f, 0x0b63,
- 0x0b66, 0x0b77,
- 0x0b82, 0x0b83,
- 0x0b85, 0x0b8a,
- 0x0b8e, 0x0b90,
- 0x0b92, 0x0b95,
- 0x0b99, 0x0b9a,
- 0x0b9c, 0x0b9c,
- 0x0b9e, 0x0b9f,
- 0x0ba3, 0x0ba4,
- 0x0ba8, 0x0baa,
- 0x0bae, 0x0bb9,
- 0x0bbe, 0x0bc2,
- 0x0bc6, 0x0bc8,
- 0x0bca, 0x0bcd,
- 0x0bd0, 0x0bd0,
- 0x0bd7, 0x0bd7,
- 0x0be6, 0x0bfa,
- 0x0c01, 0x0c03,
- 0x0c05, 0x0c0c,
- 0x0c0e, 0x0c10,
- 0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
- 0x0c3d, 0x0c44,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4d,
- 0x0c55, 0x0c56,
- 0x0c58, 0x0c59,
- 0x0c60, 0x0c63,
- 0x0c66, 0x0c6f,
- 0x0c78, 0x0c7f,
- 0x0c82, 0x0c83,
- 0x0c85, 0x0c8c,
- 0x0c8e, 0x0c90,
- 0x0c92, 0x0ca8,
- 0x0caa, 0x0cb3,
- 0x0cb5, 0x0cb9,
- 0x0cbc, 0x0cc4,
- 0x0cc6, 0x0cc8,
- 0x0cca, 0x0ccd,
- 0x0cd5, 0x0cd6,
- 0x0cde, 0x0cde,
- 0x0ce0, 0x0ce3,
- 0x0ce6, 0x0cef,
- 0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d3a,
- 0x0d3d, 0x0d44,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4e,
- 0x0d57, 0x0d57,
- 0x0d60, 0x0d63,
- 0x0d66, 0x0d75,
- 0x0d79, 0x0d7f,
- 0x0d82, 0x0d83,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0dca, 0x0dca,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df4,
- 0x0e01, 0x0e3a,
- 0x0e3f, 0x0e5b,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ec8, 0x0ecd,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f71, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fbe, 0x0fcc,
- 0x0fce, 0x0fda,
- 0x1000, 0x10c5,
- 0x10d0, 0x10fc,
- 0x1100, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135d, 0x137c,
- 0x1380, 0x1399,
- 0x13a0, 0x13f4,
- 0x1400, 0x167f,
- 0x1681, 0x169c,
- 0x16a0, 0x16f0,
- 0x1700, 0x170c,
- 0x170e, 0x1714,
- 0x1720, 0x1736,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17dd,
- 0x17e0, 0x17e9,
- 0x17f0, 0x17f9,
- 0x1800, 0x180d,
- 0x1810, 0x1819,
- 0x1820, 0x1877,
- 0x1880, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191c,
- 0x1920, 0x192b,
- 0x1930, 0x193b,
- 0x1940, 0x1940,
- 0x1944, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x19d0, 0x19da,
- 0x19de, 0x1a1b,
- 0x1a1e, 0x1a5e,
- 0x1a60, 0x1a7c,
- 0x1a7f, 0x1a89,
- 0x1a90, 0x1a99,
- 0x1aa0, 0x1aad,
- 0x1b00, 0x1b4b,
- 0x1b50, 0x1b7c,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1bf3,
- 0x1bfc, 0x1c37,
- 0x1c3b, 0x1c49,
- 0x1c4d, 0x1c7f,
- 0x1cd0, 0x1cf2,
- 0x1d00, 0x1de6,
- 0x1dfc, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fc4,
- 0x1fc6, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fdd, 0x1fef,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffe,
- 0x200b, 0x2027,
- 0x202a, 0x202e,
- 0x2030, 0x205e,
- 0x2060, 0x2064,
- 0x206a, 0x2071,
- 0x2074, 0x208e,
- 0x2090, 0x209c,
- 0x20a0, 0x20b9,
- 0x20d0, 0x20f0,
- 0x2100, 0x2189,
- 0x2190, 0x23f3,
- 0x2400, 0x2426,
- 0x2440, 0x244a,
- 0x2460, 0x26ff,
- 0x2701, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x2b4c,
- 0x2b50, 0x2b59,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2cf1,
- 0x2cf9, 0x2d25,
- 0x2d30, 0x2d65,
- 0x2d6f, 0x2d70,
- 0x2d7f, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2de0, 0x2e31,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3001, 0x303f,
- 0x3041, 0x3096,
- 0x3099, 0x30ff,
- 0x3105, 0x312d,
- 0x3131, 0x318e,
- 0x3190, 0x31ba,
- 0x31c0, 0x31e3,
- 0x31f0, 0x321e,
- 0x3220, 0x32fe,
- 0x3300, 0x4db5,
- 0x4dc0, 0x9fcb,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa4d0, 0xa62b,
- 0xa640, 0xa673,
- 0xa67c, 0xa697,
- 0xa6a0, 0xa6f7,
- 0xa700, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa82b,
- 0xa830, 0xa839,
- 0xa840, 0xa877,
- 0xa880, 0xa8c4,
- 0xa8ce, 0xa8d9,
- 0xa8e0, 0xa8fb,
- 0xa900, 0xa953,
- 0xa95f, 0xa97c,
- 0xa980, 0xa9cd,
- 0xa9cf, 0xa9d9,
- 0xa9de, 0xa9df,
- 0xaa00, 0xaa36,
- 0xaa40, 0xaa4d,
- 0xaa50, 0xaa59,
- 0xaa5c, 0xaa7b,
- 0xaa80, 0xaac2,
- 0xaadb, 0xaadf,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xabc0, 0xabed,
- 0xabf0, 0xabf9,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xe000, 0xfa2d,
- 0xfa30, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbc1,
- 0xfbd3, 0xfd3f,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfd,
- 0xfe00, 0xfe19,
- 0xfe20, 0xfe26,
- 0xfe30, 0xfe52,
- 0xfe54, 0xfe66,
- 0xfe68, 0xfe6b,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xfeff, 0xfeff,
- 0xff01, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0xffe0, 0xffe6,
- 0xffe8, 0xffee,
- 0xfff9, 0xfffd,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10100, 0x10102,
- 0x10107, 0x10133,
- 0x10137, 0x1018a,
- 0x10190, 0x1019b,
- 0x101d0, 0x101fd,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x10300, 0x1031e,
- 0x10320, 0x10323,
- 0x10330, 0x1034a,
- 0x10380, 0x1039d,
- 0x1039f, 0x103c3,
- 0x103c8, 0x103d5,
- 0x10400, 0x1049d,
- 0x104a0, 0x104a9,
- 0x10800, 0x10805,
- 0x10808, 0x10808,
- 0x1080a, 0x10835,
- 0x10837, 0x10838,
- 0x1083c, 0x1083c,
- 0x1083f, 0x10855,
- 0x10857, 0x1085f,
- 0x10900, 0x1091b,
- 0x1091f, 0x10939,
- 0x1093f, 0x1093f,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a47,
- 0x10a50, 0x10a58,
- 0x10a60, 0x10a7f,
- 0x10b00, 0x10b35,
- 0x10b39, 0x10b55,
- 0x10b58, 0x10b72,
- 0x10b78, 0x10b7f,
- 0x10c00, 0x10c48,
- 0x10e60, 0x10e7e,
- 0x11000, 0x1104d,
- 0x11052, 0x1106f,
- 0x11080, 0x110c1,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x12470, 0x12473,
- 0x13000, 0x1342e,
- 0x16800, 0x16a38,
- 0x1b000, 0x1b001,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d129, 0x1d1dd,
- 0x1d200, 0x1d245,
- 0x1d300, 0x1d356,
- 0x1d360, 0x1d371,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d7cb,
- 0x1d7ce, 0x1d7ff,
- 0x1f000, 0x1f02b,
- 0x1f030, 0x1f093,
- 0x1f0a0, 0x1f0ae,
- 0x1f0b1, 0x1f0be,
- 0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0df,
- 0x1f100, 0x1f10a,
- 0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
- 0x1f170, 0x1f19a,
- 0x1f1e6, 0x1f202,
- 0x1f210, 0x1f23a,
- 0x1f240, 0x1f248,
- 0x1f250, 0x1f251,
- 0x1f300, 0x1f320,
- 0x1f330, 0x1f335,
- 0x1f337, 0x1f37c,
- 0x1f380, 0x1f393,
- 0x1f3a0, 0x1f3c4,
- 0x1f3c6, 0x1f3ca,
- 0x1f3e0, 0x1f3f0,
- 0x1f400, 0x1f43e,
- 0x1f440, 0x1f440,
- 0x1f442, 0x1f4f7,
- 0x1f4f9, 0x1f4fc,
- 0x1f500, 0x1f53d,
- 0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
- 0x1f645, 0x1f64f,
- 0x1f680, 0x1f6c5,
- 0x1f700, 0x1f773,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2f800, 0x2fa1d,
- 0xe0001, 0xe0001,
- 0xe0020, 0xe007f,
- 0xe0100, 0xe01ef,
- 0xf0000, 0xffffd,
- 0x100000, 0x10fffd,
-}; /* CR_Graph */
-
-/* 'Lower': [[:Lower:]] */
-#define CR_Lower CR_Lowercase
-
-/* 'Print': [[:Print:]] */
-static const OnigCodePoint CR_Print[] = {
- 503,
- 0x0020, 0x007e,
- 0x00a0, 0x0377,
+/* 'Age_6_1': Derived Age 6.1 */
+static const OnigCodePoint CR_Age_6_1[] = {
+ 549,
+ 0x0000, 0x0377,
0x037a, 0x037e,
0x0384, 0x038a,
0x038c, 0x038c,
@@ -20411,10 +23617,11 @@ static const OnigCodePoint CR_Print[] = {
0x0559, 0x055f,
0x0561, 0x0587,
0x0589, 0x058a,
+ 0x058f, 0x058f,
0x0591, 0x05c7,
0x05d0, 0x05ea,
0x05f0, 0x05f4,
- 0x0600, 0x0603,
+ 0x0600, 0x0604,
0x0606, 0x061b,
0x061e, 0x070d,
0x070f, 0x074a,
@@ -20424,6 +23631,9 @@ static const OnigCodePoint CR_Print[] = {
0x0830, 0x083e,
0x0840, 0x085b,
0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
0x0900, 0x0977,
0x0979, 0x097f,
0x0981, 0x0983,
@@ -20468,8 +23678,7 @@ static const OnigCodePoint CR_Print[] = {
0x0acb, 0x0acd,
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0af1, 0x0af1,
+ 0x0ae6, 0x0af1,
0x0b01, 0x0b03,
0x0b05, 0x0b0c,
0x0b0f, 0x0b10,
@@ -20569,7 +23778,7 @@ static const OnigCodePoint CR_Print[] = {
0x0ec6, 0x0ec6,
0x0ec8, 0x0ecd,
0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f47,
0x0f49, 0x0f6c,
0x0f71, 0x0f97,
@@ -20577,8 +23786,9 @@ static const OnigCodePoint CR_Print[] = {
0x0fbe, 0x0fcc,
0x0fce, 0x0fda,
0x1000, 0x10c5,
- 0x10d0, 0x10fc,
- 0x1100, 0x1248,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -20631,13 +23841,12 @@ static const OnigCodePoint CR_Print[] = {
0x1aa0, 0x1aad,
0x1b00, 0x1b4b,
0x1b50, 0x1b7c,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1bf3,
+ 0x1b80, 0x1bf3,
0x1bfc, 0x1c37,
0x1c3b, 0x1c49,
0x1c4d, 0x1c7f,
- 0x1cd0, 0x1cf2,
+ 0x1cc0, 0x1cc7,
+ 0x1cd0, 0x1cf6,
0x1d00, 0x1de6,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
@@ -20655,8 +23864,7 @@ static const OnigCodePoint CR_Print[] = {
0x1fdd, 0x1fef,
0x1ff2, 0x1ff4,
0x1ff6, 0x1ffe,
- 0x2000, 0x2027,
- 0x202a, 0x2064,
+ 0x2000, 0x2064,
0x206a, 0x2071,
0x2074, 0x208e,
0x2090, 0x209c,
@@ -20667,15 +23875,15 @@ static const OnigCodePoint CR_Print[] = {
0x2400, 0x2426,
0x2440, 0x244a,
0x2460, 0x26ff,
- 0x2701, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x2b4c,
+ 0x2701, 0x2b4c,
0x2b50, 0x2b59,
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
- 0x2c60, 0x2cf1,
+ 0x2c60, 0x2cf3,
0x2cf9, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d70,
0x2d7f, 0x2d96,
0x2da0, 0x2da6,
@@ -20686,7 +23894,7 @@ static const OnigCodePoint CR_Print[] = {
0x2dc8, 0x2dce,
0x2dd0, 0x2dd6,
0x2dd8, 0x2dde,
- 0x2de0, 0x2e31,
+ 0x2de0, 0x2e3b,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
0x2f00, 0x2fd5,
@@ -20701,17 +23909,16 @@ static const OnigCodePoint CR_Print[] = {
0x31f0, 0x321e,
0x3220, 0x32fe,
0x3300, 0x4db5,
- 0x4dc0, 0x9fcb,
+ 0x4dc0, 0x9fcc,
0xa000, 0xa48c,
0xa490, 0xa4c6,
0xa4d0, 0xa62b,
- 0xa640, 0xa673,
- 0xa67c, 0xa697,
- 0xa6a0, 0xa6f7,
+ 0xa640, 0xa697,
+ 0xa69f, 0xa6f7,
0xa700, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa82b,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa82b,
0xa830, 0xa839,
0xa840, 0xa877,
0xa880, 0xa8c4,
@@ -20727,7 +23934,7 @@ static const OnigCodePoint CR_Print[] = {
0xaa50, 0xaa59,
0xaa5c, 0xaa7b,
0xaa80, 0xaac2,
- 0xaadb, 0xaadf,
+ 0xaadb, 0xaaf6,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -20738,8 +23945,7 @@ static const OnigCodePoint CR_Print[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xe000, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xd800, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -20752,7 +23958,7 @@ static const OnigCodePoint CR_Print[] = {
0xfbd3, 0xfd3f,
0xfd50, 0xfd8f,
0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfd,
+ 0xfdd0, 0xfdfd,
0xfe00, 0xfe19,
0xfe20, 0xfe26,
0xfe30, 0xfe52,
@@ -20768,8 +23974,7 @@ static const OnigCodePoint CR_Print[] = {
0xffda, 0xffdc,
0xffe0, 0xffe6,
0xffe8, 0xffee,
- 0xfff9, 0xfffd,
- 0x10000, 0x1000b,
+ 0xfff9, 0x1000b,
0x1000d, 0x10026,
0x10028, 0x1003a,
0x1003c, 0x1003d,
@@ -20801,6 +24006,8 @@ static const OnigCodePoint CR_Print[] = {
0x10900, 0x1091b,
0x1091f, 0x10939,
0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a13,
@@ -20819,11 +24026,22 @@ static const OnigCodePoint CR_Print[] = {
0x11000, 0x1104d,
0x11052, 0x1106f,
0x11080, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
0x12000, 0x1236e,
0x12400, 0x12462,
0x12470, 0x12473,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
0x1d000, 0x1d0f5,
0x1d100, 0x1d126,
@@ -20852,6 +24070,40 @@ static const OnigCodePoint CR_Print[] = {
0x1d552, 0x1d6a5,
0x1d6a8, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
@@ -20860,7 +24112,7 @@ static const OnigCodePoint CR_Print[] = {
0x1f0d1, 0x1f0df,
0x1f100, 0x1f10a,
0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
+ 0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
0x1f1e6, 0x1f202,
0x1f210, 0x1f23a,
@@ -20878,1083 +24130,1368 @@ static const OnigCodePoint CR_Print[] = {
0x1f442, 0x1f4f7,
0x1f4f9, 0x1f4fc,
0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
+ 0x1f5fb, 0x1f640,
0x1f645, 0x1f64f,
0x1f680, 0x1f6c5,
0x1f700, 0x1f773,
- 0x20000, 0x2a6d6,
+ 0x1fffe, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
0x2f800, 0x2fa1d,
+ 0x2fffe, 0x2ffff,
+ 0x3fffe, 0x3ffff,
+ 0x4fffe, 0x4ffff,
+ 0x5fffe, 0x5ffff,
+ 0x6fffe, 0x6ffff,
+ 0x7fffe, 0x7ffff,
+ 0x8fffe, 0x8ffff,
+ 0x9fffe, 0x9ffff,
+ 0xafffe, 0xaffff,
+ 0xbfffe, 0xbffff,
+ 0xcfffe, 0xcffff,
+ 0xdfffe, 0xdffff,
0xe0001, 0xe0001,
0xe0020, 0xe007f,
0xe0100, 0xe01ef,
- 0xf0000, 0xffffd,
- 0x100000, 0x10fffd,
-}; /* CR_Print */
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_6_1 */
-/* 'Punct': [[:Punct:]] */
-#define CR_Punct CR_P
+/* 'In_Basic_Latin': Block */
+#define CR_In_Basic_Latin CR_ASCII
-/* 'Space': [[:Space:]] */
-#define CR_Space CR_White_Space
+/* 'In_Latin_1_Supplement': Block */
+static const OnigCodePoint CR_In_Latin_1_Supplement[] = {
+ 1,
+ 0x0080, 0x00ff,
+}; /* CR_In_Latin_1_Supplement */
-/* 'Upper': [[:Upper:]] */
-#define CR_Upper CR_Uppercase
+/* 'In_Latin_Extended_A': Block */
+static const OnigCodePoint CR_In_Latin_Extended_A[] = {
+ 1,
+ 0x0100, 0x017f,
+}; /* CR_In_Latin_Extended_A */
-/* 'XDigit': [[:XDigit:]] */
-#define CR_XDigit CR_ASCII_Hex_Digit
+/* 'In_Latin_Extended_B': Block */
+static const OnigCodePoint CR_In_Latin_Extended_B[] = {
+ 1,
+ 0x0180, 0x024f,
+}; /* CR_In_Latin_Extended_B */
-/* 'Word': [[:Word:]] */
-static const OnigCodePoint CR_Word[] = {
- 514,
- 0x0030, 0x0039,
- 0x0041, 0x005a,
- 0x005f, 0x005f,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x02c1,
- 0x02c6, 0x02d1,
- 0x02e0, 0x02e4,
- 0x02ec, 0x02ec,
- 0x02ee, 0x02ee,
- 0x0300, 0x0374,
- 0x0376, 0x0377,
- 0x037a, 0x037d,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03f5,
- 0x03f7, 0x0481,
- 0x0483, 0x0527,
- 0x0531, 0x0556,
- 0x0559, 0x0559,
- 0x0561, 0x0587,
- 0x0591, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f2,
- 0x0610, 0x061a,
- 0x0620, 0x0669,
- 0x066e, 0x06d3,
- 0x06d5, 0x06dc,
- 0x06df, 0x06e8,
- 0x06ea, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x074a,
- 0x074d, 0x07b1,
- 0x07c0, 0x07f5,
- 0x07fa, 0x07fa,
- 0x0800, 0x082d,
- 0x0840, 0x085b,
- 0x0900, 0x0963,
- 0x0966, 0x096f,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bc, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09ce,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09e6, 0x09f1,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3c, 0x0a3c,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a51, 0x0a51,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a75,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abc, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acd,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3c, 0x0b44,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4d,
- 0x0b56, 0x0b57,
- 0x0b5c, 0x0b5d,
- 0x0b5f, 0x0b63,
- 0x0b66, 0x0b6f,
- 0x0b71, 0x0b71,
- 0x0b82, 0x0b83,
- 0x0b85, 0x0b8a,
- 0x0b8e, 0x0b90,
- 0x0b92, 0x0b95,
- 0x0b99, 0x0b9a,
- 0x0b9c, 0x0b9c,
- 0x0b9e, 0x0b9f,
- 0x0ba3, 0x0ba4,
- 0x0ba8, 0x0baa,
- 0x0bae, 0x0bb9,
- 0x0bbe, 0x0bc2,
- 0x0bc6, 0x0bc8,
- 0x0bca, 0x0bcd,
- 0x0bd0, 0x0bd0,
- 0x0bd7, 0x0bd7,
- 0x0be6, 0x0bef,
- 0x0c01, 0x0c03,
- 0x0c05, 0x0c0c,
- 0x0c0e, 0x0c10,
- 0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
- 0x0c3d, 0x0c44,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4d,
- 0x0c55, 0x0c56,
- 0x0c58, 0x0c59,
- 0x0c60, 0x0c63,
- 0x0c66, 0x0c6f,
- 0x0c82, 0x0c83,
- 0x0c85, 0x0c8c,
- 0x0c8e, 0x0c90,
- 0x0c92, 0x0ca8,
- 0x0caa, 0x0cb3,
- 0x0cb5, 0x0cb9,
- 0x0cbc, 0x0cc4,
- 0x0cc6, 0x0cc8,
- 0x0cca, 0x0ccd,
- 0x0cd5, 0x0cd6,
- 0x0cde, 0x0cde,
- 0x0ce0, 0x0ce3,
- 0x0ce6, 0x0cef,
- 0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d3a,
- 0x0d3d, 0x0d44,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4e,
- 0x0d57, 0x0d57,
- 0x0d60, 0x0d63,
- 0x0d66, 0x0d6f,
- 0x0d7a, 0x0d7f,
- 0x0d82, 0x0d83,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0dca, 0x0dca,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df3,
- 0x0e01, 0x0e3a,
- 0x0e40, 0x0e4e,
- 0x0e50, 0x0e59,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ec8, 0x0ecd,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f00,
- 0x0f18, 0x0f19,
- 0x0f20, 0x0f29,
- 0x0f35, 0x0f35,
- 0x0f37, 0x0f37,
- 0x0f39, 0x0f39,
- 0x0f3e, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f71, 0x0f84,
- 0x0f86, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fc6, 0x0fc6,
- 0x1000, 0x1049,
- 0x1050, 0x109d,
- 0x10a0, 0x10c5,
- 0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135d, 0x135f,
- 0x1380, 0x138f,
- 0x13a0, 0x13f4,
- 0x1401, 0x166c,
- 0x166f, 0x167f,
- 0x1681, 0x169a,
- 0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
- 0x1700, 0x170c,
- 0x170e, 0x1714,
- 0x1720, 0x1734,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17b3,
- 0x17b6, 0x17d3,
- 0x17d7, 0x17d7,
- 0x17dc, 0x17dd,
- 0x17e0, 0x17e9,
- 0x180b, 0x180d,
- 0x1810, 0x1819,
- 0x1820, 0x1877,
- 0x1880, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191c,
- 0x1920, 0x192b,
- 0x1930, 0x193b,
- 0x1946, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x19d0, 0x19d9,
- 0x1a00, 0x1a1b,
- 0x1a20, 0x1a5e,
- 0x1a60, 0x1a7c,
- 0x1a7f, 0x1a89,
- 0x1a90, 0x1a99,
- 0x1aa7, 0x1aa7,
- 0x1b00, 0x1b4b,
- 0x1b50, 0x1b59,
- 0x1b6b, 0x1b73,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1bf3,
- 0x1c00, 0x1c37,
- 0x1c40, 0x1c49,
- 0x1c4d, 0x1c7d,
- 0x1cd0, 0x1cd2,
- 0x1cd4, 0x1cf2,
- 0x1d00, 0x1de6,
- 0x1dfc, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fbc,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fcc,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fe0, 0x1fec,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffc,
- 0x203f, 0x2040,
- 0x2054, 0x2054,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x209c,
- 0x20d0, 0x20f0,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x212f, 0x2139,
- 0x213c, 0x213f,
- 0x2145, 0x2149,
- 0x214e, 0x214e,
- 0x2160, 0x2188,
- 0x24b6, 0x24e9,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2ce4,
- 0x2ceb, 0x2cf1,
- 0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
- 0x2d6f, 0x2d6f,
- 0x2d7f, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
+/* 'In_IPA_Extensions': Block */
+static const OnigCodePoint CR_In_IPA_Extensions[] = {
+ 1,
+ 0x0250, 0x02af,
+}; /* CR_In_IPA_Extensions */
+
+/* 'In_Spacing_Modifier_Letters': Block */
+static const OnigCodePoint CR_In_Spacing_Modifier_Letters[] = {
+ 1,
+ 0x02b0, 0x02ff,
+}; /* CR_In_Spacing_Modifier_Letters */
+
+/* 'In_Combining_Diacritical_Marks': Block */
+static const OnigCodePoint CR_In_Combining_Diacritical_Marks[] = {
+ 1,
+ 0x0300, 0x036f,
+}; /* CR_In_Combining_Diacritical_Marks */
+
+/* 'In_Greek_and_Coptic': Block */
+static const OnigCodePoint CR_In_Greek_and_Coptic[] = {
+ 1,
+ 0x0370, 0x03ff,
+}; /* CR_In_Greek_and_Coptic */
+
+/* 'In_Cyrillic': Block */
+static const OnigCodePoint CR_In_Cyrillic[] = {
+ 1,
+ 0x0400, 0x04ff,
+}; /* CR_In_Cyrillic */
+
+/* 'In_Cyrillic_Supplement': Block */
+static const OnigCodePoint CR_In_Cyrillic_Supplement[] = {
+ 1,
+ 0x0500, 0x052f,
+}; /* CR_In_Cyrillic_Supplement */
+
+/* 'In_Armenian': Block */
+static const OnigCodePoint CR_In_Armenian[] = {
+ 1,
+ 0x0530, 0x058f,
+}; /* CR_In_Armenian */
+
+/* 'In_Hebrew': Block */
+static const OnigCodePoint CR_In_Hebrew[] = {
+ 1,
+ 0x0590, 0x05ff,
+}; /* CR_In_Hebrew */
+
+/* 'In_Arabic': Block */
+static const OnigCodePoint CR_In_Arabic[] = {
+ 1,
+ 0x0600, 0x06ff,
+}; /* CR_In_Arabic */
+
+/* 'In_Syriac': Block */
+static const OnigCodePoint CR_In_Syriac[] = {
+ 1,
+ 0x0700, 0x074f,
+}; /* CR_In_Syriac */
+
+/* 'In_Arabic_Supplement': Block */
+static const OnigCodePoint CR_In_Arabic_Supplement[] = {
+ 1,
+ 0x0750, 0x077f,
+}; /* CR_In_Arabic_Supplement */
+
+/* 'In_Thaana': Block */
+static const OnigCodePoint CR_In_Thaana[] = {
+ 1,
+ 0x0780, 0x07bf,
+}; /* CR_In_Thaana */
+
+/* 'In_NKo': Block */
+static const OnigCodePoint CR_In_NKo[] = {
+ 1,
+ 0x07c0, 0x07ff,
+}; /* CR_In_NKo */
+
+/* 'In_Samaritan': Block */
+static const OnigCodePoint CR_In_Samaritan[] = {
+ 1,
+ 0x0800, 0x083f,
+}; /* CR_In_Samaritan */
+
+/* 'In_Mandaic': Block */
+static const OnigCodePoint CR_In_Mandaic[] = {
+ 1,
+ 0x0840, 0x085f,
+}; /* CR_In_Mandaic */
+
+/* 'In_Arabic_Extended_A': Block */
+static const OnigCodePoint CR_In_Arabic_Extended_A[] = {
+ 1,
+ 0x08a0, 0x08ff,
+}; /* CR_In_Arabic_Extended_A */
+
+/* 'In_Devanagari': Block */
+static const OnigCodePoint CR_In_Devanagari[] = {
+ 1,
+ 0x0900, 0x097f,
+}; /* CR_In_Devanagari */
+
+/* 'In_Bengali': Block */
+static const OnigCodePoint CR_In_Bengali[] = {
+ 1,
+ 0x0980, 0x09ff,
+}; /* CR_In_Bengali */
+
+/* 'In_Gurmukhi': Block */
+static const OnigCodePoint CR_In_Gurmukhi[] = {
+ 1,
+ 0x0a00, 0x0a7f,
+}; /* CR_In_Gurmukhi */
+
+/* 'In_Gujarati': Block */
+static const OnigCodePoint CR_In_Gujarati[] = {
+ 1,
+ 0x0a80, 0x0aff,
+}; /* CR_In_Gujarati */
+
+/* 'In_Oriya': Block */
+static const OnigCodePoint CR_In_Oriya[] = {
+ 1,
+ 0x0b00, 0x0b7f,
+}; /* CR_In_Oriya */
+
+/* 'In_Tamil': Block */
+static const OnigCodePoint CR_In_Tamil[] = {
+ 1,
+ 0x0b80, 0x0bff,
+}; /* CR_In_Tamil */
+
+/* 'In_Telugu': Block */
+static const OnigCodePoint CR_In_Telugu[] = {
+ 1,
+ 0x0c00, 0x0c7f,
+}; /* CR_In_Telugu */
+
+/* 'In_Kannada': Block */
+static const OnigCodePoint CR_In_Kannada[] = {
+ 1,
+ 0x0c80, 0x0cff,
+}; /* CR_In_Kannada */
+
+/* 'In_Malayalam': Block */
+static const OnigCodePoint CR_In_Malayalam[] = {
+ 1,
+ 0x0d00, 0x0d7f,
+}; /* CR_In_Malayalam */
+
+/* 'In_Sinhala': Block */
+static const OnigCodePoint CR_In_Sinhala[] = {
+ 1,
+ 0x0d80, 0x0dff,
+}; /* CR_In_Sinhala */
+
+/* 'In_Thai': Block */
+static const OnigCodePoint CR_In_Thai[] = {
+ 1,
+ 0x0e00, 0x0e7f,
+}; /* CR_In_Thai */
+
+/* 'In_Lao': Block */
+static const OnigCodePoint CR_In_Lao[] = {
+ 1,
+ 0x0e80, 0x0eff,
+}; /* CR_In_Lao */
+
+/* 'In_Tibetan': Block */
+static const OnigCodePoint CR_In_Tibetan[] = {
+ 1,
+ 0x0f00, 0x0fff,
+}; /* CR_In_Tibetan */
+
+/* 'In_Myanmar': Block */
+static const OnigCodePoint CR_In_Myanmar[] = {
+ 1,
+ 0x1000, 0x109f,
+}; /* CR_In_Myanmar */
+
+/* 'In_Georgian': Block */
+static const OnigCodePoint CR_In_Georgian[] = {
+ 1,
+ 0x10a0, 0x10ff,
+}; /* CR_In_Georgian */
+
+/* 'In_Hangul_Jamo': Block */
+static const OnigCodePoint CR_In_Hangul_Jamo[] = {
+ 1,
+ 0x1100, 0x11ff,
+}; /* CR_In_Hangul_Jamo */
+
+/* 'In_Ethiopic': Block */
+static const OnigCodePoint CR_In_Ethiopic[] = {
+ 1,
+ 0x1200, 0x137f,
+}; /* CR_In_Ethiopic */
+
+/* 'In_Ethiopic_Supplement': Block */
+static const OnigCodePoint CR_In_Ethiopic_Supplement[] = {
+ 1,
+ 0x1380, 0x139f,
+}; /* CR_In_Ethiopic_Supplement */
+
+/* 'In_Cherokee': Block */
+static const OnigCodePoint CR_In_Cherokee[] = {
+ 1,
+ 0x13a0, 0x13ff,
+}; /* CR_In_Cherokee */
+
+/* 'In_Unified_Canadian_Aboriginal_Syllabics': Block */
+static const OnigCodePoint CR_In_Unified_Canadian_Aboriginal_Syllabics[] = {
+ 1,
+ 0x1400, 0x167f,
+}; /* CR_In_Unified_Canadian_Aboriginal_Syllabics */
+
+/* 'In_Ogham': Block */
+static const OnigCodePoint CR_In_Ogham[] = {
+ 1,
+ 0x1680, 0x169f,
+}; /* CR_In_Ogham */
+
+/* 'In_Runic': Block */
+static const OnigCodePoint CR_In_Runic[] = {
+ 1,
+ 0x16a0, 0x16ff,
+}; /* CR_In_Runic */
+
+/* 'In_Tagalog': Block */
+static const OnigCodePoint CR_In_Tagalog[] = {
+ 1,
+ 0x1700, 0x171f,
+}; /* CR_In_Tagalog */
+
+/* 'In_Hanunoo': Block */
+static const OnigCodePoint CR_In_Hanunoo[] = {
+ 1,
+ 0x1720, 0x173f,
+}; /* CR_In_Hanunoo */
+
+/* 'In_Buhid': Block */
+static const OnigCodePoint CR_In_Buhid[] = {
+ 1,
+ 0x1740, 0x175f,
+}; /* CR_In_Buhid */
+
+/* 'In_Tagbanwa': Block */
+static const OnigCodePoint CR_In_Tagbanwa[] = {
+ 1,
+ 0x1760, 0x177f,
+}; /* CR_In_Tagbanwa */
+
+/* 'In_Khmer': Block */
+static const OnigCodePoint CR_In_Khmer[] = {
+ 1,
+ 0x1780, 0x17ff,
+}; /* CR_In_Khmer */
+
+/* 'In_Mongolian': Block */
+static const OnigCodePoint CR_In_Mongolian[] = {
+ 1,
+ 0x1800, 0x18af,
+}; /* CR_In_Mongolian */
+
+/* 'In_Unified_Canadian_Aboriginal_Syllabics_Extended': Block */
+static const OnigCodePoint CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended[] = {
+ 1,
+ 0x18b0, 0x18ff,
+}; /* CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended */
+
+/* 'In_Limbu': Block */
+static const OnigCodePoint CR_In_Limbu[] = {
+ 1,
+ 0x1900, 0x194f,
+}; /* CR_In_Limbu */
+
+/* 'In_Tai_Le': Block */
+static const OnigCodePoint CR_In_Tai_Le[] = {
+ 1,
+ 0x1950, 0x197f,
+}; /* CR_In_Tai_Le */
+
+/* 'In_New_Tai_Lue': Block */
+static const OnigCodePoint CR_In_New_Tai_Lue[] = {
+ 1,
+ 0x1980, 0x19df,
+}; /* CR_In_New_Tai_Lue */
+
+/* 'In_Khmer_Symbols': Block */
+static const OnigCodePoint CR_In_Khmer_Symbols[] = {
+ 1,
+ 0x19e0, 0x19ff,
+}; /* CR_In_Khmer_Symbols */
+
+/* 'In_Buginese': Block */
+static const OnigCodePoint CR_In_Buginese[] = {
+ 1,
+ 0x1a00, 0x1a1f,
+}; /* CR_In_Buginese */
+
+/* 'In_Tai_Tham': Block */
+static const OnigCodePoint CR_In_Tai_Tham[] = {
+ 1,
+ 0x1a20, 0x1aaf,
+}; /* CR_In_Tai_Tham */
+
+/* 'In_Balinese': Block */
+static const OnigCodePoint CR_In_Balinese[] = {
+ 1,
+ 0x1b00, 0x1b7f,
+}; /* CR_In_Balinese */
+
+/* 'In_Sundanese': Block */
+static const OnigCodePoint CR_In_Sundanese[] = {
+ 1,
+ 0x1b80, 0x1bbf,
+}; /* CR_In_Sundanese */
+
+/* 'In_Batak': Block */
+static const OnigCodePoint CR_In_Batak[] = {
+ 1,
+ 0x1bc0, 0x1bff,
+}; /* CR_In_Batak */
+
+/* 'In_Lepcha': Block */
+static const OnigCodePoint CR_In_Lepcha[] = {
+ 1,
+ 0x1c00, 0x1c4f,
+}; /* CR_In_Lepcha */
+
+/* 'In_Ol_Chiki': Block */
+#define CR_In_Ol_Chiki CR_Ol_Chiki
+
+/* 'In_Sundanese_Supplement': Block */
+static const OnigCodePoint CR_In_Sundanese_Supplement[] = {
+ 1,
+ 0x1cc0, 0x1ccf,
+}; /* CR_In_Sundanese_Supplement */
+
+/* 'In_Vedic_Extensions': Block */
+static const OnigCodePoint CR_In_Vedic_Extensions[] = {
+ 1,
+ 0x1cd0, 0x1cff,
+}; /* CR_In_Vedic_Extensions */
+
+/* 'In_Phonetic_Extensions': Block */
+static const OnigCodePoint CR_In_Phonetic_Extensions[] = {
+ 1,
+ 0x1d00, 0x1d7f,
+}; /* CR_In_Phonetic_Extensions */
+
+/* 'In_Phonetic_Extensions_Supplement': Block */
+static const OnigCodePoint CR_In_Phonetic_Extensions_Supplement[] = {
+ 1,
+ 0x1d80, 0x1dbf,
+}; /* CR_In_Phonetic_Extensions_Supplement */
+
+/* 'In_Combining_Diacritical_Marks_Supplement': Block */
+static const OnigCodePoint CR_In_Combining_Diacritical_Marks_Supplement[] = {
+ 1,
+ 0x1dc0, 0x1dff,
+}; /* CR_In_Combining_Diacritical_Marks_Supplement */
+
+/* 'In_Latin_Extended_Additional': Block */
+static const OnigCodePoint CR_In_Latin_Extended_Additional[] = {
+ 1,
+ 0x1e00, 0x1eff,
+}; /* CR_In_Latin_Extended_Additional */
+
+/* 'In_Greek_Extended': Block */
+static const OnigCodePoint CR_In_Greek_Extended[] = {
+ 1,
+ 0x1f00, 0x1fff,
+}; /* CR_In_Greek_Extended */
+
+/* 'In_General_Punctuation': Block */
+static const OnigCodePoint CR_In_General_Punctuation[] = {
+ 1,
+ 0x2000, 0x206f,
+}; /* CR_In_General_Punctuation */
+
+/* 'In_Superscripts_and_Subscripts': Block */
+static const OnigCodePoint CR_In_Superscripts_and_Subscripts[] = {
+ 1,
+ 0x2070, 0x209f,
+}; /* CR_In_Superscripts_and_Subscripts */
+
+/* 'In_Currency_Symbols': Block */
+static const OnigCodePoint CR_In_Currency_Symbols[] = {
+ 1,
+ 0x20a0, 0x20cf,
+}; /* CR_In_Currency_Symbols */
+
+/* 'In_Combining_Diacritical_Marks_for_Symbols': Block */
+static const OnigCodePoint CR_In_Combining_Diacritical_Marks_for_Symbols[] = {
+ 1,
+ 0x20d0, 0x20ff,
+}; /* CR_In_Combining_Diacritical_Marks_for_Symbols */
+
+/* 'In_Letterlike_Symbols': Block */
+static const OnigCodePoint CR_In_Letterlike_Symbols[] = {
+ 1,
+ 0x2100, 0x214f,
+}; /* CR_In_Letterlike_Symbols */
+
+/* 'In_Number_Forms': Block */
+static const OnigCodePoint CR_In_Number_Forms[] = {
+ 1,
+ 0x2150, 0x218f,
+}; /* CR_In_Number_Forms */
+
+/* 'In_Arrows': Block */
+static const OnigCodePoint CR_In_Arrows[] = {
+ 1,
+ 0x2190, 0x21ff,
+}; /* CR_In_Arrows */
+
+/* 'In_Mathematical_Operators': Block */
+static const OnigCodePoint CR_In_Mathematical_Operators[] = {
+ 1,
+ 0x2200, 0x22ff,
+}; /* CR_In_Mathematical_Operators */
+
+/* 'In_Miscellaneous_Technical': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Technical[] = {
+ 1,
+ 0x2300, 0x23ff,
+}; /* CR_In_Miscellaneous_Technical */
+
+/* 'In_Control_Pictures': Block */
+static const OnigCodePoint CR_In_Control_Pictures[] = {
+ 1,
+ 0x2400, 0x243f,
+}; /* CR_In_Control_Pictures */
+
+/* 'In_Optical_Character_Recognition': Block */
+static const OnigCodePoint CR_In_Optical_Character_Recognition[] = {
+ 1,
+ 0x2440, 0x245f,
+}; /* CR_In_Optical_Character_Recognition */
+
+/* 'In_Enclosed_Alphanumerics': Block */
+static const OnigCodePoint CR_In_Enclosed_Alphanumerics[] = {
+ 1,
+ 0x2460, 0x24ff,
+}; /* CR_In_Enclosed_Alphanumerics */
+
+/* 'In_Box_Drawing': Block */
+static const OnigCodePoint CR_In_Box_Drawing[] = {
+ 1,
+ 0x2500, 0x257f,
+}; /* CR_In_Box_Drawing */
+
+/* 'In_Block_Elements': Block */
+static const OnigCodePoint CR_In_Block_Elements[] = {
+ 1,
+ 0x2580, 0x259f,
+}; /* CR_In_Block_Elements */
+
+/* 'In_Geometric_Shapes': Block */
+static const OnigCodePoint CR_In_Geometric_Shapes[] = {
+ 1,
+ 0x25a0, 0x25ff,
+}; /* CR_In_Geometric_Shapes */
+
+/* 'In_Miscellaneous_Symbols': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Symbols[] = {
+ 1,
+ 0x2600, 0x26ff,
+}; /* CR_In_Miscellaneous_Symbols */
+
+/* 'In_Dingbats': Block */
+static const OnigCodePoint CR_In_Dingbats[] = {
+ 1,
+ 0x2700, 0x27bf,
+}; /* CR_In_Dingbats */
+
+/* 'In_Miscellaneous_Mathematical_Symbols_A': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Mathematical_Symbols_A[] = {
+ 1,
+ 0x27c0, 0x27ef,
+}; /* CR_In_Miscellaneous_Mathematical_Symbols_A */
+
+/* 'In_Supplemental_Arrows_A': Block */
+static const OnigCodePoint CR_In_Supplemental_Arrows_A[] = {
+ 1,
+ 0x27f0, 0x27ff,
+}; /* CR_In_Supplemental_Arrows_A */
+
+/* 'In_Braille_Patterns': Block */
+#define CR_In_Braille_Patterns CR_Braille
+
+/* 'In_Supplemental_Arrows_B': Block */
+static const OnigCodePoint CR_In_Supplemental_Arrows_B[] = {
+ 1,
+ 0x2900, 0x297f,
+}; /* CR_In_Supplemental_Arrows_B */
+
+/* 'In_Miscellaneous_Mathematical_Symbols_B': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Mathematical_Symbols_B[] = {
+ 1,
+ 0x2980, 0x29ff,
+}; /* CR_In_Miscellaneous_Mathematical_Symbols_B */
+
+/* 'In_Supplemental_Mathematical_Operators': Block */
+static const OnigCodePoint CR_In_Supplemental_Mathematical_Operators[] = {
+ 1,
+ 0x2a00, 0x2aff,
+}; /* CR_In_Supplemental_Mathematical_Operators */
+
+/* 'In_Miscellaneous_Symbols_and_Arrows': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Symbols_and_Arrows[] = {
+ 1,
+ 0x2b00, 0x2bff,
+}; /* CR_In_Miscellaneous_Symbols_and_Arrows */
+
+/* 'In_Glagolitic': Block */
+static const OnigCodePoint CR_In_Glagolitic[] = {
+ 1,
+ 0x2c00, 0x2c5f,
+}; /* CR_In_Glagolitic */
+
+/* 'In_Latin_Extended_C': Block */
+static const OnigCodePoint CR_In_Latin_Extended_C[] = {
+ 1,
+ 0x2c60, 0x2c7f,
+}; /* CR_In_Latin_Extended_C */
+
+/* 'In_Coptic': Block */
+static const OnigCodePoint CR_In_Coptic[] = {
+ 1,
+ 0x2c80, 0x2cff,
+}; /* CR_In_Coptic */
+
+/* 'In_Georgian_Supplement': Block */
+static const OnigCodePoint CR_In_Georgian_Supplement[] = {
+ 1,
+ 0x2d00, 0x2d2f,
+}; /* CR_In_Georgian_Supplement */
+
+/* 'In_Tifinagh': Block */
+static const OnigCodePoint CR_In_Tifinagh[] = {
+ 1,
+ 0x2d30, 0x2d7f,
+}; /* CR_In_Tifinagh */
+
+/* 'In_Ethiopic_Extended': Block */
+static const OnigCodePoint CR_In_Ethiopic_Extended[] = {
+ 1,
+ 0x2d80, 0x2ddf,
+}; /* CR_In_Ethiopic_Extended */
+
+/* 'In_Cyrillic_Extended_A': Block */
+static const OnigCodePoint CR_In_Cyrillic_Extended_A[] = {
+ 1,
0x2de0, 0x2dff,
- 0x2e2f, 0x2e2f,
- 0x3005, 0x3007,
- 0x3021, 0x302f,
- 0x3031, 0x3035,
- 0x3038, 0x303c,
- 0x3041, 0x3096,
- 0x3099, 0x309a,
- 0x309d, 0x309f,
- 0x30a1, 0x30fa,
- 0x30fc, 0x30ff,
- 0x3105, 0x312d,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
+}; /* CR_In_Cyrillic_Extended_A */
+
+/* 'In_Supplemental_Punctuation': Block */
+static const OnigCodePoint CR_In_Supplemental_Punctuation[] = {
+ 1,
+ 0x2e00, 0x2e7f,
+}; /* CR_In_Supplemental_Punctuation */
+
+/* 'In_CJK_Radicals_Supplement': Block */
+static const OnigCodePoint CR_In_CJK_Radicals_Supplement[] = {
+ 1,
+ 0x2e80, 0x2eff,
+}; /* CR_In_CJK_Radicals_Supplement */
+
+/* 'In_Kangxi_Radicals': Block */
+static const OnigCodePoint CR_In_Kangxi_Radicals[] = {
+ 1,
+ 0x2f00, 0x2fdf,
+}; /* CR_In_Kangxi_Radicals */
+
+/* 'In_Ideographic_Description_Characters': Block */
+static const OnigCodePoint CR_In_Ideographic_Description_Characters[] = {
+ 1,
+ 0x2ff0, 0x2fff,
+}; /* CR_In_Ideographic_Description_Characters */
+
+/* 'In_CJK_Symbols_and_Punctuation': Block */
+static const OnigCodePoint CR_In_CJK_Symbols_and_Punctuation[] = {
+ 1,
+ 0x3000, 0x303f,
+}; /* CR_In_CJK_Symbols_and_Punctuation */
+
+/* 'In_Hiragana': Block */
+static const OnigCodePoint CR_In_Hiragana[] = {
+ 1,
+ 0x3040, 0x309f,
+}; /* CR_In_Hiragana */
+
+/* 'In_Katakana': Block */
+static const OnigCodePoint CR_In_Katakana[] = {
+ 1,
+ 0x30a0, 0x30ff,
+}; /* CR_In_Katakana */
+
+/* 'In_Bopomofo': Block */
+static const OnigCodePoint CR_In_Bopomofo[] = {
+ 1,
+ 0x3100, 0x312f,
+}; /* CR_In_Bopomofo */
+
+/* 'In_Hangul_Compatibility_Jamo': Block */
+static const OnigCodePoint CR_In_Hangul_Compatibility_Jamo[] = {
+ 1,
+ 0x3130, 0x318f,
+}; /* CR_In_Hangul_Compatibility_Jamo */
+
+/* 'In_Kanbun': Block */
+static const OnigCodePoint CR_In_Kanbun[] = {
+ 1,
+ 0x3190, 0x319f,
+}; /* CR_In_Kanbun */
+
+/* 'In_Bopomofo_Extended': Block */
+static const OnigCodePoint CR_In_Bopomofo_Extended[] = {
+ 1,
+ 0x31a0, 0x31bf,
+}; /* CR_In_Bopomofo_Extended */
+
+/* 'In_CJK_Strokes': Block */
+static const OnigCodePoint CR_In_CJK_Strokes[] = {
+ 1,
+ 0x31c0, 0x31ef,
+}; /* CR_In_CJK_Strokes */
+
+/* 'In_Katakana_Phonetic_Extensions': Block */
+static const OnigCodePoint CR_In_Katakana_Phonetic_Extensions[] = {
+ 1,
0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa62b,
- 0xa640, 0xa672,
- 0xa67c, 0xa67d,
- 0xa67f, 0xa697,
- 0xa6a0, 0xa6f1,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa827,
- 0xa840, 0xa873,
- 0xa880, 0xa8c4,
- 0xa8d0, 0xa8d9,
- 0xa8e0, 0xa8f7,
- 0xa8fb, 0xa8fb,
- 0xa900, 0xa92d,
- 0xa930, 0xa953,
- 0xa960, 0xa97c,
- 0xa980, 0xa9c0,
- 0xa9cf, 0xa9d9,
- 0xaa00, 0xaa36,
- 0xaa40, 0xaa4d,
- 0xaa50, 0xaa59,
- 0xaa60, 0xaa76,
- 0xaa7a, 0xaa7b,
- 0xaa80, 0xaac2,
- 0xaadb, 0xaadd,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xabc0, 0xabea,
- 0xabec, 0xabed,
- 0xabf0, 0xabf9,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb28,
- 0xfb2a, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3d,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfb,
+}; /* CR_In_Katakana_Phonetic_Extensions */
+
+/* 'In_Enclosed_CJK_Letters_and_Months': Block */
+static const OnigCodePoint CR_In_Enclosed_CJK_Letters_and_Months[] = {
+ 1,
+ 0x3200, 0x32ff,
+}; /* CR_In_Enclosed_CJK_Letters_and_Months */
+
+/* 'In_CJK_Compatibility': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility[] = {
+ 1,
+ 0x3300, 0x33ff,
+}; /* CR_In_CJK_Compatibility */
+
+/* 'In_CJK_Unified_Ideographs_Extension_A': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_A[] = {
+ 1,
+ 0x3400, 0x4dbf,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_A */
+
+/* 'In_Yijing_Hexagram_Symbols': Block */
+static const OnigCodePoint CR_In_Yijing_Hexagram_Symbols[] = {
+ 1,
+ 0x4dc0, 0x4dff,
+}; /* CR_In_Yijing_Hexagram_Symbols */
+
+/* 'In_CJK_Unified_Ideographs': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs[] = {
+ 1,
+ 0x4e00, 0x9fff,
+}; /* CR_In_CJK_Unified_Ideographs */
+
+/* 'In_Yi_Syllables': Block */
+static const OnigCodePoint CR_In_Yi_Syllables[] = {
+ 1,
+ 0xa000, 0xa48f,
+}; /* CR_In_Yi_Syllables */
+
+/* 'In_Yi_Radicals': Block */
+static const OnigCodePoint CR_In_Yi_Radicals[] = {
+ 1,
+ 0xa490, 0xa4cf,
+}; /* CR_In_Yi_Radicals */
+
+/* 'In_Lisu': Block */
+#define CR_In_Lisu CR_Lisu
+
+/* 'In_Vai': Block */
+static const OnigCodePoint CR_In_Vai[] = {
+ 1,
+ 0xa500, 0xa63f,
+}; /* CR_In_Vai */
+
+/* 'In_Cyrillic_Extended_B': Block */
+static const OnigCodePoint CR_In_Cyrillic_Extended_B[] = {
+ 1,
+ 0xa640, 0xa69f,
+}; /* CR_In_Cyrillic_Extended_B */
+
+/* 'In_Bamum': Block */
+static const OnigCodePoint CR_In_Bamum[] = {
+ 1,
+ 0xa6a0, 0xa6ff,
+}; /* CR_In_Bamum */
+
+/* 'In_Modifier_Tone_Letters': Block */
+static const OnigCodePoint CR_In_Modifier_Tone_Letters[] = {
+ 1,
+ 0xa700, 0xa71f,
+}; /* CR_In_Modifier_Tone_Letters */
+
+/* 'In_Latin_Extended_D': Block */
+static const OnigCodePoint CR_In_Latin_Extended_D[] = {
+ 1,
+ 0xa720, 0xa7ff,
+}; /* CR_In_Latin_Extended_D */
+
+/* 'In_Syloti_Nagri': Block */
+static const OnigCodePoint CR_In_Syloti_Nagri[] = {
+ 1,
+ 0xa800, 0xa82f,
+}; /* CR_In_Syloti_Nagri */
+
+/* 'In_Common_Indic_Number_Forms': Block */
+static const OnigCodePoint CR_In_Common_Indic_Number_Forms[] = {
+ 1,
+ 0xa830, 0xa83f,
+}; /* CR_In_Common_Indic_Number_Forms */
+
+/* 'In_Phags_pa': Block */
+static const OnigCodePoint CR_In_Phags_pa[] = {
+ 1,
+ 0xa840, 0xa87f,
+}; /* CR_In_Phags_pa */
+
+/* 'In_Saurashtra': Block */
+static const OnigCodePoint CR_In_Saurashtra[] = {
+ 1,
+ 0xa880, 0xa8df,
+}; /* CR_In_Saurashtra */
+
+/* 'In_Devanagari_Extended': Block */
+static const OnigCodePoint CR_In_Devanagari_Extended[] = {
+ 1,
+ 0xa8e0, 0xa8ff,
+}; /* CR_In_Devanagari_Extended */
+
+/* 'In_Kayah_Li': Block */
+#define CR_In_Kayah_Li CR_Kayah_Li
+
+/* 'In_Rejang': Block */
+static const OnigCodePoint CR_In_Rejang[] = {
+ 1,
+ 0xa930, 0xa95f,
+}; /* CR_In_Rejang */
+
+/* 'In_Hangul_Jamo_Extended_A': Block */
+static const OnigCodePoint CR_In_Hangul_Jamo_Extended_A[] = {
+ 1,
+ 0xa960, 0xa97f,
+}; /* CR_In_Hangul_Jamo_Extended_A */
+
+/* 'In_Javanese': Block */
+static const OnigCodePoint CR_In_Javanese[] = {
+ 1,
+ 0xa980, 0xa9df,
+}; /* CR_In_Javanese */
+
+/* 'In_Cham': Block */
+static const OnigCodePoint CR_In_Cham[] = {
+ 1,
+ 0xaa00, 0xaa5f,
+}; /* CR_In_Cham */
+
+/* 'In_Myanmar_Extended_A': Block */
+static const OnigCodePoint CR_In_Myanmar_Extended_A[] = {
+ 1,
+ 0xaa60, 0xaa7f,
+}; /* CR_In_Myanmar_Extended_A */
+
+/* 'In_Tai_Viet': Block */
+static const OnigCodePoint CR_In_Tai_Viet[] = {
+ 1,
+ 0xaa80, 0xaadf,
+}; /* CR_In_Tai_Viet */
+
+/* 'In_Meetei_Mayek_Extensions': Block */
+static const OnigCodePoint CR_In_Meetei_Mayek_Extensions[] = {
+ 1,
+ 0xaae0, 0xaaff,
+}; /* CR_In_Meetei_Mayek_Extensions */
+
+/* 'In_Ethiopic_Extended_A': Block */
+static const OnigCodePoint CR_In_Ethiopic_Extended_A[] = {
+ 1,
+ 0xab00, 0xab2f,
+}; /* CR_In_Ethiopic_Extended_A */
+
+/* 'In_Meetei_Mayek': Block */
+static const OnigCodePoint CR_In_Meetei_Mayek[] = {
+ 1,
+ 0xabc0, 0xabff,
+}; /* CR_In_Meetei_Mayek */
+
+/* 'In_Hangul_Syllables': Block */
+static const OnigCodePoint CR_In_Hangul_Syllables[] = {
+ 1,
+ 0xac00, 0xd7af,
+}; /* CR_In_Hangul_Syllables */
+
+/* 'In_Hangul_Jamo_Extended_B': Block */
+static const OnigCodePoint CR_In_Hangul_Jamo_Extended_B[] = {
+ 1,
+ 0xd7b0, 0xd7ff,
+}; /* CR_In_Hangul_Jamo_Extended_B */
+
+/* 'In_High_Surrogates': Block */
+static const OnigCodePoint CR_In_High_Surrogates[] = {
+ 1,
+ 0xd800, 0xdb7f,
+}; /* CR_In_High_Surrogates */
+
+/* 'In_High_Private_Use_Surrogates': Block */
+static const OnigCodePoint CR_In_High_Private_Use_Surrogates[] = {
+ 1,
+ 0xdb80, 0xdbff,
+}; /* CR_In_High_Private_Use_Surrogates */
+
+/* 'In_Low_Surrogates': Block */
+static const OnigCodePoint CR_In_Low_Surrogates[] = {
+ 1,
+ 0xdc00, 0xdfff,
+}; /* CR_In_Low_Surrogates */
+
+/* 'In_Private_Use_Area': Block */
+static const OnigCodePoint CR_In_Private_Use_Area[] = {
+ 1,
+ 0xe000, 0xf8ff,
+}; /* CR_In_Private_Use_Area */
+
+/* 'In_CJK_Compatibility_Ideographs': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility_Ideographs[] = {
+ 1,
+ 0xf900, 0xfaff,
+}; /* CR_In_CJK_Compatibility_Ideographs */
+
+/* 'In_Alphabetic_Presentation_Forms': Block */
+static const OnigCodePoint CR_In_Alphabetic_Presentation_Forms[] = {
+ 1,
+ 0xfb00, 0xfb4f,
+}; /* CR_In_Alphabetic_Presentation_Forms */
+
+/* 'In_Arabic_Presentation_Forms_A': Block */
+static const OnigCodePoint CR_In_Arabic_Presentation_Forms_A[] = {
+ 1,
+ 0xfb50, 0xfdff,
+}; /* CR_In_Arabic_Presentation_Forms_A */
+
+/* 'In_Variation_Selectors': Block */
+static const OnigCodePoint CR_In_Variation_Selectors[] = {
+ 1,
0xfe00, 0xfe0f,
- 0xfe20, 0xfe26,
- 0xfe33, 0xfe34,
- 0xfe4d, 0xfe4f,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xff10, 0xff19,
- 0xff21, 0xff3a,
- 0xff3f, 0xff3f,
- 0xff41, 0xff5a,
- 0xff66, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10140, 0x10174,
- 0x101fd, 0x101fd,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x10300, 0x1031e,
- 0x10330, 0x1034a,
- 0x10380, 0x1039d,
- 0x103a0, 0x103c3,
- 0x103c8, 0x103cf,
- 0x103d1, 0x103d5,
- 0x10400, 0x1049d,
- 0x104a0, 0x104a9,
- 0x10800, 0x10805,
- 0x10808, 0x10808,
- 0x1080a, 0x10835,
- 0x10837, 0x10838,
- 0x1083c, 0x1083c,
- 0x1083f, 0x10855,
- 0x10900, 0x10915,
- 0x10920, 0x10939,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a3f,
- 0x10a60, 0x10a7c,
- 0x10b00, 0x10b35,
- 0x10b40, 0x10b55,
- 0x10b60, 0x10b72,
- 0x10c00, 0x10c48,
- 0x11000, 0x11046,
- 0x11066, 0x1106f,
- 0x11080, 0x110ba,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x13000, 0x1342e,
- 0x16800, 0x16a38,
- 0x1b000, 0x1b001,
- 0x1d165, 0x1d169,
- 0x1d16d, 0x1d172,
- 0x1d17b, 0x1d182,
- 0x1d185, 0x1d18b,
- 0x1d1aa, 0x1d1ad,
- 0x1d242, 0x1d244,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d6c0,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6fa,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d734,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d76e,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d7a8,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7cb,
- 0x1d7ce, 0x1d7ff,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2f800, 0x2fa1d,
+}; /* CR_In_Variation_Selectors */
+
+/* 'In_Vertical_Forms': Block */
+static const OnigCodePoint CR_In_Vertical_Forms[] = {
+ 1,
+ 0xfe10, 0xfe1f,
+}; /* CR_In_Vertical_Forms */
+
+/* 'In_Combining_Half_Marks': Block */
+static const OnigCodePoint CR_In_Combining_Half_Marks[] = {
+ 1,
+ 0xfe20, 0xfe2f,
+}; /* CR_In_Combining_Half_Marks */
+
+/* 'In_CJK_Compatibility_Forms': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility_Forms[] = {
+ 1,
+ 0xfe30, 0xfe4f,
+}; /* CR_In_CJK_Compatibility_Forms */
+
+/* 'In_Small_Form_Variants': Block */
+static const OnigCodePoint CR_In_Small_Form_Variants[] = {
+ 1,
+ 0xfe50, 0xfe6f,
+}; /* CR_In_Small_Form_Variants */
+
+/* 'In_Arabic_Presentation_Forms_B': Block */
+static const OnigCodePoint CR_In_Arabic_Presentation_Forms_B[] = {
+ 1,
+ 0xfe70, 0xfeff,
+}; /* CR_In_Arabic_Presentation_Forms_B */
+
+/* 'In_Halfwidth_and_Fullwidth_Forms': Block */
+static const OnigCodePoint CR_In_Halfwidth_and_Fullwidth_Forms[] = {
+ 1,
+ 0xff00, 0xffef,
+}; /* CR_In_Halfwidth_and_Fullwidth_Forms */
+
+/* 'In_Specials': Block */
+static const OnigCodePoint CR_In_Specials[] = {
+ 1,
+ 0xfff0, 0xffff,
+}; /* CR_In_Specials */
+
+/* 'In_Linear_B_Syllabary': Block */
+static const OnigCodePoint CR_In_Linear_B_Syllabary[] = {
+ 1,
+ 0x10000, 0x1007f,
+}; /* CR_In_Linear_B_Syllabary */
+
+/* 'In_Linear_B_Ideograms': Block */
+static const OnigCodePoint CR_In_Linear_B_Ideograms[] = {
+ 1,
+ 0x10080, 0x100ff,
+}; /* CR_In_Linear_B_Ideograms */
+
+/* 'In_Aegean_Numbers': Block */
+static const OnigCodePoint CR_In_Aegean_Numbers[] = {
+ 1,
+ 0x10100, 0x1013f,
+}; /* CR_In_Aegean_Numbers */
+
+/* 'In_Ancient_Greek_Numbers': Block */
+static const OnigCodePoint CR_In_Ancient_Greek_Numbers[] = {
+ 1,
+ 0x10140, 0x1018f,
+}; /* CR_In_Ancient_Greek_Numbers */
+
+/* 'In_Ancient_Symbols': Block */
+static const OnigCodePoint CR_In_Ancient_Symbols[] = {
+ 1,
+ 0x10190, 0x101cf,
+}; /* CR_In_Ancient_Symbols */
+
+/* 'In_Phaistos_Disc': Block */
+static const OnigCodePoint CR_In_Phaistos_Disc[] = {
+ 1,
+ 0x101d0, 0x101ff,
+}; /* CR_In_Phaistos_Disc */
+
+/* 'In_Lycian': Block */
+static const OnigCodePoint CR_In_Lycian[] = {
+ 1,
+ 0x10280, 0x1029f,
+}; /* CR_In_Lycian */
+
+/* 'In_Carian': Block */
+static const OnigCodePoint CR_In_Carian[] = {
+ 1,
+ 0x102a0, 0x102df,
+}; /* CR_In_Carian */
+
+/* 'In_Old_Italic': Block */
+static const OnigCodePoint CR_In_Old_Italic[] = {
+ 1,
+ 0x10300, 0x1032f,
+}; /* CR_In_Old_Italic */
+
+/* 'In_Gothic': Block */
+static const OnigCodePoint CR_In_Gothic[] = {
+ 1,
+ 0x10330, 0x1034f,
+}; /* CR_In_Gothic */
+
+/* 'In_Ugaritic': Block */
+static const OnigCodePoint CR_In_Ugaritic[] = {
+ 1,
+ 0x10380, 0x1039f,
+}; /* CR_In_Ugaritic */
+
+/* 'In_Old_Persian': Block */
+static const OnigCodePoint CR_In_Old_Persian[] = {
+ 1,
+ 0x103a0, 0x103df,
+}; /* CR_In_Old_Persian */
+
+/* 'In_Deseret': Block */
+#define CR_In_Deseret CR_Deseret
+
+/* 'In_Shavian': Block */
+#define CR_In_Shavian CR_Shavian
+
+/* 'In_Osmanya': Block */
+static const OnigCodePoint CR_In_Osmanya[] = {
+ 1,
+ 0x10480, 0x104af,
+}; /* CR_In_Osmanya */
+
+/* 'In_Cypriot_Syllabary': Block */
+static const OnigCodePoint CR_In_Cypriot_Syllabary[] = {
+ 1,
+ 0x10800, 0x1083f,
+}; /* CR_In_Cypriot_Syllabary */
+
+/* 'In_Imperial_Aramaic': Block */
+static const OnigCodePoint CR_In_Imperial_Aramaic[] = {
+ 1,
+ 0x10840, 0x1085f,
+}; /* CR_In_Imperial_Aramaic */
+
+/* 'In_Phoenician': Block */
+static const OnigCodePoint CR_In_Phoenician[] = {
+ 1,
+ 0x10900, 0x1091f,
+}; /* CR_In_Phoenician */
+
+/* 'In_Lydian': Block */
+static const OnigCodePoint CR_In_Lydian[] = {
+ 1,
+ 0x10920, 0x1093f,
+}; /* CR_In_Lydian */
+
+/* 'In_Meroitic_Hieroglyphs': Block */
+#define CR_In_Meroitic_Hieroglyphs CR_Meroitic_Hieroglyphs
+
+/* 'In_Meroitic_Cursive': Block */
+static const OnigCodePoint CR_In_Meroitic_Cursive[] = {
+ 1,
+ 0x109a0, 0x109ff,
+}; /* CR_In_Meroitic_Cursive */
+
+/* 'In_Kharoshthi': Block */
+static const OnigCodePoint CR_In_Kharoshthi[] = {
+ 1,
+ 0x10a00, 0x10a5f,
+}; /* CR_In_Kharoshthi */
+
+/* 'In_Old_South_Arabian': Block */
+#define CR_In_Old_South_Arabian CR_Old_South_Arabian
+
+/* 'In_Avestan': Block */
+static const OnigCodePoint CR_In_Avestan[] = {
+ 1,
+ 0x10b00, 0x10b3f,
+}; /* CR_In_Avestan */
+
+/* 'In_Inscriptional_Parthian': Block */
+static const OnigCodePoint CR_In_Inscriptional_Parthian[] = {
+ 1,
+ 0x10b40, 0x10b5f,
+}; /* CR_In_Inscriptional_Parthian */
+
+/* 'In_Inscriptional_Pahlavi': Block */
+static const OnigCodePoint CR_In_Inscriptional_Pahlavi[] = {
+ 1,
+ 0x10b60, 0x10b7f,
+}; /* CR_In_Inscriptional_Pahlavi */
+
+/* 'In_Old_Turkic': Block */
+static const OnigCodePoint CR_In_Old_Turkic[] = {
+ 1,
+ 0x10c00, 0x10c4f,
+}; /* CR_In_Old_Turkic */
+
+/* 'In_Rumi_Numeral_Symbols': Block */
+static const OnigCodePoint CR_In_Rumi_Numeral_Symbols[] = {
+ 1,
+ 0x10e60, 0x10e7f,
+}; /* CR_In_Rumi_Numeral_Symbols */
+
+/* 'In_Brahmi': Block */
+static const OnigCodePoint CR_In_Brahmi[] = {
+ 1,
+ 0x11000, 0x1107f,
+}; /* CR_In_Brahmi */
+
+/* 'In_Kaithi': Block */
+static const OnigCodePoint CR_In_Kaithi[] = {
+ 1,
+ 0x11080, 0x110cf,
+}; /* CR_In_Kaithi */
+
+/* 'In_Sora_Sompeng': Block */
+static const OnigCodePoint CR_In_Sora_Sompeng[] = {
+ 1,
+ 0x110d0, 0x110ff,
+}; /* CR_In_Sora_Sompeng */
+
+/* 'In_Chakma': Block */
+static const OnigCodePoint CR_In_Chakma[] = {
+ 1,
+ 0x11100, 0x1114f,
+}; /* CR_In_Chakma */
+
+/* 'In_Sharada': Block */
+static const OnigCodePoint CR_In_Sharada[] = {
+ 1,
+ 0x11180, 0x111df,
+}; /* CR_In_Sharada */
+
+/* 'In_Takri': Block */
+static const OnigCodePoint CR_In_Takri[] = {
+ 1,
+ 0x11680, 0x116cf,
+}; /* CR_In_Takri */
+
+/* 'In_Cuneiform': Block */
+static const OnigCodePoint CR_In_Cuneiform[] = {
+ 1,
+ 0x12000, 0x123ff,
+}; /* CR_In_Cuneiform */
+
+/* 'In_Cuneiform_Numbers_and_Punctuation': Block */
+static const OnigCodePoint CR_In_Cuneiform_Numbers_and_Punctuation[] = {
+ 1,
+ 0x12400, 0x1247f,
+}; /* CR_In_Cuneiform_Numbers_and_Punctuation */
+
+/* 'In_Egyptian_Hieroglyphs': Block */
+static const OnigCodePoint CR_In_Egyptian_Hieroglyphs[] = {
+ 1,
+ 0x13000, 0x1342f,
+}; /* CR_In_Egyptian_Hieroglyphs */
+
+/* 'In_Bamum_Supplement': Block */
+static const OnigCodePoint CR_In_Bamum_Supplement[] = {
+ 1,
+ 0x16800, 0x16a3f,
+}; /* CR_In_Bamum_Supplement */
+
+/* 'In_Miao': Block */
+static const OnigCodePoint CR_In_Miao[] = {
+ 1,
+ 0x16f00, 0x16f9f,
+}; /* CR_In_Miao */
+
+/* 'In_Kana_Supplement': Block */
+static const OnigCodePoint CR_In_Kana_Supplement[] = {
+ 1,
+ 0x1b000, 0x1b0ff,
+}; /* CR_In_Kana_Supplement */
+
+/* 'In_Byzantine_Musical_Symbols': Block */
+static const OnigCodePoint CR_In_Byzantine_Musical_Symbols[] = {
+ 1,
+ 0x1d000, 0x1d0ff,
+}; /* CR_In_Byzantine_Musical_Symbols */
+
+/* 'In_Musical_Symbols': Block */
+static const OnigCodePoint CR_In_Musical_Symbols[] = {
+ 1,
+ 0x1d100, 0x1d1ff,
+}; /* CR_In_Musical_Symbols */
+
+/* 'In_Ancient_Greek_Musical_Notation': Block */
+static const OnigCodePoint CR_In_Ancient_Greek_Musical_Notation[] = {
+ 1,
+ 0x1d200, 0x1d24f,
+}; /* CR_In_Ancient_Greek_Musical_Notation */
+
+/* 'In_Tai_Xuan_Jing_Symbols': Block */
+static const OnigCodePoint CR_In_Tai_Xuan_Jing_Symbols[] = {
+ 1,
+ 0x1d300, 0x1d35f,
+}; /* CR_In_Tai_Xuan_Jing_Symbols */
+
+/* 'In_Counting_Rod_Numerals': Block */
+static const OnigCodePoint CR_In_Counting_Rod_Numerals[] = {
+ 1,
+ 0x1d360, 0x1d37f,
+}; /* CR_In_Counting_Rod_Numerals */
+
+/* 'In_Mathematical_Alphanumeric_Symbols': Block */
+static const OnigCodePoint CR_In_Mathematical_Alphanumeric_Symbols[] = {
+ 1,
+ 0x1d400, 0x1d7ff,
+}; /* CR_In_Mathematical_Alphanumeric_Symbols */
+
+/* 'In_Arabic_Mathematical_Alphabetic_Symbols': Block */
+static const OnigCodePoint CR_In_Arabic_Mathematical_Alphabetic_Symbols[] = {
+ 1,
+ 0x1ee00, 0x1eeff,
+}; /* CR_In_Arabic_Mathematical_Alphabetic_Symbols */
+
+/* 'In_Mahjong_Tiles': Block */
+static const OnigCodePoint CR_In_Mahjong_Tiles[] = {
+ 1,
+ 0x1f000, 0x1f02f,
+}; /* CR_In_Mahjong_Tiles */
+
+/* 'In_Domino_Tiles': Block */
+static const OnigCodePoint CR_In_Domino_Tiles[] = {
+ 1,
+ 0x1f030, 0x1f09f,
+}; /* CR_In_Domino_Tiles */
+
+/* 'In_Playing_Cards': Block */
+static const OnigCodePoint CR_In_Playing_Cards[] = {
+ 1,
+ 0x1f0a0, 0x1f0ff,
+}; /* CR_In_Playing_Cards */
+
+/* 'In_Enclosed_Alphanumeric_Supplement': Block */
+static const OnigCodePoint CR_In_Enclosed_Alphanumeric_Supplement[] = {
+ 1,
+ 0x1f100, 0x1f1ff,
+}; /* CR_In_Enclosed_Alphanumeric_Supplement */
+
+/* 'In_Enclosed_Ideographic_Supplement': Block */
+static const OnigCodePoint CR_In_Enclosed_Ideographic_Supplement[] = {
+ 1,
+ 0x1f200, 0x1f2ff,
+}; /* CR_In_Enclosed_Ideographic_Supplement */
+
+/* 'In_Miscellaneous_Symbols_And_Pictographs': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Symbols_And_Pictographs[] = {
+ 1,
+ 0x1f300, 0x1f5ff,
+}; /* CR_In_Miscellaneous_Symbols_And_Pictographs */
+
+/* 'In_Emoticons': Block */
+static const OnigCodePoint CR_In_Emoticons[] = {
+ 1,
+ 0x1f600, 0x1f64f,
+}; /* CR_In_Emoticons */
+
+/* 'In_Transport_And_Map_Symbols': Block */
+static const OnigCodePoint CR_In_Transport_And_Map_Symbols[] = {
+ 1,
+ 0x1f680, 0x1f6ff,
+}; /* CR_In_Transport_And_Map_Symbols */
+
+/* 'In_Alchemical_Symbols': Block */
+static const OnigCodePoint CR_In_Alchemical_Symbols[] = {
+ 1,
+ 0x1f700, 0x1f77f,
+}; /* CR_In_Alchemical_Symbols */
+
+/* 'In_CJK_Unified_Ideographs_Extension_B': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_B[] = {
+ 1,
+ 0x20000, 0x2a6df,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_B */
+
+/* 'In_CJK_Unified_Ideographs_Extension_C': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_C[] = {
+ 1,
+ 0x2a700, 0x2b73f,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_C */
+
+/* 'In_CJK_Unified_Ideographs_Extension_D': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_D[] = {
+ 1,
+ 0x2b740, 0x2b81f,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_D */
+
+/* 'In_CJK_Compatibility_Ideographs_Supplement': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility_Ideographs_Supplement[] = {
+ 1,
+ 0x2f800, 0x2fa1f,
+}; /* CR_In_CJK_Compatibility_Ideographs_Supplement */
+
+/* 'In_Tags': Block */
+static const OnigCodePoint CR_In_Tags[] = {
+ 1,
+ 0xe0000, 0xe007f,
+}; /* CR_In_Tags */
+
+/* 'In_Variation_Selectors_Supplement': Block */
+static const OnigCodePoint CR_In_Variation_Selectors_Supplement[] = {
+ 1,
0xe0100, 0xe01ef,
-}; /* CR_Word */
+}; /* CR_In_Variation_Selectors_Supplement */
-/* 'Alnum': [[:Alnum:]] */
-static const OnigCodePoint CR_Alnum[] = {
- 509,
- 0x0030, 0x0039,
- 0x0041, 0x005a,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x02c1,
- 0x02c6, 0x02d1,
- 0x02e0, 0x02e4,
- 0x02ec, 0x02ec,
- 0x02ee, 0x02ee,
- 0x0345, 0x0345,
- 0x0370, 0x0374,
- 0x0376, 0x0377,
- 0x037a, 0x037d,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03f5,
- 0x03f7, 0x0481,
- 0x048a, 0x0527,
- 0x0531, 0x0556,
- 0x0559, 0x0559,
- 0x0561, 0x0587,
- 0x05b0, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f2,
- 0x0610, 0x061a,
- 0x0620, 0x0657,
- 0x0659, 0x0669,
- 0x066e, 0x06d3,
- 0x06d5, 0x06dc,
- 0x06e1, 0x06e8,
- 0x06ed, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x073f,
- 0x074d, 0x07b1,
- 0x07c0, 0x07ea,
- 0x07f4, 0x07f5,
- 0x07fa, 0x07fa,
- 0x0800, 0x0817,
- 0x081a, 0x082c,
- 0x0840, 0x0858,
- 0x0900, 0x093b,
- 0x093d, 0x094c,
- 0x094e, 0x0950,
- 0x0955, 0x0963,
- 0x0966, 0x096f,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bd, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09cc,
- 0x09ce, 0x09ce,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09e6, 0x09f1,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4c,
- 0x0a51, 0x0a51,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a75,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abd, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acc,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3d, 0x0b44,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4c,
- 0x0b56, 0x0b57,
- 0x0b5c, 0x0b5d,
- 0x0b5f, 0x0b63,
- 0x0b66, 0x0b6f,
- 0x0b71, 0x0b71,
- 0x0b82, 0x0b83,
- 0x0b85, 0x0b8a,
- 0x0b8e, 0x0b90,
- 0x0b92, 0x0b95,
- 0x0b99, 0x0b9a,
- 0x0b9c, 0x0b9c,
- 0x0b9e, 0x0b9f,
- 0x0ba3, 0x0ba4,
- 0x0ba8, 0x0baa,
- 0x0bae, 0x0bb9,
- 0x0bbe, 0x0bc2,
- 0x0bc6, 0x0bc8,
- 0x0bca, 0x0bcc,
- 0x0bd0, 0x0bd0,
- 0x0bd7, 0x0bd7,
- 0x0be6, 0x0bef,
- 0x0c01, 0x0c03,
- 0x0c05, 0x0c0c,
- 0x0c0e, 0x0c10,
- 0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
- 0x0c3d, 0x0c44,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4c,
- 0x0c55, 0x0c56,
- 0x0c58, 0x0c59,
- 0x0c60, 0x0c63,
- 0x0c66, 0x0c6f,
- 0x0c82, 0x0c83,
- 0x0c85, 0x0c8c,
- 0x0c8e, 0x0c90,
- 0x0c92, 0x0ca8,
- 0x0caa, 0x0cb3,
- 0x0cb5, 0x0cb9,
- 0x0cbd, 0x0cc4,
- 0x0cc6, 0x0cc8,
- 0x0cca, 0x0ccc,
- 0x0cd5, 0x0cd6,
- 0x0cde, 0x0cde,
- 0x0ce0, 0x0ce3,
- 0x0ce6, 0x0cef,
- 0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d3a,
- 0x0d3d, 0x0d44,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4c,
- 0x0d4e, 0x0d4e,
- 0x0d57, 0x0d57,
- 0x0d60, 0x0d63,
- 0x0d66, 0x0d6f,
- 0x0d7a, 0x0d7f,
- 0x0d82, 0x0d83,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df3,
- 0x0e01, 0x0e3a,
- 0x0e40, 0x0e46,
- 0x0e4d, 0x0e4d,
- 0x0e50, 0x0e59,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ecd, 0x0ecd,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f00,
- 0x0f20, 0x0f29,
- 0x0f40, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f71, 0x0f81,
- 0x0f88, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x1000, 0x1036,
- 0x1038, 0x1038,
- 0x103b, 0x1049,
- 0x1050, 0x1062,
- 0x1065, 0x1068,
- 0x106e, 0x1086,
- 0x108e, 0x108e,
- 0x1090, 0x1099,
- 0x109c, 0x109d,
- 0x10a0, 0x10c5,
- 0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135f, 0x135f,
- 0x1380, 0x138f,
- 0x13a0, 0x13f4,
- 0x1401, 0x166c,
- 0x166f, 0x167f,
- 0x1681, 0x169a,
- 0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
- 0x1700, 0x170c,
- 0x170e, 0x1713,
- 0x1720, 0x1733,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17b3,
- 0x17b6, 0x17c8,
- 0x17d7, 0x17d7,
- 0x17dc, 0x17dc,
- 0x17e0, 0x17e9,
- 0x1810, 0x1819,
- 0x1820, 0x1877,
- 0x1880, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191c,
- 0x1920, 0x192b,
- 0x1930, 0x1938,
- 0x1946, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x19d0, 0x19d9,
- 0x1a00, 0x1a1b,
- 0x1a20, 0x1a5e,
- 0x1a61, 0x1a74,
- 0x1a80, 0x1a89,
- 0x1a90, 0x1a99,
- 0x1aa7, 0x1aa7,
- 0x1b00, 0x1b33,
- 0x1b35, 0x1b43,
- 0x1b45, 0x1b4b,
- 0x1b50, 0x1b59,
- 0x1b80, 0x1ba9,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1be5,
- 0x1be7, 0x1bf1,
- 0x1c00, 0x1c35,
- 0x1c40, 0x1c49,
- 0x1c4d, 0x1c7d,
- 0x1ce9, 0x1cec,
- 0x1cee, 0x1cf2,
- 0x1d00, 0x1dbf,
- 0x1e00, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fbc,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fcc,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fe0, 0x1fec,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffc,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x209c,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x212f, 0x2139,
- 0x213c, 0x213f,
- 0x2145, 0x2149,
- 0x214e, 0x214e,
- 0x2160, 0x2188,
- 0x24b6, 0x24e9,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2ce4,
- 0x2ceb, 0x2cee,
- 0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
- 0x2d6f, 0x2d6f,
- 0x2d80, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2de0, 0x2dff,
- 0x2e2f, 0x2e2f,
- 0x3005, 0x3007,
- 0x3021, 0x3029,
- 0x3031, 0x3035,
- 0x3038, 0x303c,
- 0x3041, 0x3096,
- 0x309d, 0x309f,
- 0x30a1, 0x30fa,
- 0x30fc, 0x30ff,
- 0x3105, 0x312d,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa62b,
- 0xa640, 0xa66e,
- 0xa67f, 0xa697,
- 0xa6a0, 0xa6ef,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa801,
- 0xa803, 0xa805,
- 0xa807, 0xa80a,
- 0xa80c, 0xa827,
- 0xa840, 0xa873,
- 0xa880, 0xa8c3,
- 0xa8d0, 0xa8d9,
- 0xa8f2, 0xa8f7,
- 0xa8fb, 0xa8fb,
- 0xa900, 0xa92a,
- 0xa930, 0xa952,
- 0xa960, 0xa97c,
- 0xa980, 0xa9b2,
- 0xa9b4, 0xa9bf,
- 0xa9cf, 0xa9d9,
- 0xaa00, 0xaa36,
- 0xaa40, 0xaa4d,
- 0xaa50, 0xaa59,
- 0xaa60, 0xaa76,
- 0xaa7a, 0xaa7a,
- 0xaa80, 0xaabe,
- 0xaac0, 0xaac0,
- 0xaac2, 0xaac2,
- 0xaadb, 0xaadd,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xabc0, 0xabea,
- 0xabf0, 0xabf9,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb28,
- 0xfb2a, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3d,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfb,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xff10, 0xff19,
- 0xff21, 0xff3a,
- 0xff41, 0xff5a,
- 0xff66, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10140, 0x10174,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x10300, 0x1031e,
- 0x10330, 0x1034a,
- 0x10380, 0x1039d,
- 0x103a0, 0x103c3,
- 0x103c8, 0x103cf,
- 0x103d1, 0x103d5,
- 0x10400, 0x1049d,
- 0x104a0, 0x104a9,
- 0x10800, 0x10805,
- 0x10808, 0x10808,
- 0x1080a, 0x10835,
- 0x10837, 0x10838,
- 0x1083c, 0x1083c,
- 0x1083f, 0x10855,
- 0x10900, 0x10915,
- 0x10920, 0x10939,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x10a60, 0x10a7c,
- 0x10b00, 0x10b35,
- 0x10b40, 0x10b55,
- 0x10b60, 0x10b72,
- 0x10c00, 0x10c48,
- 0x11000, 0x11045,
- 0x11066, 0x1106f,
- 0x11082, 0x110b8,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x13000, 0x1342e,
- 0x16800, 0x16a38,
- 0x1b000, 0x1b001,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d6c0,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6fa,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d734,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d76e,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d7a8,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7cb,
- 0x1d7ce, 0x1d7ff,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2f800, 0x2fa1d,
-}; /* CR_Alnum */
+/* 'In_Supplementary_Private_Use_Area_A': Block */
+static const OnigCodePoint CR_In_Supplementary_Private_Use_Area_A[] = {
+ 1,
+ 0xf0000, 0xfffff,
+}; /* CR_In_Supplementary_Private_Use_Area_A */
-/* 'ASCII': [[:ASCII:]] */
-static const OnigCodePoint CR_ASCII[] = {
+/* 'In_Supplementary_Private_Use_Area_B': Block */
+static const OnigCodePoint CR_In_Supplementary_Private_Use_Area_B[] = {
1,
- 0x0000, 0x007f,
-}; /* CR_ASCII */
+ 0x100000, 0x10ffff,
+}; /* CR_In_Supplementary_Private_Use_Area_B */
+
+/* 'In_No_Block': Block */
+static const OnigCodePoint CR_In_No_Block[] = {
+ 36,
+ 0x0860, 0x089f,
+ 0x1ab0, 0x1aff,
+ 0x1c80, 0x1cbf,
+ 0x2fe0, 0x2fef,
+ 0xa9e0, 0xa9ff,
+ 0xab30, 0xabbf,
+ 0x10200, 0x1027f,
+ 0x102e0, 0x102ff,
+ 0x10350, 0x1037f,
+ 0x103e0, 0x103ff,
+ 0x104b0, 0x107ff,
+ 0x10860, 0x108ff,
+ 0x10940, 0x1097f,
+ 0x10a80, 0x10aff,
+ 0x10b80, 0x10bff,
+ 0x10c50, 0x10e5f,
+ 0x10e80, 0x10fff,
+ 0x11150, 0x1117f,
+ 0x111e0, 0x1167f,
+ 0x116d0, 0x11fff,
+ 0x12480, 0x12fff,
+ 0x13430, 0x167ff,
+ 0x16a40, 0x16eff,
+ 0x16fa0, 0x1afff,
+ 0x1b100, 0x1cfff,
+ 0x1d250, 0x1d2ff,
+ 0x1d380, 0x1d3ff,
+ 0x1d800, 0x1edff,
+ 0x1ef00, 0x1efff,
+ 0x1f650, 0x1f67f,
+ 0x1f780, 0x1ffff,
+ 0x2a6e0, 0x2a6ff,
+ 0x2b820, 0x2f7ff,
+ 0x2fa20, 0xdffff,
+ 0xe0080, 0xe00ff,
+ 0xe01f0, 0xeffff,
+}; /* CR_In_No_Block */
+#endif /* USE_UNICODE_PROPERTIES */
static const OnigCodePoint* const CodeRanges[] = {
CR_NEWLINE,
@@ -21973,7 +25510,6 @@ static const OnigCodePoint* const CodeRanges[] = {
CR_Alnum,
CR_ASCII,
#ifdef USE_UNICODE_PROPERTIES
-#ifdef USE_UNICODE_PROPERTIES
CR_Any,
CR_Assigned,
CR_C,
@@ -21983,6 +25519,7 @@ static const OnigCodePoint* const CodeRanges[] = {
CR_Co,
CR_Cs,
CR_L,
+ CR_LC,
CR_Ll,
CR_Lm,
CR_Lo,
@@ -22127,6 +25664,13 @@ static const OnigCodePoint* const CodeRanges[] = {
CR_Batak,
CR_Brahmi,
CR_Mandaic,
+ CR_Chakma,
+ CR_Meroitic_Cursive,
+ CR_Meroitic_Hieroglyphs,
+ CR_Miao,
+ CR_Sharada,
+ CR_Sora_Sompeng,
+ CR_Takri,
CR_White_Space,
CR_Bidi_Control,
CR_Join_Control,
@@ -22172,7 +25716,228 @@ static const OnigCodePoint* const CodeRanges[] = {
CR_Age_5_1,
CR_Age_5_2,
CR_Age_6_0,
-#endif /* USE_UNICODE_PROPERTIES */
+ CR_Age_6_1,
+ CR_In_Basic_Latin,
+ CR_In_Latin_1_Supplement,
+ CR_In_Latin_Extended_A,
+ CR_In_Latin_Extended_B,
+ CR_In_IPA_Extensions,
+ CR_In_Spacing_Modifier_Letters,
+ CR_In_Combining_Diacritical_Marks,
+ CR_In_Greek_and_Coptic,
+ CR_In_Cyrillic,
+ CR_In_Cyrillic_Supplement,
+ CR_In_Armenian,
+ CR_In_Hebrew,
+ CR_In_Arabic,
+ CR_In_Syriac,
+ CR_In_Arabic_Supplement,
+ CR_In_Thaana,
+ CR_In_NKo,
+ CR_In_Samaritan,
+ CR_In_Mandaic,
+ CR_In_Arabic_Extended_A,
+ CR_In_Devanagari,
+ CR_In_Bengali,
+ CR_In_Gurmukhi,
+ CR_In_Gujarati,
+ CR_In_Oriya,
+ CR_In_Tamil,
+ CR_In_Telugu,
+ CR_In_Kannada,
+ CR_In_Malayalam,
+ CR_In_Sinhala,
+ CR_In_Thai,
+ CR_In_Lao,
+ CR_In_Tibetan,
+ CR_In_Myanmar,
+ CR_In_Georgian,
+ CR_In_Hangul_Jamo,
+ CR_In_Ethiopic,
+ CR_In_Ethiopic_Supplement,
+ CR_In_Cherokee,
+ CR_In_Unified_Canadian_Aboriginal_Syllabics,
+ CR_In_Ogham,
+ CR_In_Runic,
+ CR_In_Tagalog,
+ CR_In_Hanunoo,
+ CR_In_Buhid,
+ CR_In_Tagbanwa,
+ CR_In_Khmer,
+ CR_In_Mongolian,
+ CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended,
+ CR_In_Limbu,
+ CR_In_Tai_Le,
+ CR_In_New_Tai_Lue,
+ CR_In_Khmer_Symbols,
+ CR_In_Buginese,
+ CR_In_Tai_Tham,
+ CR_In_Balinese,
+ CR_In_Sundanese,
+ CR_In_Batak,
+ CR_In_Lepcha,
+ CR_In_Ol_Chiki,
+ CR_In_Sundanese_Supplement,
+ CR_In_Vedic_Extensions,
+ CR_In_Phonetic_Extensions,
+ CR_In_Phonetic_Extensions_Supplement,
+ CR_In_Combining_Diacritical_Marks_Supplement,
+ CR_In_Latin_Extended_Additional,
+ CR_In_Greek_Extended,
+ CR_In_General_Punctuation,
+ CR_In_Superscripts_and_Subscripts,
+ CR_In_Currency_Symbols,
+ CR_In_Combining_Diacritical_Marks_for_Symbols,
+ CR_In_Letterlike_Symbols,
+ CR_In_Number_Forms,
+ CR_In_Arrows,
+ CR_In_Mathematical_Operators,
+ CR_In_Miscellaneous_Technical,
+ CR_In_Control_Pictures,
+ CR_In_Optical_Character_Recognition,
+ CR_In_Enclosed_Alphanumerics,
+ CR_In_Box_Drawing,
+ CR_In_Block_Elements,
+ CR_In_Geometric_Shapes,
+ CR_In_Miscellaneous_Symbols,
+ CR_In_Dingbats,
+ CR_In_Miscellaneous_Mathematical_Symbols_A,
+ CR_In_Supplemental_Arrows_A,
+ CR_In_Braille_Patterns,
+ CR_In_Supplemental_Arrows_B,
+ CR_In_Miscellaneous_Mathematical_Symbols_B,
+ CR_In_Supplemental_Mathematical_Operators,
+ CR_In_Miscellaneous_Symbols_and_Arrows,
+ CR_In_Glagolitic,
+ CR_In_Latin_Extended_C,
+ CR_In_Coptic,
+ CR_In_Georgian_Supplement,
+ CR_In_Tifinagh,
+ CR_In_Ethiopic_Extended,
+ CR_In_Cyrillic_Extended_A,
+ CR_In_Supplemental_Punctuation,
+ CR_In_CJK_Radicals_Supplement,
+ CR_In_Kangxi_Radicals,
+ CR_In_Ideographic_Description_Characters,
+ CR_In_CJK_Symbols_and_Punctuation,
+ CR_In_Hiragana,
+ CR_In_Katakana,
+ CR_In_Bopomofo,
+ CR_In_Hangul_Compatibility_Jamo,
+ CR_In_Kanbun,
+ CR_In_Bopomofo_Extended,
+ CR_In_CJK_Strokes,
+ CR_In_Katakana_Phonetic_Extensions,
+ CR_In_Enclosed_CJK_Letters_and_Months,
+ CR_In_CJK_Compatibility,
+ CR_In_CJK_Unified_Ideographs_Extension_A,
+ CR_In_Yijing_Hexagram_Symbols,
+ CR_In_CJK_Unified_Ideographs,
+ CR_In_Yi_Syllables,
+ CR_In_Yi_Radicals,
+ CR_In_Lisu,
+ CR_In_Vai,
+ CR_In_Cyrillic_Extended_B,
+ CR_In_Bamum,
+ CR_In_Modifier_Tone_Letters,
+ CR_In_Latin_Extended_D,
+ CR_In_Syloti_Nagri,
+ CR_In_Common_Indic_Number_Forms,
+ CR_In_Phags_pa,
+ CR_In_Saurashtra,
+ CR_In_Devanagari_Extended,
+ CR_In_Kayah_Li,
+ CR_In_Rejang,
+ CR_In_Hangul_Jamo_Extended_A,
+ CR_In_Javanese,
+ CR_In_Cham,
+ CR_In_Myanmar_Extended_A,
+ CR_In_Tai_Viet,
+ CR_In_Meetei_Mayek_Extensions,
+ CR_In_Ethiopic_Extended_A,
+ CR_In_Meetei_Mayek,
+ CR_In_Hangul_Syllables,
+ CR_In_Hangul_Jamo_Extended_B,
+ CR_In_High_Surrogates,
+ CR_In_High_Private_Use_Surrogates,
+ CR_In_Low_Surrogates,
+ CR_In_Private_Use_Area,
+ CR_In_CJK_Compatibility_Ideographs,
+ CR_In_Alphabetic_Presentation_Forms,
+ CR_In_Arabic_Presentation_Forms_A,
+ CR_In_Variation_Selectors,
+ CR_In_Vertical_Forms,
+ CR_In_Combining_Half_Marks,
+ CR_In_CJK_Compatibility_Forms,
+ CR_In_Small_Form_Variants,
+ CR_In_Arabic_Presentation_Forms_B,
+ CR_In_Halfwidth_and_Fullwidth_Forms,
+ CR_In_Specials,
+ CR_In_Linear_B_Syllabary,
+ CR_In_Linear_B_Ideograms,
+ CR_In_Aegean_Numbers,
+ CR_In_Ancient_Greek_Numbers,
+ CR_In_Ancient_Symbols,
+ CR_In_Phaistos_Disc,
+ CR_In_Lycian,
+ CR_In_Carian,
+ CR_In_Old_Italic,
+ CR_In_Gothic,
+ CR_In_Ugaritic,
+ CR_In_Old_Persian,
+ CR_In_Deseret,
+ CR_In_Shavian,
+ CR_In_Osmanya,
+ CR_In_Cypriot_Syllabary,
+ CR_In_Imperial_Aramaic,
+ CR_In_Phoenician,
+ CR_In_Lydian,
+ CR_In_Meroitic_Hieroglyphs,
+ CR_In_Meroitic_Cursive,
+ CR_In_Kharoshthi,
+ CR_In_Old_South_Arabian,
+ CR_In_Avestan,
+ CR_In_Inscriptional_Parthian,
+ CR_In_Inscriptional_Pahlavi,
+ CR_In_Old_Turkic,
+ CR_In_Rumi_Numeral_Symbols,
+ CR_In_Brahmi,
+ CR_In_Kaithi,
+ CR_In_Sora_Sompeng,
+ CR_In_Chakma,
+ CR_In_Sharada,
+ CR_In_Takri,
+ CR_In_Cuneiform,
+ CR_In_Cuneiform_Numbers_and_Punctuation,
+ CR_In_Egyptian_Hieroglyphs,
+ CR_In_Bamum_Supplement,
+ CR_In_Miao,
+ CR_In_Kana_Supplement,
+ CR_In_Byzantine_Musical_Symbols,
+ CR_In_Musical_Symbols,
+ CR_In_Ancient_Greek_Musical_Notation,
+ CR_In_Tai_Xuan_Jing_Symbols,
+ CR_In_Counting_Rod_Numerals,
+ CR_In_Mathematical_Alphanumeric_Symbols,
+ CR_In_Arabic_Mathematical_Alphabetic_Symbols,
+ CR_In_Mahjong_Tiles,
+ CR_In_Domino_Tiles,
+ CR_In_Playing_Cards,
+ CR_In_Enclosed_Alphanumeric_Supplement,
+ CR_In_Enclosed_Ideographic_Supplement,
+ CR_In_Miscellaneous_Symbols_And_Pictographs,
+ CR_In_Emoticons,
+ CR_In_Transport_And_Map_Symbols,
+ CR_In_Alchemical_Symbols,
+ CR_In_CJK_Unified_Ideographs_Extension_B,
+ CR_In_CJK_Unified_Ideographs_Extension_C,
+ CR_In_CJK_Unified_Ideographs_Extension_D,
+ CR_In_CJK_Compatibility_Ideographs_Supplement,
+ CR_In_Tags,
+ CR_In_Variation_Selectors_Supplement,
+ CR_In_Supplementary_Private_Use_Area_A,
+ CR_In_Supplementary_Private_Use_Area_B,
+ CR_In_No_Block,
#endif /* USE_UNICODE_PROPERTIES */
};
struct uniname2ctype_struct {
@@ -22182,19 +25947,19 @@ struct uniname2ctype_struct {
static const struct uniname2ctype_struct *uniname2ctype_p(const char *, unsigned int);
#ifndef USE_UNICODE_PROPERTIES
-#define TOTAL_KEYWORDS 15
+#define TOTAL_KEYWORDS 14
#define MIN_WORD_LENGTH 4
-#define MAX_WORD_LENGTH 7
-#define MIN_HASH_VALUE 7
-#define MAX_HASH_VALUE 21
-/* maximum key range = 15, duplicates = 0 */
+#define MAX_WORD_LENGTH 6
+#define MIN_HASH_VALUE 6
+#define MAX_HASH_VALUE 19
+/* maximum key range = 14, duplicates = 0 */
#else /* USE_UNICODE_PROPERTIES */
-#define TOTAL_KEYWORDS 387
+#define TOTAL_KEYWORDS 625
#define MIN_WORD_LENGTH 1
-#define MAX_WORD_LENGTH 30
+#define MAX_WORD_LENGTH 44
#define MIN_HASH_VALUE 3
-#define MAX_HASH_VALUE 1741
-/* maximum key range = 1739, duplicates = 0 */
+#define MAX_HASH_VALUE 4167
+/* maximum key range = 4165, duplicates = 0 */
#endif /* USE_UNICODE_PROPERTIES */
#ifdef __GNUC__
@@ -22216,33 +25981,33 @@ uniname2ctype_hash (str, len)
#endif /* USE_UNICODE_PROPERTIES */
{
#ifndef USE_UNICODE_PROPERTIES
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 3, 13, 6,
- 4, 22, 22, 11, 22, 1, 22, 22, 10, 22,
- 2, 22, 1, 22, 10, 8, 4, 7, 22, 3,
- 4, 22, 22, 22, 22, 22, 22, 22
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 3, 11, 5,
+ 4, 20, 20, 9, 20, 1, 20, 20, 10, 20,
+ 2, 20, 1, 20, 1, 7, 4, 6, 20, 1,
+ 4, 20, 20, 20, 20, 20, 20, 20
#else /* USE_UNICODE_PROPERTIES */
- 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742,
- 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742,
- 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742,
- 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742,
- 1742, 1742, 1742, 1742, 1742, 1742, 2, 1742, 9, 1,
- 2, 18, 5, 3, 4, 1742, 1742, 1742, 1742, 1742,
- 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742,
- 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742,
- 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742, 1742,
- 1742, 1742, 1742, 1742, 1742, 1742, 1742, 8, 280, 6,
- 96, 67, 362, 294, 38, 9, 63, 517, 2, 213,
- 1, 4, 192, 3, 10, 57, 31, 316, 1, 549,
- 330, 567, 36, 1742, 1742, 1742, 1742, 1742
+ 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168,
+ 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168,
+ 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168,
+ 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168,
+ 4168, 4168, 4168, 4168, 4168, 4168, 1, 4168, 13, 1,
+ 3, 28, 31, 10, 27, 4168, 4168, 4168, 4168, 4168,
+ 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168,
+ 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168,
+ 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168,
+ 4168, 4168, 4168, 4168, 4168, 4168, 4168, 13, 854, 14,
+ 443, 19, 7, 570, 335, 4, 66, 1159, 102, 34,
+ 1, 178, 474, 1, 192, 2, 64, 1117, 491, 264,
+ 256, 1305, 3, 4168, 4168, 4168, 4168, 4168
#endif /* USE_UNICODE_PROPERTIES */
};
#ifndef USE_UNICODE_PROPERTIES
@@ -22290,823 +26055,1298 @@ uniname2ctype_hash (str, len)
struct uniname2ctype_pool_t
{
#ifndef USE_UNICODE_PROPERTIES
+ char uniname2ctype_pool_str6[sizeof("word")];
char uniname2ctype_pool_str7[sizeof("print")];
char uniname2ctype_pool_str8[sizeof("punct")];
char uniname2ctype_pool_str9[sizeof("alpha")];
char uniname2ctype_pool_str10[sizeof("alnum")];
char uniname2ctype_pool_str11[sizeof("xdigit")];
- char uniname2ctype_pool_str12[sizeof("newline")];
- char uniname2ctype_pool_str13[sizeof("upper")];
- char uniname2ctype_pool_str14[sizeof("ascii")];
- char uniname2ctype_pool_str15[sizeof("cntrl")];
- char uniname2ctype_pool_str16[sizeof("space")];
- char uniname2ctype_pool_str17[sizeof("word")];
- char uniname2ctype_pool_str18[sizeof("lower")];
- char uniname2ctype_pool_str19[sizeof("graph")];
- char uniname2ctype_pool_str20[sizeof("digit")];
- char uniname2ctype_pool_str21[sizeof("blank")];
+ char uniname2ctype_pool_str12[sizeof("upper")];
+ char uniname2ctype_pool_str13[sizeof("ascii")];
+ char uniname2ctype_pool_str14[sizeof("cntrl")];
+ char uniname2ctype_pool_str15[sizeof("space")];
+ char uniname2ctype_pool_str16[sizeof("lower")];
+ char uniname2ctype_pool_str17[sizeof("graph")];
+ char uniname2ctype_pool_str18[sizeof("digit")];
+ char uniname2ctype_pool_str19[sizeof("blank")];
#else /* USE_UNICODE_PROPERTIES */
char uniname2ctype_pool_str3[sizeof("n")];
- char uniname2ctype_pool_str5[sizeof("l")];
- char uniname2ctype_pool_str7[sizeof("nl")];
- char uniname2ctype_pool_str8[sizeof("ll")];
- char uniname2ctype_pool_str10[sizeof("cn")];
- char uniname2ctype_pool_str11[sizeof("no")];
- char uniname2ctype_pool_str12[sizeof("lo")];
- char uniname2ctype_pool_str13[sizeof("c")];
- char uniname2ctype_pool_str16[sizeof("co")];
- char uniname2ctype_pool_str20[sizeof("cc")];
- char uniname2ctype_pool_str21[sizeof("lao")];
- char uniname2ctype_pool_str22[sizeof("laoo")];
- char uniname2ctype_pool_str23[sizeof("lana")];
- char uniname2ctype_pool_str26[sizeof("ci")];
- char uniname2ctype_pool_str29[sizeof("qaac")];
- char uniname2ctype_pool_str30[sizeof("vai")];
- char uniname2ctype_pool_str31[sizeof("vaii")];
- char uniname2ctype_pool_str32[sizeof("qaai")];
- char uniname2ctype_pool_str34[sizeof("control")];
- char uniname2ctype_pool_str37[sizeof("cari")];
- char uniname2ctype_pool_str40[sizeof("carian")];
- char uniname2ctype_pool_str42[sizeof("zl")];
- char uniname2ctype_pool_str44[sizeof("oriya")];
- char uniname2ctype_pool_str46[sizeof("latn")];
- char uniname2ctype_pool_str47[sizeof("cntrl")];
- char uniname2ctype_pool_str48[sizeof("latin")];
- char uniname2ctype_pool_str51[sizeof("han")];
- char uniname2ctype_pool_str53[sizeof("arabic")];
- char uniname2ctype_pool_str54[sizeof("ital")];
- char uniname2ctype_pool_str55[sizeof("hano")];
- char uniname2ctype_pool_str60[sizeof("hani")];
- char uniname2ctype_pool_str63[sizeof("hanunoo")];
- char uniname2ctype_pool_str66[sizeof("lt")];
- char uniname2ctype_pool_str67[sizeof("so")];
- char uniname2ctype_pool_str69[sizeof("hira")];
- char uniname2ctype_pool_str70[sizeof("nchar")];
- char uniname2ctype_pool_str71[sizeof("sc")];
- char uniname2ctype_pool_str73[sizeof("z")];
- char uniname2ctype_pool_str74[sizeof("oalpha")];
- char uniname2ctype_pool_str75[sizeof("tavt")];
- char uniname2ctype_pool_str76[sizeof("cans")];
- char uniname2ctype_pool_str84[sizeof("java")];
- char uniname2ctype_pool_str88[sizeof("zinh")];
- char uniname2ctype_pool_str89[sizeof("thaa")];
- char uniname2ctype_pool_str90[sizeof("thai")];
- char uniname2ctype_pool_str91[sizeof("variationselector")];
- char uniname2ctype_pool_str92[sizeof("sinhala")];
- char uniname2ctype_pool_str93[sizeof("joinc")];
- char uniname2ctype_pool_str94[sizeof("ascii")];
- char uniname2ctype_pool_str95[sizeof("initialpunctuation")];
- char uniname2ctype_pool_str98[sizeof("other")];
- char uniname2ctype_pool_str99[sizeof("joincontrol")];
- char uniname2ctype_pool_str100[sizeof("thaana")];
- char uniname2ctype_pool_str101[sizeof("avst")];
- char uniname2ctype_pool_str103[sizeof("olower")];
- char uniname2ctype_pool_str105[sizeof("othernumber")];
- char uniname2ctype_pool_str106[sizeof("otherletter")];
- char uniname2ctype_pool_str109[sizeof("sinh")];
- char uniname2ctype_pool_str112[sizeof("tale")];
- char uniname2ctype_pool_str114[sizeof("connectorpunctuation")];
- char uniname2ctype_pool_str115[sizeof("s")];
- char uniname2ctype_pool_str116[sizeof("di")];
- char uniname2ctype_pool_str117[sizeof("vs")];
- char uniname2ctype_pool_str119[sizeof("oidc")];
- char uniname2ctype_pool_str120[sizeof("idc")];
- char uniname2ctype_pool_str121[sizeof("odi")];
- char uniname2ctype_pool_str122[sizeof("cs")];
- char uniname2ctype_pool_str123[sizeof("avestan")];
- char uniname2ctype_pool_str124[sizeof("dia")];
- char uniname2ctype_pool_str125[sizeof("cher")];
- char uniname2ctype_pool_str126[sizeof("inscriptionalparthian")];
- char uniname2ctype_pool_str128[sizeof("shavian")];
- char uniname2ctype_pool_str137[sizeof("radical")];
- char uniname2ctype_pool_str143[sizeof("loe")];
- char uniname2ctype_pool_str147[sizeof("diacritic")];
- char uniname2ctype_pool_str148[sizeof("zzzz")];
- char uniname2ctype_pool_str149[sizeof("ethi")];
- char uniname2ctype_pool_str151[sizeof("canadianaboriginal")];
- char uniname2ctype_pool_str152[sizeof("zs")];
- char uniname2ctype_pool_str153[sizeof("othersymbol")];
- char uniname2ctype_pool_str156[sizeof("olditalic")];
- char uniname2ctype_pool_str161[sizeof("inscriptionalpahlavi")];
- char uniname2ctype_pool_str162[sizeof("taiviet")];
- char uniname2ctype_pool_str163[sizeof("lineseparator")];
- char uniname2ctype_pool_str166[sizeof("otheridstart")];
- char uniname2ctype_pool_str170[sizeof("oids")];
- char uniname2ctype_pool_str171[sizeof("asciihexdigit")];
- char uniname2ctype_pool_str172[sizeof("inherited")];
- char uniname2ctype_pool_str174[sizeof("otherlowercase")];
- char uniname2ctype_pool_str175[sizeof("terminalpunctuation")];
- char uniname2ctype_pool_str176[sizeof("deva")];
- char uniname2ctype_pool_str179[sizeof("otheralphabetic")];
- char uniname2ctype_pool_str180[sizeof("ideo")];
- char uniname2ctype_pool_str181[sizeof("noncharactercodepoint")];
- char uniname2ctype_pool_str183[sizeof("otheridcontinue")];
- char uniname2ctype_pool_str187[sizeof("taile")];
- char uniname2ctype_pool_str190[sizeof("oldpersian")];
- char uniname2ctype_pool_str192[sizeof("devanagari")];
- char uniname2ctype_pool_str193[sizeof("letter")];
- char uniname2ctype_pool_str195[sizeof("nd")];
- char uniname2ctype_pool_str197[sizeof("idst")];
- char uniname2ctype_pool_str198[sizeof("dsrt")];
- char uniname2ctype_pool_str200[sizeof("titlecaseletter")];
- char uniname2ctype_pool_str202[sizeof("po")];
- char uniname2ctype_pool_str203[sizeof("dash")];
- char uniname2ctype_pool_str206[sizeof("pc")];
- char uniname2ctype_pool_str209[sizeof("letternumber")];
- char uniname2ctype_pool_str212[sizeof("pi")];
- char uniname2ctype_pool_str215[sizeof("javanese")];
- char uniname2ctype_pool_str217[sizeof("mn")];
- char uniname2ctype_pool_str218[sizeof("idstart")];
- char uniname2ctype_pool_str220[sizeof("idcontinue")];
- char uniname2ctype_pool_str222[sizeof("ids")];
- char uniname2ctype_pool_str223[sizeof("alpha")];
- char uniname2ctype_pool_str227[sizeof("mc")];
- char uniname2ctype_pool_str229[sizeof("coptic")];
- char uniname2ctype_pool_str234[sizeof("mongolian")];
- char uniname2ctype_pool_str235[sizeof("common")];
- char uniname2ctype_pool_str236[sizeof("armn")];
- char uniname2ctype_pool_str237[sizeof("copt")];
- char uniname2ctype_pool_str243[sizeof("cprt")];
- char uniname2ctype_pool_str244[sizeof("armi")];
- char uniname2ctype_pool_str245[sizeof("phli")];
- char uniname2ctype_pool_str246[sizeof("prti")];
- char uniname2ctype_pool_str250[sizeof("armenian")];
- char uniname2ctype_pool_str251[sizeof("sd")];
- char uniname2ctype_pool_str252[sizeof("mandaic")];
- char uniname2ctype_pool_str255[sizeof("phoenician")];
- char uniname2ctype_pool_str258[sizeof("taml")];
- char uniname2ctype_pool_str261[sizeof("tamil")];
- char uniname2ctype_pool_str268[sizeof("cased")];
- char uniname2ctype_pool_str269[sizeof("cham")];
- char uniname2ctype_pool_str270[sizeof("idsbinaryoperator")];
- char uniname2ctype_pool_str271[sizeof("lepc")];
- char uniname2ctype_pool_str275[sizeof("otherdefaultignorablecodepoint")];
- char uniname2ctype_pool_str278[sizeof("print")];
- char uniname2ctype_pool_str286[sizeof("osma")];
- char uniname2ctype_pool_str292[sizeof("samr")];
- char uniname2ctype_pool_str294[sizeof("math")];
- char uniname2ctype_pool_str296[sizeof("linb")];
- char uniname2ctype_pool_str297[sizeof("closepunctuation")];
- char uniname2ctype_pool_str301[sizeof("otherpunctuation")];
- char uniname2ctype_pool_str303[sizeof("bali")];
- char uniname2ctype_pool_str306[sizeof("omath")];
- char uniname2ctype_pool_str307[sizeof("samaritan")];
- char uniname2ctype_pool_str308[sizeof("ps")];
- char uniname2ctype_pool_str310[sizeof("arab")];
- char uniname2ctype_pool_str311[sizeof("brai")];
- char uniname2ctype_pool_str314[sizeof("taitham")];
- char uniname2ctype_pool_str317[sizeof("linearb")];
- char uniname2ctype_pool_str321[sizeof("lepcha")];
- char uniname2ctype_pool_str322[sizeof("mand")];
- char uniname2ctype_pool_str324[sizeof("mtei")];
- char uniname2ctype_pool_str325[sizeof("term")];
- char uniname2ctype_pool_str326[sizeof("glagolitic")];
- char uniname2ctype_pool_str327[sizeof("privateuse")];
- char uniname2ctype_pool_str328[sizeof("pe")];
- char uniname2ctype_pool_str335[sizeof("deseret")];
- char uniname2ctype_pool_str340[sizeof("brah")];
- char uniname2ctype_pool_str341[sizeof("runr")];
- char uniname2ctype_pool_str343[sizeof("othermath")];
- char uniname2ctype_pool_str344[sizeof("runic")];
- char uniname2ctype_pool_str345[sizeof("hang")];
- char uniname2ctype_pool_str346[sizeof("ethiopic")];
- char uniname2ctype_pool_str349[sizeof("me")];
- char uniname2ctype_pool_str350[sizeof("patws")];
- char uniname2ctype_pool_str353[sizeof("separator")];
- char uniname2ctype_pool_str355[sizeof("tibt")];
- char uniname2ctype_pool_str356[sizeof("gothic")];
- char uniname2ctype_pool_str358[sizeof("tagbanwa")];
- char uniname2ctype_pool_str359[sizeof("sarb")];
- char uniname2ctype_pool_str361[sizeof("talu")];
- char uniname2ctype_pool_str367[sizeof("tibetan")];
- char uniname2ctype_pool_str371[sizeof("goth")];
- char uniname2ctype_pool_str372[sizeof("rjng")];
- char uniname2ctype_pool_str373[sizeof("hangul")];
- char uniname2ctype_pool_str374[sizeof("bengali")];
- char uniname2ctype_pool_str375[sizeof("hiragana")];
- char uniname2ctype_pool_str376[sizeof("braille")];
- char uniname2ctype_pool_str379[sizeof("geor")];
- char uniname2ctype_pool_str380[sizeof("age=1.1")];
- char uniname2ctype_pool_str381[sizeof("age=2.1")];
- char uniname2ctype_pool_str382[sizeof("age=5.1")];
- char uniname2ctype_pool_str383[sizeof("age=5.2")];
- char uniname2ctype_pool_str384[sizeof("age=4.1")];
- char uniname2ctype_pool_str385[sizeof("p")];
- char uniname2ctype_pool_str386[sizeof("pd")];
- char uniname2ctype_pool_str388[sizeof("lisu")];
- char uniname2ctype_pool_str389[sizeof("age=2.0")];
- char uniname2ctype_pool_str390[sizeof("age=5.0")];
- char uniname2ctype_pool_str391[sizeof("age=6.0")];
- char uniname2ctype_pool_str392[sizeof("age=4.0")];
- char uniname2ctype_pool_str393[sizeof("graph")];
- char uniname2ctype_pool_str395[sizeof("saur")];
- char uniname2ctype_pool_str396[sizeof("space")];
- char uniname2ctype_pool_str397[sizeof("age=3.1")];
- char uniname2ctype_pool_str398[sizeof("age=3.2")];
- char uniname2ctype_pool_str399[sizeof("hebr")];
- char uniname2ctype_pool_str402[sizeof("bidic")];
- char uniname2ctype_pool_str405[sizeof("age=3.0")];
- char uniname2ctype_pool_str408[sizeof("bidicontrol")];
- char uniname2ctype_pool_str413[sizeof("logicalorderexception")];
- char uniname2ctype_pool_str420[sizeof("telu")];
- char uniname2ctype_pool_str422[sizeof("zp")];
- char uniname2ctype_pool_str427[sizeof("m")];
- char uniname2ctype_pool_str430[sizeof("lm")];
- char uniname2ctype_pool_str432[sizeof("idstrinaryoperator")];
- char uniname2ctype_pool_str433[sizeof("balinese")];
- char uniname2ctype_pool_str434[sizeof("uideo")];
- char uniname2ctype_pool_str436[sizeof("spaceseparator")];
- char uniname2ctype_pool_str438[sizeof("grext")];
- char uniname2ctype_pool_str442[sizeof("alnum")];
- char uniname2ctype_pool_str443[sizeof("oldturkic")];
- char uniname2ctype_pool_str445[sizeof("xidc")];
- char uniname2ctype_pool_str446[sizeof("idsb")];
- char uniname2ctype_pool_str447[sizeof("ahex")];
- char uniname2ctype_pool_str452[sizeof("format")];
- char uniname2ctype_pool_str456[sizeof("caseignorable")];
- char uniname2ctype_pool_str457[sizeof("tifinagh")];
- char uniname2ctype_pool_str459[sizeof("sundanese")];
- char uniname2ctype_pool_str462[sizeof("ext")];
- char uniname2ctype_pool_str464[sizeof("saurashtra")];
- char uniname2ctype_pool_str465[sizeof("patternwhitespace")];
- char uniname2ctype_pool_str466[sizeof("digit")];
- char uniname2ctype_pool_str474[sizeof("sund")];
- char uniname2ctype_pool_str480[sizeof("decimalnumber")];
- char uniname2ctype_pool_str484[sizeof("bopo")];
- char uniname2ctype_pool_str485[sizeof("sm")];
- char uniname2ctype_pool_str488[sizeof("otheruppercase")];
- char uniname2ctype_pool_str493[sizeof("ideographic")];
- char uniname2ctype_pool_str496[sizeof("xids")];
- char uniname2ctype_pool_str497[sizeof("unassigned")];
- char uniname2ctype_pool_str502[sizeof("phagspa")];
- char uniname2ctype_pool_str506[sizeof("alphabetic")];
- char uniname2ctype_pool_str508[sizeof("limb")];
- char uniname2ctype_pool_str512[sizeof("xdigit")];
- char uniname2ctype_pool_str513[sizeof("xidstart")];
- char uniname2ctype_pool_str516[sizeof("mong")];
- char uniname2ctype_pool_str518[sizeof("xidcontinue")];
- char uniname2ctype_pool_str521[sizeof("assigned")];
- char uniname2ctype_pool_str523[sizeof("ogam")];
- char uniname2ctype_pool_str529[sizeof("nko")];
- char uniname2ctype_pool_str530[sizeof("nkoo")];
- char uniname2ctype_pool_str533[sizeof("olck")];
- char uniname2ctype_pool_str534[sizeof("deprecated")];
- char uniname2ctype_pool_str535[sizeof("brahmi")];
- char uniname2ctype_pool_str536[sizeof("phag")];
- char uniname2ctype_pool_str538[sizeof("kana")];
- char uniname2ctype_pool_str540[sizeof("kali")];
- char uniname2ctype_pool_str542[sizeof("changeswhenlowercased")];
- char uniname2ctype_pool_str543[sizeof("extender")];
- char uniname2ctype_pool_str550[sizeof("dep")];
- char uniname2ctype_pool_str554[sizeof("olchiki")];
- char uniname2ctype_pool_str562[sizeof("cwl")];
- char uniname2ctype_pool_str563[sizeof("graphemebase")];
- char uniname2ctype_pool_str565[sizeof("phnx")];
- char uniname2ctype_pool_str573[sizeof("orkh")];
- char uniname2ctype_pool_str576[sizeof("punct")];
- char uniname2ctype_pool_str577[sizeof("khar")];
- char uniname2ctype_pool_str580[sizeof("lower")];
- char uniname2ctype_pool_str586[sizeof("sterm")];
- char uniname2ctype_pool_str587[sizeof("yi")];
- char uniname2ctype_pool_str588[sizeof("lyci")];
- char uniname2ctype_pool_str589[sizeof("cyrl")];
- char uniname2ctype_pool_str591[sizeof("lycian")];
- char uniname2ctype_pool_str592[sizeof("finalpunctuation")];
- char uniname2ctype_pool_str593[sizeof("orya")];
- char uniname2ctype_pool_str594[sizeof("graphemeextend")];
- char uniname2ctype_pool_str596[sizeof("kaithi")];
- char uniname2ctype_pool_str597[sizeof("xpeo")];
- char uniname2ctype_pool_str598[sizeof("yiii")];
- char uniname2ctype_pool_str599[sizeof("kthi")];
- char uniname2ctype_pool_str601[sizeof("cyrillic")];
- char uniname2ctype_pool_str602[sizeof("glag")];
- char uniname2ctype_pool_str605[sizeof("oupper")];
- char uniname2ctype_pool_str617[sizeof("tagb")];
- char uniname2ctype_pool_str620[sizeof("cwt")];
- char uniname2ctype_pool_str623[sizeof("number")];
- char uniname2ctype_pool_str625[sizeof("tglg")];
- char uniname2ctype_pool_str626[sizeof("knda")];
- char uniname2ctype_pool_str627[sizeof("lowercaseletter")];
- char uniname2ctype_pool_str628[sizeof("changeswhentitlecased")];
- char uniname2ctype_pool_str629[sizeof("softdotted")];
- char uniname2ctype_pool_str632[sizeof("ugar")];
- char uniname2ctype_pool_str634[sizeof("sylo")];
- char uniname2ctype_pool_str636[sizeof("lu")];
- char uniname2ctype_pool_str640[sizeof("tagalog")];
- char uniname2ctype_pool_str643[sizeof("kharoshthi")];
- char uniname2ctype_pool_str644[sizeof("syrc")];
- char uniname2ctype_pool_str645[sizeof("kannada")];
- char uniname2ctype_pool_str646[sizeof("beng")];
- char uniname2ctype_pool_str647[sizeof("lowercase")];
- char uniname2ctype_pool_str656[sizeof("shaw")];
- char uniname2ctype_pool_str659[sizeof("patternsyntax")];
- char uniname2ctype_pool_str660[sizeof("syriac")];
- char uniname2ctype_pool_str663[sizeof("word")];
- char uniname2ctype_pool_str667[sizeof("imperialaramaic")];
- char uniname2ctype_pool_str672[sizeof("ugaritic")];
- char uniname2ctype_pool_str675[sizeof("enclosingmark")];
- char uniname2ctype_pool_str677[sizeof("georgian")];
- char uniname2ctype_pool_str678[sizeof("lydi")];
- char uniname2ctype_pool_str681[sizeof("lydian")];
- char uniname2ctype_pool_str686[sizeof("sylotinagri")];
- char uniname2ctype_pool_str687[sizeof("gujr")];
- char uniname2ctype_pool_str692[sizeof("tfng")];
- char uniname2ctype_pool_str696[sizeof("currencysymbol")];
- char uniname2ctype_pool_str701[sizeof("newline")];
- char uniname2ctype_pool_str705[sizeof("bopomofo")];
- char uniname2ctype_pool_str706[sizeof("ogrext")];
- char uniname2ctype_pool_str707[sizeof("cherokee")];
- char uniname2ctype_pool_str708[sizeof("gujarati")];
- char uniname2ctype_pool_str710[sizeof("newtailue")];
- char uniname2ctype_pool_str716[sizeof("dashpunctuation")];
- char uniname2ctype_pool_str718[sizeof("oldsoutharabian")];
- char uniname2ctype_pool_str725[sizeof("upper")];
- char uniname2ctype_pool_str732[sizeof("cf")];
- char uniname2ctype_pool_str734[sizeof("buhd")];
- char uniname2ctype_pool_str735[sizeof("rejang")];
- char uniname2ctype_pool_str736[sizeof("othergraphemeextend")];
- char uniname2ctype_pool_str739[sizeof("modifierletter")];
- char uniname2ctype_pool_str745[sizeof("nonspacingmark")];
- char uniname2ctype_pool_str749[sizeof("changeswhencasemapped")];
- char uniname2ctype_pool_str752[sizeof("mark")];
- char uniname2ctype_pool_str757[sizeof("surrogate")];
- char uniname2ctype_pool_str765[sizeof("paragraphseparator")];
- char uniname2ctype_pool_str767[sizeof("ogham")];
- char uniname2ctype_pool_str768[sizeof("hex")];
- char uniname2ctype_pool_str772[sizeof("uppercaseletter")];
- char uniname2ctype_pool_str777[sizeof("hexdigit")];
- char uniname2ctype_pool_str778[sizeof("cwcm")];
- char uniname2ctype_pool_str781[sizeof("grbase")];
- char uniname2ctype_pool_str782[sizeof("khmr")];
- char uniname2ctype_pool_str788[sizeof("unifiedideograph")];
- char uniname2ctype_pool_str792[sizeof("uppercase")];
- char uniname2ctype_pool_str793[sizeof("khmer")];
- char uniname2ctype_pool_str795[sizeof("spacingmark")];
- char uniname2ctype_pool_str797[sizeof("whitespace")];
- char uniname2ctype_pool_str806[sizeof("patsyn")];
- char uniname2ctype_pool_str816[sizeof("cypriot")];
- char uniname2ctype_pool_str818[sizeof("openpunctuation")];
- char uniname2ctype_pool_str821[sizeof("bamu")];
- char uniname2ctype_pool_str831[sizeof("buhid")];
- char uniname2ctype_pool_str840[sizeof("batk")];
- char uniname2ctype_pool_str851[sizeof("symbol")];
- char uniname2ctype_pool_str856[sizeof("changeswhenuppercased")];
- char uniname2ctype_pool_str857[sizeof("osmanya")];
- char uniname2ctype_pool_str861[sizeof("limbu")];
- char uniname2ctype_pool_str868[sizeof("punctuation")];
- char uniname2ctype_pool_str872[sizeof("hyphen")];
- char uniname2ctype_pool_str888[sizeof("mathsymbol")];
- char uniname2ctype_pool_str892[sizeof("grek")];
- char uniname2ctype_pool_str898[sizeof("changeswhencasefolded")];
- char uniname2ctype_pool_str902[sizeof("quotationmark")];
- char uniname2ctype_pool_str903[sizeof("bugi")];
- char uniname2ctype_pool_str916[sizeof("cuneiform")];
- char uniname2ctype_pool_str918[sizeof("pf")];
- char uniname2ctype_pool_str927[sizeof("cwcf")];
- char uniname2ctype_pool_str932[sizeof("bamum")];
- char uniname2ctype_pool_str940[sizeof("guru")];
- char uniname2ctype_pool_str944[sizeof("wspace")];
- char uniname2ctype_pool_str951[sizeof("meeteimayek")];
- char uniname2ctype_pool_str976[sizeof("defaultignorablecodepoint")];
- char uniname2ctype_pool_str980[sizeof("modifiersymbol")];
- char uniname2ctype_pool_str999[sizeof("mlym")];
- char uniname2ctype_pool_str1007[sizeof("mymr")];
- char uniname2ctype_pool_str1020[sizeof("malayalam")];
- char uniname2ctype_pool_str1026[sizeof("myanmar")];
- char uniname2ctype_pool_str1032[sizeof("telugu")];
- char uniname2ctype_pool_str1033[sizeof("buginese")];
- char uniname2ctype_pool_str1037[sizeof("xsux")];
- char uniname2ctype_pool_str1093[sizeof("sk")];
- char uniname2ctype_pool_str1097[sizeof("katakana")];
- char uniname2ctype_pool_str1124[sizeof("egyp")];
- char uniname2ctype_pool_str1146[sizeof("any")];
- char uniname2ctype_pool_str1148[sizeof("kayahli")];
- char uniname2ctype_pool_str1190[sizeof("cwu")];
- char uniname2ctype_pool_str1263[sizeof("qmark")];
- char uniname2ctype_pool_str1329[sizeof("blank")];
- char uniname2ctype_pool_str1347[sizeof("grlink")];
- char uniname2ctype_pool_str1358[sizeof("batak")];
- char uniname2ctype_pool_str1395[sizeof("unknown")];
- char uniname2ctype_pool_str1410[sizeof("greek")];
- char uniname2ctype_pool_str1463[sizeof("graphemelink")];
- char uniname2ctype_pool_str1470[sizeof("gurmukhi")];
- char uniname2ctype_pool_str1556[sizeof("hebrew")];
- char uniname2ctype_pool_str1621[sizeof("egyptianhieroglyphs")];
- char uniname2ctype_pool_str1741[sizeof("zyyy")];
+ char uniname2ctype_pool_str5[sizeof("s")];
+ char uniname2ctype_pool_str7[sizeof("z")];
+ char uniname2ctype_pool_str9[sizeof("zs")];
+ char uniname2ctype_pool_str16[sizeof("zzzz")];
+ char uniname2ctype_pool_str18[sizeof("cn")];
+ char uniname2ctype_pool_str20[sizeof("cs")];
+ char uniname2ctype_pool_str24[sizeof("ci")];
+ char uniname2ctype_pool_str29[sizeof("c")];
+ char uniname2ctype_pool_str30[sizeof("cf")];
+ char uniname2ctype_pool_str32[sizeof("sc")];
+ char uniname2ctype_pool_str34[sizeof("cans")];
+ char uniname2ctype_pool_str35[sizeof("qaai")];
+ char uniname2ctype_pool_str38[sizeof("mn")];
+ char uniname2ctype_pool_str42[sizeof("ascii")];
+ char uniname2ctype_pool_str44[sizeof("cc")];
+ char uniname2ctype_pool_str45[sizeof("qaac")];
+ char uniname2ctype_pool_str49[sizeof("inavestan")];
+ char uniname2ctype_pool_str52[sizeof("inspecials")];
+ char uniname2ctype_pool_str62[sizeof("inipaextensions")];
+ char uniname2ctype_pool_str64[sizeof("mc")];
+ char uniname2ctype_pool_str66[sizeof("insamaritan")];
+ char uniname2ctype_pool_str69[sizeof("m")];
+ char uniname2ctype_pool_str72[sizeof("sm")];
+ char uniname2ctype_pool_str74[sizeof("me")];
+ char uniname2ctype_pool_str82[sizeof("inarmenian")];
+ char uniname2ctype_pool_str84[sizeof("incuneiform")];
+ char uniname2ctype_pool_str86[sizeof("mandaic")];
+ char uniname2ctype_pool_str90[sizeof("inancientsymbols")];
+ char uniname2ctype_pool_str92[sizeof("incuneiformnumbersandpunctuation")];
+ char uniname2ctype_pool_str96[sizeof("inthai")];
+ char uniname2ctype_pool_str99[sizeof("inmusicalsymbols")];
+ char uniname2ctype_pool_str100[sizeof("inmiscellaneoussymbols")];
+ char uniname2ctype_pool_str106[sizeof("incham")];
+ char uniname2ctype_pool_str109[sizeof("inmiscellaneoussymbolsandarrows")];
+ char uniname2ctype_pool_str113[sizeof("initialpunctuation")];
+ char uniname2ctype_pool_str114[sizeof("inmiscellaneoussymbolsandpictographs")];
+ char uniname2ctype_pool_str116[sizeof("inthaana")];
+ char uniname2ctype_pool_str124[sizeof("taile")];
+ char uniname2ctype_pool_str125[sizeof("mtei")];
+ char uniname2ctype_pool_str132[sizeof("lc")];
+ char uniname2ctype_pool_str133[sizeof("lana")];
+ char uniname2ctype_pool_str134[sizeof("inlycian")];
+ char uniname2ctype_pool_str135[sizeof("intransportandmapsymbols")];
+ char uniname2ctype_pool_str136[sizeof("incontrolpictures")];
+ char uniname2ctype_pool_str142[sizeof("sinhala")];
+ char uniname2ctype_pool_str151[sizeof("incommonindicnumberforms")];
+ char uniname2ctype_pool_str156[sizeof("inmiscellaneousmathematicalsymbolsa")];
+ char uniname2ctype_pool_str158[sizeof("sterm")];
+ char uniname2ctype_pool_str167[sizeof("inmyanmarextendeda")];
+ char uniname2ctype_pool_str172[sizeof("lm")];
+ char uniname2ctype_pool_str175[sizeof("taiviet")];
+ char uniname2ctype_pool_str179[sizeof("inlinearbideograms")];
+ char uniname2ctype_pool_str180[sizeof("intaitham")];
+ char uniname2ctype_pool_str184[sizeof("latn")];
+ char uniname2ctype_pool_str186[sizeof("latin")];
+ char uniname2ctype_pool_str187[sizeof("ital")];
+ char uniname2ctype_pool_str189[sizeof("alnum")];
+ char uniname2ctype_pool_str199[sizeof("inmalayalam")];
+ char uniname2ctype_pool_str201[sizeof("intaile")];
+ char uniname2ctype_pool_str202[sizeof("tale")];
+ char uniname2ctype_pool_str205[sizeof("l")];
+ char uniname2ctype_pool_str207[sizeof("nl")];
+ char uniname2ctype_pool_str209[sizeof("zl")];
+ char uniname2ctype_pool_str216[sizeof("intamil")];
+ char uniname2ctype_pool_str217[sizeof("taml")];
+ char uniname2ctype_pool_str218[sizeof("inlatinextendeda")];
+ char uniname2ctype_pool_str220[sizeof("inlatinextendedc")];
+ char uniname2ctype_pool_str223[sizeof("inrunic")];
+ char uniname2ctype_pool_str224[sizeof("incarian")];
+ char uniname2ctype_pool_str225[sizeof("insyriac")];
+ char uniname2ctype_pool_str227[sizeof("cari")];
+ char uniname2ctype_pool_str230[sizeof("inmeeteimayekextensions")];
+ char uniname2ctype_pool_str231[sizeof("osma")];
+ char uniname2ctype_pool_str232[sizeof("lt")];
+ char uniname2ctype_pool_str233[sizeof("miao")];
+ char uniname2ctype_pool_str234[sizeof("insharada")];
+ char uniname2ctype_pool_str239[sizeof("incyrillic")];
+ char uniname2ctype_pool_str240[sizeof("carian")];
+ char uniname2ctype_pool_str244[sizeof("armn")];
+ char uniname2ctype_pool_str245[sizeof("samr")];
+ char uniname2ctype_pool_str247[sizeof("armi")];
+ char uniname2ctype_pool_str248[sizeof("inideographicdescriptioncharacters")];
+ char uniname2ctype_pool_str252[sizeof("inosmanya")];
+ char uniname2ctype_pool_str253[sizeof("armenian")];
+ char uniname2ctype_pool_str254[sizeof("inmyanmar")];
+ char uniname2ctype_pool_str255[sizeof("samaritan")];
+ char uniname2ctype_pool_str256[sizeof("arabic")];
+ char uniname2ctype_pool_str259[sizeof("incherokee")];
+ char uniname2ctype_pool_str261[sizeof("connectorpunctuation")];
+ char uniname2ctype_pool_str263[sizeof("merc")];
+ char uniname2ctype_pool_str264[sizeof("inmiscellaneoustechnical")];
+ char uniname2ctype_pool_str268[sizeof("inenclosedalphanumerics")];
+ char uniname2ctype_pool_str279[sizeof("inemoticons")];
+ char uniname2ctype_pool_str281[sizeof("joinc")];
+ char uniname2ctype_pool_str288[sizeof("cntrl")];
+ char uniname2ctype_pool_str301[sizeof("inenclosedcjklettersandmonths")];
+ char uniname2ctype_pool_str303[sizeof("cwcf")];
+ char uniname2ctype_pool_str304[sizeof("inruminumeralsymbols")];
+ char uniname2ctype_pool_str308[sizeof("ll")];
+ char uniname2ctype_pool_str313[sizeof("term")];
+ char uniname2ctype_pool_str316[sizeof("inlatinextendedadditional")];
+ char uniname2ctype_pool_str320[sizeof("tamil")];
+ char uniname2ctype_pool_str321[sizeof("loe")];
+ char uniname2ctype_pool_str329[sizeof("newtailue")];
+ char uniname2ctype_pool_str330[sizeof("cwcm")];
+ char uniname2ctype_pool_str339[sizeof("inenclosedalphanumericsupplement")];
+ char uniname2ctype_pool_str346[sizeof("sinh")];
+ char uniname2ctype_pool_str347[sizeof("zinh")];
+ char uniname2ctype_pool_str349[sizeof("meroiticcursive")];
+ char uniname2ctype_pool_str353[sizeof("han")];
+ char uniname2ctype_pool_str357[sizeof("hani")];
+ char uniname2ctype_pool_str358[sizeof("inopticalcharacterrecognition")];
+ char uniname2ctype_pool_str359[sizeof("no")];
+ char uniname2ctype_pool_str360[sizeof("so")];
+ char uniname2ctype_pool_str364[sizeof("innewtailue")];
+ char uniname2ctype_pool_str365[sizeof("insinhala")];
+ char uniname2ctype_pool_str367[sizeof("innko")];
+ char uniname2ctype_pool_str372[sizeof("co")];
+ char uniname2ctype_pool_str375[sizeof("shavian")];
+ char uniname2ctype_pool_str378[sizeof("terminalpunctuation")];
+ char uniname2ctype_pool_str386[sizeof("intaixuanjingsymbols")];
+ char uniname2ctype_pool_str387[sizeof("inethiopic")];
+ char uniname2ctype_pool_str389[sizeof("sora")];
+ char uniname2ctype_pool_str398[sizeof("inarrows")];
+ char uniname2ctype_pool_str400[sizeof("cham")];
+ char uniname2ctype_pool_str403[sizeof("inlowsurrogates")];
+ char uniname2ctype_pool_str405[sizeof("oriya")];
+ char uniname2ctype_pool_str406[sizeof("ext")];
+ char uniname2ctype_pool_str409[sizeof("cwt")];
+ char uniname2ctype_pool_str412[sizeof("common")];
+ char uniname2ctype_pool_str414[sizeof("inmiao")];
+ char uniname2ctype_pool_str420[sizeof("thai")];
+ char uniname2ctype_pool_str425[sizeof("intifinagh")];
+ char uniname2ctype_pool_str426[sizeof("ethi")];
+ char uniname2ctype_pool_str427[sizeof("mero")];
+ char uniname2ctype_pool_str428[sizeof("chakma")];
+ char uniname2ctype_pool_str429[sizeof("thaa")];
+ char uniname2ctype_pool_str430[sizeof("inscriptionalparthian")];
+ char uniname2ctype_pool_str432[sizeof("tifinagh")];
+ char uniname2ctype_pool_str436[sizeof("titlecaseletter")];
+ char uniname2ctype_pool_str445[sizeof("thaana")];
+ char uniname2ctype_pool_str449[sizeof("asciihexdigit")];
+ char uniname2ctype_pool_str450[sizeof("math")];
+ char uniname2ctype_pool_str453[sizeof("di")];
+ char uniname2ctype_pool_str454[sizeof("ids")];
+ char uniname2ctype_pool_str460[sizeof("lo")];
+ char uniname2ctype_pool_str468[sizeof("inlao")];
+ char uniname2ctype_pool_str470[sizeof("taitham")];
+ char uniname2ctype_pool_str474[sizeof("lao")];
+ char uniname2ctype_pool_str475[sizeof("laoo")];
+ char uniname2ctype_pool_str476[sizeof("dia")];
+ char uniname2ctype_pool_str478[sizeof("idc")];
+ char uniname2ctype_pool_str480[sizeof("ps")];
+ char uniname2ctype_pool_str481[sizeof("insundanese")];
+ char uniname2ctype_pool_str484[sizeof("pi")];
+ char uniname2ctype_pool_str485[sizeof("cwl")];
+ char uniname2ctype_pool_str490[sizeof("pf")];
+ char uniname2ctype_pool_str495[sizeof("mand")];
+ char uniname2ctype_pool_str496[sizeof("insylotinagri")];
+ char uniname2ctype_pool_str497[sizeof("vs")];
+ char uniname2ctype_pool_str503[sizeof("mongolian")];
+ char uniname2ctype_pool_str504[sizeof("pc")];
+ char uniname2ctype_pool_str506[sizeof("inmandaic")];
+ char uniname2ctype_pool_str509[sizeof("invai")];
+ char uniname2ctype_pool_str511[sizeof("lineseparator")];
+ char uniname2ctype_pool_str514[sizeof("pe")];
+ char uniname2ctype_pool_str515[sizeof("vai")];
+ char uniname2ctype_pool_str516[sizeof("vaii")];
+ char uniname2ctype_pool_str517[sizeof("idst")];
+ char uniname2ctype_pool_str520[sizeof("indominotiles")];
+ char uniname2ctype_pool_str521[sizeof("inshavian")];
+ char uniname2ctype_pool_str522[sizeof("inspacingmodifierletters")];
+ char uniname2ctype_pool_str524[sizeof("format")];
+ char uniname2ctype_pool_str528[sizeof("inphaistosdisc")];
+ char uniname2ctype_pool_str531[sizeof("hano")];
+ char uniname2ctype_pool_str532[sizeof("space")];
+ char uniname2ctype_pool_str542[sizeof("indeseret")];
+ char uniname2ctype_pool_str545[sizeof("inolchiki")];
+ char uniname2ctype_pool_str548[sizeof("hira")];
+ char uniname2ctype_pool_str553[sizeof("joincontrol")];
+ char uniname2ctype_pool_str555[sizeof("idcontinue")];
+ char uniname2ctype_pool_str558[sizeof("inmahjongtiles")];
+ char uniname2ctype_pool_str560[sizeof("patws")];
+ char uniname2ctype_pool_str563[sizeof("inlydian")];
+ char uniname2ctype_pool_str564[sizeof("cher")];
+ char uniname2ctype_pool_str568[sizeof("inhiragana")];
+ char uniname2ctype_pool_str572[sizeof("inogham")];
+ char uniname2ctype_pool_str574[sizeof("avst")];
+ char uniname2ctype_pool_str575[sizeof("inscriptionalpahlavi")];
+ char uniname2ctype_pool_str579[sizeof("incoptic")];
+ char uniname2ctype_pool_str587[sizeof("java")];
+ char uniname2ctype_pool_str589[sizeof("inmathematicalalphanumericsymbols")];
+ char uniname2ctype_pool_str594[sizeof("letter")];
+ char uniname2ctype_pool_str604[sizeof("injavanese")];
+ char uniname2ctype_pool_str608[sizeof("avestan")];
+ char uniname2ctype_pool_str612[sizeof("age=1.1")];
+ char uniname2ctype_pool_str613[sizeof("lepc")];
+ char uniname2ctype_pool_str614[sizeof("age=2.1")];
+ char uniname2ctype_pool_str616[sizeof("inlepcha")];
+ char uniname2ctype_pool_str617[sizeof("javanese")];
+ char uniname2ctype_pool_str618[sizeof("shaw")];
+ char uniname2ctype_pool_str619[sizeof("finalpunctuation")];
+ char uniname2ctype_pool_str620[sizeof("alpha")];
+ char uniname2ctype_pool_str621[sizeof("age=5.1")];
+ char uniname2ctype_pool_str622[sizeof("inmongolian")];
+ char uniname2ctype_pool_str623[sizeof("age=5.2")];
+ char uniname2ctype_pool_str626[sizeof("age=2.0")];
+ char uniname2ctype_pool_str627[sizeof("ahex")];
+ char uniname2ctype_pool_str630[sizeof("ingeneralpunctuation")];
+ char uniname2ctype_pool_str631[sizeof("oids")];
+ char uniname2ctype_pool_str632[sizeof("odi")];
+ char uniname2ctype_pool_str633[sizeof("age=5.0")];
+ char uniname2ctype_pool_str636[sizeof("tavt")];
+ char uniname2ctype_pool_str637[sizeof("intaiviet")];
+ char uniname2ctype_pool_str638[sizeof("age=6.1")];
+ char uniname2ctype_pool_str639[sizeof("age=3.1")];
+ char uniname2ctype_pool_str640[sizeof("insundanesesupplement")];
+ char uniname2ctype_pool_str641[sizeof("age=3.2")];
+ char uniname2ctype_pool_str642[sizeof("age=4.1")];
+ char uniname2ctype_pool_str643[sizeof("oidc")];
+ char uniname2ctype_pool_str646[sizeof("tfng")];
+ char uniname2ctype_pool_str647[sizeof("insmallformvariants")];
+ char uniname2ctype_pool_str648[sizeof("ideo")];
+ char uniname2ctype_pool_str649[sizeof("intags")];
+ char uniname2ctype_pool_str650[sizeof("age=6.0")];
+ char uniname2ctype_pool_str651[sizeof("age=3.0")];
+ char uniname2ctype_pool_str653[sizeof("whitespace")];
+ char uniname2ctype_pool_str654[sizeof("age=4.0")];
+ char uniname2ctype_pool_str655[sizeof("inolditalic")];
+ char uniname2ctype_pool_str660[sizeof("oalpha")];
+ char uniname2ctype_pool_str668[sizeof("ingujarati")];
+ char uniname2ctype_pool_str672[sizeof("control")];
+ char uniname2ctype_pool_str679[sizeof("diacritic")];
+ char uniname2ctype_pool_str682[sizeof("tagbanwa")];
+ char uniname2ctype_pool_str690[sizeof("inphoenician")];
+ char uniname2ctype_pool_str701[sizeof("ininscriptionalparthian")];
+ char uniname2ctype_pool_str703[sizeof("ininscriptionalpahlavi")];
+ char uniname2ctype_pool_str704[sizeof("coptic")];
+ char uniname2ctype_pool_str705[sizeof("dsrt")];
+ char uniname2ctype_pool_str706[sizeof("inmodifiertoneletters")];
+ char uniname2ctype_pool_str709[sizeof("xids")];
+ char uniname2ctype_pool_str713[sizeof("hanunoo")];
+ char uniname2ctype_pool_str715[sizeof("inoldturkic")];
+ char uniname2ctype_pool_str721[sizeof("xidc")];
+ char uniname2ctype_pool_str725[sizeof("idstart")];
+ char uniname2ctype_pool_str729[sizeof("inimperialaramaic")];
+ char uniname2ctype_pool_str730[sizeof("invariationselectors")];
+ char uniname2ctype_pool_str734[sizeof("copt")];
+ char uniname2ctype_pool_str737[sizeof("caseignorable")];
+ char uniname2ctype_pool_str738[sizeof("prti")];
+ char uniname2ctype_pool_str739[sizeof("nchar")];
+ char uniname2ctype_pool_str746[sizeof("deseret")];
+ char uniname2ctype_pool_str747[sizeof("decimalnumber")];
+ char uniname2ctype_pool_str748[sizeof("cprt")];
+ char uniname2ctype_pool_str750[sizeof("inlatin1supplement")];
+ char uniname2ctype_pool_str771[sizeof("imperialaramaic")];
+ char uniname2ctype_pool_str776[sizeof("privateuse")];
+ char uniname2ctype_pool_str777[sizeof("casedletter")];
+ char uniname2ctype_pool_str778[sizeof("lowercase")];
+ char uniname2ctype_pool_str780[sizeof("spaceseparator")];
+ char uniname2ctype_pool_str784[sizeof("radical")];
+ char uniname2ctype_pool_str787[sizeof("mong")];
+ char uniname2ctype_pool_str788[sizeof("canadianaboriginal")];
+ char uniname2ctype_pool_str792[sizeof("letternumber")];
+ char uniname2ctype_pool_str796[sizeof("insorasompeng")];
+ char uniname2ctype_pool_str797[sizeof("dash")];
+ char uniname2ctype_pool_str798[sizeof("wspace")];
+ char uniname2ctype_pool_str799[sizeof("ogam")];
+ char uniname2ctype_pool_str802[sizeof("invariationselectorssupplement")];
+ char uniname2ctype_pool_str803[sizeof("print")];
+ char uniname2ctype_pool_str811[sizeof("otheridcontinue")];
+ char uniname2ctype_pool_str815[sizeof("ingurmukhi")];
+ char uniname2ctype_pool_str818[sizeof("closepunctuation")];
+ char uniname2ctype_pool_str823[sizeof("olditalic")];
+ char uniname2ctype_pool_str824[sizeof("noncharactercodepoint")];
+ char uniname2ctype_pool_str826[sizeof("sharada")];
+ char uniname2ctype_pool_str827[sizeof("ingeometricshapes")];
+ char uniname2ctype_pool_str830[sizeof("otheralphabetic")];
+ char uniname2ctype_pool_str831[sizeof("patternwhitespace")];
+ char uniname2ctype_pool_str832[sizeof("po")];
+ char uniname2ctype_pool_str833[sizeof("rjng")];
+ char uniname2ctype_pool_str835[sizeof("ingreekandcoptic")];
+ char uniname2ctype_pool_str841[sizeof("xdigit")];
+ char uniname2ctype_pool_str850[sizeof("gothic")];
+ char uniname2ctype_pool_str851[sizeof("inoldsoutharabian")];
+ char uniname2ctype_pool_str852[sizeof("xidstart")];
+ char uniname2ctype_pool_str854[sizeof("inrejang")];
+ char uniname2ctype_pool_str860[sizeof("idsbinaryoperator")];
+ char uniname2ctype_pool_str867[sizeof("olower")];
+ char uniname2ctype_pool_str869[sizeof("hex")];
+ char uniname2ctype_pool_str870[sizeof("inenclosedideographicsupplement")];
+ char uniname2ctype_pool_str874[sizeof("inalphabeticpresentationforms")];
+ char uniname2ctype_pool_str879[sizeof("inbasiclatin")];
+ char uniname2ctype_pool_str884[sizeof("othersymbol")];
+ char uniname2ctype_pool_str889[sizeof("nd")];
+ char uniname2ctype_pool_str890[sizeof("sd")];
+ char uniname2ctype_pool_str900[sizeof("omath")];
+ char uniname2ctype_pool_str901[sizeof("separator")];
+ char uniname2ctype_pool_str907[sizeof("inarabic")];
+ char uniname2ctype_pool_str912[sizeof("xidcontinue")];
+ char uniname2ctype_pool_str913[sizeof("otheridstart")];
+ char uniname2ctype_pool_str914[sizeof("grext")];
+ char uniname2ctype_pool_str917[sizeof("otherlowercase")];
+ char uniname2ctype_pool_str919[sizeof("phli")];
+ char uniname2ctype_pool_str920[sizeof("cased")];
+ char uniname2ctype_pool_str923[sizeof("hang")];
+ char uniname2ctype_pool_str931[sizeof("xpeo")];
+ char uniname2ctype_pool_str933[sizeof("lower")];
+ char uniname2ctype_pool_str936[sizeof("modifierletter")];
+ char uniname2ctype_pool_str938[sizeof("inphoneticextensions")];
+ char uniname2ctype_pool_str939[sizeof("inarabicpresentationformsa")];
+ char uniname2ctype_pool_str943[sizeof("innumberforms")];
+ char uniname2ctype_pool_str945[sizeof("oldpersian")];
+ char uniname2ctype_pool_str946[sizeof("incyrillicextendeda")];
+ char uniname2ctype_pool_str947[sizeof("inverticalforms")];
+ char uniname2ctype_pool_str949[sizeof("p")];
+ char uniname2ctype_pool_str950[sizeof("inbyzantinemusicalsymbols")];
+ char uniname2ctype_pool_str951[sizeof("inmathematicaloperators")];
+ char uniname2ctype_pool_str952[sizeof("intibetan")];
+ char uniname2ctype_pool_str953[sizeof("zp")];
+ char uniname2ctype_pool_str956[sizeof("ingeorgian")];
+ char uniname2ctype_pool_str960[sizeof("inbraillepatterns")];
+ char uniname2ctype_pool_str962[sizeof("lepcha")];
+ char uniname2ctype_pool_str963[sizeof("geor")];
+ char uniname2ctype_pool_str964[sizeof("invedicextensions")];
+ char uniname2ctype_pool_str965[sizeof("linb")];
+ char uniname2ctype_pool_str966[sizeof("other")];
+ char uniname2ctype_pool_str970[sizeof("deva")];
+ char uniname2ctype_pool_str972[sizeof("indevanagari")];
+ char uniname2ctype_pool_str973[sizeof("othernumber")];
+ char uniname2ctype_pool_str974[sizeof("bamum")];
+ char uniname2ctype_pool_str976[sizeof("shrd")];
+ char uniname2ctype_pool_str977[sizeof("bali")];
+ char uniname2ctype_pool_str981[sizeof("devanagari")];
+ char uniname2ctype_pool_str983[sizeof("extender")];
+ char uniname2ctype_pool_str988[sizeof("inherited")];
+ char uniname2ctype_pool_str989[sizeof("glagolitic")];
+ char uniname2ctype_pool_str990[sizeof("tibt")];
+ char uniname2ctype_pool_str994[sizeof("inbalinese")];
+ char uniname2ctype_pool_str996[sizeof("ingothic")];
+ char uniname2ctype_pool_str997[sizeof("inmiscellaneousmathematicalsymbolsb")];
+ char uniname2ctype_pool_str998[sizeof("limb")];
+ char uniname2ctype_pool_str1000[sizeof("bengali")];
+ char uniname2ctype_pool_str1003[sizeof("phoenician")];
+ char uniname2ctype_pool_str1004[sizeof("insuperscriptsandsubscripts")];
+ char uniname2ctype_pool_str1006[sizeof("inmeroitichieroglyphs")];
+ char uniname2ctype_pool_str1007[sizeof("tibetan")];
+ char uniname2ctype_pool_str1010[sizeof("inphoneticextensionssupplement")];
+ char uniname2ctype_pool_str1016[sizeof("balinese")];
+ char uniname2ctype_pool_str1021[sizeof("lowercaseletter")];
+ char uniname2ctype_pool_str1031[sizeof("indingbats")];
+ char uniname2ctype_pool_str1035[sizeof("inprivateusearea")];
+ char uniname2ctype_pool_str1039[sizeof("assigned")];
+ char uniname2ctype_pool_str1044[sizeof("patternsyntax")];
+ char uniname2ctype_pool_str1051[sizeof("inhangulsyllables")];
+ char uniname2ctype_pool_str1065[sizeof("sarb")];
+ char uniname2ctype_pool_str1067[sizeof("brai")];
+ char uniname2ctype_pool_str1069[sizeof("insupplementalmathematicaloperators")];
+ char uniname2ctype_pool_str1070[sizeof("phnx")];
+ char uniname2ctype_pool_str1072[sizeof("ingreekextended")];
+ char uniname2ctype_pool_str1074[sizeof("otherletter")];
+ char uniname2ctype_pool_str1076[sizeof("arab")];
+ char uniname2ctype_pool_str1078[sizeof("inlatinextendedd")];
+ char uniname2ctype_pool_str1081[sizeof("word")];
+ char uniname2ctype_pool_str1084[sizeof("inphagspa")];
+ char uniname2ctype_pool_str1087[sizeof("inblockelements")];
+ char uniname2ctype_pool_str1092[sizeof("ethiopic")];
+ char uniname2ctype_pool_str1094[sizeof("inethiopicextendeda")];
+ char uniname2ctype_pool_str1107[sizeof("brahmi")];
+ char uniname2ctype_pool_str1110[sizeof("logicalorderexception")];
+ char uniname2ctype_pool_str1114[sizeof("inoldpersian")];
+ char uniname2ctype_pool_str1129[sizeof("inletterlikesymbols")];
+ char uniname2ctype_pool_str1133[sizeof("sorasompeng")];
+ char uniname2ctype_pool_str1135[sizeof("hiragana")];
+ char uniname2ctype_pool_str1142[sizeof("inhanguljamoextendeda")];
+ char uniname2ctype_pool_str1147[sizeof("othermath")];
+ char uniname2ctype_pool_str1150[sizeof("digit")];
+ char uniname2ctype_pool_str1151[sizeof("goth")];
+ char uniname2ctype_pool_str1156[sizeof("ogham")];
+ char uniname2ctype_pool_str1162[sizeof("sundanese")];
+ char uniname2ctype_pool_str1170[sizeof("saurashtra")];
+ char uniname2ctype_pool_str1173[sizeof("linearb")];
+ char uniname2ctype_pool_str1179[sizeof("graphemebase")];
+ char uniname2ctype_pool_str1185[sizeof("inunifiedcanadianaboriginalsyllabics")];
+ char uniname2ctype_pool_str1186[sizeof("cuneiform")];
+ char uniname2ctype_pool_str1188[sizeof("inkannada")];
+ char uniname2ctype_pool_str1190[sizeof("kana")];
+ char uniname2ctype_pool_str1195[sizeof("inancientgreeknumbers")];
+ char uniname2ctype_pool_str1196[sizeof("incjkstrokes")];
+ char uniname2ctype_pool_str1198[sizeof("inglagolitic")];
+ char uniname2ctype_pool_str1202[sizeof("inancientgreekmusicalnotation")];
+ char uniname2ctype_pool_str1212[sizeof("inchakma")];
+ char uniname2ctype_pool_str1215[sizeof("plrd")];
+ char uniname2ctype_pool_str1219[sizeof("inbrahmi")];
+ char uniname2ctype_pool_str1224[sizeof("cakm")];
+ char uniname2ctype_pool_str1225[sizeof("incjkcompatibilityforms")];
+ char uniname2ctype_pool_str1229[sizeof("lisu")];
+ char uniname2ctype_pool_str1230[sizeof("incjkcompatibilityideographs")];
+ char uniname2ctype_pool_str1231[sizeof("intagalog")];
+ char uniname2ctype_pool_str1244[sizeof("inkaithi")];
+ char uniname2ctype_pool_str1245[sizeof("insupplementalarrowsa")];
+ char uniname2ctype_pool_str1249[sizeof("takri")];
+ char uniname2ctype_pool_str1253[sizeof("ideographic")];
+ char uniname2ctype_pool_str1256[sizeof("hexdigit")];
+ char uniname2ctype_pool_str1259[sizeof("glag")];
+ char uniname2ctype_pool_str1261[sizeof("softdotted")];
+ char uniname2ctype_pool_str1262[sizeof("variationselector")];
+ char uniname2ctype_pool_str1264[sizeof("inkatakana")];
+ char uniname2ctype_pool_str1265[sizeof("meeteimayek")];
+ char uniname2ctype_pool_str1274[sizeof("otherpunctuation")];
+ char uniname2ctype_pool_str1279[sizeof("inhanguljamo")];
+ char uniname2ctype_pool_str1282[sizeof("kali")];
+ char uniname2ctype_pool_str1289[sizeof("braille")];
+ char uniname2ctype_pool_str1298[sizeof("incombininghalfmarks")];
+ char uniname2ctype_pool_str1300[sizeof("talu")];
+ char uniname2ctype_pool_str1302[sizeof("incjkcompatibilityideographssupplement")];
+ char uniname2ctype_pool_str1306[sizeof("telu")];
+ char uniname2ctype_pool_str1307[sizeof("idsb")];
+ char uniname2ctype_pool_str1310[sizeof("tglg")];
+ char uniname2ctype_pool_str1313[sizeof("inmeeteimayek")];
+ char uniname2ctype_pool_str1315[sizeof("yi")];
+ char uniname2ctype_pool_str1318[sizeof("phagspa")];
+ char uniname2ctype_pool_str1321[sizeof("yiii")];
+ char uniname2ctype_pool_str1323[sizeof("inarabicmathematicalalphabeticsymbols")];
+ char uniname2ctype_pool_str1328[sizeof("saur")];
+ char uniname2ctype_pool_str1330[sizeof("ogrext")];
+ char uniname2ctype_pool_str1334[sizeof("bidic")];
+ char uniname2ctype_pool_str1341[sizeof("inkanasupplement")];
+ char uniname2ctype_pool_str1343[sizeof("runic")];
+ char uniname2ctype_pool_str1344[sizeof("inalchemicalsymbols")];
+ char uniname2ctype_pool_str1350[sizeof("georgian")];
+ char uniname2ctype_pool_str1351[sizeof("inugaritic")];
+ char uniname2ctype_pool_str1354[sizeof("insaurashtra")];
+ char uniname2ctype_pool_str1356[sizeof("inhighprivateusesurrogates")];
+ char uniname2ctype_pool_str1362[sizeof("pd")];
+ char uniname2ctype_pool_str1372[sizeof("incountingrodnumerals")];
+ char uniname2ctype_pool_str1377[sizeof("inarabicextendeda")];
+ char uniname2ctype_pool_str1389[sizeof("inkharoshthi")];
+ char uniname2ctype_pool_str1393[sizeof("idstrinaryoperator")];
+ char uniname2ctype_pool_str1396[sizeof("phag")];
+ char uniname2ctype_pool_str1398[sizeof("brah")];
+ char uniname2ctype_pool_str1402[sizeof("mark")];
+ char uniname2ctype_pool_str1404[sizeof("hebr")];
+ char uniname2ctype_pool_str1411[sizeof("inkhmersymbols")];
+ char uniname2ctype_pool_str1413[sizeof("dep")];
+ char uniname2ctype_pool_str1416[sizeof("inkhmer")];
+ char uniname2ctype_pool_str1422[sizeof("deprecated")];
+ char uniname2ctype_pool_str1424[sizeof("rejang")];
+ char uniname2ctype_pool_str1429[sizeof("lyci")];
+ char uniname2ctype_pool_str1431[sizeof("intakri")];
+ char uniname2ctype_pool_str1432[sizeof("takr")];
+ char uniname2ctype_pool_str1435[sizeof("incyrillicsupplement")];
+ char uniname2ctype_pool_str1436[sizeof("changeswhencasefolded")];
+ char uniname2ctype_pool_str1438[sizeof("indevanagariextended")];
+ char uniname2ctype_pool_str1442[sizeof("lycian")];
+ char uniname2ctype_pool_str1443[sizeof("inbengali")];
+ char uniname2ctype_pool_str1448[sizeof("beng")];
+ char uniname2ctype_pool_str1450[sizeof("graph")];
+ char uniname2ctype_pool_str1452[sizeof("inyijinghexagramsymbols")];
+ char uniname2ctype_pool_str1457[sizeof("olck")];
+ char uniname2ctype_pool_str1460[sizeof("inarabicsupplement")];
+ char uniname2ctype_pool_str1462[sizeof("inbuginese")];
+ char uniname2ctype_pool_str1463[sizeof("changeswhencasemapped")];
+ char uniname2ctype_pool_str1468[sizeof("olchiki")];
+ char uniname2ctype_pool_str1478[sizeof("inaegeannumbers")];
+ char uniname2ctype_pool_str1479[sizeof("mlym")];
+ char uniname2ctype_pool_str1480[sizeof("alphabetic")];
+ char uniname2ctype_pool_str1492[sizeof("sylotinagri")];
+ char uniname2ctype_pool_str1498[sizeof("changeswhentitlecased")];
+ char uniname2ctype_pool_str1504[sizeof("tagalog")];
+ char uniname2ctype_pool_str1505[sizeof("tagb")];
+ char uniname2ctype_pool_str1506[sizeof("runr")];
+ char uniname2ctype_pool_str1510[sizeof("malayalam")];
+ char uniname2ctype_pool_str1512[sizeof("inoriya")];
+ char uniname2ctype_pool_str1516[sizeof("intagbanwa")];
+ char uniname2ctype_pool_str1517[sizeof("syrc")];
+ char uniname2ctype_pool_str1519[sizeof("nko")];
+ char uniname2ctype_pool_str1520[sizeof("nkoo")];
+ char uniname2ctype_pool_str1523[sizeof("inethiopicextended")];
+ char uniname2ctype_pool_str1525[sizeof("kaithi")];
+ char uniname2ctype_pool_str1530[sizeof("mathsymbol")];
+ char uniname2ctype_pool_str1531[sizeof("inyiradicals")];
+ char uniname2ctype_pool_str1536[sizeof("insupplementaryprivateuseareaa")];
+ char uniname2ctype_pool_str1540[sizeof("osmanya")];
+ char uniname2ctype_pool_str1546[sizeof("syriac")];
+ char uniname2ctype_pool_str1548[sizeof("otherdefaultignorablecodepoint")];
+ char uniname2ctype_pool_str1561[sizeof("number")];
+ char uniname2ctype_pool_str1565[sizeof("inlinearbsyllabary")];
+ char uniname2ctype_pool_str1566[sizeof("kthi")];
+ char uniname2ctype_pool_str1567[sizeof("sund")];
+ char uniname2ctype_pool_str1569[sizeof("mymr")];
+ char uniname2ctype_pool_str1571[sizeof("incombiningdiacriticalmarks")];
+ char uniname2ctype_pool_str1578[sizeof("enclosingmark")];
+ char uniname2ctype_pool_str1581[sizeof("incombiningdiacriticalmarksforsymbols")];
+ char uniname2ctype_pool_str1583[sizeof("inethiopicsupplement")];
+ char uniname2ctype_pool_str1590[sizeof("unassigned")];
+ char uniname2ctype_pool_str1591[sizeof("sylo")];
+ char uniname2ctype_pool_str1595[sizeof("combiningmark")];
+ char uniname2ctype_pool_str1598[sizeof("myanmar")];
+ char uniname2ctype_pool_str1605[sizeof("graphemeextend")];
+ char uniname2ctype_pool_str1606[sizeof("bidicontrol")];
+ char uniname2ctype_pool_str1609[sizeof("inhalfwidthandfullwidthforms")];
+ char uniname2ctype_pool_str1617[sizeof("cyrl")];
+ char uniname2ctype_pool_str1620[sizeof("knda")];
+ char uniname2ctype_pool_str1634[sizeof("inunifiedcanadianaboriginalsyllabicsextended")];
+ char uniname2ctype_pool_str1635[sizeof("xsux")];
+ char uniname2ctype_pool_str1636[sizeof("modifiersymbol")];
+ char uniname2ctype_pool_str1643[sizeof("incombiningdiacriticalmarkssupplement")];
+ char uniname2ctype_pool_str1645[sizeof("inhanunoo")];
+ char uniname2ctype_pool_str1648[sizeof("inbuhid")];
+ char uniname2ctype_pool_str1649[sizeof("kannada")];
+ char uniname2ctype_pool_str1658[sizeof("inhebrew")];
+ char uniname2ctype_pool_str1662[sizeof("grbase")];
+ char uniname2ctype_pool_str1664[sizeof("spacingmark")];
+ char uniname2ctype_pool_str1670[sizeof("inkatakanaphoneticextensions")];
+ char uniname2ctype_pool_str1676[sizeof("hangul")];
+ char uniname2ctype_pool_str1683[sizeof("incjksymbolsandpunctuation")];
+ char uniname2ctype_pool_str1688[sizeof("bopo")];
+ char uniname2ctype_pool_str1692[sizeof("orya")];
+ char uniname2ctype_pool_str1699[sizeof("inbopomofo")];
+ char uniname2ctype_pool_str1701[sizeof("kharoshthi")];
+ char uniname2ctype_pool_str1703[sizeof("khar")];
+ char uniname2ctype_pool_str1709[sizeof("changeswhenlowercased")];
+ char uniname2ctype_pool_str1724[sizeof("khmr")];
+ char uniname2ctype_pool_str1725[sizeof("punct")];
+ char uniname2ctype_pool_str1729[sizeof("symbol")];
+ char uniname2ctype_pool_str1732[sizeof("cherokee")];
+ char uniname2ctype_pool_str1737[sizeof("cyrillic")];
+ char uniname2ctype_pool_str1759[sizeof("inkangxiradicals")];
+ char uniname2ctype_pool_str1761[sizeof("hebrew")];
+ char uniname2ctype_pool_str1780[sizeof("inarabicpresentationformsb")];
+ char uniname2ctype_pool_str1787[sizeof("incyrillicextendedb")];
+ char uniname2ctype_pool_str1790[sizeof("ugaritic")];
+ char uniname2ctype_pool_str1829[sizeof("incurrencysymbols")];
+ char uniname2ctype_pool_str1831[sizeof("meroitichieroglyphs")];
+ char uniname2ctype_pool_str1835[sizeof("inhighsurrogates")];
+ char uniname2ctype_pool_str1853[sizeof("nonspacingmark")];
+ char uniname2ctype_pool_str1858[sizeof("lydi")];
+ char uniname2ctype_pool_str1864[sizeof("patsyn")];
+ char uniname2ctype_pool_str1868[sizeof("orkh")];
+ char uniname2ctype_pool_str1871[sizeof("lydian")];
+ char uniname2ctype_pool_str1896[sizeof("ugar")];
+ char uniname2ctype_pool_str1899[sizeof("othergraphemeextend")];
+ char uniname2ctype_pool_str1900[sizeof("inlatinextendedb")];
+ char uniname2ctype_pool_str1904[sizeof("bopomofo")];
+ char uniname2ctype_pool_str1917[sizeof("khmer")];
+ char uniname2ctype_pool_str1925[sizeof("uideo")];
+ char uniname2ctype_pool_str1932[sizeof("otheruppercase")];
+ char uniname2ctype_pool_str1944[sizeof("grek")];
+ char uniname2ctype_pool_str1949[sizeof("gujr")];
+ char uniname2ctype_pool_str1970[sizeof("gujarati")];
+ char uniname2ctype_pool_str1983[sizeof("inhanguljamoextendedb")];
+ char uniname2ctype_pool_str1988[sizeof("defaultignorablecodepoint")];
+ char uniname2ctype_pool_str2005[sizeof("inplayingcards")];
+ char uniname2ctype_pool_str2022[sizeof("bamu")];
+ char uniname2ctype_pool_str2028[sizeof("inkanbun")];
+ char uniname2ctype_pool_str2033[sizeof("incjkradicalssupplement")];
+ char uniname2ctype_pool_str2046[sizeof("cypriot")];
+ char uniname2ctype_pool_str2051[sizeof("inbamum")];
+ char uniname2ctype_pool_str2053[sizeof("inmeroiticcursive")];
+ char uniname2ctype_pool_str2055[sizeof("oldturkic")];
+ char uniname2ctype_pool_str2086[sizeof("insupplementalarrowsb")];
+ char uniname2ctype_pool_str2087[sizeof("surrogate")];
+ char uniname2ctype_pool_str2094[sizeof("batk")];
+ char uniname2ctype_pool_str2102[sizeof("inbatak")];
+ char uniname2ctype_pool_str2119[sizeof("inlimbu")];
+ char uniname2ctype_pool_str2123[sizeof("incypriotsyllabary")];
+ char uniname2ctype_pool_str2129[sizeof("dashpunctuation")];
+ char uniname2ctype_pool_str2130[sizeof("innoblock")];
+ char uniname2ctype_pool_str2141[sizeof("hyphen")];
+ char uniname2ctype_pool_str2162[sizeof("insupplementalpunctuation")];
+ char uniname2ctype_pool_str2165[sizeof("ingeorgiansupplement")];
+ char uniname2ctype_pool_str2178[sizeof("oupper")];
+ char uniname2ctype_pool_str2189[sizeof("paragraphseparator")];
+ char uniname2ctype_pool_str2194[sizeof("inbamumsupplement")];
+ char uniname2ctype_pool_str2299[sizeof("uppercase")];
+ char uniname2ctype_pool_str2313[sizeof("currencysymbol")];
+ char uniname2ctype_pool_str2322[sizeof("sk")];
+ char uniname2ctype_pool_str2338[sizeof("lu")];
+ char uniname2ctype_pool_str2342[sizeof("openpunctuation")];
+ char uniname2ctype_pool_str2349[sizeof("inlisu")];
+ char uniname2ctype_pool_str2371[sizeof("qmark")];
+ char uniname2ctype_pool_str2372[sizeof("egyp")];
+ char uniname2ctype_pool_str2377[sizeof("insupplementaryprivateuseareab")];
+ char uniname2ctype_pool_str2379[sizeof("limbu")];
+ char uniname2ctype_pool_str2400[sizeof("inegyptianhieroglyphs")];
+ char uniname2ctype_pool_str2401[sizeof("unifiedideograph")];
+ char uniname2ctype_pool_str2413[sizeof("intelugu")];
+ char uniname2ctype_pool_str2429[sizeof("katakana")];
+ char uniname2ctype_pool_str2442[sizeof("inhangulcompatibilityjamo")];
+ char uniname2ctype_pool_str2454[sizeof("upper")];
+ char uniname2ctype_pool_str2495[sizeof("inkayahli")];
+ char uniname2ctype_pool_str2515[sizeof("cwu")];
+ char uniname2ctype_pool_str2523[sizeof("incjkcompatibility")];
+ char uniname2ctype_pool_str2542[sizeof("uppercaseletter")];
+ char uniname2ctype_pool_str2549[sizeof("bugi")];
+ char uniname2ctype_pool_str2588[sizeof("buginese")];
+ char uniname2ctype_pool_str2627[sizeof("any")];
+ char uniname2ctype_pool_str2651[sizeof("inyisyllables")];
+ char uniname2ctype_pool_str2671[sizeof("inbopomofoextended")];
+ char uniname2ctype_pool_str2710[sizeof("inboxdrawing")];
+ char uniname2ctype_pool_str2724[sizeof("changeswhenuppercased")];
+ char uniname2ctype_pool_str2727[sizeof("unknown")];
+ char uniname2ctype_pool_str2737[sizeof("quotationmark")];
+ char uniname2ctype_pool_str2753[sizeof("buhd")];
+ char uniname2ctype_pool_str2785[sizeof("punctuation")];
+ char uniname2ctype_pool_str2888[sizeof("oldsoutharabian")];
+ char uniname2ctype_pool_str2925[sizeof("kayahli")];
+ char uniname2ctype_pool_str2940[sizeof("incjkunifiedideographs")];
+ char uniname2ctype_pool_str2961[sizeof("incjkunifiedideographsextensiona")];
+ char uniname2ctype_pool_str2962[sizeof("incjkunifiedideographsextensionc")];
+ char uniname2ctype_pool_str2995[sizeof("telugu")];
+ char uniname2ctype_pool_str3000[sizeof("guru")];
+ char uniname2ctype_pool_str3104[sizeof("greek")];
+ char uniname2ctype_pool_str3189[sizeof("grlink")];
+ char uniname2ctype_pool_str3197[sizeof("buhid")];
+ char uniname2ctype_pool_str3254[sizeof("batak")];
+ char uniname2ctype_pool_str3292[sizeof("blank")];
+ char uniname2ctype_pool_str3391[sizeof("incjkunifiedideographsextensiond")];
+ char uniname2ctype_pool_str3459[sizeof("graphemelink")];
+ char uniname2ctype_pool_str3480[sizeof("egyptianhieroglyphs")];
+ char uniname2ctype_pool_str3802[sizeof("incjkunifiedideographsextensionb")];
+ char uniname2ctype_pool_str3922[sizeof("zyyy")];
+ char uniname2ctype_pool_str4167[sizeof("gurmukhi")];
#endif /* USE_UNICODE_PROPERTIES */
};
static const struct uniname2ctype_pool_t uniname2ctype_pool_contents =
{
#ifndef USE_UNICODE_PROPERTIES
+ "word",
"print",
"punct",
+ "alpha",
+ "alnum",
+ "xdigit",
+ "upper",
#else /* USE_UNICODE_PROPERTIES */
"n",
- "l",
- "nl",
- "ll",
+ "s",
+ "z",
+ "zs",
+ "zzzz",
"cn",
- "no",
- "lo",
+ "cs",
+ "ci",
"c",
- "co",
+ "cf",
+ "sc",
+ "cans",
+ "qaai",
+ "mn",
+#endif /* USE_UNICODE_PROPERTIES */
+ "ascii",
+#ifdef USE_UNICODE_PROPERTIES
"cc",
- "lao",
- "laoo",
- "lana",
- "ci",
"qaac",
- "vai",
- "vaii",
- "qaai",
- "control",
+ "inavestan",
+ "inspecials",
+ "inipaextensions",
+ "mc",
+ "insamaritan",
+ "m",
+ "sm",
+ "me",
+ "inarmenian",
+ "incuneiform",
+ "mandaic",
+ "inancientsymbols",
+ "incuneiformnumbersandpunctuation",
+ "inthai",
+ "inmusicalsymbols",
+ "inmiscellaneoussymbols",
+ "incham",
+ "inmiscellaneoussymbolsandarrows",
+ "initialpunctuation",
+ "inmiscellaneoussymbolsandpictographs",
+ "inthaana",
+ "taile",
+ "mtei",
+ "lc",
+ "lana",
+ "inlycian",
+ "intransportandmapsymbols",
+ "incontrolpictures",
+ "sinhala",
+ "incommonindicnumberforms",
+ "inmiscellaneousmathematicalsymbolsa",
+ "sterm",
+ "inmyanmarextendeda",
+ "lm",
+ "taiviet",
+ "inlinearbideograms",
+ "intaitham",
+ "latn",
+ "latin",
+ "ital",
+ "alnum",
+ "inmalayalam",
+ "intaile",
+ "tale",
+ "l",
+ "nl",
+ "zl",
+ "intamil",
+ "taml",
+ "inlatinextendeda",
+ "inlatinextendedc",
+ "inrunic",
+ "incarian",
+ "insyriac",
"cari",
+ "inmeeteimayekextensions",
+ "osma",
+ "lt",
+ "miao",
+ "insharada",
+ "incyrillic",
"carian",
- "zl",
- "oriya",
- "latn",
+ "armn",
+ "samr",
+ "armi",
+ "inideographicdescriptioncharacters",
+ "inosmanya",
+ "armenian",
+ "inmyanmar",
+ "samaritan",
+ "arabic",
+ "incherokee",
+ "connectorpunctuation",
+ "merc",
+ "inmiscellaneoustechnical",
+ "inenclosedalphanumerics",
+ "inemoticons",
+ "joinc",
+#endif /* USE_UNICODE_PROPERTIES */
"cntrl",
- "latin",
+#ifdef USE_UNICODE_PROPERTIES
+ "inenclosedcjklettersandmonths",
+ "cwcf",
+ "inruminumeralsymbols",
+ "ll",
+ "term",
+ "inlatinextendedadditional",
+ "tamil",
+ "loe",
+ "newtailue",
+ "cwcm",
+ "inenclosedalphanumericsupplement",
+ "sinh",
+ "zinh",
+ "meroiticcursive",
"han",
- "arabic",
- "ital",
- "hano",
"hani",
- "hanunoo",
- "lt",
+ "inopticalcharacterrecognition",
+ "no",
"so",
- "hira",
- "nchar",
- "sc",
- "z",
- "oalpha",
- "tavt",
- "cans",
- "java",
- "zinh",
- "thaa",
+ "innewtailue",
+ "insinhala",
+ "innko",
+ "co",
+ "shavian",
+ "terminalpunctuation",
+ "intaixuanjingsymbols",
+ "inethiopic",
+ "sora",
+ "inarrows",
+ "cham",
+ "inlowsurrogates",
+ "oriya",
+ "ext",
+ "cwt",
+ "common",
+ "inmiao",
"thai",
- "variationselector",
- "sinhala",
- "joinc",
- "ascii",
- "initialpunctuation",
- "other",
- "joincontrol",
+ "intifinagh",
+ "ethi",
+ "mero",
+ "chakma",
+ "thaa",
+ "inscriptionalparthian",
+ "tifinagh",
+ "titlecaseletter",
"thaana",
- "avst",
- "olower",
- "othernumber",
- "otherletter",
- "sinh",
- "tale",
- "connectorpunctuation",
- "s",
+ "asciihexdigit",
+ "math",
"di",
- "vs",
- "oidc",
- "idc",
- "odi",
- "cs",
- "avestan",
+ "ids",
+ "lo",
+ "inlao",
+ "taitham",
+ "lao",
+ "laoo",
"dia",
- "cher",
- "inscriptionalparthian",
- "shavian",
- "radical",
- "loe",
- "diacritic",
- "zzzz",
- "ethi",
- "canadianaboriginal",
- "zs",
- "othersymbol",
- "olditalic",
- "inscriptionalpahlavi",
- "taiviet",
+ "idc",
+ "ps",
+ "insundanese",
+ "pi",
+ "cwl",
+ "pf",
+ "mand",
+ "insylotinagri",
+ "vs",
+ "mongolian",
+ "pc",
+ "inmandaic",
+ "invai",
"lineseparator",
- "otheridstart",
- "oids",
- "asciihexdigit",
- "inherited",
- "otherlowercase",
- "terminalpunctuation",
- "deva",
- "otheralphabetic",
- "ideo",
- "noncharactercodepoint",
- "otheridcontinue",
- "taile",
- "oldpersian",
- "devanagari",
- "letter",
- "nd",
+ "pe",
+ "vai",
+ "vaii",
"idst",
- "dsrt",
- "titlecaseletter",
- "po",
- "dash",
- "pc",
- "letternumber",
- "pi",
- "javanese",
- "mn",
- "idstart",
- "idcontinue",
- "ids",
+ "indominotiles",
+ "inshavian",
+ "inspacingmodifierletters",
+ "format",
+ "inphaistosdisc",
+ "hano",
#endif /* USE_UNICODE_PROPERTIES */
- "alpha",
+ "space",
#ifdef USE_UNICODE_PROPERTIES
- "mc",
- "coptic",
- "mongolian",
- "common",
- "armn",
- "copt",
- "cprt",
- "armi",
- "phli",
- "prti",
- "armenian",
- "sd",
- "mandaic",
- "phoenician",
- "taml",
- "tamil",
- "cased",
- "cham",
- "idsbinaryoperator",
- "lepc",
- "otherdefaultignorablecodepoint",
- "print",
- "osma",
- "samr",
- "math",
- "linb",
- "closepunctuation",
- "otherpunctuation",
- "bali",
- "omath",
- "samaritan",
- "ps",
- "arab",
- "brai",
- "taitham",
- "linearb",
- "lepcha",
- "mand",
- "mtei",
- "term",
- "glagolitic",
- "privateuse",
- "pe",
- "deseret",
- "brah",
- "runr",
- "othermath",
- "runic",
- "hang",
- "ethiopic",
- "me",
+ "indeseret",
+ "inolchiki",
+ "hira",
+ "joincontrol",
+ "idcontinue",
+ "inmahjongtiles",
"patws",
- "separator",
- "tibt",
- "gothic",
- "tagbanwa",
- "sarb",
- "talu",
- "tibetan",
- "goth",
- "rjng",
- "hangul",
- "bengali",
- "hiragana",
- "braille",
- "geor",
+ "inlydian",
+ "cher",
+ "inhiragana",
+ "inogham",
+ "avst",
+ "inscriptionalpahlavi",
+ "incoptic",
+ "java",
+ "inmathematicalalphanumericsymbols",
+ "letter",
+ "injavanese",
+ "avestan",
"age=1.1",
+ "lepc",
"age=2.1",
+ "inlepcha",
+ "javanese",
+ "shaw",
+ "finalpunctuation",
+ "alpha",
"age=5.1",
+ "inmongolian",
"age=5.2",
- "age=4.1",
- "p",
- "pd",
- "lisu",
"age=2.0",
+ "ahex",
+ "ingeneralpunctuation",
+ "oids",
+ "odi",
"age=5.0",
- "age=6.0",
- "age=4.0",
- "graph",
- "saur",
- "space",
+ "tavt",
+ "intaiviet",
+ "age=6.1",
"age=3.1",
+ "insundanesesupplement",
"age=3.2",
- "hebr",
- "bidic",
+ "age=4.1",
+ "oidc",
+ "tfng",
+ "insmallformvariants",
+ "ideo",
+ "intags",
+ "age=6.0",
"age=3.0",
- "bidicontrol",
- "logicalorderexception",
- "telu",
- "zp",
- "m",
- "lm",
- "idstrinaryoperator",
- "balinese",
- "uideo",
- "spaceseparator",
- "grext",
-#endif /* USE_UNICODE_PROPERTIES */
- "alnum",
-#ifdef USE_UNICODE_PROPERTIES
- "oldturkic",
+ "whitespace",
+ "age=4.0",
+ "inolditalic",
+ "oalpha",
+ "ingujarati",
+ "control",
+ "diacritic",
+ "tagbanwa",
+ "inphoenician",
+ "ininscriptionalparthian",
+ "ininscriptionalpahlavi",
+ "coptic",
+ "dsrt",
+ "inmodifiertoneletters",
+ "xids",
+ "hanunoo",
+ "inoldturkic",
"xidc",
- "idsb",
- "ahex",
- "format",
+ "idstart",
+ "inimperialaramaic",
+ "invariationselectors",
+ "copt",
"caseignorable",
- "tifinagh",
- "sundanese",
- "ext",
- "saurashtra",
- "patternwhitespace",
- "digit",
- "sund",
+ "prti",
+ "nchar",
+ "deseret",
"decimalnumber",
- "bopo",
- "sm",
- "otheruppercase",
- "ideographic",
- "xids",
- "unassigned",
- "phagspa",
- "alphabetic",
- "limb",
-#endif /* USE_UNICODE_PROPERTIES */
+ "cprt",
+ "inlatin1supplement",
+ "imperialaramaic",
+ "privateuse",
+ "casedletter",
+ "lowercase",
+ "spaceseparator",
+ "radical",
+ "mong",
+ "canadianaboriginal",
+ "letternumber",
+ "insorasompeng",
+ "dash",
+ "wspace",
+ "ogam",
+ "invariationselectorssupplement",
+ "print",
+ "otheridcontinue",
+ "ingurmukhi",
+ "closepunctuation",
+ "olditalic",
+ "noncharactercodepoint",
+ "sharada",
+ "ingeometricshapes",
+ "otheralphabetic",
+ "patternwhitespace",
+ "po",
+ "rjng",
+ "ingreekandcoptic",
"xdigit",
-#ifdef USE_UNICODE_PROPERTIES
+ "gothic",
+ "inoldsoutharabian",
"xidstart",
- "mong",
+ "inrejang",
+ "idsbinaryoperator",
+ "olower",
+ "hex",
+ "inenclosedideographicsupplement",
+ "inalphabeticpresentationforms",
+ "inbasiclatin",
+ "othersymbol",
+ "nd",
+ "sd",
+ "omath",
+ "separator",
+ "inarabic",
"xidcontinue",
+ "otheridstart",
+ "grext",
+ "otherlowercase",
+ "phli",
+ "cased",
+ "hang",
+ "xpeo",
+#endif /* USE_UNICODE_PROPERTIES */
+ "lower",
+#ifndef USE_UNICODE_PROPERTIES
+ "graph",
+#else /* USE_UNICODE_PROPERTIES */
+ "modifierletter",
+ "inphoneticextensions",
+ "inarabicpresentationformsa",
+ "innumberforms",
+ "oldpersian",
+ "incyrillicextendeda",
+ "inverticalforms",
+ "p",
+ "inbyzantinemusicalsymbols",
+ "inmathematicaloperators",
+ "intibetan",
+ "zp",
+ "ingeorgian",
+ "inbraillepatterns",
+ "lepcha",
+ "geor",
+ "invedicextensions",
+ "linb",
+ "other",
+ "deva",
+ "indevanagari",
+ "othernumber",
+ "bamum",
+ "shrd",
+ "bali",
+ "devanagari",
+ "extender",
+ "inherited",
+ "glagolitic",
+ "tibt",
+ "inbalinese",
+ "ingothic",
+ "inmiscellaneousmathematicalsymbolsb",
+ "limb",
+ "bengali",
+ "phoenician",
+ "insuperscriptsandsubscripts",
+ "inmeroitichieroglyphs",
+ "tibetan",
+ "inphoneticextensionssupplement",
+ "balinese",
+ "lowercaseletter",
+ "indingbats",
+ "inprivateusearea",
"assigned",
- "ogam",
- "nko",
- "nkoo",
- "olck",
- "deprecated",
+ "patternsyntax",
+ "inhangulsyllables",
+ "sarb",
+ "brai",
+ "insupplementalmathematicaloperators",
+ "phnx",
+ "ingreekextended",
+ "otherletter",
+ "arab",
+ "inlatinextendedd",
+ "word",
+ "inphagspa",
+ "inblockelements",
+ "ethiopic",
+ "inethiopicextendeda",
"brahmi",
- "phag",
+ "logicalorderexception",
+ "inoldpersian",
+ "inletterlikesymbols",
+ "sorasompeng",
+ "hiragana",
+ "inhanguljamoextendeda",
+ "othermath",
+#endif /* USE_UNICODE_PROPERTIES */
+ "digit",
+#ifndef USE_UNICODE_PROPERTIES
+ "blank"
+#else /* USE_UNICODE_PROPERTIES */
+ "goth",
+ "ogham",
+ "sundanese",
+ "saurashtra",
+ "linearb",
+ "graphemebase",
+ "inunifiedcanadianaboriginalsyllabics",
+ "cuneiform",
+ "inkannada",
"kana",
+ "inancientgreeknumbers",
+ "incjkstrokes",
+ "inglagolitic",
+ "inancientgreekmusicalnotation",
+ "inchakma",
+ "plrd",
+ "inbrahmi",
+ "cakm",
+ "incjkcompatibilityforms",
+ "lisu",
+ "incjkcompatibilityideographs",
+ "intagalog",
+ "inkaithi",
+ "insupplementalarrowsa",
+ "takri",
+ "ideographic",
+ "hexdigit",
+ "glag",
+ "softdotted",
+ "variationselector",
+ "inkatakana",
+ "meeteimayek",
+ "otherpunctuation",
+ "inhanguljamo",
"kali",
- "changeswhenlowercased",
- "extender",
- "dep",
- "olchiki",
- "cwl",
- "graphemebase",
- "phnx",
- "orkh",
- "punct",
- "khar",
- "lower",
- "sterm",
+ "braille",
+ "incombininghalfmarks",
+ "talu",
+ "incjkcompatibilityideographssupplement",
+ "telu",
+ "idsb",
+ "tglg",
+ "inmeeteimayek",
"yi",
+ "phagspa",
+ "yiii",
+ "inarabicmathematicalalphabeticsymbols",
+ "saur",
+ "ogrext",
+ "bidic",
+ "inkanasupplement",
+ "runic",
+ "inalchemicalsymbols",
+ "georgian",
+ "inugaritic",
+ "insaurashtra",
+ "inhighprivateusesurrogates",
+ "pd",
+ "incountingrodnumerals",
+ "inarabicextendeda",
+ "inkharoshthi",
+ "idstrinaryoperator",
+ "phag",
+ "brah",
+ "mark",
+ "hebr",
+ "inkhmersymbols",
+ "dep",
+ "inkhmer",
+ "deprecated",
+ "rejang",
"lyci",
- "cyrl",
+ "intakri",
+ "takr",
+ "incyrillicsupplement",
+ "changeswhencasefolded",
+ "indevanagariextended",
"lycian",
- "finalpunctuation",
- "orya",
- "graphemeextend",
- "kaithi",
- "xpeo",
- "yiii",
- "kthi",
- "cyrillic",
- "glag",
- "oupper",
- "tagb",
- "cwt",
- "number",
- "tglg",
- "knda",
- "lowercaseletter",
+ "inbengali",
+ "beng",
+ "graph",
+ "inyijinghexagramsymbols",
+ "olck",
+ "inarabicsupplement",
+ "inbuginese",
+ "changeswhencasemapped",
+ "olchiki",
+ "inaegeannumbers",
+ "mlym",
+ "alphabetic",
+ "sylotinagri",
"changeswhentitlecased",
- "softdotted",
- "ugar",
- "sylo",
- "lu",
"tagalog",
- "kharoshthi",
+ "tagb",
+ "runr",
+ "malayalam",
+ "inoriya",
+ "intagbanwa",
"syrc",
- "kannada",
- "beng",
- "lowercase",
- "shaw",
- "patternsyntax",
+ "nko",
+ "nkoo",
+ "inethiopicextended",
+ "kaithi",
+ "mathsymbol",
+ "inyiradicals",
+ "insupplementaryprivateuseareaa",
+ "osmanya",
"syriac",
- "word",
- "imperialaramaic",
- "ugaritic",
+ "otherdefaultignorablecodepoint",
+ "number",
+ "inlinearbsyllabary",
+ "kthi",
+ "sund",
+ "mymr",
+ "incombiningdiacriticalmarks",
"enclosingmark",
- "georgian",
+ "incombiningdiacriticalmarksforsymbols",
+ "inethiopicsupplement",
+ "unassigned",
+ "sylo",
+ "combiningmark",
+ "myanmar",
+ "graphemeextend",
+ "bidicontrol",
+ "inhalfwidthandfullwidthforms",
+ "cyrl",
+ "knda",
+ "inunifiedcanadianaboriginalsyllabicsextended",
+ "xsux",
+ "modifiersymbol",
+ "incombiningdiacriticalmarkssupplement",
+ "inhanunoo",
+ "inbuhid",
+ "kannada",
+ "inhebrew",
+ "grbase",
+ "spacingmark",
+ "inkatakanaphoneticextensions",
+ "hangul",
+ "incjksymbolsandpunctuation",
+ "bopo",
+ "orya",
+ "inbopomofo",
+ "kharoshthi",
+ "khar",
+ "changeswhenlowercased",
+ "khmr",
+ "punct",
+ "symbol",
+ "cherokee",
+ "cyrillic",
+ "inkangxiradicals",
+ "hebrew",
+ "inarabicpresentationformsb",
+ "incyrillicextendedb",
+ "ugaritic",
+ "incurrencysymbols",
+ "meroitichieroglyphs",
+ "inhighsurrogates",
+ "nonspacingmark",
"lydi",
+ "patsyn",
+ "orkh",
"lydian",
- "sylotinagri",
- "gujr",
- "tfng",
- "currencysymbol",
-#endif /* USE_UNICODE_PROPERTIES */
- "newline",
-#ifdef USE_UNICODE_PROPERTIES
+ "ugar",
+ "othergraphemeextend",
+ "inlatinextendedb",
"bopomofo",
- "ogrext",
- "cherokee",
+ "khmer",
+ "uideo",
+ "otheruppercase",
+ "grek",
+ "gujr",
"gujarati",
- "newtailue",
- "dashpunctuation",
- "oldsoutharabian",
-#endif /* USE_UNICODE_PROPERTIES */
- "upper",
-#ifndef USE_UNICODE_PROPERTIES
- "ascii",
- "cntrl",
- "space",
- "word",
- "lower",
- "graph",
- "digit",
- "blank"
-#else /* USE_UNICODE_PROPERTIES */
- "cf",
- "buhd",
- "rejang",
- "othergraphemeextend",
- "modifierletter",
- "nonspacingmark",
- "changeswhencasemapped",
- "mark",
+ "inhanguljamoextendedb",
+ "defaultignorablecodepoint",
+ "inplayingcards",
+ "bamu",
+ "inkanbun",
+ "incjkradicalssupplement",
+ "cypriot",
+ "inbamum",
+ "inmeroiticcursive",
+ "oldturkic",
+ "insupplementalarrowsb",
"surrogate",
+ "batk",
+ "inbatak",
+ "inlimbu",
+ "incypriotsyllabary",
+ "dashpunctuation",
+ "innoblock",
+ "hyphen",
+ "insupplementalpunctuation",
+ "ingeorgiansupplement",
+ "oupper",
"paragraphseparator",
- "ogham",
- "hex",
- "uppercaseletter",
- "hexdigit",
- "cwcm",
- "grbase",
- "khmr",
- "unifiedideograph",
+ "inbamumsupplement",
"uppercase",
- "khmer",
- "spacingmark",
- "whitespace",
- "patsyn",
- "cypriot",
+ "currencysymbol",
+ "sk",
+ "lu",
"openpunctuation",
- "bamu",
- "buhid",
- "batk",
- "symbol",
- "changeswhenuppercased",
- "osmanya",
+ "inlisu",
+ "qmark",
+ "egyp",
+ "insupplementaryprivateuseareab",
"limbu",
- "punctuation",
- "hyphen",
- "mathsymbol",
- "grek",
- "changeswhencasefolded",
- "quotationmark",
+ "inegyptianhieroglyphs",
+ "unifiedideograph",
+ "intelugu",
+ "katakana",
+ "inhangulcompatibilityjamo",
+ "upper",
+ "inkayahli",
+ "cwu",
+ "incjkcompatibility",
+ "uppercaseletter",
"bugi",
- "cuneiform",
- "pf",
- "cwcf",
- "bamum",
- "guru",
- "wspace",
- "meeteimayek",
- "defaultignorablecodepoint",
- "modifiersymbol",
- "mlym",
- "mymr",
- "malayalam",
- "myanmar",
- "telugu",
"buginese",
- "xsux",
- "sk",
- "katakana",
- "egyp",
"any",
+ "inyisyllables",
+ "inbopomofoextended",
+ "inboxdrawing",
+ "changeswhenuppercased",
+ "unknown",
+ "quotationmark",
+ "buhd",
+ "punctuation",
+ "oldsoutharabian",
"kayahli",
- "cwu",
- "qmark",
- "blank",
+ "incjkunifiedideographs",
+ "incjkunifiedideographsextensiona",
+ "incjkunifiedideographsextensionc",
+ "telugu",
+ "guru",
+ "greek",
"grlink",
+ "buhid",
"batak",
- "unknown",
- "greek",
+ "blank",
+ "incjkunifiedideographsextensiond",
"graphemelink",
- "gurmukhi",
- "hebrew",
"egyptianhieroglyphs",
- "zyyy"
+ "incjkunifiedideographsextensionb",
+ "zyyy",
+ "gurmukhi"
#endif /* USE_UNICODE_PROPERTIES */
};
#define uniname2ctype_pool ((const char *) &uniname2ctype_pool_contents)
@@ -23125,681 +27365,1289 @@ uniname2ctype_p (str, len)
{
#ifdef USE_UNICODE_PROPERTIES
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3, 33},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3, 34},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str5, 23},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str5, 46},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str7, 35},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str8, 24},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str7, 51},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str10, 20},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str11, 36},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str12, 26},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str13, 17},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str16, 21},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str9, 54},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str16, 208},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str18, 20},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str20, 22},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str20, 18},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str21, 93},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str22, 93},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str23, 150},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str24, 60},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str29, 17},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str30, 19},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str32, 47},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str34, 101},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str35, 114},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str26, 59},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str38, 33},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str42, 14},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str44, 18},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str45, 128},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str49, 401},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str29, 127},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str30, 142},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str31, 142},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str32, 113},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str52, 377},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str62, 226},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str34, 18},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str64, 31},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str66, 239},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str37, 147},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str69, 30},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str40, 147},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str72, 49},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str42, 51},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str74, 32},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str82, 232},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str44, 86},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str84, 412},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str46, 74},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str47, 3},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str48, 74},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str51, 108},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str86, 168},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str90, 382},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str53, 79},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str54, 110},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str55, 115},
- {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str60, 108},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str92, 413},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str96, 252},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str63, 115},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str99, 419},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str100, 304},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str106, 355},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str66, 27},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str67, 49},
- {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str69, 105},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str70, 184},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str71, 46},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str109, 312},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str113, 43},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str114, 430},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str73, 50},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str74, 178},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str75, 151},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str76, 100},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str116, 237},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str84, 157},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str124, 120},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str125, 159},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str132, 24},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str133, 151},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str134, 384},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str135, 432},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str136, 298},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str142, 92},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str151, 347},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str156, 306},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str158, 204},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str167, 356},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str172, 26},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str175, 152},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str88, 113},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str89, 81},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str90, 92},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str91, 197},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str92, 91},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str93, 170},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str94, 14},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str95, 42},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str179, 379},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str180, 276},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str184, 75},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str186, 75},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str187, 111},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str189, 13},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str199, 250},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str201, 272},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str202, 120},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str98, 17},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str99, 170},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str100, 81},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str101, 152},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str205, 23},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str207, 36},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str209, 52},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str216, 247},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str217, 88},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str218, 224},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str103, 182},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str220, 314},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str223, 263},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str224, 385},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str225, 235},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str105, 36},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str106, 26},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str227, 148},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str109, 91},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str230, 358},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str231, 124},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str232, 28},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str233, 172},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str234, 410},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str239, 230},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str240, 148},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str244, 78},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str245, 155},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str247, 160},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str248, 323},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str252, 392},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str253, 78},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str254, 255},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str255, 155},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str256, 80},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str112, 119},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str259, 260},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str114, 38},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str115, 45},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str116, 69},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str117, 197},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str261, 39},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str119, 195},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str120, 66},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str121, 190},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str122, 22},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str123, 152},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str124, 180},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str125, 99},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str126, 161},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str263, 170},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str264, 297},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str268, 300},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str128, 122},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str137, 188},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str143, 193},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str279, 431},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str281, 178},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str288, 3},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str147, 180},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str148, 200},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str149, 98},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str301, 333},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str151, 100},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str152, 53},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str153, 49},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str156, 110},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str303, 64},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str304, 405},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str308, 25},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str161, 162},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str162, 151},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str163, 51},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str313, 182},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str166, 194},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str316, 287},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str170, 194},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str171, 177},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str172, 113},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str320, 88},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str321, 201},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str329, 129},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str330, 65},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str339, 428},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str346, 92},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str347, 114},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str349, 170},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str353, 109},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str357, 109},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str358, 299},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str359, 37},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str360, 50},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str364, 273},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str365, 251},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str174, 182},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str175, 174},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str176, 82},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str367, 238},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str372, 21},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str179, 178},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str180, 179},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str181, 184},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str375, 123},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str378, 182},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str386, 421},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str387, 258},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str183, 195},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str389, 174},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str398, 295},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str400, 150},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str403, 365},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str405, 87},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str406, 189},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str409, 63},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str412, 74},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str414, 416},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str420, 93},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str425, 317},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str426, 99},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str427, 171},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str428, 169},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str429, 82},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str430, 162},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str432, 131},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str436, 28},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str445, 82},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str187, 119},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str449, 185},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str450, 55},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str190, 132},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str453, 70},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str454, 66},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str460, 27},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str468, 253},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str192, 82},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str193, 23},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str470, 151},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str474, 94},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str475, 94},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str476, 188},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str195, 34},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str478, 67},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str197, 187},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str198, 112},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str480, 45},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str481, 278},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str484, 43},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str485, 61},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str490, 42},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str495, 168},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str496, 346},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str497, 205},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str503, 105},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str504, 39},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str200, 27},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str506, 240},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str509, 341},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str202, 43},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str203, 171},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str511, 52},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str206, 38},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str514, 41},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str515, 143},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str516, 143},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str517, 195},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str209, 35},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str520, 426},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str521, 391},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str522, 227},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str524, 19},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str528, 383},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str531, 116},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str532, 9},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str542, 390},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str212, 42},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str545, 281},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str215, 157},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str548, 106},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str553, 178},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str217, 32},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str218, 65},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str555, 67},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str558, 425},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str220, 66},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str560, 206},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str563, 396},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str564, 100},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str568, 325},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str572, 262},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str222, 65},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str223, 1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str574, 153},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str575, 163},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str227, 30},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str579, 315},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str587, 158},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str229, 127},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str589, 423},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str234, 104},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str235, 73},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str236, 77},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str237, 127},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str243, 124},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str244, 159},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str245, 162},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str246, 161},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str594, 23},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str604, 354},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str608, 153},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str250, 77},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str251, 192},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str252, 167},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str612, 209},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str613, 141},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str614, 211},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str616, 280},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str617, 158},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str618, 123},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str619, 42},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str620, 1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str621, 218},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str622, 269},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str623, 219},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str255, 136},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str626, 210},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str627, 185},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str258, 87},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str630, 289},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str631, 202},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str632, 198},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str633, 217},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str261, 87},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str268, 58},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str269, 149},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str270, 186},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str271, 140},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str636, 152},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str637, 357},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str638, 221},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str639, 213},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str640, 282},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str641, 214},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str642, 216},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str643, 203},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str646, 131},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str647, 374},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str648, 187},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str649, 438},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str650, 220},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str651, 212},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str653, 176},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str654, 215},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str655, 386},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str660, 186},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str668, 245},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str275, 190},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str672, 18},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str679, 188},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str278, 7},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str682, 118},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str286, 123},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str292, 154},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str690, 395},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str294, 54},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str701, 402},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str296, 120},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str297, 40},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str703, 403},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str704, 128},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str705, 113},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str706, 344},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str709, 68},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str713, 116},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str715, 404},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str721, 69},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str725, 66},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str301, 43},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str729, 394},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str730, 370},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str734, 128},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str737, 60},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str738, 162},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str739, 192},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str746, 113},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str747, 35},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str748, 125},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str303, 134},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str750, 223},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str306, 175},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str307, 154},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str308, 44},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str771, 160},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str776, 21},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str777, 24},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str778, 57},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str310, 79},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str311, 125},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str780, 54},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str784, 196},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str314, 150},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str787, 105},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str788, 101},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str792, 36},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str796, 408},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str797, 179},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str798, 176},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str799, 102},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str317, 120},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str802, 439},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str803, 7},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str811, 203},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str321, 140},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str322, 167},
- {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str324, 158},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str325, 174},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str326, 129},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str327, 21},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str328, 40},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str335, 112},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str815, 244},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str818, 41},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str340, 166},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str341, 102},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str823, 111},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str824, 192},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str343, 175},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str344, 102},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str345, 97},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str346, 98},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str826, 173},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str827, 303},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str349, 31},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str350, 198},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str353, 50},
- {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str355, 94},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str356, 111},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str830, 186},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str831, 206},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str832, 44},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str833, 146},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str358, 117},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str359, 160},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str835, 229},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str841, 11},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str850, 112},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str851, 400},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str852, 68},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str361, 128},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str854, 352},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str367, 94},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str860, 194},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str867, 190},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str869, 184},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str870, 429},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str371, 111},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str372, 145},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str373, 97},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str374, 83},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str375, 105},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str376, 125},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str874, 368},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str879, 222},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str884, 50},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str889, 35},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str890, 200},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str900, 183},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str901, 51},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str907, 234},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str912, 69},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str913, 202},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str914, 71},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str379, 96},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str380, 201},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str381, 203},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str382, 210},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str383, 211},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str384, 208},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str385, 37},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str386, 39},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str917, 190},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str388, 155},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str389, 202},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str390, 209},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str391, 212},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str392, 207},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str393, 5},
- {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str395, 143},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str396, 9},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str397, 205},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str398, 206},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str399, 78},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str402, 169},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str919, 163},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str920, 59},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str405, 204},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str923, 98},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str931, 133},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str933, 6},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str408, 169},
- {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str413, 193},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str420, 88},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str936, 26},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str422, 52},
- {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str427, 29},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str938, 284},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str939, 369},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str943, 294},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str945, 133},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str946, 319},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str947, 371},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str949, 38},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str950, 418},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str951, 296},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str952, 254},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str953, 53},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str430, 25},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str956, 256},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str960, 308},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str432, 187},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str433, 134},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str434, 189},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str962, 141},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str963, 97},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str964, 283},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str965, 121},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str966, 17},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str970, 83},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str436, 53},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str972, 242},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str973, 37},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str974, 157},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str438, 70},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str976, 173},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str977, 135},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str442, 13},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str443, 163},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str981, 83},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str445, 68},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str446, 186},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str447, 177},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str983, 189},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str452, 19},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str988, 114},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str989, 130},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str990, 95},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str456, 59},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str457, 130},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str994, 277},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str459, 139},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str996, 387},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str997, 310},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str998, 119},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1000, 84},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str462, 181},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1003, 137},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1004, 290},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str464, 143},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str465, 198},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str466, 4},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str474, 139},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1006, 397},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1007, 95},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1010, 285},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str480, 34},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1016, 135},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1021, 25},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1031, 305},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str484, 107},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str485, 48},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str488, 183},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1035, 366},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1039, 16},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str493, 179},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str496, 67},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str497, 20},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1044, 207},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1051, 361},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str502, 137},
- {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str506, 55},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1065, 161},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str508, 118},
- {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str512, 11},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str513, 67},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str516, 104},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1067, 126},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str518, 68},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str521, 16},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1069, 311},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1070, 137},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str523, 101},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str529, 138},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str530, 138},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str533, 141},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str534, 191},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str535, 166},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str536, 137},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1072, 288},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str538, 106},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1074, 27},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str540, 144},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1076, 80},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str542, 60},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str543, 181},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str550, 191},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1078, 345},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1081, 12},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1084, 348},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1087, 302},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1092, 99},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1094, 359},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str554, 141},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str562, 60},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str563, 71},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1107, 167},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1110, 201},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1114, 389},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1129, 293},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1133, 174},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str565, 136},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str573, 163},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1135, 106},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1142, 353},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1147, 183},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str576, 8},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str577, 133},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1150, 4},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1151, 112},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1156, 102},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1162, 140},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1170, 144},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str580, 6},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1173, 121},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1179, 72},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str586, 196},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str587, 109},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str588, 146},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str589, 76},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1185, 261},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1186, 136},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str591, 146},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str592, 41},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str593, 86},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str594, 70},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1188, 249},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str596, 164},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str597, 132},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str598, 109},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str599, 164},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1190, 107},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1195, 381},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1196, 331},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str601, 76},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str602, 129},
- {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str605, 183},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1198, 313},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1202, 420},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1212, 409},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str617, 117},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1215, 172},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1219, 406},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1224, 169},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1225, 373},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1229, 156},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1230, 367},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1231, 264},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1244, 407},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1245, 307},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1249, 175},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1253, 187},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str620, 62},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1256, 184},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str623, 33},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1259, 130},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1261, 200},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1262, 205},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str625, 114},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str626, 89},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str627, 24},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str628, 62},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str629, 192},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1264, 326},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1265, 159},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1274, 44},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1279, 257},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str632, 121},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1282, 145},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1289, 126},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1298, 372},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str634, 131},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1300, 129},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str636, 28},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1302, 437},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str640, 114},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1306, 89},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1307, 194},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str643, 133},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str644, 80},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str645, 89},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str646, 83},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str647, 56},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str656, 122},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1310, 115},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str659, 199},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str660, 80},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1313, 360},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1315, 110},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str663, 12},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1318, 138},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1321, 110},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1323, 424},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1328, 144},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1330, 193},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str667, 159},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1334, 177},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1341, 417},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1343, 103},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1344, 433},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1350, 97},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1351, 388},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1354, 349},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1356, 364},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1362, 40},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1372, 422},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str672, 121},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1377, 241},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str675, 31},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1389, 399},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1393, 195},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1396, 138},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str677, 96},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str678, 148},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1398, 167},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1402, 30},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1404, 79},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1411, 274},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1413, 199},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str681, 148},
- {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str686, 131},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str687, 85},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1416, 268},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1422, 199},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1424, 146},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str692, 130},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1429, 147},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1431, 411},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1432, 175},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1435, 231},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1436, 64},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1438, 350},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str696, 46},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1442, 147},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1443, 243},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str701, 0},
- {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str705, 107},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str706, 185},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str707, 99},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str708, 85},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1448, 84},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str710, 128},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str716, 39},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1450, 5},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str718, 160},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str725, 10},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str732, 19},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1452, 336},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1457, 142},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1460, 236},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str734, 116},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str735, 145},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str736, 185},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1462, 275},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1463, 65},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1468, 142},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1478, 380},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1479, 91},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1480, 56},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str739, 25},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1492, 132},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1498, 63},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str745, 32},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1504, 115},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1505, 118},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1506, 103},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1510, 91},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1512, 246},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str749, 64},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1516, 267},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1517, 81},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1519, 139},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1520, 139},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str752, 29},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1523, 318},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1525, 165},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str757, 22},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str765, 52},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1530, 49},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1531, 339},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1536, 440},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1540, 124},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1546, 81},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1548, 198},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1561, 34},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1565, 378},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1566, 165},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1567, 140},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1569, 96},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1571, 228},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1578, 32},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1581, 292},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str767, 101},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str768, 176},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1583, 259},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1590, 20},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1591, 132},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str772, 28},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1595, 30},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1598, 96},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1605, 71},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1606, 177},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1609, 376},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1617, 77},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1620, 90},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str777, 176},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str778, 64},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1634, 270},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1635, 136},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1636, 48},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1643, 286},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1645, 265},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str781, 71},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str782, 103},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1648, 266},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1649, 90},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1658, 233},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1662, 72},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1664, 31},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str788, 189},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1670, 332},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1676, 98},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1683, 324},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1688, 108},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str792, 57},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str793, 103},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1692, 87},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1699, 327},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str795, 30},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1701, 134},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str797, 168},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str806, 199},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1703, 134},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1709, 61},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1724, 104},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1725, 8},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1729, 46},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1732, 100},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1737, 77},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str816, 124},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1759, 322},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str818, 44},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1761, 79},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1780, 375},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1787, 342},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str821, 156},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1790, 122},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str831, 116},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str840, 165},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1829, 291},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str851, 45},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1831, 171},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1835, 363},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1853, 33},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str856, 61},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str857, 123},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1858, 149},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1864, 207},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str861, 118},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1868, 164},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1871, 149},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str868, 37},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1896, 122},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1899, 193},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1900, 225},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str872, 172},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1904, 108},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1917, 104},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1925, 197},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str888, 48},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1932, 191},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1944, 76},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1949, 86},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1970, 86},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str892, 75},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1983, 362},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1988, 70},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2005, 427},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2022, 157},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str898, 63},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2028, 329},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2033, 321},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str902, 173},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str903, 126},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2046, 125},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2051, 343},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2053, 398},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2055, 164},
+ {-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},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str916, 135},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2086, 309},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2087, 22},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2094, 166},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2102, 279},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2119, 271},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2123, 393},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2129, 40},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2130, 442},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str918, 41},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str927, 63},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2141, 180},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2162, 320},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2165, 316},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2178, 191},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2189, 53},
{-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str932, 156},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str940, 84},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2194, 415},
+ {-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}, {-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}, {-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}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2299, 58},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2313, 47},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2322, 48},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2338, 29},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str944, 168},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2342, 45},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str951, 158},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2349, 340},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2371, 181},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2372, 154},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2377, 441},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2379, 119},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2400, 414},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2401, 197},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2413, 248},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str976, 69},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2429, 107},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str980, 47},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2442, 328},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2454, 10},
+ {-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}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str999, 90},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2495, 351},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2515, 62},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1007, 95},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2523, 334},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2542, 29},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2549, 127},
+ {-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}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2588, 127},
+ {-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}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2627, 15},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2651, 338},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2671, 330},
+ {-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}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2710, 301},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2724, 62},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2727, 208},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2737, 181},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2753, 117},
+ {-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2785, 38},
+ {-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}, {-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}, {-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}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1020, 90},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2888, 161},
+ {-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}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2925, 145},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1026, 95},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2940, 337},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2961, 335},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2962, 435},
+ {-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},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1032, 88},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1033, 126},
- {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1037, 135},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2995, 89},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3000, 85},
{-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}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1093, 47},
- {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1097, 106},
{-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},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1124, 153},
+ {-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3104, 76},
+ {-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}, {-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}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1146, 15},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3189, 73},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3197, 117},
+ {-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}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3254, 166},
+ {-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}, {-1}, {-1}, {-1}, {-1},
{-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1148, 144},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3292, 2},
{-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}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1190, 61},
{-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}, {-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3391, 436},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1263, 173},
{-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}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3459, 73},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1329, 2},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3480, 154},
+ {-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}, {-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}, {-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}, {-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}, {-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}, {-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}, {-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},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1347, 72},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1358, 165},
{-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}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1395, 200},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1410, 75},
{-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}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
#endif /* USE_UNICODE_PROPERTIES */
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
#ifndef USE_UNICODE_PROPERTIES
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str6, 12},
{(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str7, 7},
{(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str8, 8},
{(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str9, 1},
{(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str10, 13},
{(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str11, 11},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str12, 0},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str13, 10},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str14, 14},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str15, 3},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str16, 9},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str17, 12},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str18, 6},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str19, 5},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str20, 4},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str21, 2}
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str12, 10},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str13, 14},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str14, 3},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str15, 9},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str16, 6},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str17, 5},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str18, 4},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str19, 2}
#else /* USE_UNICODE_PROPERTIES */
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1463, 72},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1470, 84},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3802, 434},
+ {-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}, {-1}, {-1}, {-1}, {-1},
@@ -23809,17 +28657,15 @@ uniname2ctype_p (str, len)
{-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},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1556, 78},
{-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3922, 74},
{-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}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1621, 153},
{-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},
@@ -23833,8 +28679,18 @@ uniname2ctype_p (str, len)
{-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},
- {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1741, 73}
+ {-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}, {-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}, {-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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str4167, 85}
#endif /* USE_UNICODE_PROPERTIES */
};
diff --git a/enc/unicode/name2ctype.kwd b/enc/unicode/name2ctype.kwd
index 2e27f3f7de..ff94d68b3b 100644
--- a/enc/unicode/name2ctype.kwd
+++ b/enc/unicode/name2ctype.kwd
@@ -1,6 +1,4273 @@
%{
#define long size_t
+/* 'NEWLINE': [[:NEWLINE:]] */
+static const OnigCodePoint CR_NEWLINE[] = {
+ 1,
+ 0x000a, 0x000a,
+}; /* CR_NEWLINE */
+
+/* 'Alpha': [[:Alpha:]] */
+static const OnigCodePoint CR_Alpha[] = {
+ 540,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0345, 0x0345,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05b0, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0657,
+ 0x0659, 0x065f,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06e1, 0x06e8,
+ 0x06ed, 0x06ef,
+ 0x06fa, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x073f,
+ 0x074d, 0x07b1,
+ 0x07ca, 0x07ea,
+ 0x07f4, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x0817,
+ 0x081a, 0x082c,
+ 0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08e9,
+ 0x08f0, 0x08fe,
+ 0x0900, 0x093b,
+ 0x093d, 0x094c,
+ 0x094e, 0x0950,
+ 0x0955, 0x0963,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bd, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09cc,
+ 0x09ce, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09f0, 0x09f1,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4c,
+ 0x0a51, 0x0a51,
+ 0x0a59, 0x0a5c,
+ 0x0a5e, 0x0a5e,
+ 0x0a70, 0x0a75,
+ 0x0a81, 0x0a83,
+ 0x0a85, 0x0a8d,
+ 0x0a8f, 0x0a91,
+ 0x0a93, 0x0aa8,
+ 0x0aaa, 0x0ab0,
+ 0x0ab2, 0x0ab3,
+ 0x0ab5, 0x0ab9,
+ 0x0abd, 0x0ac5,
+ 0x0ac7, 0x0ac9,
+ 0x0acb, 0x0acc,
+ 0x0ad0, 0x0ad0,
+ 0x0ae0, 0x0ae3,
+ 0x0b01, 0x0b03,
+ 0x0b05, 0x0b0c,
+ 0x0b0f, 0x0b10,
+ 0x0b13, 0x0b28,
+ 0x0b2a, 0x0b30,
+ 0x0b32, 0x0b33,
+ 0x0b35, 0x0b39,
+ 0x0b3d, 0x0b44,
+ 0x0b47, 0x0b48,
+ 0x0b4b, 0x0b4c,
+ 0x0b56, 0x0b57,
+ 0x0b5c, 0x0b5d,
+ 0x0b5f, 0x0b63,
+ 0x0b71, 0x0b71,
+ 0x0b82, 0x0b83,
+ 0x0b85, 0x0b8a,
+ 0x0b8e, 0x0b90,
+ 0x0b92, 0x0b95,
+ 0x0b99, 0x0b9a,
+ 0x0b9c, 0x0b9c,
+ 0x0b9e, 0x0b9f,
+ 0x0ba3, 0x0ba4,
+ 0x0ba8, 0x0baa,
+ 0x0bae, 0x0bb9,
+ 0x0bbe, 0x0bc2,
+ 0x0bc6, 0x0bc8,
+ 0x0bca, 0x0bcc,
+ 0x0bd0, 0x0bd0,
+ 0x0bd7, 0x0bd7,
+ 0x0c01, 0x0c03,
+ 0x0c05, 0x0c0c,
+ 0x0c0e, 0x0c10,
+ 0x0c12, 0x0c28,
+ 0x0c2a, 0x0c33,
+ 0x0c35, 0x0c39,
+ 0x0c3d, 0x0c44,
+ 0x0c46, 0x0c48,
+ 0x0c4a, 0x0c4c,
+ 0x0c55, 0x0c56,
+ 0x0c58, 0x0c59,
+ 0x0c60, 0x0c63,
+ 0x0c82, 0x0c83,
+ 0x0c85, 0x0c8c,
+ 0x0c8e, 0x0c90,
+ 0x0c92, 0x0ca8,
+ 0x0caa, 0x0cb3,
+ 0x0cb5, 0x0cb9,
+ 0x0cbd, 0x0cc4,
+ 0x0cc6, 0x0cc8,
+ 0x0cca, 0x0ccc,
+ 0x0cd5, 0x0cd6,
+ 0x0cde, 0x0cde,
+ 0x0ce0, 0x0ce3,
+ 0x0cf1, 0x0cf2,
+ 0x0d02, 0x0d03,
+ 0x0d05, 0x0d0c,
+ 0x0d0e, 0x0d10,
+ 0x0d12, 0x0d3a,
+ 0x0d3d, 0x0d44,
+ 0x0d46, 0x0d48,
+ 0x0d4a, 0x0d4c,
+ 0x0d4e, 0x0d4e,
+ 0x0d57, 0x0d57,
+ 0x0d60, 0x0d63,
+ 0x0d7a, 0x0d7f,
+ 0x0d82, 0x0d83,
+ 0x0d85, 0x0d96,
+ 0x0d9a, 0x0db1,
+ 0x0db3, 0x0dbb,
+ 0x0dbd, 0x0dbd,
+ 0x0dc0, 0x0dc6,
+ 0x0dcf, 0x0dd4,
+ 0x0dd6, 0x0dd6,
+ 0x0dd8, 0x0ddf,
+ 0x0df2, 0x0df3,
+ 0x0e01, 0x0e3a,
+ 0x0e40, 0x0e46,
+ 0x0e4d, 0x0e4d,
+ 0x0e81, 0x0e82,
+ 0x0e84, 0x0e84,
+ 0x0e87, 0x0e88,
+ 0x0e8a, 0x0e8a,
+ 0x0e8d, 0x0e8d,
+ 0x0e94, 0x0e97,
+ 0x0e99, 0x0e9f,
+ 0x0ea1, 0x0ea3,
+ 0x0ea5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ecd, 0x0ecd,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f00,
+ 0x0f40, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f81,
+ 0x0f88, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x1000, 0x1036,
+ 0x1038, 0x1038,
+ 0x103b, 0x103f,
+ 0x1050, 0x1062,
+ 0x1065, 0x1068,
+ 0x106e, 0x1086,
+ 0x108e, 0x108e,
+ 0x109c, 0x109d,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135f, 0x135f,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1713,
+ 0x1720, 0x1733,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17b3,
+ 0x17b6, 0x17c8,
+ 0x17d7, 0x17d7,
+ 0x17dc, 0x17dc,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x1938,
+ 0x1950, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x1a00, 0x1a1b,
+ 0x1a20, 0x1a5e,
+ 0x1a61, 0x1a74,
+ 0x1aa7, 0x1aa7,
+ 0x1b00, 0x1b33,
+ 0x1b35, 0x1b43,
+ 0x1b45, 0x1b4b,
+ 0x1b80, 0x1ba9,
+ 0x1bac, 0x1baf,
+ 0x1bba, 0x1be5,
+ 0x1be7, 0x1bf1,
+ 0x1c00, 0x1c35,
+ 0x1c4d, 0x1c4f,
+ 0x1c5a, 0x1c7d,
+ 0x1ce9, 0x1cec,
+ 0x1cee, 0x1cf3,
+ 0x1cf5, 0x1cf6,
+ 0x1d00, 0x1dbf,
+ 0x1e00, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fbc,
+ 0x1fbe, 0x1fbe,
+ 0x1fc2, 0x1fc4,
+ 0x1fc6, 0x1fcc,
+ 0x1fd0, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fe0, 0x1fec,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffc,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210a, 0x2113,
+ 0x2115, 0x2115,
+ 0x2119, 0x211d,
+ 0x2124, 0x2124,
+ 0x2126, 0x2126,
+ 0x2128, 0x2128,
+ 0x212a, 0x212d,
+ 0x212f, 0x2139,
+ 0x213c, 0x213f,
+ 0x2145, 0x2149,
+ 0x214e, 0x214e,
+ 0x2160, 0x2188,
+ 0x24b6, 0x24e9,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2ce4,
+ 0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
+ 0x2d6f, 0x2d6f,
+ 0x2d80, 0x2d96,
+ 0x2da0, 0x2da6,
+ 0x2da8, 0x2dae,
+ 0x2db0, 0x2db6,
+ 0x2db8, 0x2dbe,
+ 0x2dc0, 0x2dc6,
+ 0x2dc8, 0x2dce,
+ 0x2dd0, 0x2dd6,
+ 0x2dd8, 0x2dde,
+ 0x2de0, 0x2dff,
+ 0x2e2f, 0x2e2f,
+ 0x3005, 0x3007,
+ 0x3021, 0x3029,
+ 0x3031, 0x3035,
+ 0x3038, 0x303c,
+ 0x3041, 0x3096,
+ 0x309d, 0x309f,
+ 0x30a1, 0x30fa,
+ 0x30fc, 0x30ff,
+ 0x3105, 0x312d,
+ 0x3131, 0x318e,
+ 0x31a0, 0x31ba,
+ 0x31f0, 0x31ff,
+ 0x3400, 0x4db5,
+ 0x4e00, 0x9fcc,
+ 0xa000, 0xa48c,
+ 0xa4d0, 0xa4fd,
+ 0xa500, 0xa60c,
+ 0xa610, 0xa61f,
+ 0xa62a, 0xa62b,
+ 0xa640, 0xa66e,
+ 0xa674, 0xa67b,
+ 0xa67f, 0xa697,
+ 0xa69f, 0xa6ef,
+ 0xa717, 0xa71f,
+ 0xa722, 0xa788,
+ 0xa78b, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa801,
+ 0xa803, 0xa805,
+ 0xa807, 0xa80a,
+ 0xa80c, 0xa827,
+ 0xa840, 0xa873,
+ 0xa880, 0xa8c3,
+ 0xa8f2, 0xa8f7,
+ 0xa8fb, 0xa8fb,
+ 0xa90a, 0xa92a,
+ 0xa930, 0xa952,
+ 0xa960, 0xa97c,
+ 0xa980, 0xa9b2,
+ 0xa9b4, 0xa9bf,
+ 0xa9cf, 0xa9cf,
+ 0xaa00, 0xaa36,
+ 0xaa40, 0xaa4d,
+ 0xaa60, 0xaa76,
+ 0xaa7a, 0xaa7a,
+ 0xaa80, 0xaabe,
+ 0xaac0, 0xaac0,
+ 0xaac2, 0xaac2,
+ 0xaadb, 0xaadd,
+ 0xaae0, 0xaaef,
+ 0xaaf2, 0xaaf5,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabea,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb28,
+ 0xfb2a, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11045,
+ 0x11082, 0x110b8,
+ 0x110d0, 0x110e8,
+ 0x11100, 0x11132,
+ 0x11180, 0x111bf,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116b5,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f93, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Alpha */
+
+/* 'Blank': [[:Blank:]] */
+static const OnigCodePoint CR_Blank[] = {
+ 9,
+ 0x0009, 0x0009,
+ 0x0020, 0x0020,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x180e, 0x180e,
+ 0x2000, 0x200a,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Blank */
+
+/* 'Cntrl': [[:Cntrl:]] */
+static const OnigCodePoint CR_Cntrl[] = {
+ 2,
+ 0x0000, 0x001f,
+ 0x007f, 0x009f,
+}; /* CR_Cntrl */
+
+/* 'Digit': [[:Digit:]] */
+static const OnigCodePoint CR_Digit[] = {
+ 42,
+ 0x0030, 0x0039,
+ 0x0660, 0x0669,
+ 0x06f0, 0x06f9,
+ 0x07c0, 0x07c9,
+ 0x0966, 0x096f,
+ 0x09e6, 0x09ef,
+ 0x0a66, 0x0a6f,
+ 0x0ae6, 0x0aef,
+ 0x0b66, 0x0b6f,
+ 0x0be6, 0x0bef,
+ 0x0c66, 0x0c6f,
+ 0x0ce6, 0x0cef,
+ 0x0d66, 0x0d6f,
+ 0x0e50, 0x0e59,
+ 0x0ed0, 0x0ed9,
+ 0x0f20, 0x0f29,
+ 0x1040, 0x1049,
+ 0x1090, 0x1099,
+ 0x17e0, 0x17e9,
+ 0x1810, 0x1819,
+ 0x1946, 0x194f,
+ 0x19d0, 0x19d9,
+ 0x1a80, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1b50, 0x1b59,
+ 0x1bb0, 0x1bb9,
+ 0x1c40, 0x1c49,
+ 0x1c50, 0x1c59,
+ 0xa620, 0xa629,
+ 0xa8d0, 0xa8d9,
+ 0xa900, 0xa909,
+ 0xa9d0, 0xa9d9,
+ 0xaa50, 0xaa59,
+ 0xabf0, 0xabf9,
+ 0xff10, 0xff19,
+ 0x104a0, 0x104a9,
+ 0x11066, 0x1106f,
+ 0x110f0, 0x110f9,
+ 0x11136, 0x1113f,
+ 0x111d0, 0x111d9,
+ 0x116c0, 0x116c9,
+ 0x1d7ce, 0x1d7ff,
+}; /* CR_Digit */
+
+/* 'Graph': [[:Graph:]] */
+static const OnigCodePoint CR_Graph[] = {
+ 544,
+ 0x0021, 0x007e,
+ 0x00a1, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x058f, 0x058f,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0604,
+ 0x0606, 0x061b,
+ 0x061e, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09fb,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3c, 0x0a3c,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4d,
+ 0x0a51, 0x0a51,
+ 0x0a59, 0x0a5c,
+ 0x0a5e, 0x0a5e,
+ 0x0a66, 0x0a75,
+ 0x0a81, 0x0a83,
+ 0x0a85, 0x0a8d,
+ 0x0a8f, 0x0a91,
+ 0x0a93, 0x0aa8,
+ 0x0aaa, 0x0ab0,
+ 0x0ab2, 0x0ab3,
+ 0x0ab5, 0x0ab9,
+ 0x0abc, 0x0ac5,
+ 0x0ac7, 0x0ac9,
+ 0x0acb, 0x0acd,
+ 0x0ad0, 0x0ad0,
+ 0x0ae0, 0x0ae3,
+ 0x0ae6, 0x0af1,
+ 0x0b01, 0x0b03,
+ 0x0b05, 0x0b0c,
+ 0x0b0f, 0x0b10,
+ 0x0b13, 0x0b28,
+ 0x0b2a, 0x0b30,
+ 0x0b32, 0x0b33,
+ 0x0b35, 0x0b39,
+ 0x0b3c, 0x0b44,
+ 0x0b47, 0x0b48,
+ 0x0b4b, 0x0b4d,
+ 0x0b56, 0x0b57,
+ 0x0b5c, 0x0b5d,
+ 0x0b5f, 0x0b63,
+ 0x0b66, 0x0b77,
+ 0x0b82, 0x0b83,
+ 0x0b85, 0x0b8a,
+ 0x0b8e, 0x0b90,
+ 0x0b92, 0x0b95,
+ 0x0b99, 0x0b9a,
+ 0x0b9c, 0x0b9c,
+ 0x0b9e, 0x0b9f,
+ 0x0ba3, 0x0ba4,
+ 0x0ba8, 0x0baa,
+ 0x0bae, 0x0bb9,
+ 0x0bbe, 0x0bc2,
+ 0x0bc6, 0x0bc8,
+ 0x0bca, 0x0bcd,
+ 0x0bd0, 0x0bd0,
+ 0x0bd7, 0x0bd7,
+ 0x0be6, 0x0bfa,
+ 0x0c01, 0x0c03,
+ 0x0c05, 0x0c0c,
+ 0x0c0e, 0x0c10,
+ 0x0c12, 0x0c28,
+ 0x0c2a, 0x0c33,
+ 0x0c35, 0x0c39,
+ 0x0c3d, 0x0c44,
+ 0x0c46, 0x0c48,
+ 0x0c4a, 0x0c4d,
+ 0x0c55, 0x0c56,
+ 0x0c58, 0x0c59,
+ 0x0c60, 0x0c63,
+ 0x0c66, 0x0c6f,
+ 0x0c78, 0x0c7f,
+ 0x0c82, 0x0c83,
+ 0x0c85, 0x0c8c,
+ 0x0c8e, 0x0c90,
+ 0x0c92, 0x0ca8,
+ 0x0caa, 0x0cb3,
+ 0x0cb5, 0x0cb9,
+ 0x0cbc, 0x0cc4,
+ 0x0cc6, 0x0cc8,
+ 0x0cca, 0x0ccd,
+ 0x0cd5, 0x0cd6,
+ 0x0cde, 0x0cde,
+ 0x0ce0, 0x0ce3,
+ 0x0ce6, 0x0cef,
+ 0x0cf1, 0x0cf2,
+ 0x0d02, 0x0d03,
+ 0x0d05, 0x0d0c,
+ 0x0d0e, 0x0d10,
+ 0x0d12, 0x0d3a,
+ 0x0d3d, 0x0d44,
+ 0x0d46, 0x0d48,
+ 0x0d4a, 0x0d4e,
+ 0x0d57, 0x0d57,
+ 0x0d60, 0x0d63,
+ 0x0d66, 0x0d75,
+ 0x0d79, 0x0d7f,
+ 0x0d82, 0x0d83,
+ 0x0d85, 0x0d96,
+ 0x0d9a, 0x0db1,
+ 0x0db3, 0x0dbb,
+ 0x0dbd, 0x0dbd,
+ 0x0dc0, 0x0dc6,
+ 0x0dca, 0x0dca,
+ 0x0dcf, 0x0dd4,
+ 0x0dd6, 0x0dd6,
+ 0x0dd8, 0x0ddf,
+ 0x0df2, 0x0df4,
+ 0x0e01, 0x0e3a,
+ 0x0e3f, 0x0e5b,
+ 0x0e81, 0x0e82,
+ 0x0e84, 0x0e84,
+ 0x0e87, 0x0e88,
+ 0x0e8a, 0x0e8a,
+ 0x0e8d, 0x0e8d,
+ 0x0e94, 0x0e97,
+ 0x0e99, 0x0e9f,
+ 0x0ea1, 0x0ea3,
+ 0x0ea5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ec8, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fbe, 0x0fcc,
+ 0x0fce, 0x0fda,
+ 0x1000, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135d, 0x137c,
+ 0x1380, 0x1399,
+ 0x13a0, 0x13f4,
+ 0x1400, 0x167f,
+ 0x1681, 0x169c,
+ 0x16a0, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+ 0x1720, 0x1736,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17dd,
+ 0x17e0, 0x17e9,
+ 0x17f0, 0x17f9,
+ 0x1800, 0x180d,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1940, 0x1940,
+ 0x1944, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19da,
+ 0x19de, 0x1a1b,
+ 0x1a1e, 0x1a5e,
+ 0x1a60, 0x1a7c,
+ 0x1a7f, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa0, 0x1aad,
+ 0x1b00, 0x1b4b,
+ 0x1b50, 0x1b7c,
+ 0x1b80, 0x1bf3,
+ 0x1bfc, 0x1c37,
+ 0x1c3b, 0x1c49,
+ 0x1c4d, 0x1c7f,
+ 0x1cc0, 0x1cc7,
+ 0x1cd0, 0x1cf6,
+ 0x1d00, 0x1de6,
+ 0x1dfc, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fc4,
+ 0x1fc6, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fdd, 0x1fef,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffe,
+ 0x200b, 0x2027,
+ 0x202a, 0x202e,
+ 0x2030, 0x205e,
+ 0x2060, 0x2064,
+ 0x206a, 0x2071,
+ 0x2074, 0x208e,
+ 0x2090, 0x209c,
+ 0x20a0, 0x20b9,
+ 0x20d0, 0x20f0,
+ 0x2100, 0x2189,
+ 0x2190, 0x23f3,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x2460, 0x26ff,
+ 0x2701, 0x2b4c,
+ 0x2b50, 0x2b59,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2cf3,
+ 0x2cf9, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
+ 0x2d6f, 0x2d70,
+ 0x2d7f, 0x2d96,
+ 0x2da0, 0x2da6,
+ 0x2da8, 0x2dae,
+ 0x2db0, 0x2db6,
+ 0x2db8, 0x2dbe,
+ 0x2dc0, 0x2dc6,
+ 0x2dc8, 0x2dce,
+ 0x2dd0, 0x2dd6,
+ 0x2dd8, 0x2dde,
+ 0x2de0, 0x2e3b,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+ 0x2ff0, 0x2ffb,
+ 0x3001, 0x303f,
+ 0x3041, 0x3096,
+ 0x3099, 0x30ff,
+ 0x3105, 0x312d,
+ 0x3131, 0x318e,
+ 0x3190, 0x31ba,
+ 0x31c0, 0x31e3,
+ 0x31f0, 0x321e,
+ 0x3220, 0x32fe,
+ 0x3300, 0x4db5,
+ 0x4dc0, 0x9fcc,
+ 0xa000, 0xa48c,
+ 0xa490, 0xa4c6,
+ 0xa4d0, 0xa62b,
+ 0xa640, 0xa697,
+ 0xa69f, 0xa6f7,
+ 0xa700, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa82b,
+ 0xa830, 0xa839,
+ 0xa840, 0xa877,
+ 0xa880, 0xa8c4,
+ 0xa8ce, 0xa8d9,
+ 0xa8e0, 0xa8fb,
+ 0xa900, 0xa953,
+ 0xa95f, 0xa97c,
+ 0xa980, 0xa9cd,
+ 0xa9cf, 0xa9d9,
+ 0xa9de, 0xa9df,
+ 0xaa00, 0xaa36,
+ 0xaa40, 0xaa4d,
+ 0xaa50, 0xaa59,
+ 0xaa5c, 0xaa7b,
+ 0xaa80, 0xaac2,
+ 0xaadb, 0xaaf6,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabed,
+ 0xabf0, 0xabf9,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xe000, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbc1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfd,
+ 0xfe00, 0xfe19,
+ 0xfe20, 0xfe26,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xfeff, 0xfeff,
+ 0xff01, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfff9, 0xfffd,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1018a,
+ 0x10190, 0x1019b,
+ 0x101d0, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x103c3,
+ 0x103c8, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10857, 0x1085f,
+ 0x10900, 0x1091b,
+ 0x1091f, 0x10939,
+ 0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x10a60, 0x10a7f,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b7f,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x11080, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d1dd,
+ 0x1d200, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1d360, 0x1d371,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
+ 0x1f000, 0x1f02b,
+ 0x1f030, 0x1f093,
+ 0x1f0a0, 0x1f0ae,
+ 0x1f0b1, 0x1f0be,
+ 0x1f0c1, 0x1f0cf,
+ 0x1f0d1, 0x1f0df,
+ 0x1f100, 0x1f10a,
+ 0x1f110, 0x1f12e,
+ 0x1f130, 0x1f16b,
+ 0x1f170, 0x1f19a,
+ 0x1f1e6, 0x1f202,
+ 0x1f210, 0x1f23a,
+ 0x1f240, 0x1f248,
+ 0x1f250, 0x1f251,
+ 0x1f300, 0x1f320,
+ 0x1f330, 0x1f335,
+ 0x1f337, 0x1f37c,
+ 0x1f380, 0x1f393,
+ 0x1f3a0, 0x1f3c4,
+ 0x1f3c6, 0x1f3ca,
+ 0x1f3e0, 0x1f3f0,
+ 0x1f400, 0x1f43e,
+ 0x1f440, 0x1f440,
+ 0x1f442, 0x1f4f7,
+ 0x1f4f9, 0x1f4fc,
+ 0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
+ 0x1f550, 0x1f567,
+ 0x1f5fb, 0x1f640,
+ 0x1f645, 0x1f64f,
+ 0x1f680, 0x1f6c5,
+ 0x1f700, 0x1f773,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+ 0xf0000, 0xffffd,
+ 0x100000, 0x10fffd,
+}; /* CR_Graph */
+
+/* 'Lower': [[:Lower:]] */
+static const OnigCodePoint CR_Lower[] = {
+ 618,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00df, 0x00f6,
+ 0x00f8, 0x00ff,
+ 0x0101, 0x0101,
+ 0x0103, 0x0103,
+ 0x0105, 0x0105,
+ 0x0107, 0x0107,
+ 0x0109, 0x0109,
+ 0x010b, 0x010b,
+ 0x010d, 0x010d,
+ 0x010f, 0x010f,
+ 0x0111, 0x0111,
+ 0x0113, 0x0113,
+ 0x0115, 0x0115,
+ 0x0117, 0x0117,
+ 0x0119, 0x0119,
+ 0x011b, 0x011b,
+ 0x011d, 0x011d,
+ 0x011f, 0x011f,
+ 0x0121, 0x0121,
+ 0x0123, 0x0123,
+ 0x0125, 0x0125,
+ 0x0127, 0x0127,
+ 0x0129, 0x0129,
+ 0x012b, 0x012b,
+ 0x012d, 0x012d,
+ 0x012f, 0x012f,
+ 0x0131, 0x0131,
+ 0x0133, 0x0133,
+ 0x0135, 0x0135,
+ 0x0137, 0x0138,
+ 0x013a, 0x013a,
+ 0x013c, 0x013c,
+ 0x013e, 0x013e,
+ 0x0140, 0x0140,
+ 0x0142, 0x0142,
+ 0x0144, 0x0144,
+ 0x0146, 0x0146,
+ 0x0148, 0x0149,
+ 0x014b, 0x014b,
+ 0x014d, 0x014d,
+ 0x014f, 0x014f,
+ 0x0151, 0x0151,
+ 0x0153, 0x0153,
+ 0x0155, 0x0155,
+ 0x0157, 0x0157,
+ 0x0159, 0x0159,
+ 0x015b, 0x015b,
+ 0x015d, 0x015d,
+ 0x015f, 0x015f,
+ 0x0161, 0x0161,
+ 0x0163, 0x0163,
+ 0x0165, 0x0165,
+ 0x0167, 0x0167,
+ 0x0169, 0x0169,
+ 0x016b, 0x016b,
+ 0x016d, 0x016d,
+ 0x016f, 0x016f,
+ 0x0171, 0x0171,
+ 0x0173, 0x0173,
+ 0x0175, 0x0175,
+ 0x0177, 0x0177,
+ 0x017a, 0x017a,
+ 0x017c, 0x017c,
+ 0x017e, 0x0180,
+ 0x0183, 0x0183,
+ 0x0185, 0x0185,
+ 0x0188, 0x0188,
+ 0x018c, 0x018d,
+ 0x0192, 0x0192,
+ 0x0195, 0x0195,
+ 0x0199, 0x019b,
+ 0x019e, 0x019e,
+ 0x01a1, 0x01a1,
+ 0x01a3, 0x01a3,
+ 0x01a5, 0x01a5,
+ 0x01a8, 0x01a8,
+ 0x01aa, 0x01ab,
+ 0x01ad, 0x01ad,
+ 0x01b0, 0x01b0,
+ 0x01b4, 0x01b4,
+ 0x01b6, 0x01b6,
+ 0x01b9, 0x01ba,
+ 0x01bd, 0x01bf,
+ 0x01c6, 0x01c6,
+ 0x01c9, 0x01c9,
+ 0x01cc, 0x01cc,
+ 0x01ce, 0x01ce,
+ 0x01d0, 0x01d0,
+ 0x01d2, 0x01d2,
+ 0x01d4, 0x01d4,
+ 0x01d6, 0x01d6,
+ 0x01d8, 0x01d8,
+ 0x01da, 0x01da,
+ 0x01dc, 0x01dd,
+ 0x01df, 0x01df,
+ 0x01e1, 0x01e1,
+ 0x01e3, 0x01e3,
+ 0x01e5, 0x01e5,
+ 0x01e7, 0x01e7,
+ 0x01e9, 0x01e9,
+ 0x01eb, 0x01eb,
+ 0x01ed, 0x01ed,
+ 0x01ef, 0x01f0,
+ 0x01f3, 0x01f3,
+ 0x01f5, 0x01f5,
+ 0x01f9, 0x01f9,
+ 0x01fb, 0x01fb,
+ 0x01fd, 0x01fd,
+ 0x01ff, 0x01ff,
+ 0x0201, 0x0201,
+ 0x0203, 0x0203,
+ 0x0205, 0x0205,
+ 0x0207, 0x0207,
+ 0x0209, 0x0209,
+ 0x020b, 0x020b,
+ 0x020d, 0x020d,
+ 0x020f, 0x020f,
+ 0x0211, 0x0211,
+ 0x0213, 0x0213,
+ 0x0215, 0x0215,
+ 0x0217, 0x0217,
+ 0x0219, 0x0219,
+ 0x021b, 0x021b,
+ 0x021d, 0x021d,
+ 0x021f, 0x021f,
+ 0x0221, 0x0221,
+ 0x0223, 0x0223,
+ 0x0225, 0x0225,
+ 0x0227, 0x0227,
+ 0x0229, 0x0229,
+ 0x022b, 0x022b,
+ 0x022d, 0x022d,
+ 0x022f, 0x022f,
+ 0x0231, 0x0231,
+ 0x0233, 0x0239,
+ 0x023c, 0x023c,
+ 0x023f, 0x0240,
+ 0x0242, 0x0242,
+ 0x0247, 0x0247,
+ 0x0249, 0x0249,
+ 0x024b, 0x024b,
+ 0x024d, 0x024d,
+ 0x024f, 0x0293,
+ 0x0295, 0x02b8,
+ 0x02c0, 0x02c1,
+ 0x02e0, 0x02e4,
+ 0x0345, 0x0345,
+ 0x0371, 0x0371,
+ 0x0373, 0x0373,
+ 0x0377, 0x0377,
+ 0x037a, 0x037d,
+ 0x0390, 0x0390,
+ 0x03ac, 0x03ce,
+ 0x03d0, 0x03d1,
+ 0x03d5, 0x03d7,
+ 0x03d9, 0x03d9,
+ 0x03db, 0x03db,
+ 0x03dd, 0x03dd,
+ 0x03df, 0x03df,
+ 0x03e1, 0x03e1,
+ 0x03e3, 0x03e3,
+ 0x03e5, 0x03e5,
+ 0x03e7, 0x03e7,
+ 0x03e9, 0x03e9,
+ 0x03eb, 0x03eb,
+ 0x03ed, 0x03ed,
+ 0x03ef, 0x03f3,
+ 0x03f5, 0x03f5,
+ 0x03f8, 0x03f8,
+ 0x03fb, 0x03fc,
+ 0x0430, 0x045f,
+ 0x0461, 0x0461,
+ 0x0463, 0x0463,
+ 0x0465, 0x0465,
+ 0x0467, 0x0467,
+ 0x0469, 0x0469,
+ 0x046b, 0x046b,
+ 0x046d, 0x046d,
+ 0x046f, 0x046f,
+ 0x0471, 0x0471,
+ 0x0473, 0x0473,
+ 0x0475, 0x0475,
+ 0x0477, 0x0477,
+ 0x0479, 0x0479,
+ 0x047b, 0x047b,
+ 0x047d, 0x047d,
+ 0x047f, 0x047f,
+ 0x0481, 0x0481,
+ 0x048b, 0x048b,
+ 0x048d, 0x048d,
+ 0x048f, 0x048f,
+ 0x0491, 0x0491,
+ 0x0493, 0x0493,
+ 0x0495, 0x0495,
+ 0x0497, 0x0497,
+ 0x0499, 0x0499,
+ 0x049b, 0x049b,
+ 0x049d, 0x049d,
+ 0x049f, 0x049f,
+ 0x04a1, 0x04a1,
+ 0x04a3, 0x04a3,
+ 0x04a5, 0x04a5,
+ 0x04a7, 0x04a7,
+ 0x04a9, 0x04a9,
+ 0x04ab, 0x04ab,
+ 0x04ad, 0x04ad,
+ 0x04af, 0x04af,
+ 0x04b1, 0x04b1,
+ 0x04b3, 0x04b3,
+ 0x04b5, 0x04b5,
+ 0x04b7, 0x04b7,
+ 0x04b9, 0x04b9,
+ 0x04bb, 0x04bb,
+ 0x04bd, 0x04bd,
+ 0x04bf, 0x04bf,
+ 0x04c2, 0x04c2,
+ 0x04c4, 0x04c4,
+ 0x04c6, 0x04c6,
+ 0x04c8, 0x04c8,
+ 0x04ca, 0x04ca,
+ 0x04cc, 0x04cc,
+ 0x04ce, 0x04cf,
+ 0x04d1, 0x04d1,
+ 0x04d3, 0x04d3,
+ 0x04d5, 0x04d5,
+ 0x04d7, 0x04d7,
+ 0x04d9, 0x04d9,
+ 0x04db, 0x04db,
+ 0x04dd, 0x04dd,
+ 0x04df, 0x04df,
+ 0x04e1, 0x04e1,
+ 0x04e3, 0x04e3,
+ 0x04e5, 0x04e5,
+ 0x04e7, 0x04e7,
+ 0x04e9, 0x04e9,
+ 0x04eb, 0x04eb,
+ 0x04ed, 0x04ed,
+ 0x04ef, 0x04ef,
+ 0x04f1, 0x04f1,
+ 0x04f3, 0x04f3,
+ 0x04f5, 0x04f5,
+ 0x04f7, 0x04f7,
+ 0x04f9, 0x04f9,
+ 0x04fb, 0x04fb,
+ 0x04fd, 0x04fd,
+ 0x04ff, 0x04ff,
+ 0x0501, 0x0501,
+ 0x0503, 0x0503,
+ 0x0505, 0x0505,
+ 0x0507, 0x0507,
+ 0x0509, 0x0509,
+ 0x050b, 0x050b,
+ 0x050d, 0x050d,
+ 0x050f, 0x050f,
+ 0x0511, 0x0511,
+ 0x0513, 0x0513,
+ 0x0515, 0x0515,
+ 0x0517, 0x0517,
+ 0x0519, 0x0519,
+ 0x051b, 0x051b,
+ 0x051d, 0x051d,
+ 0x051f, 0x051f,
+ 0x0521, 0x0521,
+ 0x0523, 0x0523,
+ 0x0525, 0x0525,
+ 0x0527, 0x0527,
+ 0x0561, 0x0587,
+ 0x1d00, 0x1dbf,
+ 0x1e01, 0x1e01,
+ 0x1e03, 0x1e03,
+ 0x1e05, 0x1e05,
+ 0x1e07, 0x1e07,
+ 0x1e09, 0x1e09,
+ 0x1e0b, 0x1e0b,
+ 0x1e0d, 0x1e0d,
+ 0x1e0f, 0x1e0f,
+ 0x1e11, 0x1e11,
+ 0x1e13, 0x1e13,
+ 0x1e15, 0x1e15,
+ 0x1e17, 0x1e17,
+ 0x1e19, 0x1e19,
+ 0x1e1b, 0x1e1b,
+ 0x1e1d, 0x1e1d,
+ 0x1e1f, 0x1e1f,
+ 0x1e21, 0x1e21,
+ 0x1e23, 0x1e23,
+ 0x1e25, 0x1e25,
+ 0x1e27, 0x1e27,
+ 0x1e29, 0x1e29,
+ 0x1e2b, 0x1e2b,
+ 0x1e2d, 0x1e2d,
+ 0x1e2f, 0x1e2f,
+ 0x1e31, 0x1e31,
+ 0x1e33, 0x1e33,
+ 0x1e35, 0x1e35,
+ 0x1e37, 0x1e37,
+ 0x1e39, 0x1e39,
+ 0x1e3b, 0x1e3b,
+ 0x1e3d, 0x1e3d,
+ 0x1e3f, 0x1e3f,
+ 0x1e41, 0x1e41,
+ 0x1e43, 0x1e43,
+ 0x1e45, 0x1e45,
+ 0x1e47, 0x1e47,
+ 0x1e49, 0x1e49,
+ 0x1e4b, 0x1e4b,
+ 0x1e4d, 0x1e4d,
+ 0x1e4f, 0x1e4f,
+ 0x1e51, 0x1e51,
+ 0x1e53, 0x1e53,
+ 0x1e55, 0x1e55,
+ 0x1e57, 0x1e57,
+ 0x1e59, 0x1e59,
+ 0x1e5b, 0x1e5b,
+ 0x1e5d, 0x1e5d,
+ 0x1e5f, 0x1e5f,
+ 0x1e61, 0x1e61,
+ 0x1e63, 0x1e63,
+ 0x1e65, 0x1e65,
+ 0x1e67, 0x1e67,
+ 0x1e69, 0x1e69,
+ 0x1e6b, 0x1e6b,
+ 0x1e6d, 0x1e6d,
+ 0x1e6f, 0x1e6f,
+ 0x1e71, 0x1e71,
+ 0x1e73, 0x1e73,
+ 0x1e75, 0x1e75,
+ 0x1e77, 0x1e77,
+ 0x1e79, 0x1e79,
+ 0x1e7b, 0x1e7b,
+ 0x1e7d, 0x1e7d,
+ 0x1e7f, 0x1e7f,
+ 0x1e81, 0x1e81,
+ 0x1e83, 0x1e83,
+ 0x1e85, 0x1e85,
+ 0x1e87, 0x1e87,
+ 0x1e89, 0x1e89,
+ 0x1e8b, 0x1e8b,
+ 0x1e8d, 0x1e8d,
+ 0x1e8f, 0x1e8f,
+ 0x1e91, 0x1e91,
+ 0x1e93, 0x1e93,
+ 0x1e95, 0x1e9d,
+ 0x1e9f, 0x1e9f,
+ 0x1ea1, 0x1ea1,
+ 0x1ea3, 0x1ea3,
+ 0x1ea5, 0x1ea5,
+ 0x1ea7, 0x1ea7,
+ 0x1ea9, 0x1ea9,
+ 0x1eab, 0x1eab,
+ 0x1ead, 0x1ead,
+ 0x1eaf, 0x1eaf,
+ 0x1eb1, 0x1eb1,
+ 0x1eb3, 0x1eb3,
+ 0x1eb5, 0x1eb5,
+ 0x1eb7, 0x1eb7,
+ 0x1eb9, 0x1eb9,
+ 0x1ebb, 0x1ebb,
+ 0x1ebd, 0x1ebd,
+ 0x1ebf, 0x1ebf,
+ 0x1ec1, 0x1ec1,
+ 0x1ec3, 0x1ec3,
+ 0x1ec5, 0x1ec5,
+ 0x1ec7, 0x1ec7,
+ 0x1ec9, 0x1ec9,
+ 0x1ecb, 0x1ecb,
+ 0x1ecd, 0x1ecd,
+ 0x1ecf, 0x1ecf,
+ 0x1ed1, 0x1ed1,
+ 0x1ed3, 0x1ed3,
+ 0x1ed5, 0x1ed5,
+ 0x1ed7, 0x1ed7,
+ 0x1ed9, 0x1ed9,
+ 0x1edb, 0x1edb,
+ 0x1edd, 0x1edd,
+ 0x1edf, 0x1edf,
+ 0x1ee1, 0x1ee1,
+ 0x1ee3, 0x1ee3,
+ 0x1ee5, 0x1ee5,
+ 0x1ee7, 0x1ee7,
+ 0x1ee9, 0x1ee9,
+ 0x1eeb, 0x1eeb,
+ 0x1eed, 0x1eed,
+ 0x1eef, 0x1eef,
+ 0x1ef1, 0x1ef1,
+ 0x1ef3, 0x1ef3,
+ 0x1ef5, 0x1ef5,
+ 0x1ef7, 0x1ef7,
+ 0x1ef9, 0x1ef9,
+ 0x1efb, 0x1efb,
+ 0x1efd, 0x1efd,
+ 0x1eff, 0x1f07,
+ 0x1f10, 0x1f15,
+ 0x1f20, 0x1f27,
+ 0x1f30, 0x1f37,
+ 0x1f40, 0x1f45,
+ 0x1f50, 0x1f57,
+ 0x1f60, 0x1f67,
+ 0x1f70, 0x1f7d,
+ 0x1f80, 0x1f87,
+ 0x1f90, 0x1f97,
+ 0x1fa0, 0x1fa7,
+ 0x1fb0, 0x1fb4,
+ 0x1fb6, 0x1fb7,
+ 0x1fbe, 0x1fbe,
+ 0x1fc2, 0x1fc4,
+ 0x1fc6, 0x1fc7,
+ 0x1fd0, 0x1fd3,
+ 0x1fd6, 0x1fd7,
+ 0x1fe0, 0x1fe7,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ff7,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x210a, 0x210a,
+ 0x210e, 0x210f,
+ 0x2113, 0x2113,
+ 0x212f, 0x212f,
+ 0x2134, 0x2134,
+ 0x2139, 0x2139,
+ 0x213c, 0x213d,
+ 0x2146, 0x2149,
+ 0x214e, 0x214e,
+ 0x2170, 0x217f,
+ 0x2184, 0x2184,
+ 0x24d0, 0x24e9,
+ 0x2c30, 0x2c5e,
+ 0x2c61, 0x2c61,
+ 0x2c65, 0x2c66,
+ 0x2c68, 0x2c68,
+ 0x2c6a, 0x2c6a,
+ 0x2c6c, 0x2c6c,
+ 0x2c71, 0x2c71,
+ 0x2c73, 0x2c74,
+ 0x2c76, 0x2c7d,
+ 0x2c81, 0x2c81,
+ 0x2c83, 0x2c83,
+ 0x2c85, 0x2c85,
+ 0x2c87, 0x2c87,
+ 0x2c89, 0x2c89,
+ 0x2c8b, 0x2c8b,
+ 0x2c8d, 0x2c8d,
+ 0x2c8f, 0x2c8f,
+ 0x2c91, 0x2c91,
+ 0x2c93, 0x2c93,
+ 0x2c95, 0x2c95,
+ 0x2c97, 0x2c97,
+ 0x2c99, 0x2c99,
+ 0x2c9b, 0x2c9b,
+ 0x2c9d, 0x2c9d,
+ 0x2c9f, 0x2c9f,
+ 0x2ca1, 0x2ca1,
+ 0x2ca3, 0x2ca3,
+ 0x2ca5, 0x2ca5,
+ 0x2ca7, 0x2ca7,
+ 0x2ca9, 0x2ca9,
+ 0x2cab, 0x2cab,
+ 0x2cad, 0x2cad,
+ 0x2caf, 0x2caf,
+ 0x2cb1, 0x2cb1,
+ 0x2cb3, 0x2cb3,
+ 0x2cb5, 0x2cb5,
+ 0x2cb7, 0x2cb7,
+ 0x2cb9, 0x2cb9,
+ 0x2cbb, 0x2cbb,
+ 0x2cbd, 0x2cbd,
+ 0x2cbf, 0x2cbf,
+ 0x2cc1, 0x2cc1,
+ 0x2cc3, 0x2cc3,
+ 0x2cc5, 0x2cc5,
+ 0x2cc7, 0x2cc7,
+ 0x2cc9, 0x2cc9,
+ 0x2ccb, 0x2ccb,
+ 0x2ccd, 0x2ccd,
+ 0x2ccf, 0x2ccf,
+ 0x2cd1, 0x2cd1,
+ 0x2cd3, 0x2cd3,
+ 0x2cd5, 0x2cd5,
+ 0x2cd7, 0x2cd7,
+ 0x2cd9, 0x2cd9,
+ 0x2cdb, 0x2cdb,
+ 0x2cdd, 0x2cdd,
+ 0x2cdf, 0x2cdf,
+ 0x2ce1, 0x2ce1,
+ 0x2ce3, 0x2ce4,
+ 0x2cec, 0x2cec,
+ 0x2cee, 0x2cee,
+ 0x2cf3, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0xa641, 0xa641,
+ 0xa643, 0xa643,
+ 0xa645, 0xa645,
+ 0xa647, 0xa647,
+ 0xa649, 0xa649,
+ 0xa64b, 0xa64b,
+ 0xa64d, 0xa64d,
+ 0xa64f, 0xa64f,
+ 0xa651, 0xa651,
+ 0xa653, 0xa653,
+ 0xa655, 0xa655,
+ 0xa657, 0xa657,
+ 0xa659, 0xa659,
+ 0xa65b, 0xa65b,
+ 0xa65d, 0xa65d,
+ 0xa65f, 0xa65f,
+ 0xa661, 0xa661,
+ 0xa663, 0xa663,
+ 0xa665, 0xa665,
+ 0xa667, 0xa667,
+ 0xa669, 0xa669,
+ 0xa66b, 0xa66b,
+ 0xa66d, 0xa66d,
+ 0xa681, 0xa681,
+ 0xa683, 0xa683,
+ 0xa685, 0xa685,
+ 0xa687, 0xa687,
+ 0xa689, 0xa689,
+ 0xa68b, 0xa68b,
+ 0xa68d, 0xa68d,
+ 0xa68f, 0xa68f,
+ 0xa691, 0xa691,
+ 0xa693, 0xa693,
+ 0xa695, 0xa695,
+ 0xa697, 0xa697,
+ 0xa723, 0xa723,
+ 0xa725, 0xa725,
+ 0xa727, 0xa727,
+ 0xa729, 0xa729,
+ 0xa72b, 0xa72b,
+ 0xa72d, 0xa72d,
+ 0xa72f, 0xa731,
+ 0xa733, 0xa733,
+ 0xa735, 0xa735,
+ 0xa737, 0xa737,
+ 0xa739, 0xa739,
+ 0xa73b, 0xa73b,
+ 0xa73d, 0xa73d,
+ 0xa73f, 0xa73f,
+ 0xa741, 0xa741,
+ 0xa743, 0xa743,
+ 0xa745, 0xa745,
+ 0xa747, 0xa747,
+ 0xa749, 0xa749,
+ 0xa74b, 0xa74b,
+ 0xa74d, 0xa74d,
+ 0xa74f, 0xa74f,
+ 0xa751, 0xa751,
+ 0xa753, 0xa753,
+ 0xa755, 0xa755,
+ 0xa757, 0xa757,
+ 0xa759, 0xa759,
+ 0xa75b, 0xa75b,
+ 0xa75d, 0xa75d,
+ 0xa75f, 0xa75f,
+ 0xa761, 0xa761,
+ 0xa763, 0xa763,
+ 0xa765, 0xa765,
+ 0xa767, 0xa767,
+ 0xa769, 0xa769,
+ 0xa76b, 0xa76b,
+ 0xa76d, 0xa76d,
+ 0xa76f, 0xa778,
+ 0xa77a, 0xa77a,
+ 0xa77c, 0xa77c,
+ 0xa77f, 0xa77f,
+ 0xa781, 0xa781,
+ 0xa783, 0xa783,
+ 0xa785, 0xa785,
+ 0xa787, 0xa787,
+ 0xa78c, 0xa78c,
+ 0xa78e, 0xa78e,
+ 0xa791, 0xa791,
+ 0xa793, 0xa793,
+ 0xa7a1, 0xa7a1,
+ 0xa7a3, 0xa7a3,
+ 0xa7a5, 0xa7a5,
+ 0xa7a7, 0xa7a7,
+ 0xa7a9, 0xa7a9,
+ 0xa7f8, 0xa7fa,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff41, 0xff5a,
+ 0x10428, 0x1044f,
+ 0x1d41a, 0x1d433,
+ 0x1d44e, 0x1d454,
+ 0x1d456, 0x1d467,
+ 0x1d482, 0x1d49b,
+ 0x1d4b6, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d4cf,
+ 0x1d4ea, 0x1d503,
+ 0x1d51e, 0x1d537,
+ 0x1d552, 0x1d56b,
+ 0x1d586, 0x1d59f,
+ 0x1d5ba, 0x1d5d3,
+ 0x1d5ee, 0x1d607,
+ 0x1d622, 0x1d63b,
+ 0x1d656, 0x1d66f,
+ 0x1d68a, 0x1d6a5,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6e1,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d71b,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d755,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d78f,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7c9,
+ 0x1d7cb, 0x1d7cb,
+}; /* CR_Lower */
+
+/* 'Print': [[:Print:]] */
+static const OnigCodePoint CR_Print[] = {
+ 541,
+ 0x0020, 0x007e,
+ 0x00a0, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x058f, 0x058f,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0604,
+ 0x0606, 0x061b,
+ 0x061e, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09fb,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3c, 0x0a3c,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4d,
+ 0x0a51, 0x0a51,
+ 0x0a59, 0x0a5c,
+ 0x0a5e, 0x0a5e,
+ 0x0a66, 0x0a75,
+ 0x0a81, 0x0a83,
+ 0x0a85, 0x0a8d,
+ 0x0a8f, 0x0a91,
+ 0x0a93, 0x0aa8,
+ 0x0aaa, 0x0ab0,
+ 0x0ab2, 0x0ab3,
+ 0x0ab5, 0x0ab9,
+ 0x0abc, 0x0ac5,
+ 0x0ac7, 0x0ac9,
+ 0x0acb, 0x0acd,
+ 0x0ad0, 0x0ad0,
+ 0x0ae0, 0x0ae3,
+ 0x0ae6, 0x0af1,
+ 0x0b01, 0x0b03,
+ 0x0b05, 0x0b0c,
+ 0x0b0f, 0x0b10,
+ 0x0b13, 0x0b28,
+ 0x0b2a, 0x0b30,
+ 0x0b32, 0x0b33,
+ 0x0b35, 0x0b39,
+ 0x0b3c, 0x0b44,
+ 0x0b47, 0x0b48,
+ 0x0b4b, 0x0b4d,
+ 0x0b56, 0x0b57,
+ 0x0b5c, 0x0b5d,
+ 0x0b5f, 0x0b63,
+ 0x0b66, 0x0b77,
+ 0x0b82, 0x0b83,
+ 0x0b85, 0x0b8a,
+ 0x0b8e, 0x0b90,
+ 0x0b92, 0x0b95,
+ 0x0b99, 0x0b9a,
+ 0x0b9c, 0x0b9c,
+ 0x0b9e, 0x0b9f,
+ 0x0ba3, 0x0ba4,
+ 0x0ba8, 0x0baa,
+ 0x0bae, 0x0bb9,
+ 0x0bbe, 0x0bc2,
+ 0x0bc6, 0x0bc8,
+ 0x0bca, 0x0bcd,
+ 0x0bd0, 0x0bd0,
+ 0x0bd7, 0x0bd7,
+ 0x0be6, 0x0bfa,
+ 0x0c01, 0x0c03,
+ 0x0c05, 0x0c0c,
+ 0x0c0e, 0x0c10,
+ 0x0c12, 0x0c28,
+ 0x0c2a, 0x0c33,
+ 0x0c35, 0x0c39,
+ 0x0c3d, 0x0c44,
+ 0x0c46, 0x0c48,
+ 0x0c4a, 0x0c4d,
+ 0x0c55, 0x0c56,
+ 0x0c58, 0x0c59,
+ 0x0c60, 0x0c63,
+ 0x0c66, 0x0c6f,
+ 0x0c78, 0x0c7f,
+ 0x0c82, 0x0c83,
+ 0x0c85, 0x0c8c,
+ 0x0c8e, 0x0c90,
+ 0x0c92, 0x0ca8,
+ 0x0caa, 0x0cb3,
+ 0x0cb5, 0x0cb9,
+ 0x0cbc, 0x0cc4,
+ 0x0cc6, 0x0cc8,
+ 0x0cca, 0x0ccd,
+ 0x0cd5, 0x0cd6,
+ 0x0cde, 0x0cde,
+ 0x0ce0, 0x0ce3,
+ 0x0ce6, 0x0cef,
+ 0x0cf1, 0x0cf2,
+ 0x0d02, 0x0d03,
+ 0x0d05, 0x0d0c,
+ 0x0d0e, 0x0d10,
+ 0x0d12, 0x0d3a,
+ 0x0d3d, 0x0d44,
+ 0x0d46, 0x0d48,
+ 0x0d4a, 0x0d4e,
+ 0x0d57, 0x0d57,
+ 0x0d60, 0x0d63,
+ 0x0d66, 0x0d75,
+ 0x0d79, 0x0d7f,
+ 0x0d82, 0x0d83,
+ 0x0d85, 0x0d96,
+ 0x0d9a, 0x0db1,
+ 0x0db3, 0x0dbb,
+ 0x0dbd, 0x0dbd,
+ 0x0dc0, 0x0dc6,
+ 0x0dca, 0x0dca,
+ 0x0dcf, 0x0dd4,
+ 0x0dd6, 0x0dd6,
+ 0x0dd8, 0x0ddf,
+ 0x0df2, 0x0df4,
+ 0x0e01, 0x0e3a,
+ 0x0e3f, 0x0e5b,
+ 0x0e81, 0x0e82,
+ 0x0e84, 0x0e84,
+ 0x0e87, 0x0e88,
+ 0x0e8a, 0x0e8a,
+ 0x0e8d, 0x0e8d,
+ 0x0e94, 0x0e97,
+ 0x0e99, 0x0e9f,
+ 0x0ea1, 0x0ea3,
+ 0x0ea5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ec8, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fbe, 0x0fcc,
+ 0x0fce, 0x0fda,
+ 0x1000, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135d, 0x137c,
+ 0x1380, 0x1399,
+ 0x13a0, 0x13f4,
+ 0x1400, 0x169c,
+ 0x16a0, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+ 0x1720, 0x1736,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17dd,
+ 0x17e0, 0x17e9,
+ 0x17f0, 0x17f9,
+ 0x1800, 0x180e,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1940, 0x1940,
+ 0x1944, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19da,
+ 0x19de, 0x1a1b,
+ 0x1a1e, 0x1a5e,
+ 0x1a60, 0x1a7c,
+ 0x1a7f, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa0, 0x1aad,
+ 0x1b00, 0x1b4b,
+ 0x1b50, 0x1b7c,
+ 0x1b80, 0x1bf3,
+ 0x1bfc, 0x1c37,
+ 0x1c3b, 0x1c49,
+ 0x1c4d, 0x1c7f,
+ 0x1cc0, 0x1cc7,
+ 0x1cd0, 0x1cf6,
+ 0x1d00, 0x1de6,
+ 0x1dfc, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fc4,
+ 0x1fc6, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fdd, 0x1fef,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffe,
+ 0x2000, 0x2027,
+ 0x202a, 0x2064,
+ 0x206a, 0x2071,
+ 0x2074, 0x208e,
+ 0x2090, 0x209c,
+ 0x20a0, 0x20b9,
+ 0x20d0, 0x20f0,
+ 0x2100, 0x2189,
+ 0x2190, 0x23f3,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x2460, 0x26ff,
+ 0x2701, 0x2b4c,
+ 0x2b50, 0x2b59,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2cf3,
+ 0x2cf9, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
+ 0x2d6f, 0x2d70,
+ 0x2d7f, 0x2d96,
+ 0x2da0, 0x2da6,
+ 0x2da8, 0x2dae,
+ 0x2db0, 0x2db6,
+ 0x2db8, 0x2dbe,
+ 0x2dc0, 0x2dc6,
+ 0x2dc8, 0x2dce,
+ 0x2dd0, 0x2dd6,
+ 0x2dd8, 0x2dde,
+ 0x2de0, 0x2e3b,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+ 0x2ff0, 0x2ffb,
+ 0x3000, 0x303f,
+ 0x3041, 0x3096,
+ 0x3099, 0x30ff,
+ 0x3105, 0x312d,
+ 0x3131, 0x318e,
+ 0x3190, 0x31ba,
+ 0x31c0, 0x31e3,
+ 0x31f0, 0x321e,
+ 0x3220, 0x32fe,
+ 0x3300, 0x4db5,
+ 0x4dc0, 0x9fcc,
+ 0xa000, 0xa48c,
+ 0xa490, 0xa4c6,
+ 0xa4d0, 0xa62b,
+ 0xa640, 0xa697,
+ 0xa69f, 0xa6f7,
+ 0xa700, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa82b,
+ 0xa830, 0xa839,
+ 0xa840, 0xa877,
+ 0xa880, 0xa8c4,
+ 0xa8ce, 0xa8d9,
+ 0xa8e0, 0xa8fb,
+ 0xa900, 0xa953,
+ 0xa95f, 0xa97c,
+ 0xa980, 0xa9cd,
+ 0xa9cf, 0xa9d9,
+ 0xa9de, 0xa9df,
+ 0xaa00, 0xaa36,
+ 0xaa40, 0xaa4d,
+ 0xaa50, 0xaa59,
+ 0xaa5c, 0xaa7b,
+ 0xaa80, 0xaac2,
+ 0xaadb, 0xaaf6,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabed,
+ 0xabf0, 0xabf9,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xe000, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbc1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfd,
+ 0xfe00, 0xfe19,
+ 0xfe20, 0xfe26,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xfeff, 0xfeff,
+ 0xff01, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfff9, 0xfffd,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1018a,
+ 0x10190, 0x1019b,
+ 0x101d0, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x103c3,
+ 0x103c8, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10857, 0x1085f,
+ 0x10900, 0x1091b,
+ 0x1091f, 0x10939,
+ 0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x10a60, 0x10a7f,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b7f,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x11080, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d1dd,
+ 0x1d200, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1d360, 0x1d371,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
+ 0x1f000, 0x1f02b,
+ 0x1f030, 0x1f093,
+ 0x1f0a0, 0x1f0ae,
+ 0x1f0b1, 0x1f0be,
+ 0x1f0c1, 0x1f0cf,
+ 0x1f0d1, 0x1f0df,
+ 0x1f100, 0x1f10a,
+ 0x1f110, 0x1f12e,
+ 0x1f130, 0x1f16b,
+ 0x1f170, 0x1f19a,
+ 0x1f1e6, 0x1f202,
+ 0x1f210, 0x1f23a,
+ 0x1f240, 0x1f248,
+ 0x1f250, 0x1f251,
+ 0x1f300, 0x1f320,
+ 0x1f330, 0x1f335,
+ 0x1f337, 0x1f37c,
+ 0x1f380, 0x1f393,
+ 0x1f3a0, 0x1f3c4,
+ 0x1f3c6, 0x1f3ca,
+ 0x1f3e0, 0x1f3f0,
+ 0x1f400, 0x1f43e,
+ 0x1f440, 0x1f440,
+ 0x1f442, 0x1f4f7,
+ 0x1f4f9, 0x1f4fc,
+ 0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
+ 0x1f550, 0x1f567,
+ 0x1f5fb, 0x1f640,
+ 0x1f645, 0x1f64f,
+ 0x1f680, 0x1f6c5,
+ 0x1f700, 0x1f773,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+ 0xf0000, 0xffffd,
+ 0x100000, 0x10fffd,
+}; /* CR_Print */
+
+/* 'Punct': [[:Punct:]] */
+static const OnigCodePoint CR_Punct[] = {
+ 140,
+ 0x0021, 0x0023,
+ 0x0025, 0x002a,
+ 0x002c, 0x002f,
+ 0x003a, 0x003b,
+ 0x003f, 0x0040,
+ 0x005b, 0x005d,
+ 0x005f, 0x005f,
+ 0x007b, 0x007b,
+ 0x007d, 0x007d,
+ 0x00a1, 0x00a1,
+ 0x00a7, 0x00a7,
+ 0x00ab, 0x00ab,
+ 0x00b6, 0x00b7,
+ 0x00bb, 0x00bb,
+ 0x00bf, 0x00bf,
+ 0x037e, 0x037e,
+ 0x0387, 0x0387,
+ 0x055a, 0x055f,
+ 0x0589, 0x058a,
+ 0x05be, 0x05be,
+ 0x05c0, 0x05c0,
+ 0x05c3, 0x05c3,
+ 0x05c6, 0x05c6,
+ 0x05f3, 0x05f4,
+ 0x0609, 0x060a,
+ 0x060c, 0x060d,
+ 0x061b, 0x061b,
+ 0x061e, 0x061f,
+ 0x066a, 0x066d,
+ 0x06d4, 0x06d4,
+ 0x0700, 0x070d,
+ 0x07f7, 0x07f9,
+ 0x0830, 0x083e,
+ 0x085e, 0x085e,
+ 0x0964, 0x0965,
+ 0x0970, 0x0970,
+ 0x0af0, 0x0af0,
+ 0x0df4, 0x0df4,
+ 0x0e4f, 0x0e4f,
+ 0x0e5a, 0x0e5b,
+ 0x0f04, 0x0f12,
+ 0x0f14, 0x0f14,
+ 0x0f3a, 0x0f3d,
+ 0x0f85, 0x0f85,
+ 0x0fd0, 0x0fd4,
+ 0x0fd9, 0x0fda,
+ 0x104a, 0x104f,
+ 0x10fb, 0x10fb,
+ 0x1360, 0x1368,
+ 0x1400, 0x1400,
+ 0x166d, 0x166e,
+ 0x169b, 0x169c,
+ 0x16eb, 0x16ed,
+ 0x1735, 0x1736,
+ 0x17d4, 0x17d6,
+ 0x17d8, 0x17da,
+ 0x1800, 0x180a,
+ 0x1944, 0x1945,
+ 0x1a1e, 0x1a1f,
+ 0x1aa0, 0x1aa6,
+ 0x1aa8, 0x1aad,
+ 0x1b5a, 0x1b60,
+ 0x1bfc, 0x1bff,
+ 0x1c3b, 0x1c3f,
+ 0x1c7e, 0x1c7f,
+ 0x1cc0, 0x1cc7,
+ 0x1cd3, 0x1cd3,
+ 0x2010, 0x2027,
+ 0x2030, 0x2043,
+ 0x2045, 0x2051,
+ 0x2053, 0x205e,
+ 0x207d, 0x207e,
+ 0x208d, 0x208e,
+ 0x2329, 0x232a,
+ 0x2768, 0x2775,
+ 0x27c5, 0x27c6,
+ 0x27e6, 0x27ef,
+ 0x2983, 0x2998,
+ 0x29d8, 0x29db,
+ 0x29fc, 0x29fd,
+ 0x2cf9, 0x2cfc,
+ 0x2cfe, 0x2cff,
+ 0x2d70, 0x2d70,
+ 0x2e00, 0x2e2e,
+ 0x2e30, 0x2e3b,
+ 0x3001, 0x3003,
+ 0x3008, 0x3011,
+ 0x3014, 0x301f,
+ 0x3030, 0x3030,
+ 0x303d, 0x303d,
+ 0x30a0, 0x30a0,
+ 0x30fb, 0x30fb,
+ 0xa4fe, 0xa4ff,
+ 0xa60d, 0xa60f,
+ 0xa673, 0xa673,
+ 0xa67e, 0xa67e,
+ 0xa6f2, 0xa6f7,
+ 0xa874, 0xa877,
+ 0xa8ce, 0xa8cf,
+ 0xa8f8, 0xa8fa,
+ 0xa92e, 0xa92f,
+ 0xa95f, 0xa95f,
+ 0xa9c1, 0xa9cd,
+ 0xa9de, 0xa9df,
+ 0xaa5c, 0xaa5f,
+ 0xaade, 0xaadf,
+ 0xaaf0, 0xaaf1,
+ 0xabeb, 0xabeb,
+ 0xfd3e, 0xfd3f,
+ 0xfe10, 0xfe19,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe61,
+ 0xfe63, 0xfe63,
+ 0xfe68, 0xfe68,
+ 0xfe6a, 0xfe6b,
+ 0xff01, 0xff03,
+ 0xff05, 0xff0a,
+ 0xff0c, 0xff0f,
+ 0xff1a, 0xff1b,
+ 0xff1f, 0xff20,
+ 0xff3b, 0xff3d,
+ 0xff3f, 0xff3f,
+ 0xff5b, 0xff5b,
+ 0xff5d, 0xff5d,
+ 0xff5f, 0xff65,
+ 0x10100, 0x10102,
+ 0x1039f, 0x1039f,
+ 0x103d0, 0x103d0,
+ 0x10857, 0x10857,
+ 0x1091f, 0x1091f,
+ 0x1093f, 0x1093f,
+ 0x10a50, 0x10a58,
+ 0x10a7f, 0x10a7f,
+ 0x10b39, 0x10b3f,
+ 0x11047, 0x1104d,
+ 0x110bb, 0x110bc,
+ 0x110be, 0x110c1,
+ 0x11140, 0x11143,
+ 0x111c5, 0x111c8,
+ 0x12470, 0x12473,
+}; /* CR_Punct */
+
+/* 'Space': [[:Space:]] */
+static const OnigCodePoint CR_Space[] = {
+ 11,
+ 0x0009, 0x000d,
+ 0x0020, 0x0020,
+ 0x0085, 0x0085,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x180e, 0x180e,
+ 0x2000, 0x200a,
+ 0x2028, 0x2029,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Space */
+
+/* 'Upper': [[:Upper:]] */
+static const OnigCodePoint CR_Upper[] = {
+ 610,
+ 0x0041, 0x005a,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00de,
+ 0x0100, 0x0100,
+ 0x0102, 0x0102,
+ 0x0104, 0x0104,
+ 0x0106, 0x0106,
+ 0x0108, 0x0108,
+ 0x010a, 0x010a,
+ 0x010c, 0x010c,
+ 0x010e, 0x010e,
+ 0x0110, 0x0110,
+ 0x0112, 0x0112,
+ 0x0114, 0x0114,
+ 0x0116, 0x0116,
+ 0x0118, 0x0118,
+ 0x011a, 0x011a,
+ 0x011c, 0x011c,
+ 0x011e, 0x011e,
+ 0x0120, 0x0120,
+ 0x0122, 0x0122,
+ 0x0124, 0x0124,
+ 0x0126, 0x0126,
+ 0x0128, 0x0128,
+ 0x012a, 0x012a,
+ 0x012c, 0x012c,
+ 0x012e, 0x012e,
+ 0x0130, 0x0130,
+ 0x0132, 0x0132,
+ 0x0134, 0x0134,
+ 0x0136, 0x0136,
+ 0x0139, 0x0139,
+ 0x013b, 0x013b,
+ 0x013d, 0x013d,
+ 0x013f, 0x013f,
+ 0x0141, 0x0141,
+ 0x0143, 0x0143,
+ 0x0145, 0x0145,
+ 0x0147, 0x0147,
+ 0x014a, 0x014a,
+ 0x014c, 0x014c,
+ 0x014e, 0x014e,
+ 0x0150, 0x0150,
+ 0x0152, 0x0152,
+ 0x0154, 0x0154,
+ 0x0156, 0x0156,
+ 0x0158, 0x0158,
+ 0x015a, 0x015a,
+ 0x015c, 0x015c,
+ 0x015e, 0x015e,
+ 0x0160, 0x0160,
+ 0x0162, 0x0162,
+ 0x0164, 0x0164,
+ 0x0166, 0x0166,
+ 0x0168, 0x0168,
+ 0x016a, 0x016a,
+ 0x016c, 0x016c,
+ 0x016e, 0x016e,
+ 0x0170, 0x0170,
+ 0x0172, 0x0172,
+ 0x0174, 0x0174,
+ 0x0176, 0x0176,
+ 0x0178, 0x0179,
+ 0x017b, 0x017b,
+ 0x017d, 0x017d,
+ 0x0181, 0x0182,
+ 0x0184, 0x0184,
+ 0x0186, 0x0187,
+ 0x0189, 0x018b,
+ 0x018e, 0x0191,
+ 0x0193, 0x0194,
+ 0x0196, 0x0198,
+ 0x019c, 0x019d,
+ 0x019f, 0x01a0,
+ 0x01a2, 0x01a2,
+ 0x01a4, 0x01a4,
+ 0x01a6, 0x01a7,
+ 0x01a9, 0x01a9,
+ 0x01ac, 0x01ac,
+ 0x01ae, 0x01af,
+ 0x01b1, 0x01b3,
+ 0x01b5, 0x01b5,
+ 0x01b7, 0x01b8,
+ 0x01bc, 0x01bc,
+ 0x01c4, 0x01c4,
+ 0x01c7, 0x01c7,
+ 0x01ca, 0x01ca,
+ 0x01cd, 0x01cd,
+ 0x01cf, 0x01cf,
+ 0x01d1, 0x01d1,
+ 0x01d3, 0x01d3,
+ 0x01d5, 0x01d5,
+ 0x01d7, 0x01d7,
+ 0x01d9, 0x01d9,
+ 0x01db, 0x01db,
+ 0x01de, 0x01de,
+ 0x01e0, 0x01e0,
+ 0x01e2, 0x01e2,
+ 0x01e4, 0x01e4,
+ 0x01e6, 0x01e6,
+ 0x01e8, 0x01e8,
+ 0x01ea, 0x01ea,
+ 0x01ec, 0x01ec,
+ 0x01ee, 0x01ee,
+ 0x01f1, 0x01f1,
+ 0x01f4, 0x01f4,
+ 0x01f6, 0x01f8,
+ 0x01fa, 0x01fa,
+ 0x01fc, 0x01fc,
+ 0x01fe, 0x01fe,
+ 0x0200, 0x0200,
+ 0x0202, 0x0202,
+ 0x0204, 0x0204,
+ 0x0206, 0x0206,
+ 0x0208, 0x0208,
+ 0x020a, 0x020a,
+ 0x020c, 0x020c,
+ 0x020e, 0x020e,
+ 0x0210, 0x0210,
+ 0x0212, 0x0212,
+ 0x0214, 0x0214,
+ 0x0216, 0x0216,
+ 0x0218, 0x0218,
+ 0x021a, 0x021a,
+ 0x021c, 0x021c,
+ 0x021e, 0x021e,
+ 0x0220, 0x0220,
+ 0x0222, 0x0222,
+ 0x0224, 0x0224,
+ 0x0226, 0x0226,
+ 0x0228, 0x0228,
+ 0x022a, 0x022a,
+ 0x022c, 0x022c,
+ 0x022e, 0x022e,
+ 0x0230, 0x0230,
+ 0x0232, 0x0232,
+ 0x023a, 0x023b,
+ 0x023d, 0x023e,
+ 0x0241, 0x0241,
+ 0x0243, 0x0246,
+ 0x0248, 0x0248,
+ 0x024a, 0x024a,
+ 0x024c, 0x024c,
+ 0x024e, 0x024e,
+ 0x0370, 0x0370,
+ 0x0372, 0x0372,
+ 0x0376, 0x0376,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x038f,
+ 0x0391, 0x03a1,
+ 0x03a3, 0x03ab,
+ 0x03cf, 0x03cf,
+ 0x03d2, 0x03d4,
+ 0x03d8, 0x03d8,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03e2,
+ 0x03e4, 0x03e4,
+ 0x03e6, 0x03e6,
+ 0x03e8, 0x03e8,
+ 0x03ea, 0x03ea,
+ 0x03ec, 0x03ec,
+ 0x03ee, 0x03ee,
+ 0x03f4, 0x03f4,
+ 0x03f7, 0x03f7,
+ 0x03f9, 0x03fa,
+ 0x03fd, 0x042f,
+ 0x0460, 0x0460,
+ 0x0462, 0x0462,
+ 0x0464, 0x0464,
+ 0x0466, 0x0466,
+ 0x0468, 0x0468,
+ 0x046a, 0x046a,
+ 0x046c, 0x046c,
+ 0x046e, 0x046e,
+ 0x0470, 0x0470,
+ 0x0472, 0x0472,
+ 0x0474, 0x0474,
+ 0x0476, 0x0476,
+ 0x0478, 0x0478,
+ 0x047a, 0x047a,
+ 0x047c, 0x047c,
+ 0x047e, 0x047e,
+ 0x0480, 0x0480,
+ 0x048a, 0x048a,
+ 0x048c, 0x048c,
+ 0x048e, 0x048e,
+ 0x0490, 0x0490,
+ 0x0492, 0x0492,
+ 0x0494, 0x0494,
+ 0x0496, 0x0496,
+ 0x0498, 0x0498,
+ 0x049a, 0x049a,
+ 0x049c, 0x049c,
+ 0x049e, 0x049e,
+ 0x04a0, 0x04a0,
+ 0x04a2, 0x04a2,
+ 0x04a4, 0x04a4,
+ 0x04a6, 0x04a6,
+ 0x04a8, 0x04a8,
+ 0x04aa, 0x04aa,
+ 0x04ac, 0x04ac,
+ 0x04ae, 0x04ae,
+ 0x04b0, 0x04b0,
+ 0x04b2, 0x04b2,
+ 0x04b4, 0x04b4,
+ 0x04b6, 0x04b6,
+ 0x04b8, 0x04b8,
+ 0x04ba, 0x04ba,
+ 0x04bc, 0x04bc,
+ 0x04be, 0x04be,
+ 0x04c0, 0x04c1,
+ 0x04c3, 0x04c3,
+ 0x04c5, 0x04c5,
+ 0x04c7, 0x04c7,
+ 0x04c9, 0x04c9,
+ 0x04cb, 0x04cb,
+ 0x04cd, 0x04cd,
+ 0x04d0, 0x04d0,
+ 0x04d2, 0x04d2,
+ 0x04d4, 0x04d4,
+ 0x04d6, 0x04d6,
+ 0x04d8, 0x04d8,
+ 0x04da, 0x04da,
+ 0x04dc, 0x04dc,
+ 0x04de, 0x04de,
+ 0x04e0, 0x04e0,
+ 0x04e2, 0x04e2,
+ 0x04e4, 0x04e4,
+ 0x04e6, 0x04e6,
+ 0x04e8, 0x04e8,
+ 0x04ea, 0x04ea,
+ 0x04ec, 0x04ec,
+ 0x04ee, 0x04ee,
+ 0x04f0, 0x04f0,
+ 0x04f2, 0x04f2,
+ 0x04f4, 0x04f4,
+ 0x04f6, 0x04f6,
+ 0x04f8, 0x04f8,
+ 0x04fa, 0x04fa,
+ 0x04fc, 0x04fc,
+ 0x04fe, 0x04fe,
+ 0x0500, 0x0500,
+ 0x0502, 0x0502,
+ 0x0504, 0x0504,
+ 0x0506, 0x0506,
+ 0x0508, 0x0508,
+ 0x050a, 0x050a,
+ 0x050c, 0x050c,
+ 0x050e, 0x050e,
+ 0x0510, 0x0510,
+ 0x0512, 0x0512,
+ 0x0514, 0x0514,
+ 0x0516, 0x0516,
+ 0x0518, 0x0518,
+ 0x051a, 0x051a,
+ 0x051c, 0x051c,
+ 0x051e, 0x051e,
+ 0x0520, 0x0520,
+ 0x0522, 0x0522,
+ 0x0524, 0x0524,
+ 0x0526, 0x0526,
+ 0x0531, 0x0556,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x1e00, 0x1e00,
+ 0x1e02, 0x1e02,
+ 0x1e04, 0x1e04,
+ 0x1e06, 0x1e06,
+ 0x1e08, 0x1e08,
+ 0x1e0a, 0x1e0a,
+ 0x1e0c, 0x1e0c,
+ 0x1e0e, 0x1e0e,
+ 0x1e10, 0x1e10,
+ 0x1e12, 0x1e12,
+ 0x1e14, 0x1e14,
+ 0x1e16, 0x1e16,
+ 0x1e18, 0x1e18,
+ 0x1e1a, 0x1e1a,
+ 0x1e1c, 0x1e1c,
+ 0x1e1e, 0x1e1e,
+ 0x1e20, 0x1e20,
+ 0x1e22, 0x1e22,
+ 0x1e24, 0x1e24,
+ 0x1e26, 0x1e26,
+ 0x1e28, 0x1e28,
+ 0x1e2a, 0x1e2a,
+ 0x1e2c, 0x1e2c,
+ 0x1e2e, 0x1e2e,
+ 0x1e30, 0x1e30,
+ 0x1e32, 0x1e32,
+ 0x1e34, 0x1e34,
+ 0x1e36, 0x1e36,
+ 0x1e38, 0x1e38,
+ 0x1e3a, 0x1e3a,
+ 0x1e3c, 0x1e3c,
+ 0x1e3e, 0x1e3e,
+ 0x1e40, 0x1e40,
+ 0x1e42, 0x1e42,
+ 0x1e44, 0x1e44,
+ 0x1e46, 0x1e46,
+ 0x1e48, 0x1e48,
+ 0x1e4a, 0x1e4a,
+ 0x1e4c, 0x1e4c,
+ 0x1e4e, 0x1e4e,
+ 0x1e50, 0x1e50,
+ 0x1e52, 0x1e52,
+ 0x1e54, 0x1e54,
+ 0x1e56, 0x1e56,
+ 0x1e58, 0x1e58,
+ 0x1e5a, 0x1e5a,
+ 0x1e5c, 0x1e5c,
+ 0x1e5e, 0x1e5e,
+ 0x1e60, 0x1e60,
+ 0x1e62, 0x1e62,
+ 0x1e64, 0x1e64,
+ 0x1e66, 0x1e66,
+ 0x1e68, 0x1e68,
+ 0x1e6a, 0x1e6a,
+ 0x1e6c, 0x1e6c,
+ 0x1e6e, 0x1e6e,
+ 0x1e70, 0x1e70,
+ 0x1e72, 0x1e72,
+ 0x1e74, 0x1e74,
+ 0x1e76, 0x1e76,
+ 0x1e78, 0x1e78,
+ 0x1e7a, 0x1e7a,
+ 0x1e7c, 0x1e7c,
+ 0x1e7e, 0x1e7e,
+ 0x1e80, 0x1e80,
+ 0x1e82, 0x1e82,
+ 0x1e84, 0x1e84,
+ 0x1e86, 0x1e86,
+ 0x1e88, 0x1e88,
+ 0x1e8a, 0x1e8a,
+ 0x1e8c, 0x1e8c,
+ 0x1e8e, 0x1e8e,
+ 0x1e90, 0x1e90,
+ 0x1e92, 0x1e92,
+ 0x1e94, 0x1e94,
+ 0x1e9e, 0x1e9e,
+ 0x1ea0, 0x1ea0,
+ 0x1ea2, 0x1ea2,
+ 0x1ea4, 0x1ea4,
+ 0x1ea6, 0x1ea6,
+ 0x1ea8, 0x1ea8,
+ 0x1eaa, 0x1eaa,
+ 0x1eac, 0x1eac,
+ 0x1eae, 0x1eae,
+ 0x1eb0, 0x1eb0,
+ 0x1eb2, 0x1eb2,
+ 0x1eb4, 0x1eb4,
+ 0x1eb6, 0x1eb6,
+ 0x1eb8, 0x1eb8,
+ 0x1eba, 0x1eba,
+ 0x1ebc, 0x1ebc,
+ 0x1ebe, 0x1ebe,
+ 0x1ec0, 0x1ec0,
+ 0x1ec2, 0x1ec2,
+ 0x1ec4, 0x1ec4,
+ 0x1ec6, 0x1ec6,
+ 0x1ec8, 0x1ec8,
+ 0x1eca, 0x1eca,
+ 0x1ecc, 0x1ecc,
+ 0x1ece, 0x1ece,
+ 0x1ed0, 0x1ed0,
+ 0x1ed2, 0x1ed2,
+ 0x1ed4, 0x1ed4,
+ 0x1ed6, 0x1ed6,
+ 0x1ed8, 0x1ed8,
+ 0x1eda, 0x1eda,
+ 0x1edc, 0x1edc,
+ 0x1ede, 0x1ede,
+ 0x1ee0, 0x1ee0,
+ 0x1ee2, 0x1ee2,
+ 0x1ee4, 0x1ee4,
+ 0x1ee6, 0x1ee6,
+ 0x1ee8, 0x1ee8,
+ 0x1eea, 0x1eea,
+ 0x1eec, 0x1eec,
+ 0x1eee, 0x1eee,
+ 0x1ef0, 0x1ef0,
+ 0x1ef2, 0x1ef2,
+ 0x1ef4, 0x1ef4,
+ 0x1ef6, 0x1ef6,
+ 0x1ef8, 0x1ef8,
+ 0x1efa, 0x1efa,
+ 0x1efc, 0x1efc,
+ 0x1efe, 0x1efe,
+ 0x1f08, 0x1f0f,
+ 0x1f18, 0x1f1d,
+ 0x1f28, 0x1f2f,
+ 0x1f38, 0x1f3f,
+ 0x1f48, 0x1f4d,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f5f,
+ 0x1f68, 0x1f6f,
+ 0x1fb8, 0x1fbb,
+ 0x1fc8, 0x1fcb,
+ 0x1fd8, 0x1fdb,
+ 0x1fe8, 0x1fec,
+ 0x1ff8, 0x1ffb,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210b, 0x210d,
+ 0x2110, 0x2112,
+ 0x2115, 0x2115,
+ 0x2119, 0x211d,
+ 0x2124, 0x2124,
+ 0x2126, 0x2126,
+ 0x2128, 0x2128,
+ 0x212a, 0x212d,
+ 0x2130, 0x2133,
+ 0x213e, 0x213f,
+ 0x2145, 0x2145,
+ 0x2160, 0x216f,
+ 0x2183, 0x2183,
+ 0x24b6, 0x24cf,
+ 0x2c00, 0x2c2e,
+ 0x2c60, 0x2c60,
+ 0x2c62, 0x2c64,
+ 0x2c67, 0x2c67,
+ 0x2c69, 0x2c69,
+ 0x2c6b, 0x2c6b,
+ 0x2c6d, 0x2c70,
+ 0x2c72, 0x2c72,
+ 0x2c75, 0x2c75,
+ 0x2c7e, 0x2c80,
+ 0x2c82, 0x2c82,
+ 0x2c84, 0x2c84,
+ 0x2c86, 0x2c86,
+ 0x2c88, 0x2c88,
+ 0x2c8a, 0x2c8a,
+ 0x2c8c, 0x2c8c,
+ 0x2c8e, 0x2c8e,
+ 0x2c90, 0x2c90,
+ 0x2c92, 0x2c92,
+ 0x2c94, 0x2c94,
+ 0x2c96, 0x2c96,
+ 0x2c98, 0x2c98,
+ 0x2c9a, 0x2c9a,
+ 0x2c9c, 0x2c9c,
+ 0x2c9e, 0x2c9e,
+ 0x2ca0, 0x2ca0,
+ 0x2ca2, 0x2ca2,
+ 0x2ca4, 0x2ca4,
+ 0x2ca6, 0x2ca6,
+ 0x2ca8, 0x2ca8,
+ 0x2caa, 0x2caa,
+ 0x2cac, 0x2cac,
+ 0x2cae, 0x2cae,
+ 0x2cb0, 0x2cb0,
+ 0x2cb2, 0x2cb2,
+ 0x2cb4, 0x2cb4,
+ 0x2cb6, 0x2cb6,
+ 0x2cb8, 0x2cb8,
+ 0x2cba, 0x2cba,
+ 0x2cbc, 0x2cbc,
+ 0x2cbe, 0x2cbe,
+ 0x2cc0, 0x2cc0,
+ 0x2cc2, 0x2cc2,
+ 0x2cc4, 0x2cc4,
+ 0x2cc6, 0x2cc6,
+ 0x2cc8, 0x2cc8,
+ 0x2cca, 0x2cca,
+ 0x2ccc, 0x2ccc,
+ 0x2cce, 0x2cce,
+ 0x2cd0, 0x2cd0,
+ 0x2cd2, 0x2cd2,
+ 0x2cd4, 0x2cd4,
+ 0x2cd6, 0x2cd6,
+ 0x2cd8, 0x2cd8,
+ 0x2cda, 0x2cda,
+ 0x2cdc, 0x2cdc,
+ 0x2cde, 0x2cde,
+ 0x2ce0, 0x2ce0,
+ 0x2ce2, 0x2ce2,
+ 0x2ceb, 0x2ceb,
+ 0x2ced, 0x2ced,
+ 0x2cf2, 0x2cf2,
+ 0xa640, 0xa640,
+ 0xa642, 0xa642,
+ 0xa644, 0xa644,
+ 0xa646, 0xa646,
+ 0xa648, 0xa648,
+ 0xa64a, 0xa64a,
+ 0xa64c, 0xa64c,
+ 0xa64e, 0xa64e,
+ 0xa650, 0xa650,
+ 0xa652, 0xa652,
+ 0xa654, 0xa654,
+ 0xa656, 0xa656,
+ 0xa658, 0xa658,
+ 0xa65a, 0xa65a,
+ 0xa65c, 0xa65c,
+ 0xa65e, 0xa65e,
+ 0xa660, 0xa660,
+ 0xa662, 0xa662,
+ 0xa664, 0xa664,
+ 0xa666, 0xa666,
+ 0xa668, 0xa668,
+ 0xa66a, 0xa66a,
+ 0xa66c, 0xa66c,
+ 0xa680, 0xa680,
+ 0xa682, 0xa682,
+ 0xa684, 0xa684,
+ 0xa686, 0xa686,
+ 0xa688, 0xa688,
+ 0xa68a, 0xa68a,
+ 0xa68c, 0xa68c,
+ 0xa68e, 0xa68e,
+ 0xa690, 0xa690,
+ 0xa692, 0xa692,
+ 0xa694, 0xa694,
+ 0xa696, 0xa696,
+ 0xa722, 0xa722,
+ 0xa724, 0xa724,
+ 0xa726, 0xa726,
+ 0xa728, 0xa728,
+ 0xa72a, 0xa72a,
+ 0xa72c, 0xa72c,
+ 0xa72e, 0xa72e,
+ 0xa732, 0xa732,
+ 0xa734, 0xa734,
+ 0xa736, 0xa736,
+ 0xa738, 0xa738,
+ 0xa73a, 0xa73a,
+ 0xa73c, 0xa73c,
+ 0xa73e, 0xa73e,
+ 0xa740, 0xa740,
+ 0xa742, 0xa742,
+ 0xa744, 0xa744,
+ 0xa746, 0xa746,
+ 0xa748, 0xa748,
+ 0xa74a, 0xa74a,
+ 0xa74c, 0xa74c,
+ 0xa74e, 0xa74e,
+ 0xa750, 0xa750,
+ 0xa752, 0xa752,
+ 0xa754, 0xa754,
+ 0xa756, 0xa756,
+ 0xa758, 0xa758,
+ 0xa75a, 0xa75a,
+ 0xa75c, 0xa75c,
+ 0xa75e, 0xa75e,
+ 0xa760, 0xa760,
+ 0xa762, 0xa762,
+ 0xa764, 0xa764,
+ 0xa766, 0xa766,
+ 0xa768, 0xa768,
+ 0xa76a, 0xa76a,
+ 0xa76c, 0xa76c,
+ 0xa76e, 0xa76e,
+ 0xa779, 0xa779,
+ 0xa77b, 0xa77b,
+ 0xa77d, 0xa77e,
+ 0xa780, 0xa780,
+ 0xa782, 0xa782,
+ 0xa784, 0xa784,
+ 0xa786, 0xa786,
+ 0xa78b, 0xa78b,
+ 0xa78d, 0xa78d,
+ 0xa790, 0xa790,
+ 0xa792, 0xa792,
+ 0xa7a0, 0xa7a0,
+ 0xa7a2, 0xa7a2,
+ 0xa7a4, 0xa7a4,
+ 0xa7a6, 0xa7a6,
+ 0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
+ 0xff21, 0xff3a,
+ 0x10400, 0x10427,
+ 0x1d400, 0x1d419,
+ 0x1d434, 0x1d44d,
+ 0x1d468, 0x1d481,
+ 0x1d49c, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b5,
+ 0x1d4d0, 0x1d4e9,
+ 0x1d504, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d538, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d56c, 0x1d585,
+ 0x1d5a0, 0x1d5b9,
+ 0x1d5d4, 0x1d5ed,
+ 0x1d608, 0x1d621,
+ 0x1d63c, 0x1d655,
+ 0x1d670, 0x1d689,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6e2, 0x1d6fa,
+ 0x1d71c, 0x1d734,
+ 0x1d756, 0x1d76e,
+ 0x1d790, 0x1d7a8,
+ 0x1d7ca, 0x1d7ca,
+}; /* CR_Upper */
+
+/* 'XDigit': [[:XDigit:]] */
+static const OnigCodePoint CR_XDigit[] = {
+ 3,
+ 0x0030, 0x0039,
+ 0x0041, 0x0046,
+ 0x0061, 0x0066,
+}; /* CR_XDigit */
+
+/* 'Word': [[:Word:]] */
+static const OnigCodePoint CR_Word[] = {
+ 564,
+ 0x0030, 0x0039,
+ 0x0041, 0x005a,
+ 0x005f, 0x005f,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0300, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x0483, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0669,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06df, 0x06e8,
+ 0x06ea, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0840, 0x085b,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0963,
+ 0x0966, 0x096f,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09f1,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3c, 0x0a3c,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4d,
+ 0x0a51, 0x0a51,
+ 0x0a59, 0x0a5c,
+ 0x0a5e, 0x0a5e,
+ 0x0a66, 0x0a75,
+ 0x0a81, 0x0a83,
+ 0x0a85, 0x0a8d,
+ 0x0a8f, 0x0a91,
+ 0x0a93, 0x0aa8,
+ 0x0aaa, 0x0ab0,
+ 0x0ab2, 0x0ab3,
+ 0x0ab5, 0x0ab9,
+ 0x0abc, 0x0ac5,
+ 0x0ac7, 0x0ac9,
+ 0x0acb, 0x0acd,
+ 0x0ad0, 0x0ad0,
+ 0x0ae0, 0x0ae3,
+ 0x0ae6, 0x0aef,
+ 0x0b01, 0x0b03,
+ 0x0b05, 0x0b0c,
+ 0x0b0f, 0x0b10,
+ 0x0b13, 0x0b28,
+ 0x0b2a, 0x0b30,
+ 0x0b32, 0x0b33,
+ 0x0b35, 0x0b39,
+ 0x0b3c, 0x0b44,
+ 0x0b47, 0x0b48,
+ 0x0b4b, 0x0b4d,
+ 0x0b56, 0x0b57,
+ 0x0b5c, 0x0b5d,
+ 0x0b5f, 0x0b63,
+ 0x0b66, 0x0b6f,
+ 0x0b71, 0x0b71,
+ 0x0b82, 0x0b83,
+ 0x0b85, 0x0b8a,
+ 0x0b8e, 0x0b90,
+ 0x0b92, 0x0b95,
+ 0x0b99, 0x0b9a,
+ 0x0b9c, 0x0b9c,
+ 0x0b9e, 0x0b9f,
+ 0x0ba3, 0x0ba4,
+ 0x0ba8, 0x0baa,
+ 0x0bae, 0x0bb9,
+ 0x0bbe, 0x0bc2,
+ 0x0bc6, 0x0bc8,
+ 0x0bca, 0x0bcd,
+ 0x0bd0, 0x0bd0,
+ 0x0bd7, 0x0bd7,
+ 0x0be6, 0x0bef,
+ 0x0c01, 0x0c03,
+ 0x0c05, 0x0c0c,
+ 0x0c0e, 0x0c10,
+ 0x0c12, 0x0c28,
+ 0x0c2a, 0x0c33,
+ 0x0c35, 0x0c39,
+ 0x0c3d, 0x0c44,
+ 0x0c46, 0x0c48,
+ 0x0c4a, 0x0c4d,
+ 0x0c55, 0x0c56,
+ 0x0c58, 0x0c59,
+ 0x0c60, 0x0c63,
+ 0x0c66, 0x0c6f,
+ 0x0c82, 0x0c83,
+ 0x0c85, 0x0c8c,
+ 0x0c8e, 0x0c90,
+ 0x0c92, 0x0ca8,
+ 0x0caa, 0x0cb3,
+ 0x0cb5, 0x0cb9,
+ 0x0cbc, 0x0cc4,
+ 0x0cc6, 0x0cc8,
+ 0x0cca, 0x0ccd,
+ 0x0cd5, 0x0cd6,
+ 0x0cde, 0x0cde,
+ 0x0ce0, 0x0ce3,
+ 0x0ce6, 0x0cef,
+ 0x0cf1, 0x0cf2,
+ 0x0d02, 0x0d03,
+ 0x0d05, 0x0d0c,
+ 0x0d0e, 0x0d10,
+ 0x0d12, 0x0d3a,
+ 0x0d3d, 0x0d44,
+ 0x0d46, 0x0d48,
+ 0x0d4a, 0x0d4e,
+ 0x0d57, 0x0d57,
+ 0x0d60, 0x0d63,
+ 0x0d66, 0x0d6f,
+ 0x0d7a, 0x0d7f,
+ 0x0d82, 0x0d83,
+ 0x0d85, 0x0d96,
+ 0x0d9a, 0x0db1,
+ 0x0db3, 0x0dbb,
+ 0x0dbd, 0x0dbd,
+ 0x0dc0, 0x0dc6,
+ 0x0dca, 0x0dca,
+ 0x0dcf, 0x0dd4,
+ 0x0dd6, 0x0dd6,
+ 0x0dd8, 0x0ddf,
+ 0x0df2, 0x0df3,
+ 0x0e01, 0x0e3a,
+ 0x0e40, 0x0e4e,
+ 0x0e50, 0x0e59,
+ 0x0e81, 0x0e82,
+ 0x0e84, 0x0e84,
+ 0x0e87, 0x0e88,
+ 0x0e8a, 0x0e8a,
+ 0x0e8d, 0x0e8d,
+ 0x0e94, 0x0e97,
+ 0x0e99, 0x0e9f,
+ 0x0ea1, 0x0ea3,
+ 0x0ea5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ec8, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f00,
+ 0x0f18, 0x0f19,
+ 0x0f20, 0x0f29,
+ 0x0f35, 0x0f35,
+ 0x0f37, 0x0f37,
+ 0x0f39, 0x0f39,
+ 0x0f3e, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f84,
+ 0x0f86, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fc6, 0x0fc6,
+ 0x1000, 0x1049,
+ 0x1050, 0x109d,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135d, 0x135f,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+ 0x1720, 0x1734,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17d3,
+ 0x17d7, 0x17d7,
+ 0x17dc, 0x17dd,
+ 0x17e0, 0x17e9,
+ 0x180b, 0x180d,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1946, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19d9,
+ 0x1a00, 0x1a1b,
+ 0x1a20, 0x1a5e,
+ 0x1a60, 0x1a7c,
+ 0x1a7f, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa7, 0x1aa7,
+ 0x1b00, 0x1b4b,
+ 0x1b50, 0x1b59,
+ 0x1b6b, 0x1b73,
+ 0x1b80, 0x1bf3,
+ 0x1c00, 0x1c37,
+ 0x1c40, 0x1c49,
+ 0x1c4d, 0x1c7d,
+ 0x1cd0, 0x1cd2,
+ 0x1cd4, 0x1cf6,
+ 0x1d00, 0x1de6,
+ 0x1dfc, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fbc,
+ 0x1fbe, 0x1fbe,
+ 0x1fc2, 0x1fc4,
+ 0x1fc6, 0x1fcc,
+ 0x1fd0, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fe0, 0x1fec,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffc,
+ 0x203f, 0x2040,
+ 0x2054, 0x2054,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x20d0, 0x20f0,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210a, 0x2113,
+ 0x2115, 0x2115,
+ 0x2119, 0x211d,
+ 0x2124, 0x2124,
+ 0x2126, 0x2126,
+ 0x2128, 0x2128,
+ 0x212a, 0x212d,
+ 0x212f, 0x2139,
+ 0x213c, 0x213f,
+ 0x2145, 0x2149,
+ 0x214e, 0x214e,
+ 0x2160, 0x2188,
+ 0x24b6, 0x24e9,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2ce4,
+ 0x2ceb, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
+ 0x2d6f, 0x2d6f,
+ 0x2d7f, 0x2d96,
+ 0x2da0, 0x2da6,
+ 0x2da8, 0x2dae,
+ 0x2db0, 0x2db6,
+ 0x2db8, 0x2dbe,
+ 0x2dc0, 0x2dc6,
+ 0x2dc8, 0x2dce,
+ 0x2dd0, 0x2dd6,
+ 0x2dd8, 0x2dde,
+ 0x2de0, 0x2dff,
+ 0x2e2f, 0x2e2f,
+ 0x3005, 0x3007,
+ 0x3021, 0x302f,
+ 0x3031, 0x3035,
+ 0x3038, 0x303c,
+ 0x3041, 0x3096,
+ 0x3099, 0x309a,
+ 0x309d, 0x309f,
+ 0x30a1, 0x30fa,
+ 0x30fc, 0x30ff,
+ 0x3105, 0x312d,
+ 0x3131, 0x318e,
+ 0x31a0, 0x31ba,
+ 0x31f0, 0x31ff,
+ 0x3400, 0x4db5,
+ 0x4e00, 0x9fcc,
+ 0xa000, 0xa48c,
+ 0xa4d0, 0xa4fd,
+ 0xa500, 0xa60c,
+ 0xa610, 0xa62b,
+ 0xa640, 0xa672,
+ 0xa674, 0xa67d,
+ 0xa67f, 0xa697,
+ 0xa69f, 0xa6f1,
+ 0xa717, 0xa71f,
+ 0xa722, 0xa788,
+ 0xa78b, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa827,
+ 0xa840, 0xa873,
+ 0xa880, 0xa8c4,
+ 0xa8d0, 0xa8d9,
+ 0xa8e0, 0xa8f7,
+ 0xa8fb, 0xa8fb,
+ 0xa900, 0xa92d,
+ 0xa930, 0xa953,
+ 0xa960, 0xa97c,
+ 0xa980, 0xa9c0,
+ 0xa9cf, 0xa9d9,
+ 0xaa00, 0xaa36,
+ 0xaa40, 0xaa4d,
+ 0xaa50, 0xaa59,
+ 0xaa60, 0xaa76,
+ 0xaa7a, 0xaa7b,
+ 0xaa80, 0xaac2,
+ 0xaadb, 0xaadd,
+ 0xaae0, 0xaaef,
+ 0xaaf2, 0xaaf6,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabea,
+ 0xabec, 0xabed,
+ 0xabf0, 0xabf9,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb28,
+ 0xfb2a, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe00, 0xfe0f,
+ 0xfe20, 0xfe26,
+ 0xfe33, 0xfe34,
+ 0xfe4d, 0xfe4f,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff10, 0xff19,
+ 0xff21, 0xff3a,
+ 0xff3f, 0xff3f,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x101fd, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a3f,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11046,
+ 0x11066, 0x1106f,
+ 0x11080, 0x110ba,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x1113f,
+ 0x11180, 0x111c4,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d165, 0x1d169,
+ 0x1d16d, 0x1d172,
+ 0x1d17b, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0x1d242, 0x1d244,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0100, 0xe01ef,
+}; /* CR_Word */
+
+/* 'Alnum': [[:Alnum:]] */
+static const OnigCodePoint CR_Alnum[] = {
+ 566,
+ 0x0030, 0x0039,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0345, 0x0345,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05b0, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0657,
+ 0x0659, 0x0669,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06e1, 0x06e8,
+ 0x06ed, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x073f,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07ea,
+ 0x07f4, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x0817,
+ 0x081a, 0x082c,
+ 0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08e9,
+ 0x08f0, 0x08fe,
+ 0x0900, 0x093b,
+ 0x093d, 0x094c,
+ 0x094e, 0x0950,
+ 0x0955, 0x0963,
+ 0x0966, 0x096f,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bd, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09cc,
+ 0x09ce, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09f1,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4c,
+ 0x0a51, 0x0a51,
+ 0x0a59, 0x0a5c,
+ 0x0a5e, 0x0a5e,
+ 0x0a66, 0x0a75,
+ 0x0a81, 0x0a83,
+ 0x0a85, 0x0a8d,
+ 0x0a8f, 0x0a91,
+ 0x0a93, 0x0aa8,
+ 0x0aaa, 0x0ab0,
+ 0x0ab2, 0x0ab3,
+ 0x0ab5, 0x0ab9,
+ 0x0abd, 0x0ac5,
+ 0x0ac7, 0x0ac9,
+ 0x0acb, 0x0acc,
+ 0x0ad0, 0x0ad0,
+ 0x0ae0, 0x0ae3,
+ 0x0ae6, 0x0aef,
+ 0x0b01, 0x0b03,
+ 0x0b05, 0x0b0c,
+ 0x0b0f, 0x0b10,
+ 0x0b13, 0x0b28,
+ 0x0b2a, 0x0b30,
+ 0x0b32, 0x0b33,
+ 0x0b35, 0x0b39,
+ 0x0b3d, 0x0b44,
+ 0x0b47, 0x0b48,
+ 0x0b4b, 0x0b4c,
+ 0x0b56, 0x0b57,
+ 0x0b5c, 0x0b5d,
+ 0x0b5f, 0x0b63,
+ 0x0b66, 0x0b6f,
+ 0x0b71, 0x0b71,
+ 0x0b82, 0x0b83,
+ 0x0b85, 0x0b8a,
+ 0x0b8e, 0x0b90,
+ 0x0b92, 0x0b95,
+ 0x0b99, 0x0b9a,
+ 0x0b9c, 0x0b9c,
+ 0x0b9e, 0x0b9f,
+ 0x0ba3, 0x0ba4,
+ 0x0ba8, 0x0baa,
+ 0x0bae, 0x0bb9,
+ 0x0bbe, 0x0bc2,
+ 0x0bc6, 0x0bc8,
+ 0x0bca, 0x0bcc,
+ 0x0bd0, 0x0bd0,
+ 0x0bd7, 0x0bd7,
+ 0x0be6, 0x0bef,
+ 0x0c01, 0x0c03,
+ 0x0c05, 0x0c0c,
+ 0x0c0e, 0x0c10,
+ 0x0c12, 0x0c28,
+ 0x0c2a, 0x0c33,
+ 0x0c35, 0x0c39,
+ 0x0c3d, 0x0c44,
+ 0x0c46, 0x0c48,
+ 0x0c4a, 0x0c4c,
+ 0x0c55, 0x0c56,
+ 0x0c58, 0x0c59,
+ 0x0c60, 0x0c63,
+ 0x0c66, 0x0c6f,
+ 0x0c82, 0x0c83,
+ 0x0c85, 0x0c8c,
+ 0x0c8e, 0x0c90,
+ 0x0c92, 0x0ca8,
+ 0x0caa, 0x0cb3,
+ 0x0cb5, 0x0cb9,
+ 0x0cbd, 0x0cc4,
+ 0x0cc6, 0x0cc8,
+ 0x0cca, 0x0ccc,
+ 0x0cd5, 0x0cd6,
+ 0x0cde, 0x0cde,
+ 0x0ce0, 0x0ce3,
+ 0x0ce6, 0x0cef,
+ 0x0cf1, 0x0cf2,
+ 0x0d02, 0x0d03,
+ 0x0d05, 0x0d0c,
+ 0x0d0e, 0x0d10,
+ 0x0d12, 0x0d3a,
+ 0x0d3d, 0x0d44,
+ 0x0d46, 0x0d48,
+ 0x0d4a, 0x0d4c,
+ 0x0d4e, 0x0d4e,
+ 0x0d57, 0x0d57,
+ 0x0d60, 0x0d63,
+ 0x0d66, 0x0d6f,
+ 0x0d7a, 0x0d7f,
+ 0x0d82, 0x0d83,
+ 0x0d85, 0x0d96,
+ 0x0d9a, 0x0db1,
+ 0x0db3, 0x0dbb,
+ 0x0dbd, 0x0dbd,
+ 0x0dc0, 0x0dc6,
+ 0x0dcf, 0x0dd4,
+ 0x0dd6, 0x0dd6,
+ 0x0dd8, 0x0ddf,
+ 0x0df2, 0x0df3,
+ 0x0e01, 0x0e3a,
+ 0x0e40, 0x0e46,
+ 0x0e4d, 0x0e4d,
+ 0x0e50, 0x0e59,
+ 0x0e81, 0x0e82,
+ 0x0e84, 0x0e84,
+ 0x0e87, 0x0e88,
+ 0x0e8a, 0x0e8a,
+ 0x0e8d, 0x0e8d,
+ 0x0e94, 0x0e97,
+ 0x0e99, 0x0e9f,
+ 0x0ea1, 0x0ea3,
+ 0x0ea5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ecd, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f00,
+ 0x0f20, 0x0f29,
+ 0x0f40, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f81,
+ 0x0f88, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x1000, 0x1036,
+ 0x1038, 0x1038,
+ 0x103b, 0x1049,
+ 0x1050, 0x1062,
+ 0x1065, 0x1068,
+ 0x106e, 0x1086,
+ 0x108e, 0x108e,
+ 0x1090, 0x1099,
+ 0x109c, 0x109d,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135f, 0x135f,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1713,
+ 0x1720, 0x1733,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17b3,
+ 0x17b6, 0x17c8,
+ 0x17d7, 0x17d7,
+ 0x17dc, 0x17dc,
+ 0x17e0, 0x17e9,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x1938,
+ 0x1946, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19d9,
+ 0x1a00, 0x1a1b,
+ 0x1a20, 0x1a5e,
+ 0x1a61, 0x1a74,
+ 0x1a80, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa7, 0x1aa7,
+ 0x1b00, 0x1b33,
+ 0x1b35, 0x1b43,
+ 0x1b45, 0x1b4b,
+ 0x1b50, 0x1b59,
+ 0x1b80, 0x1ba9,
+ 0x1bac, 0x1be5,
+ 0x1be7, 0x1bf1,
+ 0x1c00, 0x1c35,
+ 0x1c40, 0x1c49,
+ 0x1c4d, 0x1c7d,
+ 0x1ce9, 0x1cec,
+ 0x1cee, 0x1cf3,
+ 0x1cf5, 0x1cf6,
+ 0x1d00, 0x1dbf,
+ 0x1e00, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fbc,
+ 0x1fbe, 0x1fbe,
+ 0x1fc2, 0x1fc4,
+ 0x1fc6, 0x1fcc,
+ 0x1fd0, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fe0, 0x1fec,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffc,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210a, 0x2113,
+ 0x2115, 0x2115,
+ 0x2119, 0x211d,
+ 0x2124, 0x2124,
+ 0x2126, 0x2126,
+ 0x2128, 0x2128,
+ 0x212a, 0x212d,
+ 0x212f, 0x2139,
+ 0x213c, 0x213f,
+ 0x2145, 0x2149,
+ 0x214e, 0x214e,
+ 0x2160, 0x2188,
+ 0x24b6, 0x24e9,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2ce4,
+ 0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
+ 0x2d6f, 0x2d6f,
+ 0x2d80, 0x2d96,
+ 0x2da0, 0x2da6,
+ 0x2da8, 0x2dae,
+ 0x2db0, 0x2db6,
+ 0x2db8, 0x2dbe,
+ 0x2dc0, 0x2dc6,
+ 0x2dc8, 0x2dce,
+ 0x2dd0, 0x2dd6,
+ 0x2dd8, 0x2dde,
+ 0x2de0, 0x2dff,
+ 0x2e2f, 0x2e2f,
+ 0x3005, 0x3007,
+ 0x3021, 0x3029,
+ 0x3031, 0x3035,
+ 0x3038, 0x303c,
+ 0x3041, 0x3096,
+ 0x309d, 0x309f,
+ 0x30a1, 0x30fa,
+ 0x30fc, 0x30ff,
+ 0x3105, 0x312d,
+ 0x3131, 0x318e,
+ 0x31a0, 0x31ba,
+ 0x31f0, 0x31ff,
+ 0x3400, 0x4db5,
+ 0x4e00, 0x9fcc,
+ 0xa000, 0xa48c,
+ 0xa4d0, 0xa4fd,
+ 0xa500, 0xa60c,
+ 0xa610, 0xa62b,
+ 0xa640, 0xa66e,
+ 0xa674, 0xa67b,
+ 0xa67f, 0xa697,
+ 0xa69f, 0xa6ef,
+ 0xa717, 0xa71f,
+ 0xa722, 0xa788,
+ 0xa78b, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa801,
+ 0xa803, 0xa805,
+ 0xa807, 0xa80a,
+ 0xa80c, 0xa827,
+ 0xa840, 0xa873,
+ 0xa880, 0xa8c3,
+ 0xa8d0, 0xa8d9,
+ 0xa8f2, 0xa8f7,
+ 0xa8fb, 0xa8fb,
+ 0xa900, 0xa92a,
+ 0xa930, 0xa952,
+ 0xa960, 0xa97c,
+ 0xa980, 0xa9b2,
+ 0xa9b4, 0xa9bf,
+ 0xa9cf, 0xa9d9,
+ 0xaa00, 0xaa36,
+ 0xaa40, 0xaa4d,
+ 0xaa50, 0xaa59,
+ 0xaa60, 0xaa76,
+ 0xaa7a, 0xaa7a,
+ 0xaa80, 0xaabe,
+ 0xaac0, 0xaac0,
+ 0xaac2, 0xaac2,
+ 0xaadb, 0xaadd,
+ 0xaae0, 0xaaef,
+ 0xaaf2, 0xaaf5,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabea,
+ 0xabf0, 0xabf9,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb28,
+ 0xfb2a, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff10, 0xff19,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11045,
+ 0x11066, 0x1106f,
+ 0x11082, 0x110b8,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11132,
+ 0x11136, 0x1113f,
+ 0x11180, 0x111bf,
+ 0x111c1, 0x111c4,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b5,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f93, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Alnum */
+
+/* 'ASCII': [[:ASCII:]] */
+static const OnigCodePoint CR_ASCII[] = {
+ 1,
+ 0x0000, 0x007f,
+}; /* CR_ASCII */
+
#ifdef USE_UNICODE_PROPERTIES
/* 'Any': - */
static const OnigCodePoint CR_Any[] = {
@@ -10,7 +4277,7 @@ static const OnigCodePoint CR_Any[] = {
/* 'Assigned': - */
static const OnigCodePoint CR_Assigned[] = {
- 501,
+ 539,
0x0000, 0x0377,
0x037a, 0x037e,
0x0384, 0x038a,
@@ -21,10 +4288,11 @@ static const OnigCodePoint CR_Assigned[] = {
0x0559, 0x055f,
0x0561, 0x0587,
0x0589, 0x058a,
+ 0x058f, 0x058f,
0x0591, 0x05c7,
0x05d0, 0x05ea,
0x05f0, 0x05f4,
- 0x0600, 0x0603,
+ 0x0600, 0x0604,
0x0606, 0x061b,
0x061e, 0x070d,
0x070f, 0x074a,
@@ -34,6 +4302,9 @@ static const OnigCodePoint CR_Assigned[] = {
0x0830, 0x083e,
0x0840, 0x085b,
0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
0x0900, 0x0977,
0x0979, 0x097f,
0x0981, 0x0983,
@@ -78,8 +4349,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x0acb, 0x0acd,
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0af1, 0x0af1,
+ 0x0ae6, 0x0af1,
0x0b01, 0x0b03,
0x0b05, 0x0b0c,
0x0b0f, 0x0b10,
@@ -179,7 +4449,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x0ec6, 0x0ec6,
0x0ec8, 0x0ecd,
0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f47,
0x0f49, 0x0f6c,
0x0f71, 0x0f97,
@@ -187,8 +4457,9 @@ static const OnigCodePoint CR_Assigned[] = {
0x0fbe, 0x0fcc,
0x0fce, 0x0fda,
0x1000, 0x10c5,
- 0x10d0, 0x10fc,
- 0x1100, 0x1248,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -241,13 +4512,12 @@ static const OnigCodePoint CR_Assigned[] = {
0x1aa0, 0x1aad,
0x1b00, 0x1b4b,
0x1b50, 0x1b7c,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1bf3,
+ 0x1b80, 0x1bf3,
0x1bfc, 0x1c37,
0x1c3b, 0x1c49,
0x1c4d, 0x1c7f,
- 0x1cd0, 0x1cf2,
+ 0x1cc0, 0x1cc7,
+ 0x1cd0, 0x1cf6,
0x1d00, 0x1de6,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
@@ -276,15 +4546,15 @@ static const OnigCodePoint CR_Assigned[] = {
0x2400, 0x2426,
0x2440, 0x244a,
0x2460, 0x26ff,
- 0x2701, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x2b4c,
+ 0x2701, 0x2b4c,
0x2b50, 0x2b59,
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
- 0x2c60, 0x2cf1,
+ 0x2c60, 0x2cf3,
0x2cf9, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d70,
0x2d7f, 0x2d96,
0x2da0, 0x2da6,
@@ -295,7 +4565,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x2dc8, 0x2dce,
0x2dd0, 0x2dd6,
0x2dd8, 0x2dde,
- 0x2de0, 0x2e31,
+ 0x2de0, 0x2e3b,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
0x2f00, 0x2fd5,
@@ -310,17 +4580,16 @@ static const OnigCodePoint CR_Assigned[] = {
0x31f0, 0x321e,
0x3220, 0x32fe,
0x3300, 0x4db5,
- 0x4dc0, 0x9fcb,
+ 0x4dc0, 0x9fcc,
0xa000, 0xa48c,
0xa490, 0xa4c6,
0xa4d0, 0xa62b,
- 0xa640, 0xa673,
- 0xa67c, 0xa697,
- 0xa6a0, 0xa6f7,
+ 0xa640, 0xa697,
+ 0xa69f, 0xa6f7,
0xa700, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa82b,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa82b,
0xa830, 0xa839,
0xa840, 0xa877,
0xa880, 0xa8c4,
@@ -336,7 +4605,7 @@ static const OnigCodePoint CR_Assigned[] = {
0xaa50, 0xaa59,
0xaa5c, 0xaa7b,
0xaa80, 0xaac2,
- 0xaadb, 0xaadf,
+ 0xaadb, 0xaaf6,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -347,8 +4616,7 @@ static const OnigCodePoint CR_Assigned[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xd800, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xd800, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -410,6 +4678,8 @@ static const OnigCodePoint CR_Assigned[] = {
0x10900, 0x1091b,
0x1091f, 0x10939,
0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a13,
@@ -428,11 +4698,22 @@ static const OnigCodePoint CR_Assigned[] = {
0x11000, 0x1104d,
0x11052, 0x1106f,
0x11080, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
0x12000, 0x1236e,
0x12400, 0x12462,
0x12470, 0x12473,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
0x1d000, 0x1d0f5,
0x1d100, 0x1d126,
@@ -461,6 +4742,40 @@ static const OnigCodePoint CR_Assigned[] = {
0x1d552, 0x1d6a5,
0x1d6a8, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
@@ -469,7 +4784,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x1f0d1, 0x1f0df,
0x1f100, 0x1f10a,
0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
+ 0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
0x1f1e6, 0x1f202,
0x1f210, 0x1f23a,
@@ -487,19 +4802,9 @@ static const OnigCodePoint CR_Assigned[] = {
0x1f442, 0x1f4f7,
0x1f4f9, 0x1f4fc,
0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
+ 0x1f5fb, 0x1f640,
0x1f645, 0x1f64f,
0x1f680, 0x1f6c5,
0x1f700, 0x1f773,
@@ -516,44 +4821,560 @@ static const OnigCodePoint CR_Assigned[] = {
/* 'C': Major Category */
static const OnigCodePoint CR_C[] = {
- 20,
+ 541,
0x0000, 0x001f,
0x007f, 0x009f,
0x00ad, 0x00ad,
- 0x0600, 0x0603,
+ 0x0378, 0x0379,
+ 0x037f, 0x0383,
+ 0x038b, 0x038b,
+ 0x038d, 0x038d,
+ 0x03a2, 0x03a2,
+ 0x0528, 0x0530,
+ 0x0557, 0x0558,
+ 0x0560, 0x0560,
+ 0x0588, 0x0588,
+ 0x058b, 0x058e,
+ 0x0590, 0x0590,
+ 0x05c8, 0x05cf,
+ 0x05eb, 0x05ef,
+ 0x05f5, 0x0605,
+ 0x061c, 0x061d,
0x06dd, 0x06dd,
- 0x070f, 0x070f,
- 0x17b4, 0x17b5,
+ 0x070e, 0x070f,
+ 0x074b, 0x074c,
+ 0x07b2, 0x07bf,
+ 0x07fb, 0x07ff,
+ 0x082e, 0x082f,
+ 0x083f, 0x083f,
+ 0x085c, 0x085d,
+ 0x085f, 0x089f,
+ 0x08a1, 0x08a1,
+ 0x08ad, 0x08e3,
+ 0x08ff, 0x08ff,
+ 0x0978, 0x0978,
+ 0x0980, 0x0980,
+ 0x0984, 0x0984,
+ 0x098d, 0x098e,
+ 0x0991, 0x0992,
+ 0x09a9, 0x09a9,
+ 0x09b1, 0x09b1,
+ 0x09b3, 0x09b5,
+ 0x09ba, 0x09bb,
+ 0x09c5, 0x09c6,
+ 0x09c9, 0x09ca,
+ 0x09cf, 0x09d6,
+ 0x09d8, 0x09db,
+ 0x09de, 0x09de,
+ 0x09e4, 0x09e5,
+ 0x09fc, 0x0a00,
+ 0x0a04, 0x0a04,
+ 0x0a0b, 0x0a0e,
+ 0x0a11, 0x0a12,
+ 0x0a29, 0x0a29,
+ 0x0a31, 0x0a31,
+ 0x0a34, 0x0a34,
+ 0x0a37, 0x0a37,
+ 0x0a3a, 0x0a3b,
+ 0x0a3d, 0x0a3d,
+ 0x0a43, 0x0a46,
+ 0x0a49, 0x0a4a,
+ 0x0a4e, 0x0a50,
+ 0x0a52, 0x0a58,
+ 0x0a5d, 0x0a5d,
+ 0x0a5f, 0x0a65,
+ 0x0a76, 0x0a80,
+ 0x0a84, 0x0a84,
+ 0x0a8e, 0x0a8e,
+ 0x0a92, 0x0a92,
+ 0x0aa9, 0x0aa9,
+ 0x0ab1, 0x0ab1,
+ 0x0ab4, 0x0ab4,
+ 0x0aba, 0x0abb,
+ 0x0ac6, 0x0ac6,
+ 0x0aca, 0x0aca,
+ 0x0ace, 0x0acf,
+ 0x0ad1, 0x0adf,
+ 0x0ae4, 0x0ae5,
+ 0x0af2, 0x0b00,
+ 0x0b04, 0x0b04,
+ 0x0b0d, 0x0b0e,
+ 0x0b11, 0x0b12,
+ 0x0b29, 0x0b29,
+ 0x0b31, 0x0b31,
+ 0x0b34, 0x0b34,
+ 0x0b3a, 0x0b3b,
+ 0x0b45, 0x0b46,
+ 0x0b49, 0x0b4a,
+ 0x0b4e, 0x0b55,
+ 0x0b58, 0x0b5b,
+ 0x0b5e, 0x0b5e,
+ 0x0b64, 0x0b65,
+ 0x0b78, 0x0b81,
+ 0x0b84, 0x0b84,
+ 0x0b8b, 0x0b8d,
+ 0x0b91, 0x0b91,
+ 0x0b96, 0x0b98,
+ 0x0b9b, 0x0b9b,
+ 0x0b9d, 0x0b9d,
+ 0x0ba0, 0x0ba2,
+ 0x0ba5, 0x0ba7,
+ 0x0bab, 0x0bad,
+ 0x0bba, 0x0bbd,
+ 0x0bc3, 0x0bc5,
+ 0x0bc9, 0x0bc9,
+ 0x0bce, 0x0bcf,
+ 0x0bd1, 0x0bd6,
+ 0x0bd8, 0x0be5,
+ 0x0bfb, 0x0c00,
+ 0x0c04, 0x0c04,
+ 0x0c0d, 0x0c0d,
+ 0x0c11, 0x0c11,
+ 0x0c29, 0x0c29,
+ 0x0c34, 0x0c34,
+ 0x0c3a, 0x0c3c,
+ 0x0c45, 0x0c45,
+ 0x0c49, 0x0c49,
+ 0x0c4e, 0x0c54,
+ 0x0c57, 0x0c57,
+ 0x0c5a, 0x0c5f,
+ 0x0c64, 0x0c65,
+ 0x0c70, 0x0c77,
+ 0x0c80, 0x0c81,
+ 0x0c84, 0x0c84,
+ 0x0c8d, 0x0c8d,
+ 0x0c91, 0x0c91,
+ 0x0ca9, 0x0ca9,
+ 0x0cb4, 0x0cb4,
+ 0x0cba, 0x0cbb,
+ 0x0cc5, 0x0cc5,
+ 0x0cc9, 0x0cc9,
+ 0x0cce, 0x0cd4,
+ 0x0cd7, 0x0cdd,
+ 0x0cdf, 0x0cdf,
+ 0x0ce4, 0x0ce5,
+ 0x0cf0, 0x0cf0,
+ 0x0cf3, 0x0d01,
+ 0x0d04, 0x0d04,
+ 0x0d0d, 0x0d0d,
+ 0x0d11, 0x0d11,
+ 0x0d3b, 0x0d3c,
+ 0x0d45, 0x0d45,
+ 0x0d49, 0x0d49,
+ 0x0d4f, 0x0d56,
+ 0x0d58, 0x0d5f,
+ 0x0d64, 0x0d65,
+ 0x0d76, 0x0d78,
+ 0x0d80, 0x0d81,
+ 0x0d84, 0x0d84,
+ 0x0d97, 0x0d99,
+ 0x0db2, 0x0db2,
+ 0x0dbc, 0x0dbc,
+ 0x0dbe, 0x0dbf,
+ 0x0dc7, 0x0dc9,
+ 0x0dcb, 0x0dce,
+ 0x0dd5, 0x0dd5,
+ 0x0dd7, 0x0dd7,
+ 0x0de0, 0x0df1,
+ 0x0df5, 0x0e00,
+ 0x0e3b, 0x0e3e,
+ 0x0e5c, 0x0e80,
+ 0x0e83, 0x0e83,
+ 0x0e85, 0x0e86,
+ 0x0e89, 0x0e89,
+ 0x0e8b, 0x0e8c,
+ 0x0e8e, 0x0e93,
+ 0x0e98, 0x0e98,
+ 0x0ea0, 0x0ea0,
+ 0x0ea4, 0x0ea4,
+ 0x0ea6, 0x0ea6,
+ 0x0ea8, 0x0ea9,
+ 0x0eac, 0x0eac,
+ 0x0eba, 0x0eba,
+ 0x0ebe, 0x0ebf,
+ 0x0ec5, 0x0ec5,
+ 0x0ec7, 0x0ec7,
+ 0x0ece, 0x0ecf,
+ 0x0eda, 0x0edb,
+ 0x0ee0, 0x0eff,
+ 0x0f48, 0x0f48,
+ 0x0f6d, 0x0f70,
+ 0x0f98, 0x0f98,
+ 0x0fbd, 0x0fbd,
+ 0x0fcd, 0x0fcd,
+ 0x0fdb, 0x0fff,
+ 0x10c6, 0x10c6,
+ 0x10c8, 0x10cc,
+ 0x10ce, 0x10cf,
+ 0x1249, 0x1249,
+ 0x124e, 0x124f,
+ 0x1257, 0x1257,
+ 0x1259, 0x1259,
+ 0x125e, 0x125f,
+ 0x1289, 0x1289,
+ 0x128e, 0x128f,
+ 0x12b1, 0x12b1,
+ 0x12b6, 0x12b7,
+ 0x12bf, 0x12bf,
+ 0x12c1, 0x12c1,
+ 0x12c6, 0x12c7,
+ 0x12d7, 0x12d7,
+ 0x1311, 0x1311,
+ 0x1316, 0x1317,
+ 0x135b, 0x135c,
+ 0x137d, 0x137f,
+ 0x139a, 0x139f,
+ 0x13f5, 0x13ff,
+ 0x169d, 0x169f,
+ 0x16f1, 0x16ff,
+ 0x170d, 0x170d,
+ 0x1715, 0x171f,
+ 0x1737, 0x173f,
+ 0x1754, 0x175f,
+ 0x176d, 0x176d,
+ 0x1771, 0x1771,
+ 0x1774, 0x177f,
+ 0x17de, 0x17df,
+ 0x17ea, 0x17ef,
+ 0x17fa, 0x17ff,
+ 0x180f, 0x180f,
+ 0x181a, 0x181f,
+ 0x1878, 0x187f,
+ 0x18ab, 0x18af,
+ 0x18f6, 0x18ff,
+ 0x191d, 0x191f,
+ 0x192c, 0x192f,
+ 0x193c, 0x193f,
+ 0x1941, 0x1943,
+ 0x196e, 0x196f,
+ 0x1975, 0x197f,
+ 0x19ac, 0x19af,
+ 0x19ca, 0x19cf,
+ 0x19db, 0x19dd,
+ 0x1a1c, 0x1a1d,
+ 0x1a5f, 0x1a5f,
+ 0x1a7d, 0x1a7e,
+ 0x1a8a, 0x1a8f,
+ 0x1a9a, 0x1a9f,
+ 0x1aae, 0x1aff,
+ 0x1b4c, 0x1b4f,
+ 0x1b7d, 0x1b7f,
+ 0x1bf4, 0x1bfb,
+ 0x1c38, 0x1c3a,
+ 0x1c4a, 0x1c4c,
+ 0x1c80, 0x1cbf,
+ 0x1cc8, 0x1ccf,
+ 0x1cf7, 0x1cff,
+ 0x1de7, 0x1dfb,
+ 0x1f16, 0x1f17,
+ 0x1f1e, 0x1f1f,
+ 0x1f46, 0x1f47,
+ 0x1f4e, 0x1f4f,
+ 0x1f58, 0x1f58,
+ 0x1f5a, 0x1f5a,
+ 0x1f5c, 0x1f5c,
+ 0x1f5e, 0x1f5e,
+ 0x1f7e, 0x1f7f,
+ 0x1fb5, 0x1fb5,
+ 0x1fc5, 0x1fc5,
+ 0x1fd4, 0x1fd5,
+ 0x1fdc, 0x1fdc,
+ 0x1ff0, 0x1ff1,
+ 0x1ff5, 0x1ff5,
+ 0x1fff, 0x1fff,
0x200b, 0x200f,
0x202a, 0x202e,
- 0x2060, 0x2064,
- 0x206a, 0x206f,
- 0xd800, 0xf8ff,
- 0xfeff, 0xfeff,
- 0xfff9, 0xfffb,
+ 0x2060, 0x206f,
+ 0x2072, 0x2073,
+ 0x208f, 0x208f,
+ 0x209d, 0x209f,
+ 0x20ba, 0x20cf,
+ 0x20f1, 0x20ff,
+ 0x218a, 0x218f,
+ 0x23f4, 0x23ff,
+ 0x2427, 0x243f,
+ 0x244b, 0x245f,
+ 0x2700, 0x2700,
+ 0x2b4d, 0x2b4f,
+ 0x2b5a, 0x2bff,
+ 0x2c2f, 0x2c2f,
+ 0x2c5f, 0x2c5f,
+ 0x2cf4, 0x2cf8,
+ 0x2d26, 0x2d26,
+ 0x2d28, 0x2d2c,
+ 0x2d2e, 0x2d2f,
+ 0x2d68, 0x2d6e,
+ 0x2d71, 0x2d7e,
+ 0x2d97, 0x2d9f,
+ 0x2da7, 0x2da7,
+ 0x2daf, 0x2daf,
+ 0x2db7, 0x2db7,
+ 0x2dbf, 0x2dbf,
+ 0x2dc7, 0x2dc7,
+ 0x2dcf, 0x2dcf,
+ 0x2dd7, 0x2dd7,
+ 0x2ddf, 0x2ddf,
+ 0x2e3c, 0x2e7f,
+ 0x2e9a, 0x2e9a,
+ 0x2ef4, 0x2eff,
+ 0x2fd6, 0x2fef,
+ 0x2ffc, 0x2fff,
+ 0x3040, 0x3040,
+ 0x3097, 0x3098,
+ 0x3100, 0x3104,
+ 0x312e, 0x3130,
+ 0x318f, 0x318f,
+ 0x31bb, 0x31bf,
+ 0x31e4, 0x31ef,
+ 0x321f, 0x321f,
+ 0x32ff, 0x32ff,
+ 0x4db6, 0x4dbf,
+ 0x9fcd, 0x9fff,
+ 0xa48d, 0xa48f,
+ 0xa4c7, 0xa4cf,
+ 0xa62c, 0xa63f,
+ 0xa698, 0xa69e,
+ 0xa6f8, 0xa6ff,
+ 0xa78f, 0xa78f,
+ 0xa794, 0xa79f,
+ 0xa7ab, 0xa7f7,
+ 0xa82c, 0xa82f,
+ 0xa83a, 0xa83f,
+ 0xa878, 0xa87f,
+ 0xa8c5, 0xa8cd,
+ 0xa8da, 0xa8df,
+ 0xa8fc, 0xa8ff,
+ 0xa954, 0xa95e,
+ 0xa97d, 0xa97f,
+ 0xa9ce, 0xa9ce,
+ 0xa9da, 0xa9dd,
+ 0xa9e0, 0xa9ff,
+ 0xaa37, 0xaa3f,
+ 0xaa4e, 0xaa4f,
+ 0xaa5a, 0xaa5b,
+ 0xaa7c, 0xaa7f,
+ 0xaac3, 0xaada,
+ 0xaaf7, 0xab00,
+ 0xab07, 0xab08,
+ 0xab0f, 0xab10,
+ 0xab17, 0xab1f,
+ 0xab27, 0xab27,
+ 0xab2f, 0xabbf,
+ 0xabee, 0xabef,
+ 0xabfa, 0xabff,
+ 0xd7a4, 0xd7af,
+ 0xd7c7, 0xd7ca,
+ 0xd7fc, 0xf8ff,
+ 0xfa6e, 0xfa6f,
+ 0xfada, 0xfaff,
+ 0xfb07, 0xfb12,
+ 0xfb18, 0xfb1c,
+ 0xfb37, 0xfb37,
+ 0xfb3d, 0xfb3d,
+ 0xfb3f, 0xfb3f,
+ 0xfb42, 0xfb42,
+ 0xfb45, 0xfb45,
+ 0xfbc2, 0xfbd2,
+ 0xfd40, 0xfd4f,
+ 0xfd90, 0xfd91,
+ 0xfdc8, 0xfdef,
+ 0xfdfe, 0xfdff,
+ 0xfe1a, 0xfe1f,
+ 0xfe27, 0xfe2f,
+ 0xfe53, 0xfe53,
+ 0xfe67, 0xfe67,
+ 0xfe6c, 0xfe6f,
+ 0xfe75, 0xfe75,
+ 0xfefd, 0xff00,
+ 0xffbf, 0xffc1,
+ 0xffc8, 0xffc9,
+ 0xffd0, 0xffd1,
+ 0xffd8, 0xffd9,
+ 0xffdd, 0xffdf,
+ 0xffe7, 0xffe7,
+ 0xffef, 0xfffb,
+ 0xfffe, 0xffff,
+ 0x1000c, 0x1000c,
+ 0x10027, 0x10027,
+ 0x1003b, 0x1003b,
+ 0x1003e, 0x1003e,
+ 0x1004e, 0x1004f,
+ 0x1005e, 0x1007f,
+ 0x100fb, 0x100ff,
+ 0x10103, 0x10106,
+ 0x10134, 0x10136,
+ 0x1018b, 0x1018f,
+ 0x1019c, 0x101cf,
+ 0x101fe, 0x1027f,
+ 0x1029d, 0x1029f,
+ 0x102d1, 0x102ff,
+ 0x1031f, 0x1031f,
+ 0x10324, 0x1032f,
+ 0x1034b, 0x1037f,
+ 0x1039e, 0x1039e,
+ 0x103c4, 0x103c7,
+ 0x103d6, 0x103ff,
+ 0x1049e, 0x1049f,
+ 0x104aa, 0x107ff,
+ 0x10806, 0x10807,
+ 0x10809, 0x10809,
+ 0x10836, 0x10836,
+ 0x10839, 0x1083b,
+ 0x1083d, 0x1083e,
+ 0x10856, 0x10856,
+ 0x10860, 0x108ff,
+ 0x1091c, 0x1091e,
+ 0x1093a, 0x1093e,
+ 0x10940, 0x1097f,
+ 0x109b8, 0x109bd,
+ 0x109c0, 0x109ff,
+ 0x10a04, 0x10a04,
+ 0x10a07, 0x10a0b,
+ 0x10a14, 0x10a14,
+ 0x10a18, 0x10a18,
+ 0x10a34, 0x10a37,
+ 0x10a3b, 0x10a3e,
+ 0x10a48, 0x10a4f,
+ 0x10a59, 0x10a5f,
+ 0x10a80, 0x10aff,
+ 0x10b36, 0x10b38,
+ 0x10b56, 0x10b57,
+ 0x10b73, 0x10b77,
+ 0x10b80, 0x10bff,
+ 0x10c49, 0x10e5f,
+ 0x10e7f, 0x10fff,
+ 0x1104e, 0x11051,
+ 0x11070, 0x1107f,
0x110bd, 0x110bd,
+ 0x110c2, 0x110cf,
+ 0x110e9, 0x110ef,
+ 0x110fa, 0x110ff,
+ 0x11135, 0x11135,
+ 0x11144, 0x1117f,
+ 0x111c9, 0x111cf,
+ 0x111da, 0x1167f,
+ 0x116b8, 0x116bf,
+ 0x116ca, 0x11fff,
+ 0x1236f, 0x123ff,
+ 0x12463, 0x1246f,
+ 0x12474, 0x12fff,
+ 0x1342f, 0x167ff,
+ 0x16a39, 0x16eff,
+ 0x16f45, 0x16f4f,
+ 0x16f7f, 0x16f8e,
+ 0x16fa0, 0x1afff,
+ 0x1b002, 0x1cfff,
+ 0x1d0f6, 0x1d0ff,
+ 0x1d127, 0x1d128,
0x1d173, 0x1d17a,
- 0xe0001, 0xe0001,
- 0xe0020, 0xe007f,
- 0xf0000, 0xffffd,
- 0x100000, 0x10ffff,
+ 0x1d1de, 0x1d1ff,
+ 0x1d246, 0x1d2ff,
+ 0x1d357, 0x1d35f,
+ 0x1d372, 0x1d3ff,
+ 0x1d455, 0x1d455,
+ 0x1d49d, 0x1d49d,
+ 0x1d4a0, 0x1d4a1,
+ 0x1d4a3, 0x1d4a4,
+ 0x1d4a7, 0x1d4a8,
+ 0x1d4ad, 0x1d4ad,
+ 0x1d4ba, 0x1d4ba,
+ 0x1d4bc, 0x1d4bc,
+ 0x1d4c4, 0x1d4c4,
+ 0x1d506, 0x1d506,
+ 0x1d50b, 0x1d50c,
+ 0x1d515, 0x1d515,
+ 0x1d51d, 0x1d51d,
+ 0x1d53a, 0x1d53a,
+ 0x1d53f, 0x1d53f,
+ 0x1d545, 0x1d545,
+ 0x1d547, 0x1d549,
+ 0x1d551, 0x1d551,
+ 0x1d6a6, 0x1d6a7,
+ 0x1d7cc, 0x1d7cd,
+ 0x1d800, 0x1edff,
+ 0x1ee04, 0x1ee04,
+ 0x1ee20, 0x1ee20,
+ 0x1ee23, 0x1ee23,
+ 0x1ee25, 0x1ee26,
+ 0x1ee28, 0x1ee28,
+ 0x1ee33, 0x1ee33,
+ 0x1ee38, 0x1ee38,
+ 0x1ee3a, 0x1ee3a,
+ 0x1ee3c, 0x1ee41,
+ 0x1ee43, 0x1ee46,
+ 0x1ee48, 0x1ee48,
+ 0x1ee4a, 0x1ee4a,
+ 0x1ee4c, 0x1ee4c,
+ 0x1ee50, 0x1ee50,
+ 0x1ee53, 0x1ee53,
+ 0x1ee55, 0x1ee56,
+ 0x1ee58, 0x1ee58,
+ 0x1ee5a, 0x1ee5a,
+ 0x1ee5c, 0x1ee5c,
+ 0x1ee5e, 0x1ee5e,
+ 0x1ee60, 0x1ee60,
+ 0x1ee63, 0x1ee63,
+ 0x1ee65, 0x1ee66,
+ 0x1ee6b, 0x1ee6b,
+ 0x1ee73, 0x1ee73,
+ 0x1ee78, 0x1ee78,
+ 0x1ee7d, 0x1ee7d,
+ 0x1ee7f, 0x1ee7f,
+ 0x1ee8a, 0x1ee8a,
+ 0x1ee9c, 0x1eea0,
+ 0x1eea4, 0x1eea4,
+ 0x1eeaa, 0x1eeaa,
+ 0x1eebc, 0x1eeef,
+ 0x1eef2, 0x1efff,
+ 0x1f02c, 0x1f02f,
+ 0x1f094, 0x1f09f,
+ 0x1f0af, 0x1f0b0,
+ 0x1f0bf, 0x1f0c0,
+ 0x1f0d0, 0x1f0d0,
+ 0x1f0e0, 0x1f0ff,
+ 0x1f10b, 0x1f10f,
+ 0x1f12f, 0x1f12f,
+ 0x1f16c, 0x1f16f,
+ 0x1f19b, 0x1f1e5,
+ 0x1f203, 0x1f20f,
+ 0x1f23b, 0x1f23f,
+ 0x1f249, 0x1f24f,
+ 0x1f252, 0x1f2ff,
+ 0x1f321, 0x1f32f,
+ 0x1f336, 0x1f336,
+ 0x1f37d, 0x1f37f,
+ 0x1f394, 0x1f39f,
+ 0x1f3c5, 0x1f3c5,
+ 0x1f3cb, 0x1f3df,
+ 0x1f3f1, 0x1f3ff,
+ 0x1f43f, 0x1f43f,
+ 0x1f441, 0x1f441,
+ 0x1f4f8, 0x1f4f8,
+ 0x1f4fd, 0x1f4ff,
+ 0x1f53e, 0x1f53f,
+ 0x1f544, 0x1f54f,
+ 0x1f568, 0x1f5fa,
+ 0x1f641, 0x1f644,
+ 0x1f650, 0x1f67f,
+ 0x1f6c6, 0x1f6ff,
+ 0x1f774, 0x1ffff,
+ 0x2a6d7, 0x2a6ff,
+ 0x2b735, 0x2b73f,
+ 0x2b81e, 0x2f7ff,
+ 0x2fa1e, 0xe00ff,
+ 0xe01f0, 0x10ffff,
}; /* CR_C */
/* 'Cc': General Category */
-static const OnigCodePoint CR_Cc[] = {
- 2,
- 0x0000, 0x001f,
- 0x007f, 0x009f,
-}; /* CR_Cc */
+#define CR_Cc CR_Cntrl
/* 'Cf': General Category */
static const OnigCodePoint CR_Cf[] = {
- 15,
+ 14,
0x00ad, 0x00ad,
- 0x0600, 0x0603,
+ 0x0600, 0x0604,
0x06dd, 0x06dd,
0x070f, 0x070f,
- 0x17b4, 0x17b5,
0x200b, 0x200f,
0x202a, 0x202e,
0x2060, 0x2064,
@@ -568,7 +5389,7 @@ static const OnigCodePoint CR_Cf[] = {
/* 'Cn': General Category */
static const OnigCodePoint CR_Cn[] = {
- 501,
+ 539,
0x0378, 0x0379,
0x037f, 0x0383,
0x038b, 0x038b,
@@ -578,11 +5399,12 @@ static const OnigCodePoint CR_Cn[] = {
0x0557, 0x0558,
0x0560, 0x0560,
0x0588, 0x0588,
- 0x058b, 0x0590,
+ 0x058b, 0x058e,
+ 0x0590, 0x0590,
0x05c8, 0x05cf,
0x05eb, 0x05ef,
0x05f5, 0x05ff,
- 0x0604, 0x0605,
+ 0x0605, 0x0605,
0x061c, 0x061d,
0x070e, 0x070e,
0x074b, 0x074c,
@@ -591,7 +5413,10 @@ static const OnigCodePoint CR_Cn[] = {
0x082e, 0x082f,
0x083f, 0x083f,
0x085c, 0x085d,
- 0x085f, 0x08ff,
+ 0x085f, 0x089f,
+ 0x08a1, 0x08a1,
+ 0x08ad, 0x08e3,
+ 0x08ff, 0x08ff,
0x0978, 0x0978,
0x0980, 0x0980,
0x0984, 0x0984,
@@ -636,7 +5461,6 @@ static const OnigCodePoint CR_Cn[] = {
0x0ace, 0x0acf,
0x0ad1, 0x0adf,
0x0ae4, 0x0ae5,
- 0x0af0, 0x0af0,
0x0af2, 0x0b00,
0x0b04, 0x0b04,
0x0b0d, 0x0b0e,
@@ -737,15 +5561,16 @@ static const OnigCodePoint CR_Cn[] = {
0x0ec7, 0x0ec7,
0x0ece, 0x0ecf,
0x0eda, 0x0edb,
- 0x0ede, 0x0eff,
+ 0x0ee0, 0x0eff,
0x0f48, 0x0f48,
0x0f6d, 0x0f70,
0x0f98, 0x0f98,
0x0fbd, 0x0fbd,
0x0fcd, 0x0fcd,
0x0fdb, 0x0fff,
- 0x10c6, 0x10cf,
- 0x10fd, 0x10ff,
+ 0x10c6, 0x10c6,
+ 0x10c8, 0x10cc,
+ 0x10ce, 0x10cf,
0x1249, 0x1249,
0x124e, 0x124f,
0x1257, 0x1257,
@@ -799,13 +5624,12 @@ static const OnigCodePoint CR_Cn[] = {
0x1aae, 0x1aff,
0x1b4c, 0x1b4f,
0x1b7d, 0x1b7f,
- 0x1bab, 0x1bad,
- 0x1bba, 0x1bbf,
0x1bf4, 0x1bfb,
0x1c38, 0x1c3a,
0x1c4a, 0x1c4c,
- 0x1c80, 0x1ccf,
- 0x1cf3, 0x1cff,
+ 0x1c80, 0x1cbf,
+ 0x1cc8, 0x1ccf,
+ 0x1cf7, 0x1cff,
0x1de7, 0x1dfb,
0x1f16, 0x1f17,
0x1f1e, 0x1f1f,
@@ -834,15 +5658,15 @@ static const OnigCodePoint CR_Cn[] = {
0x2427, 0x243f,
0x244b, 0x245f,
0x2700, 0x2700,
- 0x27cb, 0x27cb,
- 0x27cd, 0x27cd,
0x2b4d, 0x2b4f,
0x2b5a, 0x2bff,
0x2c2f, 0x2c2f,
0x2c5f, 0x2c5f,
- 0x2cf2, 0x2cf8,
- 0x2d26, 0x2d2f,
- 0x2d66, 0x2d6e,
+ 0x2cf4, 0x2cf8,
+ 0x2d26, 0x2d26,
+ 0x2d28, 0x2d2c,
+ 0x2d2e, 0x2d2f,
+ 0x2d68, 0x2d6e,
0x2d71, 0x2d7e,
0x2d97, 0x2d9f,
0x2da7, 0x2da7,
@@ -853,7 +5677,7 @@ static const OnigCodePoint CR_Cn[] = {
0x2dcf, 0x2dcf,
0x2dd7, 0x2dd7,
0x2ddf, 0x2ddf,
- 0x2e32, 0x2e7f,
+ 0x2e3c, 0x2e7f,
0x2e9a, 0x2e9a,
0x2ef4, 0x2eff,
0x2fd6, 0x2fef,
@@ -868,16 +5692,15 @@ static const OnigCodePoint CR_Cn[] = {
0x321f, 0x321f,
0x32ff, 0x32ff,
0x4db6, 0x4dbf,
- 0x9fcc, 0x9fff,
+ 0x9fcd, 0x9fff,
0xa48d, 0xa48f,
0xa4c7, 0xa4cf,
0xa62c, 0xa63f,
- 0xa674, 0xa67b,
- 0xa698, 0xa69f,
+ 0xa698, 0xa69e,
0xa6f8, 0xa6ff,
0xa78f, 0xa78f,
- 0xa792, 0xa79f,
- 0xa7aa, 0xa7f9,
+ 0xa794, 0xa79f,
+ 0xa7ab, 0xa7f7,
0xa82c, 0xa82f,
0xa83a, 0xa83f,
0xa878, 0xa87f,
@@ -894,7 +5717,7 @@ static const OnigCodePoint CR_Cn[] = {
0xaa5a, 0xaa5b,
0xaa7c, 0xaa7f,
0xaac3, 0xaada,
- 0xaae0, 0xab00,
+ 0xaaf7, 0xab00,
0xab07, 0xab08,
0xab0f, 0xab10,
0xab17, 0xab1f,
@@ -905,7 +5728,6 @@ static const OnigCodePoint CR_Cn[] = {
0xd7a4, 0xd7af,
0xd7c7, 0xd7ca,
0xd7fc, 0xd7ff,
- 0xfa2e, 0xfa2f,
0xfa6e, 0xfa6f,
0xfada, 0xfaff,
0xfb07, 0xfb12,
@@ -967,7 +5789,9 @@ static const OnigCodePoint CR_Cn[] = {
0x10860, 0x108ff,
0x1091c, 0x1091e,
0x1093a, 0x1093e,
- 0x10940, 0x109ff,
+ 0x10940, 0x1097f,
+ 0x109b8, 0x109bd,
+ 0x109c0, 0x109ff,
0x10a04, 0x10a04,
0x10a07, 0x10a0b,
0x10a14, 0x10a14,
@@ -985,12 +5809,23 @@ static const OnigCodePoint CR_Cn[] = {
0x10e7f, 0x10fff,
0x1104e, 0x11051,
0x11070, 0x1107f,
- 0x110c2, 0x11fff,
+ 0x110c2, 0x110cf,
+ 0x110e9, 0x110ef,
+ 0x110fa, 0x110ff,
+ 0x11135, 0x11135,
+ 0x11144, 0x1117f,
+ 0x111c9, 0x111cf,
+ 0x111da, 0x1167f,
+ 0x116b8, 0x116bf,
+ 0x116ca, 0x11fff,
0x1236f, 0x123ff,
0x12463, 0x1246f,
0x12474, 0x12fff,
0x1342f, 0x167ff,
- 0x16a39, 0x1afff,
+ 0x16a39, 0x16eff,
+ 0x16f45, 0x16f4f,
+ 0x16f7f, 0x16f8e,
+ 0x16fa0, 0x1afff,
0x1b002, 0x1cfff,
0x1d0f6, 0x1d0ff,
0x1d127, 0x1d128,
@@ -1018,7 +5853,41 @@ static const OnigCodePoint CR_Cn[] = {
0x1d551, 0x1d551,
0x1d6a6, 0x1d6a7,
0x1d7cc, 0x1d7cd,
- 0x1d800, 0x1efff,
+ 0x1d800, 0x1edff,
+ 0x1ee04, 0x1ee04,
+ 0x1ee20, 0x1ee20,
+ 0x1ee23, 0x1ee23,
+ 0x1ee25, 0x1ee26,
+ 0x1ee28, 0x1ee28,
+ 0x1ee33, 0x1ee33,
+ 0x1ee38, 0x1ee38,
+ 0x1ee3a, 0x1ee3a,
+ 0x1ee3c, 0x1ee41,
+ 0x1ee43, 0x1ee46,
+ 0x1ee48, 0x1ee48,
+ 0x1ee4a, 0x1ee4a,
+ 0x1ee4c, 0x1ee4c,
+ 0x1ee50, 0x1ee50,
+ 0x1ee53, 0x1ee53,
+ 0x1ee55, 0x1ee56,
+ 0x1ee58, 0x1ee58,
+ 0x1ee5a, 0x1ee5a,
+ 0x1ee5c, 0x1ee5c,
+ 0x1ee5e, 0x1ee5e,
+ 0x1ee60, 0x1ee60,
+ 0x1ee63, 0x1ee63,
+ 0x1ee65, 0x1ee66,
+ 0x1ee6b, 0x1ee6b,
+ 0x1ee73, 0x1ee73,
+ 0x1ee78, 0x1ee78,
+ 0x1ee7d, 0x1ee7d,
+ 0x1ee7f, 0x1ee7f,
+ 0x1ee8a, 0x1ee8a,
+ 0x1ee9c, 0x1eea0,
+ 0x1eea4, 0x1eea4,
+ 0x1eeaa, 0x1eeaa,
+ 0x1eebc, 0x1eeef,
+ 0x1eef2, 0x1efff,
0x1f02c, 0x1f02f,
0x1f094, 0x1f09f,
0x1f0af, 0x1f0b0,
@@ -1027,7 +5896,7 @@ static const OnigCodePoint CR_Cn[] = {
0x1f0e0, 0x1f0ff,
0x1f10b, 0x1f10f,
0x1f12f, 0x1f12f,
- 0x1f16a, 0x1f16f,
+ 0x1f16c, 0x1f16f,
0x1f19b, 0x1f1e5,
0x1f203, 0x1f20f,
0x1f23b, 0x1f23f,
@@ -1044,19 +5913,9 @@ static const OnigCodePoint CR_Cn[] = {
0x1f441, 0x1f441,
0x1f4f8, 0x1f4f8,
0x1f4fd, 0x1f4ff,
- 0x1f53e, 0x1f54f,
+ 0x1f53e, 0x1f53f,
+ 0x1f544, 0x1f54f,
0x1f568, 0x1f5fa,
- 0x1f600, 0x1f600,
- 0x1f611, 0x1f611,
- 0x1f615, 0x1f615,
- 0x1f617, 0x1f617,
- 0x1f619, 0x1f619,
- 0x1f61b, 0x1f61b,
- 0x1f61f, 0x1f61f,
- 0x1f626, 0x1f627,
- 0x1f62c, 0x1f62c,
- 0x1f62e, 0x1f62f,
- 0x1f634, 0x1f634,
0x1f641, 0x1f644,
0x1f650, 0x1f67f,
0x1f6c6, 0x1f6ff,
@@ -1088,7 +5947,7 @@ static const OnigCodePoint CR_Cs[] = {
/* 'L': Major Category */
static const OnigCodePoint CR_L[] = {
- 435,
+ 486,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -1136,6 +5995,8 @@ static const OnigCodePoint CR_L[] = {
0x0824, 0x0824,
0x0828, 0x0828,
0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
0x0904, 0x0939,
0x093d, 0x093d,
0x0950, 0x0950,
@@ -1241,7 +6102,7 @@ static const OnigCodePoint CR_L[] = {
0x0ebd, 0x0ebd,
0x0ec0, 0x0ec4,
0x0ec6, 0x0ec6,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f00,
0x0f40, 0x0f47,
0x0f49, 0x0f6c,
@@ -1256,9 +6117,10 @@ static const OnigCodePoint CR_L[] = {
0x1075, 0x1081,
0x108e, 0x108e,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
+ 0x10fc, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -1305,12 +6167,13 @@ static const OnigCodePoint CR_L[] = {
0x1b45, 0x1b4b,
0x1b83, 0x1ba0,
0x1bae, 0x1baf,
- 0x1bc0, 0x1be5,
+ 0x1bba, 0x1be5,
0x1c00, 0x1c23,
0x1c4d, 0x1c4f,
0x1c5a, 0x1c7d,
0x1ce9, 0x1cec,
0x1cee, 0x1cf1,
+ 0x1cf5, 0x1cf6,
0x1d00, 0x1dbf,
0x1e00, 0x1f15,
0x1f18, 0x1f1d,
@@ -1352,8 +6215,11 @@ static const OnigCodePoint CR_L[] = {
0x2c30, 0x2c5e,
0x2c60, 0x2ce4,
0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d6f,
0x2d80, 0x2d96,
0x2da0, 0x2da6,
@@ -1377,7 +6243,7 @@ static const OnigCodePoint CR_L[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
@@ -1389,9 +6255,9 @@ static const OnigCodePoint CR_L[] = {
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa801,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa822,
@@ -1416,6 +6282,8 @@ static const OnigCodePoint CR_L[] = {
0xaac0, 0xaac0,
0xaac2, 0xaac2,
0xaadb, 0xaadd,
+ 0xaae0, 0xaaea,
+ 0xaaf2, 0xaaf4,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -1425,8 +6293,7 @@ static const OnigCodePoint CR_L[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -1475,6 +6342,8 @@ static const OnigCodePoint CR_L[] = {
0x1083f, 0x10855,
0x10900, 0x10915,
0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a00,
0x10a10, 0x10a13,
0x10a15, 0x10a17,
@@ -1486,9 +6355,17 @@ static const OnigCodePoint CR_L[] = {
0x10c00, 0x10c48,
0x11003, 0x11037,
0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
0x12000, 0x1236e,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f50,
+ 0x16f93, 0x16f9f,
0x1b000, 0x1b001,
0x1d400, 0x1d454,
0x1d456, 0x1d49c,
@@ -1520,19 +6397,168 @@ static const OnigCodePoint CR_L[] = {
0x1d78a, 0x1d7a8,
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
0x2f800, 0x2fa1d,
}; /* CR_L */
+/* 'LC': General Category */
+static const OnigCodePoint CR_LC[] = {
+ 113,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00b5, 0x00b5,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x01ba,
+ 0x01bc, 0x01bf,
+ 0x01c4, 0x0293,
+ 0x0295, 0x02af,
+ 0x0370, 0x0373,
+ 0x0376, 0x0377,
+ 0x037b, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0561, 0x0587,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x1d00, 0x1d2b,
+ 0x1d6b, 0x1d77,
+ 0x1d79, 0x1d9a,
+ 0x1e00, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fbc,
+ 0x1fbe, 0x1fbe,
+ 0x1fc2, 0x1fc4,
+ 0x1fc6, 0x1fcc,
+ 0x1fd0, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fe0, 0x1fec,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffc,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210a, 0x2113,
+ 0x2115, 0x2115,
+ 0x2119, 0x211d,
+ 0x2124, 0x2124,
+ 0x2126, 0x2126,
+ 0x2128, 0x2128,
+ 0x212a, 0x212d,
+ 0x212f, 0x2134,
+ 0x2139, 0x2139,
+ 0x213c, 0x213f,
+ 0x2145, 0x2149,
+ 0x214e, 0x214e,
+ 0x2183, 0x2184,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2c7b,
+ 0x2c7e, 0x2ce4,
+ 0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0xa640, 0xa66d,
+ 0xa680, 0xa697,
+ 0xa722, 0xa76f,
+ 0xa771, 0xa787,
+ 0xa78b, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7fa, 0xa7fa,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0x10400, 0x1044f,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+}; /* CR_LC */
+
/* 'Ll': General Category */
static const OnigCodePoint CR_Ll[] = {
- 609,
+ 611,
0x0061, 0x007a,
- 0x00aa, 0x00aa,
0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
0x00df, 0x00f6,
0x00f8, 0x00ff,
0x0101, 0x0101,
@@ -1798,7 +6824,7 @@ static const OnigCodePoint CR_Ll[] = {
0x0527, 0x0527,
0x0561, 0x0587,
0x1d00, 0x1d2b,
- 0x1d62, 0x1d77,
+ 0x1d6b, 0x1d77,
0x1d79, 0x1d9a,
0x1e01, 0x1e01,
0x1e03, 0x1e03,
@@ -1962,7 +6988,7 @@ static const OnigCodePoint CR_Ll[] = {
0x2c6c, 0x2c6c,
0x2c71, 0x2c71,
0x2c73, 0x2c74,
- 0x2c76, 0x2c7c,
+ 0x2c76, 0x2c7b,
0x2c81, 0x2c81,
0x2c83, 0x2c83,
0x2c85, 0x2c85,
@@ -2015,7 +7041,10 @@ static const OnigCodePoint CR_Ll[] = {
0x2ce3, 0x2ce4,
0x2cec, 0x2cec,
0x2cee, 0x2cee,
+ 0x2cf3, 0x2cf3,
0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
0xa641, 0xa641,
0xa643, 0xa643,
0xa645, 0xa645,
@@ -2100,6 +7129,7 @@ static const OnigCodePoint CR_Ll[] = {
0xa78c, 0xa78c,
0xa78e, 0xa78e,
0xa791, 0xa791,
+ 0xa793, 0xa793,
0xa7a1, 0xa7a1,
0xa7a3, 0xa7a3,
0xa7a5, 0xa7a5,
@@ -2142,7 +7172,7 @@ static const OnigCodePoint CR_Ll[] = {
/* 'Lm': General Category */
static const OnigCodePoint CR_Lm[] = {
- 49,
+ 52,
0x02b0, 0x02c1,
0x02c6, 0x02d1,
0x02e0, 0x02e4,
@@ -2166,13 +7196,13 @@ static const OnigCodePoint CR_Lm[] = {
0x1843, 0x1843,
0x1aa7, 0x1aa7,
0x1c78, 0x1c7d,
- 0x1d2c, 0x1d61,
+ 0x1d2c, 0x1d6a,
0x1d78, 0x1d78,
0x1d9b, 0x1dbf,
0x2071, 0x2071,
0x207f, 0x207f,
0x2090, 0x209c,
- 0x2c7d, 0x2c7d,
+ 0x2c7c, 0x2c7d,
0x2d6f, 0x2d6f,
0x2e2f, 0x2e2f,
0x3005, 0x3005,
@@ -2187,16 +7217,21 @@ static const OnigCodePoint CR_Lm[] = {
0xa717, 0xa71f,
0xa770, 0xa770,
0xa788, 0xa788,
+ 0xa7f8, 0xa7f9,
0xa9cf, 0xa9cf,
0xaa70, 0xaa70,
0xaadd, 0xaadd,
+ 0xaaf3, 0xaaf4,
0xff70, 0xff70,
0xff9e, 0xff9f,
+ 0x16f93, 0x16f9f,
}; /* CR_Lm */
/* 'Lo': General Category */
static const OnigCodePoint CR_Lo[] = {
- 323,
+ 371,
+ 0x00aa, 0x00aa,
+ 0x00ba, 0x00ba,
0x01bb, 0x01bb,
0x01c0, 0x01c3,
0x0294, 0x0294,
@@ -2217,6 +7252,8 @@ static const OnigCodePoint CR_Lo[] = {
0x07ca, 0x07ea,
0x0800, 0x0815,
0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
0x0904, 0x0939,
0x093d, 0x093d,
0x0950, 0x0950,
@@ -2321,7 +7358,7 @@ static const OnigCodePoint CR_Lo[] = {
0x0eb2, 0x0eb3,
0x0ebd, 0x0ebd,
0x0ec0, 0x0ec4,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f00,
0x0f40, 0x0f47,
0x0f49, 0x0f6c,
@@ -2336,7 +7373,7 @@ static const OnigCodePoint CR_Lo[] = {
0x1075, 0x1081,
0x108e, 0x108e,
0x10d0, 0x10fa,
- 0x1100, 0x1248,
+ 0x10fd, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -2382,14 +7419,15 @@ static const OnigCodePoint CR_Lo[] = {
0x1b45, 0x1b4b,
0x1b83, 0x1ba0,
0x1bae, 0x1baf,
- 0x1bc0, 0x1be5,
+ 0x1bba, 0x1be5,
0x1c00, 0x1c23,
0x1c4d, 0x1c4f,
0x1c5a, 0x1c77,
0x1ce9, 0x1cec,
0x1cee, 0x1cf1,
+ 0x1cf5, 0x1cf6,
0x2135, 0x2138,
- 0x2d30, 0x2d65,
+ 0x2d30, 0x2d67,
0x2d80, 0x2d96,
0x2da0, 0x2da6,
0x2da8, 0x2dae,
@@ -2410,7 +7448,7 @@ static const OnigCodePoint CR_Lo[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xa000, 0xa014,
0xa016, 0xa48c,
0xa4d0, 0xa4f7,
@@ -2444,6 +7482,8 @@ static const OnigCodePoint CR_Lo[] = {
0xaac0, 0xaac0,
0xaac2, 0xaac2,
0xaadb, 0xaadc,
+ 0xaae0, 0xaaea,
+ 0xaaf2, 0xaaf2,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -2453,8 +7493,7 @@ static const OnigCodePoint CR_Lo[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb1d, 0xfb1d,
0xfb1f, 0xfb28,
@@ -2501,6 +7540,8 @@ static const OnigCodePoint CR_Lo[] = {
0x1083f, 0x10855,
0x10900, 0x10915,
0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a00,
0x10a10, 0x10a13,
0x10a15, 0x10a17,
@@ -2512,10 +7553,50 @@ static const OnigCodePoint CR_Lo[] = {
0x10c00, 0x10c48,
0x11003, 0x11037,
0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
0x12000, 0x1236e,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f50,
0x1b000, 0x1b001,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -2539,7 +7620,7 @@ static const OnigCodePoint CR_Lt[] = {
/* 'Lu': General Category */
static const OnigCodePoint CR_Lu[] = {
- 603,
+ 608,
0x0041, 0x005a,
0x00c0, 0x00d6,
0x00d8, 0x00de,
@@ -2808,6 +7889,8 @@ static const OnigCodePoint CR_Lu[] = {
0x0526, 0x0526,
0x0531, 0x0556,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x1e00, 0x1e00,
0x1e02, 0x1e02,
0x1e04, 0x1e04,
@@ -3022,6 +8105,7 @@ static const OnigCodePoint CR_Lu[] = {
0x2ce2, 0x2ce2,
0x2ceb, 0x2ceb,
0x2ced, 0x2ced,
+ 0x2cf2, 0x2cf2,
0xa640, 0xa640,
0xa642, 0xa642,
0xa644, 0xa644,
@@ -3105,11 +8189,13 @@ static const OnigCodePoint CR_Lu[] = {
0xa78b, 0xa78b,
0xa78d, 0xa78d,
0xa790, 0xa790,
+ 0xa792, 0xa792,
0xa7a0, 0xa7a0,
0xa7a2, 0xa7a2,
0xa7a4, 0xa7a4,
0xa7a6, 0xa7a6,
0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
0xff21, 0xff3a,
0x10400, 0x10427,
0x1d400, 0x1d419,
@@ -3147,7 +8233,7 @@ static const OnigCodePoint CR_Lu[] = {
/* 'M': Major Category */
static const OnigCodePoint CR_M[] = {
- 193,
+ 204,
0x0300, 0x036f,
0x0483, 0x0489,
0x0591, 0x05bd,
@@ -3171,6 +8257,7 @@ static const OnigCodePoint CR_M[] = {
0x0825, 0x0827,
0x0829, 0x082d,
0x0859, 0x085b,
+ 0x08e4, 0x08fe,
0x0900, 0x0903,
0x093a, 0x093c,
0x093e, 0x094f,
@@ -3265,7 +8352,7 @@ static const OnigCodePoint CR_M[] = {
0x1732, 0x1734,
0x1752, 0x1753,
0x1772, 0x1773,
- 0x17b6, 0x17d3,
+ 0x17b4, 0x17d3,
0x17dd, 0x17dd,
0x180b, 0x180d,
0x18a9, 0x18a9,
@@ -3281,13 +8368,13 @@ static const OnigCodePoint CR_M[] = {
0x1b34, 0x1b44,
0x1b6b, 0x1b73,
0x1b80, 0x1b82,
- 0x1ba1, 0x1baa,
+ 0x1ba1, 0x1bad,
0x1be6, 0x1bf3,
0x1c24, 0x1c37,
0x1cd0, 0x1cd2,
0x1cd4, 0x1ce8,
0x1ced, 0x1ced,
- 0x1cf2, 0x1cf2,
+ 0x1cf2, 0x1cf4,
0x1dc0, 0x1de6,
0x1dfc, 0x1dff,
0x20d0, 0x20f0,
@@ -3297,7 +8384,8 @@ static const OnigCodePoint CR_M[] = {
0x302a, 0x302f,
0x3099, 0x309a,
0xa66f, 0xa672,
- 0xa67c, 0xa67d,
+ 0xa674, 0xa67d,
+ 0xa69f, 0xa69f,
0xa6f0, 0xa6f1,
0xa802, 0xa802,
0xa806, 0xa806,
@@ -3319,6 +8407,8 @@ static const OnigCodePoint CR_M[] = {
0xaab7, 0xaab8,
0xaabe, 0xaabf,
0xaac1, 0xaac1,
+ 0xaaeb, 0xaaef,
+ 0xaaf5, 0xaaf6,
0xabe3, 0xabea,
0xabec, 0xabed,
0xfb1e, 0xfb1e,
@@ -3334,6 +8424,13 @@ static const OnigCodePoint CR_M[] = {
0x11038, 0x11046,
0x11080, 0x11082,
0x110b0, 0x110ba,
+ 0x11100, 0x11102,
+ 0x11127, 0x11134,
+ 0x11180, 0x11182,
+ 0x111b3, 0x111c0,
+ 0x116ab, 0x116b7,
+ 0x16f51, 0x16f7e,
+ 0x16f8f, 0x16f92,
0x1d165, 0x1d169,
0x1d16d, 0x1d172,
0x1d17b, 0x1d182,
@@ -3345,7 +8442,7 @@ static const OnigCodePoint CR_M[] = {
/* 'Mc': General Category */
static const OnigCodePoint CR_Mc[] = {
- 113,
+ 126,
0x0903, 0x0903,
0x093b, 0x093b,
0x093e, 0x0940,
@@ -3427,6 +8524,7 @@ static const OnigCodePoint CR_Mc[] = {
0x1ba1, 0x1ba1,
0x1ba6, 0x1ba7,
0x1baa, 0x1baa,
+ 0x1bac, 0x1bad,
0x1be7, 0x1be7,
0x1bea, 0x1bec,
0x1bee, 0x1bee,
@@ -3434,7 +8532,8 @@ static const OnigCodePoint CR_Mc[] = {
0x1c24, 0x1c2b,
0x1c34, 0x1c35,
0x1ce1, 0x1ce1,
- 0x1cf2, 0x1cf2,
+ 0x1cf2, 0x1cf3,
+ 0x302e, 0x302f,
0xa823, 0xa824,
0xa827, 0xa827,
0xa880, 0xa881,
@@ -3448,6 +8547,9 @@ static const OnigCodePoint CR_Mc[] = {
0xaa33, 0xaa34,
0xaa4d, 0xaa4d,
0xaa7b, 0xaa7b,
+ 0xaaeb, 0xaaeb,
+ 0xaaee, 0xaaef,
+ 0xaaf5, 0xaaf5,
0xabe3, 0xabe4,
0xabe6, 0xabe7,
0xabe9, 0xabea,
@@ -3457,6 +8559,14 @@ static const OnigCodePoint CR_Mc[] = {
0x11082, 0x11082,
0x110b0, 0x110b2,
0x110b7, 0x110b8,
+ 0x1112c, 0x1112c,
+ 0x11182, 0x11182,
+ 0x111b3, 0x111b5,
+ 0x111bf, 0x111c0,
+ 0x116ac, 0x116ac,
+ 0x116ae, 0x116af,
+ 0x116b6, 0x116b6,
+ 0x16f51, 0x16f7e,
0x1d165, 0x1d166,
0x1d16d, 0x1d172,
}; /* CR_Mc */
@@ -3472,7 +8582,7 @@ static const OnigCodePoint CR_Me[] = {
/* 'Mn': General Category */
static const OnigCodePoint CR_Mn[] = {
- 203,
+ 220,
0x0300, 0x036f,
0x0483, 0x0487,
0x0591, 0x05bd,
@@ -3496,6 +8606,7 @@ static const OnigCodePoint CR_Mn[] = {
0x0825, 0x0827,
0x0829, 0x082d,
0x0859, 0x085b,
+ 0x08e4, 0x08fe,
0x0900, 0x0902,
0x093a, 0x093a,
0x093c, 0x093c,
@@ -3581,6 +8692,7 @@ static const OnigCodePoint CR_Mn[] = {
0x1732, 0x1734,
0x1752, 0x1753,
0x1772, 0x1773,
+ 0x17b4, 0x17b5,
0x17b7, 0x17bd,
0x17c6, 0x17c6,
0x17c9, 0x17d3,
@@ -3608,6 +8720,7 @@ static const OnigCodePoint CR_Mn[] = {
0x1b80, 0x1b81,
0x1ba2, 0x1ba5,
0x1ba8, 0x1ba9,
+ 0x1bab, 0x1bab,
0x1be6, 0x1be6,
0x1be8, 0x1be9,
0x1bed, 0x1bed,
@@ -3618,6 +8731,7 @@ static const OnigCodePoint CR_Mn[] = {
0x1cd4, 0x1ce0,
0x1ce2, 0x1ce8,
0x1ced, 0x1ced,
+ 0x1cf4, 0x1cf4,
0x1dc0, 0x1de6,
0x1dfc, 0x1dff,
0x20d0, 0x20dc,
@@ -3626,10 +8740,11 @@ static const OnigCodePoint CR_Mn[] = {
0x2cef, 0x2cf1,
0x2d7f, 0x2d7f,
0x2de0, 0x2dff,
- 0x302a, 0x302f,
+ 0x302a, 0x302d,
0x3099, 0x309a,
0xa66f, 0xa66f,
- 0xa67c, 0xa67d,
+ 0xa674, 0xa67d,
+ 0xa69f, 0xa69f,
0xa6f0, 0xa6f1,
0xa802, 0xa802,
0xa806, 0xa806,
@@ -3653,6 +8768,8 @@ static const OnigCodePoint CR_Mn[] = {
0xaab7, 0xaab8,
0xaabe, 0xaabf,
0xaac1, 0xaac1,
+ 0xaaec, 0xaaed,
+ 0xaaf6, 0xaaf6,
0xabe5, 0xabe5,
0xabe8, 0xabe8,
0xabed, 0xabed,
@@ -3670,6 +8787,16 @@ static const OnigCodePoint CR_Mn[] = {
0x11080, 0x11081,
0x110b3, 0x110b6,
0x110b9, 0x110ba,
+ 0x11100, 0x11102,
+ 0x11127, 0x1112b,
+ 0x1112d, 0x11134,
+ 0x11180, 0x11181,
+ 0x111b6, 0x111be,
+ 0x116ab, 0x116ab,
+ 0x116ad, 0x116ad,
+ 0x116b0, 0x116b5,
+ 0x116b7, 0x116b7,
+ 0x16f8f, 0x16f92,
0x1d167, 0x1d169,
0x1d17b, 0x1d182,
0x1d185, 0x1d18b,
@@ -3680,7 +8807,7 @@ static const OnigCodePoint CR_Mn[] = {
/* 'N': Major Category */
static const OnigCodePoint CR_N[] = {
- 83,
+ 88,
0x0030, 0x0039,
0x00b2, 0x00b3,
0x00b9, 0x00b9,
@@ -3732,6 +8859,7 @@ static const OnigCodePoint CR_N[] = {
0x3038, 0x303a,
0x3192, 0x3195,
0x3220, 0x3229,
+ 0x3248, 0x324f,
0x3251, 0x325f,
0x3280, 0x3289,
0x32b1, 0x32bf,
@@ -3760,6 +8888,10 @@ static const OnigCodePoint CR_N[] = {
0x10b78, 0x10b7f,
0x10e60, 0x10e7e,
0x11052, 0x1106f,
+ 0x110f0, 0x110f9,
+ 0x11136, 0x1113f,
+ 0x111d0, 0x111d9,
+ 0x116c0, 0x116c9,
0x12400, 0x12462,
0x1d360, 0x1d371,
0x1d7ce, 0x1d7ff,
@@ -3767,47 +8899,7 @@ static const OnigCodePoint CR_N[] = {
}; /* CR_N */
/* 'Nd': General Category */
-static const OnigCodePoint CR_Nd[] = {
- 38,
- 0x0030, 0x0039,
- 0x0660, 0x0669,
- 0x06f0, 0x06f9,
- 0x07c0, 0x07c9,
- 0x0966, 0x096f,
- 0x09e6, 0x09ef,
- 0x0a66, 0x0a6f,
- 0x0ae6, 0x0aef,
- 0x0b66, 0x0b6f,
- 0x0be6, 0x0bef,
- 0x0c66, 0x0c6f,
- 0x0ce6, 0x0cef,
- 0x0d66, 0x0d6f,
- 0x0e50, 0x0e59,
- 0x0ed0, 0x0ed9,
- 0x0f20, 0x0f29,
- 0x1040, 0x1049,
- 0x1090, 0x1099,
- 0x17e0, 0x17e9,
- 0x1810, 0x1819,
- 0x1946, 0x194f,
- 0x19d0, 0x19d9,
- 0x1a80, 0x1a89,
- 0x1a90, 0x1a99,
- 0x1b50, 0x1b59,
- 0x1bb0, 0x1bb9,
- 0x1c40, 0x1c49,
- 0x1c50, 0x1c59,
- 0xa620, 0xa629,
- 0xa8d0, 0xa8d9,
- 0xa900, 0xa909,
- 0xa9d0, 0xa9d9,
- 0xaa50, 0xaa59,
- 0xabf0, 0xabf9,
- 0xff10, 0xff19,
- 0x104a0, 0x104a9,
- 0x11066, 0x1106f,
- 0x1d7ce, 0x1d7ff,
-}; /* CR_Nd */
+#define CR_Nd CR_Digit
/* 'Nl': General Category */
static const OnigCodePoint CR_Nl[] = {
@@ -3828,7 +8920,7 @@ static const OnigCodePoint CR_Nl[] = {
/* 'No': General Category */
static const OnigCodePoint CR_No[] = {
- 41,
+ 42,
0x00b2, 0x00b3,
0x00b9, 0x00b9,
0x00bc, 0x00be,
@@ -3852,6 +8944,7 @@ static const OnigCodePoint CR_No[] = {
0x2cfd, 0x2cfd,
0x3192, 0x3195,
0x3220, 0x3229,
+ 0x3248, 0x324f,
0x3251, 0x325f,
0x3280, 0x3289,
0x32b1, 0x32bf,
@@ -3873,142 +8966,7 @@ static const OnigCodePoint CR_No[] = {
}; /* CR_No */
/* 'P': Major Category */
-static const OnigCodePoint CR_P[] = {
- 133,
- 0x0021, 0x0023,
- 0x0025, 0x002a,
- 0x002c, 0x002f,
- 0x003a, 0x003b,
- 0x003f, 0x0040,
- 0x005b, 0x005d,
- 0x005f, 0x005f,
- 0x007b, 0x007b,
- 0x007d, 0x007d,
- 0x00a1, 0x00a1,
- 0x00ab, 0x00ab,
- 0x00b7, 0x00b7,
- 0x00bb, 0x00bb,
- 0x00bf, 0x00bf,
- 0x037e, 0x037e,
- 0x0387, 0x0387,
- 0x055a, 0x055f,
- 0x0589, 0x058a,
- 0x05be, 0x05be,
- 0x05c0, 0x05c0,
- 0x05c3, 0x05c3,
- 0x05c6, 0x05c6,
- 0x05f3, 0x05f4,
- 0x0609, 0x060a,
- 0x060c, 0x060d,
- 0x061b, 0x061b,
- 0x061e, 0x061f,
- 0x066a, 0x066d,
- 0x06d4, 0x06d4,
- 0x0700, 0x070d,
- 0x07f7, 0x07f9,
- 0x0830, 0x083e,
- 0x085e, 0x085e,
- 0x0964, 0x0965,
- 0x0970, 0x0970,
- 0x0df4, 0x0df4,
- 0x0e4f, 0x0e4f,
- 0x0e5a, 0x0e5b,
- 0x0f04, 0x0f12,
- 0x0f3a, 0x0f3d,
- 0x0f85, 0x0f85,
- 0x0fd0, 0x0fd4,
- 0x0fd9, 0x0fda,
- 0x104a, 0x104f,
- 0x10fb, 0x10fb,
- 0x1361, 0x1368,
- 0x1400, 0x1400,
- 0x166d, 0x166e,
- 0x169b, 0x169c,
- 0x16eb, 0x16ed,
- 0x1735, 0x1736,
- 0x17d4, 0x17d6,
- 0x17d8, 0x17da,
- 0x1800, 0x180a,
- 0x1944, 0x1945,
- 0x1a1e, 0x1a1f,
- 0x1aa0, 0x1aa6,
- 0x1aa8, 0x1aad,
- 0x1b5a, 0x1b60,
- 0x1bfc, 0x1bff,
- 0x1c3b, 0x1c3f,
- 0x1c7e, 0x1c7f,
- 0x1cd3, 0x1cd3,
- 0x2010, 0x2027,
- 0x2030, 0x2043,
- 0x2045, 0x2051,
- 0x2053, 0x205e,
- 0x207d, 0x207e,
- 0x208d, 0x208e,
- 0x2329, 0x232a,
- 0x2768, 0x2775,
- 0x27c5, 0x27c6,
- 0x27e6, 0x27ef,
- 0x2983, 0x2998,
- 0x29d8, 0x29db,
- 0x29fc, 0x29fd,
- 0x2cf9, 0x2cfc,
- 0x2cfe, 0x2cff,
- 0x2d70, 0x2d70,
- 0x2e00, 0x2e2e,
- 0x2e30, 0x2e31,
- 0x3001, 0x3003,
- 0x3008, 0x3011,
- 0x3014, 0x301f,
- 0x3030, 0x3030,
- 0x303d, 0x303d,
- 0x30a0, 0x30a0,
- 0x30fb, 0x30fb,
- 0xa4fe, 0xa4ff,
- 0xa60d, 0xa60f,
- 0xa673, 0xa673,
- 0xa67e, 0xa67e,
- 0xa6f2, 0xa6f7,
- 0xa874, 0xa877,
- 0xa8ce, 0xa8cf,
- 0xa8f8, 0xa8fa,
- 0xa92e, 0xa92f,
- 0xa95f, 0xa95f,
- 0xa9c1, 0xa9cd,
- 0xa9de, 0xa9df,
- 0xaa5c, 0xaa5f,
- 0xaade, 0xaadf,
- 0xabeb, 0xabeb,
- 0xfd3e, 0xfd3f,
- 0xfe10, 0xfe19,
- 0xfe30, 0xfe52,
- 0xfe54, 0xfe61,
- 0xfe63, 0xfe63,
- 0xfe68, 0xfe68,
- 0xfe6a, 0xfe6b,
- 0xff01, 0xff03,
- 0xff05, 0xff0a,
- 0xff0c, 0xff0f,
- 0xff1a, 0xff1b,
- 0xff1f, 0xff20,
- 0xff3b, 0xff3d,
- 0xff3f, 0xff3f,
- 0xff5b, 0xff5b,
- 0xff5d, 0xff5d,
- 0xff5f, 0xff65,
- 0x10100, 0x10101,
- 0x1039f, 0x1039f,
- 0x103d0, 0x103d0,
- 0x10857, 0x10857,
- 0x1091f, 0x1091f,
- 0x1093f, 0x1093f,
- 0x10a50, 0x10a58,
- 0x10a7f, 0x10a7f,
- 0x10b39, 0x10b3f,
- 0x11047, 0x1104d,
- 0x110bb, 0x110bc,
- 0x110be, 0x110c1,
- 0x12470, 0x12473,
-}; /* CR_P */
+#define CR_P CR_Punct
/* 'Pc': General Category */
static const OnigCodePoint CR_Pc[] = {
@@ -4023,7 +8981,7 @@ static const OnigCodePoint CR_Pc[] = {
/* 'Pd': General Category */
static const OnigCodePoint CR_Pd[] = {
- 15,
+ 16,
0x002d, 0x002d,
0x058a, 0x058a,
0x05be, 0x05be,
@@ -4032,6 +8990,7 @@ static const OnigCodePoint CR_Pd[] = {
0x2010, 0x2015,
0x2e17, 0x2e17,
0x2e1a, 0x2e1a,
+ 0x2e3a, 0x2e3b,
0x301c, 0x301c,
0x3030, 0x3030,
0x30a0, 0x30a0,
@@ -4149,7 +9108,7 @@ static const OnigCodePoint CR_Pi[] = {
/* 'Po': General Category */
static const OnigCodePoint CR_Po[] = {
- 128,
+ 135,
0x0021, 0x0023,
0x0025, 0x0027,
0x002a, 0x002a,
@@ -4159,7 +9118,8 @@ static const OnigCodePoint CR_Po[] = {
0x003f, 0x0040,
0x005c, 0x005c,
0x00a1, 0x00a1,
- 0x00b7, 0x00b7,
+ 0x00a7, 0x00a7,
+ 0x00b6, 0x00b7,
0x00bf, 0x00bf,
0x037e, 0x037e,
0x0387, 0x0387,
@@ -4181,16 +9141,18 @@ static const OnigCodePoint CR_Po[] = {
0x085e, 0x085e,
0x0964, 0x0965,
0x0970, 0x0970,
+ 0x0af0, 0x0af0,
0x0df4, 0x0df4,
0x0e4f, 0x0e4f,
0x0e5a, 0x0e5b,
0x0f04, 0x0f12,
+ 0x0f14, 0x0f14,
0x0f85, 0x0f85,
0x0fd0, 0x0fd4,
0x0fd9, 0x0fda,
0x104a, 0x104f,
0x10fb, 0x10fb,
- 0x1361, 0x1368,
+ 0x1360, 0x1368,
0x166d, 0x166e,
0x16eb, 0x16ed,
0x1735, 0x1736,
@@ -4206,6 +9168,7 @@ static const OnigCodePoint CR_Po[] = {
0x1bfc, 0x1bff,
0x1c3b, 0x1c3f,
0x1c7e, 0x1c7f,
+ 0x1cc0, 0x1cc7,
0x1cd3, 0x1cd3,
0x2016, 0x2017,
0x2020, 0x2027,
@@ -4226,7 +9189,7 @@ static const OnigCodePoint CR_Po[] = {
0x2e1b, 0x2e1b,
0x2e1e, 0x2e1f,
0x2e2a, 0x2e2e,
- 0x2e30, 0x2e31,
+ 0x2e30, 0x2e39,
0x3001, 0x3003,
0x303d, 0x303d,
0x30fb, 0x30fb,
@@ -4244,6 +9207,7 @@ static const OnigCodePoint CR_Po[] = {
0xa9de, 0xa9df,
0xaa5c, 0xaa5f,
0xaade, 0xaadf,
+ 0xaaf0, 0xaaf1,
0xabeb, 0xabeb,
0xfe10, 0xfe16,
0xfe19, 0xfe19,
@@ -4265,7 +9229,7 @@ static const OnigCodePoint CR_Po[] = {
0xff3c, 0xff3c,
0xff61, 0xff61,
0xff64, 0xff65,
- 0x10100, 0x10101,
+ 0x10100, 0x10102,
0x1039f, 0x1039f,
0x103d0, 0x103d0,
0x10857, 0x10857,
@@ -4277,6 +9241,8 @@ static const OnigCodePoint CR_Po[] = {
0x11047, 0x1104d,
0x110bb, 0x110bc,
0x110be, 0x110c1,
+ 0x11140, 0x11143,
+ 0x111c5, 0x111c8,
0x12470, 0x12473,
}; /* CR_Po */
@@ -4359,7 +9325,7 @@ static const OnigCodePoint CR_Ps[] = {
/* 'S': Major Category */
static const OnigCodePoint CR_S[] = {
- 208,
+ 198,
0x0024, 0x0024,
0x002b, 0x002b,
0x003c, 0x003e,
@@ -4367,11 +9333,11 @@ static const OnigCodePoint CR_S[] = {
0x0060, 0x0060,
0x007c, 0x007c,
0x007e, 0x007e,
- 0x00a2, 0x00a9,
+ 0x00a2, 0x00a6,
+ 0x00a8, 0x00a9,
0x00ac, 0x00ac,
0x00ae, 0x00b1,
0x00b4, 0x00b4,
- 0x00b6, 0x00b6,
0x00b8, 0x00b8,
0x00d7, 0x00d7,
0x00f7, 0x00f7,
@@ -4384,6 +9350,7 @@ static const OnigCodePoint CR_S[] = {
0x0384, 0x0385,
0x03f6, 0x03f6,
0x0482, 0x0482,
+ 0x058f, 0x058f,
0x0606, 0x0608,
0x060b, 0x060b,
0x060e, 0x060f,
@@ -4400,7 +9367,8 @@ static const OnigCodePoint CR_S[] = {
0x0d79, 0x0d79,
0x0e3f, 0x0e3f,
0x0f01, 0x0f03,
- 0x0f13, 0x0f17,
+ 0x0f13, 0x0f13,
+ 0x0f15, 0x0f17,
0x0f1a, 0x0f1f,
0x0f34, 0x0f34,
0x0f36, 0x0f36,
@@ -4410,7 +9378,6 @@ static const OnigCodePoint CR_S[] = {
0x0fce, 0x0fcf,
0x0fd5, 0x0fd8,
0x109e, 0x109f,
- 0x1360, 0x1360,
0x1390, 0x1399,
0x17db, 0x17db,
0x1940, 0x1940,
@@ -4450,9 +9417,7 @@ static const OnigCodePoint CR_S[] = {
0x2500, 0x26ff,
0x2701, 0x2767,
0x2794, 0x27c4,
- 0x27c7, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x27e5,
+ 0x27c7, 0x27e5,
0x27f0, 0x2982,
0x2999, 0x29d7,
0x29dc, 0x29fb,
@@ -4473,7 +9438,8 @@ static const OnigCodePoint CR_S[] = {
0x3196, 0x319f,
0x31c0, 0x31e3,
0x3200, 0x321e,
- 0x322a, 0x3250,
+ 0x322a, 0x3247,
+ 0x3250, 0x3250,
0x3260, 0x327f,
0x328a, 0x32b0,
0x32c0, 0x32fe,
@@ -4502,7 +9468,6 @@ static const OnigCodePoint CR_S[] = {
0xffe0, 0xffe6,
0xffe8, 0xffee,
0xfffc, 0xfffd,
- 0x10102, 0x10102,
0x10137, 0x1013f,
0x10179, 0x10189,
0x10190, 0x1019b,
@@ -4527,6 +9492,7 @@ static const OnigCodePoint CR_S[] = {
0x1d789, 0x1d789,
0x1d7a9, 0x1d7a9,
0x1d7c3, 0x1d7c3,
+ 0x1eef0, 0x1eef1,
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
@@ -4534,7 +9500,7 @@ static const OnigCodePoint CR_S[] = {
0x1f0c1, 0x1f0cf,
0x1f0d1, 0x1f0df,
0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
+ 0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
0x1f1e6, 0x1f202,
0x1f210, 0x1f23a,
@@ -4552,19 +9518,9 @@ static const OnigCodePoint CR_S[] = {
0x1f442, 0x1f4f7,
0x1f4f9, 0x1f4fc,
0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
+ 0x1f5fb, 0x1f640,
0x1f645, 0x1f64f,
0x1f680, 0x1f6c5,
0x1f700, 0x1f773,
@@ -4572,9 +9528,10 @@ static const OnigCodePoint CR_S[] = {
/* 'Sc': General Category */
static const OnigCodePoint CR_Sc[] = {
- 16,
+ 17,
0x0024, 0x0024,
0x00a2, 0x00a5,
+ 0x058f, 0x058f,
0x060b, 0x060b,
0x09f2, 0x09f3,
0x09fb, 0x09fb,
@@ -4625,7 +9582,7 @@ static const OnigCodePoint CR_Sk[] = {
/* 'Sm': General Category */
static const OnigCodePoint CR_Sm[] = {
- 66,
+ 65,
0x002b, 0x002b,
0x003c, 0x003e,
0x007c, 0x007c,
@@ -4663,9 +9620,7 @@ static const OnigCodePoint CR_Sm[] = {
0x25f8, 0x25ff,
0x266f, 0x266f,
0x27c0, 0x27c4,
- 0x27c7, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x27e5,
+ 0x27c7, 0x27e5,
0x27f0, 0x27ff,
0x2900, 0x2982,
0x2999, 0x29d7,
@@ -4692,16 +9647,16 @@ static const OnigCodePoint CR_Sm[] = {
0x1d789, 0x1d789,
0x1d7a9, 0x1d7a9,
0x1d7c3, 0x1d7c3,
+ 0x1eef0, 0x1eef1,
}; /* CR_Sm */
/* 'So': General Category */
static const OnigCodePoint CR_So[] = {
- 164,
- 0x00a6, 0x00a7,
+ 153,
+ 0x00a6, 0x00a6,
0x00a9, 0x00a9,
0x00ae, 0x00ae,
0x00b0, 0x00b0,
- 0x00b6, 0x00b6,
0x0482, 0x0482,
0x060e, 0x060f,
0x06de, 0x06de,
@@ -4715,7 +9670,8 @@ static const OnigCodePoint CR_So[] = {
0x0c7f, 0x0c7f,
0x0d79, 0x0d79,
0x0f01, 0x0f03,
- 0x0f13, 0x0f17,
+ 0x0f13, 0x0f13,
+ 0x0f15, 0x0f17,
0x0f1a, 0x0f1f,
0x0f34, 0x0f34,
0x0f36, 0x0f36,
@@ -4725,7 +9681,6 @@ static const OnigCodePoint CR_So[] = {
0x0fce, 0x0fcf,
0x0fd5, 0x0fd8,
0x109e, 0x109f,
- 0x1360, 0x1360,
0x1390, 0x1399,
0x1940, 0x1940,
0x19de, 0x19ff,
@@ -4789,7 +9744,8 @@ static const OnigCodePoint CR_So[] = {
0x3196, 0x319f,
0x31c0, 0x31e3,
0x3200, 0x321e,
- 0x322a, 0x3250,
+ 0x322a, 0x3247,
+ 0x3250, 0x3250,
0x3260, 0x327f,
0x328a, 0x32b0,
0x32c0, 0x32fe,
@@ -4805,7 +9761,6 @@ static const OnigCodePoint CR_So[] = {
0xffe8, 0xffe8,
0xffed, 0xffee,
0xfffc, 0xfffd,
- 0x10102, 0x10102,
0x10137, 0x1013f,
0x10179, 0x10189,
0x10190, 0x1019b,
@@ -4827,7 +9782,7 @@ static const OnigCodePoint CR_So[] = {
0x1f0c1, 0x1f0cf,
0x1f0d1, 0x1f0df,
0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
+ 0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
0x1f1e6, 0x1f202,
0x1f210, 0x1f23a,
@@ -4845,19 +9800,9 @@ static const OnigCodePoint CR_So[] = {
0x1f442, 0x1f4f7,
0x1f4f9, 0x1f4fc,
0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
+ 0x1f5fb, 0x1f640,
0x1f645, 0x1f64f,
0x1f680, 0x1f6c5,
0x1f700, 0x1f773,
@@ -4904,7 +9849,7 @@ static const OnigCodePoint CR_Zs[] = {
/* 'Math': Derived Property */
static const OnigCodePoint CR_Math[] = {
- 106,
+ 138,
0x002b, 0x002b,
0x003c, 0x003e,
0x005e, 0x005e,
@@ -4973,9 +9918,7 @@ static const OnigCodePoint CR_Math[] = {
0x2642, 0x2642,
0x2660, 0x2663,
0x266d, 0x266f,
- 0x27c0, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x27ff,
+ 0x27c0, 0x27ff,
0x2900, 0x2aff,
0x2b30, 0x2b44,
0x2b47, 0x2b4c,
@@ -5011,1729 +9954,54 @@ static const OnigCodePoint CR_Math[] = {
0x1d552, 0x1d6a5,
0x1d6a8, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
}; /* CR_Math */
/* 'Alphabetic': Derived Property */
-static const OnigCodePoint CR_Alphabetic[] = {
- 486,
- 0x0041, 0x005a,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x02c1,
- 0x02c6, 0x02d1,
- 0x02e0, 0x02e4,
- 0x02ec, 0x02ec,
- 0x02ee, 0x02ee,
- 0x0345, 0x0345,
- 0x0370, 0x0374,
- 0x0376, 0x0377,
- 0x037a, 0x037d,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03f5,
- 0x03f7, 0x0481,
- 0x048a, 0x0527,
- 0x0531, 0x0556,
- 0x0559, 0x0559,
- 0x0561, 0x0587,
- 0x05b0, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f2,
- 0x0610, 0x061a,
- 0x0620, 0x0657,
- 0x0659, 0x065f,
- 0x066e, 0x06d3,
- 0x06d5, 0x06dc,
- 0x06e1, 0x06e8,
- 0x06ed, 0x06ef,
- 0x06fa, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x073f,
- 0x074d, 0x07b1,
- 0x07ca, 0x07ea,
- 0x07f4, 0x07f5,
- 0x07fa, 0x07fa,
- 0x0800, 0x0817,
- 0x081a, 0x082c,
- 0x0840, 0x0858,
- 0x0900, 0x093b,
- 0x093d, 0x094c,
- 0x094e, 0x0950,
- 0x0955, 0x0963,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bd, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09cc,
- 0x09ce, 0x09ce,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09f0, 0x09f1,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4c,
- 0x0a51, 0x0a51,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a70, 0x0a75,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abd, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acc,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae3,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3d, 0x0b44,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4c,
- 0x0b56, 0x0b57,
- 0x0b5c, 0x0b5d,
- 0x0b5f, 0x0b63,
- 0x0b71, 0x0b71,
- 0x0b82, 0x0b83,
- 0x0b85, 0x0b8a,
- 0x0b8e, 0x0b90,
- 0x0b92, 0x0b95,
- 0x0b99, 0x0b9a,
- 0x0b9c, 0x0b9c,
- 0x0b9e, 0x0b9f,
- 0x0ba3, 0x0ba4,
- 0x0ba8, 0x0baa,
- 0x0bae, 0x0bb9,
- 0x0bbe, 0x0bc2,
- 0x0bc6, 0x0bc8,
- 0x0bca, 0x0bcc,
- 0x0bd0, 0x0bd0,
- 0x0bd7, 0x0bd7,
- 0x0c01, 0x0c03,
- 0x0c05, 0x0c0c,
- 0x0c0e, 0x0c10,
- 0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
- 0x0c3d, 0x0c44,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4c,
- 0x0c55, 0x0c56,
- 0x0c58, 0x0c59,
- 0x0c60, 0x0c63,
- 0x0c82, 0x0c83,
- 0x0c85, 0x0c8c,
- 0x0c8e, 0x0c90,
- 0x0c92, 0x0ca8,
- 0x0caa, 0x0cb3,
- 0x0cb5, 0x0cb9,
- 0x0cbd, 0x0cc4,
- 0x0cc6, 0x0cc8,
- 0x0cca, 0x0ccc,
- 0x0cd5, 0x0cd6,
- 0x0cde, 0x0cde,
- 0x0ce0, 0x0ce3,
- 0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d3a,
- 0x0d3d, 0x0d44,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4c,
- 0x0d4e, 0x0d4e,
- 0x0d57, 0x0d57,
- 0x0d60, 0x0d63,
- 0x0d7a, 0x0d7f,
- 0x0d82, 0x0d83,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df3,
- 0x0e01, 0x0e3a,
- 0x0e40, 0x0e46,
- 0x0e4d, 0x0e4d,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ecd, 0x0ecd,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f00,
- 0x0f40, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f71, 0x0f81,
- 0x0f88, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x1000, 0x1036,
- 0x1038, 0x1038,
- 0x103b, 0x103f,
- 0x1050, 0x1062,
- 0x1065, 0x1068,
- 0x106e, 0x1086,
- 0x108e, 0x108e,
- 0x109c, 0x109d,
- 0x10a0, 0x10c5,
- 0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135f, 0x135f,
- 0x1380, 0x138f,
- 0x13a0, 0x13f4,
- 0x1401, 0x166c,
- 0x166f, 0x167f,
- 0x1681, 0x169a,
- 0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
- 0x1700, 0x170c,
- 0x170e, 0x1713,
- 0x1720, 0x1733,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17b3,
- 0x17b6, 0x17c8,
- 0x17d7, 0x17d7,
- 0x17dc, 0x17dc,
- 0x1820, 0x1877,
- 0x1880, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191c,
- 0x1920, 0x192b,
- 0x1930, 0x1938,
- 0x1950, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x1a00, 0x1a1b,
- 0x1a20, 0x1a5e,
- 0x1a61, 0x1a74,
- 0x1aa7, 0x1aa7,
- 0x1b00, 0x1b33,
- 0x1b35, 0x1b43,
- 0x1b45, 0x1b4b,
- 0x1b80, 0x1ba9,
- 0x1bae, 0x1baf,
- 0x1bc0, 0x1be5,
- 0x1be7, 0x1bf1,
- 0x1c00, 0x1c35,
- 0x1c4d, 0x1c4f,
- 0x1c5a, 0x1c7d,
- 0x1ce9, 0x1cec,
- 0x1cee, 0x1cf2,
- 0x1d00, 0x1dbf,
- 0x1e00, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fbc,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fcc,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fe0, 0x1fec,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffc,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x209c,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x212f, 0x2139,
- 0x213c, 0x213f,
- 0x2145, 0x2149,
- 0x214e, 0x214e,
- 0x2160, 0x2188,
- 0x24b6, 0x24e9,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2ce4,
- 0x2ceb, 0x2cee,
- 0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
- 0x2d6f, 0x2d6f,
- 0x2d80, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2de0, 0x2dff,
- 0x2e2f, 0x2e2f,
- 0x3005, 0x3007,
- 0x3021, 0x3029,
- 0x3031, 0x3035,
- 0x3038, 0x303c,
- 0x3041, 0x3096,
- 0x309d, 0x309f,
- 0x30a1, 0x30fa,
- 0x30fc, 0x30ff,
- 0x3105, 0x312d,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa61f,
- 0xa62a, 0xa62b,
- 0xa640, 0xa66e,
- 0xa67f, 0xa697,
- 0xa6a0, 0xa6ef,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa801,
- 0xa803, 0xa805,
- 0xa807, 0xa80a,
- 0xa80c, 0xa827,
- 0xa840, 0xa873,
- 0xa880, 0xa8c3,
- 0xa8f2, 0xa8f7,
- 0xa8fb, 0xa8fb,
- 0xa90a, 0xa92a,
- 0xa930, 0xa952,
- 0xa960, 0xa97c,
- 0xa980, 0xa9b2,
- 0xa9b4, 0xa9bf,
- 0xa9cf, 0xa9cf,
- 0xaa00, 0xaa36,
- 0xaa40, 0xaa4d,
- 0xaa60, 0xaa76,
- 0xaa7a, 0xaa7a,
- 0xaa80, 0xaabe,
- 0xaac0, 0xaac0,
- 0xaac2, 0xaac2,
- 0xaadb, 0xaadd,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xabc0, 0xabea,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb28,
- 0xfb2a, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3d,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfb,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xff21, 0xff3a,
- 0xff41, 0xff5a,
- 0xff66, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10140, 0x10174,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x10300, 0x1031e,
- 0x10330, 0x1034a,
- 0x10380, 0x1039d,
- 0x103a0, 0x103c3,
- 0x103c8, 0x103cf,
- 0x103d1, 0x103d5,
- 0x10400, 0x1049d,
- 0x10800, 0x10805,
- 0x10808, 0x10808,
- 0x1080a, 0x10835,
- 0x10837, 0x10838,
- 0x1083c, 0x1083c,
- 0x1083f, 0x10855,
- 0x10900, 0x10915,
- 0x10920, 0x10939,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x10a60, 0x10a7c,
- 0x10b00, 0x10b35,
- 0x10b40, 0x10b55,
- 0x10b60, 0x10b72,
- 0x10c00, 0x10c48,
- 0x11000, 0x11045,
- 0x11082, 0x110b8,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x13000, 0x1342e,
- 0x16800, 0x16a38,
- 0x1b000, 0x1b001,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d6c0,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6fa,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d734,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d76e,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d7a8,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7cb,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2f800, 0x2fa1d,
-}; /* CR_Alphabetic */
+#define CR_Alphabetic CR_Alpha
/* 'Lowercase': Derived Property */
-static const OnigCodePoint CR_Lowercase[] = {
- 612,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
- 0x00df, 0x00f6,
- 0x00f8, 0x00ff,
- 0x0101, 0x0101,
- 0x0103, 0x0103,
- 0x0105, 0x0105,
- 0x0107, 0x0107,
- 0x0109, 0x0109,
- 0x010b, 0x010b,
- 0x010d, 0x010d,
- 0x010f, 0x010f,
- 0x0111, 0x0111,
- 0x0113, 0x0113,
- 0x0115, 0x0115,
- 0x0117, 0x0117,
- 0x0119, 0x0119,
- 0x011b, 0x011b,
- 0x011d, 0x011d,
- 0x011f, 0x011f,
- 0x0121, 0x0121,
- 0x0123, 0x0123,
- 0x0125, 0x0125,
- 0x0127, 0x0127,
- 0x0129, 0x0129,
- 0x012b, 0x012b,
- 0x012d, 0x012d,
- 0x012f, 0x012f,
- 0x0131, 0x0131,
- 0x0133, 0x0133,
- 0x0135, 0x0135,
- 0x0137, 0x0138,
- 0x013a, 0x013a,
- 0x013c, 0x013c,
- 0x013e, 0x013e,
- 0x0140, 0x0140,
- 0x0142, 0x0142,
- 0x0144, 0x0144,
- 0x0146, 0x0146,
- 0x0148, 0x0149,
- 0x014b, 0x014b,
- 0x014d, 0x014d,
- 0x014f, 0x014f,
- 0x0151, 0x0151,
- 0x0153, 0x0153,
- 0x0155, 0x0155,
- 0x0157, 0x0157,
- 0x0159, 0x0159,
- 0x015b, 0x015b,
- 0x015d, 0x015d,
- 0x015f, 0x015f,
- 0x0161, 0x0161,
- 0x0163, 0x0163,
- 0x0165, 0x0165,
- 0x0167, 0x0167,
- 0x0169, 0x0169,
- 0x016b, 0x016b,
- 0x016d, 0x016d,
- 0x016f, 0x016f,
- 0x0171, 0x0171,
- 0x0173, 0x0173,
- 0x0175, 0x0175,
- 0x0177, 0x0177,
- 0x017a, 0x017a,
- 0x017c, 0x017c,
- 0x017e, 0x0180,
- 0x0183, 0x0183,
- 0x0185, 0x0185,
- 0x0188, 0x0188,
- 0x018c, 0x018d,
- 0x0192, 0x0192,
- 0x0195, 0x0195,
- 0x0199, 0x019b,
- 0x019e, 0x019e,
- 0x01a1, 0x01a1,
- 0x01a3, 0x01a3,
- 0x01a5, 0x01a5,
- 0x01a8, 0x01a8,
- 0x01aa, 0x01ab,
- 0x01ad, 0x01ad,
- 0x01b0, 0x01b0,
- 0x01b4, 0x01b4,
- 0x01b6, 0x01b6,
- 0x01b9, 0x01ba,
- 0x01bd, 0x01bf,
- 0x01c6, 0x01c6,
- 0x01c9, 0x01c9,
- 0x01cc, 0x01cc,
- 0x01ce, 0x01ce,
- 0x01d0, 0x01d0,
- 0x01d2, 0x01d2,
- 0x01d4, 0x01d4,
- 0x01d6, 0x01d6,
- 0x01d8, 0x01d8,
- 0x01da, 0x01da,
- 0x01dc, 0x01dd,
- 0x01df, 0x01df,
- 0x01e1, 0x01e1,
- 0x01e3, 0x01e3,
- 0x01e5, 0x01e5,
- 0x01e7, 0x01e7,
- 0x01e9, 0x01e9,
- 0x01eb, 0x01eb,
- 0x01ed, 0x01ed,
- 0x01ef, 0x01f0,
- 0x01f3, 0x01f3,
- 0x01f5, 0x01f5,
- 0x01f9, 0x01f9,
- 0x01fb, 0x01fb,
- 0x01fd, 0x01fd,
- 0x01ff, 0x01ff,
- 0x0201, 0x0201,
- 0x0203, 0x0203,
- 0x0205, 0x0205,
- 0x0207, 0x0207,
- 0x0209, 0x0209,
- 0x020b, 0x020b,
- 0x020d, 0x020d,
- 0x020f, 0x020f,
- 0x0211, 0x0211,
- 0x0213, 0x0213,
- 0x0215, 0x0215,
- 0x0217, 0x0217,
- 0x0219, 0x0219,
- 0x021b, 0x021b,
- 0x021d, 0x021d,
- 0x021f, 0x021f,
- 0x0221, 0x0221,
- 0x0223, 0x0223,
- 0x0225, 0x0225,
- 0x0227, 0x0227,
- 0x0229, 0x0229,
- 0x022b, 0x022b,
- 0x022d, 0x022d,
- 0x022f, 0x022f,
- 0x0231, 0x0231,
- 0x0233, 0x0239,
- 0x023c, 0x023c,
- 0x023f, 0x0240,
- 0x0242, 0x0242,
- 0x0247, 0x0247,
- 0x0249, 0x0249,
- 0x024b, 0x024b,
- 0x024d, 0x024d,
- 0x024f, 0x0293,
- 0x0295, 0x02b8,
- 0x02c0, 0x02c1,
- 0x02e0, 0x02e4,
- 0x0345, 0x0345,
- 0x0371, 0x0371,
- 0x0373, 0x0373,
- 0x0377, 0x0377,
- 0x037a, 0x037d,
- 0x0390, 0x0390,
- 0x03ac, 0x03ce,
- 0x03d0, 0x03d1,
- 0x03d5, 0x03d7,
- 0x03d9, 0x03d9,
- 0x03db, 0x03db,
- 0x03dd, 0x03dd,
- 0x03df, 0x03df,
- 0x03e1, 0x03e1,
- 0x03e3, 0x03e3,
- 0x03e5, 0x03e5,
- 0x03e7, 0x03e7,
- 0x03e9, 0x03e9,
- 0x03eb, 0x03eb,
- 0x03ed, 0x03ed,
- 0x03ef, 0x03f3,
- 0x03f5, 0x03f5,
- 0x03f8, 0x03f8,
- 0x03fb, 0x03fc,
- 0x0430, 0x045f,
- 0x0461, 0x0461,
- 0x0463, 0x0463,
- 0x0465, 0x0465,
- 0x0467, 0x0467,
- 0x0469, 0x0469,
- 0x046b, 0x046b,
- 0x046d, 0x046d,
- 0x046f, 0x046f,
- 0x0471, 0x0471,
- 0x0473, 0x0473,
- 0x0475, 0x0475,
- 0x0477, 0x0477,
- 0x0479, 0x0479,
- 0x047b, 0x047b,
- 0x047d, 0x047d,
- 0x047f, 0x047f,
- 0x0481, 0x0481,
- 0x048b, 0x048b,
- 0x048d, 0x048d,
- 0x048f, 0x048f,
- 0x0491, 0x0491,
- 0x0493, 0x0493,
- 0x0495, 0x0495,
- 0x0497, 0x0497,
- 0x0499, 0x0499,
- 0x049b, 0x049b,
- 0x049d, 0x049d,
- 0x049f, 0x049f,
- 0x04a1, 0x04a1,
- 0x04a3, 0x04a3,
- 0x04a5, 0x04a5,
- 0x04a7, 0x04a7,
- 0x04a9, 0x04a9,
- 0x04ab, 0x04ab,
- 0x04ad, 0x04ad,
- 0x04af, 0x04af,
- 0x04b1, 0x04b1,
- 0x04b3, 0x04b3,
- 0x04b5, 0x04b5,
- 0x04b7, 0x04b7,
- 0x04b9, 0x04b9,
- 0x04bb, 0x04bb,
- 0x04bd, 0x04bd,
- 0x04bf, 0x04bf,
- 0x04c2, 0x04c2,
- 0x04c4, 0x04c4,
- 0x04c6, 0x04c6,
- 0x04c8, 0x04c8,
- 0x04ca, 0x04ca,
- 0x04cc, 0x04cc,
- 0x04ce, 0x04cf,
- 0x04d1, 0x04d1,
- 0x04d3, 0x04d3,
- 0x04d5, 0x04d5,
- 0x04d7, 0x04d7,
- 0x04d9, 0x04d9,
- 0x04db, 0x04db,
- 0x04dd, 0x04dd,
- 0x04df, 0x04df,
- 0x04e1, 0x04e1,
- 0x04e3, 0x04e3,
- 0x04e5, 0x04e5,
- 0x04e7, 0x04e7,
- 0x04e9, 0x04e9,
- 0x04eb, 0x04eb,
- 0x04ed, 0x04ed,
- 0x04ef, 0x04ef,
- 0x04f1, 0x04f1,
- 0x04f3, 0x04f3,
- 0x04f5, 0x04f5,
- 0x04f7, 0x04f7,
- 0x04f9, 0x04f9,
- 0x04fb, 0x04fb,
- 0x04fd, 0x04fd,
- 0x04ff, 0x04ff,
- 0x0501, 0x0501,
- 0x0503, 0x0503,
- 0x0505, 0x0505,
- 0x0507, 0x0507,
- 0x0509, 0x0509,
- 0x050b, 0x050b,
- 0x050d, 0x050d,
- 0x050f, 0x050f,
- 0x0511, 0x0511,
- 0x0513, 0x0513,
- 0x0515, 0x0515,
- 0x0517, 0x0517,
- 0x0519, 0x0519,
- 0x051b, 0x051b,
- 0x051d, 0x051d,
- 0x051f, 0x051f,
- 0x0521, 0x0521,
- 0x0523, 0x0523,
- 0x0525, 0x0525,
- 0x0527, 0x0527,
- 0x0561, 0x0587,
- 0x1d00, 0x1dbf,
- 0x1e01, 0x1e01,
- 0x1e03, 0x1e03,
- 0x1e05, 0x1e05,
- 0x1e07, 0x1e07,
- 0x1e09, 0x1e09,
- 0x1e0b, 0x1e0b,
- 0x1e0d, 0x1e0d,
- 0x1e0f, 0x1e0f,
- 0x1e11, 0x1e11,
- 0x1e13, 0x1e13,
- 0x1e15, 0x1e15,
- 0x1e17, 0x1e17,
- 0x1e19, 0x1e19,
- 0x1e1b, 0x1e1b,
- 0x1e1d, 0x1e1d,
- 0x1e1f, 0x1e1f,
- 0x1e21, 0x1e21,
- 0x1e23, 0x1e23,
- 0x1e25, 0x1e25,
- 0x1e27, 0x1e27,
- 0x1e29, 0x1e29,
- 0x1e2b, 0x1e2b,
- 0x1e2d, 0x1e2d,
- 0x1e2f, 0x1e2f,
- 0x1e31, 0x1e31,
- 0x1e33, 0x1e33,
- 0x1e35, 0x1e35,
- 0x1e37, 0x1e37,
- 0x1e39, 0x1e39,
- 0x1e3b, 0x1e3b,
- 0x1e3d, 0x1e3d,
- 0x1e3f, 0x1e3f,
- 0x1e41, 0x1e41,
- 0x1e43, 0x1e43,
- 0x1e45, 0x1e45,
- 0x1e47, 0x1e47,
- 0x1e49, 0x1e49,
- 0x1e4b, 0x1e4b,
- 0x1e4d, 0x1e4d,
- 0x1e4f, 0x1e4f,
- 0x1e51, 0x1e51,
- 0x1e53, 0x1e53,
- 0x1e55, 0x1e55,
- 0x1e57, 0x1e57,
- 0x1e59, 0x1e59,
- 0x1e5b, 0x1e5b,
- 0x1e5d, 0x1e5d,
- 0x1e5f, 0x1e5f,
- 0x1e61, 0x1e61,
- 0x1e63, 0x1e63,
- 0x1e65, 0x1e65,
- 0x1e67, 0x1e67,
- 0x1e69, 0x1e69,
- 0x1e6b, 0x1e6b,
- 0x1e6d, 0x1e6d,
- 0x1e6f, 0x1e6f,
- 0x1e71, 0x1e71,
- 0x1e73, 0x1e73,
- 0x1e75, 0x1e75,
- 0x1e77, 0x1e77,
- 0x1e79, 0x1e79,
- 0x1e7b, 0x1e7b,
- 0x1e7d, 0x1e7d,
- 0x1e7f, 0x1e7f,
- 0x1e81, 0x1e81,
- 0x1e83, 0x1e83,
- 0x1e85, 0x1e85,
- 0x1e87, 0x1e87,
- 0x1e89, 0x1e89,
- 0x1e8b, 0x1e8b,
- 0x1e8d, 0x1e8d,
- 0x1e8f, 0x1e8f,
- 0x1e91, 0x1e91,
- 0x1e93, 0x1e93,
- 0x1e95, 0x1e9d,
- 0x1e9f, 0x1e9f,
- 0x1ea1, 0x1ea1,
- 0x1ea3, 0x1ea3,
- 0x1ea5, 0x1ea5,
- 0x1ea7, 0x1ea7,
- 0x1ea9, 0x1ea9,
- 0x1eab, 0x1eab,
- 0x1ead, 0x1ead,
- 0x1eaf, 0x1eaf,
- 0x1eb1, 0x1eb1,
- 0x1eb3, 0x1eb3,
- 0x1eb5, 0x1eb5,
- 0x1eb7, 0x1eb7,
- 0x1eb9, 0x1eb9,
- 0x1ebb, 0x1ebb,
- 0x1ebd, 0x1ebd,
- 0x1ebf, 0x1ebf,
- 0x1ec1, 0x1ec1,
- 0x1ec3, 0x1ec3,
- 0x1ec5, 0x1ec5,
- 0x1ec7, 0x1ec7,
- 0x1ec9, 0x1ec9,
- 0x1ecb, 0x1ecb,
- 0x1ecd, 0x1ecd,
- 0x1ecf, 0x1ecf,
- 0x1ed1, 0x1ed1,
- 0x1ed3, 0x1ed3,
- 0x1ed5, 0x1ed5,
- 0x1ed7, 0x1ed7,
- 0x1ed9, 0x1ed9,
- 0x1edb, 0x1edb,
- 0x1edd, 0x1edd,
- 0x1edf, 0x1edf,
- 0x1ee1, 0x1ee1,
- 0x1ee3, 0x1ee3,
- 0x1ee5, 0x1ee5,
- 0x1ee7, 0x1ee7,
- 0x1ee9, 0x1ee9,
- 0x1eeb, 0x1eeb,
- 0x1eed, 0x1eed,
- 0x1eef, 0x1eef,
- 0x1ef1, 0x1ef1,
- 0x1ef3, 0x1ef3,
- 0x1ef5, 0x1ef5,
- 0x1ef7, 0x1ef7,
- 0x1ef9, 0x1ef9,
- 0x1efb, 0x1efb,
- 0x1efd, 0x1efd,
- 0x1eff, 0x1f07,
- 0x1f10, 0x1f15,
- 0x1f20, 0x1f27,
- 0x1f30, 0x1f37,
- 0x1f40, 0x1f45,
- 0x1f50, 0x1f57,
- 0x1f60, 0x1f67,
- 0x1f70, 0x1f7d,
- 0x1f80, 0x1f87,
- 0x1f90, 0x1f97,
- 0x1fa0, 0x1fa7,
- 0x1fb0, 0x1fb4,
- 0x1fb6, 0x1fb7,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fc7,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fd7,
- 0x1fe0, 0x1fe7,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ff7,
- 0x2090, 0x2094,
- 0x210a, 0x210a,
- 0x210e, 0x210f,
- 0x2113, 0x2113,
- 0x212f, 0x212f,
- 0x2134, 0x2134,
- 0x2139, 0x2139,
- 0x213c, 0x213d,
- 0x2146, 0x2149,
- 0x214e, 0x214e,
- 0x2170, 0x217f,
- 0x2184, 0x2184,
- 0x24d0, 0x24e9,
- 0x2c30, 0x2c5e,
- 0x2c61, 0x2c61,
- 0x2c65, 0x2c66,
- 0x2c68, 0x2c68,
- 0x2c6a, 0x2c6a,
- 0x2c6c, 0x2c6c,
- 0x2c71, 0x2c71,
- 0x2c73, 0x2c74,
- 0x2c76, 0x2c7d,
- 0x2c81, 0x2c81,
- 0x2c83, 0x2c83,
- 0x2c85, 0x2c85,
- 0x2c87, 0x2c87,
- 0x2c89, 0x2c89,
- 0x2c8b, 0x2c8b,
- 0x2c8d, 0x2c8d,
- 0x2c8f, 0x2c8f,
- 0x2c91, 0x2c91,
- 0x2c93, 0x2c93,
- 0x2c95, 0x2c95,
- 0x2c97, 0x2c97,
- 0x2c99, 0x2c99,
- 0x2c9b, 0x2c9b,
- 0x2c9d, 0x2c9d,
- 0x2c9f, 0x2c9f,
- 0x2ca1, 0x2ca1,
- 0x2ca3, 0x2ca3,
- 0x2ca5, 0x2ca5,
- 0x2ca7, 0x2ca7,
- 0x2ca9, 0x2ca9,
- 0x2cab, 0x2cab,
- 0x2cad, 0x2cad,
- 0x2caf, 0x2caf,
- 0x2cb1, 0x2cb1,
- 0x2cb3, 0x2cb3,
- 0x2cb5, 0x2cb5,
- 0x2cb7, 0x2cb7,
- 0x2cb9, 0x2cb9,
- 0x2cbb, 0x2cbb,
- 0x2cbd, 0x2cbd,
- 0x2cbf, 0x2cbf,
- 0x2cc1, 0x2cc1,
- 0x2cc3, 0x2cc3,
- 0x2cc5, 0x2cc5,
- 0x2cc7, 0x2cc7,
- 0x2cc9, 0x2cc9,
- 0x2ccb, 0x2ccb,
- 0x2ccd, 0x2ccd,
- 0x2ccf, 0x2ccf,
- 0x2cd1, 0x2cd1,
- 0x2cd3, 0x2cd3,
- 0x2cd5, 0x2cd5,
- 0x2cd7, 0x2cd7,
- 0x2cd9, 0x2cd9,
- 0x2cdb, 0x2cdb,
- 0x2cdd, 0x2cdd,
- 0x2cdf, 0x2cdf,
- 0x2ce1, 0x2ce1,
- 0x2ce3, 0x2ce4,
- 0x2cec, 0x2cec,
- 0x2cee, 0x2cee,
- 0x2d00, 0x2d25,
- 0xa641, 0xa641,
- 0xa643, 0xa643,
- 0xa645, 0xa645,
- 0xa647, 0xa647,
- 0xa649, 0xa649,
- 0xa64b, 0xa64b,
- 0xa64d, 0xa64d,
- 0xa64f, 0xa64f,
- 0xa651, 0xa651,
- 0xa653, 0xa653,
- 0xa655, 0xa655,
- 0xa657, 0xa657,
- 0xa659, 0xa659,
- 0xa65b, 0xa65b,
- 0xa65d, 0xa65d,
- 0xa65f, 0xa65f,
- 0xa661, 0xa661,
- 0xa663, 0xa663,
- 0xa665, 0xa665,
- 0xa667, 0xa667,
- 0xa669, 0xa669,
- 0xa66b, 0xa66b,
- 0xa66d, 0xa66d,
- 0xa681, 0xa681,
- 0xa683, 0xa683,
- 0xa685, 0xa685,
- 0xa687, 0xa687,
- 0xa689, 0xa689,
- 0xa68b, 0xa68b,
- 0xa68d, 0xa68d,
- 0xa68f, 0xa68f,
- 0xa691, 0xa691,
- 0xa693, 0xa693,
- 0xa695, 0xa695,
- 0xa697, 0xa697,
- 0xa723, 0xa723,
- 0xa725, 0xa725,
- 0xa727, 0xa727,
- 0xa729, 0xa729,
- 0xa72b, 0xa72b,
- 0xa72d, 0xa72d,
- 0xa72f, 0xa731,
- 0xa733, 0xa733,
- 0xa735, 0xa735,
- 0xa737, 0xa737,
- 0xa739, 0xa739,
- 0xa73b, 0xa73b,
- 0xa73d, 0xa73d,
- 0xa73f, 0xa73f,
- 0xa741, 0xa741,
- 0xa743, 0xa743,
- 0xa745, 0xa745,
- 0xa747, 0xa747,
- 0xa749, 0xa749,
- 0xa74b, 0xa74b,
- 0xa74d, 0xa74d,
- 0xa74f, 0xa74f,
- 0xa751, 0xa751,
- 0xa753, 0xa753,
- 0xa755, 0xa755,
- 0xa757, 0xa757,
- 0xa759, 0xa759,
- 0xa75b, 0xa75b,
- 0xa75d, 0xa75d,
- 0xa75f, 0xa75f,
- 0xa761, 0xa761,
- 0xa763, 0xa763,
- 0xa765, 0xa765,
- 0xa767, 0xa767,
- 0xa769, 0xa769,
- 0xa76b, 0xa76b,
- 0xa76d, 0xa76d,
- 0xa76f, 0xa778,
- 0xa77a, 0xa77a,
- 0xa77c, 0xa77c,
- 0xa77f, 0xa77f,
- 0xa781, 0xa781,
- 0xa783, 0xa783,
- 0xa785, 0xa785,
- 0xa787, 0xa787,
- 0xa78c, 0xa78c,
- 0xa78e, 0xa78e,
- 0xa791, 0xa791,
- 0xa7a1, 0xa7a1,
- 0xa7a3, 0xa7a3,
- 0xa7a5, 0xa7a5,
- 0xa7a7, 0xa7a7,
- 0xa7a9, 0xa7a9,
- 0xa7fa, 0xa7fa,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xff41, 0xff5a,
- 0x10428, 0x1044f,
- 0x1d41a, 0x1d433,
- 0x1d44e, 0x1d454,
- 0x1d456, 0x1d467,
- 0x1d482, 0x1d49b,
- 0x1d4b6, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d4cf,
- 0x1d4ea, 0x1d503,
- 0x1d51e, 0x1d537,
- 0x1d552, 0x1d56b,
- 0x1d586, 0x1d59f,
- 0x1d5ba, 0x1d5d3,
- 0x1d5ee, 0x1d607,
- 0x1d622, 0x1d63b,
- 0x1d656, 0x1d66f,
- 0x1d68a, 0x1d6a5,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6e1,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d71b,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d755,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d78f,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7c9,
- 0x1d7cb, 0x1d7cb,
-}; /* CR_Lowercase */
+#define CR_Lowercase CR_Lower
/* 'Uppercase': Derived Property */
-static const OnigCodePoint CR_Uppercase[] = {
- 605,
- 0x0041, 0x005a,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00de,
- 0x0100, 0x0100,
- 0x0102, 0x0102,
- 0x0104, 0x0104,
- 0x0106, 0x0106,
- 0x0108, 0x0108,
- 0x010a, 0x010a,
- 0x010c, 0x010c,
- 0x010e, 0x010e,
- 0x0110, 0x0110,
- 0x0112, 0x0112,
- 0x0114, 0x0114,
- 0x0116, 0x0116,
- 0x0118, 0x0118,
- 0x011a, 0x011a,
- 0x011c, 0x011c,
- 0x011e, 0x011e,
- 0x0120, 0x0120,
- 0x0122, 0x0122,
- 0x0124, 0x0124,
- 0x0126, 0x0126,
- 0x0128, 0x0128,
- 0x012a, 0x012a,
- 0x012c, 0x012c,
- 0x012e, 0x012e,
- 0x0130, 0x0130,
- 0x0132, 0x0132,
- 0x0134, 0x0134,
- 0x0136, 0x0136,
- 0x0139, 0x0139,
- 0x013b, 0x013b,
- 0x013d, 0x013d,
- 0x013f, 0x013f,
- 0x0141, 0x0141,
- 0x0143, 0x0143,
- 0x0145, 0x0145,
- 0x0147, 0x0147,
- 0x014a, 0x014a,
- 0x014c, 0x014c,
- 0x014e, 0x014e,
- 0x0150, 0x0150,
- 0x0152, 0x0152,
- 0x0154, 0x0154,
- 0x0156, 0x0156,
- 0x0158, 0x0158,
- 0x015a, 0x015a,
- 0x015c, 0x015c,
- 0x015e, 0x015e,
- 0x0160, 0x0160,
- 0x0162, 0x0162,
- 0x0164, 0x0164,
- 0x0166, 0x0166,
- 0x0168, 0x0168,
- 0x016a, 0x016a,
- 0x016c, 0x016c,
- 0x016e, 0x016e,
- 0x0170, 0x0170,
- 0x0172, 0x0172,
- 0x0174, 0x0174,
- 0x0176, 0x0176,
- 0x0178, 0x0179,
- 0x017b, 0x017b,
- 0x017d, 0x017d,
- 0x0181, 0x0182,
- 0x0184, 0x0184,
- 0x0186, 0x0187,
- 0x0189, 0x018b,
- 0x018e, 0x0191,
- 0x0193, 0x0194,
- 0x0196, 0x0198,
- 0x019c, 0x019d,
- 0x019f, 0x01a0,
- 0x01a2, 0x01a2,
- 0x01a4, 0x01a4,
- 0x01a6, 0x01a7,
- 0x01a9, 0x01a9,
- 0x01ac, 0x01ac,
- 0x01ae, 0x01af,
- 0x01b1, 0x01b3,
- 0x01b5, 0x01b5,
- 0x01b7, 0x01b8,
- 0x01bc, 0x01bc,
- 0x01c4, 0x01c4,
- 0x01c7, 0x01c7,
- 0x01ca, 0x01ca,
- 0x01cd, 0x01cd,
- 0x01cf, 0x01cf,
- 0x01d1, 0x01d1,
- 0x01d3, 0x01d3,
- 0x01d5, 0x01d5,
- 0x01d7, 0x01d7,
- 0x01d9, 0x01d9,
- 0x01db, 0x01db,
- 0x01de, 0x01de,
- 0x01e0, 0x01e0,
- 0x01e2, 0x01e2,
- 0x01e4, 0x01e4,
- 0x01e6, 0x01e6,
- 0x01e8, 0x01e8,
- 0x01ea, 0x01ea,
- 0x01ec, 0x01ec,
- 0x01ee, 0x01ee,
- 0x01f1, 0x01f1,
- 0x01f4, 0x01f4,
- 0x01f6, 0x01f8,
- 0x01fa, 0x01fa,
- 0x01fc, 0x01fc,
- 0x01fe, 0x01fe,
- 0x0200, 0x0200,
- 0x0202, 0x0202,
- 0x0204, 0x0204,
- 0x0206, 0x0206,
- 0x0208, 0x0208,
- 0x020a, 0x020a,
- 0x020c, 0x020c,
- 0x020e, 0x020e,
- 0x0210, 0x0210,
- 0x0212, 0x0212,
- 0x0214, 0x0214,
- 0x0216, 0x0216,
- 0x0218, 0x0218,
- 0x021a, 0x021a,
- 0x021c, 0x021c,
- 0x021e, 0x021e,
- 0x0220, 0x0220,
- 0x0222, 0x0222,
- 0x0224, 0x0224,
- 0x0226, 0x0226,
- 0x0228, 0x0228,
- 0x022a, 0x022a,
- 0x022c, 0x022c,
- 0x022e, 0x022e,
- 0x0230, 0x0230,
- 0x0232, 0x0232,
- 0x023a, 0x023b,
- 0x023d, 0x023e,
- 0x0241, 0x0241,
- 0x0243, 0x0246,
- 0x0248, 0x0248,
- 0x024a, 0x024a,
- 0x024c, 0x024c,
- 0x024e, 0x024e,
- 0x0370, 0x0370,
- 0x0372, 0x0372,
- 0x0376, 0x0376,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x038f,
- 0x0391, 0x03a1,
- 0x03a3, 0x03ab,
- 0x03cf, 0x03cf,
- 0x03d2, 0x03d4,
- 0x03d8, 0x03d8,
- 0x03da, 0x03da,
- 0x03dc, 0x03dc,
- 0x03de, 0x03de,
- 0x03e0, 0x03e0,
- 0x03e2, 0x03e2,
- 0x03e4, 0x03e4,
- 0x03e6, 0x03e6,
- 0x03e8, 0x03e8,
- 0x03ea, 0x03ea,
- 0x03ec, 0x03ec,
- 0x03ee, 0x03ee,
- 0x03f4, 0x03f4,
- 0x03f7, 0x03f7,
- 0x03f9, 0x03fa,
- 0x03fd, 0x042f,
- 0x0460, 0x0460,
- 0x0462, 0x0462,
- 0x0464, 0x0464,
- 0x0466, 0x0466,
- 0x0468, 0x0468,
- 0x046a, 0x046a,
- 0x046c, 0x046c,
- 0x046e, 0x046e,
- 0x0470, 0x0470,
- 0x0472, 0x0472,
- 0x0474, 0x0474,
- 0x0476, 0x0476,
- 0x0478, 0x0478,
- 0x047a, 0x047a,
- 0x047c, 0x047c,
- 0x047e, 0x047e,
- 0x0480, 0x0480,
- 0x048a, 0x048a,
- 0x048c, 0x048c,
- 0x048e, 0x048e,
- 0x0490, 0x0490,
- 0x0492, 0x0492,
- 0x0494, 0x0494,
- 0x0496, 0x0496,
- 0x0498, 0x0498,
- 0x049a, 0x049a,
- 0x049c, 0x049c,
- 0x049e, 0x049e,
- 0x04a0, 0x04a0,
- 0x04a2, 0x04a2,
- 0x04a4, 0x04a4,
- 0x04a6, 0x04a6,
- 0x04a8, 0x04a8,
- 0x04aa, 0x04aa,
- 0x04ac, 0x04ac,
- 0x04ae, 0x04ae,
- 0x04b0, 0x04b0,
- 0x04b2, 0x04b2,
- 0x04b4, 0x04b4,
- 0x04b6, 0x04b6,
- 0x04b8, 0x04b8,
- 0x04ba, 0x04ba,
- 0x04bc, 0x04bc,
- 0x04be, 0x04be,
- 0x04c0, 0x04c1,
- 0x04c3, 0x04c3,
- 0x04c5, 0x04c5,
- 0x04c7, 0x04c7,
- 0x04c9, 0x04c9,
- 0x04cb, 0x04cb,
- 0x04cd, 0x04cd,
- 0x04d0, 0x04d0,
- 0x04d2, 0x04d2,
- 0x04d4, 0x04d4,
- 0x04d6, 0x04d6,
- 0x04d8, 0x04d8,
- 0x04da, 0x04da,
- 0x04dc, 0x04dc,
- 0x04de, 0x04de,
- 0x04e0, 0x04e0,
- 0x04e2, 0x04e2,
- 0x04e4, 0x04e4,
- 0x04e6, 0x04e6,
- 0x04e8, 0x04e8,
- 0x04ea, 0x04ea,
- 0x04ec, 0x04ec,
- 0x04ee, 0x04ee,
- 0x04f0, 0x04f0,
- 0x04f2, 0x04f2,
- 0x04f4, 0x04f4,
- 0x04f6, 0x04f6,
- 0x04f8, 0x04f8,
- 0x04fa, 0x04fa,
- 0x04fc, 0x04fc,
- 0x04fe, 0x04fe,
- 0x0500, 0x0500,
- 0x0502, 0x0502,
- 0x0504, 0x0504,
- 0x0506, 0x0506,
- 0x0508, 0x0508,
- 0x050a, 0x050a,
- 0x050c, 0x050c,
- 0x050e, 0x050e,
- 0x0510, 0x0510,
- 0x0512, 0x0512,
- 0x0514, 0x0514,
- 0x0516, 0x0516,
- 0x0518, 0x0518,
- 0x051a, 0x051a,
- 0x051c, 0x051c,
- 0x051e, 0x051e,
- 0x0520, 0x0520,
- 0x0522, 0x0522,
- 0x0524, 0x0524,
- 0x0526, 0x0526,
- 0x0531, 0x0556,
- 0x10a0, 0x10c5,
- 0x1e00, 0x1e00,
- 0x1e02, 0x1e02,
- 0x1e04, 0x1e04,
- 0x1e06, 0x1e06,
- 0x1e08, 0x1e08,
- 0x1e0a, 0x1e0a,
- 0x1e0c, 0x1e0c,
- 0x1e0e, 0x1e0e,
- 0x1e10, 0x1e10,
- 0x1e12, 0x1e12,
- 0x1e14, 0x1e14,
- 0x1e16, 0x1e16,
- 0x1e18, 0x1e18,
- 0x1e1a, 0x1e1a,
- 0x1e1c, 0x1e1c,
- 0x1e1e, 0x1e1e,
- 0x1e20, 0x1e20,
- 0x1e22, 0x1e22,
- 0x1e24, 0x1e24,
- 0x1e26, 0x1e26,
- 0x1e28, 0x1e28,
- 0x1e2a, 0x1e2a,
- 0x1e2c, 0x1e2c,
- 0x1e2e, 0x1e2e,
- 0x1e30, 0x1e30,
- 0x1e32, 0x1e32,
- 0x1e34, 0x1e34,
- 0x1e36, 0x1e36,
- 0x1e38, 0x1e38,
- 0x1e3a, 0x1e3a,
- 0x1e3c, 0x1e3c,
- 0x1e3e, 0x1e3e,
- 0x1e40, 0x1e40,
- 0x1e42, 0x1e42,
- 0x1e44, 0x1e44,
- 0x1e46, 0x1e46,
- 0x1e48, 0x1e48,
- 0x1e4a, 0x1e4a,
- 0x1e4c, 0x1e4c,
- 0x1e4e, 0x1e4e,
- 0x1e50, 0x1e50,
- 0x1e52, 0x1e52,
- 0x1e54, 0x1e54,
- 0x1e56, 0x1e56,
- 0x1e58, 0x1e58,
- 0x1e5a, 0x1e5a,
- 0x1e5c, 0x1e5c,
- 0x1e5e, 0x1e5e,
- 0x1e60, 0x1e60,
- 0x1e62, 0x1e62,
- 0x1e64, 0x1e64,
- 0x1e66, 0x1e66,
- 0x1e68, 0x1e68,
- 0x1e6a, 0x1e6a,
- 0x1e6c, 0x1e6c,
- 0x1e6e, 0x1e6e,
- 0x1e70, 0x1e70,
- 0x1e72, 0x1e72,
- 0x1e74, 0x1e74,
- 0x1e76, 0x1e76,
- 0x1e78, 0x1e78,
- 0x1e7a, 0x1e7a,
- 0x1e7c, 0x1e7c,
- 0x1e7e, 0x1e7e,
- 0x1e80, 0x1e80,
- 0x1e82, 0x1e82,
- 0x1e84, 0x1e84,
- 0x1e86, 0x1e86,
- 0x1e88, 0x1e88,
- 0x1e8a, 0x1e8a,
- 0x1e8c, 0x1e8c,
- 0x1e8e, 0x1e8e,
- 0x1e90, 0x1e90,
- 0x1e92, 0x1e92,
- 0x1e94, 0x1e94,
- 0x1e9e, 0x1e9e,
- 0x1ea0, 0x1ea0,
- 0x1ea2, 0x1ea2,
- 0x1ea4, 0x1ea4,
- 0x1ea6, 0x1ea6,
- 0x1ea8, 0x1ea8,
- 0x1eaa, 0x1eaa,
- 0x1eac, 0x1eac,
- 0x1eae, 0x1eae,
- 0x1eb0, 0x1eb0,
- 0x1eb2, 0x1eb2,
- 0x1eb4, 0x1eb4,
- 0x1eb6, 0x1eb6,
- 0x1eb8, 0x1eb8,
- 0x1eba, 0x1eba,
- 0x1ebc, 0x1ebc,
- 0x1ebe, 0x1ebe,
- 0x1ec0, 0x1ec0,
- 0x1ec2, 0x1ec2,
- 0x1ec4, 0x1ec4,
- 0x1ec6, 0x1ec6,
- 0x1ec8, 0x1ec8,
- 0x1eca, 0x1eca,
- 0x1ecc, 0x1ecc,
- 0x1ece, 0x1ece,
- 0x1ed0, 0x1ed0,
- 0x1ed2, 0x1ed2,
- 0x1ed4, 0x1ed4,
- 0x1ed6, 0x1ed6,
- 0x1ed8, 0x1ed8,
- 0x1eda, 0x1eda,
- 0x1edc, 0x1edc,
- 0x1ede, 0x1ede,
- 0x1ee0, 0x1ee0,
- 0x1ee2, 0x1ee2,
- 0x1ee4, 0x1ee4,
- 0x1ee6, 0x1ee6,
- 0x1ee8, 0x1ee8,
- 0x1eea, 0x1eea,
- 0x1eec, 0x1eec,
- 0x1eee, 0x1eee,
- 0x1ef0, 0x1ef0,
- 0x1ef2, 0x1ef2,
- 0x1ef4, 0x1ef4,
- 0x1ef6, 0x1ef6,
- 0x1ef8, 0x1ef8,
- 0x1efa, 0x1efa,
- 0x1efc, 0x1efc,
- 0x1efe, 0x1efe,
- 0x1f08, 0x1f0f,
- 0x1f18, 0x1f1d,
- 0x1f28, 0x1f2f,
- 0x1f38, 0x1f3f,
- 0x1f48, 0x1f4d,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f5f,
- 0x1f68, 0x1f6f,
- 0x1fb8, 0x1fbb,
- 0x1fc8, 0x1fcb,
- 0x1fd8, 0x1fdb,
- 0x1fe8, 0x1fec,
- 0x1ff8, 0x1ffb,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210b, 0x210d,
- 0x2110, 0x2112,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x2130, 0x2133,
- 0x213e, 0x213f,
- 0x2145, 0x2145,
- 0x2160, 0x216f,
- 0x2183, 0x2183,
- 0x24b6, 0x24cf,
- 0x2c00, 0x2c2e,
- 0x2c60, 0x2c60,
- 0x2c62, 0x2c64,
- 0x2c67, 0x2c67,
- 0x2c69, 0x2c69,
- 0x2c6b, 0x2c6b,
- 0x2c6d, 0x2c70,
- 0x2c72, 0x2c72,
- 0x2c75, 0x2c75,
- 0x2c7e, 0x2c80,
- 0x2c82, 0x2c82,
- 0x2c84, 0x2c84,
- 0x2c86, 0x2c86,
- 0x2c88, 0x2c88,
- 0x2c8a, 0x2c8a,
- 0x2c8c, 0x2c8c,
- 0x2c8e, 0x2c8e,
- 0x2c90, 0x2c90,
- 0x2c92, 0x2c92,
- 0x2c94, 0x2c94,
- 0x2c96, 0x2c96,
- 0x2c98, 0x2c98,
- 0x2c9a, 0x2c9a,
- 0x2c9c, 0x2c9c,
- 0x2c9e, 0x2c9e,
- 0x2ca0, 0x2ca0,
- 0x2ca2, 0x2ca2,
- 0x2ca4, 0x2ca4,
- 0x2ca6, 0x2ca6,
- 0x2ca8, 0x2ca8,
- 0x2caa, 0x2caa,
- 0x2cac, 0x2cac,
- 0x2cae, 0x2cae,
- 0x2cb0, 0x2cb0,
- 0x2cb2, 0x2cb2,
- 0x2cb4, 0x2cb4,
- 0x2cb6, 0x2cb6,
- 0x2cb8, 0x2cb8,
- 0x2cba, 0x2cba,
- 0x2cbc, 0x2cbc,
- 0x2cbe, 0x2cbe,
- 0x2cc0, 0x2cc0,
- 0x2cc2, 0x2cc2,
- 0x2cc4, 0x2cc4,
- 0x2cc6, 0x2cc6,
- 0x2cc8, 0x2cc8,
- 0x2cca, 0x2cca,
- 0x2ccc, 0x2ccc,
- 0x2cce, 0x2cce,
- 0x2cd0, 0x2cd0,
- 0x2cd2, 0x2cd2,
- 0x2cd4, 0x2cd4,
- 0x2cd6, 0x2cd6,
- 0x2cd8, 0x2cd8,
- 0x2cda, 0x2cda,
- 0x2cdc, 0x2cdc,
- 0x2cde, 0x2cde,
- 0x2ce0, 0x2ce0,
- 0x2ce2, 0x2ce2,
- 0x2ceb, 0x2ceb,
- 0x2ced, 0x2ced,
- 0xa640, 0xa640,
- 0xa642, 0xa642,
- 0xa644, 0xa644,
- 0xa646, 0xa646,
- 0xa648, 0xa648,
- 0xa64a, 0xa64a,
- 0xa64c, 0xa64c,
- 0xa64e, 0xa64e,
- 0xa650, 0xa650,
- 0xa652, 0xa652,
- 0xa654, 0xa654,
- 0xa656, 0xa656,
- 0xa658, 0xa658,
- 0xa65a, 0xa65a,
- 0xa65c, 0xa65c,
- 0xa65e, 0xa65e,
- 0xa660, 0xa660,
- 0xa662, 0xa662,
- 0xa664, 0xa664,
- 0xa666, 0xa666,
- 0xa668, 0xa668,
- 0xa66a, 0xa66a,
- 0xa66c, 0xa66c,
- 0xa680, 0xa680,
- 0xa682, 0xa682,
- 0xa684, 0xa684,
- 0xa686, 0xa686,
- 0xa688, 0xa688,
- 0xa68a, 0xa68a,
- 0xa68c, 0xa68c,
- 0xa68e, 0xa68e,
- 0xa690, 0xa690,
- 0xa692, 0xa692,
- 0xa694, 0xa694,
- 0xa696, 0xa696,
- 0xa722, 0xa722,
- 0xa724, 0xa724,
- 0xa726, 0xa726,
- 0xa728, 0xa728,
- 0xa72a, 0xa72a,
- 0xa72c, 0xa72c,
- 0xa72e, 0xa72e,
- 0xa732, 0xa732,
- 0xa734, 0xa734,
- 0xa736, 0xa736,
- 0xa738, 0xa738,
- 0xa73a, 0xa73a,
- 0xa73c, 0xa73c,
- 0xa73e, 0xa73e,
- 0xa740, 0xa740,
- 0xa742, 0xa742,
- 0xa744, 0xa744,
- 0xa746, 0xa746,
- 0xa748, 0xa748,
- 0xa74a, 0xa74a,
- 0xa74c, 0xa74c,
- 0xa74e, 0xa74e,
- 0xa750, 0xa750,
- 0xa752, 0xa752,
- 0xa754, 0xa754,
- 0xa756, 0xa756,
- 0xa758, 0xa758,
- 0xa75a, 0xa75a,
- 0xa75c, 0xa75c,
- 0xa75e, 0xa75e,
- 0xa760, 0xa760,
- 0xa762, 0xa762,
- 0xa764, 0xa764,
- 0xa766, 0xa766,
- 0xa768, 0xa768,
- 0xa76a, 0xa76a,
- 0xa76c, 0xa76c,
- 0xa76e, 0xa76e,
- 0xa779, 0xa779,
- 0xa77b, 0xa77b,
- 0xa77d, 0xa77e,
- 0xa780, 0xa780,
- 0xa782, 0xa782,
- 0xa784, 0xa784,
- 0xa786, 0xa786,
- 0xa78b, 0xa78b,
- 0xa78d, 0xa78d,
- 0xa790, 0xa790,
- 0xa7a0, 0xa7a0,
- 0xa7a2, 0xa7a2,
- 0xa7a4, 0xa7a4,
- 0xa7a6, 0xa7a6,
- 0xa7a8, 0xa7a8,
- 0xff21, 0xff3a,
- 0x10400, 0x10427,
- 0x1d400, 0x1d419,
- 0x1d434, 0x1d44d,
- 0x1d468, 0x1d481,
- 0x1d49c, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b5,
- 0x1d4d0, 0x1d4e9,
- 0x1d504, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d538, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d56c, 0x1d585,
- 0x1d5a0, 0x1d5b9,
- 0x1d5d4, 0x1d5ed,
- 0x1d608, 0x1d621,
- 0x1d63c, 0x1d655,
- 0x1d670, 0x1d689,
- 0x1d6a8, 0x1d6c0,
- 0x1d6e2, 0x1d6fa,
- 0x1d71c, 0x1d734,
- 0x1d756, 0x1d76e,
- 0x1d790, 0x1d7a8,
- 0x1d7ca, 0x1d7ca,
-}; /* CR_Uppercase */
+#define CR_Uppercase CR_Upper
/* 'Cased': Derived Property */
static const OnigCodePoint CR_Cased[] = {
- 112,
+ 119,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -6761,6 +10029,8 @@ static const OnigCodePoint CR_Cased[] = {
0x0531, 0x0556,
0x0561, 0x0587,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x1d00, 0x1dbf,
0x1e00, 0x1f15,
0x1f18, 0x1f1d,
@@ -6781,7 +10051,9 @@ static const OnigCodePoint CR_Cased[] = {
0x1fe0, 0x1fec,
0x1ff2, 0x1ff4,
0x1ff6, 0x1ffc,
- 0x2090, 0x2094,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
0x2102, 0x2102,
0x2107, 0x2107,
0x210a, 0x2113,
@@ -6803,14 +10075,17 @@ static const OnigCodePoint CR_Cased[] = {
0x2c30, 0x2c5e,
0x2c60, 0x2ce4,
0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
0xa640, 0xa66d,
0xa680, 0xa697,
0xa722, 0xa787,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa7fa,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa7fa,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
0xff21, 0xff3a,
@@ -6850,7 +10125,7 @@ static const OnigCodePoint CR_Cased[] = {
/* 'Case_Ignorable': Derived Property */
static const OnigCodePoint CR_Case_Ignorable[] = {
- 277,
+ 295,
0x0027, 0x0027,
0x002e, 0x002e,
0x003a, 0x003a,
@@ -6874,7 +10149,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x05c4, 0x05c5,
0x05c7, 0x05c7,
0x05f4, 0x05f4,
- 0x0600, 0x0603,
+ 0x0600, 0x0604,
0x0610, 0x061a,
0x0640, 0x0640,
0x064b, 0x065f,
@@ -6890,6 +10165,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x07fa, 0x07fa,
0x0816, 0x082d,
0x0859, 0x085b,
+ 0x08e4, 0x08fe,
0x0900, 0x0902,
0x093a, 0x093a,
0x093c, 0x093c,
@@ -7009,6 +10285,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x1b80, 0x1b81,
0x1ba2, 0x1ba5,
0x1ba8, 0x1ba9,
+ 0x1bab, 0x1bab,
0x1be6, 0x1be6,
0x1be8, 0x1be9,
0x1bed, 0x1bed,
@@ -7020,7 +10297,8 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x1cd4, 0x1ce0,
0x1ce2, 0x1ce8,
0x1ced, 0x1ced,
- 0x1d2c, 0x1d61,
+ 0x1cf4, 0x1cf4,
+ 0x1d2c, 0x1d6a,
0x1d78, 0x1d78,
0x1d9b, 0x1de6,
0x1dfc, 0x1dff,
@@ -7041,14 +10319,14 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x207f, 0x207f,
0x2090, 0x209c,
0x20d0, 0x20f0,
- 0x2c7d, 0x2c7d,
+ 0x2c7c, 0x2c7d,
0x2cef, 0x2cf1,
0x2d6f, 0x2d6f,
0x2d7f, 0x2d7f,
0x2de0, 0x2dff,
0x2e2f, 0x2e2f,
0x3005, 0x3005,
- 0x302a, 0x302f,
+ 0x302a, 0x302d,
0x3031, 0x3035,
0x303b, 0x303b,
0x3099, 0x309e,
@@ -7057,12 +10335,14 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0xa4f8, 0xa4fd,
0xa60c, 0xa60c,
0xa66f, 0xa672,
- 0xa67c, 0xa67d,
+ 0xa674, 0xa67d,
0xa67f, 0xa67f,
+ 0xa69f, 0xa69f,
0xa6f0, 0xa6f1,
0xa700, 0xa721,
0xa770, 0xa770,
0xa788, 0xa78a,
+ 0xa7f8, 0xa7f9,
0xa802, 0xa802,
0xa806, 0xa806,
0xa80b, 0xa80b,
@@ -7088,6 +10368,9 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0xaabe, 0xaabf,
0xaac1, 0xaac1,
0xaadd, 0xaadd,
+ 0xaaec, 0xaaed,
+ 0xaaf3, 0xaaf4,
+ 0xaaf6, 0xaaf6,
0xabe5, 0xabe5,
0xabe8, 0xabe8,
0xabed, 0xabed,
@@ -7120,6 +10403,16 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x110b3, 0x110b6,
0x110b9, 0x110ba,
0x110bd, 0x110bd,
+ 0x11100, 0x11102,
+ 0x11127, 0x1112b,
+ 0x1112d, 0x11134,
+ 0x11180, 0x11181,
+ 0x111b6, 0x111be,
+ 0x116ab, 0x116ab,
+ 0x116ad, 0x116ad,
+ 0x116b0, 0x116b5,
+ 0x116b7, 0x116b7,
+ 0x16f8f, 0x16f9f,
0x1d167, 0x1d169,
0x1d173, 0x1d182,
0x1d185, 0x1d18b,
@@ -7132,7 +10425,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
/* 'Changes_When_Lowercased': Derived Property */
static const OnigCodePoint CR_Changes_When_Lowercased[] = {
- 566,
+ 571,
0x0041, 0x005a,
0x00c0, 0x00d6,
0x00d8, 0x00de,
@@ -7400,6 +10693,8 @@ static const OnigCodePoint CR_Changes_When_Lowercased[] = {
0x0526, 0x0526,
0x0531, 0x0556,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x1e00, 0x1e00,
0x1e02, 0x1e02,
0x1e04, 0x1e04,
@@ -7609,6 +10904,7 @@ static const OnigCodePoint CR_Changes_When_Lowercased[] = {
0x2ce2, 0x2ce2,
0x2ceb, 0x2ceb,
0x2ced, 0x2ced,
+ 0x2cf2, 0x2cf2,
0xa640, 0xa640,
0xa642, 0xa642,
0xa644, 0xa644,
@@ -7692,18 +10988,20 @@ static const OnigCodePoint CR_Changes_When_Lowercased[] = {
0xa78b, 0xa78b,
0xa78d, 0xa78d,
0xa790, 0xa790,
+ 0xa792, 0xa792,
0xa7a0, 0xa7a0,
0xa7a2, 0xa7a2,
0xa7a4, 0xa7a4,
0xa7a6, 0xa7a6,
0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
0xff21, 0xff3a,
0x10400, 0x10427,
}; /* CR_Changes_When_Lowercased */
/* 'Changes_When_Uppercased': Derived Property */
static const OnigCodePoint CR_Changes_When_Uppercased[] = {
- 582,
+ 586,
0x0061, 0x007a,
0x00b5, 0x00b5,
0x00df, 0x00f6,
@@ -7853,7 +11151,7 @@ static const OnigCodePoint CR_Changes_When_Uppercased[] = {
0x025b, 0x025b,
0x0260, 0x0260,
0x0263, 0x0263,
- 0x0265, 0x0265,
+ 0x0265, 0x0266,
0x0268, 0x0269,
0x026b, 0x026b,
0x026f, 0x026f,
@@ -8194,7 +11492,10 @@ static const OnigCodePoint CR_Changes_When_Uppercased[] = {
0x2ce3, 0x2ce3,
0x2cec, 0x2cec,
0x2cee, 0x2cee,
+ 0x2cf3, 0x2cf3,
0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
0xa641, 0xa641,
0xa643, 0xa643,
0xa645, 0xa645,
@@ -8277,6 +11578,7 @@ static const OnigCodePoint CR_Changes_When_Uppercased[] = {
0xa787, 0xa787,
0xa78c, 0xa78c,
0xa791, 0xa791,
+ 0xa793, 0xa793,
0xa7a1, 0xa7a1,
0xa7a3, 0xa7a3,
0xa7a5, 0xa7a5,
@@ -8290,7 +11592,7 @@ static const OnigCodePoint CR_Changes_When_Uppercased[] = {
/* 'Changes_When_Titlecased': Derived Property */
static const OnigCodePoint CR_Changes_When_Titlecased[] = {
- 583,
+ 587,
0x0061, 0x007a,
0x00b5, 0x00b5,
0x00df, 0x00f6,
@@ -8441,7 +11743,7 @@ static const OnigCodePoint CR_Changes_When_Titlecased[] = {
0x025b, 0x025b,
0x0260, 0x0260,
0x0263, 0x0263,
- 0x0265, 0x0265,
+ 0x0265, 0x0266,
0x0268, 0x0269,
0x026b, 0x026b,
0x026f, 0x026f,
@@ -8782,7 +12084,10 @@ static const OnigCodePoint CR_Changes_When_Titlecased[] = {
0x2ce3, 0x2ce3,
0x2cec, 0x2cec,
0x2cee, 0x2cee,
+ 0x2cf3, 0x2cf3,
0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
0xa641, 0xa641,
0xa643, 0xa643,
0xa645, 0xa645,
@@ -8865,6 +12170,7 @@ static const OnigCodePoint CR_Changes_When_Titlecased[] = {
0xa787, 0xa787,
0xa78c, 0xa78c,
0xa791, 0xa791,
+ 0xa793, 0xa793,
0xa7a1, 0xa7a1,
0xa7a3, 0xa7a3,
0xa7a5, 0xa7a5,
@@ -8878,7 +12184,7 @@ static const OnigCodePoint CR_Changes_When_Titlecased[] = {
/* 'Changes_When_Casefolded': Derived Property */
static const OnigCodePoint CR_Changes_When_Casefolded[] = {
- 577,
+ 582,
0x0041, 0x005a,
0x00b5, 0x00b5,
0x00c0, 0x00d6,
@@ -9153,6 +12459,8 @@ static const OnigCodePoint CR_Changes_When_Casefolded[] = {
0x0531, 0x0556,
0x0587, 0x0587,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x1e00, 0x1e00,
0x1e02, 0x1e02,
0x1e04, 0x1e04,
@@ -9364,6 +12672,7 @@ static const OnigCodePoint CR_Changes_When_Casefolded[] = {
0x2ce2, 0x2ce2,
0x2ceb, 0x2ceb,
0x2ced, 0x2ced,
+ 0x2cf2, 0x2cf2,
0xa640, 0xa640,
0xa642, 0xa642,
0xa644, 0xa644,
@@ -9447,11 +12756,13 @@ static const OnigCodePoint CR_Changes_When_Casefolded[] = {
0xa78b, 0xa78b,
0xa78d, 0xa78d,
0xa790, 0xa790,
+ 0xa792, 0xa792,
0xa7a0, 0xa7a0,
0xa7a2, 0xa7a2,
0xa7a4, 0xa7a4,
0xa7a6, 0xa7a6,
0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
0xff21, 0xff3a,
@@ -9460,7 +12771,7 @@ static const OnigCodePoint CR_Changes_When_Casefolded[] = {
/* 'Changes_When_Casemapped': Derived Property */
static const OnigCodePoint CR_Changes_When_Casemapped[] = {
- 99,
+ 104,
0x0041, 0x005a,
0x0061, 0x007a,
0x00b5, 0x00b5,
@@ -9481,7 +12792,7 @@ static const OnigCodePoint CR_Changes_When_Casemapped[] = {
0x025b, 0x025b,
0x0260, 0x0260,
0x0263, 0x0263,
- 0x0265, 0x0265,
+ 0x0265, 0x0266,
0x0268, 0x0269,
0x026b, 0x026b,
0x026f, 0x026f,
@@ -9509,6 +12820,8 @@ static const OnigCodePoint CR_Changes_When_Casemapped[] = {
0x0531, 0x0556,
0x0561, 0x0587,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x1d79, 0x1d79,
0x1d7d, 0x1d7d,
0x1e00, 0x1e9b,
@@ -9546,15 +12859,18 @@ static const OnigCodePoint CR_Changes_When_Casemapped[] = {
0x2c75, 0x2c76,
0x2c7e, 0x2ce3,
0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
0xa640, 0xa66d,
0xa680, 0xa697,
0xa722, 0xa72f,
0xa732, 0xa76f,
0xa779, 0xa787,
0xa78b, 0xa78d,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
0xff21, 0xff3a,
@@ -9564,7 +12880,7 @@ static const OnigCodePoint CR_Changes_When_Casemapped[] = {
/* 'ID_Start': Derived Property */
static const OnigCodePoint CR_ID_Start[] = {
- 437,
+ 488,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -9612,6 +12928,8 @@ static const OnigCodePoint CR_ID_Start[] = {
0x0824, 0x0824,
0x0828, 0x0828,
0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
0x0904, 0x0939,
0x093d, 0x093d,
0x0950, 0x0950,
@@ -9717,7 +13035,7 @@ static const OnigCodePoint CR_ID_Start[] = {
0x0ebd, 0x0ebd,
0x0ec0, 0x0ec4,
0x0ec6, 0x0ec6,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f00,
0x0f40, 0x0f47,
0x0f49, 0x0f6c,
@@ -9732,9 +13050,10 @@ static const OnigCodePoint CR_ID_Start[] = {
0x1075, 0x1081,
0x108e, 0x108e,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
+ 0x10fc, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -9782,12 +13101,13 @@ static const OnigCodePoint CR_ID_Start[] = {
0x1b45, 0x1b4b,
0x1b83, 0x1ba0,
0x1bae, 0x1baf,
- 0x1bc0, 0x1be5,
+ 0x1bba, 0x1be5,
0x1c00, 0x1c23,
0x1c4d, 0x1c4f,
0x1c5a, 0x1c7d,
0x1ce9, 0x1cec,
0x1cee, 0x1cf1,
+ 0x1cf5, 0x1cf6,
0x1d00, 0x1dbf,
0x1e00, 0x1f15,
0x1f18, 0x1f1d,
@@ -9828,8 +13148,11 @@ static const OnigCodePoint CR_ID_Start[] = {
0x2c30, 0x2c5e,
0x2c60, 0x2ce4,
0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d6f,
0x2d80, 0x2d96,
0x2da0, 0x2da6,
@@ -9853,7 +13176,7 @@ static const OnigCodePoint CR_ID_Start[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
@@ -9865,9 +13188,9 @@ static const OnigCodePoint CR_ID_Start[] = {
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa801,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa822,
@@ -9892,6 +13215,8 @@ static const OnigCodePoint CR_ID_Start[] = {
0xaac0, 0xaac0,
0xaac2, 0xaac2,
0xaadb, 0xaadd,
+ 0xaae0, 0xaaea,
+ 0xaaf2, 0xaaf4,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -9901,8 +13226,7 @@ static const OnigCodePoint CR_ID_Start[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -9952,6 +13276,8 @@ static const OnigCodePoint CR_ID_Start[] = {
0x1083f, 0x10855,
0x10900, 0x10915,
0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a00,
0x10a10, 0x10a13,
0x10a15, 0x10a17,
@@ -9963,10 +13289,18 @@ static const OnigCodePoint CR_ID_Start[] = {
0x10c00, 0x10c48,
0x11003, 0x11037,
0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
0x12000, 0x1236e,
0x12400, 0x12462,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f50,
+ 0x16f93, 0x16f9f,
0x1b000, 0x1b001,
0x1d400, 0x1d454,
0x1d456, 0x1d49c,
@@ -9998,6 +13332,39 @@ static const OnigCodePoint CR_ID_Start[] = {
0x1d78a, 0x1d7a8,
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -10006,7 +13373,7 @@ static const OnigCodePoint CR_ID_Start[] = {
/* 'ID_Continue': Derived Property */
static const OnigCodePoint CR_ID_Continue[] = {
- 514,
+ 564,
0x0030, 0x0039,
0x0041, 0x005a,
0x005f, 0x005f,
@@ -10055,6 +13422,9 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x07fa, 0x07fa,
0x0800, 0x082d,
0x0840, 0x085b,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
0x0900, 0x0963,
0x0966, 0x096f,
0x0971, 0x0977,
@@ -10202,7 +13572,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x0ec6, 0x0ec6,
0x0ec8, 0x0ecd,
0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f00,
0x0f18, 0x0f19,
0x0f20, 0x0f29,
@@ -10218,9 +13588,10 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1000, 0x1049,
0x1050, 0x109d,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
+ 0x10fc, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -10252,8 +13623,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1760, 0x176c,
0x176e, 0x1770,
0x1772, 0x1773,
- 0x1780, 0x17b3,
- 0x17b6, 0x17d3,
+ 0x1780, 0x17d3,
0x17d7, 0x17d7,
0x17dc, 0x17dd,
0x17e0, 0x17e9,
@@ -10279,14 +13649,12 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1b00, 0x1b4b,
0x1b50, 0x1b59,
0x1b6b, 0x1b73,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1bf3,
+ 0x1b80, 0x1bf3,
0x1c00, 0x1c37,
0x1c40, 0x1c49,
0x1c4d, 0x1c7d,
0x1cd0, 0x1cd2,
- 0x1cd4, 0x1cf2,
+ 0x1cd4, 0x1cf6,
0x1d00, 0x1de6,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
@@ -10331,9 +13699,11 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
0x2c60, 0x2ce4,
- 0x2ceb, 0x2cf1,
+ 0x2ceb, 0x2cf3,
0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d6f,
0x2d7f, 0x2d96,
0x2da0, 0x2da6,
@@ -10358,21 +13728,21 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
0xa610, 0xa62b,
0xa640, 0xa66f,
- 0xa67c, 0xa67d,
+ 0xa674, 0xa67d,
0xa67f, 0xa697,
- 0xa6a0, 0xa6f1,
+ 0xa69f, 0xa6f1,
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa827,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa827,
0xa840, 0xa873,
0xa880, 0xa8c4,
0xa8d0, 0xa8d9,
@@ -10390,6 +13760,8 @@ static const OnigCodePoint CR_ID_Continue[] = {
0xaa7a, 0xaa7b,
0xaa80, 0xaac2,
0xaadb, 0xaadd,
+ 0xaae0, 0xaaef,
+ 0xaaf2, 0xaaf6,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -10401,8 +13773,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -10459,6 +13830,8 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1083f, 0x10855,
0x10900, 0x10915,
0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a13,
@@ -10474,10 +13847,21 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x11000, 0x11046,
0x11066, 0x1106f,
0x11080, 0x110ba,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x1113f,
+ 0x11180, 0x111c4,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
0x12000, 0x1236e,
0x12400, 0x12462,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
0x1d165, 0x1d169,
0x1d16d, 0x1d172,
@@ -10516,6 +13900,39 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -10525,7 +13942,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
/* 'XID_Start': Derived Property */
static const OnigCodePoint CR_XID_Start[] = {
- 444,
+ 495,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -10573,6 +13990,8 @@ static const OnigCodePoint CR_XID_Start[] = {
0x0824, 0x0824,
0x0828, 0x0828,
0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
0x0904, 0x0939,
0x093d, 0x093d,
0x0950, 0x0950,
@@ -10678,7 +14097,7 @@ static const OnigCodePoint CR_XID_Start[] = {
0x0ebd, 0x0ebd,
0x0ec0, 0x0ec4,
0x0ec6, 0x0ec6,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f00,
0x0f40, 0x0f47,
0x0f49, 0x0f6c,
@@ -10693,9 +14112,10 @@ static const OnigCodePoint CR_XID_Start[] = {
0x1075, 0x1081,
0x108e, 0x108e,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
+ 0x10fc, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -10743,12 +14163,13 @@ static const OnigCodePoint CR_XID_Start[] = {
0x1b45, 0x1b4b,
0x1b83, 0x1ba0,
0x1bae, 0x1baf,
- 0x1bc0, 0x1be5,
+ 0x1bba, 0x1be5,
0x1c00, 0x1c23,
0x1c4d, 0x1c4f,
0x1c5a, 0x1c7d,
0x1ce9, 0x1cec,
0x1cee, 0x1cf1,
+ 0x1cf5, 0x1cf6,
0x1d00, 0x1dbf,
0x1e00, 0x1f15,
0x1f18, 0x1f1d,
@@ -10789,8 +14210,11 @@ static const OnigCodePoint CR_XID_Start[] = {
0x2c30, 0x2c5e,
0x2c60, 0x2ce4,
0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d6f,
0x2d80, 0x2d96,
0x2da0, 0x2da6,
@@ -10814,7 +14238,7 @@ static const OnigCodePoint CR_XID_Start[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
@@ -10826,9 +14250,9 @@ static const OnigCodePoint CR_XID_Start[] = {
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa801,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa822,
@@ -10853,6 +14277,8 @@ static const OnigCodePoint CR_XID_Start[] = {
0xaac0, 0xaac0,
0xaac2, 0xaac2,
0xaadb, 0xaadd,
+ 0xaae0, 0xaaea,
+ 0xaaf2, 0xaaf4,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -10862,8 +14288,7 @@ static const OnigCodePoint CR_XID_Start[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -10920,6 +14345,8 @@ static const OnigCodePoint CR_XID_Start[] = {
0x1083f, 0x10855,
0x10900, 0x10915,
0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a00,
0x10a10, 0x10a13,
0x10a15, 0x10a17,
@@ -10931,10 +14358,18 @@ static const OnigCodePoint CR_XID_Start[] = {
0x10c00, 0x10c48,
0x11003, 0x11037,
0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
0x12000, 0x1236e,
0x12400, 0x12462,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f50,
+ 0x16f93, 0x16f9f,
0x1b000, 0x1b001,
0x1d400, 0x1d454,
0x1d456, 0x1d49c,
@@ -10966,6 +14401,39 @@ static const OnigCodePoint CR_XID_Start[] = {
0x1d78a, 0x1d7a8,
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -10974,7 +14442,7 @@ static const OnigCodePoint CR_XID_Start[] = {
/* 'XID_Continue': Derived Property */
static const OnigCodePoint CR_XID_Continue[] = {
- 521,
+ 571,
0x0030, 0x0039,
0x0041, 0x005a,
0x005f, 0x005f,
@@ -11023,6 +14491,9 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x07fa, 0x07fa,
0x0800, 0x082d,
0x0840, 0x085b,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
0x0900, 0x0963,
0x0966, 0x096f,
0x0971, 0x0977,
@@ -11170,7 +14641,7 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x0ec6, 0x0ec6,
0x0ec8, 0x0ecd,
0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f00,
0x0f18, 0x0f19,
0x0f20, 0x0f29,
@@ -11186,9 +14657,10 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1000, 0x1049,
0x1050, 0x109d,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
+ 0x10fc, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -11220,8 +14692,7 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1760, 0x176c,
0x176e, 0x1770,
0x1772, 0x1773,
- 0x1780, 0x17b3,
- 0x17b6, 0x17d3,
+ 0x1780, 0x17d3,
0x17d7, 0x17d7,
0x17dc, 0x17dd,
0x17e0, 0x17e9,
@@ -11247,14 +14718,12 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1b00, 0x1b4b,
0x1b50, 0x1b59,
0x1b6b, 0x1b73,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1bf3,
+ 0x1b80, 0x1bf3,
0x1c00, 0x1c37,
0x1c40, 0x1c49,
0x1c4d, 0x1c7d,
0x1cd0, 0x1cd2,
- 0x1cd4, 0x1cf2,
+ 0x1cd4, 0x1cf6,
0x1d00, 0x1de6,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
@@ -11299,9 +14768,11 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
0x2c60, 0x2ce4,
- 0x2ceb, 0x2cf1,
+ 0x2ceb, 0x2cf3,
0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d6f,
0x2d7f, 0x2d96,
0x2da0, 0x2da6,
@@ -11327,21 +14798,21 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
0xa610, 0xa62b,
0xa640, 0xa66f,
- 0xa67c, 0xa67d,
+ 0xa674, 0xa67d,
0xa67f, 0xa697,
- 0xa6a0, 0xa6f1,
+ 0xa69f, 0xa6f1,
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa827,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa827,
0xa840, 0xa873,
0xa880, 0xa8c4,
0xa8d0, 0xa8d9,
@@ -11359,6 +14830,8 @@ static const OnigCodePoint CR_XID_Continue[] = {
0xaa7a, 0xaa7b,
0xaa80, 0xaac2,
0xaadb, 0xaadd,
+ 0xaae0, 0xaaef,
+ 0xaaf2, 0xaaf6,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -11370,8 +14843,7 @@ static const OnigCodePoint CR_XID_Continue[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -11434,6 +14906,8 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1083f, 0x10855,
0x10900, 0x10915,
0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a13,
@@ -11449,10 +14923,21 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x11000, 0x11046,
0x11066, 0x1106f,
0x11080, 0x110ba,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x1113f,
+ 0x11180, 0x111c4,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
0x12000, 0x1236e,
0x12400, 0x12462,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
0x1d165, 0x1d169,
0x1d16d, 0x1d172,
@@ -11491,6 +14976,39 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -11520,7 +15038,7 @@ static const OnigCodePoint CR_Default_Ignorable_Code_Point[] = {
/* 'Grapheme_Extend': Derived Property */
static const OnigCodePoint CR_Grapheme_Extend[] = {
- 215,
+ 232,
0x0300, 0x036f,
0x0483, 0x0489,
0x0591, 0x05bd,
@@ -11544,6 +15062,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x0825, 0x0827,
0x0829, 0x082d,
0x0859, 0x085b,
+ 0x08e4, 0x08fe,
0x0900, 0x0902,
0x093a, 0x093a,
0x093c, 0x093c,
@@ -11639,6 +15158,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x1732, 0x1734,
0x1752, 0x1753,
0x1772, 0x1773,
+ 0x17b4, 0x17b5,
0x17b7, 0x17bd,
0x17c6, 0x17c6,
0x17c9, 0x17d3,
@@ -11666,6 +15186,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x1b80, 0x1b81,
0x1ba2, 0x1ba5,
0x1ba8, 0x1ba9,
+ 0x1bab, 0x1bab,
0x1be6, 0x1be6,
0x1be8, 0x1be9,
0x1bed, 0x1bed,
@@ -11676,6 +15197,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x1cd4, 0x1ce0,
0x1ce2, 0x1ce8,
0x1ced, 0x1ced,
+ 0x1cf4, 0x1cf4,
0x1dc0, 0x1de6,
0x1dfc, 0x1dff,
0x200c, 0x200d,
@@ -11686,7 +15208,8 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x302a, 0x302f,
0x3099, 0x309a,
0xa66f, 0xa672,
- 0xa67c, 0xa67d,
+ 0xa674, 0xa67d,
+ 0xa69f, 0xa69f,
0xa6f0, 0xa6f1,
0xa802, 0xa802,
0xa806, 0xa806,
@@ -11710,6 +15233,8 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0xaab7, 0xaab8,
0xaabe, 0xaabf,
0xaac1, 0xaac1,
+ 0xaaec, 0xaaed,
+ 0xaaf6, 0xaaf6,
0xabe5, 0xabe5,
0xabe8, 0xabe8,
0xabed, 0xabed,
@@ -11728,6 +15253,16 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x11080, 0x11081,
0x110b3, 0x110b6,
0x110b9, 0x110ba,
+ 0x11100, 0x11102,
+ 0x11127, 0x1112b,
+ 0x1112d, 0x11134,
+ 0x11180, 0x11181,
+ 0x111b6, 0x111be,
+ 0x116ab, 0x116ab,
+ 0x116ad, 0x116ad,
+ 0x116b0, 0x116b5,
+ 0x116b7, 0x116b7,
+ 0x16f8f, 0x16f92,
0x1d165, 0x1d165,
0x1d167, 0x1d169,
0x1d16e, 0x1d172,
@@ -11740,7 +15275,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
/* 'Grapheme_Base': Derived Property */
static const OnigCodePoint CR_Grapheme_Base[] = {
- 596,
+ 643,
0x0020, 0x007e,
0x00a0, 0x00ac,
0x00ae, 0x02ff,
@@ -11755,6 +15290,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x0559, 0x055f,
0x0561, 0x0587,
0x0589, 0x058a,
+ 0x058f, 0x058f,
0x05be, 0x05be,
0x05c0, 0x05c0,
0x05c3, 0x05c3,
@@ -11783,6 +15319,8 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x0830, 0x083e,
0x0840, 0x0858,
0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
0x0903, 0x0939,
0x093b, 0x093b,
0x093d, 0x0940,
@@ -11831,8 +15369,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x0acb, 0x0acc,
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae1,
- 0x0ae6, 0x0aef,
- 0x0af1, 0x0af1,
+ 0x0ae6, 0x0af1,
0x0b02, 0x0b03,
0x0b05, 0x0b0c,
0x0b0f, 0x0b10,
@@ -11932,7 +15469,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x0ec0, 0x0ec4,
0x0ec6, 0x0ec6,
0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f17,
0x0f1a, 0x0f34,
0x0f36, 0x0f36,
@@ -11957,8 +15494,9 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1087, 0x108c,
0x108e, 0x109c,
0x109e, 0x10c5,
- 0x10d0, 0x10fc,
- 0x1100, 0x1248,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -12031,8 +15569,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1b82, 0x1ba1,
0x1ba6, 0x1ba7,
0x1baa, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1be5,
+ 0x1bac, 0x1be5,
0x1be7, 0x1be7,
0x1bea, 0x1bec,
0x1bee, 0x1bee,
@@ -12041,10 +15578,12 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1c34, 0x1c35,
0x1c3b, 0x1c49,
0x1c4d, 0x1c7f,
+ 0x1cc0, 0x1cc7,
0x1cd3, 0x1cd3,
0x1ce1, 0x1ce1,
0x1ce9, 0x1cec,
- 0x1cee, 0x1cf2,
+ 0x1cee, 0x1cf3,
+ 0x1cf5, 0x1cf6,
0x1d00, 0x1dbf,
0x1e00, 0x1f15,
0x1f18, 0x1f1d,
@@ -12074,15 +15613,16 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x2400, 0x2426,
0x2440, 0x244a,
0x2460, 0x26ff,
- 0x2701, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x2b4c,
+ 0x2701, 0x2b4c,
0x2b50, 0x2b59,
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
0x2c60, 0x2cee,
+ 0x2cf2, 0x2cf3,
0x2cf9, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d70,
0x2d80, 0x2d96,
0x2da0, 0x2da6,
@@ -12093,7 +15633,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x2dc8, 0x2dce,
0x2dd0, 0x2dd6,
0x2dd8, 0x2dde,
- 0x2e00, 0x2e31,
+ 0x2e00, 0x2e3b,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
0x2f00, 0x2fd5,
@@ -12109,7 +15649,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x31f0, 0x321e,
0x3220, 0x32fe,
0x3300, 0x4db5,
- 0x4dc0, 0x9fcb,
+ 0x4dc0, 0x9fcc,
0xa000, 0xa48c,
0xa490, 0xa4c6,
0xa4d0, 0xa62b,
@@ -12119,9 +15659,9 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0xa6a0, 0xa6ef,
0xa6f2, 0xa6f7,
0xa700, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa801,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa824,
@@ -12155,7 +15695,8 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0xaab9, 0xaabd,
0xaac0, 0xaac0,
0xaac2, 0xaac2,
- 0xaadb, 0xaadf,
+ 0xaadb, 0xaaeb,
+ 0xaaee, 0xaaf5,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -12168,8 +15709,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -12231,6 +15771,8 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x10900, 0x1091b,
0x1091f, 0x10939,
0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a00,
0x10a10, 0x10a13,
0x10a15, 0x10a17,
@@ -12252,11 +15794,27 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x110b7, 0x110b8,
0x110bb, 0x110bc,
0x110be, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11103, 0x11126,
+ 0x1112c, 0x1112c,
+ 0x11136, 0x11143,
+ 0x11182, 0x111b5,
+ 0x111bf, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116aa,
+ 0x116ac, 0x116ac,
+ 0x116ae, 0x116af,
+ 0x116b6, 0x116b6,
+ 0x116c0, 0x116c9,
0x12000, 0x1236e,
0x12400, 0x12462,
0x12470, 0x12473,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f93, 0x16f9f,
0x1b000, 0x1b001,
0x1d000, 0x1d0f5,
0x1d100, 0x1d126,
@@ -12291,6 +15849,40 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1d552, 0x1d6a5,
0x1d6a8, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
@@ -12299,7 +15891,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1f0d1, 0x1f0df,
0x1f100, 0x1f10a,
0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
+ 0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
0x1f1e6, 0x1f202,
0x1f210, 0x1f23a,
@@ -12317,19 +15909,9 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1f442, 0x1f4f7,
0x1f4f9, 0x1f4fc,
0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
+ 0x1f5fb, 0x1f640,
0x1f645, 0x1f64f,
0x1f680, 0x1f6c5,
0x1f700, 0x1f773,
@@ -12341,7 +15923,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
/* 'Grapheme_Link': Derived Property */
static const OnigCodePoint CR_Grapheme_Link[] = {
- 29,
+ 33,
0x094d, 0x094d,
0x09cd, 0x09cd,
0x0a4d, 0x0a4d,
@@ -12360,22 +15942,26 @@ static const OnigCodePoint CR_Grapheme_Link[] = {
0x17d2, 0x17d2,
0x1a60, 0x1a60,
0x1b44, 0x1b44,
- 0x1baa, 0x1baa,
+ 0x1baa, 0x1bab,
0x1bf2, 0x1bf3,
0x2d7f, 0x2d7f,
0xa806, 0xa806,
0xa8c4, 0xa8c4,
0xa953, 0xa953,
0xa9c0, 0xa9c0,
+ 0xaaf6, 0xaaf6,
0xabed, 0xabed,
0x10a3f, 0x10a3f,
0x11046, 0x11046,
0x110b9, 0x110b9,
+ 0x11133, 0x11134,
+ 0x111c0, 0x111c0,
+ 0x116b6, 0x116b6,
}; /* CR_Grapheme_Link */
/* 'Common': Script */
static const OnigCodePoint CR_Common[] = {
- 169,
+ 157,
0x0000, 0x0040,
0x005b, 0x0060,
0x007b, 0x00a9,
@@ -12398,7 +15984,6 @@ static const OnigCodePoint CR_Common[] = {
0x0660, 0x0669,
0x06dd, 0x06dd,
0x0964, 0x0965,
- 0x0970, 0x0970,
0x0e3f, 0x0e3f,
0x0fd5, 0x0fd8,
0x10fb, 0x10fb,
@@ -12409,7 +15994,8 @@ static const OnigCodePoint CR_Common[] = {
0x1cd3, 0x1cd3,
0x1ce1, 0x1ce1,
0x1ce9, 0x1cec,
- 0x1cee, 0x1cf2,
+ 0x1cee, 0x1cf3,
+ 0x1cf5, 0x1cf6,
0x2000, 0x200b,
0x200e, 0x2064,
0x206a, 0x2070,
@@ -12426,12 +16012,10 @@ static const OnigCodePoint CR_Common[] = {
0x2400, 0x2426,
0x2440, 0x244a,
0x2460, 0x26ff,
- 0x2701, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x27ff,
+ 0x2701, 0x27ff,
0x2900, 0x2b4c,
0x2b50, 0x2b59,
- 0x2e00, 0x2e31,
+ 0x2e00, 0x2e3b,
0x2ff0, 0x2ffb,
0x3000, 0x3004,
0x3006, 0x3006,
@@ -12508,7 +16092,7 @@ static const OnigCodePoint CR_Common[] = {
0x1f0d1, 0x1f0df,
0x1f100, 0x1f10a,
0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
+ 0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
0x1f1e6, 0x1f1ff,
0x1f201, 0x1f202,
@@ -12527,19 +16111,9 @@ static const OnigCodePoint CR_Common[] = {
0x1f442, 0x1f4f7,
0x1f4f9, 0x1f4fc,
0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
+ 0x1f5fb, 0x1f640,
0x1f645, 0x1f64f,
0x1f680, 0x1f6c5,
0x1f700, 0x1f773,
@@ -12574,9 +16148,9 @@ static const OnigCodePoint CR_Latin[] = {
0x2c60, 0x2c7f,
0xa722, 0xa787,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa7ff,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa7ff,
0xfb00, 0xfb06,
0xff21, 0xff3a,
0xff41, 0xff5a,
@@ -12628,17 +16202,18 @@ static const OnigCodePoint CR_Cyrillic[] = {
0x1d2b, 0x1d2b,
0x1d78, 0x1d78,
0x2de0, 0x2dff,
- 0xa640, 0xa673,
- 0xa67c, 0xa697,
+ 0xa640, 0xa697,
+ 0xa69f, 0xa69f,
}; /* CR_Cyrillic */
/* 'Armenian': Script */
static const OnigCodePoint CR_Armenian[] = {
- 5,
+ 6,
0x0531, 0x0556,
0x0559, 0x055f,
0x0561, 0x0587,
0x058a, 0x058a,
+ 0x058f, 0x058f,
0xfb13, 0xfb17,
}; /* CR_Armenian */
@@ -12658,8 +16233,8 @@ static const OnigCodePoint CR_Hebrew[] = {
/* 'Arabic': Script */
static const OnigCodePoint CR_Arabic[] = {
- 19,
- 0x0600, 0x0603,
+ 56,
+ 0x0600, 0x0604,
0x0606, 0x060b,
0x060d, 0x061a,
0x061e, 0x061e,
@@ -12670,6 +16245,9 @@ static const OnigCodePoint CR_Arabic[] = {
0x0671, 0x06dc,
0x06de, 0x06ff,
0x0750, 0x077f,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
0xfb50, 0xfbc1,
0xfbd3, 0xfd3d,
0xfd50, 0xfd8f,
@@ -12678,6 +16256,40 @@ static const OnigCodePoint CR_Arabic[] = {
0xfe70, 0xfe74,
0xfe76, 0xfefc,
0x10e60, 0x10e7e,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
}; /* CR_Arabic */
/* 'Syriac': Script */
@@ -12696,11 +16308,10 @@ static const OnigCodePoint CR_Thaana[] = {
/* 'Devanagari': Script */
static const OnigCodePoint CR_Devanagari[] = {
- 6,
+ 5,
0x0900, 0x0950,
0x0953, 0x0963,
- 0x0966, 0x096f,
- 0x0971, 0x0977,
+ 0x0966, 0x0977,
0x0979, 0x097f,
0xa8e0, 0xa8fb,
}; /* CR_Devanagari */
@@ -12747,7 +16358,7 @@ static const OnigCodePoint CR_Gurmukhi[] = {
/* 'Gujarati': Script */
static const OnigCodePoint CR_Gujarati[] = {
- 14,
+ 13,
0x0a81, 0x0a83,
0x0a85, 0x0a8d,
0x0a8f, 0x0a91,
@@ -12760,8 +16371,7 @@ static const OnigCodePoint CR_Gujarati[] = {
0x0acb, 0x0acd,
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0af1, 0x0af1,
+ 0x0ae6, 0x0af1,
}; /* CR_Gujarati */
/* 'Oriya': Script */
@@ -12901,7 +16511,7 @@ static const OnigCodePoint CR_Lao[] = {
0x0ec6, 0x0ec6,
0x0ec8, 0x0ecd,
0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
}; /* CR_Lao */
/* 'Tibetan': Script */
@@ -12925,11 +16535,15 @@ static const OnigCodePoint CR_Myanmar[] = {
/* 'Georgian': Script */
static const OnigCodePoint CR_Georgian[] = {
- 4,
+ 8,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
+ 0x10fc, 0x10ff,
0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
}; /* CR_Georgian */
/* 'Hangul': Script */
@@ -13066,7 +16680,7 @@ static const OnigCodePoint CR_Bopomofo[] = {
/* 'Han': Script */
static const OnigCodePoint CR_Han[] = {
- 16,
+ 15,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
0x2f00, 0x2fd5,
@@ -13075,9 +16689,8 @@ static const OnigCodePoint CR_Han[] = {
0x3021, 0x3029,
0x3038, 0x303b,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0x4e00, 0x9fcc,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
@@ -13113,7 +16726,7 @@ static const OnigCodePoint CR_Deseret[] = {
/* 'Inherited': Script */
static const OnigCodePoint CR_Inherited[] = {
- 24,
+ 25,
0x0300, 0x036f,
0x0485, 0x0486,
0x064b, 0x0655,
@@ -13124,6 +16737,7 @@ static const OnigCodePoint CR_Inherited[] = {
0x1cd4, 0x1ce0,
0x1ce2, 0x1ce8,
0x1ced, 0x1ced,
+ 0x1cf4, 0x1cf4,
0x1dc0, 0x1de6,
0x1dfc, 0x1dff,
0x200c, 0x200d,
@@ -13244,7 +16858,7 @@ static const OnigCodePoint CR_Buginese[] = {
static const OnigCodePoint CR_Coptic[] = {
3,
0x03e2, 0x03ef,
- 0x2c80, 0x2cf1,
+ 0x2c80, 0x2cf3,
0x2cf9, 0x2cff,
}; /* CR_Coptic */
@@ -13267,7 +16881,7 @@ static const OnigCodePoint CR_Glagolitic[] = {
/* 'Tifinagh': Script */
static const OnigCodePoint CR_Tifinagh[] = {
3,
- 0x2d30, 0x2d65,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d70,
0x2d7f, 0x2d7f,
}; /* CR_Tifinagh */
@@ -13335,8 +16949,8 @@ static const OnigCodePoint CR_Nko[] = {
/* 'Sundanese': Script */
static const OnigCodePoint CR_Sundanese[] = {
2,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
+ 0x1b80, 0x1bbf,
+ 0x1cc0, 0x1cc7,
}; /* CR_Sundanese */
/* 'Lepcha': Script */
@@ -13467,7 +17081,8 @@ static const OnigCodePoint CR_Javanese[] = {
/* 'Meetei_Mayek': Script */
static const OnigCodePoint CR_Meetei_Mayek[] = {
- 2,
+ 3,
+ 0xaae0, 0xaaf6,
0xabc0, 0xabed,
0xabf0, 0xabf9,
}; /* CR_Meetei_Mayek */
@@ -13532,21 +17147,57 @@ static const OnigCodePoint CR_Mandaic[] = {
0x085e, 0x085e,
}; /* CR_Mandaic */
+/* 'Chakma': Script */
+static const OnigCodePoint CR_Chakma[] = {
+ 2,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+}; /* CR_Chakma */
+
+/* 'Meroitic_Cursive': Script */
+static const OnigCodePoint CR_Meroitic_Cursive[] = {
+ 2,
+ 0x109a0, 0x109b7,
+ 0x109be, 0x109bf,
+}; /* CR_Meroitic_Cursive */
+
+/* 'Meroitic_Hieroglyphs': Script */
+static const OnigCodePoint CR_Meroitic_Hieroglyphs[] = {
+ 1,
+ 0x10980, 0x1099f,
+}; /* CR_Meroitic_Hieroglyphs */
+
+/* 'Miao': Script */
+static const OnigCodePoint CR_Miao[] = {
+ 3,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+}; /* CR_Miao */
+
+/* 'Sharada': Script */
+static const OnigCodePoint CR_Sharada[] = {
+ 2,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+}; /* CR_Sharada */
+
+/* 'Sora_Sompeng': Script */
+static const OnigCodePoint CR_Sora_Sompeng[] = {
+ 2,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+}; /* CR_Sora_Sompeng */
+
+/* 'Takri': Script */
+static const OnigCodePoint CR_Takri[] = {
+ 2,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+}; /* CR_Takri */
+
/* 'White_Space': Binary Property */
-static const OnigCodePoint CR_White_Space[] = {
- 11,
- 0x0009, 0x000d,
- 0x0020, 0x0020,
- 0x0085, 0x0085,
- 0x00a0, 0x00a0,
- 0x1680, 0x1680,
- 0x180e, 0x180e,
- 0x2000, 0x200a,
- 0x2028, 0x2029,
- 0x202f, 0x202f,
- 0x205f, 0x205f,
- 0x3000, 0x3000,
-}; /* CR_White_Space */
+#define CR_White_Space CR_Space
/* 'Bidi_Control': Binary Property */
static const OnigCodePoint CR_Bidi_Control[] = {
@@ -13563,7 +17214,7 @@ static const OnigCodePoint CR_Join_Control[] = {
/* 'Dash': Binary Property */
static const OnigCodePoint CR_Dash[] = {
- 19,
+ 20,
0x002d, 0x002d,
0x058a, 0x058a,
0x05be, 0x05be,
@@ -13576,6 +17227,7 @@ static const OnigCodePoint CR_Dash[] = {
0x2212, 0x2212,
0x2e17, 0x2e17,
0x2e1a, 0x2e1a,
+ 0x2e3a, 0x2e3b,
0x301c, 0x301c,
0x3030, 0x3030,
0x30a0, 0x30a0,
@@ -13619,7 +17271,7 @@ static const OnigCodePoint CR_Quotation_Mark[] = {
/* 'Terminal_Punctuation': Binary Property */
static const OnigCodePoint CR_Terminal_Punctuation[] = {
- 67,
+ 70,
0x0021, 0x0021,
0x002c, 0x002c,
0x002e, 0x002e,
@@ -13669,6 +17321,7 @@ static const OnigCodePoint CR_Terminal_Punctuation[] = {
0xa9c7, 0xa9c9,
0xaa5d, 0xaa5f,
0xaadf, 0xaadf,
+ 0xaaf0, 0xaaf1,
0xabeb, 0xabeb,
0xfe50, 0xfe52,
0xfe54, 0xfe57,
@@ -13686,12 +17339,14 @@ static const OnigCodePoint CR_Terminal_Punctuation[] = {
0x10b3a, 0x10b3f,
0x11047, 0x1104d,
0x110be, 0x110c1,
+ 0x11141, 0x11143,
+ 0x111c5, 0x111c6,
0x12470, 0x12473,
}; /* CR_Terminal_Punctuation */
/* 'Other_Math': Binary Property */
static const OnigCodePoint CR_Other_Math[] = {
- 100,
+ 133,
0x005e, 0x005e,
0x03d0, 0x03d2,
0x03d5, 0x03d5,
@@ -13792,6 +17447,39 @@ static const OnigCodePoint CR_Other_Math[] = {
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
}; /* CR_Other_Math */
/* 'Hex_Digit': Binary Property */
@@ -13806,16 +17494,11 @@ static const OnigCodePoint CR_Hex_Digit[] = {
}; /* CR_Hex_Digit */
/* 'ASCII_Hex_Digit': Binary Property */
-static const OnigCodePoint CR_ASCII_Hex_Digit[] = {
- 3,
- 0x0030, 0x0039,
- 0x0041, 0x0046,
- 0x0061, 0x0066,
-}; /* CR_ASCII_Hex_Digit */
+#define CR_ASCII_Hex_Digit CR_XDigit
/* 'Other_Alphabetic': Binary Property */
static const OnigCodePoint CR_Other_Alphabetic[] = {
- 145,
+ 158,
0x0345, 0x0345,
0x05b0, 0x05bd,
0x05bf, 0x05bf,
@@ -13837,6 +17520,8 @@ static const OnigCodePoint CR_Other_Alphabetic[] = {
0x081b, 0x0823,
0x0825, 0x0827,
0x0829, 0x082c,
+ 0x08e4, 0x08e9,
+ 0x08f0, 0x08fe,
0x0900, 0x0903,
0x093a, 0x093b,
0x093e, 0x094c,
@@ -13933,11 +17618,14 @@ static const OnigCodePoint CR_Other_Alphabetic[] = {
0x1b35, 0x1b43,
0x1b80, 0x1b82,
0x1ba1, 0x1ba9,
+ 0x1bac, 0x1bad,
0x1be7, 0x1bf1,
0x1c24, 0x1c35,
- 0x1cf2, 0x1cf2,
+ 0x1cf2, 0x1cf3,
0x24b6, 0x24e9,
0x2de0, 0x2dff,
+ 0xa674, 0xa67b,
+ 0xa69f, 0xa69f,
0xa823, 0xa827,
0xa880, 0xa881,
0xa8b4, 0xa8c3,
@@ -13952,6 +17640,8 @@ static const OnigCodePoint CR_Other_Alphabetic[] = {
0xaab2, 0xaab4,
0xaab7, 0xaab8,
0xaabe, 0xaabe,
+ 0xaaeb, 0xaaef,
+ 0xaaf5, 0xaaf5,
0xabe3, 0xabea,
0xfb1e, 0xfb1e,
0x10a01, 0x10a03,
@@ -13961,18 +17651,23 @@ static const OnigCodePoint CR_Other_Alphabetic[] = {
0x11038, 0x11045,
0x11082, 0x11082,
0x110b0, 0x110b8,
+ 0x11100, 0x11102,
+ 0x11127, 0x11132,
+ 0x11180, 0x11182,
+ 0x111b3, 0x111bf,
+ 0x116ab, 0x116b5,
+ 0x16f51, 0x16f7e,
}; /* CR_Other_Alphabetic */
/* 'Ideographic': Binary Property */
static const OnigCodePoint CR_Ideographic[] = {
- 12,
+ 11,
0x3006, 0x3007,
0x3021, 0x3029,
0x3038, 0x303a,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0x4e00, 0x9fcc,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
@@ -13982,7 +17677,7 @@ static const OnigCodePoint CR_Ideographic[] = {
/* 'Diacritic': Binary Property */
static const OnigCodePoint CR_Diacritic[] = {
- 117,
+ 125,
0x005e, 0x005e,
0x0060, 0x0060,
0x00a8, 0x00a8,
@@ -14011,6 +17706,7 @@ static const OnigCodePoint CR_Diacritic[] = {
0x07a6, 0x07b0,
0x07eb, 0x07f5,
0x0818, 0x0819,
+ 0x08e4, 0x08fe,
0x093c, 0x093c,
0x094d, 0x094d,
0x0951, 0x0954,
@@ -14053,11 +17749,12 @@ static const OnigCodePoint CR_Diacritic[] = {
0x1b34, 0x1b34,
0x1b44, 0x1b44,
0x1b6b, 0x1b73,
- 0x1baa, 0x1baa,
+ 0x1baa, 0x1bab,
0x1c36, 0x1c37,
0x1c78, 0x1c7d,
0x1cd0, 0x1ce8,
0x1ced, 0x1ced,
+ 0x1cf4, 0x1cf4,
0x1d2c, 0x1d6a,
0x1dc4, 0x1dcf,
0x1dfd, 0x1dff,
@@ -14078,6 +17775,7 @@ static const OnigCodePoint CR_Diacritic[] = {
0xa6f0, 0xa6f1,
0xa717, 0xa721,
0xa788, 0xa788,
+ 0xa7f8, 0xa7f9,
0xa8c4, 0xa8c4,
0xa8e0, 0xa8f1,
0xa92b, 0xa92e,
@@ -14086,6 +17784,7 @@ static const OnigCodePoint CR_Diacritic[] = {
0xa9c0, 0xa9c0,
0xaa7b, 0xaa7b,
0xaabf, 0xaac2,
+ 0xaaf6, 0xaaf6,
0xabec, 0xabed,
0xfb1e, 0xfb1e,
0xfe20, 0xfe26,
@@ -14095,6 +17794,10 @@ static const OnigCodePoint CR_Diacritic[] = {
0xff9e, 0xff9f,
0xffe3, 0xffe3,
0x110b9, 0x110ba,
+ 0x11133, 0x11134,
+ 0x111c0, 0x111c0,
+ 0x116b6, 0x116b7,
+ 0x16f8f, 0x16f9f,
0x1d167, 0x1d169,
0x1d16d, 0x1d172,
0x1d17b, 0x1d182,
@@ -14104,13 +17807,14 @@ static const OnigCodePoint CR_Diacritic[] = {
/* 'Extender': Binary Property */
static const OnigCodePoint CR_Extender[] = {
- 20,
+ 22,
0x00b7, 0x00b7,
0x02d0, 0x02d1,
0x0640, 0x0640,
0x07fa, 0x07fa,
0x0e46, 0x0e46,
0x0ec6, 0x0ec6,
+ 0x180a, 0x180a,
0x1843, 0x1843,
0x1aa7, 0x1aa7,
0x1c36, 0x1c36,
@@ -14124,25 +17828,31 @@ static const OnigCodePoint CR_Extender[] = {
0xa9cf, 0xa9cf,
0xaa70, 0xaa70,
0xaadd, 0xaadd,
+ 0xaaf3, 0xaaf4,
0xff70, 0xff70,
}; /* CR_Extender */
/* 'Other_Lowercase': Binary Property */
static const OnigCodePoint CR_Other_Lowercase[] = {
- 13,
+ 18,
+ 0x00aa, 0x00aa,
+ 0x00ba, 0x00ba,
0x02b0, 0x02b8,
0x02c0, 0x02c1,
0x02e0, 0x02e4,
0x0345, 0x0345,
0x037a, 0x037a,
- 0x1d2c, 0x1d61,
+ 0x1d2c, 0x1d6a,
0x1d78, 0x1d78,
0x1d9b, 0x1dbf,
- 0x2090, 0x2094,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
0x2170, 0x217f,
0x24d0, 0x24e9,
- 0x2c7d, 0x2c7d,
+ 0x2c7c, 0x2c7d,
0xa770, 0xa770,
+ 0xa7f8, 0xa7f9,
}; /* CR_Other_Lowercase */
/* 'Other_Uppercase': Binary Property */
@@ -14177,7 +17887,7 @@ static const OnigCodePoint CR_Noncharacter_Code_Point[] = {
/* 'Other_Grapheme_Extend': Binary Property */
static const OnigCodePoint CR_Other_Grapheme_Extend[] = {
- 16,
+ 17,
0x09be, 0x09be,
0x09d7, 0x09d7,
0x0b3e, 0x0b3e,
@@ -14191,6 +17901,7 @@ static const OnigCodePoint CR_Other_Grapheme_Extend[] = {
0x0dcf, 0x0dcf,
0x0ddf, 0x0ddf,
0x200c, 0x200d,
+ 0x302e, 0x302f,
0xff9e, 0xff9f,
0x1d165, 0x1d165,
0x1d16e, 0x1d172,
@@ -14221,7 +17932,7 @@ static const OnigCodePoint CR_Radical[] = {
static const OnigCodePoint CR_Unified_Ideograph[] = {
12,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xfa0e, 0xfa0f,
0xfa11, 0xfa11,
0xfa13, 0xfa14,
@@ -14236,9 +17947,10 @@ static const OnigCodePoint CR_Unified_Ideograph[] = {
/* 'Other_Default_Ignorable_Code_Point': Binary Property */
static const OnigCodePoint CR_Other_Default_Ignorable_Code_Point[] = {
- 10,
+ 11,
0x034f, 0x034f,
0x115f, 0x1160,
+ 0x17b4, 0x17b5,
0x2065, 0x2069,
0x3164, 0x3164,
0xffa0, 0xffa0,
@@ -14328,7 +18040,7 @@ static const OnigCodePoint CR_Other_ID_Continue[] = {
/* 'STerm': Binary Property */
static const OnigCodePoint CR_STerm[] = {
- 47,
+ 50,
0x0021, 0x0021,
0x002e, 0x002e,
0x003f, 0x003f,
@@ -14366,6 +18078,7 @@ static const OnigCodePoint CR_STerm[] = {
0xa92f, 0xa92f,
0xa9c8, 0xa9c9,
0xaa5d, 0xaa5f,
+ 0xaaf0, 0xaaf1,
0xabeb, 0xabeb,
0xfe52, 0xfe52,
0xfe56, 0xfe57,
@@ -14376,6 +18089,8 @@ static const OnigCodePoint CR_STerm[] = {
0x10a56, 0x10a57,
0x11047, 0x11048,
0x110be, 0x110c1,
+ 0x11141, 0x11143,
+ 0x111c5, 0x111c6,
}; /* CR_STerm */
/* 'Variation_Selector': Binary Property */
@@ -14431,7 +18146,7 @@ static const OnigCodePoint CR_Pattern_Syntax[] = {
/* 'Unknown': Script */
static const OnigCodePoint CR_Unknown[] = {
- 499,
+ 537,
0x0378, 0x0379,
0x037f, 0x0383,
0x038b, 0x038b,
@@ -14441,11 +18156,12 @@ static const OnigCodePoint CR_Unknown[] = {
0x0557, 0x0558,
0x0560, 0x0560,
0x0588, 0x0588,
- 0x058b, 0x0590,
+ 0x058b, 0x058e,
+ 0x0590, 0x0590,
0x05c8, 0x05cf,
0x05eb, 0x05ef,
0x05f5, 0x05ff,
- 0x0604, 0x0605,
+ 0x0605, 0x0605,
0x061c, 0x061d,
0x070e, 0x070e,
0x074b, 0x074c,
@@ -14454,7 +18170,10 @@ static const OnigCodePoint CR_Unknown[] = {
0x082e, 0x082f,
0x083f, 0x083f,
0x085c, 0x085d,
- 0x085f, 0x08ff,
+ 0x085f, 0x089f,
+ 0x08a1, 0x08a1,
+ 0x08ad, 0x08e3,
+ 0x08ff, 0x08ff,
0x0978, 0x0978,
0x0980, 0x0980,
0x0984, 0x0984,
@@ -14499,7 +18218,6 @@ static const OnigCodePoint CR_Unknown[] = {
0x0ace, 0x0acf,
0x0ad1, 0x0adf,
0x0ae4, 0x0ae5,
- 0x0af0, 0x0af0,
0x0af2, 0x0b00,
0x0b04, 0x0b04,
0x0b0d, 0x0b0e,
@@ -14600,15 +18318,16 @@ static const OnigCodePoint CR_Unknown[] = {
0x0ec7, 0x0ec7,
0x0ece, 0x0ecf,
0x0eda, 0x0edb,
- 0x0ede, 0x0eff,
+ 0x0ee0, 0x0eff,
0x0f48, 0x0f48,
0x0f6d, 0x0f70,
0x0f98, 0x0f98,
0x0fbd, 0x0fbd,
0x0fcd, 0x0fcd,
0x0fdb, 0x0fff,
- 0x10c6, 0x10cf,
- 0x10fd, 0x10ff,
+ 0x10c6, 0x10c6,
+ 0x10c8, 0x10cc,
+ 0x10ce, 0x10cf,
0x1249, 0x1249,
0x124e, 0x124f,
0x1257, 0x1257,
@@ -14662,13 +18381,12 @@ static const OnigCodePoint CR_Unknown[] = {
0x1aae, 0x1aff,
0x1b4c, 0x1b4f,
0x1b7d, 0x1b7f,
- 0x1bab, 0x1bad,
- 0x1bba, 0x1bbf,
0x1bf4, 0x1bfb,
0x1c38, 0x1c3a,
0x1c4a, 0x1c4c,
- 0x1c80, 0x1ccf,
- 0x1cf3, 0x1cff,
+ 0x1c80, 0x1cbf,
+ 0x1cc8, 0x1ccf,
+ 0x1cf7, 0x1cff,
0x1de7, 0x1dfb,
0x1f16, 0x1f17,
0x1f1e, 0x1f1f,
@@ -14697,15 +18415,15 @@ static const OnigCodePoint CR_Unknown[] = {
0x2427, 0x243f,
0x244b, 0x245f,
0x2700, 0x2700,
- 0x27cb, 0x27cb,
- 0x27cd, 0x27cd,
0x2b4d, 0x2b4f,
0x2b5a, 0x2bff,
0x2c2f, 0x2c2f,
0x2c5f, 0x2c5f,
- 0x2cf2, 0x2cf8,
- 0x2d26, 0x2d2f,
- 0x2d66, 0x2d6e,
+ 0x2cf4, 0x2cf8,
+ 0x2d26, 0x2d26,
+ 0x2d28, 0x2d2c,
+ 0x2d2e, 0x2d2f,
+ 0x2d68, 0x2d6e,
0x2d71, 0x2d7e,
0x2d97, 0x2d9f,
0x2da7, 0x2da7,
@@ -14716,7 +18434,7 @@ static const OnigCodePoint CR_Unknown[] = {
0x2dcf, 0x2dcf,
0x2dd7, 0x2dd7,
0x2ddf, 0x2ddf,
- 0x2e32, 0x2e7f,
+ 0x2e3c, 0x2e7f,
0x2e9a, 0x2e9a,
0x2ef4, 0x2eff,
0x2fd6, 0x2fef,
@@ -14731,16 +18449,15 @@ static const OnigCodePoint CR_Unknown[] = {
0x321f, 0x321f,
0x32ff, 0x32ff,
0x4db6, 0x4dbf,
- 0x9fcc, 0x9fff,
+ 0x9fcd, 0x9fff,
0xa48d, 0xa48f,
0xa4c7, 0xa4cf,
0xa62c, 0xa63f,
- 0xa674, 0xa67b,
- 0xa698, 0xa69f,
+ 0xa698, 0xa69e,
0xa6f8, 0xa6ff,
0xa78f, 0xa78f,
- 0xa792, 0xa79f,
- 0xa7aa, 0xa7f9,
+ 0xa794, 0xa79f,
+ 0xa7ab, 0xa7f7,
0xa82c, 0xa82f,
0xa83a, 0xa83f,
0xa878, 0xa87f,
@@ -14757,7 +18474,7 @@ static const OnigCodePoint CR_Unknown[] = {
0xaa5a, 0xaa5b,
0xaa7c, 0xaa7f,
0xaac3, 0xaada,
- 0xaae0, 0xab00,
+ 0xaaf7, 0xab00,
0xab07, 0xab08,
0xab0f, 0xab10,
0xab17, 0xab1f,
@@ -14768,7 +18485,6 @@ static const OnigCodePoint CR_Unknown[] = {
0xd7a4, 0xd7af,
0xd7c7, 0xd7ca,
0xd7fc, 0xf8ff,
- 0xfa2e, 0xfa2f,
0xfa6e, 0xfa6f,
0xfada, 0xfaff,
0xfb07, 0xfb12,
@@ -14830,7 +18546,9 @@ static const OnigCodePoint CR_Unknown[] = {
0x10860, 0x108ff,
0x1091c, 0x1091e,
0x1093a, 0x1093e,
- 0x10940, 0x109ff,
+ 0x10940, 0x1097f,
+ 0x109b8, 0x109bd,
+ 0x109c0, 0x109ff,
0x10a04, 0x10a04,
0x10a07, 0x10a0b,
0x10a14, 0x10a14,
@@ -14848,12 +18566,23 @@ static const OnigCodePoint CR_Unknown[] = {
0x10e7f, 0x10fff,
0x1104e, 0x11051,
0x11070, 0x1107f,
- 0x110c2, 0x11fff,
+ 0x110c2, 0x110cf,
+ 0x110e9, 0x110ef,
+ 0x110fa, 0x110ff,
+ 0x11135, 0x11135,
+ 0x11144, 0x1117f,
+ 0x111c9, 0x111cf,
+ 0x111da, 0x1167f,
+ 0x116b8, 0x116bf,
+ 0x116ca, 0x11fff,
0x1236f, 0x123ff,
0x12463, 0x1246f,
0x12474, 0x12fff,
0x1342f, 0x167ff,
- 0x16a39, 0x1afff,
+ 0x16a39, 0x16eff,
+ 0x16f45, 0x16f4f,
+ 0x16f7f, 0x16f8e,
+ 0x16fa0, 0x1afff,
0x1b002, 0x1cfff,
0x1d0f6, 0x1d0ff,
0x1d127, 0x1d128,
@@ -14881,7 +18610,41 @@ static const OnigCodePoint CR_Unknown[] = {
0x1d551, 0x1d551,
0x1d6a6, 0x1d6a7,
0x1d7cc, 0x1d7cd,
- 0x1d800, 0x1efff,
+ 0x1d800, 0x1edff,
+ 0x1ee04, 0x1ee04,
+ 0x1ee20, 0x1ee20,
+ 0x1ee23, 0x1ee23,
+ 0x1ee25, 0x1ee26,
+ 0x1ee28, 0x1ee28,
+ 0x1ee33, 0x1ee33,
+ 0x1ee38, 0x1ee38,
+ 0x1ee3a, 0x1ee3a,
+ 0x1ee3c, 0x1ee41,
+ 0x1ee43, 0x1ee46,
+ 0x1ee48, 0x1ee48,
+ 0x1ee4a, 0x1ee4a,
+ 0x1ee4c, 0x1ee4c,
+ 0x1ee50, 0x1ee50,
+ 0x1ee53, 0x1ee53,
+ 0x1ee55, 0x1ee56,
+ 0x1ee58, 0x1ee58,
+ 0x1ee5a, 0x1ee5a,
+ 0x1ee5c, 0x1ee5c,
+ 0x1ee5e, 0x1ee5e,
+ 0x1ee60, 0x1ee60,
+ 0x1ee63, 0x1ee63,
+ 0x1ee65, 0x1ee66,
+ 0x1ee6b, 0x1ee6b,
+ 0x1ee73, 0x1ee73,
+ 0x1ee78, 0x1ee78,
+ 0x1ee7d, 0x1ee7d,
+ 0x1ee7f, 0x1ee7f,
+ 0x1ee8a, 0x1ee8a,
+ 0x1ee9c, 0x1eea0,
+ 0x1eea4, 0x1eea4,
+ 0x1eeaa, 0x1eeaa,
+ 0x1eebc, 0x1eeef,
+ 0x1eef2, 0x1efff,
0x1f02c, 0x1f02f,
0x1f094, 0x1f09f,
0x1f0af, 0x1f0b0,
@@ -14890,7 +18653,7 @@ static const OnigCodePoint CR_Unknown[] = {
0x1f0e0, 0x1f0ff,
0x1f10b, 0x1f10f,
0x1f12f, 0x1f12f,
- 0x1f16a, 0x1f16f,
+ 0x1f16c, 0x1f16f,
0x1f19b, 0x1f1e5,
0x1f203, 0x1f20f,
0x1f23b, 0x1f23f,
@@ -14907,19 +18670,9 @@ static const OnigCodePoint CR_Unknown[] = {
0x1f441, 0x1f441,
0x1f4f8, 0x1f4f8,
0x1f4fd, 0x1f4ff,
- 0x1f53e, 0x1f54f,
+ 0x1f53e, 0x1f53f,
+ 0x1f544, 0x1f54f,
0x1f568, 0x1f5fa,
- 0x1f600, 0x1f600,
- 0x1f611, 0x1f611,
- 0x1f615, 0x1f615,
- 0x1f617, 0x1f617,
- 0x1f619, 0x1f619,
- 0x1f61b, 0x1f61b,
- 0x1f61f, 0x1f61f,
- 0x1f626, 0x1f627,
- 0x1f62c, 0x1f62c,
- 0x1f62e, 0x1f62f,
- 0x1f634, 0x1f634,
0x1f641, 0x1f644,
0x1f650, 0x1f67f,
0x1f6c6, 0x1f6ff,
@@ -14932,7 +18685,6 @@ static const OnigCodePoint CR_Unknown[] = {
0xe0080, 0xe00ff,
0xe01f0, 0x10ffff,
}; /* CR_Unknown */
-#endif /* USE_UNICODE_PROPERTIES */
/* 'Age_1_1': Derived Age 1.1 */
static const OnigCodePoint CR_Age_1_1[] = {
@@ -19817,554 +23569,10 @@ static const OnigCodePoint CR_Age_6_0[] = {
0xefffe, 0x10ffff,
}; /* CR_Age_6_0 */
-/* 'NEWLINE': [[:NEWLINE:]] */
-static const OnigCodePoint CR_NEWLINE[] = {
- 1,
- 0x000a, 0x000a,
-}; /* CR_NEWLINE */
-
-/* 'Alpha': [[:Alpha:]] */
-#define CR_Alpha CR_Alphabetic
-
-/* 'Blank': [[:Blank:]] */
-static const OnigCodePoint CR_Blank[] = {
- 9,
- 0x0009, 0x0009,
- 0x0020, 0x0020,
- 0x00a0, 0x00a0,
- 0x1680, 0x1680,
- 0x180e, 0x180e,
- 0x2000, 0x200a,
- 0x202f, 0x202f,
- 0x205f, 0x205f,
- 0x3000, 0x3000,
-}; /* CR_Blank */
-
-/* 'Cntrl': [[:Cntrl:]] */
-#define CR_Cntrl CR_Cc
-
-/* 'Digit': [[:Digit:]] */
-#define CR_Digit CR_Nd
-
-/* 'Graph': [[:Graph:]] */
-static const OnigCodePoint CR_Graph[] = {
- 506,
- 0x0021, 0x007e,
- 0x00a1, 0x0377,
- 0x037a, 0x037e,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x0527,
- 0x0531, 0x0556,
- 0x0559, 0x055f,
- 0x0561, 0x0587,
- 0x0589, 0x058a,
- 0x0591, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f4,
- 0x0600, 0x0603,
- 0x0606, 0x061b,
- 0x061e, 0x070d,
- 0x070f, 0x074a,
- 0x074d, 0x07b1,
- 0x07c0, 0x07fa,
- 0x0800, 0x082d,
- 0x0830, 0x083e,
- 0x0840, 0x085b,
- 0x085e, 0x085e,
- 0x0900, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bc, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09ce,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09e6, 0x09fb,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3c, 0x0a3c,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a51, 0x0a51,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a75,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abc, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acd,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0af1, 0x0af1,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3c, 0x0b44,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4d,
- 0x0b56, 0x0b57,
- 0x0b5c, 0x0b5d,
- 0x0b5f, 0x0b63,
- 0x0b66, 0x0b77,
- 0x0b82, 0x0b83,
- 0x0b85, 0x0b8a,
- 0x0b8e, 0x0b90,
- 0x0b92, 0x0b95,
- 0x0b99, 0x0b9a,
- 0x0b9c, 0x0b9c,
- 0x0b9e, 0x0b9f,
- 0x0ba3, 0x0ba4,
- 0x0ba8, 0x0baa,
- 0x0bae, 0x0bb9,
- 0x0bbe, 0x0bc2,
- 0x0bc6, 0x0bc8,
- 0x0bca, 0x0bcd,
- 0x0bd0, 0x0bd0,
- 0x0bd7, 0x0bd7,
- 0x0be6, 0x0bfa,
- 0x0c01, 0x0c03,
- 0x0c05, 0x0c0c,
- 0x0c0e, 0x0c10,
- 0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
- 0x0c3d, 0x0c44,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4d,
- 0x0c55, 0x0c56,
- 0x0c58, 0x0c59,
- 0x0c60, 0x0c63,
- 0x0c66, 0x0c6f,
- 0x0c78, 0x0c7f,
- 0x0c82, 0x0c83,
- 0x0c85, 0x0c8c,
- 0x0c8e, 0x0c90,
- 0x0c92, 0x0ca8,
- 0x0caa, 0x0cb3,
- 0x0cb5, 0x0cb9,
- 0x0cbc, 0x0cc4,
- 0x0cc6, 0x0cc8,
- 0x0cca, 0x0ccd,
- 0x0cd5, 0x0cd6,
- 0x0cde, 0x0cde,
- 0x0ce0, 0x0ce3,
- 0x0ce6, 0x0cef,
- 0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d3a,
- 0x0d3d, 0x0d44,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4e,
- 0x0d57, 0x0d57,
- 0x0d60, 0x0d63,
- 0x0d66, 0x0d75,
- 0x0d79, 0x0d7f,
- 0x0d82, 0x0d83,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0dca, 0x0dca,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df4,
- 0x0e01, 0x0e3a,
- 0x0e3f, 0x0e5b,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ec8, 0x0ecd,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f71, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fbe, 0x0fcc,
- 0x0fce, 0x0fda,
- 0x1000, 0x10c5,
- 0x10d0, 0x10fc,
- 0x1100, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135d, 0x137c,
- 0x1380, 0x1399,
- 0x13a0, 0x13f4,
- 0x1400, 0x167f,
- 0x1681, 0x169c,
- 0x16a0, 0x16f0,
- 0x1700, 0x170c,
- 0x170e, 0x1714,
- 0x1720, 0x1736,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17dd,
- 0x17e0, 0x17e9,
- 0x17f0, 0x17f9,
- 0x1800, 0x180d,
- 0x1810, 0x1819,
- 0x1820, 0x1877,
- 0x1880, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191c,
- 0x1920, 0x192b,
- 0x1930, 0x193b,
- 0x1940, 0x1940,
- 0x1944, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x19d0, 0x19da,
- 0x19de, 0x1a1b,
- 0x1a1e, 0x1a5e,
- 0x1a60, 0x1a7c,
- 0x1a7f, 0x1a89,
- 0x1a90, 0x1a99,
- 0x1aa0, 0x1aad,
- 0x1b00, 0x1b4b,
- 0x1b50, 0x1b7c,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1bf3,
- 0x1bfc, 0x1c37,
- 0x1c3b, 0x1c49,
- 0x1c4d, 0x1c7f,
- 0x1cd0, 0x1cf2,
- 0x1d00, 0x1de6,
- 0x1dfc, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fc4,
- 0x1fc6, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fdd, 0x1fef,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffe,
- 0x200b, 0x2027,
- 0x202a, 0x202e,
- 0x2030, 0x205e,
- 0x2060, 0x2064,
- 0x206a, 0x2071,
- 0x2074, 0x208e,
- 0x2090, 0x209c,
- 0x20a0, 0x20b9,
- 0x20d0, 0x20f0,
- 0x2100, 0x2189,
- 0x2190, 0x23f3,
- 0x2400, 0x2426,
- 0x2440, 0x244a,
- 0x2460, 0x26ff,
- 0x2701, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x2b4c,
- 0x2b50, 0x2b59,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2cf1,
- 0x2cf9, 0x2d25,
- 0x2d30, 0x2d65,
- 0x2d6f, 0x2d70,
- 0x2d7f, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2de0, 0x2e31,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3001, 0x303f,
- 0x3041, 0x3096,
- 0x3099, 0x30ff,
- 0x3105, 0x312d,
- 0x3131, 0x318e,
- 0x3190, 0x31ba,
- 0x31c0, 0x31e3,
- 0x31f0, 0x321e,
- 0x3220, 0x32fe,
- 0x3300, 0x4db5,
- 0x4dc0, 0x9fcb,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa4d0, 0xa62b,
- 0xa640, 0xa673,
- 0xa67c, 0xa697,
- 0xa6a0, 0xa6f7,
- 0xa700, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa82b,
- 0xa830, 0xa839,
- 0xa840, 0xa877,
- 0xa880, 0xa8c4,
- 0xa8ce, 0xa8d9,
- 0xa8e0, 0xa8fb,
- 0xa900, 0xa953,
- 0xa95f, 0xa97c,
- 0xa980, 0xa9cd,
- 0xa9cf, 0xa9d9,
- 0xa9de, 0xa9df,
- 0xaa00, 0xaa36,
- 0xaa40, 0xaa4d,
- 0xaa50, 0xaa59,
- 0xaa5c, 0xaa7b,
- 0xaa80, 0xaac2,
- 0xaadb, 0xaadf,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xabc0, 0xabed,
- 0xabf0, 0xabf9,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xe000, 0xfa2d,
- 0xfa30, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbc1,
- 0xfbd3, 0xfd3f,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfd,
- 0xfe00, 0xfe19,
- 0xfe20, 0xfe26,
- 0xfe30, 0xfe52,
- 0xfe54, 0xfe66,
- 0xfe68, 0xfe6b,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xfeff, 0xfeff,
- 0xff01, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0xffe0, 0xffe6,
- 0xffe8, 0xffee,
- 0xfff9, 0xfffd,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10100, 0x10102,
- 0x10107, 0x10133,
- 0x10137, 0x1018a,
- 0x10190, 0x1019b,
- 0x101d0, 0x101fd,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x10300, 0x1031e,
- 0x10320, 0x10323,
- 0x10330, 0x1034a,
- 0x10380, 0x1039d,
- 0x1039f, 0x103c3,
- 0x103c8, 0x103d5,
- 0x10400, 0x1049d,
- 0x104a0, 0x104a9,
- 0x10800, 0x10805,
- 0x10808, 0x10808,
- 0x1080a, 0x10835,
- 0x10837, 0x10838,
- 0x1083c, 0x1083c,
- 0x1083f, 0x10855,
- 0x10857, 0x1085f,
- 0x10900, 0x1091b,
- 0x1091f, 0x10939,
- 0x1093f, 0x1093f,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a47,
- 0x10a50, 0x10a58,
- 0x10a60, 0x10a7f,
- 0x10b00, 0x10b35,
- 0x10b39, 0x10b55,
- 0x10b58, 0x10b72,
- 0x10b78, 0x10b7f,
- 0x10c00, 0x10c48,
- 0x10e60, 0x10e7e,
- 0x11000, 0x1104d,
- 0x11052, 0x1106f,
- 0x11080, 0x110c1,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x12470, 0x12473,
- 0x13000, 0x1342e,
- 0x16800, 0x16a38,
- 0x1b000, 0x1b001,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d129, 0x1d1dd,
- 0x1d200, 0x1d245,
- 0x1d300, 0x1d356,
- 0x1d360, 0x1d371,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d7cb,
- 0x1d7ce, 0x1d7ff,
- 0x1f000, 0x1f02b,
- 0x1f030, 0x1f093,
- 0x1f0a0, 0x1f0ae,
- 0x1f0b1, 0x1f0be,
- 0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0df,
- 0x1f100, 0x1f10a,
- 0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
- 0x1f170, 0x1f19a,
- 0x1f1e6, 0x1f202,
- 0x1f210, 0x1f23a,
- 0x1f240, 0x1f248,
- 0x1f250, 0x1f251,
- 0x1f300, 0x1f320,
- 0x1f330, 0x1f335,
- 0x1f337, 0x1f37c,
- 0x1f380, 0x1f393,
- 0x1f3a0, 0x1f3c4,
- 0x1f3c6, 0x1f3ca,
- 0x1f3e0, 0x1f3f0,
- 0x1f400, 0x1f43e,
- 0x1f440, 0x1f440,
- 0x1f442, 0x1f4f7,
- 0x1f4f9, 0x1f4fc,
- 0x1f500, 0x1f53d,
- 0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
- 0x1f645, 0x1f64f,
- 0x1f680, 0x1f6c5,
- 0x1f700, 0x1f773,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2f800, 0x2fa1d,
- 0xe0001, 0xe0001,
- 0xe0020, 0xe007f,
- 0xe0100, 0xe01ef,
- 0xf0000, 0xffffd,
- 0x100000, 0x10fffd,
-}; /* CR_Graph */
-
-/* 'Lower': [[:Lower:]] */
-#define CR_Lower CR_Lowercase
-
-/* 'Print': [[:Print:]] */
-static const OnigCodePoint CR_Print[] = {
- 503,
- 0x0020, 0x007e,
- 0x00a0, 0x0377,
+/* 'Age_6_1': Derived Age 6.1 */
+static const OnigCodePoint CR_Age_6_1[] = {
+ 549,
+ 0x0000, 0x0377,
0x037a, 0x037e,
0x0384, 0x038a,
0x038c, 0x038c,
@@ -20374,10 +23582,11 @@ static const OnigCodePoint CR_Print[] = {
0x0559, 0x055f,
0x0561, 0x0587,
0x0589, 0x058a,
+ 0x058f, 0x058f,
0x0591, 0x05c7,
0x05d0, 0x05ea,
0x05f0, 0x05f4,
- 0x0600, 0x0603,
+ 0x0600, 0x0604,
0x0606, 0x061b,
0x061e, 0x070d,
0x070f, 0x074a,
@@ -20387,6 +23596,9 @@ static const OnigCodePoint CR_Print[] = {
0x0830, 0x083e,
0x0840, 0x085b,
0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
0x0900, 0x0977,
0x0979, 0x097f,
0x0981, 0x0983,
@@ -20431,8 +23643,7 @@ static const OnigCodePoint CR_Print[] = {
0x0acb, 0x0acd,
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0af1, 0x0af1,
+ 0x0ae6, 0x0af1,
0x0b01, 0x0b03,
0x0b05, 0x0b0c,
0x0b0f, 0x0b10,
@@ -20532,7 +23743,7 @@ static const OnigCodePoint CR_Print[] = {
0x0ec6, 0x0ec6,
0x0ec8, 0x0ecd,
0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f47,
0x0f49, 0x0f6c,
0x0f71, 0x0f97,
@@ -20540,8 +23751,9 @@ static const OnigCodePoint CR_Print[] = {
0x0fbe, 0x0fcc,
0x0fce, 0x0fda,
0x1000, 0x10c5,
- 0x10d0, 0x10fc,
- 0x1100, 0x1248,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -20594,13 +23806,12 @@ static const OnigCodePoint CR_Print[] = {
0x1aa0, 0x1aad,
0x1b00, 0x1b4b,
0x1b50, 0x1b7c,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1bf3,
+ 0x1b80, 0x1bf3,
0x1bfc, 0x1c37,
0x1c3b, 0x1c49,
0x1c4d, 0x1c7f,
- 0x1cd0, 0x1cf2,
+ 0x1cc0, 0x1cc7,
+ 0x1cd0, 0x1cf6,
0x1d00, 0x1de6,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
@@ -20618,8 +23829,7 @@ static const OnigCodePoint CR_Print[] = {
0x1fdd, 0x1fef,
0x1ff2, 0x1ff4,
0x1ff6, 0x1ffe,
- 0x2000, 0x2027,
- 0x202a, 0x2064,
+ 0x2000, 0x2064,
0x206a, 0x2071,
0x2074, 0x208e,
0x2090, 0x209c,
@@ -20630,15 +23840,15 @@ static const OnigCodePoint CR_Print[] = {
0x2400, 0x2426,
0x2440, 0x244a,
0x2460, 0x26ff,
- 0x2701, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x2b4c,
+ 0x2701, 0x2b4c,
0x2b50, 0x2b59,
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
- 0x2c60, 0x2cf1,
+ 0x2c60, 0x2cf3,
0x2cf9, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d70,
0x2d7f, 0x2d96,
0x2da0, 0x2da6,
@@ -20649,7 +23859,7 @@ static const OnigCodePoint CR_Print[] = {
0x2dc8, 0x2dce,
0x2dd0, 0x2dd6,
0x2dd8, 0x2dde,
- 0x2de0, 0x2e31,
+ 0x2de0, 0x2e3b,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
0x2f00, 0x2fd5,
@@ -20664,17 +23874,16 @@ static const OnigCodePoint CR_Print[] = {
0x31f0, 0x321e,
0x3220, 0x32fe,
0x3300, 0x4db5,
- 0x4dc0, 0x9fcb,
+ 0x4dc0, 0x9fcc,
0xa000, 0xa48c,
0xa490, 0xa4c6,
0xa4d0, 0xa62b,
- 0xa640, 0xa673,
- 0xa67c, 0xa697,
- 0xa6a0, 0xa6f7,
+ 0xa640, 0xa697,
+ 0xa69f, 0xa6f7,
0xa700, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa82b,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa82b,
0xa830, 0xa839,
0xa840, 0xa877,
0xa880, 0xa8c4,
@@ -20690,7 +23899,7 @@ static const OnigCodePoint CR_Print[] = {
0xaa50, 0xaa59,
0xaa5c, 0xaa7b,
0xaa80, 0xaac2,
- 0xaadb, 0xaadf,
+ 0xaadb, 0xaaf6,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -20701,8 +23910,7 @@ static const OnigCodePoint CR_Print[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xe000, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xd800, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -20715,7 +23923,7 @@ static const OnigCodePoint CR_Print[] = {
0xfbd3, 0xfd3f,
0xfd50, 0xfd8f,
0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfd,
+ 0xfdd0, 0xfdfd,
0xfe00, 0xfe19,
0xfe20, 0xfe26,
0xfe30, 0xfe52,
@@ -20731,8 +23939,7 @@ static const OnigCodePoint CR_Print[] = {
0xffda, 0xffdc,
0xffe0, 0xffe6,
0xffe8, 0xffee,
- 0xfff9, 0xfffd,
- 0x10000, 0x1000b,
+ 0xfff9, 0x1000b,
0x1000d, 0x10026,
0x10028, 0x1003a,
0x1003c, 0x1003d,
@@ -20764,6 +23971,8 @@ static const OnigCodePoint CR_Print[] = {
0x10900, 0x1091b,
0x1091f, 0x10939,
0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a13,
@@ -20782,11 +23991,22 @@ static const OnigCodePoint CR_Print[] = {
0x11000, 0x1104d,
0x11052, 0x1106f,
0x11080, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
0x12000, 0x1236e,
0x12400, 0x12462,
0x12470, 0x12473,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
0x1d000, 0x1d0f5,
0x1d100, 0x1d126,
@@ -20815,6 +24035,40 @@ static const OnigCodePoint CR_Print[] = {
0x1d552, 0x1d6a5,
0x1d6a8, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
@@ -20823,7 +24077,7 @@ static const OnigCodePoint CR_Print[] = {
0x1f0d1, 0x1f0df,
0x1f100, 0x1f10a,
0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
+ 0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
0x1f1e6, 0x1f202,
0x1f210, 0x1f23a,
@@ -20841,1083 +24095,1368 @@ static const OnigCodePoint CR_Print[] = {
0x1f442, 0x1f4f7,
0x1f4f9, 0x1f4fc,
0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
+ 0x1f5fb, 0x1f640,
0x1f645, 0x1f64f,
0x1f680, 0x1f6c5,
0x1f700, 0x1f773,
- 0x20000, 0x2a6d6,
+ 0x1fffe, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
0x2f800, 0x2fa1d,
+ 0x2fffe, 0x2ffff,
+ 0x3fffe, 0x3ffff,
+ 0x4fffe, 0x4ffff,
+ 0x5fffe, 0x5ffff,
+ 0x6fffe, 0x6ffff,
+ 0x7fffe, 0x7ffff,
+ 0x8fffe, 0x8ffff,
+ 0x9fffe, 0x9ffff,
+ 0xafffe, 0xaffff,
+ 0xbfffe, 0xbffff,
+ 0xcfffe, 0xcffff,
+ 0xdfffe, 0xdffff,
0xe0001, 0xe0001,
0xe0020, 0xe007f,
0xe0100, 0xe01ef,
- 0xf0000, 0xffffd,
- 0x100000, 0x10fffd,
-}; /* CR_Print */
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_6_1 */
-/* 'Punct': [[:Punct:]] */
-#define CR_Punct CR_P
+/* 'In_Basic_Latin': Block */
+#define CR_In_Basic_Latin CR_ASCII
-/* 'Space': [[:Space:]] */
-#define CR_Space CR_White_Space
+/* 'In_Latin_1_Supplement': Block */
+static const OnigCodePoint CR_In_Latin_1_Supplement[] = {
+ 1,
+ 0x0080, 0x00ff,
+}; /* CR_In_Latin_1_Supplement */
-/* 'Upper': [[:Upper:]] */
-#define CR_Upper CR_Uppercase
+/* 'In_Latin_Extended_A': Block */
+static const OnigCodePoint CR_In_Latin_Extended_A[] = {
+ 1,
+ 0x0100, 0x017f,
+}; /* CR_In_Latin_Extended_A */
-/* 'XDigit': [[:XDigit:]] */
-#define CR_XDigit CR_ASCII_Hex_Digit
+/* 'In_Latin_Extended_B': Block */
+static const OnigCodePoint CR_In_Latin_Extended_B[] = {
+ 1,
+ 0x0180, 0x024f,
+}; /* CR_In_Latin_Extended_B */
-/* 'Word': [[:Word:]] */
-static const OnigCodePoint CR_Word[] = {
- 514,
- 0x0030, 0x0039,
- 0x0041, 0x005a,
- 0x005f, 0x005f,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x02c1,
- 0x02c6, 0x02d1,
- 0x02e0, 0x02e4,
- 0x02ec, 0x02ec,
- 0x02ee, 0x02ee,
- 0x0300, 0x0374,
- 0x0376, 0x0377,
- 0x037a, 0x037d,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03f5,
- 0x03f7, 0x0481,
- 0x0483, 0x0527,
- 0x0531, 0x0556,
- 0x0559, 0x0559,
- 0x0561, 0x0587,
- 0x0591, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f2,
- 0x0610, 0x061a,
- 0x0620, 0x0669,
- 0x066e, 0x06d3,
- 0x06d5, 0x06dc,
- 0x06df, 0x06e8,
- 0x06ea, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x074a,
- 0x074d, 0x07b1,
- 0x07c0, 0x07f5,
- 0x07fa, 0x07fa,
- 0x0800, 0x082d,
- 0x0840, 0x085b,
- 0x0900, 0x0963,
- 0x0966, 0x096f,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bc, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09ce,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09e6, 0x09f1,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3c, 0x0a3c,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a51, 0x0a51,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a75,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abc, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acd,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3c, 0x0b44,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4d,
- 0x0b56, 0x0b57,
- 0x0b5c, 0x0b5d,
- 0x0b5f, 0x0b63,
- 0x0b66, 0x0b6f,
- 0x0b71, 0x0b71,
- 0x0b82, 0x0b83,
- 0x0b85, 0x0b8a,
- 0x0b8e, 0x0b90,
- 0x0b92, 0x0b95,
- 0x0b99, 0x0b9a,
- 0x0b9c, 0x0b9c,
- 0x0b9e, 0x0b9f,
- 0x0ba3, 0x0ba4,
- 0x0ba8, 0x0baa,
- 0x0bae, 0x0bb9,
- 0x0bbe, 0x0bc2,
- 0x0bc6, 0x0bc8,
- 0x0bca, 0x0bcd,
- 0x0bd0, 0x0bd0,
- 0x0bd7, 0x0bd7,
- 0x0be6, 0x0bef,
- 0x0c01, 0x0c03,
- 0x0c05, 0x0c0c,
- 0x0c0e, 0x0c10,
- 0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
- 0x0c3d, 0x0c44,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4d,
- 0x0c55, 0x0c56,
- 0x0c58, 0x0c59,
- 0x0c60, 0x0c63,
- 0x0c66, 0x0c6f,
- 0x0c82, 0x0c83,
- 0x0c85, 0x0c8c,
- 0x0c8e, 0x0c90,
- 0x0c92, 0x0ca8,
- 0x0caa, 0x0cb3,
- 0x0cb5, 0x0cb9,
- 0x0cbc, 0x0cc4,
- 0x0cc6, 0x0cc8,
- 0x0cca, 0x0ccd,
- 0x0cd5, 0x0cd6,
- 0x0cde, 0x0cde,
- 0x0ce0, 0x0ce3,
- 0x0ce6, 0x0cef,
- 0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d3a,
- 0x0d3d, 0x0d44,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4e,
- 0x0d57, 0x0d57,
- 0x0d60, 0x0d63,
- 0x0d66, 0x0d6f,
- 0x0d7a, 0x0d7f,
- 0x0d82, 0x0d83,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0dca, 0x0dca,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df3,
- 0x0e01, 0x0e3a,
- 0x0e40, 0x0e4e,
- 0x0e50, 0x0e59,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ec8, 0x0ecd,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f00,
- 0x0f18, 0x0f19,
- 0x0f20, 0x0f29,
- 0x0f35, 0x0f35,
- 0x0f37, 0x0f37,
- 0x0f39, 0x0f39,
- 0x0f3e, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f71, 0x0f84,
- 0x0f86, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fc6, 0x0fc6,
- 0x1000, 0x1049,
- 0x1050, 0x109d,
- 0x10a0, 0x10c5,
- 0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135d, 0x135f,
- 0x1380, 0x138f,
- 0x13a0, 0x13f4,
- 0x1401, 0x166c,
- 0x166f, 0x167f,
- 0x1681, 0x169a,
- 0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
- 0x1700, 0x170c,
- 0x170e, 0x1714,
- 0x1720, 0x1734,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17b3,
- 0x17b6, 0x17d3,
- 0x17d7, 0x17d7,
- 0x17dc, 0x17dd,
- 0x17e0, 0x17e9,
- 0x180b, 0x180d,
- 0x1810, 0x1819,
- 0x1820, 0x1877,
- 0x1880, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191c,
- 0x1920, 0x192b,
- 0x1930, 0x193b,
- 0x1946, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x19d0, 0x19d9,
- 0x1a00, 0x1a1b,
- 0x1a20, 0x1a5e,
- 0x1a60, 0x1a7c,
- 0x1a7f, 0x1a89,
- 0x1a90, 0x1a99,
- 0x1aa7, 0x1aa7,
- 0x1b00, 0x1b4b,
- 0x1b50, 0x1b59,
- 0x1b6b, 0x1b73,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1bf3,
- 0x1c00, 0x1c37,
- 0x1c40, 0x1c49,
- 0x1c4d, 0x1c7d,
- 0x1cd0, 0x1cd2,
- 0x1cd4, 0x1cf2,
- 0x1d00, 0x1de6,
- 0x1dfc, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fbc,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fcc,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fe0, 0x1fec,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffc,
- 0x203f, 0x2040,
- 0x2054, 0x2054,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x209c,
- 0x20d0, 0x20f0,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x212f, 0x2139,
- 0x213c, 0x213f,
- 0x2145, 0x2149,
- 0x214e, 0x214e,
- 0x2160, 0x2188,
- 0x24b6, 0x24e9,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2ce4,
- 0x2ceb, 0x2cf1,
- 0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
- 0x2d6f, 0x2d6f,
- 0x2d7f, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
+/* 'In_IPA_Extensions': Block */
+static const OnigCodePoint CR_In_IPA_Extensions[] = {
+ 1,
+ 0x0250, 0x02af,
+}; /* CR_In_IPA_Extensions */
+
+/* 'In_Spacing_Modifier_Letters': Block */
+static const OnigCodePoint CR_In_Spacing_Modifier_Letters[] = {
+ 1,
+ 0x02b0, 0x02ff,
+}; /* CR_In_Spacing_Modifier_Letters */
+
+/* 'In_Combining_Diacritical_Marks': Block */
+static const OnigCodePoint CR_In_Combining_Diacritical_Marks[] = {
+ 1,
+ 0x0300, 0x036f,
+}; /* CR_In_Combining_Diacritical_Marks */
+
+/* 'In_Greek_and_Coptic': Block */
+static const OnigCodePoint CR_In_Greek_and_Coptic[] = {
+ 1,
+ 0x0370, 0x03ff,
+}; /* CR_In_Greek_and_Coptic */
+
+/* 'In_Cyrillic': Block */
+static const OnigCodePoint CR_In_Cyrillic[] = {
+ 1,
+ 0x0400, 0x04ff,
+}; /* CR_In_Cyrillic */
+
+/* 'In_Cyrillic_Supplement': Block */
+static const OnigCodePoint CR_In_Cyrillic_Supplement[] = {
+ 1,
+ 0x0500, 0x052f,
+}; /* CR_In_Cyrillic_Supplement */
+
+/* 'In_Armenian': Block */
+static const OnigCodePoint CR_In_Armenian[] = {
+ 1,
+ 0x0530, 0x058f,
+}; /* CR_In_Armenian */
+
+/* 'In_Hebrew': Block */
+static const OnigCodePoint CR_In_Hebrew[] = {
+ 1,
+ 0x0590, 0x05ff,
+}; /* CR_In_Hebrew */
+
+/* 'In_Arabic': Block */
+static const OnigCodePoint CR_In_Arabic[] = {
+ 1,
+ 0x0600, 0x06ff,
+}; /* CR_In_Arabic */
+
+/* 'In_Syriac': Block */
+static const OnigCodePoint CR_In_Syriac[] = {
+ 1,
+ 0x0700, 0x074f,
+}; /* CR_In_Syriac */
+
+/* 'In_Arabic_Supplement': Block */
+static const OnigCodePoint CR_In_Arabic_Supplement[] = {
+ 1,
+ 0x0750, 0x077f,
+}; /* CR_In_Arabic_Supplement */
+
+/* 'In_Thaana': Block */
+static const OnigCodePoint CR_In_Thaana[] = {
+ 1,
+ 0x0780, 0x07bf,
+}; /* CR_In_Thaana */
+
+/* 'In_NKo': Block */
+static const OnigCodePoint CR_In_NKo[] = {
+ 1,
+ 0x07c0, 0x07ff,
+}; /* CR_In_NKo */
+
+/* 'In_Samaritan': Block */
+static const OnigCodePoint CR_In_Samaritan[] = {
+ 1,
+ 0x0800, 0x083f,
+}; /* CR_In_Samaritan */
+
+/* 'In_Mandaic': Block */
+static const OnigCodePoint CR_In_Mandaic[] = {
+ 1,
+ 0x0840, 0x085f,
+}; /* CR_In_Mandaic */
+
+/* 'In_Arabic_Extended_A': Block */
+static const OnigCodePoint CR_In_Arabic_Extended_A[] = {
+ 1,
+ 0x08a0, 0x08ff,
+}; /* CR_In_Arabic_Extended_A */
+
+/* 'In_Devanagari': Block */
+static const OnigCodePoint CR_In_Devanagari[] = {
+ 1,
+ 0x0900, 0x097f,
+}; /* CR_In_Devanagari */
+
+/* 'In_Bengali': Block */
+static const OnigCodePoint CR_In_Bengali[] = {
+ 1,
+ 0x0980, 0x09ff,
+}; /* CR_In_Bengali */
+
+/* 'In_Gurmukhi': Block */
+static const OnigCodePoint CR_In_Gurmukhi[] = {
+ 1,
+ 0x0a00, 0x0a7f,
+}; /* CR_In_Gurmukhi */
+
+/* 'In_Gujarati': Block */
+static const OnigCodePoint CR_In_Gujarati[] = {
+ 1,
+ 0x0a80, 0x0aff,
+}; /* CR_In_Gujarati */
+
+/* 'In_Oriya': Block */
+static const OnigCodePoint CR_In_Oriya[] = {
+ 1,
+ 0x0b00, 0x0b7f,
+}; /* CR_In_Oriya */
+
+/* 'In_Tamil': Block */
+static const OnigCodePoint CR_In_Tamil[] = {
+ 1,
+ 0x0b80, 0x0bff,
+}; /* CR_In_Tamil */
+
+/* 'In_Telugu': Block */
+static const OnigCodePoint CR_In_Telugu[] = {
+ 1,
+ 0x0c00, 0x0c7f,
+}; /* CR_In_Telugu */
+
+/* 'In_Kannada': Block */
+static const OnigCodePoint CR_In_Kannada[] = {
+ 1,
+ 0x0c80, 0x0cff,
+}; /* CR_In_Kannada */
+
+/* 'In_Malayalam': Block */
+static const OnigCodePoint CR_In_Malayalam[] = {
+ 1,
+ 0x0d00, 0x0d7f,
+}; /* CR_In_Malayalam */
+
+/* 'In_Sinhala': Block */
+static const OnigCodePoint CR_In_Sinhala[] = {
+ 1,
+ 0x0d80, 0x0dff,
+}; /* CR_In_Sinhala */
+
+/* 'In_Thai': Block */
+static const OnigCodePoint CR_In_Thai[] = {
+ 1,
+ 0x0e00, 0x0e7f,
+}; /* CR_In_Thai */
+
+/* 'In_Lao': Block */
+static const OnigCodePoint CR_In_Lao[] = {
+ 1,
+ 0x0e80, 0x0eff,
+}; /* CR_In_Lao */
+
+/* 'In_Tibetan': Block */
+static const OnigCodePoint CR_In_Tibetan[] = {
+ 1,
+ 0x0f00, 0x0fff,
+}; /* CR_In_Tibetan */
+
+/* 'In_Myanmar': Block */
+static const OnigCodePoint CR_In_Myanmar[] = {
+ 1,
+ 0x1000, 0x109f,
+}; /* CR_In_Myanmar */
+
+/* 'In_Georgian': Block */
+static const OnigCodePoint CR_In_Georgian[] = {
+ 1,
+ 0x10a0, 0x10ff,
+}; /* CR_In_Georgian */
+
+/* 'In_Hangul_Jamo': Block */
+static const OnigCodePoint CR_In_Hangul_Jamo[] = {
+ 1,
+ 0x1100, 0x11ff,
+}; /* CR_In_Hangul_Jamo */
+
+/* 'In_Ethiopic': Block */
+static const OnigCodePoint CR_In_Ethiopic[] = {
+ 1,
+ 0x1200, 0x137f,
+}; /* CR_In_Ethiopic */
+
+/* 'In_Ethiopic_Supplement': Block */
+static const OnigCodePoint CR_In_Ethiopic_Supplement[] = {
+ 1,
+ 0x1380, 0x139f,
+}; /* CR_In_Ethiopic_Supplement */
+
+/* 'In_Cherokee': Block */
+static const OnigCodePoint CR_In_Cherokee[] = {
+ 1,
+ 0x13a0, 0x13ff,
+}; /* CR_In_Cherokee */
+
+/* 'In_Unified_Canadian_Aboriginal_Syllabics': Block */
+static const OnigCodePoint CR_In_Unified_Canadian_Aboriginal_Syllabics[] = {
+ 1,
+ 0x1400, 0x167f,
+}; /* CR_In_Unified_Canadian_Aboriginal_Syllabics */
+
+/* 'In_Ogham': Block */
+static const OnigCodePoint CR_In_Ogham[] = {
+ 1,
+ 0x1680, 0x169f,
+}; /* CR_In_Ogham */
+
+/* 'In_Runic': Block */
+static const OnigCodePoint CR_In_Runic[] = {
+ 1,
+ 0x16a0, 0x16ff,
+}; /* CR_In_Runic */
+
+/* 'In_Tagalog': Block */
+static const OnigCodePoint CR_In_Tagalog[] = {
+ 1,
+ 0x1700, 0x171f,
+}; /* CR_In_Tagalog */
+
+/* 'In_Hanunoo': Block */
+static const OnigCodePoint CR_In_Hanunoo[] = {
+ 1,
+ 0x1720, 0x173f,
+}; /* CR_In_Hanunoo */
+
+/* 'In_Buhid': Block */
+static const OnigCodePoint CR_In_Buhid[] = {
+ 1,
+ 0x1740, 0x175f,
+}; /* CR_In_Buhid */
+
+/* 'In_Tagbanwa': Block */
+static const OnigCodePoint CR_In_Tagbanwa[] = {
+ 1,
+ 0x1760, 0x177f,
+}; /* CR_In_Tagbanwa */
+
+/* 'In_Khmer': Block */
+static const OnigCodePoint CR_In_Khmer[] = {
+ 1,
+ 0x1780, 0x17ff,
+}; /* CR_In_Khmer */
+
+/* 'In_Mongolian': Block */
+static const OnigCodePoint CR_In_Mongolian[] = {
+ 1,
+ 0x1800, 0x18af,
+}; /* CR_In_Mongolian */
+
+/* 'In_Unified_Canadian_Aboriginal_Syllabics_Extended': Block */
+static const OnigCodePoint CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended[] = {
+ 1,
+ 0x18b0, 0x18ff,
+}; /* CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended */
+
+/* 'In_Limbu': Block */
+static const OnigCodePoint CR_In_Limbu[] = {
+ 1,
+ 0x1900, 0x194f,
+}; /* CR_In_Limbu */
+
+/* 'In_Tai_Le': Block */
+static const OnigCodePoint CR_In_Tai_Le[] = {
+ 1,
+ 0x1950, 0x197f,
+}; /* CR_In_Tai_Le */
+
+/* 'In_New_Tai_Lue': Block */
+static const OnigCodePoint CR_In_New_Tai_Lue[] = {
+ 1,
+ 0x1980, 0x19df,
+}; /* CR_In_New_Tai_Lue */
+
+/* 'In_Khmer_Symbols': Block */
+static const OnigCodePoint CR_In_Khmer_Symbols[] = {
+ 1,
+ 0x19e0, 0x19ff,
+}; /* CR_In_Khmer_Symbols */
+
+/* 'In_Buginese': Block */
+static const OnigCodePoint CR_In_Buginese[] = {
+ 1,
+ 0x1a00, 0x1a1f,
+}; /* CR_In_Buginese */
+
+/* 'In_Tai_Tham': Block */
+static const OnigCodePoint CR_In_Tai_Tham[] = {
+ 1,
+ 0x1a20, 0x1aaf,
+}; /* CR_In_Tai_Tham */
+
+/* 'In_Balinese': Block */
+static const OnigCodePoint CR_In_Balinese[] = {
+ 1,
+ 0x1b00, 0x1b7f,
+}; /* CR_In_Balinese */
+
+/* 'In_Sundanese': Block */
+static const OnigCodePoint CR_In_Sundanese[] = {
+ 1,
+ 0x1b80, 0x1bbf,
+}; /* CR_In_Sundanese */
+
+/* 'In_Batak': Block */
+static const OnigCodePoint CR_In_Batak[] = {
+ 1,
+ 0x1bc0, 0x1bff,
+}; /* CR_In_Batak */
+
+/* 'In_Lepcha': Block */
+static const OnigCodePoint CR_In_Lepcha[] = {
+ 1,
+ 0x1c00, 0x1c4f,
+}; /* CR_In_Lepcha */
+
+/* 'In_Ol_Chiki': Block */
+#define CR_In_Ol_Chiki CR_Ol_Chiki
+
+/* 'In_Sundanese_Supplement': Block */
+static const OnigCodePoint CR_In_Sundanese_Supplement[] = {
+ 1,
+ 0x1cc0, 0x1ccf,
+}; /* CR_In_Sundanese_Supplement */
+
+/* 'In_Vedic_Extensions': Block */
+static const OnigCodePoint CR_In_Vedic_Extensions[] = {
+ 1,
+ 0x1cd0, 0x1cff,
+}; /* CR_In_Vedic_Extensions */
+
+/* 'In_Phonetic_Extensions': Block */
+static const OnigCodePoint CR_In_Phonetic_Extensions[] = {
+ 1,
+ 0x1d00, 0x1d7f,
+}; /* CR_In_Phonetic_Extensions */
+
+/* 'In_Phonetic_Extensions_Supplement': Block */
+static const OnigCodePoint CR_In_Phonetic_Extensions_Supplement[] = {
+ 1,
+ 0x1d80, 0x1dbf,
+}; /* CR_In_Phonetic_Extensions_Supplement */
+
+/* 'In_Combining_Diacritical_Marks_Supplement': Block */
+static const OnigCodePoint CR_In_Combining_Diacritical_Marks_Supplement[] = {
+ 1,
+ 0x1dc0, 0x1dff,
+}; /* CR_In_Combining_Diacritical_Marks_Supplement */
+
+/* 'In_Latin_Extended_Additional': Block */
+static const OnigCodePoint CR_In_Latin_Extended_Additional[] = {
+ 1,
+ 0x1e00, 0x1eff,
+}; /* CR_In_Latin_Extended_Additional */
+
+/* 'In_Greek_Extended': Block */
+static const OnigCodePoint CR_In_Greek_Extended[] = {
+ 1,
+ 0x1f00, 0x1fff,
+}; /* CR_In_Greek_Extended */
+
+/* 'In_General_Punctuation': Block */
+static const OnigCodePoint CR_In_General_Punctuation[] = {
+ 1,
+ 0x2000, 0x206f,
+}; /* CR_In_General_Punctuation */
+
+/* 'In_Superscripts_and_Subscripts': Block */
+static const OnigCodePoint CR_In_Superscripts_and_Subscripts[] = {
+ 1,
+ 0x2070, 0x209f,
+}; /* CR_In_Superscripts_and_Subscripts */
+
+/* 'In_Currency_Symbols': Block */
+static const OnigCodePoint CR_In_Currency_Symbols[] = {
+ 1,
+ 0x20a0, 0x20cf,
+}; /* CR_In_Currency_Symbols */
+
+/* 'In_Combining_Diacritical_Marks_for_Symbols': Block */
+static const OnigCodePoint CR_In_Combining_Diacritical_Marks_for_Symbols[] = {
+ 1,
+ 0x20d0, 0x20ff,
+}; /* CR_In_Combining_Diacritical_Marks_for_Symbols */
+
+/* 'In_Letterlike_Symbols': Block */
+static const OnigCodePoint CR_In_Letterlike_Symbols[] = {
+ 1,
+ 0x2100, 0x214f,
+}; /* CR_In_Letterlike_Symbols */
+
+/* 'In_Number_Forms': Block */
+static const OnigCodePoint CR_In_Number_Forms[] = {
+ 1,
+ 0x2150, 0x218f,
+}; /* CR_In_Number_Forms */
+
+/* 'In_Arrows': Block */
+static const OnigCodePoint CR_In_Arrows[] = {
+ 1,
+ 0x2190, 0x21ff,
+}; /* CR_In_Arrows */
+
+/* 'In_Mathematical_Operators': Block */
+static const OnigCodePoint CR_In_Mathematical_Operators[] = {
+ 1,
+ 0x2200, 0x22ff,
+}; /* CR_In_Mathematical_Operators */
+
+/* 'In_Miscellaneous_Technical': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Technical[] = {
+ 1,
+ 0x2300, 0x23ff,
+}; /* CR_In_Miscellaneous_Technical */
+
+/* 'In_Control_Pictures': Block */
+static const OnigCodePoint CR_In_Control_Pictures[] = {
+ 1,
+ 0x2400, 0x243f,
+}; /* CR_In_Control_Pictures */
+
+/* 'In_Optical_Character_Recognition': Block */
+static const OnigCodePoint CR_In_Optical_Character_Recognition[] = {
+ 1,
+ 0x2440, 0x245f,
+}; /* CR_In_Optical_Character_Recognition */
+
+/* 'In_Enclosed_Alphanumerics': Block */
+static const OnigCodePoint CR_In_Enclosed_Alphanumerics[] = {
+ 1,
+ 0x2460, 0x24ff,
+}; /* CR_In_Enclosed_Alphanumerics */
+
+/* 'In_Box_Drawing': Block */
+static const OnigCodePoint CR_In_Box_Drawing[] = {
+ 1,
+ 0x2500, 0x257f,
+}; /* CR_In_Box_Drawing */
+
+/* 'In_Block_Elements': Block */
+static const OnigCodePoint CR_In_Block_Elements[] = {
+ 1,
+ 0x2580, 0x259f,
+}; /* CR_In_Block_Elements */
+
+/* 'In_Geometric_Shapes': Block */
+static const OnigCodePoint CR_In_Geometric_Shapes[] = {
+ 1,
+ 0x25a0, 0x25ff,
+}; /* CR_In_Geometric_Shapes */
+
+/* 'In_Miscellaneous_Symbols': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Symbols[] = {
+ 1,
+ 0x2600, 0x26ff,
+}; /* CR_In_Miscellaneous_Symbols */
+
+/* 'In_Dingbats': Block */
+static const OnigCodePoint CR_In_Dingbats[] = {
+ 1,
+ 0x2700, 0x27bf,
+}; /* CR_In_Dingbats */
+
+/* 'In_Miscellaneous_Mathematical_Symbols_A': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Mathematical_Symbols_A[] = {
+ 1,
+ 0x27c0, 0x27ef,
+}; /* CR_In_Miscellaneous_Mathematical_Symbols_A */
+
+/* 'In_Supplemental_Arrows_A': Block */
+static const OnigCodePoint CR_In_Supplemental_Arrows_A[] = {
+ 1,
+ 0x27f0, 0x27ff,
+}; /* CR_In_Supplemental_Arrows_A */
+
+/* 'In_Braille_Patterns': Block */
+#define CR_In_Braille_Patterns CR_Braille
+
+/* 'In_Supplemental_Arrows_B': Block */
+static const OnigCodePoint CR_In_Supplemental_Arrows_B[] = {
+ 1,
+ 0x2900, 0x297f,
+}; /* CR_In_Supplemental_Arrows_B */
+
+/* 'In_Miscellaneous_Mathematical_Symbols_B': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Mathematical_Symbols_B[] = {
+ 1,
+ 0x2980, 0x29ff,
+}; /* CR_In_Miscellaneous_Mathematical_Symbols_B */
+
+/* 'In_Supplemental_Mathematical_Operators': Block */
+static const OnigCodePoint CR_In_Supplemental_Mathematical_Operators[] = {
+ 1,
+ 0x2a00, 0x2aff,
+}; /* CR_In_Supplemental_Mathematical_Operators */
+
+/* 'In_Miscellaneous_Symbols_and_Arrows': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Symbols_and_Arrows[] = {
+ 1,
+ 0x2b00, 0x2bff,
+}; /* CR_In_Miscellaneous_Symbols_and_Arrows */
+
+/* 'In_Glagolitic': Block */
+static const OnigCodePoint CR_In_Glagolitic[] = {
+ 1,
+ 0x2c00, 0x2c5f,
+}; /* CR_In_Glagolitic */
+
+/* 'In_Latin_Extended_C': Block */
+static const OnigCodePoint CR_In_Latin_Extended_C[] = {
+ 1,
+ 0x2c60, 0x2c7f,
+}; /* CR_In_Latin_Extended_C */
+
+/* 'In_Coptic': Block */
+static const OnigCodePoint CR_In_Coptic[] = {
+ 1,
+ 0x2c80, 0x2cff,
+}; /* CR_In_Coptic */
+
+/* 'In_Georgian_Supplement': Block */
+static const OnigCodePoint CR_In_Georgian_Supplement[] = {
+ 1,
+ 0x2d00, 0x2d2f,
+}; /* CR_In_Georgian_Supplement */
+
+/* 'In_Tifinagh': Block */
+static const OnigCodePoint CR_In_Tifinagh[] = {
+ 1,
+ 0x2d30, 0x2d7f,
+}; /* CR_In_Tifinagh */
+
+/* 'In_Ethiopic_Extended': Block */
+static const OnigCodePoint CR_In_Ethiopic_Extended[] = {
+ 1,
+ 0x2d80, 0x2ddf,
+}; /* CR_In_Ethiopic_Extended */
+
+/* 'In_Cyrillic_Extended_A': Block */
+static const OnigCodePoint CR_In_Cyrillic_Extended_A[] = {
+ 1,
0x2de0, 0x2dff,
- 0x2e2f, 0x2e2f,
- 0x3005, 0x3007,
- 0x3021, 0x302f,
- 0x3031, 0x3035,
- 0x3038, 0x303c,
- 0x3041, 0x3096,
- 0x3099, 0x309a,
- 0x309d, 0x309f,
- 0x30a1, 0x30fa,
- 0x30fc, 0x30ff,
- 0x3105, 0x312d,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
+}; /* CR_In_Cyrillic_Extended_A */
+
+/* 'In_Supplemental_Punctuation': Block */
+static const OnigCodePoint CR_In_Supplemental_Punctuation[] = {
+ 1,
+ 0x2e00, 0x2e7f,
+}; /* CR_In_Supplemental_Punctuation */
+
+/* 'In_CJK_Radicals_Supplement': Block */
+static const OnigCodePoint CR_In_CJK_Radicals_Supplement[] = {
+ 1,
+ 0x2e80, 0x2eff,
+}; /* CR_In_CJK_Radicals_Supplement */
+
+/* 'In_Kangxi_Radicals': Block */
+static const OnigCodePoint CR_In_Kangxi_Radicals[] = {
+ 1,
+ 0x2f00, 0x2fdf,
+}; /* CR_In_Kangxi_Radicals */
+
+/* 'In_Ideographic_Description_Characters': Block */
+static const OnigCodePoint CR_In_Ideographic_Description_Characters[] = {
+ 1,
+ 0x2ff0, 0x2fff,
+}; /* CR_In_Ideographic_Description_Characters */
+
+/* 'In_CJK_Symbols_and_Punctuation': Block */
+static const OnigCodePoint CR_In_CJK_Symbols_and_Punctuation[] = {
+ 1,
+ 0x3000, 0x303f,
+}; /* CR_In_CJK_Symbols_and_Punctuation */
+
+/* 'In_Hiragana': Block */
+static const OnigCodePoint CR_In_Hiragana[] = {
+ 1,
+ 0x3040, 0x309f,
+}; /* CR_In_Hiragana */
+
+/* 'In_Katakana': Block */
+static const OnigCodePoint CR_In_Katakana[] = {
+ 1,
+ 0x30a0, 0x30ff,
+}; /* CR_In_Katakana */
+
+/* 'In_Bopomofo': Block */
+static const OnigCodePoint CR_In_Bopomofo[] = {
+ 1,
+ 0x3100, 0x312f,
+}; /* CR_In_Bopomofo */
+
+/* 'In_Hangul_Compatibility_Jamo': Block */
+static const OnigCodePoint CR_In_Hangul_Compatibility_Jamo[] = {
+ 1,
+ 0x3130, 0x318f,
+}; /* CR_In_Hangul_Compatibility_Jamo */
+
+/* 'In_Kanbun': Block */
+static const OnigCodePoint CR_In_Kanbun[] = {
+ 1,
+ 0x3190, 0x319f,
+}; /* CR_In_Kanbun */
+
+/* 'In_Bopomofo_Extended': Block */
+static const OnigCodePoint CR_In_Bopomofo_Extended[] = {
+ 1,
+ 0x31a0, 0x31bf,
+}; /* CR_In_Bopomofo_Extended */
+
+/* 'In_CJK_Strokes': Block */
+static const OnigCodePoint CR_In_CJK_Strokes[] = {
+ 1,
+ 0x31c0, 0x31ef,
+}; /* CR_In_CJK_Strokes */
+
+/* 'In_Katakana_Phonetic_Extensions': Block */
+static const OnigCodePoint CR_In_Katakana_Phonetic_Extensions[] = {
+ 1,
0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa62b,
- 0xa640, 0xa672,
- 0xa67c, 0xa67d,
- 0xa67f, 0xa697,
- 0xa6a0, 0xa6f1,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa827,
- 0xa840, 0xa873,
- 0xa880, 0xa8c4,
- 0xa8d0, 0xa8d9,
- 0xa8e0, 0xa8f7,
- 0xa8fb, 0xa8fb,
- 0xa900, 0xa92d,
- 0xa930, 0xa953,
- 0xa960, 0xa97c,
- 0xa980, 0xa9c0,
- 0xa9cf, 0xa9d9,
- 0xaa00, 0xaa36,
- 0xaa40, 0xaa4d,
- 0xaa50, 0xaa59,
- 0xaa60, 0xaa76,
- 0xaa7a, 0xaa7b,
- 0xaa80, 0xaac2,
- 0xaadb, 0xaadd,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xabc0, 0xabea,
- 0xabec, 0xabed,
- 0xabf0, 0xabf9,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb28,
- 0xfb2a, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3d,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfb,
+}; /* CR_In_Katakana_Phonetic_Extensions */
+
+/* 'In_Enclosed_CJK_Letters_and_Months': Block */
+static const OnigCodePoint CR_In_Enclosed_CJK_Letters_and_Months[] = {
+ 1,
+ 0x3200, 0x32ff,
+}; /* CR_In_Enclosed_CJK_Letters_and_Months */
+
+/* 'In_CJK_Compatibility': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility[] = {
+ 1,
+ 0x3300, 0x33ff,
+}; /* CR_In_CJK_Compatibility */
+
+/* 'In_CJK_Unified_Ideographs_Extension_A': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_A[] = {
+ 1,
+ 0x3400, 0x4dbf,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_A */
+
+/* 'In_Yijing_Hexagram_Symbols': Block */
+static const OnigCodePoint CR_In_Yijing_Hexagram_Symbols[] = {
+ 1,
+ 0x4dc0, 0x4dff,
+}; /* CR_In_Yijing_Hexagram_Symbols */
+
+/* 'In_CJK_Unified_Ideographs': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs[] = {
+ 1,
+ 0x4e00, 0x9fff,
+}; /* CR_In_CJK_Unified_Ideographs */
+
+/* 'In_Yi_Syllables': Block */
+static const OnigCodePoint CR_In_Yi_Syllables[] = {
+ 1,
+ 0xa000, 0xa48f,
+}; /* CR_In_Yi_Syllables */
+
+/* 'In_Yi_Radicals': Block */
+static const OnigCodePoint CR_In_Yi_Radicals[] = {
+ 1,
+ 0xa490, 0xa4cf,
+}; /* CR_In_Yi_Radicals */
+
+/* 'In_Lisu': Block */
+#define CR_In_Lisu CR_Lisu
+
+/* 'In_Vai': Block */
+static const OnigCodePoint CR_In_Vai[] = {
+ 1,
+ 0xa500, 0xa63f,
+}; /* CR_In_Vai */
+
+/* 'In_Cyrillic_Extended_B': Block */
+static const OnigCodePoint CR_In_Cyrillic_Extended_B[] = {
+ 1,
+ 0xa640, 0xa69f,
+}; /* CR_In_Cyrillic_Extended_B */
+
+/* 'In_Bamum': Block */
+static const OnigCodePoint CR_In_Bamum[] = {
+ 1,
+ 0xa6a0, 0xa6ff,
+}; /* CR_In_Bamum */
+
+/* 'In_Modifier_Tone_Letters': Block */
+static const OnigCodePoint CR_In_Modifier_Tone_Letters[] = {
+ 1,
+ 0xa700, 0xa71f,
+}; /* CR_In_Modifier_Tone_Letters */
+
+/* 'In_Latin_Extended_D': Block */
+static const OnigCodePoint CR_In_Latin_Extended_D[] = {
+ 1,
+ 0xa720, 0xa7ff,
+}; /* CR_In_Latin_Extended_D */
+
+/* 'In_Syloti_Nagri': Block */
+static const OnigCodePoint CR_In_Syloti_Nagri[] = {
+ 1,
+ 0xa800, 0xa82f,
+}; /* CR_In_Syloti_Nagri */
+
+/* 'In_Common_Indic_Number_Forms': Block */
+static const OnigCodePoint CR_In_Common_Indic_Number_Forms[] = {
+ 1,
+ 0xa830, 0xa83f,
+}; /* CR_In_Common_Indic_Number_Forms */
+
+/* 'In_Phags_pa': Block */
+static const OnigCodePoint CR_In_Phags_pa[] = {
+ 1,
+ 0xa840, 0xa87f,
+}; /* CR_In_Phags_pa */
+
+/* 'In_Saurashtra': Block */
+static const OnigCodePoint CR_In_Saurashtra[] = {
+ 1,
+ 0xa880, 0xa8df,
+}; /* CR_In_Saurashtra */
+
+/* 'In_Devanagari_Extended': Block */
+static const OnigCodePoint CR_In_Devanagari_Extended[] = {
+ 1,
+ 0xa8e0, 0xa8ff,
+}; /* CR_In_Devanagari_Extended */
+
+/* 'In_Kayah_Li': Block */
+#define CR_In_Kayah_Li CR_Kayah_Li
+
+/* 'In_Rejang': Block */
+static const OnigCodePoint CR_In_Rejang[] = {
+ 1,
+ 0xa930, 0xa95f,
+}; /* CR_In_Rejang */
+
+/* 'In_Hangul_Jamo_Extended_A': Block */
+static const OnigCodePoint CR_In_Hangul_Jamo_Extended_A[] = {
+ 1,
+ 0xa960, 0xa97f,
+}; /* CR_In_Hangul_Jamo_Extended_A */
+
+/* 'In_Javanese': Block */
+static const OnigCodePoint CR_In_Javanese[] = {
+ 1,
+ 0xa980, 0xa9df,
+}; /* CR_In_Javanese */
+
+/* 'In_Cham': Block */
+static const OnigCodePoint CR_In_Cham[] = {
+ 1,
+ 0xaa00, 0xaa5f,
+}; /* CR_In_Cham */
+
+/* 'In_Myanmar_Extended_A': Block */
+static const OnigCodePoint CR_In_Myanmar_Extended_A[] = {
+ 1,
+ 0xaa60, 0xaa7f,
+}; /* CR_In_Myanmar_Extended_A */
+
+/* 'In_Tai_Viet': Block */
+static const OnigCodePoint CR_In_Tai_Viet[] = {
+ 1,
+ 0xaa80, 0xaadf,
+}; /* CR_In_Tai_Viet */
+
+/* 'In_Meetei_Mayek_Extensions': Block */
+static const OnigCodePoint CR_In_Meetei_Mayek_Extensions[] = {
+ 1,
+ 0xaae0, 0xaaff,
+}; /* CR_In_Meetei_Mayek_Extensions */
+
+/* 'In_Ethiopic_Extended_A': Block */
+static const OnigCodePoint CR_In_Ethiopic_Extended_A[] = {
+ 1,
+ 0xab00, 0xab2f,
+}; /* CR_In_Ethiopic_Extended_A */
+
+/* 'In_Meetei_Mayek': Block */
+static const OnigCodePoint CR_In_Meetei_Mayek[] = {
+ 1,
+ 0xabc0, 0xabff,
+}; /* CR_In_Meetei_Mayek */
+
+/* 'In_Hangul_Syllables': Block */
+static const OnigCodePoint CR_In_Hangul_Syllables[] = {
+ 1,
+ 0xac00, 0xd7af,
+}; /* CR_In_Hangul_Syllables */
+
+/* 'In_Hangul_Jamo_Extended_B': Block */
+static const OnigCodePoint CR_In_Hangul_Jamo_Extended_B[] = {
+ 1,
+ 0xd7b0, 0xd7ff,
+}; /* CR_In_Hangul_Jamo_Extended_B */
+
+/* 'In_High_Surrogates': Block */
+static const OnigCodePoint CR_In_High_Surrogates[] = {
+ 1,
+ 0xd800, 0xdb7f,
+}; /* CR_In_High_Surrogates */
+
+/* 'In_High_Private_Use_Surrogates': Block */
+static const OnigCodePoint CR_In_High_Private_Use_Surrogates[] = {
+ 1,
+ 0xdb80, 0xdbff,
+}; /* CR_In_High_Private_Use_Surrogates */
+
+/* 'In_Low_Surrogates': Block */
+static const OnigCodePoint CR_In_Low_Surrogates[] = {
+ 1,
+ 0xdc00, 0xdfff,
+}; /* CR_In_Low_Surrogates */
+
+/* 'In_Private_Use_Area': Block */
+static const OnigCodePoint CR_In_Private_Use_Area[] = {
+ 1,
+ 0xe000, 0xf8ff,
+}; /* CR_In_Private_Use_Area */
+
+/* 'In_CJK_Compatibility_Ideographs': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility_Ideographs[] = {
+ 1,
+ 0xf900, 0xfaff,
+}; /* CR_In_CJK_Compatibility_Ideographs */
+
+/* 'In_Alphabetic_Presentation_Forms': Block */
+static const OnigCodePoint CR_In_Alphabetic_Presentation_Forms[] = {
+ 1,
+ 0xfb00, 0xfb4f,
+}; /* CR_In_Alphabetic_Presentation_Forms */
+
+/* 'In_Arabic_Presentation_Forms_A': Block */
+static const OnigCodePoint CR_In_Arabic_Presentation_Forms_A[] = {
+ 1,
+ 0xfb50, 0xfdff,
+}; /* CR_In_Arabic_Presentation_Forms_A */
+
+/* 'In_Variation_Selectors': Block */
+static const OnigCodePoint CR_In_Variation_Selectors[] = {
+ 1,
0xfe00, 0xfe0f,
- 0xfe20, 0xfe26,
- 0xfe33, 0xfe34,
- 0xfe4d, 0xfe4f,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xff10, 0xff19,
- 0xff21, 0xff3a,
- 0xff3f, 0xff3f,
- 0xff41, 0xff5a,
- 0xff66, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10140, 0x10174,
- 0x101fd, 0x101fd,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x10300, 0x1031e,
- 0x10330, 0x1034a,
- 0x10380, 0x1039d,
- 0x103a0, 0x103c3,
- 0x103c8, 0x103cf,
- 0x103d1, 0x103d5,
- 0x10400, 0x1049d,
- 0x104a0, 0x104a9,
- 0x10800, 0x10805,
- 0x10808, 0x10808,
- 0x1080a, 0x10835,
- 0x10837, 0x10838,
- 0x1083c, 0x1083c,
- 0x1083f, 0x10855,
- 0x10900, 0x10915,
- 0x10920, 0x10939,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a3f,
- 0x10a60, 0x10a7c,
- 0x10b00, 0x10b35,
- 0x10b40, 0x10b55,
- 0x10b60, 0x10b72,
- 0x10c00, 0x10c48,
- 0x11000, 0x11046,
- 0x11066, 0x1106f,
- 0x11080, 0x110ba,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x13000, 0x1342e,
- 0x16800, 0x16a38,
- 0x1b000, 0x1b001,
- 0x1d165, 0x1d169,
- 0x1d16d, 0x1d172,
- 0x1d17b, 0x1d182,
- 0x1d185, 0x1d18b,
- 0x1d1aa, 0x1d1ad,
- 0x1d242, 0x1d244,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d6c0,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6fa,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d734,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d76e,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d7a8,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7cb,
- 0x1d7ce, 0x1d7ff,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2f800, 0x2fa1d,
+}; /* CR_In_Variation_Selectors */
+
+/* 'In_Vertical_Forms': Block */
+static const OnigCodePoint CR_In_Vertical_Forms[] = {
+ 1,
+ 0xfe10, 0xfe1f,
+}; /* CR_In_Vertical_Forms */
+
+/* 'In_Combining_Half_Marks': Block */
+static const OnigCodePoint CR_In_Combining_Half_Marks[] = {
+ 1,
+ 0xfe20, 0xfe2f,
+}; /* CR_In_Combining_Half_Marks */
+
+/* 'In_CJK_Compatibility_Forms': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility_Forms[] = {
+ 1,
+ 0xfe30, 0xfe4f,
+}; /* CR_In_CJK_Compatibility_Forms */
+
+/* 'In_Small_Form_Variants': Block */
+static const OnigCodePoint CR_In_Small_Form_Variants[] = {
+ 1,
+ 0xfe50, 0xfe6f,
+}; /* CR_In_Small_Form_Variants */
+
+/* 'In_Arabic_Presentation_Forms_B': Block */
+static const OnigCodePoint CR_In_Arabic_Presentation_Forms_B[] = {
+ 1,
+ 0xfe70, 0xfeff,
+}; /* CR_In_Arabic_Presentation_Forms_B */
+
+/* 'In_Halfwidth_and_Fullwidth_Forms': Block */
+static const OnigCodePoint CR_In_Halfwidth_and_Fullwidth_Forms[] = {
+ 1,
+ 0xff00, 0xffef,
+}; /* CR_In_Halfwidth_and_Fullwidth_Forms */
+
+/* 'In_Specials': Block */
+static const OnigCodePoint CR_In_Specials[] = {
+ 1,
+ 0xfff0, 0xffff,
+}; /* CR_In_Specials */
+
+/* 'In_Linear_B_Syllabary': Block */
+static const OnigCodePoint CR_In_Linear_B_Syllabary[] = {
+ 1,
+ 0x10000, 0x1007f,
+}; /* CR_In_Linear_B_Syllabary */
+
+/* 'In_Linear_B_Ideograms': Block */
+static const OnigCodePoint CR_In_Linear_B_Ideograms[] = {
+ 1,
+ 0x10080, 0x100ff,
+}; /* CR_In_Linear_B_Ideograms */
+
+/* 'In_Aegean_Numbers': Block */
+static const OnigCodePoint CR_In_Aegean_Numbers[] = {
+ 1,
+ 0x10100, 0x1013f,
+}; /* CR_In_Aegean_Numbers */
+
+/* 'In_Ancient_Greek_Numbers': Block */
+static const OnigCodePoint CR_In_Ancient_Greek_Numbers[] = {
+ 1,
+ 0x10140, 0x1018f,
+}; /* CR_In_Ancient_Greek_Numbers */
+
+/* 'In_Ancient_Symbols': Block */
+static const OnigCodePoint CR_In_Ancient_Symbols[] = {
+ 1,
+ 0x10190, 0x101cf,
+}; /* CR_In_Ancient_Symbols */
+
+/* 'In_Phaistos_Disc': Block */
+static const OnigCodePoint CR_In_Phaistos_Disc[] = {
+ 1,
+ 0x101d0, 0x101ff,
+}; /* CR_In_Phaistos_Disc */
+
+/* 'In_Lycian': Block */
+static const OnigCodePoint CR_In_Lycian[] = {
+ 1,
+ 0x10280, 0x1029f,
+}; /* CR_In_Lycian */
+
+/* 'In_Carian': Block */
+static const OnigCodePoint CR_In_Carian[] = {
+ 1,
+ 0x102a0, 0x102df,
+}; /* CR_In_Carian */
+
+/* 'In_Old_Italic': Block */
+static const OnigCodePoint CR_In_Old_Italic[] = {
+ 1,
+ 0x10300, 0x1032f,
+}; /* CR_In_Old_Italic */
+
+/* 'In_Gothic': Block */
+static const OnigCodePoint CR_In_Gothic[] = {
+ 1,
+ 0x10330, 0x1034f,
+}; /* CR_In_Gothic */
+
+/* 'In_Ugaritic': Block */
+static const OnigCodePoint CR_In_Ugaritic[] = {
+ 1,
+ 0x10380, 0x1039f,
+}; /* CR_In_Ugaritic */
+
+/* 'In_Old_Persian': Block */
+static const OnigCodePoint CR_In_Old_Persian[] = {
+ 1,
+ 0x103a0, 0x103df,
+}; /* CR_In_Old_Persian */
+
+/* 'In_Deseret': Block */
+#define CR_In_Deseret CR_Deseret
+
+/* 'In_Shavian': Block */
+#define CR_In_Shavian CR_Shavian
+
+/* 'In_Osmanya': Block */
+static const OnigCodePoint CR_In_Osmanya[] = {
+ 1,
+ 0x10480, 0x104af,
+}; /* CR_In_Osmanya */
+
+/* 'In_Cypriot_Syllabary': Block */
+static const OnigCodePoint CR_In_Cypriot_Syllabary[] = {
+ 1,
+ 0x10800, 0x1083f,
+}; /* CR_In_Cypriot_Syllabary */
+
+/* 'In_Imperial_Aramaic': Block */
+static const OnigCodePoint CR_In_Imperial_Aramaic[] = {
+ 1,
+ 0x10840, 0x1085f,
+}; /* CR_In_Imperial_Aramaic */
+
+/* 'In_Phoenician': Block */
+static const OnigCodePoint CR_In_Phoenician[] = {
+ 1,
+ 0x10900, 0x1091f,
+}; /* CR_In_Phoenician */
+
+/* 'In_Lydian': Block */
+static const OnigCodePoint CR_In_Lydian[] = {
+ 1,
+ 0x10920, 0x1093f,
+}; /* CR_In_Lydian */
+
+/* 'In_Meroitic_Hieroglyphs': Block */
+#define CR_In_Meroitic_Hieroglyphs CR_Meroitic_Hieroglyphs
+
+/* 'In_Meroitic_Cursive': Block */
+static const OnigCodePoint CR_In_Meroitic_Cursive[] = {
+ 1,
+ 0x109a0, 0x109ff,
+}; /* CR_In_Meroitic_Cursive */
+
+/* 'In_Kharoshthi': Block */
+static const OnigCodePoint CR_In_Kharoshthi[] = {
+ 1,
+ 0x10a00, 0x10a5f,
+}; /* CR_In_Kharoshthi */
+
+/* 'In_Old_South_Arabian': Block */
+#define CR_In_Old_South_Arabian CR_Old_South_Arabian
+
+/* 'In_Avestan': Block */
+static const OnigCodePoint CR_In_Avestan[] = {
+ 1,
+ 0x10b00, 0x10b3f,
+}; /* CR_In_Avestan */
+
+/* 'In_Inscriptional_Parthian': Block */
+static const OnigCodePoint CR_In_Inscriptional_Parthian[] = {
+ 1,
+ 0x10b40, 0x10b5f,
+}; /* CR_In_Inscriptional_Parthian */
+
+/* 'In_Inscriptional_Pahlavi': Block */
+static const OnigCodePoint CR_In_Inscriptional_Pahlavi[] = {
+ 1,
+ 0x10b60, 0x10b7f,
+}; /* CR_In_Inscriptional_Pahlavi */
+
+/* 'In_Old_Turkic': Block */
+static const OnigCodePoint CR_In_Old_Turkic[] = {
+ 1,
+ 0x10c00, 0x10c4f,
+}; /* CR_In_Old_Turkic */
+
+/* 'In_Rumi_Numeral_Symbols': Block */
+static const OnigCodePoint CR_In_Rumi_Numeral_Symbols[] = {
+ 1,
+ 0x10e60, 0x10e7f,
+}; /* CR_In_Rumi_Numeral_Symbols */
+
+/* 'In_Brahmi': Block */
+static const OnigCodePoint CR_In_Brahmi[] = {
+ 1,
+ 0x11000, 0x1107f,
+}; /* CR_In_Brahmi */
+
+/* 'In_Kaithi': Block */
+static const OnigCodePoint CR_In_Kaithi[] = {
+ 1,
+ 0x11080, 0x110cf,
+}; /* CR_In_Kaithi */
+
+/* 'In_Sora_Sompeng': Block */
+static const OnigCodePoint CR_In_Sora_Sompeng[] = {
+ 1,
+ 0x110d0, 0x110ff,
+}; /* CR_In_Sora_Sompeng */
+
+/* 'In_Chakma': Block */
+static const OnigCodePoint CR_In_Chakma[] = {
+ 1,
+ 0x11100, 0x1114f,
+}; /* CR_In_Chakma */
+
+/* 'In_Sharada': Block */
+static const OnigCodePoint CR_In_Sharada[] = {
+ 1,
+ 0x11180, 0x111df,
+}; /* CR_In_Sharada */
+
+/* 'In_Takri': Block */
+static const OnigCodePoint CR_In_Takri[] = {
+ 1,
+ 0x11680, 0x116cf,
+}; /* CR_In_Takri */
+
+/* 'In_Cuneiform': Block */
+static const OnigCodePoint CR_In_Cuneiform[] = {
+ 1,
+ 0x12000, 0x123ff,
+}; /* CR_In_Cuneiform */
+
+/* 'In_Cuneiform_Numbers_and_Punctuation': Block */
+static const OnigCodePoint CR_In_Cuneiform_Numbers_and_Punctuation[] = {
+ 1,
+ 0x12400, 0x1247f,
+}; /* CR_In_Cuneiform_Numbers_and_Punctuation */
+
+/* 'In_Egyptian_Hieroglyphs': Block */
+static const OnigCodePoint CR_In_Egyptian_Hieroglyphs[] = {
+ 1,
+ 0x13000, 0x1342f,
+}; /* CR_In_Egyptian_Hieroglyphs */
+
+/* 'In_Bamum_Supplement': Block */
+static const OnigCodePoint CR_In_Bamum_Supplement[] = {
+ 1,
+ 0x16800, 0x16a3f,
+}; /* CR_In_Bamum_Supplement */
+
+/* 'In_Miao': Block */
+static const OnigCodePoint CR_In_Miao[] = {
+ 1,
+ 0x16f00, 0x16f9f,
+}; /* CR_In_Miao */
+
+/* 'In_Kana_Supplement': Block */
+static const OnigCodePoint CR_In_Kana_Supplement[] = {
+ 1,
+ 0x1b000, 0x1b0ff,
+}; /* CR_In_Kana_Supplement */
+
+/* 'In_Byzantine_Musical_Symbols': Block */
+static const OnigCodePoint CR_In_Byzantine_Musical_Symbols[] = {
+ 1,
+ 0x1d000, 0x1d0ff,
+}; /* CR_In_Byzantine_Musical_Symbols */
+
+/* 'In_Musical_Symbols': Block */
+static const OnigCodePoint CR_In_Musical_Symbols[] = {
+ 1,
+ 0x1d100, 0x1d1ff,
+}; /* CR_In_Musical_Symbols */
+
+/* 'In_Ancient_Greek_Musical_Notation': Block */
+static const OnigCodePoint CR_In_Ancient_Greek_Musical_Notation[] = {
+ 1,
+ 0x1d200, 0x1d24f,
+}; /* CR_In_Ancient_Greek_Musical_Notation */
+
+/* 'In_Tai_Xuan_Jing_Symbols': Block */
+static const OnigCodePoint CR_In_Tai_Xuan_Jing_Symbols[] = {
+ 1,
+ 0x1d300, 0x1d35f,
+}; /* CR_In_Tai_Xuan_Jing_Symbols */
+
+/* 'In_Counting_Rod_Numerals': Block */
+static const OnigCodePoint CR_In_Counting_Rod_Numerals[] = {
+ 1,
+ 0x1d360, 0x1d37f,
+}; /* CR_In_Counting_Rod_Numerals */
+
+/* 'In_Mathematical_Alphanumeric_Symbols': Block */
+static const OnigCodePoint CR_In_Mathematical_Alphanumeric_Symbols[] = {
+ 1,
+ 0x1d400, 0x1d7ff,
+}; /* CR_In_Mathematical_Alphanumeric_Symbols */
+
+/* 'In_Arabic_Mathematical_Alphabetic_Symbols': Block */
+static const OnigCodePoint CR_In_Arabic_Mathematical_Alphabetic_Symbols[] = {
+ 1,
+ 0x1ee00, 0x1eeff,
+}; /* CR_In_Arabic_Mathematical_Alphabetic_Symbols */
+
+/* 'In_Mahjong_Tiles': Block */
+static const OnigCodePoint CR_In_Mahjong_Tiles[] = {
+ 1,
+ 0x1f000, 0x1f02f,
+}; /* CR_In_Mahjong_Tiles */
+
+/* 'In_Domino_Tiles': Block */
+static const OnigCodePoint CR_In_Domino_Tiles[] = {
+ 1,
+ 0x1f030, 0x1f09f,
+}; /* CR_In_Domino_Tiles */
+
+/* 'In_Playing_Cards': Block */
+static const OnigCodePoint CR_In_Playing_Cards[] = {
+ 1,
+ 0x1f0a0, 0x1f0ff,
+}; /* CR_In_Playing_Cards */
+
+/* 'In_Enclosed_Alphanumeric_Supplement': Block */
+static const OnigCodePoint CR_In_Enclosed_Alphanumeric_Supplement[] = {
+ 1,
+ 0x1f100, 0x1f1ff,
+}; /* CR_In_Enclosed_Alphanumeric_Supplement */
+
+/* 'In_Enclosed_Ideographic_Supplement': Block */
+static const OnigCodePoint CR_In_Enclosed_Ideographic_Supplement[] = {
+ 1,
+ 0x1f200, 0x1f2ff,
+}; /* CR_In_Enclosed_Ideographic_Supplement */
+
+/* 'In_Miscellaneous_Symbols_And_Pictographs': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Symbols_And_Pictographs[] = {
+ 1,
+ 0x1f300, 0x1f5ff,
+}; /* CR_In_Miscellaneous_Symbols_And_Pictographs */
+
+/* 'In_Emoticons': Block */
+static const OnigCodePoint CR_In_Emoticons[] = {
+ 1,
+ 0x1f600, 0x1f64f,
+}; /* CR_In_Emoticons */
+
+/* 'In_Transport_And_Map_Symbols': Block */
+static const OnigCodePoint CR_In_Transport_And_Map_Symbols[] = {
+ 1,
+ 0x1f680, 0x1f6ff,
+}; /* CR_In_Transport_And_Map_Symbols */
+
+/* 'In_Alchemical_Symbols': Block */
+static const OnigCodePoint CR_In_Alchemical_Symbols[] = {
+ 1,
+ 0x1f700, 0x1f77f,
+}; /* CR_In_Alchemical_Symbols */
+
+/* 'In_CJK_Unified_Ideographs_Extension_B': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_B[] = {
+ 1,
+ 0x20000, 0x2a6df,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_B */
+
+/* 'In_CJK_Unified_Ideographs_Extension_C': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_C[] = {
+ 1,
+ 0x2a700, 0x2b73f,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_C */
+
+/* 'In_CJK_Unified_Ideographs_Extension_D': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_D[] = {
+ 1,
+ 0x2b740, 0x2b81f,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_D */
+
+/* 'In_CJK_Compatibility_Ideographs_Supplement': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility_Ideographs_Supplement[] = {
+ 1,
+ 0x2f800, 0x2fa1f,
+}; /* CR_In_CJK_Compatibility_Ideographs_Supplement */
+
+/* 'In_Tags': Block */
+static const OnigCodePoint CR_In_Tags[] = {
+ 1,
+ 0xe0000, 0xe007f,
+}; /* CR_In_Tags */
+
+/* 'In_Variation_Selectors_Supplement': Block */
+static const OnigCodePoint CR_In_Variation_Selectors_Supplement[] = {
+ 1,
0xe0100, 0xe01ef,
-}; /* CR_Word */
+}; /* CR_In_Variation_Selectors_Supplement */
-/* 'Alnum': [[:Alnum:]] */
-static const OnigCodePoint CR_Alnum[] = {
- 509,
- 0x0030, 0x0039,
- 0x0041, 0x005a,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x02c1,
- 0x02c6, 0x02d1,
- 0x02e0, 0x02e4,
- 0x02ec, 0x02ec,
- 0x02ee, 0x02ee,
- 0x0345, 0x0345,
- 0x0370, 0x0374,
- 0x0376, 0x0377,
- 0x037a, 0x037d,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03f5,
- 0x03f7, 0x0481,
- 0x048a, 0x0527,
- 0x0531, 0x0556,
- 0x0559, 0x0559,
- 0x0561, 0x0587,
- 0x05b0, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f2,
- 0x0610, 0x061a,
- 0x0620, 0x0657,
- 0x0659, 0x0669,
- 0x066e, 0x06d3,
- 0x06d5, 0x06dc,
- 0x06e1, 0x06e8,
- 0x06ed, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x073f,
- 0x074d, 0x07b1,
- 0x07c0, 0x07ea,
- 0x07f4, 0x07f5,
- 0x07fa, 0x07fa,
- 0x0800, 0x0817,
- 0x081a, 0x082c,
- 0x0840, 0x0858,
- 0x0900, 0x093b,
- 0x093d, 0x094c,
- 0x094e, 0x0950,
- 0x0955, 0x0963,
- 0x0966, 0x096f,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bd, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09cc,
- 0x09ce, 0x09ce,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09e6, 0x09f1,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4c,
- 0x0a51, 0x0a51,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a75,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abd, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acc,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3d, 0x0b44,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4c,
- 0x0b56, 0x0b57,
- 0x0b5c, 0x0b5d,
- 0x0b5f, 0x0b63,
- 0x0b66, 0x0b6f,
- 0x0b71, 0x0b71,
- 0x0b82, 0x0b83,
- 0x0b85, 0x0b8a,
- 0x0b8e, 0x0b90,
- 0x0b92, 0x0b95,
- 0x0b99, 0x0b9a,
- 0x0b9c, 0x0b9c,
- 0x0b9e, 0x0b9f,
- 0x0ba3, 0x0ba4,
- 0x0ba8, 0x0baa,
- 0x0bae, 0x0bb9,
- 0x0bbe, 0x0bc2,
- 0x0bc6, 0x0bc8,
- 0x0bca, 0x0bcc,
- 0x0bd0, 0x0bd0,
- 0x0bd7, 0x0bd7,
- 0x0be6, 0x0bef,
- 0x0c01, 0x0c03,
- 0x0c05, 0x0c0c,
- 0x0c0e, 0x0c10,
- 0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
- 0x0c3d, 0x0c44,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4c,
- 0x0c55, 0x0c56,
- 0x0c58, 0x0c59,
- 0x0c60, 0x0c63,
- 0x0c66, 0x0c6f,
- 0x0c82, 0x0c83,
- 0x0c85, 0x0c8c,
- 0x0c8e, 0x0c90,
- 0x0c92, 0x0ca8,
- 0x0caa, 0x0cb3,
- 0x0cb5, 0x0cb9,
- 0x0cbd, 0x0cc4,
- 0x0cc6, 0x0cc8,
- 0x0cca, 0x0ccc,
- 0x0cd5, 0x0cd6,
- 0x0cde, 0x0cde,
- 0x0ce0, 0x0ce3,
- 0x0ce6, 0x0cef,
- 0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d3a,
- 0x0d3d, 0x0d44,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4c,
- 0x0d4e, 0x0d4e,
- 0x0d57, 0x0d57,
- 0x0d60, 0x0d63,
- 0x0d66, 0x0d6f,
- 0x0d7a, 0x0d7f,
- 0x0d82, 0x0d83,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df3,
- 0x0e01, 0x0e3a,
- 0x0e40, 0x0e46,
- 0x0e4d, 0x0e4d,
- 0x0e50, 0x0e59,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ecd, 0x0ecd,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f00,
- 0x0f20, 0x0f29,
- 0x0f40, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f71, 0x0f81,
- 0x0f88, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x1000, 0x1036,
- 0x1038, 0x1038,
- 0x103b, 0x1049,
- 0x1050, 0x1062,
- 0x1065, 0x1068,
- 0x106e, 0x1086,
- 0x108e, 0x108e,
- 0x1090, 0x1099,
- 0x109c, 0x109d,
- 0x10a0, 0x10c5,
- 0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135f, 0x135f,
- 0x1380, 0x138f,
- 0x13a0, 0x13f4,
- 0x1401, 0x166c,
- 0x166f, 0x167f,
- 0x1681, 0x169a,
- 0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
- 0x1700, 0x170c,
- 0x170e, 0x1713,
- 0x1720, 0x1733,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17b3,
- 0x17b6, 0x17c8,
- 0x17d7, 0x17d7,
- 0x17dc, 0x17dc,
- 0x17e0, 0x17e9,
- 0x1810, 0x1819,
- 0x1820, 0x1877,
- 0x1880, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191c,
- 0x1920, 0x192b,
- 0x1930, 0x1938,
- 0x1946, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x19d0, 0x19d9,
- 0x1a00, 0x1a1b,
- 0x1a20, 0x1a5e,
- 0x1a61, 0x1a74,
- 0x1a80, 0x1a89,
- 0x1a90, 0x1a99,
- 0x1aa7, 0x1aa7,
- 0x1b00, 0x1b33,
- 0x1b35, 0x1b43,
- 0x1b45, 0x1b4b,
- 0x1b50, 0x1b59,
- 0x1b80, 0x1ba9,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1be5,
- 0x1be7, 0x1bf1,
- 0x1c00, 0x1c35,
- 0x1c40, 0x1c49,
- 0x1c4d, 0x1c7d,
- 0x1ce9, 0x1cec,
- 0x1cee, 0x1cf2,
- 0x1d00, 0x1dbf,
- 0x1e00, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fbc,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fcc,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fe0, 0x1fec,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffc,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x209c,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x212f, 0x2139,
- 0x213c, 0x213f,
- 0x2145, 0x2149,
- 0x214e, 0x214e,
- 0x2160, 0x2188,
- 0x24b6, 0x24e9,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2ce4,
- 0x2ceb, 0x2cee,
- 0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
- 0x2d6f, 0x2d6f,
- 0x2d80, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2de0, 0x2dff,
- 0x2e2f, 0x2e2f,
- 0x3005, 0x3007,
- 0x3021, 0x3029,
- 0x3031, 0x3035,
- 0x3038, 0x303c,
- 0x3041, 0x3096,
- 0x309d, 0x309f,
- 0x30a1, 0x30fa,
- 0x30fc, 0x30ff,
- 0x3105, 0x312d,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa62b,
- 0xa640, 0xa66e,
- 0xa67f, 0xa697,
- 0xa6a0, 0xa6ef,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa801,
- 0xa803, 0xa805,
- 0xa807, 0xa80a,
- 0xa80c, 0xa827,
- 0xa840, 0xa873,
- 0xa880, 0xa8c3,
- 0xa8d0, 0xa8d9,
- 0xa8f2, 0xa8f7,
- 0xa8fb, 0xa8fb,
- 0xa900, 0xa92a,
- 0xa930, 0xa952,
- 0xa960, 0xa97c,
- 0xa980, 0xa9b2,
- 0xa9b4, 0xa9bf,
- 0xa9cf, 0xa9d9,
- 0xaa00, 0xaa36,
- 0xaa40, 0xaa4d,
- 0xaa50, 0xaa59,
- 0xaa60, 0xaa76,
- 0xaa7a, 0xaa7a,
- 0xaa80, 0xaabe,
- 0xaac0, 0xaac0,
- 0xaac2, 0xaac2,
- 0xaadb, 0xaadd,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xabc0, 0xabea,
- 0xabf0, 0xabf9,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb28,
- 0xfb2a, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3d,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfb,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xff10, 0xff19,
- 0xff21, 0xff3a,
- 0xff41, 0xff5a,
- 0xff66, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10140, 0x10174,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x10300, 0x1031e,
- 0x10330, 0x1034a,
- 0x10380, 0x1039d,
- 0x103a0, 0x103c3,
- 0x103c8, 0x103cf,
- 0x103d1, 0x103d5,
- 0x10400, 0x1049d,
- 0x104a0, 0x104a9,
- 0x10800, 0x10805,
- 0x10808, 0x10808,
- 0x1080a, 0x10835,
- 0x10837, 0x10838,
- 0x1083c, 0x1083c,
- 0x1083f, 0x10855,
- 0x10900, 0x10915,
- 0x10920, 0x10939,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x10a60, 0x10a7c,
- 0x10b00, 0x10b35,
- 0x10b40, 0x10b55,
- 0x10b60, 0x10b72,
- 0x10c00, 0x10c48,
- 0x11000, 0x11045,
- 0x11066, 0x1106f,
- 0x11082, 0x110b8,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x13000, 0x1342e,
- 0x16800, 0x16a38,
- 0x1b000, 0x1b001,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d6c0,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6fa,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d734,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d76e,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d7a8,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7cb,
- 0x1d7ce, 0x1d7ff,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2f800, 0x2fa1d,
-}; /* CR_Alnum */
+/* 'In_Supplementary_Private_Use_Area_A': Block */
+static const OnigCodePoint CR_In_Supplementary_Private_Use_Area_A[] = {
+ 1,
+ 0xf0000, 0xfffff,
+}; /* CR_In_Supplementary_Private_Use_Area_A */
-/* 'ASCII': [[:ASCII:]] */
-static const OnigCodePoint CR_ASCII[] = {
+/* 'In_Supplementary_Private_Use_Area_B': Block */
+static const OnigCodePoint CR_In_Supplementary_Private_Use_Area_B[] = {
1,
- 0x0000, 0x007f,
-}; /* CR_ASCII */
+ 0x100000, 0x10ffff,
+}; /* CR_In_Supplementary_Private_Use_Area_B */
+
+/* 'In_No_Block': Block */
+static const OnigCodePoint CR_In_No_Block[] = {
+ 36,
+ 0x0860, 0x089f,
+ 0x1ab0, 0x1aff,
+ 0x1c80, 0x1cbf,
+ 0x2fe0, 0x2fef,
+ 0xa9e0, 0xa9ff,
+ 0xab30, 0xabbf,
+ 0x10200, 0x1027f,
+ 0x102e0, 0x102ff,
+ 0x10350, 0x1037f,
+ 0x103e0, 0x103ff,
+ 0x104b0, 0x107ff,
+ 0x10860, 0x108ff,
+ 0x10940, 0x1097f,
+ 0x10a80, 0x10aff,
+ 0x10b80, 0x10bff,
+ 0x10c50, 0x10e5f,
+ 0x10e80, 0x10fff,
+ 0x11150, 0x1117f,
+ 0x111e0, 0x1167f,
+ 0x116d0, 0x11fff,
+ 0x12480, 0x12fff,
+ 0x13430, 0x167ff,
+ 0x16a40, 0x16eff,
+ 0x16fa0, 0x1afff,
+ 0x1b100, 0x1cfff,
+ 0x1d250, 0x1d2ff,
+ 0x1d380, 0x1d3ff,
+ 0x1d800, 0x1edff,
+ 0x1ef00, 0x1efff,
+ 0x1f650, 0x1f67f,
+ 0x1f780, 0x1ffff,
+ 0x2a6e0, 0x2a6ff,
+ 0x2b820, 0x2f7ff,
+ 0x2fa20, 0xdffff,
+ 0xe0080, 0xe00ff,
+ 0xe01f0, 0xeffff,
+}; /* CR_In_No_Block */
+#endif /* USE_UNICODE_PROPERTIES */
static const OnigCodePoint* const CodeRanges[] = {
CR_NEWLINE,
@@ -21945,6 +25484,7 @@ static const OnigCodePoint* const CodeRanges[] = {
CR_Co,
CR_Cs,
CR_L,
+ CR_LC,
CR_Ll,
CR_Lm,
CR_Lo,
@@ -22089,6 +25629,13 @@ static const OnigCodePoint* const CodeRanges[] = {
CR_Batak,
CR_Brahmi,
CR_Mandaic,
+ CR_Chakma,
+ CR_Meroitic_Cursive,
+ CR_Meroitic_Hieroglyphs,
+ CR_Miao,
+ CR_Sharada,
+ CR_Sora_Sompeng,
+ CR_Takri,
CR_White_Space,
CR_Bidi_Control,
CR_Join_Control,
@@ -22134,6 +25681,228 @@ static const OnigCodePoint* const CodeRanges[] = {
CR_Age_5_1,
CR_Age_5_2,
CR_Age_6_0,
+ CR_Age_6_1,
+ CR_In_Basic_Latin,
+ CR_In_Latin_1_Supplement,
+ CR_In_Latin_Extended_A,
+ CR_In_Latin_Extended_B,
+ CR_In_IPA_Extensions,
+ CR_In_Spacing_Modifier_Letters,
+ CR_In_Combining_Diacritical_Marks,
+ CR_In_Greek_and_Coptic,
+ CR_In_Cyrillic,
+ CR_In_Cyrillic_Supplement,
+ CR_In_Armenian,
+ CR_In_Hebrew,
+ CR_In_Arabic,
+ CR_In_Syriac,
+ CR_In_Arabic_Supplement,
+ CR_In_Thaana,
+ CR_In_NKo,
+ CR_In_Samaritan,
+ CR_In_Mandaic,
+ CR_In_Arabic_Extended_A,
+ CR_In_Devanagari,
+ CR_In_Bengali,
+ CR_In_Gurmukhi,
+ CR_In_Gujarati,
+ CR_In_Oriya,
+ CR_In_Tamil,
+ CR_In_Telugu,
+ CR_In_Kannada,
+ CR_In_Malayalam,
+ CR_In_Sinhala,
+ CR_In_Thai,
+ CR_In_Lao,
+ CR_In_Tibetan,
+ CR_In_Myanmar,
+ CR_In_Georgian,
+ CR_In_Hangul_Jamo,
+ CR_In_Ethiopic,
+ CR_In_Ethiopic_Supplement,
+ CR_In_Cherokee,
+ CR_In_Unified_Canadian_Aboriginal_Syllabics,
+ CR_In_Ogham,
+ CR_In_Runic,
+ CR_In_Tagalog,
+ CR_In_Hanunoo,
+ CR_In_Buhid,
+ CR_In_Tagbanwa,
+ CR_In_Khmer,
+ CR_In_Mongolian,
+ CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended,
+ CR_In_Limbu,
+ CR_In_Tai_Le,
+ CR_In_New_Tai_Lue,
+ CR_In_Khmer_Symbols,
+ CR_In_Buginese,
+ CR_In_Tai_Tham,
+ CR_In_Balinese,
+ CR_In_Sundanese,
+ CR_In_Batak,
+ CR_In_Lepcha,
+ CR_In_Ol_Chiki,
+ CR_In_Sundanese_Supplement,
+ CR_In_Vedic_Extensions,
+ CR_In_Phonetic_Extensions,
+ CR_In_Phonetic_Extensions_Supplement,
+ CR_In_Combining_Diacritical_Marks_Supplement,
+ CR_In_Latin_Extended_Additional,
+ CR_In_Greek_Extended,
+ CR_In_General_Punctuation,
+ CR_In_Superscripts_and_Subscripts,
+ CR_In_Currency_Symbols,
+ CR_In_Combining_Diacritical_Marks_for_Symbols,
+ CR_In_Letterlike_Symbols,
+ CR_In_Number_Forms,
+ CR_In_Arrows,
+ CR_In_Mathematical_Operators,
+ CR_In_Miscellaneous_Technical,
+ CR_In_Control_Pictures,
+ CR_In_Optical_Character_Recognition,
+ CR_In_Enclosed_Alphanumerics,
+ CR_In_Box_Drawing,
+ CR_In_Block_Elements,
+ CR_In_Geometric_Shapes,
+ CR_In_Miscellaneous_Symbols,
+ CR_In_Dingbats,
+ CR_In_Miscellaneous_Mathematical_Symbols_A,
+ CR_In_Supplemental_Arrows_A,
+ CR_In_Braille_Patterns,
+ CR_In_Supplemental_Arrows_B,
+ CR_In_Miscellaneous_Mathematical_Symbols_B,
+ CR_In_Supplemental_Mathematical_Operators,
+ CR_In_Miscellaneous_Symbols_and_Arrows,
+ CR_In_Glagolitic,
+ CR_In_Latin_Extended_C,
+ CR_In_Coptic,
+ CR_In_Georgian_Supplement,
+ CR_In_Tifinagh,
+ CR_In_Ethiopic_Extended,
+ CR_In_Cyrillic_Extended_A,
+ CR_In_Supplemental_Punctuation,
+ CR_In_CJK_Radicals_Supplement,
+ CR_In_Kangxi_Radicals,
+ CR_In_Ideographic_Description_Characters,
+ CR_In_CJK_Symbols_and_Punctuation,
+ CR_In_Hiragana,
+ CR_In_Katakana,
+ CR_In_Bopomofo,
+ CR_In_Hangul_Compatibility_Jamo,
+ CR_In_Kanbun,
+ CR_In_Bopomofo_Extended,
+ CR_In_CJK_Strokes,
+ CR_In_Katakana_Phonetic_Extensions,
+ CR_In_Enclosed_CJK_Letters_and_Months,
+ CR_In_CJK_Compatibility,
+ CR_In_CJK_Unified_Ideographs_Extension_A,
+ CR_In_Yijing_Hexagram_Symbols,
+ CR_In_CJK_Unified_Ideographs,
+ CR_In_Yi_Syllables,
+ CR_In_Yi_Radicals,
+ CR_In_Lisu,
+ CR_In_Vai,
+ CR_In_Cyrillic_Extended_B,
+ CR_In_Bamum,
+ CR_In_Modifier_Tone_Letters,
+ CR_In_Latin_Extended_D,
+ CR_In_Syloti_Nagri,
+ CR_In_Common_Indic_Number_Forms,
+ CR_In_Phags_pa,
+ CR_In_Saurashtra,
+ CR_In_Devanagari_Extended,
+ CR_In_Kayah_Li,
+ CR_In_Rejang,
+ CR_In_Hangul_Jamo_Extended_A,
+ CR_In_Javanese,
+ CR_In_Cham,
+ CR_In_Myanmar_Extended_A,
+ CR_In_Tai_Viet,
+ CR_In_Meetei_Mayek_Extensions,
+ CR_In_Ethiopic_Extended_A,
+ CR_In_Meetei_Mayek,
+ CR_In_Hangul_Syllables,
+ CR_In_Hangul_Jamo_Extended_B,
+ CR_In_High_Surrogates,
+ CR_In_High_Private_Use_Surrogates,
+ CR_In_Low_Surrogates,
+ CR_In_Private_Use_Area,
+ CR_In_CJK_Compatibility_Ideographs,
+ CR_In_Alphabetic_Presentation_Forms,
+ CR_In_Arabic_Presentation_Forms_A,
+ CR_In_Variation_Selectors,
+ CR_In_Vertical_Forms,
+ CR_In_Combining_Half_Marks,
+ CR_In_CJK_Compatibility_Forms,
+ CR_In_Small_Form_Variants,
+ CR_In_Arabic_Presentation_Forms_B,
+ CR_In_Halfwidth_and_Fullwidth_Forms,
+ CR_In_Specials,
+ CR_In_Linear_B_Syllabary,
+ CR_In_Linear_B_Ideograms,
+ CR_In_Aegean_Numbers,
+ CR_In_Ancient_Greek_Numbers,
+ CR_In_Ancient_Symbols,
+ CR_In_Phaistos_Disc,
+ CR_In_Lycian,
+ CR_In_Carian,
+ CR_In_Old_Italic,
+ CR_In_Gothic,
+ CR_In_Ugaritic,
+ CR_In_Old_Persian,
+ CR_In_Deseret,
+ CR_In_Shavian,
+ CR_In_Osmanya,
+ CR_In_Cypriot_Syllabary,
+ CR_In_Imperial_Aramaic,
+ CR_In_Phoenician,
+ CR_In_Lydian,
+ CR_In_Meroitic_Hieroglyphs,
+ CR_In_Meroitic_Cursive,
+ CR_In_Kharoshthi,
+ CR_In_Old_South_Arabian,
+ CR_In_Avestan,
+ CR_In_Inscriptional_Parthian,
+ CR_In_Inscriptional_Pahlavi,
+ CR_In_Old_Turkic,
+ CR_In_Rumi_Numeral_Symbols,
+ CR_In_Brahmi,
+ CR_In_Kaithi,
+ CR_In_Sora_Sompeng,
+ CR_In_Chakma,
+ CR_In_Sharada,
+ CR_In_Takri,
+ CR_In_Cuneiform,
+ CR_In_Cuneiform_Numbers_and_Punctuation,
+ CR_In_Egyptian_Hieroglyphs,
+ CR_In_Bamum_Supplement,
+ CR_In_Miao,
+ CR_In_Kana_Supplement,
+ CR_In_Byzantine_Musical_Symbols,
+ CR_In_Musical_Symbols,
+ CR_In_Ancient_Greek_Musical_Notation,
+ CR_In_Tai_Xuan_Jing_Symbols,
+ CR_In_Counting_Rod_Numerals,
+ CR_In_Mathematical_Alphanumeric_Symbols,
+ CR_In_Arabic_Mathematical_Alphabetic_Symbols,
+ CR_In_Mahjong_Tiles,
+ CR_In_Domino_Tiles,
+ CR_In_Playing_Cards,
+ CR_In_Enclosed_Alphanumeric_Supplement,
+ CR_In_Enclosed_Ideographic_Supplement,
+ CR_In_Miscellaneous_Symbols_And_Pictographs,
+ CR_In_Emoticons,
+ CR_In_Transport_And_Map_Symbols,
+ CR_In_Alchemical_Symbols,
+ CR_In_CJK_Unified_Ideographs_Extension_B,
+ CR_In_CJK_Unified_Ideographs_Extension_C,
+ CR_In_CJK_Unified_Ideographs_Extension_D,
+ CR_In_CJK_Compatibility_Ideographs_Supplement,
+ CR_In_Tags,
+ CR_In_Variation_Selectors_Supplement,
+ CR_In_Supplementary_Private_Use_Area_A,
+ CR_In_Supplementary_Private_Use_Area_B,
+ CR_In_No_Block,
#endif /* USE_UNICODE_PROPERTIES */
};
struct uniname2ctype_struct {
@@ -22144,7 +25913,6 @@ static const struct uniname2ctype_struct *uniname2ctype_p(const char *, unsigned
%}
struct uniname2ctype_struct;
%%
-newline, 0
alpha, 1
blank, 2
cntrl, 3
@@ -22169,225 +25937,233 @@ cn, 20
co, 21
cs, 22
l, 23
-ll, 24
-lm, 25
-lo, 26
-lt, 27
-lu, 28
-m, 29
-mc, 30
-me, 31
-mn, 32
-n, 33
-nd, 34
-nl, 35
-no, 36
-p, 37
-pc, 38
-pd, 39
-pe, 40
-pf, 41
-pi, 42
-po, 43
-ps, 44
-s, 45
-sc, 46
-sk, 47
-sm, 48
-so, 49
-z, 50
-zl, 51
-zp, 52
-zs, 53
-math, 54
-alphabetic, 55
-lowercase, 56
-uppercase, 57
-cased, 58
-caseignorable, 59
-changeswhenlowercased, 60
-changeswhenuppercased, 61
-changeswhentitlecased, 62
-changeswhencasefolded, 63
-changeswhencasemapped, 64
-idstart, 65
-idcontinue, 66
-xidstart, 67
-xidcontinue, 68
-defaultignorablecodepoint, 69
-graphemeextend, 70
-graphemebase, 71
-graphemelink, 72
-common, 73
-latin, 74
-greek, 75
-cyrillic, 76
-armenian, 77
-hebrew, 78
-arabic, 79
-syriac, 80
-thaana, 81
-devanagari, 82
-bengali, 83
-gurmukhi, 84
-gujarati, 85
-oriya, 86
-tamil, 87
-telugu, 88
-kannada, 89
-malayalam, 90
-sinhala, 91
-thai, 92
-lao, 93
-tibetan, 94
-myanmar, 95
-georgian, 96
-hangul, 97
-ethiopic, 98
-cherokee, 99
-canadianaboriginal, 100
-ogham, 101
-runic, 102
-khmer, 103
-mongolian, 104
-hiragana, 105
-katakana, 106
-bopomofo, 107
-han, 108
-yi, 109
-olditalic, 110
-gothic, 111
-deseret, 112
-inherited, 113
-tagalog, 114
-hanunoo, 115
-buhid, 116
-tagbanwa, 117
-limbu, 118
-taile, 119
-linearb, 120
-ugaritic, 121
-shavian, 122
-osmanya, 123
-cypriot, 124
-braille, 125
-buginese, 126
-coptic, 127
-newtailue, 128
-glagolitic, 129
-tifinagh, 130
-sylotinagri, 131
-oldpersian, 132
-kharoshthi, 133
-balinese, 134
-cuneiform, 135
-phoenician, 136
-phagspa, 137
-nko, 138
-sundanese, 139
-lepcha, 140
-olchiki, 141
-vai, 142
-saurashtra, 143
-kayahli, 144
-rejang, 145
-lycian, 146
-carian, 147
-lydian, 148
-cham, 149
-taitham, 150
-taiviet, 151
-avestan, 152
-egyptianhieroglyphs, 153
-samaritan, 154
-lisu, 155
-bamum, 156
-javanese, 157
-meeteimayek, 158
-imperialaramaic, 159
-oldsoutharabian, 160
-inscriptionalparthian, 161
-inscriptionalpahlavi, 162
-oldturkic, 163
-kaithi, 164
-batak, 165
-brahmi, 166
-mandaic, 167
-whitespace, 168
-bidicontrol, 169
-joincontrol, 170
-dash, 171
-hyphen, 172
-quotationmark, 173
-terminalpunctuation, 174
-othermath, 175
-hexdigit, 176
-asciihexdigit, 177
-otheralphabetic, 178
-ideographic, 179
-diacritic, 180
-extender, 181
-otherlowercase, 182
-otheruppercase, 183
-noncharactercodepoint, 184
-othergraphemeextend, 185
-idsbinaryoperator, 186
-idstrinaryoperator, 187
-radical, 188
-unifiedideograph, 189
-otherdefaultignorablecodepoint, 190
-deprecated, 191
-softdotted, 192
-logicalorderexception, 193
-otheridstart, 194
-otheridcontinue, 195
-sterm, 196
-variationselector, 197
-patternwhitespace, 198
-patternsyntax, 199
-unknown, 200
-ahex, 177
-bidic, 169
-ci, 59
-cwcf, 63
-cwcm, 64
-cwl, 60
-cwt, 62
-cwu, 61
-dep, 191
-di, 69
-dia, 180
-ext, 181
-grbase, 71
-grext, 70
-grlink, 72
-hex, 176
-idc, 66
-ideo, 179
-ids, 65
-idsb, 186
-idst, 187
-joinc, 170
-loe, 193
-nchar, 184
-oalpha, 178
-odi, 190
-ogrext, 185
-oidc, 195
-oids, 194
-olower, 182
-omath, 175
-oupper, 183
-patsyn, 199
-patws, 198
-qmark, 173
-sd, 192
-term, 174
-uideo, 189
-vs, 197
-wspace, 168
-xidc, 68
-xids, 67
+lc, 24
+ll, 25
+lm, 26
+lo, 27
+lt, 28
+lu, 29
+m, 30
+mc, 31
+me, 32
+mn, 33
+n, 34
+nd, 35
+nl, 36
+no, 37
+p, 38
+pc, 39
+pd, 40
+pe, 41
+pf, 42
+pi, 43
+po, 44
+ps, 45
+s, 46
+sc, 47
+sk, 48
+sm, 49
+so, 50
+z, 51
+zl, 52
+zp, 53
+zs, 54
+math, 55
+alphabetic, 56
+lowercase, 57
+uppercase, 58
+cased, 59
+caseignorable, 60
+changeswhenlowercased, 61
+changeswhenuppercased, 62
+changeswhentitlecased, 63
+changeswhencasefolded, 64
+changeswhencasemapped, 65
+idstart, 66
+idcontinue, 67
+xidstart, 68
+xidcontinue, 69
+defaultignorablecodepoint, 70
+graphemeextend, 71
+graphemebase, 72
+graphemelink, 73
+common, 74
+latin, 75
+greek, 76
+cyrillic, 77
+armenian, 78
+hebrew, 79
+arabic, 80
+syriac, 81
+thaana, 82
+devanagari, 83
+bengali, 84
+gurmukhi, 85
+gujarati, 86
+oriya, 87
+tamil, 88
+telugu, 89
+kannada, 90
+malayalam, 91
+sinhala, 92
+thai, 93
+lao, 94
+tibetan, 95
+myanmar, 96
+georgian, 97
+hangul, 98
+ethiopic, 99
+cherokee, 100
+canadianaboriginal, 101
+ogham, 102
+runic, 103
+khmer, 104
+mongolian, 105
+hiragana, 106
+katakana, 107
+bopomofo, 108
+han, 109
+yi, 110
+olditalic, 111
+gothic, 112
+deseret, 113
+inherited, 114
+tagalog, 115
+hanunoo, 116
+buhid, 117
+tagbanwa, 118
+limbu, 119
+taile, 120
+linearb, 121
+ugaritic, 122
+shavian, 123
+osmanya, 124
+cypriot, 125
+braille, 126
+buginese, 127
+coptic, 128
+newtailue, 129
+glagolitic, 130
+tifinagh, 131
+sylotinagri, 132
+oldpersian, 133
+kharoshthi, 134
+balinese, 135
+cuneiform, 136
+phoenician, 137
+phagspa, 138
+nko, 139
+sundanese, 140
+lepcha, 141
+olchiki, 142
+vai, 143
+saurashtra, 144
+kayahli, 145
+rejang, 146
+lycian, 147
+carian, 148
+lydian, 149
+cham, 150
+taitham, 151
+taiviet, 152
+avestan, 153
+egyptianhieroglyphs, 154
+samaritan, 155
+lisu, 156
+bamum, 157
+javanese, 158
+meeteimayek, 159
+imperialaramaic, 160
+oldsoutharabian, 161
+inscriptionalparthian, 162
+inscriptionalpahlavi, 163
+oldturkic, 164
+kaithi, 165
+batak, 166
+brahmi, 167
+mandaic, 168
+chakma, 169
+meroiticcursive, 170
+meroitichieroglyphs, 171
+miao, 172
+sharada, 173
+sorasompeng, 174
+takri, 175
+whitespace, 176
+bidicontrol, 177
+joincontrol, 178
+dash, 179
+hyphen, 180
+quotationmark, 181
+terminalpunctuation, 182
+othermath, 183
+hexdigit, 184
+asciihexdigit, 185
+otheralphabetic, 186
+ideographic, 187
+diacritic, 188
+extender, 189
+otherlowercase, 190
+otheruppercase, 191
+noncharactercodepoint, 192
+othergraphemeextend, 193
+idsbinaryoperator, 194
+idstrinaryoperator, 195
+radical, 196
+unifiedideograph, 197
+otherdefaultignorablecodepoint, 198
+deprecated, 199
+softdotted, 200
+logicalorderexception, 201
+otheridstart, 202
+otheridcontinue, 203
+sterm, 204
+variationselector, 205
+patternwhitespace, 206
+patternsyntax, 207
+unknown, 208
+ahex, 185
+bidic, 177
+ci, 60
+cwcf, 64
+cwcm, 65
+cwl, 61
+cwt, 63
+cwu, 62
+dep, 199
+di, 70
+dia, 188
+ext, 189
+grbase, 72
+grext, 71
+grlink, 73
+hex, 184
+idc, 67
+ideo, 187
+ids, 66
+idsb, 194
+idst, 195
+joinc, 178
+loe, 201
+nchar, 192
+oalpha, 186
+odi, 198
+ogrext, 193
+oidc, 203
+oids, 202
+olower, 190
+omath, 183
+oupper, 191
+patsyn, 207
+patws, 206
+qmark, 181
+sd, 200
+term, 182
+uideo, 197
+vs, 205
+wspace, 176
+xidc, 69
+xids, 68
other, 17
control, 18
format, 19
@@ -22395,143 +26171,374 @@ unassigned, 20
privateuse, 21
surrogate, 22
letter, 23
-lowercaseletter, 24
-modifierletter, 25
-otherletter, 26
-titlecaseletter, 27
-uppercaseletter, 28
-mark, 29
-spacingmark, 30
-enclosingmark, 31
-nonspacingmark, 32
-number, 33
-decimalnumber, 34
-letternumber, 35
-othernumber, 36
-punctuation, 37
-connectorpunctuation, 38
-dashpunctuation, 39
-closepunctuation, 40
-finalpunctuation, 41
-initialpunctuation, 42
-otherpunctuation, 43
-openpunctuation, 44
-symbol, 45
-currencysymbol, 46
-modifiersymbol, 47
-mathsymbol, 48
-othersymbol, 49
-separator, 50
-lineseparator, 51
-paragraphseparator, 52
-spaceseparator, 53
-arab, 79
-armi, 159
-armn, 77
-avst, 152
-bali, 134
-bamu, 156
-batk, 165
-beng, 83
-bopo, 107
-brah, 166
-brai, 125
-bugi, 126
-buhd, 116
-cans, 100
-cari, 147
-cher, 99
-copt, 127
-qaac, 127
-cprt, 124
-cyrl, 76
-deva, 82
-dsrt, 112
-egyp, 153
-ethi, 98
-geor, 96
-glag, 129
-goth, 111
-grek, 75
-gujr, 85
-guru, 84
-hang, 97
-hani, 108
-hano, 115
-hebr, 78
-hira, 105
-ital, 110
-java, 157
-kali, 144
-kana, 106
-khar, 133
-khmr, 103
-knda, 89
-kthi, 164
-lana, 150
-laoo, 93
-latn, 74
-lepc, 140
-limb, 118
-linb, 120
-lyci, 146
-lydi, 148
-mand, 167
-mlym, 90
-mong, 104
-mtei, 158
-mymr, 95
-nkoo, 138
-ogam, 101
-olck, 141
-orkh, 163
-orya, 86
-osma, 123
-phag, 137
-phli, 162
-phnx, 136
-prti, 161
-rjng, 145
-runr, 102
-samr, 154
-sarb, 160
-saur, 143
-shaw, 122
-sinh, 91
-sund, 139
-sylo, 131
-syrc, 80
-tagb, 117
-tale, 119
-talu, 128
-taml, 87
-tavt, 151
-telu, 88
-tfng, 130
-tglg, 114
-thaa, 81
-tibt, 94
-ugar, 121
-vaii, 142
-xpeo, 132
-xsux, 135
-yiii, 109
-zinh, 113
-qaai, 113
-zyyy, 73
-zzzz, 200
-age=1.1, 201
-age=2.0, 202
-age=2.1, 203
-age=3.0, 204
-age=3.1, 205
-age=3.2, 206
-age=4.0, 207
-age=4.1, 208
-age=5.0, 209
-age=5.1, 210
-age=5.2, 211
-age=6.0, 212
+casedletter, 24
+lowercaseletter, 25
+modifierletter, 26
+otherletter, 27
+titlecaseletter, 28
+uppercaseletter, 29
+mark, 30
+combiningmark, 30
+spacingmark, 31
+enclosingmark, 32
+nonspacingmark, 33
+number, 34
+decimalnumber, 35
+letternumber, 36
+othernumber, 37
+punctuation, 38
+connectorpunctuation, 39
+dashpunctuation, 40
+closepunctuation, 41
+finalpunctuation, 42
+initialpunctuation, 43
+otherpunctuation, 44
+openpunctuation, 45
+symbol, 46
+currencysymbol, 47
+modifiersymbol, 48
+mathsymbol, 49
+othersymbol, 50
+separator, 51
+lineseparator, 52
+paragraphseparator, 53
+spaceseparator, 54
+arab, 80
+armi, 160
+armn, 78
+avst, 153
+bali, 135
+bamu, 157
+batk, 166
+beng, 84
+bopo, 108
+brah, 167
+brai, 126
+bugi, 127
+buhd, 117
+cakm, 169
+cans, 101
+cari, 148
+cher, 100
+copt, 128
+qaac, 128
+cprt, 125
+cyrl, 77
+deva, 83
+dsrt, 113
+egyp, 154
+ethi, 99
+geor, 97
+glag, 130
+goth, 112
+grek, 76
+gujr, 86
+guru, 85
+hang, 98
+hani, 109
+hano, 116
+hebr, 79
+hira, 106
+ital, 111
+java, 158
+kali, 145
+kana, 107
+khar, 134
+khmr, 104
+knda, 90
+kthi, 165
+lana, 151
+laoo, 94
+latn, 75
+lepc, 141
+limb, 119
+linb, 121
+lyci, 147
+lydi, 149
+mand, 168
+merc, 170
+mero, 171
+mlym, 91
+mong, 105
+mtei, 159
+mymr, 96
+nkoo, 139
+ogam, 102
+olck, 142
+orkh, 164
+orya, 87
+osma, 124
+phag, 138
+phli, 163
+phnx, 137
+plrd, 172
+prti, 162
+rjng, 146
+runr, 103
+samr, 155
+sarb, 161
+saur, 144
+shaw, 123
+shrd, 173
+sinh, 92
+sora, 174
+sund, 140
+sylo, 132
+syrc, 81
+tagb, 118
+takr, 175
+tale, 120
+talu, 129
+taml, 88
+tavt, 152
+telu, 89
+tfng, 131
+tglg, 115
+thaa, 82
+tibt, 95
+ugar, 122
+vaii, 143
+xpeo, 133
+xsux, 136
+yiii, 110
+zinh, 114
+qaai, 114
+zyyy, 74
+zzzz, 208
+age=1.1, 209
+age=2.0, 210
+age=2.1, 211
+age=3.0, 212
+age=3.1, 213
+age=3.2, 214
+age=4.0, 215
+age=4.1, 216
+age=5.0, 217
+age=5.1, 218
+age=5.2, 219
+age=6.0, 220
+age=6.1, 221
+inbasiclatin, 222
+inlatin1supplement, 223
+inlatinextendeda, 224
+inlatinextendedb, 225
+inipaextensions, 226
+inspacingmodifierletters, 227
+incombiningdiacriticalmarks, 228
+ingreekandcoptic, 229
+incyrillic, 230
+incyrillicsupplement, 231
+inarmenian, 232
+inhebrew, 233
+inarabic, 234
+insyriac, 235
+inarabicsupplement, 236
+inthaana, 237
+innko, 238
+insamaritan, 239
+inmandaic, 240
+inarabicextendeda, 241
+indevanagari, 242
+inbengali, 243
+ingurmukhi, 244
+ingujarati, 245
+inoriya, 246
+intamil, 247
+intelugu, 248
+inkannada, 249
+inmalayalam, 250
+insinhala, 251
+inthai, 252
+inlao, 253
+intibetan, 254
+inmyanmar, 255
+ingeorgian, 256
+inhanguljamo, 257
+inethiopic, 258
+inethiopicsupplement, 259
+incherokee, 260
+inunifiedcanadianaboriginalsyllabics, 261
+inogham, 262
+inrunic, 263
+intagalog, 264
+inhanunoo, 265
+inbuhid, 266
+intagbanwa, 267
+inkhmer, 268
+inmongolian, 269
+inunifiedcanadianaboriginalsyllabicsextended, 270
+inlimbu, 271
+intaile, 272
+innewtailue, 273
+inkhmersymbols, 274
+inbuginese, 275
+intaitham, 276
+inbalinese, 277
+insundanese, 278
+inbatak, 279
+inlepcha, 280
+inolchiki, 281
+insundanesesupplement, 282
+invedicextensions, 283
+inphoneticextensions, 284
+inphoneticextensionssupplement, 285
+incombiningdiacriticalmarkssupplement, 286
+inlatinextendedadditional, 287
+ingreekextended, 288
+ingeneralpunctuation, 289
+insuperscriptsandsubscripts, 290
+incurrencysymbols, 291
+incombiningdiacriticalmarksforsymbols, 292
+inletterlikesymbols, 293
+innumberforms, 294
+inarrows, 295
+inmathematicaloperators, 296
+inmiscellaneoustechnical, 297
+incontrolpictures, 298
+inopticalcharacterrecognition, 299
+inenclosedalphanumerics, 300
+inboxdrawing, 301
+inblockelements, 302
+ingeometricshapes, 303
+inmiscellaneoussymbols, 304
+indingbats, 305
+inmiscellaneousmathematicalsymbolsa, 306
+insupplementalarrowsa, 307
+inbraillepatterns, 308
+insupplementalarrowsb, 309
+inmiscellaneousmathematicalsymbolsb, 310
+insupplementalmathematicaloperators, 311
+inmiscellaneoussymbolsandarrows, 312
+inglagolitic, 313
+inlatinextendedc, 314
+incoptic, 315
+ingeorgiansupplement, 316
+intifinagh, 317
+inethiopicextended, 318
+incyrillicextendeda, 319
+insupplementalpunctuation, 320
+incjkradicalssupplement, 321
+inkangxiradicals, 322
+inideographicdescriptioncharacters, 323
+incjksymbolsandpunctuation, 324
+inhiragana, 325
+inkatakana, 326
+inbopomofo, 327
+inhangulcompatibilityjamo, 328
+inkanbun, 329
+inbopomofoextended, 330
+incjkstrokes, 331
+inkatakanaphoneticextensions, 332
+inenclosedcjklettersandmonths, 333
+incjkcompatibility, 334
+incjkunifiedideographsextensiona, 335
+inyijinghexagramsymbols, 336
+incjkunifiedideographs, 337
+inyisyllables, 338
+inyiradicals, 339
+inlisu, 340
+invai, 341
+incyrillicextendedb, 342
+inbamum, 343
+inmodifiertoneletters, 344
+inlatinextendedd, 345
+insylotinagri, 346
+incommonindicnumberforms, 347
+inphagspa, 348
+insaurashtra, 349
+indevanagariextended, 350
+inkayahli, 351
+inrejang, 352
+inhanguljamoextendeda, 353
+injavanese, 354
+incham, 355
+inmyanmarextendeda, 356
+intaiviet, 357
+inmeeteimayekextensions, 358
+inethiopicextendeda, 359
+inmeeteimayek, 360
+inhangulsyllables, 361
+inhanguljamoextendedb, 362
+inhighsurrogates, 363
+inhighprivateusesurrogates, 364
+inlowsurrogates, 365
+inprivateusearea, 366
+incjkcompatibilityideographs, 367
+inalphabeticpresentationforms, 368
+inarabicpresentationformsa, 369
+invariationselectors, 370
+inverticalforms, 371
+incombininghalfmarks, 372
+incjkcompatibilityforms, 373
+insmallformvariants, 374
+inarabicpresentationformsb, 375
+inhalfwidthandfullwidthforms, 376
+inspecials, 377
+inlinearbsyllabary, 378
+inlinearbideograms, 379
+inaegeannumbers, 380
+inancientgreeknumbers, 381
+inancientsymbols, 382
+inphaistosdisc, 383
+inlycian, 384
+incarian, 385
+inolditalic, 386
+ingothic, 387
+inugaritic, 388
+inoldpersian, 389
+indeseret, 390
+inshavian, 391
+inosmanya, 392
+incypriotsyllabary, 393
+inimperialaramaic, 394
+inphoenician, 395
+inlydian, 396
+inmeroitichieroglyphs, 397
+inmeroiticcursive, 398
+inkharoshthi, 399
+inoldsoutharabian, 400
+inavestan, 401
+ininscriptionalparthian, 402
+ininscriptionalpahlavi, 403
+inoldturkic, 404
+inruminumeralsymbols, 405
+inbrahmi, 406
+inkaithi, 407
+insorasompeng, 408
+inchakma, 409
+insharada, 410
+intakri, 411
+incuneiform, 412
+incuneiformnumbersandpunctuation, 413
+inegyptianhieroglyphs, 414
+inbamumsupplement, 415
+inmiao, 416
+inkanasupplement, 417
+inbyzantinemusicalsymbols, 418
+inmusicalsymbols, 419
+inancientgreekmusicalnotation, 420
+intaixuanjingsymbols, 421
+incountingrodnumerals, 422
+inmathematicalalphanumericsymbols, 423
+inarabicmathematicalalphabeticsymbols, 424
+inmahjongtiles, 425
+indominotiles, 426
+inplayingcards, 427
+inenclosedalphanumericsupplement, 428
+inenclosedideographicsupplement, 429
+inmiscellaneoussymbolsandpictographs, 430
+inemoticons, 431
+intransportandmapsymbols, 432
+inalchemicalsymbols, 433
+incjkunifiedideographsextensionb, 434
+incjkunifiedideographsextensionc, 435
+incjkunifiedideographsextensiond, 436
+incjkcompatibilityideographssupplement, 437
+intags, 438
+invariationselectorssupplement, 439
+insupplementaryprivateuseareaa, 440
+insupplementaryprivateuseareab, 441
+innoblock, 442
#endif /* USE_UNICODE_PROPERTIES */
%%
static int
diff --git a/enc/unicode/name2ctype.src b/enc/unicode/name2ctype.src
index 2e27f3f7de..ff94d68b3b 100644
--- a/enc/unicode/name2ctype.src
+++ b/enc/unicode/name2ctype.src
@@ -1,6 +1,4273 @@
%{
#define long size_t
+/* 'NEWLINE': [[:NEWLINE:]] */
+static const OnigCodePoint CR_NEWLINE[] = {
+ 1,
+ 0x000a, 0x000a,
+}; /* CR_NEWLINE */
+
+/* 'Alpha': [[:Alpha:]] */
+static const OnigCodePoint CR_Alpha[] = {
+ 540,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0345, 0x0345,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05b0, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0657,
+ 0x0659, 0x065f,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06e1, 0x06e8,
+ 0x06ed, 0x06ef,
+ 0x06fa, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x073f,
+ 0x074d, 0x07b1,
+ 0x07ca, 0x07ea,
+ 0x07f4, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x0817,
+ 0x081a, 0x082c,
+ 0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08e9,
+ 0x08f0, 0x08fe,
+ 0x0900, 0x093b,
+ 0x093d, 0x094c,
+ 0x094e, 0x0950,
+ 0x0955, 0x0963,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bd, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09cc,
+ 0x09ce, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09f0, 0x09f1,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4c,
+ 0x0a51, 0x0a51,
+ 0x0a59, 0x0a5c,
+ 0x0a5e, 0x0a5e,
+ 0x0a70, 0x0a75,
+ 0x0a81, 0x0a83,
+ 0x0a85, 0x0a8d,
+ 0x0a8f, 0x0a91,
+ 0x0a93, 0x0aa8,
+ 0x0aaa, 0x0ab0,
+ 0x0ab2, 0x0ab3,
+ 0x0ab5, 0x0ab9,
+ 0x0abd, 0x0ac5,
+ 0x0ac7, 0x0ac9,
+ 0x0acb, 0x0acc,
+ 0x0ad0, 0x0ad0,
+ 0x0ae0, 0x0ae3,
+ 0x0b01, 0x0b03,
+ 0x0b05, 0x0b0c,
+ 0x0b0f, 0x0b10,
+ 0x0b13, 0x0b28,
+ 0x0b2a, 0x0b30,
+ 0x0b32, 0x0b33,
+ 0x0b35, 0x0b39,
+ 0x0b3d, 0x0b44,
+ 0x0b47, 0x0b48,
+ 0x0b4b, 0x0b4c,
+ 0x0b56, 0x0b57,
+ 0x0b5c, 0x0b5d,
+ 0x0b5f, 0x0b63,
+ 0x0b71, 0x0b71,
+ 0x0b82, 0x0b83,
+ 0x0b85, 0x0b8a,
+ 0x0b8e, 0x0b90,
+ 0x0b92, 0x0b95,
+ 0x0b99, 0x0b9a,
+ 0x0b9c, 0x0b9c,
+ 0x0b9e, 0x0b9f,
+ 0x0ba3, 0x0ba4,
+ 0x0ba8, 0x0baa,
+ 0x0bae, 0x0bb9,
+ 0x0bbe, 0x0bc2,
+ 0x0bc6, 0x0bc8,
+ 0x0bca, 0x0bcc,
+ 0x0bd0, 0x0bd0,
+ 0x0bd7, 0x0bd7,
+ 0x0c01, 0x0c03,
+ 0x0c05, 0x0c0c,
+ 0x0c0e, 0x0c10,
+ 0x0c12, 0x0c28,
+ 0x0c2a, 0x0c33,
+ 0x0c35, 0x0c39,
+ 0x0c3d, 0x0c44,
+ 0x0c46, 0x0c48,
+ 0x0c4a, 0x0c4c,
+ 0x0c55, 0x0c56,
+ 0x0c58, 0x0c59,
+ 0x0c60, 0x0c63,
+ 0x0c82, 0x0c83,
+ 0x0c85, 0x0c8c,
+ 0x0c8e, 0x0c90,
+ 0x0c92, 0x0ca8,
+ 0x0caa, 0x0cb3,
+ 0x0cb5, 0x0cb9,
+ 0x0cbd, 0x0cc4,
+ 0x0cc6, 0x0cc8,
+ 0x0cca, 0x0ccc,
+ 0x0cd5, 0x0cd6,
+ 0x0cde, 0x0cde,
+ 0x0ce0, 0x0ce3,
+ 0x0cf1, 0x0cf2,
+ 0x0d02, 0x0d03,
+ 0x0d05, 0x0d0c,
+ 0x0d0e, 0x0d10,
+ 0x0d12, 0x0d3a,
+ 0x0d3d, 0x0d44,
+ 0x0d46, 0x0d48,
+ 0x0d4a, 0x0d4c,
+ 0x0d4e, 0x0d4e,
+ 0x0d57, 0x0d57,
+ 0x0d60, 0x0d63,
+ 0x0d7a, 0x0d7f,
+ 0x0d82, 0x0d83,
+ 0x0d85, 0x0d96,
+ 0x0d9a, 0x0db1,
+ 0x0db3, 0x0dbb,
+ 0x0dbd, 0x0dbd,
+ 0x0dc0, 0x0dc6,
+ 0x0dcf, 0x0dd4,
+ 0x0dd6, 0x0dd6,
+ 0x0dd8, 0x0ddf,
+ 0x0df2, 0x0df3,
+ 0x0e01, 0x0e3a,
+ 0x0e40, 0x0e46,
+ 0x0e4d, 0x0e4d,
+ 0x0e81, 0x0e82,
+ 0x0e84, 0x0e84,
+ 0x0e87, 0x0e88,
+ 0x0e8a, 0x0e8a,
+ 0x0e8d, 0x0e8d,
+ 0x0e94, 0x0e97,
+ 0x0e99, 0x0e9f,
+ 0x0ea1, 0x0ea3,
+ 0x0ea5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ecd, 0x0ecd,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f00,
+ 0x0f40, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f81,
+ 0x0f88, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x1000, 0x1036,
+ 0x1038, 0x1038,
+ 0x103b, 0x103f,
+ 0x1050, 0x1062,
+ 0x1065, 0x1068,
+ 0x106e, 0x1086,
+ 0x108e, 0x108e,
+ 0x109c, 0x109d,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135f, 0x135f,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1713,
+ 0x1720, 0x1733,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17b3,
+ 0x17b6, 0x17c8,
+ 0x17d7, 0x17d7,
+ 0x17dc, 0x17dc,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x1938,
+ 0x1950, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x1a00, 0x1a1b,
+ 0x1a20, 0x1a5e,
+ 0x1a61, 0x1a74,
+ 0x1aa7, 0x1aa7,
+ 0x1b00, 0x1b33,
+ 0x1b35, 0x1b43,
+ 0x1b45, 0x1b4b,
+ 0x1b80, 0x1ba9,
+ 0x1bac, 0x1baf,
+ 0x1bba, 0x1be5,
+ 0x1be7, 0x1bf1,
+ 0x1c00, 0x1c35,
+ 0x1c4d, 0x1c4f,
+ 0x1c5a, 0x1c7d,
+ 0x1ce9, 0x1cec,
+ 0x1cee, 0x1cf3,
+ 0x1cf5, 0x1cf6,
+ 0x1d00, 0x1dbf,
+ 0x1e00, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fbc,
+ 0x1fbe, 0x1fbe,
+ 0x1fc2, 0x1fc4,
+ 0x1fc6, 0x1fcc,
+ 0x1fd0, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fe0, 0x1fec,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffc,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210a, 0x2113,
+ 0x2115, 0x2115,
+ 0x2119, 0x211d,
+ 0x2124, 0x2124,
+ 0x2126, 0x2126,
+ 0x2128, 0x2128,
+ 0x212a, 0x212d,
+ 0x212f, 0x2139,
+ 0x213c, 0x213f,
+ 0x2145, 0x2149,
+ 0x214e, 0x214e,
+ 0x2160, 0x2188,
+ 0x24b6, 0x24e9,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2ce4,
+ 0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
+ 0x2d6f, 0x2d6f,
+ 0x2d80, 0x2d96,
+ 0x2da0, 0x2da6,
+ 0x2da8, 0x2dae,
+ 0x2db0, 0x2db6,
+ 0x2db8, 0x2dbe,
+ 0x2dc0, 0x2dc6,
+ 0x2dc8, 0x2dce,
+ 0x2dd0, 0x2dd6,
+ 0x2dd8, 0x2dde,
+ 0x2de0, 0x2dff,
+ 0x2e2f, 0x2e2f,
+ 0x3005, 0x3007,
+ 0x3021, 0x3029,
+ 0x3031, 0x3035,
+ 0x3038, 0x303c,
+ 0x3041, 0x3096,
+ 0x309d, 0x309f,
+ 0x30a1, 0x30fa,
+ 0x30fc, 0x30ff,
+ 0x3105, 0x312d,
+ 0x3131, 0x318e,
+ 0x31a0, 0x31ba,
+ 0x31f0, 0x31ff,
+ 0x3400, 0x4db5,
+ 0x4e00, 0x9fcc,
+ 0xa000, 0xa48c,
+ 0xa4d0, 0xa4fd,
+ 0xa500, 0xa60c,
+ 0xa610, 0xa61f,
+ 0xa62a, 0xa62b,
+ 0xa640, 0xa66e,
+ 0xa674, 0xa67b,
+ 0xa67f, 0xa697,
+ 0xa69f, 0xa6ef,
+ 0xa717, 0xa71f,
+ 0xa722, 0xa788,
+ 0xa78b, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa801,
+ 0xa803, 0xa805,
+ 0xa807, 0xa80a,
+ 0xa80c, 0xa827,
+ 0xa840, 0xa873,
+ 0xa880, 0xa8c3,
+ 0xa8f2, 0xa8f7,
+ 0xa8fb, 0xa8fb,
+ 0xa90a, 0xa92a,
+ 0xa930, 0xa952,
+ 0xa960, 0xa97c,
+ 0xa980, 0xa9b2,
+ 0xa9b4, 0xa9bf,
+ 0xa9cf, 0xa9cf,
+ 0xaa00, 0xaa36,
+ 0xaa40, 0xaa4d,
+ 0xaa60, 0xaa76,
+ 0xaa7a, 0xaa7a,
+ 0xaa80, 0xaabe,
+ 0xaac0, 0xaac0,
+ 0xaac2, 0xaac2,
+ 0xaadb, 0xaadd,
+ 0xaae0, 0xaaef,
+ 0xaaf2, 0xaaf5,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabea,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb28,
+ 0xfb2a, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11045,
+ 0x11082, 0x110b8,
+ 0x110d0, 0x110e8,
+ 0x11100, 0x11132,
+ 0x11180, 0x111bf,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116b5,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f93, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Alpha */
+
+/* 'Blank': [[:Blank:]] */
+static const OnigCodePoint CR_Blank[] = {
+ 9,
+ 0x0009, 0x0009,
+ 0x0020, 0x0020,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x180e, 0x180e,
+ 0x2000, 0x200a,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Blank */
+
+/* 'Cntrl': [[:Cntrl:]] */
+static const OnigCodePoint CR_Cntrl[] = {
+ 2,
+ 0x0000, 0x001f,
+ 0x007f, 0x009f,
+}; /* CR_Cntrl */
+
+/* 'Digit': [[:Digit:]] */
+static const OnigCodePoint CR_Digit[] = {
+ 42,
+ 0x0030, 0x0039,
+ 0x0660, 0x0669,
+ 0x06f0, 0x06f9,
+ 0x07c0, 0x07c9,
+ 0x0966, 0x096f,
+ 0x09e6, 0x09ef,
+ 0x0a66, 0x0a6f,
+ 0x0ae6, 0x0aef,
+ 0x0b66, 0x0b6f,
+ 0x0be6, 0x0bef,
+ 0x0c66, 0x0c6f,
+ 0x0ce6, 0x0cef,
+ 0x0d66, 0x0d6f,
+ 0x0e50, 0x0e59,
+ 0x0ed0, 0x0ed9,
+ 0x0f20, 0x0f29,
+ 0x1040, 0x1049,
+ 0x1090, 0x1099,
+ 0x17e0, 0x17e9,
+ 0x1810, 0x1819,
+ 0x1946, 0x194f,
+ 0x19d0, 0x19d9,
+ 0x1a80, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1b50, 0x1b59,
+ 0x1bb0, 0x1bb9,
+ 0x1c40, 0x1c49,
+ 0x1c50, 0x1c59,
+ 0xa620, 0xa629,
+ 0xa8d0, 0xa8d9,
+ 0xa900, 0xa909,
+ 0xa9d0, 0xa9d9,
+ 0xaa50, 0xaa59,
+ 0xabf0, 0xabf9,
+ 0xff10, 0xff19,
+ 0x104a0, 0x104a9,
+ 0x11066, 0x1106f,
+ 0x110f0, 0x110f9,
+ 0x11136, 0x1113f,
+ 0x111d0, 0x111d9,
+ 0x116c0, 0x116c9,
+ 0x1d7ce, 0x1d7ff,
+}; /* CR_Digit */
+
+/* 'Graph': [[:Graph:]] */
+static const OnigCodePoint CR_Graph[] = {
+ 544,
+ 0x0021, 0x007e,
+ 0x00a1, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x058f, 0x058f,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0604,
+ 0x0606, 0x061b,
+ 0x061e, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09fb,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3c, 0x0a3c,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4d,
+ 0x0a51, 0x0a51,
+ 0x0a59, 0x0a5c,
+ 0x0a5e, 0x0a5e,
+ 0x0a66, 0x0a75,
+ 0x0a81, 0x0a83,
+ 0x0a85, 0x0a8d,
+ 0x0a8f, 0x0a91,
+ 0x0a93, 0x0aa8,
+ 0x0aaa, 0x0ab0,
+ 0x0ab2, 0x0ab3,
+ 0x0ab5, 0x0ab9,
+ 0x0abc, 0x0ac5,
+ 0x0ac7, 0x0ac9,
+ 0x0acb, 0x0acd,
+ 0x0ad0, 0x0ad0,
+ 0x0ae0, 0x0ae3,
+ 0x0ae6, 0x0af1,
+ 0x0b01, 0x0b03,
+ 0x0b05, 0x0b0c,
+ 0x0b0f, 0x0b10,
+ 0x0b13, 0x0b28,
+ 0x0b2a, 0x0b30,
+ 0x0b32, 0x0b33,
+ 0x0b35, 0x0b39,
+ 0x0b3c, 0x0b44,
+ 0x0b47, 0x0b48,
+ 0x0b4b, 0x0b4d,
+ 0x0b56, 0x0b57,
+ 0x0b5c, 0x0b5d,
+ 0x0b5f, 0x0b63,
+ 0x0b66, 0x0b77,
+ 0x0b82, 0x0b83,
+ 0x0b85, 0x0b8a,
+ 0x0b8e, 0x0b90,
+ 0x0b92, 0x0b95,
+ 0x0b99, 0x0b9a,
+ 0x0b9c, 0x0b9c,
+ 0x0b9e, 0x0b9f,
+ 0x0ba3, 0x0ba4,
+ 0x0ba8, 0x0baa,
+ 0x0bae, 0x0bb9,
+ 0x0bbe, 0x0bc2,
+ 0x0bc6, 0x0bc8,
+ 0x0bca, 0x0bcd,
+ 0x0bd0, 0x0bd0,
+ 0x0bd7, 0x0bd7,
+ 0x0be6, 0x0bfa,
+ 0x0c01, 0x0c03,
+ 0x0c05, 0x0c0c,
+ 0x0c0e, 0x0c10,
+ 0x0c12, 0x0c28,
+ 0x0c2a, 0x0c33,
+ 0x0c35, 0x0c39,
+ 0x0c3d, 0x0c44,
+ 0x0c46, 0x0c48,
+ 0x0c4a, 0x0c4d,
+ 0x0c55, 0x0c56,
+ 0x0c58, 0x0c59,
+ 0x0c60, 0x0c63,
+ 0x0c66, 0x0c6f,
+ 0x0c78, 0x0c7f,
+ 0x0c82, 0x0c83,
+ 0x0c85, 0x0c8c,
+ 0x0c8e, 0x0c90,
+ 0x0c92, 0x0ca8,
+ 0x0caa, 0x0cb3,
+ 0x0cb5, 0x0cb9,
+ 0x0cbc, 0x0cc4,
+ 0x0cc6, 0x0cc8,
+ 0x0cca, 0x0ccd,
+ 0x0cd5, 0x0cd6,
+ 0x0cde, 0x0cde,
+ 0x0ce0, 0x0ce3,
+ 0x0ce6, 0x0cef,
+ 0x0cf1, 0x0cf2,
+ 0x0d02, 0x0d03,
+ 0x0d05, 0x0d0c,
+ 0x0d0e, 0x0d10,
+ 0x0d12, 0x0d3a,
+ 0x0d3d, 0x0d44,
+ 0x0d46, 0x0d48,
+ 0x0d4a, 0x0d4e,
+ 0x0d57, 0x0d57,
+ 0x0d60, 0x0d63,
+ 0x0d66, 0x0d75,
+ 0x0d79, 0x0d7f,
+ 0x0d82, 0x0d83,
+ 0x0d85, 0x0d96,
+ 0x0d9a, 0x0db1,
+ 0x0db3, 0x0dbb,
+ 0x0dbd, 0x0dbd,
+ 0x0dc0, 0x0dc6,
+ 0x0dca, 0x0dca,
+ 0x0dcf, 0x0dd4,
+ 0x0dd6, 0x0dd6,
+ 0x0dd8, 0x0ddf,
+ 0x0df2, 0x0df4,
+ 0x0e01, 0x0e3a,
+ 0x0e3f, 0x0e5b,
+ 0x0e81, 0x0e82,
+ 0x0e84, 0x0e84,
+ 0x0e87, 0x0e88,
+ 0x0e8a, 0x0e8a,
+ 0x0e8d, 0x0e8d,
+ 0x0e94, 0x0e97,
+ 0x0e99, 0x0e9f,
+ 0x0ea1, 0x0ea3,
+ 0x0ea5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ec8, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fbe, 0x0fcc,
+ 0x0fce, 0x0fda,
+ 0x1000, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135d, 0x137c,
+ 0x1380, 0x1399,
+ 0x13a0, 0x13f4,
+ 0x1400, 0x167f,
+ 0x1681, 0x169c,
+ 0x16a0, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+ 0x1720, 0x1736,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17dd,
+ 0x17e0, 0x17e9,
+ 0x17f0, 0x17f9,
+ 0x1800, 0x180d,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1940, 0x1940,
+ 0x1944, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19da,
+ 0x19de, 0x1a1b,
+ 0x1a1e, 0x1a5e,
+ 0x1a60, 0x1a7c,
+ 0x1a7f, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa0, 0x1aad,
+ 0x1b00, 0x1b4b,
+ 0x1b50, 0x1b7c,
+ 0x1b80, 0x1bf3,
+ 0x1bfc, 0x1c37,
+ 0x1c3b, 0x1c49,
+ 0x1c4d, 0x1c7f,
+ 0x1cc0, 0x1cc7,
+ 0x1cd0, 0x1cf6,
+ 0x1d00, 0x1de6,
+ 0x1dfc, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fc4,
+ 0x1fc6, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fdd, 0x1fef,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffe,
+ 0x200b, 0x2027,
+ 0x202a, 0x202e,
+ 0x2030, 0x205e,
+ 0x2060, 0x2064,
+ 0x206a, 0x2071,
+ 0x2074, 0x208e,
+ 0x2090, 0x209c,
+ 0x20a0, 0x20b9,
+ 0x20d0, 0x20f0,
+ 0x2100, 0x2189,
+ 0x2190, 0x23f3,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x2460, 0x26ff,
+ 0x2701, 0x2b4c,
+ 0x2b50, 0x2b59,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2cf3,
+ 0x2cf9, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
+ 0x2d6f, 0x2d70,
+ 0x2d7f, 0x2d96,
+ 0x2da0, 0x2da6,
+ 0x2da8, 0x2dae,
+ 0x2db0, 0x2db6,
+ 0x2db8, 0x2dbe,
+ 0x2dc0, 0x2dc6,
+ 0x2dc8, 0x2dce,
+ 0x2dd0, 0x2dd6,
+ 0x2dd8, 0x2dde,
+ 0x2de0, 0x2e3b,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+ 0x2ff0, 0x2ffb,
+ 0x3001, 0x303f,
+ 0x3041, 0x3096,
+ 0x3099, 0x30ff,
+ 0x3105, 0x312d,
+ 0x3131, 0x318e,
+ 0x3190, 0x31ba,
+ 0x31c0, 0x31e3,
+ 0x31f0, 0x321e,
+ 0x3220, 0x32fe,
+ 0x3300, 0x4db5,
+ 0x4dc0, 0x9fcc,
+ 0xa000, 0xa48c,
+ 0xa490, 0xa4c6,
+ 0xa4d0, 0xa62b,
+ 0xa640, 0xa697,
+ 0xa69f, 0xa6f7,
+ 0xa700, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa82b,
+ 0xa830, 0xa839,
+ 0xa840, 0xa877,
+ 0xa880, 0xa8c4,
+ 0xa8ce, 0xa8d9,
+ 0xa8e0, 0xa8fb,
+ 0xa900, 0xa953,
+ 0xa95f, 0xa97c,
+ 0xa980, 0xa9cd,
+ 0xa9cf, 0xa9d9,
+ 0xa9de, 0xa9df,
+ 0xaa00, 0xaa36,
+ 0xaa40, 0xaa4d,
+ 0xaa50, 0xaa59,
+ 0xaa5c, 0xaa7b,
+ 0xaa80, 0xaac2,
+ 0xaadb, 0xaaf6,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabed,
+ 0xabf0, 0xabf9,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xe000, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbc1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfd,
+ 0xfe00, 0xfe19,
+ 0xfe20, 0xfe26,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xfeff, 0xfeff,
+ 0xff01, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfff9, 0xfffd,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1018a,
+ 0x10190, 0x1019b,
+ 0x101d0, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x103c3,
+ 0x103c8, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10857, 0x1085f,
+ 0x10900, 0x1091b,
+ 0x1091f, 0x10939,
+ 0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x10a60, 0x10a7f,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b7f,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x11080, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d1dd,
+ 0x1d200, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1d360, 0x1d371,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
+ 0x1f000, 0x1f02b,
+ 0x1f030, 0x1f093,
+ 0x1f0a0, 0x1f0ae,
+ 0x1f0b1, 0x1f0be,
+ 0x1f0c1, 0x1f0cf,
+ 0x1f0d1, 0x1f0df,
+ 0x1f100, 0x1f10a,
+ 0x1f110, 0x1f12e,
+ 0x1f130, 0x1f16b,
+ 0x1f170, 0x1f19a,
+ 0x1f1e6, 0x1f202,
+ 0x1f210, 0x1f23a,
+ 0x1f240, 0x1f248,
+ 0x1f250, 0x1f251,
+ 0x1f300, 0x1f320,
+ 0x1f330, 0x1f335,
+ 0x1f337, 0x1f37c,
+ 0x1f380, 0x1f393,
+ 0x1f3a0, 0x1f3c4,
+ 0x1f3c6, 0x1f3ca,
+ 0x1f3e0, 0x1f3f0,
+ 0x1f400, 0x1f43e,
+ 0x1f440, 0x1f440,
+ 0x1f442, 0x1f4f7,
+ 0x1f4f9, 0x1f4fc,
+ 0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
+ 0x1f550, 0x1f567,
+ 0x1f5fb, 0x1f640,
+ 0x1f645, 0x1f64f,
+ 0x1f680, 0x1f6c5,
+ 0x1f700, 0x1f773,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+ 0xf0000, 0xffffd,
+ 0x100000, 0x10fffd,
+}; /* CR_Graph */
+
+/* 'Lower': [[:Lower:]] */
+static const OnigCodePoint CR_Lower[] = {
+ 618,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00df, 0x00f6,
+ 0x00f8, 0x00ff,
+ 0x0101, 0x0101,
+ 0x0103, 0x0103,
+ 0x0105, 0x0105,
+ 0x0107, 0x0107,
+ 0x0109, 0x0109,
+ 0x010b, 0x010b,
+ 0x010d, 0x010d,
+ 0x010f, 0x010f,
+ 0x0111, 0x0111,
+ 0x0113, 0x0113,
+ 0x0115, 0x0115,
+ 0x0117, 0x0117,
+ 0x0119, 0x0119,
+ 0x011b, 0x011b,
+ 0x011d, 0x011d,
+ 0x011f, 0x011f,
+ 0x0121, 0x0121,
+ 0x0123, 0x0123,
+ 0x0125, 0x0125,
+ 0x0127, 0x0127,
+ 0x0129, 0x0129,
+ 0x012b, 0x012b,
+ 0x012d, 0x012d,
+ 0x012f, 0x012f,
+ 0x0131, 0x0131,
+ 0x0133, 0x0133,
+ 0x0135, 0x0135,
+ 0x0137, 0x0138,
+ 0x013a, 0x013a,
+ 0x013c, 0x013c,
+ 0x013e, 0x013e,
+ 0x0140, 0x0140,
+ 0x0142, 0x0142,
+ 0x0144, 0x0144,
+ 0x0146, 0x0146,
+ 0x0148, 0x0149,
+ 0x014b, 0x014b,
+ 0x014d, 0x014d,
+ 0x014f, 0x014f,
+ 0x0151, 0x0151,
+ 0x0153, 0x0153,
+ 0x0155, 0x0155,
+ 0x0157, 0x0157,
+ 0x0159, 0x0159,
+ 0x015b, 0x015b,
+ 0x015d, 0x015d,
+ 0x015f, 0x015f,
+ 0x0161, 0x0161,
+ 0x0163, 0x0163,
+ 0x0165, 0x0165,
+ 0x0167, 0x0167,
+ 0x0169, 0x0169,
+ 0x016b, 0x016b,
+ 0x016d, 0x016d,
+ 0x016f, 0x016f,
+ 0x0171, 0x0171,
+ 0x0173, 0x0173,
+ 0x0175, 0x0175,
+ 0x0177, 0x0177,
+ 0x017a, 0x017a,
+ 0x017c, 0x017c,
+ 0x017e, 0x0180,
+ 0x0183, 0x0183,
+ 0x0185, 0x0185,
+ 0x0188, 0x0188,
+ 0x018c, 0x018d,
+ 0x0192, 0x0192,
+ 0x0195, 0x0195,
+ 0x0199, 0x019b,
+ 0x019e, 0x019e,
+ 0x01a1, 0x01a1,
+ 0x01a3, 0x01a3,
+ 0x01a5, 0x01a5,
+ 0x01a8, 0x01a8,
+ 0x01aa, 0x01ab,
+ 0x01ad, 0x01ad,
+ 0x01b0, 0x01b0,
+ 0x01b4, 0x01b4,
+ 0x01b6, 0x01b6,
+ 0x01b9, 0x01ba,
+ 0x01bd, 0x01bf,
+ 0x01c6, 0x01c6,
+ 0x01c9, 0x01c9,
+ 0x01cc, 0x01cc,
+ 0x01ce, 0x01ce,
+ 0x01d0, 0x01d0,
+ 0x01d2, 0x01d2,
+ 0x01d4, 0x01d4,
+ 0x01d6, 0x01d6,
+ 0x01d8, 0x01d8,
+ 0x01da, 0x01da,
+ 0x01dc, 0x01dd,
+ 0x01df, 0x01df,
+ 0x01e1, 0x01e1,
+ 0x01e3, 0x01e3,
+ 0x01e5, 0x01e5,
+ 0x01e7, 0x01e7,
+ 0x01e9, 0x01e9,
+ 0x01eb, 0x01eb,
+ 0x01ed, 0x01ed,
+ 0x01ef, 0x01f0,
+ 0x01f3, 0x01f3,
+ 0x01f5, 0x01f5,
+ 0x01f9, 0x01f9,
+ 0x01fb, 0x01fb,
+ 0x01fd, 0x01fd,
+ 0x01ff, 0x01ff,
+ 0x0201, 0x0201,
+ 0x0203, 0x0203,
+ 0x0205, 0x0205,
+ 0x0207, 0x0207,
+ 0x0209, 0x0209,
+ 0x020b, 0x020b,
+ 0x020d, 0x020d,
+ 0x020f, 0x020f,
+ 0x0211, 0x0211,
+ 0x0213, 0x0213,
+ 0x0215, 0x0215,
+ 0x0217, 0x0217,
+ 0x0219, 0x0219,
+ 0x021b, 0x021b,
+ 0x021d, 0x021d,
+ 0x021f, 0x021f,
+ 0x0221, 0x0221,
+ 0x0223, 0x0223,
+ 0x0225, 0x0225,
+ 0x0227, 0x0227,
+ 0x0229, 0x0229,
+ 0x022b, 0x022b,
+ 0x022d, 0x022d,
+ 0x022f, 0x022f,
+ 0x0231, 0x0231,
+ 0x0233, 0x0239,
+ 0x023c, 0x023c,
+ 0x023f, 0x0240,
+ 0x0242, 0x0242,
+ 0x0247, 0x0247,
+ 0x0249, 0x0249,
+ 0x024b, 0x024b,
+ 0x024d, 0x024d,
+ 0x024f, 0x0293,
+ 0x0295, 0x02b8,
+ 0x02c0, 0x02c1,
+ 0x02e0, 0x02e4,
+ 0x0345, 0x0345,
+ 0x0371, 0x0371,
+ 0x0373, 0x0373,
+ 0x0377, 0x0377,
+ 0x037a, 0x037d,
+ 0x0390, 0x0390,
+ 0x03ac, 0x03ce,
+ 0x03d0, 0x03d1,
+ 0x03d5, 0x03d7,
+ 0x03d9, 0x03d9,
+ 0x03db, 0x03db,
+ 0x03dd, 0x03dd,
+ 0x03df, 0x03df,
+ 0x03e1, 0x03e1,
+ 0x03e3, 0x03e3,
+ 0x03e5, 0x03e5,
+ 0x03e7, 0x03e7,
+ 0x03e9, 0x03e9,
+ 0x03eb, 0x03eb,
+ 0x03ed, 0x03ed,
+ 0x03ef, 0x03f3,
+ 0x03f5, 0x03f5,
+ 0x03f8, 0x03f8,
+ 0x03fb, 0x03fc,
+ 0x0430, 0x045f,
+ 0x0461, 0x0461,
+ 0x0463, 0x0463,
+ 0x0465, 0x0465,
+ 0x0467, 0x0467,
+ 0x0469, 0x0469,
+ 0x046b, 0x046b,
+ 0x046d, 0x046d,
+ 0x046f, 0x046f,
+ 0x0471, 0x0471,
+ 0x0473, 0x0473,
+ 0x0475, 0x0475,
+ 0x0477, 0x0477,
+ 0x0479, 0x0479,
+ 0x047b, 0x047b,
+ 0x047d, 0x047d,
+ 0x047f, 0x047f,
+ 0x0481, 0x0481,
+ 0x048b, 0x048b,
+ 0x048d, 0x048d,
+ 0x048f, 0x048f,
+ 0x0491, 0x0491,
+ 0x0493, 0x0493,
+ 0x0495, 0x0495,
+ 0x0497, 0x0497,
+ 0x0499, 0x0499,
+ 0x049b, 0x049b,
+ 0x049d, 0x049d,
+ 0x049f, 0x049f,
+ 0x04a1, 0x04a1,
+ 0x04a3, 0x04a3,
+ 0x04a5, 0x04a5,
+ 0x04a7, 0x04a7,
+ 0x04a9, 0x04a9,
+ 0x04ab, 0x04ab,
+ 0x04ad, 0x04ad,
+ 0x04af, 0x04af,
+ 0x04b1, 0x04b1,
+ 0x04b3, 0x04b3,
+ 0x04b5, 0x04b5,
+ 0x04b7, 0x04b7,
+ 0x04b9, 0x04b9,
+ 0x04bb, 0x04bb,
+ 0x04bd, 0x04bd,
+ 0x04bf, 0x04bf,
+ 0x04c2, 0x04c2,
+ 0x04c4, 0x04c4,
+ 0x04c6, 0x04c6,
+ 0x04c8, 0x04c8,
+ 0x04ca, 0x04ca,
+ 0x04cc, 0x04cc,
+ 0x04ce, 0x04cf,
+ 0x04d1, 0x04d1,
+ 0x04d3, 0x04d3,
+ 0x04d5, 0x04d5,
+ 0x04d7, 0x04d7,
+ 0x04d9, 0x04d9,
+ 0x04db, 0x04db,
+ 0x04dd, 0x04dd,
+ 0x04df, 0x04df,
+ 0x04e1, 0x04e1,
+ 0x04e3, 0x04e3,
+ 0x04e5, 0x04e5,
+ 0x04e7, 0x04e7,
+ 0x04e9, 0x04e9,
+ 0x04eb, 0x04eb,
+ 0x04ed, 0x04ed,
+ 0x04ef, 0x04ef,
+ 0x04f1, 0x04f1,
+ 0x04f3, 0x04f3,
+ 0x04f5, 0x04f5,
+ 0x04f7, 0x04f7,
+ 0x04f9, 0x04f9,
+ 0x04fb, 0x04fb,
+ 0x04fd, 0x04fd,
+ 0x04ff, 0x04ff,
+ 0x0501, 0x0501,
+ 0x0503, 0x0503,
+ 0x0505, 0x0505,
+ 0x0507, 0x0507,
+ 0x0509, 0x0509,
+ 0x050b, 0x050b,
+ 0x050d, 0x050d,
+ 0x050f, 0x050f,
+ 0x0511, 0x0511,
+ 0x0513, 0x0513,
+ 0x0515, 0x0515,
+ 0x0517, 0x0517,
+ 0x0519, 0x0519,
+ 0x051b, 0x051b,
+ 0x051d, 0x051d,
+ 0x051f, 0x051f,
+ 0x0521, 0x0521,
+ 0x0523, 0x0523,
+ 0x0525, 0x0525,
+ 0x0527, 0x0527,
+ 0x0561, 0x0587,
+ 0x1d00, 0x1dbf,
+ 0x1e01, 0x1e01,
+ 0x1e03, 0x1e03,
+ 0x1e05, 0x1e05,
+ 0x1e07, 0x1e07,
+ 0x1e09, 0x1e09,
+ 0x1e0b, 0x1e0b,
+ 0x1e0d, 0x1e0d,
+ 0x1e0f, 0x1e0f,
+ 0x1e11, 0x1e11,
+ 0x1e13, 0x1e13,
+ 0x1e15, 0x1e15,
+ 0x1e17, 0x1e17,
+ 0x1e19, 0x1e19,
+ 0x1e1b, 0x1e1b,
+ 0x1e1d, 0x1e1d,
+ 0x1e1f, 0x1e1f,
+ 0x1e21, 0x1e21,
+ 0x1e23, 0x1e23,
+ 0x1e25, 0x1e25,
+ 0x1e27, 0x1e27,
+ 0x1e29, 0x1e29,
+ 0x1e2b, 0x1e2b,
+ 0x1e2d, 0x1e2d,
+ 0x1e2f, 0x1e2f,
+ 0x1e31, 0x1e31,
+ 0x1e33, 0x1e33,
+ 0x1e35, 0x1e35,
+ 0x1e37, 0x1e37,
+ 0x1e39, 0x1e39,
+ 0x1e3b, 0x1e3b,
+ 0x1e3d, 0x1e3d,
+ 0x1e3f, 0x1e3f,
+ 0x1e41, 0x1e41,
+ 0x1e43, 0x1e43,
+ 0x1e45, 0x1e45,
+ 0x1e47, 0x1e47,
+ 0x1e49, 0x1e49,
+ 0x1e4b, 0x1e4b,
+ 0x1e4d, 0x1e4d,
+ 0x1e4f, 0x1e4f,
+ 0x1e51, 0x1e51,
+ 0x1e53, 0x1e53,
+ 0x1e55, 0x1e55,
+ 0x1e57, 0x1e57,
+ 0x1e59, 0x1e59,
+ 0x1e5b, 0x1e5b,
+ 0x1e5d, 0x1e5d,
+ 0x1e5f, 0x1e5f,
+ 0x1e61, 0x1e61,
+ 0x1e63, 0x1e63,
+ 0x1e65, 0x1e65,
+ 0x1e67, 0x1e67,
+ 0x1e69, 0x1e69,
+ 0x1e6b, 0x1e6b,
+ 0x1e6d, 0x1e6d,
+ 0x1e6f, 0x1e6f,
+ 0x1e71, 0x1e71,
+ 0x1e73, 0x1e73,
+ 0x1e75, 0x1e75,
+ 0x1e77, 0x1e77,
+ 0x1e79, 0x1e79,
+ 0x1e7b, 0x1e7b,
+ 0x1e7d, 0x1e7d,
+ 0x1e7f, 0x1e7f,
+ 0x1e81, 0x1e81,
+ 0x1e83, 0x1e83,
+ 0x1e85, 0x1e85,
+ 0x1e87, 0x1e87,
+ 0x1e89, 0x1e89,
+ 0x1e8b, 0x1e8b,
+ 0x1e8d, 0x1e8d,
+ 0x1e8f, 0x1e8f,
+ 0x1e91, 0x1e91,
+ 0x1e93, 0x1e93,
+ 0x1e95, 0x1e9d,
+ 0x1e9f, 0x1e9f,
+ 0x1ea1, 0x1ea1,
+ 0x1ea3, 0x1ea3,
+ 0x1ea5, 0x1ea5,
+ 0x1ea7, 0x1ea7,
+ 0x1ea9, 0x1ea9,
+ 0x1eab, 0x1eab,
+ 0x1ead, 0x1ead,
+ 0x1eaf, 0x1eaf,
+ 0x1eb1, 0x1eb1,
+ 0x1eb3, 0x1eb3,
+ 0x1eb5, 0x1eb5,
+ 0x1eb7, 0x1eb7,
+ 0x1eb9, 0x1eb9,
+ 0x1ebb, 0x1ebb,
+ 0x1ebd, 0x1ebd,
+ 0x1ebf, 0x1ebf,
+ 0x1ec1, 0x1ec1,
+ 0x1ec3, 0x1ec3,
+ 0x1ec5, 0x1ec5,
+ 0x1ec7, 0x1ec7,
+ 0x1ec9, 0x1ec9,
+ 0x1ecb, 0x1ecb,
+ 0x1ecd, 0x1ecd,
+ 0x1ecf, 0x1ecf,
+ 0x1ed1, 0x1ed1,
+ 0x1ed3, 0x1ed3,
+ 0x1ed5, 0x1ed5,
+ 0x1ed7, 0x1ed7,
+ 0x1ed9, 0x1ed9,
+ 0x1edb, 0x1edb,
+ 0x1edd, 0x1edd,
+ 0x1edf, 0x1edf,
+ 0x1ee1, 0x1ee1,
+ 0x1ee3, 0x1ee3,
+ 0x1ee5, 0x1ee5,
+ 0x1ee7, 0x1ee7,
+ 0x1ee9, 0x1ee9,
+ 0x1eeb, 0x1eeb,
+ 0x1eed, 0x1eed,
+ 0x1eef, 0x1eef,
+ 0x1ef1, 0x1ef1,
+ 0x1ef3, 0x1ef3,
+ 0x1ef5, 0x1ef5,
+ 0x1ef7, 0x1ef7,
+ 0x1ef9, 0x1ef9,
+ 0x1efb, 0x1efb,
+ 0x1efd, 0x1efd,
+ 0x1eff, 0x1f07,
+ 0x1f10, 0x1f15,
+ 0x1f20, 0x1f27,
+ 0x1f30, 0x1f37,
+ 0x1f40, 0x1f45,
+ 0x1f50, 0x1f57,
+ 0x1f60, 0x1f67,
+ 0x1f70, 0x1f7d,
+ 0x1f80, 0x1f87,
+ 0x1f90, 0x1f97,
+ 0x1fa0, 0x1fa7,
+ 0x1fb0, 0x1fb4,
+ 0x1fb6, 0x1fb7,
+ 0x1fbe, 0x1fbe,
+ 0x1fc2, 0x1fc4,
+ 0x1fc6, 0x1fc7,
+ 0x1fd0, 0x1fd3,
+ 0x1fd6, 0x1fd7,
+ 0x1fe0, 0x1fe7,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ff7,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x210a, 0x210a,
+ 0x210e, 0x210f,
+ 0x2113, 0x2113,
+ 0x212f, 0x212f,
+ 0x2134, 0x2134,
+ 0x2139, 0x2139,
+ 0x213c, 0x213d,
+ 0x2146, 0x2149,
+ 0x214e, 0x214e,
+ 0x2170, 0x217f,
+ 0x2184, 0x2184,
+ 0x24d0, 0x24e9,
+ 0x2c30, 0x2c5e,
+ 0x2c61, 0x2c61,
+ 0x2c65, 0x2c66,
+ 0x2c68, 0x2c68,
+ 0x2c6a, 0x2c6a,
+ 0x2c6c, 0x2c6c,
+ 0x2c71, 0x2c71,
+ 0x2c73, 0x2c74,
+ 0x2c76, 0x2c7d,
+ 0x2c81, 0x2c81,
+ 0x2c83, 0x2c83,
+ 0x2c85, 0x2c85,
+ 0x2c87, 0x2c87,
+ 0x2c89, 0x2c89,
+ 0x2c8b, 0x2c8b,
+ 0x2c8d, 0x2c8d,
+ 0x2c8f, 0x2c8f,
+ 0x2c91, 0x2c91,
+ 0x2c93, 0x2c93,
+ 0x2c95, 0x2c95,
+ 0x2c97, 0x2c97,
+ 0x2c99, 0x2c99,
+ 0x2c9b, 0x2c9b,
+ 0x2c9d, 0x2c9d,
+ 0x2c9f, 0x2c9f,
+ 0x2ca1, 0x2ca1,
+ 0x2ca3, 0x2ca3,
+ 0x2ca5, 0x2ca5,
+ 0x2ca7, 0x2ca7,
+ 0x2ca9, 0x2ca9,
+ 0x2cab, 0x2cab,
+ 0x2cad, 0x2cad,
+ 0x2caf, 0x2caf,
+ 0x2cb1, 0x2cb1,
+ 0x2cb3, 0x2cb3,
+ 0x2cb5, 0x2cb5,
+ 0x2cb7, 0x2cb7,
+ 0x2cb9, 0x2cb9,
+ 0x2cbb, 0x2cbb,
+ 0x2cbd, 0x2cbd,
+ 0x2cbf, 0x2cbf,
+ 0x2cc1, 0x2cc1,
+ 0x2cc3, 0x2cc3,
+ 0x2cc5, 0x2cc5,
+ 0x2cc7, 0x2cc7,
+ 0x2cc9, 0x2cc9,
+ 0x2ccb, 0x2ccb,
+ 0x2ccd, 0x2ccd,
+ 0x2ccf, 0x2ccf,
+ 0x2cd1, 0x2cd1,
+ 0x2cd3, 0x2cd3,
+ 0x2cd5, 0x2cd5,
+ 0x2cd7, 0x2cd7,
+ 0x2cd9, 0x2cd9,
+ 0x2cdb, 0x2cdb,
+ 0x2cdd, 0x2cdd,
+ 0x2cdf, 0x2cdf,
+ 0x2ce1, 0x2ce1,
+ 0x2ce3, 0x2ce4,
+ 0x2cec, 0x2cec,
+ 0x2cee, 0x2cee,
+ 0x2cf3, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0xa641, 0xa641,
+ 0xa643, 0xa643,
+ 0xa645, 0xa645,
+ 0xa647, 0xa647,
+ 0xa649, 0xa649,
+ 0xa64b, 0xa64b,
+ 0xa64d, 0xa64d,
+ 0xa64f, 0xa64f,
+ 0xa651, 0xa651,
+ 0xa653, 0xa653,
+ 0xa655, 0xa655,
+ 0xa657, 0xa657,
+ 0xa659, 0xa659,
+ 0xa65b, 0xa65b,
+ 0xa65d, 0xa65d,
+ 0xa65f, 0xa65f,
+ 0xa661, 0xa661,
+ 0xa663, 0xa663,
+ 0xa665, 0xa665,
+ 0xa667, 0xa667,
+ 0xa669, 0xa669,
+ 0xa66b, 0xa66b,
+ 0xa66d, 0xa66d,
+ 0xa681, 0xa681,
+ 0xa683, 0xa683,
+ 0xa685, 0xa685,
+ 0xa687, 0xa687,
+ 0xa689, 0xa689,
+ 0xa68b, 0xa68b,
+ 0xa68d, 0xa68d,
+ 0xa68f, 0xa68f,
+ 0xa691, 0xa691,
+ 0xa693, 0xa693,
+ 0xa695, 0xa695,
+ 0xa697, 0xa697,
+ 0xa723, 0xa723,
+ 0xa725, 0xa725,
+ 0xa727, 0xa727,
+ 0xa729, 0xa729,
+ 0xa72b, 0xa72b,
+ 0xa72d, 0xa72d,
+ 0xa72f, 0xa731,
+ 0xa733, 0xa733,
+ 0xa735, 0xa735,
+ 0xa737, 0xa737,
+ 0xa739, 0xa739,
+ 0xa73b, 0xa73b,
+ 0xa73d, 0xa73d,
+ 0xa73f, 0xa73f,
+ 0xa741, 0xa741,
+ 0xa743, 0xa743,
+ 0xa745, 0xa745,
+ 0xa747, 0xa747,
+ 0xa749, 0xa749,
+ 0xa74b, 0xa74b,
+ 0xa74d, 0xa74d,
+ 0xa74f, 0xa74f,
+ 0xa751, 0xa751,
+ 0xa753, 0xa753,
+ 0xa755, 0xa755,
+ 0xa757, 0xa757,
+ 0xa759, 0xa759,
+ 0xa75b, 0xa75b,
+ 0xa75d, 0xa75d,
+ 0xa75f, 0xa75f,
+ 0xa761, 0xa761,
+ 0xa763, 0xa763,
+ 0xa765, 0xa765,
+ 0xa767, 0xa767,
+ 0xa769, 0xa769,
+ 0xa76b, 0xa76b,
+ 0xa76d, 0xa76d,
+ 0xa76f, 0xa778,
+ 0xa77a, 0xa77a,
+ 0xa77c, 0xa77c,
+ 0xa77f, 0xa77f,
+ 0xa781, 0xa781,
+ 0xa783, 0xa783,
+ 0xa785, 0xa785,
+ 0xa787, 0xa787,
+ 0xa78c, 0xa78c,
+ 0xa78e, 0xa78e,
+ 0xa791, 0xa791,
+ 0xa793, 0xa793,
+ 0xa7a1, 0xa7a1,
+ 0xa7a3, 0xa7a3,
+ 0xa7a5, 0xa7a5,
+ 0xa7a7, 0xa7a7,
+ 0xa7a9, 0xa7a9,
+ 0xa7f8, 0xa7fa,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff41, 0xff5a,
+ 0x10428, 0x1044f,
+ 0x1d41a, 0x1d433,
+ 0x1d44e, 0x1d454,
+ 0x1d456, 0x1d467,
+ 0x1d482, 0x1d49b,
+ 0x1d4b6, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d4cf,
+ 0x1d4ea, 0x1d503,
+ 0x1d51e, 0x1d537,
+ 0x1d552, 0x1d56b,
+ 0x1d586, 0x1d59f,
+ 0x1d5ba, 0x1d5d3,
+ 0x1d5ee, 0x1d607,
+ 0x1d622, 0x1d63b,
+ 0x1d656, 0x1d66f,
+ 0x1d68a, 0x1d6a5,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6e1,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d71b,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d755,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d78f,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7c9,
+ 0x1d7cb, 0x1d7cb,
+}; /* CR_Lower */
+
+/* 'Print': [[:Print:]] */
+static const OnigCodePoint CR_Print[] = {
+ 541,
+ 0x0020, 0x007e,
+ 0x00a0, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x058f, 0x058f,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0604,
+ 0x0606, 0x061b,
+ 0x061e, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09fb,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3c, 0x0a3c,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4d,
+ 0x0a51, 0x0a51,
+ 0x0a59, 0x0a5c,
+ 0x0a5e, 0x0a5e,
+ 0x0a66, 0x0a75,
+ 0x0a81, 0x0a83,
+ 0x0a85, 0x0a8d,
+ 0x0a8f, 0x0a91,
+ 0x0a93, 0x0aa8,
+ 0x0aaa, 0x0ab0,
+ 0x0ab2, 0x0ab3,
+ 0x0ab5, 0x0ab9,
+ 0x0abc, 0x0ac5,
+ 0x0ac7, 0x0ac9,
+ 0x0acb, 0x0acd,
+ 0x0ad0, 0x0ad0,
+ 0x0ae0, 0x0ae3,
+ 0x0ae6, 0x0af1,
+ 0x0b01, 0x0b03,
+ 0x0b05, 0x0b0c,
+ 0x0b0f, 0x0b10,
+ 0x0b13, 0x0b28,
+ 0x0b2a, 0x0b30,
+ 0x0b32, 0x0b33,
+ 0x0b35, 0x0b39,
+ 0x0b3c, 0x0b44,
+ 0x0b47, 0x0b48,
+ 0x0b4b, 0x0b4d,
+ 0x0b56, 0x0b57,
+ 0x0b5c, 0x0b5d,
+ 0x0b5f, 0x0b63,
+ 0x0b66, 0x0b77,
+ 0x0b82, 0x0b83,
+ 0x0b85, 0x0b8a,
+ 0x0b8e, 0x0b90,
+ 0x0b92, 0x0b95,
+ 0x0b99, 0x0b9a,
+ 0x0b9c, 0x0b9c,
+ 0x0b9e, 0x0b9f,
+ 0x0ba3, 0x0ba4,
+ 0x0ba8, 0x0baa,
+ 0x0bae, 0x0bb9,
+ 0x0bbe, 0x0bc2,
+ 0x0bc6, 0x0bc8,
+ 0x0bca, 0x0bcd,
+ 0x0bd0, 0x0bd0,
+ 0x0bd7, 0x0bd7,
+ 0x0be6, 0x0bfa,
+ 0x0c01, 0x0c03,
+ 0x0c05, 0x0c0c,
+ 0x0c0e, 0x0c10,
+ 0x0c12, 0x0c28,
+ 0x0c2a, 0x0c33,
+ 0x0c35, 0x0c39,
+ 0x0c3d, 0x0c44,
+ 0x0c46, 0x0c48,
+ 0x0c4a, 0x0c4d,
+ 0x0c55, 0x0c56,
+ 0x0c58, 0x0c59,
+ 0x0c60, 0x0c63,
+ 0x0c66, 0x0c6f,
+ 0x0c78, 0x0c7f,
+ 0x0c82, 0x0c83,
+ 0x0c85, 0x0c8c,
+ 0x0c8e, 0x0c90,
+ 0x0c92, 0x0ca8,
+ 0x0caa, 0x0cb3,
+ 0x0cb5, 0x0cb9,
+ 0x0cbc, 0x0cc4,
+ 0x0cc6, 0x0cc8,
+ 0x0cca, 0x0ccd,
+ 0x0cd5, 0x0cd6,
+ 0x0cde, 0x0cde,
+ 0x0ce0, 0x0ce3,
+ 0x0ce6, 0x0cef,
+ 0x0cf1, 0x0cf2,
+ 0x0d02, 0x0d03,
+ 0x0d05, 0x0d0c,
+ 0x0d0e, 0x0d10,
+ 0x0d12, 0x0d3a,
+ 0x0d3d, 0x0d44,
+ 0x0d46, 0x0d48,
+ 0x0d4a, 0x0d4e,
+ 0x0d57, 0x0d57,
+ 0x0d60, 0x0d63,
+ 0x0d66, 0x0d75,
+ 0x0d79, 0x0d7f,
+ 0x0d82, 0x0d83,
+ 0x0d85, 0x0d96,
+ 0x0d9a, 0x0db1,
+ 0x0db3, 0x0dbb,
+ 0x0dbd, 0x0dbd,
+ 0x0dc0, 0x0dc6,
+ 0x0dca, 0x0dca,
+ 0x0dcf, 0x0dd4,
+ 0x0dd6, 0x0dd6,
+ 0x0dd8, 0x0ddf,
+ 0x0df2, 0x0df4,
+ 0x0e01, 0x0e3a,
+ 0x0e3f, 0x0e5b,
+ 0x0e81, 0x0e82,
+ 0x0e84, 0x0e84,
+ 0x0e87, 0x0e88,
+ 0x0e8a, 0x0e8a,
+ 0x0e8d, 0x0e8d,
+ 0x0e94, 0x0e97,
+ 0x0e99, 0x0e9f,
+ 0x0ea1, 0x0ea3,
+ 0x0ea5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ec8, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fbe, 0x0fcc,
+ 0x0fce, 0x0fda,
+ 0x1000, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135d, 0x137c,
+ 0x1380, 0x1399,
+ 0x13a0, 0x13f4,
+ 0x1400, 0x169c,
+ 0x16a0, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+ 0x1720, 0x1736,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17dd,
+ 0x17e0, 0x17e9,
+ 0x17f0, 0x17f9,
+ 0x1800, 0x180e,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1940, 0x1940,
+ 0x1944, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19da,
+ 0x19de, 0x1a1b,
+ 0x1a1e, 0x1a5e,
+ 0x1a60, 0x1a7c,
+ 0x1a7f, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa0, 0x1aad,
+ 0x1b00, 0x1b4b,
+ 0x1b50, 0x1b7c,
+ 0x1b80, 0x1bf3,
+ 0x1bfc, 0x1c37,
+ 0x1c3b, 0x1c49,
+ 0x1c4d, 0x1c7f,
+ 0x1cc0, 0x1cc7,
+ 0x1cd0, 0x1cf6,
+ 0x1d00, 0x1de6,
+ 0x1dfc, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fc4,
+ 0x1fc6, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fdd, 0x1fef,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffe,
+ 0x2000, 0x2027,
+ 0x202a, 0x2064,
+ 0x206a, 0x2071,
+ 0x2074, 0x208e,
+ 0x2090, 0x209c,
+ 0x20a0, 0x20b9,
+ 0x20d0, 0x20f0,
+ 0x2100, 0x2189,
+ 0x2190, 0x23f3,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x2460, 0x26ff,
+ 0x2701, 0x2b4c,
+ 0x2b50, 0x2b59,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2cf3,
+ 0x2cf9, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
+ 0x2d6f, 0x2d70,
+ 0x2d7f, 0x2d96,
+ 0x2da0, 0x2da6,
+ 0x2da8, 0x2dae,
+ 0x2db0, 0x2db6,
+ 0x2db8, 0x2dbe,
+ 0x2dc0, 0x2dc6,
+ 0x2dc8, 0x2dce,
+ 0x2dd0, 0x2dd6,
+ 0x2dd8, 0x2dde,
+ 0x2de0, 0x2e3b,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+ 0x2ff0, 0x2ffb,
+ 0x3000, 0x303f,
+ 0x3041, 0x3096,
+ 0x3099, 0x30ff,
+ 0x3105, 0x312d,
+ 0x3131, 0x318e,
+ 0x3190, 0x31ba,
+ 0x31c0, 0x31e3,
+ 0x31f0, 0x321e,
+ 0x3220, 0x32fe,
+ 0x3300, 0x4db5,
+ 0x4dc0, 0x9fcc,
+ 0xa000, 0xa48c,
+ 0xa490, 0xa4c6,
+ 0xa4d0, 0xa62b,
+ 0xa640, 0xa697,
+ 0xa69f, 0xa6f7,
+ 0xa700, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa82b,
+ 0xa830, 0xa839,
+ 0xa840, 0xa877,
+ 0xa880, 0xa8c4,
+ 0xa8ce, 0xa8d9,
+ 0xa8e0, 0xa8fb,
+ 0xa900, 0xa953,
+ 0xa95f, 0xa97c,
+ 0xa980, 0xa9cd,
+ 0xa9cf, 0xa9d9,
+ 0xa9de, 0xa9df,
+ 0xaa00, 0xaa36,
+ 0xaa40, 0xaa4d,
+ 0xaa50, 0xaa59,
+ 0xaa5c, 0xaa7b,
+ 0xaa80, 0xaac2,
+ 0xaadb, 0xaaf6,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabed,
+ 0xabf0, 0xabf9,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xe000, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbc1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfd,
+ 0xfe00, 0xfe19,
+ 0xfe20, 0xfe26,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xfeff, 0xfeff,
+ 0xff01, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfff9, 0xfffd,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1018a,
+ 0x10190, 0x1019b,
+ 0x101d0, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x103c3,
+ 0x103c8, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10857, 0x1085f,
+ 0x10900, 0x1091b,
+ 0x1091f, 0x10939,
+ 0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x10a60, 0x10a7f,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b7f,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x11080, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d1dd,
+ 0x1d200, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1d360, 0x1d371,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
+ 0x1f000, 0x1f02b,
+ 0x1f030, 0x1f093,
+ 0x1f0a0, 0x1f0ae,
+ 0x1f0b1, 0x1f0be,
+ 0x1f0c1, 0x1f0cf,
+ 0x1f0d1, 0x1f0df,
+ 0x1f100, 0x1f10a,
+ 0x1f110, 0x1f12e,
+ 0x1f130, 0x1f16b,
+ 0x1f170, 0x1f19a,
+ 0x1f1e6, 0x1f202,
+ 0x1f210, 0x1f23a,
+ 0x1f240, 0x1f248,
+ 0x1f250, 0x1f251,
+ 0x1f300, 0x1f320,
+ 0x1f330, 0x1f335,
+ 0x1f337, 0x1f37c,
+ 0x1f380, 0x1f393,
+ 0x1f3a0, 0x1f3c4,
+ 0x1f3c6, 0x1f3ca,
+ 0x1f3e0, 0x1f3f0,
+ 0x1f400, 0x1f43e,
+ 0x1f440, 0x1f440,
+ 0x1f442, 0x1f4f7,
+ 0x1f4f9, 0x1f4fc,
+ 0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
+ 0x1f550, 0x1f567,
+ 0x1f5fb, 0x1f640,
+ 0x1f645, 0x1f64f,
+ 0x1f680, 0x1f6c5,
+ 0x1f700, 0x1f773,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+ 0xf0000, 0xffffd,
+ 0x100000, 0x10fffd,
+}; /* CR_Print */
+
+/* 'Punct': [[:Punct:]] */
+static const OnigCodePoint CR_Punct[] = {
+ 140,
+ 0x0021, 0x0023,
+ 0x0025, 0x002a,
+ 0x002c, 0x002f,
+ 0x003a, 0x003b,
+ 0x003f, 0x0040,
+ 0x005b, 0x005d,
+ 0x005f, 0x005f,
+ 0x007b, 0x007b,
+ 0x007d, 0x007d,
+ 0x00a1, 0x00a1,
+ 0x00a7, 0x00a7,
+ 0x00ab, 0x00ab,
+ 0x00b6, 0x00b7,
+ 0x00bb, 0x00bb,
+ 0x00bf, 0x00bf,
+ 0x037e, 0x037e,
+ 0x0387, 0x0387,
+ 0x055a, 0x055f,
+ 0x0589, 0x058a,
+ 0x05be, 0x05be,
+ 0x05c0, 0x05c0,
+ 0x05c3, 0x05c3,
+ 0x05c6, 0x05c6,
+ 0x05f3, 0x05f4,
+ 0x0609, 0x060a,
+ 0x060c, 0x060d,
+ 0x061b, 0x061b,
+ 0x061e, 0x061f,
+ 0x066a, 0x066d,
+ 0x06d4, 0x06d4,
+ 0x0700, 0x070d,
+ 0x07f7, 0x07f9,
+ 0x0830, 0x083e,
+ 0x085e, 0x085e,
+ 0x0964, 0x0965,
+ 0x0970, 0x0970,
+ 0x0af0, 0x0af0,
+ 0x0df4, 0x0df4,
+ 0x0e4f, 0x0e4f,
+ 0x0e5a, 0x0e5b,
+ 0x0f04, 0x0f12,
+ 0x0f14, 0x0f14,
+ 0x0f3a, 0x0f3d,
+ 0x0f85, 0x0f85,
+ 0x0fd0, 0x0fd4,
+ 0x0fd9, 0x0fda,
+ 0x104a, 0x104f,
+ 0x10fb, 0x10fb,
+ 0x1360, 0x1368,
+ 0x1400, 0x1400,
+ 0x166d, 0x166e,
+ 0x169b, 0x169c,
+ 0x16eb, 0x16ed,
+ 0x1735, 0x1736,
+ 0x17d4, 0x17d6,
+ 0x17d8, 0x17da,
+ 0x1800, 0x180a,
+ 0x1944, 0x1945,
+ 0x1a1e, 0x1a1f,
+ 0x1aa0, 0x1aa6,
+ 0x1aa8, 0x1aad,
+ 0x1b5a, 0x1b60,
+ 0x1bfc, 0x1bff,
+ 0x1c3b, 0x1c3f,
+ 0x1c7e, 0x1c7f,
+ 0x1cc0, 0x1cc7,
+ 0x1cd3, 0x1cd3,
+ 0x2010, 0x2027,
+ 0x2030, 0x2043,
+ 0x2045, 0x2051,
+ 0x2053, 0x205e,
+ 0x207d, 0x207e,
+ 0x208d, 0x208e,
+ 0x2329, 0x232a,
+ 0x2768, 0x2775,
+ 0x27c5, 0x27c6,
+ 0x27e6, 0x27ef,
+ 0x2983, 0x2998,
+ 0x29d8, 0x29db,
+ 0x29fc, 0x29fd,
+ 0x2cf9, 0x2cfc,
+ 0x2cfe, 0x2cff,
+ 0x2d70, 0x2d70,
+ 0x2e00, 0x2e2e,
+ 0x2e30, 0x2e3b,
+ 0x3001, 0x3003,
+ 0x3008, 0x3011,
+ 0x3014, 0x301f,
+ 0x3030, 0x3030,
+ 0x303d, 0x303d,
+ 0x30a0, 0x30a0,
+ 0x30fb, 0x30fb,
+ 0xa4fe, 0xa4ff,
+ 0xa60d, 0xa60f,
+ 0xa673, 0xa673,
+ 0xa67e, 0xa67e,
+ 0xa6f2, 0xa6f7,
+ 0xa874, 0xa877,
+ 0xa8ce, 0xa8cf,
+ 0xa8f8, 0xa8fa,
+ 0xa92e, 0xa92f,
+ 0xa95f, 0xa95f,
+ 0xa9c1, 0xa9cd,
+ 0xa9de, 0xa9df,
+ 0xaa5c, 0xaa5f,
+ 0xaade, 0xaadf,
+ 0xaaf0, 0xaaf1,
+ 0xabeb, 0xabeb,
+ 0xfd3e, 0xfd3f,
+ 0xfe10, 0xfe19,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe61,
+ 0xfe63, 0xfe63,
+ 0xfe68, 0xfe68,
+ 0xfe6a, 0xfe6b,
+ 0xff01, 0xff03,
+ 0xff05, 0xff0a,
+ 0xff0c, 0xff0f,
+ 0xff1a, 0xff1b,
+ 0xff1f, 0xff20,
+ 0xff3b, 0xff3d,
+ 0xff3f, 0xff3f,
+ 0xff5b, 0xff5b,
+ 0xff5d, 0xff5d,
+ 0xff5f, 0xff65,
+ 0x10100, 0x10102,
+ 0x1039f, 0x1039f,
+ 0x103d0, 0x103d0,
+ 0x10857, 0x10857,
+ 0x1091f, 0x1091f,
+ 0x1093f, 0x1093f,
+ 0x10a50, 0x10a58,
+ 0x10a7f, 0x10a7f,
+ 0x10b39, 0x10b3f,
+ 0x11047, 0x1104d,
+ 0x110bb, 0x110bc,
+ 0x110be, 0x110c1,
+ 0x11140, 0x11143,
+ 0x111c5, 0x111c8,
+ 0x12470, 0x12473,
+}; /* CR_Punct */
+
+/* 'Space': [[:Space:]] */
+static const OnigCodePoint CR_Space[] = {
+ 11,
+ 0x0009, 0x000d,
+ 0x0020, 0x0020,
+ 0x0085, 0x0085,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x180e, 0x180e,
+ 0x2000, 0x200a,
+ 0x2028, 0x2029,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Space */
+
+/* 'Upper': [[:Upper:]] */
+static const OnigCodePoint CR_Upper[] = {
+ 610,
+ 0x0041, 0x005a,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00de,
+ 0x0100, 0x0100,
+ 0x0102, 0x0102,
+ 0x0104, 0x0104,
+ 0x0106, 0x0106,
+ 0x0108, 0x0108,
+ 0x010a, 0x010a,
+ 0x010c, 0x010c,
+ 0x010e, 0x010e,
+ 0x0110, 0x0110,
+ 0x0112, 0x0112,
+ 0x0114, 0x0114,
+ 0x0116, 0x0116,
+ 0x0118, 0x0118,
+ 0x011a, 0x011a,
+ 0x011c, 0x011c,
+ 0x011e, 0x011e,
+ 0x0120, 0x0120,
+ 0x0122, 0x0122,
+ 0x0124, 0x0124,
+ 0x0126, 0x0126,
+ 0x0128, 0x0128,
+ 0x012a, 0x012a,
+ 0x012c, 0x012c,
+ 0x012e, 0x012e,
+ 0x0130, 0x0130,
+ 0x0132, 0x0132,
+ 0x0134, 0x0134,
+ 0x0136, 0x0136,
+ 0x0139, 0x0139,
+ 0x013b, 0x013b,
+ 0x013d, 0x013d,
+ 0x013f, 0x013f,
+ 0x0141, 0x0141,
+ 0x0143, 0x0143,
+ 0x0145, 0x0145,
+ 0x0147, 0x0147,
+ 0x014a, 0x014a,
+ 0x014c, 0x014c,
+ 0x014e, 0x014e,
+ 0x0150, 0x0150,
+ 0x0152, 0x0152,
+ 0x0154, 0x0154,
+ 0x0156, 0x0156,
+ 0x0158, 0x0158,
+ 0x015a, 0x015a,
+ 0x015c, 0x015c,
+ 0x015e, 0x015e,
+ 0x0160, 0x0160,
+ 0x0162, 0x0162,
+ 0x0164, 0x0164,
+ 0x0166, 0x0166,
+ 0x0168, 0x0168,
+ 0x016a, 0x016a,
+ 0x016c, 0x016c,
+ 0x016e, 0x016e,
+ 0x0170, 0x0170,
+ 0x0172, 0x0172,
+ 0x0174, 0x0174,
+ 0x0176, 0x0176,
+ 0x0178, 0x0179,
+ 0x017b, 0x017b,
+ 0x017d, 0x017d,
+ 0x0181, 0x0182,
+ 0x0184, 0x0184,
+ 0x0186, 0x0187,
+ 0x0189, 0x018b,
+ 0x018e, 0x0191,
+ 0x0193, 0x0194,
+ 0x0196, 0x0198,
+ 0x019c, 0x019d,
+ 0x019f, 0x01a0,
+ 0x01a2, 0x01a2,
+ 0x01a4, 0x01a4,
+ 0x01a6, 0x01a7,
+ 0x01a9, 0x01a9,
+ 0x01ac, 0x01ac,
+ 0x01ae, 0x01af,
+ 0x01b1, 0x01b3,
+ 0x01b5, 0x01b5,
+ 0x01b7, 0x01b8,
+ 0x01bc, 0x01bc,
+ 0x01c4, 0x01c4,
+ 0x01c7, 0x01c7,
+ 0x01ca, 0x01ca,
+ 0x01cd, 0x01cd,
+ 0x01cf, 0x01cf,
+ 0x01d1, 0x01d1,
+ 0x01d3, 0x01d3,
+ 0x01d5, 0x01d5,
+ 0x01d7, 0x01d7,
+ 0x01d9, 0x01d9,
+ 0x01db, 0x01db,
+ 0x01de, 0x01de,
+ 0x01e0, 0x01e0,
+ 0x01e2, 0x01e2,
+ 0x01e4, 0x01e4,
+ 0x01e6, 0x01e6,
+ 0x01e8, 0x01e8,
+ 0x01ea, 0x01ea,
+ 0x01ec, 0x01ec,
+ 0x01ee, 0x01ee,
+ 0x01f1, 0x01f1,
+ 0x01f4, 0x01f4,
+ 0x01f6, 0x01f8,
+ 0x01fa, 0x01fa,
+ 0x01fc, 0x01fc,
+ 0x01fe, 0x01fe,
+ 0x0200, 0x0200,
+ 0x0202, 0x0202,
+ 0x0204, 0x0204,
+ 0x0206, 0x0206,
+ 0x0208, 0x0208,
+ 0x020a, 0x020a,
+ 0x020c, 0x020c,
+ 0x020e, 0x020e,
+ 0x0210, 0x0210,
+ 0x0212, 0x0212,
+ 0x0214, 0x0214,
+ 0x0216, 0x0216,
+ 0x0218, 0x0218,
+ 0x021a, 0x021a,
+ 0x021c, 0x021c,
+ 0x021e, 0x021e,
+ 0x0220, 0x0220,
+ 0x0222, 0x0222,
+ 0x0224, 0x0224,
+ 0x0226, 0x0226,
+ 0x0228, 0x0228,
+ 0x022a, 0x022a,
+ 0x022c, 0x022c,
+ 0x022e, 0x022e,
+ 0x0230, 0x0230,
+ 0x0232, 0x0232,
+ 0x023a, 0x023b,
+ 0x023d, 0x023e,
+ 0x0241, 0x0241,
+ 0x0243, 0x0246,
+ 0x0248, 0x0248,
+ 0x024a, 0x024a,
+ 0x024c, 0x024c,
+ 0x024e, 0x024e,
+ 0x0370, 0x0370,
+ 0x0372, 0x0372,
+ 0x0376, 0x0376,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x038f,
+ 0x0391, 0x03a1,
+ 0x03a3, 0x03ab,
+ 0x03cf, 0x03cf,
+ 0x03d2, 0x03d4,
+ 0x03d8, 0x03d8,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03e2,
+ 0x03e4, 0x03e4,
+ 0x03e6, 0x03e6,
+ 0x03e8, 0x03e8,
+ 0x03ea, 0x03ea,
+ 0x03ec, 0x03ec,
+ 0x03ee, 0x03ee,
+ 0x03f4, 0x03f4,
+ 0x03f7, 0x03f7,
+ 0x03f9, 0x03fa,
+ 0x03fd, 0x042f,
+ 0x0460, 0x0460,
+ 0x0462, 0x0462,
+ 0x0464, 0x0464,
+ 0x0466, 0x0466,
+ 0x0468, 0x0468,
+ 0x046a, 0x046a,
+ 0x046c, 0x046c,
+ 0x046e, 0x046e,
+ 0x0470, 0x0470,
+ 0x0472, 0x0472,
+ 0x0474, 0x0474,
+ 0x0476, 0x0476,
+ 0x0478, 0x0478,
+ 0x047a, 0x047a,
+ 0x047c, 0x047c,
+ 0x047e, 0x047e,
+ 0x0480, 0x0480,
+ 0x048a, 0x048a,
+ 0x048c, 0x048c,
+ 0x048e, 0x048e,
+ 0x0490, 0x0490,
+ 0x0492, 0x0492,
+ 0x0494, 0x0494,
+ 0x0496, 0x0496,
+ 0x0498, 0x0498,
+ 0x049a, 0x049a,
+ 0x049c, 0x049c,
+ 0x049e, 0x049e,
+ 0x04a0, 0x04a0,
+ 0x04a2, 0x04a2,
+ 0x04a4, 0x04a4,
+ 0x04a6, 0x04a6,
+ 0x04a8, 0x04a8,
+ 0x04aa, 0x04aa,
+ 0x04ac, 0x04ac,
+ 0x04ae, 0x04ae,
+ 0x04b0, 0x04b0,
+ 0x04b2, 0x04b2,
+ 0x04b4, 0x04b4,
+ 0x04b6, 0x04b6,
+ 0x04b8, 0x04b8,
+ 0x04ba, 0x04ba,
+ 0x04bc, 0x04bc,
+ 0x04be, 0x04be,
+ 0x04c0, 0x04c1,
+ 0x04c3, 0x04c3,
+ 0x04c5, 0x04c5,
+ 0x04c7, 0x04c7,
+ 0x04c9, 0x04c9,
+ 0x04cb, 0x04cb,
+ 0x04cd, 0x04cd,
+ 0x04d0, 0x04d0,
+ 0x04d2, 0x04d2,
+ 0x04d4, 0x04d4,
+ 0x04d6, 0x04d6,
+ 0x04d8, 0x04d8,
+ 0x04da, 0x04da,
+ 0x04dc, 0x04dc,
+ 0x04de, 0x04de,
+ 0x04e0, 0x04e0,
+ 0x04e2, 0x04e2,
+ 0x04e4, 0x04e4,
+ 0x04e6, 0x04e6,
+ 0x04e8, 0x04e8,
+ 0x04ea, 0x04ea,
+ 0x04ec, 0x04ec,
+ 0x04ee, 0x04ee,
+ 0x04f0, 0x04f0,
+ 0x04f2, 0x04f2,
+ 0x04f4, 0x04f4,
+ 0x04f6, 0x04f6,
+ 0x04f8, 0x04f8,
+ 0x04fa, 0x04fa,
+ 0x04fc, 0x04fc,
+ 0x04fe, 0x04fe,
+ 0x0500, 0x0500,
+ 0x0502, 0x0502,
+ 0x0504, 0x0504,
+ 0x0506, 0x0506,
+ 0x0508, 0x0508,
+ 0x050a, 0x050a,
+ 0x050c, 0x050c,
+ 0x050e, 0x050e,
+ 0x0510, 0x0510,
+ 0x0512, 0x0512,
+ 0x0514, 0x0514,
+ 0x0516, 0x0516,
+ 0x0518, 0x0518,
+ 0x051a, 0x051a,
+ 0x051c, 0x051c,
+ 0x051e, 0x051e,
+ 0x0520, 0x0520,
+ 0x0522, 0x0522,
+ 0x0524, 0x0524,
+ 0x0526, 0x0526,
+ 0x0531, 0x0556,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x1e00, 0x1e00,
+ 0x1e02, 0x1e02,
+ 0x1e04, 0x1e04,
+ 0x1e06, 0x1e06,
+ 0x1e08, 0x1e08,
+ 0x1e0a, 0x1e0a,
+ 0x1e0c, 0x1e0c,
+ 0x1e0e, 0x1e0e,
+ 0x1e10, 0x1e10,
+ 0x1e12, 0x1e12,
+ 0x1e14, 0x1e14,
+ 0x1e16, 0x1e16,
+ 0x1e18, 0x1e18,
+ 0x1e1a, 0x1e1a,
+ 0x1e1c, 0x1e1c,
+ 0x1e1e, 0x1e1e,
+ 0x1e20, 0x1e20,
+ 0x1e22, 0x1e22,
+ 0x1e24, 0x1e24,
+ 0x1e26, 0x1e26,
+ 0x1e28, 0x1e28,
+ 0x1e2a, 0x1e2a,
+ 0x1e2c, 0x1e2c,
+ 0x1e2e, 0x1e2e,
+ 0x1e30, 0x1e30,
+ 0x1e32, 0x1e32,
+ 0x1e34, 0x1e34,
+ 0x1e36, 0x1e36,
+ 0x1e38, 0x1e38,
+ 0x1e3a, 0x1e3a,
+ 0x1e3c, 0x1e3c,
+ 0x1e3e, 0x1e3e,
+ 0x1e40, 0x1e40,
+ 0x1e42, 0x1e42,
+ 0x1e44, 0x1e44,
+ 0x1e46, 0x1e46,
+ 0x1e48, 0x1e48,
+ 0x1e4a, 0x1e4a,
+ 0x1e4c, 0x1e4c,
+ 0x1e4e, 0x1e4e,
+ 0x1e50, 0x1e50,
+ 0x1e52, 0x1e52,
+ 0x1e54, 0x1e54,
+ 0x1e56, 0x1e56,
+ 0x1e58, 0x1e58,
+ 0x1e5a, 0x1e5a,
+ 0x1e5c, 0x1e5c,
+ 0x1e5e, 0x1e5e,
+ 0x1e60, 0x1e60,
+ 0x1e62, 0x1e62,
+ 0x1e64, 0x1e64,
+ 0x1e66, 0x1e66,
+ 0x1e68, 0x1e68,
+ 0x1e6a, 0x1e6a,
+ 0x1e6c, 0x1e6c,
+ 0x1e6e, 0x1e6e,
+ 0x1e70, 0x1e70,
+ 0x1e72, 0x1e72,
+ 0x1e74, 0x1e74,
+ 0x1e76, 0x1e76,
+ 0x1e78, 0x1e78,
+ 0x1e7a, 0x1e7a,
+ 0x1e7c, 0x1e7c,
+ 0x1e7e, 0x1e7e,
+ 0x1e80, 0x1e80,
+ 0x1e82, 0x1e82,
+ 0x1e84, 0x1e84,
+ 0x1e86, 0x1e86,
+ 0x1e88, 0x1e88,
+ 0x1e8a, 0x1e8a,
+ 0x1e8c, 0x1e8c,
+ 0x1e8e, 0x1e8e,
+ 0x1e90, 0x1e90,
+ 0x1e92, 0x1e92,
+ 0x1e94, 0x1e94,
+ 0x1e9e, 0x1e9e,
+ 0x1ea0, 0x1ea0,
+ 0x1ea2, 0x1ea2,
+ 0x1ea4, 0x1ea4,
+ 0x1ea6, 0x1ea6,
+ 0x1ea8, 0x1ea8,
+ 0x1eaa, 0x1eaa,
+ 0x1eac, 0x1eac,
+ 0x1eae, 0x1eae,
+ 0x1eb0, 0x1eb0,
+ 0x1eb2, 0x1eb2,
+ 0x1eb4, 0x1eb4,
+ 0x1eb6, 0x1eb6,
+ 0x1eb8, 0x1eb8,
+ 0x1eba, 0x1eba,
+ 0x1ebc, 0x1ebc,
+ 0x1ebe, 0x1ebe,
+ 0x1ec0, 0x1ec0,
+ 0x1ec2, 0x1ec2,
+ 0x1ec4, 0x1ec4,
+ 0x1ec6, 0x1ec6,
+ 0x1ec8, 0x1ec8,
+ 0x1eca, 0x1eca,
+ 0x1ecc, 0x1ecc,
+ 0x1ece, 0x1ece,
+ 0x1ed0, 0x1ed0,
+ 0x1ed2, 0x1ed2,
+ 0x1ed4, 0x1ed4,
+ 0x1ed6, 0x1ed6,
+ 0x1ed8, 0x1ed8,
+ 0x1eda, 0x1eda,
+ 0x1edc, 0x1edc,
+ 0x1ede, 0x1ede,
+ 0x1ee0, 0x1ee0,
+ 0x1ee2, 0x1ee2,
+ 0x1ee4, 0x1ee4,
+ 0x1ee6, 0x1ee6,
+ 0x1ee8, 0x1ee8,
+ 0x1eea, 0x1eea,
+ 0x1eec, 0x1eec,
+ 0x1eee, 0x1eee,
+ 0x1ef0, 0x1ef0,
+ 0x1ef2, 0x1ef2,
+ 0x1ef4, 0x1ef4,
+ 0x1ef6, 0x1ef6,
+ 0x1ef8, 0x1ef8,
+ 0x1efa, 0x1efa,
+ 0x1efc, 0x1efc,
+ 0x1efe, 0x1efe,
+ 0x1f08, 0x1f0f,
+ 0x1f18, 0x1f1d,
+ 0x1f28, 0x1f2f,
+ 0x1f38, 0x1f3f,
+ 0x1f48, 0x1f4d,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f5f,
+ 0x1f68, 0x1f6f,
+ 0x1fb8, 0x1fbb,
+ 0x1fc8, 0x1fcb,
+ 0x1fd8, 0x1fdb,
+ 0x1fe8, 0x1fec,
+ 0x1ff8, 0x1ffb,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210b, 0x210d,
+ 0x2110, 0x2112,
+ 0x2115, 0x2115,
+ 0x2119, 0x211d,
+ 0x2124, 0x2124,
+ 0x2126, 0x2126,
+ 0x2128, 0x2128,
+ 0x212a, 0x212d,
+ 0x2130, 0x2133,
+ 0x213e, 0x213f,
+ 0x2145, 0x2145,
+ 0x2160, 0x216f,
+ 0x2183, 0x2183,
+ 0x24b6, 0x24cf,
+ 0x2c00, 0x2c2e,
+ 0x2c60, 0x2c60,
+ 0x2c62, 0x2c64,
+ 0x2c67, 0x2c67,
+ 0x2c69, 0x2c69,
+ 0x2c6b, 0x2c6b,
+ 0x2c6d, 0x2c70,
+ 0x2c72, 0x2c72,
+ 0x2c75, 0x2c75,
+ 0x2c7e, 0x2c80,
+ 0x2c82, 0x2c82,
+ 0x2c84, 0x2c84,
+ 0x2c86, 0x2c86,
+ 0x2c88, 0x2c88,
+ 0x2c8a, 0x2c8a,
+ 0x2c8c, 0x2c8c,
+ 0x2c8e, 0x2c8e,
+ 0x2c90, 0x2c90,
+ 0x2c92, 0x2c92,
+ 0x2c94, 0x2c94,
+ 0x2c96, 0x2c96,
+ 0x2c98, 0x2c98,
+ 0x2c9a, 0x2c9a,
+ 0x2c9c, 0x2c9c,
+ 0x2c9e, 0x2c9e,
+ 0x2ca0, 0x2ca0,
+ 0x2ca2, 0x2ca2,
+ 0x2ca4, 0x2ca4,
+ 0x2ca6, 0x2ca6,
+ 0x2ca8, 0x2ca8,
+ 0x2caa, 0x2caa,
+ 0x2cac, 0x2cac,
+ 0x2cae, 0x2cae,
+ 0x2cb0, 0x2cb0,
+ 0x2cb2, 0x2cb2,
+ 0x2cb4, 0x2cb4,
+ 0x2cb6, 0x2cb6,
+ 0x2cb8, 0x2cb8,
+ 0x2cba, 0x2cba,
+ 0x2cbc, 0x2cbc,
+ 0x2cbe, 0x2cbe,
+ 0x2cc0, 0x2cc0,
+ 0x2cc2, 0x2cc2,
+ 0x2cc4, 0x2cc4,
+ 0x2cc6, 0x2cc6,
+ 0x2cc8, 0x2cc8,
+ 0x2cca, 0x2cca,
+ 0x2ccc, 0x2ccc,
+ 0x2cce, 0x2cce,
+ 0x2cd0, 0x2cd0,
+ 0x2cd2, 0x2cd2,
+ 0x2cd4, 0x2cd4,
+ 0x2cd6, 0x2cd6,
+ 0x2cd8, 0x2cd8,
+ 0x2cda, 0x2cda,
+ 0x2cdc, 0x2cdc,
+ 0x2cde, 0x2cde,
+ 0x2ce0, 0x2ce0,
+ 0x2ce2, 0x2ce2,
+ 0x2ceb, 0x2ceb,
+ 0x2ced, 0x2ced,
+ 0x2cf2, 0x2cf2,
+ 0xa640, 0xa640,
+ 0xa642, 0xa642,
+ 0xa644, 0xa644,
+ 0xa646, 0xa646,
+ 0xa648, 0xa648,
+ 0xa64a, 0xa64a,
+ 0xa64c, 0xa64c,
+ 0xa64e, 0xa64e,
+ 0xa650, 0xa650,
+ 0xa652, 0xa652,
+ 0xa654, 0xa654,
+ 0xa656, 0xa656,
+ 0xa658, 0xa658,
+ 0xa65a, 0xa65a,
+ 0xa65c, 0xa65c,
+ 0xa65e, 0xa65e,
+ 0xa660, 0xa660,
+ 0xa662, 0xa662,
+ 0xa664, 0xa664,
+ 0xa666, 0xa666,
+ 0xa668, 0xa668,
+ 0xa66a, 0xa66a,
+ 0xa66c, 0xa66c,
+ 0xa680, 0xa680,
+ 0xa682, 0xa682,
+ 0xa684, 0xa684,
+ 0xa686, 0xa686,
+ 0xa688, 0xa688,
+ 0xa68a, 0xa68a,
+ 0xa68c, 0xa68c,
+ 0xa68e, 0xa68e,
+ 0xa690, 0xa690,
+ 0xa692, 0xa692,
+ 0xa694, 0xa694,
+ 0xa696, 0xa696,
+ 0xa722, 0xa722,
+ 0xa724, 0xa724,
+ 0xa726, 0xa726,
+ 0xa728, 0xa728,
+ 0xa72a, 0xa72a,
+ 0xa72c, 0xa72c,
+ 0xa72e, 0xa72e,
+ 0xa732, 0xa732,
+ 0xa734, 0xa734,
+ 0xa736, 0xa736,
+ 0xa738, 0xa738,
+ 0xa73a, 0xa73a,
+ 0xa73c, 0xa73c,
+ 0xa73e, 0xa73e,
+ 0xa740, 0xa740,
+ 0xa742, 0xa742,
+ 0xa744, 0xa744,
+ 0xa746, 0xa746,
+ 0xa748, 0xa748,
+ 0xa74a, 0xa74a,
+ 0xa74c, 0xa74c,
+ 0xa74e, 0xa74e,
+ 0xa750, 0xa750,
+ 0xa752, 0xa752,
+ 0xa754, 0xa754,
+ 0xa756, 0xa756,
+ 0xa758, 0xa758,
+ 0xa75a, 0xa75a,
+ 0xa75c, 0xa75c,
+ 0xa75e, 0xa75e,
+ 0xa760, 0xa760,
+ 0xa762, 0xa762,
+ 0xa764, 0xa764,
+ 0xa766, 0xa766,
+ 0xa768, 0xa768,
+ 0xa76a, 0xa76a,
+ 0xa76c, 0xa76c,
+ 0xa76e, 0xa76e,
+ 0xa779, 0xa779,
+ 0xa77b, 0xa77b,
+ 0xa77d, 0xa77e,
+ 0xa780, 0xa780,
+ 0xa782, 0xa782,
+ 0xa784, 0xa784,
+ 0xa786, 0xa786,
+ 0xa78b, 0xa78b,
+ 0xa78d, 0xa78d,
+ 0xa790, 0xa790,
+ 0xa792, 0xa792,
+ 0xa7a0, 0xa7a0,
+ 0xa7a2, 0xa7a2,
+ 0xa7a4, 0xa7a4,
+ 0xa7a6, 0xa7a6,
+ 0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
+ 0xff21, 0xff3a,
+ 0x10400, 0x10427,
+ 0x1d400, 0x1d419,
+ 0x1d434, 0x1d44d,
+ 0x1d468, 0x1d481,
+ 0x1d49c, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b5,
+ 0x1d4d0, 0x1d4e9,
+ 0x1d504, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d538, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d56c, 0x1d585,
+ 0x1d5a0, 0x1d5b9,
+ 0x1d5d4, 0x1d5ed,
+ 0x1d608, 0x1d621,
+ 0x1d63c, 0x1d655,
+ 0x1d670, 0x1d689,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6e2, 0x1d6fa,
+ 0x1d71c, 0x1d734,
+ 0x1d756, 0x1d76e,
+ 0x1d790, 0x1d7a8,
+ 0x1d7ca, 0x1d7ca,
+}; /* CR_Upper */
+
+/* 'XDigit': [[:XDigit:]] */
+static const OnigCodePoint CR_XDigit[] = {
+ 3,
+ 0x0030, 0x0039,
+ 0x0041, 0x0046,
+ 0x0061, 0x0066,
+}; /* CR_XDigit */
+
+/* 'Word': [[:Word:]] */
+static const OnigCodePoint CR_Word[] = {
+ 564,
+ 0x0030, 0x0039,
+ 0x0041, 0x005a,
+ 0x005f, 0x005f,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0300, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x0483, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0669,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06df, 0x06e8,
+ 0x06ea, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0840, 0x085b,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0963,
+ 0x0966, 0x096f,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09f1,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3c, 0x0a3c,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4d,
+ 0x0a51, 0x0a51,
+ 0x0a59, 0x0a5c,
+ 0x0a5e, 0x0a5e,
+ 0x0a66, 0x0a75,
+ 0x0a81, 0x0a83,
+ 0x0a85, 0x0a8d,
+ 0x0a8f, 0x0a91,
+ 0x0a93, 0x0aa8,
+ 0x0aaa, 0x0ab0,
+ 0x0ab2, 0x0ab3,
+ 0x0ab5, 0x0ab9,
+ 0x0abc, 0x0ac5,
+ 0x0ac7, 0x0ac9,
+ 0x0acb, 0x0acd,
+ 0x0ad0, 0x0ad0,
+ 0x0ae0, 0x0ae3,
+ 0x0ae6, 0x0aef,
+ 0x0b01, 0x0b03,
+ 0x0b05, 0x0b0c,
+ 0x0b0f, 0x0b10,
+ 0x0b13, 0x0b28,
+ 0x0b2a, 0x0b30,
+ 0x0b32, 0x0b33,
+ 0x0b35, 0x0b39,
+ 0x0b3c, 0x0b44,
+ 0x0b47, 0x0b48,
+ 0x0b4b, 0x0b4d,
+ 0x0b56, 0x0b57,
+ 0x0b5c, 0x0b5d,
+ 0x0b5f, 0x0b63,
+ 0x0b66, 0x0b6f,
+ 0x0b71, 0x0b71,
+ 0x0b82, 0x0b83,
+ 0x0b85, 0x0b8a,
+ 0x0b8e, 0x0b90,
+ 0x0b92, 0x0b95,
+ 0x0b99, 0x0b9a,
+ 0x0b9c, 0x0b9c,
+ 0x0b9e, 0x0b9f,
+ 0x0ba3, 0x0ba4,
+ 0x0ba8, 0x0baa,
+ 0x0bae, 0x0bb9,
+ 0x0bbe, 0x0bc2,
+ 0x0bc6, 0x0bc8,
+ 0x0bca, 0x0bcd,
+ 0x0bd0, 0x0bd0,
+ 0x0bd7, 0x0bd7,
+ 0x0be6, 0x0bef,
+ 0x0c01, 0x0c03,
+ 0x0c05, 0x0c0c,
+ 0x0c0e, 0x0c10,
+ 0x0c12, 0x0c28,
+ 0x0c2a, 0x0c33,
+ 0x0c35, 0x0c39,
+ 0x0c3d, 0x0c44,
+ 0x0c46, 0x0c48,
+ 0x0c4a, 0x0c4d,
+ 0x0c55, 0x0c56,
+ 0x0c58, 0x0c59,
+ 0x0c60, 0x0c63,
+ 0x0c66, 0x0c6f,
+ 0x0c82, 0x0c83,
+ 0x0c85, 0x0c8c,
+ 0x0c8e, 0x0c90,
+ 0x0c92, 0x0ca8,
+ 0x0caa, 0x0cb3,
+ 0x0cb5, 0x0cb9,
+ 0x0cbc, 0x0cc4,
+ 0x0cc6, 0x0cc8,
+ 0x0cca, 0x0ccd,
+ 0x0cd5, 0x0cd6,
+ 0x0cde, 0x0cde,
+ 0x0ce0, 0x0ce3,
+ 0x0ce6, 0x0cef,
+ 0x0cf1, 0x0cf2,
+ 0x0d02, 0x0d03,
+ 0x0d05, 0x0d0c,
+ 0x0d0e, 0x0d10,
+ 0x0d12, 0x0d3a,
+ 0x0d3d, 0x0d44,
+ 0x0d46, 0x0d48,
+ 0x0d4a, 0x0d4e,
+ 0x0d57, 0x0d57,
+ 0x0d60, 0x0d63,
+ 0x0d66, 0x0d6f,
+ 0x0d7a, 0x0d7f,
+ 0x0d82, 0x0d83,
+ 0x0d85, 0x0d96,
+ 0x0d9a, 0x0db1,
+ 0x0db3, 0x0dbb,
+ 0x0dbd, 0x0dbd,
+ 0x0dc0, 0x0dc6,
+ 0x0dca, 0x0dca,
+ 0x0dcf, 0x0dd4,
+ 0x0dd6, 0x0dd6,
+ 0x0dd8, 0x0ddf,
+ 0x0df2, 0x0df3,
+ 0x0e01, 0x0e3a,
+ 0x0e40, 0x0e4e,
+ 0x0e50, 0x0e59,
+ 0x0e81, 0x0e82,
+ 0x0e84, 0x0e84,
+ 0x0e87, 0x0e88,
+ 0x0e8a, 0x0e8a,
+ 0x0e8d, 0x0e8d,
+ 0x0e94, 0x0e97,
+ 0x0e99, 0x0e9f,
+ 0x0ea1, 0x0ea3,
+ 0x0ea5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ec8, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f00,
+ 0x0f18, 0x0f19,
+ 0x0f20, 0x0f29,
+ 0x0f35, 0x0f35,
+ 0x0f37, 0x0f37,
+ 0x0f39, 0x0f39,
+ 0x0f3e, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f84,
+ 0x0f86, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fc6, 0x0fc6,
+ 0x1000, 0x1049,
+ 0x1050, 0x109d,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135d, 0x135f,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+ 0x1720, 0x1734,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17d3,
+ 0x17d7, 0x17d7,
+ 0x17dc, 0x17dd,
+ 0x17e0, 0x17e9,
+ 0x180b, 0x180d,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1946, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19d9,
+ 0x1a00, 0x1a1b,
+ 0x1a20, 0x1a5e,
+ 0x1a60, 0x1a7c,
+ 0x1a7f, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa7, 0x1aa7,
+ 0x1b00, 0x1b4b,
+ 0x1b50, 0x1b59,
+ 0x1b6b, 0x1b73,
+ 0x1b80, 0x1bf3,
+ 0x1c00, 0x1c37,
+ 0x1c40, 0x1c49,
+ 0x1c4d, 0x1c7d,
+ 0x1cd0, 0x1cd2,
+ 0x1cd4, 0x1cf6,
+ 0x1d00, 0x1de6,
+ 0x1dfc, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fbc,
+ 0x1fbe, 0x1fbe,
+ 0x1fc2, 0x1fc4,
+ 0x1fc6, 0x1fcc,
+ 0x1fd0, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fe0, 0x1fec,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffc,
+ 0x203f, 0x2040,
+ 0x2054, 0x2054,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x20d0, 0x20f0,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210a, 0x2113,
+ 0x2115, 0x2115,
+ 0x2119, 0x211d,
+ 0x2124, 0x2124,
+ 0x2126, 0x2126,
+ 0x2128, 0x2128,
+ 0x212a, 0x212d,
+ 0x212f, 0x2139,
+ 0x213c, 0x213f,
+ 0x2145, 0x2149,
+ 0x214e, 0x214e,
+ 0x2160, 0x2188,
+ 0x24b6, 0x24e9,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2ce4,
+ 0x2ceb, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
+ 0x2d6f, 0x2d6f,
+ 0x2d7f, 0x2d96,
+ 0x2da0, 0x2da6,
+ 0x2da8, 0x2dae,
+ 0x2db0, 0x2db6,
+ 0x2db8, 0x2dbe,
+ 0x2dc0, 0x2dc6,
+ 0x2dc8, 0x2dce,
+ 0x2dd0, 0x2dd6,
+ 0x2dd8, 0x2dde,
+ 0x2de0, 0x2dff,
+ 0x2e2f, 0x2e2f,
+ 0x3005, 0x3007,
+ 0x3021, 0x302f,
+ 0x3031, 0x3035,
+ 0x3038, 0x303c,
+ 0x3041, 0x3096,
+ 0x3099, 0x309a,
+ 0x309d, 0x309f,
+ 0x30a1, 0x30fa,
+ 0x30fc, 0x30ff,
+ 0x3105, 0x312d,
+ 0x3131, 0x318e,
+ 0x31a0, 0x31ba,
+ 0x31f0, 0x31ff,
+ 0x3400, 0x4db5,
+ 0x4e00, 0x9fcc,
+ 0xa000, 0xa48c,
+ 0xa4d0, 0xa4fd,
+ 0xa500, 0xa60c,
+ 0xa610, 0xa62b,
+ 0xa640, 0xa672,
+ 0xa674, 0xa67d,
+ 0xa67f, 0xa697,
+ 0xa69f, 0xa6f1,
+ 0xa717, 0xa71f,
+ 0xa722, 0xa788,
+ 0xa78b, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa827,
+ 0xa840, 0xa873,
+ 0xa880, 0xa8c4,
+ 0xa8d0, 0xa8d9,
+ 0xa8e0, 0xa8f7,
+ 0xa8fb, 0xa8fb,
+ 0xa900, 0xa92d,
+ 0xa930, 0xa953,
+ 0xa960, 0xa97c,
+ 0xa980, 0xa9c0,
+ 0xa9cf, 0xa9d9,
+ 0xaa00, 0xaa36,
+ 0xaa40, 0xaa4d,
+ 0xaa50, 0xaa59,
+ 0xaa60, 0xaa76,
+ 0xaa7a, 0xaa7b,
+ 0xaa80, 0xaac2,
+ 0xaadb, 0xaadd,
+ 0xaae0, 0xaaef,
+ 0xaaf2, 0xaaf6,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabea,
+ 0xabec, 0xabed,
+ 0xabf0, 0xabf9,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb28,
+ 0xfb2a, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe00, 0xfe0f,
+ 0xfe20, 0xfe26,
+ 0xfe33, 0xfe34,
+ 0xfe4d, 0xfe4f,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff10, 0xff19,
+ 0xff21, 0xff3a,
+ 0xff3f, 0xff3f,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x101fd, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a3f,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11046,
+ 0x11066, 0x1106f,
+ 0x11080, 0x110ba,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x1113f,
+ 0x11180, 0x111c4,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d165, 0x1d169,
+ 0x1d16d, 0x1d172,
+ 0x1d17b, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0x1d242, 0x1d244,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0100, 0xe01ef,
+}; /* CR_Word */
+
+/* 'Alnum': [[:Alnum:]] */
+static const OnigCodePoint CR_Alnum[] = {
+ 566,
+ 0x0030, 0x0039,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0345, 0x0345,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05b0, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0657,
+ 0x0659, 0x0669,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06e1, 0x06e8,
+ 0x06ed, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x073f,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07ea,
+ 0x07f4, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x0817,
+ 0x081a, 0x082c,
+ 0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08e9,
+ 0x08f0, 0x08fe,
+ 0x0900, 0x093b,
+ 0x093d, 0x094c,
+ 0x094e, 0x0950,
+ 0x0955, 0x0963,
+ 0x0966, 0x096f,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bd, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09cc,
+ 0x09ce, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09f1,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4c,
+ 0x0a51, 0x0a51,
+ 0x0a59, 0x0a5c,
+ 0x0a5e, 0x0a5e,
+ 0x0a66, 0x0a75,
+ 0x0a81, 0x0a83,
+ 0x0a85, 0x0a8d,
+ 0x0a8f, 0x0a91,
+ 0x0a93, 0x0aa8,
+ 0x0aaa, 0x0ab0,
+ 0x0ab2, 0x0ab3,
+ 0x0ab5, 0x0ab9,
+ 0x0abd, 0x0ac5,
+ 0x0ac7, 0x0ac9,
+ 0x0acb, 0x0acc,
+ 0x0ad0, 0x0ad0,
+ 0x0ae0, 0x0ae3,
+ 0x0ae6, 0x0aef,
+ 0x0b01, 0x0b03,
+ 0x0b05, 0x0b0c,
+ 0x0b0f, 0x0b10,
+ 0x0b13, 0x0b28,
+ 0x0b2a, 0x0b30,
+ 0x0b32, 0x0b33,
+ 0x0b35, 0x0b39,
+ 0x0b3d, 0x0b44,
+ 0x0b47, 0x0b48,
+ 0x0b4b, 0x0b4c,
+ 0x0b56, 0x0b57,
+ 0x0b5c, 0x0b5d,
+ 0x0b5f, 0x0b63,
+ 0x0b66, 0x0b6f,
+ 0x0b71, 0x0b71,
+ 0x0b82, 0x0b83,
+ 0x0b85, 0x0b8a,
+ 0x0b8e, 0x0b90,
+ 0x0b92, 0x0b95,
+ 0x0b99, 0x0b9a,
+ 0x0b9c, 0x0b9c,
+ 0x0b9e, 0x0b9f,
+ 0x0ba3, 0x0ba4,
+ 0x0ba8, 0x0baa,
+ 0x0bae, 0x0bb9,
+ 0x0bbe, 0x0bc2,
+ 0x0bc6, 0x0bc8,
+ 0x0bca, 0x0bcc,
+ 0x0bd0, 0x0bd0,
+ 0x0bd7, 0x0bd7,
+ 0x0be6, 0x0bef,
+ 0x0c01, 0x0c03,
+ 0x0c05, 0x0c0c,
+ 0x0c0e, 0x0c10,
+ 0x0c12, 0x0c28,
+ 0x0c2a, 0x0c33,
+ 0x0c35, 0x0c39,
+ 0x0c3d, 0x0c44,
+ 0x0c46, 0x0c48,
+ 0x0c4a, 0x0c4c,
+ 0x0c55, 0x0c56,
+ 0x0c58, 0x0c59,
+ 0x0c60, 0x0c63,
+ 0x0c66, 0x0c6f,
+ 0x0c82, 0x0c83,
+ 0x0c85, 0x0c8c,
+ 0x0c8e, 0x0c90,
+ 0x0c92, 0x0ca8,
+ 0x0caa, 0x0cb3,
+ 0x0cb5, 0x0cb9,
+ 0x0cbd, 0x0cc4,
+ 0x0cc6, 0x0cc8,
+ 0x0cca, 0x0ccc,
+ 0x0cd5, 0x0cd6,
+ 0x0cde, 0x0cde,
+ 0x0ce0, 0x0ce3,
+ 0x0ce6, 0x0cef,
+ 0x0cf1, 0x0cf2,
+ 0x0d02, 0x0d03,
+ 0x0d05, 0x0d0c,
+ 0x0d0e, 0x0d10,
+ 0x0d12, 0x0d3a,
+ 0x0d3d, 0x0d44,
+ 0x0d46, 0x0d48,
+ 0x0d4a, 0x0d4c,
+ 0x0d4e, 0x0d4e,
+ 0x0d57, 0x0d57,
+ 0x0d60, 0x0d63,
+ 0x0d66, 0x0d6f,
+ 0x0d7a, 0x0d7f,
+ 0x0d82, 0x0d83,
+ 0x0d85, 0x0d96,
+ 0x0d9a, 0x0db1,
+ 0x0db3, 0x0dbb,
+ 0x0dbd, 0x0dbd,
+ 0x0dc0, 0x0dc6,
+ 0x0dcf, 0x0dd4,
+ 0x0dd6, 0x0dd6,
+ 0x0dd8, 0x0ddf,
+ 0x0df2, 0x0df3,
+ 0x0e01, 0x0e3a,
+ 0x0e40, 0x0e46,
+ 0x0e4d, 0x0e4d,
+ 0x0e50, 0x0e59,
+ 0x0e81, 0x0e82,
+ 0x0e84, 0x0e84,
+ 0x0e87, 0x0e88,
+ 0x0e8a, 0x0e8a,
+ 0x0e8d, 0x0e8d,
+ 0x0e94, 0x0e97,
+ 0x0e99, 0x0e9f,
+ 0x0ea1, 0x0ea3,
+ 0x0ea5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ecd, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f00,
+ 0x0f20, 0x0f29,
+ 0x0f40, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f81,
+ 0x0f88, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x1000, 0x1036,
+ 0x1038, 0x1038,
+ 0x103b, 0x1049,
+ 0x1050, 0x1062,
+ 0x1065, 0x1068,
+ 0x106e, 0x1086,
+ 0x108e, 0x108e,
+ 0x1090, 0x1099,
+ 0x109c, 0x109d,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135f, 0x135f,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1713,
+ 0x1720, 0x1733,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17b3,
+ 0x17b6, 0x17c8,
+ 0x17d7, 0x17d7,
+ 0x17dc, 0x17dc,
+ 0x17e0, 0x17e9,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x1938,
+ 0x1946, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19d9,
+ 0x1a00, 0x1a1b,
+ 0x1a20, 0x1a5e,
+ 0x1a61, 0x1a74,
+ 0x1a80, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa7, 0x1aa7,
+ 0x1b00, 0x1b33,
+ 0x1b35, 0x1b43,
+ 0x1b45, 0x1b4b,
+ 0x1b50, 0x1b59,
+ 0x1b80, 0x1ba9,
+ 0x1bac, 0x1be5,
+ 0x1be7, 0x1bf1,
+ 0x1c00, 0x1c35,
+ 0x1c40, 0x1c49,
+ 0x1c4d, 0x1c7d,
+ 0x1ce9, 0x1cec,
+ 0x1cee, 0x1cf3,
+ 0x1cf5, 0x1cf6,
+ 0x1d00, 0x1dbf,
+ 0x1e00, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fbc,
+ 0x1fbe, 0x1fbe,
+ 0x1fc2, 0x1fc4,
+ 0x1fc6, 0x1fcc,
+ 0x1fd0, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fe0, 0x1fec,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffc,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210a, 0x2113,
+ 0x2115, 0x2115,
+ 0x2119, 0x211d,
+ 0x2124, 0x2124,
+ 0x2126, 0x2126,
+ 0x2128, 0x2128,
+ 0x212a, 0x212d,
+ 0x212f, 0x2139,
+ 0x213c, 0x213f,
+ 0x2145, 0x2149,
+ 0x214e, 0x214e,
+ 0x2160, 0x2188,
+ 0x24b6, 0x24e9,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2ce4,
+ 0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
+ 0x2d6f, 0x2d6f,
+ 0x2d80, 0x2d96,
+ 0x2da0, 0x2da6,
+ 0x2da8, 0x2dae,
+ 0x2db0, 0x2db6,
+ 0x2db8, 0x2dbe,
+ 0x2dc0, 0x2dc6,
+ 0x2dc8, 0x2dce,
+ 0x2dd0, 0x2dd6,
+ 0x2dd8, 0x2dde,
+ 0x2de0, 0x2dff,
+ 0x2e2f, 0x2e2f,
+ 0x3005, 0x3007,
+ 0x3021, 0x3029,
+ 0x3031, 0x3035,
+ 0x3038, 0x303c,
+ 0x3041, 0x3096,
+ 0x309d, 0x309f,
+ 0x30a1, 0x30fa,
+ 0x30fc, 0x30ff,
+ 0x3105, 0x312d,
+ 0x3131, 0x318e,
+ 0x31a0, 0x31ba,
+ 0x31f0, 0x31ff,
+ 0x3400, 0x4db5,
+ 0x4e00, 0x9fcc,
+ 0xa000, 0xa48c,
+ 0xa4d0, 0xa4fd,
+ 0xa500, 0xa60c,
+ 0xa610, 0xa62b,
+ 0xa640, 0xa66e,
+ 0xa674, 0xa67b,
+ 0xa67f, 0xa697,
+ 0xa69f, 0xa6ef,
+ 0xa717, 0xa71f,
+ 0xa722, 0xa788,
+ 0xa78b, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa801,
+ 0xa803, 0xa805,
+ 0xa807, 0xa80a,
+ 0xa80c, 0xa827,
+ 0xa840, 0xa873,
+ 0xa880, 0xa8c3,
+ 0xa8d0, 0xa8d9,
+ 0xa8f2, 0xa8f7,
+ 0xa8fb, 0xa8fb,
+ 0xa900, 0xa92a,
+ 0xa930, 0xa952,
+ 0xa960, 0xa97c,
+ 0xa980, 0xa9b2,
+ 0xa9b4, 0xa9bf,
+ 0xa9cf, 0xa9d9,
+ 0xaa00, 0xaa36,
+ 0xaa40, 0xaa4d,
+ 0xaa50, 0xaa59,
+ 0xaa60, 0xaa76,
+ 0xaa7a, 0xaa7a,
+ 0xaa80, 0xaabe,
+ 0xaac0, 0xaac0,
+ 0xaac2, 0xaac2,
+ 0xaadb, 0xaadd,
+ 0xaae0, 0xaaef,
+ 0xaaf2, 0xaaf5,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabea,
+ 0xabf0, 0xabf9,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb28,
+ 0xfb2a, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff10, 0xff19,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11045,
+ 0x11066, 0x1106f,
+ 0x11082, 0x110b8,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11132,
+ 0x11136, 0x1113f,
+ 0x11180, 0x111bf,
+ 0x111c1, 0x111c4,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b5,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f93, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Alnum */
+
+/* 'ASCII': [[:ASCII:]] */
+static const OnigCodePoint CR_ASCII[] = {
+ 1,
+ 0x0000, 0x007f,
+}; /* CR_ASCII */
+
#ifdef USE_UNICODE_PROPERTIES
/* 'Any': - */
static const OnigCodePoint CR_Any[] = {
@@ -10,7 +4277,7 @@ static const OnigCodePoint CR_Any[] = {
/* 'Assigned': - */
static const OnigCodePoint CR_Assigned[] = {
- 501,
+ 539,
0x0000, 0x0377,
0x037a, 0x037e,
0x0384, 0x038a,
@@ -21,10 +4288,11 @@ static const OnigCodePoint CR_Assigned[] = {
0x0559, 0x055f,
0x0561, 0x0587,
0x0589, 0x058a,
+ 0x058f, 0x058f,
0x0591, 0x05c7,
0x05d0, 0x05ea,
0x05f0, 0x05f4,
- 0x0600, 0x0603,
+ 0x0600, 0x0604,
0x0606, 0x061b,
0x061e, 0x070d,
0x070f, 0x074a,
@@ -34,6 +4302,9 @@ static const OnigCodePoint CR_Assigned[] = {
0x0830, 0x083e,
0x0840, 0x085b,
0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
0x0900, 0x0977,
0x0979, 0x097f,
0x0981, 0x0983,
@@ -78,8 +4349,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x0acb, 0x0acd,
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0af1, 0x0af1,
+ 0x0ae6, 0x0af1,
0x0b01, 0x0b03,
0x0b05, 0x0b0c,
0x0b0f, 0x0b10,
@@ -179,7 +4449,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x0ec6, 0x0ec6,
0x0ec8, 0x0ecd,
0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f47,
0x0f49, 0x0f6c,
0x0f71, 0x0f97,
@@ -187,8 +4457,9 @@ static const OnigCodePoint CR_Assigned[] = {
0x0fbe, 0x0fcc,
0x0fce, 0x0fda,
0x1000, 0x10c5,
- 0x10d0, 0x10fc,
- 0x1100, 0x1248,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -241,13 +4512,12 @@ static const OnigCodePoint CR_Assigned[] = {
0x1aa0, 0x1aad,
0x1b00, 0x1b4b,
0x1b50, 0x1b7c,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1bf3,
+ 0x1b80, 0x1bf3,
0x1bfc, 0x1c37,
0x1c3b, 0x1c49,
0x1c4d, 0x1c7f,
- 0x1cd0, 0x1cf2,
+ 0x1cc0, 0x1cc7,
+ 0x1cd0, 0x1cf6,
0x1d00, 0x1de6,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
@@ -276,15 +4546,15 @@ static const OnigCodePoint CR_Assigned[] = {
0x2400, 0x2426,
0x2440, 0x244a,
0x2460, 0x26ff,
- 0x2701, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x2b4c,
+ 0x2701, 0x2b4c,
0x2b50, 0x2b59,
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
- 0x2c60, 0x2cf1,
+ 0x2c60, 0x2cf3,
0x2cf9, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d70,
0x2d7f, 0x2d96,
0x2da0, 0x2da6,
@@ -295,7 +4565,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x2dc8, 0x2dce,
0x2dd0, 0x2dd6,
0x2dd8, 0x2dde,
- 0x2de0, 0x2e31,
+ 0x2de0, 0x2e3b,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
0x2f00, 0x2fd5,
@@ -310,17 +4580,16 @@ static const OnigCodePoint CR_Assigned[] = {
0x31f0, 0x321e,
0x3220, 0x32fe,
0x3300, 0x4db5,
- 0x4dc0, 0x9fcb,
+ 0x4dc0, 0x9fcc,
0xa000, 0xa48c,
0xa490, 0xa4c6,
0xa4d0, 0xa62b,
- 0xa640, 0xa673,
- 0xa67c, 0xa697,
- 0xa6a0, 0xa6f7,
+ 0xa640, 0xa697,
+ 0xa69f, 0xa6f7,
0xa700, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa82b,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa82b,
0xa830, 0xa839,
0xa840, 0xa877,
0xa880, 0xa8c4,
@@ -336,7 +4605,7 @@ static const OnigCodePoint CR_Assigned[] = {
0xaa50, 0xaa59,
0xaa5c, 0xaa7b,
0xaa80, 0xaac2,
- 0xaadb, 0xaadf,
+ 0xaadb, 0xaaf6,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -347,8 +4616,7 @@ static const OnigCodePoint CR_Assigned[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xd800, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xd800, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -410,6 +4678,8 @@ static const OnigCodePoint CR_Assigned[] = {
0x10900, 0x1091b,
0x1091f, 0x10939,
0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a13,
@@ -428,11 +4698,22 @@ static const OnigCodePoint CR_Assigned[] = {
0x11000, 0x1104d,
0x11052, 0x1106f,
0x11080, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
0x12000, 0x1236e,
0x12400, 0x12462,
0x12470, 0x12473,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
0x1d000, 0x1d0f5,
0x1d100, 0x1d126,
@@ -461,6 +4742,40 @@ static const OnigCodePoint CR_Assigned[] = {
0x1d552, 0x1d6a5,
0x1d6a8, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
@@ -469,7 +4784,7 @@ static const OnigCodePoint CR_Assigned[] = {
0x1f0d1, 0x1f0df,
0x1f100, 0x1f10a,
0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
+ 0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
0x1f1e6, 0x1f202,
0x1f210, 0x1f23a,
@@ -487,19 +4802,9 @@ static const OnigCodePoint CR_Assigned[] = {
0x1f442, 0x1f4f7,
0x1f4f9, 0x1f4fc,
0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
+ 0x1f5fb, 0x1f640,
0x1f645, 0x1f64f,
0x1f680, 0x1f6c5,
0x1f700, 0x1f773,
@@ -516,44 +4821,560 @@ static const OnigCodePoint CR_Assigned[] = {
/* 'C': Major Category */
static const OnigCodePoint CR_C[] = {
- 20,
+ 541,
0x0000, 0x001f,
0x007f, 0x009f,
0x00ad, 0x00ad,
- 0x0600, 0x0603,
+ 0x0378, 0x0379,
+ 0x037f, 0x0383,
+ 0x038b, 0x038b,
+ 0x038d, 0x038d,
+ 0x03a2, 0x03a2,
+ 0x0528, 0x0530,
+ 0x0557, 0x0558,
+ 0x0560, 0x0560,
+ 0x0588, 0x0588,
+ 0x058b, 0x058e,
+ 0x0590, 0x0590,
+ 0x05c8, 0x05cf,
+ 0x05eb, 0x05ef,
+ 0x05f5, 0x0605,
+ 0x061c, 0x061d,
0x06dd, 0x06dd,
- 0x070f, 0x070f,
- 0x17b4, 0x17b5,
+ 0x070e, 0x070f,
+ 0x074b, 0x074c,
+ 0x07b2, 0x07bf,
+ 0x07fb, 0x07ff,
+ 0x082e, 0x082f,
+ 0x083f, 0x083f,
+ 0x085c, 0x085d,
+ 0x085f, 0x089f,
+ 0x08a1, 0x08a1,
+ 0x08ad, 0x08e3,
+ 0x08ff, 0x08ff,
+ 0x0978, 0x0978,
+ 0x0980, 0x0980,
+ 0x0984, 0x0984,
+ 0x098d, 0x098e,
+ 0x0991, 0x0992,
+ 0x09a9, 0x09a9,
+ 0x09b1, 0x09b1,
+ 0x09b3, 0x09b5,
+ 0x09ba, 0x09bb,
+ 0x09c5, 0x09c6,
+ 0x09c9, 0x09ca,
+ 0x09cf, 0x09d6,
+ 0x09d8, 0x09db,
+ 0x09de, 0x09de,
+ 0x09e4, 0x09e5,
+ 0x09fc, 0x0a00,
+ 0x0a04, 0x0a04,
+ 0x0a0b, 0x0a0e,
+ 0x0a11, 0x0a12,
+ 0x0a29, 0x0a29,
+ 0x0a31, 0x0a31,
+ 0x0a34, 0x0a34,
+ 0x0a37, 0x0a37,
+ 0x0a3a, 0x0a3b,
+ 0x0a3d, 0x0a3d,
+ 0x0a43, 0x0a46,
+ 0x0a49, 0x0a4a,
+ 0x0a4e, 0x0a50,
+ 0x0a52, 0x0a58,
+ 0x0a5d, 0x0a5d,
+ 0x0a5f, 0x0a65,
+ 0x0a76, 0x0a80,
+ 0x0a84, 0x0a84,
+ 0x0a8e, 0x0a8e,
+ 0x0a92, 0x0a92,
+ 0x0aa9, 0x0aa9,
+ 0x0ab1, 0x0ab1,
+ 0x0ab4, 0x0ab4,
+ 0x0aba, 0x0abb,
+ 0x0ac6, 0x0ac6,
+ 0x0aca, 0x0aca,
+ 0x0ace, 0x0acf,
+ 0x0ad1, 0x0adf,
+ 0x0ae4, 0x0ae5,
+ 0x0af2, 0x0b00,
+ 0x0b04, 0x0b04,
+ 0x0b0d, 0x0b0e,
+ 0x0b11, 0x0b12,
+ 0x0b29, 0x0b29,
+ 0x0b31, 0x0b31,
+ 0x0b34, 0x0b34,
+ 0x0b3a, 0x0b3b,
+ 0x0b45, 0x0b46,
+ 0x0b49, 0x0b4a,
+ 0x0b4e, 0x0b55,
+ 0x0b58, 0x0b5b,
+ 0x0b5e, 0x0b5e,
+ 0x0b64, 0x0b65,
+ 0x0b78, 0x0b81,
+ 0x0b84, 0x0b84,
+ 0x0b8b, 0x0b8d,
+ 0x0b91, 0x0b91,
+ 0x0b96, 0x0b98,
+ 0x0b9b, 0x0b9b,
+ 0x0b9d, 0x0b9d,
+ 0x0ba0, 0x0ba2,
+ 0x0ba5, 0x0ba7,
+ 0x0bab, 0x0bad,
+ 0x0bba, 0x0bbd,
+ 0x0bc3, 0x0bc5,
+ 0x0bc9, 0x0bc9,
+ 0x0bce, 0x0bcf,
+ 0x0bd1, 0x0bd6,
+ 0x0bd8, 0x0be5,
+ 0x0bfb, 0x0c00,
+ 0x0c04, 0x0c04,
+ 0x0c0d, 0x0c0d,
+ 0x0c11, 0x0c11,
+ 0x0c29, 0x0c29,
+ 0x0c34, 0x0c34,
+ 0x0c3a, 0x0c3c,
+ 0x0c45, 0x0c45,
+ 0x0c49, 0x0c49,
+ 0x0c4e, 0x0c54,
+ 0x0c57, 0x0c57,
+ 0x0c5a, 0x0c5f,
+ 0x0c64, 0x0c65,
+ 0x0c70, 0x0c77,
+ 0x0c80, 0x0c81,
+ 0x0c84, 0x0c84,
+ 0x0c8d, 0x0c8d,
+ 0x0c91, 0x0c91,
+ 0x0ca9, 0x0ca9,
+ 0x0cb4, 0x0cb4,
+ 0x0cba, 0x0cbb,
+ 0x0cc5, 0x0cc5,
+ 0x0cc9, 0x0cc9,
+ 0x0cce, 0x0cd4,
+ 0x0cd7, 0x0cdd,
+ 0x0cdf, 0x0cdf,
+ 0x0ce4, 0x0ce5,
+ 0x0cf0, 0x0cf0,
+ 0x0cf3, 0x0d01,
+ 0x0d04, 0x0d04,
+ 0x0d0d, 0x0d0d,
+ 0x0d11, 0x0d11,
+ 0x0d3b, 0x0d3c,
+ 0x0d45, 0x0d45,
+ 0x0d49, 0x0d49,
+ 0x0d4f, 0x0d56,
+ 0x0d58, 0x0d5f,
+ 0x0d64, 0x0d65,
+ 0x0d76, 0x0d78,
+ 0x0d80, 0x0d81,
+ 0x0d84, 0x0d84,
+ 0x0d97, 0x0d99,
+ 0x0db2, 0x0db2,
+ 0x0dbc, 0x0dbc,
+ 0x0dbe, 0x0dbf,
+ 0x0dc7, 0x0dc9,
+ 0x0dcb, 0x0dce,
+ 0x0dd5, 0x0dd5,
+ 0x0dd7, 0x0dd7,
+ 0x0de0, 0x0df1,
+ 0x0df5, 0x0e00,
+ 0x0e3b, 0x0e3e,
+ 0x0e5c, 0x0e80,
+ 0x0e83, 0x0e83,
+ 0x0e85, 0x0e86,
+ 0x0e89, 0x0e89,
+ 0x0e8b, 0x0e8c,
+ 0x0e8e, 0x0e93,
+ 0x0e98, 0x0e98,
+ 0x0ea0, 0x0ea0,
+ 0x0ea4, 0x0ea4,
+ 0x0ea6, 0x0ea6,
+ 0x0ea8, 0x0ea9,
+ 0x0eac, 0x0eac,
+ 0x0eba, 0x0eba,
+ 0x0ebe, 0x0ebf,
+ 0x0ec5, 0x0ec5,
+ 0x0ec7, 0x0ec7,
+ 0x0ece, 0x0ecf,
+ 0x0eda, 0x0edb,
+ 0x0ee0, 0x0eff,
+ 0x0f48, 0x0f48,
+ 0x0f6d, 0x0f70,
+ 0x0f98, 0x0f98,
+ 0x0fbd, 0x0fbd,
+ 0x0fcd, 0x0fcd,
+ 0x0fdb, 0x0fff,
+ 0x10c6, 0x10c6,
+ 0x10c8, 0x10cc,
+ 0x10ce, 0x10cf,
+ 0x1249, 0x1249,
+ 0x124e, 0x124f,
+ 0x1257, 0x1257,
+ 0x1259, 0x1259,
+ 0x125e, 0x125f,
+ 0x1289, 0x1289,
+ 0x128e, 0x128f,
+ 0x12b1, 0x12b1,
+ 0x12b6, 0x12b7,
+ 0x12bf, 0x12bf,
+ 0x12c1, 0x12c1,
+ 0x12c6, 0x12c7,
+ 0x12d7, 0x12d7,
+ 0x1311, 0x1311,
+ 0x1316, 0x1317,
+ 0x135b, 0x135c,
+ 0x137d, 0x137f,
+ 0x139a, 0x139f,
+ 0x13f5, 0x13ff,
+ 0x169d, 0x169f,
+ 0x16f1, 0x16ff,
+ 0x170d, 0x170d,
+ 0x1715, 0x171f,
+ 0x1737, 0x173f,
+ 0x1754, 0x175f,
+ 0x176d, 0x176d,
+ 0x1771, 0x1771,
+ 0x1774, 0x177f,
+ 0x17de, 0x17df,
+ 0x17ea, 0x17ef,
+ 0x17fa, 0x17ff,
+ 0x180f, 0x180f,
+ 0x181a, 0x181f,
+ 0x1878, 0x187f,
+ 0x18ab, 0x18af,
+ 0x18f6, 0x18ff,
+ 0x191d, 0x191f,
+ 0x192c, 0x192f,
+ 0x193c, 0x193f,
+ 0x1941, 0x1943,
+ 0x196e, 0x196f,
+ 0x1975, 0x197f,
+ 0x19ac, 0x19af,
+ 0x19ca, 0x19cf,
+ 0x19db, 0x19dd,
+ 0x1a1c, 0x1a1d,
+ 0x1a5f, 0x1a5f,
+ 0x1a7d, 0x1a7e,
+ 0x1a8a, 0x1a8f,
+ 0x1a9a, 0x1a9f,
+ 0x1aae, 0x1aff,
+ 0x1b4c, 0x1b4f,
+ 0x1b7d, 0x1b7f,
+ 0x1bf4, 0x1bfb,
+ 0x1c38, 0x1c3a,
+ 0x1c4a, 0x1c4c,
+ 0x1c80, 0x1cbf,
+ 0x1cc8, 0x1ccf,
+ 0x1cf7, 0x1cff,
+ 0x1de7, 0x1dfb,
+ 0x1f16, 0x1f17,
+ 0x1f1e, 0x1f1f,
+ 0x1f46, 0x1f47,
+ 0x1f4e, 0x1f4f,
+ 0x1f58, 0x1f58,
+ 0x1f5a, 0x1f5a,
+ 0x1f5c, 0x1f5c,
+ 0x1f5e, 0x1f5e,
+ 0x1f7e, 0x1f7f,
+ 0x1fb5, 0x1fb5,
+ 0x1fc5, 0x1fc5,
+ 0x1fd4, 0x1fd5,
+ 0x1fdc, 0x1fdc,
+ 0x1ff0, 0x1ff1,
+ 0x1ff5, 0x1ff5,
+ 0x1fff, 0x1fff,
0x200b, 0x200f,
0x202a, 0x202e,
- 0x2060, 0x2064,
- 0x206a, 0x206f,
- 0xd800, 0xf8ff,
- 0xfeff, 0xfeff,
- 0xfff9, 0xfffb,
+ 0x2060, 0x206f,
+ 0x2072, 0x2073,
+ 0x208f, 0x208f,
+ 0x209d, 0x209f,
+ 0x20ba, 0x20cf,
+ 0x20f1, 0x20ff,
+ 0x218a, 0x218f,
+ 0x23f4, 0x23ff,
+ 0x2427, 0x243f,
+ 0x244b, 0x245f,
+ 0x2700, 0x2700,
+ 0x2b4d, 0x2b4f,
+ 0x2b5a, 0x2bff,
+ 0x2c2f, 0x2c2f,
+ 0x2c5f, 0x2c5f,
+ 0x2cf4, 0x2cf8,
+ 0x2d26, 0x2d26,
+ 0x2d28, 0x2d2c,
+ 0x2d2e, 0x2d2f,
+ 0x2d68, 0x2d6e,
+ 0x2d71, 0x2d7e,
+ 0x2d97, 0x2d9f,
+ 0x2da7, 0x2da7,
+ 0x2daf, 0x2daf,
+ 0x2db7, 0x2db7,
+ 0x2dbf, 0x2dbf,
+ 0x2dc7, 0x2dc7,
+ 0x2dcf, 0x2dcf,
+ 0x2dd7, 0x2dd7,
+ 0x2ddf, 0x2ddf,
+ 0x2e3c, 0x2e7f,
+ 0x2e9a, 0x2e9a,
+ 0x2ef4, 0x2eff,
+ 0x2fd6, 0x2fef,
+ 0x2ffc, 0x2fff,
+ 0x3040, 0x3040,
+ 0x3097, 0x3098,
+ 0x3100, 0x3104,
+ 0x312e, 0x3130,
+ 0x318f, 0x318f,
+ 0x31bb, 0x31bf,
+ 0x31e4, 0x31ef,
+ 0x321f, 0x321f,
+ 0x32ff, 0x32ff,
+ 0x4db6, 0x4dbf,
+ 0x9fcd, 0x9fff,
+ 0xa48d, 0xa48f,
+ 0xa4c7, 0xa4cf,
+ 0xa62c, 0xa63f,
+ 0xa698, 0xa69e,
+ 0xa6f8, 0xa6ff,
+ 0xa78f, 0xa78f,
+ 0xa794, 0xa79f,
+ 0xa7ab, 0xa7f7,
+ 0xa82c, 0xa82f,
+ 0xa83a, 0xa83f,
+ 0xa878, 0xa87f,
+ 0xa8c5, 0xa8cd,
+ 0xa8da, 0xa8df,
+ 0xa8fc, 0xa8ff,
+ 0xa954, 0xa95e,
+ 0xa97d, 0xa97f,
+ 0xa9ce, 0xa9ce,
+ 0xa9da, 0xa9dd,
+ 0xa9e0, 0xa9ff,
+ 0xaa37, 0xaa3f,
+ 0xaa4e, 0xaa4f,
+ 0xaa5a, 0xaa5b,
+ 0xaa7c, 0xaa7f,
+ 0xaac3, 0xaada,
+ 0xaaf7, 0xab00,
+ 0xab07, 0xab08,
+ 0xab0f, 0xab10,
+ 0xab17, 0xab1f,
+ 0xab27, 0xab27,
+ 0xab2f, 0xabbf,
+ 0xabee, 0xabef,
+ 0xabfa, 0xabff,
+ 0xd7a4, 0xd7af,
+ 0xd7c7, 0xd7ca,
+ 0xd7fc, 0xf8ff,
+ 0xfa6e, 0xfa6f,
+ 0xfada, 0xfaff,
+ 0xfb07, 0xfb12,
+ 0xfb18, 0xfb1c,
+ 0xfb37, 0xfb37,
+ 0xfb3d, 0xfb3d,
+ 0xfb3f, 0xfb3f,
+ 0xfb42, 0xfb42,
+ 0xfb45, 0xfb45,
+ 0xfbc2, 0xfbd2,
+ 0xfd40, 0xfd4f,
+ 0xfd90, 0xfd91,
+ 0xfdc8, 0xfdef,
+ 0xfdfe, 0xfdff,
+ 0xfe1a, 0xfe1f,
+ 0xfe27, 0xfe2f,
+ 0xfe53, 0xfe53,
+ 0xfe67, 0xfe67,
+ 0xfe6c, 0xfe6f,
+ 0xfe75, 0xfe75,
+ 0xfefd, 0xff00,
+ 0xffbf, 0xffc1,
+ 0xffc8, 0xffc9,
+ 0xffd0, 0xffd1,
+ 0xffd8, 0xffd9,
+ 0xffdd, 0xffdf,
+ 0xffe7, 0xffe7,
+ 0xffef, 0xfffb,
+ 0xfffe, 0xffff,
+ 0x1000c, 0x1000c,
+ 0x10027, 0x10027,
+ 0x1003b, 0x1003b,
+ 0x1003e, 0x1003e,
+ 0x1004e, 0x1004f,
+ 0x1005e, 0x1007f,
+ 0x100fb, 0x100ff,
+ 0x10103, 0x10106,
+ 0x10134, 0x10136,
+ 0x1018b, 0x1018f,
+ 0x1019c, 0x101cf,
+ 0x101fe, 0x1027f,
+ 0x1029d, 0x1029f,
+ 0x102d1, 0x102ff,
+ 0x1031f, 0x1031f,
+ 0x10324, 0x1032f,
+ 0x1034b, 0x1037f,
+ 0x1039e, 0x1039e,
+ 0x103c4, 0x103c7,
+ 0x103d6, 0x103ff,
+ 0x1049e, 0x1049f,
+ 0x104aa, 0x107ff,
+ 0x10806, 0x10807,
+ 0x10809, 0x10809,
+ 0x10836, 0x10836,
+ 0x10839, 0x1083b,
+ 0x1083d, 0x1083e,
+ 0x10856, 0x10856,
+ 0x10860, 0x108ff,
+ 0x1091c, 0x1091e,
+ 0x1093a, 0x1093e,
+ 0x10940, 0x1097f,
+ 0x109b8, 0x109bd,
+ 0x109c0, 0x109ff,
+ 0x10a04, 0x10a04,
+ 0x10a07, 0x10a0b,
+ 0x10a14, 0x10a14,
+ 0x10a18, 0x10a18,
+ 0x10a34, 0x10a37,
+ 0x10a3b, 0x10a3e,
+ 0x10a48, 0x10a4f,
+ 0x10a59, 0x10a5f,
+ 0x10a80, 0x10aff,
+ 0x10b36, 0x10b38,
+ 0x10b56, 0x10b57,
+ 0x10b73, 0x10b77,
+ 0x10b80, 0x10bff,
+ 0x10c49, 0x10e5f,
+ 0x10e7f, 0x10fff,
+ 0x1104e, 0x11051,
+ 0x11070, 0x1107f,
0x110bd, 0x110bd,
+ 0x110c2, 0x110cf,
+ 0x110e9, 0x110ef,
+ 0x110fa, 0x110ff,
+ 0x11135, 0x11135,
+ 0x11144, 0x1117f,
+ 0x111c9, 0x111cf,
+ 0x111da, 0x1167f,
+ 0x116b8, 0x116bf,
+ 0x116ca, 0x11fff,
+ 0x1236f, 0x123ff,
+ 0x12463, 0x1246f,
+ 0x12474, 0x12fff,
+ 0x1342f, 0x167ff,
+ 0x16a39, 0x16eff,
+ 0x16f45, 0x16f4f,
+ 0x16f7f, 0x16f8e,
+ 0x16fa0, 0x1afff,
+ 0x1b002, 0x1cfff,
+ 0x1d0f6, 0x1d0ff,
+ 0x1d127, 0x1d128,
0x1d173, 0x1d17a,
- 0xe0001, 0xe0001,
- 0xe0020, 0xe007f,
- 0xf0000, 0xffffd,
- 0x100000, 0x10ffff,
+ 0x1d1de, 0x1d1ff,
+ 0x1d246, 0x1d2ff,
+ 0x1d357, 0x1d35f,
+ 0x1d372, 0x1d3ff,
+ 0x1d455, 0x1d455,
+ 0x1d49d, 0x1d49d,
+ 0x1d4a0, 0x1d4a1,
+ 0x1d4a3, 0x1d4a4,
+ 0x1d4a7, 0x1d4a8,
+ 0x1d4ad, 0x1d4ad,
+ 0x1d4ba, 0x1d4ba,
+ 0x1d4bc, 0x1d4bc,
+ 0x1d4c4, 0x1d4c4,
+ 0x1d506, 0x1d506,
+ 0x1d50b, 0x1d50c,
+ 0x1d515, 0x1d515,
+ 0x1d51d, 0x1d51d,
+ 0x1d53a, 0x1d53a,
+ 0x1d53f, 0x1d53f,
+ 0x1d545, 0x1d545,
+ 0x1d547, 0x1d549,
+ 0x1d551, 0x1d551,
+ 0x1d6a6, 0x1d6a7,
+ 0x1d7cc, 0x1d7cd,
+ 0x1d800, 0x1edff,
+ 0x1ee04, 0x1ee04,
+ 0x1ee20, 0x1ee20,
+ 0x1ee23, 0x1ee23,
+ 0x1ee25, 0x1ee26,
+ 0x1ee28, 0x1ee28,
+ 0x1ee33, 0x1ee33,
+ 0x1ee38, 0x1ee38,
+ 0x1ee3a, 0x1ee3a,
+ 0x1ee3c, 0x1ee41,
+ 0x1ee43, 0x1ee46,
+ 0x1ee48, 0x1ee48,
+ 0x1ee4a, 0x1ee4a,
+ 0x1ee4c, 0x1ee4c,
+ 0x1ee50, 0x1ee50,
+ 0x1ee53, 0x1ee53,
+ 0x1ee55, 0x1ee56,
+ 0x1ee58, 0x1ee58,
+ 0x1ee5a, 0x1ee5a,
+ 0x1ee5c, 0x1ee5c,
+ 0x1ee5e, 0x1ee5e,
+ 0x1ee60, 0x1ee60,
+ 0x1ee63, 0x1ee63,
+ 0x1ee65, 0x1ee66,
+ 0x1ee6b, 0x1ee6b,
+ 0x1ee73, 0x1ee73,
+ 0x1ee78, 0x1ee78,
+ 0x1ee7d, 0x1ee7d,
+ 0x1ee7f, 0x1ee7f,
+ 0x1ee8a, 0x1ee8a,
+ 0x1ee9c, 0x1eea0,
+ 0x1eea4, 0x1eea4,
+ 0x1eeaa, 0x1eeaa,
+ 0x1eebc, 0x1eeef,
+ 0x1eef2, 0x1efff,
+ 0x1f02c, 0x1f02f,
+ 0x1f094, 0x1f09f,
+ 0x1f0af, 0x1f0b0,
+ 0x1f0bf, 0x1f0c0,
+ 0x1f0d0, 0x1f0d0,
+ 0x1f0e0, 0x1f0ff,
+ 0x1f10b, 0x1f10f,
+ 0x1f12f, 0x1f12f,
+ 0x1f16c, 0x1f16f,
+ 0x1f19b, 0x1f1e5,
+ 0x1f203, 0x1f20f,
+ 0x1f23b, 0x1f23f,
+ 0x1f249, 0x1f24f,
+ 0x1f252, 0x1f2ff,
+ 0x1f321, 0x1f32f,
+ 0x1f336, 0x1f336,
+ 0x1f37d, 0x1f37f,
+ 0x1f394, 0x1f39f,
+ 0x1f3c5, 0x1f3c5,
+ 0x1f3cb, 0x1f3df,
+ 0x1f3f1, 0x1f3ff,
+ 0x1f43f, 0x1f43f,
+ 0x1f441, 0x1f441,
+ 0x1f4f8, 0x1f4f8,
+ 0x1f4fd, 0x1f4ff,
+ 0x1f53e, 0x1f53f,
+ 0x1f544, 0x1f54f,
+ 0x1f568, 0x1f5fa,
+ 0x1f641, 0x1f644,
+ 0x1f650, 0x1f67f,
+ 0x1f6c6, 0x1f6ff,
+ 0x1f774, 0x1ffff,
+ 0x2a6d7, 0x2a6ff,
+ 0x2b735, 0x2b73f,
+ 0x2b81e, 0x2f7ff,
+ 0x2fa1e, 0xe00ff,
+ 0xe01f0, 0x10ffff,
}; /* CR_C */
/* 'Cc': General Category */
-static const OnigCodePoint CR_Cc[] = {
- 2,
- 0x0000, 0x001f,
- 0x007f, 0x009f,
-}; /* CR_Cc */
+#define CR_Cc CR_Cntrl
/* 'Cf': General Category */
static const OnigCodePoint CR_Cf[] = {
- 15,
+ 14,
0x00ad, 0x00ad,
- 0x0600, 0x0603,
+ 0x0600, 0x0604,
0x06dd, 0x06dd,
0x070f, 0x070f,
- 0x17b4, 0x17b5,
0x200b, 0x200f,
0x202a, 0x202e,
0x2060, 0x2064,
@@ -568,7 +5389,7 @@ static const OnigCodePoint CR_Cf[] = {
/* 'Cn': General Category */
static const OnigCodePoint CR_Cn[] = {
- 501,
+ 539,
0x0378, 0x0379,
0x037f, 0x0383,
0x038b, 0x038b,
@@ -578,11 +5399,12 @@ static const OnigCodePoint CR_Cn[] = {
0x0557, 0x0558,
0x0560, 0x0560,
0x0588, 0x0588,
- 0x058b, 0x0590,
+ 0x058b, 0x058e,
+ 0x0590, 0x0590,
0x05c8, 0x05cf,
0x05eb, 0x05ef,
0x05f5, 0x05ff,
- 0x0604, 0x0605,
+ 0x0605, 0x0605,
0x061c, 0x061d,
0x070e, 0x070e,
0x074b, 0x074c,
@@ -591,7 +5413,10 @@ static const OnigCodePoint CR_Cn[] = {
0x082e, 0x082f,
0x083f, 0x083f,
0x085c, 0x085d,
- 0x085f, 0x08ff,
+ 0x085f, 0x089f,
+ 0x08a1, 0x08a1,
+ 0x08ad, 0x08e3,
+ 0x08ff, 0x08ff,
0x0978, 0x0978,
0x0980, 0x0980,
0x0984, 0x0984,
@@ -636,7 +5461,6 @@ static const OnigCodePoint CR_Cn[] = {
0x0ace, 0x0acf,
0x0ad1, 0x0adf,
0x0ae4, 0x0ae5,
- 0x0af0, 0x0af0,
0x0af2, 0x0b00,
0x0b04, 0x0b04,
0x0b0d, 0x0b0e,
@@ -737,15 +5561,16 @@ static const OnigCodePoint CR_Cn[] = {
0x0ec7, 0x0ec7,
0x0ece, 0x0ecf,
0x0eda, 0x0edb,
- 0x0ede, 0x0eff,
+ 0x0ee0, 0x0eff,
0x0f48, 0x0f48,
0x0f6d, 0x0f70,
0x0f98, 0x0f98,
0x0fbd, 0x0fbd,
0x0fcd, 0x0fcd,
0x0fdb, 0x0fff,
- 0x10c6, 0x10cf,
- 0x10fd, 0x10ff,
+ 0x10c6, 0x10c6,
+ 0x10c8, 0x10cc,
+ 0x10ce, 0x10cf,
0x1249, 0x1249,
0x124e, 0x124f,
0x1257, 0x1257,
@@ -799,13 +5624,12 @@ static const OnigCodePoint CR_Cn[] = {
0x1aae, 0x1aff,
0x1b4c, 0x1b4f,
0x1b7d, 0x1b7f,
- 0x1bab, 0x1bad,
- 0x1bba, 0x1bbf,
0x1bf4, 0x1bfb,
0x1c38, 0x1c3a,
0x1c4a, 0x1c4c,
- 0x1c80, 0x1ccf,
- 0x1cf3, 0x1cff,
+ 0x1c80, 0x1cbf,
+ 0x1cc8, 0x1ccf,
+ 0x1cf7, 0x1cff,
0x1de7, 0x1dfb,
0x1f16, 0x1f17,
0x1f1e, 0x1f1f,
@@ -834,15 +5658,15 @@ static const OnigCodePoint CR_Cn[] = {
0x2427, 0x243f,
0x244b, 0x245f,
0x2700, 0x2700,
- 0x27cb, 0x27cb,
- 0x27cd, 0x27cd,
0x2b4d, 0x2b4f,
0x2b5a, 0x2bff,
0x2c2f, 0x2c2f,
0x2c5f, 0x2c5f,
- 0x2cf2, 0x2cf8,
- 0x2d26, 0x2d2f,
- 0x2d66, 0x2d6e,
+ 0x2cf4, 0x2cf8,
+ 0x2d26, 0x2d26,
+ 0x2d28, 0x2d2c,
+ 0x2d2e, 0x2d2f,
+ 0x2d68, 0x2d6e,
0x2d71, 0x2d7e,
0x2d97, 0x2d9f,
0x2da7, 0x2da7,
@@ -853,7 +5677,7 @@ static const OnigCodePoint CR_Cn[] = {
0x2dcf, 0x2dcf,
0x2dd7, 0x2dd7,
0x2ddf, 0x2ddf,
- 0x2e32, 0x2e7f,
+ 0x2e3c, 0x2e7f,
0x2e9a, 0x2e9a,
0x2ef4, 0x2eff,
0x2fd6, 0x2fef,
@@ -868,16 +5692,15 @@ static const OnigCodePoint CR_Cn[] = {
0x321f, 0x321f,
0x32ff, 0x32ff,
0x4db6, 0x4dbf,
- 0x9fcc, 0x9fff,
+ 0x9fcd, 0x9fff,
0xa48d, 0xa48f,
0xa4c7, 0xa4cf,
0xa62c, 0xa63f,
- 0xa674, 0xa67b,
- 0xa698, 0xa69f,
+ 0xa698, 0xa69e,
0xa6f8, 0xa6ff,
0xa78f, 0xa78f,
- 0xa792, 0xa79f,
- 0xa7aa, 0xa7f9,
+ 0xa794, 0xa79f,
+ 0xa7ab, 0xa7f7,
0xa82c, 0xa82f,
0xa83a, 0xa83f,
0xa878, 0xa87f,
@@ -894,7 +5717,7 @@ static const OnigCodePoint CR_Cn[] = {
0xaa5a, 0xaa5b,
0xaa7c, 0xaa7f,
0xaac3, 0xaada,
- 0xaae0, 0xab00,
+ 0xaaf7, 0xab00,
0xab07, 0xab08,
0xab0f, 0xab10,
0xab17, 0xab1f,
@@ -905,7 +5728,6 @@ static const OnigCodePoint CR_Cn[] = {
0xd7a4, 0xd7af,
0xd7c7, 0xd7ca,
0xd7fc, 0xd7ff,
- 0xfa2e, 0xfa2f,
0xfa6e, 0xfa6f,
0xfada, 0xfaff,
0xfb07, 0xfb12,
@@ -967,7 +5789,9 @@ static const OnigCodePoint CR_Cn[] = {
0x10860, 0x108ff,
0x1091c, 0x1091e,
0x1093a, 0x1093e,
- 0x10940, 0x109ff,
+ 0x10940, 0x1097f,
+ 0x109b8, 0x109bd,
+ 0x109c0, 0x109ff,
0x10a04, 0x10a04,
0x10a07, 0x10a0b,
0x10a14, 0x10a14,
@@ -985,12 +5809,23 @@ static const OnigCodePoint CR_Cn[] = {
0x10e7f, 0x10fff,
0x1104e, 0x11051,
0x11070, 0x1107f,
- 0x110c2, 0x11fff,
+ 0x110c2, 0x110cf,
+ 0x110e9, 0x110ef,
+ 0x110fa, 0x110ff,
+ 0x11135, 0x11135,
+ 0x11144, 0x1117f,
+ 0x111c9, 0x111cf,
+ 0x111da, 0x1167f,
+ 0x116b8, 0x116bf,
+ 0x116ca, 0x11fff,
0x1236f, 0x123ff,
0x12463, 0x1246f,
0x12474, 0x12fff,
0x1342f, 0x167ff,
- 0x16a39, 0x1afff,
+ 0x16a39, 0x16eff,
+ 0x16f45, 0x16f4f,
+ 0x16f7f, 0x16f8e,
+ 0x16fa0, 0x1afff,
0x1b002, 0x1cfff,
0x1d0f6, 0x1d0ff,
0x1d127, 0x1d128,
@@ -1018,7 +5853,41 @@ static const OnigCodePoint CR_Cn[] = {
0x1d551, 0x1d551,
0x1d6a6, 0x1d6a7,
0x1d7cc, 0x1d7cd,
- 0x1d800, 0x1efff,
+ 0x1d800, 0x1edff,
+ 0x1ee04, 0x1ee04,
+ 0x1ee20, 0x1ee20,
+ 0x1ee23, 0x1ee23,
+ 0x1ee25, 0x1ee26,
+ 0x1ee28, 0x1ee28,
+ 0x1ee33, 0x1ee33,
+ 0x1ee38, 0x1ee38,
+ 0x1ee3a, 0x1ee3a,
+ 0x1ee3c, 0x1ee41,
+ 0x1ee43, 0x1ee46,
+ 0x1ee48, 0x1ee48,
+ 0x1ee4a, 0x1ee4a,
+ 0x1ee4c, 0x1ee4c,
+ 0x1ee50, 0x1ee50,
+ 0x1ee53, 0x1ee53,
+ 0x1ee55, 0x1ee56,
+ 0x1ee58, 0x1ee58,
+ 0x1ee5a, 0x1ee5a,
+ 0x1ee5c, 0x1ee5c,
+ 0x1ee5e, 0x1ee5e,
+ 0x1ee60, 0x1ee60,
+ 0x1ee63, 0x1ee63,
+ 0x1ee65, 0x1ee66,
+ 0x1ee6b, 0x1ee6b,
+ 0x1ee73, 0x1ee73,
+ 0x1ee78, 0x1ee78,
+ 0x1ee7d, 0x1ee7d,
+ 0x1ee7f, 0x1ee7f,
+ 0x1ee8a, 0x1ee8a,
+ 0x1ee9c, 0x1eea0,
+ 0x1eea4, 0x1eea4,
+ 0x1eeaa, 0x1eeaa,
+ 0x1eebc, 0x1eeef,
+ 0x1eef2, 0x1efff,
0x1f02c, 0x1f02f,
0x1f094, 0x1f09f,
0x1f0af, 0x1f0b0,
@@ -1027,7 +5896,7 @@ static const OnigCodePoint CR_Cn[] = {
0x1f0e0, 0x1f0ff,
0x1f10b, 0x1f10f,
0x1f12f, 0x1f12f,
- 0x1f16a, 0x1f16f,
+ 0x1f16c, 0x1f16f,
0x1f19b, 0x1f1e5,
0x1f203, 0x1f20f,
0x1f23b, 0x1f23f,
@@ -1044,19 +5913,9 @@ static const OnigCodePoint CR_Cn[] = {
0x1f441, 0x1f441,
0x1f4f8, 0x1f4f8,
0x1f4fd, 0x1f4ff,
- 0x1f53e, 0x1f54f,
+ 0x1f53e, 0x1f53f,
+ 0x1f544, 0x1f54f,
0x1f568, 0x1f5fa,
- 0x1f600, 0x1f600,
- 0x1f611, 0x1f611,
- 0x1f615, 0x1f615,
- 0x1f617, 0x1f617,
- 0x1f619, 0x1f619,
- 0x1f61b, 0x1f61b,
- 0x1f61f, 0x1f61f,
- 0x1f626, 0x1f627,
- 0x1f62c, 0x1f62c,
- 0x1f62e, 0x1f62f,
- 0x1f634, 0x1f634,
0x1f641, 0x1f644,
0x1f650, 0x1f67f,
0x1f6c6, 0x1f6ff,
@@ -1088,7 +5947,7 @@ static const OnigCodePoint CR_Cs[] = {
/* 'L': Major Category */
static const OnigCodePoint CR_L[] = {
- 435,
+ 486,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -1136,6 +5995,8 @@ static const OnigCodePoint CR_L[] = {
0x0824, 0x0824,
0x0828, 0x0828,
0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
0x0904, 0x0939,
0x093d, 0x093d,
0x0950, 0x0950,
@@ -1241,7 +6102,7 @@ static const OnigCodePoint CR_L[] = {
0x0ebd, 0x0ebd,
0x0ec0, 0x0ec4,
0x0ec6, 0x0ec6,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f00,
0x0f40, 0x0f47,
0x0f49, 0x0f6c,
@@ -1256,9 +6117,10 @@ static const OnigCodePoint CR_L[] = {
0x1075, 0x1081,
0x108e, 0x108e,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
+ 0x10fc, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -1305,12 +6167,13 @@ static const OnigCodePoint CR_L[] = {
0x1b45, 0x1b4b,
0x1b83, 0x1ba0,
0x1bae, 0x1baf,
- 0x1bc0, 0x1be5,
+ 0x1bba, 0x1be5,
0x1c00, 0x1c23,
0x1c4d, 0x1c4f,
0x1c5a, 0x1c7d,
0x1ce9, 0x1cec,
0x1cee, 0x1cf1,
+ 0x1cf5, 0x1cf6,
0x1d00, 0x1dbf,
0x1e00, 0x1f15,
0x1f18, 0x1f1d,
@@ -1352,8 +6215,11 @@ static const OnigCodePoint CR_L[] = {
0x2c30, 0x2c5e,
0x2c60, 0x2ce4,
0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d6f,
0x2d80, 0x2d96,
0x2da0, 0x2da6,
@@ -1377,7 +6243,7 @@ static const OnigCodePoint CR_L[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
@@ -1389,9 +6255,9 @@ static const OnigCodePoint CR_L[] = {
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa801,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa822,
@@ -1416,6 +6282,8 @@ static const OnigCodePoint CR_L[] = {
0xaac0, 0xaac0,
0xaac2, 0xaac2,
0xaadb, 0xaadd,
+ 0xaae0, 0xaaea,
+ 0xaaf2, 0xaaf4,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -1425,8 +6293,7 @@ static const OnigCodePoint CR_L[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -1475,6 +6342,8 @@ static const OnigCodePoint CR_L[] = {
0x1083f, 0x10855,
0x10900, 0x10915,
0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a00,
0x10a10, 0x10a13,
0x10a15, 0x10a17,
@@ -1486,9 +6355,17 @@ static const OnigCodePoint CR_L[] = {
0x10c00, 0x10c48,
0x11003, 0x11037,
0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
0x12000, 0x1236e,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f50,
+ 0x16f93, 0x16f9f,
0x1b000, 0x1b001,
0x1d400, 0x1d454,
0x1d456, 0x1d49c,
@@ -1520,19 +6397,168 @@ static const OnigCodePoint CR_L[] = {
0x1d78a, 0x1d7a8,
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
0x2f800, 0x2fa1d,
}; /* CR_L */
+/* 'LC': General Category */
+static const OnigCodePoint CR_LC[] = {
+ 113,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00b5, 0x00b5,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x01ba,
+ 0x01bc, 0x01bf,
+ 0x01c4, 0x0293,
+ 0x0295, 0x02af,
+ 0x0370, 0x0373,
+ 0x0376, 0x0377,
+ 0x037b, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0561, 0x0587,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x1d00, 0x1d2b,
+ 0x1d6b, 0x1d77,
+ 0x1d79, 0x1d9a,
+ 0x1e00, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fbc,
+ 0x1fbe, 0x1fbe,
+ 0x1fc2, 0x1fc4,
+ 0x1fc6, 0x1fcc,
+ 0x1fd0, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fe0, 0x1fec,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffc,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210a, 0x2113,
+ 0x2115, 0x2115,
+ 0x2119, 0x211d,
+ 0x2124, 0x2124,
+ 0x2126, 0x2126,
+ 0x2128, 0x2128,
+ 0x212a, 0x212d,
+ 0x212f, 0x2134,
+ 0x2139, 0x2139,
+ 0x213c, 0x213f,
+ 0x2145, 0x2149,
+ 0x214e, 0x214e,
+ 0x2183, 0x2184,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2c7b,
+ 0x2c7e, 0x2ce4,
+ 0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0xa640, 0xa66d,
+ 0xa680, 0xa697,
+ 0xa722, 0xa76f,
+ 0xa771, 0xa787,
+ 0xa78b, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7fa, 0xa7fa,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0x10400, 0x1044f,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+}; /* CR_LC */
+
/* 'Ll': General Category */
static const OnigCodePoint CR_Ll[] = {
- 609,
+ 611,
0x0061, 0x007a,
- 0x00aa, 0x00aa,
0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
0x00df, 0x00f6,
0x00f8, 0x00ff,
0x0101, 0x0101,
@@ -1798,7 +6824,7 @@ static const OnigCodePoint CR_Ll[] = {
0x0527, 0x0527,
0x0561, 0x0587,
0x1d00, 0x1d2b,
- 0x1d62, 0x1d77,
+ 0x1d6b, 0x1d77,
0x1d79, 0x1d9a,
0x1e01, 0x1e01,
0x1e03, 0x1e03,
@@ -1962,7 +6988,7 @@ static const OnigCodePoint CR_Ll[] = {
0x2c6c, 0x2c6c,
0x2c71, 0x2c71,
0x2c73, 0x2c74,
- 0x2c76, 0x2c7c,
+ 0x2c76, 0x2c7b,
0x2c81, 0x2c81,
0x2c83, 0x2c83,
0x2c85, 0x2c85,
@@ -2015,7 +7041,10 @@ static const OnigCodePoint CR_Ll[] = {
0x2ce3, 0x2ce4,
0x2cec, 0x2cec,
0x2cee, 0x2cee,
+ 0x2cf3, 0x2cf3,
0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
0xa641, 0xa641,
0xa643, 0xa643,
0xa645, 0xa645,
@@ -2100,6 +7129,7 @@ static const OnigCodePoint CR_Ll[] = {
0xa78c, 0xa78c,
0xa78e, 0xa78e,
0xa791, 0xa791,
+ 0xa793, 0xa793,
0xa7a1, 0xa7a1,
0xa7a3, 0xa7a3,
0xa7a5, 0xa7a5,
@@ -2142,7 +7172,7 @@ static const OnigCodePoint CR_Ll[] = {
/* 'Lm': General Category */
static const OnigCodePoint CR_Lm[] = {
- 49,
+ 52,
0x02b0, 0x02c1,
0x02c6, 0x02d1,
0x02e0, 0x02e4,
@@ -2166,13 +7196,13 @@ static const OnigCodePoint CR_Lm[] = {
0x1843, 0x1843,
0x1aa7, 0x1aa7,
0x1c78, 0x1c7d,
- 0x1d2c, 0x1d61,
+ 0x1d2c, 0x1d6a,
0x1d78, 0x1d78,
0x1d9b, 0x1dbf,
0x2071, 0x2071,
0x207f, 0x207f,
0x2090, 0x209c,
- 0x2c7d, 0x2c7d,
+ 0x2c7c, 0x2c7d,
0x2d6f, 0x2d6f,
0x2e2f, 0x2e2f,
0x3005, 0x3005,
@@ -2187,16 +7217,21 @@ static const OnigCodePoint CR_Lm[] = {
0xa717, 0xa71f,
0xa770, 0xa770,
0xa788, 0xa788,
+ 0xa7f8, 0xa7f9,
0xa9cf, 0xa9cf,
0xaa70, 0xaa70,
0xaadd, 0xaadd,
+ 0xaaf3, 0xaaf4,
0xff70, 0xff70,
0xff9e, 0xff9f,
+ 0x16f93, 0x16f9f,
}; /* CR_Lm */
/* 'Lo': General Category */
static const OnigCodePoint CR_Lo[] = {
- 323,
+ 371,
+ 0x00aa, 0x00aa,
+ 0x00ba, 0x00ba,
0x01bb, 0x01bb,
0x01c0, 0x01c3,
0x0294, 0x0294,
@@ -2217,6 +7252,8 @@ static const OnigCodePoint CR_Lo[] = {
0x07ca, 0x07ea,
0x0800, 0x0815,
0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
0x0904, 0x0939,
0x093d, 0x093d,
0x0950, 0x0950,
@@ -2321,7 +7358,7 @@ static const OnigCodePoint CR_Lo[] = {
0x0eb2, 0x0eb3,
0x0ebd, 0x0ebd,
0x0ec0, 0x0ec4,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f00,
0x0f40, 0x0f47,
0x0f49, 0x0f6c,
@@ -2336,7 +7373,7 @@ static const OnigCodePoint CR_Lo[] = {
0x1075, 0x1081,
0x108e, 0x108e,
0x10d0, 0x10fa,
- 0x1100, 0x1248,
+ 0x10fd, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -2382,14 +7419,15 @@ static const OnigCodePoint CR_Lo[] = {
0x1b45, 0x1b4b,
0x1b83, 0x1ba0,
0x1bae, 0x1baf,
- 0x1bc0, 0x1be5,
+ 0x1bba, 0x1be5,
0x1c00, 0x1c23,
0x1c4d, 0x1c4f,
0x1c5a, 0x1c77,
0x1ce9, 0x1cec,
0x1cee, 0x1cf1,
+ 0x1cf5, 0x1cf6,
0x2135, 0x2138,
- 0x2d30, 0x2d65,
+ 0x2d30, 0x2d67,
0x2d80, 0x2d96,
0x2da0, 0x2da6,
0x2da8, 0x2dae,
@@ -2410,7 +7448,7 @@ static const OnigCodePoint CR_Lo[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xa000, 0xa014,
0xa016, 0xa48c,
0xa4d0, 0xa4f7,
@@ -2444,6 +7482,8 @@ static const OnigCodePoint CR_Lo[] = {
0xaac0, 0xaac0,
0xaac2, 0xaac2,
0xaadb, 0xaadc,
+ 0xaae0, 0xaaea,
+ 0xaaf2, 0xaaf2,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -2453,8 +7493,7 @@ static const OnigCodePoint CR_Lo[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb1d, 0xfb1d,
0xfb1f, 0xfb28,
@@ -2501,6 +7540,8 @@ static const OnigCodePoint CR_Lo[] = {
0x1083f, 0x10855,
0x10900, 0x10915,
0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a00,
0x10a10, 0x10a13,
0x10a15, 0x10a17,
@@ -2512,10 +7553,50 @@ static const OnigCodePoint CR_Lo[] = {
0x10c00, 0x10c48,
0x11003, 0x11037,
0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
0x12000, 0x1236e,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f50,
0x1b000, 0x1b001,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -2539,7 +7620,7 @@ static const OnigCodePoint CR_Lt[] = {
/* 'Lu': General Category */
static const OnigCodePoint CR_Lu[] = {
- 603,
+ 608,
0x0041, 0x005a,
0x00c0, 0x00d6,
0x00d8, 0x00de,
@@ -2808,6 +7889,8 @@ static const OnigCodePoint CR_Lu[] = {
0x0526, 0x0526,
0x0531, 0x0556,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x1e00, 0x1e00,
0x1e02, 0x1e02,
0x1e04, 0x1e04,
@@ -3022,6 +8105,7 @@ static const OnigCodePoint CR_Lu[] = {
0x2ce2, 0x2ce2,
0x2ceb, 0x2ceb,
0x2ced, 0x2ced,
+ 0x2cf2, 0x2cf2,
0xa640, 0xa640,
0xa642, 0xa642,
0xa644, 0xa644,
@@ -3105,11 +8189,13 @@ static const OnigCodePoint CR_Lu[] = {
0xa78b, 0xa78b,
0xa78d, 0xa78d,
0xa790, 0xa790,
+ 0xa792, 0xa792,
0xa7a0, 0xa7a0,
0xa7a2, 0xa7a2,
0xa7a4, 0xa7a4,
0xa7a6, 0xa7a6,
0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
0xff21, 0xff3a,
0x10400, 0x10427,
0x1d400, 0x1d419,
@@ -3147,7 +8233,7 @@ static const OnigCodePoint CR_Lu[] = {
/* 'M': Major Category */
static const OnigCodePoint CR_M[] = {
- 193,
+ 204,
0x0300, 0x036f,
0x0483, 0x0489,
0x0591, 0x05bd,
@@ -3171,6 +8257,7 @@ static const OnigCodePoint CR_M[] = {
0x0825, 0x0827,
0x0829, 0x082d,
0x0859, 0x085b,
+ 0x08e4, 0x08fe,
0x0900, 0x0903,
0x093a, 0x093c,
0x093e, 0x094f,
@@ -3265,7 +8352,7 @@ static const OnigCodePoint CR_M[] = {
0x1732, 0x1734,
0x1752, 0x1753,
0x1772, 0x1773,
- 0x17b6, 0x17d3,
+ 0x17b4, 0x17d3,
0x17dd, 0x17dd,
0x180b, 0x180d,
0x18a9, 0x18a9,
@@ -3281,13 +8368,13 @@ static const OnigCodePoint CR_M[] = {
0x1b34, 0x1b44,
0x1b6b, 0x1b73,
0x1b80, 0x1b82,
- 0x1ba1, 0x1baa,
+ 0x1ba1, 0x1bad,
0x1be6, 0x1bf3,
0x1c24, 0x1c37,
0x1cd0, 0x1cd2,
0x1cd4, 0x1ce8,
0x1ced, 0x1ced,
- 0x1cf2, 0x1cf2,
+ 0x1cf2, 0x1cf4,
0x1dc0, 0x1de6,
0x1dfc, 0x1dff,
0x20d0, 0x20f0,
@@ -3297,7 +8384,8 @@ static const OnigCodePoint CR_M[] = {
0x302a, 0x302f,
0x3099, 0x309a,
0xa66f, 0xa672,
- 0xa67c, 0xa67d,
+ 0xa674, 0xa67d,
+ 0xa69f, 0xa69f,
0xa6f0, 0xa6f1,
0xa802, 0xa802,
0xa806, 0xa806,
@@ -3319,6 +8407,8 @@ static const OnigCodePoint CR_M[] = {
0xaab7, 0xaab8,
0xaabe, 0xaabf,
0xaac1, 0xaac1,
+ 0xaaeb, 0xaaef,
+ 0xaaf5, 0xaaf6,
0xabe3, 0xabea,
0xabec, 0xabed,
0xfb1e, 0xfb1e,
@@ -3334,6 +8424,13 @@ static const OnigCodePoint CR_M[] = {
0x11038, 0x11046,
0x11080, 0x11082,
0x110b0, 0x110ba,
+ 0x11100, 0x11102,
+ 0x11127, 0x11134,
+ 0x11180, 0x11182,
+ 0x111b3, 0x111c0,
+ 0x116ab, 0x116b7,
+ 0x16f51, 0x16f7e,
+ 0x16f8f, 0x16f92,
0x1d165, 0x1d169,
0x1d16d, 0x1d172,
0x1d17b, 0x1d182,
@@ -3345,7 +8442,7 @@ static const OnigCodePoint CR_M[] = {
/* 'Mc': General Category */
static const OnigCodePoint CR_Mc[] = {
- 113,
+ 126,
0x0903, 0x0903,
0x093b, 0x093b,
0x093e, 0x0940,
@@ -3427,6 +8524,7 @@ static const OnigCodePoint CR_Mc[] = {
0x1ba1, 0x1ba1,
0x1ba6, 0x1ba7,
0x1baa, 0x1baa,
+ 0x1bac, 0x1bad,
0x1be7, 0x1be7,
0x1bea, 0x1bec,
0x1bee, 0x1bee,
@@ -3434,7 +8532,8 @@ static const OnigCodePoint CR_Mc[] = {
0x1c24, 0x1c2b,
0x1c34, 0x1c35,
0x1ce1, 0x1ce1,
- 0x1cf2, 0x1cf2,
+ 0x1cf2, 0x1cf3,
+ 0x302e, 0x302f,
0xa823, 0xa824,
0xa827, 0xa827,
0xa880, 0xa881,
@@ -3448,6 +8547,9 @@ static const OnigCodePoint CR_Mc[] = {
0xaa33, 0xaa34,
0xaa4d, 0xaa4d,
0xaa7b, 0xaa7b,
+ 0xaaeb, 0xaaeb,
+ 0xaaee, 0xaaef,
+ 0xaaf5, 0xaaf5,
0xabe3, 0xabe4,
0xabe6, 0xabe7,
0xabe9, 0xabea,
@@ -3457,6 +8559,14 @@ static const OnigCodePoint CR_Mc[] = {
0x11082, 0x11082,
0x110b0, 0x110b2,
0x110b7, 0x110b8,
+ 0x1112c, 0x1112c,
+ 0x11182, 0x11182,
+ 0x111b3, 0x111b5,
+ 0x111bf, 0x111c0,
+ 0x116ac, 0x116ac,
+ 0x116ae, 0x116af,
+ 0x116b6, 0x116b6,
+ 0x16f51, 0x16f7e,
0x1d165, 0x1d166,
0x1d16d, 0x1d172,
}; /* CR_Mc */
@@ -3472,7 +8582,7 @@ static const OnigCodePoint CR_Me[] = {
/* 'Mn': General Category */
static const OnigCodePoint CR_Mn[] = {
- 203,
+ 220,
0x0300, 0x036f,
0x0483, 0x0487,
0x0591, 0x05bd,
@@ -3496,6 +8606,7 @@ static const OnigCodePoint CR_Mn[] = {
0x0825, 0x0827,
0x0829, 0x082d,
0x0859, 0x085b,
+ 0x08e4, 0x08fe,
0x0900, 0x0902,
0x093a, 0x093a,
0x093c, 0x093c,
@@ -3581,6 +8692,7 @@ static const OnigCodePoint CR_Mn[] = {
0x1732, 0x1734,
0x1752, 0x1753,
0x1772, 0x1773,
+ 0x17b4, 0x17b5,
0x17b7, 0x17bd,
0x17c6, 0x17c6,
0x17c9, 0x17d3,
@@ -3608,6 +8720,7 @@ static const OnigCodePoint CR_Mn[] = {
0x1b80, 0x1b81,
0x1ba2, 0x1ba5,
0x1ba8, 0x1ba9,
+ 0x1bab, 0x1bab,
0x1be6, 0x1be6,
0x1be8, 0x1be9,
0x1bed, 0x1bed,
@@ -3618,6 +8731,7 @@ static const OnigCodePoint CR_Mn[] = {
0x1cd4, 0x1ce0,
0x1ce2, 0x1ce8,
0x1ced, 0x1ced,
+ 0x1cf4, 0x1cf4,
0x1dc0, 0x1de6,
0x1dfc, 0x1dff,
0x20d0, 0x20dc,
@@ -3626,10 +8740,11 @@ static const OnigCodePoint CR_Mn[] = {
0x2cef, 0x2cf1,
0x2d7f, 0x2d7f,
0x2de0, 0x2dff,
- 0x302a, 0x302f,
+ 0x302a, 0x302d,
0x3099, 0x309a,
0xa66f, 0xa66f,
- 0xa67c, 0xa67d,
+ 0xa674, 0xa67d,
+ 0xa69f, 0xa69f,
0xa6f0, 0xa6f1,
0xa802, 0xa802,
0xa806, 0xa806,
@@ -3653,6 +8768,8 @@ static const OnigCodePoint CR_Mn[] = {
0xaab7, 0xaab8,
0xaabe, 0xaabf,
0xaac1, 0xaac1,
+ 0xaaec, 0xaaed,
+ 0xaaf6, 0xaaf6,
0xabe5, 0xabe5,
0xabe8, 0xabe8,
0xabed, 0xabed,
@@ -3670,6 +8787,16 @@ static const OnigCodePoint CR_Mn[] = {
0x11080, 0x11081,
0x110b3, 0x110b6,
0x110b9, 0x110ba,
+ 0x11100, 0x11102,
+ 0x11127, 0x1112b,
+ 0x1112d, 0x11134,
+ 0x11180, 0x11181,
+ 0x111b6, 0x111be,
+ 0x116ab, 0x116ab,
+ 0x116ad, 0x116ad,
+ 0x116b0, 0x116b5,
+ 0x116b7, 0x116b7,
+ 0x16f8f, 0x16f92,
0x1d167, 0x1d169,
0x1d17b, 0x1d182,
0x1d185, 0x1d18b,
@@ -3680,7 +8807,7 @@ static const OnigCodePoint CR_Mn[] = {
/* 'N': Major Category */
static const OnigCodePoint CR_N[] = {
- 83,
+ 88,
0x0030, 0x0039,
0x00b2, 0x00b3,
0x00b9, 0x00b9,
@@ -3732,6 +8859,7 @@ static const OnigCodePoint CR_N[] = {
0x3038, 0x303a,
0x3192, 0x3195,
0x3220, 0x3229,
+ 0x3248, 0x324f,
0x3251, 0x325f,
0x3280, 0x3289,
0x32b1, 0x32bf,
@@ -3760,6 +8888,10 @@ static const OnigCodePoint CR_N[] = {
0x10b78, 0x10b7f,
0x10e60, 0x10e7e,
0x11052, 0x1106f,
+ 0x110f0, 0x110f9,
+ 0x11136, 0x1113f,
+ 0x111d0, 0x111d9,
+ 0x116c0, 0x116c9,
0x12400, 0x12462,
0x1d360, 0x1d371,
0x1d7ce, 0x1d7ff,
@@ -3767,47 +8899,7 @@ static const OnigCodePoint CR_N[] = {
}; /* CR_N */
/* 'Nd': General Category */
-static const OnigCodePoint CR_Nd[] = {
- 38,
- 0x0030, 0x0039,
- 0x0660, 0x0669,
- 0x06f0, 0x06f9,
- 0x07c0, 0x07c9,
- 0x0966, 0x096f,
- 0x09e6, 0x09ef,
- 0x0a66, 0x0a6f,
- 0x0ae6, 0x0aef,
- 0x0b66, 0x0b6f,
- 0x0be6, 0x0bef,
- 0x0c66, 0x0c6f,
- 0x0ce6, 0x0cef,
- 0x0d66, 0x0d6f,
- 0x0e50, 0x0e59,
- 0x0ed0, 0x0ed9,
- 0x0f20, 0x0f29,
- 0x1040, 0x1049,
- 0x1090, 0x1099,
- 0x17e0, 0x17e9,
- 0x1810, 0x1819,
- 0x1946, 0x194f,
- 0x19d0, 0x19d9,
- 0x1a80, 0x1a89,
- 0x1a90, 0x1a99,
- 0x1b50, 0x1b59,
- 0x1bb0, 0x1bb9,
- 0x1c40, 0x1c49,
- 0x1c50, 0x1c59,
- 0xa620, 0xa629,
- 0xa8d0, 0xa8d9,
- 0xa900, 0xa909,
- 0xa9d0, 0xa9d9,
- 0xaa50, 0xaa59,
- 0xabf0, 0xabf9,
- 0xff10, 0xff19,
- 0x104a0, 0x104a9,
- 0x11066, 0x1106f,
- 0x1d7ce, 0x1d7ff,
-}; /* CR_Nd */
+#define CR_Nd CR_Digit
/* 'Nl': General Category */
static const OnigCodePoint CR_Nl[] = {
@@ -3828,7 +8920,7 @@ static const OnigCodePoint CR_Nl[] = {
/* 'No': General Category */
static const OnigCodePoint CR_No[] = {
- 41,
+ 42,
0x00b2, 0x00b3,
0x00b9, 0x00b9,
0x00bc, 0x00be,
@@ -3852,6 +8944,7 @@ static const OnigCodePoint CR_No[] = {
0x2cfd, 0x2cfd,
0x3192, 0x3195,
0x3220, 0x3229,
+ 0x3248, 0x324f,
0x3251, 0x325f,
0x3280, 0x3289,
0x32b1, 0x32bf,
@@ -3873,142 +8966,7 @@ static const OnigCodePoint CR_No[] = {
}; /* CR_No */
/* 'P': Major Category */
-static const OnigCodePoint CR_P[] = {
- 133,
- 0x0021, 0x0023,
- 0x0025, 0x002a,
- 0x002c, 0x002f,
- 0x003a, 0x003b,
- 0x003f, 0x0040,
- 0x005b, 0x005d,
- 0x005f, 0x005f,
- 0x007b, 0x007b,
- 0x007d, 0x007d,
- 0x00a1, 0x00a1,
- 0x00ab, 0x00ab,
- 0x00b7, 0x00b7,
- 0x00bb, 0x00bb,
- 0x00bf, 0x00bf,
- 0x037e, 0x037e,
- 0x0387, 0x0387,
- 0x055a, 0x055f,
- 0x0589, 0x058a,
- 0x05be, 0x05be,
- 0x05c0, 0x05c0,
- 0x05c3, 0x05c3,
- 0x05c6, 0x05c6,
- 0x05f3, 0x05f4,
- 0x0609, 0x060a,
- 0x060c, 0x060d,
- 0x061b, 0x061b,
- 0x061e, 0x061f,
- 0x066a, 0x066d,
- 0x06d4, 0x06d4,
- 0x0700, 0x070d,
- 0x07f7, 0x07f9,
- 0x0830, 0x083e,
- 0x085e, 0x085e,
- 0x0964, 0x0965,
- 0x0970, 0x0970,
- 0x0df4, 0x0df4,
- 0x0e4f, 0x0e4f,
- 0x0e5a, 0x0e5b,
- 0x0f04, 0x0f12,
- 0x0f3a, 0x0f3d,
- 0x0f85, 0x0f85,
- 0x0fd0, 0x0fd4,
- 0x0fd9, 0x0fda,
- 0x104a, 0x104f,
- 0x10fb, 0x10fb,
- 0x1361, 0x1368,
- 0x1400, 0x1400,
- 0x166d, 0x166e,
- 0x169b, 0x169c,
- 0x16eb, 0x16ed,
- 0x1735, 0x1736,
- 0x17d4, 0x17d6,
- 0x17d8, 0x17da,
- 0x1800, 0x180a,
- 0x1944, 0x1945,
- 0x1a1e, 0x1a1f,
- 0x1aa0, 0x1aa6,
- 0x1aa8, 0x1aad,
- 0x1b5a, 0x1b60,
- 0x1bfc, 0x1bff,
- 0x1c3b, 0x1c3f,
- 0x1c7e, 0x1c7f,
- 0x1cd3, 0x1cd3,
- 0x2010, 0x2027,
- 0x2030, 0x2043,
- 0x2045, 0x2051,
- 0x2053, 0x205e,
- 0x207d, 0x207e,
- 0x208d, 0x208e,
- 0x2329, 0x232a,
- 0x2768, 0x2775,
- 0x27c5, 0x27c6,
- 0x27e6, 0x27ef,
- 0x2983, 0x2998,
- 0x29d8, 0x29db,
- 0x29fc, 0x29fd,
- 0x2cf9, 0x2cfc,
- 0x2cfe, 0x2cff,
- 0x2d70, 0x2d70,
- 0x2e00, 0x2e2e,
- 0x2e30, 0x2e31,
- 0x3001, 0x3003,
- 0x3008, 0x3011,
- 0x3014, 0x301f,
- 0x3030, 0x3030,
- 0x303d, 0x303d,
- 0x30a0, 0x30a0,
- 0x30fb, 0x30fb,
- 0xa4fe, 0xa4ff,
- 0xa60d, 0xa60f,
- 0xa673, 0xa673,
- 0xa67e, 0xa67e,
- 0xa6f2, 0xa6f7,
- 0xa874, 0xa877,
- 0xa8ce, 0xa8cf,
- 0xa8f8, 0xa8fa,
- 0xa92e, 0xa92f,
- 0xa95f, 0xa95f,
- 0xa9c1, 0xa9cd,
- 0xa9de, 0xa9df,
- 0xaa5c, 0xaa5f,
- 0xaade, 0xaadf,
- 0xabeb, 0xabeb,
- 0xfd3e, 0xfd3f,
- 0xfe10, 0xfe19,
- 0xfe30, 0xfe52,
- 0xfe54, 0xfe61,
- 0xfe63, 0xfe63,
- 0xfe68, 0xfe68,
- 0xfe6a, 0xfe6b,
- 0xff01, 0xff03,
- 0xff05, 0xff0a,
- 0xff0c, 0xff0f,
- 0xff1a, 0xff1b,
- 0xff1f, 0xff20,
- 0xff3b, 0xff3d,
- 0xff3f, 0xff3f,
- 0xff5b, 0xff5b,
- 0xff5d, 0xff5d,
- 0xff5f, 0xff65,
- 0x10100, 0x10101,
- 0x1039f, 0x1039f,
- 0x103d0, 0x103d0,
- 0x10857, 0x10857,
- 0x1091f, 0x1091f,
- 0x1093f, 0x1093f,
- 0x10a50, 0x10a58,
- 0x10a7f, 0x10a7f,
- 0x10b39, 0x10b3f,
- 0x11047, 0x1104d,
- 0x110bb, 0x110bc,
- 0x110be, 0x110c1,
- 0x12470, 0x12473,
-}; /* CR_P */
+#define CR_P CR_Punct
/* 'Pc': General Category */
static const OnigCodePoint CR_Pc[] = {
@@ -4023,7 +8981,7 @@ static const OnigCodePoint CR_Pc[] = {
/* 'Pd': General Category */
static const OnigCodePoint CR_Pd[] = {
- 15,
+ 16,
0x002d, 0x002d,
0x058a, 0x058a,
0x05be, 0x05be,
@@ -4032,6 +8990,7 @@ static const OnigCodePoint CR_Pd[] = {
0x2010, 0x2015,
0x2e17, 0x2e17,
0x2e1a, 0x2e1a,
+ 0x2e3a, 0x2e3b,
0x301c, 0x301c,
0x3030, 0x3030,
0x30a0, 0x30a0,
@@ -4149,7 +9108,7 @@ static const OnigCodePoint CR_Pi[] = {
/* 'Po': General Category */
static const OnigCodePoint CR_Po[] = {
- 128,
+ 135,
0x0021, 0x0023,
0x0025, 0x0027,
0x002a, 0x002a,
@@ -4159,7 +9118,8 @@ static const OnigCodePoint CR_Po[] = {
0x003f, 0x0040,
0x005c, 0x005c,
0x00a1, 0x00a1,
- 0x00b7, 0x00b7,
+ 0x00a7, 0x00a7,
+ 0x00b6, 0x00b7,
0x00bf, 0x00bf,
0x037e, 0x037e,
0x0387, 0x0387,
@@ -4181,16 +9141,18 @@ static const OnigCodePoint CR_Po[] = {
0x085e, 0x085e,
0x0964, 0x0965,
0x0970, 0x0970,
+ 0x0af0, 0x0af0,
0x0df4, 0x0df4,
0x0e4f, 0x0e4f,
0x0e5a, 0x0e5b,
0x0f04, 0x0f12,
+ 0x0f14, 0x0f14,
0x0f85, 0x0f85,
0x0fd0, 0x0fd4,
0x0fd9, 0x0fda,
0x104a, 0x104f,
0x10fb, 0x10fb,
- 0x1361, 0x1368,
+ 0x1360, 0x1368,
0x166d, 0x166e,
0x16eb, 0x16ed,
0x1735, 0x1736,
@@ -4206,6 +9168,7 @@ static const OnigCodePoint CR_Po[] = {
0x1bfc, 0x1bff,
0x1c3b, 0x1c3f,
0x1c7e, 0x1c7f,
+ 0x1cc0, 0x1cc7,
0x1cd3, 0x1cd3,
0x2016, 0x2017,
0x2020, 0x2027,
@@ -4226,7 +9189,7 @@ static const OnigCodePoint CR_Po[] = {
0x2e1b, 0x2e1b,
0x2e1e, 0x2e1f,
0x2e2a, 0x2e2e,
- 0x2e30, 0x2e31,
+ 0x2e30, 0x2e39,
0x3001, 0x3003,
0x303d, 0x303d,
0x30fb, 0x30fb,
@@ -4244,6 +9207,7 @@ static const OnigCodePoint CR_Po[] = {
0xa9de, 0xa9df,
0xaa5c, 0xaa5f,
0xaade, 0xaadf,
+ 0xaaf0, 0xaaf1,
0xabeb, 0xabeb,
0xfe10, 0xfe16,
0xfe19, 0xfe19,
@@ -4265,7 +9229,7 @@ static const OnigCodePoint CR_Po[] = {
0xff3c, 0xff3c,
0xff61, 0xff61,
0xff64, 0xff65,
- 0x10100, 0x10101,
+ 0x10100, 0x10102,
0x1039f, 0x1039f,
0x103d0, 0x103d0,
0x10857, 0x10857,
@@ -4277,6 +9241,8 @@ static const OnigCodePoint CR_Po[] = {
0x11047, 0x1104d,
0x110bb, 0x110bc,
0x110be, 0x110c1,
+ 0x11140, 0x11143,
+ 0x111c5, 0x111c8,
0x12470, 0x12473,
}; /* CR_Po */
@@ -4359,7 +9325,7 @@ static const OnigCodePoint CR_Ps[] = {
/* 'S': Major Category */
static const OnigCodePoint CR_S[] = {
- 208,
+ 198,
0x0024, 0x0024,
0x002b, 0x002b,
0x003c, 0x003e,
@@ -4367,11 +9333,11 @@ static const OnigCodePoint CR_S[] = {
0x0060, 0x0060,
0x007c, 0x007c,
0x007e, 0x007e,
- 0x00a2, 0x00a9,
+ 0x00a2, 0x00a6,
+ 0x00a8, 0x00a9,
0x00ac, 0x00ac,
0x00ae, 0x00b1,
0x00b4, 0x00b4,
- 0x00b6, 0x00b6,
0x00b8, 0x00b8,
0x00d7, 0x00d7,
0x00f7, 0x00f7,
@@ -4384,6 +9350,7 @@ static const OnigCodePoint CR_S[] = {
0x0384, 0x0385,
0x03f6, 0x03f6,
0x0482, 0x0482,
+ 0x058f, 0x058f,
0x0606, 0x0608,
0x060b, 0x060b,
0x060e, 0x060f,
@@ -4400,7 +9367,8 @@ static const OnigCodePoint CR_S[] = {
0x0d79, 0x0d79,
0x0e3f, 0x0e3f,
0x0f01, 0x0f03,
- 0x0f13, 0x0f17,
+ 0x0f13, 0x0f13,
+ 0x0f15, 0x0f17,
0x0f1a, 0x0f1f,
0x0f34, 0x0f34,
0x0f36, 0x0f36,
@@ -4410,7 +9378,6 @@ static const OnigCodePoint CR_S[] = {
0x0fce, 0x0fcf,
0x0fd5, 0x0fd8,
0x109e, 0x109f,
- 0x1360, 0x1360,
0x1390, 0x1399,
0x17db, 0x17db,
0x1940, 0x1940,
@@ -4450,9 +9417,7 @@ static const OnigCodePoint CR_S[] = {
0x2500, 0x26ff,
0x2701, 0x2767,
0x2794, 0x27c4,
- 0x27c7, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x27e5,
+ 0x27c7, 0x27e5,
0x27f0, 0x2982,
0x2999, 0x29d7,
0x29dc, 0x29fb,
@@ -4473,7 +9438,8 @@ static const OnigCodePoint CR_S[] = {
0x3196, 0x319f,
0x31c0, 0x31e3,
0x3200, 0x321e,
- 0x322a, 0x3250,
+ 0x322a, 0x3247,
+ 0x3250, 0x3250,
0x3260, 0x327f,
0x328a, 0x32b0,
0x32c0, 0x32fe,
@@ -4502,7 +9468,6 @@ static const OnigCodePoint CR_S[] = {
0xffe0, 0xffe6,
0xffe8, 0xffee,
0xfffc, 0xfffd,
- 0x10102, 0x10102,
0x10137, 0x1013f,
0x10179, 0x10189,
0x10190, 0x1019b,
@@ -4527,6 +9492,7 @@ static const OnigCodePoint CR_S[] = {
0x1d789, 0x1d789,
0x1d7a9, 0x1d7a9,
0x1d7c3, 0x1d7c3,
+ 0x1eef0, 0x1eef1,
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
@@ -4534,7 +9500,7 @@ static const OnigCodePoint CR_S[] = {
0x1f0c1, 0x1f0cf,
0x1f0d1, 0x1f0df,
0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
+ 0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
0x1f1e6, 0x1f202,
0x1f210, 0x1f23a,
@@ -4552,19 +9518,9 @@ static const OnigCodePoint CR_S[] = {
0x1f442, 0x1f4f7,
0x1f4f9, 0x1f4fc,
0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
+ 0x1f5fb, 0x1f640,
0x1f645, 0x1f64f,
0x1f680, 0x1f6c5,
0x1f700, 0x1f773,
@@ -4572,9 +9528,10 @@ static const OnigCodePoint CR_S[] = {
/* 'Sc': General Category */
static const OnigCodePoint CR_Sc[] = {
- 16,
+ 17,
0x0024, 0x0024,
0x00a2, 0x00a5,
+ 0x058f, 0x058f,
0x060b, 0x060b,
0x09f2, 0x09f3,
0x09fb, 0x09fb,
@@ -4625,7 +9582,7 @@ static const OnigCodePoint CR_Sk[] = {
/* 'Sm': General Category */
static const OnigCodePoint CR_Sm[] = {
- 66,
+ 65,
0x002b, 0x002b,
0x003c, 0x003e,
0x007c, 0x007c,
@@ -4663,9 +9620,7 @@ static const OnigCodePoint CR_Sm[] = {
0x25f8, 0x25ff,
0x266f, 0x266f,
0x27c0, 0x27c4,
- 0x27c7, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x27e5,
+ 0x27c7, 0x27e5,
0x27f0, 0x27ff,
0x2900, 0x2982,
0x2999, 0x29d7,
@@ -4692,16 +9647,16 @@ static const OnigCodePoint CR_Sm[] = {
0x1d789, 0x1d789,
0x1d7a9, 0x1d7a9,
0x1d7c3, 0x1d7c3,
+ 0x1eef0, 0x1eef1,
}; /* CR_Sm */
/* 'So': General Category */
static const OnigCodePoint CR_So[] = {
- 164,
- 0x00a6, 0x00a7,
+ 153,
+ 0x00a6, 0x00a6,
0x00a9, 0x00a9,
0x00ae, 0x00ae,
0x00b0, 0x00b0,
- 0x00b6, 0x00b6,
0x0482, 0x0482,
0x060e, 0x060f,
0x06de, 0x06de,
@@ -4715,7 +9670,8 @@ static const OnigCodePoint CR_So[] = {
0x0c7f, 0x0c7f,
0x0d79, 0x0d79,
0x0f01, 0x0f03,
- 0x0f13, 0x0f17,
+ 0x0f13, 0x0f13,
+ 0x0f15, 0x0f17,
0x0f1a, 0x0f1f,
0x0f34, 0x0f34,
0x0f36, 0x0f36,
@@ -4725,7 +9681,6 @@ static const OnigCodePoint CR_So[] = {
0x0fce, 0x0fcf,
0x0fd5, 0x0fd8,
0x109e, 0x109f,
- 0x1360, 0x1360,
0x1390, 0x1399,
0x1940, 0x1940,
0x19de, 0x19ff,
@@ -4789,7 +9744,8 @@ static const OnigCodePoint CR_So[] = {
0x3196, 0x319f,
0x31c0, 0x31e3,
0x3200, 0x321e,
- 0x322a, 0x3250,
+ 0x322a, 0x3247,
+ 0x3250, 0x3250,
0x3260, 0x327f,
0x328a, 0x32b0,
0x32c0, 0x32fe,
@@ -4805,7 +9761,6 @@ static const OnigCodePoint CR_So[] = {
0xffe8, 0xffe8,
0xffed, 0xffee,
0xfffc, 0xfffd,
- 0x10102, 0x10102,
0x10137, 0x1013f,
0x10179, 0x10189,
0x10190, 0x1019b,
@@ -4827,7 +9782,7 @@ static const OnigCodePoint CR_So[] = {
0x1f0c1, 0x1f0cf,
0x1f0d1, 0x1f0df,
0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
+ 0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
0x1f1e6, 0x1f202,
0x1f210, 0x1f23a,
@@ -4845,19 +9800,9 @@ static const OnigCodePoint CR_So[] = {
0x1f442, 0x1f4f7,
0x1f4f9, 0x1f4fc,
0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
+ 0x1f5fb, 0x1f640,
0x1f645, 0x1f64f,
0x1f680, 0x1f6c5,
0x1f700, 0x1f773,
@@ -4904,7 +9849,7 @@ static const OnigCodePoint CR_Zs[] = {
/* 'Math': Derived Property */
static const OnigCodePoint CR_Math[] = {
- 106,
+ 138,
0x002b, 0x002b,
0x003c, 0x003e,
0x005e, 0x005e,
@@ -4973,9 +9918,7 @@ static const OnigCodePoint CR_Math[] = {
0x2642, 0x2642,
0x2660, 0x2663,
0x266d, 0x266f,
- 0x27c0, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x27ff,
+ 0x27c0, 0x27ff,
0x2900, 0x2aff,
0x2b30, 0x2b44,
0x2b47, 0x2b4c,
@@ -5011,1729 +9954,54 @@ static const OnigCodePoint CR_Math[] = {
0x1d552, 0x1d6a5,
0x1d6a8, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
}; /* CR_Math */
/* 'Alphabetic': Derived Property */
-static const OnigCodePoint CR_Alphabetic[] = {
- 486,
- 0x0041, 0x005a,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x02c1,
- 0x02c6, 0x02d1,
- 0x02e0, 0x02e4,
- 0x02ec, 0x02ec,
- 0x02ee, 0x02ee,
- 0x0345, 0x0345,
- 0x0370, 0x0374,
- 0x0376, 0x0377,
- 0x037a, 0x037d,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03f5,
- 0x03f7, 0x0481,
- 0x048a, 0x0527,
- 0x0531, 0x0556,
- 0x0559, 0x0559,
- 0x0561, 0x0587,
- 0x05b0, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f2,
- 0x0610, 0x061a,
- 0x0620, 0x0657,
- 0x0659, 0x065f,
- 0x066e, 0x06d3,
- 0x06d5, 0x06dc,
- 0x06e1, 0x06e8,
- 0x06ed, 0x06ef,
- 0x06fa, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x073f,
- 0x074d, 0x07b1,
- 0x07ca, 0x07ea,
- 0x07f4, 0x07f5,
- 0x07fa, 0x07fa,
- 0x0800, 0x0817,
- 0x081a, 0x082c,
- 0x0840, 0x0858,
- 0x0900, 0x093b,
- 0x093d, 0x094c,
- 0x094e, 0x0950,
- 0x0955, 0x0963,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bd, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09cc,
- 0x09ce, 0x09ce,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09f0, 0x09f1,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4c,
- 0x0a51, 0x0a51,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a70, 0x0a75,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abd, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acc,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae3,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3d, 0x0b44,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4c,
- 0x0b56, 0x0b57,
- 0x0b5c, 0x0b5d,
- 0x0b5f, 0x0b63,
- 0x0b71, 0x0b71,
- 0x0b82, 0x0b83,
- 0x0b85, 0x0b8a,
- 0x0b8e, 0x0b90,
- 0x0b92, 0x0b95,
- 0x0b99, 0x0b9a,
- 0x0b9c, 0x0b9c,
- 0x0b9e, 0x0b9f,
- 0x0ba3, 0x0ba4,
- 0x0ba8, 0x0baa,
- 0x0bae, 0x0bb9,
- 0x0bbe, 0x0bc2,
- 0x0bc6, 0x0bc8,
- 0x0bca, 0x0bcc,
- 0x0bd0, 0x0bd0,
- 0x0bd7, 0x0bd7,
- 0x0c01, 0x0c03,
- 0x0c05, 0x0c0c,
- 0x0c0e, 0x0c10,
- 0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
- 0x0c3d, 0x0c44,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4c,
- 0x0c55, 0x0c56,
- 0x0c58, 0x0c59,
- 0x0c60, 0x0c63,
- 0x0c82, 0x0c83,
- 0x0c85, 0x0c8c,
- 0x0c8e, 0x0c90,
- 0x0c92, 0x0ca8,
- 0x0caa, 0x0cb3,
- 0x0cb5, 0x0cb9,
- 0x0cbd, 0x0cc4,
- 0x0cc6, 0x0cc8,
- 0x0cca, 0x0ccc,
- 0x0cd5, 0x0cd6,
- 0x0cde, 0x0cde,
- 0x0ce0, 0x0ce3,
- 0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d3a,
- 0x0d3d, 0x0d44,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4c,
- 0x0d4e, 0x0d4e,
- 0x0d57, 0x0d57,
- 0x0d60, 0x0d63,
- 0x0d7a, 0x0d7f,
- 0x0d82, 0x0d83,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df3,
- 0x0e01, 0x0e3a,
- 0x0e40, 0x0e46,
- 0x0e4d, 0x0e4d,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ecd, 0x0ecd,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f00,
- 0x0f40, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f71, 0x0f81,
- 0x0f88, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x1000, 0x1036,
- 0x1038, 0x1038,
- 0x103b, 0x103f,
- 0x1050, 0x1062,
- 0x1065, 0x1068,
- 0x106e, 0x1086,
- 0x108e, 0x108e,
- 0x109c, 0x109d,
- 0x10a0, 0x10c5,
- 0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135f, 0x135f,
- 0x1380, 0x138f,
- 0x13a0, 0x13f4,
- 0x1401, 0x166c,
- 0x166f, 0x167f,
- 0x1681, 0x169a,
- 0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
- 0x1700, 0x170c,
- 0x170e, 0x1713,
- 0x1720, 0x1733,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17b3,
- 0x17b6, 0x17c8,
- 0x17d7, 0x17d7,
- 0x17dc, 0x17dc,
- 0x1820, 0x1877,
- 0x1880, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191c,
- 0x1920, 0x192b,
- 0x1930, 0x1938,
- 0x1950, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x1a00, 0x1a1b,
- 0x1a20, 0x1a5e,
- 0x1a61, 0x1a74,
- 0x1aa7, 0x1aa7,
- 0x1b00, 0x1b33,
- 0x1b35, 0x1b43,
- 0x1b45, 0x1b4b,
- 0x1b80, 0x1ba9,
- 0x1bae, 0x1baf,
- 0x1bc0, 0x1be5,
- 0x1be7, 0x1bf1,
- 0x1c00, 0x1c35,
- 0x1c4d, 0x1c4f,
- 0x1c5a, 0x1c7d,
- 0x1ce9, 0x1cec,
- 0x1cee, 0x1cf2,
- 0x1d00, 0x1dbf,
- 0x1e00, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fbc,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fcc,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fe0, 0x1fec,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffc,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x209c,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x212f, 0x2139,
- 0x213c, 0x213f,
- 0x2145, 0x2149,
- 0x214e, 0x214e,
- 0x2160, 0x2188,
- 0x24b6, 0x24e9,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2ce4,
- 0x2ceb, 0x2cee,
- 0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
- 0x2d6f, 0x2d6f,
- 0x2d80, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2de0, 0x2dff,
- 0x2e2f, 0x2e2f,
- 0x3005, 0x3007,
- 0x3021, 0x3029,
- 0x3031, 0x3035,
- 0x3038, 0x303c,
- 0x3041, 0x3096,
- 0x309d, 0x309f,
- 0x30a1, 0x30fa,
- 0x30fc, 0x30ff,
- 0x3105, 0x312d,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa61f,
- 0xa62a, 0xa62b,
- 0xa640, 0xa66e,
- 0xa67f, 0xa697,
- 0xa6a0, 0xa6ef,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa801,
- 0xa803, 0xa805,
- 0xa807, 0xa80a,
- 0xa80c, 0xa827,
- 0xa840, 0xa873,
- 0xa880, 0xa8c3,
- 0xa8f2, 0xa8f7,
- 0xa8fb, 0xa8fb,
- 0xa90a, 0xa92a,
- 0xa930, 0xa952,
- 0xa960, 0xa97c,
- 0xa980, 0xa9b2,
- 0xa9b4, 0xa9bf,
- 0xa9cf, 0xa9cf,
- 0xaa00, 0xaa36,
- 0xaa40, 0xaa4d,
- 0xaa60, 0xaa76,
- 0xaa7a, 0xaa7a,
- 0xaa80, 0xaabe,
- 0xaac0, 0xaac0,
- 0xaac2, 0xaac2,
- 0xaadb, 0xaadd,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xabc0, 0xabea,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb28,
- 0xfb2a, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3d,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfb,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xff21, 0xff3a,
- 0xff41, 0xff5a,
- 0xff66, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10140, 0x10174,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x10300, 0x1031e,
- 0x10330, 0x1034a,
- 0x10380, 0x1039d,
- 0x103a0, 0x103c3,
- 0x103c8, 0x103cf,
- 0x103d1, 0x103d5,
- 0x10400, 0x1049d,
- 0x10800, 0x10805,
- 0x10808, 0x10808,
- 0x1080a, 0x10835,
- 0x10837, 0x10838,
- 0x1083c, 0x1083c,
- 0x1083f, 0x10855,
- 0x10900, 0x10915,
- 0x10920, 0x10939,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x10a60, 0x10a7c,
- 0x10b00, 0x10b35,
- 0x10b40, 0x10b55,
- 0x10b60, 0x10b72,
- 0x10c00, 0x10c48,
- 0x11000, 0x11045,
- 0x11082, 0x110b8,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x13000, 0x1342e,
- 0x16800, 0x16a38,
- 0x1b000, 0x1b001,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d6c0,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6fa,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d734,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d76e,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d7a8,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7cb,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2f800, 0x2fa1d,
-}; /* CR_Alphabetic */
+#define CR_Alphabetic CR_Alpha
/* 'Lowercase': Derived Property */
-static const OnigCodePoint CR_Lowercase[] = {
- 612,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
- 0x00df, 0x00f6,
- 0x00f8, 0x00ff,
- 0x0101, 0x0101,
- 0x0103, 0x0103,
- 0x0105, 0x0105,
- 0x0107, 0x0107,
- 0x0109, 0x0109,
- 0x010b, 0x010b,
- 0x010d, 0x010d,
- 0x010f, 0x010f,
- 0x0111, 0x0111,
- 0x0113, 0x0113,
- 0x0115, 0x0115,
- 0x0117, 0x0117,
- 0x0119, 0x0119,
- 0x011b, 0x011b,
- 0x011d, 0x011d,
- 0x011f, 0x011f,
- 0x0121, 0x0121,
- 0x0123, 0x0123,
- 0x0125, 0x0125,
- 0x0127, 0x0127,
- 0x0129, 0x0129,
- 0x012b, 0x012b,
- 0x012d, 0x012d,
- 0x012f, 0x012f,
- 0x0131, 0x0131,
- 0x0133, 0x0133,
- 0x0135, 0x0135,
- 0x0137, 0x0138,
- 0x013a, 0x013a,
- 0x013c, 0x013c,
- 0x013e, 0x013e,
- 0x0140, 0x0140,
- 0x0142, 0x0142,
- 0x0144, 0x0144,
- 0x0146, 0x0146,
- 0x0148, 0x0149,
- 0x014b, 0x014b,
- 0x014d, 0x014d,
- 0x014f, 0x014f,
- 0x0151, 0x0151,
- 0x0153, 0x0153,
- 0x0155, 0x0155,
- 0x0157, 0x0157,
- 0x0159, 0x0159,
- 0x015b, 0x015b,
- 0x015d, 0x015d,
- 0x015f, 0x015f,
- 0x0161, 0x0161,
- 0x0163, 0x0163,
- 0x0165, 0x0165,
- 0x0167, 0x0167,
- 0x0169, 0x0169,
- 0x016b, 0x016b,
- 0x016d, 0x016d,
- 0x016f, 0x016f,
- 0x0171, 0x0171,
- 0x0173, 0x0173,
- 0x0175, 0x0175,
- 0x0177, 0x0177,
- 0x017a, 0x017a,
- 0x017c, 0x017c,
- 0x017e, 0x0180,
- 0x0183, 0x0183,
- 0x0185, 0x0185,
- 0x0188, 0x0188,
- 0x018c, 0x018d,
- 0x0192, 0x0192,
- 0x0195, 0x0195,
- 0x0199, 0x019b,
- 0x019e, 0x019e,
- 0x01a1, 0x01a1,
- 0x01a3, 0x01a3,
- 0x01a5, 0x01a5,
- 0x01a8, 0x01a8,
- 0x01aa, 0x01ab,
- 0x01ad, 0x01ad,
- 0x01b0, 0x01b0,
- 0x01b4, 0x01b4,
- 0x01b6, 0x01b6,
- 0x01b9, 0x01ba,
- 0x01bd, 0x01bf,
- 0x01c6, 0x01c6,
- 0x01c9, 0x01c9,
- 0x01cc, 0x01cc,
- 0x01ce, 0x01ce,
- 0x01d0, 0x01d0,
- 0x01d2, 0x01d2,
- 0x01d4, 0x01d4,
- 0x01d6, 0x01d6,
- 0x01d8, 0x01d8,
- 0x01da, 0x01da,
- 0x01dc, 0x01dd,
- 0x01df, 0x01df,
- 0x01e1, 0x01e1,
- 0x01e3, 0x01e3,
- 0x01e5, 0x01e5,
- 0x01e7, 0x01e7,
- 0x01e9, 0x01e9,
- 0x01eb, 0x01eb,
- 0x01ed, 0x01ed,
- 0x01ef, 0x01f0,
- 0x01f3, 0x01f3,
- 0x01f5, 0x01f5,
- 0x01f9, 0x01f9,
- 0x01fb, 0x01fb,
- 0x01fd, 0x01fd,
- 0x01ff, 0x01ff,
- 0x0201, 0x0201,
- 0x0203, 0x0203,
- 0x0205, 0x0205,
- 0x0207, 0x0207,
- 0x0209, 0x0209,
- 0x020b, 0x020b,
- 0x020d, 0x020d,
- 0x020f, 0x020f,
- 0x0211, 0x0211,
- 0x0213, 0x0213,
- 0x0215, 0x0215,
- 0x0217, 0x0217,
- 0x0219, 0x0219,
- 0x021b, 0x021b,
- 0x021d, 0x021d,
- 0x021f, 0x021f,
- 0x0221, 0x0221,
- 0x0223, 0x0223,
- 0x0225, 0x0225,
- 0x0227, 0x0227,
- 0x0229, 0x0229,
- 0x022b, 0x022b,
- 0x022d, 0x022d,
- 0x022f, 0x022f,
- 0x0231, 0x0231,
- 0x0233, 0x0239,
- 0x023c, 0x023c,
- 0x023f, 0x0240,
- 0x0242, 0x0242,
- 0x0247, 0x0247,
- 0x0249, 0x0249,
- 0x024b, 0x024b,
- 0x024d, 0x024d,
- 0x024f, 0x0293,
- 0x0295, 0x02b8,
- 0x02c0, 0x02c1,
- 0x02e0, 0x02e4,
- 0x0345, 0x0345,
- 0x0371, 0x0371,
- 0x0373, 0x0373,
- 0x0377, 0x0377,
- 0x037a, 0x037d,
- 0x0390, 0x0390,
- 0x03ac, 0x03ce,
- 0x03d0, 0x03d1,
- 0x03d5, 0x03d7,
- 0x03d9, 0x03d9,
- 0x03db, 0x03db,
- 0x03dd, 0x03dd,
- 0x03df, 0x03df,
- 0x03e1, 0x03e1,
- 0x03e3, 0x03e3,
- 0x03e5, 0x03e5,
- 0x03e7, 0x03e7,
- 0x03e9, 0x03e9,
- 0x03eb, 0x03eb,
- 0x03ed, 0x03ed,
- 0x03ef, 0x03f3,
- 0x03f5, 0x03f5,
- 0x03f8, 0x03f8,
- 0x03fb, 0x03fc,
- 0x0430, 0x045f,
- 0x0461, 0x0461,
- 0x0463, 0x0463,
- 0x0465, 0x0465,
- 0x0467, 0x0467,
- 0x0469, 0x0469,
- 0x046b, 0x046b,
- 0x046d, 0x046d,
- 0x046f, 0x046f,
- 0x0471, 0x0471,
- 0x0473, 0x0473,
- 0x0475, 0x0475,
- 0x0477, 0x0477,
- 0x0479, 0x0479,
- 0x047b, 0x047b,
- 0x047d, 0x047d,
- 0x047f, 0x047f,
- 0x0481, 0x0481,
- 0x048b, 0x048b,
- 0x048d, 0x048d,
- 0x048f, 0x048f,
- 0x0491, 0x0491,
- 0x0493, 0x0493,
- 0x0495, 0x0495,
- 0x0497, 0x0497,
- 0x0499, 0x0499,
- 0x049b, 0x049b,
- 0x049d, 0x049d,
- 0x049f, 0x049f,
- 0x04a1, 0x04a1,
- 0x04a3, 0x04a3,
- 0x04a5, 0x04a5,
- 0x04a7, 0x04a7,
- 0x04a9, 0x04a9,
- 0x04ab, 0x04ab,
- 0x04ad, 0x04ad,
- 0x04af, 0x04af,
- 0x04b1, 0x04b1,
- 0x04b3, 0x04b3,
- 0x04b5, 0x04b5,
- 0x04b7, 0x04b7,
- 0x04b9, 0x04b9,
- 0x04bb, 0x04bb,
- 0x04bd, 0x04bd,
- 0x04bf, 0x04bf,
- 0x04c2, 0x04c2,
- 0x04c4, 0x04c4,
- 0x04c6, 0x04c6,
- 0x04c8, 0x04c8,
- 0x04ca, 0x04ca,
- 0x04cc, 0x04cc,
- 0x04ce, 0x04cf,
- 0x04d1, 0x04d1,
- 0x04d3, 0x04d3,
- 0x04d5, 0x04d5,
- 0x04d7, 0x04d7,
- 0x04d9, 0x04d9,
- 0x04db, 0x04db,
- 0x04dd, 0x04dd,
- 0x04df, 0x04df,
- 0x04e1, 0x04e1,
- 0x04e3, 0x04e3,
- 0x04e5, 0x04e5,
- 0x04e7, 0x04e7,
- 0x04e9, 0x04e9,
- 0x04eb, 0x04eb,
- 0x04ed, 0x04ed,
- 0x04ef, 0x04ef,
- 0x04f1, 0x04f1,
- 0x04f3, 0x04f3,
- 0x04f5, 0x04f5,
- 0x04f7, 0x04f7,
- 0x04f9, 0x04f9,
- 0x04fb, 0x04fb,
- 0x04fd, 0x04fd,
- 0x04ff, 0x04ff,
- 0x0501, 0x0501,
- 0x0503, 0x0503,
- 0x0505, 0x0505,
- 0x0507, 0x0507,
- 0x0509, 0x0509,
- 0x050b, 0x050b,
- 0x050d, 0x050d,
- 0x050f, 0x050f,
- 0x0511, 0x0511,
- 0x0513, 0x0513,
- 0x0515, 0x0515,
- 0x0517, 0x0517,
- 0x0519, 0x0519,
- 0x051b, 0x051b,
- 0x051d, 0x051d,
- 0x051f, 0x051f,
- 0x0521, 0x0521,
- 0x0523, 0x0523,
- 0x0525, 0x0525,
- 0x0527, 0x0527,
- 0x0561, 0x0587,
- 0x1d00, 0x1dbf,
- 0x1e01, 0x1e01,
- 0x1e03, 0x1e03,
- 0x1e05, 0x1e05,
- 0x1e07, 0x1e07,
- 0x1e09, 0x1e09,
- 0x1e0b, 0x1e0b,
- 0x1e0d, 0x1e0d,
- 0x1e0f, 0x1e0f,
- 0x1e11, 0x1e11,
- 0x1e13, 0x1e13,
- 0x1e15, 0x1e15,
- 0x1e17, 0x1e17,
- 0x1e19, 0x1e19,
- 0x1e1b, 0x1e1b,
- 0x1e1d, 0x1e1d,
- 0x1e1f, 0x1e1f,
- 0x1e21, 0x1e21,
- 0x1e23, 0x1e23,
- 0x1e25, 0x1e25,
- 0x1e27, 0x1e27,
- 0x1e29, 0x1e29,
- 0x1e2b, 0x1e2b,
- 0x1e2d, 0x1e2d,
- 0x1e2f, 0x1e2f,
- 0x1e31, 0x1e31,
- 0x1e33, 0x1e33,
- 0x1e35, 0x1e35,
- 0x1e37, 0x1e37,
- 0x1e39, 0x1e39,
- 0x1e3b, 0x1e3b,
- 0x1e3d, 0x1e3d,
- 0x1e3f, 0x1e3f,
- 0x1e41, 0x1e41,
- 0x1e43, 0x1e43,
- 0x1e45, 0x1e45,
- 0x1e47, 0x1e47,
- 0x1e49, 0x1e49,
- 0x1e4b, 0x1e4b,
- 0x1e4d, 0x1e4d,
- 0x1e4f, 0x1e4f,
- 0x1e51, 0x1e51,
- 0x1e53, 0x1e53,
- 0x1e55, 0x1e55,
- 0x1e57, 0x1e57,
- 0x1e59, 0x1e59,
- 0x1e5b, 0x1e5b,
- 0x1e5d, 0x1e5d,
- 0x1e5f, 0x1e5f,
- 0x1e61, 0x1e61,
- 0x1e63, 0x1e63,
- 0x1e65, 0x1e65,
- 0x1e67, 0x1e67,
- 0x1e69, 0x1e69,
- 0x1e6b, 0x1e6b,
- 0x1e6d, 0x1e6d,
- 0x1e6f, 0x1e6f,
- 0x1e71, 0x1e71,
- 0x1e73, 0x1e73,
- 0x1e75, 0x1e75,
- 0x1e77, 0x1e77,
- 0x1e79, 0x1e79,
- 0x1e7b, 0x1e7b,
- 0x1e7d, 0x1e7d,
- 0x1e7f, 0x1e7f,
- 0x1e81, 0x1e81,
- 0x1e83, 0x1e83,
- 0x1e85, 0x1e85,
- 0x1e87, 0x1e87,
- 0x1e89, 0x1e89,
- 0x1e8b, 0x1e8b,
- 0x1e8d, 0x1e8d,
- 0x1e8f, 0x1e8f,
- 0x1e91, 0x1e91,
- 0x1e93, 0x1e93,
- 0x1e95, 0x1e9d,
- 0x1e9f, 0x1e9f,
- 0x1ea1, 0x1ea1,
- 0x1ea3, 0x1ea3,
- 0x1ea5, 0x1ea5,
- 0x1ea7, 0x1ea7,
- 0x1ea9, 0x1ea9,
- 0x1eab, 0x1eab,
- 0x1ead, 0x1ead,
- 0x1eaf, 0x1eaf,
- 0x1eb1, 0x1eb1,
- 0x1eb3, 0x1eb3,
- 0x1eb5, 0x1eb5,
- 0x1eb7, 0x1eb7,
- 0x1eb9, 0x1eb9,
- 0x1ebb, 0x1ebb,
- 0x1ebd, 0x1ebd,
- 0x1ebf, 0x1ebf,
- 0x1ec1, 0x1ec1,
- 0x1ec3, 0x1ec3,
- 0x1ec5, 0x1ec5,
- 0x1ec7, 0x1ec7,
- 0x1ec9, 0x1ec9,
- 0x1ecb, 0x1ecb,
- 0x1ecd, 0x1ecd,
- 0x1ecf, 0x1ecf,
- 0x1ed1, 0x1ed1,
- 0x1ed3, 0x1ed3,
- 0x1ed5, 0x1ed5,
- 0x1ed7, 0x1ed7,
- 0x1ed9, 0x1ed9,
- 0x1edb, 0x1edb,
- 0x1edd, 0x1edd,
- 0x1edf, 0x1edf,
- 0x1ee1, 0x1ee1,
- 0x1ee3, 0x1ee3,
- 0x1ee5, 0x1ee5,
- 0x1ee7, 0x1ee7,
- 0x1ee9, 0x1ee9,
- 0x1eeb, 0x1eeb,
- 0x1eed, 0x1eed,
- 0x1eef, 0x1eef,
- 0x1ef1, 0x1ef1,
- 0x1ef3, 0x1ef3,
- 0x1ef5, 0x1ef5,
- 0x1ef7, 0x1ef7,
- 0x1ef9, 0x1ef9,
- 0x1efb, 0x1efb,
- 0x1efd, 0x1efd,
- 0x1eff, 0x1f07,
- 0x1f10, 0x1f15,
- 0x1f20, 0x1f27,
- 0x1f30, 0x1f37,
- 0x1f40, 0x1f45,
- 0x1f50, 0x1f57,
- 0x1f60, 0x1f67,
- 0x1f70, 0x1f7d,
- 0x1f80, 0x1f87,
- 0x1f90, 0x1f97,
- 0x1fa0, 0x1fa7,
- 0x1fb0, 0x1fb4,
- 0x1fb6, 0x1fb7,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fc7,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fd7,
- 0x1fe0, 0x1fe7,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ff7,
- 0x2090, 0x2094,
- 0x210a, 0x210a,
- 0x210e, 0x210f,
- 0x2113, 0x2113,
- 0x212f, 0x212f,
- 0x2134, 0x2134,
- 0x2139, 0x2139,
- 0x213c, 0x213d,
- 0x2146, 0x2149,
- 0x214e, 0x214e,
- 0x2170, 0x217f,
- 0x2184, 0x2184,
- 0x24d0, 0x24e9,
- 0x2c30, 0x2c5e,
- 0x2c61, 0x2c61,
- 0x2c65, 0x2c66,
- 0x2c68, 0x2c68,
- 0x2c6a, 0x2c6a,
- 0x2c6c, 0x2c6c,
- 0x2c71, 0x2c71,
- 0x2c73, 0x2c74,
- 0x2c76, 0x2c7d,
- 0x2c81, 0x2c81,
- 0x2c83, 0x2c83,
- 0x2c85, 0x2c85,
- 0x2c87, 0x2c87,
- 0x2c89, 0x2c89,
- 0x2c8b, 0x2c8b,
- 0x2c8d, 0x2c8d,
- 0x2c8f, 0x2c8f,
- 0x2c91, 0x2c91,
- 0x2c93, 0x2c93,
- 0x2c95, 0x2c95,
- 0x2c97, 0x2c97,
- 0x2c99, 0x2c99,
- 0x2c9b, 0x2c9b,
- 0x2c9d, 0x2c9d,
- 0x2c9f, 0x2c9f,
- 0x2ca1, 0x2ca1,
- 0x2ca3, 0x2ca3,
- 0x2ca5, 0x2ca5,
- 0x2ca7, 0x2ca7,
- 0x2ca9, 0x2ca9,
- 0x2cab, 0x2cab,
- 0x2cad, 0x2cad,
- 0x2caf, 0x2caf,
- 0x2cb1, 0x2cb1,
- 0x2cb3, 0x2cb3,
- 0x2cb5, 0x2cb5,
- 0x2cb7, 0x2cb7,
- 0x2cb9, 0x2cb9,
- 0x2cbb, 0x2cbb,
- 0x2cbd, 0x2cbd,
- 0x2cbf, 0x2cbf,
- 0x2cc1, 0x2cc1,
- 0x2cc3, 0x2cc3,
- 0x2cc5, 0x2cc5,
- 0x2cc7, 0x2cc7,
- 0x2cc9, 0x2cc9,
- 0x2ccb, 0x2ccb,
- 0x2ccd, 0x2ccd,
- 0x2ccf, 0x2ccf,
- 0x2cd1, 0x2cd1,
- 0x2cd3, 0x2cd3,
- 0x2cd5, 0x2cd5,
- 0x2cd7, 0x2cd7,
- 0x2cd9, 0x2cd9,
- 0x2cdb, 0x2cdb,
- 0x2cdd, 0x2cdd,
- 0x2cdf, 0x2cdf,
- 0x2ce1, 0x2ce1,
- 0x2ce3, 0x2ce4,
- 0x2cec, 0x2cec,
- 0x2cee, 0x2cee,
- 0x2d00, 0x2d25,
- 0xa641, 0xa641,
- 0xa643, 0xa643,
- 0xa645, 0xa645,
- 0xa647, 0xa647,
- 0xa649, 0xa649,
- 0xa64b, 0xa64b,
- 0xa64d, 0xa64d,
- 0xa64f, 0xa64f,
- 0xa651, 0xa651,
- 0xa653, 0xa653,
- 0xa655, 0xa655,
- 0xa657, 0xa657,
- 0xa659, 0xa659,
- 0xa65b, 0xa65b,
- 0xa65d, 0xa65d,
- 0xa65f, 0xa65f,
- 0xa661, 0xa661,
- 0xa663, 0xa663,
- 0xa665, 0xa665,
- 0xa667, 0xa667,
- 0xa669, 0xa669,
- 0xa66b, 0xa66b,
- 0xa66d, 0xa66d,
- 0xa681, 0xa681,
- 0xa683, 0xa683,
- 0xa685, 0xa685,
- 0xa687, 0xa687,
- 0xa689, 0xa689,
- 0xa68b, 0xa68b,
- 0xa68d, 0xa68d,
- 0xa68f, 0xa68f,
- 0xa691, 0xa691,
- 0xa693, 0xa693,
- 0xa695, 0xa695,
- 0xa697, 0xa697,
- 0xa723, 0xa723,
- 0xa725, 0xa725,
- 0xa727, 0xa727,
- 0xa729, 0xa729,
- 0xa72b, 0xa72b,
- 0xa72d, 0xa72d,
- 0xa72f, 0xa731,
- 0xa733, 0xa733,
- 0xa735, 0xa735,
- 0xa737, 0xa737,
- 0xa739, 0xa739,
- 0xa73b, 0xa73b,
- 0xa73d, 0xa73d,
- 0xa73f, 0xa73f,
- 0xa741, 0xa741,
- 0xa743, 0xa743,
- 0xa745, 0xa745,
- 0xa747, 0xa747,
- 0xa749, 0xa749,
- 0xa74b, 0xa74b,
- 0xa74d, 0xa74d,
- 0xa74f, 0xa74f,
- 0xa751, 0xa751,
- 0xa753, 0xa753,
- 0xa755, 0xa755,
- 0xa757, 0xa757,
- 0xa759, 0xa759,
- 0xa75b, 0xa75b,
- 0xa75d, 0xa75d,
- 0xa75f, 0xa75f,
- 0xa761, 0xa761,
- 0xa763, 0xa763,
- 0xa765, 0xa765,
- 0xa767, 0xa767,
- 0xa769, 0xa769,
- 0xa76b, 0xa76b,
- 0xa76d, 0xa76d,
- 0xa76f, 0xa778,
- 0xa77a, 0xa77a,
- 0xa77c, 0xa77c,
- 0xa77f, 0xa77f,
- 0xa781, 0xa781,
- 0xa783, 0xa783,
- 0xa785, 0xa785,
- 0xa787, 0xa787,
- 0xa78c, 0xa78c,
- 0xa78e, 0xa78e,
- 0xa791, 0xa791,
- 0xa7a1, 0xa7a1,
- 0xa7a3, 0xa7a3,
- 0xa7a5, 0xa7a5,
- 0xa7a7, 0xa7a7,
- 0xa7a9, 0xa7a9,
- 0xa7fa, 0xa7fa,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xff41, 0xff5a,
- 0x10428, 0x1044f,
- 0x1d41a, 0x1d433,
- 0x1d44e, 0x1d454,
- 0x1d456, 0x1d467,
- 0x1d482, 0x1d49b,
- 0x1d4b6, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d4cf,
- 0x1d4ea, 0x1d503,
- 0x1d51e, 0x1d537,
- 0x1d552, 0x1d56b,
- 0x1d586, 0x1d59f,
- 0x1d5ba, 0x1d5d3,
- 0x1d5ee, 0x1d607,
- 0x1d622, 0x1d63b,
- 0x1d656, 0x1d66f,
- 0x1d68a, 0x1d6a5,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6e1,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d71b,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d755,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d78f,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7c9,
- 0x1d7cb, 0x1d7cb,
-}; /* CR_Lowercase */
+#define CR_Lowercase CR_Lower
/* 'Uppercase': Derived Property */
-static const OnigCodePoint CR_Uppercase[] = {
- 605,
- 0x0041, 0x005a,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00de,
- 0x0100, 0x0100,
- 0x0102, 0x0102,
- 0x0104, 0x0104,
- 0x0106, 0x0106,
- 0x0108, 0x0108,
- 0x010a, 0x010a,
- 0x010c, 0x010c,
- 0x010e, 0x010e,
- 0x0110, 0x0110,
- 0x0112, 0x0112,
- 0x0114, 0x0114,
- 0x0116, 0x0116,
- 0x0118, 0x0118,
- 0x011a, 0x011a,
- 0x011c, 0x011c,
- 0x011e, 0x011e,
- 0x0120, 0x0120,
- 0x0122, 0x0122,
- 0x0124, 0x0124,
- 0x0126, 0x0126,
- 0x0128, 0x0128,
- 0x012a, 0x012a,
- 0x012c, 0x012c,
- 0x012e, 0x012e,
- 0x0130, 0x0130,
- 0x0132, 0x0132,
- 0x0134, 0x0134,
- 0x0136, 0x0136,
- 0x0139, 0x0139,
- 0x013b, 0x013b,
- 0x013d, 0x013d,
- 0x013f, 0x013f,
- 0x0141, 0x0141,
- 0x0143, 0x0143,
- 0x0145, 0x0145,
- 0x0147, 0x0147,
- 0x014a, 0x014a,
- 0x014c, 0x014c,
- 0x014e, 0x014e,
- 0x0150, 0x0150,
- 0x0152, 0x0152,
- 0x0154, 0x0154,
- 0x0156, 0x0156,
- 0x0158, 0x0158,
- 0x015a, 0x015a,
- 0x015c, 0x015c,
- 0x015e, 0x015e,
- 0x0160, 0x0160,
- 0x0162, 0x0162,
- 0x0164, 0x0164,
- 0x0166, 0x0166,
- 0x0168, 0x0168,
- 0x016a, 0x016a,
- 0x016c, 0x016c,
- 0x016e, 0x016e,
- 0x0170, 0x0170,
- 0x0172, 0x0172,
- 0x0174, 0x0174,
- 0x0176, 0x0176,
- 0x0178, 0x0179,
- 0x017b, 0x017b,
- 0x017d, 0x017d,
- 0x0181, 0x0182,
- 0x0184, 0x0184,
- 0x0186, 0x0187,
- 0x0189, 0x018b,
- 0x018e, 0x0191,
- 0x0193, 0x0194,
- 0x0196, 0x0198,
- 0x019c, 0x019d,
- 0x019f, 0x01a0,
- 0x01a2, 0x01a2,
- 0x01a4, 0x01a4,
- 0x01a6, 0x01a7,
- 0x01a9, 0x01a9,
- 0x01ac, 0x01ac,
- 0x01ae, 0x01af,
- 0x01b1, 0x01b3,
- 0x01b5, 0x01b5,
- 0x01b7, 0x01b8,
- 0x01bc, 0x01bc,
- 0x01c4, 0x01c4,
- 0x01c7, 0x01c7,
- 0x01ca, 0x01ca,
- 0x01cd, 0x01cd,
- 0x01cf, 0x01cf,
- 0x01d1, 0x01d1,
- 0x01d3, 0x01d3,
- 0x01d5, 0x01d5,
- 0x01d7, 0x01d7,
- 0x01d9, 0x01d9,
- 0x01db, 0x01db,
- 0x01de, 0x01de,
- 0x01e0, 0x01e0,
- 0x01e2, 0x01e2,
- 0x01e4, 0x01e4,
- 0x01e6, 0x01e6,
- 0x01e8, 0x01e8,
- 0x01ea, 0x01ea,
- 0x01ec, 0x01ec,
- 0x01ee, 0x01ee,
- 0x01f1, 0x01f1,
- 0x01f4, 0x01f4,
- 0x01f6, 0x01f8,
- 0x01fa, 0x01fa,
- 0x01fc, 0x01fc,
- 0x01fe, 0x01fe,
- 0x0200, 0x0200,
- 0x0202, 0x0202,
- 0x0204, 0x0204,
- 0x0206, 0x0206,
- 0x0208, 0x0208,
- 0x020a, 0x020a,
- 0x020c, 0x020c,
- 0x020e, 0x020e,
- 0x0210, 0x0210,
- 0x0212, 0x0212,
- 0x0214, 0x0214,
- 0x0216, 0x0216,
- 0x0218, 0x0218,
- 0x021a, 0x021a,
- 0x021c, 0x021c,
- 0x021e, 0x021e,
- 0x0220, 0x0220,
- 0x0222, 0x0222,
- 0x0224, 0x0224,
- 0x0226, 0x0226,
- 0x0228, 0x0228,
- 0x022a, 0x022a,
- 0x022c, 0x022c,
- 0x022e, 0x022e,
- 0x0230, 0x0230,
- 0x0232, 0x0232,
- 0x023a, 0x023b,
- 0x023d, 0x023e,
- 0x0241, 0x0241,
- 0x0243, 0x0246,
- 0x0248, 0x0248,
- 0x024a, 0x024a,
- 0x024c, 0x024c,
- 0x024e, 0x024e,
- 0x0370, 0x0370,
- 0x0372, 0x0372,
- 0x0376, 0x0376,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x038f,
- 0x0391, 0x03a1,
- 0x03a3, 0x03ab,
- 0x03cf, 0x03cf,
- 0x03d2, 0x03d4,
- 0x03d8, 0x03d8,
- 0x03da, 0x03da,
- 0x03dc, 0x03dc,
- 0x03de, 0x03de,
- 0x03e0, 0x03e0,
- 0x03e2, 0x03e2,
- 0x03e4, 0x03e4,
- 0x03e6, 0x03e6,
- 0x03e8, 0x03e8,
- 0x03ea, 0x03ea,
- 0x03ec, 0x03ec,
- 0x03ee, 0x03ee,
- 0x03f4, 0x03f4,
- 0x03f7, 0x03f7,
- 0x03f9, 0x03fa,
- 0x03fd, 0x042f,
- 0x0460, 0x0460,
- 0x0462, 0x0462,
- 0x0464, 0x0464,
- 0x0466, 0x0466,
- 0x0468, 0x0468,
- 0x046a, 0x046a,
- 0x046c, 0x046c,
- 0x046e, 0x046e,
- 0x0470, 0x0470,
- 0x0472, 0x0472,
- 0x0474, 0x0474,
- 0x0476, 0x0476,
- 0x0478, 0x0478,
- 0x047a, 0x047a,
- 0x047c, 0x047c,
- 0x047e, 0x047e,
- 0x0480, 0x0480,
- 0x048a, 0x048a,
- 0x048c, 0x048c,
- 0x048e, 0x048e,
- 0x0490, 0x0490,
- 0x0492, 0x0492,
- 0x0494, 0x0494,
- 0x0496, 0x0496,
- 0x0498, 0x0498,
- 0x049a, 0x049a,
- 0x049c, 0x049c,
- 0x049e, 0x049e,
- 0x04a0, 0x04a0,
- 0x04a2, 0x04a2,
- 0x04a4, 0x04a4,
- 0x04a6, 0x04a6,
- 0x04a8, 0x04a8,
- 0x04aa, 0x04aa,
- 0x04ac, 0x04ac,
- 0x04ae, 0x04ae,
- 0x04b0, 0x04b0,
- 0x04b2, 0x04b2,
- 0x04b4, 0x04b4,
- 0x04b6, 0x04b6,
- 0x04b8, 0x04b8,
- 0x04ba, 0x04ba,
- 0x04bc, 0x04bc,
- 0x04be, 0x04be,
- 0x04c0, 0x04c1,
- 0x04c3, 0x04c3,
- 0x04c5, 0x04c5,
- 0x04c7, 0x04c7,
- 0x04c9, 0x04c9,
- 0x04cb, 0x04cb,
- 0x04cd, 0x04cd,
- 0x04d0, 0x04d0,
- 0x04d2, 0x04d2,
- 0x04d4, 0x04d4,
- 0x04d6, 0x04d6,
- 0x04d8, 0x04d8,
- 0x04da, 0x04da,
- 0x04dc, 0x04dc,
- 0x04de, 0x04de,
- 0x04e0, 0x04e0,
- 0x04e2, 0x04e2,
- 0x04e4, 0x04e4,
- 0x04e6, 0x04e6,
- 0x04e8, 0x04e8,
- 0x04ea, 0x04ea,
- 0x04ec, 0x04ec,
- 0x04ee, 0x04ee,
- 0x04f0, 0x04f0,
- 0x04f2, 0x04f2,
- 0x04f4, 0x04f4,
- 0x04f6, 0x04f6,
- 0x04f8, 0x04f8,
- 0x04fa, 0x04fa,
- 0x04fc, 0x04fc,
- 0x04fe, 0x04fe,
- 0x0500, 0x0500,
- 0x0502, 0x0502,
- 0x0504, 0x0504,
- 0x0506, 0x0506,
- 0x0508, 0x0508,
- 0x050a, 0x050a,
- 0x050c, 0x050c,
- 0x050e, 0x050e,
- 0x0510, 0x0510,
- 0x0512, 0x0512,
- 0x0514, 0x0514,
- 0x0516, 0x0516,
- 0x0518, 0x0518,
- 0x051a, 0x051a,
- 0x051c, 0x051c,
- 0x051e, 0x051e,
- 0x0520, 0x0520,
- 0x0522, 0x0522,
- 0x0524, 0x0524,
- 0x0526, 0x0526,
- 0x0531, 0x0556,
- 0x10a0, 0x10c5,
- 0x1e00, 0x1e00,
- 0x1e02, 0x1e02,
- 0x1e04, 0x1e04,
- 0x1e06, 0x1e06,
- 0x1e08, 0x1e08,
- 0x1e0a, 0x1e0a,
- 0x1e0c, 0x1e0c,
- 0x1e0e, 0x1e0e,
- 0x1e10, 0x1e10,
- 0x1e12, 0x1e12,
- 0x1e14, 0x1e14,
- 0x1e16, 0x1e16,
- 0x1e18, 0x1e18,
- 0x1e1a, 0x1e1a,
- 0x1e1c, 0x1e1c,
- 0x1e1e, 0x1e1e,
- 0x1e20, 0x1e20,
- 0x1e22, 0x1e22,
- 0x1e24, 0x1e24,
- 0x1e26, 0x1e26,
- 0x1e28, 0x1e28,
- 0x1e2a, 0x1e2a,
- 0x1e2c, 0x1e2c,
- 0x1e2e, 0x1e2e,
- 0x1e30, 0x1e30,
- 0x1e32, 0x1e32,
- 0x1e34, 0x1e34,
- 0x1e36, 0x1e36,
- 0x1e38, 0x1e38,
- 0x1e3a, 0x1e3a,
- 0x1e3c, 0x1e3c,
- 0x1e3e, 0x1e3e,
- 0x1e40, 0x1e40,
- 0x1e42, 0x1e42,
- 0x1e44, 0x1e44,
- 0x1e46, 0x1e46,
- 0x1e48, 0x1e48,
- 0x1e4a, 0x1e4a,
- 0x1e4c, 0x1e4c,
- 0x1e4e, 0x1e4e,
- 0x1e50, 0x1e50,
- 0x1e52, 0x1e52,
- 0x1e54, 0x1e54,
- 0x1e56, 0x1e56,
- 0x1e58, 0x1e58,
- 0x1e5a, 0x1e5a,
- 0x1e5c, 0x1e5c,
- 0x1e5e, 0x1e5e,
- 0x1e60, 0x1e60,
- 0x1e62, 0x1e62,
- 0x1e64, 0x1e64,
- 0x1e66, 0x1e66,
- 0x1e68, 0x1e68,
- 0x1e6a, 0x1e6a,
- 0x1e6c, 0x1e6c,
- 0x1e6e, 0x1e6e,
- 0x1e70, 0x1e70,
- 0x1e72, 0x1e72,
- 0x1e74, 0x1e74,
- 0x1e76, 0x1e76,
- 0x1e78, 0x1e78,
- 0x1e7a, 0x1e7a,
- 0x1e7c, 0x1e7c,
- 0x1e7e, 0x1e7e,
- 0x1e80, 0x1e80,
- 0x1e82, 0x1e82,
- 0x1e84, 0x1e84,
- 0x1e86, 0x1e86,
- 0x1e88, 0x1e88,
- 0x1e8a, 0x1e8a,
- 0x1e8c, 0x1e8c,
- 0x1e8e, 0x1e8e,
- 0x1e90, 0x1e90,
- 0x1e92, 0x1e92,
- 0x1e94, 0x1e94,
- 0x1e9e, 0x1e9e,
- 0x1ea0, 0x1ea0,
- 0x1ea2, 0x1ea2,
- 0x1ea4, 0x1ea4,
- 0x1ea6, 0x1ea6,
- 0x1ea8, 0x1ea8,
- 0x1eaa, 0x1eaa,
- 0x1eac, 0x1eac,
- 0x1eae, 0x1eae,
- 0x1eb0, 0x1eb0,
- 0x1eb2, 0x1eb2,
- 0x1eb4, 0x1eb4,
- 0x1eb6, 0x1eb6,
- 0x1eb8, 0x1eb8,
- 0x1eba, 0x1eba,
- 0x1ebc, 0x1ebc,
- 0x1ebe, 0x1ebe,
- 0x1ec0, 0x1ec0,
- 0x1ec2, 0x1ec2,
- 0x1ec4, 0x1ec4,
- 0x1ec6, 0x1ec6,
- 0x1ec8, 0x1ec8,
- 0x1eca, 0x1eca,
- 0x1ecc, 0x1ecc,
- 0x1ece, 0x1ece,
- 0x1ed0, 0x1ed0,
- 0x1ed2, 0x1ed2,
- 0x1ed4, 0x1ed4,
- 0x1ed6, 0x1ed6,
- 0x1ed8, 0x1ed8,
- 0x1eda, 0x1eda,
- 0x1edc, 0x1edc,
- 0x1ede, 0x1ede,
- 0x1ee0, 0x1ee0,
- 0x1ee2, 0x1ee2,
- 0x1ee4, 0x1ee4,
- 0x1ee6, 0x1ee6,
- 0x1ee8, 0x1ee8,
- 0x1eea, 0x1eea,
- 0x1eec, 0x1eec,
- 0x1eee, 0x1eee,
- 0x1ef0, 0x1ef0,
- 0x1ef2, 0x1ef2,
- 0x1ef4, 0x1ef4,
- 0x1ef6, 0x1ef6,
- 0x1ef8, 0x1ef8,
- 0x1efa, 0x1efa,
- 0x1efc, 0x1efc,
- 0x1efe, 0x1efe,
- 0x1f08, 0x1f0f,
- 0x1f18, 0x1f1d,
- 0x1f28, 0x1f2f,
- 0x1f38, 0x1f3f,
- 0x1f48, 0x1f4d,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f5f,
- 0x1f68, 0x1f6f,
- 0x1fb8, 0x1fbb,
- 0x1fc8, 0x1fcb,
- 0x1fd8, 0x1fdb,
- 0x1fe8, 0x1fec,
- 0x1ff8, 0x1ffb,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210b, 0x210d,
- 0x2110, 0x2112,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x2130, 0x2133,
- 0x213e, 0x213f,
- 0x2145, 0x2145,
- 0x2160, 0x216f,
- 0x2183, 0x2183,
- 0x24b6, 0x24cf,
- 0x2c00, 0x2c2e,
- 0x2c60, 0x2c60,
- 0x2c62, 0x2c64,
- 0x2c67, 0x2c67,
- 0x2c69, 0x2c69,
- 0x2c6b, 0x2c6b,
- 0x2c6d, 0x2c70,
- 0x2c72, 0x2c72,
- 0x2c75, 0x2c75,
- 0x2c7e, 0x2c80,
- 0x2c82, 0x2c82,
- 0x2c84, 0x2c84,
- 0x2c86, 0x2c86,
- 0x2c88, 0x2c88,
- 0x2c8a, 0x2c8a,
- 0x2c8c, 0x2c8c,
- 0x2c8e, 0x2c8e,
- 0x2c90, 0x2c90,
- 0x2c92, 0x2c92,
- 0x2c94, 0x2c94,
- 0x2c96, 0x2c96,
- 0x2c98, 0x2c98,
- 0x2c9a, 0x2c9a,
- 0x2c9c, 0x2c9c,
- 0x2c9e, 0x2c9e,
- 0x2ca0, 0x2ca0,
- 0x2ca2, 0x2ca2,
- 0x2ca4, 0x2ca4,
- 0x2ca6, 0x2ca6,
- 0x2ca8, 0x2ca8,
- 0x2caa, 0x2caa,
- 0x2cac, 0x2cac,
- 0x2cae, 0x2cae,
- 0x2cb0, 0x2cb0,
- 0x2cb2, 0x2cb2,
- 0x2cb4, 0x2cb4,
- 0x2cb6, 0x2cb6,
- 0x2cb8, 0x2cb8,
- 0x2cba, 0x2cba,
- 0x2cbc, 0x2cbc,
- 0x2cbe, 0x2cbe,
- 0x2cc0, 0x2cc0,
- 0x2cc2, 0x2cc2,
- 0x2cc4, 0x2cc4,
- 0x2cc6, 0x2cc6,
- 0x2cc8, 0x2cc8,
- 0x2cca, 0x2cca,
- 0x2ccc, 0x2ccc,
- 0x2cce, 0x2cce,
- 0x2cd0, 0x2cd0,
- 0x2cd2, 0x2cd2,
- 0x2cd4, 0x2cd4,
- 0x2cd6, 0x2cd6,
- 0x2cd8, 0x2cd8,
- 0x2cda, 0x2cda,
- 0x2cdc, 0x2cdc,
- 0x2cde, 0x2cde,
- 0x2ce0, 0x2ce0,
- 0x2ce2, 0x2ce2,
- 0x2ceb, 0x2ceb,
- 0x2ced, 0x2ced,
- 0xa640, 0xa640,
- 0xa642, 0xa642,
- 0xa644, 0xa644,
- 0xa646, 0xa646,
- 0xa648, 0xa648,
- 0xa64a, 0xa64a,
- 0xa64c, 0xa64c,
- 0xa64e, 0xa64e,
- 0xa650, 0xa650,
- 0xa652, 0xa652,
- 0xa654, 0xa654,
- 0xa656, 0xa656,
- 0xa658, 0xa658,
- 0xa65a, 0xa65a,
- 0xa65c, 0xa65c,
- 0xa65e, 0xa65e,
- 0xa660, 0xa660,
- 0xa662, 0xa662,
- 0xa664, 0xa664,
- 0xa666, 0xa666,
- 0xa668, 0xa668,
- 0xa66a, 0xa66a,
- 0xa66c, 0xa66c,
- 0xa680, 0xa680,
- 0xa682, 0xa682,
- 0xa684, 0xa684,
- 0xa686, 0xa686,
- 0xa688, 0xa688,
- 0xa68a, 0xa68a,
- 0xa68c, 0xa68c,
- 0xa68e, 0xa68e,
- 0xa690, 0xa690,
- 0xa692, 0xa692,
- 0xa694, 0xa694,
- 0xa696, 0xa696,
- 0xa722, 0xa722,
- 0xa724, 0xa724,
- 0xa726, 0xa726,
- 0xa728, 0xa728,
- 0xa72a, 0xa72a,
- 0xa72c, 0xa72c,
- 0xa72e, 0xa72e,
- 0xa732, 0xa732,
- 0xa734, 0xa734,
- 0xa736, 0xa736,
- 0xa738, 0xa738,
- 0xa73a, 0xa73a,
- 0xa73c, 0xa73c,
- 0xa73e, 0xa73e,
- 0xa740, 0xa740,
- 0xa742, 0xa742,
- 0xa744, 0xa744,
- 0xa746, 0xa746,
- 0xa748, 0xa748,
- 0xa74a, 0xa74a,
- 0xa74c, 0xa74c,
- 0xa74e, 0xa74e,
- 0xa750, 0xa750,
- 0xa752, 0xa752,
- 0xa754, 0xa754,
- 0xa756, 0xa756,
- 0xa758, 0xa758,
- 0xa75a, 0xa75a,
- 0xa75c, 0xa75c,
- 0xa75e, 0xa75e,
- 0xa760, 0xa760,
- 0xa762, 0xa762,
- 0xa764, 0xa764,
- 0xa766, 0xa766,
- 0xa768, 0xa768,
- 0xa76a, 0xa76a,
- 0xa76c, 0xa76c,
- 0xa76e, 0xa76e,
- 0xa779, 0xa779,
- 0xa77b, 0xa77b,
- 0xa77d, 0xa77e,
- 0xa780, 0xa780,
- 0xa782, 0xa782,
- 0xa784, 0xa784,
- 0xa786, 0xa786,
- 0xa78b, 0xa78b,
- 0xa78d, 0xa78d,
- 0xa790, 0xa790,
- 0xa7a0, 0xa7a0,
- 0xa7a2, 0xa7a2,
- 0xa7a4, 0xa7a4,
- 0xa7a6, 0xa7a6,
- 0xa7a8, 0xa7a8,
- 0xff21, 0xff3a,
- 0x10400, 0x10427,
- 0x1d400, 0x1d419,
- 0x1d434, 0x1d44d,
- 0x1d468, 0x1d481,
- 0x1d49c, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b5,
- 0x1d4d0, 0x1d4e9,
- 0x1d504, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d538, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d56c, 0x1d585,
- 0x1d5a0, 0x1d5b9,
- 0x1d5d4, 0x1d5ed,
- 0x1d608, 0x1d621,
- 0x1d63c, 0x1d655,
- 0x1d670, 0x1d689,
- 0x1d6a8, 0x1d6c0,
- 0x1d6e2, 0x1d6fa,
- 0x1d71c, 0x1d734,
- 0x1d756, 0x1d76e,
- 0x1d790, 0x1d7a8,
- 0x1d7ca, 0x1d7ca,
-}; /* CR_Uppercase */
+#define CR_Uppercase CR_Upper
/* 'Cased': Derived Property */
static const OnigCodePoint CR_Cased[] = {
- 112,
+ 119,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -6761,6 +10029,8 @@ static const OnigCodePoint CR_Cased[] = {
0x0531, 0x0556,
0x0561, 0x0587,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x1d00, 0x1dbf,
0x1e00, 0x1f15,
0x1f18, 0x1f1d,
@@ -6781,7 +10051,9 @@ static const OnigCodePoint CR_Cased[] = {
0x1fe0, 0x1fec,
0x1ff2, 0x1ff4,
0x1ff6, 0x1ffc,
- 0x2090, 0x2094,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
0x2102, 0x2102,
0x2107, 0x2107,
0x210a, 0x2113,
@@ -6803,14 +10075,17 @@ static const OnigCodePoint CR_Cased[] = {
0x2c30, 0x2c5e,
0x2c60, 0x2ce4,
0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
0xa640, 0xa66d,
0xa680, 0xa697,
0xa722, 0xa787,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa7fa,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa7fa,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
0xff21, 0xff3a,
@@ -6850,7 +10125,7 @@ static const OnigCodePoint CR_Cased[] = {
/* 'Case_Ignorable': Derived Property */
static const OnigCodePoint CR_Case_Ignorable[] = {
- 277,
+ 295,
0x0027, 0x0027,
0x002e, 0x002e,
0x003a, 0x003a,
@@ -6874,7 +10149,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x05c4, 0x05c5,
0x05c7, 0x05c7,
0x05f4, 0x05f4,
- 0x0600, 0x0603,
+ 0x0600, 0x0604,
0x0610, 0x061a,
0x0640, 0x0640,
0x064b, 0x065f,
@@ -6890,6 +10165,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x07fa, 0x07fa,
0x0816, 0x082d,
0x0859, 0x085b,
+ 0x08e4, 0x08fe,
0x0900, 0x0902,
0x093a, 0x093a,
0x093c, 0x093c,
@@ -7009,6 +10285,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x1b80, 0x1b81,
0x1ba2, 0x1ba5,
0x1ba8, 0x1ba9,
+ 0x1bab, 0x1bab,
0x1be6, 0x1be6,
0x1be8, 0x1be9,
0x1bed, 0x1bed,
@@ -7020,7 +10297,8 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x1cd4, 0x1ce0,
0x1ce2, 0x1ce8,
0x1ced, 0x1ced,
- 0x1d2c, 0x1d61,
+ 0x1cf4, 0x1cf4,
+ 0x1d2c, 0x1d6a,
0x1d78, 0x1d78,
0x1d9b, 0x1de6,
0x1dfc, 0x1dff,
@@ -7041,14 +10319,14 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x207f, 0x207f,
0x2090, 0x209c,
0x20d0, 0x20f0,
- 0x2c7d, 0x2c7d,
+ 0x2c7c, 0x2c7d,
0x2cef, 0x2cf1,
0x2d6f, 0x2d6f,
0x2d7f, 0x2d7f,
0x2de0, 0x2dff,
0x2e2f, 0x2e2f,
0x3005, 0x3005,
- 0x302a, 0x302f,
+ 0x302a, 0x302d,
0x3031, 0x3035,
0x303b, 0x303b,
0x3099, 0x309e,
@@ -7057,12 +10335,14 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0xa4f8, 0xa4fd,
0xa60c, 0xa60c,
0xa66f, 0xa672,
- 0xa67c, 0xa67d,
+ 0xa674, 0xa67d,
0xa67f, 0xa67f,
+ 0xa69f, 0xa69f,
0xa6f0, 0xa6f1,
0xa700, 0xa721,
0xa770, 0xa770,
0xa788, 0xa78a,
+ 0xa7f8, 0xa7f9,
0xa802, 0xa802,
0xa806, 0xa806,
0xa80b, 0xa80b,
@@ -7088,6 +10368,9 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0xaabe, 0xaabf,
0xaac1, 0xaac1,
0xaadd, 0xaadd,
+ 0xaaec, 0xaaed,
+ 0xaaf3, 0xaaf4,
+ 0xaaf6, 0xaaf6,
0xabe5, 0xabe5,
0xabe8, 0xabe8,
0xabed, 0xabed,
@@ -7120,6 +10403,16 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
0x110b3, 0x110b6,
0x110b9, 0x110ba,
0x110bd, 0x110bd,
+ 0x11100, 0x11102,
+ 0x11127, 0x1112b,
+ 0x1112d, 0x11134,
+ 0x11180, 0x11181,
+ 0x111b6, 0x111be,
+ 0x116ab, 0x116ab,
+ 0x116ad, 0x116ad,
+ 0x116b0, 0x116b5,
+ 0x116b7, 0x116b7,
+ 0x16f8f, 0x16f9f,
0x1d167, 0x1d169,
0x1d173, 0x1d182,
0x1d185, 0x1d18b,
@@ -7132,7 +10425,7 @@ static const OnigCodePoint CR_Case_Ignorable[] = {
/* 'Changes_When_Lowercased': Derived Property */
static const OnigCodePoint CR_Changes_When_Lowercased[] = {
- 566,
+ 571,
0x0041, 0x005a,
0x00c0, 0x00d6,
0x00d8, 0x00de,
@@ -7400,6 +10693,8 @@ static const OnigCodePoint CR_Changes_When_Lowercased[] = {
0x0526, 0x0526,
0x0531, 0x0556,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x1e00, 0x1e00,
0x1e02, 0x1e02,
0x1e04, 0x1e04,
@@ -7609,6 +10904,7 @@ static const OnigCodePoint CR_Changes_When_Lowercased[] = {
0x2ce2, 0x2ce2,
0x2ceb, 0x2ceb,
0x2ced, 0x2ced,
+ 0x2cf2, 0x2cf2,
0xa640, 0xa640,
0xa642, 0xa642,
0xa644, 0xa644,
@@ -7692,18 +10988,20 @@ static const OnigCodePoint CR_Changes_When_Lowercased[] = {
0xa78b, 0xa78b,
0xa78d, 0xa78d,
0xa790, 0xa790,
+ 0xa792, 0xa792,
0xa7a0, 0xa7a0,
0xa7a2, 0xa7a2,
0xa7a4, 0xa7a4,
0xa7a6, 0xa7a6,
0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
0xff21, 0xff3a,
0x10400, 0x10427,
}; /* CR_Changes_When_Lowercased */
/* 'Changes_When_Uppercased': Derived Property */
static const OnigCodePoint CR_Changes_When_Uppercased[] = {
- 582,
+ 586,
0x0061, 0x007a,
0x00b5, 0x00b5,
0x00df, 0x00f6,
@@ -7853,7 +11151,7 @@ static const OnigCodePoint CR_Changes_When_Uppercased[] = {
0x025b, 0x025b,
0x0260, 0x0260,
0x0263, 0x0263,
- 0x0265, 0x0265,
+ 0x0265, 0x0266,
0x0268, 0x0269,
0x026b, 0x026b,
0x026f, 0x026f,
@@ -8194,7 +11492,10 @@ static const OnigCodePoint CR_Changes_When_Uppercased[] = {
0x2ce3, 0x2ce3,
0x2cec, 0x2cec,
0x2cee, 0x2cee,
+ 0x2cf3, 0x2cf3,
0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
0xa641, 0xa641,
0xa643, 0xa643,
0xa645, 0xa645,
@@ -8277,6 +11578,7 @@ static const OnigCodePoint CR_Changes_When_Uppercased[] = {
0xa787, 0xa787,
0xa78c, 0xa78c,
0xa791, 0xa791,
+ 0xa793, 0xa793,
0xa7a1, 0xa7a1,
0xa7a3, 0xa7a3,
0xa7a5, 0xa7a5,
@@ -8290,7 +11592,7 @@ static const OnigCodePoint CR_Changes_When_Uppercased[] = {
/* 'Changes_When_Titlecased': Derived Property */
static const OnigCodePoint CR_Changes_When_Titlecased[] = {
- 583,
+ 587,
0x0061, 0x007a,
0x00b5, 0x00b5,
0x00df, 0x00f6,
@@ -8441,7 +11743,7 @@ static const OnigCodePoint CR_Changes_When_Titlecased[] = {
0x025b, 0x025b,
0x0260, 0x0260,
0x0263, 0x0263,
- 0x0265, 0x0265,
+ 0x0265, 0x0266,
0x0268, 0x0269,
0x026b, 0x026b,
0x026f, 0x026f,
@@ -8782,7 +12084,10 @@ static const OnigCodePoint CR_Changes_When_Titlecased[] = {
0x2ce3, 0x2ce3,
0x2cec, 0x2cec,
0x2cee, 0x2cee,
+ 0x2cf3, 0x2cf3,
0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
0xa641, 0xa641,
0xa643, 0xa643,
0xa645, 0xa645,
@@ -8865,6 +12170,7 @@ static const OnigCodePoint CR_Changes_When_Titlecased[] = {
0xa787, 0xa787,
0xa78c, 0xa78c,
0xa791, 0xa791,
+ 0xa793, 0xa793,
0xa7a1, 0xa7a1,
0xa7a3, 0xa7a3,
0xa7a5, 0xa7a5,
@@ -8878,7 +12184,7 @@ static const OnigCodePoint CR_Changes_When_Titlecased[] = {
/* 'Changes_When_Casefolded': Derived Property */
static const OnigCodePoint CR_Changes_When_Casefolded[] = {
- 577,
+ 582,
0x0041, 0x005a,
0x00b5, 0x00b5,
0x00c0, 0x00d6,
@@ -9153,6 +12459,8 @@ static const OnigCodePoint CR_Changes_When_Casefolded[] = {
0x0531, 0x0556,
0x0587, 0x0587,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x1e00, 0x1e00,
0x1e02, 0x1e02,
0x1e04, 0x1e04,
@@ -9364,6 +12672,7 @@ static const OnigCodePoint CR_Changes_When_Casefolded[] = {
0x2ce2, 0x2ce2,
0x2ceb, 0x2ceb,
0x2ced, 0x2ced,
+ 0x2cf2, 0x2cf2,
0xa640, 0xa640,
0xa642, 0xa642,
0xa644, 0xa644,
@@ -9447,11 +12756,13 @@ static const OnigCodePoint CR_Changes_When_Casefolded[] = {
0xa78b, 0xa78b,
0xa78d, 0xa78d,
0xa790, 0xa790,
+ 0xa792, 0xa792,
0xa7a0, 0xa7a0,
0xa7a2, 0xa7a2,
0xa7a4, 0xa7a4,
0xa7a6, 0xa7a6,
0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
0xff21, 0xff3a,
@@ -9460,7 +12771,7 @@ static const OnigCodePoint CR_Changes_When_Casefolded[] = {
/* 'Changes_When_Casemapped': Derived Property */
static const OnigCodePoint CR_Changes_When_Casemapped[] = {
- 99,
+ 104,
0x0041, 0x005a,
0x0061, 0x007a,
0x00b5, 0x00b5,
@@ -9481,7 +12792,7 @@ static const OnigCodePoint CR_Changes_When_Casemapped[] = {
0x025b, 0x025b,
0x0260, 0x0260,
0x0263, 0x0263,
- 0x0265, 0x0265,
+ 0x0265, 0x0266,
0x0268, 0x0269,
0x026b, 0x026b,
0x026f, 0x026f,
@@ -9509,6 +12820,8 @@ static const OnigCodePoint CR_Changes_When_Casemapped[] = {
0x0531, 0x0556,
0x0561, 0x0587,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x1d79, 0x1d79,
0x1d7d, 0x1d7d,
0x1e00, 0x1e9b,
@@ -9546,15 +12859,18 @@ static const OnigCodePoint CR_Changes_When_Casemapped[] = {
0x2c75, 0x2c76,
0x2c7e, 0x2ce3,
0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
0xa640, 0xa66d,
0xa680, 0xa697,
0xa722, 0xa72f,
0xa732, 0xa76f,
0xa779, 0xa787,
0xa78b, 0xa78d,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
0xff21, 0xff3a,
@@ -9564,7 +12880,7 @@ static const OnigCodePoint CR_Changes_When_Casemapped[] = {
/* 'ID_Start': Derived Property */
static const OnigCodePoint CR_ID_Start[] = {
- 437,
+ 488,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -9612,6 +12928,8 @@ static const OnigCodePoint CR_ID_Start[] = {
0x0824, 0x0824,
0x0828, 0x0828,
0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
0x0904, 0x0939,
0x093d, 0x093d,
0x0950, 0x0950,
@@ -9717,7 +13035,7 @@ static const OnigCodePoint CR_ID_Start[] = {
0x0ebd, 0x0ebd,
0x0ec0, 0x0ec4,
0x0ec6, 0x0ec6,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f00,
0x0f40, 0x0f47,
0x0f49, 0x0f6c,
@@ -9732,9 +13050,10 @@ static const OnigCodePoint CR_ID_Start[] = {
0x1075, 0x1081,
0x108e, 0x108e,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
+ 0x10fc, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -9782,12 +13101,13 @@ static const OnigCodePoint CR_ID_Start[] = {
0x1b45, 0x1b4b,
0x1b83, 0x1ba0,
0x1bae, 0x1baf,
- 0x1bc0, 0x1be5,
+ 0x1bba, 0x1be5,
0x1c00, 0x1c23,
0x1c4d, 0x1c4f,
0x1c5a, 0x1c7d,
0x1ce9, 0x1cec,
0x1cee, 0x1cf1,
+ 0x1cf5, 0x1cf6,
0x1d00, 0x1dbf,
0x1e00, 0x1f15,
0x1f18, 0x1f1d,
@@ -9828,8 +13148,11 @@ static const OnigCodePoint CR_ID_Start[] = {
0x2c30, 0x2c5e,
0x2c60, 0x2ce4,
0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d6f,
0x2d80, 0x2d96,
0x2da0, 0x2da6,
@@ -9853,7 +13176,7 @@ static const OnigCodePoint CR_ID_Start[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
@@ -9865,9 +13188,9 @@ static const OnigCodePoint CR_ID_Start[] = {
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa801,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa822,
@@ -9892,6 +13215,8 @@ static const OnigCodePoint CR_ID_Start[] = {
0xaac0, 0xaac0,
0xaac2, 0xaac2,
0xaadb, 0xaadd,
+ 0xaae0, 0xaaea,
+ 0xaaf2, 0xaaf4,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -9901,8 +13226,7 @@ static const OnigCodePoint CR_ID_Start[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -9952,6 +13276,8 @@ static const OnigCodePoint CR_ID_Start[] = {
0x1083f, 0x10855,
0x10900, 0x10915,
0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a00,
0x10a10, 0x10a13,
0x10a15, 0x10a17,
@@ -9963,10 +13289,18 @@ static const OnigCodePoint CR_ID_Start[] = {
0x10c00, 0x10c48,
0x11003, 0x11037,
0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
0x12000, 0x1236e,
0x12400, 0x12462,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f50,
+ 0x16f93, 0x16f9f,
0x1b000, 0x1b001,
0x1d400, 0x1d454,
0x1d456, 0x1d49c,
@@ -9998,6 +13332,39 @@ static const OnigCodePoint CR_ID_Start[] = {
0x1d78a, 0x1d7a8,
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -10006,7 +13373,7 @@ static const OnigCodePoint CR_ID_Start[] = {
/* 'ID_Continue': Derived Property */
static const OnigCodePoint CR_ID_Continue[] = {
- 514,
+ 564,
0x0030, 0x0039,
0x0041, 0x005a,
0x005f, 0x005f,
@@ -10055,6 +13422,9 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x07fa, 0x07fa,
0x0800, 0x082d,
0x0840, 0x085b,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
0x0900, 0x0963,
0x0966, 0x096f,
0x0971, 0x0977,
@@ -10202,7 +13572,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x0ec6, 0x0ec6,
0x0ec8, 0x0ecd,
0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f00,
0x0f18, 0x0f19,
0x0f20, 0x0f29,
@@ -10218,9 +13588,10 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1000, 0x1049,
0x1050, 0x109d,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
+ 0x10fc, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -10252,8 +13623,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1760, 0x176c,
0x176e, 0x1770,
0x1772, 0x1773,
- 0x1780, 0x17b3,
- 0x17b6, 0x17d3,
+ 0x1780, 0x17d3,
0x17d7, 0x17d7,
0x17dc, 0x17dd,
0x17e0, 0x17e9,
@@ -10279,14 +13649,12 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1b00, 0x1b4b,
0x1b50, 0x1b59,
0x1b6b, 0x1b73,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1bf3,
+ 0x1b80, 0x1bf3,
0x1c00, 0x1c37,
0x1c40, 0x1c49,
0x1c4d, 0x1c7d,
0x1cd0, 0x1cd2,
- 0x1cd4, 0x1cf2,
+ 0x1cd4, 0x1cf6,
0x1d00, 0x1de6,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
@@ -10331,9 +13699,11 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
0x2c60, 0x2ce4,
- 0x2ceb, 0x2cf1,
+ 0x2ceb, 0x2cf3,
0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d6f,
0x2d7f, 0x2d96,
0x2da0, 0x2da6,
@@ -10358,21 +13728,21 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
0xa610, 0xa62b,
0xa640, 0xa66f,
- 0xa67c, 0xa67d,
+ 0xa674, 0xa67d,
0xa67f, 0xa697,
- 0xa6a0, 0xa6f1,
+ 0xa69f, 0xa6f1,
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa827,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa827,
0xa840, 0xa873,
0xa880, 0xa8c4,
0xa8d0, 0xa8d9,
@@ -10390,6 +13760,8 @@ static const OnigCodePoint CR_ID_Continue[] = {
0xaa7a, 0xaa7b,
0xaa80, 0xaac2,
0xaadb, 0xaadd,
+ 0xaae0, 0xaaef,
+ 0xaaf2, 0xaaf6,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -10401,8 +13773,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -10459,6 +13830,8 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1083f, 0x10855,
0x10900, 0x10915,
0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a13,
@@ -10474,10 +13847,21 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x11000, 0x11046,
0x11066, 0x1106f,
0x11080, 0x110ba,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x1113f,
+ 0x11180, 0x111c4,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
0x12000, 0x1236e,
0x12400, 0x12462,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
0x1d165, 0x1d169,
0x1d16d, 0x1d172,
@@ -10516,6 +13900,39 @@ static const OnigCodePoint CR_ID_Continue[] = {
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -10525,7 +13942,7 @@ static const OnigCodePoint CR_ID_Continue[] = {
/* 'XID_Start': Derived Property */
static const OnigCodePoint CR_XID_Start[] = {
- 444,
+ 495,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
@@ -10573,6 +13990,8 @@ static const OnigCodePoint CR_XID_Start[] = {
0x0824, 0x0824,
0x0828, 0x0828,
0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
0x0904, 0x0939,
0x093d, 0x093d,
0x0950, 0x0950,
@@ -10678,7 +14097,7 @@ static const OnigCodePoint CR_XID_Start[] = {
0x0ebd, 0x0ebd,
0x0ec0, 0x0ec4,
0x0ec6, 0x0ec6,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f00,
0x0f40, 0x0f47,
0x0f49, 0x0f6c,
@@ -10693,9 +14112,10 @@ static const OnigCodePoint CR_XID_Start[] = {
0x1075, 0x1081,
0x108e, 0x108e,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
+ 0x10fc, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -10743,12 +14163,13 @@ static const OnigCodePoint CR_XID_Start[] = {
0x1b45, 0x1b4b,
0x1b83, 0x1ba0,
0x1bae, 0x1baf,
- 0x1bc0, 0x1be5,
+ 0x1bba, 0x1be5,
0x1c00, 0x1c23,
0x1c4d, 0x1c4f,
0x1c5a, 0x1c7d,
0x1ce9, 0x1cec,
0x1cee, 0x1cf1,
+ 0x1cf5, 0x1cf6,
0x1d00, 0x1dbf,
0x1e00, 0x1f15,
0x1f18, 0x1f1d,
@@ -10789,8 +14210,11 @@ static const OnigCodePoint CR_XID_Start[] = {
0x2c30, 0x2c5e,
0x2c60, 0x2ce4,
0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d6f,
0x2d80, 0x2d96,
0x2da0, 0x2da6,
@@ -10814,7 +14238,7 @@ static const OnigCodePoint CR_XID_Start[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
@@ -10826,9 +14250,9 @@ static const OnigCodePoint CR_XID_Start[] = {
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa801,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa822,
@@ -10853,6 +14277,8 @@ static const OnigCodePoint CR_XID_Start[] = {
0xaac0, 0xaac0,
0xaac2, 0xaac2,
0xaadb, 0xaadd,
+ 0xaae0, 0xaaea,
+ 0xaaf2, 0xaaf4,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -10862,8 +14288,7 @@ static const OnigCodePoint CR_XID_Start[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -10920,6 +14345,8 @@ static const OnigCodePoint CR_XID_Start[] = {
0x1083f, 0x10855,
0x10900, 0x10915,
0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a00,
0x10a10, 0x10a13,
0x10a15, 0x10a17,
@@ -10931,10 +14358,18 @@ static const OnigCodePoint CR_XID_Start[] = {
0x10c00, 0x10c48,
0x11003, 0x11037,
0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
0x12000, 0x1236e,
0x12400, 0x12462,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f50,
+ 0x16f93, 0x16f9f,
0x1b000, 0x1b001,
0x1d400, 0x1d454,
0x1d456, 0x1d49c,
@@ -10966,6 +14401,39 @@ static const OnigCodePoint CR_XID_Start[] = {
0x1d78a, 0x1d7a8,
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -10974,7 +14442,7 @@ static const OnigCodePoint CR_XID_Start[] = {
/* 'XID_Continue': Derived Property */
static const OnigCodePoint CR_XID_Continue[] = {
- 521,
+ 571,
0x0030, 0x0039,
0x0041, 0x005a,
0x005f, 0x005f,
@@ -11023,6 +14491,9 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x07fa, 0x07fa,
0x0800, 0x082d,
0x0840, 0x085b,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
0x0900, 0x0963,
0x0966, 0x096f,
0x0971, 0x0977,
@@ -11170,7 +14641,7 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x0ec6, 0x0ec6,
0x0ec8, 0x0ecd,
0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f00,
0x0f18, 0x0f19,
0x0f20, 0x0f29,
@@ -11186,9 +14657,10 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1000, 0x1049,
0x1050, 0x109d,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
+ 0x10fc, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -11220,8 +14692,7 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1760, 0x176c,
0x176e, 0x1770,
0x1772, 0x1773,
- 0x1780, 0x17b3,
- 0x17b6, 0x17d3,
+ 0x1780, 0x17d3,
0x17d7, 0x17d7,
0x17dc, 0x17dd,
0x17e0, 0x17e9,
@@ -11247,14 +14718,12 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1b00, 0x1b4b,
0x1b50, 0x1b59,
0x1b6b, 0x1b73,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1bf3,
+ 0x1b80, 0x1bf3,
0x1c00, 0x1c37,
0x1c40, 0x1c49,
0x1c4d, 0x1c7d,
0x1cd0, 0x1cd2,
- 0x1cd4, 0x1cf2,
+ 0x1cd4, 0x1cf6,
0x1d00, 0x1de6,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
@@ -11299,9 +14768,11 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
0x2c60, 0x2ce4,
- 0x2ceb, 0x2cf1,
+ 0x2ceb, 0x2cf3,
0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d6f,
0x2d7f, 0x2d96,
0x2da0, 0x2da6,
@@ -11327,21 +14798,21 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
0xa610, 0xa62b,
0xa640, 0xa66f,
- 0xa67c, 0xa67d,
+ 0xa674, 0xa67d,
0xa67f, 0xa697,
- 0xa6a0, 0xa6f1,
+ 0xa69f, 0xa6f1,
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa827,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa827,
0xa840, 0xa873,
0xa880, 0xa8c4,
0xa8d0, 0xa8d9,
@@ -11359,6 +14830,8 @@ static const OnigCodePoint CR_XID_Continue[] = {
0xaa7a, 0xaa7b,
0xaa80, 0xaac2,
0xaadb, 0xaadd,
+ 0xaae0, 0xaaef,
+ 0xaaf2, 0xaaf6,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -11370,8 +14843,7 @@ static const OnigCodePoint CR_XID_Continue[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -11434,6 +14906,8 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1083f, 0x10855,
0x10900, 0x10915,
0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a13,
@@ -11449,10 +14923,21 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x11000, 0x11046,
0x11066, 0x1106f,
0x11080, 0x110ba,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x1113f,
+ 0x11180, 0x111c4,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
0x12000, 0x1236e,
0x12400, 0x12462,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
0x1d165, 0x1d169,
0x1d16d, 0x1d172,
@@ -11491,6 +14976,39 @@ static const OnigCodePoint CR_XID_Continue[] = {
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -11520,7 +15038,7 @@ static const OnigCodePoint CR_Default_Ignorable_Code_Point[] = {
/* 'Grapheme_Extend': Derived Property */
static const OnigCodePoint CR_Grapheme_Extend[] = {
- 215,
+ 232,
0x0300, 0x036f,
0x0483, 0x0489,
0x0591, 0x05bd,
@@ -11544,6 +15062,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x0825, 0x0827,
0x0829, 0x082d,
0x0859, 0x085b,
+ 0x08e4, 0x08fe,
0x0900, 0x0902,
0x093a, 0x093a,
0x093c, 0x093c,
@@ -11639,6 +15158,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x1732, 0x1734,
0x1752, 0x1753,
0x1772, 0x1773,
+ 0x17b4, 0x17b5,
0x17b7, 0x17bd,
0x17c6, 0x17c6,
0x17c9, 0x17d3,
@@ -11666,6 +15186,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x1b80, 0x1b81,
0x1ba2, 0x1ba5,
0x1ba8, 0x1ba9,
+ 0x1bab, 0x1bab,
0x1be6, 0x1be6,
0x1be8, 0x1be9,
0x1bed, 0x1bed,
@@ -11676,6 +15197,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x1cd4, 0x1ce0,
0x1ce2, 0x1ce8,
0x1ced, 0x1ced,
+ 0x1cf4, 0x1cf4,
0x1dc0, 0x1de6,
0x1dfc, 0x1dff,
0x200c, 0x200d,
@@ -11686,7 +15208,8 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x302a, 0x302f,
0x3099, 0x309a,
0xa66f, 0xa672,
- 0xa67c, 0xa67d,
+ 0xa674, 0xa67d,
+ 0xa69f, 0xa69f,
0xa6f0, 0xa6f1,
0xa802, 0xa802,
0xa806, 0xa806,
@@ -11710,6 +15233,8 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0xaab7, 0xaab8,
0xaabe, 0xaabf,
0xaac1, 0xaac1,
+ 0xaaec, 0xaaed,
+ 0xaaf6, 0xaaf6,
0xabe5, 0xabe5,
0xabe8, 0xabe8,
0xabed, 0xabed,
@@ -11728,6 +15253,16 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
0x11080, 0x11081,
0x110b3, 0x110b6,
0x110b9, 0x110ba,
+ 0x11100, 0x11102,
+ 0x11127, 0x1112b,
+ 0x1112d, 0x11134,
+ 0x11180, 0x11181,
+ 0x111b6, 0x111be,
+ 0x116ab, 0x116ab,
+ 0x116ad, 0x116ad,
+ 0x116b0, 0x116b5,
+ 0x116b7, 0x116b7,
+ 0x16f8f, 0x16f92,
0x1d165, 0x1d165,
0x1d167, 0x1d169,
0x1d16e, 0x1d172,
@@ -11740,7 +15275,7 @@ static const OnigCodePoint CR_Grapheme_Extend[] = {
/* 'Grapheme_Base': Derived Property */
static const OnigCodePoint CR_Grapheme_Base[] = {
- 596,
+ 643,
0x0020, 0x007e,
0x00a0, 0x00ac,
0x00ae, 0x02ff,
@@ -11755,6 +15290,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x0559, 0x055f,
0x0561, 0x0587,
0x0589, 0x058a,
+ 0x058f, 0x058f,
0x05be, 0x05be,
0x05c0, 0x05c0,
0x05c3, 0x05c3,
@@ -11783,6 +15319,8 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x0830, 0x083e,
0x0840, 0x0858,
0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
0x0903, 0x0939,
0x093b, 0x093b,
0x093d, 0x0940,
@@ -11831,8 +15369,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x0acb, 0x0acc,
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae1,
- 0x0ae6, 0x0aef,
- 0x0af1, 0x0af1,
+ 0x0ae6, 0x0af1,
0x0b02, 0x0b03,
0x0b05, 0x0b0c,
0x0b0f, 0x0b10,
@@ -11932,7 +15469,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x0ec0, 0x0ec4,
0x0ec6, 0x0ec6,
0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f17,
0x0f1a, 0x0f34,
0x0f36, 0x0f36,
@@ -11957,8 +15494,9 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1087, 0x108c,
0x108e, 0x109c,
0x109e, 0x10c5,
- 0x10d0, 0x10fc,
- 0x1100, 0x1248,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -12031,8 +15569,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1b82, 0x1ba1,
0x1ba6, 0x1ba7,
0x1baa, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1be5,
+ 0x1bac, 0x1be5,
0x1be7, 0x1be7,
0x1bea, 0x1bec,
0x1bee, 0x1bee,
@@ -12041,10 +15578,12 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1c34, 0x1c35,
0x1c3b, 0x1c49,
0x1c4d, 0x1c7f,
+ 0x1cc0, 0x1cc7,
0x1cd3, 0x1cd3,
0x1ce1, 0x1ce1,
0x1ce9, 0x1cec,
- 0x1cee, 0x1cf2,
+ 0x1cee, 0x1cf3,
+ 0x1cf5, 0x1cf6,
0x1d00, 0x1dbf,
0x1e00, 0x1f15,
0x1f18, 0x1f1d,
@@ -12074,15 +15613,16 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x2400, 0x2426,
0x2440, 0x244a,
0x2460, 0x26ff,
- 0x2701, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x2b4c,
+ 0x2701, 0x2b4c,
0x2b50, 0x2b59,
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
0x2c60, 0x2cee,
+ 0x2cf2, 0x2cf3,
0x2cf9, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d70,
0x2d80, 0x2d96,
0x2da0, 0x2da6,
@@ -12093,7 +15633,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x2dc8, 0x2dce,
0x2dd0, 0x2dd6,
0x2dd8, 0x2dde,
- 0x2e00, 0x2e31,
+ 0x2e00, 0x2e3b,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
0x2f00, 0x2fd5,
@@ -12109,7 +15649,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x31f0, 0x321e,
0x3220, 0x32fe,
0x3300, 0x4db5,
- 0x4dc0, 0x9fcb,
+ 0x4dc0, 0x9fcc,
0xa000, 0xa48c,
0xa490, 0xa4c6,
0xa4d0, 0xa62b,
@@ -12119,9 +15659,9 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0xa6a0, 0xa6ef,
0xa6f2, 0xa6f7,
0xa700, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa801,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa824,
@@ -12155,7 +15695,8 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0xaab9, 0xaabd,
0xaac0, 0xaac0,
0xaac2, 0xaac2,
- 0xaadb, 0xaadf,
+ 0xaadb, 0xaaeb,
+ 0xaaee, 0xaaf5,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -12168,8 +15709,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -12231,6 +15771,8 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x10900, 0x1091b,
0x1091f, 0x10939,
0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a00,
0x10a10, 0x10a13,
0x10a15, 0x10a17,
@@ -12252,11 +15794,27 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x110b7, 0x110b8,
0x110bb, 0x110bc,
0x110be, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11103, 0x11126,
+ 0x1112c, 0x1112c,
+ 0x11136, 0x11143,
+ 0x11182, 0x111b5,
+ 0x111bf, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116aa,
+ 0x116ac, 0x116ac,
+ 0x116ae, 0x116af,
+ 0x116b6, 0x116b6,
+ 0x116c0, 0x116c9,
0x12000, 0x1236e,
0x12400, 0x12462,
0x12470, 0x12473,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f93, 0x16f9f,
0x1b000, 0x1b001,
0x1d000, 0x1d0f5,
0x1d100, 0x1d126,
@@ -12291,6 +15849,40 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1d552, 0x1d6a5,
0x1d6a8, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
@@ -12299,7 +15891,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1f0d1, 0x1f0df,
0x1f100, 0x1f10a,
0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
+ 0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
0x1f1e6, 0x1f202,
0x1f210, 0x1f23a,
@@ -12317,19 +15909,9 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
0x1f442, 0x1f4f7,
0x1f4f9, 0x1f4fc,
0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
+ 0x1f5fb, 0x1f640,
0x1f645, 0x1f64f,
0x1f680, 0x1f6c5,
0x1f700, 0x1f773,
@@ -12341,7 +15923,7 @@ static const OnigCodePoint CR_Grapheme_Base[] = {
/* 'Grapheme_Link': Derived Property */
static const OnigCodePoint CR_Grapheme_Link[] = {
- 29,
+ 33,
0x094d, 0x094d,
0x09cd, 0x09cd,
0x0a4d, 0x0a4d,
@@ -12360,22 +15942,26 @@ static const OnigCodePoint CR_Grapheme_Link[] = {
0x17d2, 0x17d2,
0x1a60, 0x1a60,
0x1b44, 0x1b44,
- 0x1baa, 0x1baa,
+ 0x1baa, 0x1bab,
0x1bf2, 0x1bf3,
0x2d7f, 0x2d7f,
0xa806, 0xa806,
0xa8c4, 0xa8c4,
0xa953, 0xa953,
0xa9c0, 0xa9c0,
+ 0xaaf6, 0xaaf6,
0xabed, 0xabed,
0x10a3f, 0x10a3f,
0x11046, 0x11046,
0x110b9, 0x110b9,
+ 0x11133, 0x11134,
+ 0x111c0, 0x111c0,
+ 0x116b6, 0x116b6,
}; /* CR_Grapheme_Link */
/* 'Common': Script */
static const OnigCodePoint CR_Common[] = {
- 169,
+ 157,
0x0000, 0x0040,
0x005b, 0x0060,
0x007b, 0x00a9,
@@ -12398,7 +15984,6 @@ static const OnigCodePoint CR_Common[] = {
0x0660, 0x0669,
0x06dd, 0x06dd,
0x0964, 0x0965,
- 0x0970, 0x0970,
0x0e3f, 0x0e3f,
0x0fd5, 0x0fd8,
0x10fb, 0x10fb,
@@ -12409,7 +15994,8 @@ static const OnigCodePoint CR_Common[] = {
0x1cd3, 0x1cd3,
0x1ce1, 0x1ce1,
0x1ce9, 0x1cec,
- 0x1cee, 0x1cf2,
+ 0x1cee, 0x1cf3,
+ 0x1cf5, 0x1cf6,
0x2000, 0x200b,
0x200e, 0x2064,
0x206a, 0x2070,
@@ -12426,12 +16012,10 @@ static const OnigCodePoint CR_Common[] = {
0x2400, 0x2426,
0x2440, 0x244a,
0x2460, 0x26ff,
- 0x2701, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x27ff,
+ 0x2701, 0x27ff,
0x2900, 0x2b4c,
0x2b50, 0x2b59,
- 0x2e00, 0x2e31,
+ 0x2e00, 0x2e3b,
0x2ff0, 0x2ffb,
0x3000, 0x3004,
0x3006, 0x3006,
@@ -12508,7 +16092,7 @@ static const OnigCodePoint CR_Common[] = {
0x1f0d1, 0x1f0df,
0x1f100, 0x1f10a,
0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
+ 0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
0x1f1e6, 0x1f1ff,
0x1f201, 0x1f202,
@@ -12527,19 +16111,9 @@ static const OnigCodePoint CR_Common[] = {
0x1f442, 0x1f4f7,
0x1f4f9, 0x1f4fc,
0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
+ 0x1f5fb, 0x1f640,
0x1f645, 0x1f64f,
0x1f680, 0x1f6c5,
0x1f700, 0x1f773,
@@ -12574,9 +16148,9 @@ static const OnigCodePoint CR_Latin[] = {
0x2c60, 0x2c7f,
0xa722, 0xa787,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa7ff,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa7ff,
0xfb00, 0xfb06,
0xff21, 0xff3a,
0xff41, 0xff5a,
@@ -12628,17 +16202,18 @@ static const OnigCodePoint CR_Cyrillic[] = {
0x1d2b, 0x1d2b,
0x1d78, 0x1d78,
0x2de0, 0x2dff,
- 0xa640, 0xa673,
- 0xa67c, 0xa697,
+ 0xa640, 0xa697,
+ 0xa69f, 0xa69f,
}; /* CR_Cyrillic */
/* 'Armenian': Script */
static const OnigCodePoint CR_Armenian[] = {
- 5,
+ 6,
0x0531, 0x0556,
0x0559, 0x055f,
0x0561, 0x0587,
0x058a, 0x058a,
+ 0x058f, 0x058f,
0xfb13, 0xfb17,
}; /* CR_Armenian */
@@ -12658,8 +16233,8 @@ static const OnigCodePoint CR_Hebrew[] = {
/* 'Arabic': Script */
static const OnigCodePoint CR_Arabic[] = {
- 19,
- 0x0600, 0x0603,
+ 56,
+ 0x0600, 0x0604,
0x0606, 0x060b,
0x060d, 0x061a,
0x061e, 0x061e,
@@ -12670,6 +16245,9 @@ static const OnigCodePoint CR_Arabic[] = {
0x0671, 0x06dc,
0x06de, 0x06ff,
0x0750, 0x077f,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
0xfb50, 0xfbc1,
0xfbd3, 0xfd3d,
0xfd50, 0xfd8f,
@@ -12678,6 +16256,40 @@ static const OnigCodePoint CR_Arabic[] = {
0xfe70, 0xfe74,
0xfe76, 0xfefc,
0x10e60, 0x10e7e,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
}; /* CR_Arabic */
/* 'Syriac': Script */
@@ -12696,11 +16308,10 @@ static const OnigCodePoint CR_Thaana[] = {
/* 'Devanagari': Script */
static const OnigCodePoint CR_Devanagari[] = {
- 6,
+ 5,
0x0900, 0x0950,
0x0953, 0x0963,
- 0x0966, 0x096f,
- 0x0971, 0x0977,
+ 0x0966, 0x0977,
0x0979, 0x097f,
0xa8e0, 0xa8fb,
}; /* CR_Devanagari */
@@ -12747,7 +16358,7 @@ static const OnigCodePoint CR_Gurmukhi[] = {
/* 'Gujarati': Script */
static const OnigCodePoint CR_Gujarati[] = {
- 14,
+ 13,
0x0a81, 0x0a83,
0x0a85, 0x0a8d,
0x0a8f, 0x0a91,
@@ -12760,8 +16371,7 @@ static const OnigCodePoint CR_Gujarati[] = {
0x0acb, 0x0acd,
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0af1, 0x0af1,
+ 0x0ae6, 0x0af1,
}; /* CR_Gujarati */
/* 'Oriya': Script */
@@ -12901,7 +16511,7 @@ static const OnigCodePoint CR_Lao[] = {
0x0ec6, 0x0ec6,
0x0ec8, 0x0ecd,
0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
}; /* CR_Lao */
/* 'Tibetan': Script */
@@ -12925,11 +16535,15 @@ static const OnigCodePoint CR_Myanmar[] = {
/* 'Georgian': Script */
static const OnigCodePoint CR_Georgian[] = {
- 4,
+ 8,
0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
+ 0x10fc, 0x10ff,
0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
}; /* CR_Georgian */
/* 'Hangul': Script */
@@ -13066,7 +16680,7 @@ static const OnigCodePoint CR_Bopomofo[] = {
/* 'Han': Script */
static const OnigCodePoint CR_Han[] = {
- 16,
+ 15,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
0x2f00, 0x2fd5,
@@ -13075,9 +16689,8 @@ static const OnigCodePoint CR_Han[] = {
0x3021, 0x3029,
0x3038, 0x303b,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0x4e00, 0x9fcc,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
@@ -13113,7 +16726,7 @@ static const OnigCodePoint CR_Deseret[] = {
/* 'Inherited': Script */
static const OnigCodePoint CR_Inherited[] = {
- 24,
+ 25,
0x0300, 0x036f,
0x0485, 0x0486,
0x064b, 0x0655,
@@ -13124,6 +16737,7 @@ static const OnigCodePoint CR_Inherited[] = {
0x1cd4, 0x1ce0,
0x1ce2, 0x1ce8,
0x1ced, 0x1ced,
+ 0x1cf4, 0x1cf4,
0x1dc0, 0x1de6,
0x1dfc, 0x1dff,
0x200c, 0x200d,
@@ -13244,7 +16858,7 @@ static const OnigCodePoint CR_Buginese[] = {
static const OnigCodePoint CR_Coptic[] = {
3,
0x03e2, 0x03ef,
- 0x2c80, 0x2cf1,
+ 0x2c80, 0x2cf3,
0x2cf9, 0x2cff,
}; /* CR_Coptic */
@@ -13267,7 +16881,7 @@ static const OnigCodePoint CR_Glagolitic[] = {
/* 'Tifinagh': Script */
static const OnigCodePoint CR_Tifinagh[] = {
3,
- 0x2d30, 0x2d65,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d70,
0x2d7f, 0x2d7f,
}; /* CR_Tifinagh */
@@ -13335,8 +16949,8 @@ static const OnigCodePoint CR_Nko[] = {
/* 'Sundanese': Script */
static const OnigCodePoint CR_Sundanese[] = {
2,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
+ 0x1b80, 0x1bbf,
+ 0x1cc0, 0x1cc7,
}; /* CR_Sundanese */
/* 'Lepcha': Script */
@@ -13467,7 +17081,8 @@ static const OnigCodePoint CR_Javanese[] = {
/* 'Meetei_Mayek': Script */
static const OnigCodePoint CR_Meetei_Mayek[] = {
- 2,
+ 3,
+ 0xaae0, 0xaaf6,
0xabc0, 0xabed,
0xabf0, 0xabf9,
}; /* CR_Meetei_Mayek */
@@ -13532,21 +17147,57 @@ static const OnigCodePoint CR_Mandaic[] = {
0x085e, 0x085e,
}; /* CR_Mandaic */
+/* 'Chakma': Script */
+static const OnigCodePoint CR_Chakma[] = {
+ 2,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+}; /* CR_Chakma */
+
+/* 'Meroitic_Cursive': Script */
+static const OnigCodePoint CR_Meroitic_Cursive[] = {
+ 2,
+ 0x109a0, 0x109b7,
+ 0x109be, 0x109bf,
+}; /* CR_Meroitic_Cursive */
+
+/* 'Meroitic_Hieroglyphs': Script */
+static const OnigCodePoint CR_Meroitic_Hieroglyphs[] = {
+ 1,
+ 0x10980, 0x1099f,
+}; /* CR_Meroitic_Hieroglyphs */
+
+/* 'Miao': Script */
+static const OnigCodePoint CR_Miao[] = {
+ 3,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+}; /* CR_Miao */
+
+/* 'Sharada': Script */
+static const OnigCodePoint CR_Sharada[] = {
+ 2,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+}; /* CR_Sharada */
+
+/* 'Sora_Sompeng': Script */
+static const OnigCodePoint CR_Sora_Sompeng[] = {
+ 2,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+}; /* CR_Sora_Sompeng */
+
+/* 'Takri': Script */
+static const OnigCodePoint CR_Takri[] = {
+ 2,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+}; /* CR_Takri */
+
/* 'White_Space': Binary Property */
-static const OnigCodePoint CR_White_Space[] = {
- 11,
- 0x0009, 0x000d,
- 0x0020, 0x0020,
- 0x0085, 0x0085,
- 0x00a0, 0x00a0,
- 0x1680, 0x1680,
- 0x180e, 0x180e,
- 0x2000, 0x200a,
- 0x2028, 0x2029,
- 0x202f, 0x202f,
- 0x205f, 0x205f,
- 0x3000, 0x3000,
-}; /* CR_White_Space */
+#define CR_White_Space CR_Space
/* 'Bidi_Control': Binary Property */
static const OnigCodePoint CR_Bidi_Control[] = {
@@ -13563,7 +17214,7 @@ static const OnigCodePoint CR_Join_Control[] = {
/* 'Dash': Binary Property */
static const OnigCodePoint CR_Dash[] = {
- 19,
+ 20,
0x002d, 0x002d,
0x058a, 0x058a,
0x05be, 0x05be,
@@ -13576,6 +17227,7 @@ static const OnigCodePoint CR_Dash[] = {
0x2212, 0x2212,
0x2e17, 0x2e17,
0x2e1a, 0x2e1a,
+ 0x2e3a, 0x2e3b,
0x301c, 0x301c,
0x3030, 0x3030,
0x30a0, 0x30a0,
@@ -13619,7 +17271,7 @@ static const OnigCodePoint CR_Quotation_Mark[] = {
/* 'Terminal_Punctuation': Binary Property */
static const OnigCodePoint CR_Terminal_Punctuation[] = {
- 67,
+ 70,
0x0021, 0x0021,
0x002c, 0x002c,
0x002e, 0x002e,
@@ -13669,6 +17321,7 @@ static const OnigCodePoint CR_Terminal_Punctuation[] = {
0xa9c7, 0xa9c9,
0xaa5d, 0xaa5f,
0xaadf, 0xaadf,
+ 0xaaf0, 0xaaf1,
0xabeb, 0xabeb,
0xfe50, 0xfe52,
0xfe54, 0xfe57,
@@ -13686,12 +17339,14 @@ static const OnigCodePoint CR_Terminal_Punctuation[] = {
0x10b3a, 0x10b3f,
0x11047, 0x1104d,
0x110be, 0x110c1,
+ 0x11141, 0x11143,
+ 0x111c5, 0x111c6,
0x12470, 0x12473,
}; /* CR_Terminal_Punctuation */
/* 'Other_Math': Binary Property */
static const OnigCodePoint CR_Other_Math[] = {
- 100,
+ 133,
0x005e, 0x005e,
0x03d0, 0x03d2,
0x03d5, 0x03d5,
@@ -13792,6 +17447,39 @@ static const OnigCodePoint CR_Other_Math[] = {
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
}; /* CR_Other_Math */
/* 'Hex_Digit': Binary Property */
@@ -13806,16 +17494,11 @@ static const OnigCodePoint CR_Hex_Digit[] = {
}; /* CR_Hex_Digit */
/* 'ASCII_Hex_Digit': Binary Property */
-static const OnigCodePoint CR_ASCII_Hex_Digit[] = {
- 3,
- 0x0030, 0x0039,
- 0x0041, 0x0046,
- 0x0061, 0x0066,
-}; /* CR_ASCII_Hex_Digit */
+#define CR_ASCII_Hex_Digit CR_XDigit
/* 'Other_Alphabetic': Binary Property */
static const OnigCodePoint CR_Other_Alphabetic[] = {
- 145,
+ 158,
0x0345, 0x0345,
0x05b0, 0x05bd,
0x05bf, 0x05bf,
@@ -13837,6 +17520,8 @@ static const OnigCodePoint CR_Other_Alphabetic[] = {
0x081b, 0x0823,
0x0825, 0x0827,
0x0829, 0x082c,
+ 0x08e4, 0x08e9,
+ 0x08f0, 0x08fe,
0x0900, 0x0903,
0x093a, 0x093b,
0x093e, 0x094c,
@@ -13933,11 +17618,14 @@ static const OnigCodePoint CR_Other_Alphabetic[] = {
0x1b35, 0x1b43,
0x1b80, 0x1b82,
0x1ba1, 0x1ba9,
+ 0x1bac, 0x1bad,
0x1be7, 0x1bf1,
0x1c24, 0x1c35,
- 0x1cf2, 0x1cf2,
+ 0x1cf2, 0x1cf3,
0x24b6, 0x24e9,
0x2de0, 0x2dff,
+ 0xa674, 0xa67b,
+ 0xa69f, 0xa69f,
0xa823, 0xa827,
0xa880, 0xa881,
0xa8b4, 0xa8c3,
@@ -13952,6 +17640,8 @@ static const OnigCodePoint CR_Other_Alphabetic[] = {
0xaab2, 0xaab4,
0xaab7, 0xaab8,
0xaabe, 0xaabe,
+ 0xaaeb, 0xaaef,
+ 0xaaf5, 0xaaf5,
0xabe3, 0xabea,
0xfb1e, 0xfb1e,
0x10a01, 0x10a03,
@@ -13961,18 +17651,23 @@ static const OnigCodePoint CR_Other_Alphabetic[] = {
0x11038, 0x11045,
0x11082, 0x11082,
0x110b0, 0x110b8,
+ 0x11100, 0x11102,
+ 0x11127, 0x11132,
+ 0x11180, 0x11182,
+ 0x111b3, 0x111bf,
+ 0x116ab, 0x116b5,
+ 0x16f51, 0x16f7e,
}; /* CR_Other_Alphabetic */
/* 'Ideographic': Binary Property */
static const OnigCodePoint CR_Ideographic[] = {
- 12,
+ 11,
0x3006, 0x3007,
0x3021, 0x3029,
0x3038, 0x303a,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0x4e00, 0x9fcc,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
@@ -13982,7 +17677,7 @@ static const OnigCodePoint CR_Ideographic[] = {
/* 'Diacritic': Binary Property */
static const OnigCodePoint CR_Diacritic[] = {
- 117,
+ 125,
0x005e, 0x005e,
0x0060, 0x0060,
0x00a8, 0x00a8,
@@ -14011,6 +17706,7 @@ static const OnigCodePoint CR_Diacritic[] = {
0x07a6, 0x07b0,
0x07eb, 0x07f5,
0x0818, 0x0819,
+ 0x08e4, 0x08fe,
0x093c, 0x093c,
0x094d, 0x094d,
0x0951, 0x0954,
@@ -14053,11 +17749,12 @@ static const OnigCodePoint CR_Diacritic[] = {
0x1b34, 0x1b34,
0x1b44, 0x1b44,
0x1b6b, 0x1b73,
- 0x1baa, 0x1baa,
+ 0x1baa, 0x1bab,
0x1c36, 0x1c37,
0x1c78, 0x1c7d,
0x1cd0, 0x1ce8,
0x1ced, 0x1ced,
+ 0x1cf4, 0x1cf4,
0x1d2c, 0x1d6a,
0x1dc4, 0x1dcf,
0x1dfd, 0x1dff,
@@ -14078,6 +17775,7 @@ static const OnigCodePoint CR_Diacritic[] = {
0xa6f0, 0xa6f1,
0xa717, 0xa721,
0xa788, 0xa788,
+ 0xa7f8, 0xa7f9,
0xa8c4, 0xa8c4,
0xa8e0, 0xa8f1,
0xa92b, 0xa92e,
@@ -14086,6 +17784,7 @@ static const OnigCodePoint CR_Diacritic[] = {
0xa9c0, 0xa9c0,
0xaa7b, 0xaa7b,
0xaabf, 0xaac2,
+ 0xaaf6, 0xaaf6,
0xabec, 0xabed,
0xfb1e, 0xfb1e,
0xfe20, 0xfe26,
@@ -14095,6 +17794,10 @@ static const OnigCodePoint CR_Diacritic[] = {
0xff9e, 0xff9f,
0xffe3, 0xffe3,
0x110b9, 0x110ba,
+ 0x11133, 0x11134,
+ 0x111c0, 0x111c0,
+ 0x116b6, 0x116b7,
+ 0x16f8f, 0x16f9f,
0x1d167, 0x1d169,
0x1d16d, 0x1d172,
0x1d17b, 0x1d182,
@@ -14104,13 +17807,14 @@ static const OnigCodePoint CR_Diacritic[] = {
/* 'Extender': Binary Property */
static const OnigCodePoint CR_Extender[] = {
- 20,
+ 22,
0x00b7, 0x00b7,
0x02d0, 0x02d1,
0x0640, 0x0640,
0x07fa, 0x07fa,
0x0e46, 0x0e46,
0x0ec6, 0x0ec6,
+ 0x180a, 0x180a,
0x1843, 0x1843,
0x1aa7, 0x1aa7,
0x1c36, 0x1c36,
@@ -14124,25 +17828,31 @@ static const OnigCodePoint CR_Extender[] = {
0xa9cf, 0xa9cf,
0xaa70, 0xaa70,
0xaadd, 0xaadd,
+ 0xaaf3, 0xaaf4,
0xff70, 0xff70,
}; /* CR_Extender */
/* 'Other_Lowercase': Binary Property */
static const OnigCodePoint CR_Other_Lowercase[] = {
- 13,
+ 18,
+ 0x00aa, 0x00aa,
+ 0x00ba, 0x00ba,
0x02b0, 0x02b8,
0x02c0, 0x02c1,
0x02e0, 0x02e4,
0x0345, 0x0345,
0x037a, 0x037a,
- 0x1d2c, 0x1d61,
+ 0x1d2c, 0x1d6a,
0x1d78, 0x1d78,
0x1d9b, 0x1dbf,
- 0x2090, 0x2094,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
0x2170, 0x217f,
0x24d0, 0x24e9,
- 0x2c7d, 0x2c7d,
+ 0x2c7c, 0x2c7d,
0xa770, 0xa770,
+ 0xa7f8, 0xa7f9,
}; /* CR_Other_Lowercase */
/* 'Other_Uppercase': Binary Property */
@@ -14177,7 +17887,7 @@ static const OnigCodePoint CR_Noncharacter_Code_Point[] = {
/* 'Other_Grapheme_Extend': Binary Property */
static const OnigCodePoint CR_Other_Grapheme_Extend[] = {
- 16,
+ 17,
0x09be, 0x09be,
0x09d7, 0x09d7,
0x0b3e, 0x0b3e,
@@ -14191,6 +17901,7 @@ static const OnigCodePoint CR_Other_Grapheme_Extend[] = {
0x0dcf, 0x0dcf,
0x0ddf, 0x0ddf,
0x200c, 0x200d,
+ 0x302e, 0x302f,
0xff9e, 0xff9f,
0x1d165, 0x1d165,
0x1d16e, 0x1d172,
@@ -14221,7 +17932,7 @@ static const OnigCodePoint CR_Radical[] = {
static const OnigCodePoint CR_Unified_Ideograph[] = {
12,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xfa0e, 0xfa0f,
0xfa11, 0xfa11,
0xfa13, 0xfa14,
@@ -14236,9 +17947,10 @@ static const OnigCodePoint CR_Unified_Ideograph[] = {
/* 'Other_Default_Ignorable_Code_Point': Binary Property */
static const OnigCodePoint CR_Other_Default_Ignorable_Code_Point[] = {
- 10,
+ 11,
0x034f, 0x034f,
0x115f, 0x1160,
+ 0x17b4, 0x17b5,
0x2065, 0x2069,
0x3164, 0x3164,
0xffa0, 0xffa0,
@@ -14328,7 +18040,7 @@ static const OnigCodePoint CR_Other_ID_Continue[] = {
/* 'STerm': Binary Property */
static const OnigCodePoint CR_STerm[] = {
- 47,
+ 50,
0x0021, 0x0021,
0x002e, 0x002e,
0x003f, 0x003f,
@@ -14366,6 +18078,7 @@ static const OnigCodePoint CR_STerm[] = {
0xa92f, 0xa92f,
0xa9c8, 0xa9c9,
0xaa5d, 0xaa5f,
+ 0xaaf0, 0xaaf1,
0xabeb, 0xabeb,
0xfe52, 0xfe52,
0xfe56, 0xfe57,
@@ -14376,6 +18089,8 @@ static const OnigCodePoint CR_STerm[] = {
0x10a56, 0x10a57,
0x11047, 0x11048,
0x110be, 0x110c1,
+ 0x11141, 0x11143,
+ 0x111c5, 0x111c6,
}; /* CR_STerm */
/* 'Variation_Selector': Binary Property */
@@ -14431,7 +18146,7 @@ static const OnigCodePoint CR_Pattern_Syntax[] = {
/* 'Unknown': Script */
static const OnigCodePoint CR_Unknown[] = {
- 499,
+ 537,
0x0378, 0x0379,
0x037f, 0x0383,
0x038b, 0x038b,
@@ -14441,11 +18156,12 @@ static const OnigCodePoint CR_Unknown[] = {
0x0557, 0x0558,
0x0560, 0x0560,
0x0588, 0x0588,
- 0x058b, 0x0590,
+ 0x058b, 0x058e,
+ 0x0590, 0x0590,
0x05c8, 0x05cf,
0x05eb, 0x05ef,
0x05f5, 0x05ff,
- 0x0604, 0x0605,
+ 0x0605, 0x0605,
0x061c, 0x061d,
0x070e, 0x070e,
0x074b, 0x074c,
@@ -14454,7 +18170,10 @@ static const OnigCodePoint CR_Unknown[] = {
0x082e, 0x082f,
0x083f, 0x083f,
0x085c, 0x085d,
- 0x085f, 0x08ff,
+ 0x085f, 0x089f,
+ 0x08a1, 0x08a1,
+ 0x08ad, 0x08e3,
+ 0x08ff, 0x08ff,
0x0978, 0x0978,
0x0980, 0x0980,
0x0984, 0x0984,
@@ -14499,7 +18218,6 @@ static const OnigCodePoint CR_Unknown[] = {
0x0ace, 0x0acf,
0x0ad1, 0x0adf,
0x0ae4, 0x0ae5,
- 0x0af0, 0x0af0,
0x0af2, 0x0b00,
0x0b04, 0x0b04,
0x0b0d, 0x0b0e,
@@ -14600,15 +18318,16 @@ static const OnigCodePoint CR_Unknown[] = {
0x0ec7, 0x0ec7,
0x0ece, 0x0ecf,
0x0eda, 0x0edb,
- 0x0ede, 0x0eff,
+ 0x0ee0, 0x0eff,
0x0f48, 0x0f48,
0x0f6d, 0x0f70,
0x0f98, 0x0f98,
0x0fbd, 0x0fbd,
0x0fcd, 0x0fcd,
0x0fdb, 0x0fff,
- 0x10c6, 0x10cf,
- 0x10fd, 0x10ff,
+ 0x10c6, 0x10c6,
+ 0x10c8, 0x10cc,
+ 0x10ce, 0x10cf,
0x1249, 0x1249,
0x124e, 0x124f,
0x1257, 0x1257,
@@ -14662,13 +18381,12 @@ static const OnigCodePoint CR_Unknown[] = {
0x1aae, 0x1aff,
0x1b4c, 0x1b4f,
0x1b7d, 0x1b7f,
- 0x1bab, 0x1bad,
- 0x1bba, 0x1bbf,
0x1bf4, 0x1bfb,
0x1c38, 0x1c3a,
0x1c4a, 0x1c4c,
- 0x1c80, 0x1ccf,
- 0x1cf3, 0x1cff,
+ 0x1c80, 0x1cbf,
+ 0x1cc8, 0x1ccf,
+ 0x1cf7, 0x1cff,
0x1de7, 0x1dfb,
0x1f16, 0x1f17,
0x1f1e, 0x1f1f,
@@ -14697,15 +18415,15 @@ static const OnigCodePoint CR_Unknown[] = {
0x2427, 0x243f,
0x244b, 0x245f,
0x2700, 0x2700,
- 0x27cb, 0x27cb,
- 0x27cd, 0x27cd,
0x2b4d, 0x2b4f,
0x2b5a, 0x2bff,
0x2c2f, 0x2c2f,
0x2c5f, 0x2c5f,
- 0x2cf2, 0x2cf8,
- 0x2d26, 0x2d2f,
- 0x2d66, 0x2d6e,
+ 0x2cf4, 0x2cf8,
+ 0x2d26, 0x2d26,
+ 0x2d28, 0x2d2c,
+ 0x2d2e, 0x2d2f,
+ 0x2d68, 0x2d6e,
0x2d71, 0x2d7e,
0x2d97, 0x2d9f,
0x2da7, 0x2da7,
@@ -14716,7 +18434,7 @@ static const OnigCodePoint CR_Unknown[] = {
0x2dcf, 0x2dcf,
0x2dd7, 0x2dd7,
0x2ddf, 0x2ddf,
- 0x2e32, 0x2e7f,
+ 0x2e3c, 0x2e7f,
0x2e9a, 0x2e9a,
0x2ef4, 0x2eff,
0x2fd6, 0x2fef,
@@ -14731,16 +18449,15 @@ static const OnigCodePoint CR_Unknown[] = {
0x321f, 0x321f,
0x32ff, 0x32ff,
0x4db6, 0x4dbf,
- 0x9fcc, 0x9fff,
+ 0x9fcd, 0x9fff,
0xa48d, 0xa48f,
0xa4c7, 0xa4cf,
0xa62c, 0xa63f,
- 0xa674, 0xa67b,
- 0xa698, 0xa69f,
+ 0xa698, 0xa69e,
0xa6f8, 0xa6ff,
0xa78f, 0xa78f,
- 0xa792, 0xa79f,
- 0xa7aa, 0xa7f9,
+ 0xa794, 0xa79f,
+ 0xa7ab, 0xa7f7,
0xa82c, 0xa82f,
0xa83a, 0xa83f,
0xa878, 0xa87f,
@@ -14757,7 +18474,7 @@ static const OnigCodePoint CR_Unknown[] = {
0xaa5a, 0xaa5b,
0xaa7c, 0xaa7f,
0xaac3, 0xaada,
- 0xaae0, 0xab00,
+ 0xaaf7, 0xab00,
0xab07, 0xab08,
0xab0f, 0xab10,
0xab17, 0xab1f,
@@ -14768,7 +18485,6 @@ static const OnigCodePoint CR_Unknown[] = {
0xd7a4, 0xd7af,
0xd7c7, 0xd7ca,
0xd7fc, 0xf8ff,
- 0xfa2e, 0xfa2f,
0xfa6e, 0xfa6f,
0xfada, 0xfaff,
0xfb07, 0xfb12,
@@ -14830,7 +18546,9 @@ static const OnigCodePoint CR_Unknown[] = {
0x10860, 0x108ff,
0x1091c, 0x1091e,
0x1093a, 0x1093e,
- 0x10940, 0x109ff,
+ 0x10940, 0x1097f,
+ 0x109b8, 0x109bd,
+ 0x109c0, 0x109ff,
0x10a04, 0x10a04,
0x10a07, 0x10a0b,
0x10a14, 0x10a14,
@@ -14848,12 +18566,23 @@ static const OnigCodePoint CR_Unknown[] = {
0x10e7f, 0x10fff,
0x1104e, 0x11051,
0x11070, 0x1107f,
- 0x110c2, 0x11fff,
+ 0x110c2, 0x110cf,
+ 0x110e9, 0x110ef,
+ 0x110fa, 0x110ff,
+ 0x11135, 0x11135,
+ 0x11144, 0x1117f,
+ 0x111c9, 0x111cf,
+ 0x111da, 0x1167f,
+ 0x116b8, 0x116bf,
+ 0x116ca, 0x11fff,
0x1236f, 0x123ff,
0x12463, 0x1246f,
0x12474, 0x12fff,
0x1342f, 0x167ff,
- 0x16a39, 0x1afff,
+ 0x16a39, 0x16eff,
+ 0x16f45, 0x16f4f,
+ 0x16f7f, 0x16f8e,
+ 0x16fa0, 0x1afff,
0x1b002, 0x1cfff,
0x1d0f6, 0x1d0ff,
0x1d127, 0x1d128,
@@ -14881,7 +18610,41 @@ static const OnigCodePoint CR_Unknown[] = {
0x1d551, 0x1d551,
0x1d6a6, 0x1d6a7,
0x1d7cc, 0x1d7cd,
- 0x1d800, 0x1efff,
+ 0x1d800, 0x1edff,
+ 0x1ee04, 0x1ee04,
+ 0x1ee20, 0x1ee20,
+ 0x1ee23, 0x1ee23,
+ 0x1ee25, 0x1ee26,
+ 0x1ee28, 0x1ee28,
+ 0x1ee33, 0x1ee33,
+ 0x1ee38, 0x1ee38,
+ 0x1ee3a, 0x1ee3a,
+ 0x1ee3c, 0x1ee41,
+ 0x1ee43, 0x1ee46,
+ 0x1ee48, 0x1ee48,
+ 0x1ee4a, 0x1ee4a,
+ 0x1ee4c, 0x1ee4c,
+ 0x1ee50, 0x1ee50,
+ 0x1ee53, 0x1ee53,
+ 0x1ee55, 0x1ee56,
+ 0x1ee58, 0x1ee58,
+ 0x1ee5a, 0x1ee5a,
+ 0x1ee5c, 0x1ee5c,
+ 0x1ee5e, 0x1ee5e,
+ 0x1ee60, 0x1ee60,
+ 0x1ee63, 0x1ee63,
+ 0x1ee65, 0x1ee66,
+ 0x1ee6b, 0x1ee6b,
+ 0x1ee73, 0x1ee73,
+ 0x1ee78, 0x1ee78,
+ 0x1ee7d, 0x1ee7d,
+ 0x1ee7f, 0x1ee7f,
+ 0x1ee8a, 0x1ee8a,
+ 0x1ee9c, 0x1eea0,
+ 0x1eea4, 0x1eea4,
+ 0x1eeaa, 0x1eeaa,
+ 0x1eebc, 0x1eeef,
+ 0x1eef2, 0x1efff,
0x1f02c, 0x1f02f,
0x1f094, 0x1f09f,
0x1f0af, 0x1f0b0,
@@ -14890,7 +18653,7 @@ static const OnigCodePoint CR_Unknown[] = {
0x1f0e0, 0x1f0ff,
0x1f10b, 0x1f10f,
0x1f12f, 0x1f12f,
- 0x1f16a, 0x1f16f,
+ 0x1f16c, 0x1f16f,
0x1f19b, 0x1f1e5,
0x1f203, 0x1f20f,
0x1f23b, 0x1f23f,
@@ -14907,19 +18670,9 @@ static const OnigCodePoint CR_Unknown[] = {
0x1f441, 0x1f441,
0x1f4f8, 0x1f4f8,
0x1f4fd, 0x1f4ff,
- 0x1f53e, 0x1f54f,
+ 0x1f53e, 0x1f53f,
+ 0x1f544, 0x1f54f,
0x1f568, 0x1f5fa,
- 0x1f600, 0x1f600,
- 0x1f611, 0x1f611,
- 0x1f615, 0x1f615,
- 0x1f617, 0x1f617,
- 0x1f619, 0x1f619,
- 0x1f61b, 0x1f61b,
- 0x1f61f, 0x1f61f,
- 0x1f626, 0x1f627,
- 0x1f62c, 0x1f62c,
- 0x1f62e, 0x1f62f,
- 0x1f634, 0x1f634,
0x1f641, 0x1f644,
0x1f650, 0x1f67f,
0x1f6c6, 0x1f6ff,
@@ -14932,7 +18685,6 @@ static const OnigCodePoint CR_Unknown[] = {
0xe0080, 0xe00ff,
0xe01f0, 0x10ffff,
}; /* CR_Unknown */
-#endif /* USE_UNICODE_PROPERTIES */
/* 'Age_1_1': Derived Age 1.1 */
static const OnigCodePoint CR_Age_1_1[] = {
@@ -19817,554 +23569,10 @@ static const OnigCodePoint CR_Age_6_0[] = {
0xefffe, 0x10ffff,
}; /* CR_Age_6_0 */
-/* 'NEWLINE': [[:NEWLINE:]] */
-static const OnigCodePoint CR_NEWLINE[] = {
- 1,
- 0x000a, 0x000a,
-}; /* CR_NEWLINE */
-
-/* 'Alpha': [[:Alpha:]] */
-#define CR_Alpha CR_Alphabetic
-
-/* 'Blank': [[:Blank:]] */
-static const OnigCodePoint CR_Blank[] = {
- 9,
- 0x0009, 0x0009,
- 0x0020, 0x0020,
- 0x00a0, 0x00a0,
- 0x1680, 0x1680,
- 0x180e, 0x180e,
- 0x2000, 0x200a,
- 0x202f, 0x202f,
- 0x205f, 0x205f,
- 0x3000, 0x3000,
-}; /* CR_Blank */
-
-/* 'Cntrl': [[:Cntrl:]] */
-#define CR_Cntrl CR_Cc
-
-/* 'Digit': [[:Digit:]] */
-#define CR_Digit CR_Nd
-
-/* 'Graph': [[:Graph:]] */
-static const OnigCodePoint CR_Graph[] = {
- 506,
- 0x0021, 0x007e,
- 0x00a1, 0x0377,
- 0x037a, 0x037e,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x0527,
- 0x0531, 0x0556,
- 0x0559, 0x055f,
- 0x0561, 0x0587,
- 0x0589, 0x058a,
- 0x0591, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f4,
- 0x0600, 0x0603,
- 0x0606, 0x061b,
- 0x061e, 0x070d,
- 0x070f, 0x074a,
- 0x074d, 0x07b1,
- 0x07c0, 0x07fa,
- 0x0800, 0x082d,
- 0x0830, 0x083e,
- 0x0840, 0x085b,
- 0x085e, 0x085e,
- 0x0900, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bc, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09ce,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09e6, 0x09fb,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3c, 0x0a3c,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a51, 0x0a51,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a75,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abc, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acd,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0af1, 0x0af1,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3c, 0x0b44,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4d,
- 0x0b56, 0x0b57,
- 0x0b5c, 0x0b5d,
- 0x0b5f, 0x0b63,
- 0x0b66, 0x0b77,
- 0x0b82, 0x0b83,
- 0x0b85, 0x0b8a,
- 0x0b8e, 0x0b90,
- 0x0b92, 0x0b95,
- 0x0b99, 0x0b9a,
- 0x0b9c, 0x0b9c,
- 0x0b9e, 0x0b9f,
- 0x0ba3, 0x0ba4,
- 0x0ba8, 0x0baa,
- 0x0bae, 0x0bb9,
- 0x0bbe, 0x0bc2,
- 0x0bc6, 0x0bc8,
- 0x0bca, 0x0bcd,
- 0x0bd0, 0x0bd0,
- 0x0bd7, 0x0bd7,
- 0x0be6, 0x0bfa,
- 0x0c01, 0x0c03,
- 0x0c05, 0x0c0c,
- 0x0c0e, 0x0c10,
- 0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
- 0x0c3d, 0x0c44,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4d,
- 0x0c55, 0x0c56,
- 0x0c58, 0x0c59,
- 0x0c60, 0x0c63,
- 0x0c66, 0x0c6f,
- 0x0c78, 0x0c7f,
- 0x0c82, 0x0c83,
- 0x0c85, 0x0c8c,
- 0x0c8e, 0x0c90,
- 0x0c92, 0x0ca8,
- 0x0caa, 0x0cb3,
- 0x0cb5, 0x0cb9,
- 0x0cbc, 0x0cc4,
- 0x0cc6, 0x0cc8,
- 0x0cca, 0x0ccd,
- 0x0cd5, 0x0cd6,
- 0x0cde, 0x0cde,
- 0x0ce0, 0x0ce3,
- 0x0ce6, 0x0cef,
- 0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d3a,
- 0x0d3d, 0x0d44,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4e,
- 0x0d57, 0x0d57,
- 0x0d60, 0x0d63,
- 0x0d66, 0x0d75,
- 0x0d79, 0x0d7f,
- 0x0d82, 0x0d83,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0dca, 0x0dca,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df4,
- 0x0e01, 0x0e3a,
- 0x0e3f, 0x0e5b,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ec8, 0x0ecd,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f71, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fbe, 0x0fcc,
- 0x0fce, 0x0fda,
- 0x1000, 0x10c5,
- 0x10d0, 0x10fc,
- 0x1100, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135d, 0x137c,
- 0x1380, 0x1399,
- 0x13a0, 0x13f4,
- 0x1400, 0x167f,
- 0x1681, 0x169c,
- 0x16a0, 0x16f0,
- 0x1700, 0x170c,
- 0x170e, 0x1714,
- 0x1720, 0x1736,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17dd,
- 0x17e0, 0x17e9,
- 0x17f0, 0x17f9,
- 0x1800, 0x180d,
- 0x1810, 0x1819,
- 0x1820, 0x1877,
- 0x1880, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191c,
- 0x1920, 0x192b,
- 0x1930, 0x193b,
- 0x1940, 0x1940,
- 0x1944, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x19d0, 0x19da,
- 0x19de, 0x1a1b,
- 0x1a1e, 0x1a5e,
- 0x1a60, 0x1a7c,
- 0x1a7f, 0x1a89,
- 0x1a90, 0x1a99,
- 0x1aa0, 0x1aad,
- 0x1b00, 0x1b4b,
- 0x1b50, 0x1b7c,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1bf3,
- 0x1bfc, 0x1c37,
- 0x1c3b, 0x1c49,
- 0x1c4d, 0x1c7f,
- 0x1cd0, 0x1cf2,
- 0x1d00, 0x1de6,
- 0x1dfc, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fc4,
- 0x1fc6, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fdd, 0x1fef,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffe,
- 0x200b, 0x2027,
- 0x202a, 0x202e,
- 0x2030, 0x205e,
- 0x2060, 0x2064,
- 0x206a, 0x2071,
- 0x2074, 0x208e,
- 0x2090, 0x209c,
- 0x20a0, 0x20b9,
- 0x20d0, 0x20f0,
- 0x2100, 0x2189,
- 0x2190, 0x23f3,
- 0x2400, 0x2426,
- 0x2440, 0x244a,
- 0x2460, 0x26ff,
- 0x2701, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x2b4c,
- 0x2b50, 0x2b59,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2cf1,
- 0x2cf9, 0x2d25,
- 0x2d30, 0x2d65,
- 0x2d6f, 0x2d70,
- 0x2d7f, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2de0, 0x2e31,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3001, 0x303f,
- 0x3041, 0x3096,
- 0x3099, 0x30ff,
- 0x3105, 0x312d,
- 0x3131, 0x318e,
- 0x3190, 0x31ba,
- 0x31c0, 0x31e3,
- 0x31f0, 0x321e,
- 0x3220, 0x32fe,
- 0x3300, 0x4db5,
- 0x4dc0, 0x9fcb,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa4d0, 0xa62b,
- 0xa640, 0xa673,
- 0xa67c, 0xa697,
- 0xa6a0, 0xa6f7,
- 0xa700, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa82b,
- 0xa830, 0xa839,
- 0xa840, 0xa877,
- 0xa880, 0xa8c4,
- 0xa8ce, 0xa8d9,
- 0xa8e0, 0xa8fb,
- 0xa900, 0xa953,
- 0xa95f, 0xa97c,
- 0xa980, 0xa9cd,
- 0xa9cf, 0xa9d9,
- 0xa9de, 0xa9df,
- 0xaa00, 0xaa36,
- 0xaa40, 0xaa4d,
- 0xaa50, 0xaa59,
- 0xaa5c, 0xaa7b,
- 0xaa80, 0xaac2,
- 0xaadb, 0xaadf,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xabc0, 0xabed,
- 0xabf0, 0xabf9,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xe000, 0xfa2d,
- 0xfa30, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbc1,
- 0xfbd3, 0xfd3f,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfd,
- 0xfe00, 0xfe19,
- 0xfe20, 0xfe26,
- 0xfe30, 0xfe52,
- 0xfe54, 0xfe66,
- 0xfe68, 0xfe6b,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xfeff, 0xfeff,
- 0xff01, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0xffe0, 0xffe6,
- 0xffe8, 0xffee,
- 0xfff9, 0xfffd,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10100, 0x10102,
- 0x10107, 0x10133,
- 0x10137, 0x1018a,
- 0x10190, 0x1019b,
- 0x101d0, 0x101fd,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x10300, 0x1031e,
- 0x10320, 0x10323,
- 0x10330, 0x1034a,
- 0x10380, 0x1039d,
- 0x1039f, 0x103c3,
- 0x103c8, 0x103d5,
- 0x10400, 0x1049d,
- 0x104a0, 0x104a9,
- 0x10800, 0x10805,
- 0x10808, 0x10808,
- 0x1080a, 0x10835,
- 0x10837, 0x10838,
- 0x1083c, 0x1083c,
- 0x1083f, 0x10855,
- 0x10857, 0x1085f,
- 0x10900, 0x1091b,
- 0x1091f, 0x10939,
- 0x1093f, 0x1093f,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a47,
- 0x10a50, 0x10a58,
- 0x10a60, 0x10a7f,
- 0x10b00, 0x10b35,
- 0x10b39, 0x10b55,
- 0x10b58, 0x10b72,
- 0x10b78, 0x10b7f,
- 0x10c00, 0x10c48,
- 0x10e60, 0x10e7e,
- 0x11000, 0x1104d,
- 0x11052, 0x1106f,
- 0x11080, 0x110c1,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x12470, 0x12473,
- 0x13000, 0x1342e,
- 0x16800, 0x16a38,
- 0x1b000, 0x1b001,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d129, 0x1d1dd,
- 0x1d200, 0x1d245,
- 0x1d300, 0x1d356,
- 0x1d360, 0x1d371,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d7cb,
- 0x1d7ce, 0x1d7ff,
- 0x1f000, 0x1f02b,
- 0x1f030, 0x1f093,
- 0x1f0a0, 0x1f0ae,
- 0x1f0b1, 0x1f0be,
- 0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0df,
- 0x1f100, 0x1f10a,
- 0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
- 0x1f170, 0x1f19a,
- 0x1f1e6, 0x1f202,
- 0x1f210, 0x1f23a,
- 0x1f240, 0x1f248,
- 0x1f250, 0x1f251,
- 0x1f300, 0x1f320,
- 0x1f330, 0x1f335,
- 0x1f337, 0x1f37c,
- 0x1f380, 0x1f393,
- 0x1f3a0, 0x1f3c4,
- 0x1f3c6, 0x1f3ca,
- 0x1f3e0, 0x1f3f0,
- 0x1f400, 0x1f43e,
- 0x1f440, 0x1f440,
- 0x1f442, 0x1f4f7,
- 0x1f4f9, 0x1f4fc,
- 0x1f500, 0x1f53d,
- 0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
- 0x1f645, 0x1f64f,
- 0x1f680, 0x1f6c5,
- 0x1f700, 0x1f773,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2f800, 0x2fa1d,
- 0xe0001, 0xe0001,
- 0xe0020, 0xe007f,
- 0xe0100, 0xe01ef,
- 0xf0000, 0xffffd,
- 0x100000, 0x10fffd,
-}; /* CR_Graph */
-
-/* 'Lower': [[:Lower:]] */
-#define CR_Lower CR_Lowercase
-
-/* 'Print': [[:Print:]] */
-static const OnigCodePoint CR_Print[] = {
- 503,
- 0x0020, 0x007e,
- 0x00a0, 0x0377,
+/* 'Age_6_1': Derived Age 6.1 */
+static const OnigCodePoint CR_Age_6_1[] = {
+ 549,
+ 0x0000, 0x0377,
0x037a, 0x037e,
0x0384, 0x038a,
0x038c, 0x038c,
@@ -20374,10 +23582,11 @@ static const OnigCodePoint CR_Print[] = {
0x0559, 0x055f,
0x0561, 0x0587,
0x0589, 0x058a,
+ 0x058f, 0x058f,
0x0591, 0x05c7,
0x05d0, 0x05ea,
0x05f0, 0x05f4,
- 0x0600, 0x0603,
+ 0x0600, 0x0604,
0x0606, 0x061b,
0x061e, 0x070d,
0x070f, 0x074a,
@@ -20387,6 +23596,9 @@ static const OnigCodePoint CR_Print[] = {
0x0830, 0x083e,
0x0840, 0x085b,
0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
0x0900, 0x0977,
0x0979, 0x097f,
0x0981, 0x0983,
@@ -20431,8 +23643,7 @@ static const OnigCodePoint CR_Print[] = {
0x0acb, 0x0acd,
0x0ad0, 0x0ad0,
0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0af1, 0x0af1,
+ 0x0ae6, 0x0af1,
0x0b01, 0x0b03,
0x0b05, 0x0b0c,
0x0b0f, 0x0b10,
@@ -20532,7 +23743,7 @@ static const OnigCodePoint CR_Print[] = {
0x0ec6, 0x0ec6,
0x0ec8, 0x0ecd,
0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f00, 0x0f47,
0x0f49, 0x0f6c,
0x0f71, 0x0f97,
@@ -20540,8 +23751,9 @@ static const OnigCodePoint CR_Print[] = {
0x0fbe, 0x0fcc,
0x0fce, 0x0fda,
0x1000, 0x10c5,
- 0x10d0, 0x10fc,
- 0x1100, 0x1248,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x1258, 0x1258,
@@ -20594,13 +23806,12 @@ static const OnigCodePoint CR_Print[] = {
0x1aa0, 0x1aad,
0x1b00, 0x1b4b,
0x1b50, 0x1b7c,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1bf3,
+ 0x1b80, 0x1bf3,
0x1bfc, 0x1c37,
0x1c3b, 0x1c49,
0x1c4d, 0x1c7f,
- 0x1cd0, 0x1cf2,
+ 0x1cc0, 0x1cc7,
+ 0x1cd0, 0x1cf6,
0x1d00, 0x1de6,
0x1dfc, 0x1f15,
0x1f18, 0x1f1d,
@@ -20618,8 +23829,7 @@ static const OnigCodePoint CR_Print[] = {
0x1fdd, 0x1fef,
0x1ff2, 0x1ff4,
0x1ff6, 0x1ffe,
- 0x2000, 0x2027,
- 0x202a, 0x2064,
+ 0x2000, 0x2064,
0x206a, 0x2071,
0x2074, 0x208e,
0x2090, 0x209c,
@@ -20630,15 +23840,15 @@ static const OnigCodePoint CR_Print[] = {
0x2400, 0x2426,
0x2440, 0x244a,
0x2460, 0x26ff,
- 0x2701, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x2b4c,
+ 0x2701, 0x2b4c,
0x2b50, 0x2b59,
0x2c00, 0x2c2e,
0x2c30, 0x2c5e,
- 0x2c60, 0x2cf1,
+ 0x2c60, 0x2cf3,
0x2cf9, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
0x2d6f, 0x2d70,
0x2d7f, 0x2d96,
0x2da0, 0x2da6,
@@ -20649,7 +23859,7 @@ static const OnigCodePoint CR_Print[] = {
0x2dc8, 0x2dce,
0x2dd0, 0x2dd6,
0x2dd8, 0x2dde,
- 0x2de0, 0x2e31,
+ 0x2de0, 0x2e3b,
0x2e80, 0x2e99,
0x2e9b, 0x2ef3,
0x2f00, 0x2fd5,
@@ -20664,17 +23874,16 @@ static const OnigCodePoint CR_Print[] = {
0x31f0, 0x321e,
0x3220, 0x32fe,
0x3300, 0x4db5,
- 0x4dc0, 0x9fcb,
+ 0x4dc0, 0x9fcc,
0xa000, 0xa48c,
0xa490, 0xa4c6,
0xa4d0, 0xa62b,
- 0xa640, 0xa673,
- 0xa67c, 0xa697,
- 0xa6a0, 0xa6f7,
+ 0xa640, 0xa697,
+ 0xa69f, 0xa6f7,
0xa700, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa82b,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa82b,
0xa830, 0xa839,
0xa840, 0xa877,
0xa880, 0xa8c4,
@@ -20690,7 +23899,7 @@ static const OnigCodePoint CR_Print[] = {
0xaa50, 0xaa59,
0xaa5c, 0xaa7b,
0xaa80, 0xaac2,
- 0xaadb, 0xaadf,
+ 0xaadb, 0xaaf6,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -20701,8 +23910,7 @@ static const OnigCodePoint CR_Print[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xe000, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xd800, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -20715,7 +23923,7 @@ static const OnigCodePoint CR_Print[] = {
0xfbd3, 0xfd3f,
0xfd50, 0xfd8f,
0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfd,
+ 0xfdd0, 0xfdfd,
0xfe00, 0xfe19,
0xfe20, 0xfe26,
0xfe30, 0xfe52,
@@ -20731,8 +23939,7 @@ static const OnigCodePoint CR_Print[] = {
0xffda, 0xffdc,
0xffe0, 0xffe6,
0xffe8, 0xffee,
- 0xfff9, 0xfffd,
- 0x10000, 0x1000b,
+ 0xfff9, 0x1000b,
0x1000d, 0x10026,
0x10028, 0x1003a,
0x1003c, 0x1003d,
@@ -20764,6 +23971,8 @@ static const OnigCodePoint CR_Print[] = {
0x10900, 0x1091b,
0x1091f, 0x10939,
0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a00, 0x10a03,
0x10a05, 0x10a06,
0x10a0c, 0x10a13,
@@ -20782,11 +23991,22 @@ static const OnigCodePoint CR_Print[] = {
0x11000, 0x1104d,
0x11052, 0x1106f,
0x11080, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
0x12000, 0x1236e,
0x12400, 0x12462,
0x12470, 0x12473,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
0x1b000, 0x1b001,
0x1d000, 0x1d0f5,
0x1d100, 0x1d126,
@@ -20815,6 +24035,40 @@ static const OnigCodePoint CR_Print[] = {
0x1d552, 0x1d6a5,
0x1d6a8, 0x1d7cb,
0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
0x1f000, 0x1f02b,
0x1f030, 0x1f093,
0x1f0a0, 0x1f0ae,
@@ -20823,7 +24077,7 @@ static const OnigCodePoint CR_Print[] = {
0x1f0d1, 0x1f0df,
0x1f100, 0x1f10a,
0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
+ 0x1f130, 0x1f16b,
0x1f170, 0x1f19a,
0x1f1e6, 0x1f202,
0x1f210, 0x1f23a,
@@ -20841,1083 +24095,1368 @@ static const OnigCodePoint CR_Print[] = {
0x1f442, 0x1f4f7,
0x1f4f9, 0x1f4fc,
0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
+ 0x1f5fb, 0x1f640,
0x1f645, 0x1f64f,
0x1f680, 0x1f6c5,
0x1f700, 0x1f773,
- 0x20000, 0x2a6d6,
+ 0x1fffe, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
0x2f800, 0x2fa1d,
+ 0x2fffe, 0x2ffff,
+ 0x3fffe, 0x3ffff,
+ 0x4fffe, 0x4ffff,
+ 0x5fffe, 0x5ffff,
+ 0x6fffe, 0x6ffff,
+ 0x7fffe, 0x7ffff,
+ 0x8fffe, 0x8ffff,
+ 0x9fffe, 0x9ffff,
+ 0xafffe, 0xaffff,
+ 0xbfffe, 0xbffff,
+ 0xcfffe, 0xcffff,
+ 0xdfffe, 0xdffff,
0xe0001, 0xe0001,
0xe0020, 0xe007f,
0xe0100, 0xe01ef,
- 0xf0000, 0xffffd,
- 0x100000, 0x10fffd,
-}; /* CR_Print */
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_6_1 */
-/* 'Punct': [[:Punct:]] */
-#define CR_Punct CR_P
+/* 'In_Basic_Latin': Block */
+#define CR_In_Basic_Latin CR_ASCII
-/* 'Space': [[:Space:]] */
-#define CR_Space CR_White_Space
+/* 'In_Latin_1_Supplement': Block */
+static const OnigCodePoint CR_In_Latin_1_Supplement[] = {
+ 1,
+ 0x0080, 0x00ff,
+}; /* CR_In_Latin_1_Supplement */
-/* 'Upper': [[:Upper:]] */
-#define CR_Upper CR_Uppercase
+/* 'In_Latin_Extended_A': Block */
+static const OnigCodePoint CR_In_Latin_Extended_A[] = {
+ 1,
+ 0x0100, 0x017f,
+}; /* CR_In_Latin_Extended_A */
-/* 'XDigit': [[:XDigit:]] */
-#define CR_XDigit CR_ASCII_Hex_Digit
+/* 'In_Latin_Extended_B': Block */
+static const OnigCodePoint CR_In_Latin_Extended_B[] = {
+ 1,
+ 0x0180, 0x024f,
+}; /* CR_In_Latin_Extended_B */
-/* 'Word': [[:Word:]] */
-static const OnigCodePoint CR_Word[] = {
- 514,
- 0x0030, 0x0039,
- 0x0041, 0x005a,
- 0x005f, 0x005f,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x02c1,
- 0x02c6, 0x02d1,
- 0x02e0, 0x02e4,
- 0x02ec, 0x02ec,
- 0x02ee, 0x02ee,
- 0x0300, 0x0374,
- 0x0376, 0x0377,
- 0x037a, 0x037d,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03f5,
- 0x03f7, 0x0481,
- 0x0483, 0x0527,
- 0x0531, 0x0556,
- 0x0559, 0x0559,
- 0x0561, 0x0587,
- 0x0591, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f2,
- 0x0610, 0x061a,
- 0x0620, 0x0669,
- 0x066e, 0x06d3,
- 0x06d5, 0x06dc,
- 0x06df, 0x06e8,
- 0x06ea, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x074a,
- 0x074d, 0x07b1,
- 0x07c0, 0x07f5,
- 0x07fa, 0x07fa,
- 0x0800, 0x082d,
- 0x0840, 0x085b,
- 0x0900, 0x0963,
- 0x0966, 0x096f,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bc, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09ce,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09e6, 0x09f1,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3c, 0x0a3c,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a51, 0x0a51,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a75,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abc, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acd,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3c, 0x0b44,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4d,
- 0x0b56, 0x0b57,
- 0x0b5c, 0x0b5d,
- 0x0b5f, 0x0b63,
- 0x0b66, 0x0b6f,
- 0x0b71, 0x0b71,
- 0x0b82, 0x0b83,
- 0x0b85, 0x0b8a,
- 0x0b8e, 0x0b90,
- 0x0b92, 0x0b95,
- 0x0b99, 0x0b9a,
- 0x0b9c, 0x0b9c,
- 0x0b9e, 0x0b9f,
- 0x0ba3, 0x0ba4,
- 0x0ba8, 0x0baa,
- 0x0bae, 0x0bb9,
- 0x0bbe, 0x0bc2,
- 0x0bc6, 0x0bc8,
- 0x0bca, 0x0bcd,
- 0x0bd0, 0x0bd0,
- 0x0bd7, 0x0bd7,
- 0x0be6, 0x0bef,
- 0x0c01, 0x0c03,
- 0x0c05, 0x0c0c,
- 0x0c0e, 0x0c10,
- 0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
- 0x0c3d, 0x0c44,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4d,
- 0x0c55, 0x0c56,
- 0x0c58, 0x0c59,
- 0x0c60, 0x0c63,
- 0x0c66, 0x0c6f,
- 0x0c82, 0x0c83,
- 0x0c85, 0x0c8c,
- 0x0c8e, 0x0c90,
- 0x0c92, 0x0ca8,
- 0x0caa, 0x0cb3,
- 0x0cb5, 0x0cb9,
- 0x0cbc, 0x0cc4,
- 0x0cc6, 0x0cc8,
- 0x0cca, 0x0ccd,
- 0x0cd5, 0x0cd6,
- 0x0cde, 0x0cde,
- 0x0ce0, 0x0ce3,
- 0x0ce6, 0x0cef,
- 0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d3a,
- 0x0d3d, 0x0d44,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4e,
- 0x0d57, 0x0d57,
- 0x0d60, 0x0d63,
- 0x0d66, 0x0d6f,
- 0x0d7a, 0x0d7f,
- 0x0d82, 0x0d83,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0dca, 0x0dca,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df3,
- 0x0e01, 0x0e3a,
- 0x0e40, 0x0e4e,
- 0x0e50, 0x0e59,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ec8, 0x0ecd,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f00,
- 0x0f18, 0x0f19,
- 0x0f20, 0x0f29,
- 0x0f35, 0x0f35,
- 0x0f37, 0x0f37,
- 0x0f39, 0x0f39,
- 0x0f3e, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f71, 0x0f84,
- 0x0f86, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fc6, 0x0fc6,
- 0x1000, 0x1049,
- 0x1050, 0x109d,
- 0x10a0, 0x10c5,
- 0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135d, 0x135f,
- 0x1380, 0x138f,
- 0x13a0, 0x13f4,
- 0x1401, 0x166c,
- 0x166f, 0x167f,
- 0x1681, 0x169a,
- 0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
- 0x1700, 0x170c,
- 0x170e, 0x1714,
- 0x1720, 0x1734,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17b3,
- 0x17b6, 0x17d3,
- 0x17d7, 0x17d7,
- 0x17dc, 0x17dd,
- 0x17e0, 0x17e9,
- 0x180b, 0x180d,
- 0x1810, 0x1819,
- 0x1820, 0x1877,
- 0x1880, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191c,
- 0x1920, 0x192b,
- 0x1930, 0x193b,
- 0x1946, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x19d0, 0x19d9,
- 0x1a00, 0x1a1b,
- 0x1a20, 0x1a5e,
- 0x1a60, 0x1a7c,
- 0x1a7f, 0x1a89,
- 0x1a90, 0x1a99,
- 0x1aa7, 0x1aa7,
- 0x1b00, 0x1b4b,
- 0x1b50, 0x1b59,
- 0x1b6b, 0x1b73,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1bf3,
- 0x1c00, 0x1c37,
- 0x1c40, 0x1c49,
- 0x1c4d, 0x1c7d,
- 0x1cd0, 0x1cd2,
- 0x1cd4, 0x1cf2,
- 0x1d00, 0x1de6,
- 0x1dfc, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fbc,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fcc,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fe0, 0x1fec,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffc,
- 0x203f, 0x2040,
- 0x2054, 0x2054,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x209c,
- 0x20d0, 0x20f0,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x212f, 0x2139,
- 0x213c, 0x213f,
- 0x2145, 0x2149,
- 0x214e, 0x214e,
- 0x2160, 0x2188,
- 0x24b6, 0x24e9,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2ce4,
- 0x2ceb, 0x2cf1,
- 0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
- 0x2d6f, 0x2d6f,
- 0x2d7f, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
+/* 'In_IPA_Extensions': Block */
+static const OnigCodePoint CR_In_IPA_Extensions[] = {
+ 1,
+ 0x0250, 0x02af,
+}; /* CR_In_IPA_Extensions */
+
+/* 'In_Spacing_Modifier_Letters': Block */
+static const OnigCodePoint CR_In_Spacing_Modifier_Letters[] = {
+ 1,
+ 0x02b0, 0x02ff,
+}; /* CR_In_Spacing_Modifier_Letters */
+
+/* 'In_Combining_Diacritical_Marks': Block */
+static const OnigCodePoint CR_In_Combining_Diacritical_Marks[] = {
+ 1,
+ 0x0300, 0x036f,
+}; /* CR_In_Combining_Diacritical_Marks */
+
+/* 'In_Greek_and_Coptic': Block */
+static const OnigCodePoint CR_In_Greek_and_Coptic[] = {
+ 1,
+ 0x0370, 0x03ff,
+}; /* CR_In_Greek_and_Coptic */
+
+/* 'In_Cyrillic': Block */
+static const OnigCodePoint CR_In_Cyrillic[] = {
+ 1,
+ 0x0400, 0x04ff,
+}; /* CR_In_Cyrillic */
+
+/* 'In_Cyrillic_Supplement': Block */
+static const OnigCodePoint CR_In_Cyrillic_Supplement[] = {
+ 1,
+ 0x0500, 0x052f,
+}; /* CR_In_Cyrillic_Supplement */
+
+/* 'In_Armenian': Block */
+static const OnigCodePoint CR_In_Armenian[] = {
+ 1,
+ 0x0530, 0x058f,
+}; /* CR_In_Armenian */
+
+/* 'In_Hebrew': Block */
+static const OnigCodePoint CR_In_Hebrew[] = {
+ 1,
+ 0x0590, 0x05ff,
+}; /* CR_In_Hebrew */
+
+/* 'In_Arabic': Block */
+static const OnigCodePoint CR_In_Arabic[] = {
+ 1,
+ 0x0600, 0x06ff,
+}; /* CR_In_Arabic */
+
+/* 'In_Syriac': Block */
+static const OnigCodePoint CR_In_Syriac[] = {
+ 1,
+ 0x0700, 0x074f,
+}; /* CR_In_Syriac */
+
+/* 'In_Arabic_Supplement': Block */
+static const OnigCodePoint CR_In_Arabic_Supplement[] = {
+ 1,
+ 0x0750, 0x077f,
+}; /* CR_In_Arabic_Supplement */
+
+/* 'In_Thaana': Block */
+static const OnigCodePoint CR_In_Thaana[] = {
+ 1,
+ 0x0780, 0x07bf,
+}; /* CR_In_Thaana */
+
+/* 'In_NKo': Block */
+static const OnigCodePoint CR_In_NKo[] = {
+ 1,
+ 0x07c0, 0x07ff,
+}; /* CR_In_NKo */
+
+/* 'In_Samaritan': Block */
+static const OnigCodePoint CR_In_Samaritan[] = {
+ 1,
+ 0x0800, 0x083f,
+}; /* CR_In_Samaritan */
+
+/* 'In_Mandaic': Block */
+static const OnigCodePoint CR_In_Mandaic[] = {
+ 1,
+ 0x0840, 0x085f,
+}; /* CR_In_Mandaic */
+
+/* 'In_Arabic_Extended_A': Block */
+static const OnigCodePoint CR_In_Arabic_Extended_A[] = {
+ 1,
+ 0x08a0, 0x08ff,
+}; /* CR_In_Arabic_Extended_A */
+
+/* 'In_Devanagari': Block */
+static const OnigCodePoint CR_In_Devanagari[] = {
+ 1,
+ 0x0900, 0x097f,
+}; /* CR_In_Devanagari */
+
+/* 'In_Bengali': Block */
+static const OnigCodePoint CR_In_Bengali[] = {
+ 1,
+ 0x0980, 0x09ff,
+}; /* CR_In_Bengali */
+
+/* 'In_Gurmukhi': Block */
+static const OnigCodePoint CR_In_Gurmukhi[] = {
+ 1,
+ 0x0a00, 0x0a7f,
+}; /* CR_In_Gurmukhi */
+
+/* 'In_Gujarati': Block */
+static const OnigCodePoint CR_In_Gujarati[] = {
+ 1,
+ 0x0a80, 0x0aff,
+}; /* CR_In_Gujarati */
+
+/* 'In_Oriya': Block */
+static const OnigCodePoint CR_In_Oriya[] = {
+ 1,
+ 0x0b00, 0x0b7f,
+}; /* CR_In_Oriya */
+
+/* 'In_Tamil': Block */
+static const OnigCodePoint CR_In_Tamil[] = {
+ 1,
+ 0x0b80, 0x0bff,
+}; /* CR_In_Tamil */
+
+/* 'In_Telugu': Block */
+static const OnigCodePoint CR_In_Telugu[] = {
+ 1,
+ 0x0c00, 0x0c7f,
+}; /* CR_In_Telugu */
+
+/* 'In_Kannada': Block */
+static const OnigCodePoint CR_In_Kannada[] = {
+ 1,
+ 0x0c80, 0x0cff,
+}; /* CR_In_Kannada */
+
+/* 'In_Malayalam': Block */
+static const OnigCodePoint CR_In_Malayalam[] = {
+ 1,
+ 0x0d00, 0x0d7f,
+}; /* CR_In_Malayalam */
+
+/* 'In_Sinhala': Block */
+static const OnigCodePoint CR_In_Sinhala[] = {
+ 1,
+ 0x0d80, 0x0dff,
+}; /* CR_In_Sinhala */
+
+/* 'In_Thai': Block */
+static const OnigCodePoint CR_In_Thai[] = {
+ 1,
+ 0x0e00, 0x0e7f,
+}; /* CR_In_Thai */
+
+/* 'In_Lao': Block */
+static const OnigCodePoint CR_In_Lao[] = {
+ 1,
+ 0x0e80, 0x0eff,
+}; /* CR_In_Lao */
+
+/* 'In_Tibetan': Block */
+static const OnigCodePoint CR_In_Tibetan[] = {
+ 1,
+ 0x0f00, 0x0fff,
+}; /* CR_In_Tibetan */
+
+/* 'In_Myanmar': Block */
+static const OnigCodePoint CR_In_Myanmar[] = {
+ 1,
+ 0x1000, 0x109f,
+}; /* CR_In_Myanmar */
+
+/* 'In_Georgian': Block */
+static const OnigCodePoint CR_In_Georgian[] = {
+ 1,
+ 0x10a0, 0x10ff,
+}; /* CR_In_Georgian */
+
+/* 'In_Hangul_Jamo': Block */
+static const OnigCodePoint CR_In_Hangul_Jamo[] = {
+ 1,
+ 0x1100, 0x11ff,
+}; /* CR_In_Hangul_Jamo */
+
+/* 'In_Ethiopic': Block */
+static const OnigCodePoint CR_In_Ethiopic[] = {
+ 1,
+ 0x1200, 0x137f,
+}; /* CR_In_Ethiopic */
+
+/* 'In_Ethiopic_Supplement': Block */
+static const OnigCodePoint CR_In_Ethiopic_Supplement[] = {
+ 1,
+ 0x1380, 0x139f,
+}; /* CR_In_Ethiopic_Supplement */
+
+/* 'In_Cherokee': Block */
+static const OnigCodePoint CR_In_Cherokee[] = {
+ 1,
+ 0x13a0, 0x13ff,
+}; /* CR_In_Cherokee */
+
+/* 'In_Unified_Canadian_Aboriginal_Syllabics': Block */
+static const OnigCodePoint CR_In_Unified_Canadian_Aboriginal_Syllabics[] = {
+ 1,
+ 0x1400, 0x167f,
+}; /* CR_In_Unified_Canadian_Aboriginal_Syllabics */
+
+/* 'In_Ogham': Block */
+static const OnigCodePoint CR_In_Ogham[] = {
+ 1,
+ 0x1680, 0x169f,
+}; /* CR_In_Ogham */
+
+/* 'In_Runic': Block */
+static const OnigCodePoint CR_In_Runic[] = {
+ 1,
+ 0x16a0, 0x16ff,
+}; /* CR_In_Runic */
+
+/* 'In_Tagalog': Block */
+static const OnigCodePoint CR_In_Tagalog[] = {
+ 1,
+ 0x1700, 0x171f,
+}; /* CR_In_Tagalog */
+
+/* 'In_Hanunoo': Block */
+static const OnigCodePoint CR_In_Hanunoo[] = {
+ 1,
+ 0x1720, 0x173f,
+}; /* CR_In_Hanunoo */
+
+/* 'In_Buhid': Block */
+static const OnigCodePoint CR_In_Buhid[] = {
+ 1,
+ 0x1740, 0x175f,
+}; /* CR_In_Buhid */
+
+/* 'In_Tagbanwa': Block */
+static const OnigCodePoint CR_In_Tagbanwa[] = {
+ 1,
+ 0x1760, 0x177f,
+}; /* CR_In_Tagbanwa */
+
+/* 'In_Khmer': Block */
+static const OnigCodePoint CR_In_Khmer[] = {
+ 1,
+ 0x1780, 0x17ff,
+}; /* CR_In_Khmer */
+
+/* 'In_Mongolian': Block */
+static const OnigCodePoint CR_In_Mongolian[] = {
+ 1,
+ 0x1800, 0x18af,
+}; /* CR_In_Mongolian */
+
+/* 'In_Unified_Canadian_Aboriginal_Syllabics_Extended': Block */
+static const OnigCodePoint CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended[] = {
+ 1,
+ 0x18b0, 0x18ff,
+}; /* CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended */
+
+/* 'In_Limbu': Block */
+static const OnigCodePoint CR_In_Limbu[] = {
+ 1,
+ 0x1900, 0x194f,
+}; /* CR_In_Limbu */
+
+/* 'In_Tai_Le': Block */
+static const OnigCodePoint CR_In_Tai_Le[] = {
+ 1,
+ 0x1950, 0x197f,
+}; /* CR_In_Tai_Le */
+
+/* 'In_New_Tai_Lue': Block */
+static const OnigCodePoint CR_In_New_Tai_Lue[] = {
+ 1,
+ 0x1980, 0x19df,
+}; /* CR_In_New_Tai_Lue */
+
+/* 'In_Khmer_Symbols': Block */
+static const OnigCodePoint CR_In_Khmer_Symbols[] = {
+ 1,
+ 0x19e0, 0x19ff,
+}; /* CR_In_Khmer_Symbols */
+
+/* 'In_Buginese': Block */
+static const OnigCodePoint CR_In_Buginese[] = {
+ 1,
+ 0x1a00, 0x1a1f,
+}; /* CR_In_Buginese */
+
+/* 'In_Tai_Tham': Block */
+static const OnigCodePoint CR_In_Tai_Tham[] = {
+ 1,
+ 0x1a20, 0x1aaf,
+}; /* CR_In_Tai_Tham */
+
+/* 'In_Balinese': Block */
+static const OnigCodePoint CR_In_Balinese[] = {
+ 1,
+ 0x1b00, 0x1b7f,
+}; /* CR_In_Balinese */
+
+/* 'In_Sundanese': Block */
+static const OnigCodePoint CR_In_Sundanese[] = {
+ 1,
+ 0x1b80, 0x1bbf,
+}; /* CR_In_Sundanese */
+
+/* 'In_Batak': Block */
+static const OnigCodePoint CR_In_Batak[] = {
+ 1,
+ 0x1bc0, 0x1bff,
+}; /* CR_In_Batak */
+
+/* 'In_Lepcha': Block */
+static const OnigCodePoint CR_In_Lepcha[] = {
+ 1,
+ 0x1c00, 0x1c4f,
+}; /* CR_In_Lepcha */
+
+/* 'In_Ol_Chiki': Block */
+#define CR_In_Ol_Chiki CR_Ol_Chiki
+
+/* 'In_Sundanese_Supplement': Block */
+static const OnigCodePoint CR_In_Sundanese_Supplement[] = {
+ 1,
+ 0x1cc0, 0x1ccf,
+}; /* CR_In_Sundanese_Supplement */
+
+/* 'In_Vedic_Extensions': Block */
+static const OnigCodePoint CR_In_Vedic_Extensions[] = {
+ 1,
+ 0x1cd0, 0x1cff,
+}; /* CR_In_Vedic_Extensions */
+
+/* 'In_Phonetic_Extensions': Block */
+static const OnigCodePoint CR_In_Phonetic_Extensions[] = {
+ 1,
+ 0x1d00, 0x1d7f,
+}; /* CR_In_Phonetic_Extensions */
+
+/* 'In_Phonetic_Extensions_Supplement': Block */
+static const OnigCodePoint CR_In_Phonetic_Extensions_Supplement[] = {
+ 1,
+ 0x1d80, 0x1dbf,
+}; /* CR_In_Phonetic_Extensions_Supplement */
+
+/* 'In_Combining_Diacritical_Marks_Supplement': Block */
+static const OnigCodePoint CR_In_Combining_Diacritical_Marks_Supplement[] = {
+ 1,
+ 0x1dc0, 0x1dff,
+}; /* CR_In_Combining_Diacritical_Marks_Supplement */
+
+/* 'In_Latin_Extended_Additional': Block */
+static const OnigCodePoint CR_In_Latin_Extended_Additional[] = {
+ 1,
+ 0x1e00, 0x1eff,
+}; /* CR_In_Latin_Extended_Additional */
+
+/* 'In_Greek_Extended': Block */
+static const OnigCodePoint CR_In_Greek_Extended[] = {
+ 1,
+ 0x1f00, 0x1fff,
+}; /* CR_In_Greek_Extended */
+
+/* 'In_General_Punctuation': Block */
+static const OnigCodePoint CR_In_General_Punctuation[] = {
+ 1,
+ 0x2000, 0x206f,
+}; /* CR_In_General_Punctuation */
+
+/* 'In_Superscripts_and_Subscripts': Block */
+static const OnigCodePoint CR_In_Superscripts_and_Subscripts[] = {
+ 1,
+ 0x2070, 0x209f,
+}; /* CR_In_Superscripts_and_Subscripts */
+
+/* 'In_Currency_Symbols': Block */
+static const OnigCodePoint CR_In_Currency_Symbols[] = {
+ 1,
+ 0x20a0, 0x20cf,
+}; /* CR_In_Currency_Symbols */
+
+/* 'In_Combining_Diacritical_Marks_for_Symbols': Block */
+static const OnigCodePoint CR_In_Combining_Diacritical_Marks_for_Symbols[] = {
+ 1,
+ 0x20d0, 0x20ff,
+}; /* CR_In_Combining_Diacritical_Marks_for_Symbols */
+
+/* 'In_Letterlike_Symbols': Block */
+static const OnigCodePoint CR_In_Letterlike_Symbols[] = {
+ 1,
+ 0x2100, 0x214f,
+}; /* CR_In_Letterlike_Symbols */
+
+/* 'In_Number_Forms': Block */
+static const OnigCodePoint CR_In_Number_Forms[] = {
+ 1,
+ 0x2150, 0x218f,
+}; /* CR_In_Number_Forms */
+
+/* 'In_Arrows': Block */
+static const OnigCodePoint CR_In_Arrows[] = {
+ 1,
+ 0x2190, 0x21ff,
+}; /* CR_In_Arrows */
+
+/* 'In_Mathematical_Operators': Block */
+static const OnigCodePoint CR_In_Mathematical_Operators[] = {
+ 1,
+ 0x2200, 0x22ff,
+}; /* CR_In_Mathematical_Operators */
+
+/* 'In_Miscellaneous_Technical': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Technical[] = {
+ 1,
+ 0x2300, 0x23ff,
+}; /* CR_In_Miscellaneous_Technical */
+
+/* 'In_Control_Pictures': Block */
+static const OnigCodePoint CR_In_Control_Pictures[] = {
+ 1,
+ 0x2400, 0x243f,
+}; /* CR_In_Control_Pictures */
+
+/* 'In_Optical_Character_Recognition': Block */
+static const OnigCodePoint CR_In_Optical_Character_Recognition[] = {
+ 1,
+ 0x2440, 0x245f,
+}; /* CR_In_Optical_Character_Recognition */
+
+/* 'In_Enclosed_Alphanumerics': Block */
+static const OnigCodePoint CR_In_Enclosed_Alphanumerics[] = {
+ 1,
+ 0x2460, 0x24ff,
+}; /* CR_In_Enclosed_Alphanumerics */
+
+/* 'In_Box_Drawing': Block */
+static const OnigCodePoint CR_In_Box_Drawing[] = {
+ 1,
+ 0x2500, 0x257f,
+}; /* CR_In_Box_Drawing */
+
+/* 'In_Block_Elements': Block */
+static const OnigCodePoint CR_In_Block_Elements[] = {
+ 1,
+ 0x2580, 0x259f,
+}; /* CR_In_Block_Elements */
+
+/* 'In_Geometric_Shapes': Block */
+static const OnigCodePoint CR_In_Geometric_Shapes[] = {
+ 1,
+ 0x25a0, 0x25ff,
+}; /* CR_In_Geometric_Shapes */
+
+/* 'In_Miscellaneous_Symbols': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Symbols[] = {
+ 1,
+ 0x2600, 0x26ff,
+}; /* CR_In_Miscellaneous_Symbols */
+
+/* 'In_Dingbats': Block */
+static const OnigCodePoint CR_In_Dingbats[] = {
+ 1,
+ 0x2700, 0x27bf,
+}; /* CR_In_Dingbats */
+
+/* 'In_Miscellaneous_Mathematical_Symbols_A': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Mathematical_Symbols_A[] = {
+ 1,
+ 0x27c0, 0x27ef,
+}; /* CR_In_Miscellaneous_Mathematical_Symbols_A */
+
+/* 'In_Supplemental_Arrows_A': Block */
+static const OnigCodePoint CR_In_Supplemental_Arrows_A[] = {
+ 1,
+ 0x27f0, 0x27ff,
+}; /* CR_In_Supplemental_Arrows_A */
+
+/* 'In_Braille_Patterns': Block */
+#define CR_In_Braille_Patterns CR_Braille
+
+/* 'In_Supplemental_Arrows_B': Block */
+static const OnigCodePoint CR_In_Supplemental_Arrows_B[] = {
+ 1,
+ 0x2900, 0x297f,
+}; /* CR_In_Supplemental_Arrows_B */
+
+/* 'In_Miscellaneous_Mathematical_Symbols_B': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Mathematical_Symbols_B[] = {
+ 1,
+ 0x2980, 0x29ff,
+}; /* CR_In_Miscellaneous_Mathematical_Symbols_B */
+
+/* 'In_Supplemental_Mathematical_Operators': Block */
+static const OnigCodePoint CR_In_Supplemental_Mathematical_Operators[] = {
+ 1,
+ 0x2a00, 0x2aff,
+}; /* CR_In_Supplemental_Mathematical_Operators */
+
+/* 'In_Miscellaneous_Symbols_and_Arrows': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Symbols_and_Arrows[] = {
+ 1,
+ 0x2b00, 0x2bff,
+}; /* CR_In_Miscellaneous_Symbols_and_Arrows */
+
+/* 'In_Glagolitic': Block */
+static const OnigCodePoint CR_In_Glagolitic[] = {
+ 1,
+ 0x2c00, 0x2c5f,
+}; /* CR_In_Glagolitic */
+
+/* 'In_Latin_Extended_C': Block */
+static const OnigCodePoint CR_In_Latin_Extended_C[] = {
+ 1,
+ 0x2c60, 0x2c7f,
+}; /* CR_In_Latin_Extended_C */
+
+/* 'In_Coptic': Block */
+static const OnigCodePoint CR_In_Coptic[] = {
+ 1,
+ 0x2c80, 0x2cff,
+}; /* CR_In_Coptic */
+
+/* 'In_Georgian_Supplement': Block */
+static const OnigCodePoint CR_In_Georgian_Supplement[] = {
+ 1,
+ 0x2d00, 0x2d2f,
+}; /* CR_In_Georgian_Supplement */
+
+/* 'In_Tifinagh': Block */
+static const OnigCodePoint CR_In_Tifinagh[] = {
+ 1,
+ 0x2d30, 0x2d7f,
+}; /* CR_In_Tifinagh */
+
+/* 'In_Ethiopic_Extended': Block */
+static const OnigCodePoint CR_In_Ethiopic_Extended[] = {
+ 1,
+ 0x2d80, 0x2ddf,
+}; /* CR_In_Ethiopic_Extended */
+
+/* 'In_Cyrillic_Extended_A': Block */
+static const OnigCodePoint CR_In_Cyrillic_Extended_A[] = {
+ 1,
0x2de0, 0x2dff,
- 0x2e2f, 0x2e2f,
- 0x3005, 0x3007,
- 0x3021, 0x302f,
- 0x3031, 0x3035,
- 0x3038, 0x303c,
- 0x3041, 0x3096,
- 0x3099, 0x309a,
- 0x309d, 0x309f,
- 0x30a1, 0x30fa,
- 0x30fc, 0x30ff,
- 0x3105, 0x312d,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
+}; /* CR_In_Cyrillic_Extended_A */
+
+/* 'In_Supplemental_Punctuation': Block */
+static const OnigCodePoint CR_In_Supplemental_Punctuation[] = {
+ 1,
+ 0x2e00, 0x2e7f,
+}; /* CR_In_Supplemental_Punctuation */
+
+/* 'In_CJK_Radicals_Supplement': Block */
+static const OnigCodePoint CR_In_CJK_Radicals_Supplement[] = {
+ 1,
+ 0x2e80, 0x2eff,
+}; /* CR_In_CJK_Radicals_Supplement */
+
+/* 'In_Kangxi_Radicals': Block */
+static const OnigCodePoint CR_In_Kangxi_Radicals[] = {
+ 1,
+ 0x2f00, 0x2fdf,
+}; /* CR_In_Kangxi_Radicals */
+
+/* 'In_Ideographic_Description_Characters': Block */
+static const OnigCodePoint CR_In_Ideographic_Description_Characters[] = {
+ 1,
+ 0x2ff0, 0x2fff,
+}; /* CR_In_Ideographic_Description_Characters */
+
+/* 'In_CJK_Symbols_and_Punctuation': Block */
+static const OnigCodePoint CR_In_CJK_Symbols_and_Punctuation[] = {
+ 1,
+ 0x3000, 0x303f,
+}; /* CR_In_CJK_Symbols_and_Punctuation */
+
+/* 'In_Hiragana': Block */
+static const OnigCodePoint CR_In_Hiragana[] = {
+ 1,
+ 0x3040, 0x309f,
+}; /* CR_In_Hiragana */
+
+/* 'In_Katakana': Block */
+static const OnigCodePoint CR_In_Katakana[] = {
+ 1,
+ 0x30a0, 0x30ff,
+}; /* CR_In_Katakana */
+
+/* 'In_Bopomofo': Block */
+static const OnigCodePoint CR_In_Bopomofo[] = {
+ 1,
+ 0x3100, 0x312f,
+}; /* CR_In_Bopomofo */
+
+/* 'In_Hangul_Compatibility_Jamo': Block */
+static const OnigCodePoint CR_In_Hangul_Compatibility_Jamo[] = {
+ 1,
+ 0x3130, 0x318f,
+}; /* CR_In_Hangul_Compatibility_Jamo */
+
+/* 'In_Kanbun': Block */
+static const OnigCodePoint CR_In_Kanbun[] = {
+ 1,
+ 0x3190, 0x319f,
+}; /* CR_In_Kanbun */
+
+/* 'In_Bopomofo_Extended': Block */
+static const OnigCodePoint CR_In_Bopomofo_Extended[] = {
+ 1,
+ 0x31a0, 0x31bf,
+}; /* CR_In_Bopomofo_Extended */
+
+/* 'In_CJK_Strokes': Block */
+static const OnigCodePoint CR_In_CJK_Strokes[] = {
+ 1,
+ 0x31c0, 0x31ef,
+}; /* CR_In_CJK_Strokes */
+
+/* 'In_Katakana_Phonetic_Extensions': Block */
+static const OnigCodePoint CR_In_Katakana_Phonetic_Extensions[] = {
+ 1,
0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa62b,
- 0xa640, 0xa672,
- 0xa67c, 0xa67d,
- 0xa67f, 0xa697,
- 0xa6a0, 0xa6f1,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa827,
- 0xa840, 0xa873,
- 0xa880, 0xa8c4,
- 0xa8d0, 0xa8d9,
- 0xa8e0, 0xa8f7,
- 0xa8fb, 0xa8fb,
- 0xa900, 0xa92d,
- 0xa930, 0xa953,
- 0xa960, 0xa97c,
- 0xa980, 0xa9c0,
- 0xa9cf, 0xa9d9,
- 0xaa00, 0xaa36,
- 0xaa40, 0xaa4d,
- 0xaa50, 0xaa59,
- 0xaa60, 0xaa76,
- 0xaa7a, 0xaa7b,
- 0xaa80, 0xaac2,
- 0xaadb, 0xaadd,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xabc0, 0xabea,
- 0xabec, 0xabed,
- 0xabf0, 0xabf9,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb28,
- 0xfb2a, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3d,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfb,
+}; /* CR_In_Katakana_Phonetic_Extensions */
+
+/* 'In_Enclosed_CJK_Letters_and_Months': Block */
+static const OnigCodePoint CR_In_Enclosed_CJK_Letters_and_Months[] = {
+ 1,
+ 0x3200, 0x32ff,
+}; /* CR_In_Enclosed_CJK_Letters_and_Months */
+
+/* 'In_CJK_Compatibility': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility[] = {
+ 1,
+ 0x3300, 0x33ff,
+}; /* CR_In_CJK_Compatibility */
+
+/* 'In_CJK_Unified_Ideographs_Extension_A': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_A[] = {
+ 1,
+ 0x3400, 0x4dbf,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_A */
+
+/* 'In_Yijing_Hexagram_Symbols': Block */
+static const OnigCodePoint CR_In_Yijing_Hexagram_Symbols[] = {
+ 1,
+ 0x4dc0, 0x4dff,
+}; /* CR_In_Yijing_Hexagram_Symbols */
+
+/* 'In_CJK_Unified_Ideographs': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs[] = {
+ 1,
+ 0x4e00, 0x9fff,
+}; /* CR_In_CJK_Unified_Ideographs */
+
+/* 'In_Yi_Syllables': Block */
+static const OnigCodePoint CR_In_Yi_Syllables[] = {
+ 1,
+ 0xa000, 0xa48f,
+}; /* CR_In_Yi_Syllables */
+
+/* 'In_Yi_Radicals': Block */
+static const OnigCodePoint CR_In_Yi_Radicals[] = {
+ 1,
+ 0xa490, 0xa4cf,
+}; /* CR_In_Yi_Radicals */
+
+/* 'In_Lisu': Block */
+#define CR_In_Lisu CR_Lisu
+
+/* 'In_Vai': Block */
+static const OnigCodePoint CR_In_Vai[] = {
+ 1,
+ 0xa500, 0xa63f,
+}; /* CR_In_Vai */
+
+/* 'In_Cyrillic_Extended_B': Block */
+static const OnigCodePoint CR_In_Cyrillic_Extended_B[] = {
+ 1,
+ 0xa640, 0xa69f,
+}; /* CR_In_Cyrillic_Extended_B */
+
+/* 'In_Bamum': Block */
+static const OnigCodePoint CR_In_Bamum[] = {
+ 1,
+ 0xa6a0, 0xa6ff,
+}; /* CR_In_Bamum */
+
+/* 'In_Modifier_Tone_Letters': Block */
+static const OnigCodePoint CR_In_Modifier_Tone_Letters[] = {
+ 1,
+ 0xa700, 0xa71f,
+}; /* CR_In_Modifier_Tone_Letters */
+
+/* 'In_Latin_Extended_D': Block */
+static const OnigCodePoint CR_In_Latin_Extended_D[] = {
+ 1,
+ 0xa720, 0xa7ff,
+}; /* CR_In_Latin_Extended_D */
+
+/* 'In_Syloti_Nagri': Block */
+static const OnigCodePoint CR_In_Syloti_Nagri[] = {
+ 1,
+ 0xa800, 0xa82f,
+}; /* CR_In_Syloti_Nagri */
+
+/* 'In_Common_Indic_Number_Forms': Block */
+static const OnigCodePoint CR_In_Common_Indic_Number_Forms[] = {
+ 1,
+ 0xa830, 0xa83f,
+}; /* CR_In_Common_Indic_Number_Forms */
+
+/* 'In_Phags_pa': Block */
+static const OnigCodePoint CR_In_Phags_pa[] = {
+ 1,
+ 0xa840, 0xa87f,
+}; /* CR_In_Phags_pa */
+
+/* 'In_Saurashtra': Block */
+static const OnigCodePoint CR_In_Saurashtra[] = {
+ 1,
+ 0xa880, 0xa8df,
+}; /* CR_In_Saurashtra */
+
+/* 'In_Devanagari_Extended': Block */
+static const OnigCodePoint CR_In_Devanagari_Extended[] = {
+ 1,
+ 0xa8e0, 0xa8ff,
+}; /* CR_In_Devanagari_Extended */
+
+/* 'In_Kayah_Li': Block */
+#define CR_In_Kayah_Li CR_Kayah_Li
+
+/* 'In_Rejang': Block */
+static const OnigCodePoint CR_In_Rejang[] = {
+ 1,
+ 0xa930, 0xa95f,
+}; /* CR_In_Rejang */
+
+/* 'In_Hangul_Jamo_Extended_A': Block */
+static const OnigCodePoint CR_In_Hangul_Jamo_Extended_A[] = {
+ 1,
+ 0xa960, 0xa97f,
+}; /* CR_In_Hangul_Jamo_Extended_A */
+
+/* 'In_Javanese': Block */
+static const OnigCodePoint CR_In_Javanese[] = {
+ 1,
+ 0xa980, 0xa9df,
+}; /* CR_In_Javanese */
+
+/* 'In_Cham': Block */
+static const OnigCodePoint CR_In_Cham[] = {
+ 1,
+ 0xaa00, 0xaa5f,
+}; /* CR_In_Cham */
+
+/* 'In_Myanmar_Extended_A': Block */
+static const OnigCodePoint CR_In_Myanmar_Extended_A[] = {
+ 1,
+ 0xaa60, 0xaa7f,
+}; /* CR_In_Myanmar_Extended_A */
+
+/* 'In_Tai_Viet': Block */
+static const OnigCodePoint CR_In_Tai_Viet[] = {
+ 1,
+ 0xaa80, 0xaadf,
+}; /* CR_In_Tai_Viet */
+
+/* 'In_Meetei_Mayek_Extensions': Block */
+static const OnigCodePoint CR_In_Meetei_Mayek_Extensions[] = {
+ 1,
+ 0xaae0, 0xaaff,
+}; /* CR_In_Meetei_Mayek_Extensions */
+
+/* 'In_Ethiopic_Extended_A': Block */
+static const OnigCodePoint CR_In_Ethiopic_Extended_A[] = {
+ 1,
+ 0xab00, 0xab2f,
+}; /* CR_In_Ethiopic_Extended_A */
+
+/* 'In_Meetei_Mayek': Block */
+static const OnigCodePoint CR_In_Meetei_Mayek[] = {
+ 1,
+ 0xabc0, 0xabff,
+}; /* CR_In_Meetei_Mayek */
+
+/* 'In_Hangul_Syllables': Block */
+static const OnigCodePoint CR_In_Hangul_Syllables[] = {
+ 1,
+ 0xac00, 0xd7af,
+}; /* CR_In_Hangul_Syllables */
+
+/* 'In_Hangul_Jamo_Extended_B': Block */
+static const OnigCodePoint CR_In_Hangul_Jamo_Extended_B[] = {
+ 1,
+ 0xd7b0, 0xd7ff,
+}; /* CR_In_Hangul_Jamo_Extended_B */
+
+/* 'In_High_Surrogates': Block */
+static const OnigCodePoint CR_In_High_Surrogates[] = {
+ 1,
+ 0xd800, 0xdb7f,
+}; /* CR_In_High_Surrogates */
+
+/* 'In_High_Private_Use_Surrogates': Block */
+static const OnigCodePoint CR_In_High_Private_Use_Surrogates[] = {
+ 1,
+ 0xdb80, 0xdbff,
+}; /* CR_In_High_Private_Use_Surrogates */
+
+/* 'In_Low_Surrogates': Block */
+static const OnigCodePoint CR_In_Low_Surrogates[] = {
+ 1,
+ 0xdc00, 0xdfff,
+}; /* CR_In_Low_Surrogates */
+
+/* 'In_Private_Use_Area': Block */
+static const OnigCodePoint CR_In_Private_Use_Area[] = {
+ 1,
+ 0xe000, 0xf8ff,
+}; /* CR_In_Private_Use_Area */
+
+/* 'In_CJK_Compatibility_Ideographs': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility_Ideographs[] = {
+ 1,
+ 0xf900, 0xfaff,
+}; /* CR_In_CJK_Compatibility_Ideographs */
+
+/* 'In_Alphabetic_Presentation_Forms': Block */
+static const OnigCodePoint CR_In_Alphabetic_Presentation_Forms[] = {
+ 1,
+ 0xfb00, 0xfb4f,
+}; /* CR_In_Alphabetic_Presentation_Forms */
+
+/* 'In_Arabic_Presentation_Forms_A': Block */
+static const OnigCodePoint CR_In_Arabic_Presentation_Forms_A[] = {
+ 1,
+ 0xfb50, 0xfdff,
+}; /* CR_In_Arabic_Presentation_Forms_A */
+
+/* 'In_Variation_Selectors': Block */
+static const OnigCodePoint CR_In_Variation_Selectors[] = {
+ 1,
0xfe00, 0xfe0f,
- 0xfe20, 0xfe26,
- 0xfe33, 0xfe34,
- 0xfe4d, 0xfe4f,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xff10, 0xff19,
- 0xff21, 0xff3a,
- 0xff3f, 0xff3f,
- 0xff41, 0xff5a,
- 0xff66, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10140, 0x10174,
- 0x101fd, 0x101fd,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x10300, 0x1031e,
- 0x10330, 0x1034a,
- 0x10380, 0x1039d,
- 0x103a0, 0x103c3,
- 0x103c8, 0x103cf,
- 0x103d1, 0x103d5,
- 0x10400, 0x1049d,
- 0x104a0, 0x104a9,
- 0x10800, 0x10805,
- 0x10808, 0x10808,
- 0x1080a, 0x10835,
- 0x10837, 0x10838,
- 0x1083c, 0x1083c,
- 0x1083f, 0x10855,
- 0x10900, 0x10915,
- 0x10920, 0x10939,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a3f,
- 0x10a60, 0x10a7c,
- 0x10b00, 0x10b35,
- 0x10b40, 0x10b55,
- 0x10b60, 0x10b72,
- 0x10c00, 0x10c48,
- 0x11000, 0x11046,
- 0x11066, 0x1106f,
- 0x11080, 0x110ba,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x13000, 0x1342e,
- 0x16800, 0x16a38,
- 0x1b000, 0x1b001,
- 0x1d165, 0x1d169,
- 0x1d16d, 0x1d172,
- 0x1d17b, 0x1d182,
- 0x1d185, 0x1d18b,
- 0x1d1aa, 0x1d1ad,
- 0x1d242, 0x1d244,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d6c0,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6fa,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d734,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d76e,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d7a8,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7cb,
- 0x1d7ce, 0x1d7ff,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2f800, 0x2fa1d,
+}; /* CR_In_Variation_Selectors */
+
+/* 'In_Vertical_Forms': Block */
+static const OnigCodePoint CR_In_Vertical_Forms[] = {
+ 1,
+ 0xfe10, 0xfe1f,
+}; /* CR_In_Vertical_Forms */
+
+/* 'In_Combining_Half_Marks': Block */
+static const OnigCodePoint CR_In_Combining_Half_Marks[] = {
+ 1,
+ 0xfe20, 0xfe2f,
+}; /* CR_In_Combining_Half_Marks */
+
+/* 'In_CJK_Compatibility_Forms': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility_Forms[] = {
+ 1,
+ 0xfe30, 0xfe4f,
+}; /* CR_In_CJK_Compatibility_Forms */
+
+/* 'In_Small_Form_Variants': Block */
+static const OnigCodePoint CR_In_Small_Form_Variants[] = {
+ 1,
+ 0xfe50, 0xfe6f,
+}; /* CR_In_Small_Form_Variants */
+
+/* 'In_Arabic_Presentation_Forms_B': Block */
+static const OnigCodePoint CR_In_Arabic_Presentation_Forms_B[] = {
+ 1,
+ 0xfe70, 0xfeff,
+}; /* CR_In_Arabic_Presentation_Forms_B */
+
+/* 'In_Halfwidth_and_Fullwidth_Forms': Block */
+static const OnigCodePoint CR_In_Halfwidth_and_Fullwidth_Forms[] = {
+ 1,
+ 0xff00, 0xffef,
+}; /* CR_In_Halfwidth_and_Fullwidth_Forms */
+
+/* 'In_Specials': Block */
+static const OnigCodePoint CR_In_Specials[] = {
+ 1,
+ 0xfff0, 0xffff,
+}; /* CR_In_Specials */
+
+/* 'In_Linear_B_Syllabary': Block */
+static const OnigCodePoint CR_In_Linear_B_Syllabary[] = {
+ 1,
+ 0x10000, 0x1007f,
+}; /* CR_In_Linear_B_Syllabary */
+
+/* 'In_Linear_B_Ideograms': Block */
+static const OnigCodePoint CR_In_Linear_B_Ideograms[] = {
+ 1,
+ 0x10080, 0x100ff,
+}; /* CR_In_Linear_B_Ideograms */
+
+/* 'In_Aegean_Numbers': Block */
+static const OnigCodePoint CR_In_Aegean_Numbers[] = {
+ 1,
+ 0x10100, 0x1013f,
+}; /* CR_In_Aegean_Numbers */
+
+/* 'In_Ancient_Greek_Numbers': Block */
+static const OnigCodePoint CR_In_Ancient_Greek_Numbers[] = {
+ 1,
+ 0x10140, 0x1018f,
+}; /* CR_In_Ancient_Greek_Numbers */
+
+/* 'In_Ancient_Symbols': Block */
+static const OnigCodePoint CR_In_Ancient_Symbols[] = {
+ 1,
+ 0x10190, 0x101cf,
+}; /* CR_In_Ancient_Symbols */
+
+/* 'In_Phaistos_Disc': Block */
+static const OnigCodePoint CR_In_Phaistos_Disc[] = {
+ 1,
+ 0x101d0, 0x101ff,
+}; /* CR_In_Phaistos_Disc */
+
+/* 'In_Lycian': Block */
+static const OnigCodePoint CR_In_Lycian[] = {
+ 1,
+ 0x10280, 0x1029f,
+}; /* CR_In_Lycian */
+
+/* 'In_Carian': Block */
+static const OnigCodePoint CR_In_Carian[] = {
+ 1,
+ 0x102a0, 0x102df,
+}; /* CR_In_Carian */
+
+/* 'In_Old_Italic': Block */
+static const OnigCodePoint CR_In_Old_Italic[] = {
+ 1,
+ 0x10300, 0x1032f,
+}; /* CR_In_Old_Italic */
+
+/* 'In_Gothic': Block */
+static const OnigCodePoint CR_In_Gothic[] = {
+ 1,
+ 0x10330, 0x1034f,
+}; /* CR_In_Gothic */
+
+/* 'In_Ugaritic': Block */
+static const OnigCodePoint CR_In_Ugaritic[] = {
+ 1,
+ 0x10380, 0x1039f,
+}; /* CR_In_Ugaritic */
+
+/* 'In_Old_Persian': Block */
+static const OnigCodePoint CR_In_Old_Persian[] = {
+ 1,
+ 0x103a0, 0x103df,
+}; /* CR_In_Old_Persian */
+
+/* 'In_Deseret': Block */
+#define CR_In_Deseret CR_Deseret
+
+/* 'In_Shavian': Block */
+#define CR_In_Shavian CR_Shavian
+
+/* 'In_Osmanya': Block */
+static const OnigCodePoint CR_In_Osmanya[] = {
+ 1,
+ 0x10480, 0x104af,
+}; /* CR_In_Osmanya */
+
+/* 'In_Cypriot_Syllabary': Block */
+static const OnigCodePoint CR_In_Cypriot_Syllabary[] = {
+ 1,
+ 0x10800, 0x1083f,
+}; /* CR_In_Cypriot_Syllabary */
+
+/* 'In_Imperial_Aramaic': Block */
+static const OnigCodePoint CR_In_Imperial_Aramaic[] = {
+ 1,
+ 0x10840, 0x1085f,
+}; /* CR_In_Imperial_Aramaic */
+
+/* 'In_Phoenician': Block */
+static const OnigCodePoint CR_In_Phoenician[] = {
+ 1,
+ 0x10900, 0x1091f,
+}; /* CR_In_Phoenician */
+
+/* 'In_Lydian': Block */
+static const OnigCodePoint CR_In_Lydian[] = {
+ 1,
+ 0x10920, 0x1093f,
+}; /* CR_In_Lydian */
+
+/* 'In_Meroitic_Hieroglyphs': Block */
+#define CR_In_Meroitic_Hieroglyphs CR_Meroitic_Hieroglyphs
+
+/* 'In_Meroitic_Cursive': Block */
+static const OnigCodePoint CR_In_Meroitic_Cursive[] = {
+ 1,
+ 0x109a0, 0x109ff,
+}; /* CR_In_Meroitic_Cursive */
+
+/* 'In_Kharoshthi': Block */
+static const OnigCodePoint CR_In_Kharoshthi[] = {
+ 1,
+ 0x10a00, 0x10a5f,
+}; /* CR_In_Kharoshthi */
+
+/* 'In_Old_South_Arabian': Block */
+#define CR_In_Old_South_Arabian CR_Old_South_Arabian
+
+/* 'In_Avestan': Block */
+static const OnigCodePoint CR_In_Avestan[] = {
+ 1,
+ 0x10b00, 0x10b3f,
+}; /* CR_In_Avestan */
+
+/* 'In_Inscriptional_Parthian': Block */
+static const OnigCodePoint CR_In_Inscriptional_Parthian[] = {
+ 1,
+ 0x10b40, 0x10b5f,
+}; /* CR_In_Inscriptional_Parthian */
+
+/* 'In_Inscriptional_Pahlavi': Block */
+static const OnigCodePoint CR_In_Inscriptional_Pahlavi[] = {
+ 1,
+ 0x10b60, 0x10b7f,
+}; /* CR_In_Inscriptional_Pahlavi */
+
+/* 'In_Old_Turkic': Block */
+static const OnigCodePoint CR_In_Old_Turkic[] = {
+ 1,
+ 0x10c00, 0x10c4f,
+}; /* CR_In_Old_Turkic */
+
+/* 'In_Rumi_Numeral_Symbols': Block */
+static const OnigCodePoint CR_In_Rumi_Numeral_Symbols[] = {
+ 1,
+ 0x10e60, 0x10e7f,
+}; /* CR_In_Rumi_Numeral_Symbols */
+
+/* 'In_Brahmi': Block */
+static const OnigCodePoint CR_In_Brahmi[] = {
+ 1,
+ 0x11000, 0x1107f,
+}; /* CR_In_Brahmi */
+
+/* 'In_Kaithi': Block */
+static const OnigCodePoint CR_In_Kaithi[] = {
+ 1,
+ 0x11080, 0x110cf,
+}; /* CR_In_Kaithi */
+
+/* 'In_Sora_Sompeng': Block */
+static const OnigCodePoint CR_In_Sora_Sompeng[] = {
+ 1,
+ 0x110d0, 0x110ff,
+}; /* CR_In_Sora_Sompeng */
+
+/* 'In_Chakma': Block */
+static const OnigCodePoint CR_In_Chakma[] = {
+ 1,
+ 0x11100, 0x1114f,
+}; /* CR_In_Chakma */
+
+/* 'In_Sharada': Block */
+static const OnigCodePoint CR_In_Sharada[] = {
+ 1,
+ 0x11180, 0x111df,
+}; /* CR_In_Sharada */
+
+/* 'In_Takri': Block */
+static const OnigCodePoint CR_In_Takri[] = {
+ 1,
+ 0x11680, 0x116cf,
+}; /* CR_In_Takri */
+
+/* 'In_Cuneiform': Block */
+static const OnigCodePoint CR_In_Cuneiform[] = {
+ 1,
+ 0x12000, 0x123ff,
+}; /* CR_In_Cuneiform */
+
+/* 'In_Cuneiform_Numbers_and_Punctuation': Block */
+static const OnigCodePoint CR_In_Cuneiform_Numbers_and_Punctuation[] = {
+ 1,
+ 0x12400, 0x1247f,
+}; /* CR_In_Cuneiform_Numbers_and_Punctuation */
+
+/* 'In_Egyptian_Hieroglyphs': Block */
+static const OnigCodePoint CR_In_Egyptian_Hieroglyphs[] = {
+ 1,
+ 0x13000, 0x1342f,
+}; /* CR_In_Egyptian_Hieroglyphs */
+
+/* 'In_Bamum_Supplement': Block */
+static const OnigCodePoint CR_In_Bamum_Supplement[] = {
+ 1,
+ 0x16800, 0x16a3f,
+}; /* CR_In_Bamum_Supplement */
+
+/* 'In_Miao': Block */
+static const OnigCodePoint CR_In_Miao[] = {
+ 1,
+ 0x16f00, 0x16f9f,
+}; /* CR_In_Miao */
+
+/* 'In_Kana_Supplement': Block */
+static const OnigCodePoint CR_In_Kana_Supplement[] = {
+ 1,
+ 0x1b000, 0x1b0ff,
+}; /* CR_In_Kana_Supplement */
+
+/* 'In_Byzantine_Musical_Symbols': Block */
+static const OnigCodePoint CR_In_Byzantine_Musical_Symbols[] = {
+ 1,
+ 0x1d000, 0x1d0ff,
+}; /* CR_In_Byzantine_Musical_Symbols */
+
+/* 'In_Musical_Symbols': Block */
+static const OnigCodePoint CR_In_Musical_Symbols[] = {
+ 1,
+ 0x1d100, 0x1d1ff,
+}; /* CR_In_Musical_Symbols */
+
+/* 'In_Ancient_Greek_Musical_Notation': Block */
+static const OnigCodePoint CR_In_Ancient_Greek_Musical_Notation[] = {
+ 1,
+ 0x1d200, 0x1d24f,
+}; /* CR_In_Ancient_Greek_Musical_Notation */
+
+/* 'In_Tai_Xuan_Jing_Symbols': Block */
+static const OnigCodePoint CR_In_Tai_Xuan_Jing_Symbols[] = {
+ 1,
+ 0x1d300, 0x1d35f,
+}; /* CR_In_Tai_Xuan_Jing_Symbols */
+
+/* 'In_Counting_Rod_Numerals': Block */
+static const OnigCodePoint CR_In_Counting_Rod_Numerals[] = {
+ 1,
+ 0x1d360, 0x1d37f,
+}; /* CR_In_Counting_Rod_Numerals */
+
+/* 'In_Mathematical_Alphanumeric_Symbols': Block */
+static const OnigCodePoint CR_In_Mathematical_Alphanumeric_Symbols[] = {
+ 1,
+ 0x1d400, 0x1d7ff,
+}; /* CR_In_Mathematical_Alphanumeric_Symbols */
+
+/* 'In_Arabic_Mathematical_Alphabetic_Symbols': Block */
+static const OnigCodePoint CR_In_Arabic_Mathematical_Alphabetic_Symbols[] = {
+ 1,
+ 0x1ee00, 0x1eeff,
+}; /* CR_In_Arabic_Mathematical_Alphabetic_Symbols */
+
+/* 'In_Mahjong_Tiles': Block */
+static const OnigCodePoint CR_In_Mahjong_Tiles[] = {
+ 1,
+ 0x1f000, 0x1f02f,
+}; /* CR_In_Mahjong_Tiles */
+
+/* 'In_Domino_Tiles': Block */
+static const OnigCodePoint CR_In_Domino_Tiles[] = {
+ 1,
+ 0x1f030, 0x1f09f,
+}; /* CR_In_Domino_Tiles */
+
+/* 'In_Playing_Cards': Block */
+static const OnigCodePoint CR_In_Playing_Cards[] = {
+ 1,
+ 0x1f0a0, 0x1f0ff,
+}; /* CR_In_Playing_Cards */
+
+/* 'In_Enclosed_Alphanumeric_Supplement': Block */
+static const OnigCodePoint CR_In_Enclosed_Alphanumeric_Supplement[] = {
+ 1,
+ 0x1f100, 0x1f1ff,
+}; /* CR_In_Enclosed_Alphanumeric_Supplement */
+
+/* 'In_Enclosed_Ideographic_Supplement': Block */
+static const OnigCodePoint CR_In_Enclosed_Ideographic_Supplement[] = {
+ 1,
+ 0x1f200, 0x1f2ff,
+}; /* CR_In_Enclosed_Ideographic_Supplement */
+
+/* 'In_Miscellaneous_Symbols_And_Pictographs': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Symbols_And_Pictographs[] = {
+ 1,
+ 0x1f300, 0x1f5ff,
+}; /* CR_In_Miscellaneous_Symbols_And_Pictographs */
+
+/* 'In_Emoticons': Block */
+static const OnigCodePoint CR_In_Emoticons[] = {
+ 1,
+ 0x1f600, 0x1f64f,
+}; /* CR_In_Emoticons */
+
+/* 'In_Transport_And_Map_Symbols': Block */
+static const OnigCodePoint CR_In_Transport_And_Map_Symbols[] = {
+ 1,
+ 0x1f680, 0x1f6ff,
+}; /* CR_In_Transport_And_Map_Symbols */
+
+/* 'In_Alchemical_Symbols': Block */
+static const OnigCodePoint CR_In_Alchemical_Symbols[] = {
+ 1,
+ 0x1f700, 0x1f77f,
+}; /* CR_In_Alchemical_Symbols */
+
+/* 'In_CJK_Unified_Ideographs_Extension_B': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_B[] = {
+ 1,
+ 0x20000, 0x2a6df,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_B */
+
+/* 'In_CJK_Unified_Ideographs_Extension_C': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_C[] = {
+ 1,
+ 0x2a700, 0x2b73f,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_C */
+
+/* 'In_CJK_Unified_Ideographs_Extension_D': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_D[] = {
+ 1,
+ 0x2b740, 0x2b81f,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_D */
+
+/* 'In_CJK_Compatibility_Ideographs_Supplement': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility_Ideographs_Supplement[] = {
+ 1,
+ 0x2f800, 0x2fa1f,
+}; /* CR_In_CJK_Compatibility_Ideographs_Supplement */
+
+/* 'In_Tags': Block */
+static const OnigCodePoint CR_In_Tags[] = {
+ 1,
+ 0xe0000, 0xe007f,
+}; /* CR_In_Tags */
+
+/* 'In_Variation_Selectors_Supplement': Block */
+static const OnigCodePoint CR_In_Variation_Selectors_Supplement[] = {
+ 1,
0xe0100, 0xe01ef,
-}; /* CR_Word */
+}; /* CR_In_Variation_Selectors_Supplement */
-/* 'Alnum': [[:Alnum:]] */
-static const OnigCodePoint CR_Alnum[] = {
- 509,
- 0x0030, 0x0039,
- 0x0041, 0x005a,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x02c1,
- 0x02c6, 0x02d1,
- 0x02e0, 0x02e4,
- 0x02ec, 0x02ec,
- 0x02ee, 0x02ee,
- 0x0345, 0x0345,
- 0x0370, 0x0374,
- 0x0376, 0x0377,
- 0x037a, 0x037d,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03f5,
- 0x03f7, 0x0481,
- 0x048a, 0x0527,
- 0x0531, 0x0556,
- 0x0559, 0x0559,
- 0x0561, 0x0587,
- 0x05b0, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f2,
- 0x0610, 0x061a,
- 0x0620, 0x0657,
- 0x0659, 0x0669,
- 0x066e, 0x06d3,
- 0x06d5, 0x06dc,
- 0x06e1, 0x06e8,
- 0x06ed, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x073f,
- 0x074d, 0x07b1,
- 0x07c0, 0x07ea,
- 0x07f4, 0x07f5,
- 0x07fa, 0x07fa,
- 0x0800, 0x0817,
- 0x081a, 0x082c,
- 0x0840, 0x0858,
- 0x0900, 0x093b,
- 0x093d, 0x094c,
- 0x094e, 0x0950,
- 0x0955, 0x0963,
- 0x0966, 0x096f,
- 0x0971, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bd, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09cc,
- 0x09ce, 0x09ce,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09e6, 0x09f1,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4c,
- 0x0a51, 0x0a51,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a75,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abd, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acc,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3d, 0x0b44,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4c,
- 0x0b56, 0x0b57,
- 0x0b5c, 0x0b5d,
- 0x0b5f, 0x0b63,
- 0x0b66, 0x0b6f,
- 0x0b71, 0x0b71,
- 0x0b82, 0x0b83,
- 0x0b85, 0x0b8a,
- 0x0b8e, 0x0b90,
- 0x0b92, 0x0b95,
- 0x0b99, 0x0b9a,
- 0x0b9c, 0x0b9c,
- 0x0b9e, 0x0b9f,
- 0x0ba3, 0x0ba4,
- 0x0ba8, 0x0baa,
- 0x0bae, 0x0bb9,
- 0x0bbe, 0x0bc2,
- 0x0bc6, 0x0bc8,
- 0x0bca, 0x0bcc,
- 0x0bd0, 0x0bd0,
- 0x0bd7, 0x0bd7,
- 0x0be6, 0x0bef,
- 0x0c01, 0x0c03,
- 0x0c05, 0x0c0c,
- 0x0c0e, 0x0c10,
- 0x0c12, 0x0c28,
- 0x0c2a, 0x0c33,
- 0x0c35, 0x0c39,
- 0x0c3d, 0x0c44,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4c,
- 0x0c55, 0x0c56,
- 0x0c58, 0x0c59,
- 0x0c60, 0x0c63,
- 0x0c66, 0x0c6f,
- 0x0c82, 0x0c83,
- 0x0c85, 0x0c8c,
- 0x0c8e, 0x0c90,
- 0x0c92, 0x0ca8,
- 0x0caa, 0x0cb3,
- 0x0cb5, 0x0cb9,
- 0x0cbd, 0x0cc4,
- 0x0cc6, 0x0cc8,
- 0x0cca, 0x0ccc,
- 0x0cd5, 0x0cd6,
- 0x0cde, 0x0cde,
- 0x0ce0, 0x0ce3,
- 0x0ce6, 0x0cef,
- 0x0cf1, 0x0cf2,
- 0x0d02, 0x0d03,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d3a,
- 0x0d3d, 0x0d44,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4c,
- 0x0d4e, 0x0d4e,
- 0x0d57, 0x0d57,
- 0x0d60, 0x0d63,
- 0x0d66, 0x0d6f,
- 0x0d7a, 0x0d7f,
- 0x0d82, 0x0d83,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df3,
- 0x0e01, 0x0e3a,
- 0x0e40, 0x0e46,
- 0x0e4d, 0x0e4d,
- 0x0e50, 0x0e59,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ecd, 0x0ecd,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f00,
- 0x0f20, 0x0f29,
- 0x0f40, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f71, 0x0f81,
- 0x0f88, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x1000, 0x1036,
- 0x1038, 0x1038,
- 0x103b, 0x1049,
- 0x1050, 0x1062,
- 0x1065, 0x1068,
- 0x106e, 0x1086,
- 0x108e, 0x108e,
- 0x1090, 0x1099,
- 0x109c, 0x109d,
- 0x10a0, 0x10c5,
- 0x10d0, 0x10fa,
- 0x10fc, 0x10fc,
- 0x1100, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135f, 0x135f,
- 0x1380, 0x138f,
- 0x13a0, 0x13f4,
- 0x1401, 0x166c,
- 0x166f, 0x167f,
- 0x1681, 0x169a,
- 0x16a0, 0x16ea,
- 0x16ee, 0x16f0,
- 0x1700, 0x170c,
- 0x170e, 0x1713,
- 0x1720, 0x1733,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17b3,
- 0x17b6, 0x17c8,
- 0x17d7, 0x17d7,
- 0x17dc, 0x17dc,
- 0x17e0, 0x17e9,
- 0x1810, 0x1819,
- 0x1820, 0x1877,
- 0x1880, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191c,
- 0x1920, 0x192b,
- 0x1930, 0x1938,
- 0x1946, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x19d0, 0x19d9,
- 0x1a00, 0x1a1b,
- 0x1a20, 0x1a5e,
- 0x1a61, 0x1a74,
- 0x1a80, 0x1a89,
- 0x1a90, 0x1a99,
- 0x1aa7, 0x1aa7,
- 0x1b00, 0x1b33,
- 0x1b35, 0x1b43,
- 0x1b45, 0x1b4b,
- 0x1b50, 0x1b59,
- 0x1b80, 0x1ba9,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1be5,
- 0x1be7, 0x1bf1,
- 0x1c00, 0x1c35,
- 0x1c40, 0x1c49,
- 0x1c4d, 0x1c7d,
- 0x1ce9, 0x1cec,
- 0x1cee, 0x1cf2,
- 0x1d00, 0x1dbf,
- 0x1e00, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fbc,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fcc,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fe0, 0x1fec,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffc,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x209c,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x212f, 0x2139,
- 0x213c, 0x213f,
- 0x2145, 0x2149,
- 0x214e, 0x214e,
- 0x2160, 0x2188,
- 0x24b6, 0x24e9,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2ce4,
- 0x2ceb, 0x2cee,
- 0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
- 0x2d6f, 0x2d6f,
- 0x2d80, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2de0, 0x2dff,
- 0x2e2f, 0x2e2f,
- 0x3005, 0x3007,
- 0x3021, 0x3029,
- 0x3031, 0x3035,
- 0x3038, 0x303c,
- 0x3041, 0x3096,
- 0x309d, 0x309f,
- 0x30a1, 0x30fa,
- 0x30fc, 0x30ff,
- 0x3105, 0x312d,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa62b,
- 0xa640, 0xa66e,
- 0xa67f, 0xa697,
- 0xa6a0, 0xa6ef,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa801,
- 0xa803, 0xa805,
- 0xa807, 0xa80a,
- 0xa80c, 0xa827,
- 0xa840, 0xa873,
- 0xa880, 0xa8c3,
- 0xa8d0, 0xa8d9,
- 0xa8f2, 0xa8f7,
- 0xa8fb, 0xa8fb,
- 0xa900, 0xa92a,
- 0xa930, 0xa952,
- 0xa960, 0xa97c,
- 0xa980, 0xa9b2,
- 0xa9b4, 0xa9bf,
- 0xa9cf, 0xa9d9,
- 0xaa00, 0xaa36,
- 0xaa40, 0xaa4d,
- 0xaa50, 0xaa59,
- 0xaa60, 0xaa76,
- 0xaa7a, 0xaa7a,
- 0xaa80, 0xaabe,
- 0xaac0, 0xaac0,
- 0xaac2, 0xaac2,
- 0xaadb, 0xaadd,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xabc0, 0xabea,
- 0xabf0, 0xabf9,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb28,
- 0xfb2a, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3d,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfb,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xff10, 0xff19,
- 0xff21, 0xff3a,
- 0xff41, 0xff5a,
- 0xff66, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10140, 0x10174,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x10300, 0x1031e,
- 0x10330, 0x1034a,
- 0x10380, 0x1039d,
- 0x103a0, 0x103c3,
- 0x103c8, 0x103cf,
- 0x103d1, 0x103d5,
- 0x10400, 0x1049d,
- 0x104a0, 0x104a9,
- 0x10800, 0x10805,
- 0x10808, 0x10808,
- 0x1080a, 0x10835,
- 0x10837, 0x10838,
- 0x1083c, 0x1083c,
- 0x1083f, 0x10855,
- 0x10900, 0x10915,
- 0x10920, 0x10939,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x10a60, 0x10a7c,
- 0x10b00, 0x10b35,
- 0x10b40, 0x10b55,
- 0x10b60, 0x10b72,
- 0x10c00, 0x10c48,
- 0x11000, 0x11045,
- 0x11066, 0x1106f,
- 0x11082, 0x110b8,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x13000, 0x1342e,
- 0x16800, 0x16a38,
- 0x1b000, 0x1b001,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d6c0,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6fa,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d734,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d76e,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d7a8,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7cb,
- 0x1d7ce, 0x1d7ff,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2f800, 0x2fa1d,
-}; /* CR_Alnum */
+/* 'In_Supplementary_Private_Use_Area_A': Block */
+static const OnigCodePoint CR_In_Supplementary_Private_Use_Area_A[] = {
+ 1,
+ 0xf0000, 0xfffff,
+}; /* CR_In_Supplementary_Private_Use_Area_A */
-/* 'ASCII': [[:ASCII:]] */
-static const OnigCodePoint CR_ASCII[] = {
+/* 'In_Supplementary_Private_Use_Area_B': Block */
+static const OnigCodePoint CR_In_Supplementary_Private_Use_Area_B[] = {
1,
- 0x0000, 0x007f,
-}; /* CR_ASCII */
+ 0x100000, 0x10ffff,
+}; /* CR_In_Supplementary_Private_Use_Area_B */
+
+/* 'In_No_Block': Block */
+static const OnigCodePoint CR_In_No_Block[] = {
+ 36,
+ 0x0860, 0x089f,
+ 0x1ab0, 0x1aff,
+ 0x1c80, 0x1cbf,
+ 0x2fe0, 0x2fef,
+ 0xa9e0, 0xa9ff,
+ 0xab30, 0xabbf,
+ 0x10200, 0x1027f,
+ 0x102e0, 0x102ff,
+ 0x10350, 0x1037f,
+ 0x103e0, 0x103ff,
+ 0x104b0, 0x107ff,
+ 0x10860, 0x108ff,
+ 0x10940, 0x1097f,
+ 0x10a80, 0x10aff,
+ 0x10b80, 0x10bff,
+ 0x10c50, 0x10e5f,
+ 0x10e80, 0x10fff,
+ 0x11150, 0x1117f,
+ 0x111e0, 0x1167f,
+ 0x116d0, 0x11fff,
+ 0x12480, 0x12fff,
+ 0x13430, 0x167ff,
+ 0x16a40, 0x16eff,
+ 0x16fa0, 0x1afff,
+ 0x1b100, 0x1cfff,
+ 0x1d250, 0x1d2ff,
+ 0x1d380, 0x1d3ff,
+ 0x1d800, 0x1edff,
+ 0x1ef00, 0x1efff,
+ 0x1f650, 0x1f67f,
+ 0x1f780, 0x1ffff,
+ 0x2a6e0, 0x2a6ff,
+ 0x2b820, 0x2f7ff,
+ 0x2fa20, 0xdffff,
+ 0xe0080, 0xe00ff,
+ 0xe01f0, 0xeffff,
+}; /* CR_In_No_Block */
+#endif /* USE_UNICODE_PROPERTIES */
static const OnigCodePoint* const CodeRanges[] = {
CR_NEWLINE,
@@ -21945,6 +25484,7 @@ static const OnigCodePoint* const CodeRanges[] = {
CR_Co,
CR_Cs,
CR_L,
+ CR_LC,
CR_Ll,
CR_Lm,
CR_Lo,
@@ -22089,6 +25629,13 @@ static const OnigCodePoint* const CodeRanges[] = {
CR_Batak,
CR_Brahmi,
CR_Mandaic,
+ CR_Chakma,
+ CR_Meroitic_Cursive,
+ CR_Meroitic_Hieroglyphs,
+ CR_Miao,
+ CR_Sharada,
+ CR_Sora_Sompeng,
+ CR_Takri,
CR_White_Space,
CR_Bidi_Control,
CR_Join_Control,
@@ -22134,6 +25681,228 @@ static const OnigCodePoint* const CodeRanges[] = {
CR_Age_5_1,
CR_Age_5_2,
CR_Age_6_0,
+ CR_Age_6_1,
+ CR_In_Basic_Latin,
+ CR_In_Latin_1_Supplement,
+ CR_In_Latin_Extended_A,
+ CR_In_Latin_Extended_B,
+ CR_In_IPA_Extensions,
+ CR_In_Spacing_Modifier_Letters,
+ CR_In_Combining_Diacritical_Marks,
+ CR_In_Greek_and_Coptic,
+ CR_In_Cyrillic,
+ CR_In_Cyrillic_Supplement,
+ CR_In_Armenian,
+ CR_In_Hebrew,
+ CR_In_Arabic,
+ CR_In_Syriac,
+ CR_In_Arabic_Supplement,
+ CR_In_Thaana,
+ CR_In_NKo,
+ CR_In_Samaritan,
+ CR_In_Mandaic,
+ CR_In_Arabic_Extended_A,
+ CR_In_Devanagari,
+ CR_In_Bengali,
+ CR_In_Gurmukhi,
+ CR_In_Gujarati,
+ CR_In_Oriya,
+ CR_In_Tamil,
+ CR_In_Telugu,
+ CR_In_Kannada,
+ CR_In_Malayalam,
+ CR_In_Sinhala,
+ CR_In_Thai,
+ CR_In_Lao,
+ CR_In_Tibetan,
+ CR_In_Myanmar,
+ CR_In_Georgian,
+ CR_In_Hangul_Jamo,
+ CR_In_Ethiopic,
+ CR_In_Ethiopic_Supplement,
+ CR_In_Cherokee,
+ CR_In_Unified_Canadian_Aboriginal_Syllabics,
+ CR_In_Ogham,
+ CR_In_Runic,
+ CR_In_Tagalog,
+ CR_In_Hanunoo,
+ CR_In_Buhid,
+ CR_In_Tagbanwa,
+ CR_In_Khmer,
+ CR_In_Mongolian,
+ CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended,
+ CR_In_Limbu,
+ CR_In_Tai_Le,
+ CR_In_New_Tai_Lue,
+ CR_In_Khmer_Symbols,
+ CR_In_Buginese,
+ CR_In_Tai_Tham,
+ CR_In_Balinese,
+ CR_In_Sundanese,
+ CR_In_Batak,
+ CR_In_Lepcha,
+ CR_In_Ol_Chiki,
+ CR_In_Sundanese_Supplement,
+ CR_In_Vedic_Extensions,
+ CR_In_Phonetic_Extensions,
+ CR_In_Phonetic_Extensions_Supplement,
+ CR_In_Combining_Diacritical_Marks_Supplement,
+ CR_In_Latin_Extended_Additional,
+ CR_In_Greek_Extended,
+ CR_In_General_Punctuation,
+ CR_In_Superscripts_and_Subscripts,
+ CR_In_Currency_Symbols,
+ CR_In_Combining_Diacritical_Marks_for_Symbols,
+ CR_In_Letterlike_Symbols,
+ CR_In_Number_Forms,
+ CR_In_Arrows,
+ CR_In_Mathematical_Operators,
+ CR_In_Miscellaneous_Technical,
+ CR_In_Control_Pictures,
+ CR_In_Optical_Character_Recognition,
+ CR_In_Enclosed_Alphanumerics,
+ CR_In_Box_Drawing,
+ CR_In_Block_Elements,
+ CR_In_Geometric_Shapes,
+ CR_In_Miscellaneous_Symbols,
+ CR_In_Dingbats,
+ CR_In_Miscellaneous_Mathematical_Symbols_A,
+ CR_In_Supplemental_Arrows_A,
+ CR_In_Braille_Patterns,
+ CR_In_Supplemental_Arrows_B,
+ CR_In_Miscellaneous_Mathematical_Symbols_B,
+ CR_In_Supplemental_Mathematical_Operators,
+ CR_In_Miscellaneous_Symbols_and_Arrows,
+ CR_In_Glagolitic,
+ CR_In_Latin_Extended_C,
+ CR_In_Coptic,
+ CR_In_Georgian_Supplement,
+ CR_In_Tifinagh,
+ CR_In_Ethiopic_Extended,
+ CR_In_Cyrillic_Extended_A,
+ CR_In_Supplemental_Punctuation,
+ CR_In_CJK_Radicals_Supplement,
+ CR_In_Kangxi_Radicals,
+ CR_In_Ideographic_Description_Characters,
+ CR_In_CJK_Symbols_and_Punctuation,
+ CR_In_Hiragana,
+ CR_In_Katakana,
+ CR_In_Bopomofo,
+ CR_In_Hangul_Compatibility_Jamo,
+ CR_In_Kanbun,
+ CR_In_Bopomofo_Extended,
+ CR_In_CJK_Strokes,
+ CR_In_Katakana_Phonetic_Extensions,
+ CR_In_Enclosed_CJK_Letters_and_Months,
+ CR_In_CJK_Compatibility,
+ CR_In_CJK_Unified_Ideographs_Extension_A,
+ CR_In_Yijing_Hexagram_Symbols,
+ CR_In_CJK_Unified_Ideographs,
+ CR_In_Yi_Syllables,
+ CR_In_Yi_Radicals,
+ CR_In_Lisu,
+ CR_In_Vai,
+ CR_In_Cyrillic_Extended_B,
+ CR_In_Bamum,
+ CR_In_Modifier_Tone_Letters,
+ CR_In_Latin_Extended_D,
+ CR_In_Syloti_Nagri,
+ CR_In_Common_Indic_Number_Forms,
+ CR_In_Phags_pa,
+ CR_In_Saurashtra,
+ CR_In_Devanagari_Extended,
+ CR_In_Kayah_Li,
+ CR_In_Rejang,
+ CR_In_Hangul_Jamo_Extended_A,
+ CR_In_Javanese,
+ CR_In_Cham,
+ CR_In_Myanmar_Extended_A,
+ CR_In_Tai_Viet,
+ CR_In_Meetei_Mayek_Extensions,
+ CR_In_Ethiopic_Extended_A,
+ CR_In_Meetei_Mayek,
+ CR_In_Hangul_Syllables,
+ CR_In_Hangul_Jamo_Extended_B,
+ CR_In_High_Surrogates,
+ CR_In_High_Private_Use_Surrogates,
+ CR_In_Low_Surrogates,
+ CR_In_Private_Use_Area,
+ CR_In_CJK_Compatibility_Ideographs,
+ CR_In_Alphabetic_Presentation_Forms,
+ CR_In_Arabic_Presentation_Forms_A,
+ CR_In_Variation_Selectors,
+ CR_In_Vertical_Forms,
+ CR_In_Combining_Half_Marks,
+ CR_In_CJK_Compatibility_Forms,
+ CR_In_Small_Form_Variants,
+ CR_In_Arabic_Presentation_Forms_B,
+ CR_In_Halfwidth_and_Fullwidth_Forms,
+ CR_In_Specials,
+ CR_In_Linear_B_Syllabary,
+ CR_In_Linear_B_Ideograms,
+ CR_In_Aegean_Numbers,
+ CR_In_Ancient_Greek_Numbers,
+ CR_In_Ancient_Symbols,
+ CR_In_Phaistos_Disc,
+ CR_In_Lycian,
+ CR_In_Carian,
+ CR_In_Old_Italic,
+ CR_In_Gothic,
+ CR_In_Ugaritic,
+ CR_In_Old_Persian,
+ CR_In_Deseret,
+ CR_In_Shavian,
+ CR_In_Osmanya,
+ CR_In_Cypriot_Syllabary,
+ CR_In_Imperial_Aramaic,
+ CR_In_Phoenician,
+ CR_In_Lydian,
+ CR_In_Meroitic_Hieroglyphs,
+ CR_In_Meroitic_Cursive,
+ CR_In_Kharoshthi,
+ CR_In_Old_South_Arabian,
+ CR_In_Avestan,
+ CR_In_Inscriptional_Parthian,
+ CR_In_Inscriptional_Pahlavi,
+ CR_In_Old_Turkic,
+ CR_In_Rumi_Numeral_Symbols,
+ CR_In_Brahmi,
+ CR_In_Kaithi,
+ CR_In_Sora_Sompeng,
+ CR_In_Chakma,
+ CR_In_Sharada,
+ CR_In_Takri,
+ CR_In_Cuneiform,
+ CR_In_Cuneiform_Numbers_and_Punctuation,
+ CR_In_Egyptian_Hieroglyphs,
+ CR_In_Bamum_Supplement,
+ CR_In_Miao,
+ CR_In_Kana_Supplement,
+ CR_In_Byzantine_Musical_Symbols,
+ CR_In_Musical_Symbols,
+ CR_In_Ancient_Greek_Musical_Notation,
+ CR_In_Tai_Xuan_Jing_Symbols,
+ CR_In_Counting_Rod_Numerals,
+ CR_In_Mathematical_Alphanumeric_Symbols,
+ CR_In_Arabic_Mathematical_Alphabetic_Symbols,
+ CR_In_Mahjong_Tiles,
+ CR_In_Domino_Tiles,
+ CR_In_Playing_Cards,
+ CR_In_Enclosed_Alphanumeric_Supplement,
+ CR_In_Enclosed_Ideographic_Supplement,
+ CR_In_Miscellaneous_Symbols_And_Pictographs,
+ CR_In_Emoticons,
+ CR_In_Transport_And_Map_Symbols,
+ CR_In_Alchemical_Symbols,
+ CR_In_CJK_Unified_Ideographs_Extension_B,
+ CR_In_CJK_Unified_Ideographs_Extension_C,
+ CR_In_CJK_Unified_Ideographs_Extension_D,
+ CR_In_CJK_Compatibility_Ideographs_Supplement,
+ CR_In_Tags,
+ CR_In_Variation_Selectors_Supplement,
+ CR_In_Supplementary_Private_Use_Area_A,
+ CR_In_Supplementary_Private_Use_Area_B,
+ CR_In_No_Block,
#endif /* USE_UNICODE_PROPERTIES */
};
struct uniname2ctype_struct {
@@ -22144,7 +25913,6 @@ static const struct uniname2ctype_struct *uniname2ctype_p(const char *, unsigned
%}
struct uniname2ctype_struct;
%%
-newline, 0
alpha, 1
blank, 2
cntrl, 3
@@ -22169,225 +25937,233 @@ cn, 20
co, 21
cs, 22
l, 23
-ll, 24
-lm, 25
-lo, 26
-lt, 27
-lu, 28
-m, 29
-mc, 30
-me, 31
-mn, 32
-n, 33
-nd, 34
-nl, 35
-no, 36
-p, 37
-pc, 38
-pd, 39
-pe, 40
-pf, 41
-pi, 42
-po, 43
-ps, 44
-s, 45
-sc, 46
-sk, 47
-sm, 48
-so, 49
-z, 50
-zl, 51
-zp, 52
-zs, 53
-math, 54
-alphabetic, 55
-lowercase, 56
-uppercase, 57
-cased, 58
-caseignorable, 59
-changeswhenlowercased, 60
-changeswhenuppercased, 61
-changeswhentitlecased, 62
-changeswhencasefolded, 63
-changeswhencasemapped, 64
-idstart, 65
-idcontinue, 66
-xidstart, 67
-xidcontinue, 68
-defaultignorablecodepoint, 69
-graphemeextend, 70
-graphemebase, 71
-graphemelink, 72
-common, 73
-latin, 74
-greek, 75
-cyrillic, 76
-armenian, 77
-hebrew, 78
-arabic, 79
-syriac, 80
-thaana, 81
-devanagari, 82
-bengali, 83
-gurmukhi, 84
-gujarati, 85
-oriya, 86
-tamil, 87
-telugu, 88
-kannada, 89
-malayalam, 90
-sinhala, 91
-thai, 92
-lao, 93
-tibetan, 94
-myanmar, 95
-georgian, 96
-hangul, 97
-ethiopic, 98
-cherokee, 99
-canadianaboriginal, 100
-ogham, 101
-runic, 102
-khmer, 103
-mongolian, 104
-hiragana, 105
-katakana, 106
-bopomofo, 107
-han, 108
-yi, 109
-olditalic, 110
-gothic, 111
-deseret, 112
-inherited, 113
-tagalog, 114
-hanunoo, 115
-buhid, 116
-tagbanwa, 117
-limbu, 118
-taile, 119
-linearb, 120
-ugaritic, 121
-shavian, 122
-osmanya, 123
-cypriot, 124
-braille, 125
-buginese, 126
-coptic, 127
-newtailue, 128
-glagolitic, 129
-tifinagh, 130
-sylotinagri, 131
-oldpersian, 132
-kharoshthi, 133
-balinese, 134
-cuneiform, 135
-phoenician, 136
-phagspa, 137
-nko, 138
-sundanese, 139
-lepcha, 140
-olchiki, 141
-vai, 142
-saurashtra, 143
-kayahli, 144
-rejang, 145
-lycian, 146
-carian, 147
-lydian, 148
-cham, 149
-taitham, 150
-taiviet, 151
-avestan, 152
-egyptianhieroglyphs, 153
-samaritan, 154
-lisu, 155
-bamum, 156
-javanese, 157
-meeteimayek, 158
-imperialaramaic, 159
-oldsoutharabian, 160
-inscriptionalparthian, 161
-inscriptionalpahlavi, 162
-oldturkic, 163
-kaithi, 164
-batak, 165
-brahmi, 166
-mandaic, 167
-whitespace, 168
-bidicontrol, 169
-joincontrol, 170
-dash, 171
-hyphen, 172
-quotationmark, 173
-terminalpunctuation, 174
-othermath, 175
-hexdigit, 176
-asciihexdigit, 177
-otheralphabetic, 178
-ideographic, 179
-diacritic, 180
-extender, 181
-otherlowercase, 182
-otheruppercase, 183
-noncharactercodepoint, 184
-othergraphemeextend, 185
-idsbinaryoperator, 186
-idstrinaryoperator, 187
-radical, 188
-unifiedideograph, 189
-otherdefaultignorablecodepoint, 190
-deprecated, 191
-softdotted, 192
-logicalorderexception, 193
-otheridstart, 194
-otheridcontinue, 195
-sterm, 196
-variationselector, 197
-patternwhitespace, 198
-patternsyntax, 199
-unknown, 200
-ahex, 177
-bidic, 169
-ci, 59
-cwcf, 63
-cwcm, 64
-cwl, 60
-cwt, 62
-cwu, 61
-dep, 191
-di, 69
-dia, 180
-ext, 181
-grbase, 71
-grext, 70
-grlink, 72
-hex, 176
-idc, 66
-ideo, 179
-ids, 65
-idsb, 186
-idst, 187
-joinc, 170
-loe, 193
-nchar, 184
-oalpha, 178
-odi, 190
-ogrext, 185
-oidc, 195
-oids, 194
-olower, 182
-omath, 175
-oupper, 183
-patsyn, 199
-patws, 198
-qmark, 173
-sd, 192
-term, 174
-uideo, 189
-vs, 197
-wspace, 168
-xidc, 68
-xids, 67
+lc, 24
+ll, 25
+lm, 26
+lo, 27
+lt, 28
+lu, 29
+m, 30
+mc, 31
+me, 32
+mn, 33
+n, 34
+nd, 35
+nl, 36
+no, 37
+p, 38
+pc, 39
+pd, 40
+pe, 41
+pf, 42
+pi, 43
+po, 44
+ps, 45
+s, 46
+sc, 47
+sk, 48
+sm, 49
+so, 50
+z, 51
+zl, 52
+zp, 53
+zs, 54
+math, 55
+alphabetic, 56
+lowercase, 57
+uppercase, 58
+cased, 59
+caseignorable, 60
+changeswhenlowercased, 61
+changeswhenuppercased, 62
+changeswhentitlecased, 63
+changeswhencasefolded, 64
+changeswhencasemapped, 65
+idstart, 66
+idcontinue, 67
+xidstart, 68
+xidcontinue, 69
+defaultignorablecodepoint, 70
+graphemeextend, 71
+graphemebase, 72
+graphemelink, 73
+common, 74
+latin, 75
+greek, 76
+cyrillic, 77
+armenian, 78
+hebrew, 79
+arabic, 80
+syriac, 81
+thaana, 82
+devanagari, 83
+bengali, 84
+gurmukhi, 85
+gujarati, 86
+oriya, 87
+tamil, 88
+telugu, 89
+kannada, 90
+malayalam, 91
+sinhala, 92
+thai, 93
+lao, 94
+tibetan, 95
+myanmar, 96
+georgian, 97
+hangul, 98
+ethiopic, 99
+cherokee, 100
+canadianaboriginal, 101
+ogham, 102
+runic, 103
+khmer, 104
+mongolian, 105
+hiragana, 106
+katakana, 107
+bopomofo, 108
+han, 109
+yi, 110
+olditalic, 111
+gothic, 112
+deseret, 113
+inherited, 114
+tagalog, 115
+hanunoo, 116
+buhid, 117
+tagbanwa, 118
+limbu, 119
+taile, 120
+linearb, 121
+ugaritic, 122
+shavian, 123
+osmanya, 124
+cypriot, 125
+braille, 126
+buginese, 127
+coptic, 128
+newtailue, 129
+glagolitic, 130
+tifinagh, 131
+sylotinagri, 132
+oldpersian, 133
+kharoshthi, 134
+balinese, 135
+cuneiform, 136
+phoenician, 137
+phagspa, 138
+nko, 139
+sundanese, 140
+lepcha, 141
+olchiki, 142
+vai, 143
+saurashtra, 144
+kayahli, 145
+rejang, 146
+lycian, 147
+carian, 148
+lydian, 149
+cham, 150
+taitham, 151
+taiviet, 152
+avestan, 153
+egyptianhieroglyphs, 154
+samaritan, 155
+lisu, 156
+bamum, 157
+javanese, 158
+meeteimayek, 159
+imperialaramaic, 160
+oldsoutharabian, 161
+inscriptionalparthian, 162
+inscriptionalpahlavi, 163
+oldturkic, 164
+kaithi, 165
+batak, 166
+brahmi, 167
+mandaic, 168
+chakma, 169
+meroiticcursive, 170
+meroitichieroglyphs, 171
+miao, 172
+sharada, 173
+sorasompeng, 174
+takri, 175
+whitespace, 176
+bidicontrol, 177
+joincontrol, 178
+dash, 179
+hyphen, 180
+quotationmark, 181
+terminalpunctuation, 182
+othermath, 183
+hexdigit, 184
+asciihexdigit, 185
+otheralphabetic, 186
+ideographic, 187
+diacritic, 188
+extender, 189
+otherlowercase, 190
+otheruppercase, 191
+noncharactercodepoint, 192
+othergraphemeextend, 193
+idsbinaryoperator, 194
+idstrinaryoperator, 195
+radical, 196
+unifiedideograph, 197
+otherdefaultignorablecodepoint, 198
+deprecated, 199
+softdotted, 200
+logicalorderexception, 201
+otheridstart, 202
+otheridcontinue, 203
+sterm, 204
+variationselector, 205
+patternwhitespace, 206
+patternsyntax, 207
+unknown, 208
+ahex, 185
+bidic, 177
+ci, 60
+cwcf, 64
+cwcm, 65
+cwl, 61
+cwt, 63
+cwu, 62
+dep, 199
+di, 70
+dia, 188
+ext, 189
+grbase, 72
+grext, 71
+grlink, 73
+hex, 184
+idc, 67
+ideo, 187
+ids, 66
+idsb, 194
+idst, 195
+joinc, 178
+loe, 201
+nchar, 192
+oalpha, 186
+odi, 198
+ogrext, 193
+oidc, 203
+oids, 202
+olower, 190
+omath, 183
+oupper, 191
+patsyn, 207
+patws, 206
+qmark, 181
+sd, 200
+term, 182
+uideo, 197
+vs, 205
+wspace, 176
+xidc, 69
+xids, 68
other, 17
control, 18
format, 19
@@ -22395,143 +26171,374 @@ unassigned, 20
privateuse, 21
surrogate, 22
letter, 23
-lowercaseletter, 24
-modifierletter, 25
-otherletter, 26
-titlecaseletter, 27
-uppercaseletter, 28
-mark, 29
-spacingmark, 30
-enclosingmark, 31
-nonspacingmark, 32
-number, 33
-decimalnumber, 34
-letternumber, 35
-othernumber, 36
-punctuation, 37
-connectorpunctuation, 38
-dashpunctuation, 39
-closepunctuation, 40
-finalpunctuation, 41
-initialpunctuation, 42
-otherpunctuation, 43
-openpunctuation, 44
-symbol, 45
-currencysymbol, 46
-modifiersymbol, 47
-mathsymbol, 48
-othersymbol, 49
-separator, 50
-lineseparator, 51
-paragraphseparator, 52
-spaceseparator, 53
-arab, 79
-armi, 159
-armn, 77
-avst, 152
-bali, 134
-bamu, 156
-batk, 165
-beng, 83
-bopo, 107
-brah, 166
-brai, 125
-bugi, 126
-buhd, 116
-cans, 100
-cari, 147
-cher, 99
-copt, 127
-qaac, 127
-cprt, 124
-cyrl, 76
-deva, 82
-dsrt, 112
-egyp, 153
-ethi, 98
-geor, 96
-glag, 129
-goth, 111
-grek, 75
-gujr, 85
-guru, 84
-hang, 97
-hani, 108
-hano, 115
-hebr, 78
-hira, 105
-ital, 110
-java, 157
-kali, 144
-kana, 106
-khar, 133
-khmr, 103
-knda, 89
-kthi, 164
-lana, 150
-laoo, 93
-latn, 74
-lepc, 140
-limb, 118
-linb, 120
-lyci, 146
-lydi, 148
-mand, 167
-mlym, 90
-mong, 104
-mtei, 158
-mymr, 95
-nkoo, 138
-ogam, 101
-olck, 141
-orkh, 163
-orya, 86
-osma, 123
-phag, 137
-phli, 162
-phnx, 136
-prti, 161
-rjng, 145
-runr, 102
-samr, 154
-sarb, 160
-saur, 143
-shaw, 122
-sinh, 91
-sund, 139
-sylo, 131
-syrc, 80
-tagb, 117
-tale, 119
-talu, 128
-taml, 87
-tavt, 151
-telu, 88
-tfng, 130
-tglg, 114
-thaa, 81
-tibt, 94
-ugar, 121
-vaii, 142
-xpeo, 132
-xsux, 135
-yiii, 109
-zinh, 113
-qaai, 113
-zyyy, 73
-zzzz, 200
-age=1.1, 201
-age=2.0, 202
-age=2.1, 203
-age=3.0, 204
-age=3.1, 205
-age=3.2, 206
-age=4.0, 207
-age=4.1, 208
-age=5.0, 209
-age=5.1, 210
-age=5.2, 211
-age=6.0, 212
+casedletter, 24
+lowercaseletter, 25
+modifierletter, 26
+otherletter, 27
+titlecaseletter, 28
+uppercaseletter, 29
+mark, 30
+combiningmark, 30
+spacingmark, 31
+enclosingmark, 32
+nonspacingmark, 33
+number, 34
+decimalnumber, 35
+letternumber, 36
+othernumber, 37
+punctuation, 38
+connectorpunctuation, 39
+dashpunctuation, 40
+closepunctuation, 41
+finalpunctuation, 42
+initialpunctuation, 43
+otherpunctuation, 44
+openpunctuation, 45
+symbol, 46
+currencysymbol, 47
+modifiersymbol, 48
+mathsymbol, 49
+othersymbol, 50
+separator, 51
+lineseparator, 52
+paragraphseparator, 53
+spaceseparator, 54
+arab, 80
+armi, 160
+armn, 78
+avst, 153
+bali, 135
+bamu, 157
+batk, 166
+beng, 84
+bopo, 108
+brah, 167
+brai, 126
+bugi, 127
+buhd, 117
+cakm, 169
+cans, 101
+cari, 148
+cher, 100
+copt, 128
+qaac, 128
+cprt, 125
+cyrl, 77
+deva, 83
+dsrt, 113
+egyp, 154
+ethi, 99
+geor, 97
+glag, 130
+goth, 112
+grek, 76
+gujr, 86
+guru, 85
+hang, 98
+hani, 109
+hano, 116
+hebr, 79
+hira, 106
+ital, 111
+java, 158
+kali, 145
+kana, 107
+khar, 134
+khmr, 104
+knda, 90
+kthi, 165
+lana, 151
+laoo, 94
+latn, 75
+lepc, 141
+limb, 119
+linb, 121
+lyci, 147
+lydi, 149
+mand, 168
+merc, 170
+mero, 171
+mlym, 91
+mong, 105
+mtei, 159
+mymr, 96
+nkoo, 139
+ogam, 102
+olck, 142
+orkh, 164
+orya, 87
+osma, 124
+phag, 138
+phli, 163
+phnx, 137
+plrd, 172
+prti, 162
+rjng, 146
+runr, 103
+samr, 155
+sarb, 161
+saur, 144
+shaw, 123
+shrd, 173
+sinh, 92
+sora, 174
+sund, 140
+sylo, 132
+syrc, 81
+tagb, 118
+takr, 175
+tale, 120
+talu, 129
+taml, 88
+tavt, 152
+telu, 89
+tfng, 131
+tglg, 115
+thaa, 82
+tibt, 95
+ugar, 122
+vaii, 143
+xpeo, 133
+xsux, 136
+yiii, 110
+zinh, 114
+qaai, 114
+zyyy, 74
+zzzz, 208
+age=1.1, 209
+age=2.0, 210
+age=2.1, 211
+age=3.0, 212
+age=3.1, 213
+age=3.2, 214
+age=4.0, 215
+age=4.1, 216
+age=5.0, 217
+age=5.1, 218
+age=5.2, 219
+age=6.0, 220
+age=6.1, 221
+inbasiclatin, 222
+inlatin1supplement, 223
+inlatinextendeda, 224
+inlatinextendedb, 225
+inipaextensions, 226
+inspacingmodifierletters, 227
+incombiningdiacriticalmarks, 228
+ingreekandcoptic, 229
+incyrillic, 230
+incyrillicsupplement, 231
+inarmenian, 232
+inhebrew, 233
+inarabic, 234
+insyriac, 235
+inarabicsupplement, 236
+inthaana, 237
+innko, 238
+insamaritan, 239
+inmandaic, 240
+inarabicextendeda, 241
+indevanagari, 242
+inbengali, 243
+ingurmukhi, 244
+ingujarati, 245
+inoriya, 246
+intamil, 247
+intelugu, 248
+inkannada, 249
+inmalayalam, 250
+insinhala, 251
+inthai, 252
+inlao, 253
+intibetan, 254
+inmyanmar, 255
+ingeorgian, 256
+inhanguljamo, 257
+inethiopic, 258
+inethiopicsupplement, 259
+incherokee, 260
+inunifiedcanadianaboriginalsyllabics, 261
+inogham, 262
+inrunic, 263
+intagalog, 264
+inhanunoo, 265
+inbuhid, 266
+intagbanwa, 267
+inkhmer, 268
+inmongolian, 269
+inunifiedcanadianaboriginalsyllabicsextended, 270
+inlimbu, 271
+intaile, 272
+innewtailue, 273
+inkhmersymbols, 274
+inbuginese, 275
+intaitham, 276
+inbalinese, 277
+insundanese, 278
+inbatak, 279
+inlepcha, 280
+inolchiki, 281
+insundanesesupplement, 282
+invedicextensions, 283
+inphoneticextensions, 284
+inphoneticextensionssupplement, 285
+incombiningdiacriticalmarkssupplement, 286
+inlatinextendedadditional, 287
+ingreekextended, 288
+ingeneralpunctuation, 289
+insuperscriptsandsubscripts, 290
+incurrencysymbols, 291
+incombiningdiacriticalmarksforsymbols, 292
+inletterlikesymbols, 293
+innumberforms, 294
+inarrows, 295
+inmathematicaloperators, 296
+inmiscellaneoustechnical, 297
+incontrolpictures, 298
+inopticalcharacterrecognition, 299
+inenclosedalphanumerics, 300
+inboxdrawing, 301
+inblockelements, 302
+ingeometricshapes, 303
+inmiscellaneoussymbols, 304
+indingbats, 305
+inmiscellaneousmathematicalsymbolsa, 306
+insupplementalarrowsa, 307
+inbraillepatterns, 308
+insupplementalarrowsb, 309
+inmiscellaneousmathematicalsymbolsb, 310
+insupplementalmathematicaloperators, 311
+inmiscellaneoussymbolsandarrows, 312
+inglagolitic, 313
+inlatinextendedc, 314
+incoptic, 315
+ingeorgiansupplement, 316
+intifinagh, 317
+inethiopicextended, 318
+incyrillicextendeda, 319
+insupplementalpunctuation, 320
+incjkradicalssupplement, 321
+inkangxiradicals, 322
+inideographicdescriptioncharacters, 323
+incjksymbolsandpunctuation, 324
+inhiragana, 325
+inkatakana, 326
+inbopomofo, 327
+inhangulcompatibilityjamo, 328
+inkanbun, 329
+inbopomofoextended, 330
+incjkstrokes, 331
+inkatakanaphoneticextensions, 332
+inenclosedcjklettersandmonths, 333
+incjkcompatibility, 334
+incjkunifiedideographsextensiona, 335
+inyijinghexagramsymbols, 336
+incjkunifiedideographs, 337
+inyisyllables, 338
+inyiradicals, 339
+inlisu, 340
+invai, 341
+incyrillicextendedb, 342
+inbamum, 343
+inmodifiertoneletters, 344
+inlatinextendedd, 345
+insylotinagri, 346
+incommonindicnumberforms, 347
+inphagspa, 348
+insaurashtra, 349
+indevanagariextended, 350
+inkayahli, 351
+inrejang, 352
+inhanguljamoextendeda, 353
+injavanese, 354
+incham, 355
+inmyanmarextendeda, 356
+intaiviet, 357
+inmeeteimayekextensions, 358
+inethiopicextendeda, 359
+inmeeteimayek, 360
+inhangulsyllables, 361
+inhanguljamoextendedb, 362
+inhighsurrogates, 363
+inhighprivateusesurrogates, 364
+inlowsurrogates, 365
+inprivateusearea, 366
+incjkcompatibilityideographs, 367
+inalphabeticpresentationforms, 368
+inarabicpresentationformsa, 369
+invariationselectors, 370
+inverticalforms, 371
+incombininghalfmarks, 372
+incjkcompatibilityforms, 373
+insmallformvariants, 374
+inarabicpresentationformsb, 375
+inhalfwidthandfullwidthforms, 376
+inspecials, 377
+inlinearbsyllabary, 378
+inlinearbideograms, 379
+inaegeannumbers, 380
+inancientgreeknumbers, 381
+inancientsymbols, 382
+inphaistosdisc, 383
+inlycian, 384
+incarian, 385
+inolditalic, 386
+ingothic, 387
+inugaritic, 388
+inoldpersian, 389
+indeseret, 390
+inshavian, 391
+inosmanya, 392
+incypriotsyllabary, 393
+inimperialaramaic, 394
+inphoenician, 395
+inlydian, 396
+inmeroitichieroglyphs, 397
+inmeroiticcursive, 398
+inkharoshthi, 399
+inoldsoutharabian, 400
+inavestan, 401
+ininscriptionalparthian, 402
+ininscriptionalpahlavi, 403
+inoldturkic, 404
+inruminumeralsymbols, 405
+inbrahmi, 406
+inkaithi, 407
+insorasompeng, 408
+inchakma, 409
+insharada, 410
+intakri, 411
+incuneiform, 412
+incuneiformnumbersandpunctuation, 413
+inegyptianhieroglyphs, 414
+inbamumsupplement, 415
+inmiao, 416
+inkanasupplement, 417
+inbyzantinemusicalsymbols, 418
+inmusicalsymbols, 419
+inancientgreekmusicalnotation, 420
+intaixuanjingsymbols, 421
+incountingrodnumerals, 422
+inmathematicalalphanumericsymbols, 423
+inarabicmathematicalalphabeticsymbols, 424
+inmahjongtiles, 425
+indominotiles, 426
+inplayingcards, 427
+inenclosedalphanumericsupplement, 428
+inenclosedideographicsupplement, 429
+inmiscellaneoussymbolsandpictographs, 430
+inemoticons, 431
+intransportandmapsymbols, 432
+inalchemicalsymbols, 433
+incjkunifiedideographsextensionb, 434
+incjkunifiedideographsextensionc, 435
+incjkunifiedideographsextensiond, 436
+incjkcompatibilityideographssupplement, 437
+intags, 438
+invariationselectorssupplement, 439
+insupplementaryprivateuseareaa, 440
+insupplementaryprivateuseareab, 441
+innoblock, 442
#endif /* USE_UNICODE_PROPERTIES */
%%
static int
diff --git a/enc/us_ascii.c b/enc/us_ascii.c
index 2e96dd3846..1b47778391 100644
--- a/enc/us_ascii.c
+++ b/enc/us_ascii.c
@@ -24,7 +24,9 @@ OnigEncodingDefine(us_ascii, US_ASCII) = {
onigenc_ascii_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match
+ onigenc_always_true_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
ENC_ALIAS("ASCII", "US-ASCII")
ENC_ALIAS("ANSI_X3.4-1968", "US-ASCII")
diff --git a/enc/utf_16_32.h b/enc/utf_16_32.h
index b028a1a12e..b232767ee3 100644
--- a/enc/utf_16_32.h
+++ b/enc/utf_16_32.h
@@ -1,4 +1,5 @@
#include "regenc.h"
/* dummy for unsupported, statefull encoding */
-ENC_DUMMY("UTF-16");
-ENC_DUMMY("UTF-32");
+#define ENC_DUMMY_UNICODE(name) ENC_DUMMY(name)
+ENC_DUMMY_UNICODE("UTF-16");
+ENC_DUMMY_UNICODE("UTF-32");
diff --git a/enc/utf_16be.c b/enc/utf_16be.c
index 1e33c2ec7d..8b25d473a7 100644
--- a/enc/utf_16be.c
+++ b/enc/utf_16be.c
@@ -88,11 +88,8 @@ utf16be_is_mbc_newline(const UChar* p, const UChar* end,
if (*(p+1) == 0x0a && *p == 0x00)
return 1;
#ifdef USE_UNICODE_ALL_LINE_TERMINATORS
- if ((
-#ifndef USE_CRNL_AS_LINE_TERMINATOR
- *(p+1) == 0x0d ||
-#endif
- *(p+1) == 0x85) && *p == 0x00)
+ if ((*(p+1) == 0x0b || *(p+1) == 0x0c || *(p+1) == 0x0d || *(p+1) == 0x85)
+ && *p == 0x00)
return 1;
if (*p == 0x20 && (*(p+1) == 0x29 || *(p+1) == 0x28))
return 1;
@@ -252,6 +249,8 @@ OnigEncodingDefine(utf_16be, UTF_16BE) = {
onigenc_unicode_is_code_ctype,
onigenc_utf16_32_get_ctype_code_range,
utf16be_left_adjust_char_head,
- onigenc_always_false_is_allowed_reverse_match
+ onigenc_always_false_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_UNICODE,
};
ENC_ALIAS("UCS-2BE", "UTF-16BE")
diff --git a/enc/utf_16le.c b/enc/utf_16le.c
index e972cb95f0..8feb7ad769 100644
--- a/enc/utf_16le.c
+++ b/enc/utf_16le.c
@@ -81,11 +81,8 @@ utf16le_is_mbc_newline(const UChar* p, const UChar* end,
if (*p == 0x0a && *(p+1) == 0x00)
return 1;
#ifdef USE_UNICODE_ALL_LINE_TERMINATORS
- if ((
-#ifndef USE_CRNL_AS_LINE_TERMINATOR
- *p == 0x0d ||
-#endif
- *p == 0x85) && *(p+1) == 0x00)
+ if ((*p == 0x0b || *p == 0x0c || *p == 0x0d || *p == 0x85)
+ && *(p+1) == 0x00)
return 1;
if (*(p+1) == 0x20 && (*p == 0x29 || *p == 0x28))
return 1;
@@ -245,5 +242,7 @@ OnigEncodingDefine(utf_16le, UTF_16LE) = {
onigenc_unicode_is_code_ctype,
onigenc_utf16_32_get_ctype_code_range,
utf16le_left_adjust_char_head,
- onigenc_always_false_is_allowed_reverse_match
+ onigenc_always_false_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_UNICODE,
};
diff --git a/enc/utf_32be.c b/enc/utf_32be.c
index 2671448d44..43c07e2e8f 100644
--- a/enc/utf_32be.c
+++ b/enc/utf_32be.c
@@ -44,11 +44,7 @@ utf32be_is_mbc_newline(const UChar* p, const UChar* end,
if (*(p+3) == 0x0a && *(p+2) == 0 && *(p+1) == 0 && *p == 0)
return 1;
#ifdef USE_UNICODE_ALL_LINE_TERMINATORS
- if ((
-#ifndef USE_CRNL_AS_LINE_TERMINATOR
- *(p+3) == 0x0d ||
-#endif
- *(p+3) == 0x85)
+ if ((*(p+3) == 0x0b || *(p+3) == 0x0c || *(p+3) == 0x0d || *(p+3) == 0x85)
&& *(p+2) == 0 && *(p+1) == 0 && *p == 0x00)
return 1;
if (*(p+2) == 0x20 && (*(p+3) == 0x29 || *(p+3) == 0x28)
@@ -159,7 +155,7 @@ utf32be_left_adjust_char_head(const UChar* start, const UChar* s, const UChar* e
if (s <= start) return (UChar* )s;
- rem = (s - start) % 4;
+ rem = (int )((s - start) % 4);
return (UChar* )(s - rem);
}
@@ -189,7 +185,9 @@ OnigEncodingDefine(utf_32be, UTF_32BE) = {
onigenc_unicode_is_code_ctype,
onigenc_utf16_32_get_ctype_code_range,
utf32be_left_adjust_char_head,
- onigenc_always_false_is_allowed_reverse_match
+ onigenc_always_false_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_UNICODE,
};
ENC_ALIAS("UCS-4BE", "UTF-32BE")
diff --git a/enc/utf_32le.c b/enc/utf_32le.c
index aa448200c6..31693eed05 100644
--- a/enc/utf_32le.c
+++ b/enc/utf_32le.c
@@ -44,11 +44,7 @@ utf32le_is_mbc_newline(const UChar* p, const UChar* end,
if (*p == 0x0a && *(p+1) == 0 && *(p+2) == 0 && *(p+3) == 0)
return 1;
#ifdef USE_UNICODE_ALL_LINE_TERMINATORS
- if ((
-#ifndef USE_CRNL_AS_LINE_TERMINATOR
- *p == 0x0d ||
-#endif
- *p == 0x85)
+ if ((*p == 0x0b ||*p == 0x0c ||*p == 0x0d || *p == 0x85)
&& *(p+1) == 0x00 && (p+2) == 0x00 && *(p+3) == 0x00)
return 1;
if (*(p+1) == 0x20 && (*p == 0x29 || *p == 0x28)
@@ -159,7 +155,7 @@ utf32le_left_adjust_char_head(const UChar* start, const UChar* s, const UChar* e
if (s <= start) return (UChar* )s;
- rem = (s - start) % 4;
+ rem = (int )((s - start) % 4);
return (UChar* )(s - rem);
}
@@ -189,6 +185,8 @@ OnigEncodingDefine(utf_32le, UTF_32LE) = {
onigenc_unicode_is_code_ctype,
onigenc_utf16_32_get_ctype_code_range,
utf32le_left_adjust_char_head,
- onigenc_always_false_is_allowed_reverse_match
+ onigenc_always_false_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_UNICODE,
};
ENC_ALIAS("UCS-4LE", "UTF-32LE")
diff --git a/enc/utf_8.c b/enc/utf_8.c
index 83f8701205..dae1f3a1bc 100644
--- a/enc/utf_8.c
+++ b/enc/utf_8.c
@@ -248,9 +248,7 @@ is_mbc_newline(const UChar* p, const UChar* end, OnigEncoding enc)
if (*p == 0x0a) return 1;
#ifdef USE_UNICODE_ALL_LINE_TERMINATORS
-#ifndef USE_CRNL_AS_LINE_TERMINATOR
- if (*p == 0x0d) return 1;
-#endif
+ if (*p == 0x0b || *p == 0x0c || *p == 0x0d) return 1;
if (p + 1 < end) {
if (*(p+1) == 0x85 && *p == 0xc2) /* U+0085 */
return 1;
@@ -272,7 +270,7 @@ mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
int c, len;
OnigCodePoint n;
- len = enclen(enc, p, end);
+ len = mbc_enc_len(p, end, enc);
c = *p++;
if (len > 1) {
len--;
@@ -363,7 +361,7 @@ code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc ARG_UNUSED)
}
*p++ = UTF8_TRAIL0(code);
- return (int)(p - buf);
+ return (int )(p - buf);
}
}
@@ -440,7 +438,9 @@ OnigEncodingDefine(utf_8, UTF_8) = {
onigenc_unicode_is_code_ctype,
get_ctype_code_range,
left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match
+ onigenc_always_true_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_UNICODE,
};
ENC_ALIAS("CP65001", "UTF-8")
diff --git a/enc/windows_1251.c b/enc/windows_1251.c
index 1cb4da4960..73060962c3 100644
--- a/enc/windows_1251.c
+++ b/enc/windows_1251.c
@@ -196,7 +196,9 @@ OnigEncodingDefine(windows_1251, Windows_1251) = {
cp1251_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match
+ onigenc_always_true_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
};
/*
* Name: windows-1251
diff --git a/enc/windows_31j.c b/enc/windows_31j.c
new file mode 100644
index 0000000000..c4193819d4
--- /dev/null
+++ b/enc/windows_31j.c
@@ -0,0 +1,80 @@
+/**********************************************************************
+ cp932.c - Onigmo (Oniguruma-mod) (regular expression library)
+**********************************************************************/
+/*-
+ * Copyright (c) 2002-2009 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2011 K.Takata <kentkt AT csc DOT jp>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#define ENC_CP932
+#include "shift_jis.c"
+
+OnigEncodingDefine(windows_31j, Windows_31J) = {
+ mbc_enc_len,
+ "Windows-31J", /* name */
+ 2, /* max byte length */
+ 1, /* min byte length */
+ onigenc_is_mbc_newline_0x0a,
+ mbc_to_code,
+ code_to_mbclen,
+ code_to_mbc,
+ mbc_case_fold,
+ apply_all_case_fold,
+ get_case_fold_codes_by_str,
+ property_name_to_ctype,
+ is_code_ctype,
+ get_ctype_code_range,
+ left_adjust_char_head,
+ is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_NONE,
+};
+/*
+ * Name: Windows-31J
+ * MIBenum: 2024
+ * Link: http://www.iana.org/assignments/character-sets
+ * Link: http://www.microsoft.com/globaldev/reference/dbcs/932.mspx
+ * Link: http://ja.wikipedia.org/wiki/Windows-31J
+ * Link: http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/windows-932-2000.ucm
+ *
+ * Windows Standard Character Set and its mapping to Unicode by Microsoft.
+ * Since 1.9.3, SJIS is the alias of Windows-31J because its character
+ * set is usually this one even if its mapping may differ.
+ */
+ENC_ALIAS("CP932", "Windows-31J")
+ENC_ALIAS("csWindows31J", "Windows-31J") /* IANA. IE6 don't accept Windows-31J but csWindows31J. */
+ENC_ALIAS("SJIS", "Windows-31J")
+
+/*
+ * Name: PCK
+ * Link: http://download.oracle.com/docs/cd/E19253-01/819-0606/x-2chn0/index.html
+ * Link: http://download.oracle.com/docs/cd/E19253-01/819-0606/appb-pckwarn-1/index.html
+ *
+ * Solaris's SJIS variant. Its set is Windows Standard Character Set; it
+ * consists JIS X 0201 Latin (US-ASCII), JIS X 0201 Katakana, JIS X 0208, NEC
+ * special characters, NEC-selected IBM extended characters, and IBM extended
+ * characters. Solaris's iconv seems to use SJIS-open.
+ */
+ENC_ALIAS("PCK", "Windows-31J")
diff --git a/encoding.c b/encoding.c
index 0b6bf96bc5..b9e820fa29 100644
--- a/encoding.c
+++ b/encoding.c
@@ -32,6 +32,7 @@ void rb_encdb_declare(const char *name);
int rb_encdb_replicate(const char *name, const char *orig);
int rb_encdb_dummy(const char *name);
int rb_encdb_alias(const char *alias, const char *orig);
+void rb_encdb_set_unicode(int index);
#pragma GCC visibility pop
#endif
@@ -159,8 +160,9 @@ rb_to_encoding_index(VALUE enc)
return rb_enc_find_index(StringValueCStr(enc));
}
-static rb_encoding *
-to_encoding(VALUE enc)
+/* Returns encoding index or UNSPECIFIED_ENCODING */
+static int
+str_find_encindex(VALUE enc)
{
int idx;
@@ -169,17 +171,40 @@ to_encoding(VALUE enc)
rb_raise(rb_eArgError, "invalid name encoding (non ASCII)");
}
idx = rb_enc_find_index(StringValueCStr(enc));
+ return idx;
+}
+
+static int
+str_to_encindex(VALUE enc)
+{
+ int idx = str_find_encindex(enc);
if (idx < 0) {
rb_raise(rb_eArgError, "unknown encoding name - %s", RSTRING_PTR(enc));
}
- return rb_enc_from_index(idx);
+ return idx;
+}
+
+static rb_encoding *
+str_to_encoding(VALUE enc)
+{
+ return rb_enc_from_index(str_to_encindex(enc));
}
rb_encoding *
rb_to_encoding(VALUE enc)
{
if (enc_check_encoding(enc) >= 0) return RDATA(enc)->data;
- return to_encoding(enc);
+ return str_to_encoding(enc);
+}
+
+rb_encoding *
+rb_find_encoding(VALUE enc)
+{
+ int idx;
+ if (enc_check_encoding(enc) >= 0) return RDATA(enc)->data;
+ idx = str_find_encindex(enc);
+ if (idx < 0) return NULL;
+ return rb_enc_from_index(idx);
}
void
@@ -433,8 +458,13 @@ enc_ascii_compatible_p(VALUE enc)
int
rb_enc_unicode_p(rb_encoding *enc)
{
- const char *name = rb_enc_name(enc);
- return name[0] == 'U' && name[1] == 'T' && name[2] == 'F' && name[4] != '7';
+ return ONIGENC_IS_UNICODE(enc);
+}
+
+static st_data_t
+enc_dup_name(st_data_t name)
+{
+ return (st_data_t)strdup((const char *)name);
}
/*
@@ -445,7 +475,7 @@ static int
enc_alias_internal(const char *alias, int idx)
{
return st_insert2(enc_table.names, (st_data_t)alias, (st_data_t)idx,
- (st_data_t(*)(st_data_t))strdup);
+ enc_dup_name);
}
static int
@@ -483,6 +513,12 @@ rb_encdb_alias(const char *alias, const char *orig)
return enc_alias(alias, idx);
}
+void
+rb_encdb_set_unicode(int index)
+{
+ rb_enc_from_index(index)->flags |= ONIGENC_FLAG_UNICODE;
+}
+
enum {
ENCINDEX_ASCII,
ENCINDEX_UTF_8,
@@ -536,7 +572,8 @@ rb_enc_registered(const char *name)
static VALUE
require_enc(VALUE enclib)
{
- return rb_require_safe(enclib, rb_safe_level());
+ int safe = rb_safe_level();
+ return rb_require_safe(enclib, safe > 3 ? 3 : safe);
}
static int
@@ -551,9 +588,10 @@ load_encoding(const char *name)
while (s < e) {
if (!ISALNUM(*s)) *s = '_';
- else if (ISUPPER(*s)) *s = TOLOWER(*s);
+ else if (ISUPPER(*s)) *s = (char)TOLOWER(*s);
++s;
}
+ FL_UNSET(enclib, FL_TAINT|FL_UNTRUSTED);
OBJ_FREEZE(enclib);
ruby_verbose = Qfalse;
ruby_debug = Qfalse;
@@ -590,6 +628,7 @@ enc_autoload(rb_encoding *enc)
return i;
}
+/* Return encoding index or UNSPECIFIED_ENCODING from encoding name */
int
rb_enc_find_index(const char *name)
{
@@ -749,6 +788,7 @@ rb_enc_compatible(VALUE str1, VALUE str2)
{
int idx1, idx2;
rb_encoding *enc1, *enc2;
+ int isstr1, isstr2;
idx1 = rb_enc_get_index(str1);
idx2 = rb_enc_get_index(str2);
@@ -762,33 +802,38 @@ rb_enc_compatible(VALUE str1, VALUE str2)
enc1 = rb_enc_from_index(idx1);
enc2 = rb_enc_from_index(idx2);
- if (BUILTIN_TYPE(str2) == T_STRING && RSTRING_LEN(str2) == 0)
+ isstr2 = RB_TYPE_P(str2, T_STRING);
+ if (isstr2 && RSTRING_LEN(str2) == 0)
return enc1;
- if (BUILTIN_TYPE(str1) == T_STRING && RSTRING_LEN(str1) == 0)
+ isstr1 = RB_TYPE_P(str1, T_STRING);
+ if (isstr1 && RSTRING_LEN(str1) == 0)
return (rb_enc_asciicompat(enc1) && rb_enc_str_asciionly_p(str2)) ? enc1 : enc2;
if (!rb_enc_asciicompat(enc1) || !rb_enc_asciicompat(enc2)) {
return 0;
}
/* objects whose encoding is the same of contents */
- if (BUILTIN_TYPE(str2) != T_STRING && idx2 == ENCINDEX_US_ASCII)
+ if (!isstr2 && idx2 == ENCINDEX_US_ASCII)
return enc1;
- if (BUILTIN_TYPE(str1) != T_STRING && idx1 == ENCINDEX_US_ASCII)
+ if (!isstr1 && idx1 == ENCINDEX_US_ASCII)
return enc2;
- if (BUILTIN_TYPE(str1) != T_STRING) {
+ if (!isstr1) {
VALUE tmp = str1;
int idx0 = idx1;
str1 = str2;
str2 = tmp;
idx1 = idx2;
idx2 = idx0;
+ idx0 = isstr1;
+ isstr1 = isstr2;
+ isstr2 = idx0;
}
- if (BUILTIN_TYPE(str1) == T_STRING) {
+ if (isstr1) {
int cr1, cr2;
cr1 = rb_enc_str_coderange(str1);
- if (BUILTIN_TYPE(str2) == T_STRING) {
+ if (isstr2) {
cr2 = rb_enc_str_coderange(str2);
if (cr1 != cr2) {
/* may need to handle ENC_CODERANGE_BROKEN */
@@ -796,7 +841,6 @@ rb_enc_compatible(VALUE str1, VALUE str2)
if (cr2 == ENC_CODERANGE_7BIT) return enc1;
}
if (cr2 == ENC_CODERANGE_7BIT) {
- if (idx1 == ENCINDEX_ASCII) return enc2;
return enc1;
}
}
@@ -823,11 +867,11 @@ rb_enc_copy(VALUE obj1, VALUE obj2)
VALUE
rb_obj_encoding(VALUE obj)
{
- rb_encoding *enc = rb_enc_get(obj);
- if (!enc) {
+ int idx = rb_enc_get_index(obj);
+ if (idx < 0) {
rb_raise(rb_eTypeError, "unknown encoding");
}
- return rb_enc_from_encoding(enc);
+ return rb_enc_from_encoding_index(idx);
}
int
@@ -890,12 +934,11 @@ rb_enc_codepoint_len(const char *p, const char *e, int *len_p, rb_encoding *enc)
if (e <= p)
rb_raise(rb_eArgError, "empty string");
r = rb_enc_precise_mbclen(p, e, enc);
- if (MBCLEN_CHARFOUND_P(r)) {
- if (len_p) *len_p = MBCLEN_CHARFOUND_LEN(r);
- return rb_enc_mbc_to_codepoint(p, e, enc);
- }
- else
+ if (!MBCLEN_CHARFOUND_P(r)) {
rb_raise(rb_eArgError, "invalid byte sequence in %s", rb_enc_name(enc));
+ }
+ if (len_p) *len_p = MBCLEN_CHARFOUND_LEN(r);
+ return rb_enc_mbc_to_codepoint(p, e, enc);
}
#undef rb_enc_codepoint
@@ -1045,7 +1088,12 @@ enc_list(VALUE klass)
static VALUE
enc_find(VALUE klass, VALUE enc)
{
- return rb_enc_from_encoding(rb_to_encoding(enc));
+ int idx;
+ if (RB_TYPE_P(enc, T_DATA) && is_data_encoding(enc))
+ return enc;
+ idx = str_to_encindex(enc);
+ if (idx == UNSPECIFIED_ENCODING) return Qnil;
+ return rb_enc_from_encoding_index(idx);
}
/*
@@ -1068,7 +1116,7 @@ enc_find(VALUE klass, VALUE enc)
*
* If the objects are non-strings their encodings are compatible when they
* have an encoding and:
- * * Either encoding is US ASCII compatible
+ * * Either encoding is US-ASCII compatible
* * One of the encodings is a 7-bit encoding
*
*/
@@ -1302,7 +1350,7 @@ rb_enc_set_default_external(VALUE encoding)
*
* Sets default external encoding. You should not set
* Encoding::default_external in ruby code as strings created before changing
- * the value may have a different encoding from strings created after thevalue
+ * the value may have a different encoding from strings created after the value
* was changed., instead you should use <tt>ruby -E</tt> to invoke ruby with
* the correct default_external.
*
@@ -1431,9 +1479,12 @@ rb_locale_charmap(VALUE klass)
#if defined NO_LOCALE_CHARMAP
return rb_usascii_str_new2("ASCII-8BIT");
#elif defined _WIN32 || defined __CYGWIN__
- const char *nl_langinfo_codeset(void);
- const char *codeset = nl_langinfo_codeset();
+ const char *codeset = 0;
char cp[sizeof(int) * 3 + 4];
+# ifdef __CYGWIN__
+ const char *nl_langinfo_codeset(void);
+ codeset = nl_langinfo_codeset();
+# endif
if (!codeset) {
UINT codepage = GetConsoleCP();
if(!codepage) codepage = GetACP();
@@ -1580,6 +1631,206 @@ rb_enc_aliases(VALUE klass)
return aliases[0];
}
+/*
+ * An Encoding instance represents a character encoding usable in Ruby. It is
+ * defined as a constant under the Encoding namespace. It has a name and
+ * optionally, aliases:
+ *
+ * Encoding::ISO_8859_1.name
+ * #=> #<Encoding:ISO-8859-1>
+ *
+ * Encoding::ISO_8859_1.names
+ * #=> ["ISO-8859-1", "ISO8859-1"]
+ *
+ * Ruby methods dealing with encodings return or accept Encoding instances as
+ * arguments (when a method accepts an Encoding instance as an argument, it
+ * can be passed an Encoding name or alias instead).
+ *
+ * "some string".encoding
+ * #=> #<Encoding:UTF-8>
+ *
+ * string = "some string".encode(Encoding::ISO_8859_1)
+ * #=> "some string"
+ * string.encoding
+ * #=> #<Encoding:ISO-8859-1>
+ *
+ * "some string".encode "ISO-8859-1"
+ * #=> "some string"
+ *
+ * <code>Encoding::ASCII_8BIT</code> is a special encoding that is usually
+ * used for a byte string, not a character string. But as the name insists,
+ * its characters in the range of ASCII are considered as ASCII characters.
+ * This is useful when you use ASCII-8BIT characters with other ASCII
+ * compatible characters.
+ *
+ * == Changing an encoding
+ *
+ * The associated Encoding of a String can be changed in two different ways.
+ *
+ * First, it is possible to set the Encoding of a string to a new Encoding
+ * without changing the internal byte representation of the string, with
+ * String#force_encoding. This is how you can tell Ruby the correct encoding
+ * of a string.
+ *
+ * string
+ * #=> "R\xC3\xA9sum\xC3\xA9"
+ * string.encoding
+ * #=> #<Encoding:ISO-8859-1>
+ * string.force_encoding(Encoding::UTF-8)
+ * #=> "R\u00E9sum\u00E9"
+ *
+ * Second, it is possible to transcode a string, i.e. translate its internal
+ * byte representation to another encoding. Its associated encoding is also
+ * set to the other encoding. See String#encode for the various forms of
+ * transcoding, and the Encoding::Converter class for additional control over
+ * the transcoding process.
+ *
+ * string
+ * #=> "R\u00E9sum\u00E9"
+ * string.encoding
+ * #=> #<Encoding:UTF-8>
+ * string = string.encode!(Encoding::ISO_8859_1)
+ * #=> "R\xE9sum\xE9"
+ * string.encoding
+ * #=> #<Encoding::ISO-8859-1>
+ *
+ * == Script encoding
+ *
+ * All Ruby script code has an associated Encoding which any String literal
+ * created in the source code will be associated to.
+ *
+ * The default script encoding is <code>Encoding::US-ASCII</code>, but it can
+ * be changed by a magic comment on the first line of the source code file (or
+ * second line, if there is a shebang line on the first). The comment must
+ * contain the word <code>coding</code> or <code>encoding</code>, followed
+ * by a colon, space and the Encoding name or alias:
+ *
+ * # encoding: UTF-8
+ *
+ * "some string".encoding
+ * #=> #<Encoding:UTF-8>
+ *
+ * The <code>__ENCODING__</code> keyword returns the script encoding of the file
+ * which the keyword is written:
+ *
+ * # encoding: ISO-8859-1
+ *
+ * __ENCODING__
+ * #=> #<Encoding:ISO-8859-1>
+ *
+ * <code>ruby -K</code> will change the default locale encoding, but this is
+ * not recommended. Ruby source files should declare its script encoding by a
+ * magic comment even when they only depend on US-ASCII strings or regular
+ * expressions.
+ *
+ * == Locale encoding
+ *
+ * The default encoding of the environment. Usually derived from locale.
+ *
+ * see Encoding.locale_charmap, Encoding.find('locale')
+ *
+ * == Filesystem encoding
+ *
+ * The default encoding of strings from the filesystem of the environment.
+ * This is used for strings of file names or paths.
+ *
+ * see Encoding.find('filesystem')
+ *
+ * == External encoding
+ *
+ * Each IO object has an external encoding which indicates the encoding that
+ * Ruby will use to read its data. By default Ruby sets the external encoding
+ * of an IO object to the default external encoding. The default external
+ * encoding is set by locale encoding or the interpreter <code>-E</code> option.
+ * Encoding.default_external returns the current value of the external
+ * encoding.
+ *
+ * ENV["LANG"]
+ * #=> "UTF-8"
+ * Encoding.default_external
+ * #=> #<Encoding:UTF-8>
+ *
+ * $ ruby -E ISO-8859-1 -e "p Encoding.default_external"
+ * #<Encoding:ISO-8859-1>
+ *
+ * $ LANG=C ruby -e 'p Encoding.default_external'
+ * #<Encoding:US-ASCII>
+ *
+ * The default external encoding may also be set through
+ * Encoding.default_external=, but you should not do this as strings created
+ * before and after the change will have inconsistent encodings. Instead use
+ * <code>ruby -E</code> to invoke ruby with the correct external encoding.
+ *
+ * When you know that the actual encoding of the data of an IO object is not
+ * the default external encoding, you can reset its external encoding with
+ * IO#set_encoding or set it at IO object creation (see IO.new options).
+ *
+ * == Internal encoding
+ *
+ * To process the data of an IO object which has an encoding different
+ * from its external encoding, you can set its internal encoding. Ruby will use
+ * this internal encoding to transcode the data when it is read from the IO
+ * object.
+ *
+ * Conversely, when data is written to the IO object it is transcoded from the
+ * internal encoding to the external encoding of the IO object.
+ *
+ * The internal encoding of an IO object can be set with
+ * IO#set_encoding or at IO object creation (see IO.new options).
+ *
+ * The internal encoding is optional and when not set, the Ruby default
+ * internal encoding is used. If not explicitly set this default internal
+ * encoding is +nil+ meaning that by default, no transcoding occurs.
+ *
+ * The default internal encoding can be set with the interpreter option
+ * <code>-E</code>. Encoding.default_internal returns the current internal
+ * encoding.
+ *
+ * $ ruby -e 'p Encoding.default_internal'
+ * nil
+ *
+ * $ ruby -E ISO-8859-1:UTF-8 -e "p [Encoding.default_external, \
+ * Encoding.default_internal]"
+ * [#<Encoding:ISO-8859-1>, #<Encoding:UTF-8>]
+ *
+ * The default internal encoding may also be set through
+ * Encoding.default_internal=, but you should not do this as strings created
+ * before and after the change will have inconsistent encodings. Instead use
+ * <code>ruby -E</code> to invoke ruby with the correct internal encoding.
+ *
+ * == IO encoding example
+ *
+ * In the following example a UTF-8 encoded string "R\u00E9sum\u00E9" is transcoded for
+ * output to ISO-8859-1 encoding, then read back in and transcoded to UTF-8:
+ *
+ * string = "R\u00E9sum\u00E9"
+ *
+ * open("transcoded.txt", "w:ISO-8859-1") do |io|
+ * io.write(string)
+ * end
+ *
+ * puts "raw text:"
+ * p File.binread("transcoded.txt")
+ * puts
+ *
+ * open("transcoded.txt", "r:ISO-8859-1:UTF-8") do |io|
+ * puts "transcoded text:"
+ * p io.read
+ * end
+ *
+ * While writing the file, the internal encoding is not specified as it is
+ * only necessary for reading. While reading the file both the internal and
+ * external encoding must be specified to obtain the correct result.
+ *
+ * $ ruby t.rb
+ * raw text:
+ * "R\xE9sum\xE9"
+ *
+ * transcoded text:
+ * "R\u00E9sum\u00E9"
+ *
+ */
+
void
Init_Encoding(void)
{
diff --git a/enum.c b/enum.c
index de954c938f..aa8b64a995 100644
--- a/enum.c
+++ b/enum.c
@@ -13,15 +13,24 @@
#include "ruby/util.h"
#include "node.h"
#include "id.h"
+#include "internal.h"
+
+#define STATIC_ASSERT(name, expr) typedef int static_assert_##name##_check[1 - 2*!(expr)]
VALUE rb_mEnumerable;
+
static ID id_next;
+static ID id_div;
+static ID id_call;
+static ID id_size;
+
#define id_each idEach
#define id_eqq idEqq
#define id_cmp idCmp
+#define id_lshift idLTLT
-static VALUE
-enum_values_pack(int argc, VALUE *argv)
+VALUE
+rb_enum_values_pack(int argc, VALUE *argv)
{
if (argc == 0) return Qnil;
if (argc == 1) return argv[0];
@@ -29,7 +38,7 @@ enum_values_pack(int argc, VALUE *argv)
}
#define ENUM_WANT_SVALUE() do { \
- i = enum_values_pack(argc, argv); \
+ i = rb_enum_values_pack(argc, argv); \
} while (0)
#define enum_yield rb_yield_values2
@@ -37,11 +46,11 @@ enum_values_pack(int argc, VALUE *argv)
static VALUE
grep_i(VALUE i, VALUE args, int argc, VALUE *argv)
{
- VALUE *arg = (VALUE *)args;
+ NODE *memo = RNODE(args);
ENUM_WANT_SVALUE();
- if (RTEST(rb_funcall(arg[0], id_eqq, 1, i))) {
- rb_ary_push(arg[1], i);
+ if (RTEST(rb_funcall(memo->u1.value, id_eqq, 1, i))) {
+ rb_ary_push(memo->u2.value, i);
}
return Qnil;
}
@@ -49,19 +58,19 @@ grep_i(VALUE i, VALUE args, int argc, VALUE *argv)
static VALUE
grep_iter_i(VALUE i, VALUE args, int argc, VALUE *argv)
{
- VALUE *arg = (VALUE *)args;
+ NODE *memo = RNODE(args);
ENUM_WANT_SVALUE();
- if (RTEST(rb_funcall(arg[0], id_eqq, 1, i))) {
- rb_ary_push(arg[1], rb_yield(i));
+ if (RTEST(rb_funcall(memo->u1.value, id_eqq, 1, i))) {
+ rb_ary_push(memo->u2.value, rb_yield(i));
}
return Qnil;
}
/*
* call-seq:
- * enum.grep(pattern) -> array
- * enum.grep(pattern) {| obj | block } -> array
+ * enum.grep(pattern) -> array
+ * enum.grep(pattern) { |obj| block } -> array
*
* Returns an array of every element in <i>enum</i> for which
* <code>Pattern === element</code>. If the optional <em>block</em> is
@@ -71,7 +80,7 @@ grep_iter_i(VALUE i, VALUE args, int argc, VALUE *argv)
* (1..100).grep 38..44 #=> [38, 39, 40, 41, 42, 43, 44]
* c = IO.constants
* c.grep(/SEEK/) #=> [:SEEK_SET, :SEEK_CUR, :SEEK_END]
- * res = c.grep(/SEEK/) {|v| IO.const_get(v) }
+ * res = c.grep(/SEEK/) { |v| IO.const_get(v) }
* res #=> [0, 1, 2]
*
*/
@@ -80,12 +89,9 @@ static VALUE
enum_grep(VALUE obj, VALUE pat)
{
VALUE ary = rb_ary_new();
- VALUE arg[2];
+ NODE *memo = NEW_MEMO(pat, ary, 0);
- arg[0] = pat;
- arg[1] = ary;
-
- rb_block_call(obj, id_each, 0, 0, rb_block_given_p() ? grep_iter_i : grep_i, (VALUE)arg);
+ rb_block_call(obj, id_each, 0, 0, rb_block_given_p() ? grep_iter_i : grep_i, (VALUE)memo);
return ary;
}
@@ -93,12 +99,12 @@ enum_grep(VALUE obj, VALUE pat)
static VALUE
count_i(VALUE i, VALUE memop, int argc, VALUE *argv)
{
- VALUE *memo = (VALUE*)memop;
+ NODE *memo = RNODE(memop);
ENUM_WANT_SVALUE();
- if (rb_equal(i, memo[1])) {
- memo[0]++;
+ if (rb_equal(i, memo->u1.value)) {
+ memo->u3.cnt++;
}
return Qnil;
}
@@ -106,10 +112,10 @@ count_i(VALUE i, VALUE memop, int argc, VALUE *argv)
static VALUE
count_iter_i(VALUE i, VALUE memop, int argc, VALUE *argv)
{
- VALUE *memo = (VALUE*)memop;
+ NODE *memo = RNODE(memop);
if (RTEST(enum_yield(argc, argv))) {
- memo[0]++;
+ memo->u3.cnt++;
}
return Qnil;
}
@@ -117,35 +123,35 @@ count_iter_i(VALUE i, VALUE memop, int argc, VALUE *argv)
static VALUE
count_all_i(VALUE i, VALUE memop, int argc, VALUE *argv)
{
- VALUE *memo = (VALUE*)memop;
+ NODE *memo = RNODE(memop);
- memo[0]++;
+ memo->u3.cnt++;
return Qnil;
}
/*
* call-seq:
- * enum.count -> int
- * enum.count(item) -> int
- * enum.count {| obj | block } -> int
+ * enum.count -> int
+ * enum.count(item) -> int
+ * enum.count { |obj| block } -> int
*
- * Returns the number of items in <i>enum</i>, where #size is called
- * if it responds to it, otherwise the items are counted through
- * enumeration. If an argument is given, counts the number of items
- * in <i>enum</i>, for which equals to <i>item</i>. If a block is
- * given, counts the number of elements yielding a true value.
+ * Returns the number of items in +enum+ through enumeration.
+ * If an argument is given, the number of items in +enum+ that
+ * are equal to +item+ are counted. If a block is given, it
+ * counts the number of elements yielding a true value.
*
* ary = [1, 2, 4, 2]
- * ary.count #=> 4
- * ary.count(2) #=> 2
- * ary.count{|x|x%2==0} #=> 3
+ * ary.count #=> 4
+ * ary.count(2) #=> 2
+ * ary.count{ |x| x%2==0 } #=> 3
*
*/
static VALUE
enum_count(int argc, VALUE *argv, VALUE obj)
{
- VALUE memo[2]; /* [count, condition value] */
+ VALUE item = Qnil;
+ NODE *memo;
rb_block_call_func *func;
if (argc == 0) {
@@ -157,25 +163,27 @@ enum_count(int argc, VALUE *argv, VALUE obj)
}
}
else {
- rb_scan_args(argc, argv, "1", &memo[1]);
+ rb_scan_args(argc, argv, "1", &item);
if (rb_block_given_p()) {
rb_warn("given block not used");
}
func = count_i;
}
- memo[0] = 0;
- rb_block_call(obj, id_each, 0, 0, func, (VALUE)&memo);
- return INT2NUM(memo[0]);
+ memo = NEW_MEMO(item, 0, 0);
+ rb_block_call(obj, id_each, 0, 0, func, (VALUE)memo);
+ return INT2NUM(memo->u3.cnt);
}
static VALUE
-find_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
+find_i(VALUE i, VALUE memop, int argc, VALUE *argv)
{
ENUM_WANT_SVALUE();
if (RTEST(rb_yield(i))) {
- *memo = i;
+ NODE *memo = RNODE(memop);
+ memo->u1.value = i;
+ memo->u3.cnt = 1;
rb_iter_break();
}
return Qnil;
@@ -183,10 +191,10 @@ find_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
/*
* call-seq:
- * enum.detect(ifnone = nil) {| obj | block } -> obj or nil
- * enum.find(ifnone = nil) {| obj | block } -> obj or nil
- * enum.detect(ifnone = nil) -> an_enumerator
- * enum.find(ifnone = nil) -> an_enumerator
+ * enum.detect(ifnone = nil) { |obj| block } -> obj or nil
+ * enum.find(ifnone = nil) { |obj| block } -> obj or nil
+ * enum.detect(ifnone = nil) -> an_enumerator
+ * enum.find(ifnone = nil) -> an_enumerator
*
* Passes each entry in <i>enum</i> to <em>block</em>. Returns the
* first for which <em>block</em> is not false. If no
@@ -195,25 +203,26 @@ find_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
*
* If no block is given, an enumerator is returned instead.
*
- * (1..10).detect {|i| i % 5 == 0 and i % 7 == 0 } #=> nil
- * (1..100).detect {|i| i % 5 == 0 and i % 7 == 0 } #=> 35
+ * (1..10).detect { |i| i % 5 == 0 and i % 7 == 0 } #=> nil
+ * (1..100).detect { |i| i % 5 == 0 and i % 7 == 0 } #=> 35
*
*/
static VALUE
enum_find(int argc, VALUE *argv, VALUE obj)
{
- VALUE memo = Qundef;
+ NODE *memo;
VALUE if_none;
rb_scan_args(argc, argv, "01", &if_none);
RETURN_ENUMERATOR(obj, argc, argv);
- rb_block_call(obj, id_each, 0, 0, find_i, (VALUE)&memo);
- if (memo != Qundef) {
- return memo;
+ memo = NEW_MEMO(Qundef, 0, 0);
+ rb_block_call(obj, id_each, 0, 0, find_i, (VALUE)memo);
+ if (memo->u3.cnt) {
+ return memo->u1.value;
}
if (!NIL_P(if_none)) {
- return rb_funcall(if_none, rb_intern("call"), 0, 0);
+ return rb_funcall(if_none, id_call, 0, 0);
}
return Qnil;
}
@@ -221,36 +230,36 @@ enum_find(int argc, VALUE *argv, VALUE obj)
static VALUE
find_index_i(VALUE i, VALUE memop, int argc, VALUE *argv)
{
- VALUE *memo = (VALUE*)memop;
+ NODE *memo = RNODE(memop);
ENUM_WANT_SVALUE();
- if (rb_equal(i, memo[2])) {
- memo[0] = UINT2NUM(memo[1]);
+ if (rb_equal(i, memo->u2.value)) {
+ memo->u1.value = UINT2NUM(memo->u3.cnt);
rb_iter_break();
}
- memo[1]++;
+ memo->u3.cnt++;
return Qnil;
}
static VALUE
find_index_iter_i(VALUE i, VALUE memop, int argc, VALUE *argv)
{
- VALUE *memo = (VALUE*)memop;
+ NODE *memo = RNODE(memop);
if (RTEST(enum_yield(argc, argv))) {
- memo[0] = UINT2NUM(memo[1]);
+ memo->u1.value = UINT2NUM(memo->u3.cnt);
rb_iter_break();
}
- memo[1]++;
+ memo->u3.cnt++;
return Qnil;
}
/*
* call-seq:
- * enum.find_index(value) -> int or nil
- * enum.find_index {| obj | block } -> int or nil
- * enum.find_index -> an_enumerator
+ * enum.find_index(value) -> int or nil
+ * enum.find_index { |obj| block } -> int or nil
+ * enum.find_index -> an_enumerator
*
* Compares each entry in <i>enum</i> with <em>value</em> or passes
* to <em>block</em>. Returns the index for the first for which the
@@ -259,8 +268,8 @@ find_index_iter_i(VALUE i, VALUE memop, int argc, VALUE *argv)
*
* If neither block nor argument is given, an enumerator is returned instead.
*
- * (1..10).find_index {|i| i % 5 == 0 and i % 7 == 0 } #=> nil
- * (1..100).find_index {|i| i % 5 == 0 and i % 7 == 0 } #=> 34
+ * (1..10).find_index { |i| i % 5 == 0 and i % 7 == 0 } #=> nil
+ * (1..100).find_index { |i| i % 5 == 0 and i % 7 == 0 } #=> 34
* (1..100).find_index(50) #=> 49
*
*/
@@ -268,7 +277,8 @@ find_index_iter_i(VALUE i, VALUE memop, int argc, VALUE *argv)
static VALUE
enum_find_index(int argc, VALUE *argv, VALUE obj)
{
- VALUE memo[3]; /* [return value, current index, condition value] */
+ NODE *memo; /* [return value, current index, ] */
+ VALUE condition_value = Qnil;
rb_block_call_func *func;
if (argc == 0) {
@@ -276,17 +286,16 @@ enum_find_index(int argc, VALUE *argv, VALUE obj)
func = find_index_iter_i;
}
else {
- rb_scan_args(argc, argv, "1", &memo[2]);
+ rb_scan_args(argc, argv, "1", &condition_value);
if (rb_block_given_p()) {
rb_warn("given block not used");
}
func = find_index_i;
}
- memo[0] = Qnil;
- memo[1] = 0;
+ memo = NEW_MEMO(Qnil, condition_value, 0);
rb_block_call(obj, id_each, 0, 0, func, (VALUE)memo);
- return memo[0];
+ return memo->u1.value;
}
static VALUE
@@ -300,22 +309,32 @@ find_all_i(VALUE i, VALUE ary, int argc, VALUE *argv)
return Qnil;
}
+static VALUE
+enum_size(VALUE self, VALUE args)
+{
+ VALUE r;
+ r = rb_check_funcall(self, id_size, 0, 0);
+ return (r == Qundef) ? Qnil : r;
+}
+
/*
* call-seq:
- * enum.find_all {| obj | block } -> array
- * enum.select {| obj | block } -> array
- * enum.find_all -> an_enumerator
- * enum.select -> an_enumerator
+ * enum.find_all { |obj| block } -> array
+ * enum.select { |obj| block } -> array
+ * enum.find_all -> an_enumerator
+ * enum.select -> an_enumerator
*
- * Returns an array containing all elements of <i>enum</i> for which
- * <em>block</em> is not <code>false</code> (see also
- * <code>Enumerable#reject</code>).
+ * Returns an array containing all elements of +enum+
+ * for which the given +block+ returns a true value.
*
- * If no block is given, an enumerator is returned instead.
+ * If no block is given, an Enumerator is returned instead.
*
*
- * (1..10).find_all {|i| i % 3 == 0 } #=> [3, 6, 9]
+ * (1..10).find_all { |i| i % 3 == 0 } #=> [3, 6, 9]
*
+ * [1,2,3,4,5].select { |num| num.even? } #=> [2, 4]
+ *
+ * See also Enumerable#reject.
*/
static VALUE
@@ -323,7 +342,7 @@ enum_find_all(VALUE obj)
{
VALUE ary;
- RETURN_ENUMERATOR(obj, 0, 0);
+ RETURN_SIZED_ENUMERATOR(obj, 0, 0, enum_size);
ary = rb_ary_new();
rb_block_call(obj, id_each, 0, 0, find_all_i, ary);
@@ -344,16 +363,19 @@ reject_i(VALUE i, VALUE ary, int argc, VALUE *argv)
/*
* call-seq:
- * enum.reject {| obj | block } -> array
- * enum.reject -> an_enumerator
+ * enum.reject { |obj| block } -> array
+ * enum.reject -> an_enumerator
*
- * Returns an array for all elements of <i>enum</i> for which
- * <em>block</em> is false (see also <code>Enumerable#find_all</code>).
+ * Returns an array for all elements of +enum+ for which the given
+ * +block+ returns false.
*
- * If no block is given, an enumerator is returned instead.
+ * If no block is given, an Enumerator is returned instead.
+ *
+ * (1..10).reject { |i| i % 3 == 0 } #=> [1, 2, 4, 5, 7, 8, 10]
*
- * (1..10).reject {|i| i % 3 == 0 } #=> [1, 2, 4, 5, 7, 8, 10]
+ * [1, 2, 3, 4, 5].reject { |num| num.even? } #=> [1, 3, 5]
*
+ * See also Enumerable#find_all.
*/
static VALUE
@@ -361,7 +383,7 @@ enum_reject(VALUE obj)
{
VALUE ary;
- RETURN_ENUMERATOR(obj, 0, 0);
+ RETURN_SIZED_ENUMERATOR(obj, 0, 0, enum_size);
ary = rb_ary_new();
rb_block_call(obj, id_each, 0, 0, reject_i, ary);
@@ -381,24 +403,24 @@ static VALUE
collect_all(VALUE i, VALUE ary, int argc, VALUE *argv)
{
rb_thread_check_ints();
- rb_ary_push(ary, enum_values_pack(argc, argv));
+ rb_ary_push(ary, rb_enum_values_pack(argc, argv));
return Qnil;
}
/*
* call-seq:
- * enum.collect {| obj | block } -> array
- * enum.map {| obj | block } -> array
- * enum.collect -> an_enumerator
- * enum.map -> an_enumerator
+ * enum.collect { |obj| block } -> array
+ * enum.map { |obj| block } -> array
+ * enum.collect -> an_enumerator
+ * enum.map -> an_enumerator
*
* Returns a new array with the results of running <em>block</em> once
* for every element in <i>enum</i>.
*
* If no block is given, an enumerator is returned instead.
*
- * (1..4).collect {|i| i*i } #=> [1, 4, 9, 16]
+ * (1..4).collect { |i| i*i } #=> [1, 4, 9, 16]
* (1..4).collect { "cat" } #=> ["cat", "cat", "cat", "cat"]
*
*/
@@ -408,7 +430,7 @@ enum_collect(VALUE obj)
{
VALUE ary;
- RETURN_ENUMERATOR(obj, 0, 0);
+ RETURN_SIZED_ENUMERATOR(obj, 0, 0, enum_size);
ary = rb_ary_new();
rb_block_call(obj, id_each, 0, 0, collect_i, ary);
@@ -435,17 +457,18 @@ flat_map_i(VALUE i, VALUE ary, int argc, VALUE *argv)
/*
* call-seq:
- * enum.flat_map {| obj | block } -> array
- * enum.collect_concat {| obj | block } -> array
- * enum.flat_map -> an_enumerator
- * enum.collect_concat -> an_enumerator
+ * enum.flat_map { |obj| block } -> array
+ * enum.collect_concat { |obj| block } -> array
+ * enum.flat_map -> an_enumerator
+ * enum.collect_concat -> an_enumerator
*
* Returns a new array with the concatenated results of running
* <em>block</em> once for every element in <i>enum</i>.
*
* If no block is given, an enumerator is returned instead.
*
- * [[1,2],[3,4]].flat_map {|i| i } #=> [1, 2, 3, 4]
+ * [1, 2, 3, 4].flat_map { |e| [e, -e] } #=> [1, -1, 2, -2, 3, -3, 4, -4]
+ * [[1, 2], [3, 4]].flat_map { |e| e + [100] } #=> [1, 2, 100, 3, 4, 100]
*
*/
@@ -454,7 +477,7 @@ enum_flat_map(VALUE obj)
{
VALUE ary;
- RETURN_ENUMERATOR(obj, 0, 0);
+ RETURN_SIZED_ENUMERATOR(obj, 0, 0, enum_size);
ary = rb_ary_new();
rb_block_call(obj, id_each, 0, 0, flat_map_i, ary);
@@ -464,8 +487,8 @@ enum_flat_map(VALUE obj)
/*
* call-seq:
- * enum.to_a -> array
- * enum.entries -> array
+ * enum.to_a -> array
+ * enum.entries -> array
*
* Returns an array containing the items in <i>enum</i>.
*
@@ -486,15 +509,16 @@ enum_to_a(int argc, VALUE *argv, VALUE obj)
static VALUE
inject_i(VALUE i, VALUE p, int argc, VALUE *argv)
{
- VALUE *memo = (VALUE *)p;
+ NODE *memo = RNODE(p);
ENUM_WANT_SVALUE();
- if (memo[0] == Qundef) {
- memo[0] = i;
+ if (memo->u2.argc == 0) {
+ memo->u2.argc = 1;
+ memo->u1.value = i;
}
else {
- memo[0] = rb_yield_values(2, memo[0], i);
+ memo->u1.value = rb_yield_values(2, memo->u1.value, i);
}
return Qnil;
}
@@ -502,15 +526,16 @@ inject_i(VALUE i, VALUE p, int argc, VALUE *argv)
static VALUE
inject_op_i(VALUE i, VALUE p, int argc, VALUE *argv)
{
- VALUE *memo = (VALUE *)p;
+ NODE *memo = RNODE(p);
ENUM_WANT_SVALUE();
- if (memo[0] == Qundef) {
- memo[0] = i;
+ if (memo->u2.argc == 0) {
+ memo->u2.argc = 1;
+ memo->u1.value = i;
}
else {
- memo[0] = rb_funcall(memo[0], (ID)memo[1], 1, i);
+ memo->u1.value = rb_funcall(memo->u1.value, memo->u3.id, 1, i);
}
return Qnil;
}
@@ -519,12 +544,12 @@ inject_op_i(VALUE i, VALUE p, int argc, VALUE *argv)
* call-seq:
* enum.inject(initial, sym) -> obj
* enum.inject(sym) -> obj
- * enum.inject(initial) {| memo, obj | block } -> obj
- * enum.inject {| memo, obj | block } -> obj
+ * enum.inject(initial) { |memo, obj| block } -> obj
+ * enum.inject { |memo, obj| block } -> obj
* enum.reduce(initial, sym) -> obj
* enum.reduce(sym) -> obj
- * enum.reduce(initial) {| memo, obj | block } -> obj
- * enum.reduce {| memo, obj | block } -> obj
+ * enum.reduce(initial) { |memo, obj| block } -> obj
+ * enum.reduce { |memo, obj| block } -> obj
*
* Combines all elements of <i>enum</i> by applying a binary
* operation, specified by a block or a symbol that names a
@@ -539,75 +564,78 @@ inject_op_i(VALUE i, VALUE p, int argc, VALUE *argv)
* return value for the method.
*
* If you do not explicitly specify an <i>initial</i> value for <i>memo</i>,
- * then uses the first element of collection is used as the initial value
+ * then the first element of collection is used as the initial value
* of <i>memo</i>.
*
- * Examples:
*
* # Sum some numbers
- * (5..10).reduce(:+) #=> 45
+ * (5..10).reduce(:+) #=> 45
* # Same using a block and inject
- * (5..10).inject {|sum, n| sum + n } #=> 45
+ * (5..10).inject { |sum, n| sum + n } #=> 45
* # Multiply some numbers
- * (5..10).reduce(1, :*) #=> 151200
+ * (5..10).reduce(1, :*) #=> 151200
* # Same using a block
- * (5..10).inject(1) {|product, n| product * n } #=> 151200
+ * (5..10).inject(1) { |product, n| product * n } #=> 151200
* # find the longest word
- * longest = %w{ cat sheep bear }.inject do |memo,word|
+ * longest = %w{ cat sheep bear }.inject do |memo, word|
* memo.length > word.length ? memo : word
* end
- * longest #=> "sheep"
+ * longest #=> "sheep"
*
*/
static VALUE
enum_inject(int argc, VALUE *argv, VALUE obj)
{
- VALUE memo[2];
+ NODE *memo;
+ VALUE init, op;
VALUE (*iter)(VALUE, VALUE, int, VALUE*) = inject_i;
- switch (rb_scan_args(argc, argv, "02", &memo[0], &memo[1])) {
+ switch (rb_scan_args(argc, argv, "02", &init, &op)) {
case 0:
- memo[0] = Qundef;
break;
case 1:
if (rb_block_given_p()) {
break;
}
- memo[1] = (VALUE)rb_to_id(memo[0]);
- memo[0] = Qundef;
+ op = (VALUE)rb_to_id(init);
+ argc = 0;
+ init = Qnil;
iter = inject_op_i;
break;
case 2:
if (rb_block_given_p()) {
rb_warning("given block not used");
}
- memo[1] = (VALUE)rb_to_id(memo[1]);
+ op = (VALUE)rb_to_id(op);
iter = inject_op_i;
break;
}
+ memo = NEW_MEMO(init, argc, op);
rb_block_call(obj, id_each, 0, 0, iter, (VALUE)memo);
- if (memo[0] == Qundef) return Qnil;
- return memo[0];
+ return memo->u1.value;
}
static VALUE
-partition_i(VALUE i, VALUE *ary, int argc, VALUE *argv)
+partition_i(VALUE i, VALUE arys, int argc, VALUE *argv)
{
+ NODE *memo = RNODE(arys);
+ VALUE ary;
ENUM_WANT_SVALUE();
if (RTEST(rb_yield(i))) {
- rb_ary_push(ary[0], i);
+ ary = memo->u1.value;
}
else {
- rb_ary_push(ary[1], i);
+ ary = memo->u2.value;
}
+ rb_ary_push(ary, i);
return Qnil;
}
/*
* call-seq:
- * enum.partition {| obj | block } -> [ true_array, false_array ]
- * enum.partition -> an_enumerator
+ * enum.partition { |obj| block } -> [ true_array, false_array ]
+ * enum.partition -> an_enumerator
*
* Returns two arrays, the first containing the elements of
* <i>enum</i> for which the block evaluates to true, the second
@@ -615,22 +643,21 @@ partition_i(VALUE i, VALUE *ary, int argc, VALUE *argv)
*
* If no block is given, an enumerator is returned instead.
*
- * (1..6).partition {|v| v.even? } #=> [[2, 4, 6], [1, 3, 5]]
+ * (1..6).partition { |v| v.even? } #=> [[2, 4, 6], [1, 3, 5]]
*
*/
static VALUE
enum_partition(VALUE obj)
{
- VALUE ary[2];
+ NODE *memo;
- RETURN_ENUMERATOR(obj, 0, 0);
+ RETURN_SIZED_ENUMERATOR(obj, 0, 0, enum_size);
- ary[0] = rb_ary_new();
- ary[1] = rb_ary_new();
- rb_block_call(obj, id_each, 0, 0, partition_i, (VALUE)ary);
+ memo = NEW_MEMO(rb_ary_new(), rb_ary_new(), 0);
+ rb_block_call(obj, id_each, 0, 0, partition_i, (VALUE)memo);
- return rb_assoc_new(ary[0], ary[1]);
+ return rb_assoc_new(memo->u1.value, memo->u2.value);
}
static VALUE
@@ -643,7 +670,7 @@ group_by_i(VALUE i, VALUE hash, int argc, VALUE *argv)
group = rb_yield(i);
values = rb_hash_aref(hash, group);
- if (NIL_P(values)) {
+ if (!RB_TYPE_P(values, T_ARRAY)) {
values = rb_ary_new3(1, i);
rb_hash_aset(hash, group, values);
}
@@ -655,16 +682,16 @@ group_by_i(VALUE i, VALUE hash, int argc, VALUE *argv)
/*
* call-seq:
- * enum.group_by {| obj | block } -> a_hash
- * enum.group_by -> an_enumerator
+ * enum.group_by { |obj| block } -> a_hash
+ * enum.group_by -> an_enumerator
*
- * Returns a hash, which keys are evaluated result from the
- * block, and values are arrays of elements in <i>enum</i>
- * corresponding to the key.
+ * Groups the collection by result of the block. Returns a hash where the
+ * keys are the evaluated result from the block and the values are
+ * arrays of elements in the collection that correspond to the key.
*
- * If no block is given, an enumerator is returned instead.
+ * If no block is given an enumerator is returned.
*
- * (1..6).group_by {|i| i%3} #=> {0=>[3, 6], 1=>[1, 4], 2=>[2, 5]}
+ * (1..6).group_by { |i| i%3 } #=> {0=>[3, 6], 1=>[1, 4], 2=>[2, 5]}
*
*/
@@ -673,7 +700,7 @@ enum_group_by(VALUE obj)
{
VALUE hash;
- RETURN_ENUMERATOR(obj, 0, 0);
+ RETURN_SIZED_ENUMERATOR(obj, 0, 0, enum_size);
hash = rb_hash_new();
rb_block_call(obj, id_each, 0, 0, group_by_i, hash);
@@ -683,27 +710,19 @@ enum_group_by(VALUE obj)
}
static VALUE
-first_i(VALUE i, VALUE *params, int argc, VALUE *argv)
+first_i(VALUE i, VALUE params, int argc, VALUE *argv)
{
+ NODE *memo = RNODE(params);
ENUM_WANT_SVALUE();
- if (NIL_P(params[1])) {
- params[1] = i;
- rb_iter_break();
- }
- else {
- long n = params[0];
+ memo->u1.value = i;
+ rb_iter_break();
- rb_ary_push(params[1], i);
- n--;
- if (n <= 0) {
- rb_iter_break();
- }
- params[0] = n;
- }
- return Qnil;
+ UNREACHABLE;
}
+static VALUE enum_take(VALUE obj, VALUE n);
+
/*
* call-seq:
* enum.first -> obj or nil
@@ -723,33 +742,23 @@ first_i(VALUE i, VALUE *params, int argc, VALUE *argv)
static VALUE
enum_first(int argc, VALUE *argv, VALUE obj)
{
- VALUE n, params[2];
-
- if (argc == 0) {
- params[0] = params[1] = Qnil;
+ NODE *memo;
+ rb_check_arity(argc, 0, 1);
+ if (argc > 0) {
+ return enum_take(obj, argv[0]);
}
else {
- long len;
-
- rb_scan_args(argc, argv, "01", &n);
- len = NUM2LONG(n);
- if (len == 0) return rb_ary_new2(0);
- if (len < 0) {
- rb_raise(rb_eArgError, "negative length");
- }
- params[0] = len;
- params[1] = rb_ary_new2(len);
+ memo = NEW_MEMO(Qnil, 0, 0);
+ rb_block_call(obj, id_each, 0, 0, first_i, (VALUE)memo);
+ return memo->u1.value;
}
- rb_block_call(obj, id_each, 0, 0, first_i, (VALUE)params);
-
- return params[1];
}
/*
* call-seq:
- * enum.sort -> array
- * enum.sort {| a, b | block } -> array
+ * enum.sort -> array
+ * enum.sort { |a, b| block } -> array
*
* Returns an array containing the items in <i>enum</i> sorted,
* either according to their own <code><=></code> method, or by using
@@ -759,8 +768,8 @@ enum_first(int argc, VALUE *argv, VALUE obj)
* built-in Schwartzian Transform, useful when key computation or
* comparison is expensive.
*
- * %w(rhea kea flea).sort #=> ["flea", "kea", "rhea"]
- * (1..10).sort {|a,b| b <=> a} #=> [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
+ * %w(rhea kea flea).sort #=> ["flea", "kea", "rhea"]
+ * (1..10).sort { |a, b| b <=> a } #=> [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
*/
static VALUE
@@ -773,13 +782,13 @@ enum_sort(VALUE obj)
struct sort_by_data {
VALUE ary;
VALUE buf;
- int n;
+ long n;
};
static VALUE
sort_by_i(VALUE i, VALUE _data, int argc, VALUE *argv)
{
- struct sort_by_data *data = (struct sort_by_data *)_data;
+ struct sort_by_data *data = (struct sort_by_data *)&RNODE(_data)->u1;
VALUE ary = data->ary;
VALUE v;
@@ -823,29 +832,29 @@ sort_by_cmp(const void *ap, const void *bp, void *data)
/*
* call-seq:
- * enum.sort_by {| obj | block } -> array
- * enum.sort_by -> an_enumerator
+ * enum.sort_by { |obj| block } -> array
+ * enum.sort_by -> an_enumerator
*
* Sorts <i>enum</i> using a set of keys generated by mapping the
* values in <i>enum</i> through the given block.
*
* If no block is given, an enumerator is returned instead.
*
- * %w{ apple pear fig }.sort_by {|word| word.length}
+ * %w{apple pear fig}.sort_by { |word| word.length}
* #=> ["fig", "pear", "apple"]
*
* The current implementation of <code>sort_by</code> generates an
* array of tuples containing the original collection element and the
* mapped value. This makes <code>sort_by</code> fairly expensive when
- * the keysets are simple
+ * the keysets are simple.
*
* require 'benchmark'
*
- * a = (1..100000).map {rand(100000)}
+ * a = (1..100000).map { rand(100000) }
*
* Benchmark.bm(10) do |b|
* b.report("Sort") { a.sort }
- * b.report("Sort by") { a.sort_by {|a| a} }
+ * b.report("Sort by") { a.sort_by { |a| a } }
* end
*
* <em>produces:</em>
@@ -859,7 +868,7 @@ sort_by_cmp(const void *ap, const void *bp, void *data)
* using the basic <code>sort</code> method.
*
* files = Dir["*"]
- * sorted = files.sort {|a,b| File.new(a).mtime <=> File.new(b).mtime}
+ * sorted = files.sort { |a, b| File.new(a).mtime <=> File.new(b).mtime }
* sorted #=> ["mon", "tues", "wed", "thurs"]
*
* This sort is inefficient: it generates two new <code>File</code>
@@ -868,7 +877,7 @@ sort_by_cmp(const void *ap, const void *bp, void *data)
* times directly.
*
* files = Dir["*"]
- * sorted = files.sort { |a,b|
+ * sorted = files.sort { |a, b|
* test(?M, a) <=> test(?M, b)
* }
* sorted #=> ["mon", "tues", "wed", "thurs"]
@@ -888,34 +897,41 @@ sort_by_cmp(const void *ap, const void *bp, void *data)
*
* This is exactly what <code>sort_by</code> does internally.
*
- * sorted = Dir["*"].sort_by {|f| test(?M, f)}
+ * sorted = Dir["*"].sort_by { |f| test(?M, f) }
* sorted #=> ["mon", "tues", "wed", "thurs"]
*/
static VALUE
enum_sort_by(VALUE obj)
{
- VALUE ary;
+ VALUE ary, buf;
+ NODE *memo;
long i;
- struct sort_by_data data;
+ struct sort_by_data *data;
- RETURN_ENUMERATOR(obj, 0, 0);
+ RETURN_SIZED_ENUMERATOR(obj, 0, 0, enum_size);
- if (TYPE(obj) == T_ARRAY && RARRAY_LEN(obj) <= LONG_MAX/2) {
+ if (RB_TYPE_P(obj, T_ARRAY) && RARRAY_LEN(obj) <= LONG_MAX/2) {
ary = rb_ary_new2(RARRAY_LEN(obj)*2);
}
else {
ary = rb_ary_new();
}
RBASIC(ary)->klass = 0;
- data.ary = ary;
- data.buf = rb_ary_tmp_new(SORT_BY_BUFSIZE*2);
- data.n = 0;
- rb_ary_store(data.buf, SORT_BY_BUFSIZE*2-1, Qnil);
- rb_block_call(obj, id_each, 0, 0, sort_by_i, (VALUE)&data);
- if (data.n) {
- rb_ary_resize(data.buf, data.n*2);
- rb_ary_concat(ary, data.buf);
+ buf = rb_ary_tmp_new(SORT_BY_BUFSIZE*2);
+ rb_ary_store(buf, SORT_BY_BUFSIZE*2-1, Qnil);
+ memo = NEW_MEMO(0, 0, 0);
+ OBJ_INFECT(memo, obj);
+ data = (struct sort_by_data *)&memo->u1;
+ data->ary = ary;
+ data->buf = buf;
+ data->n = 0;
+ rb_block_call(obj, id_each, 0, 0, sort_by_i, (VALUE)memo);
+ ary = data->ary;
+ buf = data->buf;
+ if (data->n) {
+ rb_ary_resize(buf, data->n*2);
+ rb_ary_concat(ary, buf);
}
if (RARRAY_LEN(ary) > 2) {
ruby_qsort(RARRAY_PTR(ary), RARRAY_LEN(ary)/2, 2*sizeof(VALUE),
@@ -929,7 +945,7 @@ enum_sort_by(VALUE obj)
}
rb_ary_resize(ary, RARRAY_LEN(ary)/2);
RBASIC(ary)->klass = rb_cArray;
- OBJ_INFECT(ary, obj);
+ OBJ_INFECT(ary, memo);
return ary;
}
@@ -937,27 +953,27 @@ enum_sort_by(VALUE obj)
#define ENUMFUNC(name) rb_block_given_p() ? name##_iter_i : name##_i
#define DEFINE_ENUMFUNCS(name) \
-static VALUE enum_##name##_func(VALUE result, VALUE *memo); \
+static VALUE enum_##name##_func(VALUE result, NODE *memo); \
\
static VALUE \
-name##_i(VALUE i, VALUE *memo, int argc, VALUE *argv) \
+name##_i(VALUE i, VALUE memo, int argc, VALUE *argv) \
{ \
- return enum_##name##_func(enum_values_pack(argc, argv), memo); \
+ return enum_##name##_func(rb_enum_values_pack(argc, argv), RNODE(memo)); \
} \
\
static VALUE \
-name##_iter_i(VALUE i, VALUE *memo, int argc, VALUE *argv) \
+name##_iter_i(VALUE i, VALUE memo, int argc, VALUE *argv) \
{ \
- return enum_##name##_func(enum_yield(argc, argv), memo); \
+ return enum_##name##_func(enum_yield(argc, argv), RNODE(memo)); \
} \
\
static VALUE \
-enum_##name##_func(VALUE result, VALUE *memo)
+enum_##name##_func(VALUE result, NODE *memo)
DEFINE_ENUMFUNCS(all)
{
if (!RTEST(result)) {
- *memo = Qfalse;
+ memo->u1.value = Qfalse;
rb_iter_break();
}
return Qnil;
@@ -965,34 +981,33 @@ DEFINE_ENUMFUNCS(all)
/*
* call-seq:
- * enum.all? [{|obj| block } ] -> true or false
+ * enum.all? [{ |obj| block } ] -> true or false
*
* Passes each element of the collection to the given block. The method
* returns <code>true</code> if the block never returns
* <code>false</code> or <code>nil</code>. If the block is not given,
- * Ruby adds an implicit block of <code>{|obj| obj}</code> (that is
- * <code>all?</code> will return <code>true</code> only if none of the
- * collection members are <code>false</code> or <code>nil</code>.)
+ * Ruby adds an implicit block of <code>{ |obj| obj }</code> which will
+ * cause #all? to return +true+ when none of the collection members are
+ * +false+ or +nil+.
*
- * %w{ant bear cat}.all? {|word| word.length >= 3} #=> true
- * %w{ant bear cat}.all? {|word| word.length >= 4} #=> false
- * [ nil, true, 99 ].all? #=> false
+ * %w[ant bear cat].all? { |word| word.length >= 3 } #=> true
+ * %w[ant bear cat].all? { |word| word.length >= 4 } #=> false
+ * [nil, true, 99].all? #=> false
*
*/
static VALUE
enum_all(VALUE obj)
{
- VALUE result = Qtrue;
-
- rb_block_call(obj, id_each, 0, 0, ENUMFUNC(all), (VALUE)&result);
- return result;
+ NODE *memo = NEW_MEMO(Qtrue, 0, 0);
+ rb_block_call(obj, id_each, 0, 0, ENUMFUNC(all), (VALUE)memo);
+ return memo->u1.value;
}
DEFINE_ENUMFUNCS(any)
{
if (RTEST(result)) {
- *memo = Qtrue;
+ memo->u1.value = Qtrue;
rb_iter_break();
}
return Qnil;
@@ -1000,39 +1015,37 @@ DEFINE_ENUMFUNCS(any)
/*
* call-seq:
- * enum.any? [{|obj| block } ] -> true or false
+ * enum.any? [{ |obj| block }] -> true or false
*
* Passes each element of the collection to the given block. The method
* returns <code>true</code> if the block ever returns a value other
* than <code>false</code> or <code>nil</code>. If the block is not
- * given, Ruby adds an implicit block of <code>{|obj| obj}</code> (that
- * is <code>any?</code> will return <code>true</code> if at least one
- * of the collection members is not <code>false</code> or
- * <code>nil</code>.
+ * given, Ruby adds an implicit block of <code>{ |obj| obj }</code> that
+ * will cause #any? to return +true+ if at least one of the collection
+ * members is not +false+ or +nil+.
*
- * %w{ant bear cat}.any? {|word| word.length >= 3} #=> true
- * %w{ant bear cat}.any? {|word| word.length >= 4} #=> true
- * [ nil, true, 99 ].any? #=> true
+ * %w[ant bear cat].any? { |word| word.length >= 3 } #=> true
+ * %w[ant bear cat].any? { |word| word.length >= 4 } #=> true
+ * [nil, true, 99].any? #=> true
*
*/
static VALUE
enum_any(VALUE obj)
{
- VALUE result = Qfalse;
-
- rb_block_call(obj, id_each, 0, 0, ENUMFUNC(any), (VALUE)&result);
- return result;
+ NODE *memo = NEW_MEMO(Qfalse, 0, 0);
+ rb_block_call(obj, id_each, 0, 0, ENUMFUNC(any), (VALUE)memo);
+ return memo->u1.value;
}
DEFINE_ENUMFUNCS(one)
{
if (RTEST(result)) {
- if (*memo == Qundef) {
- *memo = Qtrue;
+ if (memo->u1.value == Qundef) {
+ memo->u1.value = Qtrue;
}
- else if (*memo == Qtrue) {
- *memo = Qfalse;
+ else if (memo->u1.value == Qtrue) {
+ memo->u1.value = Qfalse;
rb_iter_break();
}
}
@@ -1041,7 +1054,7 @@ DEFINE_ENUMFUNCS(one)
/*
* call-seq:
- * enum.one? [{|obj| block }] -> true or false
+ * enum.one? [{ |obj| block }] -> true or false
*
* Passes each element of the collection to the given block. The method
* returns <code>true</code> if the block returns <code>true</code>
@@ -1049,20 +1062,22 @@ DEFINE_ENUMFUNCS(one)
* <code>true</code> only if exactly one of the collection members is
* true.
*
- * %w{ant bear cat}.one? {|word| word.length == 4} #=> true
- * %w{ant bear cat}.one? {|word| word.length > 4} #=> false
- * %w{ant bear cat}.one? {|word| word.length < 4} #=> false
- * [ nil, true, 99 ].one? #=> false
- * [ nil, true, false ].one? #=> true
+ * %w{ant bear cat}.one? { |word| word.length == 4 } #=> true
+ * %w{ant bear cat}.one? { |word| word.length > 4 } #=> false
+ * %w{ant bear cat}.one? { |word| word.length < 4 } #=> false
+ * [ nil, true, 99 ].one? #=> false
+ * [ nil, true, false ].one? #=> true
*
*/
static VALUE
enum_one(VALUE obj)
{
- VALUE result = Qundef;
+ NODE *memo = NEW_MEMO(Qundef, 0, 0);
+ VALUE result;
- rb_block_call(obj, id_each, 0, 0, ENUMFUNC(one), (VALUE)&result);
+ rb_block_call(obj, id_each, 0, 0, ENUMFUNC(one), (VALUE)memo);
+ result = memo->u1.value;
if (result == Qundef) return Qfalse;
return result;
}
@@ -1070,7 +1085,7 @@ enum_one(VALUE obj)
DEFINE_ENUMFUNCS(none)
{
if (RTEST(result)) {
- *memo = Qfalse;
+ memo->u1.value = Qfalse;
rb_iter_break();
}
return Qnil;
@@ -1078,61 +1093,62 @@ DEFINE_ENUMFUNCS(none)
/*
* call-seq:
- * enum.none? [{|obj| block }] -> true or false
+ * enum.none? [{ |obj| block }] -> true or false
*
* Passes each element of the collection to the given block. The method
* returns <code>true</code> if the block never returns <code>true</code>
* for all elements. If the block is not given, <code>none?</code> will return
* <code>true</code> only if none of the collection members is true.
*
- * %w{ant bear cat}.none? {|word| word.length == 5} #=> true
- * %w{ant bear cat}.none? {|word| word.length >= 4} #=> false
- * [].none? #=> true
- * [nil].none? #=> true
- * [nil,false].none? #=> true
+ * %w{ant bear cat}.none? { |word| word.length == 5 } #=> true
+ * %w{ant bear cat}.none? { |word| word.length >= 4 } #=> false
+ * [].none? #=> true
+ * [nil].none? #=> true
+ * [nil, false].none? #=> true
*/
static VALUE
enum_none(VALUE obj)
{
- VALUE result = Qtrue;
-
- rb_block_call(obj, id_each, 0, 0, ENUMFUNC(none), (VALUE)&result);
- return result;
+ NODE *memo = NEW_MEMO(Qtrue, 0, 0);
+ rb_block_call(obj, id_each, 0, 0, ENUMFUNC(none), (VALUE)memo);
+ return memo->u1.value;
}
static VALUE
-min_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
+min_i(VALUE i, VALUE args, int argc, VALUE *argv)
{
VALUE cmp;
+ NODE *memo = RNODE(args);
ENUM_WANT_SVALUE();
- if (*memo == Qundef) {
- *memo = i;
+ if (memo->u1.value == Qundef) {
+ memo->u1.value = i;
}
else {
- cmp = rb_funcall(i, id_cmp, 1, *memo);
- if (rb_cmpint(cmp, i, *memo) < 0) {
- *memo = i;
+ cmp = rb_funcall(i, id_cmp, 1, memo->u1.value);
+ if (rb_cmpint(cmp, i, memo->u1.value) < 0) {
+ memo->u1.value = i;
}
}
return Qnil;
}
static VALUE
-min_ii(VALUE i, VALUE *memo, int argc, VALUE *argv)
+min_ii(VALUE i, VALUE args, int argc, VALUE *argv)
{
VALUE cmp;
+ NODE *memo = RNODE(args);
ENUM_WANT_SVALUE();
- if (*memo == Qundef) {
- *memo = i;
+ if (memo->u1.value == Qundef) {
+ memo->u1.value = i;
}
else {
- cmp = rb_yield_values(2, i, *memo);
- if (rb_cmpint(cmp, i, *memo) < 0) {
- *memo = i;
+ cmp = rb_yield_values(2, i, memo->u1.value);
+ if (rb_cmpint(cmp, i, memo->u1.value) < 0) {
+ memo->u1.value = i;
}
}
return Qnil;
@@ -1141,66 +1157,70 @@ min_ii(VALUE i, VALUE *memo, int argc, VALUE *argv)
/*
* call-seq:
- * enum.min -> obj
- * enum.min {| a,b | block } -> obj
+ * enum.min -> obj
+ * enum.min { |a, b| block } -> obj
*
* Returns the object in <i>enum</i> with the minimum value. The
* first form assumes all objects implement <code>Comparable</code>;
* the second uses the block to return <em>a <=> b</em>.
*
* a = %w(albatross dog horse)
- * a.min #=> "albatross"
- * a.min {|a,b| a.length <=> b.length } #=> "dog"
+ * a.min #=> "albatross"
+ * a.min { |a, b| a.length <=> b.length } #=> "dog"
*/
static VALUE
enum_min(VALUE obj)
{
- VALUE result = Qundef;
+ NODE *memo = NEW_MEMO(Qundef, 0, 0);
+ VALUE result;
if (rb_block_given_p()) {
- rb_block_call(obj, id_each, 0, 0, min_ii, (VALUE)&result);
+ rb_block_call(obj, id_each, 0, 0, min_ii, (VALUE)memo);
}
else {
- rb_block_call(obj, id_each, 0, 0, min_i, (VALUE)&result);
+ rb_block_call(obj, id_each, 0, 0, min_i, (VALUE)memo);
}
+ result = memo->u1.value;
if (result == Qundef) return Qnil;
return result;
}
static VALUE
-max_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
+max_i(VALUE i, VALUE args, int argc, VALUE *argv)
{
+ NODE *memo = RNODE(args);
VALUE cmp;
ENUM_WANT_SVALUE();
- if (*memo == Qundef) {
- *memo = i;
+ if (memo->u1.value == Qundef) {
+ memo->u1.value = i;
}
else {
- cmp = rb_funcall(i, id_cmp, 1, *memo);
- if (rb_cmpint(cmp, i, *memo) > 0) {
- *memo = i;
+ cmp = rb_funcall(i, id_cmp, 1, memo->u1.value);
+ if (rb_cmpint(cmp, i, memo->u1.value) > 0) {
+ memo->u1.value = i;
}
}
return Qnil;
}
static VALUE
-max_ii(VALUE i, VALUE *memo, int argc, VALUE *argv)
+max_ii(VALUE i, VALUE args, int argc, VALUE *argv)
{
+ NODE *memo = RNODE(args);
VALUE cmp;
ENUM_WANT_SVALUE();
- if (*memo == Qundef) {
- *memo = i;
+ if (memo->u1.value == Qundef) {
+ memo->u1.value = i;
}
else {
- cmp = rb_yield_values(2, i, *memo);
- if (rb_cmpint(cmp, i, *memo) > 0) {
- *memo = i;
+ cmp = rb_yield_values(2, i, memo->u1.value);
+ if (rb_cmpint(cmp, i, memo->u1.value) > 0) {
+ memo->u1.value = i;
}
}
return Qnil;
@@ -1208,29 +1228,31 @@ max_ii(VALUE i, VALUE *memo, int argc, VALUE *argv)
/*
* call-seq:
- * enum.max -> obj
- * enum.max {|a,b| block } -> obj
+ * enum.max -> obj
+ * enum.max { |a, b| block } -> obj
*
* Returns the object in _enum_ with the maximum value. The
* first form assumes all objects implement <code>Comparable</code>;
* the second uses the block to return <em>a <=> b</em>.
*
* a = %w(albatross dog horse)
- * a.max #=> "horse"
- * a.max {|a,b| a.length <=> b.length } #=> "albatross"
+ * a.max #=> "horse"
+ * a.max { |a, b| a.length <=> b.length } #=> "albatross"
*/
static VALUE
enum_max(VALUE obj)
{
- VALUE result = Qundef;
+ NODE *memo = NEW_MEMO(Qundef, 0, 0);
+ VALUE result;
if (rb_block_given_p()) {
- rb_block_call(obj, id_each, 0, 0, max_ii, (VALUE)&result);
+ rb_block_call(obj, id_each, 0, 0, max_ii, (VALUE)memo);
}
else {
- rb_block_call(obj, id_each, 0, 0, max_i, (VALUE)&result);
+ rb_block_call(obj, id_each, 0, 0, max_i, (VALUE)memo);
}
+ result = memo->u1.value;
if (result == Qundef) return Qnil;
return result;
}
@@ -1241,6 +1263,8 @@ struct minmax_t {
VALUE last;
};
+STATIC_ASSERT(minmax_t, sizeof(struct minmax_t) <= sizeof(NODE) - offsetof(NODE, u1));
+
static void
minmax_i_update(VALUE i, VALUE j, struct minmax_t *memo)
{
@@ -1265,7 +1289,7 @@ minmax_i_update(VALUE i, VALUE j, struct minmax_t *memo)
static VALUE
minmax_i(VALUE i, VALUE _memo, int argc, VALUE *argv)
{
- struct minmax_t *memo = (struct minmax_t *)_memo;
+ struct minmax_t *memo = (struct minmax_t *)&RNODE(_memo)->u1.value;
int n;
VALUE j;
@@ -1317,7 +1341,7 @@ minmax_ii_update(VALUE i, VALUE j, struct minmax_t *memo)
static VALUE
minmax_ii(VALUE i, VALUE _memo, int argc, VALUE *argv)
{
- struct minmax_t *memo = (struct minmax_t *)_memo;
+ struct minmax_t *memo = (struct minmax_t *)&RNODE(_memo)->u1.value;
int n;
VALUE j;
@@ -1347,8 +1371,8 @@ minmax_ii(VALUE i, VALUE _memo, int argc, VALUE *argv)
/*
* call-seq:
- * enum.minmax -> [min,max]
- * enum.minmax {|a,b| block } -> [min,max]
+ * enum.minmax -> [min, max]
+ * enum.minmax { |a, b| block } -> [min, max]
*
* Returns two elements array which contains the minimum and the
* maximum value in the enumerable. The first form assumes all
@@ -1357,57 +1381,59 @@ minmax_ii(VALUE i, VALUE _memo, int argc, VALUE *argv)
*
* a = %w(albatross dog horse)
* a.minmax #=> ["albatross", "horse"]
- * a.minmax {|a,b| a.length <=> b.length } #=> ["dog", "albatross"]
+ * a.minmax { |a, b| a.length <=> b.length } #=> ["dog", "albatross"]
*/
static VALUE
enum_minmax(VALUE obj)
{
- struct minmax_t memo;
+ NODE *memo = NEW_MEMO(Qundef, Qundef, Qundef);
+ struct minmax_t *m = (struct minmax_t *)&memo->u1.value;
VALUE ary = rb_ary_new3(2, Qnil, Qnil);
- memo.min = Qundef;
- memo.last = Qundef;
+ m->min = Qundef;
+ m->last = Qundef;
if (rb_block_given_p()) {
- rb_block_call(obj, id_each, 0, 0, minmax_ii, (VALUE)&memo);
- if (memo.last != Qundef)
- minmax_ii_update(memo.last, memo.last, &memo);
+ rb_block_call(obj, id_each, 0, 0, minmax_ii, (VALUE)memo);
+ if (m->last != Qundef)
+ minmax_ii_update(m->last, m->last, m);
}
else {
- rb_block_call(obj, id_each, 0, 0, minmax_i, (VALUE)&memo);
- if (memo.last != Qundef)
- minmax_i_update(memo.last, memo.last, &memo);
+ rb_block_call(obj, id_each, 0, 0, minmax_i, (VALUE)memo);
+ if (m->last != Qundef)
+ minmax_i_update(m->last, m->last, m);
}
- if (memo.min != Qundef) {
- rb_ary_store(ary, 0, memo.min);
- rb_ary_store(ary, 1, memo.max);
+ if (m->min != Qundef) {
+ rb_ary_store(ary, 0, m->min);
+ rb_ary_store(ary, 1, m->max);
}
return ary;
}
static VALUE
-min_by_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
+min_by_i(VALUE i, VALUE args, int argc, VALUE *argv)
{
+ NODE *memo = RNODE(args);
VALUE v;
ENUM_WANT_SVALUE();
v = rb_yield(i);
- if (memo[0] == Qundef) {
- memo[0] = v;
- memo[1] = i;
+ if (memo->u1.value == Qundef) {
+ memo->u1.value = v;
+ memo->u2.value = i;
}
- else if (rb_cmpint(rb_funcall(v, id_cmp, 1, memo[0]), v, memo[0]) < 0) {
- memo[0] = v;
- memo[1] = i;
+ else if (rb_cmpint(rb_funcall(v, id_cmp, 1, memo->u1.value), v, memo->u1.value) < 0) {
+ memo->u1.value = v;
+ memo->u2.value = i;
}
return Qnil;
}
/*
* call-seq:
- * enum.min_by {|obj| block } -> obj
- * enum.min_by -> an_enumerator
+ * enum.min_by { |obj| block } -> obj
+ * enum.min_by -> an_enumerator
*
* Returns the object in <i>enum</i> that gives the minimum
* value from the given block.
@@ -1415,45 +1441,45 @@ min_by_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
* If no block is given, an enumerator is returned instead.
*
* a = %w(albatross dog horse)
- * a.min_by {|x| x.length } #=> "dog"
+ * a.min_by { |x| x.length } #=> "dog"
*/
static VALUE
enum_min_by(VALUE obj)
{
- VALUE memo[2];
+ NODE *memo;
- RETURN_ENUMERATOR(obj, 0, 0);
+ RETURN_SIZED_ENUMERATOR(obj, 0, 0, enum_size);
- memo[0] = Qundef;
- memo[1] = Qnil;
+ memo = NEW_MEMO(Qundef, Qnil, 0);
rb_block_call(obj, id_each, 0, 0, min_by_i, (VALUE)memo);
- return memo[1];
+ return memo->u2.value;
}
static VALUE
-max_by_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
+max_by_i(VALUE i, VALUE args, int argc, VALUE *argv)
{
+ NODE *memo = RNODE(args);
VALUE v;
ENUM_WANT_SVALUE();
v = rb_yield(i);
- if (memo[0] == Qundef) {
- memo[0] = v;
- memo[1] = i;
+ if (memo->u1.value == Qundef) {
+ memo->u1.value = v;
+ memo->u2.value = i;
}
- else if (rb_cmpint(rb_funcall(v, id_cmp, 1, memo[0]), v, memo[0]) > 0) {
- memo[0] = v;
- memo[1] = i;
+ else if (rb_cmpint(rb_funcall(v, id_cmp, 1, memo->u1.value), v, memo->u1.value) > 0) {
+ memo->u1.value = v;
+ memo->u2.value = i;
}
return Qnil;
}
/*
* call-seq:
- * enum.max_by {|obj| block } -> obj
- * enum.max_by -> an_enumerator
+ * enum.max_by { |obj| block } -> obj
+ * enum.max_by -> an_enumerator
*
* Returns the object in <i>enum</i> that gives the maximum
* value from the given block.
@@ -1461,20 +1487,19 @@ max_by_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
* If no block is given, an enumerator is returned instead.
*
* a = %w(albatross dog horse)
- * a.max_by {|x| x.length } #=> "albatross"
+ * a.max_by { |x| x.length } #=> "albatross"
*/
static VALUE
enum_max_by(VALUE obj)
{
- VALUE memo[2];
+ NODE *memo;
- RETURN_ENUMERATOR(obj, 0, 0);
+ RETURN_SIZED_ENUMERATOR(obj, 0, 0, enum_size);
- memo[0] = Qundef;
- memo[1] = Qnil;
+ memo = NEW_MEMO(Qundef, Qnil, 0);
rb_block_call(obj, id_each, 0, 0, max_by_i, (VALUE)memo);
- return memo[1];
+ return memo->u2.value;
}
struct minmax_by_t {
@@ -1510,7 +1535,7 @@ minmax_by_i_update(VALUE v1, VALUE v2, VALUE i1, VALUE i2, struct minmax_by_t *m
static VALUE
minmax_by_i(VALUE i, VALUE _memo, int argc, VALUE *argv)
{
- struct minmax_by_t *memo = (struct minmax_by_t *)_memo;
+ struct minmax_by_t *memo = MEMO_FOR(struct minmax_by_t, _memo);
VALUE vi, vj, j;
int n;
@@ -1549,43 +1574,47 @@ minmax_by_i(VALUE i, VALUE _memo, int argc, VALUE *argv)
/*
* call-seq:
- * enum.minmax_by {|obj| block } -> [min, max]
- * enum.minmax_by -> an_enumerator
+ * enum.minmax_by { |obj| block } -> [min, max]
+ * enum.minmax_by -> an_enumerator
*
- * Returns two elements array array containing the objects in
- * <i>enum</i> that gives the minimum and maximum values respectively
+ * Returns a two element array containing the objects in
+ * <i>enum</i> that correspond to the minimum and maximum values respectively
* from the given block.
*
* If no block is given, an enumerator is returned instead.
*
* a = %w(albatross dog horse)
- * a.minmax_by {|x| x.length } #=> ["dog", "albatross"]
+ * a.minmax_by { |x| x.length } #=> ["dog", "albatross"]
*/
static VALUE
enum_minmax_by(VALUE obj)
{
- struct minmax_by_t memo;
+ VALUE memo;
+ struct minmax_by_t *m = NEW_MEMO_FOR(struct minmax_by_t, memo);
- RETURN_ENUMERATOR(obj, 0, 0);
+ RETURN_SIZED_ENUMERATOR(obj, 0, 0, enum_size);
- memo.min_bv = Qundef;
- memo.max_bv = Qundef;
- memo.min = Qnil;
- memo.max = Qnil;
- memo.last_bv = Qundef;
- memo.last = Qundef;
- rb_block_call(obj, id_each, 0, 0, minmax_by_i, (VALUE)&memo);
- if (memo.last_bv != Qundef)
- minmax_by_i_update(memo.last_bv, memo.last_bv, memo.last, memo.last, &memo);
- return rb_assoc_new(memo.min, memo.max);
+ m->min_bv = Qundef;
+ m->max_bv = Qundef;
+ m->min = Qnil;
+ m->max = Qnil;
+ m->last_bv = Qundef;
+ m->last = Qundef;
+ rb_block_call(obj, id_each, 0, 0, minmax_by_i, memo);
+ if (m->last_bv != Qundef)
+ minmax_by_i_update(m->last_bv, m->last_bv, m->last, m->last, m);
+ m = MEMO_FOR(struct minmax_by_t, memo);
+ return rb_assoc_new(m->min, m->max);
}
static VALUE
-member_i(VALUE iter, VALUE *memo, int argc, VALUE *argv)
+member_i(VALUE iter, VALUE args, int argc, VALUE *argv)
{
- if (rb_equal(enum_values_pack(argc, argv), memo[0])) {
- memo[1] = Qtrue;
+ NODE *memo = RNODE(args);
+
+ if (rb_equal(rb_enum_values_pack(argc, argv), memo->u1.value)) {
+ memo->u2.value = Qtrue;
rb_iter_break();
}
return Qnil;
@@ -1607,26 +1636,24 @@ member_i(VALUE iter, VALUE *memo, int argc, VALUE *argv)
static VALUE
enum_member(VALUE obj, VALUE val)
{
- VALUE memo[2];
+ NODE *memo = NEW_MEMO(val, Qfalse, 0);
- memo[0] = val;
- memo[1] = Qfalse;
rb_block_call(obj, id_each, 0, 0, member_i, (VALUE)memo);
- return memo[1];
+ return memo->u2.value;
}
static VALUE
each_with_index_i(VALUE i, VALUE memo, int argc, VALUE *argv)
{
- long n = (*(VALUE *)memo)++;
+ long n = RNODE(memo)->u3.cnt++;
- return rb_yield_values(2, enum_values_pack(argc, argv), INT2NUM(n));
+ return rb_yield_values(2, rb_enum_values_pack(argc, argv), INT2NUM(n));
}
/*
* call-seq:
- * enum.each_with_index(*args) {|obj, i| block } -> enum
- * enum.each_with_index(*args) -> an_enumerator
+ * enum.each_with_index(*args) { |obj, i| block } -> enum
+ * enum.each_with_index(*args) -> an_enumerator
*
* Calls <em>block</em> with two arguments, the item and its index,
* for each item in <i>enum</i>. Given arguments are passed through
@@ -1635,7 +1662,7 @@ each_with_index_i(VALUE i, VALUE memo, int argc, VALUE *argv)
* If no block is given, an enumerator is returned instead.
*
* hash = Hash.new
- * %w(cat dog wombat).each_with_index {|item, index|
+ * %w(cat dog wombat).each_with_index { |item, index|
* hash[item] = index
* }
* hash #=> {"cat"=>0, "dog"=>1, "wombat"=>2}
@@ -1645,26 +1672,26 @@ each_with_index_i(VALUE i, VALUE memo, int argc, VALUE *argv)
static VALUE
enum_each_with_index(int argc, VALUE *argv, VALUE obj)
{
- long memo;
+ NODE *memo;
- RETURN_ENUMERATOR(obj, argc, argv);
+ RETURN_SIZED_ENUMERATOR(obj, argc, argv, enum_size);
- memo = 0;
- rb_block_call(obj, id_each, argc, argv, each_with_index_i, (VALUE)&memo);
+ memo = NEW_MEMO(0, 0, 0);
+ rb_block_call(obj, id_each, argc, argv, each_with_index_i, (VALUE)memo);
return obj;
}
/*
* call-seq:
- * enum.reverse_each(*args) {|item| block } -> enum
- * enum.reverse_each(*args) -> an_enumerator
+ * enum.reverse_each(*args) { |item| block } -> enum
+ * enum.reverse_each(*args) -> an_enumerator
*
* Builds a temporary array and traverses that array in reverse order.
*
* If no block is given, an enumerator is returned instead.
*
- * (1..3).reverse_each {|v| p v }
+ * (1..3).reverse_each { |v| p v }
*
* produces:
*
@@ -1679,7 +1706,7 @@ enum_reverse_each(int argc, VALUE *argv, VALUE obj)
VALUE ary;
long i;
- RETURN_ENUMERATOR(obj, argc, argv);
+ RETURN_SIZED_ENUMERATOR(obj, argc, argv, enum_size);
ary = enum_to_a(argc, argv, obj);
@@ -1701,8 +1728,8 @@ each_val_i(VALUE i, VALUE p, int argc, VALUE *argv)
/*
* call-seq:
- * enum.each_entry {|obj| block} -> enum
- * enum.each_entry -> an_enumerator
+ * enum.each_entry { |obj| block } -> enum
+ * enum.each_entry -> an_enumerator
*
* Calls <i>block</i> once for each element in +self+, passing that
* element as a parameter, converting multiple values from yield to an
@@ -1714,11 +1741,11 @@ each_val_i(VALUE i, VALUE p, int argc, VALUE *argv)
* include Enumerable
* def each
* yield 1
- * yield 1,2
+ * yield 1, 2
* yield
* end
* end
- * Foo.new.each_entry{|o| p o }
+ * Foo.new.each_entry{ |o| p o }
*
* produces:
*
@@ -1731,39 +1758,53 @@ each_val_i(VALUE i, VALUE p, int argc, VALUE *argv)
static VALUE
enum_each_entry(int argc, VALUE *argv, VALUE obj)
{
- RETURN_ENUMERATOR(obj, argc, argv);
+ RETURN_SIZED_ENUMERATOR(obj, argc, argv, enum_size);
rb_block_call(obj, id_each, argc, argv, each_val_i, 0);
return obj;
}
static VALUE
-each_slice_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
+each_slice_i(VALUE i, VALUE m, int argc, VALUE *argv)
{
- VALUE ary = memo[0];
+ NODE *memo = RNODE(m);
+ VALUE ary = memo->u1.value;
VALUE v = Qnil;
- long size = (long)memo[1];
+ long size = memo->u3.cnt;
ENUM_WANT_SVALUE();
rb_ary_push(ary, i);
if (RARRAY_LEN(ary) == size) {
v = rb_yield(ary);
- memo[0] = rb_ary_new2(size);
+ memo->u1.value = rb_ary_new2(size);
}
return v;
}
+static VALUE
+enum_each_slice_size(VALUE obj, VALUE args)
+{
+ VALUE n, size;
+ long slice_size = NUM2LONG(RARRAY_PTR(args)[0]);
+ if (slice_size <= 0) rb_raise(rb_eArgError, "invalid slice size");
+
+ size = enum_size(obj, 0);
+ if (size == Qnil) return Qnil;
+
+ n = rb_funcall(size, '+', 1, LONG2NUM(slice_size-1));
+ return rb_funcall(n, id_div, 1, LONG2FIX(slice_size));
+}
+
/*
* call-seq:
- * enum.each_slice(n) {...} -> nil
- * enum.each_slice(n) -> an_enumerator
+ * enum.each_slice(n) { ... } -> nil
+ * enum.each_slice(n) -> an_enumerator
*
* Iterates the given block for each slice of <n> elements. If no
* block is given, returns an enumerator.
*
- * e.g.:
- * (1..10).each_slice(3) {|a| p a}
+ * (1..10).each_slice(3) { |a| p a }
* # outputs below
* [1, 2, 3]
* [4, 5, 6]
@@ -1775,27 +1816,27 @@ static VALUE
enum_each_slice(VALUE obj, VALUE n)
{
long size = NUM2LONG(n);
- VALUE args[2], ary;
+ VALUE ary;
+ NODE *memo;
if (size <= 0) rb_raise(rb_eArgError, "invalid slice size");
- RETURN_ENUMERATOR(obj, 1, &n);
- args[0] = rb_ary_new2(size);
- args[1] = (VALUE)size;
-
- rb_block_call(obj, id_each, 0, 0, each_slice_i, (VALUE)args);
-
- ary = args[0];
+ RETURN_SIZED_ENUMERATOR(obj, 1, &n, enum_each_slice_size);
+ ary = rb_ary_new2(size);
+ memo = NEW_MEMO(ary, 0, size);
+ rb_block_call(obj, id_each, 0, 0, each_slice_i, (VALUE)memo);
+ ary = memo->u1.value;
if (RARRAY_LEN(ary) > 0) rb_yield(ary);
return Qnil;
}
static VALUE
-each_cons_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
+each_cons_i(VALUE i, VALUE args, int argc, VALUE *argv)
{
- VALUE ary = memo[0];
+ NODE *memo = RNODE(args);
+ VALUE ary = memo->u1.value;
VALUE v = Qnil;
- long size = (long)memo[1];
+ long size = memo->u3.cnt;
ENUM_WANT_SVALUE();
if (RARRAY_LEN(ary) == size) {
@@ -1808,16 +1849,30 @@ each_cons_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
return v;
}
+static VALUE
+enum_each_cons_size(VALUE obj, VALUE args)
+{
+ VALUE n, size;
+ long cons_size = NUM2LONG(RARRAY_PTR(args)[0]);
+ if (cons_size <= 0) rb_raise(rb_eArgError, "invalid size");
+
+ size = enum_size(obj, 0);
+ if (size == Qnil) return Qnil;
+
+ n = rb_funcall(size, '+', 1, LONG2NUM(1 - cons_size));
+ return (rb_cmpint(rb_funcall(n, id_cmp, 1, LONG2FIX(0)), n, LONG2FIX(0)) == -1) ? LONG2FIX(0) : n;
+}
+
/*
* call-seq:
- * enum.each_cons(n) {...} -> nil
+ * enum.each_cons(n) { ... } -> nil
* enum.each_cons(n) -> an_enumerator
*
* Iterates the given block for each array of consecutive <n>
* elements. If no block is given, returns an enumerator.
*
* e.g.:
- * (1..10).each_cons(3) {|a| p a}
+ * (1..10).each_cons(3) { |a| p a }
* # outputs below
* [1, 2, 3]
* [2, 3, 4]
@@ -1833,14 +1888,12 @@ static VALUE
enum_each_cons(VALUE obj, VALUE n)
{
long size = NUM2LONG(n);
- VALUE args[2];
+ NODE *memo;
if (size <= 0) rb_raise(rb_eArgError, "invalid size");
- RETURN_ENUMERATOR(obj, 1, &n);
- args[0] = rb_ary_new2(size);
- args[1] = (VALUE)size;
-
- rb_block_call(obj, id_each, 0, 0, each_cons_i, (VALUE)args);
+ RETURN_SIZED_ENUMERATOR(obj, 1, &n, enum_each_cons_size);
+ memo = NEW_MEMO(rb_ary_new2(size), 0, size);
+ rb_block_call(obj, id_each, 0, 0, each_cons_i, (VALUE)memo);
return Qnil;
}
@@ -1854,23 +1907,22 @@ each_with_object_i(VALUE i, VALUE memo, int argc, VALUE *argv)
/*
* call-seq:
- * enum.each_with_object(obj) {|(*args), memo_obj| ... } -> obj
- * enum.each_with_object(obj) -> an_enumerator
+ * enum.each_with_object(obj) { |(*args), memo_obj| ... } -> obj
+ * enum.each_with_object(obj) -> an_enumerator
*
* Iterates the given block for each element with an arbitrary
* object given, and returns the initially given object.
*
* If no block is given, returns an enumerator.
*
- * e.g.:
- * evens = (1..10).each_with_object([]) {|i, a| a << i*2 }
+ * evens = (1..10).each_with_object([]) { |i, a| a << i*2 }
* #=> [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
*
*/
static VALUE
enum_each_with_object(VALUE obj, VALUE memo)
{
- RETURN_ENUMERATOR(obj, 1, &memo);
+ RETURN_SIZED_ENUMERATOR(obj, 1, &memo, enum_size);
rb_block_call(obj, id_each, 0, 0, each_with_object_i, memo);
@@ -1887,7 +1939,7 @@ zip_ary(VALUE val, NODE *memo, int argc, VALUE *argv)
int i;
tmp = rb_ary_new2(RARRAY_LEN(args) + 1);
- rb_ary_store(tmp, 0, enum_values_pack(argc, argv));
+ rb_ary_store(tmp, 0, rb_enum_values_pack(argc, argv));
for (i=0; i<RARRAY_LEN(args); i++) {
VALUE e = RARRAY_PTR(args)[i];
@@ -1928,7 +1980,7 @@ zip_i(VALUE val, NODE *memo, int argc, VALUE *argv)
int i;
tmp = rb_ary_new2(RARRAY_LEN(args) + 1);
- rb_ary_store(tmp, 0, enum_values_pack(argc, argv));
+ rb_ary_store(tmp, 0, rb_enum_values_pack(argc, argv));
for (i=0; i<RARRAY_LEN(args); i++) {
if (NIL_P(RARRAY_PTR(args)[i])) {
rb_ary_push(tmp, Qnil);
@@ -1937,7 +1989,7 @@ zip_i(VALUE val, NODE *memo, int argc, VALUE *argv)
VALUE v[2];
v[1] = RARRAY_PTR(args)[i];
- rb_rescue2(call_next, (VALUE)v, call_stop, (VALUE)v, rb_eStopIteration, 0);
+ rb_rescue2(call_next, (VALUE)v, call_stop, (VALUE)v, rb_eStopIteration, (VALUE)0);
if (v[0] == Qundef) {
RARRAY_PTR(args)[i] = Qnil;
v[0] = Qnil;
@@ -1956,8 +2008,8 @@ zip_i(VALUE val, NODE *memo, int argc, VALUE *argv)
/*
* call-seq:
- * enum.zip(arg, ...) -> an_array_of_array
- * enum.zip(arg, ...) {|arr| block } -> nil
+ * enum.zip(arg, ...) -> an_array_of_array
+ * enum.zip(arg, ...) { |arr| block } -> nil
*
* Takes one element from <i>enum</i> and merges corresponding
* elements from each <i>args</i>. This generates a sequence of
@@ -1971,9 +2023,9 @@ zip_i(VALUE val, NODE *memo, int argc, VALUE *argv)
* a = [ 4, 5, 6 ]
* b = [ 7, 8, 9 ]
*
- * [1,2,3].zip(a, b) #=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
- * [1,2].zip(a,b) #=> [[1, 4, 7], [2, 5, 8]]
- * a.zip([1,2],[8]) #=> [[4, 1, 8], [5, 2, nil], [6, nil, nil]]
+ * [1, 2, 3].zip(a, b) #=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
+ * [1, 2].zip(a, b) #=> [[1, 4, 7], [2, 5, 8]]
+ * a.zip([1, 2], [8]) #=> [[4, 1, 8], [5, 2, nil], [6, nil, nil]]
*
*/
@@ -1999,6 +2051,7 @@ enum_zip(int argc, VALUE *argv, VALUE obj)
if (!allary) {
CONST_ID(conv, "to_enum");
for (i=0; i<argc; i++) {
+ if (!rb_respond_to(argv[i], id_each)) Check_Type(argv[i], T_ARRAY);
argv[i] = rb_funcall(argv[i], conv, 1, ID2SYM(id_each));
}
}
@@ -2013,10 +2066,11 @@ enum_zip(int argc, VALUE *argv, VALUE obj)
}
static VALUE
-take_i(VALUE i, VALUE *arg, int argc, VALUE *argv)
+take_i(VALUE i, VALUE args, int argc, VALUE *argv)
{
- rb_ary_push(arg[0], enum_values_pack(argc, argv));
- if (--arg[1] == 0) rb_iter_break();
+ NODE *memo = RNODE(args);
+ rb_ary_push(memo->u1.value, rb_enum_values_pack(argc, argv));
+ if (--memo->u3.cnt == 0) rb_iter_break();
return Qnil;
}
@@ -2034,7 +2088,8 @@ take_i(VALUE i, VALUE *arg, int argc, VALUE *argv)
static VALUE
enum_take(VALUE obj, VALUE n)
{
- VALUE args[2];
+ NODE *memo;
+ VALUE result;
long len = NUM2LONG(n);
if (len < 0) {
@@ -2042,25 +2097,25 @@ enum_take(VALUE obj, VALUE n)
}
if (len == 0) return rb_ary_new2(0);
- args[0] = rb_ary_new();
- args[1] = len;
- rb_block_call(obj, id_each, 0, 0, take_i, (VALUE)args);
- return args[0];
+ result = rb_ary_new2(len);
+ memo = NEW_MEMO(result, 0, len);
+ rb_block_call(obj, id_each, 0, 0, take_i, (VALUE)memo);
+ return result;
}
static VALUE
-take_while_i(VALUE i, VALUE *ary, int argc, VALUE *argv)
+take_while_i(VALUE i, VALUE ary, int argc, VALUE *argv)
{
if (!RTEST(enum_yield(argc, argv))) rb_iter_break();
- rb_ary_push(*ary, enum_values_pack(argc, argv));
+ rb_ary_push(ary, rb_enum_values_pack(argc, argv));
return Qnil;
}
/*
* call-seq:
- * enum.take_while {|arr| block } -> array
- * enum.take_while -> an_enumerator
+ * enum.take_while { |arr| block } -> array
+ * enum.take_while -> an_enumerator
*
* Passes elements to the block until the block returns +nil+ or +false+,
* then stops iterating and returns an array of all prior elements.
@@ -2068,7 +2123,7 @@ take_while_i(VALUE i, VALUE *ary, int argc, VALUE *argv)
* If no block is given, an enumerator is returned instead.
*
* a = [1, 2, 3, 4, 5, 0]
- * a.take_while {|i| i < 3 } #=> [1, 2]
+ * a.take_while { |i| i < 3 } #=> [1, 2]
*
*/
@@ -2079,18 +2134,19 @@ enum_take_while(VALUE obj)
RETURN_ENUMERATOR(obj, 0, 0);
ary = rb_ary_new();
- rb_block_call(obj, id_each, 0, 0, take_while_i, (VALUE)&ary);
+ rb_block_call(obj, id_each, 0, 0, take_while_i, ary);
return ary;
}
static VALUE
-drop_i(VALUE i, VALUE *arg, int argc, VALUE *argv)
+drop_i(VALUE i, VALUE args, int argc, VALUE *argv)
{
- if (arg[1] == 0) {
- rb_ary_push(arg[0], enum_values_pack(argc, argv));
+ NODE *memo = RNODE(args);
+ if (memo->u3.cnt == 0) {
+ rb_ary_push(memo->u1.value, rb_enum_values_pack(argc, argv));
}
else {
- arg[1]--;
+ memo->u3.cnt--;
}
return Qnil;
}
@@ -2110,37 +2166,39 @@ drop_i(VALUE i, VALUE *arg, int argc, VALUE *argv)
static VALUE
enum_drop(VALUE obj, VALUE n)
{
- VALUE args[2];
+ VALUE result;
+ NODE *memo;
long len = NUM2LONG(n);
if (len < 0) {
rb_raise(rb_eArgError, "attempt to drop negative size");
}
- args[1] = len;
- args[0] = rb_ary_new();
- rb_block_call(obj, id_each, 0, 0, drop_i, (VALUE)args);
- return args[0];
+ result = rb_ary_new();
+ memo = NEW_MEMO(result, 0, len);
+ rb_block_call(obj, id_each, 0, 0, drop_i, (VALUE)memo);
+ return result;
}
static VALUE
-drop_while_i(VALUE i, VALUE *args, int argc, VALUE *argv)
+drop_while_i(VALUE i, VALUE args, int argc, VALUE *argv)
{
+ NODE *memo = RNODE(args);
ENUM_WANT_SVALUE();
- if (!args[1] && !RTEST(rb_yield(i))) {
- args[1] = Qtrue;
+ if (!memo->u3.state && !RTEST(rb_yield(i))) {
+ memo->u3.state = TRUE;
}
- if (args[1]) {
- rb_ary_push(args[0], i);
+ if (memo->u3.state) {
+ rb_ary_push(memo->u1.value, i);
}
return Qnil;
}
/*
* call-seq:
- * enum.drop_while {|arr| block } -> array
+ * enum.drop_while { |arr| block } -> array
* enum.drop_while -> an_enumerator
*
* Drops elements up to, but not including, the first element for
@@ -2150,20 +2208,21 @@ drop_while_i(VALUE i, VALUE *args, int argc, VALUE *argv)
* If no block is given, an enumerator is returned instead.
*
* a = [1, 2, 3, 4, 5, 0]
- * a.drop_while {|i| i < 3 } #=> [3, 4, 5, 0]
+ * a.drop_while { |i| i < 3 } #=> [3, 4, 5, 0]
*
*/
static VALUE
enum_drop_while(VALUE obj)
{
- VALUE args[2];
+ VALUE result;
+ NODE *memo;
RETURN_ENUMERATOR(obj, 0, 0);
- args[0] = rb_ary_new();
- args[1] = Qfalse;
- rb_block_call(obj, id_each, 0, 0, drop_while_i, (VALUE)args);
- return args[0];
+ result = rb_ary_new();
+ memo = NEW_MEMO(result, 0, FALSE);
+ rb_block_call(obj, id_each, 0, 0, drop_while_i, (VALUE)memo);
+ return result;
}
static VALUE
@@ -2176,9 +2235,28 @@ cycle_i(VALUE i, VALUE ary, int argc, VALUE *argv)
return Qnil;
}
+#define enum_cycle_size rb_enum_cycle_size
+VALUE
+rb_enum_cycle_size(VALUE self, VALUE args)
+{
+ long mul;
+ VALUE n = Qnil;
+ VALUE size = enum_size(self, args);
+
+ if (size == Qnil) return Qnil;
+
+ if (args && (RARRAY_LEN(args) > 0)) {
+ n = RARRAY_PTR(args)[0];
+ }
+ if (n == Qnil) return DBL2NUM(INFINITY);
+ mul = NUM2LONG(n);
+ if (mul <= 0) return INT2FIX(0);
+ return rb_funcall(size, '*', 1, LONG2FIX(mul));
+}
+
/*
* call-seq:
- * enum.cycle(n=nil) {|obj| block } -> nil
+ * enum.cycle(n=nil) { |obj| block } -> nil
* enum.cycle(n=nil) -> an_enumerator
*
* Calls <i>block</i> for each element of <i>enum</i> repeatedly _n_
@@ -2192,8 +2270,8 @@ cycle_i(VALUE i, VALUE ary, int argc, VALUE *argv)
* If no block is given, an enumerator is returned instead.
*
* a = ["a", "b", "c"]
- * a.cycle {|x| puts x } # print, a, b, c, a, b, c,.. forever.
- * a.cycle(2) {|x| puts x } # print, a, b, c, a, b, c.
+ * a.cycle { |x| puts x } # print, a, b, c, a, b, c,.. forever.
+ * a.cycle(2) { |x| puts x } # print, a, b, c, a, b, c.
*
*/
@@ -2206,7 +2284,7 @@ enum_cycle(int argc, VALUE *argv, VALUE obj)
rb_scan_args(argc, argv, "01", &nv);
- RETURN_ENUMERATOR(obj, argc, argv);
+ RETURN_SIZED_ENUMERATOR(obj, argc, argv, enum_cycle_size);
if (NIL_P(nv)) {
n = -1;
}
@@ -2238,7 +2316,7 @@ struct chunk_arg {
static VALUE
chunk_ii(VALUE i, VALUE _argp, int argc, VALUE *argv)
{
- struct chunk_arg *argp = (struct chunk_arg *)_argp;
+ struct chunk_arg *argp = MEMO_FOR(struct chunk_arg, _argp);
VALUE v;
VALUE alone = ID2SYM(rb_intern("_alone"));
VALUE separator = ID2SYM(rb_intern("_separator"));
@@ -2246,20 +2324,20 @@ chunk_ii(VALUE i, VALUE _argp, int argc, VALUE *argv)
ENUM_WANT_SVALUE();
if (NIL_P(argp->state))
- v = rb_funcall(argp->categorize, rb_intern("call"), 1, i);
+ v = rb_funcall(argp->categorize, id_call, 1, i);
else
- v = rb_funcall(argp->categorize, rb_intern("call"), 2, i, argp->state);
+ v = rb_funcall(argp->categorize, id_call, 2, i, argp->state);
if (v == alone) {
if (!NIL_P(argp->prev_value)) {
- rb_funcall(argp->yielder, rb_intern("<<"), 1, rb_assoc_new(argp->prev_value, argp->prev_elts));
+ rb_funcall(argp->yielder, id_lshift, 1, rb_assoc_new(argp->prev_value, argp->prev_elts));
argp->prev_value = argp->prev_elts = Qnil;
}
- rb_funcall(argp->yielder, rb_intern("<<"), 1, rb_assoc_new(v, rb_ary_new3(1, i)));
+ rb_funcall(argp->yielder, id_lshift, 1, rb_assoc_new(v, rb_ary_new3(1, i)));
}
else if (NIL_P(v) || v == separator) {
if (!NIL_P(argp->prev_value)) {
- rb_funcall(argp->yielder, rb_intern("<<"), 1, rb_assoc_new(argp->prev_value, argp->prev_elts));
+ rb_funcall(argp->yielder, id_lshift, 1, rb_assoc_new(argp->prev_value, argp->prev_elts));
argp->prev_value = argp->prev_elts = Qnil;
}
}
@@ -2276,7 +2354,7 @@ chunk_ii(VALUE i, VALUE _argp, int argc, VALUE *argv)
rb_ary_push(argp->prev_elts, i);
}
else {
- rb_funcall(argp->yielder, rb_intern("<<"), 1, rb_assoc_new(argp->prev_value, argp->prev_elts));
+ rb_funcall(argp->yielder, id_lshift, 1, rb_assoc_new(argp->prev_value, argp->prev_elts));
argp->prev_value = v;
argp->prev_elts = rb_ary_new3(1, i);
}
@@ -2289,28 +2367,30 @@ static VALUE
chunk_i(VALUE yielder, VALUE enumerator, int argc, VALUE *argv)
{
VALUE enumerable;
- struct chunk_arg arg;
+ VALUE arg;
+ struct chunk_arg *memo = NEW_MEMO_FOR(struct chunk_arg, arg);
enumerable = rb_ivar_get(enumerator, rb_intern("chunk_enumerable"));
- arg.categorize = rb_ivar_get(enumerator, rb_intern("chunk_categorize"));
- arg.state = rb_ivar_get(enumerator, rb_intern("chunk_initial_state"));
- arg.prev_value = Qnil;
- arg.prev_elts = Qnil;
- arg.yielder = yielder;
-
- if (!NIL_P(arg.state))
- arg.state = rb_obj_dup(arg.state);
-
- rb_block_call(enumerable, id_each, 0, 0, chunk_ii, (VALUE)&arg);
- if (!NIL_P(arg.prev_elts))
- rb_funcall(arg.yielder, rb_intern("<<"), 1, rb_assoc_new(arg.prev_value, arg.prev_elts));
+ memo->categorize = rb_ivar_get(enumerator, rb_intern("chunk_categorize"));
+ memo->state = rb_ivar_get(enumerator, rb_intern("chunk_initial_state"));
+ memo->prev_value = Qnil;
+ memo->prev_elts = Qnil;
+ memo->yielder = yielder;
+
+ if (!NIL_P(memo->state))
+ memo->state = rb_obj_dup(memo->state);
+
+ rb_block_call(enumerable, id_each, 0, 0, chunk_ii, arg);
+ memo = MEMO_FOR(struct chunk_arg, arg);
+ if (!NIL_P(memo->prev_elts))
+ rb_funcall(memo->yielder, id_lshift, 1, rb_assoc_new(memo->prev_value, memo->prev_elts));
return Qnil;
}
/*
* call-seq:
- * enum.chunk {|elt| ... } -> an_enumerator
- * enum.chunk(initial_state) {|elt, state| ... } -> an_enumerator
+ * enum.chunk { |elt| ... } -> an_enumerator
+ * enum.chunk(initial_state) { |elt, state| ... } -> an_enumerator
*
* Creates an enumerator for each chunked elements.
* The consecutive elements which have same block value are chunked.
@@ -2318,15 +2398,15 @@ chunk_i(VALUE yielder, VALUE enumerator, int argc, VALUE *argv)
* The result enumerator yields the block value and an array of chunked elements.
* So "each" method can be called as follows.
*
- * enum.chunk {|elt| key }.each {|key, ary| ... }
- * enum.chunk(initial_state) {|elt, state| key }.each {|key, ary| ... }
+ * enum.chunk { |elt| key }.each { |key, ary| ... }
+ * enum.chunk(initial_state) { |elt, state| key }.each { |key, ary| ... }
*
* For example, consecutive even numbers and odd numbers can be
* splitted as follows.
*
- * [3,1,4,1,5,9,2,6,5,3,5].chunk {|n|
+ * [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5].chunk { |n|
* n.even?
- * }.each {|even, ary|
+ * }.each { |even, ary|
* p [even, ary]
* }
* #=> [false, [3, 1]]
@@ -2338,8 +2418,8 @@ chunk_i(VALUE yielder, VALUE enumerator, int argc, VALUE *argv)
* This method is especially useful for sorted series of elements.
* The following example counts words for each initial letter.
*
- * open("/usr/share/dict/words", "r:iso-8859-1") {|f|
- * f.chunk {|line| line.ord }.each {|ch, lines| p [ch.chr, lines.length] }
+ * open("/usr/share/dict/words", "r:iso-8859-1") { |f|
+ * f.chunk { |line| line.ord }.each { |ch, lines| p [ch.chr, lines.length] }
* }
* #=> ["\n", 1]
* # ["A", 1327]
@@ -2357,10 +2437,10 @@ chunk_i(VALUE yielder, VALUE enumerator, int argc, VALUE *argv)
* For example, the sequence of hyphens in svn log can be eliminated as follows.
*
* sep = "-"*72 + "\n"
- * IO.popen("svn log README") {|f|
- * f.chunk {|line|
+ * IO.popen("svn log README") { |f|
+ * f.chunk { |line|
* line != sep || nil
- * }.each {|_, lines|
+ * }.each { |_, lines|
* pp lines
* }
* }
@@ -2376,9 +2456,9 @@ chunk_i(VALUE yielder, VALUE enumerator, int argc, VALUE *argv)
*
* paragraphs separated by empty lines can be parsed as follows.
*
- * File.foreach("README").chunk {|line|
+ * File.foreach("README").chunk { |line|
* /\A\s*\z/ !~ line || nil
- * }.each {|_, lines|
+ * }.each { |_, lines|
* pp lines
* }
*
@@ -2387,8 +2467,8 @@ chunk_i(VALUE yielder, VALUE enumerator, int argc, VALUE *argv)
* pass other lines, chunk can be used as follows.
*
* pat = /\A[A-Z][A-Za-z0-9_]+\#/
- * open(filename) {|f|
- * f.chunk {|line| pat =~ line ? $& : :_alone }.each {|key, lines|
+ * open(filename) { |f|
+ * f.chunk { |line| pat =~ line ? $& : :_alone }.each { |key, lines|
* if key != :_alone
* print lines.sort.join('')
* else
@@ -2434,7 +2514,7 @@ struct slicebefore_arg {
static VALUE
slicebefore_ii(VALUE i, VALUE _argp, int argc, VALUE *argv)
{
- struct slicebefore_arg *argp = (struct slicebefore_arg *)_argp;
+ struct slicebefore_arg *argp = MEMO_FOR(struct slicebefore_arg, _argp);
VALUE header_p;
ENUM_WANT_SVALUE();
@@ -2442,12 +2522,12 @@ slicebefore_ii(VALUE i, VALUE _argp, int argc, VALUE *argv)
if (!NIL_P(argp->sep_pat))
header_p = rb_funcall(argp->sep_pat, id_eqq, 1, i);
else if (NIL_P(argp->state))
- header_p = rb_funcall(argp->sep_pred, rb_intern("call"), 1, i);
+ header_p = rb_funcall(argp->sep_pred, id_call, 1, i);
else
- header_p = rb_funcall(argp->sep_pred, rb_intern("call"), 2, i, argp->state);
+ header_p = rb_funcall(argp->sep_pred, id_call, 2, i, argp->state);
if (RTEST(header_p)) {
if (!NIL_P(argp->prev_elts))
- rb_funcall(argp->yielder, rb_intern("<<"), 1, argp->prev_elts);
+ rb_funcall(argp->yielder, id_lshift, 1, argp->prev_elts);
argp->prev_elts = rb_ary_new3(1, i);
}
else {
@@ -2464,69 +2544,71 @@ static VALUE
slicebefore_i(VALUE yielder, VALUE enumerator, int argc, VALUE *argv)
{
VALUE enumerable;
- struct slicebefore_arg arg;
+ VALUE arg;
+ struct slicebefore_arg *memo = NEW_MEMO_FOR(struct slicebefore_arg, arg);
enumerable = rb_ivar_get(enumerator, rb_intern("slicebefore_enumerable"));
- arg.sep_pred = rb_attr_get(enumerator, rb_intern("slicebefore_sep_pred"));
- arg.sep_pat = NIL_P(arg.sep_pred) ? rb_ivar_get(enumerator, rb_intern("slicebefore_sep_pat")) : Qnil;
- arg.state = rb_ivar_get(enumerator, rb_intern("slicebefore_initial_state"));
- arg.prev_elts = Qnil;
- arg.yielder = yielder;
-
- if (!NIL_P(arg.state))
- arg.state = rb_obj_dup(arg.state);
-
- rb_block_call(enumerable, id_each, 0, 0, slicebefore_ii, (VALUE)&arg);
- if (!NIL_P(arg.prev_elts))
- rb_funcall(arg.yielder, rb_intern("<<"), 1, arg.prev_elts);
+ memo->sep_pred = rb_attr_get(enumerator, rb_intern("slicebefore_sep_pred"));
+ memo->sep_pat = NIL_P(memo->sep_pred) ? rb_ivar_get(enumerator, rb_intern("slicebefore_sep_pat")) : Qnil;
+ memo->state = rb_attr_get(enumerator, rb_intern("slicebefore_initial_state"));
+ memo->prev_elts = Qnil;
+ memo->yielder = yielder;
+
+ if (!NIL_P(memo->state))
+ memo->state = rb_obj_dup(memo->state);
+
+ rb_block_call(enumerable, id_each, 0, 0, slicebefore_ii, arg);
+ memo = MEMO_FOR(struct slicebefore_arg, arg);
+ if (!NIL_P(memo->prev_elts))
+ rb_funcall(memo->yielder, id_lshift, 1, memo->prev_elts);
return Qnil;
}
/*
* call-seq:
- * enum.slice_before(pattern) -> an_enumerator
- * enum.slice_before {|elt| bool } -> an_enumerator
- * enum.slice_before(initial_state) {|elt, state| bool } -> an_enumerator
+ * enum.slice_before(pattern) -> an_enumerator
+ * enum.slice_before { |elt| bool } -> an_enumerator
+ * enum.slice_before(initial_state) { |elt, state| bool } -> an_enumerator
*
* Creates an enumerator for each chunked elements.
* The beginnings of chunks are defined by _pattern_ and the block.
- * If _pattern_ === _elt_ returns true or
- * the block returns true for the element,
- * the element is beginning of a chunk.
- *
- * The === and block is called from the first element to the last element
- * of _enum_.
- * The result for the first element is ignored.
- *
- * The result enumerator yields the chunked elements as an array for +each+
- * method.
- * +each+ method can be called as follows.
+
+ * If <code>_pattern_ === _elt_</code> returns <code>true</code> or the block
+ * returns <code>true</code> for the element, the element is beginning of a
+ * chunk.
+
+ * The <code>===</code> and _block_ is called from the first element to the last
+ * element of _enum_. The result for the first element is ignored.
+
+ * The result enumerator yields the chunked elements as an array.
+ * So +each+ method can be called as follows:
*
- * enum.slice_before(pattern).each {|ary| ... }
- * enum.slice_before {|elt| bool }.each {|ary| ... }
- * enum.slice_before(initial_state) {|elt, state| bool }.each {|ary| ... }
+ * enum.slice_before(pattern).each { |ary| ... }
+ * enum.slice_before { |elt| bool }.each { |ary| ... }
+ * enum.slice_before(initial_state) { |elt, state| bool }.each { |ary| ... }
*
- * Other methods of Enumerator class and Enumerable module,
+ * Other methods of the Enumerator class and Enumerable module,
* such as map, etc., are also usable.
*
* For example, iteration over ChangeLog entries can be implemented as
- * follows.
+ * follows:
*
* # iterate over ChangeLog entries.
- * open("ChangeLog") {|f|
- * f.slice_before(/\A\S/).each {|e| pp e}
+ * open("ChangeLog") { |f|
+ * f.slice_before(/\A\S/).each { |e| pp e }
* }
*
* # same as above. block is used instead of pattern argument.
- * open("ChangeLog") {|f|
- * f.slice_before {|line| /\A\S/ === line }.each {|e| pp e}
+ * open("ChangeLog") { |f|
+ * f.slice_before { |line| /\A\S/ === line }.each { |e| pp e }
* }
*
- * "svn proplist -R" produces multiline output for each file.
- * They can be chunked as follows:
*
- * IO.popen([{"LC_ALL"=>"C"}, "svn", "proplist", "-R"]) {|f|
- * f.lines.slice_before(/\AProp/).each {|lines| p lines }
+ * "svn proplist -R" produces multiline output for each file.
+ * They can be chunked as follows:
+ *
+ * IO.popen([{"LC_ALL"=>"C"}, "svn", "proplist", "-R"]) { |f|
+ * f.lines.slice_before(/\AProp/).each { |lines| p lines }
* }
* #=> ["Properties on '.':\n", " svn:ignore\n", " svk:merge\n"]
* # ["Properties on 'goruby.c':\n", " svn:eol-style\n"]
@@ -2539,30 +2621,29 @@ slicebefore_i(VALUE yielder, VALUE enumerator, int argc, VALUE *argv)
* For example, three or more consecutive increasing numbers can be squashed
* as follows:
*
- * a = [0,2,3,4,6,7,9]
+ * a = [0, 2, 3, 4, 6, 7, 9]
* prev = a[0]
- * p a.slice_before {|e|
+ * p a.slice_before { |e|
* prev, prev2 = e, prev
* prev2 + 1 != e
- * }.map {|es|
+ * }.map { |es|
* es.length <= 2 ? es.join(",") : "#{es.first}-#{es.last}"
* }.join(",")
* #=> "0,2-4,6,7,9"
*
* However local variables are not appropriate to maintain state
* if the result enumerator is used twice or more.
- * In such case, the last state of the 1st +each+ is used in 2nd +each+.
- * _initial_state_ argument can be used to avoid this problem.
+ * In such a case, the last state of the 1st +each+ is used in the 2nd +each+.
+ * The _initial_state_ argument can be used to avoid this problem.
* If non-nil value is given as _initial_state_,
- * it is duplicated for each "each" method invocation of the enumerator.
+ * it is duplicated for each +each+ method invocation of the enumerator.
* The duplicated object is passed to 2nd argument of the block for
* +slice_before+ method.
*
- * # word wrapping.
- * # this assumes all characters have same width.
+ * # Word wrapping. This assumes all characters have same width.
* def wordwrap(words, maxwidth)
* # if cols is a local variable, 2nd "each" may start with non-zero cols.
- * words.slice_before(cols: 0) {|w, h|
+ * words.slice_before(cols: 0) { |w, h|
* h[:cols] += 1 if h[:cols] != 0
* h[:cols] += w.length
* if maxwidth < h[:cols]
@@ -2576,7 +2657,7 @@ slicebefore_i(VALUE yielder, VALUE enumerator, int argc, VALUE *argv)
* text = (1..20).to_a.join(" ")
* enum = wordwrap(text.split(/\s+/), 10)
* puts "-"*10
- * enum.each {|ws| puts ws.join(" ") }
+ * enum.each { |ws| puts ws.join(" ") }
* puts "-"*10
* #=> ----------
* # 1 2 3 4 5
@@ -2587,20 +2668,20 @@ slicebefore_i(VALUE yielder, VALUE enumerator, int argc, VALUE *argv)
* # 20
* # ----------
*
- * mbox contains series of mails which start with Unix From line.
- * So each mail can be extracted by slice before Unix From line.
+ * mbox contains series of mails which start with Unix From line.
+ * So each mail can be extracted by slice before Unix From line.
*
* # parse mbox
- * open("mbox") {|f|
- * f.slice_before {|line|
+ * open("mbox") { |f|
+ * f.slice_before { |line|
* line.start_with? "From "
- * }.each {|mail|
+ * }.each { |mail|
* unix_from = mail.shift
* i = mail.index("\n")
* header = mail[0...i]
* body = mail[(i+1)..-1]
* body.pop if body.last == "\n"
- * fields = header.slice_before {|line| !" \t".include?(line[0]) }.to_a
+ * fields = header.slice_before { |line| !" \t".include?(line[0]) }.to_a
* p unix_from
* pp fields
* pp body
@@ -2608,12 +2689,12 @@ slicebefore_i(VALUE yielder, VALUE enumerator, int argc, VALUE *argv)
* }
*
* # split mails in mbox (slice before Unix From line after an empty line)
- * open("mbox") {|f|
- * f.slice_before(emp: true) {|line,h|
+ * open("mbox") { |f|
+ * f.slice_before(emp: true) { |line, h|
* prevemp = h[:emp]
* h[:emp] = line == "\n"
* prevemp && line.start_with?("From ")
- * }.each {|mail|
+ * }.each { |mail|
* mail.pop if mail.last == "\n"
* pp mail
* }
@@ -2712,4 +2793,7 @@ Init_Enumerable(void)
rb_define_method(rb_mEnumerable, "slice_before", enum_slice_before, -1);
id_next = rb_intern("next");
+ id_call = rb_intern("call");
+ id_size = rb_intern("size");
+ id_div = rb_intern("div");
}
diff --git a/enumerator.c b/enumerator.c
index 8b1add254a..8f6ac76abf 100644
--- a/enumerator.c
+++ b/enumerator.c
@@ -13,6 +13,8 @@
************************************************/
#include "ruby/ruby.h"
+#include "node.h"
+#include "internal.h"
/*
* Document-class: Enumerator
@@ -30,17 +32,22 @@
*
* enumerator = %w(one two three).each
* puts enumerator.class # => Enumerator
- * enumerator.each_with_object("foo") do |item,obj|
+ *
+ * enumerator.each_with_object("foo") do |item, obj|
* puts "#{obj}: #{item}"
* end
+ *
* # foo: one
* # foo: two
* # foo: three
+ *
* enum_with_obj = enumerator.each_with_object("foo")
* puts enum_with_obj.class # => Enumerator
- * enum_with_obj.each do |item,obj|
- * puts "#{obj: #{item}"
+ *
+ * enum_with_obj.each do |item, obj|
+ * puts "#{obj}: #{item}"
* end
+ *
* # foo: one
* # foo: two
* # foo: three
@@ -49,7 +56,7 @@
* can map a list's elements to strings containing the index
* and the element as a string via:
*
- * puts %w[foo bar baz].map.with_index {|w,i| "#{i}:#{w}" }
+ * puts %w[foo bar baz].map.with_index { |w, i| "#{i}:#{w}" }
* # => ["0:foo", "1:bar", "2:baz"]
*
* An Enumerator can also be used as an external iterator.
@@ -96,8 +103,10 @@
*
*/
VALUE rb_cEnumerator;
-static ID id_rewind, id_each;
-static VALUE sym_each;
+VALUE rb_cLazy;
+static ID id_rewind, id_each, id_new, id_initialize, id_yield, id_call, id_size;
+static ID id_eqq, id_next, id_result, id_lazy, id_receiver, id_arguments, id_method;
+static VALUE sym_each, sym_cycle;
VALUE rb_eStopIteration;
@@ -110,6 +119,8 @@ struct enumerator {
VALUE lookahead;
VALUE feedvalue;
VALUE stop_exc;
+ VALUE size;
+ VALUE (*size_fn)(ANYARGS);
};
static VALUE rb_cGenerator, rb_cYielder;
@@ -139,6 +150,7 @@ enumerator_mark(void *p)
rb_gc_mark(ptr->lookahead);
rb_gc_mark(ptr->feedvalue);
rb_gc_mark(ptr->stop_exc);
+ rb_gc_mark(ptr->size);
}
#define enumerator_free RUBY_TYPED_DEFAULT_FREE
@@ -174,6 +186,8 @@ enumerator_ptr(VALUE obj)
* call-seq:
* obj.to_enum(method = :each, *args)
* obj.enum_for(method = :each, *args)
+ * obj.to_enum(method = :each, *args) {|obj, *args| block}
+ * obj.enum_for(method = :each, *args){|obj, *args| block}
*
* Creates a new Enumerator which will enumerate by on calling +method+ on
* +obj+.
@@ -183,6 +197,9 @@ enumerator_ptr(VALUE obj)
* to the item itself. Note that the number of args
* must not exceed the number expected by +method+
*
+ * If a block is given, it will be used to calculate the size of
+ * the enumerator (see Enumerator#size=).
+ *
* === Example
*
* str = "xyz"
@@ -201,13 +218,17 @@ enumerator_ptr(VALUE obj)
static VALUE
obj_to_enum(int argc, VALUE *argv, VALUE obj)
{
- VALUE meth = sym_each;
+ VALUE enumerator, meth = sym_each;
if (argc > 0) {
--argc;
meth = *argv++;
}
- return rb_enumeratorize(obj, meth, argc, argv);
+ enumerator = rb_enumeratorize_with_size(obj, meth, argc, argv, 0);
+ if (rb_block_given_p()) {
+ enumerator_ptr(enumerator)->size = rb_block_proc();
+ }
+ return enumerator;
}
static VALUE
@@ -223,7 +244,7 @@ enumerator_allocate(VALUE klass)
}
static VALUE
-enumerator_init(VALUE enum_obj, VALUE obj, VALUE meth, int argc, VALUE *argv)
+enumerator_init(VALUE enum_obj, VALUE obj, VALUE meth, int argc, VALUE *argv, VALUE (*size_fn)(ANYARGS), VALUE size)
{
struct enumerator *ptr;
@@ -241,13 +262,15 @@ enumerator_init(VALUE enum_obj, VALUE obj, VALUE meth, int argc, VALUE *argv)
ptr->lookahead = Qundef;
ptr->feedvalue = Qundef;
ptr->stop_exc = Qfalse;
+ ptr->size = size;
+ ptr->size_fn = size_fn;
return enum_obj;
}
/*
* call-seq:
- * Enumerator.new { |yielder| ... }
+ * Enumerator.new(size = nil) { |yielder| ... }
* Enumerator.new(obj, method = :each, *args)
*
* Creates a new Enumerator object, which can be used as an
@@ -267,6 +290,67 @@ enumerator_init(VALUE enum_obj, VALUE obj, VALUE meth, int argc, VALUE *argv)
*
* p fib.take(10) # => [1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
*
+ * The optional parameter can be used to specify how to calculate the size
+ * in a lazy fashion (see Enumerable#size). It can either be a value or
+ * a callable object.
+ *
+ * The block form can be used to create a lazy enumeration that only processes
+ * elements as-needed. The generic pattern for this is:
+ *
+ * Enumerator.new do |yielder|
+ * source.each do |source_item|
+ * # process source_item and append the yielder
+ * end
+ * end
+ *
+ * This can be used with infinite streams to support multiple chains:
+ *
+ * class Fib
+ * def initialize(a = 1, b = 1)
+ * @a, @b = a, b
+ * end
+ *
+ * def each
+ * a, b = @a, @b
+ * yield a
+ * while true
+ * yield b
+ * a, b = b, a+b
+ * end
+ * end
+ * end
+ *
+ * def lazy_select enum
+ * Enumerator.new do |y|
+ * enum.each do |e|
+ * y << e if yield e
+ * end
+ * end
+ * end
+ *
+ * def lazy_map enum
+ * Enumerator.new do |y|
+ * enum.each do |e|
+ * y << yield(e)
+ * end
+ * end
+ * end
+ *
+ * even_fibs = lazy_select(Fibs.new) { |x| x % 2 == 0 }
+ * string_fibs = lazy_map(even_fibs) { |x| "<#{x}>" }
+ * string_fibs.each_with_index do |fib, i|
+ * puts "#{i}: #{fib}"
+ * break if i >= 3
+ * end
+ *
+ * This allows output even though the Fib produces an infinite sequence of
+ * Fibonacci numbers:
+ *
+ * 0: <2>
+ * 1: <8>
+ * 2: <34>
+ * 3: <144>
+ *
* In the second, deprecated, form, a generated Enumerator iterates over the
* given object using the given method with the given arguments passed.
*
@@ -283,14 +367,24 @@ static VALUE
enumerator_initialize(int argc, VALUE *argv, VALUE obj)
{
VALUE recv, meth = sym_each;
+ VALUE size = Qnil;
- if (argc == 0) {
- if (!rb_block_given_p())
- rb_raise(rb_eArgError, "wrong number of argument (0 for 1+)");
-
+ if (rb_block_given_p()) {
+ rb_check_arity(argc, 0, 1);
recv = generator_init(generator_allocate(rb_cGenerator), rb_block_proc());
+ if (argc) {
+ if (NIL_P(argv[0]) || rb_obj_is_proc(argv[0]) ||
+ (TYPE(argv[0]) == T_FLOAT && RFLOAT_VALUE(argv[0]) == INFINITY)) {
+ size = argv[0];
+ } else {
+ size = rb_to_int(argv[0]);
+ }
+ argc = 0;
+ }
}
else {
+ rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS);
+ rb_warn("Enumerator.new without a block is deprecated; use Object#to_enum");
recv = *argv++;
if (--argc) {
meth = *argv++;
@@ -298,7 +392,7 @@ enumerator_initialize(int argc, VALUE *argv, VALUE obj)
}
}
- return enumerator_init(obj, recv, meth, argc, argv);
+ return enumerator_init(obj, recv, meth, argc, argv, 0, size);
}
/* :nodoc: */
@@ -307,6 +401,7 @@ enumerator_init_copy(VALUE obj, VALUE orig)
{
struct enumerator *ptr0, *ptr1;
+ if (!OBJ_INIT_COPY(obj, orig)) return obj;
ptr0 = enumerator_ptr(orig);
if (ptr0->fib) {
/* Fibers cannot be copied */
@@ -325,14 +420,25 @@ enumerator_init_copy(VALUE obj, VALUE orig)
ptr1->fib = 0;
ptr1->lookahead = Qundef;
ptr1->feedvalue = Qundef;
+ ptr1->size = ptr0->size;
+ ptr1->size_fn = ptr0->size_fn;
return obj;
}
+/*
+ * For backwards compatibility; use rb_enumeratorize_with_size
+ */
VALUE
rb_enumeratorize(VALUE obj, VALUE meth, int argc, VALUE *argv)
{
- return enumerator_init(enumerator_allocate(rb_cEnumerator), obj, meth, argc, argv);
+ return rb_enumeratorize_with_size(obj, meth, argc, argv, 0);
+}
+
+VALUE
+rb_enumeratorize_with_size(VALUE obj, VALUE meth, int argc, VALUE *argv, VALUE (*size_fn)(ANYARGS))
+{
+ return enumerator_init(enumerator_allocate(rb_cEnumerator), obj, meth, argc, argv, size_fn, Qnil);
}
static VALUE
@@ -359,8 +465,20 @@ enumerator_block_call(VALUE obj, rb_block_call_func *func, VALUE arg)
*
*/
static VALUE
-enumerator_each(VALUE obj)
+enumerator_each(int argc, VALUE *argv, VALUE obj)
{
+ if (argc > 0) {
+ struct enumerator *e = enumerator_ptr(obj = rb_obj_dup(obj));
+ VALUE args = e->args;
+ if (args) {
+ args = rb_ary_dup(args);
+ rb_ary_cat(args, argv, argc);
+ }
+ else {
+ args = rb_ary_new4(argc, argv);
+ }
+ e->args = args;
+ }
if (!rb_block_given_p()) return obj;
return enumerator_block_call(obj, 0, obj);
}
@@ -380,6 +498,9 @@ enumerator_with_index_i(VALUE val, VALUE m, int argc, VALUE *argv)
return rb_yield_values(2, rb_ary_new4(argc, argv), idx);
}
+static VALUE
+enumerator_size(VALUE obj);
+
/*
* call-seq:
* e.with_index(offset = 0) {|(*args), idx| ... }
@@ -398,7 +519,7 @@ enumerator_with_index(int argc, VALUE *argv, VALUE obj)
VALUE memo;
rb_scan_args(argc, argv, "01", &memo);
- RETURN_ENUMERATOR(obj, argc, argv);
+ RETURN_SIZED_ENUMERATOR(obj, argc, argv, enumerator_size);
memo = NIL_P(memo) ? 0 : (VALUE)NUM2LONG(memo);
return enumerator_block_call(obj, enumerator_with_index_i, (VALUE)&memo);
}
@@ -458,7 +579,7 @@ enumerator_with_object_i(VALUE val, VALUE memo, int argc, VALUE *argv)
static VALUE
enumerator_with_object(VALUE obj, VALUE memo)
{
- RETURN_ENUMERATOR(obj, 1, &memo);
+ RETURN_SIZED_ENUMERATOR(obj, 1, &memo, enumerator_size);
enumerator_block_call(obj, enumerator_with_object_i, memo);
return memo;
@@ -487,7 +608,7 @@ next_i(VALUE curr, VALUE obj)
result = rb_block_call(obj, id_each, 0, 0, next_ii, obj);
e->stop_exc = rb_exc_new2(rb_eStopIteration, "iteration reached an end");
- rb_ivar_set(e->stop_exc, rb_intern("result"), result);
+ rb_ivar_set(e->stop_exc, id_result, result);
return rb_fiber_yield(1, &nil);
}
@@ -590,7 +711,7 @@ enumerator_next_values(VALUE obj)
static VALUE
ary2sv(VALUE args, int dup)
{
- if (TYPE(args) != T_ARRAY)
+ if (!RB_TYPE_P(args, T_ARRAY))
return args;
switch (RARRAY_LEN(args)) {
@@ -755,7 +876,7 @@ enumerator_feed(VALUE obj, VALUE v)
* call-seq:
* e.rewind -> e
*
- * Rewinds the enumeration sequence by one step.
+ * Rewinds the enumeration sequence to the beginning.
*
* If the enclosed object responds to a "rewind" method, it is called.
*/
@@ -780,7 +901,7 @@ inspect_enumerator(VALUE obj, VALUE dummy, int recur)
{
struct enumerator *e;
const char *cname;
- VALUE eobj, str;
+ VALUE eobj, eargs, str, method;
int tainted, untrusted;
TypedData_Get_Struct(obj, struct enumerator, &enumerator_data_type, e);
@@ -797,7 +918,10 @@ inspect_enumerator(VALUE obj, VALUE dummy, int recur)
return str;
}
- eobj = e->obj;
+ eobj = rb_attr_get(obj, id_receiver);
+ if (NIL_P(eobj)) {
+ eobj = e->obj;
+ }
tainted = OBJ_TAINTED(eobj);
untrusted = OBJ_UNTRUSTED(eobj);
@@ -805,23 +929,37 @@ inspect_enumerator(VALUE obj, VALUE dummy, int recur)
/* (1..100).each_cons(2) => "#<Enumerator: 1..100:each_cons(2)>" */
str = rb_sprintf("#<%s: ", cname);
rb_str_concat(str, rb_inspect(eobj));
- rb_str_buf_cat2(str, ":");
- rb_str_buf_cat2(str, rb_id2name(e->meth));
+ method = rb_attr_get(obj, id_method);
+ if (NIL_P(method)) {
+ rb_str_buf_cat2(str, ":");
+ rb_str_buf_cat2(str, rb_id2name(e->meth));
+ }
+ else if (method != Qfalse) {
+ Check_Type(method, T_SYMBOL);
+ rb_str_buf_cat2(str, ":");
+ rb_str_buf_cat2(str, rb_id2name(SYM2ID(method)));
+ }
- if (e->args) {
- long argc = RARRAY_LEN(e->args);
- VALUE *argv = RARRAY_PTR(e->args);
+ eargs = rb_attr_get(obj, id_arguments);
+ if (NIL_P(eargs)) {
+ eargs = e->args;
+ }
+ if (eargs != Qfalse) {
+ long argc = RARRAY_LEN(eargs);
+ VALUE *argv = RARRAY_PTR(eargs);
- rb_str_buf_cat2(str, "(");
+ if (argc > 0) {
+ rb_str_buf_cat2(str, "(");
- while (argc--) {
- VALUE arg = *argv++;
+ while (argc--) {
+ VALUE arg = *argv++;
- rb_str_concat(str, rb_inspect(arg));
- rb_str_buf_cat2(str, argc > 0 ? ", " : ")");
+ rb_str_concat(str, rb_inspect(arg));
+ rb_str_buf_cat2(str, argc > 0 ? ", " : ")");
- if (OBJ_TAINTED(arg)) tainted = TRUE;
- if (OBJ_UNTRUSTED(arg)) untrusted = TRUE;
+ if (OBJ_TAINTED(arg)) tainted = TRUE;
+ if (OBJ_UNTRUSTED(arg)) untrusted = TRUE;
+ }
}
}
@@ -846,6 +984,34 @@ enumerator_inspect(VALUE obj)
}
/*
+ * call-seq:
+ * e.size -> int, Float::INFINITY or nil
+ *
+ * Returns the size of the enumerator, or +nil+ if it can't be calculated lazily.
+ *
+ * (1..100).to_a.permutation(4).size # => 94109400
+ * loop.size # => Float::INFINITY
+ * (1..100).drop_while.size # => nil
+ */
+
+static VALUE
+enumerator_size(VALUE obj)
+{
+ struct enumerator *e = enumerator_ptr(obj);
+
+ if (e->size_fn) {
+ return (*e->size_fn)(e->obj, e->args);
+ }
+ if (rb_obj_is_proc(e->size)) {
+ if(e->args)
+ return rb_proc_call(e->size, e->args);
+ else
+ return rb_proc_call_with_block(e->size, 0, 0, Qnil);
+ }
+ return e->size;
+}
+
+/*
* Yielder
*/
static void
@@ -1028,7 +1194,8 @@ generator_initialize(int argc, VALUE *argv, VALUE obj)
rb_need_block();
proc = rb_block_proc();
- } else {
+ }
+ else {
rb_scan_args(argc, argv, "1", &proc);
if (!rb_obj_is_proc(proc))
@@ -1050,6 +1217,8 @@ generator_init_copy(VALUE obj, VALUE orig)
{
struct generator *ptr0, *ptr1;
+ if (!OBJ_INIT_COPY(obj, orig)) return obj;
+
ptr0 = generator_ptr(orig);
TypedData_Get_Struct(obj, struct generator, &generator_data_type, ptr1);
@@ -1065,14 +1234,560 @@ generator_init_copy(VALUE obj, VALUE orig)
/* :nodoc: */
static VALUE
-generator_each(VALUE obj)
+generator_each(int argc, VALUE *argv, VALUE obj)
{
struct generator *ptr = generator_ptr(obj);
- VALUE yielder;
+ VALUE args = rb_ary_new2(argc + 1);
- yielder = yielder_new();
+ rb_ary_push(args, yielder_new());
+ if (argc > 0) {
+ rb_ary_cat(args, argv, argc);
+ }
- return rb_proc_call(ptr->proc, rb_ary_new3(1, yielder));
+ return rb_proc_call(ptr->proc, args);
+}
+
+/* Lazy Enumerator methods */
+static VALUE
+lazy_receiver_size(VALUE self)
+{
+ VALUE r = rb_check_funcall(rb_ivar_get(self, id_receiver), id_size, 0, 0);
+ return (r == Qundef) ? Qnil : r;
+}
+
+static VALUE
+lazy_size(VALUE self)
+{
+ struct enumerator *e = enumerator_ptr(self);
+ if (e->size_fn) {
+ return (*e->size_fn)(self);
+ }
+ return Qnil;
+}
+
+static VALUE
+lazy_init_iterator(VALUE val, VALUE m, int argc, VALUE *argv)
+{
+ VALUE result;
+ if (argc == 1) {
+ VALUE args[2];
+ args[0] = m;
+ args[1] = val;
+ result = rb_yield_values2(2, args);
+ }
+ else {
+ VALUE args;
+ int len = rb_long2int((long)argc + 1);
+
+ args = rb_ary_tmp_new(len);
+ rb_ary_push(args, m);
+ if (argc > 0) {
+ rb_ary_cat(args, argv, argc);
+ }
+ result = rb_yield_values2(len, RARRAY_PTR(args));
+ RB_GC_GUARD(args);
+ }
+ if (result == Qundef) rb_iter_break();
+ return Qnil;
+}
+
+static VALUE
+lazy_init_yielder(VALUE val, VALUE m, int argc, VALUE *argv)
+{
+ VALUE result;
+ result = rb_funcall2(m, id_yield, argc, argv);
+ if (result == Qundef) rb_iter_break();
+ return Qnil;
+}
+
+static VALUE
+lazy_init_block_i(VALUE val, VALUE m, int argc, VALUE *argv)
+{
+ rb_block_call(m, id_each, argc-1, argv+1, lazy_init_iterator, val);
+ return Qnil;
+}
+
+static VALUE
+lazy_init_block(VALUE val, VALUE m, int argc, VALUE *argv)
+{
+ rb_block_call(m, id_each, argc-1, argv+1, lazy_init_yielder, val);
+ return Qnil;
+}
+
+static VALUE
+lazy_initialize(int argc, VALUE *argv, VALUE self)
+{
+ VALUE obj, meth;
+ VALUE generator;
+ int offset;
+
+ if (argc < 1) {
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 1..)", argc);
+ }
+ else {
+ obj = argv[0];
+ if (argc == 1) {
+ meth = sym_each;
+ offset = 1;
+ }
+ else {
+ meth = argv[1];
+ offset = 2;
+ }
+ }
+ generator = generator_allocate(rb_cGenerator);
+ rb_block_call(generator, id_initialize, 0, 0,
+ (rb_block_given_p() ? lazy_init_block_i : lazy_init_block),
+ obj);
+ enumerator_init(self, generator, meth, argc - offset, argv + offset, lazy_receiver_size, Qnil);
+ rb_ivar_set(self, id_receiver, obj);
+
+ return self;
+}
+
+static VALUE
+lazy_set_method(VALUE lazy, VALUE args, VALUE (*size_fn)(ANYARGS))
+{
+ ID id = rb_frame_this_func();
+ struct enumerator *e = enumerator_ptr(lazy);
+ rb_ivar_set(lazy, id_method, ID2SYM(id));
+ if (NIL_P(args)) {
+ /* Qfalse indicates that the arguments are empty */
+ rb_ivar_set(lazy, id_arguments, Qfalse);
+ }
+ else {
+ rb_ivar_set(lazy, id_arguments, args);
+ }
+ e->size_fn = size_fn;
+ return lazy;
+}
+
+/*
+ * call-seq:
+ * e.lazy -> lazy_enumerator
+ *
+ * Returns a lazy enumerator, whose methods map/collect,
+ * flat_map/collect_concat, select/find_all, reject, grep, zip, take,
+ * take_while, drop, drop_while, and cycle enumerate values only on an
+ * as-needed basis. However, if a block is given to zip or cycle, values
+ * are enumerated immediately.
+ *
+ * === Example
+ *
+ * The following program finds pythagorean triples:
+ *
+ * def pythagorean_triples
+ * (1..Float::INFINITY).lazy.flat_map {|z|
+ * (1..z).flat_map {|x|
+ * (x..z).select {|y|
+ * x**2 + y**2 == z**2
+ * }.map {|y|
+ * [x, y, z]
+ * }
+ * }
+ * }
+ * end
+ * # show first ten pythagorean triples
+ * p pythagorean_triples.take(10).force # take is lazy, so force is needed
+ * p pythagorean_triples.first(10) # first is eager
+ * # show pythagorean triples less than 100
+ * p pythagorean_triples.take_while { |*, z| z < 100 }.force
+ */
+static VALUE
+enumerable_lazy(VALUE obj)
+{
+ VALUE result;
+
+ result = rb_class_new_instance(1, &obj, rb_cLazy);
+ /* Qfalse indicates that the Enumerator::Lazy has no method name */
+ rb_ivar_set(result, id_method, Qfalse);
+ return result;
+}
+
+static VALUE
+lazy_map_func(VALUE val, VALUE m, int argc, VALUE *argv)
+{
+ VALUE result = rb_yield_values2(argc - 1, &argv[1]);
+
+ rb_funcall(argv[0], id_yield, 1, result);
+ return Qnil;
+}
+
+static VALUE
+lazy_map(VALUE obj)
+{
+ if (!rb_block_given_p()) {
+ rb_raise(rb_eArgError, "tried to call lazy map without a block");
+ }
+
+ return lazy_set_method(rb_block_call(rb_cLazy, id_new, 1, &obj,
+ lazy_map_func, 0),
+ Qnil, lazy_receiver_size);
+}
+
+static VALUE
+lazy_flat_map_i(VALUE i, VALUE yielder, int argc, VALUE *argv)
+{
+ return rb_funcall2(yielder, id_yield, argc, argv);
+}
+
+static VALUE
+lazy_flat_map_each(VALUE obj)
+{
+ NODE *memo = RNODE(obj);
+ rb_block_call(memo->u1.value, id_each, 0, 0, lazy_flat_map_i,
+ memo->u2.value);
+ return Qnil;
+}
+
+static VALUE
+lazy_flat_map_to_ary(VALUE obj)
+{
+ NODE *memo = RNODE(obj);
+ VALUE ary = rb_check_array_type(memo->u1.value);
+ if (NIL_P(ary)) {
+ rb_funcall(memo->u2.value, id_yield, 1, memo->u1.value);
+ }
+ else {
+ long i;
+ for (i = 0; i < RARRAY_LEN(ary); i++) {
+ rb_funcall(memo->u2.value, id_yield, 1, RARRAY_PTR(ary)[i]);
+ }
+ }
+ return Qnil;
+}
+
+static VALUE
+lazy_flat_map_func(VALUE val, VALUE m, int argc, VALUE *argv)
+{
+ VALUE result = rb_yield_values2(argc - 1, &argv[1]);
+ if (RB_TYPE_P(result, T_ARRAY)) {
+ long i;
+ for (i = 0; i < RARRAY_LEN(result); i++) {
+ rb_funcall(argv[0], id_yield, 1, RARRAY_PTR(result)[i]);
+ }
+ }
+ else {
+ NODE *memo;
+ memo = NEW_MEMO(result, argv[0], 0);
+ rb_rescue2(lazy_flat_map_each, (VALUE) memo,
+ lazy_flat_map_to_ary, (VALUE) memo,
+ rb_eNoMethodError, (VALUE)0);
+ }
+ return Qnil;
+}
+
+static VALUE
+lazy_flat_map(VALUE obj)
+{
+ if (!rb_block_given_p()) {
+ rb_raise(rb_eArgError, "tried to call lazy flat_map without a block");
+ }
+
+ return lazy_set_method(rb_block_call(rb_cLazy, id_new, 1, &obj,
+ lazy_flat_map_func, 0),
+ Qnil, lazy_receiver_size);
+}
+
+static VALUE
+lazy_select_func(VALUE val, VALUE m, int argc, VALUE *argv)
+{
+ VALUE element = rb_enum_values_pack(argc - 1, argv + 1);
+
+ if (RTEST(rb_yield(element))) {
+ return rb_funcall(argv[0], id_yield, 1, element);
+ }
+ return Qnil;
+}
+
+static VALUE
+lazy_select(VALUE obj)
+{
+ if (!rb_block_given_p()) {
+ rb_raise(rb_eArgError, "tried to call lazy select without a block");
+ }
+
+ return lazy_set_method(rb_block_call(rb_cLazy, id_new, 1, &obj,
+ lazy_select_func, 0),
+ Qnil, 0);
+}
+
+static VALUE
+lazy_reject_func(VALUE val, VALUE m, int argc, VALUE *argv)
+{
+ VALUE element = rb_enum_values_pack(argc - 1, argv + 1);
+
+ if (!RTEST(rb_yield(element))) {
+ return rb_funcall(argv[0], id_yield, 1, element);
+ }
+ return Qnil;
+}
+
+static VALUE
+lazy_reject(VALUE obj)
+{
+ if (!rb_block_given_p()) {
+ rb_raise(rb_eArgError, "tried to call lazy reject without a block");
+ }
+
+ return lazy_set_method(rb_block_call(rb_cLazy, id_new, 1, &obj,
+ lazy_reject_func, 0),
+ Qnil, 0);
+}
+
+static VALUE
+lazy_grep_func(VALUE val, VALUE m, int argc, VALUE *argv)
+{
+ VALUE i = rb_enum_values_pack(argc - 1, argv + 1);
+ VALUE result = rb_funcall(m, id_eqq, 1, i);
+
+ if (RTEST(result)) {
+ rb_funcall(argv[0], id_yield, 1, i);
+ }
+ return Qnil;
+}
+
+static VALUE
+lazy_grep_iter(VALUE val, VALUE m, int argc, VALUE *argv)
+{
+ VALUE i = rb_enum_values_pack(argc - 1, argv + 1);
+ VALUE result = rb_funcall(m, id_eqq, 1, i);
+
+ if (RTEST(result)) {
+ rb_funcall(argv[0], id_yield, 1, rb_yield(i));
+ }
+ return Qnil;
+}
+
+static VALUE
+lazy_grep(VALUE obj, VALUE pattern)
+{
+ return lazy_set_method(rb_block_call(rb_cLazy, id_new, 1, &obj,
+ rb_block_given_p() ?
+ lazy_grep_iter : lazy_grep_func,
+ pattern),
+ rb_ary_new3(1, pattern), 0);
+}
+
+static VALUE
+call_next(VALUE obj)
+{
+ return rb_funcall(obj, id_next, 0);
+}
+
+static VALUE
+next_stopped(VALUE obj)
+{
+ return Qnil;
+}
+
+static VALUE
+lazy_zip_func(VALUE val, VALUE arg, int argc, VALUE *argv)
+{
+ VALUE yielder, ary, v;
+ long i;
+
+ yielder = argv[0];
+ ary = rb_ary_new2(RARRAY_LEN(arg) + 1);
+ rb_ary_push(ary, argv[1]);
+ for (i = 0; i < RARRAY_LEN(arg); i++) {
+ v = rb_rescue2(call_next, RARRAY_PTR(arg)[i], next_stopped, 0,
+ rb_eStopIteration, (VALUE)0);
+ rb_ary_push(ary, v);
+ }
+ rb_funcall(yielder, id_yield, 1, ary);
+ return Qnil;
+}
+
+static VALUE
+lazy_zip(int argc, VALUE *argv, VALUE obj)
+{
+ VALUE ary;
+ int i;
+
+ if (rb_block_given_p()) {
+ return rb_call_super(argc, argv);
+ }
+ ary = rb_ary_new2(argc);
+ for (i = 0; i < argc; i++) {
+ rb_ary_push(ary, rb_funcall(argv[i], id_lazy, 0));
+ }
+
+ return lazy_set_method(rb_block_call(rb_cLazy, id_new, 1, &obj,
+ lazy_zip_func, ary),
+ rb_ary_new4(argc, argv), lazy_receiver_size);
+}
+
+static VALUE
+lazy_take_func(VALUE val, VALUE args, int argc, VALUE *argv)
+{
+ NODE *memo = RNODE(args);
+
+ rb_funcall2(argv[0], id_yield, argc - 1, argv + 1);
+ if (--memo->u3.cnt == 0) {
+ memo->u3.cnt = memo->u2.argc;
+ return Qundef;
+ }
+ else {
+ return Qnil;
+ }
+}
+
+static VALUE
+lazy_take_size(VALUE lazy)
+{
+ long len = NUM2LONG(RARRAY_PTR(rb_ivar_get(lazy, id_arguments))[0]);
+ VALUE receiver = lazy_receiver_size(lazy);
+ if (NIL_P(receiver) || (FIXNUM_P(receiver) && FIX2LONG(receiver) < len))
+ return receiver;
+ return LONG2NUM(len);
+}
+
+static VALUE
+lazy_take(VALUE obj, VALUE n)
+{
+ NODE *memo;
+ long len = NUM2LONG(n);
+ int argc = 1;
+ VALUE argv[3];
+
+ if (len < 0) {
+ rb_raise(rb_eArgError, "attempt to take negative size");
+ }
+ argv[0] = obj;
+ if (len == 0) {
+ argv[1] = sym_cycle;
+ argv[2] = INT2NUM(0);
+ argc = 3;
+ }
+ memo = NEW_MEMO(0, len, len);
+ return lazy_set_method(rb_block_call(rb_cLazy, id_new, argc, argv,
+ lazy_take_func, (VALUE) memo),
+ rb_ary_new3(1, n), lazy_take_size);
+}
+
+static VALUE
+lazy_take_while_func(VALUE val, VALUE args, int argc, VALUE *argv)
+{
+ VALUE result = rb_yield_values2(argc - 1, &argv[1]);
+ if (!RTEST(result)) return Qundef;
+ rb_funcall2(argv[0], id_yield, argc - 1, argv + 1);
+ return Qnil;
+}
+
+static VALUE
+lazy_take_while(VALUE obj)
+{
+ return lazy_set_method(rb_block_call(rb_cLazy, id_new, 1, &obj,
+ lazy_take_while_func, 0),
+ Qnil, 0);
+}
+
+static VALUE
+lazy_drop_size(VALUE lazy)
+{
+ long len = NUM2LONG(RARRAY_PTR(rb_ivar_get(lazy, id_arguments))[0]);
+ VALUE receiver = lazy_receiver_size(lazy);
+ if (NIL_P(receiver))
+ return receiver;
+ if (FIXNUM_P(receiver)) {
+ len = FIX2LONG(receiver) - len;
+ return LONG2FIX(len < 0 ? 0 : len);
+ }
+ return rb_funcall(receiver, '-', 1, LONG2NUM(len));
+}
+
+static VALUE
+lazy_drop_func(VALUE val, VALUE args, int argc, VALUE *argv)
+{
+ NODE *memo = RNODE(args);
+
+ if (memo->u3.cnt == 0) {
+ rb_funcall2(argv[0], id_yield, argc - 1, argv + 1);
+ }
+ else {
+ memo->u3.cnt--;
+ }
+ return Qnil;
+}
+
+static VALUE
+lazy_drop(VALUE obj, VALUE n)
+{
+ NODE *memo;
+ long len = NUM2LONG(n);
+
+ if (len < 0) {
+ rb_raise(rb_eArgError, "attempt to drop negative size");
+ }
+ memo = NEW_MEMO(0, 0, len);
+ return lazy_set_method(rb_block_call(rb_cLazy, id_new, 1, &obj,
+ lazy_drop_func, (VALUE) memo),
+ rb_ary_new3(1, n), lazy_drop_size);
+}
+
+static VALUE
+lazy_drop_while_func(VALUE val, VALUE args, int argc, VALUE *argv)
+{
+ NODE *memo = RNODE(args);
+
+ if (!memo->u3.state && !RTEST(rb_yield_values2(argc - 1, &argv[1]))) {
+ memo->u3.state = TRUE;
+ }
+ if (memo->u3.state) {
+ rb_funcall2(argv[0], id_yield, argc - 1, argv + 1);
+ }
+ return Qnil;
+}
+
+static VALUE
+lazy_drop_while(VALUE obj)
+{
+ NODE *memo;
+
+ memo = NEW_MEMO(0, 0, FALSE);
+ return lazy_set_method(rb_block_call(rb_cLazy, id_new, 1, &obj,
+ lazy_drop_while_func, (VALUE) memo),
+ Qnil, 0);
+}
+
+static VALUE
+lazy_cycle_size(VALUE lazy)
+{
+ return rb_enum_cycle_size(rb_ivar_get(lazy, id_receiver), rb_ivar_get(lazy, id_arguments));
+}
+
+static VALUE
+lazy_cycle_func(VALUE val, VALUE m, int argc, VALUE *argv)
+{
+ return rb_funcall2(argv[0], id_yield, argc - 1, argv + 1);
+}
+
+static VALUE
+lazy_cycle(int argc, VALUE *argv, VALUE obj)
+{
+ VALUE args;
+ int len = rb_long2int((long)argc + 2);
+
+ if (rb_block_given_p()) {
+ return rb_call_super(argc, argv);
+ }
+ args = rb_ary_tmp_new(len);
+ rb_ary_push(args, obj);
+ rb_ary_push(args, sym_cycle);
+ if (argc > 0) {
+ rb_ary_cat(args, argv, argc);
+ }
+ return lazy_set_method(rb_block_call(rb_cLazy, id_new, len,
+ RARRAY_PTR(args), lazy_cycle_func,
+ args /* prevent from GC */),
+ rb_ary_new4(argc, argv), lazy_cycle_size);
+}
+
+static VALUE
+lazy_lazy(VALUE obj)
+{
+ return obj;
}
/*
@@ -1121,14 +1836,15 @@ generator_each(VALUE obj)
* end
*
*/
+
static VALUE
stop_result(VALUE self)
{
- return rb_attr_get(self, rb_intern("result"));
+ return rb_attr_get(self, id_result);
}
void
-Init_Enumerator(void)
+InitVM_Enumerator(void)
{
rb_define_method(rb_mKernel, "to_enum", obj_to_enum, -1);
rb_define_method(rb_mKernel, "enum_for", obj_to_enum, -1);
@@ -1139,7 +1855,7 @@ Init_Enumerator(void)
rb_define_alloc_func(rb_cEnumerator, enumerator_allocate);
rb_define_method(rb_cEnumerator, "initialize", enumerator_initialize, -1);
rb_define_method(rb_cEnumerator, "initialize_copy", enumerator_init_copy, 1);
- rb_define_method(rb_cEnumerator, "each", enumerator_each, 0);
+ rb_define_method(rb_cEnumerator, "each", enumerator_each, -1);
rb_define_method(rb_cEnumerator, "each_with_index", enumerator_each_with_index, 0);
rb_define_method(rb_cEnumerator, "each_with_object", enumerator_with_object, 1);
rb_define_method(rb_cEnumerator, "with_index", enumerator_with_index, -1);
@@ -1151,6 +1867,30 @@ Init_Enumerator(void)
rb_define_method(rb_cEnumerator, "feed", enumerator_feed, 1);
rb_define_method(rb_cEnumerator, "rewind", enumerator_rewind, 0);
rb_define_method(rb_cEnumerator, "inspect", enumerator_inspect, 0);
+ rb_define_method(rb_cEnumerator, "size", enumerator_size, 0);
+
+ /* Lazy */
+ rb_cLazy = rb_define_class_under(rb_cEnumerator, "Lazy", rb_cEnumerator);
+ rb_define_method(rb_mEnumerable, "lazy", enumerable_lazy, 0);
+ rb_define_method(rb_cLazy, "initialize", lazy_initialize, -1);
+ rb_define_method(rb_cLazy, "map", lazy_map, 0);
+ rb_define_method(rb_cLazy, "collect", lazy_map, 0);
+ rb_define_method(rb_cLazy, "flat_map", lazy_flat_map, 0);
+ rb_define_method(rb_cLazy, "collect_concat", lazy_flat_map, 0);
+ rb_define_method(rb_cLazy, "select", lazy_select, 0);
+ rb_define_method(rb_cLazy, "size", lazy_size, 0);
+ rb_define_method(rb_cLazy, "find_all", lazy_select, 0);
+ rb_define_method(rb_cLazy, "reject", lazy_reject, 0);
+ rb_define_method(rb_cLazy, "grep", lazy_grep, 1);
+ rb_define_method(rb_cLazy, "zip", lazy_zip, -1);
+ rb_define_method(rb_cLazy, "take", lazy_take, 1);
+ rb_define_method(rb_cLazy, "take_while", lazy_take_while, 0);
+ rb_define_method(rb_cLazy, "drop", lazy_drop, 1);
+ rb_define_method(rb_cLazy, "drop_while", lazy_drop_while, 0);
+ rb_define_method(rb_cLazy, "cycle", lazy_cycle, -1);
+ rb_define_method(rb_cLazy, "lazy", lazy_lazy, 0);
+
+ rb_define_alias(rb_cLazy, "force", "to_a");
rb_eStopIteration = rb_define_class("StopIteration", rb_eIndexError);
rb_define_method(rb_eStopIteration, "result", stop_result, 0);
@@ -1161,7 +1901,7 @@ Init_Enumerator(void)
rb_define_alloc_func(rb_cGenerator, generator_allocate);
rb_define_method(rb_cGenerator, "initialize", generator_initialize, -1);
rb_define_method(rb_cGenerator, "initialize_copy", generator_init_copy, 1);
- rb_define_method(rb_cGenerator, "each", generator_each, 0);
+ rb_define_method(rb_cGenerator, "each", generator_each, -1);
/* Yielder */
rb_cYielder = rb_define_class_under(rb_cEnumerator, "Yielder", rb_cObject);
@@ -1170,9 +1910,28 @@ Init_Enumerator(void)
rb_define_method(rb_cYielder, "yield", yielder_yield, -2);
rb_define_method(rb_cYielder, "<<", yielder_yield_push, -2);
+ rb_provide("enumerator.so"); /* for backward compatibility */
+}
+
+void
+Init_Enumerator(void)
+{
id_rewind = rb_intern("rewind");
id_each = rb_intern("each");
+ id_call = rb_intern("call");
+ id_size = rb_intern("size");
+ id_yield = rb_intern("yield");
+ id_new = rb_intern("new");
+ id_initialize = rb_intern("initialize");
+ id_next = rb_intern("next");
+ id_result = rb_intern("result");
+ id_lazy = rb_intern("lazy");
+ id_eqq = rb_intern("===");
+ id_receiver = rb_intern("receiver");
+ id_arguments = rb_intern("arguments");
+ id_method = rb_intern("method");
sym_each = ID2SYM(id_each);
+ sym_cycle = ID2SYM(rb_intern("cycle"));
- rb_provide("enumerator.so"); /* for backward compatibility */
+ InitVM(Enumerator);
}
diff --git a/error.c b/error.c
index ce959fc221..606b25bc50 100644
--- a/error.c
+++ b/error.c
@@ -25,6 +25,8 @@
#include <unistd.h>
#endif
+#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
+
#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS 0
#endif
@@ -99,7 +101,42 @@ compile_snprintf(char *buf, long len, const char *file, int line, const char *fm
}
}
-static void err_append(const char*, rb_encoding *);
+static void
+compile_err_append(const char *s, rb_encoding *enc)
+{
+ rb_thread_t *th = GET_THREAD();
+ VALUE err = th->errinfo;
+ rb_block_t *prev_base_block = th->base_block;
+ th->base_block = 0;
+ /* base_block should be zero while normal Ruby execution */
+ /* after this line, any Ruby code *can* run */
+
+ if (th->mild_compile_error) {
+ if (!RTEST(err)) {
+ err = rb_exc_new3(rb_eSyntaxError,
+ rb_enc_str_new(s, strlen(s), enc));
+ th->errinfo = err;
+ }
+ else {
+ VALUE str = rb_obj_as_string(err);
+
+ rb_str_cat2(str, "\n");
+ rb_str_cat2(str, s);
+ th->errinfo = rb_exc_new3(rb_eSyntaxError, str);
+ }
+ }
+ else {
+ if (!RTEST(err)) {
+ err = rb_exc_new2(rb_eSyntaxError, "compile error");
+ th->errinfo = err;
+ }
+ rb_write_error(s);
+ rb_write_error("\n");
+ }
+
+ /* returned to the parser world */
+ th->base_block = prev_base_block;
+}
void
rb_compile_error_with_enc(const char *file, int line, void *enc, const char *fmt, ...)
@@ -110,7 +147,7 @@ rb_compile_error_with_enc(const char *file, int line, void *enc, const char *fmt
va_start(args, fmt);
compile_snprintf(buf, BUFSIZ, file, line, fmt, args);
va_end(args);
- err_append(buf, (rb_encoding *)enc);
+ compile_err_append(buf, (rb_encoding *)enc);
}
void
@@ -122,7 +159,7 @@ rb_compile_error(const char *file, int line, const char *fmt, ...)
va_start(args, fmt);
compile_snprintf(buf, BUFSIZ, file, line, fmt, args);
va_end(args);
- err_append(buf, NULL);
+ compile_err_append(buf, NULL);
}
void
@@ -134,7 +171,7 @@ rb_compile_error_append(const char *fmt, ...)
va_start(args, fmt);
vsnprintf(buf, BUFSIZ, fmt, args);
va_end(args);
- err_append(buf, NULL);
+ compile_err_append(buf, NULL);
}
static void
@@ -225,18 +262,25 @@ rb_warning(const char *fmt, ...)
/*
* call-seq:
- * warn(msg) -> nil
+ * warn(msg, ...) -> nil
*
- * Display the given message (followed by a newline) on STDERR unless
- * warnings are disabled (for example with the <code>-W0</code> flag).
+ * Displays each of the given messages followed by a record separator on
+ * STDERR unless warnings have been disabled (for example with the
+ * <code>-W0</code> flag).
+ *
+ * warn("warning 1", "warning 2")
+ *
+ * <em>produces:</em>
+ *
+ * warning 1
+ * warning 2
*/
static VALUE
-rb_warn_m(VALUE self, VALUE mesg)
+rb_warn_m(int argc, VALUE *argv, VALUE exc)
{
- if (!NIL_P(ruby_verbose)) {
- rb_io_write(rb_stderr, mesg);
- rb_io_write(rb_stderr, rb_default_rs);
+ if (!NIL_P(ruby_verbose) && argc > 0) {
+ rb_io_puts(argc, argv, rb_stderr);
}
return Qnil;
}
@@ -244,16 +288,20 @@ rb_warn_m(VALUE self, VALUE mesg)
static void
report_bug(const char *file, int line, const char *fmt, va_list args)
{
- char buf[BUFSIZ];
+ /* SIGSEGV handler might have a very small stack. Thus we need to use it carefully. */
+ char buf[256];
FILE *out = stderr;
- int len = err_position_0(buf, BUFSIZ, file, line);
+ int len = err_position_0(buf, 256, file, line);
if ((ssize_t)fwrite(buf, 1, len, out) == (ssize_t)len ||
(ssize_t)fwrite(buf, 1, len, (out = stdout)) == (ssize_t)len) {
fputs("[BUG] ", out);
- vfprintf(out, fmt, args);
- fprintf(out, "\n%s\n\n", ruby_description);
+ vsnprintf(buf, 256, fmt, args);
+ fputs(buf, out);
+ snprintf(buf, 256, "\n%s\n\n", ruby_description);
+ fputs(buf, out);
+
rb_vm_bugreport();
@@ -277,7 +325,7 @@ rb_bug(const char *fmt, ...)
report_bug(file, line, fmt, args);
va_end(args);
-#if defined(_WIN32) && defined(RT_VER) && RT_VER >= 80
+#if defined(_WIN32) && defined(RUBY_MSVCRT_VERSION) && RUBY_MSVCRT_VERSION >= 80
_set_abort_behavior( 0, _CALL_REPORTFAULT);
#endif
@@ -341,41 +389,79 @@ rb_compile_bug(const char *file, int line, const char *fmt, ...)
abort();
}
-static const struct types {
- int type;
- const char *name;
-} builtin_types[] = {
- {T_NIL, "nil"},
- {T_OBJECT, "Object"},
- {T_CLASS, "Class"},
- {T_ICLASS, "iClass"}, /* internal use: mixed-in module holder */
- {T_MODULE, "Module"},
- {T_FLOAT, "Float"},
- {T_STRING, "String"},
- {T_REGEXP, "Regexp"},
- {T_ARRAY, "Array"},
- {T_FIXNUM, "Fixnum"},
- {T_HASH, "Hash"},
- {T_STRUCT, "Struct"},
- {T_BIGNUM, "Bignum"},
- {T_FILE, "File"},
- {T_RATIONAL,"Rational"},
- {T_COMPLEX, "Complex"},
- {T_TRUE, "true"},
- {T_FALSE, "false"},
- {T_SYMBOL, "Symbol"}, /* :symbol */
- {T_DATA, "Data"}, /* internal use: wrapped C pointers */
- {T_MATCH, "MatchData"}, /* data of $~ */
- {T_NODE, "Node"}, /* internal use: syntax tree node */
- {T_UNDEF, "undef"}, /* internal use: #undef; should not happen */
+static const char builtin_types[][10] = {
+ "", /* 0x00, */
+ "Object",
+ "Class",
+ "Module",
+ "Float",
+ "String",
+ "Regexp",
+ "Array",
+ "Hash",
+ "Struct",
+ "Bignum",
+ "File",
+ "Data", /* internal use: wrapped C pointers */
+ "MatchData", /* data of $~ */
+ "Complex",
+ "Rational",
+ "", /* 0x10 */
+ "nil",
+ "true",
+ "false",
+ "Symbol", /* :symbol */
+ "Fixnum",
+ "", /* 0x16 */
+ "", /* 0x17 */
+ "", /* 0x18 */
+ "", /* 0x19 */
+ "", /* 0x1a */
+ "undef", /* internal use: #undef; should not happen */
+ "Node", /* internal use: syntax tree node */
+ "iClass", /* internal use: mixed-in module holder */
};
+const char *
+rb_builtin_type_name(int t)
+{
+ const char *name;
+ if ((unsigned int)t >= numberof(builtin_types)) return 0;
+ name = builtin_types[t];
+ if (*name) return name;
+ return 0;
+}
+
+#define builtin_class_name rb_builtin_class_name
+const char *
+rb_builtin_class_name(VALUE x)
+{
+ const char *etype;
+
+ if (NIL_P(x)) {
+ etype = "nil";
+ }
+ else if (FIXNUM_P(x)) {
+ etype = "Fixnum";
+ }
+ else if (SYMBOL_P(x)) {
+ etype = "Symbol";
+ }
+ else if (RB_TYPE_P(x, T_TRUE)) {
+ etype = "true";
+ }
+ else if (RB_TYPE_P(x, T_FALSE)) {
+ etype = "false";
+ }
+ else {
+ etype = rb_obj_classname(x);
+ }
+ return etype;
+}
+
void
rb_check_type(VALUE x, int t)
{
- const struct types *type = builtin_types;
- const struct types *const typeend = builtin_types +
- sizeof(builtin_types) / sizeof(builtin_types[0]);
int xt;
if (x == Qundef) {
@@ -384,30 +470,10 @@ rb_check_type(VALUE x, int t)
xt = TYPE(x);
if (xt != t || (xt == T_DATA && RTYPEDDATA_P(x))) {
- while (type < typeend) {
- if (type->type == t) {
- const char *etype;
-
- if (NIL_P(x)) {
- etype = "nil";
- }
- else if (FIXNUM_P(x)) {
- etype = "Fixnum";
- }
- else if (SYMBOL_P(x)) {
- etype = "Symbol";
- }
- else if (rb_special_const_p(x)) {
- x = rb_obj_as_string(x);
- etype = StringValuePtr(x);
- }
- else {
- etype = rb_obj_classname(x);
- }
- rb_raise(rb_eTypeError, "wrong argument type %s (expected %s)",
- etype, type->name);
- }
- type++;
+ const char *tname = rb_builtin_type_name(t);
+ if (tname) {
+ rb_raise(rb_eTypeError, "wrong argument type %s (expected %s)",
+ builtin_class_name(x), tname);
}
if (xt > T_MASK && xt <= 0x3f) {
rb_fatal("unknown type 0x%x (0x%x given, probably comes from extension library for ruby 1.8)", t, xt);
@@ -429,7 +495,7 @@ rb_typeddata_inherited_p(const rb_data_type_t *child, const rb_data_type_t *pare
int
rb_typeddata_is_kind_of(VALUE obj, const rb_data_type_t *data_type)
{
- if (SPECIAL_CONST_P(obj) || BUILTIN_TYPE(obj) != T_DATA ||
+ if (!RB_TYPE_P(obj, T_DATA) ||
!RTYPEDDATA_P(obj) || !rb_typeddata_inherited_p(RTYPEDDATA_TYPE(obj), data_type)) {
return 0;
}
@@ -442,8 +508,9 @@ rb_check_typeddata(VALUE obj, const rb_data_type_t *data_type)
const char *etype;
static const char mesg[] = "wrong argument type %s (expected %s)";
- if (SPECIAL_CONST_P(obj) || BUILTIN_TYPE(obj) != T_DATA) {
- Check_Type(obj, T_DATA);
+ if (!RB_TYPE_P(obj, T_DATA)) {
+ etype = builtin_class_name(obj);
+ rb_raise(rb_eTypeError, mesg, etype, data_type->wrap_struct_name);
}
if (!RTYPEDDATA_P(obj)) {
etype = rb_obj_classname(obj);
@@ -569,7 +636,6 @@ exc_to_s(VALUE exc)
if (NIL_P(mesg)) return rb_class_name(CLASS_OF(exc));
r = rb_String(mesg);
- OBJ_INFECT(r, exc);
return r;
}
@@ -593,7 +659,7 @@ exc_message(VALUE exc)
* call-seq:
* exception.inspect -> string
*
- * Return this exception's class name an message
+ * Return this exception's class name and message
*/
static VALUE
@@ -650,9 +716,17 @@ static VALUE
exc_backtrace(VALUE exc)
{
ID bt;
+ VALUE obj;
CONST_ID(bt, "bt");
- return rb_attr_get(exc, bt);
+ obj = rb_attr_get(exc, bt);
+
+ if (rb_backtrace_p(obj)) {
+ obj = rb_backtrace_to_str_ary(obj);
+ /* rb_iv_set(exc, "bt", obj); */
+ }
+
+ return obj;
}
VALUE
@@ -662,14 +736,13 @@ rb_check_backtrace(VALUE bt)
static const char err[] = "backtrace must be Array of String";
if (!NIL_P(bt)) {
- int t = TYPE(bt);
-
- if (t == T_STRING) return rb_ary_new3(1, bt);
- if (t != T_ARRAY) {
+ if (RB_TYPE_P(bt, T_STRING)) return rb_ary_new3(1, bt);
+ if (rb_backtrace_p(bt)) return bt;
+ if (!RB_TYPE_P(bt, T_ARRAY)) {
rb_raise(rb_eTypeError, err);
}
for (i=0;i<RARRAY_LEN(bt);i++) {
- if (TYPE(RARRAY_PTR(bt)[i]) != T_STRING) {
+ if (!RB_TYPE_P(RARRAY_PTR(bt)[i], T_STRING)) {
rb_raise(rb_eTypeError, err);
}
}
@@ -679,11 +752,11 @@ rb_check_backtrace(VALUE bt)
/*
* call-seq:
- * exc.set_backtrace(array) -> array
+ * exc.set_backtrace(backtrace) -> array
*
- * Sets the backtrace information associated with <i>exc</i>. The
- * argument must be an array of <code>String</code> objects in the
- * format described in <code>Exception#backtrace</code>.
+ * Sets the backtrace information associated with +exc+. The +backtrace+ must
+ * be an array of String objects or a single String in the format described
+ * in Exception#backtrace.
*
*/
@@ -693,6 +766,20 @@ exc_set_backtrace(VALUE exc, VALUE bt)
return rb_iv_set(exc, "bt", rb_check_backtrace(bt));
}
+VALUE
+rb_exc_set_backtrace(VALUE exc, VALUE bt)
+{
+ return exc_set_backtrace(exc, bt);
+}
+
+static VALUE
+try_convert_to_exception(VALUE obj)
+{
+ ID id_exception;
+ CONST_ID(id_exception, "exception");
+ return rb_check_funcall(obj, id_exception, 0, 0);
+}
+
/*
* call-seq:
* exc == obj -> true or false
@@ -712,10 +799,17 @@ exc_equal(VALUE exc, VALUE obj)
CONST_ID(id_mesg, "mesg");
if (rb_obj_class(exc) != rb_obj_class(obj)) {
+ int status = 0;
ID id_message, id_backtrace;
CONST_ID(id_message, "message");
CONST_ID(id_backtrace, "backtrace");
+ obj = rb_protect(try_convert_to_exception, obj, &status);
+ if (status || obj == Qundef) {
+ rb_set_errinfo(Qnil);
+ return Qfalse;
+ }
+ if (rb_obj_class(exc) != rb_obj_class(obj)) return Qfalse;
mesg = rb_check_funcall(obj, id_message, 0, 0);
if (mesg == Qundef) return Qfalse;
backtrace = rb_check_funcall(obj, id_backtrace, 0, 0);
@@ -735,18 +829,52 @@ exc_equal(VALUE exc, VALUE obj)
/*
* call-seq:
- * SystemExit.new(status=0) -> system_exit
- *
- * Create a new +SystemExit+ exception with the given status.
+ * SystemExit.new -> system_exit
+ * SystemExit.new(status) -> system_exit
+ * SystemExit.new(status, msg) -> system_exit
+ * SystemExit.new(msg) -> system_exit
+ *
+ * Create a new +SystemExit+ exception with the given status and message.
+ * Status is true, false, or an integer.
+ * If status is not given, true is used.
*/
static VALUE
exit_initialize(int argc, VALUE *argv, VALUE exc)
{
- VALUE status = INT2FIX(EXIT_SUCCESS);
- if (argc > 0 && FIXNUM_P(argv[0])) {
- status = *argv++;
- --argc;
+ VALUE status;
+ if (argc > 0) {
+ status = *argv;
+
+ switch (status) {
+ case Qtrue:
+ status = INT2FIX(EXIT_SUCCESS);
+ ++argv;
+ --argc;
+ break;
+ case Qfalse:
+ status = INT2FIX(EXIT_FAILURE);
+ ++argv;
+ --argc;
+ break;
+ default:
+ status = rb_check_to_int(status);
+ if (NIL_P(status)) {
+ status = INT2FIX(EXIT_SUCCESS);
+ }
+ else {
+#if EXIT_SUCCESS != 0
+ if (status == INT2FIX(0))
+ status = INT2FIX(EXIT_SUCCESS);
+#endif
+ ++argv;
+ --argc;
+ }
+ break;
+ }
+ }
+ else {
+ status = INT2FIX(EXIT_SUCCESS);
}
rb_call_super(argc, argv);
rb_iv_set(exc, "status", status);
@@ -805,6 +933,21 @@ rb_name_error(ID id, const char *fmt, ...)
rb_exc_raise(exc);
}
+void
+rb_name_error_str(VALUE str, const char *fmt, ...)
+{
+ VALUE exc, argv[2];
+ va_list args;
+
+ va_start(args, fmt);
+ argv[0] = rb_vsprintf(fmt, args);
+ va_end(args);
+
+ argv[1] = str;
+ exc = rb_class_new_instance(2, argv, rb_eNameError);
+ rb_exc_raise(exc);
+}
+
/*
* call-seq:
* NameError.new(msg [, name]) -> name_error
@@ -853,11 +996,7 @@ name_err_to_s(VALUE exc)
if (NIL_P(mesg)) return rb_class_name(CLASS_OF(exc));
StringValue(str);
- if (str != mesg) {
- rb_iv_set(exc, "mesg", mesg = str);
- }
- OBJ_INFECT(mesg, exc);
- return mesg;
+ return str;
}
/*
@@ -955,20 +1094,23 @@ name_err_mesg_to_str(VALUE obj)
else {
const char *desc = 0;
VALUE d = 0, args[NAME_ERR_MESG_COUNT];
+ int state = 0;
obj = ptr[1];
- switch (TYPE(obj)) {
- case T_NIL:
+ switch (obj) {
+ case Qnil:
desc = "nil";
break;
- case T_TRUE:
+ case Qtrue:
desc = "true";
break;
- case T_FALSE:
+ case Qfalse:
desc = "false";
break;
default:
- d = rb_protect(rb_inspect, obj, 0);
+ d = rb_protect(rb_inspect, obj, &state);
+ if (state)
+ rb_set_errinfo(Qnil);
if (NIL_P(d) || RSTRING_LEN(d) > 65) {
d = rb_any_to_s(obj);
}
@@ -985,7 +1127,6 @@ name_err_mesg_to_str(VALUE obj)
args[2] = d;
mesg = rb_f_sprintf(NAME_ERR_MESG_COUNT, args);
}
- OBJ_INFECT(mesg, obj);
return mesg;
}
@@ -1013,9 +1154,9 @@ nometh_err_args(VALUE self)
void
rb_invalid_str(const char *str, const char *type)
{
- volatile VALUE s = rb_str_inspect(rb_str_new2(str));
+ VALUE s = rb_str_new2(str);
- rb_raise(rb_eArgError, "invalid value for %s: %s", type, RSTRING_PTR(s));
+ rb_raise(rb_eArgError, "invalid value for %s: %+"PRIsVALUE, type, s);
}
/*
@@ -1111,7 +1252,7 @@ syserr_initialize(int argc, VALUE *argv, VALUE self)
if (!NIL_P(error) && st_lookup(syserr_tbl, NUM2LONG(error), &data)) {
klass = (VALUE)data;
/* change class */
- if (TYPE(self) != T_OBJECT) { /* insurance to avoid type crash */
+ if (!RB_TYPE_P(self, T_OBJECT)) { /* insurance to avoid type crash */
rb_raise(rb_eTypeError, "invalid instance type");
}
RBASIC(self)->klass = klass;
@@ -1125,15 +1266,13 @@ syserr_initialize(int argc, VALUE *argv, VALUE self)
else err = "unknown error";
if (!NIL_P(mesg)) {
rb_encoding *le = rb_locale_encoding();
- VALUE str = mesg;
+ VALUE str = StringValue(mesg);
+ rb_encoding *me = rb_enc_get(mesg);
- StringValue(str);
mesg = rb_sprintf("%s - %.*s", err,
(int)RSTRING_LEN(str), RSTRING_PTR(str));
- if (le == rb_usascii_encoding()) {
- rb_encoding *me = rb_enc_get(mesg);
- if (le != me && rb_enc_asciicompat(me))
- le = me;
+ if (le != me && rb_enc_asciicompat(me)) {
+ le = me;
}/* else assume err is non ASCII string. */
OBJ_INFECT(mesg, str);
rb_enc_associate(mesg, le);
@@ -1499,14 +1638,76 @@ syserr_eqq(VALUE self, VALUE exc)
*/
/*
- * Descendants of class <code>Exception</code> are used to communicate
- * between <code>raise</code> methods and <code>rescue</code>
- * statements in <code>begin/end</code> blocks. <code>Exception</code>
- * objects carry information about the exception---its type (the
- * exception's class name), an optional descriptive string, and
- * optional traceback information. Programs may subclass
- * <code>Exception</code>, or more typically <code>StandardError</code>
- * to provide custom classes and add additional information.
+ * Descendants of class Exception are used to communicate between
+ * Kernel#raise and +rescue+ statements in <code>begin ... end</code> blocks.
+ * Exception objects carry information about the exception -- its type (the
+ * exception's class name), an optional descriptive string, and optional
+ * traceback information. Exception subclasses may add additional
+ * information like NameError#name.
+ *
+ * Programs may make subclasses of Exception, typically of StandardError or
+ * RuntimeError, to provide custom classes and add additional information.
+ * See the subclass list below for defaults for +raise+ and +rescue+.
+ *
+ * When an exception has been raised but not yet handled (in +rescue+,
+ * +ensure+, +at_exit+ and +END+ blocks) the global variable <code>$!</code>
+ * will contain the current exception and <code>$@</code> contains the
+ * current exception's backtrace.
+ *
+ * It is recommended that a library should have one subclass of StandardError
+ * or RuntimeError and have specific exception types inherit from it. This
+ * allows the user to rescue a generic exception type to catch all exceptions
+ * the library may raise even if future versions of the library add new
+ * exception subclasses.
+ *
+ * For example:
+ *
+ * class MyLibrary
+ * class Error < RuntimeError
+ * end
+ *
+ * class WidgetError < Error
+ * end
+ *
+ * class FrobError < Error
+ * end
+ *
+ * end
+ *
+ * To handle both WidgetError and FrobError the library user can rescue
+ * MyLibrary::Error.
+ *
+ * The built-in subclasses of Exception are:
+ *
+ * * NoMemoryError
+ * * ScriptError
+ * * LoadError
+ * * NotImplementedError
+ * * SyntaxError
+ * * SignalException
+ * * Interrupt
+ * * StandardError -- default for +rescue+
+ * * ArgumentError
+ * * IndexError
+ * * StopIteration
+ * * IOError
+ * * EOFError
+ * * LocalJumpError
+ * * NameError
+ * * NoMethodError
+ * * RangeError
+ * * FloatDomainError
+ * * RegexpError
+ * * RuntimeError -- default for +raise+
+ * * SecurityError
+ * * SystemCallError
+ * * Errno::*
+ * * SystemStackError
+ * * ThreadError
+ * * TypeError
+ * * ZeroDivisionError
+ * * SystemExit
+ * * fatal -- impossible to rescue
*/
void
@@ -1541,7 +1742,10 @@ Init_Exception(void)
rb_eScriptError = rb_define_class("ScriptError", rb_eException);
rb_eSyntaxError = rb_define_class("SyntaxError", rb_eScriptError);
+
rb_eLoadError = rb_define_class("LoadError", rb_eScriptError);
+ rb_attr(rb_eLoadError, rb_intern("path"), 1, 0, Qfalse);
+
rb_eNotImpError = rb_define_class("NotImplementedError", rb_eScriptError);
rb_eNameError = rb_define_class("NameError", rb_eStandardError);
@@ -1572,7 +1776,20 @@ Init_Exception(void)
rb_mErrno = rb_define_module("Errno");
- rb_define_global_function("warn", rb_warn_m, 1);
+ rb_define_global_function("warn", rb_warn_m, -1);
+}
+
+void
+rb_enc_raise(rb_encoding *enc, VALUE exc, const char *fmt, ...)
+{
+ va_list args;
+ VALUE mesg;
+
+ va_start(args, fmt);
+ mesg = rb_enc_vsprintf(enc, fmt, args);
+ va_end(args);
+
+ rb_exc_raise(rb_exc_new3(exc, mesg));
}
void
@@ -1587,6 +1804,16 @@ rb_raise(VALUE exc, const char *fmt, ...)
rb_exc_raise(rb_exc_new3(exc, mesg));
}
+NORETURN(static void raise_loaderror(VALUE path, VALUE mesg));
+
+static void
+raise_loaderror(VALUE path, VALUE mesg)
+{
+ VALUE err = rb_exc_new3(rb_eLoadError, mesg);
+ rb_ivar_set(err, rb_intern("@path"), path);
+ rb_exc_raise(err);
+}
+
void
rb_loaderror(const char *fmt, ...)
{
@@ -1596,7 +1823,19 @@ rb_loaderror(const char *fmt, ...)
va_start(args, fmt);
mesg = rb_enc_vsprintf(rb_locale_encoding(), fmt, args);
va_end(args);
- rb_exc_raise(rb_exc_new3(rb_eLoadError, mesg));
+ raise_loaderror(Qnil, mesg);
+}
+
+void
+rb_loaderror_with_path(VALUE path, const char *fmt, ...)
+{
+ va_list args;
+ VALUE mesg;
+
+ va_start(args, fmt);
+ mesg = rb_enc_vsprintf(rb_locale_encoding(), fmt, args);
+ va_end(args);
+ raise_loaderror(path, mesg);
}
void
@@ -1632,11 +1871,31 @@ make_errno_exc(const char *mesg)
return rb_syserr_new(n, mesg);
}
+static VALUE
+make_errno_exc_str(VALUE mesg)
+{
+ int n = errno;
+
+ errno = 0;
+ if (!mesg) mesg = Qnil;
+ if (n == 0) {
+ const char *s = !NIL_P(mesg) ? RSTRING_PTR(mesg) : "";
+ rb_bug("rb_sys_fail_str(%s) - errno == 0", s);
+ }
+ return rb_syserr_new_str(n, mesg);
+}
+
VALUE
rb_syserr_new(int n, const char *mesg)
{
VALUE arg;
arg = mesg ? rb_str_new2(mesg) : Qnil;
+ return rb_syserr_new_str(n, arg);
+}
+
+VALUE
+rb_syserr_new_str(int n, VALUE arg)
+{
return rb_class_new_instance(1, &arg, get_syserr(n));
}
@@ -1647,12 +1906,24 @@ rb_syserr_fail(int e, const char *mesg)
}
void
+rb_syserr_fail_str(int e, VALUE mesg)
+{
+ rb_exc_raise(rb_syserr_new_str(e, mesg));
+}
+
+void
rb_sys_fail(const char *mesg)
{
rb_exc_raise(make_errno_exc(mesg));
}
void
+rb_sys_fail_str(VALUE mesg)
+{
+ rb_exc_raise(make_errno_exc_str(mesg));
+}
+
+void
rb_mod_sys_fail(VALUE mod, const char *mesg)
{
VALUE exc = make_errno_exc(mesg);
@@ -1661,6 +1932,14 @@ rb_mod_sys_fail(VALUE mod, const char *mesg)
}
void
+rb_mod_sys_fail_str(VALUE mod, VALUE mesg)
+{
+ VALUE exc = make_errno_exc_str(mesg);
+ rb_extend_object(exc, mod);
+ rb_exc_raise(exc);
+}
+
+void
rb_mod_syserr_fail(VALUE mod, int e, const char *mesg)
{
VALUE exc = rb_syserr_new(e, mesg);
@@ -1669,6 +1948,14 @@ rb_mod_syserr_fail(VALUE mod, int e, const char *mesg)
}
void
+rb_mod_syserr_fail_str(VALUE mod, int e, VALUE mesg)
+{
+ VALUE exc = rb_syserr_new_str(e, mesg);
+ rb_extend_object(exc, mod);
+ rb_exc_raise(exc);
+}
+
+void
rb_sys_warning(const char *fmt, ...)
{
char buf[BUFSIZ];
@@ -1689,9 +1976,12 @@ rb_sys_warning(const char *fmt, ...)
}
void
-rb_load_fail(const char *path)
+rb_load_fail(VALUE path, const char *err)
{
- rb_loaderror("%s -- %s", strerror(errno), path);
+ VALUE mesg = rb_str_buf_new_cstr(err);
+ rb_str_cat2(mesg, " -- ");
+ rb_str_append(mesg, path); /* should be ASCII compatible */
+ raise_loaderror(path, mesg);
}
void
@@ -1708,6 +1998,37 @@ rb_check_frozen(VALUE obj)
}
void
+rb_error_untrusted(VALUE obj)
+{
+ if (rb_safe_level() >= 4) {
+ rb_raise(rb_eSecurityError, "Insecure: can't modify %s",
+ rb_obj_classname(obj));
+ }
+}
+
+#undef rb_check_trusted
+void
+rb_check_trusted(VALUE obj)
+{
+ rb_check_trusted_internal(obj);
+}
+
+void
+rb_check_copyable(VALUE obj, VALUE orig)
+{
+ if (!FL_ABLE(obj)) return;
+ rb_check_frozen_internal(obj);
+ rb_check_trusted_internal(obj);
+ if (!FL_ABLE(orig)) return;
+ if ((~RBASIC(obj)->flags & RBASIC(orig)->flags) & (FL_UNTRUSTED|FL_TAINT)) {
+ if (rb_safe_level() > 0) {
+ rb_raise(rb_eSecurityError, "Insecure: can't modify %"PRIsVALUE,
+ RBASIC(obj)->klass);
+ }
+ }
+}
+
+void
Init_syserr(void)
{
rb_eNOERROR = set_syserr(0, "NOERROR");
@@ -1717,33 +2038,3 @@ Init_syserr(void)
#undef defined_error
#undef undefined_error
}
-
-static void
-err_append(const char *s, rb_encoding *enc)
-{
- rb_thread_t *th = GET_THREAD();
- VALUE err = th->errinfo;
-
- if (th->mild_compile_error) {
- if (!RTEST(err)) {
- err = rb_exc_new3(rb_eSyntaxError,
- rb_enc_str_new(s, strlen(s), enc));
- th->errinfo = err;
- }
- else {
- VALUE str = rb_obj_as_string(err);
-
- rb_str_cat2(str, "\n");
- rb_str_cat2(str, s);
- th->errinfo = rb_exc_new3(rb_eSyntaxError, str);
- }
- }
- else {
- if (!RTEST(err)) {
- err = rb_exc_new2(rb_eSyntaxError, "compile error");
- th->errinfo = err;
- }
- rb_write_error(s);
- rb_write_error("\n");
- }
-}
diff --git a/eval.c b/eval.c
index 5b5b4662c0..cbf49f3011 100644
--- a/eval.c
+++ b/eval.c
@@ -18,11 +18,14 @@
#include "ruby/encoding.h"
#include "internal.h"
#include "vm_core.h"
+#include "probes_helper.h"
#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
NORETURN(void rb_raise_jump(VALUE));
+NODE *rb_vm_get_cref(const rb_iseq_t *, const VALUE *);
+
VALUE rb_eLocalJumpError;
VALUE rb_eSysStackError;
@@ -31,16 +34,18 @@ VALUE rb_eSysStackError;
#include "eval_error.c"
#include "eval_jump.c"
-/* initialize ruby */
-
-void
-ruby_init(void)
+/* Initializes the Ruby VM and builtin libraries.
+ * @retval 0 if succeeded.
+ * @retval non-zero an error occured.
+ */
+int
+ruby_setup(void)
{
static int initialized = 0;
int state;
if (initialized)
- return;
+ return 0;
initialized = 1;
ruby_init_stack((void *)&state);
@@ -51,16 +56,37 @@ ruby_init(void)
if ((state = EXEC_TAG()) == 0) {
rb_call_inits();
ruby_prog_init();
+ GET_VM()->running = 1;
}
POP_TAG();
+ return state;
+}
+
+/* Calls ruby_setup() and check error.
+ *
+ * Prints errors and calls exit(3) if an error occured.
+ */
+void
+ruby_init(void)
+{
+ int state = ruby_setup();
if (state) {
error_print();
exit(EXIT_FAILURE);
}
- GET_VM()->running = 1;
}
+/*! Processes command line arguments and compiles the Ruby source to execute.
+ *
+ * This function does:
+ * \li Processses the given command line flags and arguments for ruby(1)
+ * \li compiles the source code from the given argument, -e or stdin, and
+ * \li returns the compiled source as an opaque pointer to an internal data structure
+ *
+ * @return an opaque pointer to the compiled source or an internal special value.
+ * @sa ruby_executable_node().
+ */
void *
ruby_options(int argc, char **argv)
{
@@ -101,6 +127,13 @@ ruby_finalize_1(void)
rb_gc_call_finalizer_at_exit();
}
+/** Runs the VM finalization processes.
+ *
+ * <code>END{}</code> and procs registered by <code>Kernel.#at_ext</code> are
+ * executed here. See the Ruby language spec for more details.
+ *
+ * @note This function is allowed to raise an exception if an error occurred.
+ */
void
ruby_finalize(void)
{
@@ -108,6 +141,16 @@ ruby_finalize(void)
ruby_finalize_1();
}
+/** Destructs the VM.
+ *
+ * Runs the VM finalization processes as well as ruby_finalize(), and frees
+ * resources used by the VM.
+ *
+ * @param ex Default value to the return value.
+ * @return If an error occured returns a non-zero. If otherwise, returns the
+ * given ex.
+ * @note This function does not raise any exception.
+ */
int
ruby_cleanup(volatile int ex)
{
@@ -120,7 +163,7 @@ ruby_cleanup(volatile int ex)
rb_threadptr_check_signal(th);
PUSH_TAG();
if ((state = EXEC_TAG()) == 0) {
- SAVE_ROOT_JMPBUF(th, { RUBY_VM_CHECK_INTS(); });
+ SAVE_ROOT_JMPBUF(th, { RUBY_VM_CHECK_INTS(th); });
}
POP_TAG();
@@ -134,6 +177,9 @@ ruby_cleanup(volatile int ex)
}
POP_TAG();
+ /* protect from Thread#raise */
+ th->status = THREAD_KILLED;
+
errs[0] = th->errinfo;
PUSH_TAG();
if ((state = EXEC_TAG()) == 0) {
@@ -169,7 +215,7 @@ ruby_cleanup(volatile int ex)
if (!RTEST(err)) continue;
/* th->errinfo contains a NODE while break'ing */
- if (TYPE(err) == T_NODE) continue;
+ if (RB_TYPE_P(err, T_NODE)) continue;
if (rb_obj_is_kind_of(err, rb_eSystemExit)) {
ex = sysexit_status(err);
@@ -210,12 +256,25 @@ ruby_exec_internal(void *n)
return state;
}
+/*! Calls ruby_cleanup() and exits the process */
void
ruby_stop(int ex)
{
exit(ruby_cleanup(ex));
}
+/*! Checks the return value of ruby_options().
+ * @param n return value of ruby_options().
+ * @param status pointer to the exit status of this process.
+ *
+ * ruby_options() sometimes returns a special value to indicate this process
+ * should immediately exit. This function checks if the case. Also stores the
+ * exit status that the caller have to pass to exit(3) into
+ * <code>*status</code>.
+ *
+ * @retval non-zero if the given opaque pointer is actually a compiled source.
+ * @retval 0 if the given value is such a special value.
+ */
int
ruby_executable_node(void *n, int *status)
{
@@ -233,6 +292,10 @@ ruby_executable_node(void *n, int *status)
return FALSE;
}
+/*! Runs the given compiled source and exits this process.
+ * @retval 0 if successfully run thhe source
+ * @retval non-zero if an error occurred.
+*/
int
ruby_run_node(void *n)
{
@@ -244,6 +307,7 @@ ruby_run_node(void *n)
return ruby_cleanup(ruby_exec_node(n));
}
+/*! Runs the given compiled source */
int
ruby_exec_node(void *n)
{
@@ -286,15 +350,23 @@ rb_mod_nesting(void)
/*
* call-seq:
* Module.constants -> array
+ * Module.constants(inherited) -> array
*
- * Returns an array of the names of all constants defined in the
- * system. This list includes the names of all modules and classes.
+ * In the first form, returns an array of the names of all
+ * constants accessible from the point of call.
+ * This list includes the names of all modules and classes
+ * defined in the global scope.
*
- * p Module.constants.sort[1..5]
+ * Module.constants.first(4)
+ * # => [:ARGF, :ARGV, :ArgumentError, :Array]
*
- * <em>produces:</em>
+ * Module.constants.include?(:SEEK_SET) # => false
*
- * ["ARGV", "ArgumentError", "Array", "Bignum", "Binding"]
+ * class IO
+ * Module.constants.include?(:SEEK_SET) # => true
+ * end
+ *
+ * The second form calls the instance method +constants+.
*/
static VALUE
@@ -379,7 +451,7 @@ setup_exception(rb_thread_t *th, int tag, volatile VALUE mesg)
else {
at = get_backtrace(mesg);
if (NIL_P(at)) {
- at = rb_make_backtrace();
+ at = rb_vm_backtrace_object();
if (OBJ_FROZEN(mesg)) {
mesg = rb_obj_dup(mesg);
}
@@ -430,10 +502,13 @@ setup_exception(rb_thread_t *th, int tag, volatile VALUE mesg)
JUMP_TAG(TAG_FATAL);
}
- rb_trap_restore_mask();
-
if (tag != TAG_FATAL) {
- EXEC_EVENT_HOOK(th, RUBY_EVENT_RAISE, th->cfp->self, 0, 0);
+ if(RUBY_DTRACE_RAISE_ENABLED()) {
+ RUBY_DTRACE_RAISE(rb_obj_classname(th->errinfo),
+ rb_sourcefile(),
+ rb_sourceline());
+ }
+ EXEC_EVENT_HOOK(th, RUBY_EVENT_RAISE, th->cfp->self, 0, 0, mesg);
}
}
@@ -510,7 +585,8 @@ rb_f_raise(int argc, VALUE *argv)
}
}
rb_raise_jump(rb_make_exception(argc, argv));
- return Qnil; /* not reached */
+
+ UNREACHABLE;
}
static VALUE
@@ -549,7 +625,7 @@ make_exception(int argc, VALUE *argv, int isstr)
}
break;
default:
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 0..3)", argc);
+ rb_check_arity(argc, 0, 3);
break;
}
if (argc > 0) {
@@ -581,7 +657,7 @@ rb_raise_jump(VALUE mesg)
setup_exception(th, TAG_RAISE, mesg);
- EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, self, mid, klass);
+ EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, self, mid, klass, Qnil);
rb_thread_raised_clear(th);
JUMP_TAG(TAG_RAISE);
}
@@ -597,8 +673,7 @@ rb_block_given_p(void)
{
rb_thread_t *th = GET_THREAD();
- if ((th->cfp->lfp[0] & 0x02) == 0 &&
- GC_GUARDED_PTR_REF(th->cfp->lfp[0])) {
+ if (rb_vm_control_frame_block_ptr(th->cfp)) {
return TRUE;
}
else {
@@ -633,8 +708,8 @@ rb_rescue2(VALUE (* b_proc) (ANYARGS), VALUE data1,
volatile VALUE e_info = th->errinfo;
va_list args;
- PUSH_TAG();
- if ((state = EXEC_TAG()) == 0) {
+ TH_PUSH_TAG(th);
+ if ((state = TH_EXEC_TAG()) == 0) {
retry_entry:
result = (*b_proc) (data1);
}
@@ -677,7 +752,7 @@ rb_rescue2(VALUE (* b_proc) (ANYARGS), VALUE data1,
}
}
}
- POP_TAG();
+ TH_POP_TAG();
if (state)
JUMP_TAG(state);
@@ -704,15 +779,15 @@ rb_protect(VALUE (* proc) (VALUE), VALUE data, int * state)
protect_tag.prev = th->protect_tag;
- PUSH_TAG();
+ TH_PUSH_TAG(th);
th->protect_tag = &protect_tag;
MEMCPY(&org_jmpbuf, &(th)->root_jmpbuf, rb_jmpbuf_t, 1);
- if ((status = EXEC_TAG()) == 0) {
+ if ((status = TH_EXEC_TAG()) == 0) {
SAVE_ROOT_JMPBUF(th, result = (*proc) (data));
}
MEMCPY(&(th)->root_jmpbuf, &org_jmpbuf, rb_jmpbuf_t, 1);
th->protect_tag = protect_tag.prev;
- POP_TAG();
+ TH_POP_TAG();
if (state) {
*state = status;
@@ -789,27 +864,66 @@ frame_func_id(rb_control_frame_t *cfp)
return 0;
}
-ID
-rb_frame_this_func(void)
+static ID
+frame_called_id(rb_control_frame_t *cfp)
{
- return frame_func_id(GET_THREAD()->cfp);
+ const rb_method_entry_t *me_local;
+ rb_iseq_t *iseq = cfp->iseq;
+ if (cfp->me) {
+ return cfp->me->called_id;
+ }
+ while (iseq) {
+ if (RUBY_VM_IFUNC_P(iseq)) {
+ NODE *ifunc = (NODE *)iseq;
+ if (ifunc->nd_aid) return ifunc->nd_aid;
+ return rb_intern("<ifunc>");
+ }
+ me_local = method_entry_of_iseq(cfp, iseq);
+ if (me_local) {
+ cfp->me = me_local;
+ return me_local->called_id;
+ }
+ if (iseq->defined_method_id) {
+ return iseq->defined_method_id;
+ }
+ if (iseq->local_iseq == iseq) {
+ break;
+ }
+ iseq = iseq->parent_iseq;
+ }
+ return 0;
}
ID
-rb_frame_callee(void)
+rb_frame_this_func(void)
{
return frame_func_id(GET_THREAD()->cfp);
}
-static ID
-rb_frame_caller(void)
+static rb_control_frame_t *
+previous_frame(rb_thread_t *th)
{
- rb_thread_t *th = GET_THREAD();
rb_control_frame_t *prev_cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
/* check if prev_cfp can be accessible */
if ((void *)(th->stack + th->stack_size) == (void *)(prev_cfp)) {
return 0;
}
+ return prev_cfp;
+}
+
+ID
+rb_frame_callee(void)
+{
+ rb_control_frame_t *prev_cfp = previous_frame(GET_THREAD());
+ if (!prev_cfp) return 0;
+ return frame_called_id(prev_cfp);
+}
+
+static ID
+rb_frame_caller(void)
+{
+ rb_control_frame_t *prev_cfp = previous_frame(GET_THREAD());
+ if (!prev_cfp) return 0;
return frame_func_id(prev_cfp);
}
@@ -859,16 +973,327 @@ static VALUE
rb_mod_include(int argc, VALUE *argv, VALUE module)
{
int i;
+ ID id_append_features, id_included;
+
+ CONST_ID(id_append_features, "append_features");
+ CONST_ID(id_included, "included");
+
+ for (i = 0; i < argc; i++)
+ Check_Type(argv[i], T_MODULE);
+ while (argc--) {
+ rb_funcall(argv[argc], id_append_features, 1, module);
+ rb_funcall(argv[argc], id_included, 1, module);
+ }
+ return module;
+}
+
+/*
+ * call-seq:
+ * prepend_features(mod) -> mod
+ *
+ * When this module is prepended in another, Ruby calls
+ * <code>prepend_features</code> in this module, passing it the
+ * receiving module in _mod_. Ruby's default implementation is
+ * to overlay the constants, methods, and module variables of this module
+ * to _mod_ if this module has not already been added to
+ * _mod_ or one of its ancestors. See also <code>Module#prepend</code>.
+ */
+
+static VALUE
+rb_mod_prepend_features(VALUE module, VALUE prepend)
+{
+ switch (TYPE(prepend)) {
+ case T_CLASS:
+ case T_MODULE:
+ break;
+ default:
+ Check_Type(prepend, T_CLASS);
+ break;
+ }
+ rb_prepend_module(prepend, module);
+
+ return module;
+}
+
+/*
+ * call-seq:
+ * prepend(module, ...) -> self
+ *
+ * Invokes <code>Module.prepend_features</code> on each parameter in reverse order.
+ */
+
+static VALUE
+rb_mod_prepend(int argc, VALUE *argv, VALUE module)
+{
+ int i;
+ ID id_prepend_features, id_prepended;
+ CONST_ID(id_prepend_features, "prepend_features");
+ CONST_ID(id_prepended, "prepended");
for (i = 0; i < argc; i++)
Check_Type(argv[i], T_MODULE);
while (argc--) {
- rb_funcall(argv[argc], rb_intern("append_features"), 1, module);
- rb_funcall(argv[argc], rb_intern("included"), 1, module);
+ rb_funcall(argv[argc], id_prepend_features, 1, module);
+ rb_funcall(argv[argc], id_prepended, 1, module);
}
return module;
}
+static
+void check_class_or_module(VALUE obj)
+{
+ if (!RB_TYPE_P(obj, T_CLASS) && !RB_TYPE_P(obj, T_MODULE)) {
+ VALUE str = rb_inspect(obj);
+ rb_raise(rb_eTypeError, "%s is not a class/module",
+ StringValuePtr(str));
+ }
+}
+
+static VALUE
+hidden_identity_hash_new()
+{
+ VALUE hash = rb_hash_new();
+
+ rb_funcall(hash, rb_intern("compare_by_identity"), 0);
+ RBASIC(hash)->klass = 0; /* hide from ObjectSpace */
+ return hash;
+}
+
+void
+rb_using_refinement(NODE *cref, VALUE klass, VALUE module)
+{
+ VALUE iclass, c, superclass = klass;
+
+ check_class_or_module(klass);
+ Check_Type(module, T_MODULE);
+ if (NIL_P(cref->nd_refinements)) {
+ cref->nd_refinements = hidden_identity_hash_new();
+ }
+ else {
+ if (cref->flags & NODE_FL_CREF_OMOD_SHARED) {
+ cref->nd_refinements = rb_hash_dup(cref->nd_refinements);
+ cref->flags &= ~NODE_FL_CREF_OMOD_SHARED;
+ }
+ if (!NIL_P(c = rb_hash_lookup(cref->nd_refinements, klass))) {
+ superclass = c;
+ while (c && TYPE(c) == T_ICLASS) {
+ if (RBASIC(c)->klass == module) {
+ /* already used refinement */
+ return;
+ }
+ c = RCLASS_SUPER(c);
+ }
+ }
+ }
+ FL_SET(module, RMODULE_IS_OVERLAID);
+ c = iclass = rb_include_class_new(module, superclass);
+ RCLASS_REFINED_CLASS(c) = klass;
+ module = RCLASS_SUPER(module);
+ while (module) {
+ FL_SET(module, RMODULE_IS_OVERLAID);
+ c = RCLASS_SUPER(c) = rb_include_class_new(module, RCLASS_SUPER(c));
+ RCLASS_REFINED_CLASS(c) = klass;
+ module = RCLASS_SUPER(module);
+ }
+ rb_hash_aset(cref->nd_refinements, klass, iclass);
+}
+
+void rb_using_module(NODE *cref, VALUE module);
+
+static int
+using_module_i(VALUE module, VALUE val, VALUE arg)
+{
+ NODE *cref = (NODE *) arg;
+
+ rb_using_module(cref, module);
+ return ST_CONTINUE;
+}
+
+static int
+using_refinement(VALUE klass, VALUE module, VALUE arg)
+{
+ NODE *cref = (NODE *) arg;
+
+ rb_using_refinement(cref, klass, module);
+ return ST_CONTINUE;
+}
+
+void
+rb_using_module(NODE *cref, VALUE module)
+{
+ ID id_refinements;
+ VALUE refinements;
+ ID id_using_modules;
+ VALUE using_modules;
+
+ check_class_or_module(module);
+ CONST_ID(id_using_modules, "__using_modules__");
+ using_modules = rb_attr_get(module, id_using_modules);
+ if (!NIL_P(using_modules)) {
+ rb_hash_foreach(using_modules, using_module_i, (VALUE) cref);
+ }
+ CONST_ID(id_refinements, "__refinements__");
+ refinements = rb_attr_get(module, id_refinements);
+ if (NIL_P(refinements)) return;
+ rb_hash_foreach(refinements, using_refinement, (VALUE) cref);
+}
+
+
+static int
+check_cyclic_using(VALUE mod, VALUE _, VALUE search)
+{
+ VALUE using_modules;
+ ID id_using_modules;
+ CONST_ID(id_using_modules, "__using_modules__");
+
+ if (mod == search) {
+ rb_raise(rb_eArgError, "cyclic using detected");
+ }
+
+ using_modules = rb_attr_get(mod, id_using_modules);
+ if (!NIL_P(using_modules)) {
+ rb_hash_foreach(using_modules, check_cyclic_using, search);
+ }
+
+ return ST_CONTINUE;
+}
+
+/*
+ * call-seq:
+ * using(module) -> self
+ *
+ * Import class refinements from <i>module</i> into the receiver.
+ */
+
+static VALUE
+rb_mod_using(VALUE self, VALUE module)
+{
+ NODE *cref = rb_vm_cref();
+ ID id_using_modules;
+ VALUE using_modules;
+
+ Check_Type(module, T_MODULE);
+ check_cyclic_using(module, 0, self);
+ CONST_ID(id_using_modules, "__using_modules__");
+ using_modules = rb_attr_get(self, id_using_modules);
+ if (NIL_P(using_modules)) {
+ using_modules = hidden_identity_hash_new();
+ rb_ivar_set(self, id_using_modules, using_modules);
+ }
+ rb_hash_aset(using_modules, module, Qtrue);
+ rb_using_module(cref, module);
+ rb_clear_cache();
+ rb_funcall(module, rb_intern("used"), 1, self);
+ return self;
+}
+
+static VALUE
+refinement_module_include(int argc, VALUE *argv, VALUE module)
+{
+ rb_thread_t *th = GET_THREAD();
+ rb_control_frame_t *cfp = th->cfp;
+ rb_control_frame_t *end_cfp = RUBY_VM_END_CONTROL_FRAME(th);
+ VALUE result = rb_mod_include(argc, argv, module);
+ NODE *cref;
+ ID id_refined_class;
+ VALUE klass, c;
+
+ CONST_ID(id_refined_class, "__refined_class__");
+ klass = rb_attr_get(module, id_refined_class);
+ while (RUBY_VM_VALID_CONTROL_FRAME_P(cfp, end_cfp)) {
+ if (RUBY_VM_NORMAL_ISEQ_P(cfp->iseq) &&
+ (cref = rb_vm_get_cref(cfp->iseq, cfp->ep)) &&
+ !NIL_P(cref->nd_refinements) &&
+ !NIL_P(c = rb_hash_lookup(cref->nd_refinements, klass))) {
+ while (argc--) {
+ VALUE mod = argv[argc];
+ if (rb_class_inherited_p(module, mod)) {
+ RCLASS_SUPER(c) =
+ rb_include_class_new(mod, RCLASS_SUPER(c));
+ }
+ }
+ break;
+ }
+ cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
+ }
+ return result;
+}
+
+/*
+ * call-seq:
+ * refine(klass) { block } -> module
+ *
+ * Refine <i>klass</i> in the receiver.
+ *
+ * Returns an overlaid module.
+ */
+
+static VALUE
+rb_mod_refine(VALUE module, VALUE klass)
+{
+ NODE *cref = rb_vm_cref();
+ VALUE mod;
+ ID id_refinements, id_refined_class, id_defined_at;
+ VALUE refinements;
+
+ if (!rb_block_given_p()) {
+ rb_raise(rb_eArgError, "no block given");
+ }
+ check_class_or_module(klass);
+ CONST_ID(id_refinements, "__refinements__");
+ refinements = rb_attr_get(module, id_refinements);
+ if (NIL_P(refinements)) {
+ refinements = hidden_identity_hash_new();
+ rb_ivar_set(module, id_refinements, refinements);
+ }
+ mod = rb_hash_lookup(refinements, klass);
+ if (NIL_P(mod)) {
+ mod = rb_module_new();
+ FL_SET(mod, RMODULE_IS_REFINEMENT);
+ CONST_ID(id_refined_class, "__refined_class__");
+ rb_ivar_set(mod, id_refined_class, klass);
+ CONST_ID(id_defined_at, "__defined_at__");
+ rb_ivar_set(mod, id_defined_at, module);
+ rb_define_singleton_method(mod, "include",
+ refinement_module_include, -1);
+ rb_using_refinement(cref, klass, mod);
+ rb_hash_aset(refinements, klass, mod);
+ }
+ rb_mod_module_eval(0, NULL, mod);
+ return mod;
+}
+
+static int
+refinements_i(VALUE key, VALUE value, VALUE arg)
+{
+ rb_hash_aset(arg, key, value);
+ return ST_CONTINUE;
+}
+
+/*
+ * call-seq:
+ * refinements -> hash
+ *
+ * Returns refinements in the receiver as a hash table, whose key is a
+ * refined class and whose value is a refinement module.
+ */
+
+static VALUE
+rb_mod_refinements(VALUE module)
+{
+ ID id_refinements;
+ VALUE refinements, result;
+
+ CONST_ID(id_refinements, "__refinements__");
+ refinements = rb_attr_get(module, id_refinements);
+ if (NIL_P(refinements)) {
+ return rb_hash_new();
+ }
+ result = rb_hash_new();
+ rb_hash_foreach(refinements, refinements_i, result);
+ return result;
+}
+
void
rb_obj_call_init(VALUE obj, int argc, VALUE *argv)
{
@@ -945,15 +1370,17 @@ static VALUE
rb_obj_extend(int argc, VALUE *argv, VALUE obj)
{
int i;
+ ID id_extend_object, id_extended;
- if (argc == 0) {
- rb_raise(rb_eArgError, "wrong number of arguments (at least 1)");
- }
+ CONST_ID(id_extend_object, "extend_object");
+ CONST_ID(id_extended, "extended");
+
+ rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS);
for (i = 0; i < argc; i++)
Check_Type(argv[i], T_MODULE);
while (argc--) {
- rb_funcall(argv[argc], rb_intern("extend_object"), 1, obj);
- rb_funcall(argv[argc], rb_intern("extended"), 1, obj);
+ rb_funcall(argv[argc], id_extend_object, 1, obj);
+ rb_funcall(argv[argc], id_extended, 1, obj);
}
return obj;
}
@@ -974,13 +1401,31 @@ top_include(int argc, VALUE *argv, VALUE self)
rb_secure(4);
if (th->top_wrapper) {
- rb_warning
- ("main#include in the wrapped load is effective only in wrapper module");
+ rb_warning("main.include in the wrapped load is effective only in wrapper module");
return rb_mod_include(argc, argv, th->top_wrapper);
}
return rb_mod_include(argc, argv, rb_cObject);
}
+/*
+ * call-seq:
+ * using(module) -> self
+ *
+ * Import class refinements from <i>module</i> into the scope where
+ * <code>using</code> is called.
+ */
+
+static VALUE
+top_using(VALUE self, VALUE module)
+{
+ NODE *cref = rb_vm_cref();
+
+ Check_Type(module, T_MODULE);
+ rb_using_module(cref, module);
+ rb_clear_cache();
+ return self;
+}
+
static VALUE *
errinfo_place(rb_thread_t *th)
{
@@ -990,12 +1435,12 @@ errinfo_place(rb_thread_t *th)
while (RUBY_VM_VALID_CONTROL_FRAME_P(cfp, end_cfp)) {
if (RUBY_VM_NORMAL_ISEQ_P(cfp->iseq)) {
if (cfp->iseq->type == ISEQ_TYPE_RESCUE) {
- return &cfp->dfp[-2];
+ return &cfp->ep[-2];
}
else if (cfp->iseq->type == ISEQ_TYPE_ENSURE &&
- TYPE(cfp->dfp[-2]) != T_NODE &&
- !FIXNUM_P(cfp->dfp[-2])) {
- return &cfp->dfp[-2];
+ !RB_TYPE_P(cfp->ep[-2], T_NODE) &&
+ !FIXNUM_P(cfp->ep[-2])) {
+ return &cfp->ep[-2];
}
}
cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
@@ -1113,6 +1558,38 @@ rb_f_method_name(void)
}
}
+static VALUE
+rb_f_callee_name(void)
+{
+ ID fname = rb_frame_callee(); /* need *callee* ID */
+
+ if (fname) {
+ return ID2SYM(fname);
+ }
+ else {
+ return Qnil;
+ }
+}
+
+/*
+ * call-seq:
+ * __dir__ -> string
+ *
+ * Returns the value of <code>File.dirname(__FILE__)</code>
+ * If <code>__FILE__</code> is <code>nil</code>, it returns <code>nil</code>.
+ *
+ */
+static VALUE
+f_current_dirname(void)
+{
+ VALUE base = rb_current_realfilepath();
+ if (NIL_P(base)) {
+ return Qnil;
+ }
+ base = rb_file_dirname(base);
+ return base;
+}
+
void
Init_eval(void)
{
@@ -1125,11 +1602,17 @@ Init_eval(void)
rb_define_global_function("global_variables", rb_f_global_variables, 0); /* in variable.c */
rb_define_global_function("__method__", rb_f_method_name, 0);
- rb_define_global_function("__callee__", rb_f_method_name, 0);
+ rb_define_global_function("__callee__", rb_f_callee_name, 0);
+ rb_define_global_function("__dir__", f_current_dirname, 0);
rb_define_private_method(rb_cModule, "append_features", rb_mod_append_features, 1);
rb_define_private_method(rb_cModule, "extend_object", rb_mod_extend_object, 1);
rb_define_private_method(rb_cModule, "include", rb_mod_include, -1);
+ rb_define_private_method(rb_cModule, "prepend_features", rb_mod_prepend_features, 1);
+ rb_define_private_method(rb_cModule, "prepend", rb_mod_prepend, -1);
+ rb_define_private_method(rb_cModule, "using", rb_mod_using, 1);
+ rb_define_private_method(rb_cModule, "refine", rb_mod_refine, 1);
+ rb_define_method(rb_cModule, "refinements", rb_mod_refinements, 0);
rb_undef_method(rb_cClass, "module_function");
@@ -1140,6 +1623,7 @@ Init_eval(void)
rb_define_singleton_method(rb_cModule, "constants", rb_mod_s_constants, -1);
rb_define_singleton_method(rb_vm_top_self(), "include", top_include, -1);
+ rb_define_singleton_method(rb_vm_top_self(), "using", top_using, 1);
rb_define_method(rb_mKernel, "extend", rb_obj_extend, -1);
diff --git a/eval_error.c b/eval_error.c
index fd06adf92d..76140fcded 100644
--- a/eval_error.c
+++ b/eval_error.c
@@ -55,9 +55,22 @@ rb_get_backtrace(VALUE info)
return get_backtrace(info);
}
+VALUE rb_exc_set_backtrace(VALUE exc, VALUE bt);
+
static void
set_backtrace(VALUE info, VALUE bt)
{
+ ID set_backtrace = rb_intern("set_backtrace");
+
+ if (rb_backtrace_p(bt)) {
+ if (rb_method_basic_definition_p(CLASS_OF(info), set_backtrace)) {
+ rb_exc_set_backtrace(info, bt);
+ return;
+ }
+ else {
+ bt = rb_backtrace_to_str_ary(bt);
+ }
+ }
rb_funcall(info, rb_intern("set_backtrace"), 1, bt);
}
@@ -76,14 +89,14 @@ error_print(void)
return;
rb_thread_raised_clear(th);
- PUSH_TAG();
- if (EXEC_TAG() == 0) {
+ TH_PUSH_TAG(th);
+ if (TH_EXEC_TAG() == 0) {
errat = get_backtrace(errinfo);
}
else {
errat = Qnil;
}
- if (EXEC_TAG())
+ if (TH_EXEC_TAG())
goto error;
if (NIL_P(errat)) {
const char *file = rb_sourcefile();
@@ -109,7 +122,7 @@ error_print(void)
}
eclass = CLASS_OF(errinfo);
- if (EXEC_TAG() == 0) {
+ if (TH_EXEC_TAG() == 0) {
e = rb_funcall(errinfo, rb_intern("message"), 0, 0);
StringValue(e);
einfo = RSTRING_PTR(e);
@@ -119,7 +132,7 @@ error_print(void)
einfo = "";
elen = 0;
}
- if (EXEC_TAG())
+ if (TH_EXEC_TAG())
goto error;
if (eclass == rb_eRuntimeError && elen == 0) {
warn_print(": unhandled exception\n");
@@ -168,7 +181,7 @@ error_print(void)
#define TRACE_TAIL 5
for (i = 1; i < len; i++) {
- if (TYPE(ptr[i]) == T_STRING) {
+ if (RB_TYPE_P(ptr[i], T_STRING)) {
warn_printf("\tfrom %s\n", RSTRING_PTR(ptr[i]));
}
if (skip && i == TRACE_HEAD && len > TRACE_MAX) {
@@ -179,7 +192,7 @@ error_print(void)
}
}
error:
- POP_TAG();
+ TH_POP_TAG();
rb_thread_raised_set(th, raised_flag);
}
@@ -202,10 +215,19 @@ rb_print_undef(VALUE klass, ID id, int scope)
}
rb_name_error(id, "undefined%s method `%s' for %s `%s'", v,
rb_id2name(id),
- (TYPE(klass) == T_MODULE) ? "module" : "class",
+ (RB_TYPE_P(klass, T_MODULE)) ? "module" : "class",
rb_class2name(klass));
}
+void
+rb_print_undef_str(VALUE klass, VALUE name)
+{
+ rb_name_error_str(name, "undefined method `%s' for %s `%s'",
+ RSTRING_PTR(name),
+ (RB_TYPE_P(klass, T_MODULE)) ? "module" : "class",
+ rb_class2name(klass));
+}
+
static int
sysexit_status(VALUE err)
{
diff --git a/eval_intern.h b/eval_intern.h
index 483e711c34..421900b147 100644
--- a/eval_intern.h
+++ b/eval_intern.h
@@ -5,7 +5,7 @@
#include "vm_core.h"
#define PASS_PASSED_BLOCK_TH(th) do { \
- (th)->passed_block = GC_GUARDED_PTR_REF((rb_block_t *)(th)->cfp->lfp[0]); \
+ (th)->passed_block = rb_vm_control_frame_block_ptr(th->cfp); \
(th)->cfp->flag |= VM_FRAME_FLAG_PASSED; \
} while (0)
@@ -31,27 +31,6 @@
#include <crt_externs.h>
#endif
-/* Make alloca work the best possible way. */
-#ifdef __GNUC__
-# ifndef atarist
-# ifndef alloca
-# define alloca __builtin_alloca
-# endif
-# endif /* atarist */
-#else
-# ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-# else
-# ifdef _AIX
-#pragma alloca
-# else
-# ifndef alloca /* predefined by HP cc +Olibcalls */
-void *alloca();
-# endif
-# endif /* AIX */
-# endif /* HAVE_ALLOCA_H */
-#endif /* __GNUC__ */
-
#ifndef HAVE_STRING_H
char *strrchr(const char *, const char);
#endif
@@ -198,9 +177,12 @@ int rb_threadptr_reset_raised(rb_thread_t *th);
VALUE rb_f_eval(int argc, VALUE *argv, VALUE self);
VALUE rb_make_exception(int argc, VALUE *argv);
+NORETURN(void rb_method_name_error(VALUE, VALUE));
+
NORETURN(void rb_fiber_start(void));
NORETURN(void rb_print_undef(VALUE, ID, int));
+NORETURN(void rb_print_undef_str(VALUE, VALUE));
NORETURN(void rb_vm_localjump_error(const char *,VALUE, int));
NORETURN(void rb_vm_jump_tag_but_local_jump(int, VALUE));
NORETURN(void rb_raise_method_missing(rb_thread_t *th, int argc, VALUE *argv,
@@ -213,7 +195,6 @@ void rb_vm_set_progname(VALUE filename);
void rb_thread_terminate_all(void);
VALUE rb_vm_top_self();
VALUE rb_vm_cbase(void);
-void rb_trap_restore_mask(void);
#ifndef CharNext /* defined as CharNext[AW] on Windows. */
#define CharNext(p) ((p) + mblen((p), RUBY_MBCHAR_MAXSIZE))
diff --git a/eval_jump.c b/eval_jump.c
index a8f04808ca..092ab8766a 100644
--- a/eval_jump.c
+++ b/eval_jump.c
@@ -99,6 +99,8 @@ rb_exec_end_proc(void)
struct end_proc_data *volatile link;
int status;
volatile int safe = rb_safe_level();
+ rb_thread_t *th = GET_THREAD();
+ volatile VALUE errinfo = th->errinfo;
while (ephemeral_end_procs) {
link = ephemeral_end_procs;
@@ -112,6 +114,7 @@ rb_exec_end_proc(void)
POP_TAG();
if (status) {
error_handle(status);
+ if (!NIL_P(th->errinfo)) errinfo = th->errinfo;
}
xfree(link);
}
@@ -128,10 +131,12 @@ rb_exec_end_proc(void)
POP_TAG();
if (status) {
error_handle(status);
+ if (!NIL_P(th->errinfo)) errinfo = th->errinfo;
}
xfree(link);
}
rb_set_safe_level_force(safe);
+ th->errinfo = errinfo;
}
void
diff --git a/ext/-test-/add_suffix/bug.c b/ext/-test-/add_suffix/bug.c
deleted file mode 100644
index cd215338e0..0000000000
--- a/ext/-test-/add_suffix/bug.c
+++ /dev/null
@@ -1,22 +0,0 @@
-#include "ruby.h"
-#include "ruby/defines.h"
-#include "ruby/util.h"
-#ifndef HAVE_RUBY_ADD_SUFFIX
-#define _WIN32 1
-#include "util.c"
-#endif
-
-static VALUE
-add_suffix(VALUE self, VALUE path, VALUE suffix)
-{
- StringValueCStr(path);
- ruby_add_suffix(path, StringValueCStr(suffix));
- return path;
-}
-
-void
-Init_bug(void)
-{
- VALUE mBug = rb_define_module("Bug");
- rb_define_module_function(mBug, "add_suffix", add_suffix, 2);
-}
diff --git a/ext/-test-/add_suffix/depend b/ext/-test-/add_suffix/depend
deleted file mode 100644
index 943d0d9f21..0000000000
--- a/ext/-test-/add_suffix/depend
+++ /dev/null
@@ -1 +0,0 @@
-bug.o: $(hdrdir)/ruby/util.h $(top_srcdir)/util.c
diff --git a/ext/-test-/add_suffix/extconf.rb b/ext/-test-/add_suffix/extconf.rb
deleted file mode 100644
index bffd1550f3..0000000000
--- a/ext/-test-/add_suffix/extconf.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-unless have_func("ruby_add_suffix", "ruby/util.h")
- $INCFLAGS << " -I$(top_srcdir)"
-end
-create_makefile("-test-/add_suffix/bug")
diff --git a/ext/-test-/bug-5832/bug.c b/ext/-test-/bug-5832/bug.c
new file mode 100644
index 0000000000..67be5844b6
--- /dev/null
+++ b/ext/-test-/bug-5832/bug.c
@@ -0,0 +1,14 @@
+#include <ruby.h>
+
+static VALUE
+bug_funcall_callback(VALUE self, VALUE obj)
+{
+ return rb_funcall(obj, rb_intern("callback"), 0);
+}
+
+void
+Init_bug(void)
+{
+ VALUE mBug = rb_define_module("Bug");
+ rb_define_module_function(mBug, "funcall_callback", bug_funcall_callback, 1);
+}
diff --git a/ext/-test-/bug-5832/extconf.rb b/ext/-test-/bug-5832/extconf.rb
new file mode 100644
index 0000000000..55a4b7d93f
--- /dev/null
+++ b/ext/-test-/bug-5832/extconf.rb
@@ -0,0 +1 @@
+create_makefile("-test-/bug-5832/bug")
diff --git a/ext/-test-/exception/enc_raise.c b/ext/-test-/exception/enc_raise.c
new file mode 100644
index 0000000000..dc8a42cf3f
--- /dev/null
+++ b/ext/-test-/exception/enc_raise.c
@@ -0,0 +1,15 @@
+#include <ruby.h>
+#include <ruby/encoding.h>
+
+static VALUE
+enc_raise(VALUE exc, VALUE encoding, VALUE mesg)
+{
+ rb_enc_raise(rb_to_encoding(encoding), exc, "%s", StringValueCStr(mesg));
+ UNREACHABLE;
+}
+
+void
+Init_enc_raise(VALUE klass)
+{
+ rb_define_module_function(klass, "enc_raise", enc_raise, 2);
+}
diff --git a/ext/-test-/exception/extconf.rb b/ext/-test-/exception/extconf.rb
new file mode 100644
index 0000000000..0faf6d53ed
--- /dev/null
+++ b/ext/-test-/exception/extconf.rb
@@ -0,0 +1,6 @@
+$srcs = Dir[File.join($srcdir, "*.{#{SRC_EXT.join(%q{,})}}")]
+inits = $srcs.map {|s| File.basename(s, ".*")}
+inits.delete("init")
+inits.map! {|s|"X(#{s})"}
+$defs << "-DTEST_INIT_FUNCS(X)=\"#{inits.join(' ')}\""
+create_makefile("-test-/exception")
diff --git a/ext/-test-/exception/init.c b/ext/-test-/exception/init.c
new file mode 100644
index 0000000000..853bb68f79
--- /dev/null
+++ b/ext/-test-/exception/init.c
@@ -0,0 +1,11 @@
+#include "ruby.h"
+
+#define init(n) {void Init_##n(VALUE klass); Init_##n(klass);}
+
+void
+Init_exception(void)
+{
+ VALUE mBug = rb_define_module("Bug");
+ VALUE klass = rb_define_class_under(mBug, "Exception", rb_eStandardError);
+ TEST_INIT_FUNCS(init);
+}
diff --git a/ext/-test-/iter/break.c b/ext/-test-/iter/break.c
new file mode 100644
index 0000000000..b72440f838
--- /dev/null
+++ b/ext/-test-/iter/break.c
@@ -0,0 +1,16 @@
+#include <ruby.h>
+
+static VALUE
+iter_break_value(VALUE self, VALUE val)
+{
+ rb_iter_break_value(val);
+
+ UNREACHABLE;
+}
+
+void
+Init_break(void)
+{
+ VALUE breakable = rb_define_module_under(rb_define_module("Bug"), "Breakable");
+ rb_define_module_function(breakable, "iter_break", iter_break_value, 1);
+}
diff --git a/ext/-test-/iter/extconf.rb b/ext/-test-/iter/extconf.rb
new file mode 100644
index 0000000000..695b5e9f6d
--- /dev/null
+++ b/ext/-test-/iter/extconf.rb
@@ -0,0 +1 @@
+create_makefile("-test-/iter/break")
diff --git a/ext/-test-/marshal/compat/extconf.rb b/ext/-test-/marshal/compat/extconf.rb
new file mode 100644
index 0000000000..bb11ebfb8c
--- /dev/null
+++ b/ext/-test-/marshal/compat/extconf.rb
@@ -0,0 +1 @@
+create_makefile("-test-/marshal/compat")
diff --git a/ext/-test-/marshal/compat/usrcompat.c b/ext/-test-/marshal/compat/usrcompat.c
new file mode 100644
index 0000000000..f812df5631
--- /dev/null
+++ b/ext/-test-/marshal/compat/usrcompat.c
@@ -0,0 +1,32 @@
+#include <ruby.h>
+
+static VALUE
+usr_dumper(VALUE self)
+{
+ return self;
+}
+
+static VALUE
+usr_loader(VALUE self, VALUE m)
+{
+ VALUE val = rb_ivar_get(m, rb_intern("@value"));
+ *(int *)DATA_PTR(self) = NUM2INT(val);
+ return self;
+}
+
+static VALUE
+compat_mload(VALUE self, VALUE data)
+{
+ rb_ivar_set(self, rb_intern("@value"), data);
+ return self;
+}
+
+void
+Init_compat(void)
+{
+ VALUE newclass = rb_path2class("Bug::Marshal::UsrMarshal");
+ VALUE oldclass = rb_define_class_under(newclass, "compat", rb_cObject);
+
+ rb_define_method(oldclass, "marshal_load", compat_mload, 1);
+ rb_marshal_define_compat(newclass, oldclass, usr_dumper, usr_loader);
+}
diff --git a/ext/-test-/marshal/usr/extconf.rb b/ext/-test-/marshal/usr/extconf.rb
new file mode 100644
index 0000000000..c662b23dd5
--- /dev/null
+++ b/ext/-test-/marshal/usr/extconf.rb
@@ -0,0 +1 @@
+create_makefile("-test-/marshal/usr")
diff --git a/ext/-test-/marshal/usr/usrmarshal.c b/ext/-test-/marshal/usr/usrmarshal.c
new file mode 100644
index 0000000000..b30bd52c13
--- /dev/null
+++ b/ext/-test-/marshal/usr/usrmarshal.c
@@ -0,0 +1,35 @@
+#include <ruby.h>
+
+static VALUE
+usr_alloc(VALUE klass)
+{
+ int *p;
+ return Data_Make_Struct(klass, int, 0, RUBY_DEFAULT_FREE, p);
+}
+
+static VALUE
+usr_init(VALUE self, VALUE val)
+{
+ *(int *)DATA_PTR(self) = NUM2INT(val);
+ return self;
+}
+
+static VALUE
+usr_value(VALUE self)
+{
+ int val = *(int *)DATA_PTR(self);
+ return INT2NUM(val);
+}
+
+void
+Init_usr(void)
+{
+ VALUE mMarshal = rb_define_module_under(rb_define_module("Bug"), "Marshal");
+ VALUE newclass = rb_define_class_under(mMarshal, "UsrMarshal", rb_cObject);
+
+ rb_define_alloc_func(newclass, usr_alloc);
+ rb_define_method(newclass, "initialize", usr_init, 1);
+ rb_define_method(newclass, "value", usr_value, 0);
+ rb_define_method(newclass, "marshal_load", usr_init, 1);
+ rb_define_method(newclass, "marshal_dump", usr_value, 0);
+}
diff --git a/ext/-test-/num2int/depend b/ext/-test-/num2int/depend
new file mode 100644
index 0000000000..7a85cdb6c0
--- /dev/null
+++ b/ext/-test-/num2int/depend
@@ -0,0 +1 @@
+num2int.o: $(top_srcdir)/numeric.c $(hdrdir)/ruby/ruby.h
diff --git a/ext/-test-/num2int/extconf.rb b/ext/-test-/num2int/extconf.rb
new file mode 100644
index 0000000000..2bc820e480
--- /dev/null
+++ b/ext/-test-/num2int/extconf.rb
@@ -0,0 +1 @@
+create_makefile("-test-/num2int/num2int")
diff --git a/ext/-test-/num2int/num2int.c b/ext/-test-/num2int/num2int.c
new file mode 100644
index 0000000000..fb1ea9678d
--- /dev/null
+++ b/ext/-test-/num2int/num2int.c
@@ -0,0 +1,120 @@
+#include <ruby.h>
+
+static VALUE
+print_num2short(VALUE obj, VALUE num)
+{
+ char buf[128];
+ VALUE str;
+
+ sprintf(buf, "%d", NUM2SHORT(num));
+ str = rb_str_new_cstr(buf);
+ rb_io_write(rb_stdout, str);
+ return Qnil;
+}
+
+static VALUE
+print_num2ushort(VALUE obj, VALUE num)
+{
+ char buf[128];
+ VALUE str;
+
+ sprintf(buf, "%u", NUM2USHORT(num));
+ str = rb_str_new_cstr(buf);
+ rb_io_write(rb_stdout, str);
+ return Qnil;
+}
+
+static VALUE
+print_num2int(VALUE obj, VALUE num)
+{
+ char buf[128];
+ VALUE str;
+
+ sprintf(buf, "%d", NUM2INT(num));
+ str = rb_str_new_cstr(buf);
+ rb_io_write(rb_stdout, str);
+ return Qnil;
+}
+
+static VALUE
+print_num2uint(VALUE obj, VALUE num)
+{
+ char buf[128];
+ VALUE str;
+
+ sprintf(buf, "%u", NUM2UINT(num));
+ str = rb_str_new_cstr(buf);
+ rb_io_write(rb_stdout, str);
+ return Qnil;
+}
+
+static VALUE
+print_num2long(VALUE obj, VALUE num)
+{
+ char buf[128];
+ VALUE str;
+
+ sprintf(buf, "%ld", NUM2LONG(num));
+ str = rb_str_new_cstr(buf);
+ rb_io_write(rb_stdout, str);
+ return Qnil;
+}
+
+static VALUE
+print_num2ulong(VALUE obj, VALUE num)
+{
+ char buf[128];
+ VALUE str;
+
+ sprintf(buf, "%lu", NUM2ULONG(num));
+ str = rb_str_new_cstr(buf);
+ rb_io_write(rb_stdout, str);
+ return Qnil;
+}
+
+#ifdef HAVE_LONG_LONG
+static VALUE
+print_num2ll(VALUE obj, VALUE num)
+{
+ char buf[128];
+ VALUE str;
+
+ sprintf(buf, "%"PRI_LL_PREFIX"d", NUM2LL(num));
+ str = rb_str_new_cstr(buf);
+ rb_io_write(rb_stdout, str);
+ return Qnil;
+}
+
+static VALUE
+print_num2ull(VALUE obj, VALUE num)
+{
+ char buf[128];
+ VALUE str;
+
+ sprintf(buf, "%"PRI_LL_PREFIX"u", NUM2ULL(num));
+ str = rb_str_new_cstr(buf);
+ rb_io_write(rb_stdout, str);
+ return Qnil;
+}
+#endif
+
+void
+Init_num2int(void)
+{
+ VALUE cNum2int = rb_path2class("TestNum2int::Num2int");
+
+ rb_define_singleton_method(cNum2int, "print_num2short", print_num2short, 1);
+ rb_define_singleton_method(cNum2int, "print_num2ushort", print_num2ushort, 1);
+
+ rb_define_singleton_method(cNum2int, "print_num2int", print_num2int, 1);
+ rb_define_singleton_method(cNum2int, "print_num2uint", print_num2uint, 1);
+
+ rb_define_singleton_method(cNum2int, "print_num2long", print_num2long, 1);
+ rb_define_singleton_method(cNum2int, "print_num2ulong", print_num2ulong, 1);
+
+#ifdef HAVE_LONG_LONG
+ rb_define_singleton_method(cNum2int, "print_num2ll", print_num2ll, 1);
+ rb_define_singleton_method(cNum2int, "print_num2ull", print_num2ull, 1);
+#endif
+}
+
diff --git a/ext/-test-/old_thread_select/depend b/ext/-test-/old_thread_select/depend
new file mode 100644
index 0000000000..a2bc836e1f
--- /dev/null
+++ b/ext/-test-/old_thread_select/depend
@@ -0,0 +1,2 @@
+old_thread_select.o: $(top_srcdir)/thread.c \
+ $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/io.h
diff --git a/ext/-test-/old_thread_select/extconf.rb b/ext/-test-/old_thread_select/extconf.rb
new file mode 100644
index 0000000000..730d9ec901
--- /dev/null
+++ b/ext/-test-/old_thread_select/extconf.rb
@@ -0,0 +1,4 @@
+$warnflags = "-Wno-deprecated-declarations"
+$warnflags = "" unless try_compile("", $warnflags)
+
+create_makefile("-test-/old_thread_select/old_thread_select")
diff --git a/ext/-test-/old_thread_select/old_thread_select.c b/ext/-test-/old_thread_select/old_thread_select.c
new file mode 100644
index 0000000000..e374f02355
--- /dev/null
+++ b/ext/-test-/old_thread_select/old_thread_select.c
@@ -0,0 +1,75 @@
+/* test case for deprecated C API */
+#include "ruby/ruby.h"
+#include "ruby/io.h"
+
+static fd_set * array2fdset(fd_set *fds, VALUE ary, int *max)
+{
+ long i;
+
+ if (NIL_P(ary))
+ return NULL;
+
+ FD_ZERO(fds);
+ Check_Type(ary, T_ARRAY);
+ for (i = 0; i < RARRAY_LEN(ary); i++) {
+ VALUE val = RARRAY_PTR(ary)[i];
+ int fd;
+
+ Check_Type(val, T_FIXNUM);
+ fd = FIX2INT(val);
+ if (fd >= *max)
+ *max = fd + 1;
+ FD_SET(fd, fds);
+ }
+
+ return fds;
+}
+
+static void fdset2array(VALUE dst, fd_set *fds, int max)
+{
+ int i;
+
+ rb_ary_clear(dst);
+
+ for (i = 0; i < max; i++) {
+ if (FD_ISSET(i, fds))
+ rb_ary_push(dst, INT2NUM(i));
+ }
+}
+
+static VALUE
+old_thread_select(VALUE klass, VALUE r, VALUE w, VALUE e, VALUE timeout)
+{
+ struct timeval tv;
+ struct timeval *tvp = NULL;
+ fd_set rfds, wfds, efds;
+ fd_set *rp, *wp, *ep;
+ int rc;
+ int max = 0;
+
+ if (!NIL_P(timeout)) {
+ tv = rb_time_timeval(timeout);
+ tvp = &tv;
+ }
+ rp = array2fdset(&rfds, r, &max);
+ wp = array2fdset(&wfds, w, &max);
+ ep = array2fdset(&efds, e, &max);
+ rc = rb_thread_select(max, rp, wp, ep, tvp);
+ if (rc == -1)
+ rb_sys_fail("rb_wait_for_single_fd");
+
+ if (rp)
+ fdset2array(r, &rfds, max);
+ if (wp)
+ fdset2array(w, &wfds, max);
+ if (ep)
+ fdset2array(e, &efds, max);
+ return INT2NUM(rc);
+}
+
+void
+Init_old_thread_select(void)
+{
+ rb_define_singleton_method(rb_cIO, "old_thread_select",
+ old_thread_select, 4);
+}
diff --git a/ext/-test-/path_to_class/extconf.rb b/ext/-test-/path_to_class/extconf.rb
new file mode 100644
index 0000000000..e1072b1443
--- /dev/null
+++ b/ext/-test-/path_to_class/extconf.rb
@@ -0,0 +1,6 @@
+$srcs = Dir[File.join($srcdir, "*.{#{SRC_EXT.join(%q{,})}}")]
+inits = $srcs.map {|s| File.basename(s, ".*")}
+inits.delete("init")
+inits.map! {|s|"X(#{s})"}
+$defs << "-DTEST_INIT_FUNCS(X)=\"#{inits.join(' ')}\""
+create_makefile("-test-/path_to_class/path_to_class")
diff --git a/ext/-test-/path_to_class/path_to_class.c b/ext/-test-/path_to_class/path_to_class.c
new file mode 100644
index 0000000000..c8c2831b09
--- /dev/null
+++ b/ext/-test-/path_to_class/path_to_class.c
@@ -0,0 +1,15 @@
+#include "ruby.h"
+
+static VALUE
+path_to_class(VALUE klass, VALUE path)
+{
+ return rb_path_to_class(path);
+}
+
+void
+Init_path_to_class(void)
+{
+ VALUE klass = rb_path2class("Test_PathToClass");
+
+ rb_define_singleton_method(klass, "path_to_class", path_to_class, 1);
+}
diff --git a/ext/-test-/printf/extconf.rb b/ext/-test-/printf/extconf.rb
new file mode 100644
index 0000000000..7b96da0c85
--- /dev/null
+++ b/ext/-test-/printf/extconf.rb
@@ -0,0 +1 @@
+create_makefile("-test-/printf")
diff --git a/ext/-test-/printf/printf.c b/ext/-test-/printf/printf.c
new file mode 100644
index 0000000000..775eb33dc7
--- /dev/null
+++ b/ext/-test-/printf/printf.c
@@ -0,0 +1,31 @@
+#include <ruby.h>
+#include <ruby/encoding.h>
+
+static VALUE
+printf_test_i(VALUE self, VALUE obj)
+{
+ char buf[256];
+ snprintf(buf, sizeof(buf), "<%"PRIsVALUE">", obj);
+ return rb_usascii_str_new2(buf);
+}
+
+static VALUE
+printf_test_s(VALUE self, VALUE obj)
+{
+ return rb_enc_sprintf(rb_usascii_encoding(), "<%"PRIsVALUE">", obj);
+}
+
+static VALUE
+printf_test_v(VALUE self, VALUE obj)
+{
+ return rb_enc_sprintf(rb_usascii_encoding(), "{%+"PRIsVALUE"}", obj);
+}
+
+void
+Init_printf(void)
+{
+ VALUE m = rb_define_module_under(rb_define_module("Bug"), "Printf");
+ rb_define_singleton_method(m, "i", printf_test_i, 1);
+ rb_define_singleton_method(m, "s", printf_test_s, 1);
+ rb_define_singleton_method(m, "v", printf_test_v, 1);
+}
diff --git a/ext/-test-/st/numhash/extconf.rb b/ext/-test-/st/numhash/extconf.rb
new file mode 100644
index 0000000000..867fd75d2a
--- /dev/null
+++ b/ext/-test-/st/numhash/extconf.rb
@@ -0,0 +1 @@
+create_makefile("-test-/st/numhash")
diff --git a/ext/-test-/st/numhash/numhash.c b/ext/-test-/st/numhash/numhash.c
new file mode 100644
index 0000000000..d4dbd1a0ce
--- /dev/null
+++ b/ext/-test-/st/numhash/numhash.c
@@ -0,0 +1,120 @@
+#include <ruby.h>
+#include <ruby/st.h>
+
+static void
+numhash_free(void *ptr)
+{
+ if (ptr) st_free_table(ptr);
+}
+
+static VALUE
+numhash_alloc(VALUE klass)
+{
+ return Data_Wrap_Struct(klass, 0, numhash_free, 0);
+}
+
+static VALUE
+numhash_init(VALUE self)
+{
+ st_table *tbl = (st_table *)DATA_PTR(self);
+ if (tbl) st_free_table(tbl);
+ DATA_PTR(self) = st_init_numtable();
+ return self;
+}
+
+static VALUE
+numhash_aref(VALUE self, VALUE key)
+{
+ st_data_t data;
+ if (!SPECIAL_CONST_P(key)) rb_raise(rb_eArgError, "not a special const");
+ if (st_lookup((st_table *)DATA_PTR(self), (st_data_t)key, &data))
+ return (VALUE)data;
+ return Qnil;
+}
+
+static VALUE
+numhash_aset(VALUE self, VALUE key, VALUE data)
+{
+ if (!SPECIAL_CONST_P(key)) rb_raise(rb_eArgError, "not a special const");
+ if (!SPECIAL_CONST_P(data)) rb_raise(rb_eArgError, "not a special const");
+ st_insert((st_table *)DATA_PTR(self), (st_data_t)key, (st_data_t)data);
+ return self;
+}
+
+static int
+numhash_i(st_data_t key, st_data_t value, st_data_t arg)
+{
+ VALUE ret;
+ ret = rb_yield_values(3, (VALUE)key, (VALUE)value, (VALUE)arg);
+ if (ret == Qtrue) return ST_CHECK;
+ return ST_CONTINUE;
+}
+
+static VALUE
+numhash_each(VALUE self)
+{
+ st_table *table = DATA_PTR(self);
+ st_data_t data = (st_data_t)self;
+ return st_foreach_check(table, numhash_i, data, data) ? Qtrue : Qfalse;
+}
+
+static int
+update_func(st_data_t *key, st_data_t *value, st_data_t arg, int existing)
+{
+ VALUE ret = rb_yield_values(existing ? 2 : 1, (VALUE)*key, (VALUE)*value);
+ switch (ret) {
+ case Qfalse:
+ return ST_STOP;
+ case Qnil:
+ return ST_DELETE;
+ default:
+ *value = ret;
+ return ST_CONTINUE;
+ }
+}
+
+static VALUE
+numhash_update(VALUE self, VALUE key)
+{
+ if (st_update((st_table *)DATA_PTR(self), (st_data_t)key, update_func, 0))
+ return Qtrue;
+ else
+ return Qfalse;
+}
+
+#if SIZEOF_LONG == SIZEOF_VOIDP
+# define ST2NUM(x) ULONG2NUM(x)
+#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP
+# define ST2NUM(x) ULL2NUM(x)
+#endif
+
+static VALUE
+numhash_size(VALUE self)
+{
+ return ST2NUM(((st_table *)DATA_PTR(self))->num_entries);
+}
+
+static VALUE
+numhash_delete_safe(VALUE self, VALUE key)
+{
+ st_data_t val, k = (st_data_t)key;
+ if (st_delete_safe((st_table *)DATA_PTR(self), &k, &val, (st_data_t)self)) {
+ return val;
+ }
+ return Qnil;
+}
+
+void
+Init_numhash(void)
+{
+ VALUE st = rb_define_class_under(rb_define_module("Bug"), "StNumHash", rb_cData);
+ rb_define_alloc_func(st, numhash_alloc);
+ rb_define_method(st, "initialize", numhash_init, 0);
+ rb_define_method(st, "[]", numhash_aref, 1);
+ rb_define_method(st, "[]=", numhash_aset, 2);
+ rb_define_method(st, "each", numhash_each, 0);
+ rb_define_method(st, "update", numhash_update, 1);
+ rb_define_method(st, "size", numhash_size, 0);
+ rb_define_method(st, "delete_safe", numhash_delete_safe, 1);
+}
+
diff --git a/ext/-test-/st/update/extconf.rb b/ext/-test-/st/update/extconf.rb
new file mode 100644
index 0000000000..96dbae43ab
--- /dev/null
+++ b/ext/-test-/st/update/extconf.rb
@@ -0,0 +1 @@
+create_makefile("-test-/st/update")
diff --git a/ext/-test-/st/update/update.c b/ext/-test-/st/update/update.c
new file mode 100644
index 0000000000..979ad3e334
--- /dev/null
+++ b/ext/-test-/st/update/update.c
@@ -0,0 +1,34 @@
+#include <ruby.h>
+#include <ruby/st.h>
+
+static int
+update_func(st_data_t *key, st_data_t *value, st_data_t arg, int existing)
+{
+ VALUE ret = rb_yield_values(existing ? 2 : 1, (VALUE)*key, (VALUE)*value);
+ switch (ret) {
+ case Qfalse:
+ return ST_STOP;
+ case Qnil:
+ return ST_DELETE;
+ default:
+ *value = ret;
+ return ST_CONTINUE;
+ }
+}
+
+static VALUE
+test_st_update(VALUE self, VALUE key)
+{
+ if (st_update(RHASH_TBL(self), (st_data_t)key, update_func, 0))
+ return Qtrue;
+ else
+ return Qfalse;
+}
+
+void
+Init_update(void)
+{
+ VALUE st = rb_define_class_under(rb_define_module("Bug"), "StTable", rb_cHash);
+ rb_define_method(st, "st_update", test_st_update, 1);
+}
+
diff --git a/ext/-test-/string/coderange.c b/ext/-test-/string/coderange.c
new file mode 100644
index 0000000000..2f1e6a06a8
--- /dev/null
+++ b/ext/-test-/string/coderange.c
@@ -0,0 +1,30 @@
+#include "ruby/ruby.h"
+#include "ruby/encoding.h"
+
+static VALUE sym_7bit, sym_valid, sym_unknown, sym_broken;
+static VALUE
+str_coderange(VALUE str)
+{
+ switch (ENC_CODERANGE(str)) {
+ case ENC_CODERANGE_7BIT:
+ return sym_7bit;
+ case ENC_CODERANGE_VALID:
+ return sym_valid;
+ case ENC_CODERANGE_UNKNOWN:
+ return sym_unknown;
+ case ENC_CODERANGE_BROKEN:
+ return sym_broken;
+ }
+ rb_bug("wrong condition of coderange");
+ UNREACHABLE;
+}
+
+void
+Init_coderange(VALUE klass)
+{
+ sym_7bit = ID2SYM(rb_intern("7bit"));
+ sym_valid = ID2SYM(rb_intern("valid"));
+ sym_unknown = ID2SYM(rb_intern("unknown"));
+ sym_broken = ID2SYM(rb_intern("broken"));
+ rb_define_method(klass, "coderange", str_coderange, 0);
+}
diff --git a/ext/-test-/string/enc_str_buf_cat.c b/ext/-test-/string/enc_str_buf_cat.c
new file mode 100644
index 0000000000..5d583c65dc
--- /dev/null
+++ b/ext/-test-/string/enc_str_buf_cat.c
@@ -0,0 +1,14 @@
+#include "ruby/ruby.h"
+#include "ruby/encoding.h"
+
+static VALUE
+enc_str_buf_cat(VALUE str, VALUE str2)
+{
+ return rb_enc_str_buf_cat(str, RSTRING_PTR(str2), RSTRING_LEN(str2), rb_enc_get(str2));
+}
+
+void
+Init_enc_str_buf_cat(VALUE klass)
+{
+ rb_define_method(klass, "enc_str_buf_cat", enc_str_buf_cat, 1);
+}
diff --git a/ext/-test-/string/modify.c b/ext/-test-/string/modify.c
index a6930051b6..ddd2efd8f0 100644
--- a/ext/-test-/string/modify.c
+++ b/ext/-test-/string/modify.c
@@ -7,8 +7,16 @@ bug_str_modify(VALUE str)
return str;
}
+VALUE
+bug_str_modify_expand(VALUE str, VALUE expand)
+{
+ rb_str_modify_expand(str, NUM2LONG(expand));
+ return str;
+}
+
void
Init_modify(VALUE klass)
{
rb_define_method(klass, "modify!", bug_str_modify, 0);
+ rb_define_method(klass, "modify_expand!", bug_str_modify_expand, 1);
}
diff --git a/ext/-test-/string/qsort.c b/ext/-test-/string/qsort.c
new file mode 100644
index 0000000000..0b34936d38
--- /dev/null
+++ b/ext/-test-/string/qsort.c
@@ -0,0 +1,61 @@
+#include "ruby.h"
+#include "ruby/util.h"
+#include "ruby/encoding.h"
+
+struct sort_data {
+ rb_encoding *enc;
+ long elsize;
+};
+
+static int
+cmp_1(const void *ap, const void *bp, void *dummy)
+{
+ struct sort_data *d = dummy;
+ VALUE a = rb_enc_str_new(ap, d->elsize, d->enc);
+ VALUE b = rb_enc_str_new(bp, d->elsize, d->enc);
+ VALUE retval = rb_yield_values(2, a, b);
+ return rb_cmpint(retval, a, b);
+}
+
+static int
+cmp_2(const void *ap, const void *bp, void *dummy)
+{
+ int a = *(const unsigned char *)ap;
+ int b = *(const unsigned char *)bp;
+ return a - b;
+}
+
+static VALUE
+bug_str_qsort_bang(int argc, VALUE *argv, VALUE str)
+{
+ VALUE beg, len, size;
+ long l, b = 0, n, s = 1;
+ struct sort_data d;
+
+ rb_scan_args(argc, argv, "03", &beg, &len, &size);
+ l = RSTRING_LEN(str);
+ if (!NIL_P(beg) && (b = NUM2INT(beg)) < 0 && (b += l) < 0) {
+ rb_raise(rb_eArgError, "out of bounds");
+ }
+ if (!NIL_P(size) && (s = NUM2INT(size)) < 0) {
+ rb_raise(rb_eArgError, "negative size");
+ }
+ if (NIL_P(len) ||
+ (((n = NUM2INT(len)) < 0) ?
+ (rb_raise(rb_eArgError, "negative length"), 0) :
+ (b + n * s > l))) {
+ n = (l - b) / s;
+ }
+ rb_str_modify(str);
+ d.enc = rb_enc_get(str);
+ d.elsize = s;
+ ruby_qsort(RSTRING_PTR(str) + b, n, s,
+ rb_block_given_p() ? cmp_1 : cmp_2, &d);
+ return str;
+}
+
+void
+Init_qsort(VALUE klass)
+{
+ rb_define_method(klass, "qsort!", bug_str_qsort_bang, -1);
+}
diff --git a/ext/-test-/symbol/extconf.rb b/ext/-test-/symbol/extconf.rb
new file mode 100644
index 0000000000..d093ff682a
--- /dev/null
+++ b/ext/-test-/symbol/extconf.rb
@@ -0,0 +1,6 @@
+$srcs = Dir[File.join($srcdir, "*.{#{SRC_EXT.join(%q{,})}}")]
+inits = $srcs.map {|s| File.basename(s, ".*")}
+inits.delete("init")
+inits.map! {|s|"X(#{s})"}
+$defs << "-DTEST_INIT_FUNCS(X)=\"#{inits.join(' ')}\""
+create_makefile("-test-/symbol/symbol")
diff --git a/ext/-test-/symbol/init.c b/ext/-test-/symbol/init.c
new file mode 100644
index 0000000000..e740345f2a
--- /dev/null
+++ b/ext/-test-/symbol/init.c
@@ -0,0 +1,11 @@
+#include "ruby.h"
+
+#define init(n) {void Init_##n(VALUE klass); Init_##n(klass);}
+
+void
+Init_symbol(void)
+{
+ VALUE mBug = rb_define_module("Bug");
+ VALUE klass = rb_define_class_under(mBug, "Symbol", rb_cSymbol);
+ TEST_INIT_FUNCS(init);
+}
diff --git a/ext/-test-/symbol/intern.c b/ext/-test-/symbol/intern.c
new file mode 100644
index 0000000000..6ae86a6104
--- /dev/null
+++ b/ext/-test-/symbol/intern.c
@@ -0,0 +1,14 @@
+#include "ruby.h"
+
+static VALUE
+bug_sym_interned_p(VALUE self, VALUE name)
+{
+ ID id = rb_check_id(&name);
+ return id ? Qtrue : Qfalse;
+}
+
+void
+Init_intern(VALUE klass)
+{
+ rb_define_singleton_method(klass, "interned?", bug_sym_interned_p, 1);
+}
diff --git a/ext/-test-/typeddata/extconf.rb b/ext/-test-/typeddata/extconf.rb
new file mode 100644
index 0000000000..02e3e41c8b
--- /dev/null
+++ b/ext/-test-/typeddata/extconf.rb
@@ -0,0 +1 @@
+create_makefile("-test-/typeddata/typeddata")
diff --git a/ext/-test-/typeddata/typeddata.c b/ext/-test-/typeddata/typeddata.c
new file mode 100644
index 0000000000..1c5d677713
--- /dev/null
+++ b/ext/-test-/typeddata/typeddata.c
@@ -0,0 +1,20 @@
+#include <ruby.h>
+
+static const rb_data_type_t test_data = {
+ "typed_data",
+};
+
+static VALUE
+test_check(VALUE self, VALUE obj)
+{
+ rb_check_typeddata(obj, &test_data);
+ return obj;
+}
+
+void
+Init_typeddata(void)
+{
+ VALUE mBug = rb_define_module("Bug");
+ VALUE klass = rb_define_class_under(mBug, "TypedData", rb_cData);
+ rb_define_singleton_method(klass, "check", test_check, 1);
+}
diff --git a/ext/-test-/win32/dln/dlntest.c b/ext/-test-/win32/dln/dlntest.c
new file mode 100644
index 0000000000..3e6037ac07
--- /dev/null
+++ b/ext/-test-/win32/dln/dlntest.c
@@ -0,0 +1,17 @@
+#include <ruby.h>
+
+extern __declspec(dllimport) void dlntest_ordinal(void);
+
+static VALUE
+dln_dlntest(VALUE self)
+{
+ dlntest_ordinal();
+ return self;
+}
+
+void
+Init_dln(void)
+{
+ VALUE m = rb_define_module_under(rb_define_module("Bug"), "Win32");
+ rb_define_module_function(m, "dlntest", dln_dlntest, 0);
+}
diff --git a/ext/-test-/win32/dln/extconf.rb b/ext/-test-/win32/dln/extconf.rb
new file mode 100644
index 0000000000..0b5089af14
--- /dev/null
+++ b/ext/-test-/win32/dln/extconf.rb
@@ -0,0 +1,36 @@
+if $mingw or $mswin
+ $objs = ["dlntest.o"]
+ testdll = "$(topdir)/dlntest.dll"
+ $cleanfiles << testdll
+ config_string('cleanobjs') {|t| $cleanfiles.concat(t.gsub(/\$\*/, 'dlntest').split)}
+
+ create_makefile("-test-/win32/dln")
+ m = File.read("Makefile")
+ dlntestlib = "dlntest.#{$LIBEXT}"
+ m.sub!(/^OBJS =.*/) {"#{$&} #{dlntestlib}"}
+ FileUtils.rm_f(RbConfig.expand(testdll.dup))
+ open("Makefile", "wb") do |mf|
+ mf.puts m, "\n"
+ sodir = $extout ? "$(RUBYARCHDIR)/" : ''
+ mf.print "#{sodir}$(DLLIB): #{dlntestlib}"
+ mf.puts
+ mf.puts "#{dlntestlib}: $(topdir)/dlntest.dll"
+ mf.puts
+ if $mingw
+ mf.puts "$(topdir)/dlntest.dll: DEFFILE := $(srcdir)/libdlntest.def"
+ mf.puts "$(topdir)/dlntest.dll: DLDFLAGS += -Wl,--out-implib,#{dlntestlib}"
+ end
+ mf.puts depend_rules("$(topdir)/dlntest.dll: libdlntest.o libdlntest.def")
+ mf.puts "\t$(ECHO) linking shared-object $(@F)\n"
+ mf.print "\t-$(Q)$(RM) $@\n"
+ mf.print "\t-$(Q)$(MAKEDIRS) $(@D)\n" if $extout
+ link_so = LINK_SO.gsub(/^/, "\t$(Q) ")
+ link_so.sub!(/\$\(LOCAL_LIBS\)/, '')
+ link_so.gsub!(/-\$\(arch\)/, '')
+ link_so.gsub!(/:.so=/, ':.dll=')
+ link_so.sub!(/\$\(OBJS\)/, "libdlntest.#{$OBJEXT}")
+ link_so.sub!(/\$\(DEFFILE\)/, "$(srcdir)/libdlntest.def")
+ mf.puts link_so
+ mf.puts
+ end
+end
diff --git a/ext/-test-/win32/dln/libdlntest.c b/ext/-test-/win32/dln/libdlntest.c
new file mode 100644
index 0000000000..040ae8125d
--- /dev/null
+++ b/ext/-test-/win32/dln/libdlntest.c
@@ -0,0 +1,4 @@
+extern __declspec(dllexport) void
+dlntest_ordinal(void)
+{
+}
diff --git a/ext/-test-/win32/dln/libdlntest.def b/ext/-test-/win32/dln/libdlntest.def
new file mode 100644
index 0000000000..85bc9c7a55
--- /dev/null
+++ b/ext/-test-/win32/dln/libdlntest.def
@@ -0,0 +1,2 @@
+EXPORTS
+dlntest_ordinal @1 NONAME
diff --git a/ext/-test-/win32/fd_setsize/depend b/ext/-test-/win32/fd_setsize/depend
new file mode 100644
index 0000000000..4936d6b28c
--- /dev/null
+++ b/ext/-test-/win32/fd_setsize/depend
@@ -0,0 +1,2 @@
+fd_setsize.o: $(top_srcdir)/win32/win32.c \
+ $(hdrdir)/ruby/ruby.h
diff --git a/ext/-test-/win32/fd_setsize/extconf.rb b/ext/-test-/win32/fd_setsize/extconf.rb
new file mode 100644
index 0000000000..ed40f8b1d7
--- /dev/null
+++ b/ext/-test-/win32/fd_setsize/extconf.rb
@@ -0,0 +1,3 @@
+if $mingw or $mswin
+ create_makefile("-test-/win32/fd_setsize")
+end
diff --git a/ext/-test-/win32/fd_setsize/fd_setsize.c b/ext/-test-/win32/fd_setsize/fd_setsize.c
new file mode 100644
index 0000000000..8da8b1eaa0
--- /dev/null
+++ b/ext/-test-/win32/fd_setsize/fd_setsize.c
@@ -0,0 +1,55 @@
+#undef FD_SETSIZE
+/* redefine smaller size then default 64 */
+#define FD_SETSIZE 32
+#include <ruby.h>
+
+static VALUE
+test_select(VALUE self)
+{
+ int sd = socket(AF_INET, SOCK_DGRAM, 0);
+ struct timeval zero;
+ fd_set read;
+ fd_set write;
+ fd_set error;
+
+ zero.tv_sec = 0;
+ zero.tv_usec = 0;
+
+ FD_ZERO(&read);
+ FD_ZERO(&write);
+ FD_ZERO(&error);
+
+ FD_SET(sd, &read);
+ FD_SET(sd, &write);
+ FD_SET(sd, &error);
+
+ select(sd+1, &read, &write, &error, &zero);
+
+ return Qtrue;
+}
+
+static VALUE
+test_fdset(VALUE self)
+{
+ int i;
+ fd_set set;
+
+ FD_ZERO(&set);
+
+ for (i = 0; i < FD_SETSIZE * 2; i++) {
+ int sd = socket(AF_INET, SOCK_DGRAM, 0);
+ FD_SET(sd, &set);
+ if (set.fd_count > FD_SETSIZE) {
+ return Qfalse;
+ }
+ }
+ return Qtrue;
+}
+
+void
+Init_fd_setsize(void)
+{
+ VALUE m = rb_define_module_under(rb_define_module("Bug"), "Win32");
+ rb_define_module_function(m, "test_select", test_select, 0);
+ rb_define_module_function(m, "test_fdset", test_fdset, 0);
+}
diff --git a/ext/.document b/ext/.document
index f93dfd29b1..c1aa427126 100644
--- a/ext/.document
+++ b/ext/.document
@@ -24,11 +24,9 @@ fcntl/fcntl.c
fiddle/closure.c
fiddle/conversions.c
fiddle/fiddle.c
-fiddle/fiddle.c
fiddle/function.c
fiddle/lib
gdbm/gdbm.c
-iconv/iconv.c
io/console/console.c
io/nonblock/nonblock.c
io/wait/lib
diff --git a/ext/Setup b/ext/Setup
index b0f29b9f7b..6870035e45 100644
--- a/ext/Setup
+++ b/ext/Setup
@@ -13,7 +13,6 @@
#etc
#fcntl
#gdbm
-#iconv
#io/wait
#nkf
#openssl
@@ -25,7 +24,6 @@
#socket
#stringio
#strscan
-#syck
#syslog
#tk
#win32ole
diff --git a/ext/Setup.atheos b/ext/Setup.atheos
index 6e0b8ae5a6..c4028ef1f2 100644
--- a/ext/Setup.atheos
+++ b/ext/Setup.atheos
@@ -14,7 +14,6 @@ enumerator
etc
fcntl
gdbm
-iconv
io/wait
nkf
#openssl
@@ -26,7 +25,6 @@ sdbm
socket
stringio
strscan
-syck
syslog
#tk
#win32ole
diff --git a/ext/Setup.emx b/ext/Setup.emx
index fade917e92..bf9e2e32f9 100644
--- a/ext/Setup.emx
+++ b/ext/Setup.emx
@@ -14,7 +14,6 @@ enumerator
etc
fcntl
#gdbm
-#iconv
#io/wait
nkf
#openssl
@@ -26,7 +25,6 @@ racc/cparse
socket
stringio
strscan
-#syck
#syslog
#tk
#win32ole
diff --git a/ext/Setup.nacl b/ext/Setup.nacl
new file mode 100644
index 0000000000..3e7f469f92
--- /dev/null
+++ b/ext/Setup.nacl
@@ -0,0 +1,49 @@
+# #option nodynamic
+#
+# #Win32API
+# bigdecimal
+# continuation
+# coverage
+# #curses
+# date
+# #dbm
+# digest/bubblebabble
+# digest
+# digest/md5
+# digest/rmd160
+# digest/sha1
+# digest/sha2
+# dl
+# dl/callback
+# #dl/win32
+# etc
+# fcntl
+# fiber
+# #fiddle
+# #gdbm
+# #iconv
+# io/console
+# io/nonblock
+# io/wait
+# #json
+# json/generator
+# json/parser
+# mathn/complex
+# mathn/rational
+# nkf
+# objspace
+# #openssl
+# pathname
+# #psych
+# #pty
+# racc/cparse
+# #readline
+# ripper
+# #sdbm
+# #socket
+# stringio
+# strscan
+# #syslog
+# #tk
+# #tk/tkutil
+# #zlib
diff --git a/ext/Setup.nt b/ext/Setup.nt
index c8574ba70a..8aec238152 100644
--- a/ext/Setup.nt
+++ b/ext/Setup.nt
@@ -14,7 +14,6 @@ enumerator
etc
fcntl
#gdbm
-#iconv
#io/wait
nkf
#openssl
@@ -26,7 +25,6 @@ sdbm
socket
stringio
strscan
-syck
#syslog
#tk
win32ole
diff --git a/ext/bigdecimal/README b/ext/bigdecimal/README
index ae65b014cf..7a4362826c 100644
--- a/ext/bigdecimal/README
+++ b/ext/bigdecimal/README
@@ -51,10 +51,10 @@ You can redistribute it and/or modify it under either the terms of the GPL
* The Author
-Feel free to send comments and bug reports to the author. Here is the
-author's latest mail address:
+Feel free to send comments and bug reports to the ruby-core team.
- shigeo@tinyforest.gr.jp
+ http://bugs.ruby-lang.org
-------------------------------------------------------
created at: Thu Dec 22 1999
+updated at: Wed Sep 28 2011
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index bea5180b58..fa32c99282 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -61,7 +61,7 @@ static ID id_eq;
/* MACRO's to guard objects from GC by keeping them in stack */
#define ENTER(n) volatile VALUE vStack[n];int iStack=0
-#define PUSH(x) vStack[iStack++] = (unsigned long)(x);
+#define PUSH(x) vStack[iStack++] = (VALUE)(x);
#define SAVE(p) PUSH(p->obj);
#define GUARD_OBJ(p,y) {p=y;SAVE(p);}
@@ -109,9 +109,6 @@ bigzero_p(VALUE x)
/*
* Returns the BigDecimal version number.
- *
- * Ruby 1.8.0 returns 1.0.0.
- * Ruby 1.8.1 thru 1.8.3 return 1.0.1.
*/
static VALUE
BigDecimal_version(VALUE self)
@@ -131,7 +128,7 @@ static unsigned short VpGetException(void);
static void VpSetException(unsigned short f);
static void VpInternalRound(Real *c, size_t ixDigit, BDIGIT vPrev, BDIGIT v);
static int VpLimitRound(Real *c, size_t ixDigit);
-static Real *VpDup(Real const* const x);
+static Real *VpCopy(Real *pv, Real const* const x);
/*
* **** BigDecimal part ****
@@ -174,6 +171,24 @@ ToValue(Real *p)
return p->obj;
}
+NORETURN(static void cannot_be_coerced_into_BigDecimal(VALUE, VALUE));
+
+static void
+cannot_be_coerced_into_BigDecimal(VALUE exc_class, VALUE v)
+{
+ VALUE str;
+
+ if (rb_special_const_p(v)) {
+ str = rb_inspect(v);
+ }
+ else {
+ str = rb_class_name(rb_obj_class(v));
+ }
+
+ str = rb_str_cat2(rb_str_dup(str), " can't be coerced into BigDecimal");
+ rb_exc_raise(rb_exc_new3(exc_class, str));
+}
+
static VALUE BigDecimal_div2(int, VALUE*, VALUE);
static Real*
@@ -191,7 +206,7 @@ again:
if (prec < 0) goto unable_to_coerce_without_prec;
if (prec > DBL_DIG+1)goto SomeOneMayDoIt;
v = rb_funcall(v, id_to_r, 0);
- /* fall through */
+ goto again;
case T_RATIONAL:
if (prec < 0) goto unable_to_coerce_without_prec;
@@ -240,8 +255,7 @@ again:
SomeOneMayDoIt:
if (must) {
- rb_raise(rb_eTypeError, "%s can't be coerced into BigDecimal",
- rb_special_const_p(v) ? RSTRING_PTR(rb_inspect(v)) : rb_obj_classname(v));
+ cannot_be_coerced_into_BigDecimal(rb_eTypeError, v);
}
return NULL; /* NULL means to coerce */
@@ -295,6 +309,14 @@ BigDecimal_prec(VALUE self)
return obj;
}
+/*
+ * call-seq: hash
+ *
+ * Creates a hash for this BigDecimal.
+ *
+ * Two BigDecimals with equal sign,
+ * fractional part and exponent have the same hash.
+ */
static VALUE
BigDecimal_hash(VALUE self)
{
@@ -312,6 +334,18 @@ BigDecimal_hash(VALUE self)
return INT2FIX(hash);
}
+/*
+ * call-seq: _dump
+ *
+ * Method used to provide marshalling support.
+ *
+ * inf = BigDecimal.new('Infinity')
+ * => #<BigDecimal:1e16fa8,'Infinity',9(9)>
+ * BigDecimal._load(inf._dump)
+ * => #<BigDecimal:1df8dc8,'Infinity',9(9)>
+ *
+ * See the Marshal module.
+ */
static VALUE
BigDecimal_dump(int argc, VALUE *argv, VALUE self)
{
@@ -537,14 +571,15 @@ VpCreateRbObject(size_t mx, const char *str)
return pv;
}
+#define VpAllocReal(prec) (Real *)VpMemAlloc(offsetof(Real, frac) + (prec) * sizeof(BDIGIT))
+#define VpReallocReal(ptr, prec) (Real *)VpMemRealloc((ptr), offsetof(Real, frac) + (prec) * sizeof(BDIGIT))
+
static Real *
-VpDup(Real const* const x)
+VpCopy(Real *pv, Real const* const x)
{
- Real *pv;
-
assert(x != NULL);
- pv = VpMemAlloc(sizeof(Real) + x->MaxPrec * sizeof(BDIGIT));
+ pv = VpReallocReal(pv, x->MaxPrec);
pv->MaxPrec = x->MaxPrec;
pv->Prec = x->Prec;
pv->exponent = x->exponent;
@@ -552,9 +587,6 @@ VpDup(Real const* const x)
pv->flag = x->flag;
MEMCPY(pv->frac, x->frac, BDIGIT, pv->MaxPrec);
- pv->obj = TypedData_Wrap_Struct(
- rb_obj_class(x->obj), &BigDecimal_data_type, pv);
-
return pv;
}
@@ -675,20 +707,22 @@ BigDecimal_to_f(VALUE self)
VpToString(p, buf, 0, 0);
errno = 0;
d = strtod(buf, 0);
- if (errno == ERANGE)
- goto overflow;
+ if (errno == ERANGE) {
+ if (d == 0.0) goto underflow;
+ if (fabs(d) >= HUGE_VAL) goto overflow;
+ }
return rb_float_new(d);
overflow:
VpException(VP_EXCEPTION_OVERFLOW, "BigDecimal to Float conversion", 0);
- if (d > 0.0)
+ if (p->sign >= 0)
return rb_float_new(VpGetDoublePosInf());
else
return rb_float_new(VpGetDoubleNegInf());
underflow:
VpException(VP_EXCEPTION_UNDERFLOW, "BigDecimal to Float conversion", 0);
- if (d > 0.0)
+ if (p->sign >= 0)
return rb_float_new(0.0);
else
return rb_float_new(-0.0);
@@ -767,13 +801,25 @@ BigDecimal_coerce(VALUE self, VALUE other)
return obj;
}
+/*
+ * call-seq: +@
+ *
+ * Return self.
+ *
+ * e.g.
+ * b = +a # b == a
+ */
static VALUE
BigDecimal_uplus(VALUE self)
{
return self;
}
- /* call-seq:
+ /*
+ * Document-method: BigDecimal#add
+ * Document-method: BigDecimal#+
+ *
+ * call-seq:
* add(value, digits)
*
* Add the specified value.
@@ -782,7 +828,9 @@ BigDecimal_uplus(VALUE self)
* c = a.add(b,n)
* c = a + b
*
- * digits:: If specified and less than the number of significant digits of the result, the result is rounded to that number of digits, according to BigDecimal.mode.
+ * digits:: If specified and less than the number of significant digits of the
+ * result, the result is rounded to that number of digits, according to
+ * BigDecimal.mode.
*/
static VALUE
BigDecimal_add(VALUE self, VALUE r)
@@ -790,23 +838,37 @@ BigDecimal_add(VALUE self, VALUE r)
ENTER(5);
Real *c, *a, *b;
size_t mx;
- GUARD_OBJ(a,GetVpValue(self,1));
- b = GetVpValue(r,0);
- if(!b) return DoSomeOne(self,r,'+');
+
+ GUARD_OBJ(a, GetVpValue(self, 1));
+ if (TYPE(r) == T_FLOAT) {
+ b = GetVpValueWithPrec(r, DBL_DIG+1, 1);
+ }
+ else if (TYPE(r) == T_RATIONAL) {
+ b = GetVpValueWithPrec(r, a->Prec*VpBaseFig(), 1);
+ }
+ else {
+ b = GetVpValue(r,0);
+ }
+
+ if (!b) return DoSomeOne(self,r,'+');
SAVE(b);
- if(VpIsNaN(b)) return b->obj;
- if(VpIsNaN(a)) return a->obj;
- mx = GetAddSubPrec(a,b);
+
+ if (VpIsNaN(b)) return b->obj;
+ if (VpIsNaN(a)) return a->obj;
+
+ mx = GetAddSubPrec(a, b);
if (mx == (size_t)-1L) {
- GUARD_OBJ(c,VpCreateRbObject(VpBaseFig() + 1, "0"));
- VpAddSub(c, a, b, 1);
- } else {
- GUARD_OBJ(c,VpCreateRbObject(mx *(VpBaseFig() + 1), "0"));
- if(!mx) {
- VpSetInf(c,VpGetSign(a));
- } else {
- VpAddSub(c, a, b, 1);
- }
+ GUARD_OBJ(c,VpCreateRbObject(VpBaseFig() + 1, "0"));
+ VpAddSub(c, a, b, 1);
+ }
+ else {
+ GUARD_OBJ(c, VpCreateRbObject(mx * (VpBaseFig() + 1), "0"));
+ if(!mx) {
+ VpSetInf(c, VpGetSign(a));
+ }
+ else {
+ VpAddSub(c, a, b, 1);
+ }
}
return ToValue(c);
}
@@ -820,7 +882,9 @@ BigDecimal_add(VALUE self, VALUE r)
* c = a.sub(b,n)
* c = a - b
*
- * digits:: If specified and less than the number of significant digits of the result, the result is rounded to that number of digits, according to BigDecimal.mode.
+ * digits:: If specified and less than the number of significant digits of the
+ * result, the result is rounded to that number of digits, according to
+ * BigDecimal.mode.
*/
static VALUE
BigDecimal_sub(VALUE self, VALUE r)
@@ -942,6 +1006,8 @@ BigDecimalCmp(VALUE self, VALUE r,char op)
}
rb_bug("Undefined operation in BigDecimalCmp()");
+
+ UNREACHABLE;
}
/* Returns True if the value is zero. */
@@ -988,8 +1054,9 @@ BigDecimal_eq(VALUE self, VALUE r)
/* call-seq:
* a < b
*
- * Returns true if a is less than b. Values may be coerced to perform the
- * comparison (see ==, coerce).
+ * Returns true if a is less than b.
+ *
+ * Values may be coerced to perform the comparison (see ==, BigDecimal#coerce).
*/
static VALUE
BigDecimal_lt(VALUE self, VALUE r)
@@ -1000,8 +1067,9 @@ BigDecimal_lt(VALUE self, VALUE r)
/* call-seq:
* a <= b
*
- * Returns true if a is less than or equal to b. Values may be coerced to
- * perform the comparison (see ==, coerce).
+ * Returns true if a is less than or equal to b.
+ *
+ * Values may be coerced to perform the comparison (see ==, BigDecimal#coerce).
*/
static VALUE
BigDecimal_le(VALUE self, VALUE r)
@@ -1012,8 +1080,9 @@ BigDecimal_le(VALUE self, VALUE r)
/* call-seq:
* a > b
*
- * Returns true if a is greater than b. Values may be coerced to
- * perform the comparison (see ==, coerce).
+ * Returns true if a is greater than b.
+ *
+ * Values may be coerced to perform the comparison (see ==, BigDecimal#coerce).
*/
static VALUE
BigDecimal_gt(VALUE self, VALUE r)
@@ -1024,8 +1093,9 @@ BigDecimal_gt(VALUE self, VALUE r)
/* call-seq:
* a >= b
*
- * Returns true if a is greater than or equal to b. Values may be coerced to
- * perform the comparison (see ==, coerce)
+ * Returns true if a is greater than or equal to b.
+ *
+ * Values may be coerced to perform the comparison (see ==, BigDecimal#coerce)
*/
static VALUE
BigDecimal_ge(VALUE self, VALUE r)
@@ -1033,6 +1103,15 @@ BigDecimal_ge(VALUE self, VALUE r)
return BigDecimalCmp(self, r, 'G');
}
+/*
+ * call-seq: -@
+ *
+ * Return the negation of self.
+ *
+ * e.g.
+ * b = -a
+ * b == a * -1
+ */
static VALUE
BigDecimal_neg(VALUE self)
{
@@ -1044,8 +1123,10 @@ BigDecimal_neg(VALUE self)
return ToValue(c);
}
- /* call-seq:
- * mult(value, digits)
+ /*
+ * Document-method: BigDecimal#mult
+ *
+ * call-seq: mult(value, digits)
*
* Multiply by the specified value.
*
@@ -1053,7 +1134,9 @@ BigDecimal_neg(VALUE self)
* c = a.mult(b,n)
* c = a * b
*
- * digits:: If specified and less than the number of significant digits of the result, the result is rounded to that number of digits, according to BigDecimal.mode.
+ * digits:: If specified and less than the number of significant digits of the
+ * result, the result is rounded to that number of digits, according to
+ * BigDecimal.mode.
*/
static VALUE
BigDecimal_mult(VALUE self, VALUE r)
@@ -1104,13 +1187,15 @@ BigDecimal_divide(Real **c, Real **res, Real **div, VALUE self, VALUE r)
* e.g.
* c = a.div(b,n)
*
- * digits:: If specified and less than the number of significant digits of the result, the result is rounded to that number of digits, according to BigDecimal.mode.
+ * digits:: If specified and less than the number of significant digits of the
+ * result, the result is rounded to that number of digits, according to
+ * BigDecimal.mode.
*
* If digits is 0, the result is the same as the / operator. If not, the
* result is an integer BigDecimal, by analogy with Float#div.
*
- * The alias quo is provided since div(value, 0) is the same as computing
- * the quotient; see divmod.
+ * The alias quo is provided since <code>div(value, 0)</code> is the same as
+ * computing the quotient; see BigDecimal#divmod.
*/
static VALUE
BigDecimal_div(VALUE self, VALUE r)
@@ -1211,7 +1296,9 @@ NaN:
* a % b
* a.modulo(b)
*
- * Returns the modulus from dividing by b. See divmod.
+ * Returns the modulus from dividing by b.
+ *
+ * See BigDecimal#divmod.
*/
static VALUE
BigDecimal_mod(VALUE self, VALUE r) /* %: a%b = a - (a.to_f/b).floor * b */
@@ -1309,6 +1396,9 @@ BigDecimal_divmod(VALUE self, VALUE r)
return DoSomeOne(self,r,rb_intern("divmod"));
}
+/*
+ * See BigDecimal#quo
+ */
static VALUE
BigDecimal_div2(int argc, VALUE *argv, VALUE self)
{
@@ -1422,7 +1512,7 @@ BigDecimal_abs(VALUE self)
*
* Returns the square root of the value.
*
- * If n is specified, returns at least that many significant digits.
+ * Result has at least n significant digits.
*/
static VALUE
BigDecimal_sqrt(VALUE self, VALUE nFig)
@@ -1462,9 +1552,8 @@ BigDecimal_fix(VALUE self)
*
* Round to the nearest 1 (by default), returning the result as a BigDecimal.
*
- * BigDecimal('3.14159').round -> 3
- *
- * BigDecimal('8.7').round -> 9
+ * BigDecimal('3.14159').round #=> 3
+ * BigDecimal('8.7').round #=> 9
*
* If n is specified and positive, the fractional part of the result has no
* more than that many digits.
@@ -1472,9 +1561,8 @@ BigDecimal_fix(VALUE self)
* If n is specified and negative, at least that many digits to the left of the
* decimal point will be 0 in the result.
*
- * BigDecimal('3.14159').round(3) -> 3.142
- *
- * BigDecimal('13345.234').round(-2) -> 13300.0
+ * BigDecimal('3.14159').round(3) #=> 3.142
+ * BigDecimal('13345.234').round(-2) #=> 13300.0
*
* The value of the optional mode argument can be used to determine how
* rounding is performed; see BigDecimal.mode.
@@ -1523,9 +1611,8 @@ BigDecimal_round(int argc, VALUE *argv, VALUE self)
*
* Truncate to the nearest 1, returning the result as a BigDecimal.
*
- * BigDecimal('3.14159').truncate -> 3
- *
- * BigDecimal('8.7').truncate -> 8
+ * BigDecimal('3.14159').truncate #=> 3
+ * BigDecimal('8.7').truncate #=> 8
*
* If n is specified and positive, the fractional part of the result has no
* more than that many digits.
@@ -1533,9 +1620,8 @@ BigDecimal_round(int argc, VALUE *argv, VALUE self)
* If n is specified and negative, at least that many digits to the left of the
* decimal point will be 0 in the result.
*
- * BigDecimal('3.14159').truncate(3) -> 3.141
- *
- * BigDecimal('13345.234').truncate(-2) -> 13300.0
+ * BigDecimal('3.14159').truncate(3) #=> 3.141
+ * BigDecimal('13345.234').truncate(-2) #=> 13300.0
*/
static VALUE
BigDecimal_truncate(int argc, VALUE *argv, VALUE self)
@@ -1585,9 +1671,8 @@ BigDecimal_frac(VALUE self)
*
* Return the largest integer less than or equal to the value, as a BigDecimal.
*
- * BigDecimal('3.14159').floor -> 3
- *
- * BigDecimal('-9.1').floor -> -10
+ * BigDecimal('3.14159').floor #=> 3
+ * BigDecimal('-9.1').floor #=> -10
*
* If n is specified and positive, the fractional part of the result has no
* more than that many digits.
@@ -1595,9 +1680,8 @@ BigDecimal_frac(VALUE self)
* If n is specified and negative, at least that
* many digits to the left of the decimal point will be 0 in the result.
*
- * BigDecimal('3.14159').floor(3) -> 3.141
- *
- * BigDecimal('13345.234').floor(-2) -> 13300.0
+ * BigDecimal('3.14159').floor(3) #=> 3.141
+ * BigDecimal('13345.234').floor(-2) #=> 13300.0
*/
static VALUE
BigDecimal_floor(int argc, VALUE *argv, VALUE self)
@@ -1634,9 +1718,8 @@ BigDecimal_floor(int argc, VALUE *argv, VALUE self)
*
* Return the smallest integer greater than or equal to the value, as a BigDecimal.
*
- * BigDecimal('3.14159').ceil -> 4
- *
- * BigDecimal('-9.1').ceil -> -9
+ * BigDecimal('3.14159').ceil #=> 4
+ * BigDecimal('-9.1').ceil #=> -9
*
* If n is specified and positive, the fractional part of the result has no
* more than that many digits.
@@ -1644,9 +1727,8 @@ BigDecimal_floor(int argc, VALUE *argv, VALUE self)
* If n is specified and negative, at least that
* many digits to the left of the decimal point will be 0 in the result.
*
- * BigDecimal('3.14159').ceil(3) -> 3.142
- *
- * BigDecimal('13345.234').ceil(-2) -> 13400.0
+ * BigDecimal('3.14159').ceil(3) #=> 3.142
+ * BigDecimal('13345.234').ceil(-2) #=> 13400.0
*/
static VALUE
BigDecimal_ceil(int argc, VALUE *argv, VALUE self)
@@ -1699,11 +1781,14 @@ BigDecimal_ceil(int argc, VALUE *argv, VALUE self)
*
* Examples:
*
- * BigDecimal.new('-123.45678901234567890').to_s('5F') -> '-123.45678 90123 45678 9'
+ * BigDecimal.new('-123.45678901234567890').to_s('5F')
+ * #=> '-123.45678 90123 45678 9'
*
- * BigDecimal.new('123.45678901234567890').to_s('+8F') -> '+123.45678901 23456789'
+ * BigDecimal.new('123.45678901234567890').to_s('+8F')
+ * #=> '+123.45678901 23456789'
*
- * BigDecimal.new('123.45678901234567890').to_s(' F') -> ' 123.4567890123456789'
+ * BigDecimal.new('123.45678901234567890').to_s(' F')
+ * #=> ' 123.4567890123456789'
*/
static VALUE
BigDecimal_to_s(int argc, VALUE *argv, VALUE self)
@@ -1960,7 +2045,7 @@ is_even(VALUE x)
static VALUE
rmpd_power_by_big_decimal(Real const* x, Real const* exp, ssize_t const n)
{
- VALUE log_x, multiplied, y, vn;
+ VALUE log_x, multiplied, y;
if (VpIsZero(exp)) {
return ToValue(VpCreateRbObject(n, "1"));
@@ -1977,7 +2062,9 @@ rmpd_power_by_big_decimal(Real const* x, Real const* exp, ssize_t const n)
* power(n)
* power(n, prec)
*
- * Returns the value raised to the power of n. Note that n must be an Integer.
+ * Returns the value raised to the power of n.
+ *
+ * Note that n must be an Integer.
*
* Also available as the operator **
*/
@@ -2205,7 +2292,7 @@ retry:
/* call-seq:
* big_decimal ** exp -> big_decimal
*
- * It is a synonym of big_decimal.power(exp).
+ * It is a synonym of BigDecimal#power(exp).
*/
static VALUE
BigDecimal_power_op(VALUE self, VALUE exp)
@@ -2213,6 +2300,14 @@ BigDecimal_power_op(VALUE self, VALUE exp)
return BigDecimal_power(1, &exp, self);
}
+static VALUE
+BigDecimal_s_allocate(VALUE klass)
+{
+ return VpNewRbClass(0, NULL, klass)->obj;
+}
+
+static Real *BigDecimal_new(int argc, VALUE *argv);
+
/* call-seq:
* new(initial, digits)
*
@@ -2220,6 +2315,7 @@ BigDecimal_power_op(VALUE self, VALUE exp)
*
* initial:: The initial value, as an Integer, a Float, a Rational,
* a BigDecimal, or a String.
+ *
* If it is a String, spaces are ignored and unrecognized characters
* terminate the value.
*
@@ -2231,10 +2327,40 @@ BigDecimal_power_op(VALUE self, VALUE exp)
* larger than the specified number.
*/
static VALUE
-BigDecimal_new(int argc, VALUE *argv, VALUE self)
+BigDecimal_initialize(int argc, VALUE *argv, VALUE self)
+{
+ Real *pv = rb_check_typeddata(self, &BigDecimal_data_type);
+ Real *x = BigDecimal_new(argc, argv);
+
+ if (ToValue(x)) {
+ pv = VpCopy(pv, x);
+ }
+ else {
+ VpFree(pv);
+ pv = x;
+ }
+ DATA_PTR(self) = pv;
+ pv->obj = self;
+ return self;
+}
+
+/* :nodoc:
+ *
+ * private method to dup and clone the provided BigDecimal +other+
+ */
+static VALUE
+BigDecimal_initialize_copy(VALUE self, VALUE other)
+{
+ Real *pv = rb_check_typeddata(self, &BigDecimal_data_type);
+ Real *x = rb_check_typeddata(other, &BigDecimal_data_type);
+
+ DATA_PTR(self) = VpCopy(pv, x);
+ return self;
+}
+
+static Real *
+BigDecimal_new(int argc, VALUE *argv)
{
- ENTER(5);
- Real *pv;
size_t mf;
VALUE nFig;
VALUE iniValue;
@@ -2249,15 +2375,14 @@ BigDecimal_new(int argc, VALUE *argv, VALUE self)
switch (TYPE(iniValue)) {
case T_DATA:
if (is_kind_of_BigDecimal(iniValue)) {
- pv = VpDup(DATA_PTR(iniValue));
- return ToValue(pv);
+ return DATA_PTR(iniValue);
}
break;
case T_FIXNUM:
/* fall through */
case T_BIGNUM:
- return ToValue(GetVpValue(iniValue, 1));
+ return GetVpValue(iniValue, 1);
case T_FLOAT:
if (mf > DBL_DIG+1) {
@@ -2266,25 +2391,29 @@ BigDecimal_new(int argc, VALUE *argv, VALUE self)
/* fall through */
case T_RATIONAL:
if (NIL_P(nFig)) {
- rb_raise(rb_eArgError, "can't omit precision for a Rational.");
+ rb_raise(rb_eArgError,
+ "can't omit precision for a %s.",
+ rb_class2name(CLASS_OF(iniValue)));
}
- return ToValue(GetVpValueWithPrec(iniValue, mf, 1));
+ return GetVpValueWithPrec(iniValue, mf, 1);
case T_STRING:
/* fall through */
default:
break;
}
- SafeStringValue(iniValue);
- GUARD_OBJ(pv, VpNewRbClass(mf, RSTRING_PTR(iniValue),self));
-
- return ToValue(pv);
+ StringValueCStr(iniValue);
+ rb_check_safe_obj(iniValue);
+ return VpAlloc(mf, RSTRING_PTR(iniValue));
}
static VALUE
BigDecimal_global_new(int argc, VALUE *argv, VALUE self)
{
- return BigDecimal_new(argc, argv, rb_cBigDecimal);
+ Real *pv = BigDecimal_new(argc, argv);
+ if (ToValue(pv)) pv = VpCopy(NULL, pv);
+ pv->obj = TypedData_Wrap_Struct(rb_cBigDecimal, &BigDecimal_data_type, pv);
+ return pv->obj;
}
/* call-seq:
@@ -2341,8 +2470,23 @@ BigDecimal_sign(VALUE self)
return INT2FIX(s);
}
-/* call-seq:
- * BigDecimal.save_exception_mode { ... }
+/*
+ * call-seq: BigDecimal.save_exception_mode { ... }
+ *
+ * Excecute the provided block, but preserve the exception mode
+ *
+ * BigDecimal.save_exception_mode do
+ * BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false)
+ * BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false)
+ *
+ * BigDecimal.new(BigDecimal('Infinity'))
+ * BigDecimal.new(BigDecimal('-Infinity'))
+ * BigDecimal(BigDecimal.new('NaN'))
+ * end
+ *
+ * For use with the BigDecimal::EXCEPTION_*
+ *
+ * See BigDecimal.mode
*/
static VALUE
BigDecimal_save_exception_mode(VALUE self)
@@ -2355,8 +2499,19 @@ BigDecimal_save_exception_mode(VALUE self)
return ret;
}
-/* call-seq:
- * BigDecimal.save_rounding_mode { ... }
+/*
+ * call-seq: BigDecimal.save_rounding_mode { ... }
+ *
+ * Excecute the provided block, but preserve the rounding mode
+ *
+ * BigDecimal.save_exception_mode do
+ * BigDecimal.mode(BigDecimal::ROUND_MODE, :up)
+ * puts BigDecimal.mode(BigDecimal::ROUND_MODE)
+ * end
+ *
+ * For use with the BigDecimal::ROUND_*
+ *
+ * See BigDecimal.mode
*/
static VALUE
BigDecimal_save_rounding_mode(VALUE self)
@@ -2369,8 +2524,19 @@ BigDecimal_save_rounding_mode(VALUE self)
return ret;
}
-/* call-seq:
- * BigDecimal.save_limit { ... }
+/*
+ * call-seq: BigDecimal.save_limit { ... }
+ *
+ * Excecute the provided block, but preserve the precision limit
+ *
+ * BigDecimal.limit(100)
+ * puts BigDecimal.limit
+ * BigDecimal.save_limit do
+ * BigDecimal.limit(200)
+ * puts BigDecimal.limit
+ * end
+ * puts BigDecimal.limit
+ *
*/
static VALUE
BigDecimal_save_limit(VALUE self)
@@ -2389,7 +2555,7 @@ BigDecimal_save_limit(VALUE self)
* Computes the value of e (the base of natural logarithms) raised to the
* power of x, to the specified number of digits of precision.
*
- * If x is infinite, returns Infinity.
+ * If x is infinity, returns Infinity.
*
* If x is NaN, returns NaN.
*/
@@ -2463,8 +2629,7 @@ BigMath_s_exp(VALUE klass, VALUE x, VALUE vprec)
return ToValue(vy);
}
else if (vx == NULL) {
- rb_raise(rb_eArgError, "%s can't be coerced into BigDecimal",
- rb_special_const_p(x) ? RSTRING_PTR(rb_inspect(x)) : rb_obj_classname(x));
+ cannot_be_coerced_into_BigDecimal(rb_eArgError, x);
}
RB_GC_GUARD(vx->obj);
@@ -2522,7 +2687,7 @@ BigMath_s_exp(VALUE klass, VALUE x, VALUE vprec)
*
* If x is zero or negative, raises Math::DomainError.
*
- * If x is positive infinite, returns Infinity.
+ * If x is positive infinity, returns Infinity.
*
* If x is NaN, returns NaN.
*/
@@ -2619,8 +2784,7 @@ get_vp_value:
"Zero or negative argument for log");
}
else if (vx == NULL) {
- rb_raise(rb_eArgError, "%s can't be coerced into BigDecimal",
- rb_special_const_p(x) ? RSTRING_PTR(rb_inspect(x)) : rb_obj_classname(x));
+ cannot_be_coerced_into_BigDecimal(rb_eArgError, x);
}
x = ToValue(vx);
@@ -2632,7 +2796,7 @@ get_vp_value:
expo = VpExponent10(vx);
if (expo < 0 || expo >= 3) {
char buf[16];
- snprintf(buf, 16, "1E%ld", -expo);
+ snprintf(buf, 16, "1E%"PRIdVALUE, -expo);
x = BigDecimal_mult2(x, ToValue(VpCreateRbObject(1, buf)), vn);
}
else {
@@ -2681,6 +2845,7 @@ get_vp_value:
* BigDecimal provides arbitrary-precision floating point decimal arithmetic.
*
* Copyright (C) 2002 by Shigeo Kobayashi <shigeo@tinyforest.gr.jp>.
+ *
* You may distribute under the terms of either the GNU General Public
* License or the Artistic License, as specified in the README file
* of the BigDecimal distribution.
@@ -2690,9 +2855,10 @@ get_vp_value:
* = Introduction
*
* Ruby provides built-in support for arbitrary precision integer arithmetic.
+ *
* For example:
*
- * 42**13 -> 1265437718438866624512
+ * 42**13 #=> 1265437718438866624512
*
* BigDecimal provides similar support for very large or very accurate floating
* point numbers.
@@ -2700,13 +2866,15 @@ get_vp_value:
* Decimal arithmetic is also useful for general calculation, because it
* provides the correct answers people expect--whereas normal binary floating
* point arithmetic often introduces subtle errors because of the conversion
- * between base 10 and base 2. For example, try:
+ * between base 10 and base 2.
+ *
+ * For example, try:
*
* sum = 0
* for i in (1..10000)
* sum = sum + 0.0001
* end
- * print sum
+ * print sum #=> 0.9999999999999062
*
* and contrast with the output from:
*
@@ -2716,13 +2884,13 @@ get_vp_value:
* for i in (1..10000)
* sum = sum + BigDecimal.new("0.0001")
* end
- * print sum
+ * print sum #=> 0.1E1
*
* Similarly:
*
- * (BigDecimal.new("1.2") - BigDecimal("1.0")) == BigDecimal("0.2") -> true
+ * (BigDecimal.new("1.2") - BigDecimal("1.0")) == BigDecimal("0.2") #=> true
*
- * (1.2 - 1.0) == 0.2 -> false
+ * (1.2 - 1.0) == 0.2 #=> false
*
* = Special features of accurate decimal arithmetic
*
@@ -2734,30 +2902,29 @@ get_vp_value:
* BigDecimal sometimes needs to return infinity, for example if you divide
* a value by zero.
*
- * BigDecimal.new("1.0") / BigDecimal.new("0.0") -> infinity
- *
- * BigDecimal.new("-1.0") / BigDecimal.new("0.0") -> -infinity
+ * BigDecimal.new("1.0") / BigDecimal.new("0.0") #=> infinity
+ * BigDecimal.new("-1.0") / BigDecimal.new("0.0") #=> -infinity
*
* You can represent infinite numbers to BigDecimal using the strings
- * 'Infinity', '+Infinity' and '-Infinity' (case-sensitive)
+ * <code>'Infinity'</code>, <code>'+Infinity'</code> and
+ * <code>'-Infinity'</code> (case-sensitive)
*
* == Not a Number
*
- * When a computation results in an undefined value, the special value NaN
+ * When a computation results in an undefined value, the special value +NaN+
* (for 'not a number') is returned.
*
* Example:
*
- * BigDecimal.new("0.0") / BigDecimal.new("0.0") -> NaN
+ * BigDecimal.new("0.0") / BigDecimal.new("0.0") #=> NaN
*
- * You can also create undefined values. NaN is never considered to be the
- * same as any other value, even NaN itself:
+ * You can also create undefined values.
*
- * n = BigDecimal.new('NaN')
+ * NaN is never considered to be the same as any other value, even NaN itself:
*
- * n == 0.0 -> nil
- *
- * n == n -> nil
+ * n = BigDecimal.new('NaN')
+ * n == 0.0 #=> nil
+ * n == n #=> nil
*
* == Positive and negative zero
*
@@ -2766,16 +2933,17 @@ get_vp_value:
* be returned.
*
* If the value which is too small to be represented is negative, a BigDecimal
- * value of negative zero is returned. If the value is positive, a value of
- * positive zero is returned.
+ * value of negative zero is returned.
+ *
+ * BigDecimal.new("1.0") / BigDecimal.new("-Infinity") #=> -0.0
*
- * BigDecimal.new("1.0") / BigDecimal.new("-Infinity") -> -0.0
+ * If the value is positive, a value of positive zero is returned.
*
- * BigDecimal.new("1.0") / BigDecimal.new("Infinity") -> 0.0
+ * BigDecimal.new("1.0") / BigDecimal.new("Infinity") #=> 0.0
*
* (See BigDecimal.mode for how to specify limits of precision.)
*
- * Note that -0.0 and 0.0 are considered to be the same for the purposes of
+ * Note that +-0.0+ and +0.0+ are considered to be the same for the purposes of
* comparison.
*
* Note also that in mathematics, there is no particular concept of negative
@@ -2786,17 +2954,21 @@ Init_bigdecimal(void)
{
VALUE arg;
+ id_BigDecimal_exception_mode = rb_intern_const("BigDecimal.exception_mode");
+ id_BigDecimal_rounding_mode = rb_intern_const("BigDecimal.rounding_mode");
+ id_BigDecimal_precision_limit = rb_intern_const("BigDecimal.precision_limit");
+
/* Initialize VP routines */
VpInit(0UL);
/* Class and method registration */
rb_cBigDecimal = rb_define_class("BigDecimal",rb_cNumeric);
+ rb_define_alloc_func(rb_cBigDecimal, BigDecimal_s_allocate);
/* Global function */
rb_define_global_function("BigDecimal", BigDecimal_global_new, -1);
/* Class methods */
- rb_define_singleton_method(rb_cBigDecimal, "new", BigDecimal_new, -1);
rb_define_singleton_method(rb_cBigDecimal, "mode", BigDecimal_mode, -1);
rb_define_singleton_method(rb_cBigDecimal, "limit", BigDecimal_limit, -1);
rb_define_singleton_method(rb_cBigDecimal, "double_fig", BigDecimal_double_fig, 0);
@@ -2912,12 +3084,16 @@ Init_bigdecimal(void)
rb_define_const(rb_cBigDecimal, "SIGN_NEGATIVE_INFINITE",INT2FIX(VP_SIGN_NEGATIVE_INFINITE));
arg = rb_str_new2("+Infinity");
+ /* Positive infinity value. */
rb_define_const(rb_cBigDecimal, "INFINITY", BigDecimal_global_new(1, &arg, rb_cBigDecimal));
arg = rb_str_new2("NaN");
+ /* 'Not a Number' value. */
rb_define_const(rb_cBigDecimal, "NAN", BigDecimal_global_new(1, &arg, rb_cBigDecimal));
/* instance methods */
+ rb_define_method(rb_cBigDecimal, "initialize", BigDecimal_initialize, -1);
+ rb_define_method(rb_cBigDecimal, "initialize_copy", BigDecimal_initialize_copy, 1);
rb_define_method(rb_cBigDecimal, "precs", BigDecimal_prec, 0);
rb_define_method(rb_cBigDecimal, "add", BigDecimal_add2, 2);
@@ -2977,10 +3153,6 @@ Init_bigdecimal(void)
rb_define_singleton_method(rb_mBigMath, "exp", BigMath_s_exp, 2);
rb_define_singleton_method(rb_mBigMath, "log", BigMath_s_log, 2);
- id_BigDecimal_exception_mode = rb_intern_const("BigDecimal.exception_mode");
- id_BigDecimal_rounding_mode = rb_intern_const("BigDecimal.rounding_mode");
- id_BigDecimal_precision_limit = rb_intern_const("BigDecimal.precision_limit");
-
id_up = rb_intern_const("up");
id_down = rb_intern_const("down");
id_truncate = rb_intern_const("truncate");
@@ -3048,6 +3220,16 @@ VpMemAlloc(size_t mb)
return p;
}
+VP_EXPORT void *
+VpMemRealloc(void *ptr, size_t mb)
+{
+ void *p = xrealloc(ptr, mb);
+ if (!p) {
+ VpException(VP_EXCEPTION_MEMORY, "failed to allocate memory", 1);
+ }
+ return p;
+}
+
VP_EXPORT void
VpFree(Real *pv)
{
@@ -3561,7 +3743,7 @@ VpAlloc(size_t mx, const char *szVal)
/* necessary to be able to store */
/* at least mx digits. */
/* szVal==NULL ==> allocate zero value. */
- vp = (Real *) VpMemAlloc(sizeof(Real) + mx * sizeof(BDIGIT));
+ vp = VpAllocReal(mx);
/* xmalloc() alway returns(or throw interruption) */
vp->MaxPrec = mx; /* set max precision */
VpSetZero(vp,1); /* initialize vp to zero. */
@@ -3594,19 +3776,19 @@ VpAlloc(size_t mx, const char *szVal)
/* Check on Inf & NaN */
if (StrCmp(szVal, SZ_PINF) == 0 ||
StrCmp(szVal, SZ_INF) == 0 ) {
- vp = (Real *) VpMemAlloc(sizeof(Real) + sizeof(BDIGIT));
+ vp = VpAllocReal(1);
vp->MaxPrec = 1; /* set max precision */
VpSetPosInf(vp);
return vp;
}
if (StrCmp(szVal, SZ_NINF) == 0) {
- vp = (Real *) VpMemAlloc(sizeof(Real) + sizeof(BDIGIT));
+ vp = VpAllocReal(1);
vp->MaxPrec = 1; /* set max precision */
VpSetNegInf(vp);
return vp;
}
if (StrCmp(szVal, SZ_NaN) == 0) {
- vp = (Real *) VpMemAlloc(sizeof(Real) + sizeof(BDIGIT));
+ vp = VpAllocReal(1);
vp->MaxPrec = 1; /* set max precision */
VpSetNaN(vp);
return vp;
@@ -3664,7 +3846,7 @@ VpAlloc(size_t mx, const char *szVal)
if (mx <= 0) mx = 1;
nalloc = Max(nalloc, mx);
mx = nalloc;
- vp = (Real *) VpMemAlloc(sizeof(Real) + mx * sizeof(BDIGIT));
+ vp = VpAllocReal(mx);
/* xmalloc() alway returns(or throw interruption) */
vp->MaxPrec = mx; /* set max precision */
VpSetZero(vp, sign);
@@ -4158,7 +4340,7 @@ VpMult(Real *c, Real *a, Real *b)
{
size_t MxIndA, MxIndB, MxIndAB, MxIndC;
size_t ind_c, i, ii, nc;
- size_t ind_as, ind_ae, ind_bs, ind_be;
+ size_t ind_as, ind_ae, ind_bs;
BDIGIT carry;
BDIGIT_DBL s;
Real *w;
@@ -4221,17 +4403,14 @@ VpMult(Real *c, Real *a, Real *b)
ind_as = MxIndA - nc;
ind_ae = MxIndA;
ind_bs = MxIndB;
- ind_be = MxIndB - nc;
} else if(nc <= MxIndA) { /* The middle rectangular of the Fig. */
ind_as = MxIndA - nc;
ind_ae = MxIndA -(nc - MxIndB);
ind_bs = MxIndB;
- ind_be = 0;
} else if(nc > MxIndA) { /* The right triangle of the Fig. */
ind_as = 0;
ind_ae = MxIndAB - nc - 1;
ind_bs = MxIndB -(nc - MxIndA);
- ind_be = 0;
}
for(i = ind_as; i <= ind_ae; ++i) {
@@ -4319,7 +4498,7 @@ VpDivd(Real *c, Real *r, Real *a, Real *b)
VpAsgn(c, a, VpGetSign(b));
VpSetZero(r,VpGetSign(a));
goto Exit;
- }
+ }
word_a = a->Prec;
word_b = b->Prec;
@@ -4955,7 +5134,6 @@ VP_EXPORT int
VpCtoV(Real *a, const char *int_chr, size_t ni, const char *frac, size_t nf, const char *exp_chr, size_t ne)
{
size_t i, j, ind_a, ma, mi, me;
- size_t loc;
SIGNED_VALUE e, es, eb, ef;
int sign, signe, exponent_overflow;
@@ -5052,7 +5230,6 @@ VpCtoV(Real *a, const char *int_chr, size_t ni, const char *frac, size_t nf, con
j = 0;
}
}
- loc = 1;
/* get fraction part */
@@ -5301,7 +5478,7 @@ VpSqrt(Real *y, Real *x)
{
Real *f = NULL;
Real *r = NULL;
- size_t y_prec, f_prec;
+ size_t y_prec;
SIGNED_VALUE n, e;
SIGNED_VALUE prec;
ssize_t nr;
@@ -5338,7 +5515,6 @@ VpSqrt(Real *y, Real *x)
nr = 0;
y_prec = y->MaxPrec;
- f_prec = f->MaxPrec;
prec = x->exponent - (ssize_t)y_prec;
if (x->exponent > 0)
diff --git a/ext/bigdecimal/bigdecimal.gemspec b/ext/bigdecimal/bigdecimal.gemspec
index c8bd0aef18..362808c4e3 100644
--- a/ext/bigdecimal/bigdecimal.gemspec
+++ b/ext/bigdecimal/bigdecimal.gemspec
@@ -6,6 +6,7 @@ Gem::Specification.new do |s|
s.version = _VERSION
s.date = "2011-07-30"
s.summary = "Arbitrary-precision decimal floating-point number library."
+ s.homepage = "http://www.ruby-lang.org"
s.email = "mrkn@mrkn.jp"
s.description = "This library provides arbitrary-precision decimal floating-point number class."
s.authors = ["Kenta Murata", "Shigeo Kobayashi"]
@@ -17,11 +18,10 @@ Gem::Specification.new do |s|
README
depend extconf.rb
lib/bigdecimal/jacobian.rb
- lib/bigdecimal/lcdcmp.rb
+ lib/bigdecimal/ludcmp.rb
lib/bigdecimal/math.rb
lib/bigdecimal/newton.rb
lib/bigdecimal/util.rb
- lib/bigdecimal/version.rb
sample/linear.rb
sample/nlsolve.rb
sample/pi.rb
diff --git a/ext/bigdecimal/bigdecimal.h b/ext/bigdecimal/bigdecimal.h
index d6a3f337c6..a04d1bbfea 100644
--- a/ext/bigdecimal/bigdecimal.h
+++ b/ext/bigdecimal/bigdecimal.h
@@ -21,6 +21,9 @@
#if defined(__cplusplus)
extern "C" {
+#if 0
+} /* satisfy cc-mode */
+#endif
#endif
#ifndef HAVE_LABS
@@ -120,6 +123,12 @@ extern VALUE rb_cBigDecimal;
#define VP_SIGN_POSITIVE_INFINITE 3 /* Positive infinite number */
#define VP_SIGN_NEGATIVE_INFINITE -3 /* Negative infinite number */
+#ifdef __GNUC__
+#define FLEXIBLE_ARRAY_SIZE 0
+#else
+#define FLEXIBLE_ARRAY_SIZE 1
+#endif
+
/*
* VP representation
* r = 0.xxxxxxxxx *BASE**exponent
@@ -144,7 +153,7 @@ typedef struct {
* -3 : Negative infinite number
*/
short flag; /* Not used in vp_routines,space for user. */
- BDIGIT frac[1]; /* Pointer to array of fraction part. */
+ BDIGIT frac[FLEXIBLE_ARRAY_SIZE]; /* Array of fraction part. */
} Real;
/*
@@ -191,6 +200,7 @@ VP_EXPORT int VpIsNegDoubleZero(double v);
VP_EXPORT size_t VpNumOfChars(Real *vp,const char *pszFmt);
VP_EXPORT size_t VpInit(BDIGIT BaseVal);
VP_EXPORT void *VpMemAlloc(size_t mb);
+VP_EXPORT void *VpMemRealloc(void *ptr, size_t mb);
VP_EXPORT void VpFree(Real *pv);
VP_EXPORT Real *VpAlloc(size_t mx, const char *szVal);
VP_EXPORT size_t VpAsgn(Real *c, Real *a, int isw);
@@ -273,6 +283,9 @@ VP_EXPORT int VPrint(FILE *fp,const char *cntl_chr,Real *a);
#endif /* BIGDECIMAL_DEBUG */
#if defined(__cplusplus)
+#if 0
+{ /* satisfy cc-mode */
+#endif
} /* extern "C" { */
#endif
#endif /* RUBY_BIG_DECIMAL_H */
diff --git a/ext/bigdecimal/bigdecimal_en.html b/ext/bigdecimal/bigdecimal_en.html
deleted file mode 100644
index afaf8eca86..0000000000
--- a/ext/bigdecimal/bigdecimal_en.html
+++ /dev/null
@@ -1,792 +0,0 @@
-<HTML>
-<HEAD>
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html">
-<style type="text/css"><!--
-body { color: #3f0f0f; background: #fefeff; margin-left: 2em; margin-right: 2em;}
-h1 { color: #ffffff; background-color: #3939AD; border-color: #FF00FF; width: 100%; border-style: solid;
- border-top-width: 0.1em; border-bottom-width: 0.1em; border-right: none; border-left: none;
- padding: 0.1em; font-weight: bold; font-size: 160%; text-align: center;}
-h2 { color: #00007f; background-color: #e7e7ff; border-color: #000094; width: 100%; border-style: solid; border-le ft: none; border-right: none; border-top-width: 0.1em; border-bottom-width: 0.1em; padding: 0.1em;
- font-weight: bold; font-size: 110%;
-}
-h3 { color: #00007f; padding: 0.2em; font-size: 110%;}
-h4, h5 { color: #000000; padding: 0.2em; font-size: 100%;}
-table { margin-top: 0.2em; margin-bottom: 0.2em; margin-left: 2em; margin-right: 2em;}
-caption { color: #7f0000; font-weight: bold;}
-th { background: #e7e7ff; padding-left: 0.2em; padding-right: 0.2em;}
-td { background: #f3f7ff; padding-left: 0.2em; padding-right: 0.2em;}
-code { color: #0000df;}
-dt { margin-top: 0.2em;}
-li { margin-top: 0.2em;}
-pre
-{ BACKGROUND-COLOR: #d0d0d0; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none;
- BORDER-RIGHT: medium none; BORDER-TOP: medium none; LINE-HEIGHT: 100%; MARGIN: 12px 12px 12px 12px;
- PADDING-BOTTOM: 12px; PADDING-LEFT: 12px; PADDING-RIGHT: 12px; PADDING-TOP: 12px;
- WHITE-SPACE: pre; WIDTH: 100%
-}
---></style>
-
-<TITLE>BigDecimal:An extension library for Ruby</TITLE>
-</HEAD>
-<BODY BGCOLOR=#FFFFE0>
-<H1>BigDecimal(Variable Precision Floating Library for Ruby)</H1>
-<DIV align="right"><A HREF="./bigdecimal_ja.html">Japanese</A></DIV><BR>
-BigDecimal is an extension library for the Ruby interpreter.
-Using BigDecimal class, you can obtain any number of significant digits in computation.
-For the details about Ruby see:<BR>
-<UL>
-<LI><A HREF="http://www.ruby-lang.org/en/">http://www.ruby-lang.org/en/</A>:Official Ruby page(English).</LI>
-<LI><A HREF="http://kahori.com/ruby/ring/">http://kahori.com/ruby/ring/</A>:Mutually linked pages relating to Ruby(Japanese).
-</LI>
-</UL>
-NOTE:<BR>
- This software is provided "AS IS" and without any express or
- implied warranties,including,without limitation,the implied
- warranties of merchantability and fitness for a particular
- purpose. For the details,see COPYING and README included in this
- distribution.
-<BR>
-<hr>
-
-<H2>Contents</H2>
-<UL>
-<LI><A HREF="#INTRO">Introduction</LI>
-<LI><A HREF="#SPEC">Usage and methods</A></LI>
-<LI><A HREF="#UNDEF">Infinity,NaN,Zero</A></LI>
-<LI><A HREF="#STRUCT">Internal structure</A></LI>
-<LI><A HREF="#BASE">Binary or decimal number representation</A></LI>
-<LI><A HREF="#PREC">Resulting number of significant digits</A></LI>
-</UL>
-<HR>
-
-<A NAME="#INTRO">
-<H2>Introduction</H2>
-Ruby already has builtin (variable length integer number) class Bignum. Using Bignum class,you can obtain
- any integer value in magnitude. But, variable length decimal number class is not yet built in.
-This is why I made variable length floating class BigDecimal.
-Feel free to send any comments or bug reports to me.
-<A HREF="mailto:shigeo@tinyforest.gr.jp">shigeo@tinyforest.gr.jp</A>
-I will try(but can't promise) to fix bugs reported.
-<hr>
-<H2>Installation</H2>
-The Ruby latest version can be downloaded from <A HREF="http://www.ruby-lang.org/en/">Official Ruby page</A>.
-Once decompress the downloaded Ruby archive,follow the normal installation procedures according to the
-documents included.
-
-<A NAME="#SPEC">
-<H2>Usage and methods</H2>
-Suppose you already know Ruby programming,
-to create BigDecimal objects,the program would like:<BR>
-
-<CODE><PRE>
- require 'bigdecimal'
- a=BigDecimal::new("0.123456789123456789")
- b=BigDecimal("123456.78912345678",40)
- c=a+b
-</PRE></CODE>
-
-<H3>List of methods</H3>
-In 32 bits integer system,every 4 digits(in decimal) are computed simultaneously.
-This means the number of significant digits in BigDecimal is always a multiple of 4.
-<P>
-Some more methods are available in Ruby code (not C code).
-Functions such as sin,cos ...,are in math.rb in bigdecimal directory.
-To use them,require math.rb as:
-<CODE><PRE>
-require "bigdecimal/math.rb"
-</PRE></CODE>
-For details,see the math.rb code and comments.
-Other utility methods are in util.rb.
-To use util.rb, require it as:
-<CODE><PRE>
-require "bigdecimal/util.rb"
-</PRE></CODE>
-For details,see the util.rb code.
-
-<H4><U>Class methods</U></H4>
-<UL>
-<LI><B>new</B></LI><BLOCKQUOTE>
-"new" method creates a new BigDecimal object.<BR>
-a=BigDecimal::new(s[,n]) or<BR>
-a=BigDecimal(s[,n]) or<BR>
-where:<BR>
-s: Initial value string. Spaces will be ignored. Any unrecognizable character for
-representing initial value terminates the string.<BR>
-n: Maximum number of significant digits of a. n must be a Fixnum object.
-If n is omitted or is equal to 0,then the maximum number of significant digits of a is determined from the length of s.
-Actual number of digits handled in computations are usually greater than n.<BR>
-n is useful when performing divisions like
-<CODE><PRE>
-BigDecimal("1") / BigDecimal("3") # => 0.3333333333 33E0
-BigDecimal("1",10) / BigDecimal("3",10) # => 0.3333333333 3333333333 33333333E0
-</PRE></CODE>
-but the resulting digits obtained may differ in future version.
-</BLOCKQUOTE>
-
-<LI><B>mode</B></LI><BLOCKQUOTE>
-f = BigDecimal.mode(s[,v])<BR>
-mode method controls BigDecimal computation. If the second argument is not given or is nil,then the value
-of current setting is returned.
-Following usage are defined.<BR>
-<P><B>[EXCEPTION control]</B><P>
-Actions when computation results NaN or Infinity can be defined as follows.
-<P>
-<BLOCKQUOTE>
-f = BigDecimal::mode(BigDecimal::EXCEPTION_NaN,flag)<BR>
-f = BigDecimal::mode(BigDecimal::EXCEPTION_INFINITY,flag)<BR>
-f = BigDecimal::mode(BigDecimal::EXCEPTION_UNDERFLOW,flag)<BR>
-f = BigDecimal::mode(BigDecimal::EXCEPTION_OVERFLOW,flag)<BR>
-f = BigDecimal::mode(BigDecimal::EXCEPTION_ZERODIVIDE,flag)<BR>
-f = BigDecimal::mode(BigDecimal::EXCEPTION_ALL,flag)<BR>
-</BLOCKQUOTE>
-EXCEPTION_NaN controls the execution when computation results to NaN.<BR>
-EXCEPTION_INFINITY controls the execution when computation results to Infinity.<BR>
-EXCEPTION_UNDERFLOW controls the execution when computation underflows.<BR>
-EXCEPTION_OVERFLOW controls the execution when computation overflows.<BR>
-EXCEPTION_ZERODIVIDE controls the execution when zero-division occurs.<BR>
-EXCEPTION_ALL controls the execution when any defined exception occurs.<BR>
-If the flag is true,then the relating exception is thrown.<BR>
-No exception is thrown when the flag is false(default) and computation
-continues with the result:<BR>
-<BLOCKQUOTE>
-EXCEPTION_NaN results to NaN<BR>
-EXCEPTION_INFINITY results to +Infinity or -Infinity<BR>
-EXCEPTION_UNDERFLOW results to 0.<BR>
-EXCEPTION_OVERFLOW results to +Infinity or -Infinity<BR>
-EXCEPTION_ZERODIVIDE results to +Infinity or -Infinity<BR>
-</BLOCKQUOTE>
-EXCEPTION_INFINITY,EXCEPTION_OVERFLOW, and EXCEPTION_ZERODIVIDE are
- currently the same.<BR>
-The return value of mode method is the value set.<BR>
-If nil is specified for the second argument,then current setting is returned.<BR>
-Suppose the return value of the mode method is f,then
- f &amp; BigDecimal::EXCEPTION_NaN !=0 means EXCEPTION_NaN is set to on.
-<P>
-<B>[ROUND error control]</B><P>
-Rounding operation can be controlled as:
-<BLOCKQUOTE>
-f = BigDecimal::mode(BigDecimal::ROUND_MODE,flag)
-</BLOCKQUOTE>
-where flag must be one of:
-<TABLE>
-
-<TR><TD>ROUND_UP</TD><TD>round away from zero.</TD></TR>
-<TR><TD>ROUND_DOWN</TD><TD>round towards zero(truncate).</TD></TR>
-<TR><TD>ROUND_HALF_UP</TD><TD>round up if the digit &gt;= 5 otherwise truncated(default).</TD></TR>
-<TR><TD>ROUND_HALF_DOWN</TD><TD>round up if the digit &gt;= 6 otherwise truncated.</TD></TR>
-<TR><TD>ROUND_HALF_EVEN</TD><TD>round towards the even neighbor(Banker's rounding).
-<TR><TD>ROUND_CEILING</TD><TD>round towards positive infinity(ceil).</TD></TR>
-<TR><TD>ROUND_FLOOR</TD><TD>round towards negative infinity(floor).</TD></TR>
-</TABLE>
-New rounding mode is returned. If nil is specified for the second argument,then current setting is returned.<BR>
-The digit location for rounding operation can not be specified by this mode method,
-use truncate/round/ceil/floor/add/sub/mult/div methods for each instance instead.
-</BLOCKQUOTE>
-
-<LI><B>limit[(n)]</B></LI><BLOCKQUOTE>
-Limits the maximum digits that the newly created BigDecimal objects can hold never exceed n.
-This means the rounding operation specified by BigDecimal.mode is
-performed if necessary.
-limit returns the value before set if n is nil or is not specified.
-Zero,the default value,means no upper limit.<BR>
-The limit has no more priority than instance methods such as truncate,round,ceil,floor,add,sub,mult,and div. <BR>
-mf = BigDecimal::limit(n)<BR>
-</BLOCKQUOTE>
-
-<LI><B>double_fig</B></LI><BLOCKQUOTE>
-double_fig is a class method which returns the number of digits
-the Float class can have.
-<CODE><PRE>
- p BigDecimal::double_fig # ==> 20 (depends on the CPU etc.)
-</PRE></CODE>
-The equivalent C programs which calculates the value of
-double_fig is:
-<CODE><PRE>
- double v = 1.0;
- int double_fig = 0;
- while(v + 1.0 > 1.0) {
- ++double_fig;
- v /= 10;
- }
-</PRE></CODE>
-</BLOCKQUOTE>
-
-<LI><B>BASE</B></LI><BLOCKQUOTE>
-Base value used in the BigDecimal calculation.
-On 32 bits integer system,the value of BASE is 10000.<BR>
-b = BigDecimal::BASE<BR>
-</BLOCKQUOTE>
-</UL>
-
-<H4><U>Instance methods</U></H4>
-<UL>
-<LI><B>+</B></LI><BLOCKQUOTE>
-addition(c = a + b)<BR>
-For the resulting number of significant digits of c,see <A HREF="#PREC">Resulting number of significant digits</A>.
-
-</BLOCKQUOTE>
-<LI><B>-</B></LI><BLOCKQUOTE>
-subtraction (c = a - b) or negation (c = -a)<BR>
-For the resulting number of significant digits of c,see <A HREF="#PREC">Resulting number of significant digits</A>.
-
-</BLOCKQUOTE>
-<LI><B>*</B></LI><BLOCKQUOTE>
-multiplication(c = a * b)<BR>
-For the resulting number of significant digits of c,see <A HREF="#PREC">Resulting number of significant digits</A>.
-
-</BLOCKQUOTE>
-<LI><B>/</B></LI><BLOCKQUOTE>
-division(c = a / b)<BR>
-For the resulting number of significant digits of c,see <A HREF="#PREC">Resulting number of significant digits</A>.
-</BLOCKQUOTE>
-
-<LI><B>add(b,n)</B></LI><BLOCKQUOTE>
-c = a.add(b,n)<BR>
-c = a.add(b,n) performs c = a + b.<BR>
-If n is less than the actual significant digits of a + b,
-then c is rounded properly according to the BigDecimal.limit.<BR>
-If n is zero,then the result is the same as +'s.
-</BLOCKQUOTE>
-<LI><B>sub(b,n)</B></LI><BLOCKQUOTE>
-c = a.sub(b,n)<BR>
-c = a.sub(b,n) performs c = a - b.<BR>
-If n is less than the actual significant digits of a - b,
-then c is rounded properly according to the BigDecimal.limit.<BR>
-If n is zero,then the result is the same as -'s.
-
-</BLOCKQUOTE>
-<LI><B>mult(b,n)</B></LI><BLOCKQUOTE>
-c = a.mult(b,n)<BR>
-c = a.mult(b,n) performs c = a * b.<BR>
-If n is less than the actual significant digits of a * b,
-then c is rounded properly according to the BigDecimal.limit.<BR>
-If n is zero,then the result is the same as *'s.
-
-</BLOCKQUOTE>
-<LI><B>div(b[,n])</B></LI><BLOCKQUOTE>
-c = a.div(b,n)<BR>
-c = a.div(b,n) performs c = a / b.<BR>
-If n is less than the actual significant digits of a / b,
-then c is rounded properly according to the BigDecimal.limit.<BR>
-If n is zero,then the result is the same as /'s.
-If n is not given,then the result will be an integer(BigDecimal) like Float#div.
-</BLOCKQUOTE>
-
-<LI><B>fix</B></LI><BLOCKQUOTE>
-c = a.fix<BR>
-returns integer part of a.<BR>
-
-</BLOCKQUOTE>
-<LI><B>frac</B></LI><BLOCKQUOTE>
-c = a.frac<BR>
-returns fraction part of a.<BR>
-
-</BLOCKQUOTE>
-<LI><B>floor[(n)]</B></LI><BLOCKQUOTE>
-c = a.floor<BR>
-returns the maximum integer value (in BigDecimal) which is less than or equal to a.
-<CODE><PRE>
- c = BigDecimal("1.23456").floor # ==> 1
- c = BigDecimal("-1.23456").floor # ==> -2
-</PRE></CODE>
-
-As shown in the following example,an optional integer argument (n) specifying the position
-of the target digit can be given.<BR>
-If n> 0,then the (n+1)th digit counted from the decimal point in fraction part is processed(resulting number of fraction part digits is less than or equal to n).<BR>
-If n<0,then the n-th digit counted from the decimal point in integer part is processed(at least n 0's are placed from the decimal point to left).
-<CODE><PRE>
- c = BigDecimal("1.23456").floor(4) # ==> 1.2345
- c = BigDecimal("15.23456").floor(-1) # ==> 10.0
-</PRE></CODE>
-
-</BLOCKQUOTE>
-<LI><B>ceil[(n)]</B></LI><BLOCKQUOTE>
-c = a.ceil<BR>
-returns the minimum integer value (in BigDecimal) which is greater than or equal to a.
-<CODE><PRE>
- c = BigDecimal("1.23456").ceil # ==> 2
- c = BigDecimal("-1.23456").ceil # ==> -1
-</PRE></CODE>
-
-As shown in the following example,an optional integer argument (n) specifying the position
-of the target digit can be given.<BR>
-If n>0,then the (n+1)th digit counted from the decimal point in fraction part is processed(resulting number of fraction part digits is less than or equal to n).<BR>
-If n<0,then the n-th digit counted from the decimal point in integer part is processed(at least n 0's are placed from the decimal point to left).
-<CODE><PRE>
- c = BigDecimal("1.23456").ceil(4) # ==> 1.2346
- c = BigDecimal("15.23456").ceil(-1) # ==> 20.0
-</PRE></CODE>
-
-</BLOCKQUOTE>
-<LI><B>round[(n[,b])]</B></LI><BLOCKQUOTE>
-c = a.round<BR>
-round a to the nearest 1(default)ÅD<BR>
-<CODE><PRE>
- c = BigDecimal("1.23456").round # ==> 1
- c = BigDecimal("-1.23456").round # ==> -1
-</PRE></CODE>
-The rounding operation changes according to BigDecimal::mode(BigDecimal::ROUND_MODE,flag) if specified.
-
-As shown in the following example,an optional integer argument (n) specifying the position
-of the target digit can be given.<BR>
-If n>0,then the (n+1)th digit counted from the decimal point in fraction part is processed(resulting number of fraction part digits is less than or equal to n).<BR>
-If n<0,then the n-th digit counted from the decimal point in integer part is processed(at least n 0's are placed from the decimal point to left).
-<CODE><PRE>
-c = BigDecimal::new("1.23456").round(4) # ==> 1.2346
-c = BigDecimal::new("15.23456").round(-1) # ==> 20.0
-</PRE></CODE>
-
-Rounding operation can be specified by setting the second optional argument b with the valid ROUND_MODE.<BR>
-<CODE><PRE>
-c = BigDecimal::new("1.23456").round(3,BigDecimal::ROUND_HALF_EVEN) # ==> 1.234
-c = BigDecimal::new("1.23356").round(3,BigDecimal::ROUND_HALF_EVEN) # ==> 1.234
-</PRE></CODE>
-
-</BLOCKQUOTE>
-<LI><B>truncate[(n)]</B></LI><BLOCKQUOTE>
-c = a.truncate<BR>
-truncate a to the nearest 1ÅD<BR>
-As shown in the following example,an optional integer argument (n) specifying the position
-of the target digit can be given.<BR>
-If n>0,then the (n+1)th digit counted from the decimal point in fraction part is processed(resulting number of fraction part digits is less than or equal to n).<BR>
-If n<0,then the n-th digit counted from the decimal point in integer part is processed(at least n 0's are placed from the decimal point to left).
-
-<CODE><PRE>
-c = BigDecimal::new("1.23456").truncate(4) # ==> 1.2345
-c = BigDecimal::new("15.23456").truncate(-1) # ==> 10.0
-</PRE></CODE>
-</BLOCKQUOTE>
-<LI><B>abs</B></LI><BLOCKQUOTE>
-c = a.abs<BR>
-returns an absolute value of a.<BR>
-
-</BLOCKQUOTE>
-<LI><B>to_i</B></LI><BLOCKQUOTE>
-changes a to an integer.<BR>
-i = a.to_i<BR>
-i becomes to Fixnum or Bignum.
-If a is Infinity or NaN,then i becomes to nil.
-
-</BLOCKQUOTE>
-<LI><B>to_s[(n)]</B></LI><BLOCKQUOTE>
-converts to string(default results look like "0.xxxxxEn").
-<CODE><PRE>
-BigDecimal("1.23456").to_s # ==> "0.123456E1"
-</PRE></CODE>
-If n(>0) is given,then a space is inserted to each of two parts divided by the decimal point
-after every n digits for readability.
-<CODE><PRE>
-BigDecimal("0.1234567890123456789").to_s(10) # ==> "0.1234567890 123456789E0"
-</PRE></CODE>
-n can be a string representing a positive integer number.
-<CODE><PRE>
-BigDecimal("0.1234567890123456789").to_s("10") # ==> "0.1234567890 123456789E0"
-</PRE></CODE>
-If the first character is '+'(or ' '),then '+'(or ' ') will be set before value string
-when the value is positive.
-<CODE><PRE>
-BigDecimal("0.1234567890123456789").to_s(" 10") # ==> " 0.1234567890 123456789E0"
-BigDecimal("0.1234567890123456789").to_s("+10") # ==> "+0.1234567890 123456789E0"
-BigDecimal("-0.1234567890123456789").to_s("10") # ==> "-0.1234567890 123456789E0"
-</PRE></CODE>
-
-At the end of the string,'E'(or 'e') or 'F'(or 'f') can be specified to change
-number representation.
-<CODE><PRE>
-BigDecimal("1234567890.123456789").to_s("E") # ==> "0.1234567890123456789E10"
-BigDecimal("1234567890.123456789").to_s("F") # ==> "1234567890.123456789"
-BigDecimal("1234567890.123456789").to_s("5E") # ==> "0.12345 67890 12345 6789E10"
-BigDecimal("1234567890.123456789").to_s("5F") # ==> "12345 67890.12345 6789"
-</PRE></CODE>
-
-</BLOCKQUOTE>
-<LI><B>exponent</B></LI><BLOCKQUOTE>
-returns an integer holding exponent value of a.<BR>
-n = a.exponent <BR>
-means a = 0.xxxxxxx*10**n.
-</BLOCKQUOTE>
-
-<LI><B>precs</B></LI><BLOCKQUOTE>
-n,m = a.precs <BR>
-precs returns number of significant digits (n) and maximum number of
-significant digits (m) of a.
-</BLOCKQUOTE>
-
-<LI><B>to_f</B></LI><BLOCKQUOTE>
-Creates a new Float object having (nearly) the same value.
-Use split method if you want to convert by yourself.
-</BLOCKQUOTE>
-
-</BLOCKQUOTE>
-<LI><B>sign</B></LI><BLOCKQUOTE>
-n = a.sign <BR>
-returns positive value if a &gt; 0,negative value if a &lt; 0,
-otherwise zero if a == 0.<BR>
-where the value of n means that a is:<BR>
-n = BigDecimal::SIGN_NaN(0) : a is NaN<BR>
-n = BigDecimal::SIGN_POSITIVE_ZERO(1) : a is +0<BR>
-n = BigDecimal::SIGN_NEGATIVE_ZERO(-1) : a is -0<BR>
-n = BigDecimal::SIGN_POSITIVE_FINITE(2) : a is positive<BR>
-n = BigDecimal::SIGN_NEGATIVE_FINITE(-2) : a is negative<BR>
-n = BigDecimal::SIGN_POSITIVE_INFINITE(3) : a is +Infinity<BR>
-n = BigDecimal::SIGN_NEGATIVE_INFINITE(-3) : a is -Infinity<BR>
-The value in () is the actual value,see (<A HREF="#STRUCT">Internal structure</A>.<BR>
-
-</BLOCKQUOTE>
-<LI><B>nan?</B></LI><BLOCKQUOTE>
-a.nan? returns True when a is NaN.
-
-</BLOCKQUOTE>
-<LI><B>infinite?</B></LI><BLOCKQUOTE>
-a.infinite? returns 1 when a is Infinity, -1 when a is -Infinity, nil otherwise.
-
-</BLOCKQUOTE>
-<LI><B>finite?</B></LI><BLOCKQUOTE>
-a.finite? returns true when a is neither Infinity nor NaN.
-</BLOCKQUOTE>
-
-<LI><B>zero?</B></LI><BLOCKQUOTE>
-c = a.zero?<BR>
-returns true if a is equal to 0,otherwise returns false<BR>
-</BLOCKQUOTE>
-<LI><B>nonzero?</B></LI><BLOCKQUOTE>
-c = a.nonzero?<BR>
-returns nil if a is 0,otherwise returns a itself.<BR>
-</BLOCKQUOTE>
-
-<LI><B>split</B></LI><BLOCKQUOTE>
-decomposes a BigDecimal value to 4 parts.
-All 4 parts are returned as an array.<BR>
-Parts consist of a sign(0 when the value is NaN,+1 for positive and
- -1 for negative value), a string representing fraction part,base value(always 10 currently),and an integer(Fixnum) for exponent respectively.
-a=BigDecimal::new("3.14159265")<BR>
-f,x,y,z = a.split<BR>
-where f=+1,x="314159265",y=10 and z=1<BR>
-therefore,you can translate BigDecimal value to Float as:<BR>
-s = "0."+x<BR>
-b = f*(s.to_f)*(y**z)<BR>
-
-</BLOCKQUOTE>
-<LI><B>inspect</B></LI><BLOCKQUOTE>
-is used for debugging output.<BR>
-p a=BigDecimal::new("3.14",10)<BR>
-should produce output like "#&lt;0x112344:'0.314E1',4(12)%gt;".
-where "0x112344" is the address,
-'0.314E1' is the value,4 is the number of the significant digits,
-and 12 is the maximum number of the significant digits
-the object can hold.
-</BLOCKQUOTE>
-
-<LI><B>sqrt</B></LI><BLOCKQUOTE>
-c = a.sqrt(n)<BR>
-computes square root value of a with significant digit number n at least.<BR>
-</BLOCKQUOTE>
-
-<LI><B>**</B></LI><BLOCKQUOTE>
-c = a ** n<BR>
-returns the value of a powered by n.
-n must be an integer.<BR>
-
-</BLOCKQUOTE>
-<LI><B>power</B></LI><BLOCKQUOTE>
-The same as ** method.<BR>
-c = a.power(n)<BR>
-returns the value of a powered by n(c=a**n).
-n must be an integer.<BR>
-</BLOCKQUOTE>
-
-<LI><B>divmod,quo,modulo,%,remainder</B></LI><BLOCKQUOTE>
-See,corresponding methods in Float class.
-</BLOCKQUOTE>
-
-</BLOCKQUOTE>
-<LI><B>&lt;=&gt;</B></LI><BLOCKQUOTE>
-c = a &lt;=&gt; b <BR>
-returns 0 if a==b,1 if a &gt b,and returns -1 if a &lt b.<BR>
-</BLOCKQUOTE>
-</UL>
-
-Following methods need no explanation.<BR>
-<UL>
-<LI>==</LI>
-<LI>===</LI>
-same as ==,used in case statement.
-<LI>!=</LI>
-<LI>&lt;</LI>
-<LI>&lt;=</LI>
-<LI>&gt;</LI>
-<LI>&gt;=</LI>
-</UL>
-
-<HR>
-<H3>About 'coerce'</H3>
-<B>For the binary operation like A op B:</B>
-<DL>
-<DT> 1.Both A and B are BigDecimal objects</DT>
-<DD> A op B is normally performed.</DD>
-<DT> 2.A is the BigDecimal object but B is other than BigDecimal object</DT>
-<DD> Operation is performed,after B is translated to corresponding BigDecimal object(because BigDecimal supports coerce method).</DD>
-<DT> 3.A is not the BigDecimal object but B is BigDecimal object</DT>
-<DD>If A has coerce method,then B will translate A to corresponding
-BigDecimal object and the operation is performed,otherwise an error occures.</DD>
-</DL>
-
-String is not translated to BigDecimal in default.
-Uncomment /* #define ENABLE_NUMERIC_STRING */ in bigdecimal.c, compile and install
-again if you want to enable string to BigDecimal conversion.
-Translation stops without error at the character representing non digit.
-For instance,"10XX" is translated to 10,"XXXX" is translated to 0.<BR>
-String representing zero or infinity such as "Infinity","+Infinity","-Infinity",and "NaN" can also be translated to BigDecimal unless false is specified by mode method.<BR>
-
-BigDecimal class supports coerce method(for the details about coerce method,see Ruby documentations). This means the most binary operation can be performed if the BigDecimal object is at the left hand side of the operation.<BR><BR>
-
- For example:
-<CODE><PRE>
- a = BigDecimal.E(20)
- c = a * "0.123456789123456789123456789" # A String is changed to BigDecimal object.
-</PRE></CODE>
-is performed normally.<BR>
- But,because String does not have coerce method,the following example can not be performed.<BR>
-
-<CODE><PRE>
- a = BigDecimal.E(20)
- c = "0.123456789123456789123456789" * a # ERROR
-</PRE></CODE>
-
-If you actually have any inconvenience about the error above.
-You can define a new class derived from String class,
-and define coerce method within the new class.<BR>
-
-<hr>
-<A NAME="#UNDEF">
-<H2>Infinity,Not a Number(NaN),Zero</H2>
-Infinite numbers and NaN can be represented by string writing "+Infinity"(or "Infinity"),"-Infinity",and "NaN" respectively in your program.
-Infinite numbers can be obtained by 1.0/0.0(=Infinity) or -1.0/0.0(=-Infinity).
-<BR><BR>
-NaN(Not a number) can be obtained by undefined computation like 0.0/0.0
-or Infinity-Infinity.
-Any computation including NaN results to NaN.
-Comparisons with NaN never become true,including comparison with NaN itself.
-<BR><BR>
-Zero has two different variations as +0.0 and -0.0.
-But,still, +0.0==-0.0 is true.
-<BR><BR>
-Computation results including Infinity,NaN,+0.0 or -0.0 become complicated.
-Run following program and confirm the results.
-Send me any incorrect result if you find.
-
-<CODE><PRE>
- require "bigdecimal"
- aa = %w(1 -1 +0.0 -0.0 +Infinity -Infinity NaN)
- ba = %w(1 -1 +0.0 -0.0 +Infinity -Infinity NaN)
- opa = %w(+ - * / <=> > >= < == != <=)
- for a in aa
- for b in ba
- for op in opa
- x = BigDecimal::new(a)
- y = BigDecimal::new(b)
- eval("ans= x #{op} y;print a,' ',op,' ',b,' ==> ',ans.to_s,\"\n\"")
- end
- end
- end
-</PRE></CODE>
-<hr>
-
-<A NAME="#STRUCT">
-<H2>Internal structure</H2>
-BigDecimal number is defined by the structure Real in BigDecimal.h.
-Digits representing a float number are kept in the array frac[] defined in the structure.
-In the program,any floating number(BigDecimal number) is represented as:<BR>
- <BigDecimal number> = 0.xxxxxxxxx*BASE**n<BR><BR>
-where 'x' is any digit representing mantissa(kept in the array frac[]),
-BASE is base value(=10000 in 32 bit integer system),
-and n is the exponent value.<BR>
-Larger BASE value enables smaller size of the array frac[],and increases computation speed.
-The value of BASE is defined ind VpInit(). In 32 bit integer system, this value is
-10000. In 64 bit integer system, the value is 1000000000.
-When BASE is 10000,an element of the array frac[] can have value of from 0 to 9999.
-(up to 4 digits).<BR>
-The structure Real is defined in bigdecimal.h as:<BR>
-<CODE><PRE>
- typedef struct {
- VALUE obj; /* Back pointer(VALUE) for Ruby object. */
- unsigned long MaxPrec; /* The size of the array frac[] */
- unsigned long Prec; /* Current size of frac[] actually used. */
- short sign; /* Attribute of the value. */
- /* ==0 : NaN */
- /* 1 : +0 */
- /* -1 : -0 */
- /* 2 : Positive number */
- /* -2 : Negative number */
- /* 3 : +Infinity */
- /* -3 : -Infinity */
- unsigned short flag; /* Control flag */
- int exponent; /* Exponent value(0.xxxx*BASE**exponent) */
- unsigned long frac[1]; /* An array holding mantissa(Variable) */
- } Real;
-</CODE></PRE>
-The decimal value 1234.56784321 is represented as(BASE=10000):<BR>
-<PRE>
- 0.1234 5678 4321*(10000)**1
-</PRE>
-where frac[0]=1234,frac[1]=5678,frac[2]=4321,
-Prec=3,sign=2,exponent=1. MaxPrec can be any value greater than or equal to
-Prec.
-<hr>
-
-<A NAME="#BASE">
-<H2>Binary or decimal number representation</H2>
-I adopted decimal number representation for BigDecimal implementation.
-Of cource,binary number representation is common on the most computers.
-
-<H3>Advantages using decimal representation</H3>
-The reason why I adopted decimal number representation for BigDecimal is:<BR>
-<DL>
-<DT>Easy for debugging
-<DD>The floating number 1234.56784321 can be easily represented as:<BR>
- frac[0]=1234,frac[1]=5678,frac[2]=4321,exponent=1,and sign=2.
-<DT>Exact representation
-<DD>Following program can add all numbers(in decimal) in a file
- without any error(no round operation).<BR>
-
-<CODE><PRE>
- file = File::open(....,"r")
- s = BigDecimal::new("0")
- while line = file.gets
- s = s + line
- end
-</PRE></CODE>
-
-If the internal representation is binary,translation from decimal to
-binary is required and the translation error is inevitable.
-For example, 0.1 can not exactly be represented in binary.<BR>
-0.1 => b1*2**(-1)+b1*2**(-2)+b3*2**(-3)+b4*2**(-4)....<BR>
-where b1=0,b2=0,b3=0,b4=1...<BR>
-bn(n=1,2,3,...) is infinite series of digit with value of 0 or 1,
-and rounding operation is necessary but where we should round the series ?
-Of course, exact "0.1" is printed if the rounding operation is properly done,
-<DT>Significant digit we can have is automatically determined
-<DD>In binary representation,0.1 can not be represented in finite series of digit.
-
-But we only need one element(frac[0]=1) in decimal representation.
-This means that we can always determine the size of the array frac[] in Real
-structure.
-</DL>
-
-<H3>Disadvantage of decimal representation</H3>
-Because most computers have no internal decimal representation.
-Once you use BigDecimal,you need to keep using it without
-considering computation cost if exact computation is required.
-
-<H4>Which is the first input?</H4>
-Because most people uses decimal notation for numeric data representation,
-BigDecimal can handle numeric data without loss of translation error.
-<hr>
-
-<A NAME="#PREC">
-<H2>Resulting number of significant digits</H2>
-For the fundamental arithmetics such as addition,subtraction,
-multiplication,and division,I prepared 2 group of methods<BR>
-
-<H3>1. +,-,*,/</H3>
-For the operation + - * /,you can not specify the resulting
-number of significant digits.<BR>
-Resulting number of significant digits are defined as:<BR>
-1.1 For *,resulting number of significant digits is the sum of the
-significant digits of both side of the operator. For / ,resulting number of significant digits is the sum of the
-maximum significant digits of both side of the operator.<BR>
-1.2 For + and -,resulting number of significant digits is determined so that
- no round operation is needed. <br>
-For example, c has more than 100 significant digits if c is computed as:<BR>
-c = 0.1+0.1*10**(-100)<br>
-<BR>
-As +,-,and * are always exact(no round operation is performed unless BigDecimal.limit is specified),
-which means more memory is required to keep computation results.
-But,the division such as c=1.0/3.0 will always be rounded.<BR>
-
-<H3>2. add,sub,mult,div</H3>
-The length of the significant digits obtained from +,-,*,/
-is always defined by that of right and left side of the operator.
-To specify the length of the significant digits by your self,
-use methos add,sub,mult,div.
-<CODE><PRE>
- BigDecimal("2").div(3,12) # 2.0/3.0 => 0.6666666666 67E0
-</PRE></CODE>
-</BLOCKQUOTE>
-
-<H3>3. truncate,round,ceil,floor</H3>
-Using these methods,you can specify rounding location relatively from
-decimal point.
-<CODE><PRE>
- BigDecimal("6.66666666666666").round(12) # => 0.6666666666 667E1
-</PRE></CODE>
-</BLOCKQUOTE>
-
-
-<H3>4. Example</H3>
-Following example compute the ratio of the circumference of a circle to
-its diameter(pi=3.14159265358979....) using J.Machin's formula.
-<BR><BR>
-<CODE><PRE>
-#!/usr/local/bin/ruby
-
-require "bigdecimal"
-#
-# Calculates 3.1415.... (the number of times that a circle's diameter
-# will fit around the circle) using J. Machin's formula.
-#
-def big_pi(sig) # sig: Number of significant figures
- exp = -sig
- pi = BigDecimal::new("0")
- two = BigDecimal::new("2")
- m25 = BigDecimal::new("-0.04")
- m57121 = BigDecimal::new("-57121")
-
- u = BigDecimal::new("1")
- k = BigDecimal::new("1")
- w = BigDecimal::new("1")
- t = BigDecimal::new("-80")
- while (u.nonzero? && u.exponent >= exp)
- t = t*m25
- u = t.div(k,sig)
- pi = pi + u
- k = k+two
- end
-
- u = BigDecimal::new("1")
- k = BigDecimal::new("1")
- w = BigDecimal::new("1")
- t = BigDecimal::new("956")
- while (u.nonzero? && u.exponent >= exp )
- t = t.div(m57121,sig)
- u = t.div(k,sig)
- pi = pi + u
- k = k+two
- end
- pi
-end
-
-if $0 == __FILE__
- if ARGV.size == 1
- print "PI("+ARGV[0]+"):\n"
- p big_pi(ARGV[0].to_i)
- else
- print "TRY: ruby pi.rb 1000 \n"
- end
-end
-
-</PRE></CODE>
-<HR>
-<FONT size=2>
-<I>
-<A HREF="http://www.tinyforest.gr.jp">
-Shigeo Kobayashi
-</A>
-(E-Mail:<A HREF="mailto:shigeo@tinyforest.gr.jp">&lt;shigeo@tinyforest.gr.jp&gt;</U></A>)
-</I>
-</FONT>
-</TD>
-</TR>
-</TABLE>
-</BODY>
-</HTML>
diff --git a/ext/bigdecimal/bigdecimal_ja.html b/ext/bigdecimal/bigdecimal_ja.html
deleted file mode 100644
index cc44d61917..0000000000
--- a/ext/bigdecimal/bigdecimal_ja.html
+++ /dev/null
@@ -1,799 +0,0 @@
-<!-- saved from url=(0022)http://internet.e-mail -->
-<HTML>
-<HEAD>
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=Shift_JIS">
-<style type="text/css"><!--
-body { color: #3f0f0f; background: #fefeff; margin-left: 2em; margin-right: 2em;}
-h1 { color: #ffffff; background-color: #3939AD; border-color: #FF00FF; width: 100%;
- border-style: solid; border-top-width: 0.1em; border-bottom-width: 0.1em; border-right: none;
- border-left: none; padding: 0.1em; font-weight: bold; font-size: 160%; text-align: center;
-}
-h2 { color: #00007f; background-color: #e7e7ff; border-color: #000094; width: 100%;
- border-style: solid; border-left: none; border-right: none; border-top-width: 0.1em; border-bottom-width: 0.1em;
- padding: 0.1em;
- font-weight: bold; font-size: 110%;
-}
-h3 { color: #00007f; padding: 0.2em; font-size: 110%;}
-h4, h5 { color: #000000; padding: 0.2em; font-size: 100%;}
-table { margin-top: 0.2em; margin-bottom: 0.2em; margin-left: 2em; margin-right: 2em;}
-caption { color: #7f0000; font-weight: bold;}
-th { background: #e7e7ff; padding-left: 0.2em; padding-right: 0.2em;}
-td { background: #f3f7ff; padding-left: 0.2em; padding-right: 0.2em;}
-code { color: #0000df;}
-dt { margin-top: 0.2em;}
-li { margin-top: 0.2em;}
-pre
-{ BACKGROUND-COLOR: #d0d0d0; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none;
- BORDER-RIGHT: medium none; BORDER-TOP: medium none; LINE-HEIGHT: 100%; MARGIN: 12px 12px 12px 12px;
- PADDING-BOTTOM: 12px; PADDING-LEFT: 12px; PADDING-RIGHT: 12px; PADDING-TOP: 12px;
- WHITE-SPACE: pre; WIDTH: 100%
-}
---></style>
-
-<TITLE>BigDecimal:An extension library for Ruby</TITLE>
-</HEAD>
-<BODY BGCOLOR=#FFFFE0>
-<H1>BigDecimal(•ϒ_ZpgCu)</H1>
-<DIV align="right"><A HREF="./bigdecimal_en.html">English</A></DIV><BR>
-BigDecimal ̓IuWFNgw̋͂ȃXNvgł Ruby ɉ•ϒ_
-vZ@\lj邽߂̊gCułB
-Ruby ɂ‚Ă̏ڂe͈ȉURLQƂĂB
-<UL>
-<LI><A HREF="http://www.ruby-lang.org/ja/">http://www.ruby-lang.org/ja/</A>FRubyy[W</LI>
-<LI><A HREF="http://kahori.com/ruby/ring/">http://kahori.com/ruby/ring/</A>FRubyɊւy[WH܂</LI>
-</UL>
-<hr>
-<H2>ڎ</H2>
-<UL>
-<LI><A HREF="#INTRO">͂߂</LI>
-<LI><A HREF="#SPEC">gp@ƃ\bḧꗗ</A></LI>
-<LI><A HREF="#UNDEF">A񐔁A[̈</A></LI>
-<LI><A HREF="#STRUCT">\</A></LI>
-<LI><A HREF="#BASE">2i10i</A></LI>
-<LI><A HREF="#PREC">vZxɂ‚</A></LI>
-</UL>
-
-<HR>
-<A NAME="#INTRO">
-<H2>͂߂</H2>
-Ruby ɂ Bignum ƂNXAS̐łvZ邱Ƃł܂B
-ACӌ̕_ZpNX悤łBŁA
-Cӌ̕_ZpgCu BigDecimal 쐬܂B
-s⏕EĂꍇǂǂA
-<A HREF="mailto:shigeo@tinyforest.gr.jp">shigeo@tinyforest.gr.jp</A>
-܂łm点Bs𒼂C͑傢ɂ܂BAԂȂǂ̊֌WŖ
-͂ł܂B܂Aʂɂ‚Ăۏ؂ł̂ł͂܂B
-\߁AB
-<BR><BR>
-̃vÓARɔzzEςč\܂BA쌠͕Ă܂B
-zzEϓ̌ Ruby ̂ɏ܂Bڂ README ǂłB
-
-<hr>
-<H2>CXg[ɂ‚</H2>
-BigDecimal ܂ Ruby ̍ŐVł<A HREF="http://www.ruby-lang.org/ja/">Rubyy[W</A>_E[hł܂B
-_E[hŐVł𓀂Aʏ̃CXg[菇sĉB
-Ruby CXg[΁A BigDecimal pł悤ɂȂ͂łB
-\[Xt@C
-bigdecimal.c,bigdecimal.h
-̂Q‚݂̂łB<BR>
-
-<hr>
-<A NAME="#SPEC">
-<H2>gp@ƃ\bḧꗗ</H2>
-uRuby͊ɏvƂOŁA
-<CODE><PRE>
-require 'bigdecimal'
-a=BigDecimal::new("0.123456789123456789")
-b=BigDecimal("123456.78912345678",40)
-c=a+b
-</PRE></CODE>
-<br>
-Ƃ悤ȊŎgp܂B
-
-<H3>\bhꗗ</H3>
-ȉ̃\bhp”\łB
-uLvƂ BigDecimal xۏ؂錅łB
-҂ł͂܂A኱̗]TČvZ܂B
-܂AႦ΂RQrbg̃VXeł͂POiłSɌvZ܂B]āAł́A
-́uLv͂S̔{ƂȂĂ܂B
-<P>
-ȉ̃\bhȊOɂA(C ł͂Ȃ) Ruby \[X̌`
-񋟂Ă̂܂BႦ΁A
-<CODE><PRE>
-require "bigdecimal/math.rb"
-</PRE></CODE>
-Ƃ邱ƂŁAsin cos Ƃ֐gpł悤ɂȂ܂B
-gp@ȂǁAڍׂ math.rb ̓eQƂĉB
-
-̑AFloat Ƃ̑ݕϊȂǂ̃\bh util.rb ŃT|[gĂ܂B
-pɂ
-<CODE><PRE>
-require "bigdecimal/util.rb"
-</PRE></CODE>
-̂悤ɂ܂Bڍׂ util.rb ̓eQƂĉB
-
-<H4><U>NX\bh</U></H4>
-<UL>
-<LI><B>new</B></LI><BLOCKQUOTE>
-V BigDecimal IuWFNg𐶐܂B<BR>
-a=BigDecimal::new(s[,n]) ܂<BR>
-a=BigDecimal(s[,n])<BR>
-s ͐\鏉l𕶎Ŏw肵܂B
-Xy[X͖܂B܂AfłȂo_
-͏ÎƂ݂Ȃ܂B
-n ͕KvȗLia ̍őLj𐮐Ŏw肵܂B
-n 0 ܂͏ȗꂽƂ́An ̒l s ̗LƂ݂Ȃ܂B
-s ̗L n Ƃ n=0 ̂ƂƓłB
-a ̍őL n ኱傢l̗p܂B
-őL͈ȉ̂悤ȊZsƂɈӖ܂B
-<CODE><PRE>
-BigDecimal("1") / BigDecimal("3") # => 0.3333333333 33E0
-BigDecimal("1",10) / BigDecimal("3",10) # => 0.3333333333 3333333333 33333333E0
-</PRE></CODE>
-AX̉ZɂőL n ̎舵͏̃o[W
-኱ύX”\܂B
-</BLOCKQUOTE>
-
-<LI><B>mode</B></LI><BLOCKQUOTE>
-f = BigDecimal.mode(s[,v])<BR>
-BigDecimal̎sʂ𐧌䂵܂BQȗA܂ nil w肷
-̐ݒl߂܂B<BR>
-ȉ̎gp@`Ă܂B
-<P>
-<B>[O]</B><P>
-vZʂ(NaN)[ɂ鏜ZɂȂƂ̏`邱Ƃł܂B
-<BLOCKQUOTE>
-f = BigDecimal::mode(BigDecimal::EXCEPTION_NaN,flag)<BR>
-f = BigDecimal::mode(BigDecimal::EXCEPTION_INFINITY,flag)<BR>
-f = BigDecimal::mode(BigDecimal::EXCEPTION_UNDERFLOW,flag)<BR>
-f = BigDecimal::mode(BigDecimal::EXCEPTION_OVERFLOW,flag)<BR>
-f = BigDecimal::mode(BigDecimal::EXCEPTION_ZERODIVIDE,flag)<BR>
-f = BigDecimal::mode(BigDecimal::EXCEPTION_ALL,flag)<BR>
-</BLOCKQUOTE>
-
-EXCEPTION_NaN ͌ʂ NaN ɂȂƂ̎włB<BR>
-EXCEPTION_INFINITY ͌ʂ(}Infinity)ɂȂƂ̎włB<BR>
-EXCEPTION_UNDERFLOW ͎wA_[t[Ƃ̎włB<BR>
-EXCEPTION_OVERFLOW ͎wI[o[t[Ƃ̎włB<BR>
-EXCEPTION_ZERODIVIDE ̓[ɂ銄ZsƂ̎włB<BR>
-EXCEPTION_ALL ́A”\ȑSĂɑ΂ĈꊇĐݒ肷ƂɎgp܂B<BR><BR>
-
-flag true ̂Ƃ́Aw肵ԂɂȂƂɗO𔭍s悤ɂȂ܂B<BR>
-flag falseiftHgjȂAO͔s܂BvZʂ͈ȉ̂悤ɂȂ܂B<BR>
-<BLOCKQUOTE>
-EXCEPTION_NaN ̂ƂA(NaN)<BR>
-EXCEPTION_INFINITY ̂ƂA(+ or -Infinity)<BR>
-EXCEPTION_UNDERFLOW ̂ƂA[<BR>
-EXCEPTION_OVERFLOW ̂ƂA+Infinity -Infinity<BR>
-EXCEPTION_ZERODIVIDE ̂ƂA+Infinity -Infinity<BR>
-</BLOCKQUOTE>
-EXCEPTION_INFINITYAEXCEPTION_OVERFLOWAEXCEPTION_ZERODIVIDE
-͍̂Ƃ듯łB<BR>
-߂ĺAݒ̒lłBulv̈Ӗ́AႦ
-BigDecimal::EXCEPTION_NaNƁulv & [ȊOȂ
-EXCEPTION_NaNݒ肳ĂƂӖłB
-
-<P>
-<B>[ۂߏw]</B><P>
-vZr̊ۂߑ̎w肪ł܂B
-<BLOCKQUOTE>
-f = BigDecimal::mode(BigDecimal::ROUND_MODE,flag)
-</BLOCKQUOTE>
-̌`Ŏw肵܂B<BR>
-ŁAflag ͈ȉ(ʓ͑ΉCX^X\bh)̈‚w肵܂B
-<TABLE>
-<TR><TD>ROUND_UP</TD><TD>SĐ؂グ܂B</TD></TR>
-<TR><TD>ROUND_DOWN</TD><TD>SĐ؂̂Ă܂(truncate)B</TD></TR>
-<TR><TD>ROUND_HALF_UP</TD><TD>ľܓ܂(ftHg)B</TD></TR>
-<TR><TD>ROUND_HALF_DOWN</TD><TD>܎̘Z܂B</TD></TR>
-<TR><TD>ROUND_HALF_EVEN</TD><TD>l̘Z܂BT̎͏ʂP̎̂݌Jグ܂(Banker's rounding)B</TD></TR>
-<TR><TD>ROUND_CEILING</TD><TD>l̑傫ɌJグ܂(ceil)B</TD></TR>
-<TR><TD>ROUND_FLOOR</TD><TD>l̏ɌJ艺܂(floor)B</TD></TR>
-
-</TABLE>
-߂l͎w flag ̒lłB
-Q nil w肷ƁA̐ݒlԂ܂B
-mode \bhł͊ۂߑ̈ʒu[Uw肷邱Ƃ͂ł܂B
-ۂߑƈʒuŐ䂵ꍇ BigDecimal::limit truncate/round/ceil/floorA
-add/sub/mult/div ƂCX^X\bhgpĉB
-</BLOCKQUOTE>
-<LI><B>limit([n])</B></LI><BLOCKQUOTE>
-BigDecimalIuWFNg̍ő包nɐ܂B
-߂l͐ݒ肷O̒lłBݒl̃ftHgl͂OŁAƂӖłB
-n w肵ȂA܂ n nil ̏ꍇ́A̍ő包Ԃ܂B<BR>
-vZ𑱍sԂɁǍɑĂ܂悤ȏꍇ
- limit ŗ\ߌ𐧌ł܂B̏ꍇ BigDecimal.mode Ŏw肳ꂽ
-ۂߏs܂B
-ACX^X\bh (truncate/round/ceil/floor/add/sub/mult/div)
- limit D悳܂B<BR>
-mf = BigDecimal::limit(n)<BR>
-</BLOCKQUOTE>
-
-<LI><B>double_fig</B></LI><BLOCKQUOTE>
-Ruby Float NXێłL̐Ԃ܂B
-<CODE><PRE>
- p BigDecimal::double_fig # ==> 20 (depends on the CPU etc.)
-</PRE></CODE>
-double_fig͈ȉ C vǑʂƓłB
-<CODE><PRE>
- double v = 1.0;
- int double_fig = 0;
- while(v + 1.0 > 1.0) {
- ++double_fig;
- v /= 10;
- }
-</PRE></CODE>
-</BLOCKQUOTE>
-
-<LI><B>BASE</B></LI><BLOCKQUOTE>
-Ŏgp̒lłB 32 rbg̏nł10000łB<BR>
-b = BigDecimal::BASE<BR>
-</BLOCKQUOTE>
-</UL>
-
-<H4><U>CX^X\bh</U></H4>
-<UL>
-<LI><B>+</B></LI><BLOCKQUOTE>
-Zic = a + bj<BR>
-c ̐xɂ‚Ắu<A HREF="#PREC">vZxɂ‚</A>vQƂĂB
-</BLOCKQUOTE>
-
-<LI><B>-</B></LI><BLOCKQUOTE>
-Zic = a - bjA܂͕]ic = -aj<BR>
-c ̐xɂ‚Ắu<A HREF="#PREC">vZxɂ‚</A>vQƂĂB
-
-</BLOCKQUOTE>
-<LI><B>*</B></LI><BLOCKQUOTE>
-Z(c = a * b)<BR>
-c̐x(a̐x)+(b̐x)xłB<br>
-ڂ́u<A HREF="#PREC">vZxɂ‚</A>vQƂĂB
-
-</BLOCKQUOTE>
-<LI><B>/</B></LI><BLOCKQUOTE>
-Z(c = a / b)<BR>
-c ̐xɂ‚Ắu<A HREF="#PREC">vZxɂ‚</A>vQƂĂB
-
-</BLOCKQUOTE>
-
-<LI><B>add(b,n)</B></LI><BLOCKQUOTE>
-ȉ̂悤Ɏgp܂B<BR>
-c = a.add(b,n)<BR>
-c = a + b ő n ܂ŌvZ܂B<BR>
-a + b ̐x n 傫Ƃ BigDecimal.mode Ŏw肳ꂽ@Ŋۂ߂܂B<BR>
-n [Ȃ + ƓłB
-</BLOCKQUOTE>
-<LI><B>sub(b,n)</B></LI><BLOCKQUOTE>
-ȉ̂悤Ɏgp܂B<BR>
-c = a.sub(b,n)<BR>
-c = a - b ő n ܂ŌvZ܂B<BR>
-a - b ̐x n 傫Ƃ BigDecimal.mode Ŏw肳ꂽ@Ŋۂ߂܂B<BR>
-n [Ȃ - ƓłB
-
-</BLOCKQUOTE>
-<LI><B>mult(b,n)</B></LI><BLOCKQUOTE>
-ȉ̂悤Ɏgp܂B<BR>
-c = a.mult(b,n)<BR>
-c = a * b ő n ܂ŌvZ܂B<BR>
-a * b ̐x n 傫Ƃ BigDecimal.mode Ŏw肳ꂽ@Ŋۂ߂܂B<BR>
-n [Ȃ * ƓłB
-
-</BLOCKQUOTE>
-<LI><B>div(b[,n])</B></LI><BLOCKQUOTE>
-ȉ̂悤Ɏgp܂B<BR>
-c = a.div(b,n)<BR>
-c = a / b ő n ܂ŌvZ܂B
-a / b ̐x n 傫Ƃ BigDecimal.mode Ŏw肳ꂽ@Ŋۂ߂܂B<BR>
-n [Ȃ / ƓłB<BR>
-n ȗꂽƂ Float#div ƓlɌʂ(BigDecimal)ɂȂ܂B
-</BLOCKQUOTE>
-
-<LI><B>fix</B></LI><BLOCKQUOTE>
-a ̏_ȉ̐؂̂āB<BR>
-c = a.fix
-</BLOCKQUOTE>
-<LI><B>frac</B></LI><BLOCKQUOTE>
-a ̐̐؂̂āB<BR>
-c = a.frac
-</BLOCKQUOTE>
-
-<LI><B>floor[(n)]</B></LI><BLOCKQUOTE>
-c = a.floor<BR>
-a ȉ̍ő吮iBigDecimal ljԂ܂B
-<CODE><PRE>
-c = BigDecimal("1.23456").floor # ==> 1
-c = BigDecimal("-1.23456").floor # ==> -2
-</PRE></CODE>
-ȉ̂悤Ɉ n ^邱Ƃł܂B<BR>
-n>=0 ȂA_ȉ n+1 ʂ̐𑀍삵܂(_ȉAő n ɂ܂)B<BR>
-n ̂Ƃ͏_ȏ n ڂ𑀍삵܂(_ʒu獶ɏȂƂ n ‚ 0 т܂)B<BR>
-<CODE><PRE>
- c = BigDecimal("1.23456").floor(4) # ==> 1.2345
- c = BigDecimal("15.23456").floor(-1) # ==> 10.0
-</PRE></CODE>
-
-</BLOCKQUOTE>
-<LI><B>ceil[(n)]</B></LI><BLOCKQUOTE>
-c = a.ceil<BR>
-a ȏ̐̂AłvZA̒liBigDecimal ljԂ܂B
-<CODE><PRE>
-c = BigDecimal("1.23456").ceil # ==> 2
-c = BigDecimal("-1.23456").ceil # ==> -1
-</PRE></CODE>
-
-ȉ̂悤Ɉ^āA_ȉ n+1 ʂ̐𑀍삷邱Ƃł܂B<BR>
-n>=0 ȂA_ȉ n+1 ʂ̐𑀍삵܂(_ȉAő n ɂ܂)B<BR>
- n ̂Ƃ͏_ȏ n ڂ𑀍삵܂(_ʒu獶ɏȂƂ n ‚ 0 т܂)B<BR>
-<CODE><PRE>
- c = BigDecimal("1.23456").ceil(4) # ==> 1.2346
- c = BigDecimal("15.23456").ceil(-1) # ==> 20.0
-</PRE></CODE>
-
-</BLOCKQUOTE>
-<LI><B>round[(n[,b])]</B></LI><BLOCKQUOTE>
-c = a.round<BR>
-
-NX\bh BigDecimal::mode(BigDecimal::ROUND_MODE,flag) Ŏw肵
-ROUND_MODE ɏ]Ċۂߑs܂B
-BigDecimal::mode(BigDecimal::ROUND_MODE,flag) ʼnw肹AA
-w肵Ȃꍇ́u_ȉʂ̐ľܓĐiBigDecimal ljvɂ܂B<BR>
-<CODE><PRE>
- c = BigDecimal("1.23456").round # ==> 1
- c = BigDecimal("-1.23456").round # ==> -1
-</PRE></CODE>
-
-ȉ̂悤Ɉ^āA_ȉ n+1 ʂ̐𑀍삷邱Ƃł܂B<BR>
-n ̎́A_ȉ n+1 ʂ̐ۂ߂܂(_ȉAő n ɂ܂)B<BR>
-n ̂Ƃ͏_ȏ n ڂۂ߂܂(_ʒu獶ɏȂƂ n ‚ 0 т܂)B
-<CODE><PRE>
-c = BigDecimal("1.23456").round(4) # ==> 1.2346
-c = BigDecimal("15.23456").round(-1) # ==> 20.0
-</PRE></CODE>
-QԖڂ̈w肷ƁABigDecimal#mode ̎w𖳎āAw肳ꂽ@
-ۂߑs܂B
-<CODE><PRE>
-c = BigDecimal("1.23456").round(3,BigDecimal::ROUND_HALF_EVEN) # ==> 1.234
-c = BigDecimal("1.23356").round(3,BigDecimal::ROUND_HALF_EVEN) # ==> 1.234
-</PRE></CODE>
-
-</BLOCKQUOTE>
-<LI><B>truncate</B></LI><BLOCKQUOTE>
-c = a.truncate<BR>
-_ȉ̐؂̂ĂĐiBigDecimal ljɂ܂B<BR>
-ȉ̂悤Ɉ^āA_ȉ n+1 ʂ̐𑀍삷邱Ƃł܂B<BR>
-n ̎́A_ȉ n+1 ʂ̐؂̂Ă܂(_ȉAő n ɂ܂)B
-n ̂Ƃ͏_ȏ n ڂ𑀍삵܂(_ʒu獶ɏȂƂ n ‚ 0 т܂)B<BR>
-<CODE><PRE>
-c = BigDecimal("1.23456").truncate(4) # ==> 1.2345
-c = BigDecimal("15.23456").truncate(-1) # ==> 10.0
-</PRE></CODE>
-</BLOCKQUOTE>
-
-</BLOCKQUOTE>
-<LI><B>abs</B></LI><BLOCKQUOTE>
-̐Βl<BR>
-c = a.abs<BR>
-
-</BLOCKQUOTE>
-<LI><B>to_i</B></LI><BLOCKQUOTE>
-_ȉ؂̂ĂĐɕϊ܂B<BR>
-i = a.to_i<BR>
-i ͒lɉ Fixnum Bignum ɂȂ܂B
-a Infinity NaN ̂ƂAi nil ɂȂ܂B
-</BLOCKQUOTE>
-<LI><B>to_f</B></LI><BLOCKQUOTE>
-Float IuWFNgɕϊ܂B
-肫ߍׂlKvȂ split \bh𗘗p
-B
-</BLOCKQUOTE>
-<LI><B>to_s[(n)]</B></LI><BLOCKQUOTE>
-ɕϊ܂(ftHg "0.xxxxxEn" ̌`ɂȂ܂jB
-<CODE><PRE>
-BigDecimal("1.23456").to_s # ==> "0.123456E1"
-</PRE></CODE>
- n ɐ̐w肳ꂽƂ́A_ŕ鍶EAꂼ n
-ɋ󔒂ŋ؂܂B
-<CODE><PRE>
-BigDecimal("0.1234567890123456789").to_s(10) # ==> "0.1234567890 123456789E0"
-</PRE></CODE>
- n ɐ̐\w肷邱Ƃł܂B
-<CODE><PRE>
-BigDecimal("0.1234567890123456789").to_s("10") # ==> "0.1234567890 123456789E0"
-</PRE></CODE>
-̍ŏ '+'i܂ ' 'jtƁAl̏ꍇA擪 '+'i܂ ' 'jt܂
-ȉꍇ́A '-' t܂BjB
-<CODE><PRE>
-BigDecimal("0.1234567890123456789").to_s(" 10") # ==> " 0.1234567890 123456789E0"
-BigDecimal("0.1234567890123456789").to_s("+10") # ==> "+0.1234567890 123456789E0"
-BigDecimal("-0.1234567890123456789").to_s("10") # ==> "-0.1234567890 123456789E0"
-</PRE></CODE>
-
-ɕ̍Ō E(܂ e) F(܂ f) w肷邱ƂŁAȉ̂悤
-\`ύX邱Ƃł܂B
-<CODE><PRE>
-BigDecimal("1234567890.123456789").to_s("E") # ==> "0.1234567890123456789E10"
-BigDecimal("1234567890.123456789").to_s("F") # ==> "1234567890.123456789"
-BigDecimal("1234567890.123456789").to_s("5E") # ==> "0.12345 67890 12345 6789E10"
-BigDecimal("1234567890.123456789").to_s("5F") # ==> "12345 67890.12345 6789"
-</PRE></CODE>
-
-</BLOCKQUOTE>
-<LI><B>exponent</B></LI><BLOCKQUOTE>
-w𐮐lŕԂ܂B
-n = a.exponent <BR>
- a ̒l 0.xxxxxxx*10**n Ӗ܂B
-</BLOCKQUOTE>
-
-<LI><B>precs</B></LI><BLOCKQUOTE>
-n,m = a.precs<BR>
-a ̗L (n) ƍőL (m) ̔zԂ܂B
-
-</BLOCKQUOTE>
-
-<LI><B>sign</B></LI><BLOCKQUOTE>
-l(sign &gt; 0)A(sign &lt; 0)Ȃ(sigh==0)ł邩̏Ԃ܂B
-n = a.sign <BR>
-ƂƂ n ̒l a ȉ̂ƂӖ܂B<BR>
-() ̒̐́Aۂ̒lł(<A HREF="#STRUCT">u\v</A>Q)B<BR>
-n = BigDecimal::SIGN_NaN(0) : a NaN<BR>
-n = BigDecimal::SIGN_POSITIVE_ZERO(1) : a +0<BR>
-n = BigDecimal::SIGN_NEGATIVE_ZERO(-1) : a -0<BR>
-n = BigDecimal::SIGN_POSITIVE_FINITE(2) : a ͐̒l<BR>
-n = BigDecimal::SIGN_NEGATIVE_FINITE(-2) : a ͕̒l<BR>
-n = BigDecimal::SIGN_POSITIVE_INFINITE(3) : a +Infinity<BR>
-n = BigDecimal::SIGN_NEGATIVE_INFINITE(-3) : a -Infinity<BR>
-
-</BLOCKQUOTE>
-<LI><B>nan?</B></LI><BLOCKQUOTE>
-a.nan? a NaN̂Ƃ^Ԃ܂B
-</BLOCKQUOTE>
-<LI><B>infinite?</B></LI><BLOCKQUOTE>
-a.infinite? a +̂Ƃ 1 A-̂Ƃ -1AȊÔƂ nil Ԃ܂B
-</BLOCKQUOTE>
-<LI><B>finite?</B></LI><BLOCKQUOTE>
-a.finite? a ܂ NaN łȂƂ^Ԃ܂B
-</BLOCKQUOTE>
-
-<LI><B>zero?</B></LI><BLOCKQUOTE>
-a 0 Ȃ true ɂȂ܂B<BR>
-c = a.zero?
-</BLOCKQUOTE>
-<LI><B>nonzero?</B></LI><BLOCKQUOTE>
-a 0 Ȃ nilA0 ȊOȂ a ̂̂Ԃ܂B<BR>
-c = a.nonzero?
-
-</BLOCKQUOTE>
-<LI><B>split</B></LI><BLOCKQUOTE>
-BigDecimal l 0.xxxxxxx*10**n ƕ\ƂɁAiNaN̂Ƃ
-0AȊO+1-1ɂȂ܂jA
-̕i"xxxxxxx"jƁAi10jAXɎw n z
-Ԃ܂B<BR>
-a=BigDecimal::new("3.14159265")<BR>
-f,x,y,z = a.split<BR>
-ƂƁAf=+1Ax="314159265"Ay=10Az=1ɂȂ܂B<BR>
-]āA<BR>
-s = "0."+x<BR>
-b = f*(s.to_f)*(y**z)<BR>
- Float ɕϊ邱Ƃł܂B
-</BLOCKQUOTE>
-<LI><B>inspect</B></LI><BLOCKQUOTE>
-fobOo͂Ɏgp܂B<BR>
-p a=BigDecimal::new("3.14",10)<BR>
-ƂƁA[0x112344:'0.314E1',4(12)]̂悤ɏo͂܂B
-ŏ16i̓IuWFNg̃AhXA '0.314E1' ͒lA
-4݂̗͌L(\኱傫Ƃ܂)A
-Ō̓IuWFNg蓾ő包ɂȂ܂B
-</BLOCKQUOTE>
-<LI><B>**</B></LI><BLOCKQUOTE>
-a n vZ܂B͐B<BR>
-c = a ** n<BR>
-ʂƂ c ̗L a n {ȏɂȂ̂ŒӁB
-</BLOCKQUOTE>
-<LI><B>power</B></LI><BLOCKQUOTE>
-** ƓŁAa n vZ܂B͐B<BR>
-c = a.power(n)<BR>
-ʂƂ c ̗L a n {ȏɂȂ̂ŒӁB
-</BLOCKQUOTE>
-<LI><B>sqrt</B></LI><BLOCKQUOTE>
-a̗L n ̕in ̕ł͂܂j
-j[g@ŌvZ܂B<BR>
-c = a.sqrt(n)<BR>
-</BLOCKQUOTE>
-
-<LI><B>divmod,quo,modulo,%,remainder</B></LI><BLOCKQUOTE>
-ڍׂ͑Ή Float ̊e\bhQƂĉB
-</BLOCKQUOTE>
-
-<LI><B>&lt=&gt</B></LI><BLOCKQUOTE>
-a==b Ȃ 0Aa &gt b Ȃ 1Aa &lt b Ȃ -1 ɂȂ܂B<BR>
-c = a &lt=&gt b
-</BLOCKQUOTE>
-</UL>
-́AǂŎ̔@łB<BR>
-<UL>
-<LI><B>==</B></LI>
-<LI><B>===</B></LI>
-u==vƓł case Ŏgp܂B
-<LI><B>!=</B></LI>
-<LI><B>&lt</B></LI>
-<LI><B>&lt=</B></LI>
-<LI><B>&gt</B></LI>
-<LI><B>&gt=</B></LI>
-</UL>
-
-<H3>coerceɂ‚</H3>
-BigDecimal IuWFNgZpZq̍ɂƂ́ABigDecimal IuWFNg
-EɂIuWFNg(KvȂ) BigDecimal ɕϊĂvZ܂B
-]āABigDecimal IuWFNgȊOłlӖ̂ȂEɒu
-Z͉”\łB<BR>
-ÁiʏjlɎϊ邱Ƃ͂ł܂B
-𐔒lɎϊꍇ bigfloat.c
-u/* #define ENABLE_NUMERIC_STRING */ṽRgOĂA
-ăRpCAăCXg[Kv܂B
-Ől^ꍇ͒ӂKvłBlɕϊłȂƁA
-Pɕϊ~߂邾ŃG[ɂ͂Ȃ܂B"10XX"ȂPOA"XXXX"͂O
-ƈ܂B<BR>
-<CODE><PRE>
- a = BigDecimal.E(20)
- c = a * "0.123456789123456789123456789" # BigDecimal ɕϊĂvZ
-</PRE></CODE>
-񐔂\ƂāA"Infinity"A"+Infinity"A"-Infinity"A"NaN"
-gpł܂(啶Eʂ܂)BAmode \bh false
-w肵ꍇ͗O܂B
-<BR>
-܂ABigDecimalNX coerceiRuby{QƁjT|[gĂ܂B
-]āABigDecimal IuWFNgEɂꍇ͑vłB
-A݂ Ruby C^v^̎dlA񂪍ɂƌvZł܂B<BR>
-<CODE><PRE>
- a = BigDecimal.E(20)
- c = "0.123456789123456789123456789" * a # G[
-</PRE></CODE>
-KvƂ͎v܂񂪁AǂĂƌl
- String IuWFNgpVȃNX쐬ĂA
-̃NX coerce T|[gĂB
-
-<hr>
-<A NAME="#UNDEF">
-<H2>A񐔁A[̈</H2>
-uvƂ͕\łȂ炢傫ȐłBʂɈ߂
- +Infinityi̖j -Infinityi̖jƂ
-悤ɕ\L܂B
- 1.0/0.0 ̂悤Ƀ[Ŋ悤ȌvZƂɐ܂B
-<BR><BR>
-u񐔁v 0.0/0.0 Infinity-Infinity ̌ʂ`łȂ
-vZƂɐ܂B񐔂 NaNiNot a Numberjƕ\L܂B
-NaN ܂ތvZ͑S NaN ɂȂ܂B܂ NaN ͎܂߂āAǂȐ
-Ƃv܂B
-<BR><BR>
-[ +0.0 -0.0 ݂܂BA+0.0==-0.0 true łB
-<BR><BR>
-InfinityANaNA +0.0 -0.0 ܂񂾌vZʂ͑gݍ킹
-蕡GłB̂ĺAȉ̃vOsČʂ
-mFĂiʂɂ‚āA^ԈႢ𔭌ꂽ
-m点肢܂jB
-
-<PRE>
-<CODE>
-require "bigdecimal"
-
-aa = %w(1 -1 +0.0 -0.0 +Infinity -Infinity NaN)
-ba = %w(1 -1 +0.0 -0.0 +Infinity -Infinity NaN)
-opa = %w(+ - * / <=> > >= < == != <=)
-
-for a in aa
- for b in ba
- for op in opa
- x = BigDecimal::new(a)
- y = BigDecimal::new(b)
- eval("ans= x #{op} y;print a,' ',op,' ',b,' ==> ',ans.to_s,\"\n\"")
- end
- end
-end
-</CODE>
-</PRE>
-
-<hr>
-<A NAME="#STRUCT">
-<H2>\</H2>
-BigDecimalŕ_͍\(Real)ŕ\܂B
-̂ unsigned long ̔z(ȉ̍\̗vffrac)ŊǗ܂B
-TOIɂ́Aȉ̂悤ɂȂ܂B<BR><BR>
- <_> = 0.xxxxxxxxx*BASE**n<BR><BR>
-ŁAx͉\ABASE͊iPOiȂPOjAn͎w\
-lłBBASE傫قǁA傫Ȑl\ł܂B‚܂Az̃TCY
-Ȃł܂BBASE͑傫قǓs悢킯łAfobÔ₷Ȃǂ
-lāA10000ɂȂĂ܂iBASEVpInit()֐ŎIɌvZ܂jB
-́A32rbg̏ꍇłB64rbg̏ꍇ͂Ƒ傫ȒlɂȂ܂B
-cOȂA64rbgł̃eXg͂܂Ă܂iAꂽ
-ʂĂ΂肪łjB
-BASE10000̂Ƃ́Aȉ̉̔z(frac)̊evfɂ͍őłS
-i[܂B<BR><BR>
-_\(Real)͈ȉ̂悤ɂȂĂ܂B
-<BR>
-<CODE><PRE>
- typedef struct {
- unsigned long MaxPrec; // ő吸x(frac[]̔zTCY)
- unsigned long Prec; // x(frac[]̎gpTCY)
- short sign; // ȉ̂悤ɕ̏Ԃ`܂B
- // ==0 : NaN
- // 1 : +0
- // -1 : -0
- // 2 : ̒l
- // -2 : ̒l
- // 3 : +Infinity
- // -3 : -Infinity
- unsigned short flag; // e̐tbO
- int exponent; // w̒l(*BASE**exponent)
- unsigned long frac[1]; // ̔z(•)
- } Real;
-</CODE></PRE>
-Ⴆ 1234.56784321 Ƃ(BASE=10000Ȃ)<BR>
-<PRE>
- 0.1234 5678 4321*(10000)**1
-</PRE>
-ł frac[0]=1234Afrac[1]=5678Afrac[2]=4321A
-Prec=3Asign=2Aexponent=1 ƂȂ܂BMaxPrec
-Prec 傫΂‚ł܂܂Bflag
-gp@͎ɈˑēŎgp܂B
-
-<hr>
-<A NAME="#BASE">
-<H2>2i10i</H2>
-BigDecimal <_> = 0.xxxxxxxxx*10**n Ƃ10i`Őlێ܂B
-AvZ@̕_̓\́A܂łȂ <_> = 0.bbbbbbbb*2**n Ƃ
-2i`ʂł(x 0 9 ܂ŁAb 0 1 ̐)B
-BigDecimal Ȃ10i̓\`̗p̂ȉɐ܂B
-<H4>10ĩbg</H4>
-<DL>
-<DT>fobÔ₷
-<DD>܂AvO쐬yłBfrac[0]=1234Afrac[1]=5678Afrac[2]=4321A
-exponent=1Asign=2 Ȃ琔l 1234.56784321 ł̂͌Βɕ܂B
-
-<DT>10i\LꂽlȂmɓ\ɕϊł
-<DD>Ⴆ΁Aȉ̂悤ȃvO͑S덷
-vZ邱Ƃł܂Bȉ̗́AsɈ‚̐l
-Ăt@C file ̍vl߂̂łB
-<CODE><PRE>
- file = File::open(....,"r")
- s = BigDecimal::new("0")
- while line = file.gets
- s = s + line
- end
-</PRE></CODE>
-̗2iłƌ덷荞މ”\܂B
-Ⴆ 0.1 2iŕ\ 0.1 = b1*2**(-1)+b1*2**(-2)+b3*2**(-3)+b4*2**(-4)....
-ƖɑĂ܂܂(b1=0,b2=0,b3=0,b4=1...)B bn(n=1,2,3,...)
-2i\ 0 1 ̐łB]āAǂőł؂Kv܂B
-ŕϊ덷܂BAēx10i\LɂĈ悤
-ꍇ͓K؂ȊۂߑiľܓjɂčĂ "0.1" ƕ\܂BA
-ł͐m 0.1 ł͂܂B
-
-<DT>L͗Lłi‚܂莩łj
-<DD>0.1 \邽߂̗̈͂‚̔zvfi frac[0]=1 jōς݂܂B
-zvf̐10il玩IɌł܂B́A•ϒ_Zł
-厖ȂƂłBt 0.1 2i\Ƃɂ2i̗L‚ɂ̂ 0.1
-ł͌ł܂B
-</DL>
-
-<H3>10ĩfbg</H3>
-͍܂ł̃bǵÂ܂܃fbgɂȂ܂B
-A10i2iɕϊ悤ȑ͕ϊ덷
-𔺂ꍇ邱Ƃ͂ł܂B
-T̃Rs[^10i̓\ĂȂ̂ŁA
-BigDecimal 𗘗pČ덷̌vZꍇ́AvZx
-𖳎ĂŌ܂ BigDecimal gpKv܂B
-
-<H3>ŏ͉H</H3>
-ŌvZƂɂ킴킴2igl͋ɂ߂Ă܂łB
-vZ@Ƀf[^͂ƂقƂǂ̏ꍇA
-10iœ͂܂B̌ʁAdouble ̌vZ@
-\͍ŏ덷Ăꍇ܂B
-BigDecimal ̓[U͂덷Ŏ荞ނƂł܂B
-fobO₷̂ƁAf[^ǂ݂ݎɌ덷Ȃ
-Ƃ̂ۂ̃bgłB
-
-<hr>
-<A NAME="#PREC">
-<H2>vZxɂ‚</H2>
-c = a op b ƂvZ(op + - * /)Ƃ̓
-ȉ̂悤ɂȂ܂B<BR><BR>
-PDZ(a ̗L)+(b ̗L)A
-Z(a ̍őL)+(b ̍őL)̍ő包iۂ́A]TāA
-傫Ȃ܂j•ϐ c Vɐ܂B
-Z̏ꍇ́A덷oȂ̐x c 𐶐܂BႦ
- c = 0.1+0.1*10**(-100) ̂悤ȏꍇAc ̐x͂POOȏ̐x
-‚悤ɂȂ܂B
-<BR><BR>
-QD c = a op b ̌vZs܂B<BR><BR>
-̂悤ɁAZƏZł c ͕Ku덷oȂv̐x
-Đ܂(BigDecimal.limit w肵Ȃꍇ)B
-Z(a ̍őL)+(b ̍őL)̍ő包
- c ܂Ac = 1.0/3.0 ̂悤ȌvZŖ炩Ȃ悤ɁA
- c ̍ő吸x𒴂ƂŌvZł؂ꍇ܂B<BR><BR>
-ɂAc ̍ő吸x a b 傫Ȃ܂̂ c KvƂ
-[̈͑傫Ȃ邱ƂɒӂĉB
-<BR><BR>
-ӁFu+,-,*,/vł͌ʂ̐xiLjŎwł܂B
-xRg[ꍇ́Aȉ̃CX^X\bhgp܂B<BR>
-<UL>
-<LI>add,sub,mult,div</LI><BLOCKQUOTE>
-̃\bh͐擪(ō)̐̌wł܂B
-<CODE><PRE>
- BigDecimal("2").div(3,12) # 2.0/3.0 => 0.6666666666 67E0
-</PRE></CODE>
-</BLOCKQUOTE>
-<LI>truncate,round,ceil,floor</LI><BLOCKQUOTE>
-̃\bh͏_̑Έʒuw肵Č肵܂B
-<CODE><PRE>
- BigDecimal("6.66666666666666").round(12) # => 0.6666666666 667E1
-</PRE></CODE>
-</BLOCKQUOTE>
-</UL>
-<H3>ŐxRg[ꍇ</H3>
-Őx(L)Rg[ꍇ addAsubAmultAdiv ̃\bh
-gpł܂B
-ȉ̉~vZvÔ悤ɁA
-߂錅͎Ŏw肷邱Ƃł܂B
-<BR><BR>
-<CODE><PRE>
-#!/usr/local/bin/ruby
-
-require "bigdecimal"
-#
-# Calculates 3.1415.... (the number of times that a circle's diameter
-# will fit around the circle) using J. Machin's formula.
-#
-def big_pi(sig) # sig: Number of significant figures
- exp = -sig
- pi = BigDecimal::new("0")
- two = BigDecimal::new("2")
- m25 = BigDecimal::new("-0.04")
- m57121 = BigDecimal::new("-57121")
-
- u = BigDecimal::new("1")
- k = BigDecimal::new("1")
- w = BigDecimal::new("1")
- t = BigDecimal::new("-80")
- while (u.nonzero? && u.exponent >= exp)
- t = t*m25
- u = t.div(k,sig)
- pi = pi + u
- k = k+two
- end
-
- u = BigDecimal::new("1")
- k = BigDecimal::new("1")
- w = BigDecimal::new("1")
- t = BigDecimal::new("956")
- while (u.nonzero? && u.exponent >= exp )
- t = t.div(m57121,sig)
- u = t.div(k,sig)
- pi = pi + u
- k = k+two
- end
- pi
-end
-
-if $0 == __FILE__
- if ARGV.size == 1
- print "PI("+ARGV[0]+"):\n"
- p big_pi(ARGV[0].to_i)
- else
- print "TRY: ruby pi.rb 1000 \n"
- end
-end
-
-</PRE></CODE>
-<HR>
-<FONT size=2>
-<I>
-<A HREF="http://www.tinyforest.gr.jp">
- ΗY
-</A>
-(E-Mail:<A HREF="mailto:shigeo@tinyforest.gr.jp">&ltshigeo@tinyforest.gr.jp&gt</U></A>)
-</I>
-</FONT>
-</TD>
-</TR>
-</TABLE>
-</BODY>
-</HTML>
diff --git a/ext/bigdecimal/lib/bigdecimal/jacobian.rb b/ext/bigdecimal/lib/bigdecimal/jacobian.rb
index 8ab836259a..a416e06832 100644
--- a/ext/bigdecimal/lib/bigdecimal/jacobian.rb
+++ b/ext/bigdecimal/lib/bigdecimal/jacobian.rb
@@ -11,7 +11,7 @@
#
# f.zero:: returns 0.0
# f.one:: returns 1.0
-# f.two:: returns 1.0
+# f.two:: returns 2.0
# f.ten:: returns 10.0
#
# f.eps:: returns the convergence criterion (epsilon value) used to determine whether two values are considered equal. If |a-b| < epsilon, the two values are considered equal.
@@ -53,7 +53,8 @@ module Jacobian
until ok>0 do
s = f.zero
deriv = []
- if(nRetry>100) then
+ nRetry += 1
+ if nRetry > 100
raise "Singular Jacobian matrix. No change at x[" + i.to_s + "]"
end
dx = dx*f.two
diff --git a/ext/bigdecimal/lib/bigdecimal/math.rb b/ext/bigdecimal/lib/bigdecimal/math.rb
index 03c59bfccb..16cf9c8731 100644
--- a/ext/bigdecimal/lib/bigdecimal/math.rb
+++ b/ext/bigdecimal/lib/bigdecimal/math.rb
@@ -7,7 +7,6 @@ require 'bigdecimal'
# sin (x, prec)
# cos (x, prec)
# atan(x, prec) Note: |x|<1, x=0.9999 may not converge.
-# log (x, prec)
# PI (prec)
# E (prec) == exp(1.0,prec)
#
diff --git a/ext/bigdecimal/lib/bigdecimal/newton.rb b/ext/bigdecimal/lib/bigdecimal/newton.rb
index 96defc3c06..1110652801 100644
--- a/ext/bigdecimal/lib/bigdecimal/newton.rb
+++ b/ext/bigdecimal/lib/bigdecimal/newton.rb
@@ -18,7 +18,7 @@ require "bigdecimal/jacobian"
#
# f.zero:: returns 0.0
# f.one:: returns 1.0
-# f.two:: returns 1.0
+# f.two:: returns 2.0
# f.ten:: returns 10.0
#
# f.eps:: returns the convergence criterion (epsilon value) used to determine whether two values are considered equal. If |a-b| < epsilon, the two values are considered equal.
diff --git a/ext/bigdecimal/lib/bigdecimal/util.rb b/ext/bigdecimal/lib/bigdecimal/util.rb
index b4b02b191d..b27e64c511 100644
--- a/ext/bigdecimal/lib/bigdecimal/util.rb
+++ b/ext/bigdecimal/lib/bigdecimal/util.rb
@@ -17,7 +17,7 @@ end
class Float < Numeric
# call-seq:
- # flt.to_d(precision=nil) -> bigdecimal
+ # flt.to_d -> bigdecimal
#
# Convert +flt+ to a BigDecimal and return it.
#
@@ -83,12 +83,11 @@ end
class Rational < Numeric
# call-seq:
+ # r.to_d -> bigdecimal
# r.to_d(sig) -> bigdecimal
#
# Converts a Rational to a BigDecimal. Takes an optional parameter +sig+ to
# limit the amount of significant digits.
- # If a negative precision is given, raise ArgumentError.
- # The zero precision and implicit precision is deprecated.
#
# r = (22/7.0).to_r
# # => (7077085128725065/2251799813685248)
@@ -96,12 +95,9 @@ class Rational < Numeric
# # => #<BigDecimal:1a52bd8,'0.3142857142 8571427937 0154144999 105E1',45(63)>
# r.to_d(3)
# # => #<BigDecimal:1a44d08,'0.314E1',18(36)>
- def to_d(precision=0)
- if precision < 0
+ def to_d(precision)
+ if precision <= 0
raise ArgumentError, "negative precision"
- elsif precision == 0
- warn "zero and implicit precision is deprecated."
- precision = BigDecimal.double_fig*2+1
end
num = self.numerator
BigDecimal(num).div(self.denominator, precision)
diff --git a/ext/coverage/coverage.c b/ext/coverage/coverage.c
index 529fac256a..d2cdb357e0 100644
--- a/ext/coverage/coverage.c
+++ b/ext/coverage/coverage.c
@@ -71,11 +71,13 @@ rb_coverage_result(VALUE klass)
*
* = Usage
*
- * (1) require "coverage.so"
- * (2) do Coverage.start
- * (3) require or load Ruby source file
- * (4) Coverage.result will return a hash that contains filename as key and
- * coverage array as value.
+ * 1. require "coverage.so"
+ * 2. do Coverage.start
+ * 3. require or load Ruby source file
+ * 4. Coverage.result will return a hash that contains filename as key and
+ * coverage array as value. A coverage array gives, for each line, the
+ * number of line execution by the interpreter. A +nil+ value means
+ * coverage is disabled for this line (lines like +else+ and +end+).
*
* = Example
*
diff --git a/ext/curses/curses.c b/ext/curses/curses.c
index ff0c64e258..a2ddb6a1ec 100644
--- a/ext/curses/curses.c
+++ b/ext/curses/curses.c
@@ -18,6 +18,7 @@
#include "ruby.h"
#include "ruby/io.h"
+#include "ruby/thread.h"
#if defined(HAVE_NCURSES_H)
# include <ncurses.h>
@@ -63,6 +64,7 @@
static VALUE mCurses;
static VALUE mKey;
static VALUE cWindow;
+static VALUE cPad;
#ifdef USE_MOUSE
static VALUE cMouseEvent;
#endif
@@ -86,18 +88,34 @@ no_window(void)
#define GetWINDOW(obj, winp) do {\
if (!OBJ_TAINTED(obj) && rb_safe_level() >= 4)\
rb_raise(rb_eSecurityError, "Insecure: operation on untainted window");\
- Data_Get_Struct((obj), struct windata, (winp));\
+ TypedData_Get_Struct((obj), struct windata, &windata_type, (winp));\
if ((winp)->window == 0) no_window();\
} while (0)
static void
-free_window(struct windata *winp)
+window_free(void *p)
{
+ struct windata *winp = p;
if (winp->window && winp->window != stdscr) delwin(winp->window);
winp->window = 0;
xfree(winp);
}
+static size_t
+window_memsize(const void *p)
+{
+ const struct windata *winp = p;
+ size_t size = sizeof(*winp);
+ if (!winp) return 0;
+ if (winp->window && winp->window != stdscr) size += sizeof(winp->window);
+ return size;
+}
+
+static const rb_data_type_t windata_type = {
+ "windata",
+ {0, window_free, window_memsize,}
+};
+
static VALUE
prep_window(VALUE class, WINDOW *window)
{
@@ -109,7 +127,7 @@ prep_window(VALUE class, WINDOW *window)
}
obj = rb_obj_alloc(class);
- Data_Get_Struct(obj, struct windata, winp);
+ TypedData_Get_Struct(obj, struct windata, &windata_type, winp);
winp->window = window;
return obj;
@@ -617,12 +635,12 @@ curses_addstr(VALUE obj, VALUE str)
return Qnil;
}
-static VALUE
+static void *
getch_func(void *arg)
{
int *ip = (int *)arg;
*ip = getch();
- return Qnil;
+ return 0;
}
/*
@@ -639,7 +657,7 @@ curses_getch(VALUE obj)
int c;
curses_stdscr();
- rb_thread_blocking_region(getch_func, (void *)&c, RUBY_UBF_IO, 0);
+ rb_thread_call_without_gvl(getch_func, &c, RUBY_UBF_IO, 0);
if (c == EOF) return Qnil;
if (rb_isprint(c)) {
char ch = (char)c;
@@ -652,7 +670,7 @@ curses_getch(VALUE obj)
/* This should be big enough.. I hope */
#define GETSTR_BUF_SIZE 1024
-static VALUE
+static void *
getstr_func(void *arg)
{
char *rtn = (char *)arg;
@@ -661,7 +679,7 @@ getstr_func(void *arg)
#else
getstr(rtn);
#endif
- return Qnil;
+ return 0;
}
/*
@@ -676,7 +694,7 @@ curses_getstr(VALUE obj)
char rtn[GETSTR_BUF_SIZE];
curses_stdscr();
- rb_thread_blocking_region(getstr_func, (void *)rtn, RUBY_UBF_IO, 0);
+ rb_thread_call_without_gvl(getstr_func, rtn, RUBY_UBF_IO, 0);
return rb_locale_str_new_cstr(rtn);
}
@@ -1222,7 +1240,7 @@ static VALUE
curses_pair_number(VALUE obj, VALUE attrs)
{
curses_stdscr();
- return INT2FIX(PAIR_NUMBER(NUM2INT(attrs)));
+ return INT2FIX(PAIR_NUMBER(NUM2LONG(attrs)));
}
#endif /* USE_COLOR */
@@ -1240,17 +1258,33 @@ no_mevent(void)
#define GetMOUSE(obj, data) do {\
if (!OBJ_TAINTED(obj) && rb_safe_level() >= 4)\
rb_raise(rb_eSecurityError, "Insecure: operation on untainted mouse");\
- Data_Get_Struct((obj), struct mousedata, (data));\
+ TypedData_Get_Struct((obj), struct mousedata, &mousedata_type, (data));\
if ((data)->mevent == 0) no_mevent();\
} while (0)
static void
-curses_mousedata_free(struct mousedata *mdata)
+curses_mousedata_free(void *p)
{
+ struct mousedata *mdata = p;
if (mdata->mevent)
xfree(mdata->mevent);
}
+static size_t
+curses_mousedata_memsize(const void *p)
+{
+ const struct mousedata *mdata = p;
+ size_t size = sizeof(*mdata);
+ if (!mdata) return 0;
+ if (mdata->mevent) size += sizeof(mdata->mevent);
+ return size;
+}
+
+static const rb_data_type_t mousedata_type = {
+ "mousedata",
+ {0, curses_mousedata_free, curses_mousedata_memsize,}
+};
+
/*
* Document-method: Curses.getmouse
*
@@ -1267,8 +1301,8 @@ curses_getmouse(VALUE obj)
VALUE val;
curses_stdscr();
- val = Data_Make_Struct(cMouseEvent,struct mousedata,
- 0,curses_mousedata_free,mdata);
+ val = TypedData_Make_Struct(cMouseEvent,struct mousedata,
+ &mousedata_type,mdata);
mdata->mevent = (MEVENT*)xmalloc(sizeof(MEVENT));
return (getmouse(mdata->mevent) == OK) ? val : Qnil;
}
@@ -1437,7 +1471,7 @@ window_s_allocate(VALUE class)
{
struct windata *winp;
- return Data_Make_Struct(class, struct windata, 0, free_window, winp);
+ return TypedData_Make_Struct(class, struct windata, &windata_type, winp);
}
/*
@@ -1459,7 +1493,7 @@ window_initialize(VALUE obj, VALUE h, VALUE w, VALUE top, VALUE left)
rb_secure(4);
curses_init_screen();
- Data_Get_Struct(obj, struct windata, winp);
+ TypedData_Get_Struct(obj, struct windata, &windata_type, winp);
if (winp->window) delwin(winp->window);
window = newwin(NUM2INT(h), NUM2INT(w), NUM2INT(top), NUM2INT(left));
wclear(window);
@@ -1633,6 +1667,7 @@ window_cury(VALUE obj)
GetWINDOW(obj, winp);
getyx(winp->window, y, x);
+ (void)x;
return INT2FIX(y);
}
@@ -1649,6 +1684,7 @@ window_curx(VALUE obj)
GetWINDOW(obj, winp);
getyx(winp->window, y, x);
+ (void)y;
return INT2FIX(x);
}
@@ -1669,6 +1705,7 @@ window_maxy(VALUE obj)
{
int x, y;
getmaxyx(winp->window, y, x);
+ (void)x;
return INT2FIX(y);
}
#else
@@ -1693,6 +1730,7 @@ window_maxx(VALUE obj)
{
int x, y;
getmaxyx(winp->window, y, x);
+ (void)y;
return INT2FIX(x);
}
#else
@@ -1714,10 +1752,11 @@ window_begy(VALUE obj)
GetWINDOW(obj, winp);
#ifdef getbegyx
getbegyx(winp->window, y, x);
- return INT2FIX(y);
+ (void)x;
#else
- return INT2FIX(winp->window->_begy);
+ y = winp->window->_begy;
#endif
+ return INT2FIX(y);
}
/*
@@ -1734,10 +1773,11 @@ window_begx(VALUE obj)
GetWINDOW(obj, winp);
#ifdef getbegyx
getbegyx(winp->window, y, x);
- return INT2FIX(x);
+ (void)y;
#else
- return INT2FIX(winp->window->_begx);
+ x = winp->window->_begx;
#endif
+ return INT2FIX(x);
}
/*
@@ -1916,12 +1956,12 @@ struct wgetch_arg {
int c;
};
-static VALUE
+static void *
wgetch_func(void *_arg)
{
struct wgetch_arg *arg = (struct wgetch_arg *)_arg;
arg->c = wgetch(arg->win);
- return Qnil;
+ return 0;
}
/*
@@ -1941,7 +1981,7 @@ window_getch(VALUE obj)
GetWINDOW(obj, winp);
arg.win = winp->window;
- rb_thread_blocking_region(wgetch_func, (void *)&arg, RUBY_UBF_IO, 0);
+ rb_thread_call_without_gvl(wgetch_func, (void *)&arg, RUBY_UBF_IO, 0);
c = arg.c;
if (c == EOF) return Qnil;
if (rb_isprint(c)) {
@@ -1957,7 +1997,7 @@ struct wgetstr_arg {
char rtn[GETSTR_BUF_SIZE];
};
-static VALUE
+static void *
wgetstr_func(void *_arg)
{
struct wgetstr_arg *arg = (struct wgetstr_arg *)_arg;
@@ -1966,7 +2006,7 @@ wgetstr_func(void *_arg)
#else
wgetstr(arg->win, arg->rtn);
#endif
- return Qnil;
+ return 0;
}
/*
@@ -1983,7 +2023,7 @@ window_getstr(VALUE obj)
GetWINDOW(obj, winp);
arg.win = winp->window;
- rb_thread_blocking_region(wgetstr_func, (void *)&arg, RUBY_UBF_IO, 0);
+ rb_thread_call_without_gvl(wgetstr_func, (void *)&arg, RUBY_UBF_IO, 0);
return rb_locale_str_new_cstr(arg.rtn);
}
@@ -2406,11 +2446,14 @@ window_keypad(VALUE obj, VALUE val)
#ifdef HAVE_NODELAY
/*
* Document-method: Curses::Window.nodelay
- * call-seq: nodelay(bool)
+ * call-seq:
+ * window.nodelay = bool
*
- * Causes Curses::Window.getch to be a non-blocking call. If no input is ready, getch returns ERR.
+ * When in no-delay mode Curses::Window#getch is a non-blocking call. If no
+ * input is ready #getch returns ERR.
*
- * If disabled (+bool+ is +false+), Curses::Window.getch waits until a key is pressed.
+ * When in delay mode (+bool+ is +false+ which is the default),
+ * Curses::Window#getch blocks until a key is pressed.
*
*/
static VALUE
@@ -2455,6 +2498,137 @@ window_timeout(VALUE obj, VALUE delay)
#define window_timeout rb_f_notimplement
#endif
+/*--------------------------- class Pad ----------------------------*/
+
+#ifdef HAVE_NEWPAD
+/*
+ * Document-method: Curses::Pad.new
+ *
+ * call-seq:
+ * new(height, width)
+ *
+ * Contruct a new Curses::Pad with constraints of +height+ lines, +width+
+ * columns
+ *
+ */
+static VALUE
+pad_initialize(VALUE obj, VALUE h, VALUE w)
+{
+ struct windata *padp;
+ WINDOW *window;
+
+ rb_secure(4);
+ curses_init_screen();
+ TypedData_Get_Struct(obj, struct windata, &windata_type, padp);
+ if (padp->window) delwin(padp->window);
+ window = newpad(NUM2INT(h), NUM2INT(w));
+ wclear(window);
+ padp->window = window;
+
+ return obj;
+}
+
+#if 1
+#define pad_subpad window_subwin
+#else
+/*
+ * Document-method: Curses::Pad.subpad
+ * call-seq:
+ * subpad(height, width, begin_x, begin_y)
+ *
+ * Contruct a new subpad with constraints of +height+ lines, +width+ columns,
+ * begin at +begin_x+ line, and +begin_y+ columns on the pad.
+ *
+ */
+static VALUE
+pad_subpad(VALUE obj, VALUE height, VALUE width, VALUE begin_x, VALUE begin_y)
+{
+ struct windata *padp;
+ WINDOW *subpad;
+ VALUE pad;
+ int h, w, x, y;
+
+ h = NUM2INT(height);
+ w = NUM2INT(width);
+ x = NUM2INT(begin_x);
+ y = NUM2INT(begin_y);
+ GetWINDOW(obj, padp);
+ subpad = subwin(padp->window, h, w, x, y);
+ pad = prep_window(rb_obj_class(obj), subpad);
+
+ return pad;
+}
+#endif
+
+/*
+ * Document-method: Curses::Pad.refresh
+ *
+ * call-seq:
+ * pad.refresh(pad_minrow, pad_mincol, screen_minrow, screen_mincol, screen_maxrow, screen_maxcol)
+ *
+ * Refreshes the pad. +pad_minrow+ and pad_mincol+ define the upper-left
+ * corner of the rectangle to be displayed. +screen_minrow+, +screen_mincol+,
+ * +screen_maxrow+, +screen_maxcol+ define the edges of the rectangle to be
+ * displayed on the screen.
+ *
+ */
+static VALUE
+pad_refresh(VALUE obj, VALUE pminrow, VALUE pmincol, VALUE sminrow,
+ VALUE smincol, VALUE smaxrow, VALUE smaxcol)
+{
+ struct windata *padp;
+ int pmr, pmc, smr, smc, sxr, sxc;
+
+ pmr = NUM2INT(pminrow);
+ pmc = NUM2INT(pmincol);
+ smr = NUM2INT(sminrow);
+ smc = NUM2INT(smincol);
+ sxr = NUM2INT(smaxrow);
+ sxc = NUM2INT(smaxcol);
+
+ GetWINDOW(obj, padp);
+ prefresh(padp->window, pmr, pmc, smr, smc, sxr, sxc);
+
+ return Qnil;
+}
+
+/*
+ * Document-method: Curses::Pad.noutrefresh
+ *
+ * call-seq:
+ * pad.noutrefresh(pad_minrow, pad_mincol, screen_minrow, screen_mincol, screen_maxrow, screen_maxcol)
+ *
+ * Refreshes the pad. +pad_minrow+ and pad_mincol+ define the upper-left
+ * corner of the rectangle to be displayed. +screen_minrow+, +screen_mincol+,
+ * +screen_maxrow+, +screen_maxcol+ define the edges of the rectangle to be
+ * displayed on the screen.
+ *
+ */
+static VALUE
+pad_noutrefresh(VALUE obj, VALUE pminrow, VALUE pmincol, VALUE sminrow,
+ VALUE smincol, VALUE smaxrow, VALUE smaxcol)
+{
+ struct windata *padp;
+ int pmr, pmc, smr, smc, sxr, sxc;
+
+ pmr = NUM2INT(pminrow);
+ pmc = NUM2INT(pmincol);
+ smr = NUM2INT(sminrow);
+ smc = NUM2INT(smincol);
+ sxr = NUM2INT(smaxrow);
+ sxc = NUM2INT(smaxcol);
+
+ GetWINDOW(obj, padp);
+#ifdef HAVE_DOUPDATE
+ pnoutrefresh(padp->window, pmr, pmc, smr, smc, sxr, sxc);
+#else
+ prefresh(padp->window, pmr, pmc, smr, smc, sxr, sxc);
+#endif
+
+ return Qnil;
+}
+#endif /* HAVE_NEWPAD */
+
/*------------------------- Initialization -------------------------*/
/*
@@ -2604,6 +2778,32 @@ Init_curses(void)
rb_define_module_function(mCurses, "def_prog_mode", curses_def_prog_mode, 0);
rb_define_module_function(mCurses, "reset_prog_mode", curses_reset_prog_mode, 0);
+ {
+ VALUE version;
+#if defined(HAVE_FUNC_CURSES_VERSION)
+ /* ncurses and PDcurses */
+ version = rb_str_new2(curses_version());
+#elif defined(HAVE_VAR_CURSES_VERSION)
+ /* SVR4 curses has an undocumented and undeclared variable, curses_version.
+ * It contains a string, "SVR4". */
+ RUBY_EXTERN char *curses_version;
+ version = rb_sprintf("curses (%s)", curses_version);
+#else
+ /* BSD curses, perhaps. NetBSD 5 still use it. */
+ version = rb_str_new2("curses (unknown)");
+#endif
+ /*
+ * Identifies curses library version.
+ *
+ * - "ncurses 5.9.20110404"
+ * - "PDCurses 3.4 - Public Domain 2008"
+ * - "curses (SVR4)" (System V curses)
+ * - "curses (unknown)" (The original BSD curses? NetBSD maybe.)
+ *
+ */
+ rb_define_const(mCurses, "VERSION", version);
+ }
+
/*
* Document-class: Curses::Window
*
@@ -2686,6 +2886,26 @@ Init_curses(void)
rb_define_method(cWindow, "nodelay=", window_nodelay, 1);
rb_define_method(cWindow, "timeout=", window_timeout, 1);
+#ifdef HAVE_NEWPAD
+ /*
+ * Document-class: Curses::Pad
+ *
+ * == Description
+ *
+ * A Pad is like a Window but allows for scrolling of contents that cannot
+ * fit on the screen. Pads do not refresh automatically, use Pad#refresh
+ * or Pad#noutrefresh instead.
+ *
+ */
+ cPad = rb_define_class_under(mCurses, "Pad", cWindow);
+ /* inherits alloc_func from cWindow */
+ rb_define_method(cPad, "initialize", pad_initialize, 2);
+ rb_define_method(cPad, "subpad", pad_subpad, 4);
+ rb_define_method(cPad, "refresh", pad_refresh, 6);
+ rb_define_method(cPad, "noutrefresh", pad_noutrefresh, 6);
+ rb_undef_method(cPad, "subwin");
+#endif
+
#define rb_curses_define_const(c) rb_define_const(mCurses,#c,UINT2NUM(c))
#ifdef USE_COLOR
diff --git a/ext/curses/depend b/ext/curses/depend
index ecb79e512d..66742b7208 100644
--- a/ext/curses/depend
+++ b/ext/curses/depend
@@ -1 +1 @@
-curses.o: curses.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h
+curses.o: curses.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h $(hdrdir)/thread.h
diff --git a/ext/curses/extconf.rb b/ext/curses/extconf.rb
index 4172c8a6b6..f63de1cd6c 100644
--- a/ext/curses/extconf.rb
+++ b/ext/curses/extconf.rb
@@ -1,36 +1,116 @@
require 'mkmf'
+def have_all(*args)
+ old_libs = $libs.dup
+ old_defs = $defs.dup
+ result = []
+ begin
+ args.each {|arg|
+ r = arg.call(*result)
+ if !r
+ return nil
+ end
+ result << r
+ }
+ result
+ ensure
+ if result.length != args.length
+ $libs = old_libs
+ $defs = old_defs
+ end
+ end
+end
+
dir_config('curses')
dir_config('ncurses')
dir_config('termcap')
-make=false
-headers = []
-
have_library("mytinfo", "tgetent") if /bow/ =~ RUBY_PLATFORM
have_library("tinfo", "tgetent") or have_library("termcap", "tgetent")
-if have_header(*curses=%w"ncurses.h") and (have_library("ncursesw", "initscr") or have_library("ncurses", "initscr"))
- make=true
-elsif have_header(*curses=%w"ncurses/curses.h") and have_library("ncurses", "initscr")
- make=true
-elsif have_header(*curses=%w"curses_colr/curses.h") and have_library("cur_colr", "initscr")
- curses.unshift("varargs.h")
- make=true
-elsif have_header(*curses=%w"curses.h") and have_library("curses", "initscr")
- make=true
-end
-if make
- for f in %w(beep bkgd bkgdset curs_set deleteln doupdate flash getbkgd getnstr init isendwin keyname keypad resizeterm scrl set setscrreg ungetch wattroff wattron wattrset wbkgd wbkgdset wdeleteln wgetnstr wresize wscrl wsetscrreg def_prog_mode reset_prog_mode timeout wtimeout nodelay init_color wcolor_set use_default_colors)
+header_library = nil
+[
+ ["ncurses.h", ["ncursesw", "ncurses"]],
+ ["ncurses/curses.h", ["ncurses"]],
+ ["curses_colr/curses.h", ["cur_colr"]],
+ ["curses.h", ["curses", "pdcurses"]],
+ # ["xcurses.h", ["XCurses"]], # XCurses (PDCurses for X11)
+].each {|hdr, libs|
+ header_library = have_all(
+ lambda { have_header(hdr) && hdr },
+ lambda {|h| libs.find {|lib| have_library(lib, "initscr", h) } })
+ if header_library
+ break;
+ end
+}
+
+if header_library
+ header, library = header_library
+ puts "header: #{header}"
+ puts "library: #{library}"
+
+ curses = [header]
+ if header == 'curses_colr/curses.h'
+ curses.unshift("varargs.h")
+ end
+
+ for f in %w(beep bkgd bkgdset curs_set deleteln doupdate flash
+ getbkgd getnstr init isendwin keyname keypad resizeterm
+ scrl set setscrreg ungetch
+ wattroff wattron wattrset wbkgd wbkgdset wdeleteln wgetnstr
+ wresize wscrl wsetscrreg
+ def_prog_mode reset_prog_mode timeout wtimeout nodelay
+ init_color wcolor_set use_default_colors newpad)
have_func(f) || (have_macro(f, curses) && $defs.push(format("-DHAVE_%s", f.upcase)))
end
flag = "-D_XOPEN_SOURCE_EXTENDED"
- if try_static_assert("sizeof(char*)>sizeof(int)", %w[stdio.h stdlib.h]+curses , flag)
+ if try_static_assert("sizeof(char*)>sizeof(int)",
+ %w[stdio.h stdlib.h]+curses,
+ flag)
$defs << flag
end
have_var("ESCDELAY", curses)
have_var("TABSIZE", curses)
have_var("COLORS", curses)
have_var("COLOR_PAIRS", curses)
+
+ # SVR4 curses has a (undocumented) variable char *curses_version.
+ # ncurses and PDcurses has a function char *curses_version().
+ # Note that the original BSD curses doesn't provide version information.
+
+ prolog = cpp_include(curses)
+ if checking_for(checking_message('function curses_version', curses)) {
+ try_run(<<-"End")
+ #{prolog}
+ int main(int argc, char *argv[])
+ {
+ curses_version();
+ return EXIT_SUCCESS;
+ }
+ End
+ }
+ $defs << '-DHAVE_FUNC_CURSES_VERSION'
+ end
+
+ if checking_for(checking_message('variable curses_version', curses)) {
+ try_run(<<-"End")
+ #{prolog}
+ extern char *curses_version;
+ int main(int argc, char *argv[])
+ {
+ int i = 0;
+ for (i = 0; i < 100; i++) {
+ if (curses_version[i] == 0)
+ return 0 < i ? EXIT_SUCCESS : EXIT_FAILURE;
+ if (curses_version[i] & 0x80)
+ return EXIT_FAILURE;
+ }
+ return EXIT_FAILURE;
+ }
+ End
+ }
+ $defs << '-DHAVE_VAR_CURSES_VERSION'
+ end
+
create_makefile("curses")
end
diff --git a/ext/curses/rain.rb b/ext/curses/rain.rb
index 36f0f84de2..a6019b26e0 100644
--- a/ext/curses/rain.rb
+++ b/ext/curses/rain.rb
@@ -14,7 +14,7 @@ def ranf
end
# main #
-for i in 1 .. 15 # SIGHUP .. SIGTERM
+for i in %w[HUP INT QUIT TERM]
if trap(i, "SIG_IGN") != 0 then # 0 for SIG_IGN
trap(i) {|sig| onsig(sig) }
end
diff --git a/ext/curses/view.rb b/ext/curses/view.rb
index e033fd8ae2..bc54aeb9af 100644
--- a/ext/curses/view.rb
+++ b/ext/curses/view.rb
@@ -40,7 +40,7 @@ while TRUE
while i < lines
setpos(i, 0)
#clrtoeol
- addstr(data_lines[lptr + i]) #if data_lines[lptr + i]
+ addstr(data_lines[lptr + i] || '')
i += 1
end
refresh
diff --git a/ext/date/date_core.c b/ext/date/date_core.c
index 08328b9e8f..37d00d177e 100644
--- a/ext/date/date_core.c
+++ b/ext/date/date_core.c
@@ -1,5 +1,5 @@
/*
- date_core.c: Coded by Tadayoshi Funaba 2010, 2011
+ date_core.c: Coded by Tadayoshi Funaba 2010-2012
*/
#include "ruby.h"
@@ -39,6 +39,7 @@ static double positive_inf, negative_inf;
#define f_truncate(x) rb_funcall(x, rb_intern("truncate"), 0)
#define f_round(x) rb_funcall(x, rb_intern("round"), 0)
+#define f_to_i(x) rb_funcall(x, rb_intern("to_i"), 0)
#define f_to_r(x) rb_funcall(x, rb_intern("to_r"), 0)
#define f_to_s(x) rb_funcall(x, rb_intern("to_s"), 0)
#define f_inspect(x) rb_funcall(x, rb_intern("inspect"), 0)
@@ -217,13 +218,10 @@ f_negative_p(VALUE x)
#include <float.h>
#endif
-#if defined(FLT_RADIX) && defined(FLT_MANT_DIG)
-#if FLT_RADIX == 2 && FLT_MANT_DIG > 22
-#define USE_FLOAT
-#define sg_cast float
+#if defined(FLT_RADIX) && defined(FLT_MANT_DIG) && FLT_RADIX == 2 && FLT_MANT_DIG > 22
+#define date_sg_t float
#else
-#define sg_cast double
-#endif
+#define date_sg_t double
#endif
/* A set of nth, jd, df and sf denote ajd + 1/2. Each ajd begin at
@@ -239,11 +237,7 @@ struct SimpleDateData
/* df is zero */
/* sf is zero */
/* of is zero */
-#ifndef USE_FLOAT
- double sg; /* 2298874..2426355 or -/+oo */
-#else
- float sg; /* at most 22 bits */
-#endif
+ date_sg_t sg; /* 2298874..2426355 or -/+oo -- at most 22 bits */
/* decoded as utc=local */
int year; /* truncated */
#ifndef USE_PACK
@@ -266,11 +260,7 @@ struct ComplexDateData
int df; /* as utc, in secs */
VALUE sf; /* in nano secs */
int of; /* in secs */
-#ifndef USE_FLOAT
- double sg; /* 2298874..2426355 or -/+oo */
-#else
- float sg; /* at most 22 bits */
-#endif
+ date_sg_t sg; /* 2298874..2426355 or -/+oo -- at most 22 bits */
/* decoded as local */
int year; /* truncated */
#ifndef USE_PACK
@@ -324,7 +314,7 @@ canon(VALUE x)
{\
(x)->nth = canon(_nth);\
(x)->jd = _jd;\
- (x)->sg = (sg_cast)(_sg);\
+ (x)->sg = (date_sg_t)(_sg);\
(x)->year = _year;\
(x)->mon = _mon;\
(x)->mday = _mday;\
@@ -335,7 +325,7 @@ canon(VALUE x)
{\
(x)->nth = canon(_nth);\
(x)->jd = _jd;\
- (x)->sg = (sg_cast)(_sg);\
+ (x)->sg = (date_sg_t)(_sg);\
(x)->year = _year;\
(x)->pc = PACK2(_mon, _mday);\
(x)->flags = _flags;\
@@ -351,7 +341,7 @@ _year, _mon, _mday, _hour, _min, _sec, _flags) \
(x)->df = _df;\
(x)->sf = canon(_sf);\
(x)->of = _of;\
- (x)->sg = (sg_cast)(_sg);\
+ (x)->sg = (date_sg_t)(_sg);\
(x)->year = _year;\
(x)->mon = _mon;\
(x)->mday = _mday;\
@@ -369,7 +359,7 @@ _year, _mon, _mday, _hour, _min, _sec, _flags) \
(x)->df = _df;\
(x)->sf = canon(_sf);\
(x)->of = _of;\
- (x)->sg = (sg_cast)(_sg);\
+ (x)->sg = (date_sg_t)(_sg);\
(x)->year = _year;\
(x)->pc = PACK5(_mon, _mday, _hour, _min, _sec);\
(x)->flags = _flags;\
@@ -384,7 +374,7 @@ _year, _mon, _mday, _hour, _min, _sec, _flags) \
(x)->df = 0;\
(x)->sf = INT2FIX(0);\
(x)->of = 0;\
- (x)->sg = (sg_cast)((y)->sg);\
+ (x)->sg = (date_sg_t)((y)->sg);\
(x)->year = (y)->year;\
(x)->mon = (y)->mon;\
(x)->mday = (y)->mday;\
@@ -401,7 +391,7 @@ _year, _mon, _mday, _hour, _min, _sec, _flags) \
(x)->df = 0;\
(x)->sf = INT2FIX(0);\
(x)->of = 0;\
- (x)->sg = (sg_cast)((y)->sg);\
+ (x)->sg = (date_sg_t)((y)->sg);\
(x)->year = (y)->year;\
(x)->pc = PACK5(EX_MON((y)->pc), EX_MDAY((y)->pc), 0, 0, 0);\
(x)->flags = (y)->flags;\
@@ -413,7 +403,7 @@ _year, _mon, _mday, _hour, _min, _sec, _flags) \
{\
(x)->nth = (y)->nth;\
(x)->jd = (y)->jd;\
- (x)->sg = (sg_cast)((y)->sg);\
+ (x)->sg = (date_sg_t)((y)->sg);\
(x)->year = (y)->year;\
(x)->mon = (y)->mon;\
(x)->mday = (y)->mday;\
@@ -424,7 +414,7 @@ _year, _mon, _mday, _hour, _min, _sec, _flags) \
{\
(x)->nth = (y)->nth;\
(x)->jd = (y)->jd;\
- (x)->sg = (sg_cast)((y)->sg);\
+ (x)->sg = (date_sg_t)((y)->sg);\
(x)->year = (y)->year;\
(x)->pc = PACK2(EX_MON((y)->pc), EX_MDAY((y)->pc));\
(x)->flags = (y)->flags;\
@@ -990,8 +980,14 @@ safe_mul_p(VALUE x, long m)
if (!FIXNUM_P(x))
return 0;
ix = FIX2LONG(x);
- if (ix >= (FIXNUM_MAX / m))
- return 0;
+ if (ix < 0) {
+ if (ix <= (FIXNUM_MIN / m))
+ return 0;
+ }
+ else {
+ if (ix >= (FIXNUM_MAX / m))
+ return 0;
+ }
return 1;
}
@@ -1324,8 +1320,10 @@ encode_year(VALUE nth, int y, double style,
static void
decode_jd(VALUE jd, VALUE *nth, int *rjd)
{
+ assert(FIXNUM_P(jd) || RB_TYPE_P(jd, T_BIGNUM));
*nth = f_idiv(jd, INT2FIX(CM_PERIOD));
if (f_zero_p(*nth)) {
+ assert(FIXNUM_P(jd));
*rjd = FIX2INT(jd);
return;
}
@@ -2378,7 +2376,7 @@ offset_to_sec(VALUE vof, int *rof)
n = FIX2LONG(vs);
if (n < -DAY_IN_SECONDS || n > DAY_IN_SECONDS)
return 0;
- *rof = n;
+ *rof = (int)n;
return 1;
}
}
@@ -2428,8 +2426,6 @@ date_s__valid_jd_p(int argc, VALUE *argv, VALUE klass)
*
* Just returns true. It's nonsense, but is for symmetry.
*
- * For example:
- *
* Date.valid_jd?(2451944) #=> true
*
* See also jd.
@@ -2518,8 +2514,6 @@ date_s__valid_civil_p(int argc, VALUE *argv, VALUE klass)
*
* Returns true if the given calendar date is valid, and false if not.
*
- * For example:
- *
* Date.valid_date?(2001,2,3) #=> true
* Date.valid_date?(2001,2,29) #=> false
*
@@ -2601,8 +2595,6 @@ date_s__valid_ordinal_p(int argc, VALUE *argv, VALUE klass)
*
* Returns true if the given ordinal date is valid, and false if not.
*
- * For example:
- *
* Date.valid_ordinal?(2001,34) #=> true
* Date.valid_ordinal?(2001,366) #=> false
*
@@ -2685,8 +2677,6 @@ date_s__valid_commercial_p(int argc, VALUE *argv, VALUE klass)
*
* Returns true if the given week date is valid, and false if not.
*
- * For example:
- *
* Date.valid_commercial?(2001,5,6) #=> true
* Date.valid_commercial?(2001,5,8) #=> false
*
@@ -2872,8 +2862,6 @@ date_s_zone_to_diff(VALUE klass, VALUE str)
* Returns true if the given year is a leap year of the proleptic
* Julian calendar.
*
- * For example:
- *
* Date.julian_leap?(1900) #=> true
* Date.julian_leap?(1901) #=> false
*/
@@ -2895,8 +2883,6 @@ date_s_julian_leap_p(VALUE klass, VALUE y)
* Returns true if the given year is a leap year of the proleptic
* Gregorian calendar.
*
- * For example:
- *
* Date.gregorian_leap?(1900) #=> false
* Date.gregorian_leap?(2000) #=> true
*/
@@ -3095,14 +3081,23 @@ wholenum_p(VALUE x)
}
inline static VALUE
+to_integer(VALUE x)
+{
+ if (FIXNUM_P(x) || RB_TYPE_P(x, T_BIGNUM))
+ return x;
+ return f_to_i(x);
+}
+
+inline static VALUE
d_trunc(VALUE d, VALUE *fr)
{
VALUE rd;
if (wholenum_p(d)) {
- rd = d;
+ rd = to_integer(d);
*fr = INT2FIX(0);
- } else {
+ }
+ else {
rd = f_idiv(d, INT2FIX(1));
*fr = f_mod(d, INT2FIX(1));
}
@@ -3118,9 +3113,10 @@ h_trunc(VALUE h, VALUE *fr)
VALUE rh;
if (wholenum_p(h)) {
- rh = h;
+ rh = to_integer(h);
*fr = INT2FIX(0);
- } else {
+ }
+ else {
rh = f_idiv(h, INT2FIX(1));
*fr = f_mod(h, INT2FIX(1));
*fr = f_quo(*fr, INT2FIX(24));
@@ -3134,9 +3130,10 @@ min_trunc(VALUE min, VALUE *fr)
VALUE rmin;
if (wholenum_p(min)) {
- rmin = min;
+ rmin = to_integer(min);
*fr = INT2FIX(0);
- } else {
+ }
+ else {
rmin = f_idiv(min, INT2FIX(1));
*fr = f_mod(min, INT2FIX(1));
*fr = f_quo(*fr, INT2FIX(1440));
@@ -3150,9 +3147,10 @@ s_trunc(VALUE s, VALUE *fr)
VALUE rs;
if (wholenum_p(s)) {
- rs = s;
+ rs = to_integer(s);
*fr = INT2FIX(0);
- } else {
+ }
+ else {
rs = f_idiv(s, INT2FIX(1));
*fr = f_mod(s, INT2FIX(1));
*fr = f_quo(*fr, INT2FIX(86400));
@@ -3212,8 +3210,6 @@ static VALUE d_lite_plus(VALUE, VALUE);
* Creates a date object denoting the given chronological Julian day
* number.
*
- * For example:
- *
* Date.jd(2451944) #=> #<Date: 2001-02-03 ...>
* Date.jd(2451945) #=> #<Date: 2001-02-04 ...>
* Date.jd(0) #=> #<Date: -4712-01-01 ...>
@@ -3264,8 +3260,6 @@ date_s_jd(int argc, VALUE *argv, VALUE klass)
* relative day from the end of year when negative). It should not be
* zero.
*
- * For example:
- *
* Date.ordinal(2001) #=> #<Date: 2001-01-01 ...>
* Date.ordinal(2001,34) #=> #<Date: 2001-02-03 ...>
* Date.ordinal(2001,-1) #=> #<Date: 2001-12-31 ...>
@@ -3334,8 +3328,6 @@ date_s_ordinal(int argc, VALUE *argv, VALUE klass)
* Gregorian calendar) and Date::JULIAN (the proleptic Julian
* calendar) can be specified as a day of calendar reform.
*
- * For example:
- *
* Date.new(2001) #=> #<Date: 2001-01-01 ...>
* Date.new(2001,2,3) #=> #<Date: 2001-02-03 ...>
* Date.new(2001,2,-1) #=> #<Date: 2001-02-28 ...>
@@ -3413,8 +3405,6 @@ date_s_civil(int argc, VALUE *argv, VALUE klass)
* number (as a relative week/day from the end of year/week when
* negative). They should not be zero.
*
- * For example:
- *
* Date.commercial(2001) #=> #<Date: 2001-01-01 ...>
* Date.commercial(2002) #=> #<Date: 2001-12-31 ...>
* Date.commercial(2001,5,6) #=> #<Date: 2001-02-03 ...>
@@ -3569,6 +3559,15 @@ date_s_nth_kday(int argc, VALUE *argv, VALUE klass)
#if !defined(HAVE_GMTIME_R)
static struct tm*
+gmtime_r(const time_t *t, struct tm *tm)
+{
+ auto struct tm *tmp = gmtime(t);
+ if (tmp)
+ *tm = *tmp;
+ return tmp;
+}
+
+static struct tm*
localtime_r(const time_t *t, struct tm *tm)
{
auto struct tm *tmp = localtime(t);
@@ -3584,8 +3583,6 @@ static void set_sg(union DateData *, double);
* call-seq:
* Date.today([start=Date::ITALY]) -> date
*
- * For example:
- *
* Date.today #=> #<Date: 2011-06-11 ..>
*
* Creates a date object denoting the present day.
@@ -3608,6 +3605,7 @@ date_s_today(int argc, VALUE *argv, VALUE klass)
if (time(&t) == -1)
rb_sys_fail("time");
+ tzset();
if (!localtime_r(&t, &tm))
rb_sys_fail("localtime");
@@ -4089,6 +4087,9 @@ d_new_by_frags(VALUE klass, VALUE hash, VALUE sg)
rb_warning("invalid start is ignored");
}
+ if (NIL_P(hash))
+ rb_raise(rb_eArgError, "invalid date");
+
if (NIL_P(ref_hash("jd")) &&
NIL_P(ref_hash("yday")) &&
!NIL_P(ref_hash("year")) &&
@@ -4177,9 +4178,8 @@ date_s__strptime_internal(int argc, VALUE *argv, VALUE klass,
* Date._strptime(string[, format='%F']) -> hash
*
* Parses the given representation of date and time with the given
- * template, and returns a hash of parsed elements.
- *
- * For example:
+ * template, and returns a hash of parsed elements. _strptime does
+ * not support specification of flags and width unlike strftime.
*
* Date._strptime('2001-02-03', '%Y-%m-%d')
* #=> {:year=>2001, :mon=>2, :mday=>3}
@@ -4197,9 +4197,8 @@ date_s__strptime(int argc, VALUE *argv, VALUE klass)
* Date.strptime([string='-4712-01-01'[, format='%F'[, start=ITALY]]]) -> date
*
* Parses the given representation of date and time with the given
- * template, and creates a date object.
- *
- * For example:
+ * template, and creates a date object. strptime does not support
+ * specification of flags and width unlike strftime.
*
* Date.strptime('2001-02-03', '%Y-%m-%d') #=> #<Date: 2001-02-03 ...>
* Date.strptime('03-02-2001', '%d-%m-%Y') #=> #<Date: 2001-02-03 ...>
@@ -4272,14 +4271,13 @@ date_s__parse_internal(int argc, VALUE *argv, VALUE klass)
* Date._parse(string[, comp=true]) -> hash
*
* Parses the given representation of date and time, and returns a
- * hash of parsed elements.
+ * hash of parsed elements. This method does not function as a
+ * validator.
*
* If the optional second argument is true and the detected year is in
* the range "00" to "99", considers the year a 2-digit form and makes
* it full.
*
- * For example:
- *
* Date._parse('2001-02-03') #=> {:year=>2001, :mon=>2, :mday=>3}
*/
static VALUE
@@ -4293,14 +4291,12 @@ date_s__parse(int argc, VALUE *argv, VALUE klass)
* Date.parse(string='-4712-01-01'[, comp=true[, start=ITALY]]) -> date
*
* Parses the given representation of date and time, and creates a
- * date object.
+ * date object. This method does not function as a validator.
*
* If the optional second argument is true and the detected year is in
* the range "00" to "99", considers the year a 2-digit form and makes
* it full.
*
- * For example:
- *
* Date.parse('2001-02-03') #=> #<Date: 2001-02-03 ...>
* Date.parse('20010203') #=> #<Date: 2001-02-03 ...>
* Date.parse('3rd Feb 2001') #=> #<Date: 2001-02-03 ...>
@@ -4357,8 +4353,6 @@ date_s__iso8601(VALUE klass, VALUE str)
* Creates a new Date object by parsing from a string according to
* some typical ISO 8601 formats.
*
- * For example:
- *
* Date.iso8601('2001-02-03') #=> #<Date: 2001-02-03 ...>
* Date.iso8601('20010203') #=> #<Date: 2001-02-03 ...>
* Date.iso8601('2001-W05-6') #=> #<Date: 2001-02-03 ...>
@@ -4402,8 +4396,6 @@ date_s__rfc3339(VALUE klass, VALUE str)
* Creates a new Date object by parsing from a string according to
* some typical RFC 3339 formats.
*
- * For example:
- *
* Date.rfc3339('2001-02-03T04:05:06+07:00') #=> #<Date: 2001-02-03 ...>
*/
static VALUE
@@ -4445,8 +4437,6 @@ date_s__xmlschema(VALUE klass, VALUE str)
* Creates a new Date object by parsing from a string according to
* some typical XML Schema formats.
*
- * For example:
- *
* Date.xmlschema('2001-02-03') #=> #<Date: 2001-02-03 ...>
*/
static VALUE
@@ -4490,8 +4480,6 @@ date_s__rfc2822(VALUE klass, VALUE str)
* Creates a new Date object by parsing from a string according to
* some typical RFC 2822 formats.
*
- * For example:
- *
* Date.rfc2822('Sat, 3 Feb 2001 00:00:00 +0000')
* #=> #<Date: 2001-02-03 ...>
*/
@@ -4534,11 +4522,8 @@ date_s__httpdate(VALUE klass, VALUE str)
* Creates a new Date object by parsing from a string according to
* some RFC 2616 format.
*
- * For example:
- *
* Date.httpdate('Sat, 03 Feb 2001 00:00:00 GMT')
* #=> #<Date: 2001-02-03 ...>
- *
*/
static VALUE
date_s_httpdate(int argc, VALUE *argv, VALUE klass)
@@ -4579,8 +4564,6 @@ date_s__jisx0301(VALUE klass, VALUE str)
* Creates a new Date object by parsing from a string according to
* some typical JIS X 0301 formats.
*
- * For example:
- *
* Date.jisx0301('H13.02.03') #=> #<Date: 2001-02-03 ...>
*/
static VALUE
@@ -4666,6 +4649,9 @@ d_lite_initialize(int argc, VALUE *argv, VALUE self)
int df, of;
double sg;
+ rb_check_frozen(self);
+ rb_check_trusted(self);
+
rb_scan_args(argc, argv, "05", &vjd, &vdf, &vsf, &vof, &vsg);
jd = INT2FIX(0);
@@ -4719,6 +4705,9 @@ d_lite_initialize(int argc, VALUE *argv, VALUE self)
static VALUE
d_lite_initialize_copy(VALUE copy, VALUE date)
{
+ rb_check_frozen(copy);
+ rb_check_trusted(copy);
+
if (copy == date)
return copy;
{
@@ -4766,8 +4755,6 @@ d_lite_fill(VALUE self)
* Returns the astronomical Julian day number. This is a fractional
* number, which is not adjusted by the offset.
*
- * For example:
- *
* DateTime.new(2001,2,3,4,5,6,'+7').ajd #=> (11769328217/4800)
* DateTime.new(2001,2,2,14,5,6,'-7').ajd #=> (11769328217/4800)
*/
@@ -4785,8 +4772,6 @@ d_lite_ajd(VALUE self)
* Returns the astronomical modified Julian day number. This is
* a fractional number, which is not adjusted by the offset.
*
- * For example:
- *
* DateTime.new(2001,2,3,4,5,6,'+7').amjd #=> (249325817/4800)
* DateTime.new(2001,2,2,14,5,6,'-7').amjd #=> (249325817/4800)
*/
@@ -4804,8 +4789,6 @@ d_lite_amjd(VALUE self)
* Returns the Julian day number. This is a whole number, which is
* adjusted by the offset as the local time.
*
- * For example:
- *
* DateTime.new(2001,2,3,4,5,6,'+7').jd #=> 2451944
* DateTime.new(2001,2,3,4,5,6,'-7').jd #=> 2451944
*/
@@ -4823,8 +4806,6 @@ d_lite_jd(VALUE self)
* Returns the modified Julian day number. This is a whole number,
* which is adjusted by the offset as the local time.
*
- * For example:
- *
* DateTime.new(2001,2,3,4,5,6,'+7').mjd #=> 51943
* DateTime.new(2001,2,3,4,5,6,'-7').mjd #=> 51943
*/
@@ -4842,8 +4823,6 @@ d_lite_mjd(VALUE self)
* Returns the Lilian day number. This is a whole number, which is
* adjusted by the offset as the local time.
*
- * For example:
- *
* Date.new(2001,2,3).ld #=> 152784
*/
static VALUE
@@ -4859,8 +4838,6 @@ d_lite_ld(VALUE self)
*
* Returns the year.
*
- * For example:
- *
* Date.new(2001,2,3).year #=> 2001
* (Date.new(1,1,1) - 1).year #=> 0
*/
@@ -4877,8 +4854,6 @@ d_lite_year(VALUE self)
*
* Returns the day of the year (1-366).
*
- * For example:
- *
* Date.new(2001,2,3).yday #=> 34
*/
static VALUE
@@ -4895,8 +4870,6 @@ d_lite_yday(VALUE self)
*
* Returns the month (1-12).
*
- * For example:
- *
* Date.new(2001,2,3).mon #=> 2
*/
static VALUE
@@ -4913,8 +4886,6 @@ d_lite_mon(VALUE self)
*
* Returns the day of the month (1-31).
*
- * For example:
- *
* Date.new(2001,2,3).mday #=> 3
*/
static VALUE
@@ -4930,8 +4901,6 @@ d_lite_mday(VALUE self)
*
* Returns the fractional part of the day.
*
- * For example:
- *
* DateTime.new(2001,2,3,12).day_fraction #=> (1/2)
*/
static VALUE
@@ -4949,8 +4918,6 @@ d_lite_day_fraction(VALUE self)
*
* Returns the calendar week based year.
*
- * For example:
- *
* Date.new(2001,2,3).cwyear #=> 2001
* Date.new(2000,1,1).cwyear #=> 1999
*/
@@ -4967,8 +4934,6 @@ d_lite_cwyear(VALUE self)
*
* Returns the calendar week number (1-53).
*
- * For example:
- *
* Date.new(2001,2,3).cweek #=> 5
*/
static VALUE
@@ -4984,8 +4949,6 @@ d_lite_cweek(VALUE self)
*
* Returns the day of calendar week (1-7, Monday is 1).
*
- * For example:
- *
* Date.new(2001,2,3).cwday #=> 6
*/
static VALUE
@@ -5017,8 +4980,6 @@ d_lite_wnum1(VALUE self)
*
* Returns the day of week (0-6, Sunday is zero).
*
- * For example:
- *
* Date.new(2001,2,3).wday #=> 6
*/
static VALUE
@@ -5145,8 +5106,6 @@ d_lite_nth_kday_p(VALUE self, VALUE n, VALUE k)
*
* Returns the hour (0-23).
*
- * For example:
- *
* DateTime.new(2001,2,3,4,5,6).hour #=> 4
*/
static VALUE
@@ -5163,8 +5122,6 @@ d_lite_hour(VALUE self)
*
* Returns the minute (0-59).
*
- * For example:
- *
* DateTime.new(2001,2,3,4,5,6).min #=> 5
*/
static VALUE
@@ -5181,8 +5138,6 @@ d_lite_min(VALUE self)
*
* Returns the second (0-59).
*
- * For example:
- *
* DateTime.new(2001,2,3,4,5,6).sec #=> 6
*/
static VALUE
@@ -5199,8 +5154,6 @@ d_lite_sec(VALUE self)
*
* Returns the fractional part of the second.
*
- * For example:
- *
* DateTime.new(2001,2,3,4,5,6.5).sec_fraction #=> (1/2)
*/
static VALUE
@@ -5216,8 +5169,6 @@ d_lite_sec_fraction(VALUE self)
*
* Returns the offset.
*
- * For example:
- *
* DateTime.parse('04pm+0730').offset #=> (5/16)
*/
static VALUE
@@ -5233,8 +5184,6 @@ d_lite_offset(VALUE self)
*
* Returns the timezone.
*
- * For example:
- *
* DateTime.parse('04pm+0730').zone #=> "+07:30"
*/
static VALUE
@@ -5250,8 +5199,6 @@ d_lite_zone(VALUE self)
*
* Retruns true if the date is before the day of calendar reform.
*
- * For example:
- *
* Date.new(1582,10,15).julian? #=> false
* (Date.new(1582,10,15) - 1).julian? #=> true
*/
@@ -5268,8 +5215,6 @@ d_lite_julian_p(VALUE self)
*
* Retunrs true if the date is on or after the day of calendar reform.
*
- * For example:
- *
* Date.new(1582,10,15).gregorian? #=> true
* (Date.new(1582,10,15) - 1).gregorian? #=> false
*/
@@ -5286,8 +5231,6 @@ d_lite_gregorian_p(VALUE self)
*
* Returns true if the year is a leap year.
*
- * For example:
- *
* Date.new(2000).leap? #=> true
* Date.new(2001).leap? #=> false
*/
@@ -5312,8 +5255,6 @@ d_lite_leap_p(VALUE self)
*
* Returns the Julian day number denoting the day of calendar reform.
*
- * For example:
- *
* Date.new(2001,2,3).start #=> 2299161.0
* Date.new(2001,2,3,Date::GREGORIAN).start #=> -Infinity
*/
@@ -5358,12 +5299,12 @@ set_sg(union DateData *x, double sg)
if (simple_dat_p(x)) {
get_s_jd(x);
clear_civil(x);
- x->s.sg = (sg_cast)sg;
+ x->s.sg = (date_sg_t)sg;
} else {
get_c_jd(x);
get_c_df(x);
clear_civil(x);
- x->c.sg = (sg_cast)sg;
+ x->c.sg = (date_sg_t)sg;
}
}
@@ -5384,8 +5325,6 @@ dup_obj_with_new_start(VALUE obj, double sg)
*
* Duplicates self and resets its the day of calendar reform.
*
- * For example:
- *
* d = Date.new(1582,10,15)
* d.new_start(Date::JULIAN) #=> #<Date: 1582-10-05 ...>
*/
@@ -5479,8 +5418,6 @@ dup_obj_with_new_offset(VALUE obj, int of)
*
* Duplicates self and resets its offset.
*
- * For example:
- *
* d = DateTime.new(2001,2,3,4,5,6,'-02:00')
* #=> #<DateTime: 2001-02-03T04:05:06-02:00 ...>
* d.new_offset('+09:00') #=> #<DateTime: 2001-02-03T15:05:06+09:00 ...>
@@ -5508,8 +5445,6 @@ d_lite_new_offset(int argc, VALUE *argv, VALUE self)
* should be a numeric value. If the other is flonum, assumes its
* precision is at most nanosecond.
*
- * For example:
- *
* Date.new(2001,2,3) + 1 #=> #<Date: 2001-02-04 ...>
* DateTime.new(2001,2,3) + Rational(1,2)
* #=> #<DateTime: 2001-02-03T12:00:00+00:00 ...>
@@ -5932,8 +5867,6 @@ minus_dd(VALUE self, VALUE other)
* pointing other days before self. If the other is flonum, assumes
* its precision is at most nanosecond.
*
- * For example:
- *
* Date.new(2001,2,3) - 1 #=> #<Date: 2001-02-02 ...>
* DateTime.new(2001,2,3) - Rational(1,2)
* #=> #<DateTime: 2001-02-02T12:00:00+00:00 ...>
@@ -6016,8 +5949,6 @@ d_lite_next(VALUE self)
* Returns a date object pointing n months after self. The n should
* be a numeric value.
*
- * For example:
- *
* Date.new(2001,2,3) >> 1 #=> #<Date: 2001-03-03 ...>
* Date.new(2001,1,31) >> 1 #=> #<Date: 2001-02-28 ...>
* Date.new(2001,2,3) >> -2 #=> #<Date: 2000-12-03 ...>
@@ -6068,8 +5999,6 @@ d_lite_rshift(VALUE self, VALUE other)
* Returns a date object pointing n months before self. The n should
* be a numeric value.
*
- * For example:
- *
* Date.new(2001,2,3) << 1 #=> #<Date: 2001-01-03 ...>
* Date.new(2001,1,31) << 11 #=> #<Date: 2000-02-29 ...>
* Date.new(2001,2,3) << -1 #=> #<Date: 2001-03-03 ...>
@@ -6158,8 +6087,6 @@ static VALUE d_lite_cmp(VALUE, VALUE);
* Iterates evaluation of the given block, which takes a date object.
* The limit should be a date object.
*
- * For example:
- *
* Date.new(2001).step(Date.new(2001,-1,-1)).select{|d| d.sunday?}.size
* #=> 52
*/
@@ -6323,8 +6250,6 @@ cmp_dd(VALUE self, VALUE other)
* should be a date object or a numeric value as an astronomical
* Julian day number.
*
- * For example:
- *
* Date.new(2001,2,3) <=> Date.new(2001,2,4) #=> -1
* Date.new(2001,2,3) <=> Date.new(2001,2,3) #=> 0
* Date.new(2001,2,3) <=> Date.new(2001,2,2) #=> 1
@@ -6462,8 +6387,6 @@ equal_gen(VALUE self, VALUE other)
*
* Returns true if they are the same day.
*
- * For example:
- *
* Date.new(2001,2,3) === Date.new(2001,2,3)
* #=> true
* Date.new(2001,2,3) === Date.new(2001,2,4)
@@ -6579,8 +6502,6 @@ static VALUE strftimev(const char *, VALUE,
* Returns a string in an ISO 8601 format (This method doesn't use the
* expanded representations).
*
- * For example:
- *
* Date.new(2001,2,3).to_s #=> "2001-02-03"
*/
static VALUE
@@ -6606,30 +6527,39 @@ static VALUE
mk_inspect_raw(union DateData *x, const char *klass)
{
if (simple_dat_p(x)) {
+ VALUE nth, flags;
+
+ RB_GC_GUARD(nth) = f_inspect(x->s.nth);
+ RB_GC_GUARD(flags) = mk_inspect_flags(x);
+
return rb_enc_sprintf(rb_usascii_encoding(),
"#<%s: "
"(%sth,%dj),+0s,%.0fj; "
"%dy%dm%dd; %s>",
klass ? klass : "?",
- RSTRING_PTR(f_inspect(x->s.nth)),
- x->s.jd, x->s.sg,
+ RSTRING_PTR(nth), x->s.jd, x->s.sg,
#ifndef USE_PACK
x->s.year, x->s.mon, x->s.mday,
#else
x->s.year,
EX_MON(x->s.pc), EX_MDAY(x->s.pc),
#endif
- RSTRING_PTR(mk_inspect_flags(x)));
+ RSTRING_PTR(flags));
}
else {
+ VALUE nth, sf, flags;
+
+ RB_GC_GUARD(nth) = f_inspect(x->c.nth);
+ RB_GC_GUARD(sf) = f_inspect(x->c.sf);
+ RB_GC_GUARD(flags) = mk_inspect_flags(x);
+
return rb_enc_sprintf(rb_usascii_encoding(),
"#<%s: "
"(%sth,%dj,%ds,%sn),%+ds,%.0fj; "
"%dy%dm%dd %dh%dm%ds; %s>",
klass ? klass : "?",
- RSTRING_PTR(f_inspect(x->c.nth)),
- x->c.jd, x->c.df,
- RSTRING_PTR(f_inspect(x->c.sf)),
+ RSTRING_PTR(nth), x->c.jd, x->c.df,
+ RSTRING_PTR(sf),
x->c.of, x->c.sg,
#ifndef USE_PACK
x->c.year, x->c.mon, x->c.mday,
@@ -6640,7 +6570,7 @@ mk_inspect_raw(union DateData *x, const char *klass)
EX_HOUR(x->c.pc), EX_MIN(x->c.pc),
EX_SEC(x->c.pc),
#endif
- RSTRING_PTR(mk_inspect_flags(x)));
+ RSTRING_PTR(flags));
}
}
@@ -6655,12 +6585,16 @@ d_lite_inspect_raw(VALUE self)
static VALUE
mk_inspect(union DateData *x, const char *klass, const char *to_s)
{
+ VALUE jd, sf;
+
+ RB_GC_GUARD(jd) = f_inspect(m_real_jd(x));
+ RB_GC_GUARD(sf) = f_inspect(m_sf(x));
+
return rb_enc_sprintf(rb_usascii_encoding(),
"#<%s: %s ((%sj,%ds,%sn),%+ds,%.0fj)>",
klass ? klass : "?",
to_s ? to_s : "?",
- RSTRING_PTR(f_inspect(m_real_jd(x))), m_df(x),
- RSTRING_PTR(f_inspect(m_sf(x))),
+ RSTRING_PTR(jd), m_df(x), RSTRING_PTR(sf),
m_of(x), m_sg(x));
}
@@ -6670,20 +6604,21 @@ mk_inspect(union DateData *x, const char *klass, const char *to_s)
*
* Returns the value as a string for inspection.
*
- * For example:
- *
* Date.new(2001,2,3).inspect
* #=> "#<Date: 2001-02-03 ((2451944j,0s,0n),+0s,2299161j)>"
* DateTime.new(2001,2,3,4,5,6,'-7').inspect
* #=> "#<DateTime: 2001-02-03T04:05:06-07:00 ((2451944j,39906s,0n),-25200s,2299161j)>"
- *
*/
static VALUE
d_lite_inspect(VALUE self)
{
get_d1(self);
- return mk_inspect(dat, rb_obj_classname(self),
- RSTRING_PTR(f_to_s(self)));
+ {
+ VALUE to_s;
+
+ RB_GC_GUARD(to_s) = f_to_s(self);
+ return mk_inspect(dat, rb_obj_classname(self), RSTRING_PTR(to_s));
+ }
}
#include <errno.h>
@@ -6718,8 +6653,12 @@ date_strftime_alloc(char **buf, const char *format,
* if the buffer is 1024 times bigger than the length of the
* format string, it's not failing for lack of room.
*/
- if (len > 0 || size >= 1024 * flen) break;
+ if (len > 0) break;
xfree(*buf);
+ if (size >= 1024 * flen) {
+ rb_sys_fail(format);
+ break;
+ }
}
return len;
}
@@ -6756,10 +6695,10 @@ tmx_m_msecs(union DateData *x)
return s;
}
-static VALUE
+static int
tmx_m_of(union DateData *x)
{
- return INT2FIX(m_of(x));
+ return m_of(x);
}
static char *
@@ -6785,7 +6724,7 @@ static struct tmx_funcs tmx_funcs = {
(VALUE (*)(void *))m_sf_in_sec,
(VALUE (*)(void *))tmx_m_secs,
(VALUE (*)(void *))tmx_m_msecs,
- (VALUE (*)(void *))tmx_m_of,
+ (int (*)(void *))tmx_m_of,
(char *(*)(void *))tmx_m_zone
};
@@ -6876,12 +6815,11 @@ date_strftime_internal(int argc, VALUE *argv, VALUE self,
* 0 use zeros for padding.
* ^ upcase the result string.
* # change case.
- * : use colons for %z.
*
* The minimum field width specifies the minimum width.
*
- * The modifier is "E" and "O".
- * They are ignored.
+ * The modifiers are "E", "O", ":", "::" and ":::".
+ * "E" and "O" are ignored. No effect to result currently.
*
* Format directives:
*
@@ -6920,10 +6858,10 @@ date_strftime_internal(int argc, VALUE *argv, VALUE self,
*
* %L - Millisecond of the second (000..999)
* %N - Fractional seconds digits, default is 9 digits (nanosecond)
- * %3N millisecond (3 digits)
- * %6N microsecond (6 digits)
- * %9N nanosecond (9 digits)
- * %12N picosecond (12 digits)
+ * %3N millisecond (3 digits) %15N femtosecond (15 digits)
+ * %6N microsecond (6 digits) %18N attosecond (18 digits)
+ * %9N nanosecond (9 digits) %21N zeptosecond (21 digits)
+ * %12N picosecond (12 digits) %24N yoctosecond (24 digits)
*
* Time zone:
* %z - Time zone as hour and minute offset from UTC (e.g. +0900)
@@ -6931,7 +6869,7 @@ date_strftime_internal(int argc, VALUE *argv, VALUE self,
* %::z - hour, minute and second offset from UTC (e.g. +09:00:00)
* %:::z - hour, minute and second offset from UTC
* (e.g. +09, +09:30, +09:30:30)
- * %Z - Time zone abbreviation name
+ * %Z - Time zone abbreviation name or something similar information.
*
* Weekday:
* %A - The full weekday name (``Sunday'')
@@ -6957,7 +6895,7 @@ date_strftime_internal(int argc, VALUE *argv, VALUE self,
*
* Seconds since the Unix Epoch:
* %s - Number of seconds since 1970-01-01 00:00:00 UTC.
- * %Q - Number of microseconds since 1970-01-01 00:00:00 UTC.
+ * %Q - Number of milliseconds since 1970-01-01 00:00:00 UTC.
*
* Literal string:
* %n - Newline character (\n)
@@ -7153,8 +7091,6 @@ jisx0301_date(VALUE jd, VALUE y)
*
* Returns a string in a JIS X 0301 format.
*
- * For example:
- *
* Date.new(2001,2,3).jisx0301 #=> "H13.02.03"
*/
static VALUE
@@ -7220,19 +7156,33 @@ d_lite_marshal_load(VALUE self, VALUE a)
{
get_d1(self);
+ rb_check_frozen(self);
+ rb_check_trusted(self);
+
if (TYPE(a) != T_ARRAY)
rb_raise(rb_eTypeError, "expected an array");
switch (RARRAY_LEN(a)) {
- case 3:
+ case 2: /* 1.6.x */
+ case 3: /* 1.8.x, 1.9.2 */
{
VALUE ajd, of, sg, nth, sf;
int jd, df, rof;
double rsg;
- ajd = RARRAY_PTR(a)[0];
- of = RARRAY_PTR(a)[1];
- sg = RARRAY_PTR(a)[2];
+
+ if (RARRAY_LEN(a) == 2) {
+ ajd = f_sub(RARRAY_PTR(a)[0], half_days_in_day);
+ of = INT2FIX(0);
+ sg = RARRAY_PTR(a)[1];
+ if (!k_numeric_p(sg))
+ sg = DBL2NUM(RTEST(sg) ? GREGORIAN : JULIAN);
+ }
+ else {
+ ajd = RARRAY_PTR(a)[0];
+ of = RARRAY_PTR(a)[1];
+ sg = RARRAY_PTR(a)[2];
+ }
old_to_new(ajd, of, sg,
&nth, &jd, &df, &sf, &rof, &rsg);
@@ -7288,6 +7238,16 @@ d_lite_marshal_load(VALUE self, VALUE a)
return self;
}
+/* :nodoc: */
+static VALUE
+date_s__load(VALUE klass, VALUE s)
+{
+ VALUE a, obj;
+
+ a = rb_marshal_load(s);
+ obj = d_lite_s_alloc(klass);
+ return d_lite_marshal_load(obj, a);
+}
/* datetime */
@@ -7298,8 +7258,6 @@ d_lite_marshal_load(VALUE self, VALUE a)
* Creates a datetime object denoting the given chronological Julian
* day number.
*
- * For example:
- *
* DateTime.jd(2451944) #=> #<DateTime: 2001-02-03T00:00:00+00:00 ...>
* DateTime.jd(2451945) #=> #<DateTime: 2001-02-04T00:00:00+00:00 ...>
* DateTime.jd(Rational('0.5'))
@@ -7367,8 +7325,6 @@ datetime_s_jd(int argc, VALUE *argv, VALUE klass)
*
* Creates a date-time object denoting the given ordinal date.
*
- * For example:
- *
* DateTime.ordinal(2001,34) #=> #<DateTime: 2001-02-03T00:00:00+00:00 ...>
* DateTime.ordinal(2001,34,4,5,6,'+7')
* #=> #<DateTime: 2001-02-03T04:05:06+07:00 ...>
@@ -7445,8 +7401,6 @@ datetime_s_ordinal(int argc, VALUE *argv, VALUE klass)
*
* Creates a date-time object denoting the given calendar date.
*
- * For example:
- *
* DateTime.new(2001,2,3) #=> #<DateTime: 2001-02-03T00:00:00+00:00 ...>
* DateTime.new(2001,2,3,4,5,6,'+7')
* #=> #<DateTime: 2001-02-03T04:05:06+07:00 ...>
@@ -7545,8 +7499,6 @@ datetime_s_civil(int argc, VALUE *argv, VALUE klass)
*
* Creates a date-time object denoting the given week date.
*
- * For example:
- *
* DateTime.commercial(2001) #=> #<DateTime: 2001-01-01T00:00:00+00:00 ...>
* DateTime.commercial(2002) #=> #<DateTime: 2001-12-31T00:00:00+00:00 ...>
* DateTime.commercial(2001,5,6,4,5,6,'+7')
@@ -7764,8 +7716,6 @@ datetime_s_nth_kday(int argc, VALUE *argv, VALUE klass)
*
* Creates a date-time object denoting the present time.
*
- * For example:
- *
* DateTime.now #=> #<DateTime: 2011-06-11T21:20:44+09:00 ...>
*/
static VALUE
@@ -7799,6 +7749,7 @@ datetime_s_now(int argc, VALUE *argv, VALUE klass)
rb_sys_fail("gettimeofday");
sec = tv.tv_sec;
#endif
+ tzset();
if (!localtime_r(&sec, &tm))
rb_sys_fail("localtime");
@@ -7812,8 +7763,37 @@ datetime_s_now(int argc, VALUE *argv, VALUE klass)
s = 59;
#ifdef HAVE_STRUCT_TM_TM_GMTOFF
of = tm.tm_gmtoff;
+#elif defined(HAVE_VAR_TIMEZONE)
+#ifdef HAVE_VAR_ALTZONE
+ of = (long)((tm.tm_isdst > 0) ? altzone : timezone);
+#else
+ of = (long)-timezone;
+ if (tm.tm_isdst) {
+ time_t sec2;
+
+ tm.tm_isdst = 0;
+ sec2 = mktime(&tm);
+ of += (long)difftime(sec2, sec);
+ }
+#endif
+#elif defined(HAVE_TIMEGM)
+ {
+ time_t sec2;
+
+ sec2 = timegm(&tm);
+ of = (long)difftime(sec2, sec);
+ }
#else
- of = -timezone;
+ {
+ struct tm tm2;
+ time_t sec2;
+
+ if (!gmtime_r(&sec, &tm2))
+ rb_sys_fail("gmtime");
+ tm2.tm_isdst = tm.tm_isdst;
+ sec2 = mktime(&tm2);
+ of = (long)difftime(sec, sec2);
+ }
#endif
#ifdef HAVE_CLOCK_GETTIME
sf = ts.tv_nsec;
@@ -7853,6 +7833,9 @@ dt_new_by_frags(VALUE klass, VALUE hash, VALUE sg)
rb_warning("invalid start is ignored");
}
+ if (NIL_P(hash))
+ rb_raise(rb_eArgError, "invalid date");
+
if (NIL_P(ref_hash("jd")) &&
NIL_P(ref_hash("yday")) &&
!NIL_P(ref_hash("year")) &&
@@ -7868,7 +7851,7 @@ dt_new_by_frags(VALUE klass, VALUE hash, VALUE sg)
set_hash("min", INT2FIX(0));
if (NIL_P(ref_hash("sec")))
set_hash("sec", INT2FIX(0));
- else if (f_gt_p(ref_hash("sec"), INT2FIX(59)))
+ else if (f_eqeq_p(ref_hash("sec"), INT2FIX(60)))
set_hash("sec", INT2FIX(59));
}
else {
@@ -7931,7 +7914,8 @@ dt_new_by_frags(VALUE klass, VALUE hash, VALUE sg)
* DateTime._strptime(string[, format='%FT%T%z']) -> hash
*
* Parses the given representation of date and time with the given
- * template, and returns a hash of parsed elements.
+ * template, and returns a hash of parsed elements. _strptime does
+ * not support specification of flags and width unlike strftime.
*
* See also strptime(3) and strftime.
*/
@@ -7946,9 +7930,8 @@ datetime_s__strptime(int argc, VALUE *argv, VALUE klass)
* DateTime.strptime([string='-4712-01-01T00:00:00+00:00'[, format='%FT%T%z'[ ,start=ITALY]]]) -> datetime
*
* Parses the given representation of date and time with the given
- * template, and creates a date object.
- *
- * For example:
+ * template, and creates a date object. strptime does not support
+ * specification of flags and width unlike strftime.
*
* DateTime.strptime('2001-02-03T04:05:06+07:00', '%Y-%m-%dT%H:%M:%S%z')
* #=> #<DateTime: 2001-02-03T04:05:06+07:00 ...>
@@ -8000,13 +7983,11 @@ datetime_s_strptime(int argc, VALUE *argv, VALUE klass)
* DateTime.parse(string='-4712-01-01T00:00:00+00:00'[, comp=true[, start=ITALY]]) -> datetime
*
* Parses the given representation of date and time, and creates a
- * date object.
+ * date object. This method does not function as a validator.
*
* If the optional second argument is true and the detected year is in
* the range "00" to "99", makes it full.
*
- * For example:
- *
* DateTime.parse('2001-02-03T04:05:06+07:00')
* #=> #<DateTime: 2001-02-03T04:05:06+07:00 ...>
* DateTime.parse('20010203T040506+0700')
@@ -8047,8 +8028,6 @@ datetime_s_parse(int argc, VALUE *argv, VALUE klass)
* Creates a new Date object by parsing from a string according to
* some typical ISO 8601 formats.
*
- * For example:
- *
* DateTime.iso8601('2001-02-03T04:05:06+07:00')
* #=> #<DateTime: 2001-02-03T04:05:06+07:00 ...>
* DateTime.iso8601('20010203T040506+0700')
@@ -8083,8 +8062,6 @@ datetime_s_iso8601(int argc, VALUE *argv, VALUE klass)
* Creates a new Date object by parsing from a string according to
* some typical RFC 3339 formats.
*
- * For example:
- *
* DateTime.rfc3339('2001-02-03T04:05:06+07:00')
* #=> #<DateTime: 2001-02-03T04:05:06+07:00 ...>
*/
@@ -8115,8 +8092,6 @@ datetime_s_rfc3339(int argc, VALUE *argv, VALUE klass)
* Creates a new Date object by parsing from a string according to
* some typical XML Schema formats.
*
- * For example:
- *
* DateTime.xmlschema('2001-02-03T04:05:06+07:00')
* #=> #<DateTime: 2001-02-03T04:05:06+07:00 ...>
*/
@@ -8148,8 +8123,6 @@ datetime_s_xmlschema(int argc, VALUE *argv, VALUE klass)
* Creates a new Date object by parsing from a string according to
* some typical RFC 2822 formats.
*
- * For example:
- *
* DateTime.rfc2822('Sat, 3 Feb 2001 04:05:06 +0700')
* #=> #<DateTime: 2001-02-03T04:05:06+07:00 ...>
*/
@@ -8180,8 +8153,6 @@ datetime_s_rfc2822(int argc, VALUE *argv, VALUE klass)
* Creates a new Date object by parsing from a string according to
* some RFC 2616 format.
*
- * For example:
- *
* DateTime.httpdate('Sat, 03 Feb 2001 04:05:06 GMT')
* #=> #<DateTime: 2001-02-03T04:05:06+00:00 ...>
*/
@@ -8212,8 +8183,6 @@ datetime_s_httpdate(int argc, VALUE *argv, VALUE klass)
* Creates a new Date object by parsing from a string according to
* some typical JIS X 0301 formats.
*
- * For example:
- *
* DateTime.jisx0301('H13.02.03T04:05:06+07:00')
* #=> #<DateTime: 2001-02-03T04:05:06+07:00 ...>
*/
@@ -8244,8 +8213,6 @@ datetime_s_jisx0301(int argc, VALUE *argv, VALUE klass)
* Returns a string in an ISO 8601 format (This method doesn't use the
* expanded representations).
*
- * For example:
- *
* DateTime.new(2001,2,3,4,5,6,'-7').to_s
* #=> "2001-02-03T04:05:06-07:00"
*/
@@ -8322,10 +8289,10 @@ dt_lite_to_s(VALUE self)
*
* %L - Millisecond of the second (000..999)
* %N - Fractional seconds digits, default is 9 digits (nanosecond)
- * %3N millisecond (3 digits)
- * %6N microsecond (6 digits)
- * %9N nanosecond (9 digits)
- * %12N picosecond (12 digits)
+ * %3N millisecond (3 digits) %15N femtosecond (15 digits)
+ * %6N microsecond (6 digits) %18N attosecond (18 digits)
+ * %9N nanosecond (9 digits) %21N zeptosecond (21 digits)
+ * %12N picosecond (12 digits) %24N yoctosecond (24 digits)
*
* Time zone:
* %z - Time zone as hour and minute offset from UTC (e.g. +0900)
@@ -8333,7 +8300,7 @@ dt_lite_to_s(VALUE self)
* %::z - hour, minute and second offset from UTC (e.g. +09:00:00)
* %:::z - hour, minute and second offset from UTC
* (e.g. +09, +09:30, +09:30:30)
- * %Z - Time zone abbreviation name
+ * %Z - Time zone abbreviation name or something similar information.
*
* Weekday:
* %A - The full weekday name (``Sunday'')
@@ -8359,7 +8326,7 @@ dt_lite_to_s(VALUE self)
*
* Seconds since the Unix Epoch:
* %s - Number of seconds since 1970-01-01 00:00:00 UTC.
- * %Q - Number of microseconds since 1970-01-01 00:00:00 UTC.
+ * %Q - Number of milliseconds since 1970-01-01 00:00:00 UTC.
*
* Literal string:
* %n - Newline character (\n)
@@ -8444,6 +8411,7 @@ iso8601_timediv(VALUE self, VALUE n)
{
VALUE fmt;
+ n = to_integer(n);
fmt = rb_usascii_str_new2("T%H:%M:%S");
if (f_gt_p(n, INT2FIX(0))) {
VALUE argv[3];
@@ -8469,8 +8437,6 @@ iso8601_timediv(VALUE self, VALUE n)
* This method is equivalent to strftime('%FT%T'). The optional
* argument n is length of fractional seconds.
*
- * For example:
- *
* DateTime.parse('2001-02-03T04:05:06.123456789+07:00').iso8601(9)
* #=> "2001-02-03T04:05:06.123456789+07:00"
*/
@@ -8495,8 +8461,6 @@ dt_lite_iso8601(int argc, VALUE *argv, VALUE self)
* This method is equivalent to strftime('%FT%T'). The optional
* argument n is length of fractional seconds.
*
- * For example:
- *
* DateTime.parse('2001-02-03T04:05:06.123456789+07:00').rfc3339(9)
* #=> "2001-02-03T04:05:06.123456789+07:00"
*/
@@ -8513,8 +8477,6 @@ dt_lite_rfc3339(int argc, VALUE *argv, VALUE self)
* Returns a string in a JIS X 0301 format. The optional argument n
* is length of fractional seconds.
*
- * For example:
- *
* DateTime.parse('2001-02-03T04:05:06.123456789+07:00').jisx0301(9)
* #=> "H13.02.03T04:05:06.123456789+07:00"
*/
@@ -8555,7 +8517,7 @@ dt_lite_jisx0301(int argc, VALUE *argv, VALUE self)
static VALUE
time_to_time(VALUE self)
{
- return rb_funcall(self, rb_intern("getlocal"), 0);
+ return f_getlocal(self);
}
/*
@@ -9318,11 +9280,11 @@ Init_date_core(void)
* zero (equals to UTC).
*
* DateTime.new(2001,2,3,4,5,6,Rational(3,24))
- * #=> #<DateTime: 2001-02-03T03:04:05+03:00 ...>
+ * #=> #<DateTime: 2001-02-03T04:05:06+03:00 ...>
* also accepts string form.
*
* DateTime.new(2001,2,3,4,5,6,'+03:00')
- * #=> #<DateTime: 2001-02-03T03:04:05+03:00 ...>
+ * #=> #<DateTime: 2001-02-03T04:05:06+03:00 ...>
*
* An optional argument the day of calendar reform (start) denotes
* a Julian day number, which should be 2298874 to 2426355 or
@@ -9590,6 +9552,7 @@ Init_date_core(void)
#endif
rb_define_method(cDate, "marshal_dump", d_lite_marshal_dump, 0);
rb_define_method(cDate, "marshal_load", d_lite_marshal_load, 1);
+ rb_define_singleton_method(cDate, "_load", date_s__load, 1);
/* datetime */
diff --git a/ext/date/date_parse.c b/ext/date/date_parse.c
index 3605ff7f65..815c07f483 100644
--- a/ext/date/date_parse.c
+++ b/ext/date/date_parse.c
@@ -1,5 +1,5 @@
/*
- date_parse.c: Coded by Tadayoshi Funaba 2011
+ date_parse.c: Coded by Tadayoshi Funaba 2011,2012
*/
#include "ruby.h"
@@ -7,6 +7,8 @@
#include "ruby/re.h"
#include <ctype.h>
+/* #define TIGHT_PARSER */
+
#define sizeof_array(o) (sizeof o / sizeof o[0])
#define f_negate(x) rb_funcall(x, rb_intern("-@"), 0)
@@ -54,6 +56,14 @@ static const char *abbr_months[] = {
#define issign(c) ((c) == '-' || (c) == '+')
#define asp_string() rb_str_new(" ", 1)
+#ifdef TIGHT_PARSER
+#define asuba_string() rb_str_new("\001", 1)
+#define asubb_string() rb_str_new("\002", 1)
+#define asubw_string() rb_str_new("\027", 1)
+#define asubt_string() rb_str_new("\024", 1)
+#endif
+
+#define DECDIGIT "0123456789"
static void
s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
@@ -89,12 +99,12 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
size_t l;
s = RSTRING_PTR(y);
- while (!issign(*s) && !isdigit(*s))
+ while (!issign((unsigned char)*s) && !isdigit((unsigned char)*s))
s++;
bp = s;
- if (issign(*s))
+ if (issign((unsigned char)*s))
s++;
- l = strspn(s, "0123456789");
+ l = strspn(s, DECDIGIT);
ep = s + l;
if (*ep) {
y = d;
@@ -138,7 +148,7 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
VALUE iy;
s = RSTRING_PTR(y);
- while (!issign(*s) && !isdigit(*s))
+ while (!issign((unsigned char)*s) && !isdigit((unsigned char)*s))
s++;
bp = s;
if (issign(*s)) {
@@ -147,7 +157,7 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
}
if (sign)
c = Qfalse;
- l = strspn(s, "0123456789");
+ l = strspn(s, DECDIGIT);
ep = s + l;
if (l > 2)
c = Qfalse;
@@ -159,21 +169,22 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
buf[ep - bp] = '\0';
iy = cstr2num(buf);
}
- if (bc)
- iy = f_add(f_negate(iy), INT2FIX(1));
set_hash("year", iy);
}
+ if (bc)
+ set_hash("_bc", Qtrue);
+
if (!NIL_P(m)) {
const char *s, *bp, *ep;
size_t l;
VALUE im;
s = RSTRING_PTR(m);
- while (!isdigit(*s))
+ while (!isdigit((unsigned char)*s))
s++;
bp = s;
- l = strspn(s, "0123456789");
+ l = strspn(s, DECDIGIT);
ep = s + l;
{
char *buf;
@@ -192,10 +203,10 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
VALUE id;
s = RSTRING_PTR(d);
- while (!isdigit(*s))
+ while (!isdigit((unsigned char)*s))
s++;
bp = s;
- l = strspn(s, "0123456789");
+ l = strspn(s, DECDIGIT);
ep = s + l;
{
char *buf;
@@ -217,6 +228,23 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
#define ABBR_DAYS "sun|mon|tue|wed|thu|fri|sat"
#define ABBR_MONTHS "jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec"
+#ifdef TIGHT_PARSER
+#define VALID_DAYS "(?:" DAYS ")" "|(?:tues|wednes|thurs|thur|" ABBR_DAYS ")\\.?"
+#define VALID_MONTHS "(?:" MONTHS ")" "|(?:sept|" ABBR_MONTHS ")\\.?"
+#define DOTLESS_VALID_MONTHS "(?:" MONTHS ")" "|(?:sept|" ABBR_MONTHS ")"
+#define BOS "\\A\\s*"
+#define FPA "\\001"
+#define FPB "\\002"
+#define FPW "\\027"
+#define FPT "\\024"
+#define FPW_COM "\\s*(?:" FPW "\\s*,?)?\\s*"
+#define FPT_COM "\\s*(?:" FPT "\\s*,?)?\\s*"
+#define COM_FPW "\\s*(?:,?\\s*" FPW ")?\\s*"
+#define COM_FPT "\\s*(?:,?\\s*(?:@|\\b[aA][tT]\\b)?\\s*" FPT ")?\\s*"
+#define TEE_FPT "\\s*(?:[tT]?" FPT ")?"
+#define EOS "\\s*\\z"
+#endif
+
static VALUE
regcomp(const char *source, long len, int opt)
{
@@ -236,13 +264,28 @@ regcomp(const char *source, long len, int opt)
#define REGCOMP_0(pat) REGCOMP(pat, 0)
#define REGCOMP_I(pat) REGCOMP(pat, ONIG_OPTION_IGNORECASE)
-#define SUBS(s,p,c) \
+#define MATCH(s,p,c) \
{ \
- return subs(s, p, hash, c); \
+ return match(s, p, hash, c); \
}
static int
-subs(VALUE str, VALUE pat, VALUE hash, int (*cb)(VALUE, VALUE))
+match(VALUE str, VALUE pat, VALUE hash, int (*cb)(VALUE, VALUE))
+{
+ VALUE m;
+
+ m = f_match(pat, str);
+
+ if (NIL_P(m))
+ return 0;
+
+ (*cb)(m, hash);
+
+ return 1;
+}
+
+static int
+subx(VALUE str, VALUE rep, VALUE pat, VALUE hash, int (*cb)(VALUE, VALUE))
{
VALUE m;
@@ -256,13 +299,40 @@ subs(VALUE str, VALUE pat, VALUE hash, int (*cb)(VALUE, VALUE))
be = f_begin(m, INT2FIX(0));
en = f_end(m, INT2FIX(0));
- f_aset2(str, be, LONG2NUM(NUM2LONG(en) - NUM2LONG(be)), asp_string());
+ f_aset2(str, be, LONG2NUM(NUM2LONG(en) - NUM2LONG(be)), rep);
(*cb)(m, hash);
}
return 1;
}
+#define SUBS(s,p,c) \
+{ \
+ return subx(s, asp_string(), p, hash, c); \
+}
+
+#ifdef TIGHT_PARSER
+#define SUBA(s,p,c) \
+{ \
+ return subx(s, asuba_string(), p, hash, c); \
+}
+
+#define SUBB(s,p,c) \
+{ \
+ return subx(s, asubb_string(), p, hash, c); \
+}
+
+#define SUBW(s,p,c) \
+{ \
+ return subx(s, asubw_string(), p, hash, c); \
+}
+
+#define SUBT(s,p,c) \
+{ \
+ return subx(s, asubt_string(), p, hash, c); \
+}
+#endif
+
struct zone {
const char *name;
int offset;
@@ -361,14 +431,14 @@ date_zone_to_diff(VALUE str)
dest = d = ALLOCA_N(char, l + 1);
for (i = 0; i < l; i++) {
- if (isspace(s[i]) || s[i] == '\0') {
+ if (isspace((unsigned char)s[i]) || s[i] == '\0') {
if (!sp)
*d++ = ' ';
sp = 1;
}
else {
- if (isalpha(s[i]))
- *d++ = tolower(s[i]);
+ if (isalpha((unsigned char)s[i]))
+ *d++ = tolower((unsigned char)s[i]);
else
*d++ = s[i];
sp = 0;
@@ -392,10 +462,10 @@ date_zone_to_diff(VALUE str)
dl = RSTRING_LEN(str) - (sizeof DST - 1);
ds = RSTRING_PTR(str) + dl;
- if (strcmp(ss, STD) == 0) {
+ if (sl >= 0 && strcmp(ss, STD) == 0) {
str = rb_str_new(RSTRING_PTR(str), sl);
}
- else if (strcmp(ds, DST) == 0) {
+ else if (dl >= 0 && strcmp(ds, DST) == 0) {
str = rb_str_new(RSTRING_PTR(str), dl);
dst = 1;
}
@@ -409,7 +479,7 @@ date_zone_to_diff(VALUE str)
dl = RSTRING_LEN(str) - (sizeof DST - 1);
ds = RSTRING_PTR(str) + dl;
- if (strcmp(ds, DST) == 0) {
+ if (dl >= 0 && strcmp(ds, DST) == 0) {
str = rb_str_new(RSTRING_PTR(str), dl);
dst = 1;
}
@@ -441,8 +511,10 @@ date_zone_to_diff(VALUE str)
char *s, *p;
VALUE sign;
VALUE hour = Qnil, min = Qnil, sec = Qnil;
+ VALUE str_orig;
s = RSTRING_PTR(str);
+ str_orig = str;
if (strncmp(s, "gmt", 3) == 0 ||
strncmp(s, "utc", 3) == 0)
@@ -467,6 +539,7 @@ date_zone_to_diff(VALUE str)
}
else
min = rb_str_new2(s);
+ RB_GC_GUARD(str_orig);
goto num;
}
if (strpbrk(RSTRING_PTR(str), ",.")) {
@@ -530,6 +603,7 @@ date_zone_to_diff(VALUE str)
}
}
}
+ RB_GC_GUARD(str);
ok:
return offset;
}
@@ -569,11 +643,21 @@ parse_day_cb(VALUE m, VALUE hash)
static int
parse_day(VALUE str, VALUE hash)
{
- static const char pat_source[] = "\\b(" ABBR_DAYS ")[^-\\d\\s]*";
+ static const char pat_source[] =
+#ifndef TIGHT_PARSER
+ "\\b(" ABBR_DAYS ")[^-/\\d\\s]*"
+#else
+ "(" VALID_DAYS ")"
+#endif
+ ;
static VALUE pat = Qnil;
REGCOMP_I(pat);
+#ifndef TIGHT_PARSER
SUBS(str, pat, parse_day_cb);
+#else
+ SUBW(str, pat, parse_day_cb);
+#endif
}
static int
@@ -660,7 +744,11 @@ parse_time(VALUE str, VALUE hash)
"(?:"
"\\d+\\s*:\\s*\\d+"
"(?:"
+#ifndef TIGHT_PARSER
"\\s*:\\s*\\d+(?:[,.]\\d*)?"
+#else
+ "\\s*:\\s*\\d+(?:[,.]\\d+)?"
+#endif
")?"
"|"
"\\d+\\s*h(?:\\s*\\d+m?(?:\\s*\\d+s?)?)?"
@@ -685,12 +773,115 @@ parse_time(VALUE str, VALUE hash)
static VALUE pat = Qnil;
REGCOMP_I(pat);
+#ifndef TIGHT_PARSER
SUBS(str, pat, parse_time_cb);
+#else
+ SUBT(str, pat, parse_time_cb);
+#endif
+}
+
+#ifdef TIGHT_PARSER
+static int
+parse_era1_cb(VALUE m, VALUE hash)
+{
+ return 1;
+}
+
+static int
+parse_era1(VALUE str, VALUE hash)
+{
+ static const char pat_source[] =
+ "(a(?:d|\\.d\\.))";
+ static VALUE pat = Qnil;
+
+ REGCOMP_I(pat);
+ SUBA(str, pat, parse_era1_cb);
+}
+
+static int
+parse_era2_cb(VALUE m, VALUE hash)
+{
+ VALUE b;
+
+ b = rb_reg_nth_match(1, m);
+ if (*RSTRING_PTR(b) == 'B' ||
+ *RSTRING_PTR(b) == 'b')
+ set_hash("_bc", Qtrue);
+ return 1;
+}
+
+static int
+parse_era2(VALUE str, VALUE hash)
+{
+ static const char pat_source[] =
+ "(c(?:e|\\.e\\.)|b(?:ce|\\.c\\.e\\.)|b(?:c|\\.c\\.))";
+ static VALUE pat = Qnil;
+
+ REGCOMP_I(pat);
+ SUBB(str, pat, parse_era2_cb);
+}
+
+static int
+parse_era(VALUE str, VALUE hash)
+{
+ if (parse_era1(str, hash)) /* pre */
+ goto ok;
+ if (parse_era2(str, hash)) /* post */
+ goto ok;
+ return 0;
+ ok:
+ return 1;
+}
+#endif
+
+#ifdef TIGHT_PARSER
+static int
+check_year_width(VALUE y)
+{
+ char *s;
+ size_t l;
+
+ s = RSTRING_PTR(y);
+ l = strcspn(s, DECDIGIT);
+ s += l;
+ l = strspn(s, DECDIGIT);
+ if (l != 2)
+ return 0;
+ return 1;
}
static int
+check_apost(VALUE a, VALUE b, VALUE c)
+{
+ int f = 0;
+
+ if (!NIL_P(a) && *RSTRING_PTR(a) == '\'') {
+ if (!check_year_width(a))
+ return 0;
+ f++;
+ }
+ if (!NIL_P(b) && *RSTRING_PTR(b) == '\'') {
+ if (!check_year_width(b))
+ return 0;
+ if (!NIL_P(c))
+ return 0;
+ f++;
+ }
+ if (!NIL_P(c) && *RSTRING_PTR(c) == '\'') {
+ if (!check_year_width(c))
+ return 0;
+ f++;
+ }
+ if (f > 1)
+ return 0;
+ return 1;
+}
+#endif
+
+static int
parse_eu_cb(VALUE m, VALUE hash)
{
+#ifndef TIGHT_PARSER
VALUE y, mon, d, b;
d = rb_reg_nth_match(1, m);
@@ -703,6 +894,20 @@ parse_eu_cb(VALUE m, VALUE hash)
s3e(hash, y, mon, d, !NIL_P(b) &&
(*RSTRING_PTR(b) == 'B' ||
*RSTRING_PTR(b) == 'b'));
+#else
+ VALUE y, mon, d;
+
+ d = rb_reg_nth_match(1, m);
+ mon = rb_reg_nth_match(2, m);
+ y = rb_reg_nth_match(3, m);
+
+ if (!check_apost(d, mon, y))
+ return 0;
+
+ mon = INT2FIX(mon_num(mon));
+
+ s3e(hash, y, mon, d, 0);
+#endif
return 1;
}
@@ -710,15 +915,40 @@ static int
parse_eu(VALUE str, VALUE hash)
{
static const char pat_source[] =
- "'?(\\d+)[^-\\d\\s]*"
+#ifdef TIGHT_PARSER
+ BOS
+ FPW_COM FPT_COM
+#endif
+#ifndef TIGHT_PARSER
+ "('?\\d+)[^-\\d\\s]*"
+#else
+ "(\\d+)(?:(?:st|nd|rd|th)\\b)?"
+#endif
"\\s*"
+#ifndef TIGHT_PARSER
"(" ABBR_MONTHS ")[^-\\d\\s']*"
+#else
+ "(" VALID_MONTHS ")"
+#endif
"(?:"
"\\s*"
+#ifndef TIGHT_PARSER
"(c(?:e|\\.e\\.)|b(?:ce|\\.c\\.e\\.)|a(?:d|\\.d\\.)|b(?:c|\\.c\\.))?"
"\\s*"
"('?-?\\d+(?:(?:st|nd|rd|th)\\b)?)"
- ")?";
+#else
+ "(?:" FPA ")?"
+ "\\s*"
+ "([-']?\\d+)"
+ "\\s*"
+ "(?:" FPA "|" FPB ")?"
+#endif
+ ")?"
+#ifdef TIGHT_PARSER
+ COM_FPT COM_FPW
+ EOS
+#endif
+ ;
static VALUE pat = Qnil;
REGCOMP_I(pat);
@@ -728,10 +958,12 @@ parse_eu(VALUE str, VALUE hash)
static int
parse_us_cb(VALUE m, VALUE hash)
{
+#ifndef TIGHT_PARSER
VALUE y, mon, d, b;
mon = rb_reg_nth_match(1, m);
d = rb_reg_nth_match(2, m);
+
b = rb_reg_nth_match(3, m);
y = rb_reg_nth_match(4, m);
@@ -740,6 +972,20 @@ parse_us_cb(VALUE m, VALUE hash)
s3e(hash, y, mon, d, !NIL_P(b) &&
(*RSTRING_PTR(b) == 'B' ||
*RSTRING_PTR(b) == 'b'));
+#else
+ VALUE y, mon, d;
+
+ mon = rb_reg_nth_match(1, m);
+ d = rb_reg_nth_match(2, m);
+ y = rb_reg_nth_match(3, m);
+
+ if (!check_apost(mon, d, y))
+ return 0;
+
+ mon = INT2FIX(mon_num(mon));
+
+ s3e(hash, y, mon, d, 0);
+#endif
return 1;
}
@@ -747,15 +993,42 @@ static int
parse_us(VALUE str, VALUE hash)
{
static const char pat_source[] =
+#ifdef TIGHT_PARSER
+ BOS
+ FPW_COM FPT_COM
+#endif
+#ifndef TIGHT_PARSER
"\\b(" ABBR_MONTHS ")[^-\\d\\s']*"
+#else
+ "\\b(" VALID_MONTHS ")"
+#endif
"\\s*"
+#ifndef TIGHT_PARSER
"('?\\d+)[^-\\d\\s']*"
+#else
+ "('?\\d+)(?:(?:st|nd|rd|th)\\b)?"
+ COM_FPT
+#endif
"(?:"
+ "\\s*,?"
"\\s*"
+#ifndef TIGHT_PARSER
"(c(?:e|\\.e\\.)|b(?:ce|\\.c\\.e\\.)|a(?:d|\\.d\\.)|b(?:c|\\.c\\.))?"
"\\s*"
"('?-?\\d+)"
- ")?";
+#else
+ "(?:" FPA ")?"
+ "\\s*"
+ "([-']?\\d+)"
+ "\\s*"
+ "(?:" FPA "|" FPB ")?"
+#endif
+ ")?"
+#ifdef TIGHT_PARSER
+ COM_FPT COM_FPW
+ EOS
+#endif
+ ;
static VALUE pat = Qnil;
REGCOMP_I(pat);
@@ -771,6 +1044,11 @@ parse_iso_cb(VALUE m, VALUE hash)
mon = rb_reg_nth_match(2, m);
d = rb_reg_nth_match(3, m);
+#ifdef TIGHT_PARSER
+ if (!check_apost(y, mon, d))
+ return 0;
+#endif
+
s3e(hash, y, mon, d, 0);
return 1;
}
@@ -778,7 +1056,17 @@ parse_iso_cb(VALUE m, VALUE hash)
static int
parse_iso(VALUE str, VALUE hash)
{
- static const char pat_source[] = "('?[-+]?\\d+)-(\\d+)-('?-?\\d+)";
+ static const char pat_source[] =
+#ifndef TIGHT_PARSER
+ "('?[-+]?\\d+)-(\\d+)-('?-?\\d+)"
+#else
+ BOS
+ FPW_COM FPT_COM
+ "([-+']?\\d+)-(\\d+)-([-']?\\d+)"
+ TEE_FPT COM_FPW
+ EOS
+#endif
+ ;
static VALUE pat = Qnil;
REGCOMP_0(pat);
@@ -807,7 +1095,16 @@ static int
parse_iso21(VALUE str, VALUE hash)
{
static const char pat_source[] =
- "\\b(\\d{2}|\\d{4})?-?w(\\d{2})(?:-?(\\d))?\\b";
+#ifndef TIGHT_PARSER
+ "\\b(\\d{2}|\\d{4})?-?w(\\d{2})(?:-?(\\d))?\\b"
+#else
+ BOS
+ FPW_COM FPT_COM
+ "(\\d{2}|\\d{4})?-?w(\\d{2})(?:-?(\\d))?"
+ TEE_FPT COM_FPW
+ EOS
+#endif
+ ;
static VALUE pat = Qnil;
REGCOMP_I(pat);
@@ -827,7 +1124,17 @@ parse_iso22_cb(VALUE m, VALUE hash)
static int
parse_iso22(VALUE str, VALUE hash)
{
- static const char pat_source[] = "-w-(\\d)\\b";
+ static const char pat_source[] =
+#ifndef TIGHT_PARSER
+ "-w-(\\d)\\b"
+#else
+ BOS
+ FPW_COM FPT_COM
+ "-w-(\\d)"
+ TEE_FPT COM_FPW
+ EOS
+#endif
+ ;
static VALUE pat = Qnil;
REGCOMP_I(pat);
@@ -852,7 +1159,17 @@ parse_iso23_cb(VALUE m, VALUE hash)
static int
parse_iso23(VALUE str, VALUE hash)
{
- static const char pat_source[] = "--(\\d{2})?-(\\d{2})\\b";
+ static const char pat_source[] =
+#ifndef TIGHT_PARSER
+ "--(\\d{2})?-(\\d{2})\\b"
+#else
+ BOS
+ FPW_COM FPT_COM
+ "--(\\d{2})?-(\\d{2})"
+ TEE_FPT COM_FPW
+ EOS
+#endif
+ ;
static VALUE pat = Qnil;
REGCOMP_0(pat);
@@ -877,7 +1194,17 @@ parse_iso24_cb(VALUE m, VALUE hash)
static int
parse_iso24(VALUE str, VALUE hash)
{
- static const char pat_source[] = "--(\\d{2})(\\d{2})?\\b";
+ static const char pat_source[] =
+#ifndef TIGHT_PARSER
+ "--(\\d{2})(\\d{2})?\\b"
+#else
+ BOS
+ FPW_COM FPT_COM
+ "--(\\d{2})(\\d{2})?"
+ TEE_FPT COM_FPW
+ EOS
+#endif
+ ;
static VALUE pat = Qnil;
REGCOMP_0(pat);
@@ -901,9 +1228,29 @@ parse_iso25_cb(VALUE m, VALUE hash)
static int
parse_iso25(VALUE str, VALUE hash)
{
- static const char pat0_source[] = "[,.](\\d{2}|\\d{4})-\\d{3}\\b";
+ static const char pat0_source[] =
+#ifndef TIGHT_PARSER
+ "[,.](\\d{2}|\\d{4})-\\d{3}\\b"
+#else
+ BOS
+ FPW_COM FPT_COM
+ "[,.](\\d{2}|\\d{4})-\\d{3}"
+ TEE_FPT COM_FPW
+ EOS
+#endif
+ ;
static VALUE pat0 = Qnil;
- static const char pat_source[] = "\\b(\\d{2}|\\d{4})-(\\d{3})\\b";
+ static const char pat_source[] =
+#ifndef TIGHT_PARSER
+ "\\b(\\d{2}|\\d{4})-(\\d{3})\\b"
+#else
+ BOS
+ FPW_COM FPT_COM
+ "(\\d{2}|\\d{4})-(\\d{3})"
+ TEE_FPT COM_FPW
+ EOS
+#endif
+ ;
static VALUE pat = Qnil;
REGCOMP_0(pat0);
@@ -927,9 +1274,29 @@ parse_iso26_cb(VALUE m, VALUE hash)
static int
parse_iso26(VALUE str, VALUE hash)
{
- static const char pat0_source[] = "\\d-\\d{3}\\b";
+ static const char pat0_source[] =
+#ifndef TIGHT_PARSER
+ "\\d-\\d{3}\\b"
+#else
+ BOS
+ FPW_COM FPT_COM
+ "\\d-\\d{3}"
+ TEE_FPT COM_FPW
+ EOS
+#endif
+ ;
static VALUE pat0 = Qnil;
- static const char pat_source[] = "\\b-(\\d{3})\\b";
+ static const char pat_source[] =
+#ifndef TIGHT_PARSER
+ "\\b-(\\d{3})\\b"
+#else
+ BOS
+ FPW_COM FPT_COM
+ "-(\\d{3})"
+ TEE_FPT COM_FPW
+ EOS
+#endif
+ ;
static VALUE pat = Qnil;
REGCOMP_0(pat0);
@@ -999,7 +1366,17 @@ parse_jis_cb(VALUE m, VALUE hash)
static int
parse_jis(VALUE str, VALUE hash)
{
- static const char pat_source[] = "\\b([mtsh])(\\d+)\\.(\\d+)\\.(\\d+)";
+ static const char pat_source[] =
+#ifndef TIGHT_PARSER
+ "\\b([mtsh])(\\d+)\\.(\\d+)\\.(\\d+)"
+#else
+ BOS
+ FPW_COM FPT_COM
+ "([mtsh])(\\d+)\\.(\\d+)\\.(\\d+)"
+ TEE_FPT COM_FPW
+ EOS
+#endif
+ ;
static VALUE pat = Qnil;
REGCOMP_I(pat);
@@ -1015,6 +1392,11 @@ parse_vms11_cb(VALUE m, VALUE hash)
mon = rb_reg_nth_match(2, m);
y = rb_reg_nth_match(3, m);
+#ifdef TIGHT_PARSER
+ if (!check_apost(d, mon, y))
+ return 0;
+#endif
+
mon = INT2FIX(mon_num(mon));
s3e(hash, y, mon, d, 0);
@@ -1025,8 +1407,18 @@ static int
parse_vms11(VALUE str, VALUE hash)
{
static const char pat_source[] =
- "('?-?\\d+)-(" ABBR_MONTHS ")[^-]*"
- "-('?-?\\d+)";
+#ifndef TIGHT_PARSER
+ "('?-?\\d+)-(" ABBR_MONTHS ")[^-/.]*"
+ "-('?-?\\d+)"
+#else
+ BOS
+ FPW_COM FPT_COM
+ "([-']?\\d+)-(" DOTLESS_VALID_MONTHS ")"
+ "-([-']?\\d+)"
+ COM_FPT COM_FPW
+ EOS
+#endif
+ ;
static VALUE pat = Qnil;
REGCOMP_I(pat);
@@ -1042,6 +1434,11 @@ parse_vms12_cb(VALUE m, VALUE hash)
d = rb_reg_nth_match(2, m);
y = rb_reg_nth_match(3, m);
+#ifdef TIGHT_PARSER
+ if (!check_apost(mon, d, y))
+ return 0;
+#endif
+
mon = INT2FIX(mon_num(mon));
s3e(hash, y, mon, d, 0);
@@ -1052,8 +1449,18 @@ static int
parse_vms12(VALUE str, VALUE hash)
{
static const char pat_source[] =
- "\\b(" ABBR_MONTHS ")[^-]*"
- "-('?-?\\d+)(?:-('?-?\\d+))?";
+#ifndef TIGHT_PARSER
+ "\\b(" ABBR_MONTHS ")[^-/.]*"
+ "-('?-?\\d+)(?:-('?-?\\d+))?"
+#else
+ BOS
+ FPW_COM FPT_COM
+ "(" DOTLESS_VALID_MONTHS ")"
+ "-([-']?\\d+)(?:-([-']?\\d+))?"
+ COM_FPT COM_FPW
+ EOS
+#endif
+ ;
static VALUE pat = Qnil;
REGCOMP_I(pat);
@@ -1082,6 +1489,11 @@ parse_sla_cb(VALUE m, VALUE hash)
mon = rb_reg_nth_match(2, m);
d = rb_reg_nth_match(3, m);
+#ifdef TIGHT_PARSER
+ if (!check_apost(y, mon, d))
+ return 0;
+#endif
+
s3e(hash, y, mon, d, 0);
return 1;
}
@@ -1090,13 +1502,92 @@ static int
parse_sla(VALUE str, VALUE hash)
{
static const char pat_source[] =
- "('?-?\\d+)/\\s*('?\\d+)(?:\\D\\s*('?-?\\d+))?";
+#ifndef TIGHT_PARSER
+ "('?-?\\d+)/\\s*('?\\d+)(?:\\D\\s*('?-?\\d+))?"
+#else
+ BOS
+ FPW_COM FPT_COM
+ "([-']?\\d+)/\\s*('?\\d+)(?:(?:[-/]|\\s+)\\s*([-']?\\d+))?"
+ COM_FPT COM_FPW
+ EOS
+#endif
+ ;
static VALUE pat = Qnil;
REGCOMP_I(pat);
SUBS(str, pat, parse_sla_cb);
}
+#ifdef TIGHT_PARSER
+static int
+parse_sla2_cb(VALUE m, VALUE hash)
+{
+ VALUE y, mon, d;
+
+ d = rb_reg_nth_match(1, m);
+ mon = rb_reg_nth_match(2, m);
+ y = rb_reg_nth_match(3, m);
+
+ if (!check_apost(d, mon, y))
+ return 0;
+
+ mon = INT2FIX(mon_num(mon));
+
+ s3e(hash, y, mon, d, 0);
+ return 1;
+}
+
+static int
+parse_sla2(VALUE str, VALUE hash)
+{
+ static const char pat_source[] =
+ BOS
+ FPW_COM FPT_COM
+ "([-']?\\d+)/\\s*(" DOTLESS_VALID_MONTHS ")(?:(?:[-/]|\\s+)\\s*([-']?\\d+))?"
+ COM_FPT COM_FPW
+ EOS
+ ;
+ static VALUE pat = Qnil;
+
+ REGCOMP_I(pat);
+ SUBS(str, pat, parse_sla2_cb);
+}
+
+static int
+parse_sla3_cb(VALUE m, VALUE hash)
+{
+ VALUE y, mon, d;
+
+ mon = rb_reg_nth_match(1, m);
+ d = rb_reg_nth_match(2, m);
+ y = rb_reg_nth_match(3, m);
+
+ if (!check_apost(mon, d, y))
+ return 0;
+
+ mon = INT2FIX(mon_num(mon));
+
+ s3e(hash, y, mon, d, 0);
+ return 1;
+}
+
+static int
+parse_sla3(VALUE str, VALUE hash)
+{
+ static const char pat_source[] =
+ BOS
+ FPW_COM FPT_COM
+ "(" DOTLESS_VALID_MONTHS ")/\\s*([-']?\\d+)(?:(?:[-/]|\\s+)\\s*([-']?\\d+))?"
+ COM_FPT COM_FPW
+ EOS
+ ;
+ static VALUE pat = Qnil;
+
+ REGCOMP_I(pat);
+ SUBS(str, pat, parse_sla3_cb);
+}
+#endif
+
static int
parse_dot_cb(VALUE m, VALUE hash)
{
@@ -1106,6 +1597,11 @@ parse_dot_cb(VALUE m, VALUE hash)
mon = rb_reg_nth_match(2, m);
d = rb_reg_nth_match(3, m);
+#ifdef TIGHT_PARSER
+ if (!check_apost(y, mon, d))
+ return 0;
+#endif
+
s3e(hash, y, mon, d, 0);
return 1;
}
@@ -1114,13 +1610,92 @@ static int
parse_dot(VALUE str, VALUE hash)
{
static const char pat_source[] =
- "('?-?\\d+)\\.\\s*('?\\d+)\\.\\s*('?-?\\d+)";
+#ifndef TIGHT_PARSER
+ "('?-?\\d+)\\.\\s*('?\\d+)\\.\\s*('?-?\\d+)"
+#else
+ BOS
+ FPW_COM FPT_COM
+ "([-']?\\d+)\\.\\s*(\\d+)\\.\\s*([-']?\\d+)"
+ COM_FPT COM_FPW
+ EOS
+#endif
+ ;
static VALUE pat = Qnil;
REGCOMP_I(pat);
SUBS(str, pat, parse_dot_cb);
}
+#ifdef TIGHT_PARSER
+static int
+parse_dot2_cb(VALUE m, VALUE hash)
+{
+ VALUE y, mon, d;
+
+ d = rb_reg_nth_match(1, m);
+ mon = rb_reg_nth_match(2, m);
+ y = rb_reg_nth_match(3, m);
+
+ if (!check_apost(d, mon, y))
+ return 0;
+
+ mon = INT2FIX(mon_num(mon));
+
+ s3e(hash, y, mon, d, 0);
+ return 1;
+}
+
+static int
+parse_dot2(VALUE str, VALUE hash)
+{
+ static const char pat_source[] =
+ BOS
+ FPW_COM FPT_COM
+ "([-']?\\d+)\\.\\s*(" DOTLESS_VALID_MONTHS ")(?:(?:[./])\\s*([-']?\\d+))?"
+ COM_FPT COM_FPW
+ EOS
+ ;
+ static VALUE pat = Qnil;
+
+ REGCOMP_I(pat);
+ SUBS(str, pat, parse_dot2_cb);
+}
+
+static int
+parse_dot3_cb(VALUE m, VALUE hash)
+{
+ VALUE y, mon, d;
+
+ mon = rb_reg_nth_match(1, m);
+ d = rb_reg_nth_match(2, m);
+ y = rb_reg_nth_match(3, m);
+
+ if (!check_apost(mon, d, y))
+ return 0;
+
+ mon = INT2FIX(mon_num(mon));
+
+ s3e(hash, y, mon, d, 0);
+ return 1;
+}
+
+static int
+parse_dot3(VALUE str, VALUE hash)
+{
+ static const char pat_source[] =
+ BOS
+ FPW_COM FPT_COM
+ "(" DOTLESS_VALID_MONTHS ")\\.\\s*([-']?\\d+)(?:(?:[./])\\s*([-']?\\d+))?"
+ COM_FPT COM_FPW
+ EOS
+ ;
+ static VALUE pat = Qnil;
+
+ REGCOMP_I(pat);
+ SUBS(str, pat, parse_dot3_cb);
+}
+#endif
+
static int
parse_year_cb(VALUE m, VALUE hash)
{
@@ -1134,7 +1709,17 @@ parse_year_cb(VALUE m, VALUE hash)
static int
parse_year(VALUE str, VALUE hash)
{
- static const char pat_source[] = "'(\\d+)\\b";
+ static const char pat_source[] =
+#ifndef TIGHT_PARSER
+ "'(\\d+)\\b"
+#else
+ BOS
+ FPW_COM FPT_COM
+ "'(\\d+)"
+ COM_FPT COM_FPW
+ EOS
+#endif
+ ;
static VALUE pat = Qnil;
REGCOMP_0(pat);
@@ -1154,7 +1739,17 @@ parse_mon_cb(VALUE m, VALUE hash)
static int
parse_mon(VALUE str, VALUE hash)
{
- static const char pat_source[] = "\\b(" ABBR_MONTHS ")\\S*";
+ static const char pat_source[] =
+#ifndef TIGHT_PARSER
+ "\\b(" ABBR_MONTHS ")\\S*"
+#else
+ BOS
+ FPW_COM FPT_COM
+ "(" VALID_MONTHS ")"
+ COM_FPT COM_FPW
+ EOS
+#endif
+ ;
static VALUE pat = Qnil;
REGCOMP_I(pat);
@@ -1174,7 +1769,17 @@ parse_mday_cb(VALUE m, VALUE hash)
static int
parse_mday(VALUE str, VALUE hash)
{
- static const char pat_source[] = "(\\d+)(st|nd|rd|th)\\b";
+ static const char pat_source[] =
+#ifndef TIGHT_PARSER
+ "(\\d+)(st|nd|rd|th)\\b"
+#else
+ BOS
+ FPW_COM FPT_COM
+ "(\\d+)(st|nd|rd|th)"
+ COM_FPT COM_FPW
+ EOS
+#endif
+ ;
static VALUE pat = Qnil;
REGCOMP_I(pat);
@@ -1323,6 +1928,7 @@ parse_ddd_cb(VALUE m, VALUE hash)
}
break;
}
+ RB_GC_GUARD(s2);
if (!NIL_P(s3)) {
cs3 = RSTRING_PTR(s3);
l3 = RSTRING_LEN(s3);
@@ -1353,6 +1959,7 @@ parse_ddd_cb(VALUE m, VALUE hash)
break;
}
}
+ RB_GC_GUARD(s3);
}
if (!NIL_P(s4)) {
l4 = RSTRING_LEN(s4);
@@ -1387,10 +1994,11 @@ parse_ddd_cb(VALUE m, VALUE hash)
s3 = s1;
zone = rb_str_new2(s3);
set_hash("zone", zone);
- if (isdigit(*s1))
+ if (isdigit((unsigned char)*s1))
*--s1 = '+';
set_hash("offset", date_zone_to_diff(rb_str_new2(s1)));
}
+ RB_GC_GUARD(s5);
}
return 1;
@@ -1400,6 +2008,9 @@ static int
parse_ddd(VALUE str, VALUE hash)
{
static const char pat_source[] =
+#ifdef TIGHT_PARSER
+ BOS
+#endif
"([-+]?)(\\d{2,14})"
"(?:"
"\\s*"
@@ -1416,22 +2027,22 @@ parse_ddd(VALUE str, VALUE hash)
"|"
"\\[[-+]?\\d[^\\]]*\\]"
")"
- ")?";
+ ")?"
+#ifdef TIGHT_PARSER
+ EOS
+#endif
+ ;
static VALUE pat = Qnil;
REGCOMP_I(pat);
SUBS(str, pat, parse_ddd_cb);
}
+#ifndef TIGHT_PARSER
static int
parse_bc_cb(VALUE m, VALUE hash)
{
- VALUE y;
-
- y = ref_hash("year");
- if (!NIL_P(y))
- set_hash("year", f_add(f_negate(y), INT2FIX(1)));
-
+ set_hash("_bc", Qtrue);
return 1;
}
@@ -1478,6 +2089,57 @@ parse_frag(VALUE str, VALUE hash)
REGCOMP_I(pat);
SUBS(str, pat, parse_frag_cb);
}
+#endif
+
+#ifdef TIGHT_PARSER
+static int
+parse_dummy_cb(VALUE m, VALUE hash)
+{
+ return 1;
+}
+
+static int
+parse_wday_only(VALUE str, VALUE hash)
+{
+ static const char pat_source[] = "\\A\\s*" FPW "\\s*\\z";
+ static VALUE pat = Qnil;
+
+ REGCOMP_0(pat);
+ SUBS(str, pat, parse_dummy_cb);
+}
+
+static int
+parse_time_only(VALUE str, VALUE hash)
+{
+ static const char pat_source[] = "\\A\\s*" FPT "\\s*\\z";
+ static VALUE pat = Qnil;
+
+ REGCOMP_0(pat);
+ SUBS(str, pat, parse_dummy_cb);
+}
+
+static int
+parse_wday_and_time(VALUE str, VALUE hash)
+{
+ static const char pat_source[] = "\\A\\s*(" FPW "\\s+" FPT "|" FPT "\\s+" FPW ")\\s*\\z";
+ static VALUE pat = Qnil;
+
+ REGCOMP_0(pat);
+ SUBS(str, pat, parse_dummy_cb);
+}
+
+static unsigned
+have_invalid_char_p(VALUE s)
+{
+ long i;
+
+ for (i = 0; i < RSTRING_LEN(s); i++)
+ if (iscntrl((unsigned char)RSTRING_PTR(s)[i]) &&
+ !isspace((unsigned char)RSTRING_PTR(s)[i]))
+ return 1;
+ return 0;
+}
+#endif
#define HAVE_ALPHA (1<<0)
#define HAVE_DIGIT (1<<1)
@@ -1493,9 +2155,9 @@ check_class(VALUE s)
flags = 0;
for (i = 0; i < RSTRING_LEN(s); i++) {
- if (isalpha(RSTRING_PTR(s)[i]))
+ if (isalpha((unsigned char)RSTRING_PTR(s)[i]))
flags |= HAVE_ALPHA;
- if (isdigit(RSTRING_PTR(s)[i]))
+ if (isdigit((unsigned char)RSTRING_PTR(s)[i]))
flags |= HAVE_DIGIT;
if (RSTRING_PTR(s)[i] == '-')
flags |= HAVE_DASH;
@@ -1509,16 +2171,31 @@ check_class(VALUE s)
#define HAVE_ELEM_P(x) ((check_class(str) & (x)) == (x))
+#ifdef TIGHT_PARSER
+#define PARSER_ERROR return rb_hash_new()
+#endif
+
VALUE
date__parse(VALUE str, VALUE comp)
{
VALUE backref, hash;
+#ifdef TIGHT_PARSER
+ if (have_invalid_char_p(str))
+ PARSER_ERROR;
+#endif
+
backref = rb_backref_get();
rb_match_busy(backref);
{
- static const char pat_source[] = "[^-+',./:@[:alnum:]\\[\\]]+";
+ static const char pat_source[] =
+#ifndef TIGHT_PARSER
+ "[^-+',./:@[:alnum:]\\[\\]]+"
+#else
+ "[^[:graph:]]+"
+#endif
+ ;
static VALUE pat = Qnil;
REGCOMP_0(pat);
@@ -1534,12 +2211,17 @@ date__parse(VALUE str, VALUE comp)
if (HAVE_ELEM_P(HAVE_DIGIT))
parse_time(str, hash);
- if (HAVE_ELEM_P(HAVE_ALPHA|HAVE_DIGIT))
+#ifdef TIGHT_PARSER
+ if (HAVE_ELEM_P(HAVE_ALPHA))
+ parse_era(str, hash);
+#endif
+
+ if (HAVE_ELEM_P(HAVE_ALPHA|HAVE_DIGIT)) {
if (parse_eu(str, hash))
goto ok;
- if (HAVE_ELEM_P(HAVE_ALPHA|HAVE_DIGIT))
if (parse_us(str, hash))
goto ok;
+ }
if (HAVE_ELEM_P(HAVE_DIGIT|HAVE_DASH))
if (parse_iso(str, hash))
goto ok;
@@ -1552,9 +2234,25 @@ date__parse(VALUE str, VALUE comp)
if (HAVE_ELEM_P(HAVE_DIGIT|HAVE_SLASH))
if (parse_sla(str, hash))
goto ok;
+#ifdef TIGHT_PARSER
+ if (HAVE_ELEM_P(HAVE_ALPHA|HAVE_DIGIT|HAVE_SLASH)) {
+ if (parse_sla2(str, hash))
+ goto ok;
+ if (parse_sla3(str, hash))
+ goto ok;
+ }
+#endif
if (HAVE_ELEM_P(HAVE_DIGIT|HAVE_DOT))
if (parse_dot(str, hash))
goto ok;
+#ifdef TIGHT_PARSER
+ if (HAVE_ELEM_P(HAVE_ALPHA|HAVE_DIGIT|HAVE_DOT)) {
+ if (parse_dot2(str, hash))
+ goto ok;
+ if (parse_dot3(str, hash))
+ goto ok;
+ }
+#endif
if (HAVE_ELEM_P(HAVE_DIGIT))
if (parse_iso2(str, hash))
goto ok;
@@ -1571,13 +2269,41 @@ date__parse(VALUE str, VALUE comp)
if (parse_ddd(str, hash))
goto ok;
+#ifdef TIGHT_PARSER
+ if (parse_wday_only(str, hash))
+ goto ok;
+ if (parse_time_only(str, hash))
+ goto ok;
+ if (parse_wday_and_time(str, hash))
+ goto ok;
+
+ PARSER_ERROR; /* not found */
+#endif
+
ok:
+#ifndef TIGHT_PARSER
if (HAVE_ELEM_P(HAVE_ALPHA))
parse_bc(str, hash);
if (HAVE_ELEM_P(HAVE_DIGIT))
parse_frag(str, hash);
+#endif
{
+ if (RTEST(ref_hash("_bc"))) {
+ VALUE y;
+
+ y = ref_hash("cwyear");
+ if (!NIL_P(y)) {
+ y = f_add(f_negate(y), INT2FIX(1));
+ set_hash("cwyear", y);
+ }
+ y = ref_hash("year");
+ if (!NIL_P(y)) {
+ y = f_add(f_negate(y), INT2FIX(1));
+ set_hash("year", y);
+ }
+ }
+
if (RTEST(ref_hash("_comp"))) {
VALUE y;
@@ -1598,8 +2324,10 @@ date__parse(VALUE str, VALUE comp)
set_hash("year", f_add(y, INT2FIX(2000)));
}
}
+
}
+ del_hash("_bc");
del_hash("_comp");
{
@@ -1719,7 +2447,7 @@ iso8601_ext_datetime(VALUE str, VALUE hash)
static VALUE pat = Qnil;
REGCOMP_I(pat);
- SUBS(str, pat, iso8601_ext_datetime_cb);
+ MATCH(str, pat, iso8601_ext_datetime_cb);
}
#undef SNUM
@@ -1810,7 +2538,7 @@ iso8601_bas_datetime(VALUE str, VALUE hash)
static VALUE pat = Qnil;
REGCOMP_I(pat);
- SUBS(str, pat, iso8601_bas_datetime_cb);
+ MATCH(str, pat, iso8601_bas_datetime_cb);
}
#undef SNUM
@@ -1848,24 +2576,24 @@ static int
iso8601_ext_time(VALUE str, VALUE hash)
{
static const char pat_source[] =
- "\\A\\s*(?:(\\d{2}):(\\d{2})(?::(\\d{2})(?:[,.](\\d+))?)?"
+ "\\A\\s*(\\d{2}):(\\d{2})(?::(\\d{2})(?:[,.](\\d+))?"
"(z|[-+]\\d{2}(:?\\d{2})?)?)?\\s*\\z";
static VALUE pat = Qnil;
REGCOMP_I(pat);
- SUBS(str, pat, iso8601_ext_time_cb);
+ MATCH(str, pat, iso8601_ext_time_cb);
}
static int
iso8601_bas_time(VALUE str, VALUE hash)
{
static const char pat_source[] =
- "\\A\\s*(?:(\\d{2})(\\d{2})(?:(\\d{2})(?:[,.](\\d+))?)?"
+ "\\A\\s*(\\d{2})(\\d{2})(?:(\\d{2})(?:[,.](\\d+))?"
"(z|[-+]\\d{2}(\\d{2})?)?)?\\s*\\z";
static VALUE pat = Qnil;
REGCOMP_I(pat);
- SUBS(str, pat, iso8601_bas_time_cb);
+ MATCH(str, pat, iso8601_bas_time_cb);
}
VALUE
@@ -1933,7 +2661,7 @@ rfc3339(VALUE str, VALUE hash)
static VALUE pat = Qnil;
REGCOMP_I(pat);
- SUBS(str, pat, rfc3339_cb);
+ MATCH(str, pat, rfc3339_cb);
}
VALUE
@@ -1997,7 +2725,7 @@ xmlschema_datetime(VALUE str, VALUE hash)
static VALUE pat = Qnil;
REGCOMP_I(pat);
- SUBS(str, pat, xmlschema_datetime_cb);
+ MATCH(str, pat, xmlschema_datetime_cb);
}
#undef SNUM
@@ -2038,7 +2766,7 @@ xmlschema_time(VALUE str, VALUE hash)
static VALUE pat = Qnil;
REGCOMP_I(pat);
- SUBS(str, pat, xmlschema_time_cb);
+ MATCH(str, pat, xmlschema_time_cb);
}
#undef SNUM
@@ -2079,7 +2807,7 @@ xmlschema_trunc(VALUE str, VALUE hash)
static VALUE pat = Qnil;
REGCOMP_I(pat);
- SUBS(str, pat, xmlschema_trunc_cb);
+ MATCH(str, pat, xmlschema_trunc_cb);
}
VALUE
@@ -2150,7 +2878,7 @@ rfc2822(VALUE str, VALUE hash)
static VALUE pat = Qnil;
REGCOMP_I(pat);
- SUBS(str, pat, rfc2822_cb);
+ MATCH(str, pat, rfc2822_cb);
}
VALUE
@@ -2208,7 +2936,7 @@ httpdate_type1(VALUE str, VALUE hash)
static VALUE pat = Qnil;
REGCOMP_I(pat);
- SUBS(str, pat, httpdate_type1_cb);
+ MATCH(str, pat, httpdate_type1_cb);
}
#undef SNUM
@@ -2255,7 +2983,7 @@ httpdate_type2(VALUE str, VALUE hash)
static VALUE pat = Qnil;
REGCOMP_I(pat);
- SUBS(str, pat, httpdate_type2_cb);
+ MATCH(str, pat, httpdate_type2_cb);
}
#undef SNUM
@@ -2296,7 +3024,7 @@ httpdate_type3(VALUE str, VALUE hash)
static VALUE pat = Qnil;
REGCOMP_I(pat);
- SUBS(str, pat, httpdate_type3_cb);
+ MATCH(str, pat, httpdate_type3_cb);
}
VALUE
@@ -2370,7 +3098,7 @@ jisx0301(VALUE str, VALUE hash)
static VALUE pat = Qnil;
REGCOMP_I(pat);
- SUBS(str, pat, jisx0301_cb);
+ MATCH(str, pat, jisx0301_cb);
}
VALUE
diff --git a/ext/date/date_strftime.c b/ext/date/date_strftime.c
index 71e1bd7f00..54324dad09 100644
--- a/ext/date/date_strftime.c
+++ b/ext/date/date_strftime.c
@@ -1,164 +1,20 @@
-/* -*- c-file-style: "linux" -*- */
-
/*
- * strftime.c
- *
- * Public-domain implementation of ANSI C library routine.
- *
- * It's written in old-style C for maximal portability.
- * However, since I'm used to prototypes, I've included them too.
- *
- * If you want stuff in the System V ascftime routine, add the SYSV_EXT define.
- * For extensions from SunOS, add SUNOS_EXT.
- * For stuff needed to implement the P1003.2 date command, add POSIX2_DATE.
- * For VMS dates, add VMS_EXT.
- * For a an RFC822 time format, add MAILHEADER_EXT.
- * For ISO week years, add ISO_DATE_EXT.
- * For complete POSIX semantics, add POSIX_SEMANTICS.
- *
- * The code for %c, %x, and %X now follows the 1003.2 specification for
- * the POSIX locale.
- * This version ignores LOCALE information.
- * It also doesn't worry about multi-byte characters.
- * So there.
- *
- * This file is also shipped with GAWK (GNU Awk), gawk specific bits of
- * code are included if GAWK is defined.
- *
- * Arnold Robbins
- * January, February, March, 1991
- * Updated March, April 1992
- * Updated April, 1993
- * Updated February, 1994
- * Updated May, 1994
- * Updated January, 1995
- * Updated September, 1995
- * Updated January, 1996
- *
- * Fixes from ado@elsie.nci.nih.gov
- * February 1991, May 1992
- * Fixes from Tor Lillqvist tml@tik.vtt.fi
- * May, 1993
- * Further fixes from ado@elsie.nci.nih.gov
- * February 1994
- * %z code from chip@chinacat.unicom.com
- * Applied September 1995
- * %V code fixed (again) and %G, %g added,
- * January 1996
+ date_strftime.c: based on a public-domain implementation of ANSI C
+ library routine strftime, which is originally written by Arnold
+ Robbins.
*/
#include "ruby/ruby.h"
#include "date_tmx.h"
-#ifndef GAWK
-#include <stdio.h>
-#include <ctype.h>
+#include <stdlib.h>
#include <string.h>
-#include <time.h>
-#include <sys/types.h>
+#include <ctype.h>
#include <errno.h>
-#endif
-#if defined(TM_IN_SYS_TIME) || !defined(GAWK)
-#include <sys/types.h>
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#endif
-#include <math.h>
-
-/* defaults: season to taste */
-#define SYSV_EXT 1 /* stuff in System V ascftime routine */
-#define SUNOS_EXT 1 /* stuff in SunOS strftime routine */
-#define POSIX2_DATE 1 /* stuff in Posix 1003.2 date command */
-#define VMS_EXT 1 /* include %v for VMS date format */
-#define MAILHEADER_EXT 1 /* add %z for HHMM format */
-#define ISO_DATE_EXT 1 /* %G and %g for year of ISO week */
-
-#if defined(ISO_DATE_EXT)
-#if ! defined(POSIX2_DATE)
-#define POSIX2_DATE 1
-#endif
-#endif
-
-#if defined(POSIX2_DATE)
-#if ! defined(SYSV_EXT)
-#define SYSV_EXT 1
-#endif
-#if ! defined(SUNOS_EXT)
-#define SUNOS_EXT 1
-#endif
-#endif
-
-#if defined(POSIX2_DATE)
-#define adddecl(stuff) stuff
-#else
-#define adddecl(stuff)
-#endif
#undef strchr /* avoid AIX weirdness */
-#if 0
-#if !defined __STDC__ && !defined _WIN32
-#define const /**/
-static int weeknumber();
-adddecl(static int iso8601wknum();)
-static int weeknumber_v();
-adddecl(static int iso8601wknum_v();)
-#else
-static int weeknumber(const struct tm *timeptr, int firstweekday);
-adddecl(static int iso8601wknum(const struct tm *timeptr);)
-static int weeknumber_v(const struct tmx *tmx, int firstweekday);
-adddecl(static int iso8601wknum_v(const struct tmx *tmx);)
-#endif
-#endif
-
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#include <string.h>
-#else
-extern void *malloc();
-extern void *realloc();
-extern char *getenv();
-extern char *strchr();
-#endif
-
-#define range(low, item, hi) max((low), min((item), (hi)))
-
-#undef min /* just in case */
-
-/* min --- return minimum of two numbers */
-
-#ifndef __STDC__
-static inline int
-min(a, b)
-int a, b;
-#else
-static inline int
-min(int a, int b)
-#endif
-{
- return (a < b ? a : b);
-}
-
-#undef max /* also, just in case */
-
-/* max --- return maximum of two numbers */
-
-#ifndef __STDC__
-static inline int
-max(a, b)
-int a, b;
-#else
-static inline int
-max(int a, int b)
-#endif
-{
- return (a > b ? a : b);
-}
-
-#ifdef NO_STRING_LITERAL_CONCATENATION
-#error No string literal concatenation
-#endif
+#define range(low, item, hi) (item)
#define add(x,y) (rb_funcall((x), '+', 1, (y)))
#define sub(x,y) (rb_funcall((x), '-', 1, (y)))
@@ -167,989 +23,607 @@ max(int a, int b)
#define div(x,y) (rb_funcall((x), rb_intern("div"), 1, (y)))
#define mod(x,y) (rb_funcall((x), '%', 1, (y)))
+static void
+upcase(char *s, size_t i)
+{
+ do {
+ if (ISLOWER(*s))
+ *s = TOUPPER(*s);
+ } while (s++, --i);
+}
+
+static void
+downcase(char *s, size_t i)
+{
+ do {
+ if (ISUPPER(*s))
+ *s = TOLOWER(*s);
+ } while (s++, --i);
+}
+
/* strftime --- produce formatted time */
static size_t
date_strftime_with_tmx(char *s, size_t maxsize, const char *format,
const struct tmx *tmx)
{
- char *endp = s + maxsize;
- char *start = s;
- const char *sp, *tp;
- auto char tbuf[100];
- long off;
- ptrdiff_t i;
- int w;
- int precision, flags, colons;
- char padding;
- enum {LEFT, CHCASE, LOWER, UPPER, LOCALE_O, LOCALE_E};
+ char *endp = s + maxsize;
+ char *start = s;
+ const char *sp, *tp;
+ auto char tbuf[100];
+ ptrdiff_t i;
+ int v, w;
+ size_t colons;
+ int precision, flags;
+ char padding;
+ /* LOCALE_[OE] and COLONS are actually modifiers, not flags */
+ enum {LEFT, CHCASE, LOWER, UPPER, LOCALE_O, LOCALE_E, COLONS};
#define BIT_OF(n) (1U<<(n))
- /* various tables, useful in North America */
- static const char days_l[][10] = {
- "Sunday", "Monday", "Tuesday", "Wednesday",
- "Thursday", "Friday", "Saturday",
- };
- static const char months_l[][10] = {
- "January", "February", "March", "April",
- "May", "June", "July", "August", "September",
- "October", "November", "December",
- };
- static const char ampm[][3] = { "AM", "PM", };
-
- if (s == NULL || format == NULL || tmx == NULL || maxsize == 0)
- return 0;
-
- /* quick check if we even need to bother */
- if (strchr(format, '%') == NULL && strlen(format) + 1 >= maxsize) {
- err:
- errno = ERANGE;
- return 0;
- }
-
- for (; *format && s < endp - 1; format++) {
-#define FLAG_FOUND() do { \
- if (precision > 0 || flags & (BIT_OF(LOCALE_E)|BIT_OF(LOCALE_O))) \
- goto unknown; \
- } while (0)
+ /* various tables for locale C */
+ static const char days_l[][10] = {
+ "Sunday", "Monday", "Tuesday", "Wednesday",
+ "Thursday", "Friday", "Saturday",
+ };
+ static const char months_l[][10] = {
+ "January", "February", "March", "April",
+ "May", "June", "July", "August", "September",
+ "October", "November", "December",
+ };
+ static const char ampm[][3] = { "AM", "PM", };
+
+ if (s == NULL || format == NULL || tmx == NULL || maxsize == 0)
+ return 0;
+
+ /* quick check if we even need to bother */
+ if (strchr(format, '%') == NULL && strlen(format) + 1 >= maxsize) {
+ err:
+ errno = ERANGE;
+ return 0;
+ }
+
+ for (; *format && s < endp - 1; format++) {
+#define FLAG_FOUND() do { \
+ if (precision > 0 || flags & (BIT_OF(LOCALE_E) | BIT_OF(LOCALE_O) | BIT_OF(COLONS))) \
+ goto unknown; \
+ } while (0)
#define NEEDS(n) do if (s >= endp || (n) >= endp - s - 1) goto err; while (0)
-#define FILL_PADDING(i) do { \
- if (!(flags & BIT_OF(LEFT)) && precision > (i)) { \
- NEEDS(precision); \
- memset(s, padding ? padding : ' ', precision - (i)); \
- s += precision - (i); \
- } \
- else { \
- NEEDS(i); \
- } \
-} while (0);
-#define FMT(def_pad, def_prec, fmt, val) \
- do { \
- int l; \
- if (precision <= 0) precision = (def_prec); \
- if (flags & BIT_OF(LEFT)) precision = 1; \
- l = snprintf(s, endp - s, \
- ((padding == '0' || (!padding && (def_pad) == '0')) ? "%0*"fmt : "%*"fmt), \
- precision, (val)); \
- if (l < 0) goto err; \
- s += l; \
- } while (0)
-#define STRFTIME(fmt) \
- do { \
- i = date_strftime_with_tmx(s, endp - s, (fmt), tmx); \
- if (!i) return 0; \
- if (precision > i) {\
- if (start + maxsize < s + precision) { \
- errno = ERANGE; \
- return 0; \
- } \
- memmove(s + precision - i, s, i);\
- memset(s, padding ? padding : ' ', precision - i); \
- s += precision; \
- }\
- else s += i; \
- } while (0)
-#define FMTV(def_pad, def_prec, fmt, val) \
- do { \
- VALUE tmp = (val); \
- if (FIXNUM_P(tmp)) { \
- FMT((def_pad), (def_prec), "l"fmt, FIX2LONG(tmp)); \
- } \
- else { \
- VALUE args[2], result; \
- size_t l; \
- if (precision <= 0) precision = (def_prec); \
- if (flags & BIT_OF(LEFT)) precision = 1; \
- args[0] = INT2FIX(precision); \
- args[1] = (val); \
- if (padding == '0' || (!padding && (def_pad) == '0')) \
- result = rb_str_format(2, args, rb_str_new2("%0*"fmt)); \
- else \
- result = rb_str_format(2, args, rb_str_new2("%*"fmt)); \
- l = strlcpy(s, StringValueCStr(result), endp-s); \
- if ((size_t)(endp-s) <= l) \
- goto err; \
- s += l; \
- } \
- } while (0)
-
- if (*format != '%') {
- *s++ = *format;
- continue;
+#define FILL_PADDING(i) do { \
+ if (!(flags & BIT_OF(LEFT)) && precision > (i)) { \
+ NEEDS(precision); \
+ memset(s, padding ? padding : ' ', precision - (i)); \
+ s += precision - (i); \
+ } \
+ else { \
+ NEEDS(i); \
+ } \
+ } while (0);
+#define FMT(def_pad, def_prec, fmt, val) \
+ do { \
+ int l; \
+ if (precision <= 0) precision = (def_prec); \
+ if (flags & BIT_OF(LEFT)) precision = 1; \
+ l = snprintf(s, endp - s, \
+ ((padding == '0' || (!padding && (def_pad) == '0')) ? \
+ "%0*"fmt : "%*"fmt), \
+ precision, (val)); \
+ if (l < 0) goto err; \
+ s += l; \
+ } while (0)
+#define STRFTIME(fmt) \
+ do { \
+ i = date_strftime_with_tmx(s, endp - s, (fmt), tmx); \
+ if (!i) return 0; \
+ if (flags & BIT_OF(UPPER)) \
+ upcase(s, i); \
+ if (!(flags & BIT_OF(LEFT)) && precision > i) { \
+ if (start + maxsize < s + precision) { \
+ errno = ERANGE; \
+ return 0; \
+ } \
+ memmove(s + precision - i, s, i); \
+ memset(s, padding ? padding : ' ', precision - i); \
+ s += precision; \
+ } \
+ else s += i; \
+ } while (0)
+#define FMTV(def_pad, def_prec, fmt, val) \
+ do { \
+ VALUE tmp = (val); \
+ if (FIXNUM_P(tmp)) { \
+ FMT((def_pad), (def_prec), "l"fmt, FIX2LONG(tmp)); \
+ } \
+ else { \
+ VALUE args[2], result; \
+ size_t l; \
+ if (precision <= 0) precision = (def_prec); \
+ if (flags & BIT_OF(LEFT)) precision = 1; \
+ args[0] = INT2FIX(precision); \
+ args[1] = (val); \
+ if (padding == '0' || (!padding && (def_pad) == '0')) \
+ result = rb_str_format(2, args, rb_str_new2("%0*"fmt)); \
+ else \
+ result = rb_str_format(2, args, rb_str_new2("%*"fmt)); \
+ l = strlcpy(s, StringValueCStr(result), endp - s); \
+ if ((size_t)(endp - s) <= l) \
+ goto err; \
+ s += l; \
+ } \
+ } while (0)
+
+ if (*format != '%') {
+ *s++ = *format;
+ continue;
+ }
+ tp = tbuf;
+ sp = format;
+ precision = -1;
+ flags = 0;
+ padding = 0;
+ colons = 0;
+ again:
+ switch (*++format) {
+ case '\0':
+ format--;
+ goto unknown;
+
+ case 'A': /* full weekday name */
+ case 'a': /* abbreviated weekday name */
+ if (flags & BIT_OF(CHCASE)) {
+ flags &= ~(BIT_OF(LOWER) | BIT_OF(CHCASE));
+ flags |= BIT_OF(UPPER);
+ }
+ {
+ int wday = tmx_wday;
+ if (wday < 0 || wday > 6)
+ i = 1, tp = "?";
+ else {
+ if (*format == 'A')
+ i = strlen(tp = days_l[wday]);
+ else
+ i = 3, tp = days_l[wday];
}
- tp = tbuf;
- sp = format;
- precision = -1;
- flags = 0;
- padding = 0;
- colons = 0;
- again:
- switch (*++format) {
- case '\0':
- format--;
- goto unknown;
-
- case '%':
- FILL_PADDING(1);
- *s++ = '%';
- continue;
-
- case 'a': /* abbreviated weekday name */
- if (flags & BIT_OF(CHCASE)) {
- flags &= ~(BIT_OF(LOWER)|BIT_OF(CHCASE));
- flags |= BIT_OF(UPPER);
- }
- {
- int wday = tmx_wday;
- if (wday < 0 || wday > 6)
- i = 1, tp = "?";
- else
- i = 3, tp = days_l[wday];
- }
- break;
-
- case 'A': /* full weekday name */
- if (flags & BIT_OF(CHCASE)) {
- flags &= ~(BIT_OF(LOWER)|BIT_OF(CHCASE));
- flags |= BIT_OF(UPPER);
- }
- {
- int wday = tmx_wday;
- if (wday < 0 || wday > 6)
- i = 1, tp = "?";
- else
- i = strlen(tp = days_l[wday]);
- }
- break;
-
-#ifdef SYSV_EXT
- case 'h': /* abbreviated month name */
-#endif
- case 'b': /* abbreviated month name */
- if (flags & BIT_OF(CHCASE)) {
- flags &= ~(BIT_OF(LOWER)|BIT_OF(CHCASE));
- flags |= BIT_OF(UPPER);
- }
- {
- int mon = tmx_mon;
- if (mon < 1 || mon > 12)
- i = 1, tp = "?";
- else
- i = 3, tp = months_l[mon-1];
- }
- break;
-
- case 'B': /* full month name */
- if (flags & BIT_OF(CHCASE)) {
- flags &= ~(BIT_OF(LOWER)|BIT_OF(CHCASE));
- flags |= BIT_OF(UPPER);
- }
- {
- int mon = tmx_mon;
- if (mon < 1 || mon > 12)
- i = 1, tp = "?";
- else
- i = strlen(tp = months_l[mon-1]);
- }
- break;
-
- case 'c': /* appropriate date and time representation */
- STRFTIME("%a %b %e %H:%M:%S %Y");
- continue;
-
- case 'd': /* day of the month, 01 - 31 */
- i = range(1, tmx_mday, 31);
- FMT('0', 2, "d", (int)i);
- continue;
-
- case 'H': /* hour, 24-hour clock, 00 - 23 */
- i = range(0, tmx_hour, 23);
- FMT('0', 2, "d", (int)i);
- continue;
-
- case 'I': /* hour, 12-hour clock, 01 - 12 */
- i = range(0, tmx_hour, 23);
- if (i == 0)
- i = 12;
- else if (i > 12)
- i -= 12;
- FMT('0', 2, "d", (int)i);
- continue;
-
- case 'j': /* day of the year, 001 - 366 */
- FMT('0', 3, "d", tmx_yday);
- continue;
-
- case 'm': /* month, 01 - 12 */
- i = range(1, tmx_mon, 12);
- FMT('0', 2, "d", (int)i);
- continue;
-
- case 'M': /* minute, 00 - 59 */
- i = range(0, tmx_min, 59);
- FMT('0', 2, "d", (int)i);
- continue;
-
- case 'p': /* AM or PM based on 12-hour clock */
- case 'P': /* am or pm based on 12-hour clock */
- if ((*format == 'p' && (flags & BIT_OF(CHCASE))) ||
- (*format == 'P' && !(flags & (BIT_OF(CHCASE)|BIT_OF(UPPER))))) {
- flags &= ~(BIT_OF(UPPER)|BIT_OF(CHCASE));
- flags |= BIT_OF(LOWER);
- }
- i = range(0, tmx_hour, 23);
- if (i < 12)
- tp = ampm[0];
- else
- tp = ampm[1];
- i = 2;
- break;
-
- case 's':
- FMTV('0', 1, "d", tmx_secs);
- continue;
-
- case 'Q':
- FMTV('0', 1, "d", tmx_msecs);
- continue;
-
- case 'S': /* second, 00 - 59 */
- i = range(0, tmx_sec, 59);
- FMT('0', 2, "d", (int)i);
- continue;
-
- case 'U': /* week of year, Sunday is first day of week */
- FMT('0', 2, "d", tmx_wnum0);
- continue;
-
- case 'w': /* weekday, Sunday == 0, 0 - 6 */
- i = range(0, tmx_wday, 6);
- FMT('0', 1, "d", (int)i);
- continue;
-
- case 'W': /* week of year, Monday is first day of week */
- FMT('0', 2, "d", tmx_wnum1);
- continue;
-
- case 'x': /* appropriate date representation */
- STRFTIME("%m/%d/%y");
- continue;
-
- case 'X': /* appropriate time representation */
- STRFTIME("%H:%M:%S");
- continue;
-
- case 'y': /* year without a century, 00 - 99 */
- i = NUM2INT(mod(tmx_year, INT2FIX(100)));
- FMT('0', 2, "d", (int)i);
- continue;
-
- case 'Y': /* year with century */
- {
- VALUE year = tmx_year;
- if (FIXNUM_P(year)) {
- long y = FIX2LONG(year);
- FMT('0', 0 <= y ? 4 : 5, "ld", y);
- }
- else {
- FMTV('0', 4, "d", year);
- }
- }
- continue;
-
-#ifdef MAILHEADER_EXT
- case 'z': /* time zone offset east of GMT e.g. -0600 */
- {
- long aoff;
- int hl, hw;
-
- off = NUM2LONG(rb_funcall(tmx_offset, rb_intern("round"), 0));
-
- aoff = off;
- if (aoff < 0)
- aoff = -off;
-
- if ((aoff / 3600) < 10)
- hl = 1;
- else
- hl = 2;
- hw = 2;
- if (flags & BIT_OF(LEFT) && hl == 1)
- hw = 1;
-
- switch (colons) {
- case 0: /* %z -> +hhmm */
- precision = precision <= (3 + hw) ? hw : precision-3;
- NEEDS(precision + 3);
- break;
-
- case 1: /* %:z -> +hh:mm */
- precision = precision <= (4 + hw) ? hw : precision-4;
- NEEDS(precision + 4);
- break;
-
- case 2: /* %::z -> +hh:mm:ss */
- precision = precision <= (7 + hw) ? hw : precision-7;
- NEEDS(precision + 7);
- break;
-
- case 3: /* %:::z -> +hh[:mm[:ss]] */
- {
- if (aoff % 3600 == 0) {
- precision = precision <= (1 + hw) ? hw : precision-1;
- NEEDS(precision + 3);
- }
- else if (aoff % 60 == 0) {
- precision = precision <= (4 + hw) ? hw : precision-4;
- NEEDS(precision + 4);
- }
- else {
- precision = precision <= (7 + hw) ? hw : precision-7;
- NEEDS(precision + 7);
- }
- }
- break;
-
- default:
- format--;
- goto unknown;
- }
- if (padding == ' ' && precision > hl) {
- i = snprintf(s, endp - s, "%*s", precision - hl, "");
- precision = hl;
- if (i < 0) goto err;
- s += i;
- }
- if (off < 0) {
- off = -off;
- *s++ = '-';
- } else {
- *s++ = '+';
- }
- i = snprintf(s, endp - s, "%.*ld", precision, off / 3600);
- if (i < 0) goto err;
- s += i;
- off = off % 3600;
- if (colons == 3 && off == 0)
- continue;
- if (1 <= colons)
- *s++ = ':';
- i = snprintf(s, endp - s, "%02d", (int)(off / 60));
- if (i < 0) goto err;
- s += i;
- off = off % 60;
- if (colons == 3 && off == 0)
- continue;
- if (2 <= colons) {
- *s++ = ':';
- i = snprintf(s, endp - s, "%02d", (int)off);
- if (i < 0) goto err;
- s += i;
- }
- }
- continue;
-#endif /* MAILHEADER_EXT */
-
- case 'Z': /* time zone name or abbreviation */
- if (flags & BIT_OF(CHCASE)) {
- flags &= ~(BIT_OF(UPPER)|BIT_OF(CHCASE));
- flags |= BIT_OF(LOWER);
- }
- {
- char *zone = tmx_zone;
- if (zone == NULL)
- tp = "";
- else
- tp = zone;
- i = strlen(tp);
- }
- break;
-
-#ifdef SYSV_EXT
- case 'n': /* same as \n */
- FILL_PADDING(1);
- *s++ = '\n';
- continue;
-
- case 't': /* same as \t */
- FILL_PADDING(1);
- *s++ = '\t';
- continue;
-
- case 'D': /* date as %m/%d/%y */
- STRFTIME("%m/%d/%y");
- continue;
-
- case 'e': /* day of month, blank padded */
- FMT(' ', 2, "d", range(1, tmx_mday, 31));
- continue;
-
- case 'r': /* time as %I:%M:%S %p */
- STRFTIME("%I:%M:%S %p");
- continue;
-
- case 'R': /* time as %H:%M */
- STRFTIME("%H:%M");
- continue;
-
- case 'T': /* time as %H:%M:%S */
- STRFTIME("%H:%M:%S");
- continue;
-#endif
-
-#ifdef SUNOS_EXT
- case 'k': /* hour, 24-hour clock, blank pad */
- i = range(0, tmx_hour, 23);
- FMT(' ', 2, "d", (int)i);
- continue;
-
- case 'l': /* hour, 12-hour clock, 1 - 12, blank pad */
- i = range(0, tmx_hour, 23);
- if (i == 0)
- i = 12;
- else if (i > 12)
- i -= 12;
- FMT(' ', 2, "d", (int)i);
- continue;
-#endif
-
-#ifdef VMS_EXT
- case 'v': /* date as dd-bbb-YYYY */
- STRFTIME("%e-%b-%Y");
- continue;
-#endif
-
-#ifdef POSIX2_DATE
- case 'C':
- FMTV('0', 2, "d", div(tmx_year, INT2FIX(100)));
- continue;
-
- case 'E':
- /* POSIX locale extensions, ignored for now */
- flags |= BIT_OF(LOCALE_E);
- if (*(format + 1) && strchr("cCxXyY", *(format + 1)))
- goto again;
- goto unknown;
- case 'O':
- /* POSIX locale extensions, ignored for now */
- flags |= BIT_OF(LOCALE_O);
- if (*(format + 1) && strchr("deHImMSuUVwWy",
- *(format + 1)))
- goto again;
- goto unknown;
- case 'V': /* week of year according ISO 8601 */
- FMT('0', 2, "d", tmx_cweek);
- continue;
-
- case 'u':
- /* ISO 8601: Weekday as a decimal number [1 (Monday) - 7] */
- FMT('0', 1, "d", tmx_cwday);
- continue;
-#endif /* POSIX2_DATE */
-
-#ifdef ISO_DATE_EXT
- case 'g': /* year of ISO week without a century */
- i = NUM2INT(mod(tmx_cwyear, INT2FIX(100)));
- FMT('0', 2, "d", (int)i);
- continue;
-
- case 'G': /* year of ISO week with century */
- {
- VALUE year = tmx_cwyear;
- if (FIXNUM_P(year)) {
- long y = FIX2LONG(year);
- FMT('0', 0 <= y ? 4 : 5, "ld", y);
- }
- else {
- FMTV('0', 4, "d", year);
- }
- continue;
+ }
+ break;
+
+ case 'B': /* full month name */
+ case 'b': /* abbreviated month name */
+ case 'h': /* same as %b */
+ if (flags & BIT_OF(CHCASE)) {
+ flags &= ~(BIT_OF(LOWER) | BIT_OF(CHCASE));
+ flags |= BIT_OF(UPPER);
+ }
+ {
+ int mon = tmx_mon;
+ if (mon < 1 || mon > 12)
+ i = 1, tp = "?";
+ else {
+ if (*format == 'B')
+ i = strlen(tp = months_l[mon - 1]);
+ else
+ i = 3, tp = months_l[mon - 1];
+ }
+ }
+ break;
+
+ case 'C': /* century (year/100) */
+ FMTV('0', 2, "d", div(tmx_year, INT2FIX(100)));
+ continue;
+
+ case 'c': /* appropriate date and time representation */
+ STRFTIME("%a %b %e %H:%M:%S %Y");
+ continue;
+
+ case 'D':
+ STRFTIME("%m/%d/%y");
+ continue;
+
+ case 'd': /* day of the month, 01 - 31 */
+ case 'e': /* day of month, blank padded */
+ v = range(1, tmx_mday, 31);
+ FMT((*format == 'd') ? '0' : ' ', 2, "d", v);
+ continue;
+
+ case 'F':
+ STRFTIME("%Y-%m-%d");
+ continue;
+
+ case 'G': /* year of ISO week with century */
+ case 'Y': /* year with century */
+ {
+ VALUE year = (*format == 'G') ? tmx_cwyear : tmx_year;
+ if (FIXNUM_P(year)) {
+ long y = FIX2LONG(year);
+ FMT('0', 0 <= y ? 4 : 5, "ld", y);
+ }
+ else {
+ FMTV('0', 4, "d", year);
+ }
+ }
+ continue;
+
+ case 'g': /* year of ISO week without a century */
+ case 'y': /* year without a century */
+ v = NUM2INT(mod((*format == 'g') ? tmx_cwyear : tmx_year, INT2FIX(100)));
+ FMT('0', 2, "d", v);
+ continue;
+
+ case 'H': /* hour, 24-hour clock, 00 - 23 */
+ case 'k': /* hour, 24-hour clock, blank pad */
+ v = range(0, tmx_hour, 23);
+ FMT((*format == 'H') ? '0' : ' ', 2, "d", v);
+ continue;
+
+ case 'I': /* hour, 12-hour clock, 01 - 12 */
+ case 'l': /* hour, 12-hour clock, 1 - 12, blank pad */
+ v = range(0, tmx_hour, 23);
+ if (v == 0)
+ v = 12;
+ else if (v > 12)
+ v -= 12;
+ FMT((*format == 'I') ? '0' : ' ', 2, "d", v);
+ continue;
+
+ case 'j': /* day of the year, 001 - 366 */
+ v = range(1, tmx_yday, 366);
+ FMT('0', 3, "d", v);
+ continue;
+
+ case 'L': /* millisecond */
+ case 'N': /* nanosecond */
+ if (*format == 'L')
+ w = 3;
+ else
+ w = 9;
+ if (precision <= 0)
+ precision = w;
+ NEEDS(precision);
+
+ {
+ VALUE subsec = tmx_sec_fraction;
+ int ww;
+ long n;
+
+ ww = precision;
+ while (9 <= ww) {
+ subsec = mul(subsec, INT2FIX(1000000000));
+ ww -= 9;
+ }
+ n = 1;
+ for (; 0 < ww; ww--)
+ n *= 10;
+ if (n != 1)
+ subsec = mul(subsec, INT2FIX(n));
+ subsec = div(subsec, INT2FIX(1));
+
+ if (FIXNUM_P(subsec)) {
+ (void)snprintf(s, endp - s, "%0*ld",
+ precision, FIX2LONG(subsec));
+ s += precision;
+ }
+ else {
+ VALUE args[2], result;
+ args[0] = INT2FIX(precision);
+ args[1] = subsec;
+ result = rb_str_format(2, args, rb_str_new2("%0*d"));
+ (void)strlcpy(s, StringValueCStr(result), endp - s);
+ s += precision;
+ }
+ }
+ continue;
+
+ case 'M': /* minute, 00 - 59 */
+ v = range(0, tmx_min, 59);
+ FMT('0', 2, "d", v);
+ continue;
+
+ case 'm': /* month, 01 - 12 */
+ v = range(1, tmx_mon, 12);
+ FMT('0', 2, "d", v);
+ continue;
+
+ case 'n': /* same as \n */
+ FILL_PADDING(1);
+ *s++ = '\n';
+ continue;
+
+ case 't': /* same as \t */
+ FILL_PADDING(1);
+ *s++ = '\t';
+ continue;
+
+ case 'P': /* am or pm based on 12-hour clock */
+ case 'p': /* AM or PM based on 12-hour clock */
+ if ((*format == 'p' && (flags & BIT_OF(CHCASE))) ||
+ (*format == 'P' && !(flags & (BIT_OF(CHCASE) | BIT_OF(UPPER))))) {
+ flags &= ~(BIT_OF(UPPER) | BIT_OF(CHCASE));
+ flags |= BIT_OF(LOWER);
+ }
+ v = range(0, tmx_hour, 23);
+ if (v < 12)
+ tp = ampm[0];
+ else
+ tp = ampm[1];
+ i = 2;
+ break;
+
+ case 'Q': /* milliseconds since Unix epoch */
+ FMTV('0', 1, "d", tmx_msecs);
+ continue;
+
+ case 'R':
+ STRFTIME("%H:%M");
+ continue;
+
+ case 'r':
+ STRFTIME("%I:%M:%S %p");
+ continue;
+
+ case 'S': /* second, 00 - 59 */
+ v = range(0, tmx_sec, 59);
+ FMT('0', 2, "d", v);
+ continue;
+
+ case 's': /* seconds since Unix epoch */
+ FMTV('0', 1, "d", tmx_secs);
+ continue;
+
+ case 'T':
+ STRFTIME("%H:%M:%S");
+ continue;
+
+ case 'U': /* week of year, Sunday is first day of week */
+ case 'W': /* week of year, Monday is first day of week */
+ v = range(0, (*format == 'U') ? tmx_wnum0 : tmx_wnum1, 53);
+ FMT('0', 2, "d", v);
+ continue;
+
+ case 'u': /* weekday, Monday == 1, 1 - 7 */
+ v = range(1, tmx_cwday, 7);
+ FMT('0', 1, "d", v);
+ continue;
+
+ case 'V': /* week of year according ISO 8601 */
+ v = range(1, tmx_cweek, 53);
+ FMT('0', 2, "d", v);
+ continue;
+
+ case 'v':
+ STRFTIME("%e-%b-%Y");
+ continue;
+
+ case 'w': /* weekday, Sunday == 0, 0 - 6 */
+ v = range(0, tmx_wday, 6);
+ FMT('0', 1, "d", v);
+ continue;
+
+ case 'X': /* appropriate time representation */
+ STRFTIME("%H:%M:%S");
+ continue;
+
+ case 'x': /* appropriate date representation */
+ STRFTIME("%m/%d/%y");
+ continue;
+
+ case 'Z': /* time zone name or abbreviation */
+ if (flags & BIT_OF(CHCASE)) {
+ flags &= ~(BIT_OF(UPPER) | BIT_OF(CHCASE));
+ flags |= BIT_OF(LOWER);
+ }
+ {
+ char *zone = tmx_zone;
+ if (zone == NULL)
+ tp = "";
+ else
+ tp = zone;
+ i = strlen(tp);
+ }
+ break;
+
+ case 'z': /* offset from UTC */
+ {
+ long off, aoff;
+ int hl, hw;
+
+ off = tmx_offset;
+ aoff = off;
+ if (aoff < 0)
+ aoff = -off;
+
+ if ((aoff / 3600) < 10)
+ hl = 1;
+ else
+ hl = 2;
+ hw = 2;
+ if (flags & BIT_OF(LEFT) && hl == 1)
+ hw = 1;
+
+ switch (colons) {
+ case 0: /* %z -> +hhmm */
+ precision = precision <= (3 + hw) ? hw : precision - 3;
+ NEEDS(precision + 3);
+ break;
+
+ case 1: /* %:z -> +hh:mm */
+ precision = precision <= (4 + hw) ? hw : precision - 4;
+ NEEDS(precision + 4);
+ break;
+
+ case 2: /* %::z -> +hh:mm:ss */
+ precision = precision <= (7 + hw) ? hw : precision - 7;
+ NEEDS(precision + 7);
+ break;
+
+ case 3: /* %:::z -> +hh[:mm[:ss]] */
+ {
+ if (aoff % 3600 == 0) {
+ precision = precision <= (1 + hw) ?
+ hw : precision - 1;
+ NEEDS(precision + 3);
}
-
-#endif /* ISO_DATE_EXT */
-
- case 'L':
- w = 3;
- goto subsec;
-
- case 'N':
- /*
- * fractional second digits. default is 9 digits
- * (nanosecond).
- *
- * %3N millisecond (3 digits)
- * %6N microsecond (6 digits)
- * %9N nanosecond (9 digits)
- */
- w = 9;
- subsec:
- if (precision <= 0) {
- precision = w;
- }
- NEEDS(precision);
-
- {
- VALUE subsec = tmx_sec_fraction;
- int ww;
- long n;
-
- ww = precision;
- while (9 <= ww) {
- subsec = mul(subsec, INT2FIX(1000000000));
- ww -= 9;
- }
- n = 1;
- for (; 0 < ww; ww--)
- n *= 10;
- if (n != 1)
- subsec = mul(subsec, INT2FIX(n));
- subsec = div(subsec, INT2FIX(1));
-
- if (FIXNUM_P(subsec)) {
- (void)snprintf(s, endp - s, "%0*ld", precision, FIX2LONG(subsec));
- s += precision;
- }
- else {
- VALUE args[2], result;
- args[0] = INT2FIX(precision);
- args[1] = subsec;
- result = rb_str_format(2, args, rb_str_new2("%0*d"));
- (void)strlcpy(s, StringValueCStr(result), endp-s);
- s += precision;
- }
+ else if (aoff % 60 == 0) {
+ precision = precision <= (4 + hw) ?
+ hw : precision - 4;
+ NEEDS(precision + 4);
}
- continue;
-
- case 'F': /* Equivalent to %Y-%m-%d */
- STRFTIME("%Y-%m-%d");
- continue;
- case '+':
- STRFTIME("%a %b %e %H:%M:%S %Z %Y");
- continue;
-
- case '-':
- FLAG_FOUND();
- flags |= BIT_OF(LEFT);
- padding = precision = 0;
- goto again;
-
- case '^':
- FLAG_FOUND();
- flags |= BIT_OF(UPPER);
- goto again;
-
- case '#':
- FLAG_FOUND();
- flags |= BIT_OF(CHCASE);
- goto again;
-
- case '_':
- FLAG_FOUND();
- padding = ' ';
- goto again;
-
- case ':':
- colons++;
- goto again;
-
- case '0':
- padding = '0';
- case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- {
- char *e;
- precision = (int)strtoul(format, &e, 10);
- format = e - 1;
- goto again;
+ else {
+ precision = precision <= (7 + hw) ?
+ hw : precision - 7;
+ NEEDS(precision + 7);
}
+ }
+ break;
- default:
- unknown:
- i = format - sp + 1;
- tp = sp;
- precision = -1;
- flags = 0;
- padding = 0;
- colons = 0;
- break;
+ default:
+ format--;
+ goto unknown;
}
- if (i) {
- FILL_PADDING(i);
- memcpy(s, tp, i);
- switch (flags & (BIT_OF(UPPER)|BIT_OF(LOWER))) {
- case BIT_OF(UPPER):
- do {
- if (ISLOWER(*s)) *s = TOUPPER(*s);
- } while (s++, --i);
- break;
- case BIT_OF(LOWER):
- do {
- if (ISUPPER(*s)) *s = TOLOWER(*s);
- } while (s++, --i);
- break;
- default:
- s += i;
- break;
- }
+ if (padding == ' ' && precision > hl) {
+ i = snprintf(s, endp - s, "%*s", precision - hl, "");
+ precision = hl;
+ if (i < 0) goto err;
+ s += i;
+ }
+ if (off < 0) {
+ off = -off;
+ *s++ = '-';
+ } else {
+ *s++ = '+';
}
+ i = snprintf(s, endp - s, "%.*ld", precision, off / 3600);
+ if (i < 0) goto err;
+ s += i;
+ off = off % 3600;
+ if (colons == 3 && off == 0)
+ continue;
+ if (1 <= colons)
+ *s++ = ':';
+ i = snprintf(s, endp - s, "%02d", (int)(off / 60));
+ if (i < 0) goto err;
+ s += i;
+ off = off % 60;
+ if (colons == 3 && off == 0)
+ continue;
+ if (2 <= colons) {
+ *s++ = ':';
+ i = snprintf(s, endp - s, "%02d", (int)off);
+ if (i < 0) goto err;
+ s += i;
+ }
+ }
+ continue;
+
+ case '+':
+ STRFTIME("%a %b %e %H:%M:%S %Z %Y");
+ continue;
+
+ case 'E':
+ /* POSIX locale extensions, ignored for now */
+ flags |= BIT_OF(LOCALE_E);
+ if (*(format + 1) && strchr("cCxXyY", *(format + 1)))
+ goto again;
+ goto unknown;
+ case 'O':
+ /* POSIX locale extensions, ignored for now */
+ flags |= BIT_OF(LOCALE_O);
+ if (*(format + 1) && strchr("deHkIlmMSuUVwWy", *(format + 1)))
+ goto again;
+ goto unknown;
+
+ case ':':
+ flags |= BIT_OF(COLONS);
+ {
+ size_t l = strspn(format, ":");
+ format += l;
+ if (*format == 'z') {
+ colons = l;
+ format--;
+ goto again;
+ }
+ format -= l;
+ }
+ goto unknown;
+
+ case '_':
+ FLAG_FOUND();
+ padding = ' ';
+ goto again;
+
+ case '-':
+ FLAG_FOUND();
+ flags |= BIT_OF(LEFT);
+ goto again;
+
+ case '^':
+ FLAG_FOUND();
+ flags |= BIT_OF(UPPER);
+ goto again;
+
+ case '#':
+ FLAG_FOUND();
+ flags |= BIT_OF(CHCASE);
+ goto again;
+
+ case '0':
+ FLAG_FOUND();
+ padding = '0';
+ case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ {
+ char *e;
+ precision = (int)strtoul(format, &e, 10);
+ format = e - 1;
+ goto again;
+ }
+
+ case '%':
+ FILL_PADDING(1);
+ *s++ = '%';
+ continue;
+
+ default:
+ unknown:
+ i = format - sp + 1;
+ tp = sp;
+ precision = -1;
+ flags = 0;
+ padding = 0;
+ colons = 0;
+ break;
}
- if (s >= endp) {
- goto err;
+ if (i) {
+ FILL_PADDING(i);
+ memcpy(s, tp, i);
+ switch (flags & (BIT_OF(UPPER) | BIT_OF(LOWER))) {
+ case BIT_OF(UPPER):
+ upcase(s, i);
+ break;
+ case BIT_OF(LOWER):
+ downcase(s, i);
+ break;
+ }
+ s += i;
}
- if (*format == '\0') {
- *s = '\0';
- return (s - start);
- } else
- return 0;
+ }
+ if (s >= endp) {
+ goto err;
+ }
+ if (*format == '\0') {
+ *s = '\0';
+ return (s - start);
+ }
+ return 0;
}
size_t
date_strftime(char *s, size_t maxsize, const char *format,
const struct tmx *tmx)
{
- return date_strftime_with_tmx(s, maxsize, format, tmx);
-}
-
-#if 0
-/* isleap --- is a year a leap year? */
-
-#ifndef __STDC__
-static int
-isleap(year)
-long year;
-#else
-static int
-isleap(long year)
-#endif
-{
- return ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0);
+ return date_strftime_with_tmx(s, maxsize, format, tmx);
}
-static void
-tmx2tm_noyear(const struct tmx *tmx, struct tm *result)
-{
- struct tm tm;
-
- /* for isleap() in iso8601wknum. +100 is -1900 (mod 400). */
- tm.tm_year = FIX2INT(mod(tmx_year, INT2FIX(400))) + 100;
-
- tm.tm_mon = tmx_mon-1;
- tm.tm_mday = tmx_mday;
- tm.tm_hour = tmx_hour;
- tm.tm_min = tmx_min;
- tm.tm_sec = tmx_sec;
- tm.tm_wday = tmx_wday;
- tm.tm_yday = tmx_yday-1;
- tm.tm_isdst = 0;
-#if defined(HAVE_STRUCT_TM_TM_GMTOFF)
- tm.tm_gmtoff = NUM2LONG(tmx_offset);
-#endif
-#if defined(HAVE_TM_ZONE)
- tm.tm_zone = (char *)tmx_zone;
-#endif
- *result = tm;
-}
-
-#ifdef POSIX2_DATE
-/* iso8601wknum --- compute week number according to ISO 8601 */
-
-#ifndef __STDC__
-static int
-iso8601wknum(timeptr)
-const struct tm *timeptr;
-#else
-static int
-iso8601wknum(const struct tm *timeptr)
-#endif
-{
- /*
- * From 1003.2:
- * If the week (Monday to Sunday) containing January 1
- * has four or more days in the new year, then it is week 1;
- * otherwise it is the highest numbered week of the previous
- * year (52 or 53), and the next week is week 1.
- *
- * ADR: This means if Jan 1 was Monday through Thursday,
- * it was week 1, otherwise week 52 or 53.
- *
- * XPG4 erroneously included POSIX.2 rationale text in the
- * main body of the standard. Thus it requires week 53.
- */
-
- int weeknum, jan1day;
-
- /* get week number, Monday as first day of the week */
- weeknum = weeknumber(timeptr, 1);
-
- /*
- * With thanks and tip of the hatlo to tml@tik.vtt.fi
- *
- * What day of the week does January 1 fall on?
- * We know that
- * (timeptr->tm_yday - jan1.tm_yday) MOD 7 ==
- * (timeptr->tm_wday - jan1.tm_wday) MOD 7
- * and that
- * jan1.tm_yday == 0
- * and that
- * timeptr->tm_wday MOD 7 == timeptr->tm_wday
- * from which it follows that. . .
- */
- jan1day = timeptr->tm_wday - (timeptr->tm_yday % 7);
- if (jan1day < 0)
- jan1day += 7;
-
- /*
- * If Jan 1 was a Monday through Thursday, it was in
- * week 1. Otherwise it was last year's highest week, which is
- * this year's week 0.
- *
- * What does that mean?
- * If Jan 1 was Monday, the week number is exactly right, it can
- * never be 0.
- * If it was Tuesday through Thursday, the weeknumber is one
- * less than it should be, so we add one.
- * Otherwise, Friday, Saturday or Sunday, the week number is
- * OK, but if it is 0, it needs to be 52 or 53.
- */
- switch (jan1day) {
- case 1: /* Monday */
- break;
- case 2: /* Tuesday */
- case 3: /* Wednesday */
- case 4: /* Thursday */
- weeknum++;
- break;
- case 5: /* Friday */
- case 6: /* Saturday */
- case 0: /* Sunday */
- if (weeknum == 0) {
-#ifdef USE_BROKEN_XPG4
- /* XPG4 (as of March 1994) says 53 unconditionally */
- weeknum = 53;
-#else
- /* get week number of last week of last year */
- struct tm dec31ly; /* 12/31 last year */
- dec31ly = *timeptr;
- dec31ly.tm_year--;
- dec31ly.tm_mon = 11;
- dec31ly.tm_mday = 31;
- dec31ly.tm_wday = (jan1day == 0) ? 6 : jan1day - 1;
- dec31ly.tm_yday = 364 + isleap(dec31ly.tm_year + 1900L);
- weeknum = iso8601wknum(& dec31ly);
-#endif
- }
- break;
- }
-
- if (timeptr->tm_mon == 11) {
- /*
- * The last week of the year
- * can be in week 1 of next year.
- * Sigh.
- *
- * This can only happen if
- * M T W
- * 29 30 31
- * 30 31
- * 31
- */
- int wday, mday;
-
- wday = timeptr->tm_wday;
- mday = timeptr->tm_mday;
- if ( (wday == 1 && (mday >= 29 && mday <= 31))
- || (wday == 2 && (mday == 30 || mday == 31))
- || (wday == 3 && mday == 31))
- weeknum = 1;
- }
-
- return weeknum;
-}
-
-static int
-iso8601wknum_v(const struct tmx *tmx)
-{
- struct tm tm;
- tmx2tm_noyear(tmx, &tm);
- return iso8601wknum(&tm);
-}
-
-#endif
-
-/* weeknumber --- figure how many weeks into the year */
-
-/* With thanks and tip of the hatlo to ado@elsie.nci.nih.gov */
-
-#ifndef __STDC__
-static int
-weeknumber(timeptr, firstweekday)
-const struct tm *timeptr;
-int firstweekday;
-#else
-static int
-weeknumber(const struct tm *timeptr, int firstweekday)
-#endif
-{
- int wday = timeptr->tm_wday;
- int ret;
-
- if (firstweekday == 1) {
- if (wday == 0) /* sunday */
- wday = 6;
- else
- wday--;
- }
- ret = ((timeptr->tm_yday + 7 - wday) / 7);
- if (ret < 0)
- ret = 0;
- return ret;
-}
-
-static int
-weeknumber_v(const struct tmx *tmx, int firstweekday)
-{
- struct tm tm;
- tmx2tm_noyear(tmx, &tm);
- return weeknumber(&tm, firstweekday);
-}
-#endif
-
-#if 0
-/* ADR --- I'm loathe to mess with ado's code ... */
-
-Date: Wed, 24 Apr 91 20:54:08 MDT
-From: Michal Jaegermann <audfax!emory!vm.ucs.UAlberta.CA!NTOMCZAK>
-To: arnold@audiofax.com
-
-Hi Arnold,
-in a process of fixing of strftime() in libraries on Atari ST I grabbed
-some pieces of code from your own strftime. When doing that it came
-to mind that your weeknumber() function compiles a little bit nicer
-in the following form:
/*
- * firstweekday is 0 if starting in Sunday, non-zero if in Monday
- */
-{
- return (timeptr->tm_yday - timeptr->tm_wday +
- (firstweekday ? (timeptr->tm_wday ? 8 : 1) : 7)) / 7;
-}
-How nicer it depends on a compiler, of course, but always a tiny bit.
-
- Cheers,
- Michal
- ntomczak@vm.ucs.ualberta.ca
-#endif
-
-#ifdef TEST_STRFTIME
-
-/*
- * NAME:
- * tst
- *
- * SYNOPSIS:
- * tst
- *
- * DESCRIPTION:
- * "tst" is a test driver for the function "strftime".
- *
- * OPTIONS:
- * None.
- *
- * AUTHOR:
- * Karl Vogel
- * Control Data Systems, Inc.
- * vogelke@c-17igp.wpafb.af.mil
- *
- * BUGS:
- * None noticed yet.
- *
- * COMPILE:
- * cc -o tst -DTEST_STRFTIME strftime.c
- */
-
-/* ADR: I reformatted this to my liking, and deleted some unneeded code. */
-
-#ifndef NULL
-#include <stdio.h>
-#endif
-#include <time.h>
-#include <sys/time.h>
-#include <string.h>
-
-#define MAXTIME 132
-
-/*
- * Array of time formats.
- */
-
-static char *array[] =
-{
- "(%%A) full weekday name, var length (Sunday..Saturday) %A",
- "(%%B) full month name, var length (January..December) %B",
- "(%%C) Century %C",
- "(%%D) date (%%m/%%d/%%y) %D",
- "(%%E) Locale extensions (ignored) %E",
- "(%%H) hour (24-hour clock, 00..23) %H",
- "(%%I) hour (12-hour clock, 01..12) %I",
- "(%%M) minute (00..59) %M",
- "(%%O) Locale extensions (ignored) %O",
- "(%%R) time, 24-hour (%%H:%%M) %R",
- "(%%S) second (00..60) %S",
- "(%%T) time, 24-hour (%%H:%%M:%%S) %T",
- "(%%U) week of year, Sunday as first day of week (00..53) %U",
- "(%%V) week of year according to ISO 8601 %V",
- "(%%W) week of year, Monday as first day of week (00..53) %W",
- "(%%X) appropriate locale time representation (%H:%M:%S) %X",
- "(%%Y) year with century (1970...) %Y",
- "(%%Z) timezone (EDT), or blank if timezone not determinable %Z",
- "(%%a) locale's abbreviated weekday name (Sun..Sat) %a",
- "(%%b) locale's abbreviated month name (Jan..Dec) %b",
- "(%%c) full date (Sat Nov 4 12:02:33 1989)%n%t%t%t %c",
- "(%%d) day of the month (01..31) %d",
- "(%%e) day of the month, blank-padded ( 1..31) %e",
- "(%%h) should be same as (%%b) %h",
- "(%%j) day of the year (001..366) %j",
- "(%%k) hour, 24-hour clock, blank pad ( 0..23) %k",
- "(%%l) hour, 12-hour clock, blank pad ( 1..12) %l",
- "(%%m) month (01..12) %m",
- "(%%p) locale's AM or PM based on 12-hour clock %p",
- "(%%r) time, 12-hour (same as %%I:%%M:%%S %%p) %r",
- "(%%u) ISO 8601: Weekday as decimal number [1 (Monday) - 7] %u",
- "(%%v) VMS date (dd-bbb-YYYY) %v",
- "(%%w) day of week (0..6, Sunday == 0) %w",
- "(%%x) appropriate locale date representation %x",
- "(%%y) last two digits of year (00..99) %y",
- "(%%z) timezone offset east of GMT as HHMM (e.g. -0500) %z",
- (char *) NULL
-};
-
-/* main routine. */
-
-int
-main(argc, argv)
-int argc;
-char **argv;
-{
- char *next;
- char string[MAXTIME];
-
- int k;
- int length;
-
- struct tm *tm;
-
- time_t clock;
-
- /* Call the function. */
-
- clock = time(NULL);
- tm = localtime(&clock);
-
- for (k = 0; next = array[k]; k++) {
- length = strftime(string, MAXTIME, next, tm);
- printf("%s\n", string);
- }
-
- exit(0);
-}
-#endif /* TEST_STRFTIME */
+Local variables:
+c-file-style: "ruby"
+End:
+*/
diff --git a/ext/date/date_strptime.c b/ext/date/date_strptime.c
index 80b9e03278..c6a5969172 100644
--- a/ext/date/date_strptime.c
+++ b/ext/date/date_strptime.c
@@ -1,5 +1,5 @@
/*
- date_strptime.c: Coded by Tadayoshi Funaba 2011
+ date_strptime.c: Coded by Tadayoshi Funaba 2011,2012
*/
#include "ruby.h"
@@ -58,14 +58,15 @@ static const char *extz_pats[] = {
static int
num_pattern_p(const char *s)
{
- if (isdigit(*s))
+ if (isdigit((unsigned char)*s))
return 1;
if (*s == '%') {
s++;
if (*s == 'E' || *s == 'O')
s++;
if (*s &&
- (strchr("CDdeFGgHIjkLlMmNQRrSsTUuVvWwXxYy", *s) || isdigit(*s)))
+ (strchr("CDdeFGgHIjkLlMmNQRrSsTUuVvWwXxYy", *s) ||
+ isdigit((unsigned char)*s)))
return 1;
}
return 0;
@@ -624,7 +625,7 @@ date__strptime_internal(const char *str, size_t slen,
case '\v':
case '\f':
case '\r':
- while (isspace(str[si]))
+ while (isspace((unsigned char)str[si]))
si++;
fi++;
break;
@@ -641,15 +642,6 @@ date__strptime_internal(const char *str, size_t slen,
}
}
- {
- VALUE s;
-
- if (slen > si) {
- s = rb_usascii_str_new(&str[si], slen - si);
- set_hash("leftover", s);
- }
- }
-
return si;
}
@@ -657,9 +649,17 @@ VALUE
date__strptime(const char *str, size_t slen,
const char *fmt, size_t flen, VALUE hash)
{
+ size_t si;
VALUE cent, merid;
- date__strptime_internal(str, slen, fmt, flen, hash);
+ si = date__strptime_internal(str, slen, fmt, flen, hash);
+
+ if (slen > si) {
+ VALUE s;
+
+ s = rb_usascii_str_new(&str[si], slen - si);
+ set_hash("leftover", s);
+ }
if (fail_p())
return Qnil;
diff --git a/ext/date/date_tmx.h b/ext/date/date_tmx.h
index 0e56c9b4f0..ed06501228 100644
--- a/ext/date/date_tmx.h
+++ b/ext/date/date_tmx.h
@@ -18,7 +18,7 @@ struct tmx_funcs {
VALUE (*sec_fraction)(void *dat);
VALUE (*secs)(void *dat);
VALUE (*msecs)(void *dat);
- VALUE (*offset)(void *dat);
+ int (*offset)(void *dat);
char *(*zone)(void *dat);
};
struct tmx {
diff --git a/ext/date/depend b/ext/date/depend
index 7e5d62e79d..e6afa56162 100644
--- a/ext/date/depend
+++ b/ext/date/depend
@@ -1,2 +1,3 @@
+$(OBJS): $(ruby_headers)
date_core.o: date_tmx.h
date_strftime.o: date_tmx.h
diff --git a/ext/dbm/dbm.c b/ext/dbm/dbm.c
index 6d5396066d..57d227e8ad 100644
--- a/ext/dbm/dbm.c
+++ b/ext/dbm/dbm.c
@@ -21,6 +21,15 @@
#include <fcntl.h>
#include <errno.h>
+#define DSIZE_TYPE TYPEOF_DATUM_DSIZE
+#if SIZEOF_DATUM_DSIZE > SIZEOF_INT
+# define RSTRING_DSIZE(s) RSTRING_LEN(s)
+# define TOO_LONG(n) 0
+#else
+# define RSTRING_DSIZE(s) RSTRING_LENINT(s)
+# define TOO_LONG(n) ((long)(+(DSIZE_TYPE)(n)) != (n))
+#endif
+
static VALUE rb_cDBM, rb_eDBMError;
#define RUBY_DBM_RW_BIT 0x20000000
@@ -137,26 +146,67 @@ fdbm_initialize(int argc, VALUE *argv, VALUE obj)
FilePathValue(file);
+ /*
+ * Note:
+ * gdbm 1.10 works with O_CLOEXEC. gdbm 1.9.1 silently ignore it.
+ */
+#ifndef O_CLOEXEC
+# define O_CLOEXEC 0
+#endif
+
if (flags & RUBY_DBM_RW_BIT) {
flags &= ~RUBY_DBM_RW_BIT;
- dbm = dbm_open(RSTRING_PTR(file), flags, mode);
+ dbm = dbm_open(RSTRING_PTR(file), flags|O_CLOEXEC, mode);
}
else {
dbm = 0;
if (mode >= 0) {
- dbm = dbm_open(RSTRING_PTR(file), O_RDWR|O_CREAT, mode);
+ dbm = dbm_open(RSTRING_PTR(file), O_RDWR|O_CREAT|O_CLOEXEC, mode);
}
if (!dbm) {
- dbm = dbm_open(RSTRING_PTR(file), O_RDWR, 0);
+ dbm = dbm_open(RSTRING_PTR(file), O_RDWR|O_CLOEXEC, 0);
}
if (!dbm) {
- dbm = dbm_open(RSTRING_PTR(file), O_RDONLY, 0);
+ dbm = dbm_open(RSTRING_PTR(file), O_RDONLY|O_CLOEXEC, 0);
}
}
+ if (dbm) {
+ /*
+ * History of dbm_pagfno() and dbm_dirfno() in ndbm and its compatibles.
+ * (dbm_pagfno() and dbm_dirfno() is not standardized.)
+ *
+ * 1986: 4.3BSD provides ndbm.
+ * It provides dbm_pagfno() and dbm_dirfno() as macros.
+ * 1991: gdbm-1.5 provides them as functions.
+ * They returns a same descriptor.
+ * (Earlier releases may have the functions too.)
+ * 1991: Net/2 provides Berkeley DB.
+ * It doesn't provide dbm_pagfno() and dbm_dirfno().
+ * 1992: 4.4BSD Alpha provides Berkeley DB with dbm_dirfno() as a function.
+ * dbm_pagfno() is a macro as DBM_PAGFNO_NOT_AVAILABLE.
+ * 1997: Berkeley DB 2.0 is released by Sleepycat Software, Inc.
+ * It defines dbm_pagfno() and dbm_dirfno() as macros.
+ * 2011: gdbm-1.9 creates a separate dir file.
+ * dbm_pagfno() and dbm_dirfno() returns different descriptors.
+ */
+#if defined(HAVE_DBM_PAGFNO)
+ rb_fd_fix_cloexec(dbm_pagfno(dbm));
+#endif
+#if defined(HAVE_DBM_DIRFNO)
+ rb_fd_fix_cloexec(dbm_dirfno(dbm));
+#endif
+
+#if defined(RUBYDBM_DB_HEADER) && defined(HAVE_TYPE_DBC)
+ /* Disable Berkeley DB error messages such as:
+ * DB->put: attempt to modify a read-only database */
+ ((DBC*)dbm)->dbp->set_errfile(((DBC*)dbm)->dbp, NULL);
+#endif
+ }
+
if (!dbm) {
if (mode == -1) return Qnil;
- rb_sys_fail(RSTRING_PTR(file));
+ rb_sys_fail_str(file);
}
dbmp = ALLOC(struct dbmdata);
@@ -197,14 +247,18 @@ fdbm_fetch(VALUE obj, VALUE keystr, VALUE ifnone)
datum key, value;
struct dbmdata *dbmp;
DBM *dbm;
+ long len;
ExportStringValue(keystr);
+ len = RSTRING_LEN(keystr);
+ if (TOO_LONG(len)) goto not_found;
key.dptr = RSTRING_PTR(keystr);
- key.dsize = (int)RSTRING_LEN(keystr);
+ key.dsize = (DSIZE_TYPE)len;
GetDBM2(obj, dbmp, dbm);
value = dbm_fetch(dbm, key);
if (value.dptr == 0) {
+ not_found:
if (ifnone == Qnil && rb_block_given_p())
return rb_yield(rb_tainted_str_new(key.dptr, key.dsize));
return ifnone;
@@ -258,15 +312,18 @@ fdbm_key(VALUE obj, VALUE valstr)
datum key, val;
struct dbmdata *dbmp;
DBM *dbm;
+ long len;
ExportStringValue(valstr);
+ len = RSTRING_LEN(valstr);
+ if (TOO_LONG(len)) return Qnil;
val.dptr = RSTRING_PTR(valstr);
- val.dsize = (int)RSTRING_LEN(valstr);
+ val.dsize = (DSIZE_TYPE)len;
GetDBM2(obj, dbmp, dbm);
for (key = dbm_firstkey(dbm); key.dptr; key = dbm_nextkey(dbm)) {
val = dbm_fetch(dbm, key);
- if ((long)val.dsize == (int)RSTRING_LEN(valstr) &&
+ if ((long)val.dsize == RSTRING_LEN(valstr) &&
memcmp(val.dptr, RSTRING_PTR(valstr), val.dsize) == 0) {
return rb_tainted_str_new(key.dptr, key.dsize);
}
@@ -352,16 +409,20 @@ fdbm_delete(VALUE obj, VALUE keystr)
struct dbmdata *dbmp;
DBM *dbm;
VALUE valstr;
+ long len;
fdbm_modify(obj);
ExportStringValue(keystr);
+ len = RSTRING_LEN(keystr);
+ if (TOO_LONG(len)) goto not_found;
key.dptr = RSTRING_PTR(keystr);
- key.dsize = (int)RSTRING_LEN(keystr);
+ key.dsize = (DSIZE_TYPE)len;
GetDBM2(obj, dbmp, dbm);
value = dbm_fetch(dbm, key);
if (value.dptr == 0) {
+ not_found:
if (rb_block_given_p()) return rb_yield(keystr);
return Qnil;
}
@@ -424,7 +485,7 @@ fdbm_delete_if(VALUE obj)
struct dbmdata *dbmp;
DBM *dbm;
VALUE keystr, valstr;
- VALUE ret, ary = rb_ary_new();
+ VALUE ret, ary = rb_ary_tmp_new(0);
int i, status = 0;
long n;
@@ -436,6 +497,7 @@ fdbm_delete_if(VALUE obj)
for (key = dbm_firstkey(dbm); key.dptr; key = dbm_nextkey(dbm)) {
val = dbm_fetch(dbm, key);
keystr = rb_tainted_str_new(key.dptr, key.dsize);
+ OBJ_FREEZE(keystr);
valstr = rb_tainted_str_new(val.dptr, val.dsize);
ret = rb_protect(rb_yield, rb_assoc_new(rb_str_dup(keystr), valstr), &status);
if (status != 0) break;
@@ -445,15 +507,15 @@ fdbm_delete_if(VALUE obj)
for (i = 0; i < RARRAY_LEN(ary); i++) {
keystr = RARRAY_PTR(ary)[i];
- ExportStringValue(keystr);
key.dptr = RSTRING_PTR(keystr);
- key.dsize = (int)RSTRING_LEN(keystr);
+ key.dsize = (DSIZE_TYPE)RSTRING_LEN(keystr);
if (dbm_delete(dbm, key)) {
rb_raise(rb_eDBMError, "dbm_delete failed");
}
}
if (status) rb_jump_tag(status);
if (n > 0) dbmp->di_size = n - RARRAY_LEN(ary);
+ rb_ary_clear(ary);
return obj;
}
@@ -574,17 +636,15 @@ fdbm_store(VALUE obj, VALUE keystr, VALUE valstr)
valstr = rb_obj_as_string(valstr);
key.dptr = RSTRING_PTR(keystr);
- key.dsize = (int)RSTRING_LEN(keystr);
+ key.dsize = RSTRING_DSIZE(keystr);
val.dptr = RSTRING_PTR(valstr);
- val.dsize = (int)RSTRING_LEN(valstr);
+ val.dsize = RSTRING_DSIZE(valstr);
GetDBM2(obj, dbmp, dbm);
dbmp->di_size = -1;
if (dbm_store(dbm, key, val, DBM_REPLACE)) {
-#ifdef HAVE_DBM_CLEARERR
dbm_clearerr(dbm);
-#endif
if (errno == EPERM) rb_sys_fail(0);
rb_raise(rb_eDBMError, "dbm_store failed");
}
@@ -629,21 +689,20 @@ fdbm_empty_p(VALUE obj)
datum key;
struct dbmdata *dbmp;
DBM *dbm;
- int i = 0;
GetDBM2(obj, dbmp, dbm);
if (dbmp->di_size < 0) {
dbm = dbmp->di_dbm;
for (key = dbm_firstkey(dbm); key.dptr; key = dbm_nextkey(dbm)) {
- i++;
+ return Qfalse;
}
}
else {
- i = (int)dbmp->di_size;
+ if (dbmp->di_size)
+ return Qfalse;
}
- if (i == 0) return Qtrue;
- return Qfalse;
+ return Qtrue;
}
/*
@@ -783,10 +842,13 @@ fdbm_has_key(VALUE obj, VALUE keystr)
datum key, val;
struct dbmdata *dbmp;
DBM *dbm;
+ long len;
ExportStringValue(keystr);
+ len = RSTRING_LEN(keystr);
+ if (TOO_LONG(len)) return Qfalse;
key.dptr = RSTRING_PTR(keystr);
- key.dsize = (int)RSTRING_LEN(keystr);
+ key.dsize = (DSIZE_TYPE)len;
GetDBM2(obj, dbmp, dbm);
val = dbm_fetch(dbm, key);
@@ -807,15 +869,18 @@ fdbm_has_value(VALUE obj, VALUE valstr)
datum key, val;
struct dbmdata *dbmp;
DBM *dbm;
+ long len;
ExportStringValue(valstr);
+ len = RSTRING_LEN(valstr);
+ if (TOO_LONG(len)) return Qfalse;
val.dptr = RSTRING_PTR(valstr);
- val.dsize = (int)RSTRING_LEN(valstr);
+ val.dsize = (DSIZE_TYPE)len;
GetDBM2(obj, dbmp, dbm);
for (key = dbm_firstkey(dbm); key.dptr; key = dbm_nextkey(dbm)) {
val = dbm_fetch(dbm, key);
- if (val.dsize == (int)RSTRING_LEN(valstr) &&
+ if ((DSIZE_TYPE)val.dsize == (DSIZE_TYPE)RSTRING_LEN(valstr) &&
memcmp(val.dptr, RSTRING_PTR(valstr), val.dsize) == 0)
return Qtrue;
}
@@ -901,10 +966,13 @@ fdbm_reject(VALUE obj)
* The exact library used depends on how Ruby was compiled. It could be any
* of the following:
*
+ * - The original ndbm library is released in 4.3BSD.
+ * It is based on dbm library in Unix Version 7 but has different API to
+ * support multiple databases in a process.
* - {Berkeley DB}[http://en.wikipedia.org/wiki/Berkeley_DB] versions
* 1 thru 5, also known as BDB and Sleepycat DB, now owned by Oracle
* Corporation.
- * - ndbm, aka Berkeley DB 1.x, still found in FreeBSD and OpenBSD.
+ * - Berkeley DB 1.x, still found in 4.4BSD derivatives (FreeBSD, OpenBSD, etc).
* - {gdbm}[http://www.gnu.org/software/gdbm/], the GNU implementation of dbm.
* - {qdbm}[http://fallabs.com/qdbm/index.html], another open source
* reimplementation of dbm.
@@ -985,9 +1053,9 @@ Init_dbm(void)
rb_define_method(rb_cDBM, "reject!", fdbm_delete_if, 0);
rb_define_method(rb_cDBM, "reject", fdbm_reject, 0);
rb_define_method(rb_cDBM, "clear", fdbm_clear, 0);
- rb_define_method(rb_cDBM,"invert", fdbm_invert, 0);
- rb_define_method(rb_cDBM,"update", fdbm_update, 1);
- rb_define_method(rb_cDBM,"replace", fdbm_replace, 1);
+ rb_define_method(rb_cDBM, "invert", fdbm_invert, 0);
+ rb_define_method(rb_cDBM, "update", fdbm_update, 1);
+ rb_define_method(rb_cDBM, "replace", fdbm_replace, 1);
rb_define_method(rb_cDBM, "include?", fdbm_has_key, 1);
rb_define_method(rb_cDBM, "has_key?", fdbm_has_key, 1);
@@ -1016,10 +1084,50 @@ Init_dbm(void)
*/
rb_define_const(rb_cDBM, "NEWDB", INT2FIX(O_RDWR|O_CREAT|O_TRUNC|RUBY_DBM_RW_BIT));
-#ifdef DB_VERSION_STRING
- /* The version of the dbm library, if using Berkeley DB */
- rb_define_const(rb_cDBM, "VERSION", rb_str_new2(DB_VERSION_STRING));
+ {
+ VALUE version;
+#if defined(_DBM_IOERR)
+ version = rb_str_new2("ndbm (4.3BSD)");
+#elif defined(RUBYDBM_GDBM_HEADER)
+# if defined(HAVE_DECLARED_LIBVAR_GDBM_VERSION)
+ /* since gdbm 1.9 */
+ version = rb_str_new2(gdbm_version);
+# elif defined(HAVE_UNDECLARED_LIBVAR_GDBM_VERSION)
+ /* ndbm.h doesn't declare gdbm_version until gdbm 1.8.3.
+ * See extconf.rb for more information. */
+ RUBY_EXTERN char *gdbm_version;
+ version = rb_str_new2(gdbm_version);
+# else
+ version = rb_str_new2("GDBM (unknown)");
+# endif
+#elif defined(RUBYDBM_DB_HEADER)
+# if defined(HAVE_DB_VERSION)
+ /* The version of the dbm library, if using Berkeley DB */
+ version = rb_str_new2(db_version(NULL, NULL, NULL));
+# else
+ version = rb_str_new2("Berkeley DB (unknown)");
+# endif
+#elif defined(_RELIC_H)
+# if defined(HAVE_DPVERSION)
+ version = rb_sprintf("QDBM %s", dpversion);
+# else
+ version = rb_str_new2("QDBM (unknown)");
+# endif
#else
- rb_define_const(rb_cDBM, "VERSION", rb_str_new2("unknown"));
+ version = rb_str_new2("ndbm (unknown)");
#endif
+ /*
+ * Identifies ndbm library version.
+ *
+ * Examples:
+ *
+ * - "ndbm (4.3BSD)"
+ * - "Berkeley DB 4.8.30: (April 9, 2010)"
+ * - "Berkeley DB (unknown)" (4.4BSD, maybe)
+ * - "GDBM version 1.8.3. 10/15/2002 (built Jul 1 2011 12:32:45)"
+ * - "QDBM 1.8.78"
+ *
+ */
+ rb_define_const(rb_cDBM, "VERSION", version);
+ }
}
diff --git a/ext/dbm/extconf.rb b/ext/dbm/extconf.rb
index 91d393b211..32a944634a 100644
--- a/ext/dbm/extconf.rb
+++ b/ext/dbm/extconf.rb
@@ -5,53 +5,250 @@ dir_config("dbm")
if dblib = with_config("dbm-type", nil)
dblib = dblib.split(/[ ,]+/)
else
- dblib = %w(db db2 db1 db5 db4 db3 dbm gdbm gdbm_compat qdbm)
+ dblib = %w(libc db db2 db1 db5 db4 db3 gdbm_compat gdbm qdbm)
end
headers = {
+ "libc" => ["ndbm.h"], # 4.3BSD original ndbm, Berkeley DB 1 in 4.4BSD libc.
"db" => ["db.h"],
"db1" => ["db1/ndbm.h", "db1.h", "ndbm.h"],
"db2" => ["db2/db.h", "db2.h", "db.h"],
"db3" => ["db3/db.h", "db3.h", "db.h"],
"db4" => ["db4/db.h", "db4.h", "db.h"],
"db5" => ["db5/db.h", "db5.h", "db.h"],
- "dbm" => ["ndbm.h"],
- "gdbm" => ["gdbm-ndbm.h", "ndbm.h", "gdbm/ndbm.h"],
- "gdbm_compat" => ["gdbm-ndbm.h", "ndbm.h", "gdbm/ndbm.h"],
- "qdbm" => ["relic.h", "qdbm/relic.h"],
+ "gdbm_compat" => ["gdbm-ndbm.h", "gdbm/ndbm.h", "ndbm.h"], # GDBM since 1.8.1
+ "gdbm" => ["gdbm-ndbm.h", "gdbm/ndbm.h", "ndbm.h"], # GDBM until 1.8.0
+ "qdbm" => ["qdbm/relic.h", "relic.h"],
}
-def headers.db_check(db)
- db_prefix = nil
- have_gdbm = false
+class << headers
+ attr_accessor :found
+ attr_accessor :defs
+end
+headers.found = []
+headers.defs = nil
+
+def headers.db_check(db, hdr)
+ old_libs = $libs.dup
+ old_defs = $defs.dup
+ result = db_check2(db, hdr)
+ if !result
+ $libs = old_libs
+ $defs = old_defs
+ end
+ result
+end
+
+def have_declared_libvar(var, headers = nil, opt = "", &b)
+ checking_for checking_message([*var].compact.join(' '), headers, opt) do
+ try_declared_libvar(var, headers, opt, &b)
+ end
+end
+
+def try_declared_libvar(var, headers = nil, opt = "", &b)
+ if try_link(<<"SRC", opt, &b)
+#{cpp_include(headers)}
+/*top*/
+int main(int argc, char *argv[]) {
+ void *conftest_var = &#{var};
+ return 0;
+}
+SRC
+ $defs.push(format("-DHAVE_DECLARED_LIBVAR_%s", var.tr_cpp))
+ true
+ else
+ false
+ end
+end
+
+def have_undeclared_libvar(var, headers = nil, opt = "", &b)
+ checking_for checking_message([*var].compact.join(' '), headers, opt) do
+ try_undeclared_libvar(var, headers, opt, &b)
+ end
+end
+
+def try_undeclared_libvar(var, headers = nil, opt = "", &b)
+ var, type = *var
+ if try_link(<<"SRC", opt, &b)
+#{cpp_include(headers)}
+/*top*/
+int main(int argc, char *argv[]) {
+ typedef #{type || 'int'} conftest_type;
+ extern conftest_type #{var};
+ conftest_type *conftest_var = &#{var};
+ return 0;
+}
+SRC
+ $defs.push(format("-DHAVE_UNDECLARED_LIBVAR_%s", var.tr_cpp))
+ true
+ else
+ false
+ end
+end
+
+def have_empty_macro_dbm_clearerr(headers = nil, opt = "", &b)
+ checking_for checking_message('empty macro of dbm_clearerr(foobarbaz)',
+ headers, opt) do
+ try_toplevel('dbm_clearerr(foobarbaz)', headers, opt, &b)
+ end
+end
+
+def try_toplevel(src, headers = nil, opt = "", &b)
+ if try_compile(<<"SRC", opt, &b)
+#{cpp_include(headers)}
+/*top*/
+#{src}
+SRC
+ true
+ else
+ false
+ end
+end
+
+
+def headers.db_check2(db, hdr)
+ $defs.push(%{-DRUBYDBM_DBM_HEADER='"#{hdr}"'})
+ $defs.push(%{-DRUBYDBM_DBM_TYPE='"#{db}"'})
+
hsearch = nil
case db
when /^db[2-5]?$/
- db_prefix = "__db_n"
- hsearch = "-DDB_DBM_HSEARCH "
- when "gdbm"
- have_gdbm = true
+ hsearch = "-DDB_DBM_HSEARCH"
when "gdbm_compat"
- have_gdbm = true
have_library("gdbm") or return false
end
- db_prefix ||= ""
- if (have_library(db, db_prefix+"dbm_open") || have_func(db_prefix+"dbm_open")) and
- hdr = self.fetch(db, ["ndbm.h"]).find {|h| have_type("DBM", h, hsearch)} or
- hdr = self.fetch(db, ["ndbm.h"]).find {|h| have_type("DBM", ["db.h", h], hsearch)}
- have_func(db_prefix+"dbm_clearerr") unless have_gdbm
- $defs << hsearch if hsearch
- $defs << '-DDBM_HDR="<'+hdr+'>"'
- true
- else
- false
+ if !have_type("DBM", hdr, hsearch)
+ return false
+ end
+
+ # 'libc' means ndbm is provided by libc.
+ # 4.3BSD original ndbm is contained in libc.
+ # 4.4BSD (and its derivatives such as NetBSD) contains Berkeley DB 1 in libc.
+ if !(db == 'libc' ? have_func('dbm_open("", 0, 0)', hdr, hsearch) :
+ have_library(db, 'dbm_open("", 0, 0)', hdr, hsearch))
+ return false
+ end
+
+ # Skip a mismatch of Berkeley DB's ndbm.h and old GDBM library.
+ #
+ # dbm_clearerr() should be available for any ndbm implementation.
+ # It is available since the original (4.3BSD) ndbm and standardized by POSIX.
+ #
+ # However "can't resolve symbol 'dbm_clearerr'" problem may be caused by
+ # header/library mismatch: Berkeley DB ndbm.h and GDBM library until 1.8.3.
+ # GDBM (until 1.8.3) provides dbm_clearerr() as a empty macro in the header
+ # and the library don't provide dbm_clearerr().
+ # Berkeley DB provides dbm_clearerr() as a usual function.
+ # So Berkeley DB header with GDBM library causes the problem.
+ #
+ if !have_func('dbm_clearerr((DBM *)0)', hdr, hsearch)
+ return false
+ end
+
+ # Berkeley DB's ndbm.h (since 1.85 at least) defines DBM_SUFFIX.
+ # Note that _DB_H_ is not defined on Mac OS X because
+ # it uses Berkeley DB 1 but ndbm.h doesn't include db.h.
+ have_db_header = have_macro('DBM_SUFFIX', hdr, hsearch)
+
+ # Old GDBM's ndbm.h, until 1.8.3, defines dbm_clearerr as a macro which
+ # expands to no tokens.
+ have_gdbm_header1 = have_empty_macro_dbm_clearerr(hdr, hsearch)
+
+ # Recent GDBM's ndbm.h, since 1.9, includes gdbm.h and it defines _GDBM_H_.
+ # ndbm compatibility layer of GDBM is provided by libgdbm (until 1.8.0)
+ # and libgdbm_compat (since 1.8.1).
+ have_gdbm_header2 = have_macro('_GDBM_H_', hdr, hsearch)
+
+ # 4.3BSD's ndbm.h defines _DBM_IOERR.
+ # The original ndbm is provided by libc in 4.3BSD.
+ have_ndbm_header = have_macro('_DBM_IOERR', hdr, hsearch)
+
+ # GDBM provides ndbm functions in libgdbm_compat since GDBM 1.8.1.
+ # GDBM's ndbm.h defines _GDBM_H_ since GDBM 1.9.
+ # If _GDBM_H_ is defined, 'gdbm_compat' is required and reject 'gdbm'.
+ if have_gdbm_header2 && db == 'gdbm'
+ return false
+ end
+
+ if have_db_header
+ $defs.push('-DRUBYDBM_DB_HEADER')
end
+
+ have_gdbm_header = have_gdbm_header1 | have_gdbm_header2
+ if have_gdbm_header
+ $defs.push('-DRUBYDBM_GDBM_HEADER')
+ end
+
+ # ndbm.h is provided by the original (4.3BSD) ndbm,
+ # Berkeley DB 1 in libc of 4.4BSD and
+ # ndbm compatibility layer of GDBM.
+ # So, try to check header/library mismatch.
+ #
+ # Several (possibly historical) distributions provides libndbm.
+ # It may be Berkeley DB, GDBM or 4.3BSD ndbm.
+ # So mismatch check is not performed for that.
+ # Note that libndbm is searched only when --with-dbm-type=ndbm is
+ # given for configure.
+ #
+ if hdr == 'ndbm.h' && db != 'libc' && db != 'ndbm'
+ if /\Adb\d?\z/ !~ db && have_db_header
+ return false
+ end
+
+ if /\Agdbm/ !~ db && have_gdbm_header
+ return false
+ end
+
+ if have_ndbm_header
+ return false
+ end
+ end
+
+ # Berkeley DB
+ have_func('db_version((int *)0, (int *)0, (int *)0)', hdr, hsearch)
+
+ # GDBM
+ have_gdbm_version = have_declared_libvar("gdbm_version", hdr, hsearch)
+ # gdbm_version is available since very old version (GDBM 1.5 at least).
+ # However it is not declared by ndbm.h until GDBM 1.8.3.
+ # We can't include both ndbm.h and gdbm.h because they both define datum type.
+ # ndbm.h includes gdbm.h and gdbm_version is declared since GDBM 1.9.
+ have_gdbm_version |= have_undeclared_libvar(["gdbm_version", "char *"], hdr, hsearch)
+
+ # QDBM
+ have_var("dpversion", hdr, hsearch)
+
+ # detect mismatch between GDBM header and other library.
+ # If GDBM header is included, GDBM library should be linked.
+ if have_gdbm_header && !have_gdbm_version
+ return false
+ end
+
+ # DBC type is required to disable error messages by Berkeley DB 2 or later.
+ if have_db_header
+ have_type("DBC", hdr, hsearch)
+ end
+
+ if hsearch
+ $defs << hsearch
+ @defs = hsearch
+ end
+ $defs << '-DDBM_HDR="<'+hdr+'>"'
+ @found << hdr
+
+ puts "header: #{hdr}"
+ puts "library: #{db}"
+
+ true
end
-if dblib.any? {|db| headers.db_check(db)}
+if dblib.any? {|db| headers.fetch(db, ["ndbm.h"]).any? {|hdr| headers.db_check(db, hdr) } }
have_header("cdefs.h")
have_header("sys/cdefs.h")
+ have_func("dbm_pagfno((DBM *)0)", headers.found, headers.defs)
+ have_func("dbm_dirfno((DBM *)0)", headers.found, headers.defs)
+ convertible_int("datum.dsize", headers.found, headers.defs)
create_makefile("dbm")
end
diff --git a/ext/digest/digest.c b/ext/digest/digest.c
index d535b35980..c603441409 100644
--- a/ext/digest/digest.c
+++ b/ext/digest/digest.c
@@ -29,6 +29,53 @@ RUBY_EXTERN void Init_digest_base(void);
* Document-module: Digest
*
* This module provides a framework for message digest libraries.
+ *
+ * You may want to look at OpenSSL::Digest as it supports support more
+ * algorithms.
+ *
+ * A cryptographic hash function is a procedure that takes data and return a
+ * fixed bit string : the hash value, also known as _digest_. Hash functions
+ * are also called one-way functions, it is easy to compute a digest from
+ * a message, but it is infeasible to generate a message from a digest.
+ *
+ * == Example
+ *
+ * require 'digest'
+ *
+ * # Compute a complete digest
+ * sha256 = Digest::SHA256.new
+ * digest = sha256.digest message
+ *
+ * # Compute digest by chunks
+ * sha256 = Digest::SHA256.new
+ * sha256.update message1
+ * sha256 << message2 # << is an alias for update
+ *
+ * digest = sha256.digest
+ *
+ * == Digest algorithms
+ *
+ * Different digest algorithms (or hash functions) are available :
+ *
+ * HMAC::
+ * See FIPS PUB 198 The Keyed-Hash Message Authentication Code (HMAC)
+ * RIPEMD-160::
+ * (as Digest::RMD160) see
+ * http://homes.esat.kuleuven.be/~bosselae/ripemd160.html
+ * SHA1::
+ * See FIPS 180 Secure Hash Standard
+ * SHA2 family::
+ * See FIPS 180 Secure Hash Standard which defines the following algorithms:
+ * * SHA512
+ * * SHA384
+ * * SHA256
+ *
+ * The latest versions of the FIPS publications can be found here:
+ * http://csrc.nist.gov/publications/PubsFIPS.html
+ *
+ * Additionally Digest::BubbleBabble encodes a digest as a sequence of
+ * consonants and vowels which is more recognizable and comparable than a
+ * hexadecimal digest. See http://en.wikipedia.org/wiki/Bubblebabble
*/
static VALUE
@@ -52,7 +99,7 @@ hexencode_str_new(VALUE str_digest)
rb_raise(rb_eRuntimeError, "digest string too long");
}
- str = rb_str_new(0, digest_len * 2);
+ str = rb_usascii_str_new(0, digest_len * 2);
for (i = 0, p = RSTRING_PTR(str); i < digest_len; i++) {
unsigned char byte = digest[i];
@@ -107,6 +154,8 @@ static VALUE
rb_digest_instance_update(VALUE self, VALUE str)
{
rb_digest_instance_method_unimpl(self, "update");
+
+ UNREACHABLE;
}
/*
@@ -125,6 +174,8 @@ static VALUE
rb_digest_instance_finish(VALUE self)
{
rb_digest_instance_method_unimpl(self, "finish");
+
+ UNREACHABLE;
}
/*
@@ -139,6 +190,8 @@ static VALUE
rb_digest_instance_reset(VALUE self)
{
rb_digest_instance_method_unimpl(self, "reset");
+
+ UNREACHABLE;
}
/*
@@ -362,6 +415,8 @@ static VALUE
rb_digest_instance_block_length(VALUE self)
{
rb_digest_instance_method_unimpl(self, "block_length");
+
+ UNREACHABLE;
}
/*
diff --git a/ext/digest/md5/extconf.rb b/ext/digest/md5/extconf.rb
index ddfdb707f2..5a57fd3eea 100644
--- a/ext/digest/md5/extconf.rb
+++ b/ext/digest/md5/extconf.rb
@@ -1,3 +1,4 @@
+# -*- coding: us-ascii -*-
# $RoughId: extconf.rb,v 1.3 2001/08/14 19:54:51 knu Exp $
# $Id$
@@ -9,9 +10,11 @@ $INCFLAGS << " -I$(srcdir)/.."
$objs = [ "md5init.#{$OBJEXT}" ]
dir_config("openssl")
+pkg_config("openssl")
+require File.expand_path('../../../openssl/deprecation', __FILE__)
if !with_config("bundled-md5") &&
- have_library("crypto") && have_header("openssl/md5.h")
+ have_library("crypto") && OpenSSL.check_func("MD5_Transform", "openssl/md5.h")
$objs << "md5ossl.#{$OBJEXT}"
else
diff --git a/ext/digest/md5/md5init.c b/ext/digest/md5/md5init.c
index d1229b5c6e..3591782f6e 100644
--- a/ext/digest/md5/md5init.c
+++ b/ext/digest/md5/md5init.c
@@ -30,6 +30,9 @@ Init_md5()
rb_require("digest");
+#if 0
+ mDigest = rb_define_module("Digest"); /* let rdoc know */
+#endif
mDigest = rb_path2class("Digest");
cDigest_Base = rb_path2class("Digest::Base");
diff --git a/ext/digest/rmd160/extconf.rb b/ext/digest/rmd160/extconf.rb
index cc361e3d2b..d487d6da80 100644
--- a/ext/digest/rmd160/extconf.rb
+++ b/ext/digest/rmd160/extconf.rb
@@ -1,3 +1,4 @@
+# -*- coding: us-ascii -*-
# $RoughId: extconf.rb,v 1.3 2001/08/14 19:54:51 knu Exp $
# $Id$
@@ -9,9 +10,11 @@ $INCFLAGS << " -I$(srcdir)/.."
$objs = [ "rmd160init.#{$OBJEXT}" ]
dir_config("openssl")
+pkg_config("openssl")
+require File.expand_path('../../../openssl/deprecation', __FILE__)
if !with_config("bundled-rmd160") &&
- have_library("crypto") && have_header("openssl/ripemd.h")
+ have_library("crypto") && OpenSSL.check_func("RMD160_Transform", "openssl/ripemd.h")
$objs << "rmd160ossl.#{$OBJEXT}"
else
$objs << "rmd160.#{$OBJEXT}"
diff --git a/ext/digest/rmd160/rmd160.c b/ext/digest/rmd160/rmd160.c
index 88918728cd..bac77833b1 100644
--- a/ext/digest/rmd160/rmd160.c
+++ b/ext/digest/rmd160/rmd160.c
@@ -362,16 +362,20 @@ RMD160_Update(RMD160_CTX *context, const uint8_t *data, size_t nbytes)
_DIAGASSERT(data != NULL);
/* update length[] */
+#if SIZEOF_SIZE_T * CHAR_BIT > 32
+ context->length[1] += (uint32_t)((context->length[0] + nbytes) >> 32);
+#else
if (context->length[0] + nbytes < context->length[0])
context->length[1]++; /* overflow to msb of length */
- context->length[0] += nbytes;
+#endif
+ context->length[0] += (uint32_t)nbytes;
(void)memset(X, 0, sizeof(X));
if ( context->buflen + nbytes < 64 )
{
(void)memcpy(context->bbuffer + context->buflen, data, nbytes);
- context->buflen += nbytes;
+ context->buflen += (uint32_t)nbytes;
}
else
{
@@ -401,7 +405,7 @@ RMD160_Update(RMD160_CTX *context, const uint8_t *data, size_t nbytes)
/*
* Put last bytes from data into context's buffer
*/
- context->buflen = nbytes & 63;
+ context->buflen = (uint32_t)nbytes & 63;
memcpy(context->bbuffer, data + (64 * i) + ofs, context->buflen);
}
}
diff --git a/ext/digest/rmd160/rmd160init.c b/ext/digest/rmd160/rmd160init.c
index 0839f1b820..c214ca9f33 100644
--- a/ext/digest/rmd160/rmd160init.c
+++ b/ext/digest/rmd160/rmd160init.c
@@ -30,6 +30,9 @@ Init_rmd160()
rb_require("digest");
+#if 0
+ mDigest = rb_define_module("Digest"); /* let rdoc know */
+#endif
mDigest = rb_path2class("Digest");
cDigest_Base = rb_path2class("Digest::Base");
diff --git a/ext/digest/sha1/extconf.rb b/ext/digest/sha1/extconf.rb
index fa9945cd43..d7e52fe731 100644
--- a/ext/digest/sha1/extconf.rb
+++ b/ext/digest/sha1/extconf.rb
@@ -1,3 +1,4 @@
+# -*- coding: us-ascii -*-
# $RoughId: extconf.rb,v 1.3 2001/08/14 19:54:51 knu Exp $
# $Id$
@@ -9,9 +10,11 @@ $INCFLAGS << " -I$(srcdir)/.."
$objs = [ "sha1init.#{$OBJEXT}" ]
dir_config("openssl")
+pkg_config("openssl")
+require File.expand_path('../../../openssl/deprecation', __FILE__)
if !with_config("bundled-sha1") &&
- have_library("crypto") && have_header("openssl/sha.h")
+ have_library("crypto") && OpenSSL.check_func("SHA1_Transform", "openssl/sha.h")
$objs << "sha1ossl.#{$OBJEXT}"
else
$objs << "sha1.#{$OBJEXT}"
diff --git a/ext/digest/sha1/sha1init.c b/ext/digest/sha1/sha1init.c
index 06e7378950..d52eef58b3 100644
--- a/ext/digest/sha1/sha1init.c
+++ b/ext/digest/sha1/sha1init.c
@@ -30,6 +30,9 @@ Init_sha1()
rb_require("digest");
+#if 0
+ mDigest = rb_define_module("Digest"); /* let rdoc know */
+#endif
mDigest = rb_path2class("Digest");
cDigest_Base = rb_path2class("Digest::Base");
diff --git a/ext/digest/sha2/extconf.rb b/ext/digest/sha2/extconf.rb
index a8f0198cf0..5ab2d35af5 100644
--- a/ext/digest/sha2/extconf.rb
+++ b/ext/digest/sha2/extconf.rb
@@ -1,3 +1,4 @@
+# -*- coding: us-ascii -*-
# $RoughId: extconf.rb,v 1.4 2001/08/14 19:54:51 knu Exp $
# $Id$
@@ -9,10 +10,12 @@ $INCFLAGS << " -I$(srcdir)/.."
$objs = [ "sha2init.#{$OBJEXT}" ]
dir_config("openssl")
+pkg_config("openssl")
+require File.expand_path('../../../openssl/deprecation', __FILE__)
if !with_config("bundled-sha2") &&
have_library("crypto") &&
- %w[SHA256 SHA512].all? {|d| have_func("#{d}_Transform", "openssl/sha.h")} &&
+ %w[SHA256 SHA512].all? {|d| OpenSSL.check_func("#{d}_Transform", "openssl/sha.h")} &&
%w[SHA256 SHA512].all? {|d| have_type("#{d}_CTX", "openssl/sha.h")}
$objs << "sha2ossl.#{$OBJEXT}"
$defs << "-DSHA2_USE_OPENSSL"
diff --git a/ext/digest/sha2/lib/sha2.rb b/ext/digest/sha2/lib/sha2.rb
index 3c5bf0c863..58d12e9b09 100644
--- a/ext/digest/sha2/lib/sha2.rb
+++ b/ext/digest/sha2/lib/sha2.rb
@@ -68,11 +68,11 @@ module Digest
#
# Returns the block length of the digest in bytes.
#
- # Digest::SHA256.new.digest_length * 8
+ # Digest::SHA256.new.block_length * 8
# # => 512
- # Digest::SHA384.new.digest_length * 8
+ # Digest::SHA384.new.block_length * 8
# # => 1024
- # Digest::SHA512.new.digest_length * 8
+ # Digest::SHA512.new.block_length * 8
# # => 1024
def block_length
@sha2.block_length
diff --git a/ext/digest/sha2/sha2.c b/ext/digest/sha2/sha2.c
index 0566b93cb7..0fe64489ab 100644
--- a/ext/digest/sha2/sha2.c
+++ b/ext/digest/sha2/sha2.c
@@ -138,7 +138,7 @@ typedef u_int64_t sha2_word64; /* Exactly 8 bytes */
#define REVERSE32(w,x) { \
sha2_word32 tmp = (w); \
tmp = (tmp >> 16) | (tmp << 16); \
- (x) = ((tmp & 0xff00ff00UL) >> 8) | ((tmp & 0x00ff00ffUL) << 8); \
+ (x) = ((tmp & (sha2_word32)0xff00ff00UL) >> 8) | ((tmp & (sha2_word32)0x00ff00ffUL) << 8); \
}
#define REVERSE64(w,x) { \
sha2_word64 tmp = (w); \
@@ -633,7 +633,7 @@ void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) {
}
/* Clean up state data: */
- MEMSET_BZERO(context, sizeof(context));
+ MEMSET_BZERO(context, sizeof(*context));
usedspace = 0;
}
@@ -653,7 +653,7 @@ char *SHA256_End(SHA256_CTX* context, char buffer[]) {
}
*buffer = (char)0;
} else {
- MEMSET_BZERO(context, sizeof(context));
+ MEMSET_BZERO(context, sizeof(*context));
}
MEMSET_BZERO(digest, SHA256_DIGEST_LENGTH);
return buffer;
@@ -963,7 +963,7 @@ void SHA512_Final(sha2_byte digest[], SHA512_CTX* context) {
}
/* Zero out state data */
- MEMSET_BZERO(context, sizeof(context));
+ MEMSET_BZERO(context, sizeof(*context));
}
char *SHA512_End(SHA512_CTX* context, char buffer[]) {
@@ -982,7 +982,7 @@ char *SHA512_End(SHA512_CTX* context, char buffer[]) {
}
*buffer = (char)0;
} else {
- MEMSET_BZERO(context, sizeof(context));
+ MEMSET_BZERO(context, sizeof(*context));
}
MEMSET_BZERO(digest, SHA512_DIGEST_LENGTH);
return buffer;
@@ -1037,7 +1037,7 @@ void SHA384_Final(sha2_byte digest[], SHA384_CTX* context) {
}
/* Zero out state data */
- MEMSET_BZERO(context, sizeof(context));
+ MEMSET_BZERO(context, sizeof(*context));
}
char *SHA384_End(SHA384_CTX* context, char buffer[]) {
@@ -1056,7 +1056,7 @@ char *SHA384_End(SHA384_CTX* context, char buffer[]) {
}
*buffer = (char)0;
} else {
- MEMSET_BZERO(context, sizeof(context));
+ MEMSET_BZERO(context, sizeof(*context));
}
MEMSET_BZERO(digest, SHA384_DIGEST_LENGTH);
return buffer;
diff --git a/ext/digest/sha2/sha2ossl.c b/ext/digest/sha2/sha2ossl.c
index 86824e72f4..34353be8b8 100644
--- a/ext/digest/sha2/sha2ossl.c
+++ b/ext/digest/sha2/sha2ossl.c
@@ -4,7 +4,9 @@
#define SHA_Finish(bit) \
void SHA##bit##_Finish(SHA##bit##_CTX *ctx, char *buf) \
{ SHA##bit##_Final((unsigned char *)buf, ctx);}
+#ifndef __DragonFly__
#define SHA384_Final SHA512_Final
+#endif
SHA_Finish(256)
SHA_Finish(384)
diff --git a/ext/dl/callback/mkcallback.rb b/ext/dl/callback/mkcallback.rb
index d14072a932..e94a196247 100644
--- a/ext/dl/callback/mkcallback.rb
+++ b/ext/dl/callback/mkcallback.rb
@@ -121,28 +121,24 @@ def foreach_proc_entry
end
def gencallback(ty, calltype, proc_entry, argc, n)
- <<-EOS
+ dltype = DLTYPE[ty]
+ ret = dltype[:conv]
+ src = <<-EOS
#{calltype == STDCALL ? "\n#ifdef FUNC_STDCALL" : ""}
-static #{DLTYPE[ty][:type]}
-FUNC_#{calltype.upcase}(#{func_name(ty,argc,n,calltype)})(#{(0...argc).collect{|i| "DLSTACK_TYPE stack" + i.to_s}.join(", ")})
+static #{dltype[:type]}
+FUNC_#{calltype.upcase}(#{func_name(ty,argc,n,calltype)})(#{(0...argc).collect{|i| "DLSTACK_TYPE stack#{i}"}.join(", ")})
{
- VALUE ret, cb#{argc > 0 ? ", args[#{argc}]" : ""};
+ VALUE #{ret ? "ret, " : ""}cb#{argc > 0 ? ", args[#{argc}]" : ""};
#{
- sizeof_voidp = [""].pack('p').size
- sizeof_long = [0].pack('l!').size
(0...argc).collect{|i|
- if sizeof_voidp == sizeof_long
- " args[%d] = LONG2NUM(stack%d);" % [i,i]
- elsif sizeof_voidp == 8 # should get sizeof_long_long...
- " args[%d] = LL2NUM(stack%d);" % [i,i]
- else
- raise "unknown size of void*"
- end
- }.join("\n")
+ "\n args[#{i}] = PTR2NUM(stack#{i});"
+ }.join("")
}
cb = rb_ary_entry(rb_ary_entry(#{proc_entry}, #{ty}), #{(n * DLSTACK_SIZE) + argc});
- ret = rb_funcall2(cb, rb_dl_cb_call, #{argc}, #{argc > 0 ? 'args' : 'NULL'});
- return #{DLTYPE[ty][:conv] ? DLTYPE[ty][:conv] % "ret" : ""};
+ #{ret ? "ret = " : ""}rb_funcall2(cb, rb_dl_cb_call, #{argc}, #{argc > 0 ? 'args' : 'NULL'});
+ EOS
+ src << " return #{ret % "ret"};\n" if ret
+ src << <<-EOS
}
#{calltype == STDCALL ? "#endif\n" : ""}
EOS
diff --git a/ext/dl/cfunc.c b/ext/dl/cfunc.c
index a050ab04b3..2a96b30bed 100644
--- a/ext/dl/cfunc.c
+++ b/ext/dl/cfunc.c
@@ -2,7 +2,8 @@
* $Id$
*/
-#include <ruby.h>
+#include <ruby/ruby.h>
+#include <ruby/util.h>
#include <errno.h>
#include "dl.h"
@@ -41,6 +42,14 @@ rb_dl_set_win32_last_error(VALUE self, VALUE val)
}
#endif
+static void
+dlcfunc_mark(void *ptr)
+{
+ struct cfunc_data *data = ptr;
+ if (data->wrap) {
+ rb_gc_mark(data->wrap);
+ }
+}
static void
dlcfunc_free(void *ptr)
@@ -68,7 +77,7 @@ dlcfunc_memsize(const void *ptr)
const rb_data_type_t dlcfunc_data_type = {
"dl/cfunc",
- {0, dlcfunc_free, dlcfunc_memsize,},
+ {dlcfunc_mark, dlcfunc_free, dlcfunc_memsize,},
};
VALUE
@@ -143,14 +152,15 @@ rb_dlcfunc_kind_p(VALUE func)
static VALUE
rb_dlcfunc_initialize(int argc, VALUE argv[], VALUE self)
{
- VALUE addr, name, type, calltype;
+ VALUE addr, name, type, calltype, addrnum;
struct cfunc_data *data;
void *saddr;
const char *sname;
rb_scan_args(argc, argv, "13", &addr, &type, &name, &calltype);
- saddr = (void*)(NUM2PTR(rb_Integer(addr)));
+ addrnum = rb_Integer(addr);
+ saddr = (void*)(NUM2PTR(addrnum));
sname = NIL_P(name) ? NULL : StringValuePtr(name);
TypedData_Get_Struct(self, struct cfunc_data, &dlcfunc_data_type, data);
@@ -159,6 +169,7 @@ rb_dlcfunc_initialize(int argc, VALUE argv[], VALUE self)
data->name = sname ? strdup(sname) : 0;
data->type = NIL_P(type) ? DLTYPE_VOID : NUM2INT(type);
data->calltype = NIL_P(calltype) ? CFUNC_CDECL : SYM2ID(calltype);
+ data->wrap = (addrnum == addr) ? 0 : addr;
return Qnil;
}
@@ -314,7 +325,7 @@ rb_dlcfunc_inspect(VALUE self)
}
-#if defined(_MSC_VER) && defined(_M_AMD64) && _MSC_VER == 1500
+#if defined(_MSC_VER) && defined(_M_AMD64) && _MSC_VER >= 1400 && _MSC_VER < 1600
# pragma optimize("", off)
#endif
/*
@@ -356,7 +367,11 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
stack[i] = (DLSTACK_TYPE)FIX2LONG(arg);
}
else if (RB_TYPE_P(arg, T_BIGNUM)) {
+#if SIZEOF_VOIDP == SIZEOF_LONG
stack[i] = (DLSTACK_TYPE)rb_big2ulong_pack(arg);
+#else
+ stack[i] = (DLSTACK_TYPE)rb_big2ull(arg);
+#endif
}
else {
Check_Type(arg, T_FIXNUM);
@@ -584,7 +599,7 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
return result;
}
-#if defined(_MSC_VER) && defined(_M_AMD64) && _MSC_VER == 1500
+#if defined(_MSC_VER) && defined(_M_AMD64) && _MSC_VER >= 1400 && _MSC_VER < 1600
# pragma optimize("", on)
#endif
@@ -610,10 +625,38 @@ Init_dlcfunc(void)
#if defined(_WIN32)
id_win32_last_error = rb_intern("__DL2_WIN32_LAST_ERROR__");
#endif
+
+ /*
+ * Document-class: DL::CFunc
+ *
+ * A direct accessor to a function in a C library
+ *
+ * == Example
+ *
+ * libc_so = "/lib64/libc.so.6"
+ * => "/lib64/libc.so.6"
+ * libc = DL::dlopen(libc_so)
+ * => #<DL::Handle:0x00000000e05b00>
+ * @cfunc = DL::CFunc.new(libc,['strcpy'], DL::TYPE_VOIDP, 'strcpy')
+ * => #<DL::CFunc:0x000000012daec0 ptr=0x007f62ca5a8300 type=1 name='strcpy'>
+ *
+ */
rb_cDLCFunc = rb_define_class_under(rb_mDL, "CFunc", rb_cObject);
rb_define_alloc_func(rb_cDLCFunc, rb_dlcfunc_s_allocate);
+
+ /*
+ * Document-method: last_error
+ *
+ * Returns the last error for the current executing thread
+ */
rb_define_module_function(rb_cDLCFunc, "last_error", rb_dl_get_last_error, 0);
#if defined(_WIN32)
+
+ /*
+ * Document-method: win32_last_error
+ *
+ * Returns the last win32 error for the current executing thread
+ */
rb_define_module_function(rb_cDLCFunc, "win32_last_error", rb_dl_get_win32_last_error, 0);
#endif
rb_define_method(rb_cDLCFunc, "initialize", rb_dlcfunc_initialize, -1);
diff --git a/ext/dl/cptr.c b/ext/dl/cptr.c
index 68c18ec32c..636099d1fd 100644
--- a/ext/dl/cptr.c
+++ b/ext/dl/cptr.c
@@ -10,20 +10,37 @@
VALUE rb_cDLCPtr;
static inline freefunc_t
-get_freefunc(VALUE func)
+get_freefunc(VALUE func, volatile VALUE *wrap)
{
+ VALUE addrnum;
if (NIL_P(func)) {
+ *wrap = 0;
return NULL;
}
if (rb_dlcfunc_kind_p(func)) {
+ *wrap = func;
return (freefunc_t)(VALUE)RCFUNC_DATA(func)->ptr;
}
- return (freefunc_t)(VALUE)NUM2PTR(rb_Integer(func));
+ addrnum = rb_Integer(func);
+ *wrap = (addrnum != func) ? func : 0;
+ return (freefunc_t)(VALUE)NUM2PTR(addrnum);
}
static ID id_to_ptr;
static void
+dlptr_mark(void *ptr)
+{
+ struct ptr_data *data = ptr;
+ if (data->wrap[0]) {
+ rb_gc_mark(data->wrap[0]);
+ }
+ if (data->wrap[1]) {
+ rb_gc_mark(data->wrap[1]);
+ }
+}
+
+static void
dlptr_free(void *ptr)
{
struct ptr_data *data = ptr;
@@ -43,18 +60,9 @@ dlptr_memsize(const void *ptr)
static const rb_data_type_t dlptr_data_type = {
"dl/ptr",
- {0, dlptr_free, dlptr_memsize,},
+ {dlptr_mark, dlptr_free, dlptr_memsize,},
};
-void
-dlptr_init(VALUE val)
-{
- struct ptr_data *data;
-
- TypedData_Get_Struct(val, struct ptr_data, &dlptr_data_type, data);
- OBJ_TAINT(val);
-}
-
VALUE
rb_dlptr_new2(VALUE klass, void *ptr, long size, freefunc_t func)
{
@@ -66,7 +74,7 @@ rb_dlptr_new2(VALUE klass, void *ptr, long size, freefunc_t func)
data->ptr = ptr;
data->free = func;
data->size = size;
- dlptr_init(val);
+ OBJ_TAINT(val);
return val;
}
@@ -135,27 +143,22 @@ rb_dlptr_s_allocate(VALUE klass)
static VALUE
rb_dlptr_initialize(int argc, VALUE argv[], VALUE self)
{
- VALUE ptr, sym, size;
+ VALUE ptr, sym, size, wrap = 0, funcwrap = 0;
struct ptr_data *data;
void *p = NULL;
freefunc_t f = NULL;
long s = 0;
- switch (rb_scan_args(argc, argv, "12", &ptr, &size, &sym)) {
- case 1:
- p = (void*)(NUM2PTR(rb_Integer(ptr)));
- break;
- case 2:
- p = (void*)(NUM2PTR(rb_Integer(ptr)));
- s = NUM2LONG(size);
- break;
- case 3:
- p = (void*)(NUM2PTR(rb_Integer(ptr)));
+ if (rb_scan_args(argc, argv, "12", &ptr, &size, &sym) >= 1) {
+ VALUE addrnum = rb_Integer(ptr);
+ if (addrnum != ptr) wrap = ptr;
+ p = NUM2PTR(addrnum);
+ }
+ if (argc >= 2) {
s = NUM2LONG(size);
- f = get_freefunc(sym);
- break;
- default:
- rb_bug("rb_dlptr_initialize");
+ }
+ if (argc >= 3) {
+ f = get_freefunc(sym, &funcwrap);
}
if (p) {
@@ -164,6 +167,8 @@ rb_dlptr_initialize(int argc, VALUE argv[], VALUE self)
/* Free previous memory. Use of inappropriate initialize may cause SEGV. */
(*(data->free))(data->ptr);
}
+ data->wrap[0] = wrap;
+ data->wrap[1] = funcwrap;
data->ptr = p;
data->size = s;
data->free = f;
@@ -185,7 +190,7 @@ rb_dlptr_initialize(int argc, VALUE argv[], VALUE self)
static VALUE
rb_dlptr_s_malloc(int argc, VALUE argv[], VALUE klass)
{
- VALUE size, sym, obj;
+ VALUE size, sym, obj, wrap = 0;
long s;
freefunc_t f;
@@ -196,13 +201,14 @@ rb_dlptr_s_malloc(int argc, VALUE argv[], VALUE klass)
break;
case 2:
s = NUM2LONG(size);
- f = get_freefunc(sym);
+ f = get_freefunc(sym, &wrap);
break;
default:
rb_bug("rb_dlptr_s_malloc");
}
obj = rb_dlptr_malloc(s,f);
+ if (wrap) RPTR_DATA(obj)->wrap[1] = wrap;
return obj;
}
@@ -289,7 +295,7 @@ rb_dlptr_free_set(VALUE self, VALUE val)
struct ptr_data *data;
TypedData_Get_Struct(self, struct ptr_data, &dlptr_data_type, data);
- data->free = get_freefunc(val);
+ data->free = get_freefunc(val, &data->wrap[1]);
return Qnil;
}
@@ -487,16 +493,19 @@ rb_dlptr_aref(int argc, VALUE argv[], VALUE self)
VALUE arg0, arg1;
VALUE retval = Qnil;
size_t offset, len;
+ struct ptr_data *data;
+ TypedData_Get_Struct(self, struct ptr_data, &dlptr_data_type, data);
+ if (!data->ptr) rb_raise(rb_eDLError, "NULL pointer dereference");
switch( rb_scan_args(argc, argv, "11", &arg0, &arg1) ){
case 1:
offset = NUM2ULONG(arg0);
- retval = INT2NUM(*((char*)RPTR_DATA(self)->ptr + offset));
+ retval = INT2NUM(*((char *)data->ptr + offset));
break;
case 2:
offset = NUM2ULONG(arg0);
len = NUM2ULONG(arg1);
- retval = rb_tainted_str_new((char *)RPTR_DATA(self)->ptr + offset, len);
+ retval = rb_tainted_str_new((char *)data->ptr + offset, len);
break;
default:
rb_bug("rb_dlptr_aref()");
@@ -520,17 +529,20 @@ rb_dlptr_aset(int argc, VALUE argv[], VALUE self)
VALUE retval = Qnil;
size_t offset, len;
void *mem;
+ struct ptr_data *data;
+ TypedData_Get_Struct(self, struct ptr_data, &dlptr_data_type, data);
+ if (!data->ptr) rb_raise(rb_eDLError, "NULL pointer dereference");
switch( rb_scan_args(argc, argv, "21", &arg0, &arg1, &arg2) ){
case 2:
offset = NUM2ULONG(arg0);
- ((char*)RPTR_DATA(self)->ptr)[offset] = NUM2UINT(arg1);
+ ((char*)data->ptr)[offset] = NUM2UINT(arg1);
retval = arg1;
break;
case 3:
offset = NUM2ULONG(arg0);
len = NUM2ULONG(arg1);
- if( TYPE(arg2) == T_STRING ){
+ if (RB_TYPE_P(arg2, T_STRING)) {
mem = StringValuePtr(arg2);
}
else if( rb_obj_is_kind_of(arg2, rb_cDLCPtr) ){
@@ -539,7 +551,7 @@ rb_dlptr_aset(int argc, VALUE argv[], VALUE self)
else{
mem = NUM2PTR(arg2);
}
- memcpy((char *)RPTR_DATA(self)->ptr + offset, mem, len);
+ memcpy((char *)data->ptr + offset, mem, len);
retval = arg2;
break;
default:
@@ -582,7 +594,7 @@ rb_dlptr_size_get(VALUE self)
static VALUE
rb_dlptr_s_to_ptr(VALUE self, VALUE val)
{
- VALUE ptr;
+ VALUE ptr, wrap = val, vptr;
if (RTEST(rb_obj_is_kind_of(val, rb_cIO))){
rb_io_t *fptr;
@@ -595,20 +607,22 @@ rb_dlptr_s_to_ptr(VALUE self, VALUE val)
char *str = StringValuePtr(val);
ptr = rb_dlptr_new(str, RSTRING_LEN(val), NULL);
}
- else if (rb_respond_to(val, id_to_ptr)){
- VALUE vptr = rb_funcall(val, id_to_ptr, 0);
+ else if ((vptr = rb_check_funcall(val, id_to_ptr, 0, 0)) != Qundef){
if (rb_obj_is_kind_of(vptr, rb_cDLCPtr)){
ptr = vptr;
+ wrap = 0;
}
else{
rb_raise(rb_eDLError, "to_ptr should return a CPtr object");
}
}
else{
- ptr = rb_dlptr_new(NUM2PTR(rb_Integer(val)), 0, NULL);
+ VALUE num = rb_Integer(val);
+ if (num == val) wrap = 0;
+ ptr = rb_dlptr_new(NUM2PTR(num), 0, NULL);
}
OBJ_INFECT(ptr, val);
- rb_iv_set(ptr, "wrapping", val);
+ if (wrap) RPTR_DATA(ptr)->wrap[0] = wrap;
return ptr;
}
@@ -617,6 +631,11 @@ Init_dlptr(void)
{
id_to_ptr = rb_intern("to_ptr");
+ /* Document-class: DL::CPtr
+ *
+ * CPtr is a class to handle C pointers
+ *
+ */
rb_cDLCPtr = rb_define_class_under(rb_mDL, "CPtr", rb_cObject);
rb_define_alloc_func(rb_cDLCPtr, rb_dlptr_s_allocate);
rb_define_singleton_method(rb_cDLCPtr, "malloc", rb_dlptr_s_malloc, -1);
@@ -646,5 +665,9 @@ Init_dlptr(void)
rb_define_method(rb_cDLCPtr, "size", rb_dlptr_size_get, 0);
rb_define_method(rb_cDLCPtr, "size=", rb_dlptr_size_set, 1);
+ /* Document-const: NULL
+ *
+ * A NULL pointer
+ */
rb_define_const(rb_mDL, "NULL", rb_dlptr_new(0, 0, 0));
}
diff --git a/ext/dl/dl.c b/ext/dl/dl.c
index 9635794883..49fa7c81ac 100644
--- a/ext/dl/dl.c
+++ b/ext/dl/dl.c
@@ -1,3 +1,10 @@
+/*
+ * ext/dl/dl.c
+ *
+ * doumentation:
+ * - Vincent Batts (vbatts@hashbangbash.com)
+ *
+ */
#include <ruby/ruby.h>
#include <ruby/io.h>
#include <ctype.h>
@@ -10,6 +17,53 @@ VALUE rb_eDLTypeError;
ID rbdl_id_cdecl;
ID rbdl_id_stdcall;
+#ifndef DLTYPE_SSIZE_T
+# if SIZEOF_SIZE_T == SIZEOF_INT
+# define DLTYPE_SSIZE_T DLTYPE_INT
+# elif SIZEOF_SIZE_T == SIZEOF_LONG
+# define DLTYPE_SSIZE_T DLTYPE_LONG
+# elif defined HAVE_LONG_LONG && SIZEOF_SIZE_T == SIZEOF_LONG_LONG
+# define DLTYPE_SSIZE_T DLTYPE_LONG_LONG
+# endif
+#endif
+#define DLTYPE_SIZE_T (-1*SIGNEDNESS_OF_SIZE_T*DLTYPE_SSIZE_T)
+
+#ifndef DLTYPE_PTRDIFF_T
+# if SIZEOF_PTRDIFF_T == SIZEOF_INT
+# define DLTYPE_PTRDIFF_T DLTYPE_INT
+# elif SIZEOF_PTRDIFF_T == SIZEOF_LONG
+# define DLTYPE_PTRDIFF_T DLTYPE_LONG
+# elif defined HAVE_LONG_LONG && SIZEOF_PTRDIFF_T == SIZEOF_LONG_LONG
+# define DLTYPE_PTRDIFF_T DLTYPE_LONG_LONG
+# endif
+#endif
+
+#ifndef DLTYPE_INTPTR_T
+# if SIZEOF_INTPTR_T == SIZEOF_INT
+# define DLTYPE_INTPTR_T DLTYPE_INT
+# elif SIZEOF_INTPTR_T == SIZEOF_LONG
+# define DLTYPE_INTPTR_T DLTYPE_LONG
+# elif defined HAVE_LONG_LONG && SIZEOF_INTPTR_T == SIZEOF_LONG_LONG
+# define DLTYPE_INTPTR_T DLTYPE_LONG_LONG
+# endif
+#endif
+#define DLTYPE_UINTPTR_T (-DLTYPE_INTPTR_T)
+
+/*
+ * call-seq: DL.dlopen(so_lib)
+ *
+ * An interface to the dynamic linking loader
+ *
+ * This is a shortcut to DL::Handle.new and takes the same arguments.
+ *
+ * Example:
+ *
+ * libc_so = "/lib64/libc.so.6"
+ * => "/lib64/libc.so.6"
+ *
+ * libc = DL.dlopen(libc_so)
+ * => #<DL::Handle:0x00000000e05b00>
+ */
VALUE
rb_dl_dlopen(int argc, VALUE argv[], VALUE self)
{
@@ -17,7 +71,7 @@ rb_dl_dlopen(int argc, VALUE argv[], VALUE self)
}
/*
- * call-seq: DL.malloc
+ * call-seq: DL.malloc(size)
*
* Allocate +size+ bytes of memory and return the integer memory address
* for the allocated memory.
@@ -64,6 +118,22 @@ rb_dl_free(VALUE self, VALUE addr)
return Qnil;
}
+/*
+ * call-seq: DL.dlunwrap(addr)
+ *
+ * Returns the hexadecimal representation of a memory pointer address +addr+
+ *
+ * Example:
+ *
+ * lib = DL.dlopen('/lib64/libc-2.15.so')
+ * => #<DL::Handle:0x00000001342460>
+ *
+ * lib['strcpy'].to_s(16)
+ * => "7f59de6dd240"
+ *
+ * DL.dlunwrap(DL.dlwrap(lib['strcpy'].to_s(16)))
+ * => "7f59de6dd240"
+ */
VALUE
rb_dl_ptr2value(VALUE self, VALUE addr)
{
@@ -71,6 +141,19 @@ rb_dl_ptr2value(VALUE self, VALUE addr)
return (VALUE)NUM2PTR(addr);
}
+/*
+ * call-seq: DL.dlwrap(val)
+ *
+ * Returns a memory pointer of a function's hexadecimal address location +val+
+ *
+ * Example:
+ *
+ * lib = DL.dlopen('/lib64/libc-2.15.so')
+ * => #<DL::Handle:0x00000001342460>
+ *
+ * DL.dlwrap(lib['strcpy'].to_s(16))
+ * => 25522520
+ */
VALUE
rb_dl_value2ptr(VALUE self, VALUE val)
{
@@ -100,53 +183,360 @@ Init_dl(void)
rbdl_id_cdecl = rb_intern_const("cdecl");
rbdl_id_stdcall = rb_intern_const("stdcall");
+ /* Document-module: DL
+ *
+ * A bridge to the dlopen() or dynamic library linker function.
+ *
+ * == Example
+ *
+ * bash $> cat > sum.c <<EOF
+ * double sum(double *arry, int len)
+ * {
+ * double ret = 0;
+ * int i;
+ * for(i = 0; i < len; i++){
+ * ret = ret + arry[i];
+ * }
+ * return ret;
+ * }
+ *
+ * double split(double num)
+ * {
+ * double ret = 0;
+ * ret = num / 2;
+ * return ret;
+ * }
+ * EOF
+ * bash $> gcc -o libsum.so -shared sum.c
+ * bash $> cat > sum.rb <<EOF
+ * require 'dl'
+ * require 'dl/import'
+ *
+ * module LibSum
+ * extend DL::Importer
+ * dlload './libsum.so'
+ * extern 'double sum(double*, int)'
+ * extern 'double split(double)'
+ * end
+ *
+ * a = [2.0, 3.0, 4.0]
+ *
+ * sum = LibSum.sum(a.pack("d*"), a.count)
+ * p LibSum.split(sum)
+ * EOF
+ * bash $> ruby sum.rb
+ * 4.5
+ *
+ * WIN! :-)
+ */
rb_mDL = rb_define_module("DL");
+
+ /*
+ * Document-class: DL::DLError
+ *
+ * standard dynamic load exception
+ */
rb_eDLError = rb_define_class_under(rb_mDL, "DLError", rb_eStandardError);
+
+ /*
+ * Document-class: DL::DLTypeError
+ *
+ * dynamic load incorrect type exception
+ */
rb_eDLTypeError = rb_define_class_under(rb_mDL, "DLTypeError", rb_eDLError);
+ /* Document-const: MAX_CALLBACK
+ *
+ * Maximum number of callbacks
+ */
rb_define_const(rb_mDL, "MAX_CALLBACK", INT2NUM(MAX_CALLBACK));
+
+ /* Document-const: DLSTACK_SIZE
+ *
+ * Dynamic linker stack size
+ */
rb_define_const(rb_mDL, "DLSTACK_SIZE", INT2NUM(DLSTACK_SIZE));
rb_dl_init_callbacks(rb_mDL);
+ /* Document-const: RTLD_GLOBAL
+ *
+ * rtld DL::Handle flag.
+ *
+ * The symbols defined by this library will be made available for symbol
+ * resolution of subsequently loaded libraries.
+ */
rb_define_const(rb_mDL, "RTLD_GLOBAL", INT2NUM(RTLD_GLOBAL));
+
+ /* Document-const: RTLD_LAZY
+ *
+ * rtld DL::Handle flag.
+ *
+ * Perform lazy binding. Only resolve symbols as the code that references
+ * them is executed. If the symbol is never referenced, then it is never
+ * resolved. (Lazy binding is only performed for function references;
+ * references to variables are always immediately bound when the library
+ * is loaded.)
+ */
rb_define_const(rb_mDL, "RTLD_LAZY", INT2NUM(RTLD_LAZY));
+
+ /* Document-const: RTLD_NOW
+ *
+ * rtld DL::Handle flag.
+ *
+ * If this value is specified or the environment variable LD_BIND_NOW is
+ * set to a nonempty string, all undefined symbols in the library are
+ * resolved before dlopen() returns. If this cannot be done an error is
+ * returned.
+ */
rb_define_const(rb_mDL, "RTLD_NOW", INT2NUM(RTLD_NOW));
+ /* Document-const: TYPE_VOID
+ *
+ * DL::CFunc type - void
+ */
rb_define_const(rb_mDL, "TYPE_VOID", INT2NUM(DLTYPE_VOID));
+
+ /* Document-const: TYPE_VOIDP
+ *
+ * DL::CFunc type - void*
+ */
rb_define_const(rb_mDL, "TYPE_VOIDP", INT2NUM(DLTYPE_VOIDP));
+
+ /* Document-const: TYPE_CHAR
+ *
+ * DL::CFunc type - char
+ */
rb_define_const(rb_mDL, "TYPE_CHAR", INT2NUM(DLTYPE_CHAR));
+
+ /* Document-const: TYPE_SHORT
+ *
+ * DL::CFunc type - short
+ */
rb_define_const(rb_mDL, "TYPE_SHORT", INT2NUM(DLTYPE_SHORT));
+
+ /* Document-const: TYPE_INT
+ *
+ * DL::CFunc type - int
+ */
rb_define_const(rb_mDL, "TYPE_INT", INT2NUM(DLTYPE_INT));
+
+ /* Document-const: TYPE_LONG
+ *
+ * DL::CFunc type - long
+ */
rb_define_const(rb_mDL, "TYPE_LONG", INT2NUM(DLTYPE_LONG));
+
#if HAVE_LONG_LONG
+ /* Document-const: TYPE_LONG_LONG
+ *
+ * DL::CFunc type - long long
+ */
rb_define_const(rb_mDL, "TYPE_LONG_LONG", INT2NUM(DLTYPE_LONG_LONG));
#endif
+
+ /* Document-const: TYPE_FLOAT
+ *
+ * DL::CFunc type - float
+ */
rb_define_const(rb_mDL, "TYPE_FLOAT", INT2NUM(DLTYPE_FLOAT));
+
+ /* Document-const: TYPE_DOUBLE
+ *
+ * DL::CFunc type - double
+ */
rb_define_const(rb_mDL, "TYPE_DOUBLE", INT2NUM(DLTYPE_DOUBLE));
+ /* Document-const: TYPE_SIZE_T
+ *
+ * DL::CFunc type - size_t
+ */
+ rb_define_const(rb_mDL, "TYPE_SIZE_T", INT2NUM(DLTYPE_SIZE_T));
+
+ /* Document-const: TYPE_SSIZE_T
+ *
+ * DL::CFunc type - ssize_t
+ */
+ rb_define_const(rb_mDL, "TYPE_SSIZE_T", INT2NUM(DLTYPE_SSIZE_T));
+
+ /* Document-const: TYPE_PTRDIFF_T
+ *
+ * DL::CFunc type - ptrdiff_t
+ */
+ rb_define_const(rb_mDL, "TYPE_PTRDIFF_T", INT2NUM(DLTYPE_PTRDIFF_T));
+
+ /* Document-const: TYPE_INTPTR_T
+ *
+ * DL::CFunc type - intptr_t
+ */
+ rb_define_const(rb_mDL, "TYPE_INTPTR_T", INT2NUM(DLTYPE_INTPTR_T));
+
+ /* Document-const: TYPE_UINTPTR_T
+ *
+ * DL::CFunc type - uintptr_t
+ */
+ rb_define_const(rb_mDL, "TYPE_UINTPTR_T", INT2NUM(DLTYPE_UINTPTR_T));
+
+ /* Document-const: ALIGN_VOIDP
+ *
+ * The alignment size of a void*
+ */
rb_define_const(rb_mDL, "ALIGN_VOIDP", INT2NUM(ALIGN_VOIDP));
+
+ /* Document-const: ALIGN_CHAR
+ *
+ * The alignment size of a char
+ */
rb_define_const(rb_mDL, "ALIGN_CHAR", INT2NUM(ALIGN_CHAR));
+
+ /* Document-const: ALIGN_SHORT
+ *
+ * The alignment size of a short
+ */
rb_define_const(rb_mDL, "ALIGN_SHORT", INT2NUM(ALIGN_SHORT));
+
+ /* Document-const: ALIGN_INT
+ *
+ * The alignment size of an int
+ */
rb_define_const(rb_mDL, "ALIGN_INT", INT2NUM(ALIGN_INT));
+
+ /* Document-const: ALIGN_LONG
+ *
+ * The alignment size of a long
+ */
rb_define_const(rb_mDL, "ALIGN_LONG", INT2NUM(ALIGN_LONG));
+
#if HAVE_LONG_LONG
+ /* Document-const: ALIGN_LONG_LONG
+ *
+ * The alignment size of a long long
+ */
rb_define_const(rb_mDL, "ALIGN_LONG_LONG", INT2NUM(ALIGN_LONG_LONG));
#endif
+
+ /* Document-const: ALIGN_FLOAT
+ *
+ * The alignment size of a float
+ */
rb_define_const(rb_mDL, "ALIGN_FLOAT", INT2NUM(ALIGN_FLOAT));
+
+ /* Document-const: ALIGN_DOUBLE
+ *
+ * The alignment size of a double
+ */
rb_define_const(rb_mDL, "ALIGN_DOUBLE",INT2NUM(ALIGN_DOUBLE));
+ /* Document-const: ALIGN_SIZE_T
+ *
+ * The alignment size of a size_t
+ */
+ rb_define_const(rb_mDL, "ALIGN_SIZE_T", INT2NUM(ALIGN_OF(size_t)));
+
+ /* Document-const: ALIGN_SSIZE_T
+ *
+ * The alignment size of a ssize_t
+ */
+ rb_define_const(rb_mDL, "ALIGN_SSIZE_T", INT2NUM(ALIGN_OF(size_t))); /* same as size_t */
+
+ /* Document-const: ALIGN_PTRDIFF_T
+ *
+ * The alignment size of a ptrdiff_t
+ */
+ rb_define_const(rb_mDL, "ALIGN_PTRDIFF_T", INT2NUM(ALIGN_OF(ptrdiff_t)));
+
+ /* Document-const: ALIGN_INTPTR_T
+ *
+ * The alignment size of a intptr_t
+ */
+ rb_define_const(rb_mDL, "ALIGN_INTPTR_T", INT2NUM(ALIGN_OF(intptr_t)));
+
+ /* Document-const: ALIGN_UINTPTR_T
+ *
+ * The alignment size of a uintptr_t
+ */
+ rb_define_const(rb_mDL, "ALIGN_UINTPTR_T", INT2NUM(ALIGN_OF(uintptr_t)));
+
+ /* Document-const: SIZEOF_VOIDP
+ *
+ * size of a void*
+ */
rb_define_const(rb_mDL, "SIZEOF_VOIDP", INT2NUM(sizeof(void*)));
+
+ /* Document-const: SIZEOF_CHAR
+ *
+ * size of a char
+ */
rb_define_const(rb_mDL, "SIZEOF_CHAR", INT2NUM(sizeof(char)));
+
+ /* Document-const: SIZEOF_SHORT
+ *
+ * size of a short
+ */
rb_define_const(rb_mDL, "SIZEOF_SHORT", INT2NUM(sizeof(short)));
+
+ /* Document-const: SIZEOF_INT
+ *
+ * size of an int
+ */
rb_define_const(rb_mDL, "SIZEOF_INT", INT2NUM(sizeof(int)));
+
+ /* Document-const: SIZEOF_LONG
+ *
+ * size of a long
+ */
rb_define_const(rb_mDL, "SIZEOF_LONG", INT2NUM(sizeof(long)));
+
#if HAVE_LONG_LONG
+ /* Document-const: SIZEOF_LONG_LONG
+ *
+ * size of a long long
+ */
rb_define_const(rb_mDL, "SIZEOF_LONG_LONG", INT2NUM(sizeof(LONG_LONG)));
#endif
+
+ /* Document-const: SIZEOF_FLOAT
+ *
+ * size of a float
+ */
rb_define_const(rb_mDL, "SIZEOF_FLOAT", INT2NUM(sizeof(float)));
+
+ /* Document-const: SIZEOF_DOUBLE
+ *
+ * size of a double
+ */
rb_define_const(rb_mDL, "SIZEOF_DOUBLE",INT2NUM(sizeof(double)));
+ /* Document-const: SIZEOF_SIZE_T
+ *
+ * size of a size_t
+ */
+ rb_define_const(rb_mDL, "SIZEOF_SIZE_T", INT2NUM(sizeof(size_t)));
+
+ /* Document-const: SIZEOF_SSIZE_T
+ *
+ * size of a ssize_t
+ */
+ rb_define_const(rb_mDL, "SIZEOF_SSIZE_T", INT2NUM(sizeof(size_t))); /* same as size_t */
+
+ /* Document-const: SIZEOF_PTRDIFF_T
+ *
+ * size of a ptrdiff_t
+ */
+ rb_define_const(rb_mDL, "SIZEOF_PTRDIFF_T", INT2NUM(sizeof(ptrdiff_t)));
+
+ /* Document-const: SIZEOF_INTPTR_T
+ *
+ * size of a intptr_t
+ */
+ rb_define_const(rb_mDL, "SIZEOF_INTPTR_T", INT2NUM(sizeof(intptr_t)));
+
+ /* Document-const: SIZEOF_UINTPTR_T
+ *
+ * size of a uintptr_t
+ */
+ rb_define_const(rb_mDL, "SIZEOF_UINTPTR_T", INT2NUM(sizeof(uintptr_t)));
+
rb_define_module_function(rb_mDL, "dlwrap", rb_dl_value2ptr, 1);
rb_define_module_function(rb_mDL, "dlunwrap", rb_dl_ptr2value, 1);
@@ -155,8 +545,26 @@ Init_dl(void)
rb_define_module_function(rb_mDL, "realloc", rb_dl_realloc, 2);
rb_define_module_function(rb_mDL, "free", rb_dl_free, 1);
+ /* Document-const: RUBY_FREE
+ *
+ * Address of the ruby_xfree() function
+ */
rb_define_const(rb_mDL, "RUBY_FREE", PTR2NUM(ruby_xfree));
+
+ /* Document-const: BUILD_RUBY_PLATFORM
+ *
+ * Platform built against (i.e. "x86_64-linux", etc.)
+ *
+ * See also RUBY_PLATFORM
+ */
rb_define_const(rb_mDL, "BUILD_RUBY_PLATFORM", rb_str_new2(RUBY_PLATFORM));
+
+ /* Document-const: BUILD_RUBY_VERSION
+ *
+ * Ruby Version built. (i.e. "1.9.3")
+ *
+ * See also RUBY_VERSION
+ */
rb_define_const(rb_mDL, "BUILD_RUBY_VERSION", rb_str_new2(RUBY_VERSION));
Init_dlhandle();
diff --git a/ext/dl/dl.h b/ext/dl/dl.h
index f893d8c2ae..07adbbf680 100644
--- a/ext/dl/dl.h
+++ b/ext/dl/dl.h
@@ -134,30 +134,21 @@ extern VALUE rb_cDLSymbol;
extern VALUE rb_eDLError;
extern VALUE rb_eDLTypeError;
-typedef struct { char c; void *x; } s_voidp;
-typedef struct { char c; short x; } s_short;
-typedef struct { char c; int x; } s_int;
-typedef struct { char c; long x; } s_long;
-typedef struct { char c; float x; } s_float;
-typedef struct { char c; double x; } s_double;
-#if HAVE_LONG_LONG
-typedef struct { char c; LONG_LONG x; } s_long_long;
-#endif
+#define ALIGN_OF(type) offsetof(struct {char align_c; type align_x;}, align_x)
-#define ALIGN_VOIDP (sizeof(s_voidp) - sizeof(void *))
-#define ALIGN_SHORT (sizeof(s_short) - sizeof(short))
-#define ALIGN_CHAR (1)
-#define ALIGN_INT (sizeof(s_int) - sizeof(int))
-#define ALIGN_LONG (sizeof(s_long) - sizeof(long))
+#define ALIGN_VOIDP ALIGN_OF(void*)
+#define ALIGN_SHORT ALIGN_OF(short)
+#define ALIGN_CHAR ALIGN_OF(char)
+#define ALIGN_INT ALIGN_OF(int)
+#define ALIGN_LONG ALIGN_OF(long)
#if HAVE_LONG_LONG
-#define ALIGN_LONG_LONG (sizeof(s_long_long) - sizeof(LONG_LONG))
+#define ALIGN_LONG_LONG ALIGN_OF(LONG_LONG)
#endif
-#define ALIGN_FLOAT (sizeof(s_float) - sizeof(float))
-#define ALIGN_DOUBLE (sizeof(s_double) - sizeof(double))
+#define ALIGN_FLOAT ALIGN_OF(float)
+#define ALIGN_DOUBLE ALIGN_OF(double)
-#define DLALIGN(ptr,offset,align) {\
- while( (((unsigned long)((char *)(ptr) + (offset))) % (align)) != 0 ) (offset)++;\
-}
+#define DLALIGN(ptr,offset,align) \
+ ((offset) += ((align) - ((uintptr_t)((char *)(ptr) + (offset))) % (align)) % (align))
#define DLTYPE_VOID 0
@@ -199,6 +190,7 @@ struct cfunc_data {
char *name;
int type;
ID calltype;
+ VALUE wrap;
};
extern ID rbdl_id_cdecl;
extern ID rbdl_id_stdcall;
@@ -209,6 +201,7 @@ struct ptr_data {
void *ptr;
long size;
freefunc_t free;
+ VALUE wrap[2];
};
#define RDL_HANDLE(obj) ((struct dl_handle *)(DATA_PTR(obj)))
diff --git a/ext/dl/extconf.rb b/ext/dl/extconf.rb
index 8317ac35ad..4ef46f85fb 100644
--- a/ext/dl/extconf.rb
+++ b/ext/dl/extconf.rb
@@ -1,7 +1,8 @@
require 'mkmf'
if RbConfig::CONFIG['GCC'] == 'yes'
- $CFLAGS << " -fno-defer-pop -fno-omit-frame-pointer"
+ (have_macro("__clang__") ? $LDFLAGS : $CFLAGS) << " -fno-defer-pop"
+ $CFLAGS << " -fno-omit-frame-pointer"
end
$INSTALLFILES = [
@@ -24,6 +25,19 @@ else
end
if check
+ config = File.read(RbConfig.expand(File.join($arch_hdrdir, "ruby/config.h")))
+ types = {"SIZE_T"=>"SSIZE_T", "PTRDIFF_T"=>nil, "INTPTR_T"=>nil}
+ types.each do |type, signed|
+ if /^\#define\s+SIZEOF_#{type}\s+(SIZEOF_(.+)|\d+)/ =~ config
+ if size = $2 and size != 'VOIDP'
+ size = types.fetch(size) {size}
+ $defs << format("-DDLTYPE_%s=DLTYPE_%s", signed||type, size)
+ end
+ if signed
+ check_signedness(type.downcase, "stddef.h")
+ end
+ end
+ end
$defs << %[-DRUBY_VERSION=\\"#{RUBY_VERSION}\\"]
create_makefile("dl")
end
diff --git a/ext/dl/handle.c b/ext/dl/handle.c
index eea8697e06..ef182e816f 100644
--- a/ext/dl/handle.c
+++ b/ext/dl/handle.c
@@ -78,6 +78,8 @@ rb_dlhandle_close(VALUE self)
return INT2NUM(ret);
}
rb_raise(rb_eDLError, "dlclose() called too many times");
+
+ UNREACHABLE;
}
VALUE
@@ -361,11 +363,59 @@ dlhandle_sym(void *handle, const char *name)
void
Init_dlhandle(void)
{
+ /*
+ * Document-class: DL::Handle
+ *
+ * The DL::Handle is the manner to access the dynamic library
+ *
+ * == Example
+ *
+ * === Setup
+ *
+ * libc_so = "/lib64/libc.so.6"
+ * => "/lib64/libc.so.6"
+ * @handle = DL::Handle.new(libc_so)
+ * => #<DL::Handle:0x00000000d69ef8>
+ *
+ * === Setup, with flags
+ *
+ * libc_so = "/lib64/libc.so.6"
+ * => "/lib64/libc.so.6"
+ * @handle = DL::Handle.new(libc_so, DL::RTLD_LAZY | DL::RTLD_GLOBAL)
+ * => #<DL::Handle:0x00000000d69ef8>
+ *
+ * === Addresses to symbols
+ *
+ * strcpy_addr = @handle['strcpy']
+ * => 140062278451968
+ *
+ * or
+ *
+ * strcpy_addr = @handle.sym('strcpy')
+ * => 140062278451968
+ *
+ */
rb_cDLHandle = rb_define_class_under(rb_mDL, "Handle", rb_cObject);
rb_define_alloc_func(rb_cDLHandle, rb_dlhandle_s_allocate);
rb_define_singleton_method(rb_cDLHandle, "sym", rb_dlhandle_s_sym, 1);
rb_define_singleton_method(rb_cDLHandle, "[]", rb_dlhandle_s_sym, 1);
+
+ /* Document-const: NEXT
+ *
+ * A predefined pseudo-handle of RTLD_NEXT
+ *
+ * Which will find the next occurrence of a function in the search order
+ * after the current library.
+ */
rb_define_const(rb_cDLHandle, "NEXT", predefined_dlhandle(RTLD_NEXT));
+
+ /* Document-const: DEFAULT
+ *
+ * A predefined pseudo-handle of RTLD_DEFAULT
+ *
+ * Which will find the first occurrence of the desired symbol using the
+ * default library search order
+ */
rb_define_const(rb_cDLHandle, "DEFAULT", predefined_dlhandle(RTLD_DEFAULT));
rb_define_method(rb_cDLHandle, "initialize", rb_dlhandle_initialize, -1);
rb_define_method(rb_cDLHandle, "to_i", rb_dlhandle_to_i, 0);
diff --git a/ext/dl/lib/dl.rb b/ext/dl/lib/dl.rb
index 80d46b685a..8e615ae718 100644
--- a/ext/dl/lib/dl.rb
+++ b/ext/dl/lib/dl.rb
@@ -5,7 +5,10 @@ begin
rescue LoadError
end
+warn "DL is deprecated, please use Fiddle"
+
module DL
+ # Returns true if DL is using Fiddle, the libffi wrapper.
def self.fiddle?
Object.const_defined?(:Fiddle)
end
diff --git a/ext/dl/lib/dl/callback.rb b/ext/dl/lib/dl/callback.rb
index 0863c70d4d..1722d3c6b9 100644
--- a/ext/dl/lib/dl/callback.rb
+++ b/ext/dl/lib/dl/callback.rb
@@ -2,13 +2,29 @@ require 'dl'
require 'thread'
module DL
- SEM = Mutex.new
+ # The mutual exclusion (Mutex) semaphore for the DL module
+ SEM = Mutex.new # :nodoc:
if DL.fiddle?
- CdeclCallbackProcs = {}
- CdeclCallbackAddrs = {}
- StdcallCallbackProcs = {}
- StdcallCallbackAddrs = {}
+ # A Hash of callback Procs
+ #
+ # Uses Fiddle
+ CdeclCallbackProcs = {} # :nodoc:
+
+ # A Hash of the addresses of callback Proc
+ #
+ # Uses Fiddle
+ CdeclCallbackAddrs = {} # :nodoc:
+
+ # A Hash of Stdcall callback Procs
+ #
+ # Uses Fiddle on win32
+ StdcallCallbackProcs = {} # :nodoc:
+
+ # A Hash of the addresses of Stdcall callback Procs
+ #
+ # Uses Fiddle on win32
+ StdcallCallbackAddrs = {} # :nodoc:
end
def set_callback_internal(proc_entry, addr_entry, argc, ty, abi = nil, &cbp)
diff --git a/ext/dl/lib/dl/cparser.rb b/ext/dl/lib/dl/cparser.rb
index 210f953471..e70e0f1dc1 100644
--- a/ext/dl/lib/dl/cparser.rb
+++ b/ext/dl/lib/dl/cparser.rb
@@ -1,5 +1,13 @@
module DL
+ # Methods for parsing C struct and C prototype signatures.
module CParser
+ # Parses a C struct's members
+ #
+ # Example:
+ #
+ # parse_struct_signature(['int i', 'char c'])
+ # => [[DL::TYPE_INT, DL::TYPE_CHAR], ["i", "c"]]
+ #
def parse_struct_signature(signature, tymap=nil)
if( signature.is_a?(String) )
signature = signature.split(/\s*,\s*/)
@@ -35,6 +43,16 @@ module DL
return tys, mems
end
+ # Parses a C prototype signature
+ #
+ # Example:
+ #
+ # include DL::CParser
+ # => Object
+ #
+ # parse_signature('double sum(double, double)')
+ # => ["sum", DL::TYPE_DOUBLE, [DL::TYPE_DOUBLE, DL::TYPE_DOUBLE]]
+ #
def parse_signature(signature, tymap=nil)
tymap ||= {}
signature = signature.gsub(/\s+/, " ").strip
@@ -56,6 +74,25 @@ module DL
end
end
+ # Given a String of C type +ty+, return the corresponding DL constant.
+ #
+ # +ty+ can also accept an Array of C type Strings, and will returned in a
+ # corresponding Array.
+ #
+ # If Hash +tymap+ is provided, +ty+ is expected to be the key, and the
+ # value will be the C type to be looked up.
+ #
+ # Example:
+ #
+ # parse_ctype('int')
+ # => DL::TYPE_INT
+ #
+ # parse_ctype('double')
+ # => DL::TYPE_DOUBLE
+ #
+ # parse_ctype('unsigned char')
+ # => -DL::TYPE_CHAR
+ #
def parse_ctype(ty, tymap=nil)
tymap ||= {}
case ty
@@ -95,6 +132,16 @@ module DL
return TYPE_FLOAT
when "double"
return TYPE_DOUBLE
+ when "size_t"
+ return TYPE_SIZE_T
+ when "ssize_t"
+ return TYPE_SSIZE_T
+ when "ptrdiff_t"
+ return TYPE_PTRDIFF_T
+ when "intptr_t"
+ return TYPE_INTPTR_T
+ when "uintptr_t"
+ return TYPE_UINTPTR_T
when /\*/, /\[\s*\]/
return TYPE_VOIDP
else
diff --git a/ext/dl/lib/dl/func.rb b/ext/dl/lib/dl/func.rb
index 3c2245f413..c5d569575c 100644
--- a/ext/dl/lib/dl/func.rb
+++ b/ext/dl/lib/dl/func.rb
@@ -90,6 +90,9 @@ module DL
if( !block )
raise(RuntimeError, "block must be given.")
end
+ unless block.lambda?
+ block = Class.new(self.class){define_method(:call, block); def initialize(obj); obj.instance_variables.each{|s| instance_variable_set(s, obj.instance_variable_get(s))}; end}.new(self).method(:call)
+ end
if( @cfunc.ptr == 0 )
cb = Proc.new{|*args|
ary = @stack.unpack(args)
diff --git a/ext/dl/lib/dl/import.rb b/ext/dl/lib/dl/import.rb
index f22a53aa84..9005153624 100644
--- a/ext/dl/lib/dl/import.rb
+++ b/ext/dl/lib/dl/import.rb
@@ -31,6 +31,22 @@ module DL
end
end
+ # DL::Importer includes the means to dynamically load libraries and build
+ # modules around them including calling extern functions within the C
+ # library that has been loaded.
+ #
+ # == Example
+ #
+ # require 'dl'
+ # require 'dl/import'
+ #
+ # module LibSum
+ # extend DL::Importer
+ # dlload './libsum.so'
+ # extern 'double sum(double*, int)'
+ # extern 'double split(double)'
+ # end
+ #
module Importer
include DL
include CParser
@@ -63,6 +79,7 @@ module DL
end
def sizeof(ty)
+ @type_alias ||= nil
case ty
when String
ty = parse_ctype(ty, @type_alias).abs()
@@ -112,6 +129,7 @@ module DL
private :parse_bind_options
def extern(signature, *opts)
+ @type_alias ||= nil
symname, ctype, argtype = parse_signature(signature, @type_alias)
opt = parse_bind_options(opts)
f = import_function(symname, ctype, argtype, opt[:call_type])
@@ -134,6 +152,7 @@ module DL
end
def bind(signature, *opts, &blk)
+ @type_alias ||= nil
name, ctype, argtype = parse_signature(signature, @type_alias)
h = parse_bind_options(opts)
case h[:callback_type]
@@ -163,12 +182,20 @@ module DL
f
end
+ # Creates a class to wrap the C struct described by +signature+.
+ #
+ # MyStruct = struct ['int i', 'char c']
def struct(signature)
+ @type_alias ||= nil
tys, mems = parse_struct_signature(signature, @type_alias)
DL::CStructBuilder.create(CStruct, tys, mems)
end
+ # Creates a class to wrap the C union described by +signature+.
+ #
+ # MyUnion = union ['int i', 'char c']
def union(signature)
+ @type_alias ||= nil
tys, mems = parse_struct_signature(signature, @type_alias)
DL::CStructBuilder.create(CUnion, tys, mems)
end
@@ -194,7 +221,8 @@ module DL
end
def handler
- @handler or raise "call dlload before importing symbols and functions"
+ defined?(@handler) or raise "call dlload before importing symbols and functions"
+ @handler
end
def import_symbol(name)
diff --git a/ext/dl/lib/dl/struct.rb b/ext/dl/lib/dl/struct.rb
index b8becca6b6..e2d91a6d14 100644
--- a/ext/dl/lib/dl/struct.rb
+++ b/ext/dl/lib/dl/struct.rb
@@ -1,20 +1,52 @@
require 'dl'
+require 'dl/value'
require 'dl/pack.rb'
module DL
+ # C struct shell
class CStruct
+ # accessor to DL::CStructEntity
def CStruct.entity_class()
CStructEntity
end
end
+ # C union shell
class CUnion
+ # accessor to DL::CUnionEntity
def CUnion.entity_class()
CUnionEntity
end
end
+ # Used to construct C classes (CUnion, CStruct, etc)
+ #
+ # DL::Importer#struct and DL::Importer#union wrap this functionality in an
+ # easy-to-use manner.
module CStructBuilder
+ # Construct a new class given a C:
+ # * class +klass+ (CUnion, CStruct, or other that provide an
+ # #entity_class)
+ # * +types+ (DL:TYPE_INT, DL::TYPE_SIZE_T, etc., see the C types
+ # constants)
+ # * corresponding +members+
+ #
+ # DL::Importer#struct and DL::Importer#union wrap this functionality in an
+ # easy-to-use manner.
+ #
+ # Example:
+ #
+ # require 'dl/struct'
+ # require 'dl/cparser'
+ #
+ # include DL::CParser
+ #
+ # types, members = parse_struct_signature(['int i','char c'])
+ #
+ # MyStruct = DL::CStructBuilder.create(CUnion, types, members)
+ #
+ # obj = MyStruct.allocate
+ #
def create(klass, types, members)
new_class = Class.new(klass){
define_method(:initialize){|addr|
@@ -43,75 +75,76 @@ module DL
module_function :create
end
- class CStructEntity < CPtr
+ # A C struct wrapper
+ class CStructEntity < (DL.fiddle? ? Fiddle::Pointer : CPtr)
include PackInfo
include ValueUtil
+ # Allocates a C struct the +types+ provided. The C function +func+ is
+ # called when the instance is garbage collected.
def CStructEntity.malloc(types, func = nil)
addr = DL.malloc(CStructEntity.size(types))
CStructEntity.new(addr, types, func)
end
+ # Given +types+, returns the offset for the packed sizes of those types
+ #
+ # DL::CStructEntity.size([DL::TYPE_DOUBLE, DL::TYPE_INT, DL::TYPE_CHAR,
+ # DL::TYPE_VOIDP])
+ # => 24
def CStructEntity.size(types)
offset = 0
- max_align = 0
- types.each_with_index{|t,i|
- orig_offset = offset
- if( t.is_a?(Array) )
- align = PackInfo::ALIGN_MAP[t[0]]
- offset = PackInfo.align(orig_offset, align)
- size = offset - orig_offset
- offset += (PackInfo::SIZE_MAP[t[0]] * t[1])
- else
- align = PackInfo::ALIGN_MAP[t]
- offset = PackInfo.align(orig_offset, align)
- size = offset - orig_offset
- offset += PackInfo::SIZE_MAP[t]
- end
- if (max_align < align)
- max_align = align
- end
- }
- offset = PackInfo.align(offset, max_align)
- offset
+
+ max_align = types.map { |type, count = 1|
+ last_offset = offset
+
+ align = PackInfo::ALIGN_MAP[type]
+ offset = PackInfo.align(last_offset, align) +
+ (PackInfo::SIZE_MAP[type] * count)
+
+ align
+ }.max
+
+ PackInfo.align(offset, max_align)
end
+ # Wraps the C pointer +addr+ as a C struct with the given +types+. The C
+ # function +func+ is called when the instance is garbage collected.
+ #
+ # See also DL::CPtr.new
def initialize(addr, types, func = nil)
set_ctypes(types)
super(addr, @size, func)
end
+ # Set the names of the +members+ in this C struct
def assign_names(members)
@members = members
end
+ # Given +types+, calculate the offsets and sizes for the types in the
+ # struct.
def set_ctypes(types)
@ctypes = types
@offset = []
offset = 0
- max_align = 0
- types.each_with_index{|t,i|
+
+ max_align = types.map { |type, count = 1|
orig_offset = offset
- if( t.is_a?(Array) )
- align = ALIGN_MAP[t[0]]
- else
- align = ALIGN_MAP[t]
- end
+ align = ALIGN_MAP[type]
offset = PackInfo.align(orig_offset, align)
- @offset[i] = offset
- if( t.is_a?(Array) )
- offset += (SIZE_MAP[t[0]] * t[1])
- else
- offset += SIZE_MAP[t]
- end
- if (max_align < align)
- max_align = align
- end
- }
- offset = PackInfo.align(offset, max_align)
- @size = offset
+
+ @offset << offset
+
+ offset += (SIZE_MAP[type] * count)
+
+ align
+ }.max
+
+ @size = PackInfo.align(offset, max_align)
end
+ # Fetch struct member +name+
def [](name)
idx = @members.index(name)
if( idx.nil? )
@@ -145,6 +178,7 @@ module DL
end
end
+ # Set struct member +name+, to value +val+
def []=(name, val)
idx = @members.index(name)
if( idx.nil? )
@@ -164,48 +198,38 @@ module DL
end
end
- def to_s()
+ def to_s() # :nodoc:
super(@size)
end
end
+ # A C union wrapper
class CUnionEntity < CStructEntity
include PackInfo
+ # Allocates a C union the +types+ provided. The C function +func+ is
+ # called when the instance is garbage collected.
def CUnionEntity.malloc(types, func=nil)
addr = DL.malloc(CUnionEntity.size(types))
CUnionEntity.new(addr, types, func)
end
+ # Given +types+, returns the size needed for the union.
+ #
+ # DL::CUnionEntity.size([DL::TYPE_DOUBLE, DL::TYPE_INT, DL::TYPE_CHAR,
+ # DL::TYPE_VOIDP])
+ # => 8
def CUnionEntity.size(types)
- size = 0
- types.each_with_index{|t,i|
- if( t.is_a?(Array) )
- tsize = PackInfo::SIZE_MAP[t[0]] * t[1]
- else
- tsize = PackInfo::SIZE_MAP[t]
- end
- if( tsize > size )
- size = tsize
- end
- }
+ types.map { |type, count = 1|
+ PackInfo::SIZE_MAP[type] * count
+ }.max
end
+ # Given +types+, calculate the necessary offset and for each union member
def set_ctypes(types)
@ctypes = types
- @offset = []
- @size = 0
- types.each_with_index{|t,i|
- @offset[i] = 0
- if( t.is_a?(Array) )
- size = SIZE_MAP[t[0]] * t[1]
- else
- size = SIZE_MAP[t]
- end
- if( size > @size )
- @size = size
- end
- }
+ @offset = Array.new(types.length, 0)
+ @size = self.class.size types
end
end
end
diff --git a/ext/dl/lib/dl/types.rb b/ext/dl/lib/dl/types.rb
index b85ac890cd..d5724e407b 100644
--- a/ext/dl/lib/dl/types.rb
+++ b/ext/dl/lib/dl/types.rb
@@ -1,9 +1,36 @@
module DL
+ # Adds Windows type aliases to the including class for use with
+ # DL::Importer.
+ #
+ # The aliases added are:
+ # * ATOM
+ # * BOOL
+ # * BYTE
+ # * DWORD
+ # * DWORD32
+ # * DWORD64
+ # * HANDLE
+ # * HDC
+ # * HINSTANCE
+ # * HWND
+ # * LPCSTR
+ # * LPSTR
+ # * PBYTE
+ # * PDWORD
+ # * PHANDLE
+ # * PVOID
+ # * PWORD
+ # * UCHAR
+ # * UINT
+ # * ULONG
+ # * WORD
module Win32Types
- def included(m)
+ def included(m) # :nodoc:
m.module_eval{
typealias "DWORD", "unsigned long"
typealias "PDWORD", "unsigned long *"
+ typealias "DWORD32", "unsigned long"
+ typealias "DWORD64", "unsigned long long"
typealias "WORD", "unsigned short"
typealias "PWORD", "unsigned short *"
typealias "BOOL", "int"
@@ -13,7 +40,7 @@ module DL
typealias "UINT", "unsigned int"
typealias "ULONG", "unsigned long"
typealias "UCHAR", "unsigned char"
- typealias "HANDLE", "unsigned long"
+ typealias "HANDLE", "uintptr_t"
typealias "PHANDLE", "void*"
typealias "PVOID", "void*"
typealias "LPCSTR", "char*"
@@ -26,8 +53,12 @@ module DL
module_function :included
end
+ # Adds basic type aliases to the including class for use with DL::Importer.
+ #
+ # The aliases added are +uint+ and +u_int+ (<tt>unsigned int</tt>) and
+ # +ulong+ and +u_long+ (<tt>unsigned long</tt>)
module BasicTypes
- def included(m)
+ def included(m) # :nodoc:
m.module_eval{
typealias "uint", "unsigned int"
typealias "u_int", "unsigned int"
diff --git a/ext/dl/lib/dl/value.rb b/ext/dl/lib/dl/value.rb
index 51f96b293b..147d9d120a 100644
--- a/ext/dl/lib/dl/value.rb
+++ b/ext/dl/lib/dl/value.rb
@@ -13,7 +13,7 @@ module DL
when TYPE_LONG
[val].pack("l!").unpack("L!")[0]
when TYPE_LONG_LONG
- [val].pack("q!").unpack("Q!")[0]
+ [val].pack("q").unpack("Q")[0]
else
val
end
@@ -30,7 +30,7 @@ module DL
when TYPE_LONG
[val].pack("L!").unpack("l!")[0]
when TYPE_LONG_LONG
- [val].pack("Q!").unpack("q!")[0]
+ [val].pack("Q").unpack("q")[0]
else
val
end
@@ -46,6 +46,8 @@ module DL
end
def wrap_arg(arg, ty, funcs = [], &block)
+ require 'dl/func'
+
funcs ||= []
case arg
when nil
diff --git a/ext/dl/win32/lib/Win32API.rb b/ext/dl/win32/lib/Win32API.rb
index f18cec5749..4d7d4887a5 100644
--- a/ext/dl/win32/lib/Win32API.rb
+++ b/ext/dl/win32/lib/Win32API.rb
@@ -7,6 +7,7 @@ require 'dl'
class Win32API
DLL = {}
TYPEMAP = {"0" => DL::TYPE_VOID, "S" => DL::TYPE_VOIDP, "I" => DL::TYPE_LONG}
+ POINTER_TYPE = DL::SIZEOF_VOIDP == DL::SIZEOF_LONG_LONG ? 'q*' : 'l!*'
def initialize(dllname, func, import, export = "0", calltype = :stdcall)
@proto = [import].join.tr("VPpNnLlIi", "0SSI").sub(/^(.)0*$/, '\1')
@@ -19,7 +20,7 @@ class Win32API
def call(*args)
import = @proto.split("")
args.each_with_index do |x, i|
- args[i], = [x == 0 ? nil : x].pack("p").unpack("l!*") if import[i] == "S"
+ args[i], = [x == 0 ? nil : x].pack("p").unpack(POINTER_TYPE) if import[i] == "S"
args[i], = [x].pack("I").unpack("i") if import[i] == "I"
end
ret, = @func.call(args)
diff --git a/ext/etc/etc.c b/ext/etc/etc.c
index 2bd2e30747..1c1ab813d9 100644
--- a/ext/etc/etc.c
+++ b/ext/etc/etc.c
@@ -174,6 +174,7 @@ static int passwd_blocking = 0;
static VALUE
passwd_ensure(void)
{
+ endpwent();
passwd_blocking = (int)Qfalse;
return Qnil;
}
@@ -187,7 +188,6 @@ passwd_iterate(void)
while (pw = getpwent()) {
rb_yield(setup_passwd(pw));
}
- endpwent();
return Qnil;
}
@@ -412,6 +412,7 @@ static int group_blocking = 0;
static VALUE
group_ensure(void)
{
+ endgrent();
group_blocking = (int)Qfalse;
return Qnil;
}
@@ -425,7 +426,6 @@ group_iterate(void)
while (pw = getgrent()) {
rb_yield(setup_group(pw));
}
- endgrent();
return Qnil;
}
@@ -566,7 +566,9 @@ VALUE rb_w32_conv_from_wchar(const WCHAR *wstr, rb_encoding *enc);
#endif
/*
- * Returns system configuration directory.
+ * Returns system configuration directory. This is typically "/etc", but
+ * is modified by the prefix used when Ruby was compiled. For example,
+ * if Ruby is built and installed in /usr/local, returns "/usr/local/etc".
*/
static VALUE
etc_sysconfdir(VALUE obj)
@@ -579,7 +581,7 @@ etc_sysconfdir(VALUE obj)
}
/*
- * Returns system temporary directory.
+ * Returns system temporary directory; typically "/tmp".
*/
static VALUE
etc_systmpdir(void)
@@ -598,9 +600,25 @@ etc_systmpdir(void)
}
/*
- * The etc module provides access to information from the running OS.
+ * The Etc module provides access to information typically stored in
+ * files in the /etc directory on Unix systems.
+ *
+ * The information accessible consists of the information found in the
+ * /etc/passwd and /etc/group files, plus information about the system's
+ * temporary directory (/tmp) and configuration directory (/etc).
+ *
+ * The Etc module provides a more reliable way to access information about
+ * the logged in user than environment variables such as $USER. For example:
+ *
+ * require 'etc'
+ *
+ * login = Etc.getlogin
+ * info = Etc.getpwnam(login)
+ * username = info.gecos.split(/,/).first
+ * puts "Hello #{username}, I see your login name is #{login}"
*
- * Documented by mathew <meta@pobox.com>.
+ * Note that the methods provided by this module are not always secure.
+ * It should be used for informational purposes, and not for security.
*/
void
Init_etc(void)
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 5665a966a8..4e5f64d4f6 100755
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -1,5 +1,5 @@
#! /usr/local/bin/ruby
-# -*- ruby -*-
+# -*- mode: ruby; coding: us-ascii -*-
$extension = nil
$extstatic = nil
@@ -10,7 +10,7 @@ $dryrun = false
$clean = nil
$nodynamic = nil
$extinit = nil
-$extobjs = nil
+$extobjs = []
$extflags = ""
$extlibs = nil
$extpath = nil
@@ -26,6 +26,8 @@ alias $0 $progname
$extlist = []
$compiled = {}
+DUMMY_SIGNATURE = "***DUMMY MAKEFILE***"
+
srcdir = File.dirname(File.dirname(__FILE__))
unless defined?(CROSS_COMPILING) and CROSS_COMPILING
$:.replace([File.expand_path("lib", srcdir), Dir.pwd])
@@ -40,13 +42,30 @@ $" << "mkmf.rb"
load File.expand_path("lib/mkmf.rb", srcdir)
require 'optparse/shellwords'
+if defined?(File::NULL)
+ @null = File::NULL
+elsif !File.chardev?(@null = "/dev/null")
+ @null = "nul"
+end
+
def sysquote(x)
@quote ||= /os2/ =~ (CROSS_COMPILING || RUBY_PLATFORM)
@quote ? x.quote : x
end
def verbose?
- $mflags.defined?("Q") != "@"
+ $mflags.defined?("V") == "1"
+end
+
+def system(*args)
+ if verbose?
+ if args.size == 1
+ puts args
+ else
+ puts Shellwords.join(args)
+ end
+ end
+ super
end
def extract_makefile(makefile, keep = true)
@@ -73,6 +92,11 @@ def extract_makefile(makefile, keep = true)
end
return false
end
+ srcs = Dir[File.join($srcdir, "*.{#{SRC_EXT.join(%q{,})}}")].map {|fn| File.basename(fn)}.sort
+ if !srcs.empty?
+ old_srcs = m[/^ORIG_SRCS[ \t]*=[ \t](.*)/, 1] or return false
+ old_srcs.split.sort == srcs or return false
+ end
$target = target
$extconf_h = m[/^RUBY_EXTCONF_H[ \t]*=[ \t]*(\S+)/, 1]
if $static.nil?
@@ -95,7 +119,7 @@ def extract_makefile(makefile, keep = true)
end
def extmake(target)
- unless $configure_only
+ unless $configure_only || verbose?
print "#{$message} #{target}\n"
$stdout.flush
end
@@ -142,7 +166,7 @@ def extmake(target)
remove_const(:MAKEFILE_CONFIG)
const_set(:MAKEFILE_CONFIG, mkconfig)
}
- Object.class_eval {
+ MakeMakefile.class_eval {
remove_const(:CONFIG)
const_set(:CONFIG, mkconfig)
}
@@ -152,28 +176,36 @@ def extmake(target)
old_objs = $objs
old_cleanfiles = $distcleanfiles
conf = ["#{$srcdir}/makefile.rb", "#{$srcdir}/extconf.rb"].find {|f| File.exist?(f)}
- if (($extconf_h && !File.exist?($extconf_h)) ||
+ if (!ok || ($extconf_h && !File.exist?($extconf_h)) ||
!(t = modified?(makefile, MTIMES)) ||
[conf, "#{$srcdir}/depend"].any? {|f| modified?(f, [t])})
then
ok = false
if $configure_only
- print "#{$message} #{target}\n"
+ if verbose?
+ print "#{conf}\n" if conf
+ else
+ print "#{$message} #{target}\n"
+ end
$stdout.flush
end
init_mkmf
Logging::logfile 'mkmf.log'
rm_f makefile
if conf
+ stdout = $stdout.dup
+ stderr = $stderr.dup
unless verbose?
- stdout, $stdout = $stdout, File.open(File::NULL, "a")
- else
- stdout = $stdout
+ $stderr.reopen($stdout.reopen(@null))
end
begin
load $0 = conf
ensure
- $stdout = stdout
+ Logging::log_close
+ $stderr.reopen(stderr)
+ $stdout.reopen(stdout)
+ stdout.close
+ stderr.close
end
else
create_makefile(target)
@@ -183,27 +215,38 @@ def extmake(target)
end
rescue SystemExit
# ignore
+ rescue => error
+ ok = false
ensure
rm_f "conftest*"
- config = $0
$0 = $PROGRAM_NAME
end
end
+ ok &&= File.open(makefile){|f| !f.gets[DUMMY_SIGNATURE]}
ok = yield(ok) if block_given?
unless ok
open(makefile, "w") do |f|
+ f.puts "# " + DUMMY_SIGNATURE
f.print(*dummy_makefile(CONFIG["srcdir"]))
end
- print "Failed to configure #{target}. It will not be installed.\n"
+
+ mess = "Failed to configure #{target}. It will not be installed.\n"
+ if error
+ mess = "#{error}\n#{mess}"
+ end
+
+ Logging::message(mess)
+ print(mess)
+ $stdout.flush
return true
end
args = sysquote($mflags)
unless $destdir.to_s.empty? or $mflags.defined?("DESTDIR")
args += [sysquote("DESTDIR=" + relative_from($destdir, "../"+prefix))]
end
- if $static
+ if $static and ok and !$objs.empty? and !File.fnmatch?("-*", target)
args += ["static"] unless $clean
- $extlist.push [$static, $target, File.basename($target), $preload]
+ $extlist.push [$static, target, $target, $preload]
end
FileUtils.rm_f(old_cleanfiles - $distcleanfiles)
FileUtils.rm_f(old_objs - $objs)
@@ -222,9 +265,9 @@ def extmake(target)
$extlibs ||= []
$extpath ||= []
unless $mswin
- $extflags = ($extflags.split | $DLDFLAGS.split | $LDFLAGS.split).join(" ")
+ $extflags = split_libs($extflags, $DLDFLAGS, $LDFLAGS).uniq.join(" ")
end
- $extlibs = merge_libs($extlibs, $libs.split, $LOCAL_LIBS.split)
+ $extlibs = merge_libs($extlibs, split_libs($libs), split_libs($LOCAL_LIBS))
$extpath |= $LIBPATH
end
ensure
@@ -235,7 +278,7 @@ def extmake(target)
remove_const(:MAKEFILE_CONFIG)
const_set(:MAKEFILE_CONFIG, mkconfig0)
}
- Object.class_eval {
+ MakeMakefile.class_eval {
remove_const(:CONFIG)
const_set(:CONFIG, mkconfig0)
}
@@ -419,7 +462,7 @@ end unless $extstatic
ext_prefix = "#{$top_srcdir}/ext"
exts = $static_ext.sort_by {|t, i| i}.collect {|t, i| t}
withes, withouts = %w[--with --without].collect {|w|
- if not (w = %w[-extensions -ext].collect {|o|arg_config(w+o)}).any?
+ if !(w = %w[-extensions -ext].collect {|o|arg_config(w+o)}).any?
nil
elsif (w = w.grep(String)).empty?
proc {true}
@@ -462,7 +505,7 @@ Dir::chdir('ext')
hdrdir = $hdrdir
$hdrdir = ($top_srcdir = relative_from(srcdir, $topdir = "..")) + "/include"
exts.each do |d|
- $static = $force_static ? $static_ext[target] : nil
+ $static = $force_static ? true : $static_ext[target]
if $ignore or !$nodynamic or $static
extmake(d) or abort
@@ -498,7 +541,7 @@ if $ignore
end
$extinit ||= ""
-$extobjs ||= ""
+$extobjs ||= []
$extpath ||= []
$extflags ||= ""
$extlibs ||= []
@@ -507,7 +550,7 @@ unless $extlist.empty?
list = $extlist.dup
built = []
while e = list.shift
- s,t,i,r = e
+ s,t,i,r,os = e
if r and !(r -= built).empty?
l = list.size
if (while l > 0; break true if r.include?(list[l-=1][1]) end)
@@ -515,31 +558,27 @@ unless $extlist.empty?
end
next
end
- f = format("%s/%s.%s", t, i, $LIBEXT)
- if File.exist?(f)
- $extinit << " init(Init_#{i}, \"#{t}.so\");\n"
- $extobjs << "ext/#{f} "
- built << t
- end
+ $extinit << " init(Init_#{File.basename i}, \"#{i}.so\");\n"
+ $extobjs << format("ext/%s/%s.%s", t, File.basename(i), $LIBEXT)
+ built << t
end
src = %{\
-#include "ruby.h"
+#include "ruby/ruby.h"
#define init(func, name) { \\
- extern void func _((void)); \\
+ extern void func(void); \\
ruby_init_ext(name, func); \\
}
-void ruby_init_ext _((const char *name, void (*init)(void)));
+void ruby_init_ext(const char *name, void (*init)(void));
-void Init_ext _((void))\n{\n#$extinit}
+void Init_ext(void)\n{\n#$extinit}
}
if !modified?(extinit.c, MTIMES) || IO.read(extinit.c) != src
open(extinit.c, "w") {|fe| fe.print src}
end
- $extobjs = "ext/#{extinit.o} #{$extobjs}"
if RUBY_PLATFORM =~ /beos/
$extflags.delete("-L/usr/local/lib")
end
@@ -548,7 +587,6 @@ void Init_ext _((void))\n{\n#$extinit}
conf = [
['LIBRUBY_SO_UPDATE', '$(LIBRUBY_EXTS)'],
['SETUP', $setup],
- [enable_config("shared", $enable_shared) ? 'DLDOBJS' : 'EXTOBJS', $extobjs],
['EXTLIBS', $extlibs.join(' ')], ['EXTLDFLAGS', $extflags]
].map {|n, v|
"#{n}=#{v}" if v and !(v = v.strip).empty?
@@ -600,32 +638,56 @@ if $configure_only and $command_output
mf.puts "MFLAGS = -$(MAKEFLAGS)" if $nmake
mf.puts
- mf.print "extensions ="
- w = 12
- exts.each do |d|
- if d.size + w > 70
- mf.print " \\\n\t "
- w = 12
+ def mf.macro(name, values, max = 70)
+ print name, " ="
+ w = w0 = name.size + 2
+ h = " \\\n" + "\t" * (w / 8) + " " * (w % 8)
+ values.each do |s|
+ if s.size + w > max
+ print h
+ w = w0
+ end
+ print " ", s
+ w += s.size + 1
end
- mf.print " #{d}"
- w += d.size + 1
+ puts
end
+
+ mf.macro "extensions", exts
+ mf.macro "EXTOBJS", $extlist.empty? ? ["dmyext.#{$OBJEXT}"] : ["ext/extinit.#{$OBJEXT}", *$extobjs]
+ mf.macro "EXTLIBS", $extlibs
+ mf.macro "EXTLDFLAGS", $extflags.split
mf.puts
targets = %w[all install static install-so install-rb clean distclean realclean]
- targets.each do |target|
- mf.puts "#{target}: $(extensions:/.=/#{target})"
+ targets.each do |tgt|
+ mf.puts "#{tgt}: $(extensions:/.=/#{tgt})"
end
mf.puts
- mf.puts "all: #{rubies.join(' ')}"
- mf.puts "#{rubies.join(' ')}: $(extensions:/.=/all)"
- rubies.each do |target|
- mf.puts "#{target}:\n\t$(Q)$(MAKE) $(MFLAGS) $@"
+ mf.puts "clean:\n\t-$(Q)$(RM) ext/extinit.#{$OBJEXT}"
+ mf.puts "distclean:\n\t-$(Q)$(RM) ext/extinit.c"
+ mf.puts
+ mf.puts "#{rubies.join(' ')}: $(extensions:/.=/#{$force_static ? 'static' : 'all'})"
+ (["all static"] + rubies).each_with_index do |tgt, i|
+ mf.print "#{tgt}:\n\t$(Q)$(MAKE) "
+ mf.print "$(MFLAGS) "
+ if enable_config("shared", $enable_shared)
+ mf.print %[DLDOBJS="$(EXTOBJS) $(ENCOBJS)" EXTSOLIBS="$(EXTLIBS)" ]
+ mf.print 'LIBRUBY_SO_UPDATE=$(LIBRUBY_EXTS) '
+ else
+ mf.print %[EXTOBJS="$(EXTOBJS) $(ENCOBJS)" EXTLIBS="$(EXTLIBS)" ]
+ end
+ mf.print 'EXTLDFLAGS="$(EXTLDFLAGS)" '
+ if i == 0
+ mf.puts rubies.join(' ')
+ else
+ mf.puts '$@'
+ end
end
mf.puts
- exec = config_string("exec") {|s| s + " "}
- targets.each do |target|
+ exec = config_string("exec") {|str| str + " "}
+ targets.each do |tgt|
exts.each do |d|
- mf.puts "#{d[0..-2]}#{target}:\n\t$(Q)cd $(@D) && #{exec}$(MAKE) $(MFLAGS) $(@F)"
+ mf.puts "#{d[0..-2]}#{tgt}:\n\t$(Q)cd $(@D) && #{exec}$(MAKE) $(MFLAGS) V=$(V) $(@F)"
end
end
end
diff --git a/ext/fiddle/closure.c b/ext/fiddle/closure.c
index 5f55d6d4f8..c4ea6eeb33 100644
--- a/ext/fiddle/closure.c
+++ b/ext/fiddle/closure.c
@@ -10,7 +10,7 @@ typedef struct {
ffi_type **argv;
} fiddle_closure;
-#if defined(MACOSX) || defined(__linux) || defined(__OpenBSD__)
+#if defined(MACOSX) || defined(__linux__) || defined(__OpenBSD__)
#define DONT_USE_FFI_CLOSURE_ALLOC
#endif
@@ -72,6 +72,9 @@ callback(ffi_cif *cif, void *resp, void **args, void *ctx)
case TYPE_INT:
rb_ary_push(params, INT2NUM(*(int *)args[i]));
break;
+ case -TYPE_INT:
+ rb_ary_push(params, UINT2NUM(*(unsigned int *)args[i]));
+ break;
case TYPE_VOIDP:
rb_ary_push(params,
rb_funcall(cPointer, rb_intern("[]"), 1,
@@ -80,8 +83,20 @@ callback(ffi_cif *cif, void *resp, void **args, void *ctx)
case TYPE_LONG:
rb_ary_push(params, LONG2NUM(*(long *)args[i]));
break;
+ case -TYPE_LONG:
+ rb_ary_push(params, ULONG2NUM(*(unsigned long *)args[i]));
+ break;
case TYPE_CHAR:
- rb_ary_push(params, INT2NUM(*(char *)args[i]));
+ rb_ary_push(params, INT2NUM(*(signed char *)args[i]));
+ break;
+ case -TYPE_CHAR:
+ rb_ary_push(params, UINT2NUM(*(unsigned char *)args[i]));
+ break;
+ case TYPE_SHORT:
+ rb_ary_push(params, INT2NUM(*(signed short *)args[i]));
+ break;
+ case -TYPE_SHORT:
+ rb_ary_push(params, UINT2NUM(*(unsigned short *)args[i]));
break;
case TYPE_DOUBLE:
rb_ary_push(params, rb_float_new(*(double *)args[i]));
@@ -91,7 +106,10 @@ callback(ffi_cif *cif, void *resp, void **args, void *ctx)
break;
#if HAVE_LONG_LONG
case TYPE_LONG_LONG:
- rb_ary_push(params, rb_ull2inum(*(unsigned LONG_LONG *)args[i]));
+ rb_ary_push(params, LL2NUM(*(LONG_LONG *)args[i]));
+ break;
+ case -TYPE_LONG_LONG:
+ rb_ary_push(params, ULL2NUM(*(unsigned LONG_LONG *)args[i]));
break;
#endif
default:
@@ -109,15 +127,22 @@ callback(ffi_cif *cif, void *resp, void **args, void *ctx)
case TYPE_LONG:
*(long *)resp = NUM2LONG(ret);
break;
+ case -TYPE_LONG:
+ *(unsigned long *)resp = NUM2ULONG(ret);
+ break;
case TYPE_CHAR:
- *(char *)resp = NUM2INT(ret);
+ case TYPE_SHORT:
+ case TYPE_INT:
+ *(ffi_sarg *)resp = NUM2INT(ret);
+ break;
+ case -TYPE_CHAR:
+ case -TYPE_SHORT:
+ case -TYPE_INT:
+ *(ffi_arg *)resp = NUM2UINT(ret);
break;
case TYPE_VOIDP:
*(void **)resp = NUM2PTR(ret);
break;
- case TYPE_INT:
- *(int *)resp = NUM2INT(ret);
- break;
case TYPE_DOUBLE:
*(double *)resp = NUM2DBL(ret);
break;
@@ -126,7 +151,10 @@ callback(ffi_cif *cif, void *resp, void **args, void *ctx)
break;
#if HAVE_LONG_LONG
case TYPE_LONG_LONG:
- *(unsigned LONG_LONG *)resp = rb_big2ull(ret);
+ *(LONG_LONG *)resp = NUM2LL(ret);
+ break;
+ case -TYPE_LONG_LONG:
+ *(unsigned LONG_LONG *)resp = NUM2ULL(ret);
break;
#endif
default:
@@ -225,11 +253,55 @@ to_i(VALUE self)
void
Init_fiddle_closure()
{
+#if 0
+ mFiddle = rb_define_module("Fiddle"); /* let rdoc know about mFiddle */
+#endif
+
+ /*
+ * Document-class: Fiddle::Closure
+ *
+ * == Description
+ *
+ * An FFI closure wrapper, for handling callbacks.
+ *
+ * == Example
+ *
+ * closure = Class.new(Fiddle::Closure) {
+ * def call
+ * 10
+ * end
+ * }.new(Fiddle::TYPE_INT, [])
+ * #=> #<#<Class:0x0000000150d308>:0x0000000150d240>
+ * func = Fiddle::Function.new(closure, [], Fiddle::TYPE_INT)
+ * #=> #<Fiddle::Function:0x00000001516e58>
+ * func.call
+ * #=> 10
+ */
cFiddleClosure = rb_define_class_under(mFiddle, "Closure", rb_cObject);
rb_define_alloc_func(cFiddleClosure, allocate);
+ /*
+ * Document-method: new
+ *
+ * call-seq: new(ret, *args, abi = Fiddle::DEFAULT)
+ *
+ * Construct a new Closure object.
+ *
+ * * +ret+ is the C type to be returned
+ * * +args+ is an Array of arguments, passed to the callback function
+ * * +abi+ is the abi of the closure
+ *
+ * If there is an error in preparing the ffi_cif or ffi_prep_closure,
+ * then a RuntimeError will be raised.
+ */
rb_define_method(cFiddleClosure, "initialize", initialize, -1);
+
+ /*
+ * Document-method: to_i
+ *
+ * Returns the memory address for this closure
+ */
rb_define_method(cFiddleClosure, "to_i", to_i, 0);
}
/* vim: set noet sw=4 sts=4 */
diff --git a/ext/fiddle/conversions.c b/ext/fiddle/conversions.c
index bb5361a6c8..d40ddc1f38 100644
--- a/ext/fiddle/conversions.c
+++ b/ext/fiddle/conversions.c
@@ -27,7 +27,7 @@ int_to_ffi_type(int type)
return rb_ffi_type_of(long);
#if HAVE_LONG_LONG
case TYPE_LONG_LONG:
- return rb_ffi_type_of(int64);
+ return rb_ffi_type_of(long_long);
#endif
case TYPE_FLOAT:
return &ffi_type_float;
@@ -42,13 +42,6 @@ int_to_ffi_type(int type)
void
value_to_generic(int type, VALUE src, fiddle_generic * dst)
{
- int signed_p = 1;
-
- if (type < 0) {
- type = -1 * type;
- signed_p = 0;
- }
-
switch (type) {
case TYPE_VOID:
break;
@@ -56,19 +49,35 @@ value_to_generic(int type, VALUE src, fiddle_generic * dst)
dst->pointer = NUM2PTR(rb_Integer(src));
break;
case TYPE_CHAR:
+ dst->schar = (signed char)NUM2INT(src);
+ break;
+ case -TYPE_CHAR:
+ dst->uchar = (unsigned char)NUM2UINT(src);
+ break;
case TYPE_SHORT:
+ dst->sshort = (unsigned short)NUM2INT(src);
+ break;
+ case -TYPE_SHORT:
+ dst->sshort = (signed short)NUM2UINT(src);
+ break;
case TYPE_INT:
dst->sint = NUM2INT(src);
break;
+ case -TYPE_INT:
+ dst->uint = NUM2UINT(src);
+ break;
case TYPE_LONG:
- if (signed_p)
- dst->slong = NUM2LONG(src);
- else
- dst->ulong = NUM2LONG(src);
+ dst->slong = NUM2LONG(src);
+ break;
+ case -TYPE_LONG:
+ dst->ulong = NUM2ULONG(src);
break;
#if HAVE_LONG_LONG
case TYPE_LONG_LONG:
- dst->long_long = rb_big2ull(src);
+ dst->slong_long = NUM2LL(src);
+ break;
+ case -TYPE_LONG_LONG:
+ dst->ulong_long = NUM2ULL(src);
break;
#endif
case TYPE_FLOAT:
@@ -85,17 +94,11 @@ value_to_generic(int type, VALUE src, fiddle_generic * dst)
VALUE
generic_to_value(VALUE rettype, fiddle_generic retval)
{
- int signed_p = 1;
int type = NUM2INT(rettype);
VALUE cPointer;
cPointer = rb_const_get(mFiddle, rb_intern("Pointer"));
- if (type < 0) {
- type = -1 * type;
- signed_p = 0;
- }
-
switch (type) {
case TYPE_VOID:
return Qnil;
@@ -103,16 +106,26 @@ generic_to_value(VALUE rettype, fiddle_generic retval)
return rb_funcall(cPointer, rb_intern("[]"), 1,
PTR2NUM((void *)retval.pointer));
case TYPE_CHAR:
+ return INT2NUM((signed char)retval.fffi_sarg);
+ case -TYPE_CHAR:
+ return INT2NUM((unsigned char)retval.fffi_arg);
case TYPE_SHORT:
+ return INT2NUM((signed short)retval.fffi_sarg);
+ case -TYPE_SHORT:
+ return INT2NUM((unsigned short)retval.fffi_arg);
case TYPE_INT:
- return INT2NUM(retval.sint);
+ return INT2NUM((signed int)retval.fffi_sarg);
+ case -TYPE_INT:
+ return UINT2NUM((unsigned int)retval.fffi_arg);
case TYPE_LONG:
- if (signed_p) return LONG2NUM(retval.slong);
+ return LONG2NUM(retval.slong);
+ case -TYPE_LONG:
return ULONG2NUM(retval.ulong);
#if HAVE_LONG_LONG
case TYPE_LONG_LONG:
- return rb_ll2inum(retval.long_long);
- break;
+ return LL2NUM(retval.slong_long);
+ case -TYPE_LONG_LONG:
+ return ULL2NUM(retval.ulong_long);
#endif
case TYPE_FLOAT:
return rb_float_new(retval.ffloat);
@@ -121,6 +134,8 @@ generic_to_value(VALUE rettype, fiddle_generic retval)
default:
rb_raise(rb_eRuntimeError, "unknown type %d", type);
}
+
+ UNREACHABLE;
}
/* vim: set noet sw=4 sts=4 */
diff --git a/ext/fiddle/conversions.h b/ext/fiddle/conversions.h
index eb16125908..d0a08d6bc0 100644
--- a/ext/fiddle/conversions.h
+++ b/ext/fiddle/conversions.h
@@ -5,6 +5,8 @@
typedef union
{
+ ffi_arg fffi_arg; /* rvalue smaller than unsigned long */
+ ffi_sarg fffi_sarg; /* rvalue smaller than signed long */
unsigned char uchar; /* ffi_type_uchar */
signed char schar; /* ffi_type_schar */
unsigned short ushort; /* ffi_type_sshort */
@@ -16,7 +18,8 @@ typedef union
float ffloat; /* ffi_type_float */
double ddouble; /* ffi_type_double */
#if HAVE_LONG_LONG
- unsigned LONG_LONG long_long; /* ffi_type_uint64 */
+ unsigned LONG_LONG ulong_long; /* ffi_type_ulong_long */
+ signed LONG_LONG slong_long; /* ffi_type_ulong_long */
#endif
void * pointer; /* ffi_type_pointer */
} fiddle_generic;
diff --git a/ext/fiddle/extconf.rb b/ext/fiddle/extconf.rb
index 03b0ac2765..2cb9ae0ace 100644
--- a/ext/fiddle/extconf.rb
+++ b/ext/fiddle/extconf.rb
@@ -9,16 +9,46 @@ unless have_header('ffi.h')
if have_header('ffi/ffi.h')
$defs.push(format('-DUSE_HEADER_HACKS'))
else
- abort "ffi.h is missing. Please install libffi."
+ raise "ffi.h is missing. Please install libffi."
end
end
unless have_library('ffi') || have_library('libffi')
- abort "libffi is missing. Please install libffi."
+ raise "libffi is missing. Please install libffi."
end
have_header 'sys/mman.h'
+if have_header "dlfcn.h"
+ have_library "dl"
+
+ %w{ dlopen dlclose dlsym }.each do |func|
+ abort "missing function #{func}" unless have_func(func)
+ end
+
+ have_func "dlerror"
+elsif have_header "windows.h"
+ %w{ LoadLibrary FreeLibrary GetProcAddress }.each do |func|
+ abort "missing function #{func}" unless have_func(func)
+ end
+end
+
+have_const('FFI_STDCALL', 'ffi.h') || have_const('FFI_STDCALL', 'ffi/ffi.h')
+
+config = File.read(RbConfig.expand(File.join($arch_hdrdir, "ruby/config.h")))
+types = {"SIZE_T"=>"SSIZE_T", "PTRDIFF_T"=>nil, "INTPTR_T"=>nil}
+types.each do |type, signed|
+ if /^\#define\s+SIZEOF_#{type}\s+(SIZEOF_(.+)|\d+)/ =~ config
+ if size = $2 and size != 'VOIDP'
+ size = types.fetch(size) {size}
+ $defs << format("-DTYPE_%s=TYPE_%s", signed||type, size)
+ end
+ if signed
+ check_signedness(type.downcase, "stddef.h")
+ end
+ end
+end
+
create_makefile 'fiddle'
# :startdoc:
diff --git a/ext/fiddle/fiddle.c b/ext/fiddle/fiddle.c
index 2580ac0e53..89644301aa 100644
--- a/ext/fiddle/fiddle.c
+++ b/ext/fiddle/fiddle.c
@@ -1,30 +1,458 @@
#include <fiddle.h>
VALUE mFiddle;
+VALUE rb_eFiddleError;
-void Init_fiddle()
+#ifndef TYPE_SSIZE_T
+# if SIZEOF_SIZE_T == SIZEOF_INT
+# define TYPE_SSIZE_T TYPE_INT
+# elif SIZEOF_SIZE_T == SIZEOF_LONG
+# define TYPE_SSIZE_T TYPE_LONG
+# elif defined HAVE_LONG_LONG && SIZEOF_SIZE_T == SIZEOF_LONG_LONG
+# define TYPE_SSIZE_T TYPE_LONG_LONG
+# endif
+#endif
+#define TYPE_SIZE_T (-1*SIGNEDNESS_OF_SIZE_T*TYPE_SSIZE_T)
+
+#ifndef TYPE_PTRDIFF_T
+# if SIZEOF_PTRDIFF_T == SIZEOF_INT
+# define TYPE_PTRDIFF_T TYPE_INT
+# elif SIZEOF_PTRDIFF_T == SIZEOF_LONG
+# define TYPE_PTRDIFF_T TYPE_LONG
+# elif defined HAVE_LONG_LONG && SIZEOF_PTRDIFF_T == SIZEOF_LONG_LONG
+# define TYPE_PTRDIFF_T TYPE_LONG_LONG
+# endif
+#endif
+
+#ifndef TYPE_INTPTR_T
+# if SIZEOF_INTPTR_T == SIZEOF_INT
+# define TYPE_INTPTR_T TYPE_INT
+# elif SIZEOF_INTPTR_T == SIZEOF_LONG
+# define TYPE_INTPTR_T TYPE_LONG
+# elif defined HAVE_LONG_LONG && SIZEOF_INTPTR_T == SIZEOF_LONG_LONG
+# define TYPE_INTPTR_T TYPE_LONG_LONG
+# endif
+#endif
+#define TYPE_UINTPTR_T (-TYPE_INTPTR_T)
+
+void Init_fiddle_pointer(void);
+
+/*
+ * call-seq: Fiddle.malloc(size)
+ *
+ * Allocate +size+ bytes of memory and return the integer memory address
+ * for the allocated memory.
+ */
+static VALUE
+rb_fiddle_malloc(VALUE self, VALUE size)
+{
+ void *ptr;
+
+ rb_secure(4);
+ ptr = (void*)ruby_xmalloc(NUM2INT(size));
+ return PTR2NUM(ptr);
+}
+
+/*
+ * call-seq: Fiddle.realloc(addr, size)
+ *
+ * Change the size of the memory allocated at the memory location +addr+ to
+ * +size+ bytes. Returns the memory address of the reallocated memory, which
+ * may be different than the address passed in.
+ */
+static VALUE
+rb_fiddle_realloc(VALUE self, VALUE addr, VALUE size)
+{
+ void *ptr = NUM2PTR(addr);
+
+ rb_secure(4);
+ ptr = (void*)ruby_xrealloc(ptr, NUM2INT(size));
+ return PTR2NUM(ptr);
+}
+
+/*
+ * call-seq: Fiddle.free(addr)
+ *
+ * Free the memory at address +addr+
+ */
+VALUE
+rb_fiddle_free(VALUE self, VALUE addr)
+{
+ void *ptr = NUM2PTR(addr);
+
+ rb_secure(4);
+ ruby_xfree(ptr);
+ return Qnil;
+}
+
+/*
+ * call-seq: Fiddle.dlunwrap(addr)
+ *
+ * Returns the hexadecimal representation of a memory pointer address +addr+
+ *
+ * Example:
+ *
+ * lib = Fiddle.dlopen('/lib64/libc-2.15.so')
+ * => #<Fiddle::Handle:0x00000001342460>
+ *
+ * lib['strcpy'].to_s(16)
+ * => "7f59de6dd240"
+ *
+ * Fiddle.dlunwrap(Fiddle.dlwrap(lib['strcpy'].to_s(16)))
+ * => "7f59de6dd240"
+ */
+VALUE
+rb_fiddle_ptr2value(VALUE self, VALUE addr)
{
+ rb_secure(4);
+ return (VALUE)NUM2PTR(addr);
+}
+
+/*
+ * call-seq: Fiddle.dlwrap(val)
+ *
+ * Returns a memory pointer of a function's hexadecimal address location +val+
+ *
+ * Example:
+ *
+ * lib = Fiddle.dlopen('/lib64/libc-2.15.so')
+ * => #<Fiddle::Handle:0x00000001342460>
+ *
+ * Fiddle.dlwrap(lib['strcpy'].to_s(16))
+ * => 25522520
+ */
+static VALUE
+rb_fiddle_value2ptr(VALUE self, VALUE val)
+{
+ return PTR2NUM((void*)val);
+}
+
+void Init_fiddle_handle(void);
+
+void
+Init_fiddle(void)
+{
+ /*
+ * Document-module: Fiddle
+ *
+ * A libffi wrapper for Ruby.
+ *
+ * == Description
+ *
+ * Fiddle is an extension to translate a foreign function interface (FFI)
+ * with ruby.
+ *
+ * It wraps {libffi}[http://sourceware.org/libffi/], a popular C library
+ * which provides a portable interface that allows code written in one
+ * language to clal code written in another language.
+ *
+ * == Example
+ *
+ * Here we will use Fiddle::Function to wrap {floor(3) from
+ * libm}[http://linux.die.net/man/3/floor]
+ *
+ * require 'fiddle'
+ *
+ * libm = Fiddle.dlopen('/lib/libm.so.6')
+ *
+ * floor = Fiddle::Function.new(
+ * libm['floor'],
+ * [Fiddle::TYPE_DOUBLE],
+ * Fiddle::TYPE_DOUBLE
+ * )
+ *
+ * puts floor.call(3.14159) #=> 3.0
+ *
+ *
+ */
mFiddle = rb_define_module("Fiddle");
+ /*
+ * Document-class: Fiddle::DLError
+ *
+ * standard dynamic load exception
+ */
+ rb_eFiddleError = rb_define_class_under(mFiddle, "DLError", rb_eStandardError);
+
+ /* Document-const: TYPE_VOID
+ *
+ * C type - void
+ */
rb_define_const(mFiddle, "TYPE_VOID", INT2NUM(TYPE_VOID));
+
+ /* Document-const: TYPE_VOIDP
+ *
+ * C type - void*
+ */
rb_define_const(mFiddle, "TYPE_VOIDP", INT2NUM(TYPE_VOIDP));
+
+ /* Document-const: TYPE_CHAR
+ *
+ * C type - char
+ */
rb_define_const(mFiddle, "TYPE_CHAR", INT2NUM(TYPE_CHAR));
+
+ /* Document-const: TYPE_SHORT
+ *
+ * C type - short
+ */
rb_define_const(mFiddle, "TYPE_SHORT", INT2NUM(TYPE_SHORT));
+
+ /* Document-const: TYPE_INT
+ *
+ * C type - int
+ */
rb_define_const(mFiddle, "TYPE_INT", INT2NUM(TYPE_INT));
+
+ /* Document-const: TYPE_LONG
+ *
+ * C type - long
+ */
rb_define_const(mFiddle, "TYPE_LONG", INT2NUM(TYPE_LONG));
+
#if HAVE_LONG_LONG
+ /* Document-const: TYPE_LONG_LONG
+ *
+ * C type - long long
+ */
rb_define_const(mFiddle, "TYPE_LONG_LONG", INT2NUM(TYPE_LONG_LONG));
#endif
+
+ /* Document-const: TYPE_FLOAT
+ *
+ * C type - float
+ */
rb_define_const(mFiddle, "TYPE_FLOAT", INT2NUM(TYPE_FLOAT));
+
+ /* Document-const: TYPE_DOUBLE
+ *
+ * C type - double
+ */
rb_define_const(mFiddle, "TYPE_DOUBLE", INT2NUM(TYPE_DOUBLE));
+ /* Document-const: TYPE_SIZE_T
+ *
+ * C type - size_t
+ */
+ rb_define_const(mFiddle, "TYPE_SIZE_T", INT2NUM(TYPE_SIZE_T));
+
+ /* Document-const: TYPE_SSIZE_T
+ *
+ * C type - ssize_t
+ */
+ rb_define_const(mFiddle, "TYPE_SSIZE_T", INT2NUM(TYPE_SSIZE_T));
+
+ /* Document-const: TYPE_PTRDIFF_T
+ *
+ * C type - ptrdiff_t
+ */
+ rb_define_const(mFiddle, "TYPE_PTRDIFF_T", INT2NUM(TYPE_PTRDIFF_T));
+
+ /* Document-const: TYPE_INTPTR_T
+ *
+ * C type - intptr_t
+ */
+ rb_define_const(mFiddle, "TYPE_INTPTR_T", INT2NUM(TYPE_INTPTR_T));
+
+ /* Document-const: TYPE_UINTPTR_T
+ *
+ * C type - uintptr_t
+ */
+ rb_define_const(mFiddle, "TYPE_UINTPTR_T", INT2NUM(TYPE_UINTPTR_T));
+
+ /* Document-const: ALIGN_VOIDP
+ *
+ * The alignment size of a void*
+ */
+ rb_define_const(mFiddle, "ALIGN_VOIDP", INT2NUM(ALIGN_VOIDP));
+
+ /* Document-const: ALIGN_CHAR
+ *
+ * The alignment size of a char
+ */
+ rb_define_const(mFiddle, "ALIGN_CHAR", INT2NUM(ALIGN_CHAR));
+
+ /* Document-const: ALIGN_SHORT
+ *
+ * The alignment size of a short
+ */
+ rb_define_const(mFiddle, "ALIGN_SHORT", INT2NUM(ALIGN_SHORT));
+
+ /* Document-const: ALIGN_INT
+ *
+ * The alignment size of an int
+ */
+ rb_define_const(mFiddle, "ALIGN_INT", INT2NUM(ALIGN_INT));
+
+ /* Document-const: ALIGN_LONG
+ *
+ * The alignment size of a long
+ */
+ rb_define_const(mFiddle, "ALIGN_LONG", INT2NUM(ALIGN_LONG));
+
+#if HAVE_LONG_LONG
+ /* Document-const: ALIGN_LONG_LONG
+ *
+ * The alignment size of a long long
+ */
+ rb_define_const(mFiddle, "ALIGN_LONG_LONG", INT2NUM(ALIGN_LONG_LONG));
+#endif
+
+ /* Document-const: ALIGN_FLOAT
+ *
+ * The alignment size of a float
+ */
+ rb_define_const(mFiddle, "ALIGN_FLOAT", INT2NUM(ALIGN_FLOAT));
+
+ /* Document-const: ALIGN_DOUBLE
+ *
+ * The alignment size of a double
+ */
+ rb_define_const(mFiddle, "ALIGN_DOUBLE",INT2NUM(ALIGN_DOUBLE));
+
+ /* Document-const: ALIGN_SIZE_T
+ *
+ * The alignment size of a size_t
+ */
+ rb_define_const(mFiddle, "ALIGN_SIZE_T", INT2NUM(ALIGN_OF(size_t)));
+
+ /* Document-const: ALIGN_SSIZE_T
+ *
+ * The alignment size of a ssize_t
+ */
+ rb_define_const(mFiddle, "ALIGN_SSIZE_T", INT2NUM(ALIGN_OF(size_t))); /* same as size_t */
+
+ /* Document-const: ALIGN_PTRDIFF_T
+ *
+ * The alignment size of a ptrdiff_t
+ */
+ rb_define_const(mFiddle, "ALIGN_PTRDIFF_T", INT2NUM(ALIGN_OF(ptrdiff_t)));
+
+ /* Document-const: ALIGN_INTPTR_T
+ *
+ * The alignment size of a intptr_t
+ */
+ rb_define_const(mFiddle, "ALIGN_INTPTR_T", INT2NUM(ALIGN_OF(intptr_t)));
+
+ /* Document-const: ALIGN_UINTPTR_T
+ *
+ * The alignment size of a uintptr_t
+ */
+ rb_define_const(mFiddle, "ALIGN_UINTPTR_T", INT2NUM(ALIGN_OF(uintptr_t)));
+
+ /* Document-const: WINDOWS
+ *
+ * Returns a boolean regarding whether the host is WIN32
+ */
#if defined(_WIN32)
rb_define_const(mFiddle, "WINDOWS", Qtrue);
#else
rb_define_const(mFiddle, "WINDOWS", Qfalse);
#endif
+ /* Document-const: SIZEOF_VOIDP
+ *
+ * size of a void*
+ */
+ rb_define_const(mFiddle, "SIZEOF_VOIDP", INT2NUM(sizeof(void*)));
+
+ /* Document-const: SIZEOF_CHAR
+ *
+ * size of a char
+ */
+ rb_define_const(mFiddle, "SIZEOF_CHAR", INT2NUM(sizeof(char)));
+
+ /* Document-const: SIZEOF_SHORT
+ *
+ * size of a short
+ */
+ rb_define_const(mFiddle, "SIZEOF_SHORT", INT2NUM(sizeof(short)));
+
+ /* Document-const: SIZEOF_INT
+ *
+ * size of an int
+ */
+ rb_define_const(mFiddle, "SIZEOF_INT", INT2NUM(sizeof(int)));
+
+ /* Document-const: SIZEOF_LONG
+ *
+ * size of a long
+ */
+ rb_define_const(mFiddle, "SIZEOF_LONG", INT2NUM(sizeof(long)));
+
+#if HAVE_LONG_LONG
+ /* Document-const: SIZEOF_LONG_LONG
+ *
+ * size of a long long
+ */
+ rb_define_const(mFiddle, "SIZEOF_LONG_LONG", INT2NUM(sizeof(LONG_LONG)));
+#endif
+
+ /* Document-const: SIZEOF_FLOAT
+ *
+ * size of a float
+ */
+ rb_define_const(mFiddle, "SIZEOF_FLOAT", INT2NUM(sizeof(float)));
+
+ /* Document-const: SIZEOF_DOUBLE
+ *
+ * size of a double
+ */
+ rb_define_const(mFiddle, "SIZEOF_DOUBLE",INT2NUM(sizeof(double)));
+
+ /* Document-const: SIZEOF_SIZE_T
+ *
+ * size of a size_t
+ */
+ rb_define_const(mFiddle, "SIZEOF_SIZE_T", INT2NUM(sizeof(size_t)));
+
+ /* Document-const: SIZEOF_SSIZE_T
+ *
+ * size of a ssize_t
+ */
+ rb_define_const(mFiddle, "SIZEOF_SSIZE_T", INT2NUM(sizeof(size_t))); /* same as size_t */
+
+ /* Document-const: SIZEOF_PTRDIFF_T
+ *
+ * size of a ptrdiff_t
+ */
+ rb_define_const(mFiddle, "SIZEOF_PTRDIFF_T", INT2NUM(sizeof(ptrdiff_t)));
+
+ /* Document-const: SIZEOF_INTPTR_T
+ *
+ * size of a intptr_t
+ */
+ rb_define_const(mFiddle, "SIZEOF_INTPTR_T", INT2NUM(sizeof(intptr_t)));
+
+ /* Document-const: SIZEOF_UINTPTR_T
+ *
+ * size of a uintptr_t
+ */
+ rb_define_const(mFiddle, "SIZEOF_UINTPTR_T", INT2NUM(sizeof(uintptr_t)));
+
+ /* Document-const: RUBY_FREE
+ *
+ * Address of the ruby_xfree() function
+ */
+ rb_define_const(mFiddle, "RUBY_FREE", PTR2NUM(ruby_xfree));
+
+ /* Document-const: BUILD_RUBY_PLATFORM
+ *
+ * Platform built against (i.e. "x86_64-linux", etc.)
+ *
+ * See also RUBY_PLATFORM
+ */
+ rb_define_const(mFiddle, "BUILD_RUBY_PLATFORM", rb_str_new2(RUBY_PLATFORM));
+
+ rb_define_module_function(mFiddle, "dlwrap", rb_fiddle_value2ptr, 1);
+ rb_define_module_function(mFiddle, "dlunwrap", rb_fiddle_ptr2value, 1);
+ rb_define_module_function(mFiddle, "malloc", rb_fiddle_malloc, 1);
+ rb_define_module_function(mFiddle, "realloc", rb_fiddle_realloc, 2);
+ rb_define_module_function(mFiddle, "free", rb_fiddle_free, 1);
+
Init_fiddle_function();
Init_fiddle_closure();
+ Init_fiddle_handle();
+ Init_fiddle_pointer();
}
/* vim: set noet sws=4 sw=4: */
diff --git a/ext/fiddle/fiddle.h b/ext/fiddle/fiddle.h
index 7165969225..b37c37bc65 100644
--- a/ext/fiddle/fiddle.h
+++ b/ext/fiddle/fiddle.h
@@ -12,6 +12,30 @@
#include <sys/mman.h>
#endif
+#if defined(HAVE_DLFCN_H)
+# include <dlfcn.h>
+# /* some stranger systems may not define all of these */
+#ifndef RTLD_LAZY
+#define RTLD_LAZY 0
+#endif
+#ifndef RTLD_GLOBAL
+#define RTLD_GLOBAL 0
+#endif
+#ifndef RTLD_NOW
+#define RTLD_NOW 0
+#endif
+#else
+# if defined(_WIN32)
+# include <windows.h>
+# define dlopen(name,flag) ((void*)LoadLibrary(name))
+# define dlerror() strerror(rb_w32_map_errno(GetLastError()))
+# define dlsym(handle,name) ((void*)GetProcAddress((handle),(name)))
+# define RTLD_LAZY -1
+# define RTLD_NOW -1
+# define RTLD_GLOBAL -1
+# endif
+#endif
+
#ifdef USE_HEADER_HACKS
#include <ffi/ffi.h>
#else
@@ -67,6 +91,15 @@
# error "long size not supported"
# endif
+#if HAVE_LONG_LONG
+# if SIZEOF_LONG_LONG == 8
+# define ffi_type_slong_long ffi_type_sint64
+# define ffi_type_ulong_long ffi_type_uint64
+# else
+# error "long long size not supported"
+# endif
+#endif
+
#include <closure.h>
#include <conversions.h>
#include <function.h>
@@ -88,7 +121,23 @@
#define TYPE_FLOAT 7
#define TYPE_DOUBLE 8
+#define ALIGN_OF(type) offsetof(struct {char align_c; type align_x;}, align_x)
+
+#define ALIGN_VOIDP ALIGN_OF(void*)
+#define ALIGN_SHORT ALIGN_OF(short)
+#define ALIGN_CHAR ALIGN_OF(char)
+#define ALIGN_INT ALIGN_OF(int)
+#define ALIGN_LONG ALIGN_OF(long)
+#if HAVE_LONG_LONG
+#define ALIGN_LONG_LONG ALIGN_OF(LONG_LONG)
+#endif
+#define ALIGN_FLOAT ALIGN_OF(float)
+#define ALIGN_DOUBLE ALIGN_OF(double)
+
extern VALUE mFiddle;
+extern VALUE rb_eFiddleError;
+
+VALUE rb_fiddle_new_function(VALUE address, VALUE arg_types, VALUE ret_type);
#endif
/* vim: set noet sws=4 sw=4: */
diff --git a/ext/fiddle/function.c b/ext/fiddle/function.c
index 911c9b80fc..38012bfcbd 100644
--- a/ext/fiddle/function.c
+++ b/ext/fiddle/function.c
@@ -38,6 +38,18 @@ allocate(VALUE klass)
return TypedData_Make_Struct(klass, ffi_cif, &function_data_type, cif);
}
+VALUE
+rb_fiddle_new_function(VALUE address, VALUE arg_types, VALUE ret_type)
+{
+ VALUE argv[3];
+
+ argv[0] = address;
+ argv[1] = arg_types;
+ argv[2] = ret_type;
+
+ return rb_class_new_instance(3, argv, cFiddleFunction);
+}
+
static VALUE
initialize(int argc, VALUE argv[], VALUE self)
{
@@ -138,17 +150,83 @@ function_call(int argc, VALUE argv[], VALUE self)
void
Init_fiddle_function(void)
{
+ /*
+ * Document-class: Fiddle::Function
+ *
+ * == Description
+ *
+ * A representation of a C function
+ *
+ * == Examples
+ *
+ * === 'strcpy'
+ *
+ * @libc = Fiddle.dlopen "/lib/libc.so.6"
+ * #=> #<Fiddle::Handle:0x00000001d7a8d8>
+ * f = Fiddle::Function.new(
+ * @libc['strcpy'],
+ * [Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP],
+ * Fiddle::TYPE_VOIDP)
+ * #=> #<Fiddle::Function:0x00000001d8ee00>
+ * buff = "000"
+ * #=> "000"
+ * str = f.call(buff, "123")
+ * #=> #<Fiddle::Pointer:0x00000001d0c380 ptr=0x000000018a21b8 size=0 free=0x00000000000000>
+ * str.to_s
+ * => "123"
+ *
+ * === ABI check
+ *
+ * @libc = DL.dlopen "/lib/libc.so.6"
+ * #=> #<Fiddle::Handle:0x00000001d7a8d8>
+ * f = Fiddle::Function.new(@libc['strcpy'], [TYPE_VOIDP, TYPE_VOIDP], TYPE_VOIDP)
+ * #=> #<Fiddle::Function:0x00000001d8ee00>
+ * f.abi == Fiddle::Function::DEFAULT
+ * #=> true
+ */
cFiddleFunction = rb_define_class_under(mFiddle, "Function", rb_cObject);
+ /*
+ * Document-const: DEFAULT
+ *
+ * Default ABI
+ *
+ */
rb_define_const(cFiddleFunction, "DEFAULT", INT2NUM(FFI_DEFAULT_ABI));
-#ifdef FFI_STDCALL
+#ifdef HAVE_CONST_FFI_STDCALL
+ /*
+ * Document-const: STDCALL
+ *
+ * FFI implementation of WIN32 stdcall convention
+ *
+ */
rb_define_const(cFiddleFunction, "STDCALL", INT2NUM(FFI_STDCALL));
#endif
rb_define_alloc_func(cFiddleFunction, allocate);
+ /*
+ * Document-method: call
+ *
+ * Calls the constructed Function, with +args+
+ *
+ * For an example see Fiddle::Function
+ *
+ */
rb_define_method(cFiddleFunction, "call", function_call, -1);
+
+ /*
+ * Document-method: new
+ * call-seq: new(ptr, *args, ret_type, abi = DEFAULT)
+ *
+ * Constructs a Function object.
+ * * +ptr+ is a referenced function, of a Fiddle::Handle
+ * * +args+ is an Array of arguments, passed to the +ptr+ function
+ * * +ret_type+ is the return type of the function
+ * * +abi+ is the ABI of the function
+ *
+ */
rb_define_method(cFiddleFunction, "initialize", initialize, -1);
}
/* vim: set noet sws=4 sw=4: */
diff --git a/ext/fiddle/handle.c b/ext/fiddle/handle.c
new file mode 100644
index 0000000000..832ff3319a
--- /dev/null
+++ b/ext/fiddle/handle.c
@@ -0,0 +1,469 @@
+#include <ruby.h>
+#include <fiddle.h>
+
+VALUE rb_cHandle;
+
+struct dl_handle {
+ void *ptr;
+ int open;
+ int enable_close;
+};
+
+#ifdef _WIN32
+# ifndef _WIN32_WCE
+static void *
+w32_coredll(void)
+{
+ MEMORY_BASIC_INFORMATION m;
+ memset(&m, 0, sizeof(m));
+ if( !VirtualQuery(_errno, &m, sizeof(m)) ) return NULL;
+ return m.AllocationBase;
+}
+# endif
+
+static int
+w32_dlclose(void *ptr)
+{
+# ifndef _WIN32_WCE
+ if( ptr == w32_coredll() ) return 0;
+# endif
+ if( FreeLibrary((HMODULE)ptr) ) return 0;
+ return errno = rb_w32_map_errno(GetLastError());
+}
+#define dlclose(ptr) w32_dlclose(ptr)
+#endif
+
+static void
+fiddle_handle_free(void *ptr)
+{
+ struct dl_handle *fiddle_handle = ptr;
+ if( fiddle_handle->ptr && fiddle_handle->open && fiddle_handle->enable_close ){
+ dlclose(fiddle_handle->ptr);
+ }
+}
+
+static size_t
+fiddle_handle_memsize(const void *ptr)
+{
+ return ptr ? sizeof(struct dl_handle) : 0;
+}
+
+static const rb_data_type_t fiddle_handle_data_type = {
+ "fiddle/handle",
+ {0, fiddle_handle_free, fiddle_handle_memsize,},
+};
+
+/*
+ * call-seq: close
+ *
+ * Close this handle.
+ *
+ * Calling close more than once will raise a Fiddle::DLError exception.
+ */
+static VALUE
+rb_fiddle_handle_close(VALUE self)
+{
+ struct dl_handle *fiddle_handle;
+
+ TypedData_Get_Struct(self, struct dl_handle, &fiddle_handle_data_type, fiddle_handle);
+ if(fiddle_handle->open) {
+ int ret = dlclose(fiddle_handle->ptr);
+ fiddle_handle->open = 0;
+
+ /* Check dlclose for successful return value */
+ if(ret) {
+#if defined(HAVE_DLERROR)
+ rb_raise(rb_eFiddleError, "%s", dlerror());
+#else
+ rb_raise(rb_eFiddleError, "could not close handle");
+#endif
+ }
+ return INT2NUM(ret);
+ }
+ rb_raise(rb_eFiddleError, "dlclose() called too many times");
+
+ UNREACHABLE;
+}
+
+static VALUE
+rb_fiddle_handle_s_allocate(VALUE klass)
+{
+ VALUE obj;
+ struct dl_handle *fiddle_handle;
+
+ obj = TypedData_Make_Struct(rb_cHandle, struct dl_handle, &fiddle_handle_data_type, fiddle_handle);
+ fiddle_handle->ptr = 0;
+ fiddle_handle->open = 0;
+ fiddle_handle->enable_close = 0;
+
+ return obj;
+}
+
+static VALUE
+predefined_fiddle_handle(void *handle)
+{
+ VALUE obj = rb_fiddle_handle_s_allocate(rb_cHandle);
+ struct dl_handle *fiddle_handle = DATA_PTR(obj);
+
+ fiddle_handle->ptr = handle;
+ fiddle_handle->open = 1;
+ OBJ_FREEZE(obj);
+ return obj;
+}
+
+/*
+ * call-seq:
+ * new(lib = nil, flags = Fiddle::RTLD_LAZY | Fiddle::RTLD_GLOBAL)
+ *
+ * Create a new handler that opens library named +lib+ with +flags+. If no
+ * library is specified, RTLD_DEFAULT is used.
+ */
+static VALUE
+rb_fiddle_handle_initialize(int argc, VALUE argv[], VALUE self)
+{
+ void *ptr;
+ struct dl_handle *fiddle_handle;
+ VALUE lib, flag;
+ char *clib;
+ int cflag;
+ const char *err;
+
+ switch( rb_scan_args(argc, argv, "02", &lib, &flag) ){
+ case 0:
+ clib = NULL;
+ cflag = RTLD_LAZY | RTLD_GLOBAL;
+ break;
+ case 1:
+ clib = NIL_P(lib) ? NULL : StringValuePtr(lib);
+ cflag = RTLD_LAZY | RTLD_GLOBAL;
+ break;
+ case 2:
+ clib = NIL_P(lib) ? NULL : StringValuePtr(lib);
+ cflag = NUM2INT(flag);
+ break;
+ default:
+ rb_bug("rb_fiddle_handle_new");
+ }
+
+ rb_secure(2);
+
+#if defined(_WIN32)
+ if( !clib ){
+ HANDLE rb_libruby_handle(void);
+ ptr = rb_libruby_handle();
+ }
+ else if( STRCASECMP(clib, "libc") == 0
+# ifdef RUBY_COREDLL
+ || STRCASECMP(clib, RUBY_COREDLL) == 0
+ || STRCASECMP(clib, RUBY_COREDLL".dll") == 0
+# endif
+ ){
+# ifdef _WIN32_WCE
+ ptr = dlopen("coredll.dll", cflag);
+# else
+ ptr = w32_coredll();
+# endif
+ }
+ else
+#endif
+ ptr = dlopen(clib, cflag);
+#if defined(HAVE_DLERROR)
+ if( !ptr && (err = dlerror()) ){
+ rb_raise(rb_eFiddleError, "%s", err);
+ }
+#else
+ if( !ptr ){
+ err = dlerror();
+ rb_raise(rb_eFiddleError, "%s", err);
+ }
+#endif
+ TypedData_Get_Struct(self, struct dl_handle, &fiddle_handle_data_type, fiddle_handle);
+ if( fiddle_handle->ptr && fiddle_handle->open && fiddle_handle->enable_close ){
+ dlclose(fiddle_handle->ptr);
+ }
+ fiddle_handle->ptr = ptr;
+ fiddle_handle->open = 1;
+ fiddle_handle->enable_close = 0;
+
+ if( rb_block_given_p() ){
+ rb_ensure(rb_yield, self, rb_fiddle_handle_close, self);
+ }
+
+ return Qnil;
+}
+
+/*
+ * call-seq: enable_close
+ *
+ * Enable a call to dlclose() when this handle is garbage collected.
+ */
+static VALUE
+rb_fiddle_handle_enable_close(VALUE self)
+{
+ struct dl_handle *fiddle_handle;
+
+ TypedData_Get_Struct(self, struct dl_handle, &fiddle_handle_data_type, fiddle_handle);
+ fiddle_handle->enable_close = 1;
+ return Qnil;
+}
+
+/*
+ * call-seq: disable_close
+ *
+ * Disable a call to dlclose() when this handle is garbage collected.
+ */
+static VALUE
+rb_fiddle_handle_disable_close(VALUE self)
+{
+ struct dl_handle *fiddle_handle;
+
+ TypedData_Get_Struct(self, struct dl_handle, &fiddle_handle_data_type, fiddle_handle);
+ fiddle_handle->enable_close = 0;
+ return Qnil;
+}
+
+/*
+ * call-seq: close_enabled?
+ *
+ * Returns +true+ if dlclose() will be called when this handle is garbage collected.
+ *
+ * See man(3) dlclose() for more info.
+ */
+static VALUE
+rb_fiddle_handle_close_enabled_p(VALUE self)
+{
+ struct dl_handle *fiddle_handle;
+
+ TypedData_Get_Struct(self, struct dl_handle, &fiddle_handle_data_type, fiddle_handle);
+
+ if(fiddle_handle->enable_close) return Qtrue;
+ return Qfalse;
+}
+
+/*
+ * call-seq: to_i
+ *
+ * Returns the memory address for this handle.
+ */
+static VALUE
+rb_fiddle_handle_to_i(VALUE self)
+{
+ struct dl_handle *fiddle_handle;
+
+ TypedData_Get_Struct(self, struct dl_handle, &fiddle_handle_data_type, fiddle_handle);
+ return PTR2NUM(fiddle_handle);
+}
+
+static VALUE fiddle_handle_sym(void *handle, const char *symbol);
+
+/*
+ * Document-method: sym
+ *
+ * call-seq: sym(name)
+ *
+ * Get the address as an Integer for the function named +name+.
+ */
+static VALUE
+rb_fiddle_handle_sym(VALUE self, VALUE sym)
+{
+ struct dl_handle *fiddle_handle;
+
+ TypedData_Get_Struct(self, struct dl_handle, &fiddle_handle_data_type, fiddle_handle);
+ if( ! fiddle_handle->open ){
+ rb_raise(rb_eFiddleError, "closed handle");
+ }
+
+ return fiddle_handle_sym(fiddle_handle->ptr, StringValueCStr(sym));
+}
+
+#ifndef RTLD_NEXT
+#define RTLD_NEXT NULL
+#endif
+#ifndef RTLD_DEFAULT
+#define RTLD_DEFAULT NULL
+#endif
+
+/*
+ * Document-method: sym
+ *
+ * call-seq: sym(name)
+ *
+ * Get the address as an Integer for the function named +name+. The function
+ * is searched via dlsym on RTLD_NEXT.
+ *
+ * See man(3) dlsym() for more info.
+ */
+static VALUE
+rb_fiddle_handle_s_sym(VALUE self, VALUE sym)
+{
+ return fiddle_handle_sym(RTLD_NEXT, StringValueCStr(sym));
+}
+
+static VALUE
+fiddle_handle_sym(void *handle, const char *name)
+{
+#if defined(HAVE_DLERROR)
+ const char *err;
+# define CHECK_DLERROR if( err = dlerror() ){ func = 0; }
+#else
+# define CHECK_DLERROR
+#endif
+ void (*func)();
+
+ rb_secure(2);
+#ifdef HAVE_DLERROR
+ dlerror();
+#endif
+ func = (void (*)())(VALUE)dlsym(handle, name);
+ CHECK_DLERROR;
+#if defined(FUNC_STDCALL)
+ if( !func ){
+ int i;
+ int len = (int)strlen(name);
+ char *name_n;
+#if defined(__CYGWIN__) || defined(_WIN32) || defined(__MINGW32__)
+ {
+ char *name_a = (char*)xmalloc(len+2);
+ strcpy(name_a, name);
+ name_n = name_a;
+ name_a[len] = 'A';
+ name_a[len+1] = '\0';
+ func = dlsym(handle, name_a);
+ CHECK_DLERROR;
+ if( func ) goto found;
+ name_n = xrealloc(name_a, len+6);
+ }
+#else
+ name_n = (char*)xmalloc(len+6);
+#endif
+ memcpy(name_n, name, len);
+ name_n[len++] = '@';
+ for( i = 0; i < 256; i += 4 ){
+ sprintf(name_n + len, "%d", i);
+ func = dlsym(handle, name_n);
+ CHECK_DLERROR;
+ if( func ) break;
+ }
+ if( func ) goto found;
+ name_n[len-1] = 'A';
+ name_n[len++] = '@';
+ for( i = 0; i < 256; i += 4 ){
+ sprintf(name_n + len, "%d", i);
+ func = dlsym(handle, name_n);
+ CHECK_DLERROR;
+ if( func ) break;
+ }
+ found:
+ xfree(name_n);
+ }
+#endif
+ if( !func ){
+ rb_raise(rb_eFiddleError, "unknown symbol \"%s\"", name);
+ }
+
+ return PTR2NUM(func);
+}
+
+void
+Init_fiddle_handle(void)
+{
+ /*
+ * Document-class: Fiddle::Handle
+ *
+ * The Fiddle::Handle is the manner to access the dynamic library
+ *
+ * == Example
+ *
+ * === Setup
+ *
+ * libc_so = "/lib64/libc.so.6"
+ * => "/lib64/libc.so.6"
+ * @handle = Fiddle::Handle.new(libc_so)
+ * => #<Fiddle::Handle:0x00000000d69ef8>
+ *
+ * === Setup, with flags
+ *
+ * libc_so = "/lib64/libc.so.6"
+ * => "/lib64/libc.so.6"
+ * @handle = Fiddle::Handle.new(libc_so, Fiddle::RTLD_LAZY | Fiddle::RTLD_GLOBAL)
+ * => #<Fiddle::Handle:0x00000000d69ef8>
+ *
+ * See RTLD_LAZY and RTLD_GLOBAL
+ *
+ * === Addresses to symbols
+ *
+ * strcpy_addr = @handle['strcpy']
+ * => 140062278451968
+ *
+ * or
+ *
+ * strcpy_addr = @handle.sym('strcpy')
+ * => 140062278451968
+ *
+ */
+ rb_cHandle = rb_define_class_under(mFiddle, "Handle", rb_cObject);
+ rb_define_alloc_func(rb_cHandle, rb_fiddle_handle_s_allocate);
+ rb_define_singleton_method(rb_cHandle, "sym", rb_fiddle_handle_s_sym, 1);
+ rb_define_singleton_method(rb_cHandle, "[]", rb_fiddle_handle_s_sym, 1);
+
+ /* Document-const: NEXT
+ *
+ * A predefined pseudo-handle of RTLD_NEXT
+ *
+ * Which will find the next occurrence of a function in the search order
+ * after the current library.
+ */
+ rb_define_const(rb_cHandle, "NEXT", predefined_fiddle_handle(RTLD_NEXT));
+
+ /* Document-const: DEFAULT
+ *
+ * A predefined pseudo-handle of RTLD_DEFAULT
+ *
+ * Which will find the first occurrence of the desired symbol using the
+ * default library search order
+ */
+ rb_define_const(rb_cHandle, "DEFAULT", predefined_fiddle_handle(RTLD_DEFAULT));
+
+ /* Document-const: RTLD_GLOBAL
+ *
+ * rtld Fiddle::Handle flag.
+ *
+ * The symbols defined by this library will be made available for symbol
+ * resolution of subsequently loaded libraries.
+ */
+ rb_define_const(rb_cHandle, "RTLD_GLOBAL", INT2NUM(RTLD_GLOBAL));
+
+ /* Document-const: RTLD_LAZY
+ *
+ * rtld Fiddle::Handle flag.
+ *
+ * Perform lazy binding. Only resolve symbols as the code that references
+ * them is executed. If the symbol is never referenced, then it is never
+ * resolved. (Lazy binding is only performed for function references;
+ * references to variables are always immediately bound when the library
+ * is loaded.)
+ */
+ rb_define_const(rb_cHandle, "RTLD_LAZY", INT2NUM(RTLD_LAZY));
+
+ /* Document-const: RTLD_NOW
+ *
+ * rtld Fiddle::Handle flag.
+ *
+ * If this value is specified or the environment variable LD_BIND_NOW is
+ * set to a nonempty string, all undefined symbols in the library are
+ * resolved before Fiddle.dlopen returns. If this cannot be done an error
+ * is returned.
+ */
+ rb_define_const(rb_cHandle, "RTLD_NOW", INT2NUM(RTLD_NOW));
+
+ rb_define_method(rb_cHandle, "initialize", rb_fiddle_handle_initialize, -1);
+ rb_define_method(rb_cHandle, "to_i", rb_fiddle_handle_to_i, 0);
+ rb_define_method(rb_cHandle, "close", rb_fiddle_handle_close, 0);
+ rb_define_method(rb_cHandle, "sym", rb_fiddle_handle_sym, 1);
+ rb_define_method(rb_cHandle, "[]", rb_fiddle_handle_sym, 1);
+ rb_define_method(rb_cHandle, "disable_close", rb_fiddle_handle_disable_close, 0);
+ rb_define_method(rb_cHandle, "enable_close", rb_fiddle_handle_enable_close, 0);
+ rb_define_method(rb_cHandle, "close_enabled?", rb_fiddle_handle_close_enabled_p, 0);
+}
+
+/* vim: set noet sws=4 sw=4: */
diff --git a/ext/fiddle/lib/fiddle.rb b/ext/fiddle/lib/fiddle.rb
index 8b8c069b03..c8a7ef1b05 100644
--- a/ext/fiddle/lib/fiddle.rb
+++ b/ext/fiddle/lib/fiddle.rb
@@ -1,27 +1,46 @@
require 'fiddle.so'
require 'fiddle/function'
require 'fiddle/closure'
-require 'dl' unless Object.const_defined?(:DL)
module Fiddle
- Pointer = DL::CPtr
-
if WINDOWS
+ # Returns the last win32 +Error+ of the current executing +Thread+ or nil
+ # if none
def self.win32_last_error
Thread.current[:__FIDDLE_WIN32_LAST_ERROR__]
end
+ # Sets the last win32 +Error+ of the current executing +Thread+ to +error+
def self.win32_last_error= error
Thread.current[:__FIDDLE_WIN32_LAST_ERROR__] = error
end
end
+ # Returns the last +Error+ of the current executing +Thread+ or nil if none
def self.last_error
Thread.current[:__FIDDLE_LAST_ERROR__]
end
+ # Sets the last +Error+ of the current executing +Thread+ to +error+
def self.last_error= error
Thread.current[:__DL2_LAST_ERROR__] = error
Thread.current[:__FIDDLE_LAST_ERROR__] = error
end
+
+ # call-seq: dlopen(library) => Fiddle::Handle
+ #
+ # Creates a new handler that opens +library+, and returns an instance of
+ # Fiddle::Handle.
+ #
+ # See Fiddle::Handle.new for more.
+ def dlopen library
+ Fiddle::Handle.new library
+ end
+ module_function :dlopen
+
+ # Add constants for backwards compat
+
+ RTLD_GLOBAL = Handle::RTLD_GLOBAL # :nodoc:
+ RTLD_LAZY = Handle::RTLD_LAZY # :nodoc:
+ RTLD_NOW = Handle::RTLD_NOW # :nodoc:
end
diff --git a/ext/fiddle/lib/fiddle/closure.rb b/ext/fiddle/lib/fiddle/closure.rb
index dc2b7a65be..beb90ecbe5 100644
--- a/ext/fiddle/lib/fiddle/closure.rb
+++ b/ext/fiddle/lib/fiddle/closure.rb
@@ -1,14 +1,45 @@
module Fiddle
class Closure
+
+ # the C type of the return of the FFI closure
attr_reader :ctype
+
+ # arguments of the FFI closure
attr_reader :args
+ # Extends Fiddle::Closure to allow for building the closure in a block
class BlockCaller < Fiddle::Closure
+
+ # == Description
+ #
+ # Construct a new BlockCaller object.
+ #
+ # * +ctype+ is the C type to be returned
+ # * +args+ are passed the callback
+ # * +abi+ is the abi of the closure
+ #
+ # If there is an error in preparing the +ffi_cif+ or +ffi_prep_closure+,
+ # then a RuntimeError will be raised.
+ #
+ # == Example
+ #
+ # include Fiddle
+ #
+ # cb = Closure::BlockCaller.new(TYPE_INT, [TYPE_INT]) do |one|
+ # one
+ # end
+ #
+ # func = Function.new(cb, [TYPE_INT], TYPE_INT)
+ #
def initialize ctype, args, abi = Fiddle::Function::DEFAULT, &block
super(ctype, args, abi)
@block = block
end
+ # Calls the constructed BlockCaller, with +args+
+ #
+ # For an example see Fiddle::Closure::BlockCaller.new
+ #
def call *args
@block.call(*args)
end
diff --git a/ext/fiddle/lib/fiddle/cparser.rb b/ext/fiddle/lib/fiddle/cparser.rb
new file mode 100644
index 0000000000..43fb184a12
--- /dev/null
+++ b/ext/fiddle/lib/fiddle/cparser.rb
@@ -0,0 +1,176 @@
+module Fiddle
+ # A mixin that provides methods for parsing C struct and prototype signatures.
+ #
+ # == Example
+ # require 'fiddle/import'
+ #
+ # include Fiddle::CParser
+ # #=> Object
+ #
+ # parse_ctype('int increment(int)')
+ # #=> ["increment", Fiddle::TYPE_INT, [Fiddle::TYPE_INT]]
+ #
+ module CParser
+ # Parses a C struct's members
+ #
+ # Example:
+ #
+ # include Fiddle::CParser
+ # #=> Object
+ #
+ # parse_struct_signature(['int i', 'char c'])
+ # #=> [[Fiddle::TYPE_INT, Fiddle::TYPE_CHAR], ["i", "c"]]
+ #
+ def parse_struct_signature(signature, tymap=nil)
+ if( signature.is_a?(String) )
+ signature = signature.split(/\s*,\s*/)
+ end
+ mems = []
+ tys = []
+ signature.each{|msig|
+ tks = msig.split(/\s+(\*)?/)
+ ty = tks[0..-2].join(" ")
+ member = tks[-1]
+
+ case ty
+ when /\[(\d+)\]/
+ n = $1.to_i
+ ty.gsub!(/\s*\[\d+\]/,"")
+ ty = [ty, n]
+ when /\[\]/
+ ty.gsub!(/\s*\[\]/, "*")
+ end
+
+ case member
+ when /\[(\d+)\]/
+ ty = [ty, $1.to_i]
+ member.gsub!(/\s*\[\d+\]/,"")
+ when /\[\]/
+ ty = ty + "*"
+ member.gsub!(/\s*\[\]/, "")
+ end
+
+ mems.push(member)
+ tys.push(parse_ctype(ty,tymap))
+ }
+ return tys, mems
+ end
+
+ # Parses a C prototype signature
+ #
+ # If Hash +tymap+ is provided, the return value and the arguments from the
+ # +signature+ are expected to be keys, and the value will be the C type to
+ # be looked up.
+ #
+ # Example:
+ #
+ # include Fiddle::CParser
+ # #=> Object
+ #
+ # parse_signature('double sum(double, double)')
+ # #=> ["sum", Fiddle::TYPE_DOUBLE, [Fiddle::TYPE_DOUBLE, Fiddle::TYPE_DOUBLE]]
+ #
+ def parse_signature(signature, tymap=nil)
+ tymap ||= {}
+ signature = signature.gsub(/\s+/, " ").strip
+ case signature
+ when /^([\w@\*\s]+)\(([\w\*\s\,\[\]]*)\)$/
+ ret = $1
+ (args = $2).strip!
+ ret = ret.split(/\s+/)
+ args = args.split(/\s*,\s*/)
+ func = ret.pop
+ if( func =~ /^\*/ )
+ func.gsub!(/^\*+/,"")
+ ret.push("*")
+ end
+ ret = ret.join(" ")
+ return [func, parse_ctype(ret, tymap), args.collect{|arg| parse_ctype(arg, tymap)}]
+ else
+ raise(RuntimeError,"can't parse the function prototype: #{signature}")
+ end
+ end
+
+ # Given a String of C type +ty+, returns the corresponding Fiddle constant.
+ #
+ # +ty+ can also accept an Array of C type Strings, and will be returned in
+ # a corresponding Array.
+ #
+ # If Hash +tymap+ is provided, +ty+ is expected to be the key, and the
+ # value will be the C type to be looked up.
+ #
+ # Example:
+ #
+ # include Fiddle::CParser
+ # #=> Object
+ #
+ # parse_ctype('int')
+ # #=> Fiddle::TYPE_INT
+ #
+ # parse_ctype('double')
+ # #=> Fiddle::TYPE_DOUBLE
+ #
+ # parse_ctype('unsigned char')
+ # #=> -Fiddle::TYPE_CHAR
+ #
+ def parse_ctype(ty, tymap=nil)
+ tymap ||= {}
+ case ty
+ when Array
+ return [parse_ctype(ty[0], tymap), ty[1]]
+ when "void"
+ return TYPE_VOID
+ when "char"
+ return TYPE_CHAR
+ when "unsigned char"
+ return -TYPE_CHAR
+ when "short"
+ return TYPE_SHORT
+ when "unsigned short"
+ return -TYPE_SHORT
+ when "int"
+ return TYPE_INT
+ when "unsigned int", 'uint'
+ return -TYPE_INT
+ when "long"
+ return TYPE_LONG
+ when "unsigned long"
+ return -TYPE_LONG
+ when "long long"
+ if( defined?(TYPE_LONG_LONG) )
+ return TYPE_LONG_LONG
+ else
+ raise(RuntimeError, "unsupported type: #{ty}")
+ end
+ when "unsigned long long"
+ if( defined?(TYPE_LONG_LONG) )
+ return -TYPE_LONG_LONG
+ else
+ raise(RuntimeError, "unsupported type: #{ty}")
+ end
+ when "float"
+ return TYPE_FLOAT
+ when "double"
+ return TYPE_DOUBLE
+ when "size_t"
+ return TYPE_SIZE_T
+ when "ssize_t"
+ return TYPE_SSIZE_T
+ when "ptrdiff_t"
+ return TYPE_PTRDIFF_T
+ when "intptr_t"
+ return TYPE_INTPTR_T
+ when "uintptr_t"
+ return TYPE_UINTPTR_T
+ when /\*/, /\[\s*\]/
+ return TYPE_VOIDP
+ else
+ if( tymap[ty] )
+ return parse_ctype(tymap[ty], tymap)
+ else
+ raise(DLError, "unknown type: #{ty}")
+ end
+ end
+ end
+ end
+end
diff --git a/ext/fiddle/lib/fiddle/function.rb b/ext/fiddle/lib/fiddle/function.rb
index 7b9e735874..07a072e021 100644
--- a/ext/fiddle/lib/fiddle/function.rb
+++ b/ext/fiddle/lib/fiddle/function.rb
@@ -1,5 +1,14 @@
module Fiddle
class Function
+ # The ABI of the Function.
attr_reader :abi
+
+ # The address of this function
+ attr_reader :ptr
+
+ # The integer memory location of this function
+ def to_i
+ ptr.to_i
+ end
end
end
diff --git a/ext/fiddle/lib/fiddle/import.rb b/ext/fiddle/lib/fiddle/import.rb
new file mode 100644
index 0000000000..ba0f716a9a
--- /dev/null
+++ b/ext/fiddle/lib/fiddle/import.rb
@@ -0,0 +1,302 @@
+require 'fiddle'
+require 'fiddle/struct'
+require 'fiddle/cparser'
+
+module Fiddle
+
+ # Used internally by Fiddle::Importer
+ class CompositeHandler
+ # Create a new handler with the open +handlers+
+ #
+ # Used internally by Fiddle::Importer.dlload
+ def initialize(handlers)
+ @handlers = handlers
+ end
+
+ # Array of the currently loaded libraries.
+ def handlers()
+ @handlers
+ end
+
+ # Returns the address as an Integer from any handlers with the function
+ # named +symbol+.
+ #
+ # Raises a DLError if the handle is closed.
+ def sym(symbol)
+ @handlers.each{|handle|
+ if( handle )
+ begin
+ addr = handle.sym(symbol)
+ return addr
+ rescue DLError
+ end
+ end
+ }
+ return nil
+ end
+
+ # See Fiddle::CompositeHandler.sym
+ def [](symbol)
+ sym(symbol)
+ end
+ end
+
+ # A DSL that provides the means to dynamically load libraries and build
+ # modules around them including calling extern functions within the C
+ # library that has been loaded.
+ #
+ # == Example
+ #
+ # require 'fiddle'
+ # require 'fiddle/import'
+ #
+ # module LibSum
+ # extend Fiddle::Importer
+ # dlload './libsum.so'
+ # extern 'double sum(double*, int)'
+ # extern 'double split(double)'
+ # end
+ #
+ module Importer
+ include Fiddle
+ include CParser
+ extend Importer
+
+ # Creates an array of handlers for the given +libs+, can be an instance of
+ # Fiddle::Handle, Fiddle::Importer, or will create a new istance of
+ # Fiddle::Handle using Fiddle.dlopen
+ #
+ # Raises a DLError if the library cannot be loaded.
+ #
+ # See Fiddle.dlopen
+ def dlload(*libs)
+ handles = libs.collect{|lib|
+ case lib
+ when nil
+ nil
+ when Handle
+ lib
+ when Importer
+ lib.handlers
+ else
+ begin
+ Fiddle.dlopen(lib)
+ rescue DLError
+ raise(DLError, "can't load #{lib}")
+ end
+ end
+ }.flatten()
+ @handler = CompositeHandler.new(handles)
+ @func_map = {}
+ @type_alias = {}
+ end
+
+ # Sets the type alias for +alias_type+ as +orig_type+
+ def typealias(alias_type, orig_type)
+ @type_alias[alias_type] = orig_type
+ end
+
+ # Returns the sizeof +ty+, using Fiddle::Importer.parse_ctype to determine
+ # the C type and the appropriate Fiddle constant.
+ def sizeof(ty)
+ case ty
+ when String
+ ty = parse_ctype(ty, @type_alias).abs()
+ case ty
+ when TYPE_CHAR
+ return SIZEOF_CHAR
+ when TYPE_SHORT
+ return SIZEOF_SHORT
+ when TYPE_INT
+ return SIZEOF_INT
+ when TYPE_LONG
+ return SIZEOF_LONG
+ when TYPE_LONG_LONG
+ return SIZEOF_LONG_LON
+ when TYPE_FLOAT
+ return SIZEOF_FLOAT
+ when TYPE_DOUBLE
+ return SIZEOF_DOUBLE
+ when TYPE_VOIDP
+ return SIZEOF_VOIDP
+ else
+ raise(DLError, "unknown type: #{ty}")
+ end
+ when Class
+ if( ty.instance_methods().include?(:to_ptr) )
+ return ty.size()
+ end
+ end
+ return CPtr[ty].size()
+ end
+
+ def parse_bind_options(opts)
+ h = {}
+ while( opt = opts.shift() )
+ case opt
+ when :stdcall, :cdecl
+ h[:call_type] = opt
+ when :carried, :temp, :temporal, :bind
+ h[:callback_type] = opt
+ h[:carrier] = opts.shift()
+ else
+ h[opt] = true
+ end
+ end
+ h
+ end
+ private :parse_bind_options
+
+ # Creates a global method from the given C +signature+.
+ def extern(signature, *opts)
+ symname, ctype, argtype = parse_signature(signature, @type_alias)
+ opt = parse_bind_options(opts)
+ f = import_function(symname, ctype, argtype, opt[:call_type])
+ name = symname.gsub(/@.+/,'')
+ @func_map[name] = f
+ # define_method(name){|*args,&block| f.call(*args,&block)}
+ begin
+ /^(.+?):(\d+)/ =~ caller.first
+ file, line = $1, $2.to_i
+ rescue
+ file, line = __FILE__, __LINE__+3
+ end
+ module_eval(<<-EOS, file, line)
+ def #{name}(*args, &block)
+ @func_map['#{name}'].call(*args,&block)
+ end
+ EOS
+ module_function(name)
+ f
+ end
+
+ # Creates a global method from the given C +signature+ using the given
+ # +opts+ as bind parameters with the given block.
+ def bind(signature, *opts, &blk)
+ name, ctype, argtype = parse_signature(signature, @type_alias)
+ h = parse_bind_options(opts)
+ case h[:callback_type]
+ when :bind, nil
+ f = bind_function(name, ctype, argtype, h[:call_type], &blk)
+ else
+ raise(RuntimeError, "unknown callback type: #{h[:callback_type]}")
+ end
+ @func_map[name] = f
+ #define_method(name){|*args,&block| f.call(*args,&block)}
+ begin
+ /^(.+?):(\d+)/ =~ caller.first
+ file, line = $1, $2.to_i
+ rescue
+ file, line = __FILE__, __LINE__+3
+ end
+ module_eval(<<-EOS, file, line)
+ def #{name}(*args,&block)
+ @func_map['#{name}'].call(*args,&block)
+ end
+ EOS
+ module_function(name)
+ f
+ end
+
+ # Creates a class to wrap the C struct described by +signature+.
+ #
+ # MyStruct = struct ['int i', 'char c']
+ def struct(signature)
+ tys, mems = parse_struct_signature(signature, @type_alias)
+ Fiddle::CStructBuilder.create(CStruct, tys, mems)
+ end
+
+ # Creates a class to wrap the C union described by +signature+.
+ #
+ # MyUnion = union ['int i', 'char c']
+ def union(signature)
+ tys, mems = parse_struct_signature(signature, @type_alias)
+ Fiddle::CStructBuilder.create(CUnion, tys, mems)
+ end
+
+ # Returns the function mapped to +name+, that was created by either
+ # Fiddle::Importer.extern or Fiddle::Importer.bind
+ def [](name)
+ @func_map[name]
+ end
+
+ # Creates a class to wrap the C struct with the value +ty+
+ #
+ # See also Fiddle::Importer.struct
+ def create_value(ty, val=nil)
+ s = struct([ty + " value"])
+ ptr = s.malloc()
+ if( val )
+ ptr.value = val
+ end
+ return ptr
+ end
+ alias value create_value
+
+ # Returns a new instance of the C struct with the value +ty+ at the +addr+
+ # address.
+ def import_value(ty, addr)
+ s = struct([ty + " value"])
+ ptr = s.new(addr)
+ return ptr
+ end
+
+
+ # The Fiddle::CompositeHandler instance
+ #
+ # Will raise an error if no handlers are open.
+ def handler
+ @handler or raise "call dlload before importing symbols and functions"
+ end
+
+ # Returns a new Fiddle::Pointer instance at the memory address of the given
+ # +name+ symbol.
+ #
+ # Raises a DLError if the +name+ doesn't exist.
+ #
+ # See Fiddle::CompositeHandler.sym and Fiddle::Handle.sym
+ def import_symbol(name)
+ addr = handler.sym(name)
+ if( !addr )
+ raise(DLError, "cannot find the symbol: #{name}")
+ end
+ Pointer.new(addr)
+ end
+
+ # Returns a new Fiddle::Function instance at the memory address of the given
+ # +name+ function.
+ #
+ # Raises a DLError if the +name+ doesn't exist.
+ #
+ # * +argtype+ is an Array of arguments, passed to the +name+ function.
+ # * +ctype+ is the return type of the function
+ # * +call_type+ is the ABI of the function
+ #
+ # See also Fiddle:Function.new
+ #
+ # See Fiddle::CompositeHandler.sym and Fiddle::Handler.sym
+ def import_function(name, ctype, argtype, call_type = nil)
+ addr = handler.sym(name)
+ if( !addr )
+ raise(DLError, "cannot find the function: #{name}()")
+ end
+ Function.new(addr, argtype, ctype, call_type)
+ end
+
+ # Returns a new closure wrapper for the +name+ function.
+ #
+ # * +ctype+ is the return type of the function
+ # * +argtype+ is an Array of arguments, passed to the callback function
+ # * +call_type+ is the abi of the closure
+ # * +block+ is passed to the callback
+ #
+ # See Fiddle::Closure
+ def bind_function(name, ctype, argtype, call_type = nil, &block)
+ closure = Class.new(Fiddle::Closure) {
+ define_method(:call, block)
+ }.new(ctype, argtype)
+
+ Function.new(closure, argtype, ctype)
+ end
+ end
+end
diff --git a/ext/fiddle/lib/fiddle/pack.rb b/ext/fiddle/lib/fiddle/pack.rb
new file mode 100644
index 0000000000..e4e9542cc0
--- /dev/null
+++ b/ext/fiddle/lib/fiddle/pack.rb
@@ -0,0 +1,128 @@
+require 'fiddle'
+
+module Fiddle
+ module PackInfo # :nodoc: all
+ ALIGN_MAP = {
+ TYPE_VOIDP => ALIGN_VOIDP,
+ TYPE_CHAR => ALIGN_CHAR,
+ TYPE_SHORT => ALIGN_SHORT,
+ TYPE_INT => ALIGN_INT,
+ TYPE_LONG => ALIGN_LONG,
+ TYPE_FLOAT => ALIGN_FLOAT,
+ TYPE_DOUBLE => ALIGN_DOUBLE,
+ -TYPE_CHAR => ALIGN_CHAR,
+ -TYPE_SHORT => ALIGN_SHORT,
+ -TYPE_INT => ALIGN_INT,
+ -TYPE_LONG => ALIGN_LONG,
+ }
+
+ PACK_MAP = {
+ TYPE_VOIDP => ((SIZEOF_VOIDP == SIZEOF_LONG_LONG) ? "q" : "l!"),
+ TYPE_CHAR => "c",
+ TYPE_SHORT => "s!",
+ TYPE_INT => "i!",
+ TYPE_LONG => "l!",
+ TYPE_FLOAT => "f",
+ TYPE_DOUBLE => "d",
+ -TYPE_CHAR => "c",
+ -TYPE_SHORT => "s!",
+ -TYPE_INT => "i!",
+ -TYPE_LONG => "l!",
+ }
+
+ SIZE_MAP = {
+ TYPE_VOIDP => SIZEOF_VOIDP,
+ TYPE_CHAR => SIZEOF_CHAR,
+ TYPE_SHORT => SIZEOF_SHORT,
+ TYPE_INT => SIZEOF_INT,
+ TYPE_LONG => SIZEOF_LONG,
+ TYPE_FLOAT => SIZEOF_FLOAT,
+ TYPE_DOUBLE => SIZEOF_DOUBLE,
+ -TYPE_CHAR => SIZEOF_CHAR,
+ -TYPE_SHORT => SIZEOF_SHORT,
+ -TYPE_INT => SIZEOF_INT,
+ -TYPE_LONG => SIZEOF_LONG,
+ }
+ if defined?(TYPE_LONG_LONG)
+ ALIGN_MAP[TYPE_LONG_LONG] = ALIGN_MAP[-TYPE_LONG_LONG] = ALIGN_LONG_LONG
+ PACK_MAP[TYPE_LONG_LONG] = PACK_MAP[-TYPE_LONG_LONG] = "q"
+ SIZE_MAP[TYPE_LONG_LONG] = SIZE_MAP[-TYPE_LONG_LONG] = SIZEOF_LONG_LONG
+ end
+
+ def align(addr, align)
+ d = addr % align
+ if( d == 0 )
+ addr
+ else
+ addr + (align - d)
+ end
+ end
+ module_function :align
+ end
+
+ class Packer # :nodoc: all
+ include PackInfo
+
+ def self.[](*types)
+ new(types)
+ end
+
+ def initialize(types)
+ parse_types(types)
+ end
+
+ def size()
+ @size
+ end
+
+ def pack(ary)
+ case SIZEOF_VOIDP
+ when SIZEOF_LONG
+ ary.pack(@template)
+ when SIZEOF_LONG_LONG
+ ary.pack(@template)
+ else
+ raise(RuntimeError, "sizeof(void*)?")
+ end
+ end
+
+ def unpack(ary)
+ case SIZEOF_VOIDP
+ when SIZEOF_LONG
+ ary.join().unpack(@template)
+ when SIZEOF_LONG_LONG
+ ary.join().unpack(@template)
+ else
+ raise(RuntimeError, "sizeof(void*)?")
+ end
+ end
+
+ private
+
+ def parse_types(types)
+ @template = ""
+ addr = 0
+ types.each{|t|
+ orig_addr = addr
+ if( t.is_a?(Array) )
+ addr = align(orig_addr, ALIGN_MAP[TYPE_VOIDP])
+ else
+ addr = align(orig_addr, ALIGN_MAP[t])
+ end
+ d = addr - orig_addr
+ if( d > 0 )
+ @template << "x#{d}"
+ end
+ if( t.is_a?(Array) )
+ @template << (PACK_MAP[t[0]] * t[1])
+ addr += (SIZE_MAP[t[0]] * t[1])
+ else
+ @template << PACK_MAP[t]
+ addr += SIZE_MAP[t]
+ end
+ }
+ addr = align(addr, ALIGN_MAP[TYPE_VOIDP])
+ @size = addr
+ end
+ end
+end
diff --git a/ext/fiddle/lib/fiddle/struct.rb b/ext/fiddle/lib/fiddle/struct.rb
new file mode 100644
index 0000000000..5a70699bf3
--- /dev/null
+++ b/ext/fiddle/lib/fiddle/struct.rb
@@ -0,0 +1,243 @@
+require 'fiddle'
+require 'fiddle/value'
+require 'fiddle/pack'
+
+module Fiddle
+ # C struct shell
+ class CStruct
+ # accessor to Fiddle::CStructEntity
+ def CStruct.entity_class
+ CStructEntity
+ end
+ end
+
+ # C union shell
+ class CUnion
+ # accessor to Fiddle::CUnionEntity
+ def CUnion.entity_class
+ CUnionEntity
+ end
+ end
+
+ # Used to construct C classes (CUnion, CStruct, etc)
+ #
+ # Fiddle::Importer#struct and Fiddle::Importer#union wrap this functionality in an
+ # easy-to-use manner.
+ module CStructBuilder
+ # Construct a new class given a C:
+ # * class +klass+ (CUnion, CStruct, or other that provide an
+ # #entity_class)
+ # * +types+ (Fiddle::TYPE_INT, Fiddle::TYPE_SIZE_T, etc., see the C types
+ # constants)
+ # * corresponding +members+
+ #
+ # Fiddle::Importer#struct and Fiddle::Importer#union wrap this functionality in an
+ # easy-to-use manner.
+ #
+ # Example:
+ #
+ # require 'fiddle/struct'
+ # require 'fiddle/cparser'
+ #
+ # include Fiddle::CParser
+ #
+ # types, members = parse_struct_signature(['int i','char c'])
+ #
+ # MyStruct = Fiddle::CStructBuilder.create(Fiddle::CUnion, types, members)
+ #
+ # obj = MyStruct.allocate
+ #
+ def create(klass, types, members)
+ new_class = Class.new(klass){
+ define_method(:initialize){|addr|
+ @entity = klass.entity_class.new(addr, types)
+ @entity.assign_names(members)
+ }
+ define_method(:to_ptr){ @entity }
+ define_method(:to_i){ @entity.to_i }
+ members.each{|name|
+ define_method(name){ @entity[name] }
+ define_method(name + "="){|val| @entity[name] = val }
+ }
+ }
+ size = klass.entity_class.size(types)
+ new_class.module_eval(<<-EOS, __FILE__, __LINE__+1)
+ def new_class.size()
+ #{size}
+ end
+ def new_class.malloc()
+ addr = Fiddle.malloc(#{size})
+ new(addr)
+ end
+ EOS
+ return new_class
+ end
+ module_function :create
+ end
+
+ # A C struct wrapper
+ class CStructEntity < Fiddle::Pointer
+ include PackInfo
+ include ValueUtil
+
+ # Allocates a C struct with the +types+ provided.
+ #
+ # When the instance is garbage collected, the C function +func+ is called.
+ def CStructEntity.malloc(types, func = nil)
+ addr = Fiddle.malloc(CStructEntity.size(types))
+ CStructEntity.new(addr, types, func)
+ end
+
+ # Returns the offset for the packed sizes for the given +types+.
+ #
+ # Fiddle::CStructEntity.size(
+ # [ Fiddle::TYPE_DOUBLE,
+ # Fiddle::TYPE_INT,
+ # Fiddle::TYPE_CHAR,
+ # Fiddle::TYPE_VOIDP ]) #=> 24
+ def CStructEntity.size(types)
+ offset = 0
+
+ max_align = types.map { |type, count = 1|
+ last_offset = offset
+
+ align = PackInfo::ALIGN_MAP[type]
+ offset = PackInfo.align(last_offset, align) +
+ (PackInfo::SIZE_MAP[type] * count)
+
+ align
+ }.max
+
+ PackInfo.align(offset, max_align)
+ end
+
+ # Wraps the C pointer +addr+ as a C struct with the given +types+.
+ #
+ # When the instance is garbage collected, the C function +func+ is called.
+ #
+ # See also Fiddle::Pointer.new
+ def initialize(addr, types, func = nil)
+ set_ctypes(types)
+ super(addr, @size, func)
+ end
+
+ # Set the names of the +members+ in this C struct
+ def assign_names(members)
+ @members = members
+ end
+
+ # Calculates the offsets and sizes for the given +types+ in the struct.
+ def set_ctypes(types)
+ @ctypes = types
+ @offset = []
+ offset = 0
+
+ max_align = types.map { |type, count = 1|
+ orig_offset = offset
+ align = ALIGN_MAP[type]
+ offset = PackInfo.align(orig_offset, align)
+
+ @offset << offset
+
+ offset += (SIZE_MAP[type] * count)
+
+ align
+ }.max
+
+ @size = PackInfo.align(offset, max_align)
+ end
+
+ # Fetch struct member +name+
+ def [](name)
+ idx = @members.index(name)
+ if( idx.nil? )
+ raise(ArgumentError, "no such member: #{name}")
+ end
+ ty = @ctypes[idx]
+ if( ty.is_a?(Array) )
+ r = super(@offset[idx], SIZE_MAP[ty[0]] * ty[1])
+ else
+ r = super(@offset[idx], SIZE_MAP[ty.abs])
+ end
+ packer = Packer.new([ty])
+ val = packer.unpack([r])
+ case ty
+ when Array
+ case ty[0]
+ when TYPE_VOIDP
+ val = val.collect{|v| CPtr.new(v)}
+ end
+ when TYPE_VOIDP
+ val = CPtr.new(val[0])
+ else
+ val = val[0]
+ end
+ if( ty.is_a?(Integer) && (ty < 0) )
+ return unsigned_value(val, ty)
+ elsif( ty.is_a?(Array) && (ty[0] < 0) )
+ return val.collect{|v| unsigned_value(v,ty[0])}
+ else
+ return val
+ end
+ end
+
+ # Set struct member +name+, to value +val+
+ def []=(name, val)
+ idx = @members.index(name)
+ if( idx.nil? )
+ raise(ArgumentError, "no such member: #{name}")
+ end
+ ty = @ctypes[idx]
+ packer = Packer.new([ty])
+ val = wrap_arg(val, ty, [])
+ buff = packer.pack([val].flatten())
+ super(@offset[idx], buff.size, buff)
+ if( ty.is_a?(Integer) && (ty < 0) )
+ return unsigned_value(val, ty)
+ elsif( ty.is_a?(Array) && (ty[0] < 0) )
+ return val.collect{|v| unsigned_value(v,ty[0])}
+ else
+ return val
+ end
+ end
+
+ def to_s() # :nodoc:
+ super(@size)
+ end
+ end
+
+ # A C union wrapper
+ class CUnionEntity < CStructEntity
+ include PackInfo
+
+ # Allocates a C union the +types+ provided.
+ #
+ # When the instance is garbage collected, the C function +func+ is called.
+ def CUnionEntity.malloc(types, func=nil)
+ addr = Fiddle.malloc(CUnionEntity.size(types))
+ CUnionEntity.new(addr, types, func)
+ end
+
+ # Returns the size needed for the union with the given +types+.
+ #
+ # Fiddle::CUnionEntity.size(
+ # [ Fiddle::TYPE_DOUBLE,
+ # Fiddle::TYPE_INT,
+ # Fiddle::TYPE_CHAR,
+ # Fiddle::TYPE_VOIDP ]) #=> 8
+ def CUnionEntity.size(types)
+ types.map { |type, count = 1|
+ PackInfo::SIZE_MAP[type] * count
+ }.max
+ end
+
+ # Calculate the necessary offset and for each union member with the given
+ # +types+
+ def set_ctypes(types)
+ @ctypes = types
+ @offset = Array.new(types.length, 0)
+ @size = self.class.size types
+ end
+ end
+end
+
diff --git a/ext/fiddle/lib/fiddle/value.rb b/ext/fiddle/lib/fiddle/value.rb
new file mode 100644
index 0000000000..8d71e47ce6
--- /dev/null
+++ b/ext/fiddle/lib/fiddle/value.rb
@@ -0,0 +1,112 @@
+require 'fiddle'
+
+module Fiddle
+ module ValueUtil #:nodoc: all
+ def unsigned_value(val, ty)
+ case ty.abs
+ when TYPE_CHAR
+ [val].pack("c").unpack("C")[0]
+ when TYPE_SHORT
+ [val].pack("s!").unpack("S!")[0]
+ when TYPE_INT
+ [val].pack("i!").unpack("I!")[0]
+ when TYPE_LONG
+ [val].pack("l!").unpack("L!")[0]
+ when TYPE_LONG_LONG
+ [val].pack("q").unpack("Q")[0]
+ else
+ val
+ end
+ end
+
+ def signed_value(val, ty)
+ case ty.abs
+ when TYPE_CHAR
+ [val].pack("C").unpack("c")[0]
+ when TYPE_SHORT
+ [val].pack("S!").unpack("s!")[0]
+ when TYPE_INT
+ [val].pack("I!").unpack("i!")[0]
+ when TYPE_LONG
+ [val].pack("L!").unpack("l!")[0]
+ when TYPE_LONG_LONG
+ [val].pack("Q").unpack("q")[0]
+ else
+ val
+ end
+ end
+
+ def wrap_args(args, tys, funcs, &block)
+ result = []
+ tys ||= []
+ args.each_with_index{|arg, idx|
+ result.push(wrap_arg(arg, tys[idx], funcs, &block))
+ }
+ result
+ end
+
+ def wrap_arg(arg, ty, funcs = [], &block)
+ funcs ||= []
+ case arg
+ when nil
+ return 0
+ when Pointer
+ return arg.to_i
+ when IO
+ case ty
+ when TYPE_VOIDP
+ return Pointer[arg].to_i
+ else
+ return arg.to_i
+ end
+ when Function
+ if( block )
+ arg.bind_at_call(&block)
+ funcs.push(arg)
+ elsif !arg.bound?
+ raise(RuntimeError, "block must be given.")
+ end
+ return arg.to_i
+ when String
+ if( ty.is_a?(Array) )
+ return arg.unpack('C*')
+ else
+ case SIZEOF_VOIDP
+ when SIZEOF_LONG
+ return [arg].pack("p").unpack("l!")[0]
+ when SIZEOF_LONG_LONG
+ return [arg].pack("p").unpack("q")[0]
+ else
+ raise(RuntimeError, "sizeof(void*)?")
+ end
+ end
+ when Float, Integer
+ return arg
+ when Array
+ if( ty.is_a?(Array) ) # used only by struct
+ case ty[0]
+ when TYPE_VOIDP
+ return arg.collect{|v| Integer(v)}
+ when TYPE_CHAR
+ if( arg.is_a?(String) )
+ return val.unpack('C*')
+ end
+ end
+ return arg
+ else
+ return arg
+ end
+ else
+ if( arg.respond_to?(:to_ptr) )
+ return arg.to_ptr.to_i
+ else
+ begin
+ return Integer(arg)
+ rescue
+ raise(ArgumentError, "unknown argument type: #{arg.class}")
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/ext/fiddle/pointer.c b/ext/fiddle/pointer.c
new file mode 100644
index 0000000000..8f5fdeb60c
--- /dev/null
+++ b/ext/fiddle/pointer.c
@@ -0,0 +1,716 @@
+/* -*- C -*-
+ * $Id$
+ */
+
+#include <ruby/ruby.h>
+#include <ruby/io.h>
+#include <ctype.h>
+#include <fiddle.h>
+
+VALUE rb_cPointer;
+
+typedef void (*freefunc_t)(void*);
+
+struct ptr_data {
+ void *ptr;
+ long size;
+ freefunc_t free;
+ VALUE wrap[2];
+};
+
+#define RPTR_DATA(obj) ((struct ptr_data *)(DATA_PTR(obj)))
+
+static inline freefunc_t
+get_freefunc(VALUE func, volatile VALUE *wrap)
+{
+ VALUE addrnum;
+ if (NIL_P(func)) {
+ *wrap = 0;
+ return NULL;
+ }
+ addrnum = rb_Integer(func);
+ *wrap = (addrnum != func) ? func : 0;
+ return (freefunc_t)(VALUE)NUM2PTR(addrnum);
+}
+
+static ID id_to_ptr;
+
+static void
+fiddle_ptr_mark(void *ptr)
+{
+ struct ptr_data *data = ptr;
+ if (data->wrap[0]) {
+ rb_gc_mark(data->wrap[0]);
+ }
+ if (data->wrap[1]) {
+ rb_gc_mark(data->wrap[1]);
+ }
+}
+
+static void
+fiddle_ptr_free(void *ptr)
+{
+ struct ptr_data *data = ptr;
+ if (data->ptr) {
+ if (data->free) {
+ (*(data->free))(data->ptr);
+ }
+ }
+}
+
+static size_t
+fiddle_ptr_memsize(const void *ptr)
+{
+ const struct ptr_data *data = ptr;
+ return data ? sizeof(*data) + data->size : 0;
+}
+
+static const rb_data_type_t fiddle_ptr_data_type = {
+ "fiddle/pointer",
+ {fiddle_ptr_mark, fiddle_ptr_free, fiddle_ptr_memsize,},
+};
+
+static VALUE
+rb_fiddle_ptr_new2(VALUE klass, void *ptr, long size, freefunc_t func)
+{
+ struct ptr_data *data;
+ VALUE val;
+
+ rb_secure(4);
+ val = TypedData_Make_Struct(klass, struct ptr_data, &fiddle_ptr_data_type, data);
+ data->ptr = ptr;
+ data->free = func;
+ data->size = size;
+ OBJ_TAINT(val);
+
+ return val;
+}
+
+static VALUE
+rb_fiddle_ptr_new(void *ptr, long size, freefunc_t func)
+{
+ return rb_fiddle_ptr_new2(rb_cPointer, ptr, size, func);
+}
+
+static VALUE
+rb_fiddle_ptr_malloc(long size, freefunc_t func)
+{
+ void *ptr;
+
+ rb_secure(4);
+ ptr = ruby_xmalloc((size_t)size);
+ memset(ptr,0,(size_t)size);
+ return rb_fiddle_ptr_new(ptr, size, func);
+}
+
+static void *
+rb_fiddle_ptr2cptr(VALUE val)
+{
+ struct ptr_data *data;
+ void *ptr;
+
+ if (rb_obj_is_kind_of(val, rb_cPointer)) {
+ TypedData_Get_Struct(val, struct ptr_data, &fiddle_ptr_data_type, data);
+ ptr = data->ptr;
+ }
+ else if (val == Qnil) {
+ ptr = NULL;
+ }
+ else{
+ rb_raise(rb_eTypeError, "DL::PtrData was expected");
+ }
+
+ return ptr;
+}
+
+static VALUE
+rb_fiddle_ptr_s_allocate(VALUE klass)
+{
+ VALUE obj;
+ struct ptr_data *data;
+
+ rb_secure(4);
+ obj = TypedData_Make_Struct(klass, struct ptr_data, &fiddle_ptr_data_type, data);
+ data->ptr = 0;
+ data->size = 0;
+ data->free = 0;
+
+ return obj;
+}
+
+/*
+ * call-seq:
+ * Fiddle::Pointer.new(address) => fiddle_cptr
+ * new(address, size) => fiddle_cptr
+ * new(address, size, freefunc) => fiddle_cptr
+ *
+ * Create a new pointer to +address+ with an optional +size+ and +freefunc+.
+ *
+ * +freefunc+ will be called when the instance is garbage collected.
+ */
+static VALUE
+rb_fiddle_ptr_initialize(int argc, VALUE argv[], VALUE self)
+{
+ VALUE ptr, sym, size, wrap = 0, funcwrap = 0;
+ struct ptr_data *data;
+ void *p = NULL;
+ freefunc_t f = NULL;
+ long s = 0;
+
+ if (rb_scan_args(argc, argv, "12", &ptr, &size, &sym) >= 1) {
+ VALUE addrnum = rb_Integer(ptr);
+ if (addrnum != ptr) wrap = ptr;
+ p = NUM2PTR(addrnum);
+ }
+ if (argc >= 2) {
+ s = NUM2LONG(size);
+ }
+ if (argc >= 3) {
+ f = get_freefunc(sym, &funcwrap);
+ }
+
+ if (p) {
+ TypedData_Get_Struct(self, struct ptr_data, &fiddle_ptr_data_type, data);
+ if (data->ptr && data->free) {
+ /* Free previous memory. Use of inappropriate initialize may cause SEGV. */
+ (*(data->free))(data->ptr);
+ }
+ data->wrap[0] = wrap;
+ data->wrap[1] = funcwrap;
+ data->ptr = p;
+ data->size = s;
+ data->free = f;
+ }
+
+ return Qnil;
+}
+
+/*
+ * call-seq:
+ *
+ * Fiddle::Pointer.malloc(size, freefunc = nil) => fiddle pointer instance
+ *
+ * Allocate +size+ bytes of memory and associate it with an optional
+ * +freefunc+ that will be called when the pointer is garbage collected.
+ *
+ * +freefunc+ must be an address pointing to a function or an instance of
+ * Fiddle::Function
+ */
+static VALUE
+rb_fiddle_ptr_s_malloc(int argc, VALUE argv[], VALUE klass)
+{
+ VALUE size, sym, obj, wrap = 0;
+ long s;
+ freefunc_t f;
+
+ switch (rb_scan_args(argc, argv, "11", &size, &sym)) {
+ case 1:
+ s = NUM2LONG(size);
+ f = NULL;
+ break;
+ case 2:
+ s = NUM2LONG(size);
+ f = get_freefunc(sym, &wrap);
+ break;
+ default:
+ rb_bug("rb_fiddle_ptr_s_malloc");
+ }
+
+ obj = rb_fiddle_ptr_malloc(s,f);
+ if (wrap) RPTR_DATA(obj)->wrap[1] = wrap;
+
+ return obj;
+}
+
+/*
+ * call-seq: to_i
+ *
+ * Returns the integer memory location of this pointer.
+ */
+static VALUE
+rb_fiddle_ptr_to_i(VALUE self)
+{
+ struct ptr_data *data;
+
+ TypedData_Get_Struct(self, struct ptr_data, &fiddle_ptr_data_type, data);
+ return PTR2NUM(data->ptr);
+}
+
+/*
+ * call-seq: to_value
+ *
+ * Cast this pointer to a ruby object.
+ */
+static VALUE
+rb_fiddle_ptr_to_value(VALUE self)
+{
+ struct ptr_data *data;
+ TypedData_Get_Struct(self, struct ptr_data, &fiddle_ptr_data_type, data);
+ return (VALUE)(data->ptr);
+}
+
+/*
+ * call-seq: ptr
+ *
+ * Returns a new Fiddle::Pointer instance that is a dereferenced pointer for
+ * this pointer.
+ *
+ * Analogous to the star operator in C.
+ */
+static VALUE
+rb_fiddle_ptr_ptr(VALUE self)
+{
+ struct ptr_data *data;
+
+ TypedData_Get_Struct(self, struct ptr_data, &fiddle_ptr_data_type, data);
+ return rb_fiddle_ptr_new(*((void**)(data->ptr)),0,0);
+}
+
+/*
+ * call-seq: ref
+ *
+ * Returns a new Fiddle::Pointer instance that is a reference pointer for this
+ * pointer.
+ *
+ * Analogous to the ampersand operator in C.
+ */
+static VALUE
+rb_fiddle_ptr_ref(VALUE self)
+{
+ struct ptr_data *data;
+
+ TypedData_Get_Struct(self, struct ptr_data, &fiddle_ptr_data_type, data);
+ return rb_fiddle_ptr_new(&(data->ptr),0,0);
+}
+
+/*
+ * call-seq: null?
+ *
+ * Returns +true+ if this is a null pointer.
+ */
+static VALUE
+rb_fiddle_ptr_null_p(VALUE self)
+{
+ struct ptr_data *data;
+
+ TypedData_Get_Struct(self, struct ptr_data, &fiddle_ptr_data_type, data);
+ return data->ptr ? Qfalse : Qtrue;
+}
+
+/*
+ * call-seq: free=(function)
+ *
+ * Set the free function for this pointer to +function+ in the given
+ * Fiddle::Function.
+ */
+static VALUE
+rb_fiddle_ptr_free_set(VALUE self, VALUE val)
+{
+ struct ptr_data *data;
+
+ TypedData_Get_Struct(self, struct ptr_data, &fiddle_ptr_data_type, data);
+ data->free = get_freefunc(val, &data->wrap[1]);
+
+ return Qnil;
+}
+
+/*
+ * call-seq: free => Fiddle::Function
+ *
+ * Get the free function for this pointer.
+ *
+ * Returns a new instance of Fiddle::Function.
+ *
+ * See Fiddle::Function.new
+ */
+static VALUE
+rb_fiddle_ptr_free_get(VALUE self)
+{
+ struct ptr_data *pdata;
+ VALUE address;
+ VALUE arg_types;
+ VALUE ret_type;
+
+ TypedData_Get_Struct(self, struct ptr_data, &fiddle_ptr_data_type, pdata);
+
+ if (!pdata->free)
+ return Qnil;
+
+ address = PTR2NUM(pdata->free);
+ ret_type = INT2NUM(TYPE_VOID);
+ arg_types = rb_ary_new();
+ rb_ary_push(arg_types, INT2NUM(TYPE_VOIDP));
+
+ return rb_fiddle_new_function(address, arg_types, ret_type);
+}
+
+/*
+ * call-seq:
+ *
+ * ptr.to_s => string
+ * ptr.to_s(len) => string
+ *
+ * Returns the pointer contents as a string.
+ *
+ * When called with no arguments, this method will return the contents until
+ * the first NULL byte.
+ *
+ * When called with +len+, a string of +len+ bytes will be returned.
+ *
+ * See to_str
+ */
+static VALUE
+rb_fiddle_ptr_to_s(int argc, VALUE argv[], VALUE self)
+{
+ struct ptr_data *data;
+ VALUE arg1, val;
+ int len;
+
+ TypedData_Get_Struct(self, struct ptr_data, &fiddle_ptr_data_type, data);
+ switch (rb_scan_args(argc, argv, "01", &arg1)) {
+ case 0:
+ val = rb_tainted_str_new2((char*)(data->ptr));
+ break;
+ case 1:
+ len = NUM2INT(arg1);
+ val = rb_tainted_str_new((char*)(data->ptr), len);
+ break;
+ default:
+ rb_bug("rb_fiddle_ptr_to_s");
+ }
+
+ return val;
+}
+
+/*
+ * call-seq:
+ *
+ * ptr.to_str => string
+ * ptr.to_str(len) => string
+ *
+ * Returns the pointer contents as a string.
+ *
+ * When called with no arguments, this method will return the contents with the
+ * length of this pointer's +size+.
+ *
+ * When called with +len+, a string of +len+ bytes will be returned.
+ *
+ * See to_s
+ */
+static VALUE
+rb_fiddle_ptr_to_str(int argc, VALUE argv[], VALUE self)
+{
+ struct ptr_data *data;
+ VALUE arg1, val;
+ int len;
+
+ TypedData_Get_Struct(self, struct ptr_data, &fiddle_ptr_data_type, data);
+ switch (rb_scan_args(argc, argv, "01", &arg1)) {
+ case 0:
+ val = rb_tainted_str_new((char*)(data->ptr),data->size);
+ break;
+ case 1:
+ len = NUM2INT(arg1);
+ val = rb_tainted_str_new((char*)(data->ptr), len);
+ break;
+ default:
+ rb_bug("rb_fiddle_ptr_to_str");
+ }
+
+ return val;
+}
+
+/*
+ * call-seq: inspect
+ *
+ * Returns a string formatted with an easily readable representation of the
+ * internal state of the pointer.
+ */
+static VALUE
+rb_fiddle_ptr_inspect(VALUE self)
+{
+ struct ptr_data *data;
+ char str[1024];
+
+ TypedData_Get_Struct(self, struct ptr_data, &fiddle_ptr_data_type, data);
+ snprintf(str, 1023, "#<%s:%p ptr=%p size=%ld free=%p>",
+ rb_class2name(CLASS_OF(self)), data, data->ptr, data->size, data->free);
+ return rb_str_new2(str);
+}
+
+/*
+ * call-seq:
+ * ptr == other => true or false
+ * ptr.eql?(other) => true or false
+ *
+ * Returns true if +other+ wraps the same pointer, otherwise returns
+ * false.
+ */
+static VALUE
+rb_fiddle_ptr_eql(VALUE self, VALUE other)
+{
+ void *ptr1, *ptr2;
+
+ if(!rb_obj_is_kind_of(other, rb_cPointer)) return Qfalse;
+
+ ptr1 = rb_fiddle_ptr2cptr(self);
+ ptr2 = rb_fiddle_ptr2cptr(other);
+
+ return ptr1 == ptr2 ? Qtrue : Qfalse;
+}
+
+/*
+ * call-seq:
+ * ptr <=> other => -1, 0, 1, or nil
+ *
+ * Returns -1 if less than, 0 if equal to, 1 if greater than +other+.
+ *
+ * Returns nil if +ptr+ cannot be compared to +other+.
+ */
+static VALUE
+rb_fiddle_ptr_cmp(VALUE self, VALUE other)
+{
+ void *ptr1, *ptr2;
+ SIGNED_VALUE diff;
+
+ if(!rb_obj_is_kind_of(other, rb_cPointer)) return Qnil;
+
+ ptr1 = rb_fiddle_ptr2cptr(self);
+ ptr2 = rb_fiddle_ptr2cptr(other);
+ diff = (SIGNED_VALUE)ptr1 - (SIGNED_VALUE)ptr2;
+ if (!diff) return INT2FIX(0);
+ return diff > 0 ? INT2NUM(1) : INT2NUM(-1);
+}
+
+/*
+ * call-seq:
+ * ptr + n => new cptr
+ *
+ * Returns a new pointer instance that has been advanced +n+ bytes.
+ */
+static VALUE
+rb_fiddle_ptr_plus(VALUE self, VALUE other)
+{
+ void *ptr;
+ long num, size;
+
+ ptr = rb_fiddle_ptr2cptr(self);
+ size = RPTR_DATA(self)->size;
+ num = NUM2LONG(other);
+ return rb_fiddle_ptr_new((char *)ptr + num, size - num, 0);
+}
+
+/*
+ * call-seq:
+ * ptr - n => new cptr
+ *
+ * Returns a new pointer instance that has been moved back +n+ bytes.
+ */
+static VALUE
+rb_fiddle_ptr_minus(VALUE self, VALUE other)
+{
+ void *ptr;
+ long num, size;
+
+ ptr = rb_fiddle_ptr2cptr(self);
+ size = RPTR_DATA(self)->size;
+ num = NUM2LONG(other);
+ return rb_fiddle_ptr_new((char *)ptr - num, size + num, 0);
+}
+
+/*
+ * call-seq:
+ * ptr[index] -> an_integer
+ * ptr[start, length] -> a_string
+ *
+ * Returns integer stored at _index_.
+ *
+ * If _start_ and _length_ are given, a string containing the bytes from
+ * _start_ of _length_ will be returned.
+ */
+static VALUE
+rb_fiddle_ptr_aref(int argc, VALUE argv[], VALUE self)
+{
+ VALUE arg0, arg1;
+ VALUE retval = Qnil;
+ size_t offset, len;
+ struct ptr_data *data;
+
+ TypedData_Get_Struct(self, struct ptr_data, &fiddle_ptr_data_type, data);
+ if (!data->ptr) rb_raise(rb_eFiddleError, "NULL pointer dereference");
+ switch( rb_scan_args(argc, argv, "11", &arg0, &arg1) ){
+ case 1:
+ offset = NUM2ULONG(arg0);
+ retval = INT2NUM(*((char *)data->ptr + offset));
+ break;
+ case 2:
+ offset = NUM2ULONG(arg0);
+ len = NUM2ULONG(arg1);
+ retval = rb_tainted_str_new((char *)data->ptr + offset, len);
+ break;
+ default:
+ rb_bug("rb_fiddle_ptr_aref()");
+ }
+ return retval;
+}
+
+/*
+ * call-seq:
+ * ptr[index] = int -> int
+ * ptr[start, length] = string or cptr or addr -> string or dl_cptr or addr
+ *
+ * Set the value at +index+ to +int+.
+ *
+ * Or, set the memory at +start+ until +length+ with the contents of +string+,
+ * the memory from +dl_cptr+, or the memory pointed at by the memory address
+ * +addr+.
+ */
+static VALUE
+rb_fiddle_ptr_aset(int argc, VALUE argv[], VALUE self)
+{
+ VALUE arg0, arg1, arg2;
+ VALUE retval = Qnil;
+ size_t offset, len;
+ void *mem;
+ struct ptr_data *data;
+
+ TypedData_Get_Struct(self, struct ptr_data, &fiddle_ptr_data_type, data);
+ if (!data->ptr) rb_raise(rb_eFiddleError, "NULL pointer dereference");
+ switch( rb_scan_args(argc, argv, "21", &arg0, &arg1, &arg2) ){
+ case 2:
+ offset = NUM2ULONG(arg0);
+ ((char*)data->ptr)[offset] = NUM2UINT(arg1);
+ retval = arg1;
+ break;
+ case 3:
+ offset = NUM2ULONG(arg0);
+ len = NUM2ULONG(arg1);
+ if (RB_TYPE_P(arg2, T_STRING)) {
+ mem = StringValuePtr(arg2);
+ }
+ else if( rb_obj_is_kind_of(arg2, rb_cPointer) ){
+ mem = rb_fiddle_ptr2cptr(arg2);
+ }
+ else{
+ mem = NUM2PTR(arg2);
+ }
+ memcpy((char *)data->ptr + offset, mem, len);
+ retval = arg2;
+ break;
+ default:
+ rb_bug("rb_fiddle_ptr_aset()");
+ }
+ return retval;
+}
+
+/*
+ * call-seq: size=(size)
+ *
+ * Set the size of this pointer to +size+
+ */
+static VALUE
+rb_fiddle_ptr_size_set(VALUE self, VALUE size)
+{
+ RPTR_DATA(self)->size = NUM2LONG(size);
+ return size;
+}
+
+/*
+ * call-seq: size
+ *
+ * Get the size of this pointer.
+ */
+static VALUE
+rb_fiddle_ptr_size_get(VALUE self)
+{
+ return LONG2NUM(RPTR_DATA(self)->size);
+}
+
+/*
+ * call-seq:
+ * Fiddle::Pointer[val] => cptr
+ * to_ptr(val) => cptr
+ *
+ * Get the underlying pointer for ruby object +val+ and return it as a
+ * Fiddle::Pointer object.
+ */
+static VALUE
+rb_fiddle_ptr_s_to_ptr(VALUE self, VALUE val)
+{
+ VALUE ptr, wrap = val, vptr;
+
+ if (RTEST(rb_obj_is_kind_of(val, rb_cIO))){
+ rb_io_t *fptr;
+ FILE *fp;
+ GetOpenFile(val, fptr);
+ fp = rb_io_stdio_file(fptr);
+ ptr = rb_fiddle_ptr_new(fp, 0, NULL);
+ }
+ else if (RTEST(rb_obj_is_kind_of(val, rb_cString))){
+ char *str = StringValuePtr(val);
+ ptr = rb_fiddle_ptr_new(str, RSTRING_LEN(val), NULL);
+ }
+ else if ((vptr = rb_check_funcall(val, id_to_ptr, 0, 0)) != Qundef){
+ if (rb_obj_is_kind_of(vptr, rb_cPointer)){
+ ptr = vptr;
+ wrap = 0;
+ }
+ else{
+ rb_raise(rb_eFiddleError, "to_ptr should return a Fiddle::Pointer object");
+ }
+ }
+ else{
+ VALUE num = rb_Integer(val);
+ if (num == val) wrap = 0;
+ ptr = rb_fiddle_ptr_new(NUM2PTR(num), 0, NULL);
+ }
+ OBJ_INFECT(ptr, val);
+ if (wrap) RPTR_DATA(ptr)->wrap[0] = wrap;
+ return ptr;
+}
+
+void
+Init_fiddle_pointer(void)
+{
+ id_to_ptr = rb_intern("to_ptr");
+
+ /* Document-class: Fiddle::Pointer
+ *
+ * Fiddle::Pointer is a class to handle C pointers
+ *
+ */
+ rb_cPointer = rb_define_class_under(mFiddle, "Pointer", rb_cObject);
+ rb_define_alloc_func(rb_cPointer, rb_fiddle_ptr_s_allocate);
+ rb_define_singleton_method(rb_cPointer, "malloc", rb_fiddle_ptr_s_malloc, -1);
+ rb_define_singleton_method(rb_cPointer, "to_ptr", rb_fiddle_ptr_s_to_ptr, 1);
+ rb_define_singleton_method(rb_cPointer, "[]", rb_fiddle_ptr_s_to_ptr, 1);
+ rb_define_method(rb_cPointer, "initialize", rb_fiddle_ptr_initialize, -1);
+ rb_define_method(rb_cPointer, "free=", rb_fiddle_ptr_free_set, 1);
+ rb_define_method(rb_cPointer, "free", rb_fiddle_ptr_free_get, 0);
+ rb_define_method(rb_cPointer, "to_i", rb_fiddle_ptr_to_i, 0);
+ rb_define_method(rb_cPointer, "to_int", rb_fiddle_ptr_to_i, 0);
+ rb_define_method(rb_cPointer, "to_value", rb_fiddle_ptr_to_value, 0);
+ rb_define_method(rb_cPointer, "ptr", rb_fiddle_ptr_ptr, 0);
+ rb_define_method(rb_cPointer, "+@", rb_fiddle_ptr_ptr, 0);
+ rb_define_method(rb_cPointer, "ref", rb_fiddle_ptr_ref, 0);
+ rb_define_method(rb_cPointer, "-@", rb_fiddle_ptr_ref, 0);
+ rb_define_method(rb_cPointer, "null?", rb_fiddle_ptr_null_p, 0);
+ rb_define_method(rb_cPointer, "to_s", rb_fiddle_ptr_to_s, -1);
+ rb_define_method(rb_cPointer, "to_str", rb_fiddle_ptr_to_str, -1);
+ rb_define_method(rb_cPointer, "inspect", rb_fiddle_ptr_inspect, 0);
+ rb_define_method(rb_cPointer, "<=>", rb_fiddle_ptr_cmp, 1);
+ rb_define_method(rb_cPointer, "==", rb_fiddle_ptr_eql, 1);
+ rb_define_method(rb_cPointer, "eql?", rb_fiddle_ptr_eql, 1);
+ rb_define_method(rb_cPointer, "+", rb_fiddle_ptr_plus, 1);
+ rb_define_method(rb_cPointer, "-", rb_fiddle_ptr_minus, 1);
+ rb_define_method(rb_cPointer, "[]", rb_fiddle_ptr_aref, -1);
+ rb_define_method(rb_cPointer, "[]=", rb_fiddle_ptr_aset, -1);
+ rb_define_method(rb_cPointer, "size", rb_fiddle_ptr_size_get, 0);
+ rb_define_method(rb_cPointer, "size=", rb_fiddle_ptr_size_set, 1);
+
+ /* Document-const: NULL
+ *
+ * A NULL pointer
+ */
+ rb_define_const(mFiddle, "NULL", rb_fiddle_ptr_new(0, 0, 0));
+}
diff --git a/ext/gdbm/gdbm.c b/ext/gdbm/gdbm.c
index 6f0c14d664..9d958d54a2 100644
--- a/ext/gdbm/gdbm.c
+++ b/ext/gdbm/gdbm.c
@@ -73,12 +73,18 @@
*/
static VALUE rb_cGDBM, rb_eGDBMError, rb_eGDBMFatalError;
+#if SIZEOF_LONG > SIZEOF_INT
+#define TOO_LONG(n) ((long)(+(int)(n)) != (long)(n))
+#else
+#define TOO_LONG(n) 0
+#endif
+
#define RUBY_GDBM_RW_BIT 0x20000000
#define MY_BLOCK_SIZE (2048)
#define MY_FATAL_FUNC rb_gdbm_fatal
static void
-rb_gdbm_fatal(char *msg)
+rb_gdbm_fatal(const char *msg)
{
rb_raise(rb_eGDBMFatalError, "%s", msg);
}
@@ -204,6 +210,11 @@ fgdbm_initialize(int argc, VALUE *argv, VALUE obj)
SafeStringValue(file);
+#ifdef GDBM_CLOEXEC
+ /* GDBM_CLOEXEC is available since gdbm 1.10. */
+ flags |= GDBM_CLOEXEC;
+#endif
+
if (flags & RUBY_GDBM_RW_BIT) {
flags &= ~RUBY_GDBM_RW_BIT;
dbm = gdbm_open(RSTRING_PTR(file), MY_BLOCK_SIZE,
@@ -222,13 +233,17 @@ fgdbm_initialize(int argc, VALUE *argv, VALUE obj)
GDBM_READER|flags, 0, MY_FATAL_FUNC);
}
+ if (dbm) {
+ rb_fd_fix_cloexec(gdbm_fdesc(dbm));
+ }
+
if (!dbm) {
if (mode == -1) return Qnil;
if (gdbm_errno == GDBM_FILE_OPEN_ERROR ||
gdbm_errno == GDBM_CANT_BE_READER ||
gdbm_errno == GDBM_CANT_BE_WRITER)
- rb_sys_fail(RSTRING_PTR(file));
+ rb_sys_fail_str(file);
else
rb_raise(rb_eGDBMError, "%s", gdbm_strerror(gdbm_errno));
}
@@ -297,10 +312,13 @@ static VALUE
rb_gdbm_fetch2(GDBM_FILE dbm, VALUE keystr)
{
datum key;
+ long len;
StringValue(keystr);
+ len = RSTRING_LEN(keystr);
+ if (TOO_LONG(len)) return Qnil;
key.dptr = RSTRING_PTR(keystr);
- key.dsize = (int)RSTRING_LEN(keystr);
+ key.dsize = (int)len;
return rb_gdbm_fetch(dbm, key);
}
@@ -336,9 +354,12 @@ rb_gdbm_nextkey(GDBM_FILE dbm, VALUE keystr)
{
datum key, key2;
VALUE str;
+ long len;
+ len = RSTRING_LEN(keystr);
+ if (TOO_LONG(len)) return Qnil;
key.dptr = RSTRING_PTR(keystr);
- key.dsize = (int)RSTRING_LEN(keystr);
+ key.dsize = (int)len;
key2 = gdbm_nextkey(dbm, key);
if (key2.dptr == 0)
return Qnil;
@@ -495,11 +516,14 @@ rb_gdbm_delete(VALUE obj, VALUE keystr)
datum key;
struct dbmdata *dbmp;
GDBM_FILE dbm;
+ long len;
rb_gdbm_modify(obj);
StringValue(keystr);
+ len = RSTRING_LEN(keystr);
+ if (TOO_LONG(len)) return Qnil;
key.dptr = RSTRING_PTR(keystr);
- key.dsize = (int)RSTRING_LEN(keystr);
+ key.dsize = (int)len;
GetDBM2(obj, dbmp, dbm);
if (!gdbm_exists(dbm, key)) {
@@ -570,7 +594,7 @@ fgdbm_delete_if(VALUE obj)
struct dbmdata *dbmp;
GDBM_FILE dbm;
VALUE keystr, valstr;
- VALUE ret, ary = rb_ary_new();
+ VALUE ret, ary = rb_ary_tmp_new(0);
int i, status = 0, n;
rb_gdbm_modify(obj);
@@ -581,8 +605,9 @@ fgdbm_delete_if(VALUE obj)
for (keystr = rb_gdbm_firstkey(dbm); RTEST(keystr);
keystr = rb_gdbm_nextkey(dbm, keystr)) {
+ OBJ_FREEZE(keystr);
valstr = rb_gdbm_fetch2(dbm, keystr);
- ret = rb_protect(rb_yield, rb_assoc_new(keystr, valstr), &status);
+ ret = rb_protect(rb_yield, rb_assoc_new(rb_str_dup(keystr), valstr), &status);
if (status != 0) break;
if (RTEST(ret)) rb_ary_push(ary, keystr);
GetDBM2(obj, dbmp, dbm);
@@ -592,6 +617,7 @@ fgdbm_delete_if(VALUE obj)
rb_gdbm_delete(obj, RARRAY_PTR(ary)[i]);
if (status) rb_jump_tag(status);
if (n > 0) dbmp->di_size = n - (int)RARRAY_LEN(ary);
+ rb_ary_clear(ary);
return obj;
}
@@ -683,10 +709,10 @@ fgdbm_store(VALUE obj, VALUE keystr, VALUE valstr)
StringValue(valstr);
key.dptr = RSTRING_PTR(keystr);
- key.dsize = (int)RSTRING_LEN(keystr);
+ key.dsize = RSTRING_LENINT(keystr);
val.dptr = RSTRING_PTR(valstr);
- val.dsize = (int)RSTRING_LEN(valstr);
+ val.dsize = RSTRING_LENINT(valstr);
GetDBM2(obj, dbmp, dbm);
dbmp->di_size = -1;
@@ -939,10 +965,13 @@ fgdbm_has_key(VALUE obj, VALUE keystr)
datum key;
struct dbmdata *dbmp;
GDBM_FILE dbm;
+ long len;
StringValue(keystr);
+ len = RSTRING_LENINT(keystr);
+ if (TOO_LONG(len)) return Qfalse;
key.dptr = RSTRING_PTR(keystr);
- key.dsize = (int)RSTRING_LEN(keystr);
+ key.dsize = (int)len;
GetDBM2(obj, dbmp, dbm);
if (gdbm_exists(dbm, key))
@@ -1023,6 +1052,7 @@ fgdbm_reorganize(VALUE obj)
rb_gdbm_modify(obj);
GetDBM2(obj, dbmp, dbm);
gdbm_reorganize(dbm);
+ rb_fd_fix_cloexec(gdbm_fdesc(dbm));
return obj;
}
diff --git a/ext/iconv/charset_alias.rb b/ext/iconv/charset_alias.rb
deleted file mode 100644
index cd567a8e2e..0000000000
--- a/ext/iconv/charset_alias.rb
+++ /dev/null
@@ -1,104 +0,0 @@
-#! /usr/bin/ruby
-# :stopdoc:
-require 'rbconfig'
-require 'optparse'
-
-# http://www.ctan.org/get/macros/texinfo/texinfo/gnulib/lib/config.charset
-# Tue, 25 Dec 2007 00:00:00 GMT
-
-OS = RbConfig::CONFIG["target_os"]
-SHELL = RbConfig::CONFIG['SHELL']
-
-class Hash::Ordered < Hash
- def [](key)
- val = super and val.last
- end
- def []=(key, val)
- ary = fetch(key) {return super(key, [self.size, key, val])} and
- ary << val
- end
- def sort
- values.sort.collect {|i, *rest| rest}
- end
- def each(&block)
- sort.each(&block)
- end
-end
-
-def charset_alias(config_charset, mapfile, target = OS)
- map = Hash::Ordered.new
- comments = []
- open(config_charset) do |input|
- input.find {|line| /^case "\$os" in/ =~ line} or break
- input.find {|line|
- /^\s*([-\w\*]+(?:\s*\|\s*[-\w\*]+)*)(?=\))/ =~ line and
- $&.split('|').any? {|pattern| File.fnmatch?(pattern.strip, target)}
- } or break
- input.find do |line|
- case line
- when /^\s*echo "(?:\$\w+\.)?([-\w*]+)\s+([-\w]+)"/
- sys, can = $1, $2
- can.downcase!
- map[can] = sys
- false
- when /^\s*;;/
- true
- else
- false
- end
- end
- end
- case target
- when /linux|-gnu/
- # map.delete('ascii')
- when /cygwin|os2-emx/
- # get rid of tilde/yen problem.
- map['shift_jis'] = 'cp932'
- end
- st = Hash.new(0)
- map = map.sort.collect do |can, *sys|
- if sys.grep(/^en_us(?=.|$)/i) {break true} == true
- noen = %r"^(?!en_us)\w+_\w+#{Regexp.new($')}$"i #"
- sys.reject! {|s| noen =~ s}
- end
- sys = sys.first
- st[sys] += 1
- [can, sys]
- end
- st.delete_if {|sys, i| i == 1}.empty?
- st.keys.each {|sys| st[sys] = nil}
- st.default = nil
- writer = proc do |f|
- f.puts("require 'iconv.so'")
- f.puts
- f.puts(comments)
- f.puts("class Iconv")
- i = 0
- map.each do |can, sys|
- if s = st[sys]
- sys = s
- elsif st.key?(sys)
- sys = (st[sys] = "sys#{i+=1}") + " = '#{sys}'.freeze"
- else
- sys = "'#{sys}'.freeze"
- end
- f.puts(" charset_map['#{can}'] = #{sys}")
- end
- f.puts("end")
- end
- if mapfile
- open(mapfile, "w", &writer)
- else
- writer[STDOUT]
- end
-end
-
-target = OS
-opt = nil
-ARGV.options do |opt2|
- opt = opt2
- opt.banner << " config.status map.rb"
- opt.on("--target OS") {|t| target = t}
- opt.parse! and (1..2) === ARGV.size
-end or abort opt.to_s
-charset_alias(ARGV[0], ARGV[1], target)
diff --git a/ext/iconv/depend b/ext/iconv/depend
deleted file mode 100644
index ac555596ce..0000000000
--- a/ext/iconv/depend
+++ /dev/null
@@ -1,2 +0,0 @@
-iconv.o: iconv.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h \
- $(hdrdir)/st.h $(hdrdir)/intern.h $(hdrdir)/encoding.h
diff --git a/ext/iconv/extconf.rb b/ext/iconv/extconf.rb
deleted file mode 100644
index c4a57c80d6..0000000000
--- a/ext/iconv/extconf.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-require 'mkmf'
-
-dir_config("iconv")
-
-conf = File.exist?(File.join($srcdir, "config.charset"))
-conf = with_config("config-charset", enable_config("config-charset", conf))
-
-if have_func("iconv", "iconv.h") or
- have_library("iconv", "iconv", "iconv.h")
- check_signedness("size_t")
- if checking_for("const of iconv() 2nd argument") do
- create_tmpsrc(cpp_include("iconv.h") + "---> iconv(cd,0,0,0,0) <---")
- src = xpopen(cpp_command("")) {|f|f.read}
- if !(func = src[/^--->\s*(\w+).*\s*<---/, 1])
- Logging::message "iconv function name not found"
- false
- elsif !(second = src[%r"\b#{func}\s*\(.*?,(.*?),.*?\)\s*;"m, 1])
- Logging::message "prototype for #{func}() not found"
- false
- else
- Logging::message $&+"\n"
- /\bconst\b/ =~ second
- end
- end
- $defs.push('-DICONV_INPTR_CONST')
- end
- have_func("iconvlist", "iconv.h")
- have_func("__iconv_free_list", "iconv.h")
- if conf
- prefix = '$(srcdir)'
- prefix = $nmake ? "{#{prefix}}" : "#{prefix}/"
- if $extout
- wrapper = "$(RUBYARCHDIR)/iconv.rb"
- else
- wrapper = "./iconv.rb"
- $INSTALLFILES = [[wrapper, "$(RUBYARCHDIR)"]]
- end
- if String === conf
- require 'uri'
- scheme = URI.parse(conf).scheme
- else
- conf = "$(srcdir)/config.charset"
- end
- $cleanfiles << wrapper
- end
- create_makefile("iconv")
- if conf
- open("Makefile", "a") do |mf|
- mf.print("\nall: #{wrapper}\n\n#{wrapper}: #{prefix}charset_alias.rb")
- mf.print(" ", conf) unless scheme
- mf.print("\n\t$(RUBY) $(srcdir)/charset_alias.rb #{conf} $@\n")
- end
- end
-end
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
deleted file mode 100644
index 531745c38d..0000000000
--- a/ext/iconv/iconv.c
+++ /dev/null
@@ -1,1256 +0,0 @@
-/* -*- mode:c; c-file-style:"ruby" -*- */
-/**********************************************************************
-
- iconv.c -
-
- $Author$
- created at: Wed Dec 1 20:28:09 JST 1999
-
- All the files in this distribution are covered under the Ruby's
- license (see the file COPYING).
-
- Documentation by Yukihiro Matsumoto and Gavin Sinclair.
-
-**********************************************************************/
-
-#include "ruby/ruby.h"
-#include <errno.h>
-#include <iconv.h>
-#include <assert.h>
-#include "ruby/st.h"
-#include "ruby/encoding.h"
-
-/*
- * Document-class: Iconv
- *
- * == Summary
- *
- * Ruby extension for charset conversion.
- *
- * == Abstract
- *
- * Iconv is a wrapper class for the UNIX 95 <tt>iconv()</tt> function family,
- * which translates string between various encoding systems.
- *
- * See Open Group's on-line documents for more details.
- * * <tt>iconv.h</tt>: http://www.opengroup.org/onlinepubs/007908799/xsh/iconv.h.html
- * * <tt>iconv_open()</tt>: http://www.opengroup.org/onlinepubs/007908799/xsh/iconv_open.html
- * * <tt>iconv()</tt>: http://www.opengroup.org/onlinepubs/007908799/xsh/iconv.html
- * * <tt>iconv_close()</tt>: http://www.opengroup.org/onlinepubs/007908799/xsh/iconv_close.html
- *
- * Which coding systems are available is platform-dependent.
- *
- * == Examples
- *
- * 1. Simple conversion between two charsets.
- *
- * converted_text = Iconv.conv('iso-8859-15', 'utf-8', text)
- *
- * 2. Instantiate a new Iconv and use method Iconv#iconv.
- *
- * cd = Iconv.new(to, from)
- * begin
- * input.each { |s| output << cd.iconv(s) }
- * output << cd.iconv(nil) # Don't forget this!
- * ensure
- * cd.close
- * end
- *
- * 3. Invoke Iconv.open with a block.
- *
- * Iconv.open(to, from) do |cd|
- * input.each { |s| output << cd.iconv(s) }
- * output << cd.iconv(nil)
- * end
- *
- * 4. Shorthand for (3).
- *
- * Iconv.iconv(to, from, *input.to_a)
- *
- * == Attentions
- *
- * Even if some extentions of implementation dependent are useful,
- * DON'T USE those extentions in libraries and scripts to widely distribute.
- * If you want to use those feature, use String#encode.
- */
-
-/* Invalid value for iconv_t is -1 but 0 for VALUE, I hope VALUE is
- big enough to keep iconv_t */
-#define VALUE2ICONV(v) ((iconv_t)((VALUE)(v) ^ -1))
-#define ICONV2VALUE(c) ((VALUE)(c) ^ -1)
-
-struct iconv_env_t
-{
- iconv_t cd;
- int argc;
- VALUE *argv;
- VALUE ret;
- int toidx;
- VALUE (*append)_((VALUE, VALUE));
-};
-
-struct rb_iconv_opt_t
-{
- VALUE transliterate;
- VALUE discard_ilseq;
-};
-
-static ID id_transliterate, id_discard_ilseq;
-
-static VALUE rb_eIconvInvalidEncoding;
-static VALUE rb_eIconvFailure;
-static VALUE rb_eIconvIllegalSeq;
-static VALUE rb_eIconvInvalidChar;
-static VALUE rb_eIconvOutOfRange;
-static VALUE rb_eIconvBrokenLibrary;
-
-static ID rb_success, rb_failed;
-static VALUE iconv_fail _((VALUE error, VALUE success, VALUE failed, struct iconv_env_t* env, const char *mesg));
-static VALUE iconv_fail_retry _((VALUE error, VALUE success, VALUE failed, struct iconv_env_t* env, const char *mesg));
-static VALUE iconv_failure_initialize _((VALUE error, VALUE mesg, VALUE success, VALUE failed));
-static VALUE iconv_failure_success _((VALUE self));
-static VALUE iconv_failure_failed _((VALUE self));
-
-static iconv_t iconv_create _((VALUE to, VALUE from, struct rb_iconv_opt_t *opt, int *idx));
-static void iconv_dfree _((void *cd));
-static VALUE iconv_free _((VALUE cd));
-static VALUE iconv_try _((iconv_t cd, const char **inptr, size_t *inlen, char **outptr, size_t *outlen));
-static VALUE rb_str_derive _((VALUE str, const char* ptr, long len));
-static VALUE iconv_convert _((iconv_t cd, VALUE str, long start, long length, int toidx,
- struct iconv_env_t* env));
-static VALUE iconv_s_allocate _((VALUE klass));
-static VALUE iconv_initialize _((int argc, VALUE *argv, VALUE self));
-static VALUE iconv_s_open _((int argc, VALUE *argv, VALUE self));
-static VALUE iconv_s_convert _((struct iconv_env_t* env));
-static VALUE iconv_s_iconv _((int argc, VALUE *argv, VALUE self));
-static VALUE iconv_init_state _((VALUE cd));
-static VALUE iconv_finish _((VALUE self));
-static VALUE iconv_iconv _((int argc, VALUE *argv, VALUE self));
-static VALUE iconv_conv _((int argc, VALUE *argv, VALUE self));
-
-static VALUE charset_map;
-
-/*
- * Document-method: charset_map
- * call-seq: Iconv.charset_map
- *
- * Returns the map from canonical name to system dependent name.
- */
-static VALUE
-charset_map_get(void)
-{
- return charset_map;
-}
-
-static VALUE
-strip_glibc_option(VALUE *code)
-{
- VALUE val = StringValue(*code);
- const char *ptr = RSTRING_PTR(val), *pend = RSTRING_END(val);
- const char *slash = memchr(ptr, '/', pend - ptr);
-
- if (slash && slash < pend - 1 && slash[1] == '/') {
- VALUE opt = rb_str_subseq(val, slash - ptr, pend - slash);
- val = rb_str_subseq(val, 0, slash - ptr);
- *code = val;
- return opt;
- }
- return 0;
-}
-
-static char *
-map_charset(VALUE *code)
-{
- VALUE val = StringValue(*code);
-
- if (RHASH_SIZE(charset_map)) {
- st_data_t data;
- VALUE key = rb_funcall2(val, rb_intern("downcase"), 0, 0);
- StringValuePtr(key);
- if (st_lookup(RHASH_TBL(charset_map), key, &data)) {
- *code = (VALUE)data;
- }
- }
- return StringValuePtr(*code);
-}
-
-NORETURN(static void rb_iconv_sys_fail(const char *s));
-static void
-rb_iconv_sys_fail(const char *s)
-{
- if (errno == 0) {
- rb_exc_raise(iconv_fail(rb_eIconvBrokenLibrary, Qnil, Qnil, NULL, s));
- }
- rb_sys_fail(s);
-}
-
-#define rb_sys_fail(s) rb_iconv_sys_fail(s)
-
-static iconv_t
-iconv_create(VALUE to, VALUE from, struct rb_iconv_opt_t *opt, int *idx)
-{
- VALUE toopt = strip_glibc_option(&to);
- VALUE fromopt = strip_glibc_option(&from);
- VALUE toenc = 0, fromenc = 0;
- const char* tocode = map_charset(&to);
- const char* fromcode = map_charset(&from);
- iconv_t cd;
- int retry = 0;
-
- *idx = rb_enc_find_index(tocode);
-
- if (toopt) {
- toenc = rb_str_plus(to, toopt);
- tocode = RSTRING_PTR(toenc);
- }
- if (fromopt) {
- fromenc = rb_str_plus(from, fromopt);
- fromcode = RSTRING_PTR(fromenc);
- }
- while ((cd = iconv_open(tocode, fromcode)) == (iconv_t)-1) {
- int inval = 0;
- switch (errno) {
- case EMFILE:
- case ENFILE:
- case ENOMEM:
- if (!retry++) {
- rb_gc();
- continue;
- }
- break;
- case EINVAL:
- retry = 0;
- inval = 1;
- if (toenc) {
- tocode = RSTRING_PTR(to);
- rb_str_resize(toenc, 0);
- toenc = 0;
- continue;
- }
- if (fromenc) {
- fromcode = RSTRING_PTR(from);
- rb_str_resize(fromenc, 0);
- fromenc = 0;
- continue;
- }
- break;
- }
- {
- const char *s = inval ? "invalid encoding " : "iconv";
- volatile VALUE msg = rb_str_new(0, strlen(s) + RSTRING_LEN(to) +
- RSTRING_LEN(from) + 8);
-
- sprintf(RSTRING_PTR(msg), "%s(\"%s\", \"%s\")",
- s, RSTRING_PTR(to), RSTRING_PTR(from));
- s = RSTRING_PTR(msg);
- rb_str_set_len(msg, strlen(s));
- if (!inval) rb_sys_fail(s);
- rb_exc_raise(iconv_fail(rb_eIconvInvalidEncoding, Qnil,
- rb_ary_new3(2, to, from), NULL, s));
- }
- }
-
- if (toopt || fromopt) {
- if (toopt && fromopt && RTEST(rb_str_equal(toopt, fromopt))) {
- fromopt = 0;
- }
- if (toopt && fromopt) {
- rb_warning("encoding option isn't portable: %s, %s",
- RSTRING_PTR(toopt) + 2, RSTRING_PTR(fromopt) + 2);
- }
- else {
- rb_warning("encoding option isn't portable: %s",
- (toopt ? RSTRING_PTR(toopt) : RSTRING_PTR(fromopt)) + 2);
- }
- }
-
- if (opt) {
-#ifdef ICONV_SET_TRANSLITERATE
- if (opt->transliterate != Qundef) {
- int flag = RTEST(opt->transliterate);
- rb_warning("encoding option isn't portable: transliterate");
- if (iconvctl(cd, ICONV_SET_TRANSLITERATE, (void *)&flag))
- rb_sys_fail("ICONV_SET_TRANSLITERATE");
- }
-#endif
-#ifdef ICONV_SET_DISCARD_ILSEQ
- if (opt->discard_ilseq != Qundef) {
- int flag = RTEST(opt->discard_ilseq);
- rb_warning("encoding option isn't portable: discard_ilseq");
- if (iconvctl(cd, ICONV_SET_DISCARD_ILSEQ, (void *)&flag))
- rb_sys_fail("ICONV_SET_DISCARD_ILSEQ");
- }
-#endif
- }
-
- return cd;
-}
-
-static void
-iconv_dfree(void *cd)
-{
- iconv_close(VALUE2ICONV(cd));
-}
-
-#define ICONV_FREE iconv_dfree
-
-static VALUE
-iconv_free(VALUE cd)
-{
- if (cd && iconv_close(VALUE2ICONV(cd)) == -1)
- rb_sys_fail("iconv_close");
- return Qnil;
-}
-
-static VALUE
-check_iconv(VALUE obj)
-{
- Check_Type(obj, T_DATA);
- if (RDATA(obj)->dfree != ICONV_FREE) {
- rb_raise(rb_eArgError, "Iconv expected (%s)", rb_class2name(CLASS_OF(obj)));
- }
- return (VALUE)DATA_PTR(obj);
-}
-
-static VALUE
-iconv_try(iconv_t cd, const char **inptr, size_t *inlen, char **outptr, size_t *outlen)
-{
-#ifdef ICONV_INPTR_CONST
-#define ICONV_INPTR_CAST
-#else
-#define ICONV_INPTR_CAST (char **)
-#endif
- size_t ret;
-
- errno = 0;
- ret = iconv(cd, ICONV_INPTR_CAST inptr, inlen, outptr, outlen);
- if (ret == (size_t)-1) {
- if (!*inlen)
- return Qfalse;
- switch (errno) {
- case E2BIG:
- /* try the left in next loop */
- break;
- case EILSEQ:
- return rb_eIconvIllegalSeq;
- case EINVAL:
- return rb_eIconvInvalidChar;
- case 0:
- return rb_eIconvBrokenLibrary;
- default:
- rb_sys_fail("iconv");
- }
- }
- else if (*inlen > 0) {
- /* something goes wrong */
- return rb_eIconvIllegalSeq;
- }
- else if (ret) {
- return Qnil; /* conversion */
- }
- return Qfalse;
-}
-
-#define FAILED_MAXLEN 16
-
-static VALUE
-iconv_failure_initialize(VALUE error, VALUE mesg, VALUE success, VALUE failed)
-{
- rb_call_super(1, &mesg);
- rb_ivar_set(error, rb_success, success);
- rb_ivar_set(error, rb_failed, failed);
- return error;
-}
-
-static VALUE
-iconv_fail(VALUE error, VALUE success, VALUE failed, struct iconv_env_t* env, const char *mesg)
-{
- VALUE args[3];
-
- if (mesg && *mesg) {
- args[0] = rb_str_new2(mesg);
- }
- else if (TYPE(failed) != T_STRING || RSTRING_LEN(failed) < FAILED_MAXLEN) {
- args[0] = rb_inspect(failed);
- }
- else {
- args[0] = rb_inspect(rb_str_substr(failed, 0, FAILED_MAXLEN));
- rb_str_cat2(args[0], "...");
- }
- args[1] = success;
- args[2] = failed;
- if (env) {
- args[1] = env->append(rb_obj_dup(env->ret), success);
- if (env->argc > 0) {
- *(env->argv) = failed;
- args[2] = rb_ary_new4(env->argc, env->argv);
- }
- }
- return rb_class_new_instance(3, args, error);
-}
-
-static VALUE
-iconv_fail_retry(VALUE error, VALUE success, VALUE failed, struct iconv_env_t* env, const char *mesg)
-{
- error = iconv_fail(error, success, failed, env, mesg);
- if (!rb_block_given_p()) rb_exc_raise(error);
- rb_set_errinfo(error);
- return rb_yield(failed);
-}
-
-static VALUE
-rb_str_derive(VALUE str, const char* ptr, long len)
-{
- VALUE ret;
-
- if (NIL_P(str))
- return rb_str_new(ptr, len);
- if (RSTRING_PTR(str) + RSTRING_LEN(str) == ptr + len)
- ret = rb_str_subseq(str, ptr - RSTRING_PTR(str), len);
- else
- ret = rb_str_new(ptr, len);
- OBJ_INFECT(ret, str);
- return ret;
-}
-
-static VALUE
-iconv_convert(iconv_t cd, VALUE str, long start, long length, int toidx, struct iconv_env_t* env)
-{
- VALUE ret = Qfalse;
- VALUE error = Qfalse;
- VALUE rescue;
- const char *inptr, *instart;
- size_t inlen;
- /* I believe ONE CHARACTER never exceed this. */
- char buffer[BUFSIZ];
- char *outptr;
- size_t outlen;
-
- if (cd == (iconv_t)-1)
- rb_raise(rb_eArgError, "closed iconv");
-
- if (NIL_P(str)) {
- /* Reset output pointer or something. */
- inptr = "";
- inlen = 0;
- outptr = buffer;
- outlen = sizeof(buffer);
- error = iconv_try(cd, &inptr, &inlen, &outptr, &outlen);
- if (RTEST(error)) {
- unsigned int i;
- rescue = iconv_fail_retry(error, Qnil, Qnil, env, 0);
- if (TYPE(rescue) == T_ARRAY) {
- str = RARRAY_LEN(rescue) > 0 ? RARRAY_PTR(rescue)[0] : Qnil;
- }
- if (FIXNUM_P(str) && (i = FIX2INT(str)) <= 0xff) {
- char c = i;
- str = rb_str_new(&c, 1);
- }
- else if (!NIL_P(str)) {
- StringValue(str);
- }
- }
-
- inptr = NULL;
- length = 0;
- }
- else {
- long slen;
-
- StringValue(str);
- slen = RSTRING_LEN(str);
- inptr = RSTRING_PTR(str);
-
- inptr += start;
- if (length < 0 || length > start + slen)
- length = slen - start;
- }
- instart = inptr;
- inlen = length;
-
- do {
- char errmsg[50];
- const char *tmpstart = inptr;
- outptr = buffer;
- outlen = sizeof(buffer);
-
- errmsg[0] = 0;
- error = iconv_try(cd, &inptr, &inlen, &outptr, &outlen);
-
- if (
-#if SIGNEDNESS_OF_SIZE_T < 0
- 0 <= outlen &&
-#endif
- outlen <= sizeof(buffer)) {
- outlen = sizeof(buffer) - outlen;
- if (NIL_P(error) || /* something converted */
- outlen > (size_t)(inptr - tmpstart) || /* input can't contain output */
- (outlen < (size_t)(inptr - tmpstart) && inlen > 0) || /* something skipped */
- memcmp(buffer, tmpstart, outlen)) /* something differs */
- {
- if (NIL_P(str)) {
- ret = rb_str_new(buffer, outlen);
- if (toidx >= 0) rb_enc_associate_index(ret, toidx);
- }
- else {
- if (ret) {
- ret = rb_str_buf_cat(ret, instart, tmpstart - instart);
- }
- else {
- ret = rb_str_new(instart, tmpstart - instart);
- if (toidx >= 0) rb_enc_associate_index(ret, toidx);
- OBJ_INFECT(ret, str);
- }
- ret = rb_str_buf_cat(ret, buffer, outlen);
- instart = inptr;
- }
- }
- else if (!inlen) {
- inptr = tmpstart + outlen;
- }
- }
- else {
- /* Some iconv() have a bug, return *outlen out of range */
- sprintf(errmsg, "bug?(output length = %ld)", (long)(sizeof(buffer) - outlen));
- error = rb_eIconvOutOfRange;
- }
-
- if (RTEST(error)) {
- long len = 0;
-
- if (!ret) {
- ret = rb_str_derive(str, instart, inptr - instart);
- if (toidx >= 0) rb_enc_associate_index(ret, toidx);
- }
- else if (inptr > instart) {
- rb_str_cat(ret, instart, inptr - instart);
- }
- str = rb_str_derive(str, inptr, inlen);
- rescue = iconv_fail_retry(error, ret, str, env, errmsg);
- if (TYPE(rescue) == T_ARRAY) {
- if ((len = RARRAY_LEN(rescue)) > 0)
- rb_str_concat(ret, RARRAY_PTR(rescue)[0]);
- if (len > 1 && !NIL_P(str = RARRAY_PTR(rescue)[1])) {
- StringValue(str);
- inlen = length = RSTRING_LEN(str);
- instart = inptr = RSTRING_PTR(str);
- continue;
- }
- }
- else if (!NIL_P(rescue)) {
- rb_str_concat(ret, rescue);
- }
- break;
- }
- } while (inlen > 0);
-
- if (!ret) {
- ret = rb_str_derive(str, instart, inptr - instart);
- if (toidx >= 0) rb_enc_associate_index(ret, toidx);
- }
- else if (inptr > instart) {
- rb_str_cat(ret, instart, inptr - instart);
- }
- return ret;
-}
-
-static VALUE
-iconv_s_allocate(VALUE klass)
-{
- return Data_Wrap_Struct(klass, 0, ICONV_FREE, 0);
-}
-
-static VALUE
-get_iconv_opt_i(VALUE i, VALUE arg)
-{
- struct rb_iconv_opt_t *opt = (struct rb_iconv_opt_t *)arg;
- VALUE name, val;
-
- (void)opt;
- i = rb_Array(i);
- name = rb_ary_entry(i, 0);
- val = rb_ary_entry(i, 1);
- do {
- if (SYMBOL_P(name)) {
- ID id = SYM2ID(name);
- if (id == id_transliterate) {
-#ifdef ICONV_SET_TRANSLITERATE
- opt->transliterate = val;
-#else
- rb_notimplement();
-#endif
- break;
- }
- if (id == id_discard_ilseq) {
-#ifdef ICONV_SET_DISCARD_ILSEQ
- opt->discard_ilseq = val;
-#else
- rb_notimplement();
-#endif
- break;
- }
- }
- else {
- const char *s = StringValueCStr(name);
- if (strcmp(s, "transliterate") == 0) {
-#ifdef ICONV_SET_TRANSLITERATE
- opt->transliterate = val;
-#else
- rb_notimplement();
-#endif
- break;
- }
- if (strcmp(s, "discard_ilseq") == 0) {
-#ifdef ICONV_SET_DISCARD_ILSEQ
- opt->discard_ilseq = val;
-#else
- rb_notimplement();
-#endif
- break;
- }
- }
- name = rb_inspect(name);
- rb_raise(rb_eArgError, "unknown option - %s", StringValueCStr(name));
- } while (0);
- return Qnil;
-}
-
-static void
-get_iconv_opt(struct rb_iconv_opt_t *opt, VALUE options)
-{
- opt->transliterate = Qundef;
- opt->discard_ilseq = Qundef;
- if (!NIL_P(options)) {
- rb_block_call(options, rb_intern("each"), 0, 0, get_iconv_opt_i, (VALUE)opt);
- }
-}
-
-#define iconv_ctl(self, func, val) (\
- iconvctl(VALUE2ICONV(check_iconv(self)), func, (void *)&(val)) ? \
- rb_sys_fail(#func) : (void)0)
-
-/*
- * Document-method: new
- * call-seq: Iconv.new(to, from, [options])
- *
- * Creates new code converter from a coding-system designated with +from+
- * to another one designated with +to+.
- *
- * === Parameters
- *
- * +to+:: encoding name for destination
- * +from+:: encoding name for source
- * +options+:: options for converter
- *
- * === Exceptions
- *
- * TypeError:: if +to+ or +from+ aren't String
- * InvalidEncoding:: if designated converter couldn't find out
- * SystemCallError:: if <tt>iconv_open(3)</tt> fails
- */
-static VALUE
-iconv_initialize(int argc, VALUE *argv, VALUE self)
-{
- VALUE to, from, options;
- struct rb_iconv_opt_t opt;
- int idx;
-
- rb_scan_args(argc, argv, "21", &to, &from, &options);
- get_iconv_opt(&opt, options);
- iconv_free(check_iconv(self));
- DATA_PTR(self) = NULL;
- DATA_PTR(self) = (void *)ICONV2VALUE(iconv_create(to, from, &opt, &idx));
- if (idx >= 0) ENCODING_SET(self, idx);
- return self;
-}
-
-/*
- * Document-method: open
- * call-seq: Iconv.open(to, from) { |iconv| ... }
- *
- * Equivalent to Iconv.new except that when it is called with a block, it
- * yields with the new instance and closes it, and returns the result which
- * returned from the block.
- */
-static VALUE
-iconv_s_open(int argc, VALUE *argv, VALUE self)
-{
- VALUE to, from, options, cd;
- struct rb_iconv_opt_t opt;
- int idx;
-
- rb_scan_args(argc, argv, "21", &to, &from, &options);
- get_iconv_opt(&opt, options);
- cd = ICONV2VALUE(iconv_create(to, from, &opt, &idx));
-
- self = Data_Wrap_Struct(self, NULL, ICONV_FREE, (void *)cd);
- if (idx >= 0) ENCODING_SET(self, idx);
-
- if (rb_block_given_p()) {
- return rb_ensure(rb_yield, self, (VALUE(*)())iconv_finish, self);
- }
- else {
- return self;
- }
-}
-
-static VALUE
-iconv_s_convert(struct iconv_env_t* env)
-{
- VALUE last = 0;
-
- for (; env->argc > 0; --env->argc, ++env->argv) {
- VALUE s = iconv_convert(env->cd, last = *(env->argv),
- 0, -1, env->toidx, env);
- env->append(env->ret, s);
- }
-
- if (!NIL_P(last)) {
- VALUE s = iconv_convert(env->cd, Qnil, 0, 0, env->toidx, env);
- if (RSTRING_LEN(s))
- env->append(env->ret, s);
- }
-
- return env->ret;
-}
-
-/*
- * Document-method: Iconv::iconv
- * call-seq: Iconv.iconv(to, from, *strs)
- *
- * Shorthand for
- * Iconv.open(to, from) { |cd|
- * (strs + [nil]).collect { |s| cd.iconv(s) }
- * }
- *
- * === Parameters
- *
- * <tt>to, from</tt>:: see Iconv.new
- * <tt>strs</tt>:: strings to be converted
- *
- * === Exceptions
- *
- * Exceptions thrown by Iconv.new, Iconv.open and Iconv#iconv.
- */
-static VALUE
-iconv_s_iconv(int argc, VALUE *argv, VALUE self)
-{
- struct iconv_env_t arg;
-
- if (argc < 2) /* needs `to' and `from' arguments at least */
- rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", argc, 2);
-
- arg.argc = argc -= 2;
- arg.argv = argv + 2;
- arg.append = rb_ary_push;
- arg.ret = rb_ary_new2(argc);
- arg.cd = iconv_create(argv[0], argv[1], NULL, &arg.toidx);
- return rb_ensure(iconv_s_convert, (VALUE)&arg, iconv_free, ICONV2VALUE(arg.cd));
-}
-
-/*
- * Document-method: Iconv::conv
- * call-seq: Iconv.conv(to, from, str)
- *
- * Shorthand for
- * Iconv.iconv(to, from, str).join
- * See Iconv.iconv.
- */
-static VALUE
-iconv_s_conv(VALUE self, VALUE to, VALUE from, VALUE str)
-{
- struct iconv_env_t arg;
-
- arg.argc = 1;
- arg.argv = &str;
- arg.append = rb_str_append;
- arg.ret = rb_str_new(0, 0);
- arg.cd = iconv_create(to, from, NULL, &arg.toidx);
- return rb_ensure(iconv_s_convert, (VALUE)&arg, iconv_free, ICONV2VALUE(arg.cd));
-}
-
-/*
- * Document-method: list
- * call-seq: Iconv.list {|*aliases| ... }
- *
- * Iterates each alias sets.
- */
-
-#ifdef HAVE_ICONVLIST
-struct iconv_name_list
-{
- unsigned int namescount;
- const char *const *names;
- VALUE array;
-};
-
-static VALUE
-list_iconv_i(VALUE ptr)
-{
- struct iconv_name_list *p = (struct iconv_name_list *)ptr;
- unsigned int i, namescount = p->namescount;
- const char *const *names = p->names;
- VALUE ary = rb_ary_new2(namescount);
-
- for (i = 0; i < namescount; i++) {
- rb_ary_push(ary, rb_str_new2(names[i]));
- }
- if (p->array) {
- return rb_ary_push(p->array, ary);
- }
- return rb_yield(ary);
-}
-
-static int
-list_iconv(unsigned int namescount, const char *const *names, void *data)
-{
- int *state = data;
- struct iconv_name_list list;
-
- list.namescount = namescount;
- list.names = names;
- list.array = ((VALUE *)data)[1];
- rb_protect(list_iconv_i, (VALUE)&list, state);
- return *state;
-}
-#endif
-
-#if defined(HAVE_ICONVLIST) || defined(HAVE___ICONV_FREE_LIST)
-static VALUE
-iconv_s_list(void)
-{
-#ifdef HAVE_ICONVLIST
- int state;
- VALUE args[2];
-
- args[1] = rb_block_given_p() ? 0 : rb_ary_new();
- iconvlist(list_iconv, args);
- state = *(int *)args;
- if (state) rb_jump_tag(state);
- if (args[1]) return args[1];
-#elif defined(HAVE___ICONV_FREE_LIST)
- char **list;
- size_t sz, i;
- VALUE ary;
-
- if (__iconv_get_list(&list, &sz)) return Qnil;
-
- ary = rb_ary_new2(sz);
- for (i = 0; i < sz; i++) {
- rb_ary_push(ary, rb_str_new2(list[i]));
- }
- __iconv_free_list(list, sz);
-
- if (!rb_block_given_p())
- return ary;
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- rb_yield(RARRAY_PTR(ary)[i]);
- }
-#endif
- return Qnil;
-}
-#else
-#define iconv_s_list rb_f_notimplement
-#endif
-
-/*
- * Document-method: close
- *
- * Finishes conversion.
- *
- * After calling this, calling Iconv#iconv will cause an exception, but
- * multiple calls of #close are guaranteed to end successfully.
- *
- * Returns a string containing the byte sequence to change the output buffer to
- * its initial shift state.
- */
-static VALUE
-iconv_init_state(VALUE self)
-{
- iconv_t cd = VALUE2ICONV((VALUE)DATA_PTR(self));
- DATA_PTR(self) = NULL;
- return iconv_convert(cd, Qnil, 0, 0, ENCODING_GET(self), NULL);
-}
-
-static VALUE
-iconv_finish(VALUE self)
-{
- VALUE cd = check_iconv(self);
-
- if (!cd) return Qnil;
- return rb_ensure(iconv_init_state, self, iconv_free, cd);
-}
-
-/*
- * Document-method: Iconv#iconv
- * call-seq: iconv(str, start=0, length=-1)
- *
- * Converts string and returns the result.
- * * If +str+ is a String, converts <tt>str[start, length]</tt> and returns the converted string.
- * * If +str+ is +nil+, places converter itself into initial shift state and
- * just returns a string containing the byte sequence to change the output
- * buffer to its initial shift state.
- * * Otherwise, raises an exception.
- *
- * === Parameters
- *
- * str:: string to be converted, or nil
- * start:: starting offset
- * length:: conversion length; nil or -1 means whole the string from start
- *
- * === Exceptions
- *
- * * IconvIllegalSequence
- * * IconvInvalidCharacter
- * * IconvOutOfRange
- *
- * === Examples
- *
- * See the Iconv documentation.
- */
-static VALUE
-iconv_iconv(int argc, VALUE *argv, VALUE self)
-{
- VALUE str, n1, n2;
- VALUE cd = check_iconv(self);
- long start = 0, length = 0, slen = 0;
-
- rb_scan_args(argc, argv, "12", &str, &n1, &n2);
- if (!NIL_P(str)) {
- VALUE n = rb_str_length(StringValue(str));
- slen = NUM2LONG(n);
- }
- if (argc != 2 || !RTEST(rb_range_beg_len(n1, &start, &length, slen, 0))) {
- if (NIL_P(n1) || ((start = NUM2LONG(n1)) < 0 ? (start += slen) >= 0 : start < slen)) {
- length = NIL_P(n2) ? -1 : NUM2LONG(n2);
- }
- }
- if (start > 0 || length > 0) {
- rb_encoding *enc = rb_enc_get(str);
- const char *s = RSTRING_PTR(str), *e = s + RSTRING_LEN(str);
- const char *ps = s;
- if (start > 0) {
- start = (ps = rb_enc_nth(s, e, start, enc)) - s;
- }
- if (length > 0) {
- length = rb_enc_nth(ps, e, length, enc) - ps;
- }
- }
-
- return iconv_convert(VALUE2ICONV(cd), str, start, length, ENCODING_GET(self), NULL);
-}
-
-/*
- * Document-method: conv
- * call-seq: conv(str...)
- *
- * Equivalent to
- *
- * iconv(nil, str..., nil).join
- */
-static VALUE
-iconv_conv(int argc, VALUE *argv, VALUE self)
-{
- iconv_t cd = VALUE2ICONV(check_iconv(self));
- VALUE str, s;
- int toidx = ENCODING_GET(self);
-
- str = iconv_convert(cd, Qnil, 0, 0, toidx, NULL);
- if (argc > 0) {
- do {
- s = iconv_convert(cd, *argv++, 0, -1, toidx, NULL);
- if (RSTRING_LEN(s))
- rb_str_buf_append(str, s);
- } while (--argc);
- s = iconv_convert(cd, Qnil, 0, 0, toidx, NULL);
- if (RSTRING_LEN(s))
- rb_str_buf_append(str, s);
- }
-
- return str;
-}
-
-#ifdef ICONV_TRIVIALP
-/*
- * Document-method: trivial?
- * call-seq: trivial?
- *
- * Returns trivial flag.
- */
-static VALUE
-iconv_trivialp(VALUE self)
-{
- int trivial = 0;
- iconv_ctl(self, ICONV_TRIVIALP, trivial);
- if (trivial) return Qtrue;
- return Qfalse;
-}
-#else
-#define iconv_trivialp rb_f_notimplement
-#endif
-
-#ifdef ICONV_GET_TRANSLITERATE
-/*
- * Document-method: transliterate?
- * call-seq: transliterate?
- *
- * Returns transliterate flag.
- */
-static VALUE
-iconv_get_transliterate(VALUE self)
-{
- int trans = 0;
- iconv_ctl(self, ICONV_GET_TRANSLITERATE, trans);
- if (trans) return Qtrue;
- return Qfalse;
-}
-#else
-#define iconv_get_transliterate rb_f_notimplement
-#endif
-
-#ifdef ICONV_SET_TRANSLITERATE
-/*
- * Document-method: transliterate=
- * call-seq: cd.transliterate = flag
- *
- * Sets transliterate flag.
- */
-static VALUE
-iconv_set_transliterate(VALUE self, VALUE transliterate)
-{
- int trans = RTEST(transliterate);
- iconv_ctl(self, ICONV_SET_TRANSLITERATE, trans);
- return self;
-}
-#else
-#define iconv_set_transliterate rb_f_notimplement
-#endif
-
-#ifdef ICONV_GET_DISCARD_ILSEQ
-/*
- * Document-method: discard_ilseq?
- * call-seq: discard_ilseq?
- *
- * Returns discard_ilseq flag.
- */
-static VALUE
-iconv_get_discard_ilseq(VALUE self)
-{
- int dis = 0;
- iconv_ctl(self, ICONV_GET_DISCARD_ILSEQ, dis);
- if (dis) return Qtrue;
- return Qfalse;
-}
-#else
-#define iconv_get_discard_ilseq rb_f_notimplement
-#endif
-
-#ifdef ICONV_SET_DISCARD_ILSEQ
-/*
- * Document-method: discard_ilseq=
- * call-seq: cd.discard_ilseq = flag
- *
- * Sets discard_ilseq flag.
- */
-static VALUE
-iconv_set_discard_ilseq(VALUE self, VALUE discard_ilseq)
-{
- int dis = RTEST(discard_ilseq);
- iconv_ctl(self, ICONV_SET_DISCARD_ILSEQ, dis);
- return self;
-}
-#else
-#define iconv_set_discard_ilseq rb_f_notimplement
-#endif
-
-/*
- * Document-method: ctlmethods
- * call-seq: Iconv.ctlmethods => array
- *
- * Returns available iconvctl() method list.
- */
-static VALUE
-iconv_s_ctlmethods(VALUE klass)
-{
- VALUE ary = rb_ary_new();
-#ifdef ICONV_TRIVIALP
- rb_ary_push(ary, ID2SYM(rb_intern("trivial?")));
-#endif
-#ifdef ICONV_GET_TRANSLITERATE
- rb_ary_push(ary, ID2SYM(rb_intern("transliterate?")));
-#endif
-#ifdef ICONV_SET_TRANSLITERATE
- rb_ary_push(ary, ID2SYM(rb_intern("transliterate=")));
-#endif
-#ifdef ICONV_GET_DISCARD_ILSEQ
- rb_ary_push(ary, ID2SYM(rb_intern("discard_ilseq?")));
-#endif
-#ifdef ICONV_SET_DISCARD_ILSEQ
- rb_ary_push(ary, ID2SYM(rb_intern("discard_ilseq=")));
-#endif
- return ary;
-}
-
-/*
- * Document-class: Iconv::Failure
- *
- * Base attributes for Iconv exceptions.
- */
-
-/*
- * Document-method: success
- * call-seq: success
- *
- * Returns string(s) translated successfully until the exception occurred.
- * * In the case of failure occurred within Iconv.iconv, returned
- * value is an array of strings translated successfully preceding
- * failure and the last element is string on the way.
- */
-static VALUE
-iconv_failure_success(VALUE self)
-{
- return rb_attr_get(self, rb_success);
-}
-
-/*
- * Document-method: failed
- * call-seq: failed
- *
- * Returns substring of the original string passed to Iconv that starts at the
- * character caused the exception.
- */
-static VALUE
-iconv_failure_failed(VALUE self)
-{
- return rb_attr_get(self, rb_failed);
-}
-
-/*
- * Document-method: inspect
- * call-seq: inspect
- *
- * Returns inspected string like as: #<_class_: _success_, _failed_>
- */
-static VALUE
-iconv_failure_inspect(VALUE self)
-{
- const char *cname = rb_class2name(CLASS_OF(self));
- VALUE success = rb_attr_get(self, rb_success);
- VALUE failed = rb_attr_get(self, rb_failed);
- VALUE str = rb_str_buf_cat2(rb_str_new2("#<"), cname);
- str = rb_str_buf_cat(str, ": ", 2);
- str = rb_str_buf_append(str, rb_inspect(success));
- str = rb_str_buf_cat(str, ", ", 2);
- str = rb_str_buf_append(str, rb_inspect(failed));
- return rb_str_buf_cat(str, ">", 1);
-}
-
-/*
- * Document-class: Iconv::InvalidEncoding
- *
- * Requested coding-system is not available on this system.
- */
-
-/*
- * Document-class: Iconv::IllegalSequence
- *
- * Input conversion stopped due to an input byte that does not belong to
- * the input codeset, or the output codeset does not contain the
- * character.
- */
-
-/*
- * Document-class: Iconv::InvalidCharacter
- *
- * Input conversion stopped due to an incomplete character or shift
- * sequence at the end of the input buffer.
- */
-
-/*
- * Document-class: Iconv::OutOfRange
- *
- * Iconv library internal error. Must not occur.
- */
-
-/*
- * Document-class: Iconv::BrokenLibrary
- *
- * Detected a bug of underlying iconv(3) libray.
- * * returns an error without setting errno properly
- */
-
-static void
-warn_deprecated(void)
-{
- static const char message[] =
- ": iconv will be deprecated in the future, use String#encode instead.\n";
- VALUE msg = Qnil, caller = rb_make_backtrace();
- long i;
-
- for (i = 1; i < RARRAY_LEN(caller); ++i) {
- VALUE s = RARRAY_PTR(caller)[i];
- if (strncmp(RSTRING_PTR(s), "<internal:", 10) != 0) {
- msg = s;
- break;
- }
- }
- if (NIL_P(msg)) {
- msg = rb_str_new_cstr(message + 2);
- }
- else {
- rb_str_cat(msg, message, sizeof(message) - 1);
- }
- rb_io_puts(1, &msg, rb_stderr);
-}
-
-void
-Init_iconv(void)
-{
- VALUE rb_cIconv = rb_define_class("Iconv", rb_cData);
-
- if (!NIL_P(ruby_verbose)) {
- warn_deprecated();
- }
- rb_define_alloc_func(rb_cIconv, iconv_s_allocate);
- rb_define_singleton_method(rb_cIconv, "open", iconv_s_open, -1);
- rb_define_singleton_method(rb_cIconv, "iconv", iconv_s_iconv, -1);
- rb_define_singleton_method(rb_cIconv, "conv", iconv_s_conv, 3);
- rb_define_singleton_method(rb_cIconv, "list", iconv_s_list, 0);
- rb_define_singleton_method(rb_cIconv, "ctlmethods", iconv_s_ctlmethods, 0);
- rb_define_method(rb_cIconv, "initialize", iconv_initialize, -1);
- rb_define_method(rb_cIconv, "close", iconv_finish, 0);
- rb_define_method(rb_cIconv, "iconv", iconv_iconv, -1);
- rb_define_method(rb_cIconv, "conv", iconv_conv, -1);
- rb_define_method(rb_cIconv, "trivial?", iconv_trivialp, 0);
- rb_define_method(rb_cIconv, "transliterate?", iconv_get_transliterate, 0);
- rb_define_method(rb_cIconv, "transliterate=", iconv_set_transliterate, 1);
- rb_define_method(rb_cIconv, "discard_ilseq?", iconv_get_discard_ilseq, 0);
- rb_define_method(rb_cIconv, "discard_ilseq=", iconv_set_discard_ilseq, 1);
-
- rb_eIconvFailure = rb_define_module_under(rb_cIconv, "Failure");
- rb_define_method(rb_eIconvFailure, "initialize", iconv_failure_initialize, 3);
- rb_define_method(rb_eIconvFailure, "success", iconv_failure_success, 0);
- rb_define_method(rb_eIconvFailure, "failed", iconv_failure_failed, 0);
- rb_define_method(rb_eIconvFailure, "inspect", iconv_failure_inspect, 0);
-
- rb_eIconvInvalidEncoding = rb_define_class_under(rb_cIconv, "InvalidEncoding", rb_eArgError);
- rb_eIconvIllegalSeq = rb_define_class_under(rb_cIconv, "IllegalSequence", rb_eArgError);
- rb_eIconvInvalidChar = rb_define_class_under(rb_cIconv, "InvalidCharacter", rb_eArgError);
- rb_eIconvOutOfRange = rb_define_class_under(rb_cIconv, "OutOfRange", rb_eRuntimeError);
- rb_eIconvBrokenLibrary = rb_define_class_under(rb_cIconv, "BrokenLibrary", rb_eRuntimeError);
- rb_include_module(rb_eIconvInvalidEncoding, rb_eIconvFailure);
- rb_include_module(rb_eIconvIllegalSeq, rb_eIconvFailure);
- rb_include_module(rb_eIconvInvalidChar, rb_eIconvFailure);
- rb_include_module(rb_eIconvOutOfRange, rb_eIconvFailure);
- rb_include_module(rb_eIconvBrokenLibrary, rb_eIconvFailure);
-
- rb_success = rb_intern("success");
- rb_failed = rb_intern("failed");
- id_transliterate = rb_intern("transliterate");
- id_discard_ilseq = rb_intern("discard_ilseq");
-
- rb_gc_register_address(&charset_map);
- charset_map = rb_hash_new();
- rb_define_singleton_method(rb_cIconv, "charset_map", charset_map_get, 0);
-}
-
diff --git a/ext/iconv/mkwrapper.rb b/ext/iconv/mkwrapper.rb
deleted file mode 100644
index 44d5fcf194..0000000000
--- a/ext/iconv/mkwrapper.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-#! /usr/bin/ruby
-require 'rbconfig'
-require 'optparse'
-
-# http://www.ctan.org/get/macros/texinfo/texinfo/gnulib/lib/config.charset
-# Tue, 25 Dec 2007 00:00:00 GMT
-
-HEADER = <<SRC
-require 'iconv.so'
-
-class Iconv
- case RUBY_PLATFORM
-SRC
-
-def charset_alias(config_charset, mapfile = nil)
- found = nil
- src = [HEADER]
- open(config_charset) do |input|
- input.find {|line| /^case "\$os" in/ =~ line} or return
- input.each do |line|
- case line
- when /^\s*([-\w\*]+(?:\s*\|\s*[-\w\*]+)*)(?=\))/
- (s = " when ") << $&.split('|').collect {|targ|
- targ.strip!
- tail = targ.chomp!("*") ? '' : '\z'
- head = targ.slice!(/\A\*/) ? '' : '\A'
- targ.gsub!(/\*/, '.*')
- "/#{head}#{targ}#{tail}/"
- }.join(", ")
- src << s
- found = {}
- when /^\s*echo "(?:\$\w+\.)?([-\w*]+)\s+([-\w]+)"/
- sys, can = $1, $2
- can.downcase!
- unless found[can] or (/\Aen_(?!US\z)/ =~ sys && /\ACP437\z/i =~ can)
- found[can] = true
- src << " charset_map['#{can}'] = '#{sys}'.freeze"
- end
- when /^\s*;;/
- found = nil
- end
- end
- end
- src << " end" << "end"
- if mapfile
- open(mapfile, "wb") {|f| f.puts(*src)}
- else
- puts(*src)
- end
-end
-
-(1..2) === ARGV.size or abort "usage: #{$0} config_charset [mapfile]"
-charset_alias(*ARGV)
diff --git a/ext/io/console/console.c b/ext/io/console/console.c
index 87101fea5e..cedc057bb3 100644
--- a/ext/io/console/console.c
+++ b/ext/io/console/console.c
@@ -91,16 +91,45 @@ getattr(int fd, conmode *t)
static ID id_getc, id_console;
+typedef struct {
+ int vmin;
+ int vtime;
+} rawmode_arg_t;
+
+static rawmode_arg_t *
+rawmode_opt(int argc, VALUE *argv, rawmode_arg_t *opts)
+{
+ rawmode_arg_t *optp = NULL;
+ VALUE vopts;
+ rb_scan_args(argc, argv, "0:", &vopts);
+ if (!NIL_P(vopts)) {
+ VALUE vmin = rb_hash_aref(vopts, ID2SYM(rb_intern("min")));
+ VALUE vtime = rb_hash_aref(vopts, ID2SYM(rb_intern("time")));
+ VALUE v10 = INT2FIX(10);
+ if (!NIL_P(vmin)) {
+ vmin = rb_funcall3(vmin, '*', 1, &v10);
+ opts->vmin = NUM2INT(vmin);
+ optp = opts;
+ }
+ if (!NIL_P(vtime)) {
+ vtime = rb_funcall3(vtime, '*', 1, &v10);
+ opts->vtime = NUM2INT(vtime);
+ optp = opts;
+ }
+ }
+ return optp;
+}
+
static void
-set_rawmode(conmode *t)
+set_rawmode(conmode *t, void *arg)
{
#ifdef HAVE_CFMAKERAW
cfmakeraw(t);
-#else
-#if defined HAVE_TERMIOS_H || defined HAVE_TERMIO_H
+ t->c_lflag &= ~(ECHOE|ECHOK);
+#elif defined HAVE_TERMIOS_H || defined HAVE_TERMIO_H
t->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
t->c_oflag &= ~OPOST;
- t->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
+ t->c_lflag &= ~(ECHO|ECHOE|ECHOK|ECHONL|ICANON|ISIG|IEXTEN);
t->c_cflag &= ~(CSIZE|PARENB);
t->c_cflag |= CS8;
#elif defined HAVE_SGTTY_H
@@ -109,11 +138,32 @@ set_rawmode(conmode *t)
#elif defined _WIN32
*t = 0;
#endif
+#if defined HAVE_TERMIOS_H || defined HAVE_TERMIO_H
+ if (arg) {
+ const rawmode_arg_t *r = arg;
+ if (r->vmin >= 0) t->c_cc[VMIN] = r->vmin;
+ if (r->vtime >= 0) t->c_cc[VTIME] = r->vtime;
+ }
+#endif
+}
+
+static void
+set_cookedmode(conmode *t, void *arg)
+{
+#if defined HAVE_TERMIOS_H || defined HAVE_TERMIO_H
+ t->c_iflag |= (BRKINT|ISTRIP|ICRNL|IXON);
+ t->c_oflag |= OPOST;
+ t->c_lflag |= (ECHO|ECHOE|ECHOK|ECHONL|ICANON|ISIG|IEXTEN);
+#elif defined HAVE_SGTTY_H
+ t->sg_flags |= ECHO;
+ t->sg_flags &= ~RAW;
+#elif defined _WIN32
+ *t |= ENABLE_ECHO_INPUT|ENABLE_LINE_INPUT|ENABLE_PROCESSED_INPUT;
#endif
}
static void
-set_noecho(conmode *t)
+set_noecho(conmode *t, void *arg)
{
#if defined HAVE_TERMIOS_H || defined HAVE_TERMIO_H
t->c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
@@ -125,7 +175,7 @@ set_noecho(conmode *t)
}
static void
-set_echo(conmode *t)
+set_echo(conmode *t, void *arg)
{
#if defined HAVE_TERMIOS_H || defined HAVE_TERMIO_H
t->c_lflag |= (ECHO | ECHOE | ECHOK | ECHONL);
@@ -140,7 +190,7 @@ static int
echo_p(conmode *t)
{
#if defined HAVE_TERMIOS_H || defined HAVE_TERMIO_H
- return (t->c_lflag & (ECHO | ECHOE | ECHOK | ECHONL)) != 0;
+ return (t->c_lflag & (ECHO | ECHONL)) != 0;
#elif defined HAVE_SGTTY_H
return (t->sg_flags & ECHO) != 0;
#elif defined _WIN32
@@ -149,12 +199,12 @@ echo_p(conmode *t)
}
static int
-set_ttymode(int fd, conmode *t, void (*setter)(conmode *))
+set_ttymode(int fd, conmode *t, void (*setter)(conmode *, void *), void *arg)
{
conmode r;
if (!getattr(fd, t)) return 0;
r = *t;
- setter(&r);
+ setter(&r, arg);
return setattr(fd, &r);
}
@@ -182,7 +232,7 @@ get_write_fd(const rb_io_t *fptr)
#define FD_PER_IO 2
static VALUE
-ttymode(VALUE io, VALUE (*func)(VALUE), void (*setter)(conmode *))
+ttymode(VALUE io, VALUE (*func)(VALUE), void (*setter)(conmode *, void *), void *arg)
{
rb_io_t *fptr;
int status = -1;
@@ -194,7 +244,7 @@ ttymode(VALUE io, VALUE (*func)(VALUE), void (*setter)(conmode *))
GetOpenFile(io, fptr);
fd[0] = GetReadFD(fptr);
if (fd[0] != -1) {
- if (set_ttymode(fd[0], t+0, setter)) {
+ if (set_ttymode(fd[0], t+0, setter, arg)) {
status = 0;
}
else {
@@ -204,7 +254,7 @@ ttymode(VALUE io, VALUE (*func)(VALUE), void (*setter)(conmode *))
}
fd[1] = GetWriteFD(fptr);
if (fd[1] != -1 && fd[1] != fd[0]) {
- if (set_ttymode(fd[1], t+1, setter)) {
+ if (set_ttymode(fd[1], t+1, setter, arg)) {
status = 0;
}
else {
@@ -240,30 +290,79 @@ ttymode(VALUE io, VALUE (*func)(VALUE), void (*setter)(conmode *))
/*
* call-seq:
- * io.raw {|io| }
+ * io.raw(min: nil, time: nil) {|io| }
*
* Yields +self+ within raw mode.
*
* STDIN.raw(&:gets)
*
- * will read and return a line with echo back and line editing.
+ * will read and return a line without echo back and line editing.
+ *
+ * You must require 'io/console' to use this method.
*/
static VALUE
-console_raw(VALUE io)
+console_raw(int argc, VALUE *argv, VALUE io)
{
- return ttymode(io, rb_yield, set_rawmode);
+ rawmode_arg_t opts, *optp = rawmode_opt(argc, argv, &opts);
+ return ttymode(io, rb_yield, set_rawmode, optp);
}
/*
* call-seq:
- * io.raw!
+ * io.raw!(min: nil, time: nil)
*
* Enables raw mode.
*
* If the terminal mode needs to be back, use io.raw { ... }.
+ *
+ * You must require 'io/console' to use this method.
+ */
+static VALUE
+console_set_raw(int argc, VALUE *argv, VALUE io)
+{
+ conmode t;
+ rb_io_t *fptr;
+ int fd;
+ rawmode_arg_t opts, *optp = rawmode_opt(argc, argv, &opts);
+
+ GetOpenFile(io, fptr);
+ fd = GetReadFD(fptr);
+ if (!getattr(fd, &t)) rb_sys_fail(0);
+ set_rawmode(&t, optp);
+ if (!setattr(fd, &t)) rb_sys_fail(0);
+ return io;
+}
+
+/*
+ * call-seq:
+ * io.cooked {|io| }
+ *
+ * Yields +self+ within cooked mode.
+ *
+ * STDIN.cooked(&:gets)
+ *
+ * will read and return a line with echo back and line editing.
+ *
+ * You must require 'io/console' to use this method.
+ */
+static VALUE
+console_cooked(VALUE io)
+{
+ return ttymode(io, rb_yield, set_cookedmode, NULL);
+}
+
+/*
+ * call-seq:
+ * io.cooked!
+ *
+ * Enables cooked mode.
+ *
+ * If the terminal mode needs to be back, use io.cooked { ... }.
+ *
+ * You must require 'io/console' to use this method.
*/
static VALUE
-console_set_raw(VALUE io)
+console_set_cooked(VALUE io)
{
conmode t;
rb_io_t *fptr;
@@ -272,7 +371,7 @@ console_set_raw(VALUE io)
GetOpenFile(io, fptr);
fd = GetReadFD(fptr);
if (!getattr(fd, &t)) rb_sys_fail(0);
- set_rawmode(&t);
+ set_cookedmode(&t, NULL);
if (!setattr(fd, &t)) rb_sys_fail(0);
return io;
}
@@ -285,14 +384,17 @@ getc_call(VALUE io)
/*
* call-seq:
- * io.getch -> char
+ * io.getch(min: nil, time: nil) -> char
*
* Reads and returns a character in raw mode.
+ *
+ * You must require 'io/console' to use this method.
*/
static VALUE
-console_getch(VALUE io)
+console_getch(int argc, VALUE *argv, VALUE io)
{
- return ttymode(io, getc_call, set_rawmode);
+ rawmode_arg_t opts, *optp = rawmode_opt(argc, argv, &opts);
+ return ttymode(io, getc_call, set_rawmode, optp);
}
/*
@@ -304,11 +406,13 @@ console_getch(VALUE io)
* STDIN.noecho(&:gets)
*
* will read and return a line without echo back.
+ *
+ * You must require 'io/console' to use this method.
*/
static VALUE
console_noecho(VALUE io)
{
- return ttymode(io, rb_yield, set_noecho);
+ return ttymode(io, rb_yield, set_noecho, NULL);
}
/*
@@ -316,6 +420,10 @@ console_noecho(VALUE io)
* io.echo = flag
*
* Enables/disables echo back.
+ * On some platforms, all combinations of this flags and raw/cooked
+ * mode may not be valid.
+ *
+ * You must require 'io/console' to use this method.
*/
static VALUE
console_set_echo(VALUE io, VALUE f)
@@ -328,9 +436,9 @@ console_set_echo(VALUE io, VALUE f)
fd = GetReadFD(fptr);
if (!getattr(fd, &t)) rb_sys_fail(0);
if (RTEST(f))
- set_echo(&t);
+ set_echo(&t, NULL);
else
- set_noecho(&t);
+ set_noecho(&t, NULL);
if (!setattr(fd, &t)) rb_sys_fail(0);
return io;
}
@@ -340,6 +448,8 @@ console_set_echo(VALUE io, VALUE f)
* io.echo? -> true or false
*
* Returns +true+ if echo back is enabled.
+ *
+ * You must require 'io/console' to use this method.
*/
static VALUE
console_echo_p(VALUE io)
@@ -379,6 +489,8 @@ typedef CONSOLE_SCREEN_BUFFER_INFO rb_console_size_t;
* io.winsize -> [rows, columns]
*
* Returns console size.
+ *
+ * You must require 'io/console' to use this method.
*/
static VALUE
console_winsize(VALUE io)
@@ -399,6 +511,8 @@ console_winsize(VALUE io)
*
* Tries to set console size. The effect depends on the platform and
* the running environment.
+ *
+ * You must require 'io/console' to use this method.
*/
static VALUE
console_set_winsize(VALUE io, VALUE size)
@@ -410,7 +524,9 @@ console_set_winsize(VALUE io, VALUE size)
int newrow, newcol;
#endif
VALUE row, col, xpixel, ypixel;
+#if defined TIOCSWINSZ
int fd;
+#endif
GetOpenFile(io, fptr);
size = rb_Array(size);
@@ -456,6 +572,8 @@ console_set_winsize(VALUE io, VALUE size)
* io.iflush
*
* Flushes input buffer in kernel.
+ *
+ * You must require 'io/console' to use this method.
*/
static VALUE
console_iflush(VALUE io)
@@ -476,6 +594,8 @@ console_iflush(VALUE io)
* io.oflush
*
* Flushes output buffer in kernel.
+ *
+ * You must require 'io/console' to use this method.
*/
static VALUE
console_oflush(VALUE io)
@@ -496,6 +616,8 @@ console_oflush(VALUE io)
* io.ioflush
*
* Flushes input and output buffers in kernel.
+ *
+ * You must require 'io/console' to use this method.
*/
static VALUE
console_ioflush(VALUE io)
@@ -525,6 +647,8 @@ console_ioflush(VALUE io)
* IO.console -> #<File:/dev/tty>
*
* Returns an File instance opened console.
+ *
+ * You must require 'io/console' to use this method.
*/
static VALUE
console_dev(VALUE klass)
@@ -535,7 +659,7 @@ console_dev(VALUE klass)
if (klass == rb_cIO) klass = rb_cFile;
if (rb_const_defined(klass, id_console)) {
con = rb_const_get(klass, id_console);
- if (TYPE(con) == T_FILE) {
+ if (RB_TYPE_P(con, T_FILE)) {
if ((fptr = RFILE(con)->fptr) && GetReadFD(fptr) != -1)
return con;
}
@@ -557,17 +681,17 @@ console_dev(VALUE klass)
VALUE out;
rb_io_t *ofptr;
#endif
- int fd, mode;
+ int fd;
#ifdef CONSOLE_DEVICE_FOR_WRITING
- fd = open(CONSOLE_DEVICE_FOR_WRITING, O_WRONLY);
+ fd = rb_cloexec_open(CONSOLE_DEVICE_FOR_WRITING, O_WRONLY, 0);
if (fd < 0) return Qnil;
rb_update_max_fd(fd);
args[1] = INT2FIX(O_WRONLY);
args[0] = INT2NUM(fd);
out = rb_class_new_instance(2, args, klass);
#endif
- fd = open(CONSOLE_DEVICE_FOR_READING, O_RDWR);
+ fd = rb_cloexec_open(CONSOLE_DEVICE_FOR_READING, O_RDWR, 0);
if (fd < 0) {
#ifdef CONSOLE_DEVICE_FOR_WRITING
rb_io_close(out);
@@ -597,6 +721,12 @@ console_dev(VALUE klass)
return con;
}
+static VALUE
+io_getch(int argc, VALUE *argv, VALUE io)
+{
+ return rb_funcall2(io, rb_intern("getc"), argc, argv);
+}
+
/*
* IO console methods
*/
@@ -611,9 +741,11 @@ Init_console(void)
void
InitVM_console(void)
{
- rb_define_method(rb_cIO, "raw", console_raw, 0);
- rb_define_method(rb_cIO, "raw!", console_set_raw, 0);
- rb_define_method(rb_cIO, "getch", console_getch, 0);
+ rb_define_method(rb_cIO, "raw", console_raw, -1);
+ rb_define_method(rb_cIO, "raw!", console_set_raw, -1);
+ rb_define_method(rb_cIO, "cooked", console_cooked, 0);
+ rb_define_method(rb_cIO, "cooked!", console_set_cooked, 0);
+ rb_define_method(rb_cIO, "getch", console_getch, -1);
rb_define_method(rb_cIO, "echo=", console_set_echo, 1);
rb_define_method(rb_cIO, "echo?", console_echo_p, 0);
rb_define_method(rb_cIO, "noecho", console_noecho, 0);
@@ -623,4 +755,8 @@ InitVM_console(void)
rb_define_method(rb_cIO, "oflush", console_oflush, 0);
rb_define_method(rb_cIO, "ioflush", console_ioflush, 0);
rb_define_singleton_method(rb_cIO, "console", console_dev, 0);
+ {
+ VALUE mReadable = rb_define_module_under(rb_cIO, "readable");
+ rb_define_method(mReadable, "getch", io_getch, -1);
+ }
}
diff --git a/ext/io/console/io-console.gemspec b/ext/io/console/io-console.gemspec
index 2d34a41336..66b3165967 100644
--- a/ext/io/console/io-console.gemspec
+++ b/ext/io/console/io-console.gemspec
@@ -8,6 +8,7 @@ Gem::Specification.new do |s|
s.summary = "Console interface"
s.email = "nobu@ruby-lang.org"
s.description = "add console capabilities to IO instances."
+ s.homepage = "http://www.ruby-lang.org"
s.authors = ["Nobu Nakada"]
s.require_path = %[.]
s.files = %w[console.c extconf.rb lib/console/size.rb]
diff --git a/ext/io/wait/wait.c b/ext/io/wait/wait.c
index 34e832b122..c7a290fd4f 100644
--- a/ext/io/wait/wait.c
+++ b/ext/io/wait/wait.c
@@ -14,6 +14,9 @@
#include "ruby/io.h"
#include <sys/types.h>
+#if defined(HAVE_UNISTD_H) && (defined(__sun))
+#include <unistd.h>
+#endif
#if defined(HAVE_SYS_IOCTL_H)
#include <sys/ioctl.h>
#endif
@@ -37,7 +40,8 @@
#endif
static VALUE io_ready_p _((VALUE io));
-static VALUE io_wait _((int argc, VALUE *argv, VALUE io));
+static VALUE io_wait_readable _((int argc, VALUE *argv, VALUE io));
+static VALUE io_wait_writable _((int argc, VALUE *argv, VALUE io));
void Init_wait _((void));
/*
@@ -98,7 +102,7 @@ io_ready_p(VALUE io)
*/
static VALUE
-io_wait(int argc, VALUE *argv, VALUE io)
+io_wait_readable(int argc, VALUE *argv, VALUE io)
{
rb_io_t *fptr;
int i;
@@ -130,6 +134,43 @@ io_wait(int argc, VALUE *argv, VALUE io)
}
/*
+ * call-seq:
+ * io.wait_writable -> IO
+ * io.wait_writable(timeout) -> IO or nil
+ *
+ * Waits until IO writable is available or times out and returns self or
+ * nil when EOF is reached.
+ */
+static VALUE
+io_wait_writable(int argc, VALUE *argv, VALUE io)
+{
+ rb_io_t *fptr;
+ int i;
+ VALUE timeout;
+ struct timeval timerec;
+ struct timeval *tv;
+
+ GetOpenFile(io, fptr);
+ rb_io_check_writable(fptr);
+ rb_scan_args(argc, argv, "01", &timeout);
+ if (NIL_P(timeout)) {
+ tv = NULL;
+ }
+ else {
+ timerec = rb_time_interval(timeout);
+ tv = &timerec;
+ }
+
+ i = rb_wait_for_single_fd(fptr->fd, RB_WAITFD_OUT, tv);
+ if (i < 0)
+ rb_sys_fail(0);
+ rb_io_check_closed(fptr);
+ if (i & RB_WAITFD_OUT)
+ return io;
+ return Qnil;
+}
+
+/*
* IO wait methods
*/
@@ -138,5 +179,7 @@ Init_wait()
{
rb_define_method(rb_cIO, "nread", io_nread, 0);
rb_define_method(rb_cIO, "ready?", io_ready_p, 0);
- rb_define_method(rb_cIO, "wait", io_wait, -1);
+ rb_define_method(rb_cIO, "wait", io_wait_readable, -1);
+ rb_define_method(rb_cIO, "wait_readable", io_wait_readable, -1);
+ rb_define_method(rb_cIO, "wait_writable", io_wait_writable, -1);
}
diff --git a/ext/json/fbuffer/fbuffer.h b/ext/json/fbuffer/fbuffer.h
new file mode 100644
index 0000000000..0c532967c4
--- /dev/null
+++ b/ext/json/fbuffer/fbuffer.h
@@ -0,0 +1,164 @@
+
+#ifndef _FBUFFER_H_
+#define _FBUFFER_H_
+
+#include "ruby.h"
+#include <assert.h>
+
+#ifdef HAVE_RUBY_ENCODING_H
+#include "ruby/encoding.h"
+#define FORCE_UTF8(obj) rb_enc_associate((obj), rb_utf8_encoding())
+#else
+#define FORCE_UTF8(obj)
+#endif
+
+/* We don't need to guard objects for rbx, so let's do nothing at all. */
+#ifndef RB_GC_GUARD
+#define RB_GC_GUARD(object)
+#endif
+
+typedef struct FBufferStruct {
+ unsigned long initial_length;
+ char *ptr;
+ unsigned long len;
+ unsigned long capa;
+} FBuffer;
+
+#define FBUFFER_INITIAL_LENGTH_DEFAULT 1024
+
+#define FBUFFER_PTR(fb) (fb->ptr)
+#define FBUFFER_LEN(fb) (fb->len)
+#define FBUFFER_CAPA(fb) (fb->capa)
+#define FBUFFER_PAIR(fb) FBUFFER_PTR(fb), FBUFFER_LEN(fb)
+
+static FBuffer *fbuffer_alloc(unsigned long initial_length);
+static void fbuffer_free(FBuffer *fb);
+static void fbuffer_clear(FBuffer *fb);
+static void fbuffer_append(FBuffer *fb, const char *newstr, unsigned long len);
+#ifdef JSON_GENERATOR
+static void fbuffer_append_long(FBuffer *fb, long number);
+#endif
+static void fbuffer_append_char(FBuffer *fb, char newchr);
+#ifdef JSON_GENERATOR
+static FBuffer *fbuffer_dup(FBuffer *fb);
+static VALUE fbuffer_to_s(FBuffer *fb);
+#endif
+
+static FBuffer *fbuffer_alloc(unsigned long initial_length)
+{
+ FBuffer *fb;
+ if (initial_length <= 0) initial_length = FBUFFER_INITIAL_LENGTH_DEFAULT;
+ fb = ALLOC(FBuffer);
+ memset((void *) fb, 0, sizeof(FBuffer));
+ fb->initial_length = initial_length;
+ return fb;
+}
+
+static void fbuffer_free(FBuffer *fb)
+{
+ if (fb->ptr) ruby_xfree(fb->ptr);
+ ruby_xfree(fb);
+}
+
+static void fbuffer_clear(FBuffer *fb)
+{
+ fb->len = 0;
+}
+
+static void fbuffer_inc_capa(FBuffer *fb, unsigned long requested)
+{
+ unsigned long required;
+
+ if (!fb->ptr) {
+ fb->ptr = ALLOC_N(char, fb->initial_length);
+ fb->capa = fb->initial_length;
+ }
+
+ for (required = fb->capa; requested > required - fb->len; required <<= 1);
+
+ if (required > fb->capa) {
+ REALLOC_N(fb->ptr, char, required);
+ fb->capa = required;
+ }
+}
+
+static void fbuffer_append(FBuffer *fb, const char *newstr, unsigned long len)
+{
+ if (len > 0) {
+ fbuffer_inc_capa(fb, len);
+ MEMCPY(fb->ptr + fb->len, newstr, char, len);
+ fb->len += len;
+ }
+}
+
+#ifdef JSON_GENERATOR
+static void fbuffer_append_str(FBuffer *fb, VALUE str)
+{
+ const char *newstr = StringValuePtr(str);
+ unsigned long len = RSTRING_LEN(str);
+
+ RB_GC_GUARD(str);
+
+ fbuffer_append(fb, newstr, len);
+}
+#endif
+
+static void fbuffer_append_char(FBuffer *fb, char newchr)
+{
+ fbuffer_inc_capa(fb, 1);
+ *(fb->ptr + fb->len) = newchr;
+ fb->len++;
+}
+
+#ifdef JSON_GENERATOR
+static void freverse(char *start, char *end)
+{
+ char c;
+
+ while (end > start) {
+ c = *end, *end-- = *start, *start++ = c;
+ }
+}
+
+static long fltoa(long number, char *buf)
+{
+ static char digits[] = "0123456789";
+ long sign = number;
+ char* tmp = buf;
+
+ if (sign < 0) number = -number;
+ do *tmp++ = digits[number % 10]; while (number /= 10);
+ if (sign < 0) *tmp++ = '-';
+ freverse(buf, tmp - 1);
+ return tmp - buf;
+}
+
+static void fbuffer_append_long(FBuffer *fb, long number)
+{
+ char buf[20];
+ unsigned long len = fltoa(number, buf);
+ fbuffer_append(fb, buf, len);
+}
+
+static FBuffer *fbuffer_dup(FBuffer *fb)
+{
+ unsigned long len = fb->len;
+ FBuffer *result;
+
+ assert(len > 0);
+ if (len > 0) {
+ result = fbuffer_alloc(len);
+ fbuffer_append(result, FBUFFER_PAIR(fb));
+ }
+ return result;
+}
+
+static VALUE fbuffer_to_s(FBuffer *fb)
+{
+ VALUE result = rb_str_new(FBUFFER_PAIR(fb));
+ fbuffer_free(fb);
+ FORCE_UTF8(result);
+ return result;
+}
+#endif
+#endif
diff --git a/ext/json/generator/depend b/ext/json/generator/depend
index bb76ad6400..1f0ea0a624 100644
--- a/ext/json/generator/depend
+++ b/ext/json/generator/depend
@@ -1 +1 @@
-generator.o: generator.c generator.h
+generator.o: generator.c generator.h $(srcdir)/../fbuffer/fbuffer.h $(ruby_headers)
diff --git a/ext/json/generator/extconf.rb b/ext/json/generator/extconf.rb
index b94f71e8b3..8627c5f4bd 100644
--- a/ext/json/generator/extconf.rb
+++ b/ext/json/generator/extconf.rb
@@ -1,10 +1,4 @@
require 'mkmf'
-require 'rbconfig'
-if RUBY_VERSION < "1.9"
- have_header("re.h")
-else
- have_header("ruby/re.h")
- have_header("ruby/encoding.h")
-end
+$defs << "-DJSON_GENERATOR"
create_makefile 'json/ext/generator'
diff --git a/ext/json/generator/generator.c b/ext/json/generator/generator.c
index 4e44178e02..b1babb15f3 100644
--- a/ext/json/generator/generator.c
+++ b/ext/json/generator/generator.c
@@ -1,3 +1,4 @@
+#include "../fbuffer/fbuffer.h"
#include "generator.h"
#ifdef HAVE_RUBY_ENCODING_H
@@ -13,8 +14,9 @@ static VALUE mJSON, mExt, mGenerator, cState, mGeneratorMethods, mObject,
static ID i_to_s, i_to_json, i_new, i_indent, i_space, i_space_before,
i_object_nl, i_array_nl, i_max_nesting, i_allow_nan, i_ascii_only,
- i_pack, i_unpack, i_create_id, i_extend, i_key_p, i_aref, i_send,
- i_respond_to_p, i_match, i_keys, i_depth, i_dup;
+ i_quirks_mode, i_pack, i_unpack, i_create_id, i_extend, i_key_p,
+ i_aref, i_send, i_respond_to_p, i_match, i_keys, i_depth,
+ i_buffer_initial_length, i_dup;
/*
* Copyright 2001-2004 Unicode, Inc.
@@ -112,7 +114,7 @@ static void unicode_escape(char *buf, UTF16 character)
}
/* Escapes the UTF16 character and stores the result in the buffer buf, then
- * the buffer buf іs appended to the FBuffer buffer. */
+ * the buffer buf is appended to the FBuffer buffer. */
static void unicode_escape_to_buffer(FBuffer *buffer, char buf[6], UTF16
character)
{
@@ -292,113 +294,6 @@ static char *fstrndup(const char *ptr, unsigned long len) {
return result;
}
-/* fbuffer implementation */
-
-static FBuffer *fbuffer_alloc()
-{
- FBuffer *fb = ALLOC(FBuffer);
- memset((void *) fb, 0, sizeof(FBuffer));
- fb->initial_length = FBUFFER_INITIAL_LENGTH;
- return fb;
-}
-
-static FBuffer *fbuffer_alloc_with_length(unsigned long initial_length)
-{
- FBuffer *fb;
- assert(initial_length > 0);
- fb = ALLOC(FBuffer);
- memset((void *) fb, 0, sizeof(FBuffer));
- fb->initial_length = initial_length;
- return fb;
-}
-
-static void fbuffer_free(FBuffer *fb)
-{
- if (fb->ptr) ruby_xfree(fb->ptr);
- ruby_xfree(fb);
-}
-
-static void fbuffer_clear(FBuffer *fb)
-{
- fb->len = 0;
-}
-
-static void fbuffer_inc_capa(FBuffer *fb, unsigned long requested)
-{
- unsigned long required;
-
- if (!fb->ptr) {
- fb->ptr = ALLOC_N(char, fb->initial_length);
- fb->capa = fb->initial_length;
- }
-
- for (required = fb->capa; requested > required - fb->len; required <<= 1);
-
- if (required > fb->capa) {
- REALLOC_N(fb->ptr, char, required);
- fb->capa = required;
- }
-}
-
-static void fbuffer_append(FBuffer *fb, const char *newstr, unsigned long len)
-{
- if (len > 0) {
- fbuffer_inc_capa(fb, len);
- MEMCPY(fb->ptr + fb->len, newstr, char, len);
- fb->len += len;
- }
-}
-
-static void fbuffer_append_char(FBuffer *fb, char newchr)
-{
- fbuffer_inc_capa(fb, 1);
- *(fb->ptr + fb->len) = newchr;
- fb->len++;
-}
-
-static void freverse(char *start, char *end)
-{
- char c;
-
- while (end > start) {
- c = *end, *end-- = *start, *start++ = c;
- }
-}
-
-static long fltoa(long number, char *buf)
-{
- static char digits[] = "0123456789";
- long sign = number;
- char* tmp = buf;
-
- if (sign < 0) number = -number;
- do *tmp++ = digits[number % 10]; while (number /= 10);
- if (sign < 0) *tmp++ = '-';
- freverse(buf, tmp - 1);
- return tmp - buf;
-}
-
-static void fbuffer_append_long(FBuffer *fb, long number)
-{
- char buf[20];
- unsigned long len = fltoa(number, buf);
- fbuffer_append(fb, buf, len);
-}
-
-static FBuffer *fbuffer_dup(FBuffer *fb)
-{
- unsigned long len = fb->len;
- FBuffer *result;
-
- if (len > 0) {
- result = fbuffer_alloc_with_length(len);
- fbuffer_append(result, FBUFFER_PAIR(fb));
- } else {
- result = fbuffer_alloc();
- }
- return result;
-}
-
/*
* Document-module: JSON::Ext::Generator
*
@@ -684,10 +579,22 @@ static VALUE cState_configure(VALUE self, VALUE opts)
state->depth = 0;
}
}
+ tmp = ID2SYM(i_buffer_initial_length);
+ if (option_given_p(opts, tmp)) {
+ VALUE buffer_initial_length = rb_hash_aref(opts, tmp);
+ if (RTEST(buffer_initial_length)) {
+ long initial_length;
+ Check_Type(buffer_initial_length, T_FIXNUM);
+ initial_length = FIX2LONG(buffer_initial_length);
+ if (initial_length > 0) state->buffer_initial_length = initial_length;
+ }
+ }
tmp = rb_hash_aref(opts, ID2SYM(i_allow_nan));
state->allow_nan = RTEST(tmp);
tmp = rb_hash_aref(opts, ID2SYM(i_ascii_only));
state->ascii_only = RTEST(tmp);
+ tmp = rb_hash_aref(opts, ID2SYM(i_quirks_mode));
+ state->quirks_mode = RTEST(tmp);
return self;
}
@@ -708,8 +615,10 @@ static VALUE cState_to_h(VALUE self)
rb_hash_aset(result, ID2SYM(i_array_nl), rb_str_new(state->array_nl, state->array_nl_len));
rb_hash_aset(result, ID2SYM(i_allow_nan), state->allow_nan ? Qtrue : Qfalse);
rb_hash_aset(result, ID2SYM(i_ascii_only), state->ascii_only ? Qtrue : Qfalse);
+ rb_hash_aset(result, ID2SYM(i_quirks_mode), state->quirks_mode ? Qtrue : Qfalse);
rb_hash_aset(result, ID2SYM(i_max_nesting), LONG2FIX(state->max_nesting));
rb_hash_aset(result, ID2SYM(i_depth), LONG2FIX(state->depth));
+ rb_hash_aset(result, ID2SYM(i_buffer_initial_length), LONG2FIX(state->buffer_initial_length));
return result;
}
@@ -852,7 +761,7 @@ static void generate_json_fixnum(FBuffer *buffer, VALUE Vstate, JSON_Generator_S
static void generate_json_bignum(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj)
{
VALUE tmp = rb_funcall(obj, i_to_s, 0);
- fbuffer_append(buffer, RSTRING_PAIR(tmp));
+ fbuffer_append_str(buffer, tmp);
}
static void generate_json_float(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj)
@@ -869,7 +778,7 @@ static void generate_json_float(FBuffer *buffer, VALUE Vstate, JSON_Generator_St
rb_raise(eGeneratorError, "%u: %s not allowed in JSON", __LINE__, StringValueCStr(tmp));
}
}
- fbuffer_append(buffer, RSTRING_PAIR(tmp));
+ fbuffer_append_str(buffer, tmp);
}
static void generate_json(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj)
@@ -897,7 +806,7 @@ static void generate_json(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *s
} else if (rb_respond_to(obj, i_to_json)) {
tmp = rb_funcall(obj, i_to_json, 1, Vstate);
Check_Type(tmp, T_STRING);
- fbuffer_append(buffer, RSTRING_PAIR(tmp));
+ fbuffer_append_str(buffer, tmp);
} else {
tmp = rb_funcall(obj, i_to_s, 0);
Check_Type(tmp, T_STRING);
@@ -907,19 +816,20 @@ static void generate_json(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *s
static FBuffer *cState_prepare_buffer(VALUE self)
{
- FBuffer *buffer = fbuffer_alloc();
+ FBuffer *buffer;
GET_STATE(self);
+ buffer = fbuffer_alloc(state->buffer_initial_length);
if (state->object_delim) {
fbuffer_clear(state->object_delim);
} else {
- state->object_delim = fbuffer_alloc_with_length(16);
+ state->object_delim = fbuffer_alloc(16);
}
fbuffer_append_char(state->object_delim, ',');
if (state->object_delim2) {
fbuffer_clear(state->object_delim2);
} else {
- state->object_delim2 = fbuffer_alloc_with_length(16);
+ state->object_delim2 = fbuffer_alloc(16);
}
fbuffer_append_char(state->object_delim2, ':');
if (state->space) fbuffer_append(state->object_delim2, state->space, state->space_len);
@@ -927,21 +837,13 @@ static FBuffer *cState_prepare_buffer(VALUE self)
if (state->array_delim) {
fbuffer_clear(state->array_delim);
} else {
- state->array_delim = fbuffer_alloc_with_length(16);
+ state->array_delim = fbuffer_alloc(16);
}
fbuffer_append_char(state->array_delim, ',');
if (state->array_nl) fbuffer_append(state->array_delim, state->array_nl, state->array_nl_len);
return buffer;
}
-static VALUE fbuffer_to_s(FBuffer *fb)
-{
- VALUE result = rb_str_new(FBUFFER_PAIR(fb));
- fbuffer_free(fb);
- FORCE_UTF8(result);
- return result;
-}
-
static VALUE cState_partial_generate(VALUE self, VALUE obj)
{
FBuffer *buffer = cState_prepare_buffer(self);
@@ -951,6 +853,21 @@ static VALUE cState_partial_generate(VALUE self, VALUE obj)
}
/*
+ * This function returns true if string is either a JSON array or JSON object.
+ * It might suffer from false positives, e. g. syntactically incorrect JSON in
+ * the string or certain UTF-8 characters on the right hand side.
+ */
+static int isArrayOrObject(VALUE string)
+{
+ long string_len = RSTRING_LEN(string);
+ char *p = RSTRING_PTR(string), *q = p + string_len - 1;
+ if (string_len < 2) return 0;
+ for (; p < q && isspace(*p); p++);
+ for (; q > p && isspace(*q); q--);
+ return *p == '[' && *q == ']' || *p == '{' && *q == '}';
+}
+
+/*
* call-seq: generate(obj)
*
* Generates a valid JSON document from object +obj+ and returns the
@@ -960,11 +877,8 @@ static VALUE cState_partial_generate(VALUE self, VALUE obj)
static VALUE cState_generate(VALUE self, VALUE obj)
{
VALUE result = cState_partial_generate(self, obj);
- VALUE re, args[2];
- args[0] = rb_str_new2("\\A\\s*(?:\\[.*\\]|\\{.*\\})\\s*\\Z");
- args[1] = CRegexp_MULTILINE;
- re = rb_class_new_instance(2, args, rb_cRegexp);
- if (NIL_P(rb_funcall(re, i_match, 1, result))) {
+ GET_STATE(self);
+ if (!state->quirks_mode && !isArrayOrObject(result)) {
rb_raise(eGeneratorError, "only generation of JSON objects or arrays allowed");
}
return result;
@@ -985,12 +899,17 @@ static VALUE cState_generate(VALUE self, VALUE obj)
* * *allow_nan*: true if NaN, Infinity, and -Infinity should be
* generated, otherwise an exception is thrown, if these values are
* encountered. This options defaults to false.
+ * * *quirks_mode*: Enables quirks_mode for parser, that is for example
+ * generating single JSON values instead of documents is possible.
+ * * *buffer_initial_length*: sets the initial length of the generator's
+ * internal buffer.
*/
static VALUE cState_initialize(int argc, VALUE *argv, VALUE self)
{
VALUE opts;
GET_STATE(self);
state->max_nesting = 19;
+ state->buffer_initial_length = FBUFFER_INITIAL_LENGTH_DEFAULT;
rb_scan_args(argc, argv, "01", &opts);
if (!NIL_P(opts)) cState_configure(self, opts);
return self;
@@ -1288,6 +1207,29 @@ static VALUE cState_ascii_only_p(VALUE self)
}
/*
+ * call-seq: quirks_mode?
+ *
+ * Returns true, if quirks mode is enabled. Otherwise returns false.
+ */
+static VALUE cState_quirks_mode_p(VALUE self)
+{
+ GET_STATE(self);
+ return state->quirks_mode ? Qtrue : Qfalse;
+}
+
+/*
+ * call-seq: quirks_mode=(enable)
+ *
+ * If set to true, enables the quirks_mode mode.
+ */
+static VALUE cState_quirks_mode_set(VALUE self, VALUE enable)
+{
+ GET_STATE(self);
+ state->quirks_mode = RTEST(enable);
+ return Qnil;
+}
+
+/*
* call-seq: depth
*
* This integer returns the current depth of data structure nesting.
@@ -1308,7 +1250,37 @@ static VALUE cState_depth_set(VALUE self, VALUE depth)
{
GET_STATE(self);
Check_Type(depth, T_FIXNUM);
- return state->depth = FIX2LONG(depth);
+ state->depth = FIX2LONG(depth);
+ return Qnil;
+}
+
+/*
+ * call-seq: buffer_initial_length
+ *
+ * This integer returns the current inital length of the buffer.
+ */
+static VALUE cState_buffer_initial_length(VALUE self)
+{
+ GET_STATE(self);
+ return LONG2FIX(state->buffer_initial_length);
+}
+
+/*
+ * call-seq: buffer_initial_length=(length)
+ *
+ * This sets the initial length of the buffer to +length+, if +length+ > 0,
+ * otherwise its value isn't changed.
+ */
+static VALUE cState_buffer_initial_length_set(VALUE self, VALUE buffer_initial_length)
+{
+ long initial_length;
+ GET_STATE(self);
+ Check_Type(buffer_initial_length, T_FIXNUM);
+ initial_length = FIX2LONG(buffer_initial_length);
+ if (initial_length > 0) {
+ state->buffer_initial_length = initial_length;
+ }
+ return Qnil;
}
/*
@@ -1345,8 +1317,13 @@ void Init_generator()
rb_define_method(cState, "check_circular?", cState_check_circular_p, 0);
rb_define_method(cState, "allow_nan?", cState_allow_nan_p, 0);
rb_define_method(cState, "ascii_only?", cState_ascii_only_p, 0);
+ rb_define_method(cState, "quirks_mode?", cState_quirks_mode_p, 0);
+ rb_define_method(cState, "quirks_mode", cState_quirks_mode_p, 0);
+ rb_define_method(cState, "quirks_mode=", cState_quirks_mode_set, 1);
rb_define_method(cState, "depth", cState_depth, 0);
rb_define_method(cState, "depth=", cState_depth_set, 1);
+ rb_define_method(cState, "buffer_initial_length", cState_buffer_initial_length, 0);
+ rb_define_method(cState, "buffer_initial_length=", cState_buffer_initial_length_set, 1);
rb_define_method(cState, "configure", cState_configure, 1);
rb_define_alias(cState, "merge", "configure");
rb_define_method(cState, "to_h", cState_to_h, 0);
@@ -1392,7 +1369,9 @@ void Init_generator()
i_max_nesting = rb_intern("max_nesting");
i_allow_nan = rb_intern("allow_nan");
i_ascii_only = rb_intern("ascii_only");
+ i_quirks_mode = rb_intern("quirks_mode");
i_depth = rb_intern("depth");
+ i_buffer_initial_length = rb_intern("buffer_initial_length");
i_pack = rb_intern("pack");
i_unpack = rb_intern("unpack");
i_create_id = rb_intern("create_id");
diff --git a/ext/json/generator/generator.h b/ext/json/generator/generator.h
index ee496fe221..901b62c251 100644
--- a/ext/json/generator/generator.h
+++ b/ext/json/generator/generator.h
@@ -4,22 +4,14 @@
#include <string.h>
#include <assert.h>
#include <math.h>
+#include <ctype.h>
#include "ruby.h"
-#if HAVE_RUBY_RE_H
+#ifdef HAVE_RUBY_RE_H
#include "ruby/re.h"
-#endif
-
-#if HAVE_RE_H
-#include "re.h"
-#endif
-
-#ifdef HAVE_RUBY_ENCODING_H
-#include "ruby/encoding.h"
-#define FORCE_UTF8(obj) rb_enc_associate((obj), rb_utf8_encoding())
#else
-#define FORCE_UTF8(obj)
+#include "re.h"
#endif
#define option_given_p(opts, key) RTEST(rb_funcall(opts, i_key_p, 1, key))
@@ -45,35 +37,6 @@
#define RSTRING_LEN(string) RSTRING(string)->len
#endif
-#define RSTRING_PAIR(string) RSTRING_PTR(string), RSTRING_LEN(string)
-
-/* fbuffer implementation */
-
-typedef struct FBufferStruct {
- unsigned long initial_length;
- char *ptr;
- unsigned long len;
- unsigned long capa;
-} FBuffer;
-
-#define FBUFFER_INITIAL_LENGTH 4096
-
-#define FBUFFER_PTR(fb) (fb->ptr)
-#define FBUFFER_LEN(fb) (fb->len)
-#define FBUFFER_CAPA(fb) (fb->capa)
-#define FBUFFER_PAIR(fb) FBUFFER_PTR(fb), FBUFFER_LEN(fb)
-
-static char *fstrndup(const char *ptr, unsigned long len);
-static FBuffer *fbuffer_alloc();
-static FBuffer *fbuffer_alloc_with_length(unsigned long initial_length);
-static void fbuffer_free(FBuffer *fb);
-static void fbuffer_clear(FBuffer *fb);
-static void fbuffer_append(FBuffer *fb, const char *newstr, unsigned long len);
-static void fbuffer_append_long(FBuffer *fb, long number);
-static void fbuffer_append_char(FBuffer *fb, char newchr);
-static FBuffer *fbuffer_dup(FBuffer *fb);
-static VALUE fbuffer_to_s(FBuffer *fb);
-
/* unicode defintions */
#define UNI_STRICT_CONVERSION 1
@@ -103,6 +66,7 @@ static void unicode_escape(char *buf, UTF16 character);
static void unicode_escape_to_buffer(FBuffer *buffer, char buf[6], UTF16 character);
static void convert_UTF8_to_JSON_ASCII(FBuffer *buffer, VALUE string);
static void convert_UTF8_to_JSON(FBuffer *buffer, VALUE string);
+static char *fstrndup(const char *ptr, unsigned long len);
/* ruby api and some helpers */
@@ -123,7 +87,9 @@ typedef struct JSON_Generator_StateStruct {
long max_nesting;
char allow_nan;
char ascii_only;
+ char quirks_mode;
long depth;
+ long buffer_initial_length;
} JSON_Generator_State;
#define GET_STATE(self) \
diff --git a/ext/json/lib/json.rb b/ext/json/lib/json.rb
index d7bc1a2d23..00fe4cae84 100644
--- a/ext/json/lib/json.rb
+++ b/ext/json/lib/json.rb
@@ -7,13 +7,13 @@
#
# Built on two universally available structures:
# 1. A collection of name/value pairs. Often referred to as an _object_, hash table, record, struct, keyed list, or associative array.
-# 2. An orderd list of values. More commonly named as an _array_, vector, sequence, or list.
+# 2. An ordered list of values. More commonly called an _array_, vector, sequence or list.
#
# To read more about JSON visit: http://json.org
#
# == Parsing JSON
#
-# To parse a JSON string received by another application, or generated within
+# To parse a JSON string received by another application or generated within
# your existing application:
#
# require 'json'
@@ -42,8 +42,8 @@
# puts {:hello => "goodbye"}.to_json => "{\"hello\":\"goodbye\"}"
#
# <tt>JSON.generate</tt> only allows objects or arrays to be converted
-# to JSON syntax. While <tt>to_json</tt> accepts many Ruby classes
-# even though it only acts a method for serialization:
+# to JSON syntax. <tt>to_json</tt>, however, accepts many Ruby classes
+# even though it acts only as a method for serialization:
#
# require 'json'
#
diff --git a/ext/json/lib/json/add/bigdecimal.rb b/ext/json/lib/json/add/bigdecimal.rb
new file mode 100644
index 0000000000..4aafe537ab
--- /dev/null
+++ b/ext/json/lib/json/add/bigdecimal.rb
@@ -0,0 +1,21 @@
+unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
+ require 'json'
+end
+defined?(::BigDecimal) or require 'bigdecimal'
+
+class BigDecimal
+ def self.json_create(object)
+ BigDecimal._load object['b']
+ end
+
+ def as_json(*)
+ {
+ JSON.create_id => self.class.name,
+ 'b' => _dump,
+ }
+ end
+
+ def to_json(*)
+ as_json.to_json
+ end
+end
diff --git a/ext/json/lib/json/add/complex.rb b/ext/json/lib/json/add/complex.rb
new file mode 100644
index 0000000000..d7ebebf5f7
--- /dev/null
+++ b/ext/json/lib/json/add/complex.rb
@@ -0,0 +1,22 @@
+unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
+ require 'json'
+end
+defined?(::Complex) or require 'complex'
+
+class Complex
+ def self.json_create(object)
+ Complex(object['r'], object['i'])
+ end
+
+ def as_json(*)
+ {
+ JSON.create_id => self.class.name,
+ 'r' => real,
+ 'i' => imag,
+ }
+ end
+
+ def to_json(*)
+ as_json.to_json
+ end
+end
diff --git a/ext/json/lib/json/add/core.rb b/ext/json/lib/json/add/core.rb
index e9850af8f6..77d9dc0b20 100644
--- a/ext/json/lib/json/add/core.rb
+++ b/ext/json/lib/json/add/core.rb
@@ -1,243 +1,11 @@
-# This file contains implementations of ruby core's custom objects for
+# This file requires the implementations of ruby core's custom objects for
# serialisation/deserialisation.
-unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
- require 'json'
-end
-require 'date'
-
-# Symbol serialization/deserialization
-class Symbol
- # Returns a hash, that will be turned into a JSON object and represent this
- # object.
- def as_json(*)
- {
- JSON.create_id => self.class.name,
- 's' => to_s,
- }
- end
-
- # Stores class name (Symbol) with String representation of Symbol as a JSON string.
- def to_json(*a)
- as_json.to_json(*a)
- end
-
- # Deserializes JSON string by converting the <tt>string</tt> value stored in the object to a Symbol
- def self.json_create(o)
- o['s'].to_sym
- end
-end
-
-# Time serialization/deserialization
-class Time
-
- # Deserializes JSON string by converting time since epoch to Time
- def self.json_create(object)
- if usec = object.delete('u') # used to be tv_usec -> tv_nsec
- object['n'] = usec * 1000
- end
- if respond_to?(:tv_nsec)
- at(*object.values_at('s', 'n'))
- else
- at(object['s'], object['n'] / 1000)
- end
- end
-
- # Returns a hash, that will be turned into a JSON object and represent this
- # object.
- def as_json(*)
- {
- JSON.create_id => self.class.name,
- 's' => tv_sec,
- 'n' => respond_to?(:tv_nsec) ? tv_nsec : tv_usec * 1000
- }
- end
-
- # Stores class name (Time) with number of seconds since epoch and number of
- # microseconds for Time as JSON string
- def to_json(*args)
- as_json.to_json(*args)
- end
-end
-
-# Date serialization/deserialization
-class Date
-
- # Deserializes JSON string by converting Julian year <tt>y</tt>, month
- # <tt>m</tt>, day <tt>d</tt> and Day of Calendar Reform <tt>sg</tt> to Date.
- def self.json_create(object)
- civil(*object.values_at('y', 'm', 'd', 'sg'))
- end
-
- alias start sg unless method_defined?(:start)
-
- # Returns a hash, that will be turned into a JSON object and represent this
- # object.
- def as_json(*)
- {
- JSON.create_id => self.class.name,
- 'y' => year,
- 'm' => month,
- 'd' => day,
- 'sg' => start,
- }
- end
-
- # Stores class name (Date) with Julian year <tt>y</tt>, month <tt>m</tt>, day
- # <tt>d</tt> and Day of Calendar Reform <tt>sg</tt> as JSON string
- def to_json(*args)
- as_json.to_json(*args)
- end
-end
-
-# DateTime serialization/deserialization
-class DateTime
-
- # Deserializes JSON string by converting year <tt>y</tt>, month <tt>m</tt>,
- # day <tt>d</tt>, hour <tt>H</tt>, minute <tt>M</tt>, second <tt>S</tt>,
- # offset <tt>of</tt> and Day of Calendar Reform <tt>sg</tt> to DateTime.
- def self.json_create(object)
- args = object.values_at('y', 'm', 'd', 'H', 'M', 'S')
- of_a, of_b = object['of'].split('/')
- if of_b and of_b != '0'
- args << Rational(of_a.to_i, of_b.to_i)
- else
- args << of_a
- end
- args << object['sg']
- civil(*args)
- end
-
- alias start sg unless method_defined?(:start)
-
- # Returns a hash, that will be turned into a JSON object and represent this
- # object.
- def as_json(*)
- {
- JSON.create_id => self.class.name,
- 'y' => year,
- 'm' => month,
- 'd' => day,
- 'H' => hour,
- 'M' => min,
- 'S' => sec,
- 'of' => offset.to_s,
- 'sg' => start,
- }
- end
-
- # Stores class name (DateTime) with Julian year <tt>y</tt>, month <tt>m</tt>,
- # day <tt>d</tt>, hour <tt>H</tt>, minute <tt>M</tt>, second <tt>S</tt>,
- # offset <tt>of</tt> and Day of Calendar Reform <tt>sg</tt> as JSON string
- def to_json(*args)
- as_json.to_json(*args)
- end
-end
-
-# Range serialization/deserialization
-class Range
-
- # Deserializes JSON string by constructing new Range object with arguments
- # <tt>a</tt> serialized by <tt>to_json</tt>.
- def self.json_create(object)
- new(*object['a'])
- end
-
- # Returns a hash, that will be turned into a JSON object and represent this
- # object.
- def as_json(*)
- {
- JSON.create_id => self.class.name,
- 'a' => [ first, last, exclude_end? ]
- }
- end
-
- # Stores class name (Range) with JSON array of arguments <tt>a</tt> which
- # include <tt>first</tt> (integer), <tt>last</tt> (integer), and
- # <tt>exclude_end?</tt> (boolean) as JSON string.
- def to_json(*args)
- as_json.to_json(*args)
- end
-end
-
-# Struct serialization/deserialization
-class Struct
-
- # Deserializes JSON string by constructing new Struct object with values
- # <tt>v</tt> serialized by <tt>to_json</tt>.
- def self.json_create(object)
- new(*object['v'])
- end
-
- # Returns a hash, that will be turned into a JSON object and represent this
- # object.
- def as_json(*)
- klass = self.class.name
- klass.to_s.empty? and raise JSON::JSONError, "Only named structs are supported!"
- {
- JSON.create_id => klass,
- 'v' => values,
- }
- end
-
- # Stores class name (Struct) with Struct values <tt>v</tt> as a JSON string.
- # Only named structs are supported.
- def to_json(*args)
- as_json.to_json(*args)
- end
-end
-
-# Exception serialization/deserialization
-class Exception
-
- # Deserializes JSON string by constructing new Exception object with message
- # <tt>m</tt> and backtrace <tt>b</tt> serialized with <tt>to_json</tt>
- def self.json_create(object)
- result = new(object['m'])
- result.set_backtrace object['b']
- result
- end
-
- # Returns a hash, that will be turned into a JSON object and represent this
- # object.
- def as_json(*)
- {
- JSON.create_id => self.class.name,
- 'm' => message,
- 'b' => backtrace,
- }
- end
-
- # Stores class name (Exception) with message <tt>m</tt> and backtrace array
- # <tt>b</tt> as JSON string
- def to_json(*args)
- as_json.to_json(*args)
- end
-end
-
-# Regexp serialization/deserialization
-class Regexp
-
- # Deserializes JSON string by constructing new Regexp object with source
- # <tt>s</tt> (Regexp or String) and options <tt>o</tt> serialized by
- # <tt>to_json</tt>
- def self.json_create(object)
- new(object['s'], object['o'])
- end
-
- # Returns a hash, that will be turned into a JSON object and represent this
- # object.
- def as_json(*)
- {
- JSON.create_id => self.class.name,
- 'o' => options,
- 's' => source,
- }
- end
-
- # Stores class name (Regexp) with options <tt>o</tt> and source <tt>s</tt>
- # (Regexp or String) as JSON string
- def to_json(*)
- as_json.to_json
- end
-end
+require 'json/add/date'
+require 'json/add/date_time'
+require 'json/add/exception'
+require 'json/add/range'
+require 'json/add/regexp'
+require 'json/add/struct'
+require 'json/add/symbol'
+require 'json/add/time'
diff --git a/ext/json/lib/json/add/date.rb b/ext/json/lib/json/add/date.rb
new file mode 100644
index 0000000000..4288237db1
--- /dev/null
+++ b/ext/json/lib/json/add/date.rb
@@ -0,0 +1,34 @@
+unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
+ require 'json'
+end
+require 'date'
+
+# Date serialization/deserialization
+class Date
+
+ # Deserializes JSON string by converting Julian year <tt>y</tt>, month
+ # <tt>m</tt>, day <tt>d</tt> and Day of Calendar Reform <tt>sg</tt> to Date.
+ def self.json_create(object)
+ civil(*object.values_at('y', 'm', 'd', 'sg'))
+ end
+
+ alias start sg unless method_defined?(:start)
+
+ # Returns a hash, that will be turned into a JSON object and represent this
+ # object.
+ def as_json(*)
+ {
+ JSON.create_id => self.class.name,
+ 'y' => year,
+ 'm' => month,
+ 'd' => day,
+ 'sg' => start,
+ }
+ end
+
+ # Stores class name (Date) with Julian year <tt>y</tt>, month <tt>m</tt>, day
+ # <tt>d</tt> and Day of Calendar Reform <tt>sg</tt> as JSON string
+ def to_json(*args)
+ as_json.to_json(*args)
+ end
+end
diff --git a/ext/json/lib/json/add/date_time.rb b/ext/json/lib/json/add/date_time.rb
new file mode 100644
index 0000000000..5ea42ea656
--- /dev/null
+++ b/ext/json/lib/json/add/date_time.rb
@@ -0,0 +1,50 @@
+unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
+ require 'json'
+end
+require 'date'
+
+# DateTime serialization/deserialization
+class DateTime
+
+ # Deserializes JSON string by converting year <tt>y</tt>, month <tt>m</tt>,
+ # day <tt>d</tt>, hour <tt>H</tt>, minute <tt>M</tt>, second <tt>S</tt>,
+ # offset <tt>of</tt> and Day of Calendar Reform <tt>sg</tt> to DateTime.
+ def self.json_create(object)
+ args = object.values_at('y', 'm', 'd', 'H', 'M', 'S')
+ of_a, of_b = object['of'].split('/')
+ if of_b and of_b != '0'
+ args << Rational(of_a.to_i, of_b.to_i)
+ else
+ args << of_a
+ end
+ args << object['sg']
+ civil(*args)
+ end
+
+ alias start sg unless method_defined?(:start)
+
+ # Returns a hash, that will be turned into a JSON object and represent this
+ # object.
+ def as_json(*)
+ {
+ JSON.create_id => self.class.name,
+ 'y' => year,
+ 'm' => month,
+ 'd' => day,
+ 'H' => hour,
+ 'M' => min,
+ 'S' => sec,
+ 'of' => offset.to_s,
+ 'sg' => start,
+ }
+ end
+
+ # Stores class name (DateTime) with Julian year <tt>y</tt>, month <tt>m</tt>,
+ # day <tt>d</tt>, hour <tt>H</tt>, minute <tt>M</tt>, second <tt>S</tt>,
+ # offset <tt>of</tt> and Day of Calendar Reform <tt>sg</tt> as JSON string
+ def to_json(*args)
+ as_json.to_json(*args)
+ end
+end
+
+
diff --git a/ext/json/lib/json/add/exception.rb b/ext/json/lib/json/add/exception.rb
new file mode 100644
index 0000000000..e6ad257abf
--- /dev/null
+++ b/ext/json/lib/json/add/exception.rb
@@ -0,0 +1,31 @@
+unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
+ require 'json'
+end
+
+# Exception serialization/deserialization
+class Exception
+
+ # Deserializes JSON string by constructing new Exception object with message
+ # <tt>m</tt> and backtrace <tt>b</tt> serialized with <tt>to_json</tt>
+ def self.json_create(object)
+ result = new(object['m'])
+ result.set_backtrace object['b']
+ result
+ end
+
+ # Returns a hash, that will be turned into a JSON object and represent this
+ # object.
+ def as_json(*)
+ {
+ JSON.create_id => self.class.name,
+ 'm' => message,
+ 'b' => backtrace,
+ }
+ end
+
+ # Stores class name (Exception) with message <tt>m</tt> and backtrace array
+ # <tt>b</tt> as JSON string
+ def to_json(*args)
+ as_json.to_json(*args)
+ end
+end
diff --git a/ext/json/lib/json/add/ostruct.rb b/ext/json/lib/json/add/ostruct.rb
new file mode 100644
index 0000000000..da81e107a7
--- /dev/null
+++ b/ext/json/lib/json/add/ostruct.rb
@@ -0,0 +1,31 @@
+unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
+ require 'json'
+end
+require 'ostruct'
+
+# OpenStruct serialization/deserialization
+class OpenStruct
+
+ # Deserializes JSON string by constructing new Struct object with values
+ # <tt>v</tt> serialized by <tt>to_json</tt>.
+ def self.json_create(object)
+ new(object['t'] || object[:t])
+ end
+
+ # Returns a hash, that will be turned into a JSON object and represent this
+ # object.
+ def as_json(*)
+ klass = self.class.name
+ klass.to_s.empty? and raise JSON::JSONError, "Only named structs are supported!"
+ {
+ JSON.create_id => klass,
+ 't' => table,
+ }
+ end
+
+ # Stores class name (OpenStruct) with this struct's values <tt>v</tt> as a
+ # JSON string.
+ def to_json(*args)
+ as_json.to_json(*args)
+ end
+end
diff --git a/ext/json/lib/json/add/range.rb b/ext/json/lib/json/add/range.rb
new file mode 100644
index 0000000000..e61e553cdb
--- /dev/null
+++ b/ext/json/lib/json/add/range.rb
@@ -0,0 +1,29 @@
+unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
+ require 'json'
+end
+
+# Range serialization/deserialization
+class Range
+
+ # Deserializes JSON string by constructing new Range object with arguments
+ # <tt>a</tt> serialized by <tt>to_json</tt>.
+ def self.json_create(object)
+ new(*object['a'])
+ end
+
+ # Returns a hash, that will be turned into a JSON object and represent this
+ # object.
+ def as_json(*)
+ {
+ JSON.create_id => self.class.name,
+ 'a' => [ first, last, exclude_end? ]
+ }
+ end
+
+ # Stores class name (Range) with JSON array of arguments <tt>a</tt> which
+ # include <tt>first</tt> (integer), <tt>last</tt> (integer), and
+ # <tt>exclude_end?</tt> (boolean) as JSON string.
+ def to_json(*args)
+ as_json.to_json(*args)
+ end
+end
diff --git a/ext/json/lib/json/add/rational.rb b/ext/json/lib/json/add/rational.rb
new file mode 100644
index 0000000000..867cd92f05
--- /dev/null
+++ b/ext/json/lib/json/add/rational.rb
@@ -0,0 +1,22 @@
+unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
+ require 'json'
+end
+defined?(::Rational) or require 'rational'
+
+class Rational
+ def self.json_create(object)
+ Rational(object['n'], object['d'])
+ end
+
+ def as_json(*)
+ {
+ JSON.create_id => self.class.name,
+ 'n' => numerator,
+ 'd' => denominator,
+ }
+ end
+
+ def to_json(*)
+ as_json.to_json
+ end
+end
diff --git a/ext/json/lib/json/add/regexp.rb b/ext/json/lib/json/add/regexp.rb
new file mode 100644
index 0000000000..2fcbb6fb14
--- /dev/null
+++ b/ext/json/lib/json/add/regexp.rb
@@ -0,0 +1,30 @@
+unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
+ require 'json'
+end
+
+# Regexp serialization/deserialization
+class Regexp
+
+ # Deserializes JSON string by constructing new Regexp object with source
+ # <tt>s</tt> (Regexp or String) and options <tt>o</tt> serialized by
+ # <tt>to_json</tt>
+ def self.json_create(object)
+ new(object['s'], object['o'])
+ end
+
+ # Returns a hash, that will be turned into a JSON object and represent this
+ # object.
+ def as_json(*)
+ {
+ JSON.create_id => self.class.name,
+ 'o' => options,
+ 's' => source,
+ }
+ end
+
+ # Stores class name (Regexp) with options <tt>o</tt> and source <tt>s</tt>
+ # (Regexp or String) as JSON string
+ def to_json(*)
+ as_json.to_json
+ end
+end
diff --git a/ext/json/lib/json/add/struct.rb b/ext/json/lib/json/add/struct.rb
new file mode 100644
index 0000000000..6847cde99b
--- /dev/null
+++ b/ext/json/lib/json/add/struct.rb
@@ -0,0 +1,30 @@
+unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
+ require 'json'
+end
+
+# Struct serialization/deserialization
+class Struct
+
+ # Deserializes JSON string by constructing new Struct object with values
+ # <tt>v</tt> serialized by <tt>to_json</tt>.
+ def self.json_create(object)
+ new(*object['v'])
+ end
+
+ # Returns a hash, that will be turned into a JSON object and represent this
+ # object.
+ def as_json(*)
+ klass = self.class.name
+ klass.to_s.empty? and raise JSON::JSONError, "Only named structs are supported!"
+ {
+ JSON.create_id => klass,
+ 'v' => values,
+ }
+ end
+
+ # Stores class name (Struct) with Struct values <tt>v</tt> as a JSON string.
+ # Only named structs are supported.
+ def to_json(*args)
+ as_json.to_json(*args)
+ end
+end
diff --git a/ext/json/lib/json/add/symbol.rb b/ext/json/lib/json/add/symbol.rb
new file mode 100644
index 0000000000..03dc9a56a5
--- /dev/null
+++ b/ext/json/lib/json/add/symbol.rb
@@ -0,0 +1,25 @@
+unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
+ require 'json'
+end
+
+# Symbol serialization/deserialization
+class Symbol
+ # Returns a hash, that will be turned into a JSON object and represent this
+ # object.
+ def as_json(*)
+ {
+ JSON.create_id => self.class.name,
+ 's' => to_s,
+ }
+ end
+
+ # Stores class name (Symbol) with String representation of Symbol as a JSON string.
+ def to_json(*a)
+ as_json.to_json(*a)
+ end
+
+ # Deserializes JSON string by converting the <tt>string</tt> value stored in the object to a Symbol
+ def self.json_create(o)
+ o['s'].to_sym
+ end
+end
diff --git a/ext/json/lib/json/add/time.rb b/ext/json/lib/json/add/time.rb
new file mode 100644
index 0000000000..9755707e68
--- /dev/null
+++ b/ext/json/lib/json/add/time.rb
@@ -0,0 +1,35 @@
+unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
+ require 'json'
+end
+
+# Time serialization/deserialization
+class Time
+
+ # Deserializes JSON string by converting time since epoch to Time
+ def self.json_create(object)
+ if usec = object.delete('u') # used to be tv_usec -> tv_nsec
+ object['n'] = usec * 1000
+ end
+ if instance_methods.include?(:tv_nsec)
+ at(object['s'], Rational(object['n'], 1000))
+ else
+ at(object['s'], object['n'] / 1000)
+ end
+ end
+
+ # Returns a hash, that will be turned into a JSON object and represent this
+ # object.
+ def as_json(*)
+ {
+ JSON.create_id => self.class.name,
+ 's' => tv_sec,
+ 'n' => respond_to?(:tv_nsec) ? tv_nsec : tv_usec * 1000
+ }
+ end
+
+ # Stores class name (Time) with number of seconds since epoch and number of
+ # microseconds for Time as JSON string
+ def to_json(*args)
+ as_json.to_json(*args)
+ end
+end
diff --git a/ext/json/lib/json/common.rb b/ext/json/lib/json/common.rb
index 1a5f0481e8..a30e4ce136 100644
--- a/ext/json/lib/json/common.rb
+++ b/ext/json/lib/json/common.rb
@@ -1,12 +1,13 @@
require 'json/version'
+require 'json/generic_object'
module JSON
class << self
- # If _object_ is string-like parse the string and return the parsed result
+ # If _object_ is string-like, parse the string and return the parsed result
# as a Ruby data structure. Otherwise generate a JSON text from the Ruby
# data structure object and return it.
#
- # The _opts_ argument is passed through to generate/parse respectively, see
+ # The _opts_ argument is passed through to generate/parse respectively. See
# generate and parse for their documentation.
def [](object, opts = {})
if object.respond_to? :to_str
@@ -16,7 +17,7 @@ module JSON
end
end
- # Returns the JSON parser class, that is used by JSON. This might be either
+ # Returns the JSON parser class that is used by JSON. This is either
# JSON::Ext::Parser or JSON::Pure::Parser.
attr_reader :parser
@@ -28,7 +29,7 @@ module JSON
end
# Return the constant located at _path_. The format of _path_ has to be
- # either ::A::B::C or A::B::C. In any case A has to be located at the top
+ # either ::A::B::C or A::B::C. In any case, A has to be located at the top
# level (absolute namespace path?). If there doesn't exist a constant at
# the given path, an ArgumentError is raised.
def deep_const_get(path) # :nodoc:
@@ -81,15 +82,15 @@ module JSON
$VERBOSE = old
end
- # Returns the JSON generator modul, that is used by JSON. This might be
+ # Returns the JSON generator module that is used by JSON. This is
# either JSON::Ext::Generator or JSON::Pure::Generator.
attr_reader :generator
- # Returns the JSON generator state class, that is used by JSON. This might
- # be either JSON::Ext::Generator::State or JSON::Pure::Generator::State.
+ # Returns the JSON generator state class that is used by JSON. This is
+ # either JSON::Ext::Generator::State or JSON::Pure::Generator::State.
attr_accessor :state
- # This is create identifier, that is used to decide, if the _json_create_
+ # This is create identifier, which is used to decide if the _json_create_
# hook of a class should be called. It defaults to 'json_class'.
attr_accessor :create_id
end
@@ -104,10 +105,10 @@ module JSON
# The base exception for JSON errors.
class JSONError < StandardError; end
- # This exception is raised, if a parser error occurs.
+ # This exception is raised if a parser error occurs.
class ParserError < JSONError; end
- # This exception is raised, if the nesting of parsed datastructures is too
+ # This exception is raised if the nesting of parsed data structures is too
# deep.
class NestingError < ParserError; end
@@ -115,13 +116,13 @@ module JSON
class CircularDatastructure < NestingError; end
# :startdoc:
- # This exception is raised, if a generator or unparser error occurs.
+ # This exception is raised if a generator or unparser error occurs.
class GeneratorError < JSONError; end
# For backwards compatibility
UnparserError = GeneratorError
- # This exception is raised, if the required unicode support is missing on the
- # system. Usually this means, that the iconv library is not installed.
+ # This exception is raised if the required unicode support is missing on the
+ # system. Usually this means that the iconv library is not installed.
class MissingUnicodeSupport < JSONError; end
module_function
@@ -131,16 +132,16 @@ module JSON
# _opts_ can have the following
# keys:
# * *max_nesting*: The maximum depth of nesting allowed in the parsed data
- # structures. Disable depth checking with :max_nesting => false, it defaults
+ # structures. Disable depth checking with :max_nesting => false. It defaults
# to 19.
# * *allow_nan*: If set to true, allow NaN, Infinity and -Infinity in
# defiance of RFC 4627 to be parsed by the Parser. This option defaults
# to false.
# * *symbolize_names*: If set to true, returns symbols for the names
- # (keys) in a JSON object. Otherwise strings are returned, which is also
+ # (keys) in a JSON object. Otherwise strings are returned. Strings are
# the default.
# * *create_additions*: If set to false, the Parser doesn't create
- # additions even if a matchin class and create_id was found. This option
+ # additions even if a matching class and create_id was found. This option
# defaults to true.
# * *object_class*: Defaults to Hash
# * *array_class*: Defaults to Array
@@ -149,19 +150,19 @@ module JSON
end
# Parse the JSON document _source_ into a Ruby data structure and return it.
- # The bang version of the parse method, defaults to the more dangerous values
+ # The bang version of the parse method defaults to the more dangerous values
# for the _opts_ hash, so be sure only to parse trusted _source_ documents.
#
# _opts_ can have the following keys:
# * *max_nesting*: The maximum depth of nesting allowed in the parsed data
# structures. Enable depth checking with :max_nesting => anInteger. The parse!
- # methods defaults to not doing max depth checking: This can be dangerous,
+ # methods defaults to not doing max depth checking: This can be dangerous
# if someone wants to fill up your stack.
# * *allow_nan*: If set to true, allow NaN, Infinity, and -Infinity in
# defiance of RFC 4627 to be parsed by the Parser. This option defaults
# to true.
# * *create_additions*: If set to false, the Parser doesn't create
- # additions even if a matchin class and create_id was found. This option
+ # additions even if a matching class and create_id was found. This option
# defaults to true.
def parse!(source, opts = {})
opts = {
@@ -188,7 +189,7 @@ module JSON
# * *object_nl*: a string that is put at the end of a JSON object (default: ''),
# * *array_nl*: a string that is put at the end of a JSON array (default: ''),
# * *allow_nan*: true if NaN, Infinity, and -Infinity should be
- # generated, otherwise an exception is thrown, if these values are
+ # generated, otherwise an exception is thrown if these values are
# encountered. This options defaults to false.
# * *max_nesting*: The maximum depth of nesting allowed in the data
# structures from which JSON is to be generated. Disable depth checking
@@ -196,9 +197,13 @@ module JSON
#
# See also the fast_generate for the fastest creation method with the least
# amount of sanity checks, and the pretty_generate method for some
- # defaults for a pretty output.
+ # defaults for pretty output.
def generate(obj, opts = nil)
- state = SAFE_STATE_PROTOTYPE.dup
+ if State === opts
+ state, opts = opts, nil
+ else
+ state = SAFE_STATE_PROTOTYPE.dup
+ end
if opts
if opts.respond_to? :to_hash
opts = opts.to_hash
@@ -223,9 +228,13 @@ module JSON
# This method disables the checks for circles in Ruby objects.
#
# *WARNING*: Be careful not to pass any Ruby data structures with circles as
- # _obj_ argument, because this will cause JSON to go into an infinite loop.
+ # _obj_ argument because this will cause JSON to go into an infinite loop.
def fast_generate(obj, opts = nil)
- state = FAST_STATE_PROTOTYPE.dup
+ if State === opts
+ state, opts = opts, nil
+ else
+ state = FAST_STATE_PROTOTYPE.dup
+ end
if opts
if opts.respond_to? :to_hash
opts = opts.to_hash
@@ -249,10 +258,14 @@ module JSON
# The returned document is a prettier form of the document returned by
# #unparse.
#
- # The _opts_ argument can be used to configure the generator, see the
+ # The _opts_ argument can be used to configure the generator. See the
# generate method for a more detailed explanation.
def pretty_generate(obj, opts = nil)
- state = PRETTY_STATE_PROTOTYPE.dup
+ if State === opts
+ state, opts = opts, nil
+ else
+ state = PRETTY_STATE_PROTOTYPE.dup
+ end
if opts
if opts.respond_to? :to_hash
opts = opts.to_hash
@@ -272,22 +285,40 @@ module JSON
module_function :pretty_unparse
# :startdoc:
+ class << self
+ # The global default options for the JSON.load method:
+ # :max_nesting: false
+ # :allow_nan: true
+ # :quirks_mode: true
+ attr_accessor :load_default_options
+ end
+ self.load_default_options = {
+ :max_nesting => false,
+ :allow_nan => true,
+ :quirks_mode => true,
+ }
+
# Load a ruby data structure from a JSON _source_ and return it. A source can
- # either be a string-like object, an IO like object, or an object responding
+ # either be a string-like object, an IO-like object, or an object responding
# to the read method. If _proc_ was given, it will be called with any nested
- # Ruby object as an argument recursively in depth first order.
+ # Ruby object as an argument recursively in depth first order. The default
+ # options for the parser can be changed via the load_default_options method.
#
# This method is part of the implementation of the load/dump interface of
# Marshal and YAML.
def load(source, proc = nil)
+ opts = load_default_options
if source.respond_to? :to_str
source = source.to_str
elsif source.respond_to? :to_io
source = source.to_io.read
- else
+ elsif source.respond_to?(:read)
source = source.read
end
- result = parse(source, :max_nesting => false, :allow_nan => true)
+ if opts[:quirks_mode] && (source.nil? || source.empty?)
+ source = 'null'
+ end
+ result = parse(source, opts)
recurse_proc(result, &proc) if proc
result
end
@@ -309,16 +340,32 @@ module JSON
alias restore load
module_function :restore
+ class << self
+ # The global default options for the JSON.dump method:
+ # :max_nesting: false
+ # :allow_nan: true
+ # :quirks_mode: true
+ attr_accessor :dump_default_options
+ end
+ self.dump_default_options = {
+ :max_nesting => false,
+ :allow_nan => true,
+ :quirks_mode => true,
+ }
+
# Dumps _obj_ as a JSON string, i.e. calls generate on the object and returns
# the result.
#
- # If anIO (an IO like object or an object that responds to the write method)
+ # If anIO (an IO-like object or an object that responds to the write method)
# was given, the resulting JSON is written to it.
#
- # If the number of nested arrays or objects exceeds _limit_ an ArgumentError
+ # If the number of nested arrays or objects exceeds _limit_, an ArgumentError
# exception is raised. This argument is similar (but not exactly the
# same!) to the _limit_ argument in Marshal.dump.
#
+ # The default options for the generator can be changed via the
+ # dump_default_options method.
+ #
# This method is part of the implementation of the load/dump interface of
# Marshal and YAML.
def dump(obj, anIO = nil, limit = nil)
@@ -329,8 +376,9 @@ module JSON
anIO = nil
end
end
- limit ||= 0
- result = generate(obj, :allow_nan => true, :max_nesting => limit)
+ opts = JSON.dump_default_options
+ limit and opts.update(:max_nesting => limit)
+ result = generate(obj, opts)
if anIO
anIO.write result
anIO
@@ -396,11 +444,11 @@ module ::Kernel
nil
end
- # If _object_ is string-like parse the string and return the parsed result as
- # a Ruby data structure. Otherwise generate a JSON text from the Ruby data
+ # If _object_ is string-like, parse the string and return the parsed result as
+ # a Ruby data structure. Otherwise, generate a JSON text from the Ruby data
# structure object and return it.
#
- # The _opts_ argument is passed through to generate/parse respectively, see
+ # The _opts_ argument is passed through to generate/parse respectively. See
# generate and parse for their documentation.
def JSON(object, *args)
if object.respond_to? :to_str
@@ -413,10 +461,10 @@ end
# Extends any Class to include _json_creatable?_ method.
class ::Class
- # Returns true, if this class can be used to create an instance
+ # Returns true if this class can be used to create an instance
# from a serialised JSON string. The class has to implement a class
- # method _json_create_ that expects a hash as first parameter, which includes
- # the required data.
+ # method _json_create_ that expects a hash as first parameter. The hash
+ # should include the required data.
def json_creatable?
respond_to?(:json_create)
end
diff --git a/ext/json/lib/json/ext.rb b/ext/json/lib/json/ext.rb
index 1fbc3fd7d1..c5f813181d 100644
--- a/ext/json/lib/json/ext.rb
+++ b/ext/json/lib/json/ext.rb
@@ -1,24 +1,17 @@
+if ENV['SIMPLECOV_COVERAGE'].to_i == 1
+ require 'simplecov'
+ SimpleCov.start do
+ add_filter "/tests/"
+ end
+end
require 'json/common'
module JSON
# This module holds all the modules/classes that implement JSON's
# functionality as C extensions.
module Ext
- begin
- if defined?(RUBY_ENGINE) == 'constant' and RUBY_ENGINE == 'ruby' and RUBY_VERSION =~ /\A1\.9\./
- require 'json/ext/1.9/parser'
- require 'json/ext/1.9/generator'
- elsif !defined?(RUBY_ENGINE) && RUBY_VERSION =~ /\A1\.8\./
- require 'json/ext/1.8/parser'
- require 'json/ext/1.8/generator'
- else
- require 'json/ext/parser'
- require 'json/ext/generator'
- end
- rescue LoadError
- require 'json/ext/parser'
- require 'json/ext/generator'
- end
+ require 'json/ext/parser'
+ require 'json/ext/generator'
$DEBUG and warn "Using Ext extension for JSON."
JSON.parser = Parser
JSON.generator = Generator
diff --git a/ext/json/lib/json/generic_object.rb b/ext/json/lib/json/generic_object.rb
new file mode 100644
index 0000000000..7f3dbbd78d
--- /dev/null
+++ b/ext/json/lib/json/generic_object.rb
@@ -0,0 +1,39 @@
+require 'ostruct'
+
+module JSON
+ class GenericObject < OpenStruct
+ class << self
+ alias [] new
+
+ def json_create(data)
+ data = data.dup
+ data.delete JSON.create_id
+ self[data]
+ end
+ end
+
+ def to_hash
+ table
+ end
+
+ def [](name)
+ table[name.to_sym]
+ end
+
+ def []=(name, value)
+ __send__ "#{name}=", value
+ end
+
+ def |(other)
+ self.class[other.to_hash.merge(to_hash)]
+ end
+
+ def as_json(*)
+ { JSON.create_id => self.class.name }.merge to_hash
+ end
+
+ def to_json(*a)
+ as_json.to_json(*a)
+ end
+ end
+end
diff --git a/ext/json/lib/json/version.rb b/ext/json/lib/json/version.rb
index 2175ac0f90..b1cf47f295 100644
--- a/ext/json/lib/json/version.rb
+++ b/ext/json/lib/json/version.rb
@@ -1,6 +1,6 @@
module JSON
# JSON version
- VERSION = '1.5.4'
+ VERSION = '1.7.1'
VERSION_ARRAY = VERSION.split(/\./).map { |x| x.to_i } # :nodoc:
VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
diff --git a/ext/json/parser/depend b/ext/json/parser/depend
index 5eaf6dd040..25e74781e6 100644
--- a/ext/json/parser/depend
+++ b/ext/json/parser/depend
@@ -1 +1 @@
-parser.o: parser.c parser.h
+parser.o: parser.c parser.h $(srcdir)/../fbuffer/fbuffer.h $(ruby_headers)
diff --git a/ext/json/parser/extconf.rb b/ext/json/parser/extconf.rb
index 4a10dd2ed6..ae4f861c79 100644
--- a/ext/json/parser/extconf.rb
+++ b/ext/json/parser/extconf.rb
@@ -1,10 +1,3 @@
require 'mkmf'
-require 'rbconfig'
-if RUBY_VERSION < "1.9"
- have_header("re.h")
-else
- have_header("ruby/re.h")
- have_header("ruby/encoding.h")
-end
create_makefile 'json/ext/parser'
diff --git a/ext/json/parser/parser.c b/ext/json/parser/parser.c
index af57b81c46..c140fdb2fe 100644
--- a/ext/json/parser/parser.c
+++ b/ext/json/parser/parser.c
@@ -1,5 +1,6 @@
#line 1 "parser.rl"
+#include "../fbuffer/fbuffer.h"
#include "parser.h"
/* unicode */
@@ -78,15 +79,16 @@ static VALUE mJSON, mExt, cParser, eParserError, eNestingError;
static VALUE CNaN, CInfinity, CMinusInfinity;
static ID i_json_creatable_p, i_json_create, i_create_id, i_create_additions,
- i_chr, i_max_nesting, i_allow_nan, i_symbolize_names, i_object_class,
- i_array_class, i_key_p, i_deep_const_get, i_match, i_match_string, i_aset, i_leftshift;
+ i_chr, i_max_nesting, i_allow_nan, i_symbolize_names, i_quirks_mode,
+ i_object_class, i_array_class, i_key_p, i_deep_const_get, i_match,
+ i_match_string, i_aset, i_aref, i_leftshift;
-#line 108 "parser.rl"
+#line 110 "parser.rl"
-#line 90 "parser.c"
+#line 92 "parser.c"
static const int JSON_object_start = 1;
static const int JSON_object_first_final = 27;
static const int JSON_object_error = 0;
@@ -94,7 +96,7 @@ static const int JSON_object_error = 0;
static const int JSON_object_en_main = 1;
-#line 148 "parser.rl"
+#line 151 "parser.rl"
static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *result)
@@ -110,14 +112,14 @@ static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *resu
*result = NIL_P(object_class) ? rb_hash_new() : rb_class_new_instance(0, 0, object_class);
-#line 114 "parser.c"
+#line 116 "parser.c"
{
cs = JSON_object_start;
}
-#line 163 "parser.rl"
+#line 166 "parser.rl"
-#line 121 "parser.c"
+#line 123 "parser.c"
{
if ( p == pe )
goto _test_eof;
@@ -145,7 +147,7 @@ case 2:
goto st2;
goto st0;
tr2:
-#line 131 "parser.rl"
+#line 133 "parser.rl"
{
char *np;
json->parsing_name = 1;
@@ -158,7 +160,7 @@ st3:
if ( ++p == pe )
goto _test_eof3;
case 3:
-#line 162 "parser.c"
+#line 164 "parser.c"
switch( (*p) ) {
case 13: goto st3;
case 32: goto st3;
@@ -225,7 +227,7 @@ case 8:
goto st8;
goto st0;
tr11:
-#line 116 "parser.rl"
+#line 118 "parser.rl"
{
VALUE v = Qnil;
char *np = JSON_parse_value(json, p, pe, &v);
@@ -245,7 +247,7 @@ st9:
if ( ++p == pe )
goto _test_eof9;
case 9:
-#line 249 "parser.c"
+#line 251 "parser.c"
switch( (*p) ) {
case 13: goto st9;
case 32: goto st9;
@@ -334,14 +336,14 @@ case 18:
goto st9;
goto st18;
tr4:
-#line 139 "parser.rl"
+#line 141 "parser.rl"
{ p--; {p++; cs = 27; goto _out;} }
goto st27;
st27:
if ( ++p == pe )
goto _test_eof27;
case 27:
-#line 345 "parser.c"
+#line 347 "parser.c"
goto st0;
st19:
if ( ++p == pe )
@@ -439,11 +441,16 @@ case 26:
_out: {}
}
-#line 164 "parser.rl"
+#line 167 "parser.rl"
if (cs >= JSON_object_first_final) {
if (json->create_additions) {
- VALUE klassname = rb_hash_aref(*result, json->create_id);
+ VALUE klassname;
+ if (NIL_P(json->object_class)) {
+ klassname = rb_hash_aref(*result, json->create_id);
+ } else {
+ klassname = rb_funcall(*result, i_aref, 1, json->create_id);
+ }
if (!NIL_P(klassname)) {
VALUE klass = rb_funcall(mJSON, i_deep_const_get, 1, klassname);
if (RTEST(rb_funcall(klass, i_json_creatable_p, 0))) {
@@ -458,7 +465,8 @@ case 26:
}
-#line 462 "parser.c"
+
+#line 470 "parser.c"
static const int JSON_value_start = 1;
static const int JSON_value_first_final = 21;
static const int JSON_value_error = 0;
@@ -466,7 +474,7 @@ static const int JSON_value_error = 0;
static const int JSON_value_en_main = 1;
-#line 262 "parser.rl"
+#line 271 "parser.rl"
static char *JSON_parse_value(JSON_Parser *json, char *p, char *pe, VALUE *result)
@@ -474,14 +482,14 @@ static char *JSON_parse_value(JSON_Parser *json, char *p, char *pe, VALUE *resul
int cs = EVIL;
-#line 478 "parser.c"
+#line 486 "parser.c"
{
cs = JSON_value_start;
}
-#line 269 "parser.rl"
+#line 278 "parser.rl"
-#line 485 "parser.c"
+#line 493 "parser.c"
{
if ( p == pe )
goto _test_eof;
@@ -506,17 +514,17 @@ st0:
cs = 0;
goto _out;
tr0:
-#line 210 "parser.rl"
+#line 219 "parser.rl"
{
char *np = JSON_parse_string(json, p, pe, result);
if (np == NULL) { p--; {p++; cs = 21; goto _out;} } else {p = (( np))-1;}
}
goto st21;
tr2:
-#line 215 "parser.rl"
+#line 224 "parser.rl"
{
char *np;
- if(pe > p + 9 && !strncmp(MinusInfinity, p, 9)) {
+ if(pe > p + 9 - json->quirks_mode && !strncmp(MinusInfinity, p, 9)) {
if (json->allow_nan) {
*result = CMinusInfinity;
{p = (( p + 10))-1;}
@@ -533,7 +541,7 @@ tr2:
}
goto st21;
tr5:
-#line 233 "parser.rl"
+#line 242 "parser.rl"
{
char *np;
json->current_nesting++;
@@ -543,7 +551,7 @@ tr5:
}
goto st21;
tr9:
-#line 241 "parser.rl"
+#line 250 "parser.rl"
{
char *np;
json->current_nesting++;
@@ -553,7 +561,7 @@ tr9:
}
goto st21;
tr16:
-#line 203 "parser.rl"
+#line 212 "parser.rl"
{
if (json->allow_nan) {
*result = CInfinity;
@@ -563,7 +571,7 @@ tr16:
}
goto st21;
tr18:
-#line 196 "parser.rl"
+#line 205 "parser.rl"
{
if (json->allow_nan) {
*result = CNaN;
@@ -573,19 +581,19 @@ tr18:
}
goto st21;
tr22:
-#line 190 "parser.rl"
+#line 199 "parser.rl"
{
*result = Qfalse;
}
goto st21;
tr25:
-#line 187 "parser.rl"
+#line 196 "parser.rl"
{
*result = Qnil;
}
goto st21;
tr28:
-#line 193 "parser.rl"
+#line 202 "parser.rl"
{
*result = Qtrue;
}
@@ -594,9 +602,9 @@ st21:
if ( ++p == pe )
goto _test_eof21;
case 21:
-#line 249 "parser.rl"
+#line 258 "parser.rl"
{ p--; {p++; cs = 21; goto _out;} }
-#line 600 "parser.c"
+#line 608 "parser.c"
goto st0;
st2:
if ( ++p == pe )
@@ -757,7 +765,7 @@ case 20:
_out: {}
}
-#line 270 "parser.rl"
+#line 279 "parser.rl"
if (cs >= JSON_value_first_final) {
return p;
@@ -767,15 +775,15 @@ case 20:
}
-#line 771 "parser.c"
+#line 779 "parser.c"
static const int JSON_integer_start = 1;
-static const int JSON_integer_first_final = 5;
+static const int JSON_integer_first_final = 3;
static const int JSON_integer_error = 0;
static const int JSON_integer_en_main = 1;
-#line 286 "parser.rl"
+#line 295 "parser.rl"
static char *JSON_parse_integer(JSON_Parser *json, char *p, char *pe, VALUE *result)
@@ -783,15 +791,15 @@ static char *JSON_parse_integer(JSON_Parser *json, char *p, char *pe, VALUE *res
int cs = EVIL;
-#line 787 "parser.c"
+#line 795 "parser.c"
{
cs = JSON_integer_start;
}
-#line 293 "parser.rl"
+#line 302 "parser.rl"
json->memo = p;
-#line 795 "parser.c"
+#line 803 "parser.c"
{
if ( p == pe )
goto _test_eof;
@@ -803,7 +811,7 @@ case 1:
case 48: goto st3;
}
if ( 49 <= (*p) && (*p) <= 57 )
- goto st4;
+ goto st5;
goto st0;
st0:
cs = 0;
@@ -815,7 +823,7 @@ case 2:
if ( (*p) == 48 )
goto st3;
if ( 49 <= (*p) && (*p) <= 57 )
- goto st4;
+ goto st5;
goto st0;
st3:
if ( ++p == pe )
@@ -825,37 +833,40 @@ case 3:
goto st0;
goto tr4;
tr4:
-#line 283 "parser.rl"
- { p--; {p++; cs = 5; goto _out;} }
- goto st5;
-st5:
- if ( ++p == pe )
- goto _test_eof5;
-case 5:
-#line 836 "parser.c"
- goto st0;
+#line 292 "parser.rl"
+ { p--; {p++; cs = 4; goto _out;} }
+ goto st4;
st4:
if ( ++p == pe )
goto _test_eof4;
case 4:
+#line 844 "parser.c"
+ goto st0;
+st5:
+ if ( ++p == pe )
+ goto _test_eof5;
+case 5:
if ( 48 <= (*p) && (*p) <= 57 )
- goto st4;
+ goto st5;
goto tr4;
}
_test_eof2: cs = 2; goto _test_eof;
_test_eof3: cs = 3; goto _test_eof;
- _test_eof5: cs = 5; goto _test_eof;
_test_eof4: cs = 4; goto _test_eof;
+ _test_eof5: cs = 5; goto _test_eof;
_test_eof: {}
_out: {}
}
-#line 295 "parser.rl"
+#line 304 "parser.rl"
if (cs >= JSON_integer_first_final) {
long len = p - json->memo;
- *result = rb_Integer(rb_str_new(json->memo, len));
+ fbuffer_clear(json->fbuffer);
+ fbuffer_append(json->fbuffer, json->memo, len);
+ fbuffer_append_char(json->fbuffer, '\0');
+ *result = rb_cstr2inum(FBUFFER_PTR(json->fbuffer), 10);
return p + 1;
} else {
return NULL;
@@ -863,15 +874,15 @@ case 4:
}
-#line 867 "parser.c"
+#line 878 "parser.c"
static const int JSON_float_start = 1;
-static const int JSON_float_first_final = 10;
+static const int JSON_float_first_final = 8;
static const int JSON_float_error = 0;
static const int JSON_float_en_main = 1;
-#line 317 "parser.rl"
+#line 329 "parser.rl"
static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *result)
@@ -879,15 +890,15 @@ static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *resul
int cs = EVIL;
-#line 883 "parser.c"
+#line 894 "parser.c"
{
cs = JSON_float_start;
}
-#line 324 "parser.rl"
+#line 336 "parser.rl"
json->memo = p;
-#line 891 "parser.c"
+#line 902 "parser.c"
{
if ( p == pe )
goto _test_eof;
@@ -899,7 +910,7 @@ case 1:
case 48: goto st3;
}
if ( 49 <= (*p) && (*p) <= 57 )
- goto st9;
+ goto st7;
goto st0;
st0:
cs = 0;
@@ -911,7 +922,7 @@ case 2:
if ( (*p) == 48 )
goto st3;
if ( 49 <= (*p) && (*p) <= 57 )
- goto st9;
+ goto st7;
goto st0;
st3:
if ( ++p == pe )
@@ -919,8 +930,8 @@ st3:
case 3:
switch( (*p) ) {
case 46: goto st4;
- case 69: goto st6;
- case 101: goto st6;
+ case 69: goto st5;
+ case 101: goto st5;
}
goto st0;
st4:
@@ -928,96 +939,99 @@ st4:
goto _test_eof4;
case 4:
if ( 48 <= (*p) && (*p) <= 57 )
- goto st5;
+ goto st8;
goto st0;
-st5:
+st8:
if ( ++p == pe )
- goto _test_eof5;
-case 5:
+ goto _test_eof8;
+case 8:
switch( (*p) ) {
- case 69: goto st6;
- case 101: goto st6;
+ case 69: goto st5;
+ case 101: goto st5;
}
if ( (*p) > 46 ) {
if ( 48 <= (*p) && (*p) <= 57 )
- goto st5;
+ goto st8;
} else if ( (*p) >= 45 )
goto st0;
- goto tr7;
-tr7:
-#line 311 "parser.rl"
- { p--; {p++; cs = 10; goto _out;} }
- goto st10;
-st10:
+ goto tr9;
+tr9:
+#line 323 "parser.rl"
+ { p--; {p++; cs = 9; goto _out;} }
+ goto st9;
+st9:
if ( ++p == pe )
- goto _test_eof10;
-case 10:
-#line 956 "parser.c"
+ goto _test_eof9;
+case 9:
+#line 967 "parser.c"
goto st0;
-st6:
+st5:
if ( ++p == pe )
- goto _test_eof6;
-case 6:
+ goto _test_eof5;
+case 5:
switch( (*p) ) {
- case 43: goto st7;
- case 45: goto st7;
+ case 43: goto st6;
+ case 45: goto st6;
}
if ( 48 <= (*p) && (*p) <= 57 )
- goto st8;
+ goto st10;
goto st0;
-st7:
+st6:
if ( ++p == pe )
- goto _test_eof7;
-case 7:
+ goto _test_eof6;
+case 6:
if ( 48 <= (*p) && (*p) <= 57 )
- goto st8;
+ goto st10;
goto st0;
-st8:
+st10:
if ( ++p == pe )
- goto _test_eof8;
-case 8:
+ goto _test_eof10;
+case 10:
switch( (*p) ) {
case 69: goto st0;
case 101: goto st0;
}
if ( (*p) > 46 ) {
if ( 48 <= (*p) && (*p) <= 57 )
- goto st8;
+ goto st10;
} else if ( (*p) >= 45 )
goto st0;
- goto tr7;
-st9:
+ goto tr9;
+st7:
if ( ++p == pe )
- goto _test_eof9;
-case 9:
+ goto _test_eof7;
+case 7:
switch( (*p) ) {
case 46: goto st4;
- case 69: goto st6;
- case 101: goto st6;
+ case 69: goto st5;
+ case 101: goto st5;
}
if ( 48 <= (*p) && (*p) <= 57 )
- goto st9;
+ goto st7;
goto st0;
}
_test_eof2: cs = 2; goto _test_eof;
_test_eof3: cs = 3; goto _test_eof;
_test_eof4: cs = 4; goto _test_eof;
+ _test_eof8: cs = 8; goto _test_eof;
+ _test_eof9: cs = 9; goto _test_eof;
_test_eof5: cs = 5; goto _test_eof;
- _test_eof10: cs = 10; goto _test_eof;
_test_eof6: cs = 6; goto _test_eof;
+ _test_eof10: cs = 10; goto _test_eof;
_test_eof7: cs = 7; goto _test_eof;
- _test_eof8: cs = 8; goto _test_eof;
- _test_eof9: cs = 9; goto _test_eof;
_test_eof: {}
_out: {}
}
-#line 326 "parser.rl"
+#line 338 "parser.rl"
if (cs >= JSON_float_first_final) {
long len = p - json->memo;
- *result = rb_Float(rb_str_new(json->memo, len));
+ fbuffer_clear(json->fbuffer);
+ fbuffer_append(json->fbuffer, json->memo, len);
+ fbuffer_append_char(json->fbuffer, '\0');
+ *result = rb_float_new(rb_cstr_to_dbl(FBUFFER_PTR(json->fbuffer), 1));
return p + 1;
} else {
return NULL;
@@ -1026,7 +1040,7 @@ case 9:
-#line 1030 "parser.c"
+#line 1044 "parser.c"
static const int JSON_array_start = 1;
static const int JSON_array_first_final = 17;
static const int JSON_array_error = 0;
@@ -1034,7 +1048,7 @@ static const int JSON_array_error = 0;
static const int JSON_array_en_main = 1;
-#line 366 "parser.rl"
+#line 381 "parser.rl"
static char *JSON_parse_array(JSON_Parser *json, char *p, char *pe, VALUE *result)
@@ -1048,14 +1062,14 @@ static char *JSON_parse_array(JSON_Parser *json, char *p, char *pe, VALUE *resul
*result = NIL_P(array_class) ? rb_ary_new() : rb_class_new_instance(0, 0, array_class);
-#line 1052 "parser.c"
+#line 1066 "parser.c"
{
cs = JSON_array_start;
}
-#line 379 "parser.rl"
+#line 394 "parser.rl"
-#line 1059 "parser.c"
+#line 1073 "parser.c"
{
if ( p == pe )
goto _test_eof;
@@ -1094,7 +1108,7 @@ case 2:
goto st2;
goto st0;
tr2:
-#line 343 "parser.rl"
+#line 358 "parser.rl"
{
VALUE v = Qnil;
char *np = JSON_parse_value(json, p, pe, &v);
@@ -1114,7 +1128,7 @@ st3:
if ( ++p == pe )
goto _test_eof3;
case 3:
-#line 1118 "parser.c"
+#line 1132 "parser.c"
switch( (*p) ) {
case 13: goto st3;
case 32: goto st3;
@@ -1214,14 +1228,14 @@ case 12:
goto st3;
goto st12;
tr4:
-#line 358 "parser.rl"
+#line 373 "parser.rl"
{ p--; {p++; cs = 17; goto _out;} }
goto st17;
st17:
if ( ++p == pe )
goto _test_eof17;
case 17:
-#line 1225 "parser.c"
+#line 1239 "parser.c"
goto st0;
st13:
if ( ++p == pe )
@@ -1277,7 +1291,7 @@ case 16:
_out: {}
}
-#line 380 "parser.rl"
+#line 395 "parser.rl"
if(cs >= JSON_array_first_final) {
return p + 1;
@@ -1291,6 +1305,7 @@ static VALUE json_string_unescape(VALUE result, char *string, char *stringEnd)
{
char *p = string, *pe = string, *unescape;
int unescape_len;
+ char buf[4];
while (pe < stringEnd) {
if (*pe == '\\') {
@@ -1323,7 +1338,6 @@ static VALUE json_string_unescape(VALUE result, char *string, char *stringEnd)
if (pe > stringEnd - 4) {
return Qnil;
} else {
- char buf[4];
UTF32 ch = unescape_unicode((unsigned char *) ++pe);
pe += 3;
if (UNI_SUR_HIGH_START == (ch & 0xFC00)) {
@@ -1358,7 +1372,7 @@ static VALUE json_string_unescape(VALUE result, char *string, char *stringEnd)
}
-#line 1362 "parser.c"
+#line 1376 "parser.c"
static const int JSON_string_start = 1;
static const int JSON_string_first_final = 8;
static const int JSON_string_error = 0;
@@ -1366,7 +1380,7 @@ static const int JSON_string_error = 0;
static const int JSON_string_en_main = 1;
-#line 479 "parser.rl"
+#line 494 "parser.rl"
static int
@@ -1388,15 +1402,15 @@ static char *JSON_parse_string(JSON_Parser *json, char *p, char *pe, VALUE *resu
*result = rb_str_buf_new(0);
-#line 1392 "parser.c"
+#line 1406 "parser.c"
{
cs = JSON_string_start;
}
-#line 500 "parser.rl"
+#line 515 "parser.rl"
json->memo = p;
-#line 1400 "parser.c"
+#line 1414 "parser.c"
{
if ( p == pe )
goto _test_eof;
@@ -1421,7 +1435,7 @@ case 2:
goto st0;
goto st2;
tr2:
-#line 465 "parser.rl"
+#line 480 "parser.rl"
{
*result = json_string_unescape(*result, json->memo + 1, p);
if (NIL_P(*result)) {
@@ -1432,14 +1446,14 @@ tr2:
{p = (( p + 1))-1;}
}
}
-#line 476 "parser.rl"
+#line 491 "parser.rl"
{ p--; {p++; cs = 8; goto _out;} }
goto st8;
st8:
if ( ++p == pe )
goto _test_eof8;
case 8:
-#line 1443 "parser.c"
+#line 1457 "parser.c"
goto st0;
st3:
if ( ++p == pe )
@@ -1515,7 +1529,7 @@ case 7:
_out: {}
}
-#line 502 "parser.rl"
+#line 517 "parser.rl"
if (json->create_additions && RTEST(match_string = json->match_string)) {
VALUE klass;
@@ -1538,19 +1552,6 @@ case 7:
}
}
-
-
-#line 1544 "parser.c"
-static const int JSON_start = 1;
-static const int JSON_first_final = 10;
-static const int JSON_error = 0;
-
-static const int JSON_en_main = 1;
-
-
-#line 550 "parser.rl"
-
-
/*
* Document-class: JSON::Ext::Parser
*
@@ -1632,8 +1633,6 @@ static VALUE convert_encoding(VALUE source)
*/
static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
{
- char *ptr;
- long len;
VALUE source, opts;
GET_PARSER_INIT;
@@ -1641,9 +1640,6 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
rb_raise(rb_eTypeError, "already initialized instance");
}
rb_scan_args(argc, argv, "11", &source, &opts);
- source = convert_encoding(StringValue(source));
- ptr = RSTRING_PTR(source);
- len = RSTRING_LEN(source);
if (!NIL_P(opts)) {
opts = rb_convert_type(opts, T_HASH, "Hash", "to_hash");
if (NIL_P(opts)) {
@@ -1673,6 +1669,13 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
} else {
json->symbolize_names = 0;
}
+ tmp = ID2SYM(i_quirks_mode);
+ if (option_given_p(opts, tmp)) {
+ VALUE quirks_mode = rb_hash_aref(opts, tmp);
+ json->quirks_mode = RTEST(quirks_mode) ? 1 : 0;
+ } else {
+ json->quirks_mode = 0;
+ }
tmp = ID2SYM(i_create_additions);
if (option_given_p(opts, tmp)) {
json->create_additions = RTEST(rb_hash_aref(opts, tmp));
@@ -1713,20 +1716,31 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
json->object_class = Qnil;
json->array_class = Qnil;
}
+ source = rb_convert_type(source, T_STRING, "String", "to_str");
+ if (!json->quirks_mode) {
+ source = convert_encoding(StringValue(source));
+ }
json->current_nesting = 0;
- json->len = len;
- json->source = ptr;
+ StringValue(source);
+ json->len = RSTRING_LEN(source);
+ json->source = RSTRING_PTR(source);;
json->Vsource = source;
return self;
}
-/*
- * call-seq: parse()
- *
- * Parses the current JSON text _source_ and returns the complete data
- * structure as a result.
- */
-static VALUE cParser_parse(VALUE self)
+
+#line 1733 "parser.c"
+static const int JSON_start = 1;
+static const int JSON_first_final = 10;
+static const int JSON_error = 0;
+
+static const int JSON_en_main = 1;
+
+
+#line 740 "parser.rl"
+
+
+static VALUE cParser_parse_strict(VALUE self)
{
char *p, *pe;
int cs = EVIL;
@@ -1734,16 +1748,16 @@ static VALUE cParser_parse(VALUE self)
GET_PARSER;
-#line 1738 "parser.c"
+#line 1752 "parser.c"
{
cs = JSON_start;
}
-#line 735 "parser.rl"
+#line 750 "parser.rl"
p = json->source;
pe = p + json->len;
-#line 1747 "parser.c"
+#line 1761 "parser.c"
{
if ( p == pe )
goto _test_eof;
@@ -1799,7 +1813,7 @@ case 5:
goto st1;
goto st5;
tr3:
-#line 539 "parser.rl"
+#line 729 "parser.rl"
{
char *np;
json->current_nesting = 1;
@@ -1808,7 +1822,7 @@ tr3:
}
goto st10;
tr4:
-#line 532 "parser.rl"
+#line 722 "parser.rl"
{
char *np;
json->current_nesting = 1;
@@ -1820,7 +1834,7 @@ st10:
if ( ++p == pe )
goto _test_eof10;
case 10:
-#line 1824 "parser.c"
+#line 1838 "parser.c"
switch( (*p) ) {
case 13: goto st10;
case 32: goto st10;
@@ -1877,7 +1891,7 @@ case 9:
_out: {}
}
-#line 738 "parser.rl"
+#line 753 "parser.rl"
if (cs >= JSON_first_final && p == pe) {
return result;
@@ -1887,10 +1901,202 @@ case 9:
}
}
+
+
+#line 1907 "parser.c"
+static const int JSON_quirks_mode_start = 1;
+static const int JSON_quirks_mode_first_final = 10;
+static const int JSON_quirks_mode_error = 0;
+
+static const int JSON_quirks_mode_en_main = 1;
+
+
+#line 778 "parser.rl"
+
+
+static VALUE cParser_parse_quirks_mode(VALUE self)
+{
+ char *p, *pe;
+ int cs = EVIL;
+ VALUE result = Qnil;
+ GET_PARSER;
+
+
+#line 1926 "parser.c"
+ {
+ cs = JSON_quirks_mode_start;
+ }
+
+#line 788 "parser.rl"
+ p = json->source;
+ pe = p + json->len;
+
+#line 1935 "parser.c"
+ {
+ if ( p == pe )
+ goto _test_eof;
+ switch ( cs )
+ {
+st1:
+ if ( ++p == pe )
+ goto _test_eof1;
+case 1:
+ switch( (*p) ) {
+ case 13: goto st1;
+ case 32: goto st1;
+ case 34: goto tr2;
+ case 45: goto tr2;
+ case 47: goto st6;
+ case 73: goto tr2;
+ case 78: goto tr2;
+ case 91: goto tr2;
+ case 102: goto tr2;
+ case 110: goto tr2;
+ case 116: goto tr2;
+ case 123: goto tr2;
+ }
+ if ( (*p) > 10 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto tr2;
+ } else if ( (*p) >= 9 )
+ goto st1;
+ goto st0;
+st0:
+cs = 0;
+ goto _out;
+tr2:
+#line 770 "parser.rl"
+ {
+ char *np = JSON_parse_value(json, p, pe, &result);
+ if (np == NULL) { p--; {p++; cs = 10; goto _out;} } else {p = (( np))-1;}
+ }
+ goto st10;
+st10:
+ if ( ++p == pe )
+ goto _test_eof10;
+case 10:
+#line 1979 "parser.c"
+ switch( (*p) ) {
+ case 13: goto st10;
+ case 32: goto st10;
+ case 47: goto st2;
+ }
+ if ( 9 <= (*p) && (*p) <= 10 )
+ goto st10;
+ goto st0;
+st2:
+ if ( ++p == pe )
+ goto _test_eof2;
+case 2:
+ switch( (*p) ) {
+ case 42: goto st3;
+ case 47: goto st5;
+ }
+ goto st0;
+st3:
+ if ( ++p == pe )
+ goto _test_eof3;
+case 3:
+ if ( (*p) == 42 )
+ goto st4;
+ goto st3;
+st4:
+ if ( ++p == pe )
+ goto _test_eof4;
+case 4:
+ switch( (*p) ) {
+ case 42: goto st4;
+ case 47: goto st10;
+ }
+ goto st3;
+st5:
+ if ( ++p == pe )
+ goto _test_eof5;
+case 5:
+ if ( (*p) == 10 )
+ goto st10;
+ goto st5;
+st6:
+ if ( ++p == pe )
+ goto _test_eof6;
+case 6:
+ switch( (*p) ) {
+ case 42: goto st7;
+ case 47: goto st9;
+ }
+ goto st0;
+st7:
+ if ( ++p == pe )
+ goto _test_eof7;
+case 7:
+ if ( (*p) == 42 )
+ goto st8;
+ goto st7;
+st8:
+ if ( ++p == pe )
+ goto _test_eof8;
+case 8:
+ switch( (*p) ) {
+ case 42: goto st8;
+ case 47: goto st1;
+ }
+ goto st7;
+st9:
+ if ( ++p == pe )
+ goto _test_eof9;
+case 9:
+ if ( (*p) == 10 )
+ goto st1;
+ goto st9;
+ }
+ _test_eof1: cs = 1; goto _test_eof;
+ _test_eof10: cs = 10; goto _test_eof;
+ _test_eof2: cs = 2; goto _test_eof;
+ _test_eof3: cs = 3; goto _test_eof;
+ _test_eof4: cs = 4; goto _test_eof;
+ _test_eof5: cs = 5; goto _test_eof;
+ _test_eof6: cs = 6; goto _test_eof;
+ _test_eof7: cs = 7; goto _test_eof;
+ _test_eof8: cs = 8; goto _test_eof;
+ _test_eof9: cs = 9; goto _test_eof;
+
+ _test_eof: {}
+ _out: {}
+ }
+
+#line 791 "parser.rl"
+
+ if (cs >= JSON_quirks_mode_first_final && p == pe) {
+ return result;
+ } else {
+ rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
+ return Qnil;
+ }
+}
+
+/*
+ * call-seq: parse()
+ *
+ * Parses the current JSON text _source_ and returns the complete data
+ * structure as a result.
+ */
+static VALUE cParser_parse(VALUE self)
+{
+ GET_PARSER;
+
+ if (json->quirks_mode) {
+ return cParser_parse_quirks_mode(self);
+ } else {
+ return cParser_parse_strict(self);
+ }
+}
+
+
static JSON_Parser *JSON_allocate()
{
JSON_Parser *json = ALLOC(JSON_Parser);
MEMZERO(json, JSON_Parser, 1);
+ json->fbuffer = fbuffer_alloc(0);
return json;
}
@@ -1905,6 +2111,7 @@ static void JSON_mark(JSON_Parser *json)
static void JSON_free(JSON_Parser *json)
{
+ fbuffer_free(json->fbuffer);
ruby_xfree(json);
}
@@ -1926,6 +2133,18 @@ static VALUE cParser_source(VALUE self)
return rb_str_dup(json->Vsource);
}
+/*
+ * call-seq: quirks_mode?()
+ *
+ * Returns a true, if this parser is in quirks_mode, false otherwise.
+ */
+static VALUE cParser_quirks_mode_p(VALUE self)
+{
+ GET_PARSER;
+ return json->quirks_mode ? Qtrue : Qfalse;
+}
+
+
void Init_parser()
{
rb_require("json/common");
@@ -1938,6 +2157,7 @@ void Init_parser()
rb_define_method(cParser, "initialize", cParser_initialize, -1);
rb_define_method(cParser, "parse", cParser_parse, 0);
rb_define_method(cParser, "source", cParser_source, 0);
+ rb_define_method(cParser, "quirks_mode?", cParser_quirks_mode_p, 0);
CNaN = rb_const_get(mJSON, rb_intern("NaN"));
CInfinity = rb_const_get(mJSON, rb_intern("Infinity"));
@@ -1951,6 +2171,7 @@ void Init_parser()
i_max_nesting = rb_intern("max_nesting");
i_allow_nan = rb_intern("allow_nan");
i_symbolize_names = rb_intern("symbolize_names");
+ i_quirks_mode = rb_intern("quirks_mode");
i_object_class = rb_intern("object_class");
i_array_class = rb_intern("array_class");
i_match = rb_intern("match");
@@ -1958,6 +2179,7 @@ void Init_parser()
i_key_p = rb_intern("key?");
i_deep_const_get = rb_intern("deep_const_get");
i_aset = rb_intern("[]=");
+ i_aref = rb_intern("[]");
i_leftshift = rb_intern("<<");
#ifdef HAVE_RUBY_ENCODING_H
CEncoding_UTF_8 = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("utf-8"));
diff --git a/ext/json/parser/parser.h b/ext/json/parser/parser.h
index f2ce5a4c2f..b192064c09 100644
--- a/ext/json/parser/parser.h
+++ b/ext/json/parser/parser.h
@@ -3,16 +3,10 @@
#include "ruby.h"
-#if HAVE_RE_H
+#ifndef HAVE_RUBY_RE_H
#include "re.h"
#endif
-#ifdef HAVE_RUBY_ENCODING_H
-#include "ruby/encoding.h"
-#define FORCE_UTF8(obj) ((obj) = rb_enc_associate(rb_str_dup(obj), rb_utf8_encoding()))
-#else
-#define FORCE_UTF8(obj)
-#endif
#ifdef HAVE_RUBY_ST_H
#include "ruby/st.h"
#else
@@ -44,10 +38,12 @@ typedef struct JSON_ParserStruct {
int allow_nan;
int parsing_name;
int symbolize_names;
+ int quirks_mode;
VALUE object_class;
VALUE array_class;
int create_additions;
VALUE match_string;
+ FBuffer *fbuffer;
} JSON_Parser;
#define GET_PARSER \
diff --git a/ext/json/parser/parser.rl b/ext/json/parser/parser.rl
index 21b445e3c0..20ecc486e1 100644
--- a/ext/json/parser/parser.rl
+++ b/ext/json/parser/parser.rl
@@ -1,3 +1,4 @@
+#include "../fbuffer/fbuffer.h"
#include "parser.h"
/* unicode */
@@ -76,8 +77,9 @@ static VALUE mJSON, mExt, cParser, eParserError, eNestingError;
static VALUE CNaN, CInfinity, CMinusInfinity;
static ID i_json_creatable_p, i_json_create, i_create_id, i_create_additions,
- i_chr, i_max_nesting, i_allow_nan, i_symbolize_names, i_object_class,
- i_array_class, i_key_p, i_deep_const_get, i_match, i_match_string, i_aset, i_leftshift;
+ i_chr, i_max_nesting, i_allow_nan, i_symbolize_names, i_quirks_mode,
+ i_object_class, i_array_class, i_key_p, i_deep_const_get, i_match,
+ i_match_string, i_aset, i_aref, i_leftshift;
%%{
machine JSON_common;
@@ -138,13 +140,14 @@ static ID i_json_creatable_p, i_json_create, i_create_id, i_create_additions,
action exit { fhold; fbreak; }
- a_pair = ignore* begin_name >parse_name
- ignore* name_separator ignore*
- begin_value >parse_value;
+ pair = ignore* begin_name >parse_name ignore* name_separator ignore* begin_value >parse_value;
+ next_pair = ignore* value_separator pair;
- main := begin_object
- (a_pair (ignore* value_separator a_pair)*)?
- ignore* end_object @exit;
+ main := (
+ begin_object
+ (pair (next_pair)*)? ignore*
+ end_object
+ ) @exit;
}%%
static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *result)
@@ -164,7 +167,12 @@ static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *resu
if (cs >= JSON_object_first_final) {
if (json->create_additions) {
- VALUE klassname = rb_hash_aref(*result, json->create_id);
+ VALUE klassname;
+ if (NIL_P(json->object_class)) {
+ klassname = rb_hash_aref(*result, json->create_id);
+ } else {
+ klassname = rb_funcall(*result, i_aref, 1, json->create_id);
+ }
if (!NIL_P(klassname)) {
VALUE klass = rb_funcall(mJSON, i_deep_const_get, 1, klassname);
if (RTEST(rb_funcall(klass, i_json_creatable_p, 0))) {
@@ -178,6 +186,7 @@ static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *resu
}
}
+
%%{
machine JSON_value;
include JSON_common;
@@ -214,7 +223,7 @@ static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *resu
action parse_number {
char *np;
- if(pe > fpc + 9 && !strncmp(MinusInfinity, fpc, 9)) {
+ if(pe > fpc + 9 - json->quirks_mode && !strncmp(MinusInfinity, fpc, 9)) {
if (json->allow_nan) {
*result = CMinusInfinity;
fexec p + 10;
@@ -282,7 +291,7 @@ static char *JSON_parse_value(JSON_Parser *json, char *p, char *pe, VALUE *resul
action exit { fhold; fbreak; }
- main := '-'? ('0' | [1-9][0-9]*) (^[0-9] @exit);
+ main := '-'? ('0' | [1-9][0-9]*) (^[0-9]? @exit);
}%%
static char *JSON_parse_integer(JSON_Parser *json, char *p, char *pe, VALUE *result)
@@ -295,7 +304,10 @@ static char *JSON_parse_integer(JSON_Parser *json, char *p, char *pe, VALUE *res
if (cs >= JSON_integer_first_final) {
long len = p - json->memo;
- *result = rb_Integer(rb_str_new(json->memo, len));
+ fbuffer_clear(json->fbuffer);
+ fbuffer_append(json->fbuffer, json->memo, len);
+ fbuffer_append_char(json->fbuffer, '\0');
+ *result = rb_cstr2inum(FBUFFER_PTR(json->fbuffer), 10);
return p + 1;
} else {
return NULL;
@@ -313,7 +325,7 @@ static char *JSON_parse_integer(JSON_Parser *json, char *p, char *pe, VALUE *res
main := '-'? (
(('0' | [1-9][0-9]*) '.' [0-9]+ ([Ee] [+\-]?[0-9]+)?)
| (('0' | [1-9][0-9]*) ([Ee] [+\-]?[0-9]+))
- ) (^[0-9Ee.\-] @exit );
+ ) (^[0-9Ee.\-]? @exit );
}%%
static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *result)
@@ -326,7 +338,10 @@ static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *resul
if (cs >= JSON_float_first_final) {
long len = p - json->memo;
- *result = rb_Float(rb_str_new(json->memo, len));
+ fbuffer_clear(json->fbuffer);
+ fbuffer_append(json->fbuffer, json->memo, len);
+ fbuffer_append_char(json->fbuffer, '\0');
+ *result = rb_float_new(rb_cstr_to_dbl(FBUFFER_PTR(json->fbuffer), 1));
return p + 1;
} else {
return NULL;
@@ -390,6 +405,7 @@ static VALUE json_string_unescape(VALUE result, char *string, char *stringEnd)
{
char *p = string, *pe = string, *unescape;
int unescape_len;
+ char buf[4];
while (pe < stringEnd) {
if (*pe == '\\') {
@@ -422,7 +438,6 @@ static VALUE json_string_unescape(VALUE result, char *string, char *stringEnd)
if (pe > stringEnd - 4) {
return Qnil;
} else {
- char buf[4];
UTF32 ch = unescape_unicode((unsigned char *) ++pe);
pe += 3;
if (UNI_SUR_HIGH_START == (ch & 0xFC00)) {
@@ -521,34 +536,6 @@ static char *JSON_parse_string(JSON_Parser *json, char *p, char *pe, VALUE *resu
}
}
-
-%%{
- machine JSON;
-
- write data;
-
- include JSON_common;
-
- action parse_object {
- char *np;
- json->current_nesting = 1;
- np = JSON_parse_object(json, fpc, pe, &result);
- if (np == NULL) { fhold; fbreak; } else fexec np;
- }
-
- action parse_array {
- char *np;
- json->current_nesting = 1;
- np = JSON_parse_array(json, fpc, pe, &result);
- if (np == NULL) { fhold; fbreak; } else fexec np;
- }
-
- main := ignore* (
- begin_object >parse_object |
- begin_array >parse_array
- ) ignore*;
-}%%
-
/*
* Document-class: JSON::Ext::Parser
*
@@ -630,8 +617,6 @@ static VALUE convert_encoding(VALUE source)
*/
static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
{
- char *ptr;
- long len;
VALUE source, opts;
GET_PARSER_INIT;
@@ -639,9 +624,6 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
rb_raise(rb_eTypeError, "already initialized instance");
}
rb_scan_args(argc, argv, "11", &source, &opts);
- source = convert_encoding(StringValue(source));
- ptr = RSTRING_PTR(source);
- len = RSTRING_LEN(source);
if (!NIL_P(opts)) {
opts = rb_convert_type(opts, T_HASH, "Hash", "to_hash");
if (NIL_P(opts)) {
@@ -671,6 +653,13 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
} else {
json->symbolize_names = 0;
}
+ tmp = ID2SYM(i_quirks_mode);
+ if (option_given_p(opts, tmp)) {
+ VALUE quirks_mode = rb_hash_aref(opts, tmp);
+ json->quirks_mode = RTEST(quirks_mode) ? 1 : 0;
+ } else {
+ json->quirks_mode = 0;
+ }
tmp = ID2SYM(i_create_additions);
if (option_given_p(opts, tmp)) {
json->create_additions = RTEST(rb_hash_aref(opts, tmp));
@@ -711,20 +700,46 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
json->object_class = Qnil;
json->array_class = Qnil;
}
+ source = rb_convert_type(source, T_STRING, "String", "to_str");
+ if (!json->quirks_mode) {
+ source = convert_encoding(StringValue(source));
+ }
json->current_nesting = 0;
- json->len = len;
- json->source = ptr;
+ StringValue(source);
+ json->len = RSTRING_LEN(source);
+ json->source = RSTRING_PTR(source);;
json->Vsource = source;
return self;
}
-/*
- * call-seq: parse()
- *
- * Parses the current JSON text _source_ and returns the complete data
- * structure as a result.
- */
-static VALUE cParser_parse(VALUE self)
+%%{
+ machine JSON;
+
+ write data;
+
+ include JSON_common;
+
+ action parse_object {
+ char *np;
+ json->current_nesting = 1;
+ np = JSON_parse_object(json, fpc, pe, &result);
+ if (np == NULL) { fhold; fbreak; } else fexec np;
+ }
+
+ action parse_array {
+ char *np;
+ json->current_nesting = 1;
+ np = JSON_parse_array(json, fpc, pe, &result);
+ if (np == NULL) { fhold; fbreak; } else fexec np;
+ }
+
+ main := ignore* (
+ begin_object >parse_object |
+ begin_array >parse_array
+ ) ignore*;
+}%%
+
+static VALUE cParser_parse_strict(VALUE self)
{
char *p, *pe;
int cs = EVIL;
@@ -744,10 +759,67 @@ static VALUE cParser_parse(VALUE self)
}
}
+
+%%{
+ machine JSON_quirks_mode;
+
+ write data;
+
+ include JSON_common;
+
+ action parse_value {
+ char *np = JSON_parse_value(json, fpc, pe, &result);
+ if (np == NULL) { fhold; fbreak; } else fexec np;
+ }
+
+ main := ignore* (
+ begin_value >parse_value
+ ) ignore*;
+}%%
+
+static VALUE cParser_parse_quirks_mode(VALUE self)
+{
+ char *p, *pe;
+ int cs = EVIL;
+ VALUE result = Qnil;
+ GET_PARSER;
+
+ %% write init;
+ p = json->source;
+ pe = p + json->len;
+ %% write exec;
+
+ if (cs >= JSON_quirks_mode_first_final && p == pe) {
+ return result;
+ } else {
+ rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
+ return Qnil;
+ }
+}
+
+/*
+ * call-seq: parse()
+ *
+ * Parses the current JSON text _source_ and returns the complete data
+ * structure as a result.
+ */
+static VALUE cParser_parse(VALUE self)
+{
+ GET_PARSER;
+
+ if (json->quirks_mode) {
+ return cParser_parse_quirks_mode(self);
+ } else {
+ return cParser_parse_strict(self);
+ }
+}
+
+
static JSON_Parser *JSON_allocate()
{
JSON_Parser *json = ALLOC(JSON_Parser);
MEMZERO(json, JSON_Parser, 1);
+ json->fbuffer = fbuffer_alloc(0);
return json;
}
@@ -762,6 +834,7 @@ static void JSON_mark(JSON_Parser *json)
static void JSON_free(JSON_Parser *json)
{
+ fbuffer_free(json->fbuffer);
ruby_xfree(json);
}
@@ -783,6 +856,18 @@ static VALUE cParser_source(VALUE self)
return rb_str_dup(json->Vsource);
}
+/*
+ * call-seq: quirks_mode?()
+ *
+ * Returns a true, if this parser is in quirks_mode, false otherwise.
+ */
+static VALUE cParser_quirks_mode_p(VALUE self)
+{
+ GET_PARSER;
+ return json->quirks_mode ? Qtrue : Qfalse;
+}
+
+
void Init_parser()
{
rb_require("json/common");
@@ -795,6 +880,7 @@ void Init_parser()
rb_define_method(cParser, "initialize", cParser_initialize, -1);
rb_define_method(cParser, "parse", cParser_parse, 0);
rb_define_method(cParser, "source", cParser_source, 0);
+ rb_define_method(cParser, "quirks_mode?", cParser_quirks_mode_p, 0);
CNaN = rb_const_get(mJSON, rb_intern("NaN"));
CInfinity = rb_const_get(mJSON, rb_intern("Infinity"));
@@ -808,6 +894,7 @@ void Init_parser()
i_max_nesting = rb_intern("max_nesting");
i_allow_nan = rb_intern("allow_nan");
i_symbolize_names = rb_intern("symbolize_names");
+ i_quirks_mode = rb_intern("quirks_mode");
i_object_class = rb_intern("object_class");
i_array_class = rb_intern("array_class");
i_match = rb_intern("match");
@@ -815,6 +902,7 @@ void Init_parser()
i_key_p = rb_intern("key?");
i_deep_const_get = rb_intern("deep_const_get");
i_aset = rb_intern("[]=");
+ i_aref = rb_intern("[]");
i_leftshift = rb_intern("<<");
#ifdef HAVE_RUBY_ENCODING_H
CEncoding_UTF_8 = rb_funcall(rb_path2class("Encoding"), rb_intern("find"), 1, rb_str_new2("utf-8"));
diff --git a/ext/nkf/depend b/ext/nkf/depend
index 0ed8fea8d2..f028020a20 100644
--- a/ext/nkf/depend
+++ b/ext/nkf/depend
@@ -1 +1,4 @@
-nkf.o : nkf.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h $(srcdir)/nkf-utf8/nkf.c $(srcdir)/nkf-utf8/utf8tbl.c $(srcdir)/nkf-utf8/config.h
+nkf.o : nkf.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h \
+ $(srcdir)/nkf-utf8/nkf.c $(srcdir)/nkf-utf8/nkf.h \
+ $(srcdir)/nkf-utf8/utf8tbl.c $(srcdir)/nkf-utf8/utf8tbl.h \
+ $(srcdir)/nkf-utf8/config.h
diff --git a/ext/nkf/nkf-utf8/nkf.c b/ext/nkf/nkf-utf8/nkf.c
index fc5b30d921..8e9d206471 100644
--- a/ext/nkf/nkf-utf8/nkf.c
+++ b/ext/nkf/nkf-utf8/nkf.c
@@ -20,11 +20,11 @@
*
* 3. This notice may not be removed or altered from any source distribution.
*/
-#define NKF_VERSION "2.1.1"
-#define NKF_RELEASE_DATE "2011-03-25"
+#define NKF_VERSION "2.1.3"
+#define NKF_RELEASE_DATE "2012-11-22"
#define COPY_RIGHT \
"Copyright (C) 1987, FUJITSU LTD. (I.Ichikawa).\n" \
- "Copyright (C) 1996-2010, The nkf Project."
+ "Copyright (C) 1996-2012, The nkf Project."
#include "config.h"
#include "nkf.h"
@@ -356,6 +356,7 @@ static int no_cp932ext_f = FALSE;
/* ignore ZERO WIDTH NO-BREAK SPACE */
static int no_best_fit_chars_f = FALSE;
static int input_endian = ENDIAN_BIG;
+static int input_bom_f = FALSE;
static nkf_char unicode_subchar = '?'; /* the regular substitution character */
static void (*encode_fallback)(nkf_char c) = NULL;
static void w_status(struct input_code *, nkf_char);
@@ -430,6 +431,8 @@ static nkf_char (*i_uungetc)(nkf_char c ,FILE *f) = std_ungetc;
#define nkf_char_unicode_bmp_p(c) ((c & VALUE_MASK) <= UNICODE_BMP_MAX)
#define nkf_char_unicode_value_p(c) ((c & VALUE_MASK) <= UNICODE_MAX)
+#define UTF16_TO_UTF32(lead, trail) (((lead) << 10) + (trail) - NKF_INT32_C(0x35FDC00))
+
#ifdef NUMCHAR_OPTION
static int numchar_f = FALSE;
static nkf_char (*i_ngetc)(FILE *) = std_getc; /* input of ugetc */
@@ -506,7 +509,7 @@ static int fold_margin = FOLD_MARGIN;
/* process default */
static nkf_char
-no_connection2(nkf_char c2, nkf_char c1, nkf_char c0)
+no_connection2(ARG_UNUSED nkf_char c2, ARG_UNUSED nkf_char c1, ARG_UNUSED nkf_char c0)
{
fprintf(stderr,"nkf internal module connection failure.\n");
exit(EXIT_FAILURE);
@@ -620,6 +623,27 @@ static const unsigned char ev[]= {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00};
+/* X0201 kana to X0213 conversion table for han-daguten */
+/* 90-9F A0-DF */
+static const unsigned char ev_x0213[]= {
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x25,0x77,0x25,0x78,
+ 0x25,0x79,0x25,0x7a,0x25,0x7b,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x25,0x7c,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x25,0x7d,0x00,0x00,
+ 0x25,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00};
+
/* X0208 kigou conversion table */
/* 0x8140 - 0x819e */
@@ -1287,6 +1311,7 @@ set_input_encoding(nkf_encoding *enc)
x0213_f = TRUE;
#ifdef SHIFTJIS_CP932
cp51932_f = FALSE;
+ if (cp932inv_f == TRUE) cp932inv_f = FALSE;
#endif
break;
case EUC_JISX0213:
@@ -1357,6 +1382,7 @@ set_output_encoding(nkf_encoding *enc)
#endif
break;
case ISO_2022_JP_3:
+ case ISO_2022_JP_2004:
x0212_f = TRUE;
x0213_f = TRUE;
#ifdef SHIFTJIS_CP932
@@ -1540,13 +1566,26 @@ x0212_unshift(nkf_char c)
}
#endif /* X0212_ENABLE */
+static int
+is_x0213_2_in_x0212(nkf_char c1)
+{
+ static const char x0213_2_table[] =
+ {0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1};
+ int ku = c1 - 0x20;
+ if (ku <= 15)
+ return x0213_2_table[ku]; /* 1, 3-5, 8, 12-15 */
+ if (78 <= ku && ku <= 94)
+ return 1;
+ return 0;
+}
+
static nkf_char
e2s_conv(nkf_char c2, nkf_char c1, nkf_char *p2, nkf_char *p1)
{
nkf_char ndx;
if (is_eucg3(c2)){
ndx = c2 & 0x7f;
- if (x0213_f){
+ if (x0213_f && is_x0213_2_in_x0212(ndx)){
if((0x21 <= ndx && ndx <= 0x2F)){
if (p2) *p2 = ((ndx - 1) >> 1) + 0xec - ndx / 8 * 3;
if (p1) *p1 = c1 + ((ndx & 1) ? ((c1 < 0x60) ? 0x1f : 0x20) : 0x7e);
@@ -1592,7 +1631,7 @@ s2e_conv(nkf_char c2, nkf_char c1, nkf_char *p2, nkf_char *p1)
static const char shift_jisx0213_s1a3_table[5][2] ={ { 1, 8}, { 3, 4}, { 5,12}, {13,14}, {15, 0} };
if (0xFC < c1) return 1;
#ifdef SHIFTJIS_CP932
- if (!cp932inv_f && is_ibmext_in_sjis(c2)){
+ if (!cp932inv_f && !x0213_f && is_ibmext_in_sjis(c2)){
val = shiftjis_cp932[c2 - CP932_TABLE_BEGIN][c1 - 0x40];
if (val){
c2 = val >> 8;
@@ -1695,7 +1734,7 @@ nkf_utf8_to_unicode(nkf_char c1, nkf_char c2, nkf_char c3, nkf_char c4)
/* single byte */
wc = c1;
}
- else if (c1 <= 0xC3) {
+ else if (c1 <= 0xC1) {
/* trail byte or invalid */
return -1;
}
@@ -1835,6 +1874,7 @@ unicode_to_jis_common(nkf_char c2, nkf_char c1, nkf_char c0, nkf_char *p2, nkf_c
ms_ucs_map_f == UCS_MAP_CP932 ? utf8_to_euc_2bytes_932 :
ms_ucs_map_f == UCS_MAP_MS ? utf8_to_euc_2bytes_ms :
ms_ucs_map_f == UCS_MAP_CP10001 ? utf8_to_euc_2bytes_mac :
+ x0213_f ? utf8_to_euc_2bytes_x0213 :
utf8_to_euc_2bytes;
ret = unicode_to_jis_common2(c2, c1, pp, sizeof_utf8_to_euc_2bytes, p2, p1);
}else if(c0 < 0xF0){
@@ -1902,6 +1942,7 @@ unicode_to_jis_common(nkf_char c2, nkf_char c1, nkf_char c0, nkf_char *p2, nkf_c
ms_ucs_map_f == UCS_MAP_CP932 ? utf8_to_euc_3bytes_932 :
ms_ucs_map_f == UCS_MAP_MS ? utf8_to_euc_3bytes_ms :
ms_ucs_map_f == UCS_MAP_CP10001 ? utf8_to_euc_3bytes_mac :
+ x0213_f ? utf8_to_euc_3bytes_x0213 :
utf8_to_euc_3bytes;
ret = unicode_to_jis_common2(c1, c0, ppp[c2 - 0xE0], sizeof_utf8_to_euc_C2, p2, p1);
}else return -1;
@@ -1919,6 +1960,15 @@ unicode_to_jis_common(nkf_char c2, nkf_char c1, nkf_char c0, nkf_char *p2, nkf_c
}
#ifdef UTF8_OUTPUT_ENABLE
+#define X0213_SURROGATE_FIND(tbl, size, euc) do { \
+ int i; \
+ for (i = 0; i < size; i++) \
+ if (tbl[i][0] == euc) { \
+ low = tbl[i][2]; \
+ break; \
+ } \
+ } while (0)
+
static nkf_char
e2w_conv(nkf_char c2, nkf_char c1)
{
@@ -1941,7 +1991,9 @@ e2w_conv(nkf_char c2, nkf_char c1)
}
c2 = (c2&0x7f) - 0x21;
if (0<=c2 && c2<sizeof_euc_to_utf8_2bytes)
- p = x0212_to_utf8_2bytes[c2];
+ p =
+ x0213_f ? x0212_to_utf8_2bytes_x0213[c2] :
+ x0212_to_utf8_2bytes[c2];
else
return 0;
#endif
@@ -1950,6 +2002,7 @@ e2w_conv(nkf_char c2, nkf_char c1)
c2 = (c2&0x7f) - 0x21;
if (0<=c2 && c2<sizeof_euc_to_utf8_2bytes)
p =
+ x0213_f ? euc_to_utf8_2bytes_x0213[c2] :
ms_ucs_map_f == UCS_MAP_ASCII ? euc_to_utf8_2bytes[c2] :
ms_ucs_map_f == UCS_MAP_CP10001 ? euc_to_utf8_2bytes_mac[c2] :
euc_to_utf8_2bytes_ms[c2];
@@ -1958,8 +2011,39 @@ e2w_conv(nkf_char c2, nkf_char c1)
}
if (!p) return 0;
c1 = (c1 & 0x7f) - 0x21;
- if (0<=c1 && c1<sizeof_euc_to_utf8_1byte)
- return p[c1];
+ if (0<=c1 && c1<sizeof_euc_to_utf8_1byte) {
+ nkf_char val = p[c1];
+ if (x0213_f && 0xD800<=val && val<=0xDBFF) {
+ nkf_char euc = (c2+0x21)<<8 | (c1+0x21);
+ nkf_char low = 0;
+ if (p==x0212_to_utf8_2bytes_x0213[c2]) {
+ X0213_SURROGATE_FIND(x0213_2_surrogate_table, sizeof_x0213_2_surrogate_table, euc);
+ } else {
+ X0213_SURROGATE_FIND(x0213_1_surrogate_table, sizeof_x0213_1_surrogate_table, euc);
+ }
+ if (!low) return 0;
+ return UTF16_TO_UTF32(val, low);
+ } else {
+ return val;
+ }
+ }
+ return 0;
+}
+
+static nkf_char
+e2w_combining(nkf_char comb, nkf_char c2, nkf_char c1)
+{
+ nkf_char euc;
+ int i;
+ for (i = 0; i < sizeof_x0213_combining_chars; i++)
+ if (x0213_combining_chars[i] == comb)
+ break;
+ if (i >= sizeof_x0213_combining_chars)
+ return 0;
+ euc = (c2&0x7f)<<8 | (c1&0x7f);
+ for (i = 0; i < sizeof_x0213_combining_table; i++)
+ if (x0213_combining_table[i][0] == euc)
+ return x0213_combining_table[i][1];
return 0;
}
#endif
@@ -2006,6 +2090,25 @@ w16e_conv(nkf_char val, nkf_char *p2, nkf_char *p1)
}
}
else {
+ int i;
+ if (x0213_f) {
+ c1 = (val >> 10) + NKF_INT32_C(0xD7C0); /* high surrogate */
+ c2 = (val & 0x3FF) + NKF_INT32_C(0xDC00); /* low surrogate */
+ for (i = 0; i < sizeof_x0213_1_surrogate_table; i++)
+ if (x0213_1_surrogate_table[i][1] == c1 && x0213_1_surrogate_table[i][2] == c2) {
+ val = x0213_1_surrogate_table[i][0];
+ *p2 = val >> 8;
+ *p1 = val & 0xFF;
+ return 0;
+ }
+ for (i = 0; i < sizeof_x0213_2_surrogate_table; i++)
+ if (x0213_2_surrogate_table[i][1] == c1 && x0213_2_surrogate_table[i][2] == c2) {
+ val = x0213_2_surrogate_table[i][0];
+ *p2 = PREFIX_EUCG3 | (val >> 8);
+ *p1 = val & 0xFF;
+ return 0;
+ }
+ }
*p2 = 0;
*p1 = nkf_char_unicode_new(val);
}
@@ -2078,7 +2181,7 @@ e_iconv(nkf_char c2, nkf_char c1, nkf_char c0)
}
static nkf_char
-s_iconv(nkf_char c2, nkf_char c1, nkf_char c0)
+s_iconv(ARG_UNUSED nkf_char c2, nkf_char c1, ARG_UNUSED nkf_char c0)
{
if (c2 == JIS_X_0201_1976_K || (0xA1 <= c2 && c2 <= 0xDF)) {
if (iso2022jp_f && !x0201_f) {
@@ -2101,6 +2204,30 @@ s_iconv(nkf_char c2, nkf_char c1, nkf_char c0)
return 0;
}
+static int
+x0213_wait_combining_p(nkf_char wc)
+{
+ int i;
+ for (i = 0; i < sizeof_x0213_combining_table; i++) {
+ if (x0213_combining_table[i][1] == wc) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+static int
+x0213_combining_p(nkf_char wc)
+{
+ int i;
+ for (i = 0; i < sizeof_x0213_combining_chars; i++) {
+ if (x0213_combining_chars[i] == wc) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
static nkf_char
w_iconv(nkf_char c1, nkf_char c2, nkf_char c3)
{
@@ -2168,6 +2295,8 @@ w_iconv(nkf_char c1, nkf_char c2, nkf_char c3)
c2 = nkf_char_unicode_new(nkf_utf8_to_unicode(c1, c2, c3, c4));
c1 = 0;
} else {
+ if (x0213_f && x0213_wait_combining_p(nkf_utf8_to_unicode(c1, c2, c3, c4)))
+ return -3;
ret = w2e_conv(c1, c2, c3, &c1, &c2);
}
if (ret == 0){
@@ -2176,9 +2305,22 @@ w_iconv(nkf_char c1, nkf_char c2, nkf_char c3)
return ret;
}
+static nkf_char
+w_iconv_nocombine(nkf_char c1, nkf_char c2, nkf_char c3)
+{
+ /* continue from the line below 'return -3;' in w_iconv() */
+ nkf_char ret = w2e_conv(c1, c2, c3, &c1, &c2);
+ if (ret == 0){
+ (*oconv)(c1, c2);
+ }
+ return ret;
+}
+
#define NKF_ICONV_INVALID_CODE_RANGE -13
+#define NKF_ICONV_WAIT_COMBINING_CHAR -14
+#define NKF_ICONV_NOT_COMBINED -15
static size_t
-unicode_iconv(nkf_char wc)
+unicode_iconv(nkf_char wc, int nocombine)
{
nkf_char c1, c2;
int ret = 0;
@@ -2190,6 +2332,8 @@ unicode_iconv(nkf_char wc)
/* unpaired surrogate */
return NKF_ICONV_INVALID_CODE_RANGE;
}else if (wc < 0xFFFF) {
+ if (!nocombine && x0213_f && x0213_wait_combining_p(wc))
+ return NKF_ICONV_WAIT_COMBINING_CHAR;
ret = w16e_conv(wc, &c2, &c1);
if (ret) return ret;
}else if (wc < 0x10FFFF) {
@@ -2202,9 +2346,50 @@ unicode_iconv(nkf_char wc)
return 0;
}
+static nkf_char
+unicode_iconv_combine(nkf_char wc, nkf_char wc2)
+{
+ nkf_char c1, c2;
+ int i;
+
+ if (wc2 < 0x80) {
+ return NKF_ICONV_NOT_COMBINED;
+ }else if ((wc2>>11) == 27) {
+ /* unpaired surrogate */
+ return NKF_ICONV_INVALID_CODE_RANGE;
+ }else if (wc2 < 0xFFFF) {
+ if (!x0213_combining_p(wc2))
+ return NKF_ICONV_NOT_COMBINED;
+ for (i = 0; i < sizeof_x0213_combining_table; i++) {
+ if (x0213_combining_table[i][1] == wc &&
+ x0213_combining_table[i][2] == wc2) {
+ c2 = x0213_combining_table[i][0] >> 8;
+ c1 = x0213_combining_table[i][0] & 0x7f;
+ (*oconv)(c2, c1);
+ return 0;
+ }
+ }
+ }else if (wc2 < 0x10FFFF) {
+ return NKF_ICONV_NOT_COMBINED;
+ } else {
+ return NKF_ICONV_INVALID_CODE_RANGE;
+ }
+ return NKF_ICONV_NOT_COMBINED;
+}
+
+static nkf_char
+w_iconv_combine(nkf_char c1, nkf_char c2, nkf_char c3, nkf_char c4, nkf_char c5, nkf_char c6)
+{
+ nkf_char wc, wc2;
+ wc = nkf_utf8_to_unicode(c1, c2, c3, 0);
+ wc2 = nkf_utf8_to_unicode(c4, c5, c6, 0);
+ if (wc2 < 0)
+ return wc2;
+ return unicode_iconv_combine(wc, wc2);
+}
+
#define NKF_ICONV_NEED_ONE_MORE_BYTE (size_t)-1
#define NKF_ICONV_NEED_TWO_MORE_BYTES (size_t)-2
-#define UTF16_TO_UTF32(lead, trail) (((lead) << 10) + (trail) - NKF_INT32_C(0x35FDC00))
static size_t
nkf_iconv_utf_16(nkf_char c1, nkf_char c2, nkf_char c3, nkf_char c4)
{
@@ -2233,33 +2418,63 @@ nkf_iconv_utf_16(nkf_char c1, nkf_char c2, nkf_char c3, nkf_char c4)
}
}
- return (*unicode_iconv)(wc);
+ return (*unicode_iconv)(wc, FALSE);
+}
+
+static size_t
+nkf_iconv_utf_16_combine(nkf_char c1, nkf_char c2, nkf_char c3, nkf_char c4)
+{
+ nkf_char wc, wc2;
+
+ if (input_endian == ENDIAN_BIG) {
+ if (0xD8 <= c3 && c3 <= 0xDB) {
+ return NKF_ICONV_NOT_COMBINED;
+ } else {
+ wc = c1 << 8 | c2;
+ wc2 = c3 << 8 | c4;
+ }
+ } else {
+ if (0xD8 <= c2 && c2 <= 0xDB) {
+ return NKF_ICONV_NOT_COMBINED;
+ } else {
+ wc = c2 << 8 | c1;
+ wc2 = c4 << 8 | c3;
+ }
+ }
+
+ return unicode_iconv_combine(wc, wc2);
+}
+
+static size_t
+nkf_iconv_utf_16_nocombine(nkf_char c1, nkf_char c2)
+{
+ nkf_char wc;
+ if (input_endian == ENDIAN_BIG)
+ wc = c1 << 8 | c2;
+ else
+ wc = c2 << 8 | c1;
+ return (*unicode_iconv)(wc, TRUE);
}
static nkf_char
-w_iconv16(nkf_char c2, nkf_char c1, nkf_char c0)
+w_iconv16(nkf_char c2, nkf_char c1, ARG_UNUSED nkf_char c0)
{
(*oconv)(c2, c1);
return 16; /* different from w_iconv32 */
}
static nkf_char
-w_iconv32(nkf_char c2, nkf_char c1, nkf_char c0)
+w_iconv32(nkf_char c2, nkf_char c1, ARG_UNUSED nkf_char c0)
{
(*oconv)(c2, c1);
return 32; /* different from w_iconv16 */
}
-static size_t
-nkf_iconv_utf_32(nkf_char c1, nkf_char c2, nkf_char c3, nkf_char c4)
+static nkf_char
+utf32_to_nkf_char(nkf_char c1, nkf_char c2, nkf_char c3, nkf_char c4)
{
nkf_char wc;
- if (c1 == EOF) {
- (*oconv)(EOF, 0);
- return 0;
- }
-
switch(input_endian){
case ENDIAN_BIG:
wc = c2 << 16 | c3 << 8 | c4;
@@ -2276,8 +2491,48 @@ nkf_iconv_utf_32(nkf_char c1, nkf_char c2, nkf_char c3, nkf_char c4)
default:
return NKF_ICONV_INVALID_CODE_RANGE;
}
+ return wc;
+}
+
+static size_t
+nkf_iconv_utf_32(nkf_char c1, nkf_char c2, nkf_char c3, nkf_char c4)
+{
+ nkf_char wc;
+
+ if (c1 == EOF) {
+ (*oconv)(EOF, 0);
+ return 0;
+ }
- return (*unicode_iconv)(wc);
+ wc = utf32_to_nkf_char(c1, c2, c3, c4);
+ if (wc < 0)
+ return wc;
+
+ return (*unicode_iconv)(wc, FALSE);
+}
+
+static nkf_char
+nkf_iconv_utf_32_combine(nkf_char c1, nkf_char c2, nkf_char c3, nkf_char c4, nkf_char c5, nkf_char c6, nkf_char c7, nkf_char c8)
+{
+ nkf_char wc, wc2;
+
+ wc = utf32_to_nkf_char(c1, c2, c3, c4);
+ if (wc < 0)
+ return wc;
+ wc2 = utf32_to_nkf_char(c5, c6, c7, c8);
+ if (wc2 < 0)
+ return wc2;
+
+ return unicode_iconv_combine(wc, wc2);
+}
+
+static size_t
+nkf_iconv_utf_32_nocombine(nkf_char c1, nkf_char c2, nkf_char c3, nkf_char c4)
+{
+ nkf_char wc;
+
+ wc = utf32_to_nkf_char(c1, c2, c3, c4);
+ return (*unicode_iconv)(wc, TRUE);
}
#endif
@@ -2532,11 +2787,19 @@ s_oconv(nkf_char c2, nkf_char c1)
}
#ifdef UTF8_OUTPUT_ENABLE
+#define OUTPUT_UTF8(val) do { \
+ nkf_unicode_to_utf8(val, &c1, &c2, &c3, &c4); \
+ (*o_putc)(c1); \
+ if (c2) (*o_putc)(c2); \
+ if (c3) (*o_putc)(c3); \
+ if (c4) (*o_putc)(c4); \
+ } while (0)
+
static void
w_oconv(nkf_char c2, nkf_char c1)
{
nkf_char c3, c4;
- nkf_char val;
+ nkf_char val, val2;
if (output_bom_f) {
output_bom_f = FALSE;
@@ -2552,11 +2815,7 @@ w_oconv(nkf_char c2, nkf_char c1)
if (c2 == 0 && nkf_char_unicode_p(c1)){
val = c1 & VALUE_MASK;
- nkf_unicode_to_utf8(val, &c1, &c2, &c3, &c4);
- (*o_putc)(c1);
- if (c2) (*o_putc)(c2);
- if (c3) (*o_putc)(c3);
- if (c4) (*o_putc)(c4);
+ OUTPUT_UTF8(val);
return;
}
@@ -2565,27 +2824,46 @@ w_oconv(nkf_char c2, nkf_char c1)
} else {
val = e2w_conv(c2, c1);
if (val){
- nkf_unicode_to_utf8(val, &c1, &c2, &c3, &c4);
- (*o_putc)(c1);
- if (c2) (*o_putc)(c2);
- if (c3) (*o_putc)(c3);
- if (c4) (*o_putc)(c4);
+ val2 = e2w_combining(val, c2, c1);
+ if (val2)
+ OUTPUT_UTF8(val2);
+ OUTPUT_UTF8(val);
}
}
}
+#define OUTPUT_UTF16_BYTES(c1, c2) do { \
+ if (output_endian == ENDIAN_LITTLE){ \
+ (*o_putc)(c1); \
+ (*o_putc)(c2); \
+ }else{ \
+ (*o_putc)(c2); \
+ (*o_putc)(c1); \
+ } \
+ } while (0)
+
+#define OUTPUT_UTF16(val) do { \
+ if (nkf_char_unicode_bmp_p(val)) { \
+ c2 = (val >> 8) & 0xff; \
+ c1 = val & 0xff; \
+ OUTPUT_UTF16_BYTES(c1, c2); \
+ } else { \
+ val &= VALUE_MASK; \
+ if (val <= UNICODE_MAX) { \
+ c2 = (val >> 10) + NKF_INT32_C(0xD7C0); /* high surrogate */ \
+ c1 = (val & 0x3FF) + NKF_INT32_C(0xDC00); /* low surrogate */ \
+ OUTPUT_UTF16_BYTES(c2 & 0xff, (c2 >> 8) & 0xff); \
+ OUTPUT_UTF16_BYTES(c1 & 0xff, (c1 >> 8) & 0xff); \
+ } \
+ } \
+ } while (0)
+
static void
w_oconv16(nkf_char c2, nkf_char c1)
{
if (output_bom_f) {
output_bom_f = FALSE;
- if (output_endian == ENDIAN_LITTLE){
- (*o_putc)(0xFF);
- (*o_putc)(0xFE);
- }else{
- (*o_putc)(0xFE);
- (*o_putc)(0xFF);
- }
+ OUTPUT_UTF16_BYTES(0xFF, 0xFE);
}
if (c2 == EOF) {
@@ -2594,43 +2872,33 @@ w_oconv16(nkf_char c2, nkf_char c1)
}
if (c2 == 0 && nkf_char_unicode_p(c1)) {
- if (nkf_char_unicode_bmp_p(c1)) {
- c2 = (c1 >> 8) & 0xff;
- c1 &= 0xff;
- } else {
- c1 &= VALUE_MASK;
- if (c1 <= UNICODE_MAX) {
- c2 = (c1 >> 10) + NKF_INT32_C(0xD7C0); /* high surrogate */
- c1 = (c1 & 0x3FF) + NKF_INT32_C(0xDC00); /* low surrogate */
- if (output_endian == ENDIAN_LITTLE){
- (*o_putc)(c2 & 0xff);
- (*o_putc)((c2 >> 8) & 0xff);
- (*o_putc)(c1 & 0xff);
- (*o_putc)((c1 >> 8) & 0xff);
- }else{
- (*o_putc)((c2 >> 8) & 0xff);
- (*o_putc)(c2 & 0xff);
- (*o_putc)((c1 >> 8) & 0xff);
- (*o_putc)(c1 & 0xff);
- }
- }
- return;
- }
+ OUTPUT_UTF16(c1);
} else if (c2) {
- nkf_char val = e2w_conv(c2, c1);
- c2 = (val >> 8) & 0xff;
- c1 = val & 0xff;
+ nkf_char val, val2;
+ val = e2w_conv(c2, c1);
if (!val) return;
- }
-
- if (output_endian == ENDIAN_LITTLE){
- (*o_putc)(c1);
- (*o_putc)(c2);
- }else{
- (*o_putc)(c2);
- (*o_putc)(c1);
- }
-}
+ val2 = e2w_combining(val, c2, c1);
+ if (val2)
+ OUTPUT_UTF16(val2);
+ OUTPUT_UTF16(val);
+ } else {
+ OUTPUT_UTF16_BYTES(c1, c2);
+ }
+}
+
+#define OUTPUT_UTF32(c) do { \
+ if (output_endian == ENDIAN_LITTLE){ \
+ (*o_putc)( (c) & 0xFF); \
+ (*o_putc)(((c) >> 8) & 0xFF); \
+ (*o_putc)(((c) >> 16) & 0xFF); \
+ (*o_putc)(0); \
+ }else{ \
+ (*o_putc)(0); \
+ (*o_putc)(((c) >> 16) & 0xFF); \
+ (*o_putc)(((c) >> 8) & 0xFF); \
+ (*o_putc)( (c) & 0xFF); \
+ } \
+ } while (0)
static void
w_oconv32(nkf_char c2, nkf_char c1)
@@ -2660,20 +2928,15 @@ w_oconv32(nkf_char c2, nkf_char c1)
} else if (c2 == 0 && nkf_char_unicode_p(c1)) {
c1 &= VALUE_MASK;
} else if (c2) {
- c1 = e2w_conv(c2, c1);
- if (!c1) return;
- }
- if (output_endian == ENDIAN_LITTLE){
- (*o_putc)( c1 & 0xFF);
- (*o_putc)((c1 >> 8) & 0xFF);
- (*o_putc)((c1 >> 16) & 0xFF);
- (*o_putc)(0);
- }else{
- (*o_putc)(0);
- (*o_putc)((c1 >> 16) & 0xFF);
- (*o_putc)((c1 >> 8) & 0xFF);
- (*o_putc)( c1 & 0xFF);
+ nkf_char val, val2;
+ val = e2w_conv(c2, c1);
+ if (!val) return;
+ val2 = e2w_combining(val, c2, c1);
+ if (val2)
+ OUTPUT_UTF32(val2);
+ c1 = val;
}
+ OUTPUT_UTF32(c1);
}
#endif
@@ -2682,7 +2945,8 @@ w_oconv32(nkf_char c2, nkf_char c1)
#define SCORE_DEPEND (SCORE_KANA << 1) /* MD Characters */
#define SCORE_CP932 (SCORE_DEPEND << 1) /* IBM extended characters */
#define SCORE_X0212 (SCORE_CP932 << 1) /* JIS X 0212 */
-#define SCORE_NO_EXIST (SCORE_X0212 << 1) /* Undefined Characters */
+#define SCORE_X0213 (SCORE_X0212 << 1) /* JIS X 0213 */
+#define SCORE_NO_EXIST (SCORE_X0213 << 1) /* Undefined Characters */
#define SCORE_iMIME (SCORE_NO_EXIST << 1) /* MIME selected */
#define SCORE_ERROR (SCORE_iMIME << 1) /* Error */
@@ -2692,14 +2956,35 @@ static const nkf_char score_table_A0[] = {
0, 0, 0, 0,
0, 0, 0, 0,
0, SCORE_DEPEND, SCORE_DEPEND, SCORE_DEPEND,
- SCORE_DEPEND, SCORE_DEPEND, SCORE_DEPEND, SCORE_NO_EXIST,
+ SCORE_DEPEND, SCORE_DEPEND, SCORE_DEPEND, SCORE_X0213,
};
static const nkf_char score_table_F0[] = {
SCORE_L2, SCORE_L2, SCORE_L2, SCORE_L2,
- SCORE_L2, SCORE_DEPEND, SCORE_NO_EXIST, SCORE_NO_EXIST,
+ SCORE_L2, SCORE_DEPEND, SCORE_X0213, SCORE_X0213,
SCORE_DEPEND, SCORE_DEPEND, SCORE_CP932, SCORE_CP932,
- SCORE_CP932, SCORE_NO_EXIST, SCORE_NO_EXIST, SCORE_ERROR,
+ SCORE_CP932, SCORE_X0213, SCORE_X0213, SCORE_ERROR,
+};
+
+static const nkf_char score_table_8FA0[] = {
+ 0, SCORE_X0213, SCORE_X0212, SCORE_X0213,
+ SCORE_X0213, SCORE_X0213, SCORE_X0212, SCORE_X0212,
+ SCORE_X0213, SCORE_X0212, SCORE_X0212, SCORE_X0212,
+ SCORE_X0213, SCORE_X0213, SCORE_X0213, SCORE_X0213,
+};
+
+static const nkf_char score_table_8FE0[] = {
+ SCORE_X0212, SCORE_X0212, SCORE_X0212, SCORE_X0212,
+ SCORE_X0212, SCORE_X0212, SCORE_X0212, SCORE_X0212,
+ SCORE_X0212, SCORE_X0212, SCORE_X0212, SCORE_X0212,
+ SCORE_X0212, SCORE_X0212, SCORE_X0213, SCORE_X0213,
+};
+
+static const nkf_char score_table_8FF0[] = {
+ SCORE_X0213, SCORE_X0213, SCORE_X0213, SCORE_X0212,
+ SCORE_X0212, SCORE_X0213, SCORE_X0213, SCORE_X0213,
+ SCORE_X0213, SCORE_X0213, SCORE_X0213, SCORE_X0213,
+ SCORE_X0213, SCORE_X0213, SCORE_X0213, SCORE_X0213,
};
static void
@@ -2722,15 +3007,21 @@ static void
code_score(struct input_code *ptr)
{
nkf_char c2 = ptr->buf[0];
-#ifdef UTF8_OUTPUT_ENABLE
nkf_char c1 = ptr->buf[1];
-#endif
if (c2 < 0){
set_code_score(ptr, SCORE_ERROR);
}else if (c2 == SS2){
set_code_score(ptr, SCORE_KANA);
}else if (c2 == 0x8f){
- set_code_score(ptr, SCORE_X0212);
+ if ((c1 & 0x70) == 0x20){
+ set_code_score(ptr, score_table_8FA0[c1 & 0x0f]);
+ }else if ((c1 & 0x70) == 0x60){
+ set_code_score(ptr, score_table_8FE0[c1 & 0x0f]);
+ }else if ((c1 & 0x70) == 0x70){
+ set_code_score(ptr, score_table_8FF0[c1 & 0x0f]);
+ }else{
+ set_code_score(ptr, SCORE_X0212);
+ }
#ifdef UTF8_OUTPUT_ENABLE
}else if (!e2w_conv(c2, c1)){
set_code_score(ptr, SCORE_NO_EXIST);
@@ -3046,7 +3337,7 @@ std_getc(FILE *f)
#endif /*WIN32DLL*/
static nkf_char
-std_ungetc(nkf_char c, FILE *f)
+std_ungetc(nkf_char c, ARG_UNUSED FILE *f)
{
nkf_buf_push(nkf_state->std_gc_buf, c);
return c;
@@ -3077,6 +3368,7 @@ h_conv(FILE *f, nkf_char c1, nkf_char c2)
{
int ret;
int hold_index;
+ int fromhold_count;
nkf_char c3, c4;
/** it must NOT be in the kanji shifte sequence */
@@ -3138,8 +3430,10 @@ h_conv(FILE *f, nkf_char c1, nkf_char c2)
(*iconv)(JIS_X_0201_1976_K, c1, 0);
continue;
}
+ fromhold_count = 1;
if (hold_index < hold_count){
c2 = hold_buf[hold_index++];
+ fromhold_count++;
}else{
c2 = (*i_getc)(f);
if (c2 == EOF){
@@ -3168,17 +3462,105 @@ h_conv(FILE *f, nkf_char c1, nkf_char c2)
code_status(c4);
(*iconv)(c1, c2, (c3<<8)|c4);
break;
+ case -3:
+ /* 4 bytes UTF-8 (check combining character) */
+ if (hold_index < hold_count){
+ c3 = hold_buf[hold_index++];
+ fromhold_count++;
+ } else if ((c3 = (*i_getc)(f)) == EOF) {
+ w_iconv_nocombine(c1, c2, 0);
+ break;
+ }
+ if (hold_index < hold_count){
+ c4 = hold_buf[hold_index++];
+ fromhold_count++;
+ } else if ((c4 = (*i_getc)(f)) == EOF) {
+ w_iconv_nocombine(c1, c2, 0);
+ if (fromhold_count <= 2)
+ (*i_ungetc)(c3,f);
+ else
+ hold_index--;
+ continue;
+ }
+ if (w_iconv_combine(c1, c2, 0, c3, c4, 0)) {
+ w_iconv_nocombine(c1, c2, 0);
+ if (fromhold_count <= 2) {
+ (*i_ungetc)(c4,f);
+ (*i_ungetc)(c3,f);
+ } else if (fromhold_count == 3) {
+ (*i_ungetc)(c4,f);
+ hold_index--;
+ } else {
+ hold_index -= 2;
+ }
+ }
+ break;
case -1:
/* 3 bytes EUC or UTF-8 */
if (hold_index < hold_count){
c3 = hold_buf[hold_index++];
+ fromhold_count++;
} else if ((c3 = (*i_getc)(f)) == EOF) {
ret = EOF;
break;
} else {
code_status(c3);
}
- (*iconv)(c1, c2, c3);
+ if ((*iconv)(c1, c2, c3) == -3) {
+ /* 6 bytes UTF-8 (check combining character) */
+ nkf_char c5, c6;
+ if (hold_index < hold_count){
+ c4 = hold_buf[hold_index++];
+ fromhold_count++;
+ } else if ((c4 = (*i_getc)(f)) == EOF) {
+ w_iconv_nocombine(c1, c2, c3);
+ continue;
+ }
+ if (hold_index < hold_count){
+ c5 = hold_buf[hold_index++];
+ fromhold_count++;
+ } else if ((c5 = (*i_getc)(f)) == EOF) {
+ w_iconv_nocombine(c1, c2, c3);
+ if (fromhold_count == 4)
+ hold_index--;
+ else
+ (*i_ungetc)(c4,f);
+ continue;
+ }
+ if (hold_index < hold_count){
+ c6 = hold_buf[hold_index++];
+ fromhold_count++;
+ } else if ((c6 = (*i_getc)(f)) == EOF) {
+ w_iconv_nocombine(c1, c2, c3);
+ if (fromhold_count == 5) {
+ hold_index -= 2;
+ } else if (fromhold_count == 4) {
+ hold_index--;
+ (*i_ungetc)(c5,f);
+ } else {
+ (*i_ungetc)(c5,f);
+ (*i_ungetc)(c4,f);
+ }
+ continue;
+ }
+ if (w_iconv_combine(c1, c2, c3, c4, c5, c6)) {
+ w_iconv_nocombine(c1, c2, c3);
+ if (fromhold_count == 6) {
+ hold_index -= 3;
+ } else if (fromhold_count == 5) {
+ hold_index -= 2;
+ (*i_ungetc)(c6,f);
+ } else if (fromhold_count == 4) {
+ hold_index--;
+ (*i_ungetc)(c6,f);
+ (*i_ungetc)(c5,f);
+ } else {
+ (*i_ungetc)(c6,f);
+ (*i_ungetc)(c5,f);
+ (*i_ungetc)(c4,f);
+ }
+ }
+ }
break;
}
if (c3 == EOF) break;
@@ -3202,6 +3584,7 @@ check_bom(FILE *f)
set_iconv(TRUE, w_iconv32);
}
if (iconv == w_iconv32) {
+ input_bom_f = TRUE;
input_endian = ENDIAN_BIG;
return;
}
@@ -3232,6 +3615,7 @@ check_bom(FILE *f)
set_iconv(TRUE, w_iconv);
}
if (iconv == w_iconv) {
+ input_bom_f = TRUE;
return;
}
(*i_ungetc)(0xBF,f);
@@ -3260,6 +3644,7 @@ check_bom(FILE *f)
}
if (iconv == w_iconv16) {
input_endian = ENDIAN_BIG;
+ input_bom_f = TRUE;
return;
}
(*i_ungetc)(0xFF,f);
@@ -3275,6 +3660,7 @@ check_bom(FILE *f)
}
if (iconv == w_iconv32) {
input_endian = ENDIAN_LITTLE;
+ input_bom_f = TRUE;
return;
}
(*i_ungetc)(0x00,f);
@@ -3286,6 +3672,7 @@ check_bom(FILE *f)
}
if (iconv == w_iconv16) {
input_endian = ENDIAN_LITTLE;
+ input_bom_f = TRUE;
return;
}
(*i_ungetc)(0xFE,f);
@@ -3338,7 +3725,7 @@ broken_getc(FILE *f)
}
static nkf_char
-broken_ungetc(nkf_char c, FILE *f)
+broken_ungetc(nkf_char c, ARG_UNUSED FILE *f)
{
if (nkf_buf_length(nkf_state->broken_buf) < 2)
nkf_buf_push(nkf_state->broken_buf, c);
@@ -3494,7 +3881,7 @@ fold_conv(nkf_char c2, nkf_char c1)
f_prev = c1;
if (c2 || c2 == JIS_X_0201_1976_K)
f_prev |= 0x80; /* this is Japanese */
- f_line += char_size(c2,c1);
+ f_line += c2 == JIS_X_0201_1976_K ? 1: char_size(c2,c1);
if (f_line<=fold_len) { /* normal case */
fold_state = 1;
} else {
@@ -3613,13 +4000,17 @@ z_conv(nkf_char c2, nkf_char c1)
z_prev2 = 0;
(*o_zconv)(ev[(z_prev1-SP)*2], ev[(z_prev1-SP)*2+1]);
return;
+ } else if (x0213_f && c1 == (0xdf&0x7f) && ev_x0213[(z_prev1-SP)*2]) { /* $BH>ByE@(B */
+ z_prev2 = 0;
+ (*o_zconv)(ev_x0213[(z_prev1-SP)*2], ev_x0213[(z_prev1-SP)*2+1]);
+ return;
}
}
z_prev2 = 0;
(*o_zconv)(cv[(z_prev1-SP)*2], cv[(z_prev1-SP)*2+1]);
}
if (c2 == JIS_X_0201_1976_K) {
- if (dv[(c1-SP)*2] || ev[(c1-SP)*2]) {
+ if (dv[(c1-SP)*2] || ev[(c1-SP)*2] || (x0213_f && ev_x0213[(c1-SP)*2])) {
/* wait for $BByE@(B or $BH>ByE@(B */
z_prev1 = c1;
z_prev2 = c2;
@@ -3727,8 +4118,8 @@ z_conv(nkf_char c2, nkf_char c1)
0x4D00, 0x4D5E, 0x4D5F, 0x4E00, 0x4E5E, 0x4E5F, 0x4F00, 0x5000,
0x5100, 0x5200, 0x5300, 0x2C00, 0x5400, 0x2D00, 0x5500, 0x2E00,
0x5600, 0x5700, 0x5800, 0x5900, 0x5A00, 0x5B00, 0x0000, 0x5C00,
- 0x0000, 0x0000, 0x2600, 0x5D00, 0x335E, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
+ 0x0000, 0x0000, 0x2600, 0x5D00, 0x335E, 0x0000, 0x0000, 0x365F,
+ 0x375F, 0x385F, 0x395F, 0x3A5F, 0x3E5F, 0x425F, 0x445F, 0x0000
};
if (fullwidth_to_halfwidth[c1-0x20]){
c2 = fullwidth_to_halfwidth[c1-0x20];
@@ -3738,6 +4129,10 @@ z_conv(nkf_char c2, nkf_char c1)
}
return;
}
+ } else if (c2 == 0 && nkf_char_unicode_p(c1) &&
+ ((c1&VALUE_MASK) == 0x3099 || (c1&VALUE_MASK) == 0x309A)) { /* $B9g@.MQByE@!&H>ByE@(B */
+ (*o_zconv)(JIS_X_0201_1976_K, 0x5E + (c1&VALUE_MASK) - 0x3099);
+ return;
}
}
(*o_zconv)(c2,c1);
@@ -3926,7 +4321,7 @@ mime_input_buf_unshift(nkf_char c)
}
static nkf_char
-mime_ungetc(nkf_char c, FILE *f)
+mime_ungetc(nkf_char c, ARG_UNUSED FILE *f)
{
mime_input_buf_unshift(c);
return c;
@@ -4071,7 +4466,7 @@ mime_begin_strict(FILE *f)
static nkf_char
mime_begin(FILE *f)
{
- nkf_char c1;
+ nkf_char c1 = 0;
int i,k;
/* In NONSTRICT mode, only =? is checked. In case of failure, we */
@@ -4127,7 +4522,7 @@ mime_begin(FILE *f)
#ifdef CHECK_OPTION
static void
-no_putc(nkf_char c)
+no_putc(ARG_UNUSED nkf_char c)
{
;
}
@@ -4164,7 +4559,9 @@ get_guessed_code(void)
if (p->score & (SCORE_DEPEND|SCORE_CP932))
input_codename = "CP932";
} else if (strcmp(input_codename, "EUC-JP") == 0) {
- if (p->score & (SCORE_X0212))
+ if (p->score & SCORE_X0213)
+ input_codename = "EUC-JIS-2004";
+ else if (p->score & (SCORE_X0212))
input_codename = "EUCJP-MS";
else if (p->score & (SCORE_DEPEND|SCORE_CP932))
input_codename = "CP51932";
@@ -4190,8 +4587,13 @@ print_guessed_code(char *filename)
if (guess_f == 1) {
printf("%s\n", input_codename);
} else {
- printf("%s%s\n",
+ printf("%s%s%s%s\n",
input_codename,
+ iconv != w_iconv16 && iconv != w_iconv32 ? "" :
+ input_endian == ENDIAN_LITTLE ? " LE" :
+ input_endian == ENDIAN_BIG ? " BE" :
+ "[BUG]",
+ input_bom_f ? " (BOM)" : "",
input_eol == CR ? " (CR)" :
input_eol == LF ? " (LF)" :
input_eol == CRLF ? " (CRLF)" :
@@ -5456,17 +5858,45 @@ kanji_convert(FILE *f)
(c2 = (*i_getc)(f)) != EOF &&
(c3 = (*i_getc)(f)) != EOF &&
(c4 = (*i_getc)(f)) != EOF) {
- nkf_iconv_utf_32(c1, c2, c3, c4);
+ nkf_char c5, c6, c7, c8;
+ if (nkf_iconv_utf_32(c1, c2, c3, c4) == (size_t)NKF_ICONV_WAIT_COMBINING_CHAR) {
+ if ((c5 = (*i_getc)(f)) != EOF &&
+ (c6 = (*i_getc)(f)) != EOF &&
+ (c7 = (*i_getc)(f)) != EOF &&
+ (c8 = (*i_getc)(f)) != EOF) {
+ if (nkf_iconv_utf_32_combine(c1, c2, c3, c4, c5, c6, c7, c8)) {
+ (*i_ungetc)(c8, f);
+ (*i_ungetc)(c7, f);
+ (*i_ungetc)(c6, f);
+ (*i_ungetc)(c5, f);
+ nkf_iconv_utf_32_nocombine(c1, c2, c3, c4);
+ }
+ } else {
+ nkf_iconv_utf_32_nocombine(c1, c2, c3, c4);
+ }
+ }
}
goto finished;
}
else if (iconv == w_iconv16) {
while ((c1 = (*i_getc)(f)) != EOF &&
(c2 = (*i_getc)(f)) != EOF) {
- if (nkf_iconv_utf_16(c1, c2, 0, 0) == NKF_ICONV_NEED_TWO_MORE_BYTES &&
+ size_t ret = nkf_iconv_utf_16(c1, c2, 0, 0);
+ if (ret == NKF_ICONV_NEED_TWO_MORE_BYTES &&
(c3 = (*i_getc)(f)) != EOF &&
(c4 = (*i_getc)(f)) != EOF) {
nkf_iconv_utf_16(c1, c2, c3, c4);
+ } else if (ret == (size_t)NKF_ICONV_WAIT_COMBINING_CHAR) {
+ if ((c3 = (*i_getc)(f)) != EOF &&
+ (c4 = (*i_getc)(f)) != EOF) {
+ if (nkf_iconv_utf_16_combine(c1, c2, c3, c4)) {
+ (*i_ungetc)(c4, f);
+ (*i_ungetc)(c3, f);
+ nkf_iconv_utf_16_nocombine(c1, c2);
+ }
+ } else {
+ nkf_iconv_utf_16_nocombine(c1, c2);
+ }
}
}
goto finished;
@@ -5480,7 +5910,7 @@ kanji_convert(FILE *f)
code_status(c1);
if (c2) {
/* second byte */
- if (c2 > DEL) {
+ if (c2 > ((input_encoding && nkf_enc_cp5022x_p(input_encoding)) ? 0x92 : DEL)) {
/* in case of 8th bit is on */
if (!estab_f&&!mime_decode_mode) {
/* in case of not established yet */
@@ -5672,6 +6102,7 @@ kanji_convert(FILE *f)
else if (c1 == 'I') {
/* JIS X 0201 Katakana */
set_input_mode(JIS_X_0201_1976_K);
+ shift_mode = 1;
SKIP;
}
else if (c1 == 'B' || c1 == 'J' || c1 == 'H') {
@@ -5813,11 +6244,52 @@ kanji_convert(FILE *f)
}
}
break;
+ case -3:
+ /* 4 bytes UTF-8 (check combining character) */
+ if ((c3 = (*i_getc)(f)) != EOF) {
+ if ((c4 = (*i_getc)(f)) != EOF) {
+ if (w_iconv_combine(c2, c1, 0, c3, c4, 0)) {
+ (*i_ungetc)(c4, f);
+ (*i_ungetc)(c3, f);
+ w_iconv_nocombine(c2, c1, 0);
+ }
+ } else {
+ (*i_ungetc)(c3, f);
+ w_iconv_nocombine(c2, c1, 0);
+ }
+ } else {
+ w_iconv_nocombine(c2, c1, 0);
+ }
+ break;
case -1:
/* 3 bytes EUC or UTF-8 */
if ((c3 = (*i_getc)(f)) != EOF) {
code_status(c3);
- (*iconv)(c2, c1, c3);
+ if ((*iconv)(c2, c1, c3) == -3) {
+ /* 6 bytes UTF-8 (check combining character) */
+ nkf_char c5, c6;
+ if ((c4 = (*i_getc)(f)) != EOF) {
+ if ((c5 = (*i_getc)(f)) != EOF) {
+ if ((c6 = (*i_getc)(f)) != EOF) {
+ if (w_iconv_combine(c2, c1, c3, c4, c5, c6)) {
+ (*i_ungetc)(c6, f);
+ (*i_ungetc)(c5, f);
+ (*i_ungetc)(c4, f);
+ w_iconv_nocombine(c2, c1, c3);
+ }
+ } else {
+ (*i_ungetc)(c5, f);
+ (*i_ungetc)(c4, f);
+ w_iconv_nocombine(c2, c1, c3);
+ }
+ } else {
+ (*i_ungetc)(c4, f);
+ w_iconv_nocombine(c2, c1, c3);
+ }
+ } else {
+ w_iconv_nocombine(c2, c1, c3);
+ }
+ }
}
break;
}
diff --git a/ext/nkf/nkf-utf8/nkf.h b/ext/nkf/nkf-utf8/nkf.h
index dd479a0f87..9f0f1515a2 100644
--- a/ext/nkf/nkf-utf8/nkf.h
+++ b/ext/nkf/nkf-utf8/nkf.h
@@ -1,11 +1,12 @@
/*
- *
+ *
* nkf.h - Header file for nkf
- *
- * $Id$
+ *
+ * $Id: nkf.h,v 1.6 2008/11/07 02:43:43 naruse Exp $
*/
#ifndef NKF_H
+#define NKF_H
/* Wrapper of configurations */
@@ -17,21 +18,9 @@
#endif
#if DEFAULT_NEWLINE == 0x0D0A
-#define PUT_NEWLINE(func) do {\
- func(0x0D);\
- func(0x0A);\
-} while (0)
-#define OCONV_NEWLINE(func) do {\
- func(0, 0x0D);\
- func(0, 0x0A);\
-} while (0)
#elif DEFAULT_NEWLINE == 0x0D
-#define PUT_NEWLINE(func) func(0x0D)
-#define OCONV_NEWLINE(func) func(0, 0x0D)
#else
#define DEFAULT_NEWLINE 0x0A
-#define PUT_NEWLINE(func) func(0x0A)
-#define OCONV_NEWLINE(func) func(0, 0x0A)
#endif
#ifdef HELP_OUTPUT_STDERR
#define HELP_OUTPUT stderr
@@ -94,7 +83,7 @@ void setbinmode(FILE *fp)
#define setbinmode(fp) setmode(fileno(fp), O_BINARY)
#endif
#else /* UNIX */
-#define setbinmode(fp)
+#define setbinmode(fp) (void)(fp)
#endif
#ifdef _IOFBF /* SysV and MSDOS, Windows */
@@ -185,6 +174,14 @@ void setbinmode(FILE *fp)
#define FALSE 0
#define TRUE 1
+#ifndef ARG_UNUSED
+#if defined(__GNUC__)
+# define ARG_UNUSED __attribute__ ((unused))
+#else
+# define ARG_UNUSED
+#endif
+#endif
+
#ifdef WIN32DLL
#include "nkf32.h"
#endif
diff --git a/ext/nkf/nkf-utf8/utf8tbl.c b/ext/nkf/nkf-utf8/utf8tbl.c
index 10eec60c5d..bbf5c5f109 100644
--- a/ext/nkf/nkf-utf8/utf8tbl.c
+++ b/ext/nkf/nkf-utf8/utf8tbl.c
@@ -68,6 +68,20 @@ static const unsigned short euc_to_utf8_A2_ms[] = {
0, 0, 0x212B, 0x2030, 0x266F, 0x266D, 0x266A, 0x2020,
0x2021, 0x00B6, 0, 0, 0, 0, 0x25EF,
};
+static const unsigned short euc_to_utf8_A2_x0213[] = {
+ 0x25C6, 0x25A1, 0x25A0, 0x25B3, 0x25B2, 0x25BD, 0x25BC,
+ 0x203B, 0x3012, 0x2192, 0x2190, 0x2191, 0x2193, 0x3013, 0xFF07,
+ 0xFF02, 0xFF0D, 0xFF5E, 0x3033, 0x3034, 0x3035, 0x303B, 0x303C,
+ 0x30FF, 0x309F, 0x2208, 0x220B, 0x2286, 0x2287, 0x2282, 0x2283,
+ 0x222A, 0x2229, 0x2284, 0x2285, 0x228A, 0x228B, 0x2209, 0x2205,
+ 0x2305, 0x2306, 0x2227, 0x2228, 0x00AC, 0x21D2, 0x21D4, 0x2200,
+ 0x2203, 0x2295, 0x2296, 0x2297, 0x2225, 0x2226, 0xFF5F, 0xFF60,
+ 0x3018, 0x3019, 0x3016, 0x3017, 0x2220, 0x22A5, 0x2312, 0x2202,
+ 0x2207, 0x2261, 0x2252, 0x226A, 0x226B, 0x221A, 0x223D, 0x221D,
+ 0x2235, 0x222B, 0x222C, 0x2262, 0x2243, 0x2245, 0x2248, 0x2276,
+ 0x2277, 0x2194, 0x212B, 0x2030, 0x266F, 0x266D, 0x266A, 0x2020,
+ 0x2021, 0x00B6, 0x266E, 0x266B, 0x266C, 0x2669, 0x25EF,
+};
static const unsigned short euc_to_utf8_A3[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -82,6 +96,20 @@ static const unsigned short euc_to_utf8_A3[] = {
0xFF50, 0xFF51, 0xFF52, 0xFF53, 0xFF54, 0xFF55, 0xFF56, 0xFF57,
0xFF58, 0xFF59, 0xFF5A, 0, 0, 0, 0,
};
+static const unsigned short euc_to_utf8_A3_x0213[] = {
+ 0x25B7, 0x25B6, 0x25C1, 0x25C0, 0x2197, 0x2198, 0x2196,
+ 0x2199, 0x21C4, 0x21E8, 0x21E6, 0x21E7, 0x21E9, 0x2934, 0x2935,
+ 0xFF10, 0xFF11, 0xFF12, 0xFF13, 0xFF14, 0xFF15, 0xFF16, 0xFF17,
+ 0xFF18, 0xFF19, 0x29BF, 0x25C9, 0x303D, 0xFE46, 0xFE45, 0x25E6,
+ 0x2022, 0xFF21, 0xFF22, 0xFF23, 0xFF24, 0xFF25, 0xFF26, 0xFF27,
+ 0xFF28, 0xFF29, 0xFF2A, 0xFF2B, 0xFF2C, 0xFF2D, 0xFF2E, 0xFF2F,
+ 0xFF30, 0xFF31, 0xFF32, 0xFF33, 0xFF34, 0xFF35, 0xFF36, 0xFF37,
+ 0xFF38, 0xFF39, 0xFF3A, 0x2213, 0x2135, 0x210F, 0x33CB, 0x2113,
+ 0x2127, 0xFF41, 0xFF42, 0xFF43, 0xFF44, 0xFF45, 0xFF46, 0xFF47,
+ 0xFF48, 0xFF49, 0xFF4A, 0xFF4B, 0xFF4C, 0xFF4D, 0xFF4E, 0xFF4F,
+ 0xFF50, 0xFF51, 0xFF52, 0xFF53, 0xFF54, 0xFF55, 0xFF56, 0xFF57,
+ 0xFF58, 0xFF59, 0xFF5A, 0x30A0, 0x2013, 0x29FA, 0x29FB,
+};
static const unsigned short euc_to_utf8_A4[] = {
0x3041, 0x3042, 0x3043, 0x3044, 0x3045, 0x3046, 0x3047,
0x3048, 0x3049, 0x304A, 0x304B, 0x304C, 0x304D, 0x304E, 0x304F,
@@ -96,6 +124,20 @@ static const unsigned short euc_to_utf8_A4[] = {
0x3090, 0x3091, 0x3092, 0x3093, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short euc_to_utf8_A4_x0213[] = {
+ 0x3041, 0x3042, 0x3043, 0x3044, 0x3045, 0x3046, 0x3047,
+ 0x3048, 0x3049, 0x304A, 0x304B, 0x304C, 0x304D, 0x304E, 0x304F,
+ 0x3050, 0x3051, 0x3052, 0x3053, 0x3054, 0x3055, 0x3056, 0x3057,
+ 0x3058, 0x3059, 0x305A, 0x305B, 0x305C, 0x305D, 0x305E, 0x305F,
+ 0x3060, 0x3061, 0x3062, 0x3063, 0x3064, 0x3065, 0x3066, 0x3067,
+ 0x3068, 0x3069, 0x306A, 0x306B, 0x306C, 0x306D, 0x306E, 0x306F,
+ 0x3070, 0x3071, 0x3072, 0x3073, 0x3074, 0x3075, 0x3076, 0x3077,
+ 0x3078, 0x3079, 0x307A, 0x307B, 0x307C, 0x307D, 0x307E, 0x307F,
+ 0x3080, 0x3081, 0x3082, 0x3083, 0x3084, 0x3085, 0x3086, 0x3087,
+ 0x3088, 0x3089, 0x308A, 0x308B, 0x308C, 0x308D, 0x308E, 0x308F,
+ 0x3090, 0x3091, 0x3092, 0x3093, 0x3094, 0x3095, 0x3096, /*0x304B*/ 0x309A,
+ /*0x304D*/ 0x309A, /*0x304F*/ 0x309A, /*0x3051*/ 0x309A, /*0x3053*/ 0x309A, 0, 0, 0,
+};
static const unsigned short euc_to_utf8_A5[] = {
0x30A1, 0x30A2, 0x30A3, 0x30A4, 0x30A5, 0x30A6, 0x30A7,
0x30A8, 0x30A9, 0x30AA, 0x30AB, 0x30AC, 0x30AD, 0x30AE, 0x30AF,
@@ -110,6 +152,20 @@ static const unsigned short euc_to_utf8_A5[] = {
0x30F0, 0x30F1, 0x30F2, 0x30F3, 0x30F4, 0x30F5, 0x30F6, 0,
0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short euc_to_utf8_A5_x0213[] = {
+ 0x30A1, 0x30A2, 0x30A3, 0x30A4, 0x30A5, 0x30A6, 0x30A7,
+ 0x30A8, 0x30A9, 0x30AA, 0x30AB, 0x30AC, 0x30AD, 0x30AE, 0x30AF,
+ 0x30B0, 0x30B1, 0x30B2, 0x30B3, 0x30B4, 0x30B5, 0x30B6, 0x30B7,
+ 0x30B8, 0x30B9, 0x30BA, 0x30BB, 0x30BC, 0x30BD, 0x30BE, 0x30BF,
+ 0x30C0, 0x30C1, 0x30C2, 0x30C3, 0x30C4, 0x30C5, 0x30C6, 0x30C7,
+ 0x30C8, 0x30C9, 0x30CA, 0x30CB, 0x30CC, 0x30CD, 0x30CE, 0x30CF,
+ 0x30D0, 0x30D1, 0x30D2, 0x30D3, 0x30D4, 0x30D5, 0x30D6, 0x30D7,
+ 0x30D8, 0x30D9, 0x30DA, 0x30DB, 0x30DC, 0x30DD, 0x30DE, 0x30DF,
+ 0x30E0, 0x30E1, 0x30E2, 0x30E3, 0x30E4, 0x30E5, 0x30E6, 0x30E7,
+ 0x30E8, 0x30E9, 0x30EA, 0x30EB, 0x30EC, 0x30ED, 0x30EE, 0x30EF,
+ 0x30F0, 0x30F1, 0x30F2, 0x30F3, 0x30F4, 0x30F5, 0x30F6, /*0x30AB*/ 0x309A,
+ /*0x30AD*/ 0x309A, /*0x30AF*/ 0x309A, /*0x30B1*/ 0x309A, /*0x30B3*/ 0x309A, /*0x30BB*/ 0x309A, /*0x30C4*/ 0x309A, /*0x30C8*/ 0x309A,
+};
static const unsigned short euc_to_utf8_A6[] = {
0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397,
0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F,
@@ -124,6 +180,20 @@ static const unsigned short euc_to_utf8_A6[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short euc_to_utf8_A6_x0213[] = {
+ 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397,
+ 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F,
+ 0x03A0, 0x03A1, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A8,
+ 0x03A9, 0x2664, 0x2660, 0x2662, 0x2666, 0x2661, 0x2665, 0x2667,
+ 0x2663, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7,
+ 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF,
+ 0x03C0, 0x03C1, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, 0x03C8,
+ 0x03C9, 0x03C2, 0x24F5, 0x24F6, 0x24F7, 0x24F8, 0x24F9, 0x24FA,
+ 0x24FB, 0x24FC, 0x24FD, 0x24FE, 0x2616, 0x2617, 0x3020, 0x260E,
+ 0x2600, 0x2601, 0x2602, 0x2603, 0x2668, 0x25B1, 0x31F0, 0x31F1,
+ 0x31F2, 0x31F3, 0x31F4, 0x31F5, 0x31F6, 0x31F7, 0x31F8, 0x31F9,
+ /*0x31F7*/ 0x309A, 0x31FA, 0x31FB, 0x31FC, 0x31FD, 0x31FE, 0x31FF,
+};
static const unsigned short euc_to_utf8_A7[] = {
0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0401,
0x0416, 0x0417, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D,
@@ -138,6 +208,20 @@ static const unsigned short euc_to_utf8_A7[] = {
0x044E, 0x044F, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short euc_to_utf8_A7_x0213[] = {
+ 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0401,
+ 0x0416, 0x0417, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D,
+ 0x041E, 0x041F, 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425,
+ 0x0426, 0x0427, 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D,
+ 0x042E, 0x042F, 0x23BE, 0x23BF, 0x23C0, 0x23C1, 0x23C2, 0x23C3,
+ 0x23C4, 0x23C5, 0x23C6, 0x23C7, 0x23C8, 0x23C9, 0x23CA, 0x23CB,
+ 0x23CC, 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0451,
+ 0x0436, 0x0437, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D,
+ 0x043E, 0x043F, 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445,
+ 0x0446, 0x0447, 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D,
+ 0x044E, 0x044F, 0x30F7, 0x30F8, 0x30F9, 0x30FA, 0x22DA, 0x22DB,
+ 0x2153, 0x2154, 0x2155, 0x2713, 0x2318, 0x2423, 0x23CE,
+};
static const unsigned short euc_to_utf8_A8[] = {
0x2500, 0x2502, 0x250C, 0x2510, 0x2518, 0x2514, 0x251C,
0x252C, 0x2524, 0x2534, 0x253C, 0x2501, 0x2503, 0x250F, 0x2513,
@@ -152,6 +236,20 @@ static const unsigned short euc_to_utf8_A8[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short euc_to_utf8_A8_x0213[] = {
+ 0x2500, 0x2502, 0x250C, 0x2510, 0x2518, 0x2514, 0x251C,
+ 0x252C, 0x2524, 0x2534, 0x253C, 0x2501, 0x2503, 0x250F, 0x2513,
+ 0x251B, 0x2517, 0x2523, 0x2533, 0x252B, 0x253B, 0x254B, 0x2520,
+ 0x252F, 0x2528, 0x2537, 0x253F, 0x251D, 0x2530, 0x2525, 0x2538,
+ 0x2542, 0x3251, 0x3252, 0x3253, 0x3254, 0x3255, 0x3256, 0x3257,
+ 0x3258, 0x3259, 0x325A, 0x325B, 0x325C, 0x325D, 0x325E, 0x325F,
+ 0x32B1, 0x32B2, 0x32B3, 0x32B4, 0x32B5, 0x32B6, 0x32B7, 0x32B8,
+ 0x32B9, 0x32BA, 0x32BB, 0x32BC, 0x32BD, 0x32BE, 0x32BF, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0x25D0,
+ 0x25D1, 0x25D2, 0x25D3, 0x203C, 0x2047, 0x2048, 0x2049, 0x01CD,
+ 0x01CE, 0x01D0, 0x1E3E, 0x1E3F, 0x01F8, 0x01F9, 0x01D1, 0x01D2,
+ 0x01D4, 0x01D6, 0x01D8, 0x01DA, 0x01DC, 0, 0,
+};
static const unsigned short euc_to_utf8_A9[] = {
0x2460, 0x2461, 0x2462, 0x2463, 0x2464, 0x2465, 0x2466,
0x2467, 0x2468, 0x2469, 0x246A, 0x246B, 0x246C, 0x246D, 0x246E,
@@ -166,6 +264,20 @@ static const unsigned short euc_to_utf8_A9[] = {
0, 0, 0x2488, 0x2489, 0x248A, 0x248B, 0x248C, 0x248D,
0x248E, 0x248F, 0x2490, 0, 0, 0, 0,
};
+static const unsigned short euc_to_utf8_A9_x0213[] = {
+ 0x20AC, 0x00A0, 0x00A1, 0x00A4, 0x00A6, 0x00A9, 0x00AA,
+ 0x00AB, 0x00AD, 0x00AE, 0x00AF, 0x00B2, 0x00B3, 0x00B7, 0x00B8,
+ 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, 0x00C0,
+ 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8,
+ 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x00D0,
+ 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D8, 0x00D9,
+ 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, 0x00E0, 0x00E1,
+ 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9,
+ 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x00F0, 0x00F1,
+ 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F8, 0x00F9, 0x00FA,
+ 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF, 0x0100, 0x012A, 0x016A,
+ 0x0112, 0x014C, 0x0101, 0x012B, 0x016B, 0x0113, 0x014D,
+};
static const unsigned short euc_to_utf8_AA[] = {
0x2160, 0x2161, 0x2162, 0x2163, 0x2164, 0x2165, 0x2166,
0x2167, 0x2168, 0x2169, 0x216A, 0x216B, 0, 0, 0,
@@ -180,6 +292,20 @@ static const unsigned short euc_to_utf8_AA[] = {
0x24AF, 0x24B0, 0x24B1, 0x24B2, 0x24B3, 0x24B4, 0x24B5, 0,
0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short euc_to_utf8_AA_x0213[] = {
+ 0x0104, 0x02D8, 0x0141, 0x013D, 0x015A, 0x0160, 0x015E,
+ 0x0164, 0x0179, 0x017D, 0x017B, 0x0105, 0x02DB, 0x0142, 0x013E,
+ 0x015B, 0x02C7, 0x0161, 0x015F, 0x0165, 0x017A, 0x02DD, 0x017E,
+ 0x017C, 0x0154, 0x0102, 0x0139, 0x0106, 0x010C, 0x0118, 0x011A,
+ 0x010E, 0x0143, 0x0147, 0x0150, 0x0158, 0x016E, 0x0170, 0x0162,
+ 0x0155, 0x0103, 0x013A, 0x0107, 0x010D, 0x0119, 0x011B, 0x010F,
+ 0x0111, 0x0144, 0x0148, 0x0151, 0x0159, 0x016F, 0x0171, 0x0163,
+ 0x02D9, 0x0108, 0x011C, 0x0124, 0x0134, 0x015C, 0x016C, 0x0109,
+ 0x011D, 0x0125, 0x0135, 0x015D, 0x016D, 0x0271, 0x028B, 0x027E,
+ 0x0283, 0x0292, 0x026C, 0x026E, 0x0279, 0x0288, 0x0256, 0x0273,
+ 0x027D, 0x0282, 0x0290, 0x027B, 0x026D, 0x025F, 0x0272, 0x029D,
+ 0x028E, 0x0261, 0x014B, 0x0270, 0x0281, 0x0127, 0x0295,
+};
static const unsigned short euc_to_utf8_AB[] = {
0x339C, 0x339F, 0x339D, 0x33A0, 0x33A4, 0, 0x33A1,
0x33A5, 0x339E, 0x33A2, 0x338E, 0, 0x338F, 0x33C4, 0x3396,
@@ -194,6 +320,20 @@ static const unsigned short euc_to_utf8_AB[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0x2116, 0x33CD, 0x2121, 0,
};
+static const unsigned short euc_to_utf8_AB_x0213[] = {
+ 0x0294, 0x0266, 0x0298, 0x01C2, 0x0253, 0x0257, 0x0284,
+ 0x0260, 0x0193, 0x0153, 0x0152, 0x0268, 0x0289, 0x0258, 0x0275,
+ 0x0259, 0x025C, 0x025E, 0x0250, 0x026F, 0x028A, 0x0264, 0x028C,
+ 0x0254, 0x0251, 0x0252, 0x028D, 0x0265, 0x02A2, 0x02A1, 0x0255,
+ 0x0291, 0x027A, 0x0267, 0x025A, /*0x00E6*/ 0x0300, 0x01FD, 0x1F70, 0x1F71,
+ /*0x0254*/ 0x0300, /*0x0254*/ 0x0301, /*0x028C*/ 0x0300, /*0x028C*/ 0x0301, /*0x0259*/ 0x0300, /*0x0259*/ 0x0301, /*0x025A*/ 0x0300, /*0x025A*/ 0x0301,
+ 0x1F72, 0x1F73, 0x0361, 0x02C8, 0x02CC, 0x02D0, 0x02D1, 0x0306,
+ 0x203F, 0x030B, /*0*/ 0x0301, 0x0304, /*0*/ 0x0300, 0x030F, 0x030C, 0x0302,
+ /*0*/ 0x02E5, 0x02E6, 0x02E7, 0x02E8, /*0*/ 0x02E9, /*0x02E9*/ 0x02E5, /*0x02E5*/ 0x02E9, 0x0325,
+ 0x032C, 0x0339, 0x031C, 0x031F, 0x0320, 0x0308, 0x033D, 0x0329,
+ 0x032F, 0x02DE, 0x0324, 0x0330, 0x033C, 0x0334, 0x031D, 0x031E,
+ 0x0318, 0x0319, 0x032A, 0x033A, 0x033B, 0x0303, 0x031A,
+};
static const unsigned short euc_to_utf8_AC[] = {
0x2664, 0x2667, 0x2661, 0x2662, 0x2660, 0x2663, 0x2665,
0x2666, 0, 0, 0, 0, 0, 0, 0,
@@ -222,6 +362,20 @@ static const unsigned short euc_to_utf8_AC_mac[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short euc_to_utf8_AC_x0213[] = {
+ 0x2776, 0x2777, 0x2778, 0x2779, 0x277A, 0x277B, 0x277C,
+ 0x277D, 0x277E, 0x277F, 0x24EB, 0x24EC, 0x24ED, 0x24EE, 0x24EF,
+ 0x24F0, 0x24F1, 0x24F2, 0x24F3, 0x24F4, 0x2170, 0x2171, 0x2172,
+ 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, 0x2178, 0x2179, 0x217A,
+ 0x217B, 0x24D0, 0x24D1, 0x24D2, 0x24D3, 0x24D4, 0x24D5, 0x24D6,
+ 0x24D7, 0x24D8, 0x24D9, 0x24DA, 0x24DB, 0x24DC, 0x24DD, 0x24DE,
+ 0x24DF, 0x24E0, 0x24E1, 0x24E2, 0x24E3, 0x24E4, 0x24E5, 0x24E6,
+ 0x24E7, 0x24E8, 0x24E9, 0x32D0, 0x32D1, 0x32D2, 0x32D3, 0x32D4,
+ 0x32D5, 0x32D6, 0x32D7, 0x32D8, 0x32D9, 0x32DA, 0x32DB, 0x32DC,
+ 0x32DD, 0x32DE, 0x32DF, 0x32E0, 0x32E1, 0x32E2, 0x32E3, 0x32FA,
+ 0x32E9, 0x32E5, 0x32ED, 0x32EC, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0x2051, 0x2042,
+};
static const unsigned short euc_to_utf8_AD[] = {
0x2460, 0x2461, 0x2462, 0x2463, 0x2464, 0x2465, 0x2466,
0x2467, 0x2468, 0x2469, 0x246A, 0x246B, 0x246C, 0x246D, 0x246E,
@@ -250,6 +404,20 @@ static const unsigned short euc_to_utf8_AD_mac[] = {
0x2252, 0x5927, 0x5C0F, 0x32A4, 0x32A5, 0x32A6, 0x32A7, 0x32A8,
0x533B, 0x8CA1, 0x512A, 0x52B4, 0x5370, 0x63A7, 0x79D8,
};
+static const unsigned short euc_to_utf8_AD_x0213[] = {
+ 0x2460, 0x2461, 0x2462, 0x2463, 0x2464, 0x2465, 0x2466,
+ 0x2467, 0x2468, 0x2469, 0x246A, 0x246B, 0x246C, 0x246D, 0x246E,
+ 0x246F, 0x2470, 0x2471, 0x2472, 0x2473, 0x2160, 0x2161, 0x2162,
+ 0x2163, 0x2164, 0x2165, 0x2166, 0x2167, 0x2168, 0x2169, 0x216A,
+ 0x3349, 0x3314, 0x3322, 0x334D, 0x3318, 0x3327, 0x3303, 0x3336,
+ 0x3351, 0x3357, 0x330D, 0x3326, 0x3323, 0x332B, 0x334A, 0x333B,
+ 0x339C, 0x339D, 0x339E, 0x338E, 0x338F, 0x33C4, 0x33A1, 0x216B,
+ 0, 0, 0, 0, 0, 0, 0, 0x337B,
+ 0x301D, 0x301F, 0x2116, 0x33CD, 0x2121, 0x32A4, 0x32A5, 0x32A6,
+ 0x32A7, 0x32A8, 0x3231, 0x3232, 0x3239, 0x337E, 0x337D, 0x337C,
+ 0x2252, 0x2261, 0x222B, 0x222E, 0x2211, 0x221A, 0x22A5, 0x2220,
+ 0x221F, 0x22BF, 0x2235, 0x2229, 0x222A, 0x2756, 0x261E,
+};
static const unsigned short euc_to_utf8_AE[] = {
0x3349, 0x3322, 0x334D, 0x3314, 0x3316, 0x3305, 0x3333,
0x334E, 0x3303, 0x3336, 0x3318, 0x3315, 0x3327, 0x3351, 0x334A,
@@ -264,6 +432,20 @@ static const unsigned short euc_to_utf8_AE[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0x337F, 0, 0,
};
+static const unsigned short euc_to_utf8_AE_x0213[] = {
+ 0x4FF1, 0xD840 /*0xDC0B*/, 0x3402, 0x4E28, 0x4E2F, 0x4E30, 0x4E8D,
+ 0x4EE1, 0x4EFD, 0x4EFF, 0x4F03, 0x4F0B, 0x4F60, 0x4F48, 0x4F49,
+ 0x4F56, 0x4F5F, 0x4F6A, 0x4F6C, 0x4F7E, 0x4F8A, 0x4F94, 0x4F97,
+ 0xFA30, 0x4FC9, 0x4FE0, 0x5001, 0x5002, 0x500E, 0x5018, 0x5027,
+ 0x502E, 0x5040, 0x503B, 0x5041, 0x5094, 0x50CC, 0x50F2, 0x50D0,
+ 0x50E6, 0xFA31, 0x5106, 0x5103, 0x510B, 0x511E, 0x5135, 0x514A,
+ 0xFA32, 0x5155, 0x5157, 0x34B5, 0x519D, 0x51C3, 0x51CA, 0x51DE,
+ 0x51E2, 0x51EE, 0x5201, 0x34DB, 0x5213, 0x5215, 0x5249, 0x5257,
+ 0x5261, 0x5293, 0x52C8, 0xFA33, 0x52CC, 0x52D0, 0x52D6, 0x52DB,
+ 0xFA34, 0x52F0, 0x52FB, 0x5300, 0x5307, 0x531C, 0xFA35, 0x5361,
+ 0x5363, 0x537D, 0x5393, 0x539D, 0x53B2, 0x5412, 0x5427, 0x544D,
+ 0x549C, 0x546B, 0x5474, 0x547F, 0x5488, 0x5496, 0x54A1,
+};
static const unsigned short euc_to_utf8_AF[] = {
0x222E, 0x221F, 0x22BF, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -278,6 +460,20 @@ static const unsigned short euc_to_utf8_AF[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short euc_to_utf8_AF_x0213[] = {
+ 0x54A9, 0x54C6, 0x54FF, 0x550E, 0x552B, 0x5535, 0x5550,
+ 0x555E, 0x5581, 0x5586, 0x558E, 0xFA36, 0x55AD, 0x55CE, 0xFA37,
+ 0x5608, 0x560E, 0x563B, 0x5649, 0x5676, 0x5666, 0xFA38, 0x566F,
+ 0x5671, 0x5672, 0x5699, 0x569E, 0x56A9, 0x56AC, 0x56B3, 0x56C9,
+ 0x56CA, 0x570A, 0xD844 /*0xDE3D*/, 0x5721, 0x572F, 0x5733, 0x5734, 0x5770,
+ 0x5777, 0x577C, 0x579C, 0xFA0F, 0xD844 /*0xDF1B*/, 0x57B8, 0x57C7, 0x57C8,
+ 0x57CF, 0x57E4, 0x57ED, 0x57F5, 0x57F6, 0x57FF, 0x5809, 0xFA10,
+ 0x5861, 0x5864, 0xFA39, 0x587C, 0x5889, 0x589E, 0xFA3A, 0x58A9,
+ 0xD845 /*0xDC6E*/, 0x58D2, 0x58CE, 0x58D4, 0x58DA, 0x58E0, 0x58E9, 0x590C,
+ 0x8641, 0x595D, 0x596D, 0x598B, 0x5992, 0x59A4, 0x59C3, 0x59D2,
+ 0x59DD, 0x5A13, 0x5A23, 0x5A67, 0x5A6D, 0x5A77, 0x5A7E, 0x5A84,
+ 0x5A9E, 0x5AA7, 0x5AC4, 0xD846 /*0xDCBD*/, 0x5B19, 0x5B25, 0x525D,
+};
static const unsigned short euc_to_utf8_B0[] = {
0x4E9C, 0x5516, 0x5A03, 0x963F, 0x54C0, 0x611B, 0x6328,
0x59F6, 0x9022, 0x8475, 0x831C, 0x7A50, 0x60AA, 0x63E1, 0x6E25,
@@ -726,6 +922,20 @@ static const unsigned short euc_to_utf8_CF[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short euc_to_utf8_CF_x0213[] = {
+ 0x84EE, 0x9023, 0x932C, 0x5442, 0x9B6F, 0x6AD3, 0x7089,
+ 0x8CC2, 0x8DEF, 0x9732, 0x52B4, 0x5A41, 0x5ECA, 0x5F04, 0x6717,
+ 0x697C, 0x6994, 0x6D6A, 0x6F0F, 0x7262, 0x72FC, 0x7BED, 0x8001,
+ 0x807E, 0x874B, 0x90CE, 0x516D, 0x9E93, 0x7984, 0x808B, 0x9332,
+ 0x8AD6, 0x502D, 0x548C, 0x8A71, 0x6B6A, 0x8CC4, 0x8107, 0x60D1,
+ 0x67A0, 0x9DF2, 0x4E99, 0x4E98, 0x9C10, 0x8A6B, 0x85C1, 0x8568,
+ 0x6900, 0x6E7E, 0x7897, 0x8155, 0xD842 /*0xDF9F*/, 0x5B41, 0x5B56, 0x5B7D,
+ 0x5B93, 0x5BD8, 0x5BEC, 0x5C12, 0x5C1E, 0x5C23, 0x5C2B, 0x378D,
+ 0x5C62, 0xFA3B, 0xFA3C, 0xD845 /*0xDEB4*/, 0x5C7A, 0x5C8F, 0x5C9F, 0x5CA3,
+ 0x5CAA, 0x5CBA, 0x5CCB, 0x5CD0, 0x5CD2, 0x5CF4, 0xD847 /*0xDE34*/, 0x37E2,
+ 0x5D0D, 0x5D27, 0xFA11, 0x5D46, 0x5D47, 0x5D53, 0x5D4A, 0x5D6D,
+ 0x5D81, 0x5DA0, 0x5DA4, 0x5DA7, 0x5DB8, 0x5DCB, 0x541E,
+};
static const unsigned short euc_to_utf8_D0[] = {
0x5F0C, 0x4E10, 0x4E15, 0x4E2A, 0x4E31, 0x4E36, 0x4E3C,
0x4E3F, 0x4E42, 0x4E56, 0x4E58, 0x4E82, 0x4E85, 0x8C6B, 0x4E8A,
@@ -1244,6 +1454,20 @@ static const unsigned short euc_to_utf8_F4[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short euc_to_utf8_F4_x0213[] = {
+ 0x582F, 0x69C7, 0x9059, 0x7464, 0x51DC, 0x7199, 0x5653,
+ 0x5DE2, 0x5E14, 0x5E18, 0x5E58, 0x5E5E, 0x5EBE, 0xF928, 0x5ECB,
+ 0x5EF9, 0x5F00, 0x5F02, 0x5F07, 0x5F1D, 0x5F23, 0x5F34, 0x5F36,
+ 0x5F3D, 0x5F40, 0x5F45, 0x5F54, 0x5F58, 0x5F64, 0x5F67, 0x5F7D,
+ 0x5F89, 0x5F9C, 0x5FA7, 0x5FAF, 0x5FB5, 0x5FB7, 0x5FC9, 0x5FDE,
+ 0x5FE1, 0x5FE9, 0x600D, 0x6014, 0x6018, 0x6033, 0x6035, 0x6047,
+ 0xFA3D, 0x609D, 0x609E, 0x60CB, 0x60D4, 0x60D5, 0x60DD, 0x60F8,
+ 0x611C, 0x612B, 0x6130, 0x6137, 0xFA3E, 0x618D, 0xFA3F, 0x61BC,
+ 0x61B9, 0xFA40, 0x6222, 0x623E, 0x6243, 0x6256, 0x625A, 0x626F,
+ 0x6285, 0x62C4, 0x62D6, 0x62FC, 0x630A, 0x6318, 0x6339, 0x6343,
+ 0x6365, 0x637C, 0x63E5, 0x63ED, 0x63F5, 0x6410, 0x6414, 0x6422,
+ 0x6479, 0x6451, 0x6460, 0x646D, 0x64CE, 0x64BE, 0x64BF,
+};
static const unsigned short euc_to_utf8_F5[] = {
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -1258,6 +1482,62 @@ static const unsigned short euc_to_utf8_F5[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short euc_to_utf8_F5_x0213[] = {
+ 0x64C4, 0x64CA, 0x64D0, 0x64F7, 0x64FB, 0x6522, 0x6529,
+ 0xFA41, 0x6567, 0x659D, 0xFA42, 0x6600, 0x6609, 0x6615, 0x661E,
+ 0x663A, 0x6622, 0x6624, 0x662B, 0x6630, 0x6631, 0x6633, 0x66FB,
+ 0x6648, 0x664C, 0xD84C /*0xDDC4*/, 0x6659, 0x665A, 0x6661, 0x6665, 0x6673,
+ 0x6677, 0x6678, 0x668D, 0xFA43, 0x66A0, 0x66B2, 0x66BB, 0x66C6,
+ 0x66C8, 0x3B22, 0x66DB, 0x66E8, 0x66FA, 0x6713, 0xF929, 0x6733,
+ 0x6766, 0x6747, 0x6748, 0x677B, 0x6781, 0x6793, 0x6798, 0x679B,
+ 0x67BB, 0x67F9, 0x67C0, 0x67D7, 0x67FC, 0x6801, 0x6852, 0x681D,
+ 0x682C, 0x6831, 0x685B, 0x6872, 0x6875, 0xFA44, 0x68A3, 0x68A5,
+ 0x68B2, 0x68C8, 0x68D0, 0x68E8, 0x68ED, 0x68F0, 0x68F1, 0x68FC,
+ 0x690A, 0x6949, 0xD84D /*0xDDC4*/, 0x6935, 0x6942, 0x6957, 0x6963, 0x6964,
+ 0x6968, 0x6980, 0xFA14, 0x69A5, 0x69AD, 0x69CF, 0x3BB6,
+};
+static const unsigned short euc_to_utf8_F6_x0213[] = {
+ 0x3BC3, 0x69E2, 0x69E9, 0x69EA, 0x69F5, 0x69F6, 0x6A0F,
+ 0x6A15, 0xD84D /*0xDF3F*/, 0x6A3B, 0x6A3E, 0x6A45, 0x6A50, 0x6A56, 0x6A5B,
+ 0x6A6B, 0x6A73, 0xD84D /*0xDF63*/, 0x6A89, 0x6A94, 0x6A9D, 0x6A9E, 0x6AA5,
+ 0x6AE4, 0x6AE7, 0x3C0F, 0xF91D, 0x6B1B, 0x6B1E, 0x6B2C, 0x6B35,
+ 0x6B46, 0x6B56, 0x6B60, 0x6B65, 0x6B67, 0x6B77, 0x6B82, 0x6BA9,
+ 0x6BAD, 0xF970, 0x6BCF, 0x6BD6, 0x6BD7, 0x6BFF, 0x6C05, 0x6C10,
+ 0x6C33, 0x6C59, 0x6C5C, 0x6CAA, 0x6C74, 0x6C76, 0x6C85, 0x6C86,
+ 0x6C98, 0x6C9C, 0x6CFB, 0x6CC6, 0x6CD4, 0x6CE0, 0x6CEB, 0x6CEE,
+ 0xD84F /*0xDCFE*/, 0x6D04, 0x6D0E, 0x6D2E, 0x6D31, 0x6D39, 0x6D3F, 0x6D58,
+ 0x6D65, 0xFA45, 0x6D82, 0x6D87, 0x6D89, 0x6D94, 0x6DAA, 0x6DAC,
+ 0x6DBF, 0x6DC4, 0x6DD6, 0x6DDA, 0x6DDB, 0x6DDD, 0x6DFC, 0xFA46,
+ 0x6E34, 0x6E44, 0x6E5C, 0x6E5E, 0x6EAB, 0x6EB1, 0x6EC1,
+};
+static const unsigned short euc_to_utf8_F7_x0213[] = {
+ 0x6EC7, 0x6ECE, 0x6F10, 0x6F1A, 0xFA47, 0x6F2A, 0x6F2F,
+ 0x6F33, 0x6F51, 0x6F59, 0x6F5E, 0x6F61, 0x6F62, 0x6F7E, 0x6F88,
+ 0x6F8C, 0x6F8D, 0x6F94, 0x6FA0, 0x6FA7, 0x6FB6, 0x6FBC, 0x6FC7,
+ 0x6FCA, 0x6FF9, 0x6FF0, 0x6FF5, 0x7005, 0x7006, 0x7028, 0x704A,
+ 0x705D, 0x705E, 0x704E, 0x7064, 0x7075, 0x7085, 0x70A4, 0x70AB,
+ 0x70B7, 0x70D4, 0x70D8, 0x70E4, 0x710F, 0x712B, 0x711E, 0x7120,
+ 0x712E, 0x7130, 0x7146, 0x7147, 0x7151, 0xFA48, 0x7152, 0x715C,
+ 0x7160, 0x7168, 0xFA15, 0x7185, 0x7187, 0x7192, 0x71C1, 0x71BA,
+ 0x71C4, 0x71FE, 0x7200, 0x7215, 0x7255, 0x7256, 0x3E3F, 0x728D,
+ 0x729B, 0x72BE, 0x72C0, 0x72FB, 0xD851 /*0xDFF1*/, 0x7327, 0x7328, 0xFA16,
+ 0x7350, 0x7366, 0x737C, 0x7395, 0x739F, 0x73A0, 0x73A2, 0x73A6,
+ 0x73AB, 0x73C9, 0x73CF, 0x73D6, 0x73D9, 0x73E3, 0x73E9,
+};
+static const unsigned short euc_to_utf8_F8_x0213[] = {
+ 0x7407, 0x740A, 0x741A, 0x741B, 0xFA4A, 0x7426, 0x7428,
+ 0x742A, 0x742B, 0x742C, 0x742E, 0x742F, 0x7430, 0x7444, 0x7446,
+ 0x7447, 0x744B, 0x7457, 0x7462, 0x746B, 0x746D, 0x7486, 0x7487,
+ 0x7489, 0x7498, 0x749C, 0x749F, 0x74A3, 0x7490, 0x74A6, 0x74A8,
+ 0x74A9, 0x74B5, 0x74BF, 0x74C8, 0x74C9, 0x74DA, 0x74FF, 0x7501,
+ 0x7517, 0x752F, 0x756F, 0x7579, 0x7592, 0x3F72, 0x75CE, 0x75E4,
+ 0x7600, 0x7602, 0x7608, 0x7615, 0x7616, 0x7619, 0x761E, 0x762D,
+ 0x7635, 0x7643, 0x764B, 0x7664, 0x7665, 0x766D, 0x766F, 0x7671,
+ 0x7681, 0x769B, 0x769D, 0x769E, 0x76A6, 0x76AA, 0x76B6, 0x76C5,
+ 0x76CC, 0x76CE, 0x76D4, 0x76E6, 0x76F1, 0x76FC, 0x770A, 0x7719,
+ 0x7734, 0x7736, 0x7746, 0x774D, 0x774E, 0x775C, 0x775F, 0x7762,
+ 0x777A, 0x7780, 0x7794, 0x77AA, 0x77E0, 0x782D, 0xD855 /*0xDC8E*/,
+};
static const unsigned short euc_to_utf8_F9[] = {
0x7E8A, 0x891C, 0x9348, 0x9288, 0x84DC, 0x4FC9, 0x70BB,
0x6631, 0x68C8, 0x92F9, 0x66FB, 0x5F45, 0x4E28, 0x4EE1, 0x4EFC,
@@ -1272,6 +1552,20 @@ static const unsigned short euc_to_utf8_F9[] = {
0x5CA6, 0x5CBA, 0x5CF5, 0x5D27, 0x5D53, 0xFA11, 0x5D42, 0x5D6D,
0x5DB8, 0x5DB9, 0x5DD0, 0x5F21, 0x5F34, 0x5F67, 0x5FB7,
};
+static const unsigned short euc_to_utf8_F9_x0213[] = {
+ 0x7843, 0x784E, 0x784F, 0x7851, 0x7868, 0x786E, 0xFA4B,
+ 0x78B0, 0xD855 /*0xDD0E*/, 0x78AD, 0x78E4, 0x78F2, 0x7900, 0x78F7, 0x791C,
+ 0x792E, 0x7931, 0x7934, 0xFA4C, 0xFA4D, 0x7945, 0x7946, 0xFA4E,
+ 0xFA4F, 0xFA50, 0x795C, 0xFA51, 0xFA19, 0xFA1A, 0x7979, 0xFA52,
+ 0xFA53, 0xFA1B, 0x7998, 0x79B1, 0x79B8, 0x79C8, 0x79CA, 0xD855 /*0xDF71*/,
+ 0x79D4, 0x79DE, 0x79EB, 0x79ED, 0x7A03, 0xFA54, 0x7A39, 0x7A5D,
+ 0x7A6D, 0xFA55, 0x7A85, 0x7AA0, 0xD856 /*0xDDC4*/, 0x7AB3, 0x7ABB, 0x7ACE,
+ 0x7AEB, 0x7AFD, 0x7B12, 0x7B2D, 0x7B3B, 0x7B47, 0x7B4E, 0x7B60,
+ 0x7B6D, 0x7B6F, 0x7B72, 0x7B9E, 0xFA56, 0x7BD7, 0x7BD9, 0x7C01,
+ 0x7C31, 0x7C1E, 0x7C20, 0x7C33, 0x7C36, 0x4264, 0xD857 /*0xDDA1*/, 0x7C59,
+ 0x7C6D, 0x7C79, 0x7C8F, 0x7C94, 0x7CA0, 0x7CBC, 0x7CD5, 0x7CD9,
+ 0x7CDD, 0x7D07, 0x7D08, 0x7D13, 0x7D1D, 0x7D23, 0x7D31,
+};
static const unsigned short euc_to_utf8_FA[] = {
0x5FDE, 0x605D, 0x6085, 0x608A, 0x60DE, 0x60D5, 0x6120,
0x60F2, 0x6111, 0x6137, 0x6130, 0x6198, 0x6213, 0x62A6, 0x63F5,
@@ -1286,6 +1580,20 @@ static const unsigned short euc_to_utf8_FA[] = {
0x6FF5, 0x7005, 0x7007, 0x7028, 0x7085, 0x70AB, 0x710F, 0x7104,
0x715C, 0x7146, 0x7147, 0xFA15, 0x71C1, 0x71FE, 0x72B1,
};
+static const unsigned short euc_to_utf8_FA_x0213[] = {
+ 0x7D41, 0x7D48, 0x7D53, 0x7D5C, 0x7D7A, 0x7D83, 0x7D8B,
+ 0x7DA0, 0x7DA6, 0x7DC2, 0x7DCC, 0x7DD6, 0x7DE3, 0xFA57, 0x7E28,
+ 0x7E08, 0x7E11, 0x7E15, 0xFA59, 0x7E47, 0x7E52, 0x7E61, 0x7E8A,
+ 0x7E8D, 0x7F47, 0xFA5A, 0x7F91, 0x7F97, 0x7FBF, 0x7FCE, 0x7FDB,
+ 0x7FDF, 0x7FEC, 0x7FEE, 0x7FFA, 0xFA5B, 0x8014, 0x8026, 0x8035,
+ 0x8037, 0x803C, 0x80CA, 0x80D7, 0x80E0, 0x80F3, 0x8118, 0x814A,
+ 0x8160, 0x8167, 0x8168, 0x816D, 0x81BB, 0x81CA, 0x81CF, 0x81D7,
+ 0xFA5C, 0x4453, 0x445B, 0x8260, 0x8274, 0xD85A /*0xDEFF*/, 0x828E, 0x82A1,
+ 0x82A3, 0x82A4, 0x82A9, 0x82AE, 0x82B7, 0x82BE, 0x82BF, 0x82C6,
+ 0x82D5, 0x82FD, 0x82FE, 0x8300, 0x8301, 0x8362, 0x8322, 0x832D,
+ 0x833A, 0x8343, 0x8347, 0x8351, 0x8355, 0x837D, 0x8386, 0x8392,
+ 0x8398, 0x83A7, 0x83A9, 0x83BF, 0x83C0, 0x83C7, 0x83CF,
+};
static const unsigned short euc_to_utf8_FB[] = {
0x72BE, 0x7324, 0xFA16, 0x7377, 0x73BD, 0x73C9, 0x73D6,
0x73E3, 0x73D2, 0x7407, 0x73F5, 0x7426, 0x742A, 0x7429, 0x742E,
@@ -1300,6 +1608,20 @@ static const unsigned short euc_to_utf8_FB[] = {
0x8B7F, 0x8CF0, 0x8CF4, 0x8D12, 0x8D76, 0xFA23, 0x8ECF, 0xFA24,
0xFA25, 0x9067, 0x90DE, 0xFA26, 0x9115, 0x9127, 0x91DA,
};
+static const unsigned short euc_to_utf8_FB_x0213[] = {
+ 0x83D1, 0x83E1, 0x83EA, 0x8401, 0x8406, 0x840A, 0xFA5F,
+ 0x8448, 0x845F, 0x8470, 0x8473, 0x8485, 0x849E, 0x84AF, 0x84B4,
+ 0x84BA, 0x84C0, 0x84C2, 0xD85B /*0xDE40*/, 0x8532, 0x851E, 0x8523, 0x852F,
+ 0x8559, 0x8564, 0xFA1F, 0x85AD, 0x857A, 0x858C, 0x858F, 0x85A2,
+ 0x85B0, 0x85CB, 0x85CE, 0x85ED, 0x8612, 0x85FF, 0x8604, 0x8605,
+ 0x8610, 0xD85C /*0xDCF4*/, 0x8618, 0x8629, 0x8638, 0x8657, 0x865B, 0xF936,
+ 0x8662, 0x459D, 0x866C, 0x8675, 0x8698, 0x86B8, 0x86FA, 0x86FC,
+ 0x86FD, 0x870B, 0x8771, 0x8787, 0x8788, 0x87AC, 0x87AD, 0x87B5,
+ 0x45EA, 0x87D6, 0x87EC, 0x8806, 0x880A, 0x8810, 0x8814, 0x881F,
+ 0x8898, 0x88AA, 0x88CA, 0x88CE, 0xD85D /*0xDE84*/, 0x88F5, 0x891C, 0xFA60,
+ 0x8918, 0x8919, 0x891A, 0x8927, 0x8930, 0x8932, 0x8939, 0x8940,
+ 0x8994, 0xFA61, 0x89D4, 0x89E5, 0x89F6, 0x8A12, 0x8A15,
+};
static const unsigned short euc_to_utf8_FC[] = {
0x91D7, 0x91DE, 0x91ED, 0x91EE, 0x91E4, 0x91E5, 0x9206,
0x9210, 0x920A, 0x923A, 0x9240, 0x923C, 0x924E, 0x9259, 0x9251,
@@ -1330,6 +1652,413 @@ static const unsigned short euc_to_utf8_FC_ms[] = {
0, 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176,
0x2177, 0x2178, 0x2179, 0xFFE2, 0xFFE4, 0xFF07, 0xFF02,
};
+static const unsigned short euc_to_utf8_FC_x0213[] = {
+ 0x8A22, 0x8A37, 0x8A47, 0x8A4E, 0x8A5D, 0x8A61, 0x8A75,
+ 0x8A79, 0x8AA7, 0x8AD0, 0x8ADF, 0x8AF4, 0x8AF6, 0xFA22, 0xFA62,
+ 0xFA63, 0x8B46, 0x8B54, 0x8B59, 0x8B69, 0x8B9D, 0x8C49, 0x8C68,
+ 0xFA64, 0x8CE1, 0x8CF4, 0x8CF8, 0x8CFE, 0xFA65, 0x8D12, 0x8D1B,
+ 0x8DAF, 0x8DCE, 0x8DD1, 0x8DD7, 0x8E20, 0x8E23, 0x8E3D, 0x8E70,
+ 0x8E7B, 0xD860 /*0xDE77*/, 0x8EC0, 0x4844, 0x8EFA, 0x8F1E, 0x8F2D, 0x8F36,
+ 0x8F54, 0xD860 /*0xDFCD*/, 0x8FA6, 0x8FB5, 0x8FE4, 0x8FE8, 0x8FEE, 0x9008,
+ 0x902D, 0xFA67, 0x9088, 0x9095, 0x9097, 0x9099, 0x909B, 0x90A2,
+ 0x90B3, 0x90BE, 0x90C4, 0x90C5, 0x90C7, 0x90D7, 0x90DD, 0x90DE,
+ 0x90EF, 0x90F4, 0xFA26, 0x9114, 0x9115, 0x9116, 0x9122, 0x9123,
+ 0x9127, 0x912F, 0x9131, 0x9134, 0x913D, 0x9148, 0x915B, 0x9183,
+ 0x919E, 0x91AC, 0x91B1, 0x91BC, 0x91D7, 0x91FB, 0x91E4,
+};
+static const unsigned short euc_to_utf8_FD_x0213[] = {
+ 0x91E5, 0x91ED, 0x91F1, 0x9207, 0x9210, 0x9238, 0x9239,
+ 0x923A, 0x923C, 0x9240, 0x9243, 0x924F, 0x9278, 0x9288, 0x92C2,
+ 0x92CB, 0x92CC, 0x92D3, 0x92E0, 0x92FF, 0x9304, 0x931F, 0x9321,
+ 0x9325, 0x9348, 0x9349, 0x934A, 0x9364, 0x9365, 0x936A, 0x9370,
+ 0x939B, 0x93A3, 0x93BA, 0x93C6, 0x93DE, 0x93DF, 0x9404, 0x93FD,
+ 0x9433, 0x944A, 0x9463, 0x946B, 0x9471, 0x9472, 0x958E, 0x959F,
+ 0x95A6, 0x95A9, 0x95AC, 0x95B6, 0x95BD, 0x95CB, 0x95D0, 0x95D3,
+ 0x49B0, 0x95DA, 0x95DE, 0x9658, 0x9684, 0xF9DC, 0x969D, 0x96A4,
+ 0x96A5, 0x96D2, 0x96DE, 0xFA68, 0x96E9, 0x96EF, 0x9733, 0x973B,
+ 0x974D, 0x974E, 0x974F, 0x975A, 0x976E, 0x9773, 0x9795, 0x97AE,
+ 0x97BA, 0x97C1, 0x97C9, 0x97DE, 0x97DB, 0x97F4, 0xFA69, 0x980A,
+ 0x981E, 0x982B, 0x9830, 0xFA6A, 0x9852, 0x9853, 0x9856,
+};
+static const unsigned short euc_to_utf8_FE_x0213[] = {
+ 0x9857, 0x9859, 0x985A, 0xF9D0, 0x9865, 0x986C, 0x98BA,
+ 0x98C8, 0x98E7, 0x9958, 0x999E, 0x9A02, 0x9A03, 0x9A24, 0x9A2D,
+ 0x9A2E, 0x9A38, 0x9A4A, 0x9A4E, 0x9A52, 0x9AB6, 0x9AC1, 0x9AC3,
+ 0x9ACE, 0x9AD6, 0x9AF9, 0x9B02, 0x9B08, 0x9B20, 0x4C17, 0x9B2D,
+ 0x9B5E, 0x9B79, 0x9B66, 0x9B72, 0x9B75, 0x9B84, 0x9B8A, 0x9B8F,
+ 0x9B9E, 0x9BA7, 0x9BC1, 0x9BCE, 0x9BE5, 0x9BF8, 0x9BFD, 0x9C00,
+ 0x9C23, 0x9C41, 0x9C4F, 0x9C50, 0x9C53, 0x9C63, 0x9C65, 0x9C77,
+ 0x9D1D, 0x9D1E, 0x9D43, 0x9D47, 0x9D52, 0x9D63, 0x9D70, 0x9D7C,
+ 0x9D8A, 0x9D96, 0x9DC0, 0x9DAC, 0x9DBC, 0x9DD7, 0xD868 /*0xDD90*/, 0x9DE7,
+ 0x9E07, 0x9E15, 0x9E7C, 0x9E9E, 0x9EA4, 0x9EAC, 0x9EAF, 0x9EB4,
+ 0x9EB5, 0x9EC3, 0x9ED1, 0x9F10, 0x9F39, 0x9F57, 0x9F90, 0x9F94,
+ 0x9F97, 0x9FA2, 0x59F8, 0x5C5B, 0x5E77, 0x7626, 0x7E6B,
+};
+
+static const unsigned short euc_to_utf8_8FA1_x0213[] = {
+ 0xD840 /*0xDC89*/, 0x4E02, 0x4E0F, 0x4E12, 0x4E29, 0x4E2B, 0x4E2E,
+ 0x4E40, 0x4E47, 0x4E48, 0xD840 /*0xDCA2*/, 0x4E51, 0x3406, 0xD840 /*0xDCA4*/, 0x4E5A,
+ 0x4E69, 0x4E9D, 0x342C, 0x342E, 0x4EB9, 0x4EBB, 0xD840 /*0xDDA2*/, 0x4EBC,
+ 0x4EC3, 0x4EC8, 0x4ED0, 0x4EEB, 0x4EDA, 0x4EF1, 0x4EF5, 0x4F00,
+ 0x4F16, 0x4F64, 0x4F37, 0x4F3E, 0x4F54, 0x4F58, 0xD840 /*0xDE13*/, 0x4F77,
+ 0x4F78, 0x4F7A, 0x4F7D, 0x4F82, 0x4F85, 0x4F92, 0x4F9A, 0x4FE6,
+ 0x4FB2, 0x4FBE, 0x4FC5, 0x4FCB, 0x4FCF, 0x4FD2, 0x346A, 0x4FF2,
+ 0x5000, 0x5010, 0x5013, 0x501C, 0x501E, 0x5022, 0x3468, 0x5042,
+ 0x5046, 0x504E, 0x5053, 0x5057, 0x5063, 0x5066, 0x506A, 0x5070,
+ 0x50A3, 0x5088, 0x5092, 0x5093, 0x5095, 0x5096, 0x509C, 0x50AA,
+ 0xD840 /*0xDF2B*/, 0x50B1, 0x50BA, 0x50BB, 0x50C4, 0x50C7, 0x50F3, 0xD840 /*0xDF81*/,
+ 0x50CE, 0xD840 /*0xDF71*/, 0x50D4, 0x50D9, 0x50E1, 0x50E9, 0x3492,
+};
+static const unsigned short euc_to_utf8_8FA3_x0213[] = {
+ 0x5108, 0xD840 /*0xDFF9*/, 0x5117, 0x511B, 0xD841 /*0xDC4A*/, 0x5160, 0xD841 /*0xDD09*/,
+ 0x5173, 0x5183, 0x518B, 0x34BC, 0x5198, 0x51A3, 0x51AD, 0x34C7,
+ 0x51BC, 0xD841 /*0xDDD6*/, 0xD841 /*0xDE28*/, 0x51F3, 0x51F4, 0x5202, 0x5212, 0x5216,
+ 0xD841 /*0xDF4F*/, 0x5255, 0x525C, 0x526C, 0x5277, 0x5284, 0x5282, 0xD842 /*0xDC07*/,
+ 0x5298, 0xD842 /*0xDC3A*/, 0x52A4, 0x52A6, 0x52AF, 0x52BA, 0x52BB, 0x52CA,
+ 0x351F, 0x52D1, 0xD842 /*0xDCB9*/, 0x52F7, 0x530A, 0x530B, 0x5324, 0x5335,
+ 0x533E, 0x5342, 0xD842 /*0xDD7C*/, 0xD842 /*0xDD9D*/, 0x5367, 0x536C, 0x537A, 0x53A4,
+ 0x53B4, 0xD842 /*0xDED3*/, 0x53B7, 0x53C0, 0xD842 /*0xDF1D*/, 0x355D, 0x355E, 0x53D5,
+ 0x53DA, 0x3563, 0x53F4, 0x53F5, 0x5455, 0x5424, 0x5428, 0x356E,
+ 0x5443, 0x5462, 0x5466, 0x546C, 0x548A, 0x548D, 0x5495, 0x54A0,
+ 0x54A6, 0x54AD, 0x54AE, 0x54B7, 0x54BA, 0x54BF, 0x54C3, 0xD843 /*0xDD45*/,
+ 0x54EC, 0x54EF, 0x54F1, 0x54F3, 0x5500, 0x5501, 0x5509,
+};
+static const unsigned short euc_to_utf8_8FA4_x0213[] = {
+ 0x553C, 0x5541, 0x35A6, 0x5547, 0x554A, 0x35A8, 0x5560,
+ 0x5561, 0x5564, 0xD843 /*0xDDE1*/, 0x557D, 0x5582, 0x5588, 0x5591, 0x35C5,
+ 0x55D2, 0xD843 /*0xDE95*/, 0xD843 /*0xDE6D*/, 0x55BF, 0x55C9, 0x55CC, 0x55D1, 0x55DD,
+ 0x35DA, 0x55E2, 0xD843 /*0xDE64*/, 0x55E9, 0x5628, 0xD843 /*0xDF5F*/, 0x5607, 0x5610,
+ 0x5630, 0x5637, 0x35F4, 0x563D, 0x563F, 0x5640, 0x5647, 0x565E,
+ 0x5660, 0x566D, 0x3605, 0x5688, 0x568C, 0x5695, 0x569A, 0x569D,
+ 0x56A8, 0x56AD, 0x56B2, 0x56C5, 0x56CD, 0x56DF, 0x56E8, 0x56F6,
+ 0x56F7, 0xD844 /*0xDE01*/, 0x5715, 0x5723, 0xD844 /*0xDE55*/, 0x5729, 0xD844 /*0xDE7B*/, 0x5745,
+ 0x5746, 0x574C, 0x574D, 0xD844 /*0xDE74*/, 0x5768, 0x576F, 0x5773, 0x5774,
+ 0x5775, 0x577B, 0xD844 /*0xDEE4*/, 0xD844 /*0xDED7*/, 0x57AC, 0x579A, 0x579D, 0x579E,
+ 0x57A8, 0x57D7, 0xD844 /*0xDEFD*/, 0x57CC, 0xD844 /*0xDF36*/, 0xD844 /*0xDF44*/, 0x57DE, 0x57E6,
+ 0x57F0, 0x364A, 0x57F8, 0x57FB, 0x57FD, 0x5804, 0x581E,
+};
+static const unsigned short euc_to_utf8_8FA5_x0213[] = {
+ 0x5820, 0x5827, 0x5832, 0x5839, 0xD844 /*0xDFC4*/, 0x5849, 0x584C,
+ 0x5867, 0x588A, 0x588B, 0x588D, 0x588F, 0x5890, 0x5894, 0x589D,
+ 0x58AA, 0x58B1, 0xD845 /*0xDC6D*/, 0x58C3, 0x58CD, 0x58E2, 0x58F3, 0x58F4,
+ 0x5905, 0x5906, 0x590B, 0x590D, 0x5914, 0x5924, 0xD845 /*0xDDD7*/, 0x3691,
+ 0x593D, 0x3699, 0x5946, 0x3696, 0xD85B /*0xDC29*/, 0x595B, 0x595F, 0xD845 /*0xDE47*/,
+ 0x5975, 0x5976, 0x597C, 0x599F, 0x59AE, 0x59BC, 0x59C8, 0x59CD,
+ 0x59DE, 0x59E3, 0x59E4, 0x59E7, 0x59EE, 0xD845 /*0xDF06*/, 0xD845 /*0xDF42*/, 0x36CF,
+ 0x5A0C, 0x5A0D, 0x5A17, 0x5A27, 0x5A2D, 0x5A55, 0x5A65, 0x5A7A,
+ 0x5A8B, 0x5A9C, 0x5A9F, 0x5AA0, 0x5AA2, 0x5AB1, 0x5AB3, 0x5AB5,
+ 0x5ABA, 0x5ABF, 0x5ADA, 0x5ADC, 0x5AE0, 0x5AE5, 0x5AF0, 0x5AEE,
+ 0x5AF5, 0x5B00, 0x5B08, 0x5B17, 0x5B34, 0x5B2D, 0x5B4C, 0x5B52,
+ 0x5B68, 0x5B6F, 0x5B7C, 0x5B7F, 0x5B81, 0x5B84, 0xD846 /*0xDDC3*/,
+};
+static const unsigned short euc_to_utf8_8FA8_x0213[] = {
+ 0x5B96, 0x5BAC, 0x3761, 0x5BC0, 0x3762, 0x5BCE, 0x5BD6,
+ 0x376C, 0x376B, 0x5BF1, 0x5BFD, 0x3775, 0x5C03, 0x5C29, 0x5C30,
+ 0xD847 /*0xDC56*/, 0x5C5F, 0x5C63, 0x5C67, 0x5C68, 0x5C69, 0x5C70, 0xD847 /*0xDD2D*/,
+ 0xD847 /*0xDD45*/, 0x5C7C, 0xD847 /*0xDD78*/, 0xD847 /*0xDD62*/, 0x5C88, 0x5C8A, 0x37C1, 0xD847 /*0xDDA1*/,
+ 0xD847 /*0xDD9C*/, 0x5CA0, 0x5CA2, 0x5CA6, 0x5CA7, 0xD847 /*0xDD92*/, 0x5CAD, 0x5CB5,
+ 0xD847 /*0xDDB7*/, 0x5CC9, 0xD847 /*0xDDE0*/, 0xD847 /*0xDE33*/, 0x5D06, 0x5D10, 0x5D2B, 0x5D1D,
+ 0x5D20, 0x5D24, 0x5D26, 0x5D31, 0x5D39, 0x5D42, 0x37E8, 0x5D61,
+ 0x5D6A, 0x37F4, 0x5D70, 0xD847 /*0xDF1E*/, 0x37FD, 0x5D88, 0x3800, 0x5D92,
+ 0x5D94, 0x5D97, 0x5D99, 0x5DB0, 0x5DB2, 0x5DB4, 0xD847 /*0xDF76*/, 0x5DB9,
+ 0x5DD1, 0x5DD7, 0x5DD8, 0x5DE0, 0xD847 /*0xDFFA*/, 0x5DE4, 0x5DE9, 0x382F,
+ 0x5E00, 0x3836, 0x5E12, 0x5E15, 0x3840, 0x5E1F, 0x5E2E, 0x5E3E,
+ 0x5E49, 0x385C, 0x5E56, 0x3861, 0x5E6B, 0x5E6C, 0x5E6D,
+};
+static const unsigned short euc_to_utf8_8FAC_x0213[] = {
+ 0x5E6E, 0xD848 /*0xDD7B*/, 0x5EA5, 0x5EAA, 0x5EAC, 0x5EB9, 0x5EBF,
+ 0x5EC6, 0x5ED2, 0x5ED9, 0xD848 /*0xDF1E*/, 0x5EFD, 0x5F08, 0x5F0E, 0x5F1C,
+ 0xD848 /*0xDFAD*/, 0x5F1E, 0x5F47, 0x5F63, 0x5F72, 0x5F7E, 0x5F8F, 0x5FA2,
+ 0x5FA4, 0x5FB8, 0x5FC4, 0x38FA, 0x5FC7, 0x5FCB, 0x5FD2, 0x5FD3,
+ 0x5FD4, 0x5FE2, 0x5FEE, 0x5FEF, 0x5FF3, 0x5FFC, 0x3917, 0x6017,
+ 0x6022, 0x6024, 0x391A, 0x604C, 0x607F, 0x608A, 0x6095, 0x60A8,
+ 0xD849 /*0xDEF3*/, 0x60B0, 0x60B1, 0x60BE, 0x60C8, 0x60D9, 0x60DB, 0x60EE,
+ 0x60F2, 0x60F5, 0x6110, 0x6112, 0x6113, 0x6119, 0x611E, 0x613A,
+ 0x396F, 0x6141, 0x6146, 0x6160, 0x617C, 0xD84A /*0xDC5B*/, 0x6192, 0x6193,
+ 0x6197, 0x6198, 0x61A5, 0x61A8, 0x61AD, 0xD84A /*0xDCAB*/, 0x61D5, 0x61DD,
+ 0x61DF, 0x61F5, 0xD84A /*0xDD8F*/, 0x6215, 0x6223, 0x6229, 0x6246, 0x624C,
+ 0x6251, 0x6252, 0x6261, 0x6264, 0x627B, 0x626D, 0x6273,
+};
+static const unsigned short euc_to_utf8_8FAD_x0213[] = {
+ 0x6299, 0x62A6, 0x62D5, 0xD84A /*0xDEB8*/, 0x62FD, 0x6303, 0x630D,
+ 0x6310, 0xD84A /*0xDF4F*/, 0xD84A /*0xDF50*/, 0x6332, 0x6335, 0x633B, 0x633C, 0x6341,
+ 0x6344, 0x634E, 0xD84A /*0xDF46*/, 0x6359, 0xD84B /*0xDC1D*/, 0xD84A /*0xDFA6*/, 0x636C, 0x6384,
+ 0x6399, 0xD84B /*0xDC24*/, 0x6394, 0x63BD, 0x63F7, 0x63D4, 0x63D5, 0x63DC,
+ 0x63E0, 0x63EB, 0x63EC, 0x63F2, 0x6409, 0x641E, 0x6425, 0x6429,
+ 0x642F, 0x645A, 0x645B, 0x645D, 0x6473, 0x647D, 0x6487, 0x6491,
+ 0x649D, 0x649F, 0x64CB, 0x64CC, 0x64D5, 0x64D7, 0xD84B /*0xDDE1*/, 0x64E4,
+ 0x64E5, 0x64FF, 0x6504, 0x3A6E, 0x650F, 0x6514, 0x6516, 0x3A73,
+ 0x651E, 0x6532, 0x6544, 0x6554, 0x656B, 0x657A, 0x6581, 0x6584,
+ 0x6585, 0x658A, 0x65B2, 0x65B5, 0x65B8, 0x65BF, 0x65C2, 0x65C9,
+ 0x65D4, 0x3AD6, 0x65F2, 0x65F9, 0x65FC, 0x6604, 0x6608, 0x6621,
+ 0x662A, 0x6645, 0x6651, 0x664E, 0x3AEA, 0xD84C /*0xDDC3*/, 0x6657,
+};
+static const unsigned short euc_to_utf8_8FAE_x0213[] = {
+ 0x665B, 0x6663, 0xD84C /*0xDDF5*/, 0xD84C /*0xDDB6*/, 0x666A, 0x666B, 0x666C,
+ 0x666D, 0x667B, 0x6680, 0x6690, 0x6692, 0x6699, 0x3B0E, 0x66AD,
+ 0x66B1, 0x66B5, 0x3B1A, 0x66BF, 0x3B1C, 0x66EC, 0x3AD7, 0x6701,
+ 0x6705, 0x6712, 0xD84C /*0xDF72*/, 0x6719, 0xD84C /*0xDFD3*/, 0xD84C /*0xDFD2*/, 0x674C, 0x674D,
+ 0x6754, 0x675D, 0xD84C /*0xDFD0*/, 0xD84C /*0xDFE4*/, 0xD84C /*0xDFD5*/, 0x6774, 0x6776, 0xD84C /*0xDFDA*/,
+ 0x6792, 0xD84C /*0xDFDF*/, 0x8363, 0x6810, 0x67B0, 0x67B2, 0x67C3, 0x67C8,
+ 0x67D2, 0x67D9, 0x67DB, 0x67F0, 0x67F7, 0xD84D /*0xDC4A*/, 0xD84D /*0xDC51*/, 0xD84D /*0xDC4B*/,
+ 0x6818, 0x681F, 0x682D, 0xD84D /*0xDC65*/, 0x6833, 0x683B, 0x683E, 0x6844,
+ 0x6845, 0x6849, 0x684C, 0x6855, 0x6857, 0x3B77, 0x686B, 0x686E,
+ 0x687A, 0x687C, 0x6882, 0x6890, 0x6896, 0x3B6D, 0x6898, 0x6899,
+ 0x689A, 0x689C, 0x68AA, 0x68AB, 0x68B4, 0x68BB, 0x68FB, 0xD84D /*0xDCE4*/,
+ 0xD84D /*0xDD5A*/, 0xFA13, 0x68C3, 0x68C5, 0x68CC, 0x68CF, 0x68D6,
+};
+static const unsigned short euc_to_utf8_8FAF_x0213[] = {
+ 0x68D9, 0x68E4, 0x68E5, 0x68EC, 0x68F7, 0x6903, 0x6907,
+ 0x3B87, 0x3B88, 0xD84D /*0xDD94*/, 0x693B, 0x3B8D, 0x6946, 0x6969, 0x696C,
+ 0x6972, 0x697A, 0x697F, 0x6992, 0x3BA4, 0x6996, 0x6998, 0x69A6,
+ 0x69B0, 0x69B7, 0x69BA, 0x69BC, 0x69C0, 0x69D1, 0x69D6, 0xD84D /*0xDE39*/,
+ 0xD84D /*0xDE47*/, 0x6A30, 0xD84D /*0xDE38*/, 0xD84D /*0xDE3A*/, 0x69E3, 0x69EE, 0x69EF, 0x69F3,
+ 0x3BCD, 0x69F4, 0x69FE, 0x6A11, 0x6A1A, 0x6A1D, 0xD84D /*0xDF1C*/, 0x6A32,
+ 0x6A33, 0x6A34, 0x6A3F, 0x6A46, 0x6A49, 0x6A7A, 0x6A4E, 0x6A52,
+ 0x6A64, 0xD84D /*0xDF0C*/, 0x6A7E, 0x6A83, 0x6A8B, 0x3BF0, 0x6A91, 0x6A9F,
+ 0x6AA1, 0xD84D /*0xDF64*/, 0x6AAB, 0x6ABD, 0x6AC6, 0x6AD4, 0x6AD0, 0x6ADC,
+ 0x6ADD, 0xD84D /*0xDFFF*/, 0xD84D /*0xDFE7*/, 0x6AEC, 0x6AF1, 0x6AF2, 0x6AF3, 0x6AFD,
+ 0xD84E /*0xDC24*/, 0x6B0B, 0x6B0F, 0x6B10, 0x6B11, 0xD84E /*0xDC3D*/, 0x6B17, 0x3C26,
+ 0x6B2F, 0x6B4A, 0x6B58, 0x6B6C, 0x6B75, 0x6B7A, 0x6B81,
+};
+static const unsigned short euc_to_utf8_8FEE_x0213[] = {
+ 0x6B9B, 0x6BAE, 0xD84E /*0xDE98*/, 0x6BBD, 0x6BBE, 0x6BC7, 0x6BC8,
+ 0x6BC9, 0x6BDA, 0x6BE6, 0x6BE7, 0x6BEE, 0x6BF1, 0x6C02, 0x6C0A,
+ 0x6C0E, 0x6C35, 0x6C36, 0x6C3A, 0xD84F /*0xDC7F*/, 0x6C3F, 0x6C4D, 0x6C5B,
+ 0x6C6D, 0x6C84, 0x6C89, 0x3CC3, 0x6C94, 0x6C95, 0x6C97, 0x6CAD,
+ 0x6CC2, 0x6CD0, 0x3CD2, 0x6CD6, 0x6CDA, 0x6CDC, 0x6CE9, 0x6CEC,
+ 0x6CED, 0xD84F /*0xDD00*/, 0x6D00, 0x6D0A, 0x6D24, 0x6D26, 0x6D27, 0x6C67,
+ 0x6D2F, 0x6D3C, 0x6D5B, 0x6D5E, 0x6D60, 0x6D70, 0x6D80, 0x6D81,
+ 0x6D8A, 0x6D8D, 0x6D91, 0x6D98, 0xD84F /*0xDD40*/, 0x6E17, 0xD84F /*0xDDFA*/, 0xD84F /*0xDDF9*/,
+ 0xD84F /*0xDDD3*/, 0x6DAB, 0x6DAE, 0x6DB4, 0x6DC2, 0x6D34, 0x6DC8, 0x6DCE,
+ 0x6DCF, 0x6DD0, 0x6DDF, 0x6DE9, 0x6DF6, 0x6E36, 0x6E1E, 0x6E22,
+ 0x6E27, 0x3D11, 0x6E32, 0x6E3C, 0x6E48, 0x6E49, 0x6E4B, 0x6E4C,
+ 0x6E4F, 0x6E51, 0x6E53, 0x6E54, 0x6E57, 0x6E63, 0x3D1E,
+};
+static const unsigned short euc_to_utf8_8FEF_x0213[] = {
+ 0x6E93, 0x6EA7, 0x6EB4, 0x6EBF, 0x6EC3, 0x6ECA, 0x6ED9,
+ 0x6F35, 0x6EEB, 0x6EF9, 0x6EFB, 0x6F0A, 0x6F0C, 0x6F18, 0x6F25,
+ 0x6F36, 0x6F3C, 0xD84F /*0xDF7E*/, 0x6F52, 0x6F57, 0x6F5A, 0x6F60, 0x6F68,
+ 0x6F98, 0x6F7D, 0x6F90, 0x6F96, 0x6FBE, 0x6F9F, 0x6FA5, 0x6FAF,
+ 0x3D64, 0x6FB5, 0x6FC8, 0x6FC9, 0x6FDA, 0x6FDE, 0x6FE9, 0xD850 /*0xDC96*/,
+ 0x6FFC, 0x7000, 0x7007, 0x700A, 0x7023, 0xD850 /*0xDD03*/, 0x7039, 0x703A,
+ 0x703C, 0x7043, 0x7047, 0x704B, 0x3D9A, 0x7054, 0x7065, 0x7069,
+ 0x706C, 0x706E, 0x7076, 0x707E, 0x7081, 0x7086, 0x7095, 0x7097,
+ 0x70BB, 0xD850 /*0xDDC6*/, 0x709F, 0x70B1, 0xD850 /*0xDDFE*/, 0x70EC, 0x70CA, 0x70D1,
+ 0x70D3, 0x70DC, 0x7103, 0x7104, 0x7106, 0x7107, 0x7108, 0x710C,
+ 0x3DC0, 0x712F, 0x7131, 0x7150, 0x714A, 0x7153, 0x715E, 0x3DD4,
+ 0x7196, 0x7180, 0x719B, 0x71A0, 0x71A2, 0x71AE, 0x71AF,
+};
+static const unsigned short euc_to_utf8_8FF0_x0213[] = {
+ 0x71B3, 0xD850 /*0xDFBC*/, 0x71CB, 0x71D3, 0x71D9, 0x71DC, 0x7207,
+ 0x3E05, 0xFA49, 0x722B, 0x7234, 0x7238, 0x7239, 0x4E2C, 0x7242,
+ 0x7253, 0x7257, 0x7263, 0xD851 /*0xDE29*/, 0x726E, 0x726F, 0x7278, 0x727F,
+ 0x728E, 0xD851 /*0xDEA5*/, 0x72AD, 0x72AE, 0x72B0, 0x72B1, 0x72C1, 0x3E60,
+ 0x72CC, 0x3E66, 0x3E68, 0x72F3, 0x72FA, 0x7307, 0x7312, 0x7318,
+ 0x7319, 0x3E83, 0x7339, 0x732C, 0x7331, 0x7333, 0x733D, 0x7352,
+ 0x3E94, 0x736B, 0x736C, 0xD852 /*0xDC96*/, 0x736E, 0x736F, 0x7371, 0x7377,
+ 0x7381, 0x7385, 0x738A, 0x7394, 0x7398, 0x739C, 0x739E, 0x73A5,
+ 0x73A8, 0x73B5, 0x73B7, 0x73B9, 0x73BC, 0x73BF, 0x73C5, 0x73CB,
+ 0x73E1, 0x73E7, 0x73F9, 0x7413, 0x73FA, 0x7401, 0x7424, 0x7431,
+ 0x7439, 0x7453, 0x7440, 0x7443, 0x744D, 0x7452, 0x745D, 0x7471,
+ 0x7481, 0x7485, 0x7488, 0xD852 /*0xDE4D*/, 0x7492, 0x7497, 0x7499,
+};
+static const unsigned short euc_to_utf8_8FF1_x0213[] = {
+ 0x74A0, 0x74A1, 0x74A5, 0x74AA, 0x74AB, 0x74B9, 0x74BB,
+ 0x74BA, 0x74D6, 0x74D8, 0x74DE, 0x74EF, 0x74EB, 0xD852 /*0xDF56*/, 0x74FA,
+ 0xD852 /*0xDF6F*/, 0x7520, 0x7524, 0x752A, 0x3F57, 0xD853 /*0xDC16*/, 0x753D, 0x753E,
+ 0x7540, 0x7548, 0x754E, 0x7550, 0x7552, 0x756C, 0x7572, 0x7571,
+ 0x757A, 0x757D, 0x757E, 0x7581, 0xD853 /*0xDD14*/, 0x758C, 0x3F75, 0x75A2,
+ 0x3F77, 0x75B0, 0x75B7, 0x75BF, 0x75C0, 0x75C6, 0x75CF, 0x75D3,
+ 0x75DD, 0x75DF, 0x75E0, 0x75E7, 0x75EC, 0x75EE, 0x75F1, 0x75F9,
+ 0x7603, 0x7618, 0x7607, 0x760F, 0x3FAE, 0xD853 /*0xDE0E*/, 0x7613, 0x761B,
+ 0x761C, 0xD853 /*0xDE37*/, 0x7625, 0x7628, 0x763C, 0x7633, 0xD853 /*0xDE6A*/, 0x3FC9,
+ 0x7641, 0xD853 /*0xDE8B*/, 0x7649, 0x7655, 0x3FD7, 0x766E, 0x7695, 0x769C,
+ 0x76A1, 0x76A0, 0x76A7, 0x76A8, 0x76AF, 0xD854 /*0xDC4A*/, 0x76C9, 0xD854 /*0xDC55*/,
+ 0x76E8, 0x76EC, 0xD854 /*0xDD22*/, 0x7717, 0x771A, 0x772D, 0x7735,
+};
+static const unsigned short euc_to_utf8_8FF2_x0213[] = {
+ 0xD854 /*0xDDA9*/, 0x4039, 0xD854 /*0xDDE5*/, 0xD854 /*0xDDCD*/, 0x7758, 0x7760, 0x776A,
+ 0xD854 /*0xDE1E*/, 0x7772, 0x777C, 0x777D, 0xD854 /*0xDE4C*/, 0x4058, 0x779A, 0x779F,
+ 0x77A2, 0x77A4, 0x77A9, 0x77DE, 0x77DF, 0x77E4, 0x77E6, 0x77EA,
+ 0x77EC, 0x4093, 0x77F0, 0x77F4, 0x77FB, 0xD855 /*0xDC2E*/, 0x7805, 0x7806,
+ 0x7809, 0x780D, 0x7819, 0x7821, 0x782C, 0x7847, 0x7864, 0x786A,
+ 0xD855 /*0xDCD9*/, 0x788A, 0x7894, 0x78A4, 0x789D, 0x789E, 0x789F, 0x78BB,
+ 0x78C8, 0x78CC, 0x78CE, 0x78D5, 0x78E0, 0x78E1, 0x78E6, 0x78F9,
+ 0x78FA, 0x78FB, 0x78FE, 0xD855 /*0xDDA7*/, 0x7910, 0x791B, 0x7930, 0x7925,
+ 0x793B, 0x794A, 0x7958, 0x795B, 0x4105, 0x7967, 0x7972, 0x7994,
+ 0x7995, 0x7996, 0x799B, 0x79A1, 0x79A9, 0x79B4, 0x79BB, 0x79C2,
+ 0x79C7, 0x79CC, 0x79CD, 0x79D6, 0x4148, 0xD855 /*0xDFA9*/, 0xD855 /*0xDFB4*/, 0x414F,
+ 0x7A0A, 0x7A11, 0x7A15, 0x7A1B, 0x7A1E, 0x4163, 0x7A2D,
+};
+static const unsigned short euc_to_utf8_8FF3_x0213[] = {
+ 0x7A38, 0x7A47, 0x7A4C, 0x7A56, 0x7A59, 0x7A5C, 0x7A5F,
+ 0x7A60, 0x7A67, 0x7A6A, 0x7A75, 0x7A78, 0x7A82, 0x7A8A, 0x7A90,
+ 0x7AA3, 0x7AAC, 0xD856 /*0xDDD4*/, 0x41B4, 0x7AB9, 0x7ABC, 0x7ABE, 0x41BF,
+ 0x7ACC, 0x7AD1, 0x7AE7, 0x7AE8, 0x7AF4, 0xD856 /*0xDEE4*/, 0xD856 /*0xDEE3*/, 0x7B07,
+ 0xD856 /*0xDEF1*/, 0x7B3D, 0x7B27, 0x7B2A, 0x7B2E, 0x7B2F, 0x7B31, 0x41E6,
+ 0x41F3, 0x7B7F, 0x7B41, 0x41EE, 0x7B55, 0x7B79, 0x7B64, 0x7B66,
+ 0x7B69, 0x7B73, 0xD856 /*0xDFB2*/, 0x4207, 0x7B90, 0x7B91, 0x7B9B, 0x420E,
+ 0x7BAF, 0x7BB5, 0x7BBC, 0x7BC5, 0x7BCA, 0xD857 /*0xDC4B*/, 0xD857 /*0xDC64*/, 0x7BD4,
+ 0x7BD6, 0x7BDA, 0x7BEA, 0x7BF0, 0x7C03, 0x7C0B, 0x7C0E, 0x7C0F,
+ 0x7C26, 0x7C45, 0x7C4A, 0x7C51, 0x7C57, 0x7C5E, 0x7C61, 0x7C69,
+ 0x7C6E, 0x7C6F, 0x7C70, 0xD857 /*0xDE2E*/, 0xD857 /*0xDE56*/, 0xD857 /*0xDE65*/, 0x7CA6, 0xD857 /*0xDE62*/,
+ 0x7CB6, 0x7CB7, 0x7CBF, 0xD857 /*0xDED8*/, 0x7CC4, 0xD857 /*0xDEC2*/, 0x7CC8,
+};
+static const unsigned short euc_to_utf8_8FF4_x0213[] = {
+ 0x7CCD, 0xD857 /*0xDEE8*/, 0x7CD7, 0xD857 /*0xDF23*/, 0x7CE6, 0x7CEB, 0xD857 /*0xDF5C*/,
+ 0x7CF5, 0x7D03, 0x7D09, 0x42C6, 0x7D12, 0x7D1E, 0xD857 /*0xDFE0*/, 0xD857 /*0xDFD4*/,
+ 0x7D3D, 0x7D3E, 0x7D40, 0x7D47, 0xD858 /*0xDC0C*/, 0xD857 /*0xDFFB*/, 0x42D6, 0x7D59,
+ 0x7D5A, 0x7D6A, 0x7D70, 0x42DD, 0x7D7F, 0xD858 /*0xDC17*/, 0x7D86, 0x7D88,
+ 0x7D8C, 0x7D97, 0xD858 /*0xDC60*/, 0x7D9D, 0x7DA7, 0x7DAA, 0x7DB6, 0x7DB7,
+ 0x7DC0, 0x7DD7, 0x7DD9, 0x7DE6, 0x7DF1, 0x7DF9, 0x4302, 0xD858 /*0xDCED*/,
+ 0xFA58, 0x7E10, 0x7E17, 0x7E1D, 0x7E20, 0x7E27, 0x7E2C, 0x7E45,
+ 0x7E73, 0x7E75, 0x7E7E, 0x7E86, 0x7E87, 0x432B, 0x7E91, 0x7E98,
+ 0x7E9A, 0x4343, 0x7F3C, 0x7F3B, 0x7F3E, 0x7F43, 0x7F44, 0x7F4F,
+ 0x34C1, 0xD858 /*0xDE70*/, 0x7F52, 0xD858 /*0xDE86*/, 0x7F61, 0x7F63, 0x7F64, 0x7F6D,
+ 0x7F7D, 0x7F7E, 0xD858 /*0xDF4C*/, 0x7F90, 0x517B, 0xD84F /*0xDD0E*/, 0x7F96, 0x7F9C,
+ 0x7FAD, 0xD859 /*0xDC02*/, 0x7FC3, 0x7FCF, 0x7FE3, 0x7FE5, 0x7FEF,
+};
+static const unsigned short euc_to_utf8_8FF5_x0213[] = {
+ 0x7FF2, 0x8002, 0x800A, 0x8008, 0x800E, 0x8011, 0x8016,
+ 0x8024, 0x802C, 0x8030, 0x8043, 0x8066, 0x8071, 0x8075, 0x807B,
+ 0x8099, 0x809C, 0x80A4, 0x80A7, 0x80B8, 0xD859 /*0xDE7E*/, 0x80C5, 0x80D5,
+ 0x80D8, 0x80E6, 0xD859 /*0xDEB0*/, 0x810D, 0x80F5, 0x80FB, 0x43EE, 0x8135,
+ 0x8116, 0x811E, 0x43F0, 0x8124, 0x8127, 0x812C, 0xD859 /*0xDF1D*/, 0x813D,
+ 0x4408, 0x8169, 0x4417, 0x8181, 0x441C, 0x8184, 0x8185, 0x4422,
+ 0x8198, 0x81B2, 0x81C1, 0x81C3, 0x81D6, 0x81DB, 0xD85A /*0xDCDD*/, 0x81E4,
+ 0xD85A /*0xDCEA*/, 0x81EC, 0xD85A /*0xDD51*/, 0x81FD, 0x81FF, 0xD85A /*0xDD6F*/, 0x8204, 0xD85A /*0xDDDD*/,
+ 0x8219, 0x8221, 0x8222, 0xD85A /*0xDE1E*/, 0x8232, 0x8234, 0x823C, 0x8246,
+ 0x8249, 0x8245, 0xD85A /*0xDE58*/, 0x824B, 0x4476, 0x824F, 0x447A, 0x8257,
+ 0xD85A /*0xDE8C*/, 0x825C, 0x8263, 0xD85A /*0xDEB7*/, 0xFA5D, 0xFA5E, 0x8279, 0x4491,
+ 0x827D, 0x827F, 0x8283, 0x828A, 0x8293, 0x82A7, 0x82A8,
+};
+static const unsigned short euc_to_utf8_8FF6_x0213[] = {
+ 0x82B2, 0x82B4, 0x82BA, 0x82BC, 0x82E2, 0x82E8, 0x82F7,
+ 0x8307, 0x8308, 0x830C, 0x8354, 0x831B, 0x831D, 0x8330, 0x833C,
+ 0x8344, 0x8357, 0x44BE, 0x837F, 0x44D4, 0x44B3, 0x838D, 0x8394,
+ 0x8395, 0x839B, 0x839D, 0x83C9, 0x83D0, 0x83D4, 0x83DD, 0x83E5,
+ 0x83F9, 0x840F, 0x8411, 0x8415, 0xD85B /*0xDC73*/, 0x8417, 0x8439, 0x844A,
+ 0x844F, 0x8451, 0x8452, 0x8459, 0x845A, 0x845C, 0xD85B /*0xDCDD*/, 0x8465,
+ 0x8476, 0x8478, 0x847C, 0x8481, 0x450D, 0x84DC, 0x8497, 0x84A6,
+ 0x84BE, 0x4508, 0x84CE, 0x84CF, 0x84D3, 0xD85B /*0xDE65*/, 0x84E7, 0x84EA,
+ 0x84EF, 0x84F0, 0x84F1, 0x84FA, 0x84FD, 0x850C, 0x851B, 0x8524,
+ 0x8525, 0x852B, 0x8534, 0x854F, 0x856F, 0x4525, 0x4543, 0x853E,
+ 0x8551, 0x8553, 0x855E, 0x8561, 0x8562, 0xD85B /*0xDF94*/, 0x857B, 0x857D,
+ 0x857F, 0x8581, 0x8586, 0x8593, 0x859D, 0x859F, 0xD85B /*0xDFF8*/,
+};
+static const unsigned short euc_to_utf8_8FF7_x0213[] = {
+ 0xD85B /*0xDFF6*/, 0xD85B /*0xDFF7*/, 0x85B7, 0x85BC, 0x85C7, 0x85CA, 0x85D8,
+ 0x85D9, 0x85DF, 0x85E1, 0x85E6, 0x85F6, 0x8600, 0x8611, 0x861E,
+ 0x8621, 0x8624, 0x8627, 0xD85C /*0xDD0D*/, 0x8639, 0x863C, 0xD85C /*0xDD39*/, 0x8640,
+ 0xFA20, 0x8653, 0x8656, 0x866F, 0x8677, 0x867A, 0x8687, 0x8689,
+ 0x868D, 0x8691, 0x869C, 0x869D, 0x86A8, 0xFA21, 0x86B1, 0x86B3,
+ 0x86C1, 0x86C3, 0x86D1, 0x86D5, 0x86D7, 0x86E3, 0x86E6, 0x45B8,
+ 0x8705, 0x8707, 0x870E, 0x8710, 0x8713, 0x8719, 0x871F, 0x8721,
+ 0x8723, 0x8731, 0x873A, 0x873E, 0x8740, 0x8743, 0x8751, 0x8758,
+ 0x8764, 0x8765, 0x8772, 0x877C, 0xD85C /*0xDFDB*/, 0xD85C /*0xDFDA*/, 0x87A7, 0x8789,
+ 0x878B, 0x8793, 0x87A0, 0xD85C /*0xDFFE*/, 0x45E5, 0x87BE, 0xD85D /*0xDC10*/, 0x87C1,
+ 0x87CE, 0x87F5, 0x87DF, 0xD85D /*0xDC49*/, 0x87E3, 0x87E5, 0x87E6, 0x87EA,
+ 0x87EB, 0x87ED, 0x8801, 0x8803, 0x880B, 0x8813, 0x8828,
+};
+static const unsigned short euc_to_utf8_8FF8_x0213[] = {
+ 0x882E, 0x8832, 0x883C, 0x460F, 0x884A, 0x8858, 0x885F,
+ 0x8864, 0xD85D /*0xDE15*/, 0xD85D /*0xDE14*/, 0x8869, 0xD85D /*0xDE31*/, 0x886F, 0x88A0, 0x88BC,
+ 0x88BD, 0x88BE, 0x88C0, 0x88D2, 0xD85D /*0xDE93*/, 0x88D1, 0x88D3, 0x88DB,
+ 0x88F0, 0x88F1, 0x4641, 0x8901, 0xD85D /*0xDF0E*/, 0x8937, 0xD85D /*0xDF23*/, 0x8942,
+ 0x8945, 0x8949, 0xD85D /*0xDF52*/, 0x4665, 0x8962, 0x8980, 0x8989, 0x8990,
+ 0x899F, 0x89B0, 0x89B7, 0x89D6, 0x89D8, 0x89EB, 0x46A1, 0x89F1,
+ 0x89F3, 0x89FD, 0x89FF, 0x46AF, 0x8A11, 0x8A14, 0xD85E /*0xDD85*/, 0x8A21,
+ 0x8A35, 0x8A3E, 0x8A45, 0x8A4D, 0x8A58, 0x8AAE, 0x8A90, 0x8AB7,
+ 0x8ABE, 0x8AD7, 0x8AFC, 0xD85E /*0xDE84*/, 0x8B0A, 0x8B05, 0x8B0D, 0x8B1C,
+ 0x8B1F, 0x8B2D, 0x8B43, 0x470C, 0x8B51, 0x8B5E, 0x8B76, 0x8B7F,
+ 0x8B81, 0x8B8B, 0x8B94, 0x8B95, 0x8B9C, 0x8B9E, 0x8C39, 0xD85E /*0xDFB3*/,
+ 0x8C3D, 0xD85E /*0xDFBE*/, 0xD85E /*0xDFC7*/, 0x8C45, 0x8C47, 0x8C4F, 0x8C54,
+};
+static const unsigned short euc_to_utf8_8FF9_x0213[] = {
+ 0x8C57, 0x8C69, 0x8C6D, 0x8C73, 0xD85F /*0xDCB8*/, 0x8C93, 0x8C92,
+ 0x8C99, 0x4764, 0x8C9B, 0x8CA4, 0x8CD6, 0x8CD5, 0x8CD9, 0xD85F /*0xDDA0*/,
+ 0x8CF0, 0x8CF1, 0xD85F /*0xDE10*/, 0x8D09, 0x8D0E, 0x8D6C, 0x8D84, 0x8D95,
+ 0x8DA6, 0xD85F /*0xDFB7*/, 0x8DC6, 0x8DC8, 0x8DD9, 0x8DEC, 0x8E0C, 0x47FD,
+ 0x8DFD, 0x8E06, 0xD860 /*0xDC8A*/, 0x8E14, 0x8E16, 0x8E21, 0x8E22, 0x8E27,
+ 0xD860 /*0xDCBB*/, 0x4816, 0x8E36, 0x8E39, 0x8E4B, 0x8E54, 0x8E62, 0x8E6C,
+ 0x8E6D, 0x8E6F, 0x8E98, 0x8E9E, 0x8EAE, 0x8EB3, 0x8EB5, 0x8EB6,
+ 0x8EBB, 0xD860 /*0xDE82*/, 0x8ED1, 0x8ED4, 0x484E, 0x8EF9, 0xD860 /*0xDEF3*/, 0x8F00,
+ 0x8F08, 0x8F17, 0x8F2B, 0x8F40, 0x8F4A, 0x8F58, 0xD861 /*0xDC0C*/, 0x8FA4,
+ 0x8FB4, 0xFA66, 0x8FB6, 0xD861 /*0xDC55*/, 0x8FC1, 0x8FC6, 0xFA24, 0x8FCA,
+ 0x8FCD, 0x8FD3, 0x8FD5, 0x8FE0, 0x8FF1, 0x8FF5, 0x8FFB, 0x9002,
+ 0x900C, 0x9037, 0xD861 /*0xDD6B*/, 0x9043, 0x9044, 0x905D, 0xD861 /*0xDDC8*/,
+};
+static const unsigned short euc_to_utf8_8FFA_x0213[] = {
+ 0xD861 /*0xDDC9*/, 0x9085, 0x908C, 0x9090, 0x961D, 0x90A1, 0x48B5,
+ 0x90B0, 0x90B6, 0x90C3, 0x90C8, 0xD861 /*0xDED7*/, 0x90DC, 0x90DF, 0xD861 /*0xDEFA*/,
+ 0x90F6, 0x90F2, 0x9100, 0x90EB, 0x90FE, 0x90FF, 0x9104, 0x9106,
+ 0x9118, 0x911C, 0x911E, 0x9137, 0x9139, 0x913A, 0x9146, 0x9147,
+ 0x9157, 0x9159, 0x9161, 0x9164, 0x9174, 0x9179, 0x9185, 0x918E,
+ 0x91A8, 0x91AE, 0x91B3, 0x91B6, 0x91C3, 0x91C4, 0x91DA, 0xD862 /*0xDD49*/,
+ 0xD862 /*0xDD46*/, 0x91EC, 0x91EE, 0x9201, 0x920A, 0x9216, 0x9217, 0xD862 /*0xDD6B*/,
+ 0x9233, 0x9242, 0x9247, 0x924A, 0x924E, 0x9251, 0x9256, 0x9259,
+ 0x9260, 0x9261, 0x9265, 0x9267, 0x9268, 0xD862 /*0xDD87*/, 0xD862 /*0xDD88*/, 0x927C,
+ 0x927D, 0x927F, 0x9289, 0x928D, 0x9297, 0x9299, 0x929F, 0x92A7,
+ 0x92AB, 0xD862 /*0xDDBA*/, 0xD862 /*0xDDBB*/, 0x92B2, 0x92BF, 0x92C0, 0x92C6, 0x92CE,
+ 0x92D0, 0x92D7, 0x92D9, 0x92E5, 0x92E7, 0x9311, 0xD862 /*0xDE1E*/,
+};
+static const unsigned short euc_to_utf8_8FFB_x0213[] = {
+ 0xD862 /*0xDE29*/, 0x92F7, 0x92F9, 0x92FB, 0x9302, 0x930D, 0x9315,
+ 0x931D, 0x931E, 0x9327, 0x9329, 0xD862 /*0xDE71*/, 0xD862 /*0xDE43*/, 0x9347, 0x9351,
+ 0x9357, 0x935A, 0x936B, 0x9371, 0x9373, 0x93A1, 0xD862 /*0xDE99*/, 0xD862 /*0xDECD*/,
+ 0x9388, 0x938B, 0x938F, 0x939E, 0x93F5, 0xD862 /*0xDEE4*/, 0xD862 /*0xDEDD*/, 0x93F1,
+ 0x93C1, 0x93C7, 0x93DC, 0x93E2, 0x93E7, 0x9409, 0x940F, 0x9416,
+ 0x9417, 0x93FB, 0x9432, 0x9434, 0x943B, 0x9445, 0xD862 /*0xDFC1*/, 0xD862 /*0xDFEF*/,
+ 0x946D, 0x946F, 0x9578, 0x9579, 0x9586, 0x958C, 0x958D, 0xD863 /*0xDD10*/,
+ 0x95AB, 0x95B4, 0xD863 /*0xDD71*/, 0x95C8, 0xD863 /*0xDDFB*/, 0xD863 /*0xDE1F*/, 0x962C, 0x9633,
+ 0x9634, 0xD863 /*0xDE36*/, 0x963C, 0x9641, 0x9661, 0xD863 /*0xDE89*/, 0x9682, 0xD863 /*0xDEEB*/,
+ 0x969A, 0xD863 /*0xDF32*/, 0x49E7, 0x96A9, 0x96AF, 0x96B3, 0x96BA, 0x96BD,
+ 0x49FA, 0xD863 /*0xDFF8*/, 0x96D8, 0x96DA, 0x96DD, 0x4A04, 0x9714, 0x9723,
+ 0x4A29, 0x9736, 0x9741, 0x9747, 0x9755, 0x9757, 0x975B,
+};
+static const unsigned short euc_to_utf8_8FFC_x0213[] = {
+ 0x976A, 0xD864 /*0xDEA0*/, 0xD864 /*0xDEB1*/, 0x9796, 0x979A, 0x979E, 0x97A2,
+ 0x97B1, 0x97B2, 0x97BE, 0x97CC, 0x97D1, 0x97D4, 0x97D8, 0x97D9,
+ 0x97E1, 0x97F1, 0x9804, 0x980D, 0x980E, 0x9814, 0x9816, 0x4ABC,
+ 0xD865 /*0xDC90*/, 0x9823, 0x9832, 0x9833, 0x9825, 0x9847, 0x9866, 0x98AB,
+ 0x98AD, 0x98B0, 0xD865 /*0xDDCF*/, 0x98B7, 0x98B8, 0x98BB, 0x98BC, 0x98BF,
+ 0x98C2, 0x98C7, 0x98CB, 0x98E0, 0xD865 /*0xDE7F*/, 0x98E1, 0x98E3, 0x98E5,
+ 0x98EA, 0x98F0, 0x98F1, 0x98F3, 0x9908, 0x4B3B, 0xD865 /*0xDEF0*/, 0x9916,
+ 0x9917, 0xD865 /*0xDF19*/, 0x991A, 0x991B, 0x991C, 0xD865 /*0xDF50*/, 0x9931, 0x9932,
+ 0x9933, 0x993A, 0x993B, 0x993C, 0x9940, 0x9941, 0x9946, 0x994D,
+ 0x994E, 0x995C, 0x995F, 0x9960, 0x99A3, 0x99A6, 0x99B9, 0x99BD,
+ 0x99BF, 0x99C3, 0x99C9, 0x99D4, 0x99D9, 0x99DE, 0xD866 /*0xDCC6*/, 0x99F0,
+ 0x99F9, 0x99FC, 0x9A0A, 0x9A11, 0x9A16, 0x9A1A, 0x9A20,
+};
+static const unsigned short euc_to_utf8_8FFD_x0213[] = {
+ 0x9A31, 0x9A36, 0x9A44, 0x9A4C, 0x9A58, 0x4BC2, 0x9AAF,
+ 0x4BCA, 0x9AB7, 0x4BD2, 0x9AB9, 0xD866 /*0xDE72*/, 0x9AC6, 0x9AD0, 0x9AD2,
+ 0x9AD5, 0x4BE8, 0x9ADC, 0x9AE0, 0x9AE5, 0x9AE9, 0x9B03, 0x9B0C,
+ 0x9B10, 0x9B12, 0x9B16, 0x9B1C, 0x9B2B, 0x9B33, 0x9B3D, 0x4C20,
+ 0x9B4B, 0x9B63, 0x9B65, 0x9B6B, 0x9B6C, 0x9B73, 0x9B76, 0x9B77,
+ 0x9BA6, 0x9BAC, 0x9BB1, 0xD867 /*0xDDDB*/, 0xD867 /*0xDE3D*/, 0x9BB2, 0x9BB8, 0x9BBE,
+ 0x9BC7, 0x9BF3, 0x9BD8, 0x9BDD, 0x9BE7, 0x9BEA, 0x9BEB, 0x9BEF,
+ 0x9BEE, 0xD867 /*0xDE15*/, 0x9BFA, 0xD867 /*0xDE8A*/, 0x9BF7, 0xD867 /*0xDE49*/, 0x9C16, 0x9C18,
+ 0x9C19, 0x9C1A, 0x9C1D, 0x9C22, 0x9C27, 0x9C29, 0x9C2A, 0xD867 /*0xDEC4*/,
+ 0x9C31, 0x9C36, 0x9C37, 0x9C45, 0x9C5C, 0xD867 /*0xDEE9*/, 0x9C49, 0x9C4A,
+ 0xD867 /*0xDEDB*/, 0x9C54, 0x9C58, 0x9C5B, 0x9C5D, 0x9C5F, 0x9C69, 0x9C6A,
+ 0x9C6B, 0x9C6D, 0x9C6E, 0x9C70, 0x9C72, 0x9C75, 0x9C7A,
+};
+static const unsigned short euc_to_utf8_8FFE_x0213[] = {
+ 0x9CE6, 0x9CF2, 0x9D0B, 0x9D02, 0xD867 /*0xDFCE*/, 0x9D11, 0x9D17,
+ 0x9D18, 0xD868 /*0xDC2F*/, 0x4CC4, 0xD868 /*0xDC1A*/, 0x9D32, 0x4CD1, 0x9D42, 0x9D4A,
+ 0x9D5F, 0x9D62, 0xD868 /*0xDCF9*/, 0x9D69, 0x9D6B, 0xD868 /*0xDC82*/, 0x9D73, 0x9D76,
+ 0x9D77, 0x9D7E, 0x9D84, 0x9D8D, 0x9D99, 0x9DA1, 0x9DBF, 0x9DB5,
+ 0x9DB9, 0x9DBD, 0x9DC3, 0x9DC7, 0x9DC9, 0x9DD6, 0x9DDA, 0x9DDF,
+ 0x9DE0, 0x9DE3, 0x9DF4, 0x4D07, 0x9E0A, 0x9E02, 0x9E0D, 0x9E19,
+ 0x9E1C, 0x9E1D, 0x9E7B, 0xD848 /*0xDE18*/, 0x9E80, 0x9E85, 0x9E9B, 0x9EA8,
+ 0xD868 /*0xDF8C*/, 0x9EBD, 0xD869 /*0xDC37*/, 0x9EDF, 0x9EE7, 0x9EEE, 0x9EFF, 0x9F02,
+ 0x4D77, 0x9F03, 0x9F17, 0x9F19, 0x9F2F, 0x9F37, 0x9F3A, 0x9F3D,
+ 0x9F41, 0x9F45, 0x9F46, 0x9F53, 0x9F55, 0x9F58, 0xD869 /*0xDDF1*/, 0x9F5D,
+ 0xD869 /*0xDE02*/, 0x9F69, 0xD869 /*0xDE1A*/, 0x9F6D, 0x9F70, 0x9F75, 0xD869 /*0xDEB2*/, 0,
+ 0, 0, 0, 0, 0, 0, 0,
+};
#ifdef X0212_ENABLE
static const unsigned short euc_to_utf8_8FA2[] = {
@@ -2408,6 +3137,32 @@ const unsigned short *const euc_to_utf8_2bytes_mac[] = {
0, euc_to_utf8_F9, euc_to_utf8_FA, euc_to_utf8_FB,
euc_to_utf8_FC_ms, 0, 0,
};
+const unsigned short *const euc_to_utf8_2bytes_x0213[] = {
+ euc_to_utf8_A1, euc_to_utf8_A2_x0213, euc_to_utf8_A3_x0213,
+ euc_to_utf8_A4_x0213, euc_to_utf8_A5_x0213, euc_to_utf8_A6_x0213, euc_to_utf8_A7_x0213,
+ euc_to_utf8_A8_x0213, euc_to_utf8_A9_x0213, euc_to_utf8_AA_x0213, euc_to_utf8_AB_x0213,
+ euc_to_utf8_AC_x0213, euc_to_utf8_AD_x0213, euc_to_utf8_AE_x0213, euc_to_utf8_AF_x0213,
+ euc_to_utf8_B0, euc_to_utf8_B1, euc_to_utf8_B2, euc_to_utf8_B3,
+ euc_to_utf8_B4, euc_to_utf8_B5, euc_to_utf8_B6, euc_to_utf8_B7,
+ euc_to_utf8_B8, euc_to_utf8_B9, euc_to_utf8_BA, euc_to_utf8_BB,
+ euc_to_utf8_BC, euc_to_utf8_BD, euc_to_utf8_BE, euc_to_utf8_BF,
+ euc_to_utf8_C0, euc_to_utf8_C1, euc_to_utf8_C2, euc_to_utf8_C3,
+ euc_to_utf8_C4, euc_to_utf8_C5, euc_to_utf8_C6, euc_to_utf8_C7,
+ euc_to_utf8_C8, euc_to_utf8_C9, euc_to_utf8_CA, euc_to_utf8_CB,
+ euc_to_utf8_CC, euc_to_utf8_CD, euc_to_utf8_CE, euc_to_utf8_CF_x0213,
+ euc_to_utf8_D0, euc_to_utf8_D1, euc_to_utf8_D2, euc_to_utf8_D3,
+ euc_to_utf8_D4, euc_to_utf8_D5, euc_to_utf8_D6, euc_to_utf8_D7,
+ euc_to_utf8_D8, euc_to_utf8_D9, euc_to_utf8_DA, euc_to_utf8_DB,
+ euc_to_utf8_DC, euc_to_utf8_DD, euc_to_utf8_DE, euc_to_utf8_DF,
+ euc_to_utf8_E0, euc_to_utf8_E1, euc_to_utf8_E2, euc_to_utf8_E3,
+ euc_to_utf8_E4, euc_to_utf8_E5, euc_to_utf8_E6, euc_to_utf8_E7,
+ euc_to_utf8_E8, euc_to_utf8_E9, euc_to_utf8_EA, euc_to_utf8_EB,
+ euc_to_utf8_EC, euc_to_utf8_ED, euc_to_utf8_EE, euc_to_utf8_EF,
+ euc_to_utf8_F0, euc_to_utf8_F1, euc_to_utf8_F2, euc_to_utf8_F3,
+ euc_to_utf8_F4_x0213, euc_to_utf8_F5_x0213, euc_to_utf8_F6_x0213, euc_to_utf8_F7_x0213,
+ euc_to_utf8_F8_x0213, euc_to_utf8_F9_x0213, euc_to_utf8_FA_x0213, euc_to_utf8_FB_x0213,
+ euc_to_utf8_FC_x0213, euc_to_utf8_FD_x0213, euc_to_utf8_FE_x0213,
+};
#ifdef X0212_ENABLE
const unsigned short *const x0212_to_utf8_2bytes[] = {
@@ -2435,7 +3190,371 @@ const unsigned short *const x0212_to_utf8_2bytes[] = {
euc_to_utf8_8FF4, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0,};
+
+const unsigned short *const x0212_to_utf8_2bytes_x0213[] = {
+ euc_to_utf8_8FA1_x0213, euc_to_utf8_8FA2, euc_to_utf8_8FA3_x0213,
+ euc_to_utf8_8FA4_x0213, euc_to_utf8_8FA5_x0213, euc_to_utf8_8FA6, euc_to_utf8_8FA7,
+ euc_to_utf8_8FA8_x0213, euc_to_utf8_8FA9, euc_to_utf8_8FAA, euc_to_utf8_8FAB,
+ euc_to_utf8_8FAC_x0213, euc_to_utf8_8FAD_x0213, euc_to_utf8_8FAE_x0213, euc_to_utf8_8FAF_x0213,
+ euc_to_utf8_8FB0, euc_to_utf8_8FB1, euc_to_utf8_8FB2, euc_to_utf8_8FB3,
+ euc_to_utf8_8FB4, euc_to_utf8_8FB5, euc_to_utf8_8FB6, euc_to_utf8_8FB7,
+ euc_to_utf8_8FB8, euc_to_utf8_8FB9, euc_to_utf8_8FBA, euc_to_utf8_8FBB,
+ euc_to_utf8_8FBC, euc_to_utf8_8FBD, euc_to_utf8_8FBE, euc_to_utf8_8FBF,
+ euc_to_utf8_8FC0, euc_to_utf8_8FC1, euc_to_utf8_8FC2, euc_to_utf8_8FC3,
+ euc_to_utf8_8FC4, euc_to_utf8_8FC5, euc_to_utf8_8FC6, euc_to_utf8_8FC7,
+ euc_to_utf8_8FC8, euc_to_utf8_8FC9, euc_to_utf8_8FCA, euc_to_utf8_8FCB,
+ euc_to_utf8_8FCC, euc_to_utf8_8FCD, euc_to_utf8_8FCE, euc_to_utf8_8FCF,
+ euc_to_utf8_8FD0, euc_to_utf8_8FD1, euc_to_utf8_8FD2, euc_to_utf8_8FD3,
+ euc_to_utf8_8FD4, euc_to_utf8_8FD5, euc_to_utf8_8FD6, euc_to_utf8_8FD7,
+ euc_to_utf8_8FD8, euc_to_utf8_8FD9, euc_to_utf8_8FDA, euc_to_utf8_8FDB,
+ euc_to_utf8_8FDC, euc_to_utf8_8FDD, euc_to_utf8_8FDE, euc_to_utf8_8FDF,
+ euc_to_utf8_8FE0, euc_to_utf8_8FE1, euc_to_utf8_8FE2, euc_to_utf8_8FE3,
+ euc_to_utf8_8FE4, euc_to_utf8_8FE5, euc_to_utf8_8FE6, euc_to_utf8_8FE7,
+ euc_to_utf8_8FE8, euc_to_utf8_8FE9, euc_to_utf8_8FEA, euc_to_utf8_8FEB,
+ euc_to_utf8_8FEC, euc_to_utf8_8FED, euc_to_utf8_8FEE_x0213, euc_to_utf8_8FEF_x0213,
+ euc_to_utf8_8FF0_x0213, euc_to_utf8_8FF1_x0213, euc_to_utf8_8FF2_x0213, euc_to_utf8_8FF3_x0213,
+ euc_to_utf8_8FF4_x0213, euc_to_utf8_8FF5_x0213, euc_to_utf8_8FF6_x0213, euc_to_utf8_8FF7_x0213,
+ euc_to_utf8_8FF8_x0213, euc_to_utf8_8FF9_x0213, euc_to_utf8_8FFA_x0213, euc_to_utf8_8FFB_x0213,
+ euc_to_utf8_8FFC_x0213, euc_to_utf8_8FFD_x0213, euc_to_utf8_8FFE_x0213,};
#endif /* X0212_ENABLE */
+
+const unsigned short x0213_combining_chars[sizeof_x0213_combining_chars] = {
+ 0x309A, 0x0300, 0x0301, 0x02E5, 0x02E9,
+};
+const unsigned short x0213_combining_table[sizeof_x0213_combining_table][3] = {
+ {0x2477, 0x304B, 0x309A},
+ {0x2478, 0x304D, 0x309A},
+ {0x2479, 0x304F, 0x309A},
+ {0x247A, 0x3051, 0x309A},
+ {0x247B, 0x3053, 0x309A},
+ {0x2577, 0x30AB, 0x309A},
+ {0x2578, 0x30AD, 0x309A},
+ {0x2579, 0x30AF, 0x309A},
+ {0x257A, 0x30B1, 0x309A},
+ {0x257B, 0x30B3, 0x309A},
+ {0x257C, 0x30BB, 0x309A},
+ {0x257D, 0x30C4, 0x309A},
+ {0x257E, 0x30C8, 0x309A},
+ {0x2678, 0x31F7, 0x309A},
+ {0x2B44, 0x00E6, 0x0300},
+ {0x2B48, 0x0254, 0x0300},
+ {0x2B49, 0x0254, 0x0301},
+ {0x2B4A, 0x028C, 0x0300},
+ {0x2B4B, 0x028C, 0x0301},
+ {0x2B4C, 0x0259, 0x0300},
+ {0x2B4D, 0x0259, 0x0301},
+ {0x2B4E, 0x025A, 0x0300},
+ {0x2B4F, 0x025A, 0x0301},
+ {0x2B65, 0x02E9, 0x02E5},
+ {0x2B66, 0x02E5, 0x02E9},
+};
+const unsigned short x0213_1_surrogate_table[sizeof_x0213_1_surrogate_table][3] = {
+ {0x2E22, 0xD840, 0xDC0B},
+ {0x2F42, 0xD844, 0xDE3D},
+ {0x2F4C, 0xD844, 0xDF1B},
+ {0x2F60, 0xD845, 0xDC6E},
+ {0x2F7B, 0xD846, 0xDCBD},
+ {0x4F54, 0xD842, 0xDF9F},
+ {0x4F63, 0xD845, 0xDEB4},
+ {0x4F6E, 0xD847, 0xDE34},
+ {0x753A, 0xD84C, 0xDDC4},
+ {0x7572, 0xD84D, 0xDDC4},
+ {0x7629, 0xD84D, 0xDF3F},
+ {0x7632, 0xD84D, 0xDF63},
+ {0x7660, 0xD84F, 0xDCFE},
+ {0x776C, 0xD851, 0xDFF1},
+ {0x787E, 0xD855, 0xDC8E},
+ {0x7929, 0xD855, 0xDD0E},
+ {0x7947, 0xD855, 0xDF71},
+ {0x7954, 0xD856, 0xDDC4},
+ {0x796E, 0xD857, 0xDDA1},
+ {0x7A5D, 0xD85A, 0xDEFF},
+ {0x7B33, 0xD85B, 0xDE40},
+ {0x7B49, 0xD85C, 0xDCF4},
+ {0x7B6C, 0xD85D, 0xDE84},
+ {0x7C49, 0xD860, 0xDE77},
+ {0x7C51, 0xD860, 0xDFCD},
+ {0x7E66, 0xD868, 0xDD90},
+};
+const unsigned short x0213_2_surrogate_table[sizeof_x0213_2_surrogate_table][3] = {
+ {0x2121, 0xD840, 0xDC89},
+ {0x212B, 0xD840, 0xDCA2},
+ {0x212E, 0xD840, 0xDCA4},
+ {0x2136, 0xD840, 0xDDA2},
+ {0x2146, 0xD840, 0xDE13},
+ {0x2170, 0xD840, 0xDF2B},
+ {0x2177, 0xD840, 0xDF81},
+ {0x2179, 0xD840, 0xDF71},
+ {0x2322, 0xD840, 0xDFF9},
+ {0x2325, 0xD841, 0xDC4A},
+ {0x2327, 0xD841, 0xDD09},
+ {0x2331, 0xD841, 0xDDD6},
+ {0x2332, 0xD841, 0xDE28},
+ {0x2338, 0xD841, 0xDF4F},
+ {0x233F, 0xD842, 0xDC07},
+ {0x2341, 0xD842, 0xDC3A},
+ {0x234A, 0xD842, 0xDCB9},
+ {0x2352, 0xD842, 0xDD7C},
+ {0x2353, 0xD842, 0xDD9D},
+ {0x2359, 0xD842, 0xDED3},
+ {0x235C, 0xD842, 0xDF1D},
+ {0x2377, 0xD843, 0xDD45},
+ {0x242A, 0xD843, 0xDDE1},
+ {0x2431, 0xD843, 0xDE95},
+ {0x2432, 0xD843, 0xDE6D},
+ {0x243A, 0xD843, 0xDE64},
+ {0x243D, 0xD843, 0xDF5F},
+ {0x2459, 0xD844, 0xDE01},
+ {0x245C, 0xD844, 0xDE55},
+ {0x245E, 0xD844, 0xDE7B},
+ {0x2463, 0xD844, 0xDE74},
+ {0x246A, 0xD844, 0xDEE4},
+ {0x246B, 0xD844, 0xDED7},
+ {0x2472, 0xD844, 0xDEFD},
+ {0x2474, 0xD844, 0xDF36},
+ {0x2475, 0xD844, 0xDF44},
+ {0x2525, 0xD844, 0xDFC4},
+ {0x2532, 0xD845, 0xDC6D},
+ {0x253E, 0xD845, 0xDDD7},
+ {0x2544, 0xD85B, 0xDC29},
+ {0x2547, 0xD845, 0xDE47},
+ {0x2555, 0xD845, 0xDF06},
+ {0x2556, 0xD845, 0xDF42},
+ {0x257E, 0xD846, 0xDDC3},
+ {0x2830, 0xD847, 0xDC56},
+ {0x2837, 0xD847, 0xDD2D},
+ {0x2838, 0xD847, 0xDD45},
+ {0x283A, 0xD847, 0xDD78},
+ {0x283B, 0xD847, 0xDD62},
+ {0x283F, 0xD847, 0xDDA1},
+ {0x2840, 0xD847, 0xDD9C},
+ {0x2845, 0xD847, 0xDD92},
+ {0x2848, 0xD847, 0xDDB7},
+ {0x284A, 0xD847, 0xDDE0},
+ {0x284B, 0xD847, 0xDE33},
+ {0x285B, 0xD847, 0xDF1E},
+ {0x2866, 0xD847, 0xDF76},
+ {0x286C, 0xD847, 0xDFFA},
+ {0x2C22, 0xD848, 0xDD7B},
+ {0x2C2B, 0xD848, 0xDF1E},
+ {0x2C30, 0xD848, 0xDFAD},
+ {0x2C50, 0xD849, 0xDEF3},
+ {0x2C65, 0xD84A, 0xDC5B},
+ {0x2C6D, 0xD84A, 0xDCAB},
+ {0x2C72, 0xD84A, 0xDD8F},
+ {0x2D24, 0xD84A, 0xDEB8},
+ {0x2D29, 0xD84A, 0xDF4F},
+ {0x2D2A, 0xD84A, 0xDF50},
+ {0x2D32, 0xD84A, 0xDF46},
+ {0x2D34, 0xD84B, 0xDC1D},
+ {0x2D35, 0xD84A, 0xDFA6},
+ {0x2D39, 0xD84B, 0xDC24},
+ {0x2D56, 0xD84B, 0xDDE1},
+ {0x2D7D, 0xD84C, 0xDDC3},
+ {0x2E23, 0xD84C, 0xDDF5},
+ {0x2E24, 0xD84C, 0xDDB6},
+ {0x2E3A, 0xD84C, 0xDF72},
+ {0x2E3C, 0xD84C, 0xDFD3},
+ {0x2E3D, 0xD84C, 0xDFD2},
+ {0x2E42, 0xD84C, 0xDFD0},
+ {0x2E43, 0xD84C, 0xDFE4},
+ {0x2E44, 0xD84C, 0xDFD5},
+ {0x2E47, 0xD84C, 0xDFDA},
+ {0x2E49, 0xD84C, 0xDFDF},
+ {0x2E55, 0xD84D, 0xDC4A},
+ {0x2E56, 0xD84D, 0xDC51},
+ {0x2E57, 0xD84D, 0xDC4B},
+ {0x2E5B, 0xD84D, 0xDC65},
+ {0x2E77, 0xD84D, 0xDCE4},
+ {0x2E78, 0xD84D, 0xDD5A},
+ {0x2F2A, 0xD84D, 0xDD94},
+ {0x2F3F, 0xD84D, 0xDE39},
+ {0x2F40, 0xD84D, 0xDE47},
+ {0x2F42, 0xD84D, 0xDE38},
+ {0x2F43, 0xD84D, 0xDE3A},
+ {0x2F4E, 0xD84D, 0xDF1C},
+ {0x2F59, 0xD84D, 0xDF0C},
+ {0x2F61, 0xD84D, 0xDF64},
+ {0x2F69, 0xD84D, 0xDFFF},
+ {0x2F6A, 0xD84D, 0xDFE7},
+ {0x2F70, 0xD84E, 0xDC24},
+ {0x2F75, 0xD84E, 0xDC3D},
+ {0x6E23, 0xD84E, 0xDE98},
+ {0x6E34, 0xD84F, 0xDC7F},
+ {0x6E49, 0xD84F, 0xDD00},
+ {0x6E5C, 0xD84F, 0xDD40},
+ {0x6E5E, 0xD84F, 0xDDFA},
+ {0x6E5F, 0xD84F, 0xDDF9},
+ {0x6E60, 0xD84F, 0xDDD3},
+ {0x6F32, 0xD84F, 0xDF7E},
+ {0x6F47, 0xD850, 0xDC96},
+ {0x6F4D, 0xD850, 0xDD03},
+ {0x6F61, 0xD850, 0xDDC6},
+ {0x6F64, 0xD850, 0xDDFE},
+ {0x7022, 0xD850, 0xDFBC},
+ {0x7033, 0xD851, 0xDE29},
+ {0x7039, 0xD851, 0xDEA5},
+ {0x7053, 0xD852, 0xDC96},
+ {0x707B, 0xD852, 0xDE4D},
+ {0x712E, 0xD852, 0xDF56},
+ {0x7130, 0xD852, 0xDF6F},
+ {0x7135, 0xD853, 0xDC16},
+ {0x7144, 0xD853, 0xDD14},
+ {0x715D, 0xD853, 0xDE0E},
+ {0x7161, 0xD853, 0xDE37},
+ {0x7166, 0xD853, 0xDE6A},
+ {0x7169, 0xD853, 0xDE8B},
+ {0x7175, 0xD854, 0xDC4A},
+ {0x7177, 0xD854, 0xDC55},
+ {0x717A, 0xD854, 0xDD22},
+ {0x7221, 0xD854, 0xDDA9},
+ {0x7223, 0xD854, 0xDDE5},
+ {0x7224, 0xD854, 0xDDCD},
+ {0x7228, 0xD854, 0xDE1E},
+ {0x722C, 0xD854, 0xDE4C},
+ {0x723D, 0xD855, 0xDC2E},
+ {0x7248, 0xD855, 0xDCD9},
+ {0x725B, 0xD855, 0xDDA7},
+ {0x7275, 0xD855, 0xDFA9},
+ {0x7276, 0xD855, 0xDFB4},
+ {0x7332, 0xD856, 0xDDD4},
+ {0x733D, 0xD856, 0xDEE4},
+ {0x733E, 0xD856, 0xDEE3},
+ {0x7340, 0xD856, 0xDEF1},
+ {0x7352, 0xD856, 0xDFB2},
+ {0x735D, 0xD857, 0xDC4B},
+ {0x735E, 0xD857, 0xDC64},
+ {0x7373, 0xD857, 0xDE2E},
+ {0x7374, 0xD857, 0xDE56},
+ {0x7375, 0xD857, 0xDE65},
+ {0x7377, 0xD857, 0xDE62},
+ {0x737B, 0xD857, 0xDED8},
+ {0x737D, 0xD857, 0xDEC2},
+ {0x7422, 0xD857, 0xDEE8},
+ {0x7424, 0xD857, 0xDF23},
+ {0x7427, 0xD857, 0xDF5C},
+ {0x742E, 0xD857, 0xDFE0},
+ {0x742F, 0xD857, 0xDFD4},
+ {0x7434, 0xD858, 0xDC0C},
+ {0x7435, 0xD857, 0xDFFB},
+ {0x743D, 0xD858, 0xDC17},
+ {0x7442, 0xD858, 0xDC60},
+ {0x744F, 0xD858, 0xDCED},
+ {0x7469, 0xD858, 0xDE70},
+ {0x746B, 0xD858, 0xDE86},
+ {0x7472, 0xD858, 0xDF4C},
+ {0x7475, 0xD84F, 0xDD0E},
+ {0x7479, 0xD859, 0xDC02},
+ {0x7535, 0xD859, 0xDE7E},
+ {0x753A, 0xD859, 0xDEB0},
+ {0x7546, 0xD859, 0xDF1D},
+ {0x7556, 0xD85A, 0xDCDD},
+ {0x7558, 0xD85A, 0xDCEA},
+ {0x755A, 0xD85A, 0xDD51},
+ {0x755D, 0xD85A, 0xDD6F},
+ {0x755F, 0xD85A, 0xDDDD},
+ {0x7563, 0xD85A, 0xDE1E},
+ {0x756A, 0xD85A, 0xDE58},
+ {0x7570, 0xD85A, 0xDE8C},
+ {0x7573, 0xD85A, 0xDEB7},
+ {0x7644, 0xD85B, 0xDC73},
+ {0x764E, 0xD85B, 0xDCDD},
+ {0x765D, 0xD85B, 0xDE65},
+ {0x7675, 0xD85B, 0xDF94},
+ {0x767E, 0xD85B, 0xDFF8},
+ {0x7721, 0xD85B, 0xDFF6},
+ {0x7722, 0xD85B, 0xDFF7},
+ {0x7733, 0xD85C, 0xDD0D},
+ {0x7736, 0xD85C, 0xDD39},
+ {0x7764, 0xD85C, 0xDFDB},
+ {0x7765, 0xD85C, 0xDFDA},
+ {0x776B, 0xD85C, 0xDFFE},
+ {0x776E, 0xD85D, 0xDC10},
+ {0x7773, 0xD85D, 0xDC49},
+ {0x7829, 0xD85D, 0xDE15},
+ {0x782A, 0xD85D, 0xDE14},
+ {0x782C, 0xD85D, 0xDE31},
+ {0x7834, 0xD85D, 0xDE93},
+ {0x783C, 0xD85D, 0xDF0E},
+ {0x783E, 0xD85D, 0xDF23},
+ {0x7842, 0xD85D, 0xDF52},
+ {0x7856, 0xD85E, 0xDD85},
+ {0x7863, 0xD85E, 0xDE84},
+ {0x7877, 0xD85E, 0xDFB3},
+ {0x7879, 0xD85E, 0xDFBE},
+ {0x787A, 0xD85E, 0xDFC7},
+ {0x7925, 0xD85F, 0xDCB8},
+ {0x792F, 0xD85F, 0xDDA0},
+ {0x7932, 0xD85F, 0xDE10},
+ {0x7939, 0xD85F, 0xDFB7},
+ {0x7942, 0xD860, 0xDC8A},
+ {0x7948, 0xD860, 0xDCBB},
+ {0x7959, 0xD860, 0xDE82},
+ {0x795E, 0xD860, 0xDEF3},
+ {0x7966, 0xD861, 0xDC0C},
+ {0x796B, 0xD861, 0xDC55},
+ {0x797A, 0xD861, 0xDD6B},
+ {0x797E, 0xD861, 0xDDC8},
+ {0x7A21, 0xD861, 0xDDC9},
+ {0x7A2C, 0xD861, 0xDED7},
+ {0x7A2F, 0xD861, 0xDEFA},
+ {0x7A4F, 0xD862, 0xDD49},
+ {0x7A50, 0xD862, 0xDD46},
+ {0x7A57, 0xD862, 0xDD6B},
+ {0x7A65, 0xD862, 0xDD87},
+ {0x7A66, 0xD862, 0xDD88},
+ {0x7A71, 0xD862, 0xDDBA},
+ {0x7A72, 0xD862, 0xDDBB},
+ {0x7A7E, 0xD862, 0xDE1E},
+ {0x7B21, 0xD862, 0xDE29},
+ {0x7B2C, 0xD862, 0xDE71},
+ {0x7B2D, 0xD862, 0xDE43},
+ {0x7B36, 0xD862, 0xDE99},
+ {0x7B37, 0xD862, 0xDECD},
+ {0x7B3D, 0xD862, 0xDEE4},
+ {0x7B3E, 0xD862, 0xDEDD},
+ {0x7B4E, 0xD862, 0xDFC1},
+ {0x7B4F, 0xD862, 0xDFEF},
+ {0x7B57, 0xD863, 0xDD10},
+ {0x7B5A, 0xD863, 0xDD71},
+ {0x7B5C, 0xD863, 0xDDFB},
+ {0x7B5D, 0xD863, 0xDE1F},
+ {0x7B61, 0xD863, 0xDE36},
+ {0x7B65, 0xD863, 0xDE89},
+ {0x7B67, 0xD863, 0xDEEB},
+ {0x7B69, 0xD863, 0xDF32},
+ {0x7B71, 0xD863, 0xDFF8},
+ {0x7C22, 0xD864, 0xDEA0},
+ {0x7C23, 0xD864, 0xDEB1},
+ {0x7C38, 0xD865, 0xDC90},
+ {0x7C42, 0xD865, 0xDDCF},
+ {0x7C4C, 0xD865, 0xDE7F},
+ {0x7C56, 0xD865, 0xDEF0},
+ {0x7C59, 0xD865, 0xDF19},
+ {0x7C5D, 0xD865, 0xDF50},
+ {0x7C76, 0xD866, 0xDCC6},
+ {0x7D2C, 0xD866, 0xDE72},
+ {0x7D4B, 0xD867, 0xDDDB},
+ {0x7D4C, 0xD867, 0xDE3D},
+ {0x7D59, 0xD867, 0xDE15},
+ {0x7D5B, 0xD867, 0xDE8A},
+ {0x7D5D, 0xD867, 0xDE49},
+ {0x7D67, 0xD867, 0xDEC4},
+ {0x7D6D, 0xD867, 0xDEE9},
+ {0x7D70, 0xD867, 0xDEDB},
+ {0x7E25, 0xD867, 0xDFCE},
+ {0x7E29, 0xD868, 0xDC2F},
+ {0x7E2B, 0xD868, 0xDC1A},
+ {0x7E32, 0xD868, 0xDCF9},
+ {0x7E35, 0xD868, 0xDC82},
+ {0x7E53, 0xD848, 0xDE18},
+ {0x7E58, 0xD868, 0xDF8C},
+ {0x7E5A, 0xD869, 0xDC37},
+ {0x7E6E, 0xD869, 0xDDF1},
+ {0x7E70, 0xD869, 0xDE02},
+ {0x7E72, 0xD869, 0xDE1A},
+ {0x7E76, 0xD869, 0xDEB2},
+};
#endif /* UTF8_OUTPUT_ENABLE */
#ifdef UTF8_INPUT_ENABLE
@@ -2479,6 +3598,16 @@ static const unsigned short utf8_to_euc_C2_932[] = {
0x216B, 0x215E, 0x32, 0x33, 0x212D, 0x264C, 0x2279, 0x2126,
0x2124, 0x31, 0x6F, 0x2264, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_C2_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0x2922, 0x2923, 0x2171, 0x2172, 0x2924, 0x216F, 0x2925, 0x2178,
+ 0x212F, 0x2926, 0x2927, 0x2928, 0x224C, 0x2929, 0x292A, 0x292B,
+ 0x216B, 0x215E, 0x292C, 0x292D, 0x212D, 0, 0x2279, 0x292E,
+ 0x292F, 0x2930, 0x2931, 0x2932, 0x2933, 0x2934, 0x2935, 0x2936,
+};
static const unsigned short utf8_to_euc_C3[] = {
0xAA22, 0xAA21, 0xAA24, 0xAA2A, 0xAA23, 0xAA29, 0xA921, 0xAA2E,
0xAA32, 0xAA31, 0xAA34, 0xAA33, 0xAA40, 0xAA3F, 0xAA42, 0xAA41,
@@ -2499,6 +3628,16 @@ static const unsigned short utf8_to_euc_C3_932[] = {
0x64, 0x6E, 0x6F, 0x6F, 0x6F, 0x6F, 0x6F, 0x2160,
0x6F, 0x75, 0x75, 0x75, 0x75, 0x79, 0x74, 0x79,
};
+static const unsigned short utf8_to_euc_C3_x0213[] = {
+ 0x2937, 0x2938, 0x2939, 0x293A, 0x293B, 0x293C, 0x293D, 0x293E,
+ 0x293F, 0x2940, 0x2941, 0x2942, 0x2943, 0x2944, 0x2945, 0x2946,
+ 0x2947, 0x2948, 0x2949, 0x294A, 0x294B, 0x294C, 0x294D, 0x215F,
+ 0x294E, 0x294F, 0x2950, 0x2951, 0x2952, 0x2953, 0x2954, 0x2955,
+ 0x2956, 0x2957, 0x2958, 0x2959, 0x295A, 0x295B, 0x295C, 0x295D,
+ 0x295E, 0x295F, 0x2960, 0x2961, 0x2962, 0x2963, 0x2964, 0x2965,
+ 0x2966, 0x2967, 0x2968, 0x2969, 0x296A, 0x296B, 0x296C, 0x2160,
+ 0x296D, 0x296E, 0x296F, 0x2970, 0x2971, 0x2972, 0x2973, 0x2974,
+};
static const unsigned short utf8_to_euc_C4[] = {
0xAA27, 0xAB27, 0xAA25, 0xAB25, 0xAA28, 0xAB28, 0xAA2B, 0xAB2B,
0xAA2C, 0xAB2C, 0xAA2F, 0xAB2F, 0xAA2D, 0xAB2D, 0xAA30, 0xAB30,
@@ -2509,6 +3648,16 @@ static const unsigned short utf8_to_euc_C4[] = {
0xAA44, 0xA945, 0xA926, 0xA946, 0xAA48, 0xAB48, 0xAA49, 0xAB49,
0xA947, 0xAA4A, 0xAB4A, 0xAA4C, 0xAB4C, 0xAA4B, 0xAB4B, 0xA929,
};
+static const unsigned short utf8_to_euc_C4_x0213[] = {
+ 0x2975, 0x297A, 0x2A3A, 0x2A49, 0x2A21, 0x2A2C, 0x2A3C, 0x2A4B,
+ 0x2A59, 0x2A5F, 0xAA2F, 0xAB2F, 0x2A3D, 0x2A4C, 0x2A40, 0x2A4F,
+ 0xA922, 0x2A50, 0x2978, 0x297D, 0, 0, 0xAA36, 0xAB36,
+ 0x2A3E, 0x2A4D, 0x2A3F, 0x2A4E, 0x2A5A, 0x2A60, 0xAA3B, 0xAB3B,
+ 0xAA3D, 0xAB3D, 0xAA3C, 0, 0x2A5B, 0x2A61, 0xA924, 0x2A7D,
+ 0xAA47, 0xAB47, 0x2976, 0x297B, 0, 0, 0xAA46, 0xAB46,
+ 0xAA44, 0xA945, 0xA926, 0xA946, 0x2A5C, 0x2A62, 0xAA49, 0xAB49,
+ 0xA947, 0x2A3B, 0x2A4A, 0xAA4C, 0xAB4C, 0x2A24, 0x2A2F, 0xA929,
+};
static const unsigned short utf8_to_euc_C5[] = {
0xA949, 0xA928, 0xA948, 0xAA4D, 0xAB4D, 0xAA4F, 0xAB4F, 0xAA4E,
0xAB4E, 0xA94A, 0xA92B, 0xA94B, 0xAA57, 0xAB57, 0, 0,
@@ -2519,6 +3668,26 @@ static const unsigned short utf8_to_euc_C5[] = {
0xAA68, 0xAB68, 0xAA6A, 0xAB6A, 0xAA71, 0xAB71, 0xAA74, 0xAB74,
0xAA73, 0xAA75, 0xAB75, 0xAA77, 0xAB77, 0xAA76, 0xAB76, 0,
};
+static const unsigned short utf8_to_euc_C5_x0213[] = {
+ 0xA949, 0x2A23, 0x2A2E, 0x2A41, 0x2A51, 0xAA4F, 0xAB4F, 0x2A42,
+ 0x2A52, 0xA94A, 0xA92B, 0x2A7A, 0x2979, 0x297E, 0, 0,
+ 0x2A43, 0x2A53, 0x2B2B, 0x2B2A, 0x2A39, 0x2A48, 0xAA5B, 0xAB5B,
+ 0x2A44, 0x2A54, 0x2A25, 0x2A30, 0x2A5D, 0x2A63, 0x2A27, 0x2A33,
+ 0x2A26, 0x2A32, 0x2A47, 0x2A57, 0x2A28, 0x2A34, 0xA92F, 0xA94F,
+ 0xAA6C, 0xAB6C, 0x2977, 0x297C, 0x2A5E, 0x2A64, 0x2A45, 0x2A55,
+ 0x2A46, 0x2A56, 0xAA6A, 0xAB6A, 0xAA71, 0xAB71, 0xAA74, 0xAB74,
+ 0xAA73, 0x2A29, 0x2A35, 0x2A2B, 0x2A38, 0x2A2A, 0x2A37, 0,
+};
+static const unsigned short utf8_to_euc_C6_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0x2B29, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_C7[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0xAA26, 0xAB26, 0xAA43,
@@ -2529,6 +3698,36 @@ static const unsigned short utf8_to_euc_C7[] = {
0, 0, 0, 0, 0, 0xAB39, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_C7_x0213[] = {
+ 0, 0, 0x2B24, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0x286F, 0x2870, 0xAA43,
+ 0x2871, 0x2876, 0x2877, 0xAA67, 0x2878, 0xAA70, 0x2879, 0xAA6D,
+ 0x287A, 0xAA6F, 0x287B, 0xAA6E, 0x287C, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0xAB39, 0, 0,
+ 0x2874, 0x2875, 0, 0, 0, 0x2B45, 0, 0,
+};
+static const unsigned short utf8_to_euc_C9_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0x2B33, 0x2B39, 0x2B3A, 0x2B25, 0x2B38, 0x2B3F, 0x2A6E, 0x2B26,
+ 0x2B2E, 0x2B30, 0x2B43, 0, 0x2B31, 0, 0x2B32, 0x2A75,
+ 0x2B28, 0x2A79, 0, 0, 0x2B36, 0x2B3C, 0x2B22, 0x2B42,
+ 0x2B2C, 0, 0, 0, 0x2A6A, 0x2A74, 0x2A6B, 0x2B34,
+ 0x2A7B, 0x2A65, 0x2A76, 0x2A6F, 0, 0x2B2F, 0, 0,
+ 0, 0x2A6C, 0x2B41, 0x2A73, 0, 0x2A70, 0x2A67, 0,
+};
+static const unsigned short utf8_to_euc_CA_x0213[] = {
+ 0, 0x2A7C, 0x2A71, 0x2A68, 0x2B27, 0, 0, 0,
+ 0x2A6D, 0x2B2D, 0x2B35, 0x2A66, 0x2B37, 0x2B3B, 0x2A78, 0,
+ 0x2A72, 0x2B40, 0x2A69, 0, 0x2B21, 0x2A7E, 0, 0,
+ 0x2B23, 0, 0, 0, 0, 0x2A77, 0, 0,
+ 0, 0x2B3E, 0x2B3D, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_CB[] = {
0, 0, 0, 0, 0, 0, 0, 0xA230,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2539,6 +3738,36 @@ static const unsigned short utf8_to_euc_CB[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_CB_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0x2A31,
+ 0x2B53, 0, 0, 0, 0x2B54, 0, 0, 0,
+ 0x2B55, 0x2B56, 0, 0, 0, 0, 0, 0,
+ 0x2A22, 0x2A58, 0xA236, 0x2A2D, 0, 0x2A36, 0x2B71, 0,
+ 0, 0, 0, 0, 0, 0x2B60, 0x2B61, 0x2B62,
+ 0x2B63, 0x2B64, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_CC_x0213[] = {
+ 0x2B5C, 0x2B5A, 0x2B5F, 0x2B7D, 0x2B5B, 0, 0x2B57, 0,
+ 0x2B6D, 0, 0, 0x2B59, 0x2B5E, 0, 0, 0x2B5D,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0x2B78, 0x2B79, 0x2B7E, 0, 0x2B6A, 0x2B76, 0x2B77, 0x2B6B,
+ 0x2B6C, 0, 0, 0, 0x2B72, 0x2B67, 0, 0,
+ 0, 0x2B6F, 0x2B7A, 0, 0x2B68, 0, 0, 0x2B70,
+ 0x2B73, 0, 0, 0, 0x2B75, 0, 0, 0,
+ 0, 0x2B69, 0x2B7B, 0x2B7C, 0x2B74, 0x2B6E, 0, 0,
+};
+static const unsigned short utf8_to_euc_CD_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0x2B52, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_CE[] = {
0, 0, 0, 0, 0xA238, 0xA239, 0xA661, 0,
0xA662, 0xA663, 0xA664, 0, 0xA667, 0, 0xA669, 0xA66C,
@@ -2559,6 +3788,16 @@ static const unsigned short utf8_to_euc_CF[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_CF_x0213[] = {
+ 0x2650, 0x2651, 0x2659, 0x2652, 0x2653, 0x2654, 0x2655, 0x2656,
+ 0x2657, 0x2658, 0xA675, 0xA67A, 0xA677, 0xA679, 0xA67C, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_D0[] = {
0, 0x2727, 0xA742, 0xA743, 0xA744, 0xA745, 0xA746, 0xA747,
0xA748, 0xA749, 0xA74A, 0xA74B, 0xA74C, 0, 0xA74D, 0xA74E,
@@ -2579,6 +3818,26 @@ static const unsigned short utf8_to_euc_D1[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E1B8_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0x2872, 0x2873,
+};
+static const unsigned short utf8_to_euc_E1BD_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0x2B46, 0x2B47, 0x2B50, 0x2B51, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E280[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2609,6 +3868,36 @@ static const unsigned short utf8_to_euc_E280_932[] = {
0x2273, 0, 0x216C, 0x216D, 0, 0, 0, 0,
0, 0, 0, 0x2228, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E280_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0x213E, 0, 0, 0x237C, 0x213D, 0x213D, 0x2142, 0,
+ 0x2146, 0x2147, 0, 0, 0x2148, 0x2149, 0, 0,
+ 0x2277, 0x2278, 0x2340, 0, 0, 0x2145, 0x2144, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0x2273, 0, 0x216C, 0x216D, 0, 0, 0, 0,
+ 0, 0, 0, 0x2228, 0x286B, 0, 0x2131, 0x2B58,
+};
+static const unsigned short utf8_to_euc_E281_x0213[] = {
+ 0, 0, 0x2C7E, 0, 0, 0, 0, 0x286C,
+ 0x286D, 0x286E, 0, 0, 0, 0, 0, 0,
+ 0, 0x2C7D, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E282_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0x2921, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E284[] = {
0, 0, 0, 0x216E, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2629,6 +3918,16 @@ static const unsigned short utf8_to_euc_E284_mac[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E284_x0213[] = {
+ 0, 0, 0, 0x216E, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0x235D,
+ 0, 0, 0, 0x235F, 0, 0, 0x2D62, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0x2D64, 0xA26F, 0, 0, 0, 0, 0x2360,
+ 0, 0, 0, 0x2272, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0x235C, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E285[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2649,6 +3948,16 @@ static const unsigned short utf8_to_euc_E285_mac[] = {
0x2A35, 0x2A36, 0x2A37, 0x2A38, 0x2A39, 0x2A3A, 0x2A3B, 0x2A3C,
0x2A3D, 0x2A3E, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E285_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0x2778, 0x2779, 0x277A, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0x2D35, 0x2D36, 0x2D37, 0x2D38, 0x2D39, 0x2D3A, 0x2D3B, 0x2D3C,
+ 0x2D3D, 0x2D3E, 0x2D3F, 0x2D57, 0, 0, 0, 0,
+ 0x2C35, 0x2C36, 0x2C37, 0x2C38, 0x2C39, 0x2C3A, 0x2C3B, 0x2C3C,
+ 0x2C3D, 0x2C3E, 0x2C3F, 0x2C40, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E286[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2659,6 +3968,16 @@ static const unsigned short utf8_to_euc_E286[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E286_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0x222B, 0x222C, 0x222A, 0x222D, 0x2271, 0, 0x2327, 0x2325,
+ 0x2326, 0x2328, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E287[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2669,6 +3988,16 @@ static const unsigned short utf8_to_euc_E287[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E287_x0213[] = {
+ 0, 0, 0, 0, 0x2329, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0x224D, 0, 0x224E, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0x232B, 0x232C,
+ 0x232A, 0x232D, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E288[] = {
0x224F, 0, 0x225F, 0x2250, 0, 0, 0, 0x2260,
0x223A, 0, 0, 0x223B, 0, 0, 0, 0,
@@ -2699,6 +4028,16 @@ static const unsigned short utf8_to_euc_E288_mac[] = {
0, 0, 0, 0, 0x2168, 0x2268, 0, 0,
0, 0, 0, 0, 0, 0x2266, 0, 0,
};
+static const unsigned short utf8_to_euc_E288_x0213[] = {
+ 0x224F, 0, 0x225F, 0x2250, 0, 0x2247, 0, 0x2260,
+ 0x223A, 0x2246, 0, 0x223B, 0, 0, 0, 0,
+ 0, 0x2D74, 0x215D, 0x235B, 0, 0, 0, 0,
+ 0, 0, 0x2265, 0, 0, 0x2267, 0x2167, 0x2D78,
+ 0x225C, 0, 0, 0, 0, 0x2254, 0x2255, 0x224A,
+ 0x224B, 0x2241, 0x2240, 0x2269, 0x226A, 0, 0x2D73, 0,
+ 0, 0, 0, 0, 0x2168, 0x2268, 0, 0,
+ 0, 0, 0, 0, 0, 0x2266, 0, 0,
+};
static const unsigned short utf8_to_euc_E289[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2709,6 +4048,16 @@ static const unsigned short utf8_to_euc_E289[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E289_x0213[] = {
+ 0, 0, 0, 0x226C, 0, 0x226D, 0, 0,
+ 0x226E, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0x2262, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0x2162, 0x2261, 0x226B, 0, 0, 0, 0x2165, 0x2166,
+ 0, 0, 0x2263, 0x2264, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0x226F, 0x2270,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E28A[] = {
0, 0, 0x223E, 0x223F, 0, 0, 0x223C, 0x223D,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2729,6 +4078,26 @@ static const unsigned short utf8_to_euc_E28A_mac[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0x2F23,
};
+static const unsigned short utf8_to_euc_E28A_x0213[] = {
+ 0, 0, 0x223E, 0x223F, 0x2242, 0x2243, 0x223C, 0x223D,
+ 0, 0, 0x2244, 0x2245, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0x2251, 0x2252, 0x2253,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0x225D, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0x2D79,
+};
+static const unsigned short utf8_to_euc_E28B_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0x2776, 0x2777, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E28C[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2739,6 +4108,46 @@ static const unsigned short utf8_to_euc_E28C[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E28C_x0213[] = {
+ 0, 0, 0, 0, 0, 0x2248, 0x2249, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0x225E, 0, 0, 0, 0, 0,
+ 0x277C, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E28E_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0x2742, 0x2743,
+};
+static const unsigned short utf8_to_euc_E28F_x0213[] = {
+ 0x2744, 0x2745, 0x2746, 0x2747, 0x2748, 0x2749, 0x274A, 0x274B,
+ 0x274C, 0x274D, 0x274E, 0x274F, 0x2750, 0, 0x277E, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E290_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0x277D, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E291[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2759,6 +4168,16 @@ static const unsigned short utf8_to_euc_E291_mac[] = {
0x2931, 0x2932, 0x2933, 0x2934, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E293_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0x2C41, 0x2C42, 0x2C43, 0x2C44, 0x2C45, 0x2C46, 0x2C47, 0x2C48,
+ 0x2C49, 0x2C4A, 0x2C4B, 0x2C4C, 0x2C4D, 0x2C4E, 0x2C4F, 0x2C50,
+ 0x2C51, 0x2C52, 0x2C53, 0x2C54, 0x2C55, 0x2C56, 0x2C57, 0x2C58,
+ 0x2C59, 0x2C5A, 0, 0x2C2B, 0x2C2C, 0x2C2D, 0x2C2E, 0x2C2F,
+ 0x2C30, 0x2C31, 0x2C32, 0x2C33, 0x2C34, 0x265A, 0x265B, 0x265C,
+ 0x265D, 0x265E, 0x265F, 0x2660, 0x2661, 0x2662, 0x2663, 0,
+};
static const unsigned short utf8_to_euc_E294[] = {
0x2821, 0x282C, 0x2822, 0x282D, 0, 0, 0, 0,
0, 0, 0, 0, 0x2823, 0, 0, 0x282E,
@@ -2789,6 +4208,16 @@ static const unsigned short utf8_to_euc_E296[] = {
0, 0, 0x2225, 0x2224, 0, 0, 0, 0,
0, 0, 0, 0, 0x2227, 0x2226, 0, 0,
};
+static const unsigned short utf8_to_euc_E296_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0x2223, 0x2222, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0x266D, 0x2225, 0x2224, 0, 0, 0x2322, 0x2321,
+ 0, 0, 0, 0, 0x2227, 0x2226, 0, 0,
+};
static const unsigned short utf8_to_euc_E297[] = {
0, 0, 0, 0, 0, 0, 0x2221, 0x217E,
0, 0, 0, 0x217B, 0, 0, 0x217D, 0x217C,
@@ -2799,6 +4228,16 @@ static const unsigned short utf8_to_euc_E297[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E297_x0213[] = {
+ 0x2324, 0x2323, 0, 0, 0, 0, 0x2221, 0x217E,
+ 0, 0x233B, 0, 0x217B, 0, 0, 0x217D, 0x217C,
+ 0x2867, 0x2868, 0x2869, 0x286A, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0x233F, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0x227E,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E298[] = {
0, 0, 0, 0, 0, 0x217A, 0x2179, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2809,6 +4248,16 @@ static const unsigned short utf8_to_euc_E298[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E298_x0213[] = {
+ 0x2668, 0x2669, 0x266A, 0x266B, 0, 0x217A, 0x2179, 0,
+ 0, 0, 0, 0, 0, 0, 0x2667, 0,
+ 0, 0, 0, 0, 0, 0, 0x2664, 0x2665,
+ 0, 0, 0, 0, 0, 0, 0x2D7E, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E299[] = {
0x216A, 0, 0x2169, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2819,6 +4268,66 @@ static const unsigned short utf8_to_euc_E299[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E299_x0213[] = {
+ 0x216A, 0, 0x2169, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0x263A, 0x263D, 0x263B, 0x2640, 0x2639, 0x263E, 0x263C, 0x263F,
+ 0x266C, 0x227D, 0x2276, 0x227B, 0x227C, 0x2275, 0x227A, 0x2274,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E29C_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0x277B, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E29D_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0x2D7D, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0x2C21, 0x2C22,
+ 0x2C23, 0x2C24, 0x2C25, 0x2C26, 0x2C27, 0x2C28, 0x2C29, 0x2C2A,
+};
+static const unsigned short utf8_to_euc_E2A4_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0x232E, 0x232F, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E2A6_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0x233A,
+};
+static const unsigned short utf8_to_euc_E2A7_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0x237D, 0x237E, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E380[] = {
0x2121, 0x2122, 0x2123, 0x2137, 0, 0x2139, 0x213A, 0x213B,
0x2152, 0x2153, 0x2154, 0x2155, 0x2156, 0x2157, 0x2158, 0x2159,
@@ -2839,6 +4348,16 @@ static const unsigned short utf8_to_euc_E380_932[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E380_x0213[] = {
+ 0x2121, 0x2122, 0x2123, 0x2137, 0, 0x2139, 0x213A, 0x213B,
+ 0x2152, 0x2153, 0x2154, 0x2155, 0x2156, 0x2157, 0x2158, 0x2159,
+ 0x215A, 0x215B, 0x2229, 0x222E, 0x214C, 0x214D, 0x225A, 0x225B,
+ 0x2258, 0x2259, 0, 0, 0x2141, 0x2D60, 0, 0x2D61,
+ 0x2666, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0x2233, 0x2234, 0x2235, 0, 0,
+ 0, 0, 0, 0x2236, 0x2237, 0x233C, 0, 0,
+};
static const unsigned short utf8_to_euc_E381[] = {
0, 0x2421, 0x2422, 0x2423, 0x2424, 0x2425, 0x2426, 0x2427,
0x2428, 0x2429, 0x242A, 0x242B, 0x242C, 0x242D, 0x242E, 0x242F,
@@ -2869,6 +4388,16 @@ static const unsigned short utf8_to_euc_E382_932[] = {
0x2530, 0x2531, 0x2532, 0x2533, 0x2534, 0x2535, 0x2536, 0x2537,
0x2538, 0x2539, 0x253A, 0x253B, 0x253C, 0x253D, 0x253E, 0x253F,
};
+static const unsigned short utf8_to_euc_E382_x0213[] = {
+ 0x2460, 0x2461, 0x2462, 0x2463, 0x2464, 0x2465, 0x2466, 0x2467,
+ 0x2468, 0x2469, 0x246A, 0x246B, 0x246C, 0x246D, 0x246E, 0x246F,
+ 0x2470, 0x2471, 0x2472, 0x2473, 0x2474, 0x2475, 0x2476, 0,
+ 0, 0, 0, 0x212B, 0x212C, 0x2135, 0x2136, 0x2239,
+ 0x237B, 0x2521, 0x2522, 0x2523, 0x2524, 0x2525, 0x2526, 0x2527,
+ 0x2528, 0x2529, 0x252A, 0x252B, 0x252C, 0x252D, 0x252E, 0x252F,
+ 0x2530, 0x2531, 0x2532, 0x2533, 0x2534, 0x2535, 0x2536, 0x2537,
+ 0x2538, 0x2539, 0x253A, 0x253B, 0x253C, 0x253D, 0x253E, 0x253F,
+};
static const unsigned short utf8_to_euc_E383[] = {
0x2540, 0x2541, 0x2542, 0x2543, 0x2544, 0x2545, 0x2546, 0x2547,
0x2548, 0x2549, 0x254A, 0x254B, 0x254C, 0x254D, 0x254E, 0x254F,
@@ -2879,6 +4408,26 @@ static const unsigned short utf8_to_euc_E383[] = {
0x2570, 0x2571, 0x2572, 0x2573, 0x2574, 0x2575, 0x2576, 0,
0, 0, 0, 0x2126, 0x213C, 0x2133, 0x2134, 0,
};
+static const unsigned short utf8_to_euc_E383_x0213[] = {
+ 0x2540, 0x2541, 0x2542, 0x2543, 0x2544, 0x2545, 0x2546, 0x2547,
+ 0x2548, 0x2549, 0x254A, 0x254B, 0x254C, 0x254D, 0x254E, 0x254F,
+ 0x2550, 0x2551, 0x2552, 0x2553, 0x2554, 0x2555, 0x2556, 0x2557,
+ 0x2558, 0x2559, 0x255A, 0x255B, 0x255C, 0x255D, 0x255E, 0x255F,
+ 0x2560, 0x2561, 0x2562, 0x2563, 0x2564, 0x2565, 0x2566, 0x2567,
+ 0x2568, 0x2569, 0x256A, 0x256B, 0x256C, 0x256D, 0x256E, 0x256F,
+ 0x2570, 0x2571, 0x2572, 0x2573, 0x2574, 0x2575, 0x2576, 0x2772,
+ 0x2773, 0x2774, 0x2775, 0x2126, 0x213C, 0x2133, 0x2134, 0x2238,
+};
+static const unsigned short utf8_to_euc_E387_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0x266E, 0x266F, 0x2670, 0x2671, 0x2672, 0x2673, 0x2674, 0x2675,
+ 0x2676, 0x2677, 0x2679, 0x267A, 0x267B, 0x267C, 0x267D, 0x267E,
+};
static const unsigned short utf8_to_euc_E388[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2899,6 +4448,16 @@ static const unsigned short utf8_to_euc_E388_mac[] = {
0, 0x2D2E, 0x2D31, 0, 0, 0, 0, 0,
0, 0x2D2C, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E389_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0x2841, 0x2842, 0x2843, 0x2844, 0x2845, 0x2846, 0x2847,
+ 0x2848, 0x2849, 0x284A, 0x284B, 0x284C, 0x284D, 0x284E, 0x284F,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E38A[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -2919,6 +4478,26 @@ static const unsigned short utf8_to_euc_E38A_mac[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E38A_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0x2D65, 0x2D66, 0x2D67, 0x2D68,
+ 0x2D69, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0x2850, 0x2851, 0x2852, 0x2853, 0x2854, 0x2855, 0x2856,
+ 0x2857, 0x2858, 0x2859, 0x285A, 0x285B, 0x285C, 0x285D, 0x285E,
+};
+static const unsigned short utf8_to_euc_E38B_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0x2C5B, 0x2C5C, 0x2C5D, 0x2C5E, 0x2C5F, 0x2C60, 0x2C61, 0x2C62,
+ 0x2C63, 0x2C64, 0x2C65, 0x2C66, 0x2C67, 0x2C68, 0x2C69, 0x2C6A,
+ 0x2C6B, 0x2C6C, 0x2C6D, 0x2C6E, 0, 0x2C71, 0, 0,
+ 0, 0x2C70, 0, 0, 0x2C73, 0x2C72, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0x2C6F, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E38C[] = {
0, 0, 0, 0x2D46, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0x2D4A, 0, 0,
@@ -2999,6 +4578,796 @@ static const unsigned short utf8_to_euc_E38F_mac[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E38F_x0213[] = {
+ 0, 0, 0, 0, 0x2D55, 0, 0, 0,
+ 0, 0, 0, 0x235E, 0, 0x2D63, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E390_x0213[] = {
+ 0, 0, 0x2E23, 0, 0, 0, 0xA12D, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0xA132, 0, 0xA133, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E391_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0xA15E, 0, 0xA156, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E392_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0xA17E, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0x2E53, 0, 0,
+ 0, 0, 0, 0, 0xA32B, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E393_x0213[] = {
+ 0, 0xF468, 0, 0, 0, 0, 0, 0xA32F,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0x2E5B, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E394_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0xA348,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E395_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0xA35D, 0xA35E, 0,
+ 0, 0, 0, 0xA361, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0xA367, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E396_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0xA423, 0,
+ 0xA426, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E397_x0213[] = {
+ 0, 0, 0, 0, 0, 0xA42F, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0xA438, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0xA442, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E398_x0213[] = {
+ 0, 0, 0, 0, 0, 0xA44A, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E399_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0xA479, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E39A_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0xA53F, 0, 0, 0, 0, 0xA543, 0,
+ 0, 0xA541, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E39B_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0xA557,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E39D_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0xA823, 0xA825, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0xA829, 0xA828, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0xA82C, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E39E_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0x4F5F, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E39F_x0213[] = {
+ 0, 0xA83E, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0x4F6F, 0, 0, 0, 0, 0,
+ 0xA856, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0xA859, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0xA85C, 0, 0,
+};
+static const unsigned short utf8_to_euc_E3A0_x0213[] = {
+ 0xA85E, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0xA86F,
+ 0, 0, 0, 0, 0, 0, 0xA871, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E3A1_x0213[] = {
+ 0xA874, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0xA879, 0, 0, 0,
+ 0, 0xA87B, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E3A3_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0xAC3B, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E3A4_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0xAC46,
+ 0, 0, 0xAC4A, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E3A5_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0xAC60,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E3A9_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0xAD5B, 0,
+ 0, 0, 0, 0xAD5F, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E3AB_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0xAD71, 0xAE36,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0xAD7C, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E3AC_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0xAE2E, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0xAE32, 0, 0xAE34, 0, 0, 0,
+ 0, 0, 0x7549, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E3AD_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0xAE6D, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0xAE65,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E3AE_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0xAF28,
+ 0xAF29, 0, 0, 0, 0, 0xAF2C, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0xAF34, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0x757E, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E3AF_x0213[] = {
+ 0, 0, 0, 0x7621, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0xAF48, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0xAF5D, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E3B0_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0x763A,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0xAF77, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E3B3_x0213[] = {
+ 0, 0, 0, 0xEE3B, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0xEE42, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E3B4_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0xEE71, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0xEE7E, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E3B5_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0xEF40, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E3B6_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0xEF54, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E3B7_x0213[] = {
+ 0xEF70, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0xEF77, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E3B8_x0213[] = {
+ 0, 0, 0, 0, 0, 0xF028, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0x7766,
+};
+static const unsigned short utf8_to_euc_E3B9_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0xF03F, 0, 0, 0, 0, 0, 0xF041, 0,
+ 0xF042, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E3BA_x0213[] = {
+ 0, 0, 0, 0xF049, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0xF050, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E3BD_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0xF134,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0x784D, 0, 0, 0xF146, 0, 0xF148,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E3BE_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0xF15C, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E3BF_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0xF167, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0xF16C,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E480_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0xF222, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E481_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0xF22D, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E482_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0xF239, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E484_x0213[] = {
+ 0, 0, 0, 0, 0, 0xF264, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E485_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0xF274, 0, 0, 0, 0, 0, 0, 0xF277,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0xF27D, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E486_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0xF333, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0xF337,
+};
+static const unsigned short utf8_to_euc_E487_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0xF347, 0,
+ 0, 0, 0, 0, 0, 0, 0xF34B, 0,
+ 0, 0, 0, 0xF348, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E488_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0xF353,
+ 0, 0, 0, 0, 0, 0, 0xF357, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E489_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0x796D, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E48B_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0xF42B, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0xF436, 0,
+ 0, 0, 0, 0, 0, 0xF43B, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E48C_x0213[] = {
+ 0, 0, 0xF44E, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0xF45D, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E48D_x0213[] = {
+ 0, 0, 0, 0xF461, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E48F_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0xF53E, 0,
+ 0xF542, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E490_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0xF548, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0xF54A,
+ 0, 0, 0, 0, 0xF54C, 0, 0, 0,
+ 0, 0, 0xF54F, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E491_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0x7A59, 0, 0, 0, 0,
+ 0, 0, 0, 0x7A5A, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0xF56C, 0,
+ 0, 0, 0xF56E, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E492_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0xF577, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0xF635, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0xF632, 0,
+};
+static const unsigned short utf8_to_euc_E493_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0xF634, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E494_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0xF659, 0, 0, 0, 0, 0xF654, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0xF66D, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E495_x0213[] = {
+ 0, 0, 0, 0xF66E, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E496_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0x7B51, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0xF74F, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E497_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0xF76C, 0, 0,
+ 0, 0, 0x7B60, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E498_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0xF824,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E499_x0213[] = {
+ 0, 0xF83A, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0xF843, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E49A_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0xF84E, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0xF853,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E49C_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0xF86B, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E49D_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0xF929, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E49F_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0xF93F, 0, 0,
+};
+static const unsigned short utf8_to_euc_E4A0_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0xF949, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E4A1_x0213[] = {
+ 0, 0, 0, 0, 0x7C4B, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0xF95C, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E4A2_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0xFA27, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E4A6_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0x7D58, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E4A7_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0xFB6A,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0xFB70, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E4A8_x0213[] = {
+ 0, 0, 0, 0, 0xFB75, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0xFB78, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E4AA_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0xFC37, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E4AC_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0xFC55, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E4AF_x0213[] = {
+ 0, 0, 0xFD26, 0, 0, 0, 0, 0,
+ 0, 0, 0xFD28, 0, 0, 0, 0, 0,
+ 0, 0, 0xFD2A, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0xFD31, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E4B0_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0x7E3E,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0xFD3F, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E4B3_x0213[] = {
+ 0, 0, 0, 0, 0xFE2A, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0xFE2D, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E4B4_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0xFE4B,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_E4B5_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0xFE60,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E4B8[] = {
0x306C, 0x437A, 0xB021, 0x3C37, 0xB022, 0xB023, 0, 0x4B7C,
0x3E66, 0x3B30, 0x3E65, 0x323C, 0xB024, 0x4954, 0x4D3F, 0,
@@ -3009,6 +5378,16 @@ static const unsigned short utf8_to_euc_E4B8[] = {
0xB02D, 0x5025, 0x367A, 0, 0, 0xB02E, 0x5026, 0,
0x345D, 0x4330, 0, 0x3C67, 0x5027, 0, 0, 0x5028,
};
+static const unsigned short utf8_to_euc_E4B8_x0213[] = {
+ 0x306C, 0x437A, 0xA122, 0x3C37, 0xB022, 0xB023, 0, 0x4B7C,
+ 0x3E66, 0x3B30, 0x3E65, 0x323C, 0xB024, 0x4954, 0x4D3F, 0xA123,
+ 0x5022, 0x312F, 0xA124, 0, 0x336E, 0x5023, 0x4024, 0x5242,
+ 0x3556, 0x4A3A, 0, 0, 0, 0, 0x3E67, 0xB026,
+ 0, 0x4E3E, 0, 0xB027, 0xB028, 0, 0x4A42, 0,
+ 0x2E24, 0xA125, 0x5024, 0xA126, 0xF02E, 0x4366, 0xA127, 0x2E25,
+ 0x2E26, 0x5025, 0x367A, 0, 0, 0xB02E, 0x5026, 0,
+ 0x345D, 0x4330, 0, 0x3C67, 0x5027, 0, 0, 0x5028,
+};
static const unsigned short utf8_to_euc_E4B9[] = {
0xB02F, 0xB030, 0x5029, 0x4735, 0xB031, 0x3557, 0, 0xB032,
0, 0, 0, 0x4737, 0, 0x4663, 0x3843, 0x4B33,
@@ -3019,6 +5398,16 @@ static const unsigned short utf8_to_euc_E4B9[] = {
0, 0x4D70, 0, 0x467D, 0xB039, 0xB03A, 0, 0,
0, 0xB03B, 0, 0, 0, 0, 0x3425, 0xB03C,
};
+static const unsigned short utf8_to_euc_E4B9_x0213[] = {
+ 0xA128, 0xB030, 0x5029, 0x4735, 0xB031, 0x3557, 0, 0xA129,
+ 0xA12A, 0, 0, 0x4737, 0, 0x4663, 0x3843, 0x4B33,
+ 0, 0xA12C, 0, 0, 0, 0x6949, 0x502A, 0x3E68,
+ 0x502B, 0x3235, 0xA12F, 0, 0xB035, 0x3665, 0x3870, 0x4C69,
+ 0, 0, 0x5626, 0xB036, 0, 0, 0, 0,
+ 0xB037, 0xA130, 0, 0, 0, 0, 0, 0,
+ 0, 0x4D70, 0, 0x467D, 0xB039, 0xB03A, 0, 0,
+ 0, 0xB03B, 0, 0, 0, 0, 0x3425, 0xB03C,
+};
static const unsigned short utf8_to_euc_E4BA[] = {
0x3535, 0, 0x502C, 0, 0, 0x502D, 0x4E3B, 0,
0x4D3D, 0x4168, 0x502F, 0x3B76, 0x4673, 0xB03D, 0x5032, 0,
@@ -3029,6 +5418,16 @@ static const unsigned short utf8_to_euc_E4BA[] = {
0x5037, 0, 0, 0x5038, 0, 0, 0x5039, 0,
0, 0xB042, 0x3F4D, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E4BA_x0213[] = {
+ 0x3535, 0, 0x502C, 0, 0, 0x502D, 0x4E3B, 0,
+ 0x4D3D, 0x4168, 0x502F, 0x3B76, 0x4673, 0x2E27, 0x5032, 0,
+ 0, 0x313E, 0x385F, 0, 0x385E, 0x3066, 0xB03E, 0xB03F,
+ 0x4F4B, 0x4F4A, 0, 0x3A33, 0x3021, 0xA131, 0x5033, 0x5034,
+ 0x5035, 0x4B34, 0x5036, 0, 0x3872, 0x3067, 0x4B72, 0,
+ 0x357C, 0, 0, 0x357D, 0x357E, 0x4462, 0x4E3C, 0xB041,
+ 0x5037, 0, 0, 0x5038, 0, 0, 0x5039, 0,
+ 0, 0xA134, 0x3F4D, 0xA135, 0xA137, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E4BB[] = {
0x3D3A, 0x3F4E, 0x503E, 0xB043, 0x503C, 0, 0x503D, 0x3558,
0, 0, 0x3A23, 0x3270, 0, 0x503B, 0x503A, 0x4A29,
@@ -3039,6 +5438,16 @@ static const unsigned short utf8_to_euc_E4BB[] = {
0x3644, 0xB04C, 0x4367, 0xB04D, 0, 0xB04E, 0x376F, 0x5043,
0, 0, 0, 0x4724, 0xF42F, 0xB04F, 0xB050, 0xB051,
};
+static const unsigned short utf8_to_euc_E4BB_x0213[] = {
+ 0x3D3A, 0x3F4E, 0x503E, 0xA138, 0x503C, 0, 0x503D, 0x3558,
+ 0xA139, 0, 0x3A23, 0x3270, 0, 0x503B, 0x503A, 0x4A29,
+ 0xA13A, 0, 0, 0, 0x3B46, 0x3B45, 0x423E, 0x503F,
+ 0x4955, 0x4067, 0xA13C, 0xB046, 0, 0x2138, 0x5040, 0x5042,
+ 0xB047, 0x2E28, 0xB049, 0x4265, 0x4E61, 0x304A, 0, 0,
+ 0xB04A, 0, 0, 0xA13B, 0, 0x5041, 0x323E, 0xB04B,
+ 0x3644, 0xA13D, 0x4367, 0xB04D, 0, 0xA13E, 0x376F, 0x5043,
+ 0, 0, 0, 0x4724, 0xF42F, 0x2E29, 0xB050, 0x2E2A,
+};
static const unsigned short utf8_to_euc_E4BC[] = {
0xB052, 0x346B, 0xB053, 0xB054, 0, 0, 0, 0,
0xB055, 0x5044, 0x304B, 0xB056, 0xB057, 0x3860, 0x346C, 0x497A,
@@ -3049,6 +5458,16 @@ static const unsigned short utf8_to_euc_E4BC[] = {
0x5046, 0xB05E, 0, 0xB060, 0x483C, 0xB061, 0x4E62, 0xB062,
0x3F2D, 0xB063, 0x3B47, 0xB064, 0x3B77, 0x3240, 0xB065, 0,
};
+static const unsigned short utf8_to_euc_E4BC_x0213[] = {
+ 0xA13F, 0x346B, 0xB053, 0x2E2B, 0, 0, 0, 0,
+ 0xB055, 0x5044, 0x304B, 0x2E2C, 0xB057, 0x3860, 0x346C, 0x497A,
+ 0x4832, 0x3559, 0xB058, 0, 0, 0xB059, 0xA140, 0xB05B,
+ 0, 0xB05C, 0x3271, 0, 0x5067, 0x4541, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0xB05D, 0x476C,
+ 0x5046, 0xB05E, 0, 0xB060, 0x483C, 0xB061, 0x4E62, 0xA142,
+ 0x3F2D, 0xB063, 0x3B47, 0xB064, 0x3B77, 0x3240, 0xA143, 0,
+};
static const unsigned short utf8_to_euc_E4BD[] = {
0xB066, 0, 0xB067, 0x4451, 0, 0, 0x4322, 0x504A,
0xB068, 0xB069, 0, 0xB06A, 0xB06B, 0x304C, 0x4463, 0x3D3B,
@@ -3059,6 +5478,16 @@ static const unsigned short utf8_to_euc_E4BD[] = {
0x5051, 0xB075, 0, 0x3242, 0, 0x4A3B, 0x504B, 0xB076,
0xB077, 0xB078, 0xB079, 0x504F, 0x3873, 0xB07A, 0xB07B, 0x3B48,
};
+static const unsigned short utf8_to_euc_E4BD_x0213[] = {
+ 0xB066, 0, 0xB067, 0x4451, 0, 0, 0x4322, 0x504A,
+ 0x2E2E, 0x2E2F, 0, 0xB06A, 0xB06B, 0x304C, 0x4463, 0x3D3B,
+ 0x3A34, 0x4D24, 0xB06C, 0x424E, 0xA144, 0x323F, 0x2E30, 0x5049,
+ 0xA145, 0x4D3E, 0x5045, 0x5047, 0x3A6E, 0x5048, 0x5524, 0x2E31,
+ 0x2E2D, 0, 0, 0xB071, 0xA141, 0, 0, 0,
+ 0, 0x5050, 0x2E32, 0, 0x2E33, 0, 0xB074, 0x5053,
+ 0x5051, 0xB075, 0, 0x3242, 0, 0x4A3B, 0x504B, 0xA147,
+ 0xA148, 0xB078, 0xA149, 0x504F, 0x3873, 0xA14A, 0x2E34, 0x3B48,
+};
static const unsigned short utf8_to_euc_E4BE[] = {
0, 0xB07C, 0xB07D, 0x3426, 0xB07E, 0xB121, 0x5054, 0,
0x504C, 0xB122, 0xB123, 0x4E63, 0xB124, 0x3B78, 0xB125, 0x504D,
@@ -3069,6 +5498,16 @@ static const unsigned short utf8_to_euc_E4BE[] = {
0, 0, 0xB12F, 0, 0, 0x3F2F, 0x4E37, 0xB130,
0, 0xB131, 0, 0xB132, 0xB133, 0xB134, 0xB135, 0x4A58,
};
+static const unsigned short utf8_to_euc_E4BE_x0213[] = {
+ 0, 0xB07C, 0xA14B, 0x3426, 0xB07E, 0xA14C, 0x5054, 0,
+ 0x504C, 0xB122, 0x2E35, 0x4E63, 0xB124, 0x3B78, 0xB125, 0x504D,
+ 0xB126, 0x5052, 0xA14D, 0xB128, 0x2E36, 0, 0x5055, 0x2E37,
+ 0x504E, 0xB12B, 0xA14E, 0x3621, 0, 0x304D, 0xB12D, 0xB12E,
+ 0x3622, 0x3241, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0x5525, 0, 0x4B79, 0x496E, 0x3874,
+ 0, 0, 0xA150, 0, 0, 0x3F2F, 0x4E37, 0xB130,
+ 0, 0xB131, 0, 0xB132, 0xB133, 0xB134, 0xA151, 0x4A58,
+};
static const unsigned short utf8_to_euc_E4BF[] = {
0xB136, 0xB137, 0x3738, 0x4225, 0x3264, 0xB138, 0xB139, 0,
0xB13A, 0xB13B, 0x3D53, 0xB13C, 0xB13D, 0xB13E, 0x5059, 0xB13F,
@@ -3079,6 +5518,16 @@ static const unsigned short utf8_to_euc_E4BF[] = {
0xB144, 0, 0xB145, 0x4750, 0, 0x4936, 0x5068, 0,
0x4A70, 0, 0x3236, 0, 0xB146, 0xB147, 0x506C, 0xB148,
};
+static const unsigned short utf8_to_euc_E4BF_x0213[] = {
+ 0xB136, 0xB137, 0x3738, 0x4225, 0x3264, 0xA152, 0xB139, 0,
+ 0xB13A, 0x2E39, 0x3D53, 0xA153, 0xB13D, 0xB13E, 0x5059, 0xA154,
+ 0x505E, 0x505C, 0xA155, 0, 0x5057, 0, 0, 0x422F,
+ 0x505A, 0, 0x505D, 0x505B, 0xB141, 0x4A5D, 0, 0x5058,
+ 0x2E3A, 0x3F2E, 0xB143, 0x4B73, 0x505F, 0x5060, 0xA14F, 0,
+ 0, 0, 0, 0, 0, 0, 0x3D24, 0x506D,
+ 0xB144, 0x2E21, 0xA157, 0x4750, 0, 0x4936, 0x5068, 0,
+ 0x4A70, 0, 0x3236, 0, 0xB146, 0xB147, 0x506C, 0xB148,
+};
static const unsigned short utf8_to_euc_E580[] = {
0xB149, 0xB14A, 0, 0, 0xB14B, 0x5066, 0x506F, 0xB14C,
0, 0x4152, 0xB14D, 0x3844, 0xB14E, 0x475C, 0xB14F, 0x6047,
@@ -3089,6 +5538,16 @@ static const unsigned short utf8_to_euc_E580[] = {
0xB15B, 0, 0xB15C, 0xB15D, 0, 0xB15E, 0x3666, 0,
0, 0x3770, 0, 0xB176, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E580_x0213[] = {
+ 0xA158, 0x2E3B, 0x2E3C, 0, 0xB14B, 0x5066, 0x506F, 0xB14C,
+ 0, 0x4152, 0xB14D, 0x3844, 0xB14E, 0x475C, 0x2E3D, 0x6047,
+ 0xA159, 0x506E, 0x455D, 0xA15A, 0x5063, 0, 0x3876, 0xB152,
+ 0x2E3E, 0x3875, 0x5061, 0xB154, 0xA15B, 0xB156, 0xA15C, 0x3C5A,
+ 0, 0x5069, 0xA15D, 0x4A6F, 0x434D, 0x5065, 0x3771, 0x2E3F,
+ 0x5062, 0x506A, 0x5064, 0x4E51, 0x506B, 0x4F41, 0x2E40, 0,
+ 0xB15B, 0, 0xB15C, 0xB15D, 0, 0xB15E, 0x3666, 0,
+ 0, 0x3770, 0, 0x2E42, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E581[] = {
0xB15F, 0xB160, 0xB161, 0x5070, 0, 0xB162, 0xB163, 0x5071,
0x5075, 0x304E, 0xB164, 0, 0xB165, 0, 0xB166, 0x4A50,
@@ -3099,6 +5558,16 @@ static const unsigned short utf8_to_euc_E581[] = {
0xB174, 0xB175, 0x3C45, 0, 0x4226, 0x4465, 0x3676, 0,
0x5079, 0, 0, 0, 0, 0x3536, 0, 0,
};
+static const unsigned short utf8_to_euc_E581_x0213[] = {
+ 0x2E41, 0x2E43, 0xA15F, 0x5070, 0, 0xB162, 0xA160, 0x5071,
+ 0x5075, 0x304E, 0xB164, 0, 0xB165, 0, 0xA161, 0x4A50,
+ 0x5074, 0xB167, 0xB168, 0xA162, 0, 0x5073, 0x5077, 0xA163,
+ 0, 0xB16B, 0x5076, 0, 0x4464, 0, 0, 0xB16C,
+ 0xB16D, 0, 0xB16E, 0xA164, 0, 0x3772, 0xA165, 0xB171,
+ 0, 0, 0xA166, 0, 0x5078, 0xB173, 0, 0,
+ 0xA167, 0xB175, 0x3C45, 0, 0x4226, 0x4465, 0x3676, 0,
+ 0x5079, 0, 0, 0, 0, 0x3536, 0, 0,
+};
static const unsigned short utf8_to_euc_E582[] = {
0x507A, 0xB177, 0, 0xB178, 0xB179, 0x507C, 0xB17A, 0,
0, 0, 0xB17B, 0, 0, 0x4B35, 0xB17C, 0xB17D,
@@ -3109,6 +5578,16 @@ static const unsigned short utf8_to_euc_E582[] = {
0xB22E, 0, 0x507E, 0x5123, 0x507D, 0x3A44, 0, 0x3D7D,
0, 0xB22F, 0xB230, 0, 0, 0xB231, 0x3739, 0,
};
+static const unsigned short utf8_to_euc_E582_x0213[] = {
+ 0x507A, 0xB177, 0, 0xB178, 0xB179, 0x507C, 0xB17A, 0,
+ 0xA169, 0, 0xB17B, 0, 0, 0x4B35, 0xB17C, 0xB17D,
+ 0xB17E, 0x3766, 0xA16A, 0xA16B, 0x2E44, 0xA16C, 0xA16D, 0,
+ 0x3B31, 0x4877, 0x507B, 0xB225, 0xA16E, 0, 0xB227, 0xB228,
+ 0xB229, 0xB22A, 0xB22B, 0xA168, 0, 0, 0, 0,
+ 0, 0, 0xA16F, 0, 0x3A45, 0x4D43, 0, 0xB22D,
+ 0xB22E, 0xA171, 0x507E, 0x5123, 0x507D, 0x3A44, 0, 0x3D7D,
+ 0, 0xB22F, 0xA172, 0xA173, 0, 0xB231, 0x3739, 0,
+};
static const unsigned short utf8_to_euc_E583[] = {
0xB232, 0, 0x5124, 0xB233, 0xB234, 0x364F, 0, 0xB235,
0, 0x5121, 0x5122, 0, 0xB236, 0x462F, 0xB237, 0x417C,
@@ -3119,6 +5598,16 @@ static const unsigned short utf8_to_euc_E583[] = {
0, 0xB245, 0xB251, 0, 0xF430, 0x512C, 0xB246, 0,
0, 0x512B, 0xB247, 0x4A48, 0, 0, 0xB248, 0,
};
+static const unsigned short utf8_to_euc_E583_x0213[] = {
+ 0xB232, 0, 0x5124, 0xB233, 0xA174, 0x364F, 0, 0xA175,
+ 0, 0x5121, 0x5122, 0, 0x2E45, 0x462F, 0xA178, 0x417C,
+ 0x2E47, 0x3623, 0, 0xB239, 0xA17A, 0x4B4D, 0x5125, 0,
+ 0xB23B, 0xA17B, 0x4E3D, 0, 0xB23C, 0xB23D, 0x5126, 0xB23E,
+ 0, 0xA17C, 0xB23F, 0x5129, 0xB240, 0x5127, 0x2E48, 0x414E,
+ 0xB242, 0xA17D, 0, 0, 0, 0x5128, 0x512A, 0xB244,
+ 0, 0xB245, 0x2E46, 0xA176, 0xF430, 0x512C, 0xB246, 0,
+ 0, 0x512B, 0xB247, 0x4A48, 0, 0, 0xB248, 0,
+};
static const unsigned short utf8_to_euc_E584[] = {
0x3537, 0x512E, 0x512F, 0xB249, 0x322F, 0, 0xB24A, 0xB24B,
0xB24C, 0x512D, 0, 0xB24D, 0xB24E, 0xB24F, 0xB250, 0,
@@ -3129,6 +5618,16 @@ static const unsigned short utf8_to_euc_E584[] = {
0, 0xB25F, 0x4C59, 0xB260, 0xB261, 0xB262, 0, 0x5136,
0xB263, 0xB264, 0x5135, 0x5138, 0x5137, 0, 0, 0x5139,
};
+static const unsigned short utf8_to_euc_E584_x0213[] = {
+ 0x3537, 0x512E, 0x512F, 0x2E4B, 0x322F, 0, 0x2E4A, 0xB24B,
+ 0xA321, 0x512D, 0, 0x2E4C, 0xB24E, 0xB24F, 0xB250, 0,
+ 0xB252, 0, 0x3C74, 0, 0x5132, 0x5131, 0x5130, 0xA323,
+ 0x5056, 0xB254, 0x5133, 0xA324, 0xB256, 0xB257, 0x2E4D, 0x3D7E,
+ 0, 0x5134, 0, 0xB259, 0, 0, 0, 0xB25A,
+ 0xB25B, 0, 0x4D25, 0, 0xB25C, 0xB25D, 0, 0xB25E,
+ 0, 0xB25F, 0x4C59, 0xB260, 0xB261, 0x2E4E, 0, 0x5136,
+ 0xB263, 0xB264, 0x5135, 0x5138, 0x5137, 0, 0, 0x5139,
+};
static const unsigned short utf8_to_euc_E585[] = {
0x513A, 0x3074, 0xB265, 0x3835, 0x373B, 0x3D3C, 0x437B, 0x3624,
0x4068, 0x3877, 0xB266, 0x396E, 0x513C, 0x4C48, 0x4546, 0xB267,
@@ -3139,6 +5638,16 @@ static const unsigned short utf8_to_euc_E585[] = {
0, 0x3626, 0, 0, 0, 0x4A3C, 0x4236, 0x3671,
0x4535, 0, 0, 0, 0x3773, 0, 0xB26F, 0,
};
+static const unsigned short utf8_to_euc_E585_x0213[] = {
+ 0x513A, 0x3074, 0xB265, 0x3835, 0x373B, 0x3D3C, 0x437B, 0x3624,
+ 0x4068, 0x3877, 0x2E4F, 0x396E, 0x513C, 0x4C48, 0x4546, 0xB267,
+ 0x3B79, 0, 0x513B, 0xB268, 0x513D, 0x2E51, 0, 0x2E52,
+ 0xB26B, 0, 0x455E, 0, 0x3375, 0, 0, 0xB26C,
+ 0xA326, 0, 0x513E, 0, 0xB26D, 0x467E, 0xB26E, 0,
+ 0x4134, 0x5140, 0x5141, 0x482C, 0x3878, 0x4F3B, 0x5142, 0,
+ 0, 0x3626, 0, 0xA328, 0, 0x4A3C, 0x4236, 0x3671,
+ 0x4535, 0, 0, 0xF474, 0x3773, 0, 0xB26F, 0,
+};
static const unsigned short utf8_to_euc_E586[] = {
0x5143, 0, 0x5144, 0xB270, 0xB271, 0x4662, 0x315F, 0,
0, 0x5147, 0x3A7D, 0xB272, 0x5146, 0x3A46, 0xB273, 0x5148,
@@ -3149,6 +5658,16 @@ static const unsigned short utf8_to_euc_E586[] = {
0x5156, 0x5154, 0x5155, 0x5153, 0x3A63, 0x5157, 0x4C6A, 0x4E64,
0xB279, 0, 0xB27A, 0, 0xB27B, 0x5158, 0xB27C, 0xB27D,
};
+static const unsigned short utf8_to_euc_E586_x0213[] = {
+ 0x5143, 0, 0x5144, 0xA329, 0xB271, 0x4662, 0x315F, 0,
+ 0, 0x5147, 0x3A7D, 0xA32A, 0x5146, 0x3A46, 0xB273, 0x5148,
+ 0x666E, 0x5149, 0x4B41, 0x514A, 0, 0x514B, 0x514C, 0x3E69,
+ 0xA32C, 0x3C4C, 0, 0, 0, 0x2E54, 0, 0,
+ 0x3427, 0xB276, 0x514F, 0xA32D, 0x514D, 0x4C3D, 0x514E, 0,
+ 0x495A, 0x5150, 0x5151, 0x5152, 0x455F, 0xA32E, 0, 0,
+ 0x5156, 0x5154, 0x5155, 0x5153, 0x3A63, 0x5157, 0x4C6A, 0x4E64,
+ 0xB279, 0, 0xB27A, 0, 0xA330, 0x5158, 0xB27C, 0xB27D,
+};
static const unsigned short utf8_to_euc_E587[] = {
0, 0, 0xB27E, 0, 0x4028, 0x5159, 0x3D5A, 0,
0xB321, 0x515A, 0, 0x437C, 0x4E3F, 0x4560, 0, 0xB322,
@@ -3159,6 +5678,16 @@ static const unsigned short utf8_to_euc_E587[] = {
0x5160, 0x332E, 0xB32C, 0xB32D, 0xB32E, 0x5161, 0x3627, 0xB32F,
0x464C, 0x317A, 0x3D50, 0, 0, 0x4821, 0x5162, 0,
};
+static const unsigned short utf8_to_euc_E587_x0213[] = {
+ 0, 0, 0xB27E, 0x2E55, 0x4028, 0x5159, 0x3D5A, 0,
+ 0xB321, 0x515A, 0x2E56, 0x437C, 0x4E3F, 0x4560, 0, 0xB322,
+ 0, 0xB323, 0xB324, 0xB325, 0, 0xB326, 0x5245, 0,
+ 0xB327, 0, 0, 0x515B, 0x7425, 0x3645, 0x2E57, 0,
+ 0x515C, 0x4B5E, 0x2E58, 0, 0, 0xB32A, 0x3D68, 0x427C,
+ 0, 0x515E, 0x4664, 0, 0xF431, 0x515F, 0x2E59, 0,
+ 0x5160, 0x332E, 0xB32C, 0xA333, 0xA334, 0x5161, 0x3627, 0xB32F,
+ 0x464C, 0x317A, 0x3D50, 0, 0, 0x4821, 0x5162, 0,
+};
static const unsigned short utf8_to_euc_E588[] = {
0x4561, 0xB330, 0xB331, 0x3F4F, 0x5163, 0xB332, 0x4A2C, 0x405A,
0x3422, 0, 0x3429, 0x5164, 0, 0, 0x5166, 0,
@@ -3169,6 +5698,16 @@ static const unsigned short utf8_to_euc_E588[] = {
0x457E, 0xB33A, 0xB33B, 0x516A, 0, 0xB33C, 0x4029, 0x3A7E,
0x3774, 0x516B, 0x3B49, 0x396F, 0xB33D, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E588_x0213[] = {
+ 0x4561, 0x2E5A, 0xA335, 0x3F4F, 0x5163, 0xB332, 0x4A2C, 0x405A,
+ 0x3422, 0, 0x3429, 0x5164, 0, 0, 0x5166, 0,
+ 0, 0x373A, 0xA336, 0x2E5C, 0x5165, 0x2E5D, 0xA337, 0x4E73,
+ 0xB337, 0, 0, 0, 0, 0x3D69, 0, 0,
+ 0, 0, 0xB338, 0, 0x483D, 0x4A4C, 0, 0x5167,
+ 0xB339, 0x4D78, 0x5168, 0, 0, 0, 0x5169, 0,
+ 0x457E, 0xB33A, 0xB33B, 0x516A, 0, 0xB33C, 0x4029, 0x3A7E,
+ 0x3774, 0x516B, 0x3B49, 0x396F, 0xB33D, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E589[] = {
0, 0, 0, 0x4466, 0x516D, 0xB33E, 0, 0x4227,
0, 0xB33F, 0x3A6F, 0x516E, 0x516F, 0x4130, 0, 0x516C,
@@ -3179,6 +5718,16 @@ static const unsigned short utf8_to_euc_E589[] = {
0x3E6A, 0x517B, 0x3364, 0x5175, 0x5173, 0x414F, 0, 0xB34A,
0xB34B, 0xB34C, 0, 0, 0, 0x5177, 0, 0x5176,
};
+static const unsigned short utf8_to_euc_E589_x0213[] = {
+ 0, 0, 0, 0x4466, 0x516D, 0xB33E, 0, 0x4227,
+ 0, 0x2E5E, 0x3A6F, 0x516E, 0x516F, 0x4130, 0, 0x516C,
+ 0, 0, 0, 0, 0x5171, 0xA339, 0x4B36, 0x2E5F,
+ 0xB342, 0, 0xB343, 0x3964, 0xA33A, 0x2F7E, 0x5170, 0xB345,
+ 0xB346, 0x2E60, 0, 0x3775, 0x3A5E, 0x476D, 0xB348, 0,
+ 0, 0x5174, 0x5172, 0, 0xA33B, 0, 0xB349, 0x497B,
+ 0x3E6A, 0x517B, 0x3364, 0x5175, 0x5173, 0x414F, 0, 0xA33C,
+ 0xB34B, 0xB34C, 0, 0, 0, 0x5177, 0, 0x5176,
+};
static const unsigned short utf8_to_euc_E58A[] = {
0xB34D, 0, 0xB34E, 0x3344, 0, 0xB34F, 0, 0x3760,
0x517C, 0x4E2D, 0xB350, 0, 0xB351, 0x5178, 0, 0,
@@ -3189,6 +5738,16 @@ static const unsigned short utf8_to_euc_E58A[] = {
0xB35E, 0x4E65, 0, 0, 0x4F2B, 0x5225, 0xB35F, 0xB360,
0xB361, 0x387A, 0xB362, 0xB363, 0x5224, 0xB364, 0x332F, 0,
};
+static const unsigned short utf8_to_euc_E58A_x0213[] = {
+ 0xB34D, 0, 0xA33E, 0x3344, 0xA33D, 0xB34F, 0, 0x3760,
+ 0x517C, 0x4E2D, 0xB350, 0, 0xB351, 0x5178, 0, 0,
+ 0, 0x517D, 0x517A, 0x2E61, 0x5179, 0xB353, 0xB354, 0xB355,
+ 0xA340, 0, 0xB357, 0x4E4F, 0xB358, 0, 0, 0x3879,
+ 0x3243, 0, 0, 0x4E74, 0xA342, 0xB35A, 0xA343, 0xB35C,
+ 0, 0x3D75, 0x4558, 0x3965, 0x5222, 0x5223, 0, 0xA344,
+ 0xB35E, 0x4E65, 0, 0, 0x4F2B, 0x5225, 0xB35F, 0xB360,
+ 0xB361, 0x387A, 0xA345, 0xA346, 0x5224, 0xB364, 0x332F, 0,
+};
static const unsigned short utf8_to_euc_E58B[] = {
0xB365, 0x5226, 0, 0x4B56, 0xB366, 0x443C, 0xB367, 0x4D26,
0xB368, 0x4A59, 0, 0, 0xB369, 0x5227, 0, 0xB36A,
@@ -3199,6 +5758,16 @@ static const unsigned short utf8_to_euc_E58B[] = {
0xB376, 0xB377, 0x372E, 0x522E, 0xB378, 0x522F, 0xB379, 0xB37A,
0x5230, 0x5231, 0x3C5B, 0, 0, 0, 0x387B, 0x4C5E,
};
+static const unsigned short utf8_to_euc_E58B_x0213[] = {
+ 0xB365, 0x5226, 0, 0x4B56, 0xB366, 0x443C, 0xB367, 0x4D26,
+ 0x2E62, 0x4A59, 0xA347, 0, 0x2E64, 0x5227, 0, 0xB36A,
+ 0x2E65, 0xA349, 0x7055, 0, 0xB36C, 0x4630, 0x2E66, 0x5228,
+ 0x342A, 0x4C33, 0, 0x2E67, 0xB36F, 0x3E21, 0x5229, 0x4A67,
+ 0x522D, 0xB370, 0x402A, 0x522A, 0x3650, 0xB371, 0x522B, 0x342B,
+ 0xB372, 0xB373, 0xB374, 0, 0xB375, 0, 0, 0,
+ 0x2E69, 0xB377, 0x372E, 0x522E, 0xB378, 0x522F, 0xB379, 0xA34B,
+ 0x5230, 0x5231, 0x3C5B, 0x2E6A, 0, 0, 0x387B, 0x4C5E,
+};
static const unsigned short utf8_to_euc_E58C[] = {
0xB37B, 0x4C68, 0x4677, 0xB37C, 0, 0x4A71, 0x5232, 0xF432,
0x5233, 0, 0xB37D, 0xB37E, 0xB421, 0x5235, 0, 0x5237,
@@ -3209,6 +5778,16 @@ static const unsigned short utf8_to_euc_E58C[] = {
0xB430, 0x523C, 0xB431, 0x523D, 0, 0xB432, 0, 0,
0x523E, 0x4924, 0x3668, 0x3065, 0xB433, 0xB434, 0xB435, 0x463F,
};
+static const unsigned short utf8_to_euc_E58C_x0213[] = {
+ 0x2E6B, 0x4C68, 0x4677, 0xB37C, 0, 0x4A71, 0x5232, 0x2E6C,
+ 0x5233, 0, 0xA34C, 0xA34D, 0xB421, 0x5235, 0, 0x5237,
+ 0x5236, 0xB422, 0, 0xB423, 0, 0x5238, 0x323D, 0x4B4C,
+ 0xB424, 0x3A7C, 0x5239, 0xB425, 0x2E6D, 0x4159, 0xB427, 0xB428,
+ 0x3E22, 0x3629, 0, 0x523A, 0xA34E, 0xB429, 0, 0xB42A,
+ 0xB42B, 0xB42C, 0x485B, 0xB42D, 0xB42E, 0xB42F, 0, 0x523B,
+ 0xB430, 0x523C, 0xB431, 0x523D, 0, 0xA34F, 0, 0,
+ 0x523E, 0x4924, 0x3668, 0x3065, 0xB433, 0xB434, 0xA350, 0x463F,
+};
static const unsigned short utf8_to_euc_E58D[] = {
0x523F, 0x3D3D, 0xB436, 0x4069, 0, 0x5241, 0x5240, 0x3E23,
0x3861, 0x5243, 0x483E, 0xB438, 0xB437, 0x5244, 0, 0,
@@ -3219,6 +5798,16 @@ static const unsigned short utf8_to_euc_E58D[] = {
0x3075, 0x346D, 0xB440, 0x4228, 0x3551, 0x4D71, 0, 0x524B,
0x3237, 0xB441, 0, 0x524A, 0, 0, 0xB442, 0x362A,
};
+static const unsigned short utf8_to_euc_E58D_x0213[] = {
+ 0x523F, 0x3D3D, 0xA351, 0x4069, 0, 0x5241, 0x5240, 0x3E23,
+ 0x3861, 0x5243, 0x483E, 0xB438, 0xB437, 0x5244, 0, 0,
+ 0, 0x485C, 0x4234, 0x426E, 0x3628, 0, 0, 0x466E,
+ 0x4331, 0xB439, 0x476E, 0xB43A, 0x4B4E, 0, 0x5246, 0,
+ 0x406A, 0x2E6F, 0, 0x2E70, 0, 0xB43D, 0x3735, 0xA354,
+ 0, 0x5247, 0, 0, 0xA355, 0xB43F, 0x5248, 0x312C,
+ 0x3075, 0x346D, 0xB440, 0x4228, 0x3551, 0x4D71, 0, 0x524B,
+ 0x3237, 0xB441, 0xA356, 0x524A, 0, 0x2E71, 0xB442, 0x362A,
+};
static const unsigned short utf8_to_euc_E58E[] = {
0, 0, 0x524C, 0xB443, 0x4C71, 0, 0, 0xB444,
0xB445, 0, 0, 0, 0, 0, 0xB446, 0,
@@ -3229,6 +5818,16 @@ static const unsigned short utf8_to_euc_E58E[] = {
0x5252, 0, 0xB450, 0x3837, 0xB451, 0xB452, 0x5253, 0xB453,
0xB454, 0, 0xB455, 0x356E, 0, 0xB456, 0, 0,
};
+static const unsigned short utf8_to_euc_E58E_x0213[] = {
+ 0, 0, 0x524C, 0xB443, 0x4C71, 0, 0, 0xB444,
+ 0xB445, 0, 0, 0, 0, 0, 0xB446, 0,
+ 0, 0, 0, 0x2E72, 0xB448, 0, 0x524D, 0,
+ 0x4E52, 0xB449, 0x387C, 0, 0, 0x2E73, 0, 0x3836,
+ 0x524E, 0xB44B, 0, 0, 0xA357, 0x5250, 0x524F, 0,
+ 0x3F5F, 0x3139, 0xB44D, 0xB44E, 0, 0x315E, 0x5251, 0xB44F,
+ 0x5252, 0, 0x2E74, 0x3837, 0xA358, 0xB452, 0x5253, 0xA35A,
+ 0xB454, 0, 0xB455, 0x356E, 0, 0xB456, 0, 0,
+};
static const unsigned short utf8_to_euc_E58F[] = {
0xB457, 0, 0x3B32, 0x5254, 0, 0xB458, 0, 0,
0x4B74, 0x3A35, 0x355A, 0x4D27, 0x4150, 0x483F, 0x3C7D, 0xB459,
@@ -3239,6 +5838,16 @@ static const unsigned short utf8_to_euc_E58F[] = {
0x4266, 0x3C38, 0x3B4B, 0x3126, 0, 0xB463, 0x3370, 0x3966,
0x3B4A, 0, 0x525D, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E58F_x0213[] = {
+ 0xA35B, 0, 0x3B32, 0x5254, 0, 0xB458, 0, 0,
+ 0x4B74, 0x3A35, 0x355A, 0x4D27, 0x4150, 0x483F, 0x3C7D, 0xB459,
+ 0, 0, 0xB45A, 0xB45B, 0x3D47, 0xA35F, 0x3C68, 0x3C75,
+ 0, 0x3D76, 0xA360, 0x4840, 0, 0xB45E, 0xB45F, 0x5257,
+ 0xB460, 0x3143, 0x4151, 0x387D, 0x3845, 0x3667, 0xB461, 0xB462,
+ 0x525B, 0x4321, 0x427E, 0x362B, 0x3E24, 0x525C, 0x525A, 0x3244,
+ 0x4266, 0x3C38, 0x3B4B, 0x3126, 0xA362, 0xA363, 0x3370, 0x3966,
+ 0x3B4A, 0, 0x525D, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E590[] = {
0, 0x525E, 0xB464, 0x3549, 0x3346, 0, 0, 0,
0x3967, 0x3548, 0x445F, 0x3125, 0x4631, 0x4C3E, 0x3921, 0x4D79,
@@ -3249,6 +5858,16 @@ static const unsigned short utf8_to_euc_E590[] = {
0, 0xB46C, 0, 0, 0xB46D, 0xB46E, 0x5265, 0,
0x355B, 0x3F61, 0, 0x4A2D, 0x5263, 0x525F, 0x3863, 0,
};
+static const unsigned short utf8_to_euc_E590_x0213[] = {
+ 0, 0x525E, 0xB464, 0x3549, 0x3346, 0, 0, 0,
+ 0x3967, 0x3548, 0x445F, 0x3125, 0x4631, 0x4C3E, 0x3921, 0x4D79,
+ 0x4547, 0x387E, 0x2E75, 0xB465, 0, 0, 0, 0,
+ 0, 0, 0xB466, 0x372F, 0, 0x5267, 0x4F7E, 0x3663,
+ 0x4B4A, 0xB467, 0, 0, 0xA365, 0, 0x485D, 0x2E76,
+ 0xA366, 0x5266, 0xB46A, 0x345E, 0x5261, 0x5262, 0x5264, 0xB46B,
+ 0, 0xB46C, 0, 0, 0xB46D, 0xB46E, 0x5265, 0,
+ 0x355B, 0x3F61, 0, 0x4A2D, 0x5263, 0x525F, 0x3863, 0,
+};
static const unsigned short utf8_to_euc_E591[] = {
0x5260, 0, 0x4F24, 0xB46F, 0xB470, 0, 0x4A72, 0xB471,
0x4468, 0x3862, 0x3970, 0, 0, 0xB472, 0x5268, 0xB473,
@@ -3259,6 +5878,16 @@ static const unsigned short utf8_to_euc_E591[] = {
0x526F, 0x526D, 0, 0x4C23, 0xB47D, 0x526A, 0x5273, 0x526E,
0, 0, 0, 0x5271, 0x3846, 0x4C3F, 0, 0xB47E,
};
+static const unsigned short utf8_to_euc_E591_x0213[] = {
+ 0x5260, 0, 0x4F24, 0xA368, 0xB470, 0, 0x4A72, 0xB471,
+ 0x4468, 0x3862, 0x3970, 0, 0, 0x2E77, 0x5268, 0xB473,
+ 0, 0x465D, 0, 0, 0, 0xA364, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0xB474, 0x526C,
+ 0, 0, 0xA369, 0, 0xB476, 0, 0xA36A, 0xB478,
+ 0x3C7E, 0xB479, 0x3C76, 0x2E79, 0xA36B, 0xB47B, 0xB47C, 0,
+ 0x526F, 0x526D, 0, 0x4C23, 0x2E7A, 0x526A, 0x5273, 0x526E,
+ 0, 0, 0, 0x5271, 0x3846, 0x4C3F, 0, 0x2E7B,
+};
static const unsigned short utf8_to_euc_E592[] = {
0x5272, 0xB521, 0, 0xB522, 0x5274, 0xB523, 0x5276, 0,
0xB524, 0xB525, 0xF435, 0x3A70, 0x4F42, 0xB526, 0x526B, 0x5269,
@@ -3269,6 +5898,16 @@ static const unsigned short utf8_to_euc_E592[] = {
0, 0xB533, 0x3A69, 0x3331, 0, 0, 0, 0xB534,
0x5279, 0xB535, 0xB536, 0xB537, 0x5325, 0x3076, 0x5324, 0xB538,
};
+static const unsigned short utf8_to_euc_E592_x0213[] = {
+ 0x5272, 0xB521, 0, 0xB522, 0x5274, 0xB523, 0x5276, 0,
+ 0x2E7C, 0xB525, 0xA36C, 0x3A70, 0x4F42, 0xA36D, 0x526B, 0x5269,
+ 0x5275, 0xB527, 0x5270, 0, 0, 0xA36E, 0x2E7D, 0,
+ 0, 0, 0, 0, 0x2E78, 0, 0, 0xB52B,
+ 0xA36F, 0x2E7E, 0x5278, 0, 0x5323, 0x527A, 0xA370, 0xB52E,
+ 0x527E, 0x2F21, 0xB530, 0x5321, 0x527B, 0xA371, 0xA372, 0x533E,
+ 0, 0xB533, 0x3A69, 0x3331, 0, 0, 0, 0xA373,
+ 0x5279, 0xB535, 0xA374, 0xB537, 0x5325, 0x3076, 0x5324, 0xA375,
+};
static const unsigned short utf8_to_euc_E593[] = {
0x3025, 0x494A, 0x5322, 0, 0x527C, 0, 0xB539, 0x5277,
0x527D, 0x3A48, 0xB53A, 0, 0, 0xB53B, 0xB53C, 0,
@@ -3279,6 +5918,16 @@ static const unsigned short utf8_to_euc_E593[] = {
0, 0, 0x452F, 0, 0, 0, 0xB541, 0,
0, 0, 0x532E, 0, 0xB542, 0x532B, 0xB543, 0xB544,
};
+static const unsigned short utf8_to_euc_E593_x0213[] = {
+ 0x3025, 0x494A, 0x5322, 0xA376, 0x527C, 0, 0x2F22, 0x5277,
+ 0x527D, 0x3A48, 0xB53A, 0, 0, 0xB53B, 0xB53C, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0x5326, 0, 0, 0, 0, 0, 0, 0,
+ 0xB53D, 0x3077, 0x532F, 0, 0, 0x5327, 0x5328, 0,
+ 0x3E25, 0x4B69, 0xB53E, 0, 0xA378, 0x532D, 0x532C, 0xA379,
+ 0, 0xA37A, 0x452F, 0xA37B, 0, 0, 0xB541, 0,
+ 0, 0, 0x532E, 0, 0xB542, 0x532B, 0xB543, 0x2F23,
+};
static const unsigned short utf8_to_euc_E594[] = {
0xB545, 0xB546, 0, 0, 0x3134, 0xB547, 0x3A36, 0x3F30,
0xB548, 0xB549, 0, 0, 0xB54A, 0xB54B, 0xB54C, 0x5329,
@@ -3289,6 +5938,16 @@ static const unsigned short utf8_to_euc_E594[] = {
0, 0x3E27, 0xB550, 0x533A, 0, 0xB551, 0xB552, 0,
0x5339, 0x5330, 0, 0xB553, 0xB554, 0xB555, 0x4243, 0,
};
+static const unsigned short utf8_to_euc_E594_x0213[] = {
+ 0xA37C, 0xA37D, 0, 0, 0x3134, 0xB547, 0x3A36, 0x3F30,
+ 0xB548, 0xA37E, 0, 0, 0xB54A, 0xB54B, 0x2F24, 0x5329,
+ 0x4562, 0, 0, 0, 0x532A, 0xB54D, 0x3022, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0xB54E, 0x2F25, 0, 0, 0x5334, 0x4D23,
+ 0, 0x3E27, 0xB550, 0x533A, 0, 0x2F26, 0xB552, 0,
+ 0x5339, 0x5330, 0, 0xB553, 0xA421, 0xB555, 0x4243, 0,
+};
static const unsigned short utf8_to_euc_E595[] = {
0x5331, 0xB556, 0, 0, 0x426F, 0x5336, 0x3E26, 0xB557,
0, 0xB558, 0xB559, 0, 0x5333, 0xB55A, 0, 0x4C64,
@@ -3299,6 +5958,16 @@ static const unsigned short utf8_to_euc_E595[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0x5341, 0x5346, 0, 0x5342, 0xB565,
};
+static const unsigned short utf8_to_euc_E595_x0213[] = {
+ 0x5331, 0xA422, 0, 0, 0x426F, 0x5336, 0x3E26, 0xA424,
+ 0, 0xB558, 0xA425, 0, 0x5333, 0xB55A, 0, 0x4C64,
+ 0x2F27, 0xB55C, 0, 0x373C, 0, 0, 0x5337, 0x5338,
+ 0xB55D, 0, 0xB55E, 0xB55F, 0x5335, 0x533B, 0x2F28, 0,
+ 0xA427, 0xA428, 0, 0x5332, 0xA429, 0, 0xB564, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0x5341, 0x5346, 0xA42B, 0x5342, 0xB565,
+};
static const unsigned short utf8_to_euc_E596[] = {
0x533D, 0xB566, 0xB567, 0x5347, 0x4131, 0, 0xB568, 0x5349,
0xB569, 0x3922, 0x533F, 0x437D, 0, 0, 0xB56A, 0xB56B,
@@ -3309,6 +5978,16 @@ static const unsigned short utf8_to_euc_E596[] = {
0x3674, 0, 0xB574, 0, 0, 0, 0x3144, 0,
0, 0, 0, 0, 0, 0, 0, 0xB575,
};
+static const unsigned short utf8_to_euc_E596_x0213[] = {
+ 0x533D, 0x2F29, 0xA42C, 0x5347, 0x4131, 0, 0x2F2A, 0x5349,
+ 0xA42D, 0x3922, 0x533F, 0x437D, 0, 0, 0x2F2B, 0xB56B,
+ 0, 0xA42E, 0xB56D, 0xB56E, 0xB56F, 0, 0, 0xB570,
+ 0x5343, 0x533C, 0x342D, 0, 0x346E, 0x3365, 0x5344, 0x5340,
+ 0, 0, 0, 0xB571, 0xB572, 0, 0, 0x3776,
+ 0x534A, 0x5348, 0x4153, 0x354A, 0x362C, 0x2F2D, 0x5345, 0,
+ 0x3674, 0, 0xB574, 0, 0, 0, 0x3144, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0xA433,
+};
static const unsigned short utf8_to_euc_E597[] = {
0, 0xB576, 0, 0xB577, 0x534E, 0x534C, 0xB578, 0x5427,
0, 0xB579, 0, 0xB57A, 0xB57B, 0, 0xB57C, 0,
@@ -3319,6 +5998,16 @@ static const unsigned short utf8_to_euc_E597[] = {
0, 0, 0, 0, 0, 0, 0xB628, 0x5353,
0, 0x5358, 0, 0, 0, 0x5356, 0x5355, 0xB629,
};
+static const unsigned short utf8_to_euc_E597_x0213[] = {
+ 0, 0xB576, 0, 0xB577, 0x534E, 0x534C, 0xB578, 0x5427,
+ 0, 0xA434, 0, 0xB57A, 0xA435, 0, 0x2F2E, 0,
+ 0, 0xA436, 0xA430, 0xB621, 0x5351, 0, 0, 0xB622,
+ 0xB623, 0, 0x534B, 0xB624, 0x534F, 0xA437, 0xB625, 0x534D,
+ 0, 0, 0xA439, 0x3B4C, 0x5350, 0, 0, 0,
+ 0, 0xA43B, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0xB628, 0x5353,
+ 0, 0x5358, 0, 0, 0, 0x5356, 0x5355, 0xB629,
+};
static const unsigned short utf8_to_euc_E598[] = {
0, 0, 0, 0, 0, 0xB62A, 0x4332, 0,
0xB62B, 0x3245, 0xB62C, 0, 0, 0xB62D, 0xB62E, 0xB62F,
@@ -3329,6 +6018,16 @@ static const unsigned short utf8_to_euc_E598[] = {
0xB635, 0x3E7C, 0x535E, 0xB636, 0x535C, 0xB637, 0x535D, 0xB638,
0x535F, 0xB639, 0, 0xB63A, 0xB63B, 0xB63C, 0, 0xB63D,
};
+static const unsigned short utf8_to_euc_E598_x0213[] = {
+ 0, 0, 0, 0, 0, 0xB62A, 0x4332, 0xA43E,
+ 0x2F30, 0x3245, 0xB62C, 0, 0, 0xB62D, 0x2F31, 0xB62F,
+ 0xA43F, 0xB631, 0xB632, 0, 0x5352, 0, 0x5354, 0x3E28,
+ 0x3133, 0xB633, 0, 0x5357, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0xA43C, 0x325E, 0, 0, 0xB634, 0, 0, 0x5362,
+ 0xA440, 0x3E7C, 0x535E, 0xB636, 0x535C, 0xB637, 0x535D, 0xA441,
+ 0x535F, 0xB639, 0, 0x2F32, 0xB63B, 0xA443, 0, 0xA444,
+};
static const unsigned short utf8_to_euc_E599[] = {
0xB63E, 0xB63F, 0x313D, 0xB640, 0xB641, 0, 0xB642, 0,
0, 0xB643, 0, 0xB644, 0x4139, 0xB645, 0x5359, 0xB646,
@@ -3339,6 +6038,16 @@ static const unsigned short utf8_to_euc_E599[] = {
0, 0xB651, 0xB652, 0, 0x4A2E, 0xB653, 0, 0,
0x4655, 0, 0x4838, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E599_x0213[] = {
+ 0xA445, 0xB63F, 0x313D, 0xB640, 0xB641, 0, 0xB642, 0xA446,
+ 0, 0x2F33, 0, 0xB644, 0x4139, 0xB645, 0x5359, 0xB646,
+ 0x535A, 0, 0, 0x7427, 0xB647, 0, 0, 0,
+ 0, 0, 0, 0x337A, 0, 0, 0xA447, 0,
+ 0xA448, 0xB64A, 0xB64B, 0xB64C, 0x5361, 0, 0x2F35, 0,
+ 0x346F, 0xB64E, 0x5364, 0x5360, 0x5363, 0xA449, 0, 0x2F37,
+ 0, 0x2F38, 0x2F39, 0, 0x4A2E, 0xB653, 0x2F34, 0,
+ 0x4655, 0, 0x4838, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E59A[] = {
0x5366, 0, 0, 0, 0xB654, 0xB655, 0x5365, 0x3345,
0xB656, 0, 0x5367, 0xB657, 0xB658, 0, 0, 0x536A,
@@ -3349,6 +6058,16 @@ static const unsigned short utf8_to_euc_E59A[] = {
0, 0xB666, 0, 0xB667, 0x536E, 0, 0x536D, 0xB668,
0, 0, 0, 0, 0x5370, 0, 0xB669, 0,
};
+static const unsigned short utf8_to_euc_E59A_x0213[] = {
+ 0x5366, 0, 0, 0, 0xB654, 0xB655, 0x5365, 0x3345,
+ 0xA44B, 0, 0x5367, 0xB657, 0xA44C, 0, 0, 0x536A,
+ 0, 0, 0, 0, 0x5369, 0xA44D, 0, 0,
+ 0, 0x2F3A, 0xA44E, 0, 0, 0xA44F, 0x2F3B, 0xB65E,
+ 0x5368, 0, 0x4739, 0, 0, 0x536B, 0xB65F, 0xB660,
+ 0xA450, 0x2F3C, 0, 0xB663, 0x2F3D, 0xA451, 0x536C, 0,
+ 0, 0xB666, 0xA452, 0x2F3E, 0x536E, 0, 0x536D, 0xB668,
+ 0, 0, 0, 0, 0x5370, 0, 0xB669, 0,
+};
static const unsigned short utf8_to_euc_E59B[] = {
0x5373, 0x5371, 0x536F, 0x5372, 0, 0xB66A, 0, 0,
0x5374, 0xB66B, 0xB66C, 0xB66D, 0xB670, 0xB671, 0x5375, 0xB66E,
@@ -3359,6 +6078,16 @@ static const unsigned short utf8_to_euc_E59B[] = {
0x3A24, 0xB67C, 0x304F, 0x3F5E, 0, 0, 0xB721, 0xB722,
0, 0x537A, 0x3847, 0, 0, 0x3971, 0, 0x537C,
};
+static const unsigned short utf8_to_euc_E59B_x0213[] = {
+ 0x5373, 0x5371, 0x536F, 0x5372, 0, 0xA453, 0, 0,
+ 0x5374, 0x2F3F, 0x2F40, 0xB66D, 0xB670, 0xA454, 0x5375, 0xB66E,
+ 0xB66F, 0x5376, 0, 0x5377, 0, 0, 0, 0x5378,
+ 0x5145, 0xB672, 0x3C7C, 0x3B4D, 0xB673, 0xB674, 0x3273, 0xA455,
+ 0x3078, 0xB676, 0, 0x4344, 0xB677, 0xB678, 0xB679, 0xB67A,
+ 0xA456, 0, 0, 0xB67D, 0, 0xB67E, 0x5379, 0,
+ 0x3A24, 0xB67C, 0x304F, 0x3F5E, 0, 0, 0xA457, 0xA458,
+ 0, 0x537A, 0x3847, 0, 0, 0x3971, 0, 0x537C,
+};
static const unsigned short utf8_to_euc_E59C[] = {
0x537B, 0xB723, 0xB724, 0x4A60, 0x537D, 0, 0, 0xB725,
0x5421, 0x537E, 0xB726, 0x5422, 0xB727, 0x5423, 0, 0x3777,
@@ -3369,6 +6098,16 @@ static const unsigned short utf8_to_euc_E59C[] = {
0x434F, 0, 0, 0xB737, 0xB738, 0, 0, 0x542A,
0x542B, 0, 0, 0x542D, 0, 0xB739, 0xB73A, 0xB73B,
};
+static const unsigned short utf8_to_euc_E59C_x0213[] = {
+ 0x537B, 0xB723, 0xB724, 0x4A60, 0x537D, 0, 0, 0xB725,
+ 0x5421, 0x537E, 0x2F41, 0x5422, 0xB727, 0x5423, 0, 0x3777,
+ 0, 0xB728, 0x3160, 0x5424, 0, 0xA45A, 0x5426, 0,
+ 0x5425, 0, 0xB72A, 0xB72B, 0x5428, 0xB72C, 0, 0x455A,
+ 0xB72D, 0x2F43, 0xB72E, 0xA45B, 0xB730, 0xB731, 0x5429, 0x3035,
+ 0x3A5F, 0xA45D, 0xB733, 0, 0xB734, 0x373D, 0xB735, 0x2F44,
+ 0x434F, 0, 0, 0x2F45, 0x2F46, 0, 0, 0x542A,
+ 0x542B, 0, 0, 0x542D, 0, 0xB739, 0xB73A, 0xB73B,
+};
static const unsigned short utf8_to_euc_E59D[] = {
0x542E, 0, 0x3A64, 0, 0, 0xB73C, 0xB73D, 0x3651,
0, 0, 0x4B37, 0, 0xB73E, 0xB73F, 0x542C, 0x542F,
@@ -3379,6 +6118,16 @@ static const unsigned short utf8_to_euc_E59D[] = {
0xB749, 0xB74A, 0, 0xB74B, 0xB74C, 0xB74D, 0, 0xB74E,
0, 0xB74F, 0xB750, 0xB751, 0xB752, 0, 0xB753, 0x5434,
};
+static const unsigned short utf8_to_euc_E59D_x0213[] = {
+ 0x542E, 0, 0x3A64, 0, 0, 0xA45F, 0xA460, 0x3651,
+ 0, 0, 0x4B37, 0, 0xA461, 0xA462, 0x542C, 0x542F,
+ 0x3A41, 0x3923, 0xB740, 0, 0, 0, 0, 0,
+ 0, 0xF436, 0, 0, 0, 0, 0, 0,
+ 0, 0x5433, 0xB741, 0, 0x3A25, 0xB742, 0x4333, 0xB743,
+ 0xA464, 0x5430, 0x445A, 0xB745, 0, 0xB746, 0xB747, 0xA465,
+ 0x2F47, 0xB74A, 0, 0xA466, 0xA467, 0xA468, 0, 0x2F48,
+ 0, 0xB74F, 0xB750, 0xA469, 0x2F49, 0, 0xB753, 0x5434,
+};
static const unsigned short utf8_to_euc_E59E[] = {
0, 0xB754, 0x3F62, 0xB755, 0, 0, 0, 0,
0x5432, 0x5435, 0, 0x373F, 0xB756, 0, 0, 0,
@@ -3389,6 +6138,16 @@ static const unsigned short utf8_to_euc_E59E[] = {
0x543B, 0, 0, 0x5438, 0, 0, 0, 0,
0xB765, 0, 0, 0, 0, 0xB766, 0, 0,
};
+static const unsigned short utf8_to_euc_E59E_x0213[] = {
+ 0, 0xB754, 0x3F62, 0xB755, 0, 0, 0, 0,
+ 0x5432, 0x5435, 0, 0x373F, 0xB756, 0, 0, 0,
+ 0, 0, 0, 0x5436, 0xB757, 0xB760, 0, 0xB758,
+ 0, 0xB759, 0xA46D, 0, 0x2F4A, 0xA46E, 0xA46F, 0xB75E,
+ 0x5437, 0xB75F, 0x3924, 0x3340, 0x5439, 0, 0, 0xB761,
+ 0xA470, 0xB763, 0x543A, 0, 0xA46C, 0, 0, 0,
+ 0x543B, 0, 0, 0x5438, 0, 0, 0, 0,
+ 0x2F4D, 0, 0, 0, 0, 0xB766, 0, 0,
+};
static const unsigned short utf8_to_euc_E59F[] = {
0x5431, 0, 0, 0x543C, 0, 0, 0x543D, 0xB767,
0xB768, 0, 0, 0x4B64, 0xB769, 0, 0x3E6B, 0xB76A,
@@ -3399,6 +6158,16 @@ static const unsigned short utf8_to_euc_E59F[] = {
0xB773, 0, 0, 0, 0x3E7D, 0xB774, 0xB775, 0x3C39,
0xB776, 0x475D, 0x3470, 0, 0x3A6B, 0xB777, 0xB778, 0xB779,
};
+static const unsigned short utf8_to_euc_E59F_x0213[] = {
+ 0x5431, 0, 0, 0x543C, 0, 0, 0x543D, 0x2F4E,
+ 0x2F4F, 0, 0, 0x4B64, 0xA473, 0, 0x3E6B, 0x2F50,
+ 0, 0, 0x543F, 0x5440, 0x543E, 0xB76B, 0x5442, 0xA471,
+ 0, 0, 0, 0, 0x4738, 0xB76C, 0xA476, 0x3068,
+ 0x4956, 0xB77E, 0, 0x5443, 0x2F51, 0, 0xA477, 0xB770,
+ 0, 0xB771, 0, 0, 0, 0x2F52, 0, 0,
+ 0xA478, 0, 0, 0, 0x3E7D, 0x2F53, 0x2F54, 0x3C39,
+ 0xA47A, 0x475D, 0x3470, 0xA47B, 0x3A6B, 0xA47C, 0xB778, 0x2F55,
+};
static const unsigned short utf8_to_euc_E5A0[] = {
0x4B59, 0, 0x4632, 0xB77A, 0xB77B, 0x3778, 0x424F, 0,
0xB77C, 0xB77D, 0x5441, 0x5444, 0xB821, 0xB822, 0, 0,
@@ -3409,6 +6178,16 @@ static const unsigned short utf8_to_euc_E5A0[] = {
0x3161, 0x4A73, 0xB82A, 0, 0x3E6C, 0x4548, 0, 0,
0, 0xB82B, 0x3A66, 0, 0, 0x544E, 0, 0xB82C,
};
+static const unsigned short utf8_to_euc_E5A0_x0213[] = {
+ 0x4B59, 0, 0x4632, 0xB77A, 0xA47D, 0x3778, 0x424F, 0,
+ 0xB77C, 0x2F56, 0x5441, 0x5444, 0xB821, 0xB822, 0, 0,
+ 0, 0, 0, 0, 0, 0x4244, 0, 0,
+ 0, 0x5445, 0, 0xB823, 0, 0x5446, 0xA47E, 0xB825,
+ 0xA521, 0x5448, 0, 0, 0x4469, 0, 0xB827, 0xA522,
+ 0, 0, 0x342E, 0, 0, 0xB829, 0, 0x7421,
+ 0x3161, 0x4A73, 0xA523, 0, 0x3E6C, 0x4548, 0, 0,
+ 0, 0xA524, 0x3A66, 0, 0, 0x544E, 0, 0xB82C,
+};
static const unsigned short utf8_to_euc_E5A1[] = {
0x4A3D, 0x4E5D, 0, 0, 0, 0, 0, 0,
0, 0xB82D, 0x3274, 0x544A, 0xB82E, 0xB82F, 0, 0xB830,
@@ -3419,6 +6198,16 @@ static const unsigned short utf8_to_euc_E5A1[] = {
0x544B, 0, 0x5447, 0, 0, 0x3F50, 0, 0,
0xB838, 0x544F, 0, 0, 0xB839, 0, 0x3D4E, 0xB83A,
};
+static const unsigned short utf8_to_euc_E5A1_x0213[] = {
+ 0x4A3D, 0x4E5D, 0, 0, 0, 0, 0, 0,
+ 0, 0xA526, 0x3274, 0x544A, 0xA527, 0xB82F, 0, 0xB830,
+ 0xB831, 0x413A, 0x544D, 0, 0x4563, 0xB832, 0, 0x4549,
+ 0x4564, 0x4839, 0x444D, 0, 0, 0, 0x3A49, 0xB833,
+ 0, 0x2F58, 0x5449, 0, 0x2F59, 0, 0, 0xA528,
+ 0xB837, 0x3176, 0, 0x4536, 0, 0, 0, 0,
+ 0x544B, 0, 0x5447, 0, 0, 0x3F50, 0, 0,
+ 0xB838, 0x544F, 0, 0, 0x2F5B, 0, 0x3D4E, 0xB83A,
+};
static const unsigned short utf8_to_euc_E5A2[] = {
0xB83B, 0xB83C, 0, 0x362D, 0, 0x5450, 0, 0xB83D,
0xB83E, 0xB83F, 0xB840, 0, 0xB841, 0xB842, 0, 0xB843,
@@ -3429,6 +6218,16 @@ static const unsigned short utf8_to_euc_E5A2[] = {
0, 0xB84D, 0xB84E, 0x4A2F, 0, 0, 0, 0,
0x5457, 0x5451, 0x5454, 0x5456, 0xB850, 0, 0x3A26, 0,
};
+static const unsigned short utf8_to_euc_E5A2_x0213[] = {
+ 0xB83B, 0xB83C, 0, 0x362D, 0, 0x5450, 0, 0xB83D,
+ 0xB83E, 0x2F5C, 0xA529, 0xA52A, 0xB841, 0xA52B, 0, 0xA52C,
+ 0xA52D, 0, 0, 0x4A68, 0xA52E, 0, 0xB846, 0x417D,
+ 0, 0, 0, 0, 0x4446, 0xA52F, 0x2F5D, 0x5452,
+ 0xB848, 0xB849, 0xB84A, 0, 0, 0, 0xB84B, 0,
+ 0x4B4F, 0x2F5F, 0xA530, 0x5453, 0, 0, 0x5458, 0,
+ 0, 0xA531, 0xB84E, 0x4A2F, 0, 0, 0, 0,
+ 0x5457, 0x5451, 0x5454, 0x5456, 0xB850, 0, 0x3A26, 0,
+};
static const unsigned short utf8_to_euc_E5A3[] = {
0, 0x4A49, 0xB851, 0, 0xB84F, 0x5459, 0, 0x4345,
0xB852, 0, 0x3275, 0, 0x3E6D, 0xB853, 0xB854, 0,
@@ -3439,6 +6238,16 @@ static const unsigned short utf8_to_euc_E5A3[] = {
0x403C, 0x306D, 0x4764, 0xB85E, 0, 0, 0, 0x445B,
0, 0x5465, 0x5464, 0x5466, 0x5467, 0x5468, 0, 0,
};
+static const unsigned short utf8_to_euc_E5A3_x0213[] = {
+ 0, 0x4A49, 0xB851, 0xA533, 0xB84F, 0x5459, 0, 0x4345,
+ 0xB852, 0, 0x3275, 0, 0x3E6D, 0xA534, 0x2F62, 0,
+ 0xB855, 0x545B, 0x2F61, 0x545A, 0x2F63, 0x3968, 0xB858, 0x545C,
+ 0x545E, 0x545D, 0x2F64, 0, 0x5460, 0xB85A, 0x5455, 0x5462,
+ 0x2F65, 0xB85B, 0xA535, 0, 0x5461, 0x545F, 0, 0,
+ 0, 0x2F66, 0, 0x3B4E, 0x3F51, 0, 0x4154, 0x5463,
+ 0x403C, 0x306D, 0x4764, 0xA536, 0xA537, 0, 0, 0x445B,
+ 0, 0x5465, 0x5464, 0x5466, 0x5467, 0x5468, 0, 0,
+};
static const unsigned short utf8_to_euc_E5A4[] = {
0, 0, 0x5469, 0, 0, 0xB85F, 0xB860, 0,
0, 0x4A51, 0x546A, 0xB861, 0xB862, 0, 0, 0x3246,
@@ -3449,6 +6258,16 @@ static const unsigned short utf8_to_euc_E5A4[] = {
0xB86D, 0x3C3A, 0x5471, 0xB86E, 0, 0xB86F, 0xB870, 0x3050,
0x5472, 0, 0, 0, 0, 0, 0x5473, 0xB871,
};
+static const unsigned short utf8_to_euc_E5A4_x0213[] = {
+ 0, 0, 0x5469, 0, 0, 0xA538, 0xA539, 0,
+ 0, 0x4A51, 0x546A, 0xA53A, 0x2F67, 0xA53B, 0, 0x3246,
+ 0x546B, 0, 0xB863, 0xB864, 0xA53C, 0x4D3C, 0x3330, 0,
+ 0x5249, 0x3D48, 0x423F, 0x546C, 0x4C6B, 0xB867, 0, 0,
+ 0, 0xB868, 0x4C34, 0xB869, 0xA53D, 0x546E, 0, 0x4267,
+ 0xB86B, 0x4537, 0x4240, 0x4957, 0x546F, 0x5470, 0x317B, 0xB86C,
+ 0xB86D, 0x3C3A, 0x5471, 0xB86E, 0, 0xB86F, 0xB870, 0x3050,
+ 0x5472, 0, 0, 0, 0, 0xA540, 0x5473, 0xB871,
+};
static const unsigned short utf8_to_euc_E5A5[] = {
0, 0, 0, 0xB872, 0x3162, 0, 0xB873, 0x3471,
0x4660, 0x4A74, 0, 0, 0, 0, 0x5477, 0x4155,
@@ -3459,6 +6278,16 @@ static const unsigned short utf8_to_euc_E5A5[] = {
0, 0, 0xB922, 0x3D77, 0x455B, 0xB923, 0xB924, 0,
0x5521, 0xB925, 0, 0xB926, 0xB927, 0x3925, 0, 0,
};
+static const unsigned short utf8_to_euc_E5A5_x0213[] = {
+ 0, 0, 0, 0xB872, 0x3162, 0, 0xA542, 0x3471,
+ 0x4660, 0x4A74, 0, 0, 0, 0, 0x5477, 0x4155,
+ 0x5476, 0x3740, 0xB874, 0xB875, 0x4B5B, 0x5475, 0, 0x4565,
+ 0x5479, 0xB876, 0x5478, 0xA545, 0, 0x2F69, 0xB879, 0xA546,
+ 0x547B, 0xB87B, 0x547A, 0xB87C, 0, 0x317C, 0, 0x547C,
+ 0x3E29, 0x547E, 0x4325, 0xB87D, 0x547D, 0x2F6A, 0x4A33, 0xB921,
+ 0, 0, 0xB922, 0x3D77, 0x455B, 0xA548, 0xA549, 0,
+ 0x5521, 0xB925, 0, 0xB926, 0xA54A, 0x3925, 0, 0,
+};
static const unsigned short utf8_to_euc_E5A6[] = {
0, 0x5522, 0x4721, 0x485E, 0x4C51, 0, 0, 0,
0, 0, 0x4725, 0xB928, 0xB929, 0x552B, 0xB92A, 0,
@@ -3469,6 +6298,16 @@ static const unsigned short utf8_to_euc_E5A6[] = {
0xB934, 0, 0x5527, 0xB935, 0, 0, 0, 0xB936,
0, 0x4B65, 0xB937, 0x3A4A, 0xB938, 0, 0x3E2A, 0,
};
+static const unsigned short utf8_to_euc_E5A6_x0213[] = {
+ 0, 0x5522, 0x4721, 0x485E, 0x4C51, 0, 0, 0,
+ 0, 0, 0x4725, 0x2F6B, 0xB929, 0x552B, 0xB92A, 0,
+ 0, 0, 0x2F6C, 0x3538, 0, 0xB92C, 0x4D45, 0xB92D,
+ 0, 0x4C2F, 0, 0x562C, 0, 0x5523, 0, 0xA54B,
+ 0, 0, 0, 0x5526, 0x2F6D, 0x4245, 0, 0xB930,
+ 0x4B38, 0, 0, 0, 0x454A, 0xB931, 0xA54C, 0xB933,
+ 0xB934, 0, 0x5527, 0xB935, 0, 0, 0, 0xB936,
+ 0, 0x4B65, 0xB937, 0x3A4A, 0xA54D, 0, 0x3E2A, 0,
+};
static const unsigned short utf8_to_euc_E5A7[] = {
0, 0xB939, 0, 0xB93A, 0xB93B, 0, 0x5528, 0,
0xB93C, 0x3B50, 0xB93D, 0x3B4F, 0, 0xB93E, 0, 0,
@@ -3479,6 +6318,16 @@ static const unsigned short utf8_to_euc_E5A7[] = {
0, 0xB948, 0xB949, 0, 0xB94A, 0, 0x3028, 0xB94B,
0, 0, 0, 0x3079, 0, 0, 0, 0x3B51,
};
+static const unsigned short utf8_to_euc_E5A7_x0213[] = {
+ 0, 0xB939, 0, 0x2F6E, 0xB93B, 0, 0x5528, 0,
+ 0xA54E, 0x3B50, 0xB93D, 0x3B4F, 0, 0xA54F, 0, 0,
+ 0x3039, 0x3848, 0x2F6F, 0x402B, 0x3051, 0, 0, 0,
+ 0, 0x552C, 0x552D, 0, 0x552A, 0x2F70, 0xA550, 0xB942,
+ 0, 0, 0, 0xA551, 0xA552, 0x3138, 0x342F, 0xA553,
+ 0x5529, 0, 0x4C45, 0x4931, 0, 0, 0xA554, 0xB947,
+ 0, 0xB948, 0xB949, 0, 0xB94A, 0, 0x3028, 0xB94B,
+ 0x7E7A, 0, 0, 0x3079, 0, 0, 0, 0x3B51,
+};
static const unsigned short utf8_to_euc_E5A8[] = {
0xB94C, 0x3052, 0, 0x3023, 0xB94D, 0, 0, 0,
0, 0x5532, 0, 0, 0xB94E, 0xB94F, 0xB950, 0,
@@ -3489,6 +6338,16 @@ static const unsigned short utf8_to_euc_E5A8[] = {
0xB95A, 0, 0, 0, 0, 0x5537, 0x5538, 0,
0, 0, 0, 0, 0x3E2B, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E5A8_x0213[] = {
+ 0xB94C, 0x3052, 0, 0x3023, 0xB94D, 0, 0, 0,
+ 0, 0x5532, 0, 0, 0xA558, 0xA559, 0xB950, 0,
+ 0, 0x5530, 0xB951, 0x2F71, 0, 0, 0, 0xA55A,
+ 0x4C3C, 0, 0x5533, 0, 0x5531, 0, 0xB953, 0x552F,
+ 0x3F31, 0, 0, 0x2F72, 0xB955, 0x552E, 0, 0xA55B,
+ 0xB957, 0x4A5A, 0xB958, 0, 0, 0xA55C, 0, 0x3864,
+ 0xB95A, 0, 0, 0, 0, 0x5537, 0x5538, 0,
+ 0, 0, 0, 0, 0x3E2B, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E5A9[] = {
0x5534, 0x4F2C, 0, 0, 0xB95B, 0xB95C, 0x474C, 0xB95D,
0xB95E, 0x5536, 0, 0, 0xB95F, 0, 0, 0,
@@ -3499,6 +6358,16 @@ static const unsigned short utf8_to_euc_E5A9[] = {
0, 0, 0, 0, 0, 0, 0, 0xB967,
0, 0, 0xB968, 0xB969, 0, 0, 0xB96A, 0x4C3B,
};
+static const unsigned short utf8_to_euc_E5A9_x0213[] = {
+ 0x5534, 0x4F2C, 0, 0, 0xB95B, 0xB95C, 0x474C, 0xB95D,
+ 0xB95E, 0x5536, 0, 0, 0xB95F, 0, 0, 0,
+ 0xB960, 0, 0, 0, 0, 0xA55D, 0, 0,
+ 0, 0, 0x3A27, 0, 0, 0, 0xB962, 0,
+ 0, 0, 0x5539, 0xB963, 0, 0xA55E, 0x4958, 0x2F73,
+ 0, 0, 0x553A, 0, 0x5535, 0x2F74, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0x2F75,
+ 0, 0, 0xA55F, 0xB969, 0, 0, 0x2F76, 0x4C3B,
+};
static const unsigned short utf8_to_euc_E5AA[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0xB96B, 0, 0, 0, 0,
@@ -3509,6 +6378,16 @@ static const unsigned short utf8_to_euc_E5AA[] = {
0, 0xB977, 0xB978, 0xB979, 0, 0xB97A, 0, 0,
0xB97B, 0, 0xB97C, 0xB97D, 0x553C, 0x5540, 0x553D, 0xB97E,
};
+static const unsigned short utf8_to_euc_E5AA_x0213[] = {
+ 0, 0, 0, 0, 0x2F77, 0, 0, 0,
+ 0, 0, 0, 0xA560, 0, 0, 0, 0,
+ 0xB96C, 0, 0x475E, 0xB96D, 0, 0, 0xB96E, 0,
+ 0, 0xB96F, 0x553B, 0x4932, 0xA561, 0, 0x2F78, 0xA562,
+ 0xA563, 0, 0xA564, 0, 0, 0, 0, 0x2F79,
+ 0, 0, 0, 0, 0xB976, 0, 0, 0,
+ 0, 0xA565, 0xB978, 0xA566, 0, 0xA567, 0, 0,
+ 0xB97B, 0, 0xA568, 0xB97D, 0x553C, 0x5540, 0x553D, 0xA569,
+};
static const unsigned short utf8_to_euc_E5AB[] = {
0, 0x3247, 0x553F, 0, 0xBA21, 0, 0xBA22, 0,
0xBA23, 0x3C3B, 0, 0x553E, 0x3779, 0, 0, 0xBA24,
@@ -3519,6 +6398,16 @@ static const unsigned short utf8_to_euc_E5AB[] = {
0, 0, 0, 0, 0, 0xBA2B, 0xBA2C, 0,
0, 0, 0x5546, 0x5547, 0, 0xBA2D, 0, 0,
};
+static const unsigned short utf8_to_euc_E5AB_x0213[] = {
+ 0, 0x3247, 0x553F, 0, 0x2F7A, 0, 0xBA22, 0,
+ 0xBA23, 0x3C3B, 0, 0x553E, 0x3779, 0, 0, 0xBA24,
+ 0x554C, 0, 0, 0, 0, 0, 0x5545, 0x5542,
+ 0, 0, 0xA56A, 0, 0xA56B, 0, 0, 0,
+ 0xA56C, 0x4364, 0, 0x5541, 0, 0xA56D, 0x5543, 0,
+ 0, 0x5544, 0xBA29, 0, 0, 0, 0xA56F, 0,
+ 0xA56E, 0, 0, 0, 0, 0xA570, 0xBA2C, 0,
+ 0, 0, 0x5546, 0x5547, 0, 0xBA2D, 0, 0,
+};
static const unsigned short utf8_to_euc_E5AC[] = {
0xBA2E, 0xBA2F, 0, 0, 0, 0, 0, 0,
0xBA30, 0x3472, 0, 0x5549, 0x5548, 0, 0, 0,
@@ -3529,6 +6418,16 @@ static const unsigned short utf8_to_euc_E5AC[] = {
0x3145, 0, 0x554B, 0, 0xBA32, 0, 0x554E, 0,
0xBA39, 0, 0, 0, 0, 0, 0x554F, 0,
};
+static const unsigned short utf8_to_euc_E5AC_x0213[] = {
+ 0xA571, 0xBA2F, 0, 0, 0, 0, 0, 0,
+ 0xA572, 0x3472, 0, 0x5549, 0x5548, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0x554A, 0xA573,
+ 0, 0x2F7C, 0, 0xBA34, 0, 0xBA35, 0, 0,
+ 0, 0xBA36, 0x3E6E, 0, 0, 0x2F7D, 0, 0,
+ 0, 0, 0x554D, 0, 0x445C, 0xA575, 0, 0,
+ 0x3145, 0, 0x554B, 0, 0xA574, 0, 0x554E, 0,
+ 0xBA39, 0, 0, 0, 0, 0, 0x554F, 0,
+};
static const unsigned short utf8_to_euc_E5AD[] = {
0x5552, 0xBA3A, 0, 0x5550, 0, 0x5551, 0, 0,
0, 0, 0, 0xBA3B, 0xBA3C, 0, 0, 0,
@@ -3539,6 +6438,16 @@ static const unsigned short utf8_to_euc_E5AD[] = {
0x5559, 0x5623, 0, 0x555A, 0, 0x555B, 0, 0,
0x555C, 0, 0x555E, 0, 0xBA43, 0xBA44, 0xBA45, 0xBA46,
};
+static const unsigned short utf8_to_euc_E5AD_x0213[] = {
+ 0x5552, 0x4F55, 0, 0x5550, 0, 0x5551, 0, 0,
+ 0, 0, 0, 0xBA3B, 0xA576, 0, 0, 0,
+ 0x3B52, 0x5553, 0xA577, 0, 0x3926, 0x5554, 0x4F56, 0x3B7A,
+ 0x4238, 0, 0x5555, 0x5556, 0x3B5A, 0x3927, 0xBA3F, 0x4C52,
+ 0, 0, 0, 0x3528, 0x3849, 0x5557, 0x3358, 0,
+ 0xA578, 0x5558, 0, 0x4239, 0, 0, 0xBA41, 0xA579,
+ 0x5559, 0x5623, 0, 0x555A, 0, 0x555B, 0, 0,
+ 0x555C, 0, 0x555E, 0, 0xA57A, 0x4F57, 0xBA45, 0xA57B,
+};
static const unsigned short utf8_to_euc_E5AE[] = {
0x555F, 0xBA47, 0, 0x5560, 0xBA48, 0x4270, 0xBA49, 0x3127,
0x3C69, 0x3042, 0xBA4A, 0x4157, 0x3430, 0x3C35, 0xBA4B, 0x3928,
@@ -3549,6 +6458,16 @@ static const unsigned short utf8_to_euc_E5AE[] = {
0x3A4B, 0xBA56, 0xBA57, 0x3332, 0x3163, 0x3E2C, 0x3248, 0xBA58,
0x5562, 0x4D46, 0xBA59, 0, 0xBA5A, 0, 0, 0x3D49,
};
+static const unsigned short utf8_to_euc_E5AE_x0213[] = {
+ 0x555F, 0xA57C, 0, 0x5560, 0xA57D, 0x4270, 0xBA49, 0x3127,
+ 0x3C69, 0x3042, 0xBA4A, 0x4157, 0x3430, 0x3C35, 0xBA4B, 0x3928,
+ 0xBA4C, 0xBA4D, 0, 0x4F58, 0xBA4F, 0x4566, 0xA821, 0x3D21,
+ 0x3431, 0x4368, 0x446A, 0x3038, 0x3539, 0x4A75, 0, 0x3C42,
+ 0, 0, 0x3552, 0x406B, 0x3C3C, 0x4D28, 0x5561, 0,
+ 0xBA51, 0xBA52, 0, 0, 0xA822, 0xBA54, 0x355C, 0xBA55,
+ 0x3A4B, 0xBA56, 0xBA57, 0x3332, 0x3163, 0x3E2C, 0x3248, 0xBA58,
+ 0x5562, 0x4D46, 0xBA59, 0, 0xBA5A, 0, 0, 0x3D49,
+};
static const unsigned short utf8_to_euc_E5AF[] = {
0xBA5B, 0xBA5C, 0x3C64, 0x5563, 0x3473, 0x4652, 0x4C29, 0x5564,
0, 0x5565, 0, 0, 0x4959, 0xBA5D, 0, 0xBA5E,
@@ -3559,6 +6478,16 @@ static const unsigned short utf8_to_euc_E5AF[] = {
0x556E, 0xBA66, 0, 0x5570, 0xBA67, 0x437E, 0x556F, 0,
0x4023, 0, 0x3B7B, 0, 0, 0xBA68, 0x4250, 0x3C77,
};
+static const unsigned short utf8_to_euc_E5AF_x0213[] = {
+ 0xA824, 0xBA5C, 0x3C64, 0x5563, 0x3473, 0x4652, 0x4C29, 0x5564,
+ 0, 0x5565, 0, 0, 0x4959, 0xBA5D, 0xA826, 0xBA5E,
+ 0x5567, 0, 0x3428, 0x3677, 0x5566, 0, 0xA827, 0xBA60,
+ 0x4F59, 0xBA62, 0xBA63, 0x3432, 0, 0x3F32, 0x556B, 0x3B21,
+ 0xBA64, 0x3249, 0x556A, 0, 0x5568, 0x556C, 0x5569, 0x472B,
+ 0x5C4D, 0x3F33, 0, 0x556D, 0x4F5A, 0, 0x4E40, 0xBA65,
+ 0x556E, 0xA82A, 0, 0x5570, 0xBA67, 0x437E, 0x556F, 0,
+ 0x4023, 0, 0x3B7B, 0, 0, 0xA82B, 0x4250, 0x3C77,
+};
static const unsigned short utf8_to_euc_E5B0[] = {
0, 0x4975, 0x406C, 0, 0x3C4D, 0x5571, 0x3E2D, 0x5572,
0x5573, 0x3053, 0x423A, 0x3F52, 0xBA69, 0x5574, 0x4633, 0x3E2E,
@@ -3569,6 +6498,16 @@ static const unsigned short utf8_to_euc_E5B0[] = {
0xBA73, 0x3D22, 0xBA74, 0, 0, 0xBA75, 0xBA76, 0,
0x5579, 0x557A, 0x3C5C, 0x3F2C, 0x4674, 0x3F54, 0x4878, 0x4722,
};
+static const unsigned short utf8_to_euc_E5B0_x0213[] = {
+ 0, 0x4975, 0x406C, 0xA82D, 0x3C4D, 0x5571, 0x3E2D, 0x5572,
+ 0x5573, 0x3053, 0x423A, 0x3F52, 0xBA69, 0x5574, 0x4633, 0x3E2E,
+ 0, 0x3E2F, 0x4F5B, 0x5575, 0, 0, 0x406D, 0xBA6A,
+ 0, 0, 0x3E30, 0, 0, 0, 0x4F5C, 0xBA6C,
+ 0x5576, 0, 0x5577, 0x4F5D, 0x4C60, 0, 0xBA6E, 0,
+ 0x5578, 0xA82E, 0, 0x4F5E, 0xBA71, 0x3646, 0xBA72, 0,
+ 0xA82F, 0x3D22, 0xBA74, 0, 0, 0xBA75, 0xBA76, 0,
+ 0x5579, 0x557A, 0x3C5C, 0x3F2C, 0x4674, 0x3F54, 0x4878, 0x4722,
+};
static const unsigned short utf8_to_euc_E5B1[] = {
0x3649, 0x557B, 0, 0, 0, 0x356F, 0x557C, 0,
0x367E, 0, 0x464F, 0x3230, 0, 0x3B53, 0x557D, 0x5622,
@@ -3579,6 +6518,16 @@ static const unsigned short utf8_to_euc_E5B1[] = {
0xBB22, 0x3B33, 0, 0, 0xBB23, 0xBB24, 0x5627, 0,
0, 0x5628, 0xBB25, 0xBB26, 0xBB27, 0xBB28, 0, 0,
};
+static const unsigned short utf8_to_euc_E5B1_x0213[] = {
+ 0x3649, 0x557B, 0, 0, 0, 0x356F, 0x557C, 0,
+ 0x367E, 0, 0x464F, 0x3230, 0, 0x3B53, 0x557D, 0x5622,
+ 0x5621, 0x367D, 0, 0x557E, 0, 0x4538, 0, 0,
+ 0, 0xBA77, 0xBA78, 0x7E7B, 0xBA79, 0, 0x4230, 0xA831,
+ 0x454B, 0x3C48, 0x4F60, 0xA832, 0x4158, 0x4D7A, 0, 0xA833,
+ 0xA834, 0xA835, 0, 0, 0x5624, 0xBB21, 0x5625, 0x4656,
+ 0xA836, 0x3B33, 0, 0, 0xBB23, 0xBB24, 0x5627, 0,
+ 0, 0x5628, 0x4F64, 0xBB26, 0xA839, 0xBB28, 0, 0,
+};
static const unsigned short utf8_to_euc_E5B2[] = {
0, 0, 0, 0, 0, 0, 0, 0xBB29,
0xBB2A, 0, 0xBB2B, 0, 0x5629, 0, 0, 0xBB2C,
@@ -3589,6 +6538,16 @@ static const unsigned short utf8_to_euc_E5B2[] = {
0, 0x4252, 0xBB35, 0x3359, 0xBB36, 0xBB37, 0x562F, 0x5631,
0x345F, 0, 0xBB38, 0x562E, 0x5630, 0, 0x5633, 0,
};
+static const unsigned short utf8_to_euc_E5B2_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0xBB29,
+ 0xA83C, 0, 0xA83D, 0, 0x5629, 0, 0, 0x4F65,
+ 0x3474, 0x562A, 0xBB2D, 0, 0x562B, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0xBB2E, 0, 0x4F66,
+ 0xA841, 0x322C, 0xA842, 0x4F67, 0, 0, 0xA843, 0xA844,
+ 0x413B, 0x3464, 0x4F68, 0x562D, 0x4C28, 0xA846, 0, 0,
+ 0, 0x4252, 0xBB35, 0x3359, 0xBB36, 0xA847, 0x562F, 0x5631,
+ 0x345F, 0, 0x4F69, 0x562E, 0x5630, 0, 0x5633, 0,
+};
static const unsigned short utf8_to_euc_E5B3[] = {
0, 0, 0, 0, 0, 0x5632, 0, 0x5634,
0, 0xBB39, 0, 0xBB3A, 0, 0, 0, 0,
@@ -3599,6 +6558,16 @@ static const unsigned short utf8_to_euc_E5B3[] = {
0x4A76, 0xBB3F, 0xBB40, 0, 0xBB41, 0xF43B, 0x4567, 0,
0, 0, 0x5638, 0x3D54, 0, 0x5637, 0, 0,
};
+static const unsigned short utf8_to_euc_E5B3_x0213[] = {
+ 0, 0, 0, 0, 0, 0x5632, 0, 0x5634,
+ 0, 0xA849, 0, 0x4F6A, 0, 0, 0, 0,
+ 0x4F6B, 0, 0x4F6C, 0, 0, 0, 0, 0xBB3D,
+ 0, 0x5635, 0, 0, 0, 0xBB3C, 0, 0,
+ 0x463D, 0x362E, 0, 0, 0, 0, 0, 0,
+ 0x3265, 0x5636, 0x563B, 0, 0, 0x5639, 0xBB3E, 0x4A77,
+ 0x4A76, 0xBB3F, 0xBB40, 0, 0x4F6D, 0xF43B, 0x4567, 0,
+ 0, 0, 0x5638, 0x3D54, 0, 0x5637, 0, 0,
+};
static const unsigned short utf8_to_euc_E5B4[] = {
0, 0xBB42, 0, 0, 0, 0, 0xBB43, 0x3F72,
0, 0, 0, 0x563C, 0, 0xBB44, 0x3A6A, 0,
@@ -3609,6 +6578,16 @@ static const unsigned short utf8_to_euc_E5B4[] = {
0, 0xBB4B, 0, 0, 0xBB4C, 0, 0, 0,
0, 0xBB4D, 0, 0, 0, 0xBB4E, 0, 0xBB4F,
};
+static const unsigned short utf8_to_euc_E5B4_x0213[] = {
+ 0, 0xBB42, 0, 0, 0, 0, 0xA84C, 0x3F72,
+ 0, 0, 0, 0x563C, 0, 0x4F70, 0x3A6A, 0,
+ 0xA84D, 0x5642, 0xBB45, 0, 0x5643, 0x563D, 0x3333, 0x563E,
+ 0x5647, 0x5646, 0x5645, 0x5641, 0, 0xA84F, 0, 0x5640,
+ 0xA850, 0, 0x5644, 0xBB47, 0xA851, 0, 0xA852, 0x4F71,
+ 0, 0x4A78, 0, 0xA84E, 0, 0, 0, 0,
+ 0, 0xA853, 0, 0, 0xBB4C, 0, 0, 0,
+ 0, 0xA854, 0, 0, 0, 0xBB4E, 0, 0xBB4F,
+};
static const unsigned short utf8_to_euc_E5B5[] = {
0, 0, 0xBB50, 0xBB51, 0, 0, 0xBB52, 0,
0xBB53, 0, 0xBB57, 0x564B, 0x5648, 0, 0x564A, 0,
@@ -3619,6 +6598,16 @@ static const unsigned short utf8_to_euc_E5B5[] = {
0xBB5F, 0, 0, 0x564D, 0, 0, 0x564E, 0,
0, 0xBB60, 0xBB61, 0, 0, 0, 0xBB62, 0xBB63,
};
+static const unsigned short utf8_to_euc_E5B5_x0213[] = {
+ 0, 0, 0xA855, 0xBB51, 0, 0, 0x4F73, 0x4F74,
+ 0xBB53, 0, 0x4F76, 0x564B, 0x5648, 0, 0x564A, 0,
+ 0x4D72, 0xBB55, 0x5649, 0x4F75, 0, 0xBB54, 0, 0,
+ 0, 0xBB56, 0, 0, 0x563F, 0, 0, 0xBB58,
+ 0xBB59, 0xA857, 0xBB5B, 0, 0xBB5C, 0, 0, 0,
+ 0, 0x3F73, 0xA858, 0, 0x564C, 0x4F77, 0, 0x3A37,
+ 0xA85A, 0, 0, 0x564D, 0, 0, 0x564E, 0,
+ 0, 0xBB60, 0xBB61, 0, 0, 0, 0xBB62, 0xBB63,
+};
static const unsigned short utf8_to_euc_E5B6[] = {
0, 0xBB64, 0x5651, 0xBB65, 0x5650, 0, 0, 0x564F,
0xBB66, 0, 0xBB67, 0x4568, 0x563A, 0, 0, 0,
@@ -3629,6 +6618,16 @@ static const unsigned short utf8_to_euc_E5B6[] = {
0xBB72, 0, 0xE674, 0, 0xBB73, 0, 0, 0x5658,
0xBB74, 0xBB75, 0x4E66, 0, 0x5659, 0x5656, 0, 0,
};
+static const unsigned short utf8_to_euc_E5B6_x0213[] = {
+ 0, 0x4F78, 0x5651, 0xBB65, 0x5650, 0, 0, 0x564F,
+ 0xA85D, 0, 0xBB67, 0x4568, 0x563A, 0, 0, 0,
+ 0x5657, 0, 0xA85F, 0xBB69, 0xA860, 0xBB6B, 0, 0xA861,
+ 0, 0xA862, 0, 0xBB6D, 0, 0x5653, 0, 0xBB6E,
+ 0x4F79, 0, 0x5652, 0, 0x4F7A, 0, 0, 0x4F7B,
+ 0, 0, 0, 0xBB71, 0x5654, 0, 0x5655, 0,
+ 0xA863, 0, 0xA864, 0, 0xA865, 0, 0, 0x5658,
+ 0x4F7C, 0xA867, 0x4E66, 0, 0x5659, 0x5656, 0, 0,
+};
static const unsigned short utf8_to_euc_E5B7[] = {
0, 0, 0, 0xBB76, 0, 0, 0, 0xBB77,
0, 0x565A, 0, 0xBB78, 0x3460, 0x565B, 0xBB7A, 0,
@@ -3639,6 +6638,16 @@ static const unsigned short utf8_to_euc_E5B7[] = {
0, 0x384A, 0x5661, 0x4C26, 0x4743, 0x5662, 0, 0x392B,
0xBC22, 0xBC23, 0, 0x342C, 0, 0x4327, 0x3652, 0,
};
+static const unsigned short utf8_to_euc_E5B7_x0213[] = {
+ 0, 0, 0, 0xBB76, 0, 0, 0, 0xBB77,
+ 0, 0x565A, 0, 0x4F7D, 0x3460, 0x565B, 0xBB7A, 0,
+ 0xBB79, 0xA868, 0x565D, 0x565C, 0, 0, 0x565E, 0xA869,
+ 0xA86A, 0xBB7C, 0, 0x565F, 0, 0x406E, 0x3D23, 0,
+ 0xA86B, 0x3D64, 0x7428, 0x4163, 0xA86D, 0x3929, 0x3A38, 0x392A,
+ 0x3570, 0xA86E, 0, 0x5660, 0, 0, 0x3A39, 0,
+ 0, 0x384A, 0x5661, 0x4C26, 0x4743, 0x5662, 0, 0x392B,
+ 0xBC22, 0xBC23, 0, 0x342C, 0, 0x4327, 0x3652, 0,
+};
static const unsigned short utf8_to_euc_E5B8[] = {
0xBC24, 0, 0x3B54, 0x495B, 0, 0, 0x4841, 0xBC25,
0, 0, 0, 0x5663, 0x3475, 0xBC26, 0, 0,
@@ -3649,6 +6658,16 @@ static const unsigned short utf8_to_euc_E5B8[] = {
0x3522, 0, 0xBC2F, 0x4422, 0, 0xBC30, 0x5668, 0x5669,
0x3E6F, 0, 0, 0, 0, 0x4B39, 0xBC31, 0,
};
+static const unsigned short utf8_to_euc_E5B8_x0213[] = {
+ 0xA870, 0, 0x3B54, 0x495B, 0, 0, 0x4841, 0xBC25,
+ 0, 0, 0, 0x5663, 0x3475, 0xBC26, 0, 0,
+ 0, 0x5666, 0xA872, 0, 0x7429, 0xA873, 0x4421, 0,
+ 0x742A, 0x5665, 0x5664, 0x5667, 0, 0x446B, 0, 0xA875,
+ 0xBC2C, 0, 0, 0, 0, 0x3F63, 0, 0,
+ 0xBC2E, 0, 0, 0x3B55, 0, 0x404A, 0xA876, 0x4253,
+ 0x3522, 0, 0xBC2F, 0x4422, 0, 0xBC30, 0x5668, 0x5669,
+ 0x3E6F, 0, 0, 0, 0, 0x4B39, 0xA877, 0,
+};
static const unsigned short utf8_to_euc_E5B9[] = {
0x566C, 0, 0, 0x566B, 0x566A, 0x497D, 0, 0x5673,
0, 0xBC34, 0, 0xBC32, 0x4B5A, 0, 0x566D, 0,
@@ -3659,6 +6678,16 @@ static const unsigned short utf8_to_euc_E5B9[] = {
0xBC41, 0, 0x3433, 0x4A3F, 0x472F, 0x5674, 0x5675, 0,
0x392C, 0x3434, 0x5676, 0x3838, 0x4D44, 0x4D29, 0x3476, 0x5678,
};
+static const unsigned short utf8_to_euc_E5B9_x0213[] = {
+ 0x566C, 0, 0, 0x566B, 0x566A, 0x497D, 0, 0x5673,
+ 0, 0xA878, 0, 0xBC32, 0x4B5A, 0, 0x566D, 0,
+ 0xBC33, 0xBC35, 0, 0, 0x566F, 0x4B6B, 0xA87A, 0x566E,
+ 0x742B, 0, 0, 0xBC38, 0xBC39, 0, 0x742C, 0x5670,
+ 0, 0x4828, 0x5671, 0x4A3E, 0x5672, 0, 0, 0,
+ 0xBC3B, 0, 0xBC3C, 0xA87C, 0xA87D, 0xA87E, 0xAC21, 0,
+ 0xBC41, 0, 0x3433, 0x4A3F, 0x472F, 0x5674, 0x5675, 0x7E7C,
+ 0x392C, 0x3434, 0x5676, 0x3838, 0x4D44, 0x4D29, 0x3476, 0x5678,
+};
static const unsigned short utf8_to_euc_E5BA[] = {
0xBC42, 0x4423, 0, 0x392D, 0x3E31, 0, 0, 0x485F,
0, 0, 0x3E32, 0xBC43, 0, 0, 0xBC44, 0x3D78,
@@ -3669,6 +6698,16 @@ static const unsigned short utf8_to_euc_E5BA[] = {
0, 0xBC4B, 0, 0xBC4C, 0, 0x3043, 0x3D6E, 0x392F,
0x4D47, 0, 0, 0, 0, 0xBC4D, 0xBC4E, 0xBC4F,
};
+static const unsigned short utf8_to_euc_E5BA_x0213[] = {
+ 0xBC42, 0x4423, 0, 0x392D, 0x3E31, 0, 0, 0x485F,
+ 0, 0, 0x3E32, 0xBC43, 0, 0, 0xBC44, 0x3D78,
+ 0, 0, 0, 0, 0, 0x446C, 0x4A79, 0x4539,
+ 0, 0, 0x392E, 0, 0x495C, 0, 0, 0,
+ 0x5679, 0, 0xBC45, 0, 0xBC46, 0xAC23, 0x4559, 0x3A42,
+ 0xBC48, 0, 0xAC24, 0x384B, 0xAC25, 0x446D, 0, 0,
+ 0, 0xBC4B, 0, 0xBC4C, 0, 0x3043, 0x3D6E, 0x392F,
+ 0x4D47, 0xAC26, 0, 0, 0, 0xBC4D, 0x742D, 0xAC27,
+};
static const unsigned short utf8_to_euc_E5BB[] = {
0, 0x567A, 0x567B, 0x4751, 0, 0, 0xBC50, 0,
0x567C, 0x4E77, 0x4F2D, 0xBC52, 0xBC51, 0, 0xBC53, 0x567E,
@@ -3679,6 +6718,16 @@ static const unsigned short utf8_to_euc_E5BB[] = {
0x572D, 0x572B, 0, 0x572C, 0x572E, 0, 0x3164, 0x446E,
0x572F, 0, 0x377A, 0x3276, 0x4736, 0, 0x5730, 0x467B,
};
+static const unsigned short utf8_to_euc_E5BB_x0213[] = {
+ 0, 0x567A, 0x567B, 0x4751, 0, 0, 0xAC28, 0,
+ 0x567C, 0x4E77, 0x4F2D, 0x742F, 0xBC51, 0, 0xBC53, 0x567E,
+ 0x567D, 0xBC54, 0xAC29, 0x3347, 0xBC56, 0xBC57, 0x5721, 0,
+ 0, 0xAC2A, 0x5724, 0x5725, 0xBC58, 0x5723, 0xBC59, 0x4940,
+ 0x3E33, 0x5727, 0x5726, 0x5722, 0, 0xBC5A, 0, 0,
+ 0x5728, 0x5729, 0, 0xBC5B, 0x572A, 0, 0, 0,
+ 0x572D, 0x572B, 0, 0x572C, 0x572E, 0, 0x3164, 0x446E,
+ 0x572F, 0x7430, 0x377A, 0x3276, 0x4736, 0xAC2C, 0x5730, 0x467B,
+};
static const unsigned short utf8_to_euc_E5BC[] = {
0, 0x4A5B, 0xBC5C, 0x5731, 0x4F2E, 0, 0xBC5D, 0xBC5E,
0xBC5F, 0x5732, 0x4A40, 0x5735, 0x5021, 0x5031, 0xBC60, 0x3C30,
@@ -3689,6 +6738,16 @@ static const unsigned short utf8_to_euc_E5BC[] = {
0xBC6C, 0x3C65, 0, 0, 0xBC6D, 0x4425, 0xBC6E, 0x362F,
0x573A, 0, 0, 0xBC6F, 0x492B, 0xBC70, 0x4346, 0xBC71,
};
+static const unsigned short utf8_to_euc_E5BC_x0213[] = {
+ 0x7431, 0x4A5B, 0x7432, 0x5731, 0x4F2E, 0, 0xBC5D, 0x7433,
+ 0xAC2D, 0x5732, 0x4A40, 0x5735, 0x5021, 0x5031, 0xAC2E, 0x3C30,
+ 0x4675, 0x5736, 0, 0x355D, 0x4424, 0x307A, 0x5737, 0x4A26,
+ 0x3930, 0xBC61, 0, 0x4350, 0xAC2F, 0x7434, 0xAC31, 0x446F,
+ 0, 0xBC64, 0xBC65, 0x7435, 0xBC67, 0x4C6F, 0x3839, 0x384C,
+ 0xBC68, 0x5738, 0, 0xBC69, 0xBC6A, 0x5739, 0xBC6B, 0x573F,
+ 0xBC6C, 0x3C65, 0, 0, 0x7436, 0x4425, 0x7437, 0x362F,
+ 0x573A, 0, 0, 0xBC6F, 0x492B, 0x7438, 0x4346, 0xBC71,
+};
static const unsigned short utf8_to_euc_E5BD[] = {
0xBC72, 0x573B, 0, 0, 0xBC73, 0xBC74, 0, 0xBC75,
0x573C, 0, 0x3630, 0, 0x573D, 0xBC76, 0x573E, 0,
@@ -3699,6 +6758,16 @@ static const unsigned short utf8_to_euc_E5BD[] = {
0x3E34, 0x3146, 0xBD22, 0x5746, 0xBD23, 0xBD24, 0, 0x5747,
0xBD25, 0x4C72, 0xBD26, 0, 0x4860, 0xBD27, 0xBD28, 0x574A,
};
+static const unsigned short utf8_to_euc_E5BD_x0213[] = {
+ 0x7439, 0x573B, 0, 0, 0xBC73, 0x743A, 0, 0xAC32,
+ 0x573C, 0, 0x3630, 0, 0x573D, 0xBC76, 0x573E, 0,
+ 0xBC77, 0x5740, 0, 0x4576, 0x743B, 0, 0x5741, 0x5742,
+ 0x743C, 0x5743, 0, 0xBC7A, 0x5734, 0x5733, 0, 0,
+ 0xBC7B, 0x5744, 0x3741, 0xAC33, 0x743D, 0, 0x4927, 0x743E,
+ 0, 0x3A4C, 0x4937, 0x4426, 0x494B, 0x5745, 0, 0xBD21,
+ 0x3E34, 0x3146, 0xAC34, 0x5746, 0xBD23, 0xBD24, 0, 0x5747,
+ 0xBD25, 0x4C72, 0xBD26, 0, 0x4860, 0x743F, 0xAC35, 0x574A,
+};
static const unsigned short utf8_to_euc_E5BE[] = {
0x317D, 0x402C, 0x5749, 0x5748, 0x3742, 0x4254, 0, 0x574E,
0x574C, 0xBD29, 0x574B, 0x4E27, 0x3865, 0xBD2A, 0, 0xBD2B,
@@ -3709,6 +6778,16 @@ static const unsigned short utf8_to_euc_E5BE[] = {
0xBD35, 0xBD36, 0, 0x4641, 0x4427, 0, 0, 0xF43E,
0xBD37, 0x4530, 0, 0, 0x5755, 0x352B, 0, 0,
};
+static const unsigned short utf8_to_euc_E5BE_x0213[] = {
+ 0x317D, 0x402C, 0x5749, 0x5748, 0x3742, 0x4254, 0, 0x574E,
+ 0x574C, 0x7440, 0x574B, 0x4E27, 0x3865, 0xBD2A, 0, 0xAC36,
+ 0x3D79, 0x574D, 0x454C, 0x3D3E, 0, 0, 0xBD2C, 0x4640,
+ 0x5751, 0x5750, 0, 0, 0x7441, 0xBD2E, 0x574F, 0,
+ 0x5752, 0x3866, 0xAC37, 0, 0xAC38, 0, 0, 0x7442,
+ 0x5753, 0x497C, 0x3D5B, 0xBD31, 0xBD33, 0x5754, 0x4879, 0x7443,
+ 0xBD35, 0xBD36, 0, 0x4641, 0x4427, 0x7444, 0, 0x7445,
+ 0xAC39, 0x4530, 0, 0, 0x5755, 0x352B, 0, 0,
+};
static const unsigned short utf8_to_euc_E5BF[] = {
0, 0, 0, 0x3F34, 0xBD38, 0x492C, 0, 0xBD39,
0xBD3A, 0xBD3B, 0, 0xBD3C, 0x3477, 0x4726, 0, 0,
@@ -3719,6 +6798,16 @@ static const unsigned short utf8_to_euc_E5BF[] = {
0x582D, 0x575A, 0xBD4C, 0xBD4D, 0, 0x4730, 0xBD4E, 0,
0x5759, 0, 0xBD4F, 0x5757, 0xBD50, 0x397A, 0, 0x575D,
};
+static const unsigned short utf8_to_euc_E5BF_x0213[] = {
+ 0, 0, 0, 0x3F34, 0xAC3A, 0x492C, 0, 0xAC3C,
+ 0xBD3A, 0x7446, 0, 0xAC3D, 0x3477, 0x4726, 0, 0,
+ 0xBD3D, 0xBD3E, 0xAC3E, 0xAC3F, 0xAC40, 0, 0x5756, 0x3B56,
+ 0x4B3A, 0x4B3B, 0, 0, 0x317E, 0x575B, 0x7447, 0,
+ 0x4369, 0x7448, 0xAC41, 0, 0x5758, 0, 0, 0,
+ 0xBD45, 0x7449, 0xBD47, 0x3277, 0xBD48, 0xBD49, 0xAC42, 0xAC43,
+ 0x582D, 0x575A, 0xBD4C, 0xAC44, 0, 0x4730, 0xBD4E, 0,
+ 0x5759, 0, 0xBD4F, 0x5757, 0xAC45, 0x397A, 0, 0x575D,
+};
static const unsigned short utf8_to_euc_E680[] = {
0, 0, 0, 0, 0, 0, 0, 0xBD51,
0, 0, 0xBD52, 0, 0, 0xBD53, 0x5763, 0x5769,
@@ -3729,6 +6818,16 @@ static const unsigned short utf8_to_euc_E680[] = {
0, 0x5764, 0, 0xBD5C, 0, 0xBD5D, 0, 0,
0, 0, 0x576A, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E680_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0xBD51,
+ 0, 0, 0xBD52, 0, 0, 0x744A, 0x5763, 0x5769,
+ 0x5761, 0, 0x455C, 0xBD54, 0x744B, 0x5766, 0x495D, 0xAC47,
+ 0x744C, 0x5760, 0xBD58, 0x5765, 0x4E67, 0x3B57, 0, 0xBD59,
+ 0x4255, 0x575E, 0xAC48, 0, 0xAC49, 0x355E, 0x5768, 0x402D,
+ 0x3165, 0x5762, 0x3278, 0x5767, 0, 0xBD5B, 0, 0x3631,
+ 0, 0x5764, 0, 0x744D, 0, 0x744E, 0, 0,
+ 0, 0, 0x576A, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E681[] = {
0xBD5E, 0x576C, 0x5776, 0x5774, 0, 0, 0x5771, 0xBD5F,
0xBD60, 0xBD61, 0x5770, 0x4E78, 0xBD62, 0x5772, 0, 0,
@@ -3739,6 +6838,16 @@ static const unsigned short utf8_to_euc_E681[] = {
0x3366, 0xBD6A, 0, 0, 0, 0x3743, 0, 0x576E,
0, 0, 0, 0, 0, 0, 0xBD6B, 0xBD6C,
};
+static const unsigned short utf8_to_euc_E681_x0213[] = {
+ 0xBD5E, 0x576C, 0x5776, 0x5774, 0, 0, 0x5771, 0x744F,
+ 0xBD60, 0xBD61, 0x5770, 0x4E78, 0xAC4B, 0x5772, 0, 0,
+ 0x3632, 0xBD63, 0x3931, 0, 0xBD64, 0x3D7A, 0xBD65, 0xBD66,
+ 0, 0x5779, 0x576B, 0, 0, 0xBD67, 0, 0x576F,
+ 0x575F, 0xBD68, 0x327A, 0x5773, 0x5775, 0x4351, 0, 0xBD69,
+ 0x3A28, 0x3238, 0x576D, 0x5778, 0x5777, 0x3633, 0, 0x4229,
+ 0x3366, 0xBD6A, 0, 0, 0, 0x3743, 0, 0x576E,
+ 0, 0, 0, 0, 0, 0, 0xBD6B, 0xAC4C,
+};
static const unsigned short utf8_to_euc_E682[] = {
0, 0x577A, 0xBD6D, 0x577D, 0x5821, 0xF43F, 0xBD6E, 0,
0xBD6F, 0x3C3D, 0xBD70, 0x5827, 0x4470, 0x577B, 0xBD71, 0,
@@ -3749,6 +6858,16 @@ static const unsigned short utf8_to_euc_E682[] = {
0xBD7C, 0xBD7D, 0x4861, 0x575C, 0x582C, 0x5830, 0x4C65, 0xBD7E,
0x5829, 0, 0, 0xBE21, 0x4569, 0x582E, 0xBE22, 0,
};
+static const unsigned short utf8_to_euc_E682_x0213[] = {
+ 0, 0x577A, 0xBD6D, 0x577D, 0x5821, 0xF43F, 0xBD6E, 0,
+ 0xBD6F, 0x3C3D, 0xAC4D, 0x5827, 0x4470, 0x577B, 0xBD71, 0,
+ 0, 0xBD72, 0x5825, 0xBD73, 0x3279, 0xAC4E, 0x5823, 0x5824,
+ 0xBD75, 0, 0x577E, 0x5822, 0, 0x7451, 0x7452, 0x3867,
+ 0x4D2A, 0, 0xBD78, 0x3435, 0xBD79, 0xBD7A, 0x3159, 0x5826,
+ 0xAC4F, 0x473A, 0x302D, 0, 0, 0, 0, 0,
+ 0xAC51, 0xAC52, 0x4861, 0x575C, 0x582C, 0x5830, 0x4C65, 0xBD7E,
+ 0x5829, 0, 0, 0xBE21, 0x4569, 0x582E, 0xAC53, 0,
+};
static const unsigned short utf8_to_euc_E683[] = {
0, 0, 0xBE23, 0, 0xBE24, 0x3E70, 0x582F, 0x4657,
0xBE25, 0xBE26, 0xBE27, 0xBE28, 0, 0, 0xBE29, 0xBE2A,
@@ -3759,6 +6878,16 @@ static const unsigned short utf8_to_euc_E683[] = {
0x4246, 0x583D, 0xBE33, 0x415B, 0x5838, 0xBE34, 0x5835, 0x5836,
0xBE35, 0x3C66, 0x5839, 0x583C, 0xBE36, 0xBE37, 0, 0,
};
+static const unsigned short utf8_to_euc_E683_x0213[] = {
+ 0, 0, 0xBE23, 0, 0xBE24, 0x3E70, 0x582F, 0x4657,
+ 0xAC54, 0xBE26, 0xBE27, 0x7453, 0, 0, 0xBE29, 0xBE2A,
+ 0, 0x4F47, 0, 0x582B, 0x7454, 0x7455, 0, 0,
+ 0x5831, 0xAC55, 0x397B, 0xAC56, 0x404B, 0x7456, 0xBE30, 0x3054,
+ 0x582A, 0x5828, 0xBE31, 0x415A, 0, 0xBE32, 0, 0x577C,
+ 0x3B34, 0, 0, 0, 0, 0, 0xAC57, 0,
+ 0x4246, 0x583D, 0xAC58, 0x415B, 0x5838, 0xAC59, 0x5835, 0x5836,
+ 0x7457, 0x3C66, 0x5839, 0x583C, 0xBE36, 0xBE37, 0, 0,
+};
static const unsigned short utf8_to_euc_E684[] = {
0x5837, 0x3D25, 0xBE38, 0x583A, 0, 0, 0x5834, 0xBE39,
0x4C7C, 0x4C7B, 0xBE3A, 0, 0xBE3B, 0x583E, 0x583F, 0x3055,
@@ -3769,6 +6898,16 @@ static const unsigned short utf8_to_euc_E684[] = {
0xBE49, 0xBE4A, 0, 0, 0x5848, 0xBE4B, 0xBE4C, 0xBE4D,
0, 0xBE4E, 0, 0, 0x5846, 0x5849, 0x5841, 0x5845,
};
+static const unsigned short utf8_to_euc_E684_x0213[] = {
+ 0x5837, 0x3D25, 0xBE38, 0x583A, 0, 0, 0x5834, 0xBE39,
+ 0x4C7C, 0x4C7B, 0xBE3A, 0, 0xBE3B, 0x583E, 0x583F, 0x3055,
+ 0xAC5A, 0xBE3D, 0xAC5B, 0xAC5C, 0xBE40, 0x5833, 0xBE41, 0xBE42,
+ 0, 0xAC5D, 0x3672, 0x3026, 0x7458, 0, 0xAC5E, 0x3436,
+ 0xF440, 0x583B, 0xBE46, 0, 0, 0, 0, 0x5843,
+ 0x5842, 0, 0xBE47, 0x7459, 0x5847, 0, 0, 0,
+ 0x745A, 0xBE4A, 0, 0, 0x5848, 0xBE4B, 0xBE4C, 0x745B,
+ 0, 0xBE4E, 0xAC5F, 0, 0x5846, 0x5849, 0x5841, 0x5845,
+};
static const unsigned short utf8_to_euc_E685[] = {
0, 0xBE4F, 0x584A, 0, 0x584B, 0xBE50, 0xBE51, 0x5840,
0x3B7C, 0xBE52, 0x5844, 0x4256, 0x3932, 0x5832, 0x3F35, 0,
@@ -3779,6 +6918,16 @@ static const unsigned short utf8_to_euc_E685[] = {
0x3056, 0x5855, 0xBE56, 0x584C, 0x5852, 0x5859, 0x3744, 0x584D,
0xBE57, 0, 0, 0xBE58, 0xBE59, 0, 0x4D5D, 0xBE5A,
};
+static const unsigned short utf8_to_euc_E685_x0213[] = {
+ 0, 0xAC61, 0x584A, 0, 0x584B, 0xBE50, 0xAC62, 0x5840,
+ 0x3B7C, 0xBE52, 0x5844, 0x4256, 0x3932, 0x5832, 0x3F35, 0,
+ 0, 0, 0, 0x5858, 0, 0x4A69, 0, 0,
+ 0x584E, 0x584F, 0x5850, 0, 0, 0x5857, 0xBE53, 0x5856,
+ 0xAC63, 0, 0x4B7D, 0x3437, 0, 0x5854, 0, 0x3745,
+ 0x3334, 0, 0, 0x5851, 0xBE55, 0, 0x4E38, 0x5853,
+ 0x3056, 0x5855, 0xBE56, 0x584C, 0x5852, 0x5859, 0x3744, 0x584D,
+ 0xBE57, 0, 0, 0xBE58, 0xAC64, 0, 0x4D5D, 0xBE5A,
+};
static const unsigned short utf8_to_euc_E686[] = {
0xBE5B, 0xBE5C, 0x4D2B, 0xBE5D, 0xBE5E, 0, 0, 0x585C,
0, 0, 0x5860, 0xBE5F, 0, 0xBE60, 0x417E, 0,
@@ -3789,6 +6938,16 @@ static const unsigned short utf8_to_euc_E686[] = {
0, 0, 0x377B, 0, 0, 0, 0x3231, 0,
0xBE6D, 0xBE6E, 0x586B, 0, 0xBE6F, 0, 0x3438, 0,
};
+static const unsigned short utf8_to_euc_E686_x0213[] = {
+ 0xBE5B, 0xBE5C, 0x4D2B, 0xBE5D, 0xBE5E, 0, 0, 0x585C,
+ 0, 0, 0x5860, 0xBE5F, 0, 0x745D, 0x417E, 0,
+ 0x4E79, 0x5861, 0xAC66, 0xAC67, 0x585E, 0, 0x585B, 0xAC68,
+ 0xAC69, 0x585A, 0x585F, 0, 0xBE65, 0xBE66, 0, 0xBE67,
+ 0xBE68, 0, 0, 0, 0x4A30, 0xAC6A, 0, 0x4634,
+ 0xAC6B, 0x3746, 0xBE6B, 0x5862, 0x585D, 0xAC6C, 0x5863, 0,
+ 0, 0, 0x377B, 0, 0, 0, 0x3231, 0,
+ 0xBE6D, 0x7460, 0x586B, 0, 0x745F, 0, 0x3438, 0,
+};
static const unsigned short utf8_to_euc_E687[] = {
0xBE70, 0xBE71, 0xBE72, 0x5869, 0, 0, 0x586A, 0x3A29,
0x5868, 0x5866, 0x5865, 0x586C, 0x5864, 0x586E, 0xBE73, 0xBE74,
@@ -3799,6 +6958,16 @@ static const unsigned short utf8_to_euc_E687[] = {
0, 0, 0x4428, 0, 0x5873, 0, 0x5871, 0x5867,
0x377C, 0, 0x5872, 0, 0x5876, 0x5875, 0x5877, 0x5874,
};
+static const unsigned short utf8_to_euc_E687_x0213[] = {
+ 0xBE70, 0xBE71, 0xBE72, 0x5869, 0, 0, 0x586A, 0x3A29,
+ 0x5868, 0x5866, 0x5865, 0x586C, 0x5864, 0x586E, 0xBE73, 0xBE74,
+ 0x327B, 0, 0, 0, 0, 0xAC6E, 0, 0,
+ 0, 0, 0, 0, 0xBE76, 0xAC6F, 0xBE78, 0xAC70,
+ 0, 0xBE7A, 0xBE7B, 0x5870, 0, 0xBE7E, 0x586F, 0xBE7C,
+ 0, 0xBE7D, 0, 0, 0xBF21, 0xBF22, 0, 0xBF23,
+ 0, 0, 0x4428, 0, 0x5873, 0xAC71, 0x5871, 0x5867,
+ 0x377C, 0, 0x5872, 0, 0x5876, 0x5875, 0x5877, 0x5874,
+};
static const unsigned short utf8_to_euc_E688[] = {
0x5878, 0xBF24, 0, 0xBF25, 0xBF26, 0, 0, 0xBF27,
0x5879, 0x587A, 0x4A6A, 0, 0x587C, 0x587B, 0x3D3F, 0,
@@ -3809,6 +6978,16 @@ static const unsigned short utf8_to_euc_E688[] = {
0x5925, 0, 0x5926, 0x5927, 0x4257, 0, 0, 0,
0x384D, 0xBF31, 0, 0x4C61, 0, 0xBF32, 0, 0x4B3C,
};
+static const unsigned short utf8_to_euc_E688_x0213[] = {
+ 0x5878, 0xBF24, 0, 0xBF25, 0xBF26, 0, 0, 0xBF27,
+ 0x5879, 0x587A, 0x4A6A, 0, 0x587C, 0x587B, 0x3D3F, 0,
+ 0x402E, 0x3266, 0x327C, 0xBF28, 0x587D, 0xAC73, 0x303F, 0,
+ 0, 0, 0x404C, 0x587E, 0xBF2A, 0x6C43, 0x5921, 0x3761,
+ 0xBF2B, 0x5922, 0x7462, 0xAC74, 0, 0, 0x406F, 0xBF2E,
+ 0, 0xAC75, 0x5923, 0xBF30, 0, 0, 0x5924, 0x353A,
+ 0x5925, 0, 0x5926, 0x5927, 0x4257, 0, 0, 0,
+ 0x384D, 0xBF31, 0, 0x4C61, 0, 0xBF32, 0x7463, 0x4B3C,
+};
static const unsigned short utf8_to_euc_E689[] = {
0x3D6A, 0x5928, 0xBF33, 0xBF34, 0xBF35, 0, 0xBF36, 0x4070,
0x6E3D, 0x4862, 0, 0x3C6A, 0xBF37, 0x3A4D, 0x5929, 0,
@@ -3819,6 +6998,16 @@ static const unsigned short utf8_to_euc_E689[] = {
0, 0x3037, 0, 0xBF42, 0, 0, 0x495E, 0,
0, 0x4863, 0xBF43, 0, 0x592F, 0xBF44, 0x5932, 0x3E35,
};
+static const unsigned short utf8_to_euc_E689_x0213[] = {
+ 0x3D6A, 0x5928, 0xBF33, 0x7464, 0xBF35, 0, 0xAC76, 0x4070,
+ 0x6E3D, 0x4862, 0, 0x3C6A, 0xAC77, 0x3A4D, 0x5929, 0,
+ 0xBF38, 0xAC78, 0xAC79, 0x4247, 0xBF3B, 0x4A27, 0x7465, 0,
+ 0x4271, 0, 0x7466, 0x592C, 0xBF3E, 0, 0x592A, 0,
+ 0x592D, 0xAC7A, 0, 0x592B, 0xAC7B, 0, 0, 0,
+ 0x592E, 0, 0, 0, 0, 0xAC7D, 0x4A31, 0x7467,
+ 0, 0x3037, 0, 0xAC7E, 0, 0, 0x495E, 0,
+ 0, 0x4863, 0xBF43, 0xAC7C, 0x592F, 0xBF44, 0x5932, 0x3E35,
+};
static const unsigned short utf8_to_euc_E68A[] = {
0x353B, 0, 0x5930, 0x5937, 0x3E36, 0, 0, 0,
0, 0x5931, 0x4744, 0, 0, 0xBF45, 0xBF46, 0xBF47,
@@ -3829,6 +7018,16 @@ static const unsigned short utf8_to_euc_E68A[] = {
0, 0x4A7A, 0, 0xBF4B, 0, 0x4471, 0xBF4C, 0xBF4D,
0, 0x4B75, 0xBF4E, 0x593B, 0x3221, 0x436A, 0xBF4F, 0xBF50,
};
+static const unsigned short utf8_to_euc_E68A_x0213[] = {
+ 0x353B, 0, 0x5930, 0x5937, 0x3E36, 0x7468, 0, 0,
+ 0, 0x5931, 0x4744, 0, 0, 0xBF45, 0xBF46, 0xBF47,
+ 0xBF48, 0x4D5E, 0x5933, 0x5934, 0x5938, 0x456A, 0x5935, 0x3933,
+ 0x405E, 0xAD21, 0, 0x5946, 0x4834, 0, 0x4272, 0,
+ 0, 0, 0, 0, 0, 0, 0xAD22, 0,
+ 0xBF4A, 0, 0, 0x4864, 0x5A2D, 0, 0, 0,
+ 0, 0x4A7A, 0, 0xBF4B, 0, 0x4471, 0xBF4C, 0xBF4D,
+ 0, 0x4B75, 0xBF4E, 0x593B, 0x3221, 0x436A, 0xBF4F, 0xBF50,
+};
static const unsigned short utf8_to_euc_E68B[] = {
0, 0, 0x5944, 0, 0xBF51, 0x4334, 0x593E, 0x5945,
0x5940, 0x5947, 0x5943, 0, 0x5942, 0x476F, 0xBF52, 0x593C,
@@ -3839,6 +7038,16 @@ static const unsigned short utf8_to_euc_E68B[] = {
0, 0x594A, 0xBF57, 0x377D, 0xBF58, 0x594F, 0x3B22, 0x3969,
0, 0, 0, 0, 0xBF59, 0xBF5A, 0x3D26, 0x593D,
};
+static const unsigned short utf8_to_euc_E68B_x0213[] = {
+ 0, 0, 0x5944, 0, 0x7469, 0x4334, 0x593E, 0x5945,
+ 0x5940, 0x5947, 0x5943, 0, 0x5942, 0x476F, 0xBF52, 0x593C,
+ 0x327D, 0x593A, 0x3571, 0x4273, 0x5936, 0xAD23, 0x746A, 0x5939,
+ 0x3934, 0x405B, 0xBF55, 0x3E37, 0x5941, 0x4752, 0, 0,
+ 0x3572, 0x3348, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0xBF56, 0, 0x3367, 0x3F21, 0x5949, 0x594E,
+ 0, 0x594A, 0xBF57, 0x377D, 0xBF58, 0x594F, 0x3B22, 0x3969,
+ 0, 0, 0, 0, 0x746B, 0xAD25, 0x3D26, 0x593D,
+};
static const unsigned short utf8_to_euc_E68C[] = {
0, 0x3B7D, 0x594C, 0xBF5B, 0xBF5C, 0, 0, 0x3B58,
0x594D, 0x3044, 0xBF5D, 0xBF5E, 0x5948, 0xBF5F, 0, 0,
@@ -3849,6 +7058,16 @@ static const unsigned short utf8_to_euc_E68C[] = {
0, 0, 0, 0, 0, 0xBF67, 0xBF68, 0,
0, 0xBF69, 0x4472, 0, 0xBF6A, 0x4854, 0x5951, 0x415E,
};
+static const unsigned short utf8_to_euc_E68C_x0213[] = {
+ 0, 0x3B7D, 0x594C, 0xAD26, 0xBF5C, 0, 0, 0x3B58,
+ 0x594D, 0x3044, 0x746C, 0xBF5E, 0x5948, 0xAD27, 0, 0,
+ 0xAD28, 0x4429, 0, 0xBF61, 0, 0, 0xBF62, 0,
+ 0x746D, 0x3573, 0, 0, 0, 0, 0, 0x3634,
+ 0, 0, 0, 0, 0, 0, 0, 0x594B,
+ 0x3027, 0xBF64, 0xBF65, 0x3A43, 0, 0xBF66, 0, 0x3F36,
+ 0, 0, 0xAD2B, 0, 0, 0xAD2C, 0xBF68, 0,
+ 0, 0x746E, 0x4472, 0xAD2D, 0xAD2E, 0x4854, 0x5951, 0x415E,
+};
static const unsigned short utf8_to_euc_E68D[] = {
0, 0xBF6B, 0xBF6C, 0xBF6D, 0xBF6E, 0, 0xBF6F, 0,
0, 0x422A, 0xBF70, 0xBF71, 0x3B2B, 0x5952, 0xBF72, 0x5954,
@@ -3859,6 +7078,16 @@ static const unsigned short utf8_to_euc_E68D[] = {
0, 0xBF7C, 0x377E, 0, 0xBF7D, 0xBF7E, 0x5959, 0x3E39,
0xC021, 0, 0x4668, 0x4731, 0xC022, 0xC023, 0, 0xC024,
};
+static const unsigned short utf8_to_euc_E68D_x0213[] = {
+ 0, 0xAD2F, 0xBF6C, 0x746F, 0xAD30, 0, 0xBF6F, 0,
+ 0, 0x422A, 0xBF70, 0xBF71, 0x3B2B, 0x5952, 0xAD31, 0x5954,
+ 0x5950, 0, 0xBF73, 0xBF74, 0xBF75, 0x4A61, 0, 0x443D,
+ 0xBF76, 0xAD33, 0, 0xBF77, 0x415C, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0x7470, 0xBF79, 0x4A7B,
+ 0x3C4E, 0x5960, 0, 0x595F, 0xAD36, 0xBF7B, 0x3F78, 0,
+ 0, 0xBF7C, 0x377E, 0, 0xBF7D, 0xBF7E, 0x5959, 0x3E39,
+ 0xC021, 0, 0x4668, 0x4731, 0x7471, 0xC023, 0, 0xC024,
+};
static const unsigned short utf8_to_euc_E68E[] = {
0x5957, 0, 0xC025, 0x415D, 0xC026, 0, 0, 0xC027,
0x3C78, 0x595C, 0xC028, 0, 0x3E38, 0, 0x5956, 0x595B,
@@ -3869,6 +7098,16 @@ static const unsigned short utf8_to_euc_E68E[] = {
0, 0, 0x3747, 0, 0x444F, 0x595E, 0, 0,
0, 0, 0, 0x415F, 0, 0xC034, 0x5961, 0,
};
+static const unsigned short utf8_to_euc_E68E_x0213[] = {
+ 0x5957, 0, 0xC025, 0x415D, 0xAD37, 0, 0, 0xC027,
+ 0x3C78, 0x595C, 0xC028, 0, 0x3E38, 0, 0x5956, 0x595B,
+ 0xC029, 0, 0x4753, 0, 0xAD3A, 0xC02B, 0x5955, 0,
+ 0x3721, 0xAD38, 0xC02D, 0x335D, 0, 0, 0xC02E, 0x595D,
+ 0x4E2B, 0x3A4E, 0x4335, 0x595A, 0xC02F, 0x405C, 0xC030, 0x3935,
+ 0x3F64, 0x3166, 0x413C, 0x5958, 0x3545, 0xC031, 0xC032, 0xC033,
+ 0, 0, 0x3747, 0, 0x444F, 0x595E, 0, 0,
+ 0, 0, 0, 0x415F, 0, 0xAD3B, 0x5961, 0,
+};
static const unsigned short utf8_to_euc_E68F[] = {
0x5963, 0xC035, 0, 0x4237, 0x5969, 0xC036, 0x5964, 0,
0xC037, 0x5966, 0, 0, 0, 0, 0xC038, 0x4941,
@@ -3879,6 +7118,16 @@ static const unsigned short utf8_to_euc_E68F[] = {
0, 0, 0xC042, 0xC043, 0x3167, 0xC044, 0x5968, 0,
0xC045, 0xC046, 0x4D49, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E68F_x0213[] = {
+ 0x5963, 0xC035, 0, 0x4237, 0x5969, 0xC036, 0x5964, 0,
+ 0xC037, 0x5966, 0, 0, 0, 0, 0xC038, 0x4941,
+ 0x4473, 0xC039, 0x5967, 0xC03A, 0xAD3D, 0xAD3E, 0x4D2C, 0,
+ 0, 0, 0x4D48, 0x3439, 0xAD3F, 0, 0, 0,
+ 0xAD40, 0x302E, 0, 0x5965, 0, 0x7472, 0, 0,
+ 0, 0x5962, 0xC040, 0xAD41, 0xAD42, 0x7473, 0x3478, 0,
+ 0, 0, 0xAD43, 0xC043, 0x3167, 0x7474, 0x5968, 0xAD3C,
+ 0xC045, 0xC046, 0x4D49, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E690[] = {
0, 0, 0, 0, 0, 0, 0x596C, 0,
0, 0xC047, 0xC048, 0, 0, 0x423B, 0, 0x5973,
@@ -3889,6 +7138,16 @@ static const unsigned short utf8_to_euc_E690[] = {
0xC055, 0, 0, 0, 0x596B, 0xC056, 0x596F, 0,
0, 0, 0x3748, 0, 0, 0xC057, 0x3A71, 0xC058,
};
+static const unsigned short utf8_to_euc_E690_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0x596C, 0,
+ 0, 0xAD44, 0xC048, 0, 0, 0x423B, 0, 0x5973,
+ 0x7475, 0, 0xC04A, 0x596D, 0x7476, 0, 0x596A, 0x5971,
+ 0xC04C, 0, 0, 0, 0x5953, 0, 0xAD45, 0,
+ 0xC04E, 0, 0x7477, 0, 0xC050, 0xAD46, 0x596E, 0,
+ 0x5972, 0xAD47, 0xC053, 0, 0x4842, 0x456B, 0, 0xAD48,
+ 0xC055, 0, 0, 0, 0x596B, 0xC056, 0x596F, 0,
+ 0, 0, 0x3748, 0, 0, 0xC057, 0x3A71, 0xC058,
+};
static const unsigned short utf8_to_euc_E691[] = {
0, 0, 0x405D, 0, 0, 0, 0, 0,
0, 0, 0, 0xC059, 0, 0, 0x5977, 0xC05A,
@@ -3899,6 +7158,16 @@ static const unsigned short utf8_to_euc_E691[] = {
0, 0, 0, 0xC068, 0xC069, 0, 0x5976, 0,
0x4C4E, 0, 0x4022, 0xC06A, 0, 0xC06B, 0, 0,
};
+static const unsigned short utf8_to_euc_E691_x0213[] = {
+ 0, 0, 0x405D, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0xC059, 0, 0, 0x5977, 0xC05A,
+ 0, 0x7479, 0xC05C, 0xC05D, 0xC05E, 0, 0, 0,
+ 0x4526, 0, 0xAD49, 0xAD4A, 0xC061, 0xAD4B, 0, 0xC063,
+ 0x747A, 0xC065, 0, 0xC066, 0, 0, 0, 0x5974,
+ 0, 0x4B60, 0, 0, 0, 0x747B, 0, 0x5975,
+ 0, 0, 0, 0xAD4C, 0xC069, 0, 0x5976, 0,
+ 0x4C4E, 0x7478, 0x4022, 0xC06A, 0, 0xAD4D, 0, 0,
+};
static const unsigned short utf8_to_euc_E692[] = {
0, 0, 0, 0x3762, 0, 0xC06C, 0, 0xC06D,
0x597D, 0, 0, 0, 0, 0, 0, 0xC06E,
@@ -3909,6 +7178,16 @@ static const unsigned short utf8_to_euc_E692[] = {
0x4071, 0, 0x4B50, 0xC07B, 0, 0, 0, 0,
0, 0x3349, 0, 0x5A25, 0x597E, 0xC07C, 0xC07D, 0xC07E,
};
+static const unsigned short utf8_to_euc_E692_x0213[] = {
+ 0, 0, 0, 0x3762, 0, 0xC06C, 0, 0xAD4E,
+ 0x597D, 0, 0, 0, 0, 0, 0, 0xC06E,
+ 0xC06F, 0xAD4F, 0x3B35, 0x597A, 0, 0x5979, 0, 0,
+ 0xC071, 0xC072, 0x4732, 0xC073, 0, 0xAD50, 0x4635, 0xAD51,
+ 0, 0xC076, 0, 0xC077, 0x4531, 0x597B, 0xC078, 0,
+ 0xC079, 0x597C, 0, 0x496F, 0xC07A, 0x4745, 0x3B23, 0,
+ 0x4071, 0, 0x4B50, 0xC07B, 0, 0, 0, 0,
+ 0, 0x3349, 0, 0x5A25, 0x597E, 0xC07C, 0x747D, 0x747E,
+};
static const unsigned short utf8_to_euc_E693[] = {
0, 0x4D4A, 0x5A27, 0, 0xC121, 0x5A23, 0, 0x5A24,
0, 0xC122, 0xC123, 0xC124, 0xC125, 0x4160, 0xC126, 0,
@@ -3919,6 +7198,16 @@ static const unsigned short utf8_to_euc_E693[] = {
0xC130, 0x5A28, 0x5A33, 0, 0x5A32, 0xC131, 0x5A31, 0xC132,
0, 0, 0x5A34, 0xC133, 0, 0x5A36, 0x3E71, 0xC134,
};
+static const unsigned short utf8_to_euc_E693_x0213[] = {
+ 0, 0x4D4A, 0x5A27, 0, 0x7521, 0x5A23, 0, 0x5A24,
+ 0, 0xC122, 0x7522, 0xAD52, 0xAD53, 0x4160, 0x747C, 0,
+ 0x7523, 0xC128, 0x5A22, 0, 0x593F, 0xAD54, 0, 0xAD55,
+ 0x5A26, 0, 0x5A21, 0, 0, 0, 0, 0,
+ 0x5A2B, 0x5A2C, 0x4527, 0x5A2E, 0xAD57, 0xAD58, 0x3B24, 0x5A29,
+ 0, 0xC12D, 0xC12E, 0, 0x353C, 0xC12F, 0, 0x5A2F,
+ 0xC130, 0x5A28, 0x5A33, 0, 0x5A32, 0xC131, 0x5A31, 0x7524,
+ 0, 0, 0x5A34, 0x7525, 0, 0x5A36, 0x3E71, 0xAD59,
+};
static const unsigned short utf8_to_euc_E694[] = {
0x5A35, 0xC135, 0, 0, 0xC136, 0x5A39, 0, 0,
0xC137, 0xC138, 0xC139, 0, 0, 0, 0, 0xC13A,
@@ -3929,6 +7218,16 @@ static const unsigned short utf8_to_euc_E694[] = {
0, 0xC146, 0, 0, 0x5A3D, 0x5A3E, 0x5A40, 0x5A3F,
0x5A41, 0x327E, 0xC147, 0x3936, 0xC148, 0xC149, 0x4A7C, 0x402F,
};
+static const unsigned short utf8_to_euc_E694_x0213[] = {
+ 0x5A35, 0xC135, 0, 0, 0xAD5A, 0x5A39, 0, 0,
+ 0xC137, 0xC138, 0xC139, 0, 0, 0, 0, 0xAD5C,
+ 0, 0, 0, 0xC13B, 0xAD5D, 0, 0xAD5E, 0,
+ 0x5A37, 0xC13E, 0, 0xC13F, 0x5A38, 0x5970, 0xAD60, 0xC141,
+ 0, 0, 0x7526, 0x5A3B, 0x5A3A, 0, 0xC143, 0,
+ 0, 0x7527, 0x5978, 0x5A3C, 0x5A30, 0, 0xC145, 0x3B59,
+ 0, 0xC146, 0xAD61, 0, 0x5A3D, 0x5A3E, 0x5A40, 0x5A3F,
+ 0x5A41, 0x327E, 0xC147, 0x3936, 0xC148, 0xC149, 0x4A7C, 0x402F,
+};
static const unsigned short utf8_to_euc_E695[] = {
0, 0, 0, 0xC14A, 0, 0x384E, 0, 0xC14B,
0x5A43, 0xC14C, 0, 0, 0, 0x5A46, 0xF441, 0x4952,
@@ -3939,6 +7238,16 @@ static const unsigned short utf8_to_euc_E695[] = {
0x3F74, 0, 0x5A4A, 0, 0x4030, 0x4528, 0, 0x495F,
0x5A4B, 0, 0xC154, 0, 0, 0xC155, 0, 0,
};
+static const unsigned short utf8_to_euc_E695_x0213[] = {
+ 0, 0, 0, 0xC14A, 0xAD62, 0x384E, 0, 0xC14B,
+ 0x5A43, 0xC14C, 0, 0, 0, 0x5A46, 0xF441, 0x4952,
+ 0xC14D, 0x355F, 0xC14E, 0, 0xAD63, 0x5A45, 0x5A44, 0x4754,
+ 0x5A47, 0x3635, 0, 0, 0, 0x5A49, 0x5A48, 0xC150,
+ 0xC151, 0, 0x343A, 0x3B36, 0, 0, 0x4658, 0x7529,
+ 0, 0, 0, 0xAD64, 0x3749, 0, 0, 0,
+ 0x3F74, 0, 0x5A4A, 0, 0x4030, 0x4528, 0, 0x495F,
+ 0x5A4B, 0, 0xAD65, 0, 0, 0xC155, 0, 0,
+};
static const unsigned short utf8_to_euc_E696[] = {
0, 0xC156, 0x5A4C, 0x5A4D, 0, 0xC157, 0, 0x4A38,
0x555D, 0x4046, 0xC158, 0, 0x494C, 0, 0x3A58, 0,
@@ -3949,6 +7258,16 @@ static const unsigned short utf8_to_euc_E696[] = {
0x3F37, 0, 0xC161, 0xC162, 0xC163, 0, 0, 0x5A52,
0, 0x4A7D, 0, 0, 0x3177, 0x3B5C, 0, 0xC164,
};
+static const unsigned short utf8_to_euc_E696_x0213[] = {
+ 0, 0xAD66, 0x5A4C, 0x5A4D, 0xAD67, 0xAD68, 0, 0x4A38,
+ 0x555D, 0x4046, 0xAD69, 0, 0x494C, 0, 0x3A58, 0,
+ 0x4865, 0x4843, 0xC159, 0, 0, 0xC15A, 0, 0x454D,
+ 0xC15B, 0x4E41, 0, 0x5A4F, 0x3C50, 0x752A, 0, 0x5A50,
+ 0xC15D, 0x3036, 0, 0xC15E, 0x3654, 0x404D, 0xC15F, 0x4960,
+ 0, 0, 0, 0x5A51, 0x3B42, 0x4347, 0xC160, 0x3B5B,
+ 0x3F37, 0, 0xAD6A, 0xC162, 0xC163, 0xAD6B, 0, 0x5A52,
+ 0xAD6C, 0x4A7D, 0, 0, 0x3177, 0x3B5C, 0, 0xAD6D,
+};
static const unsigned short utf8_to_euc_E697[] = {
0, 0x5A55, 0xC165, 0x5A53, 0x5A56, 0x4E39, 0x5A54, 0,
0xC166, 0xC167, 0, 0x407B, 0x5A57, 0, 0xC168, 0x4232,
@@ -3959,6 +7278,16 @@ static const unsigned short utf8_to_euc_E697[] = {
0xC16E, 0x5A5D, 0xC16F, 0, 0xC170, 0xC171, 0, 0,
0, 0xC172, 0x3222, 0x5A61, 0, 0, 0xC173, 0xC174,
};
+static const unsigned short utf8_to_euc_E697_x0213[] = {
+ 0, 0x5A55, 0xAD6E, 0x5A53, 0x5A56, 0x4E39, 0x5A54, 0,
+ 0xC166, 0xAD6F, 0, 0x407B, 0x5A57, 0, 0xC168, 0x4232,
+ 0xC169, 0, 0x5A58, 0, 0xAD70, 0, 0xC16B, 0x347A,
+ 0xC16C, 0x5A5A, 0, 0x5A59, 0, 0, 0, 0xC16D,
+ 0x5A5B, 0x5A5C, 0x347B, 0, 0, 0x467C, 0x4336, 0x356C,
+ 0x3B5D, 0x4161, 0, 0, 0x3D5C, 0x3030, 0, 0,
+ 0xC16E, 0x5A5D, 0xAD72, 0, 0xC170, 0xC171, 0, 0,
+ 0, 0xAD73, 0x3222, 0x5A61, 0xAD74, 0, 0xC173, 0xC174,
+};
static const unsigned short utf8_to_euc_E698[] = {
0xC175, 0, 0x3937, 0x5A60, 0xC176, 0, 0x3A2B, 0x3E3A,
0xC177, 0xC178, 0x5A5F, 0, 0x3E3B, 0xC179, 0x4C40, 0x3A2A,
@@ -3969,6 +7298,16 @@ static const unsigned short utf8_to_euc_E698[] = {
0xC22C, 0xC22D, 0, 0xC22E, 0x5A65, 0x5A63, 0x5A64, 0xC230,
0, 0xC22F, 0, 0xF442, 0x436B, 0, 0, 0x5B26,
};
+static const unsigned short utf8_to_euc_E698_x0213[] = {
+ 0x752C, 0, 0x3937, 0x5A60, 0xAD75, 0, 0x3A2B, 0x3E3A,
+ 0xAD76, 0x752D, 0x5A5F, 0, 0x3E3B, 0xC179, 0x4C40, 0x3A2A,
+ 0, 0xC17A, 0xC17B, 0x3057, 0x404E, 0x752E, 0xC17D, 0,
+ 0, 0, 0, 0, 0x5A66, 0xC17E, 0x752F, 0x4031,
+ 0x3147, 0xAD77, 0x7531, 0xC224, 0x7532, 0x3D55, 0xC226, 0x4B66,
+ 0x3A72, 0xC227, 0xAD78, 0x7533, 0xC22A, 0x3E3C, 0xC22B, 0x4027,
+ 0x7534, 0x7535, 0, 0x7536, 0x5A65, 0x5A63, 0x5A64, 0xC230,
+ 0, 0xC22F, 0x7530, 0xF442, 0x436B, 0, 0, 0x5B26,
+};
static const unsigned short utf8_to_euc_E699[] = {
0xC231, 0x5A6A, 0x3B7E, 0x3938, 0x5A68, 0xC232, 0xC233, 0,
0, 0x5A69, 0xC234, 0x3F38, 0xC235, 0, 0xC237, 0x5A67,
@@ -3979,6 +7318,16 @@ static const unsigned short utf8_to_euc_E699[] = {
0x5A72, 0, 0, 0xC244, 0x4032, 0xC245, 0x3E3D, 0xC247,
0xC248, 0xC249, 0x4352, 0xC24A, 0xC24C, 0, 0xC243, 0xC246,
};
+static const unsigned short utf8_to_euc_E699_x0213[] = {
+ 0xC231, 0x5A6A, 0x3B7E, 0x3938, 0x5A68, 0xAD79, 0xC233, 0,
+ 0x7538, 0x5A69, 0xC234, 0x3F38, 0x7539, 0, 0xAD7B, 0x5A67,
+ 0, 0xAD7A, 0x3B2F, 0, 0, 0, 0, 0xAD7E,
+ 0xC239, 0x753B, 0x753C, 0xAE21, 0xC23C, 0x5A6C, 0x5A6B, 0x5A70,
+ 0xC23D, 0x753D, 0x5A71, 0xAE22, 0x5A6D, 0x753E, 0x3322, 0x5A6E,
+ 0x5A6F, 0x4855, 0xAE25, 0xAE26, 0xAE27, 0xAE28, 0x4961, 0x374A,
+ 0x5A72, 0, 0, 0x753F, 0x4032, 0xC245, 0x3E3D, 0x7540,
+ 0x7541, 0xC249, 0x4352, 0xAE29, 0xC24C, 0, 0xC243, 0xC246,
+};
static const unsigned short utf8_to_euc_E69A[] = {
0xC24B, 0x3647, 0, 0x5A73, 0x5A77, 0, 0, 0x324B,
0x5A74, 0x5A76, 0, 0xC24D, 0xC24E, 0xC24F, 0x5A75, 0,
@@ -3989,6 +7338,16 @@ static const unsigned short utf8_to_euc_E69A[] = {
0, 0xC25A, 0xC25B, 0, 0x4B3D, 0xC25C, 0, 0,
0x5B22, 0x5A7B, 0, 0xC25D, 0x5A7E, 0, 0x5A7D, 0xC25E,
};
+static const unsigned short utf8_to_euc_E69A_x0213[] = {
+ 0xAE2A, 0x3647, 0, 0x5A73, 0x5A77, 0, 0, 0x324B,
+ 0x5A74, 0x5A76, 0, 0xC24D, 0xC24E, 0x7542, 0x5A75, 0,
+ 0xAE2B, 0x3D6B, 0xAE2C, 0, 0, 0, 0x4348, 0x3045,
+ 0x5A78, 0xAE2D, 0xC253, 0xC254, 0xC255, 0x5A79, 0, 0xC256,
+ 0x7544, 0, 0x442A, 0, 0xC258, 0, 0x4E71, 0,
+ 0, 0, 0, 0x3B43, 0, 0xAE2F, 0x4A6B, 0,
+ 0, 0xAE30, 0x7545, 0, 0x4B3D, 0xAE31, 0, 0,
+ 0x5B22, 0x5A7B, 0, 0x7546, 0x5A7E, 0, 0x5A7D, 0xAE33,
+};
static const unsigned short utf8_to_euc_E69B[] = {
0xC25F, 0x5A7A, 0xC260, 0xC261, 0x5B21, 0, 0, 0x465E,
0xC262, 0x5A7C, 0, 0, 0xC263, 0, 0xC264, 0xC265,
@@ -3999,6 +7358,16 @@ static const unsigned short utf8_to_euc_E69B[] = {
0x5B29, 0, 0x364A, 0x3148, 0x3939, 0x5B2A, 0, 0x5B2B,
0x3D71, 0x4162, 0xC26D, 0xC23F, 0x5258, 0x413E, 0x413D, 0x4258,
};
+static const unsigned short utf8_to_euc_E69B_x0213[] = {
+ 0xC25F, 0x5A7A, 0xC260, 0xC261, 0x5B21, 0, 0x7547, 0x465E,
+ 0x7548, 0x5A7C, 0, 0, 0xC263, 0, 0xC264, 0xC265,
+ 0, 0, 0, 0, 0xC266, 0, 0x5B23, 0,
+ 0, 0x3D6C, 0x5B24, 0x754A, 0x4D4B, 0x4778, 0, 0xC268,
+ 0x5B25, 0, 0, 0, 0, 0, 0x5B27, 0,
+ 0x754B, 0x5B28, 0, 0xC26A, 0xAE35, 0, 0xC26C, 0,
+ 0x5B29, 0, 0x364A, 0x3148, 0x3939, 0x5B2A, 0, 0x5B2B,
+ 0x3D71, 0x4162, 0x754C, 0x7537, 0x5258, 0x413E, 0x413D, 0x4258,
+};
static const unsigned short utf8_to_euc_E69C[] = {
0x3A47, 0, 0, 0x5072, 0, 0xC26E, 0, 0xC26F,
0x376E, 0x4D2D, 0, 0x4A7E, 0, 0x497E, 0xC270, 0x5B2C,
@@ -4009,6 +7378,16 @@ static const unsigned short utf8_to_euc_E69C[] = {
0, 0x3C6B, 0, 0xC276, 0x4B51, 0, 0x5B34, 0x5B37,
0x5B36, 0, 0x3479, 0, 0, 0x3560, 0xC277, 0x5B33,
};
+static const unsigned short utf8_to_euc_E69C_x0213[] = {
+ 0x3A47, 0xAE37, 0, 0x5072, 0, 0xAE38, 0, 0xC26F,
+ 0x376E, 0x4D2D, 0, 0x4A7E, 0, 0x497E, 0xC270, 0x5B2C,
+ 0, 0, 0xAE39, 0x754D, 0x3A73, 0x443F, 0x5B2D, 0x4F2F,
+ 0, 0xAE3B, 0, 0x4B3E, 0xC273, 0x442B, 0x5B2E, 0x347C,
+ 0xC274, 0, 0xC275, 0, 0, 0, 0x5B2F, 0x5B30,
+ 0x4C5A, 0, 0x4C24, 0x4B76, 0x4B5C, 0x3B25, 0x5B32, 0,
+ 0, 0x3C6B, 0, 0x754F, 0x4B51, 0, 0x5B34, 0x5B37,
+ 0x5B36, 0, 0x3479, 0, 0, 0x3560, 0xC277, 0x5B33,
+};
static const unsigned short utf8_to_euc_E69D[] = {
0, 0x5B35, 0, 0, 0, 0xC278, 0x5B38, 0xC279,
0xC27A, 0x3F79, 0, 0, 0xC27B, 0, 0x4D7B, 0x3049,
@@ -4019,6 +7398,16 @@ static const unsigned short utf8_to_euc_E69D[] = {
0x5B3F, 0x456C, 0x5A5E, 0x5A62, 0xC324, 0x354F, 0xC325, 0x4747,
0, 0, 0, 0xC326, 0x5B41, 0, 0x3E3E, 0x4844,
};
+static const unsigned short utf8_to_euc_E69D_x0213[] = {
+ 0, 0x5B35, 0, 0, 0, 0xC278, 0x5B38, 0x7551,
+ 0x7552, 0x3F79, 0, 0, 0xAE3E, 0xAE3F, 0x4D7B, 0x3049,
+ 0x3A60, 0x423C, 0, 0x3C5D, 0xAE40, 0xC27D, 0x3E73, 0,
+ 0, 0x5B3B, 0, 0, 0x454E, 0xAE41, 0x5B39, 0x422B,
+ 0x5B3A, 0x3E72, 0x4C5D, 0x5B3C, 0x5B3D, 0x4D68, 0x7550, 0,
+ 0, 0, 0x5B42, 0, 0xC322, 0x393A, 0xC323, 0x4755,
+ 0x5B3F, 0x456C, 0x5A5E, 0x5A62, 0xAE45, 0x354F, 0xAE46, 0x4747,
+ 0, 0, 0, 0x7553, 0x5B41, 0, 0x3E3E, 0x4844,
+};
static const unsigned short utf8_to_euc_E69E[] = {
0, 0xC327, 0, 0, 0xC328, 0x5B47, 0, 0x487A,
0, 0x5B3E, 0, 0x5B44, 0x5B43, 0, 0xC329, 0xC32A,
@@ -4029,6 +7418,16 @@ static const unsigned short utf8_to_euc_E69E[] = {
0xC331, 0xC332, 0xC333, 0x5B4C, 0x5B4A, 0xC334, 0x324D, 0x5B48,
0x5B4E, 0x5B54, 0, 0xC335, 0xC336, 0xC337, 0, 0,
};
+static const unsigned short utf8_to_euc_E69E_x0213[] = {
+ 0, 0x7554, 0, 0, 0xC328, 0x5B47, 0, 0x487A,
+ 0, 0x5B3E, 0, 0x5B44, 0x5B43, 0, 0xC329, 0xC32A,
+ 0x404F, 0xC32B, 0xAE48, 0x7555, 0, 0x4B6D, 0xC32D, 0x4E53,
+ 0x7556, 0xC32F, 0x4B67, 0x7557, 0x324C, 0x3B5E, 0, 0,
+ 0x4F48, 0x5B46, 0x3F75, 0, 0, 0, 0x5B45, 0,
+ 0, 0x5B40, 0, 0, 0, 0, 0, 0x384F,
+ 0xAE4C, 0xC332, 0xAE4D, 0x5B4C, 0x5B4A, 0xC334, 0x324D, 0x5B48,
+ 0x5B4E, 0x5B54, 0, 0x7558, 0xC336, 0xC337, 0, 0,
+};
static const unsigned short utf8_to_euc_E69F[] = {
0xC339, 0x4248, 0xC33A, 0xC33B, 0x4A41, 0xC33C, 0x5B56, 0,
0xC33D, 0xC33E, 0x4922, 0, 0, 0, 0x5B55, 0x4770,
@@ -4039,6 +7438,16 @@ static const unsigned short utf8_to_euc_E69F[] = {
0xC345, 0x436C, 0xC346, 0x4C78, 0x3C46, 0x3A74, 0xC347, 0xC348,
0, 0xC338, 0, 0x3A3A, 0, 0, 0x4B6F, 0x3341,
};
+static const unsigned short utf8_to_euc_E69F_x0213[] = {
+ 0x755A, 0x4248, 0xC33A, 0xAE4E, 0x4A41, 0xC33C, 0x5B56, 0,
+ 0xAE4F, 0xC33E, 0x4922, 0, 0, 0, 0x5B55, 0x4770,
+ 0x4B3F, 0x343B, 0xAE50, 0x4077, 0x3D40, 0, 0, 0x755B,
+ 0x4453, 0xAE51, 0x4D2E, 0xAE52, 0xC342, 0x5B51, 0x5B50, 0,
+ 0, 0xC343, 0x5B52, 0, 0x5B4F, 0, 0xC344, 0x5B57,
+ 0, 0x5B4D, 0, 0, 0x5B4B, 0, 0x5B53, 0x5B49,
+ 0xAE53, 0x436C, 0xC346, 0x4C78, 0x3C46, 0x3A74, 0xC347, 0xAE54,
+ 0, 0x7559, 0, 0x3A3A, 0x755C, 0, 0x4B6F, 0x3341,
+};
static const unsigned short utf8_to_euc_E6A0[] = {
0, 0xF446, 0x444E, 0x464A, 0x3149, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -4049,6 +7458,16 @@ static const unsigned short utf8_to_euc_E6A0[] = {
0xC353, 0xC354, 0x5B5E, 0xC355, 0x4073, 0, 0, 0,
0x334B, 0x3A2C, 0, 0xC356, 0x334A, 0x3A4F, 0, 0xC357,
};
+static const unsigned short utf8_to_euc_E6A0_x0213[] = {
+ 0, 0x755D, 0x444E, 0x464A, 0x3149, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0xAE4B, 0, 0, 0x4072, 0xC34A, 0, 0x4034, 0x372A,
+ 0xAE58, 0xC34B, 0, 0, 0, 0x755F, 0x5B59, 0xAE59,
+ 0, 0x393B, 0x337C, 0, 0, 0, 0, 0xC34F,
+ 0xC34E, 0x5B5B, 0x3374, 0x5B61, 0x7560, 0xAE5A, 0, 0xC352,
+ 0xC353, 0x7561, 0x5B5E, 0xAE5C, 0x4073, 0, 0, 0,
+ 0x334B, 0x3A2C, 0, 0xAE5D, 0x334A, 0x3A4F, 0xAE5E, 0xC357,
+};
static const unsigned short utf8_to_euc_E6A1[] = {
0x5B5C, 0x3765, 0x374B, 0x456D, 0xC358, 0xC359, 0x5B5A, 0,
0x3046, 0, 0xC35A, 0, 0xC35B, 0x5B5D, 0x5B5F, 0,
@@ -4059,6 +7478,16 @@ static const unsigned short utf8_to_euc_E6A1[] = {
0xC363, 0xC364, 0xC365, 0, 0x5B6F, 0xC366, 0x3233, 0x5B64,
0, 0xC367, 0xC368, 0xC369, 0xC36A, 0, 0x5B75, 0x5B65,
};
+static const unsigned short utf8_to_euc_E6A1_x0213[] = {
+ 0x5B5C, 0x3765, 0x374B, 0x456D, 0xAE5F, 0xAE60, 0x5B5A, 0,
+ 0x3046, 0xAE61, 0xC35A, 0, 0xAE62, 0x5B5D, 0x5B5F, 0,
+ 0x364D, 0x372C, 0x755E, 0x343C, 0x354B, 0xAE63, 0, 0xAE64,
+ 0xC35E, 0x5B62, 0, 0x7562, 0x3A79, 0x4B71, 0, 0x3B37,
+ 0, 0, 0, 0x5B63, 0, 0, 0, 0x4930,
+ 0, 0, 0, 0xAE66, 0, 0, 0xAE67, 0xC362,
+ 0xC363, 0xC364, 0x7563, 0, 0x5B6F, 0x7564, 0x3233, 0x5B64,
+ 0, 0xC367, 0xAE68, 0xC369, 0xAE69, 0, 0x5B75, 0x5B65,
+};
static const unsigned short utf8_to_euc_E6A2[] = {
0, 0x4E42, 0xC36B, 0x5B6C, 0xC36C, 0x475F, 0xC36D, 0,
0xC36E, 0, 0, 0, 0, 0x5B74, 0, 0x5B67,
@@ -4069,6 +7498,16 @@ static const unsigned short utf8_to_euc_E6A2[] = {
0x3323, 0x3A2D, 0xC379, 0x5B60, 0, 0x5B70, 0x3361, 0,
0, 0x5B6E, 0x5B72, 0xC37A, 0x456E, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E6A2_x0213[] = {
+ 0, 0x4E42, 0xAE6A, 0x5B6C, 0xC36C, 0x475F, 0xC36D, 0,
+ 0xC36E, 0, 0, 0, 0, 0x5B74, 0, 0x5B67,
+ 0xAE6B, 0, 0, 0x3034, 0x5B69, 0, 0xAE6C, 0x393C,
+ 0xAE6E, 0xAE6F, 0xAE70, 0x5B6B, 0xAE71, 0x5B6A, 0, 0x5B66,
+ 0x5B71, 0xC373, 0x3E3F, 0x7566, 0, 0x7567, 0x546D, 0x3868,
+ 0x4D7C, 0xC376, 0xAE72, 0xAE73, 0, 0x5B68, 0xC378, 0x4474,
+ 0x3323, 0x3A2D, 0x7568, 0x5B60, 0xAE74, 0x5B70, 0x3361, 0,
+ 0, 0x5B6E, 0x5B72, 0xAE75, 0x456E, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E6A3[] = {
0, 0, 0, 0, 0x347E, 0xC37B, 0x5C32, 0,
0xC37C, 0x4C49, 0x5B77, 0x347D, 0xC37D, 0x5B7E, 0, 0xC37E,
@@ -4079,6 +7518,16 @@ static const unsigned short utf8_to_euc_E6A3[] = {
0xC42E, 0xC42F, 0x4033, 0, 0, 0xC430, 0xC431, 0,
0, 0x5C2A, 0x343D, 0xC432, 0xC433, 0xC434, 0, 0,
};
+static const unsigned short utf8_to_euc_E6A3_x0213[] = {
+ 0, 0, 0, 0xAE7A, 0x347E, 0xAE7B, 0x5C32, 0,
+ 0x7569, 0x4C49, 0x5B77, 0x347D, 0xAE7C, 0x5B7E, 0, 0xAE7D,
+ 0x756A, 0xC422, 0x4B40, 0xC423, 0x5C21, 0x5C23, 0xAE7E, 0x5C27,
+ 0x5B79, 0xAF21, 0x432A, 0, 0xC426, 0xC427, 0, 0x456F,
+ 0x5C2B, 0x5B7C, 0, 0x5C28, 0xAF22, 0xAF23, 0, 0x5C22,
+ 0x756B, 0, 0xC42A, 0xC42B, 0xAF24, 0x756C, 0x3F39, 0x5C2C,
+ 0x756D, 0x756E, 0x4033, 0, 0, 0xC430, 0xC431, 0xAF25,
+ 0, 0x5C2A, 0x343D, 0xAE76, 0x756F, 0xC434, 0, 0,
+};
static const unsigned short utf8_to_euc_E6A4[] = {
0x4F50, 0x5B76, 0, 0, 0x5C26, 0x3058, 0xC435, 0,
0x5B78, 0xC436, 0xC437, 0x4C3A, 0x5B7D, 0x3F22, 0x4447, 0x5B73,
@@ -4089,6 +7538,16 @@ static const unsigned short utf8_to_euc_E6A4[] = {
0x5C3F, 0xC43D, 0, 0xC43E, 0x464E, 0xC43F, 0x5C24, 0,
0xC440, 0x5C3B, 0, 0xC441, 0, 0x5C3D, 0, 0x4458,
};
+static const unsigned short utf8_to_euc_E6A4_x0213[] = {
+ 0x4F50, 0x5B76, 0, 0xAF26, 0x5C26, 0x3058, 0xC435, 0xAF27,
+ 0x5B78, 0xC436, 0x7570, 0x4C3A, 0x5B7D, 0x3F22, 0x4447, 0x5B73,
+ 0xC438, 0xC439, 0x5C25, 0xC43A, 0, 0, 0xC43B, 0xC43C,
+ 0, 0x3F7A, 0x5C2F, 0x3371, 0x3821, 0, 0, 0,
+ 0, 0x5C31, 0x5B7A, 0x5C30, 0, 0x5C29, 0x5B7B, 0,
+ 0x5C2D, 0, 0x5C2E, 0, 0, 0, 0, 0,
+ 0x5C3F, 0xC43D, 0, 0xC43E, 0x464E, 0x7573, 0x5C24, 0,
+ 0xC440, 0x5C3B, 0, 0xAF2B, 0, 0x5C3D, 0, 0x4458,
+};
static const unsigned short utf8_to_euc_E6A5[] = {
0, 0, 0xC442, 0, 0, 0xC443, 0, 0,
0, 0xC444, 0x4D4C, 0, 0, 0, 0xC445, 0,
@@ -4099,6 +7558,16 @@ static const unsigned short utf8_to_euc_E6A5[] = {
0xC44F, 0xC450, 0xC451, 0x4760, 0x5C3C, 0x364B, 0, 0x5C34,
0x5C36, 0x5C33, 0xC452, 0xC453, 0x4F30, 0x335A, 0x5C39, 0xC454,
};
+static const unsigned short utf8_to_euc_E6A5_x0213[] = {
+ 0, 0, 0x7574, 0, 0, 0xC443, 0xAF2D, 0,
+ 0, 0x7571, 0x4D4C, 0, 0, 0, 0xC445, 0,
+ 0, 0, 0, 0x4976, 0x5C38, 0x424A, 0, 0x7575,
+ 0, 0x5C3E, 0x413F, 0xC447, 0x5C35, 0x5C42, 0x5C41, 0,
+ 0x466F, 0x5C40, 0x466A, 0x7576, 0x7577, 0xC44A, 0xC44B, 0,
+ 0x7578, 0xAF2E, 0x5C44, 0x5C37, 0xAF2F, 0x3648, 0x5C3A, 0x3D5D,
+ 0xC44F, 0xC450, 0xAF30, 0x4760, 0x5C3C, 0x364B, 0, 0x5C34,
+ 0x5C36, 0x5C33, 0xAF31, 0xC453, 0x4F30, 0x335A, 0x5C39, 0xAF32,
+};
static const unsigned short utf8_to_euc_E6A6[] = {
0xC455, 0x5C43, 0x3335, 0, 0, 0, 0, 0,
0, 0, 0x3A67, 0, 0, 0xC456, 0x315D, 0,
@@ -4109,6 +7578,16 @@ static const unsigned short utf8_to_euc_E6A6[] = {
0, 0x5C63, 0x5C45, 0, 0x5C58, 0, 0, 0xC461,
0xC462, 0, 0xC463, 0x5C50, 0xC464, 0, 0x5C4B, 0x5C48,
};
+static const unsigned short utf8_to_euc_E6A6_x0213[] = {
+ 0x7579, 0x5C43, 0x3335, 0, 0, 0, 0, 0,
+ 0, 0, 0x3A67, 0, 0, 0xC456, 0x315D, 0,
+ 0, 0x5C54, 0xAF33, 0, 0x4F31, 0x5C57, 0xAF35, 0,
+ 0xAF36, 0, 0, 0x3F3A, 0x5C56, 0, 0, 0,
+ 0x5C55, 0xC45A, 0, 0, 0, 0x757B, 0xAF37, 0x5C52,
+ 0xC45D, 0, 0, 0xC45E, 0, 0x757C, 0x5C46, 0xC460,
+ 0xAF38, 0x5C63, 0x5C45, 0, 0x5C58, 0, 0, 0xAF39,
+ 0xC462, 0, 0xAF3A, 0x5C50, 0xAF3B, 0, 0x5C4B, 0x5C48,
+};
static const unsigned short utf8_to_euc_E6A7[] = {
0, 0x5C49, 0, 0x5C51, 0, 0xC465, 0, 0x7422,
0xC466, 0, 0x5C4E, 0x393D, 0x4448, 0x4164, 0x5C4C, 0,
@@ -4119,6 +7598,16 @@ static const unsigned short utf8_to_euc_E6A7[] = {
0, 0xC46E, 0x5C60, 0xC46F, 0, 0xC470, 0, 0,
0, 0x5C5F, 0, 0x4450, 0, 0x4165, 0xC471, 0x5C5D,
};
+static const unsigned short utf8_to_euc_E6A7_x0213[] = {
+ 0xAF3C, 0x5C49, 0, 0x5C51, 0, 0xC465, 0, 0x7422,
+ 0xC466, 0, 0x5C4E, 0x393D, 0x4448, 0x4164, 0x5C4C, 0x757D,
+ 0x5C47, 0xAF3D, 0, 0x5C4A, 0, 0, 0xAF3E, 0xC469,
+ 0x4D4D, 0x4B6A, 0, 0, 0, 0x5C4F, 0x5C59, 0,
+ 0, 0, 0x7622, 0xAF44, 0, 0xC46B, 0, 0x5C61,
+ 0x5C5A, 0x7623, 0x7624, 0x5C67, 0, 0x5C65, 0xAF45, 0xAF46,
+ 0, 0xC46E, 0x5C60, 0xAF47, 0xAF49, 0x7625, 0x7626, 0,
+ 0, 0x5C5F, 0, 0x4450, 0, 0x4165, 0xAF4A, 0x5C5D,
+};
static const unsigned short utf8_to_euc_E6A8[] = {
0xC472, 0xC473, 0x5C5B, 0xC474, 0, 0x5C62, 0, 0,
0, 0, 0x5C68, 0x4875, 0x5C6E, 0, 0, 0xC475,
@@ -4129,6 +7618,16 @@ static const unsigned short utf8_to_euc_E6A8[] = {
0xC47D, 0, 0xC47E, 0, 0xC521, 0x3E41, 0x5C70, 0xC522,
0x5C77, 0x3C79, 0x3372, 0xC523, 0, 0x432E, 0xC524, 0xC525,
};
+static const unsigned short utf8_to_euc_E6A8_x0213[] = {
+ 0xC472, 0xC473, 0x5C5B, 0xC474, 0, 0x5C62, 0, 0,
+ 0, 0, 0x5C68, 0x4875, 0x5C6E, 0, 0, 0x7627,
+ 0, 0xAF4B, 0x5C69, 0x5C6C, 0x5C66, 0x7628, 0, 0x4374,
+ 0, 0x4938, 0xAF4C, 0x5C5C, 0, 0xAF4D, 0x5C64, 0x3E40,
+ 0xC47A, 0x4C4F, 0x5C78, 0x5C6B, 0xC47B, 0, 0, 0,
+ 0xC47C, 0x3822, 0x3223, 0x335F, 0, 0, 0x5C53, 0,
+ 0xAF41, 0, 0xAF4F, 0xAF50, 0xAF51, 0x3E41, 0x5C70, 0xC522,
+ 0x5C77, 0x3C79, 0x3372, 0x762A, 0, 0x432E, 0x762B, 0xAF52,
+};
static const unsigned short utf8_to_euc_E6A9[] = {
0, 0, 0, 0, 0x5C6D, 0xC526, 0xC527, 0x5C72,
0x5C76, 0xC528, 0xC529, 0x3636, 0, 0, 0xC52A, 0,
@@ -4139,6 +7638,16 @@ static const unsigned short utf8_to_euc_E6A9[] = {
0, 0xC534, 0x5C6F, 0xC535, 0, 0, 0, 0,
0x5C71, 0, 0, 0, 0, 0, 0xC536, 0x3360,
};
+static const unsigned short utf8_to_euc_E6A9_x0213[] = {
+ 0, 0, 0, 0, 0x5C6D, 0x762C, 0xAF53, 0x5C72,
+ 0x5C76, 0xAF54, 0xC529, 0x3636, 0, 0, 0xAF56, 0,
+ 0x762D, 0xC52C, 0xAF57, 0, 0, 0xC52E, 0x762E, 0,
+ 0x354C, 0x5C74, 0, 0x762F, 0, 0, 0, 0x3521,
+ 0, 0x464B, 0x5C73, 0, 0xAF58, 0, 0x5C75, 0xC532,
+ 0, 0, 0xC533, 0x7630, 0, 0, 0, 0,
+ 0, 0xC534, 0x5C6F, 0x7631, 0, 0, 0, 0,
+ 0x5C71, 0, 0xAF55, 0, 0, 0, 0xAF5A, 0x3360,
+};
static const unsigned short utf8_to_euc_E6AA[] = {
0x4349, 0xC537, 0, 0xC538, 0x5C7C, 0, 0xC539, 0xC53A,
0, 0xC53B, 0, 0xC53C, 0, 0x5C7A, 0x3869, 0,
@@ -4149,6 +7658,16 @@ static const unsigned short utf8_to_euc_E6AA[] = {
0xC545, 0xC546, 0, 0x5D27, 0xC547, 0, 0, 0,
0x5D26, 0, 0, 0x5D23, 0, 0xC548, 0xC549, 0xC54A,
};
+static const unsigned short utf8_to_euc_E6AA_x0213[] = {
+ 0x4349, 0xC537, 0, 0xAF5B, 0x5C7C, 0, 0xC539, 0xC53A,
+ 0, 0x7633, 0, 0xAF5C, 0, 0x5C7A, 0x3869, 0,
+ 0x5C79, 0xAF5E, 0, 0, 0x7634, 0, 0, 0x5D21,
+ 0, 0, 0, 0xC53E, 0x5B58, 0x7635, 0x7636, 0xAF5F,
+ 0x5C7B, 0xAF60, 0x5C7D, 0x5C7E, 0, 0x7637, 0, 0,
+ 0, 0, 0x5D2C, 0xAF62, 0x5D28, 0, 0x5B6D, 0xC544,
+ 0xC545, 0xC546, 0, 0x5D27, 0xC547, 0, 0, 0,
+ 0x5D26, 0, 0, 0x5D23, 0, 0xAF63, 0xC549, 0xC54A,
+};
static const unsigned short utf8_to_euc_E6AB[] = {
0, 0x5C6A, 0x5D25, 0x5D24, 0, 0, 0xC54B, 0,
0xC54D, 0xC54C, 0, 0, 0xC54E, 0, 0, 0,
@@ -4159,6 +7678,16 @@ static const unsigned short utf8_to_euc_E6AB[] = {
0xC558, 0xC559, 0xC55A, 0, 0, 0, 0, 0,
0, 0, 0x5D32, 0x5D2F, 0xC55B, 0xC55C, 0, 0,
};
+static const unsigned short utf8_to_euc_E6AB_x0213[] = {
+ 0, 0x5C6A, 0x5D25, 0x5D24, 0, 0, 0xAF64, 0,
+ 0xC54D, 0xC54C, 0, 0, 0xC54E, 0, 0, 0,
+ 0xAF66, 0x5D2A, 0, 0x4F26, 0xAF65, 0xC551, 0xC552, 0,
+ 0, 0, 0x5D2D, 0x367B, 0xAF67, 0xAF68, 0x5D29, 0x5D2B,
+ 0, 0, 0xF44A, 0, 0x7638, 0, 0, 0x7639,
+ 0x4827, 0, 0x5D2E, 0, 0xAF6B, 0, 0, 0,
+ 0xC558, 0xAF6C, 0xAF6D, 0xAF6E, 0, 0, 0, 0,
+ 0, 0, 0x5D32, 0x5D2F, 0xC55B, 0xAF6F, 0, 0,
+};
static const unsigned short utf8_to_euc_E6AC[] = {
0, 0, 0xC55D, 0xC55E, 0x4D73, 0x5D30, 0xC55F, 0xC560,
0, 0xC561, 0x5C5E, 0, 0, 0, 0, 0xC562,
@@ -4169,6 +7698,16 @@ static const unsigned short utf8_to_euc_E6AC[] = {
0, 0, 0x4D5F, 0, 0, 0xC56D, 0xC56E, 0x5D38,
0x5D37, 0x5D3A, 0x353D, 0xC56F, 0, 0x3656, 0x343E, 0xC570,
};
+static const unsigned short utf8_to_euc_E6AC_x0213[] = {
+ 0, 0, 0xC55D, 0xC55E, 0x4D73, 0x5D30, 0xC55F, 0xC560,
+ 0, 0xC561, 0x5C5E, 0xAF71, 0, 0, 0, 0xAF72,
+ 0xAF73, 0xAF74, 0x5D33, 0, 0, 0, 0x5D34, 0xAF76,
+ 0, 0, 0, 0x763C, 0, 0x3135, 0x763D, 0x5D36,
+ 0x3767, 0x3C21, 0, 0x3655, 0xC568, 0, 0, 0x3224,
+ 0xC569, 0, 0, 0xC56A, 0x763E, 0, 0, 0xAF78,
+ 0, 0, 0x4D5F, 0, 0, 0x763F, 0xC56E, 0x5D38,
+ 0x5D37, 0x5D3A, 0x353D, 0xC56F, 0, 0x3656, 0x343E, 0xC570,
+};
static const unsigned short utf8_to_euc_E6AD[] = {
0, 0, 0, 0x5D3D, 0, 0, 0xC571, 0x5D3C,
0, 0x5D3E, 0xC572, 0, 0x324E, 0xC573, 0x4337, 0,
@@ -4179,6 +7718,16 @@ static const unsigned short utf8_to_euc_E6AD[] = {
0xC57C, 0, 0, 0x3A50, 0x4E72, 0xC57D, 0, 0,
0x5D45, 0x5D46, 0, 0x3B60, 0, 0xC57E, 0xC621, 0x5D47,
};
+static const unsigned short utf8_to_euc_E6AD_x0213[] = {
+ 0, 0, 0, 0x5D3D, 0, 0, 0x7640, 0x5D3C,
+ 0, 0x5D3E, 0xAF79, 0, 0x324E, 0xC573, 0x4337, 0,
+ 0x5D3F, 0, 0xC574, 0x343F, 0x5D41, 0, 0x7641, 0,
+ 0xAF7A, 0x5D40, 0, 0x5D42, 0, 0xC577, 0, 0x5D43,
+ 0x7642, 0x5D44, 0x3B5F, 0x4035, 0x3A21, 0x7643, 0x4970, 0x7644,
+ 0, 0x4A62, 0x4F44, 0xC57A, 0xAF7B, 0, 0xC57B, 0x3B75,
+ 0xC57C, 0, 0, 0x3A50, 0x4E72, 0xAF7C, 0, 0x7645,
+ 0x5D45, 0x5D46, 0xAF7D, 0x3B60, 0, 0xC57E, 0xC621, 0x5D47,
+};
static const unsigned short utf8_to_euc_E6AE[] = {
0x5D48, 0, 0xC622, 0x5D4A, 0x5D49, 0xC623, 0x4B58, 0,
0, 0x3D5E, 0x3C6C, 0x3B44, 0, 0x5D4B, 0, 0,
@@ -4189,6 +7738,16 @@ static const unsigned short utf8_to_euc_E6AE[] = {
0xC62F, 0x5D54, 0x5D53, 0x5D55, 0x3225, 0x434A, 0, 0x5D56,
0xC630, 0xC631, 0x3B26, 0x334C, 0x5D57, 0xC632, 0xC633, 0x4542,
};
+static const unsigned short utf8_to_euc_E6AE_x0213[] = {
+ 0x5D48, 0xAF7E, 0x7646, 0x5D4A, 0x5D49, 0xC623, 0x4B58, 0,
+ 0, 0x3D5E, 0x3C6C, 0x3B44, 0, 0x5D4B, 0, 0,
+ 0, 0, 0, 0, 0, 0x5D4D, 0x3F23, 0xC624,
+ 0x5D4C, 0, 0, 0xEE21, 0, 0, 0x5D4E, 0xC626,
+ 0xC627, 0, 0xC628, 0xC629, 0x5D4F, 0, 0, 0,
+ 0xC62A, 0x7647, 0x5D50, 0x5D51, 0xC62C, 0x7648, 0xEE22, 0x5D52,
+ 0xC62F, 0x5D54, 0x5D53, 0x5D55, 0x3225, 0x434A, 0, 0x5D56,
+ 0xC630, 0xC631, 0x3B26, 0x334C, 0x5D57, 0xEE24, 0xEE25, 0x4542,
+};
static const unsigned short utf8_to_euc_E6AF[] = {
0x544C, 0, 0, 0xC634, 0xC635, 0x3523, 0x5D58, 0,
0, 0xC636, 0, 0x5D59, 0xC637, 0x4A6C, 0x4B68, 0,
@@ -4199,6 +7758,16 @@ static const unsigned short utf8_to_euc_E6AF[] = {
0, 0xC63F, 0, 0x5D5E, 0, 0, 0, 0xC640,
0, 0xC641, 0, 0, 0, 0, 0, 0xC642,
};
+static const unsigned short utf8_to_euc_E6AF_x0213[] = {
+ 0x544C, 0, 0, 0xC634, 0xC635, 0x3523, 0x5D58, 0xEE26,
+ 0xEE27, 0xEE28, 0, 0x5D59, 0xC637, 0x4A6C, 0x4B68, 0x764A,
+ 0, 0, 0x4647, 0x5D5A, 0x4866, 0, 0x764B, 0x764C,
+ 0x487B, 0, 0xEE29, 0x4C53, 0, 0, 0, 0x5D5B,
+ 0, 0xC63A, 0, 0xC63B, 0, 0, 0xEE2A, 0xEE2B,
+ 0, 0, 0, 0x5D5D, 0x5D5C, 0, 0xEE2C, 0x5D5F,
+ 0, 0xEE2D, 0, 0x5D5E, 0, 0, 0, 0xC640,
+ 0, 0xC641, 0, 0, 0, 0, 0, 0x764D,
+};
static const unsigned short utf8_to_euc_E6B0[] = {
0, 0, 0xC643, 0, 0xC644, 0xC645, 0, 0,
0x5D61, 0xC646, 0, 0, 0, 0xC647, 0xC648, 0x3B61,
@@ -4209,6 +7778,16 @@ static const unsigned short utf8_to_euc_E6B0[] = {
0, 0, 0, 0xC652, 0x3F65, 0xC653, 0xC654, 0x4939,
0x314A, 0, 0xC655, 0xC656, 0, 0, 0x4845, 0xC657,
};
+static const unsigned short utf8_to_euc_E6B0_x0213[] = {
+ 0, 0, 0xEE2E, 0, 0xC644, 0x764E, 0, 0,
+ 0x5D61, 0xC646, 0xEE2F, 0, 0, 0xC647, 0xEE30, 0x3B61,
+ 0x764F, 0x4C31, 0xC64A, 0x5D62, 0x5D63, 0, 0, 0x3524,
+ 0, 0xC64B, 0, 0x5D64, 0, 0, 0, 0xC64C,
+ 0, 0, 0, 0x5D66, 0x5D65, 0, 0xC64D, 0xC64E,
+ 0xC64F, 0, 0, 0, 0xC650, 0, 0xC651, 0,
+ 0, 0, 0, 0x7650, 0x3F65, 0xEE31, 0xEE32, 0x4939,
+ 0x314A, 0, 0xEE33, 0xC656, 0, 0, 0x4845, 0xEE35,
+};
static const unsigned short utf8_to_euc_E6B1[] = {
0x4475, 0x3D41, 0x3561, 0, 0, 0, 0, 0,
0, 0, 0xC658, 0xC659, 0, 0xC65A, 0x4846, 0xC65B,
@@ -4219,6 +7798,16 @@ static const unsigned short utf8_to_euc_E6B1[] = {
0x4241, 0, 0x3562, 0x5D72, 0xC664, 0, 0xC665, 0,
0xC666, 0xC667, 0x3768, 0xC668, 0, 0x3525, 0x5D70, 0,
};
+static const unsigned short utf8_to_euc_E6B1_x0213[] = {
+ 0x4475, 0x3D41, 0x3561, 0, 0, 0, 0, 0,
+ 0, 0, 0xC658, 0xC659, 0, 0xEE36, 0x4846, 0xC65B,
+ 0x3C2E, 0, 0xC65C, 0, 0xC65D, 0x5D68, 0, 0x3440,
+ 0, 0x7651, 0x3178, 0xEE37, 0x7652, 0x4672, 0x5D67, 0x393E,
+ 0x4353, 0, 0x5D69, 0, 0, 0, 0, 0xEE4F,
+ 0x5D71, 0, 0x5D6A, 0xC661, 0, 0xEE38, 0, 0xC663,
+ 0x4241, 0, 0x3562, 0x5D72, 0x7654, 0, 0x7655, 0,
+ 0xC666, 0xC667, 0x3768, 0xC668, 0, 0x3525, 0x5D70, 0,
+};
static const unsigned short utf8_to_euc_E6B2[] = {
0, 0x5D6E, 0x5D6B, 0x4D60, 0, 0xC669, 0xC66A, 0xC66B,
0x4440, 0xC66C, 0, 0, 0x4659, 0x5D6C, 0, 0,
@@ -4229,6 +7818,16 @@ static const unsigned short utf8_to_euc_E6B2[] = {
0xC673, 0x5D7D, 0xC674, 0x324F, 0xC675, 0, 0, 0,
0x4A28, 0x4C7D, 0x5E21, 0x3C23, 0x3E42, 0x5D78, 0x5D7E, 0x3168,
};
+static const unsigned short utf8_to_euc_E6B2_x0213[] = {
+ 0, 0x5D6E, 0x5D6B, 0x4D60, 0xEE39, 0x7656, 0x7657, 0xC66B,
+ 0x4440, 0xEE3A, 0, 0, 0x4659, 0x5D6C, 0, 0,
+ 0x5D74, 0, 0x5D73, 0x3723, 0xEE3C, 0xEE3D, 0x322D, 0xEE3E,
+ 0x7658, 0x3A3B, 0x5D6D, 0x5D6F, 0x7659, 0, 0, 0xC672,
+ 0, 0x4B57, 0x4274, 0, 0, 0, 0, 0,
+ 0, 0, 0x7653, 0x4B77, 0, 0xEE3F, 0x5D7C, 0,
+ 0xC673, 0x5D7D, 0xC674, 0x324F, 0xC675, 0, 0, 0,
+ 0x4A28, 0x4C7D, 0x5E21, 0x3C23, 0x3E42, 0x5D78, 0x5D7E, 0x3168,
+};
static const unsigned short utf8_to_euc_E6B3[] = {
0, 0x3637, 0xC676, 0, 0x5D75, 0x5D7A, 0xC677, 0,
0, 0x4074, 0x4771, 0, 0x4867, 0xC678, 0, 0xC679,
@@ -4239,6 +7838,16 @@ static const unsigned short utf8_to_euc_E6B3[] = {
0x4259, 0x5D76, 0xC729, 0x314B, 0xC72A, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E6B3_x0213[] = {
+ 0, 0x3637, 0xEE40, 0, 0x5D75, 0x5D7A, 0x765B, 0,
+ 0, 0x4074, 0x4771, 0, 0x4867, 0xC678, 0, 0xC679,
+ 0xEE41, 0xC67B, 0xC67C, 0x5D77, 0x765C, 0x4B21, 0xEE43, 0x5D79,
+ 0, 0x5E24, 0xEE44, 0x5E22, 0xEE45, 0x5D7B, 0, 0,
+ 0x765D, 0x4B22, 0x4748, 0x3563, 0, 0x4525, 0, 0xC724,
+ 0x436D, 0xEE46, 0x5E25, 0x765E, 0xEE47, 0xEE48, 0x765F, 0x5E23,
+ 0x4259, 0x5D76, 0xC729, 0x314B, 0xC72A, 0, 0, 0,
+ 0, 0, 0, 0x765A, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E6B4[] = {
0, 0, 0, 0, 0xC72B, 0, 0, 0xC72C,
0, 0, 0xC72D, 0x4D4E, 0x5E30, 0, 0xC72E, 0xC72F,
@@ -4249,6 +7858,16 @@ static const unsigned short utf8_to_euc_E6B4[] = {
0, 0xC739, 0x3D27, 0x5E2E, 0, 0x5E2D, 0x5E28, 0,
0x5E2B, 0xC73A, 0, 0x3368, 0xC73B, 0x5E2A, 0x4749, 0xC73C,
};
+static const unsigned short utf8_to_euc_E6B4_x0213[] = {
+ 0xEE4A, 0, 0, 0, 0x7661, 0, 0, 0xC72C,
+ 0, 0, 0xEE4B, 0x4D4E, 0x5E30, 0, 0x7662, 0xC72F,
+ 0, 0xC730, 0x5E2F, 0xC731, 0, 0, 0, 0x4076,
+ 0, 0x5E2C, 0xC732, 0x4D6C, 0, 0, 0x4636, 0x5E26,
+ 0, 0, 0, 0, 0xEE4C, 0x4445, 0xEE4D, 0xEE4E,
+ 0xC735, 0x314C, 0x393F, 0x5E29, 0, 0, 0x7663, 0xEE50,
+ 0, 0x7664, 0x3D27, 0x5E2E, 0xEE65, 0x5E2D, 0x5E28, 0,
+ 0x5E2B, 0x7665, 0, 0x3368, 0xEE51, 0x5E2A, 0x4749, 0x7666,
+};
static const unsigned short utf8_to_euc_E6B5[] = {
0, 0x4E2E, 0, 0, 0x3E74, 0x4075, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -4259,6 +7878,16 @@ static const unsigned short utf8_to_euc_E6B5[] = {
0xC744, 0, 0, 0, 0x4D61, 0, 0, 0x3324,
0x3F3B, 0x5E35, 0, 0, 0xC745, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E6B5_x0213[] = {
+ 0, 0x4E2E, 0, 0, 0x3E74, 0x4075, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0xC73D,
+ 0x7667, 0x5E36, 0x5E34, 0xEE52, 0x494D, 0, 0xEE53, 0xC73F,
+ 0xEE54, 0xC740, 0, 0x5E31, 0x5E33, 0x7668, 0x313A, 0xC742,
+ 0, 0x3940, 0x4F32, 0, 0x333D, 0, 0x4962, 0xC743,
+ 0xEE55, 0, 0, 0, 0x4D61, 0, 0, 0x3324,
+ 0x3F3B, 0x5E35, 0, 0, 0xC745, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E6B6[] = {
0, 0, 0xC746, 0, 0, 0x5E3A, 0, 0xC747,
0x3E43, 0, 0, 0, 0x4D30, 0, 0x5E37, 0,
@@ -4269,6 +7898,16 @@ static const unsigned short utf8_to_euc_E6B6[] = {
0, 0, 0x3155, 0, 0xC750, 0x5E3E, 0, 0xC751,
0x5E41, 0xC752, 0, 0, 0x4E43, 0xC753, 0, 0xC754,
};
+static const unsigned short utf8_to_euc_E6B6_x0213[] = {
+ 0xEE56, 0xEE57, 0x766A, 0, 0, 0x5E3A, 0, 0x766B,
+ 0x3E43, 0x766C, 0xEE58, 0, 0x4D30, 0xEE59, 0x5E37, 0,
+ 0, 0xEE5A, 0xC749, 0x5E32, 0x766D, 0x5E38, 0xC74B, 0xC74C,
+ 0xEE5B, 0x4E5E, 0, 0x4573, 0x4642, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0x766E, 0xEE61, 0x766F, 0, 0xEE62, 0x3336,
+ 0, 0, 0x3155, 0, 0xEE63, 0x5E3E, 0, 0xC751,
+ 0x5E41, 0xC752, 0, 0, 0x4E43, 0xC753, 0, 0x7670,
+};
static const unsigned short utf8_to_euc_E6B7[] = {
0x4D64, 0, 0, 0, 0xC755, 0x5E48, 0x5E42, 0x5E3F,
0xC756, 0, 0xC757, 0x4E54, 0x5E45, 0, 0xC758, 0xC759,
@@ -4279,6 +7918,16 @@ static const unsigned short utf8_to_euc_E6B7[] = {
0xC763, 0x3F3C, 0xF44C, 0x3D5F, 0xC764, 0x4A25, 0xC765, 0x3A2E,
0xF44B, 0x5E3B, 0x5E49, 0x453A, 0xC766, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E6B7_x0213[] = {
+ 0x4D64, 0, 0xEE64, 0, 0x7671, 0x5E48, 0x5E42, 0x5E3F,
+ 0xEE66, 0, 0xC757, 0x4E54, 0x5E45, 0, 0xEE67, 0xEE68,
+ 0xEE69, 0x3D4A, 0x5E47, 0, 0, 0x5E4C, 0x7672, 0,
+ 0x4571, 0x5E4A, 0x7673, 0x7674, 0, 0x7675, 0x5E44, 0xEE6A,
+ 0xC75E, 0x4338, 0xC75F, 0, 0x5E4B, 0xC760, 0x5E40, 0,
+ 0x5E46, 0xEE6B, 0x5E4D, 0x307C, 0x5E43, 0, 0x5E4E, 0xC762,
+ 0xC763, 0x3F3C, 0xF44C, 0x3D5F, 0xC764, 0x4A25, 0xEE6C, 0x3A2E,
+ 0xF44B, 0x5E3B, 0x5E49, 0x453A, 0x7676, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E6B8[] = {
0xC767, 0, 0, 0, 0xC768, 0x4036, 0, 0x3369,
0x3A51, 0x3E44, 0x5E3D, 0x3D42, 0, 0, 0, 0,
@@ -4289,6 +7938,16 @@ static const unsigned short utf8_to_euc_E6B8[] = {
0, 0, 0xC76C, 0, 0, 0, 0xC76D, 0,
0x5E62, 0xC76E, 0x5E5D, 0xC76F, 0xC770, 0, 0x5E55, 0,
};
+static const unsigned short utf8_to_euc_E6B8_x0213[] = {
+ 0xC767, 0, 0, 0, 0xC768, 0x4036, 0, 0x3369,
+ 0x3A51, 0x3E44, 0x5E3D, 0x3D42, 0, 0, 0, 0,
+ 0, 0, 0, 0x374C, 0, 0x5E3C, 0, 0xEE5D,
+ 0, 0x5E52, 0x3D6D, 0x383A, 0, 0x5E61, 0xEE6E, 0x5E5B,
+ 0x3574, 0x454F, 0xEE6F, 0x5E56, 0x5E5F, 0x302F, 0x3132, 0xEE70,
+ 0, 0x3239, 0, 0x5E58, 0x422C, 0x5E4F, 0x5E51, 0x3941,
+ 0, 0, 0xEE72, 0, 0x7678, 0, 0xEE6D, 0,
+ 0x5E62, 0xC76E, 0x5E5D, 0xC76F, 0xEE73, 0, 0x5E55, 0,
+};
static const unsigned short utf8_to_euc_E6B9[] = {
0, 0, 0, 0x5E5C, 0xC771, 0xC772, 0, 0,
0xC773, 0xC774, 0x4C2B, 0xC775, 0, 0x5E5A, 0x5E5E, 0xC776,
@@ -4299,6 +7958,16 @@ static const unsigned short utf8_to_euc_E6B9[] = {
0, 0, 0x5E53, 0xC824, 0, 0, 0x5E59, 0,
0, 0, 0, 0xC825, 0, 0xC826, 0x4F51, 0x3C3E,
};
+static const unsigned short utf8_to_euc_E6B9_x0213[] = {
+ 0, 0, 0, 0x5E5C, 0x7679, 0xC772, 0, 0,
+ 0xEE74, 0xEE75, 0x4C2B, 0xEE76, 0xEE77, 0x5E5A, 0x5E5E, 0xEE78,
+ 0, 0xEE79, 0xC778, 0xEE7A, 0xEE7B, 0, 0x3850, 0xEE7C,
+ 0x3E45, 0, 0, 0x4339, 0x767A, 0xC77D, 0x767B, 0x5E54,
+ 0, 0, 0xC821, 0xEE7D, 0, 0, 0, 0x4D2F,
+ 0xC823, 0, 0, 0x5E57, 0, 0, 0x5E50, 0x4572,
+ 0, 0, 0x5E53, 0xC824, 0, 0, 0x5E59, 0,
+ 0, 0, 0, 0xC825, 0, 0xC826, 0x4F51, 0x3C3E,
+};
static const unsigned short utf8_to_euc_E6BA[] = {
0x4B7E, 0, 0x5E63, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0x482E, 0xC827, 0, 0x5E6F,
@@ -4309,6 +7978,16 @@ static const unsigned short utf8_to_euc_E6BA[] = {
0, 0xC82E, 0x5E6C, 0xC82F, 0, 0, 0x4D4F, 0x5E67,
0, 0, 0x452E, 0xC830, 0, 0x5E69, 0, 0xC831,
};
+static const unsigned short utf8_to_euc_E6BA_x0213[] = {
+ 0x4B7E, 0, 0x5E63, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0x482E, 0xC827, 0, 0x5E6F,
+ 0x383B, 0, 0, 0xEF21, 0, 0, 0x3D60, 0,
+ 0x5E65, 0xC829, 0, 0, 0x4E2F, 0x3942, 0, 0x5E72,
+ 0xC82A, 0, 0x306E, 0, 0, 0x5E70, 0, 0xEF22,
+ 0, 0, 0x5E64, 0x767C, 0, 0xC82C, 0xC82D, 0x5E6A,
+ 0, 0x767D, 0x5E6C, 0xC82F, 0xEF23, 0, 0x4D4F, 0x5E67,
+ 0, 0, 0x452E, 0xC830, 0, 0x5E69, 0, 0xEF24,
+};
static const unsigned short utf8_to_euc_E6BB[] = {
0xC832, 0xC833, 0x5E71, 0xC834, 0x5E6B, 0x4C47, 0, 0xC835,
0xC836, 0x5E66, 0xC837, 0x3C22, 0x5E7E, 0xC838, 0xC839, 0xC83A,
@@ -4319,6 +7998,16 @@ static const unsigned short utf8_to_euc_E6BB[] = {
0, 0, 0x5E7A, 0, 0x4529, 0, 0, 0x5F23,
0x5E77, 0xC83E, 0, 0xC83F, 0, 0xC840, 0x5E78, 0x5E60,
};
+static const unsigned short utf8_to_euc_E6BB_x0213[] = {
+ 0xC832, 0x767E, 0x5E71, 0xEF25, 0x5E6B, 0x4C47, 0, 0x7721,
+ 0xC836, 0x5E66, 0xEF26, 0x3C22, 0x5E7E, 0xC838, 0x7722, 0xC83A,
+ 0, 0x336A, 0, 0x5E68, 0x5E6D, 0x5E6E, 0, 0,
+ 0, 0xEF27, 0, 0, 0, 0x426C, 0x425A, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0xEF29, 0x5E76, 0xC83C, 0xC83D, 0x5E7C,
+ 0, 0, 0x5E7A, 0, 0x4529, 0, 0, 0x5F23,
+ 0x5E77, 0xEF2A, 0, 0xEF2B, 0, 0xC840, 0x5E78, 0x5E60,
+};
static const unsigned short utf8_to_euc_E6BC[] = {
0, 0x3579, 0x493A, 0, 0xC841, 0, 0x3C3F, 0,
0xC842, 0x3977, 0xC843, 0, 0xC844, 0xC845, 0, 0x4F33,
@@ -4329,6 +8018,16 @@ static const unsigned short utf8_to_euc_E6BC[] = {
0xC84E, 0x5E7B, 0x5E7D, 0xC84F, 0, 0, 0xC850, 0,
0x4132, 0, 0, 0xC851, 0xC852, 0, 0x5F21, 0x5E79,
};
+static const unsigned short utf8_to_euc_E6BC_x0213[] = {
+ 0, 0x3579, 0x493A, 0, 0xC841, 0, 0x3C3F, 0,
+ 0xC842, 0x3977, 0xEF2C, 0, 0xEF2D, 0xC845, 0, 0x4F33,
+ 0x7723, 0x5E74, 0, 0x5F22, 0x3169, 0x4166, 0xC846, 0,
+ 0xEF2E, 0, 0x7724, 0xC849, 0, 0, 0, 0,
+ 0x4779, 0, 0x3441, 0x4E7A, 0, 0xEF2F, 0xC84A, 0,
+ 0, 0xC84B, 0x7726, 0x4C21, 0x4452, 0xC853, 0, 0x7727,
+ 0xC84E, 0x5E7B, 0x5E7D, 0x7728, 0, 0xEF28, 0xEF30, 0,
+ 0x4132, 0, 0, 0xC851, 0xEF31, 0, 0x5F21, 0x5E79,
+};
static const unsigned short utf8_to_euc_E6BD[] = {
0, 0x5E73, 0, 0, 0, 0x3443, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0xC854,
@@ -4339,6 +8038,16 @@ static const unsigned short utf8_to_euc_E6BD[] = {
0x4459, 0, 0, 0, 0x5F4C, 0, 0, 0,
0x5F26, 0, 0x5F25, 0, 0x5F2E, 0xC861, 0xC862, 0,
};
+static const unsigned short utf8_to_euc_E6BD_x0213[] = {
+ 0, 0x5E73, 0, 0, 0, 0x3443, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0xC854,
+ 0, 0x7729, 0xEF33, 0xC857, 0x3769, 0, 0, 0xEF34,
+ 0x5F2F, 0x772A, 0xEF35, 0x5F2A, 0x4078, 0xC85B, 0x772B, 0x3363,
+ 0xEF36, 0x772C, 0x772D, 0, 0x3D61, 0, 0x5F33, 0,
+ 0xEF37, 0, 0, 0, 0xC860, 0x5F2C, 0x442C, 0x5F29,
+ 0x4459, 0, 0, 0, 0x5F4C, 0, 0, 0,
+ 0x5F26, 0, 0x5F25, 0, 0x5F2E, 0xEF39, 0x772E, 0,
+};
static const unsigned short utf8_to_euc_E6BE[] = {
0x5F28, 0x5F27, 0x5F2D, 0xC863, 0x4021, 0, 0x5F24, 0xC864,
0xC865, 0, 0, 0xC866, 0xC867, 0xC868, 0x5F30, 0,
@@ -4349,6 +8058,16 @@ static const unsigned short utf8_to_euc_E6BE[] = {
0xC877, 0x4543, 0, 0x5F34, 0, 0xC878, 0xC879, 0,
0, 0x5F38, 0, 0, 0xC87A, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E6BE_x0213[] = {
+ 0x5F28, 0x5F27, 0x5F2D, 0xC863, 0x4021, 0, 0x5F24, 0xC864,
+ 0x772F, 0, 0, 0xC866, 0x7730, 0x7731, 0x5F30, 0,
+ 0xEF3A, 0x5F31, 0xC86A, 0xC86B, 0x7732, 0, 0xEF3B, 0x3442,
+ 0xEF38, 0, 0xC86E, 0, 0, 0, 0, 0xEF3D,
+ 0x7733, 0x5F36, 0, 0x5F35, 0x5F37, 0xEF3E, 0xC872, 0x7734,
+ 0xC874, 0, 0x5F3A, 0, 0, 0, 0xC875, 0xEF3F,
+ 0xC877, 0x4543, 0, 0x5F34, 0, 0xEF41, 0x7735, 0,
+ 0, 0x5F38, 0, 0, 0x7736, 0, 0xEF3C, 0,
+};
static const unsigned short utf8_to_euc_E6BF[] = {
0x3763, 0x4279, 0x5F32, 0x473B, 0, 0xC87B, 0x5F39, 0xC87C,
0xC87D, 0, 0xC87E, 0, 0, 0, 0, 0,
@@ -4359,6 +8078,16 @@ static const unsigned short utf8_to_euc_E6BF[] = {
0xC925, 0x5F40, 0, 0x5F2B, 0, 0xC926, 0x6F69, 0,
0, 0xC927, 0x5F45, 0, 0xC928, 0xC929, 0x5F49, 0,
};
+static const unsigned short utf8_to_euc_E6BF_x0213[] = {
+ 0x3763, 0x4279, 0x5F32, 0x473B, 0, 0xC87B, 0x5F39, 0x7737,
+ 0xEF42, 0xEF43, 0x7738, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0x5F3E, 0x5F3C, 0, 0,
+ 0x5F3F, 0, 0xEF44, 0x5F42, 0, 0, 0xEF45, 0x5F3B,
+ 0x396A, 0x4728, 0, 0, 0x5E39, 0, 0, 0,
+ 0xC923, 0xEF46, 0, 0x4D74, 0x5F3D, 0, 0x5F41, 0x4275,
+ 0x773A, 0x5F40, 0, 0x5F2B, 0, 0x773B, 0x6F69, 0,
+ 0, 0x7739, 0x5F45, 0, 0xEF48, 0xC929, 0x5F49, 0,
+};
static const unsigned short utf8_to_euc_E780[] = {
0xC92A, 0x5F47, 0, 0, 0, 0xC92B, 0xC92C, 0xC92D,
0, 0x5F43, 0, 0x5F44, 0, 0xC92E, 0, 0x5F48,
@@ -4369,6 +8098,16 @@ static const unsigned short utf8_to_euc_E780[] = {
0x5F50, 0, 0x5F52, 0, 0xC933, 0, 0, 0xC934,
0, 0xC935, 0, 0, 0xC936, 0, 0x5F51, 0,
};
+static const unsigned short utf8_to_euc_E780_x0213[] = {
+ 0xEF49, 0x5F47, 0, 0, 0, 0x773C, 0x773D, 0xEF4A,
+ 0, 0x5F43, 0xEF4B, 0x5F44, 0, 0xC92E, 0, 0x5F48,
+ 0, 0x5F46, 0, 0, 0, 0x494E, 0, 0xC92F,
+ 0x5F4E, 0, 0x5F4B, 0x5F4A, 0, 0x5F4D, 0x4654, 0x5F4F,
+ 0xC930, 0, 0, 0xEF4C, 0, 0, 0x4375, 0x426D,
+ 0x773E, 0, 0, 0, 0x4025, 0, 0, 0xC932,
+ 0x5F50, 0, 0x5F52, 0, 0xC933, 0, 0, 0xC934,
+ 0, 0xEF4E, 0xEF4F, 0, 0xEF50, 0, 0x5F51, 0,
+};
static const unsigned short utf8_to_euc_E781[] = {
0, 0, 0, 0xC937, 0xC938, 0, 0, 0,
0xC939, 0xC93A, 0xC93B, 0xC93C, 0x5E75, 0, 0xC941, 0,
@@ -4379,6 +8118,16 @@ static const unsigned short utf8_to_euc_E781[] = {
0x3325, 0, 0, 0, 0, 0xC946, 0xC947, 0,
0x3564, 0, 0, 0, 0x3C5E, 0x3A52, 0xC948, 0,
};
+static const unsigned short utf8_to_euc_E781_x0213[] = {
+ 0, 0, 0, 0xEF51, 0xC938, 0, 0, 0xEF52,
+ 0xC939, 0xC93A, 0x773F, 0xEF53, 0x5E75, 0, 0x7742, 0,
+ 0, 0x5F53, 0, 0, 0xEF55, 0xC93E, 0, 0,
+ 0x4667, 0, 0, 0, 0, 0x7740, 0x7741, 0,
+ 0, 0, 0, 0x5F54, 0x7743, 0xEF56, 0, 0,
+ 0, 0xEF57, 0, 0x3250, 0xEF58, 0, 0xEF59, 0x4574,
+ 0x3325, 0, 0, 0, 0, 0x7744, 0xEF5A, 0,
+ 0x3564, 0, 0, 0, 0x3C5E, 0x3A52, 0xEF5B, 0,
+};
static const unsigned short utf8_to_euc_E782[] = {
0, 0xC949, 0, 0, 0, 0xC94A, 0xC94B, 0,
0, 0x4F27, 0x3F66, 0, 0, 0, 0x316A, 0,
@@ -4389,6 +8138,16 @@ static const unsigned short utf8_to_euc_E782[] = {
0xC954, 0xC955, 0, 0x5F5B, 0xC956, 0, 0, 0xC957,
0x5F5A, 0x4540, 0x3059, 0xF42E, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E782_x0213[] = {
+ 0, 0xEF5C, 0, 0, 0, 0x7745, 0xEF5D, 0,
+ 0, 0x4F27, 0x3F66, 0, 0, 0, 0x316A, 0,
+ 0, 0, 0x5F56, 0, 0xC94C, 0xEF5E, 0xC94E, 0xEF5F,
+ 0xC950, 0x5F55, 0, 0xC951, 0, 0, 0, 0xEF62,
+ 0, 0, 0, 0, 0x7746, 0, 0, 0,
+ 0, 0, 0, 0x7747, 0x5F59, 0x433A, 0x5F5C, 0x5F57,
+ 0xC954, 0xEF63, 0, 0x5F5B, 0xC956, 0, 0, 0x7748,
+ 0x5F5A, 0x4540, 0x3059, 0xEF60, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E783[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0x4E75, 0, 0xC958, 0x5F5E, 0, 0, 0, 0x3128,
@@ -4399,6 +8158,16 @@ static const unsigned short utf8_to_euc_E783[] = {
0, 0x5F58, 0, 0, 0, 0, 0, 0,
0, 0x4B23, 0xC961, 0, 0, 0x5F62, 0, 0,
};
+static const unsigned short utf8_to_euc_E783_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0x4E75, 0, 0xEF66, 0x5F5E, 0, 0, 0, 0x3128,
+ 0, 0xEF67, 0, 0xEF68, 0x7749, 0xC95C, 0xC95D, 0,
+ 0x774A, 0x5F60, 0, 0, 0xEF69, 0x5F5F, 0, 0x5F5D,
+ 0, 0, 0, 0, 0x774B, 0, 0, 0,
+ 0, 0, 0, 0, 0xEF65, 0, 0, 0,
+ 0, 0x5F58, 0, 0, 0, 0, 0, 0,
+ 0, 0x4B23, 0xC961, 0, 0, 0x5F62, 0, 0,
+};
static const unsigned short utf8_to_euc_E784[] = {
0, 0, 0, 0xC962, 0xC963, 0xC964, 0xC965, 0xC966,
0, 0x5F61, 0, 0xC967, 0xC968, 0, 0, 0xC969,
@@ -4409,6 +8178,16 @@ static const unsigned short utf8_to_euc_E784[] = {
0xC96F, 0xC970, 0, 0, 0, 0, 0x4133, 0,
0xC971, 0, 0, 0, 0x3E46, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E784_x0213[] = {
+ 0, 0, 0, 0xEF6A, 0xEF6B, 0xC964, 0xEF6C, 0xEF6D,
+ 0xEF6E, 0x5F61, 0, 0xC967, 0xEF6F, 0, 0, 0x774C,
+ 0, 0, 0, 0, 0x316B, 0, 0, 0,
+ 0, 0x5F64, 0x4A32, 0, 0x5F63, 0, 0x774E, 0,
+ 0x774F, 0x4C35, 0, 0, 0, 0, 0x3E47, 0,
+ 0, 0, 0, 0x774D, 0, 0xC96D, 0x7750, 0xEF71,
+ 0x7751, 0xEF72, 0, 0, 0, 0, 0x4133, 0,
+ 0xC971, 0, 0, 0, 0x3E46, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E785[] = {
0, 0xC972, 0, 0, 0, 0xC973, 0xC974, 0xC975,
0, 0x4E7B, 0xC976, 0xC977, 0x5F6A, 0, 0x4079, 0,
@@ -4419,6 +8198,16 @@ static const unsigned short utf8_to_euc_E785[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0xCA22, 0, 0, 0, 0x407A, 0, 0,
};
+static const unsigned short utf8_to_euc_E785_x0213[] = {
+ 0, 0xC972, 0, 0, 0, 0xC973, 0x7752, 0x7753,
+ 0, 0x4E7B, 0xEF74, 0xC977, 0x5F6A, 0, 0x4079, 0,
+ 0xEF73, 0x7754, 0x7756, 0xEF75, 0, 0x5F66, 0x5F6B, 0xC97A,
+ 0, 0x316C, 0xC97B, 0, 0x7757, 0, 0xEF76, 0,
+ 0x7758, 0, 0x5F69, 0, 0x4761, 0x5F65, 0x5F68, 0x3E48,
+ 0x7759, 0x4851, 0, 0, 0x5F6C, 0, 0x3C51, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0xCA22, 0, 0, 0, 0x407A, 0, 0,
+};
static const unsigned short utf8_to_euc_E786[] = {
0xCA23, 0, 0, 0, 0x5F6F, 0xCA24, 0, 0xCA25,
0x5F67, 0, 0x3727, 0, 0xCA26, 0, 0, 0x5F6D,
@@ -4429,6 +8218,16 @@ static const unsigned short utf8_to_euc_E786[] = {
0xCA2D, 0x472E, 0xCA2E, 0xCA2F, 0, 0, 0, 0,
0, 0x5F74, 0xCA30, 0, 0, 0, 0x5F75, 0xCA31,
};
+static const unsigned short utf8_to_euc_E786_x0213[] = {
+ 0xEF79, 0, 0, 0, 0x5F6F, 0x775B, 0, 0x775C,
+ 0x5F67, 0, 0x3727, 0, 0xCA26, 0, 0, 0x5F6D,
+ 0, 0, 0x775D, 0, 0x4D50, 0x5F70, 0xEF78, 0,
+ 0, 0x7426, 0xCA28, 0xEF7A, 0, 0, 0, 0x3D4F,
+ 0xEF7B, 0, 0xEF7C, 0, 0, 0, 0, 0,
+ 0x5F71, 0, 0, 0, 0x5F72, 0, 0xEF7D, 0xEF7E,
+ 0xCA2D, 0x472E, 0xCA2E, 0xF021, 0, 0, 0, 0,
+ 0, 0x5F74, 0x775F, 0, 0, 0, 0x5F75, 0xCA31,
+};
static const unsigned short utf8_to_euc_E787[] = {
0xCA32, 0xCA33, 0, 0x4733, 0xCA34, 0, 0, 0,
0x4575, 0x5F77, 0, 0xCA35, 0xCA36, 0, 0x5F79, 0,
@@ -4439,6 +8238,16 @@ static const unsigned short utf8_to_euc_E787[] = {
0, 0, 0, 0, 0, 0x5F7D, 0, 0,
0xCA3C, 0x6021, 0, 0x5F6E, 0x5F7E, 0, 0xCA3D, 0x6022,
};
+static const unsigned short utf8_to_euc_E787_x0213[] = {
+ 0xCA32, 0x775E, 0, 0x4733, 0x7760, 0, 0, 0,
+ 0x4575, 0x5F77, 0, 0xF023, 0xCA36, 0, 0x5F79, 0,
+ 0x4E55, 0, 0x5F76, 0xF024, 0x5F78, 0x316D, 0xCA38, 0x5F73,
+ 0, 0xF025, 0xCA3A, 0, 0xF026, 0, 0, 0x535B,
+ 0x5F7A, 0, 0, 0, 0, 0x4167, 0x3B38, 0x5F7C,
+ 0, 0, 0, 0, 0x5F7B, 0x3F24, 0x5259, 0,
+ 0, 0, 0, 0, 0, 0x5F7D, 0, 0,
+ 0xCA3C, 0x6021, 0, 0x5F6E, 0x5F7E, 0, 0x7761, 0x6022,
+};
static const unsigned short utf8_to_euc_E788[] = {
0xCA3E, 0, 0, 0, 0, 0, 0x477A, 0xCA3F,
0xCA40, 0xCA41, 0, 0, 0, 0x6023, 0, 0,
@@ -4449,6 +8258,16 @@ static const unsigned short utf8_to_euc_E788[] = {
0x6029, 0, 0x602A, 0, 0xCA4A, 0x3C5F, 0x4963, 0,
0xCA4B, 0xCA4C, 0x4C6C, 0x602B, 0x602C, 0x4156, 0x3C24, 0x602D,
};
+static const unsigned short utf8_to_euc_E788_x0213[] = {
+ 0x7762, 0, 0, 0, 0, 0, 0x477A, 0xF027,
+ 0xCA40, 0xCA41, 0, 0, 0, 0x6023, 0, 0,
+ 0x6024, 0, 0, 0xCA42, 0, 0x7763, 0, 0xCA43,
+ 0, 0, 0xCA44, 0x6025, 0, 0xCA45, 0, 0xCA46,
+ 0, 0, 0, 0, 0xCA47, 0, 0, 0,
+ 0x6026, 0, 0x445E, 0xF02A, 0x6028, 0x6027, 0, 0xCA49,
+ 0x6029, 0, 0x602A, 0, 0xF02B, 0x3C5F, 0x4963, 0,
+ 0xF02C, 0xF02D, 0x4C6C, 0x602B, 0x602C, 0x4156, 0x3C24, 0x602D,
+};
static const unsigned short utf8_to_euc_E789[] = {
0x602E, 0xCA4D, 0xCA4E, 0xCA4F, 0, 0xCA50, 0x602F, 0x4A52,
0x4847, 0, 0, 0x6030, 0x4757, 0, 0xCA51, 0xCA52,
@@ -4459,6 +8278,16 @@ static const unsigned short utf8_to_euc_E789[] = {
0, 0xCA60, 0x4037, 0, 0x6032, 0, 0, 0xCA61,
0xCA62, 0x4643, 0, 0xCA63, 0xCA64, 0x3823, 0x6033, 0xCA65,
};
+static const unsigned short utf8_to_euc_E789_x0213[] = {
+ 0x602E, 0xCA4D, 0xF02F, 0xCA4F, 0, 0xCA50, 0x602F, 0x4A52,
+ 0x4847, 0, 0, 0x6030, 0x4757, 0, 0xCA51, 0xCA52,
+ 0xCA53, 0, 0x442D, 0xF030, 0, 0x7764, 0x7765, 0xF031,
+ 0x6031, 0x3267, 0xCA57, 0x356D, 0xCA58, 0x4C46, 0xCA59, 0x4C36,
+ 0xCA5A, 0x3234, 0x4F34, 0xF032, 0, 0, 0, 0x4B52,
+ 0xCA5C, 0x4A2A, 0, 0xCA5D, 0, 0, 0xF034, 0xF035,
+ 0, 0xCA60, 0x4037, 0, 0x6032, 0, 0, 0xCA61,
+ 0xF036, 0x4643, 0, 0xCA63, 0xCA64, 0x3823, 0x6033, 0xF037,
+};
static const unsigned short utf8_to_euc_E78A[] = {
0x3A54, 0x6035, 0x6034, 0, 0xCA66, 0, 0, 0x6036,
0, 0xCA67, 0, 0, 0, 0xCA68, 0xCA69, 0,
@@ -4469,6 +8298,16 @@ static const unsigned short utf8_to_euc_E78A[] = {
0, 0xCA6F, 0x603C, 0, 0xCA70, 0, 0x3E75, 0,
0, 0x603B, 0, 0, 0, 0, 0xCA71, 0,
};
+static const unsigned short utf8_to_euc_E78A_x0213[] = {
+ 0x3A54, 0x6035, 0x6034, 0, 0xCA66, 0, 0, 0x6036,
+ 0, 0xCA67, 0, 0, 0, 0x7767, 0xF038, 0,
+ 0, 0, 0x6037, 0xCA6A, 0, 0, 0x6038, 0,
+ 0, 0, 0, 0x7768, 0, 0, 0, 0,
+ 0x353E, 0, 0x6039, 0, 0, 0, 0, 0x603A,
+ 0xCA6C, 0, 0, 0, 0x3824, 0xF03A, 0xF03B, 0x4848,
+ 0xF03C, 0xF03D, 0x603C, 0, 0xCA70, 0, 0x3E75, 0,
+ 0, 0x603B, 0, 0, 0, 0, 0x7769, 0,
+};
static const unsigned short utf8_to_euc_E78B[] = {
0, 0xCA72, 0x3638, 0x603D, 0x603F, 0, 0x603E, 0xCA73,
0, 0xCA74, 0, 0, 0xCA75, 0, 0x6040, 0,
@@ -4479,6 +8318,16 @@ static const unsigned short utf8_to_euc_E78B[] = {
0, 0, 0, 0xCA7B, 0xCA7C, 0, 0, 0x6046,
0x432C, 0x6045, 0xCA7D, 0xCA7E, 0x4F35, 0x4762, 0xCB21, 0,
};
+static const unsigned short utf8_to_euc_E78B_x0213[] = {
+ 0x776A, 0xF03E, 0x3638, 0x603D, 0x603F, 0, 0x603E, 0xCA73,
+ 0, 0xCA74, 0, 0, 0xF040, 0, 0x6040, 0,
+ 0x3851, 0, 0x6041, 0, 0, 0xCA76, 0xCA77, 0x3669,
+ 0xCA78, 0x4140, 0, 0x397D, 0, 0, 0, 0xCA79,
+ 0x6043, 0x6044, 0x6042, 0, 0, 0xCA7A, 0, 0,
+ 0, 0x3C6D, 0, 0, 0x4648, 0x3639, 0, 0,
+ 0, 0, 0, 0xF043, 0xCA7C, 0, 0, 0x6046,
+ 0x432C, 0x6045, 0xF044, 0x776B, 0x4F35, 0x4762, 0xCB21, 0,
+};
static const unsigned short utf8_to_euc_E78C[] = {
0, 0, 0xCB22, 0, 0xCB23, 0xCB24, 0, 0xCB25,
0, 0, 0x6049, 0xCB26, 0, 0xCB27, 0, 0,
@@ -4489,6 +8338,16 @@ static const unsigned short utf8_to_euc_E78C[] = {
0, 0xCB32, 0xCB33, 0, 0x604D, 0xCB34, 0x4D31, 0x4D32,
0, 0, 0xCB35, 0xCB36, 0, 0xCB37, 0x6051, 0x316E,
};
+static const unsigned short utf8_to_euc_E78C_x0213[] = {
+ 0, 0, 0xCB22, 0, 0xCB23, 0xCB24, 0, 0xF045,
+ 0, 0, 0x6049, 0xCB26, 0, 0xCB27, 0, 0,
+ 0, 0, 0xF046, 0xCB29, 0, 0, 0x604B, 0x6048,
+ 0xF047, 0xF048, 0, 0x4C54, 0x604A, 0x604C, 0xCB2C, 0x4E44,
+ 0, 0, 0xCB2D, 0, 0xCB2E, 0x6050, 0, 0x776D,
+ 0x776E, 0x604F, 0x4376, 0x472D, 0xF04B, 0, 0x3825, 0x604E,
+ 0, 0xF04C, 0xCB33, 0xF04D, 0x604D, 0xCB34, 0x4D31, 0x4D32,
+ 0, 0xF04A, 0xCB35, 0xCB36, 0, 0xF04E, 0x6051, 0x316E,
+};
static const unsigned short utf8_to_euc_E78D[] = {
0, 0, 0, 0xCB38, 0x3976, 0x3B62, 0, 0,
0, 0, 0, 0, 0, 0xCB39, 0x6052, 0x6053,
@@ -4499,6 +8358,16 @@ static const unsigned short utf8_to_euc_E78D[] = {
0x6058, 0xCB49, 0x334D, 0, 0, 0x605A, 0, 0xCB4A,
0x6059, 0xCB4B, 0x605C, 0x605B, 0xCB4C, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E78D_x0213[] = {
+ 0, 0, 0, 0xCB38, 0x3976, 0x3B62, 0, 0,
+ 0, 0, 0, 0, 0, 0xCB39, 0x6052, 0x6053,
+ 0x7770, 0, 0xF04F, 0, 0, 0, 0xCB3C, 0x6055,
+ 0xCB3D, 0, 0, 0, 0, 0xCB3E, 0xCB3F, 0xCB40,
+ 0xCB41, 0, 0, 0x3D43, 0, 0, 0x7771, 0xCB43,
+ 0x6057, 0xCB44, 0x6056, 0xF051, 0xF052, 0, 0xF054, 0xF055,
+ 0x6058, 0xF056, 0x334D, 0, 0, 0x605A, 0, 0xF057,
+ 0x6059, 0xCB4B, 0x605C, 0x605B, 0x7772, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E78E[] = {
0xCB4D, 0xCB4E, 0, 0xCB4F, 0x383C, 0xCB50, 0xCB51, 0x4E28,
0, 0x364C, 0, 0x3226, 0, 0, 0xCB52, 0,
@@ -4509,6 +8378,16 @@ static const unsigned short utf8_to_euc_E78E[] = {
0, 0, 0x4E68, 0x605E, 0, 0xCB62, 0, 0xCB63,
0, 0xCB64, 0, 0x6060, 0xCB65, 0xCB66, 0, 0xCB67,
};
+static const unsigned short utf8_to_euc_E78E_x0213[] = {
+ 0xCB4D, 0xF058, 0, 0xCB4F, 0x383C, 0xF059, 0xCB51, 0x4E28,
+ 0, 0x364C, 0xF05A, 0x3226, 0, 0, 0xCB52, 0,
+ 0xCB53, 0, 0, 0xCB54, 0xF05B, 0x7773, 0x366A, 0xCB56,
+ 0xF05C, 0, 0, 0, 0xF05D, 0, 0xF05E, 0x7774,
+ 0x7775, 0, 0x7776, 0, 0, 0xF05F, 0x7777, 0,
+ 0xF060, 0x3461, 0xCB5F, 0x7778, 0, 0xCB61, 0, 0,
+ 0, 0, 0x4E68, 0x605E, 0, 0xF061, 0, 0xF062,
+ 0, 0xF063, 0, 0x6060, 0xF064, 0xCB66, 0, 0xF065,
+};
static const unsigned short utf8_to_euc_E78F[] = {
0x6061, 0, 0x3251, 0, 0, 0xCB68, 0xCB69, 0,
0x605D, 0xCB6A, 0x3B39, 0xCB6B, 0xCB6C, 0x4441, 0x605F, 0xCB6D,
@@ -4519,6 +8398,16 @@ static const unsigned short utf8_to_euc_E78F[] = {
0, 0x607E, 0, 0, 0xCB78, 0xCB79, 0, 0xCB7A,
0x6069, 0xCB7B, 0xCB7C, 0xCB7D, 0, 0xCB7E, 0x383D, 0xCC21,
};
+static const unsigned short utf8_to_euc_E78F_x0213[] = {
+ 0x6061, 0, 0x3251, 0, 0, 0xF066, 0xCB69, 0,
+ 0x605D, 0x7779, 0x3B39, 0xF067, 0xCB6C, 0x4441, 0x605F, 0x777A,
+ 0, 0, 0xCB6E, 0xCB6F, 0, 0, 0x777B, 0,
+ 0, 0x777C, 0, 0, 0, 0xCB72, 0x6064, 0,
+ 0x3C6E, 0xF068, 0, 0x777D, 0, 0x6062, 0xCB75, 0xF069,
+ 0, 0x777E, 0x373E, 0, 0, 0x4849, 0x6063, 0,
+ 0, 0x607E, 0, 0, 0xCB78, 0xCB79, 0, 0xCB7A,
+ 0x6069, 0xF06A, 0xF06C, 0xCB7D, 0, 0xCB7E, 0x383D, 0xCC21,
+};
static const unsigned short utf8_to_euc_E790[] = {
0xCC22, 0xCC23, 0, 0x3565, 0xCC24, 0x6066, 0x4D7D, 0xCC25,
0, 0x4E30, 0xCC26, 0, 0, 0, 0, 0,
@@ -4529,6 +8418,16 @@ static const unsigned short utf8_to_euc_E790[] = {
0xCC34, 0xCC35, 0x606A, 0x4E56, 0x3657, 0x487C, 0x474A, 0,
0, 0xCC36, 0x606B, 0, 0, 0, 0, 0x606D,
};
+static const unsigned short utf8_to_euc_E790_x0213[] = {
+ 0xCC22, 0xF06D, 0, 0x3565, 0xCC24, 0x6066, 0x4D7D, 0x7821,
+ 0, 0x4E30, 0x7822, 0, 0, 0, 0, 0,
+ 0, 0xCC27, 0, 0xF06B, 0, 0, 0, 0,
+ 0, 0, 0x7823, 0x7824, 0, 0, 0, 0,
+ 0, 0, 0x4276, 0, 0xF06E, 0x6068, 0x7826, 0,
+ 0x7827, 0xCC2D, 0x7828, 0x7829, 0x782A, 0xCC31, 0x782B, 0x782C,
+ 0x782D, 0xF06F, 0x606A, 0x4E56, 0x3657, 0x487C, 0x474A, 0,
+ 0, 0xF070, 0x606B, 0, 0, 0, 0, 0x606D,
+};
static const unsigned short utf8_to_euc_E791[] = {
0xCC37, 0x6070, 0, 0xCC38, 0xCC39, 0, 0xCC3A, 0xCC3B,
0, 0, 0, 0xCC3C, 0, 0xCC3D, 0, 0,
@@ -4539,6 +8438,16 @@ static const unsigned short utf8_to_euc_E791[] = {
0x6073, 0xCC49, 0xCC4A, 0x3A3C, 0, 0, 0x6076, 0,
0, 0, 0, 0, 0, 0, 0x6077, 0,
};
+static const unsigned short utf8_to_euc_E791_x0213[] = {
+ 0xF072, 0x6070, 0, 0xF073, 0x782E, 0, 0x782F, 0x7830,
+ 0, 0, 0, 0x7831, 0, 0xF074, 0, 0,
+ 0, 0xCC3E, 0xF075, 0xF071, 0, 0x606C, 0, 0x7832,
+ 0, 0x606F, 0x386A, 0x314D, 0x6071, 0xF076, 0x3F70, 0x606E,
+ 0x4E5C, 0, 0x7833, 0x6074, 0x7424, 0, 0xCC43, 0xCC44,
+ 0xCC45, 0x6072, 0x6075, 0x7834, 0, 0x7835, 0xCC48, 0x6067,
+ 0x6073, 0xF077, 0xCC4A, 0x3A3C, 0, 0, 0x6076, 0,
+ 0, 0, 0, 0, 0, 0, 0x6077, 0,
+};
static const unsigned short utf8_to_euc_E792[] = {
0xCC4B, 0xCC4C, 0, 0x4D7E, 0, 0xCC4D, 0xCC4E, 0xCC4F,
0, 0xCC50, 0, 0x6078, 0, 0, 0, 0xCC51,
@@ -4549,6 +8458,16 @@ static const unsigned short utf8_to_euc_E792[] = {
0x3444, 0xCC64, 0xCC65, 0, 0, 0xCC66, 0, 0,
0, 0xCC67, 0, 0xCC68, 0, 0x3C25, 0, 0xCC69,
};
+static const unsigned short utf8_to_euc_E792_x0213[] = {
+ 0xCC4B, 0xF078, 0, 0x4D7E, 0, 0xF079, 0x7836, 0x7837,
+ 0xF07A, 0x7838, 0, 0x6078, 0, 0, 0, 0xCC51,
+ 0x783D, 0xCC53, 0xF07C, 0, 0, 0, 0, 0xF07D,
+ 0x7839, 0xF07E, 0xCC57, 0, 0x783A, 0, 0x6079, 0x783B,
+ 0xF121, 0xF122, 0x6065, 0x783C, 0, 0xF123, 0x783E, 0x607A,
+ 0x783F, 0x7840, 0xF124, 0xF125, 0, 0, 0xCC62, 0xCC63,
+ 0x3444, 0xCC64, 0xCC65, 0, 0, 0x7841, 0, 0,
+ 0, 0xF126, 0xF128, 0xF127, 0, 0x3C25, 0, 0x7842,
+};
static const unsigned short utf8_to_euc_E793[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0xCC6A, 0xCC6B, 0x607B, 0, 0xCC6C, 0, 0, 0x607C,
@@ -4559,6 +8478,16 @@ static const unsigned short utf8_to_euc_E793[] = {
0x6127, 0x6128, 0x6126, 0, 0xCC79, 0, 0x4953, 0x612A,
0x6129, 0, 0xCC7A, 0xCC7B, 0xCC7C, 0, 0, 0xCC7D,
};
+static const unsigned short utf8_to_euc_E793_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0x7843, 0x7844, 0x607B, 0, 0xCC6C, 0, 0, 0x607C,
+ 0xCC6D, 0, 0, 0xCC6E, 0x607D, 0, 0xF129, 0,
+ 0xF12A, 0, 0x7845, 0xCC71, 0x313B, 0, 0xF12B, 0xCC73,
+ 0x6121, 0, 0x493B, 0x6122, 0xCC74, 0, 0x3424, 0x6123,
+ 0xCC75, 0x6124, 0xCC76, 0xF12D, 0, 0, 0x6125, 0xF12C,
+ 0x6127, 0x6128, 0x6126, 0, 0xCC79, 0, 0x4953, 0x612A,
+ 0x6129, 0, 0xF12F, 0xCC7B, 0xCC7C, 0, 0, 0x7846,
+};
static const unsigned short utf8_to_euc_E794[] = {
0, 0xF450, 0, 0x612C, 0x612B, 0x612D, 0xCC7E, 0,
0, 0, 0, 0, 0x612E, 0x6130, 0x612F, 0,
@@ -4569,6 +8498,16 @@ static const unsigned short utf8_to_euc_E794[] = {
0x4544, 0x4D33, 0x3943, 0x3F3D, 0, 0, 0xCD2B, 0x434B,
0x5234, 0xCD2C, 0x442E, 0x3268, 0x6136, 0xCD2D, 0xCD2E, 0xCD2F,
};
+static const unsigned short utf8_to_euc_E794_x0213[] = {
+ 0, 0x7847, 0, 0x612C, 0x612B, 0x612D, 0xCC7E, 0,
+ 0, 0, 0, 0, 0x612E, 0x6130, 0x612F, 0,
+ 0, 0x3979, 0xCD21, 0x6132, 0, 0x6131, 0xCD22, 0x7848,
+ 0x3445, 0, 0x3F53, 0, 0x453C, 0, 0x6133, 0x4038,
+ 0xF131, 0xCD25, 0, 0x3B3A, 0xF132, 0x3179, 0x6134, 0xCD27,
+ 0x4D51, 0xCD28, 0xF133, 0x4A63, 0x6135, 0, 0, 0x7849,
+ 0x4544, 0x4D33, 0x3943, 0x3F3D, 0, 0, 0xCD2B, 0x434B,
+ 0x5234, 0xCD2C, 0x442E, 0x3268, 0x6136, 0xF136, 0xF137, 0xCD2F,
+};
static const unsigned short utf8_to_euc_E795[] = {
0xCD30, 0, 0, 0xCD31, 0x6137, 0, 0x613C, 0xCD32,
0xCD33, 0x613A, 0x6139, 0x5A42, 0x3326, 0x6138, 0xCD34, 0x305A,
@@ -4579,6 +8518,16 @@ static const unsigned short utf8_to_euc_E795[] = {
0x305B, 0xCD3C, 0, 0x3E76, 0x6147, 0, 0x6144, 0x466D,
0x6143, 0xCD3D, 0xCD3E, 0xCD3F, 0xCD40, 0xCD41, 0xCD42, 0x3526,
};
+static const unsigned short utf8_to_euc_E795_x0213[] = {
+ 0xF138, 0, 0, 0xCD31, 0x6137, 0, 0x613C, 0xCD32,
+ 0xF139, 0x613A, 0x6139, 0x5A42, 0x3326, 0x6138, 0xF13A, 0x305A,
+ 0xF13B, 0x482A, 0xF13C, 0, 0x484A, 0, 0, 0xCD37,
+ 0, 0x4E31, 0x613D, 0x613B, 0x435C, 0x4026, 0xCD38, 0xCD39,
+ 0x482B, 0xCD3A, 0x492D, 0, 0x613F, 0x4E2C, 0x374D, 0x6140,
+ 0, 0x613E, 0x4856, 0x6141, 0xF13D, 0x6142, 0, 0x784A,
+ 0x305B, 0xF13F, 0xF13E, 0x3E76, 0x6147, 0, 0x6144, 0x466D,
+ 0x6143, 0x784B, 0xF140, 0xCD3F, 0xCD40, 0xF141, 0xF142, 0x3526,
+};
static const unsigned short utf8_to_euc_E796[] = {
0, 0xCD43, 0x614A, 0, 0, 0xCD44, 0x6145, 0x6146,
0, 0x6149, 0x6148, 0x4925, 0, 0, 0x4142, 0x4141,
@@ -4589,6 +8538,16 @@ static const unsigned short utf8_to_euc_E796[] = {
0, 0x6157, 0x4868, 0x6151, 0xCD4D, 0x6153, 0, 0,
0x6155, 0x3F3E, 0xCD4E, 0, 0x6156, 0x6154, 0x3C40, 0xCD4F,
};
+static const unsigned short utf8_to_euc_E796_x0213[] = {
+ 0, 0xF143, 0x614A, 0, 0, 0xCD44, 0x6145, 0x6146,
+ 0, 0x6149, 0x6148, 0x4925, 0xF145, 0, 0x4142, 0x4141,
+ 0xCD45, 0x353F, 0x784C, 0xCD47, 0x614B, 0xCD48, 0, 0,
+ 0, 0xCD49, 0x614C, 0, 0xCD4A, 0x614D, 0, 0,
+ 0, 0, 0xF147, 0x614F, 0xCD4C, 0x614E, 0, 0,
+ 0, 0, 0, 0x3156, 0, 0, 0, 0,
+ 0xF149, 0x6157, 0x4868, 0x6151, 0xCD4D, 0x6153, 0, 0xF14A,
+ 0x6155, 0x3F3E, 0xCD4E, 0, 0x6156, 0x6154, 0x3C40, 0xF14B,
+};
static const unsigned short utf8_to_euc_E797[] = {
0xCD50, 0xCD51, 0x6150, 0x6152, 0xCD52, 0x4942, 0xCD53, 0x3E49,
0, 0, 0x6159, 0, 0xCD54, 0x6158, 0xCD55, 0xCD56,
@@ -4599,6 +8558,16 @@ static const unsigned short utf8_to_euc_E797[] = {
0x6162, 0xCD61, 0x6164, 0x6165, 0x4354, 0, 0, 0,
0, 0xCD62, 0x6163, 0, 0x6160, 0, 0x615E, 0x615F,
};
+static const unsigned short utf8_to_euc_E797_x0213[] = {
+ 0xF14C, 0xCD51, 0x6150, 0x6152, 0xCD52, 0x4942, 0xF14D, 0x3E49,
+ 0, 0, 0x6159, 0, 0xCD54, 0x6158, 0x784E, 0xF14E,
+ 0, 0, 0x615A, 0xF14F, 0x3C26, 0x3A2F, 0, 0xCD57,
+ 0x4577, 0x615B, 0, 0x444B, 0xCD58, 0xF150, 0x615D, 0xF151,
+ 0xF152, 0xCD5B, 0x4E21, 0x615C, 0x784F, 0, 0, 0xF153,
+ 0, 0x4169, 0, 0, 0xF154, 0, 0xF155, 0xCD60,
+ 0x6162, 0xF156, 0x6164, 0x6165, 0x4354, 0, 0, 0,
+ 0, 0xF157, 0x6163, 0, 0x6160, 0, 0x615E, 0x615F,
+};
static const unsigned short utf8_to_euc_E798[] = {
0xCD63, 0x6161, 0xCD64, 0xCD65, 0xCD66, 0, 0, 0xCD67,
0xCD68, 0x6168, 0xCD69, 0x6166, 0xCD6A, 0x6167, 0, 0xCD6B,
@@ -4609,6 +8578,16 @@ static const unsigned short utf8_to_euc_E798[] = {
0x6170, 0, 0xCD7A, 0xCD7B, 0x616F, 0xCD7C, 0, 0,
0xCD7D, 0xCD7E, 0xCE21, 0x6171, 0xCE22, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E798_x0213[] = {
+ 0x7850, 0x6161, 0x7851, 0xF158, 0xCD66, 0, 0, 0xF15A,
+ 0x7852, 0x6168, 0xCD69, 0x6166, 0xCD6A, 0x6167, 0, 0xF15B,
+ 0, 0, 0xCD6C, 0xF15E, 0, 0x7853, 0x7854, 0,
+ 0xF159, 0x7855, 0, 0xF15F, 0xF160, 0xCD73, 0x7856, 0x6169,
+ 0x616B, 0x616C, 0x616D, 0xCD75, 0x616E, 0xF162, 0x7E7D, 0x616A,
+ 0xF163, 0xCD78, 0, 0, 0, 0x7857, 0, 0,
+ 0x6170, 0, 0xCD7A, 0xF165, 0x616F, 0x7858, 0, 0,
+ 0xCD7D, 0xCD7E, 0xCE21, 0x6171, 0xF164, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E799[] = {
0xCE24, 0xCE25, 0x4E45, 0xCE26, 0xCE27, 0xCE28, 0x6174, 0x6172,
0x6173, 0xCE29, 0xCE23, 0xCE2A, 0x3462, 0, 0, 0,
@@ -4619,6 +8598,16 @@ static const unsigned short utf8_to_euc_E799[] = {
0x617E, 0xCE33, 0x6221, 0, 0xCE34, 0, 0x6222, 0,
0x6223, 0, 0x482F, 0x4550, 0x6224, 0x4772, 0x4934, 0,
};
+static const unsigned short utf8_to_euc_E799_x0213[] = {
+ 0xCE24, 0xF168, 0x4E45, 0x7859, 0xCE27, 0xCE28, 0x6174, 0x6172,
+ 0x6173, 0xF16A, 0xCE23, 0x785A, 0x3462, 0, 0, 0,
+ 0, 0, 0x4C7E, 0, 0, 0xF16B, 0x4A4A, 0,
+ 0x6176, 0xCE2C, 0, 0, 0x6175, 0, 0, 0xCE2D,
+ 0, 0x6177, 0x6178, 0, 0x785B, 0x785C, 0, 0x617C,
+ 0x6179, 0x617A, 0x617B, 0, 0x617D, 0x785D, 0xF16D, 0x785E,
+ 0x617E, 0x785F, 0x6221, 0, 0xCE34, 0, 0x6222, 0,
+ 0x6223, 0, 0x482F, 0x4550, 0x6224, 0x4772, 0x4934, 0,
+};
static const unsigned short utf8_to_euc_E79A[] = {
0x6225, 0xCE35, 0xF451, 0x6226, 0x452A, 0xCE36, 0x3327, 0x3944,
0x6227, 0, 0, 0x6228, 0xCE37, 0xCE38, 0x6229, 0,
@@ -4629,6 +8618,16 @@ static const unsigned short utf8_to_euc_E79A[] = {
0x622E, 0, 0, 0, 0x622F, 0, 0, 0x7369,
0x6230, 0x6231, 0x6232, 0, 0, 0xCE48, 0, 0x3B2E,
};
+static const unsigned short utf8_to_euc_E79A_x0213[] = {
+ 0x6225, 0x7860, 0xF451, 0x6226, 0x452A, 0xCE36, 0x3327, 0x3944,
+ 0x6227, 0, 0, 0x6228, 0xCE37, 0xCE38, 0x6229, 0,
+ 0x3B29, 0, 0, 0x622B, 0, 0xF16E, 0x622A, 0,
+ 0, 0x622C, 0x622D, 0x7861, 0xF16F, 0x7862, 0x7863, 0xCE3D,
+ 0xF171, 0xF170, 0xCE3F, 0xCE40, 0xCE41, 0xCE42, 0x7864, 0xF172,
+ 0xF173, 0, 0x7865, 0, 0, 0xCE47, 0x4869, 0xF174,
+ 0x622E, 0, 0, 0, 0x622F, 0, 0x7866, 0x7369,
+ 0x6230, 0x6231, 0x6232, 0, 0, 0xCE48, 0, 0x3B2E,
+};
static const unsigned short utf8_to_euc_E79B[] = {
0, 0xCE49, 0x6233, 0x4756, 0, 0xCE4A, 0x4B5F, 0,
0x314E, 0xCE4B, 0x3157, 0xCE4C, 0xCE4D, 0x6234, 0xCE4E, 0,
@@ -4639,6 +8638,16 @@ static const unsigned short utf8_to_euc_E79B[] = {
0xCE55, 0xCE56, 0x4C55, 0, 0x443E, 0, 0xCE57, 0,
0x416A, 0xCE58, 0, 0x623D, 0xCE59, 0, 0x3D62, 0,
};
+static const unsigned short utf8_to_euc_E79B_x0213[] = {
+ 0, 0xCE49, 0x6233, 0x4756, 0, 0x7867, 0x4B5F, 0,
+ 0x314E, 0xF176, 0x3157, 0xCE4C, 0x7868, 0x6234, 0x7869, 0,
+ 0, 0, 0x6236, 0, 0x786A, 0, 0x6235, 0x4570,
+ 0, 0xCE50, 0, 0x4039, 0x5D39, 0, 0x6237, 0x4C41,
+ 0xCE51, 0x6238, 0, 0x3446, 0x4857, 0x6239, 0x786B, 0x623A,
+ 0xF178, 0, 0x623B, 0, 0xF179, 0, 0x4C5C, 0,
+ 0xCE55, 0x786C, 0x4C55, 0, 0x443E, 0, 0xCE57, 0,
+ 0x416A, 0xCE58, 0, 0x623D, 0x786D, 0, 0x3D62, 0,
+};
static const unsigned short utf8_to_euc_E79C[] = {
0xCE5A, 0x3E4A, 0, 0, 0x6240, 0, 0xCE5B, 0x623F,
0x623E, 0x487D, 0xCE5C, 0x3447, 0x3829, 0, 0xCE5D, 0,
@@ -4649,6 +8658,16 @@ static const unsigned short utf8_to_euc_E79C[] = {
0, 0, 0, 0, 0xCE6A, 0xCE6B, 0xCE6C, 0x6247,
0x6248, 0xCE6D, 0x442F, 0, 0x3463, 0xCE6E, 0xCE6F, 0,
};
+static const unsigned short utf8_to_euc_E79C_x0213[] = {
+ 0xCE5A, 0x3E4A, 0, 0, 0x6240, 0, 0xCE5B, 0x623F,
+ 0x623E, 0x487D, 0x786E, 0x3447, 0x3829, 0, 0xCE5D, 0,
+ 0, 0, 0xCE5E, 0, 0xCE5F, 0xCE60, 0, 0xF17B,
+ 0, 0x786F, 0xF17C, 0x6246, 0xCE64, 0, 0x6243, 0x3F3F,
+ 0x4C32, 0, 0xCE65, 0, 0x6242, 0x6244, 0x6245, 0,
+ 0xCE66, 0x6241, 0, 0, 0, 0xF17D, 0xCE68, 0xCE69,
+ 0, 0, 0, 0, 0x7870, 0xF17E, 0x7871, 0x6247,
+ 0x6248, 0xCE6D, 0x442F, 0, 0x3463, 0xCE6E, 0xCE6F, 0,
+};
static const unsigned short utf8_to_euc_E79D[] = {
0x4365, 0, 0xCE70, 0, 0, 0xCE71, 0xCE72, 0x6249,
0, 0, 0xCE73, 0, 0, 0xCE74, 0xCE75, 0xCE76,
@@ -4659,6 +8678,16 @@ static const unsigned short utf8_to_euc_E79D[] = {
0xCF25, 0, 0xCF26, 0xCF27, 0xCF28, 0, 0, 0,
0, 0x6251, 0xCF29, 0, 0, 0xCF2A, 0x6250, 0x624F,
};
+static const unsigned short utf8_to_euc_E79D_x0213[] = {
+ 0x4365, 0, 0xCE70, 0, 0, 0xCE71, 0x7872, 0x6249,
+ 0, 0, 0xCE73, 0, 0, 0x7873, 0x7874, 0xCE76,
+ 0, 0, 0xCE77, 0, 0, 0, 0xCE78, 0xCE79,
+ 0xF225, 0, 0x624A, 0x624D, 0x7875, 0, 0xCE7B, 0x7876,
+ 0xF226, 0x3F67, 0x7877, 0x4644, 0xCF21, 0x624E, 0x4B53, 0xCF22,
+ 0x624B, 0, 0xF227, 0x624C, 0xCF24, 0, 0, 0,
+ 0xCF25, 0, 0xF229, 0xCF27, 0xCF28, 0, 0, 0,
+ 0, 0x6251, 0x7878, 0, 0xF22A, 0xF22B, 0x6250, 0x624F,
+};
static const unsigned short utf8_to_euc_E79E[] = {
0xCF2B, 0, 0, 0, 0xCF2C, 0, 0, 0,
0, 0, 0, 0x6253, 0xCF2D, 0xCF2E, 0x6252, 0,
@@ -4669,6 +8698,16 @@ static const unsigned short utf8_to_euc_E79E[] = {
0x6257, 0xCF39, 0, 0x4637, 0, 0xCF3A, 0x6258, 0,
0, 0x6259, 0, 0x625D, 0x625B, 0x625C, 0xCF3B, 0x625A,
};
+static const unsigned short utf8_to_euc_E79E_x0213[] = {
+ 0x7879, 0, 0, 0, 0xCF2C, 0, 0, 0,
+ 0, 0, 0, 0x6253, 0xCF2D, 0xCF2E, 0x6252, 0,
+ 0, 0x6254, 0, 0, 0x787A, 0xCF30, 0xCF31, 0,
+ 0, 0, 0xF22E, 0, 0, 0, 0x6256, 0xF22F,
+ 0x6255, 0, 0xF230, 0, 0xF231, 0x4A4D, 0, 0xCF35,
+ 0, 0xF232, 0x787B, 0, 0x3D56, 0x4E46, 0xCF37, 0xCF38,
+ 0x6257, 0xCF39, 0, 0x4637, 0, 0xCF3A, 0x6258, 0,
+ 0, 0x6259, 0, 0x625D, 0x625B, 0x625C, 0xCF3B, 0x625A,
+};
static const unsigned short utf8_to_euc_E79F[] = {
0, 0, 0, 0xCF3C, 0, 0, 0, 0x625E,
0, 0xCF3D, 0, 0, 0, 0x625F, 0, 0,
@@ -4679,6 +8718,16 @@ static const unsigned short utf8_to_euc_E79F[] = {
0xCF49, 0xCF4A, 0, 0x4050, 0xCF4B, 0, 0, 0,
0xCF4C, 0, 0, 0xCF4D, 0x6265, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E79F_x0213[] = {
+ 0, 0, 0, 0xCF3C, 0, 0, 0, 0x625E,
+ 0, 0xCF3D, 0, 0, 0, 0x625F, 0, 0,
+ 0, 0xCF3E, 0xCF3F, 0, 0, 0xCF40, 0, 0x6260,
+ 0, 0xCF41, 0x6261, 0x4C37, 0x6262, 0, 0xF233, 0xF234,
+ 0x787C, 0, 0x4C70, 0x6263, 0xF235, 0x434E, 0xF236, 0x476A,
+ 0, 0x366B, 0xF237, 0, 0xF238, 0x433B, 0x6264, 0x363A,
+ 0xF23A, 0xCF4A, 0, 0x4050, 0xF23B, 0, 0, 0,
+ 0xCF4C, 0, 0, 0xF23C, 0x6265, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E7A0[] = {
0, 0, 0x3A3D, 0, 0, 0xCF4E, 0xCF4F, 0,
0, 0xCF50, 0, 0, 0x6266, 0xCF51, 0xCF52, 0,
@@ -4689,6 +8738,16 @@ static const unsigned short utf8_to_euc_E7A0[] = {
0xCF5A, 0, 0x4B24, 0, 0x474B, 0xCF5B, 0, 0xCF5C,
0, 0, 0x4557, 0, 0, 0, 0, 0x395C,
};
+static const unsigned short utf8_to_euc_E7A0_x0213[] = {
+ 0, 0, 0x3A3D, 0, 0, 0xF23E, 0xF23F, 0,
+ 0, 0xF240, 0, 0, 0x6266, 0xF241, 0xCF52, 0,
+ 0, 0xCF53, 0x6267, 0, 0x3826, 0x3A55, 0, 0,
+ 0, 0xF242, 0, 0, 0, 0xCF54, 0, 0,
+ 0x6269, 0xF243, 0xCF56, 0xCF57, 0, 0x4556, 0x3A56, 0x354E,
+ 0, 0, 0, 0, 0xF244, 0x787D, 0xCF59, 0,
+ 0xCF5A, 0, 0x4B24, 0, 0x474B, 0xCF5B, 0, 0xCF5C,
+ 0, 0, 0x4557, 0, 0, 0, 0, 0x395C,
+};
static const unsigned short utf8_to_euc_E7A1[] = {
0, 0, 0, 0xCF5D, 0xCF5E, 0x626B, 0, 0xCF5F,
0xCF60, 0, 0, 0, 0xCF61, 0, 0xCF62, 0,
@@ -4699,6 +8758,16 @@ static const unsigned short utf8_to_euc_E7A1[] = {
0, 0, 0x4823, 0, 0x626D, 0, 0, 0,
0, 0, 0xCF6D, 0, 0x626F, 0, 0xCF6E, 0,
};
+static const unsigned short utf8_to_euc_E7A1_x0213[] = {
+ 0, 0, 0, 0x7921, 0xCF5E, 0x626B, 0, 0xF245,
+ 0xCF60, 0, 0, 0, 0xCF61, 0, 0x7922, 0x7923,
+ 0, 0x7924, 0xCF63, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0xCF64, 0x3E4B, 0xCF65, 0,
+ 0xCF66, 0xCF67, 0, 0xCF68, 0xF246, 0, 0, 0,
+ 0x7925, 0, 0xF247, 0x4E32, 0x3945, 0, 0x7926, 0x3827,
+ 0, 0, 0x4823, 0, 0x626D, 0, 0, 0,
+ 0, 0, 0xCF6D, 0, 0x626F, 0, 0xCF6E, 0,
+};
static const unsigned short utf8_to_euc_E7A2[] = {
0, 0x386B, 0, 0, 0, 0, 0x626E, 0x4476,
0, 0, 0xCF6F, 0, 0x6271, 0x3337, 0x626C, 0xCF70,
@@ -4709,6 +8778,16 @@ static const unsigned short utf8_to_euc_E7A2[] = {
0xCF7B, 0xCF7C, 0xCF7D, 0xCF7E, 0, 0x6273, 0, 0,
0, 0, 0x334E, 0xD021, 0x627B, 0xD022, 0x627A, 0xD023,
};
+static const unsigned short utf8_to_euc_E7A2_x0213[] = {
+ 0, 0x386B, 0, 0, 0, 0, 0x626E, 0x4476,
+ 0, 0, 0xF249, 0, 0x6271, 0x3337, 0x626C, 0xCF70,
+ 0, 0x486A, 0, 0x3130, 0xF24A, 0x3A6C, 0, 0x4F52,
+ 0xCF72, 0, 0x6270, 0, 0, 0xF24C, 0xF24D, 0xF24E,
+ 0, 0xCF73, 0, 0x6272, 0xF24B, 0, 0, 0x4A4B,
+ 0xCF78, 0x4059, 0x6274, 0, 0xCF79, 0x792A, 0, 0x6275,
+ 0x7928, 0xCF7C, 0xCF7D, 0xCF7E, 0, 0x6273, 0, 0,
+ 0, 0, 0x334E, 0xF24F, 0x627B, 0xD022, 0x627A, 0xD023,
+};
static const unsigned short utf8_to_euc_E7A3[] = {
0, 0x3C27, 0, 0, 0, 0x627C, 0x6277, 0xD024,
0xD025, 0xD026, 0x627D, 0x6278, 0xD027, 0, 0xD028, 0,
@@ -4719,6 +8798,16 @@ static const unsigned short utf8_to_euc_E7A3[] = {
0, 0, 0xD034, 0xD035, 0x6324, 0, 0xD037, 0xD038,
0, 0, 0xD039, 0xD03A, 0, 0x6323, 0, 0xD03B,
};
+static const unsigned short utf8_to_euc_E7A3_x0213[] = {
+ 0, 0x3C27, 0, 0, 0, 0x627C, 0x6277, 0xD024,
+ 0xF250, 0xD026, 0x627D, 0x6278, 0xF251, 0, 0xF252, 0,
+ 0x4858, 0x6276, 0xD029, 0xD02A, 0x6279, 0xF253, 0xD02C, 0,
+ 0, 0, 0x6322, 0xD02E, 0, 0, 0, 0xD02F,
+ 0xF254, 0xF255, 0, 0, 0x792B, 0, 0xF256, 0x6321,
+ 0x4B61, 0, 0xD033, 0, 0x627E, 0, 0, 0x306B,
+ 0, 0, 0x792C, 0xD035, 0x6324, 0, 0xD037, 0x792E,
+ 0, 0xF257, 0xF258, 0xF259, 0, 0x6323, 0xF25A, 0xD03B,
+};
static const unsigned short utf8_to_euc_E7A4[] = {
0xD036, 0x3E4C, 0, 0, 0, 0, 0xD03C, 0x6325,
0, 0, 0, 0, 0xD03D, 0, 0x4143, 0,
@@ -4729,6 +8818,16 @@ static const unsigned short utf8_to_euc_E7A4[] = {
0xF454, 0xD048, 0, 0, 0xD049, 0xD04A, 0, 0,
0, 0, 0x3C28, 0xD04B, 0x4E69, 0xD04C, 0x3C52, 0xD04D,
};
+static const unsigned short utf8_to_euc_E7A4_x0213[] = {
+ 0x792D, 0x3E4C, 0, 0, 0, 0, 0xD03C, 0x6325,
+ 0, 0, 0, 0, 0xD03D, 0, 0x4143, 0,
+ 0xF25C, 0x6327, 0x6326, 0, 0, 0, 0, 0,
+ 0, 0x6328, 0xD03F, 0xF25D, 0x792F, 0, 0xD041, 0xD042,
+ 0xD043, 0, 0, 0, 0, 0xF25F, 0x6268, 0xD045,
+ 0, 0xD046, 0x626A, 0x632A, 0x6329, 0xD047, 0x7930, 0,
+ 0xF25E, 0x7931, 0, 0, 0x7932, 0xD04A, 0, 0,
+ 0, 0, 0x3C28, 0xF260, 0x4E69, 0xD04C, 0x3C52, 0xD04D,
+};
static const unsigned short utf8_to_euc_E7A5[] = {
0x632B, 0x3737, 0, 0, 0xD04E, 0xD04F, 0xD050, 0x3540,
0x3527, 0x3B63, 0xD051, 0xD052, 0, 0, 0, 0xD053,
@@ -4739,6 +8838,16 @@ static const unsigned short utf8_to_euc_E7A5[] = {
0, 0, 0xD05C, 0, 0, 0, 0, 0x4578,
0, 0xD05D, 0x6332, 0xD05E, 0xD05F, 0, 0xD060, 0x6333,
};
+static const unsigned short utf8_to_euc_E7A5_x0213[] = {
+ 0x632B, 0x3737, 0, 0, 0xD04E, 0x7935, 0x7936, 0x3540,
+ 0x3527, 0x3B63, 0xF261, 0xD052, 0, 0, 0, 0xD053,
+ 0x4D34, 0xD054, 0, 0x6331, 0xD055, 0x6330, 0x4144, 0x632D,
+ 0xF262, 0, 0x632F, 0xF263, 0x793A, 0x3D4B, 0x3F40, 0x632E,
+ 0x632C, 0, 0x472A, 0, 0, 0x3E4D, 0, 0xF265,
+ 0x493C, 0xD05A, 0, 0xD05B, 0, 0x3A57, 0, 0,
+ 0, 0, 0xF266, 0, 0, 0, 0, 0x4578,
+ 0, 0x793E, 0x6332, 0xD05E, 0xD05F, 0, 0xD060, 0x6333,
+};
static const unsigned short utf8_to_euc_E7A6[] = {
0x6349, 0x3658, 0, 0, 0x4F3D, 0x4135, 0, 0,
0, 0, 0x6334, 0xD061, 0xD062, 0x3252, 0x4477, 0x4A21,
@@ -4749,6 +8858,16 @@ static const unsigned short utf8_to_euc_E7A6[] = {
0x4729, 0xD070, 0, 0x633A, 0xD071, 0, 0, 0,
0xD072, 0x633B, 0x633C, 0xD073, 0, 0x3659, 0x3253, 0x4645,
};
+static const unsigned short utf8_to_euc_E7A6_x0213[] = {
+ 0x6349, 0x3658, 0, 0, 0x4F3D, 0x4135, 0, 0,
+ 0, 0, 0x6334, 0xD061, 0xD062, 0x3252, 0x4477, 0x4A21,
+ 0, 0xD063, 0, 0xD064, 0xF267, 0xF268, 0xF269, 0,
+ 0x7942, 0, 0, 0xF26A, 0xD06A, 0x6335, 0, 0,
+ 0, 0xF26B, 0, 0, 0, 0, 0x357A, 0x6336,
+ 0xD06C, 0xF26C, 0x6338, 0xD06E, 0, 0, 0x6339, 0xD06F,
+ 0x4729, 0x7943, 0, 0x633A, 0xF26D, 0, 0, 0,
+ 0x7944, 0x633B, 0x633C, 0xF26E, 0, 0x3659, 0x3253, 0x4645,
+};
static const unsigned short utf8_to_euc_E7A7[] = {
0x3D28, 0x3B64, 0xD074, 0, 0xD075, 0, 0, 0xD076,
0xD077, 0x633D, 0xD078, 0x3D29, 0, 0, 0, 0xD079,
@@ -4759,6 +8878,16 @@ static const unsigned short utf8_to_euc_E7A7[] = {
0x3E4E, 0xD127, 0, 0, 0, 0, 0, 0,
0xD128, 0, 0, 0x305C, 0xD129, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E7A7_x0213[] = {
+ 0x3D28, 0x3B64, 0xF26F, 0, 0xD075, 0, 0, 0xF270,
+ 0x7945, 0x633D, 0x7946, 0x3D29, 0xF271, 0xF272, 0, 0xD079,
+ 0, 0x324A, 0x4943, 0, 0x7948, 0x633E, 0xF273, 0,
+ 0x486B, 0, 0xD07C, 0, 0, 0xD07D, 0x7949, 0x4145,
+ 0xD121, 0x6341, 0xD122, 0x6342, 0x4769, 0xD123, 0x3F41, 0x633F,
+ 0, 0x4361, 0xD124, 0x794A, 0x6340, 0x794B, 0, 0,
+ 0x3E4E, 0xD127, 0, 0, 0, 0, 0, 0,
+ 0xD128, 0, 0, 0x305C, 0xD129, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E7A8[] = {
0x3529, 0, 0xD12A, 0xD12B, 0, 0, 0, 0xD12C,
0x6343, 0xD12D, 0xD12E, 0x4478, 0xD12F, 0x6344, 0x4047, 0,
@@ -4769,6 +8898,16 @@ static const unsigned short utf8_to_euc_E7A8[] = {
0xD139, 0x634A, 0x3070, 0, 0xD13A, 0xD13B, 0, 0x634D,
0xD13C, 0xD13D, 0xD13E, 0x634B, 0x3254, 0x374E, 0x634C, 0x3946,
};
+static const unsigned short utf8_to_euc_E7A8_x0213[] = {
+ 0x3529, 0, 0xD12A, 0x794C, 0, 0, 0, 0xD12C,
+ 0x6343, 0xD12D, 0xF278, 0x4478, 0xD12F, 0x6344, 0x4047, 0,
+ 0, 0xF279, 0, 0, 0x4C2D, 0xF27A, 0, 0x4923,
+ 0x6345, 0x6346, 0x4355, 0xF27B, 0x4E47, 0, 0xF27C, 0x6348,
+ 0x6347, 0xD134, 0, 0, 0, 0, 0, 0xD135,
+ 0, 0, 0, 0xD136, 0, 0xF27E, 0x3C6F, 0xD138,
+ 0xD139, 0x634A, 0x3070, 0, 0xD13A, 0xD13B, 0, 0x634D,
+ 0xF321, 0x794E, 0xD13E, 0x634B, 0x3254, 0x374E, 0x634C, 0x3946,
+};
static const unsigned short utf8_to_euc_E7A9[] = {
0x3972, 0, 0x4A66, 0x634E, 0xD13F, 0xD140, 0x4B54, 0xD141,
0xD142, 0x6350, 0, 0, 0xD143, 0x4051, 0x314F, 0x323A,
@@ -4779,6 +8918,16 @@ static const unsigned short utf8_to_euc_E7A9[] = {
0x6355, 0, 0, 0, 0x376A, 0xD14F, 0x3566, 0,
0xD150, 0x6356, 0x3675, 0, 0, 0x6357, 0xD151, 0x407C,
};
+static const unsigned short utf8_to_euc_E7A9_x0213[] = {
+ 0x3972, 0, 0x4A66, 0x634E, 0xD13F, 0xD140, 0x4B54, 0xF322,
+ 0xD142, 0x6350, 0, 0, 0xF323, 0x4051, 0x314F, 0x323A,
+ 0x302C, 0, 0, 0, 0, 0xD144, 0xF324, 0x634F,
+ 0, 0xF325, 0, 0, 0xF326, 0x794F, 0, 0xF327,
+ 0xF328, 0x6351, 0x6352, 0x3E77, 0, 0xD14B, 0, 0xF329,
+ 0, 0x6353, 0xF32A, 0x334F, 0, 0x7950, 0, 0,
+ 0x6355, 0, 0, 0, 0x376A, 0xF32B, 0x3566, 0,
+ 0xF32C, 0x6356, 0x3675, 0, 0, 0x6357, 0xD151, 0x407C,
+};
static const unsigned short utf8_to_euc_E7AA[] = {
0xD152, 0x464D, 0xD153, 0x4060, 0x3A75, 0xD154, 0xD155, 0,
0x6358, 0, 0xD156, 0xD157, 0, 0, 0, 0,
@@ -4789,6 +8938,16 @@ static const unsigned short utf8_to_euc_E7AA[] = {
0x635F, 0, 0, 0xD15F, 0, 0xD160, 0x6360, 0,
0, 0xD161, 0x312E, 0xD162, 0xD163, 0, 0, 0x6363,
};
+static const unsigned short utf8_to_euc_E7AA_x0213[] = {
+ 0xD152, 0x464D, 0xF32D, 0x4060, 0x3A75, 0x7952, 0xD155, 0,
+ 0x6358, 0, 0xF32E, 0xD157, 0, 0, 0, 0,
+ 0xF32F, 0xD159, 0x4362, 0x416B, 0xD15A, 0x635A, 0x635C, 0x6359,
+ 0x635B, 0, 0, 0, 0, 0, 0xD15B, 0x3722,
+ 0x7953, 0, 0, 0xF330, 0, 0, 0, 0,
+ 0, 0x635D, 0x3726, 0, 0xF331, 0, 0x3567, 0x4D52,
+ 0x635F, 0, 0, 0x7955, 0, 0xD160, 0x6360, 0,
+ 0, 0xF334, 0x312E, 0x7956, 0xF335, 0, 0xF336, 0x6363,
+};
static const unsigned short utf8_to_euc_E7AB[] = {
0, 0, 0, 0x3376, 0x6362, 0x6361, 0xD164, 0x6365,
0x635E, 0xD165, 0x6366, 0x4E29, 0xD166, 0x6367, 0xD167, 0x6368,
@@ -4799,6 +8958,16 @@ static const unsigned short utf8_to_euc_E7AB[] = {
0x6372, 0xD16E, 0, 0, 0xD16F, 0, 0x3625, 0,
0x513F, 0x435D, 0x3C33, 0xD170, 0, 0xD171, 0xD172, 0x3448,
};
+static const unsigned short utf8_to_euc_E7AB_x0213[] = {
+ 0, 0, 0, 0x3376, 0x6362, 0x6361, 0xD164, 0x6365,
+ 0x635E, 0xD165, 0x6366, 0x4E29, 0xF338, 0x6367, 0x7957, 0x6368,
+ 0, 0xF339, 0x5474, 0x636A, 0, 0x6369, 0, 0,
+ 0, 0x636B, 0x636C, 0xD169, 0x4E35, 0x636D, 0, 0x706F,
+ 0x3E4F, 0x636E, 0x636F, 0x3D57, 0, 0x4638, 0x6370, 0xF33A,
+ 0xF33B, 0xD16B, 0x4328, 0x7958, 0xD16D, 0x6371, 0, 0x433C,
+ 0x6372, 0xD16E, 0, 0, 0xF33C, 0, 0x3625, 0,
+ 0x513F, 0x435D, 0x3C33, 0xD170, 0, 0x7959, 0xD172, 0x3448,
+};
static const unsigned short utf8_to_euc_E7AC[] = {
0, 0, 0x6373, 0, 0x6422, 0, 0x6376, 0xD173,
0x3568, 0, 0x6375, 0x6424, 0, 0, 0, 0x6374,
@@ -4809,6 +8978,16 @@ static const unsigned short utf8_to_euc_E7AC[] = {
0xD17E, 0xD221, 0, 0x6377, 0xD222, 0x637B, 0x637D, 0,
0, 0x3A7B, 0, 0, 0, 0xD223, 0, 0xD224,
};
+static const unsigned short utf8_to_euc_E7AC_x0213[] = {
+ 0, 0, 0x6373, 0, 0x6422, 0, 0x6376, 0xF33F,
+ 0x3568, 0, 0x6375, 0x6424, 0, 0, 0, 0x6374,
+ 0, 0x3E50, 0x795A, 0, 0xD174, 0, 0, 0,
+ 0x6378, 0x6379, 0, 0x452B, 0, 0, 0x637A, 0xD175,
+ 0x335E, 0, 0, 0xD176, 0, 0x3F5A, 0x4964, 0xF342,
+ 0x637C, 0xD178, 0xF343, 0xD17A, 0x4268, 0x795B, 0xF344, 0xF345,
+ 0xD17E, 0xF346, 0, 0x6377, 0xD222, 0x637B, 0x637D, 0,
+ 0, 0x3A7B, 0, 0x795C, 0, 0xF341, 0, 0xD224,
+};
static const unsigned short utf8_to_euc_E7AD[] = {
0xD225, 0xD226, 0, 0, 0, 0x6426, 0x492E, 0xD227,
0x4826, 0x4579, 0, 0x365A, 0x6425, 0x6423, 0xD228, 0x4835,
@@ -4819,6 +8998,16 @@ static const unsigned short utf8_to_euc_E7AD[] = {
0x642B, 0x642C, 0xD231, 0xD232, 0x6429, 0x6427, 0, 0xD233,
0, 0, 0x6421, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E7AD_x0213[] = {
+ 0xD225, 0xF34A, 0, 0, 0, 0x6426, 0x492E, 0x795D,
+ 0x4826, 0x4579, 0, 0x365A, 0x6425, 0x6423, 0x795E, 0x4835,
+ 0x637E, 0x435E, 0x457B, 0, 0x457A, 0xF34C, 0x3A76, 0,
+ 0, 0, 0, 0, 0, 0x6438, 0, 0,
+ 0x795F, 0, 0, 0, 0xF34E, 0x6428, 0xF34F, 0x642A,
+ 0, 0xF350, 0xD22E, 0, 0x642D, 0x7960, 0x642E, 0x7961,
+ 0x642B, 0x642C, 0x7962, 0xF351, 0x6429, 0x6427, 0, 0xD233,
+ 0, 0xF34D, 0x6421, 0, 0, 0, 0, 0xF349,
+};
static const unsigned short utf8_to_euc_E7AE[] = {
0, 0, 0, 0, 0xD234, 0, 0x4A4F, 0x3255,
0, 0xD235, 0, 0x6435, 0, 0x6432, 0xD236, 0x6437,
@@ -4829,6 +9018,16 @@ static const unsigned short utf8_to_euc_E7AE[] = {
0xD240, 0x4822, 0xD241, 0, 0x643E, 0xD242, 0xD243, 0,
0x4824, 0, 0xD244, 0xD245, 0xD246, 0xD247, 0, 0,
};
+static const unsigned short utf8_to_euc_E7AE_x0213[] = {
+ 0, 0, 0, 0, 0xD234, 0, 0x4A4F, 0x3255,
+ 0, 0xD235, 0, 0x6435, 0, 0x6432, 0xD236, 0x6437,
+ 0xF354, 0xF355, 0x6436, 0, 0x4773, 0x4C27, 0xD239, 0x3B3B,
+ 0x6430, 0x6439, 0x6434, 0xF356, 0x6433, 0x642F, 0x7963, 0x6431,
+ 0xD23C, 0x3449, 0, 0, 0, 0xD23D, 0, 0,
+ 0, 0, 0x433D, 0, 0xD23E, 0x407D, 0, 0xF358,
+ 0xD240, 0x4822, 0xD241, 0, 0x643E, 0xF359, 0xD243, 0,
+ 0x4824, 0, 0xD244, 0xD245, 0xF35A, 0xD247, 0, 0,
+};
static const unsigned short utf8_to_euc_E7AF[] = {
0x4061, 0x643B, 0xD248, 0, 0x484F, 0xD249, 0x643F, 0x4A53,
0xD24A, 0x435B, 0xD24B, 0x643A, 0x643C, 0, 0, 0x643D,
@@ -4839,6 +9038,16 @@ static const unsigned short utf8_to_euc_E7AF[] = {
0, 0, 0xD254, 0x644A, 0xD255, 0xD256, 0x644E, 0x644B,
0xD257, 0xD258, 0xD259, 0, 0xD25A, 0, 0xD25B, 0,
};
+static const unsigned short utf8_to_euc_E7AF_x0213[] = {
+ 0x4061, 0x643B, 0xD248, 0, 0x484F, 0xF35B, 0x643F, 0x4A53,
+ 0xD24A, 0x435B, 0xF35C, 0x643A, 0x643C, 0, 0, 0x643D,
+ 0, 0, 0, 0, 0xF35F, 0, 0xF360, 0x7965,
+ 0, 0x7966, 0xF361, 0xD251, 0, 0x6440, 0, 0,
+ 0x3C44, 0, 0, 0, 0x4646, 0x6445, 0x6444, 0,
+ 0xD252, 0x6441, 0xF362, 0, 0, 0x4F36, 0, 0,
+ 0xF363, 0, 0xD254, 0x644A, 0xD255, 0xD256, 0x644E, 0x644B,
+ 0xD257, 0xD258, 0xD259, 0, 0xD25A, 0, 0xD25B, 0,
+};
static const unsigned short utf8_to_euc_E7B0[] = {
0x6447, 0xD25C, 0xD25D, 0xD25E, 0xD25F, 0, 0xD260, 0x6448,
0, 0xD261, 0, 0xD262, 0xD263, 0x644D, 0xD264, 0xD265,
@@ -4849,6 +9058,16 @@ static const unsigned short utf8_to_euc_E7B0[] = {
0, 0xD26D, 0, 0xD26E, 0xD26F, 0, 0xD270, 0x6453,
0x4876, 0xD271, 0xD272, 0, 0, 0x6455, 0x4E7C, 0x4A6D,
};
+static const unsigned short utf8_to_euc_E7B0_x0213[] = {
+ 0x6447, 0x7967, 0xD25D, 0xF364, 0xD25F, 0, 0xD260, 0x6448,
+ 0, 0xD261, 0, 0xF365, 0xD263, 0x644D, 0xF366, 0xF367,
+ 0, 0x6442, 0x5255, 0x6449, 0x6443, 0, 0, 0x644C,
+ 0, 0xD266, 0, 0xD267, 0, 0, 0x7969, 0x6452,
+ 0x796A, 0x344A, 0, 0x644F, 0, 0xD269, 0xF368, 0x6450,
+ 0xD26B, 0, 0x6451, 0x6454, 0xD26C, 0, 0, 0,
+ 0, 0x7968, 0, 0x796B, 0xD26F, 0, 0x796C, 0x6453,
+ 0x4876, 0xD271, 0xD272, 0, 0, 0x6455, 0x4E7C, 0x4A6D,
+};
static const unsigned short utf8_to_euc_E7B1[] = {
0x645A, 0, 0, 0x6457, 0, 0, 0xD273, 0,
0, 0, 0xD274, 0, 0x6456, 0x4052, 0, 0x6459,
@@ -4859,6 +9078,16 @@ static const unsigned short utf8_to_euc_E7B1[] = {
0xD327, 0, 0xD328, 0x4A46, 0, 0x6462, 0, 0,
0, 0xD329, 0, 0, 0xD32A, 0xD32B, 0x4C62, 0,
};
+static const unsigned short utf8_to_euc_E7B1_x0213[] = {
+ 0x645A, 0, 0, 0x6457, 0, 0xF369, 0xD273, 0,
+ 0, 0, 0xF36A, 0, 0x6456, 0x4052, 0, 0x6459,
+ 0x645B, 0xF36B, 0xD277, 0xD278, 0x6458, 0xD275, 0x645F, 0xF36C,
+ 0x645C, 0x796F, 0xD27A, 0xD27B, 0xD27C, 0xD27D, 0xF36D, 0x645D,
+ 0x6446, 0xF36E, 0, 0xD322, 0x645E, 0x6460, 0, 0xD323,
+ 0, 0xF36F, 0, 0, 0x6461, 0x7970, 0xF370, 0xF371,
+ 0xF372, 0, 0xD328, 0x4A46, 0, 0x6462, 0, 0,
+ 0, 0x7971, 0, 0, 0xD32A, 0xD32B, 0x4C62, 0,
+};
static const unsigned short utf8_to_euc_E7B2[] = {
0, 0x364E, 0x3729, 0x6463, 0, 0, 0xD32C, 0xD32D,
0, 0x4A34, 0, 0x3F68, 0, 0x4C30, 0, 0xD32E,
@@ -4869,6 +9098,16 @@ static const unsigned short utf8_to_euc_E7B2[] = {
0xD333, 0x646D, 0x646C, 0x646B, 0, 0, 0xD334, 0xD335,
0, 0x646F, 0xD336, 0xD337, 0xD338, 0x6470, 0x403A, 0xD339,
};
+static const unsigned short utf8_to_euc_E7B2_x0213[] = {
+ 0, 0x364E, 0x3729, 0x6463, 0, 0, 0xD32C, 0xD32D,
+ 0, 0x4A34, 0, 0x3F68, 0, 0x4C30, 0, 0x7972,
+ 0x6464, 0, 0x4E33, 0, 0x7973, 0x4774, 0, 0x4146,
+ 0x4734, 0, 0, 0x3D4D, 0, 0, 0xD330, 0x3040,
+ 0x7974, 0x6469, 0x6467, 0, 0x6465, 0x3421, 0xF376, 0x3E51,
+ 0x646A, 0, 0, 0x6468, 0, 0x6466, 0x646E, 0,
+ 0xD333, 0x646D, 0x646C, 0x646B, 0, 0, 0xF378, 0xF379,
+ 0, 0x646F, 0xD336, 0xD337, 0x7975, 0x6470, 0x403A, 0xF37A,
+};
static const unsigned short utf8_to_euc_E7B3[] = {
0x6471, 0, 0x6473, 0, 0xD33A, 0x6472, 0, 0xD33B,
0xD33C, 0xD33D, 0x3852, 0, 0, 0xD33E, 0x4138, 0xD33F,
@@ -4879,6 +9118,16 @@ static const unsigned short utf8_to_euc_E7B3[] = {
0, 0, 0x647A, 0, 0x647B, 0xD34A, 0x647C, 0,
0x3B65, 0, 0x647D, 0x374F, 0, 0, 0x356A, 0,
};
+static const unsigned short utf8_to_euc_E7B3_x0213[] = {
+ 0x6471, 0, 0x6473, 0, 0xF37C, 0x6472, 0, 0xD33B,
+ 0xF37E, 0xD33D, 0x3852, 0, 0, 0xF421, 0x4138, 0xD33F,
+ 0, 0, 0x6475, 0xD340, 0xD341, 0x7976, 0x457C, 0xF423,
+ 0x6474, 0x7977, 0xD345, 0, 0x6476, 0x7978, 0x4A35, 0x416C,
+ 0x3947, 0, 0x6477, 0, 0, 0, 0xF425, 0x4E48,
+ 0, 0xD348, 0, 0xF426, 0, 0, 0, 0x6479,
+ 0, 0, 0x647A, 0, 0x647B, 0xF428, 0x647C, 0,
+ 0x3B65, 0, 0x647D, 0x374F, 0, 0, 0x356A, 0,
+};
static const unsigned short utf8_to_euc_E7B4[] = {
0x352A, 0, 0x6521, 0xD34B, 0x4C73, 0x3948, 0x647E, 0xD34C,
0xD34D, 0xD34E, 0x6524, 0x4C66, 0, 0x473C, 0, 0xD34F,
@@ -4889,6 +9138,16 @@ static const unsigned short utf8_to_euc_E7B4[] = {
0x3A59, 0xD35A, 0x6528, 0x3F42, 0, 0x652A, 0, 0,
0, 0x3E52, 0x3A30, 0, 0xD35B, 0xD35C, 0xD35D, 0x6529,
};
+static const unsigned short utf8_to_euc_E7B4_x0213[] = {
+ 0x352A, 0, 0x6521, 0xF429, 0x4C73, 0x3948, 0x647E, 0x7979,
+ 0x797A, 0xF42A, 0x6524, 0x4C66, 0, 0x473C, 0, 0xD34F,
+ 0x4933, 0xD350, 0xF42C, 0x797B, 0x3D63, 0x6523, 0xD353, 0x3C53,
+ 0x3949, 0x3B66, 0x3569, 0x4A36, 0x6522, 0x797C, 0xF42D, 0,
+ 0x4147, 0x4B42, 0x3A77, 0x797D, 0, 0, 0xD357, 0,
+ 0, 0, 0xD358, 0x3B67, 0x445D, 0xD359, 0x6527, 0x4E5F,
+ 0x3A59, 0x797E, 0x6528, 0x3F42, 0, 0x652A, 0, 0,
+ 0, 0x3E52, 0x3A30, 0, 0xD35B, 0xF430, 0xF431, 0x6529,
+};
static const unsigned short utf8_to_euc_E7B5[] = {
0xD35E, 0xD35F, 0x3D2A, 0x383E, 0x4148, 0x6525, 0x652B, 0xD360,
0xD361, 0, 0, 0x6526, 0x3750, 0xD362, 0x652E, 0x6532,
@@ -4899,6 +9158,16 @@ static const unsigned short utf8_to_euc_E7B5[] = {
0xD36D, 0x457D, 0x652F, 0x652C, 0, 0x3328, 0x4064, 0,
0xD36E, 0x3828, 0xD36F, 0xD370, 0, 0x6538, 0, 0xD371,
};
+static const unsigned short utf8_to_euc_E7B5_x0213[] = {
+ 0xF432, 0x7A21, 0x3D2A, 0x383E, 0x4148, 0x6525, 0x652B, 0xF433,
+ 0x7A22, 0, 0, 0x6526, 0x3750, 0xD362, 0x652E, 0x6532,
+ 0x376B, 0xD363, 0, 0x7A23, 0, 0, 0x652D, 0xD365,
+ 0, 0xF437, 0xF438, 0x6536, 0x7A24, 0xD369, 0x394A, 0,
+ 0, 0x4D6D, 0x303C, 0x6533, 0, 0xD36A, 0x356B, 0xD36B,
+ 0x6530, 0, 0xF439, 0, 0, 0, 0x6531, 0,
+ 0xF43A, 0x457D, 0x652F, 0x652C, 0, 0x3328, 0x4064, 0,
+ 0xD36E, 0x3828, 0x7A25, 0xD370, 0, 0x6538, 0, 0xF43C,
+};
static const unsigned short utf8_to_euc_E7B6[] = {
0, 0xD372, 0xD373, 0xD374, 0, 0xD375, 0xD376, 0,
0xD377, 0x6535, 0, 0xD378, 0xD379, 0xD37A, 0, 0x6537,
@@ -4909,6 +9178,16 @@ static const unsigned short utf8_to_euc_E7B6[] = {
0x6547, 0x394B, 0x4C56, 0xD425, 0x4456, 0x653D, 0xD426, 0xD427,
0x6545, 0xD428, 0x653A, 0x433E, 0, 0x653F, 0x303D, 0x4C4A,
};
+static const unsigned short utf8_to_euc_E7B6_x0213[] = {
+ 0, 0xD372, 0xD373, 0x7A26, 0, 0xD375, 0xF43E, 0,
+ 0xF43F, 0x6535, 0, 0x7A27, 0xF440, 0xD37A, 0, 0x6537,
+ 0, 0xD37B, 0, 0x6534, 0, 0, 0xD37C, 0xF441,
+ 0, 0x3751, 0x4233, 0x6539, 0x416E, 0xF443, 0xD421, 0x6546,
+ 0x7A28, 0, 0x6542, 0x653C, 0, 0, 0x7A29, 0xF444,
+ 0, 0, 0xF445, 0x6540, 0x3C7A, 0x305D, 0x653B, 0x6543,
+ 0x6547, 0x394B, 0x4C56, 0xD425, 0x4456, 0x653D, 0xF446, 0xF447,
+ 0x6545, 0xD428, 0x653A, 0x433E, 0, 0x653F, 0x303D, 0x4C4A,
+};
static const unsigned short utf8_to_euc_E7B7[] = {
0, 0, 0xD429, 0xD42A, 0xD42B, 0xD42C, 0xD42D, 0x653E,
0, 0, 0x365B, 0x486C, 0xD42E, 0xD42F, 0xD430, 0x416D,
@@ -4919,6 +9198,16 @@ static const unsigned short utf8_to_euc_E7B7[] = {
0, 0xD43A, 0x654D, 0, 0x4E7D, 0xD43B, 0xD43C, 0,
0, 0xD43D, 0xD43E, 0x654C, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E7B7_x0213[] = {
+ 0xF448, 0, 0x7A2A, 0xD42A, 0xD42B, 0xD42C, 0xD42D, 0x653E,
+ 0, 0, 0x365B, 0x486C, 0x7A2B, 0xD42F, 0xD430, 0x416D,
+ 0, 0x4E50, 0x3D6F, 0, 0, 0x656E, 0x7A2C, 0xF449,
+ 0x6548, 0xF44A, 0x407E, 0, 0x6544, 0x6549, 0x654B, 0,
+ 0x4479, 0x654E, 0xD434, 0x7A2D, 0x654A, 0xD435, 0xF44B, 0,
+ 0x4A54, 0x344B, 0xD437, 0xD438, 0x4C4B, 0xD439, 0, 0x305E,
+ 0, 0xF44C, 0x654D, 0, 0x4E7D, 0xD43B, 0xD43C, 0,
+ 0, 0xF44D, 0xD43E, 0x654C, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E7B8[] = {
0xD433, 0x316F, 0, 0, 0x466C, 0x654F, 0, 0,
0xD43F, 0x6556, 0x6550, 0x6557, 0, 0, 0, 0,
@@ -4929,6 +9218,16 @@ static const unsigned short utf8_to_euc_E7B8[] = {
0, 0x6554, 0x6560, 0xD44C, 0, 0x655C, 0xD44D, 0x655F,
0, 0x655D, 0x6561, 0x655B, 0, 0x6541, 0x4053, 0xD44E,
};
+static const unsigned short utf8_to_euc_E7B8_x0213[] = {
+ 0xD433, 0x316F, 0, 0, 0x466C, 0x654F, 0, 0,
+ 0x7A30, 0x6556, 0x6550, 0x6557, 0, 0, 0, 0,
+ 0xF451, 0x7A31, 0x6553, 0, 0, 0x7A32, 0, 0xF452,
+ 0, 0, 0, 0x477B, 0xD444, 0xF453, 0x3C4A, 0x6555,
+ 0xF454, 0x6552, 0x6558, 0x6551, 0, 0, 0x3D44, 0xF455,
+ 0x7A2F, 0, 0, 0x4B25, 0xF456, 0xD44A, 0x3D4C, 0xD44B,
+ 0, 0x6554, 0x6560, 0xD44C, 0, 0x655C, 0xD44D, 0x655F,
+ 0, 0x655D, 0x6561, 0x655B, 0, 0x6541, 0x4053, 0xD44E,
+};
static const unsigned short utf8_to_euc_E7B9[] = {
0, 0x484B, 0, 0x655E, 0xD44F, 0xD450, 0x6559, 0xD451,
0, 0, 0x4121, 0x3752, 0, 0x3D2B, 0xD452, 0,
@@ -4939,6 +9238,16 @@ static const unsigned short utf8_to_euc_E7B9[] = {
0x372B, 0, 0, 0xD45D, 0, 0, 0, 0,
0xD45E, 0x6568, 0, 0x656C, 0x656B, 0x656F, 0xD45F, 0x6571,
};
+static const unsigned short utf8_to_euc_E7B9_x0213[] = {
+ 0, 0x484B, 0, 0x655E, 0xD44F, 0xF457, 0x6559, 0x7A34,
+ 0, 0, 0x4121, 0x3752, 0, 0x3D2B, 0xD452, 0,
+ 0xD453, 0, 0x7A35, 0, 0x3F25, 0x4136, 0x6564, 0,
+ 0xD455, 0x6566, 0x6567, 0, 0, 0x6563, 0x6565, 0xD456,
+ 0, 0x7A36, 0xD458, 0, 0, 0xD459, 0x655A, 0x6562,
+ 0, 0x656A, 0x6569, 0x7E7E, 0, 0x4B7A, 0xD45B, 0xD45C,
+ 0x372B, 0, 0, 0xF458, 0, 0xF459, 0, 0,
+ 0xD45E, 0x6568, 0, 0x656C, 0x656B, 0x656F, 0xF45A, 0x6571,
+};
static const unsigned short utf8_to_euc_E7BA[] = {
0, 0xD460, 0x3B3C, 0x656D, 0, 0, 0xD461, 0xD462,
0x6572, 0x6573, 0xD463, 0, 0x6574, 0xD464, 0x657A, 0x453B,
@@ -4949,6 +9258,16 @@ static const unsigned short utf8_to_euc_E7BA[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E7BA_x0213[] = {
+ 0, 0xD460, 0x3B3C, 0x656D, 0, 0, 0xF45B, 0xF45C,
+ 0x6572, 0x6573, 0x7A37, 0, 0x6574, 0x7A38, 0x657A, 0x453B,
+ 0x6576, 0xF45E, 0x6575, 0x6577, 0x6578, 0xD466, 0x6579, 0,
+ 0xF45F, 0, 0xF460, 0x657B, 0x657C, 0xD469, 0xD46A, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E7BC[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -4959,6 +9278,16 @@ static const unsigned short utf8_to_euc_E7BC[] = {
0, 0, 0, 0, 0, 0, 0x344C, 0,
0x657D, 0, 0x657E, 0xD46C, 0xD46B, 0xD46D, 0xD46E, 0xD46F,
};
+static const unsigned short utf8_to_euc_E7BC_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0x344C, 0,
+ 0x657D, 0, 0x657E, 0xF463, 0xF462, 0xD46D, 0xF464, 0xD46F,
+};
static const unsigned short utf8_to_euc_E7BD[] = {
0, 0, 0, 0xD470, 0xD471, 0x6621, 0, 0xD472,
0, 0, 0, 0, 0x6622, 0x6623, 0x6624, 0xD473,
@@ -4969,6 +9298,16 @@ static const unsigned short utf8_to_euc_E7BD[] = {
0x4833, 0xD521, 0x3D70, 0, 0, 0x474D, 0, 0x486D,
0x662F, 0x586D, 0, 0, 0, 0xD522, 0xD523, 0xD524,
};
+static const unsigned short utf8_to_euc_E7BD_x0213[] = {
+ 0, 0, 0, 0xF465, 0xF466, 0x6621, 0, 0x7A39,
+ 0, 0, 0, 0, 0x6622, 0x6623, 0x6624, 0xF467,
+ 0x6625, 0x6626, 0xF46A, 0xD475, 0x6628, 0x6627, 0, 0,
+ 0x6629, 0, 0, 0xD476, 0xD477, 0xD478, 0, 0x662A,
+ 0x662B, 0xF46C, 0, 0xF46D, 0xF46E, 0xD47C, 0xD47D, 0x662E,
+ 0x662C, 0x662D, 0x3A61, 0x3753, 0, 0xF46F, 0x4356, 0,
+ 0x4833, 0xD521, 0x3D70, 0, 0, 0x474D, 0, 0x486D,
+ 0x662F, 0x586D, 0, 0, 0, 0xF470, 0xF471, 0xD524,
+};
static const unsigned short utf8_to_euc_E7BE[] = {
0xD525, 0, 0x6630, 0x6632, 0, 0x4D65, 0x6631, 0x6634,
0x6633, 0, 0x4D53, 0xD526, 0x6635, 0xD527, 0x487E, 0xD528,
@@ -4979,6 +9318,16 @@ static const unsigned short utf8_to_euc_E7BE[] = {
0, 0, 0x663C, 0, 0xD533, 0, 0x663F, 0,
0x6640, 0x663D, 0, 0, 0xD534, 0x3129, 0, 0xD535,
};
+static const unsigned short utf8_to_euc_E7BE_x0213[] = {
+ 0xD525, 0, 0x6630, 0x6632, 0, 0x4D65, 0x6631, 0x6634,
+ 0x6633, 0, 0x4D53, 0xD526, 0x6635, 0xD527, 0x487E, 0xD528,
+ 0xF473, 0x7A3B, 0, 0, 0x6636, 0, 0xF476, 0x7A3C,
+ 0, 0, 0x6639, 0, 0xF477, 0x6638, 0x6637, 0,
+ 0, 0xD52E, 0xD52F, 0x663A, 0x3732, 0, 0xD530, 0,
+ 0x4122, 0x3541, 0xD531, 0, 0, 0xF478, 0x663E, 0x663B,
+ 0, 0, 0x663C, 0, 0xD533, 0, 0x663F, 0,
+ 0x6640, 0x663D, 0, 0, 0xD534, 0x3129, 0, 0x7A3D,
+};
static const unsigned short utf8_to_euc_E7BF[] = {
0xD536, 0x3227, 0, 0xD537, 0, 0x6642, 0x6643, 0,
0xD538, 0, 0x6644, 0, 0x4D62, 0, 0xD539, 0xD53A,
@@ -4989,6 +9338,16 @@ static const unsigned short utf8_to_euc_E7BF[] = {
0x344D, 0, 0xD543, 0x664A, 0, 0, 0, 0,
0, 0x664B, 0xD544, 0x4B5D, 0x4D63, 0xD545, 0xD546, 0xD547,
};
+static const unsigned short utf8_to_euc_E7BF_x0213[] = {
+ 0xD536, 0x3227, 0, 0xF47A, 0, 0x6642, 0x6643, 0,
+ 0xD538, 0, 0x6644, 0, 0x4D62, 0, 0x7A3E, 0xF47B,
+ 0, 0, 0x3D2C, 0, 0x6646, 0x6645, 0, 0,
+ 0, 0, 0, 0x7A3F, 0, 0, 0, 0x7A40,
+ 0x3F69, 0x6647, 0, 0xF47C, 0, 0xF47D, 0x6648, 0,
+ 0xD53F, 0x6649, 0, 0x3465, 0x7A41, 0, 0x7A42, 0xF47E,
+ 0x344D, 0, 0xF521, 0x664A, 0, 0, 0, 0,
+ 0, 0x664B, 0x7A43, 0x4B5D, 0x4D63, 0xD545, 0xD546, 0xD547,
+};
static const unsigned short utf8_to_euc_E880[] = {
0x4D54, 0x4F37, 0, 0x394D, 0x664E, 0x3C54, 0x664D, 0xD548,
0xD549, 0, 0xD54A, 0x664F, 0x3C29, 0xD54B, 0xD54C, 0xD54D,
@@ -4999,6 +9358,16 @@ static const unsigned short utf8_to_euc_E880[] = {
0xD55A, 0, 0, 0x3C2A, 0xD55B, 0xD55C, 0x4C6D, 0xD55D,
0, 0xD55E, 0xD55F, 0x6657, 0xD560, 0x433F, 0xD561, 0x6656,
};
+static const unsigned short utf8_to_euc_E880_x0213[] = {
+ 0x4D54, 0x4F37, 0xF522, 0x394D, 0x664E, 0x3C54, 0x664D, 0xD548,
+ 0xF524, 0, 0xF523, 0x664F, 0x3C29, 0xD54B, 0xF525, 0xD54D,
+ 0x4251, 0xF526, 0x6650, 0xD54F, 0x7A45, 0x394C, 0xF527, 0x4C57,
+ 0x6651, 0x6652, 0, 0, 0x6653, 0xD552, 0xD553, 0xD554,
+ 0xD555, 0x6654, 0, 0, 0xF528, 0, 0x7A46, 0,
+ 0x6655, 0, 0, 0, 0xF529, 0, 0xD559, 0,
+ 0xF52A, 0, 0, 0x3C2A, 0xD55B, 0x7A47, 0x4C6D, 0x7A48,
+ 0, 0xD55E, 0xD55F, 0x6657, 0x7A49, 0x433F, 0xD561, 0x6656,
+};
static const unsigned short utf8_to_euc_E881[] = {
0xD562, 0, 0, 0, 0xD563, 0, 0x6659, 0,
0, 0, 0x6658, 0, 0, 0, 0, 0,
@@ -5009,6 +9378,16 @@ static const unsigned short utf8_to_euc_E881[] = {
0x6662, 0xD568, 0x6661, 0x6660, 0x4430, 0xD569, 0x6663, 0x3F26,
0, 0x6664, 0, 0, 0, 0x6665, 0x4F38, 0x6666,
};
+static const unsigned short utf8_to_euc_E881_x0213[] = {
+ 0xD562, 0, 0, 0xF52B, 0xD563, 0, 0x6659, 0,
+ 0, 0, 0x6658, 0, 0, 0, 0, 0,
+ 0, 0, 0x665A, 0, 0, 0, 0x403B, 0,
+ 0x665B, 0, 0x665C, 0, 0, 0, 0x4A39, 0x665D,
+ 0xD564, 0x416F, 0x665E, 0, 0xD565, 0, 0xF52C, 0,
+ 0x665F, 0, 0, 0, 0, 0xD567, 0, 0x4E7E,
+ 0x6662, 0xF52D, 0x6661, 0x6660, 0x4430, 0xF52E, 0x6663, 0x3F26,
+ 0, 0x6664, 0, 0xF52F, 0, 0x6665, 0x4F38, 0x6666,
+};
static const unsigned short utf8_to_euc_E882[] = {
0, 0xD56A, 0, 0, 0x6667, 0x6669, 0x6668, 0x4825,
0xD56B, 0x4679, 0, 0x4F3E, 0x4829, 0, 0xD56C, 0,
@@ -5019,6 +9398,16 @@ static const unsigned short utf8_to_euc_E882[] = {
0, 0x394F, 0x3069, 0, 0x3A68, 0, 0, 0,
0xD572, 0xD573, 0x4759, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E882_x0213[] = {
+ 0, 0xD56A, 0, 0, 0x6667, 0x6669, 0x6668, 0x4825,
+ 0xD56B, 0x4679, 0, 0x4F3E, 0x4829, 0, 0xD56C, 0,
+ 0, 0, 0, 0x666B, 0, 0, 0x3E53, 0,
+ 0x492A, 0xF530, 0x666C, 0x666A, 0xF531, 0x344E, 0xD56E, 0,
+ 0, 0x3854, 0x3B68, 0, 0xF532, 0x486E, 0xD56F, 0xF533,
+ 0, 0x382A, 0x4B43, 0xD571, 0x666F, 0x666D, 0, 0x394E,
+ 0, 0x394F, 0x3069, 0, 0x3A68, 0, 0, 0,
+ 0xF534, 0xD573, 0x4759, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E883[] = {
0, 0, 0, 0x305F, 0x6674, 0, 0x4340, 0,
0xD574, 0, 0, 0, 0x4758, 0xD575, 0x425B, 0xD576,
@@ -5029,6 +9418,16 @@ static const unsigned short utf8_to_euc_E883[] = {
0xD621, 0x6679, 0xD622, 0xD623, 0x4639, 0, 0xD624, 0,
0x363B, 0xD625, 0xD626, 0, 0x6726, 0x473D, 0xD627, 0,
};
+static const unsigned short utf8_to_euc_E883_x0213[] = {
+ 0, 0, 0, 0x305F, 0x6674, 0xF536, 0x4340, 0,
+ 0xD574, 0, 0x7A4A, 0, 0x4758, 0xD575, 0x425B, 0xD576,
+ 0, 0, 0xD577, 0, 0xD578, 0xF537, 0x6676, 0x7A4B,
+ 0xF538, 0x6672, 0x6675, 0x6670, 0, 0x6673, 0x4B26, 0,
+ 0x7A4C, 0x3855, 0, 0, 0x307D, 0x6671, 0xF539, 0,
+ 0, 0, 0, 0, 0, 0xD57D, 0xD57E, 0x6678,
+ 0xD621, 0x6679, 0xD622, 0x7A4D, 0x4639, 0xF53C, 0xD624, 0,
+ 0x363B, 0xD625, 0xD626, 0xF53D, 0x6726, 0x473D, 0xD627, 0,
+};
static const unsigned short utf8_to_euc_E884[] = {
0, 0, 0x3B69, 0xD628, 0, 0x363C, 0x4048, 0x4F46,
0x4C2E, 0x6677, 0x4054, 0xD629, 0, 0, 0, 0,
@@ -5039,6 +9438,16 @@ static const unsigned short utf8_to_euc_E884[] = {
0xD633, 0x4326, 0, 0x473E, 0, 0xD634, 0, 0,
0, 0x4431, 0xD635, 0, 0xD636, 0, 0x6723, 0,
};
+static const unsigned short utf8_to_euc_E884_x0213[] = {
+ 0, 0, 0x3B69, 0xD628, 0, 0x363C, 0x4048, 0x4F46,
+ 0x4C2E, 0x6677, 0x4054, 0xD629, 0, 0xF53B, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0xF540, 0xD62B,
+ 0x7A4E, 0, 0x3553, 0x667A, 0xD62D, 0, 0xF541, 0,
+ 0xD62F, 0, 0, 0x667C, 0xF543, 0, 0, 0xF544,
+ 0, 0x667B, 0, 0, 0xF545, 0, 0, 0x667D,
+ 0xD633, 0x4326, 0, 0x473E, 0, 0xF53F, 0, 0,
+ 0, 0x4431, 0xD635, 0, 0xD636, 0xF547, 0x6723, 0,
+};
static const unsigned short utf8_to_euc_E885[] = {
0, 0, 0, 0, 0, 0xD637, 0x6722, 0xD638,
0, 0, 0xD639, 0x667E, 0xD63A, 0, 0x3F55, 0,
@@ -5049,6 +9458,16 @@ static const unsigned short utf8_to_euc_E885[] = {
0x3978, 0x6727, 0, 0, 0x672B, 0, 0, 0xD644,
0x4432, 0x4A22, 0x4123, 0, 0, 0, 0, 0x425C,
};
+static const unsigned short utf8_to_euc_E885_x0213[] = {
+ 0, 0, 0, 0, 0, 0xD637, 0x6722, 0xD638,
+ 0, 0, 0x7A4F, 0x667E, 0xD63A, 0, 0x3F55, 0,
+ 0x4965, 0x6725, 0xD63B, 0x6724, 0x3950, 0x4F53, 0, 0xD63C,
+ 0, 0, 0, 0, 0, 0, 0, 0x6735,
+ 0x7A50, 0xD63E, 0, 0, 0, 0x6729, 0x672A, 0x7A51,
+ 0x7A52, 0xF549, 0, 0x3C70, 0, 0x7A53, 0x6728, 0xD643,
+ 0x3978, 0x6727, 0, 0, 0x672B, 0, 0, 0xD644,
+ 0x4432, 0x4A22, 0x4123, 0, 0, 0, 0, 0x425C,
+};
static const unsigned short utf8_to_euc_E886[] = {
0x672F, 0xD645, 0x6730, 0x672C, 0xD647, 0xD648, 0xD649, 0,
0x672D, 0, 0x672E, 0xD64A, 0, 0, 0xD64B, 0x3951,
@@ -5059,6 +9478,16 @@ static const unsigned short utf8_to_euc_E886[] = {
0x6738, 0, 0xD652, 0x4137, 0xD653, 0x6739, 0, 0,
0x673B, 0, 0x673F, 0xD654, 0, 0x673C, 0x673A, 0x473F,
};
+static const unsigned short utf8_to_euc_E886_x0213[] = {
+ 0x672F, 0xF54B, 0x6730, 0x672C, 0xF54D, 0xF54E, 0xD649, 0,
+ 0x672D, 0, 0x672E, 0xD64A, 0, 0, 0xD64B, 0x3951,
+ 0xD646, 0, 0, 0x6736, 0, 0x6732, 0xD64C, 0,
+ 0xF550, 0, 0x4966, 0xD64E, 0x4B6C, 0x4928, 0xD64F, 0,
+ 0x6731, 0, 0xD650, 0x6734, 0x6733, 0, 0, 0,
+ 0x4B44, 0x6737, 0, 0, 0, 0, 0xD651, 0,
+ 0x6738, 0, 0xF551, 0x4137, 0xD653, 0x6739, 0, 0,
+ 0x673B, 0, 0x673F, 0x7A54, 0, 0x673C, 0x673A, 0x473F,
+};
static const unsigned short utf8_to_euc_E887[] = {
0x673D, 0, 0x673E, 0xD656, 0, 0xD657, 0x3232, 0,
0x6745, 0x6740, 0xD658, 0xD655, 0, 0x6741, 0xD659, 0xD65A,
@@ -5069,6 +9498,16 @@ static const unsigned short utf8_to_euc_E887[] = {
0xD664, 0xD665, 0xD666, 0x3B6A, 0x4357, 0xD667, 0xD668, 0,
0xD669, 0xD66A, 0x674A, 0x674B, 0x3131, 0xD66B, 0x674C, 0xD66C,
};
+static const unsigned short utf8_to_euc_E887_x0213[] = {
+ 0x673D, 0xF552, 0x673E, 0xF553, 0, 0xD657, 0x3232, 0,
+ 0x6745, 0x6740, 0x7A55, 0xD655, 0, 0x6741, 0xD659, 0x7A56,
+ 0, 0x6742, 0, 0x4221, 0, 0xD65B, 0xF554, 0x7A57,
+ 0x6744, 0x6743, 0x6746, 0xF555, 0, 0xD65E, 0xD65F, 0x6747,
+ 0x6748, 0xD660, 0, 0x3F43, 0xF557, 0x3269, 0, 0x6749,
+ 0x4E57, 0, 0x3C2B, 0xD662, 0xF559, 0x3D2D, 0, 0,
+ 0xD664, 0xD665, 0xD666, 0x3B6A, 0x4357, 0xD667, 0xD668, 0,
+ 0xD669, 0xD66A, 0x674A, 0x674B, 0x3131, 0xF55B, 0x674C, 0xF55C,
+};
static const unsigned short utf8_to_euc_E888[] = {
0xD66D, 0x674D, 0x674E, 0xD66E, 0, 0x674F, 0, 0x6750,
0x363D, 0x5A2A, 0x6751, 0, 0x4065, 0x6752, 0x3C4B, 0xD66F,
@@ -5079,6 +9518,16 @@ static const unsigned short utf8_to_euc_E888[] = {
0, 0, 0xD678, 0x6758, 0xD679, 0x4249, 0x4775, 0x383F,
0x6757, 0x4125, 0xD67A, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E888_x0213[] = {
+ 0xD66D, 0x674D, 0x674E, 0xD66E, 0xF55E, 0x674F, 0, 0x6750,
+ 0x363D, 0x5A2A, 0x6751, 0, 0x4065, 0x6752, 0x3C4B, 0xD66F,
+ 0x6753, 0, 0x5030, 0xD670, 0xD671, 0, 0x6754, 0x4A5E,
+ 0x345C, 0xF560, 0xD673, 0x4124, 0x3D58, 0xD674, 0x4971, 0x3D2E,
+ 0, 0xF561, 0xF562, 0, 0, 0, 0, 0,
+ 0xD677, 0x6755, 0x3952, 0x6756, 0x484C, 0, 0x6764, 0,
+ 0, 0, 0xF564, 0x6758, 0xF565, 0x4249, 0x4775, 0x383F,
+ 0x6757, 0x4125, 0xD67A, 0, 0xF566, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E889[] = {
0x6759, 0, 0, 0xD67B, 0xD67C, 0xD67D, 0xD67E, 0x447A,
0, 0, 0, 0xD721, 0, 0, 0xD722, 0xD723,
@@ -5089,6 +9538,16 @@ static const unsigned short utf8_to_euc_E889[] = {
0, 0x6765, 0x3F27, 0, 0xD72B, 0, 0x3170, 0x6766,
0x6767, 0, 0, 0xD72C, 0, 0xD72D, 0x6768, 0xD72E,
};
+static const unsigned short utf8_to_euc_E889_x0213[] = {
+ 0x6759, 0, 0, 0xD67B, 0xD67C, 0xF569, 0xF567, 0x447A,
+ 0, 0xF568, 0, 0xF56B, 0, 0, 0xD722, 0xF56D,
+ 0, 0xD724, 0, 0, 0, 0, 0xD725, 0xF56F,
+ 0x675B, 0x675A, 0x675D, 0, 0xF571, 0x675C, 0, 0x675E,
+ 0x7A5B, 0, 0x6760, 0xF572, 0x675F, 0, 0x344F, 0xD729,
+ 0x6761, 0, 0x6762, 0x6763, 0, 0xD72A, 0x3A31, 0x4E49,
+ 0, 0x6765, 0x3F27, 0, 0x7A5C, 0, 0x3170, 0x6766,
+ 0x6767, 0xF576, 0, 0xD72C, 0, 0xF578, 0x6768, 0xF579,
+};
static const unsigned short utf8_to_euc_E88A[] = {
0xD72F, 0xD730, 0, 0xD731, 0xD732, 0, 0, 0xD733,
0, 0xD734, 0xD735, 0x3072, 0, 0x6769, 0xD736, 0,
@@ -5099,6 +9558,16 @@ static const unsigned short utf8_to_euc_E88A[] = {
0xD746, 0x3256, 0xD747, 0x4B27, 0xD748, 0, 0, 0xD749,
0x375D, 0x365C, 0xD74A, 0x676D, 0xD74B, 0x326A, 0xD74C, 0xD74D,
};
+static const unsigned short utf8_to_euc_E88A_x0213[] = {
+ 0xD72F, 0xD730, 0, 0xF57A, 0xD732, 0, 0, 0xD733,
+ 0, 0xD734, 0xF57B, 0x3072, 0, 0x6769, 0x7A5E, 0,
+ 0, 0xD737, 0x676A, 0xF57C, 0xD738, 0, 0xD739, 0,
+ 0xD73A, 0x4967, 0xD73B, 0xD73C, 0, 0x3C47, 0, 0x676C,
+ 0xD73D, 0x7A5F, 0, 0x7A60, 0x7A61, 0x3329, 0x3032, 0xF57D,
+ 0xF57E, 0x7A62, 0xD744, 0x676B, 0x676E, 0x474E, 0x7A63, 0x3F44,
+ 0xD746, 0x3256, 0xF621, 0x4B27, 0xF622, 0, 0, 0x7A64,
+ 0x375D, 0x365C, 0xF623, 0x676D, 0xF624, 0x326A, 0x7A65, 0x7A66,
+};
static const unsigned short utf8_to_euc_E88B[] = {
0, 0, 0, 0, 0, 0x3423, 0xD74E, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -5109,6 +9578,16 @@ static const unsigned short utf8_to_euc_E88B[] = {
0, 0x3151, 0, 0x6774, 0x6773, 0, 0xD759, 0xD75A,
0, 0x6779, 0x6775, 0x6778, 0, 0xD75B, 0xD75C, 0,
};
+static const unsigned short utf8_to_euc_E88B_x0213[] = {
+ 0, 0, 0, 0, 0, 0x3423, 0x7A67, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0xD74F, 0x3171, 0x6772, 0x4E6A, 0x425D, 0x7A68, 0, 0x4944,
+ 0, 0x677E, 0xD751, 0x3257, 0x677C, 0, 0x677A, 0x6771,
+ 0xD752, 0x676F, 0xF625, 0x6770, 0xD754, 0x3C63, 0x366C, 0x4377,
+ 0xF626, 0, 0xD756, 0x4651, 0, 0xD757, 0, 0xD758,
+ 0, 0x3151, 0, 0x6774, 0x6773, 0, 0xD759, 0xF627,
+ 0, 0x6779, 0x6775, 0x6778, 0, 0x7A69, 0x7A6A, 0,
+};
static const unsigned short utf8_to_euc_E88C[] = {
0xD75D, 0xD75E, 0x4C50, 0x6777, 0x3258, 0x337D, 0x677B, 0xD75F,
0xD760, 0x677D, 0xD761, 0xD762, 0, 0, 0x3754, 0,
@@ -5119,6 +9598,16 @@ static const unsigned short utf8_to_euc_E88C[] = {
0xD76D, 0x6825, 0x6824, 0xD76E, 0x6822, 0x6821, 0x4363, 0xD76F,
0x427B, 0x6827, 0xD770, 0, 0xD771, 0xD772, 0, 0,
};
+static const unsigned short utf8_to_euc_E88C_x0213[] = {
+ 0x7A6B, 0x7A6C, 0x4C50, 0x6777, 0x3258, 0x337D, 0x677B, 0xF628,
+ 0xF629, 0x677D, 0xD761, 0xD762, 0xF62A, 0, 0x3754, 0,
+ 0, 0, 0, 0, 0, 0, 0x6823, 0x682C,
+ 0x682D, 0, 0, 0xF62C, 0x302B, 0xF62D, 0xD766, 0xD767,
+ 0, 0xD768, 0x7A6E, 0x6834, 0, 0, 0, 0,
+ 0x3071, 0, 0, 0x682B, 0xD76A, 0x7A6F, 0xD76C, 0x682A,
+ 0xF62E, 0x6825, 0x6824, 0xD76E, 0x6822, 0x6821, 0x4363, 0xD76F,
+ 0x427B, 0x6827, 0x7A70, 0, 0xF62F, 0xD772, 0, 0,
+};
static const unsigned short utf8_to_euc_E88D[] = {
0x6826, 0, 0xD773, 0xD774, 0xD775, 0x6829, 0, 0xD776,
0, 0x4170, 0x3755, 0, 0, 0xD777, 0xD778, 0x3141,
@@ -5129,6 +9618,16 @@ static const unsigned short utf8_to_euc_E88D[] = {
0xD77D, 0, 0, 0x683A, 0, 0x683B, 0, 0x3259,
0xD77E, 0, 0, 0x322E, 0x6838, 0xD821, 0, 0xD822,
};
+static const unsigned short utf8_to_euc_E88D_x0213[] = {
+ 0x6826, 0, 0xD773, 0x7A71, 0xF630, 0x6829, 0, 0x7A72,
+ 0, 0x4170, 0x3755, 0, 0, 0xD777, 0xD778, 0x3141,
+ 0x6828, 0x7A73, 0x3953, 0xD83E, 0xF62B, 0x7A74, 0xD77B, 0xF631,
+ 0x4171, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0x7A6D, 0xAE4A, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0xD77D, 0, 0, 0x683A, 0, 0x683B, 0, 0x3259,
+ 0xD77E, 0, 0, 0x322E, 0x6838, 0x7A75, 0, 0xF633,
+};
static const unsigned short utf8_to_euc_E88E[] = {
0xD823, 0, 0xD824, 0, 0xD825, 0x682E, 0xD826, 0x6836,
0, 0x683D, 0x6837, 0, 0, 0xD827, 0x6835, 0,
@@ -5139,6 +9638,16 @@ static const unsigned short utf8_to_euc_E88E[] = {
0, 0x4D69, 0, 0, 0, 0x6839, 0, 0,
0, 0, 0, 0, 0, 0x684F, 0xD834, 0xD835,
};
+static const unsigned short utf8_to_euc_E88E_x0213[] = {
+ 0xD823, 0, 0xD824, 0, 0xD825, 0x682E, 0x7A76, 0x6836,
+ 0, 0x683D, 0x6837, 0, 0, 0xF636, 0x6835, 0,
+ 0, 0, 0x7A77, 0x6776, 0xF637, 0xF638, 0x6833, 0,
+ 0x7A78, 0xD82C, 0x682F, 0xF639, 0xD82E, 0xF63A, 0x3450, 0x6831,
+ 0x683C, 0, 0x6832, 0, 0, 0, 0xD830, 0x7A79,
+ 0x683E, 0x7A7A, 0x6830, 0x477C, 0xD833, 0xD84C, 0, 0,
+ 0, 0x4D69, 0, 0, 0, 0x6839, 0, 0,
+ 0, 0, 0, 0, 0, 0x684F, 0xD834, 0x7A7B,
+};
static const unsigned short utf8_to_euc_E88F[] = {
0xD836, 0x6847, 0, 0, 0, 0x3F7B, 0, 0xD837,
0, 0xD838, 0x3546, 0, 0x365D, 0, 0x6842, 0xD839,
@@ -5149,6 +9658,16 @@ static const unsigned short utf8_to_euc_E88F[] = {
0x3856, 0x4929, 0x684B, 0, 0x683F, 0, 0xD841, 0x6848,
0xD842, 0xD843, 0, 0x6852, 0xD844, 0x6843, 0, 0,
};
+static const unsigned short utf8_to_euc_E88F_x0213[] = {
+ 0x7A7C, 0x6847, 0, 0, 0, 0x3F7B, 0, 0x7A7D,
+ 0, 0xF63B, 0x3546, 0, 0x365D, 0, 0x6842, 0x7A7E,
+ 0xF63C, 0x7B21, 0, 0x325B, 0xF63D, 0, 0x3E54, 0,
+ 0x6845, 0, 0, 0, 0x3A5A, 0xF63E, 0, 0x4551,
+ 0x684A, 0x7B22, 0, 0, 0, 0xF63F, 0, 0,
+ 0xD83F, 0x4A6E, 0x7B23, 0x6841, 0, 0, 0, 0x325A,
+ 0x3856, 0x4929, 0x684B, 0, 0x683F, 0, 0xD841, 0x6848,
+ 0xD842, 0xF640, 0, 0x6852, 0xD844, 0x6843, 0, 0,
+};
static const unsigned short utf8_to_euc_E890[] = {
0, 0xD845, 0, 0x6844, 0x463A, 0, 0xD846, 0x6849,
0, 0, 0xD847, 0x6846, 0x4B28, 0x684C, 0x3060, 0xD848,
@@ -5159,6 +9678,16 @@ static const unsigned short utf8_to_euc_E890[] = {
0, 0x337E, 0, 0, 0, 0x6862, 0, 0,
0x6850, 0xD84E, 0, 0, 0x6855, 0x4D6E, 0, 0,
};
+static const unsigned short utf8_to_euc_E890_x0213[] = {
+ 0, 0x7B24, 0, 0x6844, 0x463A, 0, 0x7B25, 0x6849,
+ 0, 0, 0x7B26, 0x6846, 0x4B28, 0x684C, 0x3060, 0xF641,
+ 0, 0xF642, 0, 0x6840, 0, 0xF643, 0, 0xF645,
+ 0, 0xD84B, 0, 0, 0, 0, 0, 0,
+ 0x684E, 0, 0x684D, 0, 0, 0, 0, 0,
+ 0, 0x476B, 0x6854, 0, 0x685F, 0, 0, 0xD84D,
+ 0, 0x337E, 0, 0, 0, 0x6862, 0, 0,
+ 0x6850, 0xF646, 0, 0, 0x6855, 0x4D6E, 0, 0,
+};
static const unsigned short utf8_to_euc_E891[] = {
0, 0, 0, 0, 0, 0xD84F, 0x685E, 0xD850,
0xD851, 0x4D55, 0xD852, 0, 0, 0xD853, 0x4E2A, 0xD854,
@@ -5169,6 +9698,16 @@ static const unsigned short utf8_to_euc_E891[] = {
0xD861, 0x472C, 0, 0xD862, 0xD863, 0x302A, 0xD864, 0x6858,
0xD865, 0x6861, 0x4978, 0, 0xD866, 0xD867, 0, 0,
};
+static const unsigned short utf8_to_euc_E891_x0213[] = {
+ 0, 0, 0, 0, 0, 0xD84F, 0x685E, 0xD850,
+ 0x7B28, 0x4D55, 0xF647, 0, 0, 0xD853, 0x4E2A, 0xF648,
+ 0, 0xF649, 0xF64A, 0, 0, 0, 0xD857, 0x4378,
+ 0xD858, 0xF64B, 0xF64C, 0x336B, 0xF64D, 0, 0, 0x7B29,
+ 0xD85C, 0x4972, 0x6864, 0x4621, 0xD85D, 0xF64F, 0x3031, 0xD85F,
+ 0, 0x685D, 0xD860, 0x6859, 0x4172, 0x6853, 0x685B, 0x6860,
+ 0x7B2A, 0x472C, 0, 0x7B2B, 0xD863, 0x302A, 0xF650, 0x6858,
+ 0xF651, 0x6861, 0x4978, 0, 0xF652, 0xD867, 0, 0,
+};
static const unsigned short utf8_to_euc_E892[] = {
0, 0xD868, 0x685C, 0, 0x6857, 0xD869, 0, 0,
0, 0, 0, 0x3E55, 0, 0, 0, 0,
@@ -5179,6 +9718,16 @@ static const unsigned short utf8_to_euc_E892[] = {
0, 0xD873, 0x3377, 0, 0xD874, 0, 0, 0,
0x3E78, 0x6865, 0xD875, 0x686A, 0x4173, 0xD876, 0xD877, 0x6866,
};
+static const unsigned short utf8_to_euc_E892_x0213[] = {
+ 0, 0xF653, 0x685C, 0, 0x6857, 0x7B2C, 0, 0,
+ 0, 0, 0, 0x3E55, 0, 0, 0, 0,
+ 0x3D2F, 0, 0xD86A, 0xD86B, 0x3C2C, 0xD86C, 0, 0xF656,
+ 0, 0x4C58, 0, 0, 0x4947, 0, 0x7B2D, 0x6867,
+ 0, 0x6870, 0, 0, 0, 0, 0xF657, 0,
+ 0xD86F, 0xD870, 0xD871, 0, 0, 0x685A, 0, 0x7B2E,
+ 0, 0xD873, 0x3377, 0, 0x7B2F, 0, 0, 0,
+ 0x3E78, 0x6865, 0x7B30, 0x686A, 0x4173, 0xD876, 0xF658, 0x6866,
+};
static const unsigned short utf8_to_euc_E893[] = {
0xD878, 0x686D, 0xD879, 0, 0x435F, 0, 0x686E, 0xD87A,
0xD87B, 0x4D56, 0x6863, 0x3338, 0xD87C, 0x6869, 0, 0xD87D,
@@ -5189,6 +9738,16 @@ static const unsigned short utf8_to_euc_E893[] = {
0xD925, 0xD926, 0xD927, 0, 0x6873, 0, 0, 0xD928,
0, 0, 0xD92A, 0xD92B, 0x687A, 0xD92C, 0, 0x6872,
};
+static const unsigned short utf8_to_euc_E893_x0213[] = {
+ 0x7B31, 0x686D, 0x7B32, 0, 0x435F, 0, 0x686E, 0xD87A,
+ 0xD87B, 0x4D56, 0x6863, 0x3338, 0xD87C, 0x6869, 0xF65A, 0xF65B,
+ 0x686C, 0x4C2C, 0, 0xF65C, 0, 0, 0x686F, 0,
+ 0, 0x6868, 0x686B, 0, 0xF655, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0xF65E,
+ 0, 0, 0xF65F, 0, 0x4B29, 0, 0x4F21, 0xF660,
+ 0xF661, 0xF662, 0xD927, 0, 0x6873, 0, 0, 0xD928,
+ 0, 0, 0xF663, 0xD92B, 0x687A, 0xF664, 0, 0x6872,
+};
static const unsigned short utf8_to_euc_E894[] = {
0x3C43, 0, 0xD92D, 0xD92E, 0, 0, 0x6851, 0xD92F,
0, 0, 0, 0, 0xD930, 0, 0xD931, 0,
@@ -5199,6 +9758,16 @@ static const unsigned short utf8_to_euc_E894[] = {
0, 0, 0xD929, 0xD93D, 0xD93E, 0x4222, 0xD93F, 0,
0, 0, 0, 0, 0, 0x4A43, 0, 0xD940,
};
+static const unsigned short utf8_to_euc_E894_x0213[] = {
+ 0x3C43, 0, 0xD92D, 0xD92E, 0, 0, 0x6851, 0xD92F,
+ 0, 0, 0, 0, 0xF665, 0, 0xD931, 0,
+ 0xD932, 0x4A4E, 0, 0x4C22, 0x6879, 0x6878, 0, 0x6874,
+ 0x6875, 0, 0x3136, 0xF666, 0xD933, 0, 0x7B35, 0x6877,
+ 0, 0x6871, 0xD935, 0x7B36, 0xF667, 0xF668, 0x4455, 0xD939,
+ 0, 0, 0xD93A, 0xF669, 0x6876, 0x307E, 0, 0x7B37,
+ 0, 0, 0x7B34, 0xD93D, 0xF66A, 0x4222, 0xD93F, 0,
+ 0, 0, 0, 0, 0, 0x4A43, 0xF66F, 0xD940,
+};
static const unsigned short utf8_to_euc_E895[] = {
0x687B, 0x6921, 0, 0x4859, 0, 0, 0xD941, 0,
0x687E, 0x3E56, 0x3C49, 0x6923, 0, 0, 0x363E, 0xD942,
@@ -5209,6 +9778,16 @@ static const unsigned short utf8_to_euc_E895[] = {
0, 0, 0, 0, 0, 0, 0, 0x6931,
0, 0xD953, 0xD954, 0xD955, 0, 0xD956, 0x6932, 0xD957,
};
+static const unsigned short utf8_to_euc_E895_x0213[] = {
+ 0x687B, 0x6921, 0, 0x4859, 0, 0, 0xD941, 0,
+ 0x687E, 0x3E56, 0x3C49, 0x6923, 0, 0, 0x363E, 0xF66B,
+ 0xD943, 0xF670, 0xD945, 0xF671, 0, 0x6924, 0xD947, 0x4979,
+ 0x687D, 0x7B38, 0x6856, 0, 0xD949, 0xD94A, 0xF672, 0xD94C,
+ 0xD94D, 0xF673, 0xF674, 0x687C, 0x7B39, 0, 0, 0,
+ 0x4F4F, 0x4622, 0x4973, 0xD951, 0, 0x692B, 0, 0xF66C,
+ 0, 0, 0, 0, 0, 0, 0, 0x6931,
+ 0, 0xD953, 0x7B3C, 0xF676, 0, 0xF677, 0x6932, 0xF678,
+};
static const unsigned short utf8_to_euc_E896[] = {
0x6925, 0xD958, 0, 0, 0x4776, 0xD959, 0xD95A, 0x692F,
0x6927, 0xD95B, 0x6929, 0xD95C, 0xD95D, 0, 0, 0xD95E,
@@ -5219,6 +9798,16 @@ static const unsigned short utf8_to_euc_E896[] = {
0xF461, 0, 0, 0, 0xD967, 0, 0xD968, 0xD969,
0xD96A, 0x6937, 0x6935, 0, 0xD96B, 0xD96C, 0xD96D, 0xD96E,
};
+static const unsigned short utf8_to_euc_E896_x0213[] = {
+ 0x6925, 0xF679, 0, 0, 0x4776, 0xD959, 0xF67A, 0x692F,
+ 0x6927, 0xD95B, 0x6929, 0xD95C, 0x7B3D, 0, 0, 0x7B3E,
+ 0x6933, 0x6928, 0, 0xF67B, 0x692C, 0, 0, 0x3172,
+ 0xD960, 0x4665, 0, 0x692D, 0x6930, 0xF67C, 0, 0xF67D,
+ 0xD963, 0, 0x7B3F, 0, 0x6926, 0xD965, 0x4126, 0xD966,
+ 0x692A, 0x3B27, 0x3F45, 0x3730, 0x4C74, 0x7B3B, 0x4C79, 0x3D72,
+ 0x7B40, 0, 0, 0, 0xD967, 0, 0xD968, 0xF723,
+ 0xD96A, 0x6937, 0x6935, 0, 0xF724, 0xD96C, 0xD96D, 0xD96E,
+};
static const unsigned short utf8_to_euc_E897[] = {
0, 0x4F4E, 0xD96F, 0, 0, 0, 0, 0xD970,
0, 0x6934, 0xD971, 0xD972, 0, 0x4D75, 0xD973, 0x6936,
@@ -5229,6 +9818,16 @@ static const unsigned short utf8_to_euc_E897[] = {
0, 0, 0, 0xD97C, 0, 0, 0xD97D, 0x3D73,
0, 0x693D, 0x6942, 0x4174, 0xD97E, 0, 0x6941, 0xDA21,
};
+static const unsigned short utf8_to_euc_E897_x0213[] = {
+ 0, 0x4F4E, 0xD96F, 0, 0, 0, 0, 0xF725,
+ 0, 0x6934, 0xF726, 0x7B41, 0, 0x4D75, 0x7B42, 0x6936,
+ 0x6938, 0, 0, 0, 0, 0x6939, 0, 0,
+ 0xF727, 0xF728, 0xD976, 0, 0x693C, 0x693A, 0, 0xF729,
+ 0xD978, 0xF72A, 0, 0, 0x4623, 0x693B, 0xF72B, 0,
+ 0xD97A, 0x484D, 0x692E, 0, 0, 0x7B43, 0, 0,
+ 0, 0, 0, 0xD97C, 0, 0, 0xF72C, 0x3D73,
+ 0, 0x693D, 0x6942, 0x4174, 0xD97E, 0, 0x6941, 0x7B45,
+};
static const unsigned short utf8_to_euc_E898[] = {
0xDA22, 0, 0x6922, 0, 0xDA23, 0xDA24, 0x6943, 0x4149,
0, 0, 0x693E, 0x6940, 0, 0xDA25, 0xDA26, 0,
@@ -5239,6 +9838,16 @@ static const unsigned short utf8_to_euc_E898[] = {
0x6946, 0, 0, 0, 0, 0, 0xDA31, 0,
0xDA32, 0, 0xDA33, 0, 0xDA34, 0xDA35, 0, 0x6947,
};
+static const unsigned short utf8_to_euc_E898_x0213[] = {
+ 0xF72D, 0, 0x6922, 0, 0x7B46, 0x7B47, 0x6943, 0x4149,
+ 0, 0, 0x693E, 0x6940, 0, 0xDA25, 0xDA26, 0,
+ 0x7B48, 0xF72E, 0x7B44, 0x693F, 0, 0, 0x5D31, 0x5D22,
+ 0x7B4A, 0xDA2B, 0x6945, 0xDA2C, 0, 0, 0xF72F, 0,
+ 0, 0xF730, 0x6944, 0, 0xF731, 0, 0, 0xF732,
+ 0, 0x7B4B, 0, 0, 0, 0x4D76, 0, 0x623C,
+ 0x6946, 0, 0, 0, 0, 0, 0xDA31, 0,
+ 0x7B4C, 0xF734, 0xDA33, 0, 0xF735, 0xDA35, 0, 0x6947,
+};
static const unsigned short utf8_to_euc_E899[] = {
0xDA36, 0xB866, 0xDA37, 0, 0, 0, 0xDA38, 0,
0, 0, 0, 0, 0, 0x6948, 0x3857, 0,
@@ -5249,6 +9858,16 @@ static const unsigned short utf8_to_euc_E899[] = {
0, 0x694D, 0, 0, 0, 0xDA48, 0xDA49, 0xDA4A,
0, 0x467A, 0xDA4B, 0x303A, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E899_x0213[] = {
+ 0xF737, 0x2F68, 0xDA37, 0, 0, 0, 0xDA38, 0,
+ 0, 0, 0, 0, 0, 0x6948, 0x3857, 0,
+ 0x3554, 0, 0xDA39, 0xF739, 0x694A, 0x515D, 0xF73A, 0x7B4D,
+ 0xDA3D, 0xDA3E, 0x3575, 0x7B4E, 0x4E3A, 0xDA3F, 0x3673, 0x694B,
+ 0xDA40, 0xDA41, 0x7B50, 0xDA43, 0xDA44, 0, 0, 0x694C,
+ 0, 0xDA45, 0, 0x436E, 0x7B52, 0, 0, 0xF73B,
+ 0, 0x694D, 0, 0, 0, 0x7B53, 0xDA49, 0xF73C,
+ 0, 0x467A, 0xF73D, 0x303A, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E89A[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0xDA6D, 0, 0x3263, 0x6952, 0x6953, 0xDA4C, 0, 0,
@@ -5259,6 +9878,16 @@ static const unsigned short utf8_to_euc_E89A[] = {
0x6958, 0xDA57, 0, 0xDA58, 0xDA59, 0xDA5A, 0x6954, 0xDA5B,
0xDA5C, 0xDA5D, 0, 0, 0, 0, 0, 0xDA5E,
};
+static const unsigned short utf8_to_euc_E89A_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0xF73E,
+ 0xDA6D, 0xF73F, 0x3263, 0x6952, 0x6953, 0xF740, 0, 0,
+ 0, 0xF741, 0, 0x694E, 0, 0x3B3D, 0xDA4E, 0,
+ 0x7B54, 0, 0xDA50, 0, 0xF742, 0xF743, 0, 0,
+ 0, 0xDA52, 0, 0x694F, 0x4742, 0, 0xDA53, 0xDA54,
+ 0xF744, 0x6950, 0x6951, 0x695B, 0, 0xDA56, 0, 0x6955,
+ 0x6958, 0xF746, 0, 0xF747, 0xDA59, 0xDA5A, 0x6954, 0xDA5B,
+ 0x7B55, 0xDA5D, 0, 0, 0, 0, 0, 0xDA5E,
+};
static const unsigned short utf8_to_euc_E89B[] = {
0xDA5F, 0xDA60, 0, 0xDA61, 0x6956, 0xDA62, 0x6957, 0x3C58,
0, 0x6959, 0, 0x4341, 0, 0x3756, 0x3342, 0,
@@ -5269,6 +9898,16 @@ static const unsigned short utf8_to_euc_E89B[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0x427D, 0x696C, 0xDA6E, 0x6968, 0xDA6F, 0xDA70, 0x326B, 0,
};
+static const unsigned short utf8_to_euc_E89B_x0213[] = {
+ 0xDA5F, 0xF748, 0, 0xF749, 0x6956, 0xDA62, 0x6957, 0x3C58,
+ 0, 0x6959, 0, 0x4341, 0, 0x3756, 0x3342, 0,
+ 0, 0xF74A, 0xDA64, 0, 0x695C, 0xF74B, 0, 0xF74C,
+ 0, 0x333F, 0xDA67, 0x6961, 0xDA68, 0, 0x695D, 0x6960,
+ 0xDA69, 0, 0, 0xF74D, 0x483A, 0xDA6B, 0xF74E, 0xDA6C,
+ 0, 0x695E, 0, 0, 0x695F, 0x4948, 0x485A, 0x6962,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0x427D, 0x696C, 0x7B56, 0x6968, 0x7B57, 0x7B58, 0x326B, 0,
+};
static const unsigned short utf8_to_euc_E89C[] = {
0x6966, 0, 0x4B2A, 0x6967, 0xDA71, 0xDA72, 0x6964, 0xDA73,
0x6965, 0x696A, 0x696D, 0xDA74, 0, 0x696B, 0xDA75, 0xDA76,
@@ -5279,6 +9918,16 @@ static const unsigned short utf8_to_euc_E89C[] = {
0, 0xDB24, 0xDB25, 0, 0x696E, 0, 0, 0x6970,
0, 0xDB26, 0xDB27, 0x6971, 0xDB28, 0xDB29, 0xDB2A, 0x696F,
};
+static const unsigned short utf8_to_euc_E89C_x0213[] = {
+ 0x6966, 0, 0x4B2A, 0x6967, 0xDA71, 0xF750, 0x6964, 0xF751,
+ 0x6965, 0x696A, 0x696D, 0x7B59, 0, 0x696B, 0xF752, 0xDA76,
+ 0xF753, 0x6969, 0x6963, 0xF754, 0xDA79, 0, 0, 0,
+ 0x4358, 0xF755, 0x6974, 0, 0x4C2A, 0, 0xDA7B, 0xF756,
+ 0, 0xF757, 0, 0xF758, 0, 0x6972, 0, 0,
+ 0xDB21, 0x6973, 0, 0, 0, 0, 0xDB22, 0xDB23,
+ 0, 0xF759, 0xDB25, 0, 0x696E, 0, 0, 0x6970,
+ 0, 0xDB26, 0xF75A, 0x6971, 0xDB28, 0xDB29, 0xF75B, 0x696F,
+};
static const unsigned short utf8_to_euc_E89D[] = {
0xDB2B, 0, 0, 0xDB2C, 0, 0xDB2D, 0, 0,
0, 0x4066, 0, 0x4F39, 0x6978, 0xDB2E, 0x6979, 0,
@@ -5289,6 +9938,16 @@ static const unsigned short utf8_to_euc_E89D[] = {
0, 0xDB35, 0xDB36, 0, 0x697A, 0, 0x4433, 0,
0x6977, 0, 0, 0xDB37, 0, 0, 0, 0x4768,
};
+static const unsigned short utf8_to_euc_E89D_x0213[] = {
+ 0xF75C, 0, 0, 0xF75D, 0, 0xDB2D, 0, 0,
+ 0, 0x4066, 0, 0x4F39, 0x6978, 0xDB2E, 0x6979, 0,
+ 0, 0xF75E, 0, 0x6A21, 0, 0x3F2A, 0, 0x697B,
+ 0xF75F, 0x697E, 0, 0, 0, 0xDB30, 0, 0x6976,
+ 0x6975, 0xDB31, 0, 0x6A22, 0xF760, 0xF761, 0x325C, 0,
+ 0x697C, 0, 0x6A23, 0, 0, 0, 0x697D, 0xDB34,
+ 0, 0x7B5A, 0xF762, 0, 0x697A, 0, 0x4433, 0,
+ 0x6977, 0, 0, 0xDB37, 0xF763, 0, 0, 0x4768,
+};
static const unsigned short utf8_to_euc_E89E[] = {
0, 0, 0x6A27, 0xDB38, 0xDB39, 0xDB3A, 0xDB3B, 0xDB3C,
0xDB3D, 0xDB3E, 0, 0xDB3F, 0xDB40, 0x4D3B, 0, 0,
@@ -5299,6 +9958,16 @@ static const unsigned short utf8_to_euc_E89E[] = {
0, 0xDB4E, 0, 0x6A30, 0, 0xDB4F, 0, 0,
0, 0, 0x4D66, 0x6A33, 0, 0x6A2A, 0xDB50, 0xDB51,
};
+static const unsigned short utf8_to_euc_E89E_x0213[] = {
+ 0, 0, 0x6A27, 0xDB38, 0xDB39, 0xDB3A, 0xDB3B, 0x7B5B,
+ 0x7B5C, 0xF767, 0, 0xF768, 0xDB40, 0x4D3B, 0, 0,
+ 0xDB41, 0, 0, 0xF769, 0, 0xDB43, 0, 0xDB44,
+ 0xDB45, 0xDB46, 0, 0, 0, 0, 0xDB47, 0x6A26,
+ 0xF76A, 0, 0x6A25, 0xDB49, 0, 0, 0, 0xF766,
+ 0, 0, 0, 0x6A2E, 0x7B5D, 0x7B5E, 0xDB4D, 0x6A28,
+ 0, 0xDB4E, 0, 0x6A30, 0, 0x7B5F, 0, 0,
+ 0, 0, 0x4D66, 0x6A33, 0, 0x6A2A, 0xF76D, 0xDB51,
+};
static const unsigned short utf8_to_euc_E89F[] = {
0x6A2B, 0xDB52, 0, 0, 0x6A2F, 0, 0x6A32, 0x6A31,
0xDB53, 0xDB54, 0xDB55, 0x6A29, 0, 0, 0xDB56, 0,
@@ -5309,6 +9978,16 @@ static const unsigned short utf8_to_euc_E89F[] = {
0, 0xDB63, 0x6A35, 0xDB64, 0, 0, 0x6A3A, 0x6A3B,
0xDB65, 0x332A, 0xDB66, 0x3542, 0, 0, 0x6A39, 0xDB67,
};
+static const unsigned short utf8_to_euc_E89F_x0213[] = {
+ 0x6A2B, 0xF76F, 0, 0, 0x6A2F, 0, 0x6A32, 0x6A31,
+ 0xDB53, 0xDB54, 0xDB55, 0x6A29, 0, 0, 0xF770, 0,
+ 0x6A2C, 0, 0x6A3D, 0, 0, 0xDB57, 0x7B61, 0,
+ 0, 0xDB59, 0xDB5A, 0, 0xDB5B, 0, 0, 0xF772,
+ 0x6A36, 0, 0xDB5D, 0xF774, 0xDB5F, 0xF775, 0xF776, 0,
+ 0, 0, 0xF777, 0xF778, 0x7B62, 0xF779, 0, 0x6A34,
+ 0, 0xDB63, 0x6A35, 0xDB64, 0, 0xF771, 0x6A3A, 0x6A3B,
+ 0xDB65, 0x332A, 0xDB66, 0x3542, 0, 0, 0x6A39, 0xDB67,
+};
static const unsigned short utf8_to_euc_E8A0[] = {
0, 0xDB68, 0, 0xDB69, 0, 0x6A24, 0xDB6A, 0xF464,
0, 0xDB6B, 0xDB6C, 0xDB6D, 0, 0x6A38, 0x6A3C, 0x6A37,
@@ -5319,6 +9998,16 @@ static const unsigned short utf8_to_euc_E8A0[] = {
0xDB7C, 0x6A43, 0xDB7D, 0, 0, 0xDB7E, 0x6A44, 0,
0, 0x6A45, 0xDC21, 0x6A47, 0xDC22, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E8A0_x0213[] = {
+ 0, 0xF77A, 0, 0xF77B, 0, 0x6A24, 0x7B63, 0xF464,
+ 0, 0xDB6B, 0x7B64, 0xF77C, 0, 0x6A38, 0x6A3C, 0x6A37,
+ 0x7B65, 0x6A3E, 0xDB70, 0xF77D, 0x7B66, 0x6A40, 0x6A3F, 0,
+ 0xDB73, 0xDB6F, 0xDB74, 0xDB75, 0xDB76, 0, 0xDB77, 0x7B67,
+ 0, 0x6A42, 0x6A41, 0x695A, 0, 0, 0, 0x6A46,
+ 0xF77E, 0, 0, 0, 0, 0xDB7A, 0xF821, 0,
+ 0xDB7C, 0x6A43, 0xF822, 0, 0, 0xDB7E, 0x6A44, 0,
+ 0, 0x6A45, 0xDC21, 0x6A47, 0xF823, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E8A1[] = {
0x376C, 0xDC23, 0x6A49, 0xDC24, 0x6A48, 0xDC25, 0x3D30, 0,
0xDC26, 0xDC27, 0xDC28, 0xDC29, 0x3954, 0x5E27, 0xDC2A, 0,
@@ -5329,6 +10018,16 @@ static const unsigned short utf8_to_euc_E8A1[] = {
0x3F6A, 0xDC35, 0x6A55, 0, 0, 0x6A52, 0, 0x436F,
0, 0xDC36, 0, 0xDC37, 0, 0x6A53, 0x6A50, 0x365E,
};
+static const unsigned short utf8_to_euc_E8A1_x0213[] = {
+ 0x376C, 0xDC23, 0x6A49, 0xDC24, 0x6A48, 0xDC25, 0x3D30, 0,
+ 0xDC26, 0xDC27, 0xF825, 0xDC29, 0x3954, 0x5E27, 0xDC2A, 0,
+ 0, 0xDC2B, 0x6A4A, 0x3D51, 0, 0xDC2C, 0xDC2D, 0x3339,
+ 0xF826, 0x6A4B, 0xDC2F, 0x3152, 0xDC30, 0x3E57, 0x6A4C, 0xF827,
+ 0xDC32, 0x3955, 0x6A4D, 0x3061, 0xF828, 0, 0, 0,
+ 0x493D, 0xF82B, 0, 0x6A4E, 0, 0, 0, 0xF82D,
+ 0x3F6A, 0xDC35, 0x6A55, 0, 0, 0x6A52, 0, 0x436F,
+ 0, 0xDC36, 0, 0xDC37, 0, 0x6A53, 0x6A50, 0x365E,
+};
static const unsigned short utf8_to_euc_E8A2[] = {
0xDC38, 0x6A4F, 0x6A56, 0, 0, 0, 0, 0,
0x3736, 0, 0, 0x425E, 0, 0x6A5C, 0, 0,
@@ -5339,6 +10038,16 @@ static const unsigned short utf8_to_euc_E8A2[] = {
0x6A5E, 0x6A60, 0, 0, 0x3853, 0x6A54, 0, 0x3041,
0, 0, 0xDC41, 0, 0, 0xDC42, 0xDC43, 0x6A5F,
};
+static const unsigned short utf8_to_euc_E8A2_x0213[] = {
+ 0xDC38, 0x6A4F, 0x6A56, 0, 0, 0, 0, 0,
+ 0x3736, 0, 0, 0x425E, 0, 0x6A5C, 0, 0,
+ 0, 0, 0x6A58, 0, 0, 0, 0x4235, 0x6A57,
+ 0x7B68, 0x6A5A, 0xDC3A, 0xDC3B, 0xDC3C, 0, 0x6A51, 0xDC3D,
+ 0xF82E, 0, 0x6A5B, 0, 0x6A5D, 0, 0, 0,
+ 0xDC3F, 0, 0x7B69, 0x486F, 0, 0, 0x6A59, 0,
+ 0x6A5E, 0x6A60, 0, 0, 0x3853, 0x6A54, 0, 0x3041,
+ 0, 0, 0xDC41, 0, 0xF82F, 0xF830, 0xF831, 0x6A5F,
+};
static const unsigned short utf8_to_euc_E8A3[] = {
0xDC44, 0x3A5B, 0x4E76, 0x6A61, 0x6A62, 0x4175, 0, 0,
0, 0, 0xDC45, 0xDC46, 0xDC47, 0xDC48, 0xDC49, 0x4E22,
@@ -5349,6 +10058,16 @@ static const unsigned short utf8_to_euc_E8A3[] = {
0xDC51, 0xDC52, 0x6A6C, 0x3E58, 0x6A6A, 0xDC53, 0, 0xDC54,
0x4D67, 0x6A67, 0, 0, 0x6A69, 0x403D, 0x3F7E, 0,
};
+static const unsigned short utf8_to_euc_E8A3_x0213[] = {
+ 0xF832, 0x3A5B, 0x4E76, 0x6A61, 0x6A62, 0x4175, 0, 0,
+ 0, 0, 0x7B6A, 0xDC46, 0xDC47, 0xDC48, 0x7B6B, 0x4E22,
+ 0, 0xF835, 0xF833, 0xF836, 0x6A63, 0x4D35, 0, 0,
+ 0x6A64, 0x6A65, 0, 0xF837, 0x4A64, 0x6A66, 0xDC4E, 0x3A40,
+ 0, 0x4E23, 0, 0, 0, 0, 0, 0xDC4F,
+ 0x6A6B, 0, 0, 0, 0, 0, 0, 0xDC50,
+ 0xF838, 0xF839, 0x6A6C, 0x3E58, 0x6A6A, 0x7B6D, 0, 0xDC54,
+ 0x4D67, 0x6A67, 0, 0, 0x6A69, 0x403D, 0x3F7E, 0,
+};
static const unsigned short utf8_to_euc_E8A4[] = {
0, 0xDC55, 0x6A68, 0, 0x6A6D, 0, 0xDC56, 0x4A23,
0, 0, 0x6A6F, 0, 0x6A6E, 0xDC57, 0xDC58, 0xDC59,
@@ -5359,6 +10078,16 @@ static const unsigned short utf8_to_euc_E8A4[] = {
0xDC64, 0xDC65, 0xDC66, 0, 0, 0xDC67, 0x6A79, 0,
0x6A7A, 0xDC68, 0xDC69, 0x6A78, 0, 0, 0xDC6A, 0,
};
+static const unsigned short utf8_to_euc_E8A4_x0213[] = {
+ 0, 0xF83B, 0x6A68, 0, 0x6A6D, 0, 0xDC56, 0x4A23,
+ 0, 0, 0x6A6F, 0, 0x6A6E, 0xDC57, 0xDC58, 0xDC59,
+ 0x336C, 0, 0x4B2B, 0x6A70, 0, 0xDC5A, 0xDC5B, 0,
+ 0x7B70, 0x7B71, 0x7B72, 0, 0x7B6E, 0x6A7C, 0x6A72, 0,
+ 0xDC60, 0, 0, 0, 0, 0x6A73, 0xDC61, 0x7B73,
+ 0xDC63, 0, 0x6A74, 0x6A75, 0, 0, 0, 0,
+ 0x7B74, 0xDC65, 0x7B75, 0, 0, 0xDC67, 0x6A79, 0xF83D,
+ 0x6A7A, 0x7B76, 0xDC69, 0x6A78, 0, 0, 0xDC6A, 0,
+};
static const unsigned short utf8_to_euc_E8A5[] = {
0xDC6B, 0x6A76, 0xDC6C, 0x6A71, 0x6A77, 0xDC6D, 0xDC6E, 0,
0, 0xDC6F, 0, 0, 0x6A7B, 0x7037, 0, 0xDC70,
@@ -5369,6 +10098,16 @@ static const unsigned short utf8_to_euc_E8A5[] = {
0xDC7B, 0, 0x3D31, 0xDC7C, 0x6B26, 0xDC7D, 0, 0x6B27,
0, 0, 0xDC7E, 0xDD21, 0xDD22, 0xDD23, 0x6B28, 0x403E,
};
+static const unsigned short utf8_to_euc_E8A5_x0213[] = {
+ 0x7B77, 0x6A76, 0xF83F, 0x6A71, 0x6A77, 0xF840, 0xDC6E, 0,
+ 0, 0xF841, 0, 0, 0x6A7B, 0x7037, 0, 0xDC70,
+ 0, 0, 0xDC71, 0, 0, 0, 0x3228, 0xDC72,
+ 0, 0, 0xDC73, 0xDC74, 0xDC75, 0, 0x6A7E, 0x365F,
+ 0x6A7D, 0xDC76, 0xF844, 0xDC78, 0x6B22, 0, 0x6B21, 0,
+ 0, 0, 0x6B24, 0xDC79, 0, 0x6B23, 0xDC7A, 0x6B25,
+ 0xDC7B, 0, 0x3D31, 0xDC7C, 0x6B26, 0xDC7D, 0, 0x6B27,
+ 0, 0, 0xDC7E, 0xDD21, 0xDD22, 0xDD23, 0x6B28, 0x403E,
+};
static const unsigned short utf8_to_euc_E8A6[] = {
0, 0x4D57, 0, 0x6B29, 0, 0, 0x4A24, 0x4746,
0x6B2A, 0xDD24, 0x6B2B, 0x382B, 0, 0xDD25, 0, 0x352C,
@@ -5379,6 +10118,16 @@ static const unsigned short utf8_to_euc_E8A6[] = {
0xDD2E, 0, 0x6B33, 0x3451, 0xDD2F, 0xDD30, 0xDD31, 0xDD32,
0, 0, 0x6B34, 0, 0xDD33, 0x6B35, 0, 0x6B36,
};
+static const unsigned short utf8_to_euc_E8A6_x0213[] = {
+ 0xF845, 0x4D57, 0, 0x6B29, 0, 0, 0x4A24, 0x4746,
+ 0x6B2A, 0xF846, 0x6B2B, 0x382B, 0, 0xDD25, 0, 0x352C,
+ 0xF847, 0, 0, 0x6B2C, 0x7B78, 0xDD28, 0x3B6B, 0x4741,
+ 0x6B2D, 0, 0x3350, 0xDD29, 0xDD2A, 0, 0, 0xF848,
+ 0xDD2C, 0x6B2E, 0, 0, 0, 0xDD2D, 0x6B30, 0x4D77,
+ 0, 0x6B2F, 0x3F46, 0, 0x6B31, 0, 0, 0x6B32,
+ 0xF849, 0, 0x6B33, 0x3451, 0xDD2F, 0xDD30, 0xDD31, 0xF84A,
+ 0, 0, 0x6B34, 0, 0xDD33, 0x6B35, 0, 0x6B36,
+};
static const unsigned short utf8_to_euc_E8A7[] = {
0x6B37, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -5389,6 +10138,16 @@ static const unsigned short utf8_to_euc_E8A7[] = {
0, 0xDD3D, 0, 0xDD3E, 0x6B3C, 0, 0xDD3F, 0,
0x6B3D, 0xDD40, 0, 0, 0, 0xDD41, 0, 0xDD42,
};
+static const unsigned short utf8_to_euc_E8A7_x0213[] = {
+ 0x6B37, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0x3351, 0, 0x7B7A, 0xDD35, 0xF84B, 0xDD37,
+ 0xF84C, 0, 0x6B38, 0, 0x6B39, 0x6B3A, 0, 0,
+ 0, 0, 0, 0x3272, 0, 0x7B7B, 0x3F28, 0x6B3B,
+ 0, 0xDD3A, 0, 0xF84D, 0, 0xDD3C, 0, 0,
+ 0, 0xF84F, 0, 0xF850, 0x6B3C, 0, 0x7B7C, 0,
+ 0x6B3D, 0xDD40, 0, 0, 0, 0xF851, 0, 0xF852,
+};
static const unsigned short utf8_to_euc_E8A8[] = {
0x3840, 0, 0x447B, 0x6B3E, 0xDD43, 0xDD44, 0, 0xDD45,
0x3757, 0, 0x3F56, 0, 0x6B41, 0, 0x4624, 0xDD46,
@@ -5399,6 +10158,16 @@ static const unsigned short utf8_to_euc_E8A8[] = {
0, 0x3576, 0, 0x4C75, 0x414A, 0xDD53, 0x6B45, 0xDD54,
0, 0, 0x3F47, 0x4370, 0x3E5A, 0xDD55, 0xDD56, 0,
};
+static const unsigned short utf8_to_euc_E8A8_x0213[] = {
+ 0x3840, 0, 0x447B, 0x6B3E, 0xDD43, 0xDD44, 0, 0xDD45,
+ 0x3757, 0, 0x3F56, 0, 0x6B41, 0, 0x4624, 0xDD46,
+ 0x6B40, 0xF854, 0x7B7D, 0x3731, 0xF855, 0x7B7E, 0x6B3F, 0x4277,
+ 0x352D, 0, 0, 0x6B42, 0, 0x6B43, 0xDD4B, 0x3E59,
+ 0xDD4C, 0xF857, 0x7C21, 0x376D, 0xDD4E, 0x6B44, 0xDD4F, 0,
+ 0, 0, 0x4B2C, 0xDD50, 0xDD51, 0x405F, 0, 0xDD52,
+ 0, 0x3576, 0, 0x4C75, 0x414A, 0xF858, 0x6B45, 0x7C22,
+ 0, 0, 0x3F47, 0x4370, 0x3E5A, 0xDD55, 0xF859, 0,
+};
static const unsigned short utf8_to_euc_E8A9[] = {
0xDD57, 0x6B46, 0, 0xDD58, 0, 0xDD59, 0x6B49, 0xDD5A,
0x6B4A, 0xDD5B, 0, 0, 0, 0xDD5C, 0xDD5D, 0,
@@ -5409,6 +10178,16 @@ static const unsigned short utf8_to_euc_E8A9[] = {
0x354D, 0x4F43, 0x333A, 0x3E5C, 0, 0xDD67, 0xDD68, 0xDD69,
0, 0xDD6A, 0xDD6B, 0xDD6C, 0x6B4B, 0, 0xDD6D, 0xDD6E,
};
+static const unsigned short utf8_to_euc_E8A9_x0213[] = {
+ 0xDD57, 0x6B46, 0, 0xDD58, 0, 0xF85A, 0x6B49, 0x7C23,
+ 0x6B4A, 0xDD5B, 0, 0, 0, 0xF85B, 0x7C24, 0,
+ 0x3A3E, 0x4242, 0x6B48, 0xDD5E, 0x3E5B, 0x493E, 0xDD5F, 0xDD60,
+ 0xF85C, 0, 0, 0x6B47, 0xDD62, 0x7C25, 0x3B6C, 0,
+ 0x3153, 0x7C26, 0x6B4E, 0x3758, 0, 0xDD65, 0x3B6E, 0xDD66,
+ 0, 0x3B6D, 0, 0x4F4D, 0x6B4D, 0x6B4C, 0x4127, 0,
+ 0x354D, 0x4F43, 0x333A, 0x3E5C, 0, 0x7C27, 0xDD68, 0xDD69,
+ 0, 0x7C28, 0xDD6B, 0xDD6C, 0x6B4B, 0, 0xDD6D, 0xDD6E,
+};
static const unsigned short utf8_to_euc_E8AA[] = {
0xDD6F, 0, 0x6B50, 0xDD70, 0x6B51, 0x6B4F, 0xDD71, 0x3858,
0, 0x4D40, 0, 0xDD72, 0x3B6F, 0x4727, 0, 0xDD73,
@@ -5419,6 +10198,16 @@ static const unsigned short utf8_to_euc_E8AA[] = {
0x432F, 0, 0x325D, 0xDD7E, 0, 0, 0xDE21, 0xDE22,
0, 0x4870, 0, 0xDE23, 0x3543, 0, 0xDE24, 0x4434,
};
+static const unsigned short utf8_to_euc_E8AA_x0213[] = {
+ 0xDD6F, 0, 0x6B50, 0xDD70, 0x6B51, 0x6B4F, 0xDD71, 0x3858,
+ 0, 0x4D40, 0, 0xDD72, 0x3B6F, 0x4727, 0, 0xDD73,
+ 0xF85E, 0x6B54, 0xDD75, 0x4040, 0, 0x4342, 0xDD76, 0xDD77,
+ 0x4D36, 0xDD78, 0x6B57, 0, 0, 0, 0x386C, 0xDD79,
+ 0x403F, 0x6B53, 0, 0x6B58, 0x386D, 0x6B55, 0x6B56, 0x7C29,
+ 0x6B52, 0xDD7B, 0, 0, 0x4062, 0x4649, 0xF85D, 0xDD7D,
+ 0x432F, 0, 0x325D, 0xDD7E, 0, 0, 0xDE21, 0xF85F,
+ 0, 0x4870, 0, 0xDE23, 0x3543, 0, 0xF860, 0x4434,
+};
static const unsigned short utf8_to_euc_E8AB[] = {
0, 0, 0x6B5B, 0xDE25, 0x6B59, 0, 0xDE26, 0x434C,
0xDE27, 0xDE28, 0xDE29, 0x4041, 0x3452, 0x6B5A, 0, 0x3F5B,
@@ -5429,6 +10218,16 @@ static const unsigned short utf8_to_euc_E8AB[] = {
0xDE32, 0x6B61, 0, 0x6B5E, 0xDE33, 0xDE34, 0xDE35, 0x6B65,
0x3D74, 0, 0x3841, 0, 0xDE36, 0, 0x427A, 0xDE37,
};
+static const unsigned short utf8_to_euc_E8AB_x0213[] = {
+ 0, 0, 0x6B5B, 0xDE25, 0x6B59, 0, 0xDE26, 0x434C,
+ 0xDE27, 0xDE28, 0xDE29, 0x4041, 0x3452, 0x6B5A, 0, 0x3F5B,
+ 0x7C2A, 0xDE2A, 0x4E4A, 0xDE2B, 0xDE2C, 0xDE2D, 0x4F40, 0xF861,
+ 0, 0, 0x6B5C, 0x6B67, 0x4435, 0xDE2F, 0x6B66, 0x7C2B,
+ 0x6B63, 0x6B6B, 0x6B64, 0, 0x6B60, 0, 0x447C, 0x6B5F,
+ 0, 0, 0, 0x6B5D, 0xDE31, 0x4D21, 0x3B70, 0,
+ 0xDE32, 0x6B61, 0, 0x6B5E, 0x7C2C, 0xDE34, 0x7C2D, 0x6B65,
+ 0x3D74, 0, 0x3841, 0, 0xF862, 0, 0x427A, 0xDE37,
+};
static const unsigned short utf8_to_euc_E8AC[] = {
0x4B45, 0x315A, 0x3062, 0, 0x4625, 0xDE38, 0xDE39, 0x6B69,
0, 0, 0xDE3F, 0xDE3A, 0x6B68, 0, 0x4666, 0,
@@ -5439,6 +10238,16 @@ static const unsigned short utf8_to_euc_E8AC[] = {
0xDE41, 0, 0, 0x6B70, 0, 0, 0, 0xDE42,
0, 0x3660, 0, 0, 0xDE43, 0, 0x6B74, 0,
};
+static const unsigned short utf8_to_euc_E8AC_x0213[] = {
+ 0x4B45, 0x315A, 0x3062, 0, 0x4625, 0xF865, 0xDE39, 0x6B69,
+ 0, 0, 0xF864, 0xDE3A, 0x6B68, 0xF866, 0x4666, 0,
+ 0x6B6D, 0xDE3B, 0, 0, 0x6B62, 0, 0x6B6C, 0x6B6E,
+ 0, 0x382C, 0x6B6A, 0x3956, 0xF867, 0x3C55, 0xDE3D, 0xF868,
+ 0x6B6F, 0x4D58, 0, 0, 0, 0, 0x6B72, 0,
+ 0x6B75, 0, 0, 0x6B73, 0x4935, 0xF869, 0, 0,
+ 0xDE41, 0, 0, 0x6B70, 0, 0, 0, 0xDE42,
+ 0, 0x3660, 0, 0, 0xDE43, 0, 0x6B74, 0,
+};
static const unsigned short utf8_to_euc_E8AD[] = {
0, 0x6B76, 0xDE44, 0xDE45, 0xDE46, 0xDE47, 0xDE48, 0,
0xDE49, 0x6B7A, 0, 0, 0x6B77, 0xDE4E, 0x6B79, 0x6B78,
@@ -5449,6 +10258,16 @@ static const unsigned short utf8_to_euc_E8AD[] = {
0x3544, 0x6641, 0x3E79, 0, 0x6C24, 0, 0xDE52, 0x386E,
0xDE53, 0xDE54, 0, 0, 0xDE55, 0x6C25, 0xDE56, 0xF466,
};
+static const unsigned short utf8_to_euc_E8AD_x0213[] = {
+ 0, 0x6B76, 0xDE44, 0xF86A, 0xDE46, 0xDE47, 0x7C31, 0,
+ 0xDE49, 0x6B7A, 0, 0, 0x6B77, 0xDE4E, 0x6B79, 0x6B78,
+ 0, 0xF86C, 0xDE4A, 0xDE4B, 0x7C32, 0, 0x6B7B, 0,
+ 0x3C31, 0x7C33, 0x6B7D, 0x6B7C, 0x4968, 0, 0xF86D, 0x6C21,
+ 0, 0, 0, 0xDE50, 0, 0, 0x3759, 0,
+ 0, 0x7C34, 0, 0x6B7E, 0x6C22, 0xDE51, 0, 0x6C23,
+ 0x3544, 0x6641, 0x3E79, 0, 0x6C24, 0, 0xF86E, 0x386E,
+ 0xDE53, 0xDE54, 0, 0, 0xDE55, 0x6C25, 0xDE56, 0xF86F,
+};
static const unsigned short utf8_to_euc_E8AE[] = {
0x6C26, 0xDE57, 0, 0x3B3E, 0xDE58, 0xDE59, 0, 0,
0, 0, 0x5A4E, 0xDE5A, 0x6C27, 0xDE5B, 0x6C28, 0xDE5C,
@@ -5459,6 +10278,16 @@ static const unsigned short utf8_to_euc_E8AE[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E8AE_x0213[] = {
+ 0x6C26, 0xF870, 0, 0x3B3E, 0xDE58, 0xDE59, 0, 0,
+ 0, 0, 0x5A4E, 0xF871, 0x6C27, 0xDE5B, 0x6C28, 0xDE5C,
+ 0x3D32, 0, 0x6C29, 0x6C2A, 0xF872, 0xF873, 0x6C2B, 0,
+ 0, 0x6C2C, 0x6C2D, 0, 0xF874, 0x7C35, 0xF875, 0xDE61,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E8B0[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -5469,6 +10298,16 @@ static const unsigned short utf8_to_euc_E8B0[] = {
0, 0, 0, 0, 0, 0, 0, 0x432B,
0xDE62, 0xDE63, 0x6C2E, 0, 0, 0xDE64, 0xDE65, 0x6C30,
};
+static const unsigned short utf8_to_euc_E8B0_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0x432B,
+ 0xDE62, 0xF876, 0x6C2E, 0, 0, 0xF878, 0xDE65, 0x6C30,
+};
static const unsigned short utf8_to_euc_E8B1[] = {
0, 0x6C2F, 0, 0, 0, 0xDE66, 0x4626, 0xDE67,
0x6C31, 0xDE68, 0x4B2D, 0xDE69, 0x6C32, 0, 0x6C33, 0xDE6A,
@@ -5479,6 +10318,16 @@ static const unsigned short utf8_to_euc_E8B1[] = {
0, 0, 0, 0xDE79, 0, 0xDE7A, 0xDE7B, 0,
0x6C38, 0x493F, 0x6C39, 0xDE7C, 0x6C41, 0, 0xDE7D, 0,
};
+static const unsigned short utf8_to_euc_E8B1_x0213[] = {
+ 0, 0x6C2F, 0, 0, 0, 0xF87B, 0x4626, 0xF87C,
+ 0x6C31, 0x7C36, 0x4B2D, 0xDE69, 0x6C32, 0, 0x6C33, 0xF87D,
+ 0x6C34, 0xDE6B, 0, 0xDE6C, 0xF87E, 0x6C35, 0, 0xF921,
+ 0xDE6F, 0xDE72, 0x465A, 0xDE70, 0, 0xDE71, 0, 0,
+ 0, 0x3E5D, 0x6C36, 0xDE73, 0xDE74, 0, 0xDE75, 0,
+ 0x7C37, 0xF922, 0x396B, 0x502E, 0x6C37, 0xF923, 0, 0,
+ 0, 0, 0, 0xF924, 0, 0xDE7A, 0xDE7B, 0,
+ 0x6C38, 0x493F, 0x6C39, 0xDE7C, 0x6C41, 0, 0xDE7D, 0,
+};
static const unsigned short utf8_to_euc_E8B2[] = {
0, 0, 0x6C3A, 0, 0, 0x6C3C, 0xDE7E, 0xDF21,
0, 0x6C3B, 0x6C3D, 0xDF22, 0x4B46, 0x6C3E, 0x6C3F, 0,
@@ -5489,6 +10338,16 @@ static const unsigned short utf8_to_euc_E8B2[] = {
0x4C63, 0, 0x6C47, 0x6C48, 0x352E, 0, 0x6C4A, 0x4763,
0x425F, 0xDF2A, 0xDF2B, 0x4871, 0x453D, 0x6C46, 0, 0x4B47,
};
+static const unsigned short utf8_to_euc_E8B2_x0213[] = {
+ 0, 0, 0x6C3A, 0, 0, 0x6C3C, 0xDE7E, 0xDF21,
+ 0, 0x6C3B, 0x6C3D, 0xDF22, 0x4B46, 0x6C3E, 0x6C3F, 0,
+ 0xDF23, 0, 0xF927, 0xF926, 0x6C40, 0, 0, 0,
+ 0x6C42, 0xF928, 0, 0xF92A, 0xDF28, 0x332D, 0x4467, 0,
+ 0x4969, 0x3A62, 0x3957, 0, 0xF92B, 0, 0, 0x494F,
+ 0x325F, 0x484E, 0x6C45, 0x3453, 0x4055, 0x6C44, 0x6C49, 0x4379,
+ 0x4C63, 0, 0x6C47, 0x6C48, 0x352E, 0, 0x6C4A, 0x4763,
+ 0x425F, 0xDF2A, 0xDF2B, 0x4871, 0x453D, 0x6C46, 0, 0x4B47,
+};
static const unsigned short utf8_to_euc_E8B3[] = {
0x326C, 0x6C4C, 0x4F28, 0x4442, 0x4F45, 0xDF2C, 0xDF2D, 0x3B71,
0x6C4B, 0xDF2E, 0x4231, 0xDF2F, 0, 0x6C5C, 0x4128, 0xDF30,
@@ -5499,6 +10358,16 @@ static const unsigned short utf8_to_euc_E8B3[] = {
0xDF39, 0, 0xDF3A, 0, 0xF467, 0xDF3B, 0, 0xDF3C,
0xDF3D, 0, 0x6C51, 0x6C52, 0x3958, 0x6C50, 0xDF3E, 0xDF3F,
};
+static const unsigned short utf8_to_euc_E8B3_x0213[] = {
+ 0x326C, 0x6C4C, 0x4F28, 0x4442, 0x4F45, 0xDF2C, 0xDF2D, 0x3B71,
+ 0x6C4B, 0xDF2E, 0x4231, 0xDF2F, 0, 0x6C5C, 0x4128, 0xDF30,
+ 0, 0x4678, 0, 0x4950, 0, 0xF92D, 0xF92C, 0,
+ 0, 0xF92E, 0x6C4F, 0x3B3F, 0x3B72, 0xDF34, 0x3E5E, 0,
+ 0x4765, 0x7C39, 0x382D, 0x6C4E, 0x6C4D, 0, 0x496A, 0,
+ 0xDF36, 0, 0x3C41, 0, 0xDF37, 0x4552, 0, 0xDF38,
+ 0xF930, 0xF931, 0xDF3A, 0, 0x7C3A, 0xDF3B, 0, 0xDF3C,
+ 0x7C3B, 0, 0x6C51, 0x6C52, 0x3958, 0x6C50, 0x7C3C, 0xDF3F,
+};
static const unsigned short utf8_to_euc_E8B4[] = {
0, 0xDF40, 0, 0xDF41, 0x6C53, 0x6C54, 0, 0x6C56,
0x4223, 0xDF42, 0x6C55, 0x3466, 0, 0x6C58, 0, 0x6C57,
@@ -5509,6 +10378,16 @@ static const unsigned short utf8_to_euc_E8B4[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E8B4_x0213[] = {
+ 0, 0xDF40, 0, 0xDF41, 0x6C53, 0x6C54, 0, 0x6C56,
+ 0x4223, 0xF933, 0x6C55, 0x3466, 0, 0x6C58, 0xF934, 0x6C57,
+ 0x6C59, 0, 0x7C3E, 0x6C5B, 0x6C5D, 0, 0x6C5E, 0xDF44,
+ 0, 0, 0, 0x7C3F, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E8B5[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -5519,6 +10398,16 @@ static const unsigned short utf8_to_euc_E8B5[] = {
0x4176, 0x6C61, 0, 0x6C62, 0x496B, 0, 0xF468, 0x352F,
0, 0, 0, 0, 0, 0, 0, 0xDF4A,
};
+static const unsigned short utf8_to_euc_E8B5_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0x4056, 0xDF46, 0x3C4F, 0x6C5F,
+ 0, 0xDF47, 0, 0x3352, 0xF935, 0x6C60, 0xDF49, 0,
+ 0x4176, 0x6C61, 0, 0x6C62, 0x496B, 0, 0xF468, 0x352F,
+ 0, 0, 0, 0, 0, 0, 0, 0xDF4A,
+};
static const unsigned short utf8_to_euc_E8B6[] = {
0, 0x6C63, 0xDF4B, 0, 0xDF4C, 0x4436, 0, 0,
0xDF4D, 0, 0x315B, 0, 0, 0xDF4E, 0, 0,
@@ -5529,6 +10418,16 @@ static const unsigned short utf8_to_euc_E8B6[] = {
0, 0, 0xDF59, 0x422D, 0, 0xDF5A, 0, 0xDF5B,
0, 0xDF5C, 0x6C67, 0xDF5D, 0xDF6F, 0, 0x6C66, 0,
};
+static const unsigned short utf8_to_euc_E8B6_x0213[] = {
+ 0, 0x6C63, 0xDF4B, 0, 0xF936, 0x4436, 0, 0,
+ 0xDF4D, 0, 0x315B, 0, 0, 0xDF4E, 0, 0,
+ 0xDF4F, 0xDF50, 0, 0, 0, 0xF937, 0, 0,
+ 0, 0x6C64, 0, 0, 0, 0, 0xDF52, 0xDF53,
+ 0xDF54, 0, 0, 0x3C71, 0, 0, 0xF938, 0,
+ 0x3F76, 0, 0, 0xDF56, 0xDF57, 0, 0, 0x7C40,
+ 0, 0, 0xDF59, 0x422D, 0, 0xDF5A, 0, 0xDF5B,
+ 0, 0xDF5C, 0x6C67, 0xDF5D, 0xDF6F, 0, 0x6C66, 0,
+};
static const unsigned short utf8_to_euc_E8B7[] = {
0xDF5E, 0, 0x6C65, 0, 0, 0xDF5F, 0xDF60, 0xDF61,
0xDF62, 0, 0xDF63, 0x6C6D, 0x6C6B, 0, 0xDF64, 0x6C68,
@@ -5539,6 +10438,16 @@ static const unsigned short utf8_to_euc_E8B7[] = {
0xDF6E, 0xDF70, 0xDF71, 0x4437, 0xDF72, 0x4129, 0, 0,
0, 0, 0, 0, 0x6C72, 0xDF73, 0, 0x6C75,
};
+static const unsigned short utf8_to_euc_E8B7_x0213[] = {
+ 0xDF5E, 0, 0x6C65, 0, 0, 0xDF5F, 0xF93A, 0xDF61,
+ 0xF93B, 0, 0xDF63, 0x6C6D, 0x6C6B, 0, 0x7C41, 0x6C68,
+ 0, 0x7C42, 0, 0, 0xDF66, 0xDF67, 0x6C6A, 0x7C43,
+ 0, 0xF93C, 0x6C69, 0x6C6C, 0, 0x3577, 0, 0x6C70,
+ 0, 0x4057, 0, 0x6C71, 0xDF6A, 0xDF6B, 0, 0xDF6C,
+ 0x3859, 0, 0x6C6E, 0x6C6F, 0xF93D, 0, 0, 0x4F29,
+ 0xDF6E, 0xDF70, 0xDF71, 0x4437, 0xDF72, 0x4129, 0, 0,
+ 0, 0, 0, 0, 0x6C72, 0xF940, 0, 0x6C75,
+};
static const unsigned short utf8_to_euc_E8B8[] = {
0, 0xDF74, 0, 0, 0xDF75, 0xDF76, 0xDF77, 0,
0x6C73, 0x6C74, 0x4D59, 0xDF78, 0, 0, 0, 0x4627,
@@ -5549,6 +10458,16 @@ static const unsigned short utf8_to_euc_E8B8[] = {
0x6C7C, 0xE024, 0, 0xE025, 0x6C7D, 0x6C7B, 0xE026, 0xE027,
0xE028, 0xE029, 0, 0, 0, 0xE02A, 0, 0,
};
+static const unsigned short utf8_to_euc_E8B8_x0213[] = {
+ 0, 0xDF74, 0, 0, 0xDF75, 0xDF76, 0xF941, 0,
+ 0x6C73, 0x6C74, 0x4D59, 0xDF78, 0xF93E, 0, 0, 0x4627,
+ 0x6C78, 0xDF79, 0, 0, 0xF943, 0, 0xF944, 0,
+ 0, 0, 0, 0, 0, 0x6C76, 0x6C77, 0x6C79,
+ 0x7C44, 0xF945, 0xF946, 0x7C45, 0, 0, 0xE022, 0xF947,
+ 0, 0, 0x6D29, 0, 0, 0, 0, 0,
+ 0x6C7C, 0xE024, 0, 0xE025, 0x6C7D, 0x6C7B, 0xF94A, 0xE027,
+ 0xE028, 0xF94B, 0, 0, 0, 0x7C46, 0, 0,
+};
static const unsigned short utf8_to_euc_E8B9[] = {
0xE02B, 0xE02C, 0x6C7A, 0, 0x447D, 0, 0, 0x6D21,
0x6D25, 0x6D22, 0x6C7E, 0xE02D, 0x6D23, 0xE02E, 0xE02F, 0xE030,
@@ -5559,6 +10478,16 @@ static const unsigned short utf8_to_euc_E8B9[] = {
0xE03C, 0xE03D, 0x6D2D, 0, 0x3D33, 0, 0x6D2C, 0,
0, 0xE03E, 0xE03F, 0xE040, 0x6D2E, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E8B9_x0213[] = {
+ 0xE02B, 0xE02C, 0x6C7A, 0, 0x447D, 0, 0, 0x6D21,
+ 0x6D25, 0x6D22, 0x6C7E, 0xF94C, 0x6D23, 0xE02E, 0xE02F, 0xE030,
+ 0x6D24, 0, 0, 0, 0xF94D, 0x6D2B, 0, 0,
+ 0, 0x6D26, 0, 0xE032, 0xE033, 0xE034, 0xE035, 0x4058,
+ 0x6D28, 0xE036, 0xF94E, 0x6D2A, 0x6D27, 0, 0, 0,
+ 0, 0xE038, 0, 0, 0xF94F, 0xF950, 0, 0xF951,
+ 0x7C47, 0xE03D, 0x6D2D, 0, 0x3D33, 0, 0x6D2C, 0,
+ 0, 0xE03E, 0xE03F, 0x7C48, 0x6D2E, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E8BA[] = {
0, 0x6D2F, 0xE041, 0xE042, 0x6D32, 0x6D31, 0, 0x6D30,
0, 0xE043, 0x6D34, 0x6D33, 0, 0x4C76, 0, 0,
@@ -5569,6 +10498,16 @@ static const unsigned short utf8_to_euc_E8BA[] = {
0x6D3C, 0x6D3E, 0, 0xE050, 0, 0xE051, 0, 0,
0, 0, 0xE052, 0xE053, 0, 0, 0x6D3F, 0,
};
+static const unsigned short utf8_to_euc_E8BA_x0213[] = {
+ 0, 0x6D2F, 0xE041, 0xE042, 0x6D32, 0x6D31, 0, 0x6D30,
+ 0, 0xE043, 0x6D34, 0x6D33, 0, 0x4C76, 0, 0,
+ 0xE044, 0x6D36, 0xE045, 0x6D35, 0x6D37, 0xE046, 0, 0,
+ 0xF952, 0x6D38, 0xE047, 0xE048, 0, 0xE049, 0xF953, 0,
+ 0, 0x6D3A, 0xE04B, 0, 0, 0, 0, 0xE04C,
+ 0, 0xE04D, 0x6D39, 0x3F48, 0x6D3B, 0xE04E, 0xF954, 0x366D,
+ 0x6D3C, 0x6D3E, 0, 0xF955, 0, 0xF956, 0xF957, 0,
+ 0, 0, 0xE052, 0xF958, 0, 0, 0x6D3F, 0,
+};
static const unsigned short utf8_to_euc_E8BB[] = {
0xE054, 0xE055, 0, 0xE056, 0xE057, 0x6D40, 0x6D3D, 0xE058,
0x6D41, 0, 0x3C56, 0x6D42, 0x3530, 0x3733, 0, 0xE059,
@@ -5579,6 +10518,16 @@ static const unsigned short utf8_to_euc_E8BB[] = {
0xE05F, 0xE060, 0, 0, 0, 0, 0, 0xE061,
0x3C34, 0xE062, 0xE063, 0x6D46, 0x6D45, 0x375A, 0x6D48, 0,
};
+static const unsigned short utf8_to_euc_E8BB_x0213[] = {
+ 0x7C4A, 0xE055, 0, 0xE056, 0xE057, 0x6D40, 0x6D3D, 0xE058,
+ 0x6D41, 0, 0x3C56, 0x6D42, 0x3530, 0x3733, 0, 0xE059,
+ 0, 0xF95A, 0x382E, 0, 0xF95B, 0, 0, 0,
+ 0, 0, 0, 0x6D43, 0xE05C, 0, 0, 0x4670,
+ 0, 0, 0x453E, 0x6D44, 0, 0, 0, 0,
+ 0xE05D, 0, 0, 0x6D47, 0, 0xE064, 0xE05E, 0,
+ 0xE05F, 0xE060, 0, 0, 0, 0, 0, 0xE061,
+ 0x3C34, 0xF95D, 0x7C4C, 0x6D46, 0x6D45, 0x375A, 0x6D48, 0,
+};
static const unsigned short utf8_to_euc_E8BC[] = {
0xE065, 0, 0xE066, 0x3353, 0, 0x6D4A, 0, 0xE067,
0xE068, 0x3A5C, 0x6D49, 0, 0x6D52, 0, 0, 0xE069,
@@ -5589,6 +10538,16 @@ static const unsigned short utf8_to_euc_E8BC[] = {
0, 0, 0, 0x6D54, 0xE078, 0xE079, 0xE07A, 0xE07B,
0x4D22, 0x6D56, 0xE07C, 0x6D55, 0, 0, 0x6D59, 0x4D41,
};
+static const unsigned short utf8_to_euc_E8BC_x0213[] = {
+ 0xF95F, 0, 0xE066, 0x3353, 0, 0x6D4A, 0, 0xE067,
+ 0xF960, 0x3A5C, 0x6D49, 0, 0x6D52, 0, 0, 0xE069,
+ 0xE06A, 0, 0x6D4C, 0x6D4E, 0x4A65, 0x6D4B, 0xE06B, 0xF961,
+ 0xE06D, 0x6D4D, 0, 0x6D51, 0x6D4F, 0x3531, 0x7C4D, 0x6D50,
+ 0xE06F, 0xE070, 0, 0xE071, 0, 0xE072, 0x6D53, 0xE073,
+ 0xE074, 0x475A, 0x4E58, 0xF962, 0xE075, 0x7C4E, 0xE077, 0x3D34,
+ 0, 0, 0, 0x6D54, 0xE078, 0xE079, 0x7C4F, 0xE07B,
+ 0x4D22, 0x6D56, 0xE07C, 0x6D55, 0, 0, 0x6D59, 0x4D41,
+};
static const unsigned short utf8_to_euc_E8BD[] = {
0xE07D, 0xE07E, 0x6D58, 0xE121, 0x336D, 0x6D57, 0x6D5C, 0xE122,
0, 0x6D5B, 0, 0, 0x6D5A, 0x4532, 0x6D5D, 0xE123,
@@ -5599,6 +10558,16 @@ static const unsigned short utf8_to_euc_E8BD[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E8BD_x0213[] = {
+ 0xF963, 0xE07E, 0x6D58, 0xE121, 0x336D, 0x6D57, 0x6D5C, 0xE122,
+ 0, 0x6D5B, 0xF964, 0, 0x6D5A, 0x4532, 0x6D5D, 0xE123,
+ 0, 0xE124, 0xE125, 0xE126, 0x7C50, 0xE128, 0, 0x6D5E,
+ 0xF965, 0, 0, 0, 0x6D5F, 0xE12A, 0xE12B, 0x396C,
+ 0, 0x3725, 0x6D60, 0x6D61, 0x6D62, 0xE12C, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E8BE[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -5609,6 +10578,16 @@ static const unsigned short utf8_to_euc_E8BE[] = {
0x4324, 0x3F2B, 0x4740, 0, 0, 0xE133, 0xE134, 0x6D68,
0xE135, 0, 0x4A55, 0x4454, 0x397E, 0, 0xE136, 0x4329,
};
+static const unsigned short utf8_to_euc_E8BE_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0x3F49, 0x6D63, 0xE12D, 0x3C2D, 0x6D64,
+ 0xE12E, 0xE12F, 0, 0x6D65, 0xF967, 0xE131, 0x7C52, 0x5221,
+ 0x517E, 0, 0, 0, 0, 0x6D66, 0x6570, 0x6D67,
+ 0x4324, 0x3F2B, 0x4740, 0, 0xF968, 0x7C53, 0xF96A, 0x6D68,
+ 0xE135, 0, 0x4A55, 0x4454, 0x397E, 0, 0xE136, 0x4329,
+};
static const unsigned short utf8_to_euc_E8BF[] = {
0xE137, 0xE138, 0x312A, 0, 0x4B78, 0x3F57, 0xE139, 0,
0, 0, 0xE13A, 0xE13B, 0, 0xE13C, 0x375E, 0,
@@ -5619,6 +10598,16 @@ static const unsigned short utf8_to_euc_E8BF[] = {
0x3D52, 0xE146, 0, 0, 0x6D6F, 0xE147, 0xE148, 0x4C42,
0x6D7E, 0x6D71, 0x6D72, 0xE149, 0, 0x4449, 0xE14A, 0,
};
+static const unsigned short utf8_to_euc_E8BF_x0213[] = {
+ 0xE137, 0xF96C, 0x312A, 0, 0x4B78, 0x3F57, 0xF96D, 0,
+ 0, 0, 0xF96F, 0xE13B, 0, 0xF970, 0x375E, 0,
+ 0xE13D, 0x3661, 0xE13E, 0xF971, 0x4A56, 0xF972, 0, 0,
+ 0, 0, 0x6D69, 0, 0, 0, 0, 0,
+ 0xF973, 0, 0x6D6B, 0xE142, 0x7C54, 0x6D6A, 0x3260, 0,
+ 0x7C55, 0x4676, 0x6D6C, 0x4777, 0, 0x4533, 0x7C56, 0x6D6D,
+ 0x3D52, 0xF974, 0, 0, 0x6D6F, 0xF975, 0xE148, 0x4C42,
+ 0x6D7E, 0x6D71, 0x6D72, 0xF976, 0, 0x4449, 0xE14A, 0,
+};
static const unsigned short utf8_to_euc_E980[] = {
0x4260, 0x4177, 0xE14B, 0x4628, 0xE14C, 0x6D70, 0x3555, 0,
0xE14D, 0, 0, 0x6D79, 0xE14E, 0x6D76, 0x6E25, 0x4629,
@@ -5629,6 +10618,16 @@ static const unsigned short utf8_to_euc_E980[] = {
0, 0x3D35, 0x3F4A, 0xE157, 0xE158, 0x6D7C, 0x6D7B, 0xE159,
0x306F, 0x6D7D, 0, 0, 0x492F, 0, 0x6E27, 0xE15A,
};
+static const unsigned short utf8_to_euc_E980_x0213[] = {
+ 0x4260, 0x4177, 0xF977, 0x4628, 0xE14C, 0x6D70, 0x3555, 0,
+ 0x7C57, 0, 0, 0x6D79, 0xF978, 0x6D76, 0x6E25, 0x4629,
+ 0x4360, 0x6D73, 0, 0x447E, 0x4553, 0x6D74, 0x6D78, 0x3F60,
+ 0xE14F, 0x4767, 0x444C, 0xE150, 0, 0x4042, 0x6D77, 0x422E,
+ 0x4224, 0x6D75, 0x3029, 0x4F22, 0, 0, 0, 0x6D7A,
+ 0xE151, 0xE152, 0xE154, 0, 0xE155, 0x7C58, 0x4261, 0xE153,
+ 0, 0x3D35, 0x3F4A, 0xE157, 0xE158, 0x6D7C, 0x6D7B, 0xF979,
+ 0x306F, 0x6D7D, 0, 0, 0x492F, 0, 0x6E27, 0xE15A,
+};
static const unsigned short utf8_to_euc_E981[] = {
0, 0x465B, 0x3F6B, 0xE15B, 0xE15C, 0x4359, 0, 0x3678,
0, 0x6E26, 0x4D37, 0x313F, 0xE15D, 0x4A57, 0x3261, 0x6E21,
@@ -5639,6 +10638,16 @@ static const unsigned short utf8_to_euc_E981[] = {
0xE164, 0, 0x6E2F, 0, 0xE165, 0x3D65, 0x6E2D, 0x412B,
0x412A, 0xE166, 0x3064, 0, 0x4E4B, 0x6E31, 0, 0x4872,
};
+static const unsigned short utf8_to_euc_E981_x0213[] = {
+ 0, 0x465B, 0x3F6B, 0xF97B, 0xF97C, 0x4359, 0, 0x3678,
+ 0, 0x6E26, 0x4D37, 0x313F, 0xE15D, 0x4A57, 0x3261, 0x6E21,
+ 0x6E22, 0x6E23, 0x6E24, 0x463B, 0x4323, 0x3063, 0x6E28, 0,
+ 0x6E29, 0x7423, 0, 0xE15E, 0x423D, 0xF97D, 0x6E2A, 0,
+ 0x3173, 0x414C, 0xE160, 0x382F, 0, 0x4D5A, 0xE161, 0xE162,
+ 0x6E2B, 0x452C, 0, 0, 0xE163, 0x4178, 0x3C57, 0x6E2C,
+ 0xE164, 0, 0x6E2F, 0, 0xE165, 0x3D65, 0x6E2D, 0x412B,
+ 0x412A, 0xE166, 0x3064, 0, 0x4E4B, 0x6E31, 0, 0x4872,
+};
static const unsigned short utf8_to_euc_E982[] = {
0x6E33, 0x6E32, 0x6E30, 0x6364, 0x3454, 0xE167, 0, 0x6D6E,
0xE168, 0x6E35, 0x6E34, 0xE169, 0xE16A, 0, 0xE16B, 0x6E36,
@@ -5649,6 +10658,16 @@ static const unsigned short utf8_to_euc_E982[] = {
0xE176, 0x6E39, 0xE177, 0xE178, 0xE179, 0x6E3A, 0xE17A, 0,
0x4521, 0, 0, 0, 0, 0xE17B, 0xE17D, 0,
};
+static const unsigned short utf8_to_euc_E982_x0213[] = {
+ 0x6E33, 0x6E32, 0x6E30, 0x6364, 0x3454, 0xFA22, 0, 0x6D6E,
+ 0x7C5A, 0x6E35, 0x6E34, 0xE169, 0xFA23, 0, 0xE16B, 0x6E36,
+ 0xFA24, 0x4D38, 0, 0, 0, 0x7C5B, 0, 0x7C5C,
+ 0xE16F, 0x7C5D, 0, 0x7C5E, 0, 0, 0, 0,
+ 0xE172, 0xFA26, 0x7C5F, 0x4661, 0, 0xE175, 0x4B2E, 0,
+ 0x6E37, 0, 0x3C59, 0, 0, 0, 0, 0x6E38,
+ 0xFA28, 0x6E39, 0xE177, 0x7C60, 0xE179, 0x6E3A, 0xFA29, 0,
+ 0x4521, 0, 0, 0, 0, 0xE17B, 0x7C61, 0,
+};
static const unsigned short utf8_to_euc_E983[] = {
0, 0x306A, 0, 0xE17E, 0xE221, 0xE222, 0, 0xE223,
0xE224, 0, 0x3959, 0, 0xE17C, 0, 0x4F3A, 0,
@@ -5659,6 +10678,16 @@ static const unsigned short utf8_to_euc_E983[] = {
0xE231, 0, 0, 0, 0xE232, 0x4D39, 0xE22E, 0x363F,
0, 0, 0, 0, 0, 0x4554, 0xE233, 0xE234,
};
+static const unsigned short utf8_to_euc_E983_x0213[] = {
+ 0, 0x306A, 0, 0xFA2A, 0x7C62, 0x7C63, 0, 0x7C64,
+ 0xFA2B, 0, 0x3959, 0, 0xE17C, 0, 0x4F3A, 0,
+ 0, 0, 0xE22D, 0, 0, 0xE225, 0, 0x7C65,
+ 0xE227, 0xE228, 0, 0x6E3E, 0xFA2D, 0x7C66, 0x7C67, 0xFA2E,
+ 0, 0x3734, 0x6E3B, 0, 0x6E3C, 0xE22C, 0, 0,
+ 0x4974, 0, 0, 0xFA33, 0, 0x3354, 0, 0x7C68,
+ 0xE231, 0, 0xFA31, 0, 0x7C69, 0x4D39, 0xFA30, 0x363F,
+ 0, 0, 0, 0, 0, 0x4554, 0xFA34, 0xFA35,
+};
static const unsigned short utf8_to_euc_E984[] = {
0xE235, 0, 0x6E3F, 0, 0xE236, 0xE237, 0xE238, 0,
0xE239, 0, 0, 0, 0, 0xE23A, 0, 0,
@@ -5669,6 +10698,16 @@ static const unsigned short utf8_to_euc_E984[] = {
0x6E43, 0xE24B, 0x6E42, 0, 0xE24C, 0, 0xE24D, 0xE24E,
0, 0xE24F, 0xE250, 0, 0xE251, 0xE252, 0, 0,
};
+static const unsigned short utf8_to_euc_E984_x0213[] = {
+ 0xFA32, 0, 0x6E3F, 0, 0xFA36, 0xE237, 0xFA37, 0,
+ 0xE239, 0, 0, 0, 0, 0xE23A, 0, 0,
+ 0xE23B, 0, 0x6E40, 0, 0x7C6B, 0x7C6C, 0x7C6D, 0xE23E,
+ 0xFA38, 0x6E41, 0xE240, 0, 0xFA39, 0, 0xFA3A, 0,
+ 0xE243, 0, 0x7C6E, 0x7C6F, 0, 0xE244, 0, 0x7C70,
+ 0, 0xE248, 0, 0, 0, 0x4522, 0xE249, 0x7C71,
+ 0x6E43, 0x7C72, 0x6E42, 0, 0x7C73, 0, 0xE24D, 0xFA3B,
+ 0, 0xFA3C, 0xFA3D, 0, 0xE251, 0x7C74, 0, 0,
+};
static const unsigned short utf8_to_euc_E985[] = {
0, 0, 0, 0xE253, 0, 0, 0, 0xE254,
0xE255, 0x4653, 0x6E44, 0x3D36, 0x3C60, 0x475B, 0x4371, 0xE256,
@@ -5679,6 +10718,16 @@ static const unsigned short utf8_to_euc_E985[] = {
0, 0, 0x6E4B, 0x6E4A, 0xE260, 0x395A, 0, 0x3973,
0x3B40, 0xE261, 0xE262, 0xE263, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E985_x0213[] = {
+ 0, 0, 0, 0xE253, 0, 0, 0xFA3E, 0xFA3F,
+ 0x7C75, 0x4653, 0x6E44, 0x3D36, 0x3C60, 0x475B, 0x4371, 0xE256,
+ 0, 0, 0x3C72, 0xE257, 0x3F6C, 0, 0x6E45, 0xFA40,
+ 0x6E46, 0xFA41, 0xE25A, 0x7C76, 0, 0, 0, 0,
+ 0, 0xFA42, 0x3F5D, 0x6E47, 0xFA43, 0x6E48, 0, 0xE25E,
+ 0, 0x6E49, 0x4D6F, 0, 0x3D37, 0xE25F, 0, 0,
+ 0, 0, 0x6E4B, 0x6E4A, 0xFA44, 0x395A, 0, 0x3973,
+ 0x3B40, 0xFA45, 0xE262, 0xE263, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E986[] = {
0, 0xE264, 0x6E4E, 0xE265, 0, 0xE266, 0xE267, 0x3D66,
0, 0x6E4D, 0xE268, 0x6E4C, 0, 0x4269, 0xE269, 0,
@@ -5689,6 +10738,16 @@ static const unsigned short utf8_to_euc_E986[] = {
0xE276, 0xE277, 0xE278, 0xE279, 0x6E54, 0x6E53, 0xE27A, 0,
0x3E7A, 0, 0x6E55, 0xE27B, 0xE27C, 0xE27D, 0, 0xE27E,
};
+static const unsigned short utf8_to_euc_E986_x0213[] = {
+ 0, 0xE264, 0x6E4E, 0x7C77, 0, 0xFA46, 0xE267, 0x3D66,
+ 0, 0x6E4D, 0xE268, 0x6E4C, 0, 0x4269, 0xFA47, 0,
+ 0x386F, 0xE26A, 0x4043, 0xE26B, 0xE26C, 0xE26D, 0, 0x4830,
+ 0xE26E, 0, 0, 0, 0x3D39, 0, 0x7C78, 0,
+ 0, 0xE270, 0x6E4F, 0, 0x3E5F, 0, 0xE271, 0,
+ 0xFA48, 0, 0x6E52, 0x6E50, 0x7C79, 0xE274, 0xFA49, 0x6E51,
+ 0xE276, 0x7C7A, 0xE278, 0xFA4A, 0x6E54, 0x6E53, 0xFA4B, 0,
+ 0x3E7A, 0, 0x6E55, 0xE27B, 0x7C7B, 0xE27D, 0, 0xE27E,
+};
static const unsigned short utf8_to_euc_E987[] = {
0x6E56, 0x6E57, 0xE321, 0xE322, 0, 0xE323, 0x4850, 0x3A53,
0x3C61, 0x6E58, 0, 0x6E59, 0x4E24, 0x3D45, 0x4C6E, 0x4E4C,
@@ -5699,6 +10758,16 @@ static const unsigned short utf8_to_euc_E987[] = {
0xE332, 0xE333, 0, 0, 0, 0x6E60, 0x6E61, 0xE334,
0, 0xE335, 0, 0xE336, 0x6E5F, 0xE337, 0, 0x6E63,
};
+static const unsigned short utf8_to_euc_E987_x0213[] = {
+ 0x6E56, 0x6E57, 0xE321, 0xFA4C, 0xFA4D, 0xE323, 0x4850, 0x3A53,
+ 0x3C61, 0x6E58, 0, 0x6E59, 0x4E24, 0x3D45, 0x4C6E, 0x4E4C,
+ 0x6E5A, 0x3662, 0, 0xE324, 0xE325, 0, 0x6E5B, 0x7C7C,
+ 0x4523, 0xE327, 0xFA4E, 0x6E5E, 0x3378, 0x3F4B, 0xE329, 0x6E5C,
+ 0, 0x6E5D, 0, 0x4460, 0x7C7E, 0x7D21, 0x4B55, 0x367C,
+ 0, 0xE32C, 0xE32D, 0, 0xFA51, 0x7D22, 0xFA52, 0xE331,
+ 0xE332, 0x7D23, 0, 0, 0, 0x6E60, 0x6E61, 0xE334,
+ 0, 0xE335, 0, 0x7C7D, 0x6E5F, 0xE337, 0, 0x6E63,
+};
static const unsigned short utf8_to_euc_E988[] = {
0xE338, 0xE339, 0, 0, 0xE33A, 0xE33B, 0xE33C, 0xE33D,
0, 0xE33E, 0xE33F, 0, 0xE340, 0x465F, 0x3343, 0,
@@ -5709,6 +10778,16 @@ static const unsigned short utf8_to_euc_E988[] = {
0xE34F, 0, 0, 0xE350, 0x4E6B, 0xE351, 0xE352, 0x385A,
0xE353, 0xE354, 0xE355, 0, 0xE356, 0, 0xE357, 0x6E6F,
};
+static const unsigned short utf8_to_euc_E988_x0213[] = {
+ 0xE338, 0xFA53, 0, 0, 0xE33A, 0xE33B, 0xE33C, 0x7D24,
+ 0, 0xE33E, 0xFA54, 0, 0xE340, 0x465F, 0x3343, 0,
+ 0x7D25, 0x6E67, 0xE342, 0xE343, 0x6E64, 0x6E66, 0xFA55, 0xFA56,
+ 0xE345, 0, 0, 0, 0xE346, 0xE347, 0x6E62, 0,
+ 0, 0, 0, 0xE348, 0xE349, 0xE34A, 0xE34B, 0,
+ 0xE34C, 0x6F4F, 0, 0, 0x6E65, 0, 0xE34D, 0xE34E,
+ 0xE34F, 0, 0, 0xFA58, 0x4E6B, 0xE351, 0xE352, 0x385A,
+ 0x7D26, 0x7D27, 0x7D28, 0, 0x7D29, 0, 0xE357, 0x6E6F,
+};
static const unsigned short utf8_to_euc_E989[] = {
0xE358, 0, 0xE359, 0xE35A, 0x4534, 0x6E6A, 0xE35B, 0xE35C,
0x6E6D, 0x6E6B, 0xE35D, 0x6E70, 0, 0xE35E, 0xE35F, 0xE360,
@@ -5719,6 +10798,16 @@ static const unsigned short utf8_to_euc_E989[] = {
0xE36E, 0x395B, 0, 0, 0, 0xE36F, 0xE370, 0xE371,
0xE372, 0xE373, 0, 0xE374, 0xE375, 0xE376, 0x4B48, 0xE377,
};
+static const unsigned short utf8_to_euc_E989_x0213[] = {
+ 0x7D2A, 0, 0xFA59, 0x7D2B, 0x4534, 0x6E6A, 0xE35B, 0xFA5A,
+ 0x6E6D, 0x6E6B, 0xFA5B, 0x6E70, 0, 0xE35E, 0xFA5C, 0x7D2C,
+ 0x6E71, 0xFA5D, 0, 0, 0, 0, 0xFA5E, 0x6E69,
+ 0xE362, 0xFA5F, 0x6E76, 0x3174, 0xE364, 0xE365, 0x6E68, 0,
+ 0xFA60, 0xFA61, 0x482D, 0, 0x6E6C, 0xFA62, 0x3E60, 0xFA63,
+ 0xFA64, 0xE36B, 0, 0, 0, 0, 0xE36C, 0xE36D,
+ 0xE36E, 0x395B, 0, 0, 0, 0xE36F, 0xE370, 0xE371,
+ 0x7D2D, 0xE373, 0, 0xE374, 0xFA67, 0xFA68, 0x4B48, 0xFA69,
+};
static const unsigned short utf8_to_euc_E98A[] = {
0x3664, 0, 0, 0x3D46, 0, 0x463C, 0, 0,
0xE378, 0xE379, 0xE37A, 0, 0, 0xE37B, 0xE37C, 0,
@@ -5729,6 +10818,16 @@ static const unsigned short utf8_to_euc_E98A[] = {
0, 0, 0xE42A, 0, 0, 0, 0xE42B, 0x6E79,
0xE42C, 0x6E78, 0xE42D, 0xE42E, 0xE42F, 0xE430, 0, 0xE431,
};
+static const unsigned short utf8_to_euc_E98A_x0213[] = {
+ 0x3664, 0, 0, 0x3D46, 0, 0x463C, 0, 0,
+ 0x7D2E, 0xFA6A, 0xE37A, 0, 0, 0xFA6B, 0xE37C, 0,
+ 0, 0x412D, 0xE37D, 0x6E74, 0, 0x6E6E, 0x6E73, 0xFA6C,
+ 0x4C43, 0xFA6D, 0x4438, 0x6E75, 0x6E72, 0, 0, 0xFA6E,
+ 0xE423, 0, 0, 0, 0xE424, 0xE425, 0, 0xFA6F,
+ 0xE427, 0, 0, 0xFA70, 0, 0x412C, 0, 0xE429,
+ 0, 0, 0xFA73, 0, 0, 0, 0xE42B, 0x6E79,
+ 0xE42C, 0x6E78, 0xE42D, 0xE42E, 0xE42F, 0xE430, 0, 0xFA74,
+};
static const unsigned short utf8_to_euc_E98B[] = {
0xE432, 0xE433, 0xE434, 0xE435, 0, 0xE436, 0xE437, 0xE438,
0xE439, 0, 0, 0xE43A, 0xE43B, 0xE43C, 0xE43D, 0x6E77,
@@ -5739,6 +10838,16 @@ static const unsigned short utf8_to_euc_E98B[] = {
0xE44F, 0, 0x4946, 0x4372, 0, 0, 0, 0,
0x3578, 0xE450, 0x6E7C, 0xE451, 0x395D, 0, 0, 0xE452,
};
+static const unsigned short utf8_to_euc_E98B_x0213[] = {
+ 0xFA75, 0xE433, 0x7D2F, 0xE435, 0, 0xE436, 0xFA76, 0xE438,
+ 0xE439, 0, 0, 0x7D30, 0x7D31, 0xE43C, 0xFA77, 0x6E77,
+ 0xFA78, 0, 0x4B2F, 0x7D32, 0, 0xE440, 0, 0xFA79,
+ 0xE442, 0xFA7A, 0, 0, 0xE444, 0xE445, 0, 0xE446,
+ 0x7D33, 0xE448, 0, 0xE449, 0x3D7B, 0xFA7B, 0, 0xFA7C,
+ 0xE44C, 0x6E7A, 0x4A5F, 0, 0xE44D, 0x3154, 0xE44E, 0,
+ 0xE44F, 0, 0x4946, 0x4372, 0, 0, 0, 0xFB22,
+ 0x3578, 0xFB23, 0x6E7C, 0xFB24, 0x395D, 0, 0, 0x7D34,
+};
static const unsigned short utf8_to_euc_E98C[] = {
0xE453, 0, 0xE454, 0, 0, 0, 0x3B2C, 0,
0xE455, 0, 0, 0, 0, 0xE456, 0, 0x6E7B,
@@ -5749,6 +10858,16 @@ static const unsigned short utf8_to_euc_E98C[] = {
0, 0, 0x4F3F, 0xE464, 0xE465, 0x6F26, 0xE466, 0xE467,
0, 0, 0x6F25, 0x6F27, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E98C_x0213[] = {
+ 0xE453, 0, 0xFB25, 0, 0x7D35, 0, 0x3B2C, 0,
+ 0xE455, 0, 0, 0, 0, 0xFB26, 0, 0x6E7B,
+ 0x3F6D, 0xFA7D, 0, 0, 0xE458, 0xFB27, 0, 0,
+ 0x3F6E, 0x6F21, 0x6F23, 0, 0xE45A, 0xFB28, 0xFB29, 0x7D36,
+ 0x3E7B, 0x7D37, 0x6F22, 0x6F24, 0xE45F, 0x7D38, 0x3653, 0xFB2A,
+ 0x4945, 0xFB2B, 0xE463, 0x3C62, 0x4F23, 0, 0x6E7E, 0x3A78,
+ 0, 0, 0x4F3F, 0xE464, 0xE465, 0x6F26, 0xE466, 0xE467,
+ 0, 0, 0x6F25, 0x6F27, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E98D[] = {
0, 0, 0, 0, 0x6E7D, 0, 0, 0xE468,
0xE469, 0xE46A, 0, 0x4669, 0, 0x4555, 0, 0,
@@ -5759,6 +10878,16 @@ static const unsigned short utf8_to_euc_E98D[] = {
0xE47A, 0xE47B, 0, 0xE47C, 0xE47D, 0x3830, 0xE47E, 0,
0, 0, 0xE521, 0, 0x6F2A, 0xE522, 0x3E61, 0xE523,
};
+static const unsigned short utf8_to_euc_E98D_x0213[] = {
+ 0, 0, 0, 0, 0x6E7D, 0, 0, 0xFB2E,
+ 0x7D39, 0x7D3A, 0x7D3B, 0x4669, 0, 0x4555, 0, 0,
+ 0xE46B, 0xFB2F, 0xE46D, 0, 0x4457, 0xE46E, 0x6F2C, 0xFB30,
+ 0xE470, 0, 0xFB31, 0x4343, 0x6F28, 0, 0xE472, 0,
+ 0x6F29, 0, 0, 0, 0x7D3C, 0x7D3D, 0, 0xE475,
+ 0, 0xE476, 0x7D3E, 0xFB32, 0x372D, 0xE478, 0x6F2B, 0xE479,
+ 0x7D3F, 0xFB33, 0, 0xFB34, 0xE47D, 0x3830, 0xE47E, 0,
+ 0, 0, 0xE521, 0, 0x6F2A, 0xE522, 0x3E61, 0xE523,
+};
static const unsigned short utf8_to_euc_E98E[] = {
0xE524, 0xE525, 0xE526, 0, 0, 0, 0, 0,
0xE527, 0, 0xE528, 0xE529, 0x3379, 0xE52A, 0, 0xE52B,
@@ -5769,6 +10898,16 @@ static const unsigned short utf8_to_euc_E98E[] = {
0x6F2D, 0, 0, 0, 0xE537, 0xE538, 0xE539, 0,
0, 0x6F31, 0xE53A, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E98E_x0213[] = {
+ 0xE524, 0xE525, 0xE526, 0, 0, 0, 0, 0,
+ 0xFB38, 0, 0xE528, 0xFB39, 0x3379, 0xE52A, 0, 0xFB3A,
+ 0, 0, 0xE52C, 0, 0x6F30, 0xE52D, 0x3A3F, 0x4179,
+ 0xE52E, 0, 0x444A, 0x7D40, 0, 0, 0xFB3B, 0,
+ 0, 0xFB35, 0, 0x7D41, 0xE533, 0, 0xE534, 0x333B,
+ 0xE535, 0xE53B, 0, 0xE536, 0x6F2E, 0x6F2F, 0x4443, 0,
+ 0x6F2D, 0, 0, 0, 0xE537, 0xE538, 0xE539, 0,
+ 0, 0x6F31, 0x7D42, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E98F[] = {
0, 0xE53C, 0, 0x6F37, 0xE53D, 0xE53E, 0xE53F, 0xE540,
0x6F3A, 0xE541, 0xE542, 0xE543, 0xE544, 0xE545, 0, 0,
@@ -5779,6 +10918,16 @@ static const unsigned short utf8_to_euc_E98F[] = {
0, 0, 0, 0, 0, 0, 0, 0xE54F,
0xE550, 0xE54E, 0xE551, 0xE552, 0, 0xE553, 0, 0,
};
+static const unsigned short utf8_to_euc_E98F_x0213[] = {
+ 0, 0xFB40, 0, 0x6F37, 0xE53D, 0xE53E, 0x7D43, 0xFB41,
+ 0x6F3A, 0xE541, 0xE542, 0xE543, 0xE544, 0xE545, 0, 0,
+ 0x6F39, 0x452D, 0, 0xE546, 0, 0, 0x6F32, 0x6F33,
+ 0x6F36, 0xE547, 0, 0, 0xFB42, 0x6F38, 0x7D44, 0x7D45,
+ 0, 0x3640, 0xFB43, 0, 0x6F3B, 0x6F35, 0xE54C, 0xFB44,
+ 0x6F34, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0xFB3F, 0, 0, 0, 0xFB3C, 0, 0xE54F,
+ 0xE550, 0xE54E, 0xE551, 0xFB49, 0, 0x7D47, 0, 0,
+};
static const unsigned short utf8_to_euc_E990[] = {
0, 0xE554, 0xE555, 0x6F3F, 0xE556, 0, 0, 0x6F40,
0xE557, 0xE558, 0, 0, 0, 0xE559, 0xE55A, 0xE55B,
@@ -5789,6 +10938,16 @@ static const unsigned short utf8_to_euc_E990[] = {
0, 0xE562, 0xE563, 0xE564, 0xE565, 0x6F44, 0x6F42, 0,
0x4278, 0, 0x6F46, 0xE566, 0, 0xE568, 0, 0xE567,
};
+static const unsigned short utf8_to_euc_E990_x0213[] = {
+ 0, 0xE554, 0xE555, 0x6F3F, 0x7D46, 0, 0, 0x6F40,
+ 0xE557, 0xFB45, 0, 0, 0, 0xE559, 0xE55A, 0xFB46,
+ 0x6F41, 0, 0, 0x6F3E, 0x6F3D, 0xE55C, 0xFB47, 0xFB48,
+ 0x3E62, 0x462A, 0x6F3C, 0, 0, 0, 0, 0xE55F,
+ 0, 0x6F45, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0x6F43, 0, 0, 0xE560, 0xE561,
+ 0, 0xE562, 0xFB4A, 0x7D48, 0xFB4B, 0x6F44, 0x6F42, 0,
+ 0x4278, 0, 0x6F46, 0xFB4C, 0, 0xE568, 0, 0xE567,
+};
static const unsigned short utf8_to_euc_E991[] = {
0, 0x6F47, 0, 0xE569, 0x6F49, 0xE56A, 0, 0,
0xE56B, 0, 0xE56C, 0, 0xE56D, 0, 0, 0,
@@ -5799,6 +10958,16 @@ static const unsigned short utf8_to_euc_E991[] = {
0x6F50, 0xE579, 0xE57A, 0, 0, 0x6F51, 0, 0x6F52,
0, 0, 0, 0, 0x6F55, 0x6F53, 0x6F56, 0x6F58,
};
+static const unsigned short utf8_to_euc_E991_x0213[] = {
+ 0, 0x6F47, 0, 0xE569, 0x6F49, 0xFB4D, 0, 0,
+ 0xE56B, 0, 0x7D49, 0, 0xE56D, 0, 0, 0,
+ 0, 0x3455, 0x6F48, 0x4C7A, 0, 0xE56E, 0, 0,
+ 0, 0xE56F, 0x6F54, 0x6F4A, 0xE570, 0, 0x6F4D, 0xE571,
+ 0x6F4B, 0xE572, 0x6F4C, 0x7D4A, 0, 0, 0, 0,
+ 0xE574, 0, 0x6F4E, 0x7D4B, 0, 0xFB50, 0xE577, 0xFB51,
+ 0x6F50, 0x7D4C, 0x7D4D, 0, 0, 0x6F51, 0, 0x6F52,
+ 0, 0, 0, 0, 0x6F55, 0x6F53, 0x6F56, 0x6F58,
+};
static const unsigned short utf8_to_euc_E992[] = {
0, 0x6F57, 0, 0xE57C, 0xE57B, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -5819,6 +10988,16 @@ static const unsigned short utf8_to_euc_E995[] = {
0, 0, 0, 0, 0, 0, 0, 0x4439,
0xE57D, 0xE57E, 0, 0, 0, 0, 0xE621, 0,
};
+static const unsigned short utf8_to_euc_E995_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0x4439,
+ 0xFB52, 0xFB53, 0, 0, 0, 0, 0xE621, 0,
+};
static const unsigned short utf8_to_euc_E996[] = {
0x4C67, 0, 0x6F59, 0x412E, 0xE622, 0, 0, 0x6F5A,
0xE623, 0x4A44, 0x6F5B, 0x332B, 0xE624, 0xE625, 0xE626, 0x313C,
@@ -5829,6 +11008,16 @@ static const unsigned short utf8_to_euc_E996[] = {
0, 0, 0x315C, 0, 0xE62F, 0, 0xE630, 0,
0, 0x6F66, 0xE631, 0x6F65, 0x6F64, 0xE632, 0x6F67, 0xE633,
};
+static const unsigned short utf8_to_euc_E996_x0213[] = {
+ 0x4C67, 0, 0x6F59, 0x412E, 0xE622, 0, 0xFB54, 0x6F5A,
+ 0xE623, 0x4A44, 0x6F5B, 0x332B, 0xFB55, 0xFB56, 0x7D4E, 0x313C,
+ 0, 0x3457, 0xF471, 0x3456, 0x6F5C, 0, 0x6F5D, 0,
+ 0x6F5E, 0x6F5F, 0, 0, 0, 0xE627, 0xE628, 0x7D4F,
+ 0x6F60, 0xE62A, 0x3458, 0x3355, 0x395E, 0x4836, 0x7D50, 0x6F62,
+ 0x6F61, 0x7D51, 0, 0xFB58, 0x7D52, 0x6F63, 0, 0,
+ 0, 0, 0x315C, 0, 0xFB59, 0, 0x7D53, 0,
+ 0, 0x6F66, 0xE631, 0x6F65, 0x6F64, 0x7D54, 0x6F67, 0xE633,
+};
static const unsigned short utf8_to_euc_E997[] = {
0, 0, 0, 0x6F6A, 0, 0, 0xE634, 0x3047,
0xE635, 0xE636, 0x6F68, 0xE637, 0x6F6C, 0x6F6B, 0, 0,
@@ -5839,6 +11028,16 @@ static const unsigned short utf8_to_euc_E997[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E997_x0213[] = {
+ 0, 0, 0, 0x6F6A, 0, 0, 0xE634, 0x3047,
+ 0xFB5B, 0xE636, 0x6F68, 0x7D55, 0x6F6C, 0x6F6B, 0, 0,
+ 0x7D56, 0xE639, 0xE63A, 0x7D57, 0x6F6E, 0x6F6D, 0x6F6F, 0,
+ 0x462E, 0xE63C, 0x7D59, 0, 0x6F70, 0xE63E, 0x7D5A, 0xE640,
+ 0xE641, 0x6F71, 0x6F73, 0, 0xE642, 0x6F72, 0xE643, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E998[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -5849,6 +11048,16 @@ static const unsigned short utf8_to_euc_E998[] = {
0, 0xE64B, 0x4B49, 0xE64C, 0, 0, 0, 0xE64D,
0xE64E, 0xE64F, 0xE650, 0x414B, 0xE651, 0xE652, 0, 0x3024,
};
+static const unsigned short utf8_to_euc_E998_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0x496C, 0xFA25, 0xE645, 0,
+ 0, 0x6F74, 0xE646, 0, 0xE647, 0xE648, 0xE649, 0,
+ 0x6F75, 0, 0x3A65, 0, 0xFB5E, 0, 0x6F76, 0x6F77,
+ 0, 0xE64B, 0x4B49, 0xFB5F, 0xFB60, 0, 0, 0xE64D,
+ 0xE64E, 0xE64F, 0xE650, 0x414B, 0xFB62, 0xE652, 0, 0x3024,
+};
static const unsigned short utf8_to_euc_E999[] = {
0x424B, 0xE653, 0x6F78, 0, 0x496D, 0, 0, 0,
0, 0, 0, 0x6F7B, 0x6F79, 0x395F, 0, 0x6F7A,
@@ -5859,6 +11068,16 @@ static const unsigned short utf8_to_euc_E999[] = {
0x3122, 0, 0x7024, 0x4444, 0xE65B, 0x4E4D, 0x462B, 0x6F7C,
0x4E26, 0, 0x3831, 0xE65C, 0xE65D, 0x4D5B, 0xE65E, 0xE65F,
};
+static const unsigned short utf8_to_euc_E999_x0213[] = {
+ 0x424B, 0xFB63, 0x6F78, 0, 0x496D, 0, 0, 0,
+ 0, 0, 0, 0x6F7B, 0x6F79, 0x395F, 0, 0x6F7A,
+ 0x3842, 0, 0xE654, 0, 0xE655, 0, 0xE656, 0xE657,
+ 0x7D5B, 0, 0, 0x4A45, 0x6F7D, 0x7021, 0x6F7E, 0x7022,
+ 0, 0xFB64, 0x3121, 0x3F58, 0x3D7C, 0x3459, 0x7023, 0,
+ 0, 0, 0x4766, 0, 0x7025, 0, 0xE65A, 0,
+ 0x3122, 0, 0x7024, 0x4444, 0xE65B, 0x4E4D, 0x462B, 0x6F7C,
+ 0x4E26, 0, 0x3831, 0xE65C, 0xE65D, 0x4D5B, 0xE65E, 0xE65F,
+};
static const unsigned short utf8_to_euc_E99A[] = {
0, 0xE660, 0xE661, 0xE662, 0xE663, 0x3679, 0x4E34, 0,
0x3728, 0xE664, 0x4262, 0x6721, 0, 0x7026, 0x332C, 0x3F6F,
@@ -5869,6 +11088,16 @@ static const unsigned short utf8_to_euc_E99A[] = {
0x702E, 0x702C, 0x702D, 0xE670, 0x702F, 0, 0x7030, 0x4E6C,
0x7031, 0x7032, 0xE671, 0x4049, 0x483B, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E99A_x0213[] = {
+ 0, 0xE660, 0xFB66, 0xE662, 0x7D5C, 0x3679, 0x4E34, 0,
+ 0x3728, 0xE664, 0x4262, 0x6721, 0, 0x7026, 0x332C, 0x3F6F,
+ 0, 0xE665, 0, 0, 0x3356, 0x7028, 0xE666, 0x7029,
+ 0x7027, 0x3764, 0xFB68, 0x3A5D, 0x3E63, 0x7D5E, 0, 0xE669,
+ 0x3123, 0, 0, 0x4E59, 0x7D5F, 0x7D60, 0xE66C, 0x702B,
+ 0x6E2E, 0xFB6B, 0x702A, 0, 0, 0, 0xE66E, 0xFB6C,
+ 0x702E, 0x702C, 0x702D, 0xFB6D, 0x702F, 0, 0x7030, 0x4E6C,
+ 0x7031, 0x7032, 0xFB6E, 0x4049, 0x483B, 0xFB6F, 0, 0,
+};
static const unsigned short utf8_to_euc_E99B[] = {
0x3F7D, 0x3467, 0, 0, 0x4D3A, 0x326D, 0x3D38, 0x385B,
0, 0x7035, 0xE672, 0x7034, 0x3B73, 0x7036, 0x7033, 0,
@@ -5879,6 +11108,16 @@ static const unsigned short utf8_to_euc_E99B[] = {
0x4A37, 0xE67C, 0x3140, 0, 0, 0, 0x4E6D, 0x4D6B,
0, 0x703B, 0xE67D, 0x4545, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E99B_x0213[] = {
+ 0x3F7D, 0x3467, 0, 0, 0x4D3A, 0x326D, 0x3D38, 0x385B,
+ 0, 0x7035, 0xE672, 0x7034, 0x3B73, 0x7036, 0x7033, 0,
+ 0, 0x3B28, 0x7D61, 0, 0, 0x703A, 0x6A2D, 0,
+ 0xFB72, 0x5256, 0xFB73, 0x3F77, 0x7038, 0xFB74, 0x7D62, 0xE679,
+ 0, 0, 0x4E25, 0x4671, 0, 0, 0, 0,
+ 0x312B, 0x7D64, 0x4063, 0x3C36, 0, 0, 0, 0x7D65,
+ 0x4A37, 0xE67C, 0x3140, 0, 0, 0, 0x4E6D, 0x4D6B,
+ 0, 0x703B, 0xE67D, 0x4545, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E99C[] = {
0x3C7B, 0, 0xE67E, 0xE721, 0x703C, 0xE722, 0x703D, 0x3F4C,
0x703E, 0xE723, 0x4E6E, 0, 0, 0x7039, 0x7040, 0x7042,
@@ -5889,6 +11128,16 @@ static const unsigned short utf8_to_euc_E99C[] = {
0x7047, 0xE72B, 0x4F2A, 0xE72C, 0, 0, 0, 0,
0x5B31, 0x7048, 0, 0xF474, 0, 0x7049, 0x704A, 0,
};
+static const unsigned short utf8_to_euc_E99C_x0213[] = {
+ 0x3C7B, 0, 0xE67E, 0xE721, 0x703C, 0xE722, 0x703D, 0x3F4C,
+ 0x703E, 0xE723, 0x4E6E, 0, 0, 0x7039, 0x7040, 0x7042,
+ 0, 0x7041, 0, 0x703F, 0xFB76, 0, 0x7043, 0,
+ 0, 0x7044, 0xE724, 0xE725, 0x417A, 0xE726, 0x3262, 0,
+ 0, 0xE727, 0xE728, 0xFB77, 0x7045, 0, 0, 0x4C38,
+ 0xE72A, 0, 0x7046, 0, 0, 0, 0, 0,
+ 0x7047, 0xE72B, 0x4F2A, 0x7D66, 0, 0, 0xFB79, 0,
+ 0x5B31, 0x7048, 0, 0x7D67, 0, 0x7049, 0x704A, 0,
+};
static const unsigned short utf8_to_euc_E99D[] = {
0, 0xE72D, 0x704E, 0xE72E, 0x704B, 0, 0x704C, 0,
0x704D, 0x704F, 0xE72F, 0, 0, 0xF475, 0xE730, 0xE731,
@@ -5899,6 +11148,16 @@ static const unsigned short utf8_to_euc_E99D[] = {
0, 0x7057, 0, 0xE73B, 0x3724, 0, 0xE73C, 0xE73D,
0xE73E, 0x7058, 0x705C, 0xE73F, 0x705A, 0xE740, 0, 0xE741,
};
+static const unsigned short utf8_to_euc_E99D_x0213[] = {
+ 0, 0xFB7A, 0x704E, 0xE72E, 0x704B, 0, 0x704C, 0xFB7B,
+ 0x704D, 0x704F, 0xE72F, 0, 0, 0x7D68, 0x7D69, 0x7D6A,
+ 0, 0xF476, 0x4044, 0, 0, 0xFB7C, 0x4C77, 0xFB7D,
+ 0xE734, 0x4045, 0x7D6B, 0xFB7E, 0x7050, 0, 0x4873, 0,
+ 0x7051, 0x7353, 0x4C4C, 0xE737, 0x7052, 0, 0x7053, 0xE738,
+ 0x7054, 0x3357, 0xFC21, 0x7056, 0, 0x3F59, 0x7D6C, 0,
+ 0, 0x7057, 0, 0x7D6D, 0x3724, 0, 0xE73C, 0xE73D,
+ 0xE73E, 0x7058, 0x705C, 0xE73F, 0x705A, 0xE740, 0, 0xE741,
+};
static const unsigned short utf8_to_euc_E99E[] = {
0xE742, 0x705B, 0, 0, 0x3373, 0x7059, 0x705D, 0,
0, 0xE743, 0, 0x705E, 0, 0x3048, 0, 0x705F,
@@ -5909,6 +11168,16 @@ static const unsigned short utf8_to_euc_E99E[] = {
0, 0xE74E, 0xE74F, 0x7065, 0x7066, 0xE750, 0xE751, 0,
0xE752, 0xE753, 0xE754, 0, 0xE755, 0, 0xE756, 0xE757,
};
+static const unsigned short utf8_to_euc_E99E_x0213[] = {
+ 0xE742, 0x705B, 0, 0, 0x3373, 0x7059, 0x705D, 0,
+ 0, 0xE743, 0, 0x705E, 0, 0x3048, 0, 0x705F,
+ 0x7060, 0, 0, 0, 0, 0x7D6E, 0xFC24, 0xE746,
+ 0x3E64, 0xE747, 0xFC25, 0, 0x7061, 0, 0xFC26, 0xE74A,
+ 0x3547, 0, 0xFC27, 0x7064, 0, 0, 0x7063, 0,
+ 0x7062, 0, 0, 0x6B71, 0xE74C, 0x4A5C, 0x7D6F, 0,
+ 0, 0xFC28, 0xFC29, 0x7065, 0x7066, 0xE750, 0xE751, 0,
+ 0xE752, 0xE753, 0x7D70, 0, 0xE755, 0, 0xFC2A, 0xE757,
+};
static const unsigned short utf8_to_euc_E99F[] = {
0, 0xE758, 0, 0x7067, 0xE759, 0xE75A, 0x7068, 0xE75B,
0x7069, 0xE75C, 0xE75D, 0x706A, 0xE75E, 0xE75F, 0xE760, 0,
@@ -5919,6 +11188,16 @@ static const unsigned short utf8_to_euc_E99F[] = {
0, 0xE76E, 0x706E, 0x323B, 0xE76F, 0x7071, 0x7070, 0xE770,
0xE771, 0, 0xE772, 0x3124, 0, 0, 0, 0x3641,
};
+static const unsigned short utf8_to_euc_E99F_x0213[] = {
+ 0, 0x7D71, 0, 0x7067, 0xE759, 0xE75A, 0x7068, 0xE75B,
+ 0x7069, 0x7D72, 0xE75D, 0x706A, 0xFC2B, 0xE75F, 0xE760, 0,
+ 0xE761, 0xFC2C, 0, 0x345A, 0xFC2D, 0, 0, 0xE764,
+ 0xFC2E, 0xFC2F, 0, 0x7D74, 0x706B, 0xE767, 0x7D73, 0,
+ 0xE769, 0xFC30, 0, 0, 0xE76C, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0x706C, 0x4723, 0xE76D,
+ 0, 0xFC31, 0x706E, 0x323B, 0x7D75, 0x7071, 0x7070, 0xE770,
+ 0xE771, 0, 0xE772, 0x3124, 0, 0, 0, 0x3641,
+};
static const unsigned short utf8_to_euc_E9A0[] = {
0, 0x4A47, 0x443A, 0x3A22, 0, 0x3960, 0x3D67, 0xE773,
0x3F5C, 0, 0xE774, 0, 0x7073, 0xE776, 0xE777, 0x7072,
@@ -5929,6 +11208,16 @@ static const unsigned short utf8_to_euc_E9A0[] = {
0xE824, 0, 0xE825, 0xE826, 0x3150, 0xE827, 0, 0x7077,
0x7074, 0, 0, 0x4951, 0x4D6A, 0x7078, 0xE829, 0,
};
+static const unsigned short utf8_to_euc_E9A0_x0213[] = {
+ 0, 0x4A47, 0x443A, 0x3A22, 0xFC32, 0x3960, 0x3D67, 0xE773,
+ 0x3F5C, 0, 0x7D77, 0, 0x7073, 0xFC33, 0xFC34, 0x7072,
+ 0x4D42, 0x3468, 0x4852, 0x465C, 0xFC35, 0, 0xFC36, 0x3F7C,
+ 0x4E4E, 0xE775, 0x375B, 0, 0xE77A, 0, 0x7D78, 0,
+ 0xE77C, 0x7076, 0, 0xFC39, 0x7075, 0xFC3C, 0xE77E, 0,
+ 0, 0, 0, 0x7D79, 0x4B4B, 0x462C, 0xE822, 0xE823,
+ 0x7D7A, 0, 0xFC3A, 0xFC3B, 0x3150, 0xE827, 0, 0x7077,
+ 0x7074, 0, 0, 0x4951, 0x4D6A, 0x7078, 0xE829, 0,
+};
static const unsigned short utf8_to_euc_E9A1[] = {
0, 0, 0, 0, 0xE82A, 0, 0x7079, 0xE82B,
0, 0, 0xE82C, 0x707B, 0x426A, 0x335B, 0x335C, 0x707A,
@@ -5939,6 +11228,16 @@ static const unsigned short utf8_to_euc_E9A1[] = {
0x707E, 0x7121, 0, 0x7123, 0x7122, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E9A1_x0213[] = {
+ 0, 0, 0, 0, 0xE82A, 0, 0x7079, 0xFC3D,
+ 0, 0, 0xE82C, 0x707B, 0x426A, 0x335B, 0x335C, 0x707A,
+ 0, 0xE82D, 0x7D7C, 0x7D7D, 0x3469, 0x3832, 0x7D7E, 0x7E21,
+ 0x346A, 0x7E22, 0x7E23, 0x453F, 0, 0, 0x4E60, 0,
+ 0, 0, 0xE834, 0xE835, 0, 0x7E25, 0xFC3E, 0x385C,
+ 0, 0, 0xE838, 0x707C, 0x7E26, 0, 0, 0x707D,
+ 0x707E, 0x7121, 0, 0x7123, 0x7122, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E9A2[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -5949,6 +11248,16 @@ static const unsigned short utf8_to_euc_E9A2[] = {
0xE83D, 0x7126, 0, 0, 0xE83E, 0, 0x7127, 0xE83F,
0xE840, 0, 0xE841, 0xE842, 0, 0, 0, 0xE843,
};
+static const unsigned short utf8_to_euc_E9A2_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0x4977, 0, 0x7124, 0xFC3F, 0, 0xFC40, 0xE83C, 0x7125,
+ 0xFC41, 0x7126, 0, 0, 0xE83E, 0, 0x7127, 0xFC43,
+ 0xFC44, 0, 0x7E27, 0xFC45, 0xFC46, 0, 0, 0xFC47,
+};
static const unsigned short utf8_to_euc_E9A3[] = {
0, 0, 0xE844, 0x7129, 0x7128, 0xE845, 0x712A, 0,
0xE846, 0, 0, 0, 0xE847, 0, 0, 0,
@@ -5959,6 +11268,16 @@ static const unsigned short utf8_to_euc_E9A3[] = {
0, 0, 0x307B, 0xE84E, 0x303B, 0, 0xE84F, 0,
0, 0, 0, 0, 0x3B74, 0x4B30, 0x3E7E, 0,
};
+static const unsigned short utf8_to_euc_E9A3_x0213[] = {
+ 0, 0, 0xFC48, 0x7129, 0x7128, 0xE845, 0x712A, 0xFC49,
+ 0x7E28, 0, 0, 0xFC4A, 0xE847, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0x4874, 0x664C, 0, 0, 0x3F29,
+ 0xFC4B, 0xFC4D, 0x3532, 0xFC4E, 0, 0xFC4F, 0xE84B, 0x7E29,
+ 0, 0x712B, 0xFC50, 0x712C, 0, 0x522C, 0x5D3B, 0x4853,
+ 0xFC51, 0xFC52, 0x307B, 0xFC53, 0x303B, 0, 0xE84F, 0,
+ 0, 0, 0, 0, 0x3B74, 0x4B30, 0x3E7E, 0,
+};
static const unsigned short utf8_to_euc_E9A4[] = {
0, 0, 0xE850, 0x712D, 0, 0x4C5F, 0, 0xE851,
0xE852, 0x712E, 0x4D5C, 0, 0x3142, 0, 0, 0,
@@ -5969,6 +11288,16 @@ static const unsigned short utf8_to_euc_E9A4[] = {
0, 0xE85F, 0xE860, 0xE861, 0xE862, 0xE863, 0, 0,
0, 0xE864, 0xE865, 0xE866, 0xE867, 0x7139, 0x713A, 0,
};
+static const unsigned short utf8_to_euc_E9A4_x0213[] = {
+ 0, 0, 0xE850, 0x712D, 0, 0x4C5F, 0, 0xE851,
+ 0xFC54, 0x712E, 0x4D5C, 0, 0x3142, 0, 0, 0,
+ 0x3B41, 0xE853, 0x712F, 0x326E, 0x7130, 0xE854, 0xFC57, 0xFC58,
+ 0x7131, 0, 0xFC5A, 0xFC5B, 0xFC5C, 0x7133, 0x7134, 0xE85A,
+ 0x7136, 0x7132, 0xE85B, 0, 0x7135, 0, 0xE85C, 0xE85D,
+ 0x345B, 0, 0, 0xE85E, 0x7137, 0, 0x7138, 0,
+ 0, 0xFC5E, 0xFC5F, 0xFC60, 0xE862, 0xE863, 0, 0,
+ 0, 0xE864, 0xFC61, 0xFC62, 0xFC63, 0x7139, 0x713A, 0,
+};
static const unsigned short utf8_to_euc_E9A5[] = {
0xE868, 0xE869, 0x713B, 0, 0, 0x713D, 0xE86A, 0xE86B,
0xE86C, 0x713C, 0, 0x713F, 0x7142, 0xE86D, 0xE86E, 0,
@@ -5979,6 +11308,16 @@ static const unsigned short utf8_to_euc_E9A5[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E9A5_x0213[] = {
+ 0xFC64, 0xFC65, 0x713B, 0, 0, 0x713D, 0xFC66, 0xE86B,
+ 0xE86C, 0x713C, 0, 0x713F, 0x7142, 0xFC67, 0xFC68, 0,
+ 0x713E, 0x7140, 0x7141, 0, 0xE86F, 0x7143, 0, 0x3642,
+ 0x7E2A, 0xE871, 0, 0xE872, 0xFC69, 0, 0xE874, 0xFC6A,
+ 0xFC6B, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E9A6[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -5989,6 +11328,16 @@ static const unsigned short utf8_to_euc_E9A6[] = {
0xE87B, 0xE87C, 0xE87D, 0x435A, 0x466B, 0xE87E, 0, 0,
0, 0xE921, 0xE922, 0, 0x7149, 0xE923, 0, 0xE924,
};
+static const unsigned short utf8_to_euc_E9A6_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0x3C73, 0x7144,
+ 0x7145, 0x3961, 0, 0xE877, 0, 0xE878, 0x7E2B, 0xE879,
+ 0, 0, 0, 0xFC6C, 0, 0x7146, 0xFC6D, 0,
+ 0x333E, 0, 0, 0, 0x474F, 0x7147, 0x7148, 0,
+ 0xE87B, 0xE87C, 0xE87D, 0x435A, 0x466B, 0xE87E, 0, 0,
+ 0, 0xFC6E, 0xE922, 0, 0x7149, 0xFC6F, 0, 0xFC70,
+};
static const unsigned short utf8_to_euc_E9A7[] = {
0, 0x477D, 0, 0xE925, 0x424C, 0x3158, 0x366E, 0,
0x366F, 0xE926, 0, 0, 0, 0, 0, 0,
@@ -5999,6 +11348,16 @@ static const unsigned short utf8_to_euc_E9A7[] = {
0xE931, 0x7151, 0x7152, 0, 0xE932, 0xE933, 0, 0,
0x7154, 0xE934, 0, 0x7153, 0, 0xE935, 0xE936, 0x3D59,
};
+static const unsigned short utf8_to_euc_E9A7_x0213[] = {
+ 0, 0x477D, 0, 0xFC71, 0x424C, 0x3158, 0x366E, 0,
+ 0x366F, 0xFC72, 0, 0, 0, 0, 0, 0,
+ 0x4373, 0x714E, 0x3670, 0xE927, 0xFC73, 0x326F, 0, 0,
+ 0x714D, 0xFC74, 0xE92A, 0x714B, 0xE92B, 0x714C, 0xFC75, 0x714A,
+ 0, 0, 0x7158, 0, 0, 0, 0, 0xE92D,
+ 0, 0, 0xE92E, 0xE92F, 0xE930, 0x714F, 0x7150, 0,
+ 0xFC77, 0x7151, 0x7152, 0, 0xE932, 0xE933, 0, 0,
+ 0x7154, 0xFC78, 0, 0x7153, 0xFC79, 0xE935, 0xE936, 0x3D59,
+};
static const unsigned short utf8_to_euc_E9A8[] = {
0, 0x7155, 0xE937, 0xE938, 0xE939, 0x7157, 0, 0,
0, 0, 0, 0xE93A, 0xE93B, 0, 0x3533, 0x7156,
@@ -6009,6 +11368,16 @@ static const unsigned short utf8_to_euc_E9A8[] = {
0x462D, 0, 0, 0xE947, 0, 0xE948, 0xE949, 0x715B,
0xE94A, 0, 0, 0, 0, 0, 0x7160, 0,
};
+static const unsigned short utf8_to_euc_E9A8_x0213[] = {
+ 0, 0x7155, 0x7E2C, 0x7E2D, 0xE939, 0x7157, 0, 0,
+ 0, 0, 0xFC7A, 0xE93A, 0xE93B, 0, 0x3533, 0x7156,
+ 0xE93C, 0xFC7B, 0x417B, 0x3833, 0, 0, 0xFC7C, 0,
+ 0, 0x7159, 0xFC7D, 0, 0, 0, 0xE93F, 0,
+ 0xFC7E, 0, 0xE941, 0xE942, 0x7E2E, 0, 0, 0xE944,
+ 0x424D, 0, 0, 0x715A, 0, 0x7E2F, 0x7E30, 0,
+ 0x462D, 0xFD21, 0, 0xE947, 0, 0xE948, 0xFD22, 0x715B,
+ 0x7E31, 0, 0, 0, 0, 0, 0x7160, 0,
+};
static const unsigned short utf8_to_euc_E9A9[] = {
0x715E, 0xE94C, 0x715D, 0x715F, 0xE94D, 0x715C, 0, 0xE94B,
0, 0, 0xE94E, 0xE94F, 0xE950, 0x7162, 0xE951, 0,
@@ -6019,6 +11388,16 @@ static const unsigned short utf8_to_euc_E9A9[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E9A9_x0213[] = {
+ 0x715E, 0xE94C, 0x715D, 0x715F, 0xFD23, 0x715C, 0, 0xE94B,
+ 0, 0, 0x7E32, 0xE94F, 0xFD24, 0x7162, 0x7E33, 0,
+ 0, 0xE952, 0x7E34, 0, 0xE953, 0x7161, 0xE954, 0x7164,
+ 0xFD25, 0, 0x3643, 0x7163, 0, 0xE955, 0, 0x7165,
+ 0, 0, 0x7166, 0, 0x7168, 0x7167, 0, 0,
+ 0, 0x7169, 0x716B, 0x716A, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E9AA[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -6029,6 +11408,16 @@ static const unsigned short utf8_to_euc_E9AA[] = {
0x716D, 0, 0xE95A, 0, 0xE95B, 0xE95C, 0xE95D, 0,
0x333C, 0xE95E, 0, 0xE95F, 0x716E, 0, 0xE960, 0xE961,
};
+static const unsigned short utf8_to_euc_E9AA_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0x397C, 0, 0xE956, 0, 0xE957, 0x716C, 0xE958, 0xFD27,
+ 0x716D, 0, 0xE95A, 0, 0xE95B, 0xE95C, 0x7E35, 0xFD29,
+ 0x333C, 0xFD2B, 0, 0xE95F, 0x716E, 0, 0xE960, 0xE961,
+};
static const unsigned short utf8_to_euc_E9AB[] = {
0x716F, 0xE962, 0, 0xE963, 0x3F71, 0, 0xE964, 0,
0xE965, 0, 0, 0, 0, 0, 0xE966, 0x7170,
@@ -6039,6 +11428,16 @@ static const unsigned short utf8_to_euc_E9AB[] = {
0, 0x717D, 0xE974, 0xE975, 0x717C, 0xE976, 0, 0x717E,
0, 0xE977, 0xE978, 0x7221, 0, 0xE979, 0, 0xE97A,
};
+static const unsigned short utf8_to_euc_E9AB_x0213[] = {
+ 0x716F, 0x7E36, 0, 0x7E37, 0x3F71, 0, 0xFD2D, 0,
+ 0xE965, 0, 0, 0, 0, 0, 0x7E38, 0x7170,
+ 0xFD2E, 0x7171, 0xFD2F, 0x7172, 0x7173, 0xFD30, 0x7E39, 0xE96B,
+ 0x3962, 0xF47B, 0, 0xE96C, 0xFD32, 0, 0x7174, 0x7175,
+ 0xFD33, 0, 0x7176, 0x7177, 0xE96F, 0xFD34, 0x7178, 0xE971,
+ 0, 0xFD35, 0x4831, 0x717A, 0xE973, 0x4926, 0x717B, 0x7179,
+ 0, 0x717D, 0xE974, 0xE975, 0x717C, 0xE976, 0, 0x717E,
+ 0, 0x7E3A, 0xE978, 0x7221, 0, 0xE979, 0, 0xE97A,
+};
static const unsigned short utf8_to_euc_E9AC[] = {
0xE97B, 0xE97C, 0xE97D, 0xE97E, 0xEA21, 0xEA22, 0x7222, 0,
0xEA23, 0xEA24, 0, 0xEA25, 0xEA26, 0xEA27, 0xEA28, 0,
@@ -6049,6 +11448,16 @@ static const unsigned short utf8_to_euc_E9AC[] = {
0, 0x5D35, 0x722F, 0xEA33, 0xEA34, 0xEA35, 0, 0xEA36,
0, 0xEA37, 0xEA38, 0x6478, 0x3534, 0xEA39, 0, 0,
};
+static const unsigned short utf8_to_euc_E9AC_x0213[] = {
+ 0xE97B, 0xE97C, 0x7E3B, 0xFD36, 0xEA21, 0xEA22, 0x7222, 0,
+ 0x7E3C, 0xEA24, 0, 0xEA25, 0xFD37, 0xEA27, 0xEA28, 0,
+ 0xFD38, 0, 0xFD39, 0, 0, 0, 0xFD3A, 0,
+ 0x7223, 0xEA2C, 0x7224, 0xEA2D, 0xFD3B, 0, 0, 0x7225,
+ 0x7E3D, 0, 0x7226, 0x7227, 0, 0x7228, 0xEA30, 0x7229,
+ 0x722A, 0x722B, 0x722C, 0xFD3C, 0, 0x7E3F, 0x722D, 0x722E,
+ 0, 0x5D35, 0x722F, 0xFD3D, 0xEA34, 0xEA35, 0, 0xEA36,
+ 0, 0xEA37, 0xEA38, 0x6478, 0x3534, 0xFD3E, 0, 0,
+};
static const unsigned short utf8_to_euc_E9AD[] = {
0, 0x3321, 0x3A32, 0x7231, 0x7230, 0x4C25, 0, 0,
0xEA3A, 0, 0, 0xEA3B, 0xEA3C, 0x7233, 0x7234, 0x7232,
@@ -6059,6 +11468,16 @@ static const unsigned short utf8_to_euc_E9AD[] = {
0, 0, 0xF47C, 0xEA4C, 0x7237, 0xEA4D, 0, 0xEA4E,
0xEA4F, 0xEA50, 0, 0, 0, 0, 0, 0xEA51,
};
+static const unsigned short utf8_to_euc_E9AD_x0213[] = {
+ 0, 0x3321, 0x3A32, 0x7231, 0x7230, 0x4C25, 0, 0,
+ 0xEA3A, 0, 0, 0xFD40, 0xEA3C, 0x7233, 0x7234, 0x7232,
+ 0, 0x7235, 0, 0, 0x4B62, 0xEA3D, 0xEA3E, 0xEA3F,
+ 0x7236, 0, 0x357B, 0xEA40, 0, 0, 0x7E40, 0,
+ 0, 0xEA42, 0, 0xFD41, 0, 0xFD42, 0x7E42, 0,
+ 0xEA46, 0, 0xEA47, 0xFD43, 0xFD44, 0xEA4A, 0xEA4B, 0x4F25,
+ 0, 0, 0x7E43, 0xFD45, 0x7237, 0x7E44, 0xFD46, 0xFD47,
+ 0xEA4F, 0x7E41, 0, 0, 0, 0, 0, 0xEA51,
+};
static const unsigned short utf8_to_euc_E9AE[] = {
0xEA52, 0, 0, 0x7239, 0xEA53, 0xEA54, 0xEA55, 0xEA56,
0, 0xEA57, 0xEA58, 0xEA59, 0, 0xEA5A, 0x303E, 0xEA5B,
@@ -6069,6 +11488,16 @@ static const unsigned short utf8_to_euc_E9AE[] = {
0xEA65, 0xEA66, 0xEA67, 0, 0x7240, 0, 0, 0xEA68,
0xEA69, 0x7243, 0, 0xEA6A, 0xEA6B, 0, 0xEA6C, 0xEA6D,
};
+static const unsigned short utf8_to_euc_E9AE_x0213[] = {
+ 0xEA52, 0, 0, 0x7239, 0x7E45, 0xEA54, 0xEA55, 0xEA56,
+ 0, 0xEA57, 0x7E46, 0xEA59, 0, 0xEA5A, 0x303E, 0x7E47,
+ 0xEA5C, 0x723A, 0x4A2B, 0x7238, 0xEA5D, 0, 0x723B, 0x723C,
+ 0, 0, 0xEA5E, 0, 0, 0xEA5F, 0x7E48, 0x723D,
+ 0x723E, 0, 0, 0, 0, 0, 0xFD48, 0x7E49,
+ 0x723F, 0xEA63, 0x4B6E, 0x3B2D, 0xFD49, 0x3A7A, 0x412F, 0,
+ 0xEA65, 0xFD4A, 0xFD4D, 0, 0x7240, 0, 0, 0xEA68,
+ 0xFD4E, 0x7243, 0, 0xEA6A, 0xEA6B, 0, 0xFD4F, 0xEA6D,
+};
static const unsigned short utf8_to_euc_E9AF[] = {
0x7241, 0xEA6E, 0, 0, 0, 0, 0x7244, 0xEA6F,
0xEA70, 0x3871, 0x7242, 0, 0, 0, 0xEA71, 0x7245,
@@ -6079,6 +11508,16 @@ static const unsigned short utf8_to_euc_E9AF[] = {
0x7250, 0x724F, 0x724E, 0xEA7C, 0, 0x3033, 0, 0xEA7D,
0xEA7E, 0xEB21, 0xEB22, 0, 0, 0xEB23, 0, 0xEB24,
};
+static const unsigned short utf8_to_euc_E9AF_x0213[] = {
+ 0x7241, 0x7E4A, 0, 0, 0, 0, 0x7244, 0xFD50,
+ 0xEA70, 0x3871, 0x7242, 0, 0, 0, 0x7E4B, 0x7245,
+ 0xEA72, 0x7246, 0x7247, 0, 0x724B, 0, 0x3B2A, 0xEA73,
+ 0xFD52, 0, 0, 0x4264, 0, 0xFD53, 0, 0xEA76,
+ 0, 0x724C, 0x7249, 0x7248, 0x724A, 0x7E4C, 0, 0xFD54,
+ 0x375F, 0, 0xFD55, 0xFD56, 0, 0, 0xFD58, 0xFD57,
+ 0x7250, 0x724F, 0x724E, 0xFD51, 0, 0x3033, 0, 0xFD5C,
+ 0x7E4D, 0xEB21, 0xFD5A, 0, 0, 0x7E4E, 0, 0xEB24,
+};
static const unsigned short utf8_to_euc_E9B0[] = {
0xEB25, 0, 0xEB26, 0, 0x725A, 0, 0x7256, 0,
0x7257, 0x7253, 0x7259, 0xEB27, 0x7255, 0x3362, 0, 0xEB28,
@@ -6089,6 +11528,16 @@ static const unsigned short utf8_to_euc_E9B0[] = {
0x7260, 0xEB37, 0x7262, 0, 0, 0xEB38, 0xEB39, 0xEB3A,
0, 0x336F, 0x724D, 0x3137, 0, 0xEB3B, 0x7264, 0,
};
+static const unsigned short utf8_to_euc_E9B0_x0213[] = {
+ 0x7E4F, 0, 0xEB26, 0, 0x725A, 0, 0x7256, 0,
+ 0x7257, 0x7253, 0x7259, 0xEB27, 0x7255, 0x3362, 0, 0xEB28,
+ 0x4F4C, 0xEB29, 0x7258, 0x7254, 0x7252, 0x7251, 0xFD5E, 0,
+ 0xFD5F, 0xFD60, 0xFD61, 0x725C, 0xEB2E, 0xFD62, 0xEB2F, 0,
+ 0, 0x725F, 0xFD63, 0x7E50, 0x725E, 0x725D, 0xEB32, 0xFD64,
+ 0xEB34, 0xFD65, 0xFD66, 0, 0, 0x4949, 0x725B, 0x3073,
+ 0x7260, 0xFD68, 0x7262, 0, 0, 0xEB38, 0xFD69, 0xFD6A,
+ 0, 0x336F, 0x724D, 0x3137, 0, 0xEB3B, 0x7264, 0,
+};
static const unsigned short utf8_to_euc_E9B1[] = {
0, 0xEB3C, 0, 0xEB3D, 0xEB3E, 0xEB3F, 0x7263, 0x7261,
0x432D, 0xEB40, 0xEB41, 0, 0, 0, 0xEB42, 0xEB43,
@@ -6099,6 +11548,16 @@ static const unsigned short utf8_to_euc_E9B1[] = {
0xEB54, 0, 0xEB55, 0, 0, 0xEB56, 0x7268, 0xEB57,
0x7269, 0, 0, 0xEB58, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E9B1_x0213[] = {
+ 0, 0x7E51, 0, 0xEB3D, 0xEB3E, 0xFD6B, 0x7263, 0x7261,
+ 0x432D, 0xFD6E, 0xFD6F, 0, 0, 0, 0xEB42, 0x7E52,
+ 0x7E53, 0, 0x4B70, 0x7E54, 0xFD71, 0, 0xEB47, 0x4E5A,
+ 0xFD72, 0, 0x7265, 0xFD73, 0xFD6C, 0xFD74, 0xEB4B, 0xFD75,
+ 0x7266, 0, 0, 0x7E55, 0, 0x7E56, 0, 0x7267,
+ 0xEB52, 0xFD76, 0xFD77, 0xFD78, 0, 0xFD79, 0xFD7A, 0,
+ 0xFD7B, 0, 0xFD7C, 0, 0, 0xFD7D, 0x7268, 0x7E57,
+ 0x7269, 0, 0xFD7E, 0xEB58, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E9B3[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -6109,6 +11568,16 @@ static const unsigned short utf8_to_euc_E9B3[] = {
0x726C, 0, 0xEB5A, 0x4B31, 0x4C44, 0, 0x4650, 0xEB5B,
0, 0xEB5C, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E9B3_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0x443B, 0xFE21, 0x726A,
+ 0, 0x4837, 0, 0x726F, 0x726B, 0, 0, 0,
+ 0x726C, 0, 0xFE22, 0x4B31, 0x4C44, 0, 0x4650, 0xEB5B,
+ 0, 0xEB5C, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E9B4[] = {
0, 0, 0xEB5E, 0x7270, 0, 0, 0x7271, 0x463E,
0x726E, 0x726D, 0, 0xEB5D, 0, 0, 0x322A, 0,
@@ -6119,6 +11588,16 @@ static const unsigned short utf8_to_euc_E9B4[] = {
0xEB66, 0, 0xEB67, 0xEB68, 0xEB69, 0, 0, 0,
0, 0, 0xEB6A, 0x3963, 0xEB6B, 0xEB6D, 0x727C, 0x727B,
};
+static const unsigned short utf8_to_euc_E9B4_x0213[] = {
+ 0, 0, 0xFE24, 0x7270, 0, 0, 0x7271, 0x463E,
+ 0x726E, 0x726D, 0, 0xFE23, 0, 0, 0x322A, 0,
+ 0, 0xFE26, 0x7279, 0, 0, 0x7278, 0, 0xFE27,
+ 0xFE28, 0, 0, 0x3175, 0xEB62, 0x7E58, 0x7E59, 0x7276,
+ 0, 0, 0, 0x7275, 0, 0, 0x7273, 0,
+ 0x337B, 0, 0x7272, 0x3C32, 0x3229, 0, 0, 0xEB65,
+ 0xEB66, 0, 0xFE2C, 0xEB68, 0xEB69, 0, 0, 0,
+ 0, 0, 0xEB6A, 0x3963, 0xEB6B, 0xEB6D, 0x727C, 0x727B,
+};
static const unsigned short utf8_to_euc_E9B5[] = {
0, 0x727A, 0xEB6E, 0xEB6F, 0x7277, 0xEB6C, 0x727D, 0xEB70,
0x727E, 0, 0xEB71, 0, 0, 0, 0, 0,
@@ -6129,6 +11608,16 @@ static const unsigned short utf8_to_euc_E9B5[] = {
0xEB7B, 0, 0x7327, 0, 0, 0, 0xEB7C, 0xEB7D,
0, 0, 0x732C, 0xEB7E, 0xEC21, 0, 0xEC22, 0,
};
+static const unsigned short utf8_to_euc_E9B5_x0213[] = {
+ 0, 0x727A, 0xFE2E, 0x7E5A, 0x7277, 0xEB6C, 0x727D, 0x7E5B,
+ 0x727E, 0, 0xFE2F, 0, 0, 0, 0, 0,
+ 0x7325, 0x7324, 0x7E5C, 0xEB72, 0xEB73, 0, 0, 0,
+ 0, 0x7326, 0, 0, 0x312D, 0x7321, 0x7322, 0xFE30,
+ 0x3974, 0x4C39, 0xFE31, 0x7E5D, 0x7323, 0xEB77, 0, 0,
+ 0, 0xFE33, 0xEB79, 0xFE34, 0x4B32, 0, 0, 0x732B,
+ 0x7E5E, 0, 0x7327, 0xFE36, 0, 0, 0xFE37, 0xFE38,
+ 0, 0, 0x732C, 0xEB7E, 0x7E5F, 0, 0xFE39, 0,
+};
static const unsigned short utf8_to_euc_E9B6[] = {
0, 0, 0, 0xEC23, 0xEC24, 0, 0xEC25, 0x7329,
0, 0x7328, 0xEC26, 0, 0, 0xEC27, 0xEC28, 0x375C,
@@ -6139,6 +11628,16 @@ static const unsigned short utf8_to_euc_E9B6[] = {
0, 0xEC33, 0x7330, 0, 0x4461, 0xEC34, 0, 0,
0x7334, 0xEC35, 0x7335, 0x7333, 0xEC36, 0, 0, 0xEC37,
};
+static const unsigned short utf8_to_euc_E9B6_x0213[] = {
+ 0, 0, 0, 0xEC23, 0xFE3A, 0, 0xEC25, 0x7329,
+ 0, 0x7328, 0x7E60, 0, 0, 0xFE3B, 0xEC28, 0x375C,
+ 0, 0, 0xEC29, 0xEC2A, 0, 0xEC2B, 0x7E61, 0xEC2D,
+ 0xEC2E, 0xFE3C, 0x732D, 0, 0, 0, 0, 0,
+ 0, 0xFE3D, 0, 0, 0x732E, 0, 0, 0,
+ 0, 0x732F, 0xEC30, 0x732A, 0x7E63, 0, 0xEC32, 0x7274,
+ 0, 0xEC33, 0x7330, 0, 0x4461, 0xFE3F, 0, 0,
+ 0x7334, 0xFE40, 0x7335, 0x7333, 0x7E64, 0xFE41, 0, 0xFE3E,
+};
static const unsigned short utf8_to_euc_E9B7[] = {
0, 0x7332, 0x7338, 0xEC38, 0x7331, 0, 0x7336, 0xEC39,
0, 0xEC3A, 0xEC3B, 0, 0, 0, 0, 0x7337,
@@ -6149,6 +11648,16 @@ static const unsigned short utf8_to_euc_E9B7[] = {
0xEC49, 0, 0x4F49, 0xEC4A, 0xEC4B, 0, 0, 0,
0x733B, 0x426B, 0x3A6D, 0, 0, 0x733F, 0xEC4C, 0,
};
+static const unsigned short utf8_to_euc_E9B7_x0213[] = {
+ 0x7E62, 0x7332, 0x7338, 0xFE42, 0x7331, 0, 0x7336, 0xFE43,
+ 0, 0xFE44, 0xEC3B, 0, 0, 0, 0, 0x7337,
+ 0, 0, 0, 0x733A, 0xEC3C, 0xEC3D, 0xFE45, 0x7E65,
+ 0, 0x7339, 0xFE46, 0, 0, 0, 0xEC41, 0xFE47,
+ 0xFE48, 0, 0, 0xFE49, 0, 0xEC44, 0x733C, 0x7E67,
+ 0, 0xEC46, 0, 0xEC47, 0, 0x733D, 0xEC48, 0x733E,
+ 0xEC49, 0, 0x4F49, 0xEC4A, 0xFE4A, 0, 0, 0,
+ 0x733B, 0x426B, 0x3A6D, 0, 0, 0x733F, 0xEC4C, 0,
+};
static const unsigned short utf8_to_euc_E9B8[] = {
0, 0, 0xEC4E, 0, 0, 0, 0, 0xEC4F,
0, 0, 0xEC4D, 0, 0, 0, 0xEC50, 0,
@@ -6159,6 +11668,16 @@ static const unsigned short utf8_to_euc_E9B8[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E9B8_x0213[] = {
+ 0, 0, 0xFE4D, 0, 0, 0, 0, 0x7E68,
+ 0, 0, 0xFE4C, 0, 0, 0xFE4E, 0xEC50, 0,
+ 0xEC51, 0xEC52, 0xEC53, 0, 0, 0x7E69, 0xEC55, 0,
+ 0, 0xFE4F, 0x7340, 0x7341, 0xFE50, 0xFE51, 0x7342, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_E9B9[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -6169,6 +11688,16 @@ static const unsigned short utf8_to_euc_E9B9[] = {
0, 0, 0, 0, 0, 0x7343, 0, 0,
0x3834, 0x7344, 0xEC59, 0xEC5A, 0xEC5B, 0x7345, 0, 0x3C2F,
};
+static const unsigned short utf8_to_euc_E9B9_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0x7343, 0, 0,
+ 0x3834, 0x7344, 0xEC59, 0xFE52, 0x7E6A, 0x7345, 0, 0x3C2F,
+};
static const unsigned short utf8_to_euc_E9BA[] = {
0xEC5C, 0x7346, 0xEC5D, 0xEC5E, 0xEC5F, 0xEC60, 0, 0xEC61,
0x7347, 0, 0, 0x7348, 0x7349, 0, 0xEC62, 0xEC63,
@@ -6179,6 +11708,16 @@ static const unsigned short utf8_to_euc_E9BA[] = {
0xEC6D, 0, 0, 0xEC6E, 0xEC6F, 0xEC70, 0, 0,
0x7350, 0x396D, 0x4C4D, 0x4B63, 0x5677, 0, 0x5D60, 0x4B7B,
};
+static const unsigned short utf8_to_euc_E9BA_x0213[] = {
+ 0xFE54, 0x7346, 0xEC5D, 0xEC5E, 0xEC5F, 0xFE55, 0, 0xEC61,
+ 0x7347, 0, 0, 0x7348, 0x7349, 0, 0xEC62, 0xEC63,
+ 0, 0x734C, 0x734A, 0x4F3C, 0, 0x734B, 0xEC64, 0x4E6F,
+ 0xEC65, 0, 0, 0xFE56, 0, 0x734D, 0x7E6B, 0x4E5B,
+ 0, 0, 0, 0, 0x7E6C, 0x734E, 0x477E, 0,
+ 0xFE57, 0x734F, 0x7351, 0, 0x7E6D, 0x7352, 0xEC6B, 0x7E6E,
+ 0xEC6D, 0, 0, 0xEC6E, 0x7E6F, 0x7E70, 0, 0,
+ 0x7350, 0x396D, 0x4C4D, 0x4B63, 0x5677, 0xFE59, 0x5D60, 0x4B7B,
+};
static const unsigned short utf8_to_euc_E9BB[] = {
0, 0, 0, 0, 0x322B, 0, 0xEC71, 0,
0xEC72, 0, 0, 0xEC73, 0x7354, 0x3550, 0x7355, 0x7356,
@@ -6189,6 +11728,16 @@ static const unsigned short utf8_to_euc_E9BB[] = {
0xEC7B, 0xEC7C, 0xEC7D, 0, 0x7360, 0xEC7E, 0x7361, 0x7362,
0xED21, 0x7363, 0, 0x7364, 0x7365, 0x7366, 0, 0xED22,
};
+static const unsigned short utf8_to_euc_E9BB_x0213[] = {
+ 0, 0, 0, 0x7E71, 0x322B, 0, 0xEC71, 0,
+ 0xEC72, 0, 0, 0xEC73, 0x7354, 0x3550, 0x7355, 0x7356,
+ 0x7357, 0x7E72, 0x3975, 0, 0x7358, 0xEC74, 0, 0,
+ 0x6054, 0x4C5B, 0, 0x4263, 0x7359, 0x735B, 0x735A, 0xFE5B,
+ 0x735C, 0, 0, 0, 0xEC76, 0x735D, 0, 0xFE5C,
+ 0x735E, 0, 0, 0, 0xEC78, 0xEC79, 0xFE5D, 0x735F,
+ 0xEC7B, 0xEC7C, 0xEC7D, 0, 0x7360, 0xEC7E, 0x7361, 0x7362,
+ 0xED21, 0x7363, 0, 0x7364, 0x7365, 0x7366, 0, 0xFE5E,
+};
static const unsigned short utf8_to_euc_E9BC[] = {
0, 0, 0xED23, 0xED24, 0, 0, 0, 0x7367,
0x7368, 0xED25, 0, 0, 0, 0, 0x4524, 0xED26,
@@ -6199,6 +11748,16 @@ static const unsigned short utf8_to_euc_E9BC[] = {
0, 0xED36, 0xED37, 0, 0xED38, 0, 0, 0xED39,
0, 0xED3A, 0xED3B, 0x4921, 0xED3C, 0xED3D, 0x736D, 0xED3E,
};
+static const unsigned short utf8_to_euc_E9BC_x0213[] = {
+ 0, 0, 0xFE5F, 0xFE61, 0, 0, 0, 0x7367,
+ 0x7368, 0xED25, 0, 0, 0, 0, 0x4524, 0xED26,
+ 0x7E73, 0xED28, 0xED29, 0x385D, 0xED2A, 0x736A, 0xED2B, 0xFE62,
+ 0, 0xFE63, 0xED2E, 0xED2F, 0, 0, 0, 0xED30,
+ 0x414D, 0x736B, 0xED31, 0, 0, 0, 0xED32, 0,
+ 0, 0, 0xED33, 0xED34, 0x736C, 0, 0, 0xFE64,
+ 0, 0xED36, 0xED37, 0, 0xED38, 0, 0, 0xFE65,
+ 0, 0x7E74, 0xFE66, 0x4921, 0xED3C, 0xFE67, 0x736D, 0xED3E,
+};
static const unsigned short utf8_to_euc_E9BD[] = {
0, 0xED3F, 0, 0xED40, 0xED41, 0xED42, 0xED43, 0xED44,
0, 0, 0x736E, 0x6337, 0, 0, 0x6C5A, 0x706D,
@@ -6209,6 +11768,16 @@ static const unsigned short utf8_to_euc_E9BD[] = {
0xED52, 0xED53, 0x737A, 0xED54, 0, 0xED55, 0x737B, 0x7379,
0, 0, 0xED56, 0, 0, 0xED57, 0, 0,
};
+static const unsigned short utf8_to_euc_E9BD_x0213[] = {
+ 0, 0xFE68, 0, 0xED40, 0xED41, 0xFE69, 0xFE6A, 0xED44,
+ 0, 0, 0x736E, 0x6337, 0, 0, 0x6C5A, 0x706D,
+ 0, 0, 0x736F, 0xFE6B, 0x7370, 0xFE6C, 0xED47, 0x7E75,
+ 0xFE6D, 0, 0xED4A, 0, 0, 0xFE6F, 0xED4C, 0x7372,
+ 0x7373, 0x7374, 0x4E70, 0x7371, 0, 0, 0x7375, 0x7376,
+ 0xED4D, 0xFE71, 0x7378, 0, 0x7377, 0xFE73, 0xED50, 0xED51,
+ 0xFE74, 0xED53, 0x737A, 0xED54, 0, 0xFE75, 0x737B, 0x7379,
+ 0, 0, 0xED56, 0, 0, 0xED57, 0, 0,
+};
static const unsigned short utf8_to_euc_E9BE[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0x4E36, 0, 0xED58,
@@ -6219,6 +11788,16 @@ static const unsigned short utf8_to_euc_E9BE[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_E9BE_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0x4E36, 0, 0xED58,
+ 0x7E76, 0xED5A, 0xED5B, 0, 0x7E77, 0x737C, 0xED5D, 0x7E78,
+ 0, 0, 0, 0, 0x737D, 0x6354, 0xED5F, 0,
+ 0x737E, 0xED60, 0x7E79, 0xED62, 0, 0xED63, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_EFA4[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -6229,6 +11808,26 @@ static const unsigned short utf8_to_euc_EFA4[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_EFA4_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0x763B, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0x742E, 0x754E, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0x7B4F, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_EFA5_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0x7649, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_EFA7[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -6239,6 +11838,16 @@ static const unsigned short utf8_to_euc_EFA7[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_EFA7_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0x7E24, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0x7D5D, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_EFA8[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0xF434, 0xF437,
@@ -6249,6 +11858,36 @@ static const unsigned short utf8_to_euc_EFA8[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short utf8_to_euc_EFA8_x0213[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0xF434, 0x2F4B,
+ 0x2F57, 0x4F72, 0xF444, 0xAE79, 0x757A, 0x775A, 0x776F, 0xF453,
+ 0xF455, 0x793C, 0x793D, 0x7941, 0xF45A, 0xF45B, 0xF45E, 0x7B3A,
+ 0xF738, 0xF745, 0x7C2E, 0xF469, 0xF96E, 0xF46B, 0x7C6A, 0xF46F,
+ 0xF470, 0xF473, 0xF477, 0xF478, 0xF479, 0xF47D, 0, 0,
+ 0x2E38, 0x2E49, 0x2E50, 0x2E63, 0x2E68, 0x2E6E, 0x2F2C, 0x2F2F,
+ 0x2F36, 0x2F5A, 0x2F5E, 0x4F61, 0x4F62, 0x7450, 0x745C, 0x745E,
+};
+static const unsigned short utf8_to_euc_EFA9_x0213[] = {
+ 0x7461, 0x7528, 0x752B, 0x7543, 0x7565, 0x7669, 0x7677, 0x7725,
+ 0x7755, 0xF029, 0x7825, 0x7927, 0x7933, 0x7934, 0x7937, 0x7938,
+ 0x7939, 0x793B, 0x793F, 0x7940, 0x794D, 0x7951, 0x7964, 0x7A2E,
+ 0xF450, 0x7A33, 0x7A3A, 0x7A44, 0x7A58, 0xF574, 0xF575, 0x7B27,
+ 0x7B6F, 0x7B79, 0x7C2F, 0x7C30, 0x7C38, 0x7C3D, 0xF969, 0x7C59,
+ 0x7D63, 0x7D76, 0x7D7B, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+static const unsigned short utf8_to_euc_EFB9_x0213[] = {
+ 0, 0, 0, 0, 0, 0x233E, 0x233D, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
static const unsigned short utf8_to_euc_EFBC[] = {
0, 0x212A, 0xF42A, 0x2174, 0x2170, 0x2173, 0x2175, 0xF429,
0x214A, 0x214B, 0x2176, 0x215C, 0x2124, 0x215D, 0x2125, 0x213F,
@@ -6259,6 +11898,16 @@ static const unsigned short utf8_to_euc_EFBC[] = {
0x2350, 0x2351, 0x2352, 0x2353, 0x2354, 0x2355, 0x2356, 0x2357,
0x2358, 0x2359, 0x235A, 0x214E, 0x2140, 0x214F, 0x2130, 0x2132,
};
+static const unsigned short utf8_to_euc_EFBC_x0213[] = {
+ 0, 0x212A, 0x2230, 0x2174, 0x2170, 0x2173, 0x2175, 0x222F,
+ 0x214A, 0x214B, 0x2176, 0x215C, 0x2124, 0x2231, 0x2125, 0x213F,
+ 0x2330, 0x2331, 0x2332, 0x2333, 0x2334, 0x2335, 0x2336, 0x2337,
+ 0x2338, 0x2339, 0x2127, 0x2128, 0x2163, 0x2161, 0x2164, 0x2129,
+ 0x2177, 0x2341, 0x2342, 0x2343, 0x2344, 0x2345, 0x2346, 0x2347,
+ 0x2348, 0x2349, 0x234A, 0x234B, 0x234C, 0x234D, 0x234E, 0x234F,
+ 0x2350, 0x2351, 0x2352, 0x2353, 0x2354, 0x2355, 0x2356, 0x2357,
+ 0x2358, 0x2359, 0x235A, 0x214E, 0x2140, 0x214F, 0x2130, 0x2132,
+};
static const unsigned short utf8_to_euc_EFBD[] = {
0x212E, 0x2361, 0x2362, 0x2363, 0x2364, 0x2365, 0x2366, 0x2367,
0x2368, 0x2369, 0x236A, 0x236B, 0x236C, 0x236D, 0x236E, 0x236F,
@@ -6279,6 +11928,16 @@ static const unsigned short utf8_to_euc_EFBD_ms[] = {
0x0E30, 0x0E31, 0x0E32, 0x0E33, 0x0E34, 0x0E35, 0x0E36, 0x0E37,
0x0E38, 0x0E39, 0x0E3A, 0x0E3B, 0x0E3C, 0x0E3D, 0x0E3E, 0x0E3F,
};
+static const unsigned short utf8_to_euc_EFBD_x0213[] = {
+ 0x212E, 0x2361, 0x2362, 0x2363, 0x2364, 0x2365, 0x2366, 0x2367,
+ 0x2368, 0x2369, 0x236A, 0x236B, 0x236C, 0x236D, 0x236E, 0x236F,
+ 0x2370, 0x2371, 0x2372, 0x2373, 0x2374, 0x2375, 0x2376, 0x2377,
+ 0x2378, 0x2379, 0x237A, 0x2150, 0x2143, 0x2151, 0x2232, 0x2256,
+ 0x2257, 0x0E21, 0x0E22, 0x0E23, 0x0E24, 0x0E25, 0x0E26, 0x0E27,
+ 0x0E28, 0x0E29, 0x0E2A, 0x0E2B, 0x0E2C, 0x0E2D, 0x0E2E, 0x0E2F,
+ 0x0E30, 0x0E31, 0x0E32, 0x0E33, 0x0E34, 0x0E35, 0x0E36, 0x0E37,
+ 0x0E38, 0x0E39, 0x0E3A, 0x0E3B, 0x0E3C, 0x0E3D, 0x0E3E, 0x0E3F,
+};
static const unsigned short utf8_to_euc_EFBE[] = {
0x0E40, 0x0E41, 0x0E42, 0x0E43, 0x0E44, 0x0E45, 0x0E46, 0x0E47,
0x0E48, 0x0E49, 0x0E4A, 0x0E4B, 0x0E4C, 0x0E4D, 0x0E4E, 0x0E4F,
@@ -6299,6 +11958,24 @@ static const unsigned short utf8_to_euc_EFBF[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+static const unsigned short *const utf8_to_euc_E1_x0213[] = {
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ utf8_to_euc_E1B8_x0213, 0, 0, 0,
+ 0, utf8_to_euc_E1BD_x0213, 0, 0,
+};
static const unsigned short *const utf8_to_euc_E2[] = {
utf8_to_euc_E280, 0, 0, 0,
utf8_to_euc_E284, utf8_to_euc_E285, utf8_to_euc_E286, utf8_to_euc_E287,
@@ -6371,6 +12048,24 @@ static const unsigned short *const utf8_to_euc_E2_mac[] = {
0, 0, 0, 0,
0, 0, 0, 0,
};
+static const unsigned short *const utf8_to_euc_E2_x0213[] = {
+ utf8_to_euc_E280_x0213, utf8_to_euc_E281_x0213, utf8_to_euc_E282_x0213, 0,
+ utf8_to_euc_E284_x0213, utf8_to_euc_E285_x0213, utf8_to_euc_E286_x0213, utf8_to_euc_E287_x0213,
+ utf8_to_euc_E288_x0213, utf8_to_euc_E289_x0213, utf8_to_euc_E28A_x0213, utf8_to_euc_E28B_x0213,
+ utf8_to_euc_E28C_x0213, 0, utf8_to_euc_E28E_x0213, utf8_to_euc_E28F_x0213,
+ utf8_to_euc_E290_x0213, utf8_to_euc_E291, 0, utf8_to_euc_E293_x0213,
+ utf8_to_euc_E294, utf8_to_euc_E295, utf8_to_euc_E296_x0213, utf8_to_euc_E297_x0213,
+ utf8_to_euc_E298_x0213, utf8_to_euc_E299_x0213, 0, 0,
+ utf8_to_euc_E29C_x0213, utf8_to_euc_E29D_x0213, 0, 0,
+ 0, 0, 0, 0,
+ utf8_to_euc_E2A4_x0213, 0, utf8_to_euc_E2A6_x0213, utf8_to_euc_E2A7_x0213,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+};
static const unsigned short *const utf8_to_euc_E3[] = {
utf8_to_euc_E380, utf8_to_euc_E381, utf8_to_euc_E382, utf8_to_euc_E383,
0, 0, 0, 0,
@@ -6425,6 +12120,24 @@ static const unsigned short *const utf8_to_euc_E3_mac[] = {
0, 0, 0, 0,
0, 0, 0, 0,
};
+static const unsigned short *const utf8_to_euc_E3_x0213[] = {
+ utf8_to_euc_E380_x0213, utf8_to_euc_E381, utf8_to_euc_E382_x0213, utf8_to_euc_E383_x0213,
+ 0, 0, 0, utf8_to_euc_E387_x0213,
+ utf8_to_euc_E388, utf8_to_euc_E389_x0213, utf8_to_euc_E38A_x0213, utf8_to_euc_E38B_x0213,
+ utf8_to_euc_E38C, utf8_to_euc_E38D, utf8_to_euc_E38E, utf8_to_euc_E38F_x0213,
+ utf8_to_euc_E390_x0213, utf8_to_euc_E391_x0213, utf8_to_euc_E392_x0213, utf8_to_euc_E393_x0213,
+ utf8_to_euc_E394_x0213, utf8_to_euc_E395_x0213, utf8_to_euc_E396_x0213, utf8_to_euc_E397_x0213,
+ utf8_to_euc_E398_x0213, utf8_to_euc_E399_x0213, utf8_to_euc_E39A_x0213, utf8_to_euc_E39B_x0213,
+ 0, utf8_to_euc_E39D_x0213, utf8_to_euc_E39E_x0213, utf8_to_euc_E39F_x0213,
+ utf8_to_euc_E3A0_x0213, utf8_to_euc_E3A1_x0213, 0, utf8_to_euc_E3A3_x0213,
+ utf8_to_euc_E3A4_x0213, utf8_to_euc_E3A5_x0213, 0, 0,
+ 0, utf8_to_euc_E3A9_x0213, 0, utf8_to_euc_E3AB_x0213,
+ utf8_to_euc_E3AC_x0213, utf8_to_euc_E3AD_x0213, utf8_to_euc_E3AE_x0213, utf8_to_euc_E3AF_x0213,
+ utf8_to_euc_E3B0_x0213, 0, 0, utf8_to_euc_E3B3_x0213,
+ utf8_to_euc_E3B4_x0213, utf8_to_euc_E3B5_x0213, utf8_to_euc_E3B6_x0213, utf8_to_euc_E3B7_x0213,
+ utf8_to_euc_E3B8_x0213, utf8_to_euc_E3B9_x0213, utf8_to_euc_E3BA_x0213, 0,
+ 0, utf8_to_euc_E3BD_x0213, utf8_to_euc_E3BE_x0213, utf8_to_euc_E3BF_x0213,
+};
static const unsigned short *const utf8_to_euc_E4[] = {
0, 0, 0, 0,
0, 0, 0, 0,
@@ -6443,6 +12156,24 @@ static const unsigned short *const utf8_to_euc_E4[] = {
utf8_to_euc_E4B8, utf8_to_euc_E4B9, utf8_to_euc_E4BA, utf8_to_euc_E4BB,
utf8_to_euc_E4BC, utf8_to_euc_E4BD, utf8_to_euc_E4BE, utf8_to_euc_E4BF,
};
+static const unsigned short *const utf8_to_euc_E4_x0213[] = {
+ utf8_to_euc_E480_x0213, utf8_to_euc_E481_x0213, utf8_to_euc_E482_x0213, 0,
+ utf8_to_euc_E484_x0213, utf8_to_euc_E485_x0213, utf8_to_euc_E486_x0213, utf8_to_euc_E487_x0213,
+ utf8_to_euc_E488_x0213, utf8_to_euc_E489_x0213, 0, utf8_to_euc_E48B_x0213,
+ utf8_to_euc_E48C_x0213, utf8_to_euc_E48D_x0213, 0, utf8_to_euc_E48F_x0213,
+ utf8_to_euc_E490_x0213, utf8_to_euc_E491_x0213, utf8_to_euc_E492_x0213, utf8_to_euc_E493_x0213,
+ utf8_to_euc_E494_x0213, utf8_to_euc_E495_x0213, utf8_to_euc_E496_x0213, utf8_to_euc_E497_x0213,
+ utf8_to_euc_E498_x0213, utf8_to_euc_E499_x0213, utf8_to_euc_E49A_x0213, 0,
+ utf8_to_euc_E49C_x0213, utf8_to_euc_E49D_x0213, 0, utf8_to_euc_E49F_x0213,
+ utf8_to_euc_E4A0_x0213, utf8_to_euc_E4A1_x0213, utf8_to_euc_E4A2_x0213, 0,
+ 0, 0, utf8_to_euc_E4A6_x0213, utf8_to_euc_E4A7_x0213,
+ utf8_to_euc_E4A8_x0213, 0, utf8_to_euc_E4AA_x0213, 0,
+ utf8_to_euc_E4AC_x0213, 0, 0, utf8_to_euc_E4AF_x0213,
+ utf8_to_euc_E4B0_x0213, 0, 0, utf8_to_euc_E4B3_x0213,
+ utf8_to_euc_E4B4_x0213, utf8_to_euc_E4B5_x0213, 0, 0,
+ utf8_to_euc_E4B8_x0213, utf8_to_euc_E4B9_x0213, utf8_to_euc_E4BA_x0213, utf8_to_euc_E4BB_x0213,
+ utf8_to_euc_E4BC_x0213, utf8_to_euc_E4BD_x0213, utf8_to_euc_E4BE_x0213, utf8_to_euc_E4BF_x0213,
+};
static const unsigned short *const utf8_to_euc_E5[] = {
utf8_to_euc_E580, utf8_to_euc_E581, utf8_to_euc_E582, utf8_to_euc_E583,
utf8_to_euc_E584, utf8_to_euc_E585, utf8_to_euc_E586, utf8_to_euc_E587,
@@ -6461,6 +12192,24 @@ static const unsigned short *const utf8_to_euc_E5[] = {
utf8_to_euc_E5B8, utf8_to_euc_E5B9, utf8_to_euc_E5BA, utf8_to_euc_E5BB,
utf8_to_euc_E5BC, utf8_to_euc_E5BD, utf8_to_euc_E5BE, utf8_to_euc_E5BF,
};
+static const unsigned short *const utf8_to_euc_E5_x0213[] = {
+ utf8_to_euc_E580_x0213, utf8_to_euc_E581_x0213, utf8_to_euc_E582_x0213, utf8_to_euc_E583_x0213,
+ utf8_to_euc_E584_x0213, utf8_to_euc_E585_x0213, utf8_to_euc_E586_x0213, utf8_to_euc_E587_x0213,
+ utf8_to_euc_E588_x0213, utf8_to_euc_E589_x0213, utf8_to_euc_E58A_x0213, utf8_to_euc_E58B_x0213,
+ utf8_to_euc_E58C_x0213, utf8_to_euc_E58D_x0213, utf8_to_euc_E58E_x0213, utf8_to_euc_E58F_x0213,
+ utf8_to_euc_E590_x0213, utf8_to_euc_E591_x0213, utf8_to_euc_E592_x0213, utf8_to_euc_E593_x0213,
+ utf8_to_euc_E594_x0213, utf8_to_euc_E595_x0213, utf8_to_euc_E596_x0213, utf8_to_euc_E597_x0213,
+ utf8_to_euc_E598_x0213, utf8_to_euc_E599_x0213, utf8_to_euc_E59A_x0213, utf8_to_euc_E59B_x0213,
+ utf8_to_euc_E59C_x0213, utf8_to_euc_E59D_x0213, utf8_to_euc_E59E_x0213, utf8_to_euc_E59F_x0213,
+ utf8_to_euc_E5A0_x0213, utf8_to_euc_E5A1_x0213, utf8_to_euc_E5A2_x0213, utf8_to_euc_E5A3_x0213,
+ utf8_to_euc_E5A4_x0213, utf8_to_euc_E5A5_x0213, utf8_to_euc_E5A6_x0213, utf8_to_euc_E5A7_x0213,
+ utf8_to_euc_E5A8_x0213, utf8_to_euc_E5A9_x0213, utf8_to_euc_E5AA_x0213, utf8_to_euc_E5AB_x0213,
+ utf8_to_euc_E5AC_x0213, utf8_to_euc_E5AD_x0213, utf8_to_euc_E5AE_x0213, utf8_to_euc_E5AF_x0213,
+ utf8_to_euc_E5B0_x0213, utf8_to_euc_E5B1_x0213, utf8_to_euc_E5B2_x0213, utf8_to_euc_E5B3_x0213,
+ utf8_to_euc_E5B4_x0213, utf8_to_euc_E5B5_x0213, utf8_to_euc_E5B6_x0213, utf8_to_euc_E5B7_x0213,
+ utf8_to_euc_E5B8_x0213, utf8_to_euc_E5B9_x0213, utf8_to_euc_E5BA_x0213, utf8_to_euc_E5BB_x0213,
+ utf8_to_euc_E5BC_x0213, utf8_to_euc_E5BD_x0213, utf8_to_euc_E5BE_x0213, utf8_to_euc_E5BF_x0213,
+};
static const unsigned short *const utf8_to_euc_E6[] = {
utf8_to_euc_E680, utf8_to_euc_E681, utf8_to_euc_E682, utf8_to_euc_E683,
utf8_to_euc_E684, utf8_to_euc_E685, utf8_to_euc_E686, utf8_to_euc_E687,
@@ -6479,6 +12228,24 @@ static const unsigned short *const utf8_to_euc_E6[] = {
utf8_to_euc_E6B8, utf8_to_euc_E6B9, utf8_to_euc_E6BA, utf8_to_euc_E6BB,
utf8_to_euc_E6BC, utf8_to_euc_E6BD, utf8_to_euc_E6BE, utf8_to_euc_E6BF,
};
+static const unsigned short *const utf8_to_euc_E6_x0213[] = {
+ utf8_to_euc_E680_x0213, utf8_to_euc_E681_x0213, utf8_to_euc_E682_x0213, utf8_to_euc_E683_x0213,
+ utf8_to_euc_E684_x0213, utf8_to_euc_E685_x0213, utf8_to_euc_E686_x0213, utf8_to_euc_E687_x0213,
+ utf8_to_euc_E688_x0213, utf8_to_euc_E689_x0213, utf8_to_euc_E68A_x0213, utf8_to_euc_E68B_x0213,
+ utf8_to_euc_E68C_x0213, utf8_to_euc_E68D_x0213, utf8_to_euc_E68E_x0213, utf8_to_euc_E68F_x0213,
+ utf8_to_euc_E690_x0213, utf8_to_euc_E691_x0213, utf8_to_euc_E692_x0213, utf8_to_euc_E693_x0213,
+ utf8_to_euc_E694_x0213, utf8_to_euc_E695_x0213, utf8_to_euc_E696_x0213, utf8_to_euc_E697_x0213,
+ utf8_to_euc_E698_x0213, utf8_to_euc_E699_x0213, utf8_to_euc_E69A_x0213, utf8_to_euc_E69B_x0213,
+ utf8_to_euc_E69C_x0213, utf8_to_euc_E69D_x0213, utf8_to_euc_E69E_x0213, utf8_to_euc_E69F_x0213,
+ utf8_to_euc_E6A0_x0213, utf8_to_euc_E6A1_x0213, utf8_to_euc_E6A2_x0213, utf8_to_euc_E6A3_x0213,
+ utf8_to_euc_E6A4_x0213, utf8_to_euc_E6A5_x0213, utf8_to_euc_E6A6_x0213, utf8_to_euc_E6A7_x0213,
+ utf8_to_euc_E6A8_x0213, utf8_to_euc_E6A9_x0213, utf8_to_euc_E6AA_x0213, utf8_to_euc_E6AB_x0213,
+ utf8_to_euc_E6AC_x0213, utf8_to_euc_E6AD_x0213, utf8_to_euc_E6AE_x0213, utf8_to_euc_E6AF_x0213,
+ utf8_to_euc_E6B0_x0213, utf8_to_euc_E6B1_x0213, utf8_to_euc_E6B2_x0213, utf8_to_euc_E6B3_x0213,
+ utf8_to_euc_E6B4_x0213, utf8_to_euc_E6B5_x0213, utf8_to_euc_E6B6_x0213, utf8_to_euc_E6B7_x0213,
+ utf8_to_euc_E6B8_x0213, utf8_to_euc_E6B9_x0213, utf8_to_euc_E6BA_x0213, utf8_to_euc_E6BB_x0213,
+ utf8_to_euc_E6BC_x0213, utf8_to_euc_E6BD_x0213, utf8_to_euc_E6BE_x0213, utf8_to_euc_E6BF_x0213,
+};
static const unsigned short *const utf8_to_euc_E7[] = {
utf8_to_euc_E780, utf8_to_euc_E781, utf8_to_euc_E782, utf8_to_euc_E783,
utf8_to_euc_E784, utf8_to_euc_E785, utf8_to_euc_E786, utf8_to_euc_E787,
@@ -6497,6 +12264,24 @@ static const unsigned short *const utf8_to_euc_E7[] = {
utf8_to_euc_E7B8, utf8_to_euc_E7B9, utf8_to_euc_E7BA, 0,
utf8_to_euc_E7BC, utf8_to_euc_E7BD, utf8_to_euc_E7BE, utf8_to_euc_E7BF,
};
+static const unsigned short *const utf8_to_euc_E7_x0213[] = {
+ utf8_to_euc_E780_x0213, utf8_to_euc_E781_x0213, utf8_to_euc_E782_x0213, utf8_to_euc_E783_x0213,
+ utf8_to_euc_E784_x0213, utf8_to_euc_E785_x0213, utf8_to_euc_E786_x0213, utf8_to_euc_E787_x0213,
+ utf8_to_euc_E788_x0213, utf8_to_euc_E789_x0213, utf8_to_euc_E78A_x0213, utf8_to_euc_E78B_x0213,
+ utf8_to_euc_E78C_x0213, utf8_to_euc_E78D_x0213, utf8_to_euc_E78E_x0213, utf8_to_euc_E78F_x0213,
+ utf8_to_euc_E790_x0213, utf8_to_euc_E791_x0213, utf8_to_euc_E792_x0213, utf8_to_euc_E793_x0213,
+ utf8_to_euc_E794_x0213, utf8_to_euc_E795_x0213, utf8_to_euc_E796_x0213, utf8_to_euc_E797_x0213,
+ utf8_to_euc_E798_x0213, utf8_to_euc_E799_x0213, utf8_to_euc_E79A_x0213, utf8_to_euc_E79B_x0213,
+ utf8_to_euc_E79C_x0213, utf8_to_euc_E79D_x0213, utf8_to_euc_E79E_x0213, utf8_to_euc_E79F_x0213,
+ utf8_to_euc_E7A0_x0213, utf8_to_euc_E7A1_x0213, utf8_to_euc_E7A2_x0213, utf8_to_euc_E7A3_x0213,
+ utf8_to_euc_E7A4_x0213, utf8_to_euc_E7A5_x0213, utf8_to_euc_E7A6_x0213, utf8_to_euc_E7A7_x0213,
+ utf8_to_euc_E7A8_x0213, utf8_to_euc_E7A9_x0213, utf8_to_euc_E7AA_x0213, utf8_to_euc_E7AB_x0213,
+ utf8_to_euc_E7AC_x0213, utf8_to_euc_E7AD_x0213, utf8_to_euc_E7AE_x0213, utf8_to_euc_E7AF_x0213,
+ utf8_to_euc_E7B0_x0213, utf8_to_euc_E7B1_x0213, utf8_to_euc_E7B2_x0213, utf8_to_euc_E7B3_x0213,
+ utf8_to_euc_E7B4_x0213, utf8_to_euc_E7B5_x0213, utf8_to_euc_E7B6_x0213, utf8_to_euc_E7B7_x0213,
+ utf8_to_euc_E7B8_x0213, utf8_to_euc_E7B9_x0213, utf8_to_euc_E7BA_x0213, 0,
+ utf8_to_euc_E7BC_x0213, utf8_to_euc_E7BD_x0213, utf8_to_euc_E7BE_x0213, utf8_to_euc_E7BF_x0213,
+};
static const unsigned short *const utf8_to_euc_E8[] = {
utf8_to_euc_E880, utf8_to_euc_E881, utf8_to_euc_E882, utf8_to_euc_E883,
utf8_to_euc_E884, utf8_to_euc_E885, utf8_to_euc_E886, utf8_to_euc_E887,
@@ -6515,6 +12300,24 @@ static const unsigned short *const utf8_to_euc_E8[] = {
utf8_to_euc_E8B8, utf8_to_euc_E8B9, utf8_to_euc_E8BA, utf8_to_euc_E8BB,
utf8_to_euc_E8BC, utf8_to_euc_E8BD, utf8_to_euc_E8BE, utf8_to_euc_E8BF,
};
+static const unsigned short *const utf8_to_euc_E8_x0213[] = {
+ utf8_to_euc_E880_x0213, utf8_to_euc_E881_x0213, utf8_to_euc_E882_x0213, utf8_to_euc_E883_x0213,
+ utf8_to_euc_E884_x0213, utf8_to_euc_E885_x0213, utf8_to_euc_E886_x0213, utf8_to_euc_E887_x0213,
+ utf8_to_euc_E888_x0213, utf8_to_euc_E889_x0213, utf8_to_euc_E88A_x0213, utf8_to_euc_E88B_x0213,
+ utf8_to_euc_E88C_x0213, utf8_to_euc_E88D_x0213, utf8_to_euc_E88E_x0213, utf8_to_euc_E88F_x0213,
+ utf8_to_euc_E890_x0213, utf8_to_euc_E891_x0213, utf8_to_euc_E892_x0213, utf8_to_euc_E893_x0213,
+ utf8_to_euc_E894_x0213, utf8_to_euc_E895_x0213, utf8_to_euc_E896_x0213, utf8_to_euc_E897_x0213,
+ utf8_to_euc_E898_x0213, utf8_to_euc_E899_x0213, utf8_to_euc_E89A_x0213, utf8_to_euc_E89B_x0213,
+ utf8_to_euc_E89C_x0213, utf8_to_euc_E89D_x0213, utf8_to_euc_E89E_x0213, utf8_to_euc_E89F_x0213,
+ utf8_to_euc_E8A0_x0213, utf8_to_euc_E8A1_x0213, utf8_to_euc_E8A2_x0213, utf8_to_euc_E8A3_x0213,
+ utf8_to_euc_E8A4_x0213, utf8_to_euc_E8A5_x0213, utf8_to_euc_E8A6_x0213, utf8_to_euc_E8A7_x0213,
+ utf8_to_euc_E8A8_x0213, utf8_to_euc_E8A9_x0213, utf8_to_euc_E8AA_x0213, utf8_to_euc_E8AB_x0213,
+ utf8_to_euc_E8AC_x0213, utf8_to_euc_E8AD_x0213, utf8_to_euc_E8AE_x0213, 0,
+ utf8_to_euc_E8B0_x0213, utf8_to_euc_E8B1_x0213, utf8_to_euc_E8B2_x0213, utf8_to_euc_E8B3_x0213,
+ utf8_to_euc_E8B4_x0213, utf8_to_euc_E8B5_x0213, utf8_to_euc_E8B6_x0213, utf8_to_euc_E8B7_x0213,
+ utf8_to_euc_E8B8_x0213, utf8_to_euc_E8B9_x0213, utf8_to_euc_E8BA_x0213, utf8_to_euc_E8BB_x0213,
+ utf8_to_euc_E8BC_x0213, utf8_to_euc_E8BD_x0213, utf8_to_euc_E8BE_x0213, utf8_to_euc_E8BF_x0213,
+};
static const unsigned short *const utf8_to_euc_E9[] = {
utf8_to_euc_E980, utf8_to_euc_E981, utf8_to_euc_E982, utf8_to_euc_E983,
utf8_to_euc_E984, utf8_to_euc_E985, utf8_to_euc_E986, utf8_to_euc_E987,
@@ -6533,6 +12336,24 @@ static const unsigned short *const utf8_to_euc_E9[] = {
utf8_to_euc_E9B8, utf8_to_euc_E9B9, utf8_to_euc_E9BA, utf8_to_euc_E9BB,
utf8_to_euc_E9BC, utf8_to_euc_E9BD, utf8_to_euc_E9BE, 0,
};
+static const unsigned short *const utf8_to_euc_E9_x0213[] = {
+ utf8_to_euc_E980_x0213, utf8_to_euc_E981_x0213, utf8_to_euc_E982_x0213, utf8_to_euc_E983_x0213,
+ utf8_to_euc_E984_x0213, utf8_to_euc_E985_x0213, utf8_to_euc_E986_x0213, utf8_to_euc_E987_x0213,
+ utf8_to_euc_E988_x0213, utf8_to_euc_E989_x0213, utf8_to_euc_E98A_x0213, utf8_to_euc_E98B_x0213,
+ utf8_to_euc_E98C_x0213, utf8_to_euc_E98D_x0213, utf8_to_euc_E98E_x0213, utf8_to_euc_E98F_x0213,
+ utf8_to_euc_E990_x0213, utf8_to_euc_E991_x0213, utf8_to_euc_E992, 0,
+ 0, utf8_to_euc_E995_x0213, utf8_to_euc_E996_x0213, utf8_to_euc_E997_x0213,
+ utf8_to_euc_E998_x0213, utf8_to_euc_E999_x0213, utf8_to_euc_E99A_x0213, utf8_to_euc_E99B_x0213,
+ utf8_to_euc_E99C_x0213, utf8_to_euc_E99D_x0213, utf8_to_euc_E99E_x0213, utf8_to_euc_E99F_x0213,
+ utf8_to_euc_E9A0_x0213, utf8_to_euc_E9A1_x0213, utf8_to_euc_E9A2_x0213, utf8_to_euc_E9A3_x0213,
+ utf8_to_euc_E9A4_x0213, utf8_to_euc_E9A5_x0213, utf8_to_euc_E9A6_x0213, utf8_to_euc_E9A7_x0213,
+ utf8_to_euc_E9A8_x0213, utf8_to_euc_E9A9_x0213, utf8_to_euc_E9AA_x0213, utf8_to_euc_E9AB_x0213,
+ utf8_to_euc_E9AC_x0213, utf8_to_euc_E9AD_x0213, utf8_to_euc_E9AE_x0213, utf8_to_euc_E9AF_x0213,
+ utf8_to_euc_E9B0_x0213, utf8_to_euc_E9B1_x0213, 0, utf8_to_euc_E9B3_x0213,
+ utf8_to_euc_E9B4_x0213, utf8_to_euc_E9B5_x0213, utf8_to_euc_E9B6_x0213, utf8_to_euc_E9B7_x0213,
+ utf8_to_euc_E9B8_x0213, utf8_to_euc_E9B9_x0213, utf8_to_euc_E9BA_x0213, utf8_to_euc_E9BB_x0213,
+ utf8_to_euc_E9BC_x0213, utf8_to_euc_E9BD_x0213, utf8_to_euc_E9BE_x0213, 0,
+};
static const unsigned short *const utf8_to_euc_EF[] = {
0, 0, 0, 0,
0, 0, 0, 0,
@@ -6569,6 +12390,24 @@ static const unsigned short *const utf8_to_euc_EF_ms[] = {
0, 0, 0, 0,
utf8_to_euc_EFBC, utf8_to_euc_EFBD_ms, utf8_to_euc_EFBE, utf8_to_euc_EFBF,
};
+static const unsigned short *const utf8_to_euc_EF_x0213[] = {
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ utf8_to_euc_EFA4_x0213, utf8_to_euc_EFA5_x0213, 0, utf8_to_euc_EFA7_x0213,
+ utf8_to_euc_EFA8_x0213, utf8_to_euc_EFA9_x0213, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, utf8_to_euc_EFB9_x0213, 0, 0,
+ utf8_to_euc_EFBC_x0213, utf8_to_euc_EFBD_x0213, utf8_to_euc_EFBE, utf8_to_euc_EFBF,
+};
const unsigned short *const utf8_to_euc_2bytes[] = {
0, 0, 0, 0,
0, 0, 0, 0,
@@ -6689,6 +12528,36 @@ const unsigned short *const utf8_to_euc_2bytes_mac[] = {
0, 0, 0, 0,
0, 0, 0, 0,
};
+const unsigned short *const utf8_to_euc_2bytes_x0213[] = {
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, utf8_to_euc_C2_x0213, utf8_to_euc_C3_x0213,
+ utf8_to_euc_C4_x0213, utf8_to_euc_C5_x0213, utf8_to_euc_C6_x0213, utf8_to_euc_C7_x0213,
+ 0, utf8_to_euc_C9_x0213, utf8_to_euc_CA_x0213, utf8_to_euc_CB_x0213,
+ utf8_to_euc_CC_x0213, utf8_to_euc_CD_x0213, utf8_to_euc_CE, utf8_to_euc_CF_x0213,
+ utf8_to_euc_D0, utf8_to_euc_D1, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+};
const unsigned short *const *const utf8_to_euc_3bytes[] = {
0, 0, utf8_to_euc_E2, utf8_to_euc_E3,
utf8_to_euc_E4, utf8_to_euc_E5, utf8_to_euc_E6, utf8_to_euc_E7,
@@ -6713,6 +12582,12 @@ const unsigned short *const *const utf8_to_euc_3bytes_mac[] = {
utf8_to_euc_E8, utf8_to_euc_E9, 0, 0,
0, 0, 0, utf8_to_euc_EF_ms,
};
+const unsigned short *const *const utf8_to_euc_3bytes_x0213[] = {
+ 0, utf8_to_euc_E1_x0213, utf8_to_euc_E2_x0213, utf8_to_euc_E3_x0213,
+ utf8_to_euc_E4_x0213, utf8_to_euc_E5_x0213, utf8_to_euc_E6_x0213, utf8_to_euc_E7_x0213,
+ utf8_to_euc_E8_x0213, utf8_to_euc_E9_x0213, 0, 0,
+ 0, 0, 0, utf8_to_euc_EF_x0213,
+};
#ifdef UNICODE_NORMALIZATION
diff --git a/ext/nkf/nkf-utf8/utf8tbl.h b/ext/nkf/nkf-utf8/utf8tbl.h
index c3d7709ef7..082fb01a5b 100644
--- a/ext/nkf/nkf-utf8/utf8tbl.h
+++ b/ext/nkf/nkf-utf8/utf8tbl.h
@@ -1,7 +1,7 @@
/*
* utf8tbl.h - Header file for Convertion Table
*
- * $Id$
+ * $Id: utf8tbl.h,v 1.3 2008/01/23 09:10:25 naruse Exp $
*/
#ifndef _UTF8TBL_H_
@@ -14,7 +14,17 @@ extern const unsigned short euc_to_utf8_1byte[];
extern const unsigned short *const euc_to_utf8_2bytes[];
extern const unsigned short *const euc_to_utf8_2bytes_ms[];
extern const unsigned short *const euc_to_utf8_2bytes_mac[];
+extern const unsigned short *const euc_to_utf8_2bytes_x0213[];
extern const unsigned short *const x0212_to_utf8_2bytes[];
+extern const unsigned short *const x0212_to_utf8_2bytes_x0213[];
+#define sizeof_x0213_combining_chars 5
+#define sizeof_x0213_combining_table 25
+#define sizeof_x0213_1_surrogate_table 26
+#define sizeof_x0213_2_surrogate_table 277
+extern const unsigned short x0213_combining_chars[sizeof_x0213_combining_chars];
+extern const unsigned short x0213_combining_table[sizeof_x0213_combining_table][3];
+extern const unsigned short x0213_1_surrogate_table[sizeof_x0213_1_surrogate_table][3];
+extern const unsigned short x0213_2_surrogate_table[sizeof_x0213_2_surrogate_table][3];
#endif /* UTF8_OUTPUT_ENABLE */
#ifdef UTF8_INPUT_ENABLE
@@ -26,10 +36,12 @@ extern const unsigned short *const utf8_to_euc_2bytes[];
extern const unsigned short *const utf8_to_euc_2bytes_ms[];
extern const unsigned short *const utf8_to_euc_2bytes_932[];
extern const unsigned short *const utf8_to_euc_2bytes_mac[];
+extern const unsigned short *const utf8_to_euc_2bytes_x0213[];
extern const unsigned short *const *const utf8_to_euc_3bytes[];
extern const unsigned short *const *const utf8_to_euc_3bytes_ms[];
extern const unsigned short *const *const utf8_to_euc_3bytes_932[];
extern const unsigned short *const *const utf8_to_euc_3bytes_mac[];
+extern const unsigned short *const *const utf8_to_euc_3bytes_x0213[];
#endif /* UTF8_INPUT_ENABLE */
#ifdef UNICODE_NORMALIZATION
diff --git a/ext/nkf/nkf.c b/ext/nkf/nkf.c
index 05fd36de64..2f36866ac4 100644
--- a/ext/nkf/nkf.c
+++ b/ext/nkf/nkf.c
@@ -135,7 +135,7 @@ int nkf_split_options(const char *arg)
static VALUE
rb_nkf_convert(VALUE obj, VALUE opt, VALUE src)
{
- volatile VALUE tmp;
+ VALUE tmp;
reinit();
StringValue(opt);
nkf_split_options(RSTRING_PTR(opt));
@@ -156,23 +156,28 @@ rb_nkf_convert(VALUE obj, VALUE opt, VALUE src)
StringValue(src);
input = (unsigned char *)RSTRING_PTR(src);
i_len = RSTRING_LENINT(src);
- tmp = result = rb_str_new(0, i_len*3 + 10);
+ tmp = rb_str_new(0, i_len*3 + 10);
output_ctr = 0;
- output = (unsigned char *)RSTRING_PTR(result);
- o_len = RSTRING_LENINT(result);
+ output = (unsigned char *)RSTRING_PTR(tmp);
+ o_len = RSTRING_LENINT(tmp);
*output = '\0';
+ /* use _result_ begin*/
+ result = tmp;
kanji_convert(NULL);
- rb_str_set_len(result, output_ctr);
- OBJ_INFECT(result, src);
+ result = Qnil;
+ /* use _result_ end */
+
+ rb_str_set_len(tmp, output_ctr);
+ OBJ_INFECT(tmp, src);
if (mimeout_f)
- rb_enc_associate(result, rb_usascii_encoding());
+ rb_enc_associate(tmp, rb_usascii_encoding());
else
- rb_enc_associate(result, rb_nkf_enc_get(nkf_enc_name(output_encoding)));
+ rb_enc_associate(tmp, rb_nkf_enc_get(nkf_enc_name(output_encoding)));
- return result;
+ return tmp;
}
diff --git a/ext/objspace/objspace.c b/ext/objspace/objspace.c
index a0859a7325..1889f11382 100644
--- a/ext/objspace/objspace.c
+++ b/ext/objspace/objspace.c
@@ -60,7 +60,9 @@ memsize_of(VALUE obj)
break;
case T_MODULE:
case T_CLASS:
- size += st_memsize(RCLASS_M_TBL(obj));
+ if (RCLASS_M_TBL(obj)) {
+ size += st_memsize(RCLASS_M_TBL(obj));
+ }
if (RCLASS_IV_TBL(obj)) {
size += st_memsize(RCLASS_IV_TBL(obj));
}
@@ -97,7 +99,7 @@ memsize_of(VALUE obj)
case T_MATCH:
if (RMATCH(obj)->rmatch) {
struct rmatch *rm = RMATCH(obj)->rmatch;
- size += sizeof(struct re_registers); /* TODO: onig_region_memsize(&rm->regs); */
+ size += onig_region_memsize(&rm->regs);
size += sizeof(struct rmatch_offset) * rm->char_offset_num_allocated;
size += sizeof(struct rmatch);
}
@@ -160,7 +162,7 @@ memsize_of(VALUE obj)
* Return consuming memory size of obj.
*
* Note that the return size is incomplete. You need to deal with
- * this information as only a *HINT*. Especaially, the size of
+ * this information as only a *HINT*. Especially, the size of
* T_DATA may not be correct.
*
* This method is not expected to work except C Ruby.
@@ -214,7 +216,7 @@ total_i(void *vstart, void *vend, size_t stride, void *ptr)
* memory size of instances of the given class.
*
* Note that the returned size is incomplete. You need to deal with
- * this information as only a *HINT*. Especaially, the size of
+ * this information as only a *HINT*. Especially, the size of
* T_DATA may not be correct.
*
* Note that this method does *NOT* return total malloc'ed memory size.
@@ -268,6 +270,43 @@ cos_i(void *vstart, void *vend, size_t stride, void *data)
return 0;
}
+static VALUE
+type2sym(enum ruby_value_type i)
+{
+ VALUE type;
+ switch (i) {
+#define CASE_TYPE(t) case t: type = ID2SYM(rb_intern(#t)); break;
+ CASE_TYPE(T_NONE);
+ CASE_TYPE(T_OBJECT);
+ CASE_TYPE(T_CLASS);
+ CASE_TYPE(T_MODULE);
+ CASE_TYPE(T_FLOAT);
+ CASE_TYPE(T_STRING);
+ CASE_TYPE(T_REGEXP);
+ CASE_TYPE(T_ARRAY);
+ CASE_TYPE(T_HASH);
+ CASE_TYPE(T_STRUCT);
+ CASE_TYPE(T_BIGNUM);
+ CASE_TYPE(T_FILE);
+ CASE_TYPE(T_DATA);
+ CASE_TYPE(T_MATCH);
+ CASE_TYPE(T_COMPLEX);
+ CASE_TYPE(T_RATIONAL);
+ CASE_TYPE(T_NIL);
+ CASE_TYPE(T_TRUE);
+ CASE_TYPE(T_FALSE);
+ CASE_TYPE(T_SYMBOL);
+ CASE_TYPE(T_FIXNUM);
+ CASE_TYPE(T_UNDEF);
+ CASE_TYPE(T_NODE);
+ CASE_TYPE(T_ICLASS);
+ CASE_TYPE(T_ZOMBIE);
+#undef CASE_TYPE
+ default: rb_bug("type2sym: unknown type (%d)", i);
+ }
+ return type;
+}
+
/*
* call-seq:
* ObjectSpace.count_objects_size([result_hash]) -> hash
@@ -275,7 +314,7 @@ cos_i(void *vstart, void *vend, size_t stride, void *data)
* Counts objects size (in bytes) for each type.
*
* Note that this information is incomplete. You need to deal with
- * this information as only a *HINT*. Especaially, total size of
+ * this information as only a *HINT*. Especially, total size of
* T_DATA may not right size.
*
* It returns a hash as:
@@ -296,11 +335,11 @@ count_objects_size(int argc, VALUE *argv, VALUE os)
{
size_t counts[T_MASK+1];
size_t total = 0;
- size_t i;
+ enum ruby_value_type i;
VALUE hash;
if (rb_scan_args(argc, argv, "01", &hash) == 1) {
- if (TYPE(hash) != T_HASH)
+ if (!RB_TYPE_P(hash, T_HASH))
rb_raise(rb_eTypeError, "non-hash given");
}
@@ -319,37 +358,7 @@ count_objects_size(int argc, VALUE *argv, VALUE os)
for (i = 0; i <= T_MASK; i++) {
if (counts[i]) {
- VALUE type;
- switch (i) {
-#define COUNT_TYPE(t) case t: type = ID2SYM(rb_intern(#t)); break;
- COUNT_TYPE(T_NONE);
- COUNT_TYPE(T_OBJECT);
- COUNT_TYPE(T_CLASS);
- COUNT_TYPE(T_MODULE);
- COUNT_TYPE(T_FLOAT);
- COUNT_TYPE(T_STRING);
- COUNT_TYPE(T_REGEXP);
- COUNT_TYPE(T_ARRAY);
- COUNT_TYPE(T_HASH);
- COUNT_TYPE(T_STRUCT);
- COUNT_TYPE(T_BIGNUM);
- COUNT_TYPE(T_FILE);
- COUNT_TYPE(T_DATA);
- COUNT_TYPE(T_MATCH);
- COUNT_TYPE(T_COMPLEX);
- COUNT_TYPE(T_RATIONAL);
- COUNT_TYPE(T_NIL);
- COUNT_TYPE(T_TRUE);
- COUNT_TYPE(T_FALSE);
- COUNT_TYPE(T_SYMBOL);
- COUNT_TYPE(T_FIXNUM);
- COUNT_TYPE(T_UNDEF);
- COUNT_TYPE(T_NODE);
- COUNT_TYPE(T_ICLASS);
- COUNT_TYPE(T_ZOMBIE);
-#undef COUNT_TYPE
- default: type = INT2NUM(i); break;
- }
+ VALUE type = type2sym(i);
total += counts[i];
rb_hash_aset(hash, type, SIZET2NUM(counts[i]));
}
@@ -404,7 +413,7 @@ count_nodes(int argc, VALUE *argv, VALUE os)
VALUE hash;
if (rb_scan_args(argc, argv, "01", &hash) == 1) {
- if (TYPE(hash) != T_HASH)
+ if (!RB_TYPE_P(hash, T_HASH))
rb_raise(rb_eTypeError, "non-hash given");
}
@@ -529,7 +538,6 @@ count_nodes(int argc, VALUE *argv, VALUE os)
COUNT_NODE(NODE_ATTRASGN);
COUNT_NODE(NODE_PRELUDE);
COUNT_NODE(NODE_LAMBDA);
- COUNT_NODE(NODE_OPTBLOCK);
#undef COUNT_NODE
default: node = INT2FIX(nodes[i]);
}
@@ -609,7 +617,7 @@ count_tdata_objects(int argc, VALUE *argv, VALUE self)
VALUE hash;
if (rb_scan_args(argc, argv, "01", &hash) == 1) {
- if (TYPE(hash) != T_HASH)
+ if (!RB_TYPE_P(hash, T_HASH))
rb_raise(rb_eTypeError, "non-hash given");
}
@@ -625,6 +633,142 @@ count_tdata_objects(int argc, VALUE *argv, VALUE self)
return hash;
}
+static void
+iow_mark(void *ptr)
+{
+ rb_gc_mark((VALUE)ptr);
+}
+
+static const rb_data_type_t iow_data_type = {
+ "ObjectSpace::InternalObjectWrapper",
+ {iow_mark, 0, 0,},
+};
+
+static VALUE rb_mInternalObjectWrapper;
+
+static VALUE
+iow_newobj(VALUE obj)
+{
+ return rb_data_typed_object_alloc(rb_mInternalObjectWrapper, (void *)obj, &iow_data_type);
+}
+
+static VALUE
+iow_type(VALUE self)
+{
+ VALUE obj = (VALUE)DATA_PTR(self);
+ return type2sym(BUILTIN_TYPE(obj));
+}
+
+static VALUE
+iow_inspect(VALUE self)
+{
+ VALUE obj = (VALUE)DATA_PTR(self);
+ VALUE type = type2sym(BUILTIN_TYPE(obj));
+
+ return rb_sprintf("#<InternalObject:%p %s>", (void *)obj, rb_id2name(SYM2ID(type)));
+}
+
+static VALUE
+iow_internal_object_id(VALUE self)
+{
+ VALUE obj = (VALUE)DATA_PTR(self);
+ return rb_obj_id(obj);
+}
+
+struct rof_data {
+ st_table *refs;
+ VALUE internals;
+};
+
+static void
+reachable_object_from_i(VALUE obj, void *data_ptr)
+{
+ struct rof_data *data = (struct rof_data *)data_ptr;
+ VALUE key = obj;
+ VALUE val = obj;
+
+ if (rb_objspace_markable_object_p(obj)) {
+ if (rb_objspace_internal_object_p(obj)) {
+ val = iow_newobj(obj);
+ rb_ary_push(data->internals, val);
+ }
+ st_insert(data->refs, key, val);
+ }
+}
+
+static int
+collect_values(st_data_t key, st_data_t value, st_data_t data)
+{
+ VALUE ary = (VALUE)data;
+ rb_ary_push(ary, (VALUE)value);
+ return ST_CONTINUE;
+}
+
+/*
+ * call-seq:
+ * ObjectSpace.reachable_objects_from(obj) -> array or nil
+ *
+ * [MRI specific feature] Return all reachable objects from `obj'.
+ *
+ * This method returns all reachable objects from `obj'.
+ * If `obj' has references two or more references to same object `x',
+ * them returned array only include one `x' object.
+ * If `obj' is non-markable (non-heap management) object such as
+ * true, false, nil, symbols and Fixnums (and Flonum) them it simply
+ * returns nil.
+ *
+ * If `obj' has references to internal object, then it returns
+ * instances of `ObjectSpace::InternalObjectWrapper' class.
+ * This object contains a reference to an internal object and
+ * you can check the type of internal object with `type' method.
+ *
+ * If `obj' is instance of `ObjectSpace::InternalObjectWrapper'
+ * class, then this method retuns all reachalbe object from
+ * an interna object, which is pointed by `obj'.
+ *
+ * With this method, you can find memory leaks.
+ *
+ * This method is not expected to work except C Ruby.
+ *
+ * Example:
+ * ObjectSpace.reachable_objects_from(['a', 'b', 'c'])
+ * #=> [Array, 'a', 'b', 'c']
+ *
+ * ObjectSpace.reachable_objects_from(['a', 'a', 'a'])
+ * #=> [Array, 'a', 'a', 'a'] # all 'a' strings have different object id
+ *
+ * ObjectSpace.reachable_objects_from([v = 'a', v, v])
+ * #=> [Array, 'a']
+ *
+ * ObjectSpace.reachable_objects_from(1)
+ * #=> nil # 1 is not markable (heap managed) object
+ *
+ */
+
+static VALUE
+reachable_objects_from(VALUE self, VALUE obj)
+{
+ if (rb_objspace_markable_object_p(obj)) {
+ VALUE ret = rb_ary_new();
+ struct rof_data data;
+
+ if (rb_typeddata_is_kind_of(obj, &iow_data_type)) {
+ obj = (VALUE)DATA_PTR(obj);
+ }
+
+ data.refs = st_init_numtable();
+ data.internals = rb_ary_new();
+
+ rb_objspace_reachable_objects_from(obj, reachable_object_from_i, &data);
+
+ st_foreach(data.refs, collect_values, (st_data_t)ret);
+ return ret;
+ }
+ else {
+ return Qnil;
+ }
+}
+
/* objspace library extends ObjectSpace module and add several
* methods to get internal statistic information about
* object/memory management.
@@ -641,10 +785,16 @@ Init_objspace(void)
VALUE rb_mObjSpace = rb_const_get(rb_cObject, rb_intern("ObjectSpace"));
rb_define_module_function(rb_mObjSpace, "memsize_of", memsize_of_m, 1);
- rb_define_module_function(rb_mObjSpace, "memsize_of_all",
- memsize_of_all_m, -1);
+ rb_define_module_function(rb_mObjSpace, "memsize_of_all", memsize_of_all_m, -1);
rb_define_module_function(rb_mObjSpace, "count_objects_size", count_objects_size, -1);
rb_define_module_function(rb_mObjSpace, "count_nodes", count_nodes, -1);
rb_define_module_function(rb_mObjSpace, "count_tdata_objects", count_tdata_objects, -1);
+
+ rb_define_module_function(rb_mObjSpace, "reachable_objects_from", reachable_objects_from, 1);
+
+ rb_mInternalObjectWrapper = rb_define_class_under(rb_mObjSpace, "InternalObjectWrapper", rb_cObject);
+ rb_define_method(rb_mInternalObjectWrapper, "type", iow_type, 0);
+ rb_define_method(rb_mInternalObjectWrapper, "inspect", iow_inspect, 0);
+ rb_define_method(rb_mInternalObjectWrapper, "internal_object_id", iow_internal_object_id, 0);
}
diff --git a/ext/openssl/deprecation.rb b/ext/openssl/deprecation.rb
new file mode 100644
index 0000000000..39ebfa0d37
--- /dev/null
+++ b/ext/openssl/deprecation.rb
@@ -0,0 +1,21 @@
+module OpenSSL
+ def self.deprecated_warning_flag
+ unless flag = (@deprecated_warning_flag ||= nil)
+ if try_compile("", flag = "-Werror=deprecated-declarations")
+ if with_config("broken-apple-openssl")
+ flag = "-Wno-deprecated-declarations"
+ end
+ $warnflags << " #{flag}"
+ else
+ flag = ""
+ end
+ @deprecated_warning_flag = flag
+ end
+ flag
+ end
+
+ def self.check_func(func, header)
+ have_func(func, header, deprecated_warning_flag) and
+ have_header(header, nil, deprecated_warning_flag)
+ end
+end
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb
index 920caa641d..3d411e0da6 100644
--- a/ext/openssl/extconf.rb
+++ b/ext/openssl/extconf.rb
@@ -1,3 +1,4 @@
+# -*- coding: us-ascii -*-
=begin
= $RCSfile$ -- Generator for Makefile
@@ -15,30 +16,27 @@
=end
require "mkmf"
+require File.expand_path('../deprecation', __FILE__)
dir_config("openssl")
dir_config("kerberos")
-message "=== OpenSSL for Ruby configurator ===\n"
+Logging::message "=== OpenSSL for Ruby configurator ===\n"
##
-# Adds -Wall -DOSSL_DEBUG for compilation and some more targets when GCC is used
+# Adds -DOSSL_DEBUG for compilation and some more targets when GCC is used
# To turn it on, use: --with-debug or --enable-debug
#
if with_config("debug") or enable_config("debug")
$defs.push("-DOSSL_DEBUG") unless $defs.include? "-DOSSL_DEBUG"
-
- if CONFIG['GCC'] == 'yes'
- $CPPFLAGS += " -Wall" unless $CPPFLAGS.split.include? "-Wall"
- end
end
-message "=== Checking for system dependent stuff... ===\n"
+Logging::message "=== Checking for system dependent stuff... ===\n"
have_library("nsl", "t_open")
have_library("socket", "socket")
have_header("assert.h")
-message "=== Checking for required stuff... ===\n"
+Logging::message "=== Checking for required stuff... ===\n"
if $mingw
have_library("wsock32")
have_library("gdi32")
@@ -51,20 +49,20 @@ unless result
result &&= %w[crypto libeay32].any? {|lib| have_library(lib, "OpenSSL_add_all_digests")}
result &&= %w[ssl ssleay32].any? {|lib| have_library(lib, "SSL_library_init")}
unless result
- message "=== Checking for required stuff failed. ===\n"
- message "Makefile wasn't created. Fix the errors above.\n"
+ Logging::message "=== Checking for required stuff failed. ===\n"
+ Logging::message "Makefile wasn't created. Fix the errors above.\n"
exit 1
end
end
unless have_header("openssl/conf_api.h")
- message "OpenSSL 0.9.6 or later required.\n"
- exit 1
+ raise "OpenSSL 0.9.6 or later required."
+end
+unless OpenSSL.check_func("SSL_library_init()", "openssl/ssl.h")
+ raise "Ignore OpenSSL broken by Apple.\nPlease use another openssl. (e.g. using `configure --with-openssl-dir=/path/to/openssl')"
end
-%w"rb_str_set_len rb_block_call".each {|func| have_func(func, "ruby.h")}
-
-message "=== Checking for OpenSSL features... ===\n"
+Logging::message "=== Checking for OpenSSL features... ===\n"
have_func("ERR_peek_last_error")
have_func("ASN1_put_eoc")
have_func("BN_mod_add")
@@ -105,6 +103,13 @@ have_func("OPENSSL_cleanse")
have_func("SSLv2_method")
have_func("SSLv2_server_method")
have_func("SSLv2_client_method")
+have_func("TLSv1_1_method")
+have_func("TLSv1_1_server_method")
+have_func("TLSv1_1_client_method")
+have_func("TLSv1_2_method")
+have_func("TLSv1_2_server_method")
+have_func("TLSv1_2_client_method")
+have_macro("OPENSSL_NPN_NEGOTIATED", ['openssl/ssl.h']) && $defs.push("-DHAVE_OPENSSL_NPN_NEGOTIATED")
unless have_func("SSL_set_tlsext_host_name", ['openssl/ssl.h'])
have_macro("SSL_set_tlsext_host_name", ['openssl/ssl.h']) && $defs.push("-DHAVE_SSL_SET_TLSEXT_HOST_NAME")
end
@@ -115,6 +120,7 @@ if have_header("openssl/engine.h")
have_func("ENGINE_get_digest")
have_func("ENGINE_get_cipher")
have_func("ENGINE_cleanup")
+ have_func("ENGINE_load_dynamic")
have_func("ENGINE_load_4758cca")
have_func("ENGINE_load_aep")
have_func("ENGINE_load_atalla")
@@ -123,7 +129,16 @@ if have_header("openssl/engine.h")
have_func("ENGINE_load_nuron")
have_func("ENGINE_load_sureware")
have_func("ENGINE_load_ubsec")
+ have_func("ENGINE_load_padlock")
+ have_func("ENGINE_load_capi")
+ have_func("ENGINE_load_gmp")
+ have_func("ENGINE_load_gost")
+ have_func("ENGINE_load_cryptodev")
+ have_func("ENGINE_load_aesni")
end
+have_func("DH_generate_parameters_ex")
+have_func("DSA_generate_parameters_ex")
+have_func("RSA_generate_key_ex")
if checking_for('OpenSSL version is 0.9.7 or later') {
try_static_assert('OPENSSL_VERSION_NUMBER >= 0x00907000L', 'openssl/opensslv.h')
}
@@ -132,9 +147,10 @@ end
have_struct_member("EVP_CIPHER_CTX", "flags", "openssl/evp.h")
have_struct_member("EVP_CIPHER_CTX", "engine", "openssl/evp.h")
have_struct_member("X509_ATTRIBUTE", "single", "openssl/x509.h")
+have_macro("OPENSSL_FIPS", ['openssl/opensslconf.h']) && $defs.push("-DHAVE_OPENSSL_FIPS")
-message "=== Checking done. ===\n"
+Logging::message "=== Checking done. ===\n"
create_header
create_makefile("openssl")
-message "Done.\n"
+Logging::message "Done.\n"
diff --git a/ext/openssl/lib/openssl.rb b/ext/openssl/lib/openssl.rb
index 3cff8d9c10..19a4382d0d 100644
--- a/ext/openssl/lib/openssl.rb
+++ b/ext/openssl/lib/openssl.rb
@@ -20,6 +20,5 @@ require 'openssl/bn'
require 'openssl/cipher'
require 'openssl/config'
require 'openssl/digest'
-require 'openssl/ssl-internal'
-require 'openssl/x509-internal'
-
+require 'openssl/x509'
+require 'openssl/ssl'
diff --git a/ext/openssl/lib/openssl/bn.rb b/ext/openssl/lib/openssl/bn.rb
index 1bf3afae42..180de18db1 100644
--- a/ext/openssl/lib/openssl/bn.rb
+++ b/ext/openssl/lib/openssl/bn.rb
@@ -1,18 +1,22 @@
-=begin
-= $RCSfile$ -- Ruby-space definitions that completes C-space funcs for BN
-
-= Info
- 'OpenSSL for Ruby 2' project
- Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz>
- All rights reserved.
-
-= Licence
- This program is licenced under the same licence as Ruby.
- (See the file 'LICENCE'.)
-
-= Version
- $Id$
-=end
+#--
+#
+# $RCSfile$
+#
+# = Ruby-space definitions that completes C-space funcs for BN
+#
+# = Info
+# 'OpenSSL for Ruby 2' project
+# Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz>
+# All rights reserved.
+#
+# = Licence
+# This program is licenced under the same licence as Ruby.
+# (See the file 'LICENCE'.)
+#
+# = Version
+# $Id$
+#
+#++
module OpenSSL
class BN
diff --git a/ext/openssl/lib/openssl/buffering.rb b/ext/openssl/lib/openssl/buffering.rb
index eb39dabcef..51bc968e3a 100644
--- a/ext/openssl/lib/openssl/buffering.rb
+++ b/ext/openssl/lib/openssl/buffering.rb
@@ -307,6 +307,7 @@ module OpenSSL::Buffering
def do_write(s)
@wbuffer = "" unless defined? @wbuffer
@wbuffer << s
+ @wbuffer.force_encoding(Encoding::BINARY)
@sync ||= false
if @sync or @wbuffer.size > BLOCK_SIZE or idx = @wbuffer.rindex($/)
remain = idx ? idx + $/.size : @wbuffer.length
@@ -333,7 +334,7 @@ module OpenSSL::Buffering
def write(s)
do_write(s)
- s.length
+ s.bytesize
end
##
diff --git a/ext/openssl/lib/openssl/cipher.rb b/ext/openssl/lib/openssl/cipher.rb
index d9aac755cd..b3340ff52a 100644
--- a/ext/openssl/lib/openssl/cipher.rb
+++ b/ext/openssl/lib/openssl/cipher.rb
@@ -1,18 +1,22 @@
-=begin
-= $RCSfile$ -- Ruby-space predefined Cipher subclasses
-
-= Info
- 'OpenSSL for Ruby 2' project
- Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz>
- All rights reserved.
-
-= Licence
- This program is licenced under the same licence as Ruby.
- (See the file 'LICENCE'.)
-
-= Version
- $Id$
-=end
+#--
+#
+# $RCSfile$
+#
+# = Ruby-space predefined Cipher subclasses
+#
+# = Info
+# 'OpenSSL for Ruby 2' project
+# Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz>
+# All rights reserved.
+#
+# = Licence
+# This program is licenced under the same licence as Ruby.
+# (See the file 'LICENCE'.)
+#
+# = Version
+# $Id$
+#
+#++
module OpenSSL
class Cipher
diff --git a/ext/openssl/lib/openssl/digest.rb b/ext/openssl/lib/openssl/digest.rb
index d841fef242..1a6108df9a 100644
--- a/ext/openssl/lib/openssl/digest.rb
+++ b/ext/openssl/lib/openssl/digest.rb
@@ -1,18 +1,22 @@
-=begin
-= $RCSfile$ -- Ruby-space predefined Digest subclasses
-
-= Info
- 'OpenSSL for Ruby 2' project
- Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz>
- All rights reserved.
-
-= Licence
- This program is licenced under the same licence as Ruby.
- (See the file 'LICENCE'.)
-
-= Version
- $Id$
-=end
+#--
+#
+# $RCSfile$
+#
+# = Ruby-space predefined Digest subclasses
+#
+# = Info
+# 'OpenSSL for Ruby 2' project
+# Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz>
+# All rights reserved.
+#
+# = Licence
+# This program is licenced under the same licence as Ruby.
+# (See the file 'LICENCE'.)
+#
+# = Version
+# $Id$
+#
+#++
module OpenSSL
class Digest
@@ -22,6 +26,17 @@ module OpenSSL
alg += %w(SHA224 SHA256 SHA384 SHA512)
end
+ # Return the +data+ hash computed with +name+ Digest. +name+ is either the
+ # long name or short name of a supported digest algorithm.
+ #
+ # === Examples
+ #
+ # OpenSSL::Digest.digest("SHA256, "abc")
+ #
+ # which is equivalent to:
+ #
+ # OpenSSL::Digest::SHA256.digest("abc")
+
def self.digest(name, data)
super(data, name)
end
@@ -53,5 +68,22 @@ module OpenSSL
end
end # Digest
+
+ # Returns a Digest subclass by +name+.
+ #
+ # require 'openssl'
+ #
+ # OpenSSL::Digest("MD5")
+ # # => OpenSSL::Digest::MD5
+ #
+ # Digest("Foo")
+ # # => NameError: wrong constant name Foo
+
+ def Digest(name)
+ OpenSSL::Digest.const_get(name)
+ end
+
+ module_function :Digest
+
end # OpenSSL
diff --git a/ext/openssl/lib/openssl/ssl-internal.rb b/ext/openssl/lib/openssl/ssl-internal.rb
deleted file mode 100644
index c70b5b8f6b..0000000000
--- a/ext/openssl/lib/openssl/ssl-internal.rb
+++ /dev/null
@@ -1,177 +0,0 @@
-=begin
-= $RCSfile$ -- Ruby-space definitions that completes C-space funcs for SSL
-
-= Info
- 'OpenSSL for Ruby 2' project
- Copyright (C) 2001 GOTOU YUUZOU <gotoyuzo@notwork.org>
- All rights reserved.
-
-= Licence
- This program is licenced under the same licence as Ruby.
- (See the file 'LICENCE'.)
-
-= Version
- $Id$
-=end
-
-require "openssl/buffering"
-require "fcntl"
-
-module OpenSSL
- module SSL
- class SSLContext
- DEFAULT_PARAMS = {
- :ssl_version => "SSLv23",
- :verify_mode => OpenSSL::SSL::VERIFY_PEER,
- :ciphers => "ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW",
- :options => OpenSSL::SSL::OP_ALL,
- }
-
- DEFAULT_CERT_STORE = OpenSSL::X509::Store.new
- DEFAULT_CERT_STORE.set_default_paths
- if defined?(OpenSSL::X509::V_FLAG_CRL_CHECK_ALL)
- DEFAULT_CERT_STORE.flags = OpenSSL::X509::V_FLAG_CRL_CHECK_ALL
- end
-
- def set_params(params={})
- params = DEFAULT_PARAMS.merge(params)
- params.each{|name, value| self.__send__("#{name}=", value) }
- if self.verify_mode != OpenSSL::SSL::VERIFY_NONE
- unless self.ca_file or self.ca_path or self.cert_store
- self.cert_store = DEFAULT_CERT_STORE
- end
- end
- return params
- end
- end
-
- module SocketForwarder
- def addr
- to_io.addr
- end
-
- def peeraddr
- to_io.peeraddr
- end
-
- def setsockopt(level, optname, optval)
- to_io.setsockopt(level, optname, optval)
- end
-
- def getsockopt(level, optname)
- to_io.getsockopt(level, optname)
- end
-
- def fcntl(*args)
- to_io.fcntl(*args)
- end
-
- def closed?
- to_io.closed?
- end
-
- def do_not_reverse_lookup=(flag)
- to_io.do_not_reverse_lookup = flag
- end
- end
-
- module Nonblock
- def initialize(*args)
- flag = File::NONBLOCK
- flag |= @io.fcntl(Fcntl::F_GETFL) if defined?(Fcntl::F_GETFL)
- @io.fcntl(Fcntl::F_SETFL, flag)
- super
- end
- end
-
- def verify_certificate_identity(cert, hostname)
- should_verify_common_name = true
- cert.extensions.each{|ext|
- next if ext.oid != "subjectAltName"
- ext.value.split(/,\s+/).each{|general_name|
- if /\ADNS:(.*)/ =~ general_name
- should_verify_common_name = false
- reg = Regexp.escape($1).gsub(/\\\*/, "[^.]+")
- return true if /\A#{reg}\z/i =~ hostname
- elsif /\AIP Address:(.*)/ =~ general_name
- should_verify_common_name = false
- return true if $1 == hostname
- end
- }
- }
- if should_verify_common_name
- cert.subject.to_a.each{|oid, value|
- if oid == "CN"
- reg = Regexp.escape(value).gsub(/\\\*/, "[^.]+")
- return true if /\A#{reg}\z/i =~ hostname
- end
- }
- end
- return false
- end
- module_function :verify_certificate_identity
-
- class SSLSocket
- include Buffering
- include SocketForwarder
- include Nonblock
-
- def post_connection_check(hostname)
- unless OpenSSL::SSL.verify_certificate_identity(peer_cert, hostname)
- raise SSLError, "hostname does not match the server certificate"
- end
- return true
- end
-
- def session
- SSL::Session.new(self)
- rescue SSL::Session::SessionError
- nil
- end
- end
-
- class SSLServer
- include SocketForwarder
- attr_accessor :start_immediately
-
- def initialize(svr, ctx)
- @svr = svr
- @ctx = ctx
- unless ctx.session_id_context
- session_id = OpenSSL::Digest::MD5.hexdigest($0)
- @ctx.session_id_context = session_id
- end
- @start_immediately = true
- end
-
- def to_io
- @svr
- end
-
- def listen(backlog=5)
- @svr.listen(backlog)
- end
-
- def shutdown(how=Socket::SHUT_RDWR)
- @svr.shutdown(how)
- end
-
- def accept
- sock = @svr.accept
- begin
- ssl = OpenSSL::SSL::SSLSocket.new(sock, @ctx)
- ssl.sync_close = true
- ssl.accept if @start_immediately
- ssl
- rescue SSLError => ex
- sock.close
- raise ex
- end
- end
-
- def close
- @svr.close
- end
- end
- end
-end
diff --git a/ext/openssl/lib/openssl/ssl.rb b/ext/openssl/lib/openssl/ssl.rb
index 15f42d6091..268e8e9d67 100644
--- a/ext/openssl/lib/openssl/ssl.rb
+++ b/ext/openssl/lib/openssl/ssl.rb
@@ -1,2 +1,187 @@
-warn 'deprecated openssl/ssl use: require "openssl" instead of "openssl/ssl"'
-require 'openssl'
+=begin
+= $RCSfile$ -- Ruby-space definitions that completes C-space funcs for SSL
+
+= Info
+ 'OpenSSL for Ruby 2' project
+ Copyright (C) 2001 GOTOU YUUZOU <gotoyuzo@notwork.org>
+ All rights reserved.
+
+= Licence
+ This program is licenced under the same licence as Ruby.
+ (See the file 'LICENCE'.)
+
+= Version
+ $Id$
+=end
+
+require "openssl/buffering"
+require "fcntl"
+
+module OpenSSL
+ module SSL
+ class SSLContext
+ DEFAULT_PARAMS = {
+ :ssl_version => "SSLv23",
+ :verify_mode => OpenSSL::SSL::VERIFY_PEER,
+ :ciphers => "ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW",
+ :options => OpenSSL::SSL::OP_ALL,
+ }
+
+ DEFAULT_CERT_STORE = OpenSSL::X509::Store.new
+ DEFAULT_CERT_STORE.set_default_paths
+ if defined?(OpenSSL::X509::V_FLAG_CRL_CHECK_ALL)
+ DEFAULT_CERT_STORE.flags = OpenSSL::X509::V_FLAG_CRL_CHECK_ALL
+ end
+
+ ##
+ # Sets the parameters for this SSL context to the values in +params+.
+ # The keys in +params+ must be assignment methods on SSLContext.
+ #
+ # If the verify_mode is not VERIFY_NONE and ca_file, ca_path and
+ # cert_store are not set then the system default certificate store is
+ # used.
+
+ def set_params(params={})
+ params = DEFAULT_PARAMS.merge(params)
+ params.each{|name, value| self.__send__("#{name}=", value) }
+ if self.verify_mode != OpenSSL::SSL::VERIFY_NONE
+ unless self.ca_file or self.ca_path or self.cert_store
+ self.cert_store = DEFAULT_CERT_STORE
+ end
+ end
+ return params
+ end
+ end
+
+ module SocketForwarder
+ def addr
+ to_io.addr
+ end
+
+ def peeraddr
+ to_io.peeraddr
+ end
+
+ def setsockopt(level, optname, optval)
+ to_io.setsockopt(level, optname, optval)
+ end
+
+ def getsockopt(level, optname)
+ to_io.getsockopt(level, optname)
+ end
+
+ def fcntl(*args)
+ to_io.fcntl(*args)
+ end
+
+ def closed?
+ to_io.closed?
+ end
+
+ def do_not_reverse_lookup=(flag)
+ to_io.do_not_reverse_lookup = flag
+ end
+ end
+
+ module Nonblock
+ def initialize(*args)
+ flag = File::NONBLOCK
+ flag |= @io.fcntl(Fcntl::F_GETFL) if defined?(Fcntl::F_GETFL)
+ @io.fcntl(Fcntl::F_SETFL, flag)
+ super
+ end
+ end
+
+ def verify_certificate_identity(cert, hostname)
+ should_verify_common_name = true
+ cert.extensions.each{|ext|
+ next if ext.oid != "subjectAltName"
+ ext.value.split(/,\s+/).each{|general_name|
+ if /\ADNS:(.*)/ =~ general_name
+ should_verify_common_name = false
+ reg = Regexp.escape($1).gsub(/\\\*/, "[^.]+")
+ return true if /\A#{reg}\z/i =~ hostname
+ elsif /\AIP Address:(.*)/ =~ general_name
+ should_verify_common_name = false
+ return true if $1 == hostname
+ end
+ }
+ }
+ if should_verify_common_name
+ cert.subject.to_a.each{|oid, value|
+ if oid == "CN"
+ reg = Regexp.escape(value).gsub(/\\\*/, "[^.]+")
+ return true if /\A#{reg}\z/i =~ hostname
+ end
+ }
+ end
+ return false
+ end
+ module_function :verify_certificate_identity
+
+ class SSLSocket
+ include Buffering
+ include SocketForwarder
+ include Nonblock
+
+ def post_connection_check(hostname)
+ unless OpenSSL::SSL.verify_certificate_identity(peer_cert, hostname)
+ raise SSLError, "hostname \"#{hostname}\" does not match the server certificate"
+ end
+ return true
+ end
+
+ def session
+ SSL::Session.new(self)
+ rescue SSL::Session::SessionError
+ nil
+ end
+ end
+
+ class SSLServer
+ include SocketForwarder
+ attr_accessor :start_immediately
+
+ def initialize(svr, ctx)
+ @svr = svr
+ @ctx = ctx
+ unless ctx.session_id_context
+ # see #6137 - session id may not exceed 32 bytes
+ prng = ::Random.new($0.hash)
+ session_id = prng.bytes(16).unpack('H*')[0]
+ @ctx.session_id_context = session_id
+ end
+ @start_immediately = true
+ end
+
+ def to_io
+ @svr
+ end
+
+ def listen(backlog=5)
+ @svr.listen(backlog)
+ end
+
+ def shutdown(how=Socket::SHUT_RDWR)
+ @svr.shutdown(how)
+ end
+
+ def accept
+ sock = @svr.accept
+ begin
+ ssl = OpenSSL::SSL::SSLSocket.new(sock, @ctx)
+ ssl.sync_close = true
+ ssl.accept if @start_immediately
+ ssl
+ rescue SSLError => ex
+ sock.close
+ raise ex
+ end
+ end
+
+ def close
+ @svr.close
+ end
+ end
+ end
+end
diff --git a/ext/openssl/lib/openssl/x509-internal.rb b/ext/openssl/lib/openssl/x509-internal.rb
deleted file mode 100644
index 47e3a6f876..0000000000
--- a/ext/openssl/lib/openssl/x509-internal.rb
+++ /dev/null
@@ -1,158 +0,0 @@
-=begin
-= $RCSfile$ -- Ruby-space definitions that completes C-space funcs for X509 and subclasses
-
-= Info
- 'OpenSSL for Ruby 2' project
- Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz>
- All rights reserved.
-
-= Licence
- This program is licenced under the same licence as Ruby.
- (See the file 'LICENCE'.)
-
-= Version
- $Id$
-=end
-
-module OpenSSL
- module X509
- class ExtensionFactory
- def create_extension(*arg)
- if arg.size > 1
- create_ext(*arg)
- else
- send("create_ext_from_"+arg[0].class.name.downcase, arg[0])
- end
- end
-
- def create_ext_from_array(ary)
- raise ExtensionError, "unexpected array form" if ary.size > 3
- create_ext(ary[0], ary[1], ary[2])
- end
-
- def create_ext_from_string(str) # "oid = critical, value"
- oid, value = str.split(/=/, 2)
- oid.strip!
- value.strip!
- create_ext(oid, value)
- end
-
- def create_ext_from_hash(hash)
- create_ext(hash["oid"], hash["value"], hash["critical"])
- end
- end
-
- class Extension
- def to_s # "oid = critical, value"
- str = self.oid
- str << " = "
- str << "critical, " if self.critical?
- str << self.value.gsub(/\n/, ", ")
- end
-
- def to_h # {"oid"=>sn|ln, "value"=>value, "critical"=>true|false}
- {"oid"=>self.oid,"value"=>self.value,"critical"=>self.critical?}
- end
-
- def to_a
- [ self.oid, self.value, self.critical? ]
- end
- end
-
- class Name
- module RFC2253DN
- Special = ',=+<>#;'
- HexChar = /[0-9a-fA-F]/
- HexPair = /#{HexChar}#{HexChar}/
- HexString = /#{HexPair}+/
- Pair = /\\(?:[#{Special}]|\\|"|#{HexPair})/
- StringChar = /[^#{Special}\\"]/
- QuoteChar = /[^\\"]/
- AttributeType = /[a-zA-Z][0-9a-zA-Z]*|[0-9]+(?:\.[0-9]+)*/
- AttributeValue = /
- (?!["#])((?:#{StringChar}|#{Pair})*)|
- \#(#{HexString})|
- "((?:#{QuoteChar}|#{Pair})*)"
- /x
- TypeAndValue = /\A(#{AttributeType})=#{AttributeValue}/
-
- module_function
-
- def expand_pair(str)
- return nil unless str
- return str.gsub(Pair){
- pair = $&
- case pair.size
- when 2 then pair[1,1]
- when 3 then Integer("0x#{pair[1,2]}").chr
- else raise OpenSSL::X509::NameError, "invalid pair: #{str}"
- end
- }
- end
-
- def expand_hexstring(str)
- return nil unless str
- der = str.gsub(HexPair){$&.to_i(16).chr }
- a1 = OpenSSL::ASN1.decode(der)
- return a1.value, a1.tag
- end
-
- def expand_value(str1, str2, str3)
- value = expand_pair(str1)
- value, tag = expand_hexstring(str2) unless value
- value = expand_pair(str3) unless value
- return value, tag
- end
-
- def scan(dn)
- str = dn
- ary = []
- while true
- if md = TypeAndValue.match(str)
- remain = md.post_match
- type = md[1]
- value, tag = expand_value(md[2], md[3], md[4]) rescue nil
- if value
- type_and_value = [type, value]
- type_and_value.push(tag) if tag
- ary.unshift(type_and_value)
- if remain.length > 2 && remain[0] == ?,
- str = remain[1..-1]
- next
- elsif remain.length > 2 && remain[0] == ?+
- raise OpenSSL::X509::NameError,
- "multi-valued RDN is not supported: #{dn}"
- elsif remain.empty?
- break
- end
- end
- end
- msg_dn = dn[0, dn.length - str.length] + " =>" + str
- raise OpenSSL::X509::NameError, "malformed RDN: #{msg_dn}"
- end
- return ary
- end
- end
-
- class << self
- def parse_rfc2253(str, template=OBJECT_TYPE_TEMPLATE)
- ary = OpenSSL::X509::Name::RFC2253DN.scan(str)
- self.new(ary, template)
- end
-
- def parse_openssl(str, template=OBJECT_TYPE_TEMPLATE)
- ary = str.scan(/\s*([^\/,]+)\s*/).collect{|i| i[0].split("=", 2) }
- self.new(ary, template)
- end
-
- alias parse parse_openssl
- end
- end
-
- class StoreContext
- def cleanup
- warn "(#{caller.first}) OpenSSL::X509::StoreContext#cleanup is deprecated with no replacement" if $VERBOSE
- end
- end
- end
-end
diff --git a/ext/openssl/lib/openssl/x509.rb b/ext/openssl/lib/openssl/x509.rb
index f1777cdf06..31a4381db4 100644
--- a/ext/openssl/lib/openssl/x509.rb
+++ b/ext/openssl/lib/openssl/x509.rb
@@ -1,2 +1,162 @@
-warn 'deprecated openssl/x509 use: require "openssl" instead of "openssl/x509"'
-require 'openssl'
+#--
+#
+# $RCSfile$
+#
+# = Ruby-space definitions that completes C-space funcs for X509 and subclasses
+#
+# = Info
+# 'OpenSSL for Ruby 2' project
+# Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz>
+# All rights reserved.
+#
+# = Licence
+# This program is licenced under the same licence as Ruby.
+# (See the file 'LICENCE'.)
+#
+# = Version
+# $Id$
+#
+#++
+
+module OpenSSL
+ module X509
+ class ExtensionFactory
+ def create_extension(*arg)
+ if arg.size > 1
+ create_ext(*arg)
+ else
+ send("create_ext_from_"+arg[0].class.name.downcase, arg[0])
+ end
+ end
+
+ def create_ext_from_array(ary)
+ raise ExtensionError, "unexpected array form" if ary.size > 3
+ create_ext(ary[0], ary[1], ary[2])
+ end
+
+ def create_ext_from_string(str) # "oid = critical, value"
+ oid, value = str.split(/=/, 2)
+ oid.strip!
+ value.strip!
+ create_ext(oid, value)
+ end
+
+ def create_ext_from_hash(hash)
+ create_ext(hash["oid"], hash["value"], hash["critical"])
+ end
+ end
+
+ class Extension
+ def to_s # "oid = critical, value"
+ str = self.oid
+ str << " = "
+ str << "critical, " if self.critical?
+ str << self.value.gsub(/\n/, ", ")
+ end
+
+ def to_h # {"oid"=>sn|ln, "value"=>value, "critical"=>true|false}
+ {"oid"=>self.oid,"value"=>self.value,"critical"=>self.critical?}
+ end
+
+ def to_a
+ [ self.oid, self.value, self.critical? ]
+ end
+ end
+
+ class Name
+ module RFC2253DN
+ Special = ',=+<>#;'
+ HexChar = /[0-9a-fA-F]/
+ HexPair = /#{HexChar}#{HexChar}/
+ HexString = /#{HexPair}+/
+ Pair = /\\(?:[#{Special}]|\\|"|#{HexPair})/
+ StringChar = /[^#{Special}\\"]/
+ QuoteChar = /[^\\"]/
+ AttributeType = /[a-zA-Z][0-9a-zA-Z]*|[0-9]+(?:\.[0-9]+)*/
+ AttributeValue = /
+ (?!["#])((?:#{StringChar}|#{Pair})*)|
+ \#(#{HexString})|
+ "((?:#{QuoteChar}|#{Pair})*)"
+ /x
+ TypeAndValue = /\A(#{AttributeType})=#{AttributeValue}/
+
+ module_function
+
+ def expand_pair(str)
+ return nil unless str
+ return str.gsub(Pair){
+ pair = $&
+ case pair.size
+ when 2 then pair[1,1]
+ when 3 then Integer("0x#{pair[1,2]}").chr
+ else raise OpenSSL::X509::NameError, "invalid pair: #{str}"
+ end
+ }
+ end
+
+ def expand_hexstring(str)
+ return nil unless str
+ der = str.gsub(HexPair){$&.to_i(16).chr }
+ a1 = OpenSSL::ASN1.decode(der)
+ return a1.value, a1.tag
+ end
+
+ def expand_value(str1, str2, str3)
+ value = expand_pair(str1)
+ value, tag = expand_hexstring(str2) unless value
+ value = expand_pair(str3) unless value
+ return value, tag
+ end
+
+ def scan(dn)
+ str = dn
+ ary = []
+ while true
+ if md = TypeAndValue.match(str)
+ remain = md.post_match
+ type = md[1]
+ value, tag = expand_value(md[2], md[3], md[4]) rescue nil
+ if value
+ type_and_value = [type, value]
+ type_and_value.push(tag) if tag
+ ary.unshift(type_and_value)
+ if remain.length > 2 && remain[0] == ?,
+ str = remain[1..-1]
+ next
+ elsif remain.length > 2 && remain[0] == ?+
+ raise OpenSSL::X509::NameError,
+ "multi-valued RDN is not supported: #{dn}"
+ elsif remain.empty?
+ break
+ end
+ end
+ end
+ msg_dn = dn[0, dn.length - str.length] + " =>" + str
+ raise OpenSSL::X509::NameError, "malformed RDN: #{msg_dn}"
+ end
+ return ary
+ end
+ end
+
+ class << self
+ def parse_rfc2253(str, template=OBJECT_TYPE_TEMPLATE)
+ ary = OpenSSL::X509::Name::RFC2253DN.scan(str)
+ self.new(ary, template)
+ end
+
+ def parse_openssl(str, template=OBJECT_TYPE_TEMPLATE)
+ ary = str.scan(/\s*([^\/,]+)\s*/).collect{|i| i[0].split("=", 2) }
+ self.new(ary, template)
+ end
+
+ alias parse parse_openssl
+ end
+ end
+
+ class StoreContext
+ def cleanup
+ warn "(#{caller.first}) OpenSSL::X509::StoreContext#cleanup is deprecated with no replacement" if $VERBOSE
+ end
+ end
+ end
+end
diff --git a/ext/openssl/ossl.c b/ext/openssl/ossl.c
index f3410b64e8..ac8f63800d 100644
--- a/ext/openssl/ossl.c
+++ b/ext/openssl/ossl.c
@@ -175,7 +175,11 @@ ossl_pem_passwd_cb(char *buf, int max_len, int flag, void *pwd)
*/
rflag = flag ? Qtrue : Qfalse;
pass = rb_protect(ossl_pem_passwd_cb0, rflag, &status);
- if (status) return -1; /* exception was raised. */
+ if (status) {
+ /* ignore an exception raised. */
+ rb_set_errinfo(Qnil);
+ return -1;
+ }
len = RSTRING_LENINT(pass);
if (len < 4) { /* 4 is OpenSSL hardcoded limit */
rb_warning("password must be longer than 4 bytes");
@@ -216,18 +220,23 @@ ossl_verify_cb(int ok, X509_STORE_CTX *ctx)
if ((void*)proc == 0)
return ok;
if (!NIL_P(proc)) {
+ ret = Qfalse;
rctx = rb_protect((VALUE(*)(VALUE))ossl_x509stctx_new,
(VALUE)ctx, &state);
- ret = Qfalse;
- if (!state) {
+ if (state) {
+ rb_set_errinfo(Qnil);
+ rb_warn("StoreContext initialization failure");
+ }
+ else {
args.proc = proc;
args.preverify_ok = ok ? Qtrue : Qfalse;
args.store_ctx = rctx;
ret = rb_protect((VALUE(*)(VALUE))ossl_call_verify_cb_proc, (VALUE)&args, &state);
- ossl_x509stctx_clear_ptr(rctx);
if (state) {
+ rb_set_errinfo(Qnil);
rb_warn("exception in verify_callback is ignored");
}
+ ossl_x509stctx_clear_ptr(rctx);
}
if (ret == Qtrue) {
X509_STORE_CTX_set_error(ctx, X509_V_OK);
@@ -446,7 +455,7 @@ ossl_debug_set(VALUE self, VALUE val)
* ahold of the key may use it unless it is encrypted. In order to securely
* export a key you may export it with a pass phrase.
*
- * cipher = OpenSSL::Cipher::Cipher.new 'AES-128-CBC'
+ * cipher = OpenSSL::Cipher.new 'AES-128-CBC'
* pass_phrase = 'my secure pass phrase goes here'
*
* key_secure = key.export cipher, pass_phrase
@@ -480,35 +489,126 @@ ossl_debug_set(VALUE self, VALUE val)
*
* == RSA Encryption
*
- * RSA provides ecryption and decryption using the public and private keys.
+ * RSA provides encryption and decryption using the public and private keys.
* You can use a variety of padding methods depending upon the intended use of
* encrypted data.
*
+ * === Encryption & Decryption
+ *
+ * Asymmetric public/private key encryption is slow and victim to attack in
+ * cases where it is used without padding or directly to encrypt larger chunks
+ * of data. Typical use cases for RSA encryption involve "wrapping" a symmetric
+ * key with the public key of the recipient who would "unwrap" that symmetric
+ * key again using their private key.
+ * The following illustrates a simplified example of such a key transport
+ * scheme. It shouldn't be used in practice, though, standardized protocols
+ * should always be preferred.
+ *
+ * wrapped_key = key.public_encrypt key
+ *
+ * A symmetric key encrypted with the public key can only be decrypted with
+ * the corresponding private key of the recipient.
+ *
+ * original_key = key.private_decrypt wrapped_key
+ *
+ * By default PKCS#1 padding will be used, but it is also possible to use
+ * other forms of padding, see PKey::RSA for further details.
+ *
+ * === Signatures
+ *
+ * Using "private_encrypt" to encrypt some data with the private key is
+ * equivalent to applying a digital signature to the data. A verifying
+ * party may validate the signature by comparing the result of decrypting
+ * the signature with "public_decrypt" to the original data. However,
+ * OpenSSL::PKey already has methods "sign" and "verify" that handle
+ * digital signatures in a standardized way - "private_encrypt" and
+ * "public_decrypt" shouldn't be used in practice.
+ *
+ * To sign a document, a cryptographically secure hash of the document is
+ * computed first, which is then signed using the private key.
+ *
+ * digest = OpenSSL::Digest::SHA256.new
+ * signature = key.sign digest, document
+ *
+ * To validate the signature, again a hash of the document is computed and
+ * the signature is decrypted using the public key. The result is then
+ * compared to the hash just computed, if they are equal the signature was
+ * valid.
+ *
+ * digest = OpenSSL::Digest::SHA256.new
+ * if key.verify digest, signature, document
+ * puts 'Valid'
+ * else
+ * puts 'Invalid'
+ * end
+ *
+ * == PBKDF2 Password-based Encryption
+ *
+ * If supported by the underlying OpenSSL version used, Password-based
+ * Encryption should use the features of PKCS5. If not supported or if
+ * required by legacy applications, the older, less secure methods specified
+ * in RFC 2898 are also supported (see below).
+ *
+ * PKCS5 supports PBKDF2 as it was specified in PKCS#5
+ * v2.0[http://www.rsa.com/rsalabs/node.asp?id=2127]. It still uses a
+ * password, a salt, and additionally a number of iterations that will
+ * slow the key derivation process down. The slower this is, the more work
+ * it requires being able to brute-force the resulting key.
+ *
* === Encryption
*
- * Documents encrypted with the public key can only be decrypted with the
- * private key.
+ * The strategy is to first instantiate a Cipher for encryption, and
+ * then to generate a random IV plus a key derived from the password
+ * using PBKDF2. PKCS #5 v2.0 recommends at least 8 bytes for the salt,
+ * the number of iterations largely depends on the hardware being used.
+ *
+ * cipher = OpenSSL::Cipher.new 'AES-128-CBC'
+ * cipher.encrypt
+ * iv = cipher.random_iv
*
- * public_encrypted = key.public_encrypt 'top secret document'
+ * pwd = 'some hopefully not to easily guessable password'
+ * salt = OpenSSL::Random.random_bytes 16
+ * iter = 20000
+ * key_len = cipher.key_len
+ * digest = OpenSSL::Digest::SHA256.new
*
- * Documents encrypted with the private key can only be decrypted with the
- * public key.
+ * key = OpenSSL::PKCS5.pbkdf2_hmac(pwd, salt, iter, key_len, digest)
+ * cipher.key = key
*
- * private_encrypted = key.private_encrypt 'public release document'
+ * Now encrypt the data:
+ *
+ * encrypted = cipher.update document
+ * encrypted << cipher.final
*
* === Decryption
*
- * Use the opposite key type do decrypt the document
+ * Use the same steps as before to derive the symmetric AES key, this time
+ * setting the Cipher up for decryption.
+ *
+ * cipher = OpenSSL::Cipher.new 'AES-128-CBC'
+ * cipher.decrypt
+ * cipher.iv = iv # the one generated with #random_iv
*
- * top_secret = key.public_decrypt public_encrypted
+ * pwd = 'some hopefully not to easily guessable password'
+ * salt = ... # the one generated above
+ * iter = 20000
+ * key_len = cipher.key_len
+ * digest = OpenSSL::Digest::SHA256.new
*
- * public_release = key.private_decrypt private_encrypted
+ * key = OpenSSL::PKCS5.pbkdf2_hmac(pwd, salt, iter, key_len, digest)
+ * cipher.key = key
+ *
+ * Now decrypt the data:
+ *
+ * decrypted = cipher.update encrypted
+ * decrypted << cipher.final
*
* == PKCS #5 Password-based Encryption
*
* PKCS #5 is a password-based encryption standard documented at
* RFC2898[http://www.ietf.org/rfc/rfc2898.txt]. It allows a short password or
- * passphrase to be used to create a secure encryption key.
+ * passphrase to be used to create a secure encryption key. If possible, PBKDF2
+ * as described above should be used if the circumstances allow it.
*
* PKCS #5 uses a Cipher, a pass phrase and a salt to generate an encryption
* key.
@@ -520,7 +620,7 @@ ossl_debug_set(VALUE self, VALUE val)
*
* First set up the cipher for encryption
*
- * encrypter = OpenSSL::Cipher::Cipher.new 'AES-128-CBC'
+ * encrypter = OpenSSL::Cipher.new 'AES-128-CBC'
* encrypter.encrypt
* encrypter.pkcs5_keyivgen pass_phrase, salt
*
@@ -533,7 +633,7 @@ ossl_debug_set(VALUE self, VALUE val)
*
* Use a new Cipher instance set up for decryption
*
- * decrypter = OpenSSL::Cipher::Cipher.new 'AES-128-CBC'
+ * decrypter = OpenSSL::Cipher.new 'AES-128-CBC'
* decrypter.decrypt
* decrypter.pkcs5_keyivgen pass_phrase, salt
*
@@ -836,6 +936,7 @@ Init_openssl()
* Version of OpenSSL the ruby OpenSSL extension was built with
*/
rb_define_const(mOSSL, "OPENSSL_VERSION", rb_str_new2(OPENSSL_VERSION_TEXT));
+
/*
* Version number of OpenSSL the ruby OpenSSL extension was built with
* (base 16)
@@ -843,6 +944,15 @@ Init_openssl()
rb_define_const(mOSSL, "OPENSSL_VERSION_NUMBER", INT2NUM(OPENSSL_VERSION_NUMBER));
/*
+ * Boolean indicating whether OpenSSL runs in FIPS mode or not
+ */
+#ifdef HAVE_OPENSSL_FIPS
+ rb_define_const(mOSSL, "OPENSSL_FIPS", Qtrue);
+#else
+ rb_define_const(mOSSL, "OPENSSL_FIPS", Qfalse);
+#endif
+
+ /*
* Generic error,
* common for all classes under OpenSSL module
*/
diff --git a/ext/openssl/ossl.h b/ext/openssl/ossl.h
index 97095f7d6f..88e4506fa8 100644
--- a/ext/openssl/ossl.h
+++ b/ext/openssl/ossl.h
@@ -30,6 +30,7 @@ extern "C" {
#endif
#include <ruby.h>
#include <ruby/io.h>
+#include <ruby/thread.h>
/*
* Check the OpenSSL version
@@ -74,6 +75,11 @@ extern "C" {
# include <openssl/ocsp.h>
#endif
+/* OpenSSL requires passwords for PEM-encoded files to be at least four
+ * characters long
+ */
+#define OSSL_MIN_PWD_LEN 4
+
/*
* Common Module
*/
diff --git a/ext/openssl/ossl_asn1.c b/ext/openssl/ossl_asn1.c
index 3f50933aa4..81881517d3 100644
--- a/ext/openssl/ossl_asn1.c
+++ b/ext/openssl/ossl_asn1.c
@@ -149,11 +149,16 @@ num_to_asn1integer(VALUE obj, ASN1_INTEGER *ai)
ASN1_INTEGER *
num_to_asn1integer(VALUE obj, ASN1_INTEGER *ai)
{
- BIGNUM *bn = GetBNPtr(obj);
+ BIGNUM *bn;
- if (!(ai = BN_to_ASN1_INTEGER(bn, ai))) {
+ if (NIL_P(obj))
+ ossl_raise(rb_eTypeError, "Can't convert nil into Integer");
+
+ bn = GetBNPtr(obj);
+
+ if (!(ai = BN_to_ASN1_INTEGER(bn, ai)))
ossl_raise(eOSSLError, NULL);
- }
+
return ai;
}
#endif
@@ -219,6 +224,9 @@ static ID sivVALUE, sivTAG, sivTAG_CLASS, sivTAGGING, sivINFINITE_LENGTH, sivUNU
static ASN1_BOOLEAN
obj_to_asn1bool(VALUE obj)
{
+ if (NIL_P(obj))
+ ossl_raise(rb_eTypeError, "Can't convert nil into Boolean");
+
#if OPENSSL_VERSION_NUMBER < 0x00907000L
return RTEST(obj) ? 0xff : 0x100;
#else
@@ -331,7 +339,7 @@ obj_to_asn1derstr(VALUE obj)
* DER to Ruby converters
*/
static VALUE
-decode_bool(unsigned char* der, int length)
+decode_bool(unsigned char* der, long length)
{
int val;
const unsigned char *p;
@@ -344,7 +352,7 @@ decode_bool(unsigned char* der, int length)
}
static VALUE
-decode_int(unsigned char* der, int length)
+decode_int(unsigned char* der, long length)
{
ASN1_INTEGER *ai;
const unsigned char *p;
@@ -363,7 +371,7 @@ decode_int(unsigned char* der, int length)
}
static VALUE
-decode_bstr(unsigned char* der, int length, long *unused_bits)
+decode_bstr(unsigned char* der, long length, long *unused_bits)
{
ASN1_BIT_STRING *bstr;
const unsigned char *p;
@@ -384,7 +392,7 @@ decode_bstr(unsigned char* der, int length, long *unused_bits)
}
static VALUE
-decode_enum(unsigned char* der, int length)
+decode_enum(unsigned char* der, long length)
{
ASN1_ENUMERATED *ai;
const unsigned char *p;
@@ -403,7 +411,7 @@ decode_enum(unsigned char* der, int length)
}
static VALUE
-decode_null(unsigned char* der, int length)
+decode_null(unsigned char* der, long length)
{
ASN1_NULL *null;
const unsigned char *p;
@@ -417,7 +425,7 @@ decode_null(unsigned char* der, int length)
}
static VALUE
-decode_obj(unsigned char* der, int length)
+decode_obj(unsigned char* der, long length)
{
ASN1_OBJECT *obj;
const unsigned char *p;
@@ -446,7 +454,7 @@ decode_obj(unsigned char* der, int length)
}
static VALUE
-decode_time(unsigned char* der, int length)
+decode_time(unsigned char* der, long length)
{
ASN1_TIME *time;
const unsigned char *p;
@@ -465,9 +473,8 @@ decode_time(unsigned char* der, int length)
}
static VALUE
-decode_eoc(unsigned char *der, int length)
+decode_eoc(unsigned char *der, long length)
{
- VALUE ret;
if (length != 2 || !(der[0] == 0x00 && der[1] == 0x00))
ossl_raise(eASN1Error, NULL);
@@ -778,7 +785,7 @@ ossl_asn1data_to_der(VALUE self)
}
static VALUE
-int_ossl_asn1_decode0_prim(unsigned char **pp, long length, int hlen, int tag,
+int_ossl_asn1_decode0_prim(unsigned char **pp, long length, long hlen, int tag,
VALUE tc, long *num_read)
{
VALUE value, asn1data;
@@ -870,7 +877,7 @@ int_ossl_asn1_decode0_cons(unsigned char **pp, long max_len, long length,
rb_ary_push(ary, value);
if (length > 0)
length -= inner_read;
-
+
if (infinite &&
NUM2INT(ossl_asn1_get_tag(value)) == V_ASN1_EOC &&
SYM2ID(ossl_asn1_get_tag_class(value)) == sUNIVERSAL) {
@@ -878,13 +885,23 @@ int_ossl_asn1_decode0_cons(unsigned char **pp, long max_len, long length,
}
}
- if (tc == sUNIVERSAL && (tag == V_ASN1_SEQUENCE || V_ASN1_SET)) {
+ if (tc == sUNIVERSAL) {
VALUE args[4];
- VALUE klass = *ossl_asn1_info[tag].klass;
- if (infinite && tag != V_ASN1_SEQUENCE && tag != V_ASN1_SET) {
- asn1data = rb_obj_alloc(cASN1Constructive);
+ int not_sequence_or_set;
+
+ not_sequence_or_set = tag != V_ASN1_SEQUENCE && tag != V_ASN1_SET;
+
+ if (not_sequence_or_set) {
+ if (infinite) {
+ asn1data = rb_obj_alloc(cASN1Constructive);
+ }
+ else {
+ ossl_raise(eASN1Error, "invalid non-infinite tag");
+ return Qnil;
+ }
}
else {
+ VALUE klass = *ossl_asn1_info[tag].klass;
asn1data = rb_obj_alloc(klass);
}
args[0] = ary;
@@ -894,10 +911,6 @@ int_ossl_asn1_decode0_cons(unsigned char **pp, long max_len, long length,
ossl_asn1_initialize(4, args, asn1data);
}
else {
- VALUE args[3];
- args[0] = ary;
- args[1] = INT2NUM(tag);
- args[2] = ID2SYM(tc);
asn1data = rb_obj_alloc(cASN1Data);
ossl_asn1data_initialize(asn1data, ary, INT2NUM(tag), ID2SYM(tc));
}
@@ -917,8 +930,8 @@ ossl_asn1_decode0(unsigned char **pp, long length, long *offset, int depth,
{
unsigned char *start, *p;
const unsigned char *p0;
- long len = 0, inner_read = 0, off = *offset;
- int hlen, tag, tc, j;
+ long len = 0, inner_read = 0, off = *offset, hlen;
+ int tag, tc, j;
VALUE asn1data, tag_class;
p = *pp;
@@ -1036,7 +1049,7 @@ ossl_asn1_traverse(VALUE self, VALUE obj)
static VALUE
ossl_asn1_decode(VALUE self, VALUE obj)
{
- VALUE ret, ary;
+ VALUE ret;
unsigned char *p;
volatile VALUE tmp;
long len, read = 0, offset = 0;
@@ -1896,6 +1909,10 @@ do{\
OSSL_ASN1_DEFINE_CLASS(EndOfContent, Data);
+
+#if 0
+ cASN1ObjectId = rb_define_class_under(mASN1, "ObjectId", cASN1Primitive); /* let rdoc know */
+#endif
rb_define_singleton_method(cASN1ObjectId, "register", ossl_asn1obj_s_register, 3);
rb_define_method(cASN1ObjectId, "sn", ossl_asn1obj_get_sn, 0);
rb_define_method(cASN1ObjectId, "ln", ossl_asn1obj_get_ln, 0);
@@ -1927,7 +1944,7 @@ do{\
rb_hash_aset(class_tag_map, cASN1GeneralizedTime, INT2NUM(V_ASN1_GENERALIZEDTIME));
rb_hash_aset(class_tag_map, cASN1GraphicString, INT2NUM(V_ASN1_GRAPHICSTRING));
rb_hash_aset(class_tag_map, cASN1ISO64String, INT2NUM(V_ASN1_ISO64STRING));
- rb_hash_aset(class_tag_map, cASN1GeneralString, INT2NUM(INT2NUM(V_ASN1_GENERALSTRING)));
+ rb_hash_aset(class_tag_map, cASN1GeneralString, INT2NUM(V_ASN1_GENERALSTRING));
rb_hash_aset(class_tag_map, cASN1UniversalString, INT2NUM(V_ASN1_UNIVERSALSTRING));
rb_hash_aset(class_tag_map, cASN1BMPString, INT2NUM(V_ASN1_BMPSTRING));
rb_global_variable(&class_tag_map);
diff --git a/ext/openssl/ossl_bio.c b/ext/openssl/ossl_bio.c
index ed7c0a71a5..a11c08c1a3 100644
--- a/ext/openssl/ossl_bio.c
+++ b/ext/openssl/ossl_bio.c
@@ -25,7 +25,7 @@ ossl_obj2bio(VALUE obj)
GetOpenFile(obj, fptr);
rb_io_check_readable(fptr);
- if ((fd = dup(FPTR_TO_FD(fptr))) < 0){
+ if ((fd = rb_cloexec_dup(FPTR_TO_FD(fptr))) < 0){
rb_sys_fail(0);
}
rb_update_max_fd(fd);
diff --git a/ext/openssl/ossl_cipher.c b/ext/openssl/ossl_cipher.c
index 7a30641153..26851515cd 100644
--- a/ext/openssl/ossl_cipher.c
+++ b/ext/openssl/ossl_cipher.c
@@ -126,6 +126,7 @@ ossl_cipher_initialize(VALUE self, VALUE str)
return self;
}
+
static VALUE
ossl_cipher_copy(VALUE self, VALUE other)
{
@@ -181,6 +182,9 @@ ossl_s_ciphers(VALUE self)
* call-seq:
* cipher.reset -> self
*
+ * Fully resets the internal state of the Cipher. By using this, the same
+ * Cipher instance may be used several times for en- or decryption tasks.
+ *
* Internally calls EVP_CipherInit_ex(ctx, NULL, NULL, NULL, NULL, -1).
*/
static VALUE
@@ -243,7 +247,10 @@ ossl_cipher_init(int argc, VALUE *argv, VALUE self, int mode)
* call-seq:
* cipher.encrypt -> self
*
- * Make sure to call .encrypt or .decrypt before using any of the following methods:
+ * Initializes the Cipher for encryption.
+ *
+ * Make sure to call Cipher#encrypt or Cipher#decrypt before using any of the
+ * following methods:
* * [key=, iv=, random_key, random_iv, pkcs5_keyivgen]
*
* Internally calls EVP_CipherInit_ex(ctx, NULL, NULL, NULL, NULL, 1).
@@ -258,7 +265,10 @@ ossl_cipher_encrypt(int argc, VALUE *argv, VALUE self)
* call-seq:
* cipher.decrypt -> self
*
- * Make sure to call .encrypt or .decrypt before using any of the following methods:
+ * Initializes the Cipher for decryption.
+ *
+ * Make sure to call Cipher#encrypt or Cipher#decrypt before using any of the
+ * following methods:
* * [key=, iv=, random_key, random_iv, pkcs5_keyivgen]
*
* Internally calls EVP_CipherInit_ex(ctx, NULL, NULL, NULL, NULL, 0).
@@ -273,11 +283,13 @@ ossl_cipher_decrypt(int argc, VALUE *argv, VALUE self)
* call-seq:
* cipher.pkcs5_keyivgen(pass [, salt [, iterations [, digest]]] ) -> nil
*
- * Generates and sets the key/iv based on a password.
+ * Generates and sets the key/IV based on a password.
*
- * WARNING: This method is only PKCS5 v1.5 compliant when using RC2, RC4-40, or DES
- * with MD5 or SHA1. Using anything else (like AES) will generate the key/iv using an
- * OpenSSL specific method. Use a PKCS5 v2 key generation method instead.
+ * WARNING: This method is only PKCS5 v1.5 compliant when using RC2, RC4-40,
+ * or DES with MD5 or SHA1. Using anything else (like AES) will generate the
+ * key/iv using an OpenSSL specific method. This method is deprecated and
+ * should no longer be used. Use a PKCS5 v2 key generation method from
+ * OpenSSL::PKCS5 instead.
*
* === Parameters
* +salt+ must be an 8 byte string if provided.
@@ -322,6 +334,11 @@ ossl_cipher_pkcs5_keyivgen(int argc, VALUE *argv, VALUE self)
* call-seq:
* cipher.update(data [, buffer]) -> string or buffer
*
+ * Encrypts data in a streaming fashion. Hand consecutive blocks of data
+ * to the +update+ method in order to encrypt it. Returns the encrypted
+ * data chunk. When done, the output of Cipher#final should be additionally
+ * added to the result.
+ *
* === Parameters
* +data+ is a nonempty string.
* +buffer+ is an optional string to store the result.
@@ -360,9 +377,10 @@ ossl_cipher_update(int argc, VALUE *argv, VALUE self)
/*
* call-seq:
- * cipher.final -> aString
+ * cipher.final -> string
*
- * Returns the remaining data held in the cipher object. Further calls to update() or final() will return garbage.
+ * Returns the remaining data held in the cipher object. Further calls to
+ * Cipher#update or Cipher#final will return garbage.
*
* See EVP_CipherFinal_ex for further information.
*/
@@ -387,7 +405,8 @@ ossl_cipher_final(VALUE self)
* call-seq:
* cipher.name -> string
*
- * Returns the name of the cipher which may differ slightly from the original name provided.
+ * Returns the name of the cipher which may differ slightly from the original
+ * name provided.
*/
static VALUE
ossl_cipher_name(VALUE self)
@@ -403,9 +422,12 @@ ossl_cipher_name(VALUE self)
* call-seq:
* cipher.key = string -> string
*
- * Sets the cipher key.
+ * Sets the cipher key. To generate a key, you should either use a secure
+ * random byte string or, if the key is to be derived from a password, you
+ * should rely on PBKDF2 functionality provided by OpenSSL::PKCS5. To
+ * generate a secure random-based key, Cipher#random_key may be used.
*
- * Only call this method after calling cipher.encrypt or cipher.decrypt.
+ * Only call this method after calling Cipher#encrypt or Cipher#decrypt.
*/
static VALUE
ossl_cipher_set_key(VALUE self, VALUE key)
@@ -428,9 +450,16 @@ ossl_cipher_set_key(VALUE self, VALUE key)
* call-seq:
* cipher.iv = string -> string
*
- * Sets the cipher iv.
+ * Sets the cipher IV. Please note that since you should never be using ECB
+ * mode, an IV is always explicitly required and should be set prior to
+ * encryption. The IV itself can be safely transmitted in public, but it
+ * should be unpredictable to prevent certain kinds of attacks. You may use
+ * Cipher#random_iv to create a secure random IV.
+ *
+ * Only call this method after calling Cipher#encrypt or Cipher#decrypt.
*
- * Only call this method after calling cipher.encrypt or cipher.decrypt.
+ * If not explicitly set, the OpenSSL default of an all-zeroes ("\\0") IV is
+ * used.
*/
static VALUE
ossl_cipher_set_iv(VALUE self, VALUE iv)
@@ -454,8 +483,9 @@ ossl_cipher_set_iv(VALUE self, VALUE iv)
* call-seq:
* cipher.key_len = integer -> integer
*
- * Sets the key length of the cipher. If the cipher is a fixed length cipher then attempting to set the key
- * length to any value other than the fixed value is an error.
+ * Sets the key length of the cipher. If the cipher is a fixed length cipher
+ * then attempting to set the key length to any value other than the fixed
+ * value is an error.
*
* Under normal circumstances you do not need to call this method (and probably shouldn't).
*
@@ -508,30 +538,28 @@ ossl_cipher_set_padding(VALUE self, VALUE padding)
GetCipher(self, ctx); \
return INT2NUM(EVP_CIPHER_##func(EVP_CIPHER_CTX_cipher(ctx))); \
}
-CIPHER_0ARG_INT(key_length)
-CIPHER_0ARG_INT(iv_length)
-CIPHER_0ARG_INT(block_size)
-#if 0
/*
* call-seq:
* cipher.key_len -> integer
*
+ * Returns the key length in bytes of the Cipher.
*/
-static VALUE ossl_cipher_key_length() { }
+CIPHER_0ARG_INT(key_length)
/*
* call-seq:
* cipher.iv_len -> integer
*
+ * Returns the expected length in bytes for an IV for this Cipher.
*/
-static VALUE ossl_cipher_iv_length() { }
+CIPHER_0ARG_INT(iv_length)
/*
* call-seq:
* cipher.block_size -> integer
*
+ * Returns the size in bytes of the blocks on which this Cipher operates on.
*/
-static VALUE ossl_cipher_block_size() { }
-#endif
+CIPHER_0ARG_INT(block_size)
/*
* INIT
@@ -542,6 +570,165 @@ Init_ossl_cipher(void)
#if 0
mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL */
#endif
+
+ /* Document-class: OpenSSL::Cipher
+ *
+ * Provides symmetric algorithms for encryption and decryption. The
+ * algorithms that are available depend on the particular version
+ * of OpenSSL that is installed.
+ *
+ * === Listing all supported algorithms
+ *
+ * A list of supported algorithms can be obtained by
+ *
+ * puts OpenSSL::Cipher.ciphers
+ *
+ * === Instantiating a Cipher
+ *
+ * There are several ways to create a Cipher instance. Generally, a
+ * Cipher algorithm is categorized by its name, the key length in bits
+ * and the cipher mode to be used. The most generic way to create a
+ * Cipher is the following
+ *
+ * cipher = OpenSSL::Cipher.new('<name>-<key length>-<mode>')
+ *
+ * That is, a string consisting of the hyphenated concatenation of the
+ * individual components name, key length and mode. Either all uppercase
+ * or all lowercase strings may be used, for example:
+ *
+ * cipher = OpenSSL::Cipher.new('AES-128-CBC')
+ *
+ * For each algorithm supported, there is a class defined under the
+ * Cipher class that goes by the name of the cipher, e.g. to obtain an
+ * instance of AES, you could also use
+ *
+ * # these are equivalent
+ * cipher = OpenSSL::Cipher::AES.new(128, :CBC)
+ * cipher = OpenSSL::Cipher::AES.new(128, 'CBC')
+ * cipher = OpenSSL::Cipher::AES.new('128-CBC')
+ *
+ * Finally, due to its wide-spread use, there are also extra classes
+ * defined for the different key sizes of AES
+ *
+ * cipher = OpenSSL::Cipher::AES128.new(:CBC)
+ * cipher = OpenSSL::Cipher::AES192.new(:CBC)
+ * cipher = OpenSSL::Cipher::AES256.new(:CBC)
+ *
+ * === Choosing either encryption or decryption mode
+ *
+ * Encryption and decryption are often very similar operations for
+ * symmetric algorithms, this is reflected by not having to choose
+ * different classes for either operation, both can be done using the
+ * same class. Still, after obtaining a Cipher instance, we need to
+ * tell the instance what it is that we intend to do with it, so we
+ * need to call either
+ *
+ * cipher.encrypt
+ *
+ * or
+ *
+ * cipher.decrypt
+ *
+ * on the Cipher instance. This should be the first call after creating
+ * the instance, otherwise configuration that has already been set could
+ * get lost in the process.
+ *
+ * === Choosing a key
+ *
+ * Symmetric encryption requires a key that is the same for the encrypting
+ * and for the decrypting party and after initial key establishment should
+ * be kept as private information. There are a lot of ways to create
+ * insecure keys, the most notable is to simply take a password as the key
+ * without processing the password further. A simple and secure way to
+ * create a key for a particular Cipher is
+ *
+ * cipher = OpenSSL::AES256.new(:CFB)
+ * cipher.encrypt
+ * key = cipher.random_key # also sets the generated key on the Cipher
+ *
+ * If you absolutely need to use passwords as encryption keys, you
+ * should use Password-Based Key Derivation Function 2 (PBKDF2) by
+ * generating the key with the help of the functionality provided by
+ * OpenSSL::PKCS5.pbkdf2_hmac_sha1 or OpenSSL::PKCS5.pbkdf2_hmac.
+ *
+ * Although there is Cipher#pkcs5_keyivgen, its use is deprecated and
+ * it should only be used in legacy applications because it does not use
+ * the newer PKCS#5 v2 algorithms.
+ *
+ * === Choosing an IV
+ *
+ * The cipher modes CBC, CFB, OFB and CTR all need an "initialization
+ * vector", or short, IV. ECB mode is the only mode that does not require
+ * an IV, but there is almost no legitimate use case for this mode
+ * because of the fact that it does not sufficiently hide plaintext
+ * patterns. Therefore
+ *
+ * <b>You should never use ECB mode unless you are absolutely sure that
+ * you absolutely need it</b>
+ *
+ * Because of this, you will end up with a mode that explicitly requires
+ * an IV in any case. Note that for backwards compatibility reasons,
+ * setting an IV is not explicitly mandated by the Cipher API. If not
+ * set, OpenSSL itself defaults to an all-zeroes IV ("\\0", not the
+ * character). Although the IV can be seen as public information, i.e.
+ * it may be transmitted in public once generated, it should still stay
+ * unpredictable to prevent certain kinds of attacks. Therefore, ideally
+ *
+ * <b>Always create a secure random IV for every encryption of your
+ * Cipher</b>
+ *
+ * A new, random IV should be created for every encryption of data. Think
+ * of the IV as a nonce (number used once) - it's public but random and
+ * unpredictable. A secure random IV can be created as follows
+ *
+ * cipher = ...
+ * cipher.encrypt
+ * key = cipher.random_key
+ * iv = cipher.random_iv # also sets the generated IV on the Cipher
+ *
+ * Although the key is generally a random value, too, it is a bad choice
+ * as an IV. There are elaborate ways how an attacker can take advantage
+ * of such an IV. As a general rule of thumb, exposing the key directly
+ * or indirectly should be avoided at all cost and exceptions only be
+ * made with good reason.
+ *
+ * === Calling Cipher#final
+ *
+ * ECB (which should not be used) and CBC are both block-based modes.
+ * This means that unlike for the other streaming-based modes, they
+ * operate on fixed-size blocks of data, and therefore they require a
+ * "finalization" step to produce or correctly decrypt the last block of
+ * data by appropriately handling some form of padding. Therefore it is
+ * essential to add the output of OpenSSL::Cipher#final to your
+ * encryption/decryption buffer or you will end up with decryption errors
+ * or truncated data.
+ *
+ * Although this is not really necessary for streaming-mode ciphers, it is
+ * still recommended to apply the same pattern of adding the output of
+ * Cipher#final there as well - it also enables you to switch between
+ * modes more easily in the future.
+ *
+ * === Encrypting and decrypting some data
+ *
+ * data = "Very, very confidential data"
+ *
+ * cipher = OpenSSL::Cipher::AES.new(128, :CBC)
+ * cipher.encrypt
+ * key = cipher.random_key
+ * iv = cipher.random_iv
+ *
+ * encrypted = cipher.update(data) + cipher.final
+ * ...
+ * decipher = OpenSSL::Cipher::AES.new(128, :CBC)
+ * decipher.decrypt
+ * decipher.key = key
+ * decipher.iv = iv
+ *
+ * plain = decipher.update(encrypted) + decipher.final
+ *
+ * puts data == plain #=> true
+ *
+ */
cCipher = rb_define_class_under(mOSSL, "Cipher", rb_cObject);
eCipherError = rb_define_class_under(cCipher, "CipherError", eOSSLError);
diff --git a/ext/openssl/ossl_digest.c b/ext/openssl/ossl_digest.c
index ab165c4a84..fdf13e98e5 100644
--- a/ext/openssl/ossl_digest.c
+++ b/ext/openssl/ossl_digest.c
@@ -403,6 +403,17 @@ Init_ossl_digest()
* sha256 << data2
* sha256 << data3
* digest = sha256.digest
+ *
+ * === Reuse a Digest instance
+ *
+ * data1 = File.read('file1')
+ * sha256 = OpenSSL::Digest::SHA256.new
+ * digest1 = sha256.digest(data1)
+ *
+ * data2 = File.read('file2')
+ * sha256.reset
+ * digest2 = sha256.digest(data2)
+ *
*/
cDigest = rb_define_class_under(mOSSL, "Digest", rb_path2class("Digest::Class"));
/* Document-class: OpenSSL::Digest::DigestError
diff --git a/ext/openssl/ossl_engine.c b/ext/openssl/ossl_engine.c
index 79f51b8cdb..f85454108a 100644
--- a/ext/openssl/ossl_engine.c
+++ b/ext/openssl/ossl_engine.c
@@ -64,29 +64,47 @@ ossl_engine_s_load(int argc, VALUE *argv, VALUE klass)
#if HAVE_ENGINE_LOAD_DYNAMIC
OSSL_ENGINE_LOAD_IF_MATCH(dynamic);
#endif
-#if HAVE_ENGINE_LOAD_CSWIFT
- OSSL_ENGINE_LOAD_IF_MATCH(cswift);
+#if HAVE_ENGINE_LOAD_4758CCA
+ OSSL_ENGINE_LOAD_IF_MATCH(4758cca);
#endif
-#if HAVE_ENGINE_LOAD_CHIL
- OSSL_ENGINE_LOAD_IF_MATCH(chil);
+#if HAVE_ENGINE_LOAD_AEP
+ OSSL_ENGINE_LOAD_IF_MATCH(aep);
#endif
#if HAVE_ENGINE_LOAD_ATALLA
OSSL_ENGINE_LOAD_IF_MATCH(atalla);
#endif
+#if HAVE_ENGINE_LOAD_CHIL
+ OSSL_ENGINE_LOAD_IF_MATCH(chil);
+#endif
+#if HAVE_ENGINE_LOAD_CSWIFT
+ OSSL_ENGINE_LOAD_IF_MATCH(cswift);
+#endif
#if HAVE_ENGINE_LOAD_NURON
OSSL_ENGINE_LOAD_IF_MATCH(nuron);
#endif
+#if HAVE_ENGINE_LOAD_SUREWARE
+ OSSL_ENGINE_LOAD_IF_MATCH(sureware);
+#endif
#if HAVE_ENGINE_LOAD_UBSEC
OSSL_ENGINE_LOAD_IF_MATCH(ubsec);
#endif
-#if HAVE_ENGINE_LOAD_AEP
- OSSL_ENGINE_LOAD_IF_MATCH(aep);
+#if HAVE_ENGINE_LOAD_PADLOCK
+ OSSL_ENGINE_LOAD_IF_MATCH(padlock);
#endif
-#if HAVE_ENGINE_LOAD_SUREWARE
- OSSL_ENGINE_LOAD_IF_MATCH(sureware);
+#if HAVE_ENGINE_LOAD_CAPI
+ OSSL_ENGINE_LOAD_IF_MATCH(capi);
#endif
-#if HAVE_ENGINE_LOAD_4758CCA
- OSSL_ENGINE_LOAD_IF_MATCH(4758cca);
+#if HAVE_ENGINE_LOAD_GMP
+ OSSL_ENGINE_LOAD_IF_MATCH(gmp);
+#endif
+#if HAVE_ENGINE_LOAD_GOST
+ OSSL_ENGINE_LOAD_IF_MATCH(gost);
+#endif
+#if HAVE_ENGINE_LOAD_CRYPTODEV
+ OSSL_ENGINE_LOAD_IF_MATCH(cryptodev);
+#endif
+#if HAVE_ENGINE_LOAD_AESNI
+ OSSL_ENGINE_LOAD_IF_MATCH(aesni);
#endif
#endif
#ifdef HAVE_ENGINE_LOAD_OPENBSD_DEV_CRYPTO
@@ -118,7 +136,7 @@ ossl_engine_s_engines(VALUE klass)
/* Need a ref count of two here because of ENGINE_free being
* called internally by OpenSSL when moving to the next ENGINE
* and by us when releasing the ENGINE reference */
- ENGINE_up_ref(e);
+ ENGINE_up_ref(e);
WrapEngine(klass, obj, e);
rb_ary_push(ary, obj);
}
diff --git a/ext/openssl/ossl_ns_spki.c b/ext/openssl/ossl_ns_spki.c
index bf828cbb83..b80984cfee 100644
--- a/ext/openssl/ossl_ns_spki.c
+++ b/ext/openssl/ossl_ns_spki.c
@@ -51,6 +51,13 @@ ossl_spki_alloc(VALUE klass)
return obj;
}
+/*
+ * call-seq:
+ * SPKI.new([request]) => spki
+ *
+ * === Parameters
+ * * +request+ - optional raw request, either in PEM or DER format.
+ */
static VALUE
ossl_spki_initialize(int argc, VALUE *argv, VALUE self)
{
@@ -75,6 +82,12 @@ ossl_spki_initialize(int argc, VALUE *argv, VALUE self)
return self;
}
+/*
+ * call-seq:
+ * spki.to_der => DER-encoded string
+ *
+ * Returns the DER encoding of this SPKI.
+ */
static VALUE
ossl_spki_to_der(VALUE self)
{
@@ -95,6 +108,12 @@ ossl_spki_to_der(VALUE self)
return str;
}
+/*
+ * call-seq:
+ * spki.to_pem => PEM-encoded string
+ *
+ * Returns the PEM encoding of this SPKI.
+ */
static VALUE
ossl_spki_to_pem(VALUE self)
{
@@ -111,6 +130,13 @@ ossl_spki_to_pem(VALUE self)
return str;
}
+/*
+ * call-seq:
+ * spki.to_text => string
+ *
+ * Returns a textual representation of this SPKI, useful for debugging
+ * purposes.
+ */
static VALUE
ossl_spki_print(VALUE self)
{
@@ -134,6 +160,13 @@ ossl_spki_print(VALUE self)
return str;
}
+/*
+ * call-seq:
+ * spki.public_key => pkey
+ *
+ * Returns the public key associated with the SPKI, an instance of
+ * OpenSSL::PKey.
+ */
static VALUE
ossl_spki_get_public_key(VALUE self)
{
@@ -148,6 +181,17 @@ ossl_spki_get_public_key(VALUE self)
return ossl_pkey_new(pkey); /* NO DUP - OK */
}
+/*
+ * call-seq:
+ * spki.public_key = pub => pkey
+ *
+ * === Parameters
+ * * +pub+ - the public key to be set for this instance
+ *
+ * Sets the public key to be associated with the SPKI, an instance of
+ * OpenSSL::PKey. This should be the public key corresponding to the
+ * private key used for signing the SPKI.
+ */
static VALUE
ossl_spki_set_public_key(VALUE self, VALUE key)
{
@@ -161,6 +205,12 @@ ossl_spki_set_public_key(VALUE self, VALUE key)
return key;
}
+/*
+ * call-seq:
+ * spki.challenge => string
+ *
+ * Returns the challenge string associated with this SPKI.
+ */
static VALUE
ossl_spki_get_challenge(VALUE self)
{
@@ -176,6 +226,16 @@ ossl_spki_get_challenge(VALUE self)
spki->spkac->challenge->length);
}
+/*
+ * call-seq:
+ * spki.challenge = str => string
+ *
+ * === Parameters
+ * * +str+ - the challenge string to be set for this instance
+ *
+ * Sets the challenge to be associated with the SPKI. May be used by the
+ * server, e.g. to prevent replay.
+ */
static VALUE
ossl_spki_set_challenge(VALUE self, VALUE str)
{
@@ -191,6 +251,19 @@ ossl_spki_set_challenge(VALUE self, VALUE str)
return str;
}
+/*
+ * call-seq:
+ * spki.sign(key, digest) => spki
+ *
+ * === Parameters
+ * * +key+ - the private key to be used for signing this instance
+ * * +digest+ - the digest to be used for signing this instance
+ *
+ * To sign an SPKI, the private key corresponding to the public key set
+ * for this instance should be used, in addition to a digest algorithm in
+ * the form of an OpenSSL::Digest. The private key should be an instance of
+ * OpenSSL::PKey.
+ */
static VALUE
ossl_spki_sign(VALUE self, VALUE key, VALUE digest)
{
@@ -209,7 +282,14 @@ ossl_spki_sign(VALUE self, VALUE key, VALUE digest)
}
/*
- * Checks that cert signature is made with PRIVversion of this PUBLIC 'key'
+ * call-seq:
+ * spki.verify(key) => boolean
+ *
+ * === Parameters
+ * * +key+ - the public key to be used for verifying the SPKI signature
+ *
+ * Returns +true+ if the signature is valid, +false+ otherwise. To verify an
+ * SPKI, the public key contained within the SPKI should be used.
*/
static VALUE
ossl_spki_verify(VALUE self, VALUE key)
@@ -228,12 +308,64 @@ ossl_spki_verify(VALUE self, VALUE key)
return Qnil; /* dummy */
}
-/*
- * NETSCAPE_SPKI init
+/* Document-class: OpenSSL::Netscape::SPKI
+ *
+ * A Simple Public Key Infrastructure implementation (pronounced "spookey").
+ * The structure is defined as
+ * PublicKeyAndChallenge ::= SEQUENCE {
+ * spki SubjectPublicKeyInfo,
+ * challenge IA5STRING
+ * }
+ *
+ * SignedPublicKeyAndChallenge ::= SEQUENCE {
+ * publicKeyAndChallenge PublicKeyAndChallenge,
+ * signatureAlgorithm AlgorithmIdentifier,
+ * signature BIT STRING
+ * }
+ * where the definitions of SubjectPublicKeyInfo and AlgorithmIdentifier can
+ * be found in RFC5280. SPKI is typically used in browsers for generating
+ * a public/private key pair and a subsequent certificate request, using
+ * the HTML <keygen> element.
+ *
+ * == Examples
+ *
+ * === Creating an SPKI
+ * key = OpenSSL::PKey::RSA.new 2048
+ * spki = OpenSSL::Netscape::SPKI.new
+ * spki.challenge = "RandomChallenge"
+ * spki.public_key = key.public_key
+ * spki.sign(key, OpenSSL::Digest::SHA256.new)
+ * #send a request containing this to a server generating a certificate
+ * === Verifiying an SPKI request
+ * request = #...
+ * spki = OpenSSL::Netscape::SPKI.new request
+ * unless spki.verify(spki.public_key)
+ * # signature is invalid
+ * end
+ * #proceed
*/
+
+/* Document-module: OpenSSL::Netscape
+ *
+ * OpenSSL::Netscape is a namespace for SPKI (Simple Public Key
+ * Infrastructure) which implements Signed Public Key and Challenge.
+ * See {RFC 2692}[http://tools.ietf.org/html/rfc2692] and {RFC
+ * 2693}[http://tools.ietf.org/html/rfc2692] for details.
+ */
+
+/* Document-class: OpenSSL::Netscape::SPKIError
+ *
+ * Generic Exception class that is raised if an error occurs during an
+ * operation on an instance of OpenSSL::Netscape::SPKI.
+ */
+
void
Init_ossl_ns_spki()
{
+#if 0
+ mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL */
+#endif
+
mNetscape = rb_define_module_under(mOSSL, "Netscape");
eSPKIError = rb_define_class_under(mNetscape, "SPKIError", eOSSLError);
diff --git a/ext/openssl/ossl_pkcs5.c b/ext/openssl/ossl_pkcs5.c
index d3eaf2d073..3b615e4828 100644
--- a/ext/openssl/ossl_pkcs5.c
+++ b/ext/openssl/ossl_pkcs5.c
@@ -14,12 +14,12 @@ VALUE ePKCS5;
*
* === Parameters
* * +pass+ - string
- * * +salt+ - string
- * * +iter+ - integer - should be greater than 1000. 2000 is better.
+ * * +salt+ - string - should be at least 8 bytes long.
+ * * +iter+ - integer - should be greater than 1000. 20000 is better.
* * +keylen+ - integer
* * +digest+ - a string or OpenSSL::Digest object.
*
- * Available in OpenSSL 0.9.9?.
+ * Available in OpenSSL 0.9.4.
*
* Digests other than SHA1 may not be supported by other cryptography libraries.
*/
@@ -36,8 +36,8 @@ ossl_pkcs5_pbkdf2_hmac(VALUE self, VALUE pass, VALUE salt, VALUE iter, VALUE key
str = rb_str_new(0, len);
- if (PKCS5_PBKDF2_HMAC(RSTRING_PTR(pass), RSTRING_LEN(pass),
- (unsigned char *)RSTRING_PTR(salt), RSTRING_LEN(salt),
+ if (PKCS5_PBKDF2_HMAC(RSTRING_PTR(pass), RSTRING_LENINT(pass),
+ (unsigned char *)RSTRING_PTR(salt), RSTRING_LENINT(salt),
NUM2INT(iter), md, len,
(unsigned char *)RSTRING_PTR(str)) != 1)
ossl_raise(ePKCS5, "PKCS5_PBKDF2_HMAC");
@@ -56,11 +56,11 @@ ossl_pkcs5_pbkdf2_hmac(VALUE self, VALUE pass, VALUE salt, VALUE iter, VALUE key
*
* === Parameters
* * +pass+ - string
- * * +salt+ - string
- * * +iter+ - integer - should be greater than 1000. 2000 is better.
+ * * +salt+ - string - should be at least 8 bytes long.
+ * * +iter+ - integer - should be greater than 1000. 20000 is better.
* * +keylen+ - integer
*
- * This method is available almost any version OpenSSL.
+ * This method is available in almost any version of OpenSSL.
*
* Conforms to rfc2898.
*/
@@ -93,7 +93,95 @@ Init_ossl_pkcs5()
* Password-based Encryption
*
*/
+
+ #if 0
+ mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL */
+ #endif
+
+ /* Document-class: OpenSSL::PKCS5
+ *
+ * Provides password-based encryption functionality based on PKCS#5.
+ * Typically used for securely deriving arbitrary length symmetric keys
+ * to be used with an OpenSSL::Cipher from passwords. Another use case
+ * is for storing passwords: Due to the ability to tweak the effort of
+ * computation by increasing the iteration count, computation can be
+ * slowed down artificially in order to render possible attacks infeasible.
+ *
+ * PKCS5 offers support for PBKDF2 with an OpenSSL::Digest::SHA1-based
+ * HMAC, or an arbitrary Digest if the underlying version of OpenSSL
+ * already supports it (>= 0.9.4).
+ *
+ * === Parameters
+ * ==== Password
+ * Typically an arbitrary String that represents the password to be used
+ * for deriving a key.
+ * ==== Salt
+ * Prevents attacks based on dictionaries of common passwords. It is a
+ * public value that can be safely stored along with the password (e.g.
+ * if PBKDF2 is used for password storage). For maximum security, a fresh,
+ * random salt should be generated for each stored password. According
+ * to PKCS#5, a salt should be at least 8 bytes long.
+ * ==== Iteration Count
+ * Allows to tweak the length that the actual computation will take. The
+ * larger the iteration count, the longer it will take.
+ * ==== Key Length
+ * Specifies the length in bytes of the output that will be generated.
+ * Typically, the key length should be larger than or equal to the output
+ * length of the underlying digest function, otherwise an attacker could
+ * simply try to brute-force the key. According to PKCS#5, security is
+ * limited by the output length of the underlying digest function, i.e.
+ * security is not improved if a key length strictly larger than the
+ * digest output length is chosen. Therefore, when using PKCS5 for
+ * password storage, it suffices to store values equal to the digest
+ * output length, nothing is gained by storing larger values.
+ *
+ * == Examples
+ * === Generating a 128 bit key for a Cipher (e.g. AES)
+ * pass = "secret"
+ * salt = OpenSSL::Random.random_bytes(16)
+ * iter = 20000
+ * key_len = 16
+ * key = OpenSSL::PKCS5.pbkdf2_hmac_sha1(pass, salt, iter, key_len)
+ *
+ * === Storing Passwords
+ * pass = "secret"
+ * salt = OpenSSL::Random.random_bytes(16) #store this with the generated value
+ * iter = 20000
+ * digest = OpenSSL::Digest::SHA256.new
+ * len = digest.digest_length
+ * #the final value to be stored
+ * value = OpenSSL::PKCS5.pbkdf2_hmac(pass, salt, iter, len, digest)
+ *
+ * === Important Note on Checking Passwords
+ * When comparing passwords provided by the user with previously stored
+ * values, a common mistake made is comparing the two values using "==".
+ * Typically, "==" short-circuits on evaluation, and is therefore
+ * vulnerable to timing attacks. The proper way is to use a method that
+ * always takes the same amount of time when comparing two values, thus
+ * not leaking any information to potential attackers. To compare two
+ * values, the following could be used:
+ * def eql_time_cmp(a, b)
+ * unless a.length == b.length
+ * return false
+ * end
+ * cmp = b.bytes.to_a
+ * result = 0
+ * a.bytes.each_with_index {|c,i|
+ * result |= c ^ cmp[i]
+ * }
+ * result == 0
+ * end
+ * Please note that the premature return in case of differing lengths
+ * typically does not leak valuable information - when using PKCS#5, the
+ * length of the values to be compared is of fixed size.
+ */
+
mPKCS5 = rb_define_module_under(mOSSL, "PKCS5");
+ /* Document-class: OpenSSL::PKCS5::PKCS5Error
+ *
+ * Generic Exception class that is raised if an error occurs during a
+ * computation.
+ */
ePKCS5 = rb_define_class_under(mPKCS5, "PKCS5Error", eOSSLError);
rb_define_module_function(mPKCS5, "pbkdf2_hmac", ossl_pkcs5_pbkdf2_hmac, 5);
diff --git a/ext/openssl/ossl_pkcs7.c b/ext/openssl/ossl_pkcs7.c
index f59d3c71d9..b710280c9c 100644
--- a/ext/openssl/ossl_pkcs7.c
+++ b/ext/openssl/ossl_pkcs7.c
@@ -318,14 +318,17 @@ ossl_pkcs7_initialize(int argc, VALUE *argv, VALUE self)
arg = ossl_to_der_if_possible(arg);
in = ossl_obj2bio(arg);
p7 = PEM_read_bio_PKCS7(in, &pkcs, NULL, NULL);
- DATA_PTR(self) = pkcs;
if (!p7) {
OSSL_BIO_reset(in);
p7 = d2i_PKCS7_bio(in, &pkcs);
- if (!p7)
+ if (!p7) {
+ BIO_free(in);
+ PKCS7_free(pkcs);
+ DATA_PTR(self) = NULL;
ossl_raise(rb_eArgError, "Could not parse the PKCS7");
- DATA_PTR(self) = pkcs;
+ }
}
+ DATA_PTR(self) = pkcs;
BIO_free(in);
ossl_pkcs7_set_data(self, Qnil);
ossl_pkcs7_set_err_string(self, Qnil);
diff --git a/ext/openssl/ossl_pkey.c b/ext/openssl/ossl_pkey.c
index 43812daa9c..0004d9d9b5 100644
--- a/ext/openssl/ossl_pkey.c
+++ b/ext/openssl/ossl_pkey.c
@@ -33,6 +33,42 @@ ossl_generate_cb(int p, int n, void *arg)
rb_yield(ary);
}
+#if HAVE_BN_GENCB
+/* OpenSSL 2nd version of GN generation callback */
+int
+ossl_generate_cb_2(int p, int n, BN_GENCB *cb)
+{
+ VALUE ary;
+ struct ossl_generate_cb_arg *arg;
+ int state;
+
+ arg = (struct ossl_generate_cb_arg *)cb->arg;
+ if (arg->yield) {
+ ary = rb_ary_new2(2);
+ rb_ary_store(ary, 0, INT2NUM(p));
+ rb_ary_store(ary, 1, INT2NUM(n));
+
+ /*
+ * can be break by raising exception or 'break'
+ */
+ rb_protect(rb_yield, ary, &state);
+ if (state) {
+ arg->stop = 1;
+ arg->state = state;
+ }
+ }
+ if (arg->stop) return 0;
+ return 1;
+}
+
+void
+ossl_generate_cb_stop(void *ptr)
+{
+ struct ossl_generate_cb_arg *arg = (struct ossl_generate_cb_arg *)ptr;
+ arg->stop = 1;
+}
+#endif
+
/*
* Public
*/
@@ -62,7 +98,8 @@ ossl_pkey_new(EVP_PKEY *pkey)
default:
ossl_raise(ePKeyError, "unsupported key type");
}
- return Qnil; /* not reached */
+
+ UNREACHABLE;
}
VALUE
@@ -75,6 +112,7 @@ ossl_pkey_new_from_file(VALUE filename)
if (!(fp = fopen(RSTRING_PTR(filename), "r"))) {
ossl_raise(ePKeyError, "%s", strerror(errno));
}
+ rb_fd_fix_cloexec(fileno(fp));
pkey = PEM_read_PrivateKey(fp, NULL, ossl_pem_passwd_cb, NULL);
fclose(fp);
@@ -101,7 +139,6 @@ ossl_pkey_new_from_file(VALUE filename)
static VALUE
ossl_pkey_new_from_data(int argc, VALUE *argv, VALUE self)
{
- FILE *fp;
EVP_PKEY *pkey;
BIO *bio;
VALUE data, pass;
@@ -370,11 +407,11 @@ Init_ossl_pkey()
/* Document-class: OpenSSL::PKey::PKey
*
* An abstract class that bundles signature creation (PKey#sign) and
- * validation (PKey#verify) that is common to all implementations:
+ * validation (PKey#verify) that is common to all implementations except
+ * OpenSSL::PKey::DH
* * OpenSSL::PKey::RSA
* * OpenSSL::PKey::DSA
* * OpenSSL::PKey::EC
- * * OpenSSL::PKey::DH
*/
cPKey = rb_define_class_under(mPKey, "PKey", rb_cObject);
diff --git a/ext/openssl/ossl_pkey.h b/ext/openssl/ossl_pkey.h
index 5e3329d326..686e956ee5 100644
--- a/ext/openssl/ossl_pkey.h
+++ b/ext/openssl/ossl_pkey.h
@@ -39,6 +39,16 @@ extern ID id_private_q;
} while (0)
void ossl_generate_cb(int, int, void *);
+#define HAVE_BN_GENCB defined(HAVE_RSA_GENERATE_KEY_EX) || defined(HAVE_DH_GENERATE_PARAMETERS_EX) || defined(HAVE_DSA_GENERATE_PARAMETERS_EX)
+#if HAVE_BN_GENCB
+struct ossl_generate_cb_arg {
+ int yield;
+ int stop;
+ int state;
+};
+int ossl_generate_cb_2(int p, int n, BN_GENCB *cb);
+void ossl_generate_cb_stop(void *ptr);
+#endif
VALUE ossl_pkey_new(EVP_PKEY *);
VALUE ossl_pkey_new_from_file(VALUE);
diff --git a/ext/openssl/ossl_pkey_dh.c b/ext/openssl/ossl_pkey_dh.c
index 748d9c82fd..c8fb40e1ff 100644
--- a/ext/openssl/ossl_pkey_dh.c
+++ b/ext/openssl/ossl_pkey_dh.c
@@ -81,20 +81,67 @@ ossl_dh_new(EVP_PKEY *pkey)
/*
* Private
*/
+#if defined(HAVE_DH_GENERATE_PARAMETERS_EX) && HAVE_BN_GENCB
+struct dh_blocking_gen_arg {
+ DH *dh;
+ int size;
+ int gen;
+ BN_GENCB *cb;
+ int result;
+};
+
+static void *
+dh_blocking_gen(void *arg)
+{
+ struct dh_blocking_gen_arg *gen = (struct dh_blocking_gen_arg *)arg;
+ gen->result = DH_generate_parameters_ex(gen->dh, gen->size, gen->gen, gen->cb);
+ return 0;
+}
+#endif
+
static DH *
dh_generate(int size, int gen)
{
- DH *dh;
+#if defined(HAVE_DH_GENERATE_PARAMETERS_EX) && HAVE_BN_GENCB
+ BN_GENCB cb;
+ struct ossl_generate_cb_arg cb_arg;
+ struct dh_blocking_gen_arg gen_arg;
+ DH *dh = DH_new();
- dh = DH_generate_parameters(size, gen,
- rb_block_given_p() ? ossl_generate_cb : NULL,
- NULL);
if (!dh) return 0;
- if (!DH_generate_key(dh)) {
+ memset(&cb_arg, 0, sizeof(struct ossl_generate_cb_arg));
+ if (rb_block_given_p())
+ cb_arg.yield = 1;
+ BN_GENCB_set(&cb, ossl_generate_cb_2, &cb_arg);
+ gen_arg.dh = dh;
+ gen_arg.size = size;
+ gen_arg.gen = gen;
+ gen_arg.cb = &cb;
+ if (cb_arg.yield == 1) {
+ /* we cannot release GVL when callback proc is supplied */
+ dh_blocking_gen(&gen_arg);
+ } else {
+ /* there's a chance to unblock */
+ rb_thread_call_without_gvl(dh_blocking_gen, &gen_arg, ossl_generate_cb_stop, &cb_arg);
+ }
+
+ if (!gen_arg.result) {
DH_free(dh);
+ if (cb_arg.state) rb_jump_tag(cb_arg.state);
return 0;
}
+#else
+ DH *dh;
+
+ dh = DH_generate_parameters(size, gen, rb_block_given_p() ? ossl_generate_cb : NULL, NULL);
+ if (!dh) return 0;
+#endif
+
+ if (!DH_generate_key(dh)) {
+ DH_free(dh);
+ return 0;
+ }
return dh;
}
diff --git a/ext/openssl/ossl_pkey_dsa.c b/ext/openssl/ossl_pkey_dsa.c
index 6b10e8fdf8..ba28ba028d 100644
--- a/ext/openssl/ossl_pkey_dsa.c
+++ b/ext/openssl/ossl_pkey_dsa.c
@@ -75,9 +75,69 @@ ossl_dsa_new(EVP_PKEY *pkey)
/*
* Private
*/
+#if defined(HAVE_DSA_GENERATE_PARAMETERS_EX) && HAVE_BN_GENCB
+struct dsa_blocking_gen_arg {
+ DSA *dsa;
+ int size;
+ unsigned char* seed;
+ int seed_len;
+ int *counter;
+ unsigned long *h;
+ BN_GENCB *cb;
+ int result;
+};
+
+static void *
+dsa_blocking_gen(void *arg)
+{
+ struct dsa_blocking_gen_arg *gen = (struct dsa_blocking_gen_arg *)arg;
+ gen->result = DSA_generate_parameters_ex(gen->dsa, gen->size, gen->seed, gen->seed_len, gen->counter, gen->h, gen->cb);
+ return 0;
+}
+#endif
+
static DSA *
dsa_generate(int size)
{
+#if defined(HAVE_DSA_GENERATE_PARAMETERS_EX) && HAVE_BN_GENCB
+ BN_GENCB cb;
+ struct ossl_generate_cb_arg cb_arg;
+ struct dsa_blocking_gen_arg gen_arg;
+ DSA *dsa = DSA_new();
+ unsigned char seed[20];
+ int seed_len = 20, counter;
+ unsigned long h;
+
+ if (!dsa) return 0;
+ if (!RAND_bytes(seed, seed_len)) {
+ DSA_free(dsa);
+ return 0;
+ }
+
+ memset(&cb_arg, 0, sizeof(struct ossl_generate_cb_arg));
+ if (rb_block_given_p())
+ cb_arg.yield = 1;
+ BN_GENCB_set(&cb, ossl_generate_cb_2, &cb_arg);
+ gen_arg.dsa = dsa;
+ gen_arg.size = size;
+ gen_arg.seed = seed;
+ gen_arg.seed_len = seed_len;
+ gen_arg.counter = &counter;
+ gen_arg.h = &h;
+ gen_arg.cb = &cb;
+ if (cb_arg.yield == 1) {
+ /* we cannot release GVL when callback proc is supplied */
+ dsa_blocking_gen(&gen_arg);
+ } else {
+ /* there's a chance to unblock */
+ rb_thread_call_without_gvl(dsa_blocking_gen, &gen_arg, ossl_generate_cb_stop, &cb_arg);
+ }
+ if (!gen_arg.result) {
+ DSA_free(dsa);
+ if (cb_arg.state) rb_jump_tag(cb_arg.state);
+ return 0;
+ }
+#else
DSA *dsa;
unsigned char seed[20];
int seed_len = 20, counter;
@@ -87,9 +147,9 @@ dsa_generate(int size)
return 0;
}
dsa = DSA_generate_parameters(size, seed, seed_len, &counter, &h,
- rb_block_given_p() ? ossl_generate_cb : NULL,
- NULL);
+ rb_block_given_p() ? ossl_generate_cb : NULL, NULL);
if(!dsa) return 0;
+#endif
if (!DSA_generate_key(dsa)) {
DSA_free(dsa);
@@ -184,7 +244,7 @@ ossl_dsa_initialize(int argc, VALUE *argv, VALUE self)
BIO_free(in);
if (!dsa) {
ERR_clear_error();
- ossl_raise(eDSAError, "Neither PUB key nor PRIV key:");
+ ossl_raise(eDSAError, "Neither PUB key nor PRIV key");
}
}
if (!EVP_PKEY_assign_DSA(pkey, dsa)) {
@@ -258,7 +318,10 @@ ossl_dsa_export(int argc, VALUE *argv, VALUE self)
if (!NIL_P(cipher)) {
ciph = GetCipherPtr(cipher);
if (!NIL_P(pass)) {
- passwd = StringValuePtr(pass);
+ StringValue(pass);
+ if (RSTRING_LENINT(pass) < OSSL_MIN_PWD_LEN)
+ ossl_raise(eOSSLError, "OpenSSL requires passwords to be at least four characters long");
+ passwd = RSTRING_PTR(pass);
}
}
if (!(out = BIO_new(BIO_s_mem()))) {
diff --git a/ext/openssl/ossl_pkey_ec.c b/ext/openssl/ossl_pkey_ec.c
index 9f1050f62d..8e6d88f606 100644
--- a/ext/openssl/ossl_pkey_ec.c
+++ b/ext/openssl/ossl_pkey_ec.c
@@ -493,7 +493,10 @@ static VALUE ossl_ec_key_to_string(VALUE self, VALUE ciph, VALUE pass, int forma
if (!NIL_P(ciph)) {
cipher = GetCipherPtr(ciph);
if (!NIL_P(pass)) {
- password = StringValuePtr(pass);
+ StringValue(pass);
+ if (RSTRING_LENINT(pass) < OSSL_MIN_PWD_LEN)
+ ossl_raise(eOSSLError, "OpenSSL requires passwords to be at least four characters long");
+ password = RSTRING_PTR(pass);
}
}
else {
@@ -530,8 +533,8 @@ static VALUE ossl_ec_key_to_string(VALUE self, VALUE ciph, VALUE pass, int forma
/*
* call-seq:
- * key.to_pem => String
- * key.to_pem(cipher, pass_phrase) => String
+ * key.export => String
+ * key.export(cipher, pass_phrase) => String
*
* Outputs the EC key in PEM encoding. If +cipher+ and +pass_phrase+ are
* given they will be used to encrypt the key. +cipher+ must be an
@@ -540,7 +543,7 @@ static VALUE ossl_ec_key_to_string(VALUE self, VALUE ciph, VALUE pass, int forma
* text.
*
*/
-static VALUE ossl_ec_key_to_pem(int argc, VALUE *argv, VALUE self)
+static VALUE ossl_ec_key_export(int argc, VALUE *argv, VALUE self)
{
VALUE cipher, passwd;
rb_scan_args(argc, argv, "02", &cipher, &passwd);
@@ -700,6 +703,8 @@ static VALUE ossl_ec_key_dsa_verify_asn1(VALUE self, VALUE data, VALUE sig)
}
ossl_raise(eECError, "ECDSA_verify");
+
+ UNREACHABLE;
}
static void ossl_ec_group_free(ossl_ec_group *ec_group)
@@ -1349,6 +1354,8 @@ static VALUE ossl_ec_point_is_at_infinity(VALUE self)
case 0: return Qfalse;
default: ossl_raise(cEC_POINT, "EC_POINT_is_at_infinity");
}
+
+ UNREACHABLE;
}
/*
@@ -1370,6 +1377,8 @@ static VALUE ossl_ec_point_is_on_curve(VALUE self)
case 0: return Qfalse;
default: ossl_raise(cEC_POINT, "EC_POINT_is_on_curve");
}
+
+ UNREACHABLE;
}
/*
@@ -1461,6 +1470,78 @@ static VALUE ossl_ec_point_to_bn(VALUE self)
return bn_obj;
}
+/*
+ * call-seq:
+ * point.mul(bn) => point
+ * point.mul(bn, bn) => point
+ * point.mul([bn], [point]) => point
+ * point.mul([bn], [point], bn) => point
+ */
+static VALUE ossl_ec_point_mul(int argc, VALUE *argv, VALUE self)
+{
+ EC_POINT *point1, *point2;
+ const EC_GROUP *group;
+ VALUE group_v = rb_iv_get(self, "@group");
+ VALUE bn_v1, bn_v2, r, points_v;
+ BIGNUM *bn1 = NULL, *bn2 = NULL;
+
+ Require_EC_POINT(self, point1);
+ SafeRequire_EC_GROUP(group_v, group);
+
+ r = rb_obj_alloc(cEC_POINT);
+ ossl_ec_point_initialize(1, &group_v, r);
+ Require_EC_POINT(r, point2);
+
+ argc = rb_scan_args(argc, argv, "12", &bn_v1, &points_v, &bn_v2);
+
+ if (rb_obj_is_kind_of(bn_v1, cBN)) {
+ bn1 = GetBNPtr(bn_v1);
+ if (argc >= 2) {
+ bn2 = GetBNPtr(points_v);
+ }
+ if (EC_POINT_mul(group, point2, bn2, point1, bn1, ossl_bn_ctx) != 1)
+ ossl_raise(eEC_POINT, "Multiplication failed");
+ } else {
+ size_t i, points_len, bignums_len;
+ const EC_POINT **points;
+ const BIGNUM **bignums;
+
+ Check_Type(bn_v1, T_ARRAY);
+ bignums_len = RARRAY_LEN(bn_v1);
+ bignums = (const BIGNUM **)OPENSSL_malloc(bignums_len * (int)sizeof(BIGNUM *));
+
+ for (i = 0; i < bignums_len; ++i) {
+ bignums[i] = GetBNPtr(rb_ary_entry(bn_v1, i));
+ }
+
+ if (!rb_obj_is_kind_of(points_v, rb_cArray)) {
+ OPENSSL_free((void *)bignums);
+ rb_raise(rb_eTypeError, "Argument2 must be an array");
+ }
+
+ rb_ary_unshift(points_v, self);
+ points_len = RARRAY_LEN(points_v);
+ points = (const EC_POINT **)OPENSSL_malloc(points_len * (int)sizeof(EC_POINT *));
+
+ for (i = 0; i < points_len; ++i) {
+ Get_EC_POINT(rb_ary_entry(points_v, i), points[i]);
+ }
+
+ if (argc >= 3) {
+ bn2 = GetBNPtr(bn_v2);
+ }
+ if (EC_POINTs_mul(group, point2, bn2, points_len, points, bignums, ossl_bn_ctx) != 1) {
+ OPENSSL_free((void *)bignums);
+ OPENSSL_free((void *)points);
+ ossl_raise(eEC_POINT, "Multiplication failed");
+ }
+ OPENSSL_free((void *)bignums);
+ OPENSSL_free((void *)points);
+ }
+
+ return r;
+}
+
static void no_copy(VALUE klass)
{
rb_undef_method(klass, "copy");
@@ -1527,7 +1608,8 @@ void Init_ossl_ec()
rb_define_method(cEC, "dsa_verify_asn1", ossl_ec_key_dsa_verify_asn1, 2);
/* do_sign/do_verify */
- rb_define_method(cEC, "to_pem", ossl_ec_key_to_pem, -1);
+ rb_define_method(cEC, "export", ossl_ec_key_export, -1);
+ rb_define_alias(cEC, "to_pem", "export");
rb_define_method(cEC, "to_der", ossl_ec_key_to_der, 0);
rb_define_method(cEC, "to_text", ossl_ec_key_to_text, 0);
@@ -1581,6 +1663,7 @@ void Init_ossl_ec()
/* all the other methods */
rb_define_method(cEC_POINT, "to_bn", ossl_ec_point_to_bn, 0);
+ rb_define_method(cEC_POINT, "mul", ossl_ec_point_mul, -1);
no_copy(cEC);
no_copy(cEC_GROUP);
diff --git a/ext/openssl/ossl_pkey_rsa.c b/ext/openssl/ossl_pkey_rsa.c
index eba693b057..e395e7108f 100644
--- a/ext/openssl/ossl_pkey_rsa.c
+++ b/ext/openssl/ossl_pkey_rsa.c
@@ -76,12 +76,77 @@ ossl_rsa_new(EVP_PKEY *pkey)
/*
* Private
*/
+#if defined(HAVE_RSA_GENERATE_KEY_EX) && HAVE_BN_GENCB
+struct rsa_blocking_gen_arg {
+ RSA *rsa;
+ BIGNUM *e;
+ int size;
+ BN_GENCB *cb;
+ int result;
+};
+
+static void *
+rsa_blocking_gen(void *arg)
+{
+ struct rsa_blocking_gen_arg *gen = (struct rsa_blocking_gen_arg *)arg;
+ gen->result = RSA_generate_key_ex(gen->rsa, gen->size, gen->e, gen->cb);
+ return 0;
+}
+#endif
+
static RSA *
-rsa_generate(int size, int exp)
+rsa_generate(int size, unsigned long exp)
{
- return RSA_generate_key(size, exp,
- rb_block_given_p() ? ossl_generate_cb : NULL,
- NULL);
+#if defined(HAVE_RSA_GENERATE_KEY_EX) && HAVE_BN_GENCB
+ int i;
+ BN_GENCB cb;
+ struct ossl_generate_cb_arg cb_arg;
+ struct rsa_blocking_gen_arg gen_arg;
+ RSA *rsa = RSA_new();
+ BIGNUM *e = BN_new();
+
+ if (!rsa || !e) {
+ if (e) BN_free(e);
+ if (rsa) RSA_free(rsa);
+ return 0;
+ }
+ for (i = 0; i < (int)sizeof(exp) * 8; ++i) {
+ if (exp & (1UL << i)) {
+ if (BN_set_bit(e, i) == 0) {
+ BN_free(e);
+ RSA_free(rsa);
+ return 0;
+ }
+ }
+ }
+
+ memset(&cb_arg, 0, sizeof(struct ossl_generate_cb_arg));
+ if (rb_block_given_p())
+ cb_arg.yield = 1;
+ BN_GENCB_set(&cb, ossl_generate_cb_2, &cb_arg);
+ gen_arg.rsa = rsa;
+ gen_arg.e = e;
+ gen_arg.size = size;
+ gen_arg.cb = &cb;
+ if (cb_arg.yield == 1) {
+ /* we cannot release GVL when callback proc is supplied */
+ rsa_blocking_gen(&gen_arg);
+ } else {
+ /* there's a chance to unblock */
+ rb_thread_call_without_gvl(rsa_blocking_gen, &gen_arg, ossl_generate_cb_stop, &cb_arg);
+ }
+ if (!gen_arg.result) {
+ BN_free(e);
+ RSA_free(rsa);
+ if (cb_arg.state) rb_jump_tag(cb_arg.state);
+ return 0;
+ }
+
+ BN_free(e);
+ return rsa;
+#else
+ return RSA_generate_key(size, exp, rb_block_given_p() ? ossl_generate_cb : NULL, NULL);
+#endif
}
/*
@@ -103,7 +168,7 @@ ossl_rsa_s_generate(int argc, VALUE *argv, VALUE klass)
rb_scan_args(argc, argv, "11", &size, &exp);
- rsa = rsa_generate(NUM2INT(size), NIL_P(exp) ? RSA_F4 : NUM2INT(exp)); /* err handled by rsa_instance */
+ rsa = rsa_generate(NUM2INT(size), NIL_P(exp) ? RSA_F4 : NUM2ULONG(exp)); /* err handled by rsa_instance */
obj = rsa_instance(klass, rsa);
if (obj == Qfalse) {
@@ -148,7 +213,7 @@ ossl_rsa_initialize(int argc, VALUE *argv, VALUE self)
rsa = RSA_new();
}
else if (FIXNUM_P(arg)) {
- rsa = rsa_generate(FIX2INT(arg), NIL_P(pass) ? RSA_F4 : NUM2INT(pass));
+ rsa = rsa_generate(FIX2INT(arg), NIL_P(pass) ? RSA_F4 : NUM2ULONG(pass));
if (!rsa) ossl_raise(eRSAError, NULL);
}
else {
@@ -178,7 +243,7 @@ ossl_rsa_initialize(int argc, VALUE *argv, VALUE self)
}
BIO_free(in);
if (!rsa) {
- ossl_raise(eRSAError, "Neither PUB key nor PRIV key:");
+ ossl_raise(eRSAError, "Neither PUB key nor PRIV key");
}
}
if (!EVP_PKEY_assign_RSA(pkey, rsa)) {
@@ -249,7 +314,10 @@ ossl_rsa_export(int argc, VALUE *argv, VALUE self)
if (!NIL_P(cipher)) {
ciph = GetCipherPtr(cipher);
if (!NIL_P(pass)) {
- passwd = StringValuePtr(pass);
+ StringValue(pass);
+ if (RSTRING_LENINT(pass) < OSSL_MIN_PWD_LEN)
+ ossl_raise(eOSSLError, "OpenSSL requires passwords to be at least four characters long");
+ passwd = RSTRING_PTR(pass);
}
}
if (!(out = BIO_new(BIO_s_mem()))) {
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index ed820cd431..d5c07d79a9 100644
--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -29,47 +29,51 @@ VALUE eSSLError;
VALUE cSSLContext;
VALUE cSSLSocket;
-#define ossl_sslctx_set_cert(o,v) rb_iv_set((o),"@cert",(v))
-#define ossl_sslctx_set_key(o,v) rb_iv_set((o),"@key",(v))
-#define ossl_sslctx_set_client_ca(o,v) rb_iv_set((o),"@client_ca",(v))
-#define ossl_sslctx_set_ca_file(o,v) rb_iv_set((o),"@ca_file",(v))
-#define ossl_sslctx_set_ca_path(o,v) rb_iv_set((o),"@ca_path",(v))
-#define ossl_sslctx_set_timeout(o,v) rb_iv_set((o),"@timeout",(v))
-#define ossl_sslctx_set_verify_mode(o,v) rb_iv_set((o),"@verify_mode",(v))
-#define ossl_sslctx_set_verify_dep(o,v) rb_iv_set((o),"@verify_depth",(v))
-#define ossl_sslctx_set_verify_cb(o,v) rb_iv_set((o),"@verify_callback",(v))
-#define ossl_sslctx_set_options(o,v) rb_iv_set((o),"@options",(v))
-#define ossl_sslctx_set_cert_store(o,v) rb_iv_set((o),"@cert_store",(v))
-#define ossl_sslctx_set_extra_cert(o,v) rb_iv_set((o),"@extra_chain_cert",(v))
-#define ossl_sslctx_set_client_cert_cb(o,v) rb_iv_set((o),"@client_cert_cb",(v))
-#define ossl_sslctx_set_tmp_dh_cb(o,v) rb_iv_set((o),"@tmp_dh_callback",(v))
-#define ossl_sslctx_set_sess_id_ctx(o, v) rb_iv_get((o),"@session_id_context"(v))
-
-#define ossl_sslctx_get_cert(o) rb_iv_get((o),"@cert")
-#define ossl_sslctx_get_key(o) rb_iv_get((o),"@key")
-#define ossl_sslctx_get_client_ca(o) rb_iv_get((o),"@client_ca")
-#define ossl_sslctx_get_ca_file(o) rb_iv_get((o),"@ca_file")
-#define ossl_sslctx_get_ca_path(o) rb_iv_get((o),"@ca_path")
-#define ossl_sslctx_get_timeout(o) rb_iv_get((o),"@timeout")
-#define ossl_sslctx_get_verify_mode(o) rb_iv_get((o),"@verify_mode")
-#define ossl_sslctx_get_verify_dep(o) rb_iv_get((o),"@verify_depth")
-#define ossl_sslctx_get_verify_cb(o) rb_iv_get((o),"@verify_callback")
-#define ossl_sslctx_get_options(o) rb_iv_get((o),"@options")
-#define ossl_sslctx_get_cert_store(o) rb_iv_get((o),"@cert_store")
-#define ossl_sslctx_get_extra_cert(o) rb_iv_get((o),"@extra_chain_cert")
-#define ossl_sslctx_get_client_cert_cb(o) rb_iv_get((o),"@client_cert_cb")
-#define ossl_sslctx_get_tmp_dh_cb(o) rb_iv_get((o),"@tmp_dh_callback")
-#define ossl_sslctx_get_sess_id_ctx(o) rb_iv_get((o),"@session_id_context")
+#define ossl_sslctx_set_cert(o,v) rb_iv_set((o),"@cert",(v))
+#define ossl_sslctx_set_key(o,v) rb_iv_set((o),"@key",(v))
+#define ossl_sslctx_set_client_ca(o,v) rb_iv_set((o),"@client_ca",(v))
+#define ossl_sslctx_set_ca_file(o,v) rb_iv_set((o),"@ca_file",(v))
+#define ossl_sslctx_set_ca_path(o,v) rb_iv_set((o),"@ca_path",(v))
+#define ossl_sslctx_set_timeout(o,v) rb_iv_set((o),"@timeout",(v))
+#define ossl_sslctx_set_verify_mode(o,v) rb_iv_set((o),"@verify_mode",(v))
+#define ossl_sslctx_set_verify_dep(o,v) rb_iv_set((o),"@verify_depth",(v))
+#define ossl_sslctx_set_verify_cb(o,v) rb_iv_set((o),"@verify_callback",(v))
+#define ossl_sslctx_set_options(o,v) rb_iv_set((o),"@options",(v))
+#define ossl_sslctx_set_cert_store(o,v) rb_iv_set((o),"@cert_store",(v))
+#define ossl_sslctx_set_extra_cert(o,v) rb_iv_set((o),"@extra_chain_cert",(v))
+#define ossl_sslctx_set_client_cert_cb(o,v) rb_iv_set((o),"@client_cert_cb",(v))
+#define ossl_sslctx_set_tmp_dh_cb(o,v) rb_iv_set((o),"@tmp_dh_callback",(v))
+#define ossl_sslctx_set_sess_id_ctx(o, v) rb_iv_set((o),"@session_id_context",(v))
+
+#define ossl_sslctx_get_cert(o) rb_iv_get((o),"@cert")
+#define ossl_sslctx_get_key(o) rb_iv_get((o),"@key")
+#define ossl_sslctx_get_client_ca(o) rb_iv_get((o),"@client_ca")
+#define ossl_sslctx_get_ca_file(o) rb_iv_get((o),"@ca_file")
+#define ossl_sslctx_get_ca_path(o) rb_iv_get((o),"@ca_path")
+#define ossl_sslctx_get_timeout(o) rb_iv_get((o),"@timeout")
+#define ossl_sslctx_get_verify_mode(o) rb_iv_get((o),"@verify_mode")
+#define ossl_sslctx_get_verify_dep(o) rb_iv_get((o),"@verify_depth")
+#define ossl_sslctx_get_verify_cb(o) rb_iv_get((o),"@verify_callback")
+#define ossl_sslctx_get_options(o) rb_iv_get((o),"@options")
+#define ossl_sslctx_get_cert_store(o) rb_iv_get((o),"@cert_store")
+#define ossl_sslctx_get_extra_cert(o) rb_iv_get((o),"@extra_chain_cert")
+#define ossl_sslctx_get_client_cert_cb(o) rb_iv_get((o),"@client_cert_cb")
+#define ossl_sslctx_get_tmp_dh_cb(o) rb_iv_get((o),"@tmp_dh_callback")
+#define ossl_sslctx_get_sess_id_ctx(o) rb_iv_get((o),"@session_id_context")
static const char *ossl_sslctx_attrs[] = {
"cert", "key", "client_ca", "ca_file", "ca_path",
- "timeout", "verify_mode", "verify_depth",
+ "timeout", "verify_mode", "verify_depth", "renegotiation_cb",
"verify_callback", "options", "cert_store", "extra_chain_cert",
"client_cert_cb", "tmp_dh_callback", "session_id_context",
"session_get_cb", "session_new_cb", "session_remove_cb",
#ifdef HAVE_SSL_SET_TLSEXT_HOST_NAME
"servername_cb",
#endif
+#ifdef HAVE_OPENSSL_NPN_NEGOTIATED
+ "npn_protocols",
+ "npn_select_cb",
+#endif
};
#define ossl_ssl_get_io(o) rb_iv_get((o),"@io")
@@ -107,6 +111,18 @@ struct {
OSSL_SSL_METHOD_ENTRY(TLSv1),
OSSL_SSL_METHOD_ENTRY(TLSv1_server),
OSSL_SSL_METHOD_ENTRY(TLSv1_client),
+#if defined(HAVE_TLSV1_2_METHOD) && defined(HAVE_TLSV1_2_SERVER_METHOD) && \
+ defined(HAVE_TLSV1_2_CLIENT_METHOD)
+ OSSL_SSL_METHOD_ENTRY(TLSv1_2),
+ OSSL_SSL_METHOD_ENTRY(TLSv1_2_server),
+ OSSL_SSL_METHOD_ENTRY(TLSv1_2_client),
+#endif
+#if defined(HAVE_TLSV1_1_METHOD) && defined(HAVE_TLSV1_1_SERVER_METHOD) && \
+ defined(HAVE_TLSV1_1_CLIENT_METHOD)
+ OSSL_SSL_METHOD_ENTRY(TLSv1_1),
+ OSSL_SSL_METHOD_ENTRY(TLSv1_1_server),
+ OSSL_SSL_METHOD_ENTRY(TLSv1_1_client),
+#endif
#if defined(HAVE_SSLV2_METHOD) && defined(HAVE_SSLV2_SERVER_METHOD) && \
defined(HAVE_SSLV2_CLIENT_METHOD)
OSSL_SSL_METHOD_ENTRY(SSLv2),
@@ -148,10 +164,9 @@ ossl_sslctx_s_alloc(VALUE klass)
ctx = SSL_CTX_new(SSLv23_method());
if (!ctx) {
- ossl_raise(eSSLError, "SSL_CTX_new:");
+ ossl_raise(eSSLError, "SSL_CTX_new");
}
SSL_CTX_set_mode(ctx, mode);
- SSL_CTX_set_options(ctx, SSL_OP_ALL);
return Data_Wrap_Struct(klass, 0, ossl_sslctx_free, ctx);
}
@@ -185,7 +200,7 @@ ossl_sslctx_set_ssl_version(VALUE self, VALUE ssl_method)
}
Data_Get_Struct(self, SSL_CTX, ctx);
if (SSL_CTX_set_ssl_version(ctx, method) != 1) {
- ossl_raise(eSSLError, "SSL_CTX_set_ssl_version:");
+ ossl_raise(eSSLError, "SSL_CTX_set_ssl_version");
}
return ssl_method;
@@ -380,7 +395,7 @@ ossl_call_session_new_cb(VALUE ary)
static int
ossl_sslctx_session_new_cb(SSL *ssl, SSL_SESSION *sess)
{
- VALUE ary, ssl_obj, sess_obj, ret_obj;
+ VALUE ary, ssl_obj, sess_obj;
void *ptr;
int state = 0;
@@ -397,7 +412,7 @@ ossl_sslctx_session_new_cb(SSL *ssl, SSL_SESSION *sess)
rb_ary_push(ary, ssl_obj);
rb_ary_push(ary, sess_obj);
- ret_obj = rb_protect((VALUE(*)_((VALUE)))ossl_call_session_new_cb, ary, &state);
+ rb_protect((VALUE(*)_((VALUE)))ossl_call_session_new_cb, ary, &state);
if (state) {
rb_ivar_set(ssl_obj, ID_callback_state, INT2NUM(state));
}
@@ -429,7 +444,7 @@ ossl_call_session_remove_cb(VALUE ary)
static void
ossl_sslctx_session_remove_cb(SSL_CTX *ctx, SSL_SESSION *sess)
{
- VALUE ary, sslctx_obj, sess_obj, ret_obj;
+ VALUE ary, sslctx_obj, sess_obj;
void *ptr;
int state = 0;
@@ -446,7 +461,7 @@ ossl_sslctx_session_remove_cb(SSL_CTX *ctx, SSL_SESSION *sess)
rb_ary_push(ary, sslctx_obj);
rb_ary_push(ary, sess_obj);
- ret_obj = rb_protect((VALUE(*)_((VALUE)))ossl_call_session_remove_cb, ary, &state);
+ rb_protect((VALUE(*)_((VALUE)))ossl_call_session_remove_cb, ary, &state);
if (state) {
/*
the SSL_CTX is frozen, nowhere to save state.
@@ -506,7 +521,7 @@ ossl_call_servername_cb(VALUE ary)
static int
ssl_servername_cb(SSL *ssl, int *ad, void *arg)
{
- VALUE ary, ssl_obj, ret_obj;
+ VALUE ary, ssl_obj;
void *ptr;
int state = 0;
const char *servername = SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name);
@@ -521,7 +536,7 @@ ssl_servername_cb(SSL *ssl, int *ad, void *arg)
rb_ary_push(ary, ssl_obj);
rb_ary_push(ary, rb_str_new2(servername));
- ret_obj = rb_protect((VALUE(*)_((VALUE)))ossl_call_servername_cb, ary, &state);
+ rb_protect((VALUE(*)_((VALUE)))ossl_call_servername_cb, ary, &state);
if (state) {
rb_ivar_set(ssl_obj, ID_callback_state, INT2NUM(state));
return SSL_TLSEXT_ERR_ALERT_FATAL;
@@ -531,6 +546,99 @@ ssl_servername_cb(SSL *ssl, int *ad, void *arg)
}
#endif
+static void
+ssl_renegotiation_cb(const SSL *ssl)
+{
+ VALUE ssl_obj, sslctx_obj, cb;
+ void *ptr;
+
+ if ((ptr = SSL_get_ex_data(ssl, ossl_ssl_ex_ptr_idx)) == NULL)
+ ossl_raise(eSSLError, "SSL object could not be retrieved");
+ ssl_obj = (VALUE)ptr;
+
+ sslctx_obj = rb_iv_get(ssl_obj, "@context");
+ if (NIL_P(sslctx_obj)) return;
+ cb = rb_iv_get(sslctx_obj, "@renegotiation_cb");
+ if (NIL_P(cb)) return;
+
+ (void) rb_funcall(cb, rb_intern("call"), 1, ssl_obj);
+}
+
+#ifdef HAVE_OPENSSL_NPN_NEGOTIATED
+static VALUE
+ssl_npn_encode_protocol_i(VALUE cur, VALUE encoded)
+{
+ int len = RSTRING_LENINT(cur);
+ char len_byte;
+ if (len < 1 || len > 255)
+ ossl_raise(eSSLError, "Advertised protocol must have length 1..255");
+ /* Encode the length byte */
+ len_byte = len;
+ rb_str_buf_cat(encoded, &len_byte, 1);
+ rb_str_buf_cat(encoded, RSTRING_PTR(cur), len);
+ return Qnil;
+}
+
+static void
+ssl_npn_encode_protocols(VALUE sslctx, VALUE protocols)
+{
+ VALUE encoded = rb_str_new2("");
+ rb_iterate(rb_each, protocols, ssl_npn_encode_protocol_i, encoded);
+ StringValueCStr(encoded);
+ rb_iv_set(sslctx, "@_protocols", encoded);
+}
+
+static int
+ssl_npn_advertise_cb(SSL *ssl, const unsigned char **out, unsigned int *outlen, void *arg)
+{
+ VALUE sslctx_obj = (VALUE) arg;
+ VALUE protocols = rb_iv_get(sslctx_obj, "@_protocols");
+
+ *out = (const unsigned char *) RSTRING_PTR(protocols);
+ *outlen = RSTRING_LENINT(protocols);
+
+ return SSL_TLSEXT_ERR_OK;
+}
+
+static int
+ssl_npn_select_cb(SSL *s, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
+{
+ int i = 0;
+ VALUE sslctx_obj, cb, protocols, selected;
+
+ sslctx_obj = (VALUE) arg;
+ cb = rb_iv_get(sslctx_obj, "@npn_select_cb");
+ protocols = rb_ary_new();
+
+ /* The format is len_1|proto_1|...|len_n|proto_n\0 */
+ while (in[i]) {
+ VALUE protocol = rb_str_new((const char *) &in[i + 1], in[i]);
+ rb_ary_push(protocols, protocol);
+ i += in[i] + 1;
+ }
+
+ selected = rb_funcall(cb, rb_intern("call"), 1, protocols);
+ StringValue(selected);
+ *out = (unsigned char *) StringValuePtr(selected);
+ *outlen = RSTRING_LENINT(selected);
+
+ return SSL_TLSEXT_ERR_OK;
+}
+#endif
+
+/* This function may serve as the entry point to support further
+ * callbacks. */
+static void
+ssl_info_cb(const SSL *ssl, int where, int val)
+{
+ int state = SSL_state(ssl);
+
+ if ((where & SSL_CB_HANDSHAKE_START) &&
+ (state & SSL_ST_ACCEPT)) {
+ ssl_renegotiation_cb(ssl);
+ }
+}
+
/*
* call-seq:
* ctx.setup => Qtrue # first time
@@ -590,14 +698,14 @@ ossl_sslctx_setup(VALUE self)
if (cert && key) {
if (!SSL_CTX_use_certificate(ctx, cert)) {
/* Adds a ref => Safe to FREE */
- ossl_raise(eSSLError, "SSL_CTX_use_certificate:");
+ ossl_raise(eSSLError, "SSL_CTX_use_certificate");
}
if (!SSL_CTX_use_PrivateKey(ctx, key)) {
/* Adds a ref => Safe to FREE */
- ossl_raise(eSSLError, "SSL_CTX_use_PrivateKey:");
+ ossl_raise(eSSLError, "SSL_CTX_use_PrivateKey");
}
if (!SSL_CTX_check_private_key(ctx)) {
- ossl_raise(eSSLError, "SSL_CTX_check_private_key:");
+ ossl_raise(eSSLError, "SSL_CTX_check_private_key");
}
}
@@ -643,7 +751,25 @@ ossl_sslctx_setup(VALUE self)
if(!NIL_P(val)) SSL_CTX_set_verify_depth(ctx, NUM2INT(val));
val = ossl_sslctx_get_options(self);
- if(!NIL_P(val)) SSL_CTX_set_options(ctx, NUM2LONG(val));
+ if(!NIL_P(val)) {
+ SSL_CTX_set_options(ctx, NUM2LONG(val));
+ } else {
+ SSL_CTX_set_options(ctx, SSL_OP_ALL);
+ }
+
+#ifdef HAVE_OPENSSL_NPN_NEGOTIATED
+ val = rb_iv_get(self, "@npn_protocols");
+ if (!NIL_P(val)) {
+ ssl_npn_encode_protocols(self, val);
+ SSL_CTX_set_next_protos_advertised_cb(ctx, ssl_npn_advertise_cb, (void *) self);
+ OSSL_Debug("SSL NPN advertise callback added");
+ }
+ if (RTEST(rb_iv_get(self, "@npn_select_cb"))) {
+ SSL_CTX_set_next_proto_select_cb(ctx, ssl_npn_select_cb, (void *) self);
+ OSSL_Debug("SSL NPN select callback added");
+ }
+#endif
+
rb_obj_freeze(self);
val = ossl_sslctx_get_sess_id_ctx(self);
@@ -651,7 +777,7 @@ ossl_sslctx_setup(VALUE self)
StringValue(val);
if (!SSL_CTX_set_session_id_context(ctx, (unsigned char *)RSTRING_PTR(val),
RSTRING_LENINT(val))){
- ossl_raise(eSSLError, "SSL_CTX_set_session_id_context:");
+ ossl_raise(eSSLError, "SSL_CTX_set_session_id_context");
}
}
@@ -771,13 +897,12 @@ ossl_sslctx_set_ciphers(VALUE self, VALUE v)
return Qnil;
}
if (!SSL_CTX_set_cipher_list(ctx, RSTRING_PTR(str))) {
- ossl_raise(eSSLError, "SSL_CTX_set_cipher_list:");
+ ossl_raise(eSSLError, "SSL_CTX_set_cipher_list");
}
return v;
}
-
/*
* call-seq:
* ctx.session_add(session) -> true | false
@@ -983,8 +1108,8 @@ ossl_ssl_shutdown(SSL *ssl)
if (rc = SSL_shutdown(ssl))
break;
}
- ERR_clear_error();
SSL_clear(ssl);
+ ERR_clear_error();
}
}
@@ -1058,14 +1183,14 @@ ossl_ssl_setup(VALUE self)
ssl = SSL_new(ctx);
if (!ssl) {
- ossl_raise(eSSLError, "SSL_new:");
+ ossl_raise(eSSLError, "SSL_new");
}
DATA_PTR(self) = ssl;
#ifdef HAVE_SSL_SET_TLSEXT_HOST_NAME
if (!NIL_P(hostname)) {
if (SSL_set_tlsext_host_name(ssl, StringValuePtr(hostname)) != 1)
- ossl_raise(eSSLError, "SSL_set_tlsext_host_name:");
+ ossl_raise(eSSLError, "SSL_set_tlsext_host_name");
}
#endif
io = ossl_ssl_get_io(self);
@@ -1080,6 +1205,7 @@ ossl_ssl_setup(VALUE self)
SSL_set_ex_data(ssl, ossl_ssl_ex_client_cert_cb_idx, (void*)cb);
cb = ossl_sslctx_get_tmp_dh_cb(v_ctx);
SSL_set_ex_data(ssl, ossl_ssl_ex_tmp_dh_callback_idx, (void*)cb);
+ SSL_set_info_callback(ssl, ssl_info_cb);
}
return Qtrue;
@@ -1091,6 +1217,15 @@ ossl_ssl_setup(VALUE self)
#define ssl_get_error(ssl, ret) SSL_get_error((ssl), (ret))
#endif
+#define ossl_ssl_data_get_struct(v, ssl) \
+do { \
+ Data_Get_Struct((v), SSL, (ssl)); \
+ if (!(ssl)) { \
+ rb_warning("SSL session is not started yet."); \
+ return Qnil; \
+ } \
+} while (0)
+
static void
write_would_block(int nonblock)
{
@@ -1121,7 +1256,8 @@ ossl_start_ssl(VALUE self, int (*func)(), const char *funcname, int nonblock)
rb_ivar_set(self, ID_callback_state, Qnil);
- Data_Get_Struct(self, SSL, ssl);
+ ossl_ssl_data_get_struct(self, ssl);
+
GetOpenFile(ossl_ssl_get_io(self), fptr);
for(;;){
ret = func(ssl);
@@ -1273,7 +1409,7 @@ ossl_ssl_read_internal(int argc, VALUE *argv, VALUE self, int nonblock)
if(ERR_peek_error() == 0 && nread == 0) rb_eof_error();
rb_sys_fail(0);
default:
- ossl_raise(eSSLError, "SSL_read:");
+ ossl_raise(eSSLError, "SSL_read");
}
}
}
@@ -1290,7 +1426,6 @@ ossl_ssl_read_internal(int argc, VALUE *argv, VALUE self, int nonblock)
return str;
}
-
/*
* call-seq:
* ssl.sysread(length) => string
@@ -1350,7 +1485,7 @@ ossl_ssl_write_internal(VALUE self, VALUE str, int nonblock)
case SSL_ERROR_SYSCALL:
if (errno) rb_sys_fail(0);
default:
- ossl_raise(eSSLError, "SSL_write:");
+ ossl_raise(eSSLError, "SSL_write");
}
}
}
@@ -1400,7 +1535,8 @@ ossl_ssl_close(VALUE self)
{
SSL *ssl;
- Data_Get_Struct(self, SSL, ssl);
+ ossl_ssl_data_get_struct(self, ssl);
+
ossl_ssl_shutdown(ssl);
if (RTEST(ossl_ssl_get_sync_close(self)))
rb_funcall(ossl_ssl_get_io(self), rb_intern("close"), 0);
@@ -1420,11 +1556,7 @@ ossl_ssl_get_cert(VALUE self)
SSL *ssl;
X509 *cert = NULL;
- Data_Get_Struct(self, SSL, ssl);
- if (!ssl) {
- rb_warning("SSL session is not started yet.");
- return Qnil;
- }
+ ossl_ssl_data_get_struct(self, ssl);
/*
* Is this OpenSSL bug? Should add a ref?
@@ -1451,12 +1583,7 @@ ossl_ssl_get_peer_cert(VALUE self)
X509 *cert = NULL;
VALUE obj;
- Data_Get_Struct(self, SSL, ssl);
-
- if (!ssl){
- rb_warning("SSL session is not started yet.");
- return Qnil;
- }
+ ossl_ssl_data_get_struct(self, ssl);
cert = SSL_get_peer_certificate(ssl); /* Adds a ref => Safe to FREE. */
@@ -1484,11 +1611,8 @@ ossl_ssl_get_peer_cert_chain(VALUE self)
VALUE ary;
int i, num;
- Data_Get_Struct(self, SSL, ssl);
- if(!ssl){
- rb_warning("SSL session is not started yet.");
- return Qnil;
- }
+ ossl_ssl_data_get_struct(self, ssl);
+
chain = SSL_get_peer_cert_chain(ssl);
if(!chain) return Qnil;
num = sk_X509_num(chain);
@@ -1502,22 +1626,36 @@ ossl_ssl_get_peer_cert_chain(VALUE self)
}
/*
- * call-seq:
- * ssl.cipher => [name, version, bits, alg_bits]
- *
- * The cipher being used for the current connection
- */
+* call-seq:
+* ssl.version => String
+*
+* Returns a String representing the SSL/TLS version that was negotiated
+* for the connection, for example "TLSv1.2".
+*/
+static VALUE
+ossl_ssl_get_version(VALUE self)
+{
+ SSL *ssl;
+
+ ossl_ssl_data_get_struct(self, ssl);
+
+ return rb_str_new2(SSL_get_version(ssl));
+}
+
+/*
+* call-seq:
+* ssl.cipher => [name, version, bits, alg_bits]
+*
+* The cipher being used for the current connection
+*/
static VALUE
ossl_ssl_get_cipher(VALUE self)
{
SSL *ssl;
SSL_CIPHER *cipher;
- Data_Get_Struct(self, SSL, ssl);
- if (!ssl) {
- rb_warning("SSL session is not started yet.");
- return Qnil;
- }
+ ossl_ssl_data_get_struct(self, ssl);
+
cipher = (SSL_CIPHER *)SSL_get_current_cipher(ssl);
return ossl_ssl_cipher_to_ary(cipher);
@@ -1535,11 +1673,8 @@ ossl_ssl_get_state(VALUE self)
SSL *ssl;
VALUE ret;
- Data_Get_Struct(self, SSL, ssl);
- if (!ssl) {
- rb_warning("SSL session is not started yet.");
- return Qnil;
- }
+ ossl_ssl_data_get_struct(self, ssl);
+
ret = rb_str_new2(SSL_state_string(ssl));
if (ruby_verbose) {
rb_str_cat2(ret, ": ");
@@ -1559,11 +1694,7 @@ ossl_ssl_pending(VALUE self)
{
SSL *ssl;
- Data_Get_Struct(self, SSL, ssl);
- if (!ssl) {
- rb_warning("SSL session is not started yet.");
- return Qnil;
- }
+ ossl_ssl_data_get_struct(self, ssl);
return INT2NUM(SSL_pending(ssl));
}
@@ -1579,17 +1710,15 @@ ossl_ssl_session_reused(VALUE self)
{
SSL *ssl;
- Data_Get_Struct(self, SSL, ssl);
- if (!ssl) {
- rb_warning("SSL session is not started yet.");
- return Qnil;
- }
+ ossl_ssl_data_get_struct(self, ssl);
switch(SSL_session_reused(ssl)) {
case 1: return Qtrue;
case 0: return Qfalse;
default: ossl_raise(eSSLError, "SSL_session_reused");
}
+
+ UNREACHABLE;
}
/*
@@ -1607,11 +1736,7 @@ ossl_ssl_set_session(VALUE self, VALUE arg1)
/* why is ossl_ssl_setup delayed? */
ossl_ssl_setup(self);
- Data_Get_Struct(self, SSL, ssl);
- if (!ssl) {
- rb_warning("SSL session is not started yet.");
- return Qnil;
- }
+ ossl_ssl_data_get_struct(self, ssl);
SafeGetSSLSession(arg1, sess);
@@ -1635,11 +1760,7 @@ ossl_ssl_get_verify_result(VALUE self)
{
SSL *ssl;
- Data_Get_Struct(self, SSL, ssl);
- if (!ssl) {
- rb_warning("SSL session is not started yet.");
- return Qnil;
- }
+ ossl_ssl_data_get_struct(self, ssl);
return INT2FIX(SSL_get_verify_result(ssl));
}
@@ -1661,16 +1782,37 @@ ossl_ssl_get_client_ca_list(VALUE self)
SSL *ssl;
STACK_OF(X509_NAME) *ca;
- Data_Get_Struct(self, SSL, ssl);
- if (!ssl) {
- rb_warning("SSL session is not started yet.");
- return Qnil;
- }
+ ossl_ssl_data_get_struct(self, ssl);
ca = SSL_get_client_CA_list(ssl);
return ossl_x509name_sk2ary(ca);
}
+#ifdef HAVE_OPENSSL_NPN_NEGOTIATED
+/*
+ * call-seq:
+ * ssl.npn_protocol => String
+ *
+ * Returns the protocol string that was finally selected by the client
+ * during the handshake.
+ */
+static VALUE
+ossl_ssl_npn_protocol(VALUE self)
+{
+ SSL *ssl;
+ const unsigned char *out;
+ unsigned int outlen;
+
+ ossl_ssl_data_get_struct(self, ssl);
+
+ SSL_get0_next_proto_negotiated(ssl, &out, &outlen);
+ if (!outlen)
+ return Qnil;
+ else
+ return rb_str_new((const char *) out, outlen);
+}
+#endif
+
void
Init_ossl_ssl()
{
@@ -1691,7 +1833,18 @@ Init_ossl_ssl()
ossl_ssl_ex_tmp_dh_callback_idx =
SSL_get_ex_new_index(0,(void *)"ossl_ssl_ex_tmp_dh_callback_idx",0,0,0);
+ /* Document-module: OpenSSL::SSL
+ *
+ * Use SSLContext to set up the parameters for a TLS (former SSL)
+ * connection. Both client and server TLS connections are supported,
+ * SSLSocket and SSLServer may be used in conjunction with an instance
+ * of SSLContext to set up connections.
+ */
mSSL = rb_define_module_under(mOSSL, "SSL");
+ /* Document-class: OpenSSL::SSL::SSLError
+ *
+ * Generic error class raised by SSLSocket and SSLContext.
+ */
eSSLError = rb_define_class_under(mSSL, "SSLError", eOSSLError);
Init_ossl_ssl_session();
@@ -1850,6 +2003,59 @@ Init_ossl_ssl()
*/
rb_attr(cSSLContext, rb_intern("servername_cb"), 1, 1, Qfalse);
#endif
+ /*
+ * A callback invoked whenever a new handshake is initiated. May be used
+ * to disable renegotiation entirely.
+ *
+ * The callback is invoked with the active SSLSocket. The callback's
+ * return value is irrelevant, normal return indicates "approval" of the
+ * renegotiation and will continue the process. To forbid renegotiation
+ * and to cancel the process, an Error may be raised within the callback.
+ *
+ * === Disable client renegotiation
+ *
+ * When running a server, it is often desirable to disable client
+ * renegotiation entirely. You may use a callback as follows to implement
+ * this feature:
+ *
+ * num_handshakes = 0
+ * ctx.renegotiation_cb = lambda do |ssl|
+ * num_handshakes += 1
+ * raise RuntimeError.new("Client renegotiation disabled") if num_handshakes > 1
+ * end
+ */
+ rb_attr(cSSLContext, rb_intern("renegotiation_cb"), 1, 1, Qfalse);
+#ifdef HAVE_OPENSSL_NPN_NEGOTIATED
+ /*
+ * An Enumerable of Strings. Each String represents a protocol to be
+ * advertised as the list of supported protocols for Next Protocol
+ * Negotiation. Supported in OpenSSL 1.0.1 and higher. Has no effect
+ * on the client side. If not set explicitly, the NPN extension will
+ * not be sent by the server in the handshake.
+ *
+ * === Example
+ *
+ * ctx.npn_protocols = ["http/1.1", "spdy/2"]
+ */
+ rb_attr(cSSLContext, rb_intern("npn_protocols"), 1, 1, Qfalse);
+ /*
+ * A callback invoked on the client side when the client needs to select
+ * a protocol from the list sent by the server. Supported in OpenSSL 1.0.1
+ * and higher. The client MUST select a protocol of those advertised by
+ * the server. If none is acceptable, raising an error in the callback
+ * will cause the handshake to fail. Not setting this callback explicitly
+ * means not supporting the NPN extension on the client - any protocols
+ * advertised by the server will be ignored.
+ *
+ * === Example
+ *
+ * ctx.npn_select_cb = lambda do |protocols|
+ * #inspect the protocols and select one
+ * protocols.first
+ * end
+ */
+ rb_attr(cSSLContext, rb_intern("npn_select_cb"), 1, 1, Qfalse);
+#endif
rb_define_alias(cSSLContext, "ssl_timeout", "timeout");
rb_define_alias(cSSLContext, "ssl_timeout=", "timeout=");
@@ -1860,7 +2066,6 @@ Init_ossl_ssl()
rb_define_method(cSSLContext, "setup", ossl_sslctx_setup, 0);
-
/*
* No session caching for client or server
*/
@@ -1882,7 +2087,7 @@ Init_ossl_ssl()
rb_define_const(cSSLContext, "SESSION_CACHE_BOTH", LONG2FIX(SSL_SESS_CACHE_BOTH)); /* no different than CACHE_SERVER in 0.9.8e */
/*
- * Normally the sesison cache is checked for expired sessions every 255
+ * Normally the session cache is checked for expired sessions every 255
* connections. Since this may lead to a delay that cannot be controlled,
* the automatic flushing may be disabled and #flush_sessions can be
* called explicitly.
@@ -1952,13 +2157,18 @@ Init_ossl_ssl()
rb_define_method(cSSLSocket, "cert", ossl_ssl_get_cert, 0);
rb_define_method(cSSLSocket, "peer_cert", ossl_ssl_get_peer_cert, 0);
rb_define_method(cSSLSocket, "peer_cert_chain", ossl_ssl_get_peer_cert_chain, 0);
+ rb_define_method(cSSLSocket, "ssl_version", ossl_ssl_get_version, 0);
rb_define_method(cSSLSocket, "cipher", ossl_ssl_get_cipher, 0);
rb_define_method(cSSLSocket, "state", ossl_ssl_get_state, 0);
rb_define_method(cSSLSocket, "pending", ossl_ssl_pending, 0);
rb_define_method(cSSLSocket, "session_reused?", ossl_ssl_session_reused, 0);
+ /* implementation of OpenSSL::SSL::SSLSocket#session is in lib/openssl/ssl.rb */
rb_define_method(cSSLSocket, "session=", ossl_ssl_set_session, 1);
rb_define_method(cSSLSocket, "verify_result", ossl_ssl_get_verify_result, 0);
rb_define_method(cSSLSocket, "client_ca", ossl_ssl_get_client_ca_list, 0);
+#ifdef HAVE_OPENSSL_NPN_NEGOTIATED
+ rb_define_method(cSSLSocket, "npn_protocol", ossl_ssl_npn_protocol, 0);
+#endif
#define ossl_ssl_def_const(x) rb_define_const(mSSL, #x, INT2NUM(SSL_##x))
@@ -1966,18 +2176,20 @@ Init_ossl_ssl()
ossl_ssl_def_const(VERIFY_PEER);
ossl_ssl_def_const(VERIFY_FAIL_IF_NO_PEER_CERT);
ossl_ssl_def_const(VERIFY_CLIENT_ONCE);
- /* Not introduce constants included in OP_ALL such as...
- * ossl_ssl_def_const(OP_MICROSOFT_SESS_ID_BUG);
- * ossl_ssl_def_const(OP_NETSCAPE_CHALLENGE_BUG);
- * ossl_ssl_def_const(OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG);
- * ossl_ssl_def_const(OP_SSLREF2_REUSE_CERT_TYPE_BUG);
- * ossl_ssl_def_const(OP_MICROSOFT_BIG_SSLV3_BUFFER);
- * ossl_ssl_def_const(OP_MSIE_SSLV2_RSA_PADDING);
- * ossl_ssl_def_const(OP_SSLEAY_080_CLIENT_DH_BUG);
- * ossl_ssl_def_const(OP_TLS_D5_BUG);
- * ossl_ssl_def_const(OP_TLS_BLOCK_PADDING_BUG);
- * ossl_ssl_def_const(OP_DONT_INSERT_EMPTY_FRAGMENTS);
+ /* Introduce constants included in OP_ALL. These constants are mostly for
+ * unset some bits in OP_ALL such as;
+ * ctx.options = OP_ALL & ~OP_DONT_INSERT_EMPTY_FRAGMENTS
*/
+ ossl_ssl_def_const(OP_MICROSOFT_SESS_ID_BUG);
+ ossl_ssl_def_const(OP_NETSCAPE_CHALLENGE_BUG);
+ ossl_ssl_def_const(OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG);
+ ossl_ssl_def_const(OP_SSLREF2_REUSE_CERT_TYPE_BUG);
+ ossl_ssl_def_const(OP_MICROSOFT_BIG_SSLV3_BUFFER);
+ ossl_ssl_def_const(OP_MSIE_SSLV2_RSA_PADDING);
+ ossl_ssl_def_const(OP_SSLEAY_080_CLIENT_DH_BUG);
+ ossl_ssl_def_const(OP_TLS_D5_BUG);
+ ossl_ssl_def_const(OP_TLS_BLOCK_PADDING_BUG);
+ ossl_ssl_def_const(OP_DONT_INSERT_EMPTY_FRAGMENTS);
ossl_ssl_def_const(OP_ALL);
#if defined(SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION)
ossl_ssl_def_const(OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION);
@@ -1994,9 +2206,18 @@ Init_ossl_ssl()
ossl_ssl_def_const(OP_NO_SSLv2);
ossl_ssl_def_const(OP_NO_SSLv3);
ossl_ssl_def_const(OP_NO_TLSv1);
+#if defined(SSL_OP_NO_TLSv1_1)
+ ossl_ssl_def_const(OP_NO_TLSv1_1);
+#endif
+#if defined(SSL_OP_NO_TLSv1_2)
+ ossl_ssl_def_const(OP_NO_TLSv1_2);
+#endif
#if defined(SSL_OP_NO_TICKET)
ossl_ssl_def_const(OP_NO_TICKET);
#endif
+#if defined(SSL_OP_NO_COMPRESSION)
+ ossl_ssl_def_const(OP_NO_COMPRESSION);
+#endif
ossl_ssl_def_const(OP_PKCS1_CHECK_1);
ossl_ssl_def_const(OP_PKCS1_CHECK_2);
ossl_ssl_def_const(OP_NETSCAPE_CA_DN_BUG);
diff --git a/ext/openssl/ossl_x509cert.c b/ext/openssl/ossl_x509cert.c
index 3fb19b465f..84cedc763a 100644
--- a/ext/openssl/ossl_x509cert.c
+++ b/ext/openssl/ossl_x509cert.c
@@ -66,6 +66,7 @@ ossl_x509_new_from_file(VALUE filename)
if (!(fp = fopen(RSTRING_PTR(filename), "r"))) {
ossl_raise(eX509CertError, "%s", strerror(errno));
}
+ rb_fd_fix_cloexec(fileno(fp));
x509 = PEM_read_X509(fp, NULL, NULL, NULL);
/*
* prepare for DER...
@@ -489,7 +490,7 @@ ossl_x509_get_not_after(VALUE self)
/*
* call-seq:
- * cert.not_before = time => time
+ * cert.not_after = time => time
*/
static VALUE
ossl_x509_set_not_after(VALUE self, VALUE time)
@@ -729,8 +730,106 @@ ossl_x509_inspect(VALUE self)
void
Init_ossl_x509cert()
{
+
+#if 0
+ mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL */
+ mX509 = rb_define_module_under(mOSSL, "X509");
+#endif
+
eX509CertError = rb_define_class_under(mX509, "CertificateError", eOSSLError);
+ /* Document-class: OpenSSL::X509::Certificate
+ *
+ * Implementation of an X.509 certificate as specified in RFC 5280.
+ * Provides access to a certificate's attributes and allows certificates
+ * to be read from a string, but also supports the creation of new
+ * certificates from scratch.
+ *
+ * === Reading a certificate from a file
+ *
+ * Certificate is capable of handling DER-encoded certificates and
+ * certificates encoded in OpenSSL's PEM format.
+ *
+ * raw = File.read "cert.cer" # DER- or PEM-encoded
+ * certificate = OpenSSL::X509::Certificate.new raw
+ *
+ * === Saving a certificate to a file
+ *
+ * A certificate may be encoded in DER format
+ *
+ * cert = ...
+ * File.open("cert.cer", "wb") { |f| f.print cert.to_der }
+ *
+ * or in PEM format
+ *
+ * cert = ...
+ * File.open("cert.pem", "wb") { |f| f.print cert.to_pem }
+ *
+ * X.509 certificates are associated with a private/public key pair,
+ * typically a RSA, DSA or ECC key (see also OpenSSL::PKey::RSA,
+ * OpenSSL::PKey::DSA and OpenSSL::PKey::EC), the public key itself is
+ * stored within the certificate and can be accessed in form of an
+ * OpenSSL::PKey. Certificates are typically used to be able to associate
+ * some form of identity with a key pair, for example web servers serving
+ * pages over HTTPs use certificates to authenticate themselves to the user.
+ *
+ * The public key infrastructure (PKI) model relies on trusted certificate
+ * authorities ("root CAs") that issue these certificates, so that end
+ * users need to base their trust just on a selected few authorities
+ * that themselves again vouch for subordinate CAs issuing their
+ * certificates to end users.
+ *
+ * The OpenSSL::X509 module provides the tools to set up an independent
+ * PKI, similar to scenarios where the 'openssl' command line tool is
+ * used for issuing certificates in a private PKI.
+ *
+ * === Creating a root CA certificate and an end-entity certificate
+ *
+ * First, we need to create a "self-signed" root certificate. To do so,
+ * we need to generate a key first. Please note that the choice of "1"
+ * as a serial number is considered a security flaw for real certificates.
+ * Secure choices are integers in the two-digit byte range and ideally
+ * not sequential but secure random numbers, steps omitted here to keep
+ * the example concise.
+ *
+ * root_key = OpenSSL::PKey::RSA.new 2048 # the CA's public/private key
+ * root_ca = OpenSSL::X509::Certificate.new
+ * root_ca.version = 2 # cf. RFC 5280 - to make it a "v3" certificate
+ * root_ca.serial = 1
+ * root_ca.subject = OpenSSL::X509::Name.parse "/DC=org/DC=ruby-lang/CN=Ruby CA"
+ * root_ca.issuer = root_ca.subject # root CA's are "self-signed"
+ * root_ca.public_key = root_key.public_key
+ * root_ca.not_before = Time.now
+ * root_ca.not_after = root_ca.not_before + 2 * 365 * 24 * 60 * 60 # 2 years validity
+ * ef = OpenSSL::X509::ExtensionFactory.new
+ * ef.subject_certificate = root_ca
+ * ef.issuer_certificate = root_ca
+ * root_ca.add_extension(ef.create_extension("basicConstraints","CA:TRUE",true))
+ * root_ca.add_extension(ef.create_extension("keyUsage","keyCertSign, cRLSign", true))
+ * root_ca.add_extension(ef.create_extension("subjectKeyIdentifier","hash",false))
+ * root_ca.add_extension(ef.create_extension("authorityKeyIdentifier","keyid:always",false))
+ * root_ca.sign(root_key, OpenSSL::Digest::SHA256.new)
+ *
+ * The next step is to create the end-entity certificate using the root CA
+ * certificate.
+ *
+ * key = OpenSSL::PKey::RSA.new 2048
+ * cert = OpenSSL::X509::Certificate.new
+ * cert.version = 2
+ * cert.serial = 2
+ * cert.subject = OpenSSL::X509::Name.parse "/DC=org/DC=ruby-lang/CN=Ruby certificate"
+ * cert.issuer = root_ca.subject # root CA is the issuer
+ * cert.public_key = key.public_key
+ * cert.not_before = Time.now
+ * cert.not_after = cert.not_before + 1 * 365 * 24 * 60 * 60 # 1 years validity
+ * ef = OpenSSL::X509::ExtensionFactory.new
+ * ef.subject_certificate = cert
+ * ef.issuer_certificate = root_ca
+ * cert.add_extension(ef.create_extension("keyUsage","digitalSignature", true))
+ * cert.add_extension(ef.create_extension("subjectKeyIdentifier","hash",false))
+ * cert.sign(root_key, OpenSSL::Digest::SHA256.new)
+ *
+ */
cX509Cert = rb_define_class_under(mX509, "Certificate", rb_cObject);
rb_define_alloc_func(cX509Cert, ossl_x509_alloc);
diff --git a/ext/openssl/ossl_x509name.c b/ext/openssl/ossl_x509name.c
index 13e18eecf1..a8f288f4a5 100644
--- a/ext/openssl/ossl_x509name.c
+++ b/ext/openssl/ossl_x509name.c
@@ -227,10 +227,10 @@ ossl_x509name_to_a(VALUE self)
{
X509_NAME *name;
X509_NAME_ENTRY *entry;
- int i,entries;
+ int i,entries,nid;
char long_name[512];
const char *short_name;
- VALUE ary, ret;
+ VALUE ary, vname, ret;
GetX509Name(self, name);
entries = X509_NAME_entry_count(name);
@@ -246,8 +246,15 @@ ossl_x509name_to_a(VALUE self)
if (!i2t_ASN1_OBJECT(long_name, sizeof(long_name), entry->object)) {
ossl_raise(eX509NameError, NULL);
}
- short_name = OBJ_nid2sn(OBJ_ln2nid(long_name));
- ary = rb_ary_new3(3, rb_str_new2(short_name),
+ nid = OBJ_ln2nid(long_name);
+ if (nid == NID_undef) {
+ vname = rb_str_new2((const char *) &long_name);
+ } else {
+ short_name = OBJ_nid2sn(nid);
+ vname = rb_str_new2(short_name); /*do not free*/
+ }
+ ary = rb_ary_new3(3,
+ vname,
rb_str_new((const char *)entry->value->data, entry->value->length),
INT2FIX(entry->value->type));
rb_ary_push(ret, ary);
diff --git a/ext/openssl/ossl_x509store.c b/ext/openssl/ossl_x509store.c
index 5d341c5192..5e3094ee9f 100644
--- a/ext/openssl/ossl_x509store.c
+++ b/ext/openssl/ossl_x509store.c
@@ -204,6 +204,15 @@ ossl_x509store_set_time(VALUE self, VALUE time)
return time;
}
+/*
+ * call-seq:
+ * store.add_file(file) -> store
+ *
+ *
+ * Adds the certificates in +file+ to the certificate store. The +file+ can
+ * contain multiple PEM-encoded certificates.
+ */
+
static VALUE
ossl_x509store_add_file(VALUE self, VALUE file)
{
@@ -246,6 +255,16 @@ ossl_x509store_add_path(VALUE self, VALUE dir)
return self;
}
+/*
+ * call-seq:
+ * store.set_default_path
+ *
+ * Adds the default certificates to the certificate store. These certificates
+ * are loaded from the default configuration directory which can usually be
+ * determined by:
+ *
+ * File.dirname OpenSSL::Config::DEFAULT_CONFIG_FILE
+ */
static VALUE
ossl_x509store_set_default_paths(VALUE self)
{
@@ -259,6 +278,13 @@ ossl_x509store_set_default_paths(VALUE self)
return Qnil;
}
+/*
+ * call-seq:
+ * store.add_cert(cert)
+ *
+ * Adds the OpenSSL::X509::Certificate +cert+ to the certificate store.
+ */
+
static VALUE
ossl_x509store_add_cert(VALUE self, VALUE arg)
{
@@ -571,8 +597,47 @@ Init_ossl_x509store()
{
VALUE x509stctx;
+#if 0
+ mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL */
+ mX509 = rb_define_module_under(mOSSL, "X509");
+#endif
+
eX509StoreError = rb_define_class_under(mX509, "StoreError", eOSSLError);
+ /* Document-class: OpenSSL::X509::Store
+ *
+ * The X509 certificate store holds trusted CA certificates used to verify
+ * peer certificates.
+ *
+ * The easiest way to create a useful certificate store is:
+ *
+ * cert_store = OpenSSL::X509::Store.new
+ * cert_store.set_default_paths
+ *
+ * This will use your system's built-in certificates.
+ *
+ * If your system does not have a default set of certificates you can
+ * obtain a set from Mozilla here: http://curl.haxx.se/docs/caextract.html
+ * (Note that this set does not have an HTTPS download option so you may
+ * wish to use the firefox-db2pem.sh script to extract the certificates
+ * from a local install to avoid man-in-the-middle attacks.)
+ *
+ * After downloading or generating a cacert.pem from the above link you
+ * can create a certificate store from the pem file like this:
+ *
+ * cert_store = OpenSSL::X509::Store.new
+ * cert_store.add_file 'cacert.pem'
+ *
+ * The certificate store can be used with an SSLSocket like this:
+ *
+ * ssl_context = OpenSSL::SSL::SSLContext.new
+ * ssl_context.cert_store = cert_store
+ *
+ * tcp_socket = TCPSocket.open 'example.com', 443
+ *
+ * ssl_socket = OpenSSL::SSL::SSLSocket.new tcp_socket, ssl_context
+ */
+
cX509Store = rb_define_class_under(mX509, "Store", rb_cObject);
rb_attr(cX509Store, rb_intern("verify_callback"), 1, 0, Qfalse);
rb_attr(cX509Store, rb_intern("error"), 1, 0, Qfalse);
diff --git a/ext/openssl/ruby_missing.h b/ext/openssl/ruby_missing.h
index 1c5d05baca..0f9de1c842 100644
--- a/ext/openssl/ruby_missing.h
+++ b/ext/openssl/ruby_missing.h
@@ -25,17 +25,4 @@
#define rb_io_t OpenFile
#endif
-#ifndef HAVE_RB_STR_SET_LEN
-/* these methods should probably be backported to 1.8 */
-#define rb_str_set_len(str, length) do { \
- RSTRING(str)->ptr[(length)] = 0; \
- RSTRING(str)->len = (length); \
-} while(0)
-#endif /* ! HAVE_RB_STR_SET_LEN */
-
-#ifndef HAVE_RB_BLOCK_CALL
-/* the openssl module doesn't use arg[3-4] and arg2 is always rb_each */
-#define rb_block_call(arg1, arg2, arg3, arg4, arg5, arg6) rb_iterate(rb_each, (arg1), (arg5), (arg6))
-#endif /* ! HAVE_RB_BLOCK_CALL */
-
#endif /* _OSSL_RUBY_MISSING_H_ */
diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb
index 224c869f67..fba1074320 100644
--- a/ext/pathname/lib/pathname.rb
+++ b/ext/pathname/lib/pathname.rb
@@ -8,8 +8,6 @@
#
# For documentation, see class Pathname.
#
-# <tt>pathname.rb</tt> is distributed with Ruby since 1.8.0.
-#
require 'pathname.so'
@@ -29,7 +27,6 @@ class Pathname
proc {|a, b| a == b}
end
- # :startdoc:
if File::ALT_SEPARATOR
SEPARATOR_LIST = "#{Regexp.quote File::ALT_SEPARATOR}#{Regexp.quote File::SEPARATOR}"
@@ -39,6 +36,8 @@ class Pathname
SEPARATOR_PAT = /#{Regexp.quote File::SEPARATOR}/
end
+ # :startdoc:
+
# chop_basename(path) -> [pre-basename, basename] or nil
def chop_basename(path)
base = File.basename(path)
@@ -78,9 +77,11 @@ class Pathname
# removed. The filesystem is not accessed.
#
# If +consider_symlink+ is +true+, then a more conservative algorithm is used
- # to avoid breaking symbolic linkages. This may retain more <tt>..</tt>
+ # to avoid breaking symbolic linkages. This may retain more +..+
# entries than absolutely necessary, but without accessing the filesystem,
- # this can't be avoided. See #realpath.
+ # this can't be avoided.
+ #
+ # See Pathname#realpath.
#
def cleanpath(consider_symlink=false)
if consider_symlink
@@ -91,7 +92,7 @@ class Pathname
end
#
- # Clean the path simply by resolving and removing excess "." and ".." entries.
+ # Clean the path simply by resolving and removing excess +.+ and +..+ entries.
# Nothing more, nothing less.
#
def cleanpath_aggressive
@@ -179,14 +180,14 @@ class Pathname
end
private :cleanpath_conservative
- # #parent returns the parent directory.
+ # Returns the parent directory.
#
- # This is same as <tt>self + '..'</tt>.
+ # This is same as <code>self + '..'</code>.
def parent
self + '..'
end
- # #mountpoint? returns +true+ if <tt>self</tt> points to a mountpoint.
+ # Returns +true+ if +self+ points to a mountpoint.
def mountpoint?
begin
stat1 = self.lstat
@@ -199,10 +200,10 @@ class Pathname
end
#
- # #root? is a predicate for root directories. I.e. it returns +true+ if the
+ # Predicate method for root directories. Returns +true+ if the
# pathname consists of consecutive slashes.
#
- # It doesn't access actual filesystem. So it may return +false+ for some
+ # It doesn't access the filesystem. So it may return +false+ for some
# pathnames which points to roots such as <tt>/usr/..</tt>.
#
def root?
@@ -210,12 +211,31 @@ class Pathname
end
# Predicate method for testing whether a path is absolute.
+ #
# It returns +true+ if the pathname begins with a slash.
+ #
+ # p = Pathname.new('/im/sure')
+ # p.absolute?
+ # #=> true
+ #
+ # p = Pathname.new('not/so/sure')
+ # p.absolute?
+ # #=> false
def absolute?
!relative?
end
- # The opposite of #absolute?
+ # The opposite of Pathname#absolute?
+ #
+ # It returns +false+ if the pathname begins with a slash.
+ #
+ # p = Pathname.new('/im/sure')
+ # p.relative?
+ # #=> false
+ #
+ # p = Pathname.new('not/so/sure')
+ # p.relative?
+ # #=> true
def relative?
path = @path
while r = chop_basename(path)
@@ -230,6 +250,13 @@ class Pathname
# Pathname.new("/usr/bin/ruby").each_filename {|filename| ... }
# # yields "usr", "bin", and "ruby".
#
+ # Returns an Enumerator if no block was given.
+ #
+ # enum = Pathname.new("/usr/bin/ruby").each_filename
+ # # ... do stuff ...
+ # enum.each { |e| ... }
+ # # yields "usr", "bin", and "ruby".
+ #
def each_filename # :yield: filename
return to_enum(__method__) unless block_given?
_, names = split_names(@path)
@@ -253,9 +280,7 @@ class Pathname
# #<Pathname:path/to/some>
# #<Pathname:path/to/some/file.rb>
#
- # It doesn't access actual filesystem.
- #
- # This method is available since 1.8.5.
+ # It doesn't access the filesystem.
#
def descend
vs = []
@@ -280,9 +305,7 @@ class Pathname
# #<Pathname:path/to>
# #<Pathname:path>
#
- # It doesn't access actual filesystem.
- #
- # This method is available since 1.8.5.
+ # It doesn't access the filesystem.
#
def ascend
path = @path
@@ -295,8 +318,7 @@ class Pathname
end
#
- # Pathname#+ appends a pathname fragment to this one to produce a new Pathname
- # object.
+ # Appends a pathname fragment to +self+ to produce a new Pathname object.
#
# p1 = Pathname.new("/usr") # Pathname:/usr
# p2 = p1 + "bin/ruby" # Pathname:/usr/bin/ruby
@@ -352,10 +374,14 @@ class Pathname
private :plus
#
- # Pathname#join joins pathnames.
+ # Joins the given pathnames onto +self+ to create a new Pathname object.
#
- # <tt>path0.join(path1, ..., pathN)</tt> is the same as
- # <tt>path0 + path1 + ... + pathN</tt>.
+ # path0 = Pathname.new("/usr") # Pathname:/usr
+ # path0 = path0.join("bin/ruby") # Pathname:/usr/bin/ruby
+ # # is the same as
+ # path1 = Pathname.new("/usr") + "bin/ruby" # Pathname:/usr/bin/ruby
+ # path0 == path1
+ # #=> true
#
def join(*args)
args.unshift self
@@ -372,10 +398,11 @@ class Pathname
#
# Returns the children of the directory (files and subdirectories, not
- # recursive) as an array of Pathname objects. By default, the returned
- # pathnames will have enough information to access the files. If you set
- # +with_directory+ to +false+, then the returned pathnames will contain the
- # filename only.
+ # recursive) as an array of Pathname objects.
+ #
+ # By default, the returned pathnames will have enough information to access
+ # the files. If you set +with_directory+ to +false+, then the returned
+ # pathnames will contain the filename only.
#
# For example:
# pn = Pathname("/usr/lib/ruby/1.8")
@@ -386,11 +413,9 @@ class Pathname
# pn.children(false)
# # -> [ Pathname:English.rb, Pathname:Env.rb, Pathname:abbrev.rb, ... ]
#
- # Note that the result never contain the entries <tt>.</tt> and <tt>..</tt> in
+ # Note that the results never contain the entries +.+ and +..+ in
# the directory because they are not children.
#
- # This method has existed since 1.8.1.
- #
def children(with_directory=true)
with_directory = false if @path == '.'
result = []
@@ -407,9 +432,14 @@ class Pathname
# Iterates over the children of the directory
# (files and subdirectories, not recursive).
+ #
# It yields Pathname object for each child.
- # By default, the yielded pathnames will have enough information to access the files.
- # If you set +with_directory+ to +false+, then the returned pathnames will contain the filename only.
+ #
+ # By default, the yielded pathnames will have enough information to access
+ # the files.
+ #
+ # If you set +with_directory+ to +false+, then the returned pathnames will
+ # contain the filename only.
#
# Pathname("/usr/local").each_child {|f| p f }
# #=> #<Pathname:/usr/local/share>
@@ -431,20 +461,25 @@ class Pathname
# # #<Pathname:src>
# # #<Pathname:man>
#
+ # Note that the results never contain the entries +.+ and +..+ in
+ # the directory because they are not children.
+ #
+ # See Pathname#children
+ #
def each_child(with_directory=true, &b)
children(with_directory).each(&b)
end
#
- # #relative_path_from returns a relative path from the argument to the
- # receiver. If +self+ is absolute, the argument must be absolute too. If
- # +self+ is relative, the argument must be relative too.
+ # Returns a relative path from the given +base_directory+ to the receiver.
#
- # #relative_path_from doesn't access the filesystem. It assumes no symlinks.
+ # If +self+ is absolute, then +base_directory+ must be absolute too.
#
- # ArgumentError is raised when it cannot find a relative path.
+ # If +self+ is relative, then +base_directory+ must be relative too.
+ #
+ # This method doesn't access the filesystem. It assumes no symlinks.
#
- # This method has existed since 1.8.1.
+ # ArgumentError is raised when it cannot find a relative path.
#
def relative_path_from(base_directory)
dest_directory = self.cleanpath.to_s
@@ -486,16 +521,21 @@ end
class Pathname # * Find *
#
- # Pathname#find is an iterator to traverse a directory tree in a depth first
- # manner. It yields a Pathname for each file under "this" directory.
+ # Iterates over the directory tree in a depth first manner, yielding a
+ # Pathname for each file under "this" directory.
+ #
+ # Returns an Enumerator if no block is given.
#
- # Since it is implemented by <tt>find.rb</tt>, <tt>Find.prune</tt> can be used
- # to control the traverse.
+ # Since it is implemented by the standard library module Find, Find.prune can
+ # be used to control the traversal.
#
- # If +self+ is <tt>.</tt>, yielded pathnames begin with a filename in the
- # current directory, not <tt>./</tt>.
+ # If +self+ is +.+, yielded pathnames begin with a filename in the
+ # current directory, not +./+.
#
- def find(&block) # :yield: pathname
+ # See Find.find
+ #
+ def find # :yield: pathname
+ return to_enum(__method__) unless block_given?
require 'find'
if @path == '.'
Find.find(@path) {|f| yield self.class.new(f.sub(%r{\A\./}, '')) }
@@ -507,15 +547,19 @@ end
class Pathname # * FileUtils *
- # See <tt>FileUtils.mkpath</tt>. Creates a full path, including any
- # intermediate directories that don't yet exist.
+ # Creates a full path, including any intermediate directories that don't yet
+ # exist.
+ #
+ # See FileUtils.mkpath and FileUtils.mkdir_p
def mkpath
require 'fileutils'
FileUtils.mkpath(@path)
nil
end
- # See <tt>FileUtils.rm_r</tt>. Deletes a directory and all beneath it.
+ # Recursively deletes a directory, including all directories beneath it.
+ #
+ # See FileUtils.rm_r
def rmtree
# The name "rmtree" is borrowed from File::Path of Perl.
# File::Path provides "mkpath" and "rmtree".
diff --git a/ext/pathname/pathname.c b/ext/pathname/pathname.c
index e1632c524b..2bb6ce2f3c 100644
--- a/ext/pathname/pathname.c
+++ b/ext/pathname/pathname.c
@@ -1,4 +1,5 @@
#include "ruby.h"
+#include "ruby/encoding.h"
static VALUE rb_cPathname;
static ID id_at_path, id_to_path;
@@ -8,7 +9,7 @@ get_strpath(VALUE obj)
{
VALUE strpath;
strpath = rb_ivar_get(obj, id_at_path);
- if (TYPE(strpath) != T_STRING)
+ if (!RB_TYPE_P(strpath, T_STRING))
rb_raise(rb_eTypeError, "unexpected @path");
return strpath;
}
@@ -21,13 +22,13 @@ set_strpath(VALUE obj, VALUE val)
/*
* Create a Pathname object from the given String (or String-like object).
- * If +path+ contains a NUL character (<tt>\0</tt>), an ArgumentError is raised.
+ * If +path+ contains a NULL character (<tt>\0</tt>), an ArgumentError is raised.
*/
static VALUE
path_initialize(VALUE self, VALUE arg)
{
VALUE str;
- if (TYPE(arg) == T_STRING) {
+ if (RB_TYPE_P(arg, T_STRING)) {
str = arg;
}
else {
@@ -45,6 +46,14 @@ path_initialize(VALUE self, VALUE arg)
return self;
}
+/*
+ * call-seq:
+ * pathname.freeze -> obj
+ *
+ * Freezes this Pathname.
+ *
+ * See Object.freeze.
+ */
static VALUE
path_freeze(VALUE self)
{
@@ -53,6 +62,14 @@ path_freeze(VALUE self)
return self;
}
+/*
+ * call-seq:
+ * pathname.taint -> obj
+ *
+ * Taints this Pathname.
+ *
+ * See Object.taint.
+ */
static VALUE
path_taint(VALUE self)
{
@@ -61,6 +78,14 @@ path_taint(VALUE self)
return self;
}
+/*
+ * call-seq:
+ * pathname.untaint -> obj
+ *
+ * Untaints this Pathname.
+ *
+ * See Object.untaint.
+ */
static VALUE
path_untaint(VALUE self)
{
@@ -83,7 +108,18 @@ path_eq(VALUE self, VALUE other)
}
/*
- * Provides for comparing pathnames, case-sensitively.
+ * Provides a case-sensitive comparison operator for pathnames.
+ *
+ * Pathname.new('/usr') <=> Pathname.new('/usr/bin')
+ * #=> -1
+ * Pathname.new('/usr/bin') <=> Pathname.new('/usr/bin')
+ * #=> 0
+ * Pathname.new('/usr/bin') <=> Pathname.new('/USR/BIN')
+ * #=> 1
+ *
+ * It will return +-1+, +0+ or +1+ depending on the value of the left argument
+ * relative to the right argument. Or it will return +nil+ if the arguments
+ * are not comparable.
*/
static VALUE
path_cmp(VALUE self, VALUE other)
@@ -152,6 +188,10 @@ path_inspect(VALUE self)
/*
* Return a pathname which is substituted by String#sub.
+ *
+ * path1 = Pathname.new('/usr/bin/perl')
+ * path1.sub('perl', 'ruby')
+ * #=> #<Pathname:/usr/bin/ruby>
*/
static VALUE
path_sub(int argc, VALUE *argv, VALUE self)
@@ -168,10 +208,12 @@ path_sub(int argc, VALUE *argv, VALUE self)
}
/*
- * Return a pathname which the extension of the basename is substituted by
- * <i>repl</i>.
+ * Return a pathname with +repl+ added as a suffix to the basename.
*
- * If self has no extension part, <i>repl</i> is appended.
+ * If self has no extension part, +repl+ is appended.
+ *
+ * Pathname.new('/usr/bin/shutdown').sub_ext('.rb')
+ * #=> #<Pathname:/usr/bin/shutdown.rb>
*/
static VALUE
path_sub_ext(VALUE self, VALUE repl)
@@ -184,15 +226,15 @@ path_sub_ext(VALUE self, VALUE repl)
StringValue(repl);
p = RSTRING_PTR(str);
- ext = ruby_find_extname(p, &extlen);
+ extlen = RSTRING_LEN(str);
+ ext = ruby_enc_find_extname(p, &extlen, rb_enc_get(str));
if (ext == NULL) {
ext = p + RSTRING_LEN(str);
}
else if (extlen <= 1) {
ext += extlen;
}
- str2 = rb_str_dup(str);
- rb_str_resize(str2, ext-p);
+ str2 = rb_str_subseq(str, 0, ext-p);
rb_str_append(str2, repl);
OBJ_INFECT(str2, str);
return rb_class_new_instance(1, &str2, rb_obj_class(self));
@@ -201,8 +243,10 @@ path_sub_ext(VALUE self, VALUE repl)
/* Facade for File */
/*
- * Returns the real (absolute) pathname of +self+ in the actual
- * filesystem not containing symlinks or useless dots.
+ * Returns the real (absolute) pathname for +self+ in the actual
+ * filesystem.
+ *
+ * Does not contain symlinks or useless dots, +..+ and +.+.
*
* All components of the pathname must exist when this method is
* called.
@@ -219,7 +263,8 @@ path_realpath(int argc, VALUE *argv, VALUE self)
/*
* Returns the real (absolute) pathname of +self+ in the actual filesystem.
- * The real pathname doesn't contain symlinks or useless dots.
+ *
+ * Does not contain symlinks or useless dots, +..+ and +.+.
*
* The last component of the real pathname can be nonexistent.
*/
@@ -240,10 +285,7 @@ path_realdirpath(int argc, VALUE *argv, VALUE self)
* pathname.each_line(sep, limit [, open_args]) {|line| block } -> nil
* pathname.each_line(...) -> an_enumerator
*
- * #each_line iterates over the line in the file. It yields a String object
- * for each line.
- *
- * This method is availabel since 1.8.1.
+ * Iterates over each line in the file and yields a String object for each.
*/
static VALUE
path_each_line(int argc, VALUE *argv, VALUE self)
@@ -266,8 +308,9 @@ path_each_line(int argc, VALUE *argv, VALUE self)
* pathname.read([length [, offset]]) -> string
* pathname.read([length [, offset]], open_args) -> string
*
- * See <tt>IO.read</tt>. Returns all data from the file, or the first +N+ bytes
- * if specified.
+ * Returns all data from the file, or the first +N+ bytes if specified.
+ *
+ * See IO.read.
*
*/
static VALUE
@@ -285,8 +328,9 @@ path_read(int argc, VALUE *argv, VALUE self)
* call-seq:
* pathname.binread([length [, offset]]) -> string
*
- * See <tt>IO.binread</tt>. Returns all the bytes from the file, or the first +N+
- * if specified.
+ * Returns all the bytes from the file, or the first +N+ if specified.
+ *
+ * See IO.binread.
*
*/
static VALUE
@@ -306,7 +350,9 @@ path_binread(int argc, VALUE *argv, VALUE self)
* pathname.readlines(limit [, open_args]) -> array
* pathname.readlines(sep, limit [, open_args]) -> array
*
- * See <tt>IO.readlines</tt>. Returns all the lines from the file.
+ * Returns all the lines from the file.
+ *
+ * See IO.readlines.
*
*/
static VALUE
@@ -324,7 +370,7 @@ path_readlines(int argc, VALUE *argv, VALUE self)
* call-seq:
* pathname.sysopen([mode, [perm]]) -> fixnum
*
- * See <tt>IO.sysopen</tt>.
+ * See IO.sysopen.
*
*/
static VALUE
@@ -339,7 +385,12 @@ path_sysopen(int argc, VALUE *argv, VALUE self)
}
/*
- * See <tt>File.atime</tt>. Returns last access time.
+ * call-seq:
+ * pathname.atime -> time
+ *
+ * Returns the last access time for the file.
+ *
+ * See File.atime.
*/
static VALUE
path_atime(VALUE self)
@@ -348,7 +399,12 @@ path_atime(VALUE self)
}
/*
- * See <tt>File.ctime</tt>. Returns last (directory entry, not file) change time.
+ * call-seq:
+ * pathname.ctime -> time
+ *
+ * Returns the last change time, using directory information, not the file itself.
+ *
+ * See File.ctime.
*/
static VALUE
path_ctime(VALUE self)
@@ -357,7 +413,12 @@ path_ctime(VALUE self)
}
/*
- * See <tt>File.mtime</tt>. Returns last modification time.
+ * call-seq:
+ * pathname.mtime -> time
+ *
+ * Returns the last modified time of the file.
+ *
+ * See File.mtime.
*/
static VALUE
path_mtime(VALUE self)
@@ -366,7 +427,12 @@ path_mtime(VALUE self)
}
/*
- * See <tt>File.chmod</tt>. Changes permissions.
+ * call-seq:
+ * pathname.chmod -> integer
+ *
+ * Changes file permissions.
+ *
+ * See File.chmod.
*/
static VALUE
path_chmod(VALUE self, VALUE mode)
@@ -375,7 +441,12 @@ path_chmod(VALUE self, VALUE mode)
}
/*
- * See <tt>File.lchmod</tt>.
+ * call-seq:
+ * pathname.lchmod -> integer
+ *
+ * Same as Pathname.chmod, but does not follow symbolic links.
+ *
+ * See File.lchmod.
*/
static VALUE
path_lchmod(VALUE self, VALUE mode)
@@ -384,7 +455,12 @@ path_lchmod(VALUE self, VALUE mode)
}
/*
- * See <tt>File.chown</tt>. Change owner and group of file.
+ * call-seq:
+ * pathname.chown -> integer
+ *
+ * Change owner and group of the file.
+ *
+ * See File.chown.
*/
static VALUE
path_chown(VALUE self, VALUE owner, VALUE group)
@@ -393,7 +469,12 @@ path_chown(VALUE self, VALUE owner, VALUE group)
}
/*
- * See <tt>File.lchown</tt>.
+ * call-seq:
+ * pathname.lchown -> integer
+ *
+ * Same as Pathname.chown, but does not follow symbolic links.
+ *
+ * See File.lchown.
*/
static VALUE
path_lchown(VALUE self, VALUE owner, VALUE group)
@@ -406,8 +487,9 @@ path_lchown(VALUE self, VALUE owner, VALUE group)
* pathname.fnmatch(pattern, [flags]) -> string
* pathname.fnmatch?(pattern, [flags]) -> string
*
- * See <tt>File.fnmatch</tt>. Return +true+ if the receiver matches the given
- * pattern.
+ * Return +true+ if the receiver matches the given pattern.
+ *
+ * See File.fnmatch.
*/
static VALUE
path_fnmatch(int argc, VALUE *argv, VALUE self)
@@ -421,8 +503,12 @@ path_fnmatch(int argc, VALUE *argv, VALUE self)
}
/*
- * See <tt>File.ftype</tt>. Returns "type" of file ("file", "directory",
- * etc).
+ * call-seq:
+ * pathname.ftype -> string
+ *
+ * Returns "type" of file ("file", "directory", etc).
+ *
+ * See File.ftype.
*/
static VALUE
path_ftype(VALUE self)
@@ -434,7 +520,9 @@ path_ftype(VALUE self)
* call-seq:
* pathname.make_link(old)
*
- * See <tt>File.link</tt>. Creates a hard link at _pathname_.
+ * Creates a hard link at _pathname_.
+ *
+ * See File.link.
*/
static VALUE
path_make_link(VALUE self, VALUE old)
@@ -443,7 +531,9 @@ path_make_link(VALUE self, VALUE old)
}
/*
- * See <tt>File.open</tt>. Opens the file for reading or writing.
+ * Opens the file for reading or writing.
+ *
+ * See File.open.
*/
static VALUE
path_open(int argc, VALUE *argv, VALUE self)
@@ -462,7 +552,9 @@ path_open(int argc, VALUE *argv, VALUE self)
}
/*
- * See <tt>File.readlink</tt>. Read symbolic link.
+ * Read symbolic link.
+ *
+ * See File.readlink.
*/
static VALUE
path_readlink(VALUE self)
@@ -473,7 +565,9 @@ path_readlink(VALUE self)
}
/*
- * See <tt>File.rename</tt>. Rename the file.
+ * Rename the file.
+ *
+ * See File.rename.
*/
static VALUE
path_rename(VALUE self, VALUE to)
@@ -482,7 +576,9 @@ path_rename(VALUE self, VALUE to)
}
/*
- * See <tt>File.stat</tt>. Returns a <tt>File::Stat</tt> object.
+ * Returns a File::Stat object.
+ *
+ * See File.stat.
*/
static VALUE
path_stat(VALUE self)
@@ -491,7 +587,7 @@ path_stat(VALUE self)
}
/*
- * See <tt>File.lstat</tt>.
+ * See File.lstat.
*/
static VALUE
path_lstat(VALUE self)
@@ -503,7 +599,9 @@ path_lstat(VALUE self)
* call-seq:
* pathname.make_symlink(old)
*
- * See <tt>File.symlink</tt>. Creates a symbolic link.
+ * Creates a symbolic link.
+ *
+ * See File.symlink.
*/
static VALUE
path_make_symlink(VALUE self, VALUE old)
@@ -512,7 +610,9 @@ path_make_symlink(VALUE self, VALUE old)
}
/*
- * See <tt>File.truncate</tt>. Truncate the file to +length+ bytes.
+ * Truncates the file to +length+ bytes.
+ *
+ * See File.truncate.
*/
static VALUE
path_truncate(VALUE self, VALUE length)
@@ -521,7 +621,9 @@ path_truncate(VALUE self, VALUE length)
}
/*
- * See <tt>File.utime</tt>. Update the access and modification times.
+ * Update the access and modification times of the file.
+ *
+ * See File.utime.
*/
static VALUE
path_utime(VALUE self, VALUE atime, VALUE mtime)
@@ -530,7 +632,9 @@ path_utime(VALUE self, VALUE atime, VALUE mtime)
}
/*
- * See <tt>File.basename</tt>. Returns the last component of the path.
+ * Returns the last component of the path.
+ *
+ * See File.basename.
*/
static VALUE
path_basename(int argc, VALUE *argv, VALUE self)
@@ -545,7 +649,9 @@ path_basename(int argc, VALUE *argv, VALUE self)
}
/*
- * See <tt>File.dirname</tt>. Returns all but the last component of the path.
+ * Returns all but the last component of the path.
+ *
+ * See File.dirname.
*/
static VALUE
path_dirname(VALUE self)
@@ -556,7 +662,9 @@ path_dirname(VALUE self)
}
/*
- * See <tt>File.extname</tt>. Returns the file's extension.
+ * Returns the file's extension.
+ *
+ * See File.extname.
*/
static VALUE
path_extname(VALUE self)
@@ -566,7 +674,9 @@ path_extname(VALUE self)
}
/*
- * See <tt>File.expand_path</tt>.
+ * Returns the absolute path for the file.
+ *
+ * See File.expand_path.
*/
static VALUE
path_expand_path(int argc, VALUE *argv, VALUE self)
@@ -581,7 +691,9 @@ path_expand_path(int argc, VALUE *argv, VALUE self)
}
/*
- * See <tt>File.split</tt>. Returns the #dirname and the #basename in an Array.
+ * Returns the #dirname and the #basename in an Array.
+ *
+ * See File.split.
*/
static VALUE
path_split(VALUE self)
@@ -598,7 +710,7 @@ path_split(VALUE self)
}
/*
- * See <tt>FileTest.blockdev?</tt>.
+ * See FileTest.blockdev?.
*/
static VALUE
path_blockdev_p(VALUE self)
@@ -607,7 +719,7 @@ path_blockdev_p(VALUE self)
}
/*
- * See <tt>FileTest.chardev?</tt>.
+ * See FileTest.chardev?.
*/
static VALUE
path_chardev_p(VALUE self)
@@ -616,7 +728,7 @@ path_chardev_p(VALUE self)
}
/*
- * See <tt>FileTest.executable?</tt>.
+ * See FileTest.executable?.
*/
static VALUE
path_executable_p(VALUE self)
@@ -625,7 +737,7 @@ path_executable_p(VALUE self)
}
/*
- * See <tt>FileTest.executable_real?</tt>.
+ * See FileTest.executable_real?.
*/
static VALUE
path_executable_real_p(VALUE self)
@@ -634,7 +746,7 @@ path_executable_real_p(VALUE self)
}
/*
- * See <tt>FileTest.exist?</tt>.
+ * See FileTest.exist?.
*/
static VALUE
path_exist_p(VALUE self)
@@ -643,7 +755,7 @@ path_exist_p(VALUE self)
}
/*
- * See <tt>FileTest.grpowned?</tt>.
+ * See FileTest.grpowned?.
*/
static VALUE
path_grpowned_p(VALUE self)
@@ -652,7 +764,7 @@ path_grpowned_p(VALUE self)
}
/*
- * See <tt>FileTest.directory?</tt>.
+ * See FileTest.directory?.
*/
static VALUE
path_directory_p(VALUE self)
@@ -661,7 +773,7 @@ path_directory_p(VALUE self)
}
/*
- * See <tt>FileTest.file?</tt>.
+ * See FileTest.file?.
*/
static VALUE
path_file_p(VALUE self)
@@ -670,7 +782,7 @@ path_file_p(VALUE self)
}
/*
- * See <tt>FileTest.pipe?</tt>.
+ * See FileTest.pipe?.
*/
static VALUE
path_pipe_p(VALUE self)
@@ -679,7 +791,7 @@ path_pipe_p(VALUE self)
}
/*
- * See <tt>FileTest.socket?</tt>.
+ * See FileTest.socket?.
*/
static VALUE
path_socket_p(VALUE self)
@@ -688,7 +800,7 @@ path_socket_p(VALUE self)
}
/*
- * See <tt>FileTest.owned?</tt>.
+ * See FileTest.owned?.
*/
static VALUE
path_owned_p(VALUE self)
@@ -697,7 +809,7 @@ path_owned_p(VALUE self)
}
/*
- * See <tt>FileTest.readable?</tt>.
+ * See FileTest.readable?.
*/
static VALUE
path_readable_p(VALUE self)
@@ -706,7 +818,7 @@ path_readable_p(VALUE self)
}
/*
- * See <tt>FileTest.world_readable?</tt>.
+ * See FileTest.world_readable?.
*/
static VALUE
path_world_readable_p(VALUE self)
@@ -715,7 +827,7 @@ path_world_readable_p(VALUE self)
}
/*
- * See <tt>FileTest.readable_real?</tt>.
+ * See FileTest.readable_real?.
*/
static VALUE
path_readable_real_p(VALUE self)
@@ -724,7 +836,7 @@ path_readable_real_p(VALUE self)
}
/*
- * See <tt>FileTest.setuid?</tt>.
+ * See FileTest.setuid?.
*/
static VALUE
path_setuid_p(VALUE self)
@@ -733,7 +845,7 @@ path_setuid_p(VALUE self)
}
/*
- * See <tt>FileTest.setgid?</tt>.
+ * See FileTest.setgid?.
*/
static VALUE
path_setgid_p(VALUE self)
@@ -742,7 +854,7 @@ path_setgid_p(VALUE self)
}
/*
- * See <tt>FileTest.size</tt>.
+ * See FileTest.size.
*/
static VALUE
path_size(VALUE self)
@@ -751,7 +863,7 @@ path_size(VALUE self)
}
/*
- * See <tt>FileTest.size?</tt>.
+ * See FileTest.size?.
*/
static VALUE
path_size_p(VALUE self)
@@ -760,7 +872,7 @@ path_size_p(VALUE self)
}
/*
- * See <tt>FileTest.sticky?</tt>.
+ * See FileTest.sticky?.
*/
static VALUE
path_sticky_p(VALUE self)
@@ -769,7 +881,7 @@ path_sticky_p(VALUE self)
}
/*
- * See <tt>FileTest.symlink?</tt>.
+ * See FileTest.symlink?.
*/
static VALUE
path_symlink_p(VALUE self)
@@ -778,7 +890,7 @@ path_symlink_p(VALUE self)
}
/*
- * See <tt>FileTest.writable?</tt>.
+ * See FileTest.writable?.
*/
static VALUE
path_writable_p(VALUE self)
@@ -787,7 +899,7 @@ path_writable_p(VALUE self)
}
/*
- * See <tt>FileTest.world_writable?</tt>.
+ * See FileTest.world_writable?.
*/
static VALUE
path_world_writable_p(VALUE self)
@@ -796,7 +908,7 @@ path_world_writable_p(VALUE self)
}
/*
- * See <tt>FileTest.writable_real?</tt>.
+ * See FileTest.writable_real?.
*/
static VALUE
path_writable_real_p(VALUE self)
@@ -805,7 +917,7 @@ path_writable_real_p(VALUE self)
}
/*
- * See <tt>FileTest.zero?</tt>.
+ * See FileTest.zero?.
*/
static VALUE
path_zero_p(VALUE self)
@@ -820,7 +932,12 @@ glob_i(VALUE elt, VALUE klass, int argc, VALUE *argv)
}
/*
- * See <tt>Dir.glob</tt>. Returns or yields Pathname objects.
+ * Returns or yields Pathname objects.
+ *
+ * Pathname.glob("config/" "*.rb")
+ * #=> [#<Pathname:config/environment.rb>, #<Pathname:config/routes.rb>, ..]
+ *
+ * See Dir.glob.
*/
static VALUE
path_s_glob(int argc, VALUE *argv, VALUE klass)
@@ -847,7 +964,12 @@ path_s_glob(int argc, VALUE *argv, VALUE klass)
}
/*
- * See <tt>Dir.getwd</tt>. Returns the current working directory as a Pathname.
+ * Returns the current working directory as a Pathname.
+ *
+ * Pathname.getwd
+ * #=> #<Pathname:/home/zzak/projects/ruby>
+ *
+ * See Dir.getwd.
*/
static VALUE
path_s_getwd(VALUE klass)
@@ -861,8 +983,27 @@ path_s_getwd(VALUE klass)
* Return the entries (files and subdirectories) in the directory, each as a
* Pathname object.
*
- * The result may contain the current directory #<Pathname:.> and the parent
- * directory #<Pathname:..>.
+ * The results contains just the names in the directory, without any trailing
+ * slashes or recursive look-up.
+ *
+ * pp Pathname.new('/usr/local').entries
+ * #=> [#<Pathname:share>,
+ * # #<Pathname:lib>,
+ * # #<Pathname:..>,
+ * # #<Pathname:include>,
+ * # #<Pathname:etc>,
+ * # #<Pathname:bin>,
+ * # #<Pathname:man>,
+ * # #<Pathname:games>,
+ * # #<Pathname:.>,
+ * # #<Pathname:sbin>,
+ * # #<Pathname:src>]
+ *
+ * The result may contain the current directory <code>#<Pathname:.></code> and
+ * the parent directory <code>#<Pathname:..></code>.
+ *
+ * If you don't want +.+ and +..+ and
+ * want directories, consider Pathname#children.
*/
static VALUE
path_entries(VALUE self)
@@ -882,7 +1023,9 @@ path_entries(VALUE self)
}
/*
- * See <tt>Dir.mkdir</tt>. Create the referenced directory.
+ * Create the referenced directory.
+ *
+ * See Dir.mkdir.
*/
static VALUE
path_mkdir(int argc, VALUE *argv, VALUE self)
@@ -896,7 +1039,9 @@ path_mkdir(int argc, VALUE *argv, VALUE self)
}
/*
- * See <tt>Dir.rmdir</tt>. Remove the referenced directory.
+ * Remove the referenced directory.
+ *
+ * See Dir.rmdir.
*/
static VALUE
path_rmdir(VALUE self)
@@ -905,7 +1050,9 @@ path_rmdir(VALUE self)
}
/*
- * See <tt>Dir.open</tt>.
+ * Opens the referenced directory.
+ *
+ * See Dir.open.
*/
static VALUE
path_opendir(VALUE self)
@@ -923,10 +1070,8 @@ each_entry_i(VALUE elt, VALUE klass, int argc, VALUE *argv)
}
/*
- * Iterates over the entries (files and subdirectories) in the directory. It
- * yields a Pathname object for each entry.
- *
- * This method has available since 1.8.1.
+ * Iterates over the entries (files and subdirectories) in the directory,
+ * yielding a Pathname object for each entry.
*/
static VALUE
path_each_entry(VALUE self)
@@ -950,8 +1095,8 @@ unlink_rescue(VALUE str, VALUE errinfo)
}
/*
- * Removes a file or directory, using <tt>File.unlink</tt> or
- * <tt>Dir.unlink</tt> as necessary.
+ * Removes a file or directory, using File.unlink if +self+ is a file, or
+ * Dir.unlink as necessary.
*/
static VALUE
path_unlink(VALUE self)
@@ -962,9 +1107,7 @@ path_unlink(VALUE self)
}
/*
- * create a pathname object.
- *
- * This method is available since 1.8.5.
+ * Creates a new Pathname object.
*/
static VALUE
path_f_pathname(VALUE self, VALUE str)
@@ -973,24 +1116,26 @@ path_f_pathname(VALUE self, VALUE str)
}
/*
- * == Pathname
*
- * Pathname represents a pathname which locates a file in a filesystem.
- * The pathname depends on OS: Unix, Windows, etc.
- * Pathname library works with pathnames of local OS.
- * However non-Unix pathnames are supported experimentally.
+ * Pathname represents the name of a file or directory on the filesystem,
+ * but not the file itself.
+ *
+ * The pathname depends on the Operating System: Unix, Windows, etc.
+ * This library works with pathnames of local OS, however non-Unix pathnames
+ * are supported experimentally.
*
- * It does not represent the file itself.
* A Pathname can be relative or absolute. It's not until you try to
* reference the file that it even matters whether the file exists or not.
*
* Pathname is immutable. It has no method for destructive update.
*
- * The value of this class is to manipulate file path information in a neater
+ * The goal of this class is to manipulate file path information in a neater
* way than standard Ruby provides. The examples below demonstrate the
- * difference. *All* functionality from File, FileTest, and some from Dir and
- * FileUtils is included, in an unsurprising way. It is essentially a facade for
- * all of these, and more.
+ * difference.
+ *
+ * *All* functionality from File, FileTest, and some from Dir and FileUtils is
+ * included, in an unsurprising way. It is essentially a facade for all of
+ * these, and more.
*
* == Examples
*
@@ -1038,8 +1183,8 @@ path_f_pathname(VALUE self, VALUE str)
* === Core methods
*
* These methods are effectively manipulating a String, because that's
- * all a path is. Except for #mountpoint?, #children, #each_child,
- * #realdirpath and #realpath, they don't access the filesystem.
+ * all a path is. None of these access the file system except for
+ * #mountpoint?, #children, #each_child, #realdirpath and #realpath.
*
* - +
* - #join
diff --git a/ext/psych/.gitignore b/ext/psych/.gitignore
new file mode 100644
index 0000000000..836058c169
--- /dev/null
+++ b/ext/psych/.gitignore
@@ -0,0 +1,11 @@
+/api.c
+/config.h
+/dumper.c
+/emitter.c
+/loader.c
+/parser.c
+/reader.c
+/scanner.c
+/writer.c
+/yaml.h
+/yaml_private.h
diff --git a/ext/psych/extconf.rb b/ext/psych/extconf.rb
index 11f44ac104..65e83a3554 100644
--- a/ext/psych/extconf.rb
+++ b/ext/psych/extconf.rb
@@ -1,15 +1,37 @@
+# -*- coding: us-ascii -*-
require 'mkmf'
+require 'fileutils'
# :stopdoc:
dir_config 'libyaml'
-def asplode missing
- abort "#{missing} is missing. Please install libyaml."
-end
+if enable_config("bundled-libyaml", false) || !(find_header('yaml.h') && find_library('yaml', 'yaml_get_version'))
+ # Embed libyaml since we could not find it.
+
+ $VPATH << "$(srcdir)/yaml"
+ $INCFLAGS << " -I$(srcdir)/yaml"
+
+ $srcs = Dir.glob("#{$srcdir}/{,yaml/}*.c").map {|n| File.basename(n)}
-asplode('yaml.h') unless find_header 'yaml.h'
-asplode('libyaml') unless find_library 'yaml', 'yaml_get_version'
+ if have_macro("_WIN32")
+ $CPPFLAGS << " -DYAML_DECLARE_STATIC -DHAVE_CONFIG_H"
+ end
+
+ have_header 'dlfcn.h'
+ have_header 'inttypes.h'
+ have_header 'memory.h'
+ have_header 'stdint.h'
+ have_header 'stdlib.h'
+ have_header 'strings.h'
+ have_header 'string.h'
+ have_header 'sys/stat.h'
+ have_header 'sys/types.h'
+ have_header 'unistd.h'
+
+ find_header 'yaml.h'
+ have_header 'config.h'
+end
create_makefile 'psych'
diff --git a/ext/psych/lib/psych.rb b/ext/psych/lib/psych.rb
index 31d73c1f03..d4a5171905 100644
--- a/ext/psych/lib/psych.rb
+++ b/ext/psych/lib/psych.rb
@@ -10,15 +10,20 @@ require 'psych/set'
require 'psych/coder'
require 'psych/core_ext'
require 'psych/deprecated'
-require 'psych/json'
+require 'psych/stream'
+require 'psych/json/tree_builder'
+require 'psych/json/stream'
+require 'psych/handlers/document_stream'
###
# = Overview
#
-# Psych is a YAML parser and emitter. Psych leverages
-# libyaml[http://libyaml.org] for it's YAML parsing and emitting capabilities.
-# In addition to wrapping libyaml, Psych also knows how to serialize and
-# de-serialize most Ruby objects to and from the YAML format.
+# Psych is a YAML parser and emitter.
+# Psych leverages libyaml [Home page: http://pyyaml.org/wiki/LibYAML]
+# or [Git repo: https://github.com/zerotao/libyaml] for its YAML parsing
+# and emitting capabilities. In addition to wrapping libyaml, Psych also
+# knows how to serialize and de-serialize most Ruby objects to and from
+# the YAML format.
#
# = I NEED TO PARSE OR EMIT YAML RIGHT NOW!
#
@@ -90,7 +95,7 @@ require 'psych/json'
module Psych
# The version is Psych you're using
- VERSION = '1.2.0'
+ VERSION = '2.0.0'
# The version of libyaml Psych is using
LIBYAML_VERSION = Psych.libyaml_version.join '.'
@@ -98,39 +103,66 @@ module Psych
class Exception < RuntimeError
end
- autoload :Stream, 'psych/stream'
+ class BadAlias < Exception
+ end
###
# Load +yaml+ in to a Ruby data structure. If multiple documents are
# provided, the object contained in the first document will be returned.
+ # +filename+ will be used in the exception message if any exception is raised
+ # while parsing.
+ #
+ # Raises a Psych::SyntaxError when a YAML syntax error is detected.
#
# Example:
#
- # Psych.load("--- a") # => 'a'
- # Psych.load("---\n - a\n - b") # => ['a', 'b']
- def self.load yaml
- result = parse(yaml)
+ # Psych.load("--- a") # => 'a'
+ # Psych.load("---\n - a\n - b") # => ['a', 'b']
+ #
+ # begin
+ # Psych.load("--- `", "file.txt")
+ # rescue Psych::SyntaxError => ex
+ # ex.file # => 'file.txt'
+ # ex.message # => "(foo.txt): found character that cannot start any token"
+ # end
+ def self.load yaml, filename = nil
+ result = parse(yaml, filename)
result ? result.to_ruby : result
end
###
# Parse a YAML string in +yaml+. Returns the first object of a YAML AST.
+ # +filename+ is used in the exception message if a Psych::SyntaxError is
+ # raised.
+ #
+ # Raises a Psych::SyntaxError when a YAML syntax error is detected.
#
# Example:
#
# Psych.parse("---\n - a\n - b") # => #<Psych::Nodes::Sequence:0x00>
#
+ # begin
+ # Psych.parse("--- `", "file.txt")
+ # rescue Psych::SyntaxError => ex
+ # ex.file # => 'file.txt'
+ # ex.message # => "(foo.txt): found character that cannot start any token"
+ # end
+ #
# See Psych::Nodes for more information about YAML AST.
- def self.parse yaml
- children = parse_stream(yaml).children
- children.empty? ? false : children.first.children.first
+ def self.parse yaml, filename = nil
+ parse_stream(yaml, filename) do |node|
+ return node
+ end
+ false
end
###
# Parse a file at +filename+. Returns the YAML AST.
+ #
+ # Raises a Psych::SyntaxError when a YAML syntax error is detected.
def self.parse_file filename
- File.open filename do |f|
- parse f
+ File.open filename, 'r:bom|utf-8' do |f|
+ parse f, filename
end
end
@@ -143,16 +175,39 @@ module Psych
###
# Parse a YAML string in +yaml+. Returns the full AST for the YAML document.
# This method can handle multiple YAML documents contained in +yaml+.
+ # +filename+ is used in the exception message if a Psych::SyntaxError is
+ # raised.
+ #
+ # If a block is given, a Psych::Nodes::Document node will be yielded to the
+ # block as it's being parsed.
+ #
+ # Raises a Psych::SyntaxError when a YAML syntax error is detected.
#
# Example:
#
# Psych.parse_stream("---\n - a\n - b") # => #<Psych::Nodes::Stream:0x00>
#
+ # Psych.parse_stream("--- a\n--- b") do |node|
+ # node # => #<Psych::Nodes::Document:0x00>
+ # end
+ #
+ # begin
+ # Psych.parse_stream("--- `", "file.txt")
+ # rescue Psych::SyntaxError => ex
+ # ex.file # => 'file.txt'
+ # ex.message # => "(foo.txt): found character that cannot start any token"
+ # end
+ #
# See Psych::Nodes for more information about YAML AST.
- def self.parse_stream yaml
- parser = self.parser
- parser.parse yaml
- parser.handler.root
+ def self.parse_stream yaml, filename = nil, &block
+ if block_given?
+ parser = Psych::Parser.new(Handlers::DocumentStream.new(&block))
+ parser.parse yaml, filename
+ else
+ parser = self.parser
+ parser.parse yaml, filename
+ parser.handler.root
+ end
end
###
@@ -187,7 +242,7 @@ module Psych
visitor = Psych::Visitors::YAMLTree.new options
visitor << o
- visitor.tree.to_yaml io, options
+ visitor.tree.yaml io, options
end
###
@@ -201,7 +256,7 @@ module Psych
objects.each do |o|
visitor << o
end
- visitor.tree.to_yaml
+ visitor.tree.yaml
end
###
@@ -209,24 +264,39 @@ module Psych
def self.to_json o
visitor = Psych::Visitors::JSONTree.new
visitor << o
- visitor.tree.to_yaml
+ visitor.tree.yaml
end
###
# Load multiple documents given in +yaml+. Returns the parsed documents
- # as a list. For example:
+ # as a list. If a block is given, each document will be converted to ruby
+ # and passed to the block during parsing
+ #
+ # Example:
#
# Psych.load_stream("--- foo\n...\n--- bar\n...") # => ['foo', 'bar']
#
- def self.load_stream yaml
- parse_stream(yaml).children.map { |child| child.to_ruby }
+ # list = []
+ # Psych.load_stream("--- foo\n...\n--- bar\n...") do |ruby|
+ # list << ruby
+ # end
+ # list # => ['foo', 'bar']
+ #
+ def self.load_stream yaml, filename = nil
+ if block_given?
+ parse_stream(yaml, filename) do |node|
+ yield node.to_ruby
+ end
+ else
+ parse_stream(yaml, filename).children.map { |child| child.to_ruby }
+ end
end
###
# Load the document contained in +filename+. Returns the yaml contained in
# +filename+ as a ruby object
def self.load_file filename
- self.load File.open(filename)
+ File.open(filename, 'r:bom|utf-8') { |f| self.load f, filename }
end
# :stopdoc:
diff --git a/ext/psych/lib/psych/core_ext.rb b/ext/psych/lib/psych/core_ext.rb
index be26b2f449..9c8134da7e 100644
--- a/ext/psych/lib/psych/core_ext.rb
+++ b/ext/psych/lib/psych/core_ext.rb
@@ -30,10 +30,6 @@ class Module
alias :yaml_as :psych_yaml_as
end
-module Kernel
- def psych_y *objects
- puts Psych.dump_stream(*objects)
- end
- remove_method :y rescue nil
- alias y psych_y
+if defined?(::IRB)
+ require 'psych/y'
end
diff --git a/ext/psych/lib/psych/deprecated.rb b/ext/psych/lib/psych/deprecated.rb
index 333c3a1016..1e42859b22 100644
--- a/ext/psych/lib/psych/deprecated.rb
+++ b/ext/psych/lib/psych/deprecated.rb
@@ -21,6 +21,7 @@ module Psych
target.psych_to_yaml unless opts[:nodump]
end
+ # This method is deprecated, use Psych.load_stream instead.
def self.load_documents yaml, &block
if $VERBOSE
warn "#{caller[0]}: load_documents is deprecated, use load_stream"
diff --git a/ext/psych/lib/psych/handler.rb b/ext/psych/lib/psych/handler.rb
index a2aa6bb178..c55afe745f 100644
--- a/ext/psych/lib/psych/handler.rb
+++ b/ext/psych/lib/psych/handler.rb
@@ -11,6 +11,34 @@ module Psych
# See Psych::Parser for more details
class Handler
###
+ # Configuration options for dumping YAML.
+ class DumperOptions
+ attr_accessor :line_width, :indentation, :canonical
+
+ def initialize
+ @line_width = 0
+ @indentation = 2
+ @canonical = false
+ end
+ end
+
+ # Default dumping options
+ OPTIONS = DumperOptions.new
+
+ # Events that a Handler should respond to.
+ EVENTS = [ :alias,
+ :empty,
+ :end_document,
+ :end_mapping,
+ :end_sequence,
+ :end_stream,
+ :scalar,
+ :start_document,
+ :start_mapping,
+ :start_sequence,
+ :start_stream ]
+
+ ###
# Called with +encoding+ when the YAML stream starts. This method is
# called once per stream. A stream may contain multiple documents.
#
diff --git a/ext/psych/lib/psych/handlers/document_stream.rb b/ext/psych/lib/psych/handlers/document_stream.rb
new file mode 100644
index 0000000000..e429993c1c
--- /dev/null
+++ b/ext/psych/lib/psych/handlers/document_stream.rb
@@ -0,0 +1,22 @@
+require 'psych/tree_builder'
+
+module Psych
+ module Handlers
+ class DocumentStream < Psych::TreeBuilder # :nodoc:
+ def initialize &block
+ super
+ @block = block
+ end
+
+ def start_document version, tag_directives, implicit
+ n = Nodes::Document.new version, tag_directives, implicit
+ push n
+ end
+
+ def end_document implicit_end = !streaming?
+ @last.implicit_end = implicit_end
+ @block.call pop
+ end
+ end
+ end
+end
diff --git a/ext/psych/lib/psych/handlers/recorder.rb b/ext/psych/lib/psych/handlers/recorder.rb
new file mode 100644
index 0000000000..4eae62e5f9
--- /dev/null
+++ b/ext/psych/lib/psych/handlers/recorder.rb
@@ -0,0 +1,39 @@
+require 'psych/handler'
+
+module Psych
+ module Handlers
+ ###
+ # This handler will capture an event and record the event. Recorder events
+ # are available vial Psych::Handlers::Recorder#events.
+ #
+ # For example:
+ #
+ # recorder = Psych::Handlers::Recorder.new
+ # parser = Psych::Parser.new recorder
+ # parser.parse '--- foo'
+ #
+ # recorder.events # => [list of events]
+ #
+ # # Replay the events
+ #
+ # emitter = Psych::Emitter.new $stdout
+ # recorder.events.each do |m, args|
+ # emitter.send m, *args
+ # end
+
+ class Recorder < Psych::Handler
+ attr_reader :events
+
+ def initialize
+ @events = []
+ super
+ end
+
+ EVENTS.each do |event|
+ define_method event do |*args|
+ @events << [event, args]
+ end
+ end
+ end
+ end
+end
diff --git a/ext/psych/lib/psych/json.rb b/ext/psych/lib/psych/json.rb
deleted file mode 100644
index 412ab2708b..0000000000
--- a/ext/psych/lib/psych/json.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-module Psych
- module JSON
- autoload :TreeBuilder, 'psych/json/tree_builder'
- autoload :Stream, 'psych/json/stream'
- end
-end
diff --git a/ext/psych/lib/psych/json/yaml_events.rb b/ext/psych/lib/psych/json/yaml_events.rb
index 01d4660f85..d054d9b458 100644
--- a/ext/psych/lib/psych/json/yaml_events.rb
+++ b/ext/psych/lib/psych/json/yaml_events.rb
@@ -10,11 +10,11 @@ module Psych
end
def start_mapping anchor, tag, implicit, style
- super(anchor, nil, implicit, Nodes::Mapping::FLOW)
+ super(anchor, nil, true, Nodes::Mapping::FLOW)
end
def start_sequence anchor, tag, implicit, style
- super(anchor, nil, implicit, Nodes::Sequence::FLOW)
+ super(anchor, nil, true, Nodes::Sequence::FLOW)
end
def scalar value, anchor, tag, plain, quoted, style
diff --git a/ext/psych/lib/psych/nodes/node.rb b/ext/psych/lib/psych/nodes/node.rb
index 7c040ec463..0cefe44e44 100644
--- a/ext/psych/lib/psych/nodes/node.rb
+++ b/ext/psych/lib/psych/nodes/node.rb
@@ -40,13 +40,14 @@ module Psych
# Convert this node to YAML.
#
# See also Psych::Visitors::Emitter
- def to_yaml io = nil, options = {}
- real_io = io || StringIO.new
+ def yaml io = nil, options = {}
+ real_io = io || StringIO.new(''.encode('utf-8'))
Visitors::Emitter.new(real_io, options).accept self
return real_io.string unless io
io
end
+ alias :to_yaml :yaml
end
end
end
diff --git a/ext/psych/lib/psych/parser.rb b/ext/psych/lib/psych/parser.rb
index 5d75605d49..84085f1fb0 100644
--- a/ext/psych/lib/psych/parser.rb
+++ b/ext/psych/lib/psych/parser.rb
@@ -36,12 +36,16 @@ module Psych
# The handler on which events will be called
attr_accessor :handler
+ # Set the encoding for this parser to +encoding+
+ attr_writer :external_encoding
+
###
# Creates a new Psych::Parser instance with +handler+. YAML events will
# be called on +handler+. See Psych::Parser for more details.
def initialize handler = Handler.new
@handler = handler
+ @external_encoding = ANY
end
end
end
diff --git a/ext/psych/lib/psych/scalar_scanner.rb b/ext/psych/lib/psych/scalar_scanner.rb
index 29d66ee4cc..d0beee3626 100644
--- a/ext/psych/lib/psych/scalar_scanner.rb
+++ b/ext/psych/lib/psych/scalar_scanner.rb
@@ -7,18 +7,34 @@ module Psych
# Taken from http://yaml.org/type/timestamp.html
TIME = /^\d{4}-\d{1,2}-\d{1,2}([Tt]|\s+)\d{1,2}:\d\d:\d\d(\.\d*)?(\s*Z|[-+]\d{1,2}(:\d\d)?)?/
+ # Taken from http://yaml.org/type/float.html
+ FLOAT = /^(?:[-+]?([0-9][0-9_,]*)?\.[0-9]*([eE][-+][0-9]+)?(?# base 10)
+ |[-+]?[0-9][0-9_,]*(:[0-5]?[0-9])+\.[0-9_]*(?# base 60)
+ |[-+]?\.(inf|Inf|INF)(?# infinity)
+ |\.(nan|NaN|NAN)(?# not a number))$/x
+
+ # Taken from http://yaml.org/type/int.html
+ INTEGER = /^(?:[-+]?0b[0-1_]+ (?# base 2)
+ |[-+]?0[0-7_]+ (?# base 8)
+ |[-+]?(?:0|[1-9][0-9_]*) (?# base 10)
+ |[-+]?0x[0-9a-fA-F_]+ (?# base 16))$/x
+
# Create a new scanner
def initialize
@string_cache = {}
+ @symbol_cache = {}
end
# Tokenize +string+ returning the ruby object
def tokenize string
return nil if string.empty?
return string if @string_cache.key?(string)
+ return @symbol_cache[string] if @symbol_cache.key?(string)
case string
- when /^[A-Za-z~]/
+ # Check for a String type, being careful not to get caught by hash keys, hex values, and
+ # special floats (e.g., -.inf).
+ when /^[^\d\.:-]?[A-Za-z_\s!@#\$%\^&\*\(\)\{\}\<\>\|\/\\~;=]+/
if string.length > 5
@string_cache[string] = true
return string
@@ -39,10 +55,18 @@ module Psych
string
end
when TIME
- parse_time string
- when /^\d{4}-\d{1,2}-\d{1,2}$/
+ begin
+ parse_time string
+ rescue ArgumentError
+ string
+ end
+ when /^\d{4}-(?:1[012]|0\d|\d)-(?:[12]\d|3[01]|0\d|\d)$/
require 'date'
- Date.strptime(string, '%Y-%m-%d')
+ begin
+ Date.strptime(string, '%Y-%m-%d')
+ rescue ArgumentError
+ string
+ end
when /^\.inf$/i
1 / 0.0
when /^-\.inf$/i
@@ -51,11 +75,11 @@ module Psych
0.0 / 0.0
when /^:./
if string =~ /^:(["'])(.*)\1/
- $2.sub(/^:/, '').to_sym
+ @symbol_cache[string] = $2.sub(/^:/, '').to_sym
else
- string.sub(/^:/, '').to_sym
+ @symbol_cache[string] = string.sub(/^:/, '').to_sym
end
- when /^[-+]?[1-9][0-9_]*(:[0-5]?[0-9])+$/
+ when /^[-+]?[0-9][0-9_]*(:[0-5]?[0-9])+$/
i = 0
string.split(':').each_with_index do |n,e|
i += (n.to_i * 60 ** (e - 2).abs)
@@ -67,15 +91,30 @@ module Psych
i += (n.to_f * 60 ** (e - 2).abs)
end
i
+ when FLOAT
+ if string == '.'
+ @string_cache[string] = true
+ string
+ else
+ Float(string.gsub(/[,_]/, ''))
+ end
else
- return Integer(string.gsub(/[,_]/, '')) rescue ArgumentError
- return Float(string.gsub(/[,_]/, '')) rescue ArgumentError
+ int = parse_int string.gsub(/[,_]/, '')
+ return int if int
+
@string_cache[string] = true
string
end
end
###
+ # Parse and return an int from +string+
+ def parse_int string
+ return unless INTEGER === string
+ Integer(string)
+ end
+
+ ###
# Parse and return a Time from +string+
def parse_time string
date, time = *(string.split(/[ tT]/, 2))
diff --git a/ext/psych/lib/psych/syntax_error.rb b/ext/psych/lib/psych/syntax_error.rb
new file mode 100644
index 0000000000..f972256f9e
--- /dev/null
+++ b/ext/psych/lib/psych/syntax_error.rb
@@ -0,0 +1,22 @@
+module Psych
+ class Error < RuntimeError
+ end
+
+ class SyntaxError < Error
+ attr_reader :file, :line, :column, :offset, :problem, :context
+
+ def initialize file, line, col, offset, problem, context
+ err = [problem, context].compact.join ' '
+ filename = file || '<unknown>'
+ message = "(%s): %s at line %d column %d" % [filename, err, line, col]
+
+ @file = file
+ @line = line
+ @column = col
+ @offset = offset
+ @problem = problem
+ @context = context
+ super(message)
+ end
+ end
+end
diff --git a/ext/psych/lib/psych/tree_builder.rb b/ext/psych/lib/psych/tree_builder.rb
index 8b4e972314..c8f344787c 100644
--- a/ext/psych/lib/psych/tree_builder.rb
+++ b/ext/psych/lib/psych/tree_builder.rb
@@ -72,7 +72,9 @@ module Psych
end
def scalar value, anchor, tag, plain, quoted, style
- @last.children << Nodes::Scalar.new(value,anchor,tag,plain,quoted,style)
+ s = Nodes::Scalar.new(value,anchor,tag,plain,quoted,style)
+ @last.children << s
+ s
end
def alias anchor
diff --git a/ext/psych/lib/psych/visitors/emitter.rb b/ext/psych/lib/psych/visitors/emitter.rb
index 30db17612d..c886e5092e 100644
--- a/ext/psych/lib/psych/visitors/emitter.rb
+++ b/ext/psych/lib/psych/visitors/emitter.rb
@@ -2,10 +2,17 @@ module Psych
module Visitors
class Emitter < Psych::Visitors::Visitor
def initialize io, options = {}
- @handler = Psych::Emitter.new io
- @handler.indentation = options[:indentation] if options[:indentation]
- @handler.canonical = options[:canonical] if options[:canonical]
- @handler.line_width = options[:line_width] if options[:line_width]
+ opts = [:indentation, :canonical, :line_width].find_all { |opt|
+ options.key?(opt)
+ }
+
+ if opts.empty?
+ @handler = Psych::Emitter.new io
+ else
+ du = Handler::DumperOptions.new
+ opts.each { |option| du.send :"#{option}=", options[option] }
+ @handler = Psych::Emitter.new io, du
+ end
end
def visit_Psych_Nodes_Stream o
diff --git a/ext/psych/lib/psych/visitors/to_ruby.rb b/ext/psych/lib/psych/visitors/to_ruby.rb
index b8eb698754..c6cf018888 100644
--- a/ext/psych/lib/psych/visitors/to_ruby.rb
+++ b/ext/psych/lib/psych/visitors/to_ruby.rb
@@ -1,14 +1,18 @@
require 'psych/scalar_scanner'
+unless defined?(Regexp::NOENCODING)
+ Regexp::NOENCODING = 32
+end
+
module Psych
module Visitors
###
# This class walks a YAML AST, converting each node to ruby
class ToRuby < Psych::Visitors::Visitor
- def initialize
- super
+ def initialize ss = ScalarScanner.new
+ super()
@st = {}
- @ss = ScalarScanner.new
+ @ss = ss
@domain_types = Psych.domain_types
end
@@ -27,9 +31,7 @@ module Psych
result
end
- def visit_Psych_Nodes_Scalar o
- @st[o.anchor] = o.value if o.anchor
-
+ def deserialize o
if klass = Psych.load_tags[o.tag]
instance = klass.allocate
@@ -48,8 +50,16 @@ module Psych
case o.tag
when '!binary', 'tag:yaml.org,2002:binary'
o.value.unpack('m').first
- when '!str', 'tag:yaml.org,2002:str'
- o.value
+ when /^!(?:str|ruby\/string)(?::(.*))?/, 'tag:yaml.org,2002:str'
+ klass = resolve_class($1)
+ if klass
+ klass.allocate.replace o.value
+ else
+ o.value
+ end
+ when '!ruby/object:BigDecimal'
+ require 'bigdecimal'
+ BigDecimal._load o.value
when "!ruby/object:DateTime"
require 'date'
@ss.parse_time(o.value).to_datetime
@@ -88,6 +98,11 @@ module Psych
@ss.tokenize o.value
end
end
+ private :deserialize
+
+ def visit_Psych_Nodes_Scalar o
+ register o, deserialize(o)
+ end
def visit_Psych_Nodes_Sequence o
if klass = Psych.load_tags[o.tag]
@@ -103,18 +118,21 @@ module Psych
end
case o.tag
+ when nil
+ register_empty(o)
when '!omap', 'tag:yaml.org,2002:omap'
- map = Psych::Omap.new
- @st[o.anchor] = map if o.anchor
+ map = register(o, Psych::Omap.new)
o.children.each { |a|
map[accept(a.children.first)] = accept a.children.last
}
map
- else
- list = []
- @st[o.anchor] = list if o.anchor
+ when /^!(?:seq|ruby\/array):(.*)$/
+ klass = resolve_class($1)
+ list = register(o, klass.allocate)
o.children.each { |c| list.push accept c }
list
+ else
+ register_empty(o)
end
end
@@ -123,16 +141,33 @@ module Psych
return revive_hash({}, o) unless o.tag
case o.tag
- when '!str', 'tag:yaml.org,2002:str'
+ when /^!(?:str|ruby\/string)(?::(.*))?/, 'tag:yaml.org,2002:str'
+ klass = resolve_class($1)
members = Hash[*o.children.map { |c| accept c }]
string = members.delete 'str'
+
+ if klass
+ string = klass.allocate.replace string
+ register(o, string)
+ end
+
init_with(string, members.map { |k,v| [k.to_s.sub(/^@/, ''),v] }, o)
+ when /^!ruby\/array:(.*)$/
+ klass = resolve_class($1)
+ list = register(o, klass.allocate)
+
+ members = Hash[o.children.map { |c| accept c }.each_slice(2).to_a]
+ list.replace members['internal']
+
+ members['ivars'].each do |ivar, v|
+ list.instance_variable_set ivar, v
+ end
+ list
when /^!ruby\/struct:?(.*)?$/
klass = resolve_class($1)
if klass
- s = klass.allocate
- @st[o.anchor] = s if o.anchor
+ s = register(o, klass.allocate)
members = {}
struct_members = s.members.map { |x| x.to_sym }
@@ -154,7 +189,7 @@ module Psych
when '!ruby/range'
h = Hash[*o.children.map { |c| accept c }]
- Range.new(h['begin'], h['end'], h['excl'])
+ register o, Range.new(h['begin'], h['end'], h['excl'])
when /^!ruby\/exception:?(.*)?$/
h = Hash[*o.children.map { |c| accept c }]
@@ -173,11 +208,11 @@ module Psych
when '!ruby/object:Complex'
h = Hash[*o.children.map { |c| accept c }]
- Complex(h['real'], h['image'])
+ register o, Complex(h['real'], h['image'])
when '!ruby/object:Rational'
h = Hash[*o.children.map { |c| accept c }]
- Rational(h['numerator'], h['denominator'])
+ register o, Rational(h['numerator'], h['denominator'])
when /^!ruby\/object:?(.*)?$/
name = $1 || 'Object'
@@ -187,6 +222,13 @@ module Psych
when /^!map:(.*)$/, /^!ruby\/hash:(.*)$/
revive_hash resolve_class($1).new, o
+ when '!omap', 'tag:yaml.org,2002:omap'
+ map = register(o, Psych::Omap.new)
+ o.children.each_slice(2) do |l,r|
+ map[accept(l)] = accept r
+ end
+ map
+
else
revive_hash({}, o)
end
@@ -201,10 +243,21 @@ module Psych
end
def visit_Psych_Nodes_Alias o
- @st[o.anchor]
+ @st.fetch(o.anchor) { raise BadAlias, "Unknown alias: #{o.anchor}" }
end
private
+ def register node, object
+ @st[node.anchor] = object if node.anchor
+ object
+ end
+
+ def register_empty object
+ list = register(object, [])
+ object.children.each { |c| list.push accept c }
+ list
+ end
+
def revive_hash hash, o
@st[o.anchor] = hash if o.anchor
@@ -245,7 +298,7 @@ module Psych
o.init_with c
elsif o.respond_to?(:yaml_initialize)
if $VERBOSE
- "Implementing #{o.class}#yaml_initialize is deprecated, please implement \"init_with(coder)\""
+ warn "Implementing #{o.class}#yaml_initialize is deprecated, please implement \"init_with(coder)\""
end
o.yaml_initialize c.tag, c.map
else
diff --git a/ext/psych/lib/psych/visitors/yaml_tree.rb b/ext/psych/lib/psych/visitors/yaml_tree.rb
index eef6125ff1..d420abd64e 100644
--- a/ext/psych/lib/psych/visitors/yaml_tree.rb
+++ b/ext/psych/lib/psych/visitors/yaml_tree.rb
@@ -12,14 +12,15 @@ module Psych
alias :finished? :finished
alias :started? :started
- def initialize options = {}, emitter = Psych::TreeBuilder.new
+ def initialize options = {}, emitter = TreeBuilder.new, ss = ScalarScanner.new
super()
@started = false
@finished = false
@emitter = emitter
@st = {}
- @ss = ScalarScanner.new
+ @ss = ss
@options = options
+ @coders = []
@dispatch_cache = Hash.new do |h,klass|
method = "visit_#{(klass.name || '').split('::').join('_')}"
@@ -46,6 +47,7 @@ module Psych
def tree
finish unless finished?
+ @emitter.root
end
def push object
@@ -64,7 +66,7 @@ module Psych
@emitter.start_document version, [], false
accept object
- @emitter.end_document
+ @emitter.end_document !@emitter.streaming?
end
alias :<< :push
@@ -159,13 +161,13 @@ module Psych
end
def visit_Regexp o
- @emitter.scalar o.inspect, nil, '!ruby/regexp', false, false, Nodes::Scalar::ANY
+ register o, @emitter.scalar(o.inspect, nil, '!ruby/regexp', false, false, Nodes::Scalar::ANY)
end
def visit_DateTime o
formatted = format_time o.to_time
tag = '!ruby/object:DateTime'
- @emitter.scalar formatted, nil, tag, false, false, Nodes::Scalar::ANY
+ register o, @emitter.scalar(formatted, nil, tag, false, false, Nodes::Scalar::ANY)
end
def visit_Time o
@@ -174,7 +176,7 @@ module Psych
end
def visit_Rational o
- @emitter.start_mapping(nil, '!ruby/object:Rational', false, Nodes::Mapping::BLOCK)
+ register o, @emitter.start_mapping(nil, '!ruby/object:Rational', false, Nodes::Mapping::BLOCK)
[
'denominator', o.denominator.to_s,
@@ -187,7 +189,7 @@ module Psych
end
def visit_Complex o
- @emitter.start_mapping(nil, '!ruby/object:Complex', false, Nodes::Mapping::BLOCK)
+ register o, @emitter.start_mapping(nil, '!ruby/object:Complex', false, Nodes::Mapping::BLOCK)
['real', o.real.to_s, 'image', o.imag.to_s].each do |m|
@emitter.scalar m, nil, nil, true, false, Nodes::Scalar::ANY
@@ -214,19 +216,33 @@ module Psych
end
end
+ def visit_BigDecimal o
+ @emitter.scalar o._dump, nil, '!ruby/object:BigDecimal', false, false, Nodes::Scalar::ANY
+ end
+
+ def binary? string
+ string.encoding == Encoding::ASCII_8BIT ||
+ string.index("\x00") ||
+ string.count("\x00-\x7F", "^ -~\t\r\n").fdiv(string.length) > 0.3
+ end
+ private :binary?
+
def visit_String o
plain = false
quote = false
style = Nodes::Scalar::ANY
+ tag = nil
+ str = o
- if o.index("\x00") || o.count("\x00-\x7F", "^ -~\t\r\n").fdiv(o.length) > 0.3
+ if binary?(o)
str = [o].pack('m').chomp
tag = '!binary' # FIXME: change to below when syck is removed
#tag = 'tag:yaml.org,2002:binary'
style = Nodes::Scalar::LITERAL
+ elsif o =~ /\n/
+ quote = true
+ style = Nodes::Scalar::LITERAL
else
- str = o
- tag = nil
quote = !(String === @ss.tokenize(o))
plain = !quote
end
@@ -234,9 +250,15 @@ module Psych
ivars = find_ivars o
if ivars.empty?
+ unless o.class == ::String
+ tag = "!ruby/string:#{o.class}"
+ end
@emitter.scalar str, nil, tag, plain, quote, style
else
- @emitter.start_mapping nil, '!str', false, Nodes::Mapping::BLOCK
+ maptag = '!ruby/string'
+ maptag << ":#{o.class}" unless o.class == ::String
+
+ register o, @emitter.start_mapping(nil, maptag, false, Nodes::Mapping::BLOCK)
@emitter.scalar 'str', nil, nil, true, false, Nodes::Scalar::ANY
@emitter.scalar str, nil, tag, plain, quote, style
@@ -248,16 +270,16 @@ module Psych
def visit_Module o
raise TypeError, "can't dump anonymous module: #{o}" unless o.name
- @emitter.scalar o.name, nil, '!ruby/module', false, false, Nodes::Scalar::SINGLE_QUOTED
+ register o, @emitter.scalar(o.name, nil, '!ruby/module', false, false, Nodes::Scalar::SINGLE_QUOTED)
end
def visit_Class o
raise TypeError, "can't dump anonymous class: #{o}" unless o.name
- @emitter.scalar o.name, nil, '!ruby/class', false, false, Nodes::Scalar::SINGLE_QUOTED
+ register o, @emitter.scalar(o.name, nil, '!ruby/class', false, false, Nodes::Scalar::SINGLE_QUOTED)
end
def visit_Range o
- @emitter.start_mapping nil, '!ruby/range', false, Nodes::Mapping::BLOCK
+ register o, @emitter.start_mapping(nil, '!ruby/range', false, Nodes::Mapping::BLOCK)
['begin', o.begin, 'end', o.end, 'excl', o.exclude_end?].each do |m|
accept m
end
@@ -290,9 +312,13 @@ module Psych
end
def visit_Array o
- register o, @emitter.start_sequence(nil, nil, true, Nodes::Sequence::BLOCK)
- o.each { |c| accept c }
- @emitter.end_sequence
+ if o.class == ::Array
+ register o, @emitter.start_sequence(nil, nil, true, Nodes::Sequence::BLOCK)
+ o.each { |c| accept c }
+ @emitter.end_sequence
+ else
+ visit_array_subclass o
+ end
end
def visit_NilClass o
@@ -304,11 +330,60 @@ module Psych
end
private
- def format_time time
- if time.utc?
- time.strftime("%Y-%m-%d %H:%M:%S.%9N Z")
+ def visit_array_subclass o
+ tag = "!ruby/array:#{o.class}"
+ if o.instance_variables.empty?
+ node = @emitter.start_sequence(nil, tag, false, Nodes::Sequence::BLOCK)
+ register o, node
+ o.each { |c| accept c }
+ @emitter.end_sequence
else
- time.strftime("%Y-%m-%d %H:%M:%S.%9N %:z")
+ node = @emitter.start_mapping(nil, tag, false, Nodes::Sequence::BLOCK)
+ register o, node
+
+ # Dump the internal list
+ accept 'internal'
+ @emitter.start_sequence(nil, nil, true, Nodes::Sequence::BLOCK)
+ o.each { |c| accept c }
+ @emitter.end_sequence
+
+ # Dump the ivars
+ accept 'ivars'
+ @emitter.start_mapping(nil, nil, true, Nodes::Sequence::BLOCK)
+ o.instance_variables.each do |ivar|
+ accept ivar
+ accept o.instance_variable_get ivar
+ end
+ @emitter.end_mapping
+
+ @emitter.end_mapping
+ end
+ end
+
+ def dump_list o
+ end
+
+ # '%:z' was no defined until 1.9.3
+ if RUBY_VERSION < '1.9.3'
+ def format_time time
+ formatted = time.strftime("%Y-%m-%d %H:%M:%S.%9N")
+
+ if time.utc?
+ formatted += " Z"
+ else
+ zone = time.strftime('%z')
+ formatted += " #{zone[0,3]}:#{zone[3,5]}"
+ end
+
+ formatted
+ end
+ else
+ def format_time time
+ if time.utc?
+ time.strftime("%Y-%m-%d %H:%M:%S.%9N Z")
+ else
+ time.strftime("%Y-%m-%d %H:%M:%S.%9N %:z")
+ end
end
end
@@ -336,6 +411,7 @@ module Psych
end
def dump_coder o
+ @coders << o
tag = Psych.dump_tags[o.class]
unless tag
klass = o.class == Object ? nil : o.class.name
diff --git a/ext/psych/lib/psych/y.rb b/ext/psych/lib/psych/y.rb
new file mode 100644
index 0000000000..f20d2e2a66
--- /dev/null
+++ b/ext/psych/lib/psych/y.rb
@@ -0,0 +1,7 @@
+module Kernel
+ def y *objects
+ puts Psych.dump_stream(*objects)
+ end
+ private :y
+end
+
diff --git a/ext/psych/psych.gemspec b/ext/psych/psych.gemspec
new file mode 100644
index 0000000000..c15449c6ae
--- /dev/null
+++ b/ext/psych/psych.gemspec
@@ -0,0 +1,24 @@
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = "psych"
+ s.version = "2.0.0"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Aaron Patterson"]
+ s.date = "2012-11-28"
+ s.description = "Psych is a YAML parser and emitter. Psych leverages libyaml[http://pyyaml.org/wiki/LibYAML]\nfor its YAML parsing and emitting capabilities. In addition to wrapping\nlibyaml, Psych also knows how to serialize and de-serialize most Ruby objects\nto and from the YAML format."
+ s.email = ["aaron@tenderlovemaking.com"]
+ s.extensions = ["ext/psych/extconf.rb"]
+ s.extra_rdoc_files = ["CHANGELOG.rdoc", "Manifest.txt", "README.rdoc"]
+ s.files = [".autotest", ".travis.yml", "CHANGELOG.rdoc", "Manifest.txt", "README.rdoc", "Rakefile", "ext/psych/extconf.rb", "ext/psych/psych.c", "ext/psych/psych.h", "ext/psych/psych_emitter.c", "ext/psych/psych_emitter.h", "ext/psych/psych_parser.c", "ext/psych/psych_parser.h", "ext/psych/psych_to_ruby.c", "ext/psych/psych_to_ruby.h", "ext/psych/psych_yaml_tree.c", "ext/psych/psych_yaml_tree.h", "ext/psych/yaml/LICENSE", "ext/psych/yaml/api.c", "ext/psych/yaml/config.h", "ext/psych/yaml/dumper.c", "ext/psych/yaml/emitter.c", "ext/psych/yaml/loader.c", "ext/psych/yaml/parser.c", "ext/psych/yaml/reader.c", "ext/psych/yaml/scanner.c", "ext/psych/yaml/writer.c", "ext/psych/yaml/yaml.h", "ext/psych/yaml/yaml_private.h", "lib/psych.rb", "lib/psych/coder.rb", "lib/psych/core_ext.rb", "lib/psych/deprecated.rb", "lib/psych/handler.rb", "lib/psych/handlers/document_stream.rb", "lib/psych/handlers/recorder.rb", "lib/psych/json/ruby_events.rb", "lib/psych/json/stream.rb", "lib/psych/json/tree_builder.rb", "lib/psych/json/yaml_events.rb", "lib/psych/nodes.rb", "lib/psych/nodes/alias.rb", "lib/psych/nodes/document.rb", "lib/psych/nodes/mapping.rb", "lib/psych/nodes/node.rb", "lib/psych/nodes/scalar.rb", "lib/psych/nodes/sequence.rb", "lib/psych/nodes/stream.rb", "lib/psych/omap.rb", "lib/psych/parser.rb", "lib/psych/scalar_scanner.rb", "lib/psych/set.rb", "lib/psych/stream.rb", "lib/psych/streaming.rb", "lib/psych/syntax_error.rb", "lib/psych/tree_builder.rb", "lib/psych/visitors.rb", "lib/psych/visitors/depth_first.rb", "lib/psych/visitors/emitter.rb", "lib/psych/visitors/json_tree.rb", "lib/psych/visitors/to_ruby.rb", "lib/psych/visitors/visitor.rb", "lib/psych/visitors/yaml_tree.rb", "lib/psych/y.rb", "test/psych/handlers/test_recorder.rb", "test/psych/helper.rb", "test/psych/json/test_stream.rb", "test/psych/nodes/test_enumerable.rb", "test/psych/test_alias_and_anchor.rb", "test/psych/test_array.rb", "test/psych/test_boolean.rb", "test/psych/test_class.rb", "test/psych/test_coder.rb", "test/psych/test_date_time.rb", "test/psych/test_deprecated.rb", "test/psych/test_document.rb", "test/psych/test_emitter.rb", "test/psych/test_encoding.rb", "test/psych/test_engine_manager.rb", "test/psych/test_exception.rb", "test/psych/test_hash.rb", "test/psych/test_json_tree.rb", "test/psych/test_merge_keys.rb", "test/psych/test_nil.rb", "test/psych/test_null.rb", "test/psych/test_numeric.rb", "test/psych/test_object.rb", "test/psych/test_object_references.rb", "test/psych/test_omap.rb", "test/psych/test_parser.rb", "test/psych/test_psych.rb", "test/psych/test_scalar.rb", "test/psych/test_scalar_scanner.rb", "test/psych/test_serialize_subclasses.rb", "test/psych/test_set.rb", "test/psych/test_stream.rb", "test/psych/test_string.rb", "test/psych/test_struct.rb", "test/psych/test_symbol.rb", "test/psych/test_tainted.rb", "test/psych/test_to_yaml_properties.rb", "test/psych/test_tree_builder.rb", "test/psych/test_yaml.rb", "test/psych/test_yamldbm.rb", "test/psych/test_yamlstore.rb", "test/psych/visitors/test_depth_first.rb", "test/psych/visitors/test_emitter.rb", "test/psych/visitors/test_to_ruby.rb", "test/psych/visitors/test_yaml_tree.rb", ".gemtest"]
+ s.homepage = "http://github.com/tenderlove/psych"
+ s.rdoc_options = ["--main", "README.rdoc"]
+ s.require_paths = ["lib"]
+ s.required_ruby_version = Gem::Requirement.new(">= 1.9.2")
+ s.rubyforge_project = "psych"
+ s.rubygems_version = "1.8.24"
+ s.summary = "Psych is a YAML parser and emitter"
+ s.test_files = ["test/psych/handlers/test_recorder.rb", "test/psych/json/test_stream.rb", "test/psych/nodes/test_enumerable.rb", "test/psych/test_alias_and_anchor.rb", "test/psych/test_array.rb", "test/psych/test_boolean.rb", "test/psych/test_class.rb", "test/psych/test_coder.rb", "test/psych/test_date_time.rb", "test/psych/test_deprecated.rb", "test/psych/test_document.rb", "test/psych/test_emitter.rb", "test/psych/test_encoding.rb", "test/psych/test_engine_manager.rb", "test/psych/test_exception.rb", "test/psych/test_hash.rb", "test/psych/test_json_tree.rb", "test/psych/test_merge_keys.rb", "test/psych/test_nil.rb", "test/psych/test_null.rb", "test/psych/test_numeric.rb", "test/psych/test_object.rb", "test/psych/test_object_references.rb", "test/psych/test_omap.rb", "test/psych/test_parser.rb", "test/psych/test_psych.rb", "test/psych/test_scalar.rb", "test/psych/test_scalar_scanner.rb", "test/psych/test_serialize_subclasses.rb", "test/psych/test_set.rb", "test/psych/test_stream.rb", "test/psych/test_string.rb", "test/psych/test_struct.rb", "test/psych/test_symbol.rb", "test/psych/test_tainted.rb", "test/psych/test_to_yaml_properties.rb", "test/psych/test_tree_builder.rb", "test/psych/test_yaml.rb", "test/psych/test_yamldbm.rb", "test/psych/test_yamlstore.rb", "test/psych/visitors/test_depth_first.rb", "test/psych/visitors/test_emitter.rb", "test/psych/visitors/test_to_ruby.rb", "test/psych/visitors/test_yaml_tree.rb"]
+
+end
diff --git a/ext/psych/psych.h b/ext/psych/psych.h
index 9f1be449a2..1830ca4b19 100644
--- a/ext/psych/psych.h
+++ b/ext/psych/psych.h
@@ -9,10 +9,10 @@
#include <yaml.h>
-#include <parser.h>
-#include <emitter.h>
-#include <to_ruby.h>
-#include <yaml_tree.h>
+#include <psych_parser.h>
+#include <psych_emitter.h>
+#include <psych_to_ruby.h>
+#include <psych_yaml_tree.h>
extern VALUE mPsych;
diff --git a/ext/psych/emitter.c b/ext/psych/psych_emitter.c
index a85fa45ef5..f0d032649c 100644
--- a/ext/psych/emitter.c
+++ b/ext/psych/psych_emitter.c
@@ -2,6 +2,9 @@
VALUE cPsychEmitter;
static ID id_write;
+static ID id_line_width;
+static ID id_indentation;
+static ID id_canonical;
static void emit(yaml_emitter_t * emitter, yaml_event_t * event)
{
@@ -39,15 +42,30 @@ static VALUE allocate(VALUE klass)
return Data_Wrap_Struct(klass, 0, dealloc, emitter);
}
-/* call-seq: Psych::Emitter.new(io)
+/* call-seq: Psych::Emitter.new(io, options = Psych::Emitter::OPTIONS)
*
* Create a new Psych::Emitter that writes to +io+.
*/
-static VALUE initialize(VALUE self, VALUE io)
+static VALUE initialize(int argc, VALUE *argv, VALUE self)
{
yaml_emitter_t * emitter;
+ VALUE io, options;
+ VALUE line_width;
+ VALUE indent;
+ VALUE canonical;
+
Data_Get_Struct(self, yaml_emitter_t, emitter);
+ if (rb_scan_args(argc, argv, "11", &io, &options) == 2) {
+ line_width = rb_funcall(options, id_line_width, 0);
+ indent = rb_funcall(options, id_indentation, 0);
+ canonical = rb_funcall(options, id_canonical, 0);
+
+ yaml_emitter_set_width(emitter, NUM2INT(line_width));
+ yaml_emitter_set_indent(emitter, NUM2INT(indent));
+ yaml_emitter_set_canonical(emitter, Qtrue == canonical ? 1 : 0);
+ }
+
yaml_emitter_set_output(emitter, writer, (void *)io);
return self;
@@ -351,7 +369,7 @@ static VALUE start_mapping(
(yaml_char_t *)(NIL_P(anchor) ? NULL : StringValuePtr(anchor)),
(yaml_char_t *)(NIL_P(tag) ? NULL : StringValuePtr(tag)),
implicit ? 1 : 0,
- (yaml_sequence_style_t)NUM2INT(style)
+ (yaml_mapping_style_t)NUM2INT(style)
);
emit(emitter, &event);
@@ -494,7 +512,7 @@ void Init_psych_emitter()
rb_define_alloc_func(cPsychEmitter, allocate);
- rb_define_method(cPsychEmitter, "initialize", initialize, 1);
+ rb_define_method(cPsychEmitter, "initialize", initialize, -1);
rb_define_method(cPsychEmitter, "start_stream", start_stream, 1);
rb_define_method(cPsychEmitter, "end_stream", end_stream, 0);
rb_define_method(cPsychEmitter, "start_document", start_document, 3);
@@ -512,6 +530,9 @@ void Init_psych_emitter()
rb_define_method(cPsychEmitter, "line_width", line_width, 0);
rb_define_method(cPsychEmitter, "line_width=", set_line_width, 1);
- id_write = rb_intern("write");
+ id_write = rb_intern("write");
+ id_line_width = rb_intern("line_width");
+ id_indentation = rb_intern("indentation");
+ id_canonical = rb_intern("canonical");
}
/* vim: set noet sws=4 sw=4: */
diff --git a/ext/psych/emitter.h b/ext/psych/psych_emitter.h
index 560451ef31..560451ef31 100644
--- a/ext/psych/emitter.h
+++ b/ext/psych/psych_emitter.h
diff --git a/ext/psych/parser.c b/ext/psych/psych_parser.c
index e68768f562..8c65ce1307 100644
--- a/ext/psych/parser.c
+++ b/ext/psych/psych_parser.c
@@ -59,6 +59,164 @@ static VALUE allocate(VALUE klass)
return Data_Wrap_Struct(klass, 0, dealloc, parser);
}
+static VALUE make_exception(yaml_parser_t * parser, VALUE path)
+{
+ size_t line, column;
+
+ line = parser->context_mark.line + 1;
+ column = parser->context_mark.column + 1;
+
+ return rb_funcall(ePsychSyntaxError, rb_intern("new"), 6,
+ path,
+ INT2NUM(line),
+ INT2NUM(column),
+ INT2NUM(parser->problem_offset),
+ parser->problem ? rb_usascii_str_new2(parser->problem) : Qnil,
+ parser->context ? rb_usascii_str_new2(parser->context) : Qnil);
+}
+
+#ifdef HAVE_RUBY_ENCODING_H
+static VALUE transcode_string(VALUE src, int * parser_encoding)
+{
+ int utf8 = rb_utf8_encindex();
+ int utf16le = rb_enc_find_index("UTF-16LE");
+ int utf16be = rb_enc_find_index("UTF-16BE");
+ int source_encoding = rb_enc_get_index(src);
+
+ if (source_encoding == utf8) {
+ *parser_encoding = YAML_UTF8_ENCODING;
+ return src;
+ }
+
+ if (source_encoding == utf16le) {
+ *parser_encoding = YAML_UTF16LE_ENCODING;
+ return src;
+ }
+
+ if (source_encoding == utf16be) {
+ *parser_encoding = YAML_UTF16BE_ENCODING;
+ return src;
+ }
+
+ src = rb_str_export_to_enc(src, rb_utf8_encoding());
+ RB_GC_GUARD(src);
+
+ *parser_encoding = YAML_UTF8_ENCODING;
+ return src;
+}
+
+static VALUE transcode_io(VALUE src, int * parser_encoding)
+{
+ VALUE io_external_encoding;
+ int io_external_enc_index;
+
+ io_external_encoding = rb_funcall(src, rb_intern("external_encoding"), 0);
+
+ /* if no encoding is returned, assume ascii8bit. */
+ if (NIL_P(io_external_encoding)) {
+ io_external_enc_index = rb_ascii8bit_encindex();
+ } else {
+ io_external_enc_index = rb_to_encoding_index(io_external_encoding);
+ }
+
+ /* Treat US-ASCII as utf_8 */
+ if (io_external_enc_index == rb_usascii_encindex()) {
+ *parser_encoding = YAML_UTF8_ENCODING;
+ return src;
+ }
+
+ if (io_external_enc_index == rb_utf8_encindex()) {
+ *parser_encoding = YAML_UTF8_ENCODING;
+ return src;
+ }
+
+ if (io_external_enc_index == rb_enc_find_index("UTF-16LE")) {
+ *parser_encoding = YAML_UTF16LE_ENCODING;
+ return src;
+ }
+
+ if (io_external_enc_index == rb_enc_find_index("UTF-16BE")) {
+ *parser_encoding = YAML_UTF16BE_ENCODING;
+ return src;
+ }
+
+ /* Just guess on ASCII-8BIT */
+ if (io_external_enc_index == rb_ascii8bit_encindex()) {
+ *parser_encoding = YAML_ANY_ENCODING;
+ return src;
+ }
+
+ /* If the external encoding is something we don't know how to handle,
+ * fall back to YAML_ANY_ENCODING. */
+ *parser_encoding = YAML_ANY_ENCODING;
+
+ return src;
+}
+
+#endif
+
+static VALUE protected_start_stream(VALUE pointer)
+{
+ VALUE *args = (VALUE *)pointer;
+ return rb_funcall(args[0], id_start_stream, 1, args[1]);
+}
+
+static VALUE protected_start_document(VALUE pointer)
+{
+ VALUE *args = (VALUE *)pointer;
+ return rb_funcall3(args[0], id_start_document, 3, args + 1);
+}
+
+static VALUE protected_end_document(VALUE pointer)
+{
+ VALUE *args = (VALUE *)pointer;
+ return rb_funcall(args[0], id_end_document, 1, args[1]);
+}
+
+static VALUE protected_alias(VALUE pointer)
+{
+ VALUE *args = (VALUE *)pointer;
+ return rb_funcall(args[0], id_alias, 1, args[1]);
+}
+
+static VALUE protected_scalar(VALUE pointer)
+{
+ VALUE *args = (VALUE *)pointer;
+ return rb_funcall3(args[0], id_scalar, 6, args + 1);
+}
+
+static VALUE protected_start_sequence(VALUE pointer)
+{
+ VALUE *args = (VALUE *)pointer;
+ return rb_funcall3(args[0], id_start_sequence, 4, args + 1);
+}
+
+static VALUE protected_end_sequence(VALUE handler)
+{
+ return rb_funcall(handler, id_end_sequence, 0);
+}
+
+static VALUE protected_start_mapping(VALUE pointer)
+{
+ VALUE *args = (VALUE *)pointer;
+ return rb_funcall3(args[0], id_start_mapping, 4, args + 1);
+}
+
+static VALUE protected_end_mapping(VALUE handler)
+{
+ return rb_funcall(handler, id_end_mapping, 0);
+}
+
+static VALUE protected_empty(VALUE handler)
+{
+ return rb_funcall(handler, id_empty, 0);
+}
+
+static VALUE protected_end_stream(VALUE handler)
+{
+ return rb_funcall(handler, id_end_stream, 0);
+}
+
/*
* call-seq:
* parser.parse(yaml)
@@ -68,27 +226,48 @@ static VALUE allocate(VALUE klass)
*
* See Psych::Parser and Psych::Parser#handler
*/
-static VALUE parse(VALUE self, VALUE yaml)
+static VALUE parse(int argc, VALUE *argv, VALUE self)
{
+ VALUE yaml, path;
yaml_parser_t * parser;
yaml_event_t event;
int done = 0;
int tainted = 0;
+ int state = 0;
+ int parser_encoding = YAML_ANY_ENCODING;
#ifdef HAVE_RUBY_ENCODING_H
int encoding = rb_utf8_encindex();
rb_encoding * internal_enc = rb_default_internal_encoding();
#endif
VALUE handler = rb_iv_get(self, "@handler");
+ if (rb_scan_args(argc, argv, "11", &yaml, &path) == 1) {
+ if(rb_respond_to(yaml, id_path))
+ path = rb_funcall(yaml, id_path, 0);
+ else
+ path = rb_str_new2("<unknown>");
+ }
+
Data_Get_Struct(self, yaml_parser_t, parser);
+ yaml_parser_delete(parser);
+ yaml_parser_initialize(parser);
+
if (OBJ_TAINTED(yaml)) tainted = 1;
- if(rb_respond_to(yaml, id_read)) {
+ if (rb_respond_to(yaml, id_read)) {
+#ifdef HAVE_RUBY_ENCODING_H
+ yaml = transcode_io(yaml, &parser_encoding);
+ yaml_parser_set_encoding(parser, parser_encoding);
+#endif
yaml_parser_set_input(parser, io_reader, (void *)yaml);
if (RTEST(rb_obj_is_kind_of(yaml, rb_cIO))) tainted = 1;
} else {
StringValue(yaml);
+#ifdef HAVE_RUBY_ENCODING_H
+ yaml = transcode_string(yaml, &parser_encoding);
+ yaml_parser_set_encoding(parser, parser_encoding);
+#endif
yaml_parser_set_input_string(
parser,
(const unsigned char *)RSTRING_PTR(yaml),
@@ -98,32 +277,28 @@ static VALUE parse(VALUE self, VALUE yaml)
while(!done) {
if(!yaml_parser_parse(parser, &event)) {
- VALUE path;
- size_t line = parser->mark.line;
- size_t column = parser->mark.column;
-
- if(rb_respond_to(yaml, id_path))
- path = rb_funcall(yaml, id_path, 0);
- else
- path = rb_str_new2("<unknown>");
+ VALUE exception;
+ exception = make_exception(parser, path);
yaml_parser_delete(parser);
yaml_parser_initialize(parser);
- rb_raise(ePsychSyntaxError, "(%s): couldn't parse YAML at line %d column %d",
- StringValuePtr(path),
- (int)line, (int)column);
+ rb_exc_raise(exception);
}
switch(event.type) {
- case YAML_STREAM_START_EVENT:
-
- rb_funcall(handler, id_start_stream, 1,
- INT2NUM((long)event.data.stream_start.encoding)
- );
- break;
+ case YAML_STREAM_START_EVENT:
+ {
+ VALUE args[2];
+
+ args[0] = handler;
+ args[1] = INT2NUM((long)event.data.stream_start.encoding);
+ rb_protect(protected_start_stream, (VALUE)args, &state);
+ }
+ break;
case YAML_DOCUMENT_START_EVENT:
{
+ VALUE args[4];
/* Get a list of tag directives (if any) */
VALUE tag_directives = rb_ary_new();
/* Grab the document version */
@@ -161,19 +336,25 @@ static VALUE parse(VALUE self, VALUE yaml)
rb_ary_push(tag_directives, rb_ary_new3((long)2, handle, prefix));
}
}
- rb_funcall(handler, id_start_document, 3,
- version, tag_directives,
- event.data.document_start.implicit == 1 ? Qtrue : Qfalse
- );
+ args[0] = handler;
+ args[1] = version;
+ args[2] = tag_directives;
+ args[3] = event.data.document_start.implicit == 1 ? Qtrue : Qfalse;
+ rb_protect(protected_start_document, (VALUE)args, &state);
}
break;
case YAML_DOCUMENT_END_EVENT:
- rb_funcall(handler, id_end_document, 1,
- event.data.document_end.implicit == 1 ? Qtrue : Qfalse
- );
+ {
+ VALUE args[2];
+
+ args[0] = handler;
+ args[1] = event.data.document_end.implicit == 1 ? Qtrue : Qfalse;
+ rb_protect(protected_end_document, (VALUE)args, &state);
+ }
break;
case YAML_ALIAS_EVENT:
{
+ VALUE args[2];
VALUE alias = Qnil;
if(event.data.alias.anchor) {
alias = rb_str_new2((const char *)event.data.alias.anchor);
@@ -183,11 +364,14 @@ static VALUE parse(VALUE self, VALUE yaml)
#endif
}
- rb_funcall(handler, id_alias, 1, alias);
+ args[0] = handler;
+ args[1] = alias;
+ rb_protect(protected_alias, (VALUE)args, &state);
}
break;
case YAML_SCALAR_EVENT:
{
+ VALUE args[7];
VALUE anchor = Qnil;
VALUE tag = Qnil;
VALUE plain_implicit, quoted_implicit, style;
@@ -225,12 +409,19 @@ static VALUE parse(VALUE self, VALUE yaml)
style = INT2NUM((long)event.data.scalar.style);
- rb_funcall(handler, id_scalar, 6,
- val, anchor, tag, plain_implicit, quoted_implicit, style);
+ args[0] = handler;
+ args[1] = val;
+ args[2] = anchor;
+ args[3] = tag;
+ args[4] = plain_implicit;
+ args[5] = quoted_implicit;
+ args[6] = style;
+ rb_protect(protected_scalar, (VALUE)args, &state);
}
break;
case YAML_SEQUENCE_START_EVENT:
{
+ VALUE args[5];
VALUE anchor = Qnil;
VALUE tag = Qnil;
VALUE implicit, style;
@@ -256,15 +447,21 @@ static VALUE parse(VALUE self, VALUE yaml)
style = INT2NUM((long)event.data.sequence_start.style);
- rb_funcall(handler, id_start_sequence, 4,
- anchor, tag, implicit, style);
+ args[0] = handler;
+ args[1] = anchor;
+ args[2] = tag;
+ args[3] = implicit;
+ args[4] = style;
+
+ rb_protect(protected_start_sequence, (VALUE)args, &state);
}
break;
case YAML_SEQUENCE_END_EVENT:
- rb_funcall(handler, id_end_sequence, 0);
+ rb_protect(protected_end_sequence, handler, &state);
break;
case YAML_MAPPING_START_EVENT:
{
+ VALUE args[5];
VALUE anchor = Qnil;
VALUE tag = Qnil;
VALUE implicit, style;
@@ -289,22 +486,28 @@ static VALUE parse(VALUE self, VALUE yaml)
style = INT2NUM((long)event.data.mapping_start.style);
- rb_funcall(handler, id_start_mapping, 4,
- anchor, tag, implicit, style);
+ args[0] = handler;
+ args[1] = anchor;
+ args[2] = tag;
+ args[3] = implicit;
+ args[4] = style;
+
+ rb_protect(protected_start_mapping, (VALUE)args, &state);
}
break;
case YAML_MAPPING_END_EVENT:
- rb_funcall(handler, id_end_mapping, 0);
+ rb_protect(protected_end_mapping, handler, &state);
break;
case YAML_NO_EVENT:
- rb_funcall(handler, id_empty, 0);
+ rb_protect(protected_empty, handler, &state);
break;
case YAML_STREAM_END_EVENT:
- rb_funcall(handler, id_end_stream, 0);
+ rb_protect(protected_end_stream, handler, &state);
done = 1;
break;
}
yaml_event_delete(&event);
+ if (state) rb_jump_tag(state);
}
return self;
@@ -312,29 +515,6 @@ static VALUE parse(VALUE self, VALUE yaml)
/*
* call-seq:
- * parser.external_encoding=(encoding)
- *
- * Set the encoding for this parser to +encoding+
- */
-static VALUE set_external_encoding(VALUE self, VALUE encoding)
-{
- yaml_parser_t * parser;
- VALUE exception;
-
- Data_Get_Struct(self, yaml_parser_t, parser);
-
- if(parser->encoding) {
- exception = rb_const_get_at(mPsych, rb_intern("Exception"));
- rb_raise(exception, "don't set the encoding twice!");
- }
-
- yaml_parser_set_encoding(parser, NUM2INT(encoding));
-
- return encoding;
-}
-
-/*
- * call-seq:
* parser.mark # => #<Psych::Parser::Mark>
*
* Returns a Psych::Parser::Mark object that contains line, column, and index
@@ -376,11 +556,11 @@ void Init_psych_parser()
/* UTF-16-BE Encoding with BOM */
rb_define_const(cPsychParser, "UTF16BE", INT2NUM(YAML_UTF16BE_ENCODING));
- ePsychSyntaxError = rb_define_class_under(mPsych, "SyntaxError", rb_eSyntaxError);
+ rb_require("psych/syntax_error");
+ ePsychSyntaxError = rb_const_get(mPsych, rb_intern("SyntaxError"));
- rb_define_method(cPsychParser, "parse", parse, 1);
+ rb_define_method(cPsychParser, "parse", parse, -1);
rb_define_method(cPsychParser, "mark", mark, 0);
- rb_define_method(cPsychParser, "external_encoding=", set_external_encoding, 1);
id_read = rb_intern("read");
id_path = rb_intern("path");
diff --git a/ext/psych/parser.h b/ext/psych/psych_parser.h
index 25e896f01d..25e896f01d 100644
--- a/ext/psych/parser.h
+++ b/ext/psych/psych_parser.h
diff --git a/ext/psych/to_ruby.c b/ext/psych/psych_to_ruby.c
index ed5245e12e..ed5245e12e 100644
--- a/ext/psych/to_ruby.c
+++ b/ext/psych/psych_to_ruby.c
diff --git a/ext/psych/to_ruby.h b/ext/psych/psych_to_ruby.h
index 7b8e757a45..7b8e757a45 100644
--- a/ext/psych/to_ruby.h
+++ b/ext/psych/psych_to_ruby.h
diff --git a/ext/psych/yaml_tree.c b/ext/psych/psych_yaml_tree.c
index bcf24d2070..bcf24d2070 100644
--- a/ext/psych/yaml_tree.c
+++ b/ext/psych/psych_yaml_tree.c
diff --git a/ext/psych/yaml_tree.h b/ext/psych/psych_yaml_tree.h
index 4628a69d71..4628a69d71 100644
--- a/ext/psych/yaml_tree.h
+++ b/ext/psych/psych_yaml_tree.h
diff --git a/ext/psych/yaml/LICENSE b/ext/psych/yaml/LICENSE
new file mode 100644
index 0000000000..050ced23f6
--- /dev/null
+++ b/ext/psych/yaml/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2006 Kirill Simonov
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/ext/psych/yaml/api.c b/ext/psych/yaml/api.c
new file mode 100644
index 0000000000..0c4732e152
--- /dev/null
+++ b/ext/psych/yaml/api.c
@@ -0,0 +1,1392 @@
+
+#include "yaml_private.h"
+
+/*
+ * Get the library version.
+ */
+
+YAML_DECLARE(const char *)
+yaml_get_version_string(void)
+{
+ return YAML_VERSION_STRING;
+}
+
+/*
+ * Get the library version numbers.
+ */
+
+YAML_DECLARE(void)
+yaml_get_version(int *major, int *minor, int *patch)
+{
+ *major = YAML_VERSION_MAJOR;
+ *minor = YAML_VERSION_MINOR;
+ *patch = YAML_VERSION_PATCH;
+}
+
+/*
+ * Allocate a dynamic memory block.
+ */
+
+YAML_DECLARE(void *)
+yaml_malloc(size_t size)
+{
+ return malloc(size ? size : 1);
+}
+
+/*
+ * Reallocate a dynamic memory block.
+ */
+
+YAML_DECLARE(void *)
+yaml_realloc(void *ptr, size_t size)
+{
+ return ptr ? realloc(ptr, size ? size : 1) : malloc(size ? size : 1);
+}
+
+/*
+ * Free a dynamic memory block.
+ */
+
+YAML_DECLARE(void)
+yaml_free(void *ptr)
+{
+ if (ptr) free(ptr);
+}
+
+/*
+ * Duplicate a string.
+ */
+
+YAML_DECLARE(yaml_char_t *)
+yaml_strdup(const yaml_char_t *str)
+{
+ if (!str)
+ return NULL;
+
+ return (yaml_char_t *)strdup((char *)str);
+}
+
+/*
+ * Extend a string.
+ */
+
+YAML_DECLARE(int)
+yaml_string_extend(yaml_char_t **start,
+ yaml_char_t **pointer, yaml_char_t **end)
+{
+ yaml_char_t *new_start = yaml_realloc(*start, (*end - *start)*2);
+
+ if (!new_start) return 0;
+
+ memset(new_start + (*end - *start), 0, *end - *start);
+
+ *pointer = new_start + (*pointer - *start);
+ *end = new_start + (*end - *start)*2;
+ *start = new_start;
+
+ return 1;
+}
+
+/*
+ * Append a string B to a string A.
+ */
+
+YAML_DECLARE(int)
+yaml_string_join(
+ yaml_char_t **a_start, yaml_char_t **a_pointer, yaml_char_t **a_end,
+ yaml_char_t **b_start, yaml_char_t **b_pointer, yaml_char_t **b_end)
+{
+ if (*b_start == *b_pointer)
+ return 1;
+
+ while (*a_end - *a_pointer <= *b_pointer - *b_start) {
+ if (!yaml_string_extend(a_start, a_pointer, a_end))
+ return 0;
+ }
+
+ memcpy(*a_pointer, *b_start, *b_pointer - *b_start);
+ *a_pointer += *b_pointer - *b_start;
+
+ return 1;
+}
+
+/*
+ * Extend a stack.
+ */
+
+YAML_DECLARE(int)
+yaml_stack_extend(void **start, void **top, void **end)
+{
+ void *new_start = yaml_realloc(*start, ((char *)*end - (char *)*start)*2);
+
+ if (!new_start) return 0;
+
+ *top = (char *)new_start + ((char *)*top - (char *)*start);
+ *end = (char *)new_start + ((char *)*end - (char *)*start)*2;
+ *start = new_start;
+
+ return 1;
+}
+
+/*
+ * Extend or move a queue.
+ */
+
+YAML_DECLARE(int)
+yaml_queue_extend(void **start, void **head, void **tail, void **end)
+{
+ /* Check if we need to resize the queue. */
+
+ if (*start == *head && *tail == *end) {
+ void *new_start = yaml_realloc(*start,
+ ((char *)*end - (char *)*start)*2);
+
+ if (!new_start) return 0;
+
+ *head = (char *)new_start + ((char *)*head - (char *)*start);
+ *tail = (char *)new_start + ((char *)*tail - (char *)*start);
+ *end = (char *)new_start + ((char *)*end - (char *)*start)*2;
+ *start = new_start;
+ }
+
+ /* Check if we need to move the queue at the beginning of the buffer. */
+
+ if (*tail == *end) {
+ if (*head != *tail) {
+ memmove(*start, *head, (char *)*tail - (char *)*head);
+ }
+ *tail = (char *)*tail - (char *)*head + (char *)*start;
+ *head = *start;
+ }
+
+ return 1;
+}
+
+
+/*
+ * Create a new parser object.
+ */
+
+YAML_DECLARE(int)
+yaml_parser_initialize(yaml_parser_t *parser)
+{
+ assert(parser); /* Non-NULL parser object expected. */
+
+ memset(parser, 0, sizeof(yaml_parser_t));
+ if (!BUFFER_INIT(parser, parser->raw_buffer, INPUT_RAW_BUFFER_SIZE))
+ goto error;
+ if (!BUFFER_INIT(parser, parser->buffer, INPUT_BUFFER_SIZE))
+ goto error;
+ if (!QUEUE_INIT(parser, parser->tokens, INITIAL_QUEUE_SIZE))
+ goto error;
+ if (!STACK_INIT(parser, parser->indents, INITIAL_STACK_SIZE))
+ goto error;
+ if (!STACK_INIT(parser, parser->simple_keys, INITIAL_STACK_SIZE))
+ goto error;
+ if (!STACK_INIT(parser, parser->states, INITIAL_STACK_SIZE))
+ goto error;
+ if (!STACK_INIT(parser, parser->marks, INITIAL_STACK_SIZE))
+ goto error;
+ if (!STACK_INIT(parser, parser->tag_directives, INITIAL_STACK_SIZE))
+ goto error;
+
+ return 1;
+
+error:
+
+ BUFFER_DEL(parser, parser->raw_buffer);
+ BUFFER_DEL(parser, parser->buffer);
+ QUEUE_DEL(parser, parser->tokens);
+ STACK_DEL(parser, parser->indents);
+ STACK_DEL(parser, parser->simple_keys);
+ STACK_DEL(parser, parser->states);
+ STACK_DEL(parser, parser->marks);
+ STACK_DEL(parser, parser->tag_directives);
+
+ return 0;
+}
+
+/*
+ * Destroy a parser object.
+ */
+
+YAML_DECLARE(void)
+yaml_parser_delete(yaml_parser_t *parser)
+{
+ assert(parser); /* Non-NULL parser object expected. */
+
+ BUFFER_DEL(parser, parser->raw_buffer);
+ BUFFER_DEL(parser, parser->buffer);
+ while (!QUEUE_EMPTY(parser, parser->tokens)) {
+ yaml_token_delete(&DEQUEUE(parser, parser->tokens));
+ }
+ QUEUE_DEL(parser, parser->tokens);
+ STACK_DEL(parser, parser->indents);
+ STACK_DEL(parser, parser->simple_keys);
+ STACK_DEL(parser, parser->states);
+ STACK_DEL(parser, parser->marks);
+ while (!STACK_EMPTY(parser, parser->tag_directives)) {
+ yaml_tag_directive_t tag_directive = POP(parser, parser->tag_directives);
+ yaml_free(tag_directive.handle);
+ yaml_free(tag_directive.prefix);
+ }
+ STACK_DEL(parser, parser->tag_directives);
+
+ memset(parser, 0, sizeof(yaml_parser_t));
+}
+
+/*
+ * String read handler.
+ */
+
+static int
+yaml_string_read_handler(void *data, unsigned char *buffer, size_t size,
+ size_t *size_read)
+{
+ yaml_parser_t *parser = data;
+
+ if (parser->input.string.current == parser->input.string.end) {
+ *size_read = 0;
+ return 1;
+ }
+
+ if (size > (size_t)(parser->input.string.end
+ - parser->input.string.current)) {
+ size = parser->input.string.end - parser->input.string.current;
+ }
+
+ memcpy(buffer, parser->input.string.current, size);
+ parser->input.string.current += size;
+ *size_read = size;
+ return 1;
+}
+
+/*
+ * File read handler.
+ */
+
+static int
+yaml_file_read_handler(void *data, unsigned char *buffer, size_t size,
+ size_t *size_read)
+{
+ yaml_parser_t *parser = data;
+
+ *size_read = fread(buffer, 1, size, parser->input.file);
+ return !ferror(parser->input.file);
+}
+
+/*
+ * Set a string input.
+ */
+
+YAML_DECLARE(void)
+yaml_parser_set_input_string(yaml_parser_t *parser,
+ const unsigned char *input, size_t size)
+{
+ assert(parser); /* Non-NULL parser object expected. */
+ assert(!parser->read_handler); /* You can set the source only once. */
+ assert(input); /* Non-NULL input string expected. */
+
+ parser->read_handler = yaml_string_read_handler;
+ parser->read_handler_data = parser;
+
+ parser->input.string.start = input;
+ parser->input.string.current = input;
+ parser->input.string.end = input+size;
+}
+
+/*
+ * Set a file input.
+ */
+
+YAML_DECLARE(void)
+yaml_parser_set_input_file(yaml_parser_t *parser, FILE *file)
+{
+ assert(parser); /* Non-NULL parser object expected. */
+ assert(!parser->read_handler); /* You can set the source only once. */
+ assert(file); /* Non-NULL file object expected. */
+
+ parser->read_handler = yaml_file_read_handler;
+ parser->read_handler_data = parser;
+
+ parser->input.file = file;
+}
+
+/*
+ * Set a generic input.
+ */
+
+YAML_DECLARE(void)
+yaml_parser_set_input(yaml_parser_t *parser,
+ yaml_read_handler_t *handler, void *data)
+{
+ assert(parser); /* Non-NULL parser object expected. */
+ assert(!parser->read_handler); /* You can set the source only once. */
+ assert(handler); /* Non-NULL read handler expected. */
+
+ parser->read_handler = handler;
+ parser->read_handler_data = data;
+}
+
+/*
+ * Set the source encoding.
+ */
+
+YAML_DECLARE(void)
+yaml_parser_set_encoding(yaml_parser_t *parser, yaml_encoding_t encoding)
+{
+ assert(parser); /* Non-NULL parser object expected. */
+ assert(!parser->encoding); /* Encoding is already set or detected. */
+
+ parser->encoding = encoding;
+}
+
+/*
+ * Create a new emitter object.
+ */
+
+YAML_DECLARE(int)
+yaml_emitter_initialize(yaml_emitter_t *emitter)
+{
+ assert(emitter); /* Non-NULL emitter object expected. */
+
+ memset(emitter, 0, sizeof(yaml_emitter_t));
+ if (!BUFFER_INIT(emitter, emitter->buffer, OUTPUT_BUFFER_SIZE))
+ goto error;
+ if (!BUFFER_INIT(emitter, emitter->raw_buffer, OUTPUT_RAW_BUFFER_SIZE))
+ goto error;
+ if (!STACK_INIT(emitter, emitter->states, INITIAL_STACK_SIZE))
+ goto error;
+ if (!QUEUE_INIT(emitter, emitter->events, INITIAL_QUEUE_SIZE))
+ goto error;
+ if (!STACK_INIT(emitter, emitter->indents, INITIAL_STACK_SIZE))
+ goto error;
+ if (!STACK_INIT(emitter, emitter->tag_directives, INITIAL_STACK_SIZE))
+ goto error;
+
+ return 1;
+
+error:
+
+ BUFFER_DEL(emitter, emitter->buffer);
+ BUFFER_DEL(emitter, emitter->raw_buffer);
+ STACK_DEL(emitter, emitter->states);
+ QUEUE_DEL(emitter, emitter->events);
+ STACK_DEL(emitter, emitter->indents);
+ STACK_DEL(emitter, emitter->tag_directives);
+
+ return 0;
+}
+
+/*
+ * Destroy an emitter object.
+ */
+
+YAML_DECLARE(void)
+yaml_emitter_delete(yaml_emitter_t *emitter)
+{
+ assert(emitter); /* Non-NULL emitter object expected. */
+
+ BUFFER_DEL(emitter, emitter->buffer);
+ BUFFER_DEL(emitter, emitter->raw_buffer);
+ STACK_DEL(emitter, emitter->states);
+ while (!QUEUE_EMPTY(emitter, emitter->events)) {
+ yaml_event_delete(&DEQUEUE(emitter, emitter->events));
+ }
+ QUEUE_DEL(emitter, emitter->events);
+ STACK_DEL(emitter, emitter->indents);
+ while (!STACK_EMPTY(empty, emitter->tag_directives)) {
+ yaml_tag_directive_t tag_directive = POP(emitter, emitter->tag_directives);
+ yaml_free(tag_directive.handle);
+ yaml_free(tag_directive.prefix);
+ }
+ STACK_DEL(emitter, emitter->tag_directives);
+ yaml_free(emitter->anchors);
+
+ memset(emitter, 0, sizeof(yaml_emitter_t));
+}
+
+/*
+ * String write handler.
+ */
+
+static int
+yaml_string_write_handler(void *data, unsigned char *buffer, size_t size)
+{
+ yaml_emitter_t *emitter = data;
+
+ if (emitter->output.string.size + *emitter->output.string.size_written
+ < size) {
+ memcpy(emitter->output.string.buffer
+ + *emitter->output.string.size_written,
+ buffer,
+ emitter->output.string.size
+ - *emitter->output.string.size_written);
+ *emitter->output.string.size_written = emitter->output.string.size;
+ return 0;
+ }
+
+ memcpy(emitter->output.string.buffer
+ + *emitter->output.string.size_written, buffer, size);
+ *emitter->output.string.size_written += size;
+ return 1;
+}
+
+/*
+ * File write handler.
+ */
+
+static int
+yaml_file_write_handler(void *data, unsigned char *buffer, size_t size)
+{
+ yaml_emitter_t *emitter = data;
+
+ return (fwrite(buffer, 1, size, emitter->output.file) == size);
+}
+/*
+ * Set a string output.
+ */
+
+YAML_DECLARE(void)
+yaml_emitter_set_output_string(yaml_emitter_t *emitter,
+ unsigned char *output, size_t size, size_t *size_written)
+{
+ assert(emitter); /* Non-NULL emitter object expected. */
+ assert(!emitter->write_handler); /* You can set the output only once. */
+ assert(output); /* Non-NULL output string expected. */
+
+ emitter->write_handler = yaml_string_write_handler;
+ emitter->write_handler_data = emitter;
+
+ emitter->output.string.buffer = output;
+ emitter->output.string.size = size;
+ emitter->output.string.size_written = size_written;
+ *size_written = 0;
+}
+
+/*
+ * Set a file output.
+ */
+
+YAML_DECLARE(void)
+yaml_emitter_set_output_file(yaml_emitter_t *emitter, FILE *file)
+{
+ assert(emitter); /* Non-NULL emitter object expected. */
+ assert(!emitter->write_handler); /* You can set the output only once. */
+ assert(file); /* Non-NULL file object expected. */
+
+ emitter->write_handler = yaml_file_write_handler;
+ emitter->write_handler_data = emitter;
+
+ emitter->output.file = file;
+}
+
+/*
+ * Set a generic output handler.
+ */
+
+YAML_DECLARE(void)
+yaml_emitter_set_output(yaml_emitter_t *emitter,
+ yaml_write_handler_t *handler, void *data)
+{
+ assert(emitter); /* Non-NULL emitter object expected. */
+ assert(!emitter->write_handler); /* You can set the output only once. */
+ assert(handler); /* Non-NULL handler object expected. */
+
+ emitter->write_handler = handler;
+ emitter->write_handler_data = data;
+}
+
+/*
+ * Set the output encoding.
+ */
+
+YAML_DECLARE(void)
+yaml_emitter_set_encoding(yaml_emitter_t *emitter, yaml_encoding_t encoding)
+{
+ assert(emitter); /* Non-NULL emitter object expected. */
+ assert(!emitter->encoding); /* You can set encoding only once. */
+
+ emitter->encoding = encoding;
+}
+
+/*
+ * Set the canonical output style.
+ */
+
+YAML_DECLARE(void)
+yaml_emitter_set_canonical(yaml_emitter_t *emitter, int canonical)
+{
+ assert(emitter); /* Non-NULL emitter object expected. */
+
+ emitter->canonical = (canonical != 0);
+}
+
+/*
+ * Set the indentation increment.
+ */
+
+YAML_DECLARE(void)
+yaml_emitter_set_indent(yaml_emitter_t *emitter, int indent)
+{
+ assert(emitter); /* Non-NULL emitter object expected. */
+
+ emitter->best_indent = (1 < indent && indent < 10) ? indent : 2;
+}
+
+/*
+ * Set the preferred line width.
+ */
+
+YAML_DECLARE(void)
+yaml_emitter_set_width(yaml_emitter_t *emitter, int width)
+{
+ assert(emitter); /* Non-NULL emitter object expected. */
+
+ emitter->best_width = (width >= 0) ? width : -1;
+}
+
+/*
+ * Set if unescaped non-ASCII characters are allowed.
+ */
+
+YAML_DECLARE(void)
+yaml_emitter_set_unicode(yaml_emitter_t *emitter, int unicode)
+{
+ assert(emitter); /* Non-NULL emitter object expected. */
+
+ emitter->unicode = (unicode != 0);
+}
+
+/*
+ * Set the preferred line break character.
+ */
+
+YAML_DECLARE(void)
+yaml_emitter_set_break(yaml_emitter_t *emitter, yaml_break_t line_break)
+{
+ assert(emitter); /* Non-NULL emitter object expected. */
+
+ emitter->line_break = line_break;
+}
+
+/*
+ * Destroy a token object.
+ */
+
+YAML_DECLARE(void)
+yaml_token_delete(yaml_token_t *token)
+{
+ assert(token); /* Non-NULL token object expected. */
+
+ switch (token->type)
+ {
+ case YAML_TAG_DIRECTIVE_TOKEN:
+ yaml_free(token->data.tag_directive.handle);
+ yaml_free(token->data.tag_directive.prefix);
+ break;
+
+ case YAML_ALIAS_TOKEN:
+ yaml_free(token->data.alias.value);
+ break;
+
+ case YAML_ANCHOR_TOKEN:
+ yaml_free(token->data.anchor.value);
+ break;
+
+ case YAML_TAG_TOKEN:
+ yaml_free(token->data.tag.handle);
+ yaml_free(token->data.tag.suffix);
+ break;
+
+ case YAML_SCALAR_TOKEN:
+ yaml_free(token->data.scalar.value);
+ break;
+
+ default:
+ break;
+ }
+
+ memset(token, 0, sizeof(yaml_token_t));
+}
+
+/*
+ * Check if a string is a valid UTF-8 sequence.
+ *
+ * Check 'reader.c' for more details on UTF-8 encoding.
+ */
+
+static int
+yaml_check_utf8(yaml_char_t *start, size_t length)
+{
+ yaml_char_t *end = start+length;
+ yaml_char_t *pointer = start;
+
+ while (pointer < end) {
+ unsigned char octet;
+ unsigned int width;
+ unsigned int value;
+ size_t k;
+
+ octet = pointer[0];
+ width = (octet & 0x80) == 0x00 ? 1 :
+ (octet & 0xE0) == 0xC0 ? 2 :
+ (octet & 0xF0) == 0xE0 ? 3 :
+ (octet & 0xF8) == 0xF0 ? 4 : 0;
+ value = (octet & 0x80) == 0x00 ? octet & 0x7F :
+ (octet & 0xE0) == 0xC0 ? octet & 0x1F :
+ (octet & 0xF0) == 0xE0 ? octet & 0x0F :
+ (octet & 0xF8) == 0xF0 ? octet & 0x07 : 0;
+ if (!width) return 0;
+ if (pointer+width > end) return 0;
+ for (k = 1; k < width; k ++) {
+ octet = pointer[k];
+ if ((octet & 0xC0) != 0x80) return 0;
+ value = (value << 6) + (octet & 0x3F);
+ }
+ if (!((width == 1) ||
+ (width == 2 && value >= 0x80) ||
+ (width == 3 && value >= 0x800) ||
+ (width == 4 && value >= 0x10000))) return 0;
+
+ pointer += width;
+ }
+
+ return 1;
+}
+
+/*
+ * Create STREAM-START.
+ */
+
+YAML_DECLARE(int)
+yaml_stream_start_event_initialize(yaml_event_t *event,
+ yaml_encoding_t encoding)
+{
+ yaml_mark_t mark = { 0, 0, 0 };
+
+ assert(event); /* Non-NULL event object is expected. */
+
+ STREAM_START_EVENT_INIT(*event, encoding, mark, mark);
+
+ return 1;
+}
+
+/*
+ * Create STREAM-END.
+ */
+
+YAML_DECLARE(int)
+yaml_stream_end_event_initialize(yaml_event_t *event)
+{
+ yaml_mark_t mark = { 0, 0, 0 };
+
+ assert(event); /* Non-NULL event object is expected. */
+
+ STREAM_END_EVENT_INIT(*event, mark, mark);
+
+ return 1;
+}
+
+/*
+ * Create DOCUMENT-START.
+ */
+
+YAML_DECLARE(int)
+yaml_document_start_event_initialize(yaml_event_t *event,
+ yaml_version_directive_t *version_directive,
+ yaml_tag_directive_t *tag_directives_start,
+ yaml_tag_directive_t *tag_directives_end,
+ int implicit)
+{
+ struct {
+ yaml_error_type_t error;
+ } context;
+ yaml_mark_t mark = { 0, 0, 0 };
+ yaml_version_directive_t *version_directive_copy = NULL;
+ struct {
+ yaml_tag_directive_t *start;
+ yaml_tag_directive_t *end;
+ yaml_tag_directive_t *top;
+ } tag_directives_copy = { NULL, NULL, NULL };
+ yaml_tag_directive_t value = { NULL, NULL };
+
+ assert(event); /* Non-NULL event object is expected. */
+ assert((tag_directives_start && tag_directives_end) ||
+ (tag_directives_start == tag_directives_end));
+ /* Valid tag directives are expected. */
+
+ if (version_directive) {
+ version_directive_copy = yaml_malloc(sizeof(yaml_version_directive_t));
+ if (!version_directive_copy) goto error;
+ version_directive_copy->major = version_directive->major;
+ version_directive_copy->minor = version_directive->minor;
+ }
+
+ if (tag_directives_start != tag_directives_end) {
+ yaml_tag_directive_t *tag_directive;
+ if (!STACK_INIT(&context, tag_directives_copy, INITIAL_STACK_SIZE))
+ goto error;
+ for (tag_directive = tag_directives_start;
+ tag_directive != tag_directives_end; tag_directive ++) {
+ assert(tag_directive->handle);
+ assert(tag_directive->prefix);
+ if (!yaml_check_utf8(tag_directive->handle,
+ strlen((char *)tag_directive->handle)))
+ goto error;
+ if (!yaml_check_utf8(tag_directive->prefix,
+ strlen((char *)tag_directive->prefix)))
+ goto error;
+ value.handle = yaml_strdup(tag_directive->handle);
+ value.prefix = yaml_strdup(tag_directive->prefix);
+ if (!value.handle || !value.prefix) goto error;
+ if (!PUSH(&context, tag_directives_copy, value))
+ goto error;
+ value.handle = NULL;
+ value.prefix = NULL;
+ }
+ }
+
+ DOCUMENT_START_EVENT_INIT(*event, version_directive_copy,
+ tag_directives_copy.start, tag_directives_copy.top,
+ implicit, mark, mark);
+
+ return 1;
+
+error:
+ yaml_free(version_directive_copy);
+ while (!STACK_EMPTY(context, tag_directives_copy)) {
+ yaml_tag_directive_t value = POP(context, tag_directives_copy);
+ yaml_free(value.handle);
+ yaml_free(value.prefix);
+ }
+ STACK_DEL(context, tag_directives_copy);
+ yaml_free(value.handle);
+ yaml_free(value.prefix);
+
+ return 0;
+}
+
+/*
+ * Create DOCUMENT-END.
+ */
+
+YAML_DECLARE(int)
+yaml_document_end_event_initialize(yaml_event_t *event, int implicit)
+{
+ yaml_mark_t mark = { 0, 0, 0 };
+
+ assert(event); /* Non-NULL emitter object is expected. */
+
+ DOCUMENT_END_EVENT_INIT(*event, implicit, mark, mark);
+
+ return 1;
+}
+
+/*
+ * Create ALIAS.
+ */
+
+YAML_DECLARE(int)
+yaml_alias_event_initialize(yaml_event_t *event, yaml_char_t *anchor)
+{
+ yaml_mark_t mark = { 0, 0, 0 };
+ yaml_char_t *anchor_copy = NULL;
+
+ assert(event); /* Non-NULL event object is expected. */
+ assert(anchor); /* Non-NULL anchor is expected. */
+
+ if (!yaml_check_utf8(anchor, strlen((char *)anchor))) return 0;
+
+ anchor_copy = yaml_strdup(anchor);
+ if (!anchor_copy)
+ return 0;
+
+ ALIAS_EVENT_INIT(*event, anchor_copy, mark, mark);
+
+ return 1;
+}
+
+/*
+ * Create SCALAR.
+ */
+
+YAML_DECLARE(int)
+yaml_scalar_event_initialize(yaml_event_t *event,
+ yaml_char_t *anchor, yaml_char_t *tag,
+ yaml_char_t *value, int length,
+ int plain_implicit, int quoted_implicit,
+ yaml_scalar_style_t style)
+{
+ yaml_mark_t mark = { 0, 0, 0 };
+ yaml_char_t *anchor_copy = NULL;
+ yaml_char_t *tag_copy = NULL;
+ yaml_char_t *value_copy = NULL;
+
+ assert(event); /* Non-NULL event object is expected. */
+ assert(value); /* Non-NULL anchor is expected. */
+
+ if (anchor) {
+ if (!yaml_check_utf8(anchor, strlen((char *)anchor))) goto error;
+ anchor_copy = yaml_strdup(anchor);
+ if (!anchor_copy) goto error;
+ }
+
+ if (tag) {
+ if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error;
+ tag_copy = yaml_strdup(tag);
+ if (!tag_copy) goto error;
+ }
+
+ if (length < 0) {
+ length = strlen((char *)value);
+ }
+
+ if (!yaml_check_utf8(value, length)) goto error;
+ value_copy = yaml_malloc(length+1);
+ if (!value_copy) goto error;
+ memcpy(value_copy, value, length);
+ value_copy[length] = '\0';
+
+ SCALAR_EVENT_INIT(*event, anchor_copy, tag_copy, value_copy, length,
+ plain_implicit, quoted_implicit, style, mark, mark);
+
+ return 1;
+
+error:
+ yaml_free(anchor_copy);
+ yaml_free(tag_copy);
+ yaml_free(value_copy);
+
+ return 0;
+}
+
+/*
+ * Create SEQUENCE-START.
+ */
+
+YAML_DECLARE(int)
+yaml_sequence_start_event_initialize(yaml_event_t *event,
+ yaml_char_t *anchor, yaml_char_t *tag, int implicit,
+ yaml_sequence_style_t style)
+{
+ yaml_mark_t mark = { 0, 0, 0 };
+ yaml_char_t *anchor_copy = NULL;
+ yaml_char_t *tag_copy = NULL;
+
+ assert(event); /* Non-NULL event object is expected. */
+
+ if (anchor) {
+ if (!yaml_check_utf8(anchor, strlen((char *)anchor))) goto error;
+ anchor_copy = yaml_strdup(anchor);
+ if (!anchor_copy) goto error;
+ }
+
+ if (tag) {
+ if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error;
+ tag_copy = yaml_strdup(tag);
+ if (!tag_copy) goto error;
+ }
+
+ SEQUENCE_START_EVENT_INIT(*event, anchor_copy, tag_copy,
+ implicit, style, mark, mark);
+
+ return 1;
+
+error:
+ yaml_free(anchor_copy);
+ yaml_free(tag_copy);
+
+ return 0;
+}
+
+/*
+ * Create SEQUENCE-END.
+ */
+
+YAML_DECLARE(int)
+yaml_sequence_end_event_initialize(yaml_event_t *event)
+{
+ yaml_mark_t mark = { 0, 0, 0 };
+
+ assert(event); /* Non-NULL event object is expected. */
+
+ SEQUENCE_END_EVENT_INIT(*event, mark, mark);
+
+ return 1;
+}
+
+/*
+ * Create MAPPING-START.
+ */
+
+YAML_DECLARE(int)
+yaml_mapping_start_event_initialize(yaml_event_t *event,
+ yaml_char_t *anchor, yaml_char_t *tag, int implicit,
+ yaml_mapping_style_t style)
+{
+ yaml_mark_t mark = { 0, 0, 0 };
+ yaml_char_t *anchor_copy = NULL;
+ yaml_char_t *tag_copy = NULL;
+
+ assert(event); /* Non-NULL event object is expected. */
+
+ if (anchor) {
+ if (!yaml_check_utf8(anchor, strlen((char *)anchor))) goto error;
+ anchor_copy = yaml_strdup(anchor);
+ if (!anchor_copy) goto error;
+ }
+
+ if (tag) {
+ if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error;
+ tag_copy = yaml_strdup(tag);
+ if (!tag_copy) goto error;
+ }
+
+ MAPPING_START_EVENT_INIT(*event, anchor_copy, tag_copy,
+ implicit, style, mark, mark);
+
+ return 1;
+
+error:
+ yaml_free(anchor_copy);
+ yaml_free(tag_copy);
+
+ return 0;
+}
+
+/*
+ * Create MAPPING-END.
+ */
+
+YAML_DECLARE(int)
+yaml_mapping_end_event_initialize(yaml_event_t *event)
+{
+ yaml_mark_t mark = { 0, 0, 0 };
+
+ assert(event); /* Non-NULL event object is expected. */
+
+ MAPPING_END_EVENT_INIT(*event, mark, mark);
+
+ return 1;
+}
+
+/*
+ * Destroy an event object.
+ */
+
+YAML_DECLARE(void)
+yaml_event_delete(yaml_event_t *event)
+{
+ yaml_tag_directive_t *tag_directive;
+
+ assert(event); /* Non-NULL event object expected. */
+
+ switch (event->type)
+ {
+ case YAML_DOCUMENT_START_EVENT:
+ yaml_free(event->data.document_start.version_directive);
+ for (tag_directive = event->data.document_start.tag_directives.start;
+ tag_directive != event->data.document_start.tag_directives.end;
+ tag_directive++) {
+ yaml_free(tag_directive->handle);
+ yaml_free(tag_directive->prefix);
+ }
+ yaml_free(event->data.document_start.tag_directives.start);
+ break;
+
+ case YAML_ALIAS_EVENT:
+ yaml_free(event->data.alias.anchor);
+ break;
+
+ case YAML_SCALAR_EVENT:
+ yaml_free(event->data.scalar.anchor);
+ yaml_free(event->data.scalar.tag);
+ yaml_free(event->data.scalar.value);
+ break;
+
+ case YAML_SEQUENCE_START_EVENT:
+ yaml_free(event->data.sequence_start.anchor);
+ yaml_free(event->data.sequence_start.tag);
+ break;
+
+ case YAML_MAPPING_START_EVENT:
+ yaml_free(event->data.mapping_start.anchor);
+ yaml_free(event->data.mapping_start.tag);
+ break;
+
+ default:
+ break;
+ }
+
+ memset(event, 0, sizeof(yaml_event_t));
+}
+
+/*
+ * Create a document object.
+ */
+
+YAML_DECLARE(int)
+yaml_document_initialize(yaml_document_t *document,
+ yaml_version_directive_t *version_directive,
+ yaml_tag_directive_t *tag_directives_start,
+ yaml_tag_directive_t *tag_directives_end,
+ int start_implicit, int end_implicit)
+{
+ struct {
+ yaml_error_type_t error;
+ } context;
+ struct {
+ yaml_node_t *start;
+ yaml_node_t *end;
+ yaml_node_t *top;
+ } nodes = { NULL, NULL, NULL };
+ yaml_version_directive_t *version_directive_copy = NULL;
+ struct {
+ yaml_tag_directive_t *start;
+ yaml_tag_directive_t *end;
+ yaml_tag_directive_t *top;
+ } tag_directives_copy = { NULL, NULL, NULL };
+ yaml_tag_directive_t value = { NULL, NULL };
+ yaml_mark_t mark = { 0, 0, 0 };
+
+ assert(document); /* Non-NULL document object is expected. */
+ assert((tag_directives_start && tag_directives_end) ||
+ (tag_directives_start == tag_directives_end));
+ /* Valid tag directives are expected. */
+
+ if (!STACK_INIT(&context, nodes, INITIAL_STACK_SIZE)) goto error;
+
+ if (version_directive) {
+ version_directive_copy = yaml_malloc(sizeof(yaml_version_directive_t));
+ if (!version_directive_copy) goto error;
+ version_directive_copy->major = version_directive->major;
+ version_directive_copy->minor = version_directive->minor;
+ }
+
+ if (tag_directives_start != tag_directives_end) {
+ yaml_tag_directive_t *tag_directive;
+ if (!STACK_INIT(&context, tag_directives_copy, INITIAL_STACK_SIZE))
+ goto error;
+ for (tag_directive = tag_directives_start;
+ tag_directive != tag_directives_end; tag_directive ++) {
+ assert(tag_directive->handle);
+ assert(tag_directive->prefix);
+ if (!yaml_check_utf8(tag_directive->handle,
+ strlen((char *)tag_directive->handle)))
+ goto error;
+ if (!yaml_check_utf8(tag_directive->prefix,
+ strlen((char *)tag_directive->prefix)))
+ goto error;
+ value.handle = yaml_strdup(tag_directive->handle);
+ value.prefix = yaml_strdup(tag_directive->prefix);
+ if (!value.handle || !value.prefix) goto error;
+ if (!PUSH(&context, tag_directives_copy, value))
+ goto error;
+ value.handle = NULL;
+ value.prefix = NULL;
+ }
+ }
+
+ DOCUMENT_INIT(*document, nodes.start, nodes.end, version_directive_copy,
+ tag_directives_copy.start, tag_directives_copy.top,
+ start_implicit, end_implicit, mark, mark);
+
+ return 1;
+
+error:
+ STACK_DEL(&context, nodes);
+ yaml_free(version_directive_copy);
+ while (!STACK_EMPTY(&context, tag_directives_copy)) {
+ yaml_tag_directive_t value = POP(&context, tag_directives_copy);
+ yaml_free(value.handle);
+ yaml_free(value.prefix);
+ }
+ STACK_DEL(&context, tag_directives_copy);
+ yaml_free(value.handle);
+ yaml_free(value.prefix);
+
+ return 0;
+}
+
+/*
+ * Destroy a document object.
+ */
+
+YAML_DECLARE(void)
+yaml_document_delete(yaml_document_t *document)
+{
+ struct {
+ yaml_error_type_t error;
+ } context;
+ yaml_tag_directive_t *tag_directive;
+
+ context.error = YAML_NO_ERROR; /* Eliminate a compliler warning. */
+
+ assert(document); /* Non-NULL document object is expected. */
+
+ while (!STACK_EMPTY(&context, document->nodes)) {
+ yaml_node_t node = POP(&context, document->nodes);
+ yaml_free(node.tag);
+ switch (node.type) {
+ case YAML_SCALAR_NODE:
+ yaml_free(node.data.scalar.value);
+ break;
+ case YAML_SEQUENCE_NODE:
+ STACK_DEL(&context, node.data.sequence.items);
+ break;
+ case YAML_MAPPING_NODE:
+ STACK_DEL(&context, node.data.mapping.pairs);
+ break;
+ default:
+ assert(0); /* Should not happen. */
+ }
+ }
+ STACK_DEL(&context, document->nodes);
+
+ yaml_free(document->version_directive);
+ for (tag_directive = document->tag_directives.start;
+ tag_directive != document->tag_directives.end;
+ tag_directive++) {
+ yaml_free(tag_directive->handle);
+ yaml_free(tag_directive->prefix);
+ }
+ yaml_free(document->tag_directives.start);
+
+ memset(document, 0, sizeof(yaml_document_t));
+}
+
+/**
+ * Get a document node.
+ */
+
+YAML_DECLARE(yaml_node_t *)
+yaml_document_get_node(yaml_document_t *document, int index)
+{
+ assert(document); /* Non-NULL document object is expected. */
+
+ if (index > 0 && document->nodes.start + index <= document->nodes.top) {
+ return document->nodes.start + index - 1;
+ }
+ return NULL;
+}
+
+/**
+ * Get the root object.
+ */
+
+YAML_DECLARE(yaml_node_t *)
+yaml_document_get_root_node(yaml_document_t *document)
+{
+ assert(document); /* Non-NULL document object is expected. */
+
+ if (document->nodes.top != document->nodes.start) {
+ return document->nodes.start;
+ }
+ return NULL;
+}
+
+/*
+ * Add a scalar node to a document.
+ */
+
+YAML_DECLARE(int)
+yaml_document_add_scalar(yaml_document_t *document,
+ yaml_char_t *tag, yaml_char_t *value, int length,
+ yaml_scalar_style_t style)
+{
+ struct {
+ yaml_error_type_t error;
+ } context;
+ yaml_mark_t mark = { 0, 0, 0 };
+ yaml_char_t *tag_copy = NULL;
+ yaml_char_t *value_copy = NULL;
+ yaml_node_t node;
+
+ assert(document); /* Non-NULL document object is expected. */
+ assert(value); /* Non-NULL value is expected. */
+
+ if (!tag) {
+ tag = (yaml_char_t *)YAML_DEFAULT_SCALAR_TAG;
+ }
+
+ if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error;
+ tag_copy = yaml_strdup(tag);
+ if (!tag_copy) goto error;
+
+ if (length < 0) {
+ length = strlen((char *)value);
+ }
+
+ if (!yaml_check_utf8(value, length)) goto error;
+ value_copy = yaml_malloc(length+1);
+ if (!value_copy) goto error;
+ memcpy(value_copy, value, length);
+ value_copy[length] = '\0';
+
+ SCALAR_NODE_INIT(node, tag_copy, value_copy, length, style, mark, mark);
+ if (!PUSH(&context, document->nodes, node)) goto error;
+
+ return document->nodes.top - document->nodes.start;
+
+error:
+ yaml_free(tag_copy);
+ yaml_free(value_copy);
+
+ return 0;
+}
+
+/*
+ * Add a sequence node to a document.
+ */
+
+YAML_DECLARE(int)
+yaml_document_add_sequence(yaml_document_t *document,
+ yaml_char_t *tag, yaml_sequence_style_t style)
+{
+ struct {
+ yaml_error_type_t error;
+ } context;
+ yaml_mark_t mark = { 0, 0, 0 };
+ yaml_char_t *tag_copy = NULL;
+ struct {
+ yaml_node_item_t *start;
+ yaml_node_item_t *end;
+ yaml_node_item_t *top;
+ } items = { NULL, NULL, NULL };
+ yaml_node_t node;
+
+ assert(document); /* Non-NULL document object is expected. */
+
+ if (!tag) {
+ tag = (yaml_char_t *)YAML_DEFAULT_SEQUENCE_TAG;
+ }
+
+ if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error;
+ tag_copy = yaml_strdup(tag);
+ if (!tag_copy) goto error;
+
+ if (!STACK_INIT(&context, items, INITIAL_STACK_SIZE)) goto error;
+
+ SEQUENCE_NODE_INIT(node, tag_copy, items.start, items.end,
+ style, mark, mark);
+ if (!PUSH(&context, document->nodes, node)) goto error;
+
+ return document->nodes.top - document->nodes.start;
+
+error:
+ STACK_DEL(&context, items);
+ yaml_free(tag_copy);
+
+ return 0;
+}
+
+/*
+ * Add a mapping node to a document.
+ */
+
+YAML_DECLARE(int)
+yaml_document_add_mapping(yaml_document_t *document,
+ yaml_char_t *tag, yaml_mapping_style_t style)
+{
+ struct {
+ yaml_error_type_t error;
+ } context;
+ yaml_mark_t mark = { 0, 0, 0 };
+ yaml_char_t *tag_copy = NULL;
+ struct {
+ yaml_node_pair_t *start;
+ yaml_node_pair_t *end;
+ yaml_node_pair_t *top;
+ } pairs = { NULL, NULL, NULL };
+ yaml_node_t node;
+
+ assert(document); /* Non-NULL document object is expected. */
+
+ if (!tag) {
+ tag = (yaml_char_t *)YAML_DEFAULT_MAPPING_TAG;
+ }
+
+ if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error;
+ tag_copy = yaml_strdup(tag);
+ if (!tag_copy) goto error;
+
+ if (!STACK_INIT(&context, pairs, INITIAL_STACK_SIZE)) goto error;
+
+ MAPPING_NODE_INIT(node, tag_copy, pairs.start, pairs.end,
+ style, mark, mark);
+ if (!PUSH(&context, document->nodes, node)) goto error;
+
+ return document->nodes.top - document->nodes.start;
+
+error:
+ STACK_DEL(&context, pairs);
+ yaml_free(tag_copy);
+
+ return 0;
+}
+
+/*
+ * Append an item to a sequence node.
+ */
+
+YAML_DECLARE(int)
+yaml_document_append_sequence_item(yaml_document_t *document,
+ int sequence, int item)
+{
+ struct {
+ yaml_error_type_t error;
+ } context;
+
+ assert(document); /* Non-NULL document is required. */
+ assert(sequence > 0
+ && document->nodes.start + sequence <= document->nodes.top);
+ /* Valid sequence id is required. */
+ assert(document->nodes.start[sequence-1].type == YAML_SEQUENCE_NODE);
+ /* A sequence node is required. */
+ assert(item > 0 && document->nodes.start + item <= document->nodes.top);
+ /* Valid item id is required. */
+
+ if (!PUSH(&context,
+ document->nodes.start[sequence-1].data.sequence.items, item))
+ return 0;
+
+ return 1;
+}
+
+/*
+ * Append a pair of a key and a value to a mapping node.
+ */
+
+YAML_DECLARE(int)
+yaml_document_append_mapping_pair(yaml_document_t *document,
+ int mapping, int key, int value)
+{
+ struct {
+ yaml_error_type_t error;
+ } context;
+
+ yaml_node_pair_t pair;
+
+ assert(document); /* Non-NULL document is required. */
+ assert(mapping > 0
+ && document->nodes.start + mapping <= document->nodes.top);
+ /* Valid mapping id is required. */
+ assert(document->nodes.start[mapping-1].type == YAML_MAPPING_NODE);
+ /* A mapping node is required. */
+ assert(key > 0 && document->nodes.start + key <= document->nodes.top);
+ /* Valid key id is required. */
+ assert(value > 0 && document->nodes.start + value <= document->nodes.top);
+ /* Valid value id is required. */
+
+ pair.key = key;
+ pair.value = value;
+
+ if (!PUSH(&context,
+ document->nodes.start[mapping-1].data.mapping.pairs, pair))
+ return 0;
+
+ return 1;
+}
+
+
diff --git a/ext/psych/yaml/config.h b/ext/psych/yaml/config.h
new file mode 100644
index 0000000000..6d6c25b3b1
--- /dev/null
+++ b/ext/psych/yaml/config.h
@@ -0,0 +1,11 @@
+
+#define PACKAGE_NAME "yaml"
+#define PACKAGE_TARNAME "yaml"
+#define PACKAGE_VERSION "0.1.4"
+#define PACKAGE_STRING "yaml 0.1.4"
+#define PACKAGE_BUGREPORT "http://pyyaml.org/newticket?component libyaml"
+#define PACKAGE_URL ""
+#define YAML_VERSION_MAJOR 0
+#define YAML_VERSION_MINOR 1
+#define YAML_VERSION_PATCH 4
+#define YAML_VERSION_STRING "0.1.4"
diff --git a/ext/psych/yaml/dumper.c b/ext/psych/yaml/dumper.c
new file mode 100644
index 0000000000..203c6a709c
--- /dev/null
+++ b/ext/psych/yaml/dumper.c
@@ -0,0 +1,394 @@
+
+#include "yaml_private.h"
+
+/*
+ * API functions.
+ */
+
+YAML_DECLARE(int)
+yaml_emitter_open(yaml_emitter_t *emitter);
+
+YAML_DECLARE(int)
+yaml_emitter_close(yaml_emitter_t *emitter);
+
+YAML_DECLARE(int)
+yaml_emitter_dump(yaml_emitter_t *emitter, yaml_document_t *document);
+
+/*
+ * Clean up functions.
+ */
+
+static void
+yaml_emitter_delete_document_and_anchors(yaml_emitter_t *emitter);
+
+/*
+ * Anchor functions.
+ */
+
+static void
+yaml_emitter_anchor_node(yaml_emitter_t *emitter, int index);
+
+static yaml_char_t *
+yaml_emitter_generate_anchor(yaml_emitter_t *emitter, int anchor_id);
+
+
+/*
+ * Serialize functions.
+ */
+
+static int
+yaml_emitter_dump_node(yaml_emitter_t *emitter, int index);
+
+static int
+yaml_emitter_dump_alias(yaml_emitter_t *emitter, yaml_char_t *anchor);
+
+static int
+yaml_emitter_dump_scalar(yaml_emitter_t *emitter, yaml_node_t *node,
+ yaml_char_t *anchor);
+
+static int
+yaml_emitter_dump_sequence(yaml_emitter_t *emitter, yaml_node_t *node,
+ yaml_char_t *anchor);
+
+static int
+yaml_emitter_dump_mapping(yaml_emitter_t *emitter, yaml_node_t *node,
+ yaml_char_t *anchor);
+
+/*
+ * Issue a STREAM-START event.
+ */
+
+YAML_DECLARE(int)
+yaml_emitter_open(yaml_emitter_t *emitter)
+{
+ yaml_event_t event;
+ yaml_mark_t mark = { 0, 0, 0 };
+
+ assert(emitter); /* Non-NULL emitter object is required. */
+ assert(!emitter->opened); /* Emitter should not be opened yet. */
+
+ STREAM_START_EVENT_INIT(event, YAML_ANY_ENCODING, mark, mark);
+
+ if (!yaml_emitter_emit(emitter, &event)) {
+ return 0;
+ }
+
+ emitter->opened = 1;
+
+ return 1;
+}
+
+/*
+ * Issue a STREAM-END event.
+ */
+
+YAML_DECLARE(int)
+yaml_emitter_close(yaml_emitter_t *emitter)
+{
+ yaml_event_t event;
+ yaml_mark_t mark = { 0, 0, 0 };
+
+ assert(emitter); /* Non-NULL emitter object is required. */
+ assert(emitter->opened); /* Emitter should be opened. */
+
+ if (emitter->closed) return 1;
+
+ STREAM_END_EVENT_INIT(event, mark, mark);
+
+ if (!yaml_emitter_emit(emitter, &event)) {
+ return 0;
+ }
+
+ emitter->closed = 1;
+
+ return 1;
+}
+
+/*
+ * Dump a YAML document.
+ */
+
+YAML_DECLARE(int)
+yaml_emitter_dump(yaml_emitter_t *emitter, yaml_document_t *document)
+{
+ yaml_event_t event;
+ yaml_mark_t mark = { 0, 0, 0 };
+
+ assert(emitter); /* Non-NULL emitter object is required. */
+ assert(document); /* Non-NULL emitter object is expected. */
+
+ emitter->document = document;
+
+ if (!emitter->opened) {
+ if (!yaml_emitter_open(emitter)) goto error;
+ }
+
+ if (STACK_EMPTY(emitter, document->nodes)) {
+ if (!yaml_emitter_close(emitter)) goto error;
+ yaml_emitter_delete_document_and_anchors(emitter);
+ return 1;
+ }
+
+ assert(emitter->opened); /* Emitter should be opened. */
+
+ emitter->anchors = yaml_malloc(sizeof(*(emitter->anchors))
+ * (document->nodes.top - document->nodes.start));
+ if (!emitter->anchors) goto error;
+ memset(emitter->anchors, 0, sizeof(*(emitter->anchors))
+ * (document->nodes.top - document->nodes.start));
+
+ DOCUMENT_START_EVENT_INIT(event, document->version_directive,
+ document->tag_directives.start, document->tag_directives.end,
+ document->start_implicit, mark, mark);
+ if (!yaml_emitter_emit(emitter, &event)) goto error;
+
+ yaml_emitter_anchor_node(emitter, 1);
+ if (!yaml_emitter_dump_node(emitter, 1)) goto error;
+
+ DOCUMENT_END_EVENT_INIT(event, document->end_implicit, mark, mark);
+ if (!yaml_emitter_emit(emitter, &event)) goto error;
+
+ yaml_emitter_delete_document_and_anchors(emitter);
+
+ return 1;
+
+error:
+
+ yaml_emitter_delete_document_and_anchors(emitter);
+
+ return 0;
+}
+
+/*
+ * Clean up the emitter object after a document is dumped.
+ */
+
+static void
+yaml_emitter_delete_document_and_anchors(yaml_emitter_t *emitter)
+{
+ int index;
+
+ if (!emitter->anchors) {
+ yaml_document_delete(emitter->document);
+ emitter->document = NULL;
+ return;
+ }
+
+ for (index = 0; emitter->document->nodes.start + index
+ < emitter->document->nodes.top; index ++) {
+ yaml_node_t node = emitter->document->nodes.start[index];
+ if (!emitter->anchors[index].serialized) {
+ yaml_free(node.tag);
+ if (node.type == YAML_SCALAR_NODE) {
+ yaml_free(node.data.scalar.value);
+ }
+ }
+ if (node.type == YAML_SEQUENCE_NODE) {
+ STACK_DEL(emitter, node.data.sequence.items);
+ }
+ if (node.type == YAML_MAPPING_NODE) {
+ STACK_DEL(emitter, node.data.mapping.pairs);
+ }
+ }
+
+ STACK_DEL(emitter, emitter->document->nodes);
+ yaml_free(emitter->anchors);
+
+ emitter->anchors = NULL;
+ emitter->last_anchor_id = 0;
+ emitter->document = NULL;
+}
+
+/*
+ * Check the references of a node and assign the anchor id if needed.
+ */
+
+static void
+yaml_emitter_anchor_node(yaml_emitter_t *emitter, int index)
+{
+ yaml_node_t *node = emitter->document->nodes.start + index - 1;
+ yaml_node_item_t *item;
+ yaml_node_pair_t *pair;
+
+ emitter->anchors[index-1].references ++;
+
+ if (emitter->anchors[index-1].references == 1) {
+ switch (node->type) {
+ case YAML_SEQUENCE_NODE:
+ for (item = node->data.sequence.items.start;
+ item < node->data.sequence.items.top; item ++) {
+ yaml_emitter_anchor_node(emitter, *item);
+ }
+ break;
+ case YAML_MAPPING_NODE:
+ for (pair = node->data.mapping.pairs.start;
+ pair < node->data.mapping.pairs.top; pair ++) {
+ yaml_emitter_anchor_node(emitter, pair->key);
+ yaml_emitter_anchor_node(emitter, pair->value);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ else if (emitter->anchors[index-1].references == 2) {
+ emitter->anchors[index-1].anchor = (++ emitter->last_anchor_id);
+ }
+}
+
+/*
+ * Generate a textual representation for an anchor.
+ */
+
+#define ANCHOR_TEMPLATE "id%03d"
+#define ANCHOR_TEMPLATE_LENGTH 16
+
+static yaml_char_t *
+yaml_emitter_generate_anchor(yaml_emitter_t *emitter, int anchor_id)
+{
+ yaml_char_t *anchor = yaml_malloc(ANCHOR_TEMPLATE_LENGTH);
+
+ if (!anchor) return NULL;
+
+ sprintf((char *)anchor, ANCHOR_TEMPLATE, anchor_id);
+
+ return anchor;
+}
+
+/*
+ * Serialize a node.
+ */
+
+static int
+yaml_emitter_dump_node(yaml_emitter_t *emitter, int index)
+{
+ yaml_node_t *node = emitter->document->nodes.start + index - 1;
+ int anchor_id = emitter->anchors[index-1].anchor;
+ yaml_char_t *anchor = NULL;
+
+ if (anchor_id) {
+ anchor = yaml_emitter_generate_anchor(emitter, anchor_id);
+ if (!anchor) return 0;
+ }
+
+ if (emitter->anchors[index-1].serialized) {
+ return yaml_emitter_dump_alias(emitter, anchor);
+ }
+
+ emitter->anchors[index-1].serialized = 1;
+
+ switch (node->type) {
+ case YAML_SCALAR_NODE:
+ return yaml_emitter_dump_scalar(emitter, node, anchor);
+ case YAML_SEQUENCE_NODE:
+ return yaml_emitter_dump_sequence(emitter, node, anchor);
+ case YAML_MAPPING_NODE:
+ return yaml_emitter_dump_mapping(emitter, node, anchor);
+ default:
+ assert(0); /* Could not happen. */
+ break;
+ }
+
+ return 0; /* Could not happen. */
+}
+
+/*
+ * Serialize an alias.
+ */
+
+static int
+yaml_emitter_dump_alias(yaml_emitter_t *emitter, yaml_char_t *anchor)
+{
+ yaml_event_t event;
+ yaml_mark_t mark = { 0, 0, 0 };
+
+ ALIAS_EVENT_INIT(event, anchor, mark, mark);
+
+ return yaml_emitter_emit(emitter, &event);
+}
+
+/*
+ * Serialize a scalar.
+ */
+
+static int
+yaml_emitter_dump_scalar(yaml_emitter_t *emitter, yaml_node_t *node,
+ yaml_char_t *anchor)
+{
+ yaml_event_t event;
+ yaml_mark_t mark = { 0, 0, 0 };
+
+ int plain_implicit = (strcmp((char *)node->tag,
+ YAML_DEFAULT_SCALAR_TAG) == 0);
+ int quoted_implicit = (strcmp((char *)node->tag,
+ YAML_DEFAULT_SCALAR_TAG) == 0);
+
+ SCALAR_EVENT_INIT(event, anchor, node->tag, node->data.scalar.value,
+ node->data.scalar.length, plain_implicit, quoted_implicit,
+ node->data.scalar.style, mark, mark);
+
+ return yaml_emitter_emit(emitter, &event);
+}
+
+/*
+ * Serialize a sequence.
+ */
+
+static int
+yaml_emitter_dump_sequence(yaml_emitter_t *emitter, yaml_node_t *node,
+ yaml_char_t *anchor)
+{
+ yaml_event_t event;
+ yaml_mark_t mark = { 0, 0, 0 };
+
+ int implicit = (strcmp((char *)node->tag, YAML_DEFAULT_SEQUENCE_TAG) == 0);
+
+ yaml_node_item_t *item;
+
+ SEQUENCE_START_EVENT_INIT(event, anchor, node->tag, implicit,
+ node->data.sequence.style, mark, mark);
+ if (!yaml_emitter_emit(emitter, &event)) return 0;
+
+ for (item = node->data.sequence.items.start;
+ item < node->data.sequence.items.top; item ++) {
+ if (!yaml_emitter_dump_node(emitter, *item)) return 0;
+ }
+
+ SEQUENCE_END_EVENT_INIT(event, mark, mark);
+ if (!yaml_emitter_emit(emitter, &event)) return 0;
+
+ return 1;
+}
+
+/*
+ * Serialize a mapping.
+ */
+
+static int
+yaml_emitter_dump_mapping(yaml_emitter_t *emitter, yaml_node_t *node,
+ yaml_char_t *anchor)
+{
+ yaml_event_t event;
+ yaml_mark_t mark = { 0, 0, 0 };
+
+ int implicit = (strcmp((char *)node->tag, YAML_DEFAULT_MAPPING_TAG) == 0);
+
+ yaml_node_pair_t *pair;
+
+ MAPPING_START_EVENT_INIT(event, anchor, node->tag, implicit,
+ node->data.mapping.style, mark, mark);
+ if (!yaml_emitter_emit(emitter, &event)) return 0;
+
+ for (pair = node->data.mapping.pairs.start;
+ pair < node->data.mapping.pairs.top; pair ++) {
+ if (!yaml_emitter_dump_node(emitter, pair->key)) return 0;
+ if (!yaml_emitter_dump_node(emitter, pair->value)) return 0;
+ }
+
+ MAPPING_END_EVENT_INIT(event, mark, mark);
+ if (!yaml_emitter_emit(emitter, &event)) return 0;
+
+ return 1;
+}
+
diff --git a/ext/psych/yaml/emitter.c b/ext/psych/yaml/emitter.c
new file mode 100644
index 0000000000..f41a8fada6
--- /dev/null
+++ b/ext/psych/yaml/emitter.c
@@ -0,0 +1,2329 @@
+
+#include "yaml_private.h"
+
+/*
+ * Flush the buffer if needed.
+ */
+
+#define FLUSH(emitter) \
+ ((emitter->buffer.pointer+5 < emitter->buffer.end) \
+ || yaml_emitter_flush(emitter))
+
+/*
+ * Put a character to the output buffer.
+ */
+
+#define PUT(emitter,value) \
+ (FLUSH(emitter) \
+ && (*(emitter->buffer.pointer++) = (yaml_char_t)(value), \
+ emitter->column ++, \
+ 1))
+
+/*
+ * Put a line break to the output buffer.
+ */
+
+#define PUT_BREAK(emitter) \
+ (FLUSH(emitter) \
+ && ((emitter->line_break == YAML_CR_BREAK ? \
+ (*(emitter->buffer.pointer++) = (yaml_char_t) '\r') : \
+ emitter->line_break == YAML_LN_BREAK ? \
+ (*(emitter->buffer.pointer++) = (yaml_char_t) '\n') : \
+ emitter->line_break == YAML_CRLN_BREAK ? \
+ (*(emitter->buffer.pointer++) = (yaml_char_t) '\r', \
+ *(emitter->buffer.pointer++) = (yaml_char_t) '\n') : 0), \
+ emitter->column = 0, \
+ emitter->line ++, \
+ 1))
+
+/*
+ * Copy a character from a string into buffer.
+ */
+
+#define WRITE(emitter,string) \
+ (FLUSH(emitter) \
+ && (COPY(emitter->buffer,string), \
+ emitter->column ++, \
+ 1))
+
+/*
+ * Copy a line break character from a string into buffer.
+ */
+
+#define WRITE_BREAK(emitter,string) \
+ (FLUSH(emitter) \
+ && (CHECK(string,'\n') ? \
+ (PUT_BREAK(emitter), \
+ string.pointer ++, \
+ 1) : \
+ (COPY(emitter->buffer,string), \
+ emitter->column = 0, \
+ emitter->line ++, \
+ 1)))
+
+/*
+ * API functions.
+ */
+
+YAML_DECLARE(int)
+yaml_emitter_emit(yaml_emitter_t *emitter, yaml_event_t *event);
+
+/*
+ * Utility functions.
+ */
+
+static int
+yaml_emitter_set_emitter_error(yaml_emitter_t *emitter, const char *problem);
+
+static int
+yaml_emitter_need_more_events(yaml_emitter_t *emitter);
+
+static int
+yaml_emitter_append_tag_directive(yaml_emitter_t *emitter,
+ yaml_tag_directive_t value, int allow_duplicates);
+
+static int
+yaml_emitter_increase_indent(yaml_emitter_t *emitter,
+ int flow, int indentless);
+
+/*
+ * State functions.
+ */
+
+static int
+yaml_emitter_state_machine(yaml_emitter_t *emitter, yaml_event_t *event);
+
+static int
+yaml_emitter_emit_stream_start(yaml_emitter_t *emitter,
+ yaml_event_t *event);
+
+static int
+yaml_emitter_emit_document_start(yaml_emitter_t *emitter,
+ yaml_event_t *event, int first);
+
+static int
+yaml_emitter_emit_document_content(yaml_emitter_t *emitter,
+ yaml_event_t *event);
+
+static int
+yaml_emitter_emit_document_end(yaml_emitter_t *emitter,
+ yaml_event_t *event);
+
+static int
+yaml_emitter_emit_flow_sequence_item(yaml_emitter_t *emitter,
+ yaml_event_t *event, int first);
+
+static int
+yaml_emitter_emit_flow_mapping_key(yaml_emitter_t *emitter,
+ yaml_event_t *event, int first);
+
+static int
+yaml_emitter_emit_flow_mapping_value(yaml_emitter_t *emitter,
+ yaml_event_t *event, int simple);
+
+static int
+yaml_emitter_emit_block_sequence_item(yaml_emitter_t *emitter,
+ yaml_event_t *event, int first);
+
+static int
+yaml_emitter_emit_block_mapping_key(yaml_emitter_t *emitter,
+ yaml_event_t *event, int first);
+
+static int
+yaml_emitter_emit_block_mapping_value(yaml_emitter_t *emitter,
+ yaml_event_t *event, int simple);
+
+static int
+yaml_emitter_emit_node(yaml_emitter_t *emitter, yaml_event_t *event,
+ int root, int sequence, int mapping, int simple_key);
+
+static int
+yaml_emitter_emit_alias(yaml_emitter_t *emitter, yaml_event_t *event);
+
+static int
+yaml_emitter_emit_scalar(yaml_emitter_t *emitter, yaml_event_t *event);
+
+static int
+yaml_emitter_emit_sequence_start(yaml_emitter_t *emitter, yaml_event_t *event);
+
+static int
+yaml_emitter_emit_mapping_start(yaml_emitter_t *emitter, yaml_event_t *event);
+
+/*
+ * Checkers.
+ */
+
+static int
+yaml_emitter_check_empty_document(yaml_emitter_t *emitter);
+
+static int
+yaml_emitter_check_empty_sequence(yaml_emitter_t *emitter);
+
+static int
+yaml_emitter_check_empty_mapping(yaml_emitter_t *emitter);
+
+static int
+yaml_emitter_check_simple_key(yaml_emitter_t *emitter);
+
+static int
+yaml_emitter_select_scalar_style(yaml_emitter_t *emitter, yaml_event_t *event);
+
+/*
+ * Processors.
+ */
+
+static int
+yaml_emitter_process_anchor(yaml_emitter_t *emitter);
+
+static int
+yaml_emitter_process_tag(yaml_emitter_t *emitter);
+
+static int
+yaml_emitter_process_scalar(yaml_emitter_t *emitter);
+
+/*
+ * Analyzers.
+ */
+
+static int
+yaml_emitter_analyze_version_directive(yaml_emitter_t *emitter,
+ yaml_version_directive_t version_directive);
+
+static int
+yaml_emitter_analyze_tag_directive(yaml_emitter_t *emitter,
+ yaml_tag_directive_t tag_directive);
+
+static int
+yaml_emitter_analyze_anchor(yaml_emitter_t *emitter,
+ yaml_char_t *anchor, int alias);
+
+static int
+yaml_emitter_analyze_tag(yaml_emitter_t *emitter,
+ yaml_char_t *tag);
+
+static int
+yaml_emitter_analyze_scalar(yaml_emitter_t *emitter,
+ yaml_char_t *value, size_t length);
+
+static int
+yaml_emitter_analyze_event(yaml_emitter_t *emitter,
+ yaml_event_t *event);
+
+/*
+ * Writers.
+ */
+
+static int
+yaml_emitter_write_bom(yaml_emitter_t *emitter);
+
+static int
+yaml_emitter_write_indent(yaml_emitter_t *emitter);
+
+static int
+yaml_emitter_write_indicator(yaml_emitter_t *emitter,
+ const char *indicator, int need_whitespace,
+ int is_whitespace, int is_indention);
+
+static int
+yaml_emitter_write_anchor(yaml_emitter_t *emitter,
+ yaml_char_t *value, size_t length);
+
+static int
+yaml_emitter_write_tag_handle(yaml_emitter_t *emitter,
+ yaml_char_t *value, size_t length);
+
+static int
+yaml_emitter_write_tag_content(yaml_emitter_t *emitter,
+ yaml_char_t *value, size_t length, int need_whitespace);
+
+static int
+yaml_emitter_write_plain_scalar(yaml_emitter_t *emitter,
+ yaml_char_t *value, size_t length, int allow_breaks);
+
+static int
+yaml_emitter_write_single_quoted_scalar(yaml_emitter_t *emitter,
+ yaml_char_t *value, size_t length, int allow_breaks);
+
+static int
+yaml_emitter_write_double_quoted_scalar(yaml_emitter_t *emitter,
+ yaml_char_t *value, size_t length, int allow_breaks);
+
+static int
+yaml_emitter_write_block_scalar_hints(yaml_emitter_t *emitter,
+ yaml_string_t string);
+
+static int
+yaml_emitter_write_literal_scalar(yaml_emitter_t *emitter,
+ yaml_char_t *value, size_t length);
+
+static int
+yaml_emitter_write_folded_scalar(yaml_emitter_t *emitter,
+ yaml_char_t *value, size_t length);
+
+/*
+ * Set an emitter error and return 0.
+ */
+
+static int
+yaml_emitter_set_emitter_error(yaml_emitter_t *emitter, const char *problem)
+{
+ emitter->error = YAML_EMITTER_ERROR;
+ emitter->problem = problem;
+
+ return 0;
+}
+
+/*
+ * Emit an event.
+ */
+
+YAML_DECLARE(int)
+yaml_emitter_emit(yaml_emitter_t *emitter, yaml_event_t *event)
+{
+ if (!ENQUEUE(emitter, emitter->events, *event)) {
+ yaml_event_delete(event);
+ return 0;
+ }
+
+ while (!yaml_emitter_need_more_events(emitter)) {
+ if (!yaml_emitter_analyze_event(emitter, emitter->events.head))
+ return 0;
+ if (!yaml_emitter_state_machine(emitter, emitter->events.head))
+ return 0;
+ yaml_event_delete(&DEQUEUE(emitter, emitter->events));
+ }
+
+ return 1;
+}
+
+/*
+ * Check if we need to accumulate more events before emitting.
+ *
+ * We accumulate extra
+ * - 1 event for DOCUMENT-START
+ * - 2 events for SEQUENCE-START
+ * - 3 events for MAPPING-START
+ */
+
+static int
+yaml_emitter_need_more_events(yaml_emitter_t *emitter)
+{
+ int level = 0;
+ int accumulate = 0;
+ yaml_event_t *event;
+
+ if (QUEUE_EMPTY(emitter, emitter->events))
+ return 1;
+
+ switch (emitter->events.head->type) {
+ case YAML_DOCUMENT_START_EVENT:
+ accumulate = 1;
+ break;
+ case YAML_SEQUENCE_START_EVENT:
+ accumulate = 2;
+ break;
+ case YAML_MAPPING_START_EVENT:
+ accumulate = 3;
+ break;
+ default:
+ return 0;
+ }
+
+ if (emitter->events.tail - emitter->events.head > accumulate)
+ return 0;
+
+ for (event = emitter->events.head; event != emitter->events.tail; event ++) {
+ switch (event->type) {
+ case YAML_STREAM_START_EVENT:
+ case YAML_DOCUMENT_START_EVENT:
+ case YAML_SEQUENCE_START_EVENT:
+ case YAML_MAPPING_START_EVENT:
+ level += 1;
+ break;
+ case YAML_STREAM_END_EVENT:
+ case YAML_DOCUMENT_END_EVENT:
+ case YAML_SEQUENCE_END_EVENT:
+ case YAML_MAPPING_END_EVENT:
+ level -= 1;
+ break;
+ default:
+ break;
+ }
+ if (!level)
+ return 0;
+ }
+
+ return 1;
+}
+
+/*
+ * Append a directive to the directives stack.
+ */
+
+static int
+yaml_emitter_append_tag_directive(yaml_emitter_t *emitter,
+ yaml_tag_directive_t value, int allow_duplicates)
+{
+ yaml_tag_directive_t *tag_directive;
+ yaml_tag_directive_t copy = { NULL, NULL };
+
+ for (tag_directive = emitter->tag_directives.start;
+ tag_directive != emitter->tag_directives.top; tag_directive ++) {
+ if (strcmp((char *)value.handle, (char *)tag_directive->handle) == 0) {
+ if (allow_duplicates)
+ return 1;
+ return yaml_emitter_set_emitter_error(emitter,
+ "duplicate %TAG directive");
+ }
+ }
+
+ copy.handle = yaml_strdup(value.handle);
+ copy.prefix = yaml_strdup(value.prefix);
+ if (!copy.handle || !copy.prefix) {
+ emitter->error = YAML_MEMORY_ERROR;
+ goto error;
+ }
+
+ if (!PUSH(emitter, emitter->tag_directives, copy))
+ goto error;
+
+ return 1;
+
+error:
+ yaml_free(copy.handle);
+ yaml_free(copy.prefix);
+ return 0;
+}
+
+/*
+ * Increase the indentation level.
+ */
+
+static int
+yaml_emitter_increase_indent(yaml_emitter_t *emitter,
+ int flow, int indentless)
+{
+ if (!PUSH(emitter, emitter->indents, emitter->indent))
+ return 0;
+
+ if (emitter->indent < 0) {
+ emitter->indent = flow ? emitter->best_indent : 0;
+ }
+ else if (!indentless) {
+ emitter->indent += emitter->best_indent;
+ }
+
+ return 1;
+}
+
+/*
+ * State dispatcher.
+ */
+
+static int
+yaml_emitter_state_machine(yaml_emitter_t *emitter, yaml_event_t *event)
+{
+ switch (emitter->state)
+ {
+ case YAML_EMIT_STREAM_START_STATE:
+ return yaml_emitter_emit_stream_start(emitter, event);
+
+ case YAML_EMIT_FIRST_DOCUMENT_START_STATE:
+ return yaml_emitter_emit_document_start(emitter, event, 1);
+
+ case YAML_EMIT_DOCUMENT_START_STATE:
+ return yaml_emitter_emit_document_start(emitter, event, 0);
+
+ case YAML_EMIT_DOCUMENT_CONTENT_STATE:
+ return yaml_emitter_emit_document_content(emitter, event);
+
+ case YAML_EMIT_DOCUMENT_END_STATE:
+ return yaml_emitter_emit_document_end(emitter, event);
+
+ case YAML_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE:
+ return yaml_emitter_emit_flow_sequence_item(emitter, event, 1);
+
+ case YAML_EMIT_FLOW_SEQUENCE_ITEM_STATE:
+ return yaml_emitter_emit_flow_sequence_item(emitter, event, 0);
+
+ case YAML_EMIT_FLOW_MAPPING_FIRST_KEY_STATE:
+ return yaml_emitter_emit_flow_mapping_key(emitter, event, 1);
+
+ case YAML_EMIT_FLOW_MAPPING_KEY_STATE:
+ return yaml_emitter_emit_flow_mapping_key(emitter, event, 0);
+
+ case YAML_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE:
+ return yaml_emitter_emit_flow_mapping_value(emitter, event, 1);
+
+ case YAML_EMIT_FLOW_MAPPING_VALUE_STATE:
+ return yaml_emitter_emit_flow_mapping_value(emitter, event, 0);
+
+ case YAML_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE:
+ return yaml_emitter_emit_block_sequence_item(emitter, event, 1);
+
+ case YAML_EMIT_BLOCK_SEQUENCE_ITEM_STATE:
+ return yaml_emitter_emit_block_sequence_item(emitter, event, 0);
+
+ case YAML_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE:
+ return yaml_emitter_emit_block_mapping_key(emitter, event, 1);
+
+ case YAML_EMIT_BLOCK_MAPPING_KEY_STATE:
+ return yaml_emitter_emit_block_mapping_key(emitter, event, 0);
+
+ case YAML_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE:
+ return yaml_emitter_emit_block_mapping_value(emitter, event, 1);
+
+ case YAML_EMIT_BLOCK_MAPPING_VALUE_STATE:
+ return yaml_emitter_emit_block_mapping_value(emitter, event, 0);
+
+ case YAML_EMIT_END_STATE:
+ return yaml_emitter_set_emitter_error(emitter,
+ "expected nothing after STREAM-END");
+
+ default:
+ assert(1); /* Invalid state. */
+ }
+
+ return 0;
+}
+
+/*
+ * Expect STREAM-START.
+ */
+
+static int
+yaml_emitter_emit_stream_start(yaml_emitter_t *emitter,
+ yaml_event_t *event)
+{
+ if (event->type == YAML_STREAM_START_EVENT)
+ {
+ if (!emitter->encoding) {
+ emitter->encoding = event->data.stream_start.encoding;
+ }
+
+ if (!emitter->encoding) {
+ emitter->encoding = YAML_UTF8_ENCODING;
+ }
+
+ if (emitter->best_indent < 2 || emitter->best_indent > 9) {
+ emitter->best_indent = 2;
+ }
+
+ if (emitter->best_width >= 0
+ && emitter->best_width <= emitter->best_indent*2) {
+ emitter->best_width = 80;
+ }
+
+ if (emitter->best_width < 0) {
+ emitter->best_width = INT_MAX;
+ }
+
+ if (!emitter->line_break) {
+ emitter->line_break = YAML_LN_BREAK;
+ }
+
+ emitter->indent = -1;
+
+ emitter->line = 0;
+ emitter->column = 0;
+ emitter->whitespace = 1;
+ emitter->indention = 1;
+
+ if (emitter->encoding != YAML_UTF8_ENCODING) {
+ if (!yaml_emitter_write_bom(emitter))
+ return 0;
+ }
+
+ emitter->state = YAML_EMIT_FIRST_DOCUMENT_START_STATE;
+
+ return 1;
+ }
+
+ return yaml_emitter_set_emitter_error(emitter,
+ "expected STREAM-START");
+}
+
+/*
+ * Expect DOCUMENT-START or STREAM-END.
+ */
+
+static int
+yaml_emitter_emit_document_start(yaml_emitter_t *emitter,
+ yaml_event_t *event, int first)
+{
+ if (event->type == YAML_DOCUMENT_START_EVENT)
+ {
+ yaml_tag_directive_t default_tag_directives[] = {
+ {(yaml_char_t *)"!", (yaml_char_t *)"!"},
+ {(yaml_char_t *)"!!", (yaml_char_t *)"tag:yaml.org,2002:"},
+ {NULL, NULL}
+ };
+ yaml_tag_directive_t *tag_directive;
+ int implicit;
+
+ if (event->data.document_start.version_directive) {
+ if (!yaml_emitter_analyze_version_directive(emitter,
+ *event->data.document_start.version_directive))
+ return 0;
+ }
+
+ for (tag_directive = event->data.document_start.tag_directives.start;
+ tag_directive != event->data.document_start.tag_directives.end;
+ tag_directive ++) {
+ if (!yaml_emitter_analyze_tag_directive(emitter, *tag_directive))
+ return 0;
+ if (!yaml_emitter_append_tag_directive(emitter, *tag_directive, 0))
+ return 0;
+ }
+
+ for (tag_directive = default_tag_directives;
+ tag_directive->handle; tag_directive ++) {
+ if (!yaml_emitter_append_tag_directive(emitter, *tag_directive, 1))
+ return 0;
+ }
+
+ implicit = event->data.document_start.implicit;
+ if (!first || emitter->canonical) {
+ implicit = 0;
+ }
+
+ if ((event->data.document_start.version_directive ||
+ (event->data.document_start.tag_directives.start
+ != event->data.document_start.tag_directives.end)) &&
+ emitter->open_ended)
+ {
+ if (!yaml_emitter_write_indicator(emitter, "...", 1, 0, 0))
+ return 0;
+ if (!yaml_emitter_write_indent(emitter))
+ return 0;
+ }
+
+ if (event->data.document_start.version_directive) {
+ implicit = 0;
+ if (!yaml_emitter_write_indicator(emitter, "%YAML", 1, 0, 0))
+ return 0;
+ if (!yaml_emitter_write_indicator(emitter, "1.1", 1, 0, 0))
+ return 0;
+ if (!yaml_emitter_write_indent(emitter))
+ return 0;
+ }
+
+ if (event->data.document_start.tag_directives.start
+ != event->data.document_start.tag_directives.end) {
+ implicit = 0;
+ for (tag_directive = event->data.document_start.tag_directives.start;
+ tag_directive != event->data.document_start.tag_directives.end;
+ tag_directive ++) {
+ if (!yaml_emitter_write_indicator(emitter, "%TAG", 1, 0, 0))
+ return 0;
+ if (!yaml_emitter_write_tag_handle(emitter, tag_directive->handle,
+ strlen((char *)tag_directive->handle)))
+ return 0;
+ if (!yaml_emitter_write_tag_content(emitter, tag_directive->prefix,
+ strlen((char *)tag_directive->prefix), 1))
+ return 0;
+ if (!yaml_emitter_write_indent(emitter))
+ return 0;
+ }
+ }
+
+ if (yaml_emitter_check_empty_document(emitter)) {
+ implicit = 0;
+ }
+
+ if (!implicit) {
+ if (!yaml_emitter_write_indent(emitter))
+ return 0;
+ if (!yaml_emitter_write_indicator(emitter, "---", 1, 0, 0))
+ return 0;
+ if (emitter->canonical) {
+ if (!yaml_emitter_write_indent(emitter))
+ return 0;
+ }
+ }
+
+ emitter->state = YAML_EMIT_DOCUMENT_CONTENT_STATE;
+
+ return 1;
+ }
+
+ else if (event->type == YAML_STREAM_END_EVENT)
+ {
+ if (emitter->open_ended)
+ {
+ if (!yaml_emitter_write_indicator(emitter, "...", 1, 0, 0))
+ return 0;
+ if (!yaml_emitter_write_indent(emitter))
+ return 0;
+ }
+
+ if (!yaml_emitter_flush(emitter))
+ return 0;
+
+ emitter->state = YAML_EMIT_END_STATE;
+
+ return 1;
+ }
+
+ return yaml_emitter_set_emitter_error(emitter,
+ "expected DOCUMENT-START or STREAM-END");
+}
+
+/*
+ * Expect the root node.
+ */
+
+static int
+yaml_emitter_emit_document_content(yaml_emitter_t *emitter,
+ yaml_event_t *event)
+{
+ if (!PUSH(emitter, emitter->states, YAML_EMIT_DOCUMENT_END_STATE))
+ return 0;
+
+ return yaml_emitter_emit_node(emitter, event, 1, 0, 0, 0);
+}
+
+/*
+ * Expect DOCUMENT-END.
+ */
+
+static int
+yaml_emitter_emit_document_end(yaml_emitter_t *emitter,
+ yaml_event_t *event)
+{
+ if (event->type == YAML_DOCUMENT_END_EVENT)
+ {
+ if (!yaml_emitter_write_indent(emitter))
+ return 0;
+ if (!event->data.document_end.implicit) {
+ if (!yaml_emitter_write_indicator(emitter, "...", 1, 0, 0))
+ return 0;
+ if (!yaml_emitter_write_indent(emitter))
+ return 0;
+ }
+ if (!yaml_emitter_flush(emitter))
+ return 0;
+
+ emitter->state = YAML_EMIT_DOCUMENT_START_STATE;
+
+ while (!STACK_EMPTY(emitter, emitter->tag_directives)) {
+ yaml_tag_directive_t tag_directive = POP(emitter,
+ emitter->tag_directives);
+ yaml_free(tag_directive.handle);
+ yaml_free(tag_directive.prefix);
+ }
+
+ return 1;
+ }
+
+ return yaml_emitter_set_emitter_error(emitter,
+ "expected DOCUMENT-END");
+}
+
+/*
+ *
+ * Expect a flow item node.
+ */
+
+static int
+yaml_emitter_emit_flow_sequence_item(yaml_emitter_t *emitter,
+ yaml_event_t *event, int first)
+{
+ if (first)
+ {
+ if (!yaml_emitter_write_indicator(emitter, "[", 1, 1, 0))
+ return 0;
+ if (!yaml_emitter_increase_indent(emitter, 1, 0))
+ return 0;
+ emitter->flow_level ++;
+ }
+
+ if (event->type == YAML_SEQUENCE_END_EVENT)
+ {
+ emitter->flow_level --;
+ emitter->indent = POP(emitter, emitter->indents);
+ if (emitter->canonical && !first) {
+ if (!yaml_emitter_write_indicator(emitter, ",", 0, 0, 0))
+ return 0;
+ if (!yaml_emitter_write_indent(emitter))
+ return 0;
+ }
+ if (!yaml_emitter_write_indicator(emitter, "]", 0, 0, 0))
+ return 0;
+ emitter->state = POP(emitter, emitter->states);
+
+ return 1;
+ }
+
+ if (!first) {
+ if (!yaml_emitter_write_indicator(emitter, ",", 0, 0, 0))
+ return 0;
+ }
+
+ if (emitter->canonical || emitter->column > emitter->best_width) {
+ if (!yaml_emitter_write_indent(emitter))
+ return 0;
+ }
+ if (!PUSH(emitter, emitter->states, YAML_EMIT_FLOW_SEQUENCE_ITEM_STATE))
+ return 0;
+
+ return yaml_emitter_emit_node(emitter, event, 0, 1, 0, 0);
+}
+
+/*
+ * Expect a flow key node.
+ */
+
+static int
+yaml_emitter_emit_flow_mapping_key(yaml_emitter_t *emitter,
+ yaml_event_t *event, int first)
+{
+ if (first)
+ {
+ if (!yaml_emitter_write_indicator(emitter, "{", 1, 1, 0))
+ return 0;
+ if (!yaml_emitter_increase_indent(emitter, 1, 0))
+ return 0;
+ emitter->flow_level ++;
+ }
+
+ if (event->type == YAML_MAPPING_END_EVENT)
+ {
+ emitter->flow_level --;
+ emitter->indent = POP(emitter, emitter->indents);
+ if (emitter->canonical && !first) {
+ if (!yaml_emitter_write_indicator(emitter, ",", 0, 0, 0))
+ return 0;
+ if (!yaml_emitter_write_indent(emitter))
+ return 0;
+ }
+ if (!yaml_emitter_write_indicator(emitter, "}", 0, 0, 0))
+ return 0;
+ emitter->state = POP(emitter, emitter->states);
+
+ return 1;
+ }
+
+ if (!first) {
+ if (!yaml_emitter_write_indicator(emitter, ",", 0, 0, 0))
+ return 0;
+ }
+ if (emitter->canonical || emitter->column > emitter->best_width) {
+ if (!yaml_emitter_write_indent(emitter))
+ return 0;
+ }
+
+ if (!emitter->canonical && yaml_emitter_check_simple_key(emitter))
+ {
+ if (!PUSH(emitter, emitter->states,
+ YAML_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE))
+ return 0;
+
+ return yaml_emitter_emit_node(emitter, event, 0, 0, 1, 1);
+ }
+ else
+ {
+ if (!yaml_emitter_write_indicator(emitter, "?", 1, 0, 0))
+ return 0;
+ if (!PUSH(emitter, emitter->states,
+ YAML_EMIT_FLOW_MAPPING_VALUE_STATE))
+ return 0;
+
+ return yaml_emitter_emit_node(emitter, event, 0, 0, 1, 0);
+ }
+}
+
+/*
+ * Expect a flow value node.
+ */
+
+static int
+yaml_emitter_emit_flow_mapping_value(yaml_emitter_t *emitter,
+ yaml_event_t *event, int simple)
+{
+ if (simple) {
+ if (!yaml_emitter_write_indicator(emitter, ":", 0, 0, 0))
+ return 0;
+ }
+ else {
+ if (emitter->canonical || emitter->column > emitter->best_width) {
+ if (!yaml_emitter_write_indent(emitter))
+ return 0;
+ }
+ if (!yaml_emitter_write_indicator(emitter, ":", 1, 0, 0))
+ return 0;
+ }
+ if (!PUSH(emitter, emitter->states, YAML_EMIT_FLOW_MAPPING_KEY_STATE))
+ return 0;
+ return yaml_emitter_emit_node(emitter, event, 0, 0, 1, 0);
+}
+
+/*
+ * Expect a block item node.
+ */
+
+static int
+yaml_emitter_emit_block_sequence_item(yaml_emitter_t *emitter,
+ yaml_event_t *event, int first)
+{
+ if (first)
+ {
+ if (!yaml_emitter_increase_indent(emitter, 0,
+ (emitter->mapping_context && !emitter->indention)))
+ return 0;
+ }
+
+ if (event->type == YAML_SEQUENCE_END_EVENT)
+ {
+ emitter->indent = POP(emitter, emitter->indents);
+ emitter->state = POP(emitter, emitter->states);
+
+ return 1;
+ }
+
+ if (!yaml_emitter_write_indent(emitter))
+ return 0;
+ if (!yaml_emitter_write_indicator(emitter, "-", 1, 0, 1))
+ return 0;
+ if (!PUSH(emitter, emitter->states,
+ YAML_EMIT_BLOCK_SEQUENCE_ITEM_STATE))
+ return 0;
+
+ return yaml_emitter_emit_node(emitter, event, 0, 1, 0, 0);
+}
+
+/*
+ * Expect a block key node.
+ */
+
+static int
+yaml_emitter_emit_block_mapping_key(yaml_emitter_t *emitter,
+ yaml_event_t *event, int first)
+{
+ if (first)
+ {
+ if (!yaml_emitter_increase_indent(emitter, 0, 0))
+ return 0;
+ }
+
+ if (event->type == YAML_MAPPING_END_EVENT)
+ {
+ emitter->indent = POP(emitter, emitter->indents);
+ emitter->state = POP(emitter, emitter->states);
+
+ return 1;
+ }
+
+ if (!yaml_emitter_write_indent(emitter))
+ return 0;
+
+ if (yaml_emitter_check_simple_key(emitter))
+ {
+ if (!PUSH(emitter, emitter->states,
+ YAML_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE))
+ return 0;
+
+ return yaml_emitter_emit_node(emitter, event, 0, 0, 1, 1);
+ }
+ else
+ {
+ if (!yaml_emitter_write_indicator(emitter, "?", 1, 0, 1))
+ return 0;
+ if (!PUSH(emitter, emitter->states,
+ YAML_EMIT_BLOCK_MAPPING_VALUE_STATE))
+ return 0;
+
+ return yaml_emitter_emit_node(emitter, event, 0, 0, 1, 0);
+ }
+}
+
+/*
+ * Expect a block value node.
+ */
+
+static int
+yaml_emitter_emit_block_mapping_value(yaml_emitter_t *emitter,
+ yaml_event_t *event, int simple)
+{
+ if (simple) {
+ if (!yaml_emitter_write_indicator(emitter, ":", 0, 0, 0))
+ return 0;
+ }
+ else {
+ if (!yaml_emitter_write_indent(emitter))
+ return 0;
+ if (!yaml_emitter_write_indicator(emitter, ":", 1, 0, 1))
+ return 0;
+ }
+ if (!PUSH(emitter, emitter->states,
+ YAML_EMIT_BLOCK_MAPPING_KEY_STATE))
+ return 0;
+
+ return yaml_emitter_emit_node(emitter, event, 0, 0, 1, 0);
+}
+
+/*
+ * Expect a node.
+ */
+
+static int
+yaml_emitter_emit_node(yaml_emitter_t *emitter, yaml_event_t *event,
+ int root, int sequence, int mapping, int simple_key)
+{
+ emitter->root_context = root;
+ emitter->sequence_context = sequence;
+ emitter->mapping_context = mapping;
+ emitter->simple_key_context = simple_key;
+
+ switch (event->type)
+ {
+ case YAML_ALIAS_EVENT:
+ return yaml_emitter_emit_alias(emitter, event);
+
+ case YAML_SCALAR_EVENT:
+ return yaml_emitter_emit_scalar(emitter, event);
+
+ case YAML_SEQUENCE_START_EVENT:
+ return yaml_emitter_emit_sequence_start(emitter, event);
+
+ case YAML_MAPPING_START_EVENT:
+ return yaml_emitter_emit_mapping_start(emitter, event);
+
+ default:
+ return yaml_emitter_set_emitter_error(emitter,
+ "expected SCALAR, SEQUENCE-START, MAPPING-START, or ALIAS");
+ }
+
+ return 0;
+}
+
+/*
+ * Expect ALIAS.
+ */
+
+static int
+yaml_emitter_emit_alias(yaml_emitter_t *emitter, yaml_event_t *event)
+{
+ if (!yaml_emitter_process_anchor(emitter))
+ return 0;
+ emitter->state = POP(emitter, emitter->states);
+
+ return 1;
+}
+
+/*
+ * Expect SCALAR.
+ */
+
+static int
+yaml_emitter_emit_scalar(yaml_emitter_t *emitter, yaml_event_t *event)
+{
+ if (!yaml_emitter_select_scalar_style(emitter, event))
+ return 0;
+ if (!yaml_emitter_process_anchor(emitter))
+ return 0;
+ if (!yaml_emitter_process_tag(emitter))
+ return 0;
+ if (!yaml_emitter_increase_indent(emitter, 1, 0))
+ return 0;
+ if (!yaml_emitter_process_scalar(emitter))
+ return 0;
+ emitter->indent = POP(emitter, emitter->indents);
+ emitter->state = POP(emitter, emitter->states);
+
+ return 1;
+}
+
+/*
+ * Expect SEQUENCE-START.
+ */
+
+static int
+yaml_emitter_emit_sequence_start(yaml_emitter_t *emitter, yaml_event_t *event)
+{
+ if (!yaml_emitter_process_anchor(emitter))
+ return 0;
+ if (!yaml_emitter_process_tag(emitter))
+ return 0;
+
+ if (emitter->flow_level || emitter->canonical
+ || event->data.sequence_start.style == YAML_FLOW_SEQUENCE_STYLE
+ || yaml_emitter_check_empty_sequence(emitter)) {
+ emitter->state = YAML_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE;
+ }
+ else {
+ emitter->state = YAML_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE;
+ }
+
+ return 1;
+}
+
+/*
+ * Expect MAPPING-START.
+ */
+
+static int
+yaml_emitter_emit_mapping_start(yaml_emitter_t *emitter, yaml_event_t *event)
+{
+ if (!yaml_emitter_process_anchor(emitter))
+ return 0;
+ if (!yaml_emitter_process_tag(emitter))
+ return 0;
+
+ if (emitter->flow_level || emitter->canonical
+ || event->data.mapping_start.style == YAML_FLOW_MAPPING_STYLE
+ || yaml_emitter_check_empty_mapping(emitter)) {
+ emitter->state = YAML_EMIT_FLOW_MAPPING_FIRST_KEY_STATE;
+ }
+ else {
+ emitter->state = YAML_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE;
+ }
+
+ return 1;
+}
+
+/*
+ * Check if the document content is an empty scalar.
+ */
+
+static int
+yaml_emitter_check_empty_document(yaml_emitter_t *emitter)
+{
+ return 0;
+}
+
+/*
+ * Check if the next events represent an empty sequence.
+ */
+
+static int
+yaml_emitter_check_empty_sequence(yaml_emitter_t *emitter)
+{
+ if (emitter->events.tail - emitter->events.head < 2)
+ return 0;
+
+ return (emitter->events.head[0].type == YAML_SEQUENCE_START_EVENT
+ && emitter->events.head[1].type == YAML_SEQUENCE_END_EVENT);
+}
+
+/*
+ * Check if the next events represent an empty mapping.
+ */
+
+static int
+yaml_emitter_check_empty_mapping(yaml_emitter_t *emitter)
+{
+ if (emitter->events.tail - emitter->events.head < 2)
+ return 0;
+
+ return (emitter->events.head[0].type == YAML_MAPPING_START_EVENT
+ && emitter->events.head[1].type == YAML_MAPPING_END_EVENT);
+}
+
+/*
+ * Check if the next node can be expressed as a simple key.
+ */
+
+static int
+yaml_emitter_check_simple_key(yaml_emitter_t *emitter)
+{
+ yaml_event_t *event = emitter->events.head;
+ size_t length = 0;
+
+ switch (event->type)
+ {
+ case YAML_ALIAS_EVENT:
+ length += emitter->anchor_data.anchor_length;
+ break;
+
+ case YAML_SCALAR_EVENT:
+ if (emitter->scalar_data.multiline)
+ return 0;
+ length += emitter->anchor_data.anchor_length
+ + emitter->tag_data.handle_length
+ + emitter->tag_data.suffix_length
+ + emitter->scalar_data.length;
+ break;
+
+ case YAML_SEQUENCE_START_EVENT:
+ if (!yaml_emitter_check_empty_sequence(emitter))
+ return 0;
+ length += emitter->anchor_data.anchor_length
+ + emitter->tag_data.handle_length
+ + emitter->tag_data.suffix_length;
+ break;
+
+ case YAML_MAPPING_START_EVENT:
+ if (!yaml_emitter_check_empty_mapping(emitter))
+ return 0;
+ length += emitter->anchor_data.anchor_length
+ + emitter->tag_data.handle_length
+ + emitter->tag_data.suffix_length;
+ break;
+
+ default:
+ return 0;
+ }
+
+ if (length > 128)
+ return 0;
+
+ return 1;
+}
+
+/*
+ * Determine an acceptable scalar style.
+ */
+
+static int
+yaml_emitter_select_scalar_style(yaml_emitter_t *emitter, yaml_event_t *event)
+{
+ yaml_scalar_style_t style = event->data.scalar.style;
+ int no_tag = (!emitter->tag_data.handle && !emitter->tag_data.suffix);
+
+ if (no_tag && !event->data.scalar.plain_implicit
+ && !event->data.scalar.quoted_implicit) {
+ return yaml_emitter_set_emitter_error(emitter,
+ "neither tag nor implicit flags are specified");
+ }
+
+ if (style == YAML_ANY_SCALAR_STYLE)
+ style = YAML_PLAIN_SCALAR_STYLE;
+
+ if (emitter->canonical)
+ style = YAML_DOUBLE_QUOTED_SCALAR_STYLE;
+
+ if (emitter->simple_key_context && emitter->scalar_data.multiline)
+ style = YAML_DOUBLE_QUOTED_SCALAR_STYLE;
+
+ if (style == YAML_PLAIN_SCALAR_STYLE)
+ {
+ if ((emitter->flow_level && !emitter->scalar_data.flow_plain_allowed)
+ || (!emitter->flow_level && !emitter->scalar_data.block_plain_allowed))
+ style = YAML_SINGLE_QUOTED_SCALAR_STYLE;
+ if (!emitter->scalar_data.length
+ && (emitter->flow_level || emitter->simple_key_context))
+ style = YAML_SINGLE_QUOTED_SCALAR_STYLE;
+ if (no_tag && !event->data.scalar.plain_implicit)
+ style = YAML_SINGLE_QUOTED_SCALAR_STYLE;
+ }
+
+ if (style == YAML_SINGLE_QUOTED_SCALAR_STYLE)
+ {
+ if (!emitter->scalar_data.single_quoted_allowed)
+ style = YAML_DOUBLE_QUOTED_SCALAR_STYLE;
+ }
+
+ if (style == YAML_LITERAL_SCALAR_STYLE || style == YAML_FOLDED_SCALAR_STYLE)
+ {
+ if (!emitter->scalar_data.block_allowed
+ || emitter->flow_level || emitter->simple_key_context)
+ style = YAML_DOUBLE_QUOTED_SCALAR_STYLE;
+ }
+
+ if (no_tag && !event->data.scalar.quoted_implicit
+ && style != YAML_PLAIN_SCALAR_STYLE)
+ {
+ emitter->tag_data.handle = (yaml_char_t *)"!";
+ emitter->tag_data.handle_length = 1;
+ }
+
+ emitter->scalar_data.style = style;
+
+ return 1;
+}
+
+/*
+ * Write an achor.
+ */
+
+static int
+yaml_emitter_process_anchor(yaml_emitter_t *emitter)
+{
+ if (!emitter->anchor_data.anchor)
+ return 1;
+
+ if (!yaml_emitter_write_indicator(emitter,
+ (emitter->anchor_data.alias ? "*" : "&"), 1, 0, 0))
+ return 0;
+
+ return yaml_emitter_write_anchor(emitter,
+ emitter->anchor_data.anchor, emitter->anchor_data.anchor_length);
+}
+
+/*
+ * Write a tag.
+ */
+
+static int
+yaml_emitter_process_tag(yaml_emitter_t *emitter)
+{
+ if (!emitter->tag_data.handle && !emitter->tag_data.suffix)
+ return 1;
+
+ if (emitter->tag_data.handle)
+ {
+ if (!yaml_emitter_write_tag_handle(emitter, emitter->tag_data.handle,
+ emitter->tag_data.handle_length))
+ return 0;
+ if (emitter->tag_data.suffix) {
+ if (!yaml_emitter_write_tag_content(emitter, emitter->tag_data.suffix,
+ emitter->tag_data.suffix_length, 0))
+ return 0;
+ }
+ }
+ else
+ {
+ if (!yaml_emitter_write_indicator(emitter, "!<", 1, 0, 0))
+ return 0;
+ if (!yaml_emitter_write_tag_content(emitter, emitter->tag_data.suffix,
+ emitter->tag_data.suffix_length, 0))
+ return 0;
+ if (!yaml_emitter_write_indicator(emitter, ">", 0, 0, 0))
+ return 0;
+ }
+
+ return 1;
+}
+
+/*
+ * Write a scalar.
+ */
+
+static int
+yaml_emitter_process_scalar(yaml_emitter_t *emitter)
+{
+ switch (emitter->scalar_data.style)
+ {
+ case YAML_PLAIN_SCALAR_STYLE:
+ return yaml_emitter_write_plain_scalar(emitter,
+ emitter->scalar_data.value, emitter->scalar_data.length,
+ !emitter->simple_key_context);
+
+ case YAML_SINGLE_QUOTED_SCALAR_STYLE:
+ return yaml_emitter_write_single_quoted_scalar(emitter,
+ emitter->scalar_data.value, emitter->scalar_data.length,
+ !emitter->simple_key_context);
+
+ case YAML_DOUBLE_QUOTED_SCALAR_STYLE:
+ return yaml_emitter_write_double_quoted_scalar(emitter,
+ emitter->scalar_data.value, emitter->scalar_data.length,
+ !emitter->simple_key_context);
+
+ case YAML_LITERAL_SCALAR_STYLE:
+ return yaml_emitter_write_literal_scalar(emitter,
+ emitter->scalar_data.value, emitter->scalar_data.length);
+
+ case YAML_FOLDED_SCALAR_STYLE:
+ return yaml_emitter_write_folded_scalar(emitter,
+ emitter->scalar_data.value, emitter->scalar_data.length);
+
+ default:
+ assert(1); /* Impossible. */
+ }
+
+ return 0;
+}
+
+/*
+ * Check if a %YAML directive is valid.
+ */
+
+static int
+yaml_emitter_analyze_version_directive(yaml_emitter_t *emitter,
+ yaml_version_directive_t version_directive)
+{
+ if (version_directive.major != 1 || version_directive.minor != 1) {
+ return yaml_emitter_set_emitter_error(emitter,
+ "incompatible %YAML directive");
+ }
+
+ return 1;
+}
+
+/*
+ * Check if a %TAG directive is valid.
+ */
+
+static int
+yaml_emitter_analyze_tag_directive(yaml_emitter_t *emitter,
+ yaml_tag_directive_t tag_directive)
+{
+ yaml_string_t handle;
+ yaml_string_t prefix;
+ size_t handle_length;
+ size_t prefix_length;
+
+ handle_length = strlen((char *)tag_directive.handle);
+ prefix_length = strlen((char *)tag_directive.prefix);
+ STRING_ASSIGN(handle, tag_directive.handle, handle_length);
+ STRING_ASSIGN(prefix, tag_directive.prefix, prefix_length);
+
+ if (handle.start == handle.end) {
+ return yaml_emitter_set_emitter_error(emitter,
+ "tag handle must not be empty");
+ }
+
+ if (handle.start[0] != '!') {
+ return yaml_emitter_set_emitter_error(emitter,
+ "tag handle must start with '!'");
+ }
+
+ if (handle.end[-1] != '!') {
+ return yaml_emitter_set_emitter_error(emitter,
+ "tag handle must end with '!'");
+ }
+
+ handle.pointer ++;
+
+ while (handle.pointer < handle.end-1) {
+ if (!IS_ALPHA(handle)) {
+ return yaml_emitter_set_emitter_error(emitter,
+ "tag handle must contain alphanumerical characters only");
+ }
+ MOVE(handle);
+ }
+
+ if (prefix.start == prefix.end) {
+ return yaml_emitter_set_emitter_error(emitter,
+ "tag prefix must not be empty");
+ }
+
+ return 1;
+}
+
+/*
+ * Check if an anchor is valid.
+ */
+
+static int
+yaml_emitter_analyze_anchor(yaml_emitter_t *emitter,
+ yaml_char_t *anchor, int alias)
+{
+ size_t anchor_length;
+ yaml_string_t string;
+
+ anchor_length = strlen((char *)anchor);
+ STRING_ASSIGN(string, anchor, anchor_length);
+
+ if (string.start == string.end) {
+ return yaml_emitter_set_emitter_error(emitter, alias ?
+ "alias value must not be empty" :
+ "anchor value must not be empty");
+ }
+
+ while (string.pointer != string.end) {
+ if (!IS_ALPHA(string)) {
+ return yaml_emitter_set_emitter_error(emitter, alias ?
+ "alias value must contain alphanumerical characters only" :
+ "anchor value must contain alphanumerical characters only");
+ }
+ MOVE(string);
+ }
+
+ emitter->anchor_data.anchor = string.start;
+ emitter->anchor_data.anchor_length = string.end - string.start;
+ emitter->anchor_data.alias = alias;
+
+ return 1;
+}
+
+/*
+ * Check if a tag is valid.
+ */
+
+static int
+yaml_emitter_analyze_tag(yaml_emitter_t *emitter,
+ yaml_char_t *tag)
+{
+ size_t tag_length;
+ yaml_string_t string;
+ yaml_tag_directive_t *tag_directive;
+
+ tag_length = strlen((char *)tag);
+ STRING_ASSIGN(string, tag, tag_length);
+
+ if (string.start == string.end) {
+ return yaml_emitter_set_emitter_error(emitter,
+ "tag value must not be empty");
+ }
+
+ for (tag_directive = emitter->tag_directives.start;
+ tag_directive != emitter->tag_directives.top; tag_directive ++) {
+ size_t prefix_length = strlen((char *)tag_directive->prefix);
+ if (prefix_length < (size_t)(string.end - string.start)
+ && strncmp((char *)tag_directive->prefix, (char *)string.start,
+ prefix_length) == 0)
+ {
+ emitter->tag_data.handle = tag_directive->handle;
+ emitter->tag_data.handle_length =
+ strlen((char *)tag_directive->handle);
+ emitter->tag_data.suffix = string.start + prefix_length;
+ emitter->tag_data.suffix_length =
+ (string.end - string.start) - prefix_length;
+ return 1;
+ }
+ }
+
+ emitter->tag_data.suffix = string.start;
+ emitter->tag_data.suffix_length = string.end - string.start;
+
+ return 1;
+}
+
+/*
+ * Check if a scalar is valid.
+ */
+
+static int
+yaml_emitter_analyze_scalar(yaml_emitter_t *emitter,
+ yaml_char_t *value, size_t length)
+{
+ yaml_string_t string;
+
+ int block_indicators = 0;
+ int flow_indicators = 0;
+ int line_breaks = 0;
+ int special_characters = 0;
+
+ int leading_space = 0;
+ int leading_break = 0;
+ int trailing_space = 0;
+ int trailing_break = 0;
+ int break_space = 0;
+ int space_break = 0;
+
+ int preceeded_by_whitespace = 0;
+ int followed_by_whitespace = 0;
+ int previous_space = 0;
+ int previous_break = 0;
+
+ STRING_ASSIGN(string, value, length);
+
+ emitter->scalar_data.value = value;
+ emitter->scalar_data.length = length;
+
+ if (string.start == string.end)
+ {
+ emitter->scalar_data.multiline = 0;
+ emitter->scalar_data.flow_plain_allowed = 0;
+ emitter->scalar_data.block_plain_allowed = 1;
+ emitter->scalar_data.single_quoted_allowed = 1;
+ emitter->scalar_data.block_allowed = 0;
+
+ return 1;
+ }
+
+ if ((CHECK_AT(string, '-', 0)
+ && CHECK_AT(string, '-', 1)
+ && CHECK_AT(string, '-', 2))
+ || (CHECK_AT(string, '.', 0)
+ && CHECK_AT(string, '.', 1)
+ && CHECK_AT(string, '.', 2))) {
+ block_indicators = 1;
+ flow_indicators = 1;
+ }
+
+ preceeded_by_whitespace = 1;
+ followed_by_whitespace = IS_BLANKZ_AT(string, WIDTH(string));
+
+ while (string.pointer != string.end)
+ {
+ if (string.start == string.pointer)
+ {
+ if (CHECK(string, '#') || CHECK(string, ',')
+ || CHECK(string, '[') || CHECK(string, ']')
+ || CHECK(string, '{') || CHECK(string, '}')
+ || CHECK(string, '&') || CHECK(string, '*')
+ || CHECK(string, '!') || CHECK(string, '|')
+ || CHECK(string, '>') || CHECK(string, '\'')
+ || CHECK(string, '"') || CHECK(string, '%')
+ || CHECK(string, '@') || CHECK(string, '`')) {
+ flow_indicators = 1;
+ block_indicators = 1;
+ }
+
+ if (CHECK(string, '?') || CHECK(string, ':')) {
+ flow_indicators = 1;
+ if (followed_by_whitespace) {
+ block_indicators = 1;
+ }
+ }
+
+ if (CHECK(string, '-') && followed_by_whitespace) {
+ flow_indicators = 1;
+ block_indicators = 1;
+ }
+ }
+ else
+ {
+ if (CHECK(string, ',') || CHECK(string, '?')
+ || CHECK(string, '[') || CHECK(string, ']')
+ || CHECK(string, '{') || CHECK(string, '}')) {
+ flow_indicators = 1;
+ }
+
+ if (CHECK(string, ':')) {
+ flow_indicators = 1;
+ if (followed_by_whitespace) {
+ block_indicators = 1;
+ }
+ }
+
+ if (CHECK(string, '#') && preceeded_by_whitespace) {
+ flow_indicators = 1;
+ block_indicators = 1;
+ }
+ }
+
+ if (!IS_PRINTABLE(string)
+ || (!IS_ASCII(string) && !emitter->unicode)) {
+ special_characters = 1;
+ }
+
+ if (IS_BREAK(string)) {
+ line_breaks = 1;
+ }
+
+ if (IS_SPACE(string))
+ {
+ if (string.start == string.pointer) {
+ leading_space = 1;
+ }
+ if (string.pointer+WIDTH(string) == string.end) {
+ trailing_space = 1;
+ }
+ if (previous_break) {
+ break_space = 1;
+ }
+ previous_space = 1;
+ previous_break = 0;
+ }
+ else if (IS_BREAK(string))
+ {
+ if (string.start == string.pointer) {
+ leading_break = 1;
+ }
+ if (string.pointer+WIDTH(string) == string.end) {
+ trailing_break = 1;
+ }
+ if (previous_space) {
+ space_break = 1;
+ }
+ previous_space = 0;
+ previous_break = 1;
+ }
+ else
+ {
+ previous_space = 0;
+ previous_break = 0;
+ }
+
+ preceeded_by_whitespace = IS_BLANKZ(string);
+ MOVE(string);
+ if (string.pointer != string.end) {
+ followed_by_whitespace = IS_BLANKZ_AT(string, WIDTH(string));
+ }
+ }
+
+ emitter->scalar_data.multiline = line_breaks;
+
+ emitter->scalar_data.flow_plain_allowed = 1;
+ emitter->scalar_data.block_plain_allowed = 1;
+ emitter->scalar_data.single_quoted_allowed = 1;
+ emitter->scalar_data.block_allowed = 1;
+
+ if (leading_space || leading_break || trailing_space || trailing_break) {
+ emitter->scalar_data.flow_plain_allowed = 0;
+ emitter->scalar_data.block_plain_allowed = 0;
+ }
+
+ if (trailing_space) {
+ emitter->scalar_data.block_allowed = 0;
+ }
+
+ if (break_space) {
+ emitter->scalar_data.flow_plain_allowed = 0;
+ emitter->scalar_data.block_plain_allowed = 0;
+ emitter->scalar_data.single_quoted_allowed = 0;
+ }
+
+ if (space_break || special_characters) {
+ emitter->scalar_data.flow_plain_allowed = 0;
+ emitter->scalar_data.block_plain_allowed = 0;
+ emitter->scalar_data.single_quoted_allowed = 0;
+ emitter->scalar_data.block_allowed = 0;
+ }
+
+ if (line_breaks) {
+ emitter->scalar_data.flow_plain_allowed = 0;
+ emitter->scalar_data.block_plain_allowed = 0;
+ }
+
+ if (flow_indicators) {
+ emitter->scalar_data.flow_plain_allowed = 0;
+ }
+
+ if (block_indicators) {
+ emitter->scalar_data.block_plain_allowed = 0;
+ }
+
+ return 1;
+}
+
+/*
+ * Check if the event data is valid.
+ */
+
+static int
+yaml_emitter_analyze_event(yaml_emitter_t *emitter,
+ yaml_event_t *event)
+{
+ emitter->anchor_data.anchor = NULL;
+ emitter->anchor_data.anchor_length = 0;
+ emitter->tag_data.handle = NULL;
+ emitter->tag_data.handle_length = 0;
+ emitter->tag_data.suffix = NULL;
+ emitter->tag_data.suffix_length = 0;
+ emitter->scalar_data.value = NULL;
+ emitter->scalar_data.length = 0;
+
+ switch (event->type)
+ {
+ case YAML_ALIAS_EVENT:
+ if (!yaml_emitter_analyze_anchor(emitter,
+ event->data.alias.anchor, 1))
+ return 0;
+ return 1;
+
+ case YAML_SCALAR_EVENT:
+ if (event->data.scalar.anchor) {
+ if (!yaml_emitter_analyze_anchor(emitter,
+ event->data.scalar.anchor, 0))
+ return 0;
+ }
+ if (event->data.scalar.tag && (emitter->canonical ||
+ (!event->data.scalar.plain_implicit
+ && !event->data.scalar.quoted_implicit))) {
+ if (!yaml_emitter_analyze_tag(emitter, event->data.scalar.tag))
+ return 0;
+ }
+ if (!yaml_emitter_analyze_scalar(emitter,
+ event->data.scalar.value, event->data.scalar.length))
+ return 0;
+ return 1;
+
+ case YAML_SEQUENCE_START_EVENT:
+ if (event->data.sequence_start.anchor) {
+ if (!yaml_emitter_analyze_anchor(emitter,
+ event->data.sequence_start.anchor, 0))
+ return 0;
+ }
+ if (event->data.sequence_start.tag && (emitter->canonical ||
+ !event->data.sequence_start.implicit)) {
+ if (!yaml_emitter_analyze_tag(emitter,
+ event->data.sequence_start.tag))
+ return 0;
+ }
+ return 1;
+
+ case YAML_MAPPING_START_EVENT:
+ if (event->data.mapping_start.anchor) {
+ if (!yaml_emitter_analyze_anchor(emitter,
+ event->data.mapping_start.anchor, 0))
+ return 0;
+ }
+ if (event->data.mapping_start.tag && (emitter->canonical ||
+ !event->data.mapping_start.implicit)) {
+ if (!yaml_emitter_analyze_tag(emitter,
+ event->data.mapping_start.tag))
+ return 0;
+ }
+ return 1;
+
+ default:
+ return 1;
+ }
+}
+
+/*
+ * Write the BOM character.
+ */
+
+static int
+yaml_emitter_write_bom(yaml_emitter_t *emitter)
+{
+ if (!FLUSH(emitter)) return 0;
+
+ *(emitter->buffer.pointer++) = (yaml_char_t) '\xEF';
+ *(emitter->buffer.pointer++) = (yaml_char_t) '\xBB';
+ *(emitter->buffer.pointer++) = (yaml_char_t) '\xBF';
+
+ return 1;
+}
+
+static int
+yaml_emitter_write_indent(yaml_emitter_t *emitter)
+{
+ int indent = (emitter->indent >= 0) ? emitter->indent : 0;
+
+ if (!emitter->indention || emitter->column > indent
+ || (emitter->column == indent && !emitter->whitespace)) {
+ if (!PUT_BREAK(emitter)) return 0;
+ }
+
+ while (emitter->column < indent) {
+ if (!PUT(emitter, ' ')) return 0;
+ }
+
+ emitter->whitespace = 1;
+ emitter->indention = 1;
+
+ return 1;
+}
+
+static int
+yaml_emitter_write_indicator(yaml_emitter_t *emitter,
+ const char *indicator, int need_whitespace,
+ int is_whitespace, int is_indention)
+{
+ size_t indicator_length;
+ yaml_string_t string;
+
+ indicator_length = strlen(indicator);
+ STRING_ASSIGN(string, (yaml_char_t *)indicator, indicator_length);
+
+ if (need_whitespace && !emitter->whitespace) {
+ if (!PUT(emitter, ' ')) return 0;
+ }
+
+ while (string.pointer != string.end) {
+ if (!WRITE(emitter, string)) return 0;
+ }
+
+ emitter->whitespace = is_whitespace;
+ emitter->indention = (emitter->indention && is_indention);
+ emitter->open_ended = 0;
+
+ return 1;
+}
+
+static int
+yaml_emitter_write_anchor(yaml_emitter_t *emitter,
+ yaml_char_t *value, size_t length)
+{
+ yaml_string_t string;
+ STRING_ASSIGN(string, value, length);
+
+ while (string.pointer != string.end) {
+ if (!WRITE(emitter, string)) return 0;
+ }
+
+ emitter->whitespace = 0;
+ emitter->indention = 0;
+
+ return 1;
+}
+
+static int
+yaml_emitter_write_tag_handle(yaml_emitter_t *emitter,
+ yaml_char_t *value, size_t length)
+{
+ yaml_string_t string;
+ STRING_ASSIGN(string, value, length);
+
+ if (!emitter->whitespace) {
+ if (!PUT(emitter, ' ')) return 0;
+ }
+
+ while (string.pointer != string.end) {
+ if (!WRITE(emitter, string)) return 0;
+ }
+
+ emitter->whitespace = 0;
+ emitter->indention = 0;
+
+ return 1;
+}
+
+static int
+yaml_emitter_write_tag_content(yaml_emitter_t *emitter,
+ yaml_char_t *value, size_t length,
+ int need_whitespace)
+{
+ yaml_string_t string;
+ STRING_ASSIGN(string, value, length);
+
+ if (need_whitespace && !emitter->whitespace) {
+ if (!PUT(emitter, ' ')) return 0;
+ }
+
+ while (string.pointer != string.end) {
+ if (IS_ALPHA(string)
+ || CHECK(string, ';') || CHECK(string, '/')
+ || CHECK(string, '?') || CHECK(string, ':')
+ || CHECK(string, '@') || CHECK(string, '&')
+ || CHECK(string, '=') || CHECK(string, '+')
+ || CHECK(string, '$') || CHECK(string, ',')
+ || CHECK(string, '_') || CHECK(string, '.')
+ || CHECK(string, '~') || CHECK(string, '*')
+ || CHECK(string, '\'') || CHECK(string, '(')
+ || CHECK(string, ')') || CHECK(string, '[')
+ || CHECK(string, ']')) {
+ if (!WRITE(emitter, string)) return 0;
+ }
+ else {
+ int width = WIDTH(string);
+ unsigned int value;
+ while (width --) {
+ value = *(string.pointer++);
+ if (!PUT(emitter, '%')) return 0;
+ if (!PUT(emitter, (value >> 4)
+ + ((value >> 4) < 10 ? '0' : 'A' - 10)))
+ return 0;
+ if (!PUT(emitter, (value & 0x0F)
+ + ((value & 0x0F) < 10 ? '0' : 'A' - 10)))
+ return 0;
+ }
+ }
+ }
+
+ emitter->whitespace = 0;
+ emitter->indention = 0;
+
+ return 1;
+}
+
+static int
+yaml_emitter_write_plain_scalar(yaml_emitter_t *emitter,
+ yaml_char_t *value, size_t length, int allow_breaks)
+{
+ yaml_string_t string;
+ int spaces = 0;
+ int breaks = 0;
+
+ STRING_ASSIGN(string, value, length);
+
+ if (!emitter->whitespace) {
+ if (!PUT(emitter, ' ')) return 0;
+ }
+
+ while (string.pointer != string.end)
+ {
+ if (IS_SPACE(string))
+ {
+ if (allow_breaks && !spaces
+ && emitter->column > emitter->best_width
+ && !IS_SPACE_AT(string, 1)) {
+ if (!yaml_emitter_write_indent(emitter)) return 0;
+ MOVE(string);
+ }
+ else {
+ if (!WRITE(emitter, string)) return 0;
+ }
+ spaces = 1;
+ }
+ else if (IS_BREAK(string))
+ {
+ if (!breaks && CHECK(string, '\n')) {
+ if (!PUT_BREAK(emitter)) return 0;
+ }
+ if (!WRITE_BREAK(emitter, string)) return 0;
+ emitter->indention = 1;
+ breaks = 1;
+ }
+ else
+ {
+ if (breaks) {
+ if (!yaml_emitter_write_indent(emitter)) return 0;
+ }
+ if (!WRITE(emitter, string)) return 0;
+ emitter->indention = 0;
+ spaces = 0;
+ breaks = 0;
+ }
+ }
+
+ emitter->whitespace = 0;
+ emitter->indention = 0;
+ if (emitter->root_context)
+ {
+ emitter->open_ended = 1;
+ }
+
+ return 1;
+}
+
+static int
+yaml_emitter_write_single_quoted_scalar(yaml_emitter_t *emitter,
+ yaml_char_t *value, size_t length, int allow_breaks)
+{
+ yaml_string_t string;
+ int spaces = 0;
+ int breaks = 0;
+
+ STRING_ASSIGN(string, value, length);
+
+ if (!yaml_emitter_write_indicator(emitter, "'", 1, 0, 0))
+ return 0;
+
+ while (string.pointer != string.end)
+ {
+ if (IS_SPACE(string))
+ {
+ if (allow_breaks && !spaces
+ && emitter->column > emitter->best_width
+ && string.pointer != string.start
+ && string.pointer != string.end - 1
+ && !IS_SPACE_AT(string, 1)) {
+ if (!yaml_emitter_write_indent(emitter)) return 0;
+ MOVE(string);
+ }
+ else {
+ if (!WRITE(emitter, string)) return 0;
+ }
+ spaces = 1;
+ }
+ else if (IS_BREAK(string))
+ {
+ if (!breaks && CHECK(string, '\n')) {
+ if (!PUT_BREAK(emitter)) return 0;
+ }
+ if (!WRITE_BREAK(emitter, string)) return 0;
+ emitter->indention = 1;
+ breaks = 1;
+ }
+ else
+ {
+ if (breaks) {
+ if (!yaml_emitter_write_indent(emitter)) return 0;
+ }
+ if (CHECK(string, '\'')) {
+ if (!PUT(emitter, '\'')) return 0;
+ }
+ if (!WRITE(emitter, string)) return 0;
+ emitter->indention = 0;
+ spaces = 0;
+ breaks = 0;
+ }
+ }
+
+ if (!yaml_emitter_write_indicator(emitter, "'", 0, 0, 0))
+ return 0;
+
+ emitter->whitespace = 0;
+ emitter->indention = 0;
+
+ return 1;
+}
+
+static int
+yaml_emitter_write_double_quoted_scalar(yaml_emitter_t *emitter,
+ yaml_char_t *value, size_t length, int allow_breaks)
+{
+ yaml_string_t string;
+ int spaces = 0;
+
+ STRING_ASSIGN(string, value, length);
+
+ if (!yaml_emitter_write_indicator(emitter, "\"", 1, 0, 0))
+ return 0;
+
+ while (string.pointer != string.end)
+ {
+ if (!IS_PRINTABLE(string) || (!emitter->unicode && !IS_ASCII(string))
+ || IS_BOM(string) || IS_BREAK(string)
+ || CHECK(string, '"') || CHECK(string, '\\'))
+ {
+ unsigned char octet;
+ unsigned int width;
+ unsigned int value;
+ int k;
+
+ octet = string.pointer[0];
+ width = (octet & 0x80) == 0x00 ? 1 :
+ (octet & 0xE0) == 0xC0 ? 2 :
+ (octet & 0xF0) == 0xE0 ? 3 :
+ (octet & 0xF8) == 0xF0 ? 4 : 0;
+ value = (octet & 0x80) == 0x00 ? octet & 0x7F :
+ (octet & 0xE0) == 0xC0 ? octet & 0x1F :
+ (octet & 0xF0) == 0xE0 ? octet & 0x0F :
+ (octet & 0xF8) == 0xF0 ? octet & 0x07 : 0;
+ for (k = 1; k < (int)width; k ++) {
+ octet = string.pointer[k];
+ value = (value << 6) + (octet & 0x3F);
+ }
+ string.pointer += width;
+
+ if (!PUT(emitter, '\\')) return 0;
+
+ switch (value)
+ {
+ case 0x00:
+ if (!PUT(emitter, '0')) return 0;
+ break;
+
+ case 0x07:
+ if (!PUT(emitter, 'a')) return 0;
+ break;
+
+ case 0x08:
+ if (!PUT(emitter, 'b')) return 0;
+ break;
+
+ case 0x09:
+ if (!PUT(emitter, 't')) return 0;
+ break;
+
+ case 0x0A:
+ if (!PUT(emitter, 'n')) return 0;
+ break;
+
+ case 0x0B:
+ if (!PUT(emitter, 'v')) return 0;
+ break;
+
+ case 0x0C:
+ if (!PUT(emitter, 'f')) return 0;
+ break;
+
+ case 0x0D:
+ if (!PUT(emitter, 'r')) return 0;
+ break;
+
+ case 0x1B:
+ if (!PUT(emitter, 'e')) return 0;
+ break;
+
+ case 0x22:
+ if (!PUT(emitter, '\"')) return 0;
+ break;
+
+ case 0x5C:
+ if (!PUT(emitter, '\\')) return 0;
+ break;
+
+ case 0x85:
+ if (!PUT(emitter, 'N')) return 0;
+ break;
+
+ case 0xA0:
+ if (!PUT(emitter, '_')) return 0;
+ break;
+
+ case 0x2028:
+ if (!PUT(emitter, 'L')) return 0;
+ break;
+
+ case 0x2029:
+ if (!PUT(emitter, 'P')) return 0;
+ break;
+
+ default:
+ if (value <= 0xFF) {
+ if (!PUT(emitter, 'x')) return 0;
+ width = 2;
+ }
+ else if (value <= 0xFFFF) {
+ if (!PUT(emitter, 'u')) return 0;
+ width = 4;
+ }
+ else {
+ if (!PUT(emitter, 'U')) return 0;
+ width = 8;
+ }
+ for (k = (width-1)*4; k >= 0; k -= 4) {
+ int digit = (value >> k) & 0x0F;
+ if (!PUT(emitter, digit + (digit < 10 ? '0' : 'A'-10)))
+ return 0;
+ }
+ }
+ spaces = 0;
+ }
+ else if (IS_SPACE(string))
+ {
+ if (allow_breaks && !spaces
+ && emitter->column > emitter->best_width
+ && string.pointer != string.start
+ && string.pointer != string.end - 1) {
+ if (!yaml_emitter_write_indent(emitter)) return 0;
+ if (IS_SPACE_AT(string, 1)) {
+ if (!PUT(emitter, '\\')) return 0;
+ }
+ MOVE(string);
+ }
+ else {
+ if (!WRITE(emitter, string)) return 0;
+ }
+ spaces = 1;
+ }
+ else
+ {
+ if (!WRITE(emitter, string)) return 0;
+ spaces = 0;
+ }
+ }
+
+ if (!yaml_emitter_write_indicator(emitter, "\"", 0, 0, 0))
+ return 0;
+
+ emitter->whitespace = 0;
+ emitter->indention = 0;
+
+ return 1;
+}
+
+static int
+yaml_emitter_write_block_scalar_hints(yaml_emitter_t *emitter,
+ yaml_string_t string)
+{
+ char indent_hint[2];
+ const char *chomp_hint = NULL;
+
+ if (IS_SPACE(string) || IS_BREAK(string))
+ {
+ indent_hint[0] = '0' + (char)emitter->best_indent;
+ indent_hint[1] = '\0';
+ if (!yaml_emitter_write_indicator(emitter, indent_hint, 0, 0, 0))
+ return 0;
+ }
+
+ emitter->open_ended = 0;
+
+ string.pointer = string.end;
+ if (string.start == string.pointer)
+ {
+ chomp_hint = "-";
+ }
+ else
+ {
+ do {
+ string.pointer --;
+ } while ((*string.pointer & 0xC0) == 0x80);
+ if (!IS_BREAK(string))
+ {
+ chomp_hint = "-";
+ }
+ else if (string.start == string.pointer)
+ {
+ chomp_hint = "+";
+ emitter->open_ended = 1;
+ }
+ else
+ {
+ do {
+ string.pointer --;
+ } while ((*string.pointer & 0xC0) == 0x80);
+ if (IS_BREAK(string))
+ {
+ chomp_hint = "+";
+ emitter->open_ended = 1;
+ }
+ }
+ }
+
+ if (chomp_hint)
+ {
+ if (!yaml_emitter_write_indicator(emitter, chomp_hint, 0, 0, 0))
+ return 0;
+ }
+
+ return 1;
+}
+
+static int
+yaml_emitter_write_literal_scalar(yaml_emitter_t *emitter,
+ yaml_char_t *value, size_t length)
+{
+ yaml_string_t string;
+ int breaks = 1;
+
+ STRING_ASSIGN(string, value, length);
+
+ if (!yaml_emitter_write_indicator(emitter, "|", 1, 0, 0))
+ return 0;
+ if (!yaml_emitter_write_block_scalar_hints(emitter, string))
+ return 0;
+ if (!PUT_BREAK(emitter)) return 0;
+ emitter->indention = 1;
+ emitter->whitespace = 1;
+
+ while (string.pointer != string.end)
+ {
+ if (IS_BREAK(string))
+ {
+ if (!WRITE_BREAK(emitter, string)) return 0;
+ emitter->indention = 1;
+ breaks = 1;
+ }
+ else
+ {
+ if (breaks) {
+ if (!yaml_emitter_write_indent(emitter)) return 0;
+ }
+ if (!WRITE(emitter, string)) return 0;
+ emitter->indention = 0;
+ breaks = 0;
+ }
+ }
+
+ return 1;
+}
+
+static int
+yaml_emitter_write_folded_scalar(yaml_emitter_t *emitter,
+ yaml_char_t *value, size_t length)
+{
+ yaml_string_t string;
+ int breaks = 1;
+ int leading_spaces = 1;
+
+ STRING_ASSIGN(string, value, length);
+
+ if (!yaml_emitter_write_indicator(emitter, ">", 1, 0, 0))
+ return 0;
+ if (!yaml_emitter_write_block_scalar_hints(emitter, string))
+ return 0;
+ if (!PUT_BREAK(emitter)) return 0;
+ emitter->indention = 1;
+ emitter->whitespace = 1;
+
+ while (string.pointer != string.end)
+ {
+ if (IS_BREAK(string))
+ {
+ if (!breaks && !leading_spaces && CHECK(string, '\n')) {
+ int k = 0;
+ while (IS_BREAK_AT(string, k)) {
+ k += WIDTH_AT(string, k);
+ }
+ if (!IS_BLANKZ_AT(string, k)) {
+ if (!PUT_BREAK(emitter)) return 0;
+ }
+ }
+ if (!WRITE_BREAK(emitter, string)) return 0;
+ emitter->indention = 1;
+ breaks = 1;
+ }
+ else
+ {
+ if (breaks) {
+ if (!yaml_emitter_write_indent(emitter)) return 0;
+ leading_spaces = IS_BLANK(string);
+ }
+ if (!breaks && IS_SPACE(string) && !IS_SPACE_AT(string, 1)
+ && emitter->column > emitter->best_width) {
+ if (!yaml_emitter_write_indent(emitter)) return 0;
+ MOVE(string);
+ }
+ else {
+ if (!WRITE(emitter, string)) return 0;
+ }
+ emitter->indention = 0;
+ breaks = 0;
+ }
+ }
+
+ return 1;
+}
+
diff --git a/ext/psych/yaml/loader.c b/ext/psych/yaml/loader.c
new file mode 100644
index 0000000000..9d3d912663
--- /dev/null
+++ b/ext/psych/yaml/loader.c
@@ -0,0 +1,432 @@
+
+#include "yaml_private.h"
+
+/*
+ * API functions.
+ */
+
+YAML_DECLARE(int)
+yaml_parser_load(yaml_parser_t *parser, yaml_document_t *document);
+
+/*
+ * Error handling.
+ */
+
+static int
+yaml_parser_set_composer_error(yaml_parser_t *parser,
+ const char *problem, yaml_mark_t problem_mark);
+
+static int
+yaml_parser_set_composer_error_context(yaml_parser_t *parser,
+ const char *context, yaml_mark_t context_mark,
+ const char *problem, yaml_mark_t problem_mark);
+
+
+/*
+ * Alias handling.
+ */
+
+static int
+yaml_parser_register_anchor(yaml_parser_t *parser,
+ int index, yaml_char_t *anchor);
+
+/*
+ * Clean up functions.
+ */
+
+static void
+yaml_parser_delete_aliases(yaml_parser_t *parser);
+
+/*
+ * Composer functions.
+ */
+
+static int
+yaml_parser_load_document(yaml_parser_t *parser, yaml_event_t *first_event);
+
+static int
+yaml_parser_load_node(yaml_parser_t *parser, yaml_event_t *first_event);
+
+static int
+yaml_parser_load_alias(yaml_parser_t *parser, yaml_event_t *first_event);
+
+static int
+yaml_parser_load_scalar(yaml_parser_t *parser, yaml_event_t *first_event);
+
+static int
+yaml_parser_load_sequence(yaml_parser_t *parser, yaml_event_t *first_event);
+
+static int
+yaml_parser_load_mapping(yaml_parser_t *parser, yaml_event_t *first_event);
+
+/*
+ * Load the next document of the stream.
+ */
+
+YAML_DECLARE(int)
+yaml_parser_load(yaml_parser_t *parser, yaml_document_t *document)
+{
+ yaml_event_t event;
+
+ assert(parser); /* Non-NULL parser object is expected. */
+ assert(document); /* Non-NULL document object is expected. */
+
+ memset(document, 0, sizeof(yaml_document_t));
+ if (!STACK_INIT(parser, document->nodes, INITIAL_STACK_SIZE))
+ goto error;
+
+ if (!parser->stream_start_produced) {
+ if (!yaml_parser_parse(parser, &event)) goto error;
+ assert(event.type == YAML_STREAM_START_EVENT);
+ /* STREAM-START is expected. */
+ }
+
+ if (parser->stream_end_produced) {
+ return 1;
+ }
+
+ if (!yaml_parser_parse(parser, &event)) goto error;
+ if (event.type == YAML_STREAM_END_EVENT) {
+ return 1;
+ }
+
+ if (!STACK_INIT(parser, parser->aliases, INITIAL_STACK_SIZE))
+ goto error;
+
+ parser->document = document;
+
+ if (!yaml_parser_load_document(parser, &event)) goto error;
+
+ yaml_parser_delete_aliases(parser);
+ parser->document = NULL;
+
+ return 1;
+
+error:
+
+ yaml_parser_delete_aliases(parser);
+ yaml_document_delete(document);
+ parser->document = NULL;
+
+ return 0;
+}
+
+/*
+ * Set composer error.
+ */
+
+static int
+yaml_parser_set_composer_error(yaml_parser_t *parser,
+ const char *problem, yaml_mark_t problem_mark)
+{
+ parser->error = YAML_COMPOSER_ERROR;
+ parser->problem = problem;
+ parser->problem_mark = problem_mark;
+
+ return 0;
+}
+
+/*
+ * Set composer error with context.
+ */
+
+static int
+yaml_parser_set_composer_error_context(yaml_parser_t *parser,
+ const char *context, yaml_mark_t context_mark,
+ const char *problem, yaml_mark_t problem_mark)
+{
+ parser->error = YAML_COMPOSER_ERROR;
+ parser->context = context;
+ parser->context_mark = context_mark;
+ parser->problem = problem;
+ parser->problem_mark = problem_mark;
+
+ return 0;
+}
+
+/*
+ * Delete the stack of aliases.
+ */
+
+static void
+yaml_parser_delete_aliases(yaml_parser_t *parser)
+{
+ while (!STACK_EMPTY(parser, parser->aliases)) {
+ yaml_free(POP(parser, parser->aliases).anchor);
+ }
+ STACK_DEL(parser, parser->aliases);
+}
+
+/*
+ * Compose a document object.
+ */
+
+static int
+yaml_parser_load_document(yaml_parser_t *parser, yaml_event_t *first_event)
+{
+ yaml_event_t event;
+
+ assert(first_event->type == YAML_DOCUMENT_START_EVENT);
+ /* DOCUMENT-START is expected. */
+
+ parser->document->version_directive
+ = first_event->data.document_start.version_directive;
+ parser->document->tag_directives.start
+ = first_event->data.document_start.tag_directives.start;
+ parser->document->tag_directives.end
+ = first_event->data.document_start.tag_directives.end;
+ parser->document->start_implicit
+ = first_event->data.document_start.implicit;
+ parser->document->start_mark = first_event->start_mark;
+
+ if (!yaml_parser_parse(parser, &event)) return 0;
+
+ if (!yaml_parser_load_node(parser, &event)) return 0;
+
+ if (!yaml_parser_parse(parser, &event)) return 0;
+ assert(event.type == YAML_DOCUMENT_END_EVENT);
+ /* DOCUMENT-END is expected. */
+
+ parser->document->end_implicit = event.data.document_end.implicit;
+ parser->document->end_mark = event.end_mark;
+
+ return 1;
+}
+
+/*
+ * Compose a node.
+ */
+
+static int
+yaml_parser_load_node(yaml_parser_t *parser, yaml_event_t *first_event)
+{
+ switch (first_event->type) {
+ case YAML_ALIAS_EVENT:
+ return yaml_parser_load_alias(parser, first_event);
+ case YAML_SCALAR_EVENT:
+ return yaml_parser_load_scalar(parser, first_event);
+ case YAML_SEQUENCE_START_EVENT:
+ return yaml_parser_load_sequence(parser, first_event);
+ case YAML_MAPPING_START_EVENT:
+ return yaml_parser_load_mapping(parser, first_event);
+ default:
+ assert(0); /* Could not happen. */
+ return 0;
+ }
+
+ return 0;
+}
+
+/*
+ * Add an anchor.
+ */
+
+static int
+yaml_parser_register_anchor(yaml_parser_t *parser,
+ int index, yaml_char_t *anchor)
+{
+ yaml_alias_data_t data;
+ yaml_alias_data_t *alias_data;
+
+ if (!anchor) return 1;
+
+ data.anchor = anchor;
+ data.index = index;
+ data.mark = parser->document->nodes.start[index-1].start_mark;
+
+ for (alias_data = parser->aliases.start;
+ alias_data != parser->aliases.top; alias_data ++) {
+ if (strcmp((char *)alias_data->anchor, (char *)anchor) == 0) {
+ yaml_free(anchor);
+ return yaml_parser_set_composer_error_context(parser,
+ "found duplicate anchor; first occurence",
+ alias_data->mark, "second occurence", data.mark);
+ }
+ }
+
+ if (!PUSH(parser, parser->aliases, data)) {
+ yaml_free(anchor);
+ return 0;
+ }
+
+ return 1;
+}
+
+/*
+ * Compose a node corresponding to an alias.
+ */
+
+static int
+yaml_parser_load_alias(yaml_parser_t *parser, yaml_event_t *first_event)
+{
+ yaml_char_t *anchor = first_event->data.alias.anchor;
+ yaml_alias_data_t *alias_data;
+
+ for (alias_data = parser->aliases.start;
+ alias_data != parser->aliases.top; alias_data ++) {
+ if (strcmp((char *)alias_data->anchor, (char *)anchor) == 0) {
+ yaml_free(anchor);
+ return alias_data->index;
+ }
+ }
+
+ yaml_free(anchor);
+ return yaml_parser_set_composer_error(parser, "found undefined alias",
+ first_event->start_mark);
+}
+
+/*
+ * Compose a scalar node.
+ */
+
+static int
+yaml_parser_load_scalar(yaml_parser_t *parser, yaml_event_t *first_event)
+{
+ yaml_node_t node;
+ int index;
+ yaml_char_t *tag = first_event->data.scalar.tag;
+
+ if (!tag || strcmp((char *)tag, "!") == 0) {
+ yaml_free(tag);
+ tag = yaml_strdup((yaml_char_t *)YAML_DEFAULT_SCALAR_TAG);
+ if (!tag) goto error;
+ }
+
+ SCALAR_NODE_INIT(node, tag, first_event->data.scalar.value,
+ first_event->data.scalar.length, first_event->data.scalar.style,
+ first_event->start_mark, first_event->end_mark);
+
+ if (!PUSH(parser, parser->document->nodes, node)) goto error;
+
+ index = parser->document->nodes.top - parser->document->nodes.start;
+
+ if (!yaml_parser_register_anchor(parser, index,
+ first_event->data.scalar.anchor)) return 0;
+
+ return index;
+
+error:
+ yaml_free(tag);
+ yaml_free(first_event->data.scalar.anchor);
+ yaml_free(first_event->data.scalar.value);
+ return 0;
+}
+
+/*
+ * Compose a sequence node.
+ */
+
+static int
+yaml_parser_load_sequence(yaml_parser_t *parser, yaml_event_t *first_event)
+{
+ yaml_event_t event;
+ yaml_node_t node;
+ struct {
+ yaml_node_item_t *start;
+ yaml_node_item_t *end;
+ yaml_node_item_t *top;
+ } items = { NULL, NULL, NULL };
+ int index, item_index;
+ yaml_char_t *tag = first_event->data.sequence_start.tag;
+
+ if (!tag || strcmp((char *)tag, "!") == 0) {
+ yaml_free(tag);
+ tag = yaml_strdup((yaml_char_t *)YAML_DEFAULT_SEQUENCE_TAG);
+ if (!tag) goto error;
+ }
+
+ if (!STACK_INIT(parser, items, INITIAL_STACK_SIZE)) goto error;
+
+ SEQUENCE_NODE_INIT(node, tag, items.start, items.end,
+ first_event->data.sequence_start.style,
+ first_event->start_mark, first_event->end_mark);
+
+ if (!PUSH(parser, parser->document->nodes, node)) goto error;
+
+ index = parser->document->nodes.top - parser->document->nodes.start;
+
+ if (!yaml_parser_register_anchor(parser, index,
+ first_event->data.sequence_start.anchor)) return 0;
+
+ if (!yaml_parser_parse(parser, &event)) return 0;
+
+ while (event.type != YAML_SEQUENCE_END_EVENT) {
+ item_index = yaml_parser_load_node(parser, &event);
+ if (!item_index) return 0;
+ if (!PUSH(parser,
+ parser->document->nodes.start[index-1].data.sequence.items,
+ item_index)) return 0;
+ if (!yaml_parser_parse(parser, &event)) return 0;
+ }
+
+ parser->document->nodes.start[index-1].end_mark = event.end_mark;
+
+ return index;
+
+error:
+ yaml_free(tag);
+ yaml_free(first_event->data.sequence_start.anchor);
+ return 0;
+}
+
+/*
+ * Compose a mapping node.
+ */
+
+static int
+yaml_parser_load_mapping(yaml_parser_t *parser, yaml_event_t *first_event)
+{
+ yaml_event_t event;
+ yaml_node_t node;
+ struct {
+ yaml_node_pair_t *start;
+ yaml_node_pair_t *end;
+ yaml_node_pair_t *top;
+ } pairs = { NULL, NULL, NULL };
+ int index;
+ yaml_node_pair_t pair;
+ yaml_char_t *tag = first_event->data.mapping_start.tag;
+
+ if (!tag || strcmp((char *)tag, "!") == 0) {
+ yaml_free(tag);
+ tag = yaml_strdup((yaml_char_t *)YAML_DEFAULT_MAPPING_TAG);
+ if (!tag) goto error;
+ }
+
+ if (!STACK_INIT(parser, pairs, INITIAL_STACK_SIZE)) goto error;
+
+ MAPPING_NODE_INIT(node, tag, pairs.start, pairs.end,
+ first_event->data.mapping_start.style,
+ first_event->start_mark, first_event->end_mark);
+
+ if (!PUSH(parser, parser->document->nodes, node)) goto error;
+
+ index = parser->document->nodes.top - parser->document->nodes.start;
+
+ if (!yaml_parser_register_anchor(parser, index,
+ first_event->data.mapping_start.anchor)) return 0;
+
+ if (!yaml_parser_parse(parser, &event)) return 0;
+
+ while (event.type != YAML_MAPPING_END_EVENT) {
+ pair.key = yaml_parser_load_node(parser, &event);
+ if (!pair.key) return 0;
+ if (!yaml_parser_parse(parser, &event)) return 0;
+ pair.value = yaml_parser_load_node(parser, &event);
+ if (!pair.value) return 0;
+ if (!PUSH(parser,
+ parser->document->nodes.start[index-1].data.mapping.pairs,
+ pair)) return 0;
+ if (!yaml_parser_parse(parser, &event)) return 0;
+ }
+
+ parser->document->nodes.start[index-1].end_mark = event.end_mark;
+
+ return index;
+
+error:
+ yaml_free(tag);
+ yaml_free(first_event->data.mapping_start.anchor);
+ return 0;
+}
+
diff --git a/ext/psych/yaml/parser.c b/ext/psych/yaml/parser.c
new file mode 100644
index 0000000000..eb2a2c792b
--- /dev/null
+++ b/ext/psych/yaml/parser.c
@@ -0,0 +1,1374 @@
+
+/*
+ * The parser implements the following grammar:
+ *
+ * stream ::= STREAM-START implicit_document? explicit_document* STREAM-END
+ * implicit_document ::= block_node DOCUMENT-END*
+ * explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
+ * block_node_or_indentless_sequence ::=
+ * ALIAS
+ * | properties (block_content | indentless_block_sequence)?
+ * | block_content
+ * | indentless_block_sequence
+ * block_node ::= ALIAS
+ * | properties block_content?
+ * | block_content
+ * flow_node ::= ALIAS
+ * | properties flow_content?
+ * | flow_content
+ * properties ::= TAG ANCHOR? | ANCHOR TAG?
+ * block_content ::= block_collection | flow_collection | SCALAR
+ * flow_content ::= flow_collection | SCALAR
+ * block_collection ::= block_sequence | block_mapping
+ * flow_collection ::= flow_sequence | flow_mapping
+ * block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END
+ * indentless_sequence ::= (BLOCK-ENTRY block_node?)+
+ * block_mapping ::= BLOCK-MAPPING_START
+ * ((KEY block_node_or_indentless_sequence?)?
+ * (VALUE block_node_or_indentless_sequence?)?)*
+ * BLOCK-END
+ * flow_sequence ::= FLOW-SEQUENCE-START
+ * (flow_sequence_entry FLOW-ENTRY)*
+ * flow_sequence_entry?
+ * FLOW-SEQUENCE-END
+ * flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
+ * flow_mapping ::= FLOW-MAPPING-START
+ * (flow_mapping_entry FLOW-ENTRY)*
+ * flow_mapping_entry?
+ * FLOW-MAPPING-END
+ * flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
+ */
+
+#include "yaml_private.h"
+
+/*
+ * Peek the next token in the token queue.
+ */
+
+#define PEEK_TOKEN(parser) \
+ ((parser->token_available || yaml_parser_fetch_more_tokens(parser)) ? \
+ parser->tokens.head : NULL)
+
+/*
+ * Remove the next token from the queue (must be called after PEEK_TOKEN).
+ */
+
+#define SKIP_TOKEN(parser) \
+ (parser->token_available = 0, \
+ parser->tokens_parsed ++, \
+ parser->stream_end_produced = \
+ (parser->tokens.head->type == YAML_STREAM_END_TOKEN), \
+ parser->tokens.head ++)
+
+/*
+ * Public API declarations.
+ */
+
+YAML_DECLARE(int)
+yaml_parser_parse(yaml_parser_t *parser, yaml_event_t *event);
+
+/*
+ * Error handling.
+ */
+
+static int
+yaml_parser_set_parser_error(yaml_parser_t *parser,
+ const char *problem, yaml_mark_t problem_mark);
+
+static int
+yaml_parser_set_parser_error_context(yaml_parser_t *parser,
+ const char *context, yaml_mark_t context_mark,
+ const char *problem, yaml_mark_t problem_mark);
+
+/*
+ * State functions.
+ */
+
+static int
+yaml_parser_state_machine(yaml_parser_t *parser, yaml_event_t *event);
+
+static int
+yaml_parser_parse_stream_start(yaml_parser_t *parser, yaml_event_t *event);
+
+static int
+yaml_parser_parse_document_start(yaml_parser_t *parser, yaml_event_t *event,
+ int implicit);
+
+static int
+yaml_parser_parse_document_content(yaml_parser_t *parser, yaml_event_t *event);
+
+static int
+yaml_parser_parse_document_end(yaml_parser_t *parser, yaml_event_t *event);
+
+static int
+yaml_parser_parse_node(yaml_parser_t *parser, yaml_event_t *event,
+ int block, int indentless_sequence);
+
+static int
+yaml_parser_parse_block_sequence_entry(yaml_parser_t *parser,
+ yaml_event_t *event, int first);
+
+static int
+yaml_parser_parse_indentless_sequence_entry(yaml_parser_t *parser,
+ yaml_event_t *event);
+
+static int
+yaml_parser_parse_block_mapping_key(yaml_parser_t *parser,
+ yaml_event_t *event, int first);
+
+static int
+yaml_parser_parse_block_mapping_value(yaml_parser_t *parser,
+ yaml_event_t *event);
+
+static int
+yaml_parser_parse_flow_sequence_entry(yaml_parser_t *parser,
+ yaml_event_t *event, int first);
+
+static int
+yaml_parser_parse_flow_sequence_entry_mapping_key(yaml_parser_t *parser,
+ yaml_event_t *event);
+
+static int
+yaml_parser_parse_flow_sequence_entry_mapping_value(yaml_parser_t *parser,
+ yaml_event_t *event);
+
+static int
+yaml_parser_parse_flow_sequence_entry_mapping_end(yaml_parser_t *parser,
+ yaml_event_t *event);
+
+static int
+yaml_parser_parse_flow_mapping_key(yaml_parser_t *parser,
+ yaml_event_t *event, int first);
+
+static int
+yaml_parser_parse_flow_mapping_value(yaml_parser_t *parser,
+ yaml_event_t *event, int empty);
+
+/*
+ * Utility functions.
+ */
+
+static int
+yaml_parser_process_empty_scalar(yaml_parser_t *parser,
+ yaml_event_t *event, yaml_mark_t mark);
+
+static int
+yaml_parser_process_directives(yaml_parser_t *parser,
+ yaml_version_directive_t **version_directive_ref,
+ yaml_tag_directive_t **tag_directives_start_ref,
+ yaml_tag_directive_t **tag_directives_end_ref);
+
+static int
+yaml_parser_append_tag_directive(yaml_parser_t *parser,
+ yaml_tag_directive_t value, int allow_duplicates, yaml_mark_t mark);
+
+/*
+ * Get the next event.
+ */
+
+YAML_DECLARE(int)
+yaml_parser_parse(yaml_parser_t *parser, yaml_event_t *event)
+{
+ assert(parser); /* Non-NULL parser object is expected. */
+ assert(event); /* Non-NULL event object is expected. */
+
+ /* Erase the event object. */
+
+ memset(event, 0, sizeof(yaml_event_t));
+
+ /* No events after the end of the stream or error. */
+
+ if (parser->stream_end_produced || parser->error ||
+ parser->state == YAML_PARSE_END_STATE) {
+ return 1;
+ }
+
+ /* Generate the next event. */
+
+ return yaml_parser_state_machine(parser, event);
+}
+
+/*
+ * Set parser error.
+ */
+
+static int
+yaml_parser_set_parser_error(yaml_parser_t *parser,
+ const char *problem, yaml_mark_t problem_mark)
+{
+ parser->error = YAML_PARSER_ERROR;
+ parser->problem = problem;
+ parser->problem_mark = problem_mark;
+
+ return 0;
+}
+
+static int
+yaml_parser_set_parser_error_context(yaml_parser_t *parser,
+ const char *context, yaml_mark_t context_mark,
+ const char *problem, yaml_mark_t problem_mark)
+{
+ parser->error = YAML_PARSER_ERROR;
+ parser->context = context;
+ parser->context_mark = context_mark;
+ parser->problem = problem;
+ parser->problem_mark = problem_mark;
+
+ return 0;
+}
+
+
+/*
+ * State dispatcher.
+ */
+
+static int
+yaml_parser_state_machine(yaml_parser_t *parser, yaml_event_t *event)
+{
+ switch (parser->state)
+ {
+ case YAML_PARSE_STREAM_START_STATE:
+ return yaml_parser_parse_stream_start(parser, event);
+
+ case YAML_PARSE_IMPLICIT_DOCUMENT_START_STATE:
+ return yaml_parser_parse_document_start(parser, event, 1);
+
+ case YAML_PARSE_DOCUMENT_START_STATE:
+ return yaml_parser_parse_document_start(parser, event, 0);
+
+ case YAML_PARSE_DOCUMENT_CONTENT_STATE:
+ return yaml_parser_parse_document_content(parser, event);
+
+ case YAML_PARSE_DOCUMENT_END_STATE:
+ return yaml_parser_parse_document_end(parser, event);
+
+ case YAML_PARSE_BLOCK_NODE_STATE:
+ return yaml_parser_parse_node(parser, event, 1, 0);
+
+ case YAML_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE:
+ return yaml_parser_parse_node(parser, event, 1, 1);
+
+ case YAML_PARSE_FLOW_NODE_STATE:
+ return yaml_parser_parse_node(parser, event, 0, 0);
+
+ case YAML_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE:
+ return yaml_parser_parse_block_sequence_entry(parser, event, 1);
+
+ case YAML_PARSE_BLOCK_SEQUENCE_ENTRY_STATE:
+ return yaml_parser_parse_block_sequence_entry(parser, event, 0);
+
+ case YAML_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE:
+ return yaml_parser_parse_indentless_sequence_entry(parser, event);
+
+ case YAML_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE:
+ return yaml_parser_parse_block_mapping_key(parser, event, 1);
+
+ case YAML_PARSE_BLOCK_MAPPING_KEY_STATE:
+ return yaml_parser_parse_block_mapping_key(parser, event, 0);
+
+ case YAML_PARSE_BLOCK_MAPPING_VALUE_STATE:
+ return yaml_parser_parse_block_mapping_value(parser, event);
+
+ case YAML_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE:
+ return yaml_parser_parse_flow_sequence_entry(parser, event, 1);
+
+ case YAML_PARSE_FLOW_SEQUENCE_ENTRY_STATE:
+ return yaml_parser_parse_flow_sequence_entry(parser, event, 0);
+
+ case YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE:
+ return yaml_parser_parse_flow_sequence_entry_mapping_key(parser, event);
+
+ case YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE:
+ return yaml_parser_parse_flow_sequence_entry_mapping_value(parser, event);
+
+ case YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE:
+ return yaml_parser_parse_flow_sequence_entry_mapping_end(parser, event);
+
+ case YAML_PARSE_FLOW_MAPPING_FIRST_KEY_STATE:
+ return yaml_parser_parse_flow_mapping_key(parser, event, 1);
+
+ case YAML_PARSE_FLOW_MAPPING_KEY_STATE:
+ return yaml_parser_parse_flow_mapping_key(parser, event, 0);
+
+ case YAML_PARSE_FLOW_MAPPING_VALUE_STATE:
+ return yaml_parser_parse_flow_mapping_value(parser, event, 0);
+
+ case YAML_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE:
+ return yaml_parser_parse_flow_mapping_value(parser, event, 1);
+
+ default:
+ assert(1); /* Invalid state. */
+ }
+
+ return 0;
+}
+
+/*
+ * Parse the production:
+ * stream ::= STREAM-START implicit_document? explicit_document* STREAM-END
+ * ************
+ */
+
+static int
+yaml_parser_parse_stream_start(yaml_parser_t *parser, yaml_event_t *event)
+{
+ yaml_token_t *token;
+
+ token = PEEK_TOKEN(parser);
+ if (!token) return 0;
+
+ if (token->type != YAML_STREAM_START_TOKEN) {
+ return yaml_parser_set_parser_error(parser,
+ "did not find expected <stream-start>", token->start_mark);
+ }
+
+ parser->state = YAML_PARSE_IMPLICIT_DOCUMENT_START_STATE;
+ STREAM_START_EVENT_INIT(*event, token->data.stream_start.encoding,
+ token->start_mark, token->start_mark);
+ SKIP_TOKEN(parser);
+
+ return 1;
+}
+
+/*
+ * Parse the productions:
+ * implicit_document ::= block_node DOCUMENT-END*
+ * *
+ * explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
+ * *************************
+ */
+
+static int
+yaml_parser_parse_document_start(yaml_parser_t *parser, yaml_event_t *event,
+ int implicit)
+{
+ yaml_token_t *token;
+ yaml_version_directive_t *version_directive = NULL;
+ struct {
+ yaml_tag_directive_t *start;
+ yaml_tag_directive_t *end;
+ } tag_directives = { NULL, NULL };
+
+ token = PEEK_TOKEN(parser);
+ if (!token) return 0;
+
+ /* Parse extra document end indicators. */
+
+ if (!implicit)
+ {
+ while (token->type == YAML_DOCUMENT_END_TOKEN) {
+ SKIP_TOKEN(parser);
+ token = PEEK_TOKEN(parser);
+ if (!token) return 0;
+ }
+ }
+
+ /* Parse an implicit document. */
+
+ if (implicit && token->type != YAML_VERSION_DIRECTIVE_TOKEN &&
+ token->type != YAML_TAG_DIRECTIVE_TOKEN &&
+ token->type != YAML_DOCUMENT_START_TOKEN &&
+ token->type != YAML_STREAM_END_TOKEN)
+ {
+ if (!yaml_parser_process_directives(parser, NULL, NULL, NULL))
+ return 0;
+ if (!PUSH(parser, parser->states, YAML_PARSE_DOCUMENT_END_STATE))
+ return 0;
+ parser->state = YAML_PARSE_BLOCK_NODE_STATE;
+ DOCUMENT_START_EVENT_INIT(*event, NULL, NULL, NULL, 1,
+ token->start_mark, token->start_mark);
+ return 1;
+ }
+
+ /* Parse an explicit document. */
+
+ else if (token->type != YAML_STREAM_END_TOKEN)
+ {
+ yaml_mark_t start_mark, end_mark;
+ start_mark = token->start_mark;
+ if (!yaml_parser_process_directives(parser, &version_directive,
+ &tag_directives.start, &tag_directives.end))
+ return 0;
+ token = PEEK_TOKEN(parser);
+ if (!token) goto error;
+ if (token->type != YAML_DOCUMENT_START_TOKEN) {
+ yaml_parser_set_parser_error(parser,
+ "did not find expected <document start>", token->start_mark);
+ goto error;
+ }
+ if (!PUSH(parser, parser->states, YAML_PARSE_DOCUMENT_END_STATE))
+ goto error;
+ parser->state = YAML_PARSE_DOCUMENT_CONTENT_STATE;
+ end_mark = token->end_mark;
+ DOCUMENT_START_EVENT_INIT(*event, version_directive,
+ tag_directives.start, tag_directives.end, 0,
+ start_mark, end_mark);
+ SKIP_TOKEN(parser);
+ version_directive = NULL;
+ tag_directives.start = tag_directives.end = NULL;
+ return 1;
+ }
+
+ /* Parse the stream end. */
+
+ else
+ {
+ parser->state = YAML_PARSE_END_STATE;
+ STREAM_END_EVENT_INIT(*event, token->start_mark, token->end_mark);
+ SKIP_TOKEN(parser);
+ return 1;
+ }
+
+error:
+ yaml_free(version_directive);
+ while (tag_directives.start != tag_directives.end) {
+ yaml_free(tag_directives.end[-1].handle);
+ yaml_free(tag_directives.end[-1].prefix);
+ tag_directives.end --;
+ }
+ yaml_free(tag_directives.start);
+ return 0;
+}
+
+/*
+ * Parse the productions:
+ * explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
+ * ***********
+ */
+
+static int
+yaml_parser_parse_document_content(yaml_parser_t *parser, yaml_event_t *event)
+{
+ yaml_token_t *token;
+
+ token = PEEK_TOKEN(parser);
+ if (!token) return 0;
+
+ if (token->type == YAML_VERSION_DIRECTIVE_TOKEN ||
+ token->type == YAML_TAG_DIRECTIVE_TOKEN ||
+ token->type == YAML_DOCUMENT_START_TOKEN ||
+ token->type == YAML_DOCUMENT_END_TOKEN ||
+ token->type == YAML_STREAM_END_TOKEN) {
+ parser->state = POP(parser, parser->states);
+ return yaml_parser_process_empty_scalar(parser, event,
+ token->start_mark);
+ }
+ else {
+ return yaml_parser_parse_node(parser, event, 1, 0);
+ }
+}
+
+/*
+ * Parse the productions:
+ * implicit_document ::= block_node DOCUMENT-END*
+ * *************
+ * explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
+ * *************
+ */
+
+static int
+yaml_parser_parse_document_end(yaml_parser_t *parser, yaml_event_t *event)
+{
+ yaml_token_t *token;
+ yaml_mark_t start_mark, end_mark;
+ int implicit = 1;
+
+ token = PEEK_TOKEN(parser);
+ if (!token) return 0;
+
+ start_mark = end_mark = token->start_mark;
+
+ if (token->type == YAML_DOCUMENT_END_TOKEN) {
+ end_mark = token->end_mark;
+ SKIP_TOKEN(parser);
+ implicit = 0;
+ }
+
+ while (!STACK_EMPTY(parser, parser->tag_directives)) {
+ yaml_tag_directive_t tag_directive = POP(parser, parser->tag_directives);
+ yaml_free(tag_directive.handle);
+ yaml_free(tag_directive.prefix);
+ }
+
+ parser->state = YAML_PARSE_DOCUMENT_START_STATE;
+ DOCUMENT_END_EVENT_INIT(*event, implicit, start_mark, end_mark);
+
+ return 1;
+}
+
+/*
+ * Parse the productions:
+ * block_node_or_indentless_sequence ::=
+ * ALIAS
+ * *****
+ * | properties (block_content | indentless_block_sequence)?
+ * ********** *
+ * | block_content | indentless_block_sequence
+ * *
+ * block_node ::= ALIAS
+ * *****
+ * | properties block_content?
+ * ********** *
+ * | block_content
+ * *
+ * flow_node ::= ALIAS
+ * *****
+ * | properties flow_content?
+ * ********** *
+ * | flow_content
+ * *
+ * properties ::= TAG ANCHOR? | ANCHOR TAG?
+ * *************************
+ * block_content ::= block_collection | flow_collection | SCALAR
+ * ******
+ * flow_content ::= flow_collection | SCALAR
+ * ******
+ */
+
+static int
+yaml_parser_parse_node(yaml_parser_t *parser, yaml_event_t *event,
+ int block, int indentless_sequence)
+{
+ yaml_token_t *token;
+ yaml_char_t *anchor = NULL;
+ yaml_char_t *tag_handle = NULL;
+ yaml_char_t *tag_suffix = NULL;
+ yaml_char_t *tag = NULL;
+ yaml_mark_t start_mark, end_mark, tag_mark;
+ int implicit;
+
+ token = PEEK_TOKEN(parser);
+ if (!token) return 0;
+
+ if (token->type == YAML_ALIAS_TOKEN)
+ {
+ parser->state = POP(parser, parser->states);
+ ALIAS_EVENT_INIT(*event, token->data.alias.value,
+ token->start_mark, token->end_mark);
+ SKIP_TOKEN(parser);
+ return 1;
+ }
+
+ else
+ {
+ start_mark = end_mark = token->start_mark;
+
+ if (token->type == YAML_ANCHOR_TOKEN)
+ {
+ anchor = token->data.anchor.value;
+ start_mark = token->start_mark;
+ end_mark = token->end_mark;
+ SKIP_TOKEN(parser);
+ token = PEEK_TOKEN(parser);
+ if (!token) goto error;
+ if (token->type == YAML_TAG_TOKEN)
+ {
+ tag_handle = token->data.tag.handle;
+ tag_suffix = token->data.tag.suffix;
+ tag_mark = token->start_mark;
+ end_mark = token->end_mark;
+ SKIP_TOKEN(parser);
+ token = PEEK_TOKEN(parser);
+ if (!token) goto error;
+ }
+ }
+ else if (token->type == YAML_TAG_TOKEN)
+ {
+ tag_handle = token->data.tag.handle;
+ tag_suffix = token->data.tag.suffix;
+ start_mark = tag_mark = token->start_mark;
+ end_mark = token->end_mark;
+ SKIP_TOKEN(parser);
+ token = PEEK_TOKEN(parser);
+ if (!token) goto error;
+ if (token->type == YAML_ANCHOR_TOKEN)
+ {
+ anchor = token->data.anchor.value;
+ end_mark = token->end_mark;
+ SKIP_TOKEN(parser);
+ token = PEEK_TOKEN(parser);
+ if (!token) goto error;
+ }
+ }
+
+ if (tag_handle) {
+ if (!*tag_handle) {
+ tag = tag_suffix;
+ yaml_free(tag_handle);
+ tag_handle = tag_suffix = NULL;
+ }
+ else {
+ yaml_tag_directive_t *tag_directive;
+ for (tag_directive = parser->tag_directives.start;
+ tag_directive != parser->tag_directives.top;
+ tag_directive ++) {
+ if (strcmp((char *)tag_directive->handle, (char *)tag_handle) == 0) {
+ size_t prefix_len = strlen((char *)tag_directive->prefix);
+ size_t suffix_len = strlen((char *)tag_suffix);
+ tag = yaml_malloc(prefix_len+suffix_len+1);
+ if (!tag) {
+ parser->error = YAML_MEMORY_ERROR;
+ goto error;
+ }
+ memcpy(tag, tag_directive->prefix, prefix_len);
+ memcpy(tag+prefix_len, tag_suffix, suffix_len);
+ tag[prefix_len+suffix_len] = '\0';
+ yaml_free(tag_handle);
+ yaml_free(tag_suffix);
+ tag_handle = tag_suffix = NULL;
+ break;
+ }
+ }
+ if (!tag) {
+ yaml_parser_set_parser_error_context(parser,
+ "while parsing a node", start_mark,
+ "found undefined tag handle", tag_mark);
+ goto error;
+ }
+ }
+ }
+
+ implicit = (!tag || !*tag);
+ if (indentless_sequence && token->type == YAML_BLOCK_ENTRY_TOKEN) {
+ end_mark = token->end_mark;
+ parser->state = YAML_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE;
+ SEQUENCE_START_EVENT_INIT(*event, anchor, tag, implicit,
+ YAML_BLOCK_SEQUENCE_STYLE, start_mark, end_mark);
+ return 1;
+ }
+ else {
+ if (token->type == YAML_SCALAR_TOKEN) {
+ int plain_implicit = 0;
+ int quoted_implicit = 0;
+ end_mark = token->end_mark;
+ if ((token->data.scalar.style == YAML_PLAIN_SCALAR_STYLE && !tag)
+ || (tag && strcmp((char *)tag, "!") == 0)) {
+ plain_implicit = 1;
+ }
+ else if (!tag) {
+ quoted_implicit = 1;
+ }
+ parser->state = POP(parser, parser->states);
+ SCALAR_EVENT_INIT(*event, anchor, tag,
+ token->data.scalar.value, token->data.scalar.length,
+ plain_implicit, quoted_implicit,
+ token->data.scalar.style, start_mark, end_mark);
+ SKIP_TOKEN(parser);
+ return 1;
+ }
+ else if (token->type == YAML_FLOW_SEQUENCE_START_TOKEN) {
+ end_mark = token->end_mark;
+ parser->state = YAML_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE;
+ SEQUENCE_START_EVENT_INIT(*event, anchor, tag, implicit,
+ YAML_FLOW_SEQUENCE_STYLE, start_mark, end_mark);
+ return 1;
+ }
+ else if (token->type == YAML_FLOW_MAPPING_START_TOKEN) {
+ end_mark = token->end_mark;
+ parser->state = YAML_PARSE_FLOW_MAPPING_FIRST_KEY_STATE;
+ MAPPING_START_EVENT_INIT(*event, anchor, tag, implicit,
+ YAML_FLOW_MAPPING_STYLE, start_mark, end_mark);
+ return 1;
+ }
+ else if (block && token->type == YAML_BLOCK_SEQUENCE_START_TOKEN) {
+ end_mark = token->end_mark;
+ parser->state = YAML_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE;
+ SEQUENCE_START_EVENT_INIT(*event, anchor, tag, implicit,
+ YAML_BLOCK_SEQUENCE_STYLE, start_mark, end_mark);
+ return 1;
+ }
+ else if (block && token->type == YAML_BLOCK_MAPPING_START_TOKEN) {
+ end_mark = token->end_mark;
+ parser->state = YAML_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE;
+ MAPPING_START_EVENT_INIT(*event, anchor, tag, implicit,
+ YAML_BLOCK_MAPPING_STYLE, start_mark, end_mark);
+ return 1;
+ }
+ else if (anchor || tag) {
+ yaml_char_t *value = yaml_malloc(1);
+ if (!value) {
+ parser->error = YAML_MEMORY_ERROR;
+ goto error;
+ }
+ value[0] = '\0';
+ parser->state = POP(parser, parser->states);
+ SCALAR_EVENT_INIT(*event, anchor, tag, value, 0,
+ implicit, 0, YAML_PLAIN_SCALAR_STYLE,
+ start_mark, end_mark);
+ return 1;
+ }
+ else {
+ yaml_parser_set_parser_error_context(parser,
+ (block ? "while parsing a block node"
+ : "while parsing a flow node"), start_mark,
+ "did not find expected node content", token->start_mark);
+ goto error;
+ }
+ }
+ }
+
+error:
+ yaml_free(anchor);
+ yaml_free(tag_handle);
+ yaml_free(tag_suffix);
+ yaml_free(tag);
+
+ return 0;
+}
+
+/*
+ * Parse the productions:
+ * block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END
+ * ******************** *********** * *********
+ */
+
+static int
+yaml_parser_parse_block_sequence_entry(yaml_parser_t *parser,
+ yaml_event_t *event, int first)
+{
+ yaml_token_t *token;
+
+ if (first) {
+ token = PEEK_TOKEN(parser);
+ if (!PUSH(parser, parser->marks, token->start_mark))
+ return 0;
+ SKIP_TOKEN(parser);
+ }
+
+ token = PEEK_TOKEN(parser);
+ if (!token) return 0;
+
+ if (token->type == YAML_BLOCK_ENTRY_TOKEN)
+ {
+ yaml_mark_t mark = token->end_mark;
+ SKIP_TOKEN(parser);
+ token = PEEK_TOKEN(parser);
+ if (!token) return 0;
+ if (token->type != YAML_BLOCK_ENTRY_TOKEN &&
+ token->type != YAML_BLOCK_END_TOKEN) {
+ if (!PUSH(parser, parser->states,
+ YAML_PARSE_BLOCK_SEQUENCE_ENTRY_STATE))
+ return 0;
+ return yaml_parser_parse_node(parser, event, 1, 0);
+ }
+ else {
+ parser->state = YAML_PARSE_BLOCK_SEQUENCE_ENTRY_STATE;
+ return yaml_parser_process_empty_scalar(parser, event, mark);
+ }
+ }
+
+ else if (token->type == YAML_BLOCK_END_TOKEN)
+ {
+ yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */
+ parser->state = POP(parser, parser->states);
+ dummy_mark = POP(parser, parser->marks);
+ SEQUENCE_END_EVENT_INIT(*event, token->start_mark, token->end_mark);
+ SKIP_TOKEN(parser);
+ return 1;
+ }
+
+ else
+ {
+ return yaml_parser_set_parser_error_context(parser,
+ "while parsing a block collection", POP(parser, parser->marks),
+ "did not find expected '-' indicator", token->start_mark);
+ }
+}
+
+/*
+ * Parse the productions:
+ * indentless_sequence ::= (BLOCK-ENTRY block_node?)+
+ * *********** *
+ */
+
+static int
+yaml_parser_parse_indentless_sequence_entry(yaml_parser_t *parser,
+ yaml_event_t *event)
+{
+ yaml_token_t *token;
+
+ token = PEEK_TOKEN(parser);
+ if (!token) return 0;
+
+ if (token->type == YAML_BLOCK_ENTRY_TOKEN)
+ {
+ yaml_mark_t mark = token->end_mark;
+ SKIP_TOKEN(parser);
+ token = PEEK_TOKEN(parser);
+ if (!token) return 0;
+ if (token->type != YAML_BLOCK_ENTRY_TOKEN &&
+ token->type != YAML_KEY_TOKEN &&
+ token->type != YAML_VALUE_TOKEN &&
+ token->type != YAML_BLOCK_END_TOKEN) {
+ if (!PUSH(parser, parser->states,
+ YAML_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE))
+ return 0;
+ return yaml_parser_parse_node(parser, event, 1, 0);
+ }
+ else {
+ parser->state = YAML_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE;
+ return yaml_parser_process_empty_scalar(parser, event, mark);
+ }
+ }
+
+ else
+ {
+ parser->state = POP(parser, parser->states);
+ SEQUENCE_END_EVENT_INIT(*event, token->start_mark, token->start_mark);
+ return 1;
+ }
+}
+
+/*
+ * Parse the productions:
+ * block_mapping ::= BLOCK-MAPPING_START
+ * *******************
+ * ((KEY block_node_or_indentless_sequence?)?
+ * *** *
+ * (VALUE block_node_or_indentless_sequence?)?)*
+ *
+ * BLOCK-END
+ * *********
+ */
+
+static int
+yaml_parser_parse_block_mapping_key(yaml_parser_t *parser,
+ yaml_event_t *event, int first)
+{
+ yaml_token_t *token;
+
+ if (first) {
+ token = PEEK_TOKEN(parser);
+ if (!PUSH(parser, parser->marks, token->start_mark))
+ return 0;
+ SKIP_TOKEN(parser);
+ }
+
+ token = PEEK_TOKEN(parser);
+ if (!token) return 0;
+
+ if (token->type == YAML_KEY_TOKEN)
+ {
+ yaml_mark_t mark = token->end_mark;
+ SKIP_TOKEN(parser);
+ token = PEEK_TOKEN(parser);
+ if (!token) return 0;
+ if (token->type != YAML_KEY_TOKEN &&
+ token->type != YAML_VALUE_TOKEN &&
+ token->type != YAML_BLOCK_END_TOKEN) {
+ if (!PUSH(parser, parser->states,
+ YAML_PARSE_BLOCK_MAPPING_VALUE_STATE))
+ return 0;
+ return yaml_parser_parse_node(parser, event, 1, 1);
+ }
+ else {
+ parser->state = YAML_PARSE_BLOCK_MAPPING_VALUE_STATE;
+ return yaml_parser_process_empty_scalar(parser, event, mark);
+ }
+ }
+
+ else if (token->type == YAML_BLOCK_END_TOKEN)
+ {
+ yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */
+ parser->state = POP(parser, parser->states);
+ dummy_mark = POP(parser, parser->marks);
+ MAPPING_END_EVENT_INIT(*event, token->start_mark, token->end_mark);
+ SKIP_TOKEN(parser);
+ return 1;
+ }
+
+ else
+ {
+ return yaml_parser_set_parser_error_context(parser,
+ "while parsing a block mapping", POP(parser, parser->marks),
+ "did not find expected key", token->start_mark);
+ }
+}
+
+/*
+ * Parse the productions:
+ * block_mapping ::= BLOCK-MAPPING_START
+ *
+ * ((KEY block_node_or_indentless_sequence?)?
+ *
+ * (VALUE block_node_or_indentless_sequence?)?)*
+ * ***** *
+ * BLOCK-END
+ *
+ */
+
+static int
+yaml_parser_parse_block_mapping_value(yaml_parser_t *parser,
+ yaml_event_t *event)
+{
+ yaml_token_t *token;
+
+ token = PEEK_TOKEN(parser);
+ if (!token) return 0;
+
+ if (token->type == YAML_VALUE_TOKEN)
+ {
+ yaml_mark_t mark = token->end_mark;
+ SKIP_TOKEN(parser);
+ token = PEEK_TOKEN(parser);
+ if (!token) return 0;
+ if (token->type != YAML_KEY_TOKEN &&
+ token->type != YAML_VALUE_TOKEN &&
+ token->type != YAML_BLOCK_END_TOKEN) {
+ if (!PUSH(parser, parser->states,
+ YAML_PARSE_BLOCK_MAPPING_KEY_STATE))
+ return 0;
+ return yaml_parser_parse_node(parser, event, 1, 1);
+ }
+ else {
+ parser->state = YAML_PARSE_BLOCK_MAPPING_KEY_STATE;
+ return yaml_parser_process_empty_scalar(parser, event, mark);
+ }
+ }
+
+ else
+ {
+ parser->state = YAML_PARSE_BLOCK_MAPPING_KEY_STATE;
+ return yaml_parser_process_empty_scalar(parser, event, token->start_mark);
+ }
+}
+
+/*
+ * Parse the productions:
+ * flow_sequence ::= FLOW-SEQUENCE-START
+ * *******************
+ * (flow_sequence_entry FLOW-ENTRY)*
+ * * **********
+ * flow_sequence_entry?
+ * *
+ * FLOW-SEQUENCE-END
+ * *****************
+ * flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
+ * *
+ */
+
+static int
+yaml_parser_parse_flow_sequence_entry(yaml_parser_t *parser,
+ yaml_event_t *event, int first)
+{
+ yaml_token_t *token;
+ yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */
+
+ if (first) {
+ token = PEEK_TOKEN(parser);
+ if (!PUSH(parser, parser->marks, token->start_mark))
+ return 0;
+ SKIP_TOKEN(parser);
+ }
+
+ token = PEEK_TOKEN(parser);
+ if (!token) return 0;
+
+ if (token->type != YAML_FLOW_SEQUENCE_END_TOKEN)
+ {
+ if (!first) {
+ if (token->type == YAML_FLOW_ENTRY_TOKEN) {
+ SKIP_TOKEN(parser);
+ token = PEEK_TOKEN(parser);
+ if (!token) return 0;
+ }
+ else {
+ return yaml_parser_set_parser_error_context(parser,
+ "while parsing a flow sequence", POP(parser, parser->marks),
+ "did not find expected ',' or ']'", token->start_mark);
+ }
+ }
+
+ if (token->type == YAML_KEY_TOKEN) {
+ parser->state = YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE;
+ MAPPING_START_EVENT_INIT(*event, NULL, NULL,
+ 1, YAML_FLOW_MAPPING_STYLE,
+ token->start_mark, token->end_mark);
+ SKIP_TOKEN(parser);
+ return 1;
+ }
+
+ else if (token->type != YAML_FLOW_SEQUENCE_END_TOKEN) {
+ if (!PUSH(parser, parser->states,
+ YAML_PARSE_FLOW_SEQUENCE_ENTRY_STATE))
+ return 0;
+ return yaml_parser_parse_node(parser, event, 0, 0);
+ }
+ }
+
+ parser->state = POP(parser, parser->states);
+ dummy_mark = POP(parser, parser->marks);
+ SEQUENCE_END_EVENT_INIT(*event, token->start_mark, token->end_mark);
+ SKIP_TOKEN(parser);
+ return 1;
+}
+
+/*
+ * Parse the productions:
+ * flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
+ * *** *
+ */
+
+static int
+yaml_parser_parse_flow_sequence_entry_mapping_key(yaml_parser_t *parser,
+ yaml_event_t *event)
+{
+ yaml_token_t *token;
+
+ token = PEEK_TOKEN(parser);
+ if (!token) return 0;
+
+ if (token->type != YAML_VALUE_TOKEN && token->type != YAML_FLOW_ENTRY_TOKEN
+ && token->type != YAML_FLOW_SEQUENCE_END_TOKEN) {
+ if (!PUSH(parser, parser->states,
+ YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE))
+ return 0;
+ return yaml_parser_parse_node(parser, event, 0, 0);
+ }
+ else {
+ yaml_mark_t mark = token->end_mark;
+ SKIP_TOKEN(parser);
+ parser->state = YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE;
+ return yaml_parser_process_empty_scalar(parser, event, mark);
+ }
+}
+
+/*
+ * Parse the productions:
+ * flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
+ * ***** *
+ */
+
+static int
+yaml_parser_parse_flow_sequence_entry_mapping_value(yaml_parser_t *parser,
+ yaml_event_t *event)
+{
+ yaml_token_t *token;
+
+ token = PEEK_TOKEN(parser);
+ if (!token) return 0;
+
+ if (token->type == YAML_VALUE_TOKEN) {
+ SKIP_TOKEN(parser);
+ token = PEEK_TOKEN(parser);
+ if (!token) return 0;
+ if (token->type != YAML_FLOW_ENTRY_TOKEN
+ && token->type != YAML_FLOW_SEQUENCE_END_TOKEN) {
+ if (!PUSH(parser, parser->states,
+ YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE))
+ return 0;
+ return yaml_parser_parse_node(parser, event, 0, 0);
+ }
+ }
+ parser->state = YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE;
+ return yaml_parser_process_empty_scalar(parser, event, token->start_mark);
+}
+
+/*
+ * Parse the productions:
+ * flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
+ * *
+ */
+
+static int
+yaml_parser_parse_flow_sequence_entry_mapping_end(yaml_parser_t *parser,
+ yaml_event_t *event)
+{
+ yaml_token_t *token;
+
+ token = PEEK_TOKEN(parser);
+ if (!token) return 0;
+
+ parser->state = YAML_PARSE_FLOW_SEQUENCE_ENTRY_STATE;
+
+ MAPPING_END_EVENT_INIT(*event, token->start_mark, token->start_mark);
+ return 1;
+}
+
+/*
+ * Parse the productions:
+ * flow_mapping ::= FLOW-MAPPING-START
+ * ******************
+ * (flow_mapping_entry FLOW-ENTRY)*
+ * * **********
+ * flow_mapping_entry?
+ * ******************
+ * FLOW-MAPPING-END
+ * ****************
+ * flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
+ * * *** *
+ */
+
+static int
+yaml_parser_parse_flow_mapping_key(yaml_parser_t *parser,
+ yaml_event_t *event, int first)
+{
+ yaml_token_t *token;
+ yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */
+
+ if (first) {
+ token = PEEK_TOKEN(parser);
+ if (!PUSH(parser, parser->marks, token->start_mark))
+ return 0;
+ SKIP_TOKEN(parser);
+ }
+
+ token = PEEK_TOKEN(parser);
+ if (!token) return 0;
+
+ if (token->type != YAML_FLOW_MAPPING_END_TOKEN)
+ {
+ if (!first) {
+ if (token->type == YAML_FLOW_ENTRY_TOKEN) {
+ SKIP_TOKEN(parser);
+ token = PEEK_TOKEN(parser);
+ if (!token) return 0;
+ }
+ else {
+ return yaml_parser_set_parser_error_context(parser,
+ "while parsing a flow mapping", POP(parser, parser->marks),
+ "did not find expected ',' or '}'", token->start_mark);
+ }
+ }
+
+ if (token->type == YAML_KEY_TOKEN) {
+ SKIP_TOKEN(parser);
+ token = PEEK_TOKEN(parser);
+ if (!token) return 0;
+ if (token->type != YAML_VALUE_TOKEN
+ && token->type != YAML_FLOW_ENTRY_TOKEN
+ && token->type != YAML_FLOW_MAPPING_END_TOKEN) {
+ if (!PUSH(parser, parser->states,
+ YAML_PARSE_FLOW_MAPPING_VALUE_STATE))
+ return 0;
+ return yaml_parser_parse_node(parser, event, 0, 0);
+ }
+ else {
+ parser->state = YAML_PARSE_FLOW_MAPPING_VALUE_STATE;
+ return yaml_parser_process_empty_scalar(parser, event,
+ token->start_mark);
+ }
+ }
+ else if (token->type != YAML_FLOW_MAPPING_END_TOKEN) {
+ if (!PUSH(parser, parser->states,
+ YAML_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE))
+ return 0;
+ return yaml_parser_parse_node(parser, event, 0, 0);
+ }
+ }
+
+ parser->state = POP(parser, parser->states);
+ dummy_mark = POP(parser, parser->marks);
+ MAPPING_END_EVENT_INIT(*event, token->start_mark, token->end_mark);
+ SKIP_TOKEN(parser);
+ return 1;
+}
+
+/*
+ * Parse the productions:
+ * flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
+ * * ***** *
+ */
+
+static int
+yaml_parser_parse_flow_mapping_value(yaml_parser_t *parser,
+ yaml_event_t *event, int empty)
+{
+ yaml_token_t *token;
+
+ token = PEEK_TOKEN(parser);
+ if (!token) return 0;
+
+ if (empty) {
+ parser->state = YAML_PARSE_FLOW_MAPPING_KEY_STATE;
+ return yaml_parser_process_empty_scalar(parser, event,
+ token->start_mark);
+ }
+
+ if (token->type == YAML_VALUE_TOKEN) {
+ SKIP_TOKEN(parser);
+ token = PEEK_TOKEN(parser);
+ if (!token) return 0;
+ if (token->type != YAML_FLOW_ENTRY_TOKEN
+ && token->type != YAML_FLOW_MAPPING_END_TOKEN) {
+ if (!PUSH(parser, parser->states,
+ YAML_PARSE_FLOW_MAPPING_KEY_STATE))
+ return 0;
+ return yaml_parser_parse_node(parser, event, 0, 0);
+ }
+ }
+
+ parser->state = YAML_PARSE_FLOW_MAPPING_KEY_STATE;
+ return yaml_parser_process_empty_scalar(parser, event, token->start_mark);
+}
+
+/*
+ * Generate an empty scalar event.
+ */
+
+static int
+yaml_parser_process_empty_scalar(yaml_parser_t *parser, yaml_event_t *event,
+ yaml_mark_t mark)
+{
+ yaml_char_t *value;
+
+ value = yaml_malloc(1);
+ if (!value) {
+ parser->error = YAML_MEMORY_ERROR;
+ return 0;
+ }
+ value[0] = '\0';
+
+ SCALAR_EVENT_INIT(*event, NULL, NULL, value, 0,
+ 1, 0, YAML_PLAIN_SCALAR_STYLE, mark, mark);
+
+ return 1;
+}
+
+/*
+ * Parse directives.
+ */
+
+static int
+yaml_parser_process_directives(yaml_parser_t *parser,
+ yaml_version_directive_t **version_directive_ref,
+ yaml_tag_directive_t **tag_directives_start_ref,
+ yaml_tag_directive_t **tag_directives_end_ref)
+{
+ yaml_tag_directive_t default_tag_directives[] = {
+ {(yaml_char_t *)"!", (yaml_char_t *)"!"},
+ {(yaml_char_t *)"!!", (yaml_char_t *)"tag:yaml.org,2002:"},
+ {NULL, NULL}
+ };
+ yaml_tag_directive_t *default_tag_directive;
+ yaml_version_directive_t *version_directive = NULL;
+ struct {
+ yaml_tag_directive_t *start;
+ yaml_tag_directive_t *end;
+ yaml_tag_directive_t *top;
+ } tag_directives = { NULL, NULL, NULL };
+ yaml_token_t *token;
+
+ if (!STACK_INIT(parser, tag_directives, INITIAL_STACK_SIZE))
+ goto error;
+
+ token = PEEK_TOKEN(parser);
+ if (!token) goto error;
+
+ while (token->type == YAML_VERSION_DIRECTIVE_TOKEN ||
+ token->type == YAML_TAG_DIRECTIVE_TOKEN)
+ {
+ if (token->type == YAML_VERSION_DIRECTIVE_TOKEN) {
+ if (version_directive) {
+ yaml_parser_set_parser_error(parser,
+ "found duplicate %YAML directive", token->start_mark);
+ goto error;
+ }
+ if (token->data.version_directive.major != 1
+ || token->data.version_directive.minor != 1) {
+ yaml_parser_set_parser_error(parser,
+ "found incompatible YAML document", token->start_mark);
+ goto error;
+ }
+ version_directive = yaml_malloc(sizeof(yaml_version_directive_t));
+ if (!version_directive) {
+ parser->error = YAML_MEMORY_ERROR;
+ goto error;
+ }
+ version_directive->major = token->data.version_directive.major;
+ version_directive->minor = token->data.version_directive.minor;
+ }
+
+ else if (token->type == YAML_TAG_DIRECTIVE_TOKEN) {
+ yaml_tag_directive_t value;
+ value.handle = token->data.tag_directive.handle;
+ value.prefix = token->data.tag_directive.prefix;
+
+ if (!yaml_parser_append_tag_directive(parser, value, 0,
+ token->start_mark))
+ goto error;
+ if (!PUSH(parser, tag_directives, value))
+ goto error;
+ }
+
+ SKIP_TOKEN(parser);
+ token = PEEK_TOKEN(parser);
+ if (!token) goto error;
+ }
+
+ for (default_tag_directive = default_tag_directives;
+ default_tag_directive->handle; default_tag_directive++) {
+ if (!yaml_parser_append_tag_directive(parser, *default_tag_directive, 1,
+ token->start_mark))
+ goto error;
+ }
+
+ if (version_directive_ref) {
+ *version_directive_ref = version_directive;
+ }
+ if (tag_directives_start_ref) {
+ if (STACK_EMPTY(parser, tag_directives)) {
+ *tag_directives_start_ref = *tag_directives_end_ref = NULL;
+ STACK_DEL(parser, tag_directives);
+ }
+ else {
+ *tag_directives_start_ref = tag_directives.start;
+ *tag_directives_end_ref = tag_directives.top;
+ }
+ }
+ else {
+ STACK_DEL(parser, tag_directives);
+ }
+
+ return 1;
+
+error:
+ yaml_free(version_directive);
+ while (!STACK_EMPTY(parser, tag_directives)) {
+ yaml_tag_directive_t tag_directive = POP(parser, tag_directives);
+ yaml_free(tag_directive.handle);
+ yaml_free(tag_directive.prefix);
+ }
+ STACK_DEL(parser, tag_directives);
+ return 0;
+}
+
+/*
+ * Append a tag directive to the directives stack.
+ */
+
+static int
+yaml_parser_append_tag_directive(yaml_parser_t *parser,
+ yaml_tag_directive_t value, int allow_duplicates, yaml_mark_t mark)
+{
+ yaml_tag_directive_t *tag_directive;
+ yaml_tag_directive_t copy = { NULL, NULL };
+
+ for (tag_directive = parser->tag_directives.start;
+ tag_directive != parser->tag_directives.top; tag_directive ++) {
+ if (strcmp((char *)value.handle, (char *)tag_directive->handle) == 0) {
+ if (allow_duplicates)
+ return 1;
+ return yaml_parser_set_parser_error(parser,
+ "found duplicate %TAG directive", mark);
+ }
+ }
+
+ copy.handle = yaml_strdup(value.handle);
+ copy.prefix = yaml_strdup(value.prefix);
+ if (!copy.handle || !copy.prefix) {
+ parser->error = YAML_MEMORY_ERROR;
+ goto error;
+ }
+
+ if (!PUSH(parser, parser->tag_directives, copy))
+ goto error;
+
+ return 1;
+
+error:
+ yaml_free(copy.handle);
+ yaml_free(copy.prefix);
+ return 0;
+}
+
diff --git a/ext/psych/yaml/reader.c b/ext/psych/yaml/reader.c
new file mode 100644
index 0000000000..829e32da55
--- /dev/null
+++ b/ext/psych/yaml/reader.c
@@ -0,0 +1,465 @@
+
+#include "yaml_private.h"
+
+/*
+ * Declarations.
+ */
+
+static int
+yaml_parser_set_reader_error(yaml_parser_t *parser, const char *problem,
+ size_t offset, int value);
+
+static int
+yaml_parser_update_raw_buffer(yaml_parser_t *parser);
+
+static int
+yaml_parser_determine_encoding(yaml_parser_t *parser);
+
+YAML_DECLARE(int)
+yaml_parser_update_buffer(yaml_parser_t *parser, size_t length);
+
+/*
+ * Set the reader error and return 0.
+ */
+
+static int
+yaml_parser_set_reader_error(yaml_parser_t *parser, const char *problem,
+ size_t offset, int value)
+{
+ parser->error = YAML_READER_ERROR;
+ parser->problem = problem;
+ parser->problem_offset = offset;
+ parser->problem_value = value;
+
+ return 0;
+}
+
+/*
+ * Byte order marks.
+ */
+
+#define BOM_UTF8 "\xef\xbb\xbf"
+#define BOM_UTF16LE "\xff\xfe"
+#define BOM_UTF16BE "\xfe\xff"
+
+/*
+ * Determine the input stream encoding by checking the BOM symbol. If no BOM is
+ * found, the UTF-8 encoding is assumed. Return 1 on success, 0 on failure.
+ */
+
+static int
+yaml_parser_determine_encoding(yaml_parser_t *parser)
+{
+ /* Ensure that we had enough bytes in the raw buffer. */
+
+ while (!parser->eof
+ && parser->raw_buffer.last - parser->raw_buffer.pointer < 3) {
+ if (!yaml_parser_update_raw_buffer(parser)) {
+ return 0;
+ }
+ }
+
+ /* Determine the encoding. */
+
+ if (parser->raw_buffer.last - parser->raw_buffer.pointer >= 2
+ && !memcmp(parser->raw_buffer.pointer, BOM_UTF16LE, 2)) {
+ parser->encoding = YAML_UTF16LE_ENCODING;
+ parser->raw_buffer.pointer += 2;
+ parser->offset += 2;
+ }
+ else if (parser->raw_buffer.last - parser->raw_buffer.pointer >= 2
+ && !memcmp(parser->raw_buffer.pointer, BOM_UTF16BE, 2)) {
+ parser->encoding = YAML_UTF16BE_ENCODING;
+ parser->raw_buffer.pointer += 2;
+ parser->offset += 2;
+ }
+ else if (parser->raw_buffer.last - parser->raw_buffer.pointer >= 3
+ && !memcmp(parser->raw_buffer.pointer, BOM_UTF8, 3)) {
+ parser->encoding = YAML_UTF8_ENCODING;
+ parser->raw_buffer.pointer += 3;
+ parser->offset += 3;
+ }
+ else {
+ parser->encoding = YAML_UTF8_ENCODING;
+ }
+
+ return 1;
+}
+
+/*
+ * Update the raw buffer.
+ */
+
+static int
+yaml_parser_update_raw_buffer(yaml_parser_t *parser)
+{
+ size_t size_read = 0;
+
+ /* Return if the raw buffer is full. */
+
+ if (parser->raw_buffer.start == parser->raw_buffer.pointer
+ && parser->raw_buffer.last == parser->raw_buffer.end)
+ return 1;
+
+ /* Return on EOF. */
+
+ if (parser->eof) return 1;
+
+ /* Move the remaining bytes in the raw buffer to the beginning. */
+
+ if (parser->raw_buffer.start < parser->raw_buffer.pointer
+ && parser->raw_buffer.pointer < parser->raw_buffer.last) {
+ memmove(parser->raw_buffer.start, parser->raw_buffer.pointer,
+ parser->raw_buffer.last - parser->raw_buffer.pointer);
+ }
+ parser->raw_buffer.last -=
+ parser->raw_buffer.pointer - parser->raw_buffer.start;
+ parser->raw_buffer.pointer = parser->raw_buffer.start;
+
+ /* Call the read handler to fill the buffer. */
+
+ if (!parser->read_handler(parser->read_handler_data, parser->raw_buffer.last,
+ parser->raw_buffer.end - parser->raw_buffer.last, &size_read)) {
+ return yaml_parser_set_reader_error(parser, "input error",
+ parser->offset, -1);
+ }
+ parser->raw_buffer.last += size_read;
+ if (!size_read) {
+ parser->eof = 1;
+ }
+
+ return 1;
+}
+
+/*
+ * Ensure that the buffer contains at least `length` characters.
+ * Return 1 on success, 0 on failure.
+ *
+ * The length is supposed to be significantly less that the buffer size.
+ */
+
+YAML_DECLARE(int)
+yaml_parser_update_buffer(yaml_parser_t *parser, size_t length)
+{
+ int first = 1;
+
+ assert(parser->read_handler); /* Read handler must be set. */
+
+ /* If the EOF flag is set and the raw buffer is empty, do nothing. */
+
+ if (parser->eof && parser->raw_buffer.pointer == parser->raw_buffer.last)
+ return 1;
+
+ /* Return if the buffer contains enough characters. */
+
+ if (parser->unread >= length)
+ return 1;
+
+ /* Determine the input encoding if it is not known yet. */
+
+ if (!parser->encoding) {
+ if (!yaml_parser_determine_encoding(parser))
+ return 0;
+ }
+
+ /* Move the unread characters to the beginning of the buffer. */
+
+ if (parser->buffer.start < parser->buffer.pointer
+ && parser->buffer.pointer < parser->buffer.last) {
+ size_t size = parser->buffer.last - parser->buffer.pointer;
+ memmove(parser->buffer.start, parser->buffer.pointer, size);
+ parser->buffer.pointer = parser->buffer.start;
+ parser->buffer.last = parser->buffer.start + size;
+ }
+ else if (parser->buffer.pointer == parser->buffer.last) {
+ parser->buffer.pointer = parser->buffer.start;
+ parser->buffer.last = parser->buffer.start;
+ }
+
+ /* Fill the buffer until it has enough characters. */
+
+ while (parser->unread < length)
+ {
+ /* Fill the raw buffer if necessary. */
+
+ if (!first || parser->raw_buffer.pointer == parser->raw_buffer.last) {
+ if (!yaml_parser_update_raw_buffer(parser)) return 0;
+ }
+ first = 0;
+
+ /* Decode the raw buffer. */
+
+ while (parser->raw_buffer.pointer != parser->raw_buffer.last)
+ {
+ unsigned int value = 0, value2 = 0;
+ int incomplete = 0;
+ unsigned char octet;
+ unsigned int width = 0;
+ int low, high;
+ size_t k;
+ size_t raw_unread = parser->raw_buffer.last - parser->raw_buffer.pointer;
+
+ /* Decode the next character. */
+
+ switch (parser->encoding)
+ {
+ case YAML_UTF8_ENCODING:
+
+ /*
+ * Decode a UTF-8 character. Check RFC 3629
+ * (http://www.ietf.org/rfc/rfc3629.txt) for more details.
+ *
+ * The following table (taken from the RFC) is used for
+ * decoding.
+ *
+ * Char. number range | UTF-8 octet sequence
+ * (hexadecimal) | (binary)
+ * --------------------+------------------------------------
+ * 0000 0000-0000 007F | 0xxxxxxx
+ * 0000 0080-0000 07FF | 110xxxxx 10xxxxxx
+ * 0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx
+ * 0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+ *
+ * Additionally, the characters in the range 0xD800-0xDFFF
+ * are prohibited as they are reserved for use with UTF-16
+ * surrogate pairs.
+ */
+
+ /* Determine the length of the UTF-8 sequence. */
+
+ octet = parser->raw_buffer.pointer[0];
+ width = (octet & 0x80) == 0x00 ? 1 :
+ (octet & 0xE0) == 0xC0 ? 2 :
+ (octet & 0xF0) == 0xE0 ? 3 :
+ (octet & 0xF8) == 0xF0 ? 4 : 0;
+
+ /* Check if the leading octet is valid. */
+
+ if (!width)
+ return yaml_parser_set_reader_error(parser,
+ "invalid leading UTF-8 octet",
+ parser->offset, octet);
+
+ /* Check if the raw buffer contains an incomplete character. */
+
+ if (width > raw_unread) {
+ if (parser->eof) {
+ return yaml_parser_set_reader_error(parser,
+ "incomplete UTF-8 octet sequence",
+ parser->offset, -1);
+ }
+ incomplete = 1;
+ break;
+ }
+
+ /* Decode the leading octet. */
+
+ value = (octet & 0x80) == 0x00 ? octet & 0x7F :
+ (octet & 0xE0) == 0xC0 ? octet & 0x1F :
+ (octet & 0xF0) == 0xE0 ? octet & 0x0F :
+ (octet & 0xF8) == 0xF0 ? octet & 0x07 : 0;
+
+ /* Check and decode the trailing octets. */
+
+ for (k = 1; k < width; k ++)
+ {
+ octet = parser->raw_buffer.pointer[k];
+
+ /* Check if the octet is valid. */
+
+ if ((octet & 0xC0) != 0x80)
+ return yaml_parser_set_reader_error(parser,
+ "invalid trailing UTF-8 octet",
+ parser->offset+k, octet);
+
+ /* Decode the octet. */
+
+ value = (value << 6) + (octet & 0x3F);
+ }
+
+ /* Check the length of the sequence against the value. */
+
+ if (!((width == 1) ||
+ (width == 2 && value >= 0x80) ||
+ (width == 3 && value >= 0x800) ||
+ (width == 4 && value >= 0x10000)))
+ return yaml_parser_set_reader_error(parser,
+ "invalid length of a UTF-8 sequence",
+ parser->offset, -1);
+
+ /* Check the range of the value. */
+
+ if ((value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF)
+ return yaml_parser_set_reader_error(parser,
+ "invalid Unicode character",
+ parser->offset, value);
+
+ break;
+
+ case YAML_UTF16LE_ENCODING:
+ case YAML_UTF16BE_ENCODING:
+
+ low = (parser->encoding == YAML_UTF16LE_ENCODING ? 0 : 1);
+ high = (parser->encoding == YAML_UTF16LE_ENCODING ? 1 : 0);
+
+ /*
+ * The UTF-16 encoding is not as simple as one might
+ * naively think. Check RFC 2781
+ * (http://www.ietf.org/rfc/rfc2781.txt).
+ *
+ * Normally, two subsequent bytes describe a Unicode
+ * character. However a special technique (called a
+ * surrogate pair) is used for specifying character
+ * values larger than 0xFFFF.
+ *
+ * A surrogate pair consists of two pseudo-characters:
+ * high surrogate area (0xD800-0xDBFF)
+ * low surrogate area (0xDC00-0xDFFF)
+ *
+ * The following formulas are used for decoding
+ * and encoding characters using surrogate pairs:
+ *
+ * U = U' + 0x10000 (0x01 00 00 <= U <= 0x10 FF FF)
+ * U' = yyyyyyyyyyxxxxxxxxxx (0 <= U' <= 0x0F FF FF)
+ * W1 = 110110yyyyyyyyyy
+ * W2 = 110111xxxxxxxxxx
+ *
+ * where U is the character value, W1 is the high surrogate
+ * area, W2 is the low surrogate area.
+ */
+
+ /* Check for incomplete UTF-16 character. */
+
+ if (raw_unread < 2) {
+ if (parser->eof) {
+ return yaml_parser_set_reader_error(parser,
+ "incomplete UTF-16 character",
+ parser->offset, -1);
+ }
+ incomplete = 1;
+ break;
+ }
+
+ /* Get the character. */
+
+ value = parser->raw_buffer.pointer[low]
+ + (parser->raw_buffer.pointer[high] << 8);
+
+ /* Check for unexpected low surrogate area. */
+
+ if ((value & 0xFC00) == 0xDC00)
+ return yaml_parser_set_reader_error(parser,
+ "unexpected low surrogate area",
+ parser->offset, value);
+
+ /* Check for a high surrogate area. */
+
+ if ((value & 0xFC00) == 0xD800) {
+
+ width = 4;
+
+ /* Check for incomplete surrogate pair. */
+
+ if (raw_unread < 4) {
+ if (parser->eof) {
+ return yaml_parser_set_reader_error(parser,
+ "incomplete UTF-16 surrogate pair",
+ parser->offset, -1);
+ }
+ incomplete = 1;
+ break;
+ }
+
+ /* Get the next character. */
+
+ value2 = parser->raw_buffer.pointer[low+2]
+ + (parser->raw_buffer.pointer[high+2] << 8);
+
+ /* Check for a low surrogate area. */
+
+ if ((value2 & 0xFC00) != 0xDC00)
+ return yaml_parser_set_reader_error(parser,
+ "expected low surrogate area",
+ parser->offset+2, value2);
+
+ /* Generate the value of the surrogate pair. */
+
+ value = 0x10000 + ((value & 0x3FF) << 10) + (value2 & 0x3FF);
+ }
+
+ else {
+ width = 2;
+ }
+
+ break;
+
+ default:
+ assert(1); /* Impossible. */
+ }
+
+ /* Check if the raw buffer contains enough bytes to form a character. */
+
+ if (incomplete) break;
+
+ /*
+ * Check if the character is in the allowed range:
+ * #x9 | #xA | #xD | [#x20-#x7E] (8 bit)
+ * | #x85 | [#xA0-#xD7FF] | [#xE000-#xFFFD] (16 bit)
+ * | [#x10000-#x10FFFF] (32 bit)
+ */
+
+ if (! (value == 0x09 || value == 0x0A || value == 0x0D
+ || (value >= 0x20 && value <= 0x7E)
+ || (value == 0x85) || (value >= 0xA0 && value <= 0xD7FF)
+ || (value >= 0xE000 && value <= 0xFFFD)
+ || (value >= 0x10000 && value <= 0x10FFFF)))
+ return yaml_parser_set_reader_error(parser,
+ "control characters are not allowed",
+ parser->offset, value);
+
+ /* Move the raw pointers. */
+
+ parser->raw_buffer.pointer += width;
+ parser->offset += width;
+
+ /* Finally put the character into the buffer. */
+
+ /* 0000 0000-0000 007F -> 0xxxxxxx */
+ if (value <= 0x7F) {
+ *(parser->buffer.last++) = value;
+ }
+ /* 0000 0080-0000 07FF -> 110xxxxx 10xxxxxx */
+ else if (value <= 0x7FF) {
+ *(parser->buffer.last++) = 0xC0 + (value >> 6);
+ *(parser->buffer.last++) = 0x80 + (value & 0x3F);
+ }
+ /* 0000 0800-0000 FFFF -> 1110xxxx 10xxxxxx 10xxxxxx */
+ else if (value <= 0xFFFF) {
+ *(parser->buffer.last++) = 0xE0 + (value >> 12);
+ *(parser->buffer.last++) = 0x80 + ((value >> 6) & 0x3F);
+ *(parser->buffer.last++) = 0x80 + (value & 0x3F);
+ }
+ /* 0001 0000-0010 FFFF -> 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */
+ else {
+ *(parser->buffer.last++) = 0xF0 + (value >> 18);
+ *(parser->buffer.last++) = 0x80 + ((value >> 12) & 0x3F);
+ *(parser->buffer.last++) = 0x80 + ((value >> 6) & 0x3F);
+ *(parser->buffer.last++) = 0x80 + (value & 0x3F);
+ }
+
+ parser->unread ++;
+ }
+
+ /* On EOF, put NUL into the buffer and return. */
+
+ if (parser->eof) {
+ *(parser->buffer.last++) = '\0';
+ parser->unread ++;
+ return 1;
+ }
+
+ }
+
+ return 1;
+}
+
diff --git a/ext/psych/yaml/scanner.c b/ext/psych/yaml/scanner.c
new file mode 100644
index 0000000000..a2e8619264
--- /dev/null
+++ b/ext/psych/yaml/scanner.c
@@ -0,0 +1,3570 @@
+
+/*
+ * Introduction
+ * ************
+ *
+ * The following notes assume that you are familiar with the YAML specification
+ * (http://yaml.org/spec/cvs/current.html). We mostly follow it, although in
+ * some cases we are less restrictive that it requires.
+ *
+ * The process of transforming a YAML stream into a sequence of events is
+ * divided on two steps: Scanning and Parsing.
+ *
+ * The Scanner transforms the input stream into a sequence of tokens, while the
+ * parser transform the sequence of tokens produced by the Scanner into a
+ * sequence of parsing events.
+ *
+ * The Scanner is rather clever and complicated. The Parser, on the contrary,
+ * is a straightforward implementation of a recursive-descendant parser (or,
+ * LL(1) parser, as it is usually called).
+ *
+ * Actually there are two issues of Scanning that might be called "clever", the
+ * rest is quite straightforward. The issues are "block collection start" and
+ * "simple keys". Both issues are explained below in details.
+ *
+ * Here the Scanning step is explained and implemented. We start with the list
+ * of all the tokens produced by the Scanner together with short descriptions.
+ *
+ * Now, tokens:
+ *
+ * STREAM-START(encoding) # The stream start.
+ * STREAM-END # The stream end.
+ * VERSION-DIRECTIVE(major,minor) # The '%YAML' directive.
+ * TAG-DIRECTIVE(handle,prefix) # The '%TAG' directive.
+ * DOCUMENT-START # '---'
+ * DOCUMENT-END # '...'
+ * BLOCK-SEQUENCE-START # Indentation increase denoting a block
+ * BLOCK-MAPPING-START # sequence or a block mapping.
+ * BLOCK-END # Indentation decrease.
+ * FLOW-SEQUENCE-START # '['
+ * FLOW-SEQUENCE-END # ']'
+ * BLOCK-SEQUENCE-START # '{'
+ * BLOCK-SEQUENCE-END # '}'
+ * BLOCK-ENTRY # '-'
+ * FLOW-ENTRY # ','
+ * KEY # '?' or nothing (simple keys).
+ * VALUE # ':'
+ * ALIAS(anchor) # '*anchor'
+ * ANCHOR(anchor) # '&anchor'
+ * TAG(handle,suffix) # '!handle!suffix'
+ * SCALAR(value,style) # A scalar.
+ *
+ * The following two tokens are "virtual" tokens denoting the beginning and the
+ * end of the stream:
+ *
+ * STREAM-START(encoding)
+ * STREAM-END
+ *
+ * We pass the information about the input stream encoding with the
+ * STREAM-START token.
+ *
+ * The next two tokens are responsible for tags:
+ *
+ * VERSION-DIRECTIVE(major,minor)
+ * TAG-DIRECTIVE(handle,prefix)
+ *
+ * Example:
+ *
+ * %YAML 1.1
+ * %TAG ! !foo
+ * %TAG !yaml! tag:yaml.org,2002:
+ * ---
+ *
+ * The correspoding sequence of tokens:
+ *
+ * STREAM-START(utf-8)
+ * VERSION-DIRECTIVE(1,1)
+ * TAG-DIRECTIVE("!","!foo")
+ * TAG-DIRECTIVE("!yaml","tag:yaml.org,2002:")
+ * DOCUMENT-START
+ * STREAM-END
+ *
+ * Note that the VERSION-DIRECTIVE and TAG-DIRECTIVE tokens occupy a whole
+ * line.
+ *
+ * The document start and end indicators are represented by:
+ *
+ * DOCUMENT-START
+ * DOCUMENT-END
+ *
+ * Note that if a YAML stream contains an implicit document (without '---'
+ * and '...' indicators), no DOCUMENT-START and DOCUMENT-END tokens will be
+ * produced.
+ *
+ * In the following examples, we present whole documents together with the
+ * produced tokens.
+ *
+ * 1. An implicit document:
+ *
+ * 'a scalar'
+ *
+ * Tokens:
+ *
+ * STREAM-START(utf-8)
+ * SCALAR("a scalar",single-quoted)
+ * STREAM-END
+ *
+ * 2. An explicit document:
+ *
+ * ---
+ * 'a scalar'
+ * ...
+ *
+ * Tokens:
+ *
+ * STREAM-START(utf-8)
+ * DOCUMENT-START
+ * SCALAR("a scalar",single-quoted)
+ * DOCUMENT-END
+ * STREAM-END
+ *
+ * 3. Several documents in a stream:
+ *
+ * 'a scalar'
+ * ---
+ * 'another scalar'
+ * ---
+ * 'yet another scalar'
+ *
+ * Tokens:
+ *
+ * STREAM-START(utf-8)
+ * SCALAR("a scalar",single-quoted)
+ * DOCUMENT-START
+ * SCALAR("another scalar",single-quoted)
+ * DOCUMENT-START
+ * SCALAR("yet another scalar",single-quoted)
+ * STREAM-END
+ *
+ * We have already introduced the SCALAR token above. The following tokens are
+ * used to describe aliases, anchors, tag, and scalars:
+ *
+ * ALIAS(anchor)
+ * ANCHOR(anchor)
+ * TAG(handle,suffix)
+ * SCALAR(value,style)
+ *
+ * The following series of examples illustrate the usage of these tokens:
+ *
+ * 1. A recursive sequence:
+ *
+ * &A [ *A ]
+ *
+ * Tokens:
+ *
+ * STREAM-START(utf-8)
+ * ANCHOR("A")
+ * FLOW-SEQUENCE-START
+ * ALIAS("A")
+ * FLOW-SEQUENCE-END
+ * STREAM-END
+ *
+ * 2. A tagged scalar:
+ *
+ * !!float "3.14" # A good approximation.
+ *
+ * Tokens:
+ *
+ * STREAM-START(utf-8)
+ * TAG("!!","float")
+ * SCALAR("3.14",double-quoted)
+ * STREAM-END
+ *
+ * 3. Various scalar styles:
+ *
+ * --- # Implicit empty plain scalars do not produce tokens.
+ * --- a plain scalar
+ * --- 'a single-quoted scalar'
+ * --- "a double-quoted scalar"
+ * --- |-
+ * a literal scalar
+ * --- >-
+ * a folded
+ * scalar
+ *
+ * Tokens:
+ *
+ * STREAM-START(utf-8)
+ * DOCUMENT-START
+ * DOCUMENT-START
+ * SCALAR("a plain scalar",plain)
+ * DOCUMENT-START
+ * SCALAR("a single-quoted scalar",single-quoted)
+ * DOCUMENT-START
+ * SCALAR("a double-quoted scalar",double-quoted)
+ * DOCUMENT-START
+ * SCALAR("a literal scalar",literal)
+ * DOCUMENT-START
+ * SCALAR("a folded scalar",folded)
+ * STREAM-END
+ *
+ * Now it's time to review collection-related tokens. We will start with
+ * flow collections:
+ *
+ * FLOW-SEQUENCE-START
+ * FLOW-SEQUENCE-END
+ * FLOW-MAPPING-START
+ * FLOW-MAPPING-END
+ * FLOW-ENTRY
+ * KEY
+ * VALUE
+ *
+ * The tokens FLOW-SEQUENCE-START, FLOW-SEQUENCE-END, FLOW-MAPPING-START, and
+ * FLOW-MAPPING-END represent the indicators '[', ']', '{', and '}'
+ * correspondingly. FLOW-ENTRY represent the ',' indicator. Finally the
+ * indicators '?' and ':', which are used for denoting mapping keys and values,
+ * are represented by the KEY and VALUE tokens.
+ *
+ * The following examples show flow collections:
+ *
+ * 1. A flow sequence:
+ *
+ * [item 1, item 2, item 3]
+ *
+ * Tokens:
+ *
+ * STREAM-START(utf-8)
+ * FLOW-SEQUENCE-START
+ * SCALAR("item 1",plain)
+ * FLOW-ENTRY
+ * SCALAR("item 2",plain)
+ * FLOW-ENTRY
+ * SCALAR("item 3",plain)
+ * FLOW-SEQUENCE-END
+ * STREAM-END
+ *
+ * 2. A flow mapping:
+ *
+ * {
+ * a simple key: a value, # Note that the KEY token is produced.
+ * ? a complex key: another value,
+ * }
+ *
+ * Tokens:
+ *
+ * STREAM-START(utf-8)
+ * FLOW-MAPPING-START
+ * KEY
+ * SCALAR("a simple key",plain)
+ * VALUE
+ * SCALAR("a value",plain)
+ * FLOW-ENTRY
+ * KEY
+ * SCALAR("a complex key",plain)
+ * VALUE
+ * SCALAR("another value",plain)
+ * FLOW-ENTRY
+ * FLOW-MAPPING-END
+ * STREAM-END
+ *
+ * A simple key is a key which is not denoted by the '?' indicator. Note that
+ * the Scanner still produce the KEY token whenever it encounters a simple key.
+ *
+ * For scanning block collections, the following tokens are used (note that we
+ * repeat KEY and VALUE here):
+ *
+ * BLOCK-SEQUENCE-START
+ * BLOCK-MAPPING-START
+ * BLOCK-END
+ * BLOCK-ENTRY
+ * KEY
+ * VALUE
+ *
+ * The tokens BLOCK-SEQUENCE-START and BLOCK-MAPPING-START denote indentation
+ * increase that precedes a block collection (cf. the INDENT token in Python).
+ * The token BLOCK-END denote indentation decrease that ends a block collection
+ * (cf. the DEDENT token in Python). However YAML has some syntax pecularities
+ * that makes detections of these tokens more complex.
+ *
+ * The tokens BLOCK-ENTRY, KEY, and VALUE are used to represent the indicators
+ * '-', '?', and ':' correspondingly.
+ *
+ * The following examples show how the tokens BLOCK-SEQUENCE-START,
+ * BLOCK-MAPPING-START, and BLOCK-END are emitted by the Scanner:
+ *
+ * 1. Block sequences:
+ *
+ * - item 1
+ * - item 2
+ * -
+ * - item 3.1
+ * - item 3.2
+ * -
+ * key 1: value 1
+ * key 2: value 2
+ *
+ * Tokens:
+ *
+ * STREAM-START(utf-8)
+ * BLOCK-SEQUENCE-START
+ * BLOCK-ENTRY
+ * SCALAR("item 1",plain)
+ * BLOCK-ENTRY
+ * SCALAR("item 2",plain)
+ * BLOCK-ENTRY
+ * BLOCK-SEQUENCE-START
+ * BLOCK-ENTRY
+ * SCALAR("item 3.1",plain)
+ * BLOCK-ENTRY
+ * SCALAR("item 3.2",plain)
+ * BLOCK-END
+ * BLOCK-ENTRY
+ * BLOCK-MAPPING-START
+ * KEY
+ * SCALAR("key 1",plain)
+ * VALUE
+ * SCALAR("value 1",plain)
+ * KEY
+ * SCALAR("key 2",plain)
+ * VALUE
+ * SCALAR("value 2",plain)
+ * BLOCK-END
+ * BLOCK-END
+ * STREAM-END
+ *
+ * 2. Block mappings:
+ *
+ * a simple key: a value # The KEY token is produced here.
+ * ? a complex key
+ * : another value
+ * a mapping:
+ * key 1: value 1
+ * key 2: value 2
+ * a sequence:
+ * - item 1
+ * - item 2
+ *
+ * Tokens:
+ *
+ * STREAM-START(utf-8)
+ * BLOCK-MAPPING-START
+ * KEY
+ * SCALAR("a simple key",plain)
+ * VALUE
+ * SCALAR("a value",plain)
+ * KEY
+ * SCALAR("a complex key",plain)
+ * VALUE
+ * SCALAR("another value",plain)
+ * KEY
+ * SCALAR("a mapping",plain)
+ * BLOCK-MAPPING-START
+ * KEY
+ * SCALAR("key 1",plain)
+ * VALUE
+ * SCALAR("value 1",plain)
+ * KEY
+ * SCALAR("key 2",plain)
+ * VALUE
+ * SCALAR("value 2",plain)
+ * BLOCK-END
+ * KEY
+ * SCALAR("a sequence",plain)
+ * VALUE
+ * BLOCK-SEQUENCE-START
+ * BLOCK-ENTRY
+ * SCALAR("item 1",plain)
+ * BLOCK-ENTRY
+ * SCALAR("item 2",plain)
+ * BLOCK-END
+ * BLOCK-END
+ * STREAM-END
+ *
+ * YAML does not always require to start a new block collection from a new
+ * line. If the current line contains only '-', '?', and ':' indicators, a new
+ * block collection may start at the current line. The following examples
+ * illustrate this case:
+ *
+ * 1. Collections in a sequence:
+ *
+ * - - item 1
+ * - item 2
+ * - key 1: value 1
+ * key 2: value 2
+ * - ? complex key
+ * : complex value
+ *
+ * Tokens:
+ *
+ * STREAM-START(utf-8)
+ * BLOCK-SEQUENCE-START
+ * BLOCK-ENTRY
+ * BLOCK-SEQUENCE-START
+ * BLOCK-ENTRY
+ * SCALAR("item 1",plain)
+ * BLOCK-ENTRY
+ * SCALAR("item 2",plain)
+ * BLOCK-END
+ * BLOCK-ENTRY
+ * BLOCK-MAPPING-START
+ * KEY
+ * SCALAR("key 1",plain)
+ * VALUE
+ * SCALAR("value 1",plain)
+ * KEY
+ * SCALAR("key 2",plain)
+ * VALUE
+ * SCALAR("value 2",plain)
+ * BLOCK-END
+ * BLOCK-ENTRY
+ * BLOCK-MAPPING-START
+ * KEY
+ * SCALAR("complex key")
+ * VALUE
+ * SCALAR("complex value")
+ * BLOCK-END
+ * BLOCK-END
+ * STREAM-END
+ *
+ * 2. Collections in a mapping:
+ *
+ * ? a sequence
+ * : - item 1
+ * - item 2
+ * ? a mapping
+ * : key 1: value 1
+ * key 2: value 2
+ *
+ * Tokens:
+ *
+ * STREAM-START(utf-8)
+ * BLOCK-MAPPING-START
+ * KEY
+ * SCALAR("a sequence",plain)
+ * VALUE
+ * BLOCK-SEQUENCE-START
+ * BLOCK-ENTRY
+ * SCALAR("item 1",plain)
+ * BLOCK-ENTRY
+ * SCALAR("item 2",plain)
+ * BLOCK-END
+ * KEY
+ * SCALAR("a mapping",plain)
+ * VALUE
+ * BLOCK-MAPPING-START
+ * KEY
+ * SCALAR("key 1",plain)
+ * VALUE
+ * SCALAR("value 1",plain)
+ * KEY
+ * SCALAR("key 2",plain)
+ * VALUE
+ * SCALAR("value 2",plain)
+ * BLOCK-END
+ * BLOCK-END
+ * STREAM-END
+ *
+ * YAML also permits non-indented sequences if they are included into a block
+ * mapping. In this case, the token BLOCK-SEQUENCE-START is not produced:
+ *
+ * key:
+ * - item 1 # BLOCK-SEQUENCE-START is NOT produced here.
+ * - item 2
+ *
+ * Tokens:
+ *
+ * STREAM-START(utf-8)
+ * BLOCK-MAPPING-START
+ * KEY
+ * SCALAR("key",plain)
+ * VALUE
+ * BLOCK-ENTRY
+ * SCALAR("item 1",plain)
+ * BLOCK-ENTRY
+ * SCALAR("item 2",plain)
+ * BLOCK-END
+ */
+
+#include "yaml_private.h"
+
+/*
+ * Ensure that the buffer contains the required number of characters.
+ * Return 1 on success, 0 on failure (reader error or memory error).
+ */
+
+#define CACHE(parser,length) \
+ (parser->unread >= (length) \
+ ? 1 \
+ : yaml_parser_update_buffer(parser, (length)))
+
+/*
+ * Advance the buffer pointer.
+ */
+
+#define SKIP(parser) \
+ (parser->mark.index ++, \
+ parser->mark.column ++, \
+ parser->unread --, \
+ parser->buffer.pointer += WIDTH(parser->buffer))
+
+#define SKIP_LINE(parser) \
+ (IS_CRLF(parser->buffer) ? \
+ (parser->mark.index += 2, \
+ parser->mark.column = 0, \
+ parser->mark.line ++, \
+ parser->unread -= 2, \
+ parser->buffer.pointer += 2) : \
+ IS_BREAK(parser->buffer) ? \
+ (parser->mark.index ++, \
+ parser->mark.column = 0, \
+ parser->mark.line ++, \
+ parser->unread --, \
+ parser->buffer.pointer += WIDTH(parser->buffer)) : 0)
+
+/*
+ * Copy a character to a string buffer and advance pointers.
+ */
+
+#define READ(parser,string) \
+ (STRING_EXTEND(parser,string) ? \
+ (COPY(string,parser->buffer), \
+ parser->mark.index ++, \
+ parser->mark.column ++, \
+ parser->unread --, \
+ 1) : 0)
+
+/*
+ * Copy a line break character to a string buffer and advance pointers.
+ */
+
+#define READ_LINE(parser,string) \
+ (STRING_EXTEND(parser,string) ? \
+ (((CHECK_AT(parser->buffer,'\r',0) \
+ && CHECK_AT(parser->buffer,'\n',1)) ? /* CR LF -> LF */ \
+ (*((string).pointer++) = (yaml_char_t) '\n', \
+ parser->buffer.pointer += 2, \
+ parser->mark.index += 2, \
+ parser->mark.column = 0, \
+ parser->mark.line ++, \
+ parser->unread -= 2) : \
+ (CHECK_AT(parser->buffer,'\r',0) \
+ || CHECK_AT(parser->buffer,'\n',0)) ? /* CR|LF -> LF */ \
+ (*((string).pointer++) = (yaml_char_t) '\n', \
+ parser->buffer.pointer ++, \
+ parser->mark.index ++, \
+ parser->mark.column = 0, \
+ parser->mark.line ++, \
+ parser->unread --) : \
+ (CHECK_AT(parser->buffer,'\xC2',0) \
+ && CHECK_AT(parser->buffer,'\x85',1)) ? /* NEL -> LF */ \
+ (*((string).pointer++) = (yaml_char_t) '\n', \
+ parser->buffer.pointer += 2, \
+ parser->mark.index ++, \
+ parser->mark.column = 0, \
+ parser->mark.line ++, \
+ parser->unread --) : \
+ (CHECK_AT(parser->buffer,'\xE2',0) && \
+ CHECK_AT(parser->buffer,'\x80',1) && \
+ (CHECK_AT(parser->buffer,'\xA8',2) || \
+ CHECK_AT(parser->buffer,'\xA9',2))) ? /* LS|PS -> LS|PS */ \
+ (*((string).pointer++) = *(parser->buffer.pointer++), \
+ *((string).pointer++) = *(parser->buffer.pointer++), \
+ *((string).pointer++) = *(parser->buffer.pointer++), \
+ parser->mark.index ++, \
+ parser->mark.column = 0, \
+ parser->mark.line ++, \
+ parser->unread --) : 0), \
+ 1) : 0)
+
+/*
+ * Public API declarations.
+ */
+
+YAML_DECLARE(int)
+yaml_parser_scan(yaml_parser_t *parser, yaml_token_t *token);
+
+/*
+ * Error handling.
+ */
+
+static int
+yaml_parser_set_scanner_error(yaml_parser_t *parser, const char *context,
+ yaml_mark_t context_mark, const char *problem);
+
+/*
+ * High-level token API.
+ */
+
+YAML_DECLARE(int)
+yaml_parser_fetch_more_tokens(yaml_parser_t *parser);
+
+static int
+yaml_parser_fetch_next_token(yaml_parser_t *parser);
+
+/*
+ * Potential simple keys.
+ */
+
+static int
+yaml_parser_stale_simple_keys(yaml_parser_t *parser);
+
+static int
+yaml_parser_save_simple_key(yaml_parser_t *parser);
+
+static int
+yaml_parser_remove_simple_key(yaml_parser_t *parser);
+
+static int
+yaml_parser_increase_flow_level(yaml_parser_t *parser);
+
+static int
+yaml_parser_decrease_flow_level(yaml_parser_t *parser);
+
+/*
+ * Indentation treatment.
+ */
+
+static int
+yaml_parser_roll_indent(yaml_parser_t *parser, int column,
+ int number, yaml_token_type_t type, yaml_mark_t mark);
+
+static int
+yaml_parser_unroll_indent(yaml_parser_t *parser, int column);
+
+/*
+ * Token fetchers.
+ */
+
+static int
+yaml_parser_fetch_stream_start(yaml_parser_t *parser);
+
+static int
+yaml_parser_fetch_stream_end(yaml_parser_t *parser);
+
+static int
+yaml_parser_fetch_directive(yaml_parser_t *parser);
+
+static int
+yaml_parser_fetch_document_indicator(yaml_parser_t *parser,
+ yaml_token_type_t type);
+
+static int
+yaml_parser_fetch_flow_collection_start(yaml_parser_t *parser,
+ yaml_token_type_t type);
+
+static int
+yaml_parser_fetch_flow_collection_end(yaml_parser_t *parser,
+ yaml_token_type_t type);
+
+static int
+yaml_parser_fetch_flow_entry(yaml_parser_t *parser);
+
+static int
+yaml_parser_fetch_block_entry(yaml_parser_t *parser);
+
+static int
+yaml_parser_fetch_key(yaml_parser_t *parser);
+
+static int
+yaml_parser_fetch_value(yaml_parser_t *parser);
+
+static int
+yaml_parser_fetch_anchor(yaml_parser_t *parser, yaml_token_type_t type);
+
+static int
+yaml_parser_fetch_tag(yaml_parser_t *parser);
+
+static int
+yaml_parser_fetch_block_scalar(yaml_parser_t *parser, int literal);
+
+static int
+yaml_parser_fetch_flow_scalar(yaml_parser_t *parser, int single);
+
+static int
+yaml_parser_fetch_plain_scalar(yaml_parser_t *parser);
+
+/*
+ * Token scanners.
+ */
+
+static int
+yaml_parser_scan_to_next_token(yaml_parser_t *parser);
+
+static int
+yaml_parser_scan_directive(yaml_parser_t *parser, yaml_token_t *token);
+
+static int
+yaml_parser_scan_directive_name(yaml_parser_t *parser,
+ yaml_mark_t start_mark, yaml_char_t **name);
+
+static int
+yaml_parser_scan_version_directive_value(yaml_parser_t *parser,
+ yaml_mark_t start_mark, int *major, int *minor);
+
+static int
+yaml_parser_scan_version_directive_number(yaml_parser_t *parser,
+ yaml_mark_t start_mark, int *number);
+
+static int
+yaml_parser_scan_tag_directive_value(yaml_parser_t *parser,
+ yaml_mark_t mark, yaml_char_t **handle, yaml_char_t **prefix);
+
+static int
+yaml_parser_scan_anchor(yaml_parser_t *parser, yaml_token_t *token,
+ yaml_token_type_t type);
+
+static int
+yaml_parser_scan_tag(yaml_parser_t *parser, yaml_token_t *token);
+
+static int
+yaml_parser_scan_tag_handle(yaml_parser_t *parser, int directive,
+ yaml_mark_t start_mark, yaml_char_t **handle);
+
+static int
+yaml_parser_scan_tag_uri(yaml_parser_t *parser, int directive,
+ yaml_char_t *head, yaml_mark_t start_mark, yaml_char_t **uri);
+
+static int
+yaml_parser_scan_uri_escapes(yaml_parser_t *parser, int directive,
+ yaml_mark_t start_mark, yaml_string_t *string);
+
+static int
+yaml_parser_scan_block_scalar(yaml_parser_t *parser, yaml_token_t *token,
+ int literal);
+
+static int
+yaml_parser_scan_block_scalar_breaks(yaml_parser_t *parser,
+ int *indent, yaml_string_t *breaks,
+ yaml_mark_t start_mark, yaml_mark_t *end_mark);
+
+static int
+yaml_parser_scan_flow_scalar(yaml_parser_t *parser, yaml_token_t *token,
+ int single);
+
+static int
+yaml_parser_scan_plain_scalar(yaml_parser_t *parser, yaml_token_t *token);
+
+/*
+ * Get the next token.
+ */
+
+YAML_DECLARE(int)
+yaml_parser_scan(yaml_parser_t *parser, yaml_token_t *token)
+{
+ assert(parser); /* Non-NULL parser object is expected. */
+ assert(token); /* Non-NULL token object is expected. */
+
+ /* Erase the token object. */
+
+ memset(token, 0, sizeof(yaml_token_t));
+
+ /* No tokens after STREAM-END or error. */
+
+ if (parser->stream_end_produced || parser->error) {
+ return 1;
+ }
+
+ /* Ensure that the tokens queue contains enough tokens. */
+
+ if (!parser->token_available) {
+ if (!yaml_parser_fetch_more_tokens(parser))
+ return 0;
+ }
+
+ /* Fetch the next token from the queue. */
+
+ *token = DEQUEUE(parser, parser->tokens);
+ parser->token_available = 0;
+ parser->tokens_parsed ++;
+
+ if (token->type == YAML_STREAM_END_TOKEN) {
+ parser->stream_end_produced = 1;
+ }
+
+ return 1;
+}
+
+/*
+ * Set the scanner error and return 0.
+ */
+
+static int
+yaml_parser_set_scanner_error(yaml_parser_t *parser, const char *context,
+ yaml_mark_t context_mark, const char *problem)
+{
+ parser->error = YAML_SCANNER_ERROR;
+ parser->context = context;
+ parser->context_mark = context_mark;
+ parser->problem = problem;
+ parser->problem_mark = parser->mark;
+
+ return 0;
+}
+
+/*
+ * Ensure that the tokens queue contains at least one token which can be
+ * returned to the Parser.
+ */
+
+YAML_DECLARE(int)
+yaml_parser_fetch_more_tokens(yaml_parser_t *parser)
+{
+ int need_more_tokens;
+
+ /* While we need more tokens to fetch, do it. */
+
+ while (1)
+ {
+ /*
+ * Check if we really need to fetch more tokens.
+ */
+
+ need_more_tokens = 0;
+
+ if (parser->tokens.head == parser->tokens.tail)
+ {
+ /* Queue is empty. */
+
+ need_more_tokens = 1;
+ }
+ else
+ {
+ yaml_simple_key_t *simple_key;
+
+ /* Check if any potential simple key may occupy the head position. */
+
+ if (!yaml_parser_stale_simple_keys(parser))
+ return 0;
+
+ for (simple_key = parser->simple_keys.start;
+ simple_key != parser->simple_keys.top; simple_key++) {
+ if (simple_key->possible
+ && simple_key->token_number == parser->tokens_parsed) {
+ need_more_tokens = 1;
+ break;
+ }
+ }
+ }
+
+ /* We are finished. */
+
+ if (!need_more_tokens)
+ break;
+
+ /* Fetch the next token. */
+
+ if (!yaml_parser_fetch_next_token(parser))
+ return 0;
+ }
+
+ parser->token_available = 1;
+
+ return 1;
+}
+
+/*
+ * The dispatcher for token fetchers.
+ */
+
+static int
+yaml_parser_fetch_next_token(yaml_parser_t *parser)
+{
+ /* Ensure that the buffer is initialized. */
+
+ if (!CACHE(parser, 1))
+ return 0;
+
+ /* Check if we just started scanning. Fetch STREAM-START then. */
+
+ if (!parser->stream_start_produced)
+ return yaml_parser_fetch_stream_start(parser);
+
+ /* Eat whitespaces and comments until we reach the next token. */
+
+ if (!yaml_parser_scan_to_next_token(parser))
+ return 0;
+
+ /* Remove obsolete potential simple keys. */
+
+ if (!yaml_parser_stale_simple_keys(parser))
+ return 0;
+
+ /* Check the indentation level against the current column. */
+
+ if (!yaml_parser_unroll_indent(parser, parser->mark.column))
+ return 0;
+
+ /*
+ * Ensure that the buffer contains at least 4 characters. 4 is the length
+ * of the longest indicators ('--- ' and '... ').
+ */
+
+ if (!CACHE(parser, 4))
+ return 0;
+
+ /* Is it the end of the stream? */
+
+ if (IS_Z(parser->buffer))
+ return yaml_parser_fetch_stream_end(parser);
+
+ /* Is it a directive? */
+
+ if (parser->mark.column == 0 && CHECK(parser->buffer, '%'))
+ return yaml_parser_fetch_directive(parser);
+
+ /* Is it the document start indicator? */
+
+ if (parser->mark.column == 0
+ && CHECK_AT(parser->buffer, '-', 0)
+ && CHECK_AT(parser->buffer, '-', 1)
+ && CHECK_AT(parser->buffer, '-', 2)
+ && IS_BLANKZ_AT(parser->buffer, 3))
+ return yaml_parser_fetch_document_indicator(parser,
+ YAML_DOCUMENT_START_TOKEN);
+
+ /* Is it the document end indicator? */
+
+ if (parser->mark.column == 0
+ && CHECK_AT(parser->buffer, '.', 0)
+ && CHECK_AT(parser->buffer, '.', 1)
+ && CHECK_AT(parser->buffer, '.', 2)
+ && IS_BLANKZ_AT(parser->buffer, 3))
+ return yaml_parser_fetch_document_indicator(parser,
+ YAML_DOCUMENT_END_TOKEN);
+
+ /* Is it the flow sequence start indicator? */
+
+ if (CHECK(parser->buffer, '['))
+ return yaml_parser_fetch_flow_collection_start(parser,
+ YAML_FLOW_SEQUENCE_START_TOKEN);
+
+ /* Is it the flow mapping start indicator? */
+
+ if (CHECK(parser->buffer, '{'))
+ return yaml_parser_fetch_flow_collection_start(parser,
+ YAML_FLOW_MAPPING_START_TOKEN);
+
+ /* Is it the flow sequence end indicator? */
+
+ if (CHECK(parser->buffer, ']'))
+ return yaml_parser_fetch_flow_collection_end(parser,
+ YAML_FLOW_SEQUENCE_END_TOKEN);
+
+ /* Is it the flow mapping end indicator? */
+
+ if (CHECK(parser->buffer, '}'))
+ return yaml_parser_fetch_flow_collection_end(parser,
+ YAML_FLOW_MAPPING_END_TOKEN);
+
+ /* Is it the flow entry indicator? */
+
+ if (CHECK(parser->buffer, ','))
+ return yaml_parser_fetch_flow_entry(parser);
+
+ /* Is it the block entry indicator? */
+
+ if (CHECK(parser->buffer, '-') && IS_BLANKZ_AT(parser->buffer, 1))
+ return yaml_parser_fetch_block_entry(parser);
+
+ /* Is it the key indicator? */
+
+ if (CHECK(parser->buffer, '?')
+ && (parser->flow_level || IS_BLANKZ_AT(parser->buffer, 1)))
+ return yaml_parser_fetch_key(parser);
+
+ /* Is it the value indicator? */
+
+ if (CHECK(parser->buffer, ':')
+ && (parser->flow_level || IS_BLANKZ_AT(parser->buffer, 1)))
+ return yaml_parser_fetch_value(parser);
+
+ /* Is it an alias? */
+
+ if (CHECK(parser->buffer, '*'))
+ return yaml_parser_fetch_anchor(parser, YAML_ALIAS_TOKEN);
+
+ /* Is it an anchor? */
+
+ if (CHECK(parser->buffer, '&'))
+ return yaml_parser_fetch_anchor(parser, YAML_ANCHOR_TOKEN);
+
+ /* Is it a tag? */
+
+ if (CHECK(parser->buffer, '!'))
+ return yaml_parser_fetch_tag(parser);
+
+ /* Is it a literal scalar? */
+
+ if (CHECK(parser->buffer, '|') && !parser->flow_level)
+ return yaml_parser_fetch_block_scalar(parser, 1);
+
+ /* Is it a folded scalar? */
+
+ if (CHECK(parser->buffer, '>') && !parser->flow_level)
+ return yaml_parser_fetch_block_scalar(parser, 0);
+
+ /* Is it a single-quoted scalar? */
+
+ if (CHECK(parser->buffer, '\''))
+ return yaml_parser_fetch_flow_scalar(parser, 1);
+
+ /* Is it a double-quoted scalar? */
+
+ if (CHECK(parser->buffer, '"'))
+ return yaml_parser_fetch_flow_scalar(parser, 0);
+
+ /*
+ * Is it a plain scalar?
+ *
+ * A plain scalar may start with any non-blank characters except
+ *
+ * '-', '?', ':', ',', '[', ']', '{', '}',
+ * '#', '&', '*', '!', '|', '>', '\'', '\"',
+ * '%', '@', '`'.
+ *
+ * In the block context (and, for the '-' indicator, in the flow context
+ * too), it may also start with the characters
+ *
+ * '-', '?', ':'
+ *
+ * if it is followed by a non-space character.
+ *
+ * The last rule is more restrictive than the specification requires.
+ */
+
+ if (!(IS_BLANKZ(parser->buffer) || CHECK(parser->buffer, '-')
+ || CHECK(parser->buffer, '?') || CHECK(parser->buffer, ':')
+ || CHECK(parser->buffer, ',') || CHECK(parser->buffer, '[')
+ || CHECK(parser->buffer, ']') || CHECK(parser->buffer, '{')
+ || CHECK(parser->buffer, '}') || CHECK(parser->buffer, '#')
+ || CHECK(parser->buffer, '&') || CHECK(parser->buffer, '*')
+ || CHECK(parser->buffer, '!') || CHECK(parser->buffer, '|')
+ || CHECK(parser->buffer, '>') || CHECK(parser->buffer, '\'')
+ || CHECK(parser->buffer, '"') || CHECK(parser->buffer, '%')
+ || CHECK(parser->buffer, '@') || CHECK(parser->buffer, '`')) ||
+ (CHECK(parser->buffer, '-') && !IS_BLANK_AT(parser->buffer, 1)) ||
+ (!parser->flow_level &&
+ (CHECK(parser->buffer, '?') || CHECK(parser->buffer, ':'))
+ && !IS_BLANKZ_AT(parser->buffer, 1)))
+ return yaml_parser_fetch_plain_scalar(parser);
+
+ /*
+ * If we don't determine the token type so far, it is an error.
+ */
+
+ return yaml_parser_set_scanner_error(parser,
+ "while scanning for the next token", parser->mark,
+ "found character that cannot start any token");
+}
+
+/*
+ * Check the list of potential simple keys and remove the positions that
+ * cannot contain simple keys anymore.
+ */
+
+static int
+yaml_parser_stale_simple_keys(yaml_parser_t *parser)
+{
+ yaml_simple_key_t *simple_key;
+
+ /* Check for a potential simple key for each flow level. */
+
+ for (simple_key = parser->simple_keys.start;
+ simple_key != parser->simple_keys.top; simple_key ++)
+ {
+ /*
+ * The specification requires that a simple key
+ *
+ * - is limited to a single line,
+ * - is shorter than 1024 characters.
+ */
+
+ if (simple_key->possible
+ && (simple_key->mark.line < parser->mark.line
+ || simple_key->mark.index+1024 < parser->mark.index)) {
+
+ /* Check if the potential simple key to be removed is required. */
+
+ if (simple_key->required) {
+ return yaml_parser_set_scanner_error(parser,
+ "while scanning a simple key", simple_key->mark,
+ "could not find expected ':'");
+ }
+
+ simple_key->possible = 0;
+ }
+ }
+
+ return 1;
+}
+
+/*
+ * Check if a simple key may start at the current position and add it if
+ * needed.
+ */
+
+static int
+yaml_parser_save_simple_key(yaml_parser_t *parser)
+{
+ /*
+ * A simple key is required at the current position if the scanner is in
+ * the block context and the current column coincides with the indentation
+ * level.
+ */
+
+ int required = (!parser->flow_level
+ && parser->indent == (int)parser->mark.column);
+
+ /*
+ * A simple key is required only when it is the first token in the current
+ * line. Therefore it is always allowed. But we add a check anyway.
+ */
+
+ assert(parser->simple_key_allowed || !required); /* Impossible. */
+
+ /*
+ * If the current position may start a simple key, save it.
+ */
+
+ if (parser->simple_key_allowed)
+ {
+ yaml_simple_key_t simple_key;
+ simple_key.possible = 1;
+ simple_key.required = required;
+ simple_key.token_number =
+ parser->tokens_parsed + (parser->tokens.tail - parser->tokens.head);
+ simple_key.mark = parser->mark;
+
+ if (!yaml_parser_remove_simple_key(parser)) return 0;
+
+ *(parser->simple_keys.top-1) = simple_key;
+ }
+
+ return 1;
+}
+
+/*
+ * Remove a potential simple key at the current flow level.
+ */
+
+static int
+yaml_parser_remove_simple_key(yaml_parser_t *parser)
+{
+ yaml_simple_key_t *simple_key = parser->simple_keys.top-1;
+
+ if (simple_key->possible)
+ {
+ /* If the key is required, it is an error. */
+
+ if (simple_key->required) {
+ return yaml_parser_set_scanner_error(parser,
+ "while scanning a simple key", simple_key->mark,
+ "could not find expected ':'");
+ }
+ }
+
+ /* Remove the key from the stack. */
+
+ simple_key->possible = 0;
+
+ return 1;
+}
+
+/*
+ * Increase the flow level and resize the simple key list if needed.
+ */
+
+static int
+yaml_parser_increase_flow_level(yaml_parser_t *parser)
+{
+ yaml_simple_key_t empty_simple_key = { 0, 0, 0, { 0, 0, 0 } };
+
+ /* Reset the simple key on the next level. */
+
+ if (!PUSH(parser, parser->simple_keys, empty_simple_key))
+ return 0;
+
+ /* Increase the flow level. */
+
+ parser->flow_level++;
+
+ return 1;
+}
+
+/*
+ * Decrease the flow level.
+ */
+
+static int
+yaml_parser_decrease_flow_level(yaml_parser_t *parser)
+{
+ yaml_simple_key_t dummy_key; /* Used to eliminate a compiler warning. */
+
+ if (parser->flow_level) {
+ parser->flow_level --;
+ dummy_key = POP(parser, parser->simple_keys);
+ }
+
+ return 1;
+}
+
+/*
+ * Push the current indentation level to the stack and set the new level
+ * the current column is greater than the indentation level. In this case,
+ * append or insert the specified token into the token queue.
+ *
+ */
+
+static int
+yaml_parser_roll_indent(yaml_parser_t *parser, int column,
+ int number, yaml_token_type_t type, yaml_mark_t mark)
+{
+ yaml_token_t token;
+
+ /* In the flow context, do nothing. */
+
+ if (parser->flow_level)
+ return 1;
+
+ if (parser->indent < column)
+ {
+ /*
+ * Push the current indentation level to the stack and set the new
+ * indentation level.
+ */
+
+ if (!PUSH(parser, parser->indents, parser->indent))
+ return 0;
+
+ parser->indent = column;
+
+ /* Create a token and insert it into the queue. */
+
+ TOKEN_INIT(token, type, mark, mark);
+
+ if (number == -1) {
+ if (!ENQUEUE(parser, parser->tokens, token))
+ return 0;
+ }
+ else {
+ if (!QUEUE_INSERT(parser,
+ parser->tokens, number - parser->tokens_parsed, token))
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+/*
+ * Pop indentation levels from the indents stack until the current level
+ * becomes less or equal to the column. For each intendation level, append
+ * the BLOCK-END token.
+ */
+
+
+static int
+yaml_parser_unroll_indent(yaml_parser_t *parser, int column)
+{
+ yaml_token_t token;
+
+ /* In the flow context, do nothing. */
+
+ if (parser->flow_level)
+ return 1;
+
+ /* Loop through the intendation levels in the stack. */
+
+ while (parser->indent > column)
+ {
+ /* Create a token and append it to the queue. */
+
+ TOKEN_INIT(token, YAML_BLOCK_END_TOKEN, parser->mark, parser->mark);
+
+ if (!ENQUEUE(parser, parser->tokens, token))
+ return 0;
+
+ /* Pop the indentation level. */
+
+ parser->indent = POP(parser, parser->indents);
+ }
+
+ return 1;
+}
+
+/*
+ * Initialize the scanner and produce the STREAM-START token.
+ */
+
+static int
+yaml_parser_fetch_stream_start(yaml_parser_t *parser)
+{
+ yaml_simple_key_t simple_key = { 0, 0, 0, { 0, 0, 0 } };
+ yaml_token_t token;
+
+ /* Set the initial indentation. */
+
+ parser->indent = -1;
+
+ /* Initialize the simple key stack. */
+
+ if (!PUSH(parser, parser->simple_keys, simple_key))
+ return 0;
+
+ /* A simple key is allowed at the beginning of the stream. */
+
+ parser->simple_key_allowed = 1;
+
+ /* We have started. */
+
+ parser->stream_start_produced = 1;
+
+ /* Create the STREAM-START token and append it to the queue. */
+
+ STREAM_START_TOKEN_INIT(token, parser->encoding,
+ parser->mark, parser->mark);
+
+ if (!ENQUEUE(parser, parser->tokens, token))
+ return 0;
+
+ return 1;
+}
+
+/*
+ * Produce the STREAM-END token and shut down the scanner.
+ */
+
+static int
+yaml_parser_fetch_stream_end(yaml_parser_t *parser)
+{
+ yaml_token_t token;
+
+ /* Force new line. */
+
+ if (parser->mark.column != 0) {
+ parser->mark.column = 0;
+ parser->mark.line ++;
+ }
+
+ /* Reset the indentation level. */
+
+ if (!yaml_parser_unroll_indent(parser, -1))
+ return 0;
+
+ /* Reset simple keys. */
+
+ if (!yaml_parser_remove_simple_key(parser))
+ return 0;
+
+ parser->simple_key_allowed = 0;
+
+ /* Create the STREAM-END token and append it to the queue. */
+
+ STREAM_END_TOKEN_INIT(token, parser->mark, parser->mark);
+
+ if (!ENQUEUE(parser, parser->tokens, token))
+ return 0;
+
+ return 1;
+}
+
+/*
+ * Produce a VERSION-DIRECTIVE or TAG-DIRECTIVE token.
+ */
+
+static int
+yaml_parser_fetch_directive(yaml_parser_t *parser)
+{
+ yaml_token_t token;
+
+ /* Reset the indentation level. */
+
+ if (!yaml_parser_unroll_indent(parser, -1))
+ return 0;
+
+ /* Reset simple keys. */
+
+ if (!yaml_parser_remove_simple_key(parser))
+ return 0;
+
+ parser->simple_key_allowed = 0;
+
+ /* Create the YAML-DIRECTIVE or TAG-DIRECTIVE token. */
+
+ if (!yaml_parser_scan_directive(parser, &token))
+ return 0;
+
+ /* Append the token to the queue. */
+
+ if (!ENQUEUE(parser, parser->tokens, token)) {
+ yaml_token_delete(&token);
+ return 0;
+ }
+
+ return 1;
+}
+
+/*
+ * Produce the DOCUMENT-START or DOCUMENT-END token.
+ */
+
+static int
+yaml_parser_fetch_document_indicator(yaml_parser_t *parser,
+ yaml_token_type_t type)
+{
+ yaml_mark_t start_mark, end_mark;
+ yaml_token_t token;
+
+ /* Reset the indentation level. */
+
+ if (!yaml_parser_unroll_indent(parser, -1))
+ return 0;
+
+ /* Reset simple keys. */
+
+ if (!yaml_parser_remove_simple_key(parser))
+ return 0;
+
+ parser->simple_key_allowed = 0;
+
+ /* Consume the token. */
+
+ start_mark = parser->mark;
+
+ SKIP(parser);
+ SKIP(parser);
+ SKIP(parser);
+
+ end_mark = parser->mark;
+
+ /* Create the DOCUMENT-START or DOCUMENT-END token. */
+
+ TOKEN_INIT(token, type, start_mark, end_mark);
+
+ /* Append the token to the queue. */
+
+ if (!ENQUEUE(parser, parser->tokens, token))
+ return 0;
+
+ return 1;
+}
+
+/*
+ * Produce the FLOW-SEQUENCE-START or FLOW-MAPPING-START token.
+ */
+
+static int
+yaml_parser_fetch_flow_collection_start(yaml_parser_t *parser,
+ yaml_token_type_t type)
+{
+ yaml_mark_t start_mark, end_mark;
+ yaml_token_t token;
+
+ /* The indicators '[' and '{' may start a simple key. */
+
+ if (!yaml_parser_save_simple_key(parser))
+ return 0;
+
+ /* Increase the flow level. */
+
+ if (!yaml_parser_increase_flow_level(parser))
+ return 0;
+
+ /* A simple key may follow the indicators '[' and '{'. */
+
+ parser->simple_key_allowed = 1;
+
+ /* Consume the token. */
+
+ start_mark = parser->mark;
+ SKIP(parser);
+ end_mark = parser->mark;
+
+ /* Create the FLOW-SEQUENCE-START of FLOW-MAPPING-START token. */
+
+ TOKEN_INIT(token, type, start_mark, end_mark);
+
+ /* Append the token to the queue. */
+
+ if (!ENQUEUE(parser, parser->tokens, token))
+ return 0;
+
+ return 1;
+}
+
+/*
+ * Produce the FLOW-SEQUENCE-END or FLOW-MAPPING-END token.
+ */
+
+static int
+yaml_parser_fetch_flow_collection_end(yaml_parser_t *parser,
+ yaml_token_type_t type)
+{
+ yaml_mark_t start_mark, end_mark;
+ yaml_token_t token;
+
+ /* Reset any potential simple key on the current flow level. */
+
+ if (!yaml_parser_remove_simple_key(parser))
+ return 0;
+
+ /* Decrease the flow level. */
+
+ if (!yaml_parser_decrease_flow_level(parser))
+ return 0;
+
+ /* No simple keys after the indicators ']' and '}'. */
+
+ parser->simple_key_allowed = 0;
+
+ /* Consume the token. */
+
+ start_mark = parser->mark;
+ SKIP(parser);
+ end_mark = parser->mark;
+
+ /* Create the FLOW-SEQUENCE-END of FLOW-MAPPING-END token. */
+
+ TOKEN_INIT(token, type, start_mark, end_mark);
+
+ /* Append the token to the queue. */
+
+ if (!ENQUEUE(parser, parser->tokens, token))
+ return 0;
+
+ return 1;
+}
+
+/*
+ * Produce the FLOW-ENTRY token.
+ */
+
+static int
+yaml_parser_fetch_flow_entry(yaml_parser_t *parser)
+{
+ yaml_mark_t start_mark, end_mark;
+ yaml_token_t token;
+
+ /* Reset any potential simple keys on the current flow level. */
+
+ if (!yaml_parser_remove_simple_key(parser))
+ return 0;
+
+ /* Simple keys are allowed after ','. */
+
+ parser->simple_key_allowed = 1;
+
+ /* Consume the token. */
+
+ start_mark = parser->mark;
+ SKIP(parser);
+ end_mark = parser->mark;
+
+ /* Create the FLOW-ENTRY token and append it to the queue. */
+
+ TOKEN_INIT(token, YAML_FLOW_ENTRY_TOKEN, start_mark, end_mark);
+
+ if (!ENQUEUE(parser, parser->tokens, token))
+ return 0;
+
+ return 1;
+}
+
+/*
+ * Produce the BLOCK-ENTRY token.
+ */
+
+static int
+yaml_parser_fetch_block_entry(yaml_parser_t *parser)
+{
+ yaml_mark_t start_mark, end_mark;
+ yaml_token_t token;
+
+ /* Check if the scanner is in the block context. */
+
+ if (!parser->flow_level)
+ {
+ /* Check if we are allowed to start a new entry. */
+
+ if (!parser->simple_key_allowed) {
+ return yaml_parser_set_scanner_error(parser, NULL, parser->mark,
+ "block sequence entries are not allowed in this context");
+ }
+
+ /* Add the BLOCK-SEQUENCE-START token if needed. */
+
+ if (!yaml_parser_roll_indent(parser, parser->mark.column, -1,
+ YAML_BLOCK_SEQUENCE_START_TOKEN, parser->mark))
+ return 0;
+ }
+ else
+ {
+ /*
+ * It is an error for the '-' indicator to occur in the flow context,
+ * but we let the Parser detect and report about it because the Parser
+ * is able to point to the context.
+ */
+ }
+
+ /* Reset any potential simple keys on the current flow level. */
+
+ if (!yaml_parser_remove_simple_key(parser))
+ return 0;
+
+ /* Simple keys are allowed after '-'. */
+
+ parser->simple_key_allowed = 1;
+
+ /* Consume the token. */
+
+ start_mark = parser->mark;
+ SKIP(parser);
+ end_mark = parser->mark;
+
+ /* Create the BLOCK-ENTRY token and append it to the queue. */
+
+ TOKEN_INIT(token, YAML_BLOCK_ENTRY_TOKEN, start_mark, end_mark);
+
+ if (!ENQUEUE(parser, parser->tokens, token))
+ return 0;
+
+ return 1;
+}
+
+/*
+ * Produce the KEY token.
+ */
+
+static int
+yaml_parser_fetch_key(yaml_parser_t *parser)
+{
+ yaml_mark_t start_mark, end_mark;
+ yaml_token_t token;
+
+ /* In the block context, additional checks are required. */
+
+ if (!parser->flow_level)
+ {
+ /* Check if we are allowed to start a new key (not nessesary simple). */
+
+ if (!parser->simple_key_allowed) {
+ return yaml_parser_set_scanner_error(parser, NULL, parser->mark,
+ "mapping keys are not allowed in this context");
+ }
+
+ /* Add the BLOCK-MAPPING-START token if needed. */
+
+ if (!yaml_parser_roll_indent(parser, parser->mark.column, -1,
+ YAML_BLOCK_MAPPING_START_TOKEN, parser->mark))
+ return 0;
+ }
+
+ /* Reset any potential simple keys on the current flow level. */
+
+ if (!yaml_parser_remove_simple_key(parser))
+ return 0;
+
+ /* Simple keys are allowed after '?' in the block context. */
+
+ parser->simple_key_allowed = (!parser->flow_level);
+
+ /* Consume the token. */
+
+ start_mark = parser->mark;
+ SKIP(parser);
+ end_mark = parser->mark;
+
+ /* Create the KEY token and append it to the queue. */
+
+ TOKEN_INIT(token, YAML_KEY_TOKEN, start_mark, end_mark);
+
+ if (!ENQUEUE(parser, parser->tokens, token))
+ return 0;
+
+ return 1;
+}
+
+/*
+ * Produce the VALUE token.
+ */
+
+static int
+yaml_parser_fetch_value(yaml_parser_t *parser)
+{
+ yaml_mark_t start_mark, end_mark;
+ yaml_token_t token;
+ yaml_simple_key_t *simple_key = parser->simple_keys.top-1;
+
+ /* Have we found a simple key? */
+
+ if (simple_key->possible)
+ {
+
+ /* Create the KEY token and insert it into the queue. */
+
+ TOKEN_INIT(token, YAML_KEY_TOKEN, simple_key->mark, simple_key->mark);
+
+ if (!QUEUE_INSERT(parser, parser->tokens,
+ simple_key->token_number - parser->tokens_parsed, token))
+ return 0;
+
+ /* In the block context, we may need to add the BLOCK-MAPPING-START token. */
+
+ if (!yaml_parser_roll_indent(parser, simple_key->mark.column,
+ simple_key->token_number,
+ YAML_BLOCK_MAPPING_START_TOKEN, simple_key->mark))
+ return 0;
+
+ /* Remove the simple key. */
+
+ simple_key->possible = 0;
+
+ /* A simple key cannot follow another simple key. */
+
+ parser->simple_key_allowed = 0;
+ }
+ else
+ {
+ /* The ':' indicator follows a complex key. */
+
+ /* In the block context, extra checks are required. */
+
+ if (!parser->flow_level)
+ {
+ /* Check if we are allowed to start a complex value. */
+
+ if (!parser->simple_key_allowed) {
+ return yaml_parser_set_scanner_error(parser, NULL, parser->mark,
+ "mapping values are not allowed in this context");
+ }
+
+ /* Add the BLOCK-MAPPING-START token if needed. */
+
+ if (!yaml_parser_roll_indent(parser, parser->mark.column, -1,
+ YAML_BLOCK_MAPPING_START_TOKEN, parser->mark))
+ return 0;
+ }
+
+ /* Simple keys after ':' are allowed in the block context. */
+
+ parser->simple_key_allowed = (!parser->flow_level);
+ }
+
+ /* Consume the token. */
+
+ start_mark = parser->mark;
+ SKIP(parser);
+ end_mark = parser->mark;
+
+ /* Create the VALUE token and append it to the queue. */
+
+ TOKEN_INIT(token, YAML_VALUE_TOKEN, start_mark, end_mark);
+
+ if (!ENQUEUE(parser, parser->tokens, token))
+ return 0;
+
+ return 1;
+}
+
+/*
+ * Produce the ALIAS or ANCHOR token.
+ */
+
+static int
+yaml_parser_fetch_anchor(yaml_parser_t *parser, yaml_token_type_t type)
+{
+ yaml_token_t token;
+
+ /* An anchor or an alias could be a simple key. */
+
+ if (!yaml_parser_save_simple_key(parser))
+ return 0;
+
+ /* A simple key cannot follow an anchor or an alias. */
+
+ parser->simple_key_allowed = 0;
+
+ /* Create the ALIAS or ANCHOR token and append it to the queue. */
+
+ if (!yaml_parser_scan_anchor(parser, &token, type))
+ return 0;
+
+ if (!ENQUEUE(parser, parser->tokens, token)) {
+ yaml_token_delete(&token);
+ return 0;
+ }
+ return 1;
+}
+
+/*
+ * Produce the TAG token.
+ */
+
+static int
+yaml_parser_fetch_tag(yaml_parser_t *parser)
+{
+ yaml_token_t token;
+
+ /* A tag could be a simple key. */
+
+ if (!yaml_parser_save_simple_key(parser))
+ return 0;
+
+ /* A simple key cannot follow a tag. */
+
+ parser->simple_key_allowed = 0;
+
+ /* Create the TAG token and append it to the queue. */
+
+ if (!yaml_parser_scan_tag(parser, &token))
+ return 0;
+
+ if (!ENQUEUE(parser, parser->tokens, token)) {
+ yaml_token_delete(&token);
+ return 0;
+ }
+
+ return 1;
+}
+
+/*
+ * Produce the SCALAR(...,literal) or SCALAR(...,folded) tokens.
+ */
+
+static int
+yaml_parser_fetch_block_scalar(yaml_parser_t *parser, int literal)
+{
+ yaml_token_t token;
+
+ /* Remove any potential simple keys. */
+
+ if (!yaml_parser_remove_simple_key(parser))
+ return 0;
+
+ /* A simple key may follow a block scalar. */
+
+ parser->simple_key_allowed = 1;
+
+ /* Create the SCALAR token and append it to the queue. */
+
+ if (!yaml_parser_scan_block_scalar(parser, &token, literal))
+ return 0;
+
+ if (!ENQUEUE(parser, parser->tokens, token)) {
+ yaml_token_delete(&token);
+ return 0;
+ }
+
+ return 1;
+}
+
+/*
+ * Produce the SCALAR(...,single-quoted) or SCALAR(...,double-quoted) tokens.
+ */
+
+static int
+yaml_parser_fetch_flow_scalar(yaml_parser_t *parser, int single)
+{
+ yaml_token_t token;
+
+ /* A plain scalar could be a simple key. */
+
+ if (!yaml_parser_save_simple_key(parser))
+ return 0;
+
+ /* A simple key cannot follow a flow scalar. */
+
+ parser->simple_key_allowed = 0;
+
+ /* Create the SCALAR token and append it to the queue. */
+
+ if (!yaml_parser_scan_flow_scalar(parser, &token, single))
+ return 0;
+
+ if (!ENQUEUE(parser, parser->tokens, token)) {
+ yaml_token_delete(&token);
+ return 0;
+ }
+
+ return 1;
+}
+
+/*
+ * Produce the SCALAR(...,plain) token.
+ */
+
+static int
+yaml_parser_fetch_plain_scalar(yaml_parser_t *parser)
+{
+ yaml_token_t token;
+
+ /* A plain scalar could be a simple key. */
+
+ if (!yaml_parser_save_simple_key(parser))
+ return 0;
+
+ /* A simple key cannot follow a flow scalar. */
+
+ parser->simple_key_allowed = 0;
+
+ /* Create the SCALAR token and append it to the queue. */
+
+ if (!yaml_parser_scan_plain_scalar(parser, &token))
+ return 0;
+
+ if (!ENQUEUE(parser, parser->tokens, token)) {
+ yaml_token_delete(&token);
+ return 0;
+ }
+
+ return 1;
+}
+
+/*
+ * Eat whitespaces and comments until the next token is found.
+ */
+
+static int
+yaml_parser_scan_to_next_token(yaml_parser_t *parser)
+{
+ /* Until the next token is not found. */
+
+ while (1)
+ {
+ /* Allow the BOM mark to start a line. */
+
+ if (!CACHE(parser, 1)) return 0;
+
+ if (parser->mark.column == 0 && IS_BOM(parser->buffer))
+ SKIP(parser);
+
+ /*
+ * Eat whitespaces.
+ *
+ * Tabs are allowed:
+ *
+ * - in the flow context;
+ * - in the block context, but not at the beginning of the line or
+ * after '-', '?', or ':' (complex value).
+ */
+
+ if (!CACHE(parser, 1)) return 0;
+
+ while (CHECK(parser->buffer,' ') ||
+ ((parser->flow_level || !parser->simple_key_allowed) &&
+ CHECK(parser->buffer, '\t'))) {
+ SKIP(parser);
+ if (!CACHE(parser, 1)) return 0;
+ }
+
+ /* Eat a comment until a line break. */
+
+ if (CHECK(parser->buffer, '#')) {
+ while (!IS_BREAKZ(parser->buffer)) {
+ SKIP(parser);
+ if (!CACHE(parser, 1)) return 0;
+ }
+ }
+
+ /* If it is a line break, eat it. */
+
+ if (IS_BREAK(parser->buffer))
+ {
+ if (!CACHE(parser, 2)) return 0;
+ SKIP_LINE(parser);
+
+ /* In the block context, a new line may start a simple key. */
+
+ if (!parser->flow_level) {
+ parser->simple_key_allowed = 1;
+ }
+ }
+ else
+ {
+ /* We have found a token. */
+
+ break;
+ }
+ }
+
+ return 1;
+}
+
+/*
+ * Scan a YAML-DIRECTIVE or TAG-DIRECTIVE token.
+ *
+ * Scope:
+ * %YAML 1.1 # a comment \n
+ * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ * %TAG !yaml! tag:yaml.org,2002: \n
+ * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ */
+
+int
+yaml_parser_scan_directive(yaml_parser_t *parser, yaml_token_t *token)
+{
+ yaml_mark_t start_mark, end_mark;
+ yaml_char_t *name = NULL;
+ int major, minor;
+ yaml_char_t *handle = NULL, *prefix = NULL;
+
+ /* Eat '%'. */
+
+ start_mark = parser->mark;
+
+ SKIP(parser);
+
+ /* Scan the directive name. */
+
+ if (!yaml_parser_scan_directive_name(parser, start_mark, &name))
+ goto error;
+
+ /* Is it a YAML directive? */
+
+ if (strcmp((char *)name, "YAML") == 0)
+ {
+ /* Scan the VERSION directive value. */
+
+ if (!yaml_parser_scan_version_directive_value(parser, start_mark,
+ &major, &minor))
+ goto error;
+
+ end_mark = parser->mark;
+
+ /* Create a VERSION-DIRECTIVE token. */
+
+ VERSION_DIRECTIVE_TOKEN_INIT(*token, major, minor,
+ start_mark, end_mark);
+ }
+
+ /* Is it a TAG directive? */
+
+ else if (strcmp((char *)name, "TAG") == 0)
+ {
+ /* Scan the TAG directive value. */
+
+ if (!yaml_parser_scan_tag_directive_value(parser, start_mark,
+ &handle, &prefix))
+ goto error;
+
+ end_mark = parser->mark;
+
+ /* Create a TAG-DIRECTIVE token. */
+
+ TAG_DIRECTIVE_TOKEN_INIT(*token, handle, prefix,
+ start_mark, end_mark);
+ }
+
+ /* Unknown directive. */
+
+ else
+ {
+ yaml_parser_set_scanner_error(parser, "while scanning a directive",
+ start_mark, "found uknown directive name");
+ goto error;
+ }
+
+ /* Eat the rest of the line including any comments. */
+
+ if (!CACHE(parser, 1)) goto error;
+
+ while (IS_BLANK(parser->buffer)) {
+ SKIP(parser);
+ if (!CACHE(parser, 1)) goto error;
+ }
+
+ if (CHECK(parser->buffer, '#')) {
+ while (!IS_BREAKZ(parser->buffer)) {
+ SKIP(parser);
+ if (!CACHE(parser, 1)) goto error;
+ }
+ }
+
+ /* Check if we are at the end of the line. */
+
+ if (!IS_BREAKZ(parser->buffer)) {
+ yaml_parser_set_scanner_error(parser, "while scanning a directive",
+ start_mark, "did not find expected comment or line break");
+ goto error;
+ }
+
+ /* Eat a line break. */
+
+ if (IS_BREAK(parser->buffer)) {
+ if (!CACHE(parser, 2)) goto error;
+ SKIP_LINE(parser);
+ }
+
+ yaml_free(name);
+
+ return 1;
+
+error:
+ yaml_free(prefix);
+ yaml_free(handle);
+ yaml_free(name);
+ return 0;
+}
+
+/*
+ * Scan the directive name.
+ *
+ * Scope:
+ * %YAML 1.1 # a comment \n
+ * ^^^^
+ * %TAG !yaml! tag:yaml.org,2002: \n
+ * ^^^
+ */
+
+static int
+yaml_parser_scan_directive_name(yaml_parser_t *parser,
+ yaml_mark_t start_mark, yaml_char_t **name)
+{
+ yaml_string_t string = NULL_STRING;
+
+ if (!STRING_INIT(parser, string, INITIAL_STRING_SIZE)) goto error;
+
+ /* Consume the directive name. */
+
+ if (!CACHE(parser, 1)) goto error;
+
+ while (IS_ALPHA(parser->buffer))
+ {
+ if (!READ(parser, string)) goto error;
+ if (!CACHE(parser, 1)) goto error;
+ }
+
+ /* Check if the name is empty. */
+
+ if (string.start == string.pointer) {
+ yaml_parser_set_scanner_error(parser, "while scanning a directive",
+ start_mark, "could not find expected directive name");
+ goto error;
+ }
+
+ /* Check for an blank character after the name. */
+
+ if (!IS_BLANKZ(parser->buffer)) {
+ yaml_parser_set_scanner_error(parser, "while scanning a directive",
+ start_mark, "found unexpected non-alphabetical character");
+ goto error;
+ }
+
+ *name = string.start;
+
+ return 1;
+
+error:
+ STRING_DEL(parser, string);
+ return 0;
+}
+
+/*
+ * Scan the value of VERSION-DIRECTIVE.
+ *
+ * Scope:
+ * %YAML 1.1 # a comment \n
+ * ^^^^^^
+ */
+
+static int
+yaml_parser_scan_version_directive_value(yaml_parser_t *parser,
+ yaml_mark_t start_mark, int *major, int *minor)
+{
+ /* Eat whitespaces. */
+
+ if (!CACHE(parser, 1)) return 0;
+
+ while (IS_BLANK(parser->buffer)) {
+ SKIP(parser);
+ if (!CACHE(parser, 1)) return 0;
+ }
+
+ /* Consume the major version number. */
+
+ if (!yaml_parser_scan_version_directive_number(parser, start_mark, major))
+ return 0;
+
+ /* Eat '.'. */
+
+ if (!CHECK(parser->buffer, '.')) {
+ return yaml_parser_set_scanner_error(parser, "while scanning a %YAML directive",
+ start_mark, "did not find expected digit or '.' character");
+ }
+
+ SKIP(parser);
+
+ /* Consume the minor version number. */
+
+ if (!yaml_parser_scan_version_directive_number(parser, start_mark, minor))
+ return 0;
+
+ return 1;
+}
+
+#define MAX_NUMBER_LENGTH 9
+
+/*
+ * Scan the version number of VERSION-DIRECTIVE.
+ *
+ * Scope:
+ * %YAML 1.1 # a comment \n
+ * ^
+ * %YAML 1.1 # a comment \n
+ * ^
+ */
+
+static int
+yaml_parser_scan_version_directive_number(yaml_parser_t *parser,
+ yaml_mark_t start_mark, int *number)
+{
+ int value = 0;
+ size_t length = 0;
+
+ /* Repeat while the next character is digit. */
+
+ if (!CACHE(parser, 1)) return 0;
+
+ while (IS_DIGIT(parser->buffer))
+ {
+ /* Check if the number is too long. */
+
+ if (++length > MAX_NUMBER_LENGTH) {
+ return yaml_parser_set_scanner_error(parser, "while scanning a %YAML directive",
+ start_mark, "found extremely long version number");
+ }
+
+ value = value*10 + AS_DIGIT(parser->buffer);
+
+ SKIP(parser);
+
+ if (!CACHE(parser, 1)) return 0;
+ }
+
+ /* Check if the number was present. */
+
+ if (!length) {
+ return yaml_parser_set_scanner_error(parser, "while scanning a %YAML directive",
+ start_mark, "did not find expected version number");
+ }
+
+ *number = value;
+
+ return 1;
+}
+
+/*
+ * Scan the value of a TAG-DIRECTIVE token.
+ *
+ * Scope:
+ * %TAG !yaml! tag:yaml.org,2002: \n
+ * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ */
+
+static int
+yaml_parser_scan_tag_directive_value(yaml_parser_t *parser,
+ yaml_mark_t start_mark, yaml_char_t **handle, yaml_char_t **prefix)
+{
+ yaml_char_t *handle_value = NULL;
+ yaml_char_t *prefix_value = NULL;
+
+ /* Eat whitespaces. */
+
+ if (!CACHE(parser, 1)) goto error;
+
+ while (IS_BLANK(parser->buffer)) {
+ SKIP(parser);
+ if (!CACHE(parser, 1)) goto error;
+ }
+
+ /* Scan a handle. */
+
+ if (!yaml_parser_scan_tag_handle(parser, 1, start_mark, &handle_value))
+ goto error;
+
+ /* Expect a whitespace. */
+
+ if (!CACHE(parser, 1)) goto error;
+
+ if (!IS_BLANK(parser->buffer)) {
+ yaml_parser_set_scanner_error(parser, "while scanning a %TAG directive",
+ start_mark, "did not find expected whitespace");
+ goto error;
+ }
+
+ /* Eat whitespaces. */
+
+ while (IS_BLANK(parser->buffer)) {
+ SKIP(parser);
+ if (!CACHE(parser, 1)) goto error;
+ }
+
+ /* Scan a prefix. */
+
+ if (!yaml_parser_scan_tag_uri(parser, 1, NULL, start_mark, &prefix_value))
+ goto error;
+
+ /* Expect a whitespace or line break. */
+
+ if (!CACHE(parser, 1)) goto error;
+
+ if (!IS_BLANKZ(parser->buffer)) {
+ yaml_parser_set_scanner_error(parser, "while scanning a %TAG directive",
+ start_mark, "did not find expected whitespace or line break");
+ goto error;
+ }
+
+ *handle = handle_value;
+ *prefix = prefix_value;
+
+ return 1;
+
+error:
+ yaml_free(handle_value);
+ yaml_free(prefix_value);
+ return 0;
+}
+
+static int
+yaml_parser_scan_anchor(yaml_parser_t *parser, yaml_token_t *token,
+ yaml_token_type_t type)
+{
+ int length = 0;
+ yaml_mark_t start_mark, end_mark;
+ yaml_string_t string = NULL_STRING;
+
+ if (!STRING_INIT(parser, string, INITIAL_STRING_SIZE)) goto error;
+
+ /* Eat the indicator character. */
+
+ start_mark = parser->mark;
+
+ SKIP(parser);
+
+ /* Consume the value. */
+
+ if (!CACHE(parser, 1)) goto error;
+
+ while (IS_ALPHA(parser->buffer)) {
+ if (!READ(parser, string)) goto error;
+ if (!CACHE(parser, 1)) goto error;
+ length ++;
+ }
+
+ end_mark = parser->mark;
+
+ /*
+ * Check if length of the anchor is greater than 0 and it is followed by
+ * a whitespace character or one of the indicators:
+ *
+ * '?', ':', ',', ']', '}', '%', '@', '`'.
+ */
+
+ if (!length || !(IS_BLANKZ(parser->buffer) || CHECK(parser->buffer, '?')
+ || CHECK(parser->buffer, ':') || CHECK(parser->buffer, ',')
+ || CHECK(parser->buffer, ']') || CHECK(parser->buffer, '}')
+ || CHECK(parser->buffer, '%') || CHECK(parser->buffer, '@')
+ || CHECK(parser->buffer, '`'))) {
+ yaml_parser_set_scanner_error(parser, type == YAML_ANCHOR_TOKEN ?
+ "while scanning an anchor" : "while scanning an alias", start_mark,
+ "did not find expected alphabetic or numeric character");
+ goto error;
+ }
+
+ /* Create a token. */
+
+ if (type == YAML_ANCHOR_TOKEN) {
+ ANCHOR_TOKEN_INIT(*token, string.start, start_mark, end_mark);
+ }
+ else {
+ ALIAS_TOKEN_INIT(*token, string.start, start_mark, end_mark);
+ }
+
+ return 1;
+
+error:
+ STRING_DEL(parser, string);
+ return 0;
+}
+
+/*
+ * Scan a TAG token.
+ */
+
+static int
+yaml_parser_scan_tag(yaml_parser_t *parser, yaml_token_t *token)
+{
+ yaml_char_t *handle = NULL;
+ yaml_char_t *suffix = NULL;
+ yaml_mark_t start_mark, end_mark;
+
+ start_mark = parser->mark;
+
+ /* Check if the tag is in the canonical form. */
+
+ if (!CACHE(parser, 2)) goto error;
+
+ if (CHECK_AT(parser->buffer, '<', 1))
+ {
+ /* Set the handle to '' */
+
+ handle = yaml_malloc(1);
+ if (!handle) goto error;
+ handle[0] = '\0';
+
+ /* Eat '!<' */
+
+ SKIP(parser);
+ SKIP(parser);
+
+ /* Consume the tag value. */
+
+ if (!yaml_parser_scan_tag_uri(parser, 0, NULL, start_mark, &suffix))
+ goto error;
+
+ /* Check for '>' and eat it. */
+
+ if (!CHECK(parser->buffer, '>')) {
+ yaml_parser_set_scanner_error(parser, "while scanning a tag",
+ start_mark, "did not find the expected '>'");
+ goto error;
+ }
+
+ SKIP(parser);
+ }
+ else
+ {
+ /* The tag has either the '!suffix' or the '!handle!suffix' form. */
+
+ /* First, try to scan a handle. */
+
+ if (!yaml_parser_scan_tag_handle(parser, 0, start_mark, &handle))
+ goto error;
+
+ /* Check if it is, indeed, handle. */
+
+ if (handle[0] == '!' && handle[1] != '\0' && handle[strlen((char *)handle)-1] == '!')
+ {
+ /* Scan the suffix now. */
+
+ if (!yaml_parser_scan_tag_uri(parser, 0, NULL, start_mark, &suffix))
+ goto error;
+ }
+ else
+ {
+ /* It wasn't a handle after all. Scan the rest of the tag. */
+
+ if (!yaml_parser_scan_tag_uri(parser, 0, handle, start_mark, &suffix))
+ goto error;
+
+ /* Set the handle to '!'. */
+
+ yaml_free(handle);
+ handle = yaml_malloc(2);
+ if (!handle) goto error;
+ handle[0] = '!';
+ handle[1] = '\0';
+
+ /*
+ * A special case: the '!' tag. Set the handle to '' and the
+ * suffix to '!'.
+ */
+
+ if (suffix[0] == '\0') {
+ yaml_char_t *tmp = handle;
+ handle = suffix;
+ suffix = tmp;
+ }
+ }
+ }
+
+ /* Check the character which ends the tag. */
+
+ if (!CACHE(parser, 1)) goto error;
+
+ if (!IS_BLANKZ(parser->buffer)) {
+ yaml_parser_set_scanner_error(parser, "while scanning a tag",
+ start_mark, "did not find expected whitespace or line break");
+ goto error;
+ }
+
+ end_mark = parser->mark;
+
+ /* Create a token. */
+
+ TAG_TOKEN_INIT(*token, handle, suffix, start_mark, end_mark);
+
+ return 1;
+
+error:
+ yaml_free(handle);
+ yaml_free(suffix);
+ return 0;
+}
+
+/*
+ * Scan a tag handle.
+ */
+
+static int
+yaml_parser_scan_tag_handle(yaml_parser_t *parser, int directive,
+ yaml_mark_t start_mark, yaml_char_t **handle)
+{
+ yaml_string_t string = NULL_STRING;
+
+ if (!STRING_INIT(parser, string, INITIAL_STRING_SIZE)) goto error;
+
+ /* Check the initial '!' character. */
+
+ if (!CACHE(parser, 1)) goto error;
+
+ if (!CHECK(parser->buffer, '!')) {
+ yaml_parser_set_scanner_error(parser, directive ?
+ "while scanning a tag directive" : "while scanning a tag",
+ start_mark, "did not find expected '!'");
+ goto error;
+ }
+
+ /* Copy the '!' character. */
+
+ if (!READ(parser, string)) goto error;
+
+ /* Copy all subsequent alphabetical and numerical characters. */
+
+ if (!CACHE(parser, 1)) goto error;
+
+ while (IS_ALPHA(parser->buffer))
+ {
+ if (!READ(parser, string)) goto error;
+ if (!CACHE(parser, 1)) goto error;
+ }
+
+ /* Check if the trailing character is '!' and copy it. */
+
+ if (CHECK(parser->buffer, '!'))
+ {
+ if (!READ(parser, string)) goto error;
+ }
+ else
+ {
+ /*
+ * It's either the '!' tag or not really a tag handle. If it's a %TAG
+ * directive, it's an error. If it's a tag token, it must be a part of
+ * URI.
+ */
+
+ if (directive && !(string.start[0] == '!' && string.start[1] == '\0')) {
+ yaml_parser_set_scanner_error(parser, "while parsing a tag directive",
+ start_mark, "did not find expected '!'");
+ goto error;
+ }
+ }
+
+ *handle = string.start;
+
+ return 1;
+
+error:
+ STRING_DEL(parser, string);
+ return 0;
+}
+
+/*
+ * Scan a tag.
+ */
+
+static int
+yaml_parser_scan_tag_uri(yaml_parser_t *parser, int directive,
+ yaml_char_t *head, yaml_mark_t start_mark, yaml_char_t **uri)
+{
+ size_t length = head ? strlen((char *)head) : 0;
+ yaml_string_t string = NULL_STRING;
+
+ if (!STRING_INIT(parser, string, INITIAL_STRING_SIZE)) goto error;
+
+ /* Resize the string to include the head. */
+
+ while (string.end - string.start <= (int)length) {
+ if (!yaml_string_extend(&string.start, &string.pointer, &string.end)) {
+ parser->error = YAML_MEMORY_ERROR;
+ goto error;
+ }
+ }
+
+ /*
+ * Copy the head if needed.
+ *
+ * Note that we don't copy the leading '!' character.
+ */
+
+ if (length > 1) {
+ memcpy(string.start, head+1, length-1);
+ string.pointer += length-1;
+ }
+
+ /* Scan the tag. */
+
+ if (!CACHE(parser, 1)) goto error;
+
+ /*
+ * The set of characters that may appear in URI is as follows:
+ *
+ * '0'-'9', 'A'-'Z', 'a'-'z', '_', '-', ';', '/', '?', ':', '@', '&',
+ * '=', '+', '$', ',', '.', '!', '~', '*', '\'', '(', ')', '[', ']',
+ * '%'.
+ */
+
+ while (IS_ALPHA(parser->buffer) || CHECK(parser->buffer, ';')
+ || CHECK(parser->buffer, '/') || CHECK(parser->buffer, '?')
+ || CHECK(parser->buffer, ':') || CHECK(parser->buffer, '@')
+ || CHECK(parser->buffer, '&') || CHECK(parser->buffer, '=')
+ || CHECK(parser->buffer, '+') || CHECK(parser->buffer, '$')
+ || CHECK(parser->buffer, ',') || CHECK(parser->buffer, '.')
+ || CHECK(parser->buffer, '!') || CHECK(parser->buffer, '~')
+ || CHECK(parser->buffer, '*') || CHECK(parser->buffer, '\'')
+ || CHECK(parser->buffer, '(') || CHECK(parser->buffer, ')')
+ || CHECK(parser->buffer, '[') || CHECK(parser->buffer, ']')
+ || CHECK(parser->buffer, '%'))
+ {
+ /* Check if it is a URI-escape sequence. */
+
+ if (CHECK(parser->buffer, '%')) {
+ if (!yaml_parser_scan_uri_escapes(parser,
+ directive, start_mark, &string)) goto error;
+ }
+ else {
+ if (!READ(parser, string)) goto error;
+ }
+
+ length ++;
+ if (!CACHE(parser, 1)) goto error;
+ }
+
+ /* Check if the tag is non-empty. */
+
+ if (!length) {
+ if (!STRING_EXTEND(parser, string))
+ goto error;
+
+ yaml_parser_set_scanner_error(parser, directive ?
+ "while parsing a %TAG directive" : "while parsing a tag",
+ start_mark, "did not find expected tag URI");
+ goto error;
+ }
+
+ *uri = string.start;
+
+ return 1;
+
+error:
+ STRING_DEL(parser, string);
+ return 0;
+}
+
+/*
+ * Decode an URI-escape sequence corresponding to a single UTF-8 character.
+ */
+
+static int
+yaml_parser_scan_uri_escapes(yaml_parser_t *parser, int directive,
+ yaml_mark_t start_mark, yaml_string_t *string)
+{
+ int width = 0;
+
+ /* Decode the required number of characters. */
+
+ do {
+
+ unsigned char octet = 0;
+
+ /* Check for a URI-escaped octet. */
+
+ if (!CACHE(parser, 3)) return 0;
+
+ if (!(CHECK(parser->buffer, '%')
+ && IS_HEX_AT(parser->buffer, 1)
+ && IS_HEX_AT(parser->buffer, 2))) {
+ return yaml_parser_set_scanner_error(parser, directive ?
+ "while parsing a %TAG directive" : "while parsing a tag",
+ start_mark, "did not find URI escaped octet");
+ }
+
+ /* Get the octet. */
+
+ octet = (AS_HEX_AT(parser->buffer, 1) << 4) + AS_HEX_AT(parser->buffer, 2);
+
+ /* If it is the leading octet, determine the length of the UTF-8 sequence. */
+
+ if (!width)
+ {
+ width = (octet & 0x80) == 0x00 ? 1 :
+ (octet & 0xE0) == 0xC0 ? 2 :
+ (octet & 0xF0) == 0xE0 ? 3 :
+ (octet & 0xF8) == 0xF0 ? 4 : 0;
+ if (!width) {
+ return yaml_parser_set_scanner_error(parser, directive ?
+ "while parsing a %TAG directive" : "while parsing a tag",
+ start_mark, "found an incorrect leading UTF-8 octet");
+ }
+ }
+ else
+ {
+ /* Check if the trailing octet is correct. */
+
+ if ((octet & 0xC0) != 0x80) {
+ return yaml_parser_set_scanner_error(parser, directive ?
+ "while parsing a %TAG directive" : "while parsing a tag",
+ start_mark, "found an incorrect trailing UTF-8 octet");
+ }
+ }
+
+ /* Copy the octet and move the pointers. */
+
+ *(string->pointer++) = octet;
+ SKIP(parser);
+ SKIP(parser);
+ SKIP(parser);
+
+ } while (--width);
+
+ return 1;
+}
+
+/*
+ * Scan a block scalar.
+ */
+
+static int
+yaml_parser_scan_block_scalar(yaml_parser_t *parser, yaml_token_t *token,
+ int literal)
+{
+ yaml_mark_t start_mark;
+ yaml_mark_t end_mark;
+ yaml_string_t string = NULL_STRING;
+ yaml_string_t leading_break = NULL_STRING;
+ yaml_string_t trailing_breaks = NULL_STRING;
+ int chomping = 0;
+ int increment = 0;
+ int indent = 0;
+ int leading_blank = 0;
+ int trailing_blank = 0;
+
+ if (!STRING_INIT(parser, string, INITIAL_STRING_SIZE)) goto error;
+ if (!STRING_INIT(parser, leading_break, INITIAL_STRING_SIZE)) goto error;
+ if (!STRING_INIT(parser, trailing_breaks, INITIAL_STRING_SIZE)) goto error;
+
+ /* Eat the indicator '|' or '>'. */
+
+ start_mark = parser->mark;
+
+ SKIP(parser);
+
+ /* Scan the additional block scalar indicators. */
+
+ if (!CACHE(parser, 1)) goto error;
+
+ /* Check for a chomping indicator. */
+
+ if (CHECK(parser->buffer, '+') || CHECK(parser->buffer, '-'))
+ {
+ /* Set the chomping method and eat the indicator. */
+
+ chomping = CHECK(parser->buffer, '+') ? +1 : -1;
+
+ SKIP(parser);
+
+ /* Check for an indentation indicator. */
+
+ if (!CACHE(parser, 1)) goto error;
+
+ if (IS_DIGIT(parser->buffer))
+ {
+ /* Check that the intendation is greater than 0. */
+
+ if (CHECK(parser->buffer, '0')) {
+ yaml_parser_set_scanner_error(parser, "while scanning a block scalar",
+ start_mark, "found an intendation indicator equal to 0");
+ goto error;
+ }
+
+ /* Get the intendation level and eat the indicator. */
+
+ increment = AS_DIGIT(parser->buffer);
+
+ SKIP(parser);
+ }
+ }
+
+ /* Do the same as above, but in the opposite order. */
+
+ else if (IS_DIGIT(parser->buffer))
+ {
+ if (CHECK(parser->buffer, '0')) {
+ yaml_parser_set_scanner_error(parser, "while scanning a block scalar",
+ start_mark, "found an intendation indicator equal to 0");
+ goto error;
+ }
+
+ increment = AS_DIGIT(parser->buffer);
+
+ SKIP(parser);
+
+ if (!CACHE(parser, 1)) goto error;
+
+ if (CHECK(parser->buffer, '+') || CHECK(parser->buffer, '-')) {
+ chomping = CHECK(parser->buffer, '+') ? +1 : -1;
+
+ SKIP(parser);
+ }
+ }
+
+ /* Eat whitespaces and comments to the end of the line. */
+
+ if (!CACHE(parser, 1)) goto error;
+
+ while (IS_BLANK(parser->buffer)) {
+ SKIP(parser);
+ if (!CACHE(parser, 1)) goto error;
+ }
+
+ if (CHECK(parser->buffer, '#')) {
+ while (!IS_BREAKZ(parser->buffer)) {
+ SKIP(parser);
+ if (!CACHE(parser, 1)) goto error;
+ }
+ }
+
+ /* Check if we are at the end of the line. */
+
+ if (!IS_BREAKZ(parser->buffer)) {
+ yaml_parser_set_scanner_error(parser, "while scanning a block scalar",
+ start_mark, "did not find expected comment or line break");
+ goto error;
+ }
+
+ /* Eat a line break. */
+
+ if (IS_BREAK(parser->buffer)) {
+ if (!CACHE(parser, 2)) goto error;
+ SKIP_LINE(parser);
+ }
+
+ end_mark = parser->mark;
+
+ /* Set the intendation level if it was specified. */
+
+ if (increment) {
+ indent = parser->indent >= 0 ? parser->indent+increment : increment;
+ }
+
+ /* Scan the leading line breaks and determine the indentation level if needed. */
+
+ if (!yaml_parser_scan_block_scalar_breaks(parser, &indent, &trailing_breaks,
+ start_mark, &end_mark)) goto error;
+
+ /* Scan the block scalar content. */
+
+ if (!CACHE(parser, 1)) goto error;
+
+ while ((int)parser->mark.column == indent && !IS_Z(parser->buffer))
+ {
+ /*
+ * We are at the beginning of a non-empty line.
+ */
+
+ /* Is it a trailing whitespace? */
+
+ trailing_blank = IS_BLANK(parser->buffer);
+
+ /* Check if we need to fold the leading line break. */
+
+ if (!literal && (*leading_break.start == '\n')
+ && !leading_blank && !trailing_blank)
+ {
+ /* Do we need to join the lines by space? */
+
+ if (*trailing_breaks.start == '\0') {
+ if (!STRING_EXTEND(parser, string)) goto error;
+ *(string.pointer ++) = ' ';
+ }
+
+ CLEAR(parser, leading_break);
+ }
+ else {
+ if (!JOIN(parser, string, leading_break)) goto error;
+ CLEAR(parser, leading_break);
+ }
+
+ /* Append the remaining line breaks. */
+
+ if (!JOIN(parser, string, trailing_breaks)) goto error;
+ CLEAR(parser, trailing_breaks);
+
+ /* Is it a leading whitespace? */
+
+ leading_blank = IS_BLANK(parser->buffer);
+
+ /* Consume the current line. */
+
+ while (!IS_BREAKZ(parser->buffer)) {
+ if (!READ(parser, string)) goto error;
+ if (!CACHE(parser, 1)) goto error;
+ }
+
+ /* Consume the line break. */
+
+ if (!CACHE(parser, 2)) goto error;
+
+ if (!READ_LINE(parser, leading_break)) goto error;
+
+ /* Eat the following intendation spaces and line breaks. */
+
+ if (!yaml_parser_scan_block_scalar_breaks(parser,
+ &indent, &trailing_breaks, start_mark, &end_mark)) goto error;
+ }
+
+ /* Chomp the tail. */
+
+ if (chomping != -1) {
+ if (!JOIN(parser, string, leading_break)) goto error;
+ }
+ if (chomping == 1) {
+ if (!JOIN(parser, string, trailing_breaks)) goto error;
+ }
+
+ /* Create a token. */
+
+ SCALAR_TOKEN_INIT(*token, string.start, string.pointer-string.start,
+ literal ? YAML_LITERAL_SCALAR_STYLE : YAML_FOLDED_SCALAR_STYLE,
+ start_mark, end_mark);
+
+ STRING_DEL(parser, leading_break);
+ STRING_DEL(parser, trailing_breaks);
+
+ return 1;
+
+error:
+ STRING_DEL(parser, string);
+ STRING_DEL(parser, leading_break);
+ STRING_DEL(parser, trailing_breaks);
+
+ return 0;
+}
+
+/*
+ * Scan intendation spaces and line breaks for a block scalar. Determine the
+ * intendation level if needed.
+ */
+
+static int
+yaml_parser_scan_block_scalar_breaks(yaml_parser_t *parser,
+ int *indent, yaml_string_t *breaks,
+ yaml_mark_t start_mark, yaml_mark_t *end_mark)
+{
+ int max_indent = 0;
+
+ *end_mark = parser->mark;
+
+ /* Eat the intendation spaces and line breaks. */
+
+ while (1)
+ {
+ /* Eat the intendation spaces. */
+
+ if (!CACHE(parser, 1)) return 0;
+
+ while ((!*indent || (int)parser->mark.column < *indent)
+ && IS_SPACE(parser->buffer)) {
+ SKIP(parser);
+ if (!CACHE(parser, 1)) return 0;
+ }
+
+ if ((int)parser->mark.column > max_indent)
+ max_indent = (int)parser->mark.column;
+
+ /* Check for a tab character messing the intendation. */
+
+ if ((!*indent || (int)parser->mark.column < *indent)
+ && IS_TAB(parser->buffer)) {
+ return yaml_parser_set_scanner_error(parser, "while scanning a block scalar",
+ start_mark, "found a tab character where an intendation space is expected");
+ }
+
+ /* Have we found a non-empty line? */
+
+ if (!IS_BREAK(parser->buffer)) break;
+
+ /* Consume the line break. */
+
+ if (!CACHE(parser, 2)) return 0;
+ if (!READ_LINE(parser, *breaks)) return 0;
+ *end_mark = parser->mark;
+ }
+
+ /* Determine the indentation level if needed. */
+
+ if (!*indent) {
+ *indent = max_indent;
+ if (*indent < parser->indent + 1)
+ *indent = parser->indent + 1;
+ if (*indent < 1)
+ *indent = 1;
+ }
+
+ return 1;
+}
+
+/*
+ * Scan a quoted scalar.
+ */
+
+static int
+yaml_parser_scan_flow_scalar(yaml_parser_t *parser, yaml_token_t *token,
+ int single)
+{
+ yaml_mark_t start_mark;
+ yaml_mark_t end_mark;
+ yaml_string_t string = NULL_STRING;
+ yaml_string_t leading_break = NULL_STRING;
+ yaml_string_t trailing_breaks = NULL_STRING;
+ yaml_string_t whitespaces = NULL_STRING;
+ int leading_blanks;
+
+ if (!STRING_INIT(parser, string, INITIAL_STRING_SIZE)) goto error;
+ if (!STRING_INIT(parser, leading_break, INITIAL_STRING_SIZE)) goto error;
+ if (!STRING_INIT(parser, trailing_breaks, INITIAL_STRING_SIZE)) goto error;
+ if (!STRING_INIT(parser, whitespaces, INITIAL_STRING_SIZE)) goto error;
+
+ /* Eat the left quote. */
+
+ start_mark = parser->mark;
+
+ SKIP(parser);
+
+ /* Consume the content of the quoted scalar. */
+
+ while (1)
+ {
+ /* Check that there are no document indicators at the beginning of the line. */
+
+ if (!CACHE(parser, 4)) goto error;
+
+ if (parser->mark.column == 0 &&
+ ((CHECK_AT(parser->buffer, '-', 0) &&
+ CHECK_AT(parser->buffer, '-', 1) &&
+ CHECK_AT(parser->buffer, '-', 2)) ||
+ (CHECK_AT(parser->buffer, '.', 0) &&
+ CHECK_AT(parser->buffer, '.', 1) &&
+ CHECK_AT(parser->buffer, '.', 2))) &&
+ IS_BLANKZ_AT(parser->buffer, 3))
+ {
+ yaml_parser_set_scanner_error(parser, "while scanning a quoted scalar",
+ start_mark, "found unexpected document indicator");
+ goto error;
+ }
+
+ /* Check for EOF. */
+
+ if (IS_Z(parser->buffer)) {
+ yaml_parser_set_scanner_error(parser, "while scanning a quoted scalar",
+ start_mark, "found unexpected end of stream");
+ goto error;
+ }
+
+ /* Consume non-blank characters. */
+
+ if (!CACHE(parser, 2)) goto error;
+
+ leading_blanks = 0;
+
+ while (!IS_BLANKZ(parser->buffer))
+ {
+ /* Check for an escaped single quote. */
+
+ if (single && CHECK_AT(parser->buffer, '\'', 0)
+ && CHECK_AT(parser->buffer, '\'', 1))
+ {
+ if (!STRING_EXTEND(parser, string)) goto error;
+ *(string.pointer++) = '\'';
+ SKIP(parser);
+ SKIP(parser);
+ }
+
+ /* Check for the right quote. */
+
+ else if (CHECK(parser->buffer, single ? '\'' : '"'))
+ {
+ break;
+ }
+
+ /* Check for an escaped line break. */
+
+ else if (!single && CHECK(parser->buffer, '\\')
+ && IS_BREAK_AT(parser->buffer, 1))
+ {
+ if (!CACHE(parser, 3)) goto error;
+ SKIP(parser);
+ SKIP_LINE(parser);
+ leading_blanks = 1;
+ break;
+ }
+
+ /* Check for an escape sequence. */
+
+ else if (!single && CHECK(parser->buffer, '\\'))
+ {
+ size_t code_length = 0;
+
+ if (!STRING_EXTEND(parser, string)) goto error;
+
+ /* Check the escape character. */
+
+ switch (parser->buffer.pointer[1])
+ {
+ case '0':
+ *(string.pointer++) = '\0';
+ break;
+
+ case 'a':
+ *(string.pointer++) = '\x07';
+ break;
+
+ case 'b':
+ *(string.pointer++) = '\x08';
+ break;
+
+ case 't':
+ case '\t':
+ *(string.pointer++) = '\x09';
+ break;
+
+ case 'n':
+ *(string.pointer++) = '\x0A';
+ break;
+
+ case 'v':
+ *(string.pointer++) = '\x0B';
+ break;
+
+ case 'f':
+ *(string.pointer++) = '\x0C';
+ break;
+
+ case 'r':
+ *(string.pointer++) = '\x0D';
+ break;
+
+ case 'e':
+ *(string.pointer++) = '\x1B';
+ break;
+
+ case ' ':
+ *(string.pointer++) = '\x20';
+ break;
+
+ case '"':
+ *(string.pointer++) = '"';
+ break;
+
+ case '\'':
+ *(string.pointer++) = '\'';
+ break;
+
+ case '\\':
+ *(string.pointer++) = '\\';
+ break;
+
+ case 'N': /* NEL (#x85) */
+ *(string.pointer++) = '\xC2';
+ *(string.pointer++) = '\x85';
+ break;
+
+ case '_': /* #xA0 */
+ *(string.pointer++) = '\xC2';
+ *(string.pointer++) = '\xA0';
+ break;
+
+ case 'L': /* LS (#x2028) */
+ *(string.pointer++) = '\xE2';
+ *(string.pointer++) = '\x80';
+ *(string.pointer++) = '\xA8';
+ break;
+
+ case 'P': /* PS (#x2029) */
+ *(string.pointer++) = '\xE2';
+ *(string.pointer++) = '\x80';
+ *(string.pointer++) = '\xA9';
+ break;
+
+ case 'x':
+ code_length = 2;
+ break;
+
+ case 'u':
+ code_length = 4;
+ break;
+
+ case 'U':
+ code_length = 8;
+ break;
+
+ default:
+ yaml_parser_set_scanner_error(parser, "while parsing a quoted scalar",
+ start_mark, "found unknown escape character");
+ goto error;
+ }
+
+ SKIP(parser);
+ SKIP(parser);
+
+ /* Consume an arbitrary escape code. */
+
+ if (code_length)
+ {
+ unsigned int value = 0;
+ size_t k;
+
+ /* Scan the character value. */
+
+ if (!CACHE(parser, code_length)) goto error;
+
+ for (k = 0; k < code_length; k ++) {
+ if (!IS_HEX_AT(parser->buffer, k)) {
+ yaml_parser_set_scanner_error(parser, "while parsing a quoted scalar",
+ start_mark, "did not find expected hexdecimal number");
+ goto error;
+ }
+ value = (value << 4) + AS_HEX_AT(parser->buffer, k);
+ }
+
+ /* Check the value and write the character. */
+
+ if ((value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF) {
+ yaml_parser_set_scanner_error(parser, "while parsing a quoted scalar",
+ start_mark, "found invalid Unicode character escape code");
+ goto error;
+ }
+
+ if (value <= 0x7F) {
+ *(string.pointer++) = value;
+ }
+ else if (value <= 0x7FF) {
+ *(string.pointer++) = 0xC0 + (value >> 6);
+ *(string.pointer++) = 0x80 + (value & 0x3F);
+ }
+ else if (value <= 0xFFFF) {
+ *(string.pointer++) = 0xE0 + (value >> 12);
+ *(string.pointer++) = 0x80 + ((value >> 6) & 0x3F);
+ *(string.pointer++) = 0x80 + (value & 0x3F);
+ }
+ else {
+ *(string.pointer++) = 0xF0 + (value >> 18);
+ *(string.pointer++) = 0x80 + ((value >> 12) & 0x3F);
+ *(string.pointer++) = 0x80 + ((value >> 6) & 0x3F);
+ *(string.pointer++) = 0x80 + (value & 0x3F);
+ }
+
+ /* Advance the pointer. */
+
+ for (k = 0; k < code_length; k ++) {
+ SKIP(parser);
+ }
+ }
+ }
+
+ else
+ {
+ /* It is a non-escaped non-blank character. */
+
+ if (!READ(parser, string)) goto error;
+ }
+
+ if (!CACHE(parser, 2)) goto error;
+ }
+
+ /* Check if we are at the end of the scalar. */
+
+ if (CHECK(parser->buffer, single ? '\'' : '"'))
+ break;
+
+ /* Consume blank characters. */
+
+ if (!CACHE(parser, 1)) goto error;
+
+ while (IS_BLANK(parser->buffer) || IS_BREAK(parser->buffer))
+ {
+ if (IS_BLANK(parser->buffer))
+ {
+ /* Consume a space or a tab character. */
+
+ if (!leading_blanks) {
+ if (!READ(parser, whitespaces)) goto error;
+ }
+ else {
+ SKIP(parser);
+ }
+ }
+ else
+ {
+ if (!CACHE(parser, 2)) goto error;
+
+ /* Check if it is a first line break. */
+
+ if (!leading_blanks)
+ {
+ CLEAR(parser, whitespaces);
+ if (!READ_LINE(parser, leading_break)) goto error;
+ leading_blanks = 1;
+ }
+ else
+ {
+ if (!READ_LINE(parser, trailing_breaks)) goto error;
+ }
+ }
+ if (!CACHE(parser, 1)) goto error;
+ }
+
+ /* Join the whitespaces or fold line breaks. */
+
+ if (leading_blanks)
+ {
+ /* Do we need to fold line breaks? */
+
+ if (leading_break.start[0] == '\n') {
+ if (trailing_breaks.start[0] == '\0') {
+ if (!STRING_EXTEND(parser, string)) goto error;
+ *(string.pointer++) = ' ';
+ }
+ else {
+ if (!JOIN(parser, string, trailing_breaks)) goto error;
+ CLEAR(parser, trailing_breaks);
+ }
+ CLEAR(parser, leading_break);
+ }
+ else {
+ if (!JOIN(parser, string, leading_break)) goto error;
+ if (!JOIN(parser, string, trailing_breaks)) goto error;
+ CLEAR(parser, leading_break);
+ CLEAR(parser, trailing_breaks);
+ }
+ }
+ else
+ {
+ if (!JOIN(parser, string, whitespaces)) goto error;
+ CLEAR(parser, whitespaces);
+ }
+ }
+
+ /* Eat the right quote. */
+
+ SKIP(parser);
+
+ end_mark = parser->mark;
+
+ /* Create a token. */
+
+ SCALAR_TOKEN_INIT(*token, string.start, string.pointer-string.start,
+ single ? YAML_SINGLE_QUOTED_SCALAR_STYLE : YAML_DOUBLE_QUOTED_SCALAR_STYLE,
+ start_mark, end_mark);
+
+ STRING_DEL(parser, leading_break);
+ STRING_DEL(parser, trailing_breaks);
+ STRING_DEL(parser, whitespaces);
+
+ return 1;
+
+error:
+ STRING_DEL(parser, string);
+ STRING_DEL(parser, leading_break);
+ STRING_DEL(parser, trailing_breaks);
+ STRING_DEL(parser, whitespaces);
+
+ return 0;
+}
+
+/*
+ * Scan a plain scalar.
+ */
+
+static int
+yaml_parser_scan_plain_scalar(yaml_parser_t *parser, yaml_token_t *token)
+{
+ yaml_mark_t start_mark;
+ yaml_mark_t end_mark;
+ yaml_string_t string = NULL_STRING;
+ yaml_string_t leading_break = NULL_STRING;
+ yaml_string_t trailing_breaks = NULL_STRING;
+ yaml_string_t whitespaces = NULL_STRING;
+ int leading_blanks = 0;
+ int indent = parser->indent+1;
+
+ if (!STRING_INIT(parser, string, INITIAL_STRING_SIZE)) goto error;
+ if (!STRING_INIT(parser, leading_break, INITIAL_STRING_SIZE)) goto error;
+ if (!STRING_INIT(parser, trailing_breaks, INITIAL_STRING_SIZE)) goto error;
+ if (!STRING_INIT(parser, whitespaces, INITIAL_STRING_SIZE)) goto error;
+
+ start_mark = end_mark = parser->mark;
+
+ /* Consume the content of the plain scalar. */
+
+ while (1)
+ {
+ /* Check for a document indicator. */
+
+ if (!CACHE(parser, 4)) goto error;
+
+ if (parser->mark.column == 0 &&
+ ((CHECK_AT(parser->buffer, '-', 0) &&
+ CHECK_AT(parser->buffer, '-', 1) &&
+ CHECK_AT(parser->buffer, '-', 2)) ||
+ (CHECK_AT(parser->buffer, '.', 0) &&
+ CHECK_AT(parser->buffer, '.', 1) &&
+ CHECK_AT(parser->buffer, '.', 2))) &&
+ IS_BLANKZ_AT(parser->buffer, 3)) break;
+
+ /* Check for a comment. */
+
+ if (CHECK(parser->buffer, '#'))
+ break;
+
+ /* Consume non-blank characters. */
+
+ while (!IS_BLANKZ(parser->buffer))
+ {
+ /* Check for 'x:x' in the flow context. TODO: Fix the test "spec-08-13". */
+
+ if (parser->flow_level
+ && CHECK(parser->buffer, ':')
+ && !IS_BLANKZ_AT(parser->buffer, 1)) {
+ yaml_parser_set_scanner_error(parser, "while scanning a plain scalar",
+ start_mark, "found unexpected ':'");
+ goto error;
+ }
+
+ /* Check for indicators that may end a plain scalar. */
+
+ if ((CHECK(parser->buffer, ':') && IS_BLANKZ_AT(parser->buffer, 1))
+ || (parser->flow_level &&
+ (CHECK(parser->buffer, ',') || CHECK(parser->buffer, ':')
+ || CHECK(parser->buffer, '?') || CHECK(parser->buffer, '[')
+ || CHECK(parser->buffer, ']') || CHECK(parser->buffer, '{')
+ || CHECK(parser->buffer, '}'))))
+ break;
+
+ /* Check if we need to join whitespaces and breaks. */
+
+ if (leading_blanks || whitespaces.start != whitespaces.pointer)
+ {
+ if (leading_blanks)
+ {
+ /* Do we need to fold line breaks? */
+
+ if (leading_break.start[0] == '\n') {
+ if (trailing_breaks.start[0] == '\0') {
+ if (!STRING_EXTEND(parser, string)) goto error;
+ *(string.pointer++) = ' ';
+ }
+ else {
+ if (!JOIN(parser, string, trailing_breaks)) goto error;
+ CLEAR(parser, trailing_breaks);
+ }
+ CLEAR(parser, leading_break);
+ }
+ else {
+ if (!JOIN(parser, string, leading_break)) goto error;
+ if (!JOIN(parser, string, trailing_breaks)) goto error;
+ CLEAR(parser, leading_break);
+ CLEAR(parser, trailing_breaks);
+ }
+
+ leading_blanks = 0;
+ }
+ else
+ {
+ if (!JOIN(parser, string, whitespaces)) goto error;
+ CLEAR(parser, whitespaces);
+ }
+ }
+
+ /* Copy the character. */
+
+ if (!READ(parser, string)) goto error;
+
+ end_mark = parser->mark;
+
+ if (!CACHE(parser, 2)) goto error;
+ }
+
+ /* Is it the end? */
+
+ if (!(IS_BLANK(parser->buffer) || IS_BREAK(parser->buffer)))
+ break;
+
+ /* Consume blank characters. */
+
+ if (!CACHE(parser, 1)) goto error;
+
+ while (IS_BLANK(parser->buffer) || IS_BREAK(parser->buffer))
+ {
+ if (IS_BLANK(parser->buffer))
+ {
+ /* Check for tab character that abuse intendation. */
+
+ if (leading_blanks && (int)parser->mark.column < indent
+ && IS_TAB(parser->buffer)) {
+ yaml_parser_set_scanner_error(parser, "while scanning a plain scalar",
+ start_mark, "found a tab character that violate intendation");
+ goto error;
+ }
+
+ /* Consume a space or a tab character. */
+
+ if (!leading_blanks) {
+ if (!READ(parser, whitespaces)) goto error;
+ }
+ else {
+ SKIP(parser);
+ }
+ }
+ else
+ {
+ if (!CACHE(parser, 2)) goto error;
+
+ /* Check if it is a first line break. */
+
+ if (!leading_blanks)
+ {
+ CLEAR(parser, whitespaces);
+ if (!READ_LINE(parser, leading_break)) goto error;
+ leading_blanks = 1;
+ }
+ else
+ {
+ if (!READ_LINE(parser, trailing_breaks)) goto error;
+ }
+ }
+ if (!CACHE(parser, 1)) goto error;
+ }
+
+ /* Check intendation level. */
+
+ if (!parser->flow_level && (int)parser->mark.column < indent)
+ break;
+ }
+
+ /* Create a token. */
+
+ SCALAR_TOKEN_INIT(*token, string.start, string.pointer-string.start,
+ YAML_PLAIN_SCALAR_STYLE, start_mark, end_mark);
+
+ /* Note that we change the 'simple_key_allowed' flag. */
+
+ if (leading_blanks) {
+ parser->simple_key_allowed = 1;
+ }
+
+ STRING_DEL(parser, leading_break);
+ STRING_DEL(parser, trailing_breaks);
+ STRING_DEL(parser, whitespaces);
+
+ return 1;
+
+error:
+ STRING_DEL(parser, string);
+ STRING_DEL(parser, leading_break);
+ STRING_DEL(parser, trailing_breaks);
+ STRING_DEL(parser, whitespaces);
+
+ return 0;
+}
+
diff --git a/ext/psych/yaml/writer.c b/ext/psych/yaml/writer.c
new file mode 100644
index 0000000000..b90019f5cb
--- /dev/null
+++ b/ext/psych/yaml/writer.c
@@ -0,0 +1,141 @@
+
+#include "yaml_private.h"
+
+/*
+ * Declarations.
+ */
+
+static int
+yaml_emitter_set_writer_error(yaml_emitter_t *emitter, const char *problem);
+
+YAML_DECLARE(int)
+yaml_emitter_flush(yaml_emitter_t *emitter);
+
+/*
+ * Set the writer error and return 0.
+ */
+
+static int
+yaml_emitter_set_writer_error(yaml_emitter_t *emitter, const char *problem)
+{
+ emitter->error = YAML_WRITER_ERROR;
+ emitter->problem = problem;
+
+ return 0;
+}
+
+/*
+ * Flush the output buffer.
+ */
+
+YAML_DECLARE(int)
+yaml_emitter_flush(yaml_emitter_t *emitter)
+{
+ int low, high;
+
+ assert(emitter); /* Non-NULL emitter object is expected. */
+ assert(emitter->write_handler); /* Write handler must be set. */
+ assert(emitter->encoding); /* Output encoding must be set. */
+
+ emitter->buffer.last = emitter->buffer.pointer;
+ emitter->buffer.pointer = emitter->buffer.start;
+
+ /* Check if the buffer is empty. */
+
+ if (emitter->buffer.start == emitter->buffer.last) {
+ return 1;
+ }
+
+ /* If the output encoding is UTF-8, we don't need to recode the buffer. */
+
+ if (emitter->encoding == YAML_UTF8_ENCODING)
+ {
+ if (emitter->write_handler(emitter->write_handler_data,
+ emitter->buffer.start,
+ emitter->buffer.last - emitter->buffer.start)) {
+ emitter->buffer.last = emitter->buffer.start;
+ emitter->buffer.pointer = emitter->buffer.start;
+ return 1;
+ }
+ else {
+ return yaml_emitter_set_writer_error(emitter, "write error");
+ }
+ }
+
+ /* Recode the buffer into the raw buffer. */
+
+ low = (emitter->encoding == YAML_UTF16LE_ENCODING ? 0 : 1);
+ high = (emitter->encoding == YAML_UTF16LE_ENCODING ? 1 : 0);
+
+ while (emitter->buffer.pointer != emitter->buffer.last)
+ {
+ unsigned char octet;
+ unsigned int width;
+ unsigned int value;
+ size_t k;
+
+ /*
+ * See the "reader.c" code for more details on UTF-8 encoding. Note
+ * that we assume that the buffer contains a valid UTF-8 sequence.
+ */
+
+ /* Read the next UTF-8 character. */
+
+ octet = emitter->buffer.pointer[0];
+
+ width = (octet & 0x80) == 0x00 ? 1 :
+ (octet & 0xE0) == 0xC0 ? 2 :
+ (octet & 0xF0) == 0xE0 ? 3 :
+ (octet & 0xF8) == 0xF0 ? 4 : 0;
+
+ value = (octet & 0x80) == 0x00 ? octet & 0x7F :
+ (octet & 0xE0) == 0xC0 ? octet & 0x1F :
+ (octet & 0xF0) == 0xE0 ? octet & 0x0F :
+ (octet & 0xF8) == 0xF0 ? octet & 0x07 : 0;
+
+ for (k = 1; k < width; k ++) {
+ octet = emitter->buffer.pointer[k];
+ value = (value << 6) + (octet & 0x3F);
+ }
+
+ emitter->buffer.pointer += width;
+
+ /* Write the character. */
+
+ if (value < 0x10000)
+ {
+ emitter->raw_buffer.last[high] = value >> 8;
+ emitter->raw_buffer.last[low] = value & 0xFF;
+
+ emitter->raw_buffer.last += 2;
+ }
+ else
+ {
+ /* Write the character using a surrogate pair (check "reader.c"). */
+
+ value -= 0x10000;
+ emitter->raw_buffer.last[high] = 0xD8 + (value >> 18);
+ emitter->raw_buffer.last[low] = (value >> 10) & 0xFF;
+ emitter->raw_buffer.last[high+2] = 0xDC + ((value >> 8) & 0xFF);
+ emitter->raw_buffer.last[low+2] = value & 0xFF;
+
+ emitter->raw_buffer.last += 4;
+ }
+ }
+
+ /* Write the raw buffer. */
+
+ if (emitter->write_handler(emitter->write_handler_data,
+ emitter->raw_buffer.start,
+ emitter->raw_buffer.last - emitter->raw_buffer.start)) {
+ emitter->buffer.last = emitter->buffer.start;
+ emitter->buffer.pointer = emitter->buffer.start;
+ emitter->raw_buffer.last = emitter->raw_buffer.start;
+ emitter->raw_buffer.pointer = emitter->raw_buffer.start;
+ return 1;
+ }
+ else {
+ return yaml_emitter_set_writer_error(emitter, "write error");
+ }
+}
+
diff --git a/ext/psych/yaml/yaml.h b/ext/psych/yaml/yaml.h
new file mode 100644
index 0000000000..5a04d36d41
--- /dev/null
+++ b/ext/psych/yaml/yaml.h
@@ -0,0 +1,1971 @@
+/**
+ * @file yaml.h
+ * @brief Public interface for libyaml.
+ *
+ * Include the header file with the code:
+ * @code
+ * #include <yaml.h>
+ * @endcode
+ */
+
+#ifndef YAML_H
+#define YAML_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+/**
+ * @defgroup export Export Definitions
+ * @{
+ */
+
+/** The public API declaration. */
+
+#ifdef _WIN32
+# if defined(YAML_DECLARE_STATIC)
+# define YAML_DECLARE(type) type
+# elif defined(YAML_DECLARE_EXPORT)
+# define YAML_DECLARE(type) __declspec(dllexport) type
+# else
+# define YAML_DECLARE(type) __declspec(dllimport) type
+# endif
+#else
+# define YAML_DECLARE(type) type
+#endif
+
+/** @} */
+
+/**
+ * @defgroup version Version Information
+ * @{
+ */
+
+/**
+ * Get the library version as a string.
+ *
+ * @returns The function returns the pointer to a static string of the form
+ * @c "X.Y.Z", where @c X is the major version number, @c Y is a minor version
+ * number, and @c Z is the patch version number.
+ */
+
+YAML_DECLARE(const char *)
+yaml_get_version_string(void);
+
+/**
+ * Get the library version numbers.
+ *
+ * @param[out] major Major version number.
+ * @param[out] minor Minor version number.
+ * @param[out] patch Patch version number.
+ */
+
+YAML_DECLARE(void)
+yaml_get_version(int *major, int *minor, int *patch);
+
+/** @} */
+
+/**
+ * @defgroup basic Basic Types
+ * @{
+ */
+
+/** The character type (UTF-8 octet). */
+typedef unsigned char yaml_char_t;
+
+/** The version directive data. */
+typedef struct yaml_version_directive_s {
+ /** The major version number. */
+ int major;
+ /** The minor version number. */
+ int minor;
+} yaml_version_directive_t;
+
+/** The tag directive data. */
+typedef struct yaml_tag_directive_s {
+ /** The tag handle. */
+ yaml_char_t *handle;
+ /** The tag prefix. */
+ yaml_char_t *prefix;
+} yaml_tag_directive_t;
+
+/** The stream encoding. */
+typedef enum yaml_encoding_e {
+ /** Let the parser choose the encoding. */
+ YAML_ANY_ENCODING,
+ /** The default UTF-8 encoding. */
+ YAML_UTF8_ENCODING,
+ /** The UTF-16-LE encoding with BOM. */
+ YAML_UTF16LE_ENCODING,
+ /** The UTF-16-BE encoding with BOM. */
+ YAML_UTF16BE_ENCODING
+} yaml_encoding_t;
+
+/** Line break types. */
+
+typedef enum yaml_break_e {
+ /** Let the parser choose the break type. */
+ YAML_ANY_BREAK,
+ /** Use CR for line breaks (Mac style). */
+ YAML_CR_BREAK,
+ /** Use LN for line breaks (Unix style). */
+ YAML_LN_BREAK,
+ /** Use CR LN for line breaks (DOS style). */
+ YAML_CRLN_BREAK
+} yaml_break_t;
+
+/** Many bad things could happen with the parser and emitter. */
+typedef enum yaml_error_type_e {
+ /** No error is produced. */
+ YAML_NO_ERROR,
+
+ /** Cannot allocate or reallocate a block of memory. */
+ YAML_MEMORY_ERROR,
+
+ /** Cannot read or decode the input stream. */
+ YAML_READER_ERROR,
+ /** Cannot scan the input stream. */
+ YAML_SCANNER_ERROR,
+ /** Cannot parse the input stream. */
+ YAML_PARSER_ERROR,
+ /** Cannot compose a YAML document. */
+ YAML_COMPOSER_ERROR,
+
+ /** Cannot write to the output stream. */
+ YAML_WRITER_ERROR,
+ /** Cannot emit a YAML stream. */
+ YAML_EMITTER_ERROR
+} yaml_error_type_t;
+
+/** The pointer position. */
+typedef struct yaml_mark_s {
+ /** The position index. */
+ size_t index;
+
+ /** The position line. */
+ size_t line;
+
+ /** The position column. */
+ size_t column;
+} yaml_mark_t;
+
+/** @} */
+
+/**
+ * @defgroup styles Node Styles
+ * @{
+ */
+
+/** Scalar styles. */
+typedef enum yaml_scalar_style_e {
+ /** Let the emitter choose the style. */
+ YAML_ANY_SCALAR_STYLE,
+
+ /** The plain scalar style. */
+ YAML_PLAIN_SCALAR_STYLE,
+
+ /** The single-quoted scalar style. */
+ YAML_SINGLE_QUOTED_SCALAR_STYLE,
+ /** The double-quoted scalar style. */
+ YAML_DOUBLE_QUOTED_SCALAR_STYLE,
+
+ /** The literal scalar style. */
+ YAML_LITERAL_SCALAR_STYLE,
+ /** The folded scalar style. */
+ YAML_FOLDED_SCALAR_STYLE
+} yaml_scalar_style_t;
+
+/** Sequence styles. */
+typedef enum yaml_sequence_style_e {
+ /** Let the emitter choose the style. */
+ YAML_ANY_SEQUENCE_STYLE,
+
+ /** The block sequence style. */
+ YAML_BLOCK_SEQUENCE_STYLE,
+ /** The flow sequence style. */
+ YAML_FLOW_SEQUENCE_STYLE
+} yaml_sequence_style_t;
+
+/** Mapping styles. */
+typedef enum yaml_mapping_style_e {
+ /** Let the emitter choose the style. */
+ YAML_ANY_MAPPING_STYLE,
+
+ /** The block mapping style. */
+ YAML_BLOCK_MAPPING_STYLE,
+ /** The flow mapping style. */
+ YAML_FLOW_MAPPING_STYLE
+/* YAML_FLOW_SET_MAPPING_STYLE */
+} yaml_mapping_style_t;
+
+/** @} */
+
+/**
+ * @defgroup tokens Tokens
+ * @{
+ */
+
+/** Token types. */
+typedef enum yaml_token_type_e {
+ /** An empty token. */
+ YAML_NO_TOKEN,
+
+ /** A STREAM-START token. */
+ YAML_STREAM_START_TOKEN,
+ /** A STREAM-END token. */
+ YAML_STREAM_END_TOKEN,
+
+ /** A VERSION-DIRECTIVE token. */
+ YAML_VERSION_DIRECTIVE_TOKEN,
+ /** A TAG-DIRECTIVE token. */
+ YAML_TAG_DIRECTIVE_TOKEN,
+ /** A DOCUMENT-START token. */
+ YAML_DOCUMENT_START_TOKEN,
+ /** A DOCUMENT-END token. */
+ YAML_DOCUMENT_END_TOKEN,
+
+ /** A BLOCK-SEQUENCE-START token. */
+ YAML_BLOCK_SEQUENCE_START_TOKEN,
+ /** A BLOCK-SEQUENCE-END token. */
+ YAML_BLOCK_MAPPING_START_TOKEN,
+ /** A BLOCK-END token. */
+ YAML_BLOCK_END_TOKEN,
+
+ /** A FLOW-SEQUENCE-START token. */
+ YAML_FLOW_SEQUENCE_START_TOKEN,
+ /** A FLOW-SEQUENCE-END token. */
+ YAML_FLOW_SEQUENCE_END_TOKEN,
+ /** A FLOW-MAPPING-START token. */
+ YAML_FLOW_MAPPING_START_TOKEN,
+ /** A FLOW-MAPPING-END token. */
+ YAML_FLOW_MAPPING_END_TOKEN,
+
+ /** A BLOCK-ENTRY token. */
+ YAML_BLOCK_ENTRY_TOKEN,
+ /** A FLOW-ENTRY token. */
+ YAML_FLOW_ENTRY_TOKEN,
+ /** A KEY token. */
+ YAML_KEY_TOKEN,
+ /** A VALUE token. */
+ YAML_VALUE_TOKEN,
+
+ /** An ALIAS token. */
+ YAML_ALIAS_TOKEN,
+ /** An ANCHOR token. */
+ YAML_ANCHOR_TOKEN,
+ /** A TAG token. */
+ YAML_TAG_TOKEN,
+ /** A SCALAR token. */
+ YAML_SCALAR_TOKEN
+} yaml_token_type_t;
+
+/** The token structure. */
+typedef struct yaml_token_s {
+
+ /** The token type. */
+ yaml_token_type_t type;
+
+ /** The token data. */
+ union {
+
+ /** The stream start (for @c YAML_STREAM_START_TOKEN). */
+ struct {
+ /** The stream encoding. */
+ yaml_encoding_t encoding;
+ } stream_start;
+
+ /** The alias (for @c YAML_ALIAS_TOKEN). */
+ struct {
+ /** The alias value. */
+ yaml_char_t *value;
+ } alias;
+
+ /** The anchor (for @c YAML_ANCHOR_TOKEN). */
+ struct {
+ /** The anchor value. */
+ yaml_char_t *value;
+ } anchor;
+
+ /** The tag (for @c YAML_TAG_TOKEN). */
+ struct {
+ /** The tag handle. */
+ yaml_char_t *handle;
+ /** The tag suffix. */
+ yaml_char_t *suffix;
+ } tag;
+
+ /** The scalar value (for @c YAML_SCALAR_TOKEN). */
+ struct {
+ /** The scalar value. */
+ yaml_char_t *value;
+ /** The length of the scalar value. */
+ size_t length;
+ /** The scalar style. */
+ yaml_scalar_style_t style;
+ } scalar;
+
+ /** The version directive (for @c YAML_VERSION_DIRECTIVE_TOKEN). */
+ struct {
+ /** The major version number. */
+ int major;
+ /** The minor version number. */
+ int minor;
+ } version_directive;
+
+ /** The tag directive (for @c YAML_TAG_DIRECTIVE_TOKEN). */
+ struct {
+ /** The tag handle. */
+ yaml_char_t *handle;
+ /** The tag prefix. */
+ yaml_char_t *prefix;
+ } tag_directive;
+
+ } data;
+
+ /** The beginning of the token. */
+ yaml_mark_t start_mark;
+ /** The end of the token. */
+ yaml_mark_t end_mark;
+
+} yaml_token_t;
+
+/**
+ * Free any memory allocated for a token object.
+ *
+ * @param[in,out] token A token object.
+ */
+
+YAML_DECLARE(void)
+yaml_token_delete(yaml_token_t *token);
+
+/** @} */
+
+/**
+ * @defgroup events Events
+ * @{
+ */
+
+/** Event types. */
+typedef enum yaml_event_type_e {
+ /** An empty event. */
+ YAML_NO_EVENT,
+
+ /** A STREAM-START event. */
+ YAML_STREAM_START_EVENT,
+ /** A STREAM-END event. */
+ YAML_STREAM_END_EVENT,
+
+ /** A DOCUMENT-START event. */
+ YAML_DOCUMENT_START_EVENT,
+ /** A DOCUMENT-END event. */
+ YAML_DOCUMENT_END_EVENT,
+
+ /** An ALIAS event. */
+ YAML_ALIAS_EVENT,
+ /** A SCALAR event. */
+ YAML_SCALAR_EVENT,
+
+ /** A SEQUENCE-START event. */
+ YAML_SEQUENCE_START_EVENT,
+ /** A SEQUENCE-END event. */
+ YAML_SEQUENCE_END_EVENT,
+
+ /** A MAPPING-START event. */
+ YAML_MAPPING_START_EVENT,
+ /** A MAPPING-END event. */
+ YAML_MAPPING_END_EVENT
+} yaml_event_type_t;
+
+/** The event structure. */
+typedef struct yaml_event_s {
+
+ /** The event type. */
+ yaml_event_type_t type;
+
+ /** The event data. */
+ union {
+
+ /** The stream parameters (for @c YAML_STREAM_START_EVENT). */
+ struct {
+ /** The document encoding. */
+ yaml_encoding_t encoding;
+ } stream_start;
+
+ /** The document parameters (for @c YAML_DOCUMENT_START_EVENT). */
+ struct {
+ /** The version directive. */
+ yaml_version_directive_t *version_directive;
+
+ /** The list of tag directives. */
+ struct {
+ /** The beginning of the tag directives list. */
+ yaml_tag_directive_t *start;
+ /** The end of the tag directives list. */
+ yaml_tag_directive_t *end;
+ } tag_directives;
+
+ /** Is the document indicator implicit? */
+ int implicit;
+ } document_start;
+
+ /** The document end parameters (for @c YAML_DOCUMENT_END_EVENT). */
+ struct {
+ /** Is the document end indicator implicit? */
+ int implicit;
+ } document_end;
+
+ /** The alias parameters (for @c YAML_ALIAS_EVENT). */
+ struct {
+ /** The anchor. */
+ yaml_char_t *anchor;
+ } alias;
+
+ /** The scalar parameters (for @c YAML_SCALAR_EVENT). */
+ struct {
+ /** The anchor. */
+ yaml_char_t *anchor;
+ /** The tag. */
+ yaml_char_t *tag;
+ /** The scalar value. */
+ yaml_char_t *value;
+ /** The length of the scalar value. */
+ size_t length;
+ /** Is the tag optional for the plain style? */
+ int plain_implicit;
+ /** Is the tag optional for any non-plain style? */
+ int quoted_implicit;
+ /** The scalar style. */
+ yaml_scalar_style_t style;
+ } scalar;
+
+ /** The sequence parameters (for @c YAML_SEQUENCE_START_EVENT). */
+ struct {
+ /** The anchor. */
+ yaml_char_t *anchor;
+ /** The tag. */
+ yaml_char_t *tag;
+ /** Is the tag optional? */
+ int implicit;
+ /** The sequence style. */
+ yaml_sequence_style_t style;
+ } sequence_start;
+
+ /** The mapping parameters (for @c YAML_MAPPING_START_EVENT). */
+ struct {
+ /** The anchor. */
+ yaml_char_t *anchor;
+ /** The tag. */
+ yaml_char_t *tag;
+ /** Is the tag optional? */
+ int implicit;
+ /** The mapping style. */
+ yaml_mapping_style_t style;
+ } mapping_start;
+
+ } data;
+
+ /** The beginning of the event. */
+ yaml_mark_t start_mark;
+ /** The end of the event. */
+ yaml_mark_t end_mark;
+
+} yaml_event_t;
+
+/**
+ * Create the STREAM-START event.
+ *
+ * @param[out] event An empty event object.
+ * @param[in] encoding The stream encoding.
+ *
+ * @returns @c 1 if the function succeeded, @c 0 on error.
+ */
+
+YAML_DECLARE(int)
+yaml_stream_start_event_initialize(yaml_event_t *event,
+ yaml_encoding_t encoding);
+
+/**
+ * Create the STREAM-END event.
+ *
+ * @param[out] event An empty event object.
+ *
+ * @returns @c 1 if the function succeeded, @c 0 on error.
+ */
+
+YAML_DECLARE(int)
+yaml_stream_end_event_initialize(yaml_event_t *event);
+
+/**
+ * Create the DOCUMENT-START event.
+ *
+ * The @a implicit argument is considered as a stylistic parameter and may be
+ * ignored by the emitter.
+ *
+ * @param[out] event An empty event object.
+ * @param[in] version_directive The %YAML directive value or
+ * @c NULL.
+ * @param[in] tag_directives_start The beginning of the %TAG
+ * directives list.
+ * @param[in] tag_directives_end The end of the %TAG directives
+ * list.
+ * @param[in] implicit If the document start indicator is
+ * implicit.
+ *
+ * @returns @c 1 if the function succeeded, @c 0 on error.
+ */
+
+YAML_DECLARE(int)
+yaml_document_start_event_initialize(yaml_event_t *event,
+ yaml_version_directive_t *version_directive,
+ yaml_tag_directive_t *tag_directives_start,
+ yaml_tag_directive_t *tag_directives_end,
+ int implicit);
+
+/**
+ * Create the DOCUMENT-END event.
+ *
+ * The @a implicit argument is considered as a stylistic parameter and may be
+ * ignored by the emitter.
+ *
+ * @param[out] event An empty event object.
+ * @param[in] implicit If the document end indicator is implicit.
+ *
+ * @returns @c 1 if the function succeeded, @c 0 on error.
+ */
+
+YAML_DECLARE(int)
+yaml_document_end_event_initialize(yaml_event_t *event, int implicit);
+
+/**
+ * Create an ALIAS event.
+ *
+ * @param[out] event An empty event object.
+ * @param[in] anchor The anchor value.
+ *
+ * @returns @c 1 if the function succeeded, @c 0 on error.
+ */
+
+YAML_DECLARE(int)
+yaml_alias_event_initialize(yaml_event_t *event, yaml_char_t *anchor);
+
+/**
+ * Create a SCALAR event.
+ *
+ * The @a style argument may be ignored by the emitter.
+ *
+ * Either the @a tag attribute or one of the @a plain_implicit and
+ * @a quoted_implicit flags must be set.
+ *
+ * @param[out] event An empty event object.
+ * @param[in] anchor The scalar anchor or @c NULL.
+ * @param[in] tag The scalar tag or @c NULL.
+ * @param[in] value The scalar value.
+ * @param[in] length The length of the scalar value.
+ * @param[in] plain_implicit If the tag may be omitted for the plain
+ * style.
+ * @param[in] quoted_implicit If the tag may be omitted for any
+ * non-plain style.
+ * @param[in] style The scalar style.
+ *
+ * @returns @c 1 if the function succeeded, @c 0 on error.
+ */
+
+YAML_DECLARE(int)
+yaml_scalar_event_initialize(yaml_event_t *event,
+ yaml_char_t *anchor, yaml_char_t *tag,
+ yaml_char_t *value, int length,
+ int plain_implicit, int quoted_implicit,
+ yaml_scalar_style_t style);
+
+/**
+ * Create a SEQUENCE-START event.
+ *
+ * The @a style argument may be ignored by the emitter.
+ *
+ * Either the @a tag attribute or the @a implicit flag must be set.
+ *
+ * @param[out] event An empty event object.
+ * @param[in] anchor The sequence anchor or @c NULL.
+ * @param[in] tag The sequence tag or @c NULL.
+ * @param[in] implicit If the tag may be omitted.
+ * @param[in] style The sequence style.
+ *
+ * @returns @c 1 if the function succeeded, @c 0 on error.
+ */
+
+YAML_DECLARE(int)
+yaml_sequence_start_event_initialize(yaml_event_t *event,
+ yaml_char_t *anchor, yaml_char_t *tag, int implicit,
+ yaml_sequence_style_t style);
+
+/**
+ * Create a SEQUENCE-END event.
+ *
+ * @param[out] event An empty event object.
+ *
+ * @returns @c 1 if the function succeeded, @c 0 on error.
+ */
+
+YAML_DECLARE(int)
+yaml_sequence_end_event_initialize(yaml_event_t *event);
+
+/**
+ * Create a MAPPING-START event.
+ *
+ * The @a style argument may be ignored by the emitter.
+ *
+ * Either the @a tag attribute or the @a implicit flag must be set.
+ *
+ * @param[out] event An empty event object.
+ * @param[in] anchor The mapping anchor or @c NULL.
+ * @param[in] tag The mapping tag or @c NULL.
+ * @param[in] implicit If the tag may be omitted.
+ * @param[in] style The mapping style.
+ *
+ * @returns @c 1 if the function succeeded, @c 0 on error.
+ */
+
+YAML_DECLARE(int)
+yaml_mapping_start_event_initialize(yaml_event_t *event,
+ yaml_char_t *anchor, yaml_char_t *tag, int implicit,
+ yaml_mapping_style_t style);
+
+/**
+ * Create a MAPPING-END event.
+ *
+ * @param[out] event An empty event object.
+ *
+ * @returns @c 1 if the function succeeded, @c 0 on error.
+ */
+
+YAML_DECLARE(int)
+yaml_mapping_end_event_initialize(yaml_event_t *event);
+
+/**
+ * Free any memory allocated for an event object.
+ *
+ * @param[in,out] event An event object.
+ */
+
+YAML_DECLARE(void)
+yaml_event_delete(yaml_event_t *event);
+
+/** @} */
+
+/**
+ * @defgroup nodes Nodes
+ * @{
+ */
+
+/** The tag @c !!null with the only possible value: @c null. */
+#define YAML_NULL_TAG "tag:yaml.org,2002:null"
+/** The tag @c !!bool with the values: @c true and @c falce. */
+#define YAML_BOOL_TAG "tag:yaml.org,2002:bool"
+/** The tag @c !!str for string values. */
+#define YAML_STR_TAG "tag:yaml.org,2002:str"
+/** The tag @c !!int for integer values. */
+#define YAML_INT_TAG "tag:yaml.org,2002:int"
+/** The tag @c !!float for float values. */
+#define YAML_FLOAT_TAG "tag:yaml.org,2002:float"
+/** The tag @c !!timestamp for date and time values. */
+#define YAML_TIMESTAMP_TAG "tag:yaml.org,2002:timestamp"
+
+/** The tag @c !!seq is used to denote sequences. */
+#define YAML_SEQ_TAG "tag:yaml.org,2002:seq"
+/** The tag @c !!map is used to denote mapping. */
+#define YAML_MAP_TAG "tag:yaml.org,2002:map"
+
+/** The default scalar tag is @c !!str. */
+#define YAML_DEFAULT_SCALAR_TAG YAML_STR_TAG
+/** The default sequence tag is @c !!seq. */
+#define YAML_DEFAULT_SEQUENCE_TAG YAML_SEQ_TAG
+/** The default mapping tag is @c !!map. */
+#define YAML_DEFAULT_MAPPING_TAG YAML_MAP_TAG
+
+/** Node types. */
+typedef enum yaml_node_type_e {
+ /** An empty node. */
+ YAML_NO_NODE,
+
+ /** A scalar node. */
+ YAML_SCALAR_NODE,
+ /** A sequence node. */
+ YAML_SEQUENCE_NODE,
+ /** A mapping node. */
+ YAML_MAPPING_NODE
+} yaml_node_type_t;
+
+/** The forward definition of a document node structure. */
+typedef struct yaml_node_s yaml_node_t;
+
+/** An element of a sequence node. */
+typedef int yaml_node_item_t;
+
+/** An element of a mapping node. */
+typedef struct yaml_node_pair_s {
+ /** The key of the element. */
+ int key;
+ /** The value of the element. */
+ int value;
+} yaml_node_pair_t;
+
+/** The node structure. */
+struct yaml_node_s {
+
+ /** The node type. */
+ yaml_node_type_t type;
+
+ /** The node tag. */
+ yaml_char_t *tag;
+
+ /** The node data. */
+ union {
+
+ /** The scalar parameters (for @c YAML_SCALAR_NODE). */
+ struct {
+ /** The scalar value. */
+ yaml_char_t *value;
+ /** The length of the scalar value. */
+ size_t length;
+ /** The scalar style. */
+ yaml_scalar_style_t style;
+ } scalar;
+
+ /** The sequence parameters (for @c YAML_SEQUENCE_NODE). */
+ struct {
+ /** The stack of sequence items. */
+ struct {
+ /** The beginning of the stack. */
+ yaml_node_item_t *start;
+ /** The end of the stack. */
+ yaml_node_item_t *end;
+ /** The top of the stack. */
+ yaml_node_item_t *top;
+ } items;
+ /** The sequence style. */
+ yaml_sequence_style_t style;
+ } sequence;
+
+ /** The mapping parameters (for @c YAML_MAPPING_NODE). */
+ struct {
+ /** The stack of mapping pairs (key, value). */
+ struct {
+ /** The beginning of the stack. */
+ yaml_node_pair_t *start;
+ /** The end of the stack. */
+ yaml_node_pair_t *end;
+ /** The top of the stack. */
+ yaml_node_pair_t *top;
+ } pairs;
+ /** The mapping style. */
+ yaml_mapping_style_t style;
+ } mapping;
+
+ } data;
+
+ /** The beginning of the node. */
+ yaml_mark_t start_mark;
+ /** The end of the node. */
+ yaml_mark_t end_mark;
+
+};
+
+/** The document structure. */
+typedef struct yaml_document_s {
+
+ /** The document nodes. */
+ struct {
+ /** The beginning of the stack. */
+ yaml_node_t *start;
+ /** The end of the stack. */
+ yaml_node_t *end;
+ /** The top of the stack. */
+ yaml_node_t *top;
+ } nodes;
+
+ /** The version directive. */
+ yaml_version_directive_t *version_directive;
+
+ /** The list of tag directives. */
+ struct {
+ /** The beginning of the tag directives list. */
+ yaml_tag_directive_t *start;
+ /** The end of the tag directives list. */
+ yaml_tag_directive_t *end;
+ } tag_directives;
+
+ /** Is the document start indicator implicit? */
+ int start_implicit;
+ /** Is the document end indicator implicit? */
+ int end_implicit;
+
+ /** The beginning of the document. */
+ yaml_mark_t start_mark;
+ /** The end of the document. */
+ yaml_mark_t end_mark;
+
+} yaml_document_t;
+
+/**
+ * Create a YAML document.
+ *
+ * @param[out] document An empty document object.
+ * @param[in] version_directive The %YAML directive value or
+ * @c NULL.
+ * @param[in] tag_directives_start The beginning of the %TAG
+ * directives list.
+ * @param[in] tag_directives_end The end of the %TAG directives
+ * list.
+ * @param[in] start_implicit If the document start indicator is
+ * implicit.
+ * @param[in] end_implicit If the document end indicator is
+ * implicit.
+ *
+ * @returns @c 1 if the function succeeded, @c 0 on error.
+ */
+
+YAML_DECLARE(int)
+yaml_document_initialize(yaml_document_t *document,
+ yaml_version_directive_t *version_directive,
+ yaml_tag_directive_t *tag_directives_start,
+ yaml_tag_directive_t *tag_directives_end,
+ int start_implicit, int end_implicit);
+
+/**
+ * Delete a YAML document and all its nodes.
+ *
+ * @param[in,out] document A document object.
+ */
+
+YAML_DECLARE(void)
+yaml_document_delete(yaml_document_t *document);
+
+/**
+ * Get a node of a YAML document.
+ *
+ * The pointer returned by this function is valid until any of the functions
+ * modifying the documents are called.
+ *
+ * @param[in] document A document object.
+ * @param[in] index The node id.
+ *
+ * @returns the node objct or @c NULL if @c node_id is out of range.
+ */
+
+YAML_DECLARE(yaml_node_t *)
+yaml_document_get_node(yaml_document_t *document, int index);
+
+/**
+ * Get the root of a YAML document node.
+ *
+ * The root object is the first object added to the document.
+ *
+ * The pointer returned by this function is valid until any of the functions
+ * modifying the documents are called.
+ *
+ * An empty document produced by the parser signifies the end of a YAML
+ * stream.
+ *
+ * @param[in] document A document object.
+ *
+ * @returns the node object or @c NULL if the document is empty.
+ */
+
+YAML_DECLARE(yaml_node_t *)
+yaml_document_get_root_node(yaml_document_t *document);
+
+/**
+ * Create a SCALAR node and attach it to the document.
+ *
+ * The @a style argument may be ignored by the emitter.
+ *
+ * @param[in,out] document A document object.
+ * @param[in] tag The scalar tag.
+ * @param[in] value The scalar value.
+ * @param[in] length The length of the scalar value.
+ * @param[in] style The scalar style.
+ *
+ * @returns the node id or @c 0 on error.
+ */
+
+YAML_DECLARE(int)
+yaml_document_add_scalar(yaml_document_t *document,
+ yaml_char_t *tag, yaml_char_t *value, int length,
+ yaml_scalar_style_t style);
+
+/**
+ * Create a SEQUENCE node and attach it to the document.
+ *
+ * The @a style argument may be ignored by the emitter.
+ *
+ * @param[in,out] document A document object.
+ * @param[in] tag The sequence tag.
+ * @param[in] style The sequence style.
+ *
+ * @returns the node id or @c 0 on error.
+ */
+
+YAML_DECLARE(int)
+yaml_document_add_sequence(yaml_document_t *document,
+ yaml_char_t *tag, yaml_sequence_style_t style);
+
+/**
+ * Create a MAPPING node and attach it to the document.
+ *
+ * The @a style argument may be ignored by the emitter.
+ *
+ * @param[in,out] document A document object.
+ * @param[in] tag The sequence tag.
+ * @param[in] style The sequence style.
+ *
+ * @returns the node id or @c 0 on error.
+ */
+
+YAML_DECLARE(int)
+yaml_document_add_mapping(yaml_document_t *document,
+ yaml_char_t *tag, yaml_mapping_style_t style);
+
+/**
+ * Add an item to a SEQUENCE node.
+ *
+ * @param[in,out] document A document object.
+ * @param[in] sequence The sequence node id.
+ * @param[in] item The item node id.
+*
+ * @returns @c 1 if the function succeeded, @c 0 on error.
+ */
+
+YAML_DECLARE(int)
+yaml_document_append_sequence_item(yaml_document_t *document,
+ int sequence, int item);
+
+/**
+ * Add a pair of a key and a value to a MAPPING node.
+ *
+ * @param[in,out] document A document object.
+ * @param[in] mapping The mapping node id.
+ * @param[in] key The key node id.
+ * @param[in] value The value node id.
+*
+ * @returns @c 1 if the function succeeded, @c 0 on error.
+ */
+
+YAML_DECLARE(int)
+yaml_document_append_mapping_pair(yaml_document_t *document,
+ int mapping, int key, int value);
+
+/** @} */
+
+/**
+ * @defgroup parser Parser Definitions
+ * @{
+ */
+
+/**
+ * The prototype of a read handler.
+ *
+ * The read handler is called when the parser needs to read more bytes from the
+ * source. The handler should write not more than @a size bytes to the @a
+ * buffer. The number of written bytes should be set to the @a length variable.
+ *
+ * @param[in,out] data A pointer to an application data specified by
+ * yaml_parser_set_input().
+ * @param[out] buffer The buffer to write the data from the source.
+ * @param[in] size The size of the buffer.
+ * @param[out] size_read The actual number of bytes read from the source.
+ *
+ * @returns On success, the handler should return @c 1. If the handler failed,
+ * the returned value should be @c 0. On EOF, the handler should set the
+ * @a size_read to @c 0 and return @c 1.
+ */
+
+typedef int yaml_read_handler_t(void *data, unsigned char *buffer, size_t size,
+ size_t *size_read);
+
+/**
+ * This structure holds information about a potential simple key.
+ */
+
+typedef struct yaml_simple_key_s {
+ /** Is a simple key possible? */
+ int possible;
+
+ /** Is a simple key required? */
+ int required;
+
+ /** The number of the token. */
+ size_t token_number;
+
+ /** The position mark. */
+ yaml_mark_t mark;
+} yaml_simple_key_t;
+
+/**
+ * The states of the parser.
+ */
+typedef enum yaml_parser_state_e {
+ /** Expect STREAM-START. */
+ YAML_PARSE_STREAM_START_STATE,
+ /** Expect the beginning of an implicit document. */
+ YAML_PARSE_IMPLICIT_DOCUMENT_START_STATE,
+ /** Expect DOCUMENT-START. */
+ YAML_PARSE_DOCUMENT_START_STATE,
+ /** Expect the content of a document. */
+ YAML_PARSE_DOCUMENT_CONTENT_STATE,
+ /** Expect DOCUMENT-END. */
+ YAML_PARSE_DOCUMENT_END_STATE,
+ /** Expect a block node. */
+ YAML_PARSE_BLOCK_NODE_STATE,
+ /** Expect a block node or indentless sequence. */
+ YAML_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE,
+ /** Expect a flow node. */
+ YAML_PARSE_FLOW_NODE_STATE,
+ /** Expect the first entry of a block sequence. */
+ YAML_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE,
+ /** Expect an entry of a block sequence. */
+ YAML_PARSE_BLOCK_SEQUENCE_ENTRY_STATE,
+ /** Expect an entry of an indentless sequence. */
+ YAML_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE,
+ /** Expect the first key of a block mapping. */
+ YAML_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE,
+ /** Expect a block mapping key. */
+ YAML_PARSE_BLOCK_MAPPING_KEY_STATE,
+ /** Expect a block mapping value. */
+ YAML_PARSE_BLOCK_MAPPING_VALUE_STATE,
+ /** Expect the first entry of a flow sequence. */
+ YAML_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE,
+ /** Expect an entry of a flow sequence. */
+ YAML_PARSE_FLOW_SEQUENCE_ENTRY_STATE,
+ /** Expect a key of an ordered mapping. */
+ YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE,
+ /** Expect a value of an ordered mapping. */
+ YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE,
+ /** Expect the and of an ordered mapping entry. */
+ YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE,
+ /** Expect the first key of a flow mapping. */
+ YAML_PARSE_FLOW_MAPPING_FIRST_KEY_STATE,
+ /** Expect a key of a flow mapping. */
+ YAML_PARSE_FLOW_MAPPING_KEY_STATE,
+ /** Expect a value of a flow mapping. */
+ YAML_PARSE_FLOW_MAPPING_VALUE_STATE,
+ /** Expect an empty value of a flow mapping. */
+ YAML_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE,
+ /** Expect nothing. */
+ YAML_PARSE_END_STATE
+} yaml_parser_state_t;
+
+/**
+ * This structure holds aliases data.
+ */
+
+typedef struct yaml_alias_data_s {
+ /** The anchor. */
+ yaml_char_t *anchor;
+ /** The node id. */
+ int index;
+ /** The anchor mark. */
+ yaml_mark_t mark;
+} yaml_alias_data_t;
+
+/**
+ * The parser structure.
+ *
+ * All members are internal. Manage the structure using the @c yaml_parser_
+ * family of functions.
+ */
+
+typedef struct yaml_parser_s {
+
+ /**
+ * @name Error handling
+ * @{
+ */
+
+ /** Error type. */
+ yaml_error_type_t error;
+ /** Error description. */
+ const char *problem;
+ /** The byte about which the problem occured. */
+ size_t problem_offset;
+ /** The problematic value (@c -1 is none). */
+ int problem_value;
+ /** The problem position. */
+ yaml_mark_t problem_mark;
+ /** The error context. */
+ const char *context;
+ /** The context position. */
+ yaml_mark_t context_mark;
+
+ /**
+ * @}
+ */
+
+ /**
+ * @name Reader stuff
+ * @{
+ */
+
+ /** Read handler. */
+ yaml_read_handler_t *read_handler;
+
+ /** A pointer for passing to the read handler. */
+ void *read_handler_data;
+
+ /** Standard (string or file) input data. */
+ union {
+ /** String input data. */
+ struct {
+ /** The string start pointer. */
+ const unsigned char *start;
+ /** The string end pointer. */
+ const unsigned char *end;
+ /** The string current position. */
+ const unsigned char *current;
+ } string;
+
+ /** File input data. */
+ FILE *file;
+ } input;
+
+ /** EOF flag */
+ int eof;
+
+ /** The working buffer. */
+ struct {
+ /** The beginning of the buffer. */
+ yaml_char_t *start;
+ /** The end of the buffer. */
+ yaml_char_t *end;
+ /** The current position of the buffer. */
+ yaml_char_t *pointer;
+ /** The last filled position of the buffer. */
+ yaml_char_t *last;
+ } buffer;
+
+ /* The number of unread characters in the buffer. */
+ size_t unread;
+
+ /** The raw buffer. */
+ struct {
+ /** The beginning of the buffer. */
+ unsigned char *start;
+ /** The end of the buffer. */
+ unsigned char *end;
+ /** The current position of the buffer. */
+ unsigned char *pointer;
+ /** The last filled position of the buffer. */
+ unsigned char *last;
+ } raw_buffer;
+
+ /** The input encoding. */
+ yaml_encoding_t encoding;
+
+ /** The offset of the current position (in bytes). */
+ size_t offset;
+
+ /** The mark of the current position. */
+ yaml_mark_t mark;
+
+ /**
+ * @}
+ */
+
+ /**
+ * @name Scanner stuff
+ * @{
+ */
+
+ /** Have we started to scan the input stream? */
+ int stream_start_produced;
+
+ /** Have we reached the end of the input stream? */
+ int stream_end_produced;
+
+ /** The number of unclosed '[' and '{' indicators. */
+ int flow_level;
+
+ /** The tokens queue. */
+ struct {
+ /** The beginning of the tokens queue. */
+ yaml_token_t *start;
+ /** The end of the tokens queue. */
+ yaml_token_t *end;
+ /** The head of the tokens queue. */
+ yaml_token_t *head;
+ /** The tail of the tokens queue. */
+ yaml_token_t *tail;
+ } tokens;
+
+ /** The number of tokens fetched from the queue. */
+ size_t tokens_parsed;
+
+ /* Does the tokens queue contain a token ready for dequeueing. */
+ int token_available;
+
+ /** The indentation levels stack. */
+ struct {
+ /** The beginning of the stack. */
+ int *start;
+ /** The end of the stack. */
+ int *end;
+ /** The top of the stack. */
+ int *top;
+ } indents;
+
+ /** The current indentation level. */
+ int indent;
+
+ /** May a simple key occur at the current position? */
+ int simple_key_allowed;
+
+ /** The stack of simple keys. */
+ struct {
+ /** The beginning of the stack. */
+ yaml_simple_key_t *start;
+ /** The end of the stack. */
+ yaml_simple_key_t *end;
+ /** The top of the stack. */
+ yaml_simple_key_t *top;
+ } simple_keys;
+
+ /**
+ * @}
+ */
+
+ /**
+ * @name Parser stuff
+ * @{
+ */
+
+ /** The parser states stack. */
+ struct {
+ /** The beginning of the stack. */
+ yaml_parser_state_t *start;
+ /** The end of the stack. */
+ yaml_parser_state_t *end;
+ /** The top of the stack. */
+ yaml_parser_state_t *top;
+ } states;
+
+ /** The current parser state. */
+ yaml_parser_state_t state;
+
+ /** The stack of marks. */
+ struct {
+ /** The beginning of the stack. */
+ yaml_mark_t *start;
+ /** The end of the stack. */
+ yaml_mark_t *end;
+ /** The top of the stack. */
+ yaml_mark_t *top;
+ } marks;
+
+ /** The list of TAG directives. */
+ struct {
+ /** The beginning of the list. */
+ yaml_tag_directive_t *start;
+ /** The end of the list. */
+ yaml_tag_directive_t *end;
+ /** The top of the list. */
+ yaml_tag_directive_t *top;
+ } tag_directives;
+
+ /**
+ * @}
+ */
+
+ /**
+ * @name Dumper stuff
+ * @{
+ */
+
+ /** The alias data. */
+ struct {
+ /** The beginning of the list. */
+ yaml_alias_data_t *start;
+ /** The end of the list. */
+ yaml_alias_data_t *end;
+ /** The top of the list. */
+ yaml_alias_data_t *top;
+ } aliases;
+
+ /** The currently parsed document. */
+ yaml_document_t *document;
+
+ /**
+ * @}
+ */
+
+} yaml_parser_t;
+
+/**
+ * Initialize a parser.
+ *
+ * This function creates a new parser object. An application is responsible
+ * for destroying the object using the yaml_parser_delete() function.
+ *
+ * @param[out] parser An empty parser object.
+ *
+ * @returns @c 1 if the function succeeded, @c 0 on error.
+ */
+
+YAML_DECLARE(int)
+yaml_parser_initialize(yaml_parser_t *parser);
+
+/**
+ * Destroy a parser.
+ *
+ * @param[in,out] parser A parser object.
+ */
+
+YAML_DECLARE(void)
+yaml_parser_delete(yaml_parser_t *parser);
+
+/**
+ * Set a string input.
+ *
+ * Note that the @a input pointer must be valid while the @a parser object
+ * exists. The application is responsible for destroing @a input after
+ * destroying the @a parser.
+ *
+ * @param[in,out] parser A parser object.
+ * @param[in] input A source data.
+ * @param[in] size The length of the source data in bytes.
+ */
+
+YAML_DECLARE(void)
+yaml_parser_set_input_string(yaml_parser_t *parser,
+ const unsigned char *input, size_t size);
+
+/**
+ * Set a file input.
+ *
+ * @a file should be a file object open for reading. The application is
+ * responsible for closing the @a file.
+ *
+ * @param[in,out] parser A parser object.
+ * @param[in] file An open file.
+ */
+
+YAML_DECLARE(void)
+yaml_parser_set_input_file(yaml_parser_t *parser, FILE *file);
+
+/**
+ * Set a generic input handler.
+ *
+ * @param[in,out] parser A parser object.
+ * @param[in] handler A read handler.
+ * @param[in] data Any application data for passing to the read
+ * handler.
+ */
+
+YAML_DECLARE(void)
+yaml_parser_set_input(yaml_parser_t *parser,
+ yaml_read_handler_t *handler, void *data);
+
+/**
+ * Set the source encoding.
+ *
+ * @param[in,out] parser A parser object.
+ * @param[in] encoding The source encoding.
+ */
+
+YAML_DECLARE(void)
+yaml_parser_set_encoding(yaml_parser_t *parser, yaml_encoding_t encoding);
+
+/**
+ * Scan the input stream and produce the next token.
+ *
+ * Call the function subsequently to produce a sequence of tokens corresponding
+ * to the input stream. The initial token has the type
+ * @c YAML_STREAM_START_TOKEN while the ending token has the type
+ * @c YAML_STREAM_END_TOKEN.
+ *
+ * An application is responsible for freeing any buffers associated with the
+ * produced token object using the @c yaml_token_delete function.
+ *
+ * An application must not alternate the calls of yaml_parser_scan() with the
+ * calls of yaml_parser_parse() or yaml_parser_load(). Doing this will break
+ * the parser.
+ *
+ * @param[in,out] parser A parser object.
+ * @param[out] token An empty token object.
+ *
+ * @returns @c 1 if the function succeeded, @c 0 on error.
+ */
+
+YAML_DECLARE(int)
+yaml_parser_scan(yaml_parser_t *parser, yaml_token_t *token);
+
+/**
+ * Parse the input stream and produce the next parsing event.
+ *
+ * Call the function subsequently to produce a sequence of events corresponding
+ * to the input stream. The initial event has the type
+ * @c YAML_STREAM_START_EVENT while the ending event has the type
+ * @c YAML_STREAM_END_EVENT.
+ *
+ * An application is responsible for freeing any buffers associated with the
+ * produced event object using the yaml_event_delete() function.
+ *
+ * An application must not alternate the calls of yaml_parser_parse() with the
+ * calls of yaml_parser_scan() or yaml_parser_load(). Doing this will break the
+ * parser.
+ *
+ * @param[in,out] parser A parser object.
+ * @param[out] event An empty event object.
+ *
+ * @returns @c 1 if the function succeeded, @c 0 on error.
+ */
+
+YAML_DECLARE(int)
+yaml_parser_parse(yaml_parser_t *parser, yaml_event_t *event);
+
+/**
+ * Parse the input stream and produce the next YAML document.
+ *
+ * Call this function subsequently to produce a sequence of documents
+ * constituting the input stream.
+ *
+ * If the produced document has no root node, it means that the document
+ * end has been reached.
+ *
+ * An application is responsible for freeing any data associated with the
+ * produced document object using the yaml_document_delete() function.
+ *
+ * An application must not alternate the calls of yaml_parser_load() with the
+ * calls of yaml_parser_scan() or yaml_parser_parse(). Doing this will break
+ * the parser.
+ *
+ * @param[in,out] parser A parser object.
+ * @param[out] document An empty document object.
+ *
+ * @return @c 1 if the function succeeded, @c 0 on error.
+ */
+
+YAML_DECLARE(int)
+yaml_parser_load(yaml_parser_t *parser, yaml_document_t *document);
+
+/** @} */
+
+/**
+ * @defgroup emitter Emitter Definitions
+ * @{
+ */
+
+/**
+ * The prototype of a write handler.
+ *
+ * The write handler is called when the emitter needs to flush the accumulated
+ * characters to the output. The handler should write @a size bytes of the
+ * @a buffer to the output.
+ *
+ * @param[in,out] data A pointer to an application data specified by
+ * yaml_emitter_set_output().
+ * @param[in] buffer The buffer with bytes to be written.
+ * @param[in] size The size of the buffer.
+ *
+ * @returns On success, the handler should return @c 1. If the handler failed,
+ * the returned value should be @c 0.
+ */
+
+typedef int yaml_write_handler_t(void *data, unsigned char *buffer, size_t size);
+
+/** The emitter states. */
+typedef enum yaml_emitter_state_e {
+ /** Expect STREAM-START. */
+ YAML_EMIT_STREAM_START_STATE,
+ /** Expect the first DOCUMENT-START or STREAM-END. */
+ YAML_EMIT_FIRST_DOCUMENT_START_STATE,
+ /** Expect DOCUMENT-START or STREAM-END. */
+ YAML_EMIT_DOCUMENT_START_STATE,
+ /** Expect the content of a document. */
+ YAML_EMIT_DOCUMENT_CONTENT_STATE,
+ /** Expect DOCUMENT-END. */
+ YAML_EMIT_DOCUMENT_END_STATE,
+ /** Expect the first item of a flow sequence. */
+ YAML_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE,
+ /** Expect an item of a flow sequence. */
+ YAML_EMIT_FLOW_SEQUENCE_ITEM_STATE,
+ /** Expect the first key of a flow mapping. */
+ YAML_EMIT_FLOW_MAPPING_FIRST_KEY_STATE,
+ /** Expect a key of a flow mapping. */
+ YAML_EMIT_FLOW_MAPPING_KEY_STATE,
+ /** Expect a value for a simple key of a flow mapping. */
+ YAML_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE,
+ /** Expect a value of a flow mapping. */
+ YAML_EMIT_FLOW_MAPPING_VALUE_STATE,
+ /** Expect the first item of a block sequence. */
+ YAML_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE,
+ /** Expect an item of a block sequence. */
+ YAML_EMIT_BLOCK_SEQUENCE_ITEM_STATE,
+ /** Expect the first key of a block mapping. */
+ YAML_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE,
+ /** Expect the key of a block mapping. */
+ YAML_EMIT_BLOCK_MAPPING_KEY_STATE,
+ /** Expect a value for a simple key of a block mapping. */
+ YAML_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE,
+ /** Expect a value of a block mapping. */
+ YAML_EMIT_BLOCK_MAPPING_VALUE_STATE,
+ /** Expect nothing. */
+ YAML_EMIT_END_STATE
+} yaml_emitter_state_t;
+
+/**
+ * The emitter structure.
+ *
+ * All members are internal. Manage the structure using the @c yaml_emitter_
+ * family of functions.
+ */
+
+typedef struct yaml_emitter_s {
+
+ /**
+ * @name Error handling
+ * @{
+ */
+
+ /** Error type. */
+ yaml_error_type_t error;
+ /** Error description. */
+ const char *problem;
+
+ /**
+ * @}
+ */
+
+ /**
+ * @name Writer stuff
+ * @{
+ */
+
+ /** Write handler. */
+ yaml_write_handler_t *write_handler;
+
+ /** A pointer for passing to the white handler. */
+ void *write_handler_data;
+
+ /** Standard (string or file) output data. */
+ union {
+ /** String output data. */
+ struct {
+ /** The buffer pointer. */
+ unsigned char *buffer;
+ /** The buffer size. */
+ size_t size;
+ /** The number of written bytes. */
+ size_t *size_written;
+ } string;
+
+ /** File output data. */
+ FILE *file;
+ } output;
+
+ /** The working buffer. */
+ struct {
+ /** The beginning of the buffer. */
+ yaml_char_t *start;
+ /** The end of the buffer. */
+ yaml_char_t *end;
+ /** The current position of the buffer. */
+ yaml_char_t *pointer;
+ /** The last filled position of the buffer. */
+ yaml_char_t *last;
+ } buffer;
+
+ /** The raw buffer. */
+ struct {
+ /** The beginning of the buffer. */
+ unsigned char *start;
+ /** The end of the buffer. */
+ unsigned char *end;
+ /** The current position of the buffer. */
+ unsigned char *pointer;
+ /** The last filled position of the buffer. */
+ unsigned char *last;
+ } raw_buffer;
+
+ /** The stream encoding. */
+ yaml_encoding_t encoding;
+
+ /**
+ * @}
+ */
+
+ /**
+ * @name Emitter stuff
+ * @{
+ */
+
+ /** If the output is in the canonical style? */
+ int canonical;
+ /** The number of indentation spaces. */
+ int best_indent;
+ /** The preferred width of the output lines. */
+ int best_width;
+ /** Allow unescaped non-ASCII characters? */
+ int unicode;
+ /** The preferred line break. */
+ yaml_break_t line_break;
+
+ /** The stack of states. */
+ struct {
+ /** The beginning of the stack. */
+ yaml_emitter_state_t *start;
+ /** The end of the stack. */
+ yaml_emitter_state_t *end;
+ /** The top of the stack. */
+ yaml_emitter_state_t *top;
+ } states;
+
+ /** The current emitter state. */
+ yaml_emitter_state_t state;
+
+ /** The event queue. */
+ struct {
+ /** The beginning of the event queue. */
+ yaml_event_t *start;
+ /** The end of the event queue. */
+ yaml_event_t *end;
+ /** The head of the event queue. */
+ yaml_event_t *head;
+ /** The tail of the event queue. */
+ yaml_event_t *tail;
+ } events;
+
+ /** The stack of indentation levels. */
+ struct {
+ /** The beginning of the stack. */
+ int *start;
+ /** The end of the stack. */
+ int *end;
+ /** The top of the stack. */
+ int *top;
+ } indents;
+
+ /** The list of tag directives. */
+ struct {
+ /** The beginning of the list. */
+ yaml_tag_directive_t *start;
+ /** The end of the list. */
+ yaml_tag_directive_t *end;
+ /** The top of the list. */
+ yaml_tag_directive_t *top;
+ } tag_directives;
+
+ /** The current indentation level. */
+ int indent;
+
+ /** The current flow level. */
+ int flow_level;
+
+ /** Is it the document root context? */
+ int root_context;
+ /** Is it a sequence context? */
+ int sequence_context;
+ /** Is it a mapping context? */
+ int mapping_context;
+ /** Is it a simple mapping key context? */
+ int simple_key_context;
+
+ /** The current line. */
+ int line;
+ /** The current column. */
+ int column;
+ /** If the last character was a whitespace? */
+ int whitespace;
+ /** If the last character was an indentation character (' ', '-', '?', ':')? */
+ int indention;
+ /** If an explicit document end is required? */
+ int open_ended;
+
+ /** Anchor analysis. */
+ struct {
+ /** The anchor value. */
+ yaml_char_t *anchor;
+ /** The anchor length. */
+ size_t anchor_length;
+ /** Is it an alias? */
+ int alias;
+ } anchor_data;
+
+ /** Tag analysis. */
+ struct {
+ /** The tag handle. */
+ yaml_char_t *handle;
+ /** The tag handle length. */
+ size_t handle_length;
+ /** The tag suffix. */
+ yaml_char_t *suffix;
+ /** The tag suffix length. */
+ size_t suffix_length;
+ } tag_data;
+
+ /** Scalar analysis. */
+ struct {
+ /** The scalar value. */
+ yaml_char_t *value;
+ /** The scalar length. */
+ size_t length;
+ /** Does the scalar contain line breaks? */
+ int multiline;
+ /** Can the scalar be expessed in the flow plain style? */
+ int flow_plain_allowed;
+ /** Can the scalar be expressed in the block plain style? */
+ int block_plain_allowed;
+ /** Can the scalar be expressed in the single quoted style? */
+ int single_quoted_allowed;
+ /** Can the scalar be expressed in the literal or folded styles? */
+ int block_allowed;
+ /** The output style. */
+ yaml_scalar_style_t style;
+ } scalar_data;
+
+ /**
+ * @}
+ */
+
+ /**
+ * @name Dumper stuff
+ * @{
+ */
+
+ /** If the stream was already opened? */
+ int opened;
+ /** If the stream was already closed? */
+ int closed;
+
+ /** The information associated with the document nodes. */
+ struct {
+ /** The number of references. */
+ int references;
+ /** The anchor id. */
+ int anchor;
+ /** If the node has been emitted? */
+ int serialized;
+ } *anchors;
+
+ /** The last assigned anchor id. */
+ int last_anchor_id;
+
+ /** The currently emitted document. */
+ yaml_document_t *document;
+
+ /**
+ * @}
+ */
+
+} yaml_emitter_t;
+
+/**
+ * Initialize an emitter.
+ *
+ * This function creates a new emitter object. An application is responsible
+ * for destroying the object using the yaml_emitter_delete() function.
+ *
+ * @param[out] emitter An empty parser object.
+ *
+ * @returns @c 1 if the function succeeded, @c 0 on error.
+ */
+
+YAML_DECLARE(int)
+yaml_emitter_initialize(yaml_emitter_t *emitter);
+
+/**
+ * Destroy an emitter.
+ *
+ * @param[in,out] emitter An emitter object.
+ */
+
+YAML_DECLARE(void)
+yaml_emitter_delete(yaml_emitter_t *emitter);
+
+/**
+ * Set a string output.
+ *
+ * The emitter will write the output characters to the @a output buffer of the
+ * size @a size. The emitter will set @a size_written to the number of written
+ * bytes. If the buffer is smaller than required, the emitter produces the
+ * YAML_WRITE_ERROR error.
+ *
+ * @param[in,out] emitter An emitter object.
+ * @param[in] output An output buffer.
+ * @param[in] size The buffer size.
+ * @param[in] size_written The pointer to save the number of written
+ * bytes.
+ */
+
+YAML_DECLARE(void)
+yaml_emitter_set_output_string(yaml_emitter_t *emitter,
+ unsigned char *output, size_t size, size_t *size_written);
+
+/**
+ * Set a file output.
+ *
+ * @a file should be a file object open for writing. The application is
+ * responsible for closing the @a file.
+ *
+ * @param[in,out] emitter An emitter object.
+ * @param[in] file An open file.
+ */
+
+YAML_DECLARE(void)
+yaml_emitter_set_output_file(yaml_emitter_t *emitter, FILE *file);
+
+/**
+ * Set a generic output handler.
+ *
+ * @param[in,out] emitter An emitter object.
+ * @param[in] handler A write handler.
+ * @param[in] data Any application data for passing to the write
+ * handler.
+ */
+
+YAML_DECLARE(void)
+yaml_emitter_set_output(yaml_emitter_t *emitter,
+ yaml_write_handler_t *handler, void *data);
+
+/**
+ * Set the output encoding.
+ *
+ * @param[in,out] emitter An emitter object.
+ * @param[in] encoding The output encoding.
+ */
+
+YAML_DECLARE(void)
+yaml_emitter_set_encoding(yaml_emitter_t *emitter, yaml_encoding_t encoding);
+
+/**
+ * Set if the output should be in the "canonical" format as in the YAML
+ * specification.
+ *
+ * @param[in,out] emitter An emitter object.
+ * @param[in] canonical If the output is canonical.
+ */
+
+YAML_DECLARE(void)
+yaml_emitter_set_canonical(yaml_emitter_t *emitter, int canonical);
+
+/**
+ * Set the intendation increment.
+ *
+ * @param[in,out] emitter An emitter object.
+ * @param[in] indent The indentation increment (1 < . < 10).
+ */
+
+YAML_DECLARE(void)
+yaml_emitter_set_indent(yaml_emitter_t *emitter, int indent);
+
+/**
+ * Set the preferred line width. @c -1 means unlimited.
+ *
+ * @param[in,out] emitter An emitter object.
+ * @param[in] width The preferred line width.
+ */
+
+YAML_DECLARE(void)
+yaml_emitter_set_width(yaml_emitter_t *emitter, int width);
+
+/**
+ * Set if unescaped non-ASCII characters are allowed.
+ *
+ * @param[in,out] emitter An emitter object.
+ * @param[in] unicode If unescaped Unicode characters are allowed.
+ */
+
+YAML_DECLARE(void)
+yaml_emitter_set_unicode(yaml_emitter_t *emitter, int unicode);
+
+/**
+ * Set the preferred line break.
+ *
+ * @param[in,out] emitter An emitter object.
+ * @param[in] line_break The preferred line break.
+ */
+
+YAML_DECLARE(void)
+yaml_emitter_set_break(yaml_emitter_t *emitter, yaml_break_t line_break);
+
+/**
+ * Emit an event.
+ *
+ * The event object may be generated using the yaml_parser_parse() function.
+ * The emitter takes the responsibility for the event object and destroys its
+ * content after it is emitted. The event object is destroyed even if the
+ * function fails.
+ *
+ * @param[in,out] emitter An emitter object.
+ * @param[in,out] event An event object.
+ *
+ * @returns @c 1 if the function succeeded, @c 0 on error.
+ */
+
+YAML_DECLARE(int)
+yaml_emitter_emit(yaml_emitter_t *emitter, yaml_event_t *event);
+
+/**
+ * Start a YAML stream.
+ *
+ * This function should be used before yaml_emitter_dump() is called.
+ *
+ * @param[in,out] emitter An emitter object.
+ *
+ * @returns @c 1 if the function succeeded, @c 0 on error.
+ */
+
+YAML_DECLARE(int)
+yaml_emitter_open(yaml_emitter_t *emitter);
+
+/**
+ * Finish a YAML stream.
+ *
+ * This function should be used after yaml_emitter_dump() is called.
+ *
+ * @param[in,out] emitter An emitter object.
+ *
+ * @returns @c 1 if the function succeeded, @c 0 on error.
+ */
+
+YAML_DECLARE(int)
+yaml_emitter_close(yaml_emitter_t *emitter);
+
+/**
+ * Emit a YAML document.
+ *
+ * The documen object may be generated using the yaml_parser_load() function
+ * or the yaml_document_initialize() function. The emitter takes the
+ * responsibility for the document object and destoys its content after
+ * it is emitted. The document object is destroyedeven if the function fails.
+ *
+ * @param[in,out] emitter An emitter object.
+ * @param[in,out] document A document object.
+ *
+ * @returns @c 1 if the function succeeded, @c 0 on error.
+ */
+
+YAML_DECLARE(int)
+yaml_emitter_dump(yaml_emitter_t *emitter, yaml_document_t *document);
+
+/**
+ * Flush the accumulated characters to the output.
+ *
+ * @param[in,out] emitter An emitter object.
+ *
+ * @returns @c 1 if the function succeeded, @c 0 on error.
+ */
+
+YAML_DECLARE(int)
+yaml_emitter_flush(yaml_emitter_t *emitter);
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* #ifndef YAML_H */
+
diff --git a/ext/psych/yaml/yaml_private.h b/ext/psych/yaml/yaml_private.h
new file mode 100644
index 0000000000..2b3e0744d1
--- /dev/null
+++ b/ext/psych/yaml/yaml_private.h
@@ -0,0 +1,643 @@
+#ifdef RUBY_EXTCONF_H
+#include RUBY_EXTCONF_H
+#endif
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <yaml.h>
+
+#include <assert.h>
+#include <limits.h>
+
+/*
+ * Memory management.
+ */
+
+YAML_DECLARE(void *)
+yaml_malloc(size_t size);
+
+YAML_DECLARE(void *)
+yaml_realloc(void *ptr, size_t size);
+
+YAML_DECLARE(void)
+yaml_free(void *ptr);
+
+YAML_DECLARE(yaml_char_t *)
+yaml_strdup(const yaml_char_t *);
+
+/*
+ * Reader: Ensure that the buffer contains at least `length` characters.
+ */
+
+YAML_DECLARE(int)
+yaml_parser_update_buffer(yaml_parser_t *parser, size_t length);
+
+/*
+ * Scanner: Ensure that the token stack contains at least one token ready.
+ */
+
+YAML_DECLARE(int)
+yaml_parser_fetch_more_tokens(yaml_parser_t *parser);
+
+/*
+ * The size of the input raw buffer.
+ */
+
+#define INPUT_RAW_BUFFER_SIZE 16384
+
+/*
+ * The size of the input buffer.
+ *
+ * It should be possible to decode the whole raw buffer.
+ */
+
+#define INPUT_BUFFER_SIZE (INPUT_RAW_BUFFER_SIZE*3)
+
+/*
+ * The size of the output buffer.
+ */
+
+#define OUTPUT_BUFFER_SIZE 16384
+
+/*
+ * The size of the output raw buffer.
+ *
+ * It should be possible to encode the whole output buffer.
+ */
+
+#define OUTPUT_RAW_BUFFER_SIZE (OUTPUT_BUFFER_SIZE*2+2)
+
+/*
+ * The size of other stacks and queues.
+ */
+
+#define INITIAL_STACK_SIZE 16
+#define INITIAL_QUEUE_SIZE 16
+#define INITIAL_STRING_SIZE 16
+
+/*
+ * Buffer management.
+ */
+
+#define BUFFER_INIT(context,buffer,size) \
+ (((buffer).start = yaml_malloc(size)) ? \
+ ((buffer).last = (buffer).pointer = (buffer).start, \
+ (buffer).end = (buffer).start+(size), \
+ 1) : \
+ ((context)->error = YAML_MEMORY_ERROR, \
+ 0))
+
+#define BUFFER_DEL(context,buffer) \
+ (yaml_free((buffer).start), \
+ (buffer).start = (buffer).pointer = (buffer).end = 0)
+
+/*
+ * String management.
+ */
+
+typedef struct {
+ yaml_char_t *start;
+ yaml_char_t *end;
+ yaml_char_t *pointer;
+} yaml_string_t;
+
+YAML_DECLARE(int)
+yaml_string_extend(yaml_char_t **start,
+ yaml_char_t **pointer, yaml_char_t **end);
+
+YAML_DECLARE(int)
+yaml_string_join(
+ yaml_char_t **a_start, yaml_char_t **a_pointer, yaml_char_t **a_end,
+ yaml_char_t **b_start, yaml_char_t **b_pointer, yaml_char_t **b_end);
+
+#define NULL_STRING { NULL, NULL, NULL }
+
+#define STRING(string,length) { (string), (string)+(length), (string) }
+
+#define STRING_ASSIGN(value,string,length) \
+ ((value).start = (string), \
+ (value).end = (string)+(length), \
+ (value).pointer = (string))
+
+#define STRING_INIT(context,string,size) \
+ (((string).start = yaml_malloc(size)) ? \
+ ((string).pointer = (string).start, \
+ (string).end = (string).start+(size), \
+ memset((string).start, 0, (size)), \
+ 1) : \
+ ((context)->error = YAML_MEMORY_ERROR, \
+ 0))
+
+#define STRING_DEL(context,string) \
+ (yaml_free((string).start), \
+ (string).start = (string).pointer = (string).end = 0)
+
+#define STRING_EXTEND(context,string) \
+ (((string).pointer+5 < (string).end) \
+ || yaml_string_extend(&(string).start, \
+ &(string).pointer, &(string).end))
+
+#define CLEAR(context,string) \
+ ((string).pointer = (string).start, \
+ memset((string).start, 0, (string).end-(string).start))
+
+#define JOIN(context,string_a,string_b) \
+ ((yaml_string_join(&(string_a).start, &(string_a).pointer, \
+ &(string_a).end, &(string_b).start, \
+ &(string_b).pointer, &(string_b).end)) ? \
+ ((string_b).pointer = (string_b).start, \
+ 1) : \
+ ((context)->error = YAML_MEMORY_ERROR, \
+ 0))
+
+/*
+ * String check operations.
+ */
+
+/*
+ * Check the octet at the specified position.
+ */
+
+#define CHECK_AT(string,octet,offset) \
+ ((string).pointer[offset] == (yaml_char_t)(octet))
+
+/*
+ * Check the current octet in the buffer.
+ */
+
+#define CHECK(string,octet) CHECK_AT((string),(octet),0)
+
+/*
+ * Check if the character at the specified position is an alphabetical
+ * character, a digit, '_', or '-'.
+ */
+
+#define IS_ALPHA_AT(string,offset) \
+ (((string).pointer[offset] >= (yaml_char_t) '0' && \
+ (string).pointer[offset] <= (yaml_char_t) '9') || \
+ ((string).pointer[offset] >= (yaml_char_t) 'A' && \
+ (string).pointer[offset] <= (yaml_char_t) 'Z') || \
+ ((string).pointer[offset] >= (yaml_char_t) 'a' && \
+ (string).pointer[offset] <= (yaml_char_t) 'z') || \
+ (string).pointer[offset] == '_' || \
+ (string).pointer[offset] == '-')
+
+#define IS_ALPHA(string) IS_ALPHA_AT((string),0)
+
+/*
+ * Check if the character at the specified position is a digit.
+ */
+
+#define IS_DIGIT_AT(string,offset) \
+ (((string).pointer[offset] >= (yaml_char_t) '0' && \
+ (string).pointer[offset] <= (yaml_char_t) '9'))
+
+#define IS_DIGIT(string) IS_DIGIT_AT((string),0)
+
+/*
+ * Get the value of a digit.
+ */
+
+#define AS_DIGIT_AT(string,offset) \
+ ((string).pointer[offset] - (yaml_char_t) '0')
+
+#define AS_DIGIT(string) AS_DIGIT_AT((string),0)
+
+/*
+ * Check if the character at the specified position is a hex-digit.
+ */
+
+#define IS_HEX_AT(string,offset) \
+ (((string).pointer[offset] >= (yaml_char_t) '0' && \
+ (string).pointer[offset] <= (yaml_char_t) '9') || \
+ ((string).pointer[offset] >= (yaml_char_t) 'A' && \
+ (string).pointer[offset] <= (yaml_char_t) 'F') || \
+ ((string).pointer[offset] >= (yaml_char_t) 'a' && \
+ (string).pointer[offset] <= (yaml_char_t) 'f'))
+
+#define IS_HEX(string) IS_HEX_AT((string),0)
+
+/*
+ * Get the value of a hex-digit.
+ */
+
+#define AS_HEX_AT(string,offset) \
+ (((string).pointer[offset] >= (yaml_char_t) 'A' && \
+ (string).pointer[offset] <= (yaml_char_t) 'F') ? \
+ ((string).pointer[offset] - (yaml_char_t) 'A' + 10) : \
+ ((string).pointer[offset] >= (yaml_char_t) 'a' && \
+ (string).pointer[offset] <= (yaml_char_t) 'f') ? \
+ ((string).pointer[offset] - (yaml_char_t) 'a' + 10) : \
+ ((string).pointer[offset] - (yaml_char_t) '0'))
+
+#define AS_HEX(string) AS_HEX_AT((string),0)
+
+/*
+ * Check if the character is ASCII.
+ */
+
+#define IS_ASCII_AT(string,offset) \
+ ((string).pointer[offset] <= (yaml_char_t) '\x7F')
+
+#define IS_ASCII(string) IS_ASCII_AT((string),0)
+
+/*
+ * Check if the character can be printed unescaped.
+ */
+
+#define IS_PRINTABLE_AT(string,offset) \
+ (((string).pointer[offset] == 0x0A) /* . == #x0A */ \
+ || ((string).pointer[offset] >= 0x20 /* #x20 <= . <= #x7E */ \
+ && (string).pointer[offset] <= 0x7E) \
+ || ((string).pointer[offset] == 0xC2 /* #0xA0 <= . <= #xD7FF */ \
+ && (string).pointer[offset+1] >= 0xA0) \
+ || ((string).pointer[offset] > 0xC2 \
+ && (string).pointer[offset] < 0xED) \
+ || ((string).pointer[offset] == 0xED \
+ && (string).pointer[offset+1] < 0xA0) \
+ || ((string).pointer[offset] == 0xEE) \
+ || ((string).pointer[offset] == 0xEF /* #xE000 <= . <= #xFFFD */ \
+ && !((string).pointer[offset+1] == 0xBB /* && . != #xFEFF */ \
+ && (string).pointer[offset+2] == 0xBF) \
+ && !((string).pointer[offset+1] == 0xBF \
+ && ((string).pointer[offset+2] == 0xBE \
+ || (string).pointer[offset+2] == 0xBF))))
+
+#define IS_PRINTABLE(string) IS_PRINTABLE_AT((string),0)
+
+/*
+ * Check if the character at the specified position is NUL.
+ */
+
+#define IS_Z_AT(string,offset) CHECK_AT((string),'\0',(offset))
+
+#define IS_Z(string) IS_Z_AT((string),0)
+
+/*
+ * Check if the character at the specified position is BOM.
+ */
+
+#define IS_BOM_AT(string,offset) \
+ (CHECK_AT((string),'\xEF',(offset)) \
+ && CHECK_AT((string),'\xBB',(offset)+1) \
+ && CHECK_AT((string),'\xBF',(offset)+2)) /* BOM (#xFEFF) */
+
+#define IS_BOM(string) IS_BOM_AT(string,0)
+
+/*
+ * Check if the character at the specified position is space.
+ */
+
+#define IS_SPACE_AT(string,offset) CHECK_AT((string),' ',(offset))
+
+#define IS_SPACE(string) IS_SPACE_AT((string),0)
+
+/*
+ * Check if the character at the specified position is tab.
+ */
+
+#define IS_TAB_AT(string,offset) CHECK_AT((string),'\t',(offset))
+
+#define IS_TAB(string) IS_TAB_AT((string),0)
+
+/*
+ * Check if the character at the specified position is blank (space or tab).
+ */
+
+#define IS_BLANK_AT(string,offset) \
+ (IS_SPACE_AT((string),(offset)) || IS_TAB_AT((string),(offset)))
+
+#define IS_BLANK(string) IS_BLANK_AT((string),0)
+
+/*
+ * Check if the character at the specified position is a line break.
+ */
+
+#define IS_BREAK_AT(string,offset) \
+ (CHECK_AT((string),'\r',(offset)) /* CR (#xD)*/ \
+ || CHECK_AT((string),'\n',(offset)) /* LF (#xA) */ \
+ || (CHECK_AT((string),'\xC2',(offset)) \
+ && CHECK_AT((string),'\x85',(offset)+1)) /* NEL (#x85) */ \
+ || (CHECK_AT((string),'\xE2',(offset)) \
+ && CHECK_AT((string),'\x80',(offset)+1) \
+ && CHECK_AT((string),'\xA8',(offset)+2)) /* LS (#x2028) */ \
+ || (CHECK_AT((string),'\xE2',(offset)) \
+ && CHECK_AT((string),'\x80',(offset)+1) \
+ && CHECK_AT((string),'\xA9',(offset)+2))) /* PS (#x2029) */
+
+#define IS_BREAK(string) IS_BREAK_AT((string),0)
+
+#define IS_CRLF_AT(string,offset) \
+ (CHECK_AT((string),'\r',(offset)) && CHECK_AT((string),'\n',(offset)+1))
+
+#define IS_CRLF(string) IS_CRLF_AT((string),0)
+
+/*
+ * Check if the character is a line break or NUL.
+ */
+
+#define IS_BREAKZ_AT(string,offset) \
+ (IS_BREAK_AT((string),(offset)) || IS_Z_AT((string),(offset)))
+
+#define IS_BREAKZ(string) IS_BREAKZ_AT((string),0)
+
+/*
+ * Check if the character is a line break, space, or NUL.
+ */
+
+#define IS_SPACEZ_AT(string,offset) \
+ (IS_SPACE_AT((string),(offset)) || IS_BREAKZ_AT((string),(offset)))
+
+#define IS_SPACEZ(string) IS_SPACEZ_AT((string),0)
+
+/*
+ * Check if the character is a line break, space, tab, or NUL.
+ */
+
+#define IS_BLANKZ_AT(string,offset) \
+ (IS_BLANK_AT((string),(offset)) || IS_BREAKZ_AT((string),(offset)))
+
+#define IS_BLANKZ(string) IS_BLANKZ_AT((string),0)
+
+/*
+ * Determine the width of the character.
+ */
+
+#define WIDTH_AT(string,offset) \
+ (((string).pointer[offset] & 0x80) == 0x00 ? 1 : \
+ ((string).pointer[offset] & 0xE0) == 0xC0 ? 2 : \
+ ((string).pointer[offset] & 0xF0) == 0xE0 ? 3 : \
+ ((string).pointer[offset] & 0xF8) == 0xF0 ? 4 : 0)
+
+#define WIDTH(string) WIDTH_AT((string),0)
+
+/*
+ * Move the string pointer to the next character.
+ */
+
+#define MOVE(string) ((string).pointer += WIDTH((string)))
+
+/*
+ * Copy a character and move the pointers of both strings.
+ */
+
+#define COPY(string_a,string_b) \
+ ((*(string_b).pointer & 0x80) == 0x00 ? \
+ (*((string_a).pointer++) = *((string_b).pointer++)) : \
+ (*(string_b).pointer & 0xE0) == 0xC0 ? \
+ (*((string_a).pointer++) = *((string_b).pointer++), \
+ *((string_a).pointer++) = *((string_b).pointer++)) : \
+ (*(string_b).pointer & 0xF0) == 0xE0 ? \
+ (*((string_a).pointer++) = *((string_b).pointer++), \
+ *((string_a).pointer++) = *((string_b).pointer++), \
+ *((string_a).pointer++) = *((string_b).pointer++)) : \
+ (*(string_b).pointer & 0xF8) == 0xF0 ? \
+ (*((string_a).pointer++) = *((string_b).pointer++), \
+ *((string_a).pointer++) = *((string_b).pointer++), \
+ *((string_a).pointer++) = *((string_b).pointer++), \
+ *((string_a).pointer++) = *((string_b).pointer++)) : 0)
+
+/*
+ * Stack and queue management.
+ */
+
+YAML_DECLARE(int)
+yaml_stack_extend(void **start, void **top, void **end);
+
+YAML_DECLARE(int)
+yaml_queue_extend(void **start, void **head, void **tail, void **end);
+
+#define STACK_INIT(context,stack,size) \
+ (((stack).start = yaml_malloc((size)*sizeof(*(stack).start))) ? \
+ ((stack).top = (stack).start, \
+ (stack).end = (stack).start+(size), \
+ 1) : \
+ ((context)->error = YAML_MEMORY_ERROR, \
+ 0))
+
+#define STACK_DEL(context,stack) \
+ (yaml_free((stack).start), \
+ (stack).start = (stack).top = (stack).end = 0)
+
+#define STACK_EMPTY(context,stack) \
+ ((stack).start == (stack).top)
+
+#define PUSH(context,stack,value) \
+ (((stack).top != (stack).end \
+ || yaml_stack_extend((void **)&(stack).start, \
+ (void **)&(stack).top, (void **)&(stack).end)) ? \
+ (*((stack).top++) = value, \
+ 1) : \
+ ((context)->error = YAML_MEMORY_ERROR, \
+ 0))
+
+#define POP(context,stack) \
+ (*(--(stack).top))
+
+#define QUEUE_INIT(context,queue,size) \
+ (((queue).start = yaml_malloc((size)*sizeof(*(queue).start))) ? \
+ ((queue).head = (queue).tail = (queue).start, \
+ (queue).end = (queue).start+(size), \
+ 1) : \
+ ((context)->error = YAML_MEMORY_ERROR, \
+ 0))
+
+#define QUEUE_DEL(context,queue) \
+ (yaml_free((queue).start), \
+ (queue).start = (queue).head = (queue).tail = (queue).end = 0)
+
+#define QUEUE_EMPTY(context,queue) \
+ ((queue).head == (queue).tail)
+
+#define ENQUEUE(context,queue,value) \
+ (((queue).tail != (queue).end \
+ || yaml_queue_extend((void **)&(queue).start, (void **)&(queue).head, \
+ (void **)&(queue).tail, (void **)&(queue).end)) ? \
+ (*((queue).tail++) = value, \
+ 1) : \
+ ((context)->error = YAML_MEMORY_ERROR, \
+ 0))
+
+#define DEQUEUE(context,queue) \
+ (*((queue).head++))
+
+#define QUEUE_INSERT(context,queue,index,value) \
+ (((queue).tail != (queue).end \
+ || yaml_queue_extend((void **)&(queue).start, (void **)&(queue).head, \
+ (void **)&(queue).tail, (void **)&(queue).end)) ? \
+ (memmove((queue).head+(index)+1,(queue).head+(index), \
+ ((queue).tail-(queue).head-(index))*sizeof(*(queue).start)), \
+ *((queue).head+(index)) = value, \
+ (queue).tail++, \
+ 1) : \
+ ((context)->error = YAML_MEMORY_ERROR, \
+ 0))
+
+/*
+ * Token initializers.
+ */
+
+#define TOKEN_INIT(token,token_type,token_start_mark,token_end_mark) \
+ (memset(&(token), 0, sizeof(yaml_token_t)), \
+ (token).type = (token_type), \
+ (token).start_mark = (token_start_mark), \
+ (token).end_mark = (token_end_mark))
+
+#define STREAM_START_TOKEN_INIT(token,token_encoding,start_mark,end_mark) \
+ (TOKEN_INIT((token),YAML_STREAM_START_TOKEN,(start_mark),(end_mark)), \
+ (token).data.stream_start.encoding = (token_encoding))
+
+#define STREAM_END_TOKEN_INIT(token,start_mark,end_mark) \
+ (TOKEN_INIT((token),YAML_STREAM_END_TOKEN,(start_mark),(end_mark)))
+
+#define ALIAS_TOKEN_INIT(token,token_value,start_mark,end_mark) \
+ (TOKEN_INIT((token),YAML_ALIAS_TOKEN,(start_mark),(end_mark)), \
+ (token).data.alias.value = (token_value))
+
+#define ANCHOR_TOKEN_INIT(token,token_value,start_mark,end_mark) \
+ (TOKEN_INIT((token),YAML_ANCHOR_TOKEN,(start_mark),(end_mark)), \
+ (token).data.anchor.value = (token_value))
+
+#define TAG_TOKEN_INIT(token,token_handle,token_suffix,start_mark,end_mark) \
+ (TOKEN_INIT((token),YAML_TAG_TOKEN,(start_mark),(end_mark)), \
+ (token).data.tag.handle = (token_handle), \
+ (token).data.tag.suffix = (token_suffix))
+
+#define SCALAR_TOKEN_INIT(token,token_value,token_length,token_style,start_mark,end_mark) \
+ (TOKEN_INIT((token),YAML_SCALAR_TOKEN,(start_mark),(end_mark)), \
+ (token).data.scalar.value = (token_value), \
+ (token).data.scalar.length = (token_length), \
+ (token).data.scalar.style = (token_style))
+
+#define VERSION_DIRECTIVE_TOKEN_INIT(token,token_major,token_minor,start_mark,end_mark) \
+ (TOKEN_INIT((token),YAML_VERSION_DIRECTIVE_TOKEN,(start_mark),(end_mark)), \
+ (token).data.version_directive.major = (token_major), \
+ (token).data.version_directive.minor = (token_minor))
+
+#define TAG_DIRECTIVE_TOKEN_INIT(token,token_handle,token_prefix,start_mark,end_mark) \
+ (TOKEN_INIT((token),YAML_TAG_DIRECTIVE_TOKEN,(start_mark),(end_mark)), \
+ (token).data.tag_directive.handle = (token_handle), \
+ (token).data.tag_directive.prefix = (token_prefix))
+
+/*
+ * Event initializers.
+ */
+
+#define EVENT_INIT(event,event_type,event_start_mark,event_end_mark) \
+ (memset(&(event), 0, sizeof(yaml_event_t)), \
+ (event).type = (event_type), \
+ (event).start_mark = (event_start_mark), \
+ (event).end_mark = (event_end_mark))
+
+#define STREAM_START_EVENT_INIT(event,event_encoding,start_mark,end_mark) \
+ (EVENT_INIT((event),YAML_STREAM_START_EVENT,(start_mark),(end_mark)), \
+ (event).data.stream_start.encoding = (event_encoding))
+
+#define STREAM_END_EVENT_INIT(event,start_mark,end_mark) \
+ (EVENT_INIT((event),YAML_STREAM_END_EVENT,(start_mark),(end_mark)))
+
+#define DOCUMENT_START_EVENT_INIT(event,event_version_directive, \
+ event_tag_directives_start,event_tag_directives_end,event_implicit,start_mark,end_mark) \
+ (EVENT_INIT((event),YAML_DOCUMENT_START_EVENT,(start_mark),(end_mark)), \
+ (event).data.document_start.version_directive = (event_version_directive), \
+ (event).data.document_start.tag_directives.start = (event_tag_directives_start), \
+ (event).data.document_start.tag_directives.end = (event_tag_directives_end), \
+ (event).data.document_start.implicit = (event_implicit))
+
+#define DOCUMENT_END_EVENT_INIT(event,event_implicit,start_mark,end_mark) \
+ (EVENT_INIT((event),YAML_DOCUMENT_END_EVENT,(start_mark),(end_mark)), \
+ (event).data.document_end.implicit = (event_implicit))
+
+#define ALIAS_EVENT_INIT(event,event_anchor,start_mark,end_mark) \
+ (EVENT_INIT((event),YAML_ALIAS_EVENT,(start_mark),(end_mark)), \
+ (event).data.alias.anchor = (event_anchor))
+
+#define SCALAR_EVENT_INIT(event,event_anchor,event_tag,event_value,event_length, \
+ event_plain_implicit, event_quoted_implicit,event_style,start_mark,end_mark) \
+ (EVENT_INIT((event),YAML_SCALAR_EVENT,(start_mark),(end_mark)), \
+ (event).data.scalar.anchor = (event_anchor), \
+ (event).data.scalar.tag = (event_tag), \
+ (event).data.scalar.value = (event_value), \
+ (event).data.scalar.length = (event_length), \
+ (event).data.scalar.plain_implicit = (event_plain_implicit), \
+ (event).data.scalar.quoted_implicit = (event_quoted_implicit), \
+ (event).data.scalar.style = (event_style))
+
+#define SEQUENCE_START_EVENT_INIT(event,event_anchor,event_tag, \
+ event_implicit,event_style,start_mark,end_mark) \
+ (EVENT_INIT((event),YAML_SEQUENCE_START_EVENT,(start_mark),(end_mark)), \
+ (event).data.sequence_start.anchor = (event_anchor), \
+ (event).data.sequence_start.tag = (event_tag), \
+ (event).data.sequence_start.implicit = (event_implicit), \
+ (event).data.sequence_start.style = (event_style))
+
+#define SEQUENCE_END_EVENT_INIT(event,start_mark,end_mark) \
+ (EVENT_INIT((event),YAML_SEQUENCE_END_EVENT,(start_mark),(end_mark)))
+
+#define MAPPING_START_EVENT_INIT(event,event_anchor,event_tag, \
+ event_implicit,event_style,start_mark,end_mark) \
+ (EVENT_INIT((event),YAML_MAPPING_START_EVENT,(start_mark),(end_mark)), \
+ (event).data.mapping_start.anchor = (event_anchor), \
+ (event).data.mapping_start.tag = (event_tag), \
+ (event).data.mapping_start.implicit = (event_implicit), \
+ (event).data.mapping_start.style = (event_style))
+
+#define MAPPING_END_EVENT_INIT(event,start_mark,end_mark) \
+ (EVENT_INIT((event),YAML_MAPPING_END_EVENT,(start_mark),(end_mark)))
+
+/*
+ * Document initializer.
+ */
+
+#define DOCUMENT_INIT(document,document_nodes_start,document_nodes_end, \
+ document_version_directive,document_tag_directives_start, \
+ document_tag_directives_end,document_start_implicit, \
+ document_end_implicit,document_start_mark,document_end_mark) \
+ (memset(&(document), 0, sizeof(yaml_document_t)), \
+ (document).nodes.start = (document_nodes_start), \
+ (document).nodes.end = (document_nodes_end), \
+ (document).nodes.top = (document_nodes_start), \
+ (document).version_directive = (document_version_directive), \
+ (document).tag_directives.start = (document_tag_directives_start), \
+ (document).tag_directives.end = (document_tag_directives_end), \
+ (document).start_implicit = (document_start_implicit), \
+ (document).end_implicit = (document_end_implicit), \
+ (document).start_mark = (document_start_mark), \
+ (document).end_mark = (document_end_mark))
+
+/*
+ * Node initializers.
+ */
+
+#define NODE_INIT(node,node_type,node_tag,node_start_mark,node_end_mark) \
+ (memset(&(node), 0, sizeof(yaml_node_t)), \
+ (node).type = (node_type), \
+ (node).tag = (node_tag), \
+ (node).start_mark = (node_start_mark), \
+ (node).end_mark = (node_end_mark))
+
+#define SCALAR_NODE_INIT(node,node_tag,node_value,node_length, \
+ node_style,start_mark,end_mark) \
+ (NODE_INIT((node),YAML_SCALAR_NODE,(node_tag),(start_mark),(end_mark)), \
+ (node).data.scalar.value = (node_value), \
+ (node).data.scalar.length = (node_length), \
+ (node).data.scalar.style = (node_style))
+
+#define SEQUENCE_NODE_INIT(node,node_tag,node_items_start,node_items_end, \
+ node_style,start_mark,end_mark) \
+ (NODE_INIT((node),YAML_SEQUENCE_NODE,(node_tag),(start_mark),(end_mark)), \
+ (node).data.sequence.items.start = (node_items_start), \
+ (node).data.sequence.items.end = (node_items_end), \
+ (node).data.sequence.items.top = (node_items_start), \
+ (node).data.sequence.style = (node_style))
+
+#define MAPPING_NODE_INIT(node,node_tag,node_pairs_start,node_pairs_end, \
+ node_style,start_mark,end_mark) \
+ (NODE_INIT((node),YAML_MAPPING_NODE,(node_tag),(start_mark),(end_mark)), \
+ (node).data.mapping.pairs.start = (node_pairs_start), \
+ (node).data.mapping.pairs.end = (node_pairs_end), \
+ (node).data.mapping.pairs.top = (node_pairs_start), \
+ (node).data.mapping.style = (node_style))
+
diff --git a/ext/pty/extconf.rb b/ext/pty/extconf.rb
index 3d6d0f1e46..1db9f6e8aa 100644
--- a/ext/pty/extconf.rb
+++ b/ext/pty/extconf.rb
@@ -1,6 +1,8 @@
require 'mkmf'
-if /mswin|mingw|bccwin/ !~ RUBY_PLATFORM
+$INCFLAGS << " -I$(topdir) -I$(top_srcdir)"
+
+if /mswin|mingw|bccwin|nacl/ !~ RUBY_PLATFORM
have_header("sys/stropts.h")
have_func("setresuid")
have_header("libutil.h")
diff --git a/ext/pty/lib/expect.rb b/ext/pty/lib/expect.rb
index 0b238af8be..c15044bd2a 100644
--- a/ext/pty/lib/expect.rb
+++ b/ext/pty/lib/expect.rb
@@ -1,12 +1,14 @@
$expect_verbose = false
class IO
- # Reads ios until pattern matches or the timeout is over. It returns
- # an array with the read buffer, followed by the matches. If a block is given,
- # the result is yielded to the block and returns nil. The optional timeout parameter defines,
- # in seconds, the total time to wait for pattern. If it is over of eof is found, it
- # returns/yields nil. However, the buffer in a timeout session is kept for the next expect call.
- # The default timeout is 9999999 seconds.
+ # Reads from the IO until pattern +pat+ matches or the +timeout+ is over.
+ # It returns an array with the read buffer, followed by the matches.
+ # If a block is given, the result is yielded to the block and returns nil.
+ #
+ # The optional timeout parameter defines, in seconds, the total time to wait
+ # for the pattern. If the timeout expires or eof is found, nil is returned
+ # or yielded. However, the buffer in a timeout session is kept for the next
+ # expect call. The default timeout is 9999999 seconds.
def expect(pat,timeout=9999999)
buf = ''
case pat
diff --git a/ext/pty/pty.c b/ext/pty/pty.c
index 3797972975..7ea2e1aaf5 100644
--- a/ext/pty/pty.c
+++ b/ext/pty/pty.c
@@ -32,6 +32,7 @@
#include "ruby/ruby.h"
#include "ruby/io.h"
#include "ruby/util.h"
+#include "internal.h"
#include <signal.h>
#ifdef HAVE_SYS_STROPTS_H
@@ -44,70 +45,6 @@
#define DEVICELEN 16
-#if !defined(HAVE_OPENPTY)
-#if defined(__hpux)
-static const
-char MasterDevice[] = "/dev/ptym/pty%s",
- SlaveDevice[] = "/dev/pty/tty%s",
- *const deviceNo[] = {
- "p0","p1","p2","p3","p4","p5","p6","p7",
- "p8","p9","pa","pb","pc","pd","pe","pf",
- "q0","q1","q2","q3","q4","q5","q6","q7",
- "q8","q9","qa","qb","qc","qd","qe","qf",
- "r0","r1","r2","r3","r4","r5","r6","r7",
- "r8","r9","ra","rb","rc","rd","re","rf",
- "s0","s1","s2","s3","s4","s5","s6","s7",
- "s8","s9","sa","sb","sc","sd","se","sf",
- "t0","t1","t2","t3","t4","t5","t6","t7",
- "t8","t9","ta","tb","tc","td","te","tf",
- "u0","u1","u2","u3","u4","u5","u6","u7",
- "u8","u9","ua","ub","uc","ud","ue","uf",
- "v0","v1","v2","v3","v4","v5","v6","v7",
- "v8","v9","va","vb","vc","vd","ve","vf",
- "w0","w1","w2","w3","w4","w5","w6","w7",
- "w8","w9","wa","wb","wc","wd","we","wf",
- 0,
- };
-#elif defined(_IBMESA) /* AIX/ESA */
-static const
-char MasterDevice[] = "/dev/ptyp%s",
- SlaveDevice[] = "/dev/ttyp%s",
- *const deviceNo[] = {
-"00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f",
-"10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f",
-"20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f",
-"30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f",
-"40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f",
-"50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f",
-"60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f",
-"70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f",
-"80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f",
-"90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f",
-"a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af",
-"b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf",
-"c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf",
-"d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df",
-"e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef",
-"f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff",
- };
-#elif !defined(HAVE_PTSNAME)
-static const
-char MasterDevice[] = "/dev/pty%s",
- SlaveDevice[] = "/dev/tty%s",
- *const deviceNo[] = {
- "p0","p1","p2","p3","p4","p5","p6","p7",
- "p8","p9","pa","pb","pc","pd","pe","pf",
- "q0","q1","q2","q3","q4","q5","q6","q7",
- "q8","q9","qa","qb","qc","qd","qe","qf",
- "r0","r1","r2","r3","r4","r5","r6","r7",
- "r8","r9","ra","rb","rc","rd","re","rf",
- "s0","s1","s2","s3","s4","s5","s6","s7",
- "s8","s9","sa","sb","sc","sd","se","sf",
- 0,
- };
-#endif
-#endif /* !defined(HAVE_OPENPTY) */
-
#ifndef HAVE_SETEUID
# ifdef HAVE_SETREUID
# define seteuid(e) setreuid(-1, (e))
@@ -141,8 +78,8 @@ static void getDevice(int*, int*, char [DEVICELEN], int);
struct child_info {
int master, slave;
char *slavename;
- int argc;
- VALUE *argv;
+ VALUE execarg_obj;
+ struct rb_execarg *eargp;
};
static int
@@ -151,16 +88,12 @@ chfunc(void *data, char *errbuf, size_t errbuf_len)
struct child_info *carg = data;
int master = carg->master;
int slave = carg->slave;
- int argc = carg->argc;
- VALUE *argv = carg->argv;
#define ERROR_EXIT(str) do { \
strlcpy(errbuf, (str), errbuf_len); \
return -1; \
} while (0)
- rb_thread_atfork_before_exec();
-
/*
* Set free from process group and controlling terminal
*/
@@ -175,7 +108,7 @@ chfunc(void *data, char *errbuf, size_t errbuf_len)
if (setpgrp(0, getpid()) == -1)
ERROR_EXIT("setpgrp()");
{
- int i = open("/dev/tty", O_RDONLY);
+ int i = rb_cloexec_open("/dev/tty", O_RDONLY, 0);
if (i < 0) ERROR_EXIT("/dev/tty");
rb_update_max_fd(i);
if (ioctl(i, TIOCNOTTY, (char *)0))
@@ -195,7 +128,7 @@ chfunc(void *data, char *errbuf, size_t errbuf_len)
/* errors ignored for sun */
#else
close(slave);
- slave = open(carg->slavename, O_RDWR);
+ slave = rb_cloexec_open(carg->slavename, O_RDWR, 0);
if (slave < 0) {
ERROR_EXIT("open: pty slave");
}
@@ -210,8 +143,7 @@ chfunc(void *data, char *errbuf, size_t errbuf_len)
seteuid(getuid());
#endif
- rb_f_exec(argc, argv);
- return 0;
+ return rb_exec_async_signal_safe(carg->eargp, errbuf, sizeof(errbuf_len));
#undef ERROR_EXIT
}
@@ -219,7 +151,7 @@ static void
establishShell(int argc, VALUE *argv, struct pty_info *info,
char SlaveName[DEVICELEN])
{
- int master,slave;
+ int master, slave, status = 0;
rb_pid_t pid;
char *p, *getenv();
struct passwd *pwent;
@@ -245,21 +177,24 @@ establishShell(int argc, VALUE *argv, struct pty_info *info,
argv = &v;
}
+ carg.execarg_obj = rb_execarg_new(argc, argv, 1);
+ carg.eargp = rb_execarg_get(carg.execarg_obj);
+ rb_execarg_fixup(carg.execarg_obj);
+
getDevice(&master, &slave, SlaveName, 0);
carg.master = master;
carg.slave = slave;
carg.slavename = SlaveName;
- carg.argc = argc;
- carg.argv = argv;
errbuf[0] = '\0';
- pid = rb_fork_err(0, chfunc, &carg, Qnil, errbuf, sizeof(errbuf));
+ pid = rb_fork_async_signal_safe(&status, chfunc, &carg, Qnil, errbuf, sizeof(errbuf));
if (pid < 0) {
int e = errno;
close(master);
close(slave);
errno = e;
+ if (status) rb_jump_tag(status);
rb_sys_fail(errbuf[0] ? errbuf : "fork failed");
}
@@ -267,6 +202,8 @@ establishShell(int argc, VALUE *argv, struct pty_info *info,
info->child_pid = pid;
info->fd = master;
+
+ RB_GC_GUARD(carg.execarg_obj);
}
static int
@@ -282,6 +219,7 @@ static int
get_device_once(int *master, int *slave, char SlaveName[DEVICELEN], int nomesg, int fail)
{
#if defined(HAVE_POSIX_OPENPT)
+ /* Unix98 PTY */
int masterfd = -1, slavefd = -1;
char *slavedevice;
struct sigaction dfl, old;
@@ -290,18 +228,37 @@ get_device_once(int *master, int *slave, char SlaveName[DEVICELEN], int nomesg,
dfl.sa_flags = 0;
sigemptyset(&dfl.sa_mask);
+#if defined(__sun) || defined(__FreeBSD__)
+ /* workaround for Solaris 10: grantpt() doesn't work if FD_CLOEXEC is set. [ruby-dev:44688] */
+ /* FreeBSD 8 supported O_CLOEXEC for posix_openpt, but FreeBSD 9 removed it.
+ * http://www.freebsd.org/cgi/query-pr.cgi?pr=162374 */
if ((masterfd = posix_openpt(O_RDWR|O_NOCTTY)) == -1) goto error;
- rb_update_max_fd(masterfd);
if (sigaction(SIGCHLD, &dfl, &old) == -1) goto error;
if (grantpt(masterfd) == -1) goto grantpt_error;
+ rb_fd_fix_cloexec(masterfd);
+#else
+ {
+ int flags = O_RDWR|O_NOCTTY;
+# if defined(O_CLOEXEC)
+ /* glibc posix_openpt() in GNU/Linux calls open("/dev/ptmx", flags) internally.
+ * So version dependency on GNU/Linux is same as O_CLOEXEC with open().
+ * O_CLOEXEC is available since Linux 2.6.23. Linux 2.6.18 silently ignore it. */
+ flags |= O_CLOEXEC;
+# endif
+ if ((masterfd = posix_openpt(flags)) == -1) goto error;
+ }
+ rb_fd_fix_cloexec(masterfd);
+ if (sigaction(SIGCHLD, &dfl, &old) == -1) goto error;
+ if (grantpt(masterfd) == -1) goto grantpt_error;
+#endif
if (sigaction(SIGCHLD, &old, NULL) == -1) goto error;
if (unlockpt(masterfd) == -1) goto error;
if ((slavedevice = ptsname(masterfd)) == NULL) goto error;
if (no_mesg(slavedevice, nomesg) == -1) goto error;
- if ((slavefd = open(slavedevice, O_RDWR|O_NOCTTY, 0)) == -1) goto error;
+ if ((slavefd = rb_cloexec_open(slavedevice, O_RDWR|O_NOCTTY, 0)) == -1) goto error;
rb_update_max_fd(slavefd);
-#if defined I_PUSH && !defined linux
+#if defined(I_PUSH) && !defined(__linux__)
if (ioctl(slavefd, I_PUSH, "ptem") == -1) goto error;
if (ioctl(slavefd, I_PUSH, "ldterm") == -1) goto error;
if (ioctl(slavefd, I_PUSH, "ttcompat") == -1) goto error;
@@ -331,8 +288,8 @@ get_device_once(int *master, int *slave, char SlaveName[DEVICELEN], int nomesg,
if (!fail) return -1;
rb_raise(rb_eRuntimeError, "openpty() failed");
}
- rb_update_max_fd(*master);
- rb_update_max_fd(*slave);
+ rb_fd_fix_cloexec(*master);
+ rb_fd_fix_cloexec(*slave);
if (no_mesg(SlaveName, nomesg) == -1) {
if (!fail) return -1;
rb_raise(rb_eRuntimeError, "can't chmod slave pty");
@@ -341,6 +298,7 @@ get_device_once(int *master, int *slave, char SlaveName[DEVICELEN], int nomesg,
return 0;
#elif defined HAVE__GETPTY
+ /* SGI IRIX */
char *name;
mode_t mode = nomesg ? 0600 : 0622;
@@ -348,15 +306,16 @@ get_device_once(int *master, int *slave, char SlaveName[DEVICELEN], int nomesg,
if (!fail) return -1;
rb_raise(rb_eRuntimeError, "_getpty() failed");
}
- rb_update_max_fd(*master);
+ rb_fd_fix_cloexec(*master);
- *slave = open(name, O_RDWR);
+ *slave = rb_cloexec_open(name, O_RDWR, 0);
/* error check? */
rb_update_max_fd(*slave);
strlcpy(SlaveName, name, DEVICELEN);
return 0;
#elif defined(HAVE_PTSNAME)
+ /* System V */
int masterfd = -1, slavefd = -1;
char *slavedevice;
void (*s)();
@@ -365,17 +324,25 @@ get_device_once(int *master, int *slave, char SlaveName[DEVICELEN], int nomesg,
extern int unlockpt(int);
extern int grantpt(int);
+#if defined(__sun)
+ /* workaround for Solaris 10: grantpt() doesn't work if FD_CLOEXEC is set. [ruby-dev:44688] */
if((masterfd = open("/dev/ptmx", O_RDWR, 0)) == -1) goto error;
+ s = signal(SIGCHLD, SIG_DFL);
+ if(grantpt(masterfd) == -1) goto error;
+ rb_fd_fix_cloexec(masterfd);
+#else
+ if((masterfd = rb_cloexec_open("/dev/ptmx", O_RDWR, 0)) == -1) goto error;
rb_update_max_fd(masterfd);
s = signal(SIGCHLD, SIG_DFL);
if(grantpt(masterfd) == -1) goto error;
+#endif
signal(SIGCHLD, s);
if(unlockpt(masterfd) == -1) goto error;
if((slavedevice = ptsname(masterfd)) == NULL) goto error;
if (no_mesg(slavedevice, nomesg) == -1) goto error;
- if((slavefd = open(slavedevice, O_RDWR, 0)) == -1) goto error;
+ if((slavefd = rb_cloexec_open(slavedevice, O_RDWR, 0)) == -1) goto error;
rb_update_max_fd(slavefd);
-#if defined I_PUSH && !defined linux
+#if defined(I_PUSH) && !defined(__linux__)
if(ioctl(slavefd, I_PUSH, "ptem") == -1) goto error;
if(ioctl(slavefd, I_PUSH, "ldterm") == -1) goto error;
ioctl(slavefd, I_PUSH, "ttcompat");
@@ -391,17 +358,77 @@ get_device_once(int *master, int *slave, char SlaveName[DEVICELEN], int nomesg,
if (fail) rb_raise(rb_eRuntimeError, "can't get Master/Slave device");
return -1;
#else
+ /* BSD */
int masterfd = -1, slavefd = -1;
const char *const *p;
char MasterName[DEVICELEN];
+#if defined(__hpux)
+ static const char MasterDevice[] = "/dev/ptym/pty%s";
+ static const char SlaveDevice[] = "/dev/pty/tty%s";
+ static const char *const deviceNo[] = {
+ "p0","p1","p2","p3","p4","p5","p6","p7",
+ "p8","p9","pa","pb","pc","pd","pe","pf",
+ "q0","q1","q2","q3","q4","q5","q6","q7",
+ "q8","q9","qa","qb","qc","qd","qe","qf",
+ "r0","r1","r2","r3","r4","r5","r6","r7",
+ "r8","r9","ra","rb","rc","rd","re","rf",
+ "s0","s1","s2","s3","s4","s5","s6","s7",
+ "s8","s9","sa","sb","sc","sd","se","sf",
+ "t0","t1","t2","t3","t4","t5","t6","t7",
+ "t8","t9","ta","tb","tc","td","te","tf",
+ "u0","u1","u2","u3","u4","u5","u6","u7",
+ "u8","u9","ua","ub","uc","ud","ue","uf",
+ "v0","v1","v2","v3","v4","v5","v6","v7",
+ "v8","v9","va","vb","vc","vd","ve","vf",
+ "w0","w1","w2","w3","w4","w5","w6","w7",
+ "w8","w9","wa","wb","wc","wd","we","wf",
+ 0
+ };
+#elif defined(_IBMESA) /* AIX/ESA */
+ static const char MasterDevice[] = "/dev/ptyp%s";
+ static const char SlaveDevice[] = "/dev/ttyp%s";
+ static const char *const deviceNo[] = {
+ "00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f",
+ "10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f",
+ "20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f",
+ "30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f",
+ "40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f",
+ "50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f",
+ "60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f",
+ "70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f",
+ "80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f",
+ "90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f",
+ "a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af",
+ "b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf",
+ "c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf",
+ "d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df",
+ "e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef",
+ "f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff",
+ 0
+ };
+#else /* 4.2BSD */
+ static const char MasterDevice[] = "/dev/pty%s";
+ static const char SlaveDevice[] = "/dev/tty%s";
+ static const char *const deviceNo[] = {
+ "p0","p1","p2","p3","p4","p5","p6","p7",
+ "p8","p9","pa","pb","pc","pd","pe","pf",
+ "q0","q1","q2","q3","q4","q5","q6","q7",
+ "q8","q9","qa","qb","qc","qd","qe","qf",
+ "r0","r1","r2","r3","r4","r5","r6","r7",
+ "r8","r9","ra","rb","rc","rd","re","rf",
+ "s0","s1","s2","s3","s4","s5","s6","s7",
+ "s8","s9","sa","sb","sc","sd","se","sf",
+ 0
+ };
+#endif
for (p = deviceNo; *p != NULL; p++) {
snprintf(MasterName, sizeof MasterName, MasterDevice, *p);
- if ((masterfd = open(MasterName,O_RDWR,0)) >= 0) {
+ if ((masterfd = rb_cloexec_open(MasterName,O_RDWR,0)) >= 0) {
rb_update_max_fd(masterfd);
*master = masterfd;
snprintf(SlaveName, DEVICELEN, SlaveDevice, *p);
- if ((slavefd = open(SlaveName,O_RDWR,0)) >= 0) {
+ if ((slavefd = rb_cloexec_open(SlaveName,O_RDWR,0)) >= 0) {
rb_update_max_fd(slavefd);
*slave = slavefd;
if (chown(SlaveName, getuid(), getgid()) != 0) goto error;
@@ -436,7 +463,7 @@ pty_close_pty(VALUE assoc)
for (i = 0; i < 2; i++) {
io = rb_ary_entry(assoc, i);
- if (TYPE(io) == T_FILE && 0 <= RFILE(io)->fptr->fd)
+ if (RB_TYPE_P(io, T_FILE) && 0 <= RFILE(io)->fptr->fd)
rb_io_close(io);
}
return Qnil;
@@ -587,7 +614,7 @@ pty_getpty(int argc, VALUE *argv, VALUE self)
rfptr->pathv = rb_obj_freeze(rb_str_new_cstr(SlaveName));
wfptr->mode = rb_io_mode_flags("w") | FMODE_SYNC;
- wfptr->fd = dup(info.fd);
+ wfptr->fd = rb_cloexec_dup(info.fd);
if (wfptr->fd == -1)
rb_sys_fail("dup()");
rb_update_max_fd(wfptr->fd);
@@ -605,6 +632,7 @@ pty_getpty(int argc, VALUE *argv, VALUE self)
return res;
}
+NORETURN(static void raise_from_check(pid_t pid, int status));
static void
raise_from_check(pid_t pid, int status)
{
@@ -658,11 +686,12 @@ pty_check(int argc, VALUE *argv, VALUE self)
rb_scan_args(argc, argv, "11", &pid, &exc);
cpid = rb_waitpid(NUM2PIDT(pid), &status, WNOHANG|WUNTRACED);
- if (cpid == -1) return Qnil;
+ if (cpid == -1 || cpid == 0) return Qnil;
if (!RTEST(exc)) return rb_last_status_get();
raise_from_check(cpid, status);
- return Qnil; /* not reached */
+
+ UNREACHABLE;
}
static VALUE cPTY;
diff --git a/ext/racc/cparse/cparse.c b/ext/racc/cparse/cparse.c
index 3a2a8ae74e..10a9a030ac 100644
--- a/ext/racc/cparse/cparse.c
+++ b/ext/racc/cparse/cparse.c
@@ -416,7 +416,7 @@ extract_user_token(struct cparse_params *v, VALUE block_args,
return;
}
- if (TYPE(block_args) != T_ARRAY) {
+ if (!RB_TYPE_P(block_args, T_ARRAY)) {
rb_raise(rb_eTypeError,
"%s() %s %s (must be Array[2])",
v->lex_is_iterator ? rb_id2name(v->lexmid) : "next_token",
diff --git a/ext/readline/README.ja b/ext/readline/README.ja
index 77ec55c3aa..f1b42f25bc 100644
--- a/ext/readline/README.ja
+++ b/ext/readline/README.ja
@@ -1,20 +1,20 @@
-GNU Readline ˤ륳ޥɥ饤ϥ󥿥ե󶡤⥸塼
-ǤGNU Readline θߴ饤֥ΤҤȤĤǤ Edit Line(libedit)
-ݡȤƤޤ
+GNU Readline によるコマンドライン入力インタフェースを提供するモジュール
+です。GNU Readline の互換ライブラリのひとつである Edit Line(libedit) も
+サポートしています。
GNU Readline:: http://www.gnu.org/directory/readline.html
libedit:: http://www.thrysoee.dk/editline/
-Readline.readline Ѥƥ桼ϤǤޤΤȤ
-GNU Readline Τ褦Ϥ䴰Emacs Τ褦ʥʤɤǤޤ
+Readline.readline を使用してユーザからの入力を取得できます。このとき、
+GNU Readline のように入力の補完やEmacs のようなキー操作などができます。
require "readline"
while buf = Readline.readline("> ", true)
p buf
end
-桼ϤƤ(ʲҥȥ)ȤƵϿ뤳ȤǤޤ
- Readline::HISTORY Ѥƥҥȥ˥Ǥޤ
+ユーザが入力した内容を履歴(以下、ヒストリ)として記録することができます。
+定数 Readline::HISTORY を使用してヒストリにアクセスできます。
require "readline"
while buf = Readline.readline("> ", true)
@@ -22,40 +22,40 @@ GNU Readline Τ褦Ϥ䴰Emacs Τ褦ʥʤɤǤޤ
print("-> ", buf, "\n")
end
-Ѥ饤֥ˤꡢĤΥ᥽åɤ㳰 NotImplementedError
-ȯޤ
+使用するライブラリにより、いくつかのメソッドで例外 NotImplementedError
+が発生します。
-$SAFE 4 ξ硢¿Υ᥽åɤ㳰 SecurityError ȯޤ
+$SAFE が 4 の場合、多くのメソッドで例外 SecurityError が発生します。
-== Readline ⥸塼
+== Readline モジュール
-=== ⥸塼ؿ
+=== モジュール関数
readline([prompt, [add_hist]]) -> String | nil
- prompt Ϥ桼ΥϤԤޤ
- 󥿡βʤɤǥ桼ʸϤȡ
- Ϥʸ֤ޤ
- ΤȤadd_hist true ǤСϤʸҥȥɲäޤ
+ prompt を出力し、ユーザからのキー入力を待ちます。
+ エンターキーの押下などでユーザが文字列を入力し終えると、
+ 入力した文字列を返します。
+ このとき、add_hist が true であれば、入力した文字列をヒストリに追加します。
- ϤƤʤ֤ EOF(UNIX Ǥ ^D) Ϥʤɤǡ
- 桼Ϥʤ nil ֤ޤ
+ 何も入力していない状態で EOF(UNIX では ^D) を入力するなどで、
+ ユーザからの入力がない場合は nil を返します。
- ξ硢㳰 IOError ȯޤ
- 1. ɸϤ tty Ǥʤ
- 2. ɸϤ򥯥Ƥ롣(isatty(2) errno EBADF Ǥ롣)
+ 次の条件を全て満たす場合、例外 IOError が発生します。
+ 1. 標準入力が tty でない。
+ 2. 標準入力をクローズしている。(isatty(2) の errno が EBADF である。)
- ܥ᥽åɤϥåɤбƤޤ
- Ԥ֤ΤȤϥåɥƥȤؤȯޤ
+ 本メソッドはスレッドに対応しています。
+ 入力待ち状態のときはスレッドコンテキストの切替えが発生します。
- ϻˤϹԽǽǡvi ⡼ɤ Emacs ⡼ɤѰդƤޤ
- ǥեȤ Emacs ⡼ɤǤ
+ 入力時には行内編集が可能で、vi モードと Emacs モードが用意されています。
+ デフォルトは Emacs モードです。
- ܥ᥽åɤˤջबޤ
- Ԥξ֤ ^C ruby 󥿥ץ꥿λü֤ޤ
- 򤹤뤿3ĵ󤲤ޤ
+ 本メソッドには注意事項があります。
+ 入力待ちの状態で ^C すると ruby インタプリタが終了し、端末状態を復帰しません。
+ これを回避するための例を3つ挙げます。
- * ^CˤInterrupt㳰­ơü֤ޤ:
+ * ^CによるInterrupt例外を補足して、端末状態を復帰します:
require "readline"
@@ -71,7 +71,7 @@ readline([prompt, [add_hist]]) -> String | nil
end
end
- * INTʥ­ơü֤ޤ:
+ * INTシグナルを補足して、端末状態を復帰します:
require "readline"
@@ -82,7 +82,7 @@ readline([prompt, [add_hist]]) -> String | nil
p buf
end
- * ñ ^C ̵뤹ˡ⤢ޤ:
+ * 単に ^C を無視する方法もあります:
require "readline"
@@ -92,8 +92,8 @@ readline([prompt, [add_hist]]) -> String | nil
p buf
end
- Readline::HISTORY ѤơԤľϤƱƤ
- ˻ĤʤȤȤǤޤ
+ 入力履歴 Readline::HISTORY を使用して、空行や直前の入力と同じ内容は入力
+ 履歴に残さないということもできます。
require "readline"
@@ -112,287 +112,287 @@ readline([prompt, [add_hist]]) -> String | nil
print "-> ", buf, "\n"
end
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
+ $SAFE が 4 の場合、例外 SecurityError が発生します。
-=== 饹᥽å
+=== クラスメソッド
Readline.input = input
- Readline.readline ᥽åɤǻѤѤ File ֥ input
- ꤷޤ
+ Readline.readline メソッドで使用する入力用の File オブジェクト input
+ を指定します。
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
+ $SAFE が 4 の場合、例外 SecurityError が発生します。
Readline.output = output
- Readline.readline ᥽åɤǻѤѤ File ֥
- output ꤷޤ
+ Readline.readline メソッドで使用する出力用の File オブジェクト
+ output を指定します。
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
+ $SAFE が 4 の場合、例外 SecurityError が発生します。
Readline.completion_proc = proc
- 桼Ϥ䴰θ Proc ֥ proc
- ꤷޤproc ϡΤΤꤷƤޤ
- 1. call ᥽åɤޤ
- call ᥽åɤʤ硢㳰 ArgumentError ȯޤ
- 2. ˥桼ʸ(1)ޤ
- 3. ʸ֤ޤ
+ ユーザからの入力を補完する時の候補を取得する Proc オブジェクト proc を
+ 指定します。proc は、次のものを想定しています。
+ 1. call メソッドを持ちます。
+ call メソッドを持たない場合、例外 ArgumentError が発生します。
+ 2. 引数にユーザからの入力文字列(注1)を取ります。
+ 3. 候補の文字列の配列を返します。
- 1:/var/lib /vפθ䴰Ԥȡ
- ǥեȤǤ proc ΰˡ/vפϤޤ
- Τ褦ˡ桼Ϥʸ
- Readline.completer_word_break_characters ˴ޤޤʸǶڤä
- ΤñȤȡ뤬ñκǽʸ鸽ߤΥ
- ֤ޤǤʸ proc ΰϤޤ
+ 注1:「/var/lib /v」の後で補完を行うと、
+ デフォルトでは proc の引数に「/v」が渡されます。
+ このように、ユーザが入力した文字列を
+ Readline.completer_word_break_characters に含まれる文字で区切ったも
+ のを単語とすると、カーソルがある単語の最初の文字から現在のカーソル位
+ 置までの文字列が proc の引数に渡されます。
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
+ $SAFE が 4 の場合、例外 SecurityError が発生します。
Readline.completion_proc -> proc
- 桼Ϥ䴰θ Proc ֥ proc
- ޤ
+ ユーザからの入力を補完する時の候補を取得する Proc オブジェクト proc
+ を取得します。
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
+ $SAFE が 4 の場合、例外 SecurityError が発生します。
Readline.completion_case_fold = bool
- 桼Ϥ䴰ݡʸȾʸ̤롿ʤꤷޤ
- bool ʤж̤ޤbool ʤж̤ޤ
+ ユーザの入力を補完する際、大文字と小文字を区別する/しないを指定します。
+ bool が真ならば区別しません。bool が偽ならば区別します。
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
+ $SAFE が 4 の場合、例外 SecurityError が発生します。
Readline.completion_case_fold -> bool
- 桼Ϥ䴰ݡʸȾʸ̤롿ʤޤ
- bool ʤж̤ޤbool ʤж̤ޤ
+ ユーザの入力を補完する際、大文字と小文字を区別する/しないを取得します。
+ bool が真ならば区別しません。bool が偽ならば区別します。
- ʤReadline.completion_case_fold= ᥽åɤǻꤷ֥Ȥ
- Τޤ޼ΤǡΤ褦ư򤷤ޤ
+ なお、Readline.completion_case_fold= メソッドで指定したオブジェクトを
+ そのまま取得するので、次のような動作をします。
require "readline"
Readline.completion_case_fold = "This is a String."
p Readline.completion_case_fold # => "This is a String."
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
+ $SAFE が 4 の場合、例外 SecurityError が発生します。
Readline.line_buffer -> string
- ιΤ֤ޤcomplete_proc ǻѤ뤳Ȥꤷ
- ƤޤReadline.line_buffer Ĺ GNU Readline rl_end ѿ
- ͤȰפޤ
+ 入力中の行全体を返します。complete_proc の中で使用することを想定し
+ ています。Readline.line_buffer の長さは GNU Readline の rl_end 変数の
+ 値と一致します。
Readline.point -> int
- ߤΥΰ֤֤ޤ
- Readline ⥸塼䴰оݤñγϰ֤ξ󶡤Ƥޤ
- ʤ顢 completion_proc Ϥñ text
- Readline.point Ѥ뤳Ȥdzϰ֤ƳȤǤޤ
+ 現在のカーソルの位置を返します。
+ Readline モジュールは補完対象の単語の開始位置の情報を提供していません。
+ しかしながら、 completion_proc の中で入力した単語 text と
+ Readline.point を使用することで開始位置を導くことができます。
- ϰ = ϤñĹ - Readline.point
+ 開始位置 = 入力した単語の長さ - Readline.point
Readline.vi_editing_mode -> nil
- Խ⡼ɤ vi ⡼ɤˤޤ
- vi ⡼ɤξܺ٤ϡGNU Readline Υޥ˥奢򻲾ȤƤ
+ 編集モードを vi モードにします。
+ vi モードの詳細は、GNU Readline のマニュアルを参照してください。
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
+ サポートしていない環境では、例外 NotImplementedError が発生します。
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
+ $SAFE が 4 の場合、例外 SecurityError が発生します。
Readline.vi_editing_mode? -> bool
- Խ⡼ɤ vi ⡼ɤξ硢true ֤ޤǤʤ false
- ֤ޤ
+ 編集モードが vi モードの場合、true を返します。そうでなければ false
+ を返します。
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
+ サポートしていない環境では、例外 NotImplementedError が発生します。
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
+ $SAFE が 4 の場合、例外 SecurityError が発生します。
Readline.emacs_editing_mode -> nil
- Խ⡼ɤ Emacs ⡼ɤˤޤ
- ǥեȤ Emacs ⡼ɤǤ
- Emacs ⡼ɤξܺ٤ϡGNU Readline Υޥ˥奢򻲾ȤƤ
+ 編集モードを Emacs モードにします。
+ デフォルトは Emacs モードです。
+ Emacs モードの詳細は、GNU Readline のマニュアルを参照してください。
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
+ サポートしていない環境では、例外 NotImplementedError が発生します。
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
+ $SAFE が 4 の場合、例外 SecurityError が発生します。
Readline.emacs_editing_mode? -> bool
- Խ⡼ɤ Emacs ⡼ɤξ硢true ֤ޤǤʤ false
- ֤ޤ
+ 編集モードが Emacs モードの場合、true を返します。そうでなければ false
+ を返します。
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
+ サポートしていない環境では、例外 NotImplementedError が発生します。
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
+ $SAFE が 4 の場合、例外 SecurityError が発生します。
Readline.completion_append_character = char
- 桼Ϥ䴰λˡǸղäʸ char ꤷ
- ޤȾѥڡ" "פʤɤñڤʸꤹСϢ³
- ϤݤǤ
+ ユーザの入力の補完が完了した場合に、最後に付加する文字 char を指定し
+ ます。半角スペース「" "」などの単語を区切る文字を指定すれば、連続して
+ 入力する際に便利です。
- :
+ 使用例:
require "readline"
Readline.readline("> ", true)
Readline.completion_append_character = " "
- ¹:
+ 実行例:
>
- "/var/li" Ϥޤ
+ ここで "/var/li" を入力します。
> /var/li
- TAB Ϥޤ
+ ここで TAB キーを入力します。
> /var/lib
- "b" 䴰졢Ǹ " " ɲäΤǡ"/usr" Ϣ³ϤǤޤ
+ "b" が補完され、最後に " " が追加されるので、"/usr" を連続して入力できます。
> /var/lib /usr
- ʤ1ʸꤹ뤳ȤϤǤޤ
- 㤨С"string"ꤷϺǽʸǤ"s"Ѥޤ
+ なお、1文字しか指定することはできません。
+ 例えば、"string"を指定した場合は最初の文字である"s"だけを使用します。
require "readline"
Readline.completion_append_character = "string"
p Readline.completion_append_character # => "s"
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
+ サポートしていない環境では、例外 NotImplementedError が発生します。
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
+ $SAFE が 4 の場合、例外 SecurityError が発生します。
Readline.completion_append_character -> char
- 桼Ϥ䴰λˡǸղäʸޤ
- ǥեȤ϶ (" ") Ǥ
+ ユーザの入力の補完が完了した場合に、最後に付加する文字を取得します。
+ デフォルトは空白 (" ") です。
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
+ サポートしていない環境では、例外 NotImplementedError が発生します。
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
+ $SAFE が 4 の場合、例外 SecurityError が発生します。
Readline.basic_word_break_characters = string
- 桼Ϥ䴰Ԥݡñζڤ򼨤ʣʸǹ
- ʸ string ꤷޤ
+ ユーザの入力の補完を行う際、単語の区切りを示す複数の文字で構成される
+ 文字列 string を指定します。
- GNU Readline ΥǥեȤͤϡBash 䴰ǻѤƤʸ
- " \t\n\"\\'`@$><=;|&{(" (ڡޤ) ˤʤäƤޤ
+ GNU Readline のデフォルトの値は、Bash の補完処理で使用している文字列
+ " \t\n\"\\'`@$><=;|&{(" (スペースを含む) になっています。
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
+ サポートしていない環境では、例外 NotImplementedError が発生します。
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
+ $SAFE が 4 の場合、例外 SecurityError が発生します。
Readline.basic_word_break_characters -> string
- 桼Ϥ䴰Ԥݡñζڤ򼨤ʣʸǹ
- ʸޤ
+ ユーザの入力の補完を行う際、単語の区切りを示す複数の文字で構成される
+ 文字列を取得します。
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
+ サポートしていない環境では、例外 NotImplementedError が発生します。
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
+ $SAFE が 4 の場合、例外 SecurityError が発生します。
Readline.completer_word_break_characters = string
- 桼Ϥ䴰Ԥݡñζڤ򼨤ʣʸǹ
- ʸ string ꤷޤ
- Readline.basic_word_break_characters= Ȥΰ㤤ϡ
- GNU Readline rl_complete_internal ؿǻѤ뤳ȤǤ
+ ユーザの入力の補完を行う際、単語の区切りを示す複数の文字で構成される
+ 文字列 string を指定します。
+ Readline.basic_word_break_characters= との違いは、
+ GNU Readline の rl_complete_internal 関数で使用されることです。
- GNU Readline ΥǥեȤͤϡ
- Readline.basic_word_break_characters ƱǤ
+ GNU Readline のデフォルトの値は、
+ Readline.basic_word_break_characters と同じです。
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
+ サポートしていない環境では、例外 NotImplementedError が発生します。
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
+ $SAFE が 4 の場合、例外 SecurityError が発生します。
Readline.completer_word_break_characters -> string
- 桼Ϥ䴰Ԥݡñζڤ򼨤ʣʸǹ줿
- ʸޤ
+ ユーザの入力の補完を行う際、単語の区切りを示す複数の文字で構成された
+ 文字列を取得します。
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
+ サポートしていない環境では、例外 NotImplementedError が発生します。
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
+ $SAFE が 4 の場合、例外 SecurityError が発生します。
Readline.basic_quote_characters = string
- ڡʤɤñζڤ򥯥Ȥ뤿ʣʸǹ
- ʸ string ꤷޤ
+ スペースなどの単語の区切りをクオートするための複数の文字で構成される
+ 文字列 string を指定します。
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
+ サポートしていない環境では、例外 NotImplementedError が発生します。
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
+ $SAFE が 4 の場合、例外 SecurityError が発生します。
Readline.basic_quote_characters -> string
- ڡʤɤñζڤ򥯥Ȥ뤿ʣʸǹ
- ʸޤ
+ スペースなどの単語の区切りをクオートするための複数の文字で構成される
+ 文字列を取得します。
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
+ サポートしていない環境では、例外 NotImplementedError が発生します。
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
+ $SAFE が 4 の場合、例外 SecurityError が発生します。
Readline.completer_quote_characters = string
- 桼Ϥ䴰Ԥݡڡʤɤñζڤ
- Ȥ뤿ʣʸǹʸ string ꤷޤ
- ꤷʸδ֤ǤϡReadline.completer_word_break_characters=
- ǻꤷʸ˴ޤޤʸ⡢̤ʸȤưޤ
+ ユーザの入力の補完を行う際、スペースなどの単語の区切りを
+ クオートするための複数の文字で構成される文字列 string を指定します。
+ 指定した文字の間では、Readline.completer_word_break_characters=
+ で指定した文字列に含まれる文字も、普通の文字列として扱われます。
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
+ サポートしていない環境では、例外 NotImplementedError が発生します。
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
+ $SAFE が 4 の場合、例外 SecurityError が発生します。
Readline.completer_quote_characters -> string
- 桼Ϥ䴰Ԥݡڡʤɤñζڤ
- Ȥ뤿ʣʸǹʸޤ
+ ユーザの入力の補完を行う際、スペースなどの単語の区切りを
+ クオートするための複数の文字で構成される文字列を取得します。
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
+ サポートしていない環境では、例外 NotImplementedError が発生します。
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
+ $SAFE が 4 の場合、例外 SecurityError が発生します。
Readline.filename_quote_characters = string
- 桼ϻ˥ե̾䴰Ԥݡڡʤɤñζڤ
- Ȥ뤿ʣʸǹʸ string ꤷޤ
+ ユーザの入力時にファイル名の補完を行う際、スペースなどの単語の区切りを
+ クオートするための複数の文字で構成される文字列 string を指定します。
- GNU Readline Υǥեͤ nil Ǥ
+ GNU Readline のデフォルト値は nil です。
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
+ サポートしていない環境では、例外 NotImplementedError が発生します。
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
+ $SAFE が 4 の場合、例外 SecurityError が発生します。
Readline.filename_quote_characters -> string
- 桼ϻ˥ե̾䴰Ԥݡڡʤɤñζڤ
- Ȥ뤿ʣʸǹʸޤ
+ ユーザの入力時にファイル名の補完を行う際、スペースなどの単語の区切りを
+ クオートするための複数の文字で構成される文字列を取得します。
- ݡȤƤʤĶǤϡ㳰 NotImplementedError ȯޤ
+ サポートしていない環境では、例外 NotImplementedError が発生します。
- $SAFE 4 ξ硢㳰 SecurityError ȯޤ
+ $SAFE が 4 の場合、例外 SecurityError が発生します。
-=== 饹
+=== クラス定数
HISTORY
- HISTORY Ѥƥҥȥ˥Ǥޤ
- Enumerable ⥸塼 extend Ƥꡢ
- Τ褦˿񤦤ȤǤޤ
- 㤨СHISTORY[4] ˤ 5 ܤϤƤФȤǤޤ
+ 定数 HISTORY を使用してヒストリにアクセスできます。
+ Enumerable モジュールを extend しており、
+ 配列のように振る舞うことができます。
+ 例えば、HISTORY[4] により 5 番目に入力した内容を取り出すことができます。
require "readline"
Readline::HISTORY.push("a", "b", "c", "d", "e")
p Readline::HISTORY[4] # => "e"
- Ƥ᥽åɤ򼡤˵󤲤ޤ
+ 実装しているメソッドを次に挙げます。
* HISTORY.to_s -> "HISTORY"
* HISTORY[index] -> string
* HISTORY[index] = string
@@ -407,31 +407,31 @@ HISTORY
* HISTORY.delete_at(index) -> string
* HISTORY.clear -> self
- ݡȤƤʤĶǤϡΥ᥽åɤ㳰 NotImplementedError
- ȯޤ
+ サポートしていない環境では、次のメソッドで例外 NotImplementedError が
+ 発生します。
* HISTORY[index] = string
* HISTORY.pop -> string
* HISTORY.shift -> string
* HISTORY.delete_at(index) -> string
* HISTORY.clear -> self
- $SAFE 4 ξ硢ҥȥ˥Ȥ㳰 SecurityError
- ȯޤ
+ $SAFE が 4 の場合、ヒストリにアクセスしたときに例外 SecurityError が
+ 発生します。
FILENAME_COMPLETION_PROC
- ե̾䴰Ԥ call ᥽åɤĥ֥ȤǤ
+ ファイル名の補完を行う call メソッドを持つオブジェクトです。
- Readline.completion_proc= ˤꡢ桼ϻ˥ե̾䴰
- Ԥ褦ꤹ뤿˻Ѥ뤳ȤꤷƤޤ
+ Readline.completion_proc= により、ユーザの入力時にファイル名の補完を
+ 行うように設定するために使用することを想定してます。
USERNAME_COMPLETION_PROC
- 桼̾䴰Ԥ call ᥽åɤĥ֥ȤǤ
+ ユーザ名の補完を行う call メソッドを持つオブジェクトです。
- Readline.completion_proc= ˤꡢ桼ϻ˥桼̾䴰
- 褦ꤹ뤿˻Ѥ뤳ȤꤷƤޤ
+ Readline.completion_proc= により、ユーザの入力時にユーザ名の補完を行
+ うように設定するために使用することを想定してます。
VERSION
- ѤƤ GNU Readline ޤ libedit ΥСǤ
+ 使用している GNU Readline または libedit のバージョンです。
diff --git a/ext/readline/extconf.rb b/ext/readline/extconf.rb
index b8e9e0fab4..c5db9b029a 100644
--- a/ext/readline/extconf.rb
+++ b/ext/readline/extconf.rb
@@ -1,26 +1,26 @@
require "mkmf"
-$readline_headers = ["stdio.h"]
+readline = Struct.new(:headers, :extra_check).new(["stdio.h"])
-def have_readline_header(header)
- if have_header(header, &$readline_extra_check)
- $readline_headers.push(header)
+def readline.have_header(header)
+ if super(header, &extra_check)
+ headers.push(header)
return true
else
return false
end
end
-def have_readline_var(var)
- return have_var(var, $readline_headers)
+def readline.have_var(var)
+ return super(var, headers)
end
-def have_readline_func(func)
- return have_func(func, $readline_headers)
+def readline.have_func(func)
+ return super(func, headers)
end
-def have_readline_macro(macro)
- return have_macro(macro, $readline_headers)
+def readline.have_macro(macro)
+ return super(macro, headers)
end
dir_config('curses')
@@ -37,62 +37,66 @@ have_library("ncurses", "tgetnum") ||
case enable_libedit
when true
# --enable-libedit
- unless (have_readline_header("editline/readline.h") ||
- have_readline_header("readline/readline.h")) &&
+ unless (readline.have_header("editline/readline.h") ||
+ readline.have_header("readline/readline.h")) &&
have_library("edit", "readline")
- exit
+ raise "libedit not found"
end
when false
# --disable-libedit
- unless ((have_readline_header("readline/readline.h") &&
- have_readline_header("readline/history.h")) &&
+ unless ((readline.have_header("readline/readline.h") &&
+ readline.have_header("readline/history.h")) &&
have_library("readline", "readline"))
- exit
+ raise "readline not found"
end
else
# does not specify
- unless ((have_readline_header("readline/readline.h") &&
- have_readline_header("readline/history.h")) &&
+ unless ((readline.have_header("readline/readline.h") &&
+ readline.have_header("readline/history.h")) &&
(have_library("readline", "readline") ||
have_library("edit", "readline"))) ||
- (have_readline_header("editline/readline.h") &&
+ (readline.have_header("editline/readline.h") &&
have_library("edit", "readline"))
- exit
+ raise "readline nor libedit not found"
end
end
-have_readline_func("rl_getc")
-have_readline_func("rl_getc_function")
-have_readline_func("rl_filename_completion_function")
-have_readline_func("rl_username_completion_function")
-have_readline_func("rl_completion_matches")
-have_readline_func("rl_refresh_line")
-have_readline_var("rl_deprep_term_function")
-have_readline_var("rl_completion_append_character")
-have_readline_var("rl_basic_word_break_characters")
-have_readline_var("rl_completer_word_break_characters")
-have_readline_var("rl_basic_quote_characters")
-have_readline_var("rl_completer_quote_characters")
-have_readline_var("rl_filename_quote_characters")
-have_readline_var("rl_attempted_completion_over")
-have_readline_var("rl_library_version")
-have_readline_var("rl_editing_mode")
-have_readline_var("rl_line_buffer")
-have_readline_var("rl_point")
+readline.have_func("rl_getc")
+readline.have_func("rl_getc_function")
+readline.have_func("rl_filename_completion_function")
+readline.have_func("rl_username_completion_function")
+readline.have_func("rl_completion_matches")
+readline.have_func("rl_refresh_line")
+readline.have_var("rl_deprep_term_function")
+readline.have_var("rl_completion_append_character")
+readline.have_var("rl_basic_word_break_characters")
+readline.have_var("rl_completer_word_break_characters")
+readline.have_var("rl_basic_quote_characters")
+readline.have_var("rl_completer_quote_characters")
+readline.have_var("rl_filename_quote_characters")
+readline.have_var("rl_attempted_completion_over")
+readline.have_var("rl_library_version")
+readline.have_var("rl_editing_mode")
+readline.have_var("rl_line_buffer")
+readline.have_var("rl_point")
# workaround for native windows.
-/mswin|bccwin|mingw/ !~ RUBY_PLATFORM && have_readline_var("rl_event_hook")
-/mswin|bccwin|mingw/ !~ RUBY_PLATFORM && have_readline_var("rl_catch_sigwinch")
-/mswin|bccwin|mingw/ !~ RUBY_PLATFORM && have_readline_var("rl_catch_signals")
-have_readline_func("rl_cleanup_after_signal")
-have_readline_func("rl_free_line_state")
-have_readline_func("rl_clear_signals")
-have_readline_func("rl_set_screen_size")
-have_readline_func("rl_get_screen_size")
-have_readline_func("rl_vi_editing_mode")
-have_readline_func("rl_emacs_editing_mode")
-have_readline_func("replace_history_entry")
-have_readline_func("remove_history")
-have_readline_func("clear_history")
-have_readline_macro("RL_PROMPT_START_IGNORE")
-have_readline_macro("RL_PROMPT_END_IGNORE")
+/mswin|bccwin|mingw/ !~ RUBY_PLATFORM && readline.have_var("rl_event_hook")
+/mswin|bccwin|mingw/ !~ RUBY_PLATFORM && readline.have_var("rl_catch_sigwinch")
+/mswin|bccwin|mingw/ !~ RUBY_PLATFORM && readline.have_var("rl_catch_signals")
+readline.have_var("rl_pre_input_hook")
+readline.have_var("rl_special_prefixes")
+readline.have_func("rl_cleanup_after_signal")
+readline.have_func("rl_free_line_state")
+readline.have_func("rl_clear_signals")
+readline.have_func("rl_set_screen_size")
+readline.have_func("rl_get_screen_size")
+readline.have_func("rl_vi_editing_mode")
+readline.have_func("rl_emacs_editing_mode")
+readline.have_func("replace_history_entry")
+readline.have_func("remove_history")
+readline.have_func("clear_history")
+readline.have_func("rl_redisplay")
+readline.have_func("rl_insert_text")
+readline.have_macro("RL_PROMPT_START_IGNORE")
+readline.have_macro("RL_PROMPT_END_IGNORE")
create_makefile("readline")
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index c035b67c54..08b61fef9d 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -40,6 +40,10 @@
#include <unistd.h>
#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
static VALUE mReadline;
#define EDIT_LINE_LIBRARY_VERSION "EditLine wrapper"
@@ -57,6 +61,12 @@ static ID completion_proc, completion_case_fold;
#if USE_INSERT_IGNORE_ESCAPE
static ID id_orig_prompt, id_last_prompt;
#endif
+#if defined(HAVE_RL_PRE_INPUT_HOOK)
+static ID id_pre_input_hook;
+#endif
+#if defined(HAVE_RL_SPECIAL_PREFIXES)
+static ID id_special_prefixes;
+#endif
#ifndef HAVE_RL_FILENAME_COMPLETION_FUNCTION
# define rl_filename_completion_function filename_completion_function
@@ -69,6 +79,10 @@ static ID id_orig_prompt, id_last_prompt;
#endif
static int (*history_get_offset_func)(int);
+static int (*history_replace_offset_func)(int);
+#ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
+static int readline_completion_append_character;
+#endif
static char **readline_attempted_completion_function(const char *text,
int start, int end);
@@ -116,7 +130,6 @@ static char **readline_attempted_completion_function(const char *text,
#if defined HAVE_RL_GETC_FUNCTION
static VALUE readline_instream;
-static ID id_getbyte;
#ifndef HAVE_RL_GETC
#define rl_getc(f) EOF
@@ -158,10 +171,22 @@ readline_getc(FILE *input)
}
}
}
-#endif
- c = rb_funcall(readline_instream, id_getbyte, 0, 0);
+#endif
+ c = rb_io_getbyte(readline_instream);
if (NIL_P(c)) return EOF;
- return NUM2CHR(c);
+#ifdef ESC
+ if (c == INT2FIX(ESC) &&
+ RL_ISSTATE(RL_STATE_ISEARCH) && /* isn't needed in other states? */
+ rb_io_read_pending(ifp)) {
+ int meta = 0;
+ c = rb_io_getbyte(readline_instream);
+ if (FIXNUM_P(c) && isascii(FIX2INT(c))) meta = 1;
+ rb_io_ungetbyte(readline_instream, c);
+ if (meta) rl_execute_next(ESC);
+ return ESC;
+ }
+#endif
+ return FIX2INT(c);
}
#elif defined HAVE_RL_EVENT_HOOK
#define BUSY_WAIT 0
@@ -257,6 +282,9 @@ insert_ignore_escape(VALUE self, VALUE prompt)
static VALUE
readline_get(VALUE prompt)
{
+#ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
+ readline_completion_append_character = rl_completion_append_character;
+#endif
return (VALUE)readline((char *)prompt);
}
@@ -365,6 +393,13 @@ readline_readline(int argc, VALUE *argv, VALUE self)
}
if (!isatty(fileno(rl_instream)) && errno == EBADF) rb_raise(rb_eIOError, "closed stdin");
+ if (rl_outstream) {
+ struct stat stbuf;
+ int fd = fileno(rl_outstream);
+ if (fd < 0 || fstat(fd, &stbuf) != 0) {
+ rb_raise(rb_eIOError, "closed stdout");
+ }
+ }
#ifdef _WIN32
rl_prep_terminal(1);
@@ -450,6 +485,108 @@ readline_s_set_output(VALUE self, VALUE output)
return output;
}
+#if defined(HAVE_RL_PRE_INPUT_HOOK)
+/*
+ * call-seq:
+ * Readline.pre_input_hook = proc
+ *
+ * Specifies a Proc object +proc+ to call after the first prompt has
+ * been printed and just before readline starts reading input
+ * characters.
+ *
+ * See GNU Readline's rl_pre_input_hook variable.
+ *
+ * Raises ArgumentError if +proc+ does not respond to the call method.
+ *
+ * Raises SecurityError if $SAFE is 4.
+ */
+static VALUE
+readline_s_set_pre_input_hook(VALUE self, VALUE proc)
+{
+ rb_secure(4);
+ if (!NIL_P(proc) && !rb_respond_to(proc, rb_intern("call")))
+ rb_raise(rb_eArgError, "argument must respond to `call'");
+ return rb_ivar_set(mReadline, id_pre_input_hook, proc);
+}
+
+/*
+ * call-seq:
+ * Readline.pre_input_hook -> proc
+ *
+ * Returns a Proc object +proc+ to call after the first prompt has
+ * been printed and just before readline starts reading input
+ * characters. The default is nil.
+ *
+ * Raises SecurityError if $SAFE is 4.
+ */
+static VALUE
+readline_s_get_pre_input_hook(VALUE self)
+{
+ rb_secure(4);
+ return rb_attr_get(mReadline, id_pre_input_hook);
+}
+
+static int
+readline_pre_input_hook(void)
+{
+ VALUE proc;
+
+ proc = rb_attr_get(mReadline, id_pre_input_hook);
+ if (!NIL_P(proc))
+ rb_funcall(proc, rb_intern("call"), 0);
+ return 0;
+}
+#else
+#define readline_s_set_pre_input_hook rb_f_notimplement
+#define readline_s_get_pre_input_hook rb_f_notimplement
+#endif
+
+#if defined(HAVE_RL_INSERT_TEXT)
+/*
+ * call-seq:
+ * Readline.insert_text(string) -> self
+ *
+ * Insert text into the line at the current cursor position.
+ *
+ * See GNU Readline's rl_insert_text function.
+ *
+ * Raises SecurityError if $SAFE is 4.
+ */
+static VALUE
+readline_s_insert_text(VALUE self, VALUE str)
+{
+ rb_secure(4);
+ OutputStringValue(str);
+ rl_insert_text(RSTRING_PTR(str));
+ return self;
+}
+#else
+#define readline_s_insert_text rb_f_notimplement
+#endif
+
+#if defined(HAVE_RL_REDISPLAY)
+/*
+ * call-seq:
+ * Readline.redisplay -> self
+ *
+ * Change what's displayed on the screen to reflect the current
+ * contents.
+ *
+ * See GNU Readline's rl_redisplay function.
+ *
+ * Raises SecurityError if $SAFE is 4.
+ */
+static VALUE
+readline_s_redisplay(VALUE self)
+{
+ rb_secure(4);
+ rl_redisplay();
+ return self;
+}
+#else
+#define readline_s_redisplay rb_f_notimplement
+#endif
+
/*
* call-seq:
* Readline.completion_proc = proc
@@ -637,24 +774,34 @@ readline_attempted_completion_function(const char *text, int start, int end)
char **result;
int case_fold;
long i, matches;
+ rb_encoding *enc;
+ VALUE encobj;
proc = rb_attr_get(mReadline, completion_proc);
if (NIL_P(proc))
return NULL;
+#ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
+ rl_completion_append_character = readline_completion_append_character;
+#endif
#ifdef HAVE_RL_ATTEMPTED_COMPLETION_OVER
rl_attempted_completion_over = 1;
#endif
case_fold = RTEST(rb_attr_get(mReadline, completion_case_fold));
ary = rb_funcall(proc, rb_intern("call"), 1, rb_locale_str_new_cstr(text));
- if (TYPE(ary) != T_ARRAY)
+ if (!RB_TYPE_P(ary, T_ARRAY))
ary = rb_Array(ary);
matches = RARRAY_LEN(ary);
- if (matches == 0)
- return NULL;
- result = ALLOC_N(char *, matches + 2);
+ if (matches == 0) return NULL;
+ result = (char**)malloc((matches + 2)*sizeof(char*));
+ if (result == NULL) rb_memerror();
+ enc = rb_locale_encoding();
+ encobj = rb_enc_from_encoding(enc);
for (i = 0; i < matches; i++) {
temp = rb_obj_as_string(RARRAY_PTR(ary)[i]);
- result[i + 1] = ALLOC_N(char, RSTRING_LEN(temp) + 1);
+ StringValueCStr(temp); /* must be NUL-terminated */
+ rb_enc_check(encobj, temp);
+ result[i + 1] = (char*)malloc(RSTRING_LEN(temp) + 1);
+ if (result[i + 1] == NULL) rb_memerror();
strcpy(result[i + 1], RSTRING_PTR(temp));
}
result[matches + 1] = NULL;
@@ -663,30 +810,30 @@ readline_attempted_completion_function(const char *text, int start, int end)
result[0] = strdup(result[1]);
}
else {
- register int i = 1;
- int low = 100000;
-
- while (i < matches) {
- register int c1, c2, si;
-
- if (case_fold) {
- for (si = 0;
- (c1 = TOLOWER(result[i][si])) &&
- (c2 = TOLOWER(result[i + 1][si]));
- si++)
- if (c1 != c2) break;
- } else {
- for (si = 0;
- (c1 = result[i][si]) &&
- (c2 = result[i + 1][si]);
- si++)
- if (c1 != c2) break;
+ const char *result1 = result[1];
+ long low = strlen(result1);
+
+ for (i = 1; i < matches; ++i) {
+ register int c1, c2;
+ long i1, i2, l2;
+ int n1, n2;
+ const char *p2 = result[i + 1];
+
+ l2 = strlen(p2);
+ for (i1 = i2 = 0; i1 < low && i2 < l2; i1 += n1, i2 += n2) {
+ c1 = rb_enc_codepoint_len(result1 + i1, result1 + low, &n1, enc);
+ c2 = rb_enc_codepoint_len(p2 + i2, p2 + l2, &n2, enc);
+ if (case_fold) {
+ c1 = rb_tolower(c1);
+ c2 = rb_tolower(c2);
+ }
+ if (c1 != c2) break;
}
- if (low > si) low = si;
- i++;
+ low = i1;
}
- result[0] = ALLOC_N(char, low + 1);
+ result[0] = (char*)malloc(low + 1);
+ if (result[0] == NULL) rb_memerror();
strncpy(result[0], result[1], low);
result[0][low] = '\0';
}
@@ -931,7 +1078,7 @@ readline_s_get_completion_append_character(VALUE self)
*
* Sets the basic list of characters that signal a break between words
* for the completer routine. The default is the characters which
- * break words for completion in Bash: "\t\n\"\\'`@$><=;|&{(".
+ * break words for completion in Bash: " \t\n\"\\'`@$><=;|&{(".
*
* Raises NotImplementedError if the using readline library does not support.
*
@@ -1046,6 +1193,74 @@ readline_s_get_completer_word_break_characters(VALUE self, VALUE str)
#define readline_s_get_completer_word_break_characters rb_f_notimplement
#endif
+#if defined(HAVE_RL_SPECIAL_PREFIXES)
+/*
+ * call-seq:
+ * Readline.special_prefixes = string
+ *
+ * Sets the list of characters that are word break characters, but
+ * should be left in text when it is passed to the completion
+ * function. Programs can use this to help determine what kind of
+ * completing to do. For instance, Bash sets this variable to "$@" so
+ * that it can complete shell variables and hostnames.
+ *
+ * See GNU Readline's rl_special_prefixes variable.
+ *
+ * Raises NotImplementedError if the using readline library does not support.
+ *
+ * Raises SecurityError exception if $SAFE is 4.
+ */
+static VALUE
+readline_s_set_special_prefixes(VALUE self, VALUE str)
+{
+ rb_secure(4);
+ if (!NIL_P(str)) {
+ OutputStringValue(str);
+ str = rb_str_dup_frozen(str);
+ RBASIC(str)->klass = 0;
+ }
+ rb_ivar_set(mReadline, id_special_prefixes, str);
+ if (NIL_P(str)) {
+ rl_special_prefixes = NULL;
+ }
+ else {
+ rl_special_prefixes = RSTRING_PTR(str);
+ }
+ return self;
+}
+
+/*
+ * call-seq:
+ * Readline.special_prefixes -> string
+ *
+ * Gets the list of characters that are word break characters, but
+ * should be left in text when it is passed to the completion
+ * function.
+ *
+ * See GNU Readline's rl_special_prefixes variable.
+ *
+ * Raises NotImplementedError if the using readline library does not support.
+ *
+ * Raises SecurityError exception if $SAFE is 4.
+ */
+static VALUE
+readline_s_get_special_prefixes(VALUE self)
+{
+ VALUE str;
+ rb_secure(4);
+ if (rl_special_prefixes == NULL) return Qnil;
+ str = rb_ivar_get(mReadline, id_special_prefixes);
+ if (!NIL_P(str)) {
+ str = rb_str_dup_frozen(str);
+ RBASIC(str)->klass = rb_cString;
+ }
+ return str;
+}
+#else
+#define readline_s_set_special_prefixes rb_f_notimplement
+#define readline_s_get_special_prefixes rb_f_notimplement
+#endif
+
#ifdef HAVE_RL_BASIC_QUOTE_CHARACTERS
/*
* call-seq:
@@ -1299,7 +1514,7 @@ hist_set(VALUE self, VALUE index, VALUE str)
i += history_length;
}
if (i >= 0) {
- entry = replace_history_entry(i, RSTRING_PTR(str), NULL);
+ entry = replace_history_entry(history_replace_offset_func(i), RSTRING_PTR(str), NULL);
}
if (entry == NULL) {
rb_raise(rb_eIndexError, "invalid index");
@@ -1351,7 +1566,8 @@ rb_remove_history(int index)
return Qnil;
#else
rb_notimplement();
- return Qnil; /* not reached */
+
+ UNREACHABLE;
#endif
}
@@ -1494,10 +1710,25 @@ Init_readline()
/* Allow conditional parsing of the ~/.inputrc file. */
rl_readline_name = (char *)"Ruby";
+#if defined HAVE_RL_GETC_FUNCTION
+ /* libedit check rl_getc_function only when rl_initialize() is called, */
+ /* and using_history() call rl_initialize(). */
+ /* This assignment should be placed before using_history() */
+ rl_getc_function = readline_getc;
+#elif defined HAVE_RL_EVENT_HOOK
+ rl_event_hook = readline_event;
+#endif
+
using_history();
completion_proc = rb_intern(COMPLETION_PROC);
completion_case_fold = rb_intern(COMPLETION_CASE_FOLD);
+#if defined(HAVE_RL_PRE_INPUT_HOOK)
+ id_pre_input_hook = rb_intern("pre_input_hook");
+#endif
+#if defined(HAVE_RL_SPECIAL_PREFIXES)
+ id_special_prefixes = rb_intern("special_prefixes");
+#endif
mReadline = rb_define_module("Readline");
rb_define_module_function(mReadline, "readline",
@@ -1556,6 +1787,18 @@ Init_readline()
readline_s_get_filename_quote_characters, 0);
rb_define_singleton_method(mReadline, "refresh_line",
readline_s_refresh_line, 0);
+ rb_define_singleton_method(mReadline, "pre_input_hook=",
+ readline_s_set_pre_input_hook, 1);
+ rb_define_singleton_method(mReadline, "pre_input_hook",
+ readline_s_get_pre_input_hook, 0);
+ rb_define_singleton_method(mReadline, "insert_text",
+ readline_s_insert_text, 1);
+ rb_define_singleton_method(mReadline, "redisplay",
+ readline_s_redisplay, 0);
+ rb_define_singleton_method(mReadline, "special_prefixes=",
+ readline_s_set_special_prefixes, 1);
+ rb_define_singleton_method(mReadline, "special_prefixes",
+ readline_s_get_special_prefixes, 0);
#if USE_INSERT_IGNORE_ESCAPE
CONST_ID(id_orig_prompt, "orig_prompt");
@@ -1604,6 +1847,7 @@ Init_readline()
*/
rb_define_const(mReadline, "USERNAME_COMPLETION_PROC", ucomp);
history_get_offset_func = history_get_offset_history_base;
+ history_replace_offset_func = history_get_offset_0;
#if defined HAVE_RL_LIBRARY_VERSION
version = rb_str_new_cstr(rl_library_version);
#if defined HAVE_CLEAR_HISTORY || defined HAVE_REMOVE_HISTORY
@@ -1613,7 +1857,12 @@ Init_readline()
if (history_get(history_get_offset_func(0)) == NULL) {
history_get_offset_func = history_get_offset_0;
}
-#if !defined HAVE_CLEAR_HISTORY
+#ifdef HAVE_REPLACE_HISTORY_ENTRY
+ if (replace_history_entry(0, "a", NULL) == NULL) {
+ history_replace_offset_func = history_get_offset_history_base;
+ }
+#endif
+#ifdef HAVE_CLEAR_HISTORY
clear_history();
#else
{
@@ -1633,18 +1882,12 @@ Init_readline()
rb_define_const(mReadline, "VERSION", version);
rl_attempted_completion_function = readline_attempted_completion_function;
-#if defined HAVE_RL_GETC_FUNCTION
- rl_getc_function = readline_getc;
- id_getbyte = rb_intern_const("getbyte");
-#elif defined HAVE_RL_EVENT_HOOK
- rl_event_hook = readline_event;
+#if defined(HAVE_RL_PRE_INPUT_HOOK)
+ rl_pre_input_hook = (Function *)readline_pre_input_hook;
#endif
#ifdef HAVE_RL_CATCH_SIGNALS
rl_catch_signals = 0;
#endif
-#ifdef HAVE_RL_CATCH_SIGWINCH
- rl_catch_sigwinch = 0;
-#endif
#ifdef HAVE_RL_CLEAR_SIGNALS
rl_clear_signals();
#endif
diff --git a/ext/ripper/depend b/ext/ripper/depend
index 40d54dab77..0beb489326 100644
--- a/ext/ripper/depend
+++ b/ext/ripper/depend
@@ -7,7 +7,7 @@ BISON = bison
src: ripper.c eventids1.c eventids2table.c
-ripper.o: ripper.c lex.c eventids1.c eventids2.c eventids2table.c \
+ripper.o: ripper.c id.c lex.c eventids1.c eventids2.c eventids2table.c \
$(hdrdir)/ruby/ruby.h $(arch_hdrdir)/ruby/config.h \
$(hdrdir)/ruby/defines.h $(hdrdir)/ruby/intern.h \
$(hdrdir)/ruby/encoding.h $(hdrdir)/missing.h \
@@ -25,7 +25,9 @@ static: check
ripper.y: $(srcdir)/tools/preproc.rb $(top_srcdir)/parse.y
$(ECHO) extracting $@ from $(top_srcdir)/parse.y
- $(Q) $(RUBY) $(srcdir)/tools/preproc.rb $(top_srcdir)/parse.y --output=$@
+ $(Q) $(RUBY) $(top_srcdir)/tool/id2token.rb --vpath=$(VPATH) id.h $(top_srcdir)/parse.y > ripper.tmp.y
+ $(Q) $(RUBY) $(srcdir)/tools/preproc.rb ripper.tmp.y --output=$@
+ $(Q) $(RM) ripper.tmp.y
check: $(GEN) $(SRC1) $(SRC2)
$(ECHO) checking $(SRC1) and $(SRC2)
diff --git a/ext/ripper/eventids2.c b/ext/ripper/eventids2.c
index 8b0d9c3757..841a18c583 100644
--- a/ext/ripper/eventids2.c
+++ b/ext/ripper/eventids2.c
@@ -38,6 +38,8 @@ static ID ripper_id_tstring_content;
static ID ripper_id_tstring_end;
static ID ripper_id_words_beg;
static ID ripper_id_qwords_beg;
+static ID ripper_id_qsymbols_beg;
+static ID ripper_id_symbols_beg;
static ID ripper_id_words_sep;
static ID ripper_id_regexp_beg;
static ID ripper_id_regexp_end;
@@ -59,7 +61,7 @@ static ID ripper_id_CHAR;
#include "eventids2table.c"
static void
-ripper_init_eventids2(VALUE self)
+ripper_init_eventids2(void)
{
ripper_id_backref = rb_intern_const("on_backref");
ripper_id_backtick = rb_intern_const("on_backtick");
@@ -91,6 +93,8 @@ ripper_init_eventids2(VALUE self)
ripper_id_tstring_end = rb_intern_const("on_tstring_end");
ripper_id_words_beg = rb_intern_const("on_words_beg");
ripper_id_qwords_beg = rb_intern_const("on_qwords_beg");
+ ripper_id_qsymbols_beg = rb_intern_const("on_qsymbols_beg");
+ ripper_id_symbols_beg = rb_intern_const("on_symbols_beg");
ripper_id_words_sep = rb_intern_const("on_words_sep");
ripper_id_regexp_beg = rb_intern_const("on_regexp_beg");
ripper_id_regexp_end = rb_intern_const("on_regexp_end");
@@ -108,8 +112,6 @@ ripper_init_eventids2(VALUE self)
ripper_id_heredoc_end = rb_intern_const("on_heredoc_end");
ripper_id___end__ = rb_intern_const("on___end__");
ripper_id_CHAR = rb_intern_const("on_CHAR");
-
- ripper_init_eventids2_table(self);
}
static const struct token_assoc {
@@ -230,14 +232,18 @@ static const struct token_assoc {
{tOROP, &ripper_id_op},
{tPOW, &ripper_id_op},
{tQWORDS_BEG, &ripper_id_qwords_beg},
+ {tQSYMBOLS_BEG, &ripper_id_qsymbols_beg},
+ {tSYMBOLS_BEG, &ripper_id_symbols_beg},
{tREGEXP_BEG, &ripper_id_regexp_beg},
{tREGEXP_END, &ripper_id_regexp_end},
{tRPAREN, &ripper_id_rparen},
{tRSHFT, &ripper_id_op},
{tSTAR, &ripper_id_op},
+ {tDSTAR, &ripper_id_op},
{tSTRING_BEG, &ripper_id_tstring_beg},
{tSTRING_CONTENT, &ripper_id_tstring_content},
{tSTRING_DBEG, &ripper_id_embexpr_beg},
+ {tSTRING_DEND, &ripper_id_embexpr_end},
{tSTRING_DVAR, &ripper_id_embvar},
{tSTRING_END, &ripper_id_tstring_end},
{tSYMBEG, &ripper_id_symbeg},
@@ -276,4 +282,6 @@ ripper_token2eventid(int tok)
return ripper_id_CHAR;
}
rb_raise(rb_eRuntimeError, "[Ripper FATAL] unknown token %d", tok);
+
+ UNREACHABLE;
}
diff --git a/ext/ripper/extconf.rb b/ext/ripper/extconf.rb
index 4914d70e78..db54e5ca2a 100644
--- a/ext/ripper/extconf.rb
+++ b/ext/ripper/extconf.rb
@@ -6,8 +6,7 @@ require 'rbconfig'
def main
unless find_executable('bison')
unless File.exist?('ripper.c') or File.exist?("#{$srcdir}/ripper.c")
- Logging.message 'missing bison; abort'
- return
+ raise 'missing bison; abort'
end
end
$objs = %w(ripper.o)
diff --git a/ext/ripper/lib/ripper.rb b/ext/ripper/lib/ripper.rb
index cb19da334a..542bd405d2 100644
--- a/ext/ripper/lib/ripper.rb
+++ b/ext/ripper/lib/ripper.rb
@@ -2,3 +2,72 @@ require 'ripper/core'
require 'ripper/lexer'
require 'ripper/filter'
require 'ripper/sexp'
+
+# Ripper is a Ruby script parser.
+#
+# You can get information from the parser with event-based style.
+# Information such as abstract syntax trees or simple lexical analysis of the
+# Ruby program.
+#
+# == Usage
+#
+# Ripper provides an easy interface for parsing your program into a symbolic
+# expression tree (or S-expression).
+#
+# Understanding the output of the parser may come as a challenge, it's
+# recommended you use PP to format the output for legibility.
+#
+# require 'ripper'
+# require 'pp'
+#
+# pp Ripper.sexp('def hello(world) "Hello, #{world}!"; end')
+# #=> [:program,
+# [[:def,
+# [:@ident, "hello", [1, 4]],
+# [:paren,
+# [:params, [[:@ident, "world", [1, 10]]], nil, nil, nil, nil, nil, nil]],
+# [:bodystmt,
+# [[:string_literal,
+# [:string_content,
+# [:@tstring_content, "Hello, ", [1, 18]],
+# [:string_embexpr, [[:var_ref, [:@ident, "world", [1, 27]]]]],
+# [:@tstring_content, "!", [1, 33]]]]],
+# nil,
+# nil,
+# nil]]]]
+#
+# You can see in the example above, the expression starts with +:program+.
+#
+# From here, a method definition at +:def+, followed by the method's identifier
+# <code>:@ident</code>. After the method's identifier comes the parentheses
+# +:paren+ and the method parameters under +:params+.
+#
+# Next is the method body, starting at +:bodystmt+ (+stmt+ meaning statement),
+# which contains the full definition of the method.
+#
+# In our case, we're simply returning a String, so next we have the
+# +:string_literal+ expression.
+#
+# Within our +:string_literal+ you'll notice two <code>@tstring_content</code>,
+# this is the literal part for <code>Hello, </code> and <code>!</code>. Between
+# the two <code>@tstring_content</code> statements is a +:string_embexpr+,
+# where _embexpr_ is an embedded expression. Our expression consists of a local
+# variable, or +var_ref+, with the identifier (<code>@ident</code>) of +world+.
+#
+# == Resources
+#
+# * {Ruby Inside}[http://www.rubyinside.com/using-ripper-to-see-how-ruby-is-parsing-your-code-5270.html]
+#
+# == Requirements
+#
+# * ruby 1.9 (support CVS HEAD only)
+# * bison 1.28 or later (Other yaccs do not work)
+#
+# == License
+#
+# Ruby License.
+#
+# Minero Aoki
+# aamine@loveruby.net
+# http://i.loveruby.net
+class Ripper; end
diff --git a/ext/ripper/lib/ripper/core.rb b/ext/ripper/lib/ripper/core.rb
index 35aa54d090..637a72f4ad 100644
--- a/ext/ripper/lib/ripper/core.rb
+++ b/ext/ripper/lib/ripper/core.rb
@@ -12,8 +12,8 @@ require 'ripper.so'
class Ripper
- # Parses Ruby program read from _src_.
- # _src_ must be a String or a IO or a object which has #gets method.
+ # Parses the given Ruby program read from +src+.
+ # +src+ must be a String or an IO or a object with a #gets method.
def Ripper.parse(src, filename = '(ripper)', lineno = 1)
new(src, filename, lineno).parse
end
@@ -42,12 +42,12 @@ class Ripper
end
# This method is called when weak warning is produced by the parser.
- # _fmt_ and _args_ is printf style.
+ # +fmt+ and +args+ is printf style.
def warn(fmt, *args)
end
# This method is called when strong warning is produced by the parser.
- # _fmt_ and _args_ is printf style.
+ # +fmt+ and +args+ is printf style.
def warning(fmt, *args)
end
diff --git a/ext/ripper/lib/ripper/filter.rb b/ext/ripper/lib/ripper/filter.rb
index 898501b23c..239f9f00e1 100644
--- a/ext/ripper/lib/ripper/filter.rb
+++ b/ext/ripper/lib/ripper/filter.rb
@@ -13,9 +13,13 @@ require 'ripper/lexer'
class Ripper
# This class handles only scanner events,
- # and they are dispatched in the `right' order (same with input).
+ # which are dispatched in the 'right' order (same with input).
class Filter
+ # Creates a new Ripper::Filter instance, passes parameters +src+,
+ # +filename+, and +lineno+ to Ripper::Lexer.new
+ #
+ # The lexer is for internal use only.
def initialize(src, filename = '-', lineno = 1)
@__lexer = Lexer.new(src, filename, lineno)
@__line = nil
@@ -41,8 +45,9 @@ class Ripper
@__col
end
- # Starts parsing. _init_ is a data accumulator.
- # It is passed to the next event handler (as of Enumerable#inject).
+ # Starts the parser.
+ # +init+ is a data accumulator and is passed to the next event handler (as
+ # of Enumerable#inject).
def parse(init = nil)
data = init
@__lexer.lex.each do |pos, event, tok|
@@ -57,10 +62,12 @@ class Ripper
private
- # This method is called when some event handler have not defined.
- # _event_ is :on_XXX, _token_ is scanned token, _data_ is a data
- # accumulator. The return value of this method is passed to the
- # next event handler (as of Enumerable#inject).
+ # This method is called when some event handler is undefined.
+ # +event+ is :on_XXX, +token+ is the scanned token, and +data+ is a data
+ # accumulator.
+ #
+ # The return value of this method is passed to the next event handler (as
+ # of Enumerable#inject).
def on_default(event, token, data)
data
end
diff --git a/ext/ripper/lib/ripper/lexer.rb b/ext/ripper/lib/ripper/lexer.rb
index 5bbee39e06..b3b78ef1a1 100644
--- a/ext/ripper/lib/ripper/lexer.rb
+++ b/ext/ripper/lib/ripper/lexer.rb
@@ -12,13 +12,13 @@ require 'ripper/core'
class Ripper
- # Tokenizes Ruby program and returns an Array of String.
+ # Tokenizes the Ruby program and returns an Array of String.
def Ripper.tokenize(src, filename = '-', lineno = 1)
Lexer.new(src, filename, lineno).tokenize
end
- # Tokenizes Ruby program and returns an Array of Array,
- # which is formatted like [[lineno, column], type, token].
+ # Tokenizes the Ruby program and returns an Array of an Array,
+ # which is formatted like <code>[[lineno, column], type, token]</code>.
#
# require 'ripper'
# require 'pp'
@@ -90,9 +90,12 @@ class Ripper
class TokenPattern #:nodoc:
- class Error < ::StandardError; end
- class CompileError < Error; end
- class MatchError < Error; end
+ class Error < ::StandardError # :nodoc:
+ end
+ class CompileError < Error # :nodoc:
+ end
+ class MatchError < Error # :nodoc:
+ end
class << self
alias compile new
@@ -155,7 +158,7 @@ class Ripper
MAP[tok] or raise CompileError, "unknown token: #{tok}"
end
- class MatchData
+ class MatchData # :nodoc:
def initialize(tokens, match)
@tokens = tokens
@match = match
diff --git a/ext/ripper/lib/ripper/sexp.rb b/ext/ripper/lib/ripper/sexp.rb
index 37040e4c11..66bd69134d 100644
--- a/ext/ripper/lib/ripper/sexp.rb
+++ b/ext/ripper/lib/ripper/sexp.rb
@@ -15,7 +15,7 @@ class Ripper
# [EXPERIMENTAL]
# Parses +src+ and create S-exp tree.
# Returns more readable tree rather than Ripper.sexp_raw.
- # This method is for mainly developper use.
+ # This method is mainly for developer use.
#
# require 'ripper'
# require 'pp'
@@ -33,7 +33,7 @@ class Ripper
# [EXPERIMENTAL]
# Parses +src+ and create S-exp tree.
- # This method is for mainly developper use.
+ # This method is mainly for developer use.
#
# require 'ripper'
# require 'pp'
diff --git a/ext/ripper/tools/generate.rb b/ext/ripper/tools/generate.rb
index 22c3ac0eb7..48ad9e1d25 100755
--- a/ext/ripper/tools/generate.rb
+++ b/ext/ripper/tools/generate.rb
@@ -6,7 +6,6 @@ def main
mode = nil
ids1src = nil
ids2src = nil
- template = nil
output = nil
parser = @parser = OptionParser.new
@@ -74,15 +73,18 @@ def generate_eventids1(ids)
end
buf << %Q[\n]
buf << %Q[static void\n]
- buf << %Q[ripper_init_eventids1(VALUE self)\n]
+ buf << %Q[ripper_init_eventids1(void)\n]
buf << %Q[{\n]
- buf << %Q[ VALUE h;\n]
- buf << %Q[ ID id;\n]
ids.each do |id, arity|
buf << %Q[ ripper_id_#{id} = rb_intern_const("on_#{id}");\n]
end
+ buf << %Q[}\n]
buf << %Q[\n]
- buf << %Q[ h = rb_hash_new();\n]
+ buf << %Q[static void\n]
+ buf << %Q[ripper_init_eventids1_table(VALUE self)\n]
+ buf << %Q[{\n]
+ buf << %Q[ VALUE h = rb_hash_new();\n]
+ buf << %Q[ ID id;\n]
buf << %Q[ rb_define_const(self, "PARSER_EVENT_TABLE", h);\n]
ids.each do |id, arity|
buf << %Q[ id = rb_intern_const("#{id}");\n]
diff --git a/ext/sdbm/_sdbm.c b/ext/sdbm/_sdbm.c
index 28e5b03b31..874239a276 100644
--- a/ext/sdbm/_sdbm.c
+++ b/ext/sdbm/_sdbm.c
@@ -7,10 +7,6 @@
* core routines
*/
-#ifndef lint
-/*char sdbm_rcsid[] = "$Id$";*/
-#endif
-
#include "ruby/config.h"
#include "ruby/defines.h"
@@ -110,7 +106,7 @@ static int duppair proto((char *, datum));
/*
* externals
*/
-#if !defined sun && !defined _WIN32 && !defined __CYGWIN__ && !defined(errno)
+#if !defined(__sun) && !defined(_WIN32) && !defined(__CYGWIN__) && !defined(errno)
extern int errno;
#endif
@@ -178,6 +174,29 @@ sdbm_open(register char *file, register int flags, register int mode)
return db;
}
+static int
+fd_set_cloexec(int fd)
+{
+ /* MinGW don't have F_GETFD and FD_CLOEXEC. [ruby-core:40281] */
+#ifdef F_GETFD
+ int flags, ret;
+ flags = fcntl(fd, F_GETFD); /* should not fail except EBADF. */
+ if (flags == -1) {
+ return -1;
+ }
+ if (2 < fd) {
+ if (!(flags & FD_CLOEXEC)) {
+ flags |= FD_CLOEXEC;
+ ret = fcntl(fd, F_SETFD, flags);
+ if (ret == -1) {
+ return -1;
+ }
+ }
+ }
+#endif
+ return 0;
+}
+
DBM *
sdbm_prep(char *dirname, char *pagname, int flags, int mode)
{
@@ -187,6 +206,8 @@ sdbm_prep(char *dirname, char *pagname, int flags, int mode)
if ((db = (DBM *) malloc(sizeof(DBM))) == NULL)
return errno = ENOMEM, (DBM *) NULL;
+ db->pagf = -1;
+ db->dirf = -1;
db->flags = 0;
db->hmask = 0;
db->blkptr = 0;
@@ -205,31 +226,38 @@ sdbm_prep(char *dirname, char *pagname, int flags, int mode)
* If we fail anywhere, undo everything, return NULL.
*/
flags |= O_BINARY;
- if ((db->pagf = open(pagname, flags, mode)) > -1) {
- if ((db->dirf = open(dirname, flags, mode)) > -1) {
+#ifdef O_CLOEXEC
+ flags |= O_CLOEXEC;
+#endif
+
+ if ((db->pagf = open(pagname, flags, mode)) == -1) goto err;
+ if (fd_set_cloexec(db->pagf) == -1) goto err;
+ if ((db->dirf = open(dirname, flags, mode)) == -1) goto err;
+ if (fd_set_cloexec(db->dirf) == -1) goto err;
/*
* need the dirfile size to establish max bit number.
*/
- if (fstat(db->dirf, &dstat) == 0) {
+ if (fstat(db->dirf, &dstat) == -1) goto err;
/*
* zero size: either a fresh database, or one with a single,
* unsplit data page: dirpage is all zeros.
*/
- db->dirbno = (!dstat.st_size) ? 0 : -1;
- db->pagbno = -1;
- db->maxbno = dstat.st_size * (long) BYTESIZ;
+ db->dirbno = (!dstat.st_size) ? 0 : -1;
+ db->pagbno = -1;
+ db->maxbno = dstat.st_size * (long) BYTESIZ;
- (void) memset(db->pagbuf, 0, PBLKSIZ);
- (void) memset(db->dirbuf, 0, DBLKSIZ);
- /*
- * success
- */
- return db;
- }
- (void) close(db->dirf);
- }
- (void) close(db->pagf);
- }
+ (void) memset(db->pagbuf, 0, PBLKSIZ);
+ (void) memset(db->dirbuf, 0, DBLKSIZ);
+/*
+ * success
+ */
+ return db;
+
+ err:
+ if (db->pagf != -1)
+ (void) close(db->pagf);
+ if (db->dirf != -1)
+ (void) close(db->dirf);
free((char *) db);
return (DBM *) NULL;
}
@@ -604,10 +632,6 @@ getnext(register DBM *db)
* page-level routines
*/
-#ifndef lint
-/*char pair_rcsid[] = "$Id$";*/
-#endif
-
#ifndef BSD42
/*#include <memory.h>*/
#endif
@@ -648,8 +672,8 @@ fitpair(char *pag, int need)
register short *ino = (short *) pag;
off = ((n = GET_SHORT(ino,0)) > 0) ? GET_SHORT(ino,n) : PBLKSIZ;
- free = off - (n + 1) * sizeof(short);
- need += 2 * sizeof(short);
+ free = off - (n + 1) * (int)sizeof(short);
+ need += 2 * (int)sizeof(short);
debug(("free %d need %d\n", free, need));
diff --git a/ext/sdbm/init.c b/ext/sdbm/init.c
index 7ba59c4e5c..0fd837db31 100644
--- a/ext/sdbm/init.c
+++ b/ext/sdbm/init.c
@@ -15,6 +15,55 @@
#include <fcntl.h>
#include <errno.h>
+/*
+ * Document-class: SDBM
+ *
+ * SDBM provides a simple file-based key-value store, which can only store
+ * String keys and values.
+ *
+ * Note that Ruby comes with the source code for SDBM, while the DBM and GDBM
+ * standard libraries rely on external libraries and headers.
+ *
+ * === Examples
+ *
+ * Insert values:
+ *
+ * require 'sdbm'
+ *
+ * SDBM.open 'my_database' do |db|
+ * db['apple'] = 'fruit'
+ * db['pear'] = 'fruit'
+ * db['carrot'] = 'vegetable'
+ * db['tomato'] = 'vegetable'
+ * end
+ *
+ * Bulk update:
+ *
+ * require 'sdbm'
+ *
+ * SDBM.open 'my_database' do |db|
+ * db.update('peach' => 'fruit', 'tomato' => 'fruit')
+ * end
+ *
+ * Retrieve values:
+ *
+ * require 'sdbm'
+ *
+ * SDBM.open 'my_database' do |db|
+ * db.each do |key, value|
+ * puts "Key: #{key}, Value: #{value}"
+ * end
+ * end
+ *
+ * Outputs:
+ *
+ * Key: apple, Value: fruit
+ * Key: pear, Value: fruit
+ * Key: carrot, Value: vegetable
+ * Key: peach, Value: fruit
+ * Key: tomato, Value: fruit
+ */
+
static VALUE rb_cDBM, rb_eDBMError;
struct dbmdata {
@@ -47,6 +96,14 @@ free_sdbm(struct dbmdata *dbmp)
ruby_xfree(dbmp);
}
+/*
+ * call-seq:
+ * sdbm.close -> nil
+ *
+ * Closes the database file.
+ *
+ * Raises SDBMError if the database is already closed.
+ */
static VALUE
fsdbm_close(VALUE obj)
{
@@ -59,6 +116,12 @@ fsdbm_close(VALUE obj)
return Qnil;
}
+/*
+* call-seq:
+* sdbm.closed? -> true or false
+*
+* Returns +true+ if the database is closed.
+*/
static VALUE
fsdbm_closed(VALUE obj)
{
@@ -78,7 +141,21 @@ fsdbm_alloc(VALUE klass)
{
return Data_Wrap_Struct(klass, 0, free_sdbm, 0);
}
-
+/*
+* call-seq:
+* SDBM.new(filename, mode = 0666)
+*
+* Creates a new database handle by opening the given +filename+. SDBM actually
+* uses two physical files, with extensions '.dir' and '.pag'. These extensions
+* will automatically be appended to the +filename+.
+*
+* If the file does not exist, a new file will be created using the given
+* +mode+, unless +mode+ is explicitly set to nil. In the latter case, no
+* database will be created.
+*
+* If the file exists, it will be opened in read/write mode. If this fails, it
+* will be opened in read-only mode.
+*/
static VALUE
fsdbm_initialize(int argc, VALUE *argv, VALUE obj)
{
@@ -109,7 +186,7 @@ fsdbm_initialize(int argc, VALUE *argv, VALUE obj)
if (!dbm) {
if (mode == -1) return Qnil;
- rb_sys_fail(RSTRING_PTR(file));
+ rb_sys_fail_str(file);
}
dbmp = ALLOC(struct dbmdata);
@@ -120,6 +197,24 @@ fsdbm_initialize(int argc, VALUE *argv, VALUE obj)
return obj;
}
+/*
+ * call-seq:
+ * SDBM.open(filename, mode = 0666)
+ * SDBM.open(filename, mode = 0666) { |sdbm| ... }
+ *
+ * If called without a block, this is the same as SDBM.new.
+ *
+ * If a block is given, the new database will be passed to the block and
+ * will be safely closed after the block has executed.
+ *
+ * Example:
+ *
+ * require 'sdbm'
+ *
+ * SDBM.open('my_database') do |db|
+ * db['hello'] = 'world'
+ * end
+ */
static VALUE
fsdbm_s_open(int argc, VALUE *argv, VALUE klass)
{
@@ -157,12 +252,34 @@ fsdbm_fetch(VALUE obj, VALUE keystr, VALUE ifnone)
return rb_external_str_new(value.dptr, value.dsize);
}
+/*
+ * call-seq:
+ * sdbm[key] -> value or nil
+ *
+ * Returns the +value+ in the database associated with the given +key+ string.
+ *
+ * If no value is found, returns +nil+.
+ */
static VALUE
fsdbm_aref(VALUE obj, VALUE keystr)
{
return fsdbm_fetch(obj, keystr, Qnil);
}
+/*
+ * call-seq:
+ * sdbm.fetch(key) -> value or nil
+ * sdbm.fetch(key) { |key| ... }
+ *
+ * Returns the +value+ in the database associated with the given +key+ string.
+ *
+ * If a block is provided, the block will be called when there is no
+ * +value+ associated with the given +key+. The +key+ will be passed in as an
+ * argument to the block.
+ *
+ * If no block is provided and no value is associated with the given +key+,
+ * then an IndexError will be raised.
+ */
static VALUE
fsdbm_fetch_m(int argc, VALUE *argv, VALUE obj)
{
@@ -176,6 +293,14 @@ fsdbm_fetch_m(int argc, VALUE *argv, VALUE obj)
return valstr;
}
+/*
+ * call-seq:
+ * sdbm.key(value) -> key
+ *
+ * Returns the +key+ associated with the given +value+. If more than one
+ * +key+ corresponds to the given +value+, then the first key to be found
+ * will be returned. If no keys are found, +nil+ will be returned.
+ */
static VALUE
fsdbm_key(VALUE obj, VALUE valstr)
{
@@ -197,6 +322,9 @@ fsdbm_key(VALUE obj, VALUE valstr)
return Qnil;
}
+/*
+ * :nodoc:
+ */
static VALUE
fsdbm_index(VALUE hash, VALUE value)
{
@@ -204,6 +332,25 @@ fsdbm_index(VALUE hash, VALUE value)
return fsdbm_key(hash, value);
}
+/* call-seq:
+ * sdbm.select { |key, value| ... } -> Array
+ *
+ * Returns a new Array of key-value pairs for which the block returns +true+.
+ *
+ * Example:
+ *
+ * require 'sdbm'
+ *
+ * SDBM.open 'my_database' do |db|
+ * db['apple'] = 'fruit'
+ * db['pear'] = 'fruit'
+ * db['spinach'] = 'vegetable'
+ *
+ * veggies = db.select do |key, value|
+ * value == 'vegetable'
+ * end #=> [["apple", "fruit"], ["pear", "fruit"]]
+ * end
+ */
static VALUE
fsdbm_select(VALUE obj)
{
@@ -228,6 +375,11 @@ fsdbm_select(VALUE obj)
return new;
}
+/* call-seq:
+ * sdbm.values_at(key, ...) -> Array
+ *
+ * Returns an Array of values corresponding to the given keys.
+ */
static VALUE
fsdbm_values_at(int argc, VALUE *argv, VALUE obj)
{
@@ -248,6 +400,18 @@ fdbm_modify(VALUE obj)
if (OBJ_FROZEN(obj)) rb_error_frozen("SDBM");
}
+/*
+ * call-seq:
+ * sdbm.delete(key) -> value or nil
+ * sdbm.delete(key) { |key, value| ... }
+ *
+ * Deletes the key-value pair corresponding to the given +key+. If the
+ * +key+ exists, the deleted value will be returned, otherwise +nil+.
+ *
+ * If a block is provided, the deleted +key+ and +value+ will be passed to
+ * the block as arguments. If the +key+ does not exist in the database, the
+ * value will be +nil+.
+ */
static VALUE
fsdbm_delete(VALUE obj, VALUE keystr)
{
@@ -283,6 +447,13 @@ fsdbm_delete(VALUE obj, VALUE keystr)
return valstr;
}
+/*
+ * call-seq:
+ * sdbm.shift -> Array or nil
+ *
+ * Removes a key-value pair from the database and returns them as an
+ * Array. If the database is empty, returns +nil+.
+ */
static VALUE
fsdbm_shift(VALUE obj)
{
@@ -306,6 +477,14 @@ fsdbm_shift(VALUE obj)
return rb_assoc_new(keystr, valstr);
}
+/*
+ * call-seq:
+ * sdbm.delete_if { |key, value| ... } -> self
+ * sdbm.reject! { |key, value| ... } -> self
+ *
+ * Iterates over the key-value pairs in the database, deleting those for
+ * which the block returns +true+.
+ */
static VALUE
fsdbm_delete_if(VALUE obj)
{
@@ -345,6 +524,12 @@ fsdbm_delete_if(VALUE obj)
return obj;
}
+/*
+ * call-seq:
+ * sdbm.clear -> self
+ *
+ * Deletes all data from the database.
+ */
static VALUE
fsdbm_clear(VALUE obj)
{
@@ -365,6 +550,22 @@ fsdbm_clear(VALUE obj)
return obj;
}
+/*
+ * call-seq:
+ * sdbm.invert -> Hash
+ *
+ * Returns a Hash in which the key-value pairs have been inverted.
+ *
+ * Example:
+ *
+ * require 'sdbm'
+ *
+ * SDBM.open 'my_database' do |db|
+ * db.update('apple' => 'fruit', 'spinach' => 'vegetable')
+ *
+ * db.invert #=> {"fruit" => "apple", "vegetable" => "spinach"}
+ * end
+ */
static VALUE
fsdbm_invert(VALUE obj)
{
@@ -384,6 +585,18 @@ fsdbm_invert(VALUE obj)
return hash;
}
+/*
+ * call-seq:
+ * sdbm[key] = value -> value
+ * sdbm.store(key, value) -> value
+ *
+ * Stores a new +value+ in the database with the given +key+ as an index.
+ *
+ * If the +key+ already exists, this will update the +value+ associated with
+ * the +key+.
+ *
+ * Returns the given +value+.
+ */
static VALUE
fsdbm_store(VALUE obj, VALUE keystr, VALUE valstr)
{
@@ -430,6 +643,15 @@ update_i(VALUE pair, VALUE dbm)
return Qnil;
}
+/*
+ * call-seq:
+ * sdbm.update(pairs) -> self
+ *
+ * Insert or update key-value pairs.
+ *
+ * This method will work with any object which implements an each_pair
+ * method, such as a Hash.
+ */
static VALUE
fsdbm_update(VALUE obj, VALUE other)
{
@@ -437,6 +659,15 @@ fsdbm_update(VALUE obj, VALUE other)
return obj;
}
+/*
+ * call-seq:
+ * sdbm.replace(pairs) -> self
+ *
+ * Empties the database, then inserts the given key-value pairs.
+ *
+ * This method will work with any object which implements an each_pair
+ * method, such as a Hash.
+ */
static VALUE
fsdbm_replace(VALUE obj, VALUE other)
{
@@ -445,6 +676,13 @@ fsdbm_replace(VALUE obj, VALUE other)
return obj;
}
+/*
+ * call-seq:
+ * sdbm.length -> integer
+ * sdbm.size -> integer
+ *
+ * Returns the number of keys in the database.
+ */
static VALUE
fsdbm_length(VALUE obj)
{
@@ -464,29 +702,43 @@ fsdbm_length(VALUE obj)
return INT2FIX(i);
}
+/*
+ * call-seq:
+ * sdbm.empty? -> true or false
+ *
+ * Returns +true+ if the database is empty.
+ */
static VALUE
fsdbm_empty_p(VALUE obj)
{
datum key;
struct dbmdata *dbmp;
DBM *dbm;
- int i = 0;
GetDBM(obj, dbmp);
if (dbmp->di_size < 0) {
dbm = dbmp->di_dbm;
for (key = sdbm_firstkey(dbm); key.dptr; key = sdbm_nextkey(dbm)) {
- i++;
+ return Qfalse;
}
}
else {
- i = dbmp->di_size;
+ if (dbmp->di_size)
+ return Qfalse;
}
- if (i == 0) return Qtrue;
- return Qfalse;
+ return Qtrue;
}
+/*
+ * call-seq:
+ * sdbm.each_value
+ * sdbm.each_value { |value| ... }
+ *
+ * Iterates over each +value+ in the database.
+ *
+ * If no block is given, returns an Enumerator.
+ */
static VALUE
fsdbm_each_value(VALUE obj)
{
@@ -505,6 +757,15 @@ fsdbm_each_value(VALUE obj)
return obj;
}
+/*
+ * call-seq:
+ * sdbm.each_key
+ * sdbm.each_key { |key| ... }
+ *
+ * Iterates over each +key+ in the database.
+ *
+ * If no block is given, returns an Enumerator.
+ */
static VALUE
fsdbm_each_key(VALUE obj)
{
@@ -522,6 +783,17 @@ fsdbm_each_key(VALUE obj)
return obj;
}
+/*
+ * call-seq:
+ * sdbm.each
+ * sdbm.each { |key, value| ... }
+ * sdbm.each_pair
+ * sdbm.each_pair { |key, value| ... }
+ *
+ * Iterates over each key-value pair in the database.
+ *
+ * If no block is given, returns an Enumerator.
+ */
static VALUE
fsdbm_each_pair(VALUE obj)
{
@@ -544,6 +816,12 @@ fsdbm_each_pair(VALUE obj)
return obj;
}
+/*
+ * call-seq:
+ * sdbm.keys -> Array
+ *
+ * Returns a new Array containing the keys in the database.
+ */
static VALUE
fsdbm_keys(VALUE obj)
{
@@ -561,6 +839,12 @@ fsdbm_keys(VALUE obj)
return ary;
}
+/*
+ * call-seq:
+ * sdbm.values -> Array
+ *
+ * Returns a new Array containing the values in the database.
+ */
static VALUE
fsdbm_values(VALUE obj)
{
@@ -579,6 +863,15 @@ fsdbm_values(VALUE obj)
return ary;
}
+/*
+ * call-seq:
+ * sdbm.include?(key) -> true or false
+ * sdbm.key?(key) -> true or false
+ * sdbm.member?(key) -> true or false
+ * sdbm.has_key?(key) -> true or false
+ *
+ * Returns +true+ if the database contains the given +key+.
+ */
static VALUE
fsdbm_has_key(VALUE obj, VALUE keystr)
{
@@ -596,6 +889,13 @@ fsdbm_has_key(VALUE obj, VALUE keystr)
return Qfalse;
}
+/*
+ * call-seq:
+ * sdbm.value?(key) -> true or false
+ * sdbm.has_value?(key) -> true or false
+ *
+ * Returns +true+ if the database contains the given +value+.
+ */
static VALUE
fsdbm_has_value(VALUE obj, VALUE valstr)
{
@@ -617,6 +917,22 @@ fsdbm_has_value(VALUE obj, VALUE valstr)
return Qfalse;
}
+/*
+ * call-seq:
+ * sdbm.to_a -> Array
+ *
+ * Returns a new Array containing each key-value pair in the database.
+ *
+ * Example:
+ *
+ * require 'sdbm'
+ *
+ * SDBM.open 'my_database' do |db|
+ * db.update('apple' => 'fruit', 'spinach' => 'vegetable')
+ *
+ * db.to_a #=> [["apple", "fruit"], ["spinach", "vegetable"]]
+ * end
+ */
static VALUE
fsdbm_to_a(VALUE obj)
{
@@ -636,6 +952,12 @@ fsdbm_to_a(VALUE obj)
return ary;
}
+/*
+ * call-seq:
+ * sdbm.to_hash -> Hash
+ *
+ * Returns a new Hash containing each key-value pair in the database.
+ */
static VALUE
fsdbm_to_hash(VALUE obj)
{
@@ -655,6 +977,14 @@ fsdbm_to_hash(VALUE obj)
return hash;
}
+/*
+ * call-seq:
+ * sdbm.reject { |key, value| ... } -> Hash
+ *
+ * Creates a new Hash using the key-value pairs from the database, then
+ * calls Hash#reject with the given block, which returns a Hash with
+ * only the key-value pairs for which the block returns +false+.
+ */
static VALUE
fsdbm_reject(VALUE obj)
{
@@ -666,6 +996,9 @@ Init_sdbm()
{
rb_cDBM = rb_define_class("SDBM", rb_cObject);
rb_eDBMError = rb_define_class("SDBMError", rb_eStandardError);
+ /* Document-class: SDBMError
+ * Exception class used to return errors from the sdbm library.
+ */
rb_include_module(rb_cDBM, rb_mEnumerable);
rb_define_alloc_func(rb_cDBM, fsdbm_alloc);
@@ -701,11 +1034,11 @@ Init_sdbm()
rb_define_method(rb_cDBM,"update", fsdbm_update, 1);
rb_define_method(rb_cDBM,"replace", fsdbm_replace, 1);
- rb_define_method(rb_cDBM, "include?", fsdbm_has_key, 1);
rb_define_method(rb_cDBM, "has_key?", fsdbm_has_key, 1);
+ rb_define_method(rb_cDBM, "include?", fsdbm_has_key, 1);
+ rb_define_method(rb_cDBM, "key?", fsdbm_has_key, 1);
rb_define_method(rb_cDBM, "member?", fsdbm_has_key, 1);
rb_define_method(rb_cDBM, "has_value?", fsdbm_has_value, 1);
- rb_define_method(rb_cDBM, "key?", fsdbm_has_key, 1);
rb_define_method(rb_cDBM, "value?", fsdbm_has_value, 1);
rb_define_method(rb_cDBM, "to_a", fsdbm_to_a, 0);
diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c
index da837bfbad..050da974c4 100644
--- a/ext/socket/ancdata.c
+++ b/ext/socket/ancdata.c
@@ -86,8 +86,7 @@ ancillary_initialize(VALUE self, VALUE vfamily, VALUE vlevel, VALUE vtype, VALUE
static VALUE
ancdata_new(int family, int level, int type, VALUE data)
{
- NEWOBJ(obj, struct RObject);
- OBJSETUP(obj, rb_cAncillaryData, T_OBJECT);
+ NEWOBJ_OF(obj, struct RObject, rb_cAncillaryData, T_OBJECT);
StringValue(data);
ancillary_initialize((VALUE)obj, INT2NUM(family), INT2NUM(level), INT2NUM(type), data);
return (VALUE)obj;
@@ -196,7 +195,7 @@ ancillary_s_unix_rights(int argc, VALUE *argv, VALUE klass)
for (i = 0 ; i < argc; i++) {
VALUE obj = argv[i];
- if (TYPE(obj) != T_FILE) {
+ if (!RB_TYPE_P(obj, T_FILE)) {
rb_raise(rb_eTypeError, "IO expected");
}
rb_ary_push(ary, obj);
@@ -1110,11 +1109,11 @@ struct sendmsg_args_struct {
int flags;
};
-static VALUE
+static void *
nogvl_sendmsg_func(void *ptr)
{
struct sendmsg_args_struct *args = ptr;
- return sendmsg(args->fd, args->msg, args->flags);
+ return (void *)(VALUE)sendmsg(args->fd, args->msg, args->flags);
}
static ssize_t
@@ -1124,7 +1123,7 @@ rb_sendmsg(int fd, const struct msghdr *msg, int flags)
args.fd = fd;
args.msg = msg;
args.flags = flags;
- return rb_thread_blocking_region(nogvl_sendmsg_func, &args, RUBY_UBF_IO, 0);
+ return (ssize_t)rb_thread_call_without_gvl(nogvl_sendmsg_func, &args, RUBY_UBF_IO, 0);
}
static VALUE
@@ -1164,8 +1163,10 @@ bsock_sendmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
#if defined(HAVE_ST_MSG_CONTROL)
int i;
size_t last_pad = 0;
+#if defined(__NetBSD__)
int last_level = 0;
int last_type = 0;
+#endif
controls_str = rb_str_tmp_new(0);
for (i = 0; i < controls_num; i++) {
VALUE elt = controls_ptr[i], v;
@@ -1204,8 +1205,10 @@ bsock_sendmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
cmh.cmsg_len = (socklen_t)CMSG_LEN(RSTRING_LEN(cdata));
MEMCPY(cmsg, &cmh, char, sizeof(cmh));
MEMCPY(cmsg+((char*)CMSG_DATA(&cmh)-(char*)&cmh), RSTRING_PTR(cdata), char, RSTRING_LEN(cdata));
+#if defined(__NetBSD__)
last_level = cmh.cmsg_level;
last_type = cmh.cmsg_type;
+#endif
last_pad = cspace - cmh.cmsg_len;
}
if (last_pad) {
@@ -1358,11 +1361,22 @@ struct recvmsg_args_struct {
int flags;
};
-static VALUE
+ssize_t
+rsock_recvmsg(int socket, struct msghdr *message, int flags)
+{
+#ifdef MSG_CMSG_CLOEXEC
+ /* MSG_CMSG_CLOEXEC is available since Linux 2.6.23. Linux 2.6.18 silently ignore it. */
+ flags |= MSG_CMSG_CLOEXEC;
+#endif
+ return recvmsg(socket, message, flags);
+}
+
+static void *
nogvl_recvmsg_func(void *ptr)
{
struct recvmsg_args_struct *args = ptr;
- return recvmsg(args->fd, args->msg, args->flags);
+ int flags = args->flags;
+ return (void *)rsock_recvmsg(args->fd, args->msg, flags);
}
static ssize_t
@@ -1372,7 +1386,7 @@ rb_recvmsg(int fd, struct msghdr *msg, int flags)
args.fd = fd;
args.msg = msg;
args.flags = flags;
- return rb_thread_blocking_region(nogvl_recvmsg_func, &args, RUBY_UBF_IO, 0);
+ return (ssize_t)rb_thread_call_without_gvl(nogvl_recvmsg_func, &args, RUBY_UBF_IO, 0);
}
#if defined(HAVE_ST_MSG_CONTROL)
@@ -1380,11 +1394,11 @@ static void
discard_cmsg(struct cmsghdr *cmh, char *msg_end, int msg_peek_p)
{
# if !defined(FD_PASSING_WORK_WITH_RECVMSG_MSG_PEEK)
- /*
+ /*
* FreeBSD 8.2.0, NetBSD 5 and MacOS X Snow Leopard doesn't
* allocate fds by recvmsg with MSG_PEEK.
* [ruby-dev:44189]
- * http://redmine.ruby-lang.org/issues/5075
+ * http://bugs.ruby-lang.org/issues/5075
*
* Linux 2.6.38 allocate fds by recvmsg with MSG_PEEK.
*/
@@ -1396,7 +1410,7 @@ discard_cmsg(struct cmsghdr *cmh, char *msg_end, int msg_peek_p)
int *end = (int *)((char *)cmh + cmh->cmsg_len);
while ((char *)fdp + sizeof(int) <= (char *)end &&
(char *)fdp + sizeof(int) <= msg_end) {
- rb_update_max_fd(*fdp);
+ rb_fd_fix_cloexec(*fdp);
close(*fdp);
fdp++;
}
@@ -1439,7 +1453,7 @@ make_io_for_unix_rights(VALUE ctl, struct cmsghdr *cmh, char *msg_end)
VALUE io;
if (fstat(fd, &stbuf) == -1)
rb_raise(rb_eSocket, "invalid fd in SCM_RIGHTS");
- rb_update_max_fd(fd);
+ rb_fd_fix_cloexec(fd);
if (S_ISSOCK(stbuf.st_mode))
io = rsock_init_sock(rb_obj_alloc(rb_cSocket), fd);
else
@@ -1485,7 +1499,7 @@ bsock_recvmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
rb_secure(4);
vopts = Qnil;
- if (0 < argc && TYPE(argv[argc-1]) == T_HASH)
+ if (0 < argc && RB_TYPE_P(argv[argc-1], T_HASH))
vopts = argv[--argc];
rb_scan_args(argc, argv, "03", &vmaxdatlen, &vflags, &vmaxctllen);
@@ -1774,17 +1788,17 @@ rsock_bsock_recvmsg_nonblock(int argc, VALUE *argv, VALUE sock)
}
#endif
-/*
- * Document-class: ::Socket::AncillaryData
- *
- * Socket::AncillaryData represents the ancillary data (control information)
- * used by sendmsg and recvmsg system call.
- * It contains socket family, cmsg level, cmsg type and cmsg data.
- */
void
rsock_init_ancdata(void)
{
#if defined(HAVE_ST_MSG_CONTROL)
+ /*
+ * Document-class: Socket::AncillaryData
+ *
+ * Socket::AncillaryData represents the ancillary data (control information)
+ * used by sendmsg and recvmsg system call. It contains socket #family,
+ * control message (cmsg) #level, cmsg #type and cmsg #data.
+ */
rb_cAncillaryData = rb_define_class_under(rb_cSocket, "AncillaryData", rb_cObject);
rb_define_method(rb_cAncillaryData, "initialize", ancillary_initialize, 4);
rb_define_method(rb_cAncillaryData, "inspect", ancillary_inspect, 0);
diff --git a/ext/socket/basicsocket.c b/ext/socket/basicsocket.c
index aa99041664..c1ae88d80c 100644
--- a/ext/socket/basicsocket.c
+++ b/ext/socket/basicsocket.c
@@ -247,7 +247,7 @@ bsock_setsockopt(int argc, VALUE *argv, VALUE sock)
break;
}
-#define rb_sys_fail_path(path) rb_sys_fail(NIL_P(path) ? 0 : RSTRING_PTR(path))
+#define rb_sys_fail_path(path) rb_sys_fail_str(path)
rb_io_check_closed(fptr);
if (setsockopt(fptr->fd, level, option, v, vlen) < 0)
@@ -732,12 +732,14 @@ bsock_do_not_rev_lookup_set(VALUE self, VALUE val)
return val;
}
-/*
- * BasicSocket is the super class for the all socket classes.
- */
void
rsock_init_basicsocket(void)
{
+ /*
+ * Document-class: BasicSocket < IO
+ *
+ * BasicSocket is the super class for all the Socket classes.
+ */
rb_cBasicSocket = rb_define_class("BasicSocket", rb_cIO);
rb_undef_method(rb_cBasicSocket, "initialize");
diff --git a/ext/socket/depend b/ext/socket/depend
index ab0a5e81b3..1716f9cb89 100644
--- a/ext/socket/depend
+++ b/ext/socket/depend
@@ -1,5 +1,5 @@
SOCK_HEADERS = $(srcdir)/rubysocket.h $(hdrdir)/ruby/ruby.h $(arch_hdrdir)/ruby/config.h \
- $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/io.h \
+ $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/io.h $(hdrdir)/ruby/thread.h \
$(srcdir)/addrinfo.h $(srcdir)/sockport.h constdefs.h $(top_srcdir)/internal.h
init.o: init.c $(SOCK_HEADERS)
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index 380b3ecde0..87409394ff 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -6,7 +6,6 @@ case RUBY_PLATFORM
when /(ms|bcc)win(32|64)|mingw/
test_func = "WSACleanup"
have_library("ws2_32", "WSACleanup")
- $defs << "-DHAVE_SOCKETPAIR"
when /cygwin/
test_func = "socket"
when /beos/
@@ -36,7 +35,7 @@ if have_header("arpa/inet.h")
end
ipv6 = false
-default_ipv6 = /mswin|cygwin|beos|haiku/ !~ RUBY_PLATFORM
+default_ipv6 = /cygwin|beos|haiku/ !~ RUBY_PLATFORM
if enable_config("ipv6", default_ipv6)
if checking_for("ipv6") {try_link(<<EOF)}
#include <sys/types.h>
@@ -44,9 +43,10 @@ if enable_config("ipv6", default_ipv6)
#include <sys/socket.h>
#endif
int
-main()
+main(void)
{
socket(AF_INET6, SOCK_STREAM, 0);
+ return 0;
}
EOF
$defs << "-DENABLE_IPV6" << "-DINET6"
@@ -56,7 +56,7 @@ end
if ipv6
if $mingw
- $CPPFLAGS << " -D_WIN32_WINNT=0x501"
+ $CPPFLAGS << " -D_WIN32_WINNT=0x501" unless $CPPFLAGS.include?("_WIN32_WINNT")
end
ipv6lib = nil
class << (fmt = "unknown")
@@ -264,7 +264,7 @@ getaddr_info_ok = (enable_config("wide-getaddrinfo") && :wide) ||
#endif
int
-main()
+main(void)
{
int passive, gaierr, inet4 = 0, inet6 = 0;
struct addrinfo hints, *ai, *aitop;
@@ -348,12 +348,12 @@ main()
if (aitop)
freeaddrinfo(aitop);
- exit(EXIT_SUCCESS);
+ return EXIT_SUCCESS;
bad:
if (aitop)
freeaddrinfo(aitop);
- exit(EXIT_FAILURE);
+ return EXIT_FAILURE;
}
EOF
if ipv6 and not getaddr_info_ok
@@ -397,6 +397,8 @@ EOF
end
end
+have_func("accept4")
+
$objs = [
"init.#{$OBJEXT}",
"constants.#{$OBJEXT}",
@@ -428,9 +430,10 @@ if getaddr_info_ok == :wide or
$defs << "-DGETADDRINFO_EMU"
end
-have_func("inet_ntop") or have_func("inet_ntoa")
-have_func("inet_pton") or have_func("inet_aton")
-have_func("getservbyport")
+have_func('inet_ntop(0, (const void *)0, (char *)0, 0)') or
+ have_func("inet_ntoa(*(struct in_addr *)NULL)")
+have_func('inet_pton(0, "", (void *)0)') or have_func('inet_aton("", (struct in_addr *)0)')
+have_func('getservbyport(0, "")')
have_header("arpa/nameser.h")
have_header("resolv.h")
@@ -450,11 +453,11 @@ end
have_header("sys/un.h")
have_header("sys/uio.h")
have_type("struct in_pktinfo", headers) {|src|
- src.sub(%r'^/\*top\*/', '\1'"\n#if defined(IPPROTO_IP) && defined(IP_PKTINFO)") <<
+ src.sub(%r'^/\*top\*/', '\&'"\n#if defined(IPPROTO_IP) && defined(IP_PKTINFO)") <<
"#else\n" << "#error\n" << ">>>>>> no in_pktinfo <<<<<<\n" << "#endif\n"
} and have_struct_member("struct in_pktinfo", "ipi_spec_dst", headers)
have_type("struct in6_pktinfo", headers) {|src|
- src.sub(%r'^/\*top\*/', '\1'"\n#if defined(IPPROTO_IPV6) && defined(IPV6_PKTINFO)") <<
+ src.sub(%r'^/\*top\*/', '\&'"\n#if defined(IPPROTO_IPV6) && defined(IPV6_PKTINFO)") <<
"#else\n" << "#error\n" << ">>>>>> no in6_pktinfo <<<<<<\n" << "#endif\n"
}
@@ -480,8 +483,11 @@ $distcleanfiles << "constants.h" << "constdefs.*"
if have_func(test_func)
have_func("hsterror")
have_func("getipnodebyname") or have_func("gethostbyname2")
- have_func("socketpair") unless $defs.include?("-DHAVE_SOCKETPAIR")
- unless have_func("gethostname")
+ if !have_func("socketpair(0, 0, 0, 0)") and have_func("rb_w32_socketpair(0, 0, 0, 0)")
+ $defs << "-Dsocketpair(a,b,c,d)=rb_w32_socketpair((a),(b),(c),(d))"
+ $defs << "-DHAVE_SOCKETPAIR"
+ end
+ unless have_func("gethostname((char *)0, 0)")
have_func("uname")
end
if enable_config("socks", ENV["SOCKS_SERVER"])
diff --git a/ext/socket/init.c b/ext/socket/init.c
index 8df1aee9bf..696b62d82a 100644
--- a/ext/socket/init.c
+++ b/ext/socket/init.c
@@ -52,6 +52,7 @@ rsock_init_sock(VALUE sock, int fd)
if (!S_ISSOCK(sbuf.st_mode))
rb_raise(rb_eArgError, "not a socket file descriptor");
#else
+ rb_update_max_fd(fd);
if (!rb_w32_is_socket(fd))
rb_raise(rb_eArgError, "not a socket file descriptor");
#endif
@@ -239,17 +240,49 @@ rsock_s_recvfrom_nonblock(VALUE sock, int argc, VALUE *argv, enum sock_recv_type
return rb_assoc_new(str, addr);
}
+static int
+rsock_socket0(int domain, int type, int proto)
+{
+ int ret;
+
+#ifdef SOCK_CLOEXEC
+ static int try_sock_cloexec = 1;
+ if (try_sock_cloexec) {
+ ret = socket(domain, type|SOCK_CLOEXEC, proto);
+ if (ret == -1 && errno == EINVAL) {
+ /* SOCK_CLOEXEC is available since Linux 2.6.27. Linux 2.6.18 fails with EINVAL */
+ ret = socket(domain, type, proto);
+ if (ret != -1) {
+ try_sock_cloexec = 0;
+ }
+ }
+ }
+ else {
+ ret = socket(domain, type, proto);
+ }
+#else
+ ret = socket(domain, type, proto);
+#endif
+ if (ret == -1)
+ return -1;
+
+ rb_fd_fix_cloexec(ret);
+
+ return ret;
+
+}
+
int
rsock_socket(int domain, int type, int proto)
{
int fd;
- fd = socket(domain, type, proto);
+ fd = rsock_socket0(domain, type, proto);
if (fd < 0) {
- if (errno == EMFILE || errno == ENFILE) {
- rb_gc();
- fd = socket(domain, type, proto);
- }
+ if (errno == EMFILE || errno == ENFILE) {
+ rb_gc();
+ fd = rsock_socket0(domain, type, proto);
+ }
}
if (0 <= fd)
rb_update_max_fd(fd);
@@ -444,6 +477,37 @@ make_fd_nonblock(int fd)
}
}
+static int
+cloexec_accept(int socket, struct sockaddr *address, socklen_t *address_len)
+{
+ int ret;
+#ifdef HAVE_ACCEPT4
+ static int try_accept4 = 1;
+ if (try_accept4) {
+ ret = accept4(socket, address, address_len, SOCK_CLOEXEC);
+ /* accept4 is available since Linux 2.6.28, glibc 2.10. */
+ if (ret != -1) {
+ if (ret <= 2)
+ rb_maygvl_fd_fix_cloexec(ret);
+ return ret;
+ }
+ if (errno == ENOSYS) {
+ try_accept4 = 0;
+ ret = accept(socket, address, address_len);
+ }
+ }
+ else {
+ ret = accept(socket, address, address_len);
+ }
+#else
+ ret = accept(socket, address, address_len);
+#endif
+ if (ret == -1) return -1;
+ rb_maygvl_fd_fix_cloexec(ret);
+ return ret;
+}
+
+
VALUE
rsock_s_accept_nonblock(VALUE klass, rb_io_t *fptr, struct sockaddr *sockaddr, socklen_t *len)
{
@@ -451,7 +515,7 @@ rsock_s_accept_nonblock(VALUE klass, rb_io_t *fptr, struct sockaddr *sockaddr, s
rb_secure(3);
rb_io_set_nonblock(fptr);
- fd2 = accept(fptr->fd, (struct sockaddr*)sockaddr, len);
+ fd2 = cloexec_accept(fptr->fd, (struct sockaddr*)sockaddr, len);
if (fd2 < 0) {
switch (errno) {
case EAGAIN:
@@ -481,7 +545,7 @@ static VALUE
accept_blocking(void *data)
{
struct accept_arg *arg = data;
- return (VALUE)accept(arg->fd, arg->sockaddr, arg->len);
+ return (VALUE)cloexec_accept(arg->fd, arg->sockaddr, arg->len);
}
VALUE
@@ -531,12 +595,12 @@ rsock_getfamily(int sockfd)
return ss.ss_family;
}
-/*
- * SocketError is the error class for socket.
- */
void
rsock_init_socket_init()
{
+ /*
+ * SocketError is the error class for socket.
+ */
rb_eSocket = rb_define_class("SocketError", rb_eStandardError);
rsock_init_ipsocket();
rsock_init_tcpsocket();
diff --git a/ext/socket/ipsocket.c b/ext/socket/ipsocket.c
index 9d713d0afd..b1085cd70c 100644
--- a/ext/socket/ipsocket.c
+++ b/ext/socket/ipsocket.c
@@ -105,7 +105,7 @@ init_inetsock_internal(struct inetsock_arg *arg)
arg->fd = -1;
if (type == INET_SERVER) {
- status = listen(fd, 5);
+ status = listen(fd, SOMAXCONN);
if (status < 0) {
close(fd);
rb_sys_fail("listen(2)");
@@ -214,7 +214,7 @@ ip_addr(int argc, VALUE *argv, VALUE sock)
*
* TCPSocket.open("www.ruby-lang.org", 80) {|sock|
* p sock.peeraddr #=> ["AF_INET", 80, "carbon.ruby-lang.org", "221.186.184.68"]
- * p sock.peeraddr(true) #=> ["AF_INET", 80, "221.186.184.68", "221.186.184.68"]
+ * p sock.peeraddr(true) #=> ["AF_INET", 80, "carbon.ruby-lang.org", "221.186.184.68"]
* p sock.peeraddr(false) #=> ["AF_INET", 80, "221.186.184.68", "221.186.184.68"]
* p sock.peeraddr(:hostname) #=> ["AF_INET", 80, "carbon.ruby-lang.org", "221.186.184.68"]
* p sock.peeraddr(:numeric) #=> ["AF_INET", 80, "221.186.184.68", "221.186.184.68"]
@@ -288,14 +288,14 @@ ip_s_getaddress(VALUE obj, VALUE host)
return rsock_make_ipaddr((struct sockaddr*)&addr);
}
-/*
- * Document-class: ::IPSocket < BasicSocket
- *
- * IPSocket is the super class of TCPSocket and UDPSocket.
- */
void
rsock_init_ipsocket(void)
{
+ /*
+ * Document-class: IPSocket < BasicSocket
+ *
+ * IPSocket is the super class of TCPSocket and UDPSocket.
+ */
rb_cIPSocket = rb_define_class("IPSocket", rb_cBasicSocket);
rb_define_method(rb_cIPSocket, "addr", ip_addr, -1);
rb_define_method(rb_cIPSocket, "peeraddr", ip_peeraddr, -1);
diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb
index 621a60c9f6..10ab13b953 100644
--- a/ext/socket/lib/socket.rb
+++ b/ext/socket/lib/socket.rb
@@ -16,6 +16,12 @@ class Addrinfo
raise ArgumentError, "no address specified"
elsif Addrinfo === args.first
raise ArgumentError, "too many arguments" if args.length != 1
+ addrinfo = args.first
+ if (self.pfamily != addrinfo.pfamily) ||
+ (self.socktype != addrinfo.socktype)
+ raise ArgumentError, "Addrinfo type mismatch"
+ end
+ addrinfo
elsif self.ip?
raise ArgumentError, "IP address needs host and port but #{args.length} arguments given" if args.length != 2
host, port = args
@@ -31,16 +37,33 @@ class Addrinfo
# creates a new Socket connected to the address of +local_addrinfo+.
#
- # If no arguments are given, the address of the socket is not bound.
+ # If _local_addrinfo_ is nil, the address of the socket is not bound.
+ #
+ # The _timeout_ specify the seconds for timeout.
+ # Errno::ETIMEDOUT is raised when timeout occur.
#
# If a block is given the created socket is yielded for each address.
#
- def connect_internal(local_addrinfo) # :yields: socket
+ def connect_internal(local_addrinfo, timeout=nil) # :yields: socket
sock = Socket.new(self.pfamily, self.socktype, self.protocol)
begin
sock.ipv6only! if self.ipv6?
sock.bind local_addrinfo if local_addrinfo
- sock.connect(self)
+ if timeout
+ begin
+ sock.connect_nonblock(self)
+ rescue IO::WaitWritable
+ if !IO.select(nil, [sock], nil, timeout)
+ raise Errno::ETIMEDOUT, 'user specified timeout'
+ end
+ begin
+ sock.connect_nonblock(self) # check connection failure
+ rescue Errno::EISCONN
+ end
+ end
+ else
+ sock.connect(self)
+ end
if block_given?
yield sock
else
@@ -52,13 +75,22 @@ class Addrinfo
end
private :connect_internal
+ # :call-seq:
+ # addrinfo.connect_from([local_addr_args], [opts]) {|socket| ... }
+ # addrinfo.connect_from([local_addr_args], [opts])
+ #
# creates a socket connected to the address of self.
#
# If one or more arguments given as _local_addr_args_,
# it is used as the local address of the socket.
# _local_addr_args_ is given for family_addrinfo to obtain actual address.
#
- # If no arguments given, the local address of the socket is not bound.
+ # If _local_addr_args_ is not given, the local address of the socket is not bound.
+ #
+ # The optional last argument _opts_ is options represented by a hash.
+ # _opts_ may have following options:
+ #
+ # [:timeout] specify the timeout in seconds.
#
# If a block is given, it is called with the socket and the value of the block is returned.
# The socket is returned otherwise.
@@ -74,12 +106,23 @@ class Addrinfo
# puts s.read
# }
#
- def connect_from(*local_addr_args, &block)
- connect_internal(family_addrinfo(*local_addr_args), &block)
+ def connect_from(*args, &block)
+ opts = Hash === args.last ? args.pop : {}
+ local_addr_args = args
+ connect_internal(family_addrinfo(*local_addr_args), opts[:timeout], &block)
end
+ # :call-seq:
+ # addrinfo.connect([opts]) {|socket| ... }
+ # addrinfo.connect([opts])
+ #
# creates a socket connected to the address of self.
#
+ # The optional argument _opts_ is options represented by a hash.
+ # _opts_ may have following options:
+ #
+ # [:timeout] specify the timeout in seconds.
+ #
# If a block is given, it is called with the socket and the value of the block is returned.
# The socket is returned otherwise.
#
@@ -88,12 +131,21 @@ class Addrinfo
# puts s.read
# }
#
- def connect(&block)
- connect_internal(nil, &block)
+ def connect(opts={}, &block)
+ connect_internal(nil, opts[:timeout], &block)
end
+ # :call-seq:
+ # addrinfo.connect_to([remote_addr_args], [opts]) {|socket| ... }
+ # addrinfo.connect_to([remote_addr_args], [opts])
+ #
# creates a socket connected to _remote_addr_args_ and bound to self.
#
+ # The optional last argument _opts_ is options represented by a hash.
+ # _opts_ may have following options:
+ #
+ # [:timeout] specify the timeout in seconds.
+ #
# If a block is given, it is called with the socket and the value of the block is returned.
# The socket is returned otherwise.
#
@@ -102,9 +154,11 @@ class Addrinfo
# puts s.read
# }
#
- def connect_to(*remote_addr_args, &block)
+ def connect_to(*args, &block)
+ opts = Hash === args.last ? args.pop : {}
+ remote_addr_args = args
remote_addrinfo = family_addrinfo(*remote_addr_args)
- remote_addrinfo.send(:connect_internal, self, &block)
+ remote_addrinfo.send(:connect_internal, self, opts[:timeout], &block)
end
# creates a socket bound to self.
@@ -134,7 +188,7 @@ class Addrinfo
end
# creates a listening socket bound to self.
- def listen(backlog=5)
+ def listen(backlog=Socket::SOMAXCONN)
sock = Socket.new(self.pfamily, self.socktype, self.protocol)
begin
sock.ipv6only! if self.ipv6?
@@ -216,15 +270,29 @@ class Socket < BasicSocket
end
end
+ # :call-seq:
+ # Socket.tcp(host, port, local_host=nil, local_port=nil, [opts]) {|socket| ... }
+ # Socket.tcp(host, port, local_host=nil, local_port=nil, [opts])
+ #
# creates a new socket object connected to host:port using TCP/IP.
#
# If local_host:local_port is given,
# the socket is bound to it.
#
+ # The optional last argument _opts_ is options represented by a hash.
+ # _opts_ may have following options:
+ #
+ # [:connect_timeout] specify the timeout in seconds.
+ #
# If a block is given, the block is called with the socket.
# The value of the block is returned.
# The socket is closed when this method returns.
#
+ # The optional last argument _opts_ is options represented by a hash.
+ # _opts_ may have following options:
+ #
+ # [:timeout] specify the timeout in seconds.
+ #
# If no block is given, the socket is returned.
#
# Socket.tcp("www.ruby-lang.org", 80) {|sock|
@@ -233,10 +301,15 @@ class Socket < BasicSocket
# puts sock.read
# }
#
- def self.tcp(host, port, local_host=nil, local_port=nil) # :yield: socket
+ def self.tcp(host, port, *rest) # :yield: socket
+ opts = Hash === rest.last ? rest.pop : {}
+ raise ArgumentError, "wrong number of arguments (#{rest.length} for 2)" if 2 < rest.length
+ local_host, local_port = rest
last_error = nil
ret = nil
+ connect_timeout = opts[:connect_timeout]
+
local_addr_list = nil
if local_host != nil || local_port != nil
local_addr_list = Addrinfo.getaddrinfo(local_host, local_port, nil, :STREAM, nil)
@@ -250,7 +323,9 @@ class Socket < BasicSocket
local_addr = nil
end
begin
- sock = local_addr ? ai.connect_from(local_addr) : ai.connect
+ sock = local_addr ?
+ ai.connect_from(local_addr, :timeout => connect_timeout) :
+ ai.connect(:timeout => connect_timeout)
rescue SystemCallError
last_error = $!
next
@@ -317,7 +392,7 @@ class Socket < BasicSocket
ai_list = Addrinfo.getaddrinfo(host, 0, nil, :STREAM, nil, Socket::AI_PASSIVE)
sockets = ip_sockets_port0(ai_list, true)
sockets.each {|s|
- s.listen(5)
+ s.listen(Socket::SOMAXCONN)
}
sockets
ensure
@@ -643,17 +718,28 @@ class Socket < BasicSocket
# UDP/IP address information used by Socket.udp_server_loop.
class UDPSource
+ # +remote_adress+ is an Addrinfo object.
+ #
+ # +local_adress+ is an Addrinfo object.
+ #
+ # +reply_proc+ is a Proc used to send reply back to the source.
def initialize(remote_address, local_address, &reply_proc)
@remote_address = remote_address
@local_address = local_address
@reply_proc = reply_proc
end
- attr_reader :remote_address, :local_address
- def inspect
+ # Address of the source
+ attr_reader :remote_address
+
+ # Local address
+ attr_reader :local_address
+
+ def inspect # :nodoc:
"\#<#{self.class}: #{@remote_address.inspect_sockaddr} to #{@local_address.inspect_sockaddr}>"
end
+ # Sends the String +msg+ to the source
def reply(msg)
@reply_proc.call msg
end
diff --git a/ext/socket/mkconstants.rb b/ext/socket/mkconstants.rb
index 124a094946..3b63c39eff 100644
--- a/ext/socket/mkconstants.rb
+++ b/ext/socket/mkconstants.rb
@@ -284,18 +284,20 @@ result = ERB.new(<<'EOS', nil, '%').result(binding)
<%= INTERN_DEFS.map {|vardef, gen_hash, decl, func| vardef }.join("\n") %>
-/*
- * Document-module: ::Socket::Constants
- *
- * Socket::Constants provides socket related constants.
- * Following lists possible constants.
- * If underlying platform doesn't define a constant,
- * the corresponding Ruby constant is not defined.
- *
- */
static void
init_constants(void)
{
+ /*
+ * Document-module: Socket::Constants
+ *
+ * Socket::Constants provides socket-related constants. All possible
+ * socket constants are listed in the documentation but they may not all
+ * be present on your platform.
+ *
+ * If the underlying platform doesn't define a constant the corresponding
+ * Ruby constant is not defined.
+ *
+ */
rb_mSockConst = rb_define_module_under(rb_cSocket, "Constants");
<%= gen_const_defs %>
@@ -688,7 +690,7 @@ INET6_ADDRSTRLEN 46 Maximum length of an IPv6 address string
IFNAMSIZ nil Maximum interface name size
IF_NAMESIZE nil Maximum interface name size
-SOMAXCONN nil Maximum connection requests that may be queued for a socket
+SOMAXCONN 5 Maximum connection requests that may be queued for a socket
SCM_RIGHTS nil Access rights
SCM_TIMESTAMP nil Timestamp (timeval)
diff --git a/ext/socket/option.c b/ext/socket/option.c
index 49288a17eb..e3e59cf0c5 100644
--- a/ext/socket/option.c
+++ b/ext/socket/option.c
@@ -61,8 +61,7 @@ sockopt_initialize(VALUE self, VALUE vfamily, VALUE vlevel, VALUE voptname, VALU
VALUE
rsock_sockopt_new(int family, int level, int optname, VALUE data)
{
- NEWOBJ(obj, struct RObject);
- OBJSETUP(obj, rb_cSockOpt, T_OBJECT);
+ NEWOBJ_OF(obj, struct RObject, rb_cSockOpt, T_OBJECT);
StringValue(data);
sockopt_initialize((VALUE)obj, INT2NUM(family), INT2NUM(level), INT2NUM(optname), data);
return (VALUE)obj;
@@ -437,7 +436,7 @@ inspect_timeval_as_interval(int level, int optname, VALUE data, VALUE ret)
*/
#ifndef HAVE_INET_NTOP
-static char *
+static const char *
inet_ntop(int af, const void *addr, char *numaddr, size_t numaddr_len)
{
#ifdef HAVE_INET_NTOA
@@ -452,6 +451,8 @@ inet_ntop(int af, const void *addr, char *numaddr, size_t numaddr_len)
#endif
return numaddr;
}
+#elif defined __MINGW64__
+# define inet_ntop(f,a,n,l) rb_w32_inet_ntop(f,a,n,l)
#endif
/* Although the buffer size needed depends on the prefixes, "%u" may generate "4294967295". */
@@ -888,16 +889,17 @@ sockopt_unpack(VALUE self, VALUE template)
return rb_funcall(sockopt_data(self), rb_intern("unpack"), 1, template);
}
-/*
- * Document-class: ::Socket::Option
- *
- * Socket::Option represents a socket option used by getsockopt and setsockopt
- * system call.
- * It contains socket family, protocol level, option name and option value.
- */
void
rsock_init_sockopt(void)
{
+ /*
+ * Document-class: Socket::Option
+ *
+ * Socket::Option represents a socket option used by
+ * BasicSocket#getsockopt and BasicSocket#setsockopt. A socket option
+ * contains the socket #family, protocol #level, option name #optname and
+ * option value #data.
+ */
rb_cSockOpt = rb_define_class_under(rb_cSocket, "Option", rb_cObject);
rb_define_method(rb_cSockOpt, "initialize", sockopt_initialize, 4);
rb_define_method(rb_cSockOpt, "family", sockopt_family_m, 0);
diff --git a/ext/socket/raddrinfo.c b/ext/socket/raddrinfo.c
index 25bd5bbd22..6a5129efa8 100644
--- a/ext/socket/raddrinfo.c
+++ b/ext/socket/raddrinfo.c
@@ -154,12 +154,12 @@ struct getaddrinfo_arg
struct addrinfo **res;
};
-static VALUE
+static void *
nogvl_getaddrinfo(void *arg)
{
struct getaddrinfo_arg *ptr = arg;
- return getaddrinfo(ptr->node, ptr->service,
- ptr->hints, ptr->res);
+ return (void *)(VALUE)getaddrinfo(ptr->node, ptr->service,
+ ptr->hints, ptr->res);
}
#endif
@@ -178,7 +178,7 @@ rb_getaddrinfo(const char *node, const char *service,
arg.service = service;
arg.hints = hints;
arg.res = res;
- ret = (int)BLOCKING_REGION(nogvl_getaddrinfo, &arg);
+ ret = (int)(VALUE)rb_thread_call_without_gvl(nogvl_getaddrinfo, &arg, RUBY_UBF_IO, 0);
return ret;
#endif
}
@@ -195,14 +195,14 @@ struct getnameinfo_arg
int flags;
};
-static VALUE
+static void *
nogvl_getnameinfo(void *arg)
{
struct getnameinfo_arg *ptr = arg;
- return getnameinfo(ptr->sa, ptr->salen,
- ptr->host, (socklen_t)ptr->hostlen,
- ptr->serv, (socklen_t)ptr->servlen,
- ptr->flags);
+ return (void *)(VALUE)getnameinfo(ptr->sa, ptr->salen,
+ ptr->host, (socklen_t)ptr->hostlen,
+ ptr->serv, (socklen_t)ptr->servlen,
+ ptr->flags);
}
#endif
@@ -223,7 +223,7 @@ rb_getnameinfo(const struct sockaddr *sa, socklen_t salen,
arg.serv = serv;
arg.servlen = servlen;
arg.flags = flags;
- ret = (int)BLOCKING_REGION(nogvl_getnameinfo, &arg);
+ ret = (int)(VALUE)rb_thread_call_without_gvl(nogvl_getnameinfo, &arg, RUBY_UBF_IO, 0);
return ret;
#endif
}
@@ -421,20 +421,25 @@ rsock_ipaddr(struct sockaddr *sockaddr, int norevlookup)
}
#ifdef HAVE_SYS_UN_H
-const char*
-rsock_unixpath(struct sockaddr_un *sockaddr, socklen_t len)
+VALUE
+rsock_unixpath_str(struct sockaddr_un *sockaddr, socklen_t len)
{
- if (sockaddr->sun_path < (char*)sockaddr + len)
- return sockaddr->sun_path;
+ char *s, *e;
+ s = sockaddr->sun_path;
+ e = (char *)sockaddr + len;
+ while (s < e && *(e-1) == '\0')
+ e--;
+ if (s <= e)
+ return rb_str_new(s, e-s);
else
- return "";
+ return rb_str_new2("");
}
VALUE
rsock_unixaddr(struct sockaddr_un *sockaddr, socklen_t len)
{
return rb_assoc_new(rb_str_new2("AF_UNIX"),
- rb_str_new2(rsock_unixpath(sockaddr, len)));
+ rsock_unixpath_str(sockaddr, len));
}
#endif
@@ -661,31 +666,32 @@ make_inspectname(VALUE node, VALUE service, struct addrinfo *res)
VALUE inspectname = Qnil;
if (res) {
+ /* drop redundant information which also shown in address:port part. */
char hbuf[NI_MAXHOST], pbuf[NI_MAXSERV];
int ret;
ret = rb_getnameinfo(res->ai_addr, res->ai_addrlen, hbuf,
sizeof(hbuf), pbuf, sizeof(pbuf),
NI_NUMERICHOST|NI_NUMERICSERV);
if (ret == 0) {
- if (TYPE(node) == T_STRING && strcmp(hbuf, RSTRING_PTR(node)) == 0)
+ if (RB_TYPE_P(node, T_STRING) && strcmp(hbuf, RSTRING_PTR(node)) == 0)
node = Qnil;
- if (TYPE(service) == T_STRING && strcmp(pbuf, RSTRING_PTR(service)) == 0)
+ if (RB_TYPE_P(service, T_STRING) && strcmp(pbuf, RSTRING_PTR(service)) == 0)
service = Qnil;
- else if (TYPE(service) == T_FIXNUM && atoi(pbuf) == FIX2INT(service))
+ else if (RB_TYPE_P(service, T_FIXNUM) && atoi(pbuf) == FIX2INT(service))
service = Qnil;
}
}
- if (TYPE(node) == T_STRING) {
+ if (RB_TYPE_P(node, T_STRING)) {
inspectname = rb_str_dup(node);
}
- if (TYPE(service) == T_STRING) {
+ if (RB_TYPE_P(service, T_STRING)) {
if (NIL_P(inspectname))
inspectname = rb_sprintf(":%s", StringValueCStr(service));
else
rb_str_catf(inspectname, ":%s", StringValueCStr(service));
}
- else if (TYPE(service) == T_FIXNUM && FIX2INT(service) != 0)
+ else if (RB_TYPE_P(service, T_FIXNUM) && FIX2INT(service) != 0)
{
if (NIL_P(inspectname))
inspectname = rb_sprintf(":%d", FIX2INT(service));
@@ -766,9 +772,10 @@ init_unix_addrinfo(rb_addrinfo_t *rai, VALUE path, int socktype)
StringValue(path);
- if (sizeof(un.sun_path) <= (size_t)RSTRING_LEN(path))
- rb_raise(rb_eArgError, "too long unix socket path (max: %dbytes)",
- (int)sizeof(un.sun_path)-1);
+ if (sizeof(un.sun_path) < (size_t)RSTRING_LEN(path))
+ rb_raise(rb_eArgError,
+ "too long unix socket path (%"PRIuSIZE" bytes given but %"PRIuSIZE" bytes max)",
+ (size_t)RSTRING_LEN(path), sizeof(un.sun_path));
MEMZERO(&un, struct sockaddr_un, 1);
@@ -996,9 +1003,11 @@ inspect_sockaddr(VALUE addrinfo, VALUE ret)
case AF_UNIX:
{
struct sockaddr_un *addr = (struct sockaddr_un *)&rai->addr;
- char *p, *s, *t, *e;
+ char *p, *s, *e;
s = addr->sun_path;
e = (char*)addr + rai->sockaddr_len;
+ while (s < e && *(e-1) == '\0')
+ e--;
if (e < s)
rb_str_cat2(ret, "too-short-AF_UNIX-sockaddr");
else if (s == e)
@@ -1006,28 +1015,17 @@ inspect_sockaddr(VALUE addrinfo, VALUE ret)
else {
int printable_only = 1;
p = s;
- while (p < e && *p != '\0') {
+ while (p < e) {
printable_only = printable_only && ISPRINT(*p) && !ISSPACE(*p);
p++;
}
- t = p;
- while (p < e && *p == '\0')
- p++;
- if (printable_only && /* only printable, no space */
- t < e && /* NUL terminated */
- p == e) { /* no data after NUL */
- if (s == t)
- rb_str_cat2(ret, "empty-path-AF_UNIX-sockaddr");
- else if (s[0] == '/') /* absolute path */
- rb_str_cat2(ret, s);
- else
- rb_str_catf(ret, "AF_UNIX %s", s);
+ if (printable_only) { /* only printable, no space */
+ if (s[0] != '/') /* relative path */
+ rb_str_cat2(ret, "AF_UNIX ");
+ rb_str_cat(ret, s, p - s);
}
else {
rb_str_cat2(ret, "AF_UNIX");
- e = (char *)addr->sun_path + sizeof(addr->sun_path);
- while (s < e && *(e-1) == '\0')
- e--;
while (s < e)
rb_str_catf(ret, ":%02x", (unsigned char)*s++);
}
@@ -1060,7 +1058,7 @@ inspect_sockaddr(VALUE addrinfo, VALUE ret)
*
* returns a string which shows addrinfo in human-readable form.
*
- * Addrinfo.tcp("localhost", 80).inspect #=> "#<Addrinfo: 127.0.0.1:80 TCP (localhost:80)>"
+ * Addrinfo.tcp("localhost", 80).inspect #=> "#<Addrinfo: 127.0.0.1:80 TCP (localhost)>"
* Addrinfo.unix("/tmp/sock").inspect #=> "#<Addrinfo: /tmp/sock SOCK_STREAM>"
*
*/
@@ -1201,7 +1199,7 @@ addrinfo_mdump(VALUE self)
struct sockaddr_un *su = (struct sockaddr_un *)&rai->addr;
char *s, *e;
s = su->sun_path;
- e = (char*)s + sizeof(su->sun_path);
+ e = (char*)su + rai->sockaddr_len;
while (s < e && *(e-1) == '\0')
e--;
sockaddr = rb_str_new(s, e-s);
@@ -1298,12 +1296,14 @@ addrinfo_mload(VALUE self, VALUE ary)
case AF_UNIX:
{
struct sockaddr_un uaddr;
- memset(&uaddr, 0, sizeof(uaddr));
+ MEMZERO(&uaddr, struct sockaddr_un, 1);
uaddr.sun_family = AF_UNIX;
StringValue(v);
- if (sizeof(uaddr.sun_path) <= (size_t)RSTRING_LEN(v))
- rb_raise(rb_eSocket, "too long AF_UNIX path");
+ if (sizeof(uaddr.sun_path) < (size_t)RSTRING_LEN(v))
+ rb_raise(rb_eSocket,
+ "too long AF_UNIX path (%"PRIuSIZE" bytes given but %"PRIuSIZE" bytes max)",
+ (size_t)RSTRING_LEN(v), sizeof(uaddr.sun_path));
memcpy(uaddr.sun_path, RSTRING_PTR(v), RSTRING_LEN(v));
len = (socklen_t)sizeof(uaddr);
memcpy(&ss, &uaddr, len);
@@ -1432,7 +1432,7 @@ addrinfo_to_sockaddr(VALUE self)
* The canonical name is set by Addrinfo.getaddrinfo when AI_CANONNAME is specified.
*
* list = Addrinfo.getaddrinfo("www.ruby-lang.org", 80, :INET, :STREAM, nil, Socket::AI_CANONNAME)
- * p list[0] #=> #<Addrinfo: 221.186.184.68:80 TCP carbon.ruby-lang.org (www.ruby-lang.org:80)>
+ * p list[0] #=> #<Addrinfo: 221.186.184.68:80 TCP carbon.ruby-lang.org (www.ruby-lang.org)>
* p list[0].canonname #=> "carbon.ruby-lang.org"
*
*/
@@ -1793,6 +1793,18 @@ addrinfo_ipv6_sitelocal_p(VALUE self)
}
/*
+ * Returns true for IPv6 unique local address (fc00::/7, RFC4193).
+ * It returns false otherwise.
+ */
+static VALUE
+addrinfo_ipv6_unique_local_p(VALUE self)
+{
+ struct in6_addr *addr = extract_in6_addr(self);
+ if (addr && IN6_IS_ADDR_UNIQUE_LOCAL(addr)) return Qtrue;
+ return Qfalse;
+}
+
+/*
* Returns true for IPv4-mapped IPv6 address (::ffff:0:0/80).
* It returns false otherwise.
*/
@@ -1936,9 +1948,12 @@ addrinfo_unix_path(VALUE self)
s = addr->sun_path;
e = (char*)addr + rai->sockaddr_len;
if (e < s)
- rb_raise(rb_eSocket, "too short AF_UNIX address");
+ rb_raise(rb_eSocket, "too short AF_UNIX address: %"PRIuSIZE" bytes given for minimum %"PRIuSIZE" bytes.",
+ (size_t)rai->sockaddr_len, (size_t)(s - (char *)addr));
if (addr->sun_path + sizeof(addr->sun_path) < e)
- rb_raise(rb_eSocket, "too long AF_UNIX address");
+ rb_raise(rb_eSocket,
+ "too long AF_UNIX path (%"PRIuSIZE" bytes given but %"PRIuSIZE" bytes max)",
+ (size_t)(e - addr->sun_path), sizeof(addr->sun_path));
while (s < e && *(e-1) == '\0')
e--;
return rb_str_new(s, e-s);
@@ -1968,15 +1983,24 @@ addrinfo_unix_path(VALUE self)
*
* Similarly, PF_INET6 as family restricts for IPv6.
*
- * flags should be bitwise OR of Socket::AI_??? constants.
+ * flags should be bitwise OR of Socket::AI_??? constants such as follows.
+ * Note that the exact list of the constants depends on OS.
+ *
+ * AI_PASSIVE Get address to use with bind()
+ * AI_CANONNAME Fill in the canonical name
+ * AI_NUMERICHOST Prevent host name resolution
+ * AI_NUMERICSERV Prevent service name resolution
+ * AI_V4MAPPED Accept IPv4-mapped IPv6 addresses
+ * AI_ALL Allow all addresses
+ * AI_ADDRCONFIG Accept only if any address is assigned
*
* Note that socktype should be specified whenever application knows the usage of the address.
* Some platform causes an error when socktype is omitted and servname is specified as an integer
* because some port numbers, 512 for example, are ambiguous without socktype.
*
* Addrinfo.getaddrinfo("www.kame.net", 80, nil, :STREAM)
- * #=> [#<Addrinfo: 203.178.141.194:80 TCP (www.kame.net:80)>,
- * # #<Addrinfo: [2001:200:0:8002:203:47ff:fea5:3085]:80 TCP (www.kame.net:80)>]
+ * #=> [#<Addrinfo: 203.178.141.194:80 TCP (www.kame.net)>,
+ * # #<Addrinfo: [2001:200:dff:fff1:216:3eff:feb1:44d7]:80 TCP (www.kame.net)>]
*
*/
static VALUE
@@ -2143,6 +2167,8 @@ rsock_io_socket_addrinfo(VALUE io, struct sockaddr *addr, socklen_t len)
default:
rb_raise(rb_eTypeError, "neither IO nor file descriptor");
}
+
+ UNREACHABLE;
}
/*
@@ -2151,6 +2177,10 @@ rsock_io_socket_addrinfo(VALUE io, struct sockaddr *addr, socklen_t len)
void
rsock_init_addrinfo(void)
{
+ /*
+ * The Addrinfo class maps <tt>struct addrinfo</tt> to ruby. This
+ * structure identifies an Internet host and a service.
+ */
rb_cAddrinfo = rb_define_class("Addrinfo", rb_cData);
rb_define_alloc_func(rb_cAddrinfo, addrinfo_s_allocate);
rb_define_method(rb_cAddrinfo, "initialize", addrinfo_initialize, -1);
@@ -2189,6 +2219,7 @@ rsock_init_addrinfo(void)
rb_define_method(rb_cAddrinfo, "ipv6_multicast?", addrinfo_ipv6_multicast_p, 0);
rb_define_method(rb_cAddrinfo, "ipv6_linklocal?", addrinfo_ipv6_linklocal_p, 0);
rb_define_method(rb_cAddrinfo, "ipv6_sitelocal?", addrinfo_ipv6_sitelocal_p, 0);
+ rb_define_method(rb_cAddrinfo, "ipv6_unique_local?", addrinfo_ipv6_unique_local_p, 0);
rb_define_method(rb_cAddrinfo, "ipv6_v4mapped?", addrinfo_ipv6_v4mapped_p, 0);
rb_define_method(rb_cAddrinfo, "ipv6_v4compat?", addrinfo_ipv6_v4compat_p, 0);
rb_define_method(rb_cAddrinfo, "ipv6_mc_nodelocal?", addrinfo_ipv6_mc_nodelocal_p, 0);
diff --git a/ext/socket/rubysocket.h b/ext/socket/rubysocket.h
index 4c0efdb479..33cb51a5c9 100644
--- a/ext/socket/rubysocket.h
+++ b/ext/socket/rubysocket.h
@@ -3,6 +3,7 @@
#include "ruby/ruby.h"
#include "ruby/io.h"
+#include "ruby/thread.h"
#include "ruby/util.h"
#include "internal.h"
#include <stdio.h>
@@ -116,6 +117,10 @@
# define IS_IP_FAMILY(af) ((af) == AF_INET)
#endif
+#ifndef IN6_IS_ADDR_UNIQUE_LOCAL
+# define IN6_IS_ADDR_UNIQUE_LOCAL(a) (((a)->s6_addr[0] == 0xfc) || ((a)->s6_addr[0] == 0xfd))
+#endif
+
#ifndef HAVE_SOCKADDR_STORAGE
/*
* RFC 2553: protocol-independent placeholder for socket addresses
@@ -139,7 +144,7 @@ struct sockaddr_storage {
};
#endif
-#if defined __APPLE__ && defined __MACH__
+#ifdef __APPLE__
/*
* CMSG_ macros are broken on 64bit darwin, because __DARWIN_ALIGN
* aligns up to __darwin_size_t which is 64bit, but CMSG_DATA is
@@ -233,7 +238,7 @@ VALUE rsock_make_hostent(VALUE host, struct addrinfo *addr, VALUE (*ipaddr)(stru
int rsock_revlookup_flag(VALUE revlookup, int *norevlookup);
#ifdef HAVE_SYS_UN_H
-const char* rsock_unixpath(struct sockaddr_un *sockaddr, socklen_t len);
+VALUE rsock_unixpath_str(struct sockaddr_un *sockaddr, socklen_t len);
VALUE rsock_unixaddr(struct sockaddr_un *sockaddr, socklen_t len);
#endif
@@ -282,6 +287,7 @@ VALUE rsock_bsock_sendmsg_nonblock(int argc, VALUE *argv, VALUE sock);
#if defined(HAVE_RECVMSG)
VALUE rsock_bsock_recvmsg(int argc, VALUE *argv, VALUE sock);
VALUE rsock_bsock_recvmsg_nonblock(int argc, VALUE *argv, VALUE sock);
+ssize_t rsock_recvmsg(int socket, struct msghdr *message, int flags);
#else
#define rsock_bsock_recvmsg rb_f_notimplement
#define rsock_bsock_recvmsg_nonblock rb_f_notimplement
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index c2743cd621..09c22d6d69 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -27,9 +27,8 @@ setup_domain_and_type(VALUE domain, int *dv, VALUE type, int *tv)
*
* _socktype_ should be a socket type such as: :STREAM, :DGRAM, :RAW, etc.
*
- * _protocol_ should be a protocol defined in the domain.
- * This is optional.
- * If it is not given, 0 is used internally.
+ * _protocol_ is optional and should be a protocol defined in the domain.
+ * If protocol is not given, 0 is used internally.
*
* Socket.new(:INET, :STREAM) # TCP socket
* Socket.new(:INET, :DGRAM) # UDP socket
@@ -76,6 +75,59 @@ pair_yield(VALUE pair)
#endif
#if defined HAVE_SOCKETPAIR
+
+static int
+rsock_socketpair0(int domain, int type, int protocol, int sv[2])
+{
+ int ret;
+
+#ifdef SOCK_CLOEXEC
+ static int try_sock_cloexec = 1;
+ if (try_sock_cloexec) {
+ ret = socketpair(domain, type|SOCK_CLOEXEC, protocol, sv);
+ if (ret == -1 && errno == EINVAL) {
+ /* SOCK_CLOEXEC is available since Linux 2.6.27. Linux 2.6.18 fails with EINVAL */
+ ret = socketpair(domain, type, protocol, sv);
+ if (ret != -1) {
+ /* The reason of EINVAL may be other than SOCK_CLOEXEC.
+ * So disable SOCK_CLOEXEC only if socketpair() succeeds without SOCK_CLOEXEC.
+ * Ex. Socket.pair(:UNIX, 0xff) fails with EINVAL.
+ */
+ try_sock_cloexec = 0;
+ }
+ }
+ }
+ else {
+ ret = socketpair(domain, type, protocol, sv);
+ }
+#else
+ ret = socketpair(domain, type, protocol, sv);
+#endif
+
+ if (ret == -1) {
+ return -1;
+ }
+
+ rb_fd_fix_cloexec(sv[0]);
+ rb_fd_fix_cloexec(sv[1]);
+
+ return ret;
+}
+
+static int
+rsock_socketpair(int domain, int type, int protocol, int sv[2])
+{
+ int ret;
+
+ ret = rsock_socketpair0(domain, type, protocol, sv);
+ if (ret < 0 && (errno == EMFILE || errno == ENFILE)) {
+ rb_gc();
+ ret = rsock_socketpair0(domain, type, protocol, sv);
+ }
+
+ return ret;
+}
+
/*
* call-seq:
* Socket.pair(domain, type, protocol) => [socket1, socket2]
@@ -87,8 +139,8 @@ pair_yield(VALUE pair)
*
* _socktype_ should be a socket type such as: :STREAM, :DGRAM, :RAW, etc.
*
- * _protocol_ should be a protocol defined in the domain.
- * 0 is default protocol for the domain.
+ * _protocol_ should be a protocol defined in the domain,
+ * defaults to 0 for the domain.
*
* s1, s2 = Socket.pair(:UNIX, :DGRAM, 0)
* s1.send "a", 0
@@ -111,16 +163,12 @@ rsock_sock_s_socketpair(int argc, VALUE *argv, VALUE klass)
setup_domain_and_type(domain, &d, type, &t);
p = NUM2INT(protocol);
- ret = socketpair(d, t, p, sp);
- if (ret < 0 && (errno == EMFILE || errno == ENFILE)) {
- rb_gc();
- ret = socketpair(d, t, p, sp);
- }
+ ret = rsock_socketpair(d, t, p, sp);
if (ret < 0) {
rb_sys_fail("socketpair(2)");
}
- rb_update_max_fd(sp[0]);
- rb_update_max_fd(sp[1]);
+ rb_fd_fix_cloexec(sp[0]);
+ rb_fd_fix_cloexec(sp[1]);
s1 = rsock_init_sock(rb_obj_alloc(klass), sp[0]);
s2 = rsock_init_sock(rb_obj_alloc(klass), sp[1]);
@@ -954,13 +1002,12 @@ sock_s_gethostbyaddr(int argc, VALUE *argv)
{
VALUE addr, family;
struct hostent *h;
- struct sockaddr *sa;
char **pch;
VALUE ary, names;
int t = AF_INET;
rb_scan_args(argc, argv, "11", &addr, &family);
- sa = (struct sockaddr*)StringValuePtr(addr);
+ StringValue(addr);
if (!NIL_P(family)) {
t = rsock_family_arg(family);
}
@@ -1086,8 +1133,8 @@ sock_s_getservbyport(int argc, VALUE *argv)
*
* _socktype_ should be a socket type such as: :STREAM, :DGRAM, :RAW, etc.
*
- * _protocol_ should be a protocol defined in the family.
- * 0 is default protocol for the family.
+ * _protocol_ should be a protocol defined in the family,
+ * and defaults to 0 for the family.
*
* _flags_ should be bitwise OR of Socket::AI_* constants.
*
@@ -1100,8 +1147,7 @@ sock_s_getservbyport(int argc, VALUE *argv)
* # ["AF_INET", 0, "localhost", "127.0.0.1", 2, 3, 0]] # PF_INET/SOCK_RAW/IPPROTO_IP
*
* _reverse_lookup_ directs the form of the third element, and has to
- * be one of below.
- * If it is ommitted, the default value is +nil+.
+ * be one of below. If _reverse_lookup_ is omitted, the default value is +nil+.
*
* +true+, +:hostname+: hostname is obtained from numeric address using reverse lookup, which may take a time.
* +false+, +:numeric+: hostname is same as numeric address.
@@ -1153,7 +1199,8 @@ sock_s_getaddrinfo(int argc, VALUE *argv)
*
* _flags_ should be bitwise OR of Socket::NI_* constants.
*
- * Note that the last form is compatible with IPSocket#{addr,peeraddr}.
+ * Note:
+ * The last form is compatible with IPSocket#addr and IPSocket#peeraddr.
*
* Socket.getnameinfo(Socket.sockaddr_in(80, "127.0.0.1")) #=> ["localhost", "www"]
* Socket.getnameinfo(["AF_INET", 80, "127.0.0.1"]) #=> ["localhost", "www"]
@@ -1285,6 +1332,8 @@ sock_s_getnameinfo(int argc, VALUE *argv)
error_exit_name:
if (res) freeaddrinfo(res);
rsock_raise_socket_error("getnameinfo", error);
+
+ UNREACHABLE;
}
/*
@@ -1371,17 +1420,16 @@ static VALUE
sock_s_pack_sockaddr_un(VALUE self, VALUE path)
{
struct sockaddr_un sockaddr;
- char *sun_path;
VALUE addr;
+ StringValue(path);
MEMZERO(&sockaddr, struct sockaddr_un, 1);
sockaddr.sun_family = AF_UNIX;
- sun_path = StringValueCStr(path);
- if (sizeof(sockaddr.sun_path) <= strlen(sun_path)) {
- rb_raise(rb_eArgError, "too long unix socket path (max: %dbytes)",
- (int)sizeof(sockaddr.sun_path)-1);
+ if (sizeof(sockaddr.sun_path) < (size_t)RSTRING_LEN(path)) {
+ rb_raise(rb_eArgError, "too long unix socket path (%"PRIuSIZE" bytes given but %"PRIuSIZE" bytes max)",
+ (size_t)RSTRING_LEN(path), sizeof(sockaddr.sun_path));
}
- strncpy(sockaddr.sun_path, sun_path, sizeof(sockaddr.sun_path)-1);
+ memcpy(sockaddr.sun_path, RSTRING_PTR(path), RSTRING_LEN(path));
addr = rb_str_new((char*)&sockaddr, sizeof(sockaddr));
OBJ_INFECT(addr, path);
@@ -1404,7 +1452,6 @@ static VALUE
sock_s_unpack_sockaddr_un(VALUE self, VALUE addr)
{
struct sockaddr_un * sockaddr;
- const char *sun_path;
VALUE path;
sockaddr = (struct sockaddr_un*)SockAddrStringValuePtr(addr);
@@ -1420,13 +1467,7 @@ sock_s_unpack_sockaddr_un(VALUE self, VALUE addr)
rb_raise(rb_eTypeError, "too long sockaddr_un - %ld longer than %d",
RSTRING_LEN(addr), (int)sizeof(struct sockaddr_un));
}
- sun_path = rsock_unixpath(sockaddr, RSTRING_LENINT(addr));
- if (sizeof(struct sockaddr_un) == RSTRING_LEN(addr) &&
- sun_path == sockaddr->sun_path &&
- sun_path + strlen(sun_path) == RSTRING_PTR(addr) + RSTRING_LEN(addr)) {
- rb_raise(rb_eArgError, "sockaddr_un.sun_path not NUL terminated");
- }
- path = rb_str_new2(sun_path);
+ path = rsock_unixpath_str(sockaddr, RSTRING_LENINT(addr));
OBJ_INFECT(path, addr);
return path;
}
@@ -1792,48 +1833,126 @@ socket_s_ip_address_list(VALUE self)
#define socket_s_ip_address_list rb_f_notimplement
#endif
-/*
- * Document-class: ::Socket < BasicSocket
- *
- * Class +Socket+ provides access to the underlying operating system
- * socket implementations. It can be used to provide more operating system
- * specific functionality than the protocol-specific socket classes.
- *
- * The constants defined under Socket::Constants are also defined under Socket.
- * For example, Socket::AF_INET is usable as well as Socket::Constants::AF_INET.
- * See Socket::Constants for the list of constants.
- *
- * === Exception Handling
- * Ruby's implementation of +Socket+ causes an exception to be raised
- * based on the error generated by the system dependent implementation.
- * This is why the methods are documented in a way that isolate
- * Unix-based system exceptions from Windows based exceptions. If more
- * information on particular exception is needed please refer to the
- * Unix manual pages or the Windows WinSock reference.
- *
- * === Convenient methods
- *
- * Although the general way to create socket is Socket.new,
- * there are several methods for socket creation for most cases.
- *
- * * TCP client socket: Socket.tcp, TCPSocket.open
- * * TCP server socket: Socket.tcp_server_loop, TCPServer.open
- * * UNIX client socket: Socket.unix, UNIXSocket.open
- * * UNIX server socket: Socket.unix_server_loop, UNIXServer.open
- *
- * === Documentation by
- * * Zach Dennis
- * * Sam Roberts
- * * <em>Programming Ruby</em> from The Pragmatic Bookshelf.
- *
- * Much material in this documentation is taken with permission from
- * <em>Programming Ruby</em> from The Pragmatic Bookshelf.
- */
void
Init_socket()
{
rsock_init_basicsocket();
+ /*
+ * Document-class: Socket < BasicSocket
+ *
+ * Class +Socket+ provides access to the underlying operating system
+ * socket implementations. It can be used to provide more operating system
+ * specific functionality than the protocol-specific socket classes.
+ *
+ * The constants defined under Socket::Constants are also defined under
+ * Socket. For example, Socket::AF_INET is usable as well as
+ * Socket::Constants::AF_INET. See Socket::Constants for the list of
+ * constants.
+ *
+ * === What's a socket?
+ *
+ * Sockets are endpoints of a bidirectionnal communication channel.
+ * Sockets can communicate within a process, between processes on the same
+ * machine or between different machines. There are many types of socket:
+ * TCPSocket, UDPSocket or UNIXSocket for example.
+ *
+ * Sockets have their own vocabulary:
+ *
+ * *domain:*
+ * The family of protocols:
+ * * Socket::PF_INET
+ * * Socket::PF_INET6
+ * * Socket::PF_UNIX
+ * * etc.
+ *
+ * *type:*
+ * The type of communications between the two endpoints, typically
+ * * Socket::SOCK_STREAM
+ * * Socket::SOCK_DGRAM.
+ *
+ * *protocol:*
+ * Typically _zero_.
+ * This may be used to identify a variant of a protocol.
+ *
+ * *hostname:*
+ * The identifier of a network interface:
+ * * a string (hostname, IPv4 or IPv6 adress or +broadcast+
+ * which specifies a broadcast address)
+ * * a zero-length string which specifies INADDR_ANY
+ * * an integer (interpreted as binary address in host byte order).
+ *
+ * === Quick start
+ *
+ * Many of the classes, such as TCPSocket, UDPSocket or UNIXSocket,
+ * ease the use of sockets comparatively to the equivalent C programming interface.
+ *
+ * Let's create an internet socket using the IPv4 protocol in a C-like manner:
+ *
+ * s = Socket.new Socket::AF_INET, Socket::SOCK_STREAM
+ * s.connect Socket.pack_sockaddr_in(80, 'example.com')
+ *
+ * You could also use the TCPSocket class:
+ *
+ * s = TCPSocket.new 'example.com', 80
+ *
+ * A simple server might look like this:
+ *
+ * require 'socket'
+ *
+ * server = TCPServer.new 2000 # Server bound to port 2000
+ *
+ * loop do
+ * client = server.accept # Wait for a client to connect
+ * client.puts "Hello !"
+ * client.puts "Time is #{Time.now}"
+ * client.close
+ * end
+ *
+ * A simple client may look like this:
+ *
+ * require 'socket'
+ *
+ * s = TCPSocket.new 'localhost', 2000
+ *
+ * while line = s.gets # Read lines from socket
+ * puts line # and print them
+ * end
+ *
+ * s.close # close socket when done
+ *
+ * === Exception Handling
+ *
+ * Ruby's Socket implementation raises exceptions based on the error
+ * generated by the system dependent implementation. This is why the
+ * methods are documented in a way that isolate Unix-based system
+ * exceptions from Windows based exceptions. If more information on a
+ * particular exception is needed, please refer to the Unix manual pages or
+ * the Windows WinSock reference.
+ *
+ * === Convenience methods
+ *
+ * Although the general way to create socket is Socket.new,
+ * there are several methods of socket creation for most cases.
+ *
+ * TCP client socket::
+ * Socket.tcp, TCPSocket.open
+ * TCP server socket::
+ * Socket.tcp_server_loop, TCPServer.open
+ * UNIX client socket::
+ * Socket.unix, UNIXSocket.open
+ * UNIX server socket::
+ * Socket.unix_server_loop, UNIXServer.open
+ *
+ * === Documentation by
+ *
+ * * Zach Dennis
+ * * Sam Roberts
+ * * <em>Programming Ruby</em> from The Pragmatic Bookshelf.
+ *
+ * Much material in this documentation is taken with permission from
+ * <em>Programming Ruby</em> from The Pragmatic Bookshelf.
+ */
rb_cSocket = rb_define_class("Socket", rb_cBasicSocket);
rsock_init_socket_init();
diff --git a/ext/socket/sockssocket.c b/ext/socket/sockssocket.c
index cbe8792271..48be4fcf99 100644
--- a/ext/socket/sockssocket.c
+++ b/ext/socket/sockssocket.c
@@ -11,6 +11,13 @@
#include "rubysocket.h"
#ifdef SOCKS
+/*
+ * call-seq:
+ * SOCKSSocket.new(host, serv) => socket
+ *
+ * Opens a SOCKS connection to +host+ via the SOCKS server +serv+.
+ *
+ */
static VALUE
socks_init(VALUE sock, VALUE host, VALUE serv)
{
@@ -25,6 +32,10 @@ socks_init(VALUE sock, VALUE host, VALUE serv)
}
#ifdef SOCKS5
+/*
+ * Closes the SOCKS connection.
+ *
+ */
static VALUE
socks_s_close(VALUE sock)
{
@@ -40,15 +51,17 @@ socks_s_close(VALUE sock)
#endif
#endif
-/*
- * Document-class: ::SOCKSSocket < TCPSocket
- *
- * SOCKSSocket class
- */
void
rsock_init_sockssocket(void)
{
#ifdef SOCKS
+ /*
+ * Document-class: SOCKSSocket < TCPSocket
+ *
+ * SOCKS is an Internet protocol that routes packets between a client and
+ * a server through a proxy server. SOCKS5, if supported, additionally
+ * provides authentication so only authorized users may access a server.
+ */
rb_cSOCKSSocket = rb_define_class("SOCKSSocket", rb_cTCPSocket);
rb_define_method(rb_cSOCKSSocket, "initialize", socks_init, 2);
#ifdef SOCKS5
diff --git a/ext/socket/tcpserver.c b/ext/socket/tcpserver.c
index 7bb02d91f0..6596733239 100644
--- a/ext/socket/tcpserver.c
+++ b/ext/socket/tcpserver.c
@@ -128,14 +128,40 @@ tcp_sysaccept(VALUE sock)
return rsock_s_accept(0, fptr->fd, (struct sockaddr*)&from, &fromlen);
}
-/*
- * Document-class: ::TCPServer < TCPSocket
- *
- * TCPServer represents a TCP/IP server socket.
- */
void
rsock_init_tcpserver(void)
{
+ /*
+ * Document-class: TCPServer < TCPSocket
+ *
+ * TCPServer represents a TCP/IP server socket.
+ *
+ * A simple TCP server may look like:
+ *
+ * require 'socket'
+ *
+ * server = TCPServer.new 2000 # Server bind to port 2000
+ * loop do
+ * client = server.accept # Wait for a client to connect
+ * client.puts "Hello !"
+ * client.puts "Time is #{Time.now}"
+ * client.close
+ * end
+ *
+ * A more usable server (serving multiple clients):
+ *
+ * require 'socket'
+ *
+ * server = TCPServer.new 2000
+ * loop do
+ * Thread.start(server.accept) do |client|
+ * client.puts "Hello !"
+ * client.puts "Time is #{Time.now}"
+ * client.close
+ * end
+ * end
+ *
+ */
rb_cTCPServer = rb_define_class("TCPServer", rb_cTCPSocket);
rb_define_method(rb_cTCPServer, "accept", tcp_accept, 0);
rb_define_method(rb_cTCPServer, "accept_nonblock", tcp_accept_nonblock, 0);
diff --git a/ext/socket/tcpsocket.c b/ext/socket/tcpsocket.c
index 42d75d6015..7eb6fc7aa2 100644
--- a/ext/socket/tcpsocket.c
+++ b/ext/socket/tcpsocket.c
@@ -55,14 +55,27 @@ tcp_s_gethostbyname(VALUE obj, VALUE host)
tcp_sockaddr);
}
-/*
- * Document-class: ::TCPSocket < IPSocket
- *
- * TCPSocket represents a TCP/IP client socket.
- */
void
rsock_init_tcpsocket(void)
{
+ /*
+ * Document-class: TCPSocket < IPSocket
+ *
+ * TCPSocket represents a TCP/IP client socket.
+ *
+ * A simple client may look like:
+ *
+ * require 'socket'
+ *
+ * s = TCPSocket.new 'localhost', 2000
+ *
+ * while line = s.gets # Read lines from socket
+ * puts line # and print them
+ * end
+ *
+ * s.close # close socket when done
+ *
+ */
rb_cTCPSocket = rb_define_class("TCPSocket", rb_cIPSocket);
rb_define_singleton_method(rb_cTCPSocket, "gethostbyname", tcp_s_gethostbyname, 1);
rb_define_method(rb_cTCPSocket, "initialize", tcp_init, -1);
diff --git a/ext/socket/udpsocket.c b/ext/socket/udpsocket.c
index bd62d89872..0ba4371f1a 100644
--- a/ext/socket/udpsocket.c
+++ b/ext/socket/udpsocket.c
@@ -246,14 +246,15 @@ udp_recvfrom_nonblock(int argc, VALUE *argv, VALUE sock)
return rsock_s_recvfrom_nonblock(sock, argc, argv, RECV_IP);
}
-/*
- * Document-class: ::UDPSocket < IPSocket
- *
- * UDPSocket represents a UDP/IP socket.
- */
void
rsock_init_udpsocket(void)
{
+ /*
+ * Document-class: UDPSocket < IPSocket
+ *
+ * UDPSocket represents a UDP/IP socket.
+ *
+ */
rb_cUDPSocket = rb_define_class("UDPSocket", rb_cIPSocket);
rb_define_method(rb_cUDPSocket, "initialize", udp_init, -1);
rb_define_method(rb_cUDPSocket, "connect", udp_connect, 2);
diff --git a/ext/socket/unixserver.c b/ext/socket/unixserver.c
index 4fdc1d709d..9bd959d439 100644
--- a/ext/socket/unixserver.c
+++ b/ext/socket/unixserver.c
@@ -135,15 +135,16 @@ unix_sysaccept(VALUE sock)
#endif
-/*
- * Document-class: ::UNIXServer < UNIXSocket
- *
- * UNIXServer represents a UNIX domain stream server socket.
- */
void
rsock_init_unixserver(void)
{
#ifdef HAVE_SYS_UN_H
+ /*
+ * Document-class: UNIXServer < UNIXSocket
+ *
+ * UNIXServer represents a UNIX domain stream server socket.
+ *
+ */
rb_cUNIXServer = rb_define_class("UNIXServer", rb_cUNIXSocket);
rb_define_method(rb_cUNIXServer, "initialize", unix_svr_init, 1);
rb_define_method(rb_cUNIXServer, "accept", unix_accept, 0);
diff --git a/ext/socket/unixsocket.c b/ext/socket/unixsocket.c
index f29724db25..c8557cb4c9 100644
--- a/ext/socket/unixsocket.c
+++ b/ext/socket/unixsocket.c
@@ -39,9 +39,9 @@ rsock_init_unixsock(VALUE sock, VALUE path, int server)
MEMZERO(&sockaddr, struct sockaddr_un, 1);
sockaddr.sun_family = AF_UNIX;
- if (sizeof(sockaddr.sun_path) <= (size_t)RSTRING_LEN(path)) {
- rb_raise(rb_eArgError, "too long unix socket path (max: %dbytes)",
- (int)sizeof(sockaddr.sun_path)-1);
+ if (sizeof(sockaddr.sun_path) < (size_t)RSTRING_LEN(path)) {
+ rb_raise(rb_eArgError, "too long unix socket path (%ldbytes given but %dbytes max)",
+ RSTRING_LEN(path), (int)sizeof(sockaddr.sun_path));
}
memcpy(sockaddr.sun_path, RSTRING_PTR(path), RSTRING_LEN(path));
@@ -62,11 +62,11 @@ rsock_init_unixsock(VALUE sock, VALUE path, int server)
if (status < 0) {
close(fd);
- rb_sys_fail(sockaddr.sun_path);
+ rb_sys_fail_str(path);
}
if (server) {
- if (listen(fd, 5) < 0) {
+ if (listen(fd, SOMAXCONN) < 0) {
close(fd);
rb_sys_fail("listen(2)");
}
@@ -118,7 +118,7 @@ unix_path(VALUE sock)
socklen_t len = (socklen_t)sizeof(addr);
if (getsockname(fptr->fd, (struct sockaddr*)&addr, &len) < 0)
rb_sys_fail(0);
- fptr->pathv = rb_obj_freeze(rb_str_new_cstr(rsock_unixpath(&addr, len)));
+ fptr->pathv = rb_obj_freeze(rsock_unixpath_str(&addr, len));
}
return rb_str_dup(fptr->pathv);
}
@@ -205,7 +205,7 @@ unix_send_io(VALUE sock, VALUE val)
#if FD_PASSING_BY_MSG_CONTROL
struct {
struct cmsghdr hdr;
- char pad[8+sizeof(int)+8];
+ char pad[8+sizeof(int)+8];
} cmsg;
#endif
@@ -264,7 +264,8 @@ static VALUE
recvmsg_blocking(void *data)
{
struct iomsg_arg *arg = data;
- return recvmsg(arg->fd, &arg->msg, 0);
+ int flags = 0;
+ return rsock_recvmsg(arg->fd, &arg->msg, flags);
}
/*
@@ -299,7 +300,7 @@ unix_recv_io(int argc, VALUE *argv, VALUE sock)
#if FD_PASSING_BY_MSG_CONTROL
struct {
struct cmsghdr hdr;
- char pad[8+sizeof(int)+8];
+ char pad[8+sizeof(int)+8];
} cmsg;
#endif
@@ -383,7 +384,7 @@ unix_recv_io(int argc, VALUE *argv, VALUE sock)
#if FD_PASSING_BY_MSG_CONTROL
memcpy(&fd, CMSG_DATA(&cmsg.hdr), sizeof(int));
#endif
- rb_update_max_fd(fd);
+ rb_fd_fix_cloexec(fd);
if (klass == Qnil)
return INT2FIX(fd);
@@ -492,15 +493,15 @@ unix_s_socketpair(int argc, VALUE *argv, VALUE klass)
}
#endif
-/*
- * Document-class: ::UNIXSocket < BasicSocket
- *
- * UNIXSocket represents a UNIX domain stream client socket.
- */
void
rsock_init_unixsocket(void)
{
#ifdef HAVE_SYS_UN_H
+ /*
+ * Document-class: UNIXSocket < BasicSocket
+ *
+ * UNIXSocket represents a UNIX domain stream client socket.
+ */
rb_cUNIXSocket = rb_define_class("UNIXSocket", rb_cBasicSocket);
rb_define_method(rb_cUNIXSocket, "initialize", unix_init, 1);
rb_define_method(rb_cUNIXSocket, "path", unix_path, 0);
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index 68baf350f5..975a30855f 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -28,7 +28,7 @@ struct StringIO {
int count;
};
-static void strio_init(int, VALUE *, struct StringIO *);
+static void strio_init(int, VALUE *, struct StringIO *, VALUE);
#define IS_STRIO(obj) (rb_typeddata_is_kind_of((obj), &strio_data_type))
#define error_inval(msg) (errno = EINVAL, rb_sys_fail(msg))
@@ -107,23 +107,32 @@ strio_substr(struct StringIO *ptr, long pos, long len)
#define StringIO(obj) get_strio(obj)
-#define CLOSED(ptr) (!((ptr)->flags & FMODE_READWRITE))
-#define READABLE(ptr) ((ptr)->flags & FMODE_READABLE)
-#define WRITABLE(ptr) ((ptr)->flags & FMODE_WRITABLE)
+#define STRIO_READABLE FL_USER4
+#define STRIO_WRITABLE FL_USER5
+#define STRIO_READWRITE (STRIO_READABLE|STRIO_WRITABLE)
+typedef char strio_flags_check[(STRIO_READABLE/FMODE_READABLE == STRIO_WRITABLE/FMODE_WRITABLE) * 2 - 1];
+#define STRIO_MODE_SET_P(strio, mode) \
+ ((RBASIC(strio)->flags & STRIO_##mode) && \
+ ((struct StringIO*)DATA_PTR(strio))->flags & FMODE_##mode)
+#define CLOSED(strio) (!STRIO_MODE_SET_P(strio, READWRITE))
+#define READABLE(strio) STRIO_MODE_SET_P(strio, READABLE)
+#define WRITABLE(strio) STRIO_MODE_SET_P(strio, WRITABLE)
static struct StringIO*
-readable(struct StringIO *ptr)
+readable(VALUE strio)
{
- if (!READABLE(ptr)) {
+ struct StringIO *ptr = StringIO(strio);
+ if (!READABLE(strio)) {
rb_raise(rb_eIOError, "not opened for reading");
}
return ptr;
}
static struct StringIO*
-writable(struct StringIO *ptr)
+writable(VALUE strio)
{
- if (!WRITABLE(ptr)) {
+ struct StringIO *ptr = StringIO(strio);
+ if (!WRITABLE(strio)) {
rb_raise(rb_eIOError, "not opened for writing");
}
if (!OBJ_TAINTED(ptr->string)) {
@@ -160,12 +169,12 @@ strio_initialize(int argc, VALUE *argv, VALUE self)
DATA_PTR(self) = ptr = strio_alloc();
}
rb_call_super(0, 0);
- strio_init(argc, argv, ptr);
+ strio_init(argc, argv, ptr, self);
return self;
}
static void
-strio_init(int argc, VALUE *argv, struct StringIO *ptr)
+strio_init(int argc, VALUE *argv, struct StringIO *ptr, VALUE self)
{
VALUE string, mode;
int trunc = 0;
@@ -203,6 +212,7 @@ strio_init(int argc, VALUE *argv, struct StringIO *ptr)
ptr->string = string;
ptr->pos = 0;
ptr->lineno = 0;
+ RBASIC(self)->flags |= (ptr->flags & FMODE_READWRITE) * (STRIO_READABLE / FMODE_READABLE);
}
static VALUE
@@ -287,7 +297,8 @@ strio_unimpl(int argc, VALUE *argv, VALUE self)
{
StringIO(self);
rb_notimplement();
- return Qnil; /* not reached */
+
+ UNREACHABLE;
}
/*
@@ -331,11 +342,11 @@ strio_set_string(VALUE self, VALUE string)
static VALUE
strio_close(VALUE self)
{
- struct StringIO *ptr = StringIO(self);
- if (CLOSED(ptr)) {
+ StringIO(self);
+ if (CLOSED(self)) {
rb_raise(rb_eIOError, "closed stream");
}
- ptr->flags &= ~FMODE_READWRITE;
+ RBASIC(self)->flags &= ~STRIO_READWRITE;
return Qnil;
}
@@ -349,11 +360,11 @@ strio_close(VALUE self)
static VALUE
strio_close_read(VALUE self)
{
- struct StringIO *ptr = StringIO(self);
- if (!READABLE(ptr)) {
+ StringIO(self);
+ if (!READABLE(self)) {
rb_raise(rb_eIOError, "closing non-duplex IO for reading");
}
- ptr->flags &= ~FMODE_READABLE;
+ RBASIC(self)->flags &= ~STRIO_READABLE;
return Qnil;
}
@@ -367,11 +378,11 @@ strio_close_read(VALUE self)
static VALUE
strio_close_write(VALUE self)
{
- struct StringIO *ptr = StringIO(self);
- if (!WRITABLE(ptr)) {
+ StringIO(self);
+ if (!WRITABLE(self)) {
rb_raise(rb_eIOError, "closing non-duplex IO for writing");
}
- ptr->flags &= ~FMODE_WRITABLE;
+ RBASIC(self)->flags &= ~STRIO_WRITABLE;
return Qnil;
}
@@ -384,8 +395,8 @@ strio_close_write(VALUE self)
static VALUE
strio_closed(VALUE self)
{
- struct StringIO *ptr = StringIO(self);
- if (!CLOSED(ptr)) return Qfalse;
+ StringIO(self);
+ if (!CLOSED(self)) return Qfalse;
return Qtrue;
}
@@ -398,8 +409,8 @@ strio_closed(VALUE self)
static VALUE
strio_closed_read(VALUE self)
{
- struct StringIO *ptr = StringIO(self);
- if (READABLE(ptr)) return Qfalse;
+ StringIO(self);
+ if (READABLE(self)) return Qfalse;
return Qtrue;
}
@@ -412,8 +423,8 @@ strio_closed_read(VALUE self)
static VALUE
strio_closed_write(VALUE self)
{
- struct StringIO *ptr = StringIO(self);
- if (WRITABLE(ptr)) return Qfalse;
+ StringIO(self);
+ if (WRITABLE(self)) return Qfalse;
return Qtrue;
}
@@ -428,7 +439,7 @@ strio_closed_write(VALUE self)
static VALUE
strio_eof(VALUE self)
{
- struct StringIO *ptr = readable(StringIO(self));
+ struct StringIO *ptr = readable(self);
if (ptr->pos < RSTRING_LEN(ptr->string)) return Qfalse;
return Qtrue;
}
@@ -447,6 +458,8 @@ strio_copy(VALUE copy, VALUE orig)
}
DATA_PTR(copy) = ptr;
OBJ_INFECT(copy, orig);
+ RBASIC(copy)->flags &= ~STRIO_READWRITE;
+ RBASIC(copy)->flags |= RBASIC(orig)->flags & STRIO_READWRITE;
++ptr->count;
return copy;
}
@@ -505,10 +518,10 @@ static VALUE
strio_reopen(int argc, VALUE *argv, VALUE self)
{
rb_io_taint_check(self);
- if (argc == 1 && TYPE(*argv) != T_STRING) {
+ if (argc == 1 && !RB_TYPE_P(*argv, T_STRING)) {
return strio_copy(self, *argv);
}
- strio_init(argc, argv, StringIO(self));
+ strio_init(argc, argv, StringIO(self), self);
return self;
}
@@ -575,7 +588,7 @@ strio_seek(int argc, VALUE *argv, VALUE self)
rb_scan_args(argc, argv, "11", NULL, &whence);
offset = NUM2LONG(argv[0]);
- if (CLOSED(ptr)) {
+ if (CLOSED(self)) {
rb_raise(rb_eIOError, "closed stream");
}
switch (NIL_P(whence) ? 0 : NUM2LONG(whence)) {
@@ -628,7 +641,7 @@ strio_get_sync(VALUE self)
static VALUE
strio_each_byte(VALUE self)
{
- struct StringIO *ptr = readable(StringIO(self));
+ struct StringIO *ptr = readable(self);
RETURN_ENUMERATOR(self, 0, 0);
@@ -648,7 +661,7 @@ strio_each_byte(VALUE self)
static VALUE
strio_getc(VALUE self)
{
- struct StringIO *ptr = readable(StringIO(self));
+ struct StringIO *ptr = readable(self);
rb_encoding *enc = rb_enc_get(ptr->string);
int len;
char *p;
@@ -671,7 +684,7 @@ strio_getc(VALUE self)
static VALUE
strio_getbyte(VALUE self)
{
- struct StringIO *ptr = readable(StringIO(self));
+ struct StringIO *ptr = readable(self);
int c;
if (ptr->pos >= RSTRING_LEN(ptr->string)) {
return Qnil;
@@ -709,7 +722,7 @@ strio_extend(struct StringIO *ptr, long pos, long len)
static VALUE
strio_ungetc(VALUE self, VALUE c)
{
- struct StringIO *ptr = readable(StringIO(self));
+ struct StringIO *ptr = readable(self);
long lpos, clen;
char *p, *pend;
rb_encoding *enc, *enc2;
@@ -764,7 +777,7 @@ strio_ungetc(VALUE self, VALUE c)
static VALUE
strio_ungetbyte(VALUE self, VALUE c)
{
- struct StringIO *ptr = readable(StringIO(self));
+ struct StringIO *ptr = readable(self);
char buf[1], *cp = buf;
long pos = ptr->pos, cl = 1;
VALUE str = ptr->string;
@@ -806,7 +819,7 @@ strio_ungetbyte(VALUE self, VALUE c)
static VALUE
strio_readchar(VALUE self)
{
- VALUE c = strio_getc(self);
+ VALUE c = rb_funcall2(self, rb_intern("getc"), 0, 0);
if (NIL_P(c)) rb_eof_error();
return c;
}
@@ -820,7 +833,7 @@ strio_readchar(VALUE self)
static VALUE
strio_readbyte(VALUE self)
{
- VALUE c = strio_getbyte(self);
+ VALUE c = rb_funcall2(self, rb_intern("getbyte"), 0, 0);
if (NIL_P(c)) rb_eof_error();
return c;
}
@@ -868,7 +881,7 @@ strio_each_codepoint(VALUE self)
RETURN_ENUMERATOR(self, 0, 0);
- ptr = readable(StringIO(self));
+ ptr = readable(self);
enc = rb_enc_get(ptr->string);
for (;;) {
if (ptr->pos >= RSTRING_LEN(ptr->string)) {
@@ -930,7 +943,7 @@ strio_getline(int argc, VALUE *argv, struct StringIO *ptr)
break;
case 1:
- if (!NIL_P(str) && TYPE(str) != T_STRING) {
+ if (!NIL_P(str) && !RB_TYPE_P(str, T_STRING)) {
VALUE tmp = rb_check_string_type(str);
if (NIL_P(tmp)) {
limit = NUM2LONG(str);
@@ -1020,7 +1033,7 @@ strio_getline(int argc, VALUE *argv, struct StringIO *ptr)
static VALUE
strio_gets(int argc, VALUE *argv, VALUE self)
{
- VALUE str = strio_getline(argc, argv, readable(StringIO(self)));
+ VALUE str = strio_getline(argc, argv, readable(self));
rb_lastline_set(str);
return str;
@@ -1037,7 +1050,7 @@ strio_gets(int argc, VALUE *argv, VALUE self)
static VALUE
strio_readline(int argc, VALUE *argv, VALUE self)
{
- VALUE line = strio_gets(argc, argv, self);
+ VALUE line = rb_funcall2(self, rb_intern("gets"), argc, argv);
if (NIL_P(line)) rb_eof_error();
return line;
}
@@ -1064,9 +1077,9 @@ strio_readline(int argc, VALUE *argv, VALUE self)
static VALUE
strio_each(int argc, VALUE *argv, VALUE self)
{
- struct StringIO *ptr = StringIO(self);
VALUE line;
+ StringIO(self);
RETURN_ENUMERATOR(self, argc, argv);
if (argc > 0 && !NIL_P(argv[argc-1]) && NIL_P(rb_check_string_type(argv[argc-1])) &&
@@ -1074,7 +1087,7 @@ strio_each(int argc, VALUE *argv, VALUE self)
rb_raise(rb_eArgError, "invalid limit: 0 for each_line");
}
- while (!NIL_P(line = strio_getline(argc, argv, readable(ptr)))) {
+ while (!NIL_P(line = strio_getline(argc, argv, readable(self)))) {
rb_yield(line);
}
return self;
@@ -1091,15 +1104,16 @@ strio_each(int argc, VALUE *argv, VALUE self)
static VALUE
strio_readlines(int argc, VALUE *argv, VALUE self)
{
- struct StringIO *ptr = StringIO(self);
- VALUE ary = rb_ary_new(), line;
+ VALUE ary, line;
+ StringIO(self);
+ ary = rb_ary_new();
if (argc > 0 && !NIL_P(argv[argc-1]) && NIL_P(rb_check_string_type(argv[argc-1])) &&
NUM2LONG(argv[argc-1]) == 0) {
rb_raise(rb_eArgError, "invalid limit: 0 for readlines");
}
- while (!NIL_P(line = strio_getline(argc, argv, readable(ptr)))) {
+ while (!NIL_P(line = strio_getline(argc, argv, readable(self)))) {
rb_ary_push(ary, line);
}
return ary;
@@ -1118,12 +1132,12 @@ strio_readlines(int argc, VALUE *argv, VALUE self)
static VALUE
strio_write(VALUE self, VALUE str)
{
- struct StringIO *ptr = writable(StringIO(self));
+ struct StringIO *ptr = writable(self);
long len, olen;
rb_encoding *enc, *enc2;
RB_GC_GUARD(str);
- if (TYPE(str) != T_STRING)
+ if (!RB_TYPE_P(str, T_STRING))
str = rb_obj_as_string(str);
enc = rb_enc_get(ptr->string);
enc2 = rb_enc_get(str);
@@ -1184,7 +1198,7 @@ strio_write(VALUE self, VALUE str)
static VALUE
strio_putc(VALUE self, VALUE ch)
{
- struct StringIO *ptr = writable(StringIO(self));
+ struct StringIO *ptr = writable(self);
int c = NUM2CHR(ch);
long olen;
@@ -1209,22 +1223,25 @@ strio_putc(VALUE self, VALUE ch)
/*
* call-seq:
- * strio.read([length [, buffer]]) -> string, buffer, or nil
+ * strio.read([length [, outbuf]]) -> string, outbuf, or nil
*
* See IO#read.
*/
static VALUE
strio_read(int argc, VALUE *argv, VALUE self)
{
- struct StringIO *ptr = readable(StringIO(self));
+ struct StringIO *ptr = readable(self);
VALUE str = Qnil;
long len;
+ int binary = 0;
switch (argc) {
case 2:
str = argv[1];
- StringValue(str);
- rb_str_modify(str);
+ if (!NIL_P(str)) {
+ StringValue(str);
+ rb_str_modify(str);
+ }
case 1:
if (!NIL_P(argv[0])) {
len = NUM2LONG(argv[0]);
@@ -1235,6 +1252,7 @@ strio_read(int argc, VALUE *argv, VALUE self)
if (!NIL_P(str)) rb_str_resize(str, 0);
return Qnil;
}
+ binary = 1;
break;
}
/* fall through */
@@ -1258,21 +1276,19 @@ strio_read(int argc, VALUE *argv, VALUE self)
}
if (NIL_P(str)) {
str = strio_substr(ptr, ptr->pos, len);
- if (argc > 0) rb_enc_associate(str, rb_ascii8bit_encoding());
+ if (binary) rb_enc_associate(str, rb_ascii8bit_encoding());
}
else {
long rest = RSTRING_LEN(ptr->string) - ptr->pos;
if (len > rest) len = rest;
rb_str_resize(str, len);
MEMCPY(RSTRING_PTR(str), RSTRING_PTR(ptr->string) + ptr->pos, char, len);
+ if (binary)
+ rb_enc_associate(str, rb_ascii8bit_encoding());
+ else
+ rb_enc_copy(str, ptr->string);
}
- if (NIL_P(str)) {
- str = rb_str_new(0, 0);
- len = 0;
- }
- else {
- ptr->pos += len = RSTRING_LEN(str);
- }
+ ptr->pos += RSTRING_LEN(str);
return str;
}
@@ -1286,14 +1302,14 @@ strio_read(int argc, VALUE *argv, VALUE self)
static VALUE
strio_sysread(int argc, VALUE *argv, VALUE self)
{
- VALUE val = strio_read(argc, argv, self);
+ VALUE val = rb_funcall2(self, rb_intern("read"), argc, argv);
if (NIL_P(val)) {
rb_eof_error();
}
return val;
}
-#define strio_syswrite strio_write
+#define strio_syswrite rb_io_write
/*
* call-seq:
@@ -1335,11 +1351,11 @@ strio_size(VALUE self)
static VALUE
strio_truncate(VALUE self, VALUE len)
{
- VALUE string = writable(StringIO(self))->string;
+ VALUE string = writable(self)->string;
long l = NUM2LONG(len);
long plen = RSTRING_LEN(string);
if (l < 0) {
- error_inval("negative legnth");
+ error_inval("negative length");
}
rb_str_resize(string, l);
if (plen < l) {
@@ -1457,25 +1473,13 @@ Init_stringio()
rb_define_method(StringIO, "getc", strio_getc, 0);
rb_define_method(StringIO, "ungetc", strio_ungetc, 1);
rb_define_method(StringIO, "ungetbyte", strio_ungetbyte, 1);
- rb_define_method(StringIO, "readchar", strio_readchar, 0);
rb_define_method(StringIO, "getbyte", strio_getbyte, 0);
- rb_define_method(StringIO, "readbyte", strio_readbyte, 0);
rb_define_method(StringIO, "gets", strio_gets, -1);
- rb_define_method(StringIO, "readline", strio_readline, -1);
rb_define_method(StringIO, "readlines", strio_readlines, -1);
rb_define_method(StringIO, "read", strio_read, -1);
- rb_define_method(StringIO, "sysread", strio_sysread, -1);
- rb_define_method(StringIO, "readpartial", strio_sysread, -1);
- rb_define_method(StringIO, "read_nonblock", strio_sysread, -1);
rb_define_method(StringIO, "write", strio_write, 1);
- rb_define_method(StringIO, "<<", strio_addstr, 1);
- rb_define_method(StringIO, "print", strio_print, -1);
- rb_define_method(StringIO, "printf", strio_printf, -1);
rb_define_method(StringIO, "putc", strio_putc, 1);
- rb_define_method(StringIO, "puts", strio_puts, -1);
- rb_define_method(StringIO, "syswrite", strio_syswrite, 1);
- rb_define_method(StringIO, "write_nonblock", strio_syswrite, 1);
rb_define_method(StringIO, "isatty", strio_isatty, 0);
rb_define_method(StringIO, "tty?", strio_isatty, 0);
@@ -1488,4 +1492,25 @@ Init_stringio()
rb_define_method(StringIO, "external_encoding", strio_external_encoding, 0);
rb_define_method(StringIO, "internal_encoding", strio_internal_encoding, 0);
rb_define_method(StringIO, "set_encoding", strio_set_encoding, -1);
+
+ {
+ VALUE mReadable = rb_define_module_under(rb_cIO, "readable");
+ rb_define_method(mReadable, "readchar", strio_readchar, 0);
+ rb_define_method(mReadable, "readbyte", strio_readbyte, 0);
+ rb_define_method(mReadable, "readline", strio_readline, -1);
+ rb_define_method(mReadable, "sysread", strio_sysread, -1);
+ rb_define_method(mReadable, "readpartial", strio_sysread, -1);
+ rb_define_method(mReadable, "read_nonblock", strio_sysread, -1);
+ rb_include_module(StringIO, mReadable);
+ }
+ {
+ VALUE mWritable = rb_define_module_under(rb_cIO, "writable");
+ rb_define_method(mWritable, "<<", strio_addstr, 1);
+ rb_define_method(mWritable, "print", strio_print, -1);
+ rb_define_method(mWritable, "printf", strio_printf, -1);
+ rb_define_method(mWritable, "puts", strio_puts, -1);
+ rb_define_method(mWritable, "syswrite", strio_syswrite, 1);
+ rb_define_method(mWritable, "write_nonblock", strio_syswrite, 1);
+ rb_include_module(StringIO, mWritable);
+ }
}
diff --git a/ext/strscan/extconf.rb b/ext/strscan/extconf.rb
index 0d21966fc2..3e5a295e31 100644
--- a/ext/strscan/extconf.rb
+++ b/ext/strscan/extconf.rb
@@ -1,2 +1,3 @@
require 'mkmf'
+$INCFLAGS << " -I$(top_srcdir)"
create_makefile 'strscan'
diff --git a/ext/strscan/strscan.c b/ext/strscan/strscan.c
index dcad837a37..b81e1f1833 100644
--- a/ext/strscan/strscan.c
+++ b/ext/strscan/strscan.c
@@ -11,6 +11,7 @@
#include "ruby/ruby.h"
#include "ruby/re.h"
#include "ruby/encoding.h"
+#include "regint.h"
#define STRSCAN_VERSION "0.7.0"
@@ -20,6 +21,7 @@
static VALUE StringScanner;
static VALUE ScanError;
+static ID id_byteslice;
struct strscanner
{
@@ -51,7 +53,7 @@ struct strscanner
#define EOS_P(s) ((s)->curr >= RSTRING_LEN(p->str))
#define GET_SCANNER(obj,var) do {\
- Data_Get_Struct((obj), struct strscanner, (var));\
+ (var) = check_strscan(obj);\
if (NIL_P((var)->str)) rb_raise(rb_eArgError, "uninitialized StringScanner object");\
} while (0)
@@ -63,9 +65,10 @@ static VALUE infect _((VALUE str, struct strscanner *p));
static VALUE extract_range _((struct strscanner *p, long beg_i, long end_i));
static VALUE extract_beg_len _((struct strscanner *p, long beg_i, long len));
-void check_strscan _((VALUE obj));
-static void strscan_mark _((struct strscanner *p));
-static void strscan_free _((struct strscanner *p));
+static struct strscanner *check_strscan _((VALUE obj));
+static void strscan_mark _((void *p));
+static void strscan_free _((void *p));
+static size_t strscan_memsize _((const void *p));
static VALUE strscan_s_allocate _((VALUE klass));
static VALUE strscan_initialize _((int argc, VALUE *argv, VALUE self));
static VALUE strscan_init_copy _((VALUE vself, VALUE vorig));
@@ -157,18 +160,36 @@ extract_beg_len(struct strscanner *p, long beg_i, long len)
======================================================================= */
static void
-strscan_mark(struct strscanner *p)
+strscan_mark(void *ptr)
{
+ struct strscanner *p = ptr;
rb_gc_mark(p->str);
}
static void
-strscan_free(struct strscanner *p)
+strscan_free(void *ptr)
{
+ struct strscanner *p = ptr;
onig_region_free(&(p->regs), 0);
ruby_xfree(p);
}
+static size_t
+strscan_memsize(const void *ptr)
+{
+ const struct strscanner *p = ptr;
+ size_t size = 0;
+ if (p) {
+ size = sizeof(*p) - sizeof(p->regs) + onig_region_memsize(&p->regs);
+ }
+ return size;
+}
+
+static const rb_data_type_t strscanner_type = {
+ "StringScanner",
+ {strscan_mark, strscan_free, strscan_memsize}
+};
+
static VALUE
strscan_s_allocate(VALUE klass)
{
@@ -179,7 +200,7 @@ strscan_s_allocate(VALUE klass)
CLEAR_MATCH_STATUS(p);
onig_region_init(&(p->regs));
p->str = Qnil;
- return Data_Wrap_Struct(klass, strscan_mark, strscan_free, p);
+ return TypedData_Wrap_Struct(klass, &strscanner_type, p);
}
/*
@@ -194,7 +215,7 @@ strscan_initialize(int argc, VALUE *argv, VALUE self)
struct strscanner *p;
VALUE str, need_dup;
- Data_Get_Struct(self, struct strscanner, p);
+ p = check_strscan(self);
rb_scan_args(argc, argv, "11", &str, &need_dup);
StringValue(str);
p->str = str;
@@ -202,14 +223,10 @@ strscan_initialize(int argc, VALUE *argv, VALUE self)
return self;
}
-void
+static struct strscanner *
check_strscan(VALUE obj)
{
- if (TYPE(obj) != T_DATA || RDATA(obj)->dmark != (RUBY_DATA_FUNC)strscan_mark) {
- rb_raise(rb_eTypeError,
- "wrong argument type %s (expected StringScanner)",
- rb_obj_classname(obj));
- }
+ return rb_check_typeddata(obj, &strscanner_type);
}
/*
@@ -224,9 +241,8 @@ strscan_init_copy(VALUE vself, VALUE vorig)
{
struct strscanner *self, *orig;
- Data_Get_Struct(vself, struct strscanner, self);
- check_strscan(vorig);
- Data_Get_Struct(vorig, struct strscanner, orig);
+ self = check_strscan(vself);
+ orig = check_strscan(vorig);
if (self != orig) {
self->flags = orig->flags;
self->str = orig->str;
@@ -317,9 +333,8 @@ strscan_get_string(VALUE self)
static VALUE
strscan_set_string(VALUE self, VALUE str)
{
- struct strscanner *p;
+ struct strscanner *p = check_strscan(self);
- Data_Get_Struct(self, struct strscanner, p);
StringValue(str);
p->str = str;
p->curr = 0;
@@ -357,7 +372,7 @@ strscan_concat(VALUE self, VALUE str)
* value is zero. In the 'terminated' position (i.e. the string is exhausted),
* this value is the bytesize of the string.
*
- * In short, it's a 0-based index into the string.
+ * In short, it's a 0-based index into bytes of the string.
*
* s = StringScanner.new('test string')
* s.pos # -> 0
@@ -376,6 +391,32 @@ strscan_get_pos(VALUE self)
}
/*
+ * Returns the character position of the scan pointer. In the 'reset' position, this
+ * value is zero. In the 'terminated' position (i.e. the string is exhausted),
+ * this value is the size of the string.
+ *
+ * In short, it's a 0-based index into the string.
+ *
+ * s = StringScanner.new("abcädeföghi")
+ * s.charpos # -> 0
+ * s.scan_until(/ä/) # -> "abcä"
+ * s.pos # -> 5
+ * s.charpos # -> 4
+ */
+static VALUE
+strscan_get_charpos(VALUE self)
+{
+ struct strscanner *p;
+ VALUE substr;
+
+ GET_SCANNER(self, p);
+
+ substr = rb_funcall(p->str, id_byteslice, 2, INT2FIX(0), INT2NUM(p->curr));
+
+ return rb_str_length(substr);
+}
+
+/*
* call-seq: pos=(n)
*
* Set the byte position of the scan pointer.
@@ -1067,7 +1108,7 @@ strscan_inspect(VALUE self)
long len;
VALUE a, b;
- Data_Get_Struct(self, struct strscanner, p);
+ p = check_strscan(self);
if (NIL_P(p->str)) {
len = snprintf(buf, BUFSIZE, "#<%s (uninitialized)>",
rb_class2name(CLASS_OF(self)));
@@ -1248,6 +1289,8 @@ Init_strscan()
ID id_scanerr = rb_intern("ScanError");
VALUE tmp;
+ id_byteslice = rb_intern("byteslice");
+
StringScanner = rb_define_class("StringScanner", rb_cObject);
ScanError = rb_define_class_under(StringScanner, "Error", rb_eStandardError);
if (!rb_const_defined(rb_cObject, id_scanerr)) {
@@ -1273,6 +1316,7 @@ Init_strscan()
rb_define_method(StringScanner, "<<", strscan_concat, 1);
rb_define_method(StringScanner, "pos", strscan_get_pos, 0);
rb_define_method(StringScanner, "pos=", strscan_set_pos, 1);
+ rb_define_method(StringScanner, "charpos", strscan_get_charpos, 0);
rb_define_method(StringScanner, "pointer", strscan_get_pos, 0);
rb_define_method(StringScanner, "pointer=", strscan_set_pos, 1);
diff --git a/ext/syck/bytecode.c b/ext/syck/bytecode.c
deleted file mode 100644
index 3310713e5c..0000000000
--- a/ext/syck/bytecode.c
+++ /dev/null
@@ -1,1165 +0,0 @@
-/* Generated by re2c 0.9.10 on Mon Sep 19 23:21:26 2005 */
-#line 1 "bytecode.re"
-/*
- * bytecode.re
- *
- * $Author$
- *
- * Copyright (C) 2003 why the lucky stiff
- */
-#include "ruby/ruby.h"
-#include "syck.h"
-#include "gram.h"
-
-#define QUOTELEN 128
-
-/*
- * They do my bidding...
- */
-#define YYCTYPE char
-#define YYCURSOR parser->cursor
-#define YYMARKER parser->marker
-#define YYLIMIT parser->limit
-#define YYTOKEN parser->token
-#define YYTOKTMP parser->toktmp
-#define YYLINEPTR parser->lineptr
-#define YYLINECTPTR parser->linectptr
-#define YYLINE parser->linect
-#define YYFILL(n) syck_parser_read(parser)
-
-extern SyckParser *syck_parser_ptr;
-
-char *get_inline( SyckParser *parser );
-
-/*
- * Repositions the cursor at `n' offset from the token start.
- * Only works in `Header' and `Document' sections.
- */
-#define YYPOS(n) YYCURSOR = YYTOKEN + n
-
-/*
- * Track line numbers
- */
-#define CHK_NL(ptr) if ( *( ptr - 1 ) == '\n' && ptr > YYLINECTPTR ) { YYLINEPTR = ptr; YYLINE++; YYLINECTPTR = YYLINEPTR; }
-
-/*
- * I like seeing the level operations as macros...
- */
-#define ADD_LEVEL(len, status) syck_parser_add_level( parser, len, status )
-#define POP_LEVEL() syck_parser_pop_level( parser )
-#define CURRENT_LEVEL() syck_parser_current_level( parser )
-
-/*
- * Force a token next time around sycklex()
- */
-#define FORCE_NEXT_TOKEN(tok) parser->force_token = tok;
-
-/*
- * Adding levels in bytecode requires us to make sure
- * we've got all our tokens worked out.
- */
-#define ADD_BYTE_LEVEL(lvl, len, s ) \
- switch ( lvl->status ) \
- { \
- case syck_lvl_seq: \
- lvl->ncount++; \
- ADD_LEVEL(len, syck_lvl_open); \
- YYPOS(0); \
- return '-'; \
- \
- case syck_lvl_map: \
- lvl->ncount++; \
- ADD_LEVEL(len, s); \
- break; \
- \
- case syck_lvl_open: \
- lvl->status = s; \
- break; \
- \
- default: \
- ADD_LEVEL(len, s); \
- break; \
- }
-
-/*
- * Nice little macro to ensure we're YAML_IOPENed to the current level.
- * * Only use this macro in the "Document" section *
- */
-#define ENSURE_YAML_IOPEN(last_lvl, lvl_type, to_len, reset) \
- if ( last_lvl->spaces < to_len ) \
- { \
- if ( last_lvl->status == syck_lvl_iseq || last_lvl->status == syck_lvl_imap ) \
- { \
- goto Document; \
- } \
- else \
- { \
- ADD_LEVEL( to_len, lvl_type ); \
- if ( reset == 1 ) YYPOS(0); \
- return YAML_IOPEN; \
- } \
- }
-
-/*
- * Nice little macro to ensure closure of levels.
- * * Only use this macro in the "Document" section *
- */
-#define ENSURE_YAML_IEND(last_lvl, to_len) \
- if ( last_lvl->spaces > to_len ) \
- { \
- syck_parser_pop_level( parser ); \
- YYPOS(0); \
- return YAML_IEND; \
- }
-
-/*
- * Concatenates string items and manages allocation
- * to the string
- */
-#define CAT(s, c, i, l) \
- { \
- if ( i + 1 >= c ) \
- { \
- c += QUOTELEN; \
- S_REALLOC_N( s, char, c ); \
- } \
- s[i++] = l; \
- s[i] = '\0'; \
- }
-
-/*
- * Parser for standard YAML Bytecode [UTF-8]
- */
-int
-sycklex_bytecode_utf8( YYSTYPE *sycklval, SyckParser *parser )
-{
- SyckLevel *lvl;
- syck_parser_ptr = parser;
- if ( YYCURSOR == NULL )
- {
- syck_parser_read( parser );
- }
-
- if ( parser->force_token != 0 )
- {
- int t = parser->force_token;
- parser->force_token = 0;
- return t;
- }
-
-#line 172 "bytecode.re"
-
-
- lvl = CURRENT_LEVEL();
- if ( lvl->status == syck_lvl_doc )
- {
- goto Document;
- }
-
-/* Header: */
-
- YYTOKEN = YYCURSOR;
-
-
-#line 165 "<stdout>"
-{
- YYCTYPE yych;
- unsigned int yyaccept = 0;
- goto yy0;
- ++YYCURSOR;
-yy0:
- if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
- yych = *YYCURSOR;
- switch(yych){
- case 0x00: goto yy2;
- case 'D': goto yy3;
- default: goto yy5;
- }
-yy2: YYCURSOR = YYMARKER;
- switch(yyaccept){
- case 0: goto yy4;
- }
-yy3: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case 0x0A: goto yy6;
- case 0x0D: goto yy8;
- default: goto yy4;
- }
-yy4:
-#line 199 "bytecode.re"
-{ YYPOS(0);
- goto Document;
- }
-#line 195 "<stdout>"
-yy5: yych = *++YYCURSOR;
- goto yy4;
-yy6: ++YYCURSOR;
- goto yy7;
-yy7:
-#line 186 "bytecode.re"
-{ if ( lvl->status == syck_lvl_header )
- {
- CHK_NL(YYCURSOR);
- goto Directive;
- }
- else
- {
- ENSURE_YAML_IEND(lvl, -1);
- YYPOS(0);
- return 0;
- }
- }
-#line 214 "<stdout>"
-yy8: ++YYCURSOR;
- switch((yych = *YYCURSOR)) {
- case 0x0A: goto yy6;
- default: goto yy2;
- }
-}
-#line 203 "bytecode.re"
-
-
-Document:
- {
- lvl = CURRENT_LEVEL();
- if ( lvl->status == syck_lvl_header )
- {
- lvl->status = syck_lvl_doc;
- }
-
- YYTOKEN = YYCURSOR;
-
-
-#line 235 "<stdout>"
-{
- YYCTYPE yych;
- goto yy9;
- ++YYCURSOR;
-yy9:
- if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
- yych = *YYCURSOR;
- switch(yych){
- case 0x00: goto yy30;
- case 0x0A: goto yy27;
- case 0x0D: goto yy29;
- case 'A': goto yy19;
- case 'D': goto yy12;
- case 'E': goto yy16;
- case 'M': goto yy14;
- case 'P': goto yy13;
- case 'Q': goto yy15;
- case 'R': goto yy21;
- case 'S': goto yy17;
- case 'T': goto yy23;
- case 'c': goto yy25;
- default: goto yy11;
- }
-yy11:yy12: yych = *++YYCURSOR;
- switch(yych){
- case 0x0A: goto yy41;
- case 0x0D: goto yy44;
- default: goto yy11;
- }
-yy13: yych = *++YYCURSOR;
- switch(yych){
- case 0x0A: goto yy41;
- case 0x0D: goto yy43;
- default: goto yy11;
- }
-yy14: yych = *++YYCURSOR;
- switch(yych){
- case 0x0A: goto yy38;
- case 0x0D: goto yy40;
- default: goto yy11;
- }
-yy15: yych = *++YYCURSOR;
- switch(yych){
- case 0x0A: goto yy35;
- case 0x0D: goto yy37;
- default: goto yy11;
- }
-yy16: yych = *++YYCURSOR;
- switch(yych){
- case 0x0A: goto yy32;
- case 0x0D: goto yy34;
- default: goto yy11;
- }
-yy17: ++YYCURSOR;
- goto yy18;
-yy18:
-#line 288 "bytecode.re"
-{ ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_str);
- goto Scalar;
- }
-#line 296 "<stdout>"
-yy19: ++YYCURSOR;
- goto yy20;
-yy20:
-#line 292 "bytecode.re"
-{ ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_open);
- sycklval->name = get_inline( parser );
- syck_hdlr_remove_anchor( parser, sycklval->name );
- CHK_NL(YYCURSOR);
- return YAML_ANCHOR;
- }
-#line 307 "<stdout>"
-yy21: ++YYCURSOR;
- goto yy22;
-yy22:
-#line 299 "bytecode.re"
-{ ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_str);
- sycklval->name = get_inline( parser );
- POP_LEVEL();
- if ( *( YYCURSOR - 1 ) == '\n' ) YYCURSOR--;
- return YAML_ALIAS;
- }
-#line 318 "<stdout>"
-yy23: ++YYCURSOR;
- goto yy24;
-yy24:
-#line 306 "bytecode.re"
-{ char *qstr;
- ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_open);
- qstr = get_inline( parser );
- CHK_NL(YYCURSOR);
- if ( qstr[0] == '!' )
- {
- size_t qidx = strlen( qstr );
- if ( qstr[1] == '\0' )
- {
- free( qstr );
- return YAML_ITRANSFER;
- }
-
- lvl = CURRENT_LEVEL();
-
- /*
- * URL Prefixing
- */
- if ( qstr[1] == '^' )
- {
- sycklval->name = S_ALLOC_N( char, qidx + strlen( lvl->domain ) );
- sycklval->name[0] = '\0';
- strcat( sycklval->name, lvl->domain );
- strncat( sycklval->name, qstr + 2, qidx - 2 );
- free( qstr );
- }
- else
- {
- char *carat = qstr + 1;
- char *qend = qstr + qidx;
- while ( (++carat) < qend )
- {
- if ( *carat == '^' )
- break;
- }
-
- if ( carat < qend )
- {
- free( lvl->domain );
- lvl->domain = syck_strndup( qstr + 1, carat - ( qstr + 1 ) );
- sycklval->name = S_ALLOC_N( char, ( qend - carat ) + strlen( lvl->domain ) );
- sycklval->name[0] = '\0';
- strcat( sycklval->name, lvl->domain );
- strncat( sycklval->name, carat + 1, ( qend - carat ) - 1 );
- free( qstr );
- }
- else
- {
- sycklval->name = S_ALLOC_N( char, strlen( qstr ) );
- sycklval->name[0] = '\0';
- S_MEMCPY( sycklval->name, qstr + 1, char, strlen( qstr ) );
- free( qstr );
- }
- }
- return YAML_TRANSFER;
- }
- sycklval->name = qstr;
- return YAML_TAGURI;
- }
-#line 382 "<stdout>"
-yy25: ++YYCURSOR;
- goto yy26;
-yy26:
-#line 366 "bytecode.re"
-{ goto Comment; }
-#line 388 "<stdout>"
-yy27: ++YYCURSOR;
- goto yy28;
-yy28:
-#line 368 "bytecode.re"
-{ CHK_NL(YYCURSOR);
- if ( lvl->status == syck_lvl_seq )
- {
- return YAML_INDENT;
- }
- else if ( lvl->status == syck_lvl_map )
- {
- if ( lvl->ncount % 2 == 1 ) return ':';
- else return YAML_INDENT;
- }
- goto Document;
- }
-#line 405 "<stdout>"
-yy29: yych = *++YYCURSOR;
- switch(yych){
- case 0x0A: goto yy27;
- default: goto yy11;
- }
-yy30: ++YYCURSOR;
- goto yy31;
-yy31:
-#line 381 "bytecode.re"
-{ ENSURE_YAML_IEND(lvl, -1);
- YYPOS(0);
- return 0;
- }
-#line 419 "<stdout>"
-yy32: ++YYCURSOR;
- goto yy33;
-yy33:
-#line 252 "bytecode.re"
-{ if ( lvl->status == syck_lvl_seq && lvl->ncount == 0 )
- {
- lvl->ncount++;
- YYPOS(0);
- FORCE_NEXT_TOKEN( ']' );
- return '[';
- }
- else if ( lvl->status == syck_lvl_map && lvl->ncount == 0 )
- {
- lvl->ncount++;
- YYPOS(0);
- FORCE_NEXT_TOKEN( '}' );
- return '{';
- }
-
- POP_LEVEL();
- lvl = CURRENT_LEVEL();
- if ( lvl->status == syck_lvl_seq )
- {
- FORCE_NEXT_TOKEN(YAML_INDENT);
- }
- else if ( lvl->status == syck_lvl_map )
- {
- if ( lvl->ncount % 2 == 1 )
- {
- FORCE_NEXT_TOKEN(':');
- }
- else
- {
- FORCE_NEXT_TOKEN(YAML_INDENT);
- }
- }
- CHK_NL(YYCURSOR);
- return YAML_IEND;
- }
-#line 459 "<stdout>"
-yy34: yych = *++YYCURSOR;
- switch(yych){
- case 0x0A: goto yy32;
- default: goto yy11;
- }
-yy35: ++YYCURSOR;
- goto yy36;
-yy36:
-#line 237 "bytecode.re"
-{ int complex = 0;
- if ( lvl->ncount % 2 == 0 && ( lvl->status == syck_lvl_map || lvl->status == syck_lvl_seq ) )
- {
- complex = 1;
- }
- ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_seq);
- CHK_NL(YYCURSOR);
- if ( complex )
- {
- FORCE_NEXT_TOKEN( YAML_IOPEN );
- return '?';
- }
- return YAML_IOPEN;
- }
-#line 483 "<stdout>"
-yy37: yych = *++YYCURSOR;
- switch(yych){
- case 0x0A: goto yy35;
- default: goto yy11;
- }
-yy38: ++YYCURSOR;
- goto yy39;
-yy39:
-#line 222 "bytecode.re"
-{ int complex = 0;
- if ( lvl->ncount % 2 == 0 && ( lvl->status == syck_lvl_map || lvl->status == syck_lvl_seq ) )
- {
- complex = 1;
- }
- ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_map);
- CHK_NL(YYCURSOR);
- if ( complex )
- {
- FORCE_NEXT_TOKEN( YAML_IOPEN );
- return '?';
- }
- return YAML_IOPEN;
- }
-#line 507 "<stdout>"
-yy40: yych = *++YYCURSOR;
- switch(yych){
- case 0x0A: goto yy38;
- default: goto yy11;
- }
-yy41: ++YYCURSOR;
- goto yy42;
-yy42:
-#line 217 "bytecode.re"
-{ ENSURE_YAML_IEND(lvl, -1);
- YYPOS(0);
- return 0;
- }
-#line 521 "<stdout>"
-yy43: yych = *++YYCURSOR;
- switch(yych){
- case 0x0A: goto yy41;
- default: goto yy11;
- }
-yy44: ++YYCURSOR;
- switch((yych = *YYCURSOR)) {
- case 0x0A: goto yy41;
- default: goto yy11;
- }
-}
-#line 386 "bytecode.re"
-
-
- }
-
-Directive:
- {
- YYTOKEN = YYCURSOR;
-
-
-#line 543 "<stdout>"
-{
- YYCTYPE yych;
- unsigned int yyaccept = 0;
- goto yy45;
- ++YYCURSOR;
-yy45:
- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
- yych = *YYCURSOR;
- switch(yych){
- case 0x00: goto yy47;
- case 'V': goto yy48;
- default: goto yy50;
- }
-yy47: YYCURSOR = YYMARKER;
- switch(yyaccept){
- case 0: goto yy49;
- }
-yy48: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case '.':
- case '/':
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case ':':
- case ';':
- case '<':
- case '=':
- case '>':
- case '?':
- case '@':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '[':
- case '\\':
- case ']':
- case '^':
- case '_': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy51;
- default: goto yy49;
- }
-yy49:
-#line 399 "bytecode.re"
-{ YYCURSOR = YYTOKEN;
- return YAML_DOCSEP;
- }
-#line 646 "<stdout>"
-yy50: yych = *++YYCURSOR;
- goto yy49;
-yy51: ++YYCURSOR;
- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
- yych = *YYCURSOR;
- goto yy52;
-yy52: switch(yych){
- case '.':
- case '/':
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case ';':
- case '<':
- case '=':
- case '>':
- case '?':
- case '@':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '[':
- case '\\':
- case ']':
- case '^':
- case '_': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy51;
- case ':': goto yy53;
- default: goto yy47;
- }
-yy53: yych = *++YYCURSOR;
- switch(yych){
- case '.':
- case '/':
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case ':':
- case ';':
- case '<':
- case '=':
- case '>':
- case '?':
- case '@':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '[':
- case '\\':
- case ']':
- case '^':
- case '_': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy54;
- default: goto yy47;
- }
-yy54: ++YYCURSOR;
- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
- yych = *YYCURSOR;
- goto yy55;
-yy55: switch(yych){
- case 0x0A: goto yy56;
- case 0x0D: goto yy58;
- case '.':
- case '/':
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case ':':
- case ';':
- case '<':
- case '=':
- case '>':
- case '?':
- case '@':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '[':
- case '\\':
- case ']':
- case '^':
- case '_': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy54;
- default: goto yy47;
- }
-yy56: ++YYCURSOR;
- goto yy57;
-yy57:
-#line 396 "bytecode.re"
-{ CHK_NL(YYCURSOR);
- goto Directive; }
-#line 899 "<stdout>"
-yy58: ++YYCURSOR;
- switch((yych = *YYCURSOR)) {
- case 0x0A: goto yy56;
- default: goto yy47;
- }
-}
-#line 402 "bytecode.re"
-
-
- }
-
-Comment:
- {
- YYTOKEN = YYCURSOR;
-
-
-#line 916 "<stdout>"
-{
- YYCTYPE yych;
- goto yy59;
- ++YYCURSOR;
-yy59:
- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
- yych = *YYCURSOR;
- switch(yych){
- case 0x00: goto yy61;
- case 0x0A: goto yy62;
- case 0x0D: goto yy64;
- default: goto yy66;
- }
-yy61:yy62: ++YYCURSOR;
- goto yy63;
-yy63:
-#line 412 "bytecode.re"
-{ CHK_NL(YYCURSOR);
- goto Document; }
-#line 936 "<stdout>"
-yy64: ++YYCURSOR;
- switch((yych = *YYCURSOR)) {
- case 0x0A: goto yy67;
- default: goto yy65;
- }
-yy65:
-#line 415 "bytecode.re"
-{ goto Comment; }
-#line 945 "<stdout>"
-yy66: yych = *++YYCURSOR;
- goto yy65;
-yy67: ++YYCURSOR;
- yych = *YYCURSOR;
- goto yy63;
-}
-#line 417 "bytecode.re"
-
-
- }
-
-Scalar:
- {
- int idx = 0;
- int cap = 100;
- char *str = S_ALLOC_N( char, cap );
- char *tok;
-
- str[0] = '\0';
-
-Scalar2:
- tok = YYCURSOR;
-
-
-#line 970 "<stdout>"
-{
- YYCTYPE yych;
- goto yy68;
- ++YYCURSOR;
-yy68:
- if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
- yych = *YYCURSOR;
- switch(yych){
- case 0x00: goto yy74;
- case 0x0A: goto yy70;
- case 0x0D: goto yy72;
- default: goto yy76;
- }
-yy70: ++YYCURSOR;
- switch((yych = *YYCURSOR)) {
- case 'C': goto yy78;
- case 'N': goto yy80;
- case 'Z': goto yy83;
- default: goto yy71;
- }
-yy71:
-#line 461 "bytecode.re"
-{ YYCURSOR = tok;
- goto ScalarEnd;
- }
-#line 996 "<stdout>"
-yy72: ++YYCURSOR;
- switch((yych = *YYCURSOR)) {
- case 0x0A: goto yy77;
- default: goto yy73;
- }
-yy73:
-#line 469 "bytecode.re"
-{ CAT(str, cap, idx, tok[0]);
- goto Scalar2;
- }
-#line 1007 "<stdout>"
-yy74: ++YYCURSOR;
- goto yy75;
-yy75:
-#line 465 "bytecode.re"
-{ YYCURSOR = tok;
- goto ScalarEnd;
- }
-#line 1015 "<stdout>"
-yy76: yych = *++YYCURSOR;
- goto yy73;
-yy77: yych = *++YYCURSOR;
- switch(yych){
- case 'C': goto yy78;
- case 'N': goto yy80;
- case 'Z': goto yy83;
- default: goto yy71;
- }
-yy78: ++YYCURSOR;
- goto yy79;
-yy79:
-#line 435 "bytecode.re"
-{ CHK_NL(tok+1);
- goto Scalar2; }
-#line 1031 "<stdout>"
-yy80: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy81;
-yy81: switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy80;
- default: goto yy82;
- }
-yy82:
-#line 438 "bytecode.re"
-{ CHK_NL(tok+1);
- if ( tok + 2 < YYCURSOR )
- {
- char *count = tok + 2;
- int total = strtod( count, NULL );
- int i;
- for ( i = 0; i < total; i++ )
- {
- CAT(str, cap, idx, '\n');
- }
- }
- else
- {
- CAT(str, cap, idx, '\n');
- }
- goto Scalar2;
- }
-#line 1068 "<stdout>"
-yy83: ++YYCURSOR;
- goto yy84;
-yy84:
-#line 456 "bytecode.re"
-{ CHK_NL(tok+1);
- CAT(str, cap, idx, '\0');
- goto Scalar2;
- }
-#line 1077 "<stdout>"
-}
-#line 473 "bytecode.re"
-
-
-ScalarEnd:
- {
- SyckNode *n = syck_alloc_str();
- n->data.str->ptr = str;
- n->data.str->len = idx;
- sycklval->nodeData = n;
- POP_LEVEL();
- if ( parser->implicit_typing == 1 )
- {
- try_tag_implicit( sycklval->nodeData, parser->taguri_expansion );
- }
- return YAML_PLAIN;
- }
- }
-
-}
-
-char *
-get_inline( SyckParser *parser )
-{
- int idx = 0;
- int cap = 100;
- char *str = S_ALLOC_N( char, cap );
- char *tok;
-
- str[0] = '\0';
-
-Inline:
- {
- tok = YYCURSOR;
-
-
-#line 1114 "<stdout>"
-{
- YYCTYPE yych;
- goto yy85;
- ++YYCURSOR;
-yy85:
- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
- yych = *YYCURSOR;
- switch(yych){
- case 0x00: goto yy91;
- case 0x0A: goto yy87;
- case 0x0D: goto yy89;
- default: goto yy93;
- }
-yy87: ++YYCURSOR;
- goto yy88;
-yy88:
-#line 508 "bytecode.re"
-{ CHK_NL(YYCURSOR);
- return str; }
-#line 1134 "<stdout>"
-yy89: ++YYCURSOR;
- switch((yych = *YYCURSOR)) {
- case 0x0A: goto yy94;
- default: goto yy90;
- }
-yy90:
-#line 515 "bytecode.re"
-{ CAT(str, cap, idx, tok[0]);
- goto Inline;
- }
-#line 1145 "<stdout>"
-yy91: ++YYCURSOR;
- goto yy92;
-yy92:
-#line 511 "bytecode.re"
-{ YYCURSOR = tok;
- return str;
- }
-#line 1153 "<stdout>"
-yy93: yych = *++YYCURSOR;
- goto yy90;
-yy94: ++YYCURSOR;
- yych = *YYCURSOR;
- goto yy88;
-}
-#line 519 "bytecode.re"
-
-
- }
-
-}
-
diff --git a/ext/syck/depend b/ext/syck/depend
deleted file mode 100644
index 3eec4de72a..0000000000
--- a/ext/syck/depend
+++ /dev/null
@@ -1,12 +0,0 @@
-ruby_headers = $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h \
- $(hdrdir)/missing.h $(hdrdir)/intern.h $(hdrdir)/st.h
-bytecode.o: bytecode.c syck.h gram.h $(ruby_headers)
-emitter.o: emitter.c syck.h $(ruby_headers)
-gram.o: gram.c syck.h $(hdrdir)/st.h
-handler.o: handler.c syck.h $(ruby_headers)
-implicit.o: implicit.c syck.h $(ruby_headers)
-node.o: node.c syck.h $(ruby_headers)
-rubyext.o: rubyext.c syck.h $(ruby_headers)
-syck.o: syck.c syck.h $(ruby_headers)
-token.o: token.c syck.h gram.h $(ruby_headers)
-yaml2byte.o: yaml2byte.c syck.h yamlbyte.h $(ruby_headers)
diff --git a/ext/syck/emitter.c b/ext/syck/emitter.c
deleted file mode 100644
index af0d7891f8..0000000000
--- a/ext/syck/emitter.c
+++ /dev/null
@@ -1,1247 +0,0 @@
-/*
- * emitter.c
- *
- * $Author$
- *
- * Copyright (C) 2003 why the lucky stiff
- *
- * All Base64 code from Ruby's pack.c.
- * Ruby is Copyright (C) 1993-2007 Yukihiro Matsumoto
- */
-#include "ruby/ruby.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include "syck.h"
-
-#define DEFAULT_ANCHOR_FORMAT "id%03d"
-
-const char hex_table[] =
-"0123456789ABCDEF";
-static char b64_table[] =
-"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
-/*
- * Built-in base64 (from Ruby's pack.c)
- */
-char *
-syck_base64enc( char *s, long len )
-{
- long i = 0;
- int padding = '=';
- char *buff = S_ALLOC_N(char, len * 4 / 3 + 6);
-
- while (len >= 3) {
- buff[i++] = b64_table[077 & (*s >> 2)];
- buff[i++] = b64_table[077 & (((*s << 4) & 060) | ((s[1] >> 4) & 017))];
- buff[i++] = b64_table[077 & (((s[1] << 2) & 074) | ((s[2] >> 6) & 03))];
- buff[i++] = b64_table[077 & s[2]];
- s += 3;
- len -= 3;
- }
- if (len == 2) {
- buff[i++] = b64_table[077 & (*s >> 2)];
- buff[i++] = b64_table[077 & (((*s << 4) & 060) | ((s[1] >> 4) & 017))];
- buff[i++] = b64_table[077 & (((s[1] << 2) & 074) | (('\0' >> 6) & 03))];
- buff[i++] = padding;
- }
- else if (len == 1) {
- buff[i++] = b64_table[077 & (*s >> 2)];
- buff[i++] = b64_table[077 & (((*s << 4) & 060) | (('\0' >> 4) & 017))];
- buff[i++] = padding;
- buff[i++] = padding;
- }
- buff[i++] = '\n';
- return buff;
-}
-
-char *
-syck_base64dec( char *s, long len )
-{
- int a = -1,b = -1,c = 0,d;
- static int first = 1;
- static int b64_xtable[256];
- char *ptr = syck_strndup( s, len );
- char *end = ptr;
- char *send = s + len;
-
- if (first) {
- int i;
- first = 0;
-
- for (i = 0; i < 256; i++) {
- b64_xtable[i] = -1;
- }
- for (i = 0; i < 64; i++) {
- b64_xtable[(int)b64_table[i]] = i;
- }
- }
- while (s < send) {
- while (s[0] == '\r' || s[0] == '\n') { s++; }
- if ((a = b64_xtable[(int)s[0]]) == -1) break;
- if ((b = b64_xtable[(int)s[1]]) == -1) break;
- if ((c = b64_xtable[(int)s[2]]) == -1) break;
- if ((d = b64_xtable[(int)s[3]]) == -1) break;
- *end++ = a << 2 | b >> 4;
- *end++ = b << 4 | c >> 2;
- *end++ = c << 6 | d;
- s += 4;
- }
- if (a != -1 && b != -1) {
- if (s + 2 < send && s[2] == '=')
- *end++ = a << 2 | b >> 4;
- if (c != -1 && s + 3 < send && s[3] == '=') {
- *end++ = a << 2 | b >> 4;
- *end++ = b << 4 | c >> 2;
- }
- }
- *end = '\0';
- /*RSTRING_LEN(buf) = ptr - RSTRING_PTR(buf);*/
- return ptr;
-}
-
-/*
- * Allocate an emitter
- */
-SyckEmitter *
-syck_new_emitter(void)
-{
- SyckEmitter *e;
- e = S_ALLOC( SyckEmitter );
- e->headless = 0;
- e->use_header = 0;
- e->use_version = 0;
- e->sort_keys = 0;
- e->anchor_format = NULL;
- e->explicit_typing = 0;
- e->best_width = 80;
- e->style = scalar_none;
- e->stage = doc_open;
- e->indent = 2;
- e->level = -1;
- e->anchors = NULL;
- e->markers = NULL;
- e->anchored = NULL;
- e->bufsize = SYCK_BUFFERSIZE;
- e->buffer = NULL;
- e->marker = NULL;
- e->bufpos = 0;
- e->emitter_handler = NULL;
- e->output_handler = NULL;
- e->lvl_idx = 0;
- e->lvl_capa = ALLOC_CT;
- e->levels = S_ALLOC_N( SyckLevel, e->lvl_capa );
- syck_emitter_reset_levels( e );
- e->bonus = NULL;
- return e;
-}
-
-int
-syck_st_free_anchors( char *key, char *name, char *arg )
-{
- S_FREE( name );
- return ST_CONTINUE;
-}
-
-void
-syck_emitter_st_free( SyckEmitter *e )
-{
- /*
- * Free the anchor tables
- */
- if ( e->anchors != NULL )
- {
- st_foreach( e->anchors, syck_st_free_anchors, 0 );
- st_free_table( e->anchors );
- e->anchors = NULL;
- }
-
- if ( e->anchored != NULL )
- {
- st_free_table( e->anchored );
- e->anchored = NULL;
- }
-
- /*
- * Free the markers tables
- */
- if ( e->markers != NULL )
- {
- st_free_table( e->markers );
- e->markers = NULL;
- }
-}
-
-SyckLevel *
-syck_emitter_current_level( SyckEmitter *e )
-{
- return &e->levels[e->lvl_idx-1];
-}
-
-SyckLevel *
-syck_emitter_parent_level( SyckEmitter *e )
-{
- return &e->levels[e->lvl_idx-2];
-}
-
-void
-syck_emitter_pop_level( SyckEmitter *e )
-{
- ASSERT( e != NULL );
-
- /* The root level should never be popped */
- if ( e->lvl_idx <= 1 ) return;
-
- e->lvl_idx -= 1;
- free( e->levels[e->lvl_idx].domain );
-}
-
-void
-syck_emitter_add_level( SyckEmitter *e, int len, enum syck_level_status status )
-{
- ASSERT( e != NULL );
- if ( e->lvl_idx + 1 > e->lvl_capa )
- {
- e->lvl_capa += ALLOC_CT;
- S_REALLOC_N( e->levels, SyckLevel, e->lvl_capa );
- }
-
- ASSERT( len > e->levels[e->lvl_idx-1].spaces );
- e->levels[e->lvl_idx].spaces = len;
- e->levels[e->lvl_idx].ncount = 0;
- e->levels[e->lvl_idx].domain = syck_strndup( e->levels[e->lvl_idx-1].domain, strlen( e->levels[e->lvl_idx-1].domain ) );
- e->levels[e->lvl_idx].status = status;
- e->levels[e->lvl_idx].anctag = 0;
- e->lvl_idx += 1;
-}
-
-void
-syck_emitter_reset_levels( SyckEmitter *e )
-{
- while ( e->lvl_idx > 1 )
- {
- syck_emitter_pop_level( e );
- }
-
- if ( e->lvl_idx < 1 )
- {
- e->lvl_idx = 1;
- e->levels[0].spaces = -1;
- e->levels[0].ncount = 0;
- e->levels[0].domain = syck_strndup( "", 0 );
- e->levels[0].anctag = 0;
- }
- e->levels[0].status = syck_lvl_header;
-}
-
-void
-syck_emitter_handler( SyckEmitter *e, SyckEmitterHandler hdlr )
-{
- e->emitter_handler = hdlr;
-}
-
-void
-syck_output_handler( SyckEmitter *e, SyckOutputHandler hdlr )
-{
- e->output_handler = hdlr;
-}
-
-void
-syck_free_emitter( SyckEmitter *e )
-{
- /*
- * Free tables
- */
- syck_emitter_st_free( e );
- syck_emitter_reset_levels( e );
- S_FREE( e->levels[0].domain );
- S_FREE( e->levels );
- if ( e->buffer != NULL )
- {
- S_FREE( e->buffer );
- }
- S_FREE( e );
-}
-
-void
-syck_emitter_clear( SyckEmitter *e )
-{
- if ( e->buffer == NULL )
- {
- e->buffer = S_ALLOC_N( char, e->bufsize );
- S_MEMZERO( e->buffer, char, e->bufsize );
- }
- e->buffer[0] = '\0';
- e->marker = e->buffer;
- e->bufpos = 0;
-}
-
-/*
- * Raw write to the emitter buffer.
- */
-void
-syck_emitter_write( SyckEmitter *e, const char *str, long len )
-{
- long at;
- ASSERT( str != NULL );
- if ( e->buffer == NULL )
- {
- syck_emitter_clear( e );
- }
-
- /*
- * Flush if at end of buffer
- */
- at = e->marker - e->buffer;
- if ( len + at >= (long)e->bufsize )
- {
- syck_emitter_flush( e, 0 );
- for (;;) {
- long rest = e->bufsize - (e->marker - e->buffer);
- if (len <= rest) break;
- S_MEMCPY( e->marker, str, char, rest );
- e->marker += rest;
- str += rest;
- len -= rest;
- syck_emitter_flush( e, 0 );
- }
- }
-
- /*
- * Write to buffer
- */
- S_MEMCPY( e->marker, str, char, len );
- e->marker += len;
-}
-
-/*
- * Write a chunk of data out.
- */
-void
-syck_emitter_flush( SyckEmitter *e, long check_room )
-{
- /*
- * Check for enough space in the buffer for check_room length.
- */
- if ( check_room > 0 )
- {
- if ( (long)e->bufsize > ( e->marker - e->buffer ) + check_room )
- {
- return;
- }
- }
- else
- {
- check_room = e->bufsize;
- }
-
- /*
- * Commit buffer.
- */
- if ( check_room > e->marker - e->buffer )
- {
- check_room = e->marker - e->buffer;
- }
- (e->output_handler)( e, e->buffer, check_room );
- e->bufpos += check_room;
- e->marker -= check_room;
-}
-
-/*
- * Start emitting from the given node, check for anchoring and then
- * issue the callback to the emitter handler.
- */
-void
-syck_emit( SyckEmitter *e, st_data_t n )
-{
- SYMID oid;
- char *anchor_name = NULL;
- int indent = 0;
- long x = 0;
- SyckLevel *lvl = syck_emitter_current_level( e );
-
- /*
- * Determine headers.
- */
- if ( e->stage == doc_open && ( e->headless == 0 || e->use_header == 1 ) )
- {
- if ( e->use_version == 1 )
- {
- char *header = S_ALLOC_N( char, 64 );
- S_MEMZERO( header, char, 64 );
- sprintf( header, "--- %%YAML:%d.%d ", SYCK_YAML_MAJOR, SYCK_YAML_MINOR );
- syck_emitter_write( e, header, strlen( header ) );
- S_FREE( header );
- }
- else
- {
- syck_emitter_write( e, "--- ", 4 );
- }
- e->stage = doc_processing;
- }
-
- /* Add new level */
- if ( lvl->spaces >= 0 ) {
- indent = lvl->spaces + e->indent;
- }
- syck_emitter_add_level( e, indent, syck_lvl_open );
- lvl = syck_emitter_current_level( e );
-
- /* Look for anchor */
- if ( e->anchors != NULL &&
- st_lookup( e->markers, n, (st_data_t *)&oid ) &&
- st_lookup( e->anchors, (st_data_t)oid, (void *)&anchor_name ) )
- {
- if ( e->anchored == NULL )
- {
- e->anchored = st_init_numtable();
- }
-
- if ( ! st_lookup( e->anchored, (st_data_t)anchor_name, (st_data_t *)&x ) )
- {
- char *an = S_ALLOC_N( char, strlen( anchor_name ) + 3 );
- sprintf( an, "&%s ", anchor_name );
- syck_emitter_write( e, an, strlen( anchor_name ) + 2 );
- free( an );
-
- x = 1;
- st_insert( e->anchored, (st_data_t)anchor_name, (st_data_t)x );
- lvl->anctag = 1;
- }
- else
- {
- char *an = S_ALLOC_N( char, strlen( anchor_name ) + 2 );
- sprintf( an, "*%s", anchor_name );
- syck_emitter_write( e, an, strlen( anchor_name ) + 1 );
- free( an );
-
- goto end_emit;
- }
- }
-
- (e->emitter_handler)( e, n );
-
- /* Pop the level */
-end_emit:
- syck_emitter_pop_level( e );
- if ( e->lvl_idx == 1 ) {
- syck_emitter_write( e, "\n", 1 );
- e->headless = 0;
- e->stage = doc_open;
- }
-}
-
-/*
- * Determine what tag needs to be written, based on the taguri of the node
- * and the implicit tag which would be assigned to this node. If a tag is
- * required, write the tag.
- */
-void syck_emit_tag( SyckEmitter *e, const char *tag, const char *ignore )
-{
- SyckLevel *lvl;
- if ( tag == NULL ) return;
- if ( ignore != NULL && syck_tagcmp( tag, ignore ) == 0 && e->explicit_typing == 0 ) return;
- lvl = syck_emitter_current_level( e );
-
- /* implicit */
- if ( strlen( tag ) == 0 ) {
- syck_emitter_write( e, "! ", 2 );
-
- /* global types */
- } else if ( strncmp( tag, "tag:", 4 ) == 0 ) {
- int taglen = (int)strlen( tag );
- syck_emitter_write( e, "!", 1 );
- if ( strncmp( tag + 4, YAML_DOMAIN, strlen( YAML_DOMAIN ) ) == 0 ) {
- int skip = 4 + strlen( YAML_DOMAIN ) + 1;
- syck_emitter_write( e, tag + skip, taglen - skip );
- } else {
- const char *subd = tag + 4;
- while ( *subd != ':' && *subd != '\0' ) subd++;
- if ( *subd == ':' ) {
- if ( subd - tag > ( (long)( strlen( YAML_DOMAIN ) + 5 )) &&
- strncmp( subd - strlen( YAML_DOMAIN ), YAML_DOMAIN, strlen( YAML_DOMAIN ) ) == 0 ) {
- syck_emitter_write( e, tag + 4, subd - strlen( YAML_DOMAIN ) - ( tag + 4 ) - 1 );
- syck_emitter_write( e, "/", 1 );
- syck_emitter_write( e, subd + 1, ( tag + taglen ) - ( subd + 1 ) );
- } else {
- syck_emitter_write( e, tag + 4, subd - ( tag + 4 ) );
- syck_emitter_write( e, "/", 1 );
- syck_emitter_write( e, subd + 1, ( tag + taglen ) - ( subd + 1 ) );
- }
- } else {
- /* TODO: Invalid tag (no colon after domain) */
- return;
- }
- }
- syck_emitter_write( e, " ", 1 );
-
- /* private types */
- } else if ( strncmp( tag, "x-private:", 10 ) == 0 ) {
- syck_emitter_write( e, "!!", 2 );
- syck_emitter_write( e, tag + 10, strlen( tag ) - 10 );
- syck_emitter_write( e, " ", 1 );
- }
- lvl->anctag = 1;
-}
-
-/*
- * Emit a newline and an appropriately spaced indent.
- */
-void syck_emit_indent( SyckEmitter *e )
-{
- int i;
- SyckLevel *lvl = syck_emitter_current_level( e );
- if ( e->bufpos == 0 && ( e->marker - e->buffer ) == 0 ) return;
- if ( lvl->spaces >= 0 ) {
- char *spcs = S_ALLOC_N( char, lvl->spaces + 2 );
-
- spcs[0] = '\n'; spcs[lvl->spaces + 1] = '\0';
- for ( i = 0; i < lvl->spaces; i++ ) spcs[i+1] = ' ';
- syck_emitter_write( e, spcs, lvl->spaces + 1 );
- free( spcs );
- }
-}
-
-/* Clear the scan */
-#define SCAN_NONE 0
-/* All printable characters? */
-#define SCAN_NONPRINT 1
-/* Any indented lines? */
-#define SCAN_INDENTED 2
-/* Larger than the requested width? */
-#define SCAN_WIDE 4
-/* Opens or closes with whitespace? */
-#define SCAN_WHITEEDGE 8
-/* Contains a newline */
-#define SCAN_NEWLINE 16
-/* Contains a single quote */
-#define SCAN_SINGLEQ 32
-/* Contains a double quote */
-#define SCAN_DOUBLEQ 64
-/* Starts with a token */
-#define SCAN_INDIC_S 128
-/* Contains a flow indicator */
-#define SCAN_INDIC_C 256
-/* Ends without newlines */
-#define SCAN_NONL_E 512
-/* Ends with many newlines */
-#define SCAN_MANYNL_E 1024
-/* Contains flow map indicators */
-#define SCAN_FLOWMAP 2048
-/* Contains flow seq indicators */
-#define SCAN_FLOWSEQ 4096
-/* Contains a valid doc separator */
-#define SCAN_DOCSEP 8192
-
-/*
- * Basic printable test for LATIN-1 characters.
- */
-int
-syck_scan_scalar( int req_width, const char *cursor, long len )
-{
- long i = 0, start = 0;
- int flags = SCAN_NONE;
-
- if ( len < 1 ) return flags;
-
- /* c-indicators from the spec */
- if ( cursor[0] == '[' || cursor[0] == ']' ||
- cursor[0] == '{' || cursor[0] == '}' ||
- cursor[0] == '!' || cursor[0] == '*' ||
- cursor[0] == '&' || cursor[0] == '|' ||
- cursor[0] == '>' || cursor[0] == '\'' ||
- cursor[0] == '"' || cursor[0] == '#' ||
- cursor[0] == '%' || cursor[0] == '@' ||
- cursor[0] == '&' ) {
- flags |= SCAN_INDIC_S;
- }
- if ( ( cursor[0] == '-' || cursor[0] == ':' ||
- cursor[0] == '?' || cursor[0] == ',' ) &&
- ( len == 1 || cursor[1] == ' ' || cursor[1] == '\n' ) )
- {
- flags |= SCAN_INDIC_S;
- }
-
- /* whitespace edges */
- if ( cursor[len-1] != '\n' ) {
- flags |= SCAN_NONL_E;
- } else if ( len > 1 && cursor[len-2] == '\n' ) {
- flags |= SCAN_MANYNL_E;
- }
- if (
- ( len > 0 && ( cursor[0] == ' ' || cursor[0] == '\t' || cursor[0] == '\n' || cursor[0] == '\r' ) ) ||
- ( len > 1 && ( cursor[len-1] == ' ' || cursor[len-1] == '\t' ) )
- ) {
- flags |= SCAN_WHITEEDGE;
- }
-
- /* opening doc sep */
- if ( len >= 3 && strncmp( cursor, "---", 3 ) == 0 )
- flags |= SCAN_DOCSEP;
-
- /* scan string */
- for ( i = 0; i < len; i++ ) {
-
- if ( ! ( cursor[i] == 0x9 ||
- cursor[i] == 0xA ||
- cursor[i] == 0xD ||
- ( cursor[i] >= 0x20 && cursor[i] <= 0x7E ) )
- ) {
- flags |= SCAN_NONPRINT;
- }
- else if ( cursor[i] == '\n' ) {
- flags |= SCAN_NEWLINE;
- if ( len - i >= 3 && strncmp( &cursor[i+1], "---", 3 ) == 0 )
- flags |= SCAN_DOCSEP;
- if ( cursor[i+1] == ' ' || cursor[i+1] == '\t' )
- flags |= SCAN_INDENTED;
- if ( req_width > 0 && i - start > req_width )
- flags |= SCAN_WIDE;
- start = i;
- }
- else if ( cursor[i] == '\'' )
- {
- flags |= SCAN_SINGLEQ;
- }
- else if ( cursor[i] == '"' )
- {
- flags |= SCAN_DOUBLEQ;
- }
- else if ( cursor[i] == ']' )
- {
- flags |= SCAN_FLOWSEQ;
- }
- else if ( cursor[i] == '}' )
- {
- flags |= SCAN_FLOWMAP;
- }
- /* remember, if plain collections get implemented, to add nb-plain-flow-char */
- else if ( ( cursor[i] == ' ' && cursor[i+1] == '#' ) ||
- ( cursor[i] == ':' &&
- ( cursor[i+1] == ' ' || cursor[i+1] == '\n' || i == len - 1 ) ) )
- {
- flags |= SCAN_INDIC_C;
- }
- else if ( cursor[i] == ',' &&
- ( cursor[i+1] == ' ' || cursor[i+1] == '\n' || i == len - 1 ) )
- {
- flags |= SCAN_FLOWMAP;
- flags |= SCAN_FLOWSEQ;
- }
- }
-
- /* printf( "---STR---\n%s\nFLAGS: %d\n", cursor, flags ); */
- return flags;
-}
-/*
- * All scalars should be emitted through this function, which determines an appropriate style,
- * tag and indent.
- */
-void syck_emit_scalar( SyckEmitter *e, const char *tag, enum scalar_style force_style, int force_indent, int force_width,
- char keep_nl, const char *str, long len )
-{
- enum scalar_style favor_style = scalar_literal;
- SyckLevel *parent = syck_emitter_parent_level( e );
- SyckLevel *lvl = syck_emitter_current_level( e );
- int scan = 0;
- const char *match_implicit;
- char *implicit;
-
- if ( str == NULL ) str = "";
-
- /* No empty nulls as map keys */
- if ( len == 0 && ( parent->status == syck_lvl_map || parent->status == syck_lvl_imap ) &&
- parent->ncount % 2 == 1 && syck_tagcmp( tag, "tag:yaml.org,2002:null" ) == 0 )
- {
- str = "~";
- len = 1;
- }
-
- scan = syck_scan_scalar( force_width, str, len );
- match_implicit = syck_match_implicit( str, len );
-
- /* quote strings which default to implicits */
- implicit = syck_taguri( YAML_DOMAIN, match_implicit, (int)strlen( match_implicit ) );
- if ( syck_tagcmp( tag, implicit ) != 0 && syck_tagcmp( tag, "tag:yaml.org,2002:str" ) == 0 ) {
- force_style = scalar_2quote;
- } else {
- /* complex key */
- if ( parent->status == syck_lvl_map && parent->ncount % 2 == 1 &&
- ( !( tag == NULL ||
- ( implicit != NULL && syck_tagcmp( tag, implicit ) == 0 && e->explicit_typing == 0 ) ) ) )
- {
- syck_emitter_write( e, "? ", 2 );
- parent->status = syck_lvl_mapx;
- }
- syck_emit_tag( e, tag, implicit );
- }
- S_FREE( implicit );
-
- /* if still arbitrary, sniff a good block style. */
- if ( force_style == scalar_none ) {
- if ( scan & SCAN_NEWLINE ) {
- force_style = scalar_literal;
- } else {
- force_style = scalar_plain;
- }
- }
-
- if ( e->style == scalar_fold ) {
- favor_style = scalar_fold;
- }
-
- /* Determine block style */
- if ( scan & SCAN_NONPRINT ) {
- force_style = scalar_2quote;
- } else if ( scan & SCAN_WHITEEDGE ) {
- force_style = scalar_2quote;
- } else if ( force_style != scalar_fold && ( scan & SCAN_INDENTED ) ) {
- force_style = scalar_literal;
- } else if ( force_style == scalar_plain && ( scan & SCAN_NEWLINE ) ) {
- force_style = favor_style;
- } else if ( force_style == scalar_plain && parent->status == syck_lvl_iseq && ( scan & SCAN_FLOWSEQ ) ) {
- force_style = scalar_2quote;
- } else if ( force_style == scalar_plain && parent->status == syck_lvl_imap && ( scan & SCAN_FLOWMAP ) ) {
- force_style = scalar_2quote;
- /* } else if ( force_style == scalar_fold && ( ! ( scan & SCAN_WIDE ) ) ) {
- force_style = scalar_literal; */
- } else if ( force_style == scalar_plain && ( scan & SCAN_INDIC_S || scan & SCAN_INDIC_C ) ) {
- if ( scan & SCAN_NEWLINE ) {
- force_style = favor_style;
- } else {
- force_style = scalar_2quote;
- }
- }
-
- if ( force_indent > 0 ) {
- lvl->spaces = parent->spaces + force_indent;
- } else if ( scan & SCAN_DOCSEP ) {
- lvl->spaces = parent->spaces + e->indent;
- }
-
- /* For now, all ambiguous keys are going to be double-quoted */
- if ( ( parent->status == syck_lvl_map || parent->status == syck_lvl_mapx ) && parent->ncount % 2 == 1 ) {
- if ( force_style != scalar_plain ) {
- force_style = scalar_2quote;
- }
- }
-
- /* If the parent is an inline, double quote anything complex */
- if ( parent->status == syck_lvl_imap || parent->status == syck_lvl_iseq ) {
- if ( force_style != scalar_plain && force_style != scalar_1quote ) {
- force_style = scalar_2quote;
- }
- }
-
- /* Fix the ending newlines */
- if ( scan & SCAN_NONL_E ) {
- keep_nl = NL_CHOMP;
- } else if ( scan & SCAN_MANYNL_E ) {
- keep_nl = NL_KEEP;
- }
-
- /* Write the text node */
- switch ( force_style )
- {
- case scalar_1quote:
- syck_emit_1quoted( e, force_width, str, len );
- break;
-
- case scalar_none:
- case scalar_2quote:
- syck_emit_2quoted( e, force_width, str, len );
- break;
-
- case scalar_fold:
- syck_emit_folded( e, force_width, keep_nl, str, len );
- break;
-
- case scalar_literal:
- syck_emit_literal( e, keep_nl, str, len );
- break;
-
- case scalar_plain:
- syck_emitter_write( e, str, len );
- break;
- }
-
- if ( parent->status == syck_lvl_mapx )
- {
- syck_emitter_write( e, "\n", 1 );
- }
-}
-
-void
-syck_emitter_escape( SyckEmitter *e, const char *src, long len )
-{
- int i;
- for( i = 0; i < len; i++ )
- {
- if( (src[i] < 0x20) || (0x7E < src[i]) )
- {
- syck_emitter_write( e, "\\", 1 );
- if( '\0' == src[i] )
- syck_emitter_write( e, "0", 1 );
- else
- {
- syck_emitter_write( e, "x", 1 );
- syck_emitter_write( e, (const char *)hex_table + ((src[i] & 0xF0) >> 4), 1 );
- syck_emitter_write( e, (const char *)hex_table + (src[i] & 0x0F), 1 );
- }
- }
- else
- {
- syck_emitter_write( e, src + i, 1 );
- if( '\\' == src[i] )
- syck_emitter_write( e, "\\", 1 );
- }
- }
-}
-
-/*
- * Outputs a single-quoted block.
- */
-void
-syck_emit_1quoted( SyckEmitter *e, int width, const char *str, long len )
-{
- char do_indent = 0;
- const char *mark = str;
- const char *start = str;
- const char *end = str;
- syck_emitter_write( e, "'", 1 );
- while ( mark < str + len ) {
- if ( do_indent ) {
- syck_emit_indent( e );
- do_indent = 0;
- }
- switch ( *mark ) {
- case '\'': syck_emitter_write( e, "'", 1 ); break;
-
- case '\n':
- end = mark + 1;
- if ( *start != ' ' && *start != '\n' && *end != '\n' && *end != ' ' ) {
- syck_emitter_write( e, "\n\n", 2 );
- } else {
- syck_emitter_write( e, "\n", 1 );
- }
- do_indent = 1;
- start = mark + 1;
- break;
-
- case ' ':
- if ( width > 0 && *start != ' ' && mark - end > width ) {
- do_indent = 1;
- end = mark + 1;
- } else {
- syck_emitter_write( e, " ", 1 );
- }
- break;
-
- default:
- syck_emitter_write( e, mark, 1 );
- break;
- }
- mark++;
- }
- syck_emitter_write( e, "'", 1 );
-}
-
-/*
- * Outputs a double-quoted block.
- */
-void
-syck_emit_2quoted( SyckEmitter *e, int width, const char *str, long len )
-{
- char do_indent = 0;
- const char *mark = str;
- const char *start = str;
- const char *end = str;
- syck_emitter_write( e, "\"", 1 );
- while ( mark < str + len ) {
- if ( do_indent > 0 ) {
- if ( do_indent == 2 ) {
- syck_emitter_write( e, "\\", 1 );
- }
- syck_emit_indent( e );
- do_indent = 0;
- }
- switch ( *mark ) {
-
- /* Escape sequences allowed within double quotes. */
- case '"': syck_emitter_write( e, "\\\"", 2 ); break;
- case '\\': syck_emitter_write( e, "\\\\", 2 ); break;
- case '\0': syck_emitter_write( e, "\\0", 2 ); break;
- case '\a': syck_emitter_write( e, "\\a", 2 ); break;
- case '\b': syck_emitter_write( e, "\\b", 2 ); break;
- case '\f': syck_emitter_write( e, "\\f", 2 ); break;
- case '\r': syck_emitter_write( e, "\\r", 2 ); break;
- case '\t': syck_emitter_write( e, "\\t", 2 ); break;
- case '\v': syck_emitter_write( e, "\\v", 2 ); break;
- case 0x1b: syck_emitter_write( e, "\\e", 2 ); break;
-
- case '\n':
- end = mark + 1;
- syck_emitter_write( e, "\\n", 2 );
- do_indent = 2;
- start = mark + 1;
- if ( start < str + len && ( *start == ' ' || *start == '\n' ) ) {
- do_indent = 0;
- }
- break;
-
- case ' ':
- if ( width > 0 && *start != ' ' && mark - end > width ) {
- do_indent = 1;
- end = mark + 1;
- } else {
- syck_emitter_write( e, " ", 1 );
- }
- break;
-
- default:
- syck_emitter_escape( e, mark, 1 );
- break;
- }
- mark++;
- }
- syck_emitter_write( e, "\"", 1 );
-}
-
-/*
- * Outputs a literal block.
- */
-void
-syck_emit_literal( SyckEmitter *e, char keep_nl, const char *str, long len )
-{
- const char *mark = str;
- const char *start = str;
- const char *end = str;
- syck_emitter_write( e, "|", 1 );
- if ( keep_nl == NL_CHOMP ) {
- syck_emitter_write( e, "-", 1 );
- } else if ( keep_nl == NL_KEEP ) {
- syck_emitter_write( e, "+", 1 );
- }
- syck_emit_indent( e );
- while ( mark < str + len ) {
- if ( *mark == '\n' ) {
- end = mark;
- if ( *start != ' ' && *start != '\n' && *end != '\n' && *end != ' ' ) end += 1;
- syck_emitter_write( e, start, end - start );
- if ( mark + 1 == str + len ) {
- if ( keep_nl != NL_KEEP ) syck_emitter_write( e, "\n", 1 );
- } else {
- syck_emit_indent( e );
- }
- start = mark + 1;
- }
- mark++;
- }
- end = str + len;
- if ( start < end ) {
- syck_emitter_write( e, start, end - start );
- }
-}
-
-/*
- * Outputs a folded block.
- */
-void
-syck_emit_folded( SyckEmitter *e, int width, char keep_nl, const char *str, long len )
-{
- const char *mark = str;
- const char *start = str;
- const char *end = str;
- syck_emitter_write( e, ">", 1 );
- if ( keep_nl == NL_CHOMP ) {
- syck_emitter_write( e, "-", 1 );
- } else if ( keep_nl == NL_KEEP ) {
- syck_emitter_write( e, "+", 1 );
- }
- syck_emit_indent( e );
- if ( width <= 0 ) width = e->best_width;
- while ( mark < str + len ) {
- switch ( *mark ) {
- case '\n':
- syck_emitter_write( e, end, mark - end );
- end = mark + 1;
- if ( *start != ' ' && *start != '\n' && *end != '\n' && *end != ' ' ) {
- syck_emitter_write( e, "\n", 1 );
- }
- if ( mark + 1 == str + len ) {
- if ( keep_nl != NL_KEEP ) syck_emitter_write( e, "\n", 1 );
- } else {
- syck_emit_indent( e );
- }
- start = mark + 1;
- break;
-
- case ' ':
- if ( *start != ' ' ) {
- if ( mark - end > width ) {
- syck_emitter_write( e, end, mark - end );
- syck_emit_indent( e );
- end = mark + 1;
- }
- }
- break;
- }
- mark++;
- }
- if ( end < mark ) {
- syck_emitter_write( e, end, mark - end );
- }
-}
-
-/*
- * Begins emission of a sequence.
- */
-void syck_emit_seq( SyckEmitter *e, const char *tag, enum seq_style style )
-{
- SyckLevel *parent = syck_emitter_parent_level( e );
- SyckLevel *lvl = syck_emitter_current_level( e );
- syck_emit_tag( e, tag, "tag:yaml.org,2002:seq" );
- if ( style == seq_inline || ( parent->status == syck_lvl_imap || parent->status == syck_lvl_iseq ) ) {
- syck_emitter_write( e, "[", 1 );
- lvl->status = syck_lvl_iseq;
- } else {
- /* complex key */
- if ( parent->status == syck_lvl_map && parent->ncount % 2 == 1 ) {
- syck_emitter_write( e, "? ", 2 );
- parent->status = syck_lvl_mapx;
- }
- lvl->status = syck_lvl_seq;
- }
-}
-
-/*
- * Begins emission of a mapping.
- */
-void
-syck_emit_map( SyckEmitter *e, const char *tag, enum map_style style )
-{
- SyckLevel *parent = syck_emitter_parent_level( e );
- SyckLevel *lvl = syck_emitter_current_level( e );
- syck_emit_tag( e, tag, "tag:yaml.org,2002:map" );
- if ( style == map_inline || ( parent->status == syck_lvl_imap || parent->status == syck_lvl_iseq ) ) {
- syck_emitter_write( e, "{", 1 );
- lvl->status = syck_lvl_imap;
- } else {
- /* complex key */
- if ( parent->status == syck_lvl_map && parent->ncount % 2 == 1 ) {
- syck_emitter_write( e, "? ", 2 );
- parent->status = syck_lvl_mapx;
- }
- lvl->status = syck_lvl_map;
- }
-}
-
-/*
- * Handles emitting of a collection item (for both
- * sequences and maps)
- */
-void syck_emit_item( SyckEmitter *e, st_data_t n )
-{
- SyckLevel *lvl = syck_emitter_current_level( e );
- switch ( lvl->status )
- {
- case syck_lvl_seq:
- {
- SyckLevel *parent = syck_emitter_parent_level( e );
-
- /* seq-in-map shortcut -- the lvl->anctag check should be unneccesary but
- * there is a nasty shift/reduce in the parser on this point and
- * i'm not ready to tickle it. */
- if ( lvl->anctag == 0 && parent->status == syck_lvl_map && lvl->ncount == 0 ) {
- lvl->spaces = parent->spaces;
- }
-
- /* seq-in-seq shortcut */
- else if ( lvl->anctag == 0 && parent->status == syck_lvl_seq && lvl->ncount == 0 ) {
- int spcs = ( lvl->spaces - parent->spaces ) - 2;
- if ( spcs >= 0 ) {
- int i = 0;
- for ( i = 0; i < spcs; i++ ) {
- syck_emitter_write( e, " ", 1 );
- }
- syck_emitter_write( e, "- ", 2 );
- break;
- }
- }
-
- syck_emit_indent( e );
- syck_emitter_write( e, "- ", 2 );
- }
- break;
-
- case syck_lvl_iseq:
- {
- if ( lvl->ncount > 0 ) {
- syck_emitter_write( e, ", ", 2 );
- }
- }
- break;
-
- case syck_lvl_map:
- {
- SyckLevel *parent = syck_emitter_parent_level( e );
-
- /* map-in-seq shortcut */
- if ( lvl->anctag == 0 && parent->status == syck_lvl_seq && lvl->ncount == 0 ) {
- int spcs = ( lvl->spaces - parent->spaces ) - 2;
- if ( spcs >= 0 ) {
- int i = 0;
- for ( i = 0; i < spcs; i++ ) {
- syck_emitter_write( e, " ", 1 );
- }
- break;
- }
- }
-
- if ( lvl->ncount % 2 == 0 ) {
- syck_emit_indent( e );
- } else {
- syck_emitter_write( e, ": ", 2 );
- }
- }
- break;
-
- case syck_lvl_mapx:
- {
- if ( lvl->ncount % 2 == 0 ) {
- syck_emit_indent( e );
- lvl->status = syck_lvl_map;
- } else {
- int i;
- if ( lvl->spaces > 0 ) {
- char *spcs = S_ALLOC_N( char, lvl->spaces + 1 );
-
- spcs[lvl->spaces] = '\0';
- for ( i = 0; i < lvl->spaces; i++ ) spcs[i] = ' ';
- syck_emitter_write( e, spcs, lvl->spaces );
- S_FREE( spcs );
- }
- syck_emitter_write( e, ": ", 2 );
- }
- }
- break;
-
- case syck_lvl_imap:
- {
- if ( lvl->ncount > 0 ) {
- if ( lvl->ncount % 2 == 0 ) {
- syck_emitter_write( e, ", ", 2 );
- } else {
- syck_emitter_write( e, ": ", 2 );
- }
- }
- }
- break;
-
- default: break;
- }
- lvl->ncount++;
-
- syck_emit( e, n );
-}
-
-/*
- * Closes emission of a collection.
- */
-void syck_emit_end( SyckEmitter *e )
-{
- SyckLevel *lvl = syck_emitter_current_level( e );
- SyckLevel *parent = syck_emitter_parent_level( e );
- switch ( lvl->status )
- {
- case syck_lvl_seq:
- if ( lvl->ncount == 0 ) {
- syck_emitter_write( e, "[]\n", 3 );
- } else if ( parent->status == syck_lvl_mapx ) {
- syck_emitter_write( e, "\n", 1 );
- }
- break;
-
- case syck_lvl_iseq:
- syck_emitter_write( e, "]\n", 1 );
- break;
-
- case syck_lvl_map:
- if ( lvl->ncount == 0 ) {
- syck_emitter_write( e, "{}\n", 3 );
- } else if ( lvl->ncount % 2 == 1 ) {
- syck_emitter_write( e, ":\n", 1 );
- } else if ( parent->status == syck_lvl_mapx ) {
- syck_emitter_write( e, "\n", 1 );
- }
- break;
-
- case syck_lvl_imap:
- syck_emitter_write( e, "}\n", 1 );
- break;
-
- default: break;
- }
-}
-
-/*
- * Fill markers table with emitter nodes in the
- * soon-to-be-emitted tree.
- */
-SYMID
-syck_emitter_mark_node( SyckEmitter *e, st_data_t n )
-{
- SYMID oid = 0;
- char *anchor_name = NULL;
-
- /*
- * Ensure markers table is initialized.
- */
- if ( e->markers == NULL )
- {
- e->markers = st_init_numtable();
- }
-
- /*
- * Markers table initially marks the string position of the
- * object. Doesn't yet create an anchor, simply notes the
- * position.
- */
- if ( ! st_lookup( e->markers, n, (st_data_t *)&oid ) )
- {
- /*
- * Store all markers
- */
- oid = e->markers->num_entries + 1;
- st_insert( e->markers, n, (st_data_t)oid );
- }
- else
- {
- if ( e->anchors == NULL )
- {
- e->anchors = st_init_numtable();
- }
-
- if ( ! st_lookup( e->anchors, (st_data_t)oid, (void *)&anchor_name ) )
- {
- int idx = 0;
- const char *anc = ( e->anchor_format == NULL ? DEFAULT_ANCHOR_FORMAT : e->anchor_format );
-
- /*
- * Second time hitting this object, let's give it an anchor
- */
- idx = (int)(e->anchors->num_entries + 1);
- anchor_name = S_ALLOC_N( char, strlen( anc ) + 10 );
- S_MEMZERO( anchor_name, char, strlen( anc ) + 10 );
- sprintf( anchor_name, anc, idx );
-
- /*
- * Insert into anchors table
- */
- st_insert( e->anchors, (st_data_t)oid, (st_data_t)anchor_name );
- }
- }
- return oid;
-}
-
diff --git a/ext/syck/extconf.rb b/ext/syck/extconf.rb
deleted file mode 100644
index 6c10448c70..0000000000
--- a/ext/syck/extconf.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-require 'mkmf'
-
-have_header( "st.h" )
-create_makefile( "syck" )
-
diff --git a/ext/syck/gram.c b/ext/syck/gram.c
deleted file mode 100644
index 8fe4e4f3b5..0000000000
--- a/ext/syck/gram.c
+++ /dev/null
@@ -1,1894 +0,0 @@
-/* A Bison parser, made by GNU Bison 1.875d. */
-
-/* Skeleton parser for Yacc-like parsing with Bison,
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* As a special exception, when this file is copied by Bison into a
- Bison output file, you may use that output file without restriction.
- This special exception was added by the Free Software Foundation
- in version 1.24 of Bison. */
-
-/* Written by Richard Stallman by simplifying the original so called
- ``semantic'' parser. */
-
-/* All symbols defined below should begin with yy or YY, to avoid
- infringing on user name space. This should be done even for local
- variables, as they might otherwise be expanded by user macros.
- There are some unavoidable exceptions within include files to
- define necessary library symbols; they are noted "INFRINGES ON
- USER NAME SPACE" below. */
-
-/* Identify Bison output. */
-#define YYBISON 1
-
-/* Skeleton name. */
-#define YYSKELETON_NAME "yacc.c"
-
-/* Pure parsers. */
-#define YYPURE 1
-
-/* Using locations. */
-#define YYLSP_NEEDED 0
-
-/* If NAME_PREFIX is specified substitute the variables and functions
- names. */
-#define yyparse syckparse
-#define yylex sycklex
-#define yyerror syckerror
-#define yylval sycklval
-#define yychar syckchar
-#define yydebug syckdebug
-#define yynerrs sycknerrs
-
-
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- YAML_ANCHOR = 258,
- YAML_ALIAS = 259,
- YAML_TRANSFER = 260,
- YAML_TAGURI = 261,
- YAML_ITRANSFER = 262,
- YAML_WORD = 263,
- YAML_PLAIN = 264,
- YAML_BLOCK = 265,
- YAML_DOCSEP = 266,
- YAML_IOPEN = 267,
- YAML_INDENT = 268,
- YAML_IEND = 269
- };
-#endif
-#define YAML_ANCHOR 258
-#define YAML_ALIAS 259
-#define YAML_TRANSFER 260
-#define YAML_TAGURI 261
-#define YAML_ITRANSFER 262
-#define YAML_WORD 263
-#define YAML_PLAIN 264
-#define YAML_BLOCK 265
-#define YAML_DOCSEP 266
-#define YAML_IOPEN 267
-#define YAML_INDENT 268
-#define YAML_IEND 269
-
-
-
-
-/* Copy the first part of user declarations. */
-#line 14 "gram.y"
-
-
-#include "syck.h"
-
-void apply_seq_in_map( SyckParser *parser, SyckNode *n );
-
-#define YYPARSE_PARAM parser
-#define YYLEX_PARAM parser
-
-#define NULL_NODE(parser, node) \
- SyckNode *node = syck_new_str( "", scalar_plain ); \
- if ( ((SyckParser *)parser)->taguri_expansion == 1 ) \
- { \
- node->type_id = syck_taguri( YAML_DOMAIN, "null", 4 ); \
- } \
- else \
- { \
- node->type_id = syck_strndup( "null", 4 ); \
- }
-
-
-/* Enabling traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 1
-#endif
-
-/* Enabling verbose error messages. */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
-#endif
-
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 35 "gram.y"
-typedef union YYSTYPE {
- SYMID nodeId;
- SyckNode *nodeData;
- char *name;
-} YYSTYPE;
-/* Line 191 of yacc.c. */
-#line 140 "gram.c"
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
-
-
-
-/* Copy the second part of user declarations. */
-
-
-/* Line 214 of yacc.c. */
-#line 152 "gram.c"
-
-#if ! defined (yyoverflow) || YYERROR_VERBOSE
-
-# ifndef YYFREE
-# define YYFREE free
-# endif
-# ifndef YYMALLOC
-# define YYMALLOC malloc
-# endif
-
-/* The parser invokes alloca or malloc; define the necessary symbols. */
-
-# ifdef YYSTACK_USE_ALLOCA
-# if YYSTACK_USE_ALLOCA
-# define YYSTACK_ALLOC alloca
-# endif
-# else
-# if defined (alloca) || defined (_ALLOCA_H)
-# define YYSTACK_ALLOC alloca
-# else
-# ifdef __GNUC__
-# define YYSTACK_ALLOC __builtin_alloca
-# endif
-# endif
-# endif
-
-# ifdef YYSTACK_ALLOC
- /* Pacify GCC's `empty if-body' warning. */
-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
-# else
-# if defined (__STDC__) || defined (__cplusplus)
-# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
-# endif
-# define YYSTACK_ALLOC YYMALLOC
-# define YYSTACK_FREE YYFREE
-# endif
-#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
-
-
-#if (! defined (yyoverflow) \
- && (! defined (__cplusplus) \
- || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
-
-/* A type that is properly aligned for any stack member. */
-union yyalloc
-{
- short int yyss;
- YYSTYPE yyvs;
- };
-
-/* The size of the maximum gap between one aligned stack and the next. */
-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
-
-/* The size of an array large to enough to hold all stacks, each with
- N elements. */
-# define YYSTACK_BYTES(N) \
- ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
- + YYSTACK_GAP_MAXIMUM)
-
-/* Copy COUNT objects from FROM to TO. The source and destination do
- not overlap. */
-# ifndef YYCOPY
-# if defined (__GNUC__) && 1 < __GNUC__
-# define YYCOPY(To, From, Count) \
- __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-# else
-# define YYCOPY(To, From, Count) \
- do \
- { \
- register YYSIZE_T yyi; \
- for (yyi = 0; yyi < (Count); yyi++) \
- (To)[yyi] = (From)[yyi]; \
- } \
- while (0)
-# endif
-# endif
-
-/* Relocate STACK from its old location to the new one. The
- local variables YYSIZE and YYSTACKSIZE give the old and new number of
- elements in the stack, and YYPTR gives the new location of the
- stack. Advance YYPTR to a properly aligned location for the next
- stack. */
-# define YYSTACK_RELOCATE(Stack) \
- do \
- { \
- YYSIZE_T yynewbytes; \
- YYCOPY (&yyptr->Stack, Stack, yysize); \
- Stack = &yyptr->Stack; \
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
- yyptr += yynewbytes / sizeof (*yyptr); \
- } \
- while (0)
-
-#endif
-
-#if defined (__STDC__) || defined (__cplusplus)
- typedef signed char yysigned_char;
-#else
- typedef short int yysigned_char;
-#endif
-
-/* YYFINAL -- State number of the termination state. */
-#define YYFINAL 52
-/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 396
-
-/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 23
-/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 29
-/* YYNRULES -- Number of rules. */
-#define YYNRULES 79
-/* YYNRULES -- Number of states. */
-#define YYNSTATES 128
-
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
-#define YYUNDEFTOK 2
-#define YYMAXUTOK 269
-
-#define YYTRANSLATE(YYX) \
- ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
-static const unsigned char yytranslate[] =
-{
- 0, 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, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 21, 15, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 16, 2,
- 2, 2, 2, 22, 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, 17, 2, 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, 19, 2, 20, 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, 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,
- 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, 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, 2, 2, 1, 2, 3, 4,
- 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
-};
-
-#if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
- YYRHS. */
-static const unsigned char yyprhs[] =
-{
- 0, 0, 3, 5, 8, 9, 11, 13, 15, 18,
- 21, 24, 28, 30, 32, 36, 37, 40, 43, 46,
- 49, 51, 54, 56, 58, 60, 63, 66, 69, 72,
- 75, 77, 79, 81, 85, 87, 89, 91, 93, 95,
- 99, 103, 106, 110, 113, 117, 120, 124, 127, 129,
- 133, 136, 140, 143, 145, 149, 151, 153, 157, 161,
- 165, 168, 172, 175, 179, 182, 184, 188, 190, 194,
- 196, 200, 204, 207, 211, 215, 218, 220, 224, 226
-};
-
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const yysigned_char yyrhs[] =
-{
- 24, 0, -1, 25, -1, 11, 27, -1, -1, 33,
- -1, 26, -1, 34, -1, 5, 26, -1, 6, 26,
- -1, 3, 26, -1, 29, 26, 32, -1, 25, -1,
- 28, -1, 29, 28, 30, -1, -1, 7, 28, -1,
- 5, 28, -1, 6, 28, -1, 3, 28, -1, 12,
- -1, 29, 13, -1, 14, -1, 13, -1, 14, -1,
- 31, 32, -1, 5, 33, -1, 6, 33, -1, 7,
- 33, -1, 3, 33, -1, 4, -1, 8, -1, 9,
- -1, 29, 33, 32, -1, 10, -1, 35, -1, 39,
- -1, 42, -1, 49, -1, 29, 37, 30, -1, 29,
- 38, 30, -1, 15, 27, -1, 5, 31, 38, -1,
- 5, 37, -1, 6, 31, 38, -1, 6, 37, -1,
- 3, 31, 38, -1, 3, 37, -1, 36, -1, 38,
- 31, 36, -1, 38, 31, -1, 17, 40, 18, -1,
- 17, 18, -1, 41, -1, 40, 21, 41, -1, 25,
- -1, 48, -1, 29, 43, 30, -1, 29, 47, 30,
- -1, 5, 31, 47, -1, 5, 43, -1, 6, 31,
- 47, -1, 6, 43, -1, 3, 31, 47, -1, 3,
- 43, -1, 33, -1, 22, 25, 31, -1, 27, -1,
- 44, 16, 45, -1, 46, -1, 47, 31, 36, -1,
- 47, 31, 46, -1, 47, 31, -1, 25, 16, 27,
- -1, 19, 50, 20, -1, 19, 20, -1, 51, -1,
- 50, 21, 51, -1, 25, -1, 48, -1
-};
-
-/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
-static const unsigned short int yyrline[] =
-{
- 0, 56, 56, 60, 65, 70, 71, 74, 75, 80,
- 85, 94, 100, 101, 104, 109, 113, 121, 126, 131,
- 145, 146, 149, 152, 155, 156, 164, 169, 174, 182,
- 186, 194, 207, 208, 218, 219, 220, 221, 222, 228,
- 232, 238, 244, 249, 254, 259, 264, 268, 274, 278,
- 283, 292, 296, 302, 306, 313, 314, 320, 325, 332,
- 337, 342, 347, 352, 356, 362, 363, 369, 379, 396,
- 397, 409, 417, 426, 434, 438, 444, 445, 454, 461
-};
-#endif
-
-#if YYDEBUG || YYERROR_VERBOSE
-/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
- First, the terminals, then, starting at YYNTOKENS, nonterminals. */
-static const char *const yytname[] =
-{
- "$end", "error", "$undefined", "YAML_ANCHOR", "YAML_ALIAS",
- "YAML_TRANSFER", "YAML_TAGURI", "YAML_ITRANSFER", "YAML_WORD",
- "YAML_PLAIN", "YAML_BLOCK", "YAML_DOCSEP", "YAML_IOPEN", "YAML_INDENT",
- "YAML_IEND", "'-'", "':'", "'['", "']'", "'{'", "'}'", "','", "'?'",
- "$accept", "doc", "atom", "ind_rep", "atom_or_empty", "empty",
- "indent_open", "indent_end", "indent_sep", "indent_flex_end", "word_rep",
- "struct_rep", "implicit_seq", "basic_seq", "top_imp_seq",
- "in_implicit_seq", "inline_seq", "in_inline_seq", "inline_seq_atom",
- "implicit_map", "top_imp_map", "complex_key", "complex_value",
- "complex_mapping", "in_implicit_map", "basic_mapping", "inline_map",
- "in_inline_map", "inline_map_atom", 0
-};
-#endif
-
-# ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
- token YYLEX-NUM. */
-static const unsigned short int yytoknum[] =
-{
- 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
- 265, 266, 267, 268, 269, 45, 58, 91, 93, 123,
- 125, 44, 63
-};
-# endif
-
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const unsigned char yyr1[] =
-{
- 0, 23, 24, 24, 24, 25, 25, 26, 26, 26,
- 26, 26, 27, 27, 28, 28, 28, 28, 28, 28,
- 29, 29, 30, 31, 32, 32, 33, 33, 33, 33,
- 33, 33, 33, 33, 34, 34, 34, 34, 34, 35,
- 35, 36, 37, 37, 37, 37, 37, 37, 38, 38,
- 38, 39, 39, 40, 40, 41, 41, 42, 42, 43,
- 43, 43, 43, 43, 43, 44, 44, 45, 46, 47,
- 47, 47, 47, 48, 49, 49, 50, 50, 51, 51
-};
-
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
-static const unsigned char yyr2[] =
-{
- 0, 2, 1, 2, 0, 1, 1, 1, 2, 2,
- 2, 3, 1, 1, 3, 0, 2, 2, 2, 2,
- 1, 2, 1, 1, 1, 2, 2, 2, 2, 2,
- 1, 1, 1, 3, 1, 1, 1, 1, 1, 3,
- 3, 2, 3, 2, 3, 2, 3, 2, 1, 3,
- 2, 3, 2, 1, 3, 1, 1, 3, 3, 3,
- 2, 3, 2, 3, 2, 1, 3, 1, 3, 1,
- 3, 3, 2, 3, 3, 2, 1, 3, 1, 1
-};
-
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
- STATE-NUM when YYTABLE doesn't specify something else to do. Zero
- means the default is an error. */
-static const unsigned char yydefact[] =
-{
- 4, 0, 30, 0, 0, 0, 31, 32, 34, 15,
- 20, 0, 0, 0, 2, 6, 0, 5, 7, 35,
- 36, 37, 38, 10, 29, 8, 26, 9, 27, 0,
- 0, 0, 0, 28, 15, 15, 15, 15, 12, 3,
- 13, 15, 52, 55, 0, 53, 56, 75, 78, 79,
- 0, 76, 1, 0, 0, 0, 21, 15, 0, 0,
- 65, 48, 0, 0, 0, 0, 69, 0, 0, 19,
- 17, 18, 15, 15, 15, 16, 15, 15, 15, 15,
- 0, 15, 51, 0, 74, 0, 23, 0, 47, 64,
- 0, 43, 60, 0, 45, 62, 41, 0, 24, 0,
- 11, 33, 22, 39, 40, 50, 57, 15, 58, 72,
- 14, 73, 54, 77, 65, 46, 63, 42, 59, 44,
- 61, 66, 25, 49, 67, 68, 70, 71
-};
-
-/* YYDEFGOTO[NTERM-NUM]. */
-static const yysigned_char yydefgoto[] =
-{
- -1, 13, 38, 15, 39, 40, 16, 103, 99, 101,
- 17, 18, 19, 61, 62, 63, 20, 44, 45, 21,
- 64, 65, 125, 66, 67, 46, 22, 50, 51
-};
-
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
- STATE-NUM. */
-#define YYPACT_NINF -97
-static const short int yypact[] =
-{
- 250, 318, -97, 318, 318, 374, -97, -97, -97, 335,
- -97, 267, 232, 7, -97, -97, 192, -97, -97, -97,
- -97, -97, -97, -97, -97, -97, -97, -97, -97, 374,
- 374, 374, 352, -97, 335, 335, 335, 384, -97, -97,
- -97, 212, -97, 10, 0, -97, -97, -97, 10, -97,
- -4, -97, -97, 284, 284, 284, -97, 335, 318, 30,
- 30, -97, -2, 36, -2, 16, -97, 36, 30, -97,
- -97, -97, 384, 384, 384, -97, 363, 301, 301, 301,
- -2, 335, -97, 318, -97, 318, -97, 158, -97, -97,
- 158, -97, -97, 158, -97, -97, -97, 24, -97, 30,
- -97, -97, -97, -97, -97, 26, -97, 335, -97, 158,
- -97, -97, -97, -97, -97, 24, 24, 24, 24, 24,
- 24, -97, -97, -97, -97, -97, -97, -97
-};
-
-/* YYPGOTO[NTERM-NUM]. */
-static const yysigned_char yypgoto[] =
-{
- -97, -97, 8, 81, -56, 109, 33, -53, 74, -54,
- -1, -97, -97, -96, -31, -32, -97, -97, -44, -97,
- 77, -97, -97, -52, 9, -6, -97, -97, -29
-};
-
-/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
- positive, shift that token. If negative, reduce the rule which
- number is the opposite. If zero, do what YYDEFACT says.
- If YYTABLE_NINF, syntax error. */
-#define YYTABLE_NINF -1
-static const unsigned char yytable[] =
-{
- 24, 96, 26, 28, 33, 100, 49, 52, 14, 123,
- 104, 106, 102, 126, 108, 60, 84, 85, 82, 43,
- 48, 83, 88, 91, 94, 111, 81, 110, 24, 26,
- 28, 68, 107, 24, 26, 28, 33, 86, 32, 112,
- 60, 57, 41, 86, 98, 122, 88, 91, 94, 86,
- 102, 124, 24, 26, 28, 115, 113, 127, 117, 0,
- 0, 119, 32, 32, 32, 32, 97, 41, 41, 41,
- 76, 24, 26, 28, 41, 68, 24, 26, 28, 49,
- 0, 0, 23, 0, 25, 27, 114, 0, 0, 114,
- 41, 43, 114, 48, 0, 0, 116, 59, 0, 118,
- 0, 0, 120, 0, 0, 76, 76, 76, 114, 76,
- 41, 41, 41, 0, 41, 23, 25, 27, 0, 0,
- 32, 0, 59, 32, 0, 0, 32, 87, 90, 93,
- 89, 92, 95, 0, 23, 25, 27, 105, 0, 0,
- 41, 109, 32, 69, 70, 71, 75, 0, 0, 0,
- 80, 87, 90, 93, 89, 92, 95, 0, 23, 25,
- 27, 29, 2, 30, 31, 5, 6, 7, 0, 0,
- 10, 121, 0, 57, 0, 0, 0, 0, 0, 0,
- 58, 69, 70, 71, 0, 80, 69, 70, 71, 105,
- 109, 105, 109, 105, 109, 53, 2, 54, 55, 5,
- 6, 7, 8, 0, 10, 56, 0, 57, 0, 11,
- 0, 12, 0, 0, 58, 77, 2, 78, 79, 37,
- 6, 7, 8, 0, 10, 56, 0, 57, 0, 11,
- 0, 12, 0, 0, 58, 1, 2, 3, 4, 5,
- 6, 7, 8, 0, 10, 0, 0, 0, 0, 11,
- 0, 12, 47, 1, 2, 3, 4, 5, 6, 7,
- 8, 9, 10, 0, 0, 0, 0, 11, 0, 12,
- 1, 2, 3, 4, 5, 6, 7, 8, 0, 10,
- 0, 0, 0, 0, 11, 42, 12, 53, 2, 54,
- 55, 5, 6, 7, 8, 0, 10, 86, 0, 0,
- 0, 11, 0, 12, 77, 2, 78, 79, 37, 6,
- 7, 8, 0, 10, 86, 0, 0, 0, 11, 0,
- 12, 1, 2, 3, 4, 5, 6, 7, 8, 0,
- 10, 0, 0, 0, 0, 11, 0, 12, 34, 2,
- 35, 36, 37, 6, 7, 8, 0, 10, 0, 0,
- 0, 0, 11, 0, 12, 29, 2, 30, 31, 5,
- 6, 7, 0, 0, 10, 56, 72, 2, 73, 74,
- 37, 6, 7, 0, 0, 10, 56, 29, 2, 30,
- 31, 5, 6, 7, 0, 0, 10, 72, 2, 73,
- 74, 37, 6, 7, 0, 0, 10
-};
-
-static const yysigned_char yycheck[] =
-{
- 1, 57, 3, 4, 5, 59, 12, 0, 0, 105,
- 63, 64, 14, 109, 67, 16, 20, 21, 18, 11,
- 12, 21, 53, 54, 55, 81, 16, 80, 29, 30,
- 31, 32, 16, 34, 35, 36, 37, 13, 5, 83,
- 41, 15, 9, 13, 14, 99, 77, 78, 79, 13,
- 14, 107, 53, 54, 55, 87, 85, 109, 90, -1,
- -1, 93, 29, 30, 31, 32, 58, 34, 35, 36,
- 37, 72, 73, 74, 41, 76, 77, 78, 79, 85,
- -1, -1, 1, -1, 3, 4, 87, -1, -1, 90,
- 57, 83, 93, 85, -1, -1, 87, 16, -1, 90,
- -1, -1, 93, -1, -1, 72, 73, 74, 109, 76,
- 77, 78, 79, -1, 81, 34, 35, 36, -1, -1,
- 87, -1, 41, 90, -1, -1, 93, 53, 54, 55,
- 53, 54, 55, -1, 53, 54, 55, 63, -1, -1,
- 107, 67, 109, 34, 35, 36, 37, -1, -1, -1,
- 41, 77, 78, 79, 77, 78, 79, -1, 77, 78,
- 79, 3, 4, 5, 6, 7, 8, 9, -1, -1,
- 12, 97, -1, 15, -1, -1, -1, -1, -1, -1,
- 22, 72, 73, 74, -1, 76, 77, 78, 79, 115,
- 116, 117, 118, 119, 120, 3, 4, 5, 6, 7,
- 8, 9, 10, -1, 12, 13, -1, 15, -1, 17,
- -1, 19, -1, -1, 22, 3, 4, 5, 6, 7,
- 8, 9, 10, -1, 12, 13, -1, 15, -1, 17,
- -1, 19, -1, -1, 22, 3, 4, 5, 6, 7,
- 8, 9, 10, -1, 12, -1, -1, -1, -1, 17,
- -1, 19, 20, 3, 4, 5, 6, 7, 8, 9,
- 10, 11, 12, -1, -1, -1, -1, 17, -1, 19,
- 3, 4, 5, 6, 7, 8, 9, 10, -1, 12,
- -1, -1, -1, -1, 17, 18, 19, 3, 4, 5,
- 6, 7, 8, 9, 10, -1, 12, 13, -1, -1,
- -1, 17, -1, 19, 3, 4, 5, 6, 7, 8,
- 9, 10, -1, 12, 13, -1, -1, -1, 17, -1,
- 19, 3, 4, 5, 6, 7, 8, 9, 10, -1,
- 12, -1, -1, -1, -1, 17, -1, 19, 3, 4,
- 5, 6, 7, 8, 9, 10, -1, 12, -1, -1,
- -1, -1, 17, -1, 19, 3, 4, 5, 6, 7,
- 8, 9, -1, -1, 12, 13, 3, 4, 5, 6,
- 7, 8, 9, -1, -1, 12, 13, 3, 4, 5,
- 6, 7, 8, 9, -1, -1, 12, 3, 4, 5,
- 6, 7, 8, 9, -1, -1, 12
-};
-
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
- symbol of state STATE-NUM. */
-static const unsigned char yystos[] =
-{
- 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
- 12, 17, 19, 24, 25, 26, 29, 33, 34, 35,
- 39, 42, 49, 26, 33, 26, 33, 26, 33, 3,
- 5, 6, 29, 33, 3, 5, 6, 7, 25, 27,
- 28, 29, 18, 25, 40, 41, 48, 20, 25, 48,
- 50, 51, 0, 3, 5, 6, 13, 15, 22, 26,
- 33, 36, 37, 38, 43, 44, 46, 47, 33, 28,
- 28, 28, 3, 5, 6, 28, 29, 3, 5, 6,
- 28, 16, 18, 21, 20, 21, 13, 31, 37, 43,
- 31, 37, 43, 31, 37, 43, 27, 25, 14, 31,
- 32, 32, 14, 30, 30, 31, 30, 16, 30, 31,
- 30, 27, 41, 51, 33, 38, 47, 38, 47, 38,
- 47, 31, 32, 36, 27, 45, 36, 46
-};
-
-#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
-# define YYSIZE_T __SIZE_TYPE__
-#endif
-#if ! defined (YYSIZE_T) && defined (size_t)
-# define YYSIZE_T size_t
-#endif
-#if ! defined (YYSIZE_T)
-# if defined (__STDC__) || defined (__cplusplus)
-# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
-# endif
-#endif
-#if ! defined (YYSIZE_T)
-# define YYSIZE_T unsigned int
-#endif
-
-#define yyerrok (yyerrstatus = 0)
-#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY (-2)
-#define YYEOF 0
-
-#define YYACCEPT goto yyacceptlab
-#define YYABORT goto yyabortlab
-#define YYERROR goto yyerrorlab
-
-
-/* Like YYERROR except do call yyerror. This remains here temporarily
- to ease the transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. */
-
-#define YYFAIL goto yyerrlab
-
-#define YYRECOVERING() (!!yyerrstatus)
-
-#define YYBACKUP(Token, Value) \
-do \
- if (yychar == YYEMPTY && yylen == 1) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- yytoken = YYTRANSLATE (yychar); \
- YYPOPSTACK; \
- goto yybackup; \
- } \
- else \
- { \
- yyerror ("syntax error: cannot back up");\
- YYERROR; \
- } \
-while (0)
-
-#define YYTERROR 1
-#define YYERRCODE 256
-
-/* YYLLOC_DEFAULT -- Compute the default location (before the actions
- are run). */
-
-#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- ((Current).first_line = (Rhs)[1].first_line, \
- (Current).first_column = (Rhs)[1].first_column, \
- (Current).last_line = (Rhs)[N].last_line, \
- (Current).last_column = (Rhs)[N].last_column)
-#endif
-
-/* YYLEX -- calling `yylex' with the right arguments. */
-
-#ifdef YYLEX_PARAM
-# define YYLEX yylex (&yylval, YYLEX_PARAM)
-#else
-# define YYLEX yylex (&yylval)
-#endif
-
-/* Enable debugging if requested. */
-#if YYDEBUG
-
-# ifndef YYFPRINTF
-# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
-# define YYFPRINTF fprintf
-# endif
-
-# define YYDPRINTF(Args) \
-do { \
- if (yydebug) \
- YYFPRINTF Args; \
-} while (0)
-
-# define YYDSYMPRINT(Args) \
-do { \
- if (yydebug) \
- yysymprint Args; \
-} while (0)
-
-# define YYDSYMPRINTF(Title, Token, Value, Location) \
-do { \
- if (yydebug) \
- { \
- YYFPRINTF (stderr, "%s ", Title); \
- yysymprint (stderr, \
- Token, Value); \
- YYFPRINTF (stderr, "\n"); \
- } \
-} while (0)
-
-/*------------------------------------------------------------------.
-| yy_stack_print -- Print the state stack from its BOTTOM up to its |
-| TOP (included). |
-`------------------------------------------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yy_stack_print (short int *bottom, short int *top)
-#else
-static void
-yy_stack_print (bottom, top)
- short int *bottom;
- short int *top;
-#endif
-{
- YYFPRINTF (stderr, "Stack now");
- for (/* Nothing. */; bottom <= top; ++bottom)
- YYFPRINTF (stderr, " %d", *bottom);
- YYFPRINTF (stderr, "\n");
-}
-
-# define YY_STACK_PRINT(Bottom, Top) \
-do { \
- if (yydebug) \
- yy_stack_print ((Bottom), (Top)); \
-} while (0)
-
-
-/*------------------------------------------------.
-| Report that the YYRULE is going to be reduced. |
-`------------------------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yy_reduce_print (int yyrule)
-#else
-static void
-yy_reduce_print (yyrule)
- int yyrule;
-#endif
-{
- int yyi;
- unsigned int yylno = yyrline[yyrule];
- YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
- yyrule - 1, yylno);
- /* Print the symbols being reduced, and their result. */
- for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
- YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
- YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
-}
-
-# define YY_REDUCE_PRINT(Rule) \
-do { \
- if (yydebug) \
- yy_reduce_print (Rule); \
-} while (0)
-
-/* Nonzero means print parse trace. It is left uninitialized so that
- multiple parsers can coexist. */
-int yydebug;
-#else /* !YYDEBUG */
-# define YYDPRINTF(Args)
-# define YYDSYMPRINT(Args)
-# define YYDSYMPRINTF(Title, Token, Value, Location)
-# define YY_STACK_PRINT(Bottom, Top)
-# define YY_REDUCE_PRINT(Rule)
-#endif /* !YYDEBUG */
-
-
-/* YYINITDEPTH -- initial size of the parser's stacks. */
-#ifndef YYINITDEPTH
-# define YYINITDEPTH 200
-#endif
-
-/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
- if the built-in stack extension method is used).
-
- Do not make this value too large; the results are undefined if
- SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
- evaluated with infinite-precision integer arithmetic. */
-
-#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
-# undef YYMAXDEPTH
-#endif
-
-#ifndef YYMAXDEPTH
-# define YYMAXDEPTH 10000
-#endif
-
-
-
-#if YYERROR_VERBOSE
-
-# ifndef yystrlen
-# if defined (__GLIBC__) && defined (_STRING_H)
-# define yystrlen strlen
-# else
-/* Return the length of YYSTR. */
-static YYSIZE_T
-# if defined (__STDC__) || defined (__cplusplus)
-yystrlen (const char *yystr)
-# else
-yystrlen (yystr)
- const char *yystr;
-# endif
-{
- register const char *yys = yystr;
-
- while (*yys++ != '\0')
- continue;
-
- return yys - yystr - 1;
-}
-# endif
-# endif
-
-# ifndef yystpcpy
-# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
-# define yystpcpy stpcpy
-# else
-/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
- YYDEST. */
-static char *
-# if defined (__STDC__) || defined (__cplusplus)
-yystpcpy (char *yydest, const char *yysrc)
-# else
-yystpcpy (yydest, yysrc)
- char *yydest;
- const char *yysrc;
-# endif
-{
- register char *yyd = yydest;
- register const char *yys = yysrc;
-
- while ((*yyd++ = *yys++) != '\0')
- continue;
-
- return yyd - 1;
-}
-# endif
-# endif
-
-#endif /* !YYERROR_VERBOSE */
-
-
-
-#if YYDEBUG
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yysymprint (yyoutput, yytype, yyvaluep)
- FILE *yyoutput;
- int yytype;
- YYSTYPE *yyvaluep;
-#endif
-{
- /* Pacify ``unused variable'' warnings. */
- (void) yyvaluep;
-
- if (yytype < YYNTOKENS)
- {
- YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
-# ifdef YYPRINT
- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# endif
- }
- else
- YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
-
- switch (yytype)
- {
- default:
- break;
- }
- YYFPRINTF (yyoutput, ")");
-}
-
-#endif /* ! YYDEBUG */
-/*-----------------------------------------------.
-| Release the memory associated to this symbol. |
-`-----------------------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yydestruct (int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yydestruct (yytype, yyvaluep)
- int yytype;
- YYSTYPE *yyvaluep;
-#endif
-{
- /* Pacify ``unused variable'' warnings. */
- (void) yyvaluep;
-
- switch (yytype)
- {
-
- default:
- break;
- }
-}
-
-
-/* Prevent warnings from -Wmissing-prototypes. */
-
-#ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void *YYPARSE_PARAM);
-# else
-int yyparse ();
-# endif
-#else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
-
-
-
-
-
-
-/*----------.
-| yyparse. |
-`----------*/
-
-#ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void *YYPARSE_PARAM)
-# else
-int yyparse (YYPARSE_PARAM)
- void *YYPARSE_PARAM;
-# endif
-#else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
-int
-yyparse (void)
-#else
-int
-yyparse ()
-
-#endif
-#endif
-{
- /* The lookahead symbol. */
-int yychar;
-
-/* The semantic value of the lookahead symbol. */
-YYSTYPE yylval;
-
-/* Number of syntax errors so far. */
-int yynerrs;
-
- register int yystate;
- register int yyn;
- int yyresult;
- /* Number of tokens to shift before error messages enabled. */
- int yyerrstatus;
- /* Lookahead token as an internal (translated) token number. */
- int yytoken = 0;
-
- /* Three stacks and their tools:
- `yyss': related to states,
- `yyvs': related to semantic values,
- `yyls': related to locations.
-
- Refer to the stacks thru separate pointers, to allow yyoverflow
- to reallocate them elsewhere. */
-
- /* The state stack. */
- short int yyssa[YYINITDEPTH];
- short int *yyss = yyssa;
- register short int *yyssp;
-
- /* The semantic value stack. */
- YYSTYPE yyvsa[YYINITDEPTH];
- YYSTYPE *yyvs = yyvsa;
- register YYSTYPE *yyvsp;
-
-
-
-#define YYPOPSTACK (yyvsp--, yyssp--)
-
- YYSIZE_T yystacksize = YYINITDEPTH;
-
- /* The variables used to return semantic value and location from the
- action routines. */
- YYSTYPE yyval;
-
-
- /* When reducing, the number of symbols on the RHS of the reduced
- rule. */
- int yylen;
-
- YYDPRINTF ((stderr, "Starting parse\n"));
-
- yystate = 0;
- yyerrstatus = 0;
- yynerrs = 0;
- yychar = YYEMPTY; /* Cause a token to be read. */
-
- /* Initialize stack pointers.
- Waste one element of value and location stack
- so that they stay on the same level as the state stack.
- The wasted elements are never initialized. */
-
- yyssp = yyss;
- yyvsp = yyvs;
-
-
- goto yysetstate;
-
-/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate. |
-`------------------------------------------------------------*/
- yynewstate:
- /* In all cases, when you get here, the value and location stacks
- have just been pushed. so pushing a state here evens the stacks.
- */
- yyssp++;
-
- yysetstate:
- *yyssp = yystate;
-
- if (yyss + yystacksize - 1 <= yyssp)
- {
- /* Get the current used size of the three stacks, in elements. */
- YYSIZE_T yysize = yyssp - yyss + 1;
-
-#ifdef yyoverflow
- {
- /* Give user a chance to reallocate the stack. Use copies of
- these so that the &'s don't force the real ones into
- memory. */
- YYSTYPE *yyvs1 = yyvs;
- short int *yyss1 = yyss;
-
-
- /* Each stack pointer address is followed by the size of the
- data in use in that stack, in bytes. This used to be a
- conditional around just the two extra args, but that might
- be undefined if yyoverflow is a macro. */
- yyoverflow ("parser stack overflow",
- &yyss1, yysize * sizeof (*yyssp),
- &yyvs1, yysize * sizeof (*yyvsp),
-
- &yystacksize);
-
- yyss = yyss1;
- yyvs = yyvs1;
- }
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
- goto yyoverflowlab;
-# else
- /* Extend the stack our own way. */
- if (YYMAXDEPTH <= yystacksize)
- goto yyoverflowlab;
- yystacksize *= 2;
- if (YYMAXDEPTH < yystacksize)
- yystacksize = YYMAXDEPTH;
-
- {
- short int *yyss1 = yyss;
- union yyalloc *yyptr =
- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
- if (! yyptr)
- goto yyoverflowlab;
- YYSTACK_RELOCATE (yyss);
- YYSTACK_RELOCATE (yyvs);
-
-# undef YYSTACK_RELOCATE
- if (yyss1 != yyssa)
- YYSTACK_FREE (yyss1);
- }
-# endif
-#endif /* no yyoverflow */
-
- yyssp = yyss + yysize - 1;
- yyvsp = yyvs + yysize - 1;
-
-
- YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long int) yystacksize));
-
- if (yyss + yystacksize - 1 <= yyssp)
- YYABORT;
- }
-
- YYDPRINTF ((stderr, "Entering state %d\n", yystate));
-
- goto yybackup;
-
-/*-----------.
-| yybackup. |
-`-----------*/
-yybackup:
-
-/* Do appropriate processing given the current state. */
-/* Read a lookahead token if we need one and don't already have one. */
-/* yyresume: */
-
- /* First try to decide what to do without reference to lookahead token. */
-
- yyn = yypact[yystate];
- if (yyn == YYPACT_NINF)
- goto yydefault;
-
- /* Not known => get a lookahead token if don't already have one. */
-
- /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
- if (yychar == YYEMPTY)
- {
- YYDPRINTF ((stderr, "Reading a token: "));
- yychar = YYLEX;
- }
-
- if (yychar <= YYEOF)
- {
- yychar = yytoken = YYEOF;
- YYDPRINTF ((stderr, "Now at end of input.\n"));
- }
- else
- {
- yytoken = YYTRANSLATE (yychar);
- YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
- }
-
- /* If the proper action on seeing token YYTOKEN is to reduce or to
- detect an error, take that action. */
- yyn += yytoken;
- if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
- goto yydefault;
- yyn = yytable[yyn];
- if (yyn <= 0)
- {
- if (yyn == 0 || yyn == YYTABLE_NINF)
- goto yyerrlab;
- yyn = -yyn;
- goto yyreduce;
- }
-
- if (yyn == YYFINAL)
- YYACCEPT;
-
- /* Shift the lookahead token. */
- YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
-
- /* Discard the token being shifted unless it is eof. */
- if (yychar != YYEOF)
- yychar = YYEMPTY;
-
- *++yyvsp = yylval;
-
-
- /* Count tokens shifted since error; after three, turn off error
- status. */
- if (yyerrstatus)
- yyerrstatus--;
-
- yystate = yyn;
- goto yynewstate;
-
-
-/*-----------------------------------------------------------.
-| yydefault -- do the default action for the current state. |
-`-----------------------------------------------------------*/
-yydefault:
- yyn = yydefact[yystate];
- if (yyn == 0)
- goto yyerrlab;
- goto yyreduce;
-
-
-/*-----------------------------.
-| yyreduce -- Do a reduction. |
-`-----------------------------*/
-yyreduce:
- /* yyn is the number of a rule to reduce with. */
- yylen = yyr2[yyn];
-
- /* If YYLEN is nonzero, implement the default value of the action:
- `$$ = $1'.
-
- Otherwise, the following line sets YYVAL to garbage.
- This behavior is undocumented and Bison
- users should not rely upon it. Assigning to YYVAL
- unconditionally makes the parser a bit smaller, and it avoids a
- GCC warning that YYVAL may be used uninitialized. */
- yyval = yyvsp[1-yylen];
-
-
- YY_REDUCE_PRINT (yyn);
- switch (yyn)
- {
- case 2:
-#line 57 "gram.y"
- {
- ((SyckParser *)parser)->root = syck_hdlr_add_node( (SyckParser *)parser, yyvsp[0].nodeData );
- }
- break;
-
- case 3:
-#line 61 "gram.y"
- {
- ((SyckParser *)parser)->root = syck_hdlr_add_node( (SyckParser *)parser, yyvsp[0].nodeData );
- }
- break;
-
- case 4:
-#line 65 "gram.y"
- {
- ((SyckParser *)parser)->eof = 1;
- }
- break;
-
- case 8:
-#line 76 "gram.y"
- {
- syck_add_transfer( yyvsp[-1].name, yyvsp[0].nodeData, ((SyckParser *)parser)->taguri_expansion );
- yyval.nodeData = yyvsp[0].nodeData;
- }
- break;
-
- case 9:
-#line 81 "gram.y"
- {
- syck_add_transfer( yyvsp[-1].name, yyvsp[0].nodeData, 0 );
- yyval.nodeData = yyvsp[0].nodeData;
- }
- break;
-
- case 10:
-#line 86 "gram.y"
- {
- /*
- * _Anchors_: The language binding must keep a separate symbol table
- * for anchors. The actual ID in the symbol table is returned to the
- * higher nodes, though.
- */
- yyval.nodeData = syck_hdlr_add_anchor( (SyckParser *)parser, yyvsp[-1].name, yyvsp[0].nodeData );
- }
- break;
-
- case 11:
-#line 95 "gram.y"
- {
- yyval.nodeData = yyvsp[-1].nodeData;
- }
- break;
-
- case 14:
-#line 105 "gram.y"
- {
- yyval.nodeData = yyvsp[-1].nodeData;
- }
- break;
-
- case 15:
-#line 109 "gram.y"
- {
- NULL_NODE( parser, n );
- yyval.nodeData = n;
- }
- break;
-
- case 16:
-#line 114 "gram.y"
- {
- if ( ((SyckParser *)parser)->implicit_typing == 1 )
- {
- try_tag_implicit( yyvsp[0].nodeData, ((SyckParser *)parser)->taguri_expansion );
- }
- yyval.nodeData = yyvsp[0].nodeData;
- }
- break;
-
- case 17:
-#line 122 "gram.y"
- {
- syck_add_transfer( yyvsp[-1].name, yyvsp[0].nodeData, ((SyckParser *)parser)->taguri_expansion );
- yyval.nodeData = yyvsp[0].nodeData;
- }
- break;
-
- case 18:
-#line 127 "gram.y"
- {
- syck_add_transfer( yyvsp[-1].name, yyvsp[0].nodeData, 0 );
- yyval.nodeData = yyvsp[0].nodeData;
- }
- break;
-
- case 19:
-#line 132 "gram.y"
- {
- /*
- * _Anchors_: The language binding must keep a separate symbol table
- * for anchors. The actual ID in the symbol table is returned to the
- * higher nodes, though.
- */
- yyval.nodeData = syck_hdlr_add_anchor( (SyckParser *)parser, yyvsp[-1].name, yyvsp[0].nodeData );
- }
- break;
-
- case 26:
-#line 165 "gram.y"
- {
- syck_add_transfer( yyvsp[-1].name, yyvsp[0].nodeData, ((SyckParser *)parser)->taguri_expansion );
- yyval.nodeData = yyvsp[0].nodeData;
- }
- break;
-
- case 27:
-#line 170 "gram.y"
- {
- syck_add_transfer( yyvsp[-1].name, yyvsp[0].nodeData, 0 );
- yyval.nodeData = yyvsp[0].nodeData;
- }
- break;
-
- case 28:
-#line 175 "gram.y"
- {
- if ( ((SyckParser *)parser)->implicit_typing == 1 )
- {
- try_tag_implicit( yyvsp[0].nodeData, ((SyckParser *)parser)->taguri_expansion );
- }
- yyval.nodeData = yyvsp[0].nodeData;
- }
- break;
-
- case 29:
-#line 183 "gram.y"
- {
- yyval.nodeData = syck_hdlr_add_anchor( (SyckParser *)parser, yyvsp[-1].name, yyvsp[0].nodeData );
- }
- break;
-
- case 30:
-#line 187 "gram.y"
- {
- /*
- * _Aliases_: The anchor symbol table is scanned for the anchor name.
- * The anchor's ID in the language's symbol table is returned.
- */
- yyval.nodeData = syck_hdlr_get_anchor( (SyckParser *)parser, yyvsp[0].name );
- }
- break;
-
- case 31:
-#line 195 "gram.y"
- {
- SyckNode *n = yyvsp[0].nodeData;
- if ( ((SyckParser *)parser)->taguri_expansion == 1 )
- {
- n->type_id = syck_taguri( YAML_DOMAIN, "str", 3 );
- }
- else
- {
- n->type_id = syck_strndup( "str", 3 );
- }
- yyval.nodeData = n;
- }
- break;
-
- case 33:
-#line 209 "gram.y"
- {
- yyval.nodeData = yyvsp[-1].nodeData;
- }
- break;
-
- case 39:
-#line 229 "gram.y"
- {
- yyval.nodeData = yyvsp[-1].nodeData;
- }
- break;
-
- case 40:
-#line 233 "gram.y"
- {
- yyval.nodeData = yyvsp[-1].nodeData;
- }
- break;
-
- case 41:
-#line 239 "gram.y"
- {
- yyval.nodeId = syck_hdlr_add_node( (SyckParser *)parser, yyvsp[0].nodeData );
- }
- break;
-
- case 42:
-#line 245 "gram.y"
- {
- syck_add_transfer( yyvsp[-2].name, yyvsp[0].nodeData, ((SyckParser *)parser)->taguri_expansion );
- yyval.nodeData = yyvsp[0].nodeData;
- }
- break;
-
- case 43:
-#line 250 "gram.y"
- {
- syck_add_transfer( yyvsp[-1].name, yyvsp[0].nodeData, ((SyckParser *)parser)->taguri_expansion );
- yyval.nodeData = yyvsp[0].nodeData;
- }
- break;
-
- case 44:
-#line 255 "gram.y"
- {
- syck_add_transfer( yyvsp[-2].name, yyvsp[0].nodeData, 0 );
- yyval.nodeData = yyvsp[0].nodeData;
- }
- break;
-
- case 45:
-#line 260 "gram.y"
- {
- syck_add_transfer( yyvsp[-1].name, yyvsp[0].nodeData, 0 );
- yyval.nodeData = yyvsp[0].nodeData;
- }
- break;
-
- case 46:
-#line 265 "gram.y"
- {
- yyval.nodeData = syck_hdlr_add_anchor( (SyckParser *)parser, yyvsp[-2].name, yyvsp[0].nodeData );
- }
- break;
-
- case 47:
-#line 269 "gram.y"
- {
- yyval.nodeData = syck_hdlr_add_anchor( (SyckParser *)parser, yyvsp[-1].name, yyvsp[0].nodeData );
- }
- break;
-
- case 48:
-#line 275 "gram.y"
- {
- yyval.nodeData = syck_new_seq( yyvsp[0].nodeId );
- }
- break;
-
- case 49:
-#line 279 "gram.y"
- {
- syck_seq_add( yyvsp[-2].nodeData, yyvsp[0].nodeId );
- yyval.nodeData = yyvsp[-2].nodeData;
- }
- break;
-
- case 50:
-#line 284 "gram.y"
- {
- yyval.nodeData = yyvsp[-1].nodeData;
- }
- break;
-
- case 51:
-#line 293 "gram.y"
- {
- yyval.nodeData = yyvsp[-1].nodeData;
- }
- break;
-
- case 52:
-#line 297 "gram.y"
- {
- yyval.nodeData = syck_alloc_seq();
- }
- break;
-
- case 53:
-#line 303 "gram.y"
- {
- yyval.nodeData = syck_new_seq( syck_hdlr_add_node( (SyckParser *)parser, yyvsp[0].nodeData ) );
- }
- break;
-
- case 54:
-#line 307 "gram.y"
- {
- syck_seq_add( yyvsp[-2].nodeData, syck_hdlr_add_node( (SyckParser *)parser, yyvsp[0].nodeData ) );
- yyval.nodeData = yyvsp[-2].nodeData;
- }
- break;
-
- case 57:
-#line 321 "gram.y"
- {
- apply_seq_in_map( (SyckParser *)parser, yyvsp[-1].nodeData );
- yyval.nodeData = yyvsp[-1].nodeData;
- }
- break;
-
- case 58:
-#line 326 "gram.y"
- {
- apply_seq_in_map( (SyckParser *)parser, yyvsp[-1].nodeData );
- yyval.nodeData = yyvsp[-1].nodeData;
- }
- break;
-
- case 59:
-#line 333 "gram.y"
- {
- syck_add_transfer( yyvsp[-2].name, yyvsp[0].nodeData, ((SyckParser *)parser)->taguri_expansion );
- yyval.nodeData = yyvsp[0].nodeData;
- }
- break;
-
- case 60:
-#line 338 "gram.y"
- {
- syck_add_transfer( yyvsp[-1].name, yyvsp[0].nodeData, ((SyckParser *)parser)->taguri_expansion );
- yyval.nodeData = yyvsp[0].nodeData;
- }
- break;
-
- case 61:
-#line 343 "gram.y"
- {
- syck_add_transfer( yyvsp[-2].name, yyvsp[0].nodeData, 0 );
- yyval.nodeData = yyvsp[0].nodeData;
- }
- break;
-
- case 62:
-#line 348 "gram.y"
- {
- syck_add_transfer( yyvsp[-1].name, yyvsp[0].nodeData, 0 );
- yyval.nodeData = yyvsp[0].nodeData;
- }
- break;
-
- case 63:
-#line 353 "gram.y"
- {
- yyval.nodeData = syck_hdlr_add_anchor( (SyckParser *)parser, yyvsp[-2].name, yyvsp[0].nodeData );
- }
- break;
-
- case 64:
-#line 357 "gram.y"
- {
- yyval.nodeData = syck_hdlr_add_anchor( (SyckParser *)parser, yyvsp[-1].name, yyvsp[0].nodeData );
- }
- break;
-
- case 66:
-#line 364 "gram.y"
- {
- yyval.nodeData = yyvsp[-1].nodeData;
- }
- break;
-
- case 68:
-#line 380 "gram.y"
- {
- yyval.nodeData = syck_new_map(
- syck_hdlr_add_node( (SyckParser *)parser, yyvsp[-2].nodeData ),
- syck_hdlr_add_node( (SyckParser *)parser, yyvsp[0].nodeData ) );
- }
- break;
-
- case 70:
-#line 398 "gram.y"
- {
- if ( yyvsp[-2].nodeData->shortcut == NULL )
- {
- yyvsp[-2].nodeData->shortcut = syck_new_seq( yyvsp[0].nodeId );
- }
- else
- {
- syck_seq_add( yyvsp[-2].nodeData->shortcut, yyvsp[0].nodeId );
- }
- yyval.nodeData = yyvsp[-2].nodeData;
- }
- break;
-
- case 71:
-#line 410 "gram.y"
- {
- apply_seq_in_map( (SyckParser *)parser, yyvsp[-2].nodeData );
- syck_map_update( yyvsp[-2].nodeData, yyvsp[0].nodeData );
- syck_free_node( yyvsp[0].nodeData );
- yyvsp[0].nodeData = NULL;
- yyval.nodeData = yyvsp[-2].nodeData;
- }
- break;
-
- case 72:
-#line 418 "gram.y"
- {
- yyval.nodeData = yyvsp[-1].nodeData;
- }
- break;
-
- case 73:
-#line 427 "gram.y"
- {
- yyval.nodeData = syck_new_map(
- syck_hdlr_add_node( (SyckParser *)parser, yyvsp[-2].nodeData ),
- syck_hdlr_add_node( (SyckParser *)parser, yyvsp[0].nodeData ) );
- }
- break;
-
- case 74:
-#line 435 "gram.y"
- {
- yyval.nodeData = yyvsp[-1].nodeData;
- }
- break;
-
- case 75:
-#line 439 "gram.y"
- {
- yyval.nodeData = syck_alloc_map();
- }
- break;
-
- case 77:
-#line 446 "gram.y"
- {
- syck_map_update( yyvsp[-2].nodeData, yyvsp[0].nodeData );
- syck_free_node( yyvsp[0].nodeData );
- yyvsp[0].nodeData = NULL;
- yyval.nodeData = yyvsp[-2].nodeData;
- }
- break;
-
- case 78:
-#line 455 "gram.y"
- {
- NULL_NODE( parser, n );
- yyval.nodeData = syck_new_map(
- syck_hdlr_add_node( (SyckParser *)parser, yyvsp[0].nodeData ),
- syck_hdlr_add_node( (SyckParser *)parser, n ) );
- }
- break;
-
-
- }
-
-/* Line 1010 of yacc.c. */
-#line 1651 "gram.c"
-
- yyvsp -= yylen;
- yyssp -= yylen;
-
-
- YY_STACK_PRINT (yyss, yyssp);
-
- *++yyvsp = yyval;
-
-
- /* Now `shift' the result of the reduction. Determine what state
- that goes to, based on the state we popped back to and the rule
- number reduced by. */
-
- yyn = yyr1[yyn];
-
- yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
- if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
- yystate = yytable[yystate];
- else
- yystate = yydefgoto[yyn - YYNTOKENS];
-
- goto yynewstate;
-
-
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
-yyerrlab:
- /* If not already recovering from an error, report this error. */
- if (!yyerrstatus)
- {
- ++yynerrs;
-#if YYERROR_VERBOSE
- yyn = yypact[yystate];
-
- if (YYPACT_NINF < yyn && yyn < YYLAST)
- {
- YYSIZE_T yysize = 0;
- int yytype = YYTRANSLATE (yychar);
- const char* yyprefix;
- char *yymsg;
- int yyx;
-
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
-
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yycount = 0;
-
- yyprefix = ", expecting ";
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
- {
- yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
- yycount += 1;
- if (yycount == 5)
- {
- yysize = 0;
- break;
- }
- }
- yysize += (sizeof ("syntax error, unexpected ")
- + yystrlen (yytname[yytype]));
- yymsg = (char *) YYSTACK_ALLOC (yysize);
- if (yymsg != 0)
- {
- char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
- yyp = yystpcpy (yyp, yytname[yytype]);
-
- if (yycount < 5)
- {
- yyprefix = ", expecting ";
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
- {
- yyp = yystpcpy (yyp, yyprefix);
- yyp = yystpcpy (yyp, yytname[yyx]);
- yyprefix = " or ";
- }
- }
- yyerror (yymsg);
- YYSTACK_FREE (yymsg);
- }
- else
- yyerror ("syntax error; also virtual memory exhausted");
- }
- else
-#endif /* YYERROR_VERBOSE */
- yyerror ("syntax error");
- }
-
-
-
- if (yyerrstatus == 3)
- {
- /* If just tried and failed to reuse lookahead token after an
- error, discard it. */
-
- if (yychar <= YYEOF)
- {
- /* If at end of input, pop the error token,
- then the rest of the stack, then return failure. */
- if (yychar == YYEOF)
- for (;;)
- {
- YYPOPSTACK;
- if (yyssp == yyss)
- YYABORT;
- YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
- yydestruct (yystos[*yyssp], yyvsp);
- }
- }
- else
- {
- YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
- yydestruct (yytoken, &yylval);
- yychar = YYEMPTY;
-
- }
- }
-
- /* Else will try to reuse lookahead token after shifting the error
- token. */
- goto yyerrlab1;
-
-
-/*---------------------------------------------------.
-| yyerrorlab -- error raised explicitly by YYERROR. |
-`---------------------------------------------------*/
-yyerrorlab:
-
-#ifdef __GNUC__
- /* Pacify GCC when the user code never invokes YYERROR and the label
- yyerrorlab therefore never appears in user code. */
- if (0)
- goto yyerrorlab;
-#endif
-
- yyvsp -= yylen;
- yyssp -= yylen;
- yystate = *yyssp;
- goto yyerrlab1;
-
-
-/*-------------------------------------------------------------.
-| yyerrlab1 -- common code for both syntax error and YYERROR. |
-`-------------------------------------------------------------*/
-yyerrlab1:
- yyerrstatus = 3; /* Each real token shifted decrements this. */
-
- for (;;)
- {
- yyn = yypact[yystate];
- if (yyn != YYPACT_NINF)
- {
- yyn += YYTERROR;
- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
- {
- yyn = yytable[yyn];
- if (0 < yyn)
- break;
- }
- }
-
- /* Pop the current state because it cannot handle the error token. */
- if (yyssp == yyss)
- YYABORT;
-
- YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
- yydestruct (yystos[yystate], yyvsp);
- YYPOPSTACK;
- yystate = *yyssp;
- YY_STACK_PRINT (yyss, yyssp);
- }
-
- if (yyn == YYFINAL)
- YYACCEPT;
-
- YYDPRINTF ((stderr, "Shifting error token, "));
-
- *++yyvsp = yylval;
-
-
- yystate = yyn;
- goto yynewstate;
-
-
-/*-------------------------------------.
-| yyacceptlab -- YYACCEPT comes here. |
-`-------------------------------------*/
-yyacceptlab:
- yyresult = 0;
- goto yyreturn;
-
-/*-----------------------------------.
-| yyabortlab -- YYABORT comes here. |
-`-----------------------------------*/
-yyabortlab:
- yyresult = 1;
- goto yyreturn;
-
-#ifndef yyoverflow
-/*----------------------------------------------.
-| yyoverflowlab -- parser overflow comes here. |
-`----------------------------------------------*/
-yyoverflowlab:
- yyerror ("parser stack overflow");
- yyresult = 2;
- /* Fall through. */
-#endif
-
-yyreturn:
-#ifndef yyoverflow
- if (yyss != yyssa)
- YYSTACK_FREE (yyss);
-#endif
- return yyresult;
-}
-
-
-#line 464 "gram.y"
-
-
-void
-apply_seq_in_map( SyckParser *parser, SyckNode *n )
-{
- long map_len;
- if ( n->shortcut == NULL )
- {
- return;
- }
-
- map_len = syck_map_count( n );
- syck_map_assign( n, map_value, map_len - 1,
- syck_hdlr_add_node( parser, n->shortcut ) );
-
- n->shortcut = NULL;
-}
-
-
diff --git a/ext/syck/gram.h b/ext/syck/gram.h
deleted file mode 100644
index 547149ab4b..0000000000
--- a/ext/syck/gram.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* A Bison parser, made by GNU Bison 1.875d. */
-
-/* Skeleton parser for Yacc-like parsing with Bison,
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* As a special exception, when this file is copied by Bison into a
- Bison output file, you may use that output file without restriction.
- This special exception was added by the Free Software Foundation
- in version 1.24 of Bison. */
-
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- YAML_ANCHOR = 258,
- YAML_ALIAS = 259,
- YAML_TRANSFER = 260,
- YAML_TAGURI = 261,
- YAML_ITRANSFER = 262,
- YAML_WORD = 263,
- YAML_PLAIN = 264,
- YAML_BLOCK = 265,
- YAML_DOCSEP = 266,
- YAML_IOPEN = 267,
- YAML_INDENT = 268,
- YAML_IEND = 269
- };
-#endif
-#define YAML_ANCHOR 258
-#define YAML_ALIAS 259
-#define YAML_TRANSFER 260
-#define YAML_TAGURI 261
-#define YAML_ITRANSFER 262
-#define YAML_WORD 263
-#define YAML_PLAIN 264
-#define YAML_BLOCK 265
-#define YAML_DOCSEP 266
-#define YAML_IOPEN 267
-#define YAML_INDENT 268
-#define YAML_IEND 269
-
-
-
-
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 35 "gram.y"
-typedef union YYSTYPE {
- SYMID nodeId;
- SyckNode *nodeData;
- char *name;
-} YYSTYPE;
-/* Line 1285 of yacc.c. */
-#line 71 "gram.h"
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
-
-
-
-
-
diff --git a/ext/syck/handler.c b/ext/syck/handler.c
deleted file mode 100644
index 40f5ef27d0..0000000000
--- a/ext/syck/handler.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * handler.c
- *
- * $Author$
- *
- * Copyright (C) 2003 why the lucky stiff
- */
-
-#include "ruby/ruby.h"
-#include "syck.h"
-
-SYMID
-syck_hdlr_add_node( SyckParser *p, SyckNode *n )
-{
- SYMID id;
-
- if ( ! n->id )
- {
- n->id = (p->handler)( p, n );
- }
- id = n->id;
-
- if ( n->anchor == NULL )
- {
- syck_free_node( n );
- }
- return id;
-}
-
-SyckNode *
-syck_hdlr_add_anchor( SyckParser *p, char *a, SyckNode *n )
-{
- SyckNode *ntmp = NULL;
-
- n->anchor = a;
- if ( p->bad_anchors != NULL )
- {
- SyckNode *bad;
- if ( st_lookup( p->bad_anchors, (st_data_t)a, (void *)&bad ) )
- {
- if ( n->kind != syck_str_kind )
- {
- n->id = bad->id;
- (p->handler)( p, n );
- }
- }
- }
- if ( p->anchors == NULL )
- {
- p->anchors = st_init_strtable();
- }
- if ( st_lookup( p->anchors, (st_data_t)a, (void *)&ntmp ) )
- {
- if ( ntmp != (void *)1 )
- {
- syck_free_node( ntmp );
- }
- }
- st_insert( p->anchors, (st_data_t)a, (st_data_t)n );
- return n;
-}
-
-void
-syck_hdlr_remove_anchor( SyckParser *p, char *a )
-{
- char *atmp = a;
- SyckNode *ntmp;
- if ( p->anchors == NULL )
- {
- p->anchors = st_init_strtable();
- }
- if ( st_delete( p->anchors, (void *)&atmp, (void *)&ntmp ) )
- {
- if ( ntmp != (void *)1 )
- {
- syck_free_node( ntmp );
- }
- }
- st_insert( p->anchors, (st_data_t)a, (st_data_t)1 );
-}
-
-SyckNode *
-syck_hdlr_get_anchor( SyckParser *p, char *a )
-{
- SyckNode *n = NULL;
-
- if ( p->anchors != NULL )
- {
- if ( st_lookup( p->anchors, (st_data_t)a, (void *)&n ) )
- {
- if ( n != (void *)1 )
- {
- S_FREE( a );
- return n;
- }
- else
- {
- if ( p->bad_anchors == NULL )
- {
- p->bad_anchors = st_init_strtable();
- }
- if ( ! st_lookup( p->bad_anchors, (st_data_t)a, (void *)&n ) )
- {
- n = (p->bad_anchor_handler)( p, a );
- st_insert( p->bad_anchors, (st_data_t)a, (st_data_t)n );
- }
- }
- }
- }
-
- if ( n == NULL )
- {
- n = (p->bad_anchor_handler)( p, a );
- }
-
- if ( n->anchor )
- {
- S_FREE( a );
- }
- else
- {
- n->anchor = a;
- }
-
- return n;
-}
-
-void
-syck_add_transfer( char *uri, SyckNode *n, int taguri )
-{
- if ( n->type_id != NULL )
- {
- S_FREE( n->type_id );
- }
-
- if ( taguri == 0 )
- {
- n->type_id = uri;
- return;
- }
-
- n->type_id = syck_type_id_to_uri( uri );
- S_FREE( uri );
-}
-
-char *
-syck_xprivate( const char *type_id, int type_len )
-{
- char *uri = S_ALLOC_N( char, type_len + 14 );
- uri[0] = '\0';
- strcat( uri, "x-private:" );
- strncat( uri, type_id, type_len );
- return uri;
-}
-
-char *
-syck_taguri( const char *domain, const char *type_id, int type_len )
-{
- char *uri = S_ALLOC_N( char, strlen( domain ) + type_len + 14 );
- uri[0] = '\0';
- strcat( uri, "tag:" );
- strcat( uri, domain );
- strcat( uri, ":" );
- strncat( uri, type_id, type_len );
- return uri;
-}
-
-int
-syck_try_implicit( SyckNode *n )
-{
- return 1;
-}
-
diff --git a/ext/syck/implicit.c b/ext/syck/implicit.c
deleted file mode 100644
index 6911e6175d..0000000000
--- a/ext/syck/implicit.c
+++ /dev/null
@@ -1,2990 +0,0 @@
-/* Generated by re2c 0.9.10 on Mon Sep 19 21:46:50 2005 */
-#line 1 "implicit.re"
-/*
- * implicit.re
- *
- * $Author$
- *
- * Copyright (C) 2003 why the lucky stiff
- */
-
-#include "ruby/ruby.h"
-#include "syck.h"
-
-#define YYCTYPE char
-#define YYCURSOR cursor
-#define YYMARKER marker
-#define YYLIMIT limit
-#define YYFILL(n) (void)0
-
-void
-try_tag_implicit( SyckNode *n, int taguri )
-{
- const char *tid = "";
- switch ( n->kind )
- {
- case syck_str_kind:
- tid = syck_match_implicit( n->data.str->ptr, n->data.str->len );
- break;
-
- case syck_seq_kind:
- tid = "seq";
- break;
-
- case syck_map_kind:
- tid = "map";
- break;
- }
- if ( n->type_id != NULL ) S_FREE( n->type_id );
- if ( taguri == 1 )
- {
- n->type_id = syck_taguri( YAML_DOMAIN, tid, (int)strlen( tid ) );
- } else {
- n->type_id = syck_strndup( tid, (int)strlen( tid ) );
- }
-}
-
-const char *
-syck_match_implicit( const char *str, size_t len )
-{
- const char *cursor, *limit, *marker = 0;
- cursor = str;
- limit = str + len;
-
-
-#line 55 "<stdout>"
-{
- YYCTYPE yych;
- unsigned int yyaccept;
- goto yy0;
- ++YYCURSOR;
-yy0:
- if((YYLIMIT - YYCURSOR) < 26) YYFILL(26);
- yych = *YYCURSOR;
- switch(yych){
- case 0x00: goto yy6;
- case '+': goto yy16;
- case '-': goto yy17;
- case '.': goto yy20;
- case '0': goto yy18;
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy19;
- case '<': goto yy22;
- case '=': goto yy21;
- case 'F': goto yy15;
- case 'N': goto yy5;
- case 'O': goto yy13;
- case 'T': goto yy11;
- case 'Y': goto yy9;
- case 'f': goto yy14;
- case 'n': goto yy4;
- case 'o': goto yy12;
- case 't': goto yy10;
- case 'y': goto yy8;
- case '~': goto yy2;
- default: goto yy23;
- }
-yy2: ++YYCURSOR;
- if((yych = *YYCURSOR) <= 0x00) goto yy6;
- goto yy3;
-yy3:
-#line 123 "implicit.re"
-{ return "str"; }
-#line 100 "<stdout>"
-yy4: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case 'o': goto yy172;
- case 'u': goto yy200;
- default: goto yy3;
- }
-yy5: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case 'O': case 'o': goto yy172;
- case 'U': goto yy195;
- case 'u': goto yy196;
- default: goto yy3;
- }
-yy6: ++YYCURSOR;
- goto yy7;
-yy7:
-#line 85 "implicit.re"
-{ return "null"; }
-#line 121 "<stdout>"
-yy8: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case 'e': goto yy194;
- default: goto yy3;
- }
-yy9: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case 'E': goto yy192;
- case 'e': goto yy193;
- default: goto yy3;
- }
-yy10: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case 'r': goto yy190;
- default: goto yy3;
- }
-yy11: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case 'R': goto yy186;
- case 'r': goto yy187;
- default: goto yy3;
- }
-yy12: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case 'f': goto yy185;
- case 'n': goto yy182;
- default: goto yy3;
- }
-yy13: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case 'F': goto yy180;
- case 'N': case 'n': goto yy182;
- case 'f': goto yy181;
- default: goto yy3;
- }
-yy14: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case 'a': goto yy177;
- default: goto yy3;
- }
-yy15: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case 'A': goto yy168;
- case 'a': goto yy169;
- default: goto yy3;
- }
-yy16: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case '.': goto yy167;
- case '0': goto yy158;
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy47;
- default: goto yy3;
- }
-yy17: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case '.': goto yy157;
- case '0': goto yy158;
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy47;
- default: goto yy3;
- }
-yy18: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case 0x00: goto yy52;
- case ',': goto yy142;
- case '.': goto yy50;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7': goto yy140;
- case '8':
- case '9': goto yy141;
- case ':': goto yy49;
- case 'x': goto yy144;
- default: goto yy3;
- }
-yy19: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case 0x00: goto yy52;
- case ',': goto yy47;
- case '.': goto yy50;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy46;
- case ':': goto yy49;
- default: goto yy3;
- }
-yy20: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case 'I': goto yy33;
- case 'N': goto yy31;
- case 'i': goto yy32;
- case 'n': goto yy30;
- default: goto yy3;
- }
-yy21: yych = *++YYCURSOR;
- if(yych <= 0x00) goto yy28;
- goto yy3;
-yy22: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case '<': goto yy24;
- default: goto yy3;
- }
-yy23: yych = *++YYCURSOR;
- goto yy3;
-yy24: yych = *++YYCURSOR;
- if(yych <= 0x00) goto yy26;
- goto yy25;
-yy25: YYCURSOR = YYMARKER;
- switch(yyaccept){
- case 0: goto yy3;
- }
-yy26: ++YYCURSOR;
- goto yy27;
-yy27:
-#line 121 "implicit.re"
-{ return "merge"; }
-#line 279 "<stdout>"
-yy28: ++YYCURSOR;
- goto yy29;
-yy29:
-#line 119 "implicit.re"
-{ return "default"; }
-#line 285 "<stdout>"
-yy30: yych = *++YYCURSOR;
- switch(yych){
- case 'a': goto yy45;
- default: goto yy25;
- }
-yy31: yych = *++YYCURSOR;
- switch(yych){
- case 'A': goto yy40;
- case 'a': goto yy41;
- default: goto yy25;
- }
-yy32: yych = *++YYCURSOR;
- switch(yych){
- case 'n': goto yy39;
- default: goto yy25;
- }
-yy33: yych = *++YYCURSOR;
- switch(yych){
- case 'N': goto yy34;
- case 'n': goto yy35;
- default: goto yy25;
- }
-yy34: yych = *++YYCURSOR;
- switch(yych){
- case 'F': goto yy36;
- default: goto yy25;
- }
-yy35: yych = *++YYCURSOR;
- switch(yych){
- case 'f': goto yy36;
- default: goto yy25;
- }
-yy36: yych = *++YYCURSOR;
- if(yych >= 0x01) goto yy25;
- goto yy37;
-yy37: ++YYCURSOR;
- goto yy38;
-yy38:
-#line 105 "implicit.re"
-{ return "float#inf"; }
-#line 326 "<stdout>"
-yy39: yych = *++YYCURSOR;
- switch(yych){
- case 'f': goto yy36;
- default: goto yy25;
- }
-yy40: yych = *++YYCURSOR;
- switch(yych){
- case 'N': goto yy42;
- default: goto yy25;
- }
-yy41: yych = *++YYCURSOR;
- switch(yych){
- case 'N': goto yy42;
- default: goto yy25;
- }
-yy42: yych = *++YYCURSOR;
- if(yych >= 0x01) goto yy25;
- goto yy43;
-yy43: ++YYCURSOR;
- goto yy44;
-yy44:
-#line 109 "implicit.re"
-{ return "float#nan"; }
-#line 350 "<stdout>"
-yy45: yych = *++YYCURSOR;
- switch(yych){
- case 'n': goto yy42;
- default: goto yy25;
- }
-yy46: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy74;
- default: goto yy48;
- }
-yy47: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy48;
-yy48: switch(yych){
- case 0x00: goto yy52;
- case ',': case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy47;
- case '.': goto yy50;
- case ':': goto yy49;
- default: goto yy25;
- }
-yy49: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5': goto yy66;
- case '6':
- case '7':
- case '8':
- case '9': goto yy67;
- default: goto yy25;
- }
-yy50: ++YYCURSOR;
- if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
- yych = *YYCURSOR;
- goto yy51;
-yy51: switch(yych){
- case 0x00: goto yy56;
- case ',': goto yy54;
- case '.': goto yy58;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy50;
- case 'E': case 'e': goto yy60;
- default: goto yy25;
- }
-yy52: ++YYCURSOR;
- goto yy53;
-yy53:
-#line 97 "implicit.re"
-{ return "int"; }
-#line 432 "<stdout>"
-yy54: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy55;
-yy55: switch(yych){
- case 0x00: goto yy56;
- case ',': case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy54;
- default: goto yy25;
- }
-yy56: ++YYCURSOR;
- goto yy57;
-yy57:
-#line 99 "implicit.re"
-{ return "float#fix"; }
-#line 456 "<stdout>"
-yy58: ++YYCURSOR;
- if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
- yych = *YYCURSOR;
- goto yy59;
-yy59: switch(yych){
- case '.': case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy58;
- case 'E': case 'e': goto yy60;
- default: goto yy25;
- }
-yy60: yych = *++YYCURSOR;
- switch(yych){
- case '+': case '-': goto yy61;
- default: goto yy25;
- }
-yy61: yych = *++YYCURSOR;
- if(yych <= 0x00) goto yy25;
- goto yy63;
-yy62: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy63;
-yy63: switch(yych){
- case 0x00: goto yy64;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy62;
- default: goto yy25;
- }
-yy64: ++YYCURSOR;
- goto yy65;
-yy65:
-#line 101 "implicit.re"
-{ return "float#exp"; }
-#line 506 "<stdout>"
-yy66: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- switch(yych){
- case 0x00: goto yy70;
- case '.': goto yy68;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy67;
- case ':': goto yy49;
- default: goto yy25;
- }
-yy67: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- switch(yych){
- case 0x00: goto yy70;
- case '.': goto yy68;
- case ':': goto yy49;
- default: goto yy25;
- }
-yy68: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy69;
-yy69: switch(yych){
- case 0x00: goto yy72;
- case ',': case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy68;
- default: goto yy25;
- }
-yy70: ++YYCURSOR;
- goto yy71;
-yy71:
-#line 95 "implicit.re"
-{ return "int#base60"; }
-#line 558 "<stdout>"
-yy72: ++YYCURSOR;
- goto yy73;
-yy73:
-#line 103 "implicit.re"
-{ return "float#base60"; }
-#line 564 "<stdout>"
-yy74: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy75;
- default: goto yy48;
- }
-yy75: yych = *++YYCURSOR;
- switch(yych){
- case '-': goto yy76;
- default: goto yy48;
- }
-yy76: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy77;
- default: goto yy25;
- }
-yy77: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy78;
- default: goto yy25;
- }
-yy78: yych = *++YYCURSOR;
- switch(yych){
- case '-': goto yy79;
- default: goto yy25;
- }
-yy79: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy80;
- default: goto yy25;
- }
-yy80: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy81;
- default: goto yy25;
- }
-yy81: yych = *++YYCURSOR;
- switch(yych){
- case 0x00: goto yy82;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy25;
- case 'T': goto yy84;
- case 't': goto yy85;
- default: goto yy87;
- }
-yy82: ++YYCURSOR;
- goto yy83;
-yy83:
-#line 111 "implicit.re"
-{ return "timestamp#ymd"; }
-#line 667 "<stdout>"
-yy84: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy126;
- default: goto yy25;
- }
-yy85: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy108;
- default: goto yy25;
- }
-yy86: ++YYCURSOR;
- if((YYLIMIT - YYCURSOR) < 9) YYFILL(9);
- yych = *YYCURSOR;
- goto yy87;
-yy87: switch(yych){
- case 0x09: case ' ': goto yy86;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy88;
- default: goto yy25;
- }
-yy88: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy89;
- default: goto yy25;
- }
-yy89: yych = *++YYCURSOR;
- switch(yych){
- case ':': goto yy90;
- default: goto yy25;
- }
-yy90: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy91;
- default: goto yy25;
- }
-yy91: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy92;
- default: goto yy25;
- }
-yy92: yych = *++YYCURSOR;
- switch(yych){
- case ':': goto yy93;
- default: goto yy25;
- }
-yy93: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy94;
- default: goto yy25;
- }
-yy94: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy95;
- default: goto yy25;
- }
-yy95: yych = *++YYCURSOR;
- switch(yych){
- case 0x09: case ' ': goto yy98;
- case '.': goto yy96;
- default: goto yy25;
- }
-yy96: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy97;
-yy97: switch(yych){
- case 0x09: case ' ': goto yy98;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy96;
- default: goto yy25;
- }
-yy98: ++YYCURSOR;
- if((YYLIMIT - YYCURSOR) < 7) YYFILL(7);
- yych = *YYCURSOR;
- goto yy99;
-yy99: switch(yych){
- case 0x09: case ' ': goto yy98;
- case '+': case '-': goto yy101;
- case 'Z': goto yy100;
- default: goto yy25;
- }
-yy100: yych = *++YYCURSOR;
- if(yych <= 0x00) goto yy105;
- goto yy25;
-yy101: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy102;
- default: goto yy25;
- }
-yy102: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy103;
- default: goto yy25;
- }
-yy103: yych = *++YYCURSOR;
- switch(yych){
- case 0x00: goto yy105;
- case ':': goto yy104;
- default: goto yy25;
- }
-yy104: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy107;
- default: goto yy25;
- }
-yy105: ++YYCURSOR;
- goto yy106;
-yy106:
-#line 115 "implicit.re"
-{ return "timestamp#spaced"; }
-#line 884 "<stdout>"
-yy107: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy100;
- default: goto yy25;
- }
-yy108: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy109;
- default: goto yy25;
- }
-yy109: yych = *++YYCURSOR;
- switch(yych){
- case ':': goto yy110;
- default: goto yy25;
- }
-yy110: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy111;
- default: goto yy25;
- }
-yy111: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy112;
- default: goto yy25;
- }
-yy112: yych = *++YYCURSOR;
- switch(yych){
- case ':': goto yy113;
- default: goto yy25;
- }
-yy113: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy114;
- default: goto yy25;
- }
-yy114: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy115;
- default: goto yy25;
- }
-yy115: yych = *++YYCURSOR;
- switch(yych){
- case '.': goto yy116;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy25;
- default: goto yy117;
- }
-yy116: ++YYCURSOR;
- if((YYLIMIT - YYCURSOR) < 7) YYFILL(7);
- yych = *YYCURSOR;
- goto yy117;
-yy117: switch(yych){
- case '+': case '-': goto yy119;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy116;
- case 'Z': goto yy118;
- default: goto yy25;
- }
-yy118: yych = *++YYCURSOR;
- if(yych <= 0x00) goto yy123;
- goto yy25;
-yy119: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy120;
- default: goto yy25;
- }
-yy120: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy121;
- default: goto yy25;
- }
-yy121: yych = *++YYCURSOR;
- switch(yych){
- case 0x00: goto yy123;
- case ':': goto yy122;
- default: goto yy25;
- }
-yy122: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy125;
- default: goto yy25;
- }
-yy123: ++YYCURSOR;
- goto yy124;
-yy124:
-#line 113 "implicit.re"
-{ return "timestamp#iso8601"; }
-#line 1069 "<stdout>"
-yy125: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy118;
- default: goto yy25;
- }
-yy126: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy127;
- default: goto yy25;
- }
-yy127: yych = *++YYCURSOR;
- switch(yych){
- case ':': goto yy128;
- default: goto yy25;
- }
-yy128: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy129;
- default: goto yy25;
- }
-yy129: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy130;
- default: goto yy25;
- }
-yy130: yych = *++YYCURSOR;
- switch(yych){
- case ':': goto yy131;
- default: goto yy25;
- }
-yy131: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy132;
- default: goto yy25;
- }
-yy132: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy133;
- default: goto yy25;
- }
-yy133: yych = *++YYCURSOR;
- switch(yych){
- case '.': goto yy134;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy25;
- case 'Z': goto yy136;
- default: goto yy135;
- }
-yy134: ++YYCURSOR;
- if((YYLIMIT - YYCURSOR) < 7) YYFILL(7);
- yych = *YYCURSOR;
- goto yy135;
-yy135: switch(yych){
- case '+': case '-': goto yy119;
- case '0': goto yy134;
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy138;
- case 'Z': goto yy118;
- default: goto yy25;
- }
-yy136: yych = *++YYCURSOR;
- if(yych >= 0x01) goto yy25;
- goto yy137;
-yy137: yych = *++YYCURSOR;
- goto yy124;
-yy138: ++YYCURSOR;
- if((YYLIMIT - YYCURSOR) < 7) YYFILL(7);
- yych = *YYCURSOR;
- goto yy139;
-yy139: switch(yych){
- case '+': case '-': goto yy119;
- case '0': goto yy134;
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy138;
- case 'Z': goto yy136;
- default: goto yy25;
- }
-yy140: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7': goto yy155;
- case '8':
- case '9': goto yy153;
- default: goto yy143;
- }
-yy141: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy153;
- default: goto yy152;
- }
-yy142: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy143;
-yy143: switch(yych){
- case 0x00: goto yy149;
- case ',': case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7': goto yy142;
- case '.': goto yy50;
- case '8':
- case '9': goto yy151;
- case ':': goto yy49;
- default: goto yy25;
- }
-yy144: yych = *++YYCURSOR;
- if(yych <= 0x00) goto yy25;
- goto yy146;
-yy145: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy146;
-yy146: switch(yych){
- case 0x00: goto yy147;
- case ',': case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f': goto yy145;
- default: goto yy25;
- }
-yy147: ++YYCURSOR;
- goto yy148;
-yy148:
-#line 91 "implicit.re"
-{ return "int#hex"; }
-#line 1307 "<stdout>"
-yy149: ++YYCURSOR;
- goto yy150;
-yy150:
-#line 93 "implicit.re"
-{ return "int#oct"; }
-#line 1313 "<stdout>"
-yy151: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy152;
-yy152: switch(yych){
- case ',': case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy151;
- case '.': goto yy50;
- case ':': goto yy49;
- default: goto yy25;
- }
-yy153: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy154;
- default: goto yy152;
- }
-yy154: yych = *++YYCURSOR;
- switch(yych){
- case '-': goto yy76;
- default: goto yy152;
- }
-yy155: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7': goto yy156;
- case '8':
- case '9': goto yy154;
- default: goto yy143;
- }
-yy156: yych = *++YYCURSOR;
- switch(yych){
- case '-': goto yy76;
- default: goto yy143;
- }
-yy157: yych = *++YYCURSOR;
- switch(yych){
- case 'I': goto yy160;
- case 'i': goto yy159;
- default: goto yy25;
- }
-yy158: yych = *++YYCURSOR;
- switch(yych){
- case 0x00: goto yy52;
- case 'x': goto yy144;
- default: goto yy143;
- }
-yy159: yych = *++YYCURSOR;
- switch(yych){
- case 'n': goto yy166;
- default: goto yy25;
- }
-yy160: yych = *++YYCURSOR;
- switch(yych){
- case 'N': goto yy161;
- case 'n': goto yy162;
- default: goto yy25;
- }
-yy161: yych = *++YYCURSOR;
- switch(yych){
- case 'F': goto yy163;
- default: goto yy25;
- }
-yy162: yych = *++YYCURSOR;
- switch(yych){
- case 'f': goto yy163;
- default: goto yy25;
- }
-yy163: yych = *++YYCURSOR;
- if(yych >= 0x01) goto yy25;
- goto yy164;
-yy164: ++YYCURSOR;
- goto yy165;
-yy165:
-#line 107 "implicit.re"
-{ return "float#neginf"; }
-#line 1412 "<stdout>"
-yy166: yych = *++YYCURSOR;
- switch(yych){
- case 'f': goto yy163;
- default: goto yy25;
- }
-yy167: yych = *++YYCURSOR;
- switch(yych){
- case 'I': goto yy33;
- case 'i': goto yy32;
- default: goto yy25;
- }
-yy168: yych = *++YYCURSOR;
- switch(yych){
- case 'L': goto yy175;
- default: goto yy25;
- }
-yy169: yych = *++YYCURSOR;
- switch(yych){
- case 'l': goto yy170;
- default: goto yy25;
- }
-yy170: yych = *++YYCURSOR;
- switch(yych){
- case 's': goto yy171;
- default: goto yy25;
- }
-yy171: yych = *++YYCURSOR;
- switch(yych){
- case 'e': goto yy172;
- default: goto yy25;
- }
-yy172: yych = *++YYCURSOR;
- if(yych >= 0x01) goto yy25;
- goto yy173;
-yy173: ++YYCURSOR;
- goto yy174;
-yy174:
-#line 89 "implicit.re"
-{ return "bool#no"; }
-#line 1452 "<stdout>"
-yy175: yych = *++YYCURSOR;
- switch(yych){
- case 'S': goto yy176;
- default: goto yy25;
- }
-yy176: yych = *++YYCURSOR;
- switch(yych){
- case 'E': goto yy172;
- default: goto yy25;
- }
-yy177: yych = *++YYCURSOR;
- switch(yych){
- case 'l': goto yy178;
- default: goto yy25;
- }
-yy178: yych = *++YYCURSOR;
- switch(yych){
- case 's': goto yy179;
- default: goto yy25;
- }
-yy179: yych = *++YYCURSOR;
- switch(yych){
- case 'e': goto yy172;
- default: goto yy25;
- }
-yy180: yych = *++YYCURSOR;
- switch(yych){
- case 'F': goto yy172;
- default: goto yy25;
- }
-yy181: yych = *++YYCURSOR;
- switch(yych){
- case 'f': goto yy172;
- default: goto yy25;
- }
-yy182: yych = *++YYCURSOR;
- if(yych >= 0x01) goto yy25;
- goto yy183;
-yy183: ++YYCURSOR;
- goto yy184;
-yy184:
-#line 87 "implicit.re"
-{ return "bool#yes"; }
-#line 1496 "<stdout>"
-yy185: yych = *++YYCURSOR;
- switch(yych){
- case 'f': goto yy172;
- default: goto yy25;
- }
-yy186: yych = *++YYCURSOR;
- switch(yych){
- case 'U': goto yy189;
- default: goto yy25;
- }
-yy187: yych = *++YYCURSOR;
- switch(yych){
- case 'u': goto yy188;
- default: goto yy25;
- }
-yy188: yych = *++YYCURSOR;
- switch(yych){
- case 'e': goto yy182;
- default: goto yy25;
- }
-yy189: yych = *++YYCURSOR;
- switch(yych){
- case 'E': goto yy182;
- default: goto yy25;
- }
-yy190: yych = *++YYCURSOR;
- switch(yych){
- case 'u': goto yy191;
- default: goto yy25;
- }
-yy191: yych = *++YYCURSOR;
- switch(yych){
- case 'e': goto yy182;
- default: goto yy25;
- }
-yy192: yych = *++YYCURSOR;
- switch(yych){
- case 'S': goto yy182;
- default: goto yy25;
- }
-yy193: yych = *++YYCURSOR;
- switch(yych){
- case 's': goto yy182;
- default: goto yy25;
- }
-yy194: yych = *++YYCURSOR;
- switch(yych){
- case 's': goto yy182;
- default: goto yy25;
- }
-yy195: yych = *++YYCURSOR;
- switch(yych){
- case 'L': goto yy199;
- default: goto yy25;
- }
-yy196: yych = *++YYCURSOR;
- switch(yych){
- case 'l': goto yy197;
- default: goto yy25;
- }
-yy197: yych = *++YYCURSOR;
- switch(yych){
- case 'l': goto yy198;
- default: goto yy25;
- }
-yy198: yych = *++YYCURSOR;
- if(yych <= 0x00) goto yy6;
- goto yy25;
-yy199: yych = *++YYCURSOR;
- switch(yych){
- case 'L': goto yy198;
- default: goto yy25;
- }
-yy200: yych = *++YYCURSOR;
- switch(yych){
- case 'l': goto yy201;
- default: goto yy25;
- }
-yy201: ++YYCURSOR;
- switch((yych = *YYCURSOR)) {
- case 'l': goto yy198;
- default: goto yy25;
- }
-}
-#line 125 "implicit.re"
-
-
-}
-
-/* Remove ending fragment and compare types */
-int
-syck_tagcmp( const char *tag1, const char *tag2 )
-{
- if ( tag1 == tag2 ) return 1;
- if ( tag1 == NULL || tag2 == NULL ) return 0;
- else {
- int i;
- char *othorpe;
- char *tmp1 = syck_strndup( tag1, strlen( tag1 ) );
- char *tmp2 = syck_strndup( tag2, strlen( tag2 ) );
- othorpe = strstr( tmp1, "#" );
- if ( othorpe != NULL ) {
- othorpe[0] = '\0';
- }
- othorpe = strstr( tmp2, "#" );
- if ( othorpe != NULL ) {
- othorpe[0] = '\0';
- }
- i = strcmp( tmp1, tmp2 );
- S_FREE( tmp1 ); S_FREE( tmp2 );
- return i;
- }
-}
-
-char *
-syck_type_id_to_uri( const char *type_id )
-{
- const char *cursor, *limit, *marker = 0;
-
- cursor = type_id;
- limit = type_id + strlen( type_id );
-
-
-#line 1620 "<stdout>"
-{
- YYCTYPE yych;
- unsigned int yyaccept = 0;
- goto yy202;
- ++YYCURSOR;
-yy202:
- if((YYLIMIT - YYCURSOR) < 11) YYFILL(11);
- yych = *YYCURSOR;
- switch(yych){
- case 0x00: goto yy204;
- case '!': goto yy208;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z': case '_': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's': case 'u':
- case 'v':
- case 'w': case 'y':
- case 'z': goto yy210;
- case 't': goto yy205;
- case 'x': goto yy207;
- default: goto yy211;
- }
-yy204: YYCURSOR = YYMARKER;
- switch(yyaccept){
- case 0: goto yy206;
- }
-yy205: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case ',': goto yy216;
- case '-': goto yy212;
- case '.': goto yy217;
- case '/': goto yy218;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z': case '_': case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy214;
- case 'a': goto yy246;
- default: goto yy206;
- }
-yy206:
-#line 202 "implicit.re"
-{ return syck_taguri( YAML_DOMAIN, type_id, (int)strlen( type_id ) ); }
-#line 1768 "<stdout>"
-yy207: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case ',': case '.':
- case '/':
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z': case '_': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy215;
- case '-': goto yy236;
- default: goto yy206;
- }
-yy208: ++YYCURSOR;
- goto yy209;
-yy209:
-#line 176 "implicit.re"
-{ return syck_xprivate( type_id + 1, (int)strlen( type_id ) - 1 ); }
-#line 1842 "<stdout>"
-yy210: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case ',': goto yy216;
- case '-': goto yy212;
- case '.': goto yy217;
- case '/': goto yy218;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z': case '_': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy214;
- default: goto yy206;
- }
-yy211: yych = *++YYCURSOR;
- goto yy206;
-yy212: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy213;
-yy213: switch(yych){
- case '-': goto yy212;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z': case '_': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy214;
- default: goto yy204;
- }
-yy214: ++YYCURSOR;
- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
- yych = *YYCURSOR;
- goto yy215;
-yy215: switch(yych){
- case ',': goto yy216;
- case '-': goto yy212;
- case '.': goto yy217;
- case '/': goto yy218;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z': case '_': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy214;
- default: goto yy204;
- }
-yy216: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy224;
- default: goto yy204;
- }
-yy217: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z': case '_': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy220;
- default: goto yy204;
- }
-yy218: ++YYCURSOR;
- goto yy219;
-yy219:
-#line 178 "implicit.re"
-{ char *domain = S_ALLOC_N( char, ( YYCURSOR - type_id ) + 15 );
- char *uri;
-
- domain[0] = '\0';
- strncat( domain, type_id, ( YYCURSOR - type_id ) - 1 );
- strcat( domain, "." );
- strcat( domain, YAML_DOMAIN );
- uri = syck_taguri( domain, YYCURSOR, (int)(YYLIMIT - YYCURSOR) );
-
- S_FREE( domain );
- return uri;
- }
-#line 2149 "<stdout>"
-yy220: ++YYCURSOR;
- if((YYLIMIT - YYCURSOR) < 12) YYFILL(12);
- yych = *YYCURSOR;
- goto yy221;
-yy221: switch(yych){
- case ',': goto yy216;
- case '-': goto yy222;
- case '.': goto yy217;
- case '/': goto yy218;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z': case '_': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy220;
- default: goto yy204;
- }
-yy222: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy223;
-yy223: switch(yych){
- case '-': goto yy222;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z': case '_': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy220;
- default: goto yy204;
- }
-yy224: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy225;
- default: goto yy204;
- }
-yy225: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy226;
- default: goto yy204;
- }
-yy226: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy227;
- default: goto yy204;
- }
-yy227: yych = *++YYCURSOR;
- switch(yych){
- case '-': goto yy228;
- case '/': goto yy229;
- default: goto yy204;
- }
-yy228: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy231;
- default: goto yy204;
- }
-yy229: ++YYCURSOR;
- goto yy230;
-yy230:
-#line 191 "implicit.re"
-{ char *domain = S_ALLOC_N( char, YYCURSOR - type_id );
- char *uri;
-
- domain[0] = '\0';
- strncat( domain, type_id, ( YYCURSOR - type_id ) - 1 );
- uri = syck_taguri( domain, YYCURSOR, (int)(YYLIMIT - YYCURSOR) );
-
- S_FREE( domain );
- return uri;
- }
-#line 2365 "<stdout>"
-yy231: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy232;
- default: goto yy204;
- }
-yy232: yych = *++YYCURSOR;
- switch(yych){
- case '-': goto yy233;
- case '/': goto yy229;
- default: goto yy204;
- }
-yy233: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy234;
- default: goto yy204;
- }
-yy234: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy235;
- default: goto yy204;
- }
-yy235: yych = *++YYCURSOR;
- switch(yych){
- case '/': goto yy229;
- default: goto yy204;
- }
-yy236: yych = *++YYCURSOR;
- switch(yych){
- case 'p': goto yy237;
- default: goto yy213;
- }
-yy237: yych = *++YYCURSOR;
- switch(yych){
- case ',': goto yy216;
- case '.': goto yy217;
- case '/': goto yy218;
- case 'r': goto yy238;
- default: goto yy213;
- }
-yy238: yych = *++YYCURSOR;
- switch(yych){
- case ',': goto yy216;
- case '.': goto yy217;
- case '/': goto yy218;
- case 'i': goto yy239;
- default: goto yy213;
- }
-yy239: yych = *++YYCURSOR;
- switch(yych){
- case ',': goto yy216;
- case '.': goto yy217;
- case '/': goto yy218;
- case 'v': goto yy240;
- default: goto yy213;
- }
-yy240: yych = *++YYCURSOR;
- switch(yych){
- case ',': goto yy216;
- case '.': goto yy217;
- case '/': goto yy218;
- case 'a': goto yy241;
- default: goto yy213;
- }
-yy241: yych = *++YYCURSOR;
- switch(yych){
- case ',': goto yy216;
- case '.': goto yy217;
- case '/': goto yy218;
- case 't': goto yy242;
- default: goto yy213;
- }
-yy242: yych = *++YYCURSOR;
- switch(yych){
- case ',': goto yy216;
- case '.': goto yy217;
- case '/': goto yy218;
- case 'e': goto yy243;
- default: goto yy213;
- }
-yy243: yych = *++YYCURSOR;
- switch(yych){
- case ',': goto yy216;
- case '.': goto yy217;
- case '/': goto yy218;
- case ':': goto yy244;
- default: goto yy213;
- }
-yy244: ++YYCURSOR;
- goto yy245;
-yy245:
-#line 174 "implicit.re"
-{ return syck_strndup( type_id, strlen( type_id ) ); }
-#line 2485 "<stdout>"
-yy246: yych = *++YYCURSOR;
- switch(yych){
- case ',': goto yy216;
- case '.': goto yy217;
- case '/': goto yy218;
- case 'g': goto yy247;
- default: goto yy213;
- }
-yy247: yych = *++YYCURSOR;
- switch(yych){
- case ',': goto yy216;
- case '.': goto yy217;
- case '/': goto yy218;
- case ':': goto yy248;
- default: goto yy213;
- }
-yy248: yych = *++YYCURSOR;
- switch(yych){
- case ',':
- case '-':
- case '.': goto yy204;
- default: goto yy250;
- }
-yy249: ++YYCURSOR;
- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
- yych = *YYCURSOR;
- goto yy250;
-yy250: switch(yych){
- case ',': goto yy253;
- case '-': goto yy251;
- case '.': goto yy254;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z': case '_': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy249;
- default: goto yy204;
- }
-yy251: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy252;
-yy252: switch(yych){
- case '-': goto yy251;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z': case '_': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy249;
- default: goto yy204;
- }
-yy253: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy259;
- default: goto yy204;
- }
-yy254: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z': case '_': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy255;
- default: goto yy204;
- }
-yy255: ++YYCURSOR;
- if((YYLIMIT - YYCURSOR) < 12) YYFILL(12);
- yych = *YYCURSOR;
- goto yy256;
-yy256: switch(yych){
- case ',': goto yy253;
- case '-': goto yy257;
- case '.': goto yy254;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z': case '_': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy255;
- default: goto yy204;
- }
-yy257: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy258;
-yy258: switch(yych){
- case '-': goto yy257;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z': case '_': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy255;
- default: goto yy204;
- }
-yy259: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy260;
- default: goto yy204;
- }
-yy260: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy261;
- default: goto yy204;
- }
-yy261: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy262;
- default: goto yy204;
- }
-yy262: yych = *++YYCURSOR;
- switch(yych){
- case '-': goto yy263;
- case ':': goto yy264;
- default: goto yy204;
- }
-yy263: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy266;
- default: goto yy204;
- }
-yy264: ++YYCURSOR;
- goto yy265;
-yy265:
-#line 172 "implicit.re"
-{ return syck_strndup( type_id, strlen( type_id ) ); }
-#line 2932 "<stdout>"
-yy266: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy267;
- default: goto yy204;
- }
-yy267: yych = *++YYCURSOR;
- switch(yych){
- case '-': goto yy268;
- case ':': goto yy264;
- default: goto yy204;
- }
-yy268: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy269;
- default: goto yy204;
- }
-yy269: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy270;
- default: goto yy204;
- }
-yy270: ++YYCURSOR;
- switch((yych = *YYCURSOR)) {
- case ':': goto yy264;
- default: goto yy204;
- }
-}
-#line 204 "implicit.re"
-
-
-}
diff --git a/ext/syck/lib/syck.rb b/ext/syck/lib/syck.rb
deleted file mode 100644
index f8e3c0f8bc..0000000000
--- a/ext/syck/lib/syck.rb
+++ /dev/null
@@ -1,447 +0,0 @@
-# -*- mode: ruby; ruby-indent-level: 4; tab-width: 4 -*- vim: sw=4 ts=4
-# $Id$
-#
-# = yaml.rb: top-level module with methods for loading and parsing YAML documents
-#
-# Author:: why the lucky stiff
-#
-
-require 'yaml/syck'
-
-# == YAML
-#
-# YAML(tm) (rhymes with 'camel') is a
-# straightforward machine parsable data serialization format designed for
-# human readability and interaction with scripting languages such as Perl
-# and Python. YAML is optimized for data serialization, formatted
-# dumping, configuration files, log files, Internet messaging and
-# filtering. This specification describes the YAML information model and
-# serialization format. Together with the Unicode standard for characters, it
-# provides all the information necessary to understand YAML Version 1.0
-# and construct computer programs to process it.
-#
-# See http://yaml.org/ for more information. For a quick tutorial, please
-# visit YAML In Five Minutes (http://yaml.kwiki.org/?YamlInFiveMinutes).
-#
-# == About This Library
-#
-# The YAML 1.0 specification outlines four stages of YAML loading and dumping.
-# This library honors all four of those stages, although data is really only
-# available to you in three stages.
-#
-# The four stages are: native, representation, serialization, and presentation.
-#
-# The native stage refers to data which has been loaded completely into Ruby's
-# own types. (See +YAML::load+.)
-#
-# The representation stage means data which has been composed into
-# +YAML::BaseNode+ objects. In this stage, the document is available as a
-# tree of node objects. You can perform YPath queries and transformations
-# at this level. (See +YAML::parse+.)
-#
-# The serialization stage happens inside the parser. The YAML parser used in
-# Ruby is called Syck. Serialized nodes are available in the extension as
-# SyckNode structs.
-#
-# The presentation stage is the YAML document itself. This is accessible
-# to you as a string. (See +YAML::dump+.)
-#
-# For more information about the various information models, see Chapter
-# 3 of the YAML 1.0 Specification (http://yaml.org/spec/#id2491269).
-#
-# The YAML module provides quick access to the most common loading (YAML::load)
-# and dumping (YAML::dump) tasks. This module also provides an API for registering
-# global types (YAML::add_domain_type).
-#
-# == Example
-#
-# A simple round-trip (load and dump) of an object.
-#
-# require "yaml"
-#
-# test_obj = ["dogs", "cats", "badgers"]
-#
-# yaml_obj = YAML::dump( test_obj )
-# # -> ---
-# - dogs
-# - cats
-# - badgers
-# ruby_obj = YAML::load( yaml_obj )
-# # => ["dogs", "cats", "badgers"]
-# ruby_obj == test_obj
-# # => true
-#
-# To register your custom types with the global resolver, use +add_domain_type+.
-#
-# YAML::add_domain_type( "your-site.com,2004", "widget" ) do |type, val|
-# Widget.new( val )
-# end
-#
-module Syck
-
- DefaultResolver.use_types_at( @@tagged_classes )
-
- # Returns a new default parser
- def self.parser; Parser.new.set_resolver( self.resolver ); end
-
- # Returns a new generic parser
- def self.generic_parser
- warn "#{caller[0]}: YAML.generic_parser is deprecated, switch to psych" if $VERBOSE && !caller[0].start_with?(File.dirname(__FILE__))
- Parser.new.set_resolver( GenericResolver )
- end
-
- # Returns the default resolver
- def self.resolver
- warn "#{caller[0]}: YAML.resolver is deprecated" if $VERBOSE && !caller[0].start_with?(File.dirname(__FILE__))
- DefaultResolver
- end
-
- # Returns a new default emitter
- def self.emitter
- warn "#{caller[0]}: YAML.emitter is deprecated" if $VERBOSE && !caller[0].start_with?(File.dirname(__FILE__))
- Emitter.new.set_resolver( self.resolver )
- end
-
- #
- # Converts _obj_ to YAML and writes the YAML result to _io_.
- #
- # File.open( 'animals.yaml', 'w' ) do |out|
- # YAML.dump( ['badger', 'elephant', 'tiger'], out )
- # end
- #
- # If no _io_ is provided, a string containing the dumped YAML
- # is returned.
- #
- # YAML.dump( :locked )
- # #=> "--- :locked"
- #
- def self.dump( obj, io = nil )
- obj.to_yaml( io || io2 = StringIO.new )
- io || ( io2.rewind; io2.read )
- end
-
- #
- # Load a document from the current _io_ stream.
- #
- # File.open( 'animals.yaml' ) { |yf| YAML::load( yf ) }
- # #=> ['badger', 'elephant', 'tiger']
- #
- # Can also load from a string.
- #
- # YAML.load( "--- :locked" )
- # #=> :locked
- #
- def self.load( io )
- parser.load( io )
- end
-
- #
- # Load a document from the file located at _filepath_.
- #
- # YAML.load_file( 'animals.yaml' )
- # #=> ['badger', 'elephant', 'tiger']
- #
- def self.load_file( filepath )
- File.open( filepath ) do |f|
- load( f )
- end
- end
-
- #
- # Parse the first document from the current _io_ stream
- #
- # File.open( 'animals.yaml' ) { |yf| YAML::load( yf ) }
- # #=> #<YAML::Syck::Node:0x82ccce0
- # @kind=:seq,
- # @value=
- # [#<YAML::Syck::Node:0x82ccd94
- # @kind=:scalar,
- # @type_id="str",
- # @value="badger">,
- # #<YAML::Syck::Node:0x82ccd58
- # @kind=:scalar,
- # @type_id="str",
- # @value="elephant">,
- # #<YAML::Syck::Node:0x82ccd1c
- # @kind=:scalar,
- # @type_id="str",
- # @value="tiger">]>
- #
- # Can also load from a string.
- #
- # YAML.parse( "--- :locked" )
- # #=> #<YAML::Syck::Node:0x82edddc
- # @type_id="tag:ruby.yaml.org,2002:sym",
- # @value=":locked", @kind=:scalar>
- #
- def self.parse( io )
- generic_parser.load( io )
- end
-
- #
- # Parse a document from the file located at _filepath_.
- #
- # YAML.parse_file( 'animals.yaml' )
- # #=> #<YAML::Syck::Node:0x82ccce0
- # @kind=:seq,
- # @value=
- # [#<YAML::Syck::Node:0x82ccd94
- # @kind=:scalar,
- # @type_id="str",
- # @value="badger">,
- # #<YAML::Syck::Node:0x82ccd58
- # @kind=:scalar,
- # @type_id="str",
- # @value="elephant">,
- # #<YAML::Syck::Node:0x82ccd1c
- # @kind=:scalar,
- # @type_id="str",
- # @value="tiger">]>
- #
- def self.parse_file( filepath )
- File.open( filepath ) do |f|
- parse( f )
- end
- end
-
- #
- # Calls _block_ with each consecutive document in the YAML
- # stream contained in _io_.
- #
- # File.open( 'many-docs.yaml' ) do |yf|
- # YAML.each_document( yf ) do |ydoc|
- # ## ydoc contains the single object
- # ## from the YAML document
- # end
- # end
- #
- def self.each_document( io, &block )
- warn "#{caller[0]}: YAML.each_document is deprecated" if $VERBOSE && !caller[0].start_with?(File.dirname(__FILE__))
- parser.load_documents( io, &block )
- end
-
- #
- # Calls _block_ with each consecutive document in the YAML
- # stream contained in _io_.
- #
- # File.open( 'many-docs.yaml' ) do |yf|
- # YAML.load_documents( yf ) do |ydoc|
- # ## ydoc contains the single object
- # ## from the YAML document
- # end
- # end
- #
- def self.load_documents( io, &doc_proc )
- parser.load_documents( io, &doc_proc )
- end
-
- #
- # Calls _block_ with a tree of +YAML::BaseNodes+, one tree for
- # each consecutive document in the YAML stream contained in _io_.
- #
- # File.open( 'many-docs.yaml' ) do |yf|
- # YAML.each_node( yf ) do |ydoc|
- # ## ydoc contains a tree of nodes
- # ## from the YAML document
- # end
- # end
- #
- def self.each_node( io, &doc_proc )
- warn "#{caller[0]}: YAML.each_node is deprecated" if $VERBOSE && !caller[0].start_with?(File.dirname(__FILE__))
- generic_parser.load_documents( io, &doc_proc )
- end
-
- #
- # Calls _block_ with a tree of +YAML::BaseNodes+, one tree for
- # each consecutive document in the YAML stream contained in _io_.
- #
- # File.open( 'many-docs.yaml' ) do |yf|
- # YAML.parse_documents( yf ) do |ydoc|
- # ## ydoc contains a tree of nodes
- # ## from the YAML document
- # end
- # end
- #
- def self.parse_documents( io, &doc_proc )
- warn "#{caller[0]}: YAML.parse_documents is deprecated, use load_stream" if $VERBOSE && !caller[0].start_with?(File.dirname(__FILE__))
- self.each_node( io, &doc_proc )
- end
-
- #
- # Loads all documents from the current _io_ stream,
- # returning a +YAML::Stream+ object containing all
- # loaded documents.
- #
- def self.load_stream( io )
- d = nil
- parser.load_documents( io ) do |doc|
- d = Stream.new if not d
- d.add( doc )
- end
- return d
- end
-
- #
- # Returns a YAML stream containing each of the items in +objs+,
- # each having their own document.
- #
- # YAML.dump_stream( 0, [], {} )
- # #=> --- 0
- # --- []
- # --- {}
- #
- def self.dump_stream( *objs )
- d = Stream.new
- objs.each do |doc|
- d.add( doc )
- end
- d.emit
- end
-
- #
- # Add a global handler for a YAML domain type.
- #
- def self.add_domain_type( domain, type_tag, &transfer_proc )
- resolver.add_type( "tag:#{ domain }:#{ type_tag }", transfer_proc )
- end
-
- #
- # Add a transfer method for a builtin type
- #
- def self.add_builtin_type( type_tag, &transfer_proc )
- resolver.add_type( "tag:yaml.org,2002:#{ type_tag }", transfer_proc )
- end
-
- #
- # Add a transfer method for a builtin type
- #
- def self.add_ruby_type( type_tag, &transfer_proc )
- warn "#{caller[0]}: YAML.add_ruby_type is deprecated, use add_domain_type" if $VERBOSE && !caller[0].start_with?(File.dirname(__FILE__))
- resolver.add_type( "tag:ruby.yaml.org,2002:#{ type_tag }", transfer_proc )
- end
-
- #
- # Add a private document type
- #
- def self.add_private_type( type_re, &transfer_proc )
- warn "#{caller[0]}: YAML.add_private_type is deprecated, use add_domain_type" if $VERBOSE && !caller[0].start_with?(File.dirname(__FILE__))
- resolver.add_type( "x-private:" + type_re, transfer_proc )
- end
-
- #
- # Detect typing of a string
- #
- def self.detect_implicit( val )
- warn "#{caller[0]}: YAML.detect_implicit is deprecated" if $VERBOSE && !caller[0].start_with?(File.dirname(__FILE__))
- resolver.detect_implicit( val )
- end
-
- #
- # Convert a type_id to a taguri
- #
- def self.tagurize( val )
- warn "#{caller[0]}: YAML.tagurize is deprecated" if $VERBOSE && !caller[0].start_with?(File.dirname(__FILE__))
- resolver.tagurize( val )
- end
-
- #
- # Apply a transfer method to a Ruby object
- #
- def self.transfer( type_id, obj )
- warn "#{caller[0]}: YAML.transfer is deprecated" if $VERBOSE && !caller[0].start_with?(File.dirname(__FILE__))
- resolver.transfer( tagurize( type_id ), obj )
- end
-
- #
- # Apply any implicit a node may qualify for
- #
- def self.try_implicit( obj )
- warn "#{caller[0]}: YAML.try_implicit is deprecated" if $VERBOSE && !caller[0].start_with?(File.dirname(__FILE__))
- transfer( detect_implicit( obj ), obj )
- end
-
- #
- # Method to extract colon-seperated type and class, returning
- # the type and the constant of the class
- #
- def self.read_type_class( type, obj_class )
- warn "#{caller[0]}: YAML.read_type_class is deprecated" if $VERBOSE && !caller[0].start_with?(File.dirname(__FILE__))
- type, tclass = type.split( ':', 4 ).last(2)
- tclass.split( "::" ).each { |c| obj_class = obj_class.const_get( c ) } if tclass
- return [ type, obj_class ]
- end
-
- #
- # Allocate blank object
- #
- def self.object_maker( obj_class, val )
- warn "#{caller[0]}: YAML.object_maker is deprecated" if $VERBOSE && !caller[0].start_with?(File.dirname(__FILE__))
- if Hash === val
- o = obj_class.allocate
- val.each_pair { |k,v|
- o.instance_variable_set("@#{k}", v)
- }
- o
- else
- raise Error, "Invalid object explicitly tagged !ruby/Object: " + val.inspect
- end
- end
-
- #
- # Allocate an Emitter if needed
- #
- def self.quick_emit( oid, opts = {}, &e )
- warn "#{caller[0]}: YAML.quick_emit is deprecated" if $VERBOSE && !caller[0].start_with?(File.dirname(__FILE__))
- out =
- if opts.is_a? Emitter
- opts
- else
- emitter.reset( opts )
- end
- out.emit( oid, &e )
- end
-
-end
-
-module Kernel
- #
- # ryan:: You know how Kernel.p is a really convenient way to dump ruby
- # structures? The only downside is that it's not as legible as
- # YAML.
- #
- # _why:: (listening)
- #
- # ryan:: I know you don't want to urinate all over your users' namespaces.
- # But, on the other hand, convenience of dumping for debugging is,
- # IMO, a big YAML use case.
- #
- # _why:: Go nuts! Have a pony parade!
- #
- # ryan:: Either way, I certainly will have a pony parade.
- #
-
- # Prints any supplied _objects_ out in YAML. Intended as
- # a variation on +Kernel::p+.
- #
- # S = Struct.new(:name, :state)
- # s = S['dave', 'TX']
- # y s
- #
- # _produces:_
- #
- # --- !ruby/struct:S
- # name: dave
- # state: TX
- #
- def y( object, *objects )
- objects.unshift object
- puts( if objects.length == 1
- YAML.dump( *objects )
- else
- YAML.dump_stream( *objects )
- end )
- end
- private :y
-end
-
-
diff --git a/ext/syck/lib/syck/baseemitter.rb b/ext/syck/lib/syck/baseemitter.rb
deleted file mode 100644
index 5e39e450de..0000000000
--- a/ext/syck/lib/syck/baseemitter.rb
+++ /dev/null
@@ -1,242 +0,0 @@
-#
-# BaseEmitter
-#
-
-require 'syck/constants'
-require 'syck/encoding'
-require 'syck/error'
-
-module Syck
- module BaseEmitter
- def options( opt = nil )
- if opt
- @options[opt] || DEFAULTS[opt]
- else
- @options
- end
- end
-
- def options=( opt )
- @options = opt
- end
-
- #
- # Emit binary data
- #
- def binary_base64( value )
- self << "!binary "
- self.node_text( [value].pack("m"), '|' )
- end
-
- #
- # Emit plain, normal flowing text
- #
- def node_text( value, block = nil )
- @seq_map = false
- valx = value.dup
- unless block
- block =
- if options(:UseBlock)
- '|'
- elsif not options(:UseFold) and valx =~ /\n[ \t]/ and not valx =~ /#{ESCAPE_CHAR}/
- '|'
- else
- '>'
- end
- indt = $&.to_i if block =~ /\d+/
- if valx =~ /(\A\n*[ \t#]|^---\s+)/
- indt = options(:Indent) unless indt.to_i > 0
- block += indt.to_s
- end
-
- block +=
- if valx =~ /\n\Z\n/
- "+"
- elsif valx =~ /\Z\n/
- ""
- else
- "-"
- end
- end
- block += "\n"
- if block[0] == ?"
- esc_skip = ( "\t\n" unless valx =~ /^[ \t]/ ) || ""
- valx = fold( Syck.escape( valx, esc_skip ) + "\"" ).chomp
- self << '"' + indent_text( valx, indt, false )
- else
- if block[0] == ?>
- valx = fold( valx )
- end
- #p [block, indt]
- self << block + indent_text( valx, indt )
- end
- end
-
- #
- # Emit a simple, unqouted string
- #
- def simple( value )
- @seq_map = false
- self << value.to_s
- end
-
- #
- # Emit double-quoted string
- #
- def double( value )
- "\"#{Syck.escape( value )}\""
- end
-
- #
- # Emit single-quoted string
- #
- def single( value )
- "'#{value}'"
- end
-
- #
- # Write a text block with the current indent
- #
- def indent_text( text, mod, first_line = true )
- return "" if text.to_s.empty?
- spacing = indent( mod )
- text = text.gsub( /\A([^\n])/, "#{ spacing }\\1" ) if first_line
- return text.gsub( /\n^([^\n])/, "\n#{spacing}\\1" )
- end
-
- #
- # Write a current indent
- #
- def indent( mod = nil )
- #p [ self.id, level, mod, :INDENT ]
- if level <= 0
- mod ||= 0
- else
- mod ||= options(:Indent)
- mod += ( level - 1 ) * options(:Indent)
- end
- return " " * mod
- end
-
- #
- # Add indent to the buffer
- #
- def indent!
- self << indent
- end
-
- #
- # Folding paragraphs within a column
- #
- def fold( value )
- value.gsub( /(^[ \t]+.*$)|(\S.{0,#{options(:BestWidth) - 1}})(?:[ \t]+|(\n+(?=[ \t]|\Z))|$)/ ) do
- $1 || $2 + ( $3 || "\n" )
- end
- end
-
- #
- # Quick mapping
- #
- def map( type, &e )
- val = Mapping.new
- e.call( val )
- self << "#{type} " if type.length.nonzero?
-
- #
- # Empty hashes
- #
- if val.length.zero?
- self << "{}"
- @seq_map = false
- else
- # FIXME
- # if @buffer.length == 1 and options(:UseHeader) == false and type.length.zero?
- # @headless = 1
- # end
-
- defkey = @options.delete( :DefaultKey )
- if defkey
- seq_map_shortcut
- self << "= : "
- defkey.to_yaml( :Emitter => self )
- end
-
- #
- # Emit the key and value
- #
- val.each { |v|
- seq_map_shortcut
- if v[0].is_complex_yaml?
- self << "? "
- end
- v[0].to_yaml( :Emitter => self )
- if v[0].is_complex_yaml?
- self << "\n"
- indent!
- end
- self << ": "
- v[1].to_yaml( :Emitter => self )
- }
- end
- end
-
- def seq_map_shortcut
- # FIXME: seq_map needs to work with the new anchoring system
- # if @seq_map
- # @anchor_extras[@buffer.length - 1] = "\n" + indent
- # @seq_map = false
- # else
- self << "\n"
- indent!
- # end
- end
-
- #
- # Quick sequence
- #
- def seq( type, &e )
- @seq_map = false
- val = Sequence.new
- e.call( val )
- self << "#{type} " if type.length.nonzero?
-
- #
- # Empty arrays
- #
- if val.length.zero?
- self << "[]"
- else
- # FIXME
- # if @buffer.length == 1 and options(:UseHeader) == false and type.length.zero?
- # @headless = 1
- # end
-
- #
- # Emit the key and value
- #
- val.each { |v|
- self << "\n"
- indent!
- self << "- "
- @seq_map = true if v.class == Hash
- v.to_yaml( :Emitter => self )
- }
- end
- end
- end
-
- #
- # Emitter helper classes
- #
- class Mapping < Array
- def add( k, v )
- push [k, v]
- end
- end
-
- class Sequence < Array
- def add( v )
- push v
- end
- end
-end
diff --git a/ext/syck/lib/syck/basenode.rb b/ext/syck/lib/syck/basenode.rb
deleted file mode 100644
index 5dc27bfdfe..0000000000
--- a/ext/syck/lib/syck/basenode.rb
+++ /dev/null
@@ -1,222 +0,0 @@
-#
-# YAML::BaseNode class
-#
-
-module Syck
-
- #
- # YAML Generic Model container
- #
- module BaseNode
-
- #
- # Search for YPath entry and return
- # qualified nodes.
- #
- def select( ypath_str )
- warn "#{caller[0]}: select is deprecated" if $VERBOSE
- matches = match_path( ypath_str )
-
- #
- # Create a new generic view of the elements selected
- #
- if matches
- result = []
- matches.each { |m|
- result.push m.last
- }
- Syck.transfer( 'seq', result )
- end
- end
-
- #
- # Search for YPath entry and return
- # transformed nodes.
- #
- def select!( ypath_str )
- warn "#{caller[0]}: select!() is deprecated" if $VERBOSE
- matches = match_path( ypath_str )
-
- #
- # Create a new generic view of the elements selected
- #
- if matches
- result = []
- matches.each { |m|
- result.push m.last.transform
- }
- result
- end
- end
-
- #
- # Search for YPath entry and return a list of
- # qualified paths.
- #
- def search( ypath_str )
- warn "#{caller[0]}: search() is deprecated" if $VERBOSE
- matches = match_path( ypath_str )
-
- if matches
- matches.collect { |m|
- path = []
- m.each_index { |i|
- path.push m[i] if ( i % 2 ).zero?
- }
- "/" + path.compact.join( "/" )
- }
- end
- end
-
- def at( seg )
- warn "#{caller[0]}: at() is deprecated" if $VERBOSE
- if Hash === @value
- self[seg]
- elsif Array === @value and seg =~ /\A\d+\Z/ and @value[seg.to_i]
- @value[seg.to_i]
- end
- end
-
- #
- # YPath search returning a complete depth array
- #
- def match_path( ypath_str )
- warn "#{caller[0]}: match_path is deprecated" if $VERBOSE
- require 'syck/ypath'
- matches = []
- YPath.each_path( ypath_str ) do |ypath|
- seg = match_segment( ypath, 0 )
- matches += seg if seg
- end
- matches.uniq
- end
-
- #
- # Search a node for a single YPath segment
- #
- def match_segment( ypath, depth )
- warn "#{caller[0]}: match_segment is deprecated" if $VERBOSE
- deep_nodes = []
- seg = ypath.segments[ depth ]
- if seg == "/"
- unless String === @value
- idx = -1
- @value.collect { |v|
- idx += 1
- if Hash === @value
- match_init = [v[0].transform, v[1]]
- match_deep = v[1].match_segment( ypath, depth )
- else
- match_init = [idx, v]
- match_deep = v.match_segment( ypath, depth )
- end
- if match_deep
- match_deep.each { |m|
- deep_nodes.push( match_init + m )
- }
- end
- }
- end
- depth += 1
- seg = ypath.segments[ depth ]
- end
- match_nodes =
- case seg
- when "."
- [[nil, self]]
- when ".."
- [["..", nil]]
- when "*"
- if @value.is_a? Enumerable
- idx = -1
- @value.collect { |h|
- idx += 1
- if Hash === @value
- [h[0].transform, h[1]]
- else
- [idx, h]
- end
- }
- end
- else
- if seg =~ /^"(.*)"$/
- seg = $1
- elsif seg =~ /^'(.*)'$/
- seg = $1
- end
- if ( v = at( seg ) )
- [[ seg, v ]]
- end
- end
- return deep_nodes unless match_nodes
- pred = ypath.predicates[ depth ]
- if pred
- case pred
- when /^\.=/
- pred = $' # '
- match_nodes.reject! { |n|
- n.last.value != pred
- }
- else
- match_nodes.reject! { |n|
- n.last.at( pred ).nil?
- }
- end
- end
- return match_nodes + deep_nodes unless ypath.segments.length > depth + 1
-
- #puts "DEPTH: #{depth + 1}"
- deep_nodes = []
- match_nodes.each { |n|
- if n[1].is_a? BaseNode
- match_deep = n[1].match_segment( ypath, depth + 1 )
- if match_deep
- match_deep.each { |m|
- deep_nodes.push( n + m )
- }
- end
- else
- deep_nodes = []
- end
- }
- deep_nodes = nil if deep_nodes.length == 0
- deep_nodes
- end
-
- #
- # We want the node to act like as Hash
- # if it is.
- #
- def []( *key )
- if Hash === @value
- v = @value.detect { |k,| k.transform == key.first }
- v[1] if v
- elsif Array === @value
- @value.[]( *key )
- end
- end
-
- def children
- if Hash === @value
- @value.values.collect { |c| c[1] }
- elsif Array === @value
- @value
- end
- end
-
- def children_with_index
- warn "#{caller[0]}: children_with_index is deprecated, use children" if $VERBOSE
- if Hash === @value
- @value.keys.collect { |i| [self[i], i] }
- elsif Array === @value
- i = -1; @value.collect { |v| i += 1; [v, i] }
- end
- end
-
- def emit
- transform.to_yaml
- end
- end
-
-end
-
diff --git a/ext/syck/lib/syck/constants.rb b/ext/syck/lib/syck/constants.rb
deleted file mode 100644
index 19fe42ef85..0000000000
--- a/ext/syck/lib/syck/constants.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# Constants used throughout the library
-#
-module Syck
-
- #
- # Constants
- #
- VERSION = '0.60'
- SUPPORTED_YAML_VERSIONS = ['1.0']
-
- #
- # Parser tokens
- #
- WORD_CHAR = 'A-Za-z0-9'
- PRINTABLE_CHAR = '-_A-Za-z0-9!?/()$\'". '
- NOT_PLAIN_CHAR = '\x7f\x0-\x1f\x80-\x9f'
- ESCAPE_CHAR = '[\\x00-\\x09\\x0b-\\x1f]'
- INDICATOR_CHAR = '*&!|\\\\^@%{}[]='
- SPACE_INDICATORS = '-#:,?'
- RESTRICTED_INDICATORS = '#:,}]'
- DNS_COMP_RE = "\\w(?:[-\\w]*\\w)?"
- DNS_NAME_RE = "(?:(?:#{DNS_COMP_RE}\\.)+#{DNS_COMP_RE}|#{DNS_COMP_RE})"
- ESCAPES = %w{\x00 \x01 \x02 \x03 \x04 \x05 \x06 \a
- \x08 \t \n \v \f \r \x0e \x0f
- \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17
- \x18 \x19 \x1a \e \x1c \x1d \x1e \x1f
- }
- UNESCAPES = {
- 'a' => "\x07", 'b' => "\x08", 't' => "\x09",
- 'n' => "\x0a", 'v' => "\x0b", 'f' => "\x0c",
- 'r' => "\x0d", 'e' => "\x1b", '\\' => '\\',
- }
-
- #
- # Default settings
- #
- DEFAULTS = {
- :Indent => 2, :UseHeader => false, :UseVersion => false, :Version => '1.0',
- :SortKeys => false, :AnchorFormat => 'id%03d', :ExplicitTypes => false,
- :WidthType => 'absolute', :BestWidth => 80,
- :UseBlock => false, :UseFold => false, :Encoding => :None
- }
-
-end
diff --git a/ext/syck/lib/syck/encoding.rb b/ext/syck/lib/syck/encoding.rb
deleted file mode 100644
index dad062994c..0000000000
--- a/ext/syck/lib/syck/encoding.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# Handle Unicode-to-Internal conversion
-#
-
-module Syck
-
- #
- # Escape the string, condensing common escapes
- #
- def self.escape( value, skip = "" )
- warn "#{caller[0]}: YAML.escape is deprecated" if $VERBOSE
- value.gsub( /\\/, "\\\\\\" ).
- gsub( /"/, "\\\"" ).
- gsub( /([\x00-\x1f])/ ) do
- skip[$&] || ESCAPES[ $&.unpack("C")[0] ]
- end
- end
-
- #
- # Unescape the condenses escapes
- #
- def self.unescape( value )
- warn "#{caller[0]}: YAML.unescape is deprecated" if $VERBOSE
- value.gsub( /\\(?:([nevfbart\\])|0?x([0-9a-fA-F]{2})|u([0-9a-fA-F]{4}))/ ) {
- if $3
- ["#$3".hex ].pack('U*')
- elsif $2
- [$2].pack( "H2" )
- else
- UNESCAPES[$1]
- end
- }
- end
-
-end
diff --git a/ext/syck/lib/syck/error.rb b/ext/syck/lib/syck/error.rb
deleted file mode 100644
index 0bac872411..0000000000
--- a/ext/syck/lib/syck/error.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# Error messages and exception class
-#
-
-module Syck
-
- #
- # Error messages
- #
-
- ERROR_NO_HEADER_NODE = "With UseHeader=false, the node Array or Hash must have elements"
- ERROR_NEED_HEADER = "With UseHeader=false, the node must be an Array or Hash"
- ERROR_BAD_EXPLICIT = "Unsupported explicit transfer: '%s'"
- ERROR_MANY_EXPLICIT = "More than one explicit transfer"
- ERROR_MANY_IMPLICIT = "More than one implicit request"
- ERROR_NO_ANCHOR = "No anchor for alias '%s'"
- ERROR_BAD_ANCHOR = "Invalid anchor: %s"
- ERROR_MANY_ANCHOR = "More than one anchor"
- ERROR_ANCHOR_ALIAS = "Can't define both an anchor and an alias"
- ERROR_BAD_ALIAS = "Invalid alias: %s"
- ERROR_MANY_ALIAS = "More than one alias"
- ERROR_ZERO_INDENT = "Can't use zero as an indentation width"
- ERROR_UNSUPPORTED_VERSION = "This release of YAML.rb does not support YAML version %s"
- ERROR_UNSUPPORTED_ENCODING = "Attempt to use unsupported encoding: %s"
-
- #
- # YAML Error classes
- #
-
- class Error < StandardError; end
- class ParseError < Error; end
- class TypeError < StandardError; end
-
-end
diff --git a/ext/syck/lib/syck/loader.rb b/ext/syck/lib/syck/loader.rb
deleted file mode 100644
index 925c9ee4b2..0000000000
--- a/ext/syck/lib/syck/loader.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# YAML::Loader class
-# .. type handling ..
-#
-module Syck
- class Loader
- TRANSFER_DOMAINS = {
- 'yaml.org,2002' => {},
- 'ruby.yaml.org,2002' => {}
- }
- PRIVATE_TYPES = {}
- IMPLICIT_TYPES = [ 'null', 'bool', 'time', 'int', 'float' ]
- end
-end
diff --git a/ext/syck/lib/syck/rubytypes.rb b/ext/syck/lib/syck/rubytypes.rb
deleted file mode 100644
index eeef156e27..0000000000
--- a/ext/syck/lib/syck/rubytypes.rb
+++ /dev/null
@@ -1,466 +0,0 @@
-# -*- mode: ruby; ruby-indent-level: 4; tab-width: 4 -*- vim: sw=4 ts=4
-require 'date'
-
-class Class
- def to_yaml( opts = {} )
- raise TypeError, "can't dump anonymous class %s" % self.class
- end
-end
-
-class Object
- yaml_as "tag:ruby.yaml.org,2002:object"
- def to_yaml_style; end
- undef to_yaml_properties rescue nil
- def to_yaml_properties; instance_variables.sort; end
- def to_yaml( opts = {} )
- YAML::quick_emit( self, opts ) do |out|
- out.map( taguri, to_yaml_style ) do |map|
- to_yaml_properties.each do |m|
- map.add( m[1..-1], instance_variable_get( m ) )
- end
- end
- end
- end
- alias :syck_to_yaml :to_yaml
-end
-
-class Hash
- yaml_as "tag:ruby.yaml.org,2002:hash"
- yaml_as "tag:yaml.org,2002:map"
- def yaml_initialize( tag, val )
- if Array === val
- update Hash.[]( *val ) # Convert the map to a sequence
- elsif Hash === val
- update val
- else
- raise YAML::TypeError, "Invalid map explicitly tagged #{ tag }: " + val.inspect
- end
- end
- def to_yaml( opts = {} )
- return super unless YAML::ENGINE.syck?
- YAML::quick_emit( self, opts ) do |out|
- out.map( taguri, to_yaml_style ) do |map|
- each do |k, v|
- map.add( k, v )
- end
- end
- end
- end
-end
-
-class Struct
- yaml_as "tag:ruby.yaml.org,2002:struct"
- def self.yaml_tag_class_name; self.name.gsub( "Struct::", "" ); end
- def self.yaml_tag_read_class( name ); "Struct::#{ name }"; end
- def self.yaml_new( klass, tag, val )
- if Hash === val
- struct_type = nil
-
- #
- # Use existing Struct if it exists
- #
- props = {}
- val.delete_if { |k,v| props[k] = v if k =~ /^@/ }
- begin
- struct_type = YAML.read_type_class( tag, Struct ).last
- rescue NameError
- end
- if not struct_type
- struct_def = [ tag.split( ':', 4 ).last ]
- struct_type = Struct.new( *struct_def.concat( val.keys.collect { |k| k.intern } ) )
- end
-
- #
- # Set the Struct properties
- #
- st = YAML::object_maker( struct_type, {} )
- st.members.each do |m|
- st.send( "#{m}=", val[m.to_s] )
- end
- props.each do |k,v|
- st.instance_variable_set(k, v)
- end
- st
- else
- raise YAML::TypeError, "Invalid Ruby Struct: " + val.inspect
- end
- end
- def to_yaml( opts = {} )
- return super unless YAML::ENGINE.syck?
- YAML::quick_emit( self, opts ) do |out|
- #
- # Basic struct is passed as a YAML map
- #
- out.map( taguri, to_yaml_style ) do |map|
- self.members.each do |m|
- map.add( m.to_s, self[m.to_s] )
- end
- self.to_yaml_properties.each do |m|
- map.add( m, instance_variable_get( m ) )
- end
- end
- end
- end
-end
-
-class Array
- yaml_as "tag:ruby.yaml.org,2002:array"
- yaml_as "tag:yaml.org,2002:seq"
- def yaml_initialize( tag, val ); concat( val.to_a ); end
- def to_yaml( opts = {} )
- return super unless YAML::ENGINE.syck?
- YAML::quick_emit( self, opts ) do |out|
- out.seq( taguri, to_yaml_style ) do |seq|
- each do |x|
- seq.add( x )
- end
- end
- end
- end
-end
-
-class Exception
- yaml_as "tag:ruby.yaml.org,2002:exception"
- def Exception.yaml_new( klass, tag, val )
- o = YAML.object_maker( klass, { 'mesg' => val.delete( 'message' ) } )
- val.each_pair do |k,v|
- o.instance_variable_set("@#{k}", v)
- end
- o
- end
- def to_yaml( opts = {} )
- return super unless YAML::ENGINE.syck?
- YAML::quick_emit( self, opts ) do |out|
- out.map( taguri, to_yaml_style ) do |map|
- map.add( 'message', message )
- to_yaml_properties.each do |m|
- map.add( m[1..-1], instance_variable_get( m ) )
- end
- end
- end
- end
-end
-
-class String
- yaml_as "tag:ruby.yaml.org,2002:string"
- yaml_as "tag:yaml.org,2002:binary"
- yaml_as "tag:yaml.org,2002:str"
- def is_complex_yaml?
- to_yaml_style or not to_yaml_properties.empty? or self =~ /\n.+/
- end
- def is_binary_data?
- self.count("\x00-\x7F", "^ -~\t\r\n").fdiv(self.size) > 0.3 || self.index("\x00") unless self.empty?
- end
- def String.yaml_new( klass, tag, val )
- val = val.unpack("m")[0] if tag == "tag:yaml.org,2002:binary"
- val = { 'str' => val } if String === val
- if Hash === val
- s = klass.allocate
- # Thank you, NaHi
- String.instance_method(:initialize).
- bind(s).
- call( val.delete( 'str' ) )
- val.each { |k,v| s.instance_variable_set( k, v ) }
- s
- else
- raise YAML::TypeError, "Invalid String: " + val.inspect
- end
- end
- def to_yaml( opts = {} )
- return super unless YAML::ENGINE.syck?
- YAML::quick_emit( is_complex_yaml? ? self : nil, opts ) do |out|
- if is_binary_data?
- out.scalar( "tag:yaml.org,2002:binary", [self].pack("m"), :literal )
- elsif to_yaml_properties.empty?
- out.scalar( taguri, self, self =~ /^:/ ? :quote2 : to_yaml_style )
- else
- out.map( taguri, to_yaml_style ) do |map|
- map.add( 'str', "#{self}" )
- to_yaml_properties.each do |m|
- map.add( m, instance_variable_get( m ) )
- end
- end
- end
- end
- end
-end
-
-class Symbol
- yaml_as "tag:ruby.yaml.org,2002:symbol"
- yaml_as "tag:ruby.yaml.org,2002:sym"
- def Symbol.yaml_new( klass, tag, val )
- if String === val
- val = YAML::load( val ) if val =~ /\A(["']).*\1\z/
- val.intern
- else
- raise YAML::TypeError, "Invalid Symbol: " + val.inspect
- end
- end
- def to_yaml( opts = {} )
- return super unless YAML::ENGINE.syck?
- YAML::quick_emit( nil, opts ) do |out|
- out.scalar( "tag:yaml.org,2002:str", self.inspect, :plain )
- end
- end
-end
-
-class Range
- yaml_as "tag:ruby.yaml.org,2002:range"
- def Range.yaml_new( klass, tag, val )
- inr = %r'(\w+|[+-]?\d+(?:\.\d+)?(?:e[+-]\d+)?|"(?:[^\\"]|\\.)*")'
- opts = {}
- if String === val and val =~ /^#{inr}(\.{2,3})#{inr}$/o
- r1, rdots, r2 = $1, $2, $3
- opts = {
- 'begin' => YAML.load( "--- #{r1}" ),
- 'end' => YAML.load( "--- #{r2}" ),
- 'excl' => rdots.length == 3
- }
- val = {}
- elsif Hash === val
- opts['begin'] = val.delete('begin')
- opts['end'] = val.delete('end')
- opts['excl'] = val.delete('excl')
- end
- if Hash === opts
- r = YAML::object_maker( klass, {} )
- # Thank you, NaHi
- Range.instance_method(:initialize).
- bind(r).
- call( opts['begin'], opts['end'], opts['excl'] )
- val.each { |k,v| r.instance_variable_set( k, v ) }
- r
- else
- raise YAML::TypeError, "Invalid Range: " + val.inspect
- end
- end
- def to_yaml( opts = {} )
- return super unless YAML::ENGINE.syck?
- YAML::quick_emit( self, opts ) do |out|
- # if self.begin.is_complex_yaml? or self.begin.respond_to? :to_str or
- # self.end.is_complex_yaml? or self.end.respond_to? :to_str or
- # not to_yaml_properties.empty?
- out.map( taguri, to_yaml_style ) do |map|
- map.add( 'begin', self.begin )
- map.add( 'end', self.end )
- map.add( 'excl', self.exclude_end? )
- to_yaml_properties.each do |m|
- map.add( m, instance_variable_get( m ) )
- end
- end
- # else
- # out.scalar( taguri ) do |sc|
- # sc.embed( self.begin )
- # sc.concat( self.exclude_end? ? "..." : ".." )
- # sc.embed( self.end )
- # end
- # end
- end
- end
-end
-
-class Regexp
- yaml_as "tag:ruby.yaml.org,2002:regexp"
- def Regexp.yaml_new( klass, tag, val )
- if String === val and val =~ /^\/(.*)\/([mixn]*)$/
- val = { 'regexp' => $1, 'mods' => $2 }
- end
- if Hash === val
- mods = nil
- unless val['mods'].to_s.empty?
- mods = 0x00
- mods |= Regexp::EXTENDED if val['mods'].include?( 'x' )
- mods |= Regexp::IGNORECASE if val['mods'].include?( 'i' )
- mods |= Regexp::MULTILINE if val['mods'].include?( 'm' )
- mods |= Regexp::NOENCODING if val['mods'].include?( 'n' )
- end
- val.delete( 'mods' )
- r = YAML::object_maker( klass, {} )
- Regexp.instance_method(:initialize).
- bind(r).
- call( val.delete( 'regexp' ), mods )
- val.each { |k,v| r.instance_variable_set( k, v ) }
- r
- else
- raise YAML::TypeError, "Invalid Regular expression: " + val.inspect
- end
- end
- def to_yaml( opts = {} )
- return super unless YAML::ENGINE.syck?
- YAML::quick_emit( nil, opts ) do |out|
- if to_yaml_properties.empty?
- out.scalar( taguri, self.inspect, :plain )
- else
- out.map( taguri, to_yaml_style ) do |map|
- src = self.inspect
- if src =~ /\A\/(.*)\/([a-z]*)\Z/
- map.add( 'regexp', $1 )
- map.add( 'mods', $2 )
- else
- raise YAML::TypeError, "Invalid Regular expression: " + src
- end
- to_yaml_properties.each do |m|
- map.add( m, instance_variable_get( m ) )
- end
- end
- end
- end
- end
-end
-
-class Time
- yaml_as "tag:ruby.yaml.org,2002:time"
- yaml_as "tag:yaml.org,2002:timestamp"
- def Time.yaml_new( klass, tag, val )
- if Hash === val
- t = val.delete( 'at' )
- val.each { |k,v| t.instance_variable_set( k, v ) }
- t
- else
- raise YAML::TypeError, "Invalid Time: " + val.inspect
- end
- end
- def to_yaml( opts = {} )
- return super unless YAML::ENGINE.syck?
- YAML::quick_emit( self, opts ) do |out|
- tz = "Z"
- # from the tidy Tobias Peters <t-peters@gmx.de> Thanks!
- unless self.utc?
- utc_same_instant = self.dup.utc
- utc_same_writing = Time.utc(year,month,day,hour,min,sec,usec)
- difference_to_utc = utc_same_writing - utc_same_instant
- if (difference_to_utc < 0)
- difference_sign = '-'
- absolute_difference = -difference_to_utc
- else
- difference_sign = '+'
- absolute_difference = difference_to_utc
- end
- difference_minutes = (absolute_difference/60).round
- tz = "%s%02d:%02d" % [ difference_sign, difference_minutes / 60, difference_minutes % 60]
- end
- standard = self.strftime( "%Y-%m-%d %H:%M:%S" )
- standard += ".%06d" % [usec] if usec.nonzero?
- standard += " %s" % [tz]
- if to_yaml_properties.empty?
- out.scalar( taguri, standard, :plain )
- else
- out.map( taguri, to_yaml_style ) do |map|
- map.add( 'at', standard )
- to_yaml_properties.each do |m|
- map.add( m, instance_variable_get( m ) )
- end
- end
- end
- end
- end
-end
-
-class Date
- yaml_as "tag:yaml.org,2002:timestamp#ymd"
- def to_yaml( opts = {} )
- return super unless YAML::ENGINE.syck?
- YAML::quick_emit( self, opts ) do |out|
- out.scalar( "tag:yaml.org,2002:timestamp", self.to_s, :plain )
- end
- end
-end
-
-class Integer
- yaml_as "tag:yaml.org,2002:int"
- def to_yaml( opts = {} )
- return super unless YAML::ENGINE.syck?
- YAML::quick_emit( nil, opts ) do |out|
- out.scalar( "tag:yaml.org,2002:int", self.to_s, :plain )
- end
- end
-end
-
-class Float
- yaml_as "tag:yaml.org,2002:float"
- def to_yaml( opts = {} )
- return super unless YAML::ENGINE.syck?
- YAML::quick_emit( nil, opts ) do |out|
- str = self.to_s
- if str == "Infinity"
- str = ".Inf"
- elsif str == "-Infinity"
- str = "-.Inf"
- elsif str == "NaN"
- str = ".NaN"
- end
- out.scalar( "tag:yaml.org,2002:float", str, :plain )
- end
- end
-end
-
-class Rational
- yaml_as "tag:ruby.yaml.org,2002:object:Rational"
- def Rational.yaml_new( klass, tag, val )
- if val.is_a? String
- Rational( val )
- else
- Rational( val['numerator'], val['denominator'] )
- end
- end
- def to_yaml( opts = {} )
- return super unless YAML::ENGINE.syck?
- YAML::quick_emit( self, opts ) do |out|
- out.map( taguri, nil ) do |map|
- map.add( 'denominator', denominator )
- map.add( 'numerator', numerator )
- end
- end
- end
-end
-
-class Complex
- yaml_as "tag:ruby.yaml.org,2002:object:Complex"
- def Complex.yaml_new( klass, tag, val )
- if val.is_a? String
- Complex( val )
- else
- Complex( val['real'], val['image'] )
- end
- end
- def to_yaml( opts = {} )
- return super unless YAML::ENGINE.syck?
- YAML::quick_emit( self, opts ) do |out|
- out.map( taguri, nil ) do |map|
- map.add( 'image', imaginary )
- map.add( 'real', real )
- end
- end
- end
-end
-
-class TrueClass
- yaml_as "tag:yaml.org,2002:bool#yes"
- def to_yaml( opts = {} )
- return super unless YAML::ENGINE.syck?
- YAML::quick_emit( nil, opts ) do |out|
- out.scalar( taguri, "true", :plain )
- end
- end
-end
-
-class FalseClass
- yaml_as "tag:yaml.org,2002:bool#no"
- def to_yaml( opts = {} )
- return super unless YAML::ENGINE.syck?
- YAML::quick_emit( nil, opts ) do |out|
- out.scalar( taguri, "false", :plain )
- end
- end
-end
-
-class NilClass
- yaml_as "tag:yaml.org,2002:null"
- def to_yaml( opts = {} )
- return super unless YAML::ENGINE.syck?
- YAML::quick_emit( nil, opts ) do |out|
- out.scalar( taguri, "", :plain )
- end
- end
-end
-
diff --git a/ext/syck/lib/syck/stream.rb b/ext/syck/lib/syck/stream.rb
deleted file mode 100644
index cd77a033c6..0000000000
--- a/ext/syck/lib/syck/stream.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-module Syck
-
- #
- # YAML::Stream -- for emitting many documents
- #
- class Stream
-
- attr_accessor :documents, :options
-
- def initialize( opts = {} )
- @options = opts
- @documents = []
- end
-
- def []( i )
- @documents[ i ]
- end
-
- def add( doc )
- @documents << doc
- end
-
- def edit( doc_num, doc )
- warn "#{caller[0]}: edit is deprecated" if $VERBOSE
- @documents[ doc_num ] = doc
- end
-
- def emit( io = nil )
- # opts = @options.dup
- # opts[:UseHeader] = true if @documents.length > 1
- out = Syck.emitter
- out.reset( io || io2 = StringIO.new )
- @documents.each { |v|
- v.to_yaml( out )
- }
- io || ( io2.rewind; io2.read )
- end
-
- end
-
-end
diff --git a/ext/syck/lib/syck/stringio.rb b/ext/syck/lib/syck/stringio.rb
deleted file mode 100644
index 77a2b827e5..0000000000
--- a/ext/syck/lib/syck/stringio.rb
+++ /dev/null
@@ -1,85 +0,0 @@
-warn "#{caller[0]}: yaml/stringio is deprecated" if $VERBOSE
-
-#
-# Limited StringIO if no core lib is available
-#
-begin
-require 'stringio'
-rescue LoadError
- # StringIO based on code by MoonWolf
- class StringIO
- def initialize(string="")
- @string=string
- @pos=0
- @eof=(string.size==0)
- end
- def pos
- @pos
- end
- def eof
- @eof
- end
- alias eof? eof
- def readline(rs=$/)
- if @eof
- raise EOFError
- else
- if p = @string[@pos..-1]=~rs
- line = @string[@pos,p+1]
- else
- line = @string[@pos..-1]
- end
- @pos+=line.size
- @eof =true if @pos==@string.size
- $_ = line
- end
- end
- def rewind
- seek(0,0)
- end
- def seek(offset,whence)
- case whence
- when 0
- @pos=offset
- when 1
- @pos+=offset
- when 2
- @pos=@string.size+offset
- end
- @eof=(@pos>=@string.size)
- 0
- end
- end
-
- #
- # Class method for creating streams
- #
- def Syck.make_stream( io )
- if String === io
- io = StringIO.new( io )
- elsif not IO === io
- raise Syck::Error, "YAML stream must be an IO or String object."
- end
- if Syck::unicode
- def io.readline
- Syck.utf_to_internal( readline( @ln_sep ), @utf_encoding )
- end
- def io.check_unicode
- @utf_encoding = Syck.sniff_encoding( read( 4 ) )
- @ln_sep = Syck.enc_separator( @utf_encoding )
- seek( -4, IO::SEEK_CUR )
- end
- def io.utf_encoding
- @utf_encoding
- end
- io.check_unicode
- else
- def io.utf_encoding
- :None
- end
- end
- io
- end
-
-end
-
diff --git a/ext/syck/lib/syck/syck.rb b/ext/syck/lib/syck/syck.rb
deleted file mode 100644
index 10e5023f46..0000000000
--- a/ext/syck/lib/syck/syck.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# YAML::Syck module
-# .. glues syck and yaml.rb together ..
-#
-require 'syck/basenode'
-
-module Syck
-
- #
- # Mixin BaseNode functionality
- #
- class Node
- include Syck::BaseNode
- end
-
-end
diff --git a/ext/syck/lib/syck/tag.rb b/ext/syck/lib/syck/tag.rb
deleted file mode 100644
index 9c6de57953..0000000000
--- a/ext/syck/lib/syck/tag.rb
+++ /dev/null
@@ -1,95 +0,0 @@
-# -*- mode: ruby; ruby-indent-level: 4; tab-width: 4 -*- vim: sw=4 ts=4
-# $Id$
-#
-# = yaml/tag.rb: methods for associating a taguri to a class.
-#
-# Author:: why the lucky stiff
-#
-module Syck
- # A dictionary of taguris which map to
- # Ruby classes.
- @@tagged_classes = {}
-
- #
- # Associates a taguri _tag_ with a Ruby class _cls_. The taguri is used to give types
- # to classes when loading YAML. Taguris are of the form:
- #
- # tag:authorityName,date:specific
- #
- # The +authorityName+ is a domain name or email address. The +date+ is the date the type
- # was issued in YYYY or YYYY-MM or YYYY-MM-DD format. The +specific+ is a name for
- # the type being added.
- #
- # For example, built-in YAML types have 'yaml.org' as the +authorityName+ and '2002' as the
- # +date+. The +specific+ is simply the name of the type:
- #
- # tag:yaml.org,2002:int
- # tag:yaml.org,2002:float
- # tag:yaml.org,2002:timestamp
- #
- # The domain must be owned by you on the +date+ declared. If you don't own any domains on the
- # date you declare the type, you can simply use an e-mail address.
- #
- # tag:why@ruby-lang.org,2004:notes/personal
- #
- def self.tag_class( tag, cls )
- if @@tagged_classes.has_key? tag
- warn "class #{ @@tagged_classes[tag] } held ownership of the #{ tag } tag"
- end
- @@tagged_classes[tag] = cls
- end
-
- # Returns the complete dictionary of taguris, paired with classes. The key for
- # the dictionary is the full taguri. The value for each key is the class constant
- # associated to that taguri.
- #
- # YAML.tagged_classes["tag:yaml.org,2002:int"] => Integer
- #
- def self.tagged_classes
- @@tagged_classes
- end
-end
-
-class Module
- # :stopdoc:
-
- # Adds a taguri _tag_ to a class, used when dumping or loading the class
- # in YAML. See YAML::tag_class for detailed information on typing and
- # taguris.
- def syck_yaml_as( tag, sc = true )
- verbose, $VERBOSE = $VERBOSE, nil
- class_eval <<-"END", __FILE__, __LINE__+1
- attr_writer :taguri
- def taguri
- if respond_to? :to_yaml_type
- Syck.tagurize( to_yaml_type[1..-1] )
- else
- return @taguri if defined?(@taguri) and @taguri
- tag = #{ tag.dump }
- if self.class.yaml_tag_subclasses? and self.class != Syck.tagged_classes[tag]
- tag = "\#{ tag }:\#{ self.class.yaml_tag_class_name }"
- end
- tag
- end
- end
- def self.yaml_tag_subclasses?; #{ sc ? 'true' : 'false' }; end
- END
- Syck.tag_class tag, self
- ensure
- $VERBOSE = verbose
- end
- remove_method :yaml_as rescue nil
- alias :yaml_as :syck_yaml_as
-
- # Transforms the subclass name into a name suitable for display
- # in a subclassed tag.
- def yaml_tag_class_name
- self.name
- end
- # Transforms the subclass name found in the tag into a Ruby
- # constant name.
- def yaml_tag_read_class( name )
- name
- end
- # :startdoc:
-end
diff --git a/ext/syck/lib/syck/types.rb b/ext/syck/lib/syck/types.rb
deleted file mode 100644
index 5c129acba4..0000000000
--- a/ext/syck/lib/syck/types.rb
+++ /dev/null
@@ -1,192 +0,0 @@
-# -*- mode: ruby; ruby-indent-level: 4 -*- vim: sw=4
-#
-# Classes required by the full core typeset
-#
-
-module Syck
-
- #
- # Default private type
- #
- class PrivateType
- def self.tag_subclasses?; false; end
- verbose, $VERBOSE = $VERBOSE, nil
- def initialize( type, val )
- @type_id = type; @value = val
- @value.taguri = "x-private:#{ @type_id }"
- end
- def to_yaml( opts = {} )
- @value.to_yaml( opts )
- end
- ensure
- $VERBOSE = verbose
- end
-
- #
- # Default domain type
- #
- class DomainType
- def self.tag_subclasses?; false; end
- verbose, $VERBOSE = $VERBOSE, nil
- def initialize( domain, type, val )
- @domain = domain; @type_id = type; @value = val
- @value.taguri = "tag:#{ @domain }:#{ @type_id }"
- end
- def to_yaml( opts = {} )
- @value.to_yaml( opts )
- end
- ensure
- $VERBOSE = verbose
- end
-
- #
- # Unresolved objects
- #
- class Object
- def self.tag_subclasses?; false; end
- def to_yaml( opts = {} )
- Syck.quick_emit( self, opts ) do |out|
- out.map( "tag:ruby.yaml.org,2002:object:#{ @class }", to_yaml_style ) do |map|
- @ivars.each do |k,v|
- map.add( k, v )
- end
- end
- end
- end
- end
-
- #
- # YAML Hash class to support comments and defaults
- #
- class SpecialHash < ::Hash
- attr_accessor :default
- def inspect
- self.default.to_s
- end
- def to_s
- self.default.to_s
- end
- def update( h )
- if Syck::SpecialHash === h
- @default = h.default if h.default
- end
- super( h )
- end
- def to_yaml( opts = {} )
- opts[:DefaultKey] = self.default
- super( opts )
- end
- end
-
- #
- # Builtin collection: !omap
- #
- class Omap < ::Array
- yaml_as "tag:yaml.org,2002:omap"
- def yaml_initialize( tag, val )
- if Array === val
- val.each do |v|
- if Hash === v
- concat( v.to_a ) # Convert the map to a sequence
- else
- raise Syck::Error, "Invalid !omap entry: " + val.inspect
- end
- end
- else
- raise Syck::Error, "Invalid !omap: " + val.inspect
- end
- self
- end
- def self.[]( *vals )
- o = Omap.new
- 0.step( vals.length - 1, 2 ) do |i|
- o[vals[i]] = vals[i+1]
- end
- o
- end
- def []( k )
- self.assoc( k ).to_a[1]
- end
- def []=( k, *rest )
- val, set = rest.reverse
- if ( tmp = self.assoc( k ) ) and not set
- tmp[1] = val
- else
- self << [ k, val ]
- end
- val
- end
- def has_key?( k )
- self.assoc( k ) ? true : false
- end
- def is_complex_yaml?
- true
- end
- def to_yaml( opts = {} )
- Syck.quick_emit( self, opts ) do |out|
- out.seq( taguri, to_yaml_style ) do |seq|
- self.each do |v|
- seq.add( Hash[ *v ] )
- end
- end
- end
- end
- end
-
- #
- # Builtin collection: !pairs
- #
- class Pairs < ::Array
- yaml_as "tag:yaml.org,2002:pairs"
- def yaml_initialize( tag, val )
- if Array === val
- val.each do |v|
- if Hash === v
- concat( v.to_a ) # Convert the map to a sequence
- else
- raise Syck::Error, "Invalid !pairs entry: " + val.inspect
- end
- end
- else
- raise Syck::Error, "Invalid !pairs: " + val.inspect
- end
- self
- end
- def self.[]( *vals )
- p = Pairs.new
- 0.step( vals.length - 1, 2 ) { |i|
- p[vals[i]] = vals[i+1]
- }
- p
- end
- def []( k )
- self.assoc( k ).to_a
- end
- def []=( k, val )
- self << [ k, val ]
- val
- end
- def has_key?( k )
- self.assoc( k ) ? true : false
- end
- def is_complex_yaml?
- true
- end
- def to_yaml( opts = {} )
- Syck.quick_emit( self, opts ) do |out|
- out.seq( taguri, to_yaml_style ) do |seq|
- self.each do |v|
- seq.add( Hash[ *v ] )
- end
- end
- end
- end
- end
-
- #
- # Builtin collection: !set
- #
- class Set < ::Hash
- yaml_as "tag:yaml.org,2002:set"
- end
-end
diff --git a/ext/syck/lib/syck/yamlnode.rb b/ext/syck/lib/syck/yamlnode.rb
deleted file mode 100644
index 2fa57b1f97..0000000000
--- a/ext/syck/lib/syck/yamlnode.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# YAML::YamlNode class
-#
-require 'syck/basenode'
-
-module Syck
-
- #
- # YAML Generic Model container
- #
- class YamlNode
- include BaseNode
- attr_accessor :kind, :type_id, :value, :anchor
- def initialize(t, v)
- @type_id = t
- if Hash === v
- @kind = 'map'
- @value = {}
- v.each {|key,val|
- @value[key.transform] = [key, val]
- }
- elsif Array === v
- @kind = 'seq'
- @value = v
- elsif String === v
- @kind = 'scalar'
- @value = v
- end
- end
-
- #
- # Transform this node fully into a native type
- #
- def transform
- t = nil
- if @value.is_a? Hash
- t = {}
- @value.each { |k,v|
- t[ k ] = v[1].transform
- }
- elsif @value.is_a? Array
- t = []
- @value.each { |v|
- t.push v.transform
- }
- else
- t = @value
- end
- Syck.transfer_method( @type_id, t )
- end
-
- end
-
-end
diff --git a/ext/syck/lib/syck/ypath.rb b/ext/syck/lib/syck/ypath.rb
deleted file mode 100644
index 024dcb7f4e..0000000000
--- a/ext/syck/lib/syck/ypath.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# YAML::YPath
-#
-
-warn "#{caller[0]}: YAML::YPath is deprecated" if $VERBOSE
-
-module Syck
-
- class YPath
- attr_accessor :segments, :predicates, :flags
- def initialize( str )
- @segments = []
- @predicates = []
- @flags = nil
- while str =~ /^\/?(\/|[^\/\[]+)(?:\[([^\]]+)\])?/
- @segments.push $1
- @predicates.push $2
- str = $'
- end
- unless str.to_s.empty?
- @segments += str.split( "/" )
- end
- if @segments.length == 0
- @segments.push "."
- end
- end
- def self.each_path( str )
- #
- # Find choices
- #
- paths = []
- str = "(#{ str })"
- while str.sub!( /\(([^()]+)\)/, "\n#{ paths.length }\n" )
- paths.push $1.split( '|' )
- end
-
- #
- # Construct all possible paths
- #
- all = [ str ]
- ( paths.length - 1 ).downto( 0 ) do |i|
- all = all.collect do |a|
- paths[i].collect do |p|
- a.gsub( /\n#{ i }\n/, p )
- end
- end.flatten.uniq
- end
- all.collect do |path|
- yield YPath.new( path )
- end
- end
- end
-
-end
diff --git a/ext/syck/lib/yaml/syck.rb b/ext/syck/lib/yaml/syck.rb
deleted file mode 100644
index 5b5d1c494e..0000000000
--- a/ext/syck/lib/yaml/syck.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# $Id$
-#
-# = yaml/syck.rb:
-#
-
-require 'stringio'
-require 'syck.so'
-require 'syck/error'
-require 'syck/syck'
-require 'syck/tag'
-require 'syck/stream'
-require 'syck/constants'
-require 'syck/rubytypes'
-require 'syck/types'
diff --git a/ext/syck/node.c b/ext/syck/node.c
deleted file mode 100644
index 35c1f45150..0000000000
--- a/ext/syck/node.c
+++ /dev/null
@@ -1,407 +0,0 @@
-/*
- * node.c
- *
- * $Author$
- *
- * Copyright (C) 2003 why the lucky stiff
- */
-
-#include "ruby/ruby.h"
-#include "syck.h"
-
-/*
- * Node allocation functions
- */
-SyckNode *
-syck_alloc_node( enum syck_kind_tag type )
-{
- SyckNode *s;
-
- s = S_ALLOC( SyckNode );
- s->kind = type;
- s->id = 0;
- s->type_id = NULL;
- s->anchor = NULL;
- s->shortcut = NULL;
-
- return s;
-}
-
-void
-syck_free_node( SyckNode *n )
-{
- syck_free_members( n );
- if ( n->type_id != NULL )
- {
- S_FREE( n->type_id );
- n->type_id = NULL;
- }
- if ( n->anchor != NULL )
- {
- S_FREE( n->anchor );
- n->anchor = NULL;
- }
- S_FREE( n );
-}
-
-SyckNode *
-syck_alloc_map(void)
-{
- SyckNode *n;
- struct SyckMap *m;
-
- m = S_ALLOC( struct SyckMap );
- m->style = map_none;
- m->idx = 0;
- m->capa = ALLOC_CT;
- m->keys = S_ALLOC_N( SYMID, m->capa );
- m->values = S_ALLOC_N( SYMID, m->capa );
-
- n = syck_alloc_node( syck_map_kind );
- n->data.pairs = m;
-
- return n;
-}
-
-SyckNode *
-syck_alloc_seq(void)
-{
- SyckNode *n;
- struct SyckSeq *s;
-
- s = S_ALLOC( struct SyckSeq );
- s->style = seq_none;
- s->idx = 0;
- s->capa = ALLOC_CT;
- s->items = S_ALLOC_N( SYMID, s->capa );
-
- n = syck_alloc_node( syck_seq_kind );
- n->data.list = s;
-
- return n;
-}
-
-SyckNode *
-syck_alloc_str(void)
-{
- SyckNode *n;
- struct SyckStr *s;
-
- s = S_ALLOC( struct SyckStr );
- s->len = 0;
- s->ptr = NULL;
- s->style = scalar_none;
-
- n = syck_alloc_node( syck_str_kind );
- n->data.str = s;
-
- return n;
-}
-
-SyckNode *
-syck_new_str( const char *str, enum scalar_style style )
-{
- return syck_new_str2( str, strlen( str ), style );
-}
-
-SyckNode *
-syck_new_str2( const char *str, long len, enum scalar_style style )
-{
- SyckNode *n;
-
- n = syck_alloc_str();
- n->data.str->ptr = S_ALLOC_N( char, len + 1 );
- n->data.str->len = len;
- n->data.str->style = style;
- memcpy( n->data.str->ptr, str, len );
- n->data.str->ptr[len] = '\0';
-
- return n;
-}
-
-void
-syck_replace_str( SyckNode *n, char *str, enum scalar_style style )
-{
- syck_replace_str2( n, str, strlen( str ), style );
-}
-
-void
-syck_replace_str2( SyckNode *n, char *str, long len, enum scalar_style style )
-{
- if ( n->data.str->ptr != NULL )
- {
- S_FREE( n->data.str->ptr );
- n->data.str->ptr = NULL;
- n->data.str->len = 0;
- }
- n->data.str->ptr = S_ALLOC_N( char, len + 1 );
- n->data.str->len = len;
- n->data.str->style = style;
- memcpy( n->data.str->ptr, str, len );
- n->data.str->ptr[len] = '\0';
-}
-
-void
-syck_str_blow_away_commas( SyckNode *n )
-{
- char *go, *end;
-
- go = n->data.str->ptr;
- end = go + n->data.str->len;
- while ( *(++go) != '\0' )
- {
- if ( *go == ',' )
- {
- n->data.str->len -= 1;
- memmove( go, go + 1, end - go );
- end -= 1;
- }
- }
-}
-
-char *
-syck_str_read( SyckNode *n )
-{
- ASSERT( n != NULL );
- return n->data.str->ptr;
-}
-
-SyckNode *
-syck_new_map( SYMID key, SYMID value )
-{
- SyckNode *n;
-
- n = syck_alloc_map();
- syck_map_add( n, key, value );
-
- return n;
-}
-
-void
-syck_map_empty( SyckNode *n )
-{
- struct SyckMap *m;
- ASSERT( n != NULL );
- ASSERT( n->data.list != NULL );
-
- S_FREE( n->data.pairs->keys );
- S_FREE( n->data.pairs->values );
- m = n->data.pairs;
- m->idx = 0;
- m->capa = ALLOC_CT;
- m->keys = S_ALLOC_N( SYMID, m->capa );
- m->values = S_ALLOC_N( SYMID, m->capa );
-}
-
-void
-syck_map_add( SyckNode *map, SYMID key, SYMID value )
-{
- struct SyckMap *m;
- long idx;
-
- ASSERT( map != NULL );
- ASSERT( map->data.pairs != NULL );
-
- m = map->data.pairs;
- idx = m->idx;
- m->idx += 1;
- if ( m->idx > m->capa )
- {
- m->capa += ALLOC_CT;
- S_REALLOC_N( m->keys, SYMID, m->capa );
- S_REALLOC_N( m->values, SYMID, m->capa );
- }
- m->keys[idx] = key;
- m->values[idx] = value;
-}
-
-void
-syck_map_update( SyckNode *map1, SyckNode *map2 )
-{
- struct SyckMap *m1, *m2;
- long new_idx, new_capa;
- ASSERT( map1 != NULL );
- ASSERT( map2 != NULL );
-
- m1 = map1->data.pairs;
- m2 = map2->data.pairs;
- if ( m2->idx < 1 ) return;
-
- new_idx = m1->idx;
- new_idx += m2->idx;
- new_capa = m1->capa;
- while ( new_idx > new_capa )
- {
- new_capa += ALLOC_CT;
- }
- if ( new_capa > m1->capa )
- {
- m1->capa = new_capa;
- S_REALLOC_N( m1->keys, SYMID, m1->capa );
- S_REALLOC_N( m1->values, SYMID, m1->capa );
- }
- for ( new_idx = 0; new_idx < m2->idx; m1->idx++, new_idx++ )
- {
- m1->keys[m1->idx] = m2->keys[new_idx];
- m1->values[m1->idx] = m2->values[new_idx];
- }
-}
-
-long
-syck_map_count( SyckNode *map )
-{
- ASSERT( map != NULL );
- ASSERT( map->data.pairs != NULL );
- return map->data.pairs->idx;
-}
-
-void
-syck_map_assign( SyckNode *map, enum map_part p, long idx, SYMID id )
-{
- struct SyckMap *m;
-
- ASSERT( map != NULL );
- m = map->data.pairs;
- ASSERT( m != NULL );
- if ( p == map_key )
- {
- m->keys[idx] = id;
- }
- else
- {
- m->values[idx] = id;
- }
-}
-
-SYMID
-syck_map_read( SyckNode *map, enum map_part p, long idx )
-{
- struct SyckMap *m;
-
- ASSERT( map != NULL );
- m = map->data.pairs;
- ASSERT( m != NULL );
- if ( p == map_key )
- {
- return m->keys[idx];
- }
- else
- {
- return m->values[idx];
- }
-}
-
-SyckNode *
-syck_new_seq( SYMID value )
-{
- SyckNode *n;
-
- n = syck_alloc_seq();
- syck_seq_add( n, value );
-
- return n;
-}
-
-void
-syck_seq_empty( SyckNode *n )
-{
- struct SyckSeq *s;
- ASSERT( n != NULL );
- ASSERT( n->data.list != NULL );
-
- S_FREE( n->data.list->items );
- s = n->data.list;
- s->idx = 0;
- s->capa = ALLOC_CT;
- s->items = S_ALLOC_N( SYMID, s->capa );
-}
-
-void
-syck_seq_add( SyckNode *arr, SYMID value )
-{
- struct SyckSeq *s;
- long idx;
-
- ASSERT( arr != NULL );
- ASSERT( arr->data.list != NULL );
-
- s = arr->data.list;
- idx = s->idx;
- s->idx += 1;
- if ( s->idx > s->capa )
- {
- s->capa += ALLOC_CT;
- S_REALLOC_N( s->items, SYMID, s->capa );
- }
- s->items[idx] = value;
-}
-
-long
-syck_seq_count( SyckNode *seq )
-{
- ASSERT( seq != NULL );
- ASSERT( seq->data.list != NULL );
- return seq->data.list->idx;
-}
-
-void
-syck_seq_assign( SyckNode *seq, long idx, SYMID id )
-{
- struct SyckSeq *s;
-
- ASSERT( map != NULL );
- s = seq->data.list;
- ASSERT( m != NULL );
- s->items[idx] = id;
-}
-
-SYMID
-syck_seq_read( SyckNode *seq, long idx )
-{
- struct SyckSeq *s;
-
- ASSERT( seq != NULL );
- s = seq->data.list;
- ASSERT( s != NULL );
- return s->items[idx];
-}
-
-void
-syck_free_members( SyckNode *n )
-{
- if ( n == NULL ) return;
-
- switch ( n->kind )
- {
- case syck_str_kind:
- if ( n->data.str != NULL )
- {
- S_FREE( n->data.str->ptr );
- n->data.str->ptr = NULL;
- n->data.str->len = 0;
- S_FREE( n->data.str );
- n->data.str = NULL;
- }
- break;
-
- case syck_seq_kind:
- if ( n->data.list != NULL )
- {
- S_FREE( n->data.list->items );
- S_FREE( n->data.list );
- n->data.list = NULL;
- }
- break;
-
- case syck_map_kind:
- if ( n->data.pairs != NULL )
- {
- S_FREE( n->data.pairs->keys );
- S_FREE( n->data.pairs->values );
- S_FREE( n->data.pairs );
- n->data.pairs = NULL;
- }
- break;
- }
-}
-
diff --git a/ext/syck/rubyext.c b/ext/syck/rubyext.c
deleted file mode 100644
index 2ab2e49482..0000000000
--- a/ext/syck/rubyext.c
+++ /dev/null
@@ -1,2328 +0,0 @@
-/* -*- indent-tabs-mode: nil -*- */
-/*
- * rubyext.c
- *
- * $Author$
- *
- * Copyright (C) 2003-2005 why the lucky stiff
- */
-
-#include "ruby/ruby.h"
-#include "ruby/encoding.h"
-#include "syck.h"
-#include <sys/types.h>
-#include <time.h>
-
-typedef struct RVALUE {
- union {
-#if 0
- struct {
- unsigned long flags; /* always 0 for freed obj */
- struct RVALUE *next;
- } free;
-#endif
- struct RBasic basic;
- struct RObject object;
- struct RClass klass;
- /*struct RFloat flonum;*/
- /*struct RString string;*/
- struct RArray array;
- /*struct RRegexp regexp;*/
- struct RHash hash;
- /*struct RData data;*/
- struct RStruct rstruct;
- /*struct RBignum bignum;*/
- /*struct RFile file;*/
- } as;
-} RVALUE;
-
-typedef struct {
- long hash;
- char *buffer;
- long length;
- long remaining;
- int printed;
-} bytestring_t;
-
-#define RUBY_DOMAIN "ruby.yaml.org,2002"
-
-/*
- * symbols and constants
- */
-static ID s_new, s_utc, s_at, s_to_f, s_to_i, s_read, s_binmode, s_call, s_cmp, s_transfer, s_update, s_dup, s_haskey, s_match, s_keys, s_unpack, s_tr_bang, s_default_set, s_tag_read_class, s_tag_subclasses, s_resolver, s_push, s_emitter, s_level, s_detect_implicit, s_node_import, s_out, s_input, s_intern, s_transform, s_yaml_new, s_yaml_initialize, s_node_export, s_to_yaml, s_write, s_set_resolver, s_each;
-static ID s_tags, s_kind, s_name, s_options, s_type_id, s_type_id_set, s_style, s_style_set, s_value, s_value_set, s_parse;
-static VALUE sym_model, sym_generic, sym_input, sym_bytecode;
-static VALUE sym_scalar, sym_seq, sym_map;
-static VALUE sym_1quote, sym_2quote, sym_fold, sym_literal, sym_plain, sym_inline;
-static VALUE cDate, cNode, cMap, cSeq, cScalar, cOut, cParser, cResolver, cPrivateType, cDomainType, cYObject, cBadAlias, cDefaultKey, cMergeKey, cEmitter, cDateTime;
-static VALUE oDefaultResolver, oGenericResolver;
-
-/*
- * my private collection of numerical oddities.
- */
-static double S_zero(void) { return 0.0; }
-static double S_one(void) { return 1.0; }
-static double S_inf(void) { return S_one() / S_zero(); }
-static double S_nan(void) { return S_zero() / S_zero(); }
-
-static VALUE syck_node_transform( VALUE );
-
-/*
- * handler prototypes
- */
-SYMID rb_syck_load_handler _((SyckParser *, SyckNode *));
-void rb_syck_err_handler _((SyckParser *, const char *));
-SyckNode * rb_syck_bad_anchor_handler _((SyckParser *, char *));
-void rb_syck_output_handler _((SyckEmitter *, char *, long));
-void rb_syck_emitter_handler _((SyckEmitter *, st_data_t));
-int syck_parser_assign_io _((SyckParser *, VALUE *));
-VALUE syck_scalar_alloc _((VALUE class));
-VALUE syck_seq_alloc _((VALUE class));
-VALUE syck_map_alloc _((VALUE class));
-
-struct parser_xtra {
- VALUE data; /* Borrowed this idea from marshal.c to fix [ruby-core:8067] problem */
- VALUE proc;
- VALUE resolver;
- int taint;
-};
-
-struct emitter_xtra {
- VALUE oid;
- VALUE data;
- VALUE port;
-};
-
-/*
- * Convert YAML to bytecode
- */
-VALUE
-rb_syck_compile(VALUE self, VALUE port)
-{
- SYMID oid;
- int taint;
- char *ret;
- VALUE bc;
- bytestring_t *sav = NULL;
- void *data = NULL;
-
- SyckParser *parser = syck_new_parser();
- taint = syck_parser_assign_io(parser, &port);
- syck_parser_handler( parser, syck_yaml2byte_handler );
- syck_parser_error_handler( parser, NULL );
- syck_parser_implicit_typing( parser, 0 );
- syck_parser_taguri_expansion( parser, 0 );
- oid = syck_parse( parser );
- if (!syck_lookup_sym( parser, oid, &data )) {
- rb_raise(rb_eSyntaxError, "root node <%p> not found", (void *)oid);
- }
- sav = data;
-
- ret = S_ALLOCA_N( char, strlen( sav->buffer ) + 3 );
- ret[0] = '\0';
- strcat( ret, "D\n" );
- strcat( ret, sav->buffer );
-
- syck_free_parser( parser );
-
- bc = rb_str_new2( ret );
- if ( taint ) OBJ_TAINT( bc );
- return bc;
-}
-
-/*
- * read from io.
- */
-long
-rb_syck_io_str_read( char *buf, SyckIoStr *str, long max_size, long skip )
-{
- long len = 0;
-
- ASSERT( str != NULL );
- max_size -= skip;
-
- if ( max_size <= 0 ) max_size = 0;
- else
- {
- /*
- * call io#read.
- */
- VALUE src = (VALUE)str->ptr;
- VALUE n = LONG2NUM(max_size);
- VALUE str2 = rb_funcall2(src, s_read, 1, &n);
- if (!NIL_P(str2))
- {
- StringValue(str2);
- len = RSTRING_LEN(str2);
- memcpy( buf + skip, RSTRING_PTR(str2), len );
- }
- }
- len += skip;
- buf[len] = '\0';
- return len;
-}
-
-/*
- * determine: are we reading from a string or io?
- * (returns tainted? boolean)
- */
-int
-syck_parser_assign_io(SyckParser *parser, VALUE *pport)
-{
- int taint = Qtrue;
- VALUE tmp, port = *pport;
- if (!NIL_P(tmp = rb_check_string_type(port))) {
- taint = OBJ_TAINTED(port); /* original taintedness */
- port = tmp;
- syck_parser_str( parser, RSTRING_PTR(port), RSTRING_LEN(port), NULL );
- }
- else if (rb_respond_to(port, s_read)) {
- if (rb_respond_to(port, s_binmode)) {
- rb_funcall2(port, s_binmode, 0, 0);
- }
- syck_parser_str( parser, (char *)port, 0, rb_syck_io_str_read );
- }
- else {
- rb_raise(rb_eTypeError, "instance of IO needed");
- }
- *pport = port;
- return taint;
-}
-
-/*
- * Get value in hash by key, forcing an empty hash if nil.
- */
-VALUE
-syck_get_hash_aref(VALUE hsh, VALUE key)
-{
- VALUE val = rb_hash_aref( hsh, key );
- if ( NIL_P( val ) )
- {
- val = rb_hash_new();
- rb_hash_aset(hsh, key, val);
- }
- return val;
-}
-
-/*
- * creating timestamps
- */
-struct mktime_arg {
- const char *str;
- long len;
-};
-
-VALUE
-mktime_do(VALUE varg)
-{
- struct mktime_arg *arg = (struct mktime_arg *)varg;
- VALUE time;
- const char *str = arg->str;
- long len = arg->len;
- const char *ptr = str;
- VALUE year = INT2FIX(0);
- VALUE mon = INT2FIX(0);
- VALUE day = INT2FIX(0);
- VALUE hour = INT2FIX(0);
- VALUE min = INT2FIX(0);
- VALUE sec = INT2FIX(0);
- long usec;
-
- /* Year*/
- if ( ptr[0] != '\0' && len > 0 ) {
- year = INT2FIX(strtol(ptr, NULL, 10));
- }
-
- /* Month*/
- ptr += 4;
- if ( ptr[0] != '\0' && len > ptr - str ) {
- while ( !ISDIGIT( *ptr ) ) ptr++;
- mon = INT2FIX(strtol(ptr, NULL, 10));
- }
-
- /* Day*/
- ptr += 2;
- if ( ptr[0] != '\0' && len > ptr - str ) {
- while ( !ISDIGIT( *ptr ) ) ptr++;
- day = INT2FIX(strtol(ptr, NULL, 10));
- }
-
- /* Hour*/
- ptr += 2;
- if ( ptr[0] != '\0' && len > ptr - str ) {
- while ( !ISDIGIT( *ptr ) ) ptr++;
- hour = INT2FIX(strtol(ptr, NULL, 10));
- }
-
- /* Minute */
- ptr += 2;
- if ( ptr[0] != '\0' && len > ptr - str ) {
- while ( !ISDIGIT( *ptr ) ) ptr++;
- min = INT2FIX(strtol(ptr, NULL, 10));
- }
-
- /* Second */
- ptr += 2;
- if ( ptr[0] != '\0' && len > ptr - str ) {
- while ( !ISDIGIT( *ptr ) ) ptr++;
- sec = INT2FIX(strtol(ptr, NULL, 10));
- }
-
- /* Millisecond */
- ptr += 2;
- if ( len > ptr - str && *ptr == '.' )
- {
- char padded[] = "000000";
- const int padding = (int)(sizeof(padded) - 1);
- const char *end = ptr + 1;
- const char *begin = end;
- ptrdiff_t length;
- while ( isdigit( *end ) ) end++;
- if ((length = (end - begin)) > padding) length = padding;
- MEMCPY(padded, begin, char, length);
- usec = strtol(padded, NULL, 10);
- }
- else
- {
- usec = 0;
- }
-
- /* Time Zone*/
- while ( len > ptr - str && *ptr != 'Z' && *ptr != '+' && *ptr != '-' && *ptr != '\0' ) ptr++;
- if ( len > ptr - str && ( *ptr == '-' || *ptr == '+' ) )
- {
- time_t tz_offset = strtol(ptr, NULL, 10) * 3600;
- VALUE tmp;
-
- while ( *ptr != ':' && *ptr != '\0' ) ptr++;
- if ( *ptr == ':' )
- {
- ptr += 1;
- if ( tz_offset < 0 )
- {
- tz_offset -= strtol(ptr, NULL, 10) * 60;
- }
- else
- {
- tz_offset += strtol(ptr, NULL, 10) * 60;
- }
- }
-
- /* Make TZ time*/
- time = rb_funcall(rb_cTime, s_utc, 6, year, mon, day, hour, min, sec);
- tmp = rb_funcall(time, s_to_i, 0);
- tmp = rb_funcall(tmp, '-', 1, LONG2FIX(tz_offset));
- return rb_funcall(rb_cTime, s_at, 2, tmp, LONG2NUM(usec));
- }
- else
- {
- /* Make UTC time*/
- return rb_funcall(rb_cTime, s_utc, 7, year, mon, day, hour, min, sec, LONG2NUM(usec));
- }
-}
-
-VALUE
-mktime_r(VALUE varg)
-{
- struct mktime_arg *arg = (struct mktime_arg *)varg;
-
- if (!cDateTime) {
- /*
- * Load Date module
- */
- rb_require("date");
- cDateTime = rb_const_get(rb_cObject, rb_intern("DateTime"));
- }
- return rb_funcall(cDateTime, s_parse, 1, rb_str_new(arg->str, arg->len));
-}
-
-VALUE
-rb_syck_mktime(const char *str, long len)
-{
- struct mktime_arg a;
-
- a.str = str;
- a.len = len;
- return rb_rescue2(mktime_do, (VALUE)&a, mktime_r, (VALUE)&a, rb_eArgError, NULL);
-}
-
-/*
- * handles merging of an array of hashes
- * (see http://www.yaml.org/type/merge/)
- */
-VALUE
-syck_merge_i(VALUE entry, VALUE hsh )
-{
- VALUE tmp;
- if ( !NIL_P(tmp = rb_check_convert_type(entry, T_HASH, "Hash", "to_hash")) )
- {
- entry = tmp;
- rb_funcall( hsh, s_update, 1, entry );
- }
- return Qnil;
-}
-
-/*
- * default handler for ruby.yaml.org types
- */
-int
-yaml_org_handler( SyckNode *n, VALUE *ref )
-{
- char *type_id = n->type_id;
- int transferred = 0;
- long i = 0;
- VALUE obj = Qnil;
-
- if ( type_id != NULL && strncmp( type_id, "tag:yaml.org,2002:", 18 ) == 0 )
- {
- type_id += 18;
- }
-
- switch (n->kind)
- {
- case syck_str_kind:
- transferred = 1;
- if ( type_id == NULL )
- {
- obj = rb_str_new( n->data.str->ptr, n->data.str->len );
- }
- else if ( strcmp( type_id, "null" ) == 0 )
- {
- obj = Qnil;
- }
- else if ( strcmp( type_id, "binary" ) == 0 )
- {
- VALUE arr;
- obj = rb_str_new( n->data.str->ptr, n->data.str->len );
- rb_funcall( obj, s_tr_bang, 2, rb_str_new2( "\n\t " ), rb_str_new2( "" ) );
- arr = rb_funcall( obj, s_unpack, 1, rb_str_new2( "m" ) );
- obj = rb_ary_shift( arr );
- }
- else if ( strcmp( type_id, "bool#yes" ) == 0 )
- {
- obj = Qtrue;
- }
- else if ( strcmp( type_id, "bool#no" ) == 0 )
- {
- obj = Qfalse;
- }
- else if ( strcmp( type_id, "int#hex" ) == 0 )
- {
- syck_str_blow_away_commas( n );
- obj = rb_cstr2inum( n->data.str->ptr, 16 );
- }
- else if ( strcmp( type_id, "int#oct" ) == 0 )
- {
- syck_str_blow_away_commas( n );
- obj = rb_cstr2inum( n->data.str->ptr, 8 );
- }
- else if ( strcmp( type_id, "int#base60" ) == 0 )
- {
- char *ptr, *end;
- long sixty = 1;
- long total = 0;
- syck_str_blow_away_commas( n );
- ptr = n->data.str->ptr;
- end = n->data.str->ptr + n->data.str->len;
- while ( end > ptr )
- {
- long bnum = 0;
- char *colon = end - 1;
- while ( colon >= ptr && *colon != ':' )
- {
- colon--;
- }
- if ( colon >= ptr && *colon == ':' ) *colon = '\0';
-
- bnum = strtol( colon + 1, NULL, 10 );
- total += bnum * sixty;
- sixty *= 60;
- end = colon;
- }
- obj = INT2FIX(total);
- }
- else if ( strncmp( type_id, "int", 3 ) == 0 )
- {
- syck_str_blow_away_commas( n );
- obj = rb_cstr2inum( n->data.str->ptr, 10 );
- }
- else if ( strcmp( type_id, "float#base60" ) == 0 )
- {
- char *ptr, *end;
- long sixty = 1;
- double total = 0.0;
- syck_str_blow_away_commas( n );
- ptr = n->data.str->ptr;
- end = n->data.str->ptr + n->data.str->len;
- while ( end > ptr )
- {
- double bnum = 0;
- char *colon = end - 1;
- while ( colon >= ptr && *colon != ':' )
- {
- colon--;
- }
- if ( colon >= ptr && *colon == ':' ) *colon = '\0';
-
- bnum = strtod( colon + 1, NULL );
- total += bnum * sixty;
- sixty *= 60;
- end = colon;
- }
- obj = rb_float_new( total );
- }
- else if ( strcmp( type_id, "float#nan" ) == 0 )
- {
- obj = rb_float_new( S_nan() );
- }
- else if ( strcmp( type_id, "float#inf" ) == 0 )
- {
- obj = rb_float_new( S_inf() );
- }
- else if ( strcmp( type_id, "float#neginf" ) == 0 )
- {
- obj = rb_float_new( -S_inf() );
- }
- else if ( strncmp( type_id, "float", 5 ) == 0 )
- {
- double f;
- syck_str_blow_away_commas( n );
- f = strtod( n->data.str->ptr, NULL );
- obj = rb_float_new( f );
- }
- else if ( strcmp( type_id, "timestamp#iso8601" ) == 0 )
- {
- obj = rb_syck_mktime( n->data.str->ptr, n->data.str->len );
- }
- else if ( strcmp( type_id, "timestamp#spaced" ) == 0 )
- {
- obj = rb_syck_mktime( n->data.str->ptr, n->data.str->len );
- }
- else if ( strcmp( type_id, "timestamp#ymd" ) == 0 )
- {
- char *ptr = n->data.str->ptr;
- VALUE year, mon, day;
-
- /* Year*/
- ptr[4] = '\0';
- year = INT2FIX(strtol(ptr, NULL, 10));
-
- /* Month*/
- ptr += 4;
- while ( !ISDIGIT( *ptr ) ) ptr++;
- mon = INT2FIX(strtol(ptr, NULL, 10));
-
- /* Day*/
- ptr += 2;
- while ( !ISDIGIT( *ptr ) ) ptr++;
- day = INT2FIX(strtol(ptr, NULL, 10));
-
- if ( !cDate ) {
- /*
- * Load Date module
- */
- rb_require( "date" );
- cDate = rb_const_get( rb_cObject, rb_intern("Date") );
- }
-
- obj = rb_funcall( cDate, s_new, 3, year, mon, day );
- }
- else if ( strncmp( type_id, "timestamp", 9 ) == 0 )
- {
- obj = rb_syck_mktime( n->data.str->ptr, n->data.str->len );
- }
- else if ( strncmp( type_id, "merge", 5 ) == 0 )
- {
- obj = rb_funcall( cMergeKey, s_new, 0 );
- }
- else if ( strncmp( type_id, "default", 7 ) == 0 )
- {
- obj = rb_funcall( cDefaultKey, s_new, 0 );
- }
- else if ( n->data.str->style == scalar_plain &&
- n->data.str->len > 1 &&
- strncmp( n->data.str->ptr, ":", 1 ) == 0 )
- {
- obj = rb_funcall( oDefaultResolver, s_transfer, 2,
- rb_str_new2( "tag:ruby.yaml.org,2002:sym" ),
- rb_str_new( n->data.str->ptr + 1, n->data.str->len - 1 ) );
- }
- else if ( strcmp( type_id, "str" ) == 0 )
- {
- obj = rb_str_new( n->data.str->ptr, n->data.str->len );
- rb_enc_associate(obj, rb_utf8_encoding());
- }
- else
- {
- transferred = 0;
- obj = rb_str_new( n->data.str->ptr, n->data.str->len );
- }
- break;
-
- case syck_seq_kind:
- if ( type_id == NULL || strcmp( type_id, "seq" ) == 0 )
- {
- transferred = 1;
- }
- obj = rb_ary_new2( n->data.list->idx );
- for ( i = 0; i < n->data.list->idx; i++ )
- {
- rb_ary_store( obj, i, syck_seq_read( n, i ) );
- }
- break;
-
- case syck_map_kind:
- if ( type_id == NULL || strcmp( type_id, "map" ) == 0 )
- {
- transferred = 1;
- }
- obj = rb_hash_new();
- for ( i = 0; i < n->data.pairs->idx; i++ )
- {
- VALUE k = syck_map_read( n, map_key, i );
- VALUE v = syck_map_read( n, map_value, i );
- int skip_aset = 0;
-
- /*
- * Handle merge keys
- */
- if ( rb_obj_is_kind_of( k, cMergeKey ) )
- {
- VALUE tmp;
- if ( !NIL_P(tmp = rb_check_convert_type(v, T_HASH, "Hash", "to_hash")) )
- {
- VALUE dup = rb_funcall( tmp, s_dup, 0 );
- rb_funcall( dup, s_update, 1, obj );
- obj = dup;
- skip_aset = 1;
- }
- else if ( !NIL_P(tmp = rb_check_array_type(v)) )
- {
- VALUE end = rb_ary_pop( tmp );
- VALUE tmph = rb_check_convert_type(end, T_HASH, "Hash", "to_hash");
- if ( !NIL_P(tmph) )
- {
- VALUE dup = rb_funcall( tmph, s_dup, 0 );
- tmp = rb_ary_reverse( tmp );
- rb_ary_push( tmp, obj );
- rb_block_call( tmp, s_each, 0, 0, syck_merge_i, dup );
- obj = dup;
- skip_aset = 1;
- }
- }
- }
- else if ( rb_obj_is_kind_of( k, cDefaultKey ) )
- {
- rb_funcall( obj, s_default_set, 1, v );
- skip_aset = 1;
- }
-
- if ( ! skip_aset )
- {
- rb_hash_aset( obj, k, v );
- }
- }
- break;
- }
-
- *ref = obj;
- return transferred;
-}
-
-static void syck_node_mark( SyckNode *n );
-
-/*
- * {native mode} node handler
- * - Converts data into native Ruby types
- */
-SYMID
-rb_syck_load_handler(SyckParser *p, SyckNode *n)
-{
- VALUE obj = Qnil;
- struct parser_xtra *bonus = (struct parser_xtra *)p->bonus;
- VALUE resolver = bonus->resolver;
- if ( NIL_P( resolver ) )
- {
- resolver = oDefaultResolver;
- }
-
- /*
- * Create node,
- */
- obj = rb_funcall( resolver, s_node_import, 1, Data_Wrap_Struct( cNode, NULL, NULL, n ) );
-
- /*
- * ID already set, let's alter the symbol table to accept the new object
- */
- if (n->id > 0 && !NIL_P(obj))
- {
- MEMCPY((void *)n->id, (void *)obj, RVALUE, 1);
- MEMZERO((void *)obj, RVALUE, 1);
- obj = n->id;
- }
-
- if ( bonus->taint) OBJ_TAINT( obj );
- if ( bonus->proc != 0 ) rb_funcall(bonus->proc, s_call, 1, obj);
-
- rb_hash_aset(bonus->data, INT2FIX(RHASH_SIZE(bonus->data)), obj);
- return obj;
-}
-
-/*
- * friendly errors.
- */
-void
-rb_syck_err_handler(SyckParser *p, const char *msg)
-{
- char *endl = p->cursor;
-
- while ( *endl != '\0' && *endl != '\n' )
- endl++;
-
- endl[0] = '\0';
- rb_raise(rb_eArgError, "%s on line %d, col %"PRIdPTRDIFF": `%s'",
- msg,
- p->linect,
- p->cursor - p->lineptr,
- p->lineptr);
-}
-
-/*
- * provide bad anchor object to the parser.
- */
-SyckNode *
-rb_syck_bad_anchor_handler(SyckParser *p, char *a)
-{
- VALUE anchor_name = rb_str_new2( a );
- SyckNode *badanc = syck_new_map( rb_str_new2( "name" ), anchor_name );
- badanc->type_id = syck_strndup( "tag:ruby.yaml.org,2002:object:YAML::Syck::BadAlias", 53 );
- return badanc;
-}
-
-/*
- * data loaded based on the model requested.
- */
-void
-syck_set_model(VALUE p, VALUE input, VALUE model)
-{
- SyckParser *parser;
- Data_Get_Struct(p, SyckParser, parser);
- syck_parser_handler( parser, rb_syck_load_handler );
- /* WARN: gonna be obsoleted soon!! */
- if ( model == sym_generic )
- {
- rb_funcall( p, s_set_resolver, 1, oGenericResolver );
- }
- syck_parser_implicit_typing( parser, 1 );
- syck_parser_taguri_expansion( parser, 1 );
-
- if ( NIL_P( input ) )
- {
- input = rb_ivar_get( p, s_input );
- }
- if ( input == sym_bytecode )
- {
- syck_parser_set_input_type( parser, syck_bytecode_utf8 );
- }
- else
- {
- syck_parser_set_input_type( parser, syck_yaml_utf8 );
- }
- syck_parser_error_handler( parser, rb_syck_err_handler );
- syck_parser_bad_anchor_handler( parser, rb_syck_bad_anchor_handler );
-}
-
-static int
-syck_st_mark_nodes( char *key, SyckNode *n, char *arg )
-{
- if ( n != (void *)1 ) syck_node_mark( n );
- return ST_CONTINUE;
-}
-
-/*
- * mark parser nodes
- */
-static void
-syck_mark_parser(SyckParser *parser)
-{
- struct parser_xtra *bonus = (struct parser_xtra *)parser->bonus;
- rb_gc_mark_maybe(parser->root);
- rb_gc_mark_maybe(parser->root_on_error);
- rb_gc_mark( bonus->data );
- rb_gc_mark( bonus->proc );
- rb_gc_mark( bonus->resolver );
-
- if ( parser->anchors != NULL )
- {
- st_foreach( parser->anchors, syck_st_mark_nodes, 0 );
- }
- if ( parser->bad_anchors != NULL )
- {
- st_foreach( parser->bad_anchors, syck_st_mark_nodes, 0 );
- }
-}
-
-/*
- * Free the parser and any bonus attachment.
- */
-void
-rb_syck_free_parser(SyckParser *p)
-{
- S_FREE( p->bonus );
- syck_free_parser(p);
-}
-
-/*
- * YAML::Syck::Parser.allocate
- */
-VALUE syck_parser_s_alloc _((VALUE));
-VALUE
-syck_parser_s_alloc(VALUE class)
-{
- VALUE pobj;
- SyckParser *parser = syck_new_parser();
-
- parser->bonus = S_ALLOC( struct parser_xtra );
- S_MEMZERO( parser->bonus, struct parser_xtra, 1 );
-
- pobj = Data_Wrap_Struct( class, syck_mark_parser, rb_syck_free_parser, parser );
-
- syck_parser_set_root_on_error( parser, Qnil );
-
- return pobj;
-}
-
-/*
- * YAML::Syck::Parser.initialize( resolver, options )
- */
-static VALUE
-syck_parser_initialize(int argc, VALUE *argv, VALUE self)
-{
- VALUE options;
- if (rb_scan_args(argc, argv, "01", &options) == 0)
- {
- options = rb_hash_new();
- }
- else
- {
- Check_Type(options, T_HASH);
- }
- rb_ivar_set(self, s_options, options);
- rb_ivar_set(self, s_input, Qnil);
- return self;
-}
-
-/*
- * YAML::Syck::Parser.bufsize = Integer
- */
-static VALUE
-syck_parser_bufsize_set(VALUE self, VALUE size)
-{
- SyckParser *parser;
-
- if ( rb_respond_to( size, s_to_i ) ) {
- int n = NUM2INT(rb_funcall(size, s_to_i, 0));
- Data_Get_Struct(self, SyckParser, parser);
- parser->bufsize = n;
- }
- return self;
-}
-
-/*
- * YAML::Syck::Parser.bufsize => Integer
- */
-static VALUE
-syck_parser_bufsize_get(VALUE self)
-{
- SyckParser *parser;
-
- Data_Get_Struct(self, SyckParser, parser);
- return INT2FIX( parser->bufsize );
-}
-
-/*
- * YAML::Syck::Parser.load( IO or String )
- */
-VALUE
-syck_parser_load(int argc, VALUE *argv, VALUE self)
-{
- VALUE port, proc, model, input;
- SyckParser *parser;
- struct parser_xtra *bonus;
-
- rb_scan_args(argc, argv, "11", &port, &proc);
-
- input = rb_hash_aref( rb_attr_get( self, s_options ), sym_input );
- model = rb_hash_aref( rb_attr_get( self, s_options ), sym_model );
- Data_Get_Struct(self, SyckParser, parser);
- syck_set_model( self, input, model );
-
- bonus = (struct parser_xtra *)parser->bonus;
- bonus->taint = syck_parser_assign_io(parser, &port);
- bonus->data = rb_hash_new();
- bonus->resolver = rb_attr_get( self, s_resolver );
- if ( NIL_P( proc ) ) bonus->proc = 0;
- else bonus->proc = proc;
-
- return syck_parse( parser );
-}
-
-/*
- * YAML::Syck::Parser.load_documents( IO or String ) { |doc| }
- */
-VALUE
-syck_parser_load_documents(int argc, VALUE *argv, VALUE self)
-{
- VALUE port, proc, v, input, model;
- SyckParser *parser;
- struct parser_xtra *bonus;
-
- rb_scan_args(argc, argv, "1&", &port, &proc);
-
- input = rb_hash_aref( rb_attr_get( self, s_options ), sym_input );
- model = rb_hash_aref( rb_attr_get( self, s_options ), sym_model );
- Data_Get_Struct(self, SyckParser, parser);
- syck_set_model( self, input, model );
-
- bonus = (struct parser_xtra *)parser->bonus;
- bonus->taint = syck_parser_assign_io(parser, &port);
- bonus->resolver = rb_attr_get( self, s_resolver );
- bonus->proc = 0;
-
- while ( 1 )
- {
- /* Reset hash for tracking nodes */
- bonus->data = rb_hash_new();
-
- /* Parse a document */
- v = syck_parse( parser );
- if ( parser->eof == 1 )
- {
- break;
- }
-
- /* Pass document to block */
- rb_funcall( proc, s_call, 1, v );
- }
-
- return Qnil;
-}
-
-/*
- * YAML::Syck::Parser#set_resolver
- */
-VALUE
-syck_parser_set_resolver(VALUE self, VALUE resolver)
-{
- rb_ivar_set( self, s_resolver, resolver );
- return self;
-}
-
-/*
- * YAML::Syck::Resolver.initialize
- */
-static VALUE
-syck_resolver_initialize(VALUE self)
-{
- rb_ivar_set(self, s_tags, rb_hash_new());
- return self;
-}
-
-/*
- * YAML::Syck::Resolver#add_type
- */
-VALUE
-syck_resolver_add_type(VALUE self, VALUE taguri, VALUE cls)
-{
- VALUE tags = rb_attr_get(self, s_tags);
- rb_hash_aset( tags, taguri, cls );
- return Qnil;
-}
-
-/*
- * YAML::Syck::Resolver#use_types_at
- */
-VALUE
-syck_resolver_use_types_at(VALUE self, VALUE hsh)
-{
- rb_ivar_set( self, s_tags, hsh );
- return Qnil;
-}
-
-/*
- * YAML::Syck::Resolver#detect_implicit
- */
-VALUE
-syck_resolver_detect_implicit(VALUE self, VALUE val)
-{
- return rb_str_new2( "" );
-}
-
-/*
- * YAML::Syck::Resolver#node_import
- */
-VALUE
-syck_resolver_node_import(VALUE self, VALUE node)
-{
- SyckNode *n;
- VALUE obj = Qnil;
- int i = 0;
- Data_Get_Struct(node, SyckNode, n);
-
- switch (n->kind)
- {
- case syck_str_kind:
- obj = rb_str_new( n->data.str->ptr, n->data.str->len );
- break;
-
- case syck_seq_kind:
- obj = rb_ary_new2( n->data.list->idx );
- for ( i = 0; i < n->data.list->idx; i++ )
- {
- rb_ary_store( obj, i, syck_seq_read( n, i ) );
- }
- break;
-
- case syck_map_kind:
- obj = rb_hash_new();
- for ( i = 0; i < n->data.pairs->idx; i++ )
- {
- VALUE k = syck_map_read( n, map_key, i );
- VALUE v = syck_map_read( n, map_value, i );
- int skip_aset = 0;
-
- /*
- * Handle merge keys
- */
- if ( rb_obj_is_kind_of( k, cMergeKey ) )
- {
- if ( rb_obj_is_kind_of( v, rb_cHash ) )
- {
- VALUE dup = rb_funcall( v, s_dup, 0 );
- rb_funcall( dup, s_update, 1, obj );
- obj = dup;
- skip_aset = 1;
- }
- else if ( rb_obj_is_kind_of( v, rb_cArray ) )
- {
- VALUE end = rb_ary_pop( v );
- if ( rb_obj_is_kind_of( end, rb_cHash ) )
- {
- VALUE dup = rb_funcall( end, s_dup, 0 );
- v = rb_ary_reverse( v );
- rb_ary_push( v, obj );
- rb_block_call( v, s_each, 0, 0, syck_merge_i, dup );
- obj = dup;
- skip_aset = 1;
- }
- }
- }
- else if ( rb_obj_is_kind_of( k, cDefaultKey ) )
- {
- rb_funcall( obj, s_default_set, 1, v );
- skip_aset = 1;
- }
-
- if ( ! skip_aset )
- {
- rb_hash_aset( obj, k, v );
- }
- }
- break;
- }
-
- if ( n->type_id != NULL )
- {
- obj = rb_funcall( self, s_transfer, 2, rb_str_new2( n->type_id ), obj );
- }
- return obj;
-}
-
-/*
- * Set instance variables
- */
-VALUE
-syck_set_ivars(VALUE vars, VALUE obj)
-{
- VALUE ivname = rb_ary_entry( vars, 0 );
- char *ivn;
- StringValue( ivname );
- ivn = S_ALLOCA_N( char, RSTRING_LEN(ivname) + 2 );
- ivn[0] = '@';
- ivn[1] = '\0';
- strncat( ivn, RSTRING_PTR(ivname), RSTRING_LEN(ivname) );
- rb_iv_set( obj, ivn, rb_ary_entry( vars, 1 ) );
- return Qnil;
-}
-
-/*
- * YAML::Syck::Resolver#const_find
- */
-VALUE
-syck_const_find(VALUE const_name)
-{
- VALUE tclass = rb_cObject;
- VALUE tparts = rb_str_split( const_name, "::" );
- int i = 0;
- for ( i = 0; i < RARRAY_LEN(tparts); i++ ) {
- VALUE tpart = rb_to_id( rb_ary_entry( tparts, i ) );
- if ( !rb_const_defined( tclass, tpart ) ) return Qnil;
- tclass = rb_const_get( tclass, tpart );
- }
- return tclass;
-}
-
-/*
- * YAML::Syck::Resolver#transfer
- */
-VALUE
-syck_resolver_transfer(VALUE self, VALUE type, VALUE val)
-{
- if (NIL_P(type) || RSTRING_LEN(StringValue(type)) == 0)
- {
- type = rb_funcall( self, s_detect_implicit, 1, val );
- }
-
- if ( ! (NIL_P(type) || RSTRING_LEN(StringValue(type)) == 0) )
- {
- VALUE str_xprivate = rb_str_new2( "x-private" );
- VALUE colon = rb_str_new2( ":" );
- VALUE tags = rb_attr_get(self, s_tags);
- VALUE target_class = rb_hash_aref( tags, type );
- VALUE subclass = target_class;
- VALUE obj = Qnil;
-
- /*
- * Should no tag match exactly, check for subclass format
- */
- if ( NIL_P( target_class ) )
- {
- VALUE subclass_parts = rb_ary_new();
- VALUE parts = rb_str_split( type, ":" );
-
- while ( RARRAY_LEN(parts) > 1 )
- {
- VALUE partial;
- rb_ary_unshift( subclass_parts, rb_ary_pop( parts ) );
- partial = rb_ary_join( parts, colon );
- target_class = rb_hash_aref( tags, partial );
- if ( NIL_P( target_class ) )
- {
- rb_str_append( partial, colon );
- target_class = rb_hash_aref( tags, partial );
- }
-
- /*
- * Possible subclass found, see if it supports subclassing
- */
- if ( ! NIL_P( target_class ) )
- {
- subclass = target_class;
- if ( RARRAY_LEN(subclass_parts) > 0 && rb_respond_to( target_class, s_tag_subclasses ) &&
- RTEST( rb_funcall( target_class, s_tag_subclasses, 0 ) ) )
- {
- VALUE subclass_v;
- subclass = rb_ary_join( subclass_parts, colon );
- subclass = rb_funcall( target_class, s_tag_read_class, 1, subclass );
- subclass_v = syck_const_find( subclass );
-
- if ( subclass_v != Qnil )
- {
- subclass = subclass_v;
- }
- else if ( rb_cObject == target_class && subclass_v == Qnil )
- {
- target_class = cYObject;
- type = subclass;
- subclass = cYObject;
- }
- else /* workaround for SEGV. real fix please */
- {
- rb_raise( rb_eTypeError, "invalid subclass" );
- }
- }
- break;
- }
- }
- }
-
- /* rb_raise(rb_eTypeError, "invalid typing scheme: %s given",
- * scheme);
- */
-
- if ( rb_respond_to( target_class, s_call ) )
- {
- obj = rb_funcall( target_class, s_call, 2, type, val );
- }
- else
- {
- if ( rb_respond_to( target_class, s_yaml_new ) )
- {
- obj = rb_funcall( target_class, s_yaml_new, 3, subclass, type, val );
- }
- else if ( !NIL_P( target_class ) )
- {
- if ( subclass == rb_cBignum )
- {
- obj = rb_str2inum( val, 10 ); /* for yaml dumped by 1.8.3 [ruby-core:6159] */
- }
- else
- {
- obj = rb_obj_alloc( subclass );
- }
-
- if ( rb_respond_to( obj, s_yaml_initialize ) )
- {
- rb_funcall( obj, s_yaml_initialize, 2, type, val );
- }
- else if ( !NIL_P( obj ) && rb_obj_is_instance_of( val, rb_cHash ) )
- {
- rb_block_call( val, s_each, 0, 0, syck_set_ivars, obj );
- }
- }
- else
- {
- VALUE parts = rb_str_split( type, ":" );
- VALUE scheme = rb_ary_shift( parts );
- if ( rb_str_cmp( scheme, str_xprivate ) == 0 )
- {
- VALUE name = rb_ary_join( parts, colon );
- obj = rb_funcall( cPrivateType, s_new, 2, name, val );
- }
- else
- {
- VALUE domain = rb_ary_shift( parts );
- VALUE name = rb_ary_join( parts, colon );
- obj = rb_funcall( cDomainType, s_new, 3, domain, name, val );
- }
- }
- }
- val = obj;
- }
-
- return val;
-}
-
-/*
- * YAML::Syck::Resolver#tagurize
- */
-VALUE
-syck_resolver_tagurize(VALUE self, VALUE val)
-{
- VALUE tmp = rb_check_string_type(val);
-
- if ( !NIL_P(tmp) )
- {
- char *taguri = syck_type_id_to_uri( RSTRING_PTR(tmp) );
- val = rb_str_new2( taguri );
- S_FREE( taguri );
- }
-
- return val;
-}
-
-/*
- * YAML::Syck::DefaultResolver#detect_implicit
- */
-VALUE
-syck_defaultresolver_detect_implicit(VALUE self, VALUE val)
-{
- const char *type_id;
- VALUE tmp = rb_check_string_type(val);
-
- if ( !NIL_P(tmp) )
- {
- val = tmp;
- type_id = syck_match_implicit( RSTRING_PTR(val), RSTRING_LEN(val) );
- return rb_str_new2( type_id );
- }
-
- return rb_str_new2( "" );
-}
-
-/*
- * YAML::Syck::DefaultResolver#node_import
- */
-VALUE
-syck_defaultresolver_node_import(VALUE self, VALUE node)
-{
- SyckNode *n;
- VALUE obj;
- Data_Get_Struct( node, SyckNode, n );
- if ( !yaml_org_handler( n, &obj ) )
- {
- obj = rb_funcall( self, s_transfer, 2, rb_str_new2( n->type_id ), obj );
- }
- return obj;
-}
-
-/*
- * YAML::Syck::GenericResolver#node_import
- */
-VALUE
-syck_genericresolver_node_import(VALUE self, VALUE node)
-{
- SyckNode *n;
- int i = 0;
- VALUE t = Qnil, obj = Qnil, v = Qnil, style = Qnil;
- Data_Get_Struct(node, SyckNode, n);
-
- if ( n->type_id != NULL )
- {
- t = rb_str_new2(n->type_id);
- }
-
- switch (n->kind)
- {
- case syck_str_kind:
- {
- v = rb_str_new( n->data.str->ptr, n->data.str->len );
- rb_enc_associate(v, rb_utf8_encoding());
- if ( n->data.str->style == scalar_1quote )
- {
- style = sym_1quote;
- }
- else if ( n->data.str->style == scalar_2quote )
- {
- style = sym_2quote;
- }
- else if ( n->data.str->style == scalar_fold )
- {
- style = sym_fold;
- }
- else if ( n->data.str->style == scalar_literal )
- {
- style = sym_literal;
- }
- else if ( n->data.str->style == scalar_plain )
- {
- style = sym_plain;
- }
- obj = rb_funcall( cScalar, s_new, 3, t, v, style );
- }
- break;
-
- case syck_seq_kind:
- v = rb_ary_new2( syck_seq_count( n ) );
- for ( i = 0; i < syck_seq_count( n ); i++ )
- {
- rb_ary_store( v, i, syck_seq_read( n, i ) );
- }
- if ( n->data.list->style == seq_inline )
- {
- style = sym_inline;
- }
- obj = rb_funcall( cSeq, s_new, 3, t, v, style );
- rb_iv_set(obj, "@kind", sym_seq);
- break;
-
- case syck_map_kind:
- v = rb_hash_new();
- for ( i = 0; i < syck_map_count( n ); i++ )
- {
- rb_hash_aset( v, syck_map_read( n, map_key, i ), syck_map_read( n, map_value, i ) );
- }
- if ( n->data.pairs->style == map_inline )
- {
- style = sym_inline;
- }
- obj = rb_funcall( cMap, s_new, 3, t, v, style );
- rb_iv_set(obj, "@kind", sym_map);
- break;
- }
-
- return obj;
-}
-
-/*
- * YAML::Syck::BadAlias.initialize
- */
-VALUE
-syck_badalias_initialize(VALUE self, VALUE val)
-{
- rb_iv_set( self, "@name", val );
- return self;
-}
-
-/*
- * YAML::Syck::BadAlias.<=>
- */
-VALUE
-syck_badalias_cmp(VALUE alias1, VALUE alias2)
-{
- VALUE str1 = rb_ivar_get( alias1, s_name );
- VALUE str2 = rb_ivar_get( alias2, s_name );
- VALUE val = rb_funcall( str1, s_cmp, 1, str2 );
- return val;
-}
-
-/*
- * YAML::DomainType.initialize
- */
-VALUE
-syck_domaintype_initialize(VALUE self, VALUE domain, VALUE type_id, VALUE val)
-{
- rb_iv_set( self, "@domain", domain );
- rb_iv_set( self, "@type_id", type_id );
- rb_iv_set( self, "@value", val );
- return self;
-}
-
-/*
- * YAML::Object.initialize
- */
-VALUE
-syck_yobject_initialize(VALUE self, VALUE klass, VALUE ivars)
-{
- rb_iv_set( self, "@class", klass );
- rb_iv_set( self, "@ivars", ivars );
- return self;
-}
-
-/*
- * YAML::PrivateType.initialize
- */
-VALUE
-syck_privatetype_initialize(VALUE self, VALUE type_id, VALUE val)
-{
- rb_iv_set( self, "@type_id", type_id );
- rb_iv_set( self, "@value", val );
- return self;
-}
-
-/*
- * Mark node contents.
- */
-static void
-syck_node_mark(SyckNode *n)
-{
- int i;
- rb_gc_mark_maybe( n->id );
- switch ( n->kind )
- {
- case syck_seq_kind:
- for ( i = 0; i < n->data.list->idx; i++ )
- {
- rb_gc_mark( syck_seq_read( n, i ) );
- }
- break;
-
- case syck_map_kind:
- for ( i = 0; i < n->data.pairs->idx; i++ )
- {
- rb_gc_mark( syck_map_read( n, map_key, i ) );
- rb_gc_mark( syck_map_read( n, map_value, i ) );
- }
- break;
-
- case syck_str_kind:
- default:
- /* nothing */
- break;
- }
-#if 0 /* maybe needed */
- if ( n->shortcut ) syck_node_mark( n->shortcut ); /* caution: maybe cyclic */
-#endif
-}
-
-/*
- * YAML::Syck::Scalar.allocate
- */
-VALUE
-syck_scalar_alloc(VALUE class)
-{
- SyckNode *node = syck_alloc_str();
- VALUE obj = Data_Wrap_Struct( class, syck_node_mark, syck_free_node, node );
- node->id = obj;
- return obj;
-}
-
-/*
- * YAML::Syck::Scalar.initialize
- */
-VALUE
-syck_scalar_initialize(VALUE self, VALUE type_id, VALUE val, VALUE style)
-{
- rb_iv_set( self, "@kind", sym_scalar );
- rb_funcall( self, s_type_id_set, 1, type_id );
- rb_funcall( self, s_value_set, 1, val );
- rb_funcall( self, s_style_set, 1, style );
- return self;
-}
-
-/*
- * YAML::Syck::Scalar.style=
- */
-VALUE
-syck_scalar_style_set(VALUE self, VALUE style)
-{
- SyckNode *node;
- Data_Get_Struct( self, SyckNode, node );
-
- if ( NIL_P( style ) )
- {
- node->data.str->style = scalar_none;
- }
- else if ( style == sym_1quote )
- {
- node->data.str->style = scalar_1quote;
- }
- else if ( style == sym_2quote )
- {
- node->data.str->style = scalar_2quote;
- }
- else if ( style == sym_fold )
- {
- node->data.str->style = scalar_fold;
- }
- else if ( style == sym_literal )
- {
- node->data.str->style = scalar_literal;
- }
- else if ( style == sym_plain )
- {
- node->data.str->style = scalar_plain;
- }
-
- rb_iv_set( self, "@style", style );
- return self;
-}
-
-/*
- * YAML::Syck::Scalar.value=
- */
-VALUE
-syck_scalar_value_set(VALUE self, VALUE val)
-{
- SyckNode *node;
- Data_Get_Struct( self, SyckNode, node );
-
- StringValue( val );
- node->data.str->ptr = syck_strndup( RSTRING_PTR(val), RSTRING_LEN(val) );
- node->data.str->len = RSTRING_LEN(val);
- node->data.str->style = scalar_none;
-
- rb_iv_set( self, "@value", val );
- return val;
-}
-
-/*
- * YAML::Syck::Seq.allocate
- */
-VALUE
-syck_seq_alloc(VALUE class)
-{
- SyckNode *node;
- VALUE obj;
- node = syck_alloc_seq();
- obj = Data_Wrap_Struct( class, syck_node_mark, syck_free_node, node );
- node->id = obj;
- return obj;
-}
-
-/*
- * YAML::Syck::Seq.initialize
- */
-VALUE
-syck_seq_initialize(VALUE self, VALUE type_id, VALUE val, VALUE style)
-{
- SyckNode *node;
- Data_Get_Struct( self, SyckNode, node );
-
- rb_iv_set( self, "@kind", sym_seq );
- rb_funcall( self, s_type_id_set, 1, type_id );
- rb_funcall( self, s_value_set, 1, val );
- rb_funcall( self, s_style_set, 1, style );
- return self;
-}
-
-/*
- * YAML::Syck::Seq.value=
- */
-VALUE
-syck_seq_value_set(VALUE self, VALUE val)
-{
- SyckNode *node;
- Data_Get_Struct( self, SyckNode, node );
-
- val = rb_check_array_type( val );
- if ( !NIL_P( val ) ) {
- int i;
- syck_seq_empty( node );
- for ( i = 0; i < RARRAY_LEN( val ); i++ )
- {
- syck_seq_add( node, rb_ary_entry(val, i) );
- }
- }
-
- rb_iv_set( self, "@value", val );
- return val;
-}
-
-/*
- * YAML::Syck::Seq.add
- */
-VALUE
-syck_seq_add_m(VALUE self, VALUE val)
-{
- SyckNode *node;
- VALUE emitter = rb_ivar_get( self, s_emitter );
- Data_Get_Struct( self, SyckNode, node );
-
- if ( rb_respond_to( emitter, s_node_export ) ) {
- val = rb_funcall( emitter, s_node_export, 1, val );
- }
- syck_seq_add( node, val );
- rb_ary_push( rb_ivar_get( self, s_value ), val );
-
- return self;
-}
-
-/*
- * YAML::Syck::Seq.style=
- */
-VALUE
-syck_seq_style_set(VALUE self, VALUE style)
-{
- SyckNode *node;
- Data_Get_Struct( self, SyckNode, node );
-
- if ( style == sym_inline )
- {
- node->data.list->style = seq_inline;
- }
- else
- {
- node->data.list->style = seq_none;
- }
-
- rb_iv_set( self, "@style", style );
- return self;
-}
-
-/*
- * YAML::Syck::Map.allocate
- */
-VALUE
-syck_map_alloc(VALUE class)
-{
- SyckNode *node;
- VALUE obj;
- node = syck_alloc_map();
- obj = Data_Wrap_Struct( class, syck_node_mark, syck_free_node, node );
- node->id = obj;
- return obj;
-}
-
-/*
- * YAML::Syck::Map.initialize
- */
-VALUE
-syck_map_initialize(VALUE self, VALUE type_id, VALUE val, VALUE style)
-{
- SyckNode *node;
- Data_Get_Struct( self, SyckNode, node );
-
- if ( !NIL_P( val ) )
- {
- VALUE hsh = rb_check_convert_type(val, T_HASH, "Hash", "to_hash");
- VALUE keys;
- int i;
- if ( NIL_P(hsh) )
- {
- rb_raise( rb_eTypeError, "wrong argument type" );
- }
-
- keys = rb_funcall( hsh, s_keys, 0 );
- for ( i = 0; i < RARRAY_LEN(keys); i++ )
- {
- VALUE key = rb_ary_entry(keys, i);
- syck_map_add( node, key, rb_hash_aref(hsh, key) );
- }
- }
-
- rb_iv_set( self, "@kind", sym_seq );
- rb_funcall( self, s_type_id_set, 1, type_id );
- rb_funcall( self, s_value_set, 1, val );
- rb_funcall( self, s_style_set, 1, style );
- return self;
-}
-
-/*
- * YAML::Syck::Map.value=
- */
-VALUE
-syck_map_value_set(VALUE self, VALUE val)
-{
- SyckNode *node;
- Data_Get_Struct( self, SyckNode, node );
-
- if ( !NIL_P( val ) )
- {
- VALUE hsh = rb_check_convert_type(val, T_HASH, "Hash", "to_hash");
- VALUE keys;
- int i;
- if ( NIL_P(hsh) )
- {
- rb_raise( rb_eTypeError, "wrong argument type" );
- }
-
- syck_map_empty( node );
- keys = rb_funcall( hsh, s_keys, 0 );
- for ( i = 0; i < RARRAY_LEN(keys); i++ )
- {
- VALUE key = rb_ary_entry(keys, i);
- syck_map_add( node, key, rb_hash_aref(hsh, key) );
- }
- }
-
- rb_iv_set( self, "@value", val );
- return val;
-}
-
-/*
- * YAML::Syck::Map.add
- */
-VALUE
-syck_map_add_m(VALUE self, VALUE key, VALUE val)
-{
- SyckNode *node;
- VALUE emitter = rb_ivar_get( self, s_emitter );
- Data_Get_Struct( self, SyckNode, node );
-
- if ( rb_respond_to( emitter, s_node_export ) ) {
- key = rb_funcall( emitter, s_node_export, 1, key );
- val = rb_funcall( emitter, s_node_export, 1, val );
- }
- syck_map_add( node, key, val );
- rb_hash_aset( rb_ivar_get( self, s_value ), key, val );
-
- return self;
-}
-
-/*
- * YAML::Syck::Map.style=
- */
-VALUE
-syck_map_style_set(VALUE self, VALUE style)
-{
- SyckNode *node;
- Data_Get_Struct( self, SyckNode, node );
-
- if ( style == sym_inline )
- {
- node->data.pairs->style = map_inline;
- }
- else
- {
- node->data.pairs->style = map_none;
- }
-
- rb_iv_set( self, "@style", style );
- return self;
-}
-
-#if 0
-/*
- * Cloning method for all node types
- */
-VALUE
-syck_node_init_copy(VALUE copy, VALUE orig)
-{
- SyckNode *copy_n;
- SyckNode *orig_n;
-
- if ( copy == orig )
- return copy;
-
- if ( TYPE( orig ) != T_DATA )
- {
- rb_raise( rb_eTypeError, "wrong argument type" );
- }
-
- Data_Get_Struct( orig, SyckNode, orig_n );
- Data_Get_Struct( copy, SyckNode, copy_n );
- MEMCPY( copy_n, orig_n, SyckNode, 1 );
- return copy;
-}
-#endif
-
-/*
- * YAML::Syck::Node#type_id=
- */
-VALUE
-syck_node_type_id_set(VALUE self, VALUE type_id)
-{
- SyckNode *node;
- Data_Get_Struct( self, SyckNode, node );
-
- S_FREE( node->type_id );
-
- if ( !NIL_P( type_id ) ) {
- StringValue( type_id );
- node->type_id = syck_strndup( RSTRING_PTR(type_id), RSTRING_LEN(type_id) );
- }
-
- rb_iv_set( self, "@type_id", type_id );
- return type_id;
-}
-
-/*
- * YAML::Syck::Node.transform
- */
-VALUE
-syck_node_transform(VALUE self)
-{
- VALUE t;
- SyckNode *n = NULL;
- SyckNode *orig_n;
- Data_Get_Struct(self, SyckNode, orig_n);
- t = Data_Wrap_Struct( cNode, syck_node_mark, syck_free_node, 0 );
-
- switch (orig_n->kind)
- {
- case syck_map_kind:
- {
- int i;
- DATA_PTR(t) = n = syck_alloc_map();
- for ( i = 0; i < orig_n->data.pairs->idx; i++ )
- {
- syck_map_add( n, rb_funcall( syck_map_read( orig_n, map_key, i ), s_transform, 0 ),
- rb_funcall( syck_map_read( orig_n, map_value, i ), s_transform, 0 ) );
- }
- }
- break;
-
- case syck_seq_kind:
- {
- int i;
- DATA_PTR(t) = n = syck_alloc_seq();
- for ( i = 0; i < orig_n->data.list->idx; i++ )
- {
- syck_seq_add( n, rb_funcall( syck_seq_read( orig_n, i ), s_transform, 0 ) );
- }
- }
- break;
-
- case syck_str_kind:
- DATA_PTR(t) = n = syck_new_str2( orig_n->data.str->ptr, orig_n->data.str->len, orig_n->data.str->style );
- break;
- }
-
- if ( orig_n->type_id != NULL )
- {
- n->type_id = syck_strndup( orig_n->type_id, strlen( orig_n->type_id ) );
- }
- if ( orig_n->anchor != NULL )
- {
- n->anchor = syck_strndup( orig_n->anchor, strlen( orig_n->anchor ) );
- }
- n->id = t;
- return rb_funcall( oDefaultResolver, s_node_import, 1, t );
-}
-
-/*
- * Emitter callback: assembles YAML document events from
- * Ruby symbols. This is a brilliant way to do it.
- * No one could possibly object.
- */
-void
-rb_syck_emitter_handler(SyckEmitter *e, st_data_t data)
-{
- SyckNode *n;
- Data_Get_Struct((VALUE)data, SyckNode, n);
-
- switch (n->kind)
- {
- case syck_map_kind:
- {
- int i;
- syck_emit_map( e, n->type_id, n->data.pairs->style );
- for ( i = 0; i < n->data.pairs->idx; i++ )
- {
- syck_emit_item( e, syck_map_read( n, map_key, i ) );
- syck_emit_item( e, syck_map_read( n, map_value, i ) );
- }
- syck_emit_end( e );
- }
- break;
-
- case syck_seq_kind:
- {
- int i;
- syck_emit_seq( e, n->type_id, n->data.list->style );
- for ( i = 0; i < n->data.list->idx; i++ )
- {
- syck_emit_item( e, syck_seq_read( n, i ) );
- }
- syck_emit_end( e );
- }
- break;
-
- case syck_str_kind:
- {
- syck_emit_scalar( e, n->type_id, n->data.str->style, 0, 0, 0, n->data.str->ptr, n->data.str->len );
- }
- break;
- }
-}
-
-/*
- * Handle output from the emitter
- */
-void
-rb_syck_output_handler(SyckEmitter * emitter, char *str, long len)
-{
- struct emitter_xtra *bonus = (struct emitter_xtra *)emitter->bonus;
- VALUE dest = bonus->port;
- if (TYPE(dest) == T_STRING) {
- rb_str_cat( dest, str, len );
- } else {
- rb_io_write( dest, rb_str_new( str, len ) );
- }
-}
-
-/*
- * Helper function for marking nodes in the anchor
- * symbol table.
- */
-void
-syck_out_mark(VALUE emitter, VALUE node)
-{
- SyckEmitter *emitterPtr;
- struct emitter_xtra *bonus;
- Data_Get_Struct(emitter, SyckEmitter, emitterPtr);
- bonus = (struct emitter_xtra *)emitterPtr->bonus;
- rb_ivar_set( node, s_emitter, emitter );
- /* syck_emitter_mark_node( emitterPtr, (st_data_t)node ); */
- if ( !NIL_P( bonus->oid ) ) {
- rb_hash_aset( bonus->data, bonus->oid, node );
- }
-}
-
-/*
- * Mark emitter values.
- */
-static void
-syck_mark_emitter(SyckEmitter *emitter)
-{
- struct emitter_xtra *bonus = (struct emitter_xtra *)emitter->bonus;
- rb_gc_mark( bonus->oid );
- rb_gc_mark( bonus->data );
- rb_gc_mark( bonus->port );
-}
-
-/*
- * Free the emitter and any bonus attachment.
- */
-void
-rb_syck_free_emitter(SyckEmitter *e)
-{
- S_FREE( e->bonus );
- syck_free_emitter(e);
-}
-
-/*
- * YAML::Syck::Emitter.allocate
- */
-VALUE syck_emitter_s_alloc _((VALUE));
-VALUE
-syck_emitter_s_alloc(VALUE class)
-{
- VALUE pobj;
- SyckEmitter *emitter = syck_new_emitter();
-
- emitter->bonus = S_ALLOC( struct emitter_xtra );
- S_MEMZERO( emitter->bonus, struct emitter_xtra, 1 );
-
- pobj = Data_Wrap_Struct( class, syck_mark_emitter, rb_syck_free_emitter, emitter );
- syck_emitter_handler( emitter, rb_syck_emitter_handler );
- syck_output_handler( emitter, rb_syck_output_handler );
-
- rb_ivar_set( pobj, s_out, rb_funcall( cOut, s_new, 1, pobj ) );
- return pobj;
-}
-
-static VALUE
-id_hash_new(void)
-{
- VALUE hash;
- hash = rb_hash_new();
- rb_funcall(hash, rb_intern("compare_by_identity"), 0);
- return hash;
-}
-
-/*
- * YAML::Syck::Emitter.reset( options )
- */
-VALUE
-syck_emitter_reset(int argc, VALUE *argv, VALUE self)
-{
- VALUE options, tmp;
- SyckEmitter *emitter;
- struct emitter_xtra *bonus;
-
- Data_Get_Struct(self, SyckEmitter, emitter);
- bonus = (struct emitter_xtra *)emitter->bonus;
-
- bonus->oid = Qnil;
- bonus->port = rb_str_new2( "" );
- bonus->data = id_hash_new();
-
- if (rb_scan_args(argc, argv, "01", &options) == 0)
- {
- options = rb_hash_new();
- rb_ivar_set(self, s_options, options);
- }
- else if ( !NIL_P(tmp = rb_check_string_type(options)) )
- {
- bonus->port = tmp;
- }
- else if ( rb_respond_to( options, s_write ) )
- {
- bonus->port = options;
- }
- else
- {
- Check_Type(options, T_HASH);
- rb_ivar_set(self, s_options, options);
- }
-
- emitter->headless = 0;
- rb_ivar_set(self, s_level, INT2FIX(0));
- rb_ivar_set(self, s_resolver, Qnil);
- return self;
-}
-
-/*
- * YAML::Syck::Emitter.emit( object_id ) { |out| ... }
- */
-VALUE
-syck_emitter_emit(int argc, VALUE *argv, VALUE self)
-{
- VALUE oid, proc;
- SyckEmitter *emitter;
- struct emitter_xtra *bonus;
- SYMID symple;
- int level = FIX2INT(rb_ivar_get(self, s_level)) + 1;
- rb_ivar_set(self, s_level, INT2FIX(level));
-
- rb_scan_args(argc, argv, "1&", &oid, &proc);
- Data_Get_Struct(self, SyckEmitter, emitter);
- bonus = (struct emitter_xtra *)emitter->bonus;
-
- /* Calculate anchors, normalize nodes, build a simpler symbol table */
- bonus->oid = oid;
- if ( !NIL_P( oid ) && RTEST( rb_funcall( bonus->data, s_haskey, 1, oid ) ) ) {
- symple = rb_hash_aref( bonus->data, oid );
- } else {
- symple = rb_funcall( proc, s_call, 1, rb_ivar_get( self, s_out ) );
- }
- syck_emitter_mark_node( emitter, (st_data_t)symple );
-
- /* Second pass, build emitted string */
- level -= 1;
- rb_ivar_set(self, s_level, INT2FIX(level));
- if ( level == 0 )
- {
- syck_emit(emitter, (st_data_t)symple);
- syck_emitter_flush(emitter, 0);
-
- return bonus->port;
- }
-
- return symple;
-}
-
-/*
- * YAML::Syck::Emitter#node_export
- */
-VALUE
-syck_emitter_node_export(VALUE self, VALUE node)
-{
- return rb_funcall( node, s_to_yaml, 1, self );
-}
-
-/*
- * YAML::Syck::Emitter#set_resolver
- */
-VALUE
-syck_emitter_set_resolver(VALUE self, VALUE resolver)
-{
- rb_ivar_set( self, s_resolver, resolver );
- return self;
-}
-
-/*
- * YAML::Syck::Out::initialize
- */
-VALUE
-syck_out_initialize(VALUE self, VALUE emitter)
-{
- rb_ivar_set( self, s_emitter, emitter );
- return self;
-}
-
-/*
- * YAML::Syck::Out::map
- */
-VALUE
-syck_out_map(int argc, VALUE *argv, VALUE self)
-{
- VALUE type_id, style, map;
- if (rb_scan_args(argc, argv, "11", &type_id, &style) == 1) {
- style = Qnil;
- }
- map = rb_funcall( cMap, s_new, 3, type_id, rb_hash_new(), style );
- syck_out_mark( rb_ivar_get( self, s_emitter ), map );
- rb_yield( map );
- return map;
-}
-
-/*
- * YAML::Syck::Out::seq
- */
-VALUE
-syck_out_seq(int argc, VALUE *argv, VALUE self)
-{
- VALUE type_id, style, seq;
- if (rb_scan_args(argc, argv, "11", &type_id, &style) == 1) {
- style = Qnil;
- }
- seq = rb_funcall( cSeq, s_new, 3, type_id, rb_ary_new(), style );
- syck_out_mark( rb_ivar_get( self, s_emitter ), seq );
- rb_yield( seq );
- return seq;
-}
-
-/*
- * YAML::Syck::Out::scalar
-syck_out_scalar( self, type_id, str, style )
- VALUE self, type_id, str, style;
- */
-VALUE
-syck_out_scalar(int argc, VALUE *argv, VALUE self)
-{
- VALUE type_id, str, style, scalar;
- rb_scan_args(argc, argv, "21", &type_id, &str, &style);
- scalar = rb_funcall( cScalar, s_new, 3, type_id, str, style );
- syck_out_mark( rb_ivar_get( self, s_emitter ), scalar );
- return scalar;
-}
-
-/*
- * Initialize Syck extension
- */
-void
-Init_syck()
-{
- VALUE rb_syck = rb_define_module_under( rb_cObject, "Syck" );
- rb_define_module_function( rb_syck, "compile", rb_syck_compile, 1 );
-
- /*
- * Global symbols
- */
- s_new = rb_intern("new");
- s_utc = rb_intern("utc");
- s_at = rb_intern("at");
- s_to_f = rb_intern("to_f");
- s_to_i = rb_intern("to_i");
- s_read = rb_intern("read");
- s_binmode = rb_intern("binmode");
- s_transfer = rb_intern("transfer");
- s_call = rb_intern("call");
- s_cmp = rb_intern("<=>");
- s_intern = rb_intern("intern");
- s_update = rb_intern("update");
- s_detect_implicit = rb_intern("detect_implicit");
- s_dup = rb_intern("dup");
- s_default_set = rb_intern("default=");
- s_match = rb_intern("match");
- s_push = rb_intern("push");
- s_haskey = rb_intern("has_key?");
- s_keys = rb_intern("keys");
- s_node_import = rb_intern("node_import");
- s_tr_bang = rb_intern("tr!");
- s_unpack = rb_intern("unpack");
- s_write = rb_intern("write");
- s_tag_read_class = rb_intern( "yaml_tag_read_class" );
- s_tag_subclasses = rb_intern( "yaml_tag_subclasses?" );
- s_emitter = rb_intern( "emitter" );
- s_set_resolver = rb_intern( "set_resolver" );
- s_node_export = rb_intern( "node_export" );
- s_to_yaml = rb_intern( "to_yaml" );
- s_transform = rb_intern( "transform" );
- s_yaml_new = rb_intern("yaml_new");
- s_yaml_initialize = rb_intern("yaml_initialize");
- s_each = rb_intern("each");
- s_parse = rb_intern("parse");
-
- s_tags = rb_intern("@tags");
- s_name = rb_intern("@name");
- s_options = rb_intern("@options");
- s_kind = rb_intern("@kind");
- s_type_id = rb_intern("@type_id");
- s_type_id_set = rb_intern("type_id=");
- s_resolver = rb_intern("@resolver");
- s_level = rb_intern( "@level" );
- s_style = rb_intern("@style");
- s_style_set = rb_intern("style=");
- s_value = rb_intern("@value");
- s_value_set = rb_intern("value=");
- s_out = rb_intern("@out");
- s_input = rb_intern("@input");
-
- sym_model = ID2SYM(rb_intern("Model"));
- sym_generic = ID2SYM(rb_intern("Generic"));
- sym_bytecode = ID2SYM(rb_intern("bytecode"));
- sym_map = ID2SYM(rb_intern("map"));
- sym_scalar = ID2SYM(rb_intern("scalar"));
- sym_seq = ID2SYM(rb_intern("seq"));
- sym_1quote = ID2SYM(rb_intern("quote1"));
- sym_2quote = ID2SYM(rb_intern("quote2"));
- sym_fold = ID2SYM(rb_intern("fold"));
- sym_literal = ID2SYM(rb_intern("literal"));
- sym_plain = ID2SYM(rb_intern("plain"));
- sym_inline = ID2SYM(rb_intern("inline"));
-
- /*
- * Define YAML::Syck::Resolver class
- */
- cResolver = rb_define_class_under( rb_syck, "Resolver", rb_cObject );
- rb_define_attr( cResolver, "tags", 1, 1 );
- rb_define_method( cResolver, "initialize", syck_resolver_initialize, 0 );
- rb_define_method( cResolver, "add_type", syck_resolver_add_type, 2 );
- rb_define_method( cResolver, "use_types_at", syck_resolver_use_types_at, 1 );
- rb_define_method( cResolver, "detect_implicit", syck_resolver_detect_implicit, 1 );
- rb_define_method( cResolver, "transfer", syck_resolver_transfer, 2 );
- rb_define_method( cResolver, "node_import", syck_resolver_node_import, 1 );
- rb_define_method( cResolver, "tagurize", syck_resolver_tagurize, 1 );
-
- rb_global_variable( &oDefaultResolver );
- oDefaultResolver = rb_funcall( cResolver, rb_intern( "new" ), 0 );
- rb_define_singleton_method( oDefaultResolver, "node_import", syck_defaultresolver_node_import, 1 );
- rb_define_singleton_method( oDefaultResolver, "detect_implicit", syck_defaultresolver_detect_implicit, 1 );
- rb_define_const( rb_syck, "DefaultResolver", oDefaultResolver );
- rb_global_variable( &oGenericResolver );
- oGenericResolver = rb_funcall( cResolver, rb_intern( "new" ), 0 );
- rb_define_singleton_method( oGenericResolver, "node_import", syck_genericresolver_node_import, 1 );
- rb_define_const( rb_syck, "GenericResolver", oGenericResolver );
-
- /*
- * Define YAML::Syck::Parser class
- */
- cParser = rb_define_class_under( rb_syck, "Parser", rb_cObject );
- rb_define_attr( cParser, "options", 1, 1 );
- rb_define_attr( cParser, "resolver", 1, 1 );
- rb_define_attr( cParser, "input", 1, 1 );
- rb_define_alloc_func( cParser, syck_parser_s_alloc );
- rb_define_method(cParser, "initialize", syck_parser_initialize, -1 );
- rb_define_method(cParser, "bufsize=", syck_parser_bufsize_set, 1 );
- rb_define_method(cParser, "bufsize", syck_parser_bufsize_get, 0 );
- rb_define_method(cParser, "load", syck_parser_load, -1);
- rb_define_method(cParser, "load_documents", syck_parser_load_documents, -1);
- rb_define_method(cParser, "set_resolver", syck_parser_set_resolver, 1);
-
- /*
- * Define YAML::Syck::Node class
- */
- cNode = rb_define_class_under( rb_syck, "Node", rb_cObject );
- rb_undef( cNode, rb_intern("initialize_copy") );
- rb_define_attr( cNode, "emitter", 1, 1 );
- rb_define_attr( cNode, "resolver", 1, 1 );
- rb_define_attr( cNode, "kind", 1, 0 );
- rb_define_attr( cNode, "type_id", 1, 0 );
- rb_define_attr( cNode, "value", 1, 0 );
- rb_define_method( cNode, "type_id=", syck_node_type_id_set, 1 );
- rb_define_method( cNode, "transform", syck_node_transform, 0);
-
- /*
- * Define YAML::Syck::Scalar, YAML::Syck::Seq, YAML::Syck::Map --
- * all are the publicly usable variants of YAML::Syck::Node
- */
- cScalar = rb_define_class_under( rb_syck, "Scalar", cNode );
- rb_define_alloc_func( cScalar, syck_scalar_alloc );
- rb_define_method( cScalar, "initialize", syck_scalar_initialize, 3 );
- rb_define_method( cScalar, "value=", syck_scalar_value_set, 1 );
- rb_define_method( cScalar, "style=", syck_scalar_style_set, 1 );
- cSeq = rb_define_class_under( rb_syck, "Seq", cNode );
- rb_define_alloc_func( cSeq, syck_seq_alloc );
- rb_define_method( cSeq, "initialize", syck_seq_initialize, 3 );
- rb_define_method( cSeq, "value=", syck_seq_value_set, 1 );
- rb_define_method( cSeq, "add", syck_seq_add_m, 1 );
- rb_define_method( cSeq, "style=", syck_seq_style_set, 1 );
- cMap = rb_define_class_under( rb_syck, "Map", cNode );
- rb_define_alloc_func( cMap, syck_map_alloc );
- rb_define_method( cMap, "initialize", syck_map_initialize, 3 );
- rb_define_method( cMap, "value=", syck_map_value_set, 1 );
- rb_define_method( cMap, "add", syck_map_add_m, 2 );
- rb_define_method( cMap, "style=", syck_map_style_set, 1 );
-
- /*
- * Define YAML::PrivateType class
- */
- cPrivateType = rb_define_class_under( rb_syck, "PrivateType", rb_cObject );
- rb_define_attr( cPrivateType, "type_id", 1, 1 );
- rb_define_attr( cPrivateType, "value", 1, 1 );
- rb_define_method( cPrivateType, "initialize", syck_privatetype_initialize, 2);
-
- /*
- * Define YAML::DomainType class
- */
- cDomainType = rb_define_class_under( rb_syck, "DomainType", rb_cObject );
- rb_define_attr( cDomainType, "domain", 1, 1 );
- rb_define_attr( cDomainType, "type_id", 1, 1 );
- rb_define_attr( cDomainType, "value", 1, 1 );
- rb_define_method( cDomainType, "initialize", syck_domaintype_initialize, 3);
-
- /*
- * Define YAML::Object class
- */
- cYObject = rb_define_class_under( rb_syck, "Object", rb_cObject );
- rb_define_attr( cYObject, "class", 1, 1 );
- rb_define_attr( cYObject, "ivars", 1, 1 );
- rb_define_method( cYObject, "initialize", syck_yobject_initialize, 2);
- rb_define_method( cYObject, "yaml_initialize", syck_yobject_initialize, 2);
-
- /*
- * Define YAML::Syck::BadAlias class
- */
- cBadAlias = rb_define_class_under( rb_syck, "BadAlias", rb_cObject );
- rb_define_attr( cBadAlias, "name", 1, 1 );
- rb_define_method( cBadAlias, "initialize", syck_badalias_initialize, 1);
- rb_define_method( cBadAlias, "<=>", syck_badalias_cmp, 1);
- rb_include_module( cBadAlias, rb_const_get( rb_cObject, rb_intern("Comparable") ) );
-
- /*
- * Define YAML::Syck::MergeKey class
- */
- cMergeKey = rb_define_class_under( rb_syck, "MergeKey", rb_cObject );
-
- /*
- * Define YAML::Syck::DefaultKey class
- */
- cDefaultKey = rb_define_class_under( rb_syck, "DefaultKey", rb_cObject );
-
- /*
- * Define YAML::Syck::Out classes
- */
- cOut = rb_define_class_under( rb_syck, "Out", rb_cObject );
- rb_define_attr( cOut, "emitter", 1, 1 );
- rb_define_method( cOut, "initialize", syck_out_initialize, 1 );
- rb_define_method( cOut, "map", syck_out_map, -1 );
- rb_define_method( cOut, "seq", syck_out_seq, -1 );
- rb_define_method( cOut, "scalar", syck_out_scalar, -1 );
-
- /*
- * Define YAML::Syck::Emitter class
- */
- cEmitter = rb_define_class_under( rb_syck, "Emitter", rb_cObject );
- rb_define_attr( cEmitter, "level", 1, 1 );
- rb_define_alloc_func( cEmitter, syck_emitter_s_alloc );
- rb_define_method( cEmitter, "initialize", syck_emitter_reset, -1 );
- rb_define_method( cEmitter, "reset", syck_emitter_reset, -1 );
- rb_define_method( cEmitter, "emit", syck_emitter_emit, -1 );
- rb_define_method( cEmitter, "set_resolver", syck_emitter_set_resolver, 1);
- rb_define_method( cEmitter, "node_export", syck_emitter_node_export, 1);
-}
-
diff --git a/ext/syck/syck.c b/ext/syck/syck.c
deleted file mode 100644
index 94e3992d3f..0000000000
--- a/ext/syck/syck.c
+++ /dev/null
@@ -1,524 +0,0 @@
-/*
- * syck.c
- *
- * $Author$
- *
- * Copyright (C) 2003 why the lucky stiff
- */
-#include "ruby/ruby.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include "syck.h"
-
-void syck_parser_pop_level( SyckParser * );
-
-/*
- * Custom assert
- */
-void
-syck_assert( const char *file_name, unsigned line_num, const char *expr )
-{
- fflush( NULL );
- fprintf( stderr, "\nAssertion failed: %s, line %u: %s\n",
- file_name, line_num, expr );
- fflush( stderr );
- abort();
-}
-
-/*
- * Allocates and copies a string
- */
-char *
-syck_strndup( const char *buf, long len )
-{
- char *new = S_ALLOC_N( char, len + 1 );
- S_MEMZERO( new, char, len + 1 );
- S_MEMCPY( new, buf, char, len );
- return new;
-}
-
-/*
- * Default FILE IO function
- */
-long
-syck_io_file_read( char *buf, SyckIoFile *file, long max_size, long skip )
-{
- long len = 0;
-
- ASSERT( file != NULL );
-
- max_size -= skip;
- len = fread( buf + skip, sizeof( char ), max_size, file->ptr );
- len += skip;
- buf[len] = '\0';
-
- return len;
-}
-
-/*
- * Default string IO function
- */
-long
-syck_io_str_read( char *buf, SyckIoStr *str, long max_size, long skip )
-{
- char *beg;
- long len = 0;
-
- ASSERT( str != NULL );
- beg = str->ptr;
- if ( max_size >= 0 )
- {
- max_size -= skip;
- if ( max_size <= 0 ) max_size = 0;
- else str->ptr += max_size;
-
- if ( str->ptr > str->end )
- {
- str->ptr = str->end;
- }
- }
- else
- {
- /* Use exact string length */
- while ( str->ptr < str->end ) {
- if (*(str->ptr++) == '\n') break;
- }
- }
- if ( beg < str->ptr )
- {
- len = ( str->ptr - beg );
- S_MEMCPY( buf + skip, beg, char, len );
- }
- len += skip;
- buf[len] = '\0';
-
- return len;
-}
-
-void
-syck_parser_reset_levels( SyckParser *p )
-{
- while ( p->lvl_idx > 1 )
- {
- syck_parser_pop_level( p );
- }
-
- if ( p->lvl_idx < 1 )
- {
- p->lvl_idx = 1;
- p->levels[0].spaces = -1;
- p->levels[0].ncount = 0;
- p->levels[0].domain = syck_strndup( "", 0 );
- }
- p->levels[0].status = syck_lvl_header;
-}
-
-void
-syck_parser_reset_cursor( SyckParser *p )
-{
- if ( p->buffer == NULL )
- {
- p->buffer = S_ALLOC_N( char, p->bufsize );
- S_MEMZERO( p->buffer, char, p->bufsize );
- }
- p->buffer[0] = '\0';
-
- p->cursor = NULL;
- p->lineptr = NULL;
- p->linectptr = NULL;
- p->token = NULL;
- p->toktmp = NULL;
- p->marker = NULL;
- p->limit = NULL;
-
- p->root = 0;
- p->root_on_error = 0;
- p->linect = 0;
- p->eof = 0;
- p->last_token = 0;
- p->force_token = 0;
-}
-
-/*
- * Value to return on a parse error
- */
-void
-syck_parser_set_root_on_error( SyckParser *p, SYMID roer )
-{
- p->root_on_error = roer;
-}
-
-/*
- * Allocate the parser
- */
-SyckParser *
-syck_new_parser(void)
-{
- SyckParser *p;
- p = S_ALLOC( SyckParser );
- S_MEMZERO( p, SyckParser, 1 );
- p->lvl_capa = ALLOC_CT;
- p->levels = S_ALLOC_N( SyckLevel, p->lvl_capa );
- p->input_type = syck_yaml_utf8;
- p->io_type = syck_io_str;
- p->io.str = NULL;
- p->syms = NULL;
- p->anchors = NULL;
- p->bad_anchors = NULL;
- p->implicit_typing = 1;
- p->taguri_expansion = 0;
- p->bufsize = SYCK_BUFFERSIZE;
- p->buffer = NULL;
- p->lvl_idx = 0;
- syck_parser_reset_levels( p );
- return p;
-}
-
-int
-syck_add_sym( SyckParser *p, void *data )
-{
- SYMID id = 0;
- if ( p->syms == NULL )
- {
- p->syms = st_init_numtable();
- }
- id = p->syms->num_entries + 1;
- st_insert( p->syms, id, (st_data_t)data );
- return (int)id;
-}
-
-int
-syck_lookup_sym( SyckParser *p, SYMID id, void **datap )
-{
- st_data_t data;
- int ret;
- if ( p->syms == NULL ) return 0;
- ret = st_lookup( p->syms, id, &data );
- if(ret) *datap = (void *)data;
- return ret;
-}
-
-int
-syck_st_free_nodes( char *key, SyckNode *n, char *arg )
-{
- if ( n != (void *)1 ) syck_free_node( n );
- n = NULL;
- return ST_CONTINUE;
-}
-
-void
-syck_st_free( SyckParser *p )
-{
- /*
- * Free the anchor tables
- */
- if ( p->anchors != NULL )
- {
- st_foreach( p->anchors, syck_st_free_nodes, 0 );
- st_free_table( p->anchors );
- p->anchors = NULL;
- }
-
- if ( p->bad_anchors != NULL )
- {
- st_foreach( p->bad_anchors, syck_st_free_nodes, 0 );
- st_free_table( p->bad_anchors );
- p->bad_anchors = NULL;
- }
-}
-
-typedef struct {
- long hash;
- char *buffer;
- long length;
- long remaining;
- int printed;
-} bytestring_t;
-
-int
-syck_st_free_syms( void *key, bytestring_t *sav, void *dummy )
-{
- S_FREE(sav->buffer);
- S_FREE(sav);
- return ST_CONTINUE;
-}
-
-void
-syck_free_parser( SyckParser *p )
-{
- /*
- * Free the adhoc symbol table
- */
- if ( p->syms != NULL )
- {
- st_foreach( p->syms, syck_st_free_syms, 0 );
- st_free_table( p->syms );
- p->syms = NULL;
- }
-
- /*
- * Free tables, levels
- */
- syck_st_free( p );
- syck_parser_reset_levels( p );
- S_FREE( p->levels[0].domain );
- S_FREE( p->levels );
-
- if ( p->buffer != NULL )
- {
- S_FREE( p->buffer );
- }
- free_any_io( p );
- S_FREE( p );
-}
-
-void
-syck_parser_handler( SyckParser *p, SyckNodeHandler hdlr )
-{
- ASSERT( p != NULL );
- p->handler = hdlr;
-}
-
-void
-syck_parser_implicit_typing( SyckParser *p, int flag )
-{
- p->implicit_typing = ( flag == 0 ? 0 : 1 );
-}
-
-void
-syck_parser_taguri_expansion( SyckParser *p, int flag )
-{
- p->taguri_expansion = ( flag == 0 ? 0 : 1 );
-}
-
-void
-syck_parser_error_handler( SyckParser *p, SyckErrorHandler hdlr )
-{
- ASSERT( p != NULL );
- p->error_handler = hdlr;
-}
-
-void
-syck_parser_bad_anchor_handler( SyckParser *p, SyckBadAnchorHandler hdlr )
-{
- ASSERT( p != NULL );
- p->bad_anchor_handler = hdlr;
-}
-
-void
-syck_parser_set_input_type( SyckParser *p, enum syck_parser_input input_type )
-{
- ASSERT( p != NULL );
- p->input_type = input_type;
-}
-
-void
-syck_parser_file( SyckParser *p, FILE *fp, SyckIoFileRead read )
-{
- ASSERT( p != NULL );
- free_any_io( p );
- syck_parser_reset_cursor( p );
- p->io_type = syck_io_file;
- p->io.file = S_ALLOC( SyckIoFile );
- p->io.file->ptr = fp;
- if ( read != NULL )
- {
- p->io.file->read = read;
- }
- else
- {
- p->io.file->read = syck_io_file_read;
- }
-}
-
-void
-syck_parser_str( SyckParser *p, char *ptr, long len, SyckIoStrRead read )
-{
- ASSERT( p != NULL );
- free_any_io( p );
- syck_parser_reset_cursor( p );
- p->io_type = syck_io_str;
- p->io.str = S_ALLOC( SyckIoStr );
- p->io.str->beg = ptr;
- p->io.str->ptr = ptr;
- p->io.str->end = ptr + len;
- if ( read != NULL )
- {
- p->io.str->read = read;
- }
- else
- {
- p->io.str->read = syck_io_str_read;
- }
-}
-
-void
-syck_parser_str_auto( SyckParser *p, char *ptr, SyckIoStrRead read )
-{
- syck_parser_str( p, ptr, strlen( ptr ), read );
-}
-
-SyckLevel *
-syck_parser_current_level( SyckParser *p )
-{
- return &p->levels[p->lvl_idx-1];
-}
-
-void
-syck_parser_pop_level( SyckParser *p )
-{
- ASSERT( p != NULL );
-
- /* The root level should never be popped */
- if ( p->lvl_idx <= 1 ) return;
-
- p->lvl_idx -= 1;
- free( p->levels[p->lvl_idx].domain );
-}
-
-void
-syck_parser_add_level( SyckParser *p, int len, enum syck_level_status status )
-{
- ASSERT( p != NULL );
- if ( p->lvl_idx + 1 > p->lvl_capa )
- {
- p->lvl_capa += ALLOC_CT;
- S_REALLOC_N( p->levels, SyckLevel, p->lvl_capa );
- }
-
- ASSERT( len > p->levels[p->lvl_idx-1].spaces );
- p->levels[p->lvl_idx].spaces = len;
- p->levels[p->lvl_idx].ncount = 0;
- p->levels[p->lvl_idx].domain = syck_strndup( p->levels[p->lvl_idx-1].domain, strlen( p->levels[p->lvl_idx-1].domain ) );
- p->levels[p->lvl_idx].status = status;
- p->lvl_idx += 1;
-}
-
-void
-free_any_io( SyckParser *p )
-{
- ASSERT( p != NULL );
- switch ( p->io_type )
- {
- case syck_io_str:
- if ( p->io.str != NULL )
- {
- S_FREE( p->io.str );
- p->io.str = NULL;
- }
- break;
-
- case syck_io_file:
- if ( p->io.file != NULL )
- {
- S_FREE( p->io.file );
- p->io.file = NULL;
- }
- break;
- }
-}
-
-long
-syck_move_tokens( SyckParser *p )
-{
- long count, skip;
- ASSERT( p->buffer != NULL );
-
- if ( p->token == NULL )
- return 0;
-
- skip = p->limit - p->token;
- if ( ( count = p->token - p->buffer ) )
- {
- if (skip > 0)
- S_MEMMOVE( p->buffer, p->token, char, skip );
- p->token = p->buffer;
- p->marker -= count;
- p->cursor -= count;
- p->toktmp -= count;
- p->limit -= count;
- p->lineptr -= count;
- p->linectptr -= count;
- }
- return skip;
-}
-
-void
-syck_check_limit( SyckParser *p, long len )
-{
- if ( p->cursor == NULL )
- {
- p->cursor = p->buffer;
- p->lineptr = p->buffer;
- p->linectptr = p->buffer;
- p->marker = p->buffer;
- }
- p->limit = p->buffer + len;
-}
-
-long
-syck_parser_read( SyckParser *p )
-{
- long len = 0;
- long skip = 0;
- ASSERT( p != NULL );
- switch ( p->io_type )
- {
- case syck_io_str:
- skip = syck_move_tokens( p );
- len = (p->io.str->read)( p->buffer, p->io.str, SYCK_BUFFERSIZE - 1, skip );
- break;
-
- case syck_io_file:
- skip = syck_move_tokens( p );
- len = (p->io.file->read)( p->buffer, p->io.file, SYCK_BUFFERSIZE - 1, skip );
- break;
- }
- syck_check_limit( p, len );
- return len;
-}
-
-long
-syck_parser_readlen( SyckParser *p, long max_size )
-{
- long len = 0;
- long skip = 0;
- ASSERT( p != NULL );
- switch ( p->io_type )
- {
- case syck_io_str:
- skip = syck_move_tokens( p );
- len = (p->io.str->read)( p->buffer, p->io.str, max_size, skip );
- break;
-
- case syck_io_file:
- skip = syck_move_tokens( p );
- len = (p->io.file->read)( p->buffer, p->io.file, max_size, skip );
- break;
- }
- syck_check_limit( p, len );
- return len;
-}
-
-SYMID
-syck_parse( SyckParser *p )
-{
- ASSERT( p != NULL );
-
- syck_st_free( p );
- syck_parser_reset_levels( p );
- syckparse( p );
- return p->root;
-}
-
-void
-syck_default_error_handler( SyckParser *p, const char *msg )
-{
- printf( "Error at [Line %d, Col %"PRIdPTRDIFF"]: %s\n",
- p->linect,
- p->cursor - p->lineptr,
- msg );
-}
-
diff --git a/ext/syck/syck.h b/ext/syck/syck.h
deleted file mode 100644
index 8885b000de..0000000000
--- a/ext/syck/syck.h
+++ /dev/null
@@ -1,453 +0,0 @@
-/*
- * syck.h
- *
- * $Author$
- *
- * Copyright (C) 2003 why the lucky stiff
- */
-
-#ifndef SYCK_H
-#define SYCK_H
-
-#define SYCK_YAML_MAJOR 1
-#define SYCK_YAML_MINOR 0
-
-#define YAML_DOMAIN "yaml.org,2002"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include "ruby/st.h"
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
-/*
- * Memory Allocation
- */
-#if defined(HAVE_ALLOCA_H) && !defined(__GNUC__)
-#include <alloca.h>
-#endif
-
-#ifdef DEBUG
-void syck_assert( const char *, unsigned, const char * );
-# define ASSERT(f) \
- (( f ) ? (void)0 : syck_assert( __FILE__, __LINE__, #f ))
-#else
-# define ASSERT(f) ((void)0)
-#endif
-
-#ifndef NULL
-# define NULL (void *)0
-#endif
-
-#define ALLOC_CT 8
-#define SYCK_BUFFERSIZE 4096
-#define S_ALLOC_N(type,n) (type*)malloc(sizeof(type)*(n))
-#define S_ALLOC(type) (type*)malloc(sizeof(type))
-#define S_REALLOC_N(var,type,n) (var)=(type*)realloc((char*)(var),sizeof(type)*(n))
-#define S_FREE(n) if (n) { free(n); n = NULL; }
-
-#define S_ALLOCA_N(type,n) (type*)alloca(sizeof(type)*(n))
-
-#define S_MEMZERO(p,type,n) memset((p), 0, sizeof(type)*(n))
-#define S_MEMCPY(p1,p2,type,n) memcpy((p1), (p2), sizeof(type)*(n))
-#define S_MEMMOVE(p1,p2,type,n) memmove((p1), (p2), sizeof(type)*(n))
-#define S_MEMCMP(p1,p2,type,n) memcmp((p1), (p2), sizeof(type)*(n))
-
-#define BLOCK_FOLD 10
-#define BLOCK_LIT 20
-#define BLOCK_PLAIN 30
-#define NL_CHOMP 40
-#define NL_KEEP 50
-
-/*
- * Node definitions
- */
-#ifndef ST_DATA_T_DEFINED
-typedef long st_data_t;
-#endif
-
-#define SYMID st_data_t
-
-typedef struct _syck_node SyckNode;
-
-enum syck_kind_tag {
- syck_map_kind,
- syck_seq_kind,
- syck_str_kind
-};
-
-enum map_part {
- map_key,
- map_value
-};
-
-enum map_style {
- map_none,
- map_inline
-};
-
-enum seq_style {
- seq_none,
- seq_inline
-};
-
-enum scalar_style {
- scalar_none,
- scalar_1quote,
- scalar_2quote,
- scalar_fold,
- scalar_literal,
- scalar_plain
-};
-
-/*
- * Node metadata struct
- */
-struct _syck_node {
- /* Symbol table ID */
- SYMID id;
- /* Underlying kind */
- enum syck_kind_tag kind;
- /* Fully qualified tag-uri for type */
- char *type_id;
- /* Anchor name */
- char *anchor;
- union {
- /* Storage for map data */
- struct SyckMap {
- enum map_style style;
- SYMID *keys;
- SYMID *values;
- long capa;
- long idx;
- } *pairs;
- /* Storage for sequence data */
- struct SyckSeq {
- enum seq_style style;
- SYMID *items;
- long capa;
- long idx;
- } *list;
- /* Storage for string data */
- struct SyckStr {
- enum scalar_style style;
- char *ptr;
- long len;
- } *str;
- } data;
- /* Shortcut node */
- void *shortcut;
-};
-
-/*
- * Parser definitions
- */
-typedef struct _syck_parser SyckParser;
-typedef struct _syck_file SyckIoFile;
-typedef struct _syck_str SyckIoStr;
-typedef struct _syck_level SyckLevel;
-
-typedef SYMID (*SyckNodeHandler)(SyckParser *, SyckNode *);
-typedef void (*SyckErrorHandler)(SyckParser *, const char *);
-typedef SyckNode * (*SyckBadAnchorHandler)(SyckParser *, char *);
-typedef long (*SyckIoFileRead)(char *, SyckIoFile *, long, long);
-typedef long (*SyckIoStrRead)(char *, SyckIoStr *, long, long);
-
-enum syck_io_type {
- syck_io_str,
- syck_io_file
-};
-
-enum syck_parser_input {
- syck_yaml_utf8,
- syck_yaml_utf16,
- syck_yaml_utf32,
- syck_bytecode_utf8
-};
-
-enum syck_level_status {
- syck_lvl_header,
- syck_lvl_doc,
- syck_lvl_open,
- syck_lvl_seq,
- syck_lvl_map,
- syck_lvl_block,
- syck_lvl_str,
- syck_lvl_iseq,
- syck_lvl_imap,
- syck_lvl_end,
- syck_lvl_pause,
- syck_lvl_anctag,
- syck_lvl_mapx,
- syck_lvl_seqx
-};
-
-/*
- * Parser structs
- */
-struct _syck_file {
- /* File pointer */
- FILE *ptr;
- /* Function which FILE -> buffer */
- SyckIoFileRead read;
-};
-
-struct _syck_str {
- /* String buffer pointers */
- char *beg, *ptr, *end;
- /* Function which string -> buffer */
- SyckIoStrRead read;
-};
-
-struct _syck_level {
- /* Indent */
- int spaces;
- /* Counts nodes emitted at this level, useful for parsing
- * keys and pairs in bytecode */
- int ncount;
- /* Does node have anchors or tags? */
- int anctag;
- /* Domain prefixing at the given level */
- char *domain;
- /* Keeps a node status */
- enum syck_level_status status;
-};
-
-struct _syck_parser {
- /* Root node */
- SYMID root, root_on_error;
- /* Implicit typing flag */
- int implicit_typing, taguri_expansion;
- /* Scripting language function to handle nodes */
- SyckNodeHandler handler;
- /* Error handler */
- SyckErrorHandler error_handler;
- /* InvalidAnchor handler */
- SyckBadAnchorHandler bad_anchor_handler;
- /* Parser input type */
- enum syck_parser_input input_type;
- /* IO type */
- enum syck_io_type io_type;
- /* Custom buffer size */
- size_t bufsize;
- /* Buffer pointers */
- char *buffer, *linectptr, *lineptr, *toktmp, *token, *cursor, *marker, *limit;
- /* Line counter */
- int linect;
- /* Last token from yylex() */
- int last_token;
- /* Force a token upon next call to yylex() */
- int force_token;
- /* EOF flag */
- int eof;
- union {
- SyckIoFile *file;
- SyckIoStr *str;
- } io;
- /* Symbol table for anchors */
- st_table *anchors, *bad_anchors;
- /* Optional symbol table for SYMIDs */
- st_table *syms;
- /* Levels of indentation */
- SyckLevel *levels;
- int lvl_idx;
- int lvl_capa;
- /* Pointer for extension's use */
- void *bonus;
-};
-
-/*
- * Emitter definitions
- */
-typedef struct _syck_emitter SyckEmitter;
-typedef struct _syck_emitter_node SyckEmitterNode;
-
-typedef void (*SyckOutputHandler)(SyckEmitter *, char *, long);
-typedef void (*SyckEmitterHandler)(SyckEmitter *, st_data_t);
-
-enum doc_stage {
- doc_open,
- doc_processing
-};
-
-/*
- * Emitter struct
- */
-struct _syck_emitter {
- /* Headerless doc flag */
- int headless;
- /* Force header? */
- int use_header;
- /* Force version? */
- int use_version;
- /* Sort hash keys */
- int sort_keys;
- /* Anchor format */
- char *anchor_format;
- /* Explicit typing on all collections? */
- int explicit_typing;
- /* Best width on folded scalars */
- int best_width;
- /* Use literal[1] or folded[2] blocks on all text? */
- enum scalar_style style;
- /* Stage of written document */
- enum doc_stage stage;
- /* Level counter */
- int level;
- /* Default indentation */
- int indent;
- /* Object ignore ID */
- SYMID ignore_id;
- /* Symbol table for anchors */
- st_table *markers, *anchors, *anchored;
- /* Custom buffer size */
- size_t bufsize;
- /* Buffer */
- char *buffer, *marker;
- /* Absolute position of the buffer */
- long bufpos;
- /* Handler for emitter nodes */
- SyckEmitterHandler emitter_handler;
- /* Handler for output */
- SyckOutputHandler output_handler;
- /* Levels of indentation */
- SyckLevel *levels;
- int lvl_idx;
- int lvl_capa;
- /* Pointer for extension's use */
- void *bonus;
-};
-
-/*
- * Emitter node metadata struct
- */
-struct _syck_emitter_node {
- /* Node buffer position */
- long pos;
- /* Current indent */
- long indent;
- /* Collection? */
- int is_shortcut;
-};
-
-/*
- * Handler prototypes
- */
-SYMID syck_hdlr_add_node( SyckParser *, SyckNode * );
-SyckNode *syck_hdlr_add_anchor( SyckParser *, char *, SyckNode * );
-void syck_hdlr_remove_anchor( SyckParser *, char * );
-SyckNode *syck_hdlr_get_anchor( SyckParser *, char * );
-void syck_add_transfer( char *, SyckNode *, int );
-char *syck_xprivate( const char *, int );
-char *syck_taguri( const char *, const char *, int );
-int syck_tagcmp( const char *, const char * );
-int syck_add_sym( SyckParser *, void * );
-int syck_lookup_sym( SyckParser *, SYMID, void ** );
-int syck_try_implicit( SyckNode * );
-char *syck_type_id_to_uri( const char * );
-void try_tag_implicit( SyckNode *, int );
-const char *syck_match_implicit( const char *, size_t );
-
-/*
- * API prototypes
- */
-char *syck_strndup( const char *, long );
-long syck_io_file_read( char *, SyckIoFile *, long, long );
-long syck_io_str_read( char *, SyckIoStr *, long, long );
-char *syck_base64enc( char *, long );
-char *syck_base64dec( char *, long );
-SyckEmitter *syck_new_emitter(void);
-SYMID syck_emitter_mark_node( SyckEmitter *, st_data_t );
-void syck_emitter_ignore_id( SyckEmitter *, SYMID );
-void syck_output_handler( SyckEmitter *, SyckOutputHandler );
-void syck_emitter_handler( SyckEmitter *, SyckEmitterHandler );
-void syck_free_emitter( SyckEmitter * );
-void syck_emitter_clear( SyckEmitter * );
-void syck_emitter_write( SyckEmitter *, const char *, long );
-void syck_emitter_escape( SyckEmitter *, const char *, long );
-void syck_emitter_flush( SyckEmitter *, long );
-void syck_emit( SyckEmitter *, st_data_t );
-void syck_emit_scalar( SyckEmitter *, const char *, enum scalar_style, int, int, char, const char *, long );
-void syck_emit_1quoted( SyckEmitter *, int, const char *, long );
-void syck_emit_2quoted( SyckEmitter *, int, const char *, long );
-void syck_emit_folded( SyckEmitter *, int, char, const char *, long );
-void syck_emit_literal( SyckEmitter *, char, const char *, long );
-void syck_emit_seq( SyckEmitter *, const char *, enum seq_style );
-void syck_emit_item( SyckEmitter *, st_data_t );
-void syck_emit_map( SyckEmitter *, const char *, enum map_style );
-void syck_emit_end( SyckEmitter * );
-void syck_emit_tag( SyckEmitter *, const char *, const char * );
-void syck_emit_indent( SyckEmitter * );
-SyckLevel *syck_emitter_current_level( SyckEmitter * );
-SyckLevel *syck_emitter_parent_level( SyckEmitter * );
-void syck_emitter_pop_level( SyckEmitter * );
-void syck_emitter_add_level( SyckEmitter *, int, enum syck_level_status );
-void syck_emitter_reset_levels( SyckEmitter * );
-SyckParser *syck_new_parser(void);
-void syck_free_parser( SyckParser * );
-void syck_parser_set_root_on_error( SyckParser *, SYMID );
-void syck_parser_implicit_typing( SyckParser *, int );
-void syck_parser_taguri_expansion( SyckParser *, int );
-int syck_scan_scalar( int, const char *, long );
-void syck_parser_handler( SyckParser *, SyckNodeHandler );
-void syck_parser_error_handler( SyckParser *, SyckErrorHandler );
-void syck_parser_bad_anchor_handler( SyckParser *, SyckBadAnchorHandler );
-void syck_parser_set_input_type( SyckParser *, enum syck_parser_input );
-void syck_parser_file( SyckParser *, FILE *, SyckIoFileRead );
-void syck_parser_str( SyckParser *, char *, long, SyckIoStrRead );
-void syck_parser_str_auto( SyckParser *, char *, SyckIoStrRead );
-SyckLevel *syck_parser_current_level( SyckParser * );
-void syck_parser_add_level( SyckParser *, int, enum syck_level_status );
-void syck_parser_pop_level( SyckParser * );
-void free_any_io( SyckParser * );
-long syck_parser_read( SyckParser * );
-long syck_parser_readlen( SyckParser *, long );
-SYMID syck_parse( SyckParser * );
-void syck_default_error_handler( SyckParser *, const char * );
-SYMID syck_yaml2byte_handler( SyckParser *, SyckNode * );
-char *syck_yaml2byte( char * );
-
-/*
- * Allocation prototypes
- */
-SyckNode *syck_alloc_map(void);
-SyckNode *syck_alloc_seq(void);
-SyckNode *syck_alloc_str(void);
-void syck_free_node( SyckNode * );
-void syck_free_members( SyckNode * );
-SyckNode *syck_new_str( const char *, enum scalar_style );
-SyckNode *syck_new_str2( const char *, long, enum scalar_style );
-void syck_replace_str( SyckNode *, char *, enum scalar_style );
-void syck_replace_str2( SyckNode *, char *, long, enum scalar_style );
-void syck_str_blow_away_commas( SyckNode * );
-char *syck_str_read( SyckNode * );
-SyckNode *syck_new_map( SYMID, SYMID );
-void syck_map_empty( SyckNode * );
-void syck_map_add( SyckNode *, SYMID, SYMID );
-SYMID syck_map_read( SyckNode *, enum map_part, long );
-void syck_map_assign( SyckNode *, enum map_part, long, SYMID );
-long syck_map_count( SyckNode * );
-void syck_map_update( SyckNode *, SyckNode * );
-SyckNode *syck_new_seq( SYMID );
-void syck_seq_empty( SyckNode * );
-void syck_seq_add( SyckNode *, SYMID );
-void syck_seq_assign( SyckNode *, long, SYMID );
-SYMID syck_seq_read( SyckNode *, long );
-long syck_seq_count( SyckNode * );
-
-/*
- * Lexer prototypes
- */
-void syckerror( const char * );
-int syckparse( void * );
-union YYSTYPE;
-int sycklex( union YYSTYPE *, SyckParser * );
-
-#if defined(__cplusplus)
-} /* extern "C" { */
-#endif
-
-#endif /* ifndef SYCK_H */
diff --git a/ext/syck/token.c b/ext/syck/token.c
deleted file mode 100644
index bea79c158a..0000000000
--- a/ext/syck/token.c
+++ /dev/null
@@ -1,2724 +0,0 @@
-/* Generated by re2c 0.9.10 on Tue Sep 20 17:46:17 2005 */
-#line 1 "token.re"
-/*
- * token.re
- *
- * $Author$
- *
- * Copyright (C) 2003 why the lucky stiff
- */
-#include "ruby/ruby.h"
-#include "syck.h"
-#include "gram.h"
-
-/*
- * Allocate quoted strings in chunks
- */
-#define QUOTELEN 1024
-
-/*
- * They do my bidding...
- */
-#define YYCTYPE char
-#define YYCURSOR parser->cursor
-#define YYMARKER parser->marker
-#define YYLIMIT parser->limit
-#define YYTOKEN parser->token
-#define YYTOKTMP parser->toktmp
-#define YYLINEPTR parser->lineptr
-#define YYLINECTPTR parser->linectptr
-#define YYLINE parser->linect
-#define YYFILL(n) syck_parser_read(parser)
-
-/*
- * Repositions the cursor at `n' offset from the token start.
- * Only works in `Header' and `Document' sections.
- */
-#define YYPOS(n) YYCURSOR = YYTOKEN + n
-
-/*
- * Track line numbers
- */
-#define NEWLINE(ptr) YYLINEPTR = ptr + newline_len(ptr); if ( YYLINEPTR > YYLINECTPTR ) { YYLINE++; YYLINECTPTR = YYLINEPTR; }
-
-/*
- * I like seeing the level operations as macros...
- */
-#define ADD_LEVEL(len, status) syck_parser_add_level( parser, len, status )
-#define POP_LEVEL() syck_parser_pop_level( parser )
-#define CURRENT_LEVEL() syck_parser_current_level( parser )
-
-/*
- * Force a token next time around sycklex()
- */
-#define FORCE_NEXT_TOKEN(tok) parser->force_token = tok;
-
-/*
- * Nice little macro to ensure we're YAML_IOPENed to the current level.
- * * Only use this macro in the "Document" section *
- */
-#define ENSURE_YAML_IOPEN(last_lvl, to_len, reset) \
- if ( last_lvl->spaces < to_len ) \
- { \
- if ( last_lvl->status == syck_lvl_iseq || last_lvl->status == syck_lvl_imap ) \
- { \
- goto Document; \
- } \
- else \
- { \
- ADD_LEVEL( to_len, syck_lvl_doc ); \
- if ( reset == 1 ) YYPOS(0); \
- return YAML_IOPEN; \
- } \
- }
-
-/*
- * Nice little macro to ensure closure of levels.
- * * Only use this macro in the "Document" section *
- */
-#define ENSURE_YAML_IEND(last_lvl, to_len) \
- if ( last_lvl->spaces > to_len ) \
- { \
- syck_parser_pop_level( parser ); \
- YYPOS(0); \
- return YAML_IEND; \
- }
-
-/*
- * Concatenates quoted string items and manages allocation
- * to the quoted string
- */
-#define QUOTECAT(s, c, i, l) \
- { \
- if ( i + 1 >= c ) \
- { \
- c += QUOTELEN; \
- S_REALLOC_N( s, char, c ); \
- } \
- s[i++] = l; \
- s[i] = '\0'; \
- }
-
-#define QUOTECATS(s, c, i, cs, cl) \
- { \
- while ( i + cl >= c ) \
- { \
- c += QUOTELEN; \
- S_REALLOC_N( s, char, c ); \
- } \
- S_MEMCPY( s + i, cs, char, cl ); \
- i += cl; \
- s[i] = '\0'; \
- }
-
-/*
- * Tags a plain scalar with a transfer method
- * * Use only in "Plain" section *
- */
-#define RETURN_IMPLICIT() \
- { \
- SyckNode *n = syck_alloc_str(); \
- YYCURSOR = YYTOKEN; \
- n->data.str->ptr = qstr; \
- n->data.str->len = qidx; \
- n->data.str->style = scalar_plain; \
- sycklval->nodeData = n; \
- if ( parser->implicit_typing == 1 ) \
- { \
- try_tag_implicit( sycklval->nodeData, parser->taguri_expansion ); \
- } \
- return YAML_PLAIN; \
- }
-
-/* concat the inline characters to the plain scalar */
-#define PLAIN_NOT_INL() \
- if ( *(YYCURSOR - 1) == ' ' || is_newline( YYCURSOR - 1 ) ) \
- { \
- YYCURSOR--; \
- } \
- QUOTECATS(qstr, qcapa, qidx, YYTOKEN, YYCURSOR - YYTOKEN); \
- goto Plain2;
-
-/* trim spaces off the end in case of indent */
-#define PLAIN_IS_INL() \
- char *walker = qstr + qidx - 1; \
- while ( walker > qstr && ( *walker == '\n' || *walker == ' ' || *walker == '\t' ) ) \
- { \
- qidx--; \
- walker[0] = '\0'; \
- walker--; \
- }
-
-/*
- * Keep or chomp block?
- * * Use only in "ScalarBlock" section *
- */
-#define RETURN_YAML_BLOCK() \
- { \
- SyckNode *n = syck_alloc_str(); \
- if ( ((SyckParser *)parser)->taguri_expansion == 1 ) \
- { \
- n->type_id = syck_taguri( YAML_DOMAIN, "str", 3 ); \
- } \
- else \
- { \
- n->type_id = syck_strndup( "str", 3 ); \
- } \
- n->data.str->ptr = qstr; \
- n->data.str->len = qidx; \
- if ( blockType == BLOCK_LIT ) { \
- n->data.str->style = scalar_literal; \
- } else { \
- n->data.str->style = scalar_fold; \
- } \
- if ( qidx > 0 ) \
- { \
- if ( nlDoWhat != NL_KEEP ) \
- { \
- char *fc = n->data.str->ptr + n->data.str->len - 1; \
- while ( is_newline( fc ) ) fc--; \
- if ( nlDoWhat != NL_CHOMP && fc < n->data.str->ptr + n->data.str->len - 1 ) \
- fc += 1; \
- n->data.str->len = fc - n->data.str->ptr + 1; \
- } \
- } \
- sycklval->nodeData = n; \
- return YAML_BLOCK; \
- }
-
-/*
- * Handles newlines, calculates indent
- */
-#define GOBBLE_UP_YAML_INDENT( ict, start ) \
- char *indent = start; \
- NEWLINE(indent); \
- while ( indent < YYCURSOR ) \
- { \
- if ( is_newline( ++indent ) ) \
- { \
- NEWLINE(indent); \
- } \
- } \
- ict = 0; \
- if ( *YYCURSOR == '\0' ) \
- { \
- ict = -1; \
- start = YYCURSOR - 1; \
- } \
- else if ( *YYLINEPTR == ' ' ) \
- { \
- ict = (int)(YYCURSOR - YYLINEPTR); \
- }
-
-/*
- * If an indent exists at the current level, back up.
- */
-#define GET_TRUE_YAML_INDENT(indt_len) \
- { \
- SyckLevel *lvl_deep = CURRENT_LEVEL(); \
- indt_len = lvl_deep->spaces; \
- if ( lvl_deep->status == syck_lvl_seq || ( indt_len == YYCURSOR - YYLINEPTR && lvl_deep->status != syck_lvl_map ) ) \
- { \
- SyckLevel *lvl_over; \
- parser->lvl_idx--; \
- lvl_over = CURRENT_LEVEL(); \
- indt_len = lvl_over->spaces; \
- parser->lvl_idx++; \
- } \
- }
-
-/*
- * Argjh! I hate globals! Here for syckerror() only!
- */
-SyckParser *syck_parser_ptr = NULL;
-
-/*
- * Accessory funcs later in this file.
- */
-void eat_comments( SyckParser * );
-char escape_seq( char );
-int is_newline( char *ptr );
-int newline_len( char *ptr );
-int sycklex_yaml_utf8( YYSTYPE *, SyckParser * );
-int sycklex_bytecode_utf8( YYSTYPE *, SyckParser * );
-int syckwrap();
-
-/*
- * My own re-entrant sycklex() using re2c.
- * You really get used to the limited regexp.
- * It's really nice to not rely on backtracking and such.
- */
-int
-sycklex( YYSTYPE *sycklval, SyckParser *parser )
-{
- switch ( parser->input_type )
- {
- case syck_yaml_utf8:
- return sycklex_yaml_utf8( sycklval, parser );
-
- case syck_yaml_utf16:
- syckerror( "UTF-16 is not currently supported in Syck.\nPlease contribute code to help this happen!" );
- break;
-
- case syck_yaml_utf32:
- syckerror( "UTF-32 is not currently supported in Syck.\nPlease contribute code to help this happen!" );
- break;
-
- case syck_bytecode_utf8:
- return sycklex_bytecode_utf8( sycklval, parser );
- }
- return YAML_DOCSEP;
-}
-
-/*
- * Parser for standard YAML [UTF-8]
- */
-int
-sycklex_yaml_utf8( YYSTYPE *sycklval, SyckParser *parser )
-{
- int doc_level = 0;
- syck_parser_ptr = parser;
- if ( YYCURSOR == NULL )
- {
- syck_parser_read( parser );
- }
-
- if ( parser->force_token != 0 )
- {
- int t = parser->force_token;
- parser->force_token = 0;
- return t;
- }
-
-#line 315 "token.re"
-
-
- if ( YYLINEPTR != YYCURSOR )
- {
- goto Document;
- }
-
-Header:
-
- YYTOKEN = YYCURSOR;
-
-
-#line 307 "<stdout>"
-{
- YYCTYPE yych;
- unsigned int yyaccept;
- goto yy0;
- ++YYCURSOR;
-yy0:
- if((YYLIMIT - YYCURSOR) < 5) YYFILL(5);
- yych = *YYCURSOR;
- switch(yych){
- case 0x00: goto yy7;
- case 0x09: case ' ': goto yy12;
- case 0x0A: goto yy9;
- case 0x0D: goto yy11;
- case '#': goto yy5;
- case '-': goto yy2;
- case '.': goto yy4;
- default: goto yy14;
- }
-yy2: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case '-': goto yy28;
- default: goto yy3;
- }
-yy3:
-#line 374 "token.re"
-{ YYPOS(0);
- goto Document;
- }
-#line 337 "<stdout>"
-yy4: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case '.': goto yy21;
- default: goto yy3;
- }
-yy5: ++YYCURSOR;
- goto yy6;
-yy6:
-#line 356 "token.re"
-{ eat_comments( parser );
- goto Header;
- }
-#line 351 "<stdout>"
-yy7: ++YYCURSOR;
- goto yy8;
-yy8:
-#line 360 "token.re"
-{ SyckLevel *lvl = CURRENT_LEVEL();
- ENSURE_YAML_IEND(lvl, -1);
- YYPOS(0);
- return 0;
- }
-#line 361 "<stdout>"
-yy9: yyaccept = 1;
- yych = *(YYMARKER = ++YYCURSOR);
- goto yy18;
-yy10:
-#line 366 "token.re"
-{ GOBBLE_UP_YAML_INDENT( doc_level, YYTOKEN );
- goto Header;
- }
-#line 370 "<stdout>"
-yy11: yych = *++YYCURSOR;
- switch(yych){
- case 0x0A: goto yy17;
- default: goto yy3;
- }
-yy12: ++YYCURSOR;
- yych = *YYCURSOR;
- goto yy16;
-yy13:
-#line 370 "token.re"
-{ doc_level = (int)(YYCURSOR - YYLINEPTR);
- goto Header;
- }
-#line 384 "<stdout>"
-yy14: yych = *++YYCURSOR;
- goto yy3;
-yy15: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy16;
-yy16: switch(yych){
- case 0x09: case ' ': goto yy15;
- default: goto yy13;
- }
-yy17: yyaccept = 1;
- YYMARKER = ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy18;
-yy18: switch(yych){
- case 0x0A: case ' ': goto yy17;
- case 0x0D: goto yy19;
- default: goto yy10;
- }
-yy19: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- switch(yych){
- case 0x0A: goto yy17;
- default: goto yy20;
- }
-yy20: YYCURSOR = YYMARKER;
- switch(yyaccept){
- case 1: goto yy10;
- case 0: goto yy3;
- }
-yy21: yych = *++YYCURSOR;
- switch(yych){
- case '.': goto yy22;
- default: goto yy20;
- }
-yy22: yych = *++YYCURSOR;
- switch(yych){
- case 0x0A: goto yy23;
- case 0x0D: goto yy27;
- case ' ': goto yy25;
- default: goto yy20;
- }
-yy23: ++YYCURSOR;
- goto yy24;
-yy24:
-#line 342 "token.re"
-{ SyckLevel *lvl = CURRENT_LEVEL();
- if ( lvl->status == syck_lvl_header )
- {
- goto Header;
- }
- else
- {
- ENSURE_YAML_IEND(lvl, -1);
- YYPOS(0);
- return 0;
- }
- return 0;
- }
-#line 446 "<stdout>"
-yy25: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy26;
-yy26: switch(yych){
- case ' ': goto yy25;
- default: goto yy24;
- }
-yy27: yych = *++YYCURSOR;
- switch(yych){
- case 0x0A: goto yy23;
- default: goto yy20;
- }
-yy28: yych = *++YYCURSOR;
- switch(yych){
- case '-': goto yy29;
- default: goto yy20;
- }
-yy29: yych = *++YYCURSOR;
- switch(yych){
- case 0x0A: goto yy30;
- case 0x0D: goto yy34;
- case ' ': goto yy32;
- default: goto yy20;
- }
-yy30: ++YYCURSOR;
- goto yy31;
-yy31:
-#line 328 "token.re"
-{ SyckLevel *lvl = CURRENT_LEVEL();
- if ( lvl->status == syck_lvl_header )
- {
- YYPOS(3);
- goto Directive;
- }
- else
- {
- ENSURE_YAML_IEND(lvl, -1);
- YYPOS(0);
- return 0;
- }
- }
-#line 489 "<stdout>"
-yy32: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy33;
-yy33: switch(yych){
- case ' ': goto yy32;
- default: goto yy31;
- }
-yy34: ++YYCURSOR;
- switch((yych = *YYCURSOR)) {
- case 0x0A: goto yy30;
- default: goto yy20;
- }
-}
-#line 378 "token.re"
-
-
-Document:
- {
- SyckLevel *lvl = CURRENT_LEVEL();
- if ( lvl->status == syck_lvl_header )
- {
- lvl->status = syck_lvl_doc;
- }
-
- YYTOKEN = YYCURSOR;
-
-
-#line 518 "<stdout>"
-{
- YYCTYPE yych;
- unsigned int yyaccept;
- goto yy35;
- ++YYCURSOR;
-yy35:
- if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
- yych = *YYCURSOR;
- switch(yych){
- case 0x00: goto yy62;
- case 0x09: case ' ': goto yy60;
- case 0x0A: goto yy37;
- case 0x0D: goto yy39;
- case '!': goto yy51;
- case '"': goto yy55;
- case '#': goto yy58;
- case '&': goto yy49;
- case '\'': goto yy53;
- case '*': goto yy50;
- case ',': case ':': goto yy47;
- case '-': case '?': goto yy48;
- case '>': case '|': goto yy57;
- case '[': goto yy41;
- case ']': case '}': goto yy45;
- case '{': goto yy43;
- default: goto yy64;
- }
-yy37: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- goto yy92;
-yy38:
-#line 392 "token.re"
-{ /* Isolate spaces */
- int indt_len;
- GOBBLE_UP_YAML_INDENT( indt_len, YYTOKEN );
- lvl = CURRENT_LEVEL();
- doc_level = 0;
-
- /* XXX: Comment lookahead */
- if ( *YYCURSOR == '#' )
- {
- goto Document;
- }
-
- /* Ignore indentation inside inlines */
- if ( lvl->status == syck_lvl_iseq || lvl->status == syck_lvl_imap )
- {
- goto Document;
- }
-
- /* Check for open indent */
- ENSURE_YAML_IEND(lvl, indt_len);
- ENSURE_YAML_IOPEN(lvl, indt_len, 0);
- if ( indt_len == -1 )
- {
- return 0;
- }
- return YAML_INDENT;
- }
-#line 578 "<stdout>"
-yy39: ++YYCURSOR;
- switch((yych = *YYCURSOR)) {
- case 0x0A: goto yy91;
- default: goto yy40;
- }
-yy40:
-#line 497 "token.re"
-{ ENSURE_YAML_IOPEN(lvl, doc_level, 1);
- goto Plain;
- }
-#line 589 "<stdout>"
-yy41: ++YYCURSOR;
- goto yy42;
-yy42:
-#line 420 "token.re"
-{ ENSURE_YAML_IOPEN(lvl, doc_level, 1);
- lvl = CURRENT_LEVEL();
- ADD_LEVEL(lvl->spaces + 1, syck_lvl_iseq);
- return YYTOKEN[0];
- }
-#line 599 "<stdout>"
-yy43: ++YYCURSOR;
- goto yy44;
-yy44:
-#line 426 "token.re"
-{ ENSURE_YAML_IOPEN(lvl, doc_level, 1);
- lvl = CURRENT_LEVEL();
- ADD_LEVEL(lvl->spaces + 1, syck_lvl_imap);
- return YYTOKEN[0];
- }
-#line 609 "<stdout>"
-yy45: ++YYCURSOR;
- goto yy46;
-yy46:
-#line 432 "token.re"
-{ POP_LEVEL();
- return YYTOKEN[0];
- }
-#line 617 "<stdout>"
-yy47: yyaccept = 1;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case 0x0A: goto yy86;
- case 0x0D: goto yy90;
- case ' ': goto yy88;
- default: goto yy40;
- }
-yy48: yyaccept = 1;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case 0x0A: goto yy81;
- case 0x0D: goto yy85;
- case ' ': goto yy83;
- default: goto yy40;
- }
-yy49: yych = *++YYCURSOR;
- switch(yych){
- case '-': case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z': case '_': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy78;
- default: goto yy40;
- }
-yy50: yych = *++YYCURSOR;
- switch(yych){
- case '-': case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z': case '_': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy75;
- default: goto yy40;
- }
-yy51: ++YYCURSOR;
- goto yy52;
-yy52:
-#line 471 "token.re"
-{ goto TransferMethod; }
-#line 767 "<stdout>"
-yy53: ++YYCURSOR;
- goto yy54;
-yy54:
-#line 473 "token.re"
-{ ENSURE_YAML_IOPEN(lvl, doc_level, 1);
- goto SingleQuote; }
-#line 774 "<stdout>"
-yy55: ++YYCURSOR;
- goto yy56;
-yy56:
-#line 476 "token.re"
-{ ENSURE_YAML_IOPEN(lvl, doc_level, 1);
- goto DoubleQuote; }
-#line 781 "<stdout>"
-yy57: yyaccept = 1;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case 0x0A: goto yy70;
- case 0x0D: goto yy74;
- case ' ': goto yy72;
- case '+': case '-': case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy67;
- default: goto yy40;
- }
-yy58: ++YYCURSOR;
- goto yy59;
-yy59:
-#line 486 "token.re"
-{ eat_comments( parser );
- goto Document;
- }
-#line 807 "<stdout>"
-yy60: ++YYCURSOR;
- yych = *YYCURSOR;
- goto yy66;
-yy61:
-#line 490 "token.re"
-{ goto Document; }
-#line 814 "<stdout>"
-yy62: ++YYCURSOR;
- goto yy63;
-yy63:
-#line 492 "token.re"
-{ ENSURE_YAML_IEND(lvl, -1);
- YYPOS(0);
- return 0;
- }
-#line 823 "<stdout>"
-yy64: yych = *++YYCURSOR;
- goto yy40;
-yy65: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy66;
-yy66: switch(yych){
- case 0x09: case ' ': goto yy65;
- default: goto yy61;
- }
-yy67: ++YYCURSOR;
- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
- yych = *YYCURSOR;
- goto yy68;
-yy68: switch(yych){
- case 0x0A: goto yy70;
- case 0x0D: goto yy74;
- case ' ': goto yy72;
- case '+': case '-': case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy67;
- default: goto yy69;
- }
-yy69: YYCURSOR = YYMARKER;
- switch(yyaccept){
- case 0: goto yy38;
- case 1: goto yy40;
- }
-yy70: ++YYCURSOR;
- goto yy71;
-yy71:
-#line 479 "token.re"
-{ if ( is_newline( YYCURSOR - 1 ) )
- {
- YYCURSOR--;
- }
- goto ScalarBlock;
- }
-#line 869 "<stdout>"
-yy72: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy73;
-yy73: switch(yych){
- case ' ': goto yy72;
- default: goto yy71;
- }
-yy74: yych = *++YYCURSOR;
- switch(yych){
- case 0x0A: goto yy70;
- default: goto yy69;
- }
-yy75: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy76;
-yy76: switch(yych){
- case '-': case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z': case '_': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy75;
- default: goto yy77;
- }
-yy77:
-#line 466 "token.re"
-{ ENSURE_YAML_IOPEN(lvl, doc_level, 1);
- sycklval->name = syck_strndup( YYTOKEN + 1, YYCURSOR - YYTOKEN - 1 );
- return YAML_ALIAS;
- }
-#line 956 "<stdout>"
-yy78: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy79;
-yy79: switch(yych){
- case '-': case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z': case '_': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy78;
- default: goto yy80;
- }
-yy80:
-#line 455 "token.re"
-{ sycklval->name = syck_strndup( YYTOKEN + 1, YYCURSOR - YYTOKEN - 1 );
-
- /*
- * Remove previous anchors of the same name. Since the parser will likely
- * construct deeper nodes first, we want those nodes to be placed in the
- * queue for matching at a higher level of indentation.
- */
- syck_hdlr_remove_anchor(parser, sycklval->name);
- return YAML_ANCHOR;
- }
-#line 1036 "<stdout>"
-yy81: ++YYCURSOR;
- goto yy82;
-yy82:
-#line 441 "token.re"
-{ ENSURE_YAML_IOPEN(lvl, (int)(YYTOKEN - YYLINEPTR), 1);
- FORCE_NEXT_TOKEN(YAML_IOPEN);
- if ( *YYCURSOR == '#' || is_newline( YYCURSOR ) || is_newline( YYCURSOR - 1 ) )
- {
- YYCURSOR--;
- ADD_LEVEL((int)((YYTOKEN + 1) - YYLINEPTR), syck_lvl_seq);
- }
- else /* spaces followed by content uses the space as indentation */
- {
- ADD_LEVEL((int)(YYCURSOR - YYLINEPTR), syck_lvl_seq);
- }
- return YYTOKEN[0];
- }
-#line 1054 "<stdout>"
-yy83: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy84;
-yy84: switch(yych){
- case ' ': goto yy83;
- default: goto yy82;
- }
-yy85: yych = *++YYCURSOR;
- switch(yych){
- case 0x0A: goto yy81;
- default: goto yy69;
- }
-yy86: ++YYCURSOR;
- goto yy87;
-yy87:
-#line 436 "token.re"
-{ if ( *YYTOKEN == ':' && lvl->status != syck_lvl_imap ) lvl->status = syck_lvl_map;
- YYPOS(1);
- return YYTOKEN[0];
- }
-#line 1076 "<stdout>"
-yy88: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy89;
-yy89: switch(yych){
- case ' ': goto yy88;
- default: goto yy87;
- }
-yy90: yych = *++YYCURSOR;
- switch(yych){
- case 0x0A: goto yy86;
- default: goto yy69;
- }
-yy91: yyaccept = 0;
- YYMARKER = ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy92;
-yy92: switch(yych){
- case 0x0A: case ' ': goto yy91;
- case 0x0D: goto yy93;
- default: goto yy38;
- }
-yy93: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- switch(yych){
- case 0x0A: goto yy91;
- default: goto yy69;
- }
-}
-#line 501 "token.re"
-
- }
-
-Directive:
- {
- YYTOKTMP = YYCURSOR;
-
-
-#line 1117 "<stdout>"
-{
- YYCTYPE yych;
- unsigned int yyaccept = 0;
- goto yy94;
- ++YYCURSOR;
-yy94:
- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
- yych = *YYCURSOR;
- switch(yych){
- case 0x00: goto yy96;
- case 0x09: case ' ': goto yy99;
- case '%': goto yy97;
- default: goto yy101;
- }
-yy96: YYCURSOR = YYMARKER;
- switch(yyaccept){
- case 0: goto yy98;
- }
-yy97: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case '.':
- case '/':
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case ':':
- case ';':
- case '<':
- case '=':
- case '>':
- case '?':
- case '@':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '[':
- case '\\':
- case ']':
- case '^':
- case '_': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy104;
- default: goto yy98;
- }
-yy98:
-#line 514 "token.re"
-{ YYCURSOR = YYTOKTMP;
- return YAML_DOCSEP;
- }
-#line 1221 "<stdout>"
-yy99: ++YYCURSOR;
- yych = *YYCURSOR;
- goto yy103;
-yy100:
-#line 512 "token.re"
-{ goto Directive; }
-#line 1228 "<stdout>"
-yy101: yych = *++YYCURSOR;
- goto yy98;
-yy102: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy103;
-yy103: switch(yych){
- case 0x09: case ' ': goto yy102;
- default: goto yy100;
- }
-yy104: ++YYCURSOR;
- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
- yych = *YYCURSOR;
- goto yy105;
-yy105: switch(yych){
- case '.':
- case '/':
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case ';':
- case '<':
- case '=':
- case '>':
- case '?':
- case '@':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '[':
- case '\\':
- case ']':
- case '^':
- case '_': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy104;
- case ':': goto yy106;
- default: goto yy96;
- }
-yy106: yych = *++YYCURSOR;
- switch(yych){
- case '.':
- case '/':
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case ':':
- case ';':
- case '<':
- case '=':
- case '>':
- case '?':
- case '@':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '[':
- case '\\':
- case ']':
- case '^':
- case '_': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy107;
- default: goto yy96;
- }
-yy107: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy108;
-yy108: switch(yych){
- case '.':
- case '/':
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case ':':
- case ';':
- case '<':
- case '=':
- case '>':
- case '?':
- case '@':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '[':
- case '\\':
- case ']':
- case '^':
- case '_': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy107;
- default: goto yy109;
- }
-yy109:
-#line 510 "token.re"
-{ goto Directive; }
-#line 1484 "<stdout>"
-}
-#line 517 "token.re"
-
-
- }
-
-Plain:
- {
- int qidx = 0;
- int qcapa = 100;
- char *qstr = S_ALLOC_N( char, qcapa );
- SyckLevel *plvl;
- int parentIndent;
-
- YYCURSOR = YYTOKEN;
- plvl = CURRENT_LEVEL();
- GET_TRUE_YAML_INDENT(parentIndent);
-
-Plain2:
- YYTOKEN = YYCURSOR;
-
-Plain3:
-
-
-#line 1509 "<stdout>"
-{
- YYCTYPE yych;
- unsigned int yyaccept;
- goto yy110;
- ++YYCURSOR;
-yy110:
- if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
- yych = *YYCURSOR;
- switch(yych){
- case 0x00: goto yy124;
- case 0x09: goto yy126;
- case 0x0A: goto yy112;
- case 0x0D: goto yy114;
- case ' ': goto yy122;
- case ',': goto yy117;
- case ':': goto yy116;
- case ']': goto yy120;
- case '}': goto yy118;
- default: goto yy127;
- }
-yy112: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- goto yy142;
-yy113:
-#line 540 "token.re"
-{ int indt_len, nl_count = 0;
- SyckLevel *lvl;
- char *tok = YYTOKEN;
- GOBBLE_UP_YAML_INDENT( indt_len, tok );
- lvl = CURRENT_LEVEL();
-
- if ( indt_len <= parentIndent )
- {
- RETURN_IMPLICIT();
- }
-
- while ( YYTOKEN < YYCURSOR )
- {
- int nl_len = newline_len( YYTOKEN++ );
- if ( nl_len )
- {
- nl_count++;
- YYTOKEN += nl_len - 1;
- }
- }
- if ( nl_count <= 1 )
- {
- QUOTECAT(qstr, qcapa, qidx, ' ');
- }
- else
- {
- int i;
- for ( i = 0; i < nl_count - 1; i++ )
- {
- QUOTECAT(qstr, qcapa, qidx, '\n');
- }
- }
-
- goto Plain2;
- }
-#line 1570 "<stdout>"
-yy114: ++YYCURSOR;
- switch((yych = *YYCURSOR)) {
- case 0x0A: goto yy141;
- default: goto yy115;
- }
-yy115:
-#line 627 "token.re"
-{ QUOTECATS(qstr, qcapa, qidx, YYTOKEN, YYCURSOR - YYTOKEN);
- goto Plain2;
- }
-#line 1581 "<stdout>"
-yy116: yyaccept = 1;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case 0x0A: goto yy136;
- case 0x0D: goto yy140;
- case ' ': goto yy138;
- default: goto yy115;
- }
-yy117: yyaccept = 1;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case 0x0A: goto yy130;
- case 0x0D: goto yy134;
- case ' ': goto yy132;
- default: goto yy115;
- }
-yy118: ++YYCURSOR;
- goto yy119;
-yy119:
-#line 589 "token.re"
-{ if ( plvl->status != syck_lvl_imap )
- {
- PLAIN_NOT_INL();
- }
- else
- {
- PLAIN_IS_INL();
- }
- RETURN_IMPLICIT();
- }
-#line 1612 "<stdout>"
-yy120: ++YYCURSOR;
- goto yy121;
-yy121:
-#line 600 "token.re"
-{ if ( plvl->status != syck_lvl_iseq )
- {
- PLAIN_NOT_INL();
- }
- else
- {
- PLAIN_IS_INL();
- }
- RETURN_IMPLICIT();
- }
-#line 1627 "<stdout>"
-yy122: ++YYCURSOR;
- switch((yych = *YYCURSOR)) {
- case '#': goto yy128;
- default: goto yy123;
- }
-yy123:
-#line 617 "token.re"
-{ if ( qidx == 0 )
- {
- goto Plain2;
- }
- else
- {
- goto Plain3;
- }
- }
-#line 1644 "<stdout>"
-yy124: ++YYCURSOR;
- goto yy125;
-yy125:
-#line 615 "token.re"
-{ RETURN_IMPLICIT(); }
-#line 1650 "<stdout>"
-yy126: yych = *++YYCURSOR;
- goto yy123;
-yy127: yych = *++YYCURSOR;
- goto yy115;
-yy128: ++YYCURSOR;
- goto yy129;
-yy129:
-#line 611 "token.re"
-{ eat_comments( parser );
- RETURN_IMPLICIT();
- }
-#line 1662 "<stdout>"
-yy130: ++YYCURSOR;
- goto yy131;
-yy131:
-#line 578 "token.re"
-{ if ( plvl->status != syck_lvl_iseq && plvl->status != syck_lvl_imap )
- {
- PLAIN_NOT_INL();
- }
- else
- {
- PLAIN_IS_INL();
- }
- RETURN_IMPLICIT();
- }
-#line 1677 "<stdout>"
-yy132: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy133;
-yy133: switch(yych){
- case ' ': goto yy132;
- default: goto yy131;
- }
-yy134: yych = *++YYCURSOR;
- switch(yych){
- case 0x0A: goto yy130;
- default: goto yy135;
- }
-yy135: YYCURSOR = YYMARKER;
- switch(yyaccept){
- case 0: goto yy113;
- case 1: goto yy115;
- }
-yy136: ++YYCURSOR;
- goto yy137;
-yy137:
-#line 576 "token.re"
-{ RETURN_IMPLICIT(); }
-#line 1701 "<stdout>"
-yy138: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy139;
-yy139: switch(yych){
- case ' ': goto yy138;
- default: goto yy137;
- }
-yy140: yych = *++YYCURSOR;
- switch(yych){
- case 0x0A: goto yy136;
- default: goto yy135;
- }
-yy141: yyaccept = 0;
- YYMARKER = ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy142;
-yy142: switch(yych){
- case 0x0A: case ' ': goto yy141;
- case 0x0D: goto yy143;
- default: goto yy113;
- }
-yy143: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- switch(yych){
- case 0x0A: goto yy141;
- default: goto yy135;
- }
-}
-#line 631 "token.re"
-
- }
-
-SingleQuote:
- {
- int qidx = 0;
- int qcapa = 100;
- char *qstr = S_ALLOC_N( char, qcapa );
-
-SingleQuote2:
- YYTOKEN = YYCURSOR;
-
-
-#line 1747 "<stdout>"
-{
- YYCTYPE yych;
- unsigned int yyaccept;
- goto yy144;
- ++YYCURSOR;
-yy144:
- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
- yych = *YYCURSOR;
- switch(yych){
- case 0x00: goto yy152;
- case 0x0A: goto yy146;
- case 0x0D: goto yy148;
- case '\'': goto yy150;
- default: goto yy153;
- }
-yy146: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- goto yy157;
-yy147:
-#line 645 "token.re"
-{ int indt_len;
- int nl_count = 0;
- SyckLevel *lvl;
- GOBBLE_UP_YAML_INDENT( indt_len, YYTOKEN );
- lvl = CURRENT_LEVEL();
-
- if ( lvl->status != syck_lvl_str )
- {
- ADD_LEVEL( indt_len, syck_lvl_str );
- }
- else if ( indt_len < lvl->spaces )
- {
- /* Error! */
- }
-
- while ( YYTOKEN < YYCURSOR )
- {
- int nl_len = newline_len( YYTOKEN++ );
- if ( nl_len )
- {
- nl_count++;
- YYTOKEN += nl_len - 1;
- }
- }
- if ( nl_count <= 1 )
- {
- QUOTECAT(qstr, qcapa, qidx, ' ');
- }
- else
- {
- int i;
- for ( i = 0; i < nl_count - 1; i++ )
- {
- QUOTECAT(qstr, qcapa, qidx, '\n');
- }
- }
-
- goto SingleQuote2;
- }
-#line 1807 "<stdout>"
-yy148: ++YYCURSOR;
- switch((yych = *YYCURSOR)) {
- case 0x0A: goto yy156;
- default: goto yy149;
- }
-yy149:
-#line 712 "token.re"
-{ QUOTECAT(qstr, qcapa, qidx, *(YYCURSOR - 1));
- goto SingleQuote2;
- }
-#line 1818 "<stdout>"
-yy150: ++YYCURSOR;
- switch((yych = *YYCURSOR)) {
- case '\'': goto yy154;
- default: goto yy151;
- }
-yy151:
-#line 689 "token.re"
-{ SyckLevel *lvl;
- SyckNode *n = syck_alloc_str();
- lvl = CURRENT_LEVEL();
-
- if ( lvl->status == syck_lvl_str )
- {
- POP_LEVEL();
- }
- if ( ((SyckParser *)parser)->taguri_expansion == 1 )
- {
- n->type_id = syck_taguri( YAML_DOMAIN, "str", 3 );
- }
- else
- {
- n->type_id = syck_strndup( "str", 3 );
- }
- n->data.str->ptr = qstr;
- n->data.str->len = qidx;
- n->data.str->style = scalar_1quote;
- sycklval->nodeData = n;
- return YAML_PLAIN;
- }
-#line 1848 "<stdout>"
-yy152: yych = *++YYCURSOR;
- goto yy151;
-yy153: yych = *++YYCURSOR;
- goto yy149;
-yy154: ++YYCURSOR;
- goto yy155;
-yy155:
-#line 685 "token.re"
-{ QUOTECAT(qstr, qcapa, qidx, '\'');
- goto SingleQuote2;
- }
-#line 1860 "<stdout>"
-yy156: yyaccept = 0;
- YYMARKER = ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy157;
-yy157: switch(yych){
- case 0x0A: case ' ': goto yy156;
- case 0x0D: goto yy158;
- default: goto yy147;
- }
-yy158: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- switch(yych){
- case 0x0A: goto yy156;
- default: goto yy159;
- }
-yy159: YYCURSOR = YYMARKER;
- switch(yyaccept){
- case 0: goto yy147;
- }
-}
-#line 716 "token.re"
-
-
- }
-
-
-DoubleQuote:
- {
- int keep_nl = 1;
- int qidx = 0;
- int qcapa = 100;
- char *qstr = S_ALLOC_N( char, qcapa );
-
-DoubleQuote2:
- YYTOKEN = YYCURSOR;
-
-
-
-#line 1901 "<stdout>"
-{
- YYCTYPE yych;
- unsigned int yyaccept;
- goto yy160;
- ++YYCURSOR;
-yy160:
- if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
- yych = *YYCURSOR;
- switch(yych){
- case 0x00: goto yy167;
- case 0x0A: goto yy162;
- case 0x0D: goto yy164;
- case '"': goto yy169;
- case '\\': goto yy166;
- default: goto yy170;
- }
-yy162: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- goto yy184;
-yy163:
-#line 734 "token.re"
-{ int indt_len;
- int nl_count = 0;
- SyckLevel *lvl;
- GOBBLE_UP_YAML_INDENT( indt_len, YYTOKEN );
- lvl = CURRENT_LEVEL();
-
- if ( lvl->status != syck_lvl_str )
- {
- ADD_LEVEL( indt_len, syck_lvl_str );
- }
- else if ( indt_len < lvl->spaces )
- {
- /* FIXME */
- }
-
- if ( keep_nl == 1 )
- {
- while ( YYTOKEN < YYCURSOR )
- {
- int nl_len = newline_len( YYTOKEN++ );
- if ( nl_len )
- {
- nl_count++;
- YYTOKEN += nl_len - 1;
- }
- }
- if ( nl_count <= 1 )
- {
- QUOTECAT(qstr, qcapa, qidx, ' ');
- }
- else
- {
- int i;
- for ( i = 0; i < nl_count - 1; i++ )
- {
- QUOTECAT(qstr, qcapa, qidx, '\n');
- }
- }
- }
-
- keep_nl = 1;
- goto DoubleQuote2;
- }
-#line 1966 "<stdout>"
-yy164: ++YYCURSOR;
- switch((yych = *YYCURSOR)) {
- case 0x0A: goto yy183;
- default: goto yy165;
- }
-yy165:
-#line 820 "token.re"
-{ QUOTECAT(qstr, qcapa, qidx, *(YYCURSOR - 1));
- goto DoubleQuote2;
- }
-#line 1977 "<stdout>"
-yy166: yyaccept = 1;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case 0x0A: goto yy174;
- case 0x0D: goto yy176;
- case ' ': goto yy171;
- case '"': case '0': case '\\': case 'a':
- case 'b': case 'e':
- case 'f': case 'n': case 'r': case 't': case 'v': goto yy178;
- case 'x': goto yy177;
- default: goto yy165;
- }
-yy167: ++YYCURSOR;
- goto yy168;
-yy168:
-#line 797 "token.re"
-{ SyckLevel *lvl;
- SyckNode *n = syck_alloc_str();
- lvl = CURRENT_LEVEL();
-
- if ( lvl->status == syck_lvl_str )
- {
- POP_LEVEL();
- }
- if ( ((SyckParser *)parser)->taguri_expansion == 1 )
- {
- n->type_id = syck_taguri( YAML_DOMAIN, "str", 3 );
- }
- else
- {
- n->type_id = syck_strndup( "str", 3 );
- }
- n->data.str->ptr = qstr;
- n->data.str->len = qidx;
- n->data.str->style = scalar_2quote;
- sycklval->nodeData = n;
- return YAML_PLAIN;
- }
-#line 2016 "<stdout>"
-yy169: yych = *++YYCURSOR;
- goto yy168;
-yy170: yych = *++YYCURSOR;
- goto yy165;
-yy171: ++YYCURSOR;
- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
- yych = *YYCURSOR;
- goto yy172;
-yy172: switch(yych){
- case 0x0A: goto yy174;
- case 0x0D: goto yy176;
- case ' ': goto yy171;
- default: goto yy173;
- }
-yy173: YYCURSOR = YYMARKER;
- switch(yyaccept){
- case 0: goto yy163;
- case 1: goto yy165;
- }
-yy174: ++YYCURSOR;
- goto yy175;
-yy175:
-#line 792 "token.re"
-{ keep_nl = 0;
- YYCURSOR--;
- goto DoubleQuote2;
- }
-#line 2044 "<stdout>"
-yy176: yych = *++YYCURSOR;
- switch(yych){
- case 0x0A: goto yy174;
- default: goto yy173;
- }
-yy177: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f': goto yy180;
- default: goto yy173;
- }
-yy178: ++YYCURSOR;
- goto yy179;
-yy179:
-#line 778 "token.re"
-{ char ch = *( YYCURSOR - 1 );
- QUOTECAT(qstr, qcapa, qidx, escape_seq( ch ));
- goto DoubleQuote2;
- }
-#line 2082 "<stdout>"
-yy180: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f': goto yy181;
- default: goto yy173;
- }
-yy181: ++YYCURSOR;
- goto yy182;
-yy182:
-#line 783 "token.re"
-{ long ch;
- char *chr_text = syck_strndup( YYTOKEN, 4 );
- chr_text[0] = '0';
- ch = strtol( chr_text, NULL, 16 );
- free( chr_text );
- QUOTECAT(qstr, qcapa, qidx, ch);
- goto DoubleQuote2;
- }
-#line 2119 "<stdout>"
-yy183: yyaccept = 0;
- YYMARKER = ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy184;
-yy184: switch(yych){
- case 0x0A: case ' ': goto yy183;
- case 0x0D: goto yy185;
- default: goto yy163;
- }
-yy185: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- switch(yych){
- case 0x0A: goto yy183;
- default: goto yy173;
- }
-}
-#line 824 "token.re"
-
- }
-
-TransferMethod:
- {
- int qidx = 0;
- int qcapa = 100;
- char *qstr = S_ALLOC_N( char, qcapa );
-
-TransferMethod2:
- YYTOKTMP = YYCURSOR;
-
-
-#line 2152 "<stdout>"
-{
- YYCTYPE yych;
- unsigned int yyaccept;
- goto yy186;
- ++YYCURSOR;
-yy186:
- if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
- yych = *YYCURSOR;
- switch(yych){
- case 0x00: goto yy188;
- case 0x0A: goto yy190;
- case 0x0D: goto yy192;
- case ' ': goto yy191;
- case '\\': goto yy194;
- default: goto yy195;
- }
-yy188: ++YYCURSOR;
- goto yy189;
-yy189:
-#line 838 "token.re"
-{ SyckLevel *lvl;
- YYCURSOR = YYTOKTMP;
- if ( YYCURSOR == YYTOKEN + 1 )
- {
- free( qstr );
- return YAML_ITRANSFER;
- }
-
- lvl = CURRENT_LEVEL();
-
- /*
- * URL Prefixing
- */
- if ( *qstr == '^' )
- {
- sycklval->name = S_ALLOC_N( char, qidx + strlen( lvl->domain ) );
- sycklval->name[0] = '\0';
- strcat( sycklval->name, lvl->domain );
- strncat( sycklval->name, qstr + 1, qidx - 1 );
- free( qstr );
- }
- else
- {
- char *carat = qstr;
- char *qend = qstr + qidx;
- while ( (++carat) < qend )
- {
- if ( *carat == '^' )
- break;
- }
-
- if ( carat < qend )
- {
- free( lvl->domain );
- lvl->domain = syck_strndup( qstr, carat - qstr );
- sycklval->name = S_ALLOC_N( char, ( qend - carat ) + strlen( lvl->domain ) );
- sycklval->name[0] = '\0';
- strcat( sycklval->name, lvl->domain );
- strncat( sycklval->name, carat + 1, ( qend - carat ) - 1 );
- free( qstr );
- }
- else
- {
- sycklval->name = qstr;
- }
- }
-
- return YAML_TRANSFER;
- }
-#line 2222 "<stdout>"
-yy190: yych = *++YYCURSOR;
- goto yy189;
-yy191: yych = *++YYCURSOR;
- goto yy204;
-yy192: ++YYCURSOR;
- switch((yych = *YYCURSOR)) {
- case 0x0A: goto yy188;
- default: goto yy193;
- }
-yy193:
-#line 905 "token.re"
-{ QUOTECAT(qstr, qcapa, qidx, *(YYCURSOR - 1));
- goto TransferMethod2;
- }
-#line 2237 "<stdout>"
-yy194: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case '"': case '0': case '\\': case 'a':
- case 'b': case 'e':
- case 'f': case 'n': case 'r': case 't': case 'v': goto yy198;
- case 'x': goto yy196;
- default: goto yy193;
- }
-yy195: yych = *++YYCURSOR;
- goto yy193;
-yy196: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f': goto yy200;
- default: goto yy197;
- }
-yy197: YYCURSOR = YYMARKER;
- switch(yyaccept){
- case 0: goto yy193;
- }
-yy198: ++YYCURSOR;
- goto yy199;
-yy199:
-#line 891 "token.re"
-{ char ch = *( YYCURSOR - 1 );
- QUOTECAT(qstr, qcapa, qidx, escape_seq( ch ));
- goto TransferMethod2;
- }
-#line 2285 "<stdout>"
-yy200: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f': goto yy201;
- default: goto yy197;
- }
-yy201: ++YYCURSOR;
- goto yy202;
-yy202:
-#line 896 "token.re"
-{ long ch;
- char *chr_text = syck_strndup( YYTOKTMP, 4 );
- chr_text[0] = '0';
- ch = strtol( chr_text, NULL, 16 );
- free( chr_text );
- QUOTECAT(qstr, qcapa, qidx, ch);
- goto TransferMethod2;
- }
-#line 2322 "<stdout>"
-yy203: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy204;
-yy204: switch(yych){
- case ' ': goto yy203;
- default: goto yy189;
- }
-}
-#line 910 "token.re"
-
- }
-
-ScalarBlock:
- {
- int qidx = 0;
- int qcapa = 100;
- char *qstr = S_ALLOC_N( char, qcapa );
- int blockType = 0;
- int nlDoWhat = 0;
- int lastIndent = 0;
- int forceIndent = -1;
- char *yyt = YYTOKEN;
- SyckLevel *lvl = CURRENT_LEVEL();
- int parentIndent = -1;
-
- switch ( *yyt )
- {
- case '|': blockType = BLOCK_LIT; break;
- case '>': blockType = BLOCK_FOLD; break;
- }
-
- while ( ++yyt <= YYCURSOR )
- {
- if ( *yyt == '-' )
- {
- nlDoWhat = NL_CHOMP;
- }
- else if ( *yyt == '+' )
- {
- nlDoWhat = NL_KEEP;
- }
- else if ( isdigit( *yyt ) )
- {
- forceIndent = rb_long2int(strtol( yyt, NULL, 10 ));
- }
- }
-
- qstr[0] = '\0';
- YYTOKEN = YYCURSOR;
-
-ScalarBlock2:
- YYTOKEN = YYCURSOR;
-
-
-#line 2378 "<stdout>"
-{
- YYCTYPE yych;
- unsigned int yyaccept;
- goto yy205;
- ++YYCURSOR;
-yy205:
- if((YYLIMIT - YYCURSOR) < 5) YYFILL(5);
- yych = *YYCURSOR;
- switch(yych){
- case 0x00: goto yy213;
- case 0x0A: goto yy207;
- case 0x0D: goto yy209;
- case '#': goto yy211;
- case '-': goto yy215;
- default: goto yy216;
- }
-yy207: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- goto yy226;
-yy208:
-#line 956 "token.re"
-{ char *pacer;
- char *tok = YYTOKEN;
- int indt_len = 0, nl_count = 0, fold_nl = 0, nl_begin = 0;
- GOBBLE_UP_YAML_INDENT( indt_len, tok );
- lvl = CURRENT_LEVEL();
-
- if ( lvl->status != syck_lvl_block )
- {
- GET_TRUE_YAML_INDENT(parentIndent);
- if ( forceIndent > 0 ) forceIndent += parentIndent;
- if ( indt_len > parentIndent )
- {
- int new_spaces = forceIndent > 0 ? forceIndent : indt_len;
- ADD_LEVEL( new_spaces, syck_lvl_block );
- lastIndent = indt_len - new_spaces;
- nl_begin = 1;
- lvl = CURRENT_LEVEL();
- }
- else
- {
- YYCURSOR = YYTOKEN;
- RETURN_YAML_BLOCK();
- }
- }
-
- /*
- * Fold only in the event of two lines being on the leftmost
- * indentation.
- */
- if ( blockType == BLOCK_FOLD && lastIndent == 0 && ( indt_len - lvl->spaces ) == 0 )
- {
- fold_nl = 1;
- }
-
- pacer = YYTOKEN;
- while ( pacer < YYCURSOR )
- {
- int nl_len = newline_len( pacer++ );
- if ( nl_len )
- {
- nl_count++;
- pacer += nl_len - 1;
- }
- }
-
- if ( fold_nl == 1 || nl_begin == 1 )
- {
- nl_count--;
- }
-
- if ( nl_count < 1 && nl_begin == 0 )
- {
- QUOTECAT(qstr, qcapa, qidx, ' ');
- }
- else
- {
- int i;
- for ( i = 0; i < nl_count; i++ )
- {
- QUOTECAT(qstr, qcapa, qidx, '\n');
- }
- }
-
- lastIndent = indt_len - lvl->spaces;
- YYCURSOR -= lastIndent;
-
- if ( indt_len < lvl->spaces )
- {
- POP_LEVEL();
- YYCURSOR = YYTOKEN;
- RETURN_YAML_BLOCK();
- }
- goto ScalarBlock2;
- }
-#line 2474 "<stdout>"
-yy209: ++YYCURSOR;
- switch((yych = *YYCURSOR)) {
- case 0x0A: goto yy225;
- default: goto yy210;
- }
-yy210:
-#line 1070 "token.re"
-{ QUOTECAT(qstr, qcapa, qidx, *YYTOKEN);
- goto ScalarBlock2;
- }
-#line 2485 "<stdout>"
-yy211: ++YYCURSOR;
- goto yy212;
-yy212:
-#line 1032 "token.re"
-{ lvl = CURRENT_LEVEL();
- if ( lvl->status != syck_lvl_block )
- {
- eat_comments( parser );
- YYTOKEN = YYCURSOR;
- }
- else
- {
- QUOTECAT(qstr, qcapa, qidx, *YYTOKEN);
- }
- goto ScalarBlock2;
- }
-#line 2502 "<stdout>"
-yy213: ++YYCURSOR;
- goto yy214;
-yy214:
-#line 1046 "token.re"
-{ YYCURSOR--;
- POP_LEVEL();
- RETURN_YAML_BLOCK();
- }
-#line 2511 "<stdout>"
-yy215: yyaccept = 1;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case '-': goto yy217;
- default: goto yy210;
- }
-yy216: yych = *++YYCURSOR;
- goto yy210;
-yy217: yych = *++YYCURSOR;
- switch(yych){
- case '-': goto yy219;
- default: goto yy218;
- }
-yy218: YYCURSOR = YYMARKER;
- switch(yyaccept){
- case 0: goto yy208;
- case 1: goto yy210;
- }
-yy219: yych = *++YYCURSOR;
- switch(yych){
- case 0x0A: goto yy220;
- case 0x0D: goto yy224;
- case ' ': goto yy222;
- default: goto yy218;
- }
-yy220: ++YYCURSOR;
- goto yy221;
-yy221:
-#line 1051 "token.re"
-{ if ( YYTOKEN == YYLINEPTR )
- {
- if ( blockType == BLOCK_FOLD && qidx > 0 )
- {
- qidx -= 1;
- }
- QUOTECAT(qstr, qcapa, qidx, '\n');
- POP_LEVEL();
- YYCURSOR = YYTOKEN;
- RETURN_YAML_BLOCK();
- }
- else
- {
- QUOTECAT(qstr, qcapa, qidx, *YYTOKEN);
- YYCURSOR = YYTOKEN + 1;
- goto ScalarBlock2;
- }
- }
-#line 2559 "<stdout>"
-yy222: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy223;
-yy223: switch(yych){
- case ' ': goto yy222;
- default: goto yy221;
- }
-yy224: yych = *++YYCURSOR;
- switch(yych){
- case 0x0A: goto yy220;
- default: goto yy218;
- }
-yy225: yyaccept = 0;
- YYMARKER = ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy226;
-yy226: switch(yych){
- case 0x0A: case ' ': goto yy225;
- case 0x0D: goto yy227;
- default: goto yy208;
- }
-yy227: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- switch(yych){
- case 0x0A: goto yy225;
- default: goto yy218;
- }
-}
-#line 1075 "token.re"
-
- }
-
- return 0;
-
-}
-
-void
-eat_comments( SyckParser *parser )
-{
-Comment:
- {
- YYTOKEN = YYCURSOR;
-
-
-#line 2607 "<stdout>"
-{
- YYCTYPE yych;
- unsigned int yyaccept;
- goto yy228;
- ++YYCURSOR;
-yy228:
- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
- yych = *YYCURSOR;
- switch(yych){
- case 0x00: goto yy230;
- case 0x0A: goto yy232;
- case 0x0D: goto yy233;
- default: goto yy235;
- }
-yy230: ++YYCURSOR;
- goto yy231;
-yy231:
-#line 1091 "token.re"
-{ YYCURSOR = YYTOKEN;
- return;
- }
-#line 2629 "<stdout>"
-yy232: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- goto yy237;
-yy233: ++YYCURSOR;
- switch((yych = *YYCURSOR)) {
- case 0x0A: goto yy236;
- default: goto yy234;
- }
-yy234:
-#line 1095 "token.re"
-{ goto Comment;
- }
-#line 2642 "<stdout>"
-yy235: yych = *++YYCURSOR;
- goto yy234;
-yy236: yyaccept = 0;
- YYMARKER = ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy237;
-yy237: switch(yych){
- case 0x0A: goto yy236;
- case 0x0D: goto yy238;
- default: goto yy231;
- }
-yy238: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- switch(yych){
- case 0x0A: goto yy236;
- default: goto yy239;
- }
-yy239: YYCURSOR = YYMARKER;
- switch(yyaccept){
- case 0: goto yy231;
- }
-}
-#line 1098 "token.re"
-
-
- }
-
-}
-
-char
-escape_seq( char ch )
-{
- switch ( ch )
- {
- case '0': return '\0';
- case 'a': return 7;
- case 'b': return '\010';
- case 'e': return '\033';
- case 'f': return '\014';
- case 'n': return '\n';
- case 'r': return '\015';
- case 't': return '\t';
- case 'v': return '\013';
- default: return ch;
- }
-}
-
-int
-is_newline( char *ptr )
-{
- return newline_len( ptr );
-}
-
-int
-newline_len( char *ptr )
-{
- if ( *ptr == '\n' )
- return 1;
-
- if ( *ptr == '\r' && *( ptr + 1 ) == '\n' )
- return 2;
-
- return 0;
-}
-
-int
-syckwrap()
-{
- return 1;
-}
-
-void
-syckerror( const char *msg )
-{
- if ( syck_parser_ptr->error_handler == NULL )
- syck_parser_ptr->error_handler = syck_default_error_handler;
-
- syck_parser_ptr->root = syck_parser_ptr->root_on_error;
- (syck_parser_ptr->error_handler)(syck_parser_ptr, msg);
-}
-
diff --git a/ext/syck/yaml2byte.c b/ext/syck/yaml2byte.c
deleted file mode 100644
index e5cc4e0779..0000000000
--- a/ext/syck/yaml2byte.c
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * yaml2byte.c
- *
- * $Author$
- *
- * Copyright (C) 2003 why the lucky stiff, clark evans
- *
- * WARNING WARNING WARNING --- THIS IS *NOT JUST* PLAYING
- * ANYMORE! -- WHY HAS EMBRACED THIS AS THE REAL THING!
- */
-#include "ruby/ruby.h"
-#include <syck.h>
-#include <assert.h>
-#define YAMLBYTE_UTF8
-#include "yamlbyte.h"
-
-#include <stdio.h>
-#define TRACE0(a) \
- do { printf(a); printf("\n"); fflush(stdout); } while(0)
-#define TRACE1(a,b) \
- do { printf(a,b); printf("\n"); fflush(stdout); } while(0)
-#define TRACE2(a,b,c) \
- do { printf(a,b,c); printf("\n"); fflush(stdout); } while(0)
-#define TRACE3(a,b,c,d) \
- do { printf(a,b,c,d); printf("\n"); fflush(stdout); } while(0)
-
-/* Reinvent the wheel... */
-#define CHUNKSIZE 64
-#define HASH ((long)0xCAFECAFE)
-typedef struct {
- long hash;
- char *buffer;
- long length;
- long remaining;
- int printed;
-} bytestring_t;
-bytestring_t *bytestring_alloc(void) {
- bytestring_t *ret;
- /*TRACE0("bytestring_alloc()");*/
- ret = S_ALLOC(bytestring_t);
- ret->hash = HASH;
- ret->length = CHUNKSIZE;
- ret->remaining = ret->length;
- ret->buffer = S_ALLOC_N(char, ret->length + 1 );
- ret->buffer[0] = 0;
- ret->printed = 0;
- return ret;
-}
-void bytestring_append(bytestring_t *str, char code,
- char *start, char *finish)
-{
- long grow;
- long length = 2; /* CODE + LF */
- char *curr;
- assert(str && HASH == str->hash);
- /*TRACE0("bytestring_append()");*/
- if(start) {
- if(!finish)
- finish = start + strlen(start);
- length += (finish-start);
- }
- if(length > str->remaining) {
- grow = (length - str->remaining) + CHUNKSIZE;
- str->remaining += grow;
- str->length += grow;
- S_REALLOC_N( str->buffer, char, str->length + 1 );
- assert(str->buffer);
- }
- curr = str->buffer + (str->length - str->remaining);
- *curr = code;
- curr += 1;
- if(start)
- while(start < finish)
- *curr ++ = *start ++;
- *curr = '\n';
- curr += 1;
- *curr = 0;
- str->remaining = str->remaining - length;
- assert( (str->buffer + str->length) - str->remaining );
-}
-void bytestring_extend(bytestring_t *str, bytestring_t *ext)
-{
- char *from;
- char *curr;
- char *stop;
- long grow;
- long length;
- assert(str && HASH == str->hash);
- assert(ext && HASH == ext->hash);
- if(ext->printed) {
- assert(ext->buffer[0] ==YAMLBYTE_ANCHOR);
- curr = ext->buffer;
- while( '\n' != *curr)
- curr++;
- bytestring_append(str, YAMLBYTE_ALIAS, ext->buffer + 1, curr);
- } else {
- ext->printed = 1;
- length = (ext->length - ext->remaining);
- if(length > str->remaining) {
- grow = (length - str->remaining) + CHUNKSIZE;
- str->remaining += grow;
- str->length += grow;
- S_REALLOC_N( str->buffer, char, str->length + 1 );
- }
- curr = str->buffer + (str->length - str->remaining);
- from = ext->buffer;
- stop = ext->buffer + length;
- while( from < stop )
- *curr ++ = *from ++;
- *curr = 0;
- str->remaining = str->remaining - length;
- assert( (str->buffer + str->length) - str->remaining );
- }
-}
-
-/* convert SyckNode into yamlbyte_buffer_t objects */
-SYMID
-syck_yaml2byte_handler(p, n)
- SyckParser *p;
- SyckNode *n;
-{
- SYMID oid;
- long i;
- char ch;
- char nextcode;
- char *start;
- char *current;
- char *finish;
- bytestring_t *val = NULL;
- bytestring_t *sav = NULL;
- void *data;
- /*TRACE0("syck_yaml2byte_handler()");*/
- val = bytestring_alloc();
- if(n->anchor) bytestring_append(val,YAMLBYTE_ANCHOR, n->anchor, NULL);
- if ( n->type_id )
- {
- if ( p->taguri_expansion )
- {
- bytestring_append(val,YAMLBYTE_TRANSFER, n->type_id, NULL);
- }
- else
- {
- char *type_tag = S_ALLOC_N( char, strlen( n->type_id ) + 1 );
- type_tag[0] = '\0';
- strcat( type_tag, "!" );
- strcat( type_tag, n->type_id );
- bytestring_append( val, YAMLBYTE_TRANSFER, type_tag, NULL);
- S_FREE(type_tag);
- }
- }
- switch (n->kind)
- {
- case syck_str_kind:
- nextcode = YAMLBYTE_SCALAR;
- start = n->data.str->ptr;
- finish = start + n->data.str->len - 1;
- current = start;
- /*TRACE2("SCALAR: %s %d", start, n->data.str->len); */
- while(1) {
- ch = *current;
- if('\n' == ch || 0 == ch || current > finish) {
- if(current >= start) {
- bytestring_append(val, nextcode, start, current);
- nextcode = YAMLBYTE_CONTINUE;
- }
- start = current + 1;
- if(current > finish)
- {
- break;
- }
- else if('\n' == ch )
- {
- bytestring_append(val,YAMLBYTE_NEWLINE,NULL,NULL);
- }
- else if(0 == ch)
- {
- bytestring_append(val,YAMLBYTE_NULLCHAR,NULL,NULL);
- }
- else
- {
- assert("oops");
- }
- }
- current += 1;
- }
- break;
- case syck_seq_kind:
- bytestring_append(val,YAMLBYTE_SEQUENCE,NULL,NULL);
- for ( i = 0; i < n->data.list->idx; i++ )
- {
- oid = syck_seq_read( n, i );
- if (syck_lookup_sym( p, oid, &data )) sav = data;
- bytestring_extend(val, sav);
- }
- bytestring_append(val,YAMLBYTE_END_BRANCH,NULL,NULL);
- break;
- case syck_map_kind:
- bytestring_append(val,YAMLBYTE_MAPPING,NULL,NULL);
- for ( i = 0; i < n->data.pairs->idx; i++ )
- {
- oid = syck_map_read( n, map_key, i );
- if (syck_lookup_sym( p, oid, &data )) sav = data;
- bytestring_extend(val, sav);
- oid = syck_map_read( n, map_value, i );
- if (syck_lookup_sym( p, oid, &data )) sav = data;
- bytestring_extend(val, sav);
- }
- bytestring_append(val,YAMLBYTE_END_BRANCH,NULL,NULL);
- break;
- }
- oid = syck_add_sym( p, (char *) val );
- /*TRACE1("Saving: %s", val->buffer );*/
- return oid;
-}
-
-char *
-syck_yaml2byte(char *yamlstr)
-{
- SYMID oid;
- char *ret;
- bytestring_t *sav;
- void *data;
-
- SyckParser *parser = syck_new_parser();
- syck_parser_str_auto( parser, yamlstr, NULL );
- syck_parser_handler( parser, syck_yaml2byte_handler );
- syck_parser_error_handler( parser, NULL );
- syck_parser_implicit_typing( parser, 1 );
- syck_parser_taguri_expansion( parser, 1 );
- oid = syck_parse( parser );
-
- if ( syck_lookup_sym( parser, oid, &data ) ) {
- sav = data;
- ret = S_ALLOC_N( char, strlen( sav->buffer ) + 3 );
- ret[0] = '\0';
- strcat( ret, "D\n" );
- strcat( ret, sav->buffer );
- }
- else
- {
- ret = NULL;
- }
-
- syck_free_parser( parser );
- return ret;
-}
-
-#ifdef TEST_YBEXT
-#include <stdio.h>
-int main() {
- char *yaml = "test: 1\nand: \"with new\\nline\\n\"\nalso: &3 three\nmore: *3";
- printf("--- # YAML \n");
- printf(yaml);
- printf("\n...\n");
- printf(syck_yaml2byte(yaml));
- return 0;
-}
-#endif
-
diff --git a/ext/syck/yamlbyte.h b/ext/syck/yamlbyte.h
deleted file mode 100644
index 16ca3d70de..0000000000
--- a/ext/syck/yamlbyte.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/* yamlbyte.h
- *
- * The YAML bytecode "C" interface header file. See the YAML bytecode
- * reference for bytecode sequence rules and for the meaning of each
- * bytecode.
- */
-
-#ifndef YAMLBYTE_H
-#define YAMLBYTE_H
-#include <stddef.h>
-
-/* define what a character is */
-typedef unsigned char yamlbyte_utf8_t;
-typedef unsigned short yamlbyte_utf16_t;
-#ifdef YAMLBYTE_UTF8
- #ifdef YAMLBYTE_UTF16
- #error Must only define YAMLBYTE_UTF8 or YAMLBYTE_UTF16
- #endif
- typedef yamlbyte_utf8_t yamlbyte_char_t;
-#else
- #ifdef YAMLBYTE_UTF16
- typedef yamlbyte_utf16_t yamlbyte_char_t;
- #else
- #error Must define YAMLBYTE_UTF8 or YAMLBYTE_UTF16
- #endif
-#endif
-
-/* specify list of bytecodes */
-#define YAMLBYTE_FINISH ((yamlbyte_char_t) 0)
-#define YAMLBYTE_DOCUMENT ((yamlbyte_char_t)'D')
-#define YAMLBYTE_DIRECTIVE ((yamlbyte_char_t)'V')
-#define YAMLBYTE_PAUSE ((yamlbyte_char_t)'P')
-#define YAMLBYTE_MAPPING ((yamlbyte_char_t)'M')
-#define YAMLBYTE_SEQUENCE ((yamlbyte_char_t)'Q')
-#define YAMLBYTE_END_BRANCH ((yamlbyte_char_t)'E')
-#define YAMLBYTE_SCALAR ((yamlbyte_char_t)'S')
-#define YAMLBYTE_CONTINUE ((yamlbyte_char_t)'C')
-#define YAMLBYTE_NEWLINE ((yamlbyte_char_t)'N')
-#define YAMLBYTE_NULLCHAR ((yamlbyte_char_t)'Z')
-#define YAMLBYTE_ANCHOR ((yamlbyte_char_t)'A')
-#define YAMLBYTE_ALIAS ((yamlbyte_char_t)'R')
-#define YAMLBYTE_TRANSFER ((yamlbyte_char_t)'T')
-/* formatting bytecodes */
-#define YAMLBYTE_COMMENT ((yamlbyte_char_t)'c')
-#define YAMLBYTE_INDENT ((yamlbyte_char_t)'i')
-#define YAMLBYTE_STYLE ((yamlbyte_char_t)'s')
-/* other bytecodes */
-#define YAMLBYTE_LINE_NUMBER ((yamlbyte_char_t)'#')
-#define YAMLBYTE_WHOLE_SCALAR ((yamlbyte_char_t)'<')
-#define YAMLBYTE_NOTICE ((yamlbyte_char_t)'!')
-#define YAMLBYTE_SPAN ((yamlbyte_char_t)')')
-#define YAMLBYTE_ALLOC ((yamlbyte_char_t)'@')
-
-/* second level style bytecodes, ie "s>" */
-#define YAMLBYTE_FLOW ((yamlbyte_char_t)'>')
-#define YAMLBYTE_LITERAL ((yamlbyte_char_t)'|')
-#define YAMLBYTE_BLOCK ((yamlbyte_char_t)'b')
-#define YAMLBYTE_PLAIN ((yamlbyte_char_t)'p')
-#define YAMLBYTE_INLINE_MAPPING ((yamlbyte_char_t)'{')
-#define YAMLBYTE_INLINE_SEQUENCE ((yamlbyte_char_t)'[')
-#define YAMLBYTE_SINGLE_QUOTED ((yamlbyte_char_t)39)
-#define YAMLBYTE_DOUBLE_QUOTED ((yamlbyte_char_t)'"')
-
-/*
- * The "C" API has two variants, one based on instructions,
- * with events delivered via pointers; and the other one
- * is character based where one or more instructions are
- * serialized into a buffer.
- *
- * Note: In the instruction based API, WHOLE_SCALAR does
- * not have the '<here' marshalling stuff.
- */
-
-typedef void * yamlbyte_consumer_t;
-typedef void * yamlbyte_producer_t;
-
-/* push and pull APIs need a way to communicate results */
-typedef enum {
- YAMLBYTE_OK = 0, /* proceed */
- YAMLBYTE_E_MEMORY = 'M', /* could not allocate memory */
- YAMLBYTE_E_READ = 'R', /* input stream read error */
- YAMLBYTE_E_WRITE = 'W', /* output stream write error */
- YAMLBYTE_E_OTHER = '?', /* some other error condition */
- YAMLBYTE_E_PARSE = 'P', /* parse error, check bytecodes */
- YAMLBYTE_MAX
-} yamlbyte_result_t;
-
-typedef const yamlbyte_char_t *yamlbyte_buff_t;
-
-/*
- * The "Instruction" API
- */
-
-typedef struct yaml_instruction {
- yamlbyte_char_t bytecode;
- yamlbyte_buff_t start;
- yamlbyte_buff_t finish; /* open range, *finish is _not_ part */
-} *yamlbyte_inst_t;
-
-/* producer pushes the instruction with one bytecode event to the
- * consumer; if the consumer's result is not YAMLBYTE_OK, then
- * the producer should stop */
-typedef
- yamlbyte_result_t
- (*yamlbyte_push_t)(
- yamlbyte_consumer_t self,
- yamlbyte_inst_t inst
- );
-
-/* consumer pulls a bytecode instruction from the producer; in this
- * case the instruction (and is buffer) are owned by the producer and
- * will remain valid till the pull function is called once again;
- * if the instruction is NULL, then there are no more results; and
- * it is important to call the pull function till it returns NULL so
- * that the producer can clean up its memory allocations */
-typedef
- yamlbyte_result_t
- (*yamlbyte_pull_t)(
- yamlbyte_producer_t self,
- yamlbyte_inst_t *inst /* to be filled in by the producer */
- );
-
-/*
- * Buffer based API
- */
-
-/* producer pushes a null terminated buffer filled with one or more
- * bytecode events to the consumer; if the consumer's result is not
- * YAMLBYTE_OK, then the producer should stop */
-typedef
- yamlbyte_result_t
- (*yamlbyte_pushbuff_t)(
- yamlbyte_consumer_t self,
- yamlbyte_buff_t buff
- );
-
-/* consumer pulls bytecode events from the producer; in this case
- * the buffer is owned by the producer, and will remain valid till
- * the pull function is called once again; if the buffer pointer
- * is set to NULL, then there are no more results; it is important
- * to call the pull function till it returns NULL so that the
- * producer can clean up its memory allocations */
-typedef
- yamlbyte_result_t
- (*yamlbyte_pullbuff_t)(
- yamlbyte_producer_t self,
- yamlbyte_buff_t *buff /* to be filled in by the producer */
- );
-
-/* convert a pull interface to a push interface; the reverse process
- * requires threads and thus is language dependent */
-#define YAMLBYTE_PULL2PUSH(pull,producer,push,consumer,result) \
- do { \
- yamlbyte_pullbuff_t _pull = (pull); \
- yamlbyte_pushbuff_t _push = (push); \
- yamlbyte_result_t _result = YAMLBYTE_OK; \
- yamlbyte_producer_t _producer = (producer); \
- yamlbyte_consumer_t _consumer = (consumer); \
- while(1) { \
- yamlbyte_buff_t buff = NULL; \
- _result = _pull(_producer,&buff); \
- if(YAMLBYTE_OK != result || NULL == buff) \
- break; \
- _result = _push(_consumer,buff); \
- if(YAMLBYTE_OK != result) \
- break; \
- } \
- (result) = _result; \
- } while(0)
-
-#endif
diff --git a/ext/syslog/lib/syslog/logger.rb b/ext/syslog/lib/syslog/logger.rb
new file mode 100644
index 0000000000..a8d089a094
--- /dev/null
+++ b/ext/syslog/lib/syslog/logger.rb
@@ -0,0 +1,194 @@
+require 'syslog'
+require 'logger'
+
+##
+# Syslog::Logger is a Logger work-alike that logs via syslog instead of to a
+# file. You can use Syslog::Logger to aggregate logs between multiple
+# machines.
+#
+# By default, Syslog::Logger uses the program name 'ruby', but this can be
+# changed via the first argument to Syslog::Logger.new.
+#
+# NOTE! You can only set the Syslog::Logger program name when you initialize
+# Syslog::Logger for the first time. This is a limitation of the way
+# Syslog::Logger uses syslog (and in some ways, a limitation of the way
+# syslog(3) works). Attempts to change Syslog::Logger's program name after
+# the first initialization will be ignored.
+#
+# === Example
+#
+# The following will log to syslogd on your local machine:
+#
+# require 'syslog/logger'
+#
+# log = Syslog::Logger.new 'my_program'
+# log.info 'this line will be logged via syslog(3)'
+#
+# You may need to perform some syslog.conf setup first. For a BSD machine add
+# the following lines to /etc/syslog.conf:
+#
+# !my_program
+# *.* /var/log/my_program.log
+#
+# Then touch /var/log/my_program.log and signal syslogd with a HUP
+# (killall -HUP syslogd, on FreeBSD).
+#
+# If you wish to have logs automatically roll over and archive, see the
+# newsyslog.conf(5) and newsyslog(8) man pages.
+
+class Syslog::Logger
+ # Default formatter for log messages.
+ class Formatter
+ def call severity, time, progname, msg
+ clean msg
+ end
+
+ private
+
+ ##
+ # Clean up messages so they're nice and pretty.
+
+ def clean message
+ message = message.to_s.strip
+ message.gsub!(/\e\[[0-9;]*m/, '') # remove useless ansi color codes
+ return message
+ end
+ end
+
+ ##
+ # The version of Syslog::Logger you are using.
+
+ VERSION = '2.0'
+
+ ##
+ # Maps Logger warning types to syslog(3) warning types.
+ #
+ # Messages from ruby applications are not considered as critical as messages
+ # from other system daemons using syslog(3), so most messages are reduced by
+ # one level. For example, a fatal message for ruby's Logger is considered
+ # an error for syslog(3).
+
+ LEVEL_MAP = {
+ ::Logger::UNKNOWN => Syslog::LOG_ALERT,
+ ::Logger::FATAL => Syslog::LOG_ERR,
+ ::Logger::ERROR => Syslog::LOG_WARNING,
+ ::Logger::WARN => Syslog::LOG_NOTICE,
+ ::Logger::INFO => Syslog::LOG_INFO,
+ ::Logger::DEBUG => Syslog::LOG_DEBUG,
+ }
+
+ ##
+ # Returns the internal Syslog object that is initialized when the
+ # first instance is created.
+
+ def self.syslog
+ @@syslog
+ end
+
+ ##
+ # Specifies the internal Syslog object to be used.
+
+ def self.syslog= syslog
+ @@syslog = syslog
+ end
+
+ ##
+ # Builds a methods for level +meth+.
+
+ def self.make_methods meth
+ level = ::Logger.const_get(meth.upcase)
+ eval <<-EOM, nil, __FILE__, __LINE__ + 1
+ def #{meth}(message = nil, &block)
+ add(#{level}, message, &block)
+ end
+
+ def #{meth}?
+ @level <= #{level}
+ end
+ EOM
+ end
+
+ ##
+ # :method: unknown
+ #
+ # Logs a +message+ at the unknown (syslog alert) log level, or logs the
+ # message returned from the block.
+
+ ##
+ # :method: fatal
+ #
+ # Logs a +message+ at the fatal (syslog err) log level, or logs the message
+ # returned from the block.
+
+ ##
+ # :method: error
+ #
+ # Logs a +message+ at the error (syslog warning) log level, or logs the
+ # message returned from the block.
+
+ ##
+ # :method: warn
+ #
+ # Logs a +message+ at the warn (syslog notice) log level, or logs the
+ # message returned from the block.
+
+ ##
+ # :method: info
+ #
+ # Logs a +message+ at the info (syslog info) log level, or logs the message
+ # returned from the block.
+
+ ##
+ # :method: debug
+ #
+ # Logs a +message+ at the debug (syslog debug) log level, or logs the
+ # message returned from the block.
+
+ Logger::Severity::constants.each do |severity|
+ make_methods severity.downcase
+ end
+
+ ##
+ # Log level for Logger compatibility.
+
+ attr_accessor :level
+
+ # Logging formatter, as a +Proc+ that will take four arguments and
+ # return the formatted message. The arguments are:
+ #
+ # +severity+:: The Severity of the log message.
+ # +time+:: A Time instance representing when the message was logged.
+ # +progname+:: The #progname configured, or passed to the logger method.
+ # +msg+:: The _Object_ the user passed to the log message; not necessarily a
+ # String.
+ #
+ # The block should return an Object that can be written to the logging
+ # device via +write+. The default formatter is used when no formatter is
+ # set.
+ attr_accessor :formatter
+
+ ##
+ # Fills in variables for Logger compatibility. If this is the first
+ # instance of Syslog::Logger, +program_name+ may be set to change the logged
+ # program name.
+ #
+ # Due to the way syslog works, only one program name may be chosen.
+
+ def initialize program_name = 'ruby'
+ @level = ::Logger::DEBUG
+ @formatter = Formatter.new
+
+ @@syslog ||= Syslog.open(program_name)
+ end
+
+ ##
+ # Almost duplicates Logger#add. +progname+ is ignored.
+
+ def add severity, message = nil, progname = nil, &block
+ severity ||= ::Logger::UNKNOWN
+ @level <= severity and
+ @@syslog.log LEVEL_MAP[severity], '%s', formatter.call(severity, Time.now, progname, (message || block.call))
+ true
+ end
+end
+
diff --git a/ext/syslog/syslog.c b/ext/syslog/syslog.c
index f7d622ef34..34541837c4 100644
--- a/ext/syslog/syslog.c
+++ b/ext/syslog/syslog.c
@@ -13,7 +13,21 @@
#include <syslog.h>
/* Syslog class */
-static VALUE mSyslog, mSyslogConstants;
+static VALUE mSyslog;
+/*
+ * Module holding all Syslog constants. See Syslog::log and
+ * Syslog::open for constant descriptions.
+ */
+static VALUE mSyslogConstants;
+/* Module holding Syslog option constants */
+static VALUE mSyslogOption;
+/* Module holding Syslog facility constants */
+static VALUE mSyslogFacility;
+/* Module holding Syslog level constants */
+static VALUE mSyslogLevel;
+/* Module holding Syslog utility macros */
+static VALUE mSyslogMacros;
+
static const char *syslog_ident = NULL;
static int syslog_options = -1, syslog_facility = -1, syslog_mask = -1;
static int syslog_opened = 0;
@@ -49,7 +63,7 @@ static VALUE mSyslog_close(VALUE self)
closelog();
- free((void *)syslog_ident);
+ xfree((void *)syslog_ident);
syslog_ident = NULL;
syslog_options = syslog_facility = syslog_mask = -1;
syslog_opened = 0;
@@ -111,7 +125,7 @@ static VALUE mSyslog_close(VALUE self)
* LOG_KERN:: A kernel message (not sendable by user processes, so not of
* much use to Ruby, but listed here for completeness).
*
- * LOG_LRP:: Line printer subsystem.
+ * LOG_LPR:: Line printer subsystem.
*
* LOG_MAIL:: Mail delivery or transport subsystem.
*
@@ -313,22 +327,17 @@ static VALUE mSyslog_log(int argc, VALUE *argv, VALUE self)
*/
static VALUE mSyslog_inspect(VALUE self)
{
- char buf[1024];
+ Check_Type(self, T_MODULE);
- if (syslog_opened) {
- snprintf(buf, sizeof(buf),
- "<#%s: opened=true, ident=\"%s\", options=%d, facility=%d, mask=%d>",
- rb_class2name(self),
- syslog_ident,
- syslog_options,
- syslog_facility,
- syslog_mask);
- } else {
- snprintf(buf, sizeof(buf),
- "<#%s: opened=false>", rb_class2name(self));
- }
+ if (!syslog_opened)
+ return rb_sprintf("<#%s: opened=false>", rb_class2name(self));
- return rb_str_new2(buf);
+ return rb_sprintf("<#%s: opened=true, ident=\"%s\", options=%d, facility=%d, mask=%d>",
+ rb_class2name(self),
+ syslog_ident,
+ syslog_options,
+ syslog_facility,
+ syslog_mask);
}
/* Returns self, for backward compatibility.
@@ -376,7 +385,7 @@ define_syslog_shortcut_method(LOG_DEBUG, debug)
*
* Generates a mask bit for a priority level. See #mask=
*/
-static VALUE mSyslogConstants_LOG_MASK(VALUE klass, VALUE pri)
+static VALUE mSyslogMacros_LOG_MASK(VALUE mod, VALUE pri)
{
return INT2FIX(LOG_MASK(NUM2INT(pri)));
}
@@ -387,11 +396,17 @@ static VALUE mSyslogConstants_LOG_MASK(VALUE klass, VALUE pri)
* Generates a mask value for priority levels at or below the level specified.
* See #mask=
*/
-static VALUE mSyslogConstants_LOG_UPTO(VALUE klass, VALUE pri)
+static VALUE mSyslogMacros_LOG_UPTO(VALUE mod, VALUE pri)
{
return INT2FIX(LOG_UPTO(NUM2INT(pri)));
}
+static VALUE mSyslogMacros_included(VALUE mod, VALUE target)
+{
+ rb_extend_object(target, mSyslogMacros);
+ return mod;
+}
+
/* The syslog package provides a Ruby interface to the POSIX system logging
* facility.
*
@@ -410,14 +425,12 @@ void Init_syslog()
{
mSyslog = rb_define_module("Syslog");
- /* Document-module: Syslog::Constants
- *
- * Module holding Syslog constants. See Syslog::log and Syslog::open for
- * constant descriptions.
- */
- mSyslogConstants = rb_define_module_under(mSyslog, "Constants");
+ mSyslogConstants = rb_define_module_under(mSyslog, "Constants");
- rb_include_module(mSyslog, mSyslogConstants);
+ mSyslogOption = rb_define_module_under(mSyslog, "Option");
+ mSyslogFacility = rb_define_module_under(mSyslog, "Facility");
+ mSyslogLevel = rb_define_module_under(mSyslog, "Level");
+ mSyslogMacros = rb_define_module_under(mSyslog, "Macros");
rb_define_module_function(mSyslog, "open", mSyslog_open, -1);
rb_define_module_function(mSyslog, "reopen", mSyslog_reopen, -1);
@@ -433,143 +446,150 @@ void Init_syslog()
rb_define_module_function(mSyslog, "mask", mSyslog_get_mask, 0);
rb_define_module_function(mSyslog, "mask=", mSyslog_set_mask, 1);
- rb_define_module_function(mSyslog, "LOG_MASK", mSyslogConstants_LOG_MASK, 1);
- rb_define_module_function(mSyslog, "LOG_UPTO", mSyslogConstants_LOG_UPTO, 1);
-
rb_define_module_function(mSyslog, "inspect", mSyslog_inspect, 0);
rb_define_module_function(mSyslog, "instance", mSyslog_instance, 0);
- rb_define_module_function(mSyslogConstants, "LOG_MASK", mSyslogConstants_LOG_MASK, 1);
- rb_define_module_function(mSyslogConstants, "LOG_UPTO", mSyslogConstants_LOG_UPTO, 1);
+ /* Syslog options */
-#define rb_define_syslog_const(id) \
- rb_define_const(mSyslogConstants, #id, INT2NUM(id))
+#define rb_define_syslog_option(c) \
+ rb_define_const(mSyslogOption, #c, INT2NUM(c))
- /* Various options when opening log */
#ifdef LOG_PID
- rb_define_syslog_const(LOG_PID);
+ rb_define_syslog_option(LOG_PID);
#endif
#ifdef LOG_CONS
- rb_define_syslog_const(LOG_CONS);
+ rb_define_syslog_option(LOG_CONS);
#endif
#ifdef LOG_ODELAY
- rb_define_syslog_const(LOG_ODELAY); /* deprecated */
+ rb_define_syslog_option(LOG_ODELAY); /* deprecated */
#endif
#ifdef LOG_NDELAY
- rb_define_syslog_const(LOG_NDELAY);
+ rb_define_syslog_option(LOG_NDELAY);
#endif
#ifdef LOG_NOWAIT
- rb_define_syslog_const(LOG_NOWAIT); /* deprecated */
+ rb_define_syslog_option(LOG_NOWAIT); /* deprecated */
#endif
#ifdef LOG_PERROR
- rb_define_syslog_const(LOG_PERROR);
+ rb_define_syslog_option(LOG_PERROR);
#endif
- /* Various syslog facilities */
+ /* Syslog facilities */
+
+#define rb_define_syslog_facility(c) \
+ rb_define_const(mSyslogFacility, #c, INT2NUM(c))
+
#ifdef LOG_AUTH
- rb_define_syslog_const(LOG_AUTH);
+ rb_define_syslog_facility(LOG_AUTH);
#endif
#ifdef LOG_AUTHPRIV
- rb_define_syslog_const(LOG_AUTHPRIV);
+ rb_define_syslog_facility(LOG_AUTHPRIV);
#endif
#ifdef LOG_CONSOLE
- rb_define_syslog_const(LOG_CONSOLE);
+ rb_define_syslog_facility(LOG_CONSOLE);
#endif
#ifdef LOG_CRON
- rb_define_syslog_const(LOG_CRON);
+ rb_define_syslog_facility(LOG_CRON);
#endif
#ifdef LOG_DAEMON
- rb_define_syslog_const(LOG_DAEMON);
+ rb_define_syslog_facility(LOG_DAEMON);
#endif
#ifdef LOG_FTP
- rb_define_syslog_const(LOG_FTP);
+ rb_define_syslog_facility(LOG_FTP);
#endif
#ifdef LOG_KERN
- rb_define_syslog_const(LOG_KERN);
+ rb_define_syslog_facility(LOG_KERN);
#endif
#ifdef LOG_LPR
- rb_define_syslog_const(LOG_LPR);
+ rb_define_syslog_facility(LOG_LPR);
#endif
#ifdef LOG_MAIL
- rb_define_syslog_const(LOG_MAIL);
+ rb_define_syslog_facility(LOG_MAIL);
#endif
#ifdef LOG_NEWS
- rb_define_syslog_const(LOG_NEWS);
+ rb_define_syslog_facility(LOG_NEWS);
#endif
#ifdef LOG_NTP
- rb_define_syslog_const(LOG_NTP);
+ rb_define_syslog_facility(LOG_NTP);
#endif
#ifdef LOG_SECURITY
- rb_define_syslog_const(LOG_SECURITY);
+ rb_define_syslog_facility(LOG_SECURITY);
#endif
#ifdef LOG_SYSLOG
- rb_define_syslog_const(LOG_SYSLOG);
+ rb_define_syslog_facility(LOG_SYSLOG);
#endif
#ifdef LOG_USER
- rb_define_syslog_const(LOG_USER);
+ rb_define_syslog_facility(LOG_USER);
#endif
#ifdef LOG_UUCP
- rb_define_syslog_const(LOG_UUCP);
+ rb_define_syslog_facility(LOG_UUCP);
#endif
#ifdef LOG_LOCAL0
- rb_define_syslog_const(LOG_LOCAL0);
+ rb_define_syslog_facility(LOG_LOCAL0);
#endif
#ifdef LOG_LOCAL1
- rb_define_syslog_const(LOG_LOCAL1);
+ rb_define_syslog_facility(LOG_LOCAL1);
#endif
#ifdef LOG_LOCAL2
- rb_define_syslog_const(LOG_LOCAL2);
+ rb_define_syslog_facility(LOG_LOCAL2);
#endif
#ifdef LOG_LOCAL3
- rb_define_syslog_const(LOG_LOCAL3);
+ rb_define_syslog_facility(LOG_LOCAL3);
#endif
#ifdef LOG_LOCAL4
- rb_define_syslog_const(LOG_LOCAL4);
+ rb_define_syslog_facility(LOG_LOCAL4);
#endif
#ifdef LOG_LOCAL5
- rb_define_syslog_const(LOG_LOCAL5);
+ rb_define_syslog_facility(LOG_LOCAL5);
#endif
#ifdef LOG_LOCAL6
- rb_define_syslog_const(LOG_LOCAL6);
+ rb_define_syslog_facility(LOG_LOCAL6);
#endif
#ifdef LOG_LOCAL7
- rb_define_syslog_const(LOG_LOCAL7);
+ rb_define_syslog_facility(LOG_LOCAL7);
#endif
-#define rb_define_syslog_shortcut(name) \
- rb_define_module_function(mSyslog, #name, mSyslog_##name, -1)
+ /* Syslog levels and the shortcut methods */
+
+#define rb_define_syslog_level(c, m) \
+ rb_define_const(mSyslogLevel, #c, INT2NUM(c)); \
+ rb_define_module_function(mSyslog, #m, mSyslog_##m, -1)
- /* Various syslog priorities and the shortcut methods */
#ifdef LOG_EMERG
- rb_define_syslog_const(LOG_EMERG);
- rb_define_syslog_shortcut(emerg);
+ rb_define_syslog_level(LOG_EMERG, emerg);
#endif
#ifdef LOG_ALERT
- rb_define_syslog_const(LOG_ALERT);
- rb_define_syslog_shortcut(alert);
+ rb_define_syslog_level(LOG_ALERT, alert);
#endif
#ifdef LOG_CRIT
- rb_define_syslog_const(LOG_CRIT);
- rb_define_syslog_shortcut(crit);
+ rb_define_syslog_level(LOG_CRIT, crit);
#endif
#ifdef LOG_ERR
- rb_define_syslog_const(LOG_ERR);
- rb_define_syslog_shortcut(err);
+ rb_define_syslog_level(LOG_ERR, err);
#endif
#ifdef LOG_WARNING
- rb_define_syslog_const(LOG_WARNING);
- rb_define_syslog_shortcut(warning);
+ rb_define_syslog_level(LOG_WARNING, warning);
#endif
#ifdef LOG_NOTICE
- rb_define_syslog_const(LOG_NOTICE);
- rb_define_syslog_shortcut(notice);
+ rb_define_syslog_level(LOG_NOTICE, notice);
#endif
#ifdef LOG_INFO
- rb_define_syslog_const(LOG_INFO);
- rb_define_syslog_shortcut(info);
+ rb_define_syslog_level(LOG_INFO, info);
#endif
#ifdef LOG_DEBUG
- rb_define_syslog_const(LOG_DEBUG);
- rb_define_syslog_shortcut(debug);
+ rb_define_syslog_level(LOG_DEBUG, debug);
#endif
+
+ /* Syslog macros */
+
+ rb_define_method(mSyslogMacros, "LOG_MASK", mSyslogMacros_LOG_MASK, 1);
+ rb_define_method(mSyslogMacros, "LOG_UPTO", mSyslogMacros_LOG_UPTO, 1);
+ rb_define_singleton_method(mSyslogMacros, "included", mSyslogMacros_included, 1);
+
+ rb_include_module(mSyslogConstants, mSyslogOption);
+ rb_include_module(mSyslogConstants, mSyslogFacility);
+ rb_include_module(mSyslogConstants, mSyslogLevel);
+ rb_funcall(mSyslogConstants, rb_intern("include"), 1, mSyslogMacros);
+
+ rb_define_singleton_method(mSyslogConstants, "included", mSyslogMacros_included, 1);
+ rb_funcall(mSyslog, rb_intern("include"), 1, mSyslogConstants);
}
diff --git a/ext/tk/MANUAL_tcltklib.eng b/ext/tk/MANUAL_tcltklib.eng
index 8ba202c06f..e9f6dc65ce 100644
--- a/ext/tk/MANUAL_tcltklib.eng
+++ b/ext/tk/MANUAL_tcltklib.eng
@@ -11,7 +11,7 @@ module TclTklib
: Tcl/Tk interpreters
module TclTkLib::EventFlag
- : Defines flags to define taget events on 'do_one_event' methos.
+ : Defines flags to define target events on 'do_one_event' methods.
: When to give, please use bit-operator (e.g. WINDOW | DONT_WAIT).
[constants]
diff --git a/ext/tk/MANUAL_tcltklib.eucj b/ext/tk/MANUAL_tcltklib.eucj
index 1ff5dddde4..1de1736f9f 100644
--- a/ext/tk/MANUAL_tcltklib.eucj
+++ b/ext/tk/MANUAL_tcltklib.eucj
@@ -1,525 +1,525 @@
(tof)
2005/07/05 Hidetoshi NAGAI
-ܥɥȤˤϸŤ tcltk 饤֥ꡤtcltklib 饤֥
-ޤޤƤޤεƤϸŤΤȤʤäƤޤ
+本ドキュメントには古い tcltk ライブラリ,tcltklib ライブラリの説明
+が含まれていますが,その記述内容は古いものとなっています.
-tcltk 饤֥tcltk.rbˤϸߤǤϥƥʥ󥹤¾Ԥ
-ʤᡤŤɥȤΤޤͭǤФ
-tcltklib 饤֥ˤĤƤϡߤ Ruby/Tktk.rb ʲΥ饤֥
-귲ˤƯ뤿濴Ȥƥƥʥ󥹤Ƥ뤿ᡤ
-㤤Ƥޤ
+tcltk ライブラリ(tcltk.rb)は現在ではメンテナンスが事実上行われて
+いないため,古いドキュメントの説明がそのまま有効です.それに対し,
+tcltklib ライブラリについては,現在の Ruby/Tk(tk.rb 以下のライブラ
+リ群)を稼働させるための中心としてメンテナンスされているため,少々
+違いが生じています.
-ǡޤŤʸ򼨤塤ߤ tcltklib 饤֥ˤ
-Ƥäޤ
+そこで,まず古い説明文書を示した後,現在の tcltklib ライブラリにつ
+いての説明を加えます.
-ʲ饤֥θŤʸǤ
+以下がライブラリの古い説明文書です.
==============================================================
MANUAL.euc
Sep. 19, 1997 Y. Shigehiro
-ʲ, tcl/tkפȤɽ, tclsh wish ¸Ƥ, ̤Ǥ
-Ȥ tcl/tk ؤޤ. tcltk 饤֥, tcltklib 饤֥
-פȤɽ, ܥѥå˴ޤޤ ruby ѤΥ饤֥ؤޤ.
+以下, 「tcl/tk」という表記は, tclsh や wish を実現している, 一般でいう
+ところの tcl/tk を指します. 「tcltk ライブラリ」, 「tcltklib ライブラ
+リ」という表記は, 本パッケージに含まれる ruby 用のライブラリを指します.
-<< tcltk 饤֥ >>
+<< tcltk ライブラリ >>
-tcl/tk C 饤֥Ѥ뤿ι(?)।󥿡ե
-ޤ.
+tcl/tk の C ライブラリを利用するための高(中?)水準インターフェースを提
+供します.
-Υ饤֥ ruby tcl/tk 饤֥Ѥ뤿ΤΤ,
- tcltklib 饤֥ѤƤޤ.
+このライブラリは ruby から tcl/tk ライブラリを利用するためのもので, 内
+部で tcltklib ライブラリを利用しています.
-[]
+[説明]
-tcl/tk 󥿥ץ꥿Ǥ, åȤ˲ؼˤ,
-̾³ƥѥ᡼񤭤ޤ. ä, åȤ֥
-ȤǤ, Фƥ᥽åɤäƤ, ȤߤʤȤǤޤ.
-, tcl/tk 󥿥ץ꥿Ǥ, Ȥ߹ߥޥɤ, ҤΥåȤ
-Ʊ褦ʽ񼰤̿Ǽ¹Ԥޤ. ʤ, ޥɤ⥪֥Ȥ
-ȹͤ뤳ȤǤޤ.
+tcl/tk インタプリタでは, ウィジェットに何か指示を送るには, ウィジェッ
+ト名に続いてパラメータを書きます. したがって, ウィジェットがオブジェク
+トであり, それに対してメソッドを送っている, とみなすことができます. さ
+て, tcl/tk インタプリタでは, 組み込みコマンドも, 前述のウィジェットと
+同じような書式の命令で実行されます. すなわち, コマンドもオブジェクトで
+あると考えることができます.
-Τ褦ʹͤ˴Ť, tcltk 饤֥Ǥ, tcl/tk Υޥɤ䥦
-åȤб륪֥Ȥޤ. ֥ȤФ᥽
-ɸƤӽФ, e() ᥽åɤˤ¹Ԥޤ. 㤨, tcl/tk info
-ޥɤб ruby Υ֥Ȥ info Ȥ̾ǤȤ,
-tcl/tk
+このような考えに基づき, tcltk ライブラリでは, tcl/tk のコマンドやウィ
+ジェットに対応するオブジェクトを生成します. オブジェクトに対するメソッ
+ド呼び出しは, e() メソッドにより実行されます. 例えば, tcl/tk の info
+コマンドに対応する ruby のオブジェクトが info という名前であるとすると,
+tcl/tk の
info commands
-Ȥ̿ tcltk 饤֥Ǥ
+という命令は tcltk ライブラリでは
info.e("commands")
-ȵҤޤ. ޤ, .פȤå (wish ¹Ի˼ưŪ
-롼ȥå) б ruby Υ֥Ȥ root Ȥ
-̾ǤȤ,
+と記述されます. また, 「.」というウィジェット (wish 実行時に自動的に生
+成されるルートウィジェット) に対応する ruby のオブジェクトが root とい
+う名前であるとすると,
. configure -height 300 -width 300
-Ȥ tcl/tk ̿
+という tcl/tk の命令は
root.e("configure -height 300 -width 300")
-ȵҤޤ. Τ褦ʵҤ, ˤޤ, ,
-ץȤɤͤˤϸŤ餤Τޤ, ºݤ˥ץȤ
-Ƥߤͽ۳˼ڤǤ.
+と記述されます. このような記述は, 見ためには美しくありませんが, そして,
+スクリプトを読む人には見づらいかも知れませんが, 実際にスクリプトを書い
+てみると予想外に手軽です.
-[ˡ]
+[使用法]
-1. 饤֥ɤ߹.
+1. ライブラリを読み込む.
require "tcltk"
-2. tcl/tk 󥿥ץ꥿.
+2. tcl/tk インタプリタを生成する.
ip = TclTkInterpreter.new()
-3. tcl/tk Υޥɤб륪֥ȤѿƤ.
- # ޥɤб륪֥Ȥä Hash Ф.
+3. tcl/tk のコマンドに対応するオブジェクトを変数に代入しておく.
+ # コマンドに対応するオブジェクトが入った Hash を取り出す.
c = ip.commands()
- # Ȥޥɤб륪֥Ȥ̤ѿ.
+ # 使いたいコマンドに対応するオブジェクトを個別の変数に代入する.
bind, button, info, wm = c.indexes("bind", "button", "info", "wm")
-4. ɬפʽԤ.
- ܤ, ץ򻲾ȤΤ.
+4. 必要な処理を行う.
+ 詳しくは, サンプルを参照のこと.
-5. Ǥ, ٥ȥ롼פ.
+5. 準備ができたら, イベントループに入る.
TclTk.mainloop()
-(( ʲ, ⥸塼, 饹ͽ.))
+(( 以下, モジュール, クラス等の説明を書く予定.))
-<< tcltklib 饤֥ >>
+<< tcltklib ライブラリ >>
-tcl/tk C 饤֥Ѥ뤿।󥿡ե󶡤
-.
+tcl/tk の C ライブラリを利用するための低水準インターフェースを提供しま
+す.
-ѥ/¹Ԥˤ, tcl/tk C 饤֥꤬ɬפǤ.
+コンパイル/実行には, tcl/tk の C ライブラリが必要です.
-[]
+[説明]
-Υ饤֥Ѥ, ruby tcl/tk C 饤֥ѤǤ
-. Ūˤ, ruby 󥿥ץ꥿ tcl/tk 󥿥ץ꥿ƤӽФ
-ȤǤޤ. , (ruby 󥿥ץ꥿ƤӽФ) tcl/tk
-󥿥ץ꥿, դ ruby 󥿥ץ꥿ƤӽФȤǤޤ.
+このライブラリを用いると, ruby から tcl/tk の C ライブラリを利用できま
+す. 具体的には, ruby インタプリタから tcl/tk インタプリタを呼び出すこ
+とができます. さらに, その(ruby インタプリタから呼び出した) tcl/tk イ
+ンタプリタから, 逆に ruby インタプリタを呼び出すこともできます.
-[ˡ]
+[使用法]
-require "tcltklib" , ʲΥ⥸塼, 饹ѲǽǤ.
+require "tcltklib" すると, 以下のモジュール, クラスが利用可能です.
-⥸塼 TclTkLib
- tcl/tk 饤֥ƤӽФ᥽åɤ򽸤᤿⥸塼Ǥ. ,
- tcl/tk 󥿥ץ꥿طΥ᥽åɤϥ饹 TclTkIp ˤޤ.
+モジュール TclTkLib
+ tcl/tk ライブラリを呼び出すメソッドを集めたモジュールです. ただし,
+ tcl/tk インタプリタ関係のメソッドはクラス TclTkIp にあります.
- ⥸塼᥽å mainloop()
- Tk_MainLoop ¹Ԥޤ. Ƥ tk Υɥ̵ʤȽλ
- ޤ(㤨, tcl/tk ǽ񤯤Ȥ "destroy ." 򤷤).
- : ̵
- : nil
+ モジュールメソッド mainloop()
+ Tk_MainLoop を実行します. 全ての tk のウインドウが無くなると終了
+ します(例えば, tcl/tk で書くところの "destroy ." をした場合等).
+ 引数: 無し
+ 戻り値: nil
-饹 TclTkIp
- 󥹥󥹤 tcl/tk Υ󥿥ץ꥿бޤ. tcl/tk Υ饤
- λ̤, 󥹥󥹤ʣƤưޤ(
- ʤȤ򤹤ɬפϤޤ̵ϤǤ). 󥿥ץ꥿ wish
- tcl/tk ޥɤ¹ԤǤޤ. , ʲΥޥɤ¹ԤǤ
- .
- ޥ ruby
- ruby Ǽ¹Ԥޤ(ruby_eval_string ¹Ԥޤ).
- 1 ĤǤʤФʤޤ. ͤ ruby μ¹Է̤Ǥ.
- ruby μ¹Է̤ nil String ǤʤФʤޤ.
+クラス TclTkIp
+ インスタンスが tcl/tk のインタプリタに対応します. tcl/tk のライブ
+ ラリの仕様通り, インスタンスを複数個生成しても正しく動作します(そ
+ んなことをする必要はあまり無いはずですが). インタプリタは wish の
+ tcl/tk コマンドを実行できます. さらに, 以下のコマンドを実行できま
+ す.
+ コマンド ruby
+ 引数を ruby で実行します(ruby_eval_string を実行します). 引数
+ は 1 つでなければなりません. 戻り値は ruby の実行結果です.
+ ruby の実行結果は nil か String でなければなりません.
- 饹᥽å new()
- TclTkIp 饹Υ󥹥󥹤ޤ
- : ̵
- (TclTkIp): 줿󥹥
+ クラスメソッド new()
+ TclTkIp クラスのインスタンスを生成します
+ 引数: 無し
+ 戻り値 (TclTkIp): 生成されたインスタンス
- ᥽å _eval(script)
- 󥿥ץ꥿ script ɾޤ(Tcl_Eval ¹Ԥޤ).
- Τ褦, ruby ޥɤˤ script ⤫ ruby ץȤ
- ԤǤޤ.
- : script (String) - 󥿥ץ꥿ɾ륹ץʸ
- (String): ɾ ((Tcl_Interp *)->result)
+ メソッド _eval(script)
+ インタプリタで script を評価します(Tcl_Eval を実行します). 前述
+ のように, ruby コマンドにより script 内から ruby スクリプトを実
+ 行できます.
+ 引数: script (String) - インタプリタで評価するスクリプト文字列
+ 戻り値 (String): 評価結果 ((Tcl_Interp *)->result)
- ᥽å _return_value()
- ľ Tcl_Eval ֤ͤޤ. 0(TCL_OK) ェλǤ.
- : ̵
- (Fixnum): ľ Tcl_Eval() ֤.
+ メソッド _return_value()
+ 直前の Tcl_Eval の戻り値を返します. 0(TCL_OK) で正常終了です.
+ 引数: 無し
+ 戻り値 (Fixnum): 直前の Tcl_Eval() が返した値.
==============================================================
-ʲܥɥȺǤ tcltklib 饤֥Ǥ
+以下が本ドキュメント作成時点での tcltklib ライブラリの説明です.
==============================================================
-⥸塼 TclTkLib
- : ġ Tcl/Tk 󥿡ץ꥿˰¸ʤ ( == ٥ȥ롼
- : פ˴ؤ ) ƤӽФ᥽åɤ⥸塼롥
-
- ⥸塼 TclTkLib::EventFlag
- : do_one_event ƤӽФݤνоݥ٥Ȥꤹ뤿
- : ե饰 ( WINDOW|DONT_WAIT Ȥ褦˥ӥåȱ黻ҤϢ뤷
- : ) Ȥ⥸塼롥ʲޤޤ롥
-
- NONE
- : ͤ 0 ǡͤȤƤϤʤΥ٥ȤꤷƤʤ
- : Ȥˤʤ뤬ºݤν ALL ƱȤư롥
-
- WINDOW
- : window ٥ȤоݤȤ
-
- FILE
- : file ٥ȤоݤȤ
-
- TIMER
- : timer ٥ȤоݤȤ
-
- IDLE
- : ɥ롼׽ ( ʤɡ¾μΥ٥Ȥȯ
- : ƤʤȤ˹Ԥ ) оݤȤ
-
- ALL
- : ٤ƤμΥ٥ȤоݤȤ
- : WINDOW|FILE|TIMER|IDLE Ʊ
-
- DONT_WAIT
- : оݥ٥Ȥ¸ߤʤˡ٥ȯԤ
- : do_one_event λ ( false ֤ )
-
- ⥸塼 TclTkLib::VarAccessFlag
- : _get_variable ʤɤǤΥե饰ꤹ뤿ΤΡե饰
- : ϰʲ OR Ϣ뤷Ϳ롥
-
- NONE
- : ͤ 0 ǡե饰ꤷƤʤΤ
-
- GLOBAL_ONLY
- : ̾ѿθϤޤ³ƤӽФԤä٥Ǹ
- : ˸ߤ֤̾ǸǸ˥Х֤
- : ԤΥե饰ꤵ줿ˤϡ
- : Х֤ǤΤ߸롥
- : ⤷ GLOBAL_ONLY NAMESPACE_ONLY Ȥξꤵ줿
- : ˤϡGLOBAL_ONLY λ̵뤵롥
-
- NAMESPACE_ONLY
- : Υե饰ꤵ줿ˤϡߤ֤̾ǤΤ
- : θԤGLOBAL_ONLY ⻲Ȥ뤳ȡ
-
- LEAVE_ERR_MSG
- : ѿˤƥ顼ȯ硤Υե饰
- : ꤵƤС¹Է̤Ȥ Tcl 󥿡ץ꥿˥
- : 顼åĤ롥Υե饰ꤵƤʤ
- : С顼åϰڻĤʤ
-
- APPEND_VALUE
- : Υե饰ꤵƤ硤ѿ֤ͤΤ
- : Ϥʤߤͤͤɲ (append; ʸϢ)
- : 롥ѿ̤ä硤Υե饰̵뤵롥
-
- LIST_ELEMENT
- : Υե饰ꤵƤ硤ͤϤޤ Tcl Υꥹ
- : ǤȤŬڤȤʤ褦Ѵ롥ͤꥹ
- : (ޤϥ֥ꥹ) κǽǤȤʤΤǤʤ¤ꡤ
- : ͤľˤ϶ʸɲä롥
-
- PARSE_VARNAME
- : _set_variable ʤɤθƤӽФˤƤΥե饰ꤵ
- : Ƥ硤var_name Ϣ̾̾Ȥξ
- : ޤǽ (̤ޤߡĤ̤ǽ)
- : Ȥ򼨤ξ硤̤δ֤̾ꡤǽγ
- : ̤ޤǤϢ̾Ȥư롥_set_variable2 ʤɤ
- : Υե饰ꤹ硤Ϣ̾̾ var_name
- : ФϤǤ뤫顤index_name nil
- : ͤФʤʤ
-
- ⥸塼 TclTkLib::RELEASE_TYPE
- : Tcl/Tk Υ꡼ֹ
-
- ALPHA
- : ALPHA ꡼
-
- BETA
- : BETA ꡼
-
- FINAL
- : FINAL ꡼
-
- ⥸塼᥽å
+モジュール TclTkLib
+ : 個々の Tcl/Tk インタープリタに依存しない処理 ( == イベントルー
+ : プに関する処理 ) を呼び出すメソッドを定義したモジュール.
+
+ モジュール TclTkLib::EventFlag
+ : do_one_event を呼び出す際の処理対象イベントを指定するための
+ : フラグ ( WINDOW|DONT_WAIT というようにビット演算子で連結して
+ : 指定 ) を定数として定義したモジュール.以下の定数が含まれる.
+
+ 定数 NONE
+ : 値は 0 で,値としてはいかなる種類のイベントも指定していない
+ : ことになるが,実際の処理上は ALL と同じとして扱われる.
+
+ 定数 WINDOW
+ : window イベントを処理対象とする
+
+ 定数 FILE
+ : file イベントを処理対象とする
+
+ 定数 TIMER
+ : timer イベントを処理対象とする
+
+ 定数 IDLE
+ : アイドルループ処理 ( 再描画など,他の種類のイベントが発生
+ : していないときに行われる処理 ) を処理対象とする
+
+ 定数 ALL
+ : すべての種類のイベントを処理対象とする
+ : WINDOW|FILE|TIMER|IDLE と同じ
+
+ 定数 DONT_WAIT
+ : 処理対象イベントが存在しない場合に,イベント発生を待たず
+ : に do_one_event を終了 ( false を返す ) する
+
+ モジュール TclTkLib::VarAccessFlag
+ : _get_variable などでのフラグを指定するためのもの.フラグに
+ : は以下の定数を OR で連結して与える.
+
+ 定数 NONE
+ : 値は 0 で,何もフラグを指定していないのに等しい.
+
+ 定数 GLOBAL_ONLY
+ : 通常,変数の検索はまず手続き呼び出しを行ったレベルで検
+ : 索し,次に現在の名前空間で検索,最後にグローバル空間で
+ : 検索を行う.しかし,このフラグが指定された場合には,グ
+ : ローバル空間でのみ検索する.
+ : もし GLOBAL_ONLY と NAMESPACE_ONLY とが両方指定された場
+ : 合には,GLOBAL_ONLY の指定は無視される.
+
+ 定数 NAMESPACE_ONLY
+ : このフラグが指定された場合には,現在の名前空間でのみ変
+ : 数の検索を行う.GLOBAL_ONLY の説明も参照すること.
+
+ 定数 LEAVE_ERR_MSG
+ : 変数アクセスにおいてエラーが発生した場合,このフラグが
+ : 指定されていれば,実行結果として Tcl インタープリタにエ
+ : ラーメッセージが残される.このフラグが指定されていなけ
+ : れば,エラーメッセージは一切残されない.
+
+ 定数 APPEND_VALUE
+ : このフラグが指定されていた場合,変数の値を置き換えので
+ : はなく,現在の値に代入値が追加 (append; 文字列連結) さ
+ : れる.変数が未定義あった場合,このフラグは無視される.
+
+ 定数 LIST_ELEMENT
+ : このフラグが指定されていた場合,代入値はまず Tcl のリス
+ : ト要素として適切となるように変換される.代入値がリスト
+ : (またはサブリスト) の最初の要素となるのでない限り,代入
+ : 値の直前には空白文字が追加される.
+
+ 定数 PARSE_VARNAME
+ : _set_variable などの呼び出しにおいてこのフラグが指定さ
+ : れていた場合,var_name 引数が連想配列名と要素名とを両方
+ : 含む可能性がある (開き括弧を含み,閉じ括弧で終わる) こ
+ : とを示す.その場合,括弧の間が要素名指定,最初の開き括
+ : 弧までが連想配列名として扱われる._set_variable2 などで
+ : このフラグを指定する場合,連想配列名と要素名は var_name
+ : から抽出されるはずであるから,index_name 引数は nil と
+ : せねばならない.
+
+ モジュール TclTkLib::RELEASE_TYPE
+ : Tcl/Tk のリリースタイプ番号の定義
+
+ 定数 ALPHA
+ : ALPHA リリース
+
+ 定数 BETA
+ : BETA リリース
+
+ 定数 FINAL
+ : FINAL リリース
+
+ モジュールメソッド
get_version()
- : Tcl/Tk major, minor, release-type ֹ, patchlevel
- : ˤ֤
+ : Tcl/Tk の major, minor, release-type 番号, patchlevel を
+ : 配列にして返す.
mainloop(check_root = true)
- : ٥ȥ롼פư롥check_root true ǤС
- : root widget ¸ߤ¤ꡤΥ᥽åɤϽλʤ
- : check_root false ξϡroot widget ǤƤ
- : Υ᥽åɤϽλʤ ( root widget ǤƤ⡤
- : WINDOW ʳΥ٥Ȥȯ뤿 )λˤϡ
- : Ưݤ ( åɤѤʤ ) ɬס
+ : イベントループを起動する.check_root が true であれば,
+ : root widget が存在する限り,このメソッドは終了しない.
+ : check_root が false の場合は,root widget が消滅しても
+ : このメソッドは終了しない ( root widget が消滅しても,
+ : WINDOW 以外のイベントは発生しうるため ).終了には,外部
+ : からの働き掛け ( スレッドを活用するなど ) が必要.
mainloop_thread?
- : ȥåɤ٥ȥ롼פ¹ԤƤ륹å
- : ɤ֤
- : ٥ȥ롼פ¹ԤƤ륹åɤǤ true
- : ɤΥåɤǤ⥤٥ȥ롼פ¹ԤƤʤ
- : nil ¾Υåɤǥ٥ȥ롼פ¹ԤƤ
- : false ֤
- : false κݤ Tk 󥿡ץ꥿ľܸƤ֤ΤϴǤ롥
+ : カレントスレッドがイベントループを実行しているスレッド
+ : かどうかを返す.
+ : イベントループを実行しているスレッドであれば true を,
+ : どのスレッドでもイベントループが実行されていない場合は
+ : nil を,他のスレッドでイベントループが実行されている場
+ : 合は false を返す.
+ : false の際に Tk インタープリタを直接呼ぶのは危険である.
mainloop_watchdog(check_root = true)
- : ̾Υ٥ȥ롼פǤϡ٥ȽƤˤäƤ
- : ǥåɥåǽ (㤨Х٥Ȥ
- : Ф륳Хå widget 򤷡νλ
- : ԤĤʤ)Υ᥽åɤϡǥåɥå
- : 뤿δƻ륹åդǥ٥ȥ롼פư
- : ( ƻ륹åɤ˥٥ȥ롼פ¹Ԥ )
- : ΰ̣ mainloop ƱǤ롥
+ : 通常のイベントループでは,イベント処理の内容によっては
+ : デッドロックを引き起こす可能性がある (例えばイベントに
+ : 対するコールバック処理中で widget 操作をし,その終了を
+ : 待つなど).このメソッドは,そうしたデッドロックを回避す
+ : るための監視スレッド付きでイベントループを起動する
+ : ( 監視スレッドを生成した後にイベントループを実行する ).
+ : 引数の意味は mainloop と同じである.
do_one_event(flag = TclTkLib::EventFlag::ALL |
TclTkLib::EventFlag::DONT_WAIT)
- : ԤΥ٥ 1 Ĥ¹Ԥ롥
- : ٥Ȥ true ֤
- : ե饰 DONT_WAIT ꤷƤʤ硤ե饰ǽ
- : ݤȤʤäƤΥ٥ȤȯޤԤ³롥
- : DONT_WAIT ꤷƤ硤оݥ٥ȤʤƤ
- : ˽λ false ֤
- : $SAFE >= 4 $SAFE >= 1 flag Ƥʤ
- : flag ˤ DONT_WAIT Ūդ롥
+ : 処理待ちのイベント 1 個を実行する.
+ : イベントを処理した場合は true を返す.
+ : フラグで DONT_WAIT を指定していない場合,フラグで処理対
+ : 象となっている種類のイベントが発生するまで待ち続ける.
+ : DONT_WAIT を指定していた場合,処理対象イベントがなくても
+ : すぐに終了し false を返す.
+ : $SAFE >= 4 か,$SAFE >= 1 かつ flag が汚染されているならば
+ : flag には DONT_WAIT が強制的に付けられる.
set_eventloop_tick(timer_tick)
- : ٥ȥ롼פƱ̥åɤƯƤˡ
- : ֤˴ŤŪʥåɥå󥰤ɤ٤
- : ( ֳִ ) ȯ뤫ߥñ̤ͤǻꤹ롥
- : 0 ꤹȡζŪʥå󥰤ϹԤʤ
- : ɸǤ 0 ꤵƤꡤ٥Ƚ˴Ť
- : 󥰤Ԥ ( see set_eventloop_weight )
- : ƯƤ륹åɤ٥ȥ롼פξ硤
- : timer_tick 0 ꤹ뤳ȤϤǤʤ⤷ꤵ
- : 顤100 ms ( see NO_THREAD_INTERRUPT_TIME ) ˼ư
- : ꤵ롥
- : ܺ٤ά CPU ѥ󤷤Ĥİ
- : ꤷư¸뤿˼ͤǤ롥
- : $SAFE >= 4 Ǥϼ¹Ԥػߤ롥
+ : イベントループと同時に別スレッドが稼働している場合に,時
+ : 間に基づいた強制的なスレッドスイッチングをどの程度の頻度
+ : ( 時間間隔 ) で発生させるかをミリ秒単位の整数値で指定する.
+ : 0 を指定すると,この強制的なスイッチングは行われない.
+ : 標準では 0 に設定されており,イベント処理数に基づくスイッ
+ : チングだけが行われる ( see set_eventloop_weight ).
+ : ただし,稼働しているスレッドがイベントループだけの場合,
+ : timer_tick を 0 に設定することはできない.もし設定されて
+ : いたら,100 ms ( see NO_THREAD_INTERRUPT_TIME ) に自動設
+ : 定される.
+ : 詳細な説明は略すが,これは CPU パワーを節約しつつ安全で
+ : 安定した動作を実現するために実装した仕様である.
+ : $SAFE >= 4 では実行が禁止される.
get_eventloop_tick
- : timer_tick θ֤ͤ
+ : timer_tick の現在値を返す.
set_no_event_wait(no_event_wait)
- : ʣΥåɤƯƤǡԤ٥Ȥ
- : ¸ߤʤäݤ sleep ֤Ĺꤹ롥
- : Ưåɤ٥ȥ롼פξˤϰ̣ʤʤ
- : ǥեȤͤ 20 (ms)
- : $SAFE >= 4 Ǥϼ¹Ԥػߤ롥
+ : 複数のスレッドが稼働している場合で,処理待ちイベントが全
+ : く存在しなかった際に sleep 状態に入る時間長を指定する.
+ : 稼働スレッドがイベントループだけの場合には意味をなさない.
+ : デフォルトの値は 20 (ms)
+ : $SAFE >= 4 では実行が禁止される.
get_no_event_wait
- : no_event_wait θ֤ͤ
+ : no_event_wait の現在値を返す.
set_eventloop_weight(loop_max, no_event_tick)
- : ʣΥåɤƯƤݤ Ruby/Tk Υ٥ȥ롼
- : פ˳ƤŤ뤿Υѥ᡼ꤹ롥
- : Ưåɤ٥ȥ롼פξˤϰ̣ʤʤ
- : ٤Υåڤؤδ֤˽륤٥Ȥκȡ
- : ԤΥ٥Ȥ¸ߤʤݤβûȤꤹ롥
- : Ԥ٥Ȥ¸ߤʤ no_event_wait ( see
- : set_no_event_wait ) δ sleep ֤롥
- : ǥեȤǤϤ줾 800 10 󡤤Ĥޤꡤ800 ĤΥ
- : ٥ (ɥ륤٥Ȥޤ) Ȥ٥
- : ȯʤޤޤ 80 νԤ٥ȸλ
- : ȤǥȤ 800 ʾˤʤȥåɥå
- : ȯ뤳Ȥˤʤ롥
- : $SAFE >= 4 Ǥϼ¹Ԥػߤ롥
+ : 複数のスレッドが稼働している際に Ruby/Tk のイベントルー
+ : プに割り当てる比重を定めるためのパラメータを設定する.
+ : 稼働スレッドがイベントループだけの場合には意味をなさない.
+ : 一度のスレッド切り替えの間に処理するイベントの最大数と,
+ : 処理待ちのイベントが存在しない際の加算数とを設定する.
+ : 処理待ちイベントが存在しない場合は no_event_wait ( see
+ : set_no_event_wait ) だけの間 sleep 状態に入る.
+ : デフォルトではそれぞれ 800 回と 10 回,つまり,800 個のイ
+ : ベント (アイドルイベントを含む) を処理するとか,イベント
+ : が全く発生しないままに 80 回の処理待ちイベント検査が完了
+ : するとかでカウントが 800 以上になるとスレッドスイッチング
+ : が発生することになる.
+ : $SAFE >= 4 では実行が禁止される.
get_eventloop_weight
- : ߤ loop_max no_event_tick Ȥ֤ͤ
+ : 現在の loop_max と no_event_tick との値を返す.
: ( see set_eventloop_wait )
mainloop_abort_on_exception=(bool)
- : Tk 󥿡ץ꥿㳰ȯݤˡ٥ȥ롼פ
- : 顼ߤ뤫ɤꤹ롥true ꤷ
- : 顼ߤ뤬false ξ㳰̵뤷ƥ٥ȥ롼
- : פ³롥 nil ξϷٹ⡼ɤǤʤ¤ϥ
- : 顼åνϤάơ㳰̵뤹롥
- : ǥեȤǤ true ꤵƤ롥
- : ĤΥ󥿡ץ꥿ȤäƤˤϥ顼ˤ
- : ޤߤƤ̾ʤʣΥ󥿡ץ꥿Ʊ
- : ưƤˤϡ륤٥ȥ롼פϣ
- : ĤǤ뤿ᡤ줫Υ󥿡ץ꥿Υ顼ǡ
- : ¾Υ󥿡ץ꥿ν³Բǽˤʤ뤳Ȥ롥
- : 褦ʾǤ⥨顼̵뤷ƥ٥ȥ롼פƯ³
- : Ȥǡ¾Υ󥿡ץ꥿ư³뤳ȤǤ롥
- : $SAFE >= 4 Ǥϼ¹Ԥػߤ롥
+ : Tk インタープリタ上で例外を発生した際に,イベントループを
+ : エラー停止させるかどうかを指定する.true を指定した場合は
+ : エラー停止するが,false の場合は例外を無視してイベントルー
+ : プを継続する.さらに nil の場合は警告モードでない限りはエ
+ : ラーメッセージの出力すら省略して,例外を無視する.
+ : デフォルトでは true に設定されている.
+ : 1個のインタープリタだけを使っている場合にはエラー時にその
+ : まま停止しても通常は問題ないが,複数のインタープリタが同時
+ : に動作している場合には,それらを管理するイベントループは1
+ : 個だけであるため,いずれかのインタープリタのエラーが原因で,
+ : 他のインタープリタの処理継続が不可能になることがある.その
+ : ような場合でもエラーを無視してイベントループが稼働を続ける
+ : ことで,他のインタープリタが正常に動作し続けることができる.
+ : $SAFE >= 4 では実行が禁止される.
mainloop_abort_on_exception
- : Tk 󥿡ץ꥿㳰ȯݤˡ٥ȥ롼פ
- : 顼ߤ뤫ɤ֤ true/false 롥
+ : Tk インタープリタ上で例外を発生した際に,イベントループをエ
+ : ラー停止させるかどうかの設定状態を true/false で得る.
num_of_mainwindows
- : ߤΥᥤ󥦥ɥ (롼ȥå) ο֤
- : ᥤ󥦥ɥϰĤΥ󥿡ץ꥿դĤǤ
- : Τǡͤϸ Tk εǽͭǤ륤󥿡ץ꥿
- :
+ : 現在のメインウィンドウ (ルートウィジェット) の数を返す.
+ : メインウィンドウは一つのインタープリタに付き最大一つである
+ : ので,この値は現在 Tk の機能が有効であるインタープリタの総
+ : 数に等しい.
_merge_tklist(str, str, ... )
- : Tcl/Tk Υ饤֥ؿȤäơʸ󤬤줾
- : ĤΥꥹǤȤʤ褦Ϣ뤷ʸ֤
+ : Tcl/Tk のライブラリ関数を使って,引数の文字列がそれぞれ
+ : 正しく一つのリスト要素となるように連結した文字列を返す.
_conv_listelement(str)
- : Tcl/Tk Υ饤֥ؿȤäơʸ Tcl
- : ĤΥꥹǤȤŬڤɽˤʤ褦Ѵʸ
- : ֤
+ : Tcl/Tk のライブラリ関数を使って,引数の文字列が Tcl の
+ : 一つのリスト要素として適切な表現になるように変換した文
+ : 字列を返す.
_toUTF8(str, encoding=nil)
_fromUTF8(str, encoding=nil)
- : Tcl/Tk ¢Ƥ UTF8 ѴƤӽФ
+ : Tcl/Tk が内蔵している UTF8 変換処理を呼び出す.
_subst_UTF_backslash(str)
_subst_Tcl_backslash(str)
- : Tcl Υ롼ǥХåå嵭ˡ ( \uhhhh ˤ
- : Unicode ʸɽޤ ) Ϥ롥
- : _subst_Tcl_backslash Ϥ٤ƤΥХåå嵭ˡ
- : ֤ΤФ_subst_UTF_backslash \uhhhh
- : ˤ Unicode ʸɽ֤롥
+ : Tcl のルールでバックスラッシュ記法 ( \uhhhh による
+ : Unicode 文字表現を含む ) を解析する.
+ : _subst_Tcl_backslash はすべてのバックスラッシュ記法を
+ : 置き換えるのに対し,_subst_UTF_backslash は \uhhhh
+ : による Unicode 文字表現だけを置き換える.
encoding_system
encoding_system=(encoding)
- : Tcl system encoding γ
+ : Tcl の system encoding の獲得および設定
encoding
encoding=(encoding)
- : encoding_system / encoding_system= alias
- : ( Ruby/Tk tk.rb Ǥ֤ͽΤΡ)
+ : encoding_system / encoding_system= の alias
+ : ( Ruby/Tk の tk.rb では置き換えられる予定のもの.)
-饹 TclTkIp
- 饹᥽å
+クラス TclTkIp
+ クラスメソッド
new(ip_name=nil, options='')
- : TclTkIp 饹Υ󥹥󥹤롥
- : ip_name ʸͿϡ줬 winfo interps ʤɤ
- : ɽ̾ˤʤ롥
- : options ˤϡ-geometry -use ʤɡwish Υޥɥ饤
- : ȤͿ륪ץƱͤξʸȤͿ롥
- : Ϳ줿ϡroot widget κݤѤ롥
+ : TclTkIp クラスのインスタンスを生成する.
+ : ip_name に文字列を与えた場合は,それが winfo interps などで
+ : 表示される名前になる.
+ : options には,-geometry や -use など,wish のコマンドライン
+ : 引数として与えるオプションと同様の情報を文字列として与える.
+ : 与えられた情報は,root widget 生成の際に用いられる.
: ( e.g. TclTkIp.new('FOO', '-geometry 500x200 -use 0x2200009') )
- : ⤷ options ˴ nil ޤ false Ϳ硤Tk 饤
- : ֥꤬ƳƤʤ (Ĥޤ Tcl Τߤ) 󥿡ץ
- : 롥ξ GUI Ķɬפʤᡤɥ
- : ƥब¸ߤʤޤϻѤǤʤĶǤ Tcl 󥿡
- : ץ꥿Tcl 䤽γĥ饤֥Ѥ뤳ȤǤ롥
+ : もし options に敢えて nil または false を与えた場合,Tk ライ
+ : ブラリが導入されていない (つまりは Tcl のみの) インタープリ
+ : タを生成する.この場合は GUI 環境は必要ないため,ウインドウ
+ : システムが存在しない,または使用できない環境でも Tcl インター
+ : プリタを生成し,Tcl やその拡張ライブラリを活用することができる.
- 󥹥󥹥᥽å
+ インスタンスメソッド
create_slave(name, safe=false)
- : 쥷ФƤȤ name Ȥ̾Υ졼֥󥿡ץ꥿
- : 롥
- : safe ˤ륤󥿡ץ꥿ safe 󥿡ץ꥿Ȥ
- : ꤹ롥ǥեȤ false ȤȤˤʤäƤ뤬
- : ȤΤ false ꤷƤȤƤ⡤ƤȤʤ륤󥿡
- : ץ꥿ safe 󥿡ץ꥿ǤСѤ
- : safe 󥿡ץ꥿Ȥ롥
- : $SAFE >= 4 Ǥϡsafe 󥿡ץ꥿ʳػߤ롥
+ : レシーバを親とする name という名前のスレーブインタープリタを
+ : 生成する.
+ : safe には生成するインタープリタを safe インタープリタとする
+ : かを指定する.デフォルトは false ということになっているが,
+ : たとえ明確に false を指定していたとしても,親となるインター
+ : プリタが safe インタープリタであれば,その設定を引き継いで
+ : safe インタープリタとして生成される.
+ : $SAFE >= 4 では,safe インタープリタ以外の生成が禁止される.
make_safe
- : Tcl/Tk 󥿡ץ꥿ safe 󥿡ץ꥿ѹ롥
- : ͤϥ쥷ФǤ륤󥿡ץ꥿ȤǤ롥
- : Ԥ RuntimeError 㳰ȯ롥
+ : Tcl/Tk インタープリタを safe インタープリタに変更する.
+ : 戻り値はレシーバであるインタープリタ自身である.
+ : 失敗した場合は RuntimeError の例外を発生する.
safe?
- : Tcl/Tk 󥿡ץ꥿ safe 󥿡ץ꥿Ǥ뤫Ĵ٤롥
- : safe 󥿡ץ꥿Ǥ true ֤
+ : Tcl/Tk インタープリタが safe インタープリタであるかを調べる.
+ : safe インタープリタであれば true を返す.
allow_ruby_exit?
- : оݤȤʤ륤󥿡ץ꥿ɾǡruby exit ؿޤ
- : Tcl/Tk exit ޥɤˤä ruby Τλ뤳
- : ɤ֤
- : ʤоݤΥ󥿡ץ꥿λ롥
- : ޥ󥿡ץ꥿Υǥեͤ true졼֥󥿡
- : ץ꥿Υǥեͤ false Ǥ롥
+ : 対象となるインタープリタ上の評価で,ruby の exit 関数または
+ : Tcl/Tk 上の exit コマンドによって ruby 自体を終了させること
+ : を許すかどうかを返す.
+ : 許さない場合は対象のインタープリタだけが終了する.
+ : マスターインタープリタのデフォルト値は true,スレーブインター
+ : プリタのデフォルト値は false である.
allow_ruby_exit=(mode)
- : оݤȤʤ륤󥿡ץ꥿ allow_ruby_exit? ξ֤ѹ롥
- : $SAFE >= 4 ޤϥ󥿡ץ꥿ safe 󥿡ץ꥿ξ
- : ѹʤ (㳰ȯ)
+ : 対象となるインタープリタの allow_ruby_exit? の状態を変更する.
+ : $SAFE >= 4 またはインタープリタが safe インタープリタの場合は
+ : 変更が許されない (例外を発生).
delete
- : Tcl/Tk 󥿡ץ꥿ delete 롥
- : delete 줿󥿡ץ꥿ϡʸڤǤʤʤꡤ
- : ޥɤäƤ㳰ȯ褦ˤʤ롥
+ : Tcl/Tk インタープリタを delete する.
+ : delete されたインタープリタは,以後一切の操作ができなくなり,
+ : コマンドを送っても例外を発生するようになる.
deleted?
- : Tcl/Tk 󥿡ץ꥿Ǥ delete Ƥ뤫Ĵ٤롥
- : delete Ѥߤǥޥɤդʤ֤ˤʤäƤʤ
- : true ֤
+ : Tcl/Tk インタープリタがすでに delete されているかを調べる.
+ : delete 済みでコマンドを受け付けない状態になっているならば
+ : true を返す.
has_mainwindow?
- : Tcl/Tk 󥿡ץ꥿˥ᥤ󥦥ɥ (root widget)
- : ¸ߤ true ¸ߤʤ false ֤
- : 󥿡ץ꥿ delete ѤߤǤ nil ֤
+ : Tcl/Tk インタープリタにメインウィンドウ (root widget) が
+ : 存在すれば true を,存在しなければ false を返す.
+ : インタープリタが既に delete 済みであれば nil を返す.
restart
- : Tcl/Tk 󥿡ץ꥿ Tk ʬνƵưԤ
- : ö root widget ˲˺ Tk εǽɬפ
- : ʤäѤ롥
- : $SAFE >= 4 Ǥϼ¹Ԥػߤ롥
+ : Tcl/Tk インタープリタの Tk 部分の初期化,再起動を行う.
+ : 一旦 root widget を破壊した後に再度 Tk の機能が必要と
+ : なった場合に用いる.
+ : $SAFE >= 4 では実行が禁止される.
_eval(str)
_invoke(*args)
- : Tcl/Tk 󥿡ץ꥿ɾԤ
- : _eval ɾץȤĤʸǤ뤳ȤФ
- : _invoke ɾץȤ token Ȥ˰ĤΰȤ
- : 褦Ϳ롥
- : _invoke Tcl/Tk 󥿡ץ꥿λϴѤ
- : ʤᡤɾ٤꾯ʤƤࡥ
- : auto_load Τ褦ʵƯload ˤä
- : Tcl/Tk 󥿡ץ꥿˴ϿѤߤΥޥɤ
- : ӽФȤǤʤ
- : _eval Ǥ auto_load Ưᡤ _eval ¹
- : ϿСʹߤ _invoke ǤѤ
- : 褦ˤʤ롥
+ : Tcl/Tk インタープリタ上で評価を行う.
+ : _eval は評価スクリプトが一つの文字列であることに対し,
+ : _invoke は評価スクリプトの token ごとに一つの引数とな
+ : るように与える.
+ : _invoke の方は Tcl/Tk インタープリタの字句解析器を用い
+ : ないため,評価の負荷がより少なくてすむ.ただし,その代
+ : わりに auto_load のような機構は働かず,load 等によって
+ : Tcl/Tk インタープリタ上に既に登録済みのコマンドしか呼
+ : び出すことができない.
+ : _eval では auto_load 機構が働くため,一度 _eval を実行
+ : して登録に成功しさえすれば,以降は _invoke でも利用で
+ : きるようになる.
_cancel_eval(str)
_cancel_eval_unwind(str)
: (Tcl/Tk8.6 or later)
- : Tcl_CancelEval() ؿƤӽФeval μ¹ԤǤڤ롥
+ : Tcl_CancelEval() 関数を呼び出し,eval の実行を打ち切る.
_toUTF8(str, encoding=nil)
_fromUTF8(str, encoding=nil)
- : Tcl/Tk ¢Ƥ UTF8 ѴƤӽФ
+ : Tcl/Tk が内蔵している UTF8 変換処理を呼び出す.
_thread_vwait(var_name)
_thread_tkwait(mode, target)
- : åб vwait 뤤 tkwait Υ᥽åɡ
- : ̾ vwait 뤤 tkwait ޥɤȰۤʤΤϡ٥
- : ȥ롼פȤϰۤʤ륹åɤƤӽФ vwait
- : åȤΩ˾ΩԤʤ뤳ȤǤ롥
- : ̾ vwait / tkwait Ǥϡvwait / tkwait (1) Ԥ
- : Ǥ vwait / tkwait (2) ƤФ줿硤Ԥо
- : ȤʤäƤΩɤ졤(2)->(1) νԤ
- : λäƤ롥
- : _thread_vwait / _thread_tkwait ϡ٥ȥ롼פΥ
- : ɤǸƤФ줿̾ vwait / tkwait Ʊͤư
- : ٥ȥ롼װʳΥåɤǸƤФ줿ˤϤΥ
- : åɤߤԤꡤ郎Ω˥å
- : μ¹ԤƳ롥vwait ԤåȤΩפȤ
- : ̣ϡκƳΥߥ󥰤¾ΥåɤǤԤ
- : Ȥ̵طȤȤǤ롥Ĥޤꡤ٥ȥ롼¾
- : Υåɤ vwait Ԥξ֤ˤäȤƤ⤽δλ
- : ԤĤȤʤԤ郎Ω衤³
- : Ȥˤʤ롥
+ : スレッド対応の vwait あるいは tkwait 相当のメソッド.
+ : 通常の vwait あるいは tkwait コマンドと異なるのは,イベン
+ : トループとは異なるスレッドから呼び出した場合に vwait 等の
+ : スタックとは独立に条件の成立待ちがなされることである.
+ : 通常の vwait / tkwait では,vwait / tkwait (1) の待ちの途
+ : 中でさらに vwait / tkwait (2) が呼ばれた場合,待ちの対象
+ : となっている条件の成立順序がどうあれ,(2)->(1) の順で待ち
+ : を終了して戻ってくる.
+ : _thread_vwait / _thread_tkwait は,イベントループのスレッ
+ : ドで呼ばれた場合は通常の vwait / tkwait と同様に動作する
+ : が,イベントループ以外のスレッドで呼ばれた場合にはそのス
+ : レッドを停止させて待ちに入り,条件が成立した時にスレッド
+ : の実行を再開する.「vwait 等の待ちスタックとは独立」とい
+ : う意味は,この再開のタイミングが他のスレッドでの待ち状況
+ : とは無関係ということである.つまり,イベントループ等の他
+ : のスレッドで vwait 等で待ちの状態にあったとしてもその完了
+ : を待つことなく,自らの待ち条件が成立次第,処理を継続する
+ : ことになる.
_return_value
- : ľ Tcl/Tk Ǥɾμ¹Է̤ȤƤ֤ͤ
+ : 直前の Tcl/Tk 上での評価の実行結果としての戻り値を返す.
_get_variable(var_name, flag)
_get_variable2(var_name, index_name, flag)
- : Tcl/Tk var Ȥѿ̾ѿ֤ͤ
- : ⤷ index_name (PARSE_VARNAME ե饰⻲)
- : 줿Ϣ var_name index_name Ǥ֤
- : flag ˤѿ򸡺ݤξꤹ롥flag Ϳ
- : ͤϥ⥸塼 TclTkLib::VarAccessFlag 򻲾Ȥ뤳ȡ
+ : Tcl/Tk 上の var という変数名の変数の値を返す.
+ : もし index_name が指定 (PARSE_VARNAME フラグの説明も参照)
+ : された場合は連想配列 var_name の index_name の要素を返す.
+ : flag には変数を検索する際の条件を指定する.flag に与える
+ : 値はモジュール TclTkLib::VarAccessFlag を参照すること.
_set_variable(var_name, value, flag)
_set_variable2(var_name, index_name, value, flag)
- : Tcl/Tk var Ȥѿ̾ѿͤꤹ롥
- : ⤷ index_name (PARSE_VARNAME ե饰⻲)
- : 줿Ϣ var_name index_name Ǥ
- : 롥
- : flag ˤѿ򸡺ݤξꤹ롥flag Ϳ
- : ͤϥ⥸塼 TclTkLib::VarAccessFlag 򻲾Ȥ뤳ȡ
+ : Tcl/Tk 上の var という変数名の変数に値を設定する.
+ : もし index_name が指定 (PARSE_VARNAME フラグの説明も参照)
+ : された場合は連想配列 var_name の index_name の要素を設定
+ : する.
+ : flag には変数を検索する際の条件を指定する.flag に与える
+ : 値はモジュール TclTkLib::VarAccessFlag を参照すること.
_unset_variable(var_name)
_unset_variable2(var_name, index_name)
- : Tcl/Tk var_name Ȥѿ̾ѿõ롥
- : ⤷ index_name (PARSE_VARNAME ե饰⻲)
- : 줿Ϣ var_name index_name Ǥ
- : õ롥
+ : Tcl/Tk 上の var_name という変数名の変数を消去する.
+ : もし index_name が指定 (PARSE_VARNAME フラグの説明も参照)
+ : された場合は連想配列 var_name から index_name の要素だけ
+ : を消去する.
_get_global_var(var_name)
_get_global_var2(var_name, index_name)
@@ -527,31 +527,31 @@ require "tcltklib" , ʲΥ⥸塼, 饹ѲǽǤ.
_set_global_var2(var_name, index_name, value)
_unset_global_var(var_name)
_unset_global_var2(var_name, index_name)
- : 줾졤бѿ᥽åɤ flag Ф
- : (GLOBAL_ONLY | LEAVE_ERR_MSG) ͿΡ
+ : それぞれ,対応する変数アクセスメソッドの flag に対して
+ : (GLOBAL_ONLY | LEAVE_ERR_MSG) を与えたもの.
_split_tklist(str)
- : Tcl/Tk Υ饤֥ؿȤäơʸ str ꥹȤ
- : ʬ䤹 (ʸȤ֤)
+ : Tcl/Tk のライブラリ関数を使って,文字列 str をリストに
+ : 分割する (文字列の配列として返す).
_merge_tklist(str, str, ... )
- : Tcl/Tk Υ饤֥ؿȤäơʸ󤬤줾
- : ĤΥꥹǤȤʤ褦Ϣ뤷ʸ֤
+ : Tcl/Tk のライブラリ関数を使って,引数の文字列がそれぞれ
+ : 正しく一つのリスト要素となるように連結した文字列を返す.
_conv_listelement(str)
- : Tcl/Tk Υ饤֥ؿȤäơʸ Tcl
- : ĤΥꥹǤȤŬڤɽˤʤ褦Ѵʸ
- : ֤
+ : Tcl/Tk のライブラリ関数を使って,引数の文字列が Tcl の
+ : 一つのリスト要素として適切な表現になるように変換した文
+ : 字列を返す.
mainloop
mainloop_watchdog
- : 졼 IP ξˤϥ٥ȥ롼פư nil ֤
- : ʳǤϰޤ TclTkLib Ʊ̾᥽åɤƱ
+ : スレーブ IP の場合にはイベントループを起動せずに nil を返す.
+ : それ以外の点では引数を含めて TclTkLib の同名メソッドに同じ.
do_one_event
- : 졼 IP ξˤϰΥ٥ȥե饰 DONT_WAIT
- : Ūɲä (٥Ԥǥ꡼פ뤳Ȥ϶ػ)
- : ʳǤϰޤ TclTkLib Ʊ̾᥽åɤƱ
+ : スレーブ IP の場合には引数のイベントフラグに DONT_WAIT が
+ : 強制的に追加される (イベント待ちでスリープすることは禁止).
+ : それ以外の点では引数を含めて TclTkLib の同名メソッドに同じ.
set_eventloop_tick
get_eventloop_tick
@@ -561,24 +561,24 @@ require "tcltklib" , ʲΥ⥸塼, 饹ѲǽǤ.
get_eventloop_weight
mainloop_abort_on_exception
mainloop_abort_on_exception=
- : 졼 IP ξˤ꤬ͤʤ (̵뤵)
- : ʳǤϰޤ TclTkLib Ʊ̾᥽åɤƱ
+ : スレーブ IP の場合には値の設定が許されない (無視される).
+ : それ以外の点では引数を含めて TclTkLib の同名メソッドに同じ.
encoding_table
- : Ruby m17n Ѥ Ruby Tk Ȥδ֤ encoding бɽ֤
-
-饹 TkCallbackBreak < StandardError
-饹 TkCallbackContinue < StandardError
- : ϥ٥ȥХåˤơХåŬڤ
- : ǤꡤΥХɥΥХǥ󥰽˿ʤ᤿ꤹ뤳
- : ǽˤ뤿㳰饹Ǥ롥
- : Хå break continue ¸뤿ˤϡХå
- : Ǥ Ruby ³ Tcl/Tk 󥿡ץ꥿¦Ŭڤʥ꥿󥳡
- : ɤ֤ɬפ롥Ruby μ³̤֤ͤΤǤϡ줬
- : ̤ͤǤΤݤ̤Ǥʤᡤ㳰ȯѤ
- : ԤäƤ롥
- : ߤǤϡХå³ Ruby break, next ǽλ
- : 뤳ȤƱη̤뤳ȤǤ褦ˤʤäƤ롥椨
- : ɬפʤΤǤϤ뤬ߴΤ˻ĤƤ롥
+ : Ruby m17n 用に Ruby と Tk との間の encoding 対応表を返す.
+
+クラス TkCallbackBreak < StandardError
+クラス TkCallbackContinue < StandardError
+ : これらはイベントコールバックにおいて,コールバック処理を適切に中
+ : 断したり,次のバインドタグのバインディング処理に進めたりすること
+ : を可能にするための例外クラスである.
+ : コールバックで break や continue を実現するためには,コールバック
+ : である Ruby 手続きが Tcl/Tk インタープリタ側に適切なリターンコー
+ : ドを返す必要がある.Ruby の手続きが普通に値を返すのでは,それが普
+ : 通の戻り値であるのか否かを区別ができないため,例外発生を利用した
+ : 実装を行っている.
+ : ただし現在では,コールバック手続きを Ruby の break, next で終了す
+ : ることで同等の結果を得ることができるようになっている.それゆえ,
+ : これらは必要ないものではあるが,互換性のために残してある.
(eof)
diff --git a/ext/tk/README.1st b/ext/tk/README.1st
index 0179f4d526..96564cc67b 100644
--- a/ext/tk/README.1st
+++ b/ext/tk/README.1st
@@ -6,14 +6,14 @@ work without Tcl/Tk libraries (e.g. libtcl8.4.so) on your environment.
You must also check that your Tcl/Tk is installed properly.
--------------------------------------------
- ( the following is written in EUC-JP )
+ ( the following is written in UTF-8 )
-Ruby/Tk (tk.rb ʤ) Ȥˤϡtcltklib.so ưƤ
-Фʤޤ󡥥ѥ˲꤬ϡREADME.tcltklib
- README.ActiveTcl 򸫤Ƥ
-Ȥ Ruby Υ饤֥ǥ쥯ȥ tcltklib.so ¸ߤƤȤ
-⡤¹ԴĶ Tcl/Tk 饤֥ (libtcl8.4.so ʤ) ʤеǽ
-Tcl/Tk 󥹥ȡ뤵Ƥ뤫åƤ
+Ruby/Tk (tk.rb など) を使いたい場合には,tcltklib.so が正しく動いていな
+ければなりません.コンパイル時に何か問題が生じた場合は,README.tcltklib
+や README.ActiveTcl を見てください.
+たとえ Ruby のライブラリディレクトリに tcltklib.so が存在していたとして
+も,実行環境に Tcl/Tk ライブラリ (libtcl8.4.so など) がなければ機能しま
+せん.Tcl/Tk が正しくインストールされているかもチェックしてください.
==========================================================
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/extconf.rb b/ext/tk/extconf.rb
index 2f68d01e7f..72dd6cf21d 100644
--- a/ext/tk/extconf.rb
+++ b/ext/tk/extconf.rb
@@ -541,7 +541,7 @@ end
def get_ext_list()
exts = [CONFIG['DLEXT']]
exts.concat %w(dll lib) if is_win32?
- exts.concat %w(bundle dylib) if is_macosx? || /nextstep|openstep|rhapsody/ =~ RUBY_PLATFORM
+ exts.concat %w(bundle dylib) if is_macosx?
if enable_config("shared") == false
[CONFIG['LIBEXT'], "a"].concat exts
@@ -1947,53 +1947,56 @@ if TkLib_Config["tcltk-framework"]
puts("Use MacOS X Frameworks.")
($LDFLAGS ||= "") << " -L#{TkLib_Config["tcl-build-dir"].quote} -Wl,-R#{TkLib_Config["tcl-build-dir"].quote}" if TkLib_Config["tcl-build-dir"]
+ libs = ''
if tcl_cfg_dir
TclConfig_Info['TCL_LIBS'] ||= ""
($INCFLAGS ||= "") << ' ' << TclConfig_Info['TCL_INCLUDE_SPEC']
- $LDFLAGS << ' ' << TclConfig_Info['TCL_LIBS']
+ libs << ' ' << TclConfig_Info['TCL_LIBS']
if stubs
if TkLib_Config["tcl-build-dir"] &&
TclConfig_Info['TCL_BUILD_STUB_LIB_SPEC'] &&
!TclConfig_Info['TCL_BUILD_STUB_LIB_SPEC'].strip.empty?
- $LDFLAGS << ' ' << TclConfig_Info['TCL_BUILD_STUB_LIB_SPEC']
+ libs << ' ' << TclConfig_Info['TCL_BUILD_STUB_LIB_SPEC']
else
- $LDFLAGS << ' ' << TclConfig_Info['TCL_STUB_LIB_SPEC']
+ libs << ' ' << TclConfig_Info['TCL_STUB_LIB_SPEC']
end
else
if TkLib_Config["tcl-build-dir"] &&
TclConfig_Info['TCL_BUILD_LIB_SPEC'] &&
!TclConfig_Info['TCL_BUILD_LIB_SPEC'].strip.empty?
- $LDFLAGS << ' ' << TclConfig_Info['TCL_BUILD_LIB_SPEC']
+ libs << ' ' << TclConfig_Info['TCL_BUILD_LIB_SPEC']
else
- $LDFLAGS << ' ' << TclConfig_Info['TCL_LIB_SPEC']
+ libs << ' ' << TclConfig_Info['TCL_LIB_SPEC']
end
end
end
- $LDFLAGS << " -L#{TkLib_Config["tk-build-dir"].quote} -Wl,-R#{TkLib_Config["tk-build-dir"].quote}" if TkLib_Config["tk-build-dir"]
+ libs << " -L#{TkLib_Config["tk-build-dir"].quote} -Wl,-R#{TkLib_Config["tk-build-dir"].quote}" if TkLib_Config["tk-build-dir"]
if tk_cfg_dir
TkConfig_Info['TK_LIBS'] ||= ""
($INCFLAGS ||= "") << ' ' << TkConfig_Info['TK_INCLUDE_SPEC']
- $LDFLAGS << ' ' << TkConfig_Info['TK_LIBS']
+ libs << ' ' << TkConfig_Info['TK_LIBS']
if stubs
if TkLib_Config["tk-build-dir"] &&
TclConfig_Info['TK_BUILD_STUB_LIB_SPEC'] &&
!TclConfig_Info['TK_BUILD_STUB_LIB_SPEC'].strip.empty?
- $LDFLAGS << ' ' << TkConfig_Info['TK_BUILD_STUB_LIB_SPEC']
+ libs << ' ' << TkConfig_Info['TK_BUILD_STUB_LIB_SPEC']
else
- $LDFLAGS << ' ' << TkConfig_Info['TK_STUB_LIB_SPEC']
+ libs << ' ' << TkConfig_Info['TK_STUB_LIB_SPEC']
end
else
if TkLib_Config["tk-build-dir"] &&
TclConfig_Info['TK_BUILD_LIB_SPEC'] &&
!TclConfig_Info['TK_BUILD_LIB_SPEC'].strip.empty?
- $LDFLAGS << ' ' << TkConfig_Info['TK_BUILD_LIB_SPEC']
+ libs << ' ' << TkConfig_Info['TK_BUILD_LIB_SPEC']
else
- $LDFLAGS << ' ' << TkConfig_Info['TK_LIB_SPEC']
+ libs << ' ' << TkConfig_Info['TK_LIB_SPEC']
end
end
end
+ $LDFLAGS << ' ' << libs
+ $libs << ' -ltk -ltcl'
setup_for_macosx_framework(tclver, tkver) if tcl_cfg_dir && tk_cfg_dir
end
diff --git a/ext/tk/lib/multi-tk.rb b/ext/tk/lib/multi-tk.rb
index b125c6e18e..68bd849670 100644
--- a/ext/tk/lib/multi-tk.rb
+++ b/ext/tk/lib/multi-tk.rb
@@ -2103,7 +2103,7 @@ end
# evaluate a procedure on the proper interpreter
class MultiTkIp
# instance & class method
- def _proc_on_safelevel(cmd=nil, &blk) # require a block for eval
+ def _proc_on_safelevel(cmd=nil) # require a block for eval
if cmd
if cmd.kind_of?(Method)
_proc_on_safelevel{|*args| cmd.call(*args)}
diff --git a/ext/tk/lib/tcltk.rb b/ext/tk/lib/tcltk.rb
index 2df3b2fd8c..48ec1df09a 100644
--- a/ext/tk/lib/tcltk.rb
+++ b/ext/tk/lib/tcltk.rb
@@ -280,7 +280,7 @@ class TclTkWidget < TclTkCommand
# interp: interpreter(TclTkInterpreter)
# parent: parent widget
- # command: widget generating tk command(label )
+ # command: widget generating tk command(label 等)
# *args: argument to the command
interp, parent, command, *args = args
diff --git a/ext/tk/lib/tk/image.rb b/ext/tk/lib/tk/image.rb
index 00bb440d6a..d2b0305dcd 100644
--- a/ext/tk/lib/tk/image.rb
+++ b/ext/tk/lib/tk/image.rb
@@ -130,7 +130,7 @@ end
# A photo is an image whose pixels can display any color or be transparent.
# At present, only GIF and PPM/PGM formats are supported, but an interface
# exists to allow additional image file formats to be added easily.
-#
+#
# This class documentation is a copy from the original Tcl/Tk at
# http://www.tcl.tk/man/tcl8.5/TkCmd/photo.htm with some rewrited parts.
class TkPhotoImage<TkImage
@@ -162,13 +162,13 @@ class TkPhotoImage<TkImage
# image = TkPhotoImage.new(:file: => 'my_image.gif')
#
# == Options
- # Photos support the following options:
+ # Photos support the following options:
# * :data
# Specifies the contents of the image as a string.
# * :format
# Specifies the name of the file format for the data.
# * :file
- # Gives the name of a file that is to be read to supply data for the image.
+ # Gives the name of a file that is to be read to supply data for the image.
# * :gamma
# Specifies that the colors allocated for displaying this image in a window
# should be corrected for a non-linear display with the specified gamma
@@ -185,7 +185,7 @@ class TkPhotoImage<TkImage
# Specifies the width of the image, in pixels. This option is useful
# primarily in situations where the user wishes to build up the contents of
# the image piece by piece. A value of zero (the default) allows the image
- # to expand or shrink horizontally to fit the data stored in it.
+ # to expand or shrink horizontally to fit the data stored in it.
def initialize(*args)
@type = 'photo'
super(*args)
@@ -193,7 +193,7 @@ class TkPhotoImage<TkImage
# Blank the image; that is, set the entire image to have no data, so it will
# be displayed as transparent, and the background of whatever window it is
- # displayed in will show through.
+ # displayed in will show through.
def blank
tk_send_without_enc('blank')
self
@@ -233,7 +233,7 @@ class TkPhotoImage<TkImage
# destination, possibly with pixel zooming and/or subsampling. If no options
# are specified, this method copies the whole of source into destination,
# starting at coordinates (0,0) in destination. The following options may be
- # specified:
+ # specified:
#
# * :from [x1, y1, x2, y2]
# Specifies a rectangular sub-region of the source image to be copied.
@@ -250,30 +250,30 @@ class TkPhotoImage<TkImage
# specified). If x2 and y2 are specified, the source region will be
# replicated if necessary to fill the destination region in a tiled fashion.
# * :shrink
- # Specifies that the size of the destination image should be reduced, if
- # necessary, so that the region being copied into is at the bottom-right
- # corner of the image. This option will not affect the width or height of
+ # Specifies that the size of the destination image should be reduced, if
+ # necessary, so that the region being copied into is at the bottom-right
+ # corner of the image. This option will not affect the width or height of
# the image if the user has specified a non-zero value for the :width or
# :height configuration option, respectively.
# * :zoom [x, y]
- # Specifies that the source region should be magnified by a factor of x
+ # Specifies that the source region should be magnified by a factor of x
# in the X direction and y in the Y direction. If y is not given, the
# default value is the same as x. With this option, each pixel in the
# source image will be expanded into a block of x x y pixels in the
# destination image, all the same color. x and y must be greater than 0.
# * :subsample [x, y]
# Specifies that the source image should be reduced in size by using only
- # every xth pixel in the X direction and yth pixel in the Y direction.
- # Negative values will cause the image to be flipped about the Y or X axes,
+ # every xth pixel in the X direction and yth pixel in the Y direction.
+ # Negative values will cause the image to be flipped about the Y or X axes,
# respectively. If y is not given, the default value is the same as x.
# * :compositingrule rule
- # Specifies how transparent pixels in the source image are combined with
+ # Specifies how transparent pixels in the source image are combined with
# the destination image. When a compositing rule of <tt>overlay</tt> is set,
# the old contents of the destination image are visible, as if the source
# image were printed on a piece of transparent film and placed over the
# top of the destination. When a compositing rule of <tt>set</tt> is set,
# the old contents of the destination image are discarded and the source
- # image is used as-is. The default compositing rule is <tt>overlay</tt>.
+ # image is used as-is. The default compositing rule is <tt>overlay</tt>.
def copy(src, *opts)
if opts.size == 0
tk_send('copy', src)
@@ -314,14 +314,14 @@ class TkPhotoImage<TkImage
# whole image.
# * :grayscale
# If this options is specified, the data will not contain color information.
- # All pixel data will be transformed into grayscale.
+ # All pixel data will be transformed into grayscale.
def data(keys={})
tk_split_list(tk_send('data', *_photo_hash_kv(keys)))
end
- # Returns the color of the pixel at coordinates (x,y) in the image as a list
+ # Returns the color of the pixel at coordinates (x,y) in the image as a list
# of three integers between 0 and 255, representing the red, green and blue
- # components respectively.
+ # components respectively.
def get(x, y)
tk_send('get', x, y).split.collect{|n| n.to_i}
end
@@ -362,13 +362,13 @@ class TkPhotoImage<TkImage
self
end
- # Returns a boolean indicating if the pixel at (x,y) is transparent.
+ # Returns a boolean indicating if the pixel at (x,y) is transparent.
def get_transparency(x, y)
bool(tk_send('transparency', 'get', x, y))
end
-
+
# Makes the pixel at (x,y) transparent if <tt>state</tt> is true, and makes
- # that pixel opaque otherwise.
+ # that pixel opaque otherwise.
def set_transparency(x, y, state)
tk_send('transparency', 'set', x, y, state)
self
diff --git a/ext/tk/lib/tk/wm.rb b/ext/tk/lib/tk/wm.rb
index b1a2ed886a..fcd5a2cbd2 100644
--- a/ext/tk/lib/tk/wm.rb
+++ b/ext/tk/lib/tk/wm.rb
@@ -83,11 +83,11 @@ module Tk
def Wm.command(win, value=nil)
if value
- tk_call('wm', 'command', epath, value)
+ tk_call('wm', 'command', win.epath, value)
win
else
- #procedure(tk_call('wm', 'command', epath))
- tk_call('wm', 'command', epath)
+ #procedure(tk_call('wm', 'command', win.epath))
+ tk_call('wm', 'command', win.epath)
end
end
def wm_command(value=nil)
diff --git a/ext/tk/old-README.tcltklib.eucj b/ext/tk/old-README.tcltklib.eucj
index 1683629fcb..e29b389402 100644
--- a/ext/tk/old-README.tcltklib.eucj
+++ b/ext/tk/old-README.tcltklib.eucj
@@ -1,159 +1,159 @@
(tof)
2003/06/19 Hidetoshi NAGAI
-ܥɥȤˤϸŤ tcltk 饤֥ꡤtcltklib 饤֥
-ޤޤƤޤεƤϸŤΤȤʤäƤޤ
+本ドキュメントには古い tcltk ライブラリ,tcltklib ライブラリの説明
+が含まれていますが,その記述内容は古いものとなっています.
-ޤߤ Ruby/Tk 濴Ǥ tk.rb wish ƤӽФϤ
-tcltklib 饤֥ wrap ưΤȤʤäƤޤ
-ᡤŤҤǽҤ٤Ƥ褦ʥץ̿ˤ륪
-إåɤ¸ߤޤ
+まず,現在の Ruby/Tk の中心である tk.rb は wish を呼び出したりはせ
+ず,tcltklib ライブラリを wrap して動作するものとなっています.その
+ため,古い説明記述で述べられているようなプロセス間通信によるオーバ
+ヘッドは存在しません.
-ߤ tcltklib 饤֥Ǥ⡤Tcl/Tk C 饤֥󥯤
-ľܤưȤǡХإåɤ򲡤Ĥ Tcl/Tk 󥿡ץ꥿
-Τۤǽʳĥ饤֥ޤˤȤƱǤ
-Ϥۤܡtk.rb ʲΥ饤֥ŪƯ뤿ΤΡ
-ȸʤƤꡤŪǥƥʥ󥹤Ƥޤ
+現在の tcltklib ライブラリでも,Tcl/Tk の C ライブラリをリンクして
+直接に動かすことで,オーバヘッドを押さえつつ Tcl/Tk インタープリタ
+のほぼ全機能(拡張ライブラリを含む)を使える点は同じです.しかし,
+その役割はほぼ「tk.rb 以下のライブラリを効果的に働かせるためのもの」
+と見なされており,その目的でメンテナンスされています.
-tk.rb ιⵡǽȼäơΥ饤֥Ǥ tcltk 饤֥
-tcltk.rbˤϤ¸߰յ򸺤ƤꡤߤǤϥƥʥ󥹤ϹԤ
-Ƥޤ
+tk.rb の高機能化に伴って,中水準のライブラリである tcltk ライブラリ
+(tcltk.rb)はその存在意義を減じており,現在ではメンテナンスは行わ
+れていません.
-ʤŤǤϥХǥ󥰤ˤ륹ץȤɲäϤǤʤ
-ȤȤʤäƤޤߤ tk.rb ǤϤǽǤ뤳Ȥ­
+なお,古い説明ではバインディングにおけるスクリプトの追加はできないこ
+ととなっていますが,現在の tk.rb ではこれも可能であることを補足して
+おきます.
-ʲ饤֥θŤʸǤ
+以下がライブラリの古い説明文書です.
==============================================================
- tcltk 饤֥
- tcltklib 饤֥
+ tcltk ライブラリ
+ tcltklib ライブラリ
Sep. 19, 1997 Y. Shigehiro
-ʲ, tcl/tkפȤɽ, tclsh wish ¸Ƥ, ̤Ǥ
-Ȥ tcl/tk ؤޤ. tcltk 饤֥, tcltklib 饤֥
-פȤɽ, ܥѥå˴ޤޤ ruby ѤΥ饤֥ؤޤ.
+以下, 「tcl/tk」という表記は, tclsh や wish を実現している, 一般でいう
+ところの tcl/tk を指します. 「tcltk ライブラリ」, 「tcltklib ライブラ
+リ」という表記は, 本パッケージに含まれる ruby 用のライブラリを指します.
-[եˤĤ]
+[ファイルについて]
-README.euc : Υե(, ħ, 󥹥ȡˡ).
-MANUAL.euc : ޥ˥奢.
+README.euc : このファイル(注意, 特徴, インストールの方法).
+MANUAL.euc : マニュアル.
-lib/, ext/ : 饤֥μ.
+lib/, ext/ : ライブラリの実体.
-sample/ : ޥ˥奢Υץץ.
-sample/sample0.rb : tcltklib 饤֥Υƥ.
-sample/sample1.rb : tcltk 饤֥Υƥ.
- tcl/tk (wish) ǤǤʤȤ̤񤤤Ƥߤޤ.
-sample/sample2.rb : tcltk 饤֥Υץ.
- maeda shugo (shugo@po.aianet.ne.jp) ˤ
- (`rb.tk' ǽ񤫤Ƥ) ruby Υץץ
+sample/ : マニュアル代わりのサンプルプログラム.
+sample/sample0.rb : tcltklib ライブラリのテスト.
+sample/sample1.rb : tcltk ライブラリのテスト.
+ tcl/tk (wish) でできそうなことを一通り書いてみました.
+sample/sample2.rb : tcltk ライブラリのサンプル.
+ maeda shugo (shugo@po.aianet.ne.jp) 氏による
+ (`rb.tk' で書かれていた) ruby のサンプルプログラム
http://www.aianet.or.jp/~shugo/ruby/othello.rb.gz
- tcltk 饤֥Ȥ褦, ŪѹƤߤޤ.
+ を tcltk ライブラリを使うように, 機械的に変更してみました.
-demo/ : 100 ܤ 100 ǥץ.
- ǽ˶롼פλ֤¬ꤷ, ³Ƽºݤ֤¬ꤷޤ.
- tcl/tk ()ΤȤ backing store Ȥ鷺Χ 10000 (?)
- Τ, ()Ϥ, ޥ󤬤ʤŤʤޤ.
-demo/lines0.tcl : wish ѤΥץ.
-demo/lines1.rb : `tk.rb' ѤΥץ.
-demo/lines2.rb : tcltk 饤֥ѤΥץ.
+demo/ : 100 本の線を 100 回描くデモプログラム.
+ 最初に空ループの時間を測定し, 続いて実際に線を引く時間を測定します.
+ tcl/tk は(再)描画のときに backing store を使わずに律義に 10000 本(?)
+ 線を引くので, (再)描画を始めると, マシンがかなり重くなります.
+demo/lines0.tcl : wish 用のスクリプト.
+demo/lines1.rb : `tk.rb' 用のスクリプト.
+demo/lines2.rb : tcltk ライブラリ用のスクリプト.
-[]
+[注意]
-ѥ/¹Ԥˤ, tcl/tk C 饤֥꤬ɬפǤ.
+コンパイル/実行には, tcl/tk の C ライブラリが必要です.
-Υ饤֥,
+このライブラリは,
ruby-1.0-970701, ruby-1.0-970911, ruby-1.0-970919
FreeBSD 2.2.2-RELEASE
- ӤΥѥå jp-tcl-7.6.tgz, jp-tk-4.2.tgz
+ およびそのパッケージ jp-tcl-7.6.tgz, jp-tk-4.2.tgz
-Ǻ/ưǧޤ. ¾δĶǤư뤫ɤ狼ޤ.
+で作成/動作確認しました. 他の環境では動作するかどうかわかりません.
-TclTkLib.mainloop ¹ Control-C ʤΤؤʤΤ, ruby
-Υ򻲹ͤ, #include "sig.h" trap_immediate Ƥ
-, ruby README.EXT ˤ񤤤ƤʤΤ, ʤȤ򤷤ɤΤ
-ɤ狼ޤ.
+TclTkLib.mainloop を実行中に Control-C が効かないのは不便なので, ruby
+のソースを参考に, #include "sig.h" して trap_immediate を操作していま
+すが, ruby の README.EXT にも書いてないのに, こんなことをして良いのか
+どうかわかりません.
--d ץǥǥХåɽ뤿, ruby Υ򻲹ͤ,
-debug Ȥѿ򻲾ȤƤޤ, ruby README.EXT ˤ񤤤
-ʤΤ, ʤȤ򤷤ɤΤɤ狼ޤ.
+-d オプションでデバッグ情報を表示させるために, ruby のソースを参考に,
+debug という大域変数を参照していますが, ruby の README.EXT にも書いて
+ないのに, こんなことをして良いのかどうかわかりません.
-extconf.rb Ͻ񤭤ޤ, (ʰ̣)ɤΤɤʬ
-ޤ.
+extconf.rb は書きましたが, (いろいろな意味で)これで良いのか良く分かり
+ません.
-[ħ]
+[特徴]
-ruby tcl/tk 饤֥ѤǤޤ.
+ruby から tcl/tk ライブラリを利用できます.
-tcl/tk 󥿥ץ꥿ΥץȤ, Ū tcltk 饤֥Ѥ ruby
-ץȤѴǤޤ.
+tcl/tk インタプリタのスクリプトは, 機械的に tcltk ライブラリ用の ruby
+スクリプトに変換できます.
-(`tk.rb' Ȥΰ㤤)
+(`tk.rb' との違い)
-1. tcl/tk 󥿥ץ꥿ΥץȤ, ɤΤ褦, tcltk 饤֥Ѥ
- ruby ץȤѴ뤫Ǥ, ޥ˥奢ब̵
- `tk.rb' Ȥϰۤʤ
+1. tcl/tk インタプリタのスクリプトが, どのように, tcltk ライブラリ用の
+ ruby スクリプトに変換されるかが理解できれば, マニュアル類が無いに等
+ しい `tk.rb' とは異なり
- tcl/tk Υޥ˥奢䥪饤ɥȤѤ
+ tcl/tk のマニュアルやオンラインドキュメントを用いて
- Ψɤץߥ󥰤ԤȤǤޤ.
- ˡ狼ʤ, ޥɤͿѥ᡼狼ʤ...
- - Canvas.new { ... } , ʤƥ졼֥å񤱤??
- - Canvas bbox ϿͤΥꥹȤ֤Τ, xview ʸ֤??
- , , 饤֥ΥɤɬפϤޤ.
+ 効率良くプログラミングを行うことができます.
+ 記述方法がわからない, コマンドに与えるパラメータがわからない...
+ - Canvas.new { ... } と, なぜイテレータブロックを書けるの??
+ - Canvas の bbox は数値のリストを返すのに, xview は文字列を返すの??
+ と, いちいち, ライブラリのソースを追いかける必要はありません.
-2. ġεǽ(ץ)̽ˤꥵݡȤƤ, Τ᥵
- ݡȤƤʤǽϻȤȤǤʤ(ϻȤʤȤʤ
- Ǥ) `tk.rb' Ȥϰۤʤ, tcl/tk 󥿥ץ꥿DzǽʤȤ
+2. 個々の機能(オプション)を個別処理によりサポートしており, そのためサ
+ ポートしていない機能は使うことができない(本当は使えないこともないの
+ ですが) `tk.rb' とは異なり, tcl/tk インタプリタで可能なことは
- ۤȤ
+ ほとんど
- ruby ¹ԤǤޤ. , ruby ¹ԤǤʤȤǧ
- ƤΤ,
+ ruby からも実行できます. 現在, ruby から実行できないことが確認され
+ ているのは,
- bind ޥɤǥץȤɲä빽ʸ
- bind tag sequence +script
+ bind コマンドでスクリプトを追加する構文
+ 「bind tag sequence +script」
^
- ΤߤǤ.
- - `. configure -width' 򤷤褦Ȥ, `Tk.root.height()' Ƚ
- Τ, `undefined method `height'' ܤƤޤä. tk.rb
- ɤǤߤ, . ǤʤΤ...
- ȤȤϤޤ.
+ のみです.
+ - `. configure -width' をしようとして, `Tk.root.height()' と書い
+ たのに, `undefined method `height'' と怒られてしまった. tk.rb を
+ 読んでみて, ガーン. できないのか...
+ ということはありません.
-3. wish ץưץ̿ wish Ѥ `tk.rb' Ȥ
- ۤʤ, tcl/tk C 饤֥󥯤
+3. wish プロセスを起動しプロセス間通信で wish を利用する `tk.rb' とは
+ 異なり, tcl/tk の C ライブラリをリンクし
- ® (ȤäƤ, פä®ʤǤ)
+ より高速に (といっても, 思った程は速くないですが)
- Ԥޤ.
+ 処理を行います.
-4. `tk.rb' ۤ, ʥ󥿡եƤʤ, tcl/tk
- 󥿥ץ꥿
+4. `tk.rb' ほど, 高水準なインターフェースを備えていないため, tcl/tk イ
+ ンタプリタの生成等
- 鲿ޤǼʬǵ
+ 何から何まで自分で記述
- ʤФʤޤ(, tcl/tk 饤֥λ̤,
- tcl/tk 󥿥ץ꥿ʣ뤳ȤǤޤ).
- 󥿡ե(餯) ruby λۤ˱äΤǤϤޤ.
- ޤ, ץȤεҤ
+ しなければなりません(その代わり, tcl/tk ライブラリの仕様通り,
+ tcl/tk インタプリタを複数生成することもできますが).
+ インターフェースは(おそらく) ruby の思想に沿ったものではありません.
+ また, スクリプトの記述は
-
+ ダサダサ
- Ǥ. ץȤ, 츫, ɤߤŤ餤ΤȤʤޤ. , 񤯿ͤˤȤ
- Ƥ, ۤѤ路ΤǤϤʤȻפޤ.
+ です. スクリプトは, 一見, 読みづらいものとなります. が, 書く人にとっ
+ ては, それほど煩わしいものではないと思います.
-[󥹥ȡˡ]
+[インストールの方法]
-0. ruby Υե(ruby-1.0-ʤ󤿤.tgz)ŸƤޤ.
+0. ruby のソースファイル(ruby-1.0-なんたら.tgz)を展開しておきます.
-1. ruby-1.0-ʤ󤿤/ext ext/tcltklib 򥳥ԡޤ.
- cp -r ext/tcltklib ???/ruby-1.0-ʤ󤿤/ext/
+1. ruby-1.0-なんたら/ext に ext/tcltklib をコピーします.
+ cp -r ext/tcltklib ???/ruby-1.0-なんたら/ext/
-2. ruby Υ󥹥ȡˡ˽ make 򤷤ޤ.
+2. ruby のインストール法に従い make 等をします.
-3. ruby Υ饤֥־ lib/* 򥳥ԡޤ.
+3. ruby のライブラリ置場に lib/* をコピーします.
cp lib/* /usr/local/lib/ruby/
(eof)
diff --git a/ext/tk/sample/demos-en/README b/ext/tk/sample/demos-en/README
index a6ea4fae8c..033dca33c6 100644
--- a/ext/tk/sample/demos-en/README
+++ b/ext/tk/sample/demos-en/README
@@ -68,71 +68,71 @@ Notes:
Ruby/Tk81 widget-demo 1999/08/13
- Φüʳظ
- Ω <ttate@jaist.ac.jp>
+ 北陸先端大情報科学研究科
+ 立石 <ttate@jaist.ac.jp>
-Tcl/Tk8.1Ǥunicode(UTF8)Ѥ졢unicodeѴ줿ܸǤ
-Widgetɽ뤳ȤǽǤܥ֤ˤϰ˱ʰ椵濴
-ʤƺ줿Ruby/TkΥץ˽äʲδĶˤƤư
-ǧΤǤ
+Tcl/Tk8.1ではunicode(UTF8)が採用され、unicodeに変換された日本語であれば
+Widgetに表示させることが可能です。本アーカイブには以前に永井さんが中心と
+なられて作成されたRuby/Tkのサンプルに修正を加え、以下の環境においてで動作
+を確認したものです。
* ruby-1.3.7,ruby-1.4.0
* tcl8.1, tk8.1
* linux-2.2
-Windows(Cygwin)ˤơץưˤruby-KeȤץ
-ƵưɤǤ
- 󶡡դ
+Windows(Cygwin)において、サンプルを動かすにはrubyを-Keというオプションを付
+けて起動させると良いそうです。
+ 情報提供:渡辺さん
<eban@os.rim.or.jp>
----------------------------------------------------------------------------
Ruby/Tk widget-demo
version 1.1 ( 1998/07/24 )
- ʰǽ幩 (nagai@ai.kyutech.ac.jp)
-
-ɸۤ Tcl/Tk ĥѥå Ruby (ʲ Ruby/Tk ȸƤӤޤ)
-ǤϡTk widget Ѥ GUI κԤȤǤޤºݤ GUI
-Ƥˤ͡ʼ㤬ץȤ¸ߤʤΤǤRuby/Tk
-ˤϤΤ褦Ŭʥץ륹ץȽ¸ߤޤǤФ
-ĥѥåθǤ Tcl/Tk ˤϡTk widget ѤƤɤΤ褦ʤȤ
-뤫򼨤ΤȤ widget-demo ¸ߤꡤTcl/Tk Ѥ GUI κ
-ݤɽŪץȤʤäƤޤܥ֤ϡRuby/Tk ν
-ɽŪʥץ륹ץȤȤ٤Tcl/Tk widget-demo ܿ
-ΤǤ
-
-ܥ֤˴ޤޤ륹ץȤ¹Ԥ뤿ˤϡruby-1.1c2 ʾǤ뤳
-ȤɬפǤ1.1c1 ξϡܥ֤˴ޤޤ patck_1.1c1 Ruby
-饤֥ˤƤƤȤ߹ Tk ΥСϡ4.2 Ǥ 8.0 Ǥ⽤
-ʤưϤǤܸǤǤΰܿȤʤäƤ뤿ᡤܸ첽
-줿 Tk ѤץȤΥƥȤϡTk4.2jp Tk8.0jp ξǹ
-ޤ (ˤǤϤʤǤ)
-
-ܥ֤˴ޤޤ륹ץȤ¿ϡȤʤäƤ Tcl/Tk ǤŪ
-ץȵҤȤʤ褦ˤƤޤΤᡤRuby/Tk Υץȸ
-ϡޤ Ruby 餷ʤȤǤ礦ˤ⤫餺Τ褦ʵ
-äƤͳϡRuby/Tk Υɥ­ˤޤ
-
-Tcl/Tk ˤŬʻͽ񤬲¸ߤƤޤ顤Ruby/Tk ץȤ
-ݤϡΤ褦 Tcl/Tk λͽǾ䤤ʤ뤳ȤˤʤȻ
-ޤ widget λȤơTcl/Tk widget-demo 򻲾Ȥ뤳Ȥ⤢
-Ǥ礦Ruby/Tk ǤεҤ widget-demo Tcl/Tk ǤεҤ˶ᤤΤˤ
-СˤäơRuby/Tk 뤳ȤǤȹͤޤ
-ö Ruby/Tk Ǥ widget λˡƤޤСRuby 餷
-ץȤ뤳Ȥ񤷤ʤǤ礦ܥ֤ΥץȤϡRuby/Tk
-ǽ˽ޤǤƧȤѤƤйǤ
-
-widget-demo ΰܿˤäƤϡˤܿץȤ󶡤Ƥ
-ޤ˴դΰդɽޤ
-
- ΩСJAIST (ttate@jaist.ac.jp)
- ʿͻ (hiramatu@cdrom.co.jp)
-
-ʿˤ Ruby/Tk Web page (http://www.cdrom.co.jp/~hiramatu/)
- Ruby/Tk νͭѤȻפޤΤǡҤȤ
-
-ޤ (maebashi@iij.ad.jp) ϤȤơwidget-demo ΰܿ˺ݤ
-ɬפȤʤä Ruby Tk Ϣ饤֥꽤ˤĤơХλŦ
-Ƥˤⴶפޤ
-
-ƺǸ˺δդ Ruby ߷׼Ԥ ޤĤ 椭Ҥ (matz@netlab.co.jp)
-Ȼפޤ
+ 永井@知能.九工大 (nagai@ai.kyutech.ac.jp)
+
+標準配布の Tcl/Tk 拡張パッケージを取り込んだ Ruby (以下 Ruby/Tk と呼びます)
+では,Tk widget を用いた GUI の作成を行うことができます.実際に GUI を作成
+していく場合には様々な実例がサンプルとして存在すると便利なのですが,Ruby/Tk
+にはそのような適当なサンプルスクリプト集合は存在しませんでした.それに対し,
+拡張パッケージの元である Tcl/Tk には,Tk widget を用いてどのようなことがで
+きるかを示すものとして widget-demo が存在しおり,Tcl/Tk を用いた GUI の作成
+を習得する際の代表的サンプルとなっています.本アーカイブは,Ruby/Tk の習得の
+ための代表的なサンプルスクリプトとすべく,Tcl/Tk の widget-demo を移植したも
+のです.
+
+本アーカイブに含まれるスクリプトを実行するためには,ruby-1.1c2 以上であるこ
+とが必要です.1.1c1 の場合は,本アーカイブに含まれる patck_1.1c1 を Ruby の
+ライブラリにあててください.組み込む Tk のバージョンは,4.2 でも 8.0 でも修
+正なく動かせるはずです.ただし,日本語版での移植となっているため,日本語化さ
+れた Tk をご利用ください.スクリプトのテストは,Tk4.2jp と Tk8.0jp の上で行
+いました (完璧にではないですが).
+
+本アーカイブに含まれるスクリプトの多くは,元となっている Tcl/Tk 版に比較的近
+いスクリプト記述となるようにしています.そのため,Ruby/Tk のサンプルと言うに
+は,あまり Ruby らしくないとも言えるでしょう.にもかかわらず,そのような記述
+を取っている理由は,Ruby/Tk のドキュメント不足にあります.
+
+Tcl/Tk には適当な参考書が何冊か存在していますから,Ruby/Tk スクリプトを作成
+する際は,そのような Tcl/Tk の参考書で情報を補いながら作成することになると思
+います.各 widget の使用例として,Tcl/Tk の widget-demo を参照することもある
+でしょう.Ruby/Tk 版の記述を widget-demo を Tcl/Tk 版の記述に近いものにして
+おけば,その対比によって,Ruby/Tk の理解を早めることができると考えられます.
+一旦 Ruby/Tk での 各 widget の使用方法を習得してしまえば,Ruby らしいスクリ
+プトを作成することは難しくないでしょう.本アーカイブのスクリプトは,Ruby/Tk
+を最初に習得するまでの踏台として利用していただければ幸いです.
+
+widget-demo の移植にあたっては,次の方にも移植したスクリプトを提供していただ
+きました.ここに感謝の意を表します.
+
+ 立石@JAIST (ttate@jaist.ac.jp) さん
+ 平松祥史 (hiramatu@cdrom.co.jp) さん
+
+平松さんによる Ruby/Tk 入門の Web page (http://www.cdrom.co.jp/~hiramatu/)
+も Ruby/Tk の習得に有用と思えますので,ぜひご参照ください.
+
+また,前橋 (maebashi@iij.ad.jp) さんをはじめとして,widget-demo の移植に際し
+て必要となった Ruby の Tk 関連ライブラリ修正について,問題点,バグの指摘をし
+ていただいた方々にも感謝致します.
+
+そして最後に最大の感謝を Ruby 設計者の まつもと ゆきひろ (matz@netlab.co.jp)
+さんに捧げたいと思います.
diff --git a/ext/tk/sample/demos-en/README.tkencoding b/ext/tk/sample/demos-en/README.tkencoding
index 679b476a08..cca8734a28 100644
--- a/ext/tk/sample/demos-en/README.tkencoding
+++ b/ext/tk/sample/demos-en/README.tkencoding
@@ -3,27 +3,27 @@ The library 'tkencoding.rb' is obsolete.
Functions of tkencoding.rb is already included into Ruby/Tk.
-------------------------------------------------
-tkencoding.rbѤܸɽˤĤ
+tkencoding.rbを用いた日本語の表示について
Copyright (C) 1999/07, Takaaki Tateishi <ttate@jaist.ac.jp>
-1. tkencoding.rbȤϡ
+1. tkencoding.rbとは?
-tkencoding.rbTcl/Tk8.1ѤRuby/TkΤΥ饤֥
-Ǥtkencoding.rbrequire뤳ȤˤäWedgetɽ
-ƥȤunicode(UTF8)Ѵޤ
+tkencoding.rbはTcl/Tk8.1を利用したRuby/Tkのためのライブラリ
+です。tkencoding.rbをrequireすることによってWedgetに表示さ
+れるテキストは全てunicode(UTF8)へ変換されます。
-2. Ȥ
+2. 使い方
-tkencoding.rbrequireTk.encodingǻѤƤʸ
-ꤷƲ㤨аʲΤ褦ʴˤʤޤ
+tkencoding.rbをrequireしてTk.encodingで使用している文字コード
+を指定して下さい。例えば以下のような感じになります。
----
require 'tk'
require 'tkencoding'
-Tk.encoding = "euc-jp"
+Tk.encoding = "utf-8"
# Tk.encoding = "shiftjis"
---
diff --git a/ext/tk/sample/demos-en/widget b/ext/tk/sample/demos-en/widget
index e6510c7e45..21dd41685f 100644
--- a/ext/tk/sample/demos-en/widget
+++ b/ext/tk/sample/demos-en/widget
@@ -627,7 +627,7 @@ class Object
end
class Proc
- def initialize(*args, &b)
+ def initialize(*args)
super
@__pseudo_toplevel__ = Thread.current[:TOPLEVEL]
end
diff --git a/ext/tk/sample/demos-jp/README b/ext/tk/sample/demos-jp/README
index 6375800232..4278124659 100644
--- a/ext/tk/sample/demos-jp/README
+++ b/ext/tk/sample/demos-jp/README
@@ -1,54 +1,54 @@
Ruby/Tk widget-demo
version 1.2 ( 2000/04/08 )
- ʰǽ幩 (nagai@ai.kyutech.ac.jp)
-
-ɸۤ Tcl/Tk ĥѥå Ruby (ʲ Ruby/Tk ȸƤӤޤ)
-ǤϡTk widget Ѥ GUI κԤȤǤޤºݤ GUI
-Ƥˤ͡ʼ㤬ץȤ¸ߤʤΤǤRuby/Tk
-ˤϤΤ褦Ŭʥץ륹ץȽ¸ߤޤǤФ
-ĥѥåθǤ Tcl/Tk ˤϡTk widget ѤƤɤΤ褦ʤȤ
-뤫򼨤ΤȤ widget-demo ¸ߤꡤTcl/Tk Ѥ GUI κ
-ݤɽŪץȤʤäƤޤܥ֤ϡRuby/Tk ν
-ɽŪʥץ륹ץȤȤ٤Tcl/Tk widget-demo ܿ
-ΤǤ
-
-ΥС ruby-1.4.x бȤƤޤС٤ơ
-ۤȤѹϤޤruby-1.1c2 ʾʤưȻפޤruby-1.5.x ˤ
-ƤϥƥȤƤޤ󡥤ΤᡤߴαƶФ뤳Ȥ뤫⤷ޤ
-󤬡ξǤ⾯νưȻפޤȤ߹ Tk ΥСϡ
-4.2 Ǥ 8.0 Ǥ⽤ʤưϤǤܸǤǤΰܿȤʤä
-뤿ᡤܸ첽줿 Tk ѤץȤΥƥȤϡС
-κݤ Tk4.2jp Tk8.0jp ξǹԤäƤޤ (ˤǤϤʤǤ)
-ΥСǤ ruby-1.4.x + Tk8.0jp ǤδñʥƥȤԤäƤޤ󤬡
-ȤۤɤνϤƤޤΤϤʤȹͤƤޤ
-
-ܥ֤˴ޤޤ륹ץȤ¿ϡȤʤäƤ Tcl/Tk ǤŪ
-ץȵҤȤʤ褦ˤƤޤΤᡤRuby/Tk Υץȸ
-ϡޤ Ruby 餷ʤȤǤ礦ˤ⤫餺Τ褦ʵ
-äƤͳϡRuby/Tk Υɥ­ˤޤ
-
-Tcl/Tk ˤŬʻͽ񤬲¸ߤƤޤ顤Ruby/Tk ץȤ
-ݤϡΤ褦 Tcl/Tk λͽǾ䤤ʤ뤳ȤˤʤȻ
-ޤ widget λȤơTcl/Tk widget-demo 򻲾Ȥ뤳Ȥ⤢
-Ǥ礦Ruby/Tk ǤεҤ widget-demo Tcl/Tk ǤεҤ˶ᤤΤˤ
-СˤäơRuby/Tk 뤳ȤǤȹͤޤ
-ö Ruby/Tk Ǥ widget λˡƤޤСRuby 餷
-ץȤ뤳Ȥ񤷤ʤǤ礦ܥ֤ΥץȤϡRuby/Tk
-ǽ˽ޤǤƧȤѤƤйǤ
-
-widget-demo ΰܿˤäƤϡˤܿץȤ󶡤Ƥ
-ޤ˴դΰդɽޤ
-
- ΩСJAIST (ttate@jaist.ac.jp)
- ʿͻ (hiramatu@cdrom.co.jp)
-
-ʿˤ Ruby/Tk Web page (http://www.cdrom.co.jp/~hiramatu/)
- Ruby/Tk νͭѤȻפޤΤǡҤȤ
-
-ޤ (maebashi@iij.ad.jp) ϤȤơwidget-demo ΰܿ˺ݤ
-ɬפȤʤä Ruby Tk Ϣ饤֥꽤ˤĤơХλŦ
-Ƥˤⴶפޤ
-
-ƺǸ˺δդ Ruby ߷׼Ԥ ޤĤ 椭Ҥ (matz@netlab.co.jp)
-Ȼפޤ
+ 永井@知能.九工大 (nagai@ai.kyutech.ac.jp)
+
+標準配布の Tcl/Tk 拡張パッケージを取り込んだ Ruby (以下 Ruby/Tk と呼びます)
+では,Tk widget を用いた GUI の作成を行うことができます.実際に GUI を作成
+していく場合には様々な実例がサンプルとして存在すると便利なのですが,Ruby/Tk
+にはそのような適当なサンプルスクリプト集合は存在しませんでした.それに対し,
+拡張パッケージの元である Tcl/Tk には,Tk widget を用いてどのようなことがで
+きるかを示すものとして widget-demo が存在しおり,Tcl/Tk を用いた GUI の作成
+を習得する際の代表的サンプルとなっています.本アーカイブは,Ruby/Tk の習得の
+ための代表的なサンプルスクリプトとすべく,Tcl/Tk の widget-demo を移植したも
+のです.
+
+今回のバージョンは ruby-1.4.x に対応としておきますが,旧バージョンに比べて,
+ほとんど変更はありません.ruby-1.1c2 以上なら動くと思います.ruby-1.5.x につ
+いてはテストしていません.そのため,非互換の影響が出ることがあるかもしれませ
+んが,その場合でも少しの修正で動かせると思います.組み込む Tk のバージョンは,
+4.2 でも 8.0 でも修正なく動かせるはずです.ただし,日本語版での移植となって
+いるため,日本語化された Tk をご利用ください.スクリプトのテストは,旧バージョ
+ンの際に Tk4.2jp と Tk8.0jp の上で行っています (完璧にではないですが).今回
+のバージョンでは ruby-1.4.x + Tk8.0jp 上での簡単なテストしか行っていませんが,
+修正というほどの修正はしていませんので問題はないと考えています.
+
+本アーカイブに含まれるスクリプトの多くは,元となっている Tcl/Tk 版に比較的近
+いスクリプト記述となるようにしています.そのため,Ruby/Tk のサンプルと言うに
+は,あまり Ruby らしくないとも言えるでしょう.にもかかわらず,そのような記述
+を取っている理由は,Ruby/Tk のドキュメント不足にあります.
+
+Tcl/Tk には適当な参考書が何冊か存在していますから,Ruby/Tk スクリプトを作成
+する際は,そのような Tcl/Tk の参考書で情報を補いながら作成することになると思
+います.各 widget の使用例として,Tcl/Tk の widget-demo を参照することもある
+でしょう.Ruby/Tk 版の記述を widget-demo を Tcl/Tk 版の記述に近いものにして
+おけば,その対比によって,Ruby/Tk の理解を早めることができると考えられます.
+一旦 Ruby/Tk での 各 widget の使用方法を習得してしまえば,Ruby らしいスクリ
+プトを作成することは難しくないでしょう.本アーカイブのスクリプトは,Ruby/Tk
+を最初に習得するまでの踏台として利用していただければ幸いです.
+
+widget-demo の移植にあたっては,次の方にも移植したスクリプトを提供していただ
+きました.ここに感謝の意を表します.
+
+ 立石@JAIST (ttate@jaist.ac.jp) さん
+ 平松祥史 (hiramatu@cdrom.co.jp) さん
+
+平松さんによる Ruby/Tk 入門の Web page (http://www.cdrom.co.jp/~hiramatu/)
+も Ruby/Tk の習得に有用と思えますので,ぜひご参照ください.
+
+また,前橋 (maebashi@iij.ad.jp) さんをはじめとして,widget-demo の移植に際し
+て必要となった Ruby の Tk 関連ライブラリ修正について,問題点,バグの指摘をし
+ていただいた方々にも感謝致します.
+
+そして最後に最大の感謝を Ruby 設計者の まつもと ゆきひろ (matz@netlab.co.jp)
+さんに捧げたいと思います.
diff --git a/ext/tk/sample/demos-jp/README.1st b/ext/tk/sample/demos-jp/README.1st
index 60b278d7b6..68caf8b14d 100644
--- a/ext/tk/sample/demos-jp/README.1st
+++ b/ext/tk/sample/demos-jp/README.1st
@@ -1,20 +1,20 @@
-Υǥ쥯ȥˤ Ruby/Tk Υǥ⥹ץȤƤޤ
+このディレクトリには Ruby/Tk のデモスクリプトが収められています.
-'.rb' ȤĥҤäƤեϡ㨡ץȤ
- 'widget' ƤӽФ륵֥ץȤǤ줾Ω
-ưޤ'widget' ץȤƤӽФƤ
+'.rb' という拡張子を持っているファイルは,ランチャ─スクリプトで
+ある 'widget' から呼び出されるサブスクリプトです.それぞれ独立に
+は動きません.'widget' スクリプトから呼び出してください.
-⤷㨡ץ 'widget' εưƱˤĤΥ֥
-ץȤưСΥ֥ץȤ̾ȤͿ
-( : /usr/local/bin/ruby widget button.rb entry1.rb text.rb )
-֥ץȤγĥ '.rb' Ͼά뤳ȤǤޤ
-( : /usr/local/bin/ruby widget button entry1 text )
+もしランチャ─スクリプト 'widget' の起動と同時にいくつかのサブス
+クリプトを起動したければ,そのサブスクリプトの名前を引数として与
+えてください.
+( 例: /usr/local/bin/ruby widget button.rb entry1.rb text.rb )
+サブスクリプトの拡張子 '.rb' は省略することもできます.
+( 例: /usr/local/bin/ruby widget button entry1 text )
-⤷㨡ץȤΥɥɬפʤˤϡ'-n'
-ץͿƤ
-( : /usr/local/bin/ruby widget -n button.rb entry1.rb text.rb )
+もしランチャ─スクリプトのウィンドウが必要ない場合には,'-n' オ
+プションを与えてください.
+( 例: /usr/local/bin/ruby widget -n button.rb entry1.rb text.rb )
-¾Υե (browse1 hello ʤ) ñȤưȤǽǤ
+他のファイル (browse1 や hello など) は単独で動かすことが可能です.
2004/04/14 Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/sample/demos-jp/anilabel.rb b/ext/tk/sample/demos-jp/anilabel.rb
index d2f5b12041..c882f43f7e 100644
--- a/ext/tk/sample/demos-jp/anilabel.rb
+++ b/ext/tk/sample/demos-jp/anilabel.rb
@@ -1,16 +1,16 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# animated label widget demo (called by 'widget')
#
# based on Tcl/Tk8.5a2 widget demos
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($anilabel_demo) && $anilabel_demo
$anilabel_demo.destroy
$anilabel_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$anilabel_demo = TkToplevel.new {|w|
title("Animated Label Demonstration")
iconname("anilabel")
@@ -19,20 +19,20 @@ $anilabel_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($anilabel_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label 生成
msg = TkLabel.new(base_frame) {
font $font
wraplength '4i'
justify 'left'
- text "ˤ4ĤΥ˥᡼٥뤬ɽƤޤ¦ˤ٥ϡΥƥȥå򥹥뤷褦˸뤳ȤưդƤޤ¦Υ٥ϡɽ륤᡼Ѳ뤳ȤưͿƤޤ"
+ text "下には4つのアニメーションラベルが表示されています。左側にあるラベルは、内部のテキストメッセージをスクロールしたように見せることで動きを付けています。右側のラベルは、表示するイメージを変化させることで動きを与えています。"
}
msg.pack('side'=>'top')
-# frame
+# frame 生成
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $anilabel_demo
$anilabel_demo = nil
@@ -41,13 +41,13 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'anilabel'}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# label demo ѥե졼
+# label demo 用フレーム生成
f_left = TkLabelFrame.new(base_frame, :text=>'Scrolling Texts')
f_right = TkLabelFrame.new(base_frame, :text=>'GIF Image')
Tk.pack(f_left, f_right, 'side'=>'left', 'expand'=>'yes', 'fill'=>'both',
@@ -123,7 +123,7 @@ class AnimatedImageLabel < AnimatedTextLabel
private :_animation_callback
end
-# label
+# label 生成
l1 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:ridge,
:font=>{:family=>'Courier', :size=>10})
l2 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:groove,
diff --git a/ext/tk/sample/demos-jp/aniwave.rb b/ext/tk/sample/demos-jp/aniwave.rb
index 973c1be1e9..866316c331 100644
--- a/ext/tk/sample/demos-jp/aniwave.rb
+++ b/ext/tk/sample/demos-jp/aniwave.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# animated wave demo (called by 'widget')
#
@@ -24,15 +24,15 @@ msg = TkLabel.new(base_frame) {
font $font
wraplength '4i'
justify 'left'
- text 'ΥǥǤϡ饤󥢥ƥबĤ줿ХåȤɽƤޤ˥᡼ϡΥ饤󥢥ƥκɸͤѹ뤳ȤǼ¸Ƥޤ'
+ text 'このデモでは、ラインアイテムが一つだけ描かれたキャンバスウィジェットが表示されています。アニメーション処理は、そのラインアイテムの座標値を変更することで実現しています。'
}
msg.pack('side'=>'top')
# create frame
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $aniwave_demo
$aniwave_demo = nil
@@ -41,7 +41,7 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'aniwave'}
}.pack('side'=>'left', 'expand'=>'yes')
diff --git a/ext/tk/sample/demos-jp/arrow.rb b/ext/tk/sample/demos-jp/arrow.rb
index a1694d019d..2995f96d54 100644
--- a/ext/tk/sample/demos-jp/arrow.rb
+++ b/ext/tk/sample/demos-jp/arrow.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# arrowhead widget demo (called by 'widget')
#
@@ -91,13 +91,13 @@ def arrowSetup(c)
v.count += 1
end
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($arrow_demo) && $arrow_demo
$arrow_demo.destroy
$arrow_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$arrow_demo = TkToplevel.new {|w|
title("Arrowhead Editor Demonstration")
iconname("arrow")
@@ -106,17 +106,17 @@ $arrow_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($arrow_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label 生成
TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left',
- 'text'=>" widget ǡХǻȤ饤ˤĤ͡ƬηƤߤ뤳ȤǤޤηѤˤϡ礵줿ˤĤƤ 3ĤλͳѤɥåƤ¦̤礭ǤΥץ򼨤ƤޤΥƥȤϥ饤󥢥ƥФꥪץǤ"){
+ 'text'=>"この widget で、キャンバスで使われるラインについて様々な幅や矢印の頭の形を試してみることができます。線の幅や矢印の形を変えるには、拡大された矢印についている 3つの四角をドラッグしてください。右側の矢印は普通の大きさでのサンプルを示しています。下のテキストはラインアイテムに対する設定オプションです。"){
pack('side'=>'top')
}
-# frame
+# frame 生成
$arrow_buttons = TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $arrow_demo
$arrow_demo = nil
@@ -125,18 +125,18 @@ $arrow_buttons = TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'arrow'}
}.pack('side'=>'left', 'expand'=>'yes')
}
$arrow_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# canvas
+# canvas 設定
$arrow_canvas = TkCanvas.new(base_frame, 'width'=>500, 'height'=>350,
'relief'=>'sunken', 'borderwidth'=>2)
$arrow_canvas.pack('expand'=>'yes', 'fill'=>'both')
-#
+# 値設定
unless Struct.const_defined?("ArrowInfo")
$demo_arrowInfo = Struct.new("ArrowInfo", :a, :b, :c, :width, :motionProc,
:x1, :x2, :y, :smallTips, :count,
diff --git a/ext/tk/sample/demos-jp/bind.rb b/ext/tk/sample/demos-jp/bind.rb
index 99e5c1718c..efba6e6c01 100644
--- a/ext/tk/sample/demos-jp/bind.rb
+++ b/ext/tk/sample/demos-jp/bind.rb
@@ -1,15 +1,15 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# text (tag bindings) widget demo (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($bind_demo) && $bind_demo
$bind_demo.destroy
$bind_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$bind_demo = TkToplevel.new {|w|
title("Text Demonstration - Tag Bindings")
iconname("bind")
@@ -18,11 +18,11 @@ $bind_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($bind_demo).pack(:fill=>:both, :expand=>true)
-# frame
+# frame 生成
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $bind_demo
$bind_demo = nil
@@ -31,20 +31,20 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'bind'}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# bind ѥ᥽å
+# bind 用メソッド
def tag_binding_for_bind_demo(tag, enter_style, leave_style)
tag.bind('Any-Enter', proc{tag.configure enter_style})
tag.bind('Any-Leave', proc{tag.configure leave_style})
end
-# text
+# text 生成
txt = TkText.new(base_frame){|t|
- #
+ # 生成
setgrid 'true'
#width 60
#height 24
@@ -57,7 +57,7 @@ txt = TkText.new(base_frame){|t|
}
pack('expand'=>'yes', 'fill'=>'both')
- #
+ # スタイル設定
if TkWinfo.depth($root).to_i > 1
tagstyle_bold = {'background'=>'#43ce80', 'relief'=>'raised',
'borderwidth'=>1}
@@ -67,25 +67,25 @@ txt = TkText.new(base_frame){|t|
tagstyle_normal = {'foreground'=>'', 'background'=>''}
end
- # ƥ
- insert 'insert', "ƥwidgetɽ椹ΤƱΥᥫ˥ȤäơƥȤTclΥޥɤƤ뤳ȤǤޤˤꡢޥ䥭ܡɤΥTclΥޥɤ¹Ԥ褦ˤʤޤ㤨СΥХΥǥץˤĤƤʸˤϤΤ褦ʥĤƤޤޥʸξ˻äƤʸꡢܥ1򲡤ȤΥǥ⤬Ϥޤޤ
+ # テキスト挿入
+ insert 'insert', "テキストwidgetの表示スタイルを制御するのと同じタグのメカニズムを使って、テキストにTclのコマンドを割り当てることができます。これにより、マウスやキーボードのアクションで特定のTclのコマンドが実行されるようになります。例えば、下のキャンバスのデモプログラムについての説明文にはそのようなタグがついています。マウスを説明文の上に持っていくと説明文が光り、ボタン1を押すとその説明のデモが始まります。
"
- insert('end', '1. Х widget ˺뤳ȤΤǤ륢ƥμƤ˴ؤ륵ץ롣', (d1 = TkTextTag.new(t)) )
+ insert('end', '1. キャンバス widget に作ることのできるアイテムの種類全てに関するサンプル。', (d1 = TkTextTag.new(t)) )
insert('end', "\n\n")
- insert('end', '2. ñ 2ΥץåȡǡɽưȤǤ롣', (d2 = TkTextTag.new(t)) )
+ insert('end', '2. 簡単な 2次元のプロット。データを表す点を動かすことができる。', (d2 = TkTextTag.new(t)) )
insert('end', "\n\n")
- insert('end', '3. ƥȥƥΥ󥫡ȹ·',
+ insert('end', '3. テキストアイテムのアンカーと行揃え。',
(d3 = TkTextTag.new(t)) )
insert('end', "\n\n")
- insert('end', '4. 饤󥢥ƥΤƬηΥǥ',
+ insert('end', '4. ラインアイテムのための矢印の頭の形のエディタ。',
(d4 = TkTextTag.new(t)) )
insert('end', "\n\n")
- insert('end', '5. ֥ȥåפѹ뤿εǽĤΥ롼顼',
+ insert('end', '5. タブストップを変更するための機能つきのルーラー。',
(d5 = TkTextTag.new(t)) )
insert('end', "\n\n")
insert('end',
- '6. Хɤäƥ뤹Τ򼨤åɡ',
+ '6. キャンバスがどうやってスクロールするのかを示すグリッド。',
(d6 = TkTextTag.new(t)) )
# binding
diff --git a/ext/tk/sample/demos-jp/bitmap.rb b/ext/tk/sample/demos-jp/bitmap.rb
index 1193e8de24..d84e9a5f09 100644
--- a/ext/tk/sample/demos-jp/bitmap.rb
+++ b/ext/tk/sample/demos-jp/bitmap.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# bitmap widget demo (called by 'widget')
#
@@ -25,13 +25,13 @@ def bitmapRow(w,*args)
}
end
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($bitmap_demo) && $bitmap_demo
$bitmap_demo.destroy
$bitmap_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$bitmap_demo = TkToplevel.new {|w|
title("Bitmap Demonstration")
iconname("bitmap")
@@ -40,17 +40,17 @@ $bitmap_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($bitmap_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label 生成
TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left',
- 'text'=>"ΥɥˤϡTk Ȥ߹ޤ줿٤ƤΥӥåȥޥåפ̾ȶɽƤޤTcl ΥץǤϡ줾̾ѤƻȤޤ"){
+ 'text'=>"このウィンドウには、Tk に組み込まれたすべてのビットマップが、それらの名前と共に表示されています。Tcl のスクリプト中では、それぞれの名前を用いて参照します。"){
pack('side'=>'top')
}
-# frame
+# frame 生成
$bitmap_buttons = TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $bitmap_demo
$bitmap_demo = nil
@@ -59,13 +59,13 @@ $bitmap_buttons = TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'bitmap'}
}.pack('side'=>'left', 'expand'=>'yes')
}
$bitmap_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# frame
+# frame 設定
TkFrame.new(base_frame){|f|
bitmapRow(f,'error','gray25','gray50','hourglass')
bitmapRow(f,'info','question','questhead','warning')
diff --git a/ext/tk/sample/demos-jp/button.rb b/ext/tk/sample/demos-jp/button.rb
index 87ced45810..301100b057 100644
--- a/ext/tk/sample/demos-jp/button.rb
+++ b/ext/tk/sample/demos-jp/button.rb
@@ -1,36 +1,36 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# button widget demo (called by 'widget')
#
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($button_demo) && $button_demo
$button_demo.destroy
$button_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$button_demo = TkToplevel.new {|w|
title("Button Demonstration")
iconname("button")
positionWindow(w)
}
-# label
+# label 生成
msg = TkLabel.new($button_demo) {
font $kanji_font
wraplength '4i'
justify 'left'
- text "ܥ򥯥åȡܥطʿΥܥ˽񤫤Ƥ뿧ˤʤޤܥ󤫤ܥؤΰưϥ֤򲡤ȤǤǽǤޤڡǼ¹Ԥ뤳ȤǤޤ"
+ text "ボタンをクリックすると、ボタンの背景色がそのボタンに書かれている色になります。ボタンからボタンへの移動はタブを押すことでも可能です。またスペースで実行することができます。"
}
msg.pack('side'=>'top')
-# frame
+# frame 生成
$button_buttons = Tk::Frame.new($button_demo) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $button_demo
$button_demo = nil
@@ -39,13 +39,13 @@ $button_buttons = Tk::Frame.new($button_demo) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'button'}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# button
+# button 生成
TkButton.new($button_demo){
text "Peach Puff"
width 10
diff --git a/ext/tk/sample/demos-jp/check.rb b/ext/tk/sample/demos-jp/check.rb
index 762b99778b..422e898ec9 100644
--- a/ext/tk/sample/demos-jp/check.rb
+++ b/ext/tk/sample/demos-jp/check.rb
@@ -1,15 +1,15 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# checkbutton widget demo (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($check_demo) && $check_demo
$check_demo.destroy
$check_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$check_demo = TkToplevel.new {|w|
title("Checkbutton Demonstration")
iconname("check")
@@ -18,25 +18,25 @@ $check_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($check_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label 生成
msg = TkLabel.new(base_frame) {
font $font
wraplength '4i'
justify 'left'
- text "ˤ 3 ĤΥåܥɽƤޤåȥܥ֤ѤꡢTcl ѿ ( TkVariable ֥ȤǥǤޤ ) ˤΥܥξ֤򼨤ͤꤷޤߤѿͤ򸫤ˤϡѿȡץܥ򥯥åƤ"
+ text "下には 3 つのチェックボタンが表示されています。クリックするとボタンの選択状態が変わり、Tcl 変数 ( TkVariable オブジェクトでアクセスできます ) にそのボタンの状態を示す値を設定します。現在の変数の値を見るには「変数参照」ボタンをクリックしてください。"
}
msg.pack('side'=>'top')
-# ѿ
+# 変数生成
wipers = TkVariable.new(0)
brakes = TkVariable.new(0)
sober = TkVariable.new(0)
-# frame
+# frame 生成
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $check_demo
$check_demo = nil
@@ -46,13 +46,13 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'check'}
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ѿ'
+ text '変数参照'
command proc{
showVars(base_frame,
['wipers', wipers], ['brakes', brakes], ['sober', sober])
@@ -62,9 +62,9 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# checkbutton
-[ TkCheckButton.new(base_frame, 'text'=>'磻ѡ OK', 'variable'=>wipers),
- TkCheckButton.new(base_frame, 'text'=>'֥졼 OK', 'variable'=>brakes),
- TkCheckButton.new(base_frame, 'text'=>'ž ', 'variable'=>sober)
+# checkbutton 生成
+[ TkCheckButton.new(base_frame, 'text'=>'ワイパー OK', 'variable'=>wipers),
+ TkCheckButton.new(base_frame, 'text'=>'ブレーキ OK', 'variable'=>brakes),
+ TkCheckButton.new(base_frame, 'text'=>'運転手 素面', 'variable'=>sober)
].each{|w| w.relief('flat'); w.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w')}
diff --git a/ext/tk/sample/demos-jp/check2.rb b/ext/tk/sample/demos-jp/check2.rb
index 9f845183f3..558e588535 100644
--- a/ext/tk/sample/demos-jp/check2.rb
+++ b/ext/tk/sample/demos-jp/check2.rb
@@ -1,15 +1,15 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# checkbutton widget demo2 (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($check2_demo) && $check2_demo
$check2_demo.destroy
$check2_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$check2_demo = TkToplevel.new {|w|
title("Checkbutton Demonstration 2")
iconname("check2")
@@ -18,37 +18,37 @@ $check2_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($check2_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label 生成
msg = TkLabel.new(base_frame) {
font $font
wraplength '4i'
justify 'left'
- text "ˤϣĤΥåܥɽƤޤåȥܥ֤ѤꡢTclѿTkVariable֥ȤǥǤޤˤˤΥܥξ֤򼨤ͤꤷޤǽΥܥξ֤¾ΣĤΥܥξ֤ˤ¸Ѳޤ⤷ĤΥܥΰ˥åդƤ硢ǽΥܥϥȥ饤ơȡʣ֡˥⡼ɤǤɽԤޤߤѿͤ򸫤ˤϡѿȡץܥ򥯥åƤ"
+ text "下には4つのチェックボタンが表示されています。クリックするとボタンの選択状態が変わり、Tcl変数(TkVariableオブジェクトでアクセスできます)にそのボタンの状態を示す値を設定します。最初のボタンの状態は他の3つのボタンの状態にも依存して変化します。もし3つのボタンの一部だけにチェックが付けられている場合、最初のボタンはトライステート(3状態)モードでの表示を行います。現在の変数の値を見るには「変数参照」ボタンをクリックしてください。"
}
msg.pack('side'=>'top')
-# ѿ
+# 変数生成
safety = TkVariable.new(0)
wipers = TkVariable.new(0)
brakes = TkVariable.new(0)
sober = TkVariable.new(0)
-# frame
+# frame 生成
TkFrame.new(base_frame) {|frame|
TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2),
:columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
TkGrid('x',
- TkButton.new(frame, :text=>'ѿ',
+ TkButton.new(frame, :text=>'変数参照',
:image=>$image['view'], :compound=>:left,
:command=>proc{
showVars($check2_demo,
['safety', safety], ['wipers', wipers],
['brakes', brakes], ['sober', sober])
}),
- TkButton.new(frame, :text=>'ɻ',
+ TkButton.new(frame, :text=>'コード参照',
:image=>$image['view'], :compound=>:left,
:command=>proc{showCode 'check2'}),
- TkButton.new(frame, :text=>'Ĥ',
+ TkButton.new(frame, :text=>'閉じる',
:image=>$image['delete'], :compound=>:left,
:command=>proc{
tmppath = $check2_demo
@@ -61,16 +61,16 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'bottom', 'fill'=>'x')
-# checkbutton
-TkCheckButton.new(base_frame, :text=>'', :variable=>safety,
+# checkbutton 生成
+TkCheckButton.new(base_frame, :text=>'安全性検査', :variable=>safety,
:relief=>:flat, :onvalue=>'all', :offvalue=>'none',
:tristatevalue=>'partial'){
pack('side'=>'top', 'pady'=>2, 'anchor'=>'w')
}
-[ TkCheckButton.new(base_frame, 'text'=>'磻ѡ OK', 'variable'=>wipers),
- TkCheckButton.new(base_frame, 'text'=>'֥졼 OK', 'variable'=>brakes),
- TkCheckButton.new(base_frame, 'text'=>'ž ', 'variable'=>sober)
+[ TkCheckButton.new(base_frame, 'text'=>'ワイパー OK', 'variable'=>wipers),
+ TkCheckButton.new(base_frame, 'text'=>'ブレーキ OK', 'variable'=>brakes),
+ TkCheckButton.new(base_frame, 'text'=>'運転手 素面', 'variable'=>sober)
].each{|w|
w.relief('flat')
w.pack('side'=>'top', 'padx'=>15, 'pady'=>2, 'anchor'=>'w')
diff --git a/ext/tk/sample/demos-jp/clrpick.rb b/ext/tk/sample/demos-jp/clrpick.rb
index c188723c5a..df8c76a69d 100644
--- a/ext/tk/sample/demos-jp/clrpick.rb
+++ b/ext/tk/sample/demos-jp/clrpick.rb
@@ -1,35 +1,35 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# widget demo prompts the user to select a color (called by 'widget')
#
# Note: don't support ttk_wrapper. work with standard widgets only.
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($clrpick_demo) && $clrpick_demo
$clrpick_demo.destroy
$clrpick_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$clrpick_demo = TkToplevel.new {|w|
title("Color Selection Dialogs")
iconname("colors")
positionWindow(w)
}
-# label
+# label 生成
#TkLabel.new($clrpick_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left',
Tk::Label.new($clrpick_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left',
- 'text'=>"ʲΥܥ򲡤ơΥɥˤ륦åȤʿطʿ򤷤Ʋ").pack('side'=>'top')
+ 'text'=>"以下のボタンを押して、このウィンドウ上にあるウィジェットの前景色と背景色を選択して下さい。").pack('side'=>'top')
-# frame
+# frame 生成
# TkFrame.new($clrpick_demo) {|frame|
Tk::Frame.new($clrpick_demo) {|frame|
# TkButton.new(frame) {
Tk::Button.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $clrpick_demo
$clrpick_demo = nil
@@ -39,21 +39,21 @@ Tk::Frame.new($clrpick_demo) {|frame|
# TkButton.new(frame) {
Tk::Button.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'clrpick'}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# button
-# TkButton.new($clrpick_demo, 'text'=>'طʿ ...') {|b|
-Tk::Button.new($clrpick_demo, 'text'=>'طʿ ...') {|b|
+# button 生成
+# TkButton.new($clrpick_demo, 'text'=>'背景色を設定 ...') {|b|
+Tk::Button.new($clrpick_demo, 'text'=>'背景色を設定 ...') {|b|
command(proc{setColor $clrpick_demo, b, 'background',
['background', 'highlightbackground']})
pack('side'=>'top', 'anchor'=>'c', 'pady'=>'2m')
}
-# TkButton.new($clrpick_demo, 'text'=>'ʿ ...') {|b|
-Tk::Button.new($clrpick_demo, 'text'=>'ʿ ...') {|b|
+# TkButton.new($clrpick_demo, 'text'=>'前景色を設定 ...') {|b|
+Tk::Button.new($clrpick_demo, 'text'=>'前景色を設定 ...') {|b|
command(proc{setColor $clrpick_demo, b, 'foreground', ['foreground']})
pack('side'=>'top', 'anchor'=>'c', 'pady'=>'2m')
}
diff --git a/ext/tk/sample/demos-jp/colors.rb b/ext/tk/sample/demos-jp/colors.rb
index 9fcf0333b5..5e5f47cb04 100644
--- a/ext/tk/sample/demos-jp/colors.rb
+++ b/ext/tk/sample/demos-jp/colors.rb
@@ -1,15 +1,15 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# listbox widget demo 'colors' (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($colors_demo) && $colors_demo
$colors_demo.destroy
$colors_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$colors_demo = TkToplevel.new {|w|
title("Listbox Demonstration (colors)")
iconname("colors")
@@ -18,20 +18,20 @@ $colors_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($colors_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label 生成
msg = TkLabel.new(base_frame) {
font $font
wraplength '4i'
justify 'left'
- text "ˤϿ̾äСդΥꥹȥܥåɽƤޤꥹȤ򥹥뤵ΤϥСǤǤޤꥹȥܥåǥޥΥܥ2(ܥ)򲡤ޤޥɥåƤǤޤ뿧ܥ1(ܥ)ǥ֥륯åȥץꥱΤοˤʤޤ"
+ text "下には色の名前が入ったスクロールバー付のリストボックスが表示されています。リストをスクロールさせるのはスクロールバーでもできますし、リストボックスの中でマウスのボタン2(中ボタン)を押したままドラッグしてもできます。ある色をボタン1(左ボタン)でダブルクリックするとアプリケーション全体がその色になります。"
}
msg.pack('side'=>'top')
-# frame
+# frame 生成
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $colors_demo
$colors_demo = nil
@@ -40,13 +40,13 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'colors'}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# frame
+# frame 生成
colors_lbox = nil
TkFrame.new(base_frame, 'borderwidth'=>10) {|w|
s = TkScrollbar.new(w)
diff --git a/ext/tk/sample/demos-jp/combo.rb b/ext/tk/sample/demos-jp/combo.rb
index 2059662d48..8bbe36997d 100644
--- a/ext/tk/sample/demos-jp/combo.rb
+++ b/ext/tk/sample/demos-jp/combo.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# combo.rb --
#
@@ -21,16 +21,16 @@ base_frame = TkFrame.new($combo_demo).pack(:fill=>:both, :expand=>true)
Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'5i', :justify=>:left,
:text=><<EOL).pack(:side=>:top, :fill=>:x)
-ʲǤ3ΥܥܥåɽƤޤ\
-ǽΤΤϡȥꥦåȤƱͤˡ\
-ݥȤꡤåꡤפꤹ뤳ȤǤޤ\
-ޤReturnϤиߤͤꥹȤɲä졤\
-ɥåץꥹȤ򤹤뤳ȤǤ褦ˤʤޤ\
-()򲡤ɽ줿ꥹȤ\
-¾θReturn򲡤СͤǤޤ\
-2ܤΥܥܥåͤ˸ꤵƤꡤѹǤޤ\
-3ܤΤΤϥȥꥢԻԤΥɥåץꥹȤ\
-򤹤뤳ȤǽȤʤäƤޤ
+以下では3種類のコンボボックスが表示されています.\
+最初のものは,エントリウィジェットと同じ様に,\
+ポイントしたり,クリックしたり,タイプしたりすることができます.\
+また,Returnキーを入力すれば現在の値がリストに追加され,\
+ドロップダウンリストから選択することができるようになります.\
+↓(下向き矢印)キーを押して表示されたリストから\
+矢印キーで他の候補を選んでReturnキーを押せば,値を選択できます.\
+2番目のコンボボックスは特定の値に固定されており,一切変更できません.\
+3番目のものはオーストラリアの都市のドロップダウンリストから\
+選択することだけが可能となっています.
EOL
## variables
@@ -43,7 +43,7 @@ Ttk::Frame.new(base_frame) {|frame|
sep = Ttk::Separator.new(frame)
Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
TkGrid('x',
- Ttk::Button.new(frame, :text=>'ѿ',
+ Ttk::Button.new(frame, :text=>'変数参照',
:image=>$image['view'], :compound=>:left,
:command=>proc{
showVars(base_frame,
@@ -51,10 +51,10 @@ Ttk::Frame.new(base_frame) {|frame|
['secondVariable', secondValue],
['ozCity', ozCity])
}),
- Ttk::Button.new(frame, :text=>'ɻ',
+ Ttk::Button.new(frame, :text=>'コード参照',
:image=>$image['view'], :compound=>:left,
:command=>proc{showCode 'combo'}),
- Ttk::Button.new(frame, :text=>'Ĥ',
+ Ttk::Button.new(frame, :text=>'閉じる',
:image=>$image['delete'], :compound=>:left,
:command=>proc{
$combo_demo.destroy
@@ -68,13 +68,13 @@ Ttk::Frame.new(base_frame) {|frame|
frame = Ttk::Frame.new(base_frame).pack(:fill=>:both, :expand=>true)
australianCities = [
- '٥', 'ɥˡ', 'ܥ', 'ѡ', 'ǥ졼',
- '֥ꥹ١', 'ۥС', '', 'ꥹ ץ󥰥'
+ 'キャンベラ', 'シドニー', 'メルボルン', 'パース', 'アデレード',
+ 'ブリスベーン', 'ホバート', 'ダーウィン', 'アリス スプリングス'
]
-secondValue.value = 'ѹԲ'
-ozCity.value = 'ɥˡ'
+secondValue.value = '変更不可'
+ozCity.value = 'シドニー'
Tk.pack(Ttk::Labelframe.new(frame, :text=>'Fully Editable'){|f|
Ttk::Combobox.new(f, :textvariable=>firstValue){|b|
diff --git a/ext/tk/sample/demos-jp/cscroll.rb b/ext/tk/sample/demos-jp/cscroll.rb
index 0a31f28b5e..e993326aa9 100644
--- a/ext/tk/sample/demos-jp/cscroll.rb
+++ b/ext/tk/sample/demos-jp/cscroll.rb
@@ -1,15 +1,15 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# simple scrollable canvas widget demo (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($cscroll_demo) && $cscroll_demo
$cscroll_demo.destroy
$cscroll_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$cscroll_demo = TkToplevel.new {|w|
title("Scrollable Canvas Demonstration")
iconname("cscroll")
@@ -18,17 +18,17 @@ $cscroll_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($cscroll_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label 生成
TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i',
- 'justify'=>'left', 'text'=>"ΥɥˤϥСޥΥܥ2 ǥǤ륭Х widget ɽƤޤͳѤξǥܥ1 򥯥åȡΥǥåɸϤ˽Ϥޤ"){
+ 'justify'=>'left', 'text'=>"このウィンドウにはスクロールバーやマウスのボタン2 でスクロールできるキャンバス widget が表示されています。四角の上でボタン1 をクリックすると、そのインデックスが標準出力に出力されます。"){
pack('side'=>'top')
}
-# frame
+# frame 生成
$cscroll_buttons = TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $cscroll_demo
$cscroll_demo = nil
@@ -37,13 +37,13 @@ $cscroll_buttons = TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'cscroll'}
}.pack('side'=>'left', 'expand'=>'yes')
}
$cscroll_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# frame
+# frame 設定
unless $tk_version =~ /^4\.[01]/
$cscroll_grid = TkFrame.new(base_frame) {
pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>1)
@@ -52,7 +52,7 @@ unless $tk_version =~ /^4\.[01]/
TkGrid.columnconfigure($cscroll_grid, 0, 'weight'=>1, 'minsize'=>0)
end
-# canvas
+# canvas 設定
$cscroll_canvas = TkCanvas.new(base_frame,
'relief'=>'sunken', 'borderwidth'=>2,
'scrollregion'=>['-11c', '-11c', '50c', '20c']
diff --git a/ext/tk/sample/demos-jp/ctext.rb b/ext/tk/sample/demos-jp/ctext.rb
index 70c1cad1a7..bb354c490e 100644
--- a/ext/tk/sample/demos-jp/ctext.rb
+++ b/ext/tk/sample/demos-jp/ctext.rb
@@ -1,15 +1,15 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# Canvas Text widget demo (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($ctext_demo) && $ctext_demo
$ctext_demo.destroy
$ctext_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$ctext_demo = TkToplevel.new {|w|
title("Canvas Text Demonstration")
iconname("Text")
@@ -18,23 +18,23 @@ $ctext_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($ctext_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label 生成
TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left',
- 'text'=>"ΥɥˤϥХwidgetΥƥȵǽǥ⤹뤿ΥƥʸɽƤޤޥͳѤ˻äƤåȰ֤Ѥа֤Ѥꡢ·Ѥꤹ뤳ȤǤޤޤʲΤ褦ԽΤδñʥХǥ󥰤򥵥ݡȤƤޤ
+ 'text'=>"このウィンドウにはキャンバスwidgetのテキスト機能をデモするためのテキスト文字列が表示されています。マウスを四角の中に持っていき、クリックすると位置ぎめ用の点からの相対位置を変えたり、行揃えを変えたりすることができます。また以下のような編集のための簡単なバインディングをサポートしています。
- 1. ޥäƤåϤǤޤ
- 2. ܥ1Ǥޤ
- 3. ޥΰ֤˥ܥ2򤷤ƥȤ򥳥ԡǤޤ
- 4.Хåڡ򥳥ȥ-Hľʸޤ
- 5. Deleteľʸޤ"){
+ 1. マウスを持っていき、クリックし、入力できます。
+ 2. ボタン1で選択できます。
+ 3. マウスの位置にボタン2で選択したテキストをコピーできます。
+ 4.バックスペースをコントロール-Hで挿入カーソルの直前の文字を削除します。
+ 5. Deleteキーは挿入カーソルの直後の文字を削除します。"){
pack('side'=>'top')
}
-# frame
+# frame 生成
$ctext_buttons = TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $ctext_demo
$ctext_demo = nil
@@ -43,30 +43,30 @@ $ctext_buttons = TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'ctext'}
}.pack('side'=>'left', 'expand'=>'yes')
}
$ctext_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# canvas
+# canvas 生成
$ctext_canvas = TkCanvas.new(base_frame, 'relief'=>'flat',
'borderwidth'=>0, 'width'=>500, 'height'=>350)
$ctext_canvas.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'both')
-# font
+# font 設定
if $tk_version =~ /^4.*/
textFont = '-*-Helvetica-Medium-R-Normal--*-240-*-*-*-*-*-*'
else
textFont = 'Helvetica 24'
end
-# canvas
+# canvas 設定
TkcRectangle.new($ctext_canvas, 245, 195, 255, 205,
'outline'=>'black', 'fill'=>'red')
ctag_text_param = {
- 'text'=>"ϥХwidgetΥƥȵǽǥ⤹뤿ʸǤ\nǽҤ٤褦ԽǽȤ뤿ΥХǥ󥰤ܤƤޤ",
+ 'text'=>"これはキャンバスwidgetのテキスト機能をデモするための文字列です。\n上で述べたような編集を可能とするためのバインディングを施しています。",
'width'=>440, 'anchor'=>'n', 'justify'=>'left'
}
if $tk_version =~ /^4.*/
diff --git a/ext/tk/sample/demos-jp/dialog1.rb b/ext/tk/sample/demos-jp/dialog1.rb
index 07e50306ab..e50c9071e5 100644
--- a/ext/tk/sample/demos-jp/dialog1.rb
+++ b/ext/tk/sample/demos-jp/dialog1.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# a dialog box with a local grab (called by 'widget')
#
@@ -11,7 +11,7 @@ class TkDialog_Demo1 < TkDialog
end
def message
- '⡼ܥåǤTk "grab" ޥɤѤƥܥåǡ֥륰֡פƤޤΤ줫Υܥ¹Ԥ뤳ȤˤäơΥޤǡΥ֤ˤäƥץꥱ¾ΥɥǤϡݥ󥿴طΥ٥Ȥ뤳ȤǤʤʤäƤޤ'
+ 'モーダルダイアログボックスです。Tk の "grab" コマンドを使用してダイアログボックスで「ローカルグラブ」しています。下のいずれかのボタンを実行することによって、このダイアログに答えるまで、このグラブによってアプリケーションの他のウィンドウでは、ポインタ関係のイベントを受け取ることができなくなっています。'
end
def bitmap
@@ -23,17 +23,17 @@ class TkDialog_Demo1 < TkDialog
end
def buttons
-# "λ 󥻥 ɻ"
- ["λ", "󥻥", "ɻ"]
+# "了解 キャンセル コード参照"
+ ["了解", "キャンセル", "コード参照"]
end
end
ret = TkDialog_Demo1.new('message_config'=>{'wraplength'=>'4i'}).value
case ret
when 0
- print "ʤϡλפ򲡤ޤ͡\n"
+ print "あなたは「了解」を押しましたね。\n"
when 1
- print "ʤϡ֥󥻥פ򲡤ޤ͡\n"
+ print "あなたは「キャンセル」を押しましたね。\n"
when 2
showCode 'dialog1'
end
diff --git a/ext/tk/sample/demos-jp/dialog2.rb b/ext/tk/sample/demos-jp/dialog2.rb
index f747f8d6a8..3e7d9619a4 100644
--- a/ext/tk/sample/demos-jp/dialog2.rb
+++ b/ext/tk/sample/demos-jp/dialog2.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# a dialog box with a global grab (called by 'widget')
#
@@ -11,7 +11,7 @@ class TkDialog_Demo2 < TkDialog
end
def message
- 'ΥܥåϥХ륰֤ѤƤޤΥܥ¹Ԥޤǡǥץ쥤ΤʤΤȤäǤޤ󡣥Х륰֤Ѥ뤳ȤϡޤɤͤǤϤޤ󡣤ɤƤɬפˤʤޤǻȤȻפʤDz'
+ 'このダイアログボックスはグローバルグラブを使用しています。下のボタンを実行するまで、ディスプレイ上のいかなるものとも対話できません。グローバルグラブを使用することは、まず良い考えではありません。どうしても必要になるまで使おうと思わないで下さい。'
end
def bitmap
@@ -23,8 +23,8 @@ class TkDialog_Demo2 < TkDialog
end
def buttons
-# "λ 󥻥 ɻ"
- ["λ", "󥻥", "ɻ"]
+# "了解 キャンセル コード参照"
+ ["了解", "キャンセル", "コード参照"]
end
end
@@ -34,9 +34,9 @@ ret = TkDialog_Demo2.new('message_config'=>{'wraplength'=>'4i'},
}).value
case ret
when 0
- print "ʤϡλפ򲡤ޤ͡\n"
+ print "あなたは「了解」を押しましたね。\n"
when 1
- print "ʤϡ֥󥻥פ򲡤ޤ͡\n"
+ print "あなたは「キャンセル」を押しましたね。\n"
when 2
showCode 'dialog2'
end
diff --git a/ext/tk/sample/demos-jp/entry1.rb b/ext/tk/sample/demos-jp/entry1.rb
index eb71e87aec..9be677d12d 100644
--- a/ext/tk/sample/demos-jp/entry1.rb
+++ b/ext/tk/sample/demos-jp/entry1.rb
@@ -1,15 +1,15 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# entry (no scrollbars) widget demo (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($entry1_demo) && $entry1_demo
$entry1_demo.destroy
$entry1_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$entry1_demo = TkToplevel.new {|w|
title("Entry Demonstration (no scrollbars)")
iconname("entry1")
@@ -18,20 +18,20 @@ $entry1_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($entry1_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label 生成
msg = TkLabel.new(base_frame) {
font $font
wraplength '5i'
justify 'left'
- text "3ΰۤʤ륨ȥ꤬ɽƤޤʸϤˤϥݥ󥿤äƹԤåƤ饿פƤɸŪMotifԽǽEmacsΥХɤȤȤˡݡȤƤޤ㤨СХåڡȥȥ-Hϥκʸǥ꡼ȥȥȥ-Dϥα¦ʸޤĹ᤮ƥɥڤʤΤϡޥΥܥ2򲡤ޤޥɥå뤳Ȥǥ뤵뤳ȤǤޤܸϤΤϥȥ-ХååǤkinput2ưƤϤ뤳ȤǤޤ"
+ text "3種類の異なるエントリが表示されています。文字を入力するにはポインタを持って行き、クリックしてからタイプしてください。標準的なMotifの編集機能が、Emacsのキーバインドとともに、サポートされています。例えば、バックスペースとコントロール-Hはカーソルの左の文字を削除し、デリートキーとコントロール-Dはカーソルの右側の文字を削除します。長過ぎてウィンドウに入り切らないものは、マウスのボタン2を押したままドラッグすることでスクロールさせることができます。日本語を入力するのはコントロール-バックスラッシュです。kinput2が動いていれば入力することができます。"
}
msg.pack('side'=>'top')
-# frame
+# frame 生成
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $entry1_demo
$entry1_demo = nil
@@ -40,21 +40,21 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'entry1'}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# entry
+# entry 生成
e1 = TkEntry.new(base_frame, 'relief'=>'sunken')
e2 = TkEntry.new(base_frame, 'relief'=>'sunken')
e3 = TkEntry.new(base_frame, 'relief'=>'sunken')
[e1,e2,e3].each{|w| w.pack('side'=>'top', 'padx'=>10, 'pady'=>5, 'fill'=>'x')}
-#
-e1.insert(0, '')
-e2.insert('end', "ΥȥˤĹʸäƤơ")
-e2.insert('end', "ĹƥɥˤڤʤΤǡ")
-e2.insert('end', "ºݤν꽪ޤǸˤϥ뤵ʤ")
-e2.insert('end', "ʤʤǤ礦")
+# 初期値挿入
+e1.insert(0, '初期値')
+e2.insert('end', "このエントリには長い文字列が入っていて、")
+e2.insert('end', "長すぎてウィンドウには入り切らないので、")
+e2.insert('end', "実際の所終りまで見るにはスクロールさせなければ")
+e2.insert('end', "ならないでしょう。")
diff --git a/ext/tk/sample/demos-jp/entry2.rb b/ext/tk/sample/demos-jp/entry2.rb
index b5187ab508..5476d24ade 100644
--- a/ext/tk/sample/demos-jp/entry2.rb
+++ b/ext/tk/sample/demos-jp/entry2.rb
@@ -1,15 +1,15 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# entry (with scrollbars) widget demo (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($entry2_demo) && $entry2_demo
$entry2_demo.destroy
$entry2_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$entry2_demo = TkToplevel.new {|w|
title("Entry Demonstration (with scrollbars)")
iconname("entry2")
@@ -18,20 +18,20 @@ $entry2_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($entry2_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label 生成
msg = TkLabel.new(base_frame) {
font $font
wraplength '5i'
justify 'left'
- text "3ΰۤʤ륨ȥ꤬ơСդɽƤޤʸϤˤϥݥ󥿤äƹԤåƤ饿פƤɸŪMotifԽǽEmacsΥХɤȤȤˡݡȤƤޤ㤨СХåڡȥȥ-Hϥκʸǥ꡼ȥȥȥ-Dϥα¦ʸޤĹ᤮ƥɥڤʤΤϡޥΥܥ2򲡤ޤޥɥå뤳Ȥǥ뤵뤳ȤǤޤܸϤΤϥȥ-ХååǤkinput2ưƤϤ뤳ȤǤޤ"
+ text "3種類の異なるエントリが各々スクロールバー付で表示されています。文字を入力するにはポインタを持って行き、クリックしてからタイプしてください。標準的なMotifの編集機能が、Emacsのキーバインドとともに、サポートされています。例えば、バックスペースとコントロール-Hはカーソルの左の文字を削除し、デリートキーとコントロール-Dはカーソルの右側の文字を削除します。長過ぎてウィンドウに入り切らないものは、マウスのボタン2を押したままドラッグすることでスクロールさせることができます。日本語を入力するのはコントロール-バックスラッシュです。kinput2が動いていれば入力することができます。"
}
msg.pack('side'=>'top')
-# frame
+# frame 生成
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $entry2_demo
$entry2_demo = nil
@@ -40,12 +40,12 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'entry2'}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# frame
+# frame 生成
TkFrame.new(base_frame, 'borderwidth'=>10) {|w|
# entry 1
s1 = TkScrollbar.new(w, 'relief'=>'sunken', 'orient'=>'horiz')
@@ -80,12 +80,12 @@ TkFrame.new(base_frame, 'borderwidth'=>10) {|w|
e3.pack('side'=>'top', 'fill'=>'x')
s3.pack('side'=>'top', 'fill'=>'x')
- #
- e1.insert(0, '')
- e2.insert('end', "ΥȥˤĹʸäƤơ")
- e2.insert('end', "ĹƥɥˤڤʤΤǡ")
- e2.insert('end', "ºݤν꽪ޤǸˤϥ뤵ʤ")
- e2.insert('end', "ʤʤǤ礦")
+ # 初期値挿入
+ e1.insert(0, '初期値')
+ e2.insert('end', "このエントリには長い文字列が入っていて、")
+ e2.insert('end', "長すぎてウィンドウには入り切らないので、")
+ e2.insert('end', "実際の所終りまで見るにはスクロールさせなければ")
+ e2.insert('end', "ならないでしょう。")
}.pack('side'=>'top', 'fill'=>'x', 'expand'=>'yes')
diff --git a/ext/tk/sample/demos-jp/entry3.rb b/ext/tk/sample/demos-jp/entry3.rb
index 2728de0b93..59c698de62 100644
--- a/ext/tk/sample/demos-jp/entry3.rb
+++ b/ext/tk/sample/demos-jp/entry3.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
# entry3.rb --
#
# This demonstration script creates several entry widgets whose
@@ -23,33 +23,33 @@ base_frame = TkFrame.new($entry3_demo).pack(:fill=>:both, :expand=>true)
TkLabel.new(base_frame,
:font=>$font, :wraplength=>'5i', :justify=>:left,
:text=><<EOL).pack(:side=>:top)
-ʲˤϣΥȥܥåɽƤޤƥȥܥåϡ\
-ޥåʸǤळȤǽǤ줾줬ɤΤ褦\
-Ϥդ뤳ȤǤ뤫ˤߤƤޤ\
-ĤΥȥܥåȸʤʸʸʤξ֤\
-ξդ꤬ϥȥܥåǤޤ\
-ʥե˥åޤˡ\
-ĤΥȥܥåϡϤ줿ʸĹ\
-ʸ̤ξդ¤ۤƽ񤭹⤦ȤȤˤ\
-٥Ĥ餷Τ餻ޤ\
-Ĥƹֹդ륨ȥܥåǤ\
-ե٥åȤϡõΥбŤƤѴޤ\
-ŬڤʸϤ줿ʳʸΰ֤˿Ϥ褦Ȥ\
-ˤϷٹΥ٥뤬Ĥޤ\
-ͤĤΥȥܥåϡʸޤǤϤդ\
-ѥɥեɤǤʣʸʾä˷ٹФȤʤ̵뤵ޤˡ\
-Ϥ줿ʸϥꥹ֤ɽޤ
+以下には4種類のエントリボックスが表示されています.各エントリボックスは,\
+マウスクリックで選択し文字を打ち込むことが可能ですが,それぞれがどのような\
+入力を受け付けることができるかには制約が設けられています.\
+一つめのエントリボックスは整数と見なされる文字列か入力文字がない空の状態か\
+の場合だけを受け付け,問題がある場合はエントリボックスが点滅します\
+(フォーカスが去る時にチェックされます).\
+二つめのエントリボックスは,入力された文字列の長さが\
+10文字未満の場合だけを受け付け,制限を越えて書き込もうとしたときには\
+ベルを鳴らして知らせます.\
+三つめは米国の電話番号を受け付けるエントリボックスです.\
+アルファベットは,電話機のダイヤル上で対応づけられている数字に変換されます.\
+不適切な文字が入力されたり数字以外の文字の位置に数字を入力しようとしたり\
+した場合には警告のベルが鳴ります.\
+四つめのエントリボックスは,8文字までの入力を受け付ける\
+パスワードフィールドです(8文字以上は特に警告を出すことなく無視されます).\
+入力された文字はアスタリスク記号に置き換えて表示されます.
EOL
TkFrame.new(base_frame){|f|
pack(:side=>:bottom, :fill=>:x, :pady=>'2m')
- TkButton.new(f, :text=>'Ĥ', :width=>15, :command=>proc{
+ TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{
$entry3_demo.destroy
$entry3_demo = nil
}).pack(:side=>:left, :expand=>true)
- TkButton.new(f, :text=>'ɻ', :width=>15, :command=>proc{
+ TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{
showCode 'entry3'
}).pack(:side=>:left, :expand=>true)
}
@@ -90,7 +90,7 @@ def focusAndFlash(widget, fg, bg, count=5)
widget.focus(true)
end
-l1 = TkLabelFrame.new(base_frame, :text=>"ȥ")
+l1 = TkLabelFrame.new(base_frame, :text=>"整数エントリ")
TkEntry.new(l1, :validate=>:focus,
:vcmd=>[
proc{|s| s == '' || /^[+-]?\d+$/ =~ s }, '%P'
@@ -101,7 +101,7 @@ TkEntry.new(l1, :validate=>:focus,
pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m')
}
-l2 = TkLabelFrame.new(base_frame, :text=>"Ĺդȥ")
+l2 = TkLabelFrame.new(base_frame, :text=>"長さ制約付きエントリ")
TkEntry.new(l2, :validate=>:key, :invcmd=>proc{Tk.bell},
:vcmd=>[proc{|s| s.length < 10}, '%P']
).pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m')
@@ -190,7 +190,7 @@ def validatePhoneChange(widget, vmode, idx, char)
end
-l3 = TkLabelFrame.new(base_frame, :text=>"ƹֹ楨ȥ")
+l3 = TkLabelFrame.new(base_frame, :text=>"米国電話番号エントリ")
TkEntry.new(l3, :validate=>:key, :invcmd=>proc{Tk.bell},
:textvariable=>entry3content,
:vcmd=>[
@@ -209,7 +209,7 @@ TkEntry.new(l3, :validate=>:key, :invcmd=>proc{Tk.bell},
pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m')
}
-l4 = TkLabelFrame.new(base_frame, :text=>"ѥɥȥ")
+l4 = TkLabelFrame.new(base_frame, :text=>"パスワードエントリ")
TkEntry.new(l4, :validate=>:key, :show=>'*',
:vcmd=>[
proc{|s| s.length <= 8},
diff --git a/ext/tk/sample/demos-jp/filebox.rb b/ext/tk/sample/demos-jp/filebox.rb
index ffe5fbc5c6..fc014bc282 100644
--- a/ext/tk/sample/demos-jp/filebox.rb
+++ b/ext/tk/sample/demos-jp/filebox.rb
@@ -1,15 +1,15 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# widget demo prompts the user to select a file (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($filebox_demo) && $entry2_demo
$filebox_demo.destroy
$filebox_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$filebox_demo = TkToplevel.new {|w|
title("File Selection Dialogs")
iconname("filebox")
@@ -18,15 +18,15 @@ $filebox_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($filebox_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label 生成
TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left',
- 'text'=>"ȥ˥ե̾ľϤ뤫\"Browse\" ܥ򲡤ƥեե̾Dz").pack('side'=>'top')
+ 'text'=>"エントリにファイル名を直接入力するか、\"Browse\" ボタンを押してファイル選択ダイアログからファイル名を選んで下さい。").pack('side'=>'top')
-# frame
+# frame 生成
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $filebox_demo
$filebox_demo = nil
@@ -35,15 +35,15 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'filebox'}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# frame
-['', '¸'].each{|type|
+# frame 生成
+['開く', '保存'].each{|type|
TkFrame.new(base_frame) {|f|
- TkLabel.new(f, 'text'=>"ե#{type}: ", 'anchor'=>'e')\
+ TkLabel.new(f, 'text'=>"ファイルを#{type}: ", 'anchor'=>'e')\
.pack('side'=>'left')
TkEntry.new(f, 'width'=>20) {|e|
@@ -61,7 +61,7 @@ TkFrame.new(base_frame) {|frame|
$tk_strictMotif = TkVarAccess.new('tk_strictMotif')
if ($tk_platform['platform'] == 'unix')
TkCheckButton.new(base_frame,
- 'text'=>'MotifΥѤ',
+ 'text'=>'Motifスタイルのダイアログを用いる',
'variable'=>$tk_strictMotif,
'onvalue'=>1, 'offvalue'=>0 ).pack('anchor'=>'c')
end
@@ -83,7 +83,7 @@ def fileDialog(w,ent,operation)
['All files', '*' ]
]
- if operation == ''
+ if operation == '開く'
file = Tk.getOpenFile('filetypes'=>types, 'parent'=>w)
else
file = Tk.getSaveFile('filetypes'=>types, 'parent'=>w,
diff --git a/ext/tk/sample/demos-jp/floor.rb b/ext/tk/sample/demos-jp/floor.rb
index 78cc23a245..5101a026bb 100644
--- a/ext/tk/sample/demos-jp/floor.rb
+++ b/ext/tk/sample/demos-jp/floor.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# floorDisplay widget demo (called by 'widget')
#
@@ -50,7 +50,7 @@ def floorDisplay(w,active)
# Create items for the room entry and its label.
TkcWindow.new(w, 600, 100, 'anchor'=>'w', 'window'=>$floor_entry)
- TkcText.new(w, 600, 100, 'anchor'=>'e', 'text'=>"ֹ: ")
+ TkcText.new(w, 600, 100, 'anchor'=>'e', 'text'=>"部屋番号: ")
w['scrollregion'] = w.bbox('all')
end
@@ -1572,13 +1572,13 @@ end
# Below is the "main program" that creates the floorplan demonstration.
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($floor_demo) && $floor_demo
$floor_demo.destroy
$floor_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$floor_demo = TkToplevel.new {|w|
title("Floorplan Canvas Demonstration")
iconname("Floorplan")
@@ -1589,17 +1589,17 @@ $floor_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($floor_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label 生成
TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left',
- 'text'=>"Υɥˤϥǥ륨åץȼҤΥꥵܥȥ (DECWRL) δּ꤬񤫤줿Х widget äƤޤ 3ƤǡˤΤ1ʬ򡢤Ĥޤꤽδּ꤬ɽ褦ˤʤäƤޤ볬򤹤ˤϡξǥޥκܥ򥯥åƤޥ򤵤Ƥ볬ξưȡβˤοѤꡢֹ椬ֹ:ץȥɽޤޤȥֹ񤯤ȤοѤޤ"){
+ 'text'=>"このウィンドウにはディジタルエクイップメント社のウェスタンリサーチラボラトリ (DECWRL) の間取りが書かれたキャンバス widget が入っています。これは 3階建てで、常にそのうちの1階分が選択、つまりその間取りが表示されるようになっています。ある階を選択するには、その上でマウスの左ボタンをクリックしてください。マウスが選択されている階の上を動くと、その下にある部屋の色が変わり、部屋番号が「部屋番号:」エントリに表示されます。また、エントリに部屋番号を書くとその部屋の色が変わります。"){
pack('side'=>'top')
}
-# frame
+# frame 生成
$floor_buttons = TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $floor_demo
$floor_demo = nil
@@ -1608,17 +1608,17 @@ $floor_buttons = TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'floor'}
}.pack('side'=>'left', 'expand'=>'yes')
}
$floor_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# ѿ
+# 変数設定
$floorLabels = {}
$floorItems = {}
-# canvas
+# canvas 設定
if $tk_version =~ /^4\.[01]/
$floor_canvas_frame = TkFrame.new(base_frame,'bd'=>2,'relief'=>'sunken',
'highlightthickness'=>2)
diff --git a/ext/tk/sample/demos-jp/floor2.rb b/ext/tk/sample/demos-jp/floor2.rb
index 92ace6b51a..7ca705c7bd 100644
--- a/ext/tk/sample/demos-jp/floor2.rb
+++ b/ext/tk/sample/demos-jp/floor2.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# floorDisplay widget demo 2 (called by 'widget')
#
@@ -50,7 +50,7 @@ def floorDisplay2(w,active)
# Create items for the room entry and its label.
w.create(TkcWindow, 600, 100, 'anchor'=>'w', 'window'=>$floor2_entry)
- w.create(TkcText, 600, 100, 'anchor'=>'e', 'text'=>"ֹ: ")
+ w.create(TkcText, 600, 100, 'anchor'=>'e', 'text'=>"部屋番号: ")
w['scrollregion'] = w.bbox('all')
end
@@ -1572,13 +1572,13 @@ end
# Below is the "main program" that creates the floorplan demonstration.
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($floor2_demo) && $floor2_demo
$floor2_demo.destroy
$floor2_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$floor2_demo = TkToplevel.new {|w|
title("Floorplan Canvas Demonstration 2")
iconname("Floorplan2")
@@ -1589,17 +1589,17 @@ $floor2_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($floor2_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label 生成
TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left',
- 'text'=>"Υɥˤϥǥ륨åץȼҤΥꥵܥȥ (DECWRL) δּ꤬񤫤줿Х widget äƤޤ 3ƤǡˤΤ1ʬ򡢤Ĥޤꤽδּ꤬ɽ褦ˤʤäƤޤ볬򤹤ˤϡξǥޥκܥ򥯥åƤޥ򤵤Ƥ볬ξưȡβˤοѤꡢֹ椬ֹ:ץȥɽޤޤȥֹ񤯤ȤοѤޤ"){
+ 'text'=>"このウィンドウにはディジタルエクイップメント社のウェスタンリサーチラボラトリ (DECWRL) の間取りが書かれたキャンバス widget が入っています。これは 3階建てで、常にそのうちの1階分が選択、つまりその間取りが表示されるようになっています。ある階を選択するには、その上でマウスの左ボタンをクリックしてください。マウスが選択されている階の上を動くと、その下にある部屋の色が変わり、部屋番号が「部屋番号:」エントリに表示されます。また、エントリに部屋番号を書くとその部屋の色が変わります。"){
pack('side'=>'top')
}
-# frame
+# frame 生成
$floor2_buttons = TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $floor2_demo
$floor2_demo = nil
@@ -1608,17 +1608,17 @@ $floor2_buttons = TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'floor2'}
}.pack('side'=>'left', 'expand'=>'yes')
}
$floor2_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# ѿ
+# 変数設定
$floorLabels2 = {}
$floorItems2 = {}
-# canvas
+# canvas 設定
if $tk_version =~ /^4\.[01]/
$floor2_canvas_frame = TkFrame.new(base_frame,'bd'=>2,'relief'=>'sunken',
'highlightthickness'=>2)
diff --git a/ext/tk/sample/demos-jp/form.rb b/ext/tk/sample/demos-jp/form.rb
index 84ed94de88..000fcb5091 100644
--- a/ext/tk/sample/demos-jp/form.rb
+++ b/ext/tk/sample/demos-jp/form.rb
@@ -1,15 +1,15 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# form widget demo (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($form_demo) && $form_demo
$form_demo.destroy
$form_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$form_demo = TkToplevel.new {|w|
title("Form Demonstration")
iconname("form")
@@ -18,20 +18,20 @@ $form_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($form_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label 生成
msg = TkLabel.new(base_frame) {
font $font
wraplength '4i'
justify 'left'
- text "ΥɥϴñʥեѤˤʤäƤơޤޤʥȥϤǤޤ֤ǥȥؤǤޤ"
+ text "このウィンドウは簡単なフォーム入力用になっていて、さまざまなエントリに入力ができます。タブでエントリの切替えができます。"
}
msg.pack('side'=>'top', 'fill'=>'x')
-# frame
+# frame 生成
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $form_demo
$form_demo = nil
@@ -40,12 +40,12 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'form'}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# entry
+# entry 生成
form_data = []
(1..5).each{|i|
f = TkFrame.new(base_frame, 'bd'=>2)
@@ -56,10 +56,10 @@ form_data = []
form_data[i] = {'frame'=>f, 'entry'=>e, 'label'=>l}
}
-# ʸ
-form_data[1]['label'].text('̾:')
-form_data[2]['label'].text(':')
-form_data[5]['label'].text(':')
+# 文字列設定
+form_data[1]['label'].text('名前:')
+form_data[2]['label'].text('住所:')
+form_data[5]['label'].text('電話:')
# pack
(1..5).each{|i| form_data[i]['frame'].pack('side'=>'top', 'fill'=>'x')}
diff --git a/ext/tk/sample/demos-jp/goldberg.rb b/ext/tk/sample/demos-jp/goldberg.rb
index ea521b82ec..fc38d877db 100644
--- a/ext/tk/sample/demos-jp/goldberg.rb
+++ b/ext/tk/sample/demos-jp/goldberg.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# Ruby/Tk Goldverg demo (called by 'widget')
#
@@ -63,7 +63,7 @@ msg = TkLabel.new($goldberg_demo) {
font 'Arial 10'
wraplength '4i'
justify 'left'
- text "ϡʤʬΥ˥᡼򤤤ȤΤˤǤ뤫򼨤ȤΤΥǥǤܡ򥯥åʪưϤޤ\n\n\"Man will always find a difficult means to perform a simple task\"\n - Rube Goldberg"
+ text "これは、あなたが自分のアニメーションをいかに入り組んだものにできるかを示すというだけのためのデモです。ボールをクリックすれば物が動き始めます!\n\n\"Man will always find a difficult means to perform a simple task\"\n - Rube Goldberg"
}
msg.pack('side'=>'top')
=end
@@ -72,7 +72,7 @@ msg.pack('side'=>'top')
# frame
TkFrame.new($goldberg_demo) {|frame|
TkButton.new(frame) {
- text 'Ĥ'
+ text '閉じる'
command proc{
tmppath = $goldberg_demo
$goldberg_demo = nil
@@ -81,7 +81,7 @@ TkFrame.new($goldberg_demo) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'goldberg'}
}.pack('side'=>'left', 'expand'=>'yes')
@@ -99,7 +99,7 @@ class TkGoldberg_Demo
@S['speed'] = TkVariable.new(5)
@S['cnt'] = TkVariable.new(0)
# @S['message'] = TkVariable.new("\\nWelcome\\nto\\nRuby/Tk")
- @S['message'] = TkVariable.new("\\n 褦\\nRuby/Tk\\n\\n")
+ @S['message'] = TkVariable.new("\\n ようこそ!\\nRuby/Tk\\nの\\n世界へ")
@S['pause'] = TkVariable.new
@S['details'] = TkVariable.new(true)
@@ -184,7 +184,7 @@ class TkGoldberg_Demo
font 'Arial 10'
wraplength 600
justify 'left'
- text "ϡʤʬΥ˥᡼򤤤ȤΤˤǤ뤫򼨤ȤΤΥǥǤܡ򥯥åʪưϤޤ\n\"Man will always find a difficult means to perform a simple task\" - Rube Goldberg"
+ text "これは、あなたが自分のアニメーションをいかに入り組んだものにできるかを示すというだけのためのデモです。ボールをクリックすれば物が動き始めます!\n\"Man will always find a difficult means to perform a simple task\" - Rube Goldberg"
}
msg.place(:in=>@canvas, :relx=>0, :rely=>0, :anchor=>:nw)
@@ -192,7 +192,7 @@ class TkGoldberg_Demo
# TkButton.new(frame, :bg=>@C['bg'], :activebackground=>@C['bg']) {
Tk::Button.new(frame, :bg=>@C['bg'], :activebackground=>@C['bg']) {
- text 'Ĥ'
+ text '閉じる'
command proc{
tmppath = $goldberg_demo
$goldberg_demo = nil
@@ -202,7 +202,7 @@ class TkGoldberg_Demo
# TkButton.new(frame, :bg=>@C['bg'], :activebackground=>@C['bg']) {
Tk::Button.new(frame, :bg=>@C['bg'], :activebackground=>@C['bg']) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'goldberg'}
}.pack('side'=>'left', 'padx'=>5)
@@ -420,7 +420,7 @@ class TkGoldberg_Demo
color = @C['0']
TkcText.new(@canvas,
# [579, 119], :text=>'START HERE!',
- [558, 119], :text=>'饹ȡ',
+ [558, 119], :text=>'ここからスタート!',
:fill=>color, :anchor=>:w,
:tag=>'I0', :font=>['Times Roman', 12, :italic, :bold])
TkcLine.new(@canvas, [719, 119, 763, 119], :tag=>'I0', :fill=>color,
@@ -1792,7 +1792,7 @@ class TkGoldberg_Demo
@canvas.delete('I24', 'I26')
TkcText.new(@canvas, 430, 735, :anchor=>:s, :tag=>'I26',
#:text=>'click to continue',
- :text=>'åǥꥻåȤޤ',
+ :text=>'クリックでリセットします',
:font=>['Times Roman', 20, :bold])
@canvas.bind('1', proc{reset})
return 4
diff --git a/ext/tk/sample/demos-jp/hello b/ext/tk/sample/demos-jp/hello
index 08f154d499..e942f3d851 100644
--- a/ext/tk/sample/demos-jp/hello
+++ b/ext/tk/sample/demos-jp/hello
@@ -1,10 +1,10 @@
#!/usr/bin/env ruby
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
require 'tk'
TkButton.new(nil,
- 'text'=>"ˤϡ",
- 'command'=>proc{print "ˤϡ\n"; exit}
+ 'text'=>"こんにちは、世界",
+ 'command'=>proc{print "こんにちは、世界\n"; exit}
).pack
Tk.mainloop
diff --git a/ext/tk/sample/demos-jp/hscale.rb b/ext/tk/sample/demos-jp/hscale.rb
index 5615aa50bd..2dfbf38272 100644
--- a/ext/tk/sample/demos-jp/hscale.rb
+++ b/ext/tk/sample/demos-jp/hscale.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
require "tkcanvas"
if defined?($hscale_demo) && $hscale_deom
@@ -18,16 +18,16 @@ msg = TkLabel.new(base_frame) {
font $font
wraplength '3.5i'
justify 'left'
- text "ˤ1Ĥȿʿʥ뤬ɽƤޤ\
-ǥޥܥ1򥯥åޤϥɥå\
-ĹѤ뤳ȤǤޤ"
+ text "下には矢印が1つと水平なスケールが表示されています。\
+スケール上でマウスボタン1をクリック、またはドラッグすると\
+矢印の長さを変えることができます。"
}
msg.pack('side'=>'top')
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc {
tmppath = $hscale_demo
$hscale_demo = nil
@@ -36,7 +36,7 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc { showCode 'hscale' }
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
diff --git a/ext/tk/sample/demos-jp/icon.rb b/ext/tk/sample/demos-jp/icon.rb
index 935519435b..6b9e1a570a 100644
--- a/ext/tk/sample/demos-jp/icon.rb
+++ b/ext/tk/sample/demos-jp/icon.rb
@@ -1,15 +1,15 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# iconic button widget demo (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($icon_demo) && $icon_demo
$icon_demo.destroy
$icon_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$icon_demo = TkToplevel.new {|w|
title("Iconic Button Demonstration")
iconname("icon")
@@ -18,20 +18,20 @@ $icon_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($icon_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label 生成
msg = TkLabel.new(base_frame) {
font $font
wraplength '5i'
justify 'left'
- text "Υɥˤϥ饸ܥȥåܥ˥ӥåȥޥåפɽ 3 Ĥˡ򼨤ƤޤˤΤ2ĤΥ饸ܥǡ줾줬ӥåȥޥåפ򼨤󥸥ǤǤƤޤˤΤϡѤߤɤˤäưۤʤɽåܥǤ¦ˤΤѤߤɤˤäطʿѤӥåȥޥåפɽåܥǤ"
+ text "このウィンドウにはラジオボタンとチェックボタン上にビットマップや画像を表示する 3 つの方法を示しています。左にあるのは2つのラジオボタンで、それぞれが、ビットマップと選択を示すインジケータでできています。中央にあるのは、選択済みかどうかによって異なる画像を表示するチェックボタンです。右側にあるのは選択済みかどうかによって背景色が変わるビットマップを表示するチェックボタンです。"
}
msg.pack('side'=>'top')
-# frame
+# frame 生成
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $icon_demo
$icon_demo = nil
@@ -40,13 +40,13 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'icon'}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# image
+# image 生成
flagup = \
TkBitmapImage.new('file'=>[$demo_dir,'..',
'images','flagup.xbm'].join(File::Separator),
@@ -59,10 +59,10 @@ TkBitmapImage.new('file'=>[$demo_dir,'..',
[$demo_dir,'..',
'images','flagdown.xbm'].join(File::Separator))
-# ѿ
+# 変数生成
letters = TkVariable.new
-# frame
+# frame 生成
TkFrame.new(base_frame, 'borderwidth'=>10){|w|
TkFrame.new(w) {|f|
# TkRadioButton.new(f){
diff --git a/ext/tk/sample/demos-jp/image1.rb b/ext/tk/sample/demos-jp/image1.rb
index 10078c6c22..0c69b2a45f 100644
--- a/ext/tk/sample/demos-jp/image1.rb
+++ b/ext/tk/sample/demos-jp/image1.rb
@@ -1,15 +1,15 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# two image widgets demo (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($image1_demo) && $image1_demo
$image1_demo.destroy
$image1_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$image1_demo = TkToplevel.new {|w|
title('Image Demonstration #1')
iconname("Image1")
@@ -18,20 +18,20 @@ $image1_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($image1_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label 生成
msg = TkLabel.new(base_frame) {
font $font
wraplength '4i'
justify 'left'
- text "ΥǥǤ2ĤΥ٥˲򤽤줾ɽƤޤ"
+ text "このデモでは2つのラベル上に画像をそれぞれ表示しています。"
}
msg.pack('side'=>'top')
-# frame
+# frame 生成
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $image1_demo
$image1_demo = nil
@@ -40,13 +40,13 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'image1'}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# image
+# image 生成
image1a = \
TkPhotoImage.new('file'=>[$demo_dir,'..',
'images','earth.gif'].join(File::Separator))
@@ -54,7 +54,7 @@ image1b = \
TkPhotoImage.new('file'=>[$demo_dir,'..',
'images','earthris.gif'].join(File::Separator))
-# label
+# label 生成
#[ TkLabel.new(base_frame, 'image'=>image1a, 'bd'=>1, 'relief'=>'sunken'),
# TkLabel.new(base_frame, 'image'=>image1b, 'bd'=>1, 'relief'=>'sunken')
#].each{|w| w.pack('side'=>'top', 'padx'=>'.5m', 'pady'=>'.5m')}
diff --git a/ext/tk/sample/demos-jp/image2.rb b/ext/tk/sample/demos-jp/image2.rb
index 3e8b87461f..aa507c5b9b 100644
--- a/ext/tk/sample/demos-jp/image2.rb
+++ b/ext/tk/sample/demos-jp/image2.rb
@@ -1,15 +1,15 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# widget demo 'load image' (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($image2_demo) && $image2_demo
$image2_demo.destroy
$image2_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$image2_demo = TkToplevel.new {|w|
title('Image Demonstration #2')
iconname("Image2")
@@ -18,20 +18,20 @@ $image2_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($image2_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label 生成
msg = TkLabel.new(base_frame) {
font $font
wraplength '4i'
justify 'left'
- text "ΥǥǤTk photo image ѤƲ򸫤뤳ȤǤޤǽ˥ȥˤ˥ǥ쥯ȥ̾Ʋ˲ΥꥹȥܥåˤΥǥ쥯ȥɤ뤿ᡢ꥿򲡤Ƥθ塢򤹤뤿˥ꥹȥܥåΥե֥̾륯åƲ"
+ text "このデモではTkの photo image を使用して画像を見ることができます。最初にエントリ内ににディレクトリ名を入れて下さい。次に下のリストボックスにこのディレクトリをロードするため、リターンを押してください。その後、画像を選択するためにリストボックスの中のファイル名をダブルクリックして下さい。"
}
msg.pack('side'=>'top')
-# frame
+# frame 生成
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $image2_demo
$image2_demo = nil
@@ -40,20 +40,20 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'image2'}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# ѿ
+# 変数生成
$dirName = TkVariable.new([$demo_dir,'..','images'].join(File::Separator))
-# image
+# image 生成
$image2a = TkPhotoImage.new
-# ե̾
-TkLabel.new(base_frame, 'text'=>'ǥ쥯ȥ:')\
+# ファイル名入力部
+TkLabel.new(base_frame, 'text'=>'ディレクトリ:')\
.pack('side'=>'top', 'anchor'=>'w')
image2_e = TkEntry.new(base_frame) {
@@ -64,7 +64,7 @@ image2_e = TkEntry.new(base_frame) {
TkFrame.new(base_frame, 'height'=>'3m', 'width'=>20)\
.pack('side'=>'top', 'anchor'=>'w')
-TkLabel.new(base_frame, 'text'=>'ե:')\
+TkLabel.new(base_frame, 'text'=>'ファイル:')\
.pack('side'=>'top', 'anchor'=>'w')
TkFrame.new(base_frame){|w|
@@ -85,14 +85,14 @@ TkFrame.new(base_frame){|w|
}.pack('side'=>'top', 'anchor'=>'w')
-# image
+# image 配置
[ TkFrame.new(base_frame, 'height'=>'3m', 'width'=>20),
- TkLabel.new(base_frame, 'text'=>':'),
+ TkLabel.new(base_frame, 'text'=>'画像:'),
# TkLabel.new(base_frame, 'image'=>$image2a)
Tk::Label.new(base_frame, 'image'=>$image2a)
].each{|w| w.pack('side'=>'top', 'anchor'=>'w')}
-# ᥽å
+# メソッド定義
def loadDir(w)
w.delete(0,'end')
Dir.glob([$dirName,'*'].join(File::Separator)).sort.each{|f|
diff --git a/ext/tk/sample/demos-jp/image3.rb b/ext/tk/sample/demos-jp/image3.rb
index 625e69a21d..5c1ceb2816 100644
--- a/ext/tk/sample/demos-jp/image3.rb
+++ b/ext/tk/sample/demos-jp/image3.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
# image3.rb
#
# This demonstration script creates a simple collection of widgets
@@ -56,15 +56,15 @@ msg = TkLabel.new(base_frame) {
font $font
wraplength '4i'
justify 'left'
- text "ΥǥǤTk photo image ѤƲ 뤳ȤǤޤǽ˥ȥˤ˥ǥ쥯ȥ̾Ʋ˲ΥꥹȥܥåˤΥǥ쥯ȥɤ뤿ᡢ꥿򲡤Ƥθ塢򤹤뤿˥ꥹȥܥåΥե֥̾륯åƲ"
+ text "このデモではTkの photo image を使用して画像を 見ることができます。最初にエントリ内ににディレクトリ名を入れて下さい。次に下のリストボックスにこのディレクトリをロードするため、リターンを押してください。その後、画像を選択するためにリストボックスの中のファイル名をダブルクリックして下さい。"
}
msg.pack('side'=>'top')
# frame
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $image3_demo
$image3_demo = nil
@@ -73,7 +73,7 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'image3'}
}.pack('side'=>'left', 'expand'=>'yes')
@@ -92,9 +92,9 @@ $image3a = TkPhotoImage.new
#
image3_f = TkFrame.new(base_frame).pack(:fill=>:both, :expand=>true)
-image3_df = TkLabelFrame.new(base_frame, :text=>'ǥ쥯ȥ:')
+image3_df = TkLabelFrame.new(base_frame, :text=>'ディレクトリ:')
-image3_ff = TkLabelFrame.new(base_frame, :text=>'ե:',
+image3_ff = TkLabelFrame.new(base_frame, :text=>'ファイル:',
:padx=>'2m', :pady=>'2m')
image3_lbx = TkListbox.new(image3_ff, :width=>20, :height=>10) {
pack(:side=>:left, :fill=>:y, :expand=>true)
@@ -109,12 +109,12 @@ image3_ent = TkEntry.new(image3_df, :width=>30, :textvariable=>$dirName){
bind('Return', proc{loadDir3(image3_lbx)})
}
-TkButton.new(image3_df, :pady=>0, :padx=>'2m', :text=>"ǥ쥯ȥ",
+TkButton.new(image3_df, :pady=>0, :padx=>'2m', :text=>"ディレクトリ選択",
:command=>proc{selectAndLoadDir3(image3_ent, image3_lbx)}) {
pack(:side=>:left, :fill=>:y, :padx=>[0, '2m'], :pady=>'2m')
}
-image3_if = TkLabelFrame.new(base_frame, :text=>'᡼:') {|f|
+image3_if = TkLabelFrame.new(base_frame, :text=>'イメージ:') {|f|
# TkLabel.new(f, :image=>$image3a).pack(:padx=>'2m', :pady=>'2m')
Tk::Label.new(f, :image=>$image3a).pack(:padx=>'2m', :pady=>'2m')
}
diff --git a/ext/tk/sample/demos-jp/items.rb b/ext/tk/sample/demos-jp/items.rb
index 4440905db8..b1d66f367b 100644
--- a/ext/tk/sample/demos-jp/items.rb
+++ b/ext/tk/sample/demos-jp/items.rb
@@ -1,15 +1,15 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# canvas item types widget demo (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($items_demo) && $items_demo
$items_demo.destroy
$items_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$items_demo = TkToplevel.new {|w|
title("Canvas Item Demonstration")
iconname("Items")
@@ -18,19 +18,19 @@ $items_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($items_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label 生成
TkLabel.new(base_frame) {
font $font
wraplength '5i'
justify 'left'
- text "ΥɥˤϥХ widget äƤꡢˤϥХ widget ݡȤ͡ʥפΥƥ㤬äƤޤΤ褦Ǥޤ\n ܥ-1 ɥå:\tƥư\n ܥ-2 ɥå:\tƤʬ򤺤餹\n ܥ-3 ɥå:\tΰϤ\n ȥ-F:\tΰβΥƥɽ롣"
+ text "このウィンドウにはキャンバス widget が入っており、その中にはキャンバス widget がサポートする様々なタイプのアイテムの例が入っています。次のような操作ができます。\n ボタン-1 ドラッグ:\tアイテムを動かす。\n ボタン-2 ドラッグ:\t見えている部分をずらす。\n ボタン-3 ドラッグ:\t領域を囲う。\n コントロール-F:\t領域の下のアイテムを表示する。"
}.pack('side'=>'top')
-# frame
+# frame 生成
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $items_demo
$items_demo = nil
@@ -39,15 +39,15 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'items'}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# frame
+# frame 生成
cvs = nil
TkFrame.new(base_frame) {|cf|
- # canvas
+ # canvas 生成
cvs = TkCanvas.new(cf) {|c|
focus
scrollregion '0c 0c 30c 24c'
@@ -113,11 +113,11 @@ else
green = 'black'
end
-# tag ֥Ȥ
+# tag オブジェクトを生成
$tag_item = TkcGroup.new(cvs)
# Set up demos within each of the areas of the grid.
-TkcText.new(cvs, '5c', '.2c', 'text'=>'饤', 'anchor'=>'n')
+TkcText.new(cvs, '5c', '.2c', 'text'=>'ライン', 'anchor'=>'n')
TkcLine.new(cvs, '1c', '1c', '3c', '1c', '1c', '4c', '3c', '4c',
'width'=>2, 'fill'=>blue, 'capstyle'=>'butt',
'join'=>'miter', 'tags'=>$tag_item )
@@ -136,7 +136,7 @@ TkcLine.new(cvs, '1c','7c','1.75c','5.8c','2.5c','7c','3.25c','5.8c','4c','7c',
'tags'=>$tag_item )
TkcText.new(cvs, '15c', '.2c',
- 'text'=>' (餫ˤĤʤľ)', 'anchor'=>'n')
+ 'text'=>'曲線 (滑らかにつないだ直線)', 'anchor'=>'n')
TkcLine.new(cvs, '11c','4c','11.5c','1c','13.5c','1c','14c','4c',
'smooth'=>'on', 'fill'=>blue, 'tags'=>$tag_item )
TkcLine.new(cvs, '15.5c','1c','19.5c','1.5c','15.5c','4.5c','19.5c','4c',
@@ -148,7 +148,7 @@ TkcLine.new(cvs, '12c','6c','13.5c','4.5c','16.5c','7.5c','18c','6c',
'images', 'gray25.xbm'].join(File::Separator),
'fill'=>red, 'tags'=>$tag_item )
-TkcText.new(cvs, '25c', '.2c', 'text'=>'¿ѷ', 'anchor'=>'n')
+TkcText.new(cvs, '25c', '.2c', 'text'=>'多角形', 'anchor'=>'n')
TkcPolygon.new(cvs, '21c','1.0c','22.5c','1.75c','24c','1.0c','23.25c','2.5c',
'24c','4.0c','22.5c','3.25c','21c','4.0c','21.75c','2.5c',
'fill'=>'green', 'outline'=>'black', 'width'=>4,
@@ -163,7 +163,7 @@ TkcPolygon.new(cvs, '22c','4.5c','25c','4.5c','25c','6.75c','28c','6.75c',
'images', 'gray25.xbm'].join(File::Separator),
'outline'=>'black', 'tags'=>$tag_item )
-TkcText.new(cvs, '5c', '8.2c', 'text'=>'', 'anchor'=>'n')
+TkcText.new(cvs, '5c', '8.2c', 'text'=>'矩形', 'anchor'=>'n')
TkcRectangle.new(cvs, '1c','9.5c','4c','12.5c',
'outline'=>red, 'width'=>'3m', 'tags'=>$tag_item)
TkcRectangle.new(cvs, '0.5c','13.5c','4.5c','15.5c',
@@ -173,7 +173,7 @@ TkcRectangle.new(cvs, '6c','10c','9c','15c', 'outline'=>'',
'images','gray25.xbm'].join(File::Separator),
'fill'=>blue, 'tags'=>$tag_item )
-TkcText.new(cvs, '15c', '8.2c', 'text'=>'ʱ', 'anchor'=>'n')
+TkcText.new(cvs, '15c', '8.2c', 'text'=>'楕円', 'anchor'=>'n')
TkcOval.new(cvs, '11c','9.5c','14c','12.5c',
'outline'=>red, 'width'=>'3m', 'tags'=>$tag_item)
TkcOval.new(cvs, '10.5c','13.5c','14.5c','15.5c',
@@ -183,13 +183,13 @@ TkcOval.new(cvs, '16c','10c','19c','15c', 'outline'=>'',
'images','gray25.xbm'].join(File::Separator),
'fill'=>blue, 'tags'=>$tag_item )
-TkcText.new(cvs, '25c', '8.2c', 'text'=>'ƥ', 'anchor'=>'n')
+TkcText.new(cvs, '25c', '8.2c', 'text'=>'テキスト', 'anchor'=>'n')
TkcRectangle.new(cvs, '22.4c','8.9c','22.6c','9.1c')
TkcText.new(cvs, '22.5c', '9c', 'anchor'=>'n', 'font'=>font1, 'width'=>'4c',
- 'text'=>'ûƥȡɥåס·󥫡()ϳƥƥȤΥ󥫡ݥȤ򼨤', 'tags'=>$tag_item )
+ 'text'=>'短いテキスト。ワードラップ、左揃え、アンカーは北(上)。□は各テキストのアンカーポイントを示す。', 'tags'=>$tag_item )
TkcRectangle.new(cvs, '25.4c','10.9c','25.6c','11.1c')
TkcText.new(cvs, '25.5c', '11c', 'anchor'=>'w', 'font'=>font1, 'fill'=>blue,
- 'text'=>"Ĥιԡ\n줾Ω\n·\nƺü󥫡Ƥ롣", 'justify'=>'center', 'tags'=>$tag_item )
+ 'text'=>"いくつかの行。\nそれぞれ独立に\n行揃え。\n全て左端がアンカーされている。", 'justify'=>'center', 'tags'=>$tag_item )
TkcRectangle.new(cvs, '24.9c','13.9c','25.1c','14.1c')
if $tk_version =~ /^4\.[01]/
TkcText.new(cvs, '25c', '14c', 'anchor'=>'c', 'font'=>font2, 'fill'=>red,
@@ -202,7 +202,7 @@ else
'tags'=>$tag_item )
end
-TkcText.new(cvs, '5c', '16.2c', 'text'=>'', 'anchor'=>'n')
+TkcText.new(cvs, '5c', '16.2c', 'text'=>'弧', 'anchor'=>'n')
TkcArc.new(cvs, '0.5c','17c','7c','20c', 'fill'=>green, 'outline'=>'black',
'start'=>45, 'extent'=>270, 'style'=>'pieslice', 'tags'=>$tag_item)
#TkcArc.new(cvs, '6.5c','17c','9.5c','20c', 'width'=>'4m', 'style'=>'arc',
@@ -221,7 +221,7 @@ TkcArc.new(cvs, '5.5c','20.5c','9.5c','23.5c', 'width'=>'4m', 'style'=>'chord',
'fill'=>blue, 'outline'=>'', 'start'=>45, 'extent'=>270,
'tags'=>$tag_item)
-TkcText.new(cvs, '15c', '16.2c', 'text'=>'ӥåȥޥå', 'anchor'=>'n')
+TkcText.new(cvs, '15c', '16.2c', 'text'=>'ビットマップ', 'anchor'=>'n')
#TkcBitmap.new(cvs, '13c','20c',
# 'bitmap'=>'@' + ['images', 'face'].join(File::Separator),
# 'tags'=>$tag_item)
@@ -239,7 +239,7 @@ TkcBitmap.new(cvs, '17c','18.5c',
#TkcBitmap.new(cvs, '17c','21.5c',
# 'bitmap'=>'@' + ['images', 'letters'].join(File::Separator),
# 'tags'=>$tag_item)
-# ηǤǽ
+# ↓の形式でも可能
TkcBitmap.new(cvs, '17c','21.5c') {
bitmap '@' + [$demo_dir, '..', 'images', 'letters.xbm'].join(File::Separator)
tags $tag_item
@@ -249,15 +249,15 @@ TkcBitmap.new(cvs, '17c','21.5c') {
# tags $tag_item
#}
-TkcText.new(cvs, '25c', '16.2c', 'text'=>'ɥ', 'anchor'=>'n')
+TkcText.new(cvs, '25c', '16.2c', 'text'=>'ウィンドウ', 'anchor'=>'n')
TkButton.new(cvs) {|b|
- text 'Ƥ'
+ text '押してね'
command proc{butPress cvs, red}
TkcWindow.new(cvs, '21c','18c',
'window'=>b, 'anchor'=>'nw', 'tags'=>$tag_item)
}
TkEntry.new(cvs, 'width'=>20, 'relief'=>'sunken') {|e|
- insert 'end', 'ԽƤ'
+ insert 'end', '編集してね'
TkcWindow.new(cvs, '21c','21c',
'window'=>e, 'anchor'=>'nw', 'tags'=>$tag_item)
}
@@ -266,9 +266,9 @@ TkScale.new(cvs, 'from'=>0, 'to'=>100, 'length'=>'6c', 'sliderlength'=>'.4c',
TkcWindow.new(cvs, '28.5c','17.5c',
'window'=>scl, 'anchor'=>'n', 'tags'=>$tag_item)
}
-TkcText.new(cvs, '21c', '17.9c', 'text'=>'ܥ:', 'anchor'=>'sw')
-TkcText.new(cvs, '21c', '20.9c', 'text'=>'ȥ:', 'anchor'=>'sw')
-TkcText.new(cvs, '28.5c', '17.4c', 'text'=>':', 'anchor'=>'s')
+TkcText.new(cvs, '21c', '17.9c', 'text'=>'ボタン:', 'anchor'=>'sw')
+TkcText.new(cvs, '21c', '20.9c', 'text'=>'エントリ:', 'anchor'=>'sw')
+TkcText.new(cvs, '28.5c', '17.4c', 'text'=>'スケール:', 'anchor'=>'s')
# Set up event bindings for canvas:
cvs.itembind($tag_item, 'Any-Enter', proc{itemEnter cvs})
@@ -374,6 +374,6 @@ end
def butPress(w,color)
i = TkcText.new(w, '25c', '18.1c',
- 'text'=>'Ƥ!!', 'fill'=>color, 'anchor'=>'n')
+ 'text'=>'いてて!!', 'fill'=>color, 'anchor'=>'n')
Tk.after(500, proc{w.delete i})
end
diff --git a/ext/tk/sample/demos-jp/ixset2 b/ext/tk/sample/demos-jp/ixset2
index 5011dfe640..e11ce2ac8f 100644
--- a/ext/tk/sample/demos-jp/ixset2
+++ b/ext/tk/sample/demos-jp/ixset2
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# ixset --
# A nice interface to "xset" to change X server settings
@@ -167,15 +167,15 @@ class Xsettings
btn_frame = TkFrame.new(@root)
buttons = [
@btn_OK = TkButton.new(btn_frame, 'command'=>proc{win.ok},
- 'default'=>'active', 'text'=>'λ'),
+ 'default'=>'active', 'text'=>'了解'),
@btn_APPLY = TkButton.new(btn_frame, 'command'=>proc{win.writesettings},
- 'default'=>'normal', 'text'=>'Ŭ',
+ 'default'=>'normal', 'text'=>'適用',
'state'=>'disabled'),
@btn_CANCEL = TkButton.new(btn_frame, 'command'=>proc{win.cancel},
- 'default'=>'normal', 'text'=>'',
+ 'default'=>'normal', 'text'=>'取消',
'state'=>'disabled'),
@btn_QUIT = TkButton.new(btn_frame, 'command'=>proc{win.quit},
- 'default'=>'normal', 'text'=>'')
+ 'default'=>'normal', 'text'=>'中止')
]
buttons.each{|b| b.pack('side'=>'left', 'expand'=>'yes', 'pady'=>5) }
@@ -202,16 +202,16 @@ class Xsettings
#
# Bell settings
#
- bell = TkLabelframe.new(@root, 'text'=>'٥',
+ bell = TkLabelframe.new(@root, 'text'=>'ベル設定',
'padx'=>'1.5m', 'pady'=>'1.5m')
@w_bellvol = TkScale.new(bell, 'from'=>0, 'to'=>100, 'length'=>200,
'tickinterval'=>20, 'orient'=>'horizontal',
- 'label'=>" (%)")
+ 'label'=>"音量 (%)")
f = TkFrame.new(bell)
- @w_bellpit = LabelEntry.new(f, " (Hz)", 6, [25, 20000])
+ @w_bellpit = LabelEntry.new(f, "音程 (Hz)", 6, [25, 20000])
@w_bellpit.pack('side'=>'left', 'padx'=>5)
- @w_belldur = LabelEntry.new(f, "³ (ms)", 6, [1, 10000])
+ @w_belldur = LabelEntry.new(f, "持続時間 (ms)", 6, [1, 10000])
@w_belldur.pack('side'=>'right', 'padx'=>5)
@w_bellvol.pack('side'=>'top', 'expand'=>'yes')
@@ -222,10 +222,10 @@ class Xsettings
#
kbdonoff = nil
kbdcli = nil
- kbd = TkLabelframe.new(@root, 'text'=>'ܡɥԡ',
+ kbd = TkLabelframe.new(@root, 'text'=>'キーボードリピート設定',
'padx'=>'1.5m', 'pady'=>'1.5m')
f = TkFrame.new(kbd)
- @w_kbdonoff = TkCheckButton.new(f, 'text'=>'å',
+ @w_kbdonoff = TkCheckButton.new(f, 'text'=>'クリック音あり',
'relief'=>'flat',
'onvalue'=>'on', 'offvalue'=>'off',
'variable'=>@w_kbdrep ) {
@@ -240,7 +240,7 @@ class Xsettings
}
@w_kbdcli = TkScale.new(f, 'from'=>0, 'to'=>100, 'length'=>200,
'tickinterval'=>20, 'orient'=>'horizontal',
- 'label'=>'å (%)')
+ 'label'=>'クリック音量 (%)')
@w_kbdcli.pack('side'=>'left', 'expand'=>'yes',
'fill'=>'x', 'padx'=>['1m', 0])
f.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2, 'fill'=>'x')
@@ -248,21 +248,21 @@ class Xsettings
#
# Mouse settings
#
- mouse = TkLabelframe.new(@root, 'text'=>'ޥ',
+ mouse = TkLabelframe.new(@root, 'text'=>'マウス設定',
'padx'=>'1.5m', 'pady'=>'1.5m')
f = TkFrame.new(mouse)
- @w_mouseacc = LabelEntry.new(f, '®', 5)
+ @w_mouseacc = LabelEntry.new(f, '加速量', 5)
@w_mouseacc.pack('side'=>'left', 'padx'=>[0, '1m'])
- @w_mousethr = LabelEntry.new(f, ' (pixels)', 3, [1, 2000])
+ @w_mousethr = LabelEntry.new(f, '閾値 (pixels)', 3, [1, 2000])
@w_mousethr.pack('side'=>'right', 'padx'=>['1m', 0])
f.pack('side'=>'top', 'expand'=>'yes')
#
# Screen Saver settings
#
- screen = TkLabelframe.new(@root, 'text'=>'꡼󥻡',
+ screen = TkLabelframe.new(@root, 'text'=>'スクリーンセーバ設定',
'padx'=>'1.5m', 'pady'=>'1.5m')
- @w_screenblank = TkRadioButton.new(screen, 'text'=>'֥ɽ',
+ @w_screenblank = TkRadioButton.new(screen, 'text'=>'ブランク表示',
'relief'=>'flat', 'anchor'=>'w',
'variable'=>@w_screenbla,
'value'=>'blank') {
@@ -275,7 +275,7 @@ class Xsettings
end
}
- @w_screenpat = TkRadioButton.new(screen, 'text'=>'ѥɽ',
+ @w_screenpat = TkRadioButton.new(screen, 'text'=>'パターン表示',
'relief'=>'flat', 'anchor'=>'w',
'variable'=>@w_screenbla,
'value'=>'noblank') {
@@ -288,8 +288,8 @@ class Xsettings
end
}
- @w_screentim = LabelEntry.new(screen, 'ॢ (s)', 5, [1, 100000])
- @w_screencyc = LabelEntry.new(screen, ' (s)', 5, [1, 100000])
+ @w_screentim = LabelEntry.new(screen, 'タイムアウト (s)', 5, [1, 100000])
+ @w_screencyc = LabelEntry.new(screen, '周期 (s)', 5, [1, 100000])
Tk.grid(@w_screenblank, @w_screentim, 'sticky'=>'e')
Tk.grid(@w_screenpat, @w_screencyc, 'sticky'=>'e')
diff --git a/ext/tk/sample/demos-jp/knightstour.rb b/ext/tk/sample/demos-jp/knightstour.rb
index ae0f13076e..835a24c392 100644
--- a/ext/tk/sample/demos-jp/knightstour.rb
+++ b/ext/tk/sample/demos-jp/knightstour.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# Based on the widget demo of Tcl/Tk8.5.2
# The following is the original copyright text.
@@ -94,13 +94,13 @@ class Knights_Tour
@start_btn.state :normal
if @visited.length == 64
if @initial == square
- @log.insert :end, 'ͷ(closed tour)'
+ @log.insert :end, '周遊(closed tour)成功!'
else
- @log.insert :end, "\n", {}
+ @log.insert :end, "成功\n", {}
Tk.after(@delay.numeric * 2){tour(rand(64))} if @continuous.bool
end
else
- @log.insert :end, "ԡ\n", {}
+ @log.insert :end, "失敗!\n", {}
end
end
end
@@ -158,10 +158,10 @@ class Knights_Tour
sep = Ttk::Separator.new(frame)
Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
TkGrid('x',
- Ttk::Button.new(frame, :text=>'ɻ',
+ Ttk::Button.new(frame, :text=>'コード参照',
:image=>$image['view'], :compound=>:left,
:command=>proc{showCode 'knightstour'}),
- Ttk::Button.new(frame, :text=>'Ĥ',
+ Ttk::Button.new(frame, :text=>'閉じる',
:image=>$image['delete'], :compound=>:left,
:command=>proc{
$knightstour.destroy
@@ -187,14 +187,14 @@ class Knights_Tour
@continuous = TkVariable.new(false)
tool_f = Ttk::Frame.new($knightstour)
- label = Ttk::Label.new(tool_f, :text=>'¹®')
+ label = Ttk::Label.new(tool_f, :text=>'実行速度')
scale = Ttk::Scale.new(tool_f, :from=>8, :to=>2000, :variable=>@delay,
:command=>proc{|n| set_delay(n)})
- check = Ttk::Checkbutton.new(tool_f, :text=>'ȿ',
+ check = Ttk::Checkbutton.new(tool_f, :text=>'反復',
:variable=>@continuous)
- @start_btn = Ttk::Button.new(tool_f, :text=>'',
+ @start_btn = Ttk::Button.new(tool_f, :text=>'開始',
:command=>proc{tour()})
- @exit_btn = Ttk::Button.new(tool_f, :text=>'λ',
+ @exit_btn = Ttk::Button.new(tool_f, :text=>'終了',
:command=>proc{_exit()})
7.downto(0){|row|
diff --git a/ext/tk/sample/demos-jp/label.rb b/ext/tk/sample/demos-jp/label.rb
index 19105e6f71..700e6a61ce 100644
--- a/ext/tk/sample/demos-jp/label.rb
+++ b/ext/tk/sample/demos-jp/label.rb
@@ -1,15 +1,15 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# label widget demo (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($label_demo) && $label_demo
$label_demo.destroy
$label_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$label_demo = TkToplevel.new {|w|
title("Label Demonstration")
iconname("label")
@@ -18,20 +18,20 @@ $label_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($label_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label 生成
msg = TkLabel.new(base_frame) {
font $font
wraplength '4i'
justify 'left'
- text "ˤ5ĤΥ٥뤬ɽƤޤ¦ˤϥƥȥ٥뤬3Ĥꡢ¦ˤϥӥåȥޥåץ٥ȥƥȥ٥뤬ޤ٥ȤΤϤޤ򤤤ΤǤϤޤ󡣤ʤʤįʳǤʤǤ"
+ text "下には5つのラベルが表示されています。左側にはテキストラベルが3つあり、右側にはビットマップラベルとテキストラベルがあります。ラベルというのはあまり面白いものではありません。なぜなら眺める以外何もできないからです。"
}
msg.pack('side'=>'top')
-# frame
+# frame 生成
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $label_demo
$label_demo = nil
@@ -40,23 +40,23 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'label'}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# label demo ѥե졼
+# label demo 用フレーム生成
f_left = TkFrame.new(base_frame)
f_right = TkFrame.new(base_frame)
[f_left, f_right].each{|w| w.pack('side'=>'left', 'expand'=>'yes',
'padx'=>10, 'pady'=>10, 'fill'=>'both')}
-# label
-[ TkLabel.new(f_left, 'text'=>'ǽΥ٥'),
- TkLabel.new(f_left, 'text'=>'2 ܡä⤭夬餻Ƥߤޤ',
+# label 生成
+[ TkLabel.new(f_left, 'text'=>'最初のラベル'),
+ TkLabel.new(f_left, 'text'=>'2 番目。ちょっと浮き上がらせてみました',
'relief'=>'raised'),
- TkLabel.new(f_left, 'text'=>'3 ܡǤޤ ', 'relief'=>'sunken')
+ TkLabel.new(f_left, 'text'=>'3 番目。沈んでいます ', 'relief'=>'sunken')
].each{|w| w.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2, 'anchor'=>'w')}
# TkLabel.new(f_right) {
@@ -66,4 +66,4 @@ Tk::Label.new(f_right) {
relief 'sunken'
}.pack('side'=>'top')
-TkLabel.new(f_right) { text 'Tcl/Tk ͭ' }.pack('side'=>'top')
+TkLabel.new(f_right) { text 'Tcl/Tk 所有者' }.pack('side'=>'top')
diff --git a/ext/tk/sample/demos-jp/labelframe.rb b/ext/tk/sample/demos-jp/labelframe.rb
index cee504f4b6..80e106c6e7 100644
--- a/ext/tk/sample/demos-jp/labelframe.rb
+++ b/ext/tk/sample/demos-jp/labelframe.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# labelframe.rb
#
@@ -25,28 +25,28 @@ base_frame = TkFrame.new($labelframe_demo).pack(:fill=>:both, :expand=>true)
TkLabel.new(base_frame,
:font=>$font, :wraplength=>'4i', :justify=>:left,
:text=><<EOL).pack(:side=>:top)
-TkLabelFrame åȤϴϢ widget
-ޤȤƼ갷Ѥޤ
-٥̾ʸǤⲿ餫Υå
-Ǥ⤫ޤޤ󡣤⤷ʤȤäƤ
-Ruby ˥󥯤Ƥ Tk 饤֥꤬
-labelframe åȤƤʤ
-硢ΥǥϤޤưʤϤǤ
-ξˤ labelframe åȤ
-Ƥ褦ʤ꿷С Tk
-Ȥ߹碌ƻ褦ˤƤ
+TkLabelFrame ウィジェットは関連する widget
+群をまとめて取り扱うために用いられます。ラ
+ベルは通常の文字列でも何らかのウィジェット
+でもかまいません。もしあなたが使っている
+Ruby にリンクされている Tk ライブラリが
+labelframe ウィジェットを実装していない
+場合、このデモはうまく動かないはずです。
+その場合には labelframe ウィジェットが実装
+されているようなより新しいバージョンの Tk
+を組み合わせて試すようにしてください。
EOL
# The bottom buttons
TkFrame.new(base_frame){|f|
pack(:side=>:bottom, :fill=>:x, :pady=>'2m')
- TkButton.new(f, :text=>'Ĥ', :width=>15, :command=>proc{
+ TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{
$labelframe_demo.destroy
$labelframe_demo = nil
}).pack(:side=>:left, :expand=>true)
- TkButton.new(f, :text=>'ɻ', :width=>15, :command=>proc{
+ TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{
showCode 'labelframe'
}).pack(:side=>:left, :expand=>true)
}
@@ -56,7 +56,7 @@ w = TkFrame.new(base_frame).pack(:side=>:bottom, :fill=>:both,
:expand=>true)
# A group of radiobuttons in a labelframe
-TkLabelFrame.new(w, :text=>'',
+TkLabelFrame.new(w, :text=>'選択値',
:padx=>2, :pady=>2) {|f|
grid(:row=>0, :column=>0, :pady=>'2m', :padx=>'2m')
@@ -86,13 +86,13 @@ end
TkLabelFrame.new(w, :pady=>2, :padx=>2){|f|
TkCheckButton.new(f, :widgetname=>'cb', :variable=>$lfdummy,
- :text=>"ץ", :padx=>0) {|cb|
+ :text=>"オプションを使用", :padx=>0) {|cb|
command proc{lfEnableButtons(f)}
f.labelwidget(cb)
}
grid(:row=>0, :column=>1, :pady=>'2m', :padx=>'2m')
- %w(ץ1 ץ2 ץ3).each{|str|
+ %w(オプション1 オプション2 オプション3).each{|str|
TkCheckbutton.new(f, :text=>str).pack(:side=>:top, :fill=>:x, :pady=>2)
}
diff --git a/ext/tk/sample/demos-jp/mclist.rb b/ext/tk/sample/demos-jp/mclist.rb
index 37f5dfa8eb..67cec638eb 100644
--- a/ext/tk/sample/demos-jp/mclist.rb
+++ b/ext/tk/sample/demos-jp/mclist.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# mclist.rb --
#
@@ -24,16 +24,16 @@ base_frame = TkFrame.new($mclist_demo).pack(:fill=>:both, :expand=>true)
Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i',
:justify=>:left, :anchor=>'n', :padding=>[10, 2, 10, 6],
:text=><<EOL).pack(:fill=>:x)
-TtkȤϡơ޻ǽʿåȽǤ\
-Ttk::TreeviewåȤ\
-TtkåȥåȤ˴ޤޤ륦åȤΰĤǡ\
-줬ݻڹ¤ΥǡΤΤޤǤɽ뤳Ȥʤ\
-ޥɽ뤳ȤǤޤ
-ΥץϡʣΥäꥹȥܥåñǤ
-ƥΥȥ(heading)򥯥åС\
-Υξ˴ŤƥꥹȤ¤ؤʤϤǤ\
-ޤΥȥ֤ζڤʬɥå뤳Ȥǡ\
-ѹ뤳ȤǽǤ
+Ttkとは,テーマ指定可能な新しいウィジェット集合です.\
+Ttk::Treeviewウィジェットは\
+Ttkウィジェットセットに含まれるウィジェットの一つで,\
+それが保持する木構造のデータそのものまでは表示することなく,\
+示したい情報をマルチカラムで表示させることができます.
+このサンプルは,複数のカラムを持ったリストボックスを作成する簡単な例です.
+各カラムのタイトル(heading)をクリックすれば,\
+そのカラムの情報に基づいてリストの並べ替えがなされるはずです.\
+また,カラムのタイトル間の区切り部分をドラッグすることで,\
+カラムの幅を変更することも可能です.
EOL
## See Code / Dismiss
@@ -41,10 +41,10 @@ Ttk::Frame.new(base_frame) {|frame|
sep = Ttk::Separator.new(frame)
Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
TkGrid('x',
- Ttk::Button.new(frame, :text=>'ɻ',
+ Ttk::Button.new(frame, :text=>'コード参照',
:image=>$image['view'], :compound=>:left,
:command=>proc{showCode 'mclist'}),
- Ttk::Button.new(frame, :text=>'Ĥ',
+ Ttk::Button.new(frame, :text=>'閉じる',
:image=>$image['delete'], :compound=>:left,
:command=>proc{
$mclist_demo.destroy
@@ -74,27 +74,27 @@ container.grid_rowconfigure(0, :weight=>1)
## The data we're going to insert
data = [
- ['를', '֥Υ쥹', 'ARS'],
- ['ȥꥢ', '٥', 'AUD'],
- ['֥饸', '֥饸ꥢ', 'BRL'],
- ['ʥ', '', 'CAD'],
- ['', '̵', 'CNY'],
- ['ե', 'ѥ', 'EUR'],
- ['ɥ', '٥', 'EUR'],
- ['', '˥塼ǥ꡼', 'INR'],
- ['ꥢ', '', 'EUR'],
- ['', '', 'JPY'],
- ['ᥭ', 'ᥭƥ', 'MXN'],
- ['', '⥹', 'RUB'],
- ['եꥫ', 'ץȥꥢ', 'ZAR'],
- ['ѹ', 'ɥ', 'GBP'],
- ['ꥫ', '亮ȥ D.C.', 'USD'],
+ ['アルゼンチン', 'ブエノスアイレス', 'ARS'],
+ ['オーストラリア', 'キャンベラ', 'AUD'],
+ ['ブラジル', 'ブラジリア', 'BRL'],
+ ['カナダ', 'オタワ', 'CAD'],
+ ['中国', '北京', 'CNY'],
+ ['フランス', 'パリ', 'EUR'],
+ ['ドイツ', 'ベルリン', 'EUR'],
+ ['インド', 'ニューデリー', 'INR'],
+ ['イタリア', 'ローマ', 'EUR'],
+ ['日本', '東京', 'JPY'],
+ ['メキシコ', 'メキシコシティ', 'MXN'],
+ ['ロシア', 'モスクワ', 'RUB'],
+ ['南アフリカ', 'プレトリア', 'ZAR'],
+ ['英国', 'ロンドン', 'GBP'],
+ ['アメリカ', 'ワシントン D.C.', 'USD'],
]
## Code to insert the data nicely
font = Ttk::Style.lookup(tree[:style], :font)
cols = %w(country capital currency)
-cols.zip(%w(̾ ̲)).each{|col, name|
+cols.zip(%w(国名 首都 通貨)).each{|col, name|
tree.heading_configure(col, :text=>name,
:command=>proc{sort_by(tree, col, false)})
tree.column_configure(col, :width=>TkFont.measure(font, name))
diff --git a/ext/tk/sample/demos-jp/menu.rb b/ext/tk/sample/demos-jp/menu.rb
index e38a467000..05ea7a9ec2 100644
--- a/ext/tk/sample/demos-jp/menu.rb
+++ b/ext/tk/sample/demos-jp/menu.rb
@@ -1,15 +1,15 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# menus widget demo (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($menu_demo) && $menu_demo
$menu_demo.destroy
$menu_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$menu_demo = TkToplevel.new {|w|
title("File Selection Dialogs")
iconname("menu")
@@ -18,7 +18,7 @@ $menu_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($menu_demo).pack(:fill=>:both, :expand=>true)
-# menu frame
+# menu frame 生成
$menu_frame = TkFrame.new(base_frame, 'relief'=>'raised', 'bd'=>2)
$menu_frame.pack('side'=>'top', 'fill'=>'x')
@@ -28,21 +28,21 @@ rescue
windowingsystem = ""
end
-# label
+# label 生成
TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left') {
if $tk_platform['platform'] == 'macintosh' ||
windowingsystem == "classic" || windowingsystem == "aqua"
- text("Υɥ͡ʥ˥塼ȥɥ˥塼鹽ƤޤCommand-X ϤȡXޥɥ³ɽƤʸʤС졼ȤäܵưԤȤǤޤ˥塼桢ǸΤΤϡΥ˥塼κǽιܤ򤹤뤳ȤΩ뤳ȤǤޤ")
+ text("このウィンドウは様々なメニューとカスケードメニューから構成されています。Command-X を入力すると、Xがコマンドキー記号に続いて表示されている文字ならば、アクセラレータを使った項目起動を行うことができます。メニュー要素中、最後のものは、そのメニューの最初の項目を選択することで独立させることができます。")
else
- text("Υɥ͡ʥ˥塼ȥɥ˥塼鹽ƤޤAlt-X ϤȡX˥塼˥饤դɽƤʸʤСܡɤλ꤬Ǥޤǥ˥塼ΥȥСǽǤ˥塼ꤵ줿ݤˤϡڡǼ¹Ԥ뤳ȤǤޤ뤤ϡ饤դʸϤ뤳ȤǤ¹ԤǤޤ˥塼Υȥ꤬졼äƤϡΥ졼Ϥ뤳Ȥǥ˥塼ꤹ뤳Ȥʤ˼¹Ԥ뤳ȤǤޤ˥塼桢ǸΤΤϡΥ˥塼κǽιܤ򤹤뤳ȤΩ뤳ȤǤޤ")
+ text("このウィンドウは様々なメニューとカスケードメニューから構成されています。Alt-X を入力すると、Xがメニューにアンダーライン付きで表示されている文字ならば、キーボードからの指定ができます。矢印キーでメニューのトラバースも可能です。メニューが指定された際には、スペースキーで実行することができます。あるいは、アンダーライン付きの文字を入力することでも実行できます。メニューのエントリがアクセラレータを持っている場合は、そのアクセラレータを入力することでメニューを指定することなしに実行することができます。メニュー要素中、最後のものは、そのメニューの最初の項目を選択することで独立させることができます。")
end
}.pack('side'=>'top')
-# frame
+# frame 生成
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $menu_demo
$menu_demo = nil
@@ -51,25 +51,25 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'menu'}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# menu
+# menu 生成
TkMenubutton.new($menu_frame, 'text'=>'File', 'underline'=>0) {|m|
pack('side'=>'left')
TkMenu.new(m, 'tearoff'=>false) {|file_menu|
m.configure('menu'=>file_menu)
- add('command', 'label'=>' ...', 'command'=>proc{fail 'ϡǥǤΤ" ..."Ф륢Ƥޤ'})
- add('command', 'label'=>'', 'command'=>proc{fail 'ϡǥǤΤ""Ф륢Ƥޤ'})
- add('command', 'label'=>'¸', 'command'=>proc{fail 'ϡǥǤΤ"¸"Ф륢Ƥޤ'})
- add('command', 'label'=>'¸() ...', 'command'=>proc{fail 'ϡǥǤΤ"¸() ..."Ф륢Ƥޤ'})
+ add('command', 'label'=>'開く ...', 'command'=>proc{fail 'これは、デモですので"開く ..."に対するアクションは定義されていません。'})
+ add('command', 'label'=>'新規', 'command'=>proc{fail 'これは、デモですので"新規"に対するアクションは定義されていません。'})
+ add('command', 'label'=>'保存', 'command'=>proc{fail 'これは、デモですので"保存"に対するアクションは定義されていません。'})
+ add('command', 'label'=>'保存(指定) ...', 'command'=>proc{fail 'これは、デモですので"保存(指定) ..."に対するアクションは定義されていません。'})
add('separator')
- add('command', 'label'=>'ץ ...', 'command'=>proc{fail 'ϡǥǤΤ"ץ ..."Ф륢Ƥޤ'})
- add('command', 'label'=>'ץ ...', 'command'=>proc{fail 'ϡǥǤΤ"ץ ..."Ф륢Ƥޤ'})
+ add('command', 'label'=>'プリント設定 ...', 'command'=>proc{fail 'これは、デモですので"プリント設定 ..."に対するアクションは定義されていません。'})
+ add('command', 'label'=>'プリント ...', 'command'=>proc{fail 'これは、デモですので"プリント ..."に対するアクションは定義されていません。'})
add('separator')
- add('command', 'label'=>'λ', 'command'=>proc{$menu_demo.destroy})
+ add('command', 'label'=>'終了', 'command'=>proc{$menu_demo.destroy})
}
}
@@ -86,10 +86,10 @@ TkMenubutton.new($menu_frame, 'text'=>'Basic', 'underline'=>0) {|m|
pack('side'=>'left')
TkMenu.new(m, 'tearoff'=>false) {|basic_menu|
m.configure('menu'=>basic_menu)
- add('command', 'label'=>'⤷ʤĹȥ')
+ add('command', 'label'=>'何もしない長いエントリ')
['A','B','C','D','E','F','G'].each{|c|
- # add('command', 'label'=>"ʸ \"#{c}\" ", 'underline'=>4,
- add('command', 'label'=>"Print letter \"#{c}\" (ʸ \"#{c}\" )",
+ # add('command', 'label'=>"文字 \"#{c}\" を印字", 'underline'=>4,
+ add('command', 'label'=>"Print letter \"#{c}\" (文字 \"#{c}\" を印字)",
'underline'=>14, 'accelerator'=>"Meta+#{c}",
'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}")
$menu_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"})
@@ -101,58 +101,58 @@ TkMenubutton.new($menu_frame, 'text'=>'Cascades', 'underline'=>0) {|m|
pack('side'=>'left')
TkMenu.new(m, 'tearoff'=>false) {|cascade_menu|
m.configure('menu'=>cascade_menu)
- add('command', 'label'=>'Print hello(ˤ)',
- 'command'=>proc{print "Hello(ˤ)\n"},
+ add('command', 'label'=>'Print hello(こんにちは)',
+ 'command'=>proc{print "Hello(こんにちは)\n"},
'accelerator'=>"#{modifier}+H", 'underline'=>6)
- $menu_demo.bind("#{modifier}-h", proc{print "Hello(ˤ)\n"})
- add('command', 'label'=>'Print goodbye(褦ʤ)',
- 'command'=>proc{print "Goodbye(褦ʤ)\n"},
+ $menu_demo.bind("#{modifier}-h", proc{print "Hello(こんにちは)\n"})
+ add('command', 'label'=>'Print goodbye(さようなら)',
+ 'command'=>proc{print "Goodbye(さようなら)\n"},
'accelerator'=>"#{modifier}+G", 'underline'=>6)
- $menu_demo.bind("#{modifier}-g", proc{print "Goodbye(褦ʤ)\n"})
+ $menu_demo.bind("#{modifier}-g", proc{print "Goodbye(さようなら)\n"})
# TkMenu.new(m, 'tearoff'=>false) {|cascade_check|
TkMenu.new(cascade_menu, 'tearoff'=>false) {|cascade_check|
- cascade_menu.add('cascade', 'label'=>'Check buttons(åܥ)',
+ cascade_menu.add('cascade', 'label'=>'Check buttons(チェックボタン)',
'menu'=>cascade_check, 'underline'=>0)
oil = TkVariable.new(0)
- add('check', 'label'=>'', 'variable'=>oil)
+ add('check', 'label'=>'オイル点検', 'variable'=>oil)
trans = TkVariable.new(0)
- add('check', 'label'=>'ȥ󥹥ߥå', 'variable'=>trans)
+ add('check', 'label'=>'トランスミッション点検', 'variable'=>trans)
brakes = TkVariable.new(0)
- add('check', 'label'=>'֥졼', 'variable'=>brakes)
+ add('check', 'label'=>'ブレーキ点検', 'variable'=>brakes)
lights = TkVariable.new(0)
- add('check', 'label'=>'饤', 'variable'=>lights)
+ add('check', 'label'=>'ライト点検', 'variable'=>lights)
add('separator')
- add('command', 'label'=>'ߤͤɽ',
+ add('command', 'label'=>'現在の値を表示',
'command'=>proc{showVars($menu_demo,
- ['', oil],
- ['ȥ󥹥ߥå', trans],
- ['֥졼', brakes],
- ['饤', lights])} )
+ ['オイル点検', oil],
+ ['トランスミッション点検', trans],
+ ['ブレーキ点検', brakes],
+ ['ライト点検', lights])} )
invoke 1
invoke 3
}
#TkMenu.new(m, 'tearoff'=>false) {|cascade_radio|
TkMenu.new(cascade_menu, 'tearoff'=>false) {|cascade_radio|
- cascade_menu.add('cascade', 'label'=>'Radio buttons(饸ܥ)',
+ cascade_menu.add('cascade', 'label'=>'Radio buttons(ラジオボタン)',
'menu'=>cascade_radio, 'underline'=>0)
pointSize = TkVariable.new
- add('radio', 'label'=>'10 ݥ', 'variable'=>pointSize, 'value'=>10)
- add('radio', 'label'=>'14 ݥ', 'variable'=>pointSize, 'value'=>14)
- add('radio', 'label'=>'18 ݥ', 'variable'=>pointSize, 'value'=>18)
- add('radio', 'label'=>'24 ݥ', 'variable'=>pointSize, 'value'=>24)
- add('radio', 'label'=>'32 ݥ', 'variable'=>pointSize, 'value'=>32)
+ add('radio', 'label'=>'10 ポイント', 'variable'=>pointSize, 'value'=>10)
+ add('radio', 'label'=>'14 ポイント', 'variable'=>pointSize, 'value'=>14)
+ add('radio', 'label'=>'18 ポイント', 'variable'=>pointSize, 'value'=>18)
+ add('radio', 'label'=>'24 ポイント', 'variable'=>pointSize, 'value'=>24)
+ add('radio', 'label'=>'32 ポイント', 'variable'=>pointSize, 'value'=>32)
add('separator')
style = TkVariable.new
- add('radio', 'label'=>'ޥ', 'variable'=>style, 'value'=>'roman')
- add('radio', 'label'=>'ܡ', 'variable'=>style, 'value'=>'bold')
- add('radio', 'label'=>'å', 'variable'=>style, 'value'=>'italic')
+ add('radio', 'label'=>'ローマン', 'variable'=>style, 'value'=>'roman')
+ add('radio', 'label'=>'ボールド', 'variable'=>style, 'value'=>'bold')
+ add('radio', 'label'=>'イタリック', 'variable'=>style, 'value'=>'italic')
add('separator')
- add('command', 'label'=>'ߤͤɽ',
+ add('command', 'label'=>'現在の値を表示',
'command'=>proc{showVars($menu_demo,
- ['ݥȥ', pointSize],
- ['', style])} )
+ ['ポイントサイズ', pointSize],
+ ['スタイル', style])} )
invoke 1
invoke 7
}
@@ -167,9 +167,9 @@ TkMenubutton.new($menu_frame, 'text'=>'Icons', 'underline'=>0) {|m|
'bitmap'=>'@'+[$demo_dir,'..',
'images','pattern.xbm'].join(File::Separator),
'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry',
- 'text'=>'ʤ򤷤˥塼ιܤϥƥȤǤϤʤӥåȥޥåפɽƤޤʳǤ¾Υ˥塼ܤѤޤ',
+ 'text'=>'今あなたが選択したメニューの項目はテキストではなくビットマップを表示していました。それ以外の点では他のメニュー項目と変わりません。',
'bitmap'=>'', 'default'=>0,
- 'buttons'=>'λ')} )
+ 'buttons'=>'了解')} )
['info', 'questhead', 'error'].each{|icon|
add('command', 'bitmap'=>icon,
'command'=>proc{print "You invoked the #{icon} bitmap\n"})
@@ -181,8 +181,8 @@ TkMenubutton.new($menu_frame, 'text'=>'More', 'underline'=>0) {|m|
pack('side'=>'left')
TkMenu.new(m, 'tearoff'=>false) {|more_menu|
m.configure('menu'=>more_menu)
- [ 'ȥ','̤Υȥ','⤷ʤ','ۤȤɲ⤷ʤ',
- 'յΤ' ].each{|i|
+ [ 'エントリ','別のエントリ','何もしない','ほとんど何もしない',
+ '人生を意義あるものに' ].each{|i|
add('command', 'label'=>i,
'command'=>proc{print "You invoked \"#{i}\"\n"})
}
diff --git a/ext/tk/sample/demos-jp/menu84.rb b/ext/tk/sample/demos-jp/menu84.rb
index 094853a728..6a57279481 100644
--- a/ext/tk/sample/demos-jp/menu84.rb
+++ b/ext/tk/sample/demos-jp/menu84.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# menus widget demo (called by 'widget')
#
@@ -28,9 +28,9 @@ end
TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left') {
if $tk_platform['platform'] == 'macintosh' ||
windowingsystem == "classic" || windowingsystem == "aqua"
- text("Υɥˤϥɥ˥塼ĥ˥塼СդƤޤCommand+x ('x'ϥޥɥܥ³ɽƤʸǤ) ȥפ뤳ȤˤäƤܤεǽƤӽФȤǤޤǸΥ˥塼ϡޥǥɥγ˥ɥå뤳ȤˤäơΩѥåȤȤʤ褦ڤȤǽǤ")
+ text("このウィンドウにはカスケードメニューを持つメニューバーが付けられています。Command+x ('x'はコマンドキーシンボルに続けて表示されている文字です) とタイプすることによっても項目の機能を呼び出すことができます。最後のメニューは、マウスでウィンドウの外にドラッグすることによって、独立したパレットとなるように切り放すことが可能です。")
else
- text("Υɥˤϥɥ˥塼ĥ˥塼СդƤޤAlt+x ('x'ϥ˥塼Dz줿ʸǤ) ȥפ뤳ȤˤäƤ˥塼ƤӽФȤǤޤȤäơ˥塼֤ư뤳ȤǽǤ˥塼ɽƤˤϡ֤߰ιܤ򥹥ڡ򤷤ꡢ줿ʸϤ뤳ȤǤιܤ򤷤ꤹ뤳ȤǤޤ⤷ܤ˥졼λ꤬ʤƤʤСλꤵ줿ϤԤȤǡ˥塼ɽ뤳ȤʤľܤιܤεǽƤӽФޤǸΥ˥塼ϡ˥塼κǽιܤ򤹤뤳ȤˤäơΩѥåȤȤʤ褦ڤȤǽǤ")
+ text("このウィンドウにはカスケードメニューを持つメニューバーが付けられています。Alt+x ('x'はメニュー上で下線が引かれた文字です) とタイプすることによってもメニューを呼び出すことができます。矢印キーを使って、メニュー間を移動することも可能です。メニューが表示されている時には、現在位置の項目をスペースキーで選択したり、下線が引かれた文字を入力することでその項目を選択したりすることができます。もし項目にアクセラレータの指定がなされていたならば、その指定されたキー入力を行うことで、メニューを表示させることなく直接その項目の機能を呼び出せます。最後のメニューは、メニューの最初の項目を選択することによって、独立したパレットとなるように切り放すことが可能です。")
end
}.pack('side'=>'top')
@@ -48,8 +48,8 @@ TkFrame.new(base_frame) {|frame|
# frame
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $menu84_demo
$menu84_demo = nil
@@ -58,7 +58,7 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'menu84'}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
@@ -70,13 +70,13 @@ $menu84_frame = TkMenu.new($menu84_demo, 'tearoff'=>false)
# menu
TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
$menu84_frame.add('cascade', 'label'=>'File', 'menu'=>m, 'underline'=>0)
- add('command', 'label'=>'Open...', 'command'=>proc{fail 'ñʤǥǤ顢"Open..." ܤεǽäƤϤޤ'})
- add('command', 'label'=>'New', 'command'=>proc{fail 'ñʤǥǤ顢"New" ܤεǽäƤϤޤ'})
- add('command', 'label'=>'Save', 'command'=>proc{fail 'ñʤǥǤ顢"Save" ܤεǽäƤϤޤ'})
- add('command', 'label'=>'Save As...', 'command'=>proc{fail 'ñʤǥǤ顢"Save As..." ܤεǽäƤϤޤ'})
+ add('command', 'label'=>'Open...', 'command'=>proc{fail 'これは単なるデモですから、"Open..." 項目の機能は特に定義されてはいません。'})
+ add('command', 'label'=>'New', 'command'=>proc{fail 'これは単なるデモですから、"New" 項目の機能は特に定義されてはいません。'})
+ add('command', 'label'=>'Save', 'command'=>proc{fail 'これは単なるデモですから、"Save" 項目の機能は特に定義されてはいません。'})
+ add('command', 'label'=>'Save As...', 'command'=>proc{fail 'これは単なるデモですから、"Save As..." 項目の機能は特に定義されてはいません。'})
add('separator')
- add('command', 'label'=>'Print Setup...', 'command'=>proc{fail 'ñʤǥǤ顢"Print Setup..." ܤεǽäƤϤޤ'})
- add('command', 'label'=>'Print...', 'command'=>proc{fail 'ñʤǥǤ顢"Print..." ܤεǽäƤϤޤ'})
+ add('command', 'label'=>'Print Setup...', 'command'=>proc{fail 'これは単なるデモですから、"Print Setup..." 項目の機能は特に定義されてはいません。'})
+ add('command', 'label'=>'Print...', 'command'=>proc{fail 'これは単なるデモですから、"Print..." 項目の機能は特に定義されてはいません。'})
add('separator')
add('command', 'label'=>'Dismiss Menus Demo', 'command'=>proc{$menu84_demo.destroy})
}
@@ -116,20 +116,20 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
m.add('cascade', 'label'=>'Check button',
'menu'=>cascade_check, 'underline'=>0)
oil = TkVariable.new(0)
- add('check', 'label'=>'븡', 'variable'=>oil)
+ add('check', 'label'=>'オイル検査', 'variable'=>oil)
trans = TkVariable.new(0)
- add('check', 'label'=>'ȥ󥹥ߥå󸡺', 'variable'=>trans)
+ add('check', 'label'=>'トランスミッション検査', 'variable'=>trans)
brakes = TkVariable.new(0)
- add('check', 'label'=>'֥졼', 'variable'=>brakes)
+ add('check', 'label'=>'ブレーキ検査', 'variable'=>brakes)
lights = TkVariable.new(0)
- add('check', 'label'=>'饤ȸ', 'variable'=>lights)
+ add('check', 'label'=>'ライト検査', 'variable'=>lights)
add('separator')
add('command', 'label'=>'Show current values',
'command'=>proc{showVars($menu84_demo,
- ['', oil],
- ['ȥ󥹥ߥå', trans],
- ['֥졼', brakes],
- ['饤', lights])} )
+ ['オイル', oil],
+ ['トランスミッション', trans],
+ ['ブレーキ', brakes],
+ ['ライト', lights])} )
invoke 1
invoke 3
}
@@ -149,7 +149,7 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
add('radio', 'label'=>'Bold', 'variable'=>style, 'value'=>'bold')
add('radio', 'label'=>'Italic', 'variable'=>style, 'value'=>'italic')
add('separator')
- add('command', 'label'=>'ͤɽ',
+ add('command', 'label'=>'現在値の表示',
'command'=>proc{showVars($menu84_demo,
['pointSize', pointSize],
['style', style])} )
@@ -164,9 +164,9 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
'bitmap'=>'@'+[$demo_dir,'..',
'images','pattern.xbm'].join(File::Separator),
'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry',
- 'text'=>'ʤ򤷤˥塼ܤϡʸ˥ӥåȥޥåץ᡼ǹܤɽΤǤʳǤϡۤΥ˥塼ܤȤδ֤ä˰㤤櫓ǤϤޤ',
+ 'text'=>'あなたが選択したメニュー項目は、文字列の代わりにビットマップイメージで項目を表示したものです。それ以外の点では、ほかのメニュー項目との間で特に違いがあるわけではありません。',
'bitmap'=>'', 'default'=>0,
- 'buttons'=>'Ĥ')} )
+ 'buttons'=>'閉じる')} )
['info', 'questhead', 'error'].each{|icon|
add('command', 'bitmap'=>icon, 'hidemargin'=>1,
'command'=>proc{print "You invoked the #{icon} bitmap\n"})
@@ -187,8 +187,8 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
'bitmap'=>'questhead', 'compound'=>'left',
'command'=>proc{
TkDialog.new('title'=>'Compound Menu Entry',
- 'message'=>'ʤ򤷤˥塼ܤϡӥåȥޥåץ᡼ʸȤƱ˰Ĥιܤɽ褦ˤΤǤʳǤϡۤΥ˥塼ܤȤδ֤ä˰㤤櫓ǤϤޤ',
- 'buttons'=>['λ'], 'bitmap'=>'')
+ 'message'=>'あなたが選択したメニュー項目は、ビットマップイメージと文字列とを同時に一つの項目に表示するようにしたものです。それ以外の点では、ほかのメニュー項目との間で特に違いがあるわけではありません。',
+ 'buttons'=>['了解'], 'bitmap'=>'')
})
}
diff --git a/ext/tk/sample/demos-jp/menu8x.rb b/ext/tk/sample/demos-jp/menu8x.rb
index 49aca6786d..77ecb5bcf3 100644
--- a/ext/tk/sample/demos-jp/menu8x.rb
+++ b/ext/tk/sample/demos-jp/menu8x.rb
@@ -1,15 +1,15 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# menus widget demo (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($menu8x_demo) && $menu8x_demo
$menu8x_demo.destroy
$menu8x_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$menu8x_demo = TkToplevel.new {|w|
title("Menu Demonstration (Tk8.x)")
iconname("menu")
@@ -21,16 +21,16 @@ base_frame = TkFrame.new($menu8x_demo).pack(:fill=>:both, :expand=>true)
# version check
if $tk_version.to_f < 8.0
-# label
+# label 生成
TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left') {
- text("¹Ԥ褦ȤץȤ Tk8.0 ʾѤǤ뵡ǽѤƤ뤿ᡢʤ Ruby#{VERSION}/Tk#{$tk_version}#{(Tk::JAPANIZED_TK)? 'jp': ''} Ǥ˼¹ԤǤޤ󡣤äƥǥμ¹ԤߤޤΥɻȥܥ򲡤Ȥǡ¹Ԥߤ줿ץȤΥ򻲾Ȥ뤳ȤϲǽǤ")
+ text("実行しようとしたスクリプトは Tk8.0 以上で利用できる機能を利用しているため、あなたの Ruby#{VERSION}/Tk#{$tk_version}#{(Tk::JAPANIZED_TK)? 'jp': ''} では正常に実行できません。よってデモの実行を中止しました。ただし、下のコード参照ボタンを押すことで、実行が中止されたスクリプトのソースを参照することは可能です。")
}.pack('side'=>'top')
-# frame
+# frame 生成
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $menu8x_demo
$menu8x_demo = nil
@@ -39,7 +39,7 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'menu8x'}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
@@ -52,17 +52,17 @@ rescue
windowingsystem = ""
end
-# label
+# label 生成
TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left') {
if $tk_platform['platform'] == 'macintosh' ||
windowingsystem == "classic" || windowingsystem == "aqua"
- text("Υɥ͡ʥ˥塼ȥɥ˥塼鹽ƤޤCommand-X ϤȡXޥɥ³ɽƤʸʤС졼ȤäܵưԤȤǤޤ˥塼桢ǸΤΤϡΥ˥塼κǽιܤ򤹤뤳ȤΩ뤳ȤǤޤ")
+ text("このウィンドウは様々なメニューとカスケードメニューから構成されています。Command-X を入力すると、Xがコマンドキー記号に続いて表示されている文字ならば、アクセラレータを使った項目起動を行うことができます。メニュー要素中、最後のものは、そのメニューの最初の項目を選択することで独立させることができます。")
else
- text("Υɥ͡ʥ˥塼ȥɥ˥塼鹽ƤޤAlt-X ϤȡX˥塼˥饤դɽƤʸʤСܡɤλ꤬Ǥޤǥ˥塼ΥȥСǽǤ˥塼ꤵ줿ݤˤϡڡǼ¹Ԥ뤳ȤǤޤ뤤ϡ饤դʸϤ뤳ȤǤ¹ԤǤޤ˥塼Υȥ꤬졼äƤϡΥ졼Ϥ뤳Ȥǥ˥塼ꤹ뤳Ȥʤ˼¹Ԥ뤳ȤǤޤ˥塼桢ǸΤΤϡΥ˥塼κǽιܤ򤹤뤳ȤΩ뤳ȤǤޤ")
+ text("このウィンドウは様々なメニューとカスケードメニューから構成されています。Alt-X を入力すると、Xがメニューにアンダーライン付きで表示されている文字ならば、キーボードからの指定ができます。矢印キーでメニューのトラバースも可能です。メニューが指定された際には、スペースキーで実行することができます。あるいは、アンダーライン付きの文字を入力することでも実行できます。メニューのエントリがアクセラレータを持っている場合は、そのアクセラレータを入力することでメニューを指定することなしに実行することができます。メニュー要素中、最後のものは、そのメニューの最初の項目を選択することで独立させることができます。")
end
}.pack('side'=>'top')
-# ɽ
+# 状態表示の生成
$menu8xstatus = TkVariable.new(" ")
TkFrame.new(base_frame) {|frame|
TkLabel.new(frame, 'textvariable'=>$menu8xstatus, 'relief'=>'sunken',
@@ -70,11 +70,11 @@ TkFrame.new(base_frame) {|frame|
.pack('side'=>'left', 'padx'=>2, 'expand'=>'yes', 'fill'=>'both')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>2)
-# frame
+# frame 生成
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $menu8x_demo
$menu8x_demo = nil
@@ -83,24 +83,24 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'menu8x'}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# menu
+# menu 生成
TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m|
TkMenu.new(m, 'tearoff'=>false) {|file_menu|
m.add('cascade', 'label'=>'File', 'menu'=>file_menu, 'underline'=>0)
- add('command', 'label'=>' ...', 'command'=>proc{fail 'ϡǥǤΤ" ..."Ф륢Ƥޤ'})
- add('command', 'label'=>'', 'command'=>proc{fail 'ϡǥǤΤ""Ф륢Ƥޤ'})
- add('command', 'label'=>'¸', 'command'=>proc{fail 'ϡǥǤΤ"¸"Ф륢Ƥޤ'})
- add('command', 'label'=>'¸() ...', 'command'=>proc{fail 'ϡǥǤΤ"¸() ..."Ф륢Ƥޤ'})
+ add('command', 'label'=>'開く ...', 'command'=>proc{fail 'これは、デモですので"開く ..."に対するアクションは定義されていません。'})
+ add('command', 'label'=>'新規', 'command'=>proc{fail 'これは、デモですので"新規"に対するアクションは定義されていません。'})
+ add('command', 'label'=>'保存', 'command'=>proc{fail 'これは、デモですので"保存"に対するアクションは定義されていません。'})
+ add('command', 'label'=>'保存(指定) ...', 'command'=>proc{fail 'これは、デモですので"保存(指定) ..."に対するアクションは定義されていません。'})
add('separator')
- add('command', 'label'=>'ץ ...', 'command'=>proc{fail 'ϡǥǤΤ"ץ ..."Ф륢Ƥޤ'})
- add('command', 'label'=>'ץ ...', 'command'=>proc{fail 'ϡǥǤΤ"ץ ..."Ф륢Ƥޤ'})
+ add('command', 'label'=>'プリント設定 ...', 'command'=>proc{fail 'これは、デモですので"プリント設定 ..."に対するアクションは定義されていません。'})
+ add('command', 'label'=>'プリント ...', 'command'=>proc{fail 'これは、デモですので"プリント ..."に対するアクションは定義されていません。'})
add('separator')
- add('command', 'label'=>'λ', 'command'=>proc{$menu8x_demo.destroy})
+ add('command', 'label'=>'終了', 'command'=>proc{$menu8x_demo.destroy})
}
if $tk_platform['platform'] == 'macintosh' ||
@@ -114,10 +114,10 @@ TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m|
TkMenu.new(m, 'tearoff'=>false) {|basic_menu|
m.add('cascade', 'label'=>'Basic', 'menu'=>basic_menu, 'underline'=>0)
- add('command', 'label'=>'⤷ʤĹȥ')
+ add('command', 'label'=>'何もしない長いエントリ')
['A','B','C','D','E','F','G'].each{|c|
- # add('command', 'label'=>"ʸ \"#{c}\" ", 'underline'=>4,
- add('command', 'label'=>"Print letter \"#{c}\" (ʸ \"#{c}\" )",
+ # add('command', 'label'=>"文字 \"#{c}\" を印字", 'underline'=>4,
+ add('command', 'label'=>"Print letter \"#{c}\" (文字 \"#{c}\" を印字)",
'underline'=>14, 'accelerator'=>"Meta+#{c}",
'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}")
$menu8x_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"})
@@ -126,56 +126,56 @@ TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m|
TkMenu.new(m, 'tearoff'=>false) {|cascade_menu|
m.add('cascade', 'label'=>'Cascades', 'menu'=>cascade_menu, 'underline'=>0)
- add('command', 'label'=>'Print hello(ˤ)',
- 'command'=>proc{print "Hello(ˤ)\n"},
+ add('command', 'label'=>'Print hello(こんにちは)',
+ 'command'=>proc{print "Hello(こんにちは)\n"},
'accelerator'=>"#{modifier}+H", 'underline'=>6)
- $menu8x_demo.bind("#{modifier}-h", proc{print "Hello(ˤ)\n"})
- add('command', 'label'=>'Print goodbye(褦ʤ)',
- 'command'=>proc{print "Goodbye(褦ʤ)\n"},
+ $menu8x_demo.bind("#{modifier}-h", proc{print "Hello(こんにちは)\n"})
+ add('command', 'label'=>'Print goodbye(さようなら)',
+ 'command'=>proc{print "Goodbye(さようなら)\n"},
'accelerator'=>"#{modifier}+G", 'underline'=>6)
- $menu8x_demo.bind("#{modifier}-g", proc{print "Goodbye(褦ʤ)\n"})
+ $menu8x_demo.bind("#{modifier}-g", proc{print "Goodbye(さようなら)\n"})
TkMenu.new(m, 'tearoff'=>false) {|cascade_check|
- cascade_menu.add('cascade', 'label'=>'Check buttons(åܥ)',
+ cascade_menu.add('cascade', 'label'=>'Check buttons(チェックボタン)',
'menu'=>cascade_check, 'underline'=>0)
oil = TkVariable.new(0)
- add('check', 'label'=>'', 'variable'=>oil)
+ add('check', 'label'=>'オイル点検', 'variable'=>oil)
trans = TkVariable.new(0)
- add('check', 'label'=>'ȥ󥹥ߥå', 'variable'=>trans)
+ add('check', 'label'=>'トランスミッション点検', 'variable'=>trans)
brakes = TkVariable.new(0)
- add('check', 'label'=>'֥졼', 'variable'=>brakes)
+ add('check', 'label'=>'ブレーキ点検', 'variable'=>brakes)
lights = TkVariable.new(0)
- add('check', 'label'=>'饤', 'variable'=>lights)
+ add('check', 'label'=>'ライト点検', 'variable'=>lights)
add('separator')
- add('command', 'label'=>'ߤͤɽ',
+ add('command', 'label'=>'現在の値を表示',
'command'=>proc{showVars($menu8x_demo,
- ['', oil],
- ['ȥ󥹥ߥå', trans],
- ['֥졼', brakes],
- ['饤', lights])} )
+ ['オイル点検', oil],
+ ['トランスミッション点検', trans],
+ ['ブレーキ点検', brakes],
+ ['ライト点検', lights])} )
invoke 1
invoke 3
}
TkMenu.new(m, 'tearoff'=>false) {|cascade_radio|
- cascade_menu.add('cascade', 'label'=>'Radio buttons(饸ܥ)',
+ cascade_menu.add('cascade', 'label'=>'Radio buttons(ラジオボタン)',
'menu'=>cascade_radio, 'underline'=>0)
pointSize = TkVariable.new
- add('radio', 'label'=>'10 ݥ', 'variable'=>pointSize, 'value'=>10)
- add('radio', 'label'=>'14 ݥ', 'variable'=>pointSize, 'value'=>14)
- add('radio', 'label'=>'18 ݥ', 'variable'=>pointSize, 'value'=>18)
- add('radio', 'label'=>'24 ݥ', 'variable'=>pointSize, 'value'=>24)
- add('radio', 'label'=>'32 ݥ', 'variable'=>pointSize, 'value'=>32)
+ add('radio', 'label'=>'10 ポイント', 'variable'=>pointSize, 'value'=>10)
+ add('radio', 'label'=>'14 ポイント', 'variable'=>pointSize, 'value'=>14)
+ add('radio', 'label'=>'18 ポイント', 'variable'=>pointSize, 'value'=>18)
+ add('radio', 'label'=>'24 ポイント', 'variable'=>pointSize, 'value'=>24)
+ add('radio', 'label'=>'32 ポイント', 'variable'=>pointSize, 'value'=>32)
add('separator')
style = TkVariable.new
- add('radio', 'label'=>'ޥ', 'variable'=>style, 'value'=>'roman')
- add('radio', 'label'=>'ܡ', 'variable'=>style, 'value'=>'bold')
- add('radio', 'label'=>'å', 'variable'=>style, 'value'=>'italic')
+ add('radio', 'label'=>'ローマン', 'variable'=>style, 'value'=>'roman')
+ add('radio', 'label'=>'ボールド', 'variable'=>style, 'value'=>'bold')
+ add('radio', 'label'=>'イタリック', 'variable'=>style, 'value'=>'italic')
add('separator')
- add('command', 'label'=>'ߤͤɽ',
+ add('command', 'label'=>'現在の値を表示',
'command'=>proc{showVars($menu8x_demo,
- ['ݥȥ', pointSize],
- ['', style])} )
+ ['ポイントサイズ', pointSize],
+ ['スタイル', style])} )
invoke 1
invoke 7
}
@@ -188,9 +188,9 @@ TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m|
'images','pattern.xbm'].join(File::Separator),
'hidemargin'=>1,
'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry',
- 'text'=>'ʤ򤷤˥塼ιܤϥƥȤǤϤʤӥåȥޥåפɽƤޤʳǤ¾Υ˥塼ܤѤޤ',
+ 'text'=>'今あなたが選択したメニューの項目はテキストではなくビットマップを表示していました。それ以外の点では他のメニュー項目と変わりません。',
'bitmap'=>'', 'default'=>0,
- 'buttons'=>'λ')} )
+ 'buttons'=>'了解')} )
['info', 'questhead', 'error'].each{|icon|
add('command', 'bitmap'=>icon, 'hidemargin'=>1,
'command'=>proc{print "You invoked the #{icon} bitmap\n"})
@@ -201,8 +201,8 @@ TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m|
TkMenu.new(m, 'tearoff'=>false) {|more_menu|
m.add('cascade', 'label'=>'More', 'menu'=>more_menu, 'underline'=>0)
- [ 'ȥ','̤Υȥ','⤷ʤ','ۤȤɲ⤷ʤ',
- 'յΤ' ].each{|i|
+ [ 'エントリ','別のエントリ','何もしない','ほとんど何もしない',
+ '人生を意義あるものに' ].each{|i|
add('command', 'label'=>i,
'command'=>proc{print "You invoked \"#{i}\"\n"})
}
diff --git a/ext/tk/sample/demos-jp/menubu.rb b/ext/tk/sample/demos-jp/menubu.rb
index 78418ce3ea..06f9eb875e 100644
--- a/ext/tk/sample/demos-jp/menubu.rb
+++ b/ext/tk/sample/demos-jp/menubu.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
require "tkcanvas"
def optionMenu(menubutton, varName, firstValue, *rest)
@@ -38,16 +38,16 @@ base_frame = TkFrame.new($menubu_demo).pack(:fill=>:both, :expand=>true)
# version check
if $tk_version.to_f < 8.0
-# label
+# label 生成
TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left') {
- text("¹Ԥ褦ȤץȤ Tk8.0 ʾѤǤ뵡ǽѤƤ뤿ᡢʤ Ruby#{VERSION}/Tk#{$tk_version}#{(Tk::JAPANIZED_TK)? 'jp': ''} Ǥ˼¹ԤǤޤ󡣤äƥǥμ¹ԤߤޤΥɻȥܥ򲡤Ȥǡ¹Ԥߤ줿ץȤΥ򻲾Ȥ뤳ȤϲǽǤ")
+ text("実行しようとしたスクリプトは Tk8.0 以上で利用できる機能を利用しているため、あなたの Ruby#{VERSION}/Tk#{$tk_version}#{(Tk::JAPANIZED_TK)? 'jp': ''} では正常に実行できません。よってデモの実行を中止しました。ただし、下のコード参照ボタンを押すことで、実行が中止されたスクリプトのソースを参照することは可能です。")
}.pack('side'=>'top')
-# frame
+# frame 生成
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $menubu_demo
$menubu_demo = nil
@@ -56,7 +56,7 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'menubu'}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
@@ -160,8 +160,8 @@ center = TkFrame.new(body) {
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc {
tmppath = $menubu_demo
$menubu_demo = nil
@@ -170,7 +170,7 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc { showCode 'menubu' }
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'expand'=>'yes', 'fill'=>'x', 'pady'=>'2m')
@@ -179,10 +179,10 @@ msg = TkLabel.new(center) {
# font $font
wraplength '4i'
justify 'left'
- text "ϥ˥塼ܥΥǥǤ\"Below\"Υܥ\
-˥˥塼Ф\"Right\"Υܥϱ˥˥塼Фơ\
-ġĤȤʤޤʸϤβˤ2ĤΥץ˥塼ޤ\
-1Ĥ̤Υ˥塼ǡ⤦1Ĥ16ΥѥåȤǤ"
+ text "これはメニューボタンのデモです。\"Below\"のボタンは\
+下にメニューを出し、\"Right\"のボタンは右にメニューを出して、\
+……となります。この文章の下には2つのオプションメニューがあります。\
+1つは普通のメニューで、もう1つは16色のパレットです。"
}
msg.pack('side'=>'top', 'padx'=>25, 'pady'=>25)
diff --git a/ext/tk/sample/demos-jp/msgbox.rb b/ext/tk/sample/demos-jp/msgbox.rb
index ed5d01252e..ec7b4f2bbc 100644
--- a/ext/tk/sample/demos-jp/msgbox.rb
+++ b/ext/tk/sample/demos-jp/msgbox.rb
@@ -1,15 +1,15 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# message boxes widget demo (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($msgbox_demo) && $msgbox_demo
$msgbox_demo.destroy
$msgbox_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$msgbox_demo = TkToplevel.new {|w|
title("Message Box Demonstration")
iconname("messagebox")
@@ -18,15 +18,15 @@ $msgbox_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($msgbox_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label 生成
TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left',
- 'text'=>"ޤɽ륢ȥåܥåμDzθ\"åܥå\"ܥ򲡤ȡꤷåܥåɽޤ").pack('side'=>'top')
+ 'text'=>"まず表示するアイコンとメッセージボックスの種類を選んで下さい。その後に\"メッセージボックス\"ボタンを押すと、指定したメッセージボックスが表示されます。").pack('side'=>'top')
-# frame
+# frame 生成
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $msgbox_demo
$msgbox_demo = nil
@@ -35,17 +35,17 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'msgbox'}
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'åܥå'
+ text 'メッセージボックス'
command proc{showMessageBox $msgbox_demo}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# frame
+# frame 生成
$msgbox_leftframe = TkFrame.new(base_frame)
$msgbox_rightframe = TkFrame.new(base_frame)
$msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
@@ -53,7 +53,7 @@ $msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
$msgbox_rightframe.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
'pady'=>'.5c', 'padx'=>'.5c')
-TkLabel.new($msgbox_leftframe, 'text'=>'').pack('side'=>'top')
+TkLabel.new($msgbox_leftframe, 'text'=>'アイコン').pack('side'=>'top')
TkFrame.new($msgbox_leftframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\
.pack('side'=>'top', 'fill'=>'x', 'expand'=>'no')
@@ -65,7 +65,7 @@ $msgboxIcon = TkVariable.new('info')
'anchor'=>'w', 'fill'=>'x')
}
-TkLabel.new($msgbox_rightframe, 'text'=>'').pack('side'=>'top')
+TkLabel.new($msgbox_rightframe, 'text'=>'種類').pack('side'=>'top')
TkFrame.new($msgbox_rightframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\
.pack('side'=>'top', 'fill'=>'x', 'expand'=>'no')
@@ -81,9 +81,9 @@ $msgboxType = TkVariable.new('ok')
def showMessageBox(w)
button = Tk.messageBox('icon'=>$msgboxIcon.value, 'type'=>$msgboxType.value,
'title'=>'Message', 'parent'=>w,
- 'message'=>"\"#{$msgboxType.value}\"ȤΥåܥåǡ\"#{$msgboxIcon.value}\"ΥɽƤޤ")
+ 'message'=>"これは\"#{$msgboxType.value}\"という種類のメッセージボックスで、\"#{$msgboxIcon.value}\"のアイコンが表示されています。")
Tk.messageBox('icon'=>'info', 'type'=>'ok', 'parent'=>w,
- 'message'=>"ʤ \"#{button}\" 򲡤ޤ͡")
+ 'message'=>"あなたは \"#{button}\" を押しましたね。")
end
diff --git a/ext/tk/sample/demos-jp/msgbox2.rb b/ext/tk/sample/demos-jp/msgbox2.rb
index 8c80e08d70..ad6d936036 100644
--- a/ext/tk/sample/demos-jp/msgbox2.rb
+++ b/ext/tk/sample/demos-jp/msgbox2.rb
@@ -1,15 +1,15 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# message boxes widget demo (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($msgbox2_demo) && $msgbox2_demo
$msgbox2_demo.destroy
$msgbox2_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$msgbox2_demo = TkToplevel.new {|w|
title("Message Box Demonstration")
iconname("messagebox")
@@ -18,15 +18,15 @@ $msgbox2_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($msgbox2_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label 生成
TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left',
- 'text'=>"ޤɽ륢ȥåܥåμDzθ\"åܥå\"ܥ򲡤ȡꤵ줿ǡåȾܺ٥ƥȤȤäåܥåɽޤ").pack('side'=>'top')
+ 'text'=>"まず表示するアイコンとメッセージボックスの種類を選んで下さい。その後に\"メッセージボックス\"ボタンを押すと、指定された形式で、メッセージと詳細テキストとを持ったメッセージボックスが表示されます。").pack('side'=>'top')
-# frame
+# frame 生成
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $msgbox2_demo
$msgbox2_demo = nil
@@ -35,17 +35,17 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'msgbox2'}
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'åܥå'
+ text 'メッセージボックス'
command proc{showMessageBox2 $msgbox2_demo}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# frame
+# frame 生成
$msgbox_leftframe = TkFrame.new(base_frame)
$msgbox_rightframe = TkFrame.new(base_frame)
$msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
@@ -53,7 +53,7 @@ $msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
$msgbox_rightframe.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
'pady'=>'.5c', 'padx'=>'.5c')
-TkLabel.new($msgbox_leftframe, 'text'=>'').pack('side'=>'top')
+TkLabel.new($msgbox_leftframe, 'text'=>'アイコン').pack('side'=>'top')
TkFrame.new($msgbox_leftframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\
.pack('side'=>'top', 'fill'=>'x', 'expand'=>'no')
@@ -65,7 +65,7 @@ $msgboxIcon = TkVariable.new('info')
'anchor'=>'w', 'fill'=>'x')
}
-TkLabel.new($msgbox_rightframe, 'text'=>'').pack('side'=>'top')
+TkLabel.new($msgbox_rightframe, 'text'=>'種類').pack('side'=>'top')
TkFrame.new($msgbox_rightframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\
.pack('side'=>'top', 'fill'=>'x', 'expand'=>'no')
@@ -81,10 +81,10 @@ $msgboxType = TkVariable.new('ok')
def showMessageBox2(w)
button = Tk.messageBox('icon'=>$msgboxIcon.value, 'type'=>$msgboxType.value,
'title'=>'Message', 'parent'=>w,
- 'message'=>"\"#{$msgboxType.value}\"פΥåܥå",
- 'detail'=>"\"#{$msgboxType.value}\"ȤΥåܥåǡ\"#{$msgboxIcon.value}\"ΥɽƤޤΥܥΤ줫򤷤ƥåƤ")
+ 'message'=>"\"#{$msgboxType.value}\"タイプのメッセージボックス",
+ 'detail'=>"これは\"#{$msgboxType.value}\"という種類のメッセージボックスで、\"#{$msgboxIcon.value}\"のアイコンが表示されています。下のボタンのいずれかを選択してクリックしてください。")
Tk.messageBox('icon'=>'info', 'type'=>'ok', 'parent'=>w,
- 'message'=>"ʤ \"#{button}\" 򲡤ޤ͡")
+ 'message'=>"あなたは \"#{button}\" を押しましたね。")
end
diff --git a/ext/tk/sample/demos-jp/paned1.rb b/ext/tk/sample/demos-jp/paned1.rb
index 987a073086..53d2e7162b 100644
--- a/ext/tk/sample/demos-jp/paned1.rb
+++ b/ext/tk/sample/demos-jp/paned1.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# paned1.rb
#
@@ -23,23 +23,23 @@ base_frame = TkFrame.new($paned1_demo).pack(:fill=>:both, :expand=>true)
TkLabel.new(base_frame,
:font=>$font, :wraplength=>'4i', :justify=>:left,
:text=><<EOL).pack(:side=>:top)
-οդ줿ĤΥɥδ֤λڤȤϡĤΰ򤽤줾ΥɥΤʬ䤹뤿ΤΤǤܥǻڤȡʬ䥵ѹǤϺɽϤʤ줺ꤵȤɽޤޥˤڤɿ路ƥѹɽʤ褦ˤϡޥܥȤäƤ
-⤷ʤȤäƤ Ruby ˥󥯤Ƥ Tk 饤֥꤬ panedwindow Ƥʤ
-硢ΥǥϤޤưʤϤǤξˤ panedwindow Ƥ褦
-꿷С Tk Ȥ߹碌ƻ
-褦ˤƤ
+下の色付けされた二つのウィンドウの間の仕切り枠は、一つの領域をそれぞれのウィンドウのために分割するためのものです。左ボタンで仕切りを操作すると、分割サイズ変更の操作途中では再表示はなされず、確定させたときに表示が更新されます。マウスによる仕切りの操作に追随してサイズを変更した表示がなわれるようにしたい場合は、マウスの中央ボタンを使ってください。
+もしあなたが使っている Ruby にリンクされている Tk ライブラリが panedwindow を実装していない
+場合、このデモはうまく動かないはずです。その場合には panedwindow が実装されているような
+より新しいバージョンの Tk を組み合わせて試す
+ようにしてください。
EOL
# The bottom buttons
TkFrame.new(base_frame){|f|
pack(:side=>:bottom, :fill=>:x, :pady=>'2m')
- TkButton.new(f, :text=>'Ĥ', :width=>15, :command=>proc{
+ TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{
$paned1_demo.destroy
$paned1_demo = nil
}).pack(:side=>:left, :expand=>true)
- TkButton.new(f, :text=>'ɻ', :width=>15, :command=>proc{
+ TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{
showCode 'paned1'
}).pack(:side=>:left, :expand=>true)
}
diff --git a/ext/tk/sample/demos-jp/paned2.rb b/ext/tk/sample/demos-jp/paned2.rb
index a1aee81690..65bd41c757 100644
--- a/ext/tk/sample/demos-jp/paned2.rb
+++ b/ext/tk/sample/demos-jp/paned2.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# paned2.rb --
#
@@ -23,30 +23,30 @@ base_frame = TkFrame.new($paned2_demo).pack(:fill=>:both, :expand=>true)
TkLabel.new(base_frame,
:font=>$font, :wraplength=>'4i', :justify=>:left,
:text=><<EOL).pack(:side=>:top)
-ΥСդΥåȤ֤줿ĤΥɥδ֤λڤȤϡĤΰ򤽤줾ΥɥΤʬ䤹뤿ΤΤǤܥǻڤȡʬ䥵ѹǤϺɽϤʤ줺ꤵȤɽޤޥˤڤɿ路ƥѹɽʤ褦ˤϡޥܥȤäƤ
-⤷ʤȤäƤ Ruby ˥󥯤Ƥ Tk 饤֥꤬ panedwindow Ƥʤ
-硢ΥǥϤޤưʤϤǤξˤ panedwindow Ƥ褦
-꿷С Tk Ȥ߹碌ƻ
-褦ˤƤ
+下のスクロールバー付きのウィジェットが置かれた二つのウィンドウの間の仕切り枠は、一つの領域をそれぞれのウィンドウのために分割するためのものです。左ボタンで仕切りを操作すると、分割サイズ変更の操作途中では再表示はなされず、確定させたときに表示が更新されます。マウスによる仕切りの操作に追随してサイズを変更した表示がなわれるようにしたい場合は、マウスの中央ボタンを使ってください。
+もしあなたが使っている Ruby にリンクされている Tk ライブラリが panedwindow を実装していない
+場合、このデモはうまく動かないはずです。その場合には panedwindow が実装されているような
+より新しいバージョンの Tk を組み合わせて試す
+ようにしてください。
EOL
# The bottom buttons
TkFrame.new(base_frame){|f|
pack(:side=>:bottom, :fill=>:x, :pady=>'2m')
- TkButton.new(f, :text=>'Ĥ', :width=>15, :command=>proc{
+ TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{
$paned2_demo.destroy
$paned2_demo = nil
}).pack(:side=>:left, :expand=>true)
- TkButton.new(f, :text=>'ɻ', :width=>15, :command=>proc{
+ TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{
showCode 'paned2'
}).pack(:side=>:left, :expand=>true)
}
paneList = TkVariable.new # define as normal variable (not array)
paneList.value = [ # ruby's array --> tcl's list
- 'Ruby/Tk ΥåȰ',
+ 'Ruby/Tk のウィジェット一覧',
'TkButton',
'TkCanvas',
'TkCheckbutton',
@@ -87,8 +87,8 @@ TkPanedwindow.new(base_frame, :orient=>:vertical){|f|
paned2_xscr = TkScrollbar.new(paned2_bottom)
paned2_yscr = TkScrollbar.new(paned2_bottom)
paned2_text = TkText.new(paned2_bottom, :width=>30, :wrap=>:non) {
- insert('1.0', '֤ƤΤϡ' +
- '̤ΥƥȥåȤǤ')
+ insert('1.0', 'ここに配置されているのは、' +
+ 'ごく普通のテキストウィジェットです。')
xscrollbar(paned2_xscr)
yscrollbar(paned2_yscr)
}
diff --git a/ext/tk/sample/demos-jp/pendulum.rb b/ext/tk/sample/demos-jp/pendulum.rb
index 48839aa58a..60556fd70a 100644
--- a/ext/tk/sample/demos-jp/pendulum.rb
+++ b/ext/tk/sample/demos-jp/pendulum.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# This demonstration illustrates how Tcl/Tk can be used to construct
# simulations of physical systems.
@@ -26,15 +26,15 @@ msg = TkLabel.new(base_frame) {
font $font
wraplength '4i'
justify 'left'
- text 'ΥǥϡʪϤΥߥ졼˴ؤ褦ʥ˥᡼¹Ԥ뤿 Ruby/Tk ɤΤ褦Ѥ뤳ȤǤ뤫򼨤Ƥޤ¦ΥХñʿҤǤʪϼΤΥեɽǤΤФ¦ΥХϷϤΰ֤Υաʳ®٤ȳ٤ȤץåȤΡˤˤʤäƤޤ¦ΥХǥåӥɥåԤäƿҤνŤΰ֤ѤƤߤƤ'
+ text 'このデモは、物理系のシミュレーションに関わるようなアニメーション実行するために Ruby/Tk をどのように用いることができるかを示しています。左側のキャンバスは単純な振り子である物理系自体のグラフィカル表現であるのに対し、右側のキャンバスは系の位相空間のグラフ(角速度と角度とをプロットしたもの)になっています。左側のキャンバス上でクリックおよびドラッグを行って振り子の重りの位置を変えてみてください。'
}
msg.pack('side'=>'top')
# create frame
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $pendulum_demo
$pendulum_demo = nil
@@ -43,7 +43,7 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'pendulum'}
}.pack('side'=>'left', 'expand'=>'yes')
diff --git a/ext/tk/sample/demos-jp/plot.rb b/ext/tk/sample/demos-jp/plot.rb
index a49ed00df8..4147b35399 100644
--- a/ext/tk/sample/demos-jp/plot.rb
+++ b/ext/tk/sample/demos-jp/plot.rb
@@ -1,15 +1,15 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# 2-D plot widget demo (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($plot_demo) && $plot_demo
$plot_demo.destroy
$plot_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$plot_demo = TkToplevel.new {|w|
title("Plot Demonstration")
iconname("Plot")
@@ -18,17 +18,17 @@ $plot_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($plot_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label 生成
TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left',
- 'text'=>"Υɥϴñ2ΥץåȤޤХ widgetǤɽ줿ޥܥ1ǥɥåƥǡ򤤤뤳ȤǤޤ"){
+ 'text'=>"このウィンドウは簡単な2次元のプロットを含んだキャンバス widgetです。表示された点をマウスボタン1でドラッグしてデータをいじることができます。"){
pack('side'=>'top')
}
-# frame
+# frame 生成
$plot_buttons = TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $plot_demo
$plot_demo = nil
@@ -37,28 +37,28 @@ $plot_buttons = TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'plot'}
}.pack('side'=>'left', 'expand'=>'yes')
}
$plot_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# font
+# font 設定
if $tk_version =~ /^4.*/
plotFont = '-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*'
else
font = 'Helvetica 18'
end
-# canvas
+# canvas 設定
$plot_canvas = TkCanvas.new(base_frame,'relief'=>'raised','width'=>450,'height'=>300)
$plot_canvas.pack('side'=>'top', 'fill'=>'x')
-# plot
+# plot 生成
TkcLine.new($plot_canvas, 100, 250, 400, 250, 'width'=>2)
TkcLine.new($plot_canvas, 100, 250, 100, 50, 'width'=>2)
TkcText.new($plot_canvas, 225, 20,
- 'text'=>"ñʥץå", 'font'=>plotFont, 'fill'=>'brown')
+ 'text'=>"簡単なプロット", 'font'=>plotFont, 'fill'=>'brown')
(0..10).each {|i|
x = 100 + (i * 30)
diff --git a/ext/tk/sample/demos-jp/puzzle.rb b/ext/tk/sample/demos-jp/puzzle.rb
index 16d7ce497c..dbcb423463 100644
--- a/ext/tk/sample/demos-jp/puzzle.rb
+++ b/ext/tk/sample/demos-jp/puzzle.rb
@@ -1,15 +1,15 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# widet demo 'puzzle' (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($puzzle_demo) && $puzzle_demo
$puzzle_demo.destroy
$puzzle_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$puzzle_demo = TkToplevel.new {|w|
title("15-Puzzle Demonstration")
iconname("15-Puzzle")
@@ -18,20 +18,20 @@ $puzzle_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($puzzle_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label 生成
msg = TkLabel.new(base_frame) {
font $font
wraplength '4i'
justify 'left'
- text "15-ѥϥܥ򽸤ƤǤƤޤƤ٤Υԡ򥯥åȡΥԡζƤ˥饤ɤޤ³ԡον˾夫鲼鱦¤֤褦ˤƤ"
+ text "下の15-パズルはボタンを集めてできています。空いている所の隣のピースをクリックすると、そのピースがその空いている場所にスライドします。この操作を続け、ピースがその数の順に上から下、左から右に並ぶようにしてください。"
}
msg.pack('side'=>'top')
-# frame
+# frame 生成
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $puzzle_demo
$puzzle_demo = nil
@@ -40,16 +40,16 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'puzzle'}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# frame
+# frame 生成
#
-# Special trick: scrollbar widget Ƥ trough color Ѥ뤳Ȥ
-# ʬΤΰſ򤷡ꤹ
+# Special trick: scrollbar widget を生成してその trough color を用いることで
+# 空白部分のための暗色を選択し,設定する
#
begin
if Tk.windowingsystem() == 'aqua'
@@ -81,9 +81,9 @@ base = TkFrame.new(base_frame) {
s.destroy
base.pack('side'=>'top', 'padx'=>'1c', 'pady'=>'1c')
-# proc ΥפĤ뤿ᡤproc ᥽åɤѰ
-# ƤͤС롼ͤѲ num αƶ
-# puzzleSwitch 2 ѲƤޤ̤ˤϤʤʤ
+# proc のスコープを閉じるため,proc 生成メソッドを用意
+# こうしておかねば,ループ中で値が変化する num の影響を受けて
+# puzzleSwitch の第 2 引数が変化してしまい,期待通りにはならない.
def def_puzzleswitch_proc(w, num)
proc{puzzleSwitch w, num}
end
diff --git a/ext/tk/sample/demos-jp/radio.rb b/ext/tk/sample/demos-jp/radio.rb
index 3355f25116..efb613593d 100644
--- a/ext/tk/sample/demos-jp/radio.rb
+++ b/ext/tk/sample/demos-jp/radio.rb
@@ -1,15 +1,15 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# radiobutton widget demo (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($radio_demo) && $radio_demo
$radio_demo.destroy
$radio_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$radio_demo = TkToplevel.new {|w|
title("Radiobutton Demonstration")
iconname("radio")
@@ -18,24 +18,24 @@ $radio_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($radio_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label 生成
msg = TkLabel.new(base_frame) {
font $font
wraplength '4i'
justify 'left'
- text "ˤ2ĤΥ饸ܥ󥰥롼פɽƤޤܥ򥯥åȡΥܥΥ롼פ򤵤ޤƥ롼פФƤΥ롼פΤɤΥܥ򤵤Ƥ뤫򼨤ѿƤƤޤߤѿͤ򸫤ˤϡѿȡץܥ򥯥åƤ"
+ text "下には2つのラジオボタングループが表示されています。ボタンをクリックすると、そのボタンだけがそのグループの中で選択されます。各グループに対してそのグループの中のどのボタンが選択されているかを示す変数が割り当てられています。現在の変数の値を見るには「変数参照」ボタンをクリックしてください。"
}
msg.pack('side'=>'top')
-# ѿ
+# 変数生成
size = TkVariable.new
color = TkVariable.new
-# frame
+# frame 生成
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $radio_demo
$radio_demo = nil
@@ -45,35 +45,35 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'radio'}
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ѿ'
+ text '変数参照'
command proc{
showVars(base_frame, ['size', size], ['color', color])
}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# frame
+# frame 生成
f_left = TkFrame.new(base_frame)
f_right = TkFrame.new(base_frame)
f_left.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c')
f_right.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c')
-# radiobutton
+# radiobutton 生成
[10, 12, 18, 24].each {|sz|
TkRadioButton.new(f_left) {
- text "ݥȥ #{sz}"
+ text "ポイントサイズ #{sz}"
variable size
relief 'flat'
value sz
}.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w')
}
-['', '', '', '', '', ''].each {|col|
+['赤', '緑', '青', '黄', '橙', '紫'].each {|col|
TkRadioButton.new(f_right) {
text col
variable color
diff --git a/ext/tk/sample/demos-jp/radio2.rb b/ext/tk/sample/demos-jp/radio2.rb
index 91496beb6d..0633a8def1 100644
--- a/ext/tk/sample/demos-jp/radio2.rb
+++ b/ext/tk/sample/demos-jp/radio2.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# radio2.rb
#
@@ -28,7 +28,7 @@ msg = TkLabel.new(base_frame) {
font $font
wraplength '5i'
justify 'left'
- text "ˤ3ĤΥ饸ܥ󥰥롼פɽƤޤܥ򥯥åȡΥܥΥ롼פ򤵤ޤƥ롼פФƤΥ롼פΤɤΥܥ򤵤Ƥ뤫򼨤ѿƤƤޤߤѿͤ򸫤ˤϡѿȡץܥ򥯥åƤ"
+ text "下には3つのラジオボタングループが表示されています。ボタンをクリックすると、そのボタンだけがそのグループの中で選択されます。各グループに対してそのグループの中のどのボタンが選択されているかを示す変数が割り当てられています。現在の変数の値を見るには「変数参照」ボタンをクリックしてください。"
}
msg.pack('side'=>'top')
@@ -40,8 +40,8 @@ align = TkVariable.new
# frame
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $radio2_demo
$radio2_demo = nil
@@ -51,12 +51,12 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'radio2'}
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ѿ'
+ text '変数参照'
command proc{
showVars(base_frame,
['size', size], ['color', color], ['compound', align])
@@ -65,11 +65,11 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
# frame
-f_left = TkLabelFrame.new(base_frame, 'text'=>'ʸ',
+f_left = TkLabelFrame.new(base_frame, 'text'=>'文字サイズ',
'pady'=>2, 'padx'=>2)
-f_mid = TkLabelFrame.new(base_frame, 'text'=>'',
+f_mid = TkLabelFrame.new(base_frame, 'text'=>'色',
'pady'=>2, 'padx'=>2)
-f_right = TkLabelFrame.new(base_frame, 'text'=>'ӥåȥޥå',
+f_right = TkLabelFrame.new(base_frame, 'text'=>'ビットマップ配置',
'pady'=>2, 'padx'=>2)
f_left.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c')
f_mid.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c')
@@ -78,14 +78,14 @@ f_right.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c')
# radiobutton
[10, 12, 18, 24].each {|sz|
TkRadioButton.new(f_left) {
- text "ݥȥ #{sz}"
+ text "ポイントサイズ #{sz}"
variable size
relief 'flat'
value sz
}.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w', 'fill'=>'x')
}
-['', '', '', '', '', ''].each {|col|
+['赤', '緑', '青', '黄', '橙', '紫'].each {|col|
TkRadioButton.new(f_mid) {
text col
variable color
@@ -95,8 +95,8 @@ f_right.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c')
}.pack('side'=>'top', 'pady'=>2, 'fill'=>'x')
}
-# label = TkLabel.new(f_right, 'text'=>'٥', 'bitmap'=>'questhead',
-label = Tk::Label.new(f_right, 'text'=>'٥', 'bitmap'=>'questhead',
+# label = TkLabel.new(f_right, 'text'=>'ラベル', 'bitmap'=>'questhead',
+label = Tk::Label.new(f_right, 'text'=>'ラベル', 'bitmap'=>'questhead',
'compound'=>'left')
label.configure('width'=>TkWinfo.reqwidth(label), 'compound'=>'top')
label.height(TkWinfo.reqheight(label))
diff --git a/ext/tk/sample/demos-jp/radio3.rb b/ext/tk/sample/demos-jp/radio3.rb
index 763c522448..3356b6945b 100644
--- a/ext/tk/sample/demos-jp/radio3.rb
+++ b/ext/tk/sample/demos-jp/radio3.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# radio3.rb
#
@@ -28,7 +28,7 @@ msg = TkLabel.new(base_frame) {
font $font
wraplength '5i'
justify 'left'
- text 'ˤ3ĤΥ饸ܥ󥰥롼פɽƤޤܥ򥯥åȡΥ롼פ°뤹٤ƤΥܥǥåܥ򤵤줿֤ˤʤޤƥ롼פˤϡΥ롼פΤɤΥܥ򤵤Ƥ뤫򼨤ѿƤƤޤ֥ȥ饤ơȡץܥ󤬲줿Ȥˤϡ饸ܥɽȥ饤ơȥ⡼ɤˤʤޤ줫Υܥ򤹤Сܥξ֤ϸΤ褦˸ġΥܥon/off֤򼨤褦ˤʤޤߤѿͤ򸫤ˤϡѿȡץܥ򥯥åƤ'
+ text '下には3つのラジオボタングループが表示されています。ボタンをクリックすると、そのグループに属するすべてのボタンの中でクリックしたボタンだけが選択された状態になります。各グループには、そのグループの中のどのボタンが選択されているかを示す変数が割り当てられています。「トライステート」ボタンが押されたときには、ラジオボタンの表示がトライステートモードになります。いずれかのボタンを選択すれば、ボタンの状態は元のように個々のボタンのon/off状態を示すようになります。現在の変数の値を見るには「変数参照」ボタンをクリックしてください。'
}
msg.grid(:row=>0, :column=>0, :columnspan=>3, :sticky=>'nsew')
@@ -42,16 +42,16 @@ TkFrame.new(base_frame) {|frame|
TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2),
:columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
TkGrid('x',
- TkButton.new(frame, :text=>'ѿ',
+ TkButton.new(frame, :text=>'変数参照',
:image=>$image['view'], :compound=>:left,
:command=>proc{
showVars(base_frame, ['size', size],
['color', color], ['compound', align])
}),
- TkButton.new(frame, :text=>'ɻ',
+ TkButton.new(frame, :text=>'コード参照',
:image=>$image['view'], :compound=>:left,
:command=>proc{showCode 'radio3'}),
- TkButton.new(frame, :text=>'Ĥ',
+ TkButton.new(frame, :text=>'閉じる',
:image=>$image['delete'], :compound=>:left,
:command=>proc{
tmppath = $radio3_demo
@@ -65,17 +65,17 @@ TkFrame.new(base_frame) {|frame|
}
# frame
-f_left = TkLabelFrame.new(base_frame, 'text'=>'ʸ',
+f_left = TkLabelFrame.new(base_frame, 'text'=>'文字サイズ',
'pady'=>2, 'padx'=>2)
-f_mid = TkLabelFrame.new(base_frame, 'text'=>'',
+f_mid = TkLabelFrame.new(base_frame, 'text'=>'色',
'pady'=>2, 'padx'=>2)
-f_right = TkLabelFrame.new(base_frame, 'text'=>'ӥåȥޥå',
+f_right = TkLabelFrame.new(base_frame, 'text'=>'ビットマップ配置',
'pady'=>2, 'padx'=>2)
f_left .grid('column'=>0, 'row'=>1, 'pady'=>'.5c', 'padx'=>'.5c', 'rowspan'=>2)
f_mid .grid('column'=>1, 'row'=>1, 'pady'=>'.5c', 'padx'=>'.5c', 'rowspan'=>2)
f_right.grid('column'=>2, 'row'=>1, 'pady'=>'.5c', 'padx'=>'.5c')
-TkButton.new(base_frame, 'text'=>'ȥ饤ơ',
+TkButton.new(base_frame, 'text'=>'トライステート',
'command'=>proc{size.value = 'multi'; color.value = 'multi'}){
grid('column'=>2, 'row'=>2, 'pady'=>'.5c', 'padx'=>'.5c')
}
@@ -83,7 +83,7 @@ TkButton.new(base_frame, 'text'=>'ȥ饤ơ',
# radiobutton
[10, 12, 14, 18, 24].each {|sz|
TkRadioButton.new(f_left) {
- text "ݥȥ #{sz}"
+ text "ポイントサイズ #{sz}"
variable size
relief 'flat'
value sz
@@ -103,8 +103,8 @@ TkButton.new(base_frame, 'text'=>'ȥ饤ơ',
}.pack('side'=>'top', 'pady'=>2, 'fill'=>'x')
}
-# label = TkLabel.new(f_right, 'text'=>'٥', 'bitmap'=>'questhead',
-label = Tk::Label.new(f_right, 'text'=>'٥', 'bitmap'=>'questhead',
+# label = TkLabel.new(f_right, 'text'=>'ラベル', 'bitmap'=>'questhead',
+label = Tk::Label.new(f_right, 'text'=>'ラベル', 'bitmap'=>'questhead',
'compound'=>'left')
label.configure('width'=>TkWinfo.reqwidth(label), 'compound'=>'top')
label.height(TkWinfo.reqheight(label))
diff --git a/ext/tk/sample/demos-jp/rolodex-j b/ext/tk/sample/demos-jp/rolodex-j
index ee8dd110bc..f6e3afdacd 100644
--- a/ext/tk/sample/demos-jp/rolodex-j
+++ b/ext/tk/sample/demos-jp/rolodex-j
@@ -1,15 +1,15 @@
#!/usr/bin/env ruby
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# rolodex --
-# ΥץȤ Tom LaStrange rolodex ΰǤ
+# このスクリプトは Tom LaStrange の rolodex の一部です。
#
# Copyright (C) 1998 by Takaaki Tateishi <ttate@jaist.ac.jp>
# Time-stamp: "04/04/09 00:32:12 nagai"
#
require "tk"
-Tk.encoding = "euc-jp"
+Tk.encoding = "utf-8"
def show_help(topic,x=0,y=0)
if( topic.is_a?(TkWindow) )
@@ -24,20 +24,20 @@ def show_help(topic,x=0,y=0)
if( $helpTopics.include?(topic) )
msg = $helpTopics[topic]
else
- msg = "ΥȥԥåˤĤƤΥإפϤޤѤǤޤ"
+ msg = "このトピックについてのヘルプはまだ使用できません"
end
TkDialog.new("title"=>"Rolodex Help",
- "message"=>"#{topic}\n\n#{msg}",
+ "message"=>"「#{topic}」\n\n#{msg}",
"default_button"=>0,
"buttons"=>["OK"])
end
def fillCard
clearAction
- $root.frame.entry[1].insert(0, "Ω ")
- $root.frame.entry[2].insert(0, "923-1292 ")
- $root.frame.entry[3].insert(0, "äĮ 1-1")
- $root.frame.entry[4].insert(0, "Φüʳصر")
+ $root.frame.entry[1].insert(0, "立石 孝彰")
+ $root.frame.entry[2].insert(0, "923-1292 石川県")
+ $root.frame.entry[3].insert(0, "辰口町 旭台 1-1")
+ $root.frame.entry[4].insert(0, "北陸先端科学技術大学院大学")
$root.frame.entry[5].insert(0,"private")
$root.frame.entry[6].insert(0,"***-***-****")
$root.frame.entry[7].insert(0,"***-***-****")
@@ -59,7 +59,7 @@ end
def fileAction
TkDialog.new("title"=>"File Selection",
- "message"=>"ϥեΥߡǤ\n",
+ "message"=>"これはファイル選択ダイアログのダミーです。\n",
"default_button"=>0,
"buttons"=>["OK"])
STDERR.print "dummy file name\n"
@@ -67,9 +67,9 @@ end
def deleteAction
result = TkDialog.new("title"=>"Confirm Action",
- "message"=>"Ǥ",
+ "message"=>"よろしいですか?",
"default_button"=>0,
- "buttons"=>["󥻥"])
+ "buttons"=>["キャンセル"])
if( result.value == 0 )
clearAction
end
@@ -79,7 +79,7 @@ end
class RolodexFrame < TkFrame
attr_reader :entry, :label
- LABEL = ["","̾:","","","","():","():","Fax:"]
+ LABEL = ["","名前:","住所","","","電話(自宅):","電話(会社):","Fax:"]
def initialize(parent=nil,keys=nil)
super(parent,keys)
@@ -109,10 +109,10 @@ class RolodexButtons < TkFrame
def initialize(parent,keys=nil)
super(parent,keys)
- @clear = TkButton.new(self,"text" => "ꥢ")
- @add = TkButton.new(self, "text" => "ɲ")
- @search = TkButton.new(self, "text" => "")
- @delete = TkButton.new(self, "text" => "õ")
+ @clear = TkButton.new(self,"text" => "クリアー")
+ @add = TkButton.new(self, "text" => "追加")
+ @search = TkButton.new(self, "text" => "検索")
+ @delete = TkButton.new(self, "text" => "消去")
for w in [@clear,@add,@search,@delete]
w.pack("side"=>"left", "padx"=>2)
end
@@ -128,43 +128,43 @@ class RolodexMenuFrame < TkFrame
"borderwidth"=>1)
@file = TkMenubutton.new(self,
- "text"=> "ե",
+ "text"=> "ファイル",
"underline"=>0)
@file_menu = TkMenu.new(@file)
@file_menu.add("command",
- "label" => "ɤ߹ ...",
+ "label" => "読み込み ...",
"command" => proc{fileAction},
"underline" => 0)
@file_menu.add("command",
- "label" => "λ",
+ "label" => "終了",
"command" => proc{$root.destroy},
"underline" => 0)
@file.menu(@file_menu)
@file.pack("side"=>"left")
@help = TkMenubutton.new(self,
- "text"=> "إ",
+ "text"=> "ヘルプ",
"underline"=>0)
@help_menu = TkMenu.new(@help)
@help_menu.add("command",
- "label"=> "ƥȤˤĤ",
- "command"=>proc{show_help("ƥ")},
+ "label"=> "コンテキストについて",
+ "command"=>proc{show_help("コンテキスト")},
"underline"=>3)
@help_menu.add("command",
- "label"=> "إפˤĤ",
- "command"=>proc{show_help("إ")},
+ "label"=> "ヘルプについて",
+ "command"=>proc{show_help("ヘルプ")},
"underline"=>3)
@help_menu.add("command",
- "label"=> "ɥˤĤ",
- "command"=>proc{show_help("ɥ")},
+ "label"=> "ウィンドウについて",
+ "command"=>proc{show_help("ウィンドウ")},
"underline"=>3)
@help_menu.add("command",
- "label"=> "ˤĤ",
- "command"=>proc{show_help("")},
+ "label"=> "キー操作について",
+ "command"=>proc{show_help("キー操作")},
"underline"=>3)
@help_menu.add("command",
- "label"=> "С",
- "command"=>proc{show_help("С")},
+ "label"=> "バージョン情報",
+ "command"=>proc{show_help("バージョン情報")},
"underline"=>3)
@help.menu(@help_menu)
@help.pack("side"=>"right")
@@ -198,16 +198,16 @@ $root.buttons.add.configure("command"=>proc{addAction})
$root.buttons.clear.configure("command"=>proc{clearAction})
$root.buttons.search.configure("command"=>proc{addAction; fillCard})
-$root.buttons.clear.configure("text"=> "ꥢ Ctrl+C")
+$root.buttons.clear.configure("text"=> "クリアー Ctrl+C")
$root.bind("Control-c",proc{clearAction})
-$root.buttons.add.configure("text"=> "ɲ Ctrl+A")
+$root.buttons.add.configure("text"=> "追加 Ctrl+A")
$root.bind("Control-a",proc{addAction})
-$root.buttons.search.configure("text"=> " Ctrl+S")
+$root.buttons.search.configure("text"=> "検索 Ctrl+S")
$root.bind("Control-s",proc{addAction; fillCard})
-$root.buttons.delete.configure("text"=> "õ Ctrl+D")
+$root.buttons.delete.configure("text"=> "消去 Ctrl+D")
$root.bind("Control-d",proc{deleteAction})
$root.menu.file_menu.entryconfigure(1, "accel"=>"Ctrl+F")
@@ -227,74 +227,74 @@ $root.bind("Any-Help",
$helpTopics = {}
$helpTopics[$root.menu.file] = <<EOF
-ϡ֥եץ˥塼Ǥɤ߹ߡפֽλפʤɤ
-ԤʤȤǤޤ
+これは「ファイル」メニューです。「読み込み」や「終了」などを
+行なうことができます。
EOF
$helpTopics[$root.menu.file_menu.index(0)] = <<EOF
-եɤ߹ߤԤʤȤ˻Ȥޤ
+ファイルの読み込みを行なうときに使います。
EOF
$helpTopics[$root.menu.file_menu.index(1)] = <<EOF
-ץꥱλȤ˻Ȥޤ
+アプリケーションを終了するときに使います。
EOF
$helpTopics[$root.frame.entry[1]] = <<EOF
-̾륨ȥǤ
+名前を記入するエントリです。
EOF
$helpTopics[$root.frame.entry[2]] = <<EOF
-륨ȥǤ
+住所を記入するエントリです。
EOF
$helpTopics[$root.frame.entry[3]] = <<EOF
-륨ȥǤ
+住所を記入するエントリです。
EOF
$helpTopics[$root.frame.entry[4]] = <<EOF
-륨ȥǤ
+住所を記入するエントリです。
EOF
$helpTopics[$root.frame.entry[5]] = <<EOF
-ֹ륨ȥǤ\
-ʤȤ private ȵޤ
+自宅の電話番号を記入するエントリです。公開\
+したくないときは private と記入します。
EOF
$helpTopics[$root.frame.entry[6]] = <<EOF
-Ҥֹ륨ȥǤ
+会社の電話番号を記入するエントリです。
EOF
$helpTopics[$root.frame.entry[7]] = <<EOF
-FAXֹ륨ȥǤ
+FAX番号を記入するエントリです。
EOF
-$helpTopics["ƥ"] = <<EOF
-Ruby/TkǤgrabεʤᤳΥץꥱǤ\
-ƥȥإפϥݡȤƤޤ
-Ʊ褦ʸ̤bindȥޥΰ֤WedgetΤ\
-Ȥ뤳ȤǤޤ
+$helpTopics["コンテキスト"] = <<EOF
+Ruby/Tkではgrabの機構がないためこのアプリケーションでは\
+コンテキストヘルプはサポートされていません。
+しかし同じような効果をbindとマウスの位置のWedgetを知る\
+ことで得ることができます。
EOF
-$helpTopics["إ"] = <<EOF
-ޥ򥦥ɥˤ碌F1򲡤Ȥˤä\
-Υإפ򸫤뤳ȤǤޤ
+$helpTopics["ヘルプ"] = <<EOF
+マウスをウィンドウにあわせてF1キーを押すことによって\
+そのヘルプを見ることができます。
EOF
-$helpTopics["ɥ"] = <<EOF
-ΥɥϥߡǤ
+$helpTopics["ウィンドウ"] = <<EOF
+このウィンドウはダミーです。
EOF
-$helpTopics[""] = <<EOF
-Ctrl+A: ɲ
-Ctrl+C: ꥢ
-Ctrl+D: õ
-Ctrl+F: ե
-Ctrl+Q: λ
-Ctrl+S:
+$helpTopics["キー操作"] = <<EOF
+Ctrl+A: 追加
+Ctrl+C: クリアー
+Ctrl+D: 消去
+Ctrl+F: ファイル選択
+Ctrl+Q: 終了
+Ctrl+S: 検索
EOF
-$helpTopics["С"] = <<EOF
-С 1.0.1j Ǥ
+$helpTopics["バージョン情報"] = <<EOF
+バージョンは 1.0.1j です。
EOF
Tk.mainloop
diff --git a/ext/tk/sample/demos-jp/ruler.rb b/ext/tk/sample/demos-jp/ruler.rb
index a721b95a6a..5c34a5a5da 100644
--- a/ext/tk/sample/demos-jp/ruler.rb
+++ b/ext/tk/sample/demos-jp/ruler.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# ruler widget demo (called by 'widget')
#
@@ -16,13 +16,13 @@ def rulerMkTab(c,x,y)
TkcPolygon.new(c, x, y, x+v.size, y+v.size, x-v.size, y+v.size)
end
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($ruler_demo) && $ruler_demo
$ruler_demo.destroy
$ruler_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$ruler_demo = TkToplevel.new {|w|
title("Ruler Demonstration")
iconname("ruler")
@@ -31,17 +31,17 @@ $ruler_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($ruler_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label 生成
TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left',
- 'text'=>"ΥХwidgetϥ롼顼ϷǤ롼顼αˤΤϥ֥ȥåפΰͤǡĥäƤ뤳Ȥˤäƥ֥ȥåפ뤳ȤǤޤޤǤˤ륿֥ȥåפưȤǤޤ֥ȥåפޤϲˤɽޤǥɥåȡޥܥΥˤΥ֥ȥåפϾäޤ"){
+ 'text'=>"このキャンバスwidgetはルーラーの模型です。ルーラーの右にあるのはタブストップの井戸で、ここから引っ張ってくることによってタブストップを作ることができます。また、すでにあるタブストップを動かすこともできます。タブストップを上方または下方にかすれて表示されるまでドラッグすると、マウスボタンを離した時にそのタブストップは消えます。"){
pack('side'=>'top')
}
-# frame
+# frame 生成
$ruler_buttons = TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $ruler_demo
$ruler_demo = nil
@@ -50,17 +50,17 @@ $ruler_buttons = TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'ruler'}
}.pack('side'=>'left', 'expand'=>'yes')
}
$ruler_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# canvas
+# canvas 設定
$ruler_canvas = TkCanvas.new(base_frame, 'width'=>'14.8c', 'height'=>'2.5c')
$ruler_canvas.pack('side'=>'top', 'fill'=>'x')
-#
+# 値設定
unless Struct.const_defined?("RulerInfo")
$demo_rulerInfo = Struct.new("RulerInfo", :grid, :left, :right, :x, :y,
:top, :bottom, :size, :normalStyle,
diff --git a/ext/tk/sample/demos-jp/sayings.rb b/ext/tk/sample/demos-jp/sayings.rb
index b3bdbe0bc5..cf4fe7b1b1 100644
--- a/ext/tk/sample/demos-jp/sayings.rb
+++ b/ext/tk/sample/demos-jp/sayings.rb
@@ -1,15 +1,15 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# listbox widget demo 'sayings' (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($sayings_demo) && $sayings_demo
$sayings_demo.destroy
$sayings_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$sayings_demo = TkToplevel.new {|w|
title("Listbox Demonstration (well-known sayings)")
iconname("sayings")
@@ -18,20 +18,20 @@ $sayings_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($sayings_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label 生成
msg = TkLabel.new(base_frame) {
font $font
wraplength '4i'
justify 'left'
- text "ΥꥹȥܥåˤϤʳʸäƤޤꥹȤ򥹥뤵ΤϥСǤǤޤꥹȥܥåǥޥΥܥ2(ܥ)򲡤ޤޥɥåƤǤޤ"
+ text "下のリストボックスにはいろいろな格言が入っています。リストをスクロールさせるのはスクロールバーでもできますし、リストボックスの中でマウスのボタン2(中ボタン)を押したままドラッグしてもできます。"
}
msg.pack('side'=>'top')
-# frame
+# frame 生成
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $sayings_demo
$sayings_demo = nil
@@ -40,13 +40,13 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'sayings'}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# frame
+# frame 生成
sayings_lbox = nil
TkFrame.new(base_frame, 'borderwidth'=>10) {|w|
sv = TkScrollbar.new(w)
diff --git a/ext/tk/sample/demos-jp/search.rb b/ext/tk/sample/demos-jp/search.rb
index 293ae83910..238450ae30 100644
--- a/ext/tk/sample/demos-jp/search.rb
+++ b/ext/tk/sample/demos-jp/search.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# Text Search widget demo (called by 'widget')
#
@@ -62,13 +62,13 @@ def textToggle(cmd1,sleep1,cmd2,sleep2)
-1, cmd1, cmd2).start(sleep1)
end
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($search_demo) && $search_demo
$search_demo.destroy
$search_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$search_demo = TkToplevel.new {|w|
title("Text Demonstration - Search and Highlight")
iconname("search")
@@ -77,11 +77,11 @@ $search_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($search_demo).pack(:fill=>:both, :expand=>true)
-# frame
+# frame 生成
$search_buttons = TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $search_demo
$search_demo = nil
@@ -90,15 +90,15 @@ $search_buttons = TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'search'}
}.pack('side'=>'left', 'expand'=>'yes')
}
$search_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# frame
+# frame 生成
TkFrame.new(base_frame) {|f|
- TkLabel.new(f, 'text'=>'ե̾:',
+ TkLabel.new(f, 'text'=>'ファイル名:',
'width'=>13, 'anchor'=>'w').pack('side'=>'left')
$search_fileName = TkVariable.new
TkEntry.new(f, 'width'=>40,
@@ -108,14 +108,14 @@ TkFrame.new(base_frame) {|f|
$search_string_entry.focus})
focus
}
- TkButton.new(f, 'text'=>'ɤ߹',
+ TkButton.new(f, 'text'=>'読み込み',
'command'=>proc{textLoadFile($search_text,
$search_fileName.value)})\
.pack('side'=>'left', 'pady'=>5, 'padx'=>10)
}.pack('side'=>'top', 'fill'=>'x')
TkFrame.new(base_frame) {|f|
- TkLabel.new(f, 'text'=>'ʸ:',
+ TkLabel.new(f, 'text'=>'検索文字列:',
'width'=>13, 'anchor'=>'w').pack('side'=>'left')
$search_searchString = TkVariable.new
$search_string_entry = TkEntry.new(f, 'width'=>40,
@@ -124,7 +124,7 @@ TkFrame.new(base_frame) {|f|
bind('Return', proc{textSearch($search_text, $search_searchString.value,
$search_Tag)})
}
- TkButton.new(f, 'text'=>'ȿž',
+ TkButton.new(f, 'text'=>'反転',
'command'=>proc{textSearch($search_text,
$search_searchString.value,
$search_Tag)}) {
@@ -165,15 +165,15 @@ else
200 )
end
$search_text.insert('1.0', "\
-Υɥϸ¸Τ˥ƥ widget Υǽɤ \
-褦˻ȤΤǥ⤹ΤǤޤΥȥ˥ե̾ \
-졢<꥿> 򲡤֥ɡץܥ򲡤Ƥˤβ \
-ȥʸϤ<꥿> 򲡤ȿžץܥ򲡤Ƥ \
-ȥեΡʸȰפʬ \"search_Tag\" \
-ȤĤ졢ɽ°ȤƤʸǤ褦 \
-ꤵޤ\n")
+このウィンドウは検索機構を実現するのにテキスト widget のタグ機能がどの \
+ように使われるのかをデモするものです。まず上のエントリにファイル名を入 \
+れ、<リターン> を押すか「ロード」ボタンを押してください。次にその下の \
+エントリに文字列を入力し、<リターン> を押すか「反転」ボタンを押してく \
+ださい。するとファイル中の、検索文字列と一致する部分に全て \"search_Tag\" \
+というタグがつけられ、タグの表示属性としてその文字列が点滅するように \
+設定されます。\n")
$search_text.insert('end', "\
-եɤ߹ߤΥȥǥ쥯ȥ \"#{Dir.pwd}\" Ǥ\
+ファイル読み込みのカレントディレクトリは \"#{Dir.pwd}\" です。\
")
$search_text.set_insert '0.0'
diff --git a/ext/tk/sample/demos-jp/spin.rb b/ext/tk/sample/demos-jp/spin.rb
index 2bcc3217e6..fd51a3f457 100644
--- a/ext/tk/sample/demos-jp/spin.rb
+++ b/ext/tk/sample/demos-jp/spin.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# spin.rb --
#
@@ -22,35 +22,35 @@ base_frame = TkFrame.new($spin_demo).pack(:fill=>:both, :expand=>true)
TkLabel.new(base_frame,
:font=>$font, :wraplength=>'5i', :justify=>:left,
:text=><<EOL).pack(:side=>:top)
-ˤϣΥԥܥåɽƤޤ
-줾졢ޥ򤷤ʸϤ뤳ȤǤޤ
-ԽȤƤϡEmacs ¿˲äơŪ
-Motif ΥݡȤƤޤȤС
-Backspace Control-h Ȥϥκ¦ʸ
-Delete Control-d Ȥϱ¦ʸޤ
-ȤĹۤ褦ĹʸϤˤϡ
-ޥΥܥ󣲤򲡤ƥɥå뤳Ȥǡʸ
-򥹥󤹤뤳ȤǽǤ
-ʤǽΥԥܥåϡͤȤߤʤ褦
-ʸ󤷤ϤʤȤդƤޤ
-ܤΥԥܥå˸Τϥȥ
-ꥢԻ̾ΥꥹȤȤʤäƤޤ
-⤷ʤȤäƤ Ruby ˥󥯤Ƥ Tk 饤
-֥꤬ spinbox åȤƤʤ硢
-ǥϤޤưʤϤǤξˤ spinbox
-åȤƤ褦ʤ꿷С Tk
-Ȥ߹碌ƻ褦ˤƤ
+下には3種類のスピンボックスが表示されています。
+それぞれ、マウスで選択して文字を入力することができます。
+編集操作としては、Emacs 形式の多くに加えて、一般的な
+Motif 形式のキー操作がサポートされています。たとえば、
+Backspace と Control-h とは入力カーソルの左側の文字を
+削除し、Delete と Control-d とは右側の文字を削除します。
+入力枠の長さを越えるような長い文字列を入力した場合には、
+マウスのボタン2を押してドラッグすることで、入力文字列
+をスキャンすることが可能です。
+なお、最初のスピンボックスは、整数値とみなされるような
+文字列しか入力が許されないことに注意してください。また、
+3番目のスピンボックスで選択候補に現れるのはオーストラ
+リアの都市名のリストとなっています。
+もしあなたが使っている Ruby にリンクされている Tk ライ
+ブラリが spinbox ウィジェットを実装していない場合、この
+デモはうまく動かないはずです。その場合には spinbox ウィ
+ジェットが実装されているようなより新しいバージョンの Tk
+を組み合わせて試すようにしてください。
EOL
TkFrame.new(base_frame){|f|
pack(:side=>:bottom, :fill=>:x, :pady=>'2m')
- TkButton.new(f, :text=>'Ĥ', :width=>15, :command=>proc{
+ TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{
$spin_demo.destroy
$spin_demo = nil
}).pack(:side=>:left, :expand=>true)
- TkButton.new(f, :text=>'ɻ', :width=>15, :command=>proc{
+ TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{
showCode 'spin'
}).pack(:side=>:left, :expand=>true)
}
diff --git a/ext/tk/sample/demos-jp/states.rb b/ext/tk/sample/demos-jp/states.rb
index f354d28d84..2966e6d834 100644
--- a/ext/tk/sample/demos-jp/states.rb
+++ b/ext/tk/sample/demos-jp/states.rb
@@ -1,15 +1,15 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# listbox widget demo 'states' (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($states_demo) && $states_demo
$states_demo.destroy
$states_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$states_demo = TkToplevel.new {|w|
title("Listbox Demonstration (states)")
iconname("states")
@@ -18,20 +18,20 @@ $states_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($states_demo).pack(:fill=>:both, :expand=>true)
-# label
+# label 生成
msg = TkLabel.new(base_frame) {
font $font
wraplength '4i'
justify 'left'
- text "ˤΤƻܸ̾äСդΥꥹȥܥåǤꥹȤ򥹥뤵ΤϥСǤǤޤꥹȥܥåǥޥΥܥ2(ܥ)򲡤ޤޥɥåƤǤޤ"
+ text "下にあるのは都道府県名が入ったスクロールバー付のリストボックスです。リストをスクロールさせるのはスクロールバーでもできますし、リストボックスの中でマウスのボタン2(中ボタン)を押したままドラッグしてもできます。"
}
msg.pack('side'=>'top')
-# frame
+# frame 生成
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $states_demo
$states_demo = nil
@@ -40,13 +40,13 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'states'}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# frame
+# frame 生成
states_lbox = nil
TkFrame.new(base_frame, 'borderwidth'=>'.5c') {|w|
s = TkScrollbar.new(w)
@@ -61,13 +61,13 @@ TkFrame.new(base_frame, 'borderwidth'=>'.5c') {|w|
}.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'y')
ins_data = [
- '','Ŀ','','','','','ɲ',
- 'ʬ','','','','','','',
- '','','','','','','',
- '','Ų','纬','','','','',
- 'Ļ','ٻ','Ĺ','Ĺ','','','ʼ',
- '','ʡ','ʡ','ʡ','̳ƻ','','ܾ',
- 'ܺ','','','','²λ'
+ '愛知','青森','秋田','石川','茨城','岩手','愛媛',
+ '大分','大阪','岡山','沖縄','香川','鹿児島','神奈川',
+ '岐阜','京都','熊本','群馬','高知','埼玉','佐賀',
+ '滋賀','静岡','島根','千葉','東京','徳島','栃木',
+ '鳥取','富山','長崎','長野','奈良','新潟','兵庫',
+ '広島','福井','福岡','福島','北海道','三重','宮城',
+ '宮崎','山形','山口','山梨','和歌山'
]
states_lbox.insert(0, *ins_data)
diff --git a/ext/tk/sample/demos-jp/style.rb b/ext/tk/sample/demos-jp/style.rb
index 3189e1f6d8..813fde7a78 100644
--- a/ext/tk/sample/demos-jp/style.rb
+++ b/ext/tk/sample/demos-jp/style.rb
@@ -1,16 +1,16 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# text (display styles) widget demo (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($style_demo) && $style_demo
$style_demo.destroy
$style_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$style_demo = TkToplevel.new {|w|
title("Text Demonstration - Display Styles")
iconname("style")
@@ -19,11 +19,11 @@ $style_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($style_demo).pack(:fill=>:both, :expand=>true)
-# frame
+# frame 生成
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $style_demo
$style_demo = nil
@@ -32,15 +32,15 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'style'}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# text
+# text 生成
txt = TkText.new(base_frame){|t|
- #
+ # 生成
setgrid 'true'
#width 70
#height 32
@@ -53,7 +53,7 @@ txt = TkText.new(base_frame){|t|
}
pack('expand'=>'yes', 'fill'=>'both')
- # ƥȥ (եȴϢ)
+ # テキストタグ設定 (フォント関連)
family = 'Courier'
if $tk_version =~ /^4.*/
@@ -89,7 +89,7 @@ txt = TkText.new(base_frame){|t|
# style_tag_small = TkTextTag.new(t, 'font'=>'@cSmallFont')
# end
- # ƥȥ (꡼մϢ)
+ # テキストタグ設定 (色,レリーフ関連)
if TkWinfo.depth($root).to_i > 1
style_tag_color1 = TkTextTag.new(t, 'background'=>'#a0b7ce')
style_tag_color2 = TkTextTag.new(t, 'foreground'=>'red')
@@ -106,7 +106,7 @@ txt = TkText.new(base_frame){|t|
'relief'=>'sunken', 'borderwidth'=>1)
end
- # ƥȥ (¾)
+ # テキストタグ設定 (その他)
if $tk_version =~ /^4\.[01]/
style_tag_bgstipple = TkTextTag.new(t, 'background'=>'black',
'borderwidth'=>0,
@@ -134,134 +134,134 @@ txt = TkText.new(base_frame){|t|
'lmargin1'=>'12m', 'lmargin2'=>'6m',
'rmargin'=>'10m')
- # ƥ
- insert('end', 'Τ褦˥ƥ widget Ͼ͡ʥɽ뤳
-Ǥޤ')
- insert('end', '', style_tag_big)
- insert('end', 'Ȥᥫ˥ǥȥ뤵ޤ
-Ȥϥƥ widget Τʸ (ϰ)ФŬѤǤ
-ñʤ̾ΤȤǤ͡ɽǤޤ
-ꤹȡΥΤĤʸϻꤷɽ
-褦ˤʤޤѤǤɽϼ̤Ǥ
+ # テキスト挿入
+ insert('end', 'このようにテキスト widget は情報を様々なスタイルで表示すること
+ができます。')
+ insert('end', 'タグ', style_tag_big)
+ insert('end', 'というメカニズムでコントロールされます。
+タグとはテキスト widget 内のある文字 (の範囲)に対して適用できる
+単なる名前のことです。タグは様々な表示スタイルに設定できます。
+設定すると、そのタグのついた文字は指定したスタイルで表示される
+ようになります。使用できる表示スタイルは次の通りです。
')
insert('end', '
-1. ե', style_tag_big)
- insert('end', ' ɤ X ΥեȤǤȤޤ')
+1. フォント', style_tag_big)
+ insert('end', ' どんな X のフォントでも使えます。')
insert('end', 'large', style_tag_verybig)
insert('end', '
-Ȥ')
-# insert('end', '', style_tag_small)
+とか')
+# insert('end', '小さい', style_tag_small)
insert('end', 'small', style_tag_small)
- insert('end', 'Ȥ
+ insert('end', 'とか。
')
insert('end', '
-2. ', style_tag_big)
+2. 色', style_tag_big)
insert('end', ' ')
- insert('end', 'طʿ', style_tag_color1)
- insert('end', '')
- insert('end', 'ʿ', style_tag_color2)
- insert('end', '')
- insert('end', 'ξ', style_tag_color1, style_tag_color2)
- insert('end', 'ȤѤ뤳ȤǤޤ
+ insert('end', '背景色', style_tag_color1)
+ insert('end', 'も')
+ insert('end', '前景色', style_tag_color2)
+ insert('end', 'も')
+ insert('end', '両方', style_tag_color1, style_tag_color2)
+ insert('end', 'とも変えることができます。
')
insert('end', '
-3. ֤', style_tag_big)
- insert('end', ' Τ褦κݤ')
- insert('end', 'طʤ', style_tag_bgstipple)
- insert('end', 'ʸ', style_tag_fgstipple)
- insert('end', 'ñʤɤĤ֤
-Ǥʤ֤ȤȤǤޤ
+3. 網かけ', style_tag_big)
+ insert('end', ' このように描画の際に')
+ insert('end', '背景も', style_tag_bgstipple)
+ insert('end', '文字も', style_tag_fgstipple)
+ insert('end', '単なる塗りつぶし
+でなく、網かけを使うことができます。
')
insert('end', '
-4. ', style_tag_big)
- insert('end', ' Τ褦')
- insert('end', 'ʸ˲', style_tag_underline)
- insert('end', 'ȤǤޤ
+4. 下線', style_tag_big)
+ insert('end', ' このように')
+ insert('end', '文字に下線を引く', style_tag_underline)
+ insert('end', 'ことができます。
')
insert('end', '
-5. Ǥä', style_tag_big)
- insert('end', ' Τ褦')
- insert('end', 'ʸ˽Ťͤ', style_tag_overstrike)
- insert('end', 'ȤǤޤ
+5. 打ち消し線', style_tag_big)
+ insert('end', ' このように')
+ insert('end', '文字に重ねて線を引く', style_tag_overstrike)
+ insert('end', 'ことができます。
')
insert('end', '
-6. 3D ', style_tag_big)
- insert('end', ' طʤȤĤơʸ')
- insert('end', 'ӽФ', style_tag_raised)
- insert('end', '褦ˤ')
- insert('end', '', style_tag_sunken)
+6. 3D 効果', style_tag_big)
+ insert('end', ' 背景に枠をつけて、文字を')
+ insert('end', '飛び出す', style_tag_raised)
+ insert('end', 'ようにしたり')
+ insert('end', '沈む', style_tag_sunken)
insert('end', '
-褦ˤǤޤ
+ようにできます。
')
insert('end', '
-7. ·', style_tag_big)
- insert('end', ' Τ褦˹Ԥ
+7. 行揃え', style_tag_big)
+ insert('end', ' このように行を
')
- insert('end', '·
+ insert('end', '左に揃えたり
')
- insert('end', '·
+ insert('end', '右に揃えたり
', style_tag_right)
- insert('end', '·Ǥޤ
+ insert('end', '真中に揃えたりできます。
', style_tag_center)
insert('end', '
-8. դʸź', style_tag_big)
+8. 肩付き文字と添字', style_tag_big)
insert('end', ' 10')
insert('end', 'n', style_tag_super)
- insert('end', ' Τ褦˸դʸθ̤䡢')
+ insert('end', ' のように肩付き文字の効果や、')
insert('end', '
X')
insert('end', 'i', style_tag_sub)
- insert('end', 'Τ褦źθ̤ФȤǤޤ
+ insert('end', 'のように添字の効果を出すことができます。
')
insert('end', '
-9. ޡ', style_tag_big)
- insert('end', 'ƥȤκ¦;ʬʶ֤ȤǤޤ:
+9. マージン', style_tag_big)
+ insert('end', 'テキストの左側に余分な空白を置くことができます:
')
- insert('end', 'ϥޡλǤ꡼',
+ insert('end', 'この段落はマージンの使用例です。スクリーン',
style_tag_margins)
- insert('end', 'ޤ֤ɽƤ1ԤΥƥȤǤ',
+ insert('end', '上で折り返されて表示されている1行のテキストです。',
style_tag_margins)
- insert('end', '¦ˤ2Υޡޤ', style_tag_margins)
- insert('end', '1ܤФΤȡ', style_tag_margins)
- insert('end', '2ܰʹߤϢ³ޡ', style_tag_margins)
- insert('end', 'Ǥޤ¦ˤޡ󤬤ޤ', style_tag_margins)
- insert('end', 'Ԥޤ֤֤뤿˻Ѥ뤳ȤǤޤ
+ insert('end', '左側には2種類のマージンを持ちます。', style_tag_margins)
+ insert('end', '1行目に対するものと、', style_tag_margins)
+ insert('end', '2行目以降の連続したマージン', style_tag_margins)
+ insert('end', 'です。また右側にもマージンがあります。', style_tag_margins)
+ insert('end', '行の折り返し位置を決めるために使用することができます。
', style_tag_margins)
insert('end', '
-10. ڡ', style_tag_big)
- insert('end', '3ĤΥѥ᡼ǹԤΥڡ󥰤')
- insert('end', '椹
-뤳ȤǤޤSpacing1ǡԤ')
- insert('end', 'ˤɤΤ餤ζ֤֤
+10. スペーシング', style_tag_big)
+ insert('end', '3つのパラメータで行のスペーシングを')
+ insert('end', '制御す
+ることができます。Spacing1で、行の')
+ insert('end', '上にどのくらいの空間を置くか、
spacing3')
- insert('end', 'ǹԤβˤɤΤ餤ζ֤֤')
- insert('end', 'Ԥޤ֤Ƥʤ
-Сspacing2ǡ')
- insert('end', 'ƥȹԤƤԤδ֤ˤɤΤ餤')
- insert('end', 'ζ֤
-򼨤ޤ
+ insert('end', 'で行の下にどのくらいの空間を置くか、')
+ insert('end', '行が折り返されているなら
+ば、spacing2で、')
+ insert('end', 'テキスト行を生成している行の間にどのくらい')
+ insert('end', 'の空間を置
+くかを示します。
')
- insert('end', 'ΥǥȤ줿ϤɤΤ褦',
+ insert('end', 'これらのインデントされた段落はどのように',
style_tag_spacing)
- insert('end', 'ڡ󥰤ԤΤ򼨤ޤ',
+ insert('end', 'スペーシングがが行われるのかを示します。',
style_tag_spacing)
- insert('end', 'ϼºݤϥƥwidget', style_tag_spacing)
- insert('end', '1ԤǡwidgetˤäޤޤƤޤ
+ insert('end', '各段落は実際はテキストwidget', style_tag_spacing)
+ insert('end', 'の1行で、widgetによって折り畳まれています。
', style_tag_spacing)
- insert('end', 'Spacing1ϤΥƥȤǤ10point', style_tag_spacing)
- insert('end', 'ꤵƤޤ', style_tag_spacing)
- insert('end', 'ˤꡢδ֤礭ʴֳ֤', style_tag_spacing)
- insert('end', '¸ߤƤޤ', style_tag_spacing)
- insert('end', 'Spacing22pointꤵƤޤ', style_tag_spacing)
- insert('end', 'ˤۤξֳ֤¸ߤƤޤ',
+ insert('end', 'Spacing1はこのテキストでは10pointに', style_tag_spacing)
+ insert('end', '設定されています。', style_tag_spacing)
+ insert('end', 'これにより、段落の間に大きな間隔が', style_tag_spacing)
+ insert('end', '存在しています。', style_tag_spacing)
+ insert('end', 'Spacing2は2pointに設定されています。', style_tag_spacing)
+ insert('end', 'これで段落の中にほんの少し間隔が存在しています。',
style_tag_spacing)
- insert('end', 'Spacing3ϤǤϻѤƤޤ
+ insert('end', 'Spacing3はこの例では使用されていません。
', style_tag_spacing)
- insert('end', 'ֳ֤ɤˤ뤫򸫤С',
+ insert('end', '間隔がどこにあるかを見たければ、これらの段落の',
style_tag_spacing)
- insert('end', 'ʤǥƥȤ򤷤Ƥ', style_tag_spacing)
- insert('end', 'ȿžʬˤ;ʬˤȤ줿ֳ֤', style_tag_spacing)
- insert('end', 'ޤޤƤޤ
+ insert('end', 'なかでテキストを選択してください。選択の', style_tag_spacing)
+ insert('end', '反転した部分には余分にとられた間隔が', style_tag_spacing)
+ insert('end', '含まれています。
', style_tag_spacing)
}
diff --git a/ext/tk/sample/demos-jp/tcolor b/ext/tk/sample/demos-jp/tcolor
index 1c83a4b10b..f2d5458db4 100644
--- a/ext/tk/sample/demos-jp/tcolor
+++ b/ext/tk/sample/demos-jp/tcolor
@@ -1,20 +1,20 @@
#!/usr/bin/env ruby
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# tcolor --
-# ΥץȤRGB,HSB,CYM򥵥ݡȤ
-# ʰץ顼ǥǤ
+# このスクリプトはRGB,HSB,CYM形式をサポートする
+# 簡易カラーエディタです。
#
# Copyright (C) 1998 Takaaki Tateishi(ttate@jaist.ac.jp)
# last update: Thu Jun 18 06:32:35 JST 1998
#
-# ޤtk.rbɤ߹ࡣ
+# まずはtk.rbを読み込む。
require "tk"
-# TkˤäѹѿTkVariableΥ󥹥󥹤Ȥ
+# Tkによって変更される変数はTkVariableのインスタンスを使う。
$colorSpace = TkVariable.new(:rgb)
$master = nil
@@ -32,13 +32,13 @@ $label2 = TkVariable.new("label2")
$label3 = TkVariable.new("label3")
-# ꥽ǡ١
+# リソースデータベースの設定
if (TkVarAccess.new('tcl_platform')['platform'] == 'unix')
TkOptionDB.add('*Entry.background', 'white')
end
-# ƥ٥ѤΥ᥽å
+# 各イベント用のメソッド
def rgbToHsv(red,green,blue)
@@ -277,7 +277,7 @@ end
-# tcolorѤΥ˥塼
+# tcolor用のメニュー
class TkColorMenuFrame<TkFrame
def initialize(parent)
@@ -285,10 +285,10 @@ class TkColorMenuFrame<TkFrame
"relief"=>"raised",
"borderwidth"=>"2")
- # File˥塼ܥ
+ # Fileメニューボタンの生成
@file = TkMenubutton.new(self){|button|
- # File˥塼κ
+ # Fileメニューの作成
@file_menu = TkMenu.new(button){
add "radio",
"label" => "RGB color space",
@@ -326,7 +326,7 @@ class TkColorMenuFrame<TkFrame
"command" => proc{exit}
}
- # File˥塼FileܥϢդ
+ # FileメニューとFileボタンを関連付ける
menu @file_menu
text "File"
@@ -338,7 +338,7 @@ class TkColorMenuFrame<TkFrame
end
-# Υե졼ΤΥ饹
+# 下部のフレームのためのクラス
class TkColorBotFrame<TkFrame
def initialize(parent)
super(parent,
@@ -364,7 +364,7 @@ class TkColorBotFrame<TkFrame
end
-# ʺΥե졼
+# 中段左のフレーム
class TkColorMiddleLeftFrame<TkFrame
def initialize(parent)
super(parent)
@@ -408,9 +408,9 @@ class TkColorMiddleLeftFrame<TkFrame
end
-# Υե졼
+# 中段中央のフレーム
class TkColorMiddleMiddleFrame<TkFrame
- # @scale1,@scale2,@scale3黲ȤΤߵĤ롣(ѹԲ)
+ # @scale1,@scale2,@scale3を外部から参照のみ許可する。(変更不可)
attr_reader :scale1, :scale2, :scale3
def initialize(parent)
@@ -485,7 +485,7 @@ end
-# ʤΥե졼
+# 中段のフレーム
class TkColorMiddleFrame<TkFrame
attr_reader :left, :middle, :right
@@ -529,6 +529,6 @@ end
$root = TkColor.new
-# ٥ȤԤİ٤˥롼פ롣
+# イベントを待つ為にループに入る。
changeColorSpace :rgb
Tk.mainloop
diff --git a/ext/tk/sample/demos-jp/text.rb b/ext/tk/sample/demos-jp/text.rb
index ea15064830..e698a79246 100644
--- a/ext/tk/sample/demos-jp/text.rb
+++ b/ext/tk/sample/demos-jp/text.rb
@@ -1,15 +1,15 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# text (basic facilities) widget demo (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($text_demo) && $text_demo
$text_demo.destroy
$text_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$text_demo = TkToplevel.new {|w|
title("Text Demonstration - Basic Facilities")
iconname("text")
@@ -25,11 +25,11 @@ else
undo_support = true
end
-# frame
+# frame 生成
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $text_demo
$text_demo = nil
@@ -38,14 +38,14 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'text'}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# text
+# text 生成
TkText.new(base_frame){|t|
- #
+ # 生成
relief 'sunken'
bd 2
setgrid 1
@@ -57,62 +57,62 @@ TkText.new(base_frame){|t|
}
pack('expand'=>'yes', 'fill'=>'both')
- # ƥ
+ # テキスト挿入
insert('0.0', <<EOT)
-Υɥϥƥ widget Ǥ1ԤޤϤʾΥƥȤɽ
-Խ뤳ȤǤޤʲϥƥ widget ǤǤˤĤ
-ޤȤ᤿ΤǤ
-
-1. 롣СǥƥȤɽʬưȤǤޤ
-
-2. ˥󥰡ƥȤΥɥǥޥܥ2 (ܥ)
-ƾ岼˥ɥåƤȥƥȤ®ǥɥå졢
-Ƥ򤶤äį뤳ȤǤޤ
-
-3. ƥȤޥܥ1 (ܥ) 򲡤򥻥
-ȤƤƥȤϤƤϤΤ widget ޤ
-
-4. 򡣤ϰϤʸ򤹤ˤϥޥܥ1 򲡤ɥå
-Ƥ٥ܥΥ顢եȥ򲡤ʤܥ1 򲡤
-ȤϰϤĴǤޤϰϤκǸޥ
-Ǥᤤ֤˥ꥻåȤܥΥ˥ޥɥå뤳ȤǤ
-ϰϤĴǤޤ֥륯åǥɤ򡢤ޤȥץ륯
-ǹΤ򤹤뤳ȤǤޤ
-
-5. õִƥȤõˤϡõʸ򤷤ƥХå
-ڡǥ꡼ȥϤƤ뤤ϡƥȤ
-Ϥ򤵤줿ƥȤִޤ
-
-6. ʬΥԡʬ򤳤ΥɥΤɤ˥ԡ
-ˤϡޤԡ(ǡ뤤̤Υץꥱ)
-ܥ 2 򥯥åơΰ֤˥ԡƤ
-
-7. Խƥ widget Emacs ΥХɤ˲äɸŪʤ Motif
-Խǽ򥵥ݡȤƤޤХåڡȥȥ-H
-κ¦ʸޤǥ꡼ȥȥȥ-D
-α¦ʸޤMeta-Хåڡ
-¦ñMeta-D κ¦ñޤ
-ȥ-K 뤫ޤǤΰ֤˲
-ʤäϡԤޤ#{
+このウィンドウはテキスト widget です。1行またはそれ以上のテキストを表
+示・編集することができます。以下はテキスト widget でできる操作について
+まとめたものです。
+
+1. スクロール。スクロールバーでテキストの表示部分を動かすことができます。
+
+2. スキャニング。テキストのウィンドウでマウスボタン2 (中ボタンを) を押
+して上下にドラッグしてください。そうするとテキストが高速でドラッグされ、
+内容をざっと眺めることができます。
+
+3. テキストの挿入。マウスボタン1 (左ボタン) を押し、挿入カーソルをセッ
+トしてからテキストを入力してください。入力したものが widget に入ります。
+
+4. 選択。ある範囲の文字を選択するにはマウスボタン1 を押し、ドラッグし
+てください。一度ボタンを離したら、シフトキーを押しながらボタン1 を押す
+ことで選択範囲の調整ができます。これは選択範囲の最後をマウスカーソルに
+最も近い位置にリセットし、ボタンを離す前にマウスをドラッグすることでさ
+らに選択範囲を調整できます。ダブルクリックでワードを、またトリプルクリッ
+クで行全体を選択することができます。
+
+5. 消去と置換。テキストを消去するには、消去したい文字を選択してバック
+スペースかデリートキーを入力してください。あるいは、新しいテキストを
+入力すると選択されたテキストと置換されます。
+
+6. 選択部分のコピー。選択部分をこのウィンドウの中のどこかにコピーする
+には、まずコピーしたい所を選択(ここで、あるいは別のアプリケーションで)
+し、ボタン 2 をクリックして、挿入カーソルの位置にコピーしてください。
+
+7. 編集。テキスト widget は Emacs のキーバインドに加えて標準的なの Motif
+の編集機能をサポートしています。バックスペースとコントロール-H は挿入
+カーソルの左側の文字を削除します。デリートキーとコントロール-D は挿入
+カーソルの右側の文字を削除します。Meta-バックスペースは挿入カーソルの
+右側の単語を削除し、Meta-D は挿入カーソルの左側の単語を削除します。
+コントロール-K は挿入カーソルから行末までを削除し、その位置に改行
+しかなかった場合は、改行を削除します。#{
if undo_support
- undo_text = "Control-z ϺǸ˹Ԥäѹμä(undo)Ԥ"
+ undo_text = "Control-z は最後に行った変更の取り消し(undo)を行い、"
case $tk_platform['platform']
when "unix", "macintosh"
undo_text << "Control-Shift-z"
else # 'windows'
undo_text << "Control-y"
end
- undo_text << "undoѹκŬ(redo)Ԥޤ"
+ undo_text << "はundoした変更の再適用(redo)を行います。"
else
""
end
}
-8. ɥΥꥵ widget "setGrid" ץ򥪥ˤ
-ƤޤΤǡɥꥵˤϹ⤵Ͼʸʸ
-ܤˤʤޤޤɥ򶹤ˤĹԤư
-Ūޤ֤졢ƤƤ褦ˤʤäƤޤ
+8. ウィンドウのリサイズ。この widget は "setGrid" オプションをオンにし
+てありますので、ウィンドウをリサイズする時には高さと幅は常に文字高と文
+字幅の整数倍になります。また、ウィンドウを狭くした場合には長い行が自動
+的に折り返され、常に全ての内容が見えるようになっています。
EOT
set_insert('0.0')
diff --git a/ext/tk/sample/demos-jp/textpeer.rb b/ext/tk/sample/demos-jp/textpeer.rb
index de604f1940..4d896d2a12 100644
--- a/ext/tk/sample/demos-jp/textpeer.rb
+++ b/ext/tk/sample/demos-jp/textpeer.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# text widget peering demo (called by 'widget')
#
@@ -22,17 +22,17 @@ count = [0]
## Define a widget that we peer from; it won't ever actually be shown though
first = TkText.new(base_frame, :widgetname=>"text#{count[0] += 1}")
-first.insert :end,"ΥǥϰĤȤƥȥåȤ򼨤ޤ"
-first.insert :end,"ΥƥȥåȤ(ԥ;peer)δط"
-first.insert :end,"ʤäƤޤ"
-first.insert :end,"ϡפȤʤǡǥ϶̤ΤΤޤ"
-first.insert :end,"ɽ֡Խ֡ϰ(selection)ˤĤƤ"
-first.insert :end,"Ω˻ĤȤǤޤ"
-first.insert :end,"ƥƥȥåȤƤˤ"
-first.insert :end,"֥ԥ(peer)κץܥȤС"
-first.insert :end,"ʥԥɲä뤳ȤǽǤ"
-first.insert :end,"ޤ֥ԥ(peer)ξõץܥȤС"
-first.insert :end,"ΥԥåȤõ뤳ȤǤޤ"
+first.insert :end,"このデモは一つの組を成したテキストウィジェットを示します。"
+first.insert :end,"それらのテキストウィジェットは対等(ピア;peer)の関係に"
+first.insert :end,"なっています。"
+first.insert :end,"それらは、基盤となるデータモデルは共通のものを持ちますが、"
+first.insert :end,"画面表示位置、編集位置、選択範囲(selection)については"
+first.insert :end,"独立に持つことができます。"
+first.insert :end,"各テキストウィジェットの脇にある"
+first.insert :end,"「ピア(peer)の作成」ボタンを使えば、"
+first.insert :end,"新たなピアを追加することが可能です。"
+first.insert :end,"また「ピア(peer)の消去」ボタンを使えば、"
+first.insert :end,"特定のピアウィジェットを消去することもできます。"
Tk.update_idletasks ## for 'first' widget
@@ -44,10 +44,10 @@ def makeClone(count, win, txt)
sbar = TkScrollbar.new(win, :widgetname=>"sb#{cnt}")
peer.yscrollbar sbar
b1 = TkButton.new(win, :widgetname=>"clone#{cnt}",
- :text=>'ԥ(peer)κ',
+ :text=>'ピア(peer)の作成',
:command=>proc{makeClone(count, win, peer)})
b2 = TkButton.new(win, :widgetname=>"kill#{cnt}",
- :text=>'ԥ(peer)ξõ',
+ :text=>'ピア(peer)の消去',
:command=>proc{killClone(win, cnt)})
row = cnt * 2
TkGrid.configure(peer, sbar, b1, :sticky=>'nsew', :row=>row)
@@ -68,12 +68,12 @@ first.destroy
## See Code / Dismiss buttons
TkFrame.new(base_frame){|f|
- TkButton.new(f, :text=>'Ĥ', :width=>15, :command=>proc{
+ TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{
$textpeer_demo.destroy
$textpeer_demo = nil
}).pack(:side=>:left, :expand=>true)
- TkButton.new(f, :text=>'ɻ', :width=>15, :command=>proc{
+ TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{
showCode 'textpeer'
}).pack(:side=>:left, :expand=>true)
diff --git a/ext/tk/sample/demos-jp/toolbar.rb b/ext/tk/sample/demos-jp/toolbar.rb
index 570d52704f..3ee7a5f9d8 100644
--- a/ext/tk/sample/demos-jp/toolbar.rb
+++ b/ext/tk/sample/demos-jp/toolbar.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# toolbar.rb --
#
@@ -21,32 +21,32 @@ base_frame = Ttk::Frame.new($toolbar_demo).pack(:fill=>:both, :expand=>true)
if Tk.windowingsystem != 'aqua'
msg = Ttk::Label.new(base_frame, :wraplength=>'4i', :text=><<EOL)
-ΥǥǤϡġСɤΤ褦ˤŬڤ˥ơб뤫\
-ޤɤΤ褦ˤڤΥǽˤ뤫򼨤Ƥޤ\
-ʤġСڤΥˤTcl/Tk8.5ʾεǽɬפǤˡ\
-ġСΥܥϡ'Toolbutton'Ѥ褦뤳Ȥǡ\
-"toolbar style"ܥȤʤ褦°ꤵƤޤ\
-ġСκüˤϴñʥޡ֤Ƥޤ\
-ޡ˥ޥ뤬Ȱư˥뤬Ѳޤ\
-ǥġСư褦˥ɥåȡ\
-ġСΤڤΥΩȥåץ٥륦åȤ\
-뤳ȤǤޤ\
-ڤΥġСפȤʤäˤϡ\
-Ūʥȥåץ٥륦åȤƱͤñĤ뤳Ȥǡ
-ƤӸΥɥĥդǤ礦
+このデモでは,ツールバーをどのようにして適切にテーマ対応させるか,\
+また,どのようにして切り離し可能にするかを示しています\
+(ただし,ツールバーの切り離しにはTcl/Tk8.5以上の機能が必要です).\
+ツールバーのボタンは,'Toolbutton'スタイルを使用するように明示することで,\
+"toolbar style"ボタンとなるように属性設定されています.\
+ツールバーの左端には簡単なマーカーが置かれています.\
+マーカー上にマウスカーソルが来ると移動アイコンにカーソルが変化します.\
+そこでツールバーを動かすようにドラッグすると,\
+ツールバー全体を切り離して独立したトップレベルウィジェットに\
+することができます.\
+切り離したツールバーが不要となった時には,\
+一般的なトップレベルウィジェットと同様に単純に閉じることで,
+再び元のウィンドウに張り付けられるでしょう.
EOL
else
msg = Ttk::Label.new(base_frame, :wraplength=>'4i', :text=><<EOL)
-ΥǥǤϡġСɤΤ褦ˤŬڤ˥ơб뤫\
-Ƥޤ\
-ġСΥܥϡ'Toolbutton'Ѥ褦뤳Ȥǡ\
-"toolbar style"ܥȤʤ褦°ꤵƤޤ
+このデモでは,ツールバーをどのようにして適切にテーマ対応させるかを\
+示しています.\
+ツールバーのボタンは,'Toolbutton'スタイルを使用するように明示することで,\
+"toolbar style"ボタンとなるように属性設定されています.
EOL
end
## Set up the toolbar hull
-tbar_base = Tk::Frame.new(base_frame, # Tk ɸ frame ǤʤФʤޤ
- :widgetname=>'toolbar') # ɥȥʸȤ뤿ˡå̾Ƥޤ
+tbar_base = Tk::Frame.new(base_frame, # Tk 標準の frame でなければなりません.
+ :widgetname=>'toolbar') # ウィンドウタイトル文字列とするために,ウィジェット名を明示しています.
sep = Ttk::Separator.new(base_frame)
to_base = Ttk::Frame.new(tbar_base, :cursor=>'fleur')
if Tk.windowingsystem != 'aqua'
@@ -72,7 +72,7 @@ if Tk.windowingsystem != 'aqua'
self.grid_remove
w.grid_remove
self.wm_manage
- # self.wm_title('Toolbar') # ⤷å̾򥦥ɥȥˤʤʤ顤ꤷƤ
+ # self.wm_title('Toolbar') # もしウィジェット名をウィンドウタイトルにしたくないなら,ここで設定してください
self.wm_protocol('WM_DELETE_WINDOW'){ self.untearoff(w) }
end
def tbar_base.untearoff(w)
@@ -86,17 +86,17 @@ end
text = TkText.new(base_frame, :width=>40, :height=>10)
## Toolbar contents
-tb_btn = Ttk::Button.new(tbar_base, :text=>'ܥ', :style=>'Toolbutton',
+tb_btn = Ttk::Button.new(tbar_base, :text=>'ボタン', :style=>'Toolbutton',
:command=>proc{
- text.insert(:end, "ܥ󤬲ޤ\n")
+ text.insert(:end, "ボタンが押されました.\n")
})
-tb_chk = Ttk::Checkbutton.new(tbar_base, :text=>'åܥ',
+tb_chk = Ttk::Checkbutton.new(tbar_base, :text=>'チェックボタン',
:style=>'Toolbutton',
:variable=>(check = TkVariable.new),
:command=>proc{
- text.insert(:end, "åܥͤ#{check.value}Ǥ\n")
+ text.insert(:end, "チェックボタンの値は#{check.value}です.\n")
})
-tb_mbtn = Ttk::Menubutton.new(tbar_base, :text=>'˥塼')
+tb_mbtn = Ttk::Menubutton.new(tbar_base, :text=>'メニュー')
tb_combo = Ttk::Combobox.new(tbar_base, :value=>TkFont.families,
:state=>:readonly)
tb_mbtn.menu(menu = Tk::Menu.new(tb_mbtn))
@@ -121,10 +121,10 @@ Ttk::Frame.new(base_frame) {|frame|
sep = Ttk::Separator.new(frame)
Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
TkGrid('x',
- Ttk::Button.new(frame, :text=>'ɻ',
+ Ttk::Button.new(frame, :text=>'コード参照',
:image=>$image['view'], :compound=>:left,
:command=>proc{showCode 'toolbar'}),
- Ttk::Button.new(frame, :text=>'Ĥ',
+ Ttk::Button.new(frame, :text=>'閉じる',
:image=>$image['delete'], :compound=>:left,
:command=>proc{
$toolbar_demo.destroy
diff --git a/ext/tk/sample/demos-jp/tree.rb b/ext/tk/sample/demos-jp/tree.rb
index 00d715282b..1c779391d4 100644
--- a/ext/tk/sample/demos-jp/tree.rb
+++ b/ext/tk/sample/demos-jp/tree.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# tree.rb --
#
@@ -24,14 +24,14 @@ base_frame = TkFrame.new($tree_demo).pack(:fill=>:both, :expand=>true)
Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i',
:justify=>:left, :anchor=>'n', :padding=>[10, 2, 10, 6],
:text=><<EOL).pack(:fill=>:x)
-TtkȤϡơ޻ǽʿåȽǤ\
-Υץϡե륷ƥΤ褦ʳŪʥǡ\
-ȤǤ褦ˤTtk::TreeviewåȤޤǤޤ\
-Ttk::TreeviewåȤϡڹ¤ΤɽǽˤǤʤ\
-ɲþ(Υץξϥե륵)ɽ뤿\
-ǤդθĿɲåⰷȤǤޤ\
-ޤΥȥ֤ζڤʬɥå뤳Ȥǡ\
-ѹ뤳ȤǽǤ
+Ttkとは,テーマ指定可能な新しいウィジェット集合です.\
+このサンプルは,ファイルシステムのような階層的なデータ集合を\
+参照できるようにしたTtk::Treeviewウィジェットを含んでいます.\
+Ttk::Treeviewウィジェットは,木構造自体の表示を可能にするだけでなく,\
+追加情報(このサンプルの場合はファイルサイズ)を表示するために\
+任意の個数の追加カラムも扱うこともできます.\
+また,カラムのタイトル間の区切り部分をドラッグすることで,\
+カラムの幅を変更することも可能です.
EOL
## See Code / Dismiss
@@ -39,10 +39,10 @@ Ttk::Frame.new(base_frame) {|frame|
sep = Ttk::Separator.new(frame)
Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
TkGrid('x',
- Ttk::Button.new(frame, :text=>'ɻ',
+ Ttk::Button.new(frame, :text=>'コード参照',
:image=>$image['view'], :compound=>:left,
:command=>proc{showCode 'tree'}),
- Ttk::Button.new(frame, :text=>'Ĥ',
+ Ttk::Button.new(frame, :text=>'閉じる',
:image=>$image['delete'], :compound=>:left,
:command=>proc{
$tree_demo.destroy
diff --git a/ext/tk/sample/demos-jp/ttkbut.rb b/ext/tk/sample/demos-jp/ttkbut.rb
index 90ec3fce5b..ccde541019 100644
--- a/ext/tk/sample/demos-jp/ttkbut.rb
+++ b/ext/tk/sample/demos-jp/ttkbut.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# ttkbut.rb
#
@@ -23,22 +23,22 @@ base_frame = TkFrame.new($ttkbut_demo).pack(:fill=>:both, :expand=>true)
Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left,
:text=><<EOL).pack(:side=>:top, :fill=>:x)
-TtkȤϡơ޻ǽʿåȽǤ\
-ʤܤˤƤΤTtkΥơ޲٥ǡ\
-ˤTtkΥ٥ե졼˻ĤΥ롼פTtkåȤ\
-ɽƤޤ
-ǽΥ롼פƥܥǤꡤ\
-줾쥯åиߤΥץꥱΥơޤꤵޤ
-ܤΥ롼פϻĤΥåܥ󽸹Ǥ\
-ƽδ֤ˤϡѥ졼åȤ֤Ƥޤ\
-ʤͭץܥϡΥȥåץ٥륦å\
-¾Τ٤ƤΥơ޲åȤξ(state)"disabled"ɤ\
-ȥ뤹뤳ȤդƤ
-ܤΥ롼פϴϢդ줿饸ܥ󽸹ȤʤäƤޤ
+Ttkとは,テーマ指定可能な新しいウィジェット集合です.\
+今,あなたが目にしているのはTtkのテーマ化ラベルで,\
+下にはTtkのラベルフレームの中に三つのグループのTtkウィジェットが\
+表示されています.
+最初のグループは全てボタンであり,\
+それぞれクリックすれば現在のアプリケーションのテーマが設定されます.
+2番目のグループは三つのチェックボタン集合です.\
+各集合の間には,セパレータウィジェットが置かれています.\
+なお「有効化」ボタンは,このトップレベルウィジェット内の\
+他のすべてのテーマ化ウィジェットの状態(state)が"disabled"かどうかを\
+コントロールすることに注意してください.
+3番目のグループは関連付けられたラジオボタン集合となっています.
EOL
## Add buttons for setting the theme
-buttons = Ttk::Labelframe.new(base_frame, :text=>'ܥ')
+buttons = Ttk::Labelframe.new(base_frame, :text=>'ボタン')
# Ttk::Style.theme_names.each{|theme|
# Ttk::Button.new(buttons, :text=>theme,
# :command=>proc{Ttk::Style.theme_use theme}).pack(:pady=>2)
@@ -66,9 +66,9 @@ def setState(root, value, *excepts)
end
## Set up the checkbutton group
-checks = Ttk::Labelframe.new(base_frame, :text=>'åܥ')
+checks = Ttk::Labelframe.new(base_frame, :text=>'チェックボタン')
enabled = TkVariable.new(true)
-e = Ttk::Checkbutton.new(checks, :text=>'ͭ', :variable=>enabled,
+e = Ttk::Checkbutton.new(checks, :text=>'有効化', :variable=>enabled,
:command=>proc{
setState($ttkbut_demo,
((enabled.bool)? "!disabled" : "disabled"),
@@ -84,15 +84,15 @@ tomato = TkVariable.new
basil = TkVariable.new
oregano = TkVariable.new
-c1 = Ttk::Checkbutton.new(checks, :text=>'', :variable=>cheese)
-c2 = Ttk::Checkbutton.new(checks, :text=>'ȥޥ', :variable=>tomato)
-c3 = Ttk::Checkbutton.new(checks, :text=>'Х', :variable=>basil)
-c4 = Ttk::Checkbutton.new(checks, :text=>'쥬', :variable=>oregano)
+c1 = Ttk::Checkbutton.new(checks, :text=>'チーズ', :variable=>cheese)
+c2 = Ttk::Checkbutton.new(checks, :text=>'トマト', :variable=>tomato)
+c3 = Ttk::Checkbutton.new(checks, :text=>'バジル', :variable=>basil)
+c4 = Ttk::Checkbutton.new(checks, :text=>'オレガノ', :variable=>oregano)
Tk.pack(e, sep1, c1, c2, sep2, c3, c4, :fill=>:x, :pady=>2)
## Set up the radiobutton group
-radios = Ttk::Labelframe.new(base_frame, :text=>'饸ܥ')
+radios = Ttk::Labelframe.new(base_frame, :text=>'ラジオボタン')
happyness = TkVariable.new
@@ -114,18 +114,18 @@ Ttk::Frame.new(base_frame) {|frame|
sep = Ttk::Separator.new(frame)
Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
TkGrid('x',
- Ttk::Button.new(frame, :text=>'ѿ',
+ Ttk::Button.new(frame, :text=>'変数参照',
:image=>$image['view'], :compound=>:left,
:command=>proc{
- showVars(base_frame, ['ͭ', enabled],
- ['', cheese], ['ȥޥ', tomato],
- ['Х', basil], ['쥬', oregano],
- ['ʡ', happyness])
+ showVars(base_frame, ['有効化', enabled],
+ ['チーズ', cheese], ['トマト', tomato],
+ ['バジル', basil], ['オレガノ', oregano],
+ ['幸福度', happyness])
}),
- Ttk::Button.new(frame, :text=>'ɻ',
+ Ttk::Button.new(frame, :text=>'コード参照',
:image=>$image['view'], :compound=>:left,
:command=>proc{showCode 'ttkbut'}),
- Ttk::Button.new(frame, :text=>'Ĥ',
+ Ttk::Button.new(frame, :text=>'閉じる',
:image=>$image['delete'], :compound=>:left,
:command=>proc{
tmppath = $ttkbut_demo
diff --git a/ext/tk/sample/demos-jp/ttkmenu.rb b/ext/tk/sample/demos-jp/ttkmenu.rb
index 9e78678c8e..aa9db5019f 100644
--- a/ext/tk/sample/demos-jp/ttkmenu.rb
+++ b/ext/tk/sample/demos-jp/ttkmenu.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# ttkmenu.rb --
#
@@ -22,21 +22,21 @@ base_frame = Ttk::Frame.new($ttkmenu_demo).pack(:fill=>:both, :expand=>true)
Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left,
:text=><<EOL).pack(:side=>:top, :fill=>:x)
-TtkȤϡơ޻ǽʿåȽǤ\
-ˤơޤб뤳ȤǤ褦ˤʤäåȤΤҤȤĤ\
-˥塼ܥ󤬤ޤ\
-ʲǤϡơޤб˥塼ܥ󤬤ĤɽƤޤ\
-Ȥäơ߻Υơޤѹ뤳ȤǽǤ\
-ơޤ򤬥˥塼ܥ󼫿ȤθݤѲͻҤ䡤\
-Υ˥塼ܥۤʤ륹\
-(ġСǤΰŪɽŬ)ɽƤͻҤ\
-ܤƤ\
-ʤ˥塼ܥˤĤƤϥơޤбåȤޤ\
-˥塼ˤĤƤϥơޤбåȤϴޤޤƤޤ\
-ͳϡɸTkΥ˥塼åȤ\
-٤ƤΥץåȥۡǽʬɹʸݤäƤ롤\
-äˡ¿δĶǤδĶηϤȤʤ褦˼Ƥ\
-ȽǤ줿Ȥˤޤ
+Ttkとは,テーマ指定可能な新しいウィジェット集合です.\
+これによりテーマに対応することができるようになったウィジェットのひとつに\
+メニューボタンがあります.\
+以下では,テーマに対応したメニューボタンがいくつか表示されています.\
+それらを使って,現在使用中のテーマを変更することが可能です.\
+テーマの選択がメニューボタン自身の見掛けを変化させる様子や,\
+中央のメニューボタンだけが異なるスタイル\
+(ツールバーでの一般的な表示に適したもの)で表示されている様子に\
+注目してください.\
+なお,メニューボタンについてはテーマに対応したウィジェットがありますが,\
+メニューについてはテーマに対応したウィジェットは含まれていません.\
+その理由は,標準のTkのメニューウィジェットが\
+すべてのプラットホームで十分に良好な見掛けと操作性を持っている,\
+特に,多くの環境でその環境本来の操作体系となるように実装されていると\
+判断されたことによります.
EOL
Ttk::Separator.new(base_frame).pack(:side=>:top, :fill=>:x)
@@ -46,10 +46,10 @@ Ttk::Frame.new($ttkmenu_demo) {|frame|
sep = Ttk::Separator.new(frame)
Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
TkGrid('x',
- Ttk::Button.new(frame, :text=>'ɻ',
+ Ttk::Button.new(frame, :text=>'コード参照',
:image=>$image['view'], :compound=>:left,
:command=>proc{showCode 'ttkmenu'}),
- Ttk::Button.new(frame, :text=>'Ĥ',
+ Ttk::Button.new(frame, :text=>'閉じる',
:image=>$image['delete'], :compound=>:left,
:command=>proc{
$ttkmenu_demo.destroy
@@ -60,12 +60,12 @@ Ttk::Frame.new($ttkmenu_demo) {|frame|
pack(:side=>:bottom, :fill=>:x)
}
-b1 = Ttk::Menubutton.new(base_frame,:text=>'ơޤ',:direction=>:above)
-b2 = Ttk::Menubutton.new(base_frame,:text=>'ơޤ',:direction=>:left)
-b3 = Ttk::Menubutton.new(base_frame,:text=>'ơޤ',:direction=>:right)
-b4 = Ttk::Menubutton.new(base_frame,:text=>'ơޤ',:direction=>:flush,
+b1 = Ttk::Menubutton.new(base_frame,:text=>'テーマを選択',:direction=>:above)
+b2 = Ttk::Menubutton.new(base_frame,:text=>'テーマを選択',:direction=>:left)
+b3 = Ttk::Menubutton.new(base_frame,:text=>'テーマを選択',:direction=>:right)
+b4 = Ttk::Menubutton.new(base_frame,:text=>'テーマを選択',:direction=>:flush,
:style=>Ttk::Menubutton.style('Toolbutton'))
-b5 = Ttk::Menubutton.new(base_frame,:text=>'ơޤ',:direction=>:below)
+b5 = Ttk::Menubutton.new(base_frame,:text=>'テーマを選択',:direction=>:below)
b1.menu(m1 = Tk::Menu.new(b1, :tearoff=>false))
b2.menu(m2 = Tk::Menu.new(b2, :tearoff=>false))
diff --git a/ext/tk/sample/demos-jp/ttknote.rb b/ext/tk/sample/demos-jp/ttknote.rb
index f0cd258893..f3b2fa5881 100644
--- a/ext/tk/sample/demos-jp/ttknote.rb
+++ b/ext/tk/sample/demos-jp/ttknote.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# ttknote.rb --
#
@@ -23,10 +23,10 @@ Ttk::Frame.new($ttknote_demo) {|frame|
sep = Ttk::Separator.new(frame)
Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
TkGrid('x',
- Ttk::Button.new(frame, :text=>'ɻ',
+ Ttk::Button.new(frame, :text=>'コード参照',
:image=>$image['view'], :compound=>:left,
:command=>proc{showCode 'ttknote'}),
- Ttk::Button.new(frame, :text=>'Ĥ',
+ Ttk::Button.new(frame, :text=>'閉じる',
:image=>$image['delete'], :compound=>:left,
:command=>proc{
$ttknote_demo.destroy
@@ -48,31 +48,31 @@ notebook.enable_traversal
f_msg = Ttk::Frame.new(notebook)
msg_m = Ttk::Label.new(f_msg, :font=>$font, :wraplength=>'5i',
:justify=>:left, :anchor=>'n', :text=><<EOL)
-TtkȤϡơ޻ǽʿåȽǤ\
-˴ޤޤ륦åȤΤҤȤĤ˥Ρȥ֥ååȤޤ\
-Ρȥ֥ååȤϡ\
-̤Ƥäѥͥ뤫ǽˤ褦\
-֤νʥ֥åȡˤޤ\
-֥åȤϺǶ¿Υ桼󥿡եǸ뵡ǽǤ\
-֤ϡޥˤǤʤ\
-Ρȥ֥ååȤΥڡθФ򤵤ƤǤ\
-Ctrl+TabϤˤäƤԤȤǤޤ\
-ΥǥǤϡФDzդʸΥAltȤȤ߹碌뤳Ȥ\
-ڡ򤹤뤳ȤǤ褦ˤꤷƤޤ\
-ܤΥ̵֤Ǥʤ褦ˤʤäƤ뤳Ȥˤ\
-դƤ
+Ttkとは,テーマ指定可能な新しいウィジェット集合です.\
+その中に含まれるウィジェットのひとつにノートブックウィジェットがあります.\
+ノートブックウィジェットは,\
+個別の内容を持ったパネルからの選択を可能にするような\
+タブの集合(タブセット)を定めます.\
+タブセットは最近の多くのユーザインターフェースで見られる機能です.\
+タブの選択は,マウスによるだけでなく,\
+ノートブックウィジェットのページの見出しが選択されている時であれば\
+Ctrl+Tabキーの入力によっても行うことができます.\
+このデモでは,見出しで下線付きの文字のキーとAltキーとを組み合わせることで\
+ページを選択することができるようにも設定しています.\
+ただし,2番目のタブは無効化されて選択できないようになっていることには\
+注意してください.
EOL
neat = TkVariable.new
after_id = nil
-msg_b = Ttk::Button.new(f_msg, :text=>'Ƥ(Neat!)', :underline=>6,
+msg_b = Ttk::Button.new(f_msg, :text=>'すてきだ!(Neat!)', :underline=>6,
:command=>proc{
- neat.value = 'ΤȤꤵ'
+ neat.value = 'あぁ,そのとおりさ...'
Tk.after_cancel(after_id) if after_id
after_id = Tk.after(500){neat.value = ''}
})
msg_b.winfo_toplevel.bind('Alt-n'){ msg_b.focus; msg_b.invoke }
msg_l = Ttk::Label.new(f_msg, :textvariable=>neat)
-notebook.add(f_msg, :text=>'(Description)', :underline=>3, :padding=>2)
+notebook.add(f_msg, :text=>'説明(Description)', :underline=>3, :padding=>2)
Tk.grid(msg_m, '-', :sticky=>'new', :pady=>2)
Tk.grid(msg_b, msg_l, :pady=>[2, 4], :padx=>20)
msg_b.grid_configure(:sticky=>'e')
@@ -82,11 +82,11 @@ f_msg.grid_columnconfigure([0, 1], :weight=>1, :uniform=>1)
## Populate the second pane. Note that the content doesn't really matter
f_disabled = Ttk::Frame.new(notebook)
-notebook.add(f_disabled, :text=>'̵줿', :state=>:disabled)
+notebook.add(f_disabled, :text=>'無効化されたタブ', :state=>:disabled)
## Popuplate the third pane
f_editor = Ttk::Frame.new(notebook)
-notebook.add(f_editor, :text=>'ƥȥǥ(Text Editor)', :underline=>9)
+notebook.add(f_editor, :text=>'テキストエディタ(Text Editor)', :underline=>9)
editor_t = Tk::Text.new(f_editor, :width=>40, :height=>10, :wrap=>:char)
if Tk.windowingsystem != 'aqua'
editor_s = editor_t.yscrollbar(Ttk::Scrollbar.new(f_editor))
diff --git a/ext/tk/sample/demos-jp/ttkpane.rb b/ext/tk/sample/demos-jp/ttkpane.rb
index a7b458a683..a5c1a08ec9 100644
--- a/ext/tk/sample/demos-jp/ttkpane.rb
+++ b/ext/tk/sample/demos-jp/ttkpane.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# ttkpane.rb --
#
@@ -21,9 +21,9 @@ base_frame = TkFrame.new($ttkpane_demo).pack(:fill=>:both, :expand=>true)
Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left,
:text=><<EOL).pack(:side=>:top, :fill=>:x)
-Υǥϡߴطˤơդڥɥɥ򼨤Ƥޤ\
-줾礭ϡޤޤƤڥδ֤ˤ륨ꥢĤ\
-ɥå뤳ȤѹǤޤ
+このデモは,埋め込み関係にあるテーマ付きペインドウィンドウを示しています.\
+それぞれの大きさは,含まれているペインの間にあるエリアをつかんで\
+境界をドラッグすることで変更できます.
EOL
Ttk::Separator.new(base_frame).pack(:side=>:top, :fill=>:x)
@@ -33,10 +33,10 @@ Ttk::Frame.new(base_frame) {|frame|
sep = Ttk::Separator.new(frame)
Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
TkGrid('x',
- Ttk::Button.new(frame, :text=>'ɻ',
+ Ttk::Button.new(frame, :text=>'コード参照',
:image=>$image['view'], :compound=>:left,
:command=>proc{showCode 'ttkpane'}),
- Ttk::Button.new(frame, :text=>'Ĥ',
+ Ttk::Button.new(frame, :text=>'閉じる',
:image=>$image['delete'], :compound=>:left,
:command=>proc{
$ttkpane_demo.destroy
@@ -52,19 +52,19 @@ frame = Ttk::Frame.new(base_frame).pack(:fill=>:both, :expand=>true)
outer = Ttk::Panedwindow.new(frame, :orient=>:horizontal)
outer.add(in_left = Ttk::Panedwindow.new(outer, :orient=>:vertical))
outer.add(in_right = Ttk::Panedwindow.new(outer, :orient=>:vertical))
-in_left.add(left_top = Ttk::Labelframe.new(in_left, :text=>'ܥ'))
-in_left.add(left_bot = Ttk::Labelframe.new(in_left, :text=>''))
-in_right.add(right_top = Ttk::Labelframe.new(in_right, :text=>'ץ쥹'))
-in_right.add(right_bot = Ttk::Labelframe.new(in_right, :text=>'ƥ'))
+in_left.add(left_top = Ttk::Labelframe.new(in_left, :text=>'ボタン'))
+in_left.add(left_bot = Ttk::Labelframe.new(in_left, :text=>'時計'))
+in_right.add(right_top = Ttk::Labelframe.new(in_right, :text=>'プログレス'))
+in_right.add(right_bot = Ttk::Labelframe.new(in_right, :text=>'テキスト'))
if Tk.windowingsystem == 'aqua'
[left_top, left_bot, right_top, right_bot].each{|w| w.padding(3) }
end
# Fill the button pane
-Ttk::Button.new(left_top, :text=>'Ƥ',
+Ttk::Button.new(left_top, :text=>'押してね',
:command=>proc{
Tk.messageBox(:type=>'ok', :icon=>'info',
- :message=>'Ƥơ',
+ :message=>'いてて!',
:detail=>'That hurt...', :parent=>base_frame,
:title=>'Button Pressed')
}).pack(:padx=>2, :pady=>5)
diff --git a/ext/tk/sample/demos-jp/ttkprogress.rb b/ext/tk/sample/demos-jp/ttkprogress.rb
index 82898bf50e..ec28253a9f 100644
--- a/ext/tk/sample/demos-jp/ttkprogress.rb
+++ b/ext/tk/sample/demos-jp/ttkprogress.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# ttkprogress.rb --
#
@@ -21,16 +21,16 @@ base_frame = TkFrame.new($ttkprogress_demo).pack(:fill=>:both, :expand=>true)
Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left,
:text=><<EOL).pack(:side=>:top, :fill=>:x)
-ˤΤĤΥץ쥹СǤ\
-ΤΤ"determinate"פΥץ쥹Сǡ\
-㤨ХץबͿ줿λޤǤˤɤΤ餤뤫\
-ȤʤɤѤޤ\
-ΤΤ"indeterminate"פΥץ쥹Сǡ\
-㤨Хץब¹(busy)ǤΤ\
-λޤǤˤɤ줯餤뤫ʬʤȤ֤\
-ȤʤɤѤޤ\
-Υץ쥹С⡤ˤܥȤȤ\
-ư˥᡼⡼ɤON/OFFؤ뤳ȤǤޤ
+下にあるのは二つのプログレスバーです.\
+上のものは"determinate"タイプのプログレスバーで,\
+例えばプログラムが与えられたタスクを終了するまでにどのくらいかかるかを\
+示すときなどに用いられます.\
+下のものは"indeterminate"タイプのプログレスバーで,\
+例えばプログラムが実行中(busy)であるものの\
+終了までにどれくらいかかるかは分からないという状態を\
+示すときなどに用いられます.\
+いずれのプログレスバーも,すぐ下にあるボタンを使うことで\
+自動アニメーションモードのON/OFFを切替えることができます.
EOL
## See Code / Dismiss buttons
@@ -38,10 +38,10 @@ Ttk::Frame.new(base_frame) {|frame|
sep = Ttk::Separator.new(frame)
Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
TkGrid('x',
- Ttk::Button.new(frame, :text=>'ɻ',
+ Ttk::Button.new(frame, :text=>'コード参照',
:image=>$image['view'], :compound=>:left,
:command=>proc{showCode 'ttkprogress'}),
- Ttk::Button.new(frame, :text=>'Ĥ',
+ Ttk::Button.new(frame, :text=>'閉じる',
:image=>$image['delete'], :compound=>:left,
:command=>proc{
$ttkprogress_demo.destroy
diff --git a/ext/tk/sample/demos-jp/twind.rb b/ext/tk/sample/demos-jp/twind.rb
index bd0b060754..f13a137cc3 100644
--- a/ext/tk/sample/demos-jp/twind.rb
+++ b/ext/tk/sample/demos-jp/twind.rb
@@ -1,15 +1,15 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# text (embedded windows) widget demo (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($twind_demo) && $twind_demo
$twind_demo.destroy
$twind_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$twind_demo = TkToplevel.new {|w|
title("Text Demonstration - Embedded Windows")
iconname("Embedded Windows")
@@ -18,11 +18,11 @@ $twind_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($twind_demo).pack(:fill=>:both, :expand=>true)
-# frame
+# frame 生成
$twind_buttons = TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc{
tmppath = $twind_demo
$twind_demo = nil
@@ -31,13 +31,13 @@ $twind_buttons = TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc{showCode 'twind'}
}.pack('side'=>'left', 'expand'=>'yes')
}
$twind_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# frame
+# frame 生成
$twind_text = nil
TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2,
'relief'=>'sunken') {|f|
@@ -51,7 +51,7 @@ TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2,
}.pack('expand'=>'yes', 'fill'=>'both')
}.pack('expand'=>'yes', 'fill'=>'both')
-#
+# タグ生成
$tag_center = TkTextTag.new($twind_text,
'justify' =>'center',
'spacing1'=>'5m',
@@ -64,70 +64,70 @@ $tag_buttons = TkTextTag.new($twind_text,
'spacing2'=>0,
'spacing3'=>0 )
-# ƥȤ
+# テキストの生成
$twind_text.insert('end',
- 'ƥwidget¾widgetȤ߹ळȤǤޤ')
+ 'テキストwidget上に他のwidgetを組み込むことができます。')
$twind_text.insert('end',
- 'Ȥ߹ߥɥȸƤФ졢ǤդwidgetǽǤ')
+ '組み込みウィンドウと呼ばれ、任意のwidgetが可能です。')
$twind_text.insert('end',
- '㤨С2ĤΥܥwidgetȤ߹ޤƤޤ')
-$twind_text.insert('end', 'ǽΥܥ򥯥åȿʿΥ')
+ '例えば、ここに2つのボタンwidgetが組み込まれています。')
+$twind_text.insert('end', '最初のボタンをクリックすと水平方向のスクロールを')
TkTextWindow.new($twind_text, 'end',
'window'=>TkButton.new($twind_text) {
#text 'ON'
- text ''
+ text 'オン'
command proc{textWindOn $twind_text,$twind_buttons}
cursor 'top_left_arrow'
})
-$twind_text.insert('end', "ˤޤޤ2ĤΥܥ򥯥å\n")
-$twind_text.insert('end', 'ʿΥ')
+$twind_text.insert('end', "にします。また2つめのボタンをクリックすると\n")
+$twind_text.insert('end', '水平方向のスクロールを')
TkTextWindow.new($twind_text, 'end',
'window'=>TkButton.new($twind_text) {
#text 'OFF'
- text ''
+ text 'オフ'
command proc{textWindOff $twind_text}
cursor 'top_left_arrow'
})
-$twind_text.insert('end', 'ˤޤ')
+$twind_text.insert('end', 'にします。')
-$twind_text.insert('end', '⤦ҤȤĤǤ')
+$twind_text.insert('end', 'もうひとつの例です。')
TkTextWindow.new($twind_text, 'end',
'window'=>TkButton.new($twind_text) {
- text '򥯥å'
+ text 'ここをクリック'
command proc{textWindPlot $twind_text}
cursor 'top_left_arrow'
})
-$twind_text.insert('end', 'ȡx-yץåȤ˸ޤ')
+$twind_text.insert('end', 'すると、x-yプロットがここに現れます。')
$mark_plot = TkTextMark.new($twind_text, 'insert')
$mark_plot.gravity='left'
-$twind_text.insert('end', 'ޥǥǡ褹뤳ȤǤޤ')
+$twind_text.insert('end', 'マウスでデータを描画することができます。')
TkTextWindow.new($twind_text, 'end',
'window'=>TkButton.new($twind_text) {
- text 'õ'
+ text '消去'
command proc{textWindDel $twind_text}
cursor 'top_left_arrow'
})
-$twind_text.insert('end', '򥯥åȸޤ
+$twind_text.insert('end', 'をクリックすると元に戻ります。
')
-$twind_text.insert('end', 'Ȥ߹ߥɥƥwidgetˡºݤ')
-$twind_text.insert('end', 'ƥȤϤʤȤ߹ळȤǤ')
-$twind_text.insert('end', 'ξϡƥwidgetϥɥޥ͡')
-$twind_text.insert('end', '褦ưޤ㤨Сˤϥƥwidget')
-$twind_text.insert('end', 'äƥܥ󤬤줤¤٤Ƥޤ')
-$twind_text.insert('end', 'ΥܥطʿѤ뤳ȤǤޤ')
-$twind_text.insert('end', '("Default"Ǹο᤹ȤǤޤ)')
-$twind_text.insert('end', '"Short"Ȥܥ򥯥åʸĹ')
-$twind_text.insert('end', 'ѤޤȼưŪ˥ƥwidget')
-$twind_text.insert('end', '쥤ȤƤޤ')
-$twind_text.insert('end', '⤦Ʊܥ򲡤ȸޤ
+$twind_text.insert('end', '組み込みウィンドウだけをテキストwidget上に、実際の')
+$twind_text.insert('end', 'テキストはなしで組み込むことは便利です。')
+$twind_text.insert('end', 'この場合は、テキストwidgetはウィンドウマネージャの')
+$twind_text.insert('end', 'ように動作します。例えば、ここにはテキストwidgetに')
+$twind_text.insert('end', 'よってボタンがきれいに並べられています。')
+$twind_text.insert('end', 'これらのボタンで背景色を変えることができます')
+$twind_text.insert('end', '("Default"で元の色に戻すことができます)。')
+$twind_text.insert('end', '"Short"というボタンをクリックすると文字列の長さが')
+$twind_text.insert('end', '変わります。すると自動的にテキストwidgetが')
+$twind_text.insert('end', 'レイアウトを整えてくれます。')
+$twind_text.insert('end', 'もう一度同じボタンを押すと元に戻ります。
')
TkTextWindow.new($twind_text, 'end',
'window'=>TkButton.new($twind_text) {|b|
- text 'ǥե'
+ text 'デフォルト'
command proc{embDefBg $twind_text}
cursor 'top_left_arrow'
$tag_buttons.add('end')
@@ -163,7 +163,7 @@ TkTextWindow.new($twind_text, 'end',
'pady'=>2 )
}
-# ᥽å
+# メソッド定義
def textWindOn (w,f)
if defined? $twind_scroll
begin
diff --git a/ext/tk/sample/demos-jp/twind2.rb b/ext/tk/sample/demos-jp/twind2.rb
index 96000b0e14..a783ba4738 100644
--- a/ext/tk/sample/demos-jp/twind2.rb
+++ b/ext/tk/sample/demos-jp/twind2.rb
@@ -1,15 +1,15 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# text (embedded windows) widget demo 2 (called by 'widget')
#
-# toplevel widget ¸ߤк
+# toplevel widget が存在すれば削除する
if defined?($twind2_demo) && $twind2_demo
$twind2_demo.destroy
$twind2_demo = nil
end
-# demo Ѥ toplevel widget
+# demo 用の toplevel widget を生成
$twind2_demo = TkToplevel.new {|w|
title("Text Demonstration - Embedded Windows 2")
iconname("Embedded Windows")
@@ -18,15 +18,15 @@ $twind2_demo = TkToplevel.new {|w|
base_frame = TkFrame.new($twind2_demo).pack(:fill=>:both, :expand=>true)
-# frame
+# frame 生成
$twind2_buttons = TkFrame.new(base_frame) {|frame|
TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2),
:columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
TkGrid('x',
- TkButton.new(frame, :text=>'ɻ',
+ TkButton.new(frame, :text=>'コード参照',
:image=>$image['view'], :compound=>:left,
:command=>proc{showCode 'twind2'}),
- TkButton.new(frame, :text=>'Ĥ',
+ TkButton.new(frame, :text=>'閉じる',
:image=>$image['delete'], :compound=>:left,
:command=>proc{
tmppath = $twind2_demo
@@ -39,7 +39,7 @@ $twind2_buttons = TkFrame.new(base_frame) {|frame|
}
$twind2_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
-# frame
+# frame 生成
$twind2_text = nil
TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2,
'relief'=>'sunken') {|f|
@@ -54,7 +54,7 @@ TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2,
}.pack('expand'=>'yes', 'fill'=>'both')
}.pack('expand'=>'yes', 'fill'=>'both')
-#
+# タグ生成
$tag2_center = TkTextTag.new($twind2_text,
'justify' =>'center',
'spacing1'=>'5m',
@@ -67,82 +67,82 @@ $tag2_buttons = TkTextTag.new($twind2_text,
'spacing2'=>0,
'spacing3'=>0 )
-# ƥȤ
-$twind2_text.insert('end', 'ƥȥåȤˤϿʼΥƥ')
-$twind2_text.insert('end', 'ưŪʤΤŪʤΤξޤˤ')
-$twind2_text.insert('end', '¿ޤ뤳ȤǤޤƥ')
-$twind2_text.insert('end', 'ؤ֡·ʤɤ͡ˡ')
-$twind2_text.insert('end', '֤뤳ȤǤޤ')
-$twind2_text.insert('end', 'äơƥȥåȤʪ')
-$twind2_text.insert('end', 'ɥ٤礭Ǥ')
-$twind2_text.insert('end', '٤Ƥ˥ࡼ˥뤵')
-$twind2_text.insert('end', 'ǧ뤳ȤǽǤ')
+# テキストの生成
+$twind2_text.insert('end', 'テキストウィジェットには色々な種類のアイテム')
+$twind2_text.insert('end', '(動的なものや静的なものの両方があります)を')
+$twind2_text.insert('end', '数多く含めることができます。そうしたアイテムは')
+$twind2_text.insert('end', '行替え、タブ、中央揃えなどの様々な方法で')
+$twind2_text.insert('end', '配置することができます。')
+$twind2_text.insert('end', '加えて、テキストウィジェットの内容物が')
+$twind2_text.insert('end', 'ウィンドウサイズに比べて大きすぎる場合でも')
+$twind2_text.insert('end', 'すべての方向にスムーズにスクロールさせて')
+$twind2_text.insert('end', '確認することが可能です。')
$twind2_text.insert('end', "\n\n")
-$twind2_text.insert('end', 'ƥȥåȾˤ¾ΥåȤ')
-$twind2_text.insert('end', 'ޤ뤳ȤǤޤΤ')
-$twind2_text.insert('end', 'ߥɥפȸƤФ졢')
-$twind2_text.insert('end', 'ʤ륦åȤǤͤळȤǤޤ')
-$twind2_text.insert('end', '㤨СˤϣĤ')
-$twind2_text.insert('end', 'ܥ󥦥åȤޤƤޤ')
-$twind2_text.insert('end', 'ǽΥܥ򥯥åȡ')
-$twind2_text.insert('end', 'ʿΥ ')
+$twind2_text.insert('end', 'テキストウィジェット上には他のウィジェットを')
+$twind2_text.insert('end', '含めることもできます。こうしたものは')
+$twind2_text.insert('end', '「埋め込みウィンドウ」と呼ばれ、その中に')
+$twind2_text.insert('end', 'いかなるウィジェットでも詰め込むことができます。')
+$twind2_text.insert('end', '例えば,ここには2つの')
+$twind2_text.insert('end', 'ボタンウィジェットが埋め込まれています。')
+$twind2_text.insert('end', '最初のボタンをクリックすると、')
+$twind2_text.insert('end', '水平方向のスクロールを ')
TkTextWindow.new($twind2_text, 'end',
'window'=>TkButton.new($twind2_text) {
#text 'ON'
- text ''
+ text 'オン'
command proc{textWindOn2 $twind2_text,$twind2_buttons}
cursor 'top_left_arrow'
})
-$twind2_text.insert('end', "ˤޤޤĤΥܥ򥯥å\n")
-$twind2_text.insert('end', 'ʿΥ')
+$twind2_text.insert('end', "にします。また、2つめのボタンをクリックすると\n")
+$twind2_text.insert('end', '水平方向のスクロールを')
TkTextWindow.new($twind2_text, 'end',
'window'=>TkButton.new($twind2_text) {
#text 'OFF'
- text ''
+ text 'オフ'
command proc{textWindOff2 $twind2_text}
cursor 'top_left_arrow'
})
-$twind2_text.insert('end', "ˤޤ\n\n")
+$twind2_text.insert('end', "にします。\n\n")
-$twind2_text.insert('end', 'Ϥ⤦ҤȤĤǤ')
+$twind2_text.insert('end', '次はもうひとつの例です。')
TkTextWindow.new($twind2_text, 'end',
'window'=>TkButton.new($twind2_text) {
- text '򥯥å'
+ text 'ここをクリック'
command proc{textWindPlot2 $twind2_text}
cursor 'top_left_arrow'
})
-$twind2_text.insert('end', 'ȡx-yץåȤ˸ޤ')
+$twind2_text.insert('end', 'すると、x-yプロットがここに現れます。')
$mark2_plot = TkTextMark.new($twind2_text, 'insert')
$mark2_plot.gravity='left'
-$twind2_text.insert('end', 'ޥǥɥå뤳Ȥǡ')
-$twind2_text.insert('end', 'ץåȾΥǡư뤳ȤǤޤ')
+$twind2_text.insert('end', 'マウスでドラッグすることで、')
+$twind2_text.insert('end', 'プロット上のデータ点を移動することができます。')
TkTextWindow.new($twind2_text, 'end',
'window'=>TkButton.new($twind2_text) {
- text 'õ'
+ text '消去'
command proc{textWindDel2 $twind2_text}
cursor 'top_left_arrow'
})
-$twind2_text.insert('end', '򥯥åȸޤ')
+$twind2_text.insert('end', 'をクリックすると元に戻ります。')
$twind2_text.insert('end', "\n\n")
-$twind2_text.insert('end', 'ɽƥȤʤߥɥ')
-$twind2_text.insert('end', 'ƥȥåȤ˴ޤ뤳ȤͭѤǤ礦')
-$twind2_text.insert('end', 'ξ硢ƥȥåȤ')
-$twind2_text.insert('end', 'ȥޥ͡Τ褦Ưޤ')
-$twind2_text.insert('end', '㤨СˤϥƥȥåȤ')
-$twind2_text.insert('end', 'äƥܥ󤬤줤󤷤֤Ƥޤ')
-$twind2_text.insert('end', 'Υܥ򥯥å뤳Ȥǡ')
-$twind2_text.insert('end', 'ΥƥȥåȤطʿ')
-$twind2_text.insert('end', 'Ѥ뤳ȤǤޤ("ǥե"ܥ')
-$twind2_text.insert('end', 'ο᤹ȤǤޤ)')
-$twind2_text.insert('end', '"Short"Ȥܥ򥯥åʸĹ')
-$twind2_text.insert('end', 'ѤꡢƥȥåȤưŪ')
-$twind2_text.insert('end', '쥤ȤͻҤ򸫤뤳ȤǤޤ')
-$twind2_text.insert('end', '⤦Ʊܥ򲡤ȸޤ')
+$twind2_text.insert('end', '表示するテキストなしに埋め込みウィンドウだけを')
+$twind2_text.insert('end', 'テキストウィジェットに含めることも有用でしょう。')
+$twind2_text.insert('end', 'この場合、テキストウィジェットは')
+$twind2_text.insert('end', 'ジオメトリマネージャのように働きます。')
+$twind2_text.insert('end', '例えば、ここにはテキストウィジェットに')
+$twind2_text.insert('end', 'よってボタンがきれいに整列して配置されています。')
+$twind2_text.insert('end', 'これらのボタンをクリックすることで、')
+$twind2_text.insert('end', 'このテキストウィジェットの背景色を')
+$twind2_text.insert('end', '変えることができます("デフォルト"ボタンで')
+$twind2_text.insert('end', '元の色に戻すことができます)。')
+$twind2_text.insert('end', '"Short"というボタンをクリックすると文字列の長さが')
+$twind2_text.insert('end', '変わり、テキストウィジェットが自動的に')
+$twind2_text.insert('end', 'レイアウトを整える様子を見ることができます。')
+$twind2_text.insert('end', 'もう一度同じボタンを押すと元に戻ります。')
$twind2_text.insert('end', "\n")
btn_default = TkButton.new($twind2_text) {|b|
- text 'ǥե'
+ text 'デフォルト'
command proc{embDefBg2 $twind2_text}
cursor 'top_left_arrow'
}
@@ -184,8 +184,8 @@ $text_normal2['border'] = $twind2_text.cget('borderwidth')
$text_normal2['highlight'] = $twind2_text.cget('highlightthickness')
$text_normal2['pad'] = $twind2_text.cget('padx')
-$twind2_text.insert('end', "\nborder width highlightthickness, ")
-$twind2_text.insert('end', "padding ̾ͤѹ뤳ȤǽǤ\n")
+$twind2_text.insert('end', "\nborder width や highlightthickness, ")
+$twind2_text.insert('end', "padding を通常の値から変更することも可能です。\n")
TkTextWindow.new($twind2_text, 'end',
'window'=>TkButton.new($twind2_text, :text=>"Big borders",
@@ -229,8 +229,8 @@ TkTextWindow.new($twind2_text, 'end',
textWinSmallP2 $twind2_text
}))
-$twind2_text.insert('end', "\n\n˥᡼ƥȥåȤ")
-$twind2_text.insert('end', "ޤ֤Ǥޤ")
+$twind2_text.insert('end', "\n\n更にイメージもテキストウィジェットに")
+$twind2_text.insert('end', "うまく配置できます:")
TkTextImage.new($twind2_text, 'end',
'image'=>TkBitmapImage.new(:file=>[
@@ -238,7 +238,7 @@ TkTextImage.new($twind2_text, 'end',
'images', 'face.xbm'
].join(File::Separator)))
-# ᥽å
+# メソッド定義
def textWinBigB2(w)
w.borderwidth 15
end
diff --git a/ext/tk/sample/demos-jp/unicodeout.rb b/ext/tk/sample/demos-jp/unicodeout.rb
index 4857cd131d..31596cf8fd 100644
--- a/ext/tk/sample/demos-jp/unicodeout.rb
+++ b/ext/tk/sample/demos-jp/unicodeout.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
#
# unicodeout.rb --
#
@@ -23,41 +23,41 @@ base_frame = TkFrame.new($unicodeout_demo).pack(:fill=>:both, :expand=>true)
TkLabel.new(base_frame,
:font=>$font, :wraplength=>'5.4i', :justify=>:left,
:text=><<EOL).pack(:side=>:top)
-ϡTkˤʸѤФ륵ݡȤˤĤƤ\
-ץǤɽˤƤʤºݤˤɤΤ褦ɽ\
-ܤˤ뤫ϡʤδĶˤɤΤ褦ʸ礬󥹥ȡ뤵Ƥ뤫\
-礭¸ޤޤоݤȤʤʸ礬󥹥ȡ뤵Ƥʤ\
-ɤΤ褦ɽʤ뤫⤢ʤδĶǤ\
-֥ɻȡץܥ򲡤ƥɽ\
-Unicodeout_SampleFrame饹@@font񤭴\
-(եƤѹޤ)\
-ֺƼ¹ԡץܥΥåƤߤƤ
-ץȤĤ褦ˡʸ\\uXXXXȤ\
-TclΥɽѤUNICODEʸǽ񤫤Ƥޤ\
-ʸϡTk::UTF8_String᥽åɤˤäơ\
-UTF8ʸǤפȤ\
-󥳡ɾդʸ󥪥֥\
-(TclΥɽѴѤ)Ѵ\
-٥륦åȤϤƤդƤ
+これは,Tkにおける非欧米文字集合を用いる言語に対するサポートについての\
+サンプルです.ただし,下の表示においてあなたが実際にどのような表示を\
+目にするかは,あなたの環境にどのような文字集合がインストールされているかに\
+大きく依存します.また,対象となる文字集合がインストールされていない場合に\
+どのような表示がなされるかもあなたの環境次第です.\
+「コード参照」ボタンを押してソースを表示し,\
+Unicodeout_SampleFrameクラスの@@fontの定義を書き換えて\
+(ファイルの内容は変更されません)\
+「再実行」ボタンのクリックを試してみてください.
+スクリプトが可搬性を持つように,文字列は\\uXXXXという\
+Tclのエスケープ表現を用いたUNICODE文字列で書かれています.\
+文字列は,Tk::UTF8_Stringメソッドによって,\
+「UTF8形式の文字列である」という\
+エンコード情報付きの文字列オブジェクト\
+(Tclのエスケープ表現の変換済み)に変換して\
+ラベルウィジェットに渡している点に注意してください.
EOL
#'
TkFrame.new(base_frame){|f|
pack(:side=>:bottom, :fill=>:x, :pady=>'2m')
- TkButton.new(f, :text=>'Ĥ', :width=>15, :command=>proc{
+ TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{
$unicodeout_demo.destroy
$unicodeout_demo = nil
}).pack(:side=>:left, :expand=>true)
- TkButton.new(f, :text=>'ɻ', :width=>15, :command=>proc{
+ TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{
showCode 'unicodeout'
}).pack(:side=>:left, :expand=>true)
}
wait_msg = TkLabel.new(base_frame,
- :text=>"եɤ߹ߤδλޤ" +
- "Ф餯Ԥ",
+ :text=>"フォント読み込みの完了まで" +
+ "しばらくお待ち下さい...",
:font=>"Helvetica 12 italic").pack
class Unicodeout_SampleFrame < TkFrame
diff --git a/ext/tk/sample/demos-jp/vscale.rb b/ext/tk/sample/demos-jp/vscale.rb
index a1097fd77f..6ae513bc33 100644
--- a/ext/tk/sample/demos-jp/vscale.rb
+++ b/ext/tk/sample/demos-jp/vscale.rb
@@ -1,4 +1,4 @@
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
require "tkcanvas"
if defined?($vscale_demo) && $vscale_demo
@@ -18,17 +18,17 @@ msg = TkLabel.new(base_frame) {
font $font
wraplength '3.5i'
justify 'left'
-# text "ˤ1ĤȾľʥ뤬ɽƤޤ\
-#ǥޥܥ1򥯥åޤϥɥå\
-#ĹѤ뤳ȤǤޤ"
- text "ˤϥСȽķΥ뤬ɽƤޤǥޥΥܥ1 򥯥å뤫ɥåƥСι⤵Ѥ뤳ȤǤޤäλץܥ򲡤Ƥ"
+# text "下には矢印が1つと乗直なスケールが表示されています。\
+#スケール上でマウスボタン1をクリック、またはドラッグすると\
+#矢印の長さを変えることができます。"
+ text "にはバーと縦型のスケールが表示されています。スケールでマウスのボタン1 をクリックするかドラッグしてバーの高さを変えることができます。終ったら「了解」ボタンを押してください。"
}
msg.pack('side'=>'top', 'padx'=>'.5c')
TkFrame.new(base_frame) {|frame|
TkButton.new(frame) {
- #text 'λ'
- text 'Ĥ'
+ #text '了解'
+ text '閉じる'
command proc {
tmppath = $vscale_demo
$vscale_demo = nil
@@ -37,7 +37,7 @@ TkFrame.new(base_frame) {|frame|
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {
- text 'ɻ'
+ text 'コード参照'
command proc { showCode 'vscale' }
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
diff --git a/ext/tk/sample/demos-jp/widget b/ext/tk/sample/demos-jp/widget
index fc3c084e9a..193c15affd 100644
--- a/ext/tk/sample/demos-jp/widget
+++ b/ext/tk/sample/demos-jp/widget
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby
-# -*- coding: euc-jp -*-
+# -*- coding: utf-8 -*-
-# ( tk.rb Υɻ encoding /˻Ȥ )
+# 漢字コード設定 ( tk.rb のロード時の encoding 推定/設定に使われる )
#if RUBY_VERSION < '1.9.0' ### !!!!!!!!!!!!!!
unless defined?(::Encoding.default_external)
$KCODE = 'euc'
@@ -9,28 +9,28 @@ else
DEFAULT_TK_ENCODING = 'EUC-JP'
end
-# tk ط饤֥ɤ߹
+# tk 関係ライブラリの読み込み
require 'tk'
# require 'tkafter'
$RubyTk_WidgetDemo = true
-# widget demo directory ֤γ
+# widget demo directory 位置の獲得
# $demo_dir = File.dirname($0)
$demo_dir = File.dirname(__FILE__)
-# root
+# root の生成
$root = TkRoot.new{title "Ruby/Tk Widget Demonstration"}
-# tk Сμ
+# tk バージョンの取得
$tk_version = Tk::TK_VERSION
$tk_major_ver, $tk_minor_ver = $tk_version.split('.').map{|n| n.to_i}
$tk_patchlevel = Tk::TK_PATCHLEVEL
-# tcl_platform ؤΥ֥
+# tcl_platform 情報へのアクセスオブジェクト
$tk_platform = TkVarAccess.new('tcl_platform')
-# ե
+# フォント設定
#######
case($tk_version)
when /^4.*/
@@ -64,7 +64,7 @@ else
end
#######
-# ᡼
+# イメージ設定
$image = {}
if $tk_major_ver >= 8
@@ -123,7 +123,7 @@ $image['print'] = TkPhotoImage.new(:height=>19, :format=>'GIF', :data=><<EOD)
EOD
end
-# ˥塼
+# メニュー設定
if $tk_major_ver >= 8
$root.add_menubar([[['File', 0],
['About ... ', proc{aboutBox}, 0, '<F1>'],
@@ -154,7 +154,7 @@ TkFrame.new($root){|frame|
}.pack('side'=>'top', 'fill'=>'x')
=end
-# ƥȥܥå
+# テキストボックスの生成
if $tk_version =~ /^4\.[01]/
scr = TkScrollbar.new($root, 'orient'=>'vertical')
txt = TkText.new($root) {
@@ -215,7 +215,7 @@ else
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>2)
end
-# ƥȥ
+# テキストタグ設定
if $tk_version =~ /^4.*/
tag_title = TkTextTag.new(txt, 'font'=>'-*-Helvetica-Bold-R-Normal--*-180-*-*-*-*-*-*')
else
@@ -277,267 +277,267 @@ tag_demo.bind('Motion', proc{|x, y|
},
'%x %y')
-# ƥ
+# テキスト生成
txt.insert('end', 'Ruby/Tk : Widget', tag_title)
-#txt.insert('end', " ǥ󥹥ȥ졼\n", tag_middle)
-txt.insert('end', " ǥ󥹥ȥ졼\n", tag_kanji_title)
+#txt.insert('end', " デモンストレーション\n", tag_middle)
+txt.insert('end', " デモンストレーション\n", tag_kanji_title)
txt.insert('end', <<"EOT")
-ΥץꥱϡTk Widget ѤƤɤΤ褦ʤȤǤ뤫\
-򼨤ΡĤξʥץȤФեȥɤ\
-Ƥޤʲ˽֤˵󤲤Ƥǥ󥹥ȥ졼¹\
-ˤϥޥǥåƤǥ󥹥ȥ졼Υ\
-ɥȡǥ󥹥ȥ졼 Ruby/Tk Υɤ\
-뤿ˡ"ɻ"ܥ򥯥å뤳ȤǤޤʤ\
-˾ʤ顢Υɤ뤳ȤǤޤɤǥǥ\
-󥹥ȥ졼Ƽ¹Ԥ뤿ˤϡɤ񤫤줿ɥ\
-"ǥƼ¹" ܥ򥯥åƤ\
-ɤƤ⥪ꥸʥΥե뤬񤭴뤳Ȥ\
-ޤ󤫤顢ۤ˿ѹƤߤƤ
-
-ΥǥǤϡŪǶΥС Tk ǤʤХݡȤ\
-ʤǽȤäƼƤޤ(㤨 Tk8.4 ʾʤ)Τᡢ\
-ǽʤ Tk 饤֥ȤäƤˤϡ\
-ǥưޤ󡣤Τ褦ʵǽɬפǤС򥵥ݡ\
-Ƥ Tk 饤֥Ȥ褦 tcltklib 򥳥ѥ뤷ʤ\
-
-
-⤷ʤ Tk (ǽ餫ޤफ󥹥ȡ뤷ˤ) \
-Ttk (Tile) ĥѤǤ֤Ǥʤ顢\
-Ttk ĥΥǥ (sample/tkextlib/tile/demo.rb) ⤼һƤߤƤ
-( ¿ʬߤΤʤδĶˤ Ttk ĥ\
+このアプリケーションは、Tk Widget を用いてどのようなことができるか\
+を示すための、いくつかの小さなスクリプトに対するフロントエンドを提\
+供しています。以下に順番に挙げられているデモンストレーションを実行\
+するにはマウスでクリックしてください。デモンストレーションのウィン\
+ドウが現れると、デモンストレーションを生成した Ruby/Tk のコードを見\
+るために、"コード参照"ボタンをクリックすることができます。あなたが\
+望むなら、そのコードを修正することができます。修正したコードでデモ\
+ンストレーションを再実行するためには、コードが書かれたウィンドウに\
+ある"デモ再実行" ボタンをクリックしてください。\
+コードを修正してもオリジナルのファイルが書き換えられることは\
+ありませんから、心配せずに色々な変更を試してみてください。
+
+一部のデモでは、比較的最近のバージョンの Tk でなければサポートして\
+いない機能を使って実装しています(例えば Tk8.4 以上など)。そのため、\
+そうした機能を持たない Tk ライブラリを使っている場合には、そうした\
+デモは正しく動きません。そのような機能が必要であれば、それをサポート\
+している Tk ライブラリを使うように tcltklib をコンパイルしなおして\
+ください。
+
+もしあなたの Tk が (最初から含むかインストールしたかにより) \
+Ttk (Tile) 拡張を利用できる状態であるなら、\
+Ttk 拡張のデモ (sample/tkextlib/tile/demo.rb) もぜひ試してみてください。
+( 多分,現在のあなたの環境には Ttk 拡張は\
#{
begin
require 'tkextlib/tile'
- "ǤƳƤޤ"
+ "すでに導入されています"
rescue
- "ޤ󥹥ȡ뤵Ƥޤ"
+ "まだインストールされていません"
end
}\
-)
-Ttk ĥϡTk8.5 ʾǤɸεǽȤȤ߹ޤƤޤ
+。)
+Ttk 拡張は、Tk8.5 以上では標準の機能として組み込まれています。
EOT
-#txt.insert('end',"٥, ܥ, åܥ, 饸ܥ\n",tag_middle)
-txt.insert('end', "٥, ܥ, åܥ, 饸ܥ\n",
+#txt.insert('end',"ラベル, ボタン, チェックボタン, ラジオボタン\n",tag_middle)
+txt.insert('end', "ラベル, ボタン, チェックボタン, ラジオボタン\n",
tag_kanji_title)
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "1. ٥ (ƥ, ӥåȥޥå)\n",
+txt.insert('end', "1. ラベル (テキスト, ビットマップ)\n",
tag_demo, "demo-label")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "2. ٥UNICODEƥ (ǽбСTkɬ)\n", tag_demo, "demo-unicodeout")
+txt.insert('end', "2. ラベルとUNICODEテキスト (機能に対応したバージョンのTkが必要)\n", tag_demo, "demo-unicodeout")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "3. ܥ \n", tag_demo, "demo-button")
+txt.insert('end', "3. ボタン \n", tag_demo, "demo-button")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "4. åܥ (ʣǽ)\n",
+txt.insert('end', "4. チェックボタン (複数を選択可能)\n",
tag_demo, "demo-check")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "5. ֥åܥ (ǽбСTkɬ)\n",
+txt.insert('end', "5. 3状態チェックボタン (機能に対応したバージョンのTkが必要)\n",
tag_demo, "demo-check2")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "6. 饸ܥ (ǤդΰĤǽ)\n",
+txt.insert('end', "6. ラジオボタン (任意の一つを選択可能)\n",
tag_demo, "demo-radio")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "7. 饸ܥ (ǽбСTkɬ)\n",
+txt.insert('end', "7. ラジオボタン (機能に対応したバージョンのTkが必要)\n",
tag_demo, "demo-radio2")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "8. ֥饸ܥ (ǽбСTkɬ)\n",
+txt.insert('end', "8. 3状態ラジオボタン (機能に対応したバージョンのTkが必要)\n",
tag_demo, "demo-radio3")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "9. ܥǺ줿15-ѥ륲\n",
+txt.insert('end', "9. ボタンで作られた15-パズルゲーム\n",
tag_demo, "demo-puzzle")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "10. ӥåȥޥåפѤܥ\n",
+txt.insert('end', "10. ビットマップを使用したアイコンボタン\n",
tag_demo, "demo-icon")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "11. ɽĤΥ٥\n",
+txt.insert('end', "11. 画像を表示する二つのラベル\n",
tag_demo, "demo-image1")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "12. 򸫤뤿δñʥ桼󥿡ե\n",
+txt.insert('end', "12. 画像を見るための簡単なユーザインターフェース\n",
tag_demo, "demo-image2")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "13. 򸫤뤿δñʥ桼󥿡ե (ǽбСTkɬ)\n",
+txt.insert('end', "13. 画像を見るための簡単なユーザインターフェース (機能に対応したバージョンのTkが必要)\n",
tag_demo, "demo-image3")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "14. ٥դե졼 (ǽбСTkɬ)\n",
+txt.insert('end', "14. ラベル付きフレーム (機能に対応したバージョンのTkが必要)\n",
tag_demo, "demo-labelframe")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "15. ơޤбåȤδñ (Tile/Ttkĥؤбɬ)\n",
+txt.insert('end', "15. テーマに対応したウィジェットの簡単な例 (Tile/Ttk拡張への対応が必要)\n",
tag_demo, "demo-ttkbut")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "\n")
-#txt.insert('end', "ꥹȥܥå\n", tag_middle)
-txt.insert('end', "ꥹȥܥå\n", tag_kanji_title)
+#txt.insert('end', "リストボックス\n", tag_middle)
+txt.insert('end', "リストボックス\n", tag_kanji_title)
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "1. ƻܸ.\n", tag_demo, "demo-states")
+txt.insert('end', "1. 都道府県.\n", tag_demo, "demo-states")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "2. : ץꥱΤۿѤ\n",
+txt.insert('end', "2. 色: アプリケーションのための配色を変える\n",
"#{tag_demo.id} demo-colors")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "3. ʸ\n", tag_demo, "demo-sayings")
+txt.insert('end', "3. 格言集\n", tag_demo, "demo-sayings")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "4. ˤĤƤΥޥꥹ (Tile/Ttkĥؤбɬ)\n",
+txt.insert('end', "4. 国についてのマルチカラムリスト (Tile/Ttk拡張への対応が必要)\n",
tag_demo, "demo-mclist")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "5. ǥ쥯ȥ֥饦 (Tile/Ttkĥؤбɬ)\n",
+txt.insert('end', "5. ディレクトリブラウザ (Tile/Ttk拡張への対応が必要)\n",
tag_demo, "demo-tree")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "\n")
-#txt.insert('end', "ȥȥԥܥå\n", tag_middle)
-txt.insert('end', "ȥ\n", tag_kanji_title)
+#txt.insert('end', "エントリとスピンボックス\n", tag_middle)
+txt.insert('end', "エントリ\n", tag_kanji_title)
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "1. Сʤ\n", tag_demo, "demo-entry1")
+txt.insert('end', "1. スクロールバーなし\n", tag_demo, "demo-entry1")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "2. С\n", tag_demo, "demo-entry2")
+txt.insert('end', "2. スクロールバーあり\n", tag_demo, "demo-entry2")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "3. ǧڽդΥȥܥåȥѥɥե (ǽбСTkɬ)\n",
+txt.insert('end', "3. 認証処理付きのエントリボックスとパスワードフィールド (機能に対応したバージョンのTkが必要)\n",
tag_demo, "demo-entry3")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "4. ԥܥå (ǽбСTkɬ)\n",
+txt.insert('end', "4. スピンボックス (機能に対応したバージョンのTkが必要)\n",
tag_demo, "demo-spin")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "5. ܥܥå (Tile/Ttkĥؤбɬ)\n",
+txt.insert('end', "5. コンボボックス (Tile/Ttk拡張への対応が必要)\n",
tag_demo, "demo-combo")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "6. ñʥե\n", tag_demo, "demo-form")
+txt.insert('end', "6. 簡単なフォーム\n", tag_demo, "demo-form")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "\n")
-#txt.insert('end', "ƥ\n", tag_middle)
-txt.insert('end', "ƥ\n", tag_kanji_title)
+#txt.insert('end', "テキスト\n", tag_middle)
+txt.insert('end', "テキスト\n", tag_kanji_title)
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "1. Ūʥƥ\n", tag_demo, "demo-text")
+txt.insert('end', "1. 基本的なテキスト\n", tag_demo, "demo-text")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "2. ɽ.\n", tag_demo, "demo-style")
+txt.insert('end', "2. 表示スタイル.\n", tag_demo, "demo-style")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "3. ϥѡƥ(Х).\n",
+txt.insert('end', "3. ハイパーテキスト(タグバインド).\n",
tag_demo, "demo-bind")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "4. ɥƥ\n",
+txt.insert('end', "4. ウィンドウを埋め込んだテキスト\n",
tag_demo, "demo-twind")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "5. ɥƥ (ǽбСTkɬ)\n",
+txt.insert('end', "5. ウィンドウを埋め込んだテキスト (機能に対応したバージョンのTkが必要)\n",
tag_demo, "demo-twind2")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "6. \n", tag_demo, "demo-search")
+txt.insert('end', "6. 検索\n", tag_demo, "demo-search")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "7. ƥȥåȤ(peering) (ǽбСTkɬ)\n", tag_demo, "demo-textpeer")
+txt.insert('end', "7. テキストウィジェットの対等化(peering) (機能に対応したバージョンのTkが必要)\n", tag_demo, "demo-textpeer")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "\n")
-#txt.insert('end', "Х\n", tag_middle)
-txt.insert('end', "Х\n", tag_kanji_title)
+#txt.insert('end', "キャンバス\n", tag_middle)
+txt.insert('end', "キャンバス\n", tag_kanji_title)
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "1. ƥη\n", tag_demo, "demo-items")
+txt.insert('end', "1. アイテムの型\n", tag_demo, "demo-items")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "2. 2 Υץå\n", tag_demo, "demo-plot")
+txt.insert('end', "2. 2 次元のプロット\n", tag_demo, "demo-plot")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "3. ƥ\n", tag_demo, "demo-ctext")
+txt.insert('end', "3. テキスト\n", tag_demo, "demo-ctext")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "4. η\n", tag_demo, "demo-arrow")
+txt.insert('end', "4. 矢印の形\n", tag_demo, "demo-arrow")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "5. 롼顼\n", tag_demo, "demo-ruler")
+txt.insert('end', "5. ルーラー\n", tag_demo, "demo-ruler")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "6. եץ\n", tag_demo, "demo-floor")
+txt.insert('end', "6. フロアプラン\n", tag_demo, "demo-floor")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "7. եץ (ۤʤ륭Хƥˡ)\n", tag_demo, "demo-floor2")
+txt.insert('end', "7. フロアプラン (異なるキャンバスアイテム作成方法を使用)\n", tag_demo, "demo-floor2")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "8. ǽʥХ\n",
+txt.insert('end', "8. スクロール可能なキャンバス\n",
tag_demo, "demo-cscroll")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "9. ܡɾεΤν (Tile/Ttkĥؤбɬ)\n",
+txt.insert('end', "9. チェスボード上の騎士の巡回 (Tile/Ttk拡張への対応が必要)\n",
tag_demo, "demo-knightstour")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "\n")
-#txt.insert('end', "ȥץ쥹С\n", tag_middle)
-txt.insert('end', "ȥץ쥹С\n", tag_kanji_title)
+#txt.insert('end', "スケールとプログレスバー\n", tag_middle)
+txt.insert('end', "スケールとプログレスバー\n", tag_kanji_title)
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "1. ľ\n", tag_demo.id, "demo-vscale")
+txt.insert('end', "1. 垂直スケール\n", tag_demo.id, "demo-vscale")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "2. ʿ\n", tag_demo.id, "demo-hscale")
+txt.insert('end', "2. 水平スケール\n", tag_demo.id, "demo-hscale")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "3. ץ쥹С (Tile/Ttkĥؤбɬ)\n", tag_demo.id, "demo-ttkprogress")
+txt.insert('end', "3. プログレスバー (Tile/Ttk拡張への対応が必要)\n", tag_demo.id, "demo-ttkprogress")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "\n")
-txt.insert('end', "ڥɥɥȥΡȥ֥å\n", tag_kanji_title)
+txt.insert('end', "ペインドウィンドウとノートブック\n", tag_kanji_title)
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "1. ʿ (ǽбСTkɬ)\n",
+txt.insert('end', "1. 水平方向 (機能に対応したバージョンのTkが必要)\n",
tag_demo.id, "demo-paned1")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "2. ľ (ǽбСTkɬ)\n",
+txt.insert('end', "2. 垂直方向 (機能に対応したバージョンのTkが必要)\n",
tag_demo.id, "demo-paned2")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "3. ơޤбߥڥ (Tile/Ttkĥؤбɬ)\n",
+txt.insert('end', "3. テーマに対応した埋め込みペイン (Tile/Ttk拡張への対応が必要)\n",
tag_demo.id, "demo-ttkpane")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "4. Ρȥ֥åå (Tile/Ttkĥؤбɬ)\n",
+txt.insert('end', "4. ノートブックウィジェット (Tile/Ttk拡張への対応が必要)\n",
tag_demo.id, "demo-ttknote")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "\n")
-#txt.insert('end', "˥塼ȥġС\n", tag_middle)
-txt.insert('end', "˥塼ȥġС\n", tag_kanji_title)
+#txt.insert('end', "メニューとツールバー\n", tag_middle)
+txt.insert('end', "メニューとツールバー\n", tag_kanji_title)
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "1. ˥塼ȥɤޤɥ\n",
+txt.insert('end', "1. メニューとカスケードを含んだウィンドウ\n",
tag_demo, "demo-menu")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "2. ˥塼ȥɤޤɥ (Tk8.x )\n",
+txt.insert('end', "2. メニューとカスケードを含んだウィンドウ (Tk8.x 専用)\n",
tag_demo, "demo-menu8x")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "3. (ǽбСTkɬ)\n",
+txt.insert('end', "3. 〃 (機能に対応したバージョンのTkが必要)\n",
tag_demo, "demo-menu84")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "4. ˥塼ܥ (Tk8.x )\n",
+txt.insert('end', "4. メニューボタン (Tk8.x 専用)\n",
tag_demo, "demo-menubu")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "5. ơޤб˥塼ܥ (Tile/Ttkĥؤбɬ)\n",
+txt.insert('end', "5. テーマに対応したメニューボタン (Tile/Ttk拡張への対応が必要)\n",
tag_demo.id, "demo-ttkmenu")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "6. ơޤбġС (Tile/Ttkĥؤбɬ)\n",
+txt.insert('end', "6. テーマに対応したツールバー (Tile/Ttk拡張への対応が必要)\n",
tag_demo.id, "demo-toolbar")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "\n")
-#txt.insert('end', "ɥ\n", tag_middle)
-txt.insert('end', "ɥ\n", tag_kanji_title)
+#txt.insert('end', "ダイアログウィンドウ\n", tag_middle)
+txt.insert('end', "ダイアログウィンドウ\n", tag_kanji_title)
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "1. åܥå\n", tag_demo, "demo-msgbox")
+txt.insert('end', "1. メッセージボックス\n", tag_demo, "demo-msgbox")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "2. ܺ٥ƥդΥåܥå (ǽбСTkɬ)\n", tag_demo, "demo-msgbox2")
+txt.insert('end', "2. 詳細テキスト付きのメッセージボックス (機能に対応したバージョンのTkが必要)\n", tag_demo, "demo-msgbox2")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "3. ե\n", tag_demo, "demo-filebox")
+txt.insert('end', "3. ファイル選択ダイアログ\n", tag_demo, "demo-filebox")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "4. \n", tag_demo, "demo-clrpick")
+txt.insert('end', "4. 色選択ダイアログ\n", tag_demo, "demo-clrpick")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "\n")
-#txt.insert('end', "˥᡼\n", tag_middle)
-txt.insert('end', "˥᡼\n", tag_kanji_title)
+#txt.insert('end', "アニメーション\n", tag_middle)
+txt.insert('end', "アニメーション\n", tag_kanji_title)
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "1. ˥᡼٥ (ǽбСTkɬ)\n", tag_demo, "demo-anilabel")
+txt.insert('end', "1. アニメーションラベル (機能に対応したバージョンのTkが必要)\n", tag_demo, "demo-anilabel")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "2. ȷΥ˥᡼ (ǽбСTkɬ)\n", tag_demo, "demo-aniwave")
+txt.insert('end', "2. 波形のアニメーション (機能に対応したバージョンのTkが必要)\n", tag_demo, "demo-aniwave")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "3. ҤΥߥ졼 (ǽбСTkɬ)\n", tag_demo, "demo-pendulum")
+txt.insert('end', "3. 振り子のシミュレーション (機能に対応したバージョンのTkが必要)\n", tag_demo, "demo-pendulum")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "4. A celebration of Rube Goldberg (ǽбСTkɬ)\n", tag_demo, "demo-goldberg")
+txt.insert('end', "4. A celebration of Rube Goldberg (機能に対応したバージョンのTkが必要)\n", tag_demo, "demo-goldberg")
txt.insert('end', "\n")
-#txt.insert('end', "¾\n", tag_middle)
-txt.insert('end', "¾\n", tag_kanji_title)
+#txt.insert('end', "その他\n", tag_middle)
+txt.insert('end', "その他\n", tag_kanji_title)
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "1. Ȥ߹ߤΥӥåȥޥå\n", tag_demo, "demo-bitmap")
+txt.insert('end', "1. 組み込みのビットマップ\n", tag_demo, "demo-bitmap")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "2. ⡼(륰)\n",
+txt.insert('end', "2. モーダルダイアログ(ローカルグラブ)\n",
tag_demo, "demo-dialog1")
txt.insert('end', " \n ", tag_demospace)
-txt.insert('end', "3. ⡼(Х륰)\n",
+txt.insert('end', "3. モーダルダイアログ(グローバルグラブ)\n",
tag_demo, "demo-dialog2")
txt.insert('end', " \n ", tag_demospace)
@@ -545,13 +545,13 @@ txt.state('disabled')
scr.focus
################################
-# method
+# method 定義
################################
def positionWindow(w)
w.geometry('+300+300')
end
-# ƥåȤȡѿ̾ TkVariable Ȥ()¤ӤϤ
+# 親ウィジェットと,変数名と TkVariable との組(配列)の並びを渡す
$showVarsWin = {}
def showVars1(parent, *args)
if $showVarsWin[parent.path]
@@ -564,7 +564,7 @@ def showVars1(parent, *args)
title "Variable values"
base = TkFrame.new(w).pack(:fill=>:both, :expand=>true)
TkLabel.new(base) {
- text "ѿ:"
+ text "変数値:"
width 20
anchor 'center'
if $tk_version =~ /^4.*/
@@ -586,7 +586,7 @@ def showVars1(parent, *args)
}.pack('side'=>'top', 'anchor'=>'w', 'fill'=>'x')
}
TkButton.new(base) {
- text "λ"
+ text "了解"
command proc{w.destroy}
}.pack('side'=>'bottom', 'pady'=>2)
}
@@ -605,7 +605,7 @@ def showVars2(parent, *args)
base = TkFrame.new(top).pack(:fill=>:both, :expand=>true)
- TkLabelFrame.new(base, :text=>"ѿ:",
+ TkLabelFrame.new(base, :text=>"変数値:",
:font=>{:family=>'Helvetica', :size=>14}){|f|
args.each{|vnam,vbody|
TkGrid(TkLabel.new(f, :text=>"#{vnam}: ", :anchor=>'w'),
@@ -617,7 +617,7 @@ def showVars2(parent, *args)
f.grid_columnconfig(1, :weight=>1)
f.grid_rowconfig(100, :weight=>1)
}
- TkButton.new(base, :text=>"λ", :width=>8, :default=>:active,
+ TkButton.new(base, :text=>"了解", :width=>8, :default=>:active,
:command=>proc{top.destroy}){|b|
top.bind('Return', proc{b.invoke})
top.bind('Escape', proc{b.invoke})
@@ -637,7 +637,7 @@ else # ver >= 8.4
alias showVars showVars2
end
-# ȥåץ٥륵ݡ
+# 疑似トップレベルサポート
module PseudoToplevel_Evaluable
def pseudo_toplevel_eval(body = Proc.new)
Thread.current[:TOPLEVEL] = self
@@ -743,7 +743,7 @@ def eval_samplecode(code, file=nil)
Tk.update
end
-# ƥȾǤ click Фư
+# テキスト上での click に対する動作
def invoke(txt, idx)
tag = txt.tag_names(idx).find{|t| t.kind_of?(String) && t =~ /^demo-/}
return unless tag
@@ -776,7 +776,7 @@ def invoke (txt, idx)
end
=end
-# ɽ
+# 状態表示
def showStatus (txt, index)
tag = txt.tag_names(index).find{|t| t.kind_of?(String) && t =~ /^demo-/}
cursor = txt.cget('cursor')
@@ -786,13 +786,13 @@ def showStatus (txt, index)
else
demoname = tag[5..-1]
$statusBarLabel.configure('text',
- "ץץ \"#{demoname}\" μ¹ ")
+ "サンプルプログラム \"#{demoname}\" の実行 ")
newcursor = 'hand2'
end
txt.configure('cursor'=>newcursor) if cursor != newcursor
end
-# ɤɽ
+# ソースコードの表示
def showCode1(demo)
file = "#{demo}.rb"
$code_window = nil unless defined? $code_window
@@ -801,15 +801,15 @@ def showCode1(demo)
f = TkFrame.new($code_window)
TkButton.new(f) {
- #text "λ"
- text "Ĥ"
+ #text "了解"
+ text "閉じる"
command proc{
$code_window.destroy
$code_window = nil
}
}.pack('side'=>'right', 'expand'=>'false', 'pady'=>2)
TkButton.new(f) {
- text "Ƽ¹"
+ text "再実行"
# command proc{eval($code_text.get('1.0','end'), _null_binding)}
command proc{eval_samplecode($code_text.get('1.0','end'), '<viewer>')}
}.pack('side'=>'right', 'expand'=>'false', 'pady'=>2)
@@ -924,17 +924,17 @@ def showCode2(demo)
posnum.text = pos
}
- #b_dis = TkButton.new(bf, :text=>'λ', :default=>:active,
- b_dis = TkButton.new(bf, :text=>'Ĥ', :default=>:active,
+ #b_dis = TkButton.new(bf, :text=>'了解', :default=>:active,
+ b_dis = TkButton.new(bf, :text=>'閉じる', :default=>:active,
:command=>proc{
$code_window.destroy
$code_window = nil
},
:image=>$image['delete'], :compound=>:left)
- b_prn = TkButton.new(bf, :text=>'',
+ b_prn = TkButton.new(bf, :text=>'印刷',
:command=>proc{printCode($code_text, file)},
:image=>$image['print'], :compound=>:left)
- b_run = TkButton.new(bf, :text=>'Ƽ¹',
+ b_run = TkButton.new(bf, :text=>'再実行',
:command=>proc{
# eval($code_text.get('1.0','end'), _null_binding)
eval_samplecode($code_text.get('1.0','end'), '<viewer>')
@@ -1012,27 +1012,27 @@ def printCode(txt, file)
msg = `lp -c #{fname}`
unless $?.exitstatus == 0
Tk.messageBox(:title=>'Print spooling failure',
- :message=>'顼ȯޤ' +
- '˼ԤΤȻפޤ : ' + msg)
+ :message=>'エラーが発生しました.' +
+ '印刷に失敗したものと思われます : ' + msg)
end
when 'windows'
begin
printTextWin32(fname)
rescue => e
Tk.messageBox(:title=>'Print spooling failure',
- :message=>'顼ȯޤ' +
- '˼ԤΤȻפޤ : ' +
+ :message=>'エラーが発生しました.' +
+ '印刷に失敗したものと思われます : ' +
e.message)
end
when 'macintosh'
Tk.messageBox(:title=>'Operation not Implemented',
- :message=>'ǽϤޤƤޤ')
+ :message=>'印刷機能はまだ実装されていません')
else
Tk.messageBox(:title=>'Operation not Implemented',
- :message=>'Ф줿Ķ ' +
+ :message=>'検出された環境 ' +
Tk::TCL_PLATFORM('platform') +
- ' ̤ΤδĶǤ뤿ᡤ' +
- 'ǽϼƤޤ: ')
+ ' は未知の環境であるため,' +
+ '印刷機能は実装されていません: ')
end
ensure
File.delete(fname)
@@ -1074,7 +1074,7 @@ end
#
def aboutBox
Tk.messageBox('icon'=>'info', 'type'=>'ok', 'title'=>'About Widget Demo',
- 'message'=>"Ruby/Tk åȥǥ Ver.1.7.1-jp\n\n" +
+ 'message'=>"Ruby/Tk ウィジェットデモ Ver.1.7.1-jp\n\n" +
"based on demos of Tk8.1 -- 8.5 " +
"( Copyright of Tcl/Tk demos:: " +
"(c) 1996-1997 Sun Microsystems, Inc. / " +
@@ -1087,7 +1087,7 @@ def aboutBox
end
####################################
-# ǻꤵ줿ǥư
+# 引数で指定されたデモを起動する
no_launcher = false
if ARGV[0] == '-n'
ARGV.shift
@@ -1118,5 +1118,5 @@ if no_launcher
end
################################
-# ٥Ԥ
+# イベント待ちに入る
Tk.mainloop
diff --git a/ext/tk/sample/msgs_rb2/ja.msg b/ext/tk/sample/msgs_rb2/ja.msg
index 84e89aa6ef..54a105b61f 100644
--- a/ext/tk/sample/msgs_rb2/ja.msg
+++ b/ext/tk/sample/msgs_rb2/ja.msg
@@ -1,85 +1,85 @@
TkMsgCatalog.new('::tkmsgcat_demo') {
- ja 'Application Error', 'ץꥱ󥨥顼', 'euc-jp'
- ja 'Blue', '', 'euc-jp'
- ja 'Color', '', 'euc-jp'
- ja 'Delete', 'õ', 'euc-jp'
- ja 'Error', '顼', 'euc-jp'
- ja 'Exit', 'λ', 'euc-jp'
- ja 'Green', '', 'euc-jp'
- ja 'Red', '', 'euc-jp'
- ja 'blue', '', 'euc-jp'
- ja 'green', '', 'euc-jp'
- ja 'red', '', 'euc-jp'
+ ja 'Application Error', 'アプリケーションエラー', 'utf-8'
+ ja 'Blue', '青', 'utf-8'
+ ja 'Color', '色選択', 'utf-8'
+ ja 'Delete', '消去', 'utf-8'
+ ja 'Error', 'エラー', 'utf-8'
+ ja 'Exit', '終了', 'utf-8'
+ ja 'Green', '緑', 'utf-8'
+ ja 'Red', '赤', 'utf-8'
+ ja 'blue', '青', 'utf-8'
+ ja 'green', '緑', 'utf-8'
+ ja 'red', '赤', 'utf-8'
}
TkMsgCatalog.new('::tk') {
- ja "&Abort", '', 'euc-jp'
+ ja "&Abort", '中止', 'utf-8'
ja "About..."
- ja "All Files", '٤ƤΥե', 'euc-jp'
- ja "Application Error", 'ץꥱ󥨥顼', 'euc-jp'
- ja "&Blue", '', 'euc-jp'
- ja "&Cancel", 'ä', 'euc-jp'
- ja "Cannot change to the directory \"%1\$s\".\nPermission denied.", "ǥ쥯ȥ \"%1\$s\" ѹǤޤ\nĤޤ", 'euc-jp'
- ja "Choose Directory", 'ǥ쥯ȥ', 'euc-jp'
- ja "Clear", 'õ', 'euc-jp'
- ja "Color", '', 'euc-jp'
- ja "Console", '󥽡', 'euc-jp'
- ja "Copy", 'ԡ', 'euc-jp'
- ja "Cut", 'ڤ', 'euc-jp'
- ja "Delete", 'õ', 'euc-jp'
- ja "Details >>", 'ܺ >>', 'euc-jp'
- ja "Directory \"%1\$s\" does not exist.", '"%1$s" Ȥǥ쥯ȥ¸ߤޤ', 'euc-jp'
- ja "&Directory:", 'ǥ쥯ȥ', 'euc-jp'
+ ja "All Files", 'すべてのファイル', 'utf-8'
+ ja "Application Error", 'アプリケーションエラー', 'utf-8'
+ ja "&Blue", '青', 'utf-8'
+ ja "&Cancel", '取り消し', 'utf-8'
+ ja "Cannot change to the directory \"%1\$s\".\nPermission denied.", "ディレクトリ \"%1\$s\" に変更できません.\n許可がありません.", 'utf-8'
+ ja "Choose Directory", 'ディレクトリを選択', 'utf-8'
+ ja "Clear", '消去', 'utf-8'
+ ja "Color", '色', 'utf-8'
+ ja "Console", 'コンソール', 'utf-8'
+ ja "Copy", 'コピー', 'utf-8'
+ ja "Cut", '切り取り', 'utf-8'
+ ja "Delete", '消去', 'utf-8'
+ ja "Details >>", '詳細 >>', 'utf-8'
+ ja "Directory \"%1\$s\" does not exist.", '"%1$s" というディレクトリは存在しません.', 'utf-8'
+ ja "&Directory:", 'ディレクトリ', 'utf-8'
ja "Error: %1\$s"
- ja "Exit", 'λ', 'euc-jp'
- ja "File \"%1\$s\" already exists.\nDo you want to overwrite it?", "\"%1\$s\" Ȥեϴ¸ߤƤޤ\n񤭴ޤ", 'euc-jp'
- ja "File \"%1\$s\" already exists.\n\n", "\"%1\$s\" Ȥեϴ¸ߤƤޤ\n\n", 'euc-jp'
- ja "File \"%1\$s\" does not exist.", '"%1$s" Ȥե¸ߤޤ', 'euc-jp'
- ja "File &name:", 'ե̾', 'euc-jp'
- ja "File &names:", 'ե̾', 'euc-jp'
- ja "Files of &type:", 'ե', 'euc-jp'
- ja "Fi&les:", 'ե', 'euc-jp'
- ja "&Filter", 'ե륿', 'euc-jp'
- ja "Fil&ter:", 'ե륿', 'euc-jp'
- ja "&Green", '', 'euc-jp'
- ja "Hi", 'ˤ', 'euc-jp'
- ja "Hide Console", '󥽡򱣤', 'euc-jp'
- ja "&Ignore", '̵', 'euc-jp'
- ja "Invalid file name \"%1\$s\".", '"%1$s" ʥե̾Ǥ', 'euc-jp'
- ja "Log Files", 'ե', 'euc-jp'
- ja "&No", '', 'euc-jp'
- ja "&OK", 'λ', 'euc-jp'
- ja "OK", 'λ', 'euc-jp'
- ja "Ok", 'λ', 'euc-jp'
- ja "Open", '', 'euc-jp'
- ja "&Open", '', 'euc-jp'
- ja "Open Multiple Files", 'ʣΥե򳫤', 'euc-jp'
- ja "Paste", 'Žդ', 'euc-jp'
- ja "Quit", 'λ', 'euc-jp'
- ja "&Red", '', 'euc-jp'
- ja "Replace existing file?", '¸Υե֤ޤ', 'euc-jp'
- ja "&Retry", 'Ƽ¹', 'euc-jp'
- ja "&Save", '¸', 'euc-jp'
- ja "Save As", '̾դ¸', 'euc-jp'
- ja "Save To Log", '¸', 'euc-jp'
- ja "Select Log File", 'ե', 'euc-jp'
- ja "Select a file to source", 'ե', 'euc-jp'
- ja "&Selection:", '', 'euc-jp'
- ja "Skip Messages", 'åȤФ', 'euc-jp'
- ja "Source...", '...', 'euc-jp'
- ja "Tcl Scripts", 'Tcl ץ', 'euc-jp'
+ ja "Exit", '終了', 'utf-8'
+ ja "File \"%1\$s\" already exists.\nDo you want to overwrite it?", "\"%1\$s\" というファイルは既に存在しています.\n書き換えますか?", 'utf-8'
+ ja "File \"%1\$s\" already exists.\n\n", "\"%1\$s\" というファイルは既に存在しています.\n\n", 'utf-8'
+ ja "File \"%1\$s\" does not exist.", '"%1$s" というファイルは存在しません.', 'utf-8'
+ ja "File &name:", 'ファイル名', 'utf-8'
+ ja "File &names:", 'ファイル名', 'utf-8'
+ ja "Files of &type:", 'ファイル形式', 'utf-8'
+ ja "Fi&les:", 'ファイル', 'utf-8'
+ ja "&Filter", 'フィルター', 'utf-8'
+ ja "Fil&ter:", 'フィルター', 'utf-8'
+ ja "&Green", '緑', 'utf-8'
+ ja "Hi", 'こんにちは', 'utf-8'
+ ja "Hide Console", 'コンソールを隠す', 'utf-8'
+ ja "&Ignore", '無視', 'utf-8'
+ ja "Invalid file name \"%1\$s\".", '"%1$s" は不正なファイル名です.', 'utf-8'
+ ja "Log Files", 'ログファイル', 'utf-8'
+ ja "&No", 'いいえ', 'utf-8'
+ ja "&OK", '了解', 'utf-8'
+ ja "OK", '了解', 'utf-8'
+ ja "Ok", '了解', 'utf-8'
+ ja "Open", '開く', 'utf-8'
+ ja "&Open", '開く', 'utf-8'
+ ja "Open Multiple Files", '複数のファイルを開く', 'utf-8'
+ ja "Paste", '貼り付け', 'utf-8'
+ ja "Quit", '終了', 'utf-8'
+ ja "&Red", '赤', 'utf-8'
+ ja "Replace existing file?", '既存のファイルを置き換えますか?', 'utf-8'
+ ja "&Retry", '再実行', 'utf-8'
+ ja "&Save", '保存', 'utf-8'
+ ja "Save As", '名前を付けて保存', 'utf-8'
+ ja "Save To Log", 'ログを保存', 'utf-8'
+ ja "Select Log File", 'ログファイルを選択', 'utf-8'
+ ja "Select a file to source", 'ソースファイルを選択', 'utf-8'
+ ja "&Selection:", '選択', 'utf-8'
+ ja "Skip Messages", 'メッセージをとばす', 'utf-8'
+ ja "Source...", 'ソース...', 'utf-8'
+ ja "Tcl Scripts", 'Tcl スクリプト', 'utf-8'
ja "Tcl for Windows"
- ja "Text Files", 'ƥȥե', 'euc-jp'
- ja "&Yes", 'Ϥ', 'euc-jp'
- ja "abort", '', 'euc-jp'
- ja "blue", '', 'euc-jp'
- ja "cancel", 'ä', 'euc-jp'
- ja "extension", 'ĥ', 'euc-jp'
- ja "extensions", 'ĥ', 'euc-jp'
- ja "green", '', 'euc-jp'
- ja "ignore", '̵', 'euc-jp'
- ja "ok", 'λ', 'euc-jp'
- ja "red", '', 'euc-jp'
- ja "retry", 'Ƽ¹', 'euc-jp'
- ja "yes", 'Ϥ', 'euc-jp'
+ ja "Text Files", 'テキストファイル', 'utf-8'
+ ja "&Yes", 'はい', 'utf-8'
+ ja "abort", '中止', 'utf-8'
+ ja "blue", '青', 'utf-8'
+ ja "cancel", '取り消し', 'utf-8'
+ ja "extension", '拡張子', 'utf-8'
+ ja "extensions", '拡張子', 'utf-8'
+ ja "green", '緑', 'utf-8'
+ ja "ignore", '無視', 'utf-8'
+ ja "ok", '了解', 'utf-8'
+ ja "red", '赤', 'utf-8'
+ ja "retry", '再実行', 'utf-8'
+ ja "yes", 'はい', 'utf-8'
}
diff --git a/ext/tk/sample/tcltklib/sample0.rb b/ext/tk/sample/tcltklib/sample0.rb
index cd4c8069b4..0ac303ae9e 100644
--- a/ext/tk/sample/tcltklib/sample0.rb
+++ b/ext/tk/sample/tcltklib/sample0.rb
@@ -1,18 +1,18 @@
#! /usr/local/bin/ruby -vd
-# tcltklib 饤֥Υƥ
+# tcltklib ライブラリのテスト
require "tcltklib"
def test
- # 󥿥ץ꥿
+ # インタプリタを生成する
ip1 = TclTkIp.new()
- # ɾƤߤ
+ # 評価してみる
print ip1._return_value().inspect, "\n"
print ip1._eval("puts {abc}").inspect, "\n"
- # ܥäƤߤ
+ # ボタンを作ってみる
print ip1._return_value().inspect, "\n"
print ip1._eval("button .lab -text exit -command \"destroy .\"").inspect,
"\n"
@@ -20,12 +20,12 @@ def test
print ip1._eval("pack .lab").inspect, "\n"
print ip1._return_value().inspect, "\n"
- # 󥿥ץ꥿ ruby ޥɤɾƤߤ
+ # インタプリタから ruby コマンドを評価してみる
# print ip1._eval(%q/ruby {print "print by ruby\n"}/).inspect, "\n"
print ip1._eval(%q+puts [ruby {print "print by ruby\n"; "puts by tcl/tk"}]+).inspect, "\n"
print ip1._return_value().inspect, "\n"
- # ⤦ĥ󥿥ץ꥿Ƥߤ
+ # もう一つインタプリタを生成してみる
ip2 = TclTkIp.new()
ip2._eval("button .lab -text test -command \"puts test ; destroy .\"")
ip2._eval("pack .lab")
diff --git a/ext/tk/sample/tcltklib/sample1.rb b/ext/tk/sample/tcltklib/sample1.rb
index 1965781533..3235edfe0d 100644
--- a/ext/tk/sample/tcltklib/sample1.rb
+++ b/ext/tk/sample/tcltklib/sample1.rb
@@ -1,131 +1,131 @@
#! /usr/local/bin/ruby -d
-# -*- encoding: euc-jp -*-
-# -d ץդ, ǥХåɽ.
+# -*- encoding: utf-8 -*-
+# -d オプションを付けると, デバッグ情報を表示する.
-# tcltk 饤֥Υץ
+# tcltk ライブラリのサンプル
-# ޤ, 饤֥ require .
+# まず, ライブラリを require する.
require "tcltk"
-# ʲ, Test1 Υ󥹥󥹤 initialize() ,
-# tcl/tk ˴ؤԤǤ.
-# ɬ⤽Τ褦ˤɬפ̵,
-# (⤷, ) class γ tcl/tk ˴ؤԤäƤɤ.
+# 以下は, Test1 のインスタンスの initialize() で,
+# tcl/tk に関する処理を行う例である.
+# 必ずしもそのようにする必要は無く,
+# (もし, そうしたければ) class の外で tcl/tk に関する処理を行っても良い.
class Test1
- # (󥿥ץ꥿ƥåȤ).
+ # 初期化(インタプリタを生成してウィジェットを生成する).
def initialize()
- #### ȤΤޤʤ
+ #### 使う前のおまじない
- # 󥿥ץ꥿.
+ # インタプリタの生成.
ip = TclTkInterpreter.new()
- # ޥɤб륪֥Ȥ c ꤷƤ.
+ # コマンドに対応するオブジェクトを c に設定しておく.
c = ip.commands()
- # Ѥ륳ޥɤб륪֥ȤѿƤ.
+ # 使用するコマンドに対応するオブジェクトは変数に入れておく.
append, bind, button, destroy, incr, info, label, place, set, wm =
c.values_at(
"append", "bind", "button", "destroy", "incr", "info", "label", "place",
"set", "wm")
- #### tcl/tk Υޥɤб륪֥(TclTkCommand)
+ #### tcl/tk のコマンドに対応するオブジェクト(TclTkCommand)の操作
- # ¹Ԥ, e() ᥽åɤȤ.
- # (ʲ, tcl/tk ˤ info command r* ¹.)
+ # 実行する時は, e() メソッドを使う.
+ # (以下は, tcl/tk における info command r* を実行.)
print info.e("command", "r*"), "\n"
- # , ޤȤ᤿ʸˤƤƱ.
+ # 引数は, まとめた文字列にしても同じ.
print info.e("command r*"), "\n"
- # ѿѤʤȤ¹ԤǤ뤬, ᤬.
+ # 変数を用いなくとも実行できるが, 見ためが悪い.
print c["info"].e("command", "r*"), "\n"
- # 󥿥ץ꥿Υ᥽åɤȤƤ¹ԤǤ뤬, Ψ.
+ # インタプリタのメソッドとしても実行できるが, 効率が悪い.
print ip.info("command", "r*"), "\n"
####
- # ʲ, ֥ȤѿƤʤ
- # GC оݤˤʤäƤޤ.
+ # 以下, 生成したオブジェクトは変数に代入しておかないと
+ # GC の対象になってしまう.
- #### tcl/tk ѿб륪֥(TclTkVariable)
+ #### tcl/tk の変数に対応するオブジェクト(TclTkVariable)の操作
- # Ʊͤꤹ.
+ # 生成と同時に値を設定する.
v1 = TclTkVariable.new(ip, "20")
- # ɤ߽Ф get ᥽åɤȤ.
+ # 読み出しは get メソッドを使う.
print v1.get(), "\n"
- # set ᥽åɤȤ.
+ # 設定は set メソッドを使う.
v1.set(40)
print v1.get(), "\n"
- # set ޥɤȤäɤ߽Ф, ϲǽ᤬.
- # e() ᥽åΰľ TclTkObject ͤ񤤤Ƥɤ.
+ # set コマンドを使って読み出し, 設定は可能だが見ためが悪い.
+ # e() メソッド等の引数に直接 TclTkObject や数値を書いても良い.
set.e(v1, 30)
print set.e(v1), "\n"
- # tcl/tk ΥޥɤѿǤ.
+ # tcl/tk のコマンドで変数を操作できる.
incr.e(v1)
print v1.get(), "\n"
append.e(v1, 10)
print v1.get(), "\n"
- #### tcl/tk ΥåȤб륪֥(TclTkWidget)
+ #### tcl/tk のウィジェットに対応するオブジェクト(TclTkWidget)の操作
- # 롼ȥåȤФ.
+ # ルートウィジェットを取り出す.
root = ip.rootwidget()
- # åȤ.
+ # ウィジェットの操作.
root.e("configure -height 300 -width 300")
- # ȥդȤ wm Ȥ.
+ # タイトルを付けるときは wm を使う.
wm.e("title", root, $0)
- # ƥåȤȥޥɤꤷ, åȤ.
+ # 親ウィジェットとコマンドを指定して, ウィジェットを作る.
l1 = TclTkWidget.new(ip, root, label, "-text {type `x' to print}")
- # place ɽ.
+ # place すると表示される.
place.e(l1, "-x 0 -rely 0.0 -relwidth 1 -relheight 0.1")
- # ޥ̾ʸǻꤷƤɤ, ᤬.
- # (ޥ̾ΩǤʤФʤʤ.)
+ # コマンド名は文字列で指定しても良いが, 見ためが悪い.
+ # (コマンド名は独立した引数でなければならない.)
l2 = TclTkWidget.new(ip, root, "label")
- # åȤ.
+ # ウィジェットの操作.
l2.e("configure -text {type `q' to exit}")
place.e(l2, "-x 0 -rely 0.1 -relwidth 1 -relheight 0.1")
- #### tcl/tk ΥХåб륪֥(TclTkCallback)
+ #### tcl/tk のコールバックに対応するオブジェクト(TclTkCallback)の操作
- # Хå.
+ # コールバックを生成する.
c1 = TclTkCallback.new(ip, proc{sample(ip, root)})
- # ХåĥåȤ.
+ # コールバックを持つウィジェットを生成する.
b1 = TclTkWidget.new(ip, root, button, "-text sample -command", c1)
place.e(b1, "-x 0 -rely 0.2 -relwidth 1 -relheight 0.1")
- # ٥ȥ롼פȴˤ destroy.e(root) .
+ # イベントループを抜けるには destroy.e(root) する.
c2 = TclTkCallback.new(ip, proc{destroy.e(root)})
b2 = TclTkWidget.new(ip, root, button, "-text exit -command", c2)
place.e(b2, "-x 0 -rely 0.3 -relwidth 1 -relheight 0.1")
- #### ٥ȤΥХ
- # script ɲ (bind tag sequence +script) ϺΤȤǤʤ.
- # (ƥ졼ѿ꤬ޤʤ.)
+ #### イベントのバインド
+ # script の追加 (bind tag sequence +script) は今のところできない.
+ # (イテレータ変数の設定がうまくいかない.)
- # ŪˤϥåȤФ륳ХåƱ.
+ # 基本的にはウィジェットに対するコールバックと同じ.
c3 = TclTkCallback.new(ip, proc{print("q pressed\n"); destroy.e(root)})
bind.e(root, "q", c3)
- # bind ޥɤ % ִˤѥ᡼ꤿȤ,
- # proc{} θʸǻꤹ,
- # ִ̤򥤥ƥ졼ѿ̤Ƽ뤳ȤǤ.
- # proc{} θʸ,
- # bind ޥɤͿ륳ХåʳǻꤷƤϤʤ.
+ # bind コマンドで % 置換によりパラメータを受け取りたいときは,
+ # proc{} の後ろに文字列で指定すると,
+ # 置換結果をイテレータ変数を通して受け取ることができる.
+ # ただし proc{} の後ろの文字列は,
+ # bind コマンドに与えるコールバック以外で指定してはいけない.
c4 = TclTkCallback.new(ip, proc{|i| print("#{i} pressed\n")}, "%A")
bind.e(root, "x", c4)
- # TclTkCallback GC оݤˤ,
- # dcb() (ޤ deletecallbackkeys()) ɬפ.
+ # TclTkCallback を GC の対象にしたければ,
+ # dcb() (または deletecallbackkeys()) する必要がある.
cb = [c1, c2, c3, c4]
c5 = TclTkCallback.new(ip, proc{|w| TclTk.dcb(cb, root, w)}, "%W")
bind.e(root, "<Destroy>", c5)
cb.push(c5)
- #### tcl/tk Υ᡼б륪֥(TclTkImage)
+ #### tcl/tk のイメージに対応するオブジェクト(TclTkImage)の操作
- # ǡꤷ.
+ # データを指定して生成する.
i1 = TclTkImage.new(ip, "photo", "-file maru.gif")
- # ٥ĥդƤߤ.
+ # ラベルに張り付けてみる.
l3 = TclTkWidget.new(ip, root, label, "-relief raised -image", i1)
place.e(l3, "-x 0 -rely 0.4 -relwidth 0.2 -relheight 0.2")
- # Υ᡼Ƹ.
+ # 空のイメージを生成して後で操作する.
i2 = TclTkImage.new(ip, "photo")
- # ᡼.
+ # イメージを操作する.
i2.e("copy", i1)
i2.e("configure -gamma 0.5")
l4 = TclTkWidget.new(ip, root, label, "-relief raised -image", i2)
@@ -134,26 +134,26 @@ class Test1
####
end
- # ץΤΥåȤ.
+ # サンプルのためのウィジェットを生成する.
def sample(ip, parent)
bind, button, destroy, grid, toplevel, wm = ip.commands().values_at(
"bind", "button", "destroy", "grid", "toplevel", "wm")
## toplevel
- # ɥ򳫤ˤ, toplevel Ȥ.
+ # 新しいウインドウを開くには, toplevel を使う.
t1 = TclTkWidget.new(ip, parent, toplevel)
- # ȥդƤ
+ # タイトルを付けておく
wm.e("title", t1, "sample")
- # åȤ˲줿Ȥ, Хå GC оݤˤʤ褦ˤ.
+ # ウィジェットが破壊されたとき, コールバックが GC の対象になるようにする.
cb = []
cb.push(c = TclTkCallback.new(ip, proc{|w| TclTk.dcb(cb, t1, w)}, "%W"))
bind.e(t1, "<Destroy>", c)
- # ܥ.
+ # ボタンの生成.
wid = []
- # toplevel åȤ˲ˤ destroy .
+ # toplevel ウィジェットを破壊するには destroy する.
cb.push(c = TclTkCallback.new(ip, proc{destroy.e(t1)}))
wid.push(TclTkWidget.new(ip, t1, button, "-text close -command", c))
cb.push(c = TclTkCallback.new(ip, proc{test_label(ip, t1)}))
@@ -183,7 +183,7 @@ class Test1
cb.push(c = TclTkCallback.new(ip, proc{test_canvas(ip, t1)}))
wid.push(TclTkWidget.new(ip, t1, button, "-text canvas -command", c))
- # grid ɽ.
+ # grid で表示する.
ro = co = 0
wid.each{|w|
grid.e(w, "-row", ro, "-column", co, "-sticky news")
@@ -196,38 +196,38 @@ class Test1
end
# inittoplevel(ip, parent, title)
- # ʲνޤȤƹԤ.
- # 1. toplevel åȤ.
- # 2. ХåϿѰդ, toplevel åȤ
- # <Destroy> ٥Ȥ˥Хå³Ͽ.
- # 3. ܥ.
- # toplevel å, ܥ, ХåϿѿ
- # ֤.
- # ip: 󥿥ץ꥿
- # parent: ƥå
- # title: toplevel åȤΥɥΥȥ
+ # 以下の処理をまとめて行う.
+ # 1. toplevel ウィジェットを作成する.
+ # 2. コールバックを登録する配列を用意し, toplevel ウィジェットの
+ # <Destroy> イベントにコールバックを削除する手続きを登録する.
+ # 3. クローズボタンを作る.
+ # 作成した toplevel ウィジェット, クローズボタン, コールバック登録用変数
+ # を返す.
+ # ip: インタプリタ
+ # parent: 親ウィジェット
+ # title: toplevel ウィジェットのウインドウのタイトル
def inittoplevel(ip, parent, title)
bind, button, destroy, toplevel, wm = ip.commands().values_at(
"bind", "button", "destroy", "toplevel", "wm")
- # ɥ򳫤ˤ, toplevel Ȥ.
+ # 新しいウインドウを開くには, toplevel を使う.
t1 = TclTkWidget.new(ip, parent, toplevel)
- # ȥդƤ
+ # タイトルを付けておく
wm.e("title", t1, title)
- # åȤ˲줿Ȥ, Хå GC оݤˤʤ褦ˤ.
+ # ウィジェットが破壊されたとき, コールバックが GC の対象になるようにする.
cb = []
cb.push(c = TclTkCallback.new(ip, proc{|w| TclTk.dcb(cb, t1, w)}, "%W"))
bind.e(t1, "<Destroy>", c)
- # close ܥäƤ.
- # toplevel åȤ˲ˤ destroy .
+ # close ボタンを作っておく.
+ # toplevel ウィジェットを破壊するには destroy する.
cb.push(c = TclTkCallback.new(ip, proc{destroy.e(t1)}))
b1 = TclTkWidget.new(ip, t1, button, "-text close -command", c)
return t1, b1, cb
end
- # label Υץ.
+ # label のサンプル.
def test_label(ip, parent)
button, global, label, pack = ip.commands().values_at(
"button", "global", "label", "pack")
@@ -235,7 +235,7 @@ class Test1
## label
- # ʷΥ٥.
+ # いろいろな形のラベル.
l1 = TclTkWidget.new(ip, t1, label, "-text {default(flat)}")
l2 = TclTkWidget.new(ip, t1, label, "-text raised -relief raised")
l3 = TclTkWidget.new(ip, t1, label, "-text sunken -relief sunken")
@@ -244,23 +244,23 @@ class Test1
l6 = TclTkWidget.new(ip, t1, label, "-bitmap error")
l7 = TclTkWidget.new(ip, t1, label, "-bitmap questhead")
- # pack Ƥɽ.
+ # pack しても表示される.
pack.e(b1, l1, l2, l3, l4, l5, l6, l7, "-pady 3")
## -textvariable
- # tcltk 饤֥μǤ, Хå tcl/tk ``³''̤
- # ƤФ. ä, Хå()ѿ˥Ȥ,
- # global ɬפ.
- # global ѿͤꤷƤޤȥ顼ˤʤΤ,
- # tcl/tk ˤɽ, ºݤͤꤷʤ褦,
- # 2 ܤΰˤ nil Ϳ.
+ # tcltk ライブラリの実装では, コールバックは tcl/tk の``手続き''を通して
+ # 呼ばれる. したがって, コールバックの中で(大域)変数にアクセスするときは,
+ # global する必要がある.
+ # global する前に変数に値を設定してしまうとエラーになるので,
+ # tcl/tk における表現形だけ生成して, 実際に値を設定しないように,
+ # 2 番目の引数には nil を与える.
v1 = TclTkVariable.new(ip, nil)
global.e(v1)
v1.set(100)
- # -textvariable ѿꤹ.
+ # -textvariable で変数を設定する.
l6 = TclTkWidget.new(ip, t1, label, "-textvariable", v1)
- # Хå椫ѿ.
+ # コールバックの中から変数を操作する.
cb.push(c = TclTkCallback.new(ip, proc{
global.e(v1); v1.set(v1.get().to_i + 10)}))
b2 = TclTkWidget.new(ip, t1, button, "-text +10 -command", c)
@@ -270,14 +270,14 @@ class Test1
pack.e(l6, b2, b3)
end
- # button Υץ.
+ # button のサンプル.
def test_button(ip, parent)
button, pack = ip.commands().values_at("button", "pack")
t1, b1, cb = inittoplevel(ip, parent, "button")
## button
- # ХåǻȤѿƤʤФʤʤ.
+ # コールバック内で参照する変数は先に宣言しておかなければならない.
b3 = b4 = nil
cb.push(c = TclTkCallback.new(ip, proc{b3.e("flash"); b4.e("flash")}))
b2 = TclTkWidget.new(ip, t1, button, "-text flash -command", c)
@@ -288,7 +288,7 @@ class Test1
pack.e(b1, b2, b3, b4)
end
- # checkbutton Υץ.
+ # checkbutton のサンプル.
def test_checkbutton(ip, parent)
checkbutton, global, pack = ip.commands().values_at(
"checkbutton", "global", "pack")
@@ -298,13 +298,13 @@ class Test1
v1 = TclTkVariable.new(ip, nil)
global.e(v1)
- # -variable ѿꤹ.
+ # -variable で変数を設定する.
ch1 = TclTkWidget.new(ip, t1, checkbutton, "-onvalue on -offvalue off",
"-textvariable", v1, "-variable", v1)
pack.e(b1, ch1)
end
- # radiobutton Υץ.
+ # radiobutton のサンプル.
def test_radiobutton(ip, parent)
global, label, pack, radiobutton = ip.commands().values_at(
"global", "label", "pack", "radiobutton")
@@ -314,10 +314,10 @@ class Test1
v1 = TclTkVariable.new(ip, nil)
global.e(v1)
- # ̥륹ȥ󥰤 "{}" ǻꤹ.
+ # ヌルストリングは "{}" で指定する.
v1.set("{}")
l1 = TclTkWidget.new(ip, t1, label, "-textvariable", v1)
- # -variable ƱѿꤹƱ롼פˤʤ.
+ # -variable で同じ変数を指定すると同じグループになる.
ra1 = TclTkWidget.new(ip, t1, radiobutton,
"-text radio1 -value r1 -variable", v1)
ra2 = TclTkWidget.new(ip, t1, radiobutton,
@@ -328,7 +328,7 @@ class Test1
pack.e(b1, l1, ra1, ra2, ra3)
end
- # scale Υץ.
+ # scale のサンプル.
def test_scale(ip, parent)
global, pack, scale = ip.commands().values_at(
"global", "pack", "scale")
@@ -339,7 +339,7 @@ class Test1
v1 = TclTkVariable.new(ip, nil)
global.e(v1)
v1.set(219)
- # ХåǻȤѿƤʤФʤʤ.
+ # コールバック内で参照する変数は先に宣言しておかなければならない.
sca1 = nil
cb.push(c = TclTkCallback.new(ip, proc{global.e(v1); v = v1.get();
sca1.e("configure -background", format("#%02x%02x%02x", v, v, v))}))
@@ -348,7 +348,7 @@ class Test1
pack.e(b1, sca1)
end
- # entry Υץ.
+ # entry のサンプル.
def test_entry(ip, parent)
button, entry, global, pack = ip.commands().values_at(
"button", "entry", "global", "pack")
@@ -358,7 +358,7 @@ class Test1
v1 = TclTkVariable.new(ip, nil)
global.e(v1)
- # ̥륹ȥ󥰤 "{}" ǻꤹ.
+ # ヌルストリングは "{}" で指定する.
v1.set("{}")
en1 = TclTkWidget.new(ip, t1, entry, "-textvariable", v1)
cb.push(c = TclTkCallback.new(ip, proc{
@@ -367,7 +367,7 @@ class Test1
pack.e(b1, en1, b2)
end
- # text Υץ.
+ # text のサンプル.
def test_text(ip, parent)
button, pack, text = ip.commands().values_at(
"button", "pack", "text")
@@ -377,13 +377,13 @@ class Test1
te1 = TclTkWidget.new(ip, t1, text)
cb.push(c = TclTkCallback.new(ip, proc{
- # 1 ܤ 0 ʸܤǸޤǤɽ, .
+ # 1 行目の 0 文字目から最後までを表示し, 削除する.
print(te1.e("get 1.0 end")); te1.e("delete 1.0 end")}))
b2 = TclTkWidget.new(ip, t1, button, "-text print -command", c)
pack.e(b1, te1, b2)
end
- # raise/lower Υץ.
+ # raise/lower のサンプル.
def test_raise(ip, parent)
button, frame, lower, pack, raise = ip.commands().values_at(
"button", "frame", "lower", "pack", "raise")
@@ -391,9 +391,9 @@ class Test1
## raise/lower
- # button 򱣤ƥȤΤ, frame Ȥ.
+ # button を隠すテストのために, frame を使う.
f1 = TclTkWidget.new(ip, t1, frame)
- # ХåǻȤѿƤʤФʤʤ.
+ # コールバック内で参照する変数は先に宣言しておかなければならない.
b2 = nil
cb.push(c = TclTkCallback.new(ip, proc{raise.e(f1, b2)}))
b2 = TclTkWidget.new(ip, t1, button, "-text raise -command", c)
@@ -405,21 +405,21 @@ class Test1
pack.e(b1, f1)
end
- # modal ʥåȤΥץ.
+ # modal なウィジェットのサンプル.
def test_modal(ip, parent)
button, frame, message, pack, tk_chooseColor, tk_getOpenFile,
tk_messageBox = ip.commands().values_at(
"button", "frame", "message", "pack", "tk_chooseColor",
"tk_getOpenFile", "tk_messageBox")
- # ǽ load Ƥʤ饤֥ ip.commands() ¸ߤʤΤ,
- # TclTkLibCommand ɬפ.
+ # 最初に load されていないライブラリは ip.commands() に存在しないので,
+ # TclTkLibCommand を生成する必要がある.
tk_dialog = TclTkLibCommand.new(ip, "tk_dialog")
t1, b1, cb = inittoplevel(ip, parent, "message/modal")
## message
- mes = " message åȤΥƥȤǤ."
- mes += "ʲ modal ʥåȤΥƥȤǤ."
+ mes = "これは message ウィジェットのテストです."
+ mes += "以下は modal なウィジェットのテストです."
me1 = TclTkWidget.new(ip, t1, message, "-text {#{mes}}")
## modal
@@ -431,7 +431,7 @@ class Test1
b2 = TclTkWidget.new(ip, t1, button, "-text messageBox -command", c)
# tk_dialog
cb.push(c = TclTkCallback.new(ip, proc{
- # å̾뤿˥ߡ frame .
+ # ウィジェット名を生成するためにダミーの frame を生成.
print tk_dialog.e(TclTkWidget.new(ip, t1, frame),
"dialog dialog error 2 yes no cancel"), "\n"}))
b3 = TclTkWidget.new(ip, t1, button, "-text dialog -command", c)
@@ -449,7 +449,7 @@ class Test1
pack.e(b1, me1, b2, b3, b4, b5)
end
- # menu Υץ.
+ # menu のサンプル.
def test_menu(ip, parent)
global, menu, menubutton, pack = ip.commands().values_at(
"global", "menu", "menubutton", "pack")
@@ -458,29 +458,29 @@ class Test1
## menu
- # menubutton .
+ # menubutton を生成する.
mb1 = TclTkWidget.new(ip, t1, menubutton, "-text menu")
- # menu .
+ # menu を生成する.
me1 = TclTkWidget.new(ip, mb1, menu)
- # mb1 me1 ư褦ˤ.
+ # mb1 から me1 が起動されるようにする.
mb1.e("configure -menu", me1)
- # cascade ǵư menu .
+ # cascade で起動される menu を生成する.
me11 = TclTkWidget.new(ip, me1, menu)
- # radiobutton Υץ.
+ # radiobutton のサンプル.
v1 = TclTkVariable.new(ip, nil); global.e(v1); v1.set("r1")
me11.e("add radiobutton -label radio1 -value r1 -variable", v1)
me11.e("add radiobutton -label radio2 -value r2 -variable", v1)
me11.e("add radiobutton -label radio3 -value r3 -variable", v1)
- # cascade ˤ mb11 ư褦ˤ.
+ # cascade により mb11 が起動されるようにする.
me1.e("add cascade -label cascade -menu", me11)
- # checkbutton Υץ.
+ # checkbutton のサンプル.
v2 = TclTkVariable.new(ip, nil); global.e(v2); v2.set("none")
me1.e("add checkbutton -label check -variable", v2)
- # separator Υץ.
+ # separator のサンプル.
me1.e("add separator")
- # command Υץ.
+ # command のサンプル.
v3 = nil
cb.push(c = TclTkCallback.new(ip, proc{
global.e(v1, v2, v3); print "v1: ", v1.get(), ", v2: ", v2.get(),
@@ -495,7 +495,7 @@ class Test1
pack.e(b1, mb1, om1, "-side left")
end
- # listbox Υץ.
+ # listbox のサンプル.
def test_listbox(ip, parent)
clipboard, frame, grid, listbox, lower, menu, menubutton, pack, scrollbar,
selection = ip.commands().values_at(
@@ -506,11 +506,11 @@ class Test1
## listbox/scrollbar
f1 = TclTkWidget.new(ip, t1, frame)
- # ХåǻȤѿƤʤФʤʤ.
+ # コールバック内で参照する変数は先に宣言しておかなければならない.
li1 = sc1 = sc2 = nil
- # ¹Ի, ˥ѥ᡼ĤХå,
- # ƥ졼ѿǤΥѥ᡼뤳ȤǤ.
- # (ʣΥѥ᡼ϤҤȤĤʸˤޤȤ.)
+ # 実行時に, 後ろにパラメータがつくコールバックは,
+ # イテレータ変数でそのパラメータを受け取ることができる.
+ # (複数のパラメータはひとつの文字列にまとめられる.)
cb.push(c1 = TclTkCallback.new(ip, proc{|i| li1.e("xview", i)}))
cb.push(c2 = TclTkCallback.new(ip, proc{|i| li1.e("yview", i)}))
cb.push(c3 = TclTkCallback.new(ip, proc{|i| sc1.e("set", i)}))
@@ -532,17 +532,17 @@ class Test1
me1 = TclTkWidget.new(ip, mb1, menu)
mb1.e("configure -menu", me1)
cb.push(c = TclTkCallback.new(ip, proc{
- # clipboard 򥯥ꥢ.
+ # clipboard をクリア.
clipboard.e("clear")
- # selection ʸɤ߹ clipboard ɲä.
+ # selection から文字列を読み込み clipboard に追加する.
clipboard.e("append {#{selection.e('get')}}")}))
me1.e("add command -label {selection -> clipboard} -command",c)
cb.push(c = TclTkCallback.new(ip, proc{
- # li1 򥯥ꥢ.
+ # li1 をクリア.
li1.e("delete 0 end")
- # clipboard ʸФ, 1 Ԥ
+ # clipboard から文字列を取り出し, 1 行ずつ
selection.e("get -selection CLIPBOARD").split(/\n/).each{|line|
- # li1 .
+ # li1 に挿入する.
li1.e("insert end {#{line}}")}}))
me1.e("add command -label {clipboard -> listbox} -command",c)
@@ -557,7 +557,7 @@ class Test1
pack.e(f2, f1)
end
- # canvas Υץ.
+ # canvas のサンプル.
def test_canvas(ip, parent)
canvas, lower, pack = ip.commands().values_at("canvas", "lower", "pack")
t1, b1, cb = inittoplevel(ip, parent, "canvas")
@@ -566,36 +566,36 @@ class Test1
ca1 = TclTkWidget.new(ip, t1, canvas, "-width 400 -height 300")
lower.e(ca1, b1)
- # rectangle .
+ # rectangle を作る.
idr = ca1.e("create rectangle 10 10 20 20")
- # oval .
+ # oval を作る.
ca1.e("create oval 60 10 100 50")
- # polygon .
+ # polygon を作る.
ca1.e("create polygon 110 10 110 30 140 10")
- # line .
+ # line を作る.
ca1.e("create line 150 10 150 30 190 10")
- # arc .
+ # arc を作る.
ca1.e("create arc 200 10 250 50 -start 0 -extent 90 -style pieslice")
- # i1 , ɤ˲ʤФʤʤ, ݤʤΤäƤ.
+ # i1 は本当は, どこかで破壊しなければならないが, 面倒なので放ってある.
i1 = TclTkImage.new(ip, "photo", "-file maru.gif")
- # image .
+ # image を作る.
ca1.e("create image 100 100 -image", i1)
- # bitmap .
+ # bitmap を作る.
ca1.e("create bitmap 260 50 -bitmap questhead")
- # text .
+ # text を作る.
ca1.e("create text 320 50 -text {drag rectangle}")
- # window (ܥ).
+ # window を作る(クローズボタン).
ca1.e("create window 200 200 -window", b1)
- # bind ˤ rectangle drag Ǥ褦ˤ.
+ # bind により rectangle を drag できるようにする.
cb.push(c = TclTkCallback.new(ip, proc{|i|
- # i x y Τ, Ф.
+ # i に x と y を受け取るので, 取り出す.
x, y = i.split(/ /); x = x.to_f; y = y.to_f
- # ɸѹ.
+ # 座標を変更する.
ca1.e("coords current #{x - 5} #{y - 5} #{x + 5} #{y + 5}")},
- # x, y ɸǶڤäΤ򥤥ƥ졼ѿϤ褦˻.
+ # x, y 座標を空白で区切ったものをイテレータ変数へ渡すように指定.
"%x %y"))
- # rectangle bind .
+ # rectangle に bind する.
ca1.e("bind", idr, "<B1-Motion>", c)
pack.e(ca1)
@@ -605,7 +605,7 @@ end
# test driver
if ARGV.size == 0
- print "#{$0} n , n ĤΥ󥿥ץ꥿ưޤ.\n"
+ print "#{$0} n で, n 個のインタプリタを起動します.\n"
n = 1
else
n = ARGV[0].to_i
@@ -614,16 +614,16 @@ end
print "start\n"
ip = []
-# 󥿥ץ꥿, å.
+# インタプリタ, ウィジェット等の生成.
for i in 1 .. n
ip.push(Test1.new())
end
-# ѰդǤ饤٥ȥ롼פ.
+# 用意ができたらイベントループに入る.
TclTk.mainloop()
print "exit from mainloop\n"
-# 󥿥ץ꥿ GC 뤫Υƥ.
+# インタプリタが GC されるかのテスト.
ip = []
print "GC.start\n" if $DEBUG
GC.start() if $DEBUG
diff --git a/ext/tk/sample/tcltklib/sample2.rb b/ext/tk/sample/tcltklib/sample2.rb
index f187d6ce1d..1acc180680 100644
--- a/ext/tk/sample/tcltklib/sample2.rb
+++ b/ext/tk/sample/tcltklib/sample2.rb
@@ -7,12 +7,12 @@
#---------------------------------------------------------------------------
# Sep. 17, 1997 modified by Y. Shigehiro for tcltk library
-# maeda shugo (shugo@po.aianet.ne.jp) ˤ
-# (ruby/tk ǽ񤫤Ƥ) ruby Υץץ
+# maeda shugo (shugo@po.aianet.ne.jp) 氏による
+# (ruby/tk で書かれていた) ruby のサンプルプログラム
# http://www.aianet.or.jp/~shugo/ruby/othello.rb.gz
-# tcltk 饤֥Ȥ褦, ŪѹƤߤޤ.
+# を tcltk ライブラリを使うように, 機械的に変更してみました.
#
-# ʤ٤ꥸʥƱˤʤ褦ˤƤޤ.
+# なるべくオリジナルと同じになるようにしてあります.
require "observer"
require "tcltk"
@@ -343,14 +343,14 @@ class Othello
@board = Board.new(self)
@board_view = BoardView.new(self, @board)
#### added by Y. Shigehiro
- ## board_view 礭ꤹ.
+ ## board_view の大きさを設定する.
x1, y1, x2, y2 = @board_view.e("bbox all").split(/ /).collect{|i| i.to_f}
@board_view.e("configure -width", x2 - x1)
@board_view.e("configure -height", y2 - y1)
- ## scrollregion ꤹ.
+ ## scrollregion を設定する.
@board_view.e("configure -scrollregion {", @board_view.e("bbox all"),
"}")
- #### ޤ
+ #### ここまで
$pack.e(@board_view, "-fill both -expand true")
panel = TclTkWidget.new($ip, $root, $frame)
diff --git a/ext/tk/sample/tkextlib/tkHTML/page1/index.html b/ext/tk/sample/tkextlib/tkHTML/page1/index.html
index 9efac7f7af..af87289c28 100644
--- a/ext/tk/sample/tkextlib/tkHTML/page1/index.html
+++ b/ext/tk/sample/tkextlib/tkHTML/page1/index.html
@@ -90,7 +90,7 @@ everything and the Wirth of nothing?
All trademarks and copyrights on this
page are owned by their respective owners. Comments
are owned by the Poster.
- The Rest 1997-2000 <A href="http://Andover.Net">Andover.Net</A>.
+ The Rest 1997-2000 <A href="http://Andover.Net">Andover.Net</A>.
</FONT></CENTER>
</TD>
</TR>
diff --git a/ext/tk/sample/tkoptdb-safeTk.rb b/ext/tk/sample/tkoptdb-safeTk.rb
index 3972577b0f..7502e30667 100644
--- a/ext/tk/sample/tkoptdb-safeTk.rb
+++ b/ext/tk/sample/tkoptdb-safeTk.rb
@@ -20,7 +20,7 @@ if ENV['LANG'] =~ /^ja/
# read Japanese resource
ent = TkOptionDB.read_entries(File.expand_path('resource.ja',
File.dirname(__FILE__)),
- 'euc-jp')
+ 'utf-8')
else
# read English resource
ent = TkOptionDB.read_entries(File.expand_path('resource.en',
diff --git a/ext/tk/sample/tkoptdb.rb b/ext/tk/sample/tkoptdb.rb
index 75c21e7e47..0171e465b3 100644
--- a/ext/tk/sample/tkoptdb.rb
+++ b/ext/tk/sample/tkoptdb.rb
@@ -13,7 +13,7 @@ if __FILE__ == $0 || !TkCore::INTERP.safe?
# read Japanese resource
TkOptionDB.read_with_encoding(File.expand_path('resource.ja',
File.dirname(__FILE__)),
- 'euc-jp')
+ 'utf-8')
else
# read English resource
TkOptionDB.readfile(File.expand_path('resource.en',
diff --git a/ext/tk/stubs.c b/ext/tk/stubs.c
index dd475c3455..7398a79ae3 100644
--- a/ext/tk/stubs.c
+++ b/ext/tk/stubs.c
@@ -96,7 +96,7 @@ _nativethread_consistency_check(ip)
# define TK_INDEX 7
# define TCL_NAME "libtcl8.9%s"
# define TK_NAME "libtk8.9%s"
-# if defined(__APPLE__) && defined(__MACH__) /* Mac OS X */
+# ifdef __APPLE__
# undef DLEXT
# define DLEXT ".dylib"
# endif
@@ -329,7 +329,7 @@ ruby_tk_stubs_init(tcl_ip)
if (!p_Tk_Init)
return NO_Tk_Init;
-#if defined USE_TK_STUBS && defined TK_FRAMEWORK && defined(__APPLE__) && defined(__MACH__)
+#if defined USE_TK_STUBS && defined TK_FRAMEWORK && defined(__APPLE__)
/*
FIX ME : dirty hack for Mac OS X frameworks.
With stubs, fails to find Resource/Script directory of Tk.framework.
diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c
index 312b0c05eb..02571d62fb 100644
--- a/ext/tk/tcltklib.c
+++ b/ext/tk/tcltklib.c
@@ -20,7 +20,7 @@
#endif
#ifdef RUBY_VM
-static VALUE rb_thread_critical; /* dummy */
+static int rb_thread_critical; /* dummy */
int rb_thread_check_trap_pending();
#else
/* use rb_thread_critical on Ruby 1.8.x */
@@ -31,6 +31,9 @@ int rb_thread_check_trap_pending();
#define RSTRING_PTR(s) (RSTRING(s)->ptr)
#define RSTRING_LEN(s) (RSTRING(s)->len)
#endif
+#if !defined(RSTRING_LENINT)
+#define RSTRING_LENINT(s) ((int)RSTRING_LEN(s))
+#endif
#if !defined(RARRAY_PTR)
#define RARRAY_PTR(s) (RARRAY(s)->ptr)
#define RARRAY_LEN(s) (RARRAY(s)->len)
@@ -41,6 +44,7 @@ int rb_thread_check_trap_pending();
#else
#define RbTk_OBJ_UNTRUST(x) OBJ_TAINT(x)
#endif
+#define RbTk_ALLOC_N(type, n) (type *)ckalloc((int)(sizeof(type) * (n)))
#if defined(HAVE_RB_PROC_NEW) && !defined(RUBY_VM)
/* Ruby 1.8 :: rb_proc_new() was hidden from intern.h at 2008/04/22 */
@@ -1403,6 +1407,8 @@ pending_exception_check0()
} else {
return 0;
}
+
+ UNREACHABLE;
}
static int
@@ -1444,6 +1450,8 @@ pending_exception_check1(thr_crit_bup, ptr)
} else {
return 0;
}
+
+ UNREACHABLE;
}
@@ -1481,7 +1489,7 @@ call_original_exit(ptr, state)
#if USE_RUBY_ALLOC
argv = (Tcl_Obj **)ALLOC_N(Tcl_Obj *, 3);
#else /* not USE_RUBY_ALLOC */
- argv = (Tcl_Obj **)ckalloc(sizeof(Tcl_Obj *) * 3);
+ argv = RbTk_ALLOC_N(Tcl_Obj *, 3);
#if 0 /* use Tcl_Preserve/Release */
Tcl_Preserve((ClientData)argv); /* XXXXXXXX */
#endif
@@ -1521,7 +1529,7 @@ call_original_exit(ptr, state)
#if USE_RUBY_ALLOC
argv = ALLOC_N(char *, 3); /* XXXXXXXXXX */
#else /* not USE_RUBY_ALLOC */
- argv = (CONST84 char **)ckalloc(sizeof(char *) * 3);
+ argv = RbTk_ALLOC_N(CONST84 char *, 3);
#if 0 /* use Tcl_Preserve/Release */
Tcl_Preserve((ClientData)argv); /* XXXXXXXX */
#endif
@@ -1560,7 +1568,7 @@ call_original_exit(ptr, state)
#if USE_RUBY_ALLOC
argv = (char **)ALLOC_N(char *, 3);
#else /* not USE_RUBY_ALLOC */
- argv = (char **)ckalloc(sizeof(char *) * 3);
+ argv = RbTk_ALLOC_N(char *, 3);
#if 0 /* use Tcl_Preserve/Release */
Tcl_Preserve((ClientData)argv); /* XXXXXXXX */
#endif
@@ -2047,6 +2055,7 @@ call_DoOneEvent(flag_val)
#endif
+#if 0
static VALUE
#ifdef HAVE_PROTOTYPES
eventloop_sleep(VALUE dummy)
@@ -2062,7 +2071,7 @@ eventloop_sleep(dummy)
}
t.tv_sec = 0;
- t.tv_usec = (long)(no_event_wait*1000.0);
+ t.tv_usec = (int)(no_event_wait*1000.0);
#ifdef HAVE_NATIVETHREAD
#ifndef RUBY_USE_NATIVE_THREAD
@@ -2086,6 +2095,7 @@ eventloop_sleep(dummy)
return Qnil;
}
+#endif
#define USE_EVLOOP_THREAD_ALONE_CHECK_FLAG 0
@@ -2193,7 +2203,7 @@ lib_eventloop_core(check_root, update_flag, check_var, interp)
if (update_flag) DUMP1("update loop start!!");
t.tv_sec = 0;
- t.tv_usec = 1000 * (long)no_event_wait;
+ t.tv_usec = 1000 * no_event_wait;
Tcl_DeleteTimerHandler(timer_token);
run_timer_flag = 0;
@@ -2676,7 +2686,7 @@ lib_eventloop_launcher(check_root, update_flag, check_var, interp)
{
volatile VALUE parent_evloop = eventloop_thread;
struct evloop_params *args = ALLOC(struct evloop_params);
- /* struct evloop_params *args = (struct evloop_params *)ckalloc(sizeof(struct evloop_params)); */
+ /* struct evloop_params *args = RbTk_ALLOC_N(struct evloop_params, 1); */
tcl_stubs_check();
@@ -2956,10 +2966,10 @@ lib_thread_callback(argc, argv, self)
}
q = (struct thread_call_proc_arg *)ALLOC(struct thread_call_proc_arg);
- /* q = (struct thread_call_proc_arg *)ckalloc(sizeof(struct thread_call_proc_arg)); */
+ /* q = RbTk_ALLOC_N(struct thread_call_proc_arg, 1); */
q->proc = proc;
q->done = (int*)ALLOC(int);
- /* q->done = (int*)ckalloc(sizeof(int)); */
+ /* q->done = RbTk_ALLOC_N(int, 1); */
*(q->done) = 0;
/* create call-proc thread */
@@ -3121,14 +3131,14 @@ ip_set_exc_message(interp, exc)
/* buf = ALLOC_N(char, (RSTRING(msg)->len)+1);*/
/* memcpy(buf, RSTRING(msg)->ptr, RSTRING(msg)->len);*/
/* buf[RSTRING(msg)->len] = 0; */
- buf = ALLOC_N(char, RSTRING_LEN(msg)+1);
- /* buf = ckalloc(sizeof(char)*((RSTRING_LEN(msg))+1)); */
+ buf = ALLOC_N(char, RSTRING_LENINT(msg)+1);
+ /* buf = ckalloc(RSTRING_LENINT(msg)+1); */
memcpy(buf, RSTRING_PTR(msg), RSTRING_LEN(msg));
buf[RSTRING_LEN(msg)] = 0;
Tcl_DStringInit(&dstr);
Tcl_DStringFree(&dstr);
- Tcl_ExternalToUtfDString(encoding, buf, RSTRING_LEN(msg), &dstr);
+ Tcl_ExternalToUtfDString(encoding, buf, RSTRING_LENINT(msg), &dstr);
Tcl_AppendResult(interp, Tcl_DStringValue(&dstr), (char*)NULL);
DUMP2("error message:%s", Tcl_DStringValue(&dstr));
@@ -3555,7 +3565,7 @@ ip_ruby_cmd_receiver_get(str)
} else {
/* global variable omitted '$' */
char *buf;
- int len;
+ size_t len;
len = strlen(str);
buf = ALLOC_N(char, len + 2);
@@ -3677,7 +3687,7 @@ ip_ruby_cmd(clientData, interp, argc, argv)
/* allocate */
arg = ALLOC(struct cmd_body_arg);
- /* arg = (struct cmd_body_arg *)ckalloc(sizeof(struct cmd_body_arg)); */
+ /* arg = RbTk_ALLOC_N(struct cmd_body_arg, 1); */
arg->receiver = receiver;
arg->method = method;
@@ -4116,7 +4126,7 @@ ip_rb_threadUpdateCommand(clientData, interp, objc, objv)
DUMP1("pass argument check");
/* param = (struct th_update_param *)Tcl_Alloc(sizeof(struct th_update_param)); */
- param = (struct th_update_param *)ckalloc(sizeof(struct th_update_param));
+ param = RbTk_ALLOC_N(struct th_update_param, 1);
#if 0 /* use Tcl_Preserve/Release */
Tcl_Preserve((ClientData)param);
#endif
@@ -4980,7 +4990,7 @@ ip_rb_threadVwaitCommand(clientData, interp, objc, objv)
rb_thread_critical = Qtrue;
/* param = (struct th_vwait_param *)Tcl_Alloc(sizeof(struct th_vwait_param)); */
- param = (struct th_vwait_param *)ckalloc(sizeof(struct th_vwait_param));
+ param = RbTk_ALLOC_N(struct th_vwait_param, 1);
#if 1 /* use Tcl_Preserve/Release */
Tcl_Preserve((ClientData)param);
#endif
@@ -5196,7 +5206,7 @@ ip_rb_threadTkWaitCommand(clientData, interp, objc, objv)
#endif
/* param = (struct th_vwait_param *)Tcl_Alloc(sizeof(struct th_vwait_param)); */
- param = (struct th_vwait_param *)ckalloc(sizeof(struct th_vwait_param));
+ param = RbTk_ALLOC_N(struct th_vwait_param, 1);
#if 1 /* use Tcl_Preserve/Release */
Tcl_Preserve((ClientData)param);
#endif
@@ -6042,7 +6052,7 @@ ip_rbNamespaceObjCmd(clientData, interp, objc, objv)
char **argv;
/* argv = (char **)Tcl_Alloc(sizeof(char *) * (objc + 1)); */
- argv = (char **)ckalloc(sizeof(char *) * (objc + 1));
+ argv = RbTk_ALLOC_N(char *, (objc + 1));
#if 0 /* use Tcl_Preserve/Release */
Tcl_Preserve((ClientData)argv); /* XXXXXXXX */
#endif
@@ -6151,7 +6161,7 @@ ip_init(argc, argv, self)
/* create object */
Data_Get_Struct(self, struct tcltkip, ptr);
ptr = ALLOC(struct tcltkip);
- /* ptr = (struct tcltkip *)ckalloc(sizeof(struct tcltkip)); */
+ /* ptr = RbTk_ALLOC_N(struct tcltkip, 1); */
DATA_PTR(self) = ptr;
#ifdef RUBY_USE_NATIVE_THREAD
ptr->tk_thread_id = 0;
@@ -6388,7 +6398,7 @@ ip_create_slave_core(interp, argc, argv)
{
struct tcltkip *master = get_ip(interp);
struct tcltkip *slave = ALLOC(struct tcltkip);
- /* struct tcltkip *slave = (struct tcltkip *)ckalloc(sizeof(struct tcltkip)); */
+ /* struct tcltkip *slave = RbTk_ALLOC_N(struct tcltkip, 1); */
VALUE safemode;
VALUE name;
int safe;
@@ -6928,22 +6938,22 @@ get_obj_from_str(str)
StringValue(enc);
if (strcmp(RSTRING_PTR(enc), "binary") == 0) {
/* binary string */
- return Tcl_NewByteArrayObj((const unsigned char *)s, RSTRING_LEN(str));
+ return Tcl_NewByteArrayObj((const unsigned char *)s, RSTRING_LENINT(str));
} else {
/* text string */
- return Tcl_NewStringObj(s, RSTRING_LEN(str));
+ return Tcl_NewStringObj(s, RSTRING_LENINT(str));
}
#ifdef HAVE_RUBY_ENCODING_H
} else if (rb_enc_get_index(str) == ENCODING_INDEX_BINARY) {
/* binary string */
- return Tcl_NewByteArrayObj((const unsigned char *)s, RSTRING_LEN(str));
+ return Tcl_NewByteArrayObj((const unsigned char *)s, RSTRING_LENINT(str));
#endif
} else if (memchr(s, 0, RSTRING_LEN(str))) {
/* probably binary string */
- return Tcl_NewByteArrayObj((const unsigned char *)s, RSTRING_LEN(str));
+ return Tcl_NewByteArrayObj((const unsigned char *)s, RSTRING_LENINT(str));
} else {
/* probably text string */
- return Tcl_NewStringObj(s, RSTRING_LEN(str));
+ return Tcl_NewStringObj(s, RSTRING_LENINT(str));
}
#endif
}
@@ -7149,7 +7159,7 @@ tk_funcall(func, argc, argv, obj)
/* allocate memory (argv cross over thread : must be in heap) */
if (argv) {
/* VALUE *temp = ALLOC_N(VALUE, argc); */
- VALUE *temp = (VALUE*)ckalloc(sizeof(VALUE) * argc);
+ VALUE *temp = RbTk_ALLOC_N(VALUE, argc);
#if 0 /* use Tcl_Preserve/Release */
Tcl_Preserve((ClientData)temp); /* XXXXXXXX */
#endif
@@ -7159,7 +7169,7 @@ tk_funcall(func, argc, argv, obj)
/* allocate memory (keep result) */
/* alloc_done = (int*)ALLOC(int); */
- alloc_done = (int*)ckalloc(sizeof(int));
+ alloc_done = RbTk_ALLOC_N(int, 1);
#if 0 /* use Tcl_Preserve/Release */
Tcl_Preserve((ClientData)alloc_done); /* XXXXXXXX */
#endif
@@ -7167,7 +7177,7 @@ tk_funcall(func, argc, argv, obj)
/* allocate memory (freed by Tcl_ServiceEvent) */
/* callq = (struct call_queue *)Tcl_Alloc(sizeof(struct call_queue)); */
- callq = (struct call_queue *)ckalloc(sizeof(struct call_queue));
+ callq = RbTk_ALLOC_N(struct call_queue, 1);
#if 0 /* use Tcl_Preserve/Release */
Tcl_Preserve(callq);
#endif
@@ -7632,7 +7642,7 @@ ip_eval(self, str)
} else {
DUMP2("eval from current eventloop %lx", current);
}
- result = ip_eval_real(self, RSTRING_PTR(str), RSTRING_LEN(str));
+ result = ip_eval_real(self, RSTRING_PTR(str), RSTRING_LENINT(str));
if (rb_obj_is_kind_of(result, rb_eException)) {
rb_exc_raise(result);
}
@@ -7646,14 +7656,14 @@ ip_eval(self, str)
/* allocate memory (keep result) */
/* alloc_done = (int*)ALLOC(int); */
- alloc_done = (int*)ckalloc(sizeof(int));
+ alloc_done = RbTk_ALLOC_N(int, 1);
#if 0 /* use Tcl_Preserve/Release */
Tcl_Preserve((ClientData)alloc_done); /* XXXXXXXX */
#endif
*alloc_done = 0;
/* eval_str = ALLOC_N(char, RSTRING_LEN(str) + 1); */
- eval_str = ckalloc(sizeof(char) * (RSTRING_LEN(str) + 1));
+ eval_str = ckalloc(RSTRING_LENINT(str) + 1);
#if 0 /* use Tcl_Preserve/Release */
Tcl_Preserve((ClientData)eval_str); /* XXXXXXXX */
#endif
@@ -7662,7 +7672,7 @@ ip_eval(self, str)
/* allocate memory (freed by Tcl_ServiceEvent) */
/* evq = (struct eval_queue *)Tcl_Alloc(sizeof(struct eval_queue)); */
- evq = (struct eval_queue *)ckalloc(sizeof(struct eval_queue));
+ evq = RbTk_ALLOC_N(struct eval_queue, 1);
#if 0 /* use Tcl_Preserve/Release */
Tcl_Preserve(evq);
#endif
@@ -7673,7 +7683,7 @@ ip_eval(self, str)
/* construct event data */
evq->done = alloc_done;
evq->str = eval_str;
- evq->len = RSTRING_LEN(str);
+ evq->len = RSTRING_LENINT(str);
evq->interp = ip_obj;
evq->result = result;
evq->thread = current;
@@ -7775,6 +7785,8 @@ ip_cancel_eval_core(interp, msg, flag)
#if TCL_MAJOR_VERSION < 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 6)
rb_raise(rb_eNotImpError,
"cancel_eval is supported Tcl/Tk8.6 or later.");
+
+ UNREACHABLE;
#else
Tcl_Obj *msg_obj;
@@ -8055,14 +8067,14 @@ lib_toUTF8_core(ip_obj, src, encodename)
return str;
}
buf = ALLOC_N(char, RSTRING_LEN(str)+1);
- /* buf = ckalloc(sizeof(char) * (RSTRING_LEN(str)+1)); */
+ /* buf = ckalloc(sizeof(char) * (RSTRING_LENINT(str)+1)); */
memcpy(buf, RSTRING_PTR(str), RSTRING_LEN(str));
buf[RSTRING_LEN(str)] = 0;
Tcl_DStringInit(&dstr);
Tcl_DStringFree(&dstr);
/* Tcl_ExternalToUtfDString(encoding,buf,strlen(buf),&dstr); */
- Tcl_ExternalToUtfDString(encoding, buf, RSTRING_LEN(str), &dstr);
+ Tcl_ExternalToUtfDString(encoding, buf, RSTRING_LENINT(str), &dstr);
/* str = rb_tainted_str_new2(Tcl_DStringValue(&dstr)); */
/* str = rb_str_new2(Tcl_DStringValue(&dstr)); */
@@ -8210,7 +8222,7 @@ lib_fromUTF8_core(ip_obj, src, encodename)
int len;
StringValue(str);
- tclstr = Tcl_NewStringObj(RSTRING_PTR(str), RSTRING_LEN(str));
+ tclstr = Tcl_NewStringObj(RSTRING_PTR(str), RSTRING_LENINT(str));
Tcl_IncrRefCount(tclstr);
s = (char*)Tcl_GetByteArrayFromObj(tclstr, &len);
str = rb_tainted_str_new(s, len);
@@ -8246,14 +8258,14 @@ lib_fromUTF8_core(ip_obj, src, encodename)
}
buf = ALLOC_N(char, RSTRING_LEN(str)+1);
- /* buf = ckalloc(sizeof(char) * (RSTRING_LEN(str)+1)); */
+ /* buf = ckalloc(sizeof(char) * (RSTRING_LENINT(str)+1)); */
memcpy(buf, RSTRING_PTR(str), RSTRING_LEN(str));
buf[RSTRING_LEN(str)] = 0;
Tcl_DStringInit(&dstr);
Tcl_DStringFree(&dstr);
/* Tcl_UtfToExternalDString(encoding,buf,strlen(buf),&dstr); */
- Tcl_UtfToExternalDString(encoding,buf,RSTRING_LEN(str),&dstr);
+ Tcl_UtfToExternalDString(encoding,buf,RSTRING_LENINT(str),&dstr);
/* str = rb_tainted_str_new2(Tcl_DStringValue(&dstr)); */
/* str = rb_str_new2(Tcl_DStringValue(&dstr)); */
@@ -8342,7 +8354,7 @@ lib_UTF_backslash_core(self, str, all_bs)
rb_thread_critical = Qtrue;
/* src_buf = ALLOC_N(char, RSTRING_LEN(str)+1); */
- src_buf = ckalloc(sizeof(char) * (RSTRING_LEN(str)+1));
+ src_buf = ckalloc(RSTRING_LENINT(str)+1);
#if 0 /* use Tcl_Preserve/Release */
Tcl_Preserve((ClientData)src_buf); /* XXXXXXXX */
#endif
@@ -8350,7 +8362,7 @@ lib_UTF_backslash_core(self, str, all_bs)
src_buf[RSTRING_LEN(str)] = 0;
/* dst_buf = ALLOC_N(char, RSTRING_LEN(str)+1); */
- dst_buf = ckalloc(sizeof(char) * (RSTRING_LEN(str)+1));
+ dst_buf = ckalloc(RSTRING_LENINT(str)+1);
#if 0 /* use Tcl_Preserve/Release */
Tcl_Preserve((ClientData)dst_buf); /* XXXXXXXX */
#endif
@@ -8487,7 +8499,7 @@ invoke_tcl_proc(arg)
if (!inf->cmdinfo.isNativeObjectProc) {
/* string interface */
/* argv = (char **)ALLOC_N(char *, argc+1);*/ /* XXXXXXXXXX */
- argv = (char **)ckalloc(sizeof(char *)*(argc+1));
+ argv = RbTk_ALLOC_N(char *, (argc+1));
#if 0 /* use Tcl_Preserve/Release */
Tcl_Preserve((ClientData)argv); /* XXXXXXXX */
#endif
@@ -8633,7 +8645,7 @@ ip_invoke_core(interp, argc, argv)
#if TCL_MAJOR_VERSION >= 8
/* unknown_objv = (Tcl_Obj **)ALLOC_N(Tcl_Obj *, objc+2); */
- unknown_objv = (Tcl_Obj **)ckalloc(sizeof(Tcl_Obj *) * (objc+2));
+ unknown_objv = RbTk_ALLOC_N(Tcl_Obj *, (objc+2));
#if 0 /* use Tcl_Preserve/Release */
Tcl_Preserve((ClientData)unknown_objv); /* XXXXXXXX */
#endif
@@ -8644,7 +8656,7 @@ ip_invoke_core(interp, argc, argv)
objv = unknown_objv;
#else
/* unknown_argv = (char **)ALLOC_N(char *, argc+2); */
- unknown_argv = (char **)ckalloc(sizeof(char *) * (argc+2));
+ unknown_argv = RbTk_ALLOC_N(char *, (argc+2));
#if 0 /* use Tcl_Preserve/Release */
Tcl_Preserve((ClientData)unknown_argv); /* XXXXXXXX */
#endif
@@ -8701,7 +8713,7 @@ ip_invoke_core(interp, argc, argv)
/* string interface */
/* argv = (char **)ALLOC_N(char *, argc+1); */
- argv = (char **)ckalloc(sizeof(char *) * (argc+1));
+ argv = RbTk_ALLOC_N(char *, (argc+1));
#if 0 /* use Tcl_Preserve/Release */
Tcl_Preserve((ClientData)argv); /* XXXXXXXX */
#endif
@@ -8846,7 +8858,7 @@ alloc_invoke_arguments(argc, argv)
/* memory allocation */
#if TCL_MAJOR_VERSION >= 8
/* av = ALLOC_N(Tcl_Obj *, argc+1);*/ /* XXXXXXXXXX */
- av = (Tcl_Obj**)ckalloc(sizeof(Tcl_Obj *)*(argc+1));
+ av = RbTk_ALLOC_N(Tcl_Obj *, (argc+1));
#if 0 /* use Tcl_Preserve/Release */
Tcl_Preserve((ClientData)av); /* XXXXXXXX */
#endif
@@ -8859,7 +8871,7 @@ alloc_invoke_arguments(argc, argv)
#else /* TCL_MAJOR_VERSION < 8 */
/* string interface */
/* av = ALLOC_N(char *, argc+1); */
- av = (char**)ckalloc(sizeof(char *) * (argc+1));
+ av = RbTk_ALLOC_N(char *, (argc+1));
#if 0 /* use Tcl_Preserve/Release */
Tcl_Preserve((ClientData)av); /* XXXXXXXX */
#endif
@@ -9139,7 +9151,7 @@ ip_invoke_with_position(argc, argv, obj, position)
/* allocate memory (keep result) */
/* alloc_done = (int*)ALLOC(int); */
- alloc_done = (int*)ckalloc(sizeof(int));
+ alloc_done = RbTk_ALLOC_N(int, 1);
#if 0 /* use Tcl_Preserve/Release */
Tcl_Preserve((ClientData)alloc_done); /* XXXXXXXX */
#endif
@@ -9147,7 +9159,7 @@ ip_invoke_with_position(argc, argv, obj, position)
/* allocate memory (freed by Tcl_ServiceEvent) */
/* ivq = (struct invoke_queue *)Tcl_Alloc(sizeof(struct invoke_queue)); */
- ivq = (struct invoke_queue *)ckalloc(sizeof(struct invoke_queue));
+ ivq = RbTk_ALLOC_N(struct invoke_queue, 1);
#if 0 /* use Tcl_Preserve/Release */
Tcl_Preserve((ClientData)ivq); /* XXXXXXXX */
#endif
@@ -9869,7 +9881,7 @@ lib_merge_tklist(argc, argv, obj)
/* based on Tcl/Tk's Tcl_Merge() */
/* flagPtr = ALLOC_N(int, argc); */
- flagPtr = (int *)ckalloc(sizeof(int) * argc);
+ flagPtr = RbTk_ALLOC_N(int, argc);
#if 0 /* use Tcl_Preserve/Release */
Tcl_Preserve((ClientData)flagPtr); /* XXXXXXXXXX */
#endif
@@ -9880,7 +9892,7 @@ lib_merge_tklist(argc, argv, obj)
if (OBJ_TAINTED(argv[num])) taint_flag = 1;
dst = StringValuePtr(argv[num]);
#if TCL_MAJOR_VERSION >= 8
- len += Tcl_ScanCountedElement(dst, RSTRING_LEN(argv[num]),
+ len += Tcl_ScanCountedElement(dst, RSTRING_LENINT(argv[num]),
&flagPtr[num]) + 1;
#else /* TCL_MAJOR_VERSION < 8 */
len += Tcl_ScanElement(dst, &flagPtr[num]) + 1;
@@ -9897,7 +9909,7 @@ lib_merge_tklist(argc, argv, obj)
for(num = 0; num < argc; num++) {
#if TCL_MAJOR_VERSION >= 8
len = Tcl_ConvertCountedElement(RSTRING_PTR(argv[num]),
- RSTRING_LEN(argv[num]),
+ RSTRING_LENINT(argv[num]),
dst, flagPtr[num]);
#else /* TCL_MAJOR_VERSION < 8 */
len = Tcl_ConvertElement(RSTRING_PTR(argv[num]), dst, flagPtr[num]);
@@ -9961,10 +9973,10 @@ lib_conv_listelement(self, src)
StringValue(src);
#if TCL_MAJOR_VERSION >= 8
- len = Tcl_ScanCountedElement(RSTRING_PTR(src), RSTRING_LEN(src),
+ len = Tcl_ScanCountedElement(RSTRING_PTR(src), RSTRING_LENINT(src),
&scan_flag);
dst = rb_str_new(0, len + 1);
- len = Tcl_ConvertCountedElement(RSTRING_PTR(src), RSTRING_LEN(src),
+ len = Tcl_ConvertCountedElement(RSTRING_PTR(src), RSTRING_LENINT(src),
RSTRING_PTR(dst), scan_flag);
#else /* TCL_MAJOR_VERSION < 8 */
len = Tcl_ScanElement(RSTRING_PTR(src), &scan_flag);
@@ -10008,6 +10020,8 @@ lib_get_reltype_name(self)
default:
rb_raise(rb_eRuntimeError, "tcltklib has invalid release type number");
}
+
+ UNREACHABLE;
}
@@ -10015,8 +10029,8 @@ static VALUE
tcltklib_compile_info()
{
volatile VALUE ret;
- int size;
- char form[]
+ size_t size;
+ static CONST char form[]
= "tcltklib %s :: Ruby%s (%s) %s pthread :: Tcl%s(%s)/Tk%s(%s) %s";
char *info;
@@ -10111,6 +10125,8 @@ create_dummy_encoding_for_tk_core(interp, name, error_mode)
return Qnil;
}
}
+
+ UNREACHABLE;
#else
return name;
#endif
diff --git a/ext/tk/tkutil/tkutil.c b/ext/tk/tkutil/tkutil.c
index 2f92b334bb..0e256921ba 100644
--- a/ext/tk/tkutil/tkutil.c
+++ b/ext/tk/tkutil/tkutil.c
@@ -12,7 +12,7 @@
#include "ruby.h"
#ifdef RUBY_VM
-static VALUE rb_thread_critical; /* dummy */
+static int rb_thread_critical; /* dummy */
#else
/* On Ruby 1.8.x, use rb_thread_critical (defined at rubysig.h) */
#include "rubysig.h"
@@ -202,8 +202,8 @@ tk_uninstall_cmd(self, cmd_id)
VALUE self;
VALUE cmd_id;
{
- int head_len = strlen(cmd_id_head);
- int prefix_len = strlen(cmd_id_prefix);
+ size_t head_len = strlen(cmd_id_head);
+ size_t prefix_len = strlen(cmd_id_prefix);
StringValue(cmd_id);
if (strncmp(cmd_id_head, RSTRING_PTR(cmd_id), head_len) != 0) {
@@ -266,7 +266,6 @@ to_strkey(key, value, hash)
VALUE value;
VALUE hash;
{
- if (key == Qundef) return ST_CONTINUE;
rb_hash_aset(hash, rb_funcall(key, ID_to_s, 0, 0), value);
return ST_CHECK;
}
@@ -280,7 +279,7 @@ tk_symbolkey2str(self, keys)
if NIL_P(keys) return new_keys;
keys = rb_convert_type(keys, T_HASH, "Hash", "to_hash");
- st_foreach(RHASH_TBL(keys), to_strkey, new_keys);
+ st_foreach_check(RHASH_TBL(keys), to_strkey, new_keys, Qundef);
return new_keys;
}
@@ -298,7 +297,8 @@ ary2list(ary, enc_flag, self)
VALUE enc_flag;
VALUE self;
{
- int idx, idx2, size, size2, req_chk_flag;
+ long idx, idx2, size, size2;
+ int req_chk_flag;
volatile VALUE val, val2, str_val;
volatile VALUE dst;
volatile VALUE sys_enc, dst_enc, str_enc;
@@ -451,7 +451,8 @@ ary2list2(ary, enc_flag, self)
VALUE enc_flag;
VALUE self;
{
- int idx, size, req_chk_flag;
+ long idx, size;
+ int req_chk_flag;
volatile VALUE val, str_val;
volatile VALUE dst;
volatile VALUE sys_enc, dst_enc, str_enc;
@@ -551,7 +552,7 @@ assoc2kv(assoc, ary, self)
VALUE ary;
VALUE self;
{
- int i, j, len;
+ long i, j, len;
volatile VALUE pair;
volatile VALUE val;
volatile VALUE dst = rb_ary_new2(2 * RARRAY_LEN(assoc));
@@ -599,7 +600,7 @@ assoc2kv_enc(assoc, ary, self)
VALUE ary;
VALUE self;
{
- int i, j, len;
+ long i, j, len;
volatile VALUE pair;
volatile VALUE val;
volatile VALUE dst = rb_ary_new2(2 * RARRAY_LEN(assoc));
@@ -651,7 +652,6 @@ push_kv(key, val, args)
ary = RARRAY_PTR(args)[0];
- if (key == Qundef) return ST_CONTINUE;
#if 0
rb_ary_push(ary, key2keyname(key));
if (val != TK_None) rb_ary_push(ary, val);
@@ -674,7 +674,7 @@ hash2kv(hash, ary, self)
volatile VALUE dst = rb_ary_new2(2 * RHASH_SIZE(hash));
volatile VALUE args = rb_ary_new3(2, dst, self);
- st_foreach(RHASH_TBL(hash), push_kv, args);
+ st_foreach_check(RHASH_TBL(hash), push_kv, args, Qundef);
if (NIL_P(ary)) {
return dst;
@@ -693,7 +693,6 @@ push_kv_enc(key, val, args)
ary = RARRAY_PTR(args)[0];
- if (key == Qundef) return ST_CONTINUE;
#if 0
rb_ary_push(ary, key2keyname(key));
if (val != TK_None) {
@@ -719,7 +718,7 @@ hash2kv_enc(hash, ary, self)
volatile VALUE dst = rb_ary_new2(2 * RHASH_SIZE(hash));
volatile VALUE args = rb_ary_new3(2, dst, self);
- st_foreach(RHASH_TBL(hash), push_kv_enc, args);
+ st_foreach_check(RHASH_TBL(hash), push_kv_enc, args, Qundef);
if (NIL_P(ary)) {
return dst;
@@ -801,6 +800,8 @@ tk_hash_kv(argc, argv, self)
}
rb_raise(rb_eArgError, "Hash is expected for 1st argument");
}
+
+ UNREACHABLE;
}
static VALUE
@@ -1079,7 +1080,7 @@ tkstr_to_str(value)
VALUE value;
{
char * ptr;
- int len;
+ long len;
ptr = RSTRING_PTR(value);
len = RSTRING_LEN(value);
@@ -1133,8 +1134,8 @@ tcl2rb_num_or_nil(self, value)
#define CBSUBST_TBL_MAX (256)
struct cbsubst_info {
- int full_subst_length;
- int keylen[CBSUBST_TBL_MAX];
+ long full_subst_length;
+ long keylen[CBSUBST_TBL_MAX];
char *key[CBSUBST_TBL_MAX];
char type[CBSUBST_TBL_MAX];
ID ivar[CBSUBST_TBL_MAX];
@@ -1300,7 +1301,8 @@ cbsubst_sym_to_subst(self, sym)
struct cbsubst_info *inf;
const char *str;
char *buf, *ptr;
- int idx, len;
+ int idx;
+ long len;
ID id;
volatile VALUE ret;
@@ -1354,7 +1356,8 @@ cbsubst_get_subst_arg(argc, argv, self)
struct cbsubst_info *inf;
const char *str;
char *buf, *ptr;
- int i, idx, len;
+ int i, idx;
+ long len;
ID id;
volatile VALUE arg_sym, ret;
@@ -1422,7 +1425,8 @@ cbsubst_get_subst_key(self, str)
volatile VALUE list;
volatile VALUE ret;
VALUE keyval;
- int i, len, keylen, idx;
+ long i, len, keylen;
+ int idx;
char *buf, *ptr, *key;
list = rb_funcall(cTclTkLib, ID_split_tklist, 1, str);
@@ -1473,7 +1477,8 @@ cbsubst_get_all_subst_keys(self)
struct cbsubst_info *inf;
char *buf, *ptr;
char *keys_buf, *keys_ptr;
- int idx, len;
+ int idx;
+ long len;
volatile VALUE ret;
Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO),
@@ -1525,7 +1530,7 @@ cbsubst_table_setup(argc, argv, self)
VALUE inf;
ID id;
struct cbsubst_info *subst_inf;
- int idx, len;
+ long idx, len;
unsigned char chr;
/* accept (key_inf, proc_inf) or (key_inf, longkey_inf, procinf) */
@@ -1646,10 +1651,10 @@ cbsubst_scan_args(self, arg_key, val_ary)
VALUE val_ary;
{
struct cbsubst_info *inf;
- int idx;
+ long idx;
unsigned char *keyptr = (unsigned char*)RSTRING_PTR(arg_key);
- int keylen = RSTRING_LEN(arg_key);
- int vallen = RARRAY_LEN(val_ary);
+ long keylen = RSTRING_LEN(arg_key);
+ long vallen = RARRAY_LEN(val_ary);
unsigned char type_chr;
volatile VALUE dst = rb_ary_new2(vallen);
volatile VALUE proc;
diff --git a/ext/zlib/extconf.rb b/ext/zlib/extconf.rb
index 499f55a046..b4348ceca7 100644
--- a/ext/zlib/extconf.rb
+++ b/ext/zlib/extconf.rb
@@ -10,12 +10,12 @@ require 'rbconfig'
dir_config 'zlib'
-if %w'z libz zlib1 zlib zdll'.find {|z| have_library(z, 'deflateReset')} and
+if %w'z libz zlib1 zlib zdll zlibwapi'.find {|z| have_library(z, 'deflateReset')} and
have_header('zlib.h') then
defines = []
- message 'checking for kind of operating system... '
+ Logging::message 'checking for kind of operating system... '
os_code = with_config('os-code') ||
case RUBY_PLATFORM.split('-',2)[1]
when 'amigaos' then
@@ -48,16 +48,16 @@ if %w'z libz zlib1 zlib zdll'.find {|z| have_library(z, 'deflateReset')} and
'OS_UNKNOWN' => 'Unknown',
}
unless OS_NAMES.key? os_code then
- puts "invalid OS_CODE `#{os_code}'"
- exit
+ raise "invalid OS_CODE `#{os_code}'"
end
- message "#{OS_NAMES[os_code]}\n"
+ Logging::message "#{OS_NAMES[os_code]}\n"
defines << "OS_CODE=#{os_code}"
$defs.concat(defines.collect{|d|' -D'+d})
have_func('crc32_combine', 'zlib.h')
have_func('adler32_combine', 'zlib.h')
+ have_type('z_crc_t', 'zlib.h')
create_makefile('zlib')
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index b5a740df96..6b6299c0d0 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -10,6 +10,7 @@
#include <zlib.h>
#include <time.h>
#include <ruby/io.h>
+#include <ruby/thread.h>
#ifdef HAVE_VALGRIND_MEMCHECK_H
# include <valgrind/memcheck.h>
@@ -20,8 +21,8 @@
# define VALGRIND_MAKE_MEM_UNDEFINED(p, n) VALGRIND_MAKE_WRITABLE((p), (n))
# endif
#else
-# define VALGRIND_MAKE_MEM_DEFINED(p, n) /* empty */
-# define VALGRIND_MAKE_MEM_UNDEFINED(p, n) /* empty */
+# define VALGRIND_MAKE_MEM_DEFINED(p, n) 0
+# define VALGRIND_MAKE_MEM_UNDEFINED(p, n) 0
#endif
#define RUBY_ZLIB_VERSION "0.6.0"
@@ -56,6 +57,8 @@ max_uint(long n)
#define sizeof(x) ((int)sizeof(x))
+static ID id_dictionaries;
+
/*--------- Prototypes --------*/
static NORETURN(void raise_zlib_error(int, const char*));
@@ -70,6 +73,7 @@ static void finalizer_warn(const char*);
struct zstream;
struct zstream_funcs;
+struct zstream_run_args;
static void zstream_init(struct zstream*, const struct zstream_funcs*);
static void zstream_expand_buffer(struct zstream*);
static void zstream_expand_buffer_into(struct zstream*, unsigned long);
@@ -222,9 +226,50 @@ static VALUE rb_gzreader_readlines(int, VALUE*, VALUE);
/*
* Document-module: Zlib
*
- * == Overview
+ * This module provides access to the {zlib library}[http://zlib.net]. Zlib is
+ * designed to be a portable, free, general-purpose, legally unencumbered --
+ * that is, not covered by any patents -- lossless data-compression library
+ * for use on virtually any computer hardware and operating system.
+ *
+ * The zlib compression library provides in-memory compression and
+ * decompression functions, including integrity checks of the uncompressed
+ * data.
+ *
+ * The zlib compressed data format is described in RFC 1950, which is a
+ * wrapper around a deflate stream which is described in RFC 1951.
+ *
+ * The library also supports reading and writing files in gzip (.gz) format
+ * with an interface similar to that of IO. The gzip format is described in
+ * RFC 1952 which is also a wrapper around a deflate stream.
+ *
+ * The zlib format was designed to be compact and fast for use in memory and on
+ * communications channels. The gzip format was designed for single-file
+ * compression on file systems, has a larger header than zlib to maintain
+ * directory information, and uses a different, slower check method than zlib.
+ *
+ * See your system's zlib.h for further information about zlib
+ *
+ * == Sample usage
*
- * Access to the zlib library.
+ * Using the wrapper to compress strings with default parameters is quite
+ * simple:
+ *
+ * require "zlib"
+ *
+ * data_to_compress = File.read("don_quixote.txt")
+ *
+ * puts "Input size: #{data_to_compress.size}"
+ * #=> Input size: 2347740
+ *
+ * data_compressed = Zlib::Deflate.deflate(data_to_compress)
+ *
+ * puts "Compressed size: #{data_compressed.size}"
+ * #=> Compressed size: 887238
+ *
+ * uncompressed_data = Zlib::Inflate.inflate(data_compressed)
+ *
+ * puts "Uncompressed data is: #{uncompressed_data}"
+ * #=> Uncompressed data is: The Project Gutenberg EBook of Don Quixote...
*
* == Class tree
*
@@ -249,8 +294,6 @@ static VALUE rb_gzreader_readlines(int, VALUE*, VALUE);
* - Zlib::GzipFile::CRCError
* - Zlib::GzipFile::NoFooter
*
- * see also zlib.h
- *
*/
void Init_zlib(void);
@@ -464,7 +507,11 @@ rb_zlib_crc32_combine(VALUE klass, VALUE crc1, VALUE crc2, VALUE len2)
static VALUE
rb_zlib_crc_table(VALUE obj)
{
- const unsigned long *crctbl;
+#if !defined(HAVE_TYPE_Z_CRC_T)
+ /* z_crc_t is defined since zlib-1.2.7. */
+ typedef unsigned long z_crc_t;
+#endif
+ const z_crc_t *crctbl;
VALUE dst;
int i;
@@ -498,16 +545,22 @@ struct zstream {
#define ZSTREAM_FLAG_IN_STREAM 0x2
#define ZSTREAM_FLAG_FINISHED 0x4
#define ZSTREAM_FLAG_CLOSING 0x8
-#define ZSTREAM_FLAG_UNUSED 0x10
+#define ZSTREAM_FLAG_GZFILE 0x10 /* disallows yield from expand_buffer for
+ gzip*/
+#define ZSTREAM_FLAG_UNUSED 0x20
#define ZSTREAM_READY(z) ((z)->flags |= ZSTREAM_FLAG_READY)
#define ZSTREAM_IS_READY(z) ((z)->flags & ZSTREAM_FLAG_READY)
#define ZSTREAM_IS_FINISHED(z) ((z)->flags & ZSTREAM_FLAG_FINISHED)
#define ZSTREAM_IS_CLOSING(z) ((z)->flags & ZSTREAM_FLAG_CLOSING)
+#define ZSTREAM_IS_GZFILE(z) ((z)->flags & ZSTREAM_FLAG_GZFILE)
+
+#define ZSTREAM_EXPAND_BUFFER_OK 0
/* I think that more better value should be found,
but I gave up finding it. B) */
#define ZSTREAM_INITIAL_BUFSIZE 1024
+/* Allow a quick return when the thread is interrupted */
#define ZSTREAM_AVAIL_OUT_STEP_MAX 16384
#define ZSTREAM_AVAIL_OUT_STEP_MIN 2048
@@ -519,6 +572,13 @@ static const struct zstream_funcs inflate_funcs = {
inflateReset, inflateEnd, inflate,
};
+struct zstream_run_args {
+ struct zstream * z;
+ int flush; /* stream flush value for inflate() or deflate() */
+ int interrupt; /* stop processing the stream and return to ruby */
+ int jump_state; /* for buffer expansion block break or exception */
+ int stream_output; /* for streaming zlib processing */
+};
static voidpf
zlib_mem_alloc(voidpf opaque, uInt items, uInt size)
@@ -528,7 +588,7 @@ zlib_mem_alloc(voidpf opaque, uInt items, uInt size)
deflate is performing a conditional jump that depends on an
uninitialized value. Isn't that a bug?
http://www.zlib.net/zlib_faq.html#faq36 */
- VALGRIND_MAKE_MEM_DEFINED(p, items * size);
+ (void)VALGRIND_MAKE_MEM_DEFINED(p, items * size);
return p;
}
@@ -562,33 +622,50 @@ zstream_init(struct zstream *z, const struct zstream_funcs *func)
static void
zstream_expand_buffer(struct zstream *z)
{
- long inc;
-
if (NIL_P(z->buf)) {
- /* I uses rb_str_new here not rb_str_buf_new because
- rb_str_buf_new makes a zero-length string. */
- z->buf = rb_str_new(0, ZSTREAM_INITIAL_BUFSIZE);
- z->buf_filled = 0;
- z->stream.next_out = (Bytef*)RSTRING_PTR(z->buf);
- z->stream.avail_out = ZSTREAM_INITIAL_BUFSIZE;
- RBASIC(z->buf)->klass = 0;
+ zstream_expand_buffer_into(z, ZSTREAM_INITIAL_BUFSIZE);
return;
}
- if (RSTRING_LEN(z->buf) - z->buf_filled >= ZSTREAM_AVAIL_OUT_STEP_MAX) {
- /* to keep other threads from freezing */
- z->stream.avail_out = ZSTREAM_AVAIL_OUT_STEP_MAX;
+ if (!ZSTREAM_IS_GZFILE(z) && rb_block_given_p()) {
+ if (z->buf_filled >= ZSTREAM_AVAIL_OUT_STEP_MAX) {
+ int state = 0;
+ VALUE self = (VALUE)z->stream.opaque;
+
+ rb_str_resize(z->buf, z->buf_filled);
+ RBASIC(z->buf)->klass = rb_cString;
+ OBJ_INFECT(z->buf, self);
+
+ rb_protect(rb_yield, z->buf, &state);
+
+ z->buf = Qnil;
+ zstream_expand_buffer_into(z, ZSTREAM_AVAIL_OUT_STEP_MAX);
+
+ if (state)
+ rb_jump_tag(state);
+
+ return;
+ }
+ else {
+ zstream_expand_buffer_into(z,
+ ZSTREAM_AVAIL_OUT_STEP_MAX - z->buf_filled);
+ }
}
else {
- inc = z->buf_filled / 2;
- if (inc < ZSTREAM_AVAIL_OUT_STEP_MIN) {
- inc = ZSTREAM_AVAIL_OUT_STEP_MIN;
+ if (RSTRING_LEN(z->buf) - z->buf_filled >= ZSTREAM_AVAIL_OUT_STEP_MAX) {
+ z->stream.avail_out = ZSTREAM_AVAIL_OUT_STEP_MAX;
}
- rb_str_resize(z->buf, z->buf_filled + inc);
- z->stream.avail_out = (inc < ZSTREAM_AVAIL_OUT_STEP_MAX) ?
- (int)inc : ZSTREAM_AVAIL_OUT_STEP_MAX;
+ else {
+ long inc = z->buf_filled / 2;
+ if (inc < ZSTREAM_AVAIL_OUT_STEP_MIN) {
+ inc = ZSTREAM_AVAIL_OUT_STEP_MIN;
+ }
+ rb_str_resize(z->buf, z->buf_filled + inc);
+ z->stream.avail_out = (inc < ZSTREAM_AVAIL_OUT_STEP_MAX) ?
+ (int)inc : ZSTREAM_AVAIL_OUT_STEP_MAX;
+ }
+ z->stream.next_out = (Bytef*)RSTRING_PTR(z->buf) + z->buf_filled;
}
- z->stream.next_out = (Bytef*)RSTRING_PTR(z->buf) + z->buf_filled;
}
static void
@@ -610,6 +687,50 @@ zstream_expand_buffer_into(struct zstream *z, unsigned long size)
}
}
+static void *
+zstream_expand_buffer_protect(void *ptr)
+{
+ struct zstream *z = (struct zstream *)ptr;
+ int state = 0;
+
+ rb_protect((VALUE (*)(VALUE))zstream_expand_buffer, (VALUE)z, &state);
+
+ return (void *)(VALUE)state;
+}
+
+static int
+zstream_expand_buffer_without_gvl(struct zstream *z)
+{
+ char * new_str;
+ long inc, len;
+
+ if (RSTRING_LEN(z->buf) - z->buf_filled >= ZSTREAM_AVAIL_OUT_STEP_MAX) {
+ z->stream.avail_out = ZSTREAM_AVAIL_OUT_STEP_MAX;
+ }
+ else {
+ inc = z->buf_filled / 2;
+ if (inc < ZSTREAM_AVAIL_OUT_STEP_MIN) {
+ inc = ZSTREAM_AVAIL_OUT_STEP_MIN;
+ }
+
+ len = z->buf_filled + inc;
+
+ new_str = ruby_xrealloc(RSTRING(z->buf)->as.heap.ptr, len + 1);
+
+ /* from rb_str_resize */
+ RSTRING(z->buf)->as.heap.ptr = new_str;
+ RSTRING(z->buf)->as.heap.ptr[len] = '\0'; /* sentinel */
+ RSTRING(z->buf)->as.heap.len =
+ RSTRING(z->buf)->as.heap.aux.capa = len;
+
+ z->stream.avail_out = (inc < ZSTREAM_AVAIL_OUT_STEP_MAX) ?
+ (int)inc : ZSTREAM_AVAIL_OUT_STEP_MAX;
+ }
+ z->stream.next_out = (Bytef*)RSTRING_PTR(z->buf) + z->buf_filled;
+
+ return ZSTREAM_EXPAND_BUFFER_OK;
+}
+
static void
zstream_append_buffer(struct zstream *z, const Bytef *src, long len)
{
@@ -646,7 +767,14 @@ zstream_append_buffer(struct zstream *z, const Bytef *src, long len)
static VALUE
zstream_detach_buffer(struct zstream *z)
{
- VALUE dst;
+ VALUE dst, self = (VALUE)z->stream.opaque;
+
+ if (!ZSTREAM_IS_FINISHED(z) && !ZSTREAM_IS_GZFILE(z) &&
+ rb_block_given_p()) {
+ /* prevent tiny yields mid-stream, save for next
+ * zstream_expand_buffer() or stream end */
+ return Qnil;
+ }
if (NIL_P(z->buf)) {
dst = rb_str_new(0, 0);
@@ -657,10 +785,18 @@ zstream_detach_buffer(struct zstream *z)
RBASIC(dst)->klass = rb_cString;
}
+ OBJ_INFECT(dst, self);
+
z->buf = Qnil;
z->buf_filled = 0;
z->stream.next_out = 0;
z->stream.avail_out = 0;
+
+ if (!ZSTREAM_IS_GZFILE(z) && rb_block_given_p()) {
+ rb_yield(dst);
+ dst = Qnil;
+ }
+
return dst;
}
@@ -826,13 +962,83 @@ zstream_end(struct zstream *z)
return Qnil;
}
+static void *
+zstream_run_func(void *ptr)
+{
+ struct zstream_run_args *args = (struct zstream_run_args *)ptr;
+ int err, state, flush = args->flush;
+ struct zstream *z = args->z;
+ uInt n;
+
+ err = Z_OK;
+ while (!args->interrupt) {
+ n = z->stream.avail_out;
+ err = z->func->run(&z->stream, flush);
+ z->buf_filled += n - z->stream.avail_out;
+
+ if (err == Z_STREAM_END) {
+ z->flags &= ~ZSTREAM_FLAG_IN_STREAM;
+ z->flags |= ZSTREAM_FLAG_FINISHED;
+ break;
+ }
+
+ if (err != Z_OK && err != Z_BUF_ERROR)
+ break;
+
+ if (z->stream.avail_out > 0) {
+ z->flags |= ZSTREAM_FLAG_IN_STREAM;
+ break;
+ }
+
+ if (z->stream.avail_in == 0 && z->func == &inflate_funcs) {
+ /* break here because inflate() return Z_BUF_ERROR when avail_in == 0. */
+ /* but deflate() could be called with avail_in == 0 (there's hidden buffer
+ in zstream->state) */
+ z->flags |= ZSTREAM_FLAG_IN_STREAM;
+ break;
+ }
+
+ if (args->stream_output) {
+ state = (int)(VALUE)rb_thread_call_with_gvl(zstream_expand_buffer_protect,
+ (void *)z);
+ } else {
+ state = zstream_expand_buffer_without_gvl(z);
+ }
+
+ if (state) {
+ err = Z_OK; /* buffer expanded but stream processing was stopped */
+ args->jump_state = state;
+ break;
+ }
+ }
+
+ return (void *)(VALUE)err;
+}
+
+/*
+ * There is no safe way to interrupt z->run->func().
+ */
+static void
+zstream_unblock_func(void *ptr)
+{
+ struct zstream_run_args *args = (struct zstream_run_args *)ptr;
+
+ args->interrupt = 1;
+}
+
static void
zstream_run(struct zstream *z, Bytef *src, long len, int flush)
{
- uInt n;
+ struct zstream_run_args args;
int err;
volatile VALUE guard = Qnil;
+ args.z = z;
+ args.flush = flush;
+ args.interrupt = 0;
+ args.jump_state = 0;
+ args.stream_output = !ZSTREAM_IS_GZFILE(z) && rb_block_given_p();
+
if (NIL_P(z->input) && len == 0) {
z->stream.next_in = (Bytef*)"";
z->stream.avail_in = 0;
@@ -851,50 +1057,46 @@ zstream_run(struct zstream *z, Bytef *src, long len, int flush)
zstream_expand_buffer(z);
}
- for (;;) {
- /* VC allocates err and guard to same address. accessing err and guard
- in same scope prevents it. */
- RB_GC_GUARD(guard);
- n = z->stream.avail_out;
- err = z->func->run(&z->stream, flush);
- z->buf_filled += n - z->stream.avail_out;
- rb_thread_schedule();
+loop:
+ err = (int)(VALUE)rb_thread_call_without_gvl(zstream_run_func, (void *)&args,
+ zstream_unblock_func, (void *)&args);
- if (err == Z_STREAM_END) {
- z->flags &= ~ZSTREAM_FLAG_IN_STREAM;
- z->flags |= ZSTREAM_FLAG_FINISHED;
- break;
+ if (flush != Z_FINISH && err == Z_BUF_ERROR
+ && z->stream.avail_out > 0) {
+ z->flags |= ZSTREAM_FLAG_IN_STREAM;
+ }
+
+ zstream_reset_input(z);
+
+ if (err != Z_OK && err != Z_STREAM_END) {
+ if (z->stream.avail_in > 0) {
+ zstream_append_input(z, z->stream.next_in, z->stream.avail_in);
}
- if (err != Z_OK) {
- if (flush != Z_FINISH && err == Z_BUF_ERROR
- && z->stream.avail_out > 0) {
- z->flags |= ZSTREAM_FLAG_IN_STREAM;
- break;
+ if (err == Z_NEED_DICT) {
+ VALUE self = (VALUE)z->stream.opaque;
+ VALUE dicts = rb_ivar_get(self, id_dictionaries);
+ VALUE dict = rb_hash_aref(dicts, rb_uint2inum(z->stream.adler));
+ if (!NIL_P(dict)) {
+ rb_inflate_set_dictionary(self, dict);
+ goto loop;
}
- zstream_reset_input(z);
- if (z->stream.avail_in > 0) {
- zstream_append_input(z, z->stream.next_in, z->stream.avail_in);
- }
- raise_zlib_error(err, z->stream.msg);
- }
- if (z->stream.avail_out > 0) {
- z->flags |= ZSTREAM_FLAG_IN_STREAM;
- break;
}
- zstream_expand_buffer(z);
+ raise_zlib_error(err, z->stream.msg);
}
- zstream_reset_input(z);
if (z->stream.avail_in > 0) {
zstream_append_input(z, z->stream.next_in, z->stream.avail_in);
- guard = Qnil; /* prevent tail call to make guard effective */
+ RB_GC_GUARD(guard) = Qnil; /* prevent tail call to make guard effective */
}
+
+ if (args.jump_state)
+ rb_jump_tag(args.jump_state);
}
static VALUE
zstream_sync(struct zstream *z, Bytef *src, long len)
{
- VALUE rest;
+ /* VALUE rest; */
int err;
if (!NIL_P(z->input)) {
@@ -909,7 +1111,7 @@ zstream_sync(struct zstream *z, Bytef *src, long len)
}
zstream_reset_input(z);
if (err != Z_DATA_ERROR) {
- rest = rb_str_new((char*)z->stream.next_in, z->stream.avail_in);
+ /* rest = rb_str_new((char*)z->stream.next_in, z->stream.avail_in); */
raise_zlib_error(err, z->stream.msg);
}
}
@@ -924,7 +1126,7 @@ zstream_sync(struct zstream *z, Bytef *src, long len)
return Qtrue;
}
if (err != Z_DATA_ERROR) {
- rest = rb_str_new((char*)z->stream.next_in, z->stream.avail_in);
+ /* rest = rb_str_new((char*)z->stream.next_in, z->stream.avail_in); */
raise_zlib_error(err, z->stream.msg);
}
return Qfalse;
@@ -965,6 +1167,7 @@ zstream_new(VALUE klass, const struct zstream_funcs *funcs)
obj = Data_Make_Struct(klass, struct zstream,
zstream_mark, zstream_free, z);
zstream_init(z, funcs);
+ z->stream.opaque = (voidpf)obj;
return obj;
}
@@ -1070,24 +1273,32 @@ rb_zstream_reset(VALUE obj)
}
/*
- * Finishes the stream and flushes output buffer. See Zlib::Deflate#finish and
- * Zlib::Inflate#finish for details of this behavior.
+ * call-seq:
+ * finish -> String
+ * finish { |chunk| ... } -> nil
+ *
+ * Finishes the stream and flushes output buffer. If a block is given each
+ * chunk is yielded to the block until the input buffer has been flushed to
+ * the output buffer.
*/
static VALUE
rb_zstream_finish(VALUE obj)
{
struct zstream *z = get_zstream(obj);
- VALUE dst;
zstream_run(z, (Bytef*)"", 0, Z_FINISH);
- dst = zstream_detach_buffer(z);
- OBJ_INFECT(dst, obj);
- return dst;
+ return zstream_detach_buffer(z);
}
/*
- * Flushes input buffer and returns all data in that buffer.
+ * call-seq:
+ * flush_next_out -> String
+ * flush_next_out { |chunk| ... } -> nil
+ *
+ * Flushes output buffer and returns all data in that buffer. If a block is
+ * given each chunk is yielded to the block until the current output buffer
+ * has been flushed.
*/
static VALUE
rb_zstream_flush_next_in(VALUE obj)
@@ -1108,12 +1319,10 @@ static VALUE
rb_zstream_flush_next_out(VALUE obj)
{
struct zstream *z;
- VALUE dst;
Data_Get_Struct(obj, struct zstream, z);
- dst = zstream_detach_buffer(z);
- OBJ_INFECT(dst, obj);
- return dst;
+
+ return zstream_detach_buffer(z);
}
/*
@@ -1243,60 +1452,73 @@ rb_deflate_s_allocate(VALUE klass)
/*
* Document-method: Zlib::Deflate.new
*
- * call-seq: Zlib::Deflate.new(level=nil, windowBits=nil, memlevel=nil, strategy=nil)
+ * call-seq:
+ * Zlib::Deflate.new(level=DEFAULT_COMPRESSION, window_bits=MAX_WBITS, mem_level=DEF_MEM_LEVEL, strategy=DEFAULT_STRATEGY)
*
- * == Arguments
+ * Creates a new deflate stream for compression. If a given argument is nil,
+ * the default value of that argument is used.
*
- * +level+::
- * An Integer compression level between
- * BEST_SPEED and BEST_COMPRESSION
- * +windowBits+::
- * An Integer for the windowBits size. Should be
- * in the range 8..15, larger values of this parameter
- * result in better at the expense of memory usage.
- * +memlevel+::
- * Specifies how much memory should be allocated for
- * the internal compression state.
- * Between DEF_MEM_LEVEL and MAX_MEM_LEVEL
- * +strategy+::
- * A parameter to tune the compression algorithm. Use the
- * DEFAULT_STRATEGY for normal data, FILTERED for data produced by a
- * filter (or predictor), HUFFMAN_ONLY to force Huffman encoding only (no
- * string match).
+ * The +level+ sets the compression level for the deflate stream between 0 (no
+ * compression) and 9 (best compression. The following constants have been
+ * defined to make code more readable:
*
- * == Description
+ * * Zlib::NO_COMPRESSION = 0
+ * * Zlib::BEST_SPEED = 1
+ * * Zlib::DEFAULT_COMPRESSION = 6
+ * * Zlib::BEST_COMPRESSION = 9
*
- * Creates a new deflate stream for compression. See zlib.h for details of
- * each argument. If an argument is nil, the default value of that argument is
- * used.
+ * The +window_bits+ sets the size of the history buffer and should be between
+ * 8 and 15. Larger values of this parameter result in better compression at
+ * the expense of memory usage.
*
+ * The +mem_level+ specifies how much memory should be allocated for the
+ * internal compression state. 1 uses minimum memory but is slow and reduces
+ * compression ratio while 9 uses maximum memory for optimal speed. The
+ * default value is 8. Two constants are defined:
*
- * == examples
+ * * Zlib::DEF_MEM_LEVEL
+ * * Zlib::MAX_MEM_LEVEL
*
- * === basic
+ * The +strategy+ sets the deflate compression strategy. The following
+ * strategies are available:
*
- * f = File.new("compressed.file","w+")
- * #=> #<File:compressed.file>
- * f << Zlib::Deflate.new().deflate(File.read("big.file"))
- * #=> #<File:compressed.file>
- * f.close
- * #=> nil
+ * Zlib::DEFAULT_STRATEGY:: For normal data
+ * Zlib::FILTERED:: For data produced by a filter or predictor
+ * Zlib::FIXED:: Prevents dynamic Huffman codes
+ * Zlib::HUFFMAN_ONLY:: Prevents string matching
+ * Zlib::RLE:: Designed for better compression of PNG image data
*
- * === a little more robust
+ * See the constants for further description.
*
- * compressed_file = File.open("compressed.file", "w+")
- * #=> #<File:compressed.file>
- * zd = Zlib::Deflate.new(Zlib::BEST_COMPRESSION, 15, Zlib::MAX_MEM_LEVEL, Zlib::HUFFMAN_ONLY)
- * #=> #<Zlib::Deflate:0x000000008610a0>
- * compressed_file << zd.deflate(File.read("big.file"))
- * #=> "\xD4z\xC6\xDE\b\xA1K\x1Ej\x8A ..."
- * compressed_file.close
- * #=> nil
- * zd.close
- * #=> nil
+ * == Examples
*
- * (while this example will work, for best optimization the flags need to be reviewed for your specific function)
+ * === Basic
*
+ * open "compressed.file", "w+" do |io|
+ * io << Zlib::Deflate.new.deflate(File.read("big.file"))
+ * end
+ *
+ * === Custom compression
+ *
+ * open "compressed.file", "w+" do |compressed_io|
+ * deflate = Zlib::Deflate.new(Zlib::BEST_COMPRESSION,
+ * Zlib::MAX_WBITS,
+ * Zlib::MAX_MEM_LEVEL,
+ * Zlib::HUFFMAN_ONLY)
+ *
+ * begin
+ * open "big.file" do |big_io|
+ * until big_io.eof? do
+ * compressed_io << zd.deflate(big_io.read(16384))
+ * end
+ * end
+ * ensure
+ * deflate.close
+ * end
+ * end
+ *
+ * While this example will work, for best optimization review the flags for
+ * your specific time, memory usage and output space requirements.
*/
static VALUE
rb_deflate_initialize(int argc, VALUE *argv, VALUE obj)
@@ -1358,19 +1580,19 @@ deflate_run(VALUE args)
/*
* Document-method: Zlib::Deflate.deflate
*
- * call-seq: Zlib.deflate(string[, level])
- * Zlib::Deflate.deflate(string[, level])
+ * call-seq:
+ * Zlib.deflate(string[, level])
+ * Zlib::Deflate.deflate(string[, level])
*
* Compresses the given +string+. Valid values of level are
- * <tt>NO_COMPRESSION</tt>, <tt>BEST_SPEED</tt>,
- * <tt>BEST_COMPRESSION</tt>, <tt>DEFAULT_COMPRESSION</tt>, and an
- * integer from 0 to 9 (the default is 6).
+ * Zlib::NO_COMPRESSION, Zlib::BEST_SPEED, Zlib::BEST_COMPRESSION,
+ * Zlib::DEFAULT_COMPRESSION, or an integer from 0 to 9 (the default is 6).
*
* This method is almost equivalent to the following code:
*
* def deflate(string, level)
* z = Zlib::Deflate.new(level)
- * dst = z.deflate(string, Zlib::NO_FLUSH)
+ * dst = z.deflate(string, Zlib::FINISH)
* z.close
* dst
* end
@@ -1418,55 +1640,46 @@ do_deflate(struct zstream *z, VALUE src, int flush)
}
/*
- * Document-method: Zlib.deflate
- *
- * call-seq: deflate(string[, flush])
- *
- * == Arguments
- *
- * +string+::
- * String
- *
- * +flush+::
- * Integer representing a flush code. Either NO_FLUSH,
- * SYNC_FLUSH, FULL_FLUSH, or FINISH. See zlib.h for details.
- * Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
- * decide how much data to accumulate before producing output, in order to
- * maximize compression.
+ * Document-method: Zlib::Deflate#deflate
*
- * == Description
+ * call-seq:
+ * z.deflate(string, flush = Zlib::NO_FLUSH) -> String
+ * z.deflate(string, flush = Zlib::NO_FLUSH) { |chunk| ... } -> nil
*
* Inputs +string+ into the deflate stream and returns the output from the
* stream. On calling this method, both the input and the output buffers of
- * the stream are flushed.
- *
- * If +string+ is nil, this method finishes the
+ * the stream are flushed. If +string+ is nil, this method finishes the
* stream, just like Zlib::ZStream#finish.
*
- * == Usage
+ * If a block is given consecutive deflated chunks from the +string+ are
+ * yielded to the block and +nil+ is returned.
+ *
+ * The +flush+ parameter specifies the flush mode. The following constants
+ * may be used:
*
- * comp = Zlib.deflate(File.read("big.file"))
- * or
- * comp = Zlib.deflate(File.read("big.file"), Zlib::FULL_FLUSH)
+ * Zlib::NO_FLUSH:: The default
+ * Zlib::SYNC_FLUSH:: Flushes the output to a byte boundary
+ * Zlib::FULL_FLUSH:: SYNC_FLUSH + resets the compression state
+ * Zlib::FINISH:: Pending input is processed, pending output is flushed.
+ *
+ * See the constants for further description.
*
*/
static VALUE
rb_deflate_deflate(int argc, VALUE *argv, VALUE obj)
{
struct zstream *z = get_zstream(obj);
- VALUE src, flush, dst;
+ VALUE src, flush;
rb_scan_args(argc, argv, "11", &src, &flush);
OBJ_INFECT(obj, src);
do_deflate(z, src, ARG_FLUSH(flush));
- dst = zstream_detach_buffer(z);
- OBJ_INFECT(dst, obj);
- return dst;
+ return zstream_detach_buffer(z);
}
/*
- * Document-method: Zlib::Deflate.<<
+ * Document-method: Zlib::Deflate#<<
*
* call-seq: << string
*
@@ -1485,20 +1698,23 @@ rb_deflate_addstr(VALUE obj, VALUE src)
/*
* Document-method: Zlib::Deflate#flush
*
- * call-seq: flush(flush)
+ * call-seq:
+ * flush(flush = Zlib::SYNC_FLUSH) -> String
+ * flush(flush = Zlib::SYNC_FLUSH) { |chunk| ... } -> nil
*
- * This method is equivalent to <tt>deflate('', flush)</tt>. If flush is omitted,
- * <tt>SYNC_FLUSH</tt> is used as flush. This method is just provided
- * to improve the readability of your Ruby program.
- *
- * Please visit your zlib.h for a deeper detail on NO_FLUSH, SYNC_FLUSH, FULL_FLUSH, and FINISH
+ * This method is equivalent to <tt>deflate('', flush)</tt>. This method is
+ * just provided to improve the readability of your Ruby program. If a block
+ * is given chunks of deflate output are yielded to the block until the buffer
+ * is flushed.
*
+ * See Zlib::Deflate#deflate for detail on the +flush+ constants NO_FLUSH,
+ * SYNC_FLUSH, FULL_FLUSH and FINISH.
*/
static VALUE
rb_deflate_flush(int argc, VALUE *argv, VALUE obj)
{
struct zstream *z = get_zstream(obj);
- VALUE v_flush, dst;
+ VALUE v_flush;
int flush;
rb_scan_args(argc, argv, "01", &v_flush);
@@ -1506,10 +1722,8 @@ rb_deflate_flush(int argc, VALUE *argv, VALUE obj)
if (flush != Z_NO_FLUSH) { /* prevent Z_BUF_ERROR */
zstream_run(z, (Bytef*)"", 0, flush);
}
- dst = zstream_detach_buffer(z);
- OBJ_INFECT(dst, obj);
- return dst;
+ return zstream_detach_buffer(z);
}
/*
@@ -1517,18 +1731,11 @@ rb_deflate_flush(int argc, VALUE *argv, VALUE obj)
*
* call-seq: params(level, strategy)
*
- * Changes the parameters of the deflate stream. See zlib.h for details. The
- * output from the stream by changing the params is preserved in output
- * buffer.
+ * Changes the parameters of the deflate stream to allow changes between
+ * different types of data that require different types of compression. Any
+ * unprocessed data is flushed before changing the params.
*
- * +level+::
- * An Integer compression level between
- * BEST_SPEED and BEST_COMPRESSION
- * +strategy+::
- * A parameter to tune the compression algorithm. Use the
- * DEFAULT_STRATEGY for normal data, FILTERED for data produced by a
- * filter (or predictor), HUFFMAN_ONLY to force Huffman encoding only (no
- * string match).
+ * See Zlib::Deflate.new for a description of +level+ and +strategy+.
*
*/
static VALUE
@@ -1602,52 +1809,57 @@ rb_deflate_set_dictionary(VALUE obj, VALUE dic)
* dup) itself.
*/
-
-
static VALUE
rb_inflate_s_allocate(VALUE klass)
{
- return zstream_inflate_new(klass);
+ VALUE inflate = zstream_inflate_new(klass);
+ rb_ivar_set(inflate, id_dictionaries, rb_hash_new());
+ return inflate;
}
/*
* Document-method: Zlib::Inflate.new
*
- * call-seq: Zlib::Inflate.new(window_bits)
- *
- * == Arguments
+ * call-seq:
+ * Zlib::Inflate.new(window_bits = Zlib::MAX_WBITS)
*
- * +windowBits+::
- * An Integer for the windowBits size. Should be
- * in the range 8..15, larger values of this parameter
- * result in better at the expense of memory usage.
+ * Creates a new inflate stream for decompression. +window_bits+ sets the
+ * size of the history buffer and can have the following values:
*
- * == Description
+ * 0::
+ * Have inflate use the window size from the zlib header of the compressed
+ * stream.
*
- * Creates a new inflate stream for decompression. See zlib.h for details
- * of the argument. If +window_bits+ is +nil+, the default value is used.
+ * (8..15)
+ * Overrides the window size of the inflate header in the compressed stream.
+ * The window size must be greater than or equal to the window size of the
+ * compressed stream.
*
- * == Example
+ * Greater than 15::
+ * Add 32 to window_bits to enable zlib and gzip decoding with automatic
+ * header detection, or add 16 to decode only the gzip format (a
+ * Zlib::DataError will be raised for a non-gzip stream).
*
- * cf = File.open("compressed.file")
- * ucf = File.open("uncompressed.file", "w+")
- * zi = Zlib::Inflate.new(Zlib::MAX_WBITS)
+ * (-8..-15)::
+ * Enables raw deflate mode which will not generate a check value, and will
+ * not look for any check values for comparison at the end of the stream.
*
- * ucf << zi.inflate(cf.read)
+ * This is for use with other formats that use the deflate compressed data
+ * format such as zip which provide their own check values.
*
- * ucf.close
- * zi.close
- * cf.close
+ * == Example
*
- * or
+ * open "compressed.file" do |compressed_io|
+ * inflate = Zlib::Inflate.new(Zlib::MAX_WBITS + 32)
*
- * File.open("compressed.file") {|cf|
- * zi = Zlib::Inflate.new
- * File.open("uncompressed.file", "w+") {|ucf|
- * ucf << zi.inflate(cf.read)
- * }
- * zi.close
- * }
+ * begin
+ * open "uncompressed.file", "w+" do |uncompressed_io|
+ * uncompressed_io << zi.inflate(compressed_io.read)
+ * }
+ * ensure
+ * zi.close
+ * end
+ * end
*
*/
static VALUE
@@ -1681,9 +1893,11 @@ inflate_run(VALUE args)
}
/*
- * Document-method: Zlib::Inflate.inflate
+ * Document-method: Zlib::inflate
*
- * call-seq: Zlib::Inflate.inflate(string)
+ * call-seq:
+ * Zlib.inflate(string)
+ * Zlib::Inflate.inflate(string)
*
* Decompresses +string+. Raises a Zlib::NeedDict exception if a preset
* dictionary is needed for decompression.
@@ -1732,24 +1946,64 @@ do_inflate(struct zstream *z, VALUE src)
return;
}
StringValue(src);
- if (RSTRING_LEN(src) > 0) { /* prevent Z_BUF_ERROR */
+ if (RSTRING_LEN(src) > 0 || z->stream.avail_in > 0) { /* prevent Z_BUF_ERROR */
zstream_run(z, (Bytef*)RSTRING_PTR(src), RSTRING_LEN(src), Z_SYNC_FLUSH);
}
}
+/* Document-method: Zlib::Inflate#add_dictionary
+ *
+ * call-seq: add_dictionary(string)
+ *
+ * Provide the inflate stream with a dictionary that may be required in the
+ * future. Multiple dictionaries may be provided. The inflate stream will
+ * automatically choose the correct user-provided dictionary based on the
+ * stream's required dictionary.
+ */
+static VALUE
+rb_inflate_add_dictionary(VALUE obj, VALUE dictionary) {
+ VALUE dictionaries = rb_ivar_get(obj, id_dictionaries);
+ VALUE checksum = do_checksum(1, &dictionary, adler32);
+
+ rb_hash_aset(dictionaries, checksum, dictionary);
+
+ return obj;
+}
+
/*
* Document-method: Zlib::Inflate#inflate
*
- * call-seq: inflate(string)
+ * call-seq:
+ * inflate(deflate_string) -> String
+ * inflate(deflate_string) { |chunk| ... } -> nil
*
- * Inputs +string+ into the inflate stream and returns the output from the
- * stream. Calling this method, both the input and the output buffer of the
- * stream are flushed. If string is +nil+, this method finishes the stream,
- * just like Zlib::ZStream#finish.
+ * Inputs +deflate_string+ into the inflate stream and returns the output from
+ * the stream. Calling this method, both the input and the output buffer of
+ * the stream are flushed. If string is +nil+, this method finishes the
+ * stream, just like Zlib::ZStream#finish.
+ *
+ * If a block is given consecutive inflated chunks from the +deflate_string+
+ * are yielded to the block and +nil+ is returned.
*
* Raises a Zlib::NeedDict exception if a preset dictionary is needed to
* decompress. Set the dictionary by Zlib::Inflate#set_dictionary and then
- * call this method again with an empty string. (<i>???</i>)
+ * call this method again with an empty string to flush the stream:
+ *
+ * inflater = Zlib::Inflate.new
+ *
+ * begin
+ * out = inflater.inflate compressed
+ * rescue Zlib::NeedDict
+ * # ensure the dictionary matches the stream's required dictionary
+ * raise unless inflater.adler == Zlib.adler32(dictionary)
+ *
+ * inflater.set_dictionary dictionary
+ * inflater.inflate ''
+ * end
+ *
+ * # ...
+ *
+ * inflater.close
*
* See also Zlib::Inflate.new
*/
@@ -1769,6 +2023,7 @@ rb_inflate_inflate(VALUE obj, VALUE src)
StringValue(src);
zstream_append_buffer2(z, src);
dst = rb_str_new(0, 0);
+ OBJ_INFECT(dst, obj);
}
}
else {
@@ -1779,7 +2034,6 @@ rb_inflate_inflate(VALUE obj, VALUE src)
}
}
- OBJ_INFECT(dst, obj);
return dst;
}
@@ -2003,6 +2257,7 @@ gzfile_new(klass, funcs, endfunc)
obj = Data_Make_Struct(klass, struct gzfile, gzfile_mark, gzfile_free, gz);
zstream_init(&gz->z, funcs);
+ gz->z.flags |= ZSTREAM_FLAG_GZFILE;
gz->io = Qnil;
gz->level = 0;
gz->mtime = 0;
@@ -2306,6 +2561,9 @@ gzfile_read_header(struct gzfile *gz)
zstream_discard_input(&gz->z, 2 + len);
}
if (flags & GZ_FLAG_ORIG_NAME) {
+ if (!gzfile_read_raw_ensure(gz, 1)) {
+ rb_raise(cGzError, "unexpected end of file");
+ }
p = gzfile_read_raw_until_zero(gz, 0);
len = p - RSTRING_PTR(gz->z.input);
gz->orig_name = rb_str_new(RSTRING_PTR(gz->z.input), len);
@@ -2313,6 +2571,9 @@ gzfile_read_header(struct gzfile *gz)
zstream_discard_input(&gz->z, len + 1);
}
if (flags & GZ_FLAG_COMMENT) {
+ if (!gzfile_read_raw_ensure(gz, 1)) {
+ rb_raise(cGzError, "unexpected end of file");
+ }
p = gzfile_read_raw_until_zero(gz, 0);
len = p - RSTRING_PTR(gz->z.input);
gz->comment = rb_str_new(RSTRING_PTR(gz->z.input), len);
@@ -2534,7 +2795,6 @@ gzfile_getc(struct gzfile *gz)
if (gz->ec && rb_enc_dummy_p(gz->enc2)) {
const unsigned char *ss, *sp, *se;
unsigned char *ds, *dp, *de;
- rb_econv_result_t res;
if (!gz->cbuf) {
gz->cbuf = ALLOC_N(char, GZFILE_CBUF_CAPA);
@@ -2543,7 +2803,7 @@ gzfile_getc(struct gzfile *gz)
se = sp + gz->z.buf_filled;
ds = dp = (unsigned char *)gz->cbuf;
de = (unsigned char *)ds + GZFILE_CBUF_CAPA;
- res = rb_econv_convert(gz->ec, &sp, se, &dp, de, ECONV_PARTIAL_INPUT|ECONV_AFTER_OUTPUT);
+ (void)rb_econv_convert(gz->ec, &sp, se, &dp, de, ECONV_PARTIAL_INPUT|ECONV_AFTER_OUTPUT);
rb_econv_check_error(gz->ec);
dst = zstream_shift_buffer(&gz->z, sp - ss);
gzfile_calc_crc(gz, dst);
@@ -2762,14 +3022,17 @@ gzfile_wrap(int argc, VALUE *argv, VALUE klass, int close_io_on_error)
/*
* Document-method: Zlib::GzipFile.wrap
*
- * call-seq: Zlib::GzipFile.wrap(io) { |gz| ... }
+ * call-seq:
+ * Zlib::GzipReader.wrap(io, ...) { |gz| ... }
+ * Zlib::GzipWriter.wrap(io, ...) { |gz| ... }
+ *
+ * Creates a GzipReader or GzipWriter associated with +io+, passing in any
+ * necessary extra options, and executes the block with the newly created
+ * object just like File.open.
*
- * Creates a GzipFile object associated with +io+, and
- * executes the block with the newly created GzipFile object,
- * just like File.open. The GzipFile object will be closed
- * automatically after executing the block. If you want to keep
- * the associated IO object opening, you may call
- * +Zlib::GzipFile#finish+ method in the block.
+ * The GzipFile object will be closed automatically after executing the block.
+ * If you want to keep the associated IO object open, you may call
+ * Zlib::GzipFile#finish method in the block.
*/
static VALUE
rb_gzfile_s_wrap(int argc, VALUE *argv, VALUE klass)
@@ -3187,12 +3450,17 @@ rb_gzwriter_s_open(int argc, VALUE *argv, VALUE klass)
}
/*
- * call-seq: Zlib::GzipWriter.new(io, level, strategy)
+ * call-seq:
+ * Zlib::GzipWriter.new(io, level = nil, strategy = nil, options = {})
*
* Creates a GzipWriter object associated with +io+. +level+ and +strategy+
* should be the same as the arguments of Zlib::Deflate.new. The GzipWriter
- * object writes gzipped data to +io+. At least, +io+ must respond to the
- * +write+ method that behaves same as write method in IO class.
+ * object writes gzipped data to +io+. +io+ must respond to the
+ * +write+ method that behaves the same as IO#write.
+ *
+ * The +options+ hash may be used to set the encoding of the data.
+ * +:external_encoding+, +:internal_encoding+ and +:encoding+ may be set as in
+ * IO::new.
*/
static VALUE
rb_gzwriter_initialize(int argc, VALUE *argv, VALUE obj)
@@ -3264,7 +3532,7 @@ rb_gzwriter_write(VALUE obj, VALUE str)
{
struct gzfile *gz = get_gzfile(obj);
- if (TYPE(str) != T_STRING)
+ if (!RB_TYPE_P(str, T_STRING))
str = rb_obj_as_string(str);
if (gz->enc2 && gz->enc2 != rb_ascii8bit_encoding()) {
str = rb_str_conv_enc(str, rb_enc_get(str), gz->enc2);
@@ -3388,11 +3656,16 @@ rb_gzreader_s_open(int argc, VALUE *argv, VALUE klass)
/*
* Document-method: Zlib::GzipReader.new
*
- * call-seq: Zlib::GzipReader.new(io)
+ * call-seq:
+ * Zlib::GzipReader.new(io, options = {})
*
* Creates a GzipReader object associated with +io+. The GzipReader object reads
- * gzipped data from +io+, and parses/decompresses them. At least, +io+ must have
- * a +read+ method that behaves same as the +read+ method in IO class.
+ * gzipped data from +io+, and parses/decompresses it. The +io+ must
+ * have a +read+ method that behaves same as the IO#read.
+ *
+ * The +options+ hash may be used to set the encoding of the data.
+ * +:external_encoding+, +:internal_encoding+ and +:encoding+ may be set as in
+ * IO::new.
*
* If the gzip file header is incorrect, raises an Zlib::GzipFile::Error
* exception.
@@ -3890,89 +4163,6 @@ rb_gzreader_readlines(int argc, VALUE *argv, VALUE obj)
#endif /* GZIP_SUPPORT */
-
-
-/*
- * Document-module: Zlib
- *
- * The Zlib module contains several classes for compressing and decompressing
- * streams, and for working with "gzip" files.
- *
- * == Classes
- *
- * Following are the classes that are most likely to be of interest to the
- * user:
- * Zlib::Inflate
- * Zlib::Deflate
- * Zlib::GzipReader
- * Zlib::GzipWriter
- *
- * There are two important base classes for the classes above: Zlib::ZStream
- * and Zlib::GzipFile. Everything else is an error class.
- *
- * == Constants
- *
- * Here's a list.
- *
- * Zlib::VERSION
- * The Ruby/zlib version string.
- *
- * Zlib::ZLIB_VERSION
- * The string which represents the version of zlib.h.
- *
- * Zlib::BINARY
- * Zlib::ASCII
- * Zlib::UNKNOWN
- * The integers representing data types which Zlib::ZStream#data_type
- * method returns.
- *
- * Zlib::NO_COMPRESSION
- * Zlib::BEST_SPEED
- * Zlib::BEST_COMPRESSION
- * Zlib::DEFAULT_COMPRESSION
- * The integers representing compression levels which are an argument
- * for Zlib::Deflate.new, Zlib::Deflate#deflate, and so on.
- *
- * Zlib::FILTERED
- * Zlib::HUFFMAN_ONLY
- * Zlib::DEFAULT_STRATEGY
- * The integers representing compression methods which are an argument
- * for Zlib::Deflate.new and Zlib::Deflate#params.
- *
- * Zlib::DEF_MEM_LEVEL
- * Zlib::MAX_MEM_LEVEL
- * The integers representing memory levels which are an argument for
- * Zlib::Deflate.new, Zlib::Deflate#params, and so on.
- *
- * Zlib::MAX_WBITS
- * The default value of windowBits which is an argument for
- * Zlib::Deflate.new and Zlib::Inflate.new.
- *
- * Zlib::NO_FLUSH
- * Zlib::SYNC_FLUSH
- * Zlib::FULL_FLUSH
- * Zlib::FINISH
- * The integers to control the output of the deflate stream, which are
- * an argument for Zlib::Deflate#deflate and so on.
- *
- * Zlib::OS_CODE
- * Zlib::OS_MSDOS
- * Zlib::OS_AMIGA
- * Zlib::OS_VMS
- * Zlib::OS_UNIX
- * Zlib::OS_VMCMS
- * Zlib::OS_ATARI
- * Zlib::OS_OS2
- * Zlib::OS_MACOS
- * Zlib::OS_ZSYSTEM
- * Zlib::OS_CPM
- * Zlib::OS_TOPS20
- * Zlib::OS_WIN32
- * Zlib::OS_QDOS
- * Zlib::OS_RISCOS
- * Zlib::OS_UNKNOWN
- * The return values of Zlib::GzipFile#os_code method.
- */
void
Init_zlib()
{
@@ -3983,6 +4173,8 @@ Init_zlib()
mZlib = rb_define_module("Zlib");
+ id_dictionaries = rb_intern("@dictionaries");
+
cZError = rb_define_class_under(mZlib, "Error", rb_eStandardError);
cStreamEnd = rb_define_class_under(mZlib, "StreamEnd", cZError);
cNeedDict = rb_define_class_under(mZlib, "NeedDict", cZError);
@@ -4024,14 +4216,29 @@ Init_zlib()
rb_define_method(cZStream, "flush_next_in", rb_zstream_flush_next_in, 0);
rb_define_method(cZStream, "flush_next_out", rb_zstream_flush_next_out, 0);
- /* Integer representing date types which
- * ZStream#data_type method returns */
+ /* Represents binary data as guessed by deflate.
+ *
+ * See Zlib::Deflate#data_type. */
rb_define_const(mZlib, "BINARY", INT2FIX(Z_BINARY));
- /* Integer representing date types which
- * ZStream#data_type method returns */
+
+ /* Represents text data as guessed by deflate.
+ *
+ * NOTE: The underlying constant Z_ASCII was deprecated in favor of Z_TEXT
+ * in zlib 1.2.2. New applications should not use this constant.
+ *
+ * See Zlib::Deflate#data_type. */
rb_define_const(mZlib, "ASCII", INT2FIX(Z_ASCII));
- /* Integer representing date types which
- * ZStream#data_type method returns */
+
+#ifdef Z_TEXT
+ /* Represents text data as guessed by deflate.
+ *
+ * See Zlib::Deflate#data_type. */
+ rb_define_const(mZlib, "TEXT", INT2FIX(Z_TEXT));
+#endif
+
+ /* Represents an unknown data type as guessed by deflate.
+ *
+ * See Zlib::Deflate#data_type. */
rb_define_const(mZlib, "UNKNOWN", INT2FIX(Z_UNKNOWN));
cDeflate = rb_define_class_under(mZlib, "Deflate", cZStream);
@@ -4051,77 +4258,91 @@ Init_zlib()
rb_define_singleton_method(mZlib, "inflate", rb_inflate_s_inflate, 1);
rb_define_alloc_func(cInflate, rb_inflate_s_allocate);
rb_define_method(cInflate, "initialize", rb_inflate_initialize, -1);
+ rb_define_method(cInflate, "add_dictionary", rb_inflate_add_dictionary, 1);
rb_define_method(cInflate, "inflate", rb_inflate_inflate, 1);
rb_define_method(cInflate, "<<", rb_inflate_addstr, 1);
rb_define_method(cInflate, "sync", rb_inflate_sync, 1);
rb_define_method(cInflate, "sync_point?", rb_inflate_sync_point_p, 0);
rb_define_method(cInflate, "set_dictionary", rb_inflate_set_dictionary, 1);
- /* compression level 0
- *
- * Which is an argument for Deflate.new, Deflate#deflate, and so on. */
+ /* No compression, passes through data untouched. Use this for appending
+ * pre-compressed data to a deflate stream.
+ */
rb_define_const(mZlib, "NO_COMPRESSION", INT2FIX(Z_NO_COMPRESSION));
- /* compression level 1
- *
- * Which is an argument for Deflate.new, Deflate#deflate, and so on. */
+ /* Fastest compression level, but with with lowest space savings. */
rb_define_const(mZlib, "BEST_SPEED", INT2FIX(Z_BEST_SPEED));
- /* compression level 9
- *
- * Which is an argument for Deflate.new, Deflate#deflate, and so on. */
+ /* Slowest compression level, but with the best space savings. */
rb_define_const(mZlib, "BEST_COMPRESSION", INT2FIX(Z_BEST_COMPRESSION));
- /* compression level -1
- *
- * Which is an argument for Deflate.new, Deflate#deflate, and so on. */
+ /* Default compression level which is a good trade-off between space and
+ * time
+ */
rb_define_const(mZlib, "DEFAULT_COMPRESSION",
INT2FIX(Z_DEFAULT_COMPRESSION));
- /* compression method 1
- *
- * Which is an argument for Deflate.new and Deflate#params. */
+ /* Deflate strategy for data produced by a filter (or predictor). The
+ * effect of FILTERED is to force more Huffman codes and less string
+ * matching; it is somewhat intermediate between DEFAULT_STRATEGY and
+ * HUFFMAN_ONLY. Filtered data consists mostly of small values with a
+ * somewhat random distribution.
+ */
rb_define_const(mZlib, "FILTERED", INT2FIX(Z_FILTERED));
- /* compression method 2
- *
- * Which is an argument for Deflate.new and Deflate#params. */
+
+ /* Deflate strategy which uses Huffman codes only (no string matching). */
rb_define_const(mZlib, "HUFFMAN_ONLY", INT2FIX(Z_HUFFMAN_ONLY));
- /* compression method 0
- *
- * Which is an argument for Deflate.new and Deflate#params. */
+
+#ifdef Z_RLE
+ /* Deflate compression strategy designed to be almost as fast as
+ * HUFFMAN_ONLY, but give better compression for PNG image data.
+ */
+ rb_define_const(mZlib, "RLE", INT2FIX(Z_RLE));
+#endif
+
+#ifdef Z_FIXED
+ /* Deflate strategy which prevents the use of dynamic Huffman codes,
+ * allowing for a simpler decoder for specialized applications.
+ */
+ rb_define_const(mZlib, "FIXED", INT2FIX(Z_FIXED));
+#endif
+
+ /* Default deflate strategy which is used for normal data. */
rb_define_const(mZlib, "DEFAULT_STRATEGY", INT2FIX(Z_DEFAULT_STRATEGY));
- /* The default value of windowBits which is an argument for
- * Deflate.new and Inflate.new.
- */
+ /* The maximum size of the zlib history buffer. Note that zlib allows
+ * larger values to enable different inflate modes. See Zlib::Inflate.new
+ * for details.
+ */
rb_define_const(mZlib, "MAX_WBITS", INT2FIX(MAX_WBITS));
- /* Default value is 8
- *
- * The integer representing memory levels.
- * Which are an argument for Deflate.new, Deflate#params, and so on. */
+
+ /* The default memory level for allocating zlib deflate compression state.
+ */
rb_define_const(mZlib, "DEF_MEM_LEVEL", INT2FIX(DEF_MEM_LEVEL));
- /* Maximum level is 9
- *
- * The integers representing memory levels which are an argument for
- * Deflate.new, Deflate#params, and so on. */
+
+ /* The maximum memory level for allocating zlib deflate compression state.
+ */
rb_define_const(mZlib, "MAX_MEM_LEVEL", INT2FIX(MAX_MEM_LEVEL));
- /* Output control - 0
- *
- * The integers to control the output of the deflate stream, which are
- * an argument for Deflate#deflate and so on. */
+ /* NO_FLUSH is the default flush method and allows deflate to decide how
+ * much data to accumulate before producing output in order to maximize
+ * compression.
+ */
rb_define_const(mZlib, "NO_FLUSH", INT2FIX(Z_NO_FLUSH));
- /* Output control - 2
- *
- * The integers to control the output of the deflate stream, which are
- * an argument for Deflate#deflate and so on. */
+
+ /* The SYNC_FLUSH method flushes all pending output to the output buffer
+ * and the output is aligned on a byte boundary. Flushing may degrade
+ * compression so it should be used only when necessary, such as at a
+ * request or response boundary for a network stream.
+ */
rb_define_const(mZlib, "SYNC_FLUSH", INT2FIX(Z_SYNC_FLUSH));
- /* Output control - 3
- *
- * The integers to control the output of the deflate stream, which are
- * an argument for Deflate#deflate and so on. */
+
+ /* Flushes all output as with SYNC_FLUSH, and the compression state is
+ * reset so that decompression can restart from this point if previous
+ * compressed data has been damaged or if random access is desired. Like
+ * SYNC_FLUSH, using FULL_FLUSH too often can seriously degrade
+ * compression.
+ */
rb_define_const(mZlib, "FULL_FLUSH", INT2FIX(Z_FULL_FLUSH));
- /* Oputput control - 4
- *
- * The integers to control the output of the deflate stream, which are
- * an argument for Deflate#deflate and so on. */
+
+ /* Processes all pending input and flushes pending output. */
rb_define_const(mZlib, "FINISH", INT2FIX(Z_FINISH));
#if GZIP_SUPPORT
@@ -4209,38 +4430,37 @@ Init_zlib()
rb_define_method(cGzipReader, "lines", rb_gzreader_each, -1);
rb_define_method(cGzipReader, "readlines", rb_gzreader_readlines, -1);
- /* From GzipFile#os_code - code of current host */
+ /* The OS code of current host */
rb_define_const(mZlib, "OS_CODE", INT2FIX(OS_CODE));
- /* From GzipFile#os_code - 0x00 */
+ /* OS code for MSDOS hosts */
rb_define_const(mZlib, "OS_MSDOS", INT2FIX(OS_MSDOS));
- /* From GzipFile#os_code - 0x01 */
+ /* OS code for Amiga hosts */
rb_define_const(mZlib, "OS_AMIGA", INT2FIX(OS_AMIGA));
- /* From GzipFile#os_code - 0x02 */
+ /* OS code for VMS hosts */
rb_define_const(mZlib, "OS_VMS", INT2FIX(OS_VMS));
- /* From GzipFile#os_code - 0x03 */
+ /* OS code for UNIX hosts */
rb_define_const(mZlib, "OS_UNIX", INT2FIX(OS_UNIX));
- /* From GzipFile#os_code - 0x05 */
+ /* OS code for Atari hosts */
rb_define_const(mZlib, "OS_ATARI", INT2FIX(OS_ATARI));
- /* From GzipFile#os_code - 0x06 */
+ /* OS code for OS2 hosts */
rb_define_const(mZlib, "OS_OS2", INT2FIX(OS_OS2));
- /* From GzipFile#os_code - 0x07 */
+ /* OS code for Mac OS hosts */
rb_define_const(mZlib, "OS_MACOS", INT2FIX(OS_MACOS));
- /* From GzipFile#os_code - 0x0a */
+ /* OS code for TOPS-20 hosts */
rb_define_const(mZlib, "OS_TOPS20", INT2FIX(OS_TOPS20));
- /* From GzipFile#os_code - 0x0b */
+ /* OS code for Win32 hosts */
rb_define_const(mZlib, "OS_WIN32", INT2FIX(OS_WIN32));
-
- /* From GzipFile#os_code - 0x04 */
+ /* OS code for VM OS hosts */
rb_define_const(mZlib, "OS_VMCMS", INT2FIX(OS_VMCMS));
- /* From GzipFile#os_code - 0x08 */
+ /* OS code for Z-System hosts */
rb_define_const(mZlib, "OS_ZSYSTEM", INT2FIX(OS_ZSYSTEM));
- /* From GzipFile#os_code - 0x09 */
+ /* OS code for CP/M hosts */
rb_define_const(mZlib, "OS_CPM", INT2FIX(OS_CPM));
- /* From GzipFile#os_code - 0x0c */
+ /* OS code for QDOS hosts */
rb_define_const(mZlib, "OS_QDOS", INT2FIX(OS_QDOS));
- /* From GzipFile#os_code - 0x0d */
+ /* OS code for RISC OS hosts */
rb_define_const(mZlib, "OS_RISCOS", INT2FIX(OS_RISCOS));
- /* From GzipFile#os_code - 0xff */
+ /* OS code for unknown hosts */
rb_define_const(mZlib, "OS_UNKNOWN", INT2FIX(OS_UNKNOWN));
#endif /* GZIP_SUPPORT */
diff --git a/file.c b/file.c
index 81f28ffa03..88a7065cf7 100644
--- a/file.c
+++ b/file.c
@@ -17,6 +17,7 @@
#ifdef __CYGWIN__
#include <windows.h>
#include <sys/cygwin.h>
+#include <wchar.h>
#endif
#include "ruby/ruby.h"
@@ -59,6 +60,13 @@ int flock(int, int);
#include <sys/types.h>
#include <sys/stat.h>
+#if defined(__native_client__) && defined(NACL_NEWLIB)
+# include "nacl/utime.h"
+# include "nacl/stat.h"
+# include "nacl/unistd.h"
+#endif
+
+
#ifdef HAVE_SYS_MKDEV_H
#include <sys/mkdev.h>
#endif
@@ -94,6 +102,8 @@ int flock(int, int);
#define STAT(p, s) stat((p), (s))
#endif
+#define rb_sys_fail_path(path) rb_sys_fail_str(path)
+
#if defined(__BEOS__) || defined(__HAIKU__) /* should not change ID if -1 */
static int
be_chown(const char *path, uid_t owner, gid_t group)
@@ -136,45 +146,70 @@ file_path_convert(VALUE name)
if (rb_default_internal_encoding() != NULL
&& rb_usascii_encoding() != fname_encoding
&& rb_ascii8bit_encoding() != fname_encoding
- && (fs_encoding = rb_filesystem_encoding()) != fname_encoding) {
+ && (fs_encoding = rb_filesystem_encoding()) != fname_encoding
+ && !rb_enc_str_asciionly_p(name)) {
/* Don't call rb_filesystem_encoding() before US-ASCII and ASCII-8BIT */
+ /* fs_encoding should be ascii compatible */
name = rb_str_conv_enc(name, fname_encoding, fs_encoding);
}
#endif
return name;
}
-static VALUE
-rb_get_path_check(VALUE obj, int level)
+static rb_encoding *
+check_path_encoding(VALUE str)
+{
+ rb_encoding *enc = rb_enc_get(str);
+ if (!rb_enc_asciicompat(enc)) {
+ rb_raise(rb_eEncCompatError, "path name must be ASCII-compatible (%s): %"PRIsVALUE,
+ rb_enc_name(enc), rb_str_inspect(str));
+ }
+ return enc;
+}
+
+VALUE
+rb_get_path_check_to_string(VALUE obj, int level)
{
VALUE tmp;
ID to_path;
- rb_encoding *enc;
if (insecure_obj_p(obj, level)) {
rb_insecure_operation();
}
+ if (RB_TYPE_P(obj, T_STRING)) {
+ return obj;
+ }
CONST_ID(to_path, "to_path");
tmp = rb_check_funcall(obj, to_path, 0, 0);
if (tmp == Qundef) {
tmp = obj;
}
StringValue(tmp);
+ return tmp;
+}
+VALUE
+rb_get_path_check_convert(VALUE obj, VALUE tmp, int level)
+{
tmp = file_path_convert(tmp);
if (obj != tmp && insecure_obj_p(tmp, level)) {
rb_insecure_operation();
}
- enc = rb_enc_get(tmp);
- if (!rb_enc_asciicompat(enc)) {
- tmp = rb_str_inspect(tmp);
- rb_raise(rb_eEncCompatError, "path name must be ASCII-compatible (%s): %s",
- rb_enc_name(enc), RSTRING_PTR(tmp));
- }
+
+ check_path_encoding(tmp);
+ StringValueCStr(tmp);
+
return rb_str_new4(tmp);
}
+static VALUE
+rb_get_path_check(VALUE obj, int level)
+{
+ VALUE tmp = rb_get_path_check_to_string(obj, level);
+ return rb_get_path_check_convert(obj, tmp, level);
+}
+
VALUE
rb_get_path_no_checksafe(VALUE obj)
{
@@ -207,16 +242,18 @@ rb_str_encode_ospath(VALUE path)
}
static long
-apply2files(void (*func)(const char *, void *), VALUE vargs, void *arg)
+apply2files(void (*func)(const char *, VALUE, void *), VALUE vargs, void *arg)
{
long i;
volatile VALUE path;
rb_secure(4);
for (i=0; i<RARRAY_LEN(vargs); i++) {
+ const char *s;
path = rb_get_path(RARRAY_PTR(vargs)[i]);
path = rb_str_encode_ospath(path);
- (*func)(StringValueCStr(path), arg);
+ s = RSTRING_PTR(path);
+ (*func)(s, path, arg);
}
return RARRAY_LEN(vargs);
@@ -843,8 +880,7 @@ w32_io_info(VALUE *file, BY_HANDLE_FILE_INFORMATION *st)
MultiByteToWideChar(CP_UTF8, 0, RSTRING_PTR(tmp), -1, ptr, len);
f = CreateFileW(ptr, 0,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
- rb_w32_iswin95() ? 0 : FILE_FLAG_BACKUP_SEMANTICS,
- NULL);
+ FILE_FLAG_BACKUP_SEMANTICS, NULL);
ALLOCV_END(v);
if (f == INVALID_HANDLE_VALUE) return f;
ret = f;
@@ -877,7 +913,7 @@ rb_file_s_stat(VALUE klass, VALUE fname)
rb_secure(4);
FilePathValue(fname);
if (rb_stat(fname, &st) < 0) {
- rb_sys_fail(RSTRING_PTR(fname));
+ rb_sys_fail_path(fname);
}
return stat_new(&st);
}
@@ -903,7 +939,6 @@ rb_io_stat(VALUE obj)
rb_io_t *fptr;
struct stat st;
-#define rb_sys_fail_path(path) rb_sys_fail(NIL_P(path) ? 0 : RSTRING_PTR(path))
GetOpenFile(obj, fptr);
if (fstat(fptr->fd, &st) == -1) {
rb_sys_fail_path(fptr->pathv);
@@ -935,7 +970,7 @@ rb_file_s_lstat(VALUE klass, VALUE fname)
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (lstat(StringValueCStr(fname), &st) == -1) {
- rb_sys_fail(RSTRING_PTR(fname));
+ rb_sys_fail_path(fname);
}
return stat_new(&st);
#else
@@ -1079,18 +1114,6 @@ access_internal(const char *path, int mode)
*/
/*
- * Document-method: exist?
- *
- * call-seq:
- * Dir.exist?(file_name) -> true or false
- * Dir.exists?(file_name) -> true or false
- *
- * Returns <code>true</code> if the named file is a directory,
- * <code>false</code> otherwise.
- *
- */
-
-/*
* Document-method: directory?
*
* call-seq:
@@ -1671,7 +1694,6 @@ rb_file_identical_p(VALUE obj, VALUE fname1, VALUE fname2)
st1.nFileIndexLow == st2.nFileIndexLow)
return Qtrue;
if (!f1 || !f2) return Qfalse;
- if (rb_w32_iswin95()) return Qfalse;
# else
FilePathValue(fname1);
fname1 = rb_str_new4(fname1);
@@ -1704,7 +1726,7 @@ rb_file_s_size(VALUE klass, VALUE fname)
if (rb_stat(fname, &st) < 0) {
FilePathValue(fname);
- rb_sys_fail(RSTRING_PTR(fname));
+ rb_sys_fail_path(fname);
}
return OFFT2NUM(st.st_size);
}
@@ -1774,7 +1796,7 @@ rb_file_s_ftype(VALUE klass, VALUE fname)
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (lstat(StringValueCStr(fname), &st) == -1) {
- rb_sys_fail(RSTRING_PTR(fname));
+ rb_sys_fail_path(fname);
}
return rb_file_ftype(&st);
@@ -1797,7 +1819,7 @@ rb_file_s_atime(VALUE klass, VALUE fname)
if (rb_stat(fname, &st) < 0) {
FilePathValue(fname);
- rb_sys_fail(RSTRING_PTR(fname));
+ rb_sys_fail_path(fname);
}
return stat_atime(&st);
}
@@ -1843,7 +1865,7 @@ rb_file_s_mtime(VALUE klass, VALUE fname)
if (rb_stat(fname, &st) < 0) {
FilePathValue(fname);
- rb_sys_fail(RSTRING_PTR(fname));
+ rb_sys_fail_path(fname);
}
return stat_mtime(&st);
}
@@ -1892,7 +1914,7 @@ rb_file_s_ctime(VALUE klass, VALUE fname)
if (rb_stat(fname, &st) < 0) {
FilePathValue(fname);
- rb_sys_fail(RSTRING_PTR(fname));
+ rb_sys_fail_path(fname);
}
return stat_ctime(&st);
}
@@ -1950,10 +1972,10 @@ rb_file_size(VALUE obj)
}
static void
-chmod_internal(const char *path, void *mode)
+chmod_internal(const char *path, VALUE pathv, void *mode)
{
if (chmod(path, *(int *)mode) < 0)
- rb_sys_fail(path);
+ rb_sys_fail_path(pathv);
}
/*
@@ -2026,10 +2048,10 @@ rb_file_chmod(VALUE obj, VALUE vmode)
#if defined(HAVE_LCHMOD)
static void
-lchmod_internal(const char *path, void *mode)
+lchmod_internal(const char *path, VALUE pathv, void *mode)
{
if (lchmod(path, (int)(VALUE)mode) < 0)
- rb_sys_fail(path);
+ rb_sys_fail_path(pathv);
}
/*
@@ -2066,11 +2088,11 @@ struct chown_args {
};
static void
-chown_internal(const char *path, void *arg)
+chown_internal(const char *path, VALUE pathv, void *arg)
{
struct chown_args *args = arg;
if (chown(path, args->owner, args->group) < 0)
- rb_sys_fail(path);
+ rb_sys_fail_path(pathv);
}
/*
@@ -2157,11 +2179,11 @@ rb_file_chown(VALUE obj, VALUE owner, VALUE group)
#if defined(HAVE_LCHOWN)
static void
-lchown_internal(const char *path, void *arg)
+lchown_internal(const char *path, VALUE pathv, void *arg)
{
struct chown_args *args = arg;
if (lchown(path, args->owner, args->group) < 0)
- rb_sys_fail(path);
+ rb_sys_fail_path(pathv);
}
/*
@@ -2210,10 +2232,10 @@ struct utime_args {
};
#if defined DOSISH || defined __CYGWIN__
-NORETURN(static void utime_failed(const char *, const struct timespec *, VALUE, VALUE));
+NORETURN(static void utime_failed(VALUE, const struct timespec *, VALUE, VALUE));
static void
-utime_failed(const char *path, const struct timespec *tsp, VALUE atime, VALUE mtime)
+utime_failed(VALUE path, const struct timespec *tsp, VALUE atime, VALUE mtime)
{
if (tsp && errno == EINVAL) {
VALUE e[2], a = Qnil, m = Qnil;
@@ -2234,23 +2256,23 @@ utime_failed(const char *path, const struct timespec *tsp, VALUE atime, VALUE mt
if (!NIL_P(e[0])) {
if (path) {
if (!d) e[0] = rb_str_dup(e[0]);
- rb_str_cat2(rb_str_cat2(e[0], " for "), path);
+ rb_str_append(rb_str_cat2(e[0], " for "), path);
}
e[1] = INT2FIX(EINVAL);
rb_exc_raise(rb_class_new_instance(2, e, rb_eSystemCallError));
}
errno = EINVAL;
}
- rb_sys_fail(path);
+ rb_sys_fail_path(path);
}
#else
-#define utime_failed(path, tsp, atime, mtime) rb_sys_fail(path)
+#define utime_failed(path, tsp, atime, mtime) rb_sys_fail_path(path)
#endif
#if defined(HAVE_UTIMES)
static void
-utime_internal(const char *path, void *arg)
+utime_internal(const char *path, VALUE pathv, void *arg)
{
struct utime_args *v = arg;
const struct timespec *tsp = v->tsp;
@@ -2265,7 +2287,7 @@ utime_internal(const char *path, void *arg)
try_utimensat = 0;
goto no_utimensat;
}
- utime_failed(path, tsp, v->atime, v->mtime);
+ utime_failed(pathv, tsp, v->atime, v->mtime);
}
return;
}
@@ -2280,7 +2302,7 @@ no_utimensat:
tvp = tvbuf;
}
if (utimes(path, tvp) < 0)
- utime_failed(path, tsp, v->atime, v->mtime);
+ utime_failed(pathv, tsp, v->atime, v->mtime);
}
#else
@@ -2293,7 +2315,7 @@ struct utimbuf {
#endif
static void
-utime_internal(const char *path, void *arg)
+utime_internal(const char *path, VALUE pathv, void *arg)
{
struct utime_args *v = arg;
const struct timespec *tsp = v->tsp;
@@ -2304,7 +2326,7 @@ utime_internal(const char *path, void *arg)
utp = &utbuf;
}
if (utime(path, utp) < 0)
- utime_failed(path, tsp, v->atime, v->mtime);
+ utime_failed(pathv, tsp, v->atime, v->mtime);
}
#endif
@@ -2344,33 +2366,19 @@ NORETURN(static void sys_fail2(VALUE,VALUE));
static void
sys_fail2(VALUE s1, VALUE s2)
{
- char *buf;
+ VALUE str;
#ifdef MAX_PATH
const int max_pathlen = MAX_PATH;
#else
const int max_pathlen = MAXPATHLEN;
#endif
- const char *e1, *e2;
- int len = 5;
- long l1 = RSTRING_LEN(s1), l2 = RSTRING_LEN(s2);
- e1 = e2 = "";
- if (l1 > max_pathlen) {
- l1 = max_pathlen - 3;
- e1 = "...";
- len += 3;
- }
- if (l2 > max_pathlen) {
- l2 = max_pathlen - 3;
- e2 = "...";
- len += 3;
- }
- len += (int)l1 + (int)l2;
- buf = ALLOCA_N(char, len);
- snprintf(buf, len, "(%.*s%s, %.*s%s)",
- (int)l1, RSTRING_PTR(s1), e1,
- (int)l2, RSTRING_PTR(s2), e2);
- rb_sys_fail(buf);
+ str = rb_str_new_cstr("(");
+ rb_str_append(str, rb_str_ellipsize(s1, max_pathlen));
+ rb_str_cat2(str, ", ");
+ rb_str_append(str, rb_str_ellipsize(s2, max_pathlen));
+ rb_str_cat2(str, ")");
+ rb_sys_fail_path(str);
}
#ifdef HAVE_LINK
@@ -2436,6 +2444,8 @@ rb_file_s_symlink(VALUE klass, VALUE from, VALUE to)
#endif
#ifdef HAVE_READLINK
+static VALUE rb_readlink(VALUE path);
+
/*
* call-seq:
* File.readlink(link_name) -> file_name
@@ -2450,7 +2460,12 @@ rb_file_s_symlink(VALUE klass, VALUE from, VALUE to)
static VALUE
rb_file_s_readlink(VALUE klass, VALUE path)
{
- char *buf;
+ return rb_readlink(path);
+}
+
+static VALUE
+rb_readlink(VALUE path)
+{
int size = 100;
ssize_t rv;
VALUE v;
@@ -2458,21 +2473,20 @@ rb_file_s_readlink(VALUE klass, VALUE path)
rb_secure(2);
FilePathValue(path);
path = rb_str_encode_ospath(path);
- buf = xmalloc(size);
- while ((rv = readlink(RSTRING_PTR(path), buf, size)) == size
+ v = rb_enc_str_new(0, size, rb_filesystem_encoding());
+ while ((rv = readlink(RSTRING_PTR(path), RSTRING_PTR(v), size)) == size
#ifdef _AIX
|| (rv < 0 && errno == ERANGE) /* quirky behavior of GPFS */
#endif
) {
+ rb_str_modify_expand(v, size);
size *= 2;
- buf = xrealloc(buf, size);
}
if (rv < 0) {
- xfree(buf);
+ rb_str_resize(v, 0);
rb_sys_fail_path(path);
}
- v = rb_filesystem_str_new(buf, rv);
- xfree(buf);
+ rb_str_resize(v, rv);
return v;
}
@@ -2481,10 +2495,10 @@ rb_file_s_readlink(VALUE klass, VALUE path)
#endif
static void
-unlink_internal(const char *path, void *arg)
+unlink_internal(const char *path, VALUE pathv, void *arg)
{
if (unlink(path) < 0)
- rb_sys_fail(path);
+ rb_sys_fail_path(pathv);
}
/*
@@ -2581,7 +2595,7 @@ rb_file_s_umask(int argc, VALUE *argv)
omask = umask(NUM2INT(argv[0]));
}
else {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 0..1)", argc);
+ rb_check_arity(argc, 0, 1);
}
return INT2FIX(omask);
}
@@ -2615,9 +2629,8 @@ static const char file_alt_separator[] = {FILE_ALT_SEPARATOR, '\0'};
#define istrailinggarbage(x) 0
#endif
-#ifndef CharNext /* defined as CharNext[AW] on Windows. */
-# define CharNext(p) ((p) + 1)
-#endif
+#define Next(p, e, enc) ((p) + rb_enc_mbclen((p), (e), (enc)))
+#define Inc(p, e, enc) ((p) = Next((p), (e), (enc)))
#if defined(DOSISH_UNC)
#define has_unc(buf) (isdirsep((buf)[0]) && isdirsep((buf)[1]))
@@ -2637,6 +2650,7 @@ has_drive_letter(const char *buf)
}
}
+#ifndef _WIN32
static char*
getcwdofdrv(int drv)
{
@@ -2663,6 +2677,7 @@ getcwdofdrv(int drv)
}
return drvcwd;
}
+#endif
static inline int
not_same_drive(VALUE path, int drive)
@@ -2679,40 +2694,40 @@ not_same_drive(VALUE path, int drive)
#endif
static inline char *
-skiproot(const char *path)
+skiproot(const char *path, const char *end, rb_encoding *enc)
{
#ifdef DOSISH_DRIVE_LETTER
- if (has_drive_letter(path)) path += 2;
+ if (path + 2 <= end && has_drive_letter(path)) path += 2;
#endif
- while (isdirsep(*path)) path++;
+ while (path < end && isdirsep(*path)) path++;
return (char *)path;
}
-#define nextdirsep rb_path_next
+#define nextdirsep rb_enc_path_next
char *
-rb_path_next(const char *s)
+rb_enc_path_next(const char *s, const char *e, rb_encoding *enc)
{
- while (*s && !isdirsep(*s)) {
- s = CharNext(s);
+ while (s < e && !isdirsep(*s)) {
+ Inc(s, e, enc);
}
return (char *)s;
}
#if defined(DOSISH_UNC) || defined(DOSISH_DRIVE_LETTER)
-#define skipprefix rb_path_skip_prefix
+#define skipprefix rb_enc_path_skip_prefix
#else
-#define skipprefix(path) (path)
+#define skipprefix(path, end, enc) (path)
#endif
char *
-rb_path_skip_prefix(const char *path)
+rb_enc_path_skip_prefix(const char *path, const char *end, rb_encoding *enc)
{
#if defined(DOSISH_UNC) || defined(DOSISH_DRIVE_LETTER)
#ifdef DOSISH_UNC
- if (isdirsep(path[0]) && isdirsep(path[1])) {
+ if (path + 2 <= end && isdirsep(path[0]) && isdirsep(path[1])) {
path += 2;
- while (isdirsep(*path)) path++;
- if (*(path = nextdirsep(path)) && path[1] && !isdirsep(path[1]))
- path = nextdirsep(path + 1);
+ while (path < end && isdirsep(*path)) path++;
+ if ((path = rb_enc_path_next(path, end, enc)) < end && path[0] && path[1] && !isdirsep(path[1]))
+ path = rb_enc_path_next(path + 1, end, enc);
return (char *)path;
}
#endif
@@ -2725,78 +2740,78 @@ rb_path_skip_prefix(const char *path)
}
static inline char *
-skipprefixroot(const char *path)
+skipprefixroot(const char *path, const char *end, rb_encoding *enc)
{
#if defined(DOSISH_UNC) || defined(DOSISH_DRIVE_LETTER)
- char *p = skipprefix(path);
+ char *p = skipprefix(path, end, enc);
while (isdirsep(*p)) p++;
return p;
#else
- return skiproot(path);
+ return skiproot(path, end, enc);
#endif
}
-#define strrdirsep rb_path_last_separator
+#define strrdirsep rb_enc_path_last_separator
char *
-rb_path_last_separator(const char *path)
+rb_enc_path_last_separator(const char *path, const char *end, rb_encoding *enc)
{
char *last = NULL;
- while (*path) {
+ while (path < end) {
if (isdirsep(*path)) {
const char *tmp = path++;
- while (isdirsep(*path)) path++;
- if (!*path) break;
+ while (path < end && isdirsep(*path)) path++;
+ if (path >= end) break;
last = (char *)tmp;
}
else {
- path = CharNext(path);
+ Inc(path, end, enc);
}
}
return last;
}
static char *
-chompdirsep(const char *path)
+chompdirsep(const char *path, const char *end, rb_encoding *enc)
{
- while (*path) {
+ while (path < end) {
if (isdirsep(*path)) {
const char *last = path++;
- while (isdirsep(*path)) path++;
- if (!*path) return (char *)last;
+ while (path < end && isdirsep(*path)) path++;
+ if (path >= end) return (char *)last;
}
else {
- path = CharNext(path);
+ Inc(path, end, enc);
}
}
return (char *)path;
}
char *
-rb_path_end(const char *path)
+rb_enc_path_end(const char *path, const char *end, rb_encoding *enc)
{
- if (isdirsep(*path)) path++;
- return chompdirsep(path);
+ if (path < end && isdirsep(*path)) path++;
+ return chompdirsep(path, end, enc);
}
#if USE_NTFS
static char *
-ntfs_tail(const char *path)
+ntfs_tail(const char *path, const char *end, rb_encoding *enc)
{
- while (*path == '.') path++;
- while (*path && *path != ':') {
+ while (path < end && *path == '.') path++;
+ while (path < end && *path != ':') {
if (istrailinggarbage(*path)) {
const char *last = path++;
- while (istrailinggarbage(*path)) path++;
- if (!*path || *path == ':') return (char *)last;
+ while (path < end && istrailinggarbage(*path)) path++;
+ if (path >= end || *path == ':') return (char *)last;
}
else if (isdirsep(*path)) {
const char *last = path++;
- while (isdirsep(*path)) path++;
- if (!*path) return (char *)last;
+ while (path < end && isdirsep(*path)) path++;
+ if (path >= end) return (char *)last;
if (*path == ':') path++;
}
else {
- path = CharNext(path);
+ Inc(path, end, enc);
}
}
return (char *)path;
@@ -2825,9 +2840,10 @@ rb_home_dir(const char *user, VALUE result)
const char *dir;
char *buf;
#if defined DOSISH || defined __CYGWIN__
- char *p;
+ char *p, *bend;
#endif
long dirlen;
+ rb_encoding *enc;
if (!user || !*user) {
if (!(dir = getenv("HOME"))) {
@@ -2846,32 +2862,62 @@ rb_home_dir(const char *user, VALUE result)
}
dirlen = strlen(pwPtr->pw_dir);
rb_str_resize(result, dirlen);
- strcpy(buf = RSTRING_PTR(result), pwPtr->pw_dir);
+ memcpy(buf = RSTRING_PTR(result), pwPtr->pw_dir, dirlen + 1);
endpwent();
#else
return Qnil;
#endif
}
+ enc = rb_filesystem_encoding();
+ rb_enc_associate(result, enc);
#if defined DOSISH || defined __CYGWIN__
- for (p = buf; *p; p = CharNext(p)) {
+ for (bend = (p = buf) + dirlen; p < bend; Inc(p, bend, enc)) {
if (*p == '\\') {
*p = '/';
}
}
#endif
- rb_enc_associate_index(result, rb_filesystem_encindex());
return result;
}
-static VALUE
-file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
+#ifndef _WIN32
+static char *
+append_fspath(VALUE result, VALUE fname, char *dir, rb_encoding **enc, rb_encoding *fsenc)
{
- const char *s, *b;
+ char *buf, *cwdp = dir;
+ VALUE dirname = Qnil;
+ size_t dirlen = strlen(dir), buflen = rb_str_capacity(result);
+
+ if (*enc != fsenc) {
+ rb_encoding *direnc = rb_enc_check(fname, dirname = rb_enc_str_new(dir, dirlen, fsenc));
+ if (direnc != fsenc) {
+ dirname = rb_str_conv_enc(dirname, fsenc, direnc);
+ RSTRING_GETMEM(dirname, cwdp, dirlen);
+ }
+ *enc = direnc;
+ }
+ do {buflen *= 2;} while (dirlen > buflen);
+ rb_str_resize(result, buflen);
+ buf = RSTRING_PTR(result);
+ memcpy(buf, cwdp, dirlen);
+ xfree(dir);
+ if (!NIL_P(dirname)) rb_str_resize(dirname, 0);
+ rb_enc_associate(result, *enc);
+ return buf + dirlen;
+}
+
+VALUE
+rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_name, VALUE result)
+{
+ const char *s, *b, *fend;
char *buf, *p, *pend, *root;
- size_t buflen, dirlen, bdiff;
+ size_t buflen, bdiff;
int tainted;
+ rb_encoding *enc, *fsenc = rb_filesystem_encoding();
s = StringValuePtr(fname);
+ fend = s + RSTRING_LEN(fname);
+ enc = rb_enc_get(fname);
BUFINIT();
tainted = OBJ_TAINTED(fname);
@@ -2885,7 +2931,7 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
if (*++s) ++s;
}
else {
- s = nextdirsep(b = s);
+ s = nextdirsep(b = s, fend, enc);
userlen = s - b;
BUFCHECK(bdiff + userlen >= buflen);
memcpy(p, b, userlen);
@@ -2923,7 +2969,7 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
/* specified drive, but not full path */
int same = 0;
if (!NIL_P(dname) && !not_same_drive(dname, s[0])) {
- file_expand_path(dname, Qnil, abs_mode, result);
+ rb_file_expand_path_internal(dname, Qnil, abs_mode, long_name, result);
BUFINIT();
if (has_drive_letter(p) && TOLOWER(p[0]) == TOLOWER(s[0])) {
/* ok, same drive */
@@ -2931,47 +2977,42 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
}
}
if (!same) {
- char *dir = getcwdofdrv(*s);
-
+ char *e = append_fspath(result, fname, getcwdofdrv(*s), &enc, fsenc);
tainted = 1;
- dirlen = strlen(dir);
- BUFCHECK(dirlen > buflen);
- strcpy(buf, dir);
- xfree(dir);
- rb_enc_associate_index(result, rb_filesystem_encindex());
+ BUFINIT();
+ p = e;
}
- else
- rb_enc_associate(result, rb_enc_check(result, fname));
- p = chompdirsep(skiproot(buf));
+ else {
+ rb_enc_associate(result, enc = rb_enc_check(result, fname));
+ p = pend;
+ }
+ p = chompdirsep(skiproot(buf, p, enc), p, enc);
s += 2;
}
}
#endif
else if (!rb_is_absolute_path(s)) {
if (!NIL_P(dname)) {
- file_expand_path(dname, Qnil, abs_mode, result);
- BUFINIT();
+ rb_file_expand_path_internal(dname, Qnil, abs_mode, long_name, result);
rb_enc_associate(result, rb_enc_check(result, fname));
+ BUFINIT();
+ p = pend;
}
else {
- char *dir = my_getcwd();
-
+ char *e = append_fspath(result, fname, my_getcwd(), &enc, fsenc);
tainted = 1;
- dirlen = strlen(dir);
- BUFCHECK(dirlen > buflen);
- strcpy(buf, dir);
- xfree(dir);
- rb_enc_associate_index(result, rb_filesystem_encindex());
+ BUFINIT();
+ p = e;
}
#if defined DOSISH || defined __CYGWIN__
if (isdirsep(*s)) {
/* specified full path, but not drive letter nor UNC */
/* we need to get the drive letter or UNC share name */
- p = skipprefix(buf);
+ p = skipprefix(buf, p, enc);
}
else
#endif
- p = chompdirsep(skiproot(buf));
+ p = chompdirsep(skiproot(buf, p, enc), p, enc);
}
else {
size_t len;
@@ -2995,7 +3036,7 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
rb_str_set_len(result, p-buf+1);
BUFCHECK(bdiff + 1 >= buflen);
p[1] = 0;
- root = skipprefix(buf);
+ root = skipprefix(buf, p+1, enc);
b = s;
while (*s) {
@@ -3011,7 +3052,7 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
/* We must go back to the parent */
char *n;
*p = '\0';
- if (!(n = strrdirsep(root))) {
+ if (!(n = strrdirsep(root, p, enc))) {
*p = '/';
}
else {
@@ -3041,7 +3082,7 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
--s;
case ' ': {
const char *e = s;
- while (istrailinggarbage(*s)) s++;
+ while (s < fend && istrailinggarbage(*s)) s++;
if (!*s) {
s = e;
goto endpath;
@@ -3066,7 +3107,7 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
b = ++s;
break;
default:
- s = CharNext(s);
+ Inc(s, fend, enc);
break;
}
}
@@ -3091,14 +3132,18 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
BUFCHECK(bdiff + (s-b) >= buflen);
memcpy(++p, b, s-b);
p += s-b;
+ rb_str_set_len(result, p-buf);
}
- if (p == skiproot(buf) - 1) p++;
+ if (p == skiproot(buf, p + !!*p, enc) - 1) p++;
#if USE_NTFS
*p = '\0';
- if ((s = strrdirsep(b = buf)) != 0 && !strpbrk(s, "*?")) {
+ if ((s = strrdirsep(b = buf, p, enc)) != 0 && !strpbrk(s, "*?")) {
+ VALUE tmp, v;
size_t len;
- WIN32_FIND_DATA wfd;
+ rb_encoding *enc;
+ WCHAR *wstr;
+ WIN32_FIND_DATAW wfd;
HANDLE h;
#ifdef __CYGWIN__
#ifdef HAVE_CYGWIN_CONV_PATH
@@ -3148,21 +3193,43 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
}
*p = '/';
#endif
- h = FindFirstFile(b, &wfd);
+ rb_str_set_len(result, p - buf + strlen(p));
+ enc = rb_enc_get(result);
+ tmp = result;
+ if (enc != rb_utf8_encoding() && rb_enc_str_coderange(result) != ENC_CODERANGE_7BIT) {
+ tmp = rb_str_encode_ospath(result);
+ }
+ len = MultiByteToWideChar(CP_UTF8, 0, RSTRING_PTR(tmp), -1, NULL, 0);
+ wstr = ALLOCV_N(WCHAR, v, len);
+ MultiByteToWideChar(CP_UTF8, 0, RSTRING_PTR(tmp), -1, wstr, len);
+ if (tmp != result) rb_str_resize(tmp, 0);
+ h = FindFirstFileW(wstr, &wfd);
+ ALLOCV_END(v);
if (h != INVALID_HANDLE_VALUE) {
+ size_t wlen;
FindClose(h);
- len = strlen(wfd.cFileName);
+ len = lstrlenW(wfd.cFileName);
#ifdef __CYGWIN__
if (lnk_added && len > 4 &&
- STRCASECMP(wfd.cFileName + len - 4, ".lnk") == 0) {
- wfd.cFileName[len -= 4] = '\0';
+ wcscasecmp(wfd.cFileName + len - 4, L".lnk") == 0) {
+ wfd.cFileName[len -= 4] = L'\0';
}
#else
p = (char *)s;
#endif
++p;
+ wlen = (int)len;
+ len = WideCharToMultiByte(CP_UTF8, 0, wfd.cFileName, wlen, NULL, 0, NULL, NULL);
BUFCHECK(bdiff + len >= buflen);
- memcpy(p, wfd.cFileName, len + 1);
+ WideCharToMultiByte(CP_UTF8, 0, wfd.cFileName, wlen, p, len + 1, NULL, NULL);
+ if (tmp != result) {
+ rb_str_buf_cat(tmp, p, len);
+ tmp = rb_str_encode(tmp, rb_enc_from_encoding(enc), 0, Qnil);
+ len = RSTRING_LEN(tmp);
+ BUFCHECK(bdiff + len >= buflen);
+ memcpy(p, RSTRING_PTR(tmp), len);
+ rb_str_resize(tmp, 0);
+ }
p += len;
}
#ifdef __CYGWIN__
@@ -3176,8 +3243,10 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
if (tainted) OBJ_TAINT(result);
rb_str_set_len(result, p - buf);
rb_enc_check(fname, result);
+ ENC_CODERANGE_CLEAR(result);
return result;
}
+#endif /* _WIN32 */
#define EXPAND_PATH_BUFFER() rb_usascii_str_new(0, MAXPATHLEN + 2)
@@ -3188,14 +3257,20 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
static VALUE
file_expand_path_1(VALUE fname)
{
- return file_expand_path(fname, Qnil, 0, EXPAND_PATH_BUFFER());
+ return rb_file_expand_path_internal(fname, Qnil, 0, 0, EXPAND_PATH_BUFFER());
}
VALUE
rb_file_expand_path(VALUE fname, VALUE dname)
{
check_expand_path_args(fname, dname);
- return file_expand_path(fname, dname, 0, EXPAND_PATH_BUFFER());
+ return rb_file_expand_path_internal(fname, dname, 0, 1, EXPAND_PATH_BUFFER());
+}
+
+VALUE
+rb_file_expand_path_fast(VALUE fname, VALUE dname)
+{
+ return rb_file_expand_path_internal(fname, dname, 0, 0, EXPAND_PATH_BUFFER());
}
/*
@@ -3232,7 +3307,7 @@ VALUE
rb_file_absolute_path(VALUE fname, VALUE dname)
{
check_expand_path_args(fname, dname);
- return file_expand_path(fname, dname, 1, EXPAND_PATH_BUFFER());
+ return rb_file_expand_path_internal(fname, dname, 1, 1, EXPAND_PATH_BUFFER());
}
/*
@@ -3262,23 +3337,27 @@ rb_file_s_absolute_path(int argc, VALUE *argv)
}
static void
-realpath_rec(long *prefixlenp, VALUE *resolvedp, char *unresolved, VALUE loopcheck, int strict, int last)
+realpath_rec(long *prefixlenp, VALUE *resolvedp, const char *unresolved, VALUE loopcheck, int strict, int last)
{
+ const char *pend = unresolved + strlen(unresolved);
+ rb_encoding *enc = rb_enc_get(*resolvedp);
ID resolving;
CONST_ID(resolving, "resolving");
- while (*unresolved) {
- char *testname = unresolved;
- char *unresolved_firstsep = rb_path_next(unresolved);
- long testnamelen = unresolved_firstsep - unresolved;
- char *unresolved_nextname = unresolved_firstsep;
- while (isdirsep(*unresolved_nextname)) unresolved_nextname++;
+ while (unresolved < pend) {
+ const char *testname = unresolved;
+ const char *unresolved_firstsep = rb_enc_path_next(unresolved, pend, enc);
+ long testnamelen = unresolved_firstsep - unresolved;
+ const char *unresolved_nextname = unresolved_firstsep;
+ while (unresolved_nextname < pend && isdirsep(*unresolved_nextname))
+ unresolved_nextname++;
unresolved = unresolved_nextname;
if (testnamelen == 1 && testname[0] == '.') {
}
else if (testnamelen == 2 && testname[0] == '.' && testname[1] == '.') {
if (*prefixlenp < RSTRING_LEN(*resolvedp)) {
- char *resolved_names = RSTRING_PTR(*resolvedp) + *prefixlenp;
- char *lastsep = rb_path_last_separator(resolved_names);
+ const char *resolved_str = RSTRING_PTR(*resolvedp);
+ const char *resolved_names = resolved_str + *prefixlenp;
+ const char *lastsep = strrdirsep(resolved_names, resolved_str + RSTRING_LEN(*resolvedp), enc);
long len = lastsep ? lastsep - resolved_names : 0;
rb_str_resize(*resolvedp, *prefixlenp + len);
}
@@ -3288,12 +3367,19 @@ realpath_rec(long *prefixlenp, VALUE *resolvedp, char *unresolved, VALUE loopche
VALUE testpath = rb_str_dup(*resolvedp);
if (*prefixlenp < RSTRING_LEN(testpath))
rb_str_cat2(testpath, "/");
+#if defined(DOSISH_UNC) || defined(DOSISH_DRIVE_LETTER)
+ if (*prefixlenp > 1 && *prefixlenp == RSTRING_LEN(testpath)) {
+ const char *prefix = RSTRING_PTR(testpath);
+ const char *last = rb_enc_left_char_head(prefix, prefix + *prefixlenp - 1, prefix + *prefixlenp, enc);
+ if (!isdirsep(*last)) rb_str_cat2(testpath, "/");
+ }
+#endif
rb_str_cat(testpath, testname, testnamelen);
checkval = rb_hash_aref(loopcheck, testpath);
if (!NIL_P(checkval)) {
if (checkval == ID2SYM(resolving)) {
errno = ELOOP;
- rb_sys_fail(RSTRING_PTR(testpath));
+ rb_sys_fail_path(testpath);
}
else {
*resolvedp = rb_str_dup(checkval);
@@ -3303,37 +3389,45 @@ realpath_rec(long *prefixlenp, VALUE *resolvedp, char *unresolved, VALUE loopche
struct stat sbuf;
int ret;
VALUE testpath2 = rb_str_encode_ospath(testpath);
+#ifdef __native_client__
+ ret = stat(RSTRING_PTR(testpath2), &sbuf);
+#else
ret = lstat(RSTRING_PTR(testpath2), &sbuf);
+#endif
if (ret == -1) {
if (errno == ENOENT) {
if (strict || !last || *unresolved_firstsep)
- rb_sys_fail(RSTRING_PTR(testpath));
+ rb_sys_fail_path(testpath);
*resolvedp = testpath;
break;
}
else {
- rb_sys_fail(RSTRING_PTR(testpath));
+ rb_sys_fail_path(testpath);
}
}
#ifdef HAVE_READLINK
if (S_ISLNK(sbuf.st_mode)) {
- volatile VALUE link;
- char *link_prefix, *link_names;
+ VALUE link;
+ volatile VALUE link_orig = Qnil;
+ const char *link_prefix, *link_names;
long link_prefixlen;
rb_hash_aset(loopcheck, testpath, ID2SYM(resolving));
- link = rb_file_s_readlink(rb_cFile, testpath);
+ link = rb_readlink(testpath);
link_prefix = RSTRING_PTR(link);
- link_names = skipprefixroot(link_prefix);
- link_prefixlen = link_names - link_prefix;
- if (link_prefixlen == 0) {
- realpath_rec(prefixlenp, resolvedp, link_names, loopcheck, strict, *unresolved_firstsep == '\0');
- }
- else {
- *resolvedp = rb_str_new(link_prefix, link_prefixlen);
- *prefixlenp = link_prefixlen;
- realpath_rec(prefixlenp, resolvedp, link_names, loopcheck, strict, *unresolved_firstsep == '\0');
- }
- rb_hash_aset(loopcheck, testpath, rb_str_dup_frozen(*resolvedp));
+ link_names = skipprefixroot(link_prefix, link_prefix + RSTRING_LEN(link), rb_enc_get(link));
+ link_prefixlen = link_names - link_prefix;
+ if (link_prefixlen > 0) {
+ rb_encoding *enc, *linkenc = rb_enc_get(link);
+ link_orig = link;
+ link = rb_str_subseq(link, 0, link_prefixlen);
+ enc = rb_enc_check(*resolvedp, link);
+ if (enc != linkenc) link = rb_str_conv_enc(link, linkenc, enc);
+ *resolvedp = link;
+ *prefixlenp = link_prefixlen;
+ }
+ realpath_rec(prefixlenp, resolvedp, link_names, loopcheck, strict, *unresolved_firstsep == '\0');
+ RB_GC_GUARD(link_orig);
+ rb_hash_aset(loopcheck, testpath, rb_str_dup_frozen(*resolvedp));
}
else
#endif
@@ -3347,6 +3441,13 @@ realpath_rec(long *prefixlenp, VALUE *resolvedp, char *unresolved, VALUE loopche
}
}
+#ifdef __native_client__
+VALUE
+rb_realpath_internal(VALUE basedir, VALUE path, int strict)
+{
+ return path;
+}
+#else
VALUE
rb_realpath_internal(VALUE basedir, VALUE path, int strict)
{
@@ -3356,8 +3457,10 @@ rb_realpath_internal(VALUE basedir, VALUE path, int strict)
VALUE loopcheck;
volatile VALUE curdir = Qnil;
+ rb_encoding *enc;
char *path_names = NULL, *basedir_names = NULL, *curdir_names = NULL;
- char *ptr, *prefixptr = NULL;
+ char *ptr, *prefixptr = NULL, *pend;
+ long len;
rb_secure(2);
@@ -3369,34 +3472,33 @@ rb_realpath_internal(VALUE basedir, VALUE path, int strict)
basedir = rb_str_dup_frozen(basedir);
}
- ptr = RSTRING_PTR(unresolved_path);
- path_names = skipprefixroot(ptr);
+ RSTRING_GETMEM(unresolved_path, ptr, len);
+ path_names = skipprefixroot(ptr, ptr + len, rb_enc_get(unresolved_path));
if (ptr != path_names) {
- resolved = rb_enc_str_new(ptr, path_names - ptr,
- rb_enc_get(unresolved_path));
+ resolved = rb_str_subseq(unresolved_path, 0, path_names - ptr);
goto root_found;
}
if (!NIL_P(basedir)) {
- ptr = RSTRING_PTR(basedir);
- basedir_names = skipprefixroot(ptr);
+ RSTRING_GETMEM(basedir, ptr, len);
+ basedir_names = skipprefixroot(ptr, ptr + len, rb_enc_get(basedir));
if (ptr != basedir_names) {
- resolved = rb_enc_str_new(ptr, basedir_names - ptr,
- rb_enc_get(basedir));
- goto root_found;
+ resolved = rb_str_subseq(basedir, 0, basedir_names - ptr);
+ goto root_found;
}
}
curdir = rb_dir_getwd();
- ptr = RSTRING_PTR(curdir);
- curdir_names = skipprefixroot(ptr);
- resolved = rb_enc_str_new(ptr, curdir_names - ptr, rb_enc_get(curdir));
+ RSTRING_GETMEM(curdir, ptr, len);
+ curdir_names = skipprefixroot(ptr, ptr + len, rb_enc_get(curdir));
+ resolved = rb_str_subseq(curdir, 0, curdir_names - ptr);
root_found:
- prefixptr = RSTRING_PTR(resolved);
- prefixlen = RSTRING_LEN(resolved);
- ptr = chompdirsep(prefixptr);
- if (*ptr) {
+ RSTRING_GETMEM(resolved, prefixptr, prefixlen);
+ pend = prefixptr + prefixlen;
+ enc = rb_enc_get(resolved);
+ ptr = chompdirsep(prefixptr, pend, enc);
+ if (ptr < pend) {
prefixlen = ++ptr - prefixptr;
rb_str_set_len(resolved, prefixlen);
}
@@ -3405,7 +3507,7 @@ rb_realpath_internal(VALUE basedir, VALUE path, int strict)
if (*prefixptr == FILE_ALT_SEPARATOR) {
*prefixptr = '/';
}
- prefixptr = CharNext(prefixptr);
+ Inc(prefixptr, pend, enc);
}
#endif
@@ -3419,6 +3521,7 @@ rb_realpath_internal(VALUE basedir, VALUE path, int strict)
OBJ_TAINT(resolved);
return resolved;
}
+#endif
/*
* call-seq:
@@ -3462,44 +3565,52 @@ rb_file_s_realdirpath(int argc, VALUE *argv, VALUE klass)
}
static size_t
-rmext(const char *p, long l0, long l1, const char *e)
+rmext(const char *p, long l0, long l1, const char *e, long l2, rb_encoding *enc)
{
- long l2;
+ int len1, len2;
+ unsigned int c;
+ const char *s, *last;
- if (!e) return 0;
+ if (!e || !l2) return 0;
- l2 = strlen(e);
- if (l2 == 2 && e[1] == '*') {
- unsigned char c = *e;
+ c = rb_enc_codepoint_len(e, e + l2, &len1, enc);
+ if (rb_enc_ascget(e + len1, e + l2, &len2, enc) == '*' && len1 + len2 == l2) {
+ if (c == '.') return l0;
+ s = p;
e = p + l1;
- do {
- if (e <= p + l0) return 0;
- } while (*--e != c);
- return e - p;
+ last = e;
+ while (s < e) {
+ if (rb_enc_codepoint_len(s, e, &len1, enc) == c) last = s;
+ s += len1;
+ }
+ return last - p;
}
if (l1 < l2) return l1;
+ s = p+l1-l2;
+ if (rb_enc_left_char_head(p, s, p+l1, enc) != s) return 0;
#if CASEFOLD_FILESYSTEM
#define fncomp strncasecmp
#else
#define fncomp strncmp
#endif
- if (fncomp(p+l1-l2, e, l2) == 0) {
+ if (fncomp(s, e, l2) == 0) {
return l1-l2;
}
return 0;
}
const char *
-ruby_find_basename(const char *name, long *baselen, long *alllen)
+ruby_enc_find_basename(const char *name, long *baselen, long *alllen, rb_encoding *enc)
{
- const char *p, *q, *e;
+ const char *p, *q, *e, *end;
#if defined DOSISH_DRIVE_LETTER || defined DOSISH_UNC
const char *root;
#endif
long f = 0, n = -1;
- name = skipprefix(name);
+ end = name + (alllen ? (size_t)*alllen : strlen(name));
+ name = skipprefix(name, end, enc);
#if defined DOSISH_DRIVE_LETTER || defined DOSISH_UNC
root = name;
#endif
@@ -3526,19 +3637,19 @@ ruby_find_basename(const char *name, long *baselen, long *alllen)
#endif
}
else {
- if (!(p = strrdirsep(name))) {
+ if (!(p = strrdirsep(name, end, enc))) {
p = name;
}
else {
while (isdirsep(*p)) p++; /* skip last / */
}
#if USE_NTFS
- n = ntfs_tail(p) - p;
+ n = ntfs_tail(p, end, enc) - p;
#else
- n = chompdirsep(p) - p;
+ n = chompdirsep(p, end, enc) - p;
#endif
for (q = p; q - p < n && *q == '.'; q++);
- for (e = 0; q - p < n; q = CharNext(q)) {
+ for (e = 0; q - p < n; Inc(q, end, enc)) {
if (*q == '.') e = q;
}
if (e) f = e - p;
@@ -3557,8 +3668,9 @@ ruby_find_basename(const char *name, long *baselen, long *alllen)
* File.basename(file_name [, suffix] ) -> base_name
*
* Returns the last component of the filename given in <i>file_name</i>,
- * which must be formed using forward slashes (``<code>/</code>'')
- * regardless of the separator used on the local file system. If
+ * which can be formed using both <code>File::SEPARATOR</code> and
+ * <code>File::ALT_SEPARETOR</code> as the separator when
+ * <code>File::ALT_SEPARATOR</code> is not <code>nil</code>. If
* <i>suffix</i> is given and present at the end of <i>file_name</i>,
* it is removed.
*
@@ -3572,25 +3684,33 @@ rb_file_s_basename(int argc, VALUE *argv)
VALUE fname, fext, basename;
const char *name, *p;
long f, n;
+ rb_encoding *enc;
if (rb_scan_args(argc, argv, "11", &fname, &fext) == 2) {
- rb_encoding *enc;
StringValue(fext);
- if (!rb_enc_asciicompat(enc = rb_enc_get(fext))) {
- rb_raise(rb_eEncCompatError, "ascii incompatible character encodings: %s",
- rb_enc_name(enc));
- }
+ enc = check_path_encoding(fext);
}
FilePathStringValue(fname);
- if (!NIL_P(fext)) rb_enc_check(fname, fext);
- if (RSTRING_LEN(fname) == 0 || !*(name = RSTRING_PTR(fname)))
+ if (NIL_P(fext) || !(enc = rb_enc_compatible(fname, fext))) {
+ enc = rb_enc_get(fname);
+ fext = Qnil;
+ }
+ if ((n = RSTRING_LEN(fname)) == 0 || !*(name = RSTRING_PTR(fname)))
return rb_str_new_shared(fname);
- p = ruby_find_basename(name, &f, &n);
+ p = ruby_enc_find_basename(name, &f, &n, enc);
if (n >= 0) {
- if (NIL_P(fext) || !(f = rmext(p, f, n, StringValueCStr(fext)))) {
+ if (NIL_P(fext)) {
f = n;
}
+ else {
+ const char *fp;
+ fp = StringValueCStr(fext);
+ if (!(f = rmext(p, f, n, fp, RSTRING_LEN(fext), enc))) {
+ f = n;
+ }
+ RB_GC_GUARD(fext);
+ }
if (f == RSTRING_LEN(fname)) return rb_str_new_shared(fname);
}
@@ -3605,9 +3725,9 @@ rb_file_s_basename(int argc, VALUE *argv)
* File.dirname(file_name ) -> dir_name
*
* Returns all components of the filename given in <i>file_name</i>
- * except the last one. The filename must be formed using forward
- * slashes (``<code>/</code>'') regardless of the separator used on the
- * local file system.
+ * except the last one. The filename can be formed using both
+ * <code>File::SEPARATOR</code> and <code>File::ALT_SEPARETOR</code> as the
+ * separator when <code>File::ALT_SEPARATOR</code> is not <code>nil</code>.
*
* File.dirname("/home/gumby/work/ruby.rb") #=> "/home/gumby/work"
*/
@@ -3621,20 +3741,23 @@ rb_file_s_dirname(VALUE klass, VALUE fname)
VALUE
rb_file_dirname(VALUE fname)
{
- const char *name, *root, *p;
+ const char *name, *root, *p, *end;
VALUE dirname;
+ rb_encoding *enc;
FilePathStringValue(fname);
name = StringValueCStr(fname);
- root = skiproot(name);
+ end = name + RSTRING_LEN(fname);
+ enc = rb_enc_get(fname);
+ root = skiproot(name, end, enc);
#ifdef DOSISH_UNC
if (root > name + 1 && isdirsep(*name))
- root = skipprefix(name = root - 2);
+ root = skipprefix(name = root - 2, end, enc);
#else
if (root > name + 1)
name = root - 1;
#endif
- p = strrdirsep(root);
+ p = strrdirsep(root, end, enc);
if (!p) {
p = root;
}
@@ -3642,7 +3765,7 @@ rb_file_dirname(VALUE fname)
return rb_usascii_str_new2(".");
#ifdef DOSISH_DRIVE_LETTER
if (has_drive_letter(name) && isdirsep(*(name + 2))) {
- const char *top = skiproot(name + 2);
+ const char *top = skiproot(name + 2, end, enc);
dirname = rb_str_new(name, 3);
rb_str_cat(dirname, top, p - top);
}
@@ -3671,11 +3794,11 @@ rb_file_dirname(VALUE fname)
*
*/
const char *
-ruby_find_extname(const char *name, long *len)
+ruby_enc_find_extname(const char *name, long *len, rb_encoding *enc)
{
- const char *p, *e;
+ const char *p, *e, *end = name + (len ? *len : (long)strlen(name));
- p = strrdirsep(name); /* get the last path component */
+ p = strrdirsep(name, end, enc); /* get the last path component */
if (!p)
p = name;
else
@@ -3708,7 +3831,7 @@ ruby_find_extname(const char *name, long *len)
#endif
else if (isdirsep(*p))
break;
- p = CharNext(p);
+ Inc(p, end, enc);
}
if (len) {
@@ -3727,13 +3850,21 @@ ruby_find_extname(const char *name, long *len)
* call-seq:
* File.extname(path) -> string
*
- * Returns the extension (the portion of file name in <i>path</i>
- * after the period).
+ * Returns the extension (the portion of file name in +path+
+ * starting from the last period).
+ *
+ * If +path+ is a dotfile, or starts with a period, then the starting
+ * dot is not dealt with the start of the extension.
+ *
+ * An empty string will also be returned when the period is the last character
+ * in +path+.
*
* File.extname("test.rb") #=> ".rb"
* File.extname("a/b/d/test.rb") #=> ".rb"
+ * File.extname("foo.") #=> ""
* File.extname("test") #=> ""
* File.extname(".profile") #=> ""
+ * File.extname(".profile.sh") #=> ".sh"
*
*/
@@ -3746,11 +3877,11 @@ rb_file_s_extname(VALUE klass, VALUE fname)
FilePathStringValue(fname);
name = StringValueCStr(fname);
- e = ruby_find_extname(name, &len);
+ len = RSTRING_LEN(fname);
+ e = ruby_enc_find_extname(name, &len, rb_enc_get(fname));
if (len <= 1)
return rb_str_new(0, 0);
- extname = rb_str_new(e, len); /* keep the dot, too! */
- rb_enc_copy(extname, fname);
+ extname = rb_str_subseq(fname, e - name, len); /* keep the dot, too! */
OBJ_INFECT(extname, fname);
return extname;
}
@@ -3808,13 +3939,16 @@ rb_file_join(VALUE ary, VALUE sep)
long len, i;
VALUE result, tmp;
const char *name, *tail;
+ int checked = TRUE;
if (RARRAY_LEN(ary) == 0) return rb_str_new(0, 0);
len = 1;
for (i=0; i<RARRAY_LEN(ary); i++) {
- if (TYPE(RARRAY_PTR(ary)[i]) == T_STRING) {
- len += RSTRING_LEN(RARRAY_PTR(ary)[i]);
+ tmp = RARRAY_PTR(ary)[i];
+ if (RB_TYPE_P(tmp, T_STRING)) {
+ check_path_encoding(tmp);
+ len += RSTRING_LEN(tmp);
}
else {
len += 10;
@@ -3822,14 +3956,17 @@ rb_file_join(VALUE ary, VALUE sep)
}
if (!NIL_P(sep)) {
StringValue(sep);
- len += RSTRING_LEN(sep) * RARRAY_LEN(ary) - 1;
+ len += RSTRING_LEN(sep) * (RARRAY_LEN(ary) - 1);
}
result = rb_str_buf_new(len);
+ RBASIC(result)->klass = 0;
OBJ_INFECT(result, ary);
for (i=0; i<RARRAY_LEN(ary); i++) {
tmp = RARRAY_PTR(ary)[i];
switch (TYPE(tmp)) {
case T_STRING:
+ if (!checked) check_path_encoding(tmp);
+ StringValueCStr(tmp);
break;
case T_ARRAY:
if (ary == tmp) {
@@ -3845,10 +3982,14 @@ rb_file_join(VALUE ary, VALUE sep)
break;
default:
FilePathStringValue(tmp);
+ checked = FALSE;
}
- name = StringValueCStr(result);
- if (i > 0 && !NIL_P(sep)) {
- tail = chompdirsep(name);
+ RSTRING_GETMEM(result, name, len);
+ if (i == 0) {
+ rb_enc_copy(result, tmp);
+ }
+ else if (!NIL_P(sep)) {
+ tail = chompdirsep(name, name + len, rb_enc_get(result));
if (RSTRING_PTR(tmp) && isdirsep(RSTRING_PTR(tmp)[0])) {
rb_str_set_len(result, tail - name);
}
@@ -3858,6 +3999,7 @@ rb_file_join(VALUE ary, VALUE sep)
}
rb_str_buf_append(result, tmp);
}
+ RBASIC(result)->klass = rb_cString;
return result;
}
@@ -3906,18 +4048,18 @@ rb_file_s_truncate(VALUE klass, VALUE path, VALUE len)
path = rb_str_encode_ospath(path);
#ifdef HAVE_TRUNCATE
if (truncate(StringValueCStr(path), pos) < 0)
- rb_sys_fail(RSTRING_PTR(path));
+ rb_sys_fail_path(path);
#else /* defined(HAVE_CHSIZE) */
{
int tmpfd;
- if ((tmpfd = open(StringValueCStr(path), 0)) < 0) {
- rb_sys_fail(RSTRING_PTR(path));
+ if ((tmpfd = rb_cloexec_open(StringValueCStr(path), 0, 0)) < 0) {
+ rb_sys_fail_path(path);
}
rb_update_max_fd(tmpfd);
if (chsize(tmpfd, pos) < 0) {
close(tmpfd);
- rb_sys_fail(RSTRING_PTR(path));
+ rb_sys_fail_path(path);
}
close(tmpfd);
}
@@ -4095,15 +4237,10 @@ test_check(int n, int argc, VALUE *argv)
rb_secure(2);
n+=1;
- if (n != argc) rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", argc, n);
+ rb_check_arity(argc, n, n);
for (i=1; i<n; i++) {
- switch (TYPE(argv[i])) {
- case T_STRING:
- default:
+ if (!RB_TYPE_P(argv[i], T_FILE)) {
FilePathValue(argv[i]);
- break;
- case T_FILE:
- break;
}
}
}
@@ -4114,9 +4251,8 @@ test_check(int n, int argc, VALUE *argv)
* call-seq:
* test(int_cmd, file1 [, file2] ) -> obj
*
- * Uses the integer <i>aCmd</i> to perform various tests on
- * <i>file1</i> (first table below) or on <i>file1</i> and
- * <i>file2</i> (second table).
+ * Uses the integer +int_cmd+ to perform various tests on +file1+ (first
+ * table below) or on +file1+ and +file2+ (second table).
*
* File tests on a single file:
*
@@ -4158,7 +4294,7 @@ test_check(int n, int argc, VALUE *argv)
* | | the real uid/gid
* "z" | boolean | True if file1 exists and has a zero length
*
- * Tests that take two files:
+ * Tests that take two files:
*
* "-" | boolean | True if file1 and file2 are identical
* "=" | boolean | True if the modification times of file1
@@ -4174,9 +4310,18 @@ rb_f_test(int argc, VALUE *argv)
{
int cmd;
- if (argc == 0) rb_raise(rb_eArgError, "wrong number of arguments (0 for 2..3)");
+ if (argc == 0) rb_check_arity(argc, 2, 3);
cmd = NUM2CHR(argv[0]);
- if (cmd == 0) goto unknown;
+ if (cmd == 0) {
+ unknown:
+ /* unknown command */
+ if (ISPRINT(cmd)) {
+ rb_raise(rb_eArgError, "unknown command '%s%c'", cmd == '\'' || cmd == '\\' ? "\\" : "", cmd);
+ }
+ else {
+ rb_raise(rb_eArgError, "unknown command \"\\x%02X\"", cmd);
+ }
+ }
if (strchr("bcdefgGkloOprRsSuwWxXz", cmd)) {
CHECK(1);
switch (cmd) {
@@ -4256,7 +4401,7 @@ rb_f_test(int argc, VALUE *argv)
CHECK(1);
if (rb_stat(fname, &st) == -1) {
FilePathValue(fname);
- rb_sys_fail(RSTRING_PTR(fname));
+ rb_sys_fail_path(fname);
}
switch (cmd) {
@@ -4295,15 +4440,7 @@ rb_f_test(int argc, VALUE *argv)
return Qfalse;
}
}
- unknown:
- /* unknown command */
- if (ISPRINT(cmd)) {
- rb_raise(rb_eArgError, "unknown command '%s%c'", cmd == '\'' || cmd == '\\' ? "\\" : "", cmd);
- }
- else {
- rb_raise(rb_eArgError, "unknown command \"\\x%02X\"", cmd);
- }
- return Qnil; /* not reached */
+ goto unknown;
}
@@ -4345,7 +4482,7 @@ rb_stat_init(VALUE obj, VALUE fname)
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (STAT(StringValueCStr(fname), &st) == -1) {
- rb_sys_fail(RSTRING_PTR(fname));
+ rb_sys_fail_path(fname);
}
if (DATA_PTR(obj)) {
xfree(DATA_PTR(obj));
@@ -4364,12 +4501,7 @@ rb_stat_init_copy(VALUE copy, VALUE orig)
{
struct stat *nst;
- if (copy == orig) return orig;
- rb_check_frozen(copy);
- /* need better argument type check */
- if (!rb_obj_is_instance_of(orig, rb_obj_class(copy))) {
- rb_raise(rb_eTypeError, "wrong argument class");
- }
+ if (!OBJ_INIT_COPY(copy, orig)) return copy;
if (DATA_PTR(copy)) {
xfree(DATA_PTR(copy));
DATA_PTR(copy) = 0;
@@ -4984,6 +5116,8 @@ path_check_0(VALUE path, int execpath)
{
struct stat st;
const char *p0 = StringValueCStr(path);
+ const char *e0;
+ rb_encoding *enc;
char *p = 0, *s;
if (!rb_is_absolute_path(p0)) {
@@ -4998,6 +5132,8 @@ path_check_0(VALUE path, int execpath)
path = newpath;
p0 = RSTRING_PTR(path);
}
+ e0 = p0 + RSTRING_LEN(path);
+ enc = rb_enc_get(path);
for (;;) {
#ifndef S_IWOTH
# define S_IWOTH 002
@@ -5014,10 +5150,11 @@ path_check_0(VALUE path, int execpath)
RB_GC_GUARD(path);
return 0;
}
- s = strrdirsep(p0);
+ s = strrdirsep(p0, e0, enc);
if (p) *p = '/';
if (!s || s == p0) return 1;
p = s;
+ e0 = p;
*p = '\0';
}
}
@@ -5056,11 +5193,15 @@ rb_path_check(const char *path)
return 1;
}
-static int
-file_load_ok(const char *path)
+#ifndef _WIN32
+#ifdef __native_client__
+__attribute__((noinline))
+#endif
+int
+rb_file_load_ok(const char *path)
{
int ret = 1;
- int fd = open(path, O_RDONLY);
+ int fd = rb_cloexec_open(path, O_RDONLY, 0);
if (fd == -1) return 0;
rb_update_max_fd(fd);
#if !defined DOSISH
@@ -5074,12 +5215,7 @@ file_load_ok(const char *path)
(void)close(fd);
return ret;
}
-
-int
-rb_file_load_ok(const char *path)
-{
- return file_load_ok(path);
-}
+#endif
static int
is_explicit_relative(const char *path)
@@ -5131,7 +5267,7 @@ rb_find_file_ext_safe(VALUE *filep, const char *const *ext, int safe_level)
fnlen = RSTRING_LEN(fname);
for (i=0; ext[i]; i++) {
rb_str_cat2(fname, ext[i]);
- if (file_load_ok(RSTRING_PTR(fname))) {
+ if (rb_file_load_ok(RSTRING_PTR(fname))) {
*filep = copy_path_class(fname, *filep);
return (int)(i+1);
}
@@ -5144,13 +5280,14 @@ rb_find_file_ext_safe(VALUE *filep, const char *const *ext, int safe_level)
rb_raise(rb_eSecurityError, "loading from non-absolute path %s", f);
}
- RB_GC_GUARD(load_path) = rb_get_load_path();
+ RB_GC_GUARD(load_path) = rb_get_expanded_load_path();
if (!load_path) return 0;
fname = rb_str_dup(*filep);
RBASIC(fname)->klass = 0;
fnlen = RSTRING_LEN(fname);
tmp = rb_str_tmp_new(MAXPATHLEN + 2);
+ rb_enc_associate_index(tmp, rb_usascii_encindex());
for (j=0; ext[j]; j++) {
rb_str_cat2(fname, ext[j]);
for (i = 0; i < RARRAY_LEN(load_path); i++) {
@@ -5158,8 +5295,8 @@ rb_find_file_ext_safe(VALUE *filep, const char *const *ext, int safe_level)
RB_GC_GUARD(str) = rb_get_path_check(str, safe_level);
if (RSTRING_LEN(str) == 0) continue;
- file_expand_path(fname, str, 0, tmp);
- if (file_load_ok(RSTRING_PTR(tmp))) {
+ rb_file_expand_path_internal(fname, str, 0, 0, tmp);
+ if (rb_file_load_ok(RSTRING_PTR(tmp))) {
*filep = copy_path_class(tmp, *filep);
return (int)(j+1);
}
@@ -5198,7 +5335,7 @@ rb_find_file_safe(VALUE path, int safe_level)
if (safe_level >= 1 && !fpath_check(path)) {
rb_raise(rb_eSecurityError, "loading from unsafe path %s", f);
}
- if (!file_load_ok(f)) return 0;
+ if (!rb_file_load_ok(f)) return 0;
if (!expanded)
path = copy_path_class(file_expand_path_1(path), path);
return path;
@@ -5208,18 +5345,19 @@ rb_find_file_safe(VALUE path, int safe_level)
rb_raise(rb_eSecurityError, "loading from non-absolute path %s", f);
}
- RB_GC_GUARD(load_path) = rb_get_load_path();
+ RB_GC_GUARD(load_path) = rb_get_expanded_load_path();
if (load_path) {
long i;
tmp = rb_str_tmp_new(MAXPATHLEN + 2);
+ rb_enc_associate_index(tmp, rb_usascii_encindex());
for (i = 0; i < RARRAY_LEN(load_path); i++) {
VALUE str = RARRAY_PTR(load_path)[i];
RB_GC_GUARD(str) = rb_get_path_check(str, safe_level);
if (RSTRING_LEN(str) > 0) {
- file_expand_path(path, str, 0, tmp);
+ rb_file_expand_path_internal(path, str, 0, 0, tmp);
f = RSTRING_PTR(tmp);
- if (file_load_ok(f)) goto found;
+ if (rb_file_load_ok(f)) goto found;
}
}
return 0;
@@ -5383,14 +5521,88 @@ Init_File(void)
rb_define_method(rb_cFile, "flock", rb_file_flock, 1);
+ /*
+ * Document-module: File::Constants
+ *
+ * File::Constants provides file-related constants. All possible
+ * file constants are listed in the documentation but they may not all
+ * be present on your platform.
+ *
+ * If the underlying platform doesn't define a constant the corresponding
+ * Ruby constant is not defined.
+ *
+ * Your platform documentations (e.g. man open(2)) may describe more
+ * detailed information.
+ */
rb_mFConst = rb_define_module_under(rb_cFile, "Constants");
rb_include_module(rb_cIO, rb_mFConst);
- rb_file_const("LOCK_SH", INT2FIX(LOCK_SH));
- rb_file_const("LOCK_EX", INT2FIX(LOCK_EX));
- rb_file_const("LOCK_UN", INT2FIX(LOCK_UN));
- rb_file_const("LOCK_NB", INT2FIX(LOCK_NB));
- rb_file_const("NULL", rb_obj_freeze(rb_usascii_str_new2(null_device)));
+ /* open for reading only */
+ rb_define_const(rb_mFConst, "RDONLY", INT2FIX(O_RDONLY));
+ /* open for writing only */
+ rb_define_const(rb_mFConst, "WRONLY", INT2FIX(O_WRONLY));
+ /* open for reading and writing */
+ rb_define_const(rb_mFConst, "RDWR", INT2FIX(O_RDWR));
+ /* append on each write */
+ rb_define_const(rb_mFConst, "APPEND", INT2FIX(O_APPEND));
+ /* create file if it does not exist */
+ rb_define_const(rb_mFConst, "CREAT", INT2FIX(O_CREAT));
+ /* error if CREAT and the file exists */
+ rb_define_const(rb_mFConst, "EXCL", INT2FIX(O_EXCL));
+#if defined(O_NDELAY) || defined(O_NONBLOCK)
+# ifndef O_NONBLOCK
+# define O_NONBLOCK O_NDELAY
+# endif
+ /* do not block on open or for data to become available */
+ rb_define_const(rb_mFConst, "NONBLOCK", INT2FIX(O_NONBLOCK));
+#endif
+ /* truncate size to 0 */
+ rb_define_const(rb_mFConst, "TRUNC", INT2FIX(O_TRUNC));
+#ifdef O_NOCTTY
+ /* not to make opened IO the controlling terminal device */
+ rb_define_const(rb_mFConst, "NOCTTY", INT2FIX(O_NOCTTY));
+#endif
+#ifndef O_BINARY
+# define O_BINARY 0
+#endif
+ /* disable line code conversion */
+ rb_define_const(rb_mFConst, "BINARY", INT2FIX(O_BINARY));
+#ifdef O_SYNC
+ /* any write operation perform synchronously */
+ rb_define_const(rb_mFConst, "SYNC", INT2FIX(O_SYNC));
+#endif
+#ifdef O_DSYNC
+ /* any write operation perform synchronously except some meta data */
+ rb_define_const(rb_mFConst, "DSYNC", INT2FIX(O_DSYNC));
+#endif
+#ifdef O_RSYNC
+ /* any read operation perform synchronously. used with SYNC or DSYNC. */
+ rb_define_const(rb_mFConst, "RSYNC", INT2FIX(O_RSYNC));
+#endif
+#ifdef O_NOFOLLOW
+ /* do not follow symlinks */
+ rb_define_const(rb_mFConst, "NOFOLLOW", INT2FIX(O_NOFOLLOW)); /* FreeBSD, Linux */
+#endif
+#ifdef O_NOATIME
+ /* do not change atime */
+ rb_define_const(rb_mFConst, "NOATIME", INT2FIX(O_NOATIME)); /* Linux */
+#endif
+#ifdef O_DIRECT
+ /* Try to minimize cache effects of the I/O to and from this file. */
+ rb_define_const(rb_mFConst, "DIRECT", INT2FIX(O_DIRECT));
+#endif
+
+ /* shared lock. see File#flock */
+ rb_define_const(rb_mFConst, "LOCK_SH", INT2FIX(LOCK_SH));
+ /* exclusive lock. see File#flock */
+ rb_define_const(rb_mFConst, "LOCK_EX", INT2FIX(LOCK_EX));
+ /* unlock. see File#flock */
+ rb_define_const(rb_mFConst, "LOCK_UN", INT2FIX(LOCK_UN));
+ /* non-blocking lock. used with LOCK_SH or LOCK_EX. see File#flock */
+ rb_define_const(rb_mFConst, "LOCK_NB", INT2FIX(LOCK_NB));
+
+ /* Name of the null device */
+ rb_define_const(rb_mFConst, "NULL", rb_obj_freeze(rb_usascii_str_new2(null_device)));
rb_define_method(rb_cFile, "path", rb_file_path, 0);
rb_define_method(rb_cFile, "to_path", rb_file_path, 0);
@@ -5452,4 +5664,8 @@ Init_File(void)
rb_define_method(rb_cStat, "setuid?", rb_stat_suid, 0);
rb_define_method(rb_cStat, "setgid?", rb_stat_sgid, 0);
rb_define_method(rb_cStat, "sticky?", rb_stat_sticky, 0);
+
+#ifdef _WIN32
+ rb_w32_init_file();
+#endif
}
diff --git a/gc.c b/gc.c
index 8c33323e9b..9e2da52ffc 100644
--- a/gc.c
+++ b/gc.c
@@ -15,15 +15,19 @@
#include "ruby/st.h"
#include "ruby/re.h"
#include "ruby/io.h"
+#include "ruby/thread.h"
#include "ruby/util.h"
#include "eval_intern.h"
#include "vm_core.h"
#include "internal.h"
#include "gc.h"
#include "constant.h"
+#include "ruby_atomic.h"
+#include "probes.h"
#include <stdio.h>
#include <setjmp.h>
#include <sys/types.h>
+#include <assert.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
@@ -32,9 +36,18 @@
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
+#if defined(__native_client__) && defined(NACL_NEWLIB)
+# include "nacl/resource.h"
+# undef HAVE_POSIX_MEMALIGN
+# undef HAVE_MEMALIGN
+
+#endif
#if defined _WIN32 || defined __CYGWIN__
#include <windows.h>
+#elif defined(HAVE_POSIX_MEMALIGN)
+#elif defined(HAVE_MEMALIGN)
+#include <malloc.h>
#endif
#ifdef HAVE_VALGRIND_MEMCHECK_H
@@ -46,211 +59,67 @@
# define VALGRIND_MAKE_MEM_UNDEFINED(p, n) VALGRIND_MAKE_WRITABLE((p), (n))
# endif
#else
-# define VALGRIND_MAKE_MEM_DEFINED(p, n) /* empty */
-# define VALGRIND_MAKE_MEM_UNDEFINED(p, n) /* empty */
+# define VALGRIND_MAKE_MEM_DEFINED(p, n) 0
+# define VALGRIND_MAKE_MEM_UNDEFINED(p, n) 0
#endif
#define rb_setjmp(env) RUBY_SETJMP(env)
#define rb_jmp_buf rb_jmpbuf_t
-/* Make alloca work the best possible way. */
-#ifdef __GNUC__
-# ifndef atarist
-# ifndef alloca
-# define alloca __builtin_alloca
-# endif
-# endif /* atarist */
-#else
-# ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-# else
-# ifdef _AIX
- #pragma alloca
-# else
-# ifndef alloca /* predefined by HP cc +Olibcalls */
-void *alloca ();
-# endif
-# endif /* AIX */
-# endif /* HAVE_ALLOCA_H */
-#endif /* __GNUC__ */
-
#ifndef GC_MALLOC_LIMIT
#define GC_MALLOC_LIMIT 8000000
#endif
#define HEAP_MIN_SLOTS 10000
#define FREE_MIN 4096
-static unsigned int initial_malloc_limit = GC_MALLOC_LIMIT;
+typedef struct {
+ unsigned int initial_malloc_limit;
+ unsigned int initial_heap_min_slots;
+ unsigned int initial_free_min;
#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
-static unsigned int initial_heap_min_slots = HEAP_MIN_SLOTS;
+ int gc_stress;
#endif
-static unsigned int initial_free_min = FREE_MIN;
-
-#define nomem_error GET_VM()->special_exceptions[ruby_error_nomemory]
+} ruby_gc_params_t;
-#define MARK_STACK_MAX 1024
+static ruby_gc_params_t initial_params = {
+ GC_MALLOC_LIMIT,
+ HEAP_MIN_SLOTS,
+ FREE_MIN,
+#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
+ FALSE,
+#endif
+};
-int ruby_gc_debug_indent = 0;
+#define nomem_error GET_VM()->special_exceptions[ruby_error_nomemory]
-/* for GC profile */
+#ifndef GC_PROFILE_MORE_DETAIL
#define GC_PROFILE_MORE_DETAIL 0
+#endif
+
typedef struct gc_profile_record {
double gc_time;
- double gc_mark_time;
- double gc_sweep_time;
double gc_invoke_time;
- size_t heap_use_slots;
- size_t heap_live_objects;
- size_t heap_free_objects;
size_t heap_total_objects;
size_t heap_use_size;
size_t heap_total_size;
- int have_finalize;
int is_marked;
- size_t allocate_increase;
- size_t allocate_limit;
-} gc_profile_record;
-
-static double
-getrusage_time(void)
-{
-#ifdef RUSAGE_SELF
- struct rusage usage;
- struct timeval time;
- getrusage(RUSAGE_SELF, &usage);
- time = usage.ru_utime;
- return time.tv_sec + time.tv_usec * 1e-6;
-#elif defined _WIN32
- FILETIME creation_time, exit_time, kernel_time, user_time;
- ULARGE_INTEGER ui;
- LONG_LONG q;
- double t;
+#if GC_PROFILE_MORE_DETAIL
+ double gc_mark_time;
+ double gc_sweep_time;
- if (GetProcessTimes(GetCurrentProcess(),
- &creation_time, &exit_time, &kernel_time, &user_time) == 0)
- {
- return 0.0;
- }
- memcpy(&ui, &user_time, sizeof(FILETIME));
- q = ui.QuadPart / 10L;
- t = (DWORD)(q % 1000000L) * 1e-6;
- q /= 1000000L;
-#ifdef __GNUC__
- t += q;
-#else
- t += (double)(DWORD)(q >> 16) * (1 << 16);
- t += (DWORD)q & ~(~0 << 16);
-#endif
- return t;
-#else
- return 0.0;
-#endif
-}
+ size_t heap_use_slots;
+ size_t heap_live_objects;
+ size_t heap_free_objects;
-#define GC_PROF_TIMER_START do {\
- if (objspace->profile.run) {\
- if (!objspace->profile.record) {\
- objspace->profile.size = 1000;\
- objspace->profile.record = malloc(sizeof(gc_profile_record) * objspace->profile.size);\
- }\
- if (count >= objspace->profile.size) {\
- objspace->profile.size += 1000;\
- objspace->profile.record = realloc(objspace->profile.record, sizeof(gc_profile_record) * objspace->profile.size);\
- }\
- if (!objspace->profile.record) {\
- rb_bug("gc_profile malloc or realloc miss");\
- }\
- MEMZERO(&objspace->profile.record[count], gc_profile_record, 1);\
- gc_time = getrusage_time();\
- objspace->profile.record[count].gc_invoke_time = gc_time - objspace->profile.invoke_time;\
- }\
- } while(0)
-
-#define GC_PROF_TIMER_STOP(marked) do {\
- if (objspace->profile.run) {\
- gc_time = getrusage_time() - gc_time;\
- if (gc_time < 0) gc_time = 0;\
- objspace->profile.record[count].gc_time = gc_time;\
- objspace->profile.record[count].is_marked = !!(marked);\
- GC_PROF_SET_HEAP_INFO(objspace->profile.record[count]);\
- objspace->profile.count++;\
- }\
- } while(0)
+ int have_finalize;
-#if GC_PROFILE_MORE_DETAIL
-#define INIT_GC_PROF_PARAMS double gc_time = 0, sweep_time = 0;\
- size_t count = objspace->profile.count, total = 0, live = 0
-
-#define GC_PROF_MARK_TIMER_START double mark_time = 0;\
- do {\
- if (objspace->profile.run) {\
- mark_time = getrusage_time();\
- }\
- } while(0)
-
-#define GC_PROF_MARK_TIMER_STOP do {\
- if (objspace->profile.run) {\
- mark_time = getrusage_time() - mark_time;\
- if (mark_time < 0) mark_time = 0;\
- objspace->profile.record[objspace->profile.count].gc_mark_time = mark_time;\
- }\
- } while(0)
-
-#define GC_PROF_SWEEP_TIMER_START do {\
- if (objspace->profile.run) {\
- sweep_time = getrusage_time();\
- }\
- } while(0)
-
-#define GC_PROF_SWEEP_TIMER_STOP do {\
- if (objspace->profile.run) {\
- sweep_time = getrusage_time() - sweep_time;\
- if (sweep_time < 0) sweep_time = 0;\
- objspace->profile.record[count].gc_sweep_time = sweep_time;\
- }\
- } while(0)
-#define GC_PROF_SET_MALLOC_INFO do {\
- if (objspace->profile.run) {\
- gc_profile_record *record = &objspace->profile.record[objspace->profile.count];\
- record->allocate_increase = malloc_increase;\
- record->allocate_limit = malloc_limit; \
- }\
- } while(0)
-#define GC_PROF_SET_HEAP_INFO(record) do {\
- live = objspace->heap.live_num;\
- total = heaps_used * HEAP_OBJ_LIMIT;\
- (record).heap_use_slots = heaps_used;\
- (record).heap_live_objects = live;\
- (record).heap_free_objects = total - live;\
- (record).heap_total_objects = total;\
- (record).have_finalize = deferred_final_list ? Qtrue : Qfalse;\
- (record).heap_use_size = live * sizeof(RVALUE);\
- (record).heap_total_size = total * sizeof(RVALUE);\
- } while(0)
-#define GC_PROF_INC_LIVE_NUM objspace->heap.live_num++
-#define GC_PROF_DEC_LIVE_NUM objspace->heap.live_num--
-#else
-#define INIT_GC_PROF_PARAMS double gc_time = 0;\
- size_t count = objspace->profile.count, total = 0, live = 0
-#define GC_PROF_MARK_TIMER_START
-#define GC_PROF_MARK_TIMER_STOP
-#define GC_PROF_SWEEP_TIMER_START
-#define GC_PROF_SWEEP_TIMER_STOP
-#define GC_PROF_SET_MALLOC_INFO
-#define GC_PROF_SET_HEAP_INFO(record) do {\
- live = objspace->heap.live_num;\
- total = heaps_used * HEAP_OBJ_LIMIT;\
- (record).heap_total_objects = total;\
- (record).heap_use_size = live * sizeof(RVALUE);\
- (record).heap_total_size = total * sizeof(RVALUE);\
- } while(0)
-#define GC_PROF_INC_LIVE_NUM
-#define GC_PROF_DEC_LIVE_NUM
+ size_t allocate_increase;
+ size_t allocate_limit;
#endif
-
+} gc_profile_record;
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CYGWIN__)
#pragma pack(push, 1) /* magic for reducing sizeof(RVALUE): 24 -> 20 */
@@ -291,17 +160,24 @@ typedef struct RVALUE {
#endif
struct heaps_slot {
- void *membase;
- RVALUE *slot;
- size_t limit;
+ struct heaps_header *header;
+ uintptr_t *bits;
+ RVALUE *freelist;
struct heaps_slot *next;
struct heaps_slot *prev;
+ struct heaps_slot *free_next;
};
-struct sorted_heaps_slot {
+struct heaps_header {
+ struct heaps_slot *base;
+ uintptr_t *bits;
RVALUE *start;
RVALUE *end;
- struct heaps_slot *slot;
+ size_t limit;
+};
+
+struct heaps_free_bitmap {
+ struct heaps_free_bitmap *next;
};
struct gc_list {
@@ -309,7 +185,25 @@ struct gc_list {
struct gc_list *next;
};
+#define STACK_CHUNK_SIZE 500
+
+typedef struct stack_chunk {
+ VALUE data[STACK_CHUNK_SIZE];
+ struct stack_chunk *next;
+} stack_chunk_t;
+
+typedef struct mark_stack {
+ stack_chunk_t *chunk;
+ stack_chunk_t *cache;
+ size_t index;
+ size_t limit;
+ size_t cache_size;
+ size_t unused_cache_size;
+} mark_stack_t;
+
+#ifndef CALC_EXACT_MALLOC_SIZE
#define CALC_EXACT_MALLOC_SIZE 0
+#endif
typedef struct rb_objspace {
struct {
@@ -324,13 +218,13 @@ typedef struct rb_objspace {
size_t increment;
struct heaps_slot *ptr;
struct heaps_slot *sweep_slots;
- struct sorted_heaps_slot *sorted;
+ struct heaps_slot *free_slots;
+ struct heaps_header **sorted;
size_t length;
size_t used;
- RVALUE *freelist;
+ struct heaps_free_bitmap *free_bitmap;
RVALUE *range[2];
- RVALUE *freed;
- size_t live_num;
+ struct heaps_header *freed;
size_t free_num;
size_t free_min;
size_t final_num;
@@ -340,16 +234,13 @@ typedef struct rb_objspace {
int dont_gc;
int dont_lazy_sweep;
int during_gc;
+ rb_atomic_t finalizing;
} flags;
struct {
st_table *table;
RVALUE *deferred;
} final;
- struct {
- VALUE buffer[MARK_STACK_MAX];
- VALUE *ptr;
- int overflow;
- } markstack;
+ mark_stack_t mark_stack;
struct {
int run;
gc_profile_record *record;
@@ -359,15 +250,22 @@ typedef struct rb_objspace {
} profile;
struct gc_list *global_list;
size_t count;
+ size_t total_allocated_object_num;
+ size_t total_freed_object_num;
int gc_stress;
+
+ struct mark_func_data_struct {
+ void *data;
+ void (*mark_func)(VALUE v, void *data);
+ } *mark_func_data;
} rb_objspace_t;
#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
#define rb_objspace (*GET_VM()->objspace)
-static int ruby_initial_gc_stress = 0;
+#define ruby_initial_gc_stress initial_params.gc_stress
int *ruby_initial_gc_stress_ptr = &ruby_initial_gc_stress;
#else
-static rb_objspace_t rb_objspace = {{GC_MALLOC_LIMIT}, {HEAP_MIN_SLOTS}};
+static rb_objspace_t rb_objspace = {{GC_MALLOC_LIMIT}};
int *ruby_initial_gc_stress_ptr = &rb_objspace.gc_stress;
#endif
#define malloc_limit objspace->malloc_params.limit
@@ -375,22 +273,91 @@ int *ruby_initial_gc_stress_ptr = &rb_objspace.gc_stress;
#define heaps objspace->heap.ptr
#define heaps_length objspace->heap.length
#define heaps_used objspace->heap.used
-#define freelist objspace->heap.freelist
#define lomem objspace->heap.range[0]
#define himem objspace->heap.range[1]
#define heaps_inc objspace->heap.increment
#define heaps_freed objspace->heap.freed
#define dont_gc objspace->flags.dont_gc
#define during_gc objspace->flags.during_gc
+#define finalizing objspace->flags.finalizing
#define finalizer_table objspace->final.table
#define deferred_final_list objspace->final.deferred
-#define mark_stack objspace->markstack.buffer
-#define mark_stack_ptr objspace->markstack.ptr
-#define mark_stack_overflow objspace->markstack.overflow
#define global_List objspace->global_list
#define ruby_gc_stress objspace->gc_stress
+#define initial_malloc_limit initial_params.initial_malloc_limit
+#define initial_heap_min_slots initial_params.initial_heap_min_slots
+#define initial_free_min initial_params.initial_free_min
+
+#define is_lazy_sweeping(objspace) ((objspace)->heap.sweep_slots != 0)
+
+#define nonspecial_obj_id(obj) (VALUE)((SIGNED_VALUE)(obj)|FIXNUM_FLAG)
+
+#define RANY(o) ((RVALUE*)(o))
+#define has_free_object (objspace->heap.free_slots && objspace->heap.free_slots->freelist)
+
+#define HEAP_HEADER(p) ((struct heaps_header *)(p))
+#define GET_HEAP_HEADER(x) (HEAP_HEADER((uintptr_t)(x) & ~(HEAP_ALIGN_MASK)))
+#define GET_HEAP_SLOT(x) (GET_HEAP_HEADER(x)->base)
+#define GET_HEAP_BITMAP(x) (GET_HEAP_HEADER(x)->bits)
+#define NUM_IN_SLOT(p) (((uintptr_t)(p) & HEAP_ALIGN_MASK)/sizeof(RVALUE))
+#define BITMAP_INDEX(p) (NUM_IN_SLOT(p) / (sizeof(uintptr_t) * CHAR_BIT))
+#define BITMAP_OFFSET(p) (NUM_IN_SLOT(p) & ((sizeof(uintptr_t) * CHAR_BIT)-1))
+#define MARKED_IN_BITMAP(bits, p) (bits[BITMAP_INDEX(p)] & ((uintptr_t)1 << BITMAP_OFFSET(p)))
+
+#ifndef HEAP_ALIGN_LOG
+/* default tiny heap size: 16KB */
+#define HEAP_ALIGN_LOG 14
+#endif
+
+#define CEILDIV(i, mod) (((i) + (mod) - 1)/(mod))
+
+enum {
+ HEAP_ALIGN = (1UL << HEAP_ALIGN_LOG),
+ HEAP_ALIGN_MASK = (~(~0UL << HEAP_ALIGN_LOG)),
+ REQUIRED_SIZE_BY_MALLOC = (sizeof(size_t) * 5),
+ HEAP_SIZE = (HEAP_ALIGN - REQUIRED_SIZE_BY_MALLOC),
+ HEAP_OBJ_LIMIT = (unsigned int)((HEAP_SIZE - sizeof(struct heaps_header))/sizeof(struct RVALUE)),
+ HEAP_BITMAP_LIMIT = CEILDIV(CEILDIV(HEAP_SIZE, sizeof(struct RVALUE)), sizeof(uintptr_t) * CHAR_BIT)
+};
+
+int ruby_gc_debug_indent = 0;
+VALUE rb_mGC;
+extern st_table *rb_class_tbl;
+int ruby_disable_gc_stress = 0;
static void rb_objspace_call_finalizer(rb_objspace_t *objspace);
+static VALUE define_final0(VALUE obj, VALUE block);
+VALUE rb_define_final(VALUE obj, VALUE block);
+VALUE rb_undefine_final(VALUE obj);
+static void run_final(rb_objspace_t *objspace, VALUE obj);
+static void initial_expand_heap(rb_objspace_t *objspace);
+
+static void negative_size_allocation_error(const char *);
+static void *aligned_malloc(size_t, size_t);
+static void aligned_free(void *);
+
+static void init_mark_stack(mark_stack_t *stack);
+
+static VALUE lazy_sweep_enable(void);
+static int garbage_collect(rb_objspace_t *);
+static int gc_prepare_free_objects(rb_objspace_t *);
+static void mark_tbl(rb_objspace_t *, st_table *);
+static void rest_sweep(rb_objspace_t *);
+static void gc_mark_stacked_objects(rb_objspace_t *);
+
+static double getrusage_time(void);
+static inline void gc_prof_timer_start(rb_objspace_t *);
+static inline void gc_prof_timer_stop(rb_objspace_t *, int);
+static inline void gc_prof_mark_timer_start(rb_objspace_t *);
+static inline void gc_prof_mark_timer_stop(rb_objspace_t *);
+static inline void gc_prof_sweep_timer_start(rb_objspace_t *);
+static inline void gc_prof_sweep_timer_stop(rb_objspace_t *);
+static inline void gc_prof_set_malloc_info(rb_objspace_t *);
+
+
+/*
+ --------------------------- ObjectSpace -----------------------------
+*/
#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
rb_objspace_t *
@@ -403,54 +370,15 @@ rb_objspace_alloc(void)
return objspace;
}
+#endif
-static void initial_expand_heap(rb_objspace_t *objspace);
-
-void
-rb_gc_set_params(void)
-{
- char *malloc_limit_ptr, *heap_min_slots_ptr, *free_min_ptr;
-
- if (rb_safe_level() > 0) return;
-
- malloc_limit_ptr = getenv("RUBY_GC_MALLOC_LIMIT");
- if (malloc_limit_ptr != NULL) {
- int malloc_limit_i = atoi(malloc_limit_ptr);
- printf("malloc_limit=%d (%d)\n", malloc_limit_i, initial_malloc_limit);
- if (malloc_limit_i > 0) {
- initial_malloc_limit = malloc_limit_i;
- }
- }
-
- heap_min_slots_ptr = getenv("RUBY_HEAP_MIN_SLOTS");
- if (heap_min_slots_ptr != NULL) {
- int heap_min_slots_i = atoi(heap_min_slots_ptr);
- printf("heap_min_slots=%d (%d)\n", heap_min_slots_i, initial_heap_min_slots);
- if (heap_min_slots_i > 0) {
- initial_heap_min_slots = heap_min_slots_i;
- initial_expand_heap(&rb_objspace);
- }
- }
-
- free_min_ptr = getenv("RUBY_FREE_MIN");
- if (free_min_ptr != NULL) {
- int free_min_i = atoi(free_min_ptr);
- printf("free_min=%d (%d)\n", free_min_i, initial_free_min);
- if (free_min_i > 0) {
- initial_free_min = free_min_i;
- }
- }
-}
-
-static void gc_sweep(rb_objspace_t *);
-static void slot_sweep(rb_objspace_t *, struct heaps_slot *);
-static void gc_clear_mark_on_sweep_slots(rb_objspace_t *);
+#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
+static void free_stack_chunks(mark_stack_t *);
void
rb_objspace_free(rb_objspace_t *objspace)
{
- gc_clear_mark_on_sweep_slots(objspace);
- gc_sweep(objspace);
+ rest_sweep(objspace);
if (objspace->profile.record) {
free(objspace->profile.record);
objspace->profile.record = 0;
@@ -459,539 +387,84 @@ rb_objspace_free(rb_objspace_t *objspace)
struct gc_list *list, *next;
for (list = global_List; list; list = next) {
next = list->next;
- free(list);
+ xfree(list);
}
}
+ if (objspace->heap.free_bitmap) {
+ struct heaps_free_bitmap *list, *next;
+ for (list = objspace->heap.free_bitmap; list; list = next) {
+ next = list->next;
+ free(list);
+ }
+ }
if (objspace->heap.sorted) {
size_t i;
for (i = 0; i < heaps_used; ++i) {
- free(objspace->heap.sorted[i].slot->membase);
- free(objspace->heap.sorted[i].slot);
+ free(objspace->heap.sorted[i]->bits);
+ aligned_free(objspace->heap.sorted[i]);
}
free(objspace->heap.sorted);
heaps_used = 0;
heaps = 0;
}
+ free_stack_chunks(&objspace->mark_stack);
free(objspace);
}
-#else
-void
-rb_gc_set_params(void)
-{
-}
#endif
-/* tiny heap size */
-/* 32KB */
-/*#define HEAP_SIZE 0x8000 */
-/* 128KB */
-/*#define HEAP_SIZE 0x20000 */
-/* 64KB */
-/*#define HEAP_SIZE 0x10000 */
-/* 16KB */
-#define HEAP_SIZE 0x4000
-/* 8KB */
-/*#define HEAP_SIZE 0x2000 */
-/* 4KB */
-/*#define HEAP_SIZE 0x1000 */
-/* 2KB */
-/*#define HEAP_SIZE 0x800 */
-
-#define HEAP_OBJ_LIMIT (HEAP_SIZE / sizeof(struct RVALUE))
-
-extern st_table *rb_class_tbl;
-
-int ruby_disable_gc_stress = 0;
-
-static void run_final(rb_objspace_t *objspace, VALUE obj);
-static int garbage_collect(rb_objspace_t *objspace);
-static int gc_lazy_sweep(rb_objspace_t *objspace);
-
void
rb_global_variable(VALUE *var)
{
rb_gc_register_address(var);
}
-static void *
-ruby_memerror_body(void *dummy)
-{
- rb_memerror();
- return 0;
-}
-
static void
-ruby_memerror(void)
-{
- if (ruby_thread_has_gvl_p()) {
- rb_memerror();
- }
- else {
- if (ruby_native_thread_p()) {
- rb_thread_call_with_gvl(ruby_memerror_body, 0);
- }
- else {
- /* no ruby thread */
- fprintf(stderr, "[FATAL] failed to allocate memory\n");
- exit(EXIT_FAILURE);
- }
- }
-}
-
-void
-rb_memerror(void)
-{
- rb_thread_t *th = GET_THREAD();
- if (!nomem_error ||
- (rb_thread_raised_p(th, RAISED_NOMEMORY) && rb_safe_level() < 4)) {
- fprintf(stderr, "[FATAL] failed to allocate memory\n");
- exit(EXIT_FAILURE);
- }
- if (rb_thread_raised_p(th, RAISED_NOMEMORY)) {
- rb_thread_raised_clear(th);
- GET_THREAD()->errinfo = nomem_error;
- JUMP_TAG(TAG_RAISE);
- }
- rb_thread_raised_set(th, RAISED_NOMEMORY);
- rb_exc_raise(nomem_error);
-}
-
-/*
- * call-seq:
- * GC.stress -> true or false
- *
- * returns current status of GC stress mode.
- */
-
-static VALUE
-gc_stress_get(VALUE self)
-{
- rb_objspace_t *objspace = &rb_objspace;
- return ruby_gc_stress ? Qtrue : Qfalse;
-}
-
-/*
- * call-seq:
- * GC.stress = bool -> bool
- *
- * Updates the GC stress mode.
- *
- * When stress mode is enabled the GC is invoked at every GC opportunity:
- * all memory and object allocations.
- *
- * Enabling stress mode makes Ruby very slow, it is only for debugging.
- */
-
-static VALUE
-gc_stress_set(VALUE self, VALUE flag)
-{
- rb_objspace_t *objspace = &rb_objspace;
- rb_secure(2);
- ruby_gc_stress = RTEST(flag);
- return flag;
-}
-
-/*
- * call-seq:
- * GC::Profiler.enable? -> true or false
- *
- * The current status of GC profile mode.
- */
-
-static VALUE
-gc_profile_enable_get(VALUE self)
-{
- rb_objspace_t *objspace = &rb_objspace;
- return objspace->profile.run;
-}
-
-/*
- * call-seq:
- * GC::Profiler.enable -> nil
- *
- * Starts the GC profiler.
- *
- */
-
-static VALUE
-gc_profile_enable(void)
-{
- rb_objspace_t *objspace = &rb_objspace;
-
- objspace->profile.run = TRUE;
- return Qnil;
-}
-
-/*
- * call-seq:
- * GC::Profiler.disable -> nil
- *
- * Stops the GC profiler.
- *
- */
-
-static VALUE
-gc_profile_disable(void)
-{
- rb_objspace_t *objspace = &rb_objspace;
-
- objspace->profile.run = FALSE;
- return Qnil;
-}
-
-/*
- * call-seq:
- * GC::Profiler.clear -> nil
- *
- * Clears the GC profiler data.
- *
- */
-
-static VALUE
-gc_profile_clear(void)
-{
- rb_objspace_t *objspace = &rb_objspace;
- MEMZERO(objspace->profile.record, gc_profile_record, objspace->profile.size);
- objspace->profile.count = 0;
- return Qnil;
-}
-
-static void *
-negative_size_allocation_error_with_gvl(void *ptr)
-{
- rb_raise(rb_eNoMemError, "%s", (const char *)ptr);
- return 0; /* should not be reached */
-}
-
-static void
-negative_size_allocation_error(const char *msg)
+allocate_sorted_heaps(rb_objspace_t *objspace, size_t next_heaps_length)
{
- if (ruby_thread_has_gvl_p()) {
- rb_raise(rb_eNoMemError, "%s", msg);
- }
- else {
- if (ruby_native_thread_p()) {
- rb_thread_call_with_gvl(negative_size_allocation_error_with_gvl, (void *)msg);
- }
- else {
- fprintf(stderr, "[FATAL] %s\n", msg);
- exit(EXIT_FAILURE);
- }
- }
-}
+ struct heaps_header **p;
+ struct heaps_free_bitmap *bits;
+ size_t size, add, i;
-static void *
-gc_with_gvl(void *ptr)
-{
- return (void *)(VALUE)garbage_collect((rb_objspace_t *)ptr);
-}
+ size = next_heaps_length*sizeof(struct heaps_header *);
+ add = next_heaps_length - heaps_used;
-static int
-garbage_collect_with_gvl(rb_objspace_t *objspace)
-{
- if (dont_gc) return TRUE;
- if (ruby_thread_has_gvl_p()) {
- return garbage_collect(objspace);
+ if (heaps_used > 0) {
+ p = (struct heaps_header **)realloc(objspace->heap.sorted, size);
+ if (p) objspace->heap.sorted = p;
}
else {
- if (ruby_native_thread_p()) {
- return (int)(VALUE)rb_thread_call_with_gvl(gc_with_gvl, (void *)objspace);
- }
- else {
- /* no ruby thread */
- fprintf(stderr, "[FATAL] failed to allocate memory\n");
- exit(EXIT_FAILURE);
- }
+ p = objspace->heap.sorted = (struct heaps_header **)malloc(size);
}
-}
-
-static void vm_xfree(rb_objspace_t *objspace, void *ptr);
-
-static inline size_t
-vm_malloc_prepare(rb_objspace_t *objspace, size_t size)
-{
- if ((ssize_t)size < 0) {
- negative_size_allocation_error("negative allocation size (or too big)");
- }
- if (size == 0) size = 1;
-
-#if CALC_EXACT_MALLOC_SIZE
- size += sizeof(size_t);
-#endif
-
- if ((ruby_gc_stress && !ruby_disable_gc_stress) ||
- (malloc_increase+size) > malloc_limit) {
- garbage_collect_with_gvl(objspace);
- }
-
- return size;
-}
-
-static inline void *
-vm_malloc_fixup(rb_objspace_t *objspace, void *mem, size_t size)
-{
- malloc_increase += size;
-
-#if CALC_EXACT_MALLOC_SIZE
- objspace->malloc_params.allocated_size += size;
- objspace->malloc_params.allocations++;
- ((size_t *)mem)[0] = size;
- mem = (size_t *)mem + 1;
-#endif
-
- return mem;
-}
-#define TRY_WITH_GC(alloc) do { \
- if (!(alloc) && \
- (!garbage_collect_with_gvl(objspace) || \
- !(alloc))) { \
- ruby_memerror(); \
- } \
- } while (0)
-
-static void *
-vm_xmalloc(rb_objspace_t *objspace, size_t size)
-{
- void *mem;
-
- size = vm_malloc_prepare(objspace, size);
- TRY_WITH_GC(mem = malloc(size));
- return vm_malloc_fixup(objspace, mem, size);
-}
-
-static void *
-vm_xrealloc(rb_objspace_t *objspace, void *ptr, size_t size)
-{
- void *mem;
-
- if ((ssize_t)size < 0) {
- negative_size_allocation_error("negative re-allocation size");
- }
- if (!ptr) return vm_xmalloc(objspace, size);
- if (size == 0) {
- vm_xfree(objspace, ptr);
- return 0;
+ if (p == 0) {
+ during_gc = 0;
+ rb_memerror();
}
- if (ruby_gc_stress && !ruby_disable_gc_stress)
- garbage_collect_with_gvl(objspace);
-
-#if CALC_EXACT_MALLOC_SIZE
- size += sizeof(size_t);
- objspace->malloc_params.allocated_size -= size;
- ptr = (size_t *)ptr - 1;
-#endif
- mem = realloc(ptr, size);
- if (!mem) {
- if (garbage_collect_with_gvl(objspace)) {
- mem = realloc(ptr, size);
- }
- if (!mem) {
- ruby_memerror();
+ for (i = 0; i < add; i++) {
+ bits = (struct heaps_free_bitmap *)malloc(HEAP_BITMAP_LIMIT * sizeof(uintptr_t));
+ if (bits == 0) {
+ during_gc = 0;
+ rb_memerror();
+ return;
}
+ bits->next = objspace->heap.free_bitmap;
+ objspace->heap.free_bitmap = bits;
}
- malloc_increase += size;
-
-#if CALC_EXACT_MALLOC_SIZE
- objspace->malloc_params.allocated_size += size;
- ((size_t *)mem)[0] = size;
- mem = (size_t *)mem + 1;
-#endif
-
- return mem;
}
static void
-vm_xfree(rb_objspace_t *objspace, void *ptr)
-{
-#if CALC_EXACT_MALLOC_SIZE
- size_t size;
- ptr = ((size_t *)ptr) - 1;
- size = ((size_t*)ptr)[0];
- objspace->malloc_params.allocated_size -= size;
- objspace->malloc_params.allocations--;
-#endif
-
- free(ptr);
-}
-
-void *
-ruby_xmalloc(size_t size)
-{
- return vm_xmalloc(&rb_objspace, size);
-}
-
-static inline size_t
-xmalloc2_size(size_t n, size_t size)
-{
- size_t len = size * n;
- if (n != 0 && size != len / n) {
- rb_raise(rb_eArgError, "malloc: possible integer overflow");
- }
- return len;
-}
-
-void *
-ruby_xmalloc2(size_t n, size_t size)
+link_free_heap_slot(rb_objspace_t *objspace, struct heaps_slot *slot)
{
- return vm_xmalloc(&rb_objspace, xmalloc2_size(n, size));
+ slot->free_next = objspace->heap.free_slots;
+ objspace->heap.free_slots = slot;
}
-static void *
-vm_xcalloc(rb_objspace_t *objspace, size_t count, size_t elsize)
-{
- void *mem;
- size_t size;
-
- size = xmalloc2_size(count, elsize);
- size = vm_malloc_prepare(objspace, size);
-
- TRY_WITH_GC(mem = calloc(1, size));
- return vm_malloc_fixup(objspace, mem, size);
-}
-
-void *
-ruby_xcalloc(size_t n, size_t size)
-{
- return vm_xcalloc(&rb_objspace, n, size);
-}
-
-void *
-ruby_xrealloc(void *ptr, size_t size)
-{
- return vm_xrealloc(&rb_objspace, ptr, size);
-}
-
-void *
-ruby_xrealloc2(void *ptr, size_t n, size_t size)
-{
- size_t len = size * n;
- if (n != 0 && size != len / n) {
- rb_raise(rb_eArgError, "realloc: possible integer overflow");
- }
- return ruby_xrealloc(ptr, len);
-}
-
-void
-ruby_xfree(void *x)
-{
- if (x)
- vm_xfree(&rb_objspace, x);
-}
-
-
-/*
- * call-seq:
- * GC.enable -> true or false
- *
- * Enables garbage collection, returning <code>true</code> if garbage
- * collection was previously disabled.
- *
- * GC.disable #=> false
- * GC.enable #=> true
- * GC.enable #=> false
- *
- */
-
-VALUE
-rb_gc_enable(void)
-{
- rb_objspace_t *objspace = &rb_objspace;
- int old = dont_gc;
-
- dont_gc = FALSE;
- return old ? Qtrue : Qfalse;
-}
-
-/*
- * call-seq:
- * GC.disable -> true or false
- *
- * Disables garbage collection, returning <code>true</code> if garbage
- * collection was already disabled.
- *
- * GC.disable #=> false
- * GC.disable #=> true
- *
- */
-
-VALUE
-rb_gc_disable(void)
-{
- rb_objspace_t *objspace = &rb_objspace;
- int old = dont_gc;
-
- dont_gc = TRUE;
- return old ? Qtrue : Qfalse;
-}
-
-VALUE rb_mGC;
-
-void
-rb_gc_register_mark_object(VALUE obj)
-{
- VALUE ary = GET_THREAD()->vm->mark_object_ary;
- rb_ary_push(ary, obj);
-}
-
-void
-rb_gc_register_address(VALUE *addr)
-{
- rb_objspace_t *objspace = &rb_objspace;
- struct gc_list *tmp;
-
- tmp = ALLOC(struct gc_list);
- tmp->next = global_List;
- tmp->varptr = addr;
- global_List = tmp;
-}
-
-void
-rb_gc_unregister_address(VALUE *addr)
-{
- rb_objspace_t *objspace = &rb_objspace;
- struct gc_list *tmp = global_List;
-
- if (tmp->varptr == addr) {
- global_List = tmp->next;
- xfree(tmp);
- return;
- }
- while (tmp->next) {
- if (tmp->next->varptr == addr) {
- struct gc_list *t = tmp->next;
-
- tmp->next = tmp->next->next;
- xfree(t);
- break;
- }
- tmp = tmp->next;
- }
-}
-
-
static void
-allocate_sorted_heaps(rb_objspace_t *objspace, size_t next_heaps_length)
+unlink_free_heap_slot(rb_objspace_t *objspace, struct heaps_slot *slot)
{
- struct sorted_heaps_slot *p;
- size_t size;
-
- size = next_heaps_length*sizeof(struct sorted_heaps_slot);
-
- if (heaps_used > 0) {
- p = (struct sorted_heaps_slot *)realloc(objspace->heap.sorted, size);
- if (p) objspace->heap.sorted = p;
- }
- else {
- p = objspace->heap.sorted = (struct sorted_heaps_slot *)malloc(size);
- }
-
- if (p == 0) {
- during_gc = 0;
- rb_memerror();
- }
- heaps_length = next_heaps_length;
+ objspace->heap.free_slots = slot->free_next;
+ slot->free_next = NULL;
}
static void
@@ -1003,16 +476,16 @@ assign_heap_slot(rb_objspace_t *objspace)
size_t objs;
objs = HEAP_OBJ_LIMIT;
- p = (RVALUE*)malloc(HEAP_SIZE);
+ p = (RVALUE*)aligned_malloc(HEAP_ALIGN, HEAP_SIZE);
if (p == 0) {
during_gc = 0;
rb_memerror();
}
slot = (struct heaps_slot *)malloc(sizeof(struct heaps_slot));
if (slot == 0) {
- xfree(p);
- during_gc = 0;
- rb_memerror();
+ aligned_free(p);
+ during_gc = 0;
+ rb_memerror();
}
MEMZERO((void*)slot, struct heaps_slot, 1);
@@ -1021,11 +494,10 @@ assign_heap_slot(rb_objspace_t *objspace)
heaps = slot;
membase = p;
+ p = (RVALUE*)((VALUE)p + sizeof(struct heaps_header));
if ((VALUE)p % sizeof(RVALUE) != 0) {
- p = (RVALUE*)((VALUE)p + sizeof(RVALUE) - ((VALUE)p % sizeof(RVALUE)));
- if ((HEAP_SIZE - HEAP_OBJ_LIMIT * sizeof(RVALUE)) < (size_t)((char*)p - (char*)membase)) {
- objs--;
- }
+ p = (RVALUE*)((VALUE)p + sizeof(RVALUE) - ((VALUE)p % sizeof(RVALUE)));
+ objs = (HEAP_SIZE - (size_t)((VALUE)p - (VALUE)membase))/sizeof(RVALUE);
}
lo = 0;
@@ -1033,7 +505,7 @@ assign_heap_slot(rb_objspace_t *objspace)
while (lo < hi) {
register RVALUE *mid_membase;
mid = (lo + hi) / 2;
- mid_membase = objspace->heap.sorted[mid].slot->membase;
+ mid_membase = (RVALUE *)objspace->heap.sorted[mid];
if (mid_membase < membase) {
lo = mid + 1;
}
@@ -1045,15 +517,19 @@ assign_heap_slot(rb_objspace_t *objspace)
}
}
if (hi < heaps_used) {
- MEMMOVE(&objspace->heap.sorted[hi+1], &objspace->heap.sorted[hi], struct sorted_heaps_slot, heaps_used - hi);
- }
- objspace->heap.sorted[hi].slot = slot;
- objspace->heap.sorted[hi].start = p;
- objspace->heap.sorted[hi].end = (p + objs);
- heaps->membase = membase;
- heaps->slot = p;
- heaps->limit = objs;
- objspace->heap.free_num += objs;
+ MEMMOVE(&objspace->heap.sorted[hi+1], &objspace->heap.sorted[hi], struct heaps_header*, heaps_used - hi);
+ }
+ heaps->header = (struct heaps_header *)membase;
+ objspace->heap.sorted[hi] = heaps->header;
+ objspace->heap.sorted[hi]->start = p;
+ objspace->heap.sorted[hi]->end = (p + objs);
+ objspace->heap.sorted[hi]->base = heaps;
+ objspace->heap.sorted[hi]->limit = objs;
+ assert(objspace->heap.free_bitmap != NULL);
+ heaps->bits = (uintptr_t *)objspace->heap.free_bitmap;
+ objspace->heap.sorted[hi]->bits = (uintptr_t *)objspace->heap.free_bitmap;
+ objspace->heap.free_bitmap = objspace->heap.free_bitmap->next;
+ memset(heaps->bits, 0, HEAP_BITMAP_LIMIT * sizeof(uintptr_t));
pend = p + objs;
if (lomem == 0 || lomem > p) lomem = p;
if (himem < pend) himem = pend;
@@ -1061,37 +537,52 @@ assign_heap_slot(rb_objspace_t *objspace)
while (p < pend) {
p->as.free.flags = 0;
- p->as.free.next = freelist;
- freelist = p;
+ p->as.free.next = heaps->freelist;
+ heaps->freelist = p;
p++;
}
+ link_free_heap_slot(objspace, heaps);
}
static void
add_heap_slots(rb_objspace_t *objspace, size_t add)
{
size_t i;
+ size_t next_heaps_length;
+
+ next_heaps_length = heaps_used + add;
- if ((heaps_used + add) > heaps_length) {
- allocate_sorted_heaps(objspace, heaps_used + add);
+ if (next_heaps_length > heaps_length) {
+ allocate_sorted_heaps(objspace, next_heaps_length);
+ heaps_length = next_heaps_length;
}
for (i = 0; i < add; i++) {
assign_heap_slot(objspace);
}
+ heaps_inc = 0;
}
static void
init_heap(rb_objspace_t *objspace)
{
add_heap_slots(objspace, HEAP_MIN_SLOTS / HEAP_OBJ_LIMIT);
+ init_mark_stack(&objspace->mark_stack);
+
+#ifdef USE_SIGALTSTACK
+ {
+ /* altstack of another threads are allocated in another place */
+ rb_thread_t *th = GET_THREAD();
+ void *tmp = th->altstack;
+ th->altstack = malloc(ALT_STACK_SIZE);
+ free(tmp); /* free previously allocated area */
+ }
+#endif
- heaps_inc = 0;
objspace->profile.invoke_time = getrusage_time();
finalizer_table = st_init_numtable();
}
-#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
static void
initial_expand_heap(rb_objspace_t *objspace)
{
@@ -1101,7 +592,6 @@ initial_expand_heap(rb_objspace_t *objspace)
add_heap_slots(objspace, min_size - heaps_used);
}
}
-#endif
static void
set_heaps_increment(rb_objspace_t *objspace)
@@ -1116,6 +606,7 @@ set_heaps_increment(rb_objspace_t *objspace)
if (next_heaps_length > heaps_length) {
allocate_sorted_heaps(objspace, next_heaps_length);
+ heaps_length = next_heaps_length;
}
}
@@ -1130,17 +621,8 @@ heaps_increment(rb_objspace_t *objspace)
return FALSE;
}
-int
-rb_during_gc(void)
-{
- rb_objspace_t *objspace = &rb_objspace;
- return during_gc;
-}
-
-#define RANY(o) ((RVALUE*)(o))
-
-VALUE
-rb_newobj(void)
+static VALUE
+newobj(VALUE klass, VALUE flags)
{
rb_objspace_t *objspace = &rb_objspace;
VALUE obj;
@@ -1158,22 +640,42 @@ rb_newobj(void)
}
}
- if (UNLIKELY(!freelist)) {
- if (!gc_lazy_sweep(objspace)) {
+ if (UNLIKELY(!has_free_object)) {
+ if (!gc_prepare_free_objects(objspace)) {
during_gc = 0;
rb_memerror();
}
}
- obj = (VALUE)freelist;
- freelist = freelist->as.free.next;
+ obj = (VALUE)objspace->heap.free_slots->freelist;
+ objspace->heap.free_slots->freelist = RANY(obj)->as.free.next;
+ if (objspace->heap.free_slots->freelist == NULL) {
+ unlink_free_heap_slot(objspace, objspace->heap.free_slots);
+ }
MEMZERO((void*)obj, RVALUE, 1);
#ifdef GC_DEBUG
RANY(obj)->file = rb_sourcefile();
RANY(obj)->line = rb_sourceline();
#endif
- GC_PROF_INC_LIVE_NUM;
+ objspace->total_allocated_object_num++;
+
+ return obj;
+}
+
+VALUE
+rb_newobj(void)
+{
+ return newobj(0, T_NONE);
+}
+
+VALUE
+rb_newobj_of(VALUE klass, VALUE flags)
+{
+ VALUE obj;
+
+ obj = newobj(klass, flags);
+ OBJSETUP(obj, klass, flags);
return obj;
}
@@ -1244,129 +746,14 @@ rb_objspace_data_type_name(VALUE obj)
}
}
-#ifdef __ia64
-#define SET_STACK_END (SET_MACHINE_STACK_END(&th->machine_stack_end), th->machine_register_stack_end = rb_ia64_bsp())
-#else
-#define SET_STACK_END SET_MACHINE_STACK_END(&th->machine_stack_end)
-#endif
-
-#define STACK_START (th->machine_stack_start)
-#define STACK_END (th->machine_stack_end)
-#define STACK_LEVEL_MAX (th->machine_stack_maxsize/sizeof(VALUE))
-
-#if STACK_GROW_DIRECTION < 0
-# define STACK_LENGTH (size_t)(STACK_START - STACK_END)
-#elif STACK_GROW_DIRECTION > 0
-# define STACK_LENGTH (size_t)(STACK_END - STACK_START + 1)
-#else
-# define STACK_LENGTH ((STACK_END < STACK_START) ? (size_t)(STACK_START - STACK_END) \
- : (size_t)(STACK_END - STACK_START + 1))
-#endif
-#if !STACK_GROW_DIRECTION
-int ruby_stack_grow_direction;
-int
-ruby_get_stack_grow_direction(volatile VALUE *addr)
-{
- VALUE *end;
- SET_MACHINE_STACK_END(&end);
-
- if (end > addr) return ruby_stack_grow_direction = 1;
- return ruby_stack_grow_direction = -1;
-}
-#endif
-
-#define GC_LEVEL_MAX 250
-#define STACKFRAME_FOR_GC_MARK (GC_LEVEL_MAX * GC_MARK_STACKFRAME_WORD)
-
-size_t
-ruby_stack_length(VALUE **p)
-{
- rb_thread_t *th = GET_THREAD();
- SET_STACK_END;
- if (p) *p = STACK_UPPER(STACK_END, STACK_START, STACK_END);
- return STACK_LENGTH;
-}
-
-static int
-stack_check(int water_mark)
-{
- int ret;
- rb_thread_t *th = GET_THREAD();
- SET_STACK_END;
- ret = STACK_LENGTH > STACK_LEVEL_MAX - water_mark;
-#ifdef __ia64
- if (!ret) {
- ret = (VALUE*)rb_ia64_bsp() - th->machine_register_stack_start >
- th->machine_register_stack_maxsize/sizeof(VALUE) - water_mark;
- }
-#endif
- return ret;
-}
-
-#define STACKFRAME_FOR_CALL_CFUNC 512
-
-int
-ruby_stack_check(void)
-{
-#if defined(POSIX_SIGNAL) && defined(SIGSEGV) && defined(HAVE_SIGALTSTACK)
- return 0;
-#else
- return stack_check(STACKFRAME_FOR_CALL_CFUNC);
-#endif
-}
-
-static void
-init_mark_stack(rb_objspace_t *objspace)
-{
- mark_stack_overflow = 0;
- mark_stack_ptr = mark_stack;
-}
-
-#define MARK_STACK_EMPTY (mark_stack_ptr == mark_stack)
-
-static void gc_mark(rb_objspace_t *objspace, VALUE ptr, int lev);
-static void gc_mark_children(rb_objspace_t *objspace, VALUE ptr, int lev);
-
-static void
-gc_mark_all(rb_objspace_t *objspace)
-{
- RVALUE *p, *pend;
- size_t i;
-
- init_mark_stack(objspace);
- for (i = 0; i < heaps_used; i++) {
- p = objspace->heap.sorted[i].start; pend = objspace->heap.sorted[i].end;
- while (p < pend) {
- if ((p->as.basic.flags & FL_MARK) &&
- (p->as.basic.flags != FL_MARK)) {
- gc_mark_children(objspace, (VALUE)p, 0);
- }
- p++;
- }
- }
-}
-
-static void
-gc_mark_rest(rb_objspace_t *objspace)
-{
- VALUE tmp_arry[MARK_STACK_MAX];
- VALUE *p;
-
- p = (mark_stack_ptr - mark_stack) + tmp_arry;
- MEMCPY(tmp_arry, mark_stack, VALUE, p - tmp_arry);
-
- init_mark_stack(objspace);
- while (p != tmp_arry) {
- p--;
- gc_mark_children(objspace, *p, 0);
- }
-}
+static void gc_mark(rb_objspace_t *objspace, VALUE ptr);
+static void gc_mark_children(rb_objspace_t *objspace, VALUE ptr);
static inline int
is_pointer_to_heap(rb_objspace_t *objspace, void *ptr)
{
register RVALUE *p = RANY(ptr);
- register struct sorted_heaps_slot *heap;
+ register struct heaps_header *heap;
register size_t hi, lo, mid;
if (p < lomem || p > himem) return FALSE;
@@ -1377,7 +764,7 @@ is_pointer_to_heap(rb_objspace_t *objspace, void *ptr)
hi = heaps_used;
while (lo < hi) {
mid = (lo + hi) / 2;
- heap = &objspace->heap.sorted[mid];
+ heap = objspace->heap.sorted[mid];
if (heap->start <= p) {
if (p < heap->end)
return TRUE;
@@ -1390,161 +777,12 @@ is_pointer_to_heap(rb_objspace_t *objspace, void *ptr)
return FALSE;
}
-static void
-mark_locations_array(rb_objspace_t *objspace, register VALUE *x, register long n)
-{
- VALUE v;
- while (n--) {
- v = *x;
- VALGRIND_MAKE_MEM_DEFINED(&v, sizeof(v));
- if (is_pointer_to_heap(objspace, (void *)v)) {
- gc_mark(objspace, v, 0);
- }
- x++;
- }
-}
-
-static void
-gc_mark_locations(rb_objspace_t *objspace, VALUE *start, VALUE *end)
-{
- long n;
-
- if (end <= start) return;
- n = end - start;
- mark_locations_array(objspace, start, n);
-}
-
-void
-rb_gc_mark_locations(VALUE *start, VALUE *end)
-{
- gc_mark_locations(&rb_objspace, start, end);
-}
-
-#define rb_gc_mark_locations(start, end) gc_mark_locations(objspace, (start), (end))
-
-struct mark_tbl_arg {
- rb_objspace_t *objspace;
- int lev;
-};
-
-static int
-mark_entry(ID key, VALUE value, st_data_t data)
-{
- struct mark_tbl_arg *arg = (void*)data;
- gc_mark(arg->objspace, value, arg->lev);
- return ST_CONTINUE;
-}
-
-static void
-mark_tbl(rb_objspace_t *objspace, st_table *tbl, int lev)
-{
- struct mark_tbl_arg arg;
- if (!tbl || tbl->num_entries == 0) return;
- arg.objspace = objspace;
- arg.lev = lev;
- st_foreach(tbl, mark_entry, (st_data_t)&arg);
-}
-
-static int
-mark_key(VALUE key, VALUE value, st_data_t data)
-{
- struct mark_tbl_arg *arg = (void*)data;
- gc_mark(arg->objspace, key, arg->lev);
- return ST_CONTINUE;
-}
-
-static void
-mark_set(rb_objspace_t *objspace, st_table *tbl, int lev)
-{
- struct mark_tbl_arg arg;
- if (!tbl) return;
- arg.objspace = objspace;
- arg.lev = lev;
- st_foreach(tbl, mark_key, (st_data_t)&arg);
-}
-
-void
-rb_mark_set(st_table *tbl)
-{
- mark_set(&rb_objspace, tbl, 0);
-}
-
-static int
-mark_keyvalue(VALUE key, VALUE value, st_data_t data)
-{
- struct mark_tbl_arg *arg = (void*)data;
- gc_mark(arg->objspace, key, arg->lev);
- gc_mark(arg->objspace, value, arg->lev);
- return ST_CONTINUE;
-}
-
-static void
-mark_hash(rb_objspace_t *objspace, st_table *tbl, int lev)
-{
- struct mark_tbl_arg arg;
- if (!tbl) return;
- arg.objspace = objspace;
- arg.lev = lev;
- st_foreach(tbl, mark_keyvalue, (st_data_t)&arg);
-}
-
-void
-rb_mark_hash(st_table *tbl)
-{
- mark_hash(&rb_objspace, tbl, 0);
-}
-
-static void
-mark_method_entry(rb_objspace_t *objspace, const rb_method_entry_t *me, int lev)
-{
- const rb_method_definition_t *def = me->def;
-
- gc_mark(objspace, me->klass, lev);
- if (!def) return;
- switch (def->type) {
- case VM_METHOD_TYPE_ISEQ:
- gc_mark(objspace, def->body.iseq->self, lev);
- break;
- case VM_METHOD_TYPE_BMETHOD:
- gc_mark(objspace, def->body.proc, lev);
- break;
- case VM_METHOD_TYPE_ATTRSET:
- case VM_METHOD_TYPE_IVAR:
- gc_mark(objspace, def->body.attr.location, lev);
- break;
- default:
- break; /* ignore */
- }
-}
-
-void
-rb_mark_method_entry(const rb_method_entry_t *me)
-{
- mark_method_entry(&rb_objspace, me, 0);
-}
-
-static int
-mark_method_entry_i(ID key, const rb_method_entry_t *me, st_data_t data)
-{
- struct mark_tbl_arg *arg = (void*)data;
- mark_method_entry(arg->objspace, me, arg->lev);
- return ST_CONTINUE;
-}
-
-static void
-mark_m_tbl(rb_objspace_t *objspace, st_table *tbl, int lev)
-{
- struct mark_tbl_arg arg;
- if (!tbl) return;
- arg.objspace = objspace;
- arg.lev = lev;
- st_foreach(tbl, mark_method_entry_i, (st_data_t)&arg);
-}
-
static int
free_method_entry_i(ID key, rb_method_entry_t *me, st_data_t data)
{
- rb_free_method_entry(me);
+ if (!me->mark) {
+ rb_free_method_entry(me);
+ }
return ST_CONTINUE;
}
@@ -1556,24 +794,6 @@ rb_free_m_table(st_table *tbl)
}
static int
-mark_const_entry_i(ID key, const rb_const_entry_t *ce, st_data_t data)
-{
- struct mark_tbl_arg *arg = (void*)data;
- gc_mark(arg->objspace, ce->value, arg->lev);
- return ST_CONTINUE;
-}
-
-static void
-mark_const_tbl(rb_objspace_t *objspace, st_table *tbl, int lev)
-{
- struct mark_tbl_arg arg;
- if (!tbl) return;
- arg.objspace = objspace;
- arg.lev = lev;
- st_foreach(tbl, mark_const_entry_i, (st_data_t)&arg);
-}
-
-static int
free_const_entry_i(ID key, rb_const_entry_t *ce, st_data_t data)
{
xfree(ce);
@@ -1587,357 +807,20 @@ rb_free_const_table(st_table *tbl)
st_free_table(tbl);
}
-void
-rb_mark_tbl(st_table *tbl)
-{
- mark_tbl(&rb_objspace, tbl, 0);
-}
-
-void
-rb_gc_mark_maybe(VALUE obj)
-{
- if (is_pointer_to_heap(&rb_objspace, (void *)obj)) {
- gc_mark(&rb_objspace, obj, 0);
- }
-}
-
-static void
-gc_mark(rb_objspace_t *objspace, VALUE ptr, int lev)
-{
- register RVALUE *obj;
-
- obj = RANY(ptr);
- if (rb_special_const_p(ptr)) return; /* special const not marked */
- if (obj->as.basic.flags == 0) return; /* free cell */
- if (obj->as.basic.flags & FL_MARK) return; /* already marked */
- obj->as.basic.flags |= FL_MARK;
- objspace->heap.live_num++;
-
- if (lev > GC_LEVEL_MAX || (lev == 0 && stack_check(STACKFRAME_FOR_GC_MARK))) {
- if (!mark_stack_overflow) {
- if (mark_stack_ptr - mark_stack < MARK_STACK_MAX) {
- *mark_stack_ptr = ptr;
- mark_stack_ptr++;
- }
- else {
- mark_stack_overflow = 1;
- }
- }
- return;
- }
- gc_mark_children(objspace, ptr, lev+1);
-}
-
-void
-rb_gc_mark(VALUE ptr)
-{
- gc_mark(&rb_objspace, ptr, 0);
-}
-
-static void
-gc_mark_children(rb_objspace_t *objspace, VALUE ptr, int lev)
-{
- register RVALUE *obj = RANY(ptr);
-
- goto marking; /* skip */
-
- again:
- obj = RANY(ptr);
- if (rb_special_const_p(ptr)) return; /* special const not marked */
- if (obj->as.basic.flags == 0) return; /* free cell */
- if (obj->as.basic.flags & FL_MARK) return; /* already marked */
- obj->as.basic.flags |= FL_MARK;
- objspace->heap.live_num++;
-
- marking:
- if (FL_TEST(obj, FL_EXIVAR)) {
- rb_mark_generic_ivar(ptr);
- }
-
- switch (BUILTIN_TYPE(obj)) {
- case T_NIL:
- case T_FIXNUM:
- rb_bug("rb_gc_mark() called for broken object");
- break;
-
- case T_NODE:
- switch (nd_type(obj)) {
- case NODE_IF: /* 1,2,3 */
- case NODE_FOR:
- case NODE_ITER:
- case NODE_WHEN:
- case NODE_MASGN:
- case NODE_RESCUE:
- case NODE_RESBODY:
- case NODE_CLASS:
- case NODE_BLOCK_PASS:
- gc_mark(objspace, (VALUE)obj->as.node.u2.node, lev);
- /* fall through */
- case NODE_BLOCK: /* 1,3 */
- case NODE_OPTBLOCK:
- case NODE_ARRAY:
- case NODE_DSTR:
- case NODE_DXSTR:
- case NODE_DREGX:
- case NODE_DREGX_ONCE:
- case NODE_ENSURE:
- case NODE_CALL:
- case NODE_DEFS:
- case NODE_OP_ASGN1:
- case NODE_ARGS:
- gc_mark(objspace, (VALUE)obj->as.node.u1.node, lev);
- /* fall through */
- case NODE_SUPER: /* 3 */
- case NODE_FCALL:
- case NODE_DEFN:
- case NODE_ARGS_AUX:
- ptr = (VALUE)obj->as.node.u3.node;
- goto again;
-
- case NODE_WHILE: /* 1,2 */
- case NODE_UNTIL:
- case NODE_AND:
- case NODE_OR:
- case NODE_CASE:
- case NODE_SCLASS:
- case NODE_DOT2:
- case NODE_DOT3:
- case NODE_FLIP2:
- case NODE_FLIP3:
- case NODE_MATCH2:
- case NODE_MATCH3:
- case NODE_OP_ASGN_OR:
- case NODE_OP_ASGN_AND:
- case NODE_MODULE:
- case NODE_ALIAS:
- case NODE_VALIAS:
- case NODE_ARGSCAT:
- gc_mark(objspace, (VALUE)obj->as.node.u1.node, lev);
- /* fall through */
- case NODE_GASGN: /* 2 */
- case NODE_LASGN:
- case NODE_DASGN:
- case NODE_DASGN_CURR:
- case NODE_IASGN:
- case NODE_IASGN2:
- case NODE_CVASGN:
- case NODE_COLON3:
- case NODE_OPT_N:
- case NODE_EVSTR:
- case NODE_UNDEF:
- case NODE_POSTEXE:
- ptr = (VALUE)obj->as.node.u2.node;
- goto again;
-
- case NODE_HASH: /* 1 */
- case NODE_LIT:
- case NODE_STR:
- case NODE_XSTR:
- case NODE_DEFINED:
- case NODE_MATCH:
- case NODE_RETURN:
- case NODE_BREAK:
- case NODE_NEXT:
- case NODE_YIELD:
- case NODE_COLON2:
- case NODE_SPLAT:
- case NODE_TO_ARY:
- ptr = (VALUE)obj->as.node.u1.node;
- goto again;
-
- case NODE_SCOPE: /* 2,3 */
- case NODE_CDECL:
- case NODE_OPT_ARG:
- gc_mark(objspace, (VALUE)obj->as.node.u3.node, lev);
- ptr = (VALUE)obj->as.node.u2.node;
- goto again;
-
- case NODE_ZARRAY: /* - */
- case NODE_ZSUPER:
- case NODE_VCALL:
- case NODE_GVAR:
- case NODE_LVAR:
- case NODE_DVAR:
- case NODE_IVAR:
- case NODE_CVAR:
- case NODE_NTH_REF:
- case NODE_BACK_REF:
- case NODE_REDO:
- case NODE_RETRY:
- case NODE_SELF:
- case NODE_NIL:
- case NODE_TRUE:
- case NODE_FALSE:
- case NODE_ERRINFO:
- case NODE_BLOCK_ARG:
- break;
- case NODE_ALLOCA:
- mark_locations_array(objspace,
- (VALUE*)obj->as.node.u1.value,
- obj->as.node.u3.cnt);
- ptr = (VALUE)obj->as.node.u2.node;
- goto again;
-
- default: /* unlisted NODE */
- if (is_pointer_to_heap(objspace, obj->as.node.u1.node)) {
- gc_mark(objspace, (VALUE)obj->as.node.u1.node, lev);
- }
- if (is_pointer_to_heap(objspace, obj->as.node.u2.node)) {
- gc_mark(objspace, (VALUE)obj->as.node.u2.node, lev);
- }
- if (is_pointer_to_heap(objspace, obj->as.node.u3.node)) {
- gc_mark(objspace, (VALUE)obj->as.node.u3.node, lev);
- }
- }
- return; /* no need to mark class. */
- }
-
- gc_mark(objspace, obj->as.basic.klass, lev);
- switch (BUILTIN_TYPE(obj)) {
- case T_ICLASS:
- case T_CLASS:
- case T_MODULE:
- mark_m_tbl(objspace, RCLASS_M_TBL(obj), lev);
- mark_tbl(objspace, RCLASS_IV_TBL(obj), lev);
- mark_const_tbl(objspace, RCLASS_CONST_TBL(obj), lev);
- ptr = RCLASS_SUPER(obj);
- goto again;
-
- case T_ARRAY:
- if (FL_TEST(obj, ELTS_SHARED)) {
- ptr = obj->as.array.as.heap.aux.shared;
- goto again;
- }
- else {
- long i, len = RARRAY_LEN(obj);
- VALUE *ptr = RARRAY_PTR(obj);
- for (i=0; i < len; i++) {
- gc_mark(objspace, *ptr++, lev);
- }
- }
- break;
-
- case T_HASH:
- mark_hash(objspace, obj->as.hash.ntbl, lev);
- ptr = obj->as.hash.ifnone;
- goto again;
-
- case T_STRING:
-#define STR_ASSOC FL_USER3 /* copied from string.c */
- if (FL_TEST(obj, RSTRING_NOEMBED) && FL_ANY(obj, ELTS_SHARED|STR_ASSOC)) {
- ptr = obj->as.string.as.heap.aux.shared;
- goto again;
- }
- break;
-
- case T_DATA:
- if (RTYPEDDATA_P(obj)) {
- RUBY_DATA_FUNC mark_func = obj->as.typeddata.type->function.dmark;
- if (mark_func) (*mark_func)(DATA_PTR(obj));
- }
- else {
- if (obj->as.data.dmark) (*obj->as.data.dmark)(DATA_PTR(obj));
- }
- break;
-
- case T_OBJECT:
- {
- long i, len = ROBJECT_NUMIV(obj);
- VALUE *ptr = ROBJECT_IVPTR(obj);
- for (i = 0; i < len; i++) {
- gc_mark(objspace, *ptr++, lev);
- }
- }
- break;
-
- case T_FILE:
- if (obj->as.file.fptr) {
- gc_mark(objspace, obj->as.file.fptr->pathv, lev);
- gc_mark(objspace, obj->as.file.fptr->tied_io_for_writing, lev);
- gc_mark(objspace, obj->as.file.fptr->writeconv_asciicompat, lev);
- gc_mark(objspace, obj->as.file.fptr->writeconv_pre_ecopts, lev);
- gc_mark(objspace, obj->as.file.fptr->encs.ecopts, lev);
- gc_mark(objspace, obj->as.file.fptr->write_lock, lev);
- }
- break;
-
- case T_REGEXP:
- gc_mark(objspace, obj->as.regexp.src, lev);
- break;
-
- case T_FLOAT:
- case T_BIGNUM:
- case T_ZOMBIE:
- break;
-
- case T_MATCH:
- gc_mark(objspace, obj->as.match.regexp, lev);
- if (obj->as.match.str) {
- ptr = obj->as.match.str;
- goto again;
- }
- break;
-
- case T_RATIONAL:
- gc_mark(objspace, obj->as.rational.num, lev);
- gc_mark(objspace, obj->as.rational.den, lev);
- break;
-
- case T_COMPLEX:
- gc_mark(objspace, obj->as.complex.real, lev);
- gc_mark(objspace, obj->as.complex.imag, lev);
- break;
-
- case T_STRUCT:
- {
- long len = RSTRUCT_LEN(obj);
- VALUE *ptr = RSTRUCT_PTR(obj);
-
- while (len--) {
- gc_mark(objspace, *ptr++, lev);
- }
- }
- break;
-
- default:
- rb_bug("rb_gc_mark(): unknown data type 0x%x(%p) %s",
- BUILTIN_TYPE(obj), (void *)obj,
- is_pointer_to_heap(objspace, obj) ? "corrupted object" : "non object");
- }
-}
-
static int obj_free(rb_objspace_t *, VALUE);
-static inline void
-add_freelist(rb_objspace_t *objspace, RVALUE *p)
+static inline struct heaps_slot *
+add_slot_local_freelist(rb_objspace_t *objspace, RVALUE *p)
{
- VALGRIND_MAKE_MEM_UNDEFINED((void*)p, sizeof(RVALUE));
+ struct heaps_slot *slot;
+
+ (void)VALGRIND_MAKE_MEM_UNDEFINED((void*)p, sizeof(RVALUE));
p->as.free.flags = 0;
- p->as.free.next = freelist;
- freelist = p;
-}
+ slot = GET_HEAP_SLOT(p);
+ p->as.free.next = slot->freelist;
+ slot->freelist = p;
-static void
-finalize_list(rb_objspace_t *objspace, RVALUE *p)
-{
- while (p) {
- RVALUE *tmp = p->as.free.next;
- run_final(objspace, (VALUE)p);
- if (!FL_TEST(p, FL_SINGLETON)) { /* not freeing page */
- if (objspace->heap.sweep_slots) {
- p->as.free.flags = 0;
- }
- else {
- GC_PROF_DEC_LIVE_NUM;
- add_freelist(objspace, p);
- }
- }
- else {
- struct heaps_slot *slot = (struct heaps_slot *)(VALUE)RDATA(p)->dmark;
- slot->limit--;
- }
- p = tmp;
- }
+ return slot;
}
static void
@@ -1955,22 +838,24 @@ unlink_heap_slot(rb_objspace_t *objspace, struct heaps_slot *slot)
slot->next = NULL;
}
-
static void
free_unused_heaps(rb_objspace_t *objspace)
{
size_t i, j;
- RVALUE *last = 0;
+ struct heaps_header *last = 0;
for (i = j = 1; j < heaps_used; i++) {
- if (objspace->heap.sorted[i].slot->limit == 0) {
+ if (objspace->heap.sorted[i]->limit == 0) {
+ struct heaps_header* h = objspace->heap.sorted[i];
+ ((struct heaps_free_bitmap *)(h->bits))->next =
+ objspace->heap.free_bitmap;
+ objspace->heap.free_bitmap = (struct heaps_free_bitmap *)h->bits;
if (!last) {
- last = objspace->heap.sorted[i].slot->membase;
+ last = objspace->heap.sorted[i];
}
else {
- free(objspace->heap.sorted[i].slot->membase);
+ aligned_free(objspace->heap.sorted[i]);
}
- free(objspace->heap.sorted[i].slot);
heaps_used--;
}
else {
@@ -1982,240 +867,14 @@ free_unused_heaps(rb_objspace_t *objspace)
}
if (last) {
if (last < heaps_freed) {
- free(heaps_freed);
+ aligned_free(heaps_freed);
heaps_freed = last;
}
else {
- free(last);
- }
- }
-}
-
-static void
-slot_sweep(rb_objspace_t *objspace, struct heaps_slot *sweep_slot)
-{
- size_t free_num = 0, final_num = 0;
- RVALUE *p, *pend;
- RVALUE *free = freelist, *final = deferred_final_list;
- int deferred;
-
- p = sweep_slot->slot; pend = p + sweep_slot->limit;
- while (p < pend) {
- if (!(p->as.basic.flags & FL_MARK)) {
- if (p->as.basic.flags &&
- ((deferred = obj_free(objspace, (VALUE)p)) ||
- (FL_TEST(p, FL_FINALIZE)))) {
- if (!deferred) {
- p->as.free.flags = T_ZOMBIE;
- RDATA(p)->dfree = 0;
- }
- p->as.free.flags |= FL_MARK;
- p->as.free.next = deferred_final_list;
- deferred_final_list = p;
- final_num++;
- }
- else {
- add_freelist(objspace, p);
- free_num++;
- }
- }
- else if (BUILTIN_TYPE(p) == T_ZOMBIE) {
- /* objects to be finalized */
- /* do nothing remain marked */
- }
- else {
- RBASIC(p)->flags &= ~FL_MARK;
- }
- p++;
- }
- if (final_num + free_num == sweep_slot->limit &&
- objspace->heap.free_num > objspace->heap.do_heap_free) {
- RVALUE *pp;
-
- for (pp = deferred_final_list; pp != final; pp = pp->as.free.next) {
- RDATA(pp)->dmark = (void (*)(void *))(VALUE)sweep_slot;
- pp->as.free.flags |= FL_SINGLETON; /* freeing page mark */
- }
- sweep_slot->limit = final_num;
- freelist = free; /* cancel this page from freelist */
- unlink_heap_slot(objspace, sweep_slot);
- }
- else {
- objspace->heap.free_num += free_num;
- }
- objspace->heap.final_num += final_num;
-
- if (deferred_final_list) {
- rb_thread_t *th = GET_THREAD();
- if (th) {
- RUBY_VM_SET_FINALIZER_INTERRUPT(th);
- }
- }
-}
-
-static int
-ready_to_gc(rb_objspace_t *objspace)
-{
- if (dont_gc || during_gc) {
- if (!freelist) {
- if (!heaps_increment(objspace)) {
- set_heaps_increment(objspace);
- heaps_increment(objspace);
- }
+ aligned_free(last);
}
- return FALSE;
- }
- return TRUE;
-}
-
-static void
-before_gc_sweep(rb_objspace_t *objspace)
-{
- freelist = 0;
- objspace->heap.do_heap_free = (size_t)((heaps_used * HEAP_OBJ_LIMIT) * 0.65);
- objspace->heap.free_min = (size_t)((heaps_used * HEAP_OBJ_LIMIT) * 0.2);
- if (objspace->heap.free_min < initial_free_min) {
- objspace->heap.do_heap_free = heaps_used * HEAP_OBJ_LIMIT;
- objspace->heap.free_min = initial_free_min;
- }
- objspace->heap.sweep_slots = heaps;
- objspace->heap.free_num = 0;
-
- /* sweep unlinked method entries */
- if (GET_VM()->unlinked_method_entry_list) {
- rb_sweep_method_entry(GET_VM());
- }
-}
-
-static void
-after_gc_sweep(rb_objspace_t *objspace)
-{
- GC_PROF_SET_MALLOC_INFO;
-
- if (objspace->heap.free_num < objspace->heap.free_min) {
- set_heaps_increment(objspace);
- heaps_increment(objspace);
- }
-
- if (malloc_increase > malloc_limit) {
- malloc_limit += (size_t)((malloc_increase - malloc_limit) * (double)objspace->heap.live_num / (heaps_used * HEAP_OBJ_LIMIT));
- if (malloc_limit < initial_malloc_limit) malloc_limit = initial_malloc_limit;
- }
- malloc_increase = 0;
-
- free_unused_heaps(objspace);
-}
-
-static int
-lazy_sweep(rb_objspace_t *objspace)
-{
- struct heaps_slot *next;
-
- heaps_increment(objspace);
- while (objspace->heap.sweep_slots) {
- next = objspace->heap.sweep_slots->next;
- slot_sweep(objspace, objspace->heap.sweep_slots);
- objspace->heap.sweep_slots = next;
- if (freelist) {
- during_gc = 0;
- return TRUE;
- }
- }
- return FALSE;
-}
-
-static void
-rest_sweep(rb_objspace_t *objspace)
-{
- if (objspace->heap.sweep_slots) {
- while (objspace->heap.sweep_slots) {
- lazy_sweep(objspace);
- }
- after_gc_sweep(objspace);
- }
-}
-
-static void gc_marks(rb_objspace_t *objspace);
-
-static int
-gc_lazy_sweep(rb_objspace_t *objspace)
-{
- int res;
- INIT_GC_PROF_PARAMS;
-
- if (objspace->flags.dont_lazy_sweep)
- return garbage_collect(objspace);
-
-
- if (!ready_to_gc(objspace)) return TRUE;
-
- during_gc++;
- GC_PROF_TIMER_START;
- GC_PROF_SWEEP_TIMER_START;
-
- if (objspace->heap.sweep_slots) {
- res = lazy_sweep(objspace);
- if (res) {
- GC_PROF_SWEEP_TIMER_STOP;
- GC_PROF_SET_MALLOC_INFO;
- GC_PROF_TIMER_STOP(Qfalse);
- return res;
- }
- after_gc_sweep(objspace);
- }
-
- gc_marks(objspace);
-
- before_gc_sweep(objspace);
- if (objspace->heap.free_min > (heaps_used * HEAP_OBJ_LIMIT - objspace->heap.live_num)) {
- set_heaps_increment(objspace);
- }
-
- GC_PROF_SWEEP_TIMER_START;
- if(!(res = lazy_sweep(objspace))) {
- after_gc_sweep(objspace);
- if(freelist) {
- res = TRUE;
- during_gc = 0;
- }
}
- GC_PROF_SWEEP_TIMER_STOP;
-
- GC_PROF_TIMER_STOP(Qtrue);
- return res;
}
-
-static void
-gc_sweep(rb_objspace_t *objspace)
-{
- struct heaps_slot *next;
-
- before_gc_sweep(objspace);
-
- while (objspace->heap.sweep_slots) {
- next = objspace->heap.sweep_slots->next;
- slot_sweep(objspace, objspace->heap.sweep_slots);
- objspace->heap.sweep_slots = next;
- }
-
- after_gc_sweep(objspace);
-
- during_gc = 0;
-}
-
-void
-rb_gc_force_recycle(VALUE p)
-{
- rb_objspace_t *objspace = &rb_objspace;
- GC_PROF_DEC_LIVE_NUM;
- if (RBASIC(p)->flags & FL_MARK) {
- RANY(p)->as.free.flags = 0;
- }
- else {
- add_freelist(objspace, (RVALUE *)p);
- }
-}
-
static inline void
make_deferred(RVALUE *p)
{
@@ -2258,7 +917,9 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
case T_MODULE:
case T_CLASS:
rb_clear_cache_by_class((VALUE)obj);
- rb_free_m_table(RCLASS_M_TBL(obj));
+ if (RCLASS_M_TBL(obj)) {
+ rb_free_m_table(RCLASS_M_TBL(obj));
+ }
if (RCLASS_IV_TBL(obj)) {
st_free_table(RCLASS_IV_TBL(obj));
}
@@ -2338,6 +999,11 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
xfree(RANY(obj)->as.node.u1.tbl);
}
break;
+ case NODE_ARGS:
+ if (RANY(obj)->as.node.u3.args) {
+ xfree(RANY(obj)->as.node.u3.args);
+ }
+ break;
case NODE_ALLOCA:
xfree(RANY(obj)->as.node.u1.node);
break;
@@ -2352,248 +1018,19 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
break;
default:
- rb_bug("gc_sweep(): unknown data type 0x%x(%p)",
- BUILTIN_TYPE(obj), (void*)obj);
+ rb_bug("gc_sweep(): unknown data type 0x%x(%p) 0x%"PRIxVALUE,
+ BUILTIN_TYPE(obj), (void*)obj, RBASIC(obj)->flags);
}
return 0;
}
-#define GC_NOTIFY 0
-
-#if STACK_GROW_DIRECTION < 0
-#define GET_STACK_BOUNDS(start, end, appendix) ((start) = STACK_END, (end) = STACK_START)
-#elif STACK_GROW_DIRECTION > 0
-#define GET_STACK_BOUNDS(start, end, appendix) ((start) = STACK_START, (end) = STACK_END+(appendix))
-#else
-#define GET_STACK_BOUNDS(start, end, appendix) \
- ((STACK_END < STACK_START) ? \
- ((start) = STACK_END, (end) = STACK_START) : ((start) = STACK_START, (end) = STACK_END+(appendix)))
-#endif
-
-#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
-
-static void
-mark_current_machine_context(rb_objspace_t *objspace, rb_thread_t *th)
-{
- union {
- rb_jmp_buf j;
- VALUE v[sizeof(rb_jmp_buf) / sizeof(VALUE)];
- } save_regs_gc_mark;
- VALUE *stack_start, *stack_end;
-
- FLUSH_REGISTER_WINDOWS;
- /* This assumes that all registers are saved into the jmp_buf (and stack) */
- rb_setjmp(save_regs_gc_mark.j);
-
- SET_STACK_END;
- GET_STACK_BOUNDS(stack_start, stack_end, 1);
-
- mark_locations_array(objspace, save_regs_gc_mark.v, numberof(save_regs_gc_mark.v));
-
- rb_gc_mark_locations(stack_start, stack_end);
-#ifdef __ia64
- rb_gc_mark_locations(th->machine_register_stack_start, th->machine_register_stack_end);
-#endif
-#if defined(__mc68000__)
- mark_locations_array(objspace, (VALUE*)((char*)STACK_END + 2),
- (STACK_START - STACK_END));
-#endif
-}
-
-static void
-gc_clear_mark_on_sweep_slots(rb_objspace_t *objspace)
-{
- struct heaps_slot *scan;
- RVALUE *p, *pend;
-
- if (objspace->heap.sweep_slots) {
- while (objspace->heap.sweep_slots) {
- scan = objspace->heap.sweep_slots;
- p = scan->slot; pend = p + scan->limit;
- while (p < pend) {
- if (p->as.free.flags & FL_MARK && BUILTIN_TYPE(p) != T_ZOMBIE) {
- p->as.basic.flags &= ~FL_MARK;
- }
- p++;
- }
- objspace->heap.sweep_slots = objspace->heap.sweep_slots->next;
- }
- }
-}
-
-static void
-gc_marks(rb_objspace_t *objspace)
-{
- struct gc_list *list;
- rb_thread_t *th = GET_THREAD();
- GC_PROF_MARK_TIMER_START;
-
- objspace->heap.live_num = 0;
- objspace->count++;
-
-
- gc_clear_mark_on_sweep_slots(objspace);
-
- SET_STACK_END;
-
- init_mark_stack(objspace);
-
- th->vm->self ? rb_gc_mark(th->vm->self) : rb_vm_mark(th->vm);
-
- mark_tbl(objspace, finalizer_table, 0);
- mark_current_machine_context(objspace, th);
-
- rb_gc_mark_symbols();
- rb_gc_mark_encodings();
-
- /* mark protected global variables */
- for (list = global_List; list; list = list->next) {
- rb_gc_mark_maybe(*list->varptr);
- }
- rb_mark_end_proc();
- rb_gc_mark_global_tbl();
-
- mark_tbl(objspace, rb_class_tbl, 0);
-
- /* mark generic instance variables for special constants */
- rb_mark_generic_ivar_tbl();
-
- rb_gc_mark_parser();
-
- rb_gc_mark_unlinked_live_method_entries(th->vm);
-
- /* gc_mark objects whose marking are not completed*/
- while (!MARK_STACK_EMPTY) {
- if (mark_stack_overflow) {
- gc_mark_all(objspace);
- }
- else {
- gc_mark_rest(objspace);
- }
- }
- GC_PROF_MARK_TIMER_STOP;
-}
-
-static int
-garbage_collect(rb_objspace_t *objspace)
-{
- INIT_GC_PROF_PARAMS;
-
- if (GC_NOTIFY) printf("start garbage_collect()\n");
-
- if (!heaps) {
- return FALSE;
- }
- if (!ready_to_gc(objspace)) {
- return TRUE;
- }
-
- GC_PROF_TIMER_START;
-
- during_gc++;
- gc_marks(objspace);
-
- GC_PROF_SWEEP_TIMER_START;
- gc_sweep(objspace);
- GC_PROF_SWEEP_TIMER_STOP;
-
- GC_PROF_TIMER_STOP(Qtrue);
- if (GC_NOTIFY) printf("end garbage_collect()\n");
- return TRUE;
-}
-
-int
-rb_garbage_collect(void)
-{
- return garbage_collect(&rb_objspace);
-}
-
-void
-rb_gc_mark_machine_stack(rb_thread_t *th)
-{
- rb_objspace_t *objspace = &rb_objspace;
- VALUE *stack_start, *stack_end;
-
- GET_STACK_BOUNDS(stack_start, stack_end, 0);
- rb_gc_mark_locations(stack_start, stack_end);
-#ifdef __ia64
- rb_gc_mark_locations(th->machine_register_stack_start, th->machine_register_stack_end);
-#endif
-}
-
-
-/*
- * call-seq:
- * GC.start -> nil
- * gc.garbage_collect -> nil
- * ObjectSpace.garbage_collect -> nil
- *
- * Initiates garbage collection, unless manually disabled.
- *
- */
-
-VALUE
-rb_gc_start(void)
-{
- rb_gc();
- return Qnil;
-}
-
-#undef Init_stack
-
-void
-Init_stack(volatile VALUE *addr)
-{
- ruby_init_stack(addr);
-}
-
-/*
- * Document-class: ObjectSpace
- *
- * The <code>ObjectSpace</code> module contains a number of routines
- * that interact with the garbage collection facility and allow you to
- * traverse all living objects with an iterator.
- *
- * <code>ObjectSpace</code> also provides support for object
- * finalizers, procs that will be called when a specific object is
- * about to be destroyed by garbage collection.
- *
- * include ObjectSpace
- *
- *
- * a = "A"
- * b = "B"
- * c = "C"
- *
- *
- * define_finalizer(a, proc {|id| puts "Finalizer one on #{id}" })
- * define_finalizer(a, proc {|id| puts "Finalizer two on #{id}" })
- * define_finalizer(b, proc {|id| puts "Finalizer three on #{id}" })
- *
- * <em>produces:</em>
- *
- * Finalizer three on 537763470
- * Finalizer one on 537763480
- * Finalizer two on 537763480
- *
- */
-
void
Init_heap(void)
{
init_heap(&rb_objspace);
}
-static VALUE
-lazy_sweep_enable(void)
-{
- rb_objspace_t *objspace = &rb_objspace;
-
- objspace->flags.dont_lazy_sweep = FALSE;
- return Qnil;
-}
-
typedef int each_obj_callback(void *, void *, size_t, void *);
struct each_obj_args {
@@ -2613,16 +1050,16 @@ objspace_each_objects(VALUE arg)
i = 0;
while (i < heaps_used) {
- while (0 < i && (uintptr_t)membase < (uintptr_t)objspace->heap.sorted[i-1].slot->membase)
+ while (0 < i && (uintptr_t)membase < (uintptr_t)objspace->heap.sorted[i-1])
i--;
- while (i < heaps_used && (uintptr_t)objspace->heap.sorted[i].slot->membase <= (uintptr_t)membase)
+ while (i < heaps_used && (uintptr_t)objspace->heap.sorted[i] <= (uintptr_t)membase)
i++;
if (heaps_used <= i)
break;
- membase = objspace->heap.sorted[i].slot->membase;
+ membase = (RVALUE *)objspace->heap.sorted[i];
- pstart = objspace->heap.sorted[i].slot->slot;
- pend = pstart + objspace->heap.sorted[i].slot->limit;
+ pstart = objspace->heap.sorted[i]->start;
+ pend = pstart + objspace->heap.sorted[i]->limit;
for (; pstart != pend; pstart++) {
if (pstart->as.basic.flags) {
@@ -2636,6 +1073,7 @@ objspace_each_objects(VALUE arg)
}
}
}
+ RB_GC_GUARD(v);
return Qnil;
}
@@ -2696,30 +1134,46 @@ struct os_each_struct {
};
static int
+internal_object_p(VALUE obj)
+{
+ RVALUE *p = (RVALUE *)obj;
+
+ if (p->as.basic.flags) {
+ switch (BUILTIN_TYPE(p)) {
+ case T_NONE:
+ case T_ICLASS:
+ case T_NODE:
+ case T_ZOMBIE:
+ break;
+ case T_CLASS:
+ if (FL_TEST(p, FL_SINGLETON))
+ break;
+ default:
+ if (!p->as.basic.klass) break;
+ return 0;
+ }
+ }
+ return 1;
+}
+
+int
+rb_objspace_internal_object_p(VALUE obj)
+{
+ return internal_object_p(obj);
+}
+
+static int
os_obj_of_i(void *vstart, void *vend, size_t stride, void *data)
{
struct os_each_struct *oes = (struct os_each_struct *)data;
RVALUE *p = (RVALUE *)vstart, *pend = (RVALUE *)vend;
- volatile VALUE v;
for (; p != pend; p++) {
- if (p->as.basic.flags) {
- switch (BUILTIN_TYPE(p)) {
- case T_NONE:
- case T_ICLASS:
- case T_NODE:
- case T_ZOMBIE:
- continue;
- case T_CLASS:
- if (FL_TEST(p, FL_SINGLETON))
- continue;
- default:
- if (!p->as.basic.klass) continue;
- v = (VALUE)p;
- if (!oes->of || rb_obj_is_kind_of(v, oes->of)) {
- rb_yield(v);
- oes->num++;
- }
+ volatile VALUE v = (VALUE)p;
+ if (!internal_object_p(v)) {
+ if (!oes->of || rb_obj_is_kind_of(v, oes->of)) {
+ rb_yield(v);
+ oes->num++;
}
}
}
@@ -2801,6 +1255,12 @@ os_each_obj(int argc, VALUE *argv, VALUE os)
static VALUE
undefine_final(VALUE os, VALUE obj)
{
+ return rb_undefine_final(obj);
+}
+
+VALUE
+rb_undefine_final(VALUE obj)
+{
rb_objspace_t *objspace = &rb_objspace;
st_data_t data = obj;
rb_check_frozen(obj);
@@ -2821,9 +1281,7 @@ undefine_final(VALUE os, VALUE obj)
static VALUE
define_final(int argc, VALUE *argv, VALUE os)
{
- rb_objspace_t *objspace = &rb_objspace;
- VALUE obj, block, table;
- st_data_t data;
+ VALUE obj, block;
rb_scan_args(argc, argv, "11", &obj, &block);
rb_check_frozen(obj);
@@ -2834,6 +1292,17 @@ define_final(int argc, VALUE *argv, VALUE os)
rb_raise(rb_eArgError, "wrong type argument %s (should be callable)",
rb_obj_classname(block));
}
+
+ return define_final0(obj, block);
+}
+
+static VALUE
+define_final0(VALUE obj, VALUE block)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+ VALUE table;
+ st_data_t data;
+
if (!FL_ABLE(obj)) {
rb_raise(rb_eArgError, "cannot define finalizer for %s",
rb_obj_classname(obj));
@@ -2855,6 +1324,17 @@ define_final(int argc, VALUE *argv, VALUE os)
return block;
}
+VALUE
+rb_define_final(VALUE obj, VALUE block)
+{
+ rb_check_frozen(obj);
+ if (!rb_respond_to(block, rb_intern("call"))) {
+ rb_raise(rb_eArgError, "wrong type argument %s (should be callable)",
+ rb_obj_classname(block));
+ }
+ return define_final0(obj, block);
+}
+
void
rb_gc_copy_finalizer(VALUE dest, VALUE obj)
{
@@ -2879,11 +1359,12 @@ run_single_final(VALUE arg)
}
static void
-run_finalizer(rb_objspace_t *objspace, VALUE objid, VALUE table)
+run_finalizer(rb_objspace_t *objspace, VALUE obj, VALUE table)
{
long i;
int status;
VALUE args[3];
+ VALUE objid = nonspecial_obj_id(obj);
if (RARRAY_LEN(table) > 0) {
args[1] = rb_obj_freeze(rb_ary_new3(1, objid));
@@ -2897,20 +1378,21 @@ run_finalizer(rb_objspace_t *objspace, VALUE objid, VALUE table)
VALUE final = RARRAY_PTR(table)[i];
args[0] = RARRAY_PTR(final)[1];
args[2] = FIX2INT(RARRAY_PTR(final)[0]);
+ status = 0;
rb_protect(run_single_final, (VALUE)args, &status);
+ if (status)
+ rb_set_errinfo(Qnil);
}
}
static void
run_final(rb_objspace_t *objspace, VALUE obj)
{
- VALUE objid;
RUBY_DATA_FUNC free_func = 0;
st_data_t key, table;
objspace->heap.final_num--;
- objid = rb_obj_id(obj); /* make obj into id */
RBASIC(obj)->klass = 0;
if (RTYPEDDATA_P(obj)) {
@@ -2925,7 +1407,28 @@ run_final(rb_objspace_t *objspace, VALUE obj)
key = (st_data_t)obj;
if (st_delete(finalizer_table, &key, &table)) {
- run_finalizer(objspace, objid, (VALUE)table);
+ run_finalizer(objspace, obj, (VALUE)table);
+ }
+}
+
+static void
+finalize_list(rb_objspace_t *objspace, RVALUE *p)
+{
+ while (p) {
+ RVALUE *tmp = p->as.free.next;
+ run_final(objspace, (VALUE)p);
+ if (!FL_TEST(p, FL_SINGLETON)) { /* not freeing page */
+ add_slot_local_freelist(objspace, p);
+ if (!is_lazy_sweeping(objspace)) {
+ objspace->total_freed_object_num++;
+ objspace->heap.free_num++;
+ }
+ }
+ else {
+ struct heaps_slot *slot = (struct heaps_slot *)(VALUE)RDATA(p)->dmark;
+ slot->header->limit--;
+ }
+ p = tmp;
}
}
@@ -2943,22 +1446,10 @@ finalize_deferred(rb_objspace_t *objspace)
void
rb_gc_finalize_deferred(void)
{
- finalize_deferred(&rb_objspace);
-}
-
-static int
-chain_finalized_object(st_data_t key, st_data_t val, st_data_t arg)
-{
- RVALUE *p = (RVALUE *)key, **final_list = (RVALUE **)arg;
- if ((p->as.basic.flags & (FL_FINALIZE|FL_MARK)) == FL_FINALIZE) {
- if (BUILTIN_TYPE(p) != T_ZOMBIE) {
- p->as.free.flags = FL_MARK | T_ZOMBIE; /* remain marked */
- RDATA(p)->dfree = 0;
- }
- p->as.free.next = *final_list;
- *final_list = p;
- }
- return ST_CONTINUE;
+ rb_objspace_t *objspace = &rb_objspace;
+ if (ATOMIC_EXCHANGE(finalizing, 1)) return;
+ finalize_deferred(objspace);
+ ATOMIC_SET(finalizing, 0);
}
struct force_finalize_list {
@@ -2992,25 +1483,23 @@ rb_objspace_call_finalizer(rb_objspace_t *objspace)
RVALUE *final_list = 0;
size_t i;
+ rest_sweep(objspace);
+
+ if (ATOMIC_EXCHANGE(finalizing, 1)) return;
+
/* run finalizers */
- gc_clear_mark_on_sweep_slots(objspace);
-
- do {
- /* XXX: this loop will make no sense */
- /* because mark will not be removed */
- finalize_deferred(objspace);
- mark_tbl(objspace, finalizer_table, 0);
- st_foreach(finalizer_table, chain_finalized_object,
- (st_data_t)&deferred_final_list);
- } while (deferred_final_list);
+ finalize_deferred(objspace);
+ assert(deferred_final_list == 0);
+
/* force to run finalizer */
while (finalizer_table->num_entries) {
struct force_finalize_list *list = 0;
st_foreach(finalizer_table, force_chain_object, (st_data_t)&list);
while (list) {
struct force_finalize_list *curr = list;
- run_finalizer(objspace, rb_obj_id(curr->obj), curr->table);
- st_delete(finalizer_table, (st_data_t*)&curr->obj, 0);
+ st_data_t obj = (st_data_t)curr->obj;
+ run_finalizer(objspace, curr->obj, curr->table);
+ st_delete(finalizer_table, &obj, 0);
list = curr->next;
xfree(curr);
}
@@ -3021,11 +1510,12 @@ rb_objspace_call_finalizer(rb_objspace_t *objspace)
/* run data object's finalizers */
for (i = 0; i < heaps_used; i++) {
- p = objspace->heap.sorted[i].start; pend = objspace->heap.sorted[i].end;
+ p = objspace->heap.sorted[i]->start; pend = p + objspace->heap.sorted[i]->limit;
while (p < pend) {
if (BUILTIN_TYPE(p) == T_DATA &&
DATA_PTR(p) && RANY(p)->as.data.dfree &&
- !rb_obj_is_thread((VALUE)p) && !rb_obj_is_mutex((VALUE)p) ) {
+ !rb_obj_is_thread((VALUE)p) && !rb_obj_is_mutex((VALUE)p) &&
+ !rb_obj_is_fiber((VALUE)p)) {
p->as.free.flags = 0;
if (RTYPEDDATA_P(p)) {
RDATA(p)->dfree = RANY(p)->as.typeddata.type->function.dfree;
@@ -3056,15 +1546,48 @@ rb_objspace_call_finalizer(rb_objspace_t *objspace)
st_free_table(finalizer_table);
finalizer_table = 0;
+ ATOMIC_SET(finalizing, 0);
}
-void
-rb_gc(void)
+static inline int
+is_id_value(rb_objspace_t *objspace, VALUE ptr)
{
- rb_objspace_t *objspace = &rb_objspace;
- garbage_collect(objspace);
- finalize_deferred(objspace);
- free_unused_heaps(objspace);
+ if (!is_pointer_to_heap(objspace, (void *)ptr)) return FALSE;
+ if (BUILTIN_TYPE(ptr) > T_FIXNUM) return FALSE;
+ if (BUILTIN_TYPE(ptr) == T_ICLASS) return FALSE;
+ return TRUE;
+}
+
+static inline int
+is_swept_object(rb_objspace_t *objspace, VALUE ptr)
+{
+ struct heaps_slot *slot = objspace->heap.sweep_slots;
+
+ while (slot) {
+ if ((VALUE)slot->header->start <= ptr && ptr < (VALUE)(slot->header->end))
+ return FALSE;
+ slot = slot->next;
+ }
+ return TRUE;
+}
+
+static inline int
+is_dead_object(rb_objspace_t *objspace, VALUE ptr)
+{
+ if (!is_lazy_sweeping(objspace) || MARKED_IN_BITMAP(GET_HEAP_BITMAP(ptr), ptr))
+ return FALSE;
+ if (!is_swept_object(objspace, ptr))
+ return TRUE;
+ return FALSE;
+}
+
+static inline int
+is_live_object(rb_objspace_t *objspace, VALUE ptr)
+{
+ if (BUILTIN_TYPE(ptr) == 0) return FALSE;
+ if (RBASIC(ptr)->klass == 0) return FALSE;
+ if (is_dead_object(objspace, ptr)) return FALSE;
+ return TRUE;
}
/*
@@ -3100,6 +1623,7 @@ id2ref(VALUE obj, VALUE objid)
if (ptr == Qfalse) return Qfalse;
if (ptr == Qnil) return Qnil;
if (FIXNUM_P(ptr)) return (VALUE)ptr;
+ if (FLONUM_P(ptr)) return (VALUE)ptr;
ptr = objid ^ FIXNUM_FLAG; /* unset FIXNUM_FLAG */
if ((ptr % sizeof(RVALUE)) == (4 << 2)) {
@@ -3109,11 +1633,10 @@ id2ref(VALUE obj, VALUE objid)
return ID2SYM(symid);
}
- if (!is_pointer_to_heap(objspace, (void *)ptr) ||
- BUILTIN_TYPE(ptr) > T_FIXNUM || BUILTIN_TYPE(ptr) == T_ICLASS) {
+ if (!is_id_value(objspace, ptr)) {
rb_raise(rb_eRangeError, "%p is not id value", p0);
}
- if (BUILTIN_TYPE(ptr) == 0 || RBASIC(ptr)->klass == 0) {
+ if (!is_live_object(objspace, ptr)) {
rb_raise(rb_eRangeError, "%p is recycled object", p0);
}
return (VALUE)ptr;
@@ -3124,26 +1647,33 @@ id2ref(VALUE obj, VALUE objid)
* Document-method: object_id
*
* call-seq:
- * obj.__id__ -> fixnum
- * obj.object_id -> fixnum
- *
- * Returns an integer identifier for <i>obj</i>. The same number will
- * be returned on all calls to <code>id</code> for a given object, and
- * no two active objects will share an id.
- * <code>Object#object_id</code> is a different concept from the
- * <code>:name</code> notation, which returns the symbol id of
- * <code>name</code>. Replaces the deprecated <code>Object#id</code>.
+ * obj.__id__ -> integer
+ * obj.object_id -> integer
+ *
+ * Returns an integer identifier for +obj+.
+ *
+ * The same number will be returned on all calls to +id+ for a given object,
+ * and no two active objects will share an id.
+ *
+ * Object#object_id is a different concept from the +:name+ notation, which
+ * returns the symbol id of +name+.
+ *
+ * Replaces the deprecated Object#id.
*/
/*
* call-seq:
* obj.hash -> fixnum
*
- * Generates a <code>Fixnum</code> hash value for this object. This
- * function must have the property that <code>a.eql?(b)</code> implies
- * <code>a.hash == b.hash</code>. The hash value is used by class
- * <code>Hash</code>. Any hash value that exceeds the capacity of a
- * <code>Fixnum</code> will be truncated before being used.
+ * Generates a Fixnum hash value for this object.
+ *
+ * This function must have the property that <code>a.eql?(b)</code> implies
+ * <code>a.hash == b.hash</code>.
+ *
+ * The hash value is used by Hash class.
+ *
+ * Any hash value that exceeds the capacity of a Fixnum will be truncated
+ * before being used.
*/
VALUE
@@ -3180,10 +1710,17 @@ rb_obj_id(VALUE obj)
if (SYMBOL_P(obj)) {
return (SYM2ID(obj) * sizeof(RVALUE) + (4 << 2)) | FIXNUM_FLAG;
}
- if (SPECIAL_CONST_P(obj)) {
- return LONG2NUM((SIGNED_VALUE)obj);
+ else if (FLONUM_P(obj)) {
+#if SIZEOF_LONG == SIZEOF_VOIDP
+ return LONG2NUM((SIGNED_VALUE)obj);
+#else
+ return LL2NUM((SIGNED_VALUE)obj);
+#endif
+ }
+ else if (SPECIAL_CONST_P(obj)) {
+ return LONG2NUM((SIGNED_VALUE)obj);
}
- return (VALUE)((SIGNED_VALUE)obj|FIXNUM_FLAG);
+ return nonspecial_obj_id(obj);
}
static int
@@ -3201,17 +1738,22 @@ set_zero(st_data_t key, st_data_t val, st_data_t arg)
*
* Counts objects for each type.
*
- * It returns a hash as:
- * {:TOTAL=>10000, :FREE=>3011, :T_OBJECT=>6, :T_CLASS=>404, ...}
+ * It returns a hash, such as:
+ * {
+ * :TOTAL=>10000,
+ * :FREE=>3011,
+ * :T_OBJECT=>6,
+ * :T_CLASS=>404,
+ * # ...
+ * }
*
- * If the optional argument, result_hash, is given,
- * it is overwritten and returned.
- * This is intended to avoid probe effect.
- *
- * The contents of the returned hash is implementation defined.
+ * The contents of the returned hash are implementation specific.
* It may be changed in future.
*
- * This method is not expected to work except C Ruby.
+ * If the optional argument +result_hash+ is given,
+ * it is overwritten and returned. This is intended to avoid probe effect.
+ *
+ * This method is only expected to work on C Ruby.
*
*/
@@ -3226,7 +1768,7 @@ count_objects(int argc, VALUE *argv, VALUE os)
VALUE hash;
if (rb_scan_args(argc, argv, "01", &hash) == 1) {
- if (TYPE(hash) != T_HASH)
+ if (!RB_TYPE_P(hash, T_HASH))
rb_raise(rb_eTypeError, "non-hash given");
}
@@ -3237,7 +1779,7 @@ count_objects(int argc, VALUE *argv, VALUE os)
for (i = 0; i < heaps_used; i++) {
RVALUE *p, *pend;
- p = objspace->heap.sorted[i].start; pend = objspace->heap.sorted[i].end;
+ p = objspace->heap.sorted[i]->start; pend = p + objspace->heap.sorted[i]->limit;
for (;p < pend; p++) {
if (p->as.basic.flags) {
counts[BUILTIN_TYPE(p)]++;
@@ -3246,7 +1788,7 @@ count_objects(int argc, VALUE *argv, VALUE os)
freed++;
}
}
- total += objspace->heap.sorted[i].slot->limit;
+ total += objspace->heap.sorted[i]->limit;
}
if (hash == Qnil) {
@@ -3297,6 +1839,1269 @@ count_objects(int argc, VALUE *argv, VALUE os)
return hash;
}
+
+
+/*
+ ------------------------ Garbage Collection ------------------------
+*/
+
+/* Sweeping */
+
+static VALUE
+lazy_sweep_enable(void)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+
+ objspace->flags.dont_lazy_sweep = FALSE;
+ return Qnil;
+}
+
+static void
+gc_clear_slot_bits(struct heaps_slot *slot)
+{
+ memset(slot->bits, 0, HEAP_BITMAP_LIMIT * sizeof(uintptr_t));
+}
+
+static size_t
+objspace_live_num(rb_objspace_t *objspace)
+{
+ return objspace->total_allocated_object_num - objspace->total_freed_object_num;
+}
+
+static void
+slot_sweep(rb_objspace_t *objspace, struct heaps_slot *sweep_slot)
+{
+ size_t empty_num = 0, freed_num = 0, final_num = 0;
+ RVALUE *p, *pend;
+ RVALUE *final = deferred_final_list;
+ int deferred;
+ uintptr_t *bits;
+
+ p = sweep_slot->header->start; pend = p + sweep_slot->header->limit;
+ bits = GET_HEAP_BITMAP(p);
+ while (p < pend) {
+ if ((!(MARKED_IN_BITMAP(bits, p))) && BUILTIN_TYPE(p) != T_ZOMBIE) {
+ if (p->as.basic.flags) {
+ if ((deferred = obj_free(objspace, (VALUE)p)) ||
+ (FL_TEST(p, FL_FINALIZE))) {
+ if (!deferred) {
+ p->as.free.flags = T_ZOMBIE;
+ RDATA(p)->dfree = 0;
+ }
+ p->as.free.next = deferred_final_list;
+ deferred_final_list = p;
+ assert(BUILTIN_TYPE(p) == T_ZOMBIE);
+ final_num++;
+ }
+ else {
+ (void)VALGRIND_MAKE_MEM_UNDEFINED((void*)p, sizeof(RVALUE));
+ p->as.free.flags = 0;
+ p->as.free.next = sweep_slot->freelist;
+ sweep_slot->freelist = p;
+ freed_num++;
+ }
+ }
+ else {
+ empty_num++;
+ }
+ }
+ p++;
+ }
+ gc_clear_slot_bits(sweep_slot);
+ if (final_num + freed_num + empty_num == sweep_slot->header->limit &&
+ objspace->heap.free_num > objspace->heap.do_heap_free) {
+ RVALUE *pp;
+
+ for (pp = deferred_final_list; pp != final; pp = pp->as.free.next) {
+ RDATA(pp)->dmark = (void (*)(void *))(VALUE)sweep_slot;
+ pp->as.free.flags |= FL_SINGLETON; /* freeing page mark */
+ }
+ sweep_slot->header->limit = final_num;
+ unlink_heap_slot(objspace, sweep_slot);
+ }
+ else {
+ if (freed_num + empty_num > 0) {
+ link_free_heap_slot(objspace, sweep_slot);
+ }
+ else {
+ sweep_slot->free_next = NULL;
+ }
+ objspace->total_freed_object_num += freed_num;
+ objspace->heap.free_num += freed_num + empty_num;
+ }
+ objspace->heap.final_num += final_num;
+
+ if (deferred_final_list && !finalizing) {
+ rb_thread_t *th = GET_THREAD();
+ if (th) {
+ RUBY_VM_SET_FINALIZER_INTERRUPT(th);
+ }
+ }
+}
+
+static int
+ready_to_gc(rb_objspace_t *objspace)
+{
+ if (dont_gc || during_gc) {
+ if (!has_free_object) {
+ if (!heaps_increment(objspace)) {
+ set_heaps_increment(objspace);
+ heaps_increment(objspace);
+ }
+ }
+ return FALSE;
+ }
+ return TRUE;
+}
+
+static void
+before_gc_sweep(rb_objspace_t *objspace)
+{
+ objspace->heap.do_heap_free = (size_t)((heaps_used * HEAP_OBJ_LIMIT) * 0.65);
+ objspace->heap.free_min = (size_t)((heaps_used * HEAP_OBJ_LIMIT) * 0.2);
+ if (objspace->heap.free_min < initial_free_min) {
+ objspace->heap.do_heap_free = heaps_used * HEAP_OBJ_LIMIT;
+ objspace->heap.free_min = initial_free_min;
+ }
+ objspace->heap.sweep_slots = heaps;
+ objspace->heap.free_num = 0;
+ objspace->heap.free_slots = NULL;
+
+ /* sweep unlinked method entries */
+ if (GET_VM()->unlinked_method_entry_list) {
+ rb_sweep_method_entry(GET_VM());
+ }
+}
+
+static void
+after_gc_sweep(rb_objspace_t *objspace)
+{
+ size_t inc;
+
+ gc_prof_set_malloc_info(objspace);
+ if (objspace->heap.free_num < objspace->heap.free_min) {
+ set_heaps_increment(objspace);
+ heaps_increment(objspace);
+ }
+
+ inc = ATOMIC_SIZE_EXCHANGE(malloc_increase, 0);
+ if (inc > malloc_limit) {
+ malloc_limit +=
+ (size_t)((inc - malloc_limit) * (double)objspace_live_num(objspace) / (heaps_used * HEAP_OBJ_LIMIT));
+ if (malloc_limit < initial_malloc_limit) malloc_limit = initial_malloc_limit;
+ }
+
+ free_unused_heaps(objspace);
+}
+
+static int
+lazy_sweep(rb_objspace_t *objspace)
+{
+ struct heaps_slot *next;
+
+ heaps_increment(objspace);
+ while (objspace->heap.sweep_slots) {
+ next = objspace->heap.sweep_slots->next;
+ slot_sweep(objspace, objspace->heap.sweep_slots);
+ objspace->heap.sweep_slots = next;
+ if (has_free_object) {
+ during_gc = 0;
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+static void
+rest_sweep(rb_objspace_t *objspace)
+{
+ if (objspace->heap.sweep_slots) {
+ while (objspace->heap.sweep_slots) {
+ lazy_sweep(objspace);
+ }
+ after_gc_sweep(objspace);
+ }
+}
+
+static void gc_marks(rb_objspace_t *objspace);
+
+static int
+gc_prepare_free_objects(rb_objspace_t *objspace)
+{
+ int res;
+
+ if (objspace->flags.dont_lazy_sweep)
+ return garbage_collect(objspace);
+
+
+ if (!ready_to_gc(objspace)) return TRUE;
+
+ during_gc++;
+ gc_prof_timer_start(objspace);
+ gc_prof_sweep_timer_start(objspace);
+
+ if (objspace->heap.sweep_slots) {
+ res = lazy_sweep(objspace);
+ if (res) {
+ gc_prof_sweep_timer_stop(objspace);
+ gc_prof_set_malloc_info(objspace);
+ gc_prof_timer_stop(objspace, Qfalse);
+ return res;
+ }
+ after_gc_sweep(objspace);
+ }
+ else {
+ if (heaps_increment(objspace)) {
+ during_gc = 0;
+ return TRUE;
+ }
+ }
+
+ gc_marks(objspace);
+
+ before_gc_sweep(objspace);
+ if (objspace->heap.free_min > (heaps_used * HEAP_OBJ_LIMIT - objspace_live_num(objspace))) {
+ set_heaps_increment(objspace);
+ }
+
+ gc_prof_sweep_timer_start(objspace);
+ if (!(res = lazy_sweep(objspace))) {
+ after_gc_sweep(objspace);
+ if (has_free_object) {
+ res = TRUE;
+ during_gc = 0;
+ }
+ }
+ gc_prof_sweep_timer_stop(objspace);
+
+ gc_prof_timer_stop(objspace, Qtrue);
+ return res;
+}
+
+static void
+gc_sweep(rb_objspace_t *objspace)
+{
+ struct heaps_slot *next;
+
+ before_gc_sweep(objspace);
+
+ while (objspace->heap.sweep_slots) {
+ next = objspace->heap.sweep_slots->next;
+ slot_sweep(objspace, objspace->heap.sweep_slots);
+ objspace->heap.sweep_slots = next;
+ }
+
+ after_gc_sweep(objspace);
+
+ during_gc = 0;
+}
+
+/* Marking stack */
+
+static void push_mark_stack(mark_stack_t *, VALUE);
+static int pop_mark_stack(mark_stack_t *, VALUE *);
+static void shrink_stack_chunk_cache(mark_stack_t *stack);
+
+static stack_chunk_t *
+stack_chunk_alloc(void)
+{
+ stack_chunk_t *res;
+
+ res = malloc(sizeof(stack_chunk_t));
+ if (!res)
+ rb_memerror();
+
+ return res;
+}
+
+static inline int
+is_mark_stask_empty(mark_stack_t *stack)
+{
+ return stack->chunk == NULL;
+}
+
+static void
+add_stack_chunk_cache(mark_stack_t *stack, stack_chunk_t *chunk)
+{
+ chunk->next = stack->cache;
+ stack->cache = chunk;
+ stack->cache_size++;
+}
+
+static void
+shrink_stack_chunk_cache(mark_stack_t *stack)
+{
+ stack_chunk_t *chunk;
+
+ if (stack->unused_cache_size > (stack->cache_size/2)) {
+ chunk = stack->cache;
+ stack->cache = stack->cache->next;
+ stack->cache_size--;
+ free(chunk);
+ }
+ stack->unused_cache_size = stack->cache_size;
+}
+
+static void
+push_mark_stack_chunk(mark_stack_t *stack)
+{
+ stack_chunk_t *next;
+
+ assert(stack->index == stack->limit);
+ if (stack->cache_size > 0) {
+ next = stack->cache;
+ stack->cache = stack->cache->next;
+ stack->cache_size--;
+ if (stack->unused_cache_size > stack->cache_size)
+ stack->unused_cache_size = stack->cache_size;
+ }
+ else {
+ next = stack_chunk_alloc();
+ }
+ next->next = stack->chunk;
+ stack->chunk = next;
+ stack->index = 0;
+}
+
+static void
+pop_mark_stack_chunk(mark_stack_t *stack)
+{
+ stack_chunk_t *prev;
+
+ prev = stack->chunk->next;
+ assert(stack->index == 0);
+ add_stack_chunk_cache(stack, stack->chunk);
+ stack->chunk = prev;
+ stack->index = stack->limit;
+}
+
+#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
+static void
+free_stack_chunks(mark_stack_t *stack)
+{
+ stack_chunk_t *chunk = stack->chunk;
+ stack_chunk_t *next = NULL;
+
+ while (chunk != NULL) {
+ next = chunk->next;
+ free(chunk);
+ chunk = next;
+ }
+}
+#endif
+
+static void
+push_mark_stack(mark_stack_t *stack, VALUE data)
+{
+ if (stack->index == stack->limit) {
+ push_mark_stack_chunk(stack);
+ }
+ stack->chunk->data[stack->index++] = data;
+}
+
+static int
+pop_mark_stack(mark_stack_t *stack, VALUE *data)
+{
+ if (is_mark_stask_empty(stack)) {
+ return FALSE;
+ }
+ if (stack->index == 1) {
+ *data = stack->chunk->data[--stack->index];
+ pop_mark_stack_chunk(stack);
+ return TRUE;
+ }
+ *data = stack->chunk->data[--stack->index];
+ return TRUE;
+}
+
+static void
+init_mark_stack(mark_stack_t *stack)
+{
+ int i;
+
+ push_mark_stack_chunk(stack);
+ stack->limit = STACK_CHUNK_SIZE;
+
+ for(i=0; i < 4; i++) {
+ add_stack_chunk_cache(stack, stack_chunk_alloc());
+ }
+ stack->unused_cache_size = stack->cache_size;
+}
+
+
+/* Marking */
+
+#define MARK_IN_BITMAP(bits, p) (bits[BITMAP_INDEX(p)] = bits[BITMAP_INDEX(p)] | ((uintptr_t)1 << BITMAP_OFFSET(p)))
+
+
+#ifdef __ia64
+#define SET_STACK_END (SET_MACHINE_STACK_END(&th->machine_stack_end), th->machine_register_stack_end = rb_ia64_bsp())
+#else
+#define SET_STACK_END SET_MACHINE_STACK_END(&th->machine_stack_end)
+#endif
+
+#define STACK_START (th->machine_stack_start)
+#define STACK_END (th->machine_stack_end)
+#define STACK_LEVEL_MAX (th->machine_stack_maxsize/sizeof(VALUE))
+
+#if STACK_GROW_DIRECTION < 0
+# define STACK_LENGTH (size_t)(STACK_START - STACK_END)
+#elif STACK_GROW_DIRECTION > 0
+# define STACK_LENGTH (size_t)(STACK_END - STACK_START + 1)
+#else
+# define STACK_LENGTH ((STACK_END < STACK_START) ? (size_t)(STACK_START - STACK_END) \
+ : (size_t)(STACK_END - STACK_START + 1))
+#endif
+#if !STACK_GROW_DIRECTION
+int ruby_stack_grow_direction;
+int
+ruby_get_stack_grow_direction(volatile VALUE *addr)
+{
+ VALUE *end;
+ SET_MACHINE_STACK_END(&end);
+
+ if (end > addr) return ruby_stack_grow_direction = 1;
+ return ruby_stack_grow_direction = -1;
+}
+#endif
+
+size_t
+ruby_stack_length(VALUE **p)
+{
+ rb_thread_t *th = GET_THREAD();
+ SET_STACK_END;
+ if (p) *p = STACK_UPPER(STACK_END, STACK_START, STACK_END);
+ return STACK_LENGTH;
+}
+
+#if !(defined(POSIX_SIGNAL) && defined(SIGSEGV) && defined(HAVE_SIGALTSTACK))
+static int
+stack_check(int water_mark)
+{
+ int ret;
+ rb_thread_t *th = GET_THREAD();
+ SET_STACK_END;
+ ret = STACK_LENGTH > STACK_LEVEL_MAX - water_mark;
+#ifdef __ia64
+ if (!ret) {
+ ret = (VALUE*)rb_ia64_bsp() - th->machine_register_stack_start >
+ th->machine_register_stack_maxsize/sizeof(VALUE) - water_mark;
+ }
+#endif
+ return ret;
+}
+#endif
+
+#define STACKFRAME_FOR_CALL_CFUNC 512
+
+int
+ruby_stack_check(void)
+{
+#if defined(POSIX_SIGNAL) && defined(SIGSEGV) && defined(HAVE_SIGALTSTACK)
+ return 0;
+#else
+ return stack_check(STACKFRAME_FOR_CALL_CFUNC);
+#endif
+}
+
+static void
+mark_locations_array(rb_objspace_t *objspace, register VALUE *x, register long n)
+{
+ VALUE v;
+ while (n--) {
+ v = *x;
+ (void)VALGRIND_MAKE_MEM_DEFINED(&v, sizeof(v));
+ if (is_pointer_to_heap(objspace, (void *)v)) {
+ gc_mark(objspace, v);
+ }
+ x++;
+ }
+}
+
+static void
+gc_mark_locations(rb_objspace_t *objspace, VALUE *start, VALUE *end)
+{
+ long n;
+
+ if (end <= start) return;
+ n = end - start;
+ mark_locations_array(objspace, start, n);
+}
+
+void
+rb_gc_mark_locations(VALUE *start, VALUE *end)
+{
+ gc_mark_locations(&rb_objspace, start, end);
+}
+
+#define rb_gc_mark_locations(start, end) gc_mark_locations(objspace, (start), (end))
+
+struct mark_tbl_arg {
+ rb_objspace_t *objspace;
+};
+
+static int
+mark_entry(st_data_t key, st_data_t value, st_data_t data)
+{
+ struct mark_tbl_arg *arg = (void*)data;
+ gc_mark(arg->objspace, (VALUE)value);
+ return ST_CONTINUE;
+}
+
+static void
+mark_tbl(rb_objspace_t *objspace, st_table *tbl)
+{
+ struct mark_tbl_arg arg;
+ if (!tbl || tbl->num_entries == 0) return;
+ arg.objspace = objspace;
+ st_foreach(tbl, mark_entry, (st_data_t)&arg);
+}
+
+static int
+mark_key(st_data_t key, st_data_t value, st_data_t data)
+{
+ struct mark_tbl_arg *arg = (void*)data;
+ gc_mark(arg->objspace, (VALUE)key);
+ return ST_CONTINUE;
+}
+
+static void
+mark_set(rb_objspace_t *objspace, st_table *tbl)
+{
+ struct mark_tbl_arg arg;
+ if (!tbl) return;
+ arg.objspace = objspace;
+ st_foreach(tbl, mark_key, (st_data_t)&arg);
+}
+
+void
+rb_mark_set(st_table *tbl)
+{
+ mark_set(&rb_objspace, tbl);
+}
+
+static int
+mark_keyvalue(st_data_t key, st_data_t value, st_data_t data)
+{
+ struct mark_tbl_arg *arg = (void*)data;
+ gc_mark(arg->objspace, (VALUE)key);
+ gc_mark(arg->objspace, (VALUE)value);
+ return ST_CONTINUE;
+}
+
+static void
+mark_hash(rb_objspace_t *objspace, st_table *tbl)
+{
+ struct mark_tbl_arg arg;
+ if (!tbl) return;
+ arg.objspace = objspace;
+ st_foreach(tbl, mark_keyvalue, (st_data_t)&arg);
+}
+
+void
+rb_mark_hash(st_table *tbl)
+{
+ mark_hash(&rb_objspace, tbl);
+}
+
+static void
+mark_method_entry(rb_objspace_t *objspace, const rb_method_entry_t *me)
+{
+ const rb_method_definition_t *def = me->def;
+
+ gc_mark(objspace, me->klass);
+ if (!def) return;
+ switch (def->type) {
+ case VM_METHOD_TYPE_ISEQ:
+ gc_mark(objspace, def->body.iseq->self);
+ break;
+ case VM_METHOD_TYPE_BMETHOD:
+ gc_mark(objspace, def->body.proc);
+ break;
+ case VM_METHOD_TYPE_ATTRSET:
+ case VM_METHOD_TYPE_IVAR:
+ gc_mark(objspace, def->body.attr.location);
+ break;
+ default:
+ break; /* ignore */
+ }
+}
+
+void
+rb_mark_method_entry(const rb_method_entry_t *me)
+{
+ mark_method_entry(&rb_objspace, me);
+}
+
+static int
+mark_method_entry_i(ID key, const rb_method_entry_t *me, st_data_t data)
+{
+ struct mark_tbl_arg *arg = (void*)data;
+ mark_method_entry(arg->objspace, me);
+ return ST_CONTINUE;
+}
+
+static void
+mark_m_tbl(rb_objspace_t *objspace, st_table *tbl)
+{
+ struct mark_tbl_arg arg;
+ if (!tbl) return;
+ arg.objspace = objspace;
+ st_foreach(tbl, mark_method_entry_i, (st_data_t)&arg);
+}
+
+static int
+mark_const_entry_i(ID key, const rb_const_entry_t *ce, st_data_t data)
+{
+ struct mark_tbl_arg *arg = (void*)data;
+ gc_mark(arg->objspace, ce->value);
+ gc_mark(arg->objspace, ce->file);
+ return ST_CONTINUE;
+}
+
+static void
+mark_const_tbl(rb_objspace_t *objspace, st_table *tbl)
+{
+ struct mark_tbl_arg arg;
+ if (!tbl) return;
+ arg.objspace = objspace;
+ st_foreach(tbl, mark_const_entry_i, (st_data_t)&arg);
+}
+
+#if STACK_GROW_DIRECTION < 0
+#define GET_STACK_BOUNDS(start, end, appendix) ((start) = STACK_END, (end) = STACK_START)
+#elif STACK_GROW_DIRECTION > 0
+#define GET_STACK_BOUNDS(start, end, appendix) ((start) = STACK_START, (end) = STACK_END+(appendix))
+#else
+#define GET_STACK_BOUNDS(start, end, appendix) \
+ ((STACK_END < STACK_START) ? \
+ ((start) = STACK_END, (end) = STACK_START) : ((start) = STACK_START, (end) = STACK_END+(appendix)))
+#endif
+
+#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
+
+static void
+mark_current_machine_context(rb_objspace_t *objspace, rb_thread_t *th)
+{
+ union {
+ rb_jmp_buf j;
+ VALUE v[sizeof(rb_jmp_buf) / sizeof(VALUE)];
+ } save_regs_gc_mark;
+ VALUE *stack_start, *stack_end;
+
+ FLUSH_REGISTER_WINDOWS;
+ /* This assumes that all registers are saved into the jmp_buf (and stack) */
+ rb_setjmp(save_regs_gc_mark.j);
+
+ SET_STACK_END;
+ GET_STACK_BOUNDS(stack_start, stack_end, 1);
+
+ mark_locations_array(objspace, save_regs_gc_mark.v, numberof(save_regs_gc_mark.v));
+
+ rb_gc_mark_locations(stack_start, stack_end);
+#ifdef __ia64
+ rb_gc_mark_locations(th->machine_register_stack_start, th->machine_register_stack_end);
+#endif
+#if defined(__mc68000__)
+ mark_locations_array(objspace, (VALUE*)((char*)STACK_END + 2),
+ (STACK_START - STACK_END));
+#endif
+}
+
+void
+rb_gc_mark_machine_stack(rb_thread_t *th)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+ VALUE *stack_start, *stack_end;
+
+ GET_STACK_BOUNDS(stack_start, stack_end, 0);
+ rb_gc_mark_locations(stack_start, stack_end);
+#ifdef __ia64
+ rb_gc_mark_locations(th->machine_register_stack_start, th->machine_register_stack_end);
+#endif
+}
+
+void
+rb_mark_tbl(st_table *tbl)
+{
+ mark_tbl(&rb_objspace, tbl);
+}
+
+void
+rb_gc_mark_maybe(VALUE obj)
+{
+ if (is_pointer_to_heap(&rb_objspace, (void *)obj)) {
+ gc_mark(&rb_objspace, obj);
+ }
+}
+
+static int
+gc_mark_ptr(rb_objspace_t *objspace, VALUE ptr)
+{
+ register uintptr_t *bits = GET_HEAP_BITMAP(ptr);
+ if (MARKED_IN_BITMAP(bits, ptr)) return 0;
+ MARK_IN_BITMAP(bits, ptr);
+ return 1;
+}
+
+static int
+markable_object_p(rb_objspace_t *objspace, VALUE ptr)
+{
+ register RVALUE *obj = RANY(ptr);
+
+ if (rb_special_const_p(ptr)) return 0; /* special const not marked */
+ if (obj->as.basic.flags == 0) return 0 ; /* free cell */
+
+ return 1;
+}
+
+int
+rb_objspace_markable_object_p(VALUE obj)
+{
+ return markable_object_p(/* now it doesn't use &rb_objspace */ 0, obj);
+}
+
+static void
+gc_mark(rb_objspace_t *objspace, VALUE ptr)
+{
+ if (!markable_object_p(objspace, ptr)) {
+ return;
+ }
+
+ if (LIKELY(objspace->mark_func_data == 0)) {
+ if (!gc_mark_ptr(objspace, ptr)) return; /* already marked */
+ push_mark_stack(&objspace->mark_stack, ptr);
+ }
+ else {
+ objspace->mark_func_data->mark_func(ptr, objspace->mark_func_data->data);
+ }
+}
+
+void
+rb_gc_mark(VALUE ptr)
+{
+ gc_mark(&rb_objspace, ptr);
+}
+
+static void
+gc_mark_children(rb_objspace_t *objspace, VALUE ptr)
+{
+ register RVALUE *obj = RANY(ptr);
+
+ goto marking; /* skip */
+
+ again:
+ if (LIKELY(objspace->mark_func_data == 0)) {
+ obj = RANY(ptr);
+ if (!markable_object_p(objspace, ptr)) return;
+ if (!gc_mark_ptr(objspace, ptr)) return; /* already marked */
+ }
+ else {
+ gc_mark(objspace, ptr);
+ return;
+ }
+
+ marking:
+ if (FL_TEST(obj, FL_EXIVAR)) {
+ rb_mark_generic_ivar(ptr);
+ }
+
+ switch (BUILTIN_TYPE(obj)) {
+ case T_NIL:
+ case T_FIXNUM:
+ rb_bug("rb_gc_mark() called for broken object");
+ break;
+
+ case T_NODE:
+ switch (nd_type(obj)) {
+ case NODE_IF: /* 1,2,3 */
+ case NODE_FOR:
+ case NODE_ITER:
+ case NODE_WHEN:
+ case NODE_MASGN:
+ case NODE_RESCUE:
+ case NODE_RESBODY:
+ case NODE_CLASS:
+ case NODE_BLOCK_PASS:
+ gc_mark(objspace, (VALUE)obj->as.node.u2.node);
+ /* fall through */
+ case NODE_BLOCK: /* 1,3 */
+ case NODE_ARRAY:
+ case NODE_DSTR:
+ case NODE_DXSTR:
+ case NODE_DREGX:
+ case NODE_DREGX_ONCE:
+ case NODE_ENSURE:
+ case NODE_CALL:
+ case NODE_DEFS:
+ case NODE_OP_ASGN1:
+ gc_mark(objspace, (VALUE)obj->as.node.u1.node);
+ /* fall through */
+ case NODE_SUPER: /* 3 */
+ case NODE_FCALL:
+ case NODE_DEFN:
+ case NODE_ARGS_AUX:
+ ptr = (VALUE)obj->as.node.u3.node;
+ goto again;
+
+ case NODE_WHILE: /* 1,2 */
+ case NODE_UNTIL:
+ case NODE_AND:
+ case NODE_OR:
+ case NODE_CASE:
+ case NODE_SCLASS:
+ case NODE_DOT2:
+ case NODE_DOT3:
+ case NODE_FLIP2:
+ case NODE_FLIP3:
+ case NODE_MATCH2:
+ case NODE_MATCH3:
+ case NODE_OP_ASGN_OR:
+ case NODE_OP_ASGN_AND:
+ case NODE_MODULE:
+ case NODE_ALIAS:
+ case NODE_VALIAS:
+ case NODE_ARGSCAT:
+ gc_mark(objspace, (VALUE)obj->as.node.u1.node);
+ /* fall through */
+ case NODE_GASGN: /* 2 */
+ case NODE_LASGN:
+ case NODE_DASGN:
+ case NODE_DASGN_CURR:
+ case NODE_IASGN:
+ case NODE_IASGN2:
+ case NODE_CVASGN:
+ case NODE_COLON3:
+ case NODE_OPT_N:
+ case NODE_EVSTR:
+ case NODE_UNDEF:
+ case NODE_POSTEXE:
+ ptr = (VALUE)obj->as.node.u2.node;
+ goto again;
+
+ case NODE_HASH: /* 1 */
+ case NODE_LIT:
+ case NODE_STR:
+ case NODE_XSTR:
+ case NODE_DEFINED:
+ case NODE_MATCH:
+ case NODE_RETURN:
+ case NODE_BREAK:
+ case NODE_NEXT:
+ case NODE_YIELD:
+ case NODE_COLON2:
+ case NODE_SPLAT:
+ case NODE_TO_ARY:
+ ptr = (VALUE)obj->as.node.u1.node;
+ goto again;
+
+ case NODE_SCOPE: /* 2,3 */
+ case NODE_CDECL:
+ case NODE_OPT_ARG:
+ gc_mark(objspace, (VALUE)obj->as.node.u3.node);
+ ptr = (VALUE)obj->as.node.u2.node;
+ goto again;
+
+ case NODE_ARGS: /* custom */
+ {
+ struct rb_args_info *args = obj->as.node.u3.args;
+ if (args) {
+ if (args->pre_init) gc_mark(objspace, (VALUE)args->pre_init);
+ if (args->post_init) gc_mark(objspace, (VALUE)args->post_init);
+ if (args->opt_args) gc_mark(objspace, (VALUE)args->opt_args);
+ if (args->kw_args) gc_mark(objspace, (VALUE)args->kw_args);
+ if (args->kw_rest_arg) gc_mark(objspace, (VALUE)args->kw_rest_arg);
+ }
+ }
+ ptr = (VALUE)obj->as.node.u2.node;
+ goto again;
+
+ case NODE_ZARRAY: /* - */
+ case NODE_ZSUPER:
+ case NODE_VCALL:
+ case NODE_GVAR:
+ case NODE_LVAR:
+ case NODE_DVAR:
+ case NODE_IVAR:
+ case NODE_CVAR:
+ case NODE_NTH_REF:
+ case NODE_BACK_REF:
+ case NODE_REDO:
+ case NODE_RETRY:
+ case NODE_SELF:
+ case NODE_NIL:
+ case NODE_TRUE:
+ case NODE_FALSE:
+ case NODE_ERRINFO:
+ case NODE_BLOCK_ARG:
+ break;
+ case NODE_ALLOCA:
+ mark_locations_array(objspace,
+ (VALUE*)obj->as.node.u1.value,
+ obj->as.node.u3.cnt);
+ gc_mark(objspace, (VALUE)obj->as.node.u2.node);
+ break;
+
+ case NODE_CREF:
+ gc_mark(objspace, obj->as.node.nd_refinements);
+ gc_mark(objspace, (VALUE)obj->as.node.u1.node);
+ ptr = (VALUE)obj->as.node.u3.node;
+ goto again;
+
+ default: /* unlisted NODE */
+ if (is_pointer_to_heap(objspace, obj->as.node.u1.node)) {
+ gc_mark(objspace, (VALUE)obj->as.node.u1.node);
+ }
+ if (is_pointer_to_heap(objspace, obj->as.node.u2.node)) {
+ gc_mark(objspace, (VALUE)obj->as.node.u2.node);
+ }
+ if (is_pointer_to_heap(objspace, obj->as.node.u3.node)) {
+ gc_mark(objspace, (VALUE)obj->as.node.u3.node);
+ }
+ }
+ return; /* no need to mark class. */
+ }
+
+ gc_mark(objspace, obj->as.basic.klass);
+ switch (BUILTIN_TYPE(obj)) {
+ case T_ICLASS:
+ case T_CLASS:
+ case T_MODULE:
+ mark_m_tbl(objspace, RCLASS_M_TBL(obj));
+ if (!RCLASS_EXT(obj)) break;
+ mark_tbl(objspace, RCLASS_IV_TBL(obj));
+ mark_const_tbl(objspace, RCLASS_CONST_TBL(obj));
+ ptr = RCLASS_SUPER(obj);
+ goto again;
+
+ case T_ARRAY:
+ if (FL_TEST(obj, ELTS_SHARED)) {
+ ptr = obj->as.array.as.heap.aux.shared;
+ goto again;
+ }
+ else {
+ long i, len = RARRAY_LEN(obj);
+ VALUE *ptr = RARRAY_PTR(obj);
+ for (i=0; i < len; i++) {
+ gc_mark(objspace, *ptr++);
+ }
+ }
+ break;
+
+ case T_HASH:
+ mark_hash(objspace, obj->as.hash.ntbl);
+ ptr = obj->as.hash.ifnone;
+ goto again;
+
+ case T_STRING:
+#define STR_ASSOC FL_USER3 /* copied from string.c */
+ if (FL_TEST(obj, RSTRING_NOEMBED) && FL_ANY(obj, ELTS_SHARED|STR_ASSOC)) {
+ ptr = obj->as.string.as.heap.aux.shared;
+ goto again;
+ }
+ break;
+
+ case T_DATA:
+ if (RTYPEDDATA_P(obj)) {
+ RUBY_DATA_FUNC mark_func = obj->as.typeddata.type->function.dmark;
+ if (mark_func) (*mark_func)(DATA_PTR(obj));
+ }
+ else {
+ if (obj->as.data.dmark) (*obj->as.data.dmark)(DATA_PTR(obj));
+ }
+ break;
+
+ case T_OBJECT:
+ {
+ long i, len = ROBJECT_NUMIV(obj);
+ VALUE *ptr = ROBJECT_IVPTR(obj);
+ for (i = 0; i < len; i++) {
+ gc_mark(objspace, *ptr++);
+ }
+ }
+ break;
+
+ case T_FILE:
+ if (obj->as.file.fptr) {
+ gc_mark(objspace, obj->as.file.fptr->pathv);
+ gc_mark(objspace, obj->as.file.fptr->tied_io_for_writing);
+ gc_mark(objspace, obj->as.file.fptr->writeconv_asciicompat);
+ gc_mark(objspace, obj->as.file.fptr->writeconv_pre_ecopts);
+ gc_mark(objspace, obj->as.file.fptr->encs.ecopts);
+ gc_mark(objspace, obj->as.file.fptr->write_lock);
+ }
+ break;
+
+ case T_REGEXP:
+ ptr = obj->as.regexp.src;
+ goto again;
+
+ case T_FLOAT:
+ case T_BIGNUM:
+ case T_ZOMBIE:
+ break;
+
+ case T_MATCH:
+ gc_mark(objspace, obj->as.match.regexp);
+ if (obj->as.match.str) {
+ ptr = obj->as.match.str;
+ goto again;
+ }
+ break;
+
+ case T_RATIONAL:
+ gc_mark(objspace, obj->as.rational.num);
+ ptr = obj->as.rational.den;
+ goto again;
+
+ case T_COMPLEX:
+ gc_mark(objspace, obj->as.complex.real);
+ ptr = obj->as.complex.imag;
+ goto again;
+
+ case T_STRUCT:
+ {
+ long len = RSTRUCT_LEN(obj);
+ VALUE *ptr = RSTRUCT_PTR(obj);
+
+ while (len--) {
+ gc_mark(objspace, *ptr++);
+ }
+ }
+ break;
+
+ default:
+ rb_bug("rb_gc_mark(): unknown data type 0x%x(%p) %s",
+ BUILTIN_TYPE(obj), (void *)obj,
+ is_pointer_to_heap(objspace, obj) ? "corrupted object" : "non object");
+ }
+}
+
+static void
+gc_mark_stacked_objects(rb_objspace_t *objspace)
+{
+ mark_stack_t *mstack = &objspace->mark_stack;
+ VALUE obj = 0;
+
+ if (!mstack->index) return;
+ while (pop_mark_stack(mstack, &obj)) {
+ gc_mark_children(objspace, obj);
+ }
+ shrink_stack_chunk_cache(mstack);
+}
+
+static void
+gc_marks(rb_objspace_t *objspace)
+{
+ struct gc_list *list;
+ rb_thread_t *th = GET_THREAD();
+ struct mark_func_data_struct *prev_mark_func_data;
+
+ prev_mark_func_data = objspace->mark_func_data;
+ objspace->mark_func_data = 0;
+
+ gc_prof_mark_timer_start(objspace);
+ objspace->count++;
+
+ SET_STACK_END;
+
+ th->vm->self ? rb_gc_mark(th->vm->self) : rb_vm_mark(th->vm);
+
+ mark_tbl(objspace, finalizer_table);
+ mark_current_machine_context(objspace, th);
+
+ rb_gc_mark_symbols();
+ rb_gc_mark_encodings();
+
+ /* mark protected global variables */
+ for (list = global_List; list; list = list->next) {
+ rb_gc_mark_maybe(*list->varptr);
+ }
+ rb_mark_end_proc();
+ rb_gc_mark_global_tbl();
+
+ mark_tbl(objspace, rb_class_tbl);
+
+ /* mark generic instance variables for special constants */
+ rb_mark_generic_ivar_tbl();
+
+ rb_gc_mark_parser();
+
+ rb_gc_mark_unlinked_live_method_entries(th->vm);
+
+ /* marking-loop */
+ gc_mark_stacked_objects(objspace);
+
+ gc_prof_mark_timer_stop(objspace);
+
+ objspace->mark_func_data = prev_mark_func_data;
+}
+
+/* GC */
+
+void
+rb_gc_force_recycle(VALUE p)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+ struct heaps_slot *slot;
+
+ if (MARKED_IN_BITMAP(GET_HEAP_BITMAP(p), p)) {
+ add_slot_local_freelist(objspace, (RVALUE *)p);
+ }
+ else {
+ objspace->total_freed_object_num++;
+ objspace->heap.free_num++;
+ slot = add_slot_local_freelist(objspace, (RVALUE *)p);
+ if (slot->free_next == NULL) {
+ link_free_heap_slot(objspace, slot);
+ }
+ }
+}
+
+void
+rb_gc_register_mark_object(VALUE obj)
+{
+ VALUE ary = GET_THREAD()->vm->mark_object_ary;
+ rb_ary_push(ary, obj);
+}
+
+void
+rb_gc_register_address(VALUE *addr)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+ struct gc_list *tmp;
+
+ tmp = ALLOC(struct gc_list);
+ tmp->next = global_List;
+ tmp->varptr = addr;
+ global_List = tmp;
+}
+
+void
+rb_gc_unregister_address(VALUE *addr)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+ struct gc_list *tmp = global_List;
+
+ if (tmp->varptr == addr) {
+ global_List = tmp->next;
+ xfree(tmp);
+ return;
+ }
+ while (tmp->next) {
+ if (tmp->next->varptr == addr) {
+ struct gc_list *t = tmp->next;
+
+ tmp->next = tmp->next->next;
+ xfree(t);
+ break;
+ }
+ tmp = tmp->next;
+ }
+}
+
+#define GC_NOTIFY 0
+
+static int
+garbage_collect(rb_objspace_t *objspace)
+{
+ if (GC_NOTIFY) printf("start garbage_collect()\n");
+
+ if (!heaps) {
+ return FALSE;
+ }
+ if (!ready_to_gc(objspace)) {
+ return TRUE;
+ }
+
+ gc_prof_timer_start(objspace);
+
+ rest_sweep(objspace);
+
+ during_gc++;
+ gc_marks(objspace);
+
+ gc_prof_sweep_timer_start(objspace);
+ gc_sweep(objspace);
+ gc_prof_sweep_timer_stop(objspace);
+
+ gc_prof_timer_stop(objspace, Qtrue);
+ if (GC_NOTIFY) printf("end garbage_collect()\n");
+ return TRUE;
+}
+
+static void *
+gc_with_gvl(void *ptr)
+{
+ return (void *)(VALUE)garbage_collect((rb_objspace_t *)ptr);
+}
+
+static int
+garbage_collect_with_gvl(rb_objspace_t *objspace)
+{
+ if (dont_gc) return TRUE;
+ if (ruby_thread_has_gvl_p()) {
+ return garbage_collect(objspace);
+ }
+ else {
+ if (ruby_native_thread_p()) {
+ return (int)(VALUE)rb_thread_call_with_gvl(gc_with_gvl, (void *)objspace);
+ }
+ else {
+ /* no ruby thread */
+ fprintf(stderr, "[FATAL] failed to allocate memory\n");
+ exit(EXIT_FAILURE);
+ }
+ }
+}
+
+int
+rb_garbage_collect(void)
+{
+ return garbage_collect(&rb_objspace);
+}
+
+#undef Init_stack
+
+void
+Init_stack(volatile VALUE *addr)
+{
+ ruby_init_stack(addr);
+}
+
+/*
+ * call-seq:
+ * GC.start -> nil
+ * gc.garbage_collect -> nil
+ * ObjectSpace.garbage_collect -> nil
+ *
+ * Initiates garbage collection, unless manually disabled.
+ *
+ */
+
+VALUE
+rb_gc_start(void)
+{
+ rb_gc();
+ return Qnil;
+}
+
+void
+rb_gc(void)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+ garbage_collect(objspace);
+ if (!finalizing) finalize_deferred(objspace);
+ free_unused_heaps(objspace);
+}
+
+int
+rb_during_gc(void)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+ return during_gc;
+}
+
/*
* call-seq:
* GC.count -> Integer
@@ -3310,7 +3115,7 @@ count_objects(int argc, VALUE *argv, VALUE os)
static VALUE
gc_count(VALUE self)
{
- return UINT2NUM((&rb_objspace)->count);
+ return UINT2NUM(rb_objspace.count);
}
/*
@@ -3321,17 +3126,19 @@ gc_count(VALUE self)
*
* The hash includes information about internal statistics about GC such as:
*
- * {
- * :count => 18,
- * :heap_used => 77,
- * :heap_length => 77,
- * :heap_increment => 0,
- * :heap_live_num => 23287,
- * :heap_free_num => 8115,
- * :heap_final_num => 0,
- * }
- *
- * The contents of the hash are implementation defined and may be changed in
+ * {
+ * :count=>0,
+ * :heap_used=>12,
+ * :heap_length=>12,
+ * :heap_increment=>0,
+ * :heap_live_num=>7539,
+ * :heap_free_num=>88,
+ * :heap_final_num=>0,
+ * :total_allocated_object=>7630,
+ * :total_freed_object=>88
+ * }
+ *
+ * The contents of the hash are implementation specific and may be changed in
* the future.
*
* This method is only expected to work on C Ruby.
@@ -3343,9 +3150,24 @@ gc_stat(int argc, VALUE *argv, VALUE self)
{
rb_objspace_t *objspace = &rb_objspace;
VALUE hash;
+ static VALUE sym_count;
+ static VALUE sym_heap_used, sym_heap_length, sym_heap_increment;
+ static VALUE sym_heap_live_num, sym_heap_free_num, sym_heap_final_num;
+ static VALUE sym_total_allocated_object, sym_total_freed_object;
+ if (sym_count == 0) {
+ sym_count = ID2SYM(rb_intern_const("count"));
+ sym_heap_used = ID2SYM(rb_intern_const("heap_used"));
+ sym_heap_length = ID2SYM(rb_intern_const("heap_length"));
+ sym_heap_increment = ID2SYM(rb_intern_const("heap_increment"));
+ sym_heap_live_num = ID2SYM(rb_intern_const("heap_live_num"));
+ sym_heap_free_num = ID2SYM(rb_intern_const("heap_free_num"));
+ sym_heap_final_num = ID2SYM(rb_intern_const("heap_final_num"));
+ sym_total_allocated_object = ID2SYM(rb_intern_const("total_allocated_object"));
+ sym_total_freed_object = ID2SYM(rb_intern_const("total_freed_object"));
+ }
if (rb_scan_args(argc, argv, "01", &hash) == 1) {
- if (TYPE(hash) != T_HASH)
+ if (!RB_TYPE_P(hash, T_HASH))
rb_raise(rb_eTypeError, "non-hash given");
}
@@ -3355,51 +3177,973 @@ gc_stat(int argc, VALUE *argv, VALUE self)
rest_sweep(objspace);
- rb_hash_aset(hash, ID2SYM(rb_intern("count")), SIZET2NUM(objspace->count));
-
+ rb_hash_aset(hash, sym_count, SIZET2NUM(objspace->count));
/* implementation dependent counters */
- rb_hash_aset(hash, ID2SYM(rb_intern("heap_used")), SIZET2NUM(objspace->heap.used));
- rb_hash_aset(hash, ID2SYM(rb_intern("heap_length")), SIZET2NUM(objspace->heap.length));
- rb_hash_aset(hash, ID2SYM(rb_intern("heap_increment")), SIZET2NUM(objspace->heap.increment));
- rb_hash_aset(hash, ID2SYM(rb_intern("heap_live_num")), SIZET2NUM(objspace->heap.live_num));
- rb_hash_aset(hash, ID2SYM(rb_intern("heap_free_num")), SIZET2NUM(objspace->heap.free_num));
- rb_hash_aset(hash, ID2SYM(rb_intern("heap_final_num")), SIZET2NUM(objspace->heap.final_num));
+ rb_hash_aset(hash, sym_heap_used, SIZET2NUM(objspace->heap.used));
+ rb_hash_aset(hash, sym_heap_length, SIZET2NUM(objspace->heap.length));
+ rb_hash_aset(hash, sym_heap_increment, SIZET2NUM(objspace->heap.increment));
+ rb_hash_aset(hash, sym_heap_live_num, SIZET2NUM(objspace_live_num(objspace)));
+ rb_hash_aset(hash, sym_heap_free_num, SIZET2NUM(objspace->heap.free_num));
+ rb_hash_aset(hash, sym_heap_final_num, SIZET2NUM(objspace->heap.final_num));
+ rb_hash_aset(hash, sym_total_allocated_object, SIZET2NUM(objspace->total_allocated_object_num));
+ rb_hash_aset(hash, sym_total_freed_object, SIZET2NUM(objspace->total_freed_object_num));
+
return hash;
}
+/*
+ * call-seq:
+ * GC.stress -> true or false
+ *
+ * Returns current status of GC stress mode.
+ */
+
+static VALUE
+gc_stress_get(VALUE self)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+ return ruby_gc_stress ? Qtrue : Qfalse;
+}
+
+/*
+ * call-seq:
+ * GC.stress = bool -> bool
+ *
+ * Updates the GC stress mode.
+ *
+ * When stress mode is enabled, the GC is invoked at every GC opportunity:
+ * all memory and object allocations.
+ *
+ * Enabling stress mode will degrade performance, it is only for debugging.
+ */
+
+static VALUE
+gc_stress_set(VALUE self, VALUE flag)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+ rb_secure(2);
+ ruby_gc_stress = RTEST(flag);
+ return flag;
+}
+
+/*
+ * call-seq:
+ * GC.enable -> true or false
+ *
+ * Enables garbage collection, returning +true+ if garbage
+ * collection was previously disabled.
+ *
+ * GC.disable #=> false
+ * GC.enable #=> true
+ * GC.enable #=> false
+ *
+ */
+
+VALUE
+rb_gc_enable(void)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+ int old = dont_gc;
+
+ dont_gc = FALSE;
+ return old ? Qtrue : Qfalse;
+}
+
+/*
+ * call-seq:
+ * GC.disable -> true or false
+ *
+ * Disables garbage collection, returning +true+ if garbage
+ * collection was already disabled.
+ *
+ * GC.disable #=> false
+ * GC.disable #=> true
+ *
+ */
+
+VALUE
+rb_gc_disable(void)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+ int old = dont_gc;
+
+ dont_gc = TRUE;
+ return old ? Qtrue : Qfalse;
+}
+
+void
+rb_gc_set_params(void)
+{
+ char *malloc_limit_ptr, *heap_min_slots_ptr, *free_min_ptr;
+
+ if (rb_safe_level() > 0) return;
+
+ malloc_limit_ptr = getenv("RUBY_GC_MALLOC_LIMIT");
+ if (malloc_limit_ptr != NULL) {
+ int malloc_limit_i = atoi(malloc_limit_ptr);
+ if (RTEST(ruby_verbose))
+ fprintf(stderr, "malloc_limit=%d (%d)\n",
+ malloc_limit_i, initial_malloc_limit);
+ if (malloc_limit_i > 0) {
+ initial_malloc_limit = malloc_limit_i;
+ }
+ }
+
+ heap_min_slots_ptr = getenv("RUBY_HEAP_MIN_SLOTS");
+ if (heap_min_slots_ptr != NULL) {
+ int heap_min_slots_i = atoi(heap_min_slots_ptr);
+ if (RTEST(ruby_verbose))
+ fprintf(stderr, "heap_min_slots=%d (%d)\n",
+ heap_min_slots_i, initial_heap_min_slots);
+ if (heap_min_slots_i > 0) {
+ initial_heap_min_slots = heap_min_slots_i;
+ initial_expand_heap(&rb_objspace);
+ }
+ }
+
+ free_min_ptr = getenv("RUBY_FREE_MIN");
+ if (free_min_ptr != NULL) {
+ int free_min_i = atoi(free_min_ptr);
+ if (RTEST(ruby_verbose))
+ fprintf(stderr, "free_min=%d (%d)\n", free_min_i, initial_free_min);
+ if (free_min_i > 0) {
+ initial_free_min = free_min_i;
+ }
+ }
+}
+
+void
+rb_objspace_reachable_objects_from(VALUE obj, void (func)(VALUE, void *), void *data)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+
+ if (markable_object_p(objspace, obj)) {
+ struct mark_func_data_struct mfd;
+ mfd.mark_func = func;
+ mfd.data = data;
+ objspace->mark_func_data = &mfd;
+ gc_mark_children(objspace, obj);
+ objspace->mark_func_data = 0;
+ }
+}
+
+/*
+ ------------------------ Extended allocator ------------------------
+*/
+
+static void vm_xfree(rb_objspace_t *objspace, void *ptr);
+
+static void *
+negative_size_allocation_error_with_gvl(void *ptr)
+{
+ rb_raise(rb_eNoMemError, "%s", (const char *)ptr);
+ return 0; /* should not be reached */
+}
+
+static void
+negative_size_allocation_error(const char *msg)
+{
+ if (ruby_thread_has_gvl_p()) {
+ rb_raise(rb_eNoMemError, "%s", msg);
+ }
+ else {
+ if (ruby_native_thread_p()) {
+ rb_thread_call_with_gvl(negative_size_allocation_error_with_gvl, (void *)msg);
+ }
+ else {
+ fprintf(stderr, "[FATAL] %s\n", msg);
+ exit(EXIT_FAILURE);
+ }
+ }
+}
+
+static void *
+ruby_memerror_body(void *dummy)
+{
+ rb_memerror();
+ return 0;
+}
+
+static void
+ruby_memerror(void)
+{
+ if (ruby_thread_has_gvl_p()) {
+ rb_memerror();
+ }
+ else {
+ if (ruby_native_thread_p()) {
+ rb_thread_call_with_gvl(ruby_memerror_body, 0);
+ }
+ else {
+ /* no ruby thread */
+ fprintf(stderr, "[FATAL] failed to allocate memory\n");
+ exit(EXIT_FAILURE);
+ }
+ }
+}
+
+void
+rb_memerror(void)
+{
+ rb_thread_t *th = GET_THREAD();
+ if (!nomem_error ||
+ (rb_thread_raised_p(th, RAISED_NOMEMORY) && rb_safe_level() < 4)) {
+ fprintf(stderr, "[FATAL] failed to allocate memory\n");
+ exit(EXIT_FAILURE);
+ }
+ if (rb_thread_raised_p(th, RAISED_NOMEMORY)) {
+ rb_thread_raised_clear(th);
+ GET_THREAD()->errinfo = nomem_error;
+ JUMP_TAG(TAG_RAISE);
+ }
+ rb_thread_raised_set(th, RAISED_NOMEMORY);
+ rb_exc_raise(nomem_error);
+}
+
+static void *
+aligned_malloc(size_t alignment, size_t size)
+{
+ void *res;
+
+#if defined __MINGW32__
+ res = __mingw_aligned_malloc(size, alignment);
+#elif defined _WIN32 && !defined __CYGWIN__
+ res = _aligned_malloc(size, alignment);
+#elif defined(HAVE_POSIX_MEMALIGN)
+ if (posix_memalign(&res, alignment, size) == 0) {
+ return res;
+ }
+ else {
+ return NULL;
+ }
+#elif defined(HAVE_MEMALIGN)
+ res = memalign(alignment, size);
+#else
+ char* aligned;
+ res = malloc(alignment + size + sizeof(void*));
+ aligned = (char*)res + alignment + sizeof(void*);
+ aligned -= ((VALUE)aligned & (alignment - 1));
+ ((void**)aligned)[-1] = res;
+ res = (void*)aligned;
+#endif
+
+#if defined(_DEBUG) || defined(GC_DEBUG)
+ /* alignment must be a power of 2 */
+ assert((alignment - 1) & alignment == 0);
+ assert(alignment % sizeof(void*) == 0);
+#endif
+ return res;
+}
+
+static void
+aligned_free(void *ptr)
+{
+#if defined __MINGW32__
+ __mingw_aligned_free(ptr);
+#elif defined _WIN32 && !defined __CYGWIN__
+ _aligned_free(ptr);
+#elif defined(HAVE_MEMALIGN) || defined(HAVE_POSIX_MEMALIGN)
+ free(ptr);
+#else
+ free(((void**)ptr)[-1]);
+#endif
+}
+
+static inline size_t
+vm_malloc_prepare(rb_objspace_t *objspace, size_t size)
+{
+ if ((ssize_t)size < 0) {
+ negative_size_allocation_error("negative allocation size (or too big)");
+ }
+ if (size == 0) size = 1;
+
+#if CALC_EXACT_MALLOC_SIZE
+ size += sizeof(size_t);
+#endif
+
+ if ((ruby_gc_stress && !ruby_disable_gc_stress) ||
+ (malloc_increase+size) > malloc_limit) {
+ garbage_collect_with_gvl(objspace);
+ }
+
+ return size;
+}
+
+static inline void *
+vm_malloc_fixup(rb_objspace_t *objspace, void *mem, size_t size)
+{
+ ATOMIC_SIZE_ADD(malloc_increase, size);
+
+#if CALC_EXACT_MALLOC_SIZE
+ ATOMIC_SIZE_ADD(objspace->malloc_params.allocated_size, size);
+ ATOMIC_SIZE_INC(objspace->malloc_params.allocations);
+ ((size_t *)mem)[0] = size;
+ mem = (size_t *)mem + 1;
+#endif
+
+ return mem;
+}
+
+#define TRY_WITH_GC(alloc) do { \
+ if (!(alloc) && \
+ (!garbage_collect_with_gvl(objspace) || \
+ !(alloc))) { \
+ ruby_memerror(); \
+ } \
+ } while (0)
+
+static void *
+vm_xmalloc(rb_objspace_t *objspace, size_t size)
+{
+ void *mem;
+
+ size = vm_malloc_prepare(objspace, size);
+ TRY_WITH_GC(mem = malloc(size));
+ return vm_malloc_fixup(objspace, mem, size);
+}
+
+static void *
+vm_xrealloc(rb_objspace_t *objspace, void *ptr, size_t size)
+{
+ void *mem;
+#if CALC_EXACT_MALLOC_SIZE
+ size_t oldsize;
+#endif
+
+ if ((ssize_t)size < 0) {
+ negative_size_allocation_error("negative re-allocation size");
+ }
+ if (!ptr) return vm_xmalloc(objspace, size);
+ if (size == 0) {
+ vm_xfree(objspace, ptr);
+ return 0;
+ }
+ if (ruby_gc_stress && !ruby_disable_gc_stress)
+ garbage_collect_with_gvl(objspace);
+
+#if CALC_EXACT_MALLOC_SIZE
+ size += sizeof(size_t);
+ ptr = (size_t *)ptr - 1;
+ oldsize = ((size_t *)ptr)[0];
+#endif
+
+ mem = realloc(ptr, size);
+ if (!mem) {
+ if (garbage_collect_with_gvl(objspace)) {
+ mem = realloc(ptr, size);
+ }
+ if (!mem) {
+ ruby_memerror();
+ }
+ }
+ ATOMIC_SIZE_ADD(malloc_increase, size);
+
+#if CALC_EXACT_MALLOC_SIZE
+ ATOMIC_SIZE_ADD(objspace->malloc_params.allocated_size, size - oldsize);
+ ((size_t *)mem)[0] = size;
+ mem = (size_t *)mem + 1;
+#endif
+
+ return mem;
+}
+
+static void
+vm_xfree(rb_objspace_t *objspace, void *ptr)
+{
+#if CALC_EXACT_MALLOC_SIZE
+ size_t size;
+ ptr = ((size_t *)ptr) - 1;
+ size = ((size_t*)ptr)[0];
+ if (size) {
+ ATOMIC_SIZE_SUB(objspace->malloc_params.allocated_size, size);
+ ATOMIC_SIZE_DEC(objspace->malloc_params.allocations);
+ }
+#endif
+
+ free(ptr);
+}
+
+void *
+ruby_xmalloc(size_t size)
+{
+ return vm_xmalloc(&rb_objspace, size);
+}
+
+static inline size_t
+xmalloc2_size(size_t n, size_t size)
+{
+ size_t len = size * n;
+ if (n != 0 && size != len / n) {
+ rb_raise(rb_eArgError, "malloc: possible integer overflow");
+ }
+ return len;
+}
+
+void *
+ruby_xmalloc2(size_t n, size_t size)
+{
+ return vm_xmalloc(&rb_objspace, xmalloc2_size(n, size));
+}
+
+static void *
+vm_xcalloc(rb_objspace_t *objspace, size_t count, size_t elsize)
+{
+ void *mem;
+ size_t size;
+
+ size = xmalloc2_size(count, elsize);
+ size = vm_malloc_prepare(objspace, size);
+
+ TRY_WITH_GC(mem = calloc(1, size));
+ return vm_malloc_fixup(objspace, mem, size);
+}
+
+void *
+ruby_xcalloc(size_t n, size_t size)
+{
+ return vm_xcalloc(&rb_objspace, n, size);
+}
+
+void *
+ruby_xrealloc(void *ptr, size_t size)
+{
+ return vm_xrealloc(&rb_objspace, ptr, size);
+}
+
+void *
+ruby_xrealloc2(void *ptr, size_t n, size_t size)
+{
+ size_t len = size * n;
+ if (n != 0 && size != len / n) {
+ rb_raise(rb_eArgError, "realloc: possible integer overflow");
+ }
+ return ruby_xrealloc(ptr, len);
+}
+
+void
+ruby_xfree(void *x)
+{
+ if (x)
+ vm_xfree(&rb_objspace, x);
+}
+
+
+/* Mimic ruby_xmalloc, but need not rb_objspace.
+ * should return pointer suitable for ruby_xfree
+ */
+void *
+ruby_mimmalloc(size_t size)
+{
+ void *mem;
+#if CALC_EXACT_MALLOC_SIZE
+ size += sizeof(size_t);
+#endif
+ mem = malloc(size);
+#if CALC_EXACT_MALLOC_SIZE
+ /* set 0 for consistency of allocated_size/allocations */
+ ((size_t *)mem)[0] = 0;
+ mem = (size_t *)mem + 1;
+#endif
+ return mem;
+}
#if CALC_EXACT_MALLOC_SIZE
/*
* call-seq:
* GC.malloc_allocated_size -> Integer
*
- * The allocated size by malloc().
+ * Returns the size of memory allocated by malloc().
*
- * It returns the allocated size by malloc().
+ * Only available if ruby was built with +CALC_EXACT_MALLOC_SIZE+.
*/
static VALUE
gc_malloc_allocated_size(VALUE self)
{
- return UINT2NUM((&rb_objspace)->malloc_params.allocated_size);
+ return UINT2NUM(rb_objspace.malloc_params.allocated_size);
}
/*
* call-seq:
* GC.malloc_allocations -> Integer
*
- * The number of allocated memory object by malloc().
+ * Returns the number of malloc() allocations.
*
- * It returns the number of allocated memory object by malloc().
+ * Only available if ruby was built with +CALC_EXACT_MALLOC_SIZE+.
*/
static VALUE
gc_malloc_allocations(VALUE self)
{
- return UINT2NUM((&rb_objspace)->malloc_params.allocations);
+ return UINT2NUM(rb_objspace.malloc_params.allocations);
}
#endif
+/*
+ ------------------------------ WeakMap ------------------------------
+*/
+
+struct weakmap {
+ st_table *obj2wmap; /* obj -> [ref,...] */
+ st_table *wmap2obj; /* ref -> obj */
+ VALUE final;
+};
+
+static int
+wmap_mark_map(st_data_t key, st_data_t val, st_data_t arg)
+{
+ gc_mark_ptr((rb_objspace_t *)arg, (VALUE)val);
+ return ST_CONTINUE;
+}
+
+static void
+wmap_mark(void *ptr)
+{
+ struct weakmap *w = ptr;
+ st_foreach(w->obj2wmap, wmap_mark_map, (st_data_t)&rb_objspace);
+ rb_gc_mark(w->final);
+}
+
+static int
+wmap_free_map(st_data_t key, st_data_t val, st_data_t arg)
+{
+ rb_ary_resize((VALUE)val, 0);
+ return ST_CONTINUE;
+}
+
+static void
+wmap_free(void *ptr)
+{
+ struct weakmap *w = ptr;
+ st_foreach(w->obj2wmap, wmap_free_map, 0);
+ st_free_table(w->obj2wmap);
+ st_free_table(w->wmap2obj);
+}
+
+size_t rb_ary_memsize(VALUE ary);
+static int
+wmap_memsize_map(st_data_t key, st_data_t val, st_data_t arg)
+{
+ *(size_t *)arg += rb_ary_memsize((VALUE)val);
+ return ST_CONTINUE;
+}
+
+static size_t
+wmap_memsize(const void *ptr)
+{
+ size_t size;
+ const struct weakmap *w = ptr;
+ if (!w) return 0;
+ size = sizeof(*w);
+ size += st_memsize(w->obj2wmap);
+ size += st_memsize(w->wmap2obj);
+ st_foreach(w->obj2wmap, wmap_memsize_map, (st_data_t)&size);
+ return size;
+}
+
+static const rb_data_type_t weakmap_type = {
+ "weakmap",
+ {
+ wmap_mark,
+ wmap_free,
+ wmap_memsize,
+ }
+};
+
+static VALUE
+wmap_allocate(VALUE klass)
+{
+ struct weakmap *w;
+ VALUE obj = TypedData_Make_Struct(klass, struct weakmap, &weakmap_type, w);
+ w->obj2wmap = st_init_numtable();
+ w->wmap2obj = st_init_numtable();
+ w->final = rb_obj_method(obj, ID2SYM(rb_intern("finalize")));
+ return obj;
+}
+
+static int
+wmap_final_func(st_data_t *key, st_data_t *value, st_data_t arg, int existing)
+{
+ VALUE wmap, ary;
+ if (!existing) return ST_STOP;
+ wmap = (VALUE)arg, ary = (VALUE)*value;
+ rb_ary_delete_same(ary, wmap);
+ if (!RARRAY_LEN(ary)) return ST_DELETE;
+ return ST_CONTINUE;
+}
+
+static VALUE
+wmap_finalize(VALUE self, VALUE objid)
+{
+ st_data_t orig, wmap, data;
+ VALUE obj, rids;
+ long i;
+ struct weakmap *w;
+
+ TypedData_Get_Struct(self, struct weakmap, &weakmap_type, w);
+ /* Get reference from object id. */
+ obj = objid ^ FIXNUM_FLAG; /* unset FIXNUM_FLAG */
+
+ /* obj is original referenced object and/or weak reference. */
+ orig = (st_data_t)obj;
+ if (st_delete(w->obj2wmap, &orig, &data)) {
+ rids = (VALUE)data;
+ for (i = 0; i < RARRAY_LEN(rids); ++i) {
+ wmap = (st_data_t)RARRAY_PTR(rids)[i];
+ st_delete(w->wmap2obj, &wmap, NULL);
+ }
+ }
+
+ wmap = (st_data_t)obj;
+ if (st_delete(w->wmap2obj, &wmap, &orig)) {
+ wmap = (st_data_t)obj;
+ st_update(w->obj2wmap, orig, wmap_final_func, wmap);
+ }
+ return self;
+}
+
+/* Creates a weak reference from the given key to the given value */
+static VALUE
+wmap_aset(VALUE self, VALUE wmap, VALUE orig)
+{
+ st_data_t data;
+ VALUE rids;
+ struct weakmap *w;
+
+ TypedData_Get_Struct(self, struct weakmap, &weakmap_type, w);
+ rb_define_final(orig, w->final);
+ rb_define_final(wmap, w->final);
+ if (st_lookup(w->obj2wmap, (st_data_t)orig, &data)) {
+ rids = (VALUE)data;
+ }
+ else {
+ rids = rb_ary_tmp_new(1);
+ st_insert(w->obj2wmap, (st_data_t)orig, (st_data_t)rids);
+ }
+ rb_ary_push(rids, wmap);
+ st_insert(w->wmap2obj, (st_data_t)wmap, (st_data_t)orig);
+ return nonspecial_obj_id(orig);
+}
+
+/* Retrieves a weakly referenced object with the given key */
+static VALUE
+wmap_aref(VALUE self, VALUE wmap)
+{
+ st_data_t data;
+ VALUE obj;
+ struct weakmap *w;
+ rb_objspace_t *objspace = &rb_objspace;
+
+ TypedData_Get_Struct(self, struct weakmap, &weakmap_type, w);
+ if (!st_lookup(w->wmap2obj, (st_data_t)wmap, &data)) return Qnil;
+ obj = (VALUE)data;
+ if (!is_id_value(objspace, obj)) return Qnil;
+ if (!is_live_object(objspace, obj)) return Qnil;
+ return obj;
+}
+
+
+/*
+ ------------------------------ GC profiler ------------------------------
+*/
+
+static inline void gc_prof_set_heap_info(rb_objspace_t *, gc_profile_record *);
+#define GC_PROFILE_RECORD_DEFAULT_SIZE 100
+
+static double
+getrusage_time(void)
+{
+#ifdef RUSAGE_SELF
+ struct rusage usage;
+ struct timeval time;
+ getrusage(RUSAGE_SELF, &usage);
+ time = usage.ru_utime;
+ return time.tv_sec + time.tv_usec * 1e-6;
+#elif defined _WIN32
+ FILETIME creation_time, exit_time, kernel_time, user_time;
+ ULARGE_INTEGER ui;
+ LONG_LONG q;
+ double t;
+
+ if (GetProcessTimes(GetCurrentProcess(),
+ &creation_time, &exit_time, &kernel_time, &user_time) == 0)
+ {
+ return 0.0;
+ }
+ memcpy(&ui, &user_time, sizeof(FILETIME));
+ q = ui.QuadPart / 10L;
+ t = (DWORD)(q % 1000000L) * 1e-6;
+ q /= 1000000L;
+#ifdef __GNUC__
+ t += q;
+#else
+ t += (double)(DWORD)(q >> 16) * (1 << 16);
+ t += (DWORD)q & ~(~0 << 16);
+#endif
+ return t;
+#else
+ return 0.0;
+#endif
+}
+
+static inline void
+gc_prof_timer_start(rb_objspace_t *objspace)
+{
+ if (objspace->profile.run) {
+ size_t count = objspace->profile.count;
+
+ if (!objspace->profile.record) {
+ objspace->profile.size = GC_PROFILE_RECORD_DEFAULT_SIZE;
+ objspace->profile.record = malloc(sizeof(gc_profile_record) * objspace->profile.size);
+ }
+ if (count >= objspace->profile.size) {
+ objspace->profile.size += 1000;
+ objspace->profile.record = realloc(objspace->profile.record, sizeof(gc_profile_record) * objspace->profile.size);
+ }
+ if (!objspace->profile.record) {
+ rb_bug("gc_profile malloc or realloc miss");
+ }
+ MEMZERO(&objspace->profile.record[count], gc_profile_record, 1);
+ objspace->profile.record[count].gc_time = getrusage_time();
+ objspace->profile.record[objspace->profile.count].gc_invoke_time =
+ objspace->profile.record[count].gc_time - objspace->profile.invoke_time;
+ }
+}
+
+static inline void
+gc_prof_timer_stop(rb_objspace_t *objspace, int marked)
+{
+ if (objspace->profile.run) {
+ double gc_time = 0;
+ size_t count = objspace->profile.count;
+ gc_profile_record *record = &objspace->profile.record[count];
+
+ gc_time = getrusage_time() - record->gc_time;
+ if (gc_time < 0) gc_time = 0;
+ record->gc_time = gc_time;
+ record->is_marked = !!(marked);
+ gc_prof_set_heap_info(objspace, record);
+ objspace->profile.count++;
+ }
+}
+
+#if !GC_PROFILE_MORE_DETAIL
+
+static inline void
+gc_prof_mark_timer_start(rb_objspace_t *objspace)
+{
+ if (RUBY_DTRACE_GC_MARK_BEGIN_ENABLED()) {
+ RUBY_DTRACE_GC_MARK_BEGIN();
+ }
+}
+
+static inline void
+gc_prof_mark_timer_stop(rb_objspace_t *objspace)
+{
+ if (RUBY_DTRACE_GC_MARK_END_ENABLED()) {
+ RUBY_DTRACE_GC_MARK_END();
+ }
+}
+
+static inline void
+gc_prof_sweep_timer_start(rb_objspace_t *objspace)
+{
+ if (RUBY_DTRACE_GC_SWEEP_BEGIN_ENABLED()) {
+ RUBY_DTRACE_GC_SWEEP_BEGIN();
+ }
+}
+
+static inline void
+gc_prof_sweep_timer_stop(rb_objspace_t *objspace)
+{
+ if (RUBY_DTRACE_GC_SWEEP_END_ENABLED()) {
+ RUBY_DTRACE_GC_SWEEP_END();
+ }
+}
+
+static inline void
+gc_prof_set_malloc_info(rb_objspace_t *objspace)
+{
+}
+
+static inline void
+gc_prof_set_heap_info(rb_objspace_t *objspace, gc_profile_record *record)
+{
+ size_t live = objspace_live_num(objspace);
+ size_t total = heaps_used * HEAP_OBJ_LIMIT;
+
+ record->heap_total_objects = total;
+ record->heap_use_size = live * sizeof(RVALUE);
+ record->heap_total_size = total * sizeof(RVALUE);
+}
+
+#else
+
+static inline void
+gc_prof_mark_timer_start(rb_objspace_t *objspace)
+{
+ if (RUBY_DTRACE_GC_MARK_BEGIN_ENABLED()) {
+ RUBY_DTRACE_GC_MARK_BEGIN();
+ }
+ if (objspace->profile.run) {
+ size_t count = objspace->profile.count;
+
+ objspace->profile.record[count].gc_mark_time = getrusage_time();
+ }
+}
+
+static inline void
+gc_prof_mark_timer_stop(rb_objspace_t *objspace)
+{
+ if (RUBY_DTRACE_GC_MARK_END_ENABLED()) {
+ RUBY_DTRACE_GC_MARK_END();
+ }
+ if (objspace->profile.run) {
+ double mark_time = 0;
+ size_t count = objspace->profile.count;
+ gc_profile_record *record = &objspace->profile.record[count];
+
+ mark_time = getrusage_time() - record->gc_mark_time;
+ if (mark_time < 0) mark_time = 0;
+ record->gc_mark_time = mark_time;
+ }
+}
+
+static inline void
+gc_prof_sweep_timer_start(rb_objspace_t *objspace)
+{
+ if (RUBY_DTRACE_GC_SWEEP_BEGIN_ENABLED()) {
+ RUBY_DTRACE_GC_SWEEP_BEGIN();
+ }
+ if (objspace->profile.run) {
+ size_t count = objspace->profile.count;
+
+ objspace->profile.record[count].gc_sweep_time = getrusage_time();
+ }
+}
+
+static inline void
+gc_prof_sweep_timer_stop(rb_objspace_t *objspace)
+{
+ if (RUBY_DTRACE_GC_SWEEP_END_ENABLED()) {
+ RUBY_DTRACE_GC_SWEEP_END();
+ }
+ if (objspace->profile.run) {
+ double sweep_time = 0;
+ size_t count = objspace->profile.count;
+ gc_profile_record *record = &objspace->profile.record[count];
+
+ sweep_time = getrusage_time() - record->gc_sweep_time;\
+ if (sweep_time < 0) sweep_time = 0;\
+ record->gc_sweep_time = sweep_time;
+ }
+}
+
+static inline void
+gc_prof_set_malloc_info(rb_objspace_t *objspace)
+{
+ if (objspace->profile.run) {
+ gc_profile_record *record = &objspace->profile.record[objspace->profile.count];
+ if (record) {
+ record->allocate_increase = malloc_increase;
+ record->allocate_limit = malloc_limit;
+ }
+ }
+}
+
+static inline void
+gc_prof_set_heap_info(rb_objspace_t *objspace, gc_profile_record *record)
+{
+ size_t live = objspace->heap.live_num;
+ size_t total = heaps_used * HEAP_OBJ_LIMIT;
+
+ record->heap_use_slots = heaps_used;
+ record->heap_live_objects = live;
+ record->heap_free_objects = total - live;
+ record->heap_total_objects = total;
+ record->have_finalize = deferred_final_list ? Qtrue : Qfalse;
+ record->heap_use_size = live * sizeof(RVALUE);
+ record->heap_total_size = total * sizeof(RVALUE);
+}
+
+#endif /* !GC_PROFILE_MORE_DETAIL */
+
+
+/*
+ * call-seq:
+ * GC::Profiler.clear -> nil
+ *
+ * Clears the GC profiler data.
+ *
+ */
+
+static VALUE
+gc_profile_clear(void)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+
+ if (GC_PROFILE_RECORD_DEFAULT_SIZE * 2 < objspace->profile.size) {
+ objspace->profile.size = GC_PROFILE_RECORD_DEFAULT_SIZE * 2;
+ objspace->profile.record = realloc(objspace->profile.record, sizeof(gc_profile_record) * objspace->profile.size);
+ if (!objspace->profile.record) {
+ rb_memerror();
+ }
+ }
+ MEMZERO(objspace->profile.record, gc_profile_record, objspace->profile.size);
+ objspace->profile.count = 0;
+ return Qnil;
+}
+
+/*
+ * call-seq:
+ * GC::Profiler.raw_data -> [Hash, ...]
+ *
+ * Returns an Array of individual raw profile data Hashes ordered
+ * from earliest to latest by +:GC_INVOKE_TIME+.
+ *
+ * For example:
+ *
+ * [
+ * {
+ * :GC_TIME=>1.3000000000000858e-05,
+ * :GC_INVOKE_TIME=>0.010634999999999999,
+ * :HEAP_USE_SIZE=>289640,
+ * :HEAP_TOTAL_SIZE=>588960,
+ * :HEAP_TOTAL_OBJECTS=>14724,
+ * :GC_IS_MARKED=>false
+ * },
+ * # ...
+ * ]
+ *
+ * The keys mean:
+ *
+ * +:GC_TIME+::
+ * Time elapsed in seconds for this GC run
+ * +:GC_INVOKE_TIME+::
+ * Time elapsed in seconds from startup to when the GC was invoked
+ * +:HEAP_USE_SIZE+::
+ * Total bytes of heap used
+ * +:HEAP_TOTAL_SIZE+::
+ * Total size of heap in bytes
+ * +:HEAP_TOTAL_OBJECTS+::
+ * Total number of objects
+ * +:GC_IS_MARKED+::
+ * Returns +true+ if the GC is in mark phase
+ *
+ * If ruby was built with +GC_PROFILE_MORE_DETAIL+, you will also have access
+ * to the following hash keys:
+ *
+ * +:GC_MARK_TIME+::
+ * +:GC_SWEEP_TIME+::
+ * +:ALLOCATE_INCREASE+::
+ * +:ALLOCATE_LIMIT+::
+ * +:HEAP_USE_SLOTS+::
+ * +:HEAP_LIVE_OBJECTS+::
+ * +:HEAP_FREE_OBJECTS+::
+ * +:HAVE_FINALIZE+::
+ *
+ */
+
static VALUE
gc_profile_record_get(void)
{
@@ -3436,75 +4180,71 @@ gc_profile_record_get(void)
return gc_profile;
}
-/*
- * call-seq:
- * GC::Profiler.result -> String
- *
- * Returns a profile data report such as:
- *
- * GC 1 invokes.
- * Index Invoke Time(sec) Use Size(byte) Total Size(byte) Total Object GC time(ms)
- * 1 0.012 159240 212940 10647 0.00000000000001530000
- */
-
-static VALUE
-gc_profile_result(void)
+static void
+gc_profile_dump_on(VALUE out, VALUE (*append)(VALUE, VALUE))
{
rb_objspace_t *objspace = &rb_objspace;
- VALUE record;
- VALUE result;
- int i, index;
+ size_t count = objspace->profile.count;
- record = gc_profile_record_get();
- if (objspace->profile.run && objspace->profile.count) {
- result = rb_sprintf("GC %d invokes.\n", NUM2INT(gc_count(0)));
- index = 1;
- rb_str_cat2(result, "Index Invoke Time(sec) Use Size(byte) Total Size(byte) Total Object GC Time(ms)\n");
- for (i = 0; i < (int)RARRAY_LEN(record); i++) {
- VALUE r = RARRAY_PTR(record)[i];
+ if (objspace->profile.run && count) {
+ int index = 1;
+ size_t i;
+ gc_profile_record r;
+ append(out, rb_sprintf("GC %"PRIuSIZE" invokes.\n", objspace->count));
+ append(out, rb_str_new_cstr("Index Invoke Time(sec) Use Size(byte) Total Size(byte) Total Object GC Time(ms)\n"));
+ for (i = 0; i < count; i++) {
+ r = objspace->profile.record[i];
#if !GC_PROFILE_MORE_DETAIL
- if (rb_hash_aref(r, ID2SYM(rb_intern("GC_IS_MARKED")))) {
+ if (r.is_marked) {
#endif
- rb_str_catf(result, "%5d %19.3f %20"PRIuSIZE" %20"PRIuSIZE" %20"PRIuSIZE" %30.20f\n",
- index++, NUM2DBL(rb_hash_aref(r, ID2SYM(rb_intern("GC_INVOKE_TIME")))),
- (size_t)NUM2SIZET(rb_hash_aref(r, ID2SYM(rb_intern("HEAP_USE_SIZE")))),
- (size_t)NUM2SIZET(rb_hash_aref(r, ID2SYM(rb_intern("HEAP_TOTAL_SIZE")))),
- (size_t)NUM2SIZET(rb_hash_aref(r, ID2SYM(rb_intern("HEAP_TOTAL_OBJECTS")))),
- NUM2DBL(rb_hash_aref(r, ID2SYM(rb_intern("GC_TIME"))))*1000);
+ append(out, rb_sprintf("%5d %19.3f %20"PRIuSIZE" %20"PRIuSIZE" %20"PRIuSIZE" %30.20f\n",
+ index++, r.gc_invoke_time, r.heap_use_size,
+ r.heap_total_size, r.heap_total_objects, r.gc_time*1000));
#if !GC_PROFILE_MORE_DETAIL
}
#endif
}
#if GC_PROFILE_MORE_DETAIL
- rb_str_cat2(result, "\n\n");
- rb_str_cat2(result, "More detail.\n");
- rb_str_cat2(result, "Index Allocate Increase Allocate Limit Use Slot Have Finalize Mark Time(ms) Sweep Time(ms)\n");
+ append(out, rb_str_new_cstr("\n\n" \
+ "More detail.\n" \
+ "Index Allocate Increase Allocate Limit Use Slot Have Finalize Mark Time(ms) Sweep Time(ms)\n"));
index = 1;
- for (i = 0; i < (int)RARRAY_LEN(record); i++) {
- VALUE r = RARRAY_PTR(record)[i];
- rb_str_catf(result, "%5d %17"PRIuSIZE" %17"PRIuSIZE" %9"PRIuSIZE" %14s %25.20f %25.20f\n",
- index++, (size_t)NUM2SIZET(rb_hash_aref(r, ID2SYM(rb_intern("ALLOCATE_INCREASE")))),
- (size_t)NUM2SIZET(rb_hash_aref(r, ID2SYM(rb_intern("ALLOCATE_LIMIT")))),
- (size_t)NUM2SIZET(rb_hash_aref(r, ID2SYM(rb_intern("HEAP_USE_SLOTS")))),
- rb_hash_aref(r, ID2SYM(rb_intern("HAVE_FINALIZE")))? "true" : "false",
- NUM2DBL(rb_hash_aref(r, ID2SYM(rb_intern("GC_MARK_TIME"))))*1000,
- NUM2DBL(rb_hash_aref(r, ID2SYM(rb_intern("GC_SWEEP_TIME"))))*1000);
+ for (i = 0; i < count; i++) {
+ r = objspace->profile.record[i];
+ append(out, rb_sprintf("%5d %17"PRIuSIZE" %17"PRIuSIZE" %9"PRIuSIZE" %14s %25.20f %25.20f\n",
+ index++, r.allocate_increase, r.allocate_limit,
+ r.heap_use_slots, (r.have_finalize ? "true" : "false"),
+ r.gc_mark_time*1000, r.gc_sweep_time*1000));
}
#endif
}
- else {
- result = rb_str_new2("");
- }
- return result;
}
+/*
+ * call-seq:
+ * GC::Profiler.result -> String
+ *
+ * Returns a profile data report such as:
+ *
+ * GC 1 invokes.
+ * Index Invoke Time(sec) Use Size(byte) Total Size(byte) Total Object GC time(ms)
+ * 1 0.012 159240 212940 10647 0.00000000000001530000
+ */
+
+static VALUE
+gc_profile_result(void)
+{
+ VALUE str = rb_str_buf_new(0);
+ gc_profile_dump_on(str, rb_str_buf_append);
+ return str;
+}
/*
* call-seq:
* GC::Profiler.report
- * GC::Profiler.report io
+ * GC::Profiler.report(io)
*
- * Writes the GC::Profiler#result to <tt>$stdout</tt> or the given IO object.
+ * Writes the GC::Profiler.result to <tt>$stdout</tt> or the given IO object.
*
*/
@@ -3519,16 +4259,16 @@ gc_profile_report(int argc, VALUE *argv, VALUE self)
else {
rb_scan_args(argc, argv, "01", &out);
}
- rb_io_write(out, gc_profile_result());
+ gc_profile_dump_on(out, rb_io_write);
return Qnil;
}
/*
* call-seq:
- * GC::Profiler.total_time -> float
+ * GC::Profiler.total_time -> float
*
- * The total time used for garbage collection in milliseconds
+ * The total time used for garbage collection in seconds
*/
static VALUE
@@ -3546,6 +4286,135 @@ gc_profile_total_time(VALUE self)
return DBL2NUM(time);
}
+/*
+ * call-seq:
+ * GC::Profiler.enabled? -> true or false
+ *
+ * The current status of GC profile mode.
+ */
+
+static VALUE
+gc_profile_enable_get(VALUE self)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+ return objspace->profile.run ? Qtrue : Qfalse;
+}
+
+/*
+ * call-seq:
+ * GC::Profiler.enable -> nil
+ *
+ * Starts the GC profiler.
+ *
+ */
+
+static VALUE
+gc_profile_enable(void)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+
+ objspace->profile.run = TRUE;
+ return Qnil;
+}
+
+/*
+ * call-seq:
+ * GC::Profiler.disable -> nil
+ *
+ * Stops the GC profiler.
+ *
+ */
+
+static VALUE
+gc_profile_disable(void)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+
+ objspace->profile.run = FALSE;
+ return Qnil;
+}
+
+#ifdef GC_DEBUG
+
+/*
+ ------------------------------ DEBUG ------------------------------
+*/
+
+void
+rb_gcdebug_print_obj_condition(VALUE obj)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+
+ if (is_pointer_to_heap(objspace, (void *)obj)) {
+ fprintf(stderr, "pointer to heap?: true\n");
+ }
+ else {
+ fprintf(stderr, "pointer to heap?: false\n");
+ return;
+ }
+ fprintf(stderr, "marked?: %s\n",
+ MARKED_IN_BITMAP(GET_HEAP_BITMAP(obj), obj) ? "true" : "false");
+ if (is_lazy_sweeping(objspace)) {
+ fprintf(stderr, "lazy sweeping?: true\n");
+ fprintf(stderr, "swept?: %s\n",
+ is_swept_object(objspace, obj) ? "done" : "not yet");
+ }
+ else {
+ fprintf(stderr, "lazy sweeping?: false\n");
+ }
+}
+
+static VALUE
+gcdebug_sential(VALUE obj, VALUE name)
+{
+ fprintf(stderr, "WARNING: object %s(%p) is inadvertently collected\n", (char *)name, (void *)obj);
+ return Qnil;
+}
+
+void
+rb_gcdebug_sentinel(VALUE obj, const char *name)
+{
+ rb_define_final(obj, rb_proc_new(gcdebug_sential, (VALUE)name));
+}
+#endif /* GC_DEBUG */
+
+
+/*
+ * Document-class: ObjectSpace
+ *
+ * The ObjectSpace module contains a number of routines
+ * that interact with the garbage collection facility and allow you to
+ * traverse all living objects with an iterator.
+ *
+ * ObjectSpace also provides support for object finalizers, procs that will be
+ * called when a specific object is about to be destroyed by garbage
+ * collection.
+ *
+ * include ObjectSpace
+ *
+ * a = "A"
+ * b = "B"
+ * c = "C"
+ *
+ * define_finalizer(a, proc {|id| puts "Finalizer one on #{id}" })
+ * define_finalizer(a, proc {|id| puts "Finalizer two on #{id}" })
+ * define_finalizer(b, proc {|id| puts "Finalizer three on #{id}" })
+ *
+ * _produces:_
+ *
+ * Finalizer three on 537763470
+ * Finalizer one on 537763480
+ * Finalizer two on 537763480
+ *
+ */
+
+/*
+ * Document-class: ObjectSpace::WeakMap
+ *
+ * An ObjectSpace::WeakMap object holds references to
+ * any objects, but those objects can get disposed by GC.
+ */
+
/* Document-class: GC::Profiler
*
* The GC profiler provides access to information on GC runs including time,
@@ -3557,7 +4426,7 @@ gc_profile_total_time(VALUE self)
*
* require 'rdoc/rdoc'
*
- * puts GC::Profiler.result
+ * GC::Profiler.report
*
* GC::Profiler.disable
*
@@ -3565,9 +4434,11 @@ gc_profile_total_time(VALUE self)
*/
/*
- * The <code>GC</code> module provides an interface to Ruby's mark and
- * sweep garbage collection mechanism. Some of the underlying methods
- * are also available via the ObjectSpace module.
+ * The GC module provides an interface to Ruby's mark and
+ * sweep garbage collection mechanism.
+ *
+ * Some of the underlying methods are also available via the ObjectSpace
+ * module.
*
* You may obtain information about the operation of the GC through
* GC::Profiler.
@@ -3592,6 +4463,7 @@ Init_GC(void)
rb_mProfiler = rb_define_module_under(rb_mGC, "Profiler");
rb_define_singleton_method(rb_mProfiler, "enabled?", gc_profile_enable_get, 0);
rb_define_singleton_method(rb_mProfiler, "enable", gc_profile_enable, 0);
+ rb_define_singleton_method(rb_mProfiler, "raw_data", gc_profile_record_get, 0);
rb_define_singleton_method(rb_mProfiler, "disable", gc_profile_disable, 0);
rb_define_singleton_method(rb_mProfiler, "clear", gc_profile_clear, 0);
rb_define_singleton_method(rb_mProfiler, "result", gc_profile_result, 0);
@@ -3617,6 +4489,14 @@ Init_GC(void)
rb_define_module_function(rb_mObSpace, "count_objects", count_objects, -1);
+ {
+ VALUE rb_cWeakMap = rb_define_class_under(rb_mObSpace, "WeakMap", rb_cObject);
+ rb_define_alloc_func(rb_cWeakMap, wmap_allocate);
+ rb_define_method(rb_cWeakMap, "[]=", wmap_aset, 2);
+ rb_define_method(rb_cWeakMap, "[]", wmap_aref, 1);
+ rb_define_private_method(rb_cWeakMap, "finalize", wmap_finalize, 1);
+ }
+
#if CALC_EXACT_MALLOC_SIZE
rb_define_singleton_method(rb_mGC, "malloc_allocated_size", gc_malloc_allocated_size, 0);
rb_define_singleton_method(rb_mGC, "malloc_allocations", gc_malloc_allocations, 0);
diff --git a/gc.h b/gc.h
index df2cf7dd79..2a3dd92c01 100644
--- a/gc.h
+++ b/gc.h
@@ -2,9 +2,9 @@
#ifndef RUBY_GC_H
#define RUBY_GC_H 1
-#if defined(__x86_64__) && defined(__GNUC__)
+#if defined(__x86_64__) && defined(__GNUC__) && !defined(__native_client__)
#define SET_MACHINE_STACK_END(p) __asm__("movq\t%%rsp, %0" : "=r" (*(p)))
-#elif defined(__i386) && defined(__GNUC__)
+#elif defined(__i386) && defined(__GNUC__) && !defined(__native_client__)
#define SET_MACHINE_STACK_END(p) __asm__("movl\t%%esp, %0" : "=r" (*(p)))
#else
NOINLINE(void rb_gc_set_stack_end(VALUE **stack_end_p));
@@ -81,12 +81,18 @@ int ruby_get_stack_grow_direction(volatile VALUE *addr);
#define STACK_GROW_DIR_DETECTION VALUE stack_grow_dir_detection
#define STACK_DIR_UPPER(a,b) STACK_UPPER(&stack_grow_dir_detection, (a), (b))
#endif
+#define IS_STACK_DIR_UPPER() STACK_DIR_UPPER(1,0)
#if defined __GNUC__ && __GNUC__ >= 4
#pragma GCC visibility push(default)
#endif
+/* exports for objspace module */
size_t rb_objspace_data_type_memsize(VALUE obj);
+void rb_objspace_reachable_objects_from(VALUE obj, void (func)(VALUE, void *), void *data);
+int rb_objspace_markable_object_p(VALUE obj);
+int rb_objspace_internal_object_p(VALUE obj);
+
void rb_objspace_each_objects(
int (*callback)(void *start, void *end, size_t stride, void *data),
void *data);
diff --git a/goruby.c b/goruby.c
index 17be654800..310f236011 100644
--- a/goruby.c
+++ b/goruby.c
@@ -1,8 +1,19 @@
void Init_golf(void);
+#define ruby_options goruby_options
#define ruby_run_node goruby_run_node
#include "main.c"
+#undef ruby_options
#undef ruby_run_node
+#if defined _WIN32
+#include <io.h>
+#include <fcntl.h>
+#define pipe(p) _pipe(p, 32L, _O_NOINHERIT)
+#elif defined HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+RUBY_EXTERN void *ruby_options(int argc, char **argv);
RUBY_EXTERN int ruby_run_node(void*);
RUBY_EXTERN void ruby_init_ext(const char *name, void (*init)(void));
@@ -13,6 +24,29 @@ init_golf(VALUE arg)
return arg;
}
+void *
+goruby_options(int argc, char **argv)
+{
+ static const char cmd[] = "require 'irb'\nIRB.start";
+ int rw[2], infd;
+ void *ret;
+
+ if ((isatty(0) && isatty(1) && isatty(2)) && (pipe(rw) == 0)) {
+ infd = dup(0);
+ dup2(rw[0], 0);
+ close(rw[0]);
+ write(rw[1], cmd, sizeof(cmd) - 1);
+ close(rw[1]);
+ ret = ruby_options(argc, argv);
+ dup2(infd, 0);
+ close(infd);
+ return ret;
+ }
+ else {
+ return ruby_options(argc, argv);
+ }
+}
+
int
goruby_run_node(void *arg)
{
diff --git a/hash.c b/hash.c
index 8d6cd96ded..a9047be968 100644
--- a/hash.c
+++ b/hash.c
@@ -15,7 +15,9 @@
#include "ruby/st.h"
#include "ruby/util.h"
#include "ruby/encoding.h"
+#include "internal.h"
#include <errno.h>
+#include "probes.h"
#ifdef __APPLE__
#include <crt_externs.h>
@@ -44,8 +46,8 @@ rb_any_cmp(VALUE a, VALUE b)
if (FIXNUM_P(a) && FIXNUM_P(b)) {
return a != b;
}
- if (TYPE(a) == T_STRING && RBASIC(a)->klass == rb_cString &&
- TYPE(b) == T_STRING && RBASIC(b)->klass == rb_cString) {
+ if (RB_TYPE_P(a, T_STRING) && RBASIC(a)->klass == rb_cString &&
+ RB_TYPE_P(b, T_STRING) && RBASIC(b)->klass == rb_cString) {
return rb_str_hash_cmp(a, b);
}
if (a == Qundef || b == Qundef) return -1;
@@ -80,20 +82,14 @@ rb_any_hash(VALUE a)
VALUE hval;
st_index_t hnum;
- switch (TYPE(a)) {
- case T_FIXNUM:
- case T_SYMBOL:
- case T_NIL:
- case T_FALSE:
- case T_TRUE:
- hnum = rb_hash_end(rb_hash_start((unsigned int)a));
- break;
-
- case T_STRING:
+ if (SPECIAL_CONST_P(a)) {
+ if (a == Qundef) return 0;
+ hnum = rb_hash_end(rb_hash_start((st_index_t)a));
+ }
+ else if (BUILTIN_TYPE(a) == T_STRING) {
hnum = rb_str_hash(a);
- break;
-
- default:
+ }
+ else {
hval = rb_hash(a);
hnum = FIX2LONG(hval);
}
@@ -106,10 +102,8 @@ static const struct st_hash_type objhash = {
rb_any_hash,
};
-static const struct st_hash_type identhash = {
- st_numcmp,
- st_numhash,
-};
+extern const struct st_hash_type st_hashtype_num;
+#define identhash st_hashtype_num
typedef int st_foreach_func(st_data_t, st_data_t, st_data_t);
@@ -124,7 +118,6 @@ foreach_safe_i(st_data_t key, st_data_t value, struct foreach_safe_arg *arg)
{
int status;
- if (key == Qundef) return ST_CONTINUE;
status = (*arg->func)(key, value, arg->arg);
if (status == ST_CONTINUE) {
return ST_CHECK;
@@ -140,7 +133,7 @@ st_foreach_safe(st_table *table, int (*func)(ANYARGS), st_data_t a)
arg.tbl = table;
arg.func = (st_foreach_func *)func;
arg.arg = a;
- if (st_foreach(table, foreach_safe_i, (st_data_t)&arg)) {
+ if (st_foreach_check(table, foreach_safe_i, (st_data_t)&arg, 0)) {
rb_raise(rb_eRuntimeError, "hash modified during iteration");
}
}
@@ -154,21 +147,21 @@ struct hash_foreach_arg {
};
static int
-hash_foreach_iter(st_data_t key, st_data_t value, struct hash_foreach_arg *arg)
+hash_foreach_iter(st_data_t key, st_data_t value, st_data_t argp)
{
+ struct hash_foreach_arg *arg = (struct hash_foreach_arg *)argp;
int status;
st_table *tbl;
tbl = RHASH(arg->hash)->ntbl;
- if ((VALUE)key == Qundef) return ST_CONTINUE;
status = (*arg->func)((VALUE)key, (VALUE)value, arg->arg);
if (RHASH(arg->hash)->ntbl != tbl) {
rb_raise(rb_eRuntimeError, "rehash occurred during iteration");
}
switch (status) {
case ST_DELETE:
- st_delete_safe(tbl, &key, 0, Qundef);
FL_SET(arg->hash, HASH_DELETED);
+ return ST_DELETE;
case ST_CONTINUE:
break;
case ST_STOP:
@@ -180,11 +173,9 @@ hash_foreach_iter(st_data_t key, st_data_t value, struct hash_foreach_arg *arg)
static VALUE
hash_foreach_ensure(VALUE hash)
{
- RHASH(hash)->iter_lev--;
-
- if (RHASH(hash)->iter_lev == 0) {
+ if (--RHASH_ITER_LEV(hash) == 0) {
if (FL_TEST(hash, HASH_DELETED)) {
- st_cleanup_safe(RHASH(hash)->ntbl, Qundef);
+ st_cleanup_safe(RHASH(hash)->ntbl, (st_data_t)Qundef);
FL_UNSET(hash, HASH_DELETED);
}
}
@@ -192,9 +183,10 @@ hash_foreach_ensure(VALUE hash)
}
static VALUE
-hash_foreach_call(struct hash_foreach_arg *arg)
+hash_foreach_call(VALUE arg)
{
- if (st_foreach(RHASH(arg->hash)->ntbl, hash_foreach_iter, (st_data_t)arg)) {
+ VALUE hash = ((struct hash_foreach_arg *)arg)->hash;
+ if (st_foreach_check(RHASH(hash)->ntbl, hash_foreach_iter, (st_data_t)arg, (st_data_t)Qundef)) {
rb_raise(rb_eRuntimeError, "hash modified during iteration");
}
return Qnil;
@@ -207,7 +199,7 @@ rb_hash_foreach(VALUE hash, int (*func)(ANYARGS), VALUE farg)
if (!RHASH(hash)->ntbl)
return;
- RHASH(hash)->iter_lev++;
+ RHASH_ITER_LEV(hash)++;
arg.hash = hash;
arg.func = (rb_foreach_func *)func;
arg.arg = farg;
@@ -217,14 +209,23 @@ rb_hash_foreach(VALUE hash, int (*func)(ANYARGS), VALUE farg)
static VALUE
hash_alloc(VALUE klass)
{
- NEWOBJ(hash, struct RHash);
- OBJSETUP(hash, klass, T_HASH);
+ NEWOBJ_OF(hash, struct RHash, klass, T_HASH);
RHASH_IFNONE(hash) = Qnil;
return (VALUE)hash;
}
+static VALUE
+empty_hash_alloc(VALUE klass)
+{
+ if(RUBY_DTRACE_HASH_CREATE_ENABLED()) {
+ RUBY_DTRACE_HASH_CREATE(0, rb_sourcefile(), rb_sourceline());
+ }
+
+ return hash_alloc(klass);
+}
+
VALUE
rb_hash_new(void)
{
@@ -234,8 +235,11 @@ rb_hash_new(void)
VALUE
rb_hash_dup(VALUE hash)
{
- NEWOBJ(ret, struct RHash);
- DUPSETUP(ret, hash);
+ NEWOBJ_OF(ret, struct RHash,
+ rb_obj_class(hash),
+ (RBASIC(hash)->flags)&(T_MASK|FL_EXIVAR|FL_TAINT|FL_UNTRUSTED));
+ if (FL_TEST((hash), FL_EXIVAR))
+ rb_copy_generic_ivar((VALUE)(ret),(VALUE)(hash));
if (!RHASH_EMPTY_P(hash))
ret->ntbl = st_copy(RHASH(hash)->ntbl);
@@ -270,14 +274,30 @@ rb_hash_modify(VALUE hash)
rb_hash_tbl(hash);
}
+NORETURN(static void no_new_key(void));
static void
-hash_update(VALUE hash, VALUE key)
+no_new_key(void)
{
- if (RHASH(hash)->iter_lev > 0 && !st_lookup(RHASH(hash)->ntbl, key, 0)) {
- rb_raise(rb_eRuntimeError, "can't add a new key into hash during iteration");
- }
+ rb_raise(rb_eRuntimeError, "can't add a new key into hash during iteration");
+}
+
+#define NOINSERT_UPDATE_CALLBACK(func) \
+int \
+func##_noinsert(st_data_t *key, st_data_t *val, st_data_t arg, int existing) \
+{ \
+ if (!existing) no_new_key(); \
+ return func(key, val, arg, existing); \
}
+#define UPDATE_CALLBACK(iter_lev, func) ((iter_lev) > 0 ? func##_noinsert : func)
+
+#define RHASH_UPDATE_ITER(hash, iter_lev, key, func, arg) \
+ st_update(RHASH(hash)->ntbl, (st_data_t)(key), \
+ UPDATE_CALLBACK((iter_lev), func), \
+ (st_data_t)(arg))
+#define RHASH_UPDATE(hash, key, func, arg) \
+ RHASH_UPDATE_ITER(hash, RHASH_ITER_LEV(hash), key, func, arg)
+
static void
default_proc_arity_check(VALUE proc)
{
@@ -331,9 +351,7 @@ rb_hash_initialize(int argc, VALUE *argv, VALUE hash)
rb_hash_modify(hash);
if (rb_block_given_p()) {
- if (argc > 0) {
- rb_raise(rb_eArgError, "wrong number of arguments");
- }
+ rb_check_arity(argc, 0, 0);
ifnone = rb_block_proc();
default_proc_arity_check(ifnone);
RHASH_IFNONE(hash) = ifnone;
@@ -386,11 +404,27 @@ rb_hash_s_create(int argc, VALUE *argv, VALUE klass)
hash = hash_alloc(klass);
for (i = 0; i < RARRAY_LEN(tmp); ++i) {
- VALUE v = rb_check_array_type(RARRAY_PTR(tmp)[i]);
+ VALUE e = RARRAY_PTR(tmp)[i];
+ VALUE v = rb_check_array_type(e);
VALUE key, val = Qnil;
- if (NIL_P(v)) continue;
+ if (NIL_P(v)) {
+#if 0 /* refix in the next release */
+ rb_raise(rb_eArgError, "wrong element type %s at %ld (expected array)",
+ rb_builtin_class_name(e), i);
+
+#else
+ rb_warn("wrong element type %s at %ld (expected array)",
+ rb_builtin_class_name(e), i);
+ rb_warn("ignoring wrong elements is deprecated, remove them explicitly");
+ rb_warn("this causes ArgumentError in the next release");
+ continue;
+#endif
+ }
switch (RARRAY_LEN(v)) {
+ default:
+ rb_raise(rb_eArgError, "invalid number of elements (%ld for 1..2)",
+ RARRAY_LEN(v));
case 2:
val = RARRAY_PTR(v)[1];
case 1:
@@ -447,7 +481,7 @@ rb_hash_rehash_i(VALUE key, VALUE value, VALUE arg)
{
st_table *tbl = (st_table *)arg;
- if (key != Qundef) st_insert(tbl, key, value);
+ st_insert(tbl, (st_data_t)key, (st_data_t)value);
return ST_CONTINUE;
}
@@ -476,7 +510,7 @@ rb_hash_rehash(VALUE hash)
{
st_table *tbl;
- if (RHASH(hash)->iter_lev > 0) {
+ if (RHASH_ITER_LEV(hash) > 0) {
rb_raise(rb_eRuntimeError, "rehash during iteration");
}
rb_hash_modify_check(hash);
@@ -490,6 +524,20 @@ rb_hash_rehash(VALUE hash)
return hash;
}
+static VALUE
+hash_default_value(VALUE hash, VALUE key)
+{
+ if (rb_method_basic_definition_p(CLASS_OF(hash), id_default)) {
+ VALUE ifnone = RHASH_IFNONE(hash);
+ if (!FL_TEST(hash, HASH_PROC_DEFAULT)) return ifnone;
+ if (key == Qundef) return Qnil;
+ return rb_funcall(ifnone, id_yield, 2, hash, key);
+ }
+ else {
+ return rb_funcall(hash, id_default, 1, key);
+ }
+}
+
/*
* call-seq:
* hsh[key] -> value
@@ -510,13 +558,7 @@ rb_hash_aref(VALUE hash, VALUE key)
st_data_t val;
if (!RHASH(hash)->ntbl || !st_lookup(RHASH(hash)->ntbl, key, &val)) {
- if (!FL_TEST(hash, HASH_PROC_DEFAULT) &&
- rb_method_basic_definition_p(CLASS_OF(hash), id_default)) {
- return RHASH_IFNONE(hash);
- }
- else {
- return rb_funcall(hash, id_default, 1, key);
- }
+ return hash_default_value(hash, key);
}
return (VALUE)val;
}
@@ -659,7 +701,7 @@ rb_hash_default(int argc, VALUE *argv, VALUE hash)
static VALUE
rb_hash_set_default(VALUE hash, VALUE ifnone)
{
- rb_hash_modify(hash);
+ rb_hash_modify_check(hash);
RHASH_IFNONE(hash) = ifnone;
FL_UNSET(hash, HASH_PROC_DEFAULT);
return ifnone;
@@ -691,9 +733,9 @@ rb_hash_default_proc(VALUE hash)
/*
* call-seq:
- * hsh.default_proc = proc_obj -> proc_obj
+ * hsh.default_proc = proc_obj or nil
*
- * Sets the default proc to be executed on each key lookup.
+ * Sets the default proc to be executed on each failed key lookup.
*
* h.default_proc = proc do |hash, key|
* hash[key] = key + key
@@ -707,7 +749,12 @@ rb_hash_set_default_proc(VALUE hash, VALUE proc)
{
VALUE b;
- rb_hash_modify(hash);
+ rb_hash_modify_check(hash);
+ if (NIL_P(proc)) {
+ FL_UNSET(hash, HASH_PROC_DEFAULT);
+ RHASH_IFNONE(hash) = proc;
+ return proc;
+ }
b = rb_check_convert_type(proc, T_DATA, "Proc", "to_proc");
if (NIL_P(b) || !rb_obj_is_proc(b)) {
rb_raise(rb_eTypeError,
@@ -775,8 +822,8 @@ rb_hash_delete_key(VALUE hash, VALUE key)
if (!RHASH(hash)->ntbl)
return Qundef;
- if (RHASH(hash)->iter_lev > 0) {
- if (st_delete_safe(RHASH(hash)->ntbl, &ktmp, &val, Qundef)) {
+ if (RHASH_ITER_LEV(hash) > 0) {
+ if (st_delete_safe(RHASH(hash)->ntbl, &ktmp, &val, (st_data_t)Qundef)) {
FL_SET(hash, HASH_DELETED);
return (VALUE)val;
}
@@ -791,8 +838,8 @@ rb_hash_delete_key(VALUE hash, VALUE key)
* hsh.delete(key) -> value
* hsh.delete(key) {| key | block } -> value
*
- * Deletes and returns a key-value pair from <i>hsh</i> whose key is
- * equal to <i>key</i>. If the key is not found, returns the
+ * Deletes the key-value pair and returns the value from <i>hsh</i> whose
+ * key is equal to <i>key</i>. If the key is not found, returns the
* <em>default value</em>. If the optional code block is given and the
* key is not found, pass in the key and return the result of
* <i>block</i>.
@@ -809,7 +856,7 @@ rb_hash_delete(VALUE hash, VALUE key)
{
VALUE val;
- rb_hash_modify(hash);
+ rb_hash_modify_check(hash);
val = rb_hash_delete_key(hash, key);
if (val != Qundef) return val;
if (rb_block_given_p()) {
@@ -828,7 +875,6 @@ shift_i(VALUE key, VALUE value, VALUE arg)
{
struct shift_var *var = (struct shift_var *)arg;
- if (key == Qundef) return ST_CONTINUE;
if (var->key != Qundef) return ST_STOP;
var->key = key;
var->val = value;
@@ -840,7 +886,6 @@ shift_i_safe(VALUE key, VALUE value, VALUE arg)
{
struct shift_var *var = (struct shift_var *)arg;
- if (key == Qundef) return ST_CONTINUE;
var->key = key;
var->val = value;
return ST_STOP;
@@ -864,35 +909,33 @@ rb_hash_shift(VALUE hash)
{
struct shift_var var;
- rb_hash_modify(hash);
- var.key = Qundef;
- rb_hash_foreach(hash, RHASH(hash)->iter_lev > 0 ? shift_i_safe : shift_i,
- (VALUE)&var);
-
- if (var.key != Qundef) {
- if (RHASH(hash)->iter_lev > 0) {
- rb_hash_delete_key(hash, var.key);
+ rb_hash_modify_check(hash);
+ if (RHASH(hash)->ntbl) {
+ var.key = Qundef;
+ rb_hash_foreach(hash, RHASH_ITER_LEV(hash) > 0 ? shift_i_safe : shift_i,
+ (VALUE)&var);
+
+ if (var.key != Qundef) {
+ if (RHASH_ITER_LEV(hash) > 0) {
+ rb_hash_delete_key(hash, var.key);
+ }
+ return rb_assoc_new(var.key, var.val);
}
- return rb_assoc_new(var.key, var.val);
- }
- else if (FL_TEST(hash, HASH_PROC_DEFAULT)) {
- return rb_funcall(RHASH_IFNONE(hash), id_yield, 2, hash, Qnil);
- }
- else {
- return RHASH_IFNONE(hash);
}
+ return hash_default_value(hash, Qnil);
}
static int
delete_if_i(VALUE key, VALUE value, VALUE hash)
{
- if (key == Qundef) return ST_CONTINUE;
if (RTEST(rb_yield_values(2, key, value))) {
rb_hash_delete_key(hash, key);
}
return ST_CONTINUE;
}
+static VALUE rb_hash_size(VALUE hash);
+
/*
* call-seq:
* hsh.delete_if {| key, value | block } -> hsh
@@ -911,9 +954,10 @@ delete_if_i(VALUE key, VALUE value, VALUE hash)
VALUE
rb_hash_delete_if(VALUE hash)
{
- RETURN_ENUMERATOR(hash, 0, 0);
- rb_hash_modify(hash);
- rb_hash_foreach(hash, delete_if_i, hash);
+ RETURN_SIZED_ENUMERATOR(hash, 0, 0, rb_hash_size);
+ rb_hash_modify_check(hash);
+ if (RHASH(hash)->ntbl)
+ rb_hash_foreach(hash, delete_if_i, hash);
return hash;
}
@@ -931,7 +975,7 @@ rb_hash_reject_bang(VALUE hash)
{
st_index_t n;
- RETURN_ENUMERATOR(hash, 0, 0);
+ RETURN_SIZED_ENUMERATOR(hash, 0, 0, rb_hash_size);
rb_hash_modify(hash);
if (!RHASH(hash)->ntbl)
return Qnil;
@@ -984,7 +1028,6 @@ rb_hash_values_at(int argc, VALUE *argv, VALUE hash)
static int
select_i(VALUE key, VALUE value, VALUE result)
{
- if (key == Qundef) return ST_CONTINUE;
if (RTEST(rb_yield_values(2, key, value)))
rb_hash_aset(result, key, value);
return ST_CONTINUE;
@@ -1009,7 +1052,7 @@ rb_hash_select(VALUE hash)
{
VALUE result;
- RETURN_ENUMERATOR(hash, 0, 0);
+ RETURN_SIZED_ENUMERATOR(hash, 0, 0, rb_hash_size);
result = rb_hash_new();
rb_hash_foreach(hash, select_i, result);
return result;
@@ -1018,7 +1061,6 @@ rb_hash_select(VALUE hash)
static int
keep_if_i(VALUE key, VALUE value, VALUE hash)
{
- if (key == Qundef) return ST_CONTINUE;
if (!RTEST(rb_yield_values(2, key, value))) {
return ST_DELETE;
}
@@ -1039,8 +1081,8 @@ rb_hash_select_bang(VALUE hash)
{
st_index_t n;
- RETURN_ENUMERATOR(hash, 0, 0);
- rb_hash_modify(hash);
+ RETURN_SIZED_ENUMERATOR(hash, 0, 0, rb_hash_size);
+ rb_hash_modify_check(hash);
if (!RHASH(hash)->ntbl)
return Qnil;
n = RHASH(hash)->ntbl->num_entries;
@@ -1064,9 +1106,10 @@ rb_hash_select_bang(VALUE hash)
VALUE
rb_hash_keep_if(VALUE hash)
{
- RETURN_ENUMERATOR(hash, 0, 0);
- rb_hash_modify(hash);
- rb_hash_foreach(hash, keep_if_i, hash);
+ RETURN_SIZED_ENUMERATOR(hash, 0, 0, rb_hash_size);
+ rb_hash_modify_check(hash);
+ if (RHASH(hash)->ntbl)
+ rb_hash_foreach(hash, keep_if_i, hash);
return hash;
}
@@ -1087,14 +1130,14 @@ clear_i(VALUE key, VALUE value, VALUE dummy)
*
*/
-static VALUE
+VALUE
rb_hash_clear(VALUE hash)
{
rb_hash_modify_check(hash);
if (!RHASH(hash)->ntbl)
return hash;
if (RHASH(hash)->ntbl->num_entries > 0) {
- if (RHASH(hash)->iter_lev > 0)
+ if (RHASH_ITER_LEV(hash) > 0)
rb_hash_foreach(hash, clear_i, 0);
else
st_clear(RHASH(hash)->ntbl);
@@ -1103,12 +1146,23 @@ rb_hash_clear(VALUE hash)
return hash;
}
-static st_data_t
-copy_str_key(st_data_t str)
+static int
+hash_aset(st_data_t *key, st_data_t *val, st_data_t arg, int existing)
{
- return (st_data_t)rb_str_new4((VALUE)str);
+ *val = arg;
+ return ST_CONTINUE;
}
+static int
+hash_aset_str(st_data_t *key, st_data_t *val, st_data_t arg, int existing)
+{
+ *key = (st_data_t)rb_str_new_frozen((VALUE)*key);
+ return hash_aset(key, val, arg, existing);
+}
+
+static NOINSERT_UPDATE_CALLBACK(hash_aset)
+static NOINSERT_UPDATE_CALLBACK(hash_aset_str)
+
/*
* call-seq:
* hsh[key] = value -> value
@@ -1130,13 +1184,19 @@ copy_str_key(st_data_t str)
VALUE
rb_hash_aset(VALUE hash, VALUE key, VALUE val)
{
+ int iter_lev = RHASH_ITER_LEV(hash);
+ st_table *tbl = RHASH(hash)->ntbl;
+
rb_hash_modify(hash);
- hash_update(hash, key);
- if (RHASH(hash)->ntbl->type == &identhash || rb_obj_class(key) != rb_cString) {
- st_insert(RHASH(hash)->ntbl, key, val);
+ if (!tbl) {
+ if (iter_lev > 0) no_new_key();
+ tbl = RHASH_TBL(hash);
+ }
+ if (tbl->type == &identhash || rb_obj_class(key) != rb_cString) {
+ RHASH_UPDATE_ITER(hash, iter_lev, key, hash_aset, val);
}
else {
- st_insert2(RHASH(hash)->ntbl, key, val, copy_str_key);
+ RHASH_UPDATE_ITER(hash, iter_lev, key, hash_aset_str, val);
}
return val;
}
@@ -1144,13 +1204,35 @@ rb_hash_aset(VALUE hash, VALUE key, VALUE val)
static int
replace_i(VALUE key, VALUE val, VALUE hash)
{
- if (key != Qundef) {
- rb_hash_aset(hash, key, val);
- }
+ rb_hash_aset(hash, key, val);
return ST_CONTINUE;
}
+static VALUE
+rb_hash_initialize_copy(VALUE hash, VALUE hash2)
+{
+ rb_hash_modify_check(hash);
+ hash2 = to_hash(hash2);
+
+ Check_Type(hash2, T_HASH);
+
+ if (!RHASH_EMPTY_P(hash2)) {
+ RHASH(hash)->ntbl = st_copy(RHASH(hash2)->ntbl);
+ rb_hash_rehash(hash);
+ }
+
+ if (FL_TEST(hash2, HASH_PROC_DEFAULT)) {
+ FL_SET(hash, HASH_PROC_DEFAULT);
+ }
+ else {
+ FL_UNSET(hash, HASH_PROC_DEFAULT);
+ }
+ RHASH_IFNONE(hash) = RHASH_IFNONE(hash2);
+
+ return hash;
+}
+
/*
* call-seq:
* hsh.replace(other_hash) -> hsh
@@ -1227,7 +1309,6 @@ rb_hash_empty_p(VALUE hash)
static int
each_value_i(VALUE key, VALUE value)
{
- if (key == Qundef) return ST_CONTINUE;
rb_yield(value);
return ST_CONTINUE;
}
@@ -1254,7 +1335,7 @@ each_value_i(VALUE key, VALUE value)
static VALUE
rb_hash_each_value(VALUE hash)
{
- RETURN_ENUMERATOR(hash, 0, 0);
+ RETURN_SIZED_ENUMERATOR(hash, 0, 0, rb_hash_size);
rb_hash_foreach(hash, each_value_i, 0);
return hash;
}
@@ -1262,7 +1343,6 @@ rb_hash_each_value(VALUE hash)
static int
each_key_i(VALUE key, VALUE value)
{
- if (key == Qundef) return ST_CONTINUE;
rb_yield(key);
return ST_CONTINUE;
}
@@ -1288,7 +1368,7 @@ each_key_i(VALUE key, VALUE value)
static VALUE
rb_hash_each_key(VALUE hash)
{
- RETURN_ENUMERATOR(hash, 0, 0);
+ RETURN_SIZED_ENUMERATOR(hash, 0, 0, rb_hash_size);
rb_hash_foreach(hash, each_key_i, 0);
return hash;
}
@@ -1296,7 +1376,6 @@ rb_hash_each_key(VALUE hash)
static int
each_pair_i(VALUE key, VALUE value)
{
- if (key == Qundef) return ST_CONTINUE;
rb_yield(rb_assoc_new(key, value));
return ST_CONTINUE;
}
@@ -1326,7 +1405,7 @@ each_pair_i(VALUE key, VALUE value)
static VALUE
rb_hash_each_pair(VALUE hash)
{
- RETURN_ENUMERATOR(hash, 0, 0);
+ RETURN_SIZED_ENUMERATOR(hash, 0, 0, rb_hash_size);
rb_hash_foreach(hash, each_pair_i, 0);
return hash;
}
@@ -1334,7 +1413,6 @@ rb_hash_each_pair(VALUE hash)
static int
to_a_i(VALUE key, VALUE value, VALUE ary)
{
- if (key == Qundef) return ST_CONTINUE;
rb_ary_push(ary, rb_assoc_new(key, value));
return ST_CONTINUE;
}
@@ -1367,17 +1445,16 @@ inspect_i(VALUE key, VALUE value, VALUE str)
{
VALUE str2;
- if (key == Qundef) return ST_CONTINUE;
str2 = rb_inspect(key);
if (RSTRING_LEN(str) > 1) {
- rb_str_cat2(str, ", ");
+ rb_str_buf_cat_ascii(str, ", ");
}
else {
rb_enc_copy(str, str2);
}
rb_str_buf_append(str, str2);
OBJ_INFECT(str, str2);
- rb_str_buf_cat2(str, "=>");
+ rb_str_buf_cat_ascii(str, "=>");
str2 = rb_inspect(value);
rb_str_buf_append(str, str2);
OBJ_INFECT(str, str2);
@@ -1431,10 +1508,33 @@ rb_hash_to_hash(VALUE hash)
return hash;
}
+/*
+ * call-seq:
+ * hsh.to_h -> hsh or new_hash
+ *
+ * Returns +self+. If called on a subclass of Hash, converts
+ * the receiver to a Hash object.
+ */
+
+static VALUE
+rb_hash_to_h(VALUE hash)
+{
+ if (rb_obj_class(hash) != rb_cHash) {
+ VALUE ret = rb_hash_new();
+ if (!RHASH_EMPTY_P(hash))
+ RHASH(ret)->ntbl = st_copy(RHASH(hash)->ntbl);
+ if (FL_TEST(hash, HASH_PROC_DEFAULT)) {
+ FL_SET(ret, HASH_PROC_DEFAULT);
+ }
+ RHASH_IFNONE(ret) = RHASH_IFNONE(hash);
+ return ret;
+ }
+ return hash;
+}
+
static int
keys_i(VALUE key, VALUE value, VALUE ary)
{
- if (key == Qundef) return ST_CONTINUE;
rb_ary_push(ary, key);
return ST_CONTINUE;
}
@@ -1465,7 +1565,6 @@ rb_hash_keys(VALUE hash)
static int
values_i(VALUE key, VALUE value, VALUE ary)
{
- if (key == Qundef) return ST_CONTINUE;
rb_ary_push(ary, value);
return ST_CONTINUE;
}
@@ -1524,7 +1623,6 @@ rb_hash_search_value(VALUE key, VALUE value, VALUE arg)
{
VALUE *data = (VALUE *)arg;
- if (key == Qundef) return ST_CONTINUE;
if (rb_equal(value, data[1])) {
data[0] = Qtrue;
return ST_STOP;
@@ -1568,7 +1666,6 @@ eql_i(VALUE key, VALUE val1, VALUE arg)
struct equal_data *data = (struct equal_data *)arg;
st_data_t val2;
- if (key == Qundef) return ST_CONTINUE;
if (!st_lookup(data->tbl, key, &val2)) {
data->result = Qfalse;
return ST_STOP;
@@ -1599,7 +1696,7 @@ hash_equal(VALUE hash1, VALUE hash2, int eql)
struct equal_data data;
if (hash1 == hash2) return Qtrue;
- if (TYPE(hash2) != T_HASH) {
+ if (!RB_TYPE_P(hash2, T_HASH)) {
if (!rb_respond_to(hash2, rb_intern("to_hash"))) {
return Qfalse;
}
@@ -1670,7 +1767,6 @@ hash_i(VALUE key, VALUE val, VALUE arg)
st_index_t *hval = (st_index_t *)arg;
st_index_t hdata[2];
- if (key == Qundef) return ST_CONTINUE;
hdata[0] = rb_hash(key);
hdata[1] = rb_hash(val);
*hval ^= st_hash(hdata, sizeof(hdata), 0);
@@ -1685,6 +1781,7 @@ recursive_hash(VALUE hash, VALUE dummy, int recur)
if (!RHASH(hash)->ntbl)
return LONG2FIX(0);
hval = RHASH(hash)->ntbl->num_entries;
+ if (!hval) return LONG2FIX(0);
if (recur)
hval = rb_hash_uint(rb_hash_start(rb_hash(rb_cHash)), hval);
else
@@ -1710,7 +1807,6 @@ rb_hash_hash(VALUE hash)
static int
rb_hash_invert_i(VALUE key, VALUE value, VALUE hash)
{
- if (key == Qundef) return ST_CONTINUE;
rb_hash_aset(hash, value, key);
return ST_CONTINUE;
}
@@ -1737,23 +1833,38 @@ rb_hash_invert(VALUE hash)
}
static int
+rb_hash_update_callback(st_data_t *key, st_data_t *value, st_data_t arg, int existing)
+{
+ *value = arg;
+ return ST_CONTINUE;
+}
+
+static NOINSERT_UPDATE_CALLBACK(rb_hash_update_callback)
+
+static int
rb_hash_update_i(VALUE key, VALUE value, VALUE hash)
{
- if (key == Qundef) return ST_CONTINUE;
- hash_update(hash, key);
- st_insert(RHASH(hash)->ntbl, key, value);
+ RHASH_UPDATE(hash, key, rb_hash_update_callback, value);
return ST_CONTINUE;
}
static int
-rb_hash_update_block_i(VALUE key, VALUE value, VALUE hash)
+rb_hash_update_block_callback(st_data_t *key, st_data_t *value, st_data_t arg, int existing)
{
- if (key == Qundef) return ST_CONTINUE;
- if (rb_hash_has_key(hash, key)) {
- value = rb_yield_values(3, key, rb_hash_aref(hash, key), value);
+ VALUE newvalue = (VALUE)arg;
+ if (existing) {
+ newvalue = rb_yield_values(3, (VALUE)*key, (VALUE)*value, newvalue);
}
- hash_update(hash, key);
- st_insert(RHASH(hash)->ntbl, key, value);
+ *value = (st_data_t)newvalue;
+ return ST_CONTINUE;
+}
+
+static NOINSERT_UPDATE_CALLBACK(rb_hash_update_block_callback)
+
+static int
+rb_hash_update_block_i(VALUE key, VALUE value, VALUE hash)
+{
+ RHASH_UPDATE(hash, key, rb_hash_update_block_callback, value);
return ST_CONTINUE;
}
@@ -1796,21 +1907,32 @@ rb_hash_update(VALUE hash1, VALUE hash2)
struct update_arg {
VALUE hash;
+ VALUE value;
rb_hash_update_func *func;
};
static int
+rb_hash_update_func_callback(st_data_t *key, st_data_t *value, st_data_t arg0, int existing)
+{
+ struct update_arg *arg = (struct update_arg *)arg0;
+ VALUE newvalue = arg->value;
+ if (existing) {
+ newvalue = (*arg->func)((VALUE)*key, (VALUE)*value, newvalue);
+ }
+ *value = (st_data_t)newvalue;
+ return ST_CONTINUE;
+}
+
+static NOINSERT_UPDATE_CALLBACK(rb_hash_update_func_callback)
+
+static int
rb_hash_update_func_i(VALUE key, VALUE value, VALUE arg0)
{
struct update_arg *arg = (struct update_arg *)arg0;
VALUE hash = arg->hash;
- if (key == Qundef) return ST_CONTINUE;
- if (rb_hash_has_key(hash, key)) {
- value = (*arg->func)(key, rb_hash_aref(hash, key), value);
- }
- hash_update(hash, key);
- st_insert(RHASH(hash)->ntbl, key, value);
+ arg->value = value;
+ RHASH_UPDATE(hash, key, rb_hash_update_func_callback, arg);
return ST_CONTINUE;
}
@@ -1862,7 +1984,6 @@ assoc_i(VALUE key, VALUE val, VALUE arg)
{
VALUE *args = (VALUE *)arg;
- if (key == Qundef) return ST_CONTINUE;
if (RTEST(rb_equal(args[0], key))) {
args[1] = rb_assoc_new(key, val);
return ST_STOP;
@@ -1900,7 +2021,6 @@ rassoc_i(VALUE key, VALUE val, VALUE arg)
{
VALUE *args = (VALUE *)arg;
- if (key == Qundef) return ST_CONTINUE;
if (RTEST(rb_equal(args[0], val))) {
args[1] = rb_assoc_new(key, val);
return ST_STOP;
@@ -2017,6 +2137,8 @@ static char **origenviron;
static char **my_environ;
#undef environ
#define environ my_environ
+#undef getenv
+#define getenv(n) rb_w32_ugetenv(n)
#elif defined(__APPLE__)
#undef environ
#define environ (*_NSGetEnviron())
@@ -2038,7 +2160,11 @@ extern char **environ;
static VALUE
env_str_new(const char *ptr, long len)
{
+#ifdef _WIN32
+ VALUE str = rb_str_conv_enc(rb_str_new(ptr, len), rb_utf8_encoding(), rb_locale_encoding());
+#else
VALUE str = rb_locale_str_new(ptr, len);
+#endif
rb_obj_freeze(str);
return str;
@@ -2117,7 +2243,11 @@ rb_f_getenv(VALUE obj, VALUE name)
env = getenv(nam);
if (env) {
if (ENVMATCH(nam, PATH_ENV) && !env_path_tainted(env)) {
+#ifdef _WIN32
+ VALUE str = rb_str_conv_enc(rb_str_new(env, strlen(env)), rb_utf8_encoding(), rb_filesystem_encoding());
+#else
VALUE str = rb_filesystem_str_new_cstr(env);
+#endif
rb_obj_freeze(str);
return str;
@@ -2168,7 +2298,11 @@ env_fetch(int argc, VALUE *argv)
return if_none;
}
if (ENVMATCH(nam, PATH_ENV) && !env_path_tainted(env))
+#ifdef _WIN32
+ return rb_str_conv_enc(rb_str_new(env, strlen(env)), rb_utf8_encoding(), rb_filesystem_encoding());
+#else
return rb_filesystem_str_new_cstr(env);
+#endif
return env_str_new2(env);
}
@@ -2197,7 +2331,7 @@ rb_env_path_tainted(void)
}
#if defined(_WIN32) || (defined(HAVE_SETENV) && defined(HAVE_UNSETENV))
-#elif defined __sun__
+#elif defined __sun
static int
in_origenv(const char *str)
{
@@ -2285,7 +2419,7 @@ ruby_setenv(const char *name, const char *value)
rb_sys_fail("unsetenv");
#endif
}
-#elif defined __sun__
+#elif defined __sun
size_t len;
char **env_ptr, *str;
if (strchr(name, '=')) {
@@ -2438,12 +2572,30 @@ env_keys(void)
* An Enumerator is returned if no block is given.
*/
static VALUE
+rb_env_size(VALUE ehash)
+{
+ char **env;
+ long cnt = 0;
+
+ rb_secure(4);
+
+ env = GET_ENVIRON(environ);
+ for (; *env ; ++env) {
+ if (strchr(*env, '=')) {
+ cnt++;
+ }
+ }
+ FREE_ENVIRON(environ);
+ return LONG2FIX(cnt);
+}
+
+static VALUE
env_each_key(VALUE ehash)
{
VALUE keys;
long i;
- RETURN_ENUMERATOR(ehash, 0, 0);
+ RETURN_SIZED_ENUMERATOR(ehash, 0, 0, rb_env_size);
keys = env_keys(); /* rb_secure(4); */
for (i=0; i<RARRAY_LEN(keys); i++) {
rb_yield(RARRAY_PTR(keys)[i]);
@@ -2492,7 +2644,7 @@ env_each_value(VALUE ehash)
VALUE values;
long i;
- RETURN_ENUMERATOR(ehash, 0, 0);
+ RETURN_SIZED_ENUMERATOR(ehash, 0, 0, rb_env_size);
values = env_values(); /* rb_secure(4); */
for (i=0; i<RARRAY_LEN(values); i++) {
rb_yield(RARRAY_PTR(values)[i]);
@@ -2518,7 +2670,7 @@ env_each_pair(VALUE ehash)
VALUE ary;
long i;
- RETURN_ENUMERATOR(ehash, 0, 0);
+ RETURN_SIZED_ENUMERATOR(ehash, 0, 0, rb_env_size);
rb_secure(4);
ary = rb_ary_new();
@@ -2555,7 +2707,7 @@ env_reject_bang(VALUE ehash)
long i;
int del = 0;
- RETURN_ENUMERATOR(ehash, 0, 0);
+ RETURN_SIZED_ENUMERATOR(ehash, 0, 0, rb_env_size);
keys = env_keys(); /* rb_secure(4); */
for (i=0; i<RARRAY_LEN(keys); i++) {
VALUE val = rb_f_getenv(Qnil, RARRAY_PTR(keys)[i]);
@@ -2583,7 +2735,7 @@ env_reject_bang(VALUE ehash)
static VALUE
env_delete_if(VALUE ehash)
{
- RETURN_ENUMERATOR(ehash, 0, 0);
+ RETURN_SIZED_ENUMERATOR(ehash, 0, 0, rb_env_size);
env_reject_bang(ehash);
return envtbl;
}
@@ -2624,7 +2776,7 @@ env_select(VALUE ehash)
VALUE result;
char **env;
- RETURN_ENUMERATOR(ehash, 0, 0);
+ RETURN_SIZED_ENUMERATOR(ehash, 0, 0, rb_env_size);
rb_secure(4);
result = rb_hash_new();
env = GET_ENVIRON(environ);
@@ -2658,7 +2810,7 @@ env_select_bang(VALUE ehash)
long i;
int del = 0;
- RETURN_ENUMERATOR(ehash, 0, 0);
+ RETURN_SIZED_ENUMERATOR(ehash, 0, 0, rb_env_size);
keys = env_keys(); /* rb_secure(4); */
for (i=0; i<RARRAY_LEN(keys); i++) {
VALUE val = rb_f_getenv(Qnil, RARRAY_PTR(keys)[i]);
@@ -2686,7 +2838,7 @@ env_select_bang(VALUE ehash)
static VALUE
env_keep_if(VALUE ehash)
{
- RETURN_ENUMERATOR(ehash, 0, 0);
+ RETURN_SIZED_ENUMERATOR(ehash, 0, 0, rb_env_size);
env_select_bang(ehash);
return envtbl;
}
@@ -3000,7 +3152,8 @@ env_index(VALUE dmy, VALUE value)
/*
* call-seq:
- * ENV.to_hash -> Hash
+ * ENV.to_hash -> hash
+ * ENV.to_h -> hash
*
* Creates a hash with a copy of the environment variables.
*
@@ -3083,11 +3236,9 @@ env_invert(void)
static int
env_replace_i(VALUE key, VALUE val, VALUE keys)
{
- if (key != Qundef) {
- env_aset(Qnil, key, val);
- if (rb_ary_includes(keys, key)) {
- rb_ary_delete(keys, key);
- }
+ env_aset(Qnil, key, val);
+ if (rb_ary_includes(keys, key)) {
+ rb_ary_delete(keys, key);
}
return ST_CONTINUE;
}
@@ -3119,12 +3270,10 @@ env_replace(VALUE env, VALUE hash)
static int
env_update_i(VALUE key, VALUE val)
{
- if (key != Qundef) {
- if (rb_block_given_p()) {
- val = rb_yield_values(3, key, rb_f_getenv(Qnil, key), val);
- }
- env_aset(Qnil, key, val);
+ if (rb_block_given_p()) {
+ val = rb_yield_values(3, key, rb_f_getenv(Qnil, key), val);
}
+ env_aset(Qnil, key, val);
return ST_CONTINUE;
}
@@ -3149,15 +3298,116 @@ env_update(VALUE env, VALUE hash)
}
/*
- * A <code>Hash</code> is a collection of key-value pairs. It is
- * similar to an <code>Array</code>, except that indexing is done via
- * arbitrary keys of any object type, not an integer index. Hashes enumerate
- * their values in the order that the corresponding keys were inserted.
+ * A Hash is a dictionary-like collection of unique keys and their values.
+ * Also called associative arrays, they are similar to Arrays, but where an
+ * Array uses integers as its index, a Hash allows you to use any object
+ * type.
+ *
+ * Hashes enumerate their values in the order that the corresponding keys
+ * were inserted.
+ *
+ * A Hash can be easily created by using its implicit form:
+ *
+ * grades = { "Jane Doe" => 10, "Jim Doe" => 6 }
+ *
+ * Hashes allow an alternate syntax form when your keys are always symbols.
+ * Instead of
+ *
+ * options = { :font_size => 10, :font_family => "Arial" }
+ *
+ * You could write it as:
+ *
+ * options = { font_size: 10, font_family: "Arial" }
+ *
+ * Each named key is a symbol you can access in hash:
+ *
+ * options[:font_size] # => 10
+ *
+ * A Hash can also be created through its ::new method:
+ *
+ * grades = Hash.new
+ * grades["Dorothy Doe"] = 9
*
* Hashes have a <em>default value</em> that is returned when accessing
- * keys that do not exist in the hash. By default, that value is
- * <code>nil</code>.
+ * keys that do not exist in the hash. If no default is set +nil+ is used.
+ * You can set the default value by sending it as an argument to Hash.new:
+ *
+ * grades = Hash.new(0)
+ *
+ * Or by using the #default= method:
+ *
+ * grades = {"Timmy Doe" => 8}
+ * grades.default = 0
+ *
+ * Accessing a value in a Hash requires using its key:
+ *
+ * puts grades["Jane Doe"] # => 10
+ *
+ * === Common Uses
+ *
+ * Hashes are an easy way to represent data structures, such as
+ *
+ * books = {}
+ * books[:matz] = "The Ruby Language"
+ * books[:black] = "The Well-Grounded Rubyist"
+ *
+ * Hashes are also commonly used as a way to have named parameters in
+ * functions. Note that no brackets are used below. If a hash is the last
+ * argument on a method call, no braces are needed, thus creating a really
+ * clean interface:
+ *
+ * Person.create(name: "John Doe", age: 27)
+ *
+ * def self.create(params)
+ * @name = params[:name]
+ * @age = params[:age]
+ * end
+ *
+ * === Hash Keys
+ *
+ * Two objects refer to the same hash key when their <code>hash</code> value
+ * is identical and the two objects are <code>eql?</code> to each other.
+ *
+ * A user-defined class may be used as a hash key if the <code>hash</code>
+ * and <code>eql?</code> methods are overridden to provide meaningful
+ * behavior. By default, separate instances refer to separate hash keys.
+ *
+ * A typical implementation of <code>hash</code> is based on the
+ * object's data while <code>eql?</code> is usually aliased to the overridden
+ * <code>==</code> method:
+ *
+ * class Book
+ * attr_reader :author, :title
+ *
+ * def initialize(author, title)
+ * @author = author
+ * @title = title
+ * end
+ *
+ * def ==(other)
+ * self.class === other and
+ * other.author == @author and
+ * other.title == @title
+ * end
+ *
+ * alias eql? ==
+ *
+ * def hash
+ * @author.hash ^ @title.hash # XOR
+ * end
+ * end
+ *
+ * book1 = Book.new 'matz', 'Ruby in a Nutshell'
+ * book2 = Book.new 'matz', 'Ruby in a Nutshell'
+ *
+ * reviews = {}
+ *
+ * reviews[book1] = 'Great reference!'
+ * reviews[book2] = 'Nice and compact!'
+ *
+ * reviews.length #=> 1
*
+ * See also Object#hash and Object#eql?
*/
void
@@ -3174,14 +3424,15 @@ Init_Hash(void)
rb_include_module(rb_cHash, rb_mEnumerable);
- rb_define_alloc_func(rb_cHash, hash_alloc);
+ rb_define_alloc_func(rb_cHash, empty_hash_alloc);
rb_define_singleton_method(rb_cHash, "[]", rb_hash_s_create, -1);
rb_define_singleton_method(rb_cHash, "try_convert", rb_hash_s_try_convert, 1);
rb_define_method(rb_cHash,"initialize", rb_hash_initialize, -1);
- rb_define_method(rb_cHash,"initialize_copy", rb_hash_replace, 1);
+ rb_define_method(rb_cHash,"initialize_copy", rb_hash_initialize_copy, 1);
rb_define_method(rb_cHash,"rehash", rb_hash_rehash, 0);
rb_define_method(rb_cHash,"to_hash", rb_hash_to_hash, 0);
+ rb_define_method(rb_cHash,"to_h", rb_hash_to_h, 0);
rb_define_method(rb_cHash,"to_a", rb_hash_to_a, 0);
rb_define_method(rb_cHash,"inspect", rb_hash_inspect, 0);
rb_define_alias(rb_cHash, "to_s", "inspect");
@@ -3292,6 +3543,7 @@ Init_Hash(void)
rb_define_singleton_method(envtbl,"key?", env_has_key, 1);
rb_define_singleton_method(envtbl,"value?", env_has_value, 1);
rb_define_singleton_method(envtbl,"to_hash", env_to_hash, 0);
+ rb_define_singleton_method(envtbl,"to_h", env_to_hash, 0);
rb_define_singleton_method(envtbl,"assoc", env_assoc, 1);
rb_define_singleton_method(envtbl,"rassoc", env_rassoc, 1);
diff --git a/ia64.s b/ia64.s
index 92415b4e97..1087105585 100644
--- a/ia64.s
+++ b/ia64.s
@@ -5,11 +5,11 @@
//
// void rb_ia64_flushrs(void) { __builtin_ia64_flushrs(); }
// void *rb_ia64_bsp(void) { return __builtin_ia64_bsp(); }
-//
+//
// Note that rb_ia64_flushrs and rb_ia64_bsp works in its own stack frame.
// It's because BSP is updated by br.call/brl.call (not alloc instruction).
// So rb_ia64_flushrs flushes stack frames including caller's one.
-// rb_ia64_bsp returns the address next to caller's register stack frame.
+// rb_ia64_bsp returns the address next to caller's register stack frame.
//
// See also
// Intel Itanium Architecture Software Developer's Manual
diff --git a/id.c b/id.c
index 89ae4a4e77..0da29dffbe 100644
--- a/id.c
+++ b/id.c
@@ -13,6 +13,8 @@
#include "id.h"
+#include "vm_opts.h" /* for SUPPORT_JOKE */
+
static void
Init_id(void)
{
@@ -24,6 +26,7 @@ Init_id(void)
REGISTER_SYMID(idIFUNC, "<IFUNC>");
REGISTER_SYMID(idCFUNC, "<CFUNC>");
REGISTER_SYMID(idRespond_to, "respond_to?");
+ REGISTER_SYMID(idRespond_to_missing, "respond_to_missing?");
REGISTER_SYMID(id_core_set_method_alias, "core#set_method_alias");
REGISTER_SYMID(id_core_set_variable_alias, "core#set_variable_alias");
@@ -31,10 +34,15 @@ Init_id(void)
REGISTER_SYMID(id_core_define_method, "core#define_method");
REGISTER_SYMID(id_core_define_singleton_method, "core#define_singleton_method");
REGISTER_SYMID(id_core_set_postexe, "core#set_postexe");
+ REGISTER_SYMID(id_core_hash_from_ary, "core#hash_from_ary");
+ REGISTER_SYMID(id_core_hash_merge_ary, "core#hash_merge_ary");
+ REGISTER_SYMID(id_core_hash_merge_ptr, "core#hash_merge_ptr");
+ REGISTER_SYMID(id_core_hash_merge_kwd, "core#hash_merge_kwd");
REGISTER_SYMID(idEach, "each");
REGISTER_SYMID(idLength, "length");
REGISTER_SYMID(idSize, "size");
+ REGISTER_SYMID(idEmptyP, "empty?");
REGISTER_SYMID(idLambda, "lambda");
REGISTER_SYMID(idIntern, "intern");
REGISTER_SYMID(idGets, "gets");
@@ -47,5 +55,8 @@ Init_id(void)
REGISTER_SYMID(idSend, "send");
REGISTER_SYMID(id__send__, "__send__");
REGISTER_SYMID(idInitialize, "initialize");
+ REGISTER_SYMID(idInitialize_copy, "initialize_copy");
+ REGISTER_SYMID(idInitialize_clone, "initialize_clone");
+ REGISTER_SYMID(idInitialize_dup, "initialize_dup");
REGISTER_SYMID(idUScore, "_");
}
diff --git a/include/ruby.h b/include/ruby.h
index 862b1687d4..076b5ce258 100644
--- a/include/ruby.h
+++ b/include/ruby.h
@@ -22,6 +22,7 @@
#define HAVE_RUBY_REGEX_H 1
#define HAVE_RUBY_RUBY_H 1
#define HAVE_RUBY_ST_H 1
+#define HAVE_RUBY_THREAD_H 1
#define HAVE_RUBY_UTIL_H 1
#define HAVE_RUBY_VERSION_H 1
#define HAVE_RUBY_VM_H 1
diff --git a/include/ruby/backward/rubysig.h b/include/ruby/backward/rubysig.h
index 3952f7e85e..f46679ae67 100644
--- a/include/ruby/backward/rubysig.h
+++ b/include/ruby/backward/rubysig.h
@@ -27,6 +27,10 @@ extern "C" {
#endif
#endif
+#if defined __GNUC__ && __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
struct rb_blocking_region_buffer;
DEPRECATED(RUBY_EXTERN struct rb_blocking_region_buffer *rb_thread_blocking_region_begin(void));
DEPRECATED(RUBY_EXTERN void rb_thread_blocking_region_end(struct rb_blocking_region_buffer *));
@@ -38,6 +42,10 @@ DEPRECATED(RUBY_EXTERN void rb_thread_blocking_region_end(struct rb_blocking_reg
#define ALLOW_INTS do {CHECK_INTS;} while (0)
#define CHECK_INTS rb_thread_check_ints()
+#if defined __GNUC__ && __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
#if defined(__cplusplus)
#if 0
{ /* satisfy cc-mode */
diff --git a/include/ruby/debug.h b/include/ruby/debug.h
new file mode 100644
index 0000000000..7767770a83
--- /dev/null
+++ b/include/ruby/debug.h
@@ -0,0 +1,92 @@
+/**********************************************************************
+
+ ruby/debug.h -
+
+ $Author: ko1 $
+ created at: Tue Nov 20 20:35:08 2012
+
+ Copyright (C) 2012 Yukihiro Matsumoto
+
+**********************************************************************/
+
+#ifndef RB_DEBUG_H
+#define RB_DEBUG_H 1
+
+#if defined(__cplusplus)
+extern "C" {
+#if 0
+} /* satisfy cc-mode */
+#endif
+#endif
+
+#if defined __GNUC__ && __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
+/* Note: This file contains experimental APIs. */
+/* APIs can be replaced at Ruby 2.0.1 or later */
+
+/* debug inspector APIs */
+typedef struct rb_debug_inspector_struct rb_debug_inspector_t;
+typedef VALUE (*rb_debug_inspector_func_t)(const rb_debug_inspector_t *, void *);
+
+VALUE rb_debug_inspector_open(rb_debug_inspector_func_t func, void *data);
+VALUE rb_debug_inspector_frame_binding_get(const rb_debug_inspector_t *dc, int index);
+VALUE rb_debug_inspector_frame_class_get(const rb_debug_inspector_t *dc, int index);
+VALUE rb_debug_inspector_frame_iseq_get(const rb_debug_inspector_t *dc, int index);
+VALUE rb_debug_inspector_backtrace_locations(const rb_debug_inspector_t *dc);
+
+/* Old style set_trace_func APIs */
+
+/* duplicated def of include/ruby/ruby.h */
+void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data);
+int rb_remove_event_hook(rb_event_hook_func_t func);
+
+int rb_remove_event_hook_with_data(rb_event_hook_func_t func, VALUE data);
+void rb_thread_add_event_hook(VALUE thval, rb_event_hook_func_t func, rb_event_flag_t events, VALUE data);
+int rb_thread_remove_event_hook(VALUE thval, rb_event_hook_func_t func);
+int rb_thread_remove_event_hook_with_data(VALUE thval, rb_event_hook_func_t func, VALUE data);
+
+/* TracePoint APIs */
+
+VALUE rb_tracepoint_new(VALUE target_thread_not_supported_yet, rb_event_flag_t events, void (*func)(VALUE, void *), void *data);
+VALUE rb_tracepoint_enable(VALUE tpval);
+VALUE rb_tracepoint_disable(VALUE tpval);
+VALUE rb_tracepoint_enabled_p(VALUE tpval);
+
+struct rb_trace_arg_struct;
+struct rb_trace_arg_struct *rb_tracearg_from_tracepoint(VALUE tpval);
+
+VALUE rb_tracearg_event(struct rb_trace_arg_struct *trace_arg);
+VALUE rb_tracearg_lineno(struct rb_trace_arg_struct *trace_arg);
+VALUE rb_tracearg_path(struct rb_trace_arg_struct *trace_arg);
+VALUE rb_tracearg_method_id(struct rb_trace_arg_struct *trace_arg);
+VALUE rb_tracearg_defined_class(struct rb_trace_arg_struct *trace_arg);
+VALUE rb_tracearg_binding(struct rb_trace_arg_struct *trace_arg);
+VALUE rb_tracearg_self(struct rb_trace_arg_struct *trace_arg);
+VALUE rb_tracearg_return_value(struct rb_trace_arg_struct *trace_arg);
+VALUE rb_tracearg_raised_exception(struct rb_trace_arg_struct *trace_arg);
+
+/* undocumented advanced tracing APIs */
+
+typedef enum {
+ RUBY_EVENT_HOOK_FLAG_SAFE = 0x01,
+ RUBY_EVENT_HOOK_FLAG_DELETED = 0x02,
+ RUBY_EVENT_HOOK_FLAG_RAW_ARG = 0x04
+} rb_event_hook_flag_t;
+
+void rb_add_event_hook2(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data, rb_event_hook_flag_t hook_flag);
+void rb_thread_add_event_hook2(VALUE thval, rb_event_hook_func_t func, rb_event_flag_t events, VALUE data, rb_event_hook_flag_t hook_flag);
+
+#if defined __GNUC__ && __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
+#if defined(__cplusplus)
+#if 0
+{ /* satisfy cc-mode */
+#endif
+} /* extern "C" { */
+#endif
+
+#endif /* RUBY_DEBUG_H */
diff --git a/include/ruby/defines.h b/include/ruby/defines.h
index ea38dc3689..de0883d2c9 100644
--- a/include/ruby/defines.h
+++ b/include/ruby/defines.h
@@ -149,76 +149,6 @@ void xfree(void*);
#endif
#endif
-#ifdef __NeXT__
-/* NextStep, OpenStep, Rhapsody */
-#ifndef S_IRUSR
-#define S_IRUSR 0000400 /* read permission, owner */
-#endif
-#ifndef S_IRGRP
-#define S_IRGRP 0000040 /* read permission, group */
-#endif
-#ifndef S_IROTH
-#define S_IROTH 0000004 /* read permission, other */
-#endif
-#ifndef S_IWUSR
-#define S_IWUSR 0000200 /* write permission, owner */
-#endif
-#ifndef S_IWGRP
-#define S_IWGRP 0000020 /* write permission, group */
-#endif
-#ifndef S_IWOTH
-#define S_IWOTH 0000002 /* write permission, other */
-#endif
-#ifndef S_IXUSR
-#define S_IXUSR 0000100 /* execute/search permission, owner */
-#endif
-#ifndef S_IXGRP
-#define S_IXGRP 0000010 /* execute/search permission, group */
-#endif
-#ifndef S_IXOTH
-#define S_IXOTH 0000001 /* execute/search permission, other */
-#endif
-#ifndef S_IRWXU
-#define S_IRWXU 0000700 /* read, write, execute permissions, owner */
-#endif
-#ifndef S_IRWXG
-#define S_IRWXG 0000070 /* read, write, execute permissions, group */
-#endif
-#ifndef S_IRWXO
-#define S_IRWXO 0000007 /* read, write, execute permissions, other */
-#endif
-#ifndef S_ISBLK
-#define S_ISBLK(mode) (((mode) & (0170000)) == (0060000))
-#endif
-#ifndef S_ISCHR
-#define S_ISCHR(mode) (((mode) & (0170000)) == (0020000))
-#endif
-#ifndef S_ISDIR
-#define S_ISDIR(mode) (((mode) & (0170000)) == (0040000))
-#endif
-#ifndef S_ISFIFO
-#define S_ISFIFO(mode) (((mode) & (0170000)) == (0010000))
-#endif
-#ifndef S_ISREG
-#define S_ISREG(mode) (((mode) & (0170000)) == (0100000))
-#endif
-#ifndef __APPLE__
-/* NextStep, OpenStep (but not Rhapsody) */
-#ifndef GETPGRP_VOID
-#define GETPGRP_VOID 1
-#endif
-#ifndef WNOHANG
-#define WNOHANG 01
-#endif
-#ifndef WUNTRACED
-#define WUNTRACED 02
-#endif
-#ifndef X_OK
-#define X_OK 1
-#endif
-#endif /* __APPLE__ */
-#endif /* NeXT */
-
#ifdef _WIN32
#include "ruby/win32.h"
#endif
@@ -267,22 +197,9 @@ void xfree(void*);
/* MB_CUR_MAX will not work well in C locale */
#endif
-#if defined(sparc) || defined(__sparc__)
-static inline void
-flush_register_windows(void)
-{
- asm
-#ifdef __GNUC__
- volatile
-#endif
-# if defined(__sparc_v9__) || defined(__sparcv9) || defined(__arch64__)
- ("flushw")
-# else
- ("ta 0x03")
-# endif /* trap always to flush register windows if we are on a Sparc system */
- ;
-}
-# define FLUSH_REGISTER_WINDOWS flush_register_windows()
+#if defined(__sparc)
+void rb_sparc_flush_register_windows(void);
+# define FLUSH_REGISTER_WINDOWS rb_sparc_flush_register_windows()
#elif defined(__ia64)
void *rb_ia64_bsp(void);
void rb_ia64_flushrs(void);
diff --git a/include/ruby/encoding.h b/include/ruby/encoding.h
index 123f76aff5..41640ec7e0 100644
--- a/include/ruby/encoding.h
+++ b/include/ruby/encoding.h
@@ -89,6 +89,7 @@ void rb_enc_set_index(VALUE obj, int encindex);
int rb_enc_find_index(const char *name);
int rb_to_encoding_index(VALUE);
rb_encoding* rb_to_encoding(VALUE);
+rb_encoding* rb_find_encoding(VALUE);
rb_encoding* rb_enc_get(VALUE);
rb_encoding* rb_enc_compatible(VALUE,VALUE);
rb_encoding* rb_enc_check(VALUE,VALUE);
@@ -111,6 +112,8 @@ VALUE rb_str_export_to_enc(VALUE, rb_encoding *);
VALUE rb_str_conv_enc(VALUE str, rb_encoding *from, rb_encoding *to);
VALUE rb_str_conv_enc_opts(VALUE str, rb_encoding *from, rb_encoding *to, int ecflags, VALUE ecopts);
+PRINTF_ARGS(NORETURN(void rb_enc_raise(rb_encoding *, VALUE, const char*, ...)), 3, 4);
+
/* index -> rb_encoding */
rb_encoding* rb_enc_from_index(int idx);
@@ -211,6 +214,13 @@ void rb_enc_set_default_external(VALUE encoding);
void rb_enc_set_default_internal(VALUE encoding);
VALUE rb_locale_charmap(VALUE klass);
long rb_memsearch(const void*,long,const void*,long,rb_encoding*);
+char *rb_enc_path_next(const char *,const char *,rb_encoding*);
+char *rb_enc_path_skip_prefix(const char *,const char *,rb_encoding*);
+char *rb_enc_path_last_separator(const char *,const char *,rb_encoding*);
+char *rb_enc_path_end(const char *,const char *,rb_encoding*);
+const char *ruby_enc_find_basename(const char *name, long *baselen, long *alllen, rb_encoding *enc);
+const char *ruby_enc_find_extname(const char *name, long *len, rb_encoding *enc);
+ID rb_check_id_cstr(const char *ptr, long len, rb_encoding *enc);
RUBY_EXTERN VALUE rb_cEncoding;
#define ENC_DUMMY_FLAG (1<<24)
@@ -305,6 +315,8 @@ void rb_econv_binmode(rb_econv_t *ec);
#define ECONV_DECORATOR_MASK 0x0000ff00
#define ECONV_NEWLINE_DECORATOR_MASK 0x00003f00
+#define ECONV_NEWLINE_DECORATOR_READ_MASK 0x00000f00
+#define ECONV_NEWLINE_DECORATOR_WRITE_MASK 0x00003000
#define ECONV_UNIVERSAL_NEWLINE_DECORATOR 0x00000100
#define ECONV_CRLF_NEWLINE_DECORATOR 0x00001000
@@ -316,7 +328,7 @@ void rb_econv_binmode(rb_econv_t *ec);
#define ECONV_XML_ATTR_QUOTE_DECORATOR 0x00100000
#if defined(RUBY_TEST_CRLF_ENVIRONMENT) || defined(_WIN32)
-#define ECONV_DEFAULT_NEWLINE_DECORATOR ECONV_UNIVERSAL_NEWLINE_DECORATOR
+#define ECONV_DEFAULT_NEWLINE_DECORATOR ECONV_CRLF_NEWLINE_DECORATOR
#else
#define ECONV_DEFAULT_NEWLINE_DECORATOR 0
#endif
diff --git a/include/ruby/intern.h b/include/ruby/intern.h
index 3ad0212ccb..1b7cabcd14 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -42,7 +42,7 @@ extern "C" {
* the kernel.
*/
-#define ID_ALLOCATOR 1
+#define UNLIMITED_ARGUMENTS (-1)
/* array.c */
void rb_mem_clear(register VALUE*, register long);
@@ -56,6 +56,7 @@ VALUE rb_ary_tmp_new(long);
void rb_ary_free(VALUE);
void rb_ary_modify(VALUE);
VALUE rb_ary_freeze(VALUE);
+VALUE rb_ary_shared_with_p(VALUE, VALUE);
VALUE rb_ary_aref(int, VALUE*, VALUE);
VALUE rb_ary_subseq(VALUE, long, long);
void rb_ary_store(VALUE, long, VALUE);
@@ -71,6 +72,7 @@ VALUE rb_ary_entry(VALUE, long);
VALUE rb_ary_each(VALUE);
VALUE rb_ary_join(VALUE, VALUE);
VALUE rb_ary_reverse(VALUE);
+VALUE rb_ary_rotate(VALUE, long);
VALUE rb_ary_sort(VALUE);
VALUE rb_ary_sort_bang(VALUE);
VALUE rb_ary_delete(VALUE, VALUE);
@@ -171,6 +173,7 @@ VALUE rb_define_class_id_under(VALUE, ID, VALUE);
VALUE rb_module_new(void);
VALUE rb_define_module_id(ID);
VALUE rb_define_module_id_under(VALUE, ID);
+VALUE rb_include_class_new(VALUE, VALUE);
VALUE rb_mod_included_modules(VALUE);
VALUE rb_mod_include_p(VALUE, VALUE);
VALUE rb_mod_ancestors(VALUE);
@@ -196,34 +199,47 @@ VALUE rb_fiber_yield(int argc, VALUE *args);
VALUE rb_fiber_current(void);
VALUE rb_fiber_alive_p(VALUE);
/* enum.c */
+VALUE rb_enum_values_pack(int, VALUE*);
/* enumerator.c */
VALUE rb_enumeratorize(VALUE, VALUE, int, VALUE *);
-#define RETURN_ENUMERATOR(obj, argc, argv) do { \
+VALUE rb_enumeratorize_with_size(VALUE, VALUE, int, VALUE *, VALUE (*)(ANYARGS));
+#define RETURN_SIZED_ENUMERATOR(obj, argc, argv, size_fn) do { \
if (!rb_block_given_p()) \
- return rb_enumeratorize((obj), ID2SYM(rb_frame_this_func()),\
- (argc), (argv)); \
+ return rb_enumeratorize_with_size((obj), ID2SYM(rb_frame_this_func()),\
+ (argc), (argv), (size_fn)); \
} while (0)
+#define RETURN_ENUMERATOR(obj, argc, argv) RETURN_SIZED_ENUMERATOR(obj, argc, argv, 0)
/* error.c */
VALUE rb_exc_new(VALUE, const char*, long);
VALUE rb_exc_new2(VALUE, const char*);
VALUE rb_exc_new3(VALUE, VALUE);
PRINTF_ARGS(NORETURN(void rb_loaderror(const char*, ...)), 1, 2);
+PRINTF_ARGS(NORETURN(void rb_loaderror_with_path(VALUE path, const char*, ...)), 2, 3);
PRINTF_ARGS(NORETURN(void rb_name_error(ID, const char*, ...)), 2, 3);
+PRINTF_ARGS(NORETURN(void rb_name_error_str(VALUE, const char*, ...)), 2, 3);
NORETURN(void rb_invalid_str(const char*, const char*));
PRINTF_ARGS(void rb_compile_error(const char*, int, const char*, ...), 3, 4);
PRINTF_ARGS(void rb_compile_error_with_enc(const char*, int, void *, const char*, ...), 4, 5);
PRINTF_ARGS(void rb_compile_error_append(const char*, ...), 1, 2);
-NORETURN(void rb_load_fail(const char*));
NORETURN(void rb_error_frozen(const char*));
+void rb_error_untrusted(VALUE);
void rb_check_frozen(VALUE);
+void rb_check_trusted(VALUE);
#define rb_check_frozen_internal(obj) do { \
VALUE frozen_obj = (obj); \
if (OBJ_FROZEN(frozen_obj)) { \
rb_error_frozen(rb_obj_classname(frozen_obj)); \
} \
} while (0)
+#define rb_check_trusted_internal(obj) do { \
+ VALUE untrusted_obj = (obj); \
+ if (!OBJ_UNTRUSTED(untrusted_obj)) { \
+ rb_error_untrusted(untrusted_obj); \
+ } \
+ } while (0)
#ifdef __GNUC__
#define rb_check_frozen(obj) __extension__({rb_check_frozen_internal(obj);})
+#define rb_check_trusted(obj) __extension__({rb_check_trusted_internal(obj);})
#else
static inline void
rb_check_frozen_inline(VALUE obj)
@@ -231,13 +247,29 @@ rb_check_frozen_inline(VALUE obj)
rb_check_frozen_internal(obj);
}
#define rb_check_frozen(obj) rb_check_frozen_inline(obj)
+static inline void
+rb_check_trusted_inline(VALUE obj)
+{
+ rb_check_trusted_internal(obj);
+}
+#define rb_check_trusted(obj) rb_check_trusted_inline(obj)
#endif
+void rb_check_copyable(VALUE obj, VALUE orig);
+
+#define OBJ_INIT_COPY(obj, orig) \
+ ((obj) != (orig) && (rb_obj_init_copy((obj), (orig)), 1))
/* eval.c */
int rb_sourceline(void);
const char *rb_sourcefile(void);
VALUE rb_check_funcall(VALUE, ID, int, VALUE*);
+NORETURN(void rb_error_arity(int, int, int));
+#define rb_check_arity(argc, min, max) do { \
+ if (((argc) < (min)) || ((argc) > (max) && (max) != UNLIMITED_ARGUMENTS)) \
+ rb_error_arity(argc, min, max); \
+ } while(0)
+
#if defined(NFDBITS) && defined(HAVE_RB_FD_INIT)
typedef struct {
int maxfd;
@@ -270,6 +302,8 @@ void rb_fd_term(rb_fdset_t *);
void rb_fd_set(int, rb_fdset_t *);
#define rb_fd_clr(n, f) rb_w32_fdclr((n), (f)->fdset)
#define rb_fd_isset(n, f) rb_w32_fdisset((n), (f)->fdset)
+#define rb_fd_copy(d, s, n) rb_w32_fd_copy((d), (s), (n))
+void rb_w32_fd_copy(rb_fdset_t *, const fd_set *, int);
#define rb_fd_dup(d, s) rb_w32_fd_dup((d), (s))
void rb_w32_fd_dup(rb_fdset_t *dst, const rb_fdset_t *src);
#define rb_fd_select(n, rfds, wfds, efds, timeout) rb_w32_select((n), (rfds) ? ((rb_fdset_t*)(rfds))->fdset : NULL, (wfds) ? ((rb_fdset_t*)(wfds))->fdset : NULL, (efds) ? ((rb_fdset_t*)(efds))->fdset: NULL, (timeout))
@@ -354,12 +388,7 @@ int rb_mod_method_arity(VALUE, ID);
int rb_obj_method_arity(VALUE, ID);
VALUE rb_protect(VALUE (*)(VALUE), VALUE, int*);
void rb_set_end_proc(void (*)(VALUE), VALUE);
-void rb_mark_end_proc(void);
void rb_exec_end_proc(void);
-void ruby_finalize(void);
-NORETURN(void ruby_stop(int));
-int ruby_cleanup(volatile int);
-DEPRECATED(void rb_gc_mark_threads(void));
void rb_thread_schedule(void);
void rb_thread_wait_fd(int);
int rb_thread_fd_writable(int);
@@ -394,26 +423,15 @@ VALUE rb_file_expand_path(VALUE, VALUE);
VALUE rb_file_s_absolute_path(int, VALUE *);
VALUE rb_file_absolute_path(VALUE, VALUE);
VALUE rb_file_dirname(VALUE fname);
-void rb_file_const(const char*, VALUE);
-int rb_file_load_ok(const char *);
int rb_find_file_ext_safe(VALUE*, const char* const*, int);
VALUE rb_find_file_safe(VALUE, int);
int rb_find_file_ext(VALUE*, const char* const*);
VALUE rb_find_file(VALUE);
-char *rb_path_next(const char *);
-char *rb_path_skip_prefix(const char *);
-char *rb_path_last_separator(const char *);
-char *rb_path_end(const char *);
VALUE rb_file_directory_p(VALUE,VALUE);
VALUE rb_str_encode_ospath(VALUE);
int rb_is_absolute_path(const char *);
-const char *ruby_find_basename(const char *name, long *baselen, long *alllen);
-const char *ruby_find_extname(const char *name, long *len);
/* gc.c */
-void ruby_set_stack_size(size_t);
NORETURN(void rb_memerror(void));
-int ruby_stack_check(void);
-size_t ruby_stack_length(VALUE**);
int rb_during_gc(void);
void rb_gc_mark_locations(VALUE*, VALUE*);
void rb_mark_tbl(struct st_table*);
@@ -429,7 +447,6 @@ void rb_gc_call_finalizer_at_exit(void);
VALUE rb_gc_enable(void);
VALUE rb_gc_disable(void);
VALUE rb_gc_start(void);
-#define Init_stack(addr) ruby_init_stack(addr)
void rb_gc_set_params(void);
/* hash.c */
void st_foreach_safe(struct st_table *, int (*)(ANYARGS), st_data_t);
@@ -444,6 +461,7 @@ VALUE rb_hash_lookup(VALUE, VALUE);
VALUE rb_hash_lookup2(VALUE, VALUE, VALUE);
VALUE rb_hash_fetch(VALUE, VALUE);
VALUE rb_hash_aset(VALUE, VALUE, VALUE);
+VALUE rb_hash_clear(VALUE);
VALUE rb_hash_delete_if(VALUE);
VALUE rb_hash_delete(VALUE,VALUE);
typedef VALUE rb_hash_update_func(VALUE newkey, VALUE oldkey, VALUE value);
@@ -483,19 +501,24 @@ void rb_write_error2(const char*, long);
void rb_close_before_exec(int lowfd, int maxhint, VALUE noclose_fds);
int rb_pipe(int *pipes);
int rb_reserved_fd_p(int fd);
+int rb_cloexec_open(const char *pathname, int flags, mode_t mode);
+int rb_cloexec_dup(int oldfd);
+int rb_cloexec_dup2(int oldfd, int newfd);
+int rb_cloexec_pipe(int fildes[2]);
+int rb_cloexec_fcntl_dupfd(int fd, int minfd);
#define RB_RESERVED_FD_P(fd) rb_reserved_fd_p(fd)
void rb_update_max_fd(int fd);
+void rb_fd_fix_cloexec(int fd);
/* marshal.c */
VALUE rb_marshal_dump(VALUE, VALUE);
VALUE rb_marshal_load(VALUE);
void rb_marshal_define_compat(VALUE newclass, VALUE oldclass, VALUE (*dumper)(VALUE), VALUE (*loader)(VALUE, VALUE));
/* numeric.c */
-void rb_num_zerodiv(void);
+NORETURN(void rb_num_zerodiv(void));
#define RB_NUM_COERCE_FUNCS_NEED_OPID 1
VALUE rb_num_coerce_bin(VALUE, VALUE, ID);
VALUE rb_num_coerce_cmp(VALUE, VALUE, ID);
VALUE rb_num_coerce_relop(VALUE, VALUE, ID);
-VALUE rb_float_new(double);
VALUE rb_num2fix(VALUE);
VALUE rb_fix2str(VALUE, int);
VALUE rb_dbl_cmp(double, double);
@@ -528,26 +551,28 @@ VALUE rb_check_convert_type(VALUE,int,const char*,const char*);
VALUE rb_check_to_integer(VALUE, const char *);
VALUE rb_check_to_float(VALUE);
VALUE rb_to_int(VALUE);
+VALUE rb_check_to_int(VALUE);
VALUE rb_Integer(VALUE);
VALUE rb_to_float(VALUE);
VALUE rb_Float(VALUE);
VALUE rb_String(VALUE);
VALUE rb_Array(VALUE);
+VALUE rb_Hash(VALUE);
double rb_cstr_to_dbl(const char*, int);
double rb_str_to_dbl(VALUE, int);
/* parse.y */
RUBY_EXTERN int ruby_sourceline;
RUBY_EXTERN char *ruby_sourcefile;
ID rb_id_attrset(ID);
-void rb_gc_mark_parser(void);
int rb_is_const_id(ID);
+int rb_is_global_id(ID);
int rb_is_instance_id(ID);
+int rb_is_attrset_id(ID);
int rb_is_class_id(ID);
int rb_is_local_id(ID);
int rb_is_junk_id(ID);
int rb_symname_p(const char*);
int rb_sym_interned_p(VALUE);
-void rb_gc_mark_symbols(void);
VALUE rb_backref_get(void);
void rb_backref_set(VALUE);
VALUE rb_lastline_get(void);
@@ -557,23 +582,19 @@ VALUE rb_sym_all_symbols(void);
void rb_last_status_set(int status, rb_pid_t pid);
VALUE rb_last_status_get(void);
struct rb_exec_arg {
- int argc;
- VALUE *argv;
- const char *prog;
- VALUE options;
- VALUE redirect_fds;
+ VALUE execarg_obj;
};
-int rb_proc_exec_n(int, VALUE*, const char*);
+DEPRECATED(int rb_proc_exec_n(int, VALUE*, const char*));
int rb_proc_exec(const char*);
-VALUE rb_exec_arg_init(int argc, VALUE *argv, int accept_shell, struct rb_exec_arg *e);
-int rb_exec_arg_addopt(struct rb_exec_arg *e, VALUE key, VALUE val);
-void rb_exec_arg_fixup(struct rb_exec_arg *e);
-int rb_run_exec_options(const struct rb_exec_arg *e, struct rb_exec_arg *s);
-int rb_run_exec_options_err(const struct rb_exec_arg *e, struct rb_exec_arg *s, char*, size_t);
-int rb_exec(const struct rb_exec_arg*);
-int rb_exec_err(const struct rb_exec_arg*, char*, size_t);
-rb_pid_t rb_fork(int*, int (*)(void*), void*, VALUE);
-rb_pid_t rb_fork_err(int*, int (*)(void*, char*, size_t), void*, VALUE, char*, size_t);
+DEPRECATED(VALUE rb_exec_arg_init(int argc, VALUE *argv, int accept_shell, struct rb_exec_arg *e));
+DEPRECATED(int rb_exec_arg_addopt(struct rb_exec_arg *e, VALUE key, VALUE val));
+DEPRECATED(void rb_exec_arg_fixup(struct rb_exec_arg *e));
+DEPRECATED(int rb_run_exec_options(const struct rb_exec_arg *e, struct rb_exec_arg *s));
+DEPRECATED(int rb_run_exec_options_err(const struct rb_exec_arg *e, struct rb_exec_arg *s, char*, size_t));
+DEPRECATED(int rb_exec(const struct rb_exec_arg*));
+DEPRECATED(int rb_exec_err(const struct rb_exec_arg*, char*, size_t));
+DEPRECATED(rb_pid_t rb_fork(int*, int (*)(void*), void*, VALUE));
+DEPRECATED(rb_pid_t rb_fork_err(int*, int (*)(void*, char*, size_t), void*, VALUE, char*, size_t));
VALUE rb_f_exec(int,VALUE*);
rb_pid_t rb_waitpid(rb_pid_t pid, int *status, int flags);
void rb_syswait(rb_pid_t pid);
@@ -593,6 +614,7 @@ VALUE rb_random_bytes(VALUE rnd, long n);
VALUE rb_random_int(VALUE rnd, VALUE max);
unsigned int rb_random_int32(VALUE rnd);
double rb_random_real(VALUE rnd);
+unsigned long rb_random_ulong_limited(VALUE rnd, unsigned long limit);
unsigned long rb_genrand_ulong_limited(unsigned long i);
/* re.c */
#define rb_memcmp memcmp
@@ -618,20 +640,12 @@ int rb_reg_options(VALUE);
RUBY_EXTERN VALUE rb_argv0;
VALUE rb_get_argv(void);
void *rb_load_file(const char*);
-void ruby_script(const char*);
-void ruby_prog_init(void);
-void ruby_set_argv(int, char**);
-void *ruby_process_options(int, char**);
-void ruby_init_loadpath(void);
-void ruby_incpush(const char*);
/* signal.c */
VALUE rb_f_kill(int, VALUE*);
-void rb_gc_mark_trap_list(void);
#ifdef POSIX_SIGNAL
#define posix_signal ruby_posix_signal
RETSIGTYPE (*posix_signal(int, RETSIGTYPE (*)(int)))(int);
#endif
-void ruby_sig_finalize(void);
void rb_trap_exit(void);
void rb_trap_exec(void);
const char *ruby_signal_name(int);
@@ -677,6 +691,7 @@ VALUE rb_str_buf_cat2(VALUE, const char*);
VALUE rb_str_buf_cat_ascii(VALUE, const char*);
VALUE rb_obj_as_string(VALUE);
VALUE rb_check_string_type(VALUE);
+void rb_must_asciicompat(VALUE);
VALUE rb_str_dup(VALUE);
VALUE rb_str_resurrect(VALUE str);
VALUE rb_str_locktmp(VALUE);
@@ -689,6 +704,7 @@ long rb_str_sublen(VALUE, long);
VALUE rb_str_substr(VALUE, long, long);
VALUE rb_str_subseq(VALUE, long, long);
void rb_str_modify(VALUE);
+void rb_str_modify_expand(VALUE, long);
VALUE rb_str_freeze(VALUE);
void rb_str_set_len(VALUE, long);
VALUE rb_str_resize(VALUE, long);
@@ -807,8 +823,10 @@ typedef void rb_unblock_function_t(void *);
typedef VALUE rb_blocking_function_t(void *);
void rb_thread_check_ints(void);
int rb_thread_interrupted(VALUE thval);
-VALUE rb_thread_blocking_region(rb_blocking_function_t *func, void *data1,
- rb_unblock_function_t *ubf, void *data2);
+
+/* Use rb_thread_call_without_gvl family instead. */
+DEPRECATED(VALUE rb_thread_blocking_region(rb_blocking_function_t *func, void *data1,
+ rb_unblock_function_t *ubf, void *data2));
#define RUBY_UBF_IO ((rb_unblock_function_t *)-1)
#define RUBY_UBF_PROCESS ((rb_unblock_function_t *)-1)
VALUE rb_mutex_new(void);
@@ -818,10 +836,6 @@ VALUE rb_mutex_lock(VALUE mutex);
VALUE rb_mutex_unlock(VALUE mutex);
VALUE rb_mutex_sleep(VALUE self, VALUE timeout);
VALUE rb_mutex_synchronize(VALUE mutex, VALUE (*func)(VALUE arg), VALUE arg);
-VALUE rb_barrier_new(void);
-VALUE rb_barrier_wait(VALUE self);
-VALUE rb_barrier_release(VALUE self);
-VALUE rb_barrier_destroy(VALUE self);
/* time.c */
VALUE rb_time_new(time_t, long);
VALUE rb_time_nano_new(time_t, long);
@@ -841,15 +855,12 @@ VALUE rb_class_name(VALUE);
void rb_autoload(VALUE, ID, const char*);
VALUE rb_autoload_load(VALUE, ID);
VALUE rb_autoload_p(VALUE, ID);
-void rb_gc_mark_global_tbl(void);
VALUE rb_f_trace_var(int, VALUE*);
VALUE rb_f_untrace_var(int, VALUE*);
VALUE rb_f_global_variables(void);
void rb_alias_variable(ID, ID);
struct st_table* rb_generic_ivar_table(VALUE);
void rb_copy_generic_ivar(VALUE,VALUE);
-void rb_mark_generic_ivar(VALUE);
-void rb_mark_generic_ivar_tbl(void);
void rb_free_generic_ivar(VALUE);
VALUE rb_ivar_get(VALUE, ID);
VALUE rb_ivar_set(VALUE, ID, VALUE);
@@ -881,11 +892,8 @@ VALUE rb_cvar_get(VALUE, ID);
void rb_cv_set(VALUE, const char*, VALUE);
VALUE rb_cv_get(VALUE, const char*);
void rb_define_class_variable(VALUE, const char*, VALUE);
-VALUE rb_mod_class_variables(VALUE);
+VALUE rb_mod_class_variables(int, VALUE*, VALUE);
VALUE rb_mod_remove_cvar(VALUE, VALUE);
-/* version.c */
-void ruby_show_version(void);
-void ruby_show_copyright(void);
ID rb_frame_callee(void);
VALUE rb_str_succ(VALUE);
diff --git a/include/ruby/io.h b/include/ruby/io.h
index cfdfaf1fb7..07be55c46c 100644
--- a/include/ruby/io.h
+++ b/include/ruby/io.h
@@ -168,6 +168,7 @@ void rb_io_synchronized(rb_io_t*);
void rb_io_check_initialized(rb_io_t*);
void rb_io_check_closed(rb_io_t*);
VALUE rb_io_get_io(VALUE io);
+VALUE rb_io_check_io(VALUE io);
VALUE rb_io_get_write_io(VALUE io);
VALUE rb_io_set_write_io(VALUE io, VALUE w);
int rb_io_wait_readable(int);
diff --git a/include/ruby/missing.h b/include/ruby/missing.h
index bded5521d1..1297c43a7a 100644
--- a/include/ruby/missing.h
+++ b/include/ruby/missing.h
@@ -20,6 +20,7 @@ extern "C" {
#include "ruby/config.h"
#include <stddef.h>
+#include <math.h> /* for INFINITY and NAN */
#ifdef RUBY_EXTCONF_H
#include RUBY_EXTCONF_H
#endif
@@ -51,8 +52,8 @@ struct timezone {
};
#endif
-#if defined(HAVE___SYSCALL) && defined(__APPLE__)
-/* Mac OS X has __syscall but doen't defined in headers */
+#if defined(HAVE___SYSCALL) && (defined(__APPLE__) || defined(__OpenBSD__))
+/* Mac OS X and OpenBSD have __syscall but don't define it in headers */
off_t __syscall(quad_t number, ...);
#endif
@@ -124,20 +125,27 @@ RUBY_EXTERN double lgamma_r(double, int *);
RUBY_EXTERN double cbrt(double);
#endif
+#if !defined(INFINITY) || !defined(NAN)
+union bytesequence4_or_float {
+ unsigned char bytesequence[4];
+ float float_value;
+};
+#endif
+
#ifdef INFINITY
# define HAVE_INFINITY
#else
/** @internal */
-RUBY_EXTERN const unsigned char rb_infinity[];
-# define INFINITY (*(float *)rb_infinity)
+RUBY_EXTERN const union bytesequence4_or_float rb_infinity;
+# define INFINITY (rb_infinity.float_value)
#endif
#ifdef NAN
# define HAVE_NAN
#else
/** @internal */
-RUBY_EXTERN const unsigned char rb_nan[];
-# define NAN (*(float *)rb_nan)
+RUBY_EXTERN const union bytesequence4_or_float rb_nan;
+# define NAN (rb_nan.float_value)
#endif
#ifndef isinf
diff --git a/include/ruby/oniguruma.h b/include/ruby/oniguruma.h
index 67773aa482..c01b6f7bb4 100644
--- a/include/ruby/oniguruma.h
+++ b/include/ruby/oniguruma.h
@@ -1,10 +1,11 @@
#ifndef ONIGURUMA_H
#define ONIGURUMA_H
/**********************************************************************
- oniguruma.h - Oniguruma (regular expression library)
+ oniguruma.h - Onigmo (Oniguruma-mod) (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2009 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2011-2012 K.Takata <kentkt AT csc DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -38,8 +39,8 @@ extern "C" {
#define ONIGURUMA
#define ONIGURUMA_VERSION_MAJOR 5
-#define ONIGURUMA_VERSION_MINOR 9
-#define ONIGURUMA_VERSION_TEENY 2
+#define ONIGURUMA_VERSION_MINOR 13
+#define ONIGURUMA_VERSION_TEENY 1
#ifdef __cplusplus
# ifndef HAVE_PROTOTYPES
@@ -101,6 +102,8 @@ extern "C" {
#pragma GCC visibility push(default)
#endif
+#include <stddef.h> /* for size_t */
+
/* PART: character encoding */
#ifndef ONIG_ESCAPE_UCHAR_COLLISION
@@ -108,9 +111,10 @@ extern "C" {
#endif
typedef unsigned char OnigUChar;
-typedef unsigned int OnigCodePoint;
+typedef unsigned int OnigCodePoint;
typedef unsigned int OnigCtype;
typedef size_t OnigDistance;
+typedef ptrdiff_t OnigPosition;
#define ONIG_INFINITE_DISTANCE ~((OnigDistance )0)
@@ -171,6 +175,7 @@ typedef struct OnigEncodingTypeST {
OnigUChar* (*left_adjust_char_head)(const OnigUChar* start, const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc);
int (*is_allowed_reverse_match)(const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc);
int ruby_encoding_index;
+ unsigned int flags;
} OnigEncodingType;
typedef OnigEncodingType* OnigEncoding;
@@ -204,17 +209,12 @@ ONIG_EXTERN OnigEncodingType OnigEncodingASCII;
#define ONIGENC_CTYPE_ALNUM 13 /* alpha || digit */
#define ONIGENC_CTYPE_ASCII 14
#define ONIGENC_MAX_STD_CTYPE ONIGENC_CTYPE_ASCII
-#define ONIGENC_CTYPE_SPECIAL_MASK 256
-#define ONIGENC_CTYPE_S /* [\t\n\v\f\r\s] */ \
- ONIGENC_CTYPE_SPECIAL_MASK | ONIGENC_CTYPE_SPACE
-#define ONIGENC_CTYPE_D /* [0-9] */ \
- ONIGENC_CTYPE_SPECIAL_MASK | ONIGENC_CTYPE_DIGIT
-#define ONIGENC_CTYPE_W /* [0-9A-Za-z_] */ \
- ONIGENC_CTYPE_SPECIAL_MASK | ONIGENC_CTYPE_WORD
-#define ONIGENC_CTYPE_SPECIAL_P(ctype) ((ctype) & ONIGENC_CTYPE_SPECIAL_MASK)
+/* flags */
+#define ONIGENC_FLAG_NONE 0U
+#define ONIGENC_FLAG_UNICODE 1U
-#define onig_enc_len(enc,p,e) ONIGENC_MBC_ENC_LEN(enc, p, e)
+#define onig_enc_len(enc,p,e) ONIGENC_MBC_ENC_LEN(enc, p, e)
#define ONIGENC_IS_UNDEF(enc) ((enc) == ONIG_ENCODING_UNDEF)
#define ONIGENC_IS_SINGLEBYTE(enc) (ONIGENC_MBC_MAXLEN(enc) == 1)
@@ -223,6 +223,10 @@ ONIG_EXTERN OnigEncodingType OnigEncodingASCII;
#define ONIGENC_IS_CODE_ASCII(code) ((code) < 128)
#define ONIGENC_IS_MBC_WORD(enc,s,end) \
ONIGENC_IS_CODE_WORD(enc,ONIGENC_MBC_TO_CODE(enc,s,end))
+#define ONIGENC_IS_MBC_ASCII_WORD(enc,s,end) \
+ onigenc_ascii_is_code_ctype( \
+ ONIGENC_MBC_TO_CODE(enc,s,end),ONIGENC_CTYPE_WORD,enc)
+#define ONIGENC_IS_UNICODE(enc) ((enc)->flags & ONIGENC_FLAG_UNICODE)
#define ONIGENC_NAME(enc) ((enc)->name)
@@ -350,6 +354,7 @@ typedef unsigned int OnigOptionType;
#define ONIG_OPTION_IGNORECASE 1U
#define ONIG_OPTION_EXTEND (ONIG_OPTION_IGNORECASE << 1)
#define ONIG_OPTION_MULTILINE (ONIG_OPTION_EXTEND << 1)
+#define ONIG_OPTION_DOTALL ONIG_OPTION_MULTILINE
#define ONIG_OPTION_SINGLELINE (ONIG_OPTION_MULTILINE << 1)
#define ONIG_OPTION_FIND_LONGEST (ONIG_OPTION_SINGLELINE << 1)
#define ONIG_OPTION_FIND_NOT_EMPTY (ONIG_OPTION_FIND_LONGEST << 1)
@@ -360,7 +365,13 @@ typedef unsigned int OnigOptionType;
#define ONIG_OPTION_NOTBOL (ONIG_OPTION_CAPTURE_GROUP << 1)
#define ONIG_OPTION_NOTEOL (ONIG_OPTION_NOTBOL << 1)
#define ONIG_OPTION_POSIX_REGION (ONIG_OPTION_NOTEOL << 1)
-#define ONIG_OPTION_MAXBIT ONIG_OPTION_POSIX_REGION /* limit */
+/* options (ctype range) */
+#define ONIG_OPTION_ASCII_RANGE (ONIG_OPTION_POSIX_REGION << 1)
+#define ONIG_OPTION_POSIX_BRACKET_ALL_RANGE (ONIG_OPTION_ASCII_RANGE << 1)
+#define ONIG_OPTION_WORD_BOUND_ALL_RANGE (ONIG_OPTION_POSIX_BRACKET_ALL_RANGE << 1)
+/* options (newline) */
+#define ONIG_OPTION_NEWLINE_CRLF (ONIG_OPTION_WORD_BOUND_ALL_RANGE << 1)
+#define ONIG_OPTION_MAXBIT ONIG_OPTION_NEWLINE_CRLF /* limit */
#define ONIG_OPTION_ON(options,regopt) ((options) |= (regopt))
#define ONIG_OPTION_OFF(options,regopt) ((options) &= ~(regopt))
@@ -382,9 +393,11 @@ ONIG_EXTERN const OnigSyntaxType OnigSyntaxEmacs;
ONIG_EXTERN const OnigSyntaxType OnigSyntaxGrep;
ONIG_EXTERN const OnigSyntaxType OnigSyntaxGnuRegex;
ONIG_EXTERN const OnigSyntaxType OnigSyntaxJava;
+ONIG_EXTERN const OnigSyntaxType OnigSyntaxPerl58;
+ONIG_EXTERN const OnigSyntaxType OnigSyntaxPerl58_NG;
ONIG_EXTERN const OnigSyntaxType OnigSyntaxPerl;
-ONIG_EXTERN const OnigSyntaxType OnigSyntaxPerl_NG;
ONIG_EXTERN const OnigSyntaxType OnigSyntaxRuby;
+ONIG_EXTERN const OnigSyntaxType OnigSyntaxPython;
/* predefined syntaxes (see regsyntax.c) */
#define ONIG_SYNTAX_ASIS (&OnigSyntaxASIS)
@@ -394,9 +407,11 @@ ONIG_EXTERN const OnigSyntaxType OnigSyntaxRuby;
#define ONIG_SYNTAX_GREP (&OnigSyntaxGrep)
#define ONIG_SYNTAX_GNU_REGEX (&OnigSyntaxGnuRegex)
#define ONIG_SYNTAX_JAVA (&OnigSyntaxJava)
+#define ONIG_SYNTAX_PERL58 (&OnigSyntaxPerl58)
+#define ONIG_SYNTAX_PERL58_NG (&OnigSyntaxPerl58_NG)
#define ONIG_SYNTAX_PERL (&OnigSyntaxPerl)
-#define ONIG_SYNTAX_PERL_NG (&OnigSyntaxPerl_NG)
#define ONIG_SYNTAX_RUBY (&OnigSyntaxRuby)
+#define ONIG_SYNTAX_PYTHON (&OnigSyntaxPython)
/* default syntax */
ONIG_EXTERN const OnigSyntaxType* OnigDefaultSyntax;
@@ -434,11 +449,12 @@ ONIG_EXTERN const OnigSyntaxType* OnigDefaultSyntax;
#define ONIG_SYN_OP_ESC_OCTAL3 (1U<<28) /* \OOO */
#define ONIG_SYN_OP_ESC_X_HEX2 (1U<<29) /* \xHH */
#define ONIG_SYN_OP_ESC_X_BRACE_HEX8 (1U<<30) /* \x{7HHHHHHH} */
+#define ONIG_SYN_OP_ESC_O_BRACE_OCTAL (1U<<31) /* \o{OOO} */ /* NOTIMPL */
#define ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE (1U<<0) /* \Q...\E */
#define ONIG_SYN_OP2_QMARK_GROUP_EFFECT (1U<<1) /* (?...) */
-#define ONIG_SYN_OP2_OPTION_PERL (1U<<2) /* (?imsx),(?-imsx) */
-#define ONIG_SYN_OP2_OPTION_RUBY (1U<<3) /* (?imx), (?-imx) */
+#define ONIG_SYN_OP2_OPTION_PERL (1U<<2) /* (?imsxadlu), (?-imsx), (?^imsxalu) */
+#define ONIG_SYN_OP2_OPTION_RUBY (1U<<3) /* (?imxadu), (?-imx) */
#define ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT (1U<<4) /* ?+,*+,++ */
#define ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL (1U<<5) /* {n,m}+ */
#define ONIG_SYN_OP2_CCLASS_SET_OP (1U<<6) /* [...&&..[..]..] */
@@ -456,6 +472,17 @@ ONIG_EXTERN const OnigSyntaxType* OnigDefaultSyntax;
/* #define ONIG_SYN_OP2_CHAR_PROPERTY_PREFIX_IS (1U<<18) */
#define ONIG_SYN_OP2_ESC_H_XDIGIT (1U<<19) /* \h, \H */
#define ONIG_SYN_OP2_INEFFECTIVE_ESCAPE (1U<<20) /* \ */
+#define ONIG_SYN_OP2_ESC_CAPITAL_R_LINEBREAK (1U<<21) /* \R as (?>\x0D\x0A|[\x0A-\x0D\x{85}\x{2028}\x{2029}]) */
+#define ONIG_SYN_OP2_ESC_CAPITAL_X_EXTENDED_GRAPHEME_CLUSTER (1U<<22) /* \X as (?>\P{M}\p{M}*) */
+#define ONIG_SYN_OP2_ESC_V_VERTICAL_WHITESPACE (1U<<23) /* \v, \V -- Perl */ /* NOTIMPL */
+#define ONIG_SYN_OP2_ESC_H_HORIZONTAL_WHITESPACE (1U<<24) /* \h, \H -- Perl */ /* NOTIMPL */
+#define ONIG_SYN_OP2_ESC_CAPITAL_K_KEEP (1U<<25) /* \K */
+#define ONIG_SYN_OP2_ESC_G_BRACE_BACKREF (1U<<26) /* \g{name}, \g{n} */
+#define ONIG_SYN_OP2_QMARK_SUBEXP_CALL (1U<<27) /* (?&name), (?n), (?R), (?0) */
+#define ONIG_SYN_OP2_QMARK_VBAR_BRANCH_RESET (1U<<28) /* (?|...) */ /* NOTIMPL */
+#define ONIG_SYN_OP2_QMARK_LPAREN_CONDITION (1U<<29) /* (?(cond)yes...|no...) */
+#define ONIG_SYN_OP2_QMARK_CAPITAL_P_NAMED_GROUP (1U<<30) /* (?P<name>...), (?P=name), (?P>name) -- Python/PCRE */
+#define ONIG_SYN_OP2_OPTION_JAVA (1U<<31) /* (?idmsux), (?-idmsux) */ /* NOTIMPL */
/* syntax (behavior) */
#define ONIG_SYN_CONTEXT_INDEP_ANCHORS (1U<<31) /* not implemented */
@@ -469,6 +496,7 @@ ONIG_EXTERN const OnigSyntaxType* OnigDefaultSyntax;
#define ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP (1U<<7) /* see doc/RE */
#define ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME (1U<<8) /* (?<x>)(?<x>) */
#define ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY (1U<<9) /* a{n}?=(?:a{n})? */
+#define ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME_CALL (1U<<10) /* (?<x>)(?<x>)(?&x) */
/* syntax (behavior) in char class [...] */
#define ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC (1U<<20) /* [^...] */
@@ -505,7 +533,7 @@ ONIG_EXTERN const OnigSyntaxType* OnigDefaultSyntax;
#define ONIGERR_UNDEFINED_BYTECODE -13
#define ONIGERR_UNEXPECTED_BYTECODE -14
#define ONIGERR_MATCH_STACK_LIMIT_OVER -15
-#define ONIGERR_DEFAULT_ENCODING_IS_NOT_SETTED -21
+#define ONIGERR_DEFAULT_ENCODING_IS_NOT_SET -21
#define ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR -22
/* general error */
#define ONIGERR_INVALID_ARGUMENT -30
@@ -532,6 +560,7 @@ ONIG_EXTERN const OnigSyntaxType* OnigDefaultSyntax;
#define ONIGERR_INVALID_POSIX_BRACKET_TYPE -121
#define ONIGERR_INVALID_LOOK_BEHIND_PATTERN -122
#define ONIGERR_INVALID_REPEAT_RANGE_PATTERN -123
+#define ONIGERR_INVALID_CONDITION_PATTERN -124
/* values error (syntax error) */
#define ONIGERR_TOO_BIG_NUMBER -200
#define ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE -201
@@ -543,6 +572,7 @@ ONIG_EXTERN const OnigSyntaxType* OnigDefaultSyntax;
#define ONIGERR_TOO_BIG_BACKREF_NUMBER -207
#define ONIGERR_INVALID_BACKREF -208
#define ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED -209
+#define ONIGERR_TOO_SHORT_DIGITS -210
#define ONIGERR_TOO_LONG_WIDE_CHAR_VALUE -212
#define ONIGERR_EMPTY_GROUP_NAME -214
#define ONIGERR_INVALID_GROUP_NAME -215
@@ -571,8 +601,8 @@ ONIG_EXTERN const OnigSyntaxType* OnigDefaultSyntax;
typedef struct OnigCaptureTreeNodeStruct {
int group; /* group number */
- int beg;
- int end;
+ OnigPosition beg;
+ OnigPosition end;
int allocated;
int num_childs;
struct OnigCaptureTreeNodeStruct** childs;
@@ -582,8 +612,8 @@ typedef struct OnigCaptureTreeNodeStruct {
struct re_registers {
int allocated;
int num_regs;
- int* beg;
- int* end;
+ OnigPosition* beg;
+ OnigPosition* end;
/* extended */
OnigCaptureTreeNode* history_root; /* capture history tree root */
};
@@ -689,7 +719,7 @@ typedef struct {
ONIG_EXTERN
int onig_init P_((void));
ONIG_EXTERN
-int onig_error_code_to_str PV_((OnigUChar* s, int err_code, ...));
+int onig_error_code_to_str PV_((OnigUChar* s, OnigPosition err_code, ...));
ONIG_EXTERN
void onig_set_warn_func P_((OnigWarnFunc f));
ONIG_EXTERN
@@ -697,7 +727,7 @@ void onig_set_verb_warn_func P_((OnigWarnFunc f));
ONIG_EXTERN
int onig_new P_((OnigRegex*, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, const OnigSyntaxType* syntax, OnigErrorInfo* einfo));
ONIG_EXTERN
-int onig_reg_init P_((regex_t* reg, OnigOptionType option, OnigCaseFoldType case_fold_flag, OnigEncoding enc, const OnigSyntaxType* syntax));
+int onig_reg_init P_((OnigRegex reg, OnigOptionType option, OnigCaseFoldType case_fold_flag, OnigEncoding enc, const OnigSyntaxType* syntax));
ONIG_EXTERN
int onig_new_without_alloc P_((OnigRegex, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));
ONIG_EXTERN
@@ -711,9 +741,11 @@ int onig_recompile P_((OnigRegex, const OnigUChar* pattern, const OnigUChar* pat
ONIG_EXTERN
int onig_recompile_deluxe P_((OnigRegex reg, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo));
ONIG_EXTERN
-long onig_search P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option));
+OnigPosition onig_search P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option));
+ONIG_EXTERN
+OnigPosition onig_search_gpos P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* global_pos, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option));
ONIG_EXTERN
-long onig_match P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* at, OnigRegion* region, OnigOptionType option));
+OnigPosition onig_match P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* at, OnigRegion* region, OnigOptionType option));
ONIG_EXTERN
OnigRegion* onig_region_new P_((void));
ONIG_EXTERN
@@ -743,7 +775,7 @@ int onig_number_of_capture_histories P_((OnigRegex reg));
ONIG_EXTERN
OnigCaptureTreeNode* onig_get_capture_tree P_((OnigRegion* region));
ONIG_EXTERN
-int onig_capture_tree_traverse P_((OnigRegion* region, int at, int(*callback_func)(int,int,int,int,int,void*), void* arg));
+int onig_capture_tree_traverse P_((OnigRegion* region, int at, int(*callback_func)(int,OnigPosition,OnigPosition,int,int,void*), void* arg));
ONIG_EXTERN
int onig_noname_group_capture_is_active P_((OnigRegex reg));
ONIG_EXTERN
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 340bea102a..56e78a18d4 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -36,6 +36,9 @@ extern "C" {
#ifndef NOINLINE
# define NOINLINE(x) x
#endif
+#ifndef UNREACHABLE
+# define UNREACHABLE /* unreachable */
+#endif
#ifdef __GNUC__
#define PRINTF_ARGS(decl, string_index, first_to_check) \
@@ -70,13 +73,26 @@ extern "C" {
#pragma GCC visibility push(default)
#endif
-#if defined(HAVE_ALLOCA_H)
-#include <alloca.h>
+/* Make alloca work the best possible way. */
+#ifdef __GNUC__
+# ifndef atarist
+# ifndef alloca
+# define alloca __builtin_alloca
+# endif
+# endif /* atarist */
#else
+# ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+# else
# ifdef _AIX
#pragma alloca
-# endif
-#endif
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+void *alloca();
+# endif
+# endif /* AIX */
+# endif /* HAVE_ALLOCA_H */
+#endif /* __GNUC__ */
#if defined HAVE_UINTPTR_T && 0
typedef uintptr_t VALUE;
@@ -98,7 +114,7 @@ typedef unsigned LONG_LONG ID;
# define SIZEOF_VALUE SIZEOF_LONG_LONG
# define PRI_VALUE_PREFIX PRI_LL_PREFIX
#else
-# error ---->> ruby requires sizeof(void*) == sizeof(long) to be compiled. <<----
+# error ---->> ruby requires sizeof(void*) == sizeof(long) or sizeof(LONG_LONG) to be compiled. <<----
#endif
typedef char ruby_check_sizeof_int[SIZEOF_INT == sizeof(int) ? 1 : -1];
@@ -117,18 +133,18 @@ typedef char ruby_check_sizeof_voidp[SIZEOF_VOIDP == sizeof(void*) ? 1 : -1];
#if defined PRIdPTR && !defined PRI_VALUE_PREFIX
#define PRIdVALUE PRIdPTR
-#define PRIiVALUE PRIiPTR
#define PRIoVALUE PRIoPTR
#define PRIuVALUE PRIuPTR
#define PRIxVALUE PRIxPTR
#define PRIXVALUE PRIXPTR
+#define PRIsVALUE PRIiPTR
#else
#define PRIdVALUE PRI_VALUE_PREFIX"d"
-#define PRIiVALUE PRI_VALUE_PREFIX"i"
#define PRIoVALUE PRI_VALUE_PREFIX"o"
#define PRIuVALUE PRI_VALUE_PREFIX"u"
#define PRIxVALUE PRI_VALUE_PREFIX"x"
#define PRIXVALUE PRI_VALUE_PREFIX"X"
+#define PRIsVALUE PRI_VALUE_PREFIX"i"
#endif
#ifndef PRI_VALUE_PREFIX
# define PRI_VALUE_PREFIX ""
@@ -258,6 +274,22 @@ VALUE rb_ull2inum(unsigned LONG_LONG);
# define SSIZET2NUM(v) INT2NUM(v)
#endif
+#ifndef SIZE_MAX
+# if SIZEOF_SIZE_T > SIZEOF_LONG && defined(HAVE_LONG_LONG)
+# define SIZE_MAX ULLONG_MAX
+# define SIZE_MIN ULLONG_MIN
+# elif SIZEOF_SIZE_T == SIZEOF_LONG
+# define SIZE_MAX ULONG_MAX
+# define SIZE_MIN ULONG_MIN
+# elif SIZEOF_SIZE_T == SIZEOF_INT
+# define SIZE_MAX UINT_MAX
+# define SIZE_MIN UINT_MIN
+# else
+# define SIZE_MAX USHRT_MAX
+# define SIZE_MIN USHRT_MIN
+# endif
+#endif
+
#ifndef SSIZE_MAX
# if SIZEOF_SIZE_T > SIZEOF_LONG && defined(HAVE_LONG_LONG)
# define SSIZE_MAX LLONG_MAX
@@ -279,15 +311,16 @@ NORETURN(void rb_out_of_int(SIGNED_VALUE num));
#endif
#if SIZEOF_INT < SIZEOF_LONG
-#define rb_long2int_internal(n, i) \
- int (i) = (int)(n); \
- if ((long)(i) != (n)) rb_out_of_int(n)
-#ifdef __GNUC__
-#define rb_long2int(n) __extension__ ({long i2l_n = (n); rb_long2int_internal(i2l_n, i2l_i); i2l_i;})
-#else
static inline int
-rb_long2int(long n) {rb_long2int_internal(n, i); return i;}
-#endif
+rb_long2int_inline(long n)
+{
+ int i = (int)n;
+ if ((long)i != n)
+ rb_out_of_int(n);
+
+ return i;
+}
+#define rb_long2int(n) rb_long2int_inline(n)
#else
#define rb_long2int(n) ((int)(n))
#endif
@@ -319,7 +352,7 @@ rb_long2int(long n) {rb_long2int_internal(n, i); return i;}
#define FIX2LONG(x) (long)RSHIFT((SIGNED_VALUE)(x),1)
#define FIX2ULONG(x) ((((VALUE)(x))>>1)&LONG_MAX)
-#define FIXNUM_P(f) (((SIGNED_VALUE)(f))&FIXNUM_FLAG)
+#define FIXNUM_P(f) (((int)(SIGNED_VALUE)(f))&FIXNUM_FLAG)
#define POSFIXABLE(f) ((f) < FIXNUM_MAX+1)
#define NEGFIXABLE(f) ((f) >= FIXNUM_MIN)
#define FIXABLE(f) (POSFIXABLE(f) && NEGFIXABLE(f))
@@ -330,11 +363,59 @@ rb_long2int(long n) {rb_long2int_internal(n, i); return i;}
#define ID2SYM(x) (((VALUE)(x)<<RUBY_SPECIAL_SHIFT)|SYMBOL_FLAG)
#define SYM2ID(x) RSHIFT((unsigned long)(x),RUBY_SPECIAL_SHIFT)
+#ifndef USE_FLONUM
+#if SIZEOF_VALUE >= SIZEOF_DOUBLE
+#define USE_FLONUM 1
+#else
+#define USE_FLONUM 0
+#endif
+#endif
+
+#if USE_FLONUM
+#define FLONUM_P(x) ((((int)(SIGNED_VALUE)(x))&FLONUM_MASK) == FLONUM_FLAG)
+#else
+#define FLONUM_P(x) 0
+#endif
+
/* Module#methods, #singleton_methods and so on return Symbols */
#define USE_SYMBOL_AS_METHOD_NAME 1
+/*
+!USE_FLONUM
+-------------------------
+...xxxx xxx1 Fixnum
+...0000 1110 Symbol
+...0000 0000 Qfalse
+...0000 0010 Qtrue
+...0000 0100 Qnil
+...0000 0110 Qundef
+
+USE_FLONUM
+-------------------------
+...xxxx xxx1 Fixnum
+...xxxx xx10 Flonum
+...0000 1100 Symbol
+...0000 0000 Qfalse 0x00 = 0
+...0000 1000 Qnil 0x08 = 8
+...0001 0100 Qtrue 0x14 = 20
+...0011 0100 Qundef 0x34 = 52
+ */
+
/* special constants - i.e. non-zero and non-fixnum constants */
enum ruby_special_consts {
+#if USE_FLONUM
+ RUBY_Qfalse = 0x00,
+ RUBY_Qtrue = 0x14,
+ RUBY_Qnil = 0x08,
+ RUBY_Qundef = 0x34,
+
+ RUBY_IMMEDIATE_MASK = 0x07,
+ RUBY_FIXNUM_FLAG = 0x01,
+ RUBY_FLONUM_MASK = 0x03,
+ RUBY_FLONUM_FLAG = 0x02,
+ RUBY_SYMBOL_FLAG = 0x0c,
+ RUBY_SPECIAL_SHIFT = 8
+#else
RUBY_Qfalse = 0,
RUBY_Qtrue = 2,
RUBY_Qnil = 4,
@@ -342,8 +423,11 @@ enum ruby_special_consts {
RUBY_IMMEDIATE_MASK = 0x03,
RUBY_FIXNUM_FLAG = 0x01,
+ RUBY_FLONUM_MASK = 0x00, /* any values ANDed with FLONUM_MASK cannot be FLONUM_FLAG */
+ RUBY_FLONUM_FLAG = 0x02,
RUBY_SYMBOL_FLAG = 0x0e,
RUBY_SPECIAL_SHIFT = 8
+#endif
};
#define Qfalse ((VALUE)RUBY_Qfalse)
@@ -352,6 +436,10 @@ enum ruby_special_consts {
#define Qundef ((VALUE)RUBY_Qundef) /* undefined value for placeholder */
#define IMMEDIATE_MASK RUBY_IMMEDIATE_MASK
#define FIXNUM_FLAG RUBY_FIXNUM_FLAG
+#if USE_FLONUM
+#define FLONUM_MASK RUBY_FLONUM_MASK
+#define FLONUM_FLAG RUBY_FLONUM_FLAG
+#endif
#define SYMBOL_FLAG RUBY_SYMBOL_FLAG
#define RTEST(v) (((VALUE)(v) & ~Qnil) != 0)
@@ -424,6 +512,8 @@ enum ruby_value_type {
static inline int rb_type(VALUE obj);
#define TYPE(x) rb_type((VALUE)(x))
+/* RB_GC_GUARD_PTR() is an intermediate macro, and has no effect by
+ * itself. don't use it directly */
#ifdef __GNUC__
#define RB_GC_GUARD_PTR(ptr) \
__extension__ ({volatile VALUE *rb_gc_guarded_ptr = (ptr); rb_gc_guarded_ptr;})
@@ -485,59 +575,80 @@ void rb_set_errinfo(VALUE);
SIGNED_VALUE rb_num2long(VALUE);
VALUE rb_num2ulong(VALUE);
-#define NUM2LONG_internal(x) ((long)(FIXNUM_P(x) ? FIX2LONG(x) : rb_num2long(x)))
-#ifdef __GNUC__
-#define NUM2LONG(x) \
- __extension__ ({VALUE num2long_x = (x); NUM2LONG_internal(num2long_x);})
-#else
static inline long
-NUM2LONG(VALUE x)
+rb_num2long_inline(VALUE x)
{
- return NUM2LONG_internal(x);
+ if (FIXNUM_P(x))
+ return FIX2LONG(x);
+ else
+ return (long)rb_num2long(x);
}
-#endif
-#define NUM2ULONG(x) rb_num2ulong((VALUE)(x))
+#define NUM2LONG(x) rb_num2long_inline(x)
+static inline unsigned long
+rb_num2ulong_inline(VALUE x)
+{
+ if (FIXNUM_P(x))
+ return (unsigned long)FIX2LONG(x);
+ else
+ return (unsigned long)rb_num2ulong(x);
+}
+#define NUM2ULONG(x) rb_num2ulong_inline(x)
#if SIZEOF_INT < SIZEOF_LONG
long rb_num2int(VALUE);
long rb_fix2int(VALUE);
#define FIX2INT(x) ((int)rb_fix2int((VALUE)(x)))
-#define NUM2INT_internal(x) (FIXNUM_P(x) ? FIX2INT(x) : (int)rb_num2int(x))
-#ifdef __GNUC__
-#define NUM2INT(x) \
- __extension__ ({VALUE num2int_x = (x); NUM2INT_internal(num2int_x);})
-#else
+
static inline int
-NUM2INT(VALUE x)
+rb_num2int_inline(VALUE x)
{
- return NUM2INT_internal(x);
+ if (FIXNUM_P(x))
+ return FIX2INT(x);
+ else
+ return (int)rb_num2int(x);
}
-#endif
+#define NUM2INT(x) rb_num2int_inline(x)
+
unsigned long rb_num2uint(VALUE);
#define NUM2UINT(x) ((unsigned int)rb_num2uint(x))
unsigned long rb_fix2uint(VALUE);
#define FIX2UINT(x) ((unsigned int)rb_fix2uint(x))
-#else
+#else /* SIZEOF_INT < SIZEOF_LONG */
#define NUM2INT(x) ((int)NUM2LONG(x))
#define NUM2UINT(x) ((unsigned int)NUM2ULONG(x))
#define FIX2INT(x) ((int)FIX2LONG(x))
#define FIX2UINT(x) ((unsigned int)FIX2ULONG(x))
-#endif
+#endif /* SIZEOF_INT < SIZEOF_LONG */
+
+short rb_num2short(VALUE);
+unsigned short rb_num2ushort(VALUE);
+short rb_fix2short(VALUE);
+unsigned short rb_fix2ushort(VALUE);
+#define FIX2SHORT(x) (rb_fix2short((VALUE)(x)))
+static inline short
+rb_num2short_inline(VALUE x)
+{
+ if (FIXNUM_P(x))
+ return FIX2SHORT(x);
+ else
+ return rb_num2short(x);
+}
+
+#define NUM2SHORT(x) rb_num2short_inline(x)
+#define NUM2USHORT(x) rb_num2ushort(x)
#ifdef HAVE_LONG_LONG
LONG_LONG rb_num2ll(VALUE);
unsigned LONG_LONG rb_num2ull(VALUE);
-# define NUM2LL_internal(x) (FIXNUM_P(x) ? FIX2LONG(x) : rb_num2ll(x))
-# ifdef __GNUC__
-# define NUM2LL(x) \
- __extension__ ({VALUE num2ll_x = (x); NUM2LL_internal(num2ll_x);})
-# else
static inline LONG_LONG
-NUM2LL(VALUE x)
+rb_num2ll_inline(VALUE x)
{
- return NUM2LL_internal(x);
+ if (FIXNUM_P(x))
+ return FIX2LONG(x);
+ else
+ return rb_num2ll(x);
}
-# endif
-# define NUM2ULL(x) rb_num2ull((VALUE)(x))
+# define NUM2LL(x) rb_num2ll_inline(x)
+# define NUM2ULL(x) rb_num2ull(x)
#endif
#if defined(HAVE_LONG_LONG) && SIZEOF_OFF_T > SIZEOF_LONG
@@ -548,7 +659,7 @@ NUM2LL(VALUE x)
#if defined(HAVE_LONG_LONG) && SIZEOF_SIZE_T > SIZEOF_LONG
# define NUM2SIZET(x) ((size_t)NUM2ULL(x))
-# define NUM2SSIZET(x) ((size_t)NUM2LL(x))
+# define NUM2SSIZET(x) ((ssize_t)NUM2LL(x))
#else
# define NUM2SIZET(x) NUM2ULONG(x)
# define NUM2SSIZET(x) NUM2LONG(x)
@@ -561,7 +672,9 @@ VALUE rb_uint2big(VALUE);
VALUE rb_int2big(SIGNED_VALUE);
VALUE rb_newobj(void);
+VALUE rb_newobj_of(VALUE, VALUE);
#define NEWOBJ(obj,type) type *(obj) = (type*)rb_newobj()
+#define NEWOBJ_OF(obj,type,klass,flags) type *(obj) = (type*)rb_newobj_of(klass, flags)
#define OBJSETUP(obj,c,t) do {\
RBASIC(obj)->flags = (t);\
RBASIC(obj)->klass = (c);\
@@ -622,12 +735,94 @@ struct RClass {
#define RMODULE_CONST_TBL(m) RCLASS_CONST_TBL(m)
#define RMODULE_M_TBL(m) RCLASS_M_TBL(m)
#define RMODULE_SUPER(m) RCLASS_SUPER(m)
+#define RMODULE_IS_OVERLAID FL_USER2
+#define RMODULE_IS_REFINEMENT FL_USER3
struct RFloat {
struct RBasic basic;
double float_value;
};
-#define RFLOAT_VALUE(v) (RFLOAT(v)->float_value)
+
+VALUE rb_float_new_in_heap(double);
+
+#if USE_FLONUM
+#define RUBY_BIT_ROTL(v, n) (((v) << (n)) | ((v) >> ((sizeof(v) * 8) - n)))
+#define RUBY_BIT_ROTR(v, n) (((v) >> (n)) | ((v) << ((sizeof(v) * 8) - n)))
+
+static inline double
+rb_float_value(VALUE v)
+{
+ if (FLONUM_P(v)) {
+ if (v != (VALUE)0x8000000000000002) { /* LIKELY */
+ union {
+ double d;
+ VALUE v;
+ } t;
+
+ VALUE b63 = (v >> 63);
+ /* e: xx1... -> 011... */
+ /* xx0... -> 100... */
+ /* ^b63 */
+ t.v = RUBY_BIT_ROTR((2 - b63) | (v & ~0x03), 3);
+ return t.d;
+ }
+ else {
+ return 0.0;
+ }
+ }
+ else {
+ return ((struct RFloat *)v)->float_value;
+ }
+}
+
+static inline VALUE
+rb_float_new(double d)
+{
+ union {
+ double d;
+ VALUE v;
+ } t;
+ int bits;
+
+ t.d = d;
+ bits = (int)((VALUE)(t.v >> 60) & 0x7);
+ /* bits contains 3 bits of b62..b60. */
+ /* bits - 3 = */
+ /* b011 -> b000 */
+ /* b100 -> b001 */
+
+ if (t.v != 0x3000000000000000 /* 1.72723e-77 */ &&
+ !((bits-3) & ~0x01)) {
+ return (RUBY_BIT_ROTL(t.v, 3) & ~(VALUE)0x01) | 0x02;
+ }
+ else {
+ if (t.v == (VALUE)0) {
+ /* +0.0 */
+ return 0x8000000000000002;
+ }
+ else {
+ /* out of range */
+ return rb_float_new_in_heap(d);
+ }
+ }
+}
+
+#else /* USE_FLONUM */
+
+static inline double
+rb_float_value(VALUE v)
+{
+ return ((struct RFloat *)v)->float_value;
+}
+
+static inline VALUE
+rb_float_new(double d)
+{
+ return rb_float_new_in_heap(d);
+}
+#endif
+
+#define RFLOAT_VALUE(v) rb_float_value(v)
#define DBL2NUM(dbl) rb_float_new(dbl)
#define ELTS_SHARED FL_USER2
@@ -903,8 +1098,8 @@ struct RBignum {
#define RCOMPLEX(obj) (R_CAST(RComplex)(obj))
#define FL_SINGLETON FL_USER0
-#define FL_MARK (((VALUE)1)<<5)
-#define FL_RESERVED (((VALUE)1)<<6) /* will be used in the future GC */
+#define FL_RESERVED1 (((VALUE)1)<<5)
+#define FL_RESERVED2 (((VALUE)1)<<6) /* will be used in the future GC */
#define FL_FINALIZE (((VALUE)1)<<7)
#define FL_TAINT (((VALUE)1)<<8)
#define FL_UNTRUSTED (((VALUE)1)<<9)
@@ -948,71 +1143,70 @@ struct RBignum {
#define OBJ_TAINT(x) FL_SET((x), FL_TAINT)
#define OBJ_UNTRUSTED(x) (!!FL_TEST((x), FL_UNTRUSTED))
#define OBJ_UNTRUST(x) FL_SET((x), FL_UNTRUSTED)
-#define OBJ_INFECT(x,s) do {if (FL_ABLE(x) && FL_ABLE(s)) RBASIC(x)->flags |= RBASIC(s)->flags & (FL_TAINT | FL_UNTRUSTED);} while (0)
+#define OBJ_INFECT(x,s) do { \
+ if (FL_ABLE(x) && FL_ABLE(s)) \
+ RBASIC(x)->flags |= RBASIC(s)->flags & \
+ (FL_TAINT | FL_UNTRUSTED); \
+} while (0)
-#define OBJ_FROZEN(x) (!!FL_TEST((x), FL_FREEZE))
+#define OBJ_FROZEN(x) (!!(FL_ABLE(x)?(RBASIC(x)->flags&(FL_FREEZE)):(FIXNUM_P(x)||FLONUM_P(x))))
#define OBJ_FREEZE(x) FL_SET((x), FL_FREEZE)
#if SIZEOF_INT < SIZEOF_LONG
# define INT2NUM(v) INT2FIX((int)(v))
# define UINT2NUM(v) LONG2FIX((unsigned int)(v))
#else
-# define INT2NUM_internal(v) (FIXABLE(v) ? INT2FIX(v) : rb_int2big(v))
-# ifdef __GNUC__
-# define INT2NUM(v) __extension__ ({int int2num_v = (v); INT2NUM_internal(int2num_v);})
-# else
static inline VALUE
-INT2NUM(int v)
+rb_int2num_inline(int v)
{
- return INT2NUM_internal(v);
+ if (FIXABLE(v))
+ return INT2FIX(v);
+ else
+ return rb_int2big(v);
}
-# endif
+#define INT2NUM(x) rb_int2num_inline(x)
-# define UINT2NUM_internal(v) (POSFIXABLE(v) ? LONG2FIX(v) : rb_uint2big(v))
-# ifdef __GNUC__
-# define UINT2NUM(v) __extension__ ({unsigned int uint2num_v = (v); UINT2NUM_internal(uint2num_v);})
-# else
static inline VALUE
-UINT2NUM(unsigned int v)
+rb_uint2num_inline(unsigned int v)
{
- return UINT2NUM_internal(v);
+ if (POSFIXABLE(v))
+ return LONG2FIX(v);
+ else
+ return rb_uint2big(v);
}
-# endif
+#define UINT2NUM(x) rb_uint2num_inline(x)
#endif
-#define LONG2NUM_internal(v) (FIXABLE(v) ? LONG2FIX(v) : rb_int2big(v))
-#ifdef __GNUC__
-# define LONG2NUM(v) __extension__ ({long long2num_v = (v); LONG2NUM_internal(long2num_v);})
-#else
static inline VALUE
-LONG2NUM(long v)
+rb_long2num_inline(long v)
{
- return LONG2NUM_internal(v);
+ if (FIXABLE(v))
+ return LONG2FIX(v);
+ else
+ return rb_int2big(v);
}
-#endif
+#define LONG2NUM(x) rb_long2num_inline(x)
-#define ULONG2NUM_internal(v) (POSFIXABLE(v) ? LONG2FIX(v) : rb_uint2big(v))
-#ifdef __GNUC__
-# define ULONG2NUM(v) __extension__ ({unsigned long ulong2num_v = (v); ULONG2NUM_internal(ulong2num_v);})
-#else
static inline VALUE
-ULONG2NUM(unsigned long v)
+rb_ulong2num_inline(unsigned long v)
{
- return ULONG2NUM_internal(v);
+ if (POSFIXABLE(v))
+ return LONG2FIX(v);
+ else
+ return rb_uint2big(v);
}
-#endif
+#define ULONG2NUM(x) rb_ulong2num_inline(x)
-#define NUM2CHR_internal(x) (((TYPE(x) == T_STRING)&&(RSTRING_LEN(x)>=1))?\
- RSTRING_PTR(x)[0]:(char)(NUM2INT(x)&0xff))
-#ifdef __GNUC__
-# define NUM2CHR(x) __extension__ ({VALUE num2chr_x = (x); NUM2CHR_internal(num2chr_x);})
-#else
static inline char
-NUM2CHR(VALUE x)
+rb_num2char_inline(VALUE x)
{
- return NUM2CHR_internal(x);
+ if ((TYPE(x) == T_STRING) && (RSTRING_LEN(x)>=1))
+ return RSTRING_PTR(x)[0];
+ else
+ return (char)(NUM2INT(x) & 0xff);
}
-#endif
+#define NUM2CHR(x) rb_num2char_inline(x)
+
#define CHR2FIX(x) INT2FIX((long)((x)&0xff))
#define ALLOC_N(type,n) ((type*)xmalloc2((n),sizeof(type)))
@@ -1052,6 +1246,7 @@ VALUE rb_define_module_under(VALUE, const char*);
void rb_include_module(VALUE,VALUE);
void rb_extend_object(VALUE,VALUE);
+void rb_prepend_module(VALUE,VALUE);
struct rb_global_variable;
@@ -1098,6 +1293,7 @@ ID rb_intern(const char*);
ID rb_intern2(const char*, long);
ID rb_intern_str(VALUE str);
const char *rb_id2name(ID);
+ID rb_check_id(volatile VALUE *);
ID rb_to_id(VALUE);
VALUE rb_id2str(ID);
@@ -1137,6 +1333,8 @@ VALUE rb_funcall(VALUE, ID, int, ...);
VALUE rb_funcall2(VALUE, ID, int, const VALUE*);
VALUE rb_funcall3(VALUE, ID, int, const VALUE*);
VALUE rb_funcall_passing_block(VALUE, ID, int, const VALUE*);
+VALUE rb_funcall_passing_block_with_refinements(VALUE, ID, int,
+ const VALUE*, VALUE);
int rb_scan_args(int, const VALUE*, const char*, ...);
VALUE rb_call_super(int, const VALUE*);
@@ -1157,13 +1355,19 @@ PRINTF_ARGS(NORETURN(void rb_fatal(const char*, ...)), 1, 2);
PRINTF_ARGS(NORETURN(void rb_bug(const char*, ...)), 1, 2);
NORETURN(void rb_bug_errno(const char*, int));
NORETURN(void rb_sys_fail(const char*));
+NORETURN(void rb_sys_fail_str(VALUE));
NORETURN(void rb_mod_sys_fail(VALUE, const char*));
+NORETURN(void rb_mod_sys_fail_str(VALUE, VALUE));
NORETURN(void rb_iter_break(void));
+NORETURN(void rb_iter_break_value(VALUE));
NORETURN(void rb_exit(int));
NORETURN(void rb_notimplement(void));
VALUE rb_syserr_new(int, const char *);
+VALUE rb_syserr_new_str(int n, VALUE arg);
NORETURN(void rb_syserr_fail(int, const char*));
+NORETURN(void rb_syserr_fail_str(int, VALUE));
NORETURN(void rb_mod_syserr_fail(VALUE, int, const char*));
+NORETURN(void rb_mod_syserr_fail_str(VALUE, int, VALUE));
/* reports if `-W' specified */
PRINTF_ARGS(void rb_warning(const char*, ...), 1, 2);
@@ -1194,21 +1398,6 @@ NORETURN(void rb_throw_obj(VALUE,VALUE));
VALUE rb_require(const char*);
-#ifdef __ia64
-void ruby_init_stack(volatile VALUE*, void*);
-#define ruby_init_stack(addr) ruby_init_stack((addr), rb_ia64_bsp())
-#else
-void ruby_init_stack(volatile VALUE*);
-#endif
-#define RUBY_INIT_STACK \
- VALUE variable_in_this_stack_frame; \
- ruby_init_stack(&variable_in_this_stack_frame);
-void ruby_init(void);
-void *ruby_options(int, char**);
-int ruby_run_node(void *);
-int ruby_exec_node(void *);
-int ruby_executable_node(void *n, int *status);
-
RUBY_EXTERN VALUE rb_mKernel;
RUBY_EXTERN VALUE rb_mComparable;
RUBY_EXTERN VALUE rb_mEnumerable;
@@ -1302,6 +1491,7 @@ rb_class_of(VALUE obj)
{
if (IMMEDIATE_P(obj)) {
if (FIXNUM_P(obj)) return rb_cFixnum;
+ if (FLONUM_P(obj)) return rb_cFloat;
if (obj == Qtrue) return rb_cTrueClass;
if (SYMBOL_P(obj)) return rb_cSymbol;
}
@@ -1317,17 +1507,20 @@ rb_type(VALUE obj)
{
if (IMMEDIATE_P(obj)) {
if (FIXNUM_P(obj)) return T_FIXNUM;
- if (obj == Qtrue) return T_TRUE;
+ if (FLONUM_P(obj)) return T_FLOAT;
+ if (obj == Qtrue) return T_TRUE;
if (SYMBOL_P(obj)) return T_SYMBOL;
if (obj == Qundef) return T_UNDEF;
}
else if (!RTEST(obj)) {
- if (obj == Qnil) return T_NIL;
+ if (obj == Qnil) return T_NIL;
if (obj == Qfalse) return T_FALSE;
}
return BUILTIN_TYPE(obj);
}
+#define RB_FLOAT_TYPE_P(obj) (FLONUM_P(obj) || (!SPECIAL_CONST_P(obj) && BUILTIN_TYPE(obj) == T_FLOAT))
+
#define RB_TYPE_P(obj, type) ( \
((type) == T_FIXNUM) ? FIXNUM_P(obj) : \
((type) == T_TRUE) ? ((obj) == Qtrue) : \
@@ -1335,6 +1528,7 @@ rb_type(VALUE obj)
((type) == T_NIL) ? ((obj) == Qnil) : \
((type) == T_UNDEF) ? ((obj) == Qundef) : \
((type) == T_SYMBOL) ? SYMBOL_P(obj) : \
+ ((type) == T_FLOAT) ? RB_FLOAT_TYPE_P(obj) : \
(!SPECIAL_CONST_P(obj) && BUILTIN_TYPE(obj) == (type)))
#ifdef __GNUC__
@@ -1365,14 +1559,6 @@ rb_special_const_p(VALUE obj)
static char *dln_libs_to_be_linked[] = { EXTLIB, 0 };
#endif
-#if (defined(__APPLE__) || defined(__NeXT__)) && defined(__MACH__)
-#define RUBY_GLOBAL_SETUP /* use linker option to link startup code with ObjC support */
-#else
-#define RUBY_GLOBAL_SETUP
-#endif
-
-void ruby_sysinit(int *, char ***);
-
#define RUBY_VM 1 /* YARV */
#define HAVE_NATIVETHREAD
int ruby_native_thread_p(void);
@@ -1386,24 +1572,23 @@ int ruby_native_thread_p(void);
#define RUBY_EVENT_C_CALL 0x0020
#define RUBY_EVENT_C_RETURN 0x0040
#define RUBY_EVENT_RAISE 0x0080
-#define RUBY_EVENT_ALL 0xffff
-#define RUBY_EVENT_VM 0x10000
+#define RUBY_EVENT_ALL 0x00ff
#define RUBY_EVENT_SWITCH 0x20000
#define RUBY_EVENT_COVERAGE 0x40000
-typedef unsigned int rb_event_flag_t;
-typedef void (*rb_event_hook_func_t)(rb_event_flag_t, VALUE data, VALUE, ID, VALUE klass);
+/* for TracePoint extended events */
+#define RUBY_EVENT_B_CALL 0x0100
+#define RUBY_EVENT_B_RETURN 0x0200
+#define RUBY_EVENT_THREAD_BEGIN 0x0400
+#define RUBY_EVENT_THREAD_END 0x0800
+#define RUBY_EVENT_SPECIFIED_LINE 0x8000
+#define RUBY_EVENT_TRACEPOINT_ALL 0xFFFF
-typedef struct rb_event_hook_struct {
- rb_event_flag_t flag;
- rb_event_hook_func_t func;
- VALUE data;
- struct rb_event_hook_struct *next;
-} rb_event_hook_t;
+typedef unsigned long rb_event_flag_t;
+typedef void (*rb_event_hook_func_t)(rb_event_flag_t evflag, VALUE data, VALUE self, ID mid, VALUE klass);
#define RB_EVENT_HOOKS_HAVE_CALLBACK_DATA 1
-void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events,
- VALUE data);
+void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data);
int rb_remove_event_hook(rb_event_hook_func_t func);
/* locale insensitive functions */
@@ -1452,14 +1637,80 @@ unsigned long ruby_strtoul(const char *str, char **endptr, int base);
PRINTF_ARGS(int ruby_snprintf(char *str, size_t n, char const *fmt, ...), 3, 4);
int ruby_vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility pop
-#endif
-
#ifndef RUBY_DONT_SUBST
#include "ruby/subst.h"
#endif
+/**
+ * @defgroup embed CRuby Embedding APIs
+ * CRuby interpreter APIs. These are APIs to embed MRI interpreter into your
+ * program.
+ * These functions are not a part of Ruby extention library API.
+ * Extension libraries of Ruby should not depend on these functions.
+ * @{
+ */
+
+/** @defgroup ruby1 ruby(1) implementation
+ * A part of the implementation of ruby(1) command.
+ * Other programs that embed Ruby interpreter do not always need to use these
+ * functions.
+ * @{
+ */
+
+void ruby_sysinit(int *argc, char ***argv);
+void ruby_init(void);
+void* ruby_options(int argc, char** argv);
+int ruby_executable_node(void *n, int *status);
+int ruby_run_node(void *n);
+
+/* version.c */
+void ruby_show_version(void);
+void ruby_show_copyright(void);
+
+
+/*! A convenience macro to call ruby_init_stack(). Must be placed just after
+ * variable declarations */
+#define RUBY_INIT_STACK \
+ VALUE variable_in_this_stack_frame; \
+ ruby_init_stack(&variable_in_this_stack_frame);
+/*! @} */
+
+#ifdef __ia64
+void ruby_init_stack(volatile VALUE*, void*);
+#define ruby_init_stack(addr) ruby_init_stack((addr), rb_ia64_bsp())
+#else
+void ruby_init_stack(volatile VALUE*);
+#endif
+#define Init_stack(addr) ruby_init_stack(addr)
+
+int ruby_setup(void);
+int ruby_cleanup(volatile int);
+
+void ruby_finalize(void);
+NORETURN(void ruby_stop(int));
+
+void ruby_set_stack_size(size_t);
+int ruby_stack_check(void);
+size_t ruby_stack_length(VALUE**);
+
+int ruby_exec_node(void *n);
+
+void ruby_script(const char* name);
+void ruby_set_script_name(VALUE name);
+
+void ruby_prog_init(void);
+void ruby_set_argv(int, char**);
+void *ruby_process_options(int, char**);
+void ruby_init_loadpath(void);
+void ruby_incpush(const char*);
+void ruby_sig_finalize(void);
+
+/*! @} */
+
+#if defined __GNUC__ && __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
#if defined(__cplusplus)
#if 0
{ /* satisfy cc-mode */
diff --git a/include/ruby/st.h b/include/ruby/st.h
index 50f2a75328..c2294a92c1 100644
--- a/include/ruby/st.h
+++ b/include/ruby/st.h
@@ -36,7 +36,7 @@ typedef unsigned long st_data_t;
#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP
typedef unsigned LONG_LONG st_data_t;
#else
-# error ---->> st.c requires sizeof(void*) == sizeof(long) to be compiled. <<----
+# error ---->> st.c requires sizeof(void*) == sizeof(long) or sizeof(LONG_LONG) to be compiled. <<----
#endif
#define ST_DATA_T_DEFINED
@@ -91,8 +91,16 @@ struct st_table {
__extension__
#endif
st_index_t num_entries : ST_INDEX_BITS - 1;
- struct st_table_entry **bins;
- struct st_table_entry *head, *tail;
+ union {
+ struct {
+ struct st_table_entry **bins;
+ struct st_table_entry *head, *tail;
+ } big;
+ struct {
+ struct st_packed_entry *entries;
+ st_index_t real_entries;
+ } packed;
+ } as;
};
#define st_is_member(table,key) st_lookup((table),(key),(st_data_t *)0)
@@ -113,7 +121,10 @@ int st_insert(st_table *, st_data_t, st_data_t);
int st_insert2(st_table *, st_data_t, st_data_t, st_data_t (*)(st_data_t));
int st_lookup(st_table *, st_data_t, st_data_t *);
int st_get_key(st_table *, st_data_t, st_data_t *);
+typedef int st_update_callback_func(st_data_t *key, st_data_t *value, st_data_t arg, int existing);
+int st_update(st_table *table, st_data_t key, st_update_callback_func *func, st_data_t arg);
int st_foreach(st_table *, int (*)(ANYARGS), st_data_t);
+int st_foreach_check(st_table *, int (*)(ANYARGS), st_data_t, st_data_t);
int st_reverse_foreach(st_table *, int (*)(ANYARGS), st_data_t);
void st_add_direct(st_table *, st_data_t, st_data_t);
void st_free_table(st_table *);
diff --git a/include/ruby/subst.h b/include/ruby/subst.h
index 6c01b25900..1f0e6db5a4 100644
--- a/include/ruby/subst.h
+++ b/include/ruby/subst.h
@@ -16,5 +16,4 @@
#undef close
#define close ruby_close
#endif
-
#endif
diff --git a/include/ruby/thread.h b/include/ruby/thread.h
new file mode 100644
index 0000000000..fb9057c70f
--- /dev/null
+++ b/include/ruby/thread.h
@@ -0,0 +1,49 @@
+/**********************************************************************
+
+ thread.h -
+
+ $Author: matz $
+ created at: Tue Jul 10 17:35:43 JST 2012
+
+ Copyright (C) 2007 Yukihiro Matsumoto
+
+**********************************************************************/
+
+#ifndef RUBY_THREAD_H
+#define RUBY_THREAD_H 1
+
+#if defined(__cplusplus)
+extern "C" {
+#if 0
+} /* satisfy cc-mode */
+#endif
+#endif
+
+#include "ruby/intern.h"
+
+#if defined __GNUC__ && __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+
+void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
+
+void *rb_thread_call_without_gvl(void *(*func)(void *), void *data1,
+ rb_unblock_function_t *ubf, void *data2);
+void *rb_thread_call_without_gvl2(void *(*func)(void *), void *data1,
+ rb_unblock_function_t *ubf, void *data2);
+
+#define RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_AFTER 0x01
+#define RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_
+
+#if defined __GNUC__ && __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
+
+#if defined(__cplusplus)
+#if 0
+{ /* satisfy cc-mode */
+#endif
+} /* extern "C" { */
+#endif
+
+#endif /* RUBY_THREAD_H */
diff --git a/include/ruby/util.h b/include/ruby/util.h
index 40f044d3cb..02aa643916 100644
--- a/include/ruby/util.h
+++ b/include/ruby/util.h
@@ -54,10 +54,6 @@ unsigned long ruby_scan_oct(const char *, size_t, size_t *);
#define scan_hex(s,l,e) ((int)ruby_scan_hex((s),(l),(e)))
unsigned long ruby_scan_hex(const char *, size_t, size_t *);
-#if defined(__CYGWIN32__) || defined(_WIN32)
-void ruby_add_suffix(VALUE str, const char *suffix);
-#endif
-
void ruby_qsort(void *, const size_t, const size_t,
int (*)(const void *, const void *, void *), void *);
@@ -66,7 +62,7 @@ void ruby_unsetenv(const char *);
#undef setenv
#undef unsetenv
#define setenv(name,val) ruby_setenv((name),(val))
-#define unsetenv(name,val) ruby_unsetenv(name);
+#define unsetenv(name,val) ruby_unsetenv(name)
char *ruby_strdup(const char *);
#undef strdup
diff --git a/include/ruby/version.h b/include/ruby/version.h
index 458efff320..b41b64fe66 100644
--- a/include/ruby/version.h
+++ b/include/ruby/version.h
@@ -30,9 +30,9 @@
#define RUBY_BIRTH_DAY 24
/* API version */
-#define RUBY_API_VERSION_MAJOR 1
-#define RUBY_API_VERSION_MINOR 9
-#define RUBY_API_VERSION_TEENY 1
+#define RUBY_API_VERSION_MAJOR 2
+#define RUBY_API_VERSION_MINOR 0
+#define RUBY_API_VERSION_TEENY 0
#define RUBY_API_VERSION_CODE (RUBY_API_VERSION_MAJOR*10000+RUBY_API_VERSION_MINOR*100+RUBY_API_VERSION_TEENY)
#ifdef RUBY_EXTERN
diff --git a/include/ruby/win32.h b/include/ruby/win32.h
index 4d8a66742f..9645cc888d 100644
--- a/include/ruby/win32.h
+++ b/include/ruby/win32.h
@@ -20,16 +20,16 @@ extern "C" {
*
*/
-//
-// Definitions for NT port of Perl
-//
+/*
+ * Definitions for NT port of Perl
+ */
-//
-// Ok now we can include the normal include files.
-//
+/*
+ * Ok now we can include the normal include files.
+ */
-// #include <stdarg.h> conflict with varargs.h?
+/* #include <stdarg.h> conflict with varargs.h? */
#if !defined(WSAAPI)
#if defined(__cplusplus) && defined(_MSC_VER)
extern "C++" { /* template without extern "C++" */
@@ -44,12 +44,10 @@ extern "C++" { /* template without extern "C++" */
#endif
#endif
-#define NT 1 /* deprecated */
-
-//
-// We're not using Microsoft's "extensions" to C for
-// Structured Exception Handling (SEH) so we can nuke these
-//
+/*
+ * We're not using Microsoft's "extensions" to C for
+ * Structured Exception Handling (SEH) so we can nuke these
+ */
#undef try
#undef except
#undef finally
@@ -105,14 +103,8 @@ typedef unsigned int uintptr_t;
# include <unistd.h>
#endif
-#ifdef WIN95
-extern DWORD rb_w32_osid(void);
-#define rb_w32_iswinnt() (rb_w32_osid() == VER_PLATFORM_WIN32_NT)
-#define rb_w32_iswin95() (rb_w32_osid() == VER_PLATFORM_WIN32_WINDOWS)
-#else
#define rb_w32_iswinnt() TRUE
#define rb_w32_iswin95() FALSE
-#endif
#define WNOHANG -1
@@ -126,6 +118,7 @@ extern DWORD rb_w32_osid(void);
#undef fputchar
#undef utime
#undef lseek
+#undef stat
#undef fstat
#define getc(_stream) rb_w32_getc(_stream)
#define getchar() rb_w32_getc(stdin)
@@ -149,6 +142,7 @@ extern DWORD rb_w32_osid(void);
#define getppid() rb_w32_getppid()
#define sleep(x) rb_w32_Sleep((x)*1000)
#define Sleep(msec) (void)rb_w32_Sleep(msec)
+#define fstati64(fd,st) rb_w32_fstati64(fd,st)
#ifdef __BORLANDC__
#define creat(p, m) _creat(p, m)
#define eof() _eof()
@@ -157,7 +151,6 @@ extern DWORD rb_w32_osid(void);
#define tell(h) _tell(h)
#define _open _sopen
#define sopen _sopen
-#define _fstati64(fd,st) rb_w32_fstati64(fd,st)
#undef fopen
#define fopen(p, m) rb_w32_fopen(p, m)
#undef fdopen
@@ -195,7 +188,6 @@ extern DWORD rb_w32_osid(void);
#else
#define stati64 _stat64
#define _stat64(path, st) rb_w32_stati64(path, st)
-#define _fstati64 _fstat64
#endif
#else
#define stat(path,st) rb_w32_stat(path,st)
@@ -230,11 +222,11 @@ struct msghdr {
int msg_flags;
};
-#define NtInitialize ruby_sysinit
+extern DWORD rb_w32_osid(void);
extern int rb_w32_cmdvector(const char *, char ***);
extern rb_pid_t rb_w32_pipe_exec(const char *, const char *, int, int *, int *);
extern int flock(int fd, int oper);
-extern int rb_w32_has_cancel_io(void);
+extern int rb_w32_io_cancelable_p(int);
extern int rb_w32_is_socket(int);
extern int WSAAPI rb_w32_accept(int, struct sockaddr *, int *);
extern int WSAAPI rb_w32_bind(int, const struct sockaddr *, int);
@@ -267,13 +259,14 @@ extern struct servent *WSAAPI rb_w32_getservbyname(const char *, const char *);
extern struct servent *WSAAPI rb_w32_getservbyport(int, const char *);
extern int rb_w32_socketpair(int, int, int, int *);
extern char * rb_w32_getcwd(char *, int);
+extern char * rb_w32_ugetenv(const char *);
extern char * rb_w32_getenv(const char *);
extern int rb_w32_rename(const char *, const char *);
extern int rb_w32_urename(const char *, const char *);
extern char **rb_w32_get_environ(void);
extern void rb_w32_free_environ(char **);
extern int rb_w32_map_errno(DWORD);
-extern char * WSAAPI rb_w32_inet_ntop(int,void *,char *,size_t);
+extern const char *WSAAPI rb_w32_inet_ntop(int,const void *,char *,size_t);
extern DWORD rb_w32_osver(void);
extern int chown(const char *, int, int);
@@ -284,6 +277,7 @@ extern int gettimeofday(struct timeval *, struct timezone *);
extern rb_pid_t waitpid (rb_pid_t, int *, int);
extern rb_pid_t rb_w32_spawn(int, const char *, const char*);
extern rb_pid_t rb_w32_aspawn(int, const char *, char *const *);
+extern rb_pid_t rb_w32_aspawn_flags(int, const char *, char *const *, DWORD);
extern int kill(int, int);
extern int fcntl(int, int, ...);
extern rb_pid_t rb_w32_getpid(void);
@@ -303,9 +297,10 @@ extern int rb_w32_stati64(const char *, struct stati64 *);
extern int rb_w32_ustati64(const char *, struct stati64 *);
extern int rb_w32_access(const char *, int);
extern int rb_w32_uaccess(const char *, int);
+extern char rb_w32_fd_is_text(int);
+extern int rb_w32_fstati64(int, struct stati64 *);
#ifdef __BORLANDC__
-extern int rb_w32_fstati64(int, struct stati64 *);
extern off_t _lseeki64(int, off_t, int);
extern FILE *rb_w32_fopen(const char *, const char *);
extern FILE *rb_w32_fdopen(int, const char *);
@@ -379,9 +374,9 @@ scalb(double a, long b)
#define S_IXOTH 0001
#endif
-//
-// define this so we can do inplace editing
-//
+/*
+ * define this so we can do inplace editing
+ */
#define SUFFIX
@@ -422,9 +417,9 @@ extern int rb_w32_fseeko(FILE *stream, off_t offset, int whence);
#define ftello rb_w32_ftello
#endif
-//
-// stubs
-//
+/*
+ * stubs
+ */
extern int ioctl (int, int, ...);
extern rb_uid_t getuid (void);
extern rb_uid_t geteuid (void);
@@ -569,11 +564,35 @@ extern char *rb_w32_strerror(int);
# define EREMOTE WSAEREMOTE
#endif
-#define F_SETFL 1
+#define F_DUPFD 0
+#if 0
+#define F_GETFD 1
+#define F_SETFD 2
+#define F_GETFL 3
+#endif
+#define F_SETFL 4
+#if 0
+#define FD_CLOEXEC 1 /* F_GETFD, F_SETFD */
+#endif
#define O_NONBLOCK 1
#undef FD_SET
-#define FD_SET(f, s) rb_w32_fdset(f, s)
+#define FD_SET(fd, set) do {\
+ unsigned int i;\
+ SOCKET s = _get_osfhandle(fd);\
+\
+ for (i = 0; i < (set)->fd_count; i++) {\
+ if ((set)->fd_array[i] == s) {\
+ break;\
+ }\
+ }\
+ if (i == (set)->fd_count) {\
+ if ((set)->fd_count < FD_SETSIZE) {\
+ (set)->fd_array[i] = s;\
+ (set)->fd_count++;\
+ }\
+ }\
+} while(0)
#undef FD_CLR
#define FD_CLR(f, s) rb_w32_fdclr(f, s)
@@ -682,8 +701,10 @@ struct tms {
int rb_w32_times(struct tms *);
+struct tm *gmtime_r(const time_t *, struct tm *);
+struct tm *localtime_r(const time_t *, struct tm *);
+
/* thread stuff */
-HANDLE GetCurrentThreadHandle(void);
int rb_w32_sleep(unsigned long msec);
int rb_w32_putc(int, FILE*);
int rb_w32_getc(FILE*);
@@ -701,6 +722,8 @@ long rb_w32_write_console(uintptr_t, int); /* use uintptr_t instead of VALUE bec
int WINAPI rb_w32_Sleep(unsigned long msec);
int rb_w32_wait_events_blocking(HANDLE *events, int num, DWORD timeout);
int rb_w32_time_subtract(struct timeval *rest, const struct timeval *wait);
+int rb_w32_wrap_io_handle(HANDLE, int);
+int rb_w32_unwrap_io_handle(int);
/*
== ***CAUTION***
@@ -717,6 +740,7 @@ uintptr_t rb_w32_asynchronize(asynchronous_func_t func, uintptr_t self, int argc
#endif
#ifdef __MINGW_ATTRIB_PURE
+/* License: Ruby's */
/* get rid of bugs in math.h of mingw */
#define frexp(_X, _Y) __extension__ ({\
int intpart_frexp_bug = intpart_frexp_bug;\
@@ -724,6 +748,7 @@ uintptr_t rb_w32_asynchronize(asynchronous_func_t func, uintptr_t self, int argc
*(_Y) = intpart_frexp_bug;\
result_frexp_bug;\
})
+/* License: Ruby's */
#define modf(_X, _Y) __extension__ ({\
double intpart_modf_bug = intpart_modf_bug;\
double result_modf_bug = modf((_X), &intpart_modf_bug);\
@@ -739,4 +764,36 @@ uintptr_t rb_w32_asynchronize(asynchronous_func_t func, uintptr_t self, int argc
} /* extern "C" { */
#endif
+#if defined(__MINGW64__)
+/*
+ * Use powl() instead of broken pow() of x86_64-w64-mingw32.
+ * This workaround will fix test failures in test_bignum.rb,
+ * test_fixnum.rb and test_float.rb etc.
+ */
+static inline double
+rb_w32_pow(double x, double y)
+{
+ return powl(x, y);
+}
+#elif defined(__MINGW64_VERSION_MAJOR)
+/*
+ * Set floating point precision for pow() of mingw-w64 x86.
+ * With default precision the result is not proper on WinXP.
+ */
+static inline double
+rb_w32_pow(double x, double y)
+{
+ double r;
+ unsigned int default_control = _controlfp(0, 0);
+ _controlfp(_PC_64, _MCW_PC);
+ r = pow(x, y);
+ /* Restore setting */
+ _controlfp(default_control, _MCW_PC);
+ return r;
+}
+#endif
+#if defined(__MINGW64_VERSION_MAJOR) || defined(__MINGW64__)
+#define pow rb_w32_pow
+#endif
+
#endif /* RUBY_WIN32_H */
diff --git a/inits.c b/inits.c
index 73b9eb4283..fe0aade090 100644
--- a/inits.c
+++ b/inits.c
@@ -60,5 +60,6 @@ rb_call_inits(void)
CALL(Rational);
CALL(Complex);
CALL(version);
+ CALL(vm_trace);
}
#undef CALL
diff --git a/insns.def b/insns.def
index a300189e1d..c4918961ce 100644
--- a/insns.def
+++ b/insns.def
@@ -1,4 +1,4 @@
-/** ##skip -*- mode:c; style:ruby; coding: shift_jis -*-
+/** ##skip -*- mode:c; style:ruby; coding: utf-8 -*-
insns.def - YARV instruction definitions
$Author: $
@@ -46,36 +46,50 @@ nop
/**
@c variable
- @e get local variable value (which is pointed by idx).
- @j idx Ŏw肳ꂽ[JϐX^bNɒuB
+ @e Get local variable (pointed by `idx' and `level').
+ 'level' indicates the nesting depth from the current block.
+ @j level, idx で指定されたローカル変数の値をスタックに置く。
+ level はブロックのネストレベルで、何段上かを示す。
*/
DEFINE_INSN
getlocal
-(lindex_t idx)
+(lindex_t idx, rb_num_t level)
()
(VALUE val)
{
- val = *(GET_LFP() - idx);
+ rb_num_t i;
+ VALUE *ep = GET_EP();
+ for (i = 0; i < level; i++) {
+ ep = GET_PREV_EP(ep);
+ }
+ val = *(ep - idx);
}
/**
@c variable
- @e set local variable value (which is pointed by idx) as val.
- @j idx Ŏw肳ꂽ[Jϐ val ɐݒ肷B
+ @e Set a local variable (pointed to by 'idx') as val.
+ 'level' indicates the nesting depth from the current block.
+ @j level, idx で指定されたローカル変数の値を val にする。
+ level はブロックのネストレベルで、何段上かを示す。
*/
DEFINE_INSN
setlocal
-(lindex_t idx)
+(lindex_t idx, rb_num_t level)
(VALUE val)
()
{
- (*(GET_LFP() - idx)) = val;
+ rb_num_t i;
+ VALUE *ep = GET_EP();
+ for (i = 0; i < level; i++) {
+ ep = GET_PREV_EP(ep);
+ }
+ *(ep - idx) = val;
}
/**
@c variable
- @e get special local variable ($~, $_, ..) value.
- @j ȃ[Jϐi$~, $_, ...j̒l𓾂B
+ @e Get value of special local variable ($~, $_, ..).
+ @j 特殊なローカル変数($~, $_, ...)の値を得る。
*/
DEFINE_INSN
getspecial
@@ -83,13 +97,13 @@ getspecial
()
(VALUE val)
{
- val = vm_getspecial(th, GET_LFP(), key, type);
+ val = vm_getspecial(th, GET_LEP(), key, type);
}
/**
@c variable
- @e set special local variable ($~, $_, ...) value as obj.
- @j ʂȃ[Jϐi$~, $_, ...j̒lݒ肷B
+ @e Set value of special local variable ($~, $_, ...) to obj.
+ @j 特別なローカル変数($~, $_, ...)の値を設定する。
*/
DEFINE_INSN
setspecial
@@ -97,56 +111,14 @@ setspecial
(VALUE obj)
()
{
- lfp_svar_set(th, GET_LFP(), key, obj);
+ lep_svar_set(th, GET_LEP(), key, obj);
}
/**
@c variable
- @e get block local variable(which is pointed by idx and level).
- level means nest level of block, and specify how above this variable.
- @j level, idx Ŏw肳ꂽubN[Jϐ̒lX^bNɒuB
- level ̓ubÑlXgxŁAiォB
- */
-DEFINE_INSN
-getdynamic
-(dindex_t idx, rb_num_t level)
-()
-(VALUE val)
-{
- rb_num_t i;
- VALUE *dfp2 = GET_DFP();
- for (i = 0; i < level; i++) {
- dfp2 = GET_PREV_DFP(dfp2);
- }
- val = *(dfp2 - idx);
-}
-
-/**
- @c variable
- @e set block local variable(which is pointed by 'idx') as val.
- level means nest level of block, and specify how above this variable.
- @j level, idx Ŏw肳ꂽubN[Jϐ̒l val ɂB
- level ̓ubÑlXgxŁAiォB
- */
-DEFINE_INSN
-setdynamic
-(dindex_t idx, rb_num_t level)
-(VALUE val)
-()
-{
- rb_num_t i;
- VALUE *dfp2 = GET_DFP();
- for (i = 0; i < level; i++) {
- dfp2 = GET_PREV_DFP(dfp2);
- }
- *(dfp2 - idx) = val;
-}
-
-/**
- @c variable
- @e get instance variable id of obj.
- if is_local is not 0, search as class local variable.
- @j self ̃CX^Xϐ id ̒l𓾂B
+ @e Get value of instance variable id of self.
+ If is_local is not 0, get value of class local variable.
+ @j self のインスタンス変数 id の値を得る。
*/
DEFINE_INSN
getinstancevariable
@@ -154,14 +126,14 @@ getinstancevariable
()
(VALUE val)
{
- val = vm_getivar(GET_SELF(), id, ic);
+ val = vm_getinstancevariable(GET_SELF(), id, ic);
}
/**
@c variable
- @e set instance variable id of obj as val.
- if is_local is not 0, search as class local variable.
- @j self ̃CX^Xϐ id val ɂB
+ @e Set value of instance variable id of self to val.
+ If is_local is not 0, set value of class local variable.
+ @j self のインスタンス変数 id を val にする。
*/
DEFINE_INSN
setinstancevariable
@@ -169,13 +141,13 @@ setinstancevariable
(VALUE val)
()
{
- vm_setivar(GET_SELF(), id, val, ic);
+ vm_setinstancevariable(GET_SELF(), id, val, ic);
}
/**
@c variable
- @e get class variable id of klass as val.
- @j ݂̃XR[ṽNXϐ id ̒l𓾂B
+ @e Get value of class variable id of klass as val.
+ @j 現在のスコープのクラス変数 id の値を得る。
*/
DEFINE_INSN
getclassvariable
@@ -183,14 +155,14 @@ getclassvariable
()
(VALUE val)
{
- NODE * const cref = vm_get_cref(GET_ISEQ(), GET_LFP(), GET_DFP());
- val = rb_cvar_get(vm_get_cvar_base(cref), id);
+ NODE *cref = rb_vm_get_cref(GET_ISEQ(), GET_EP());
+ val = rb_cvar_get(vm_get_cvar_base(cref, GET_CFP()), id);
}
/**
@c variable
- @e set class variable id of klass as val.
- @j klass ̃NXϐ id val ɂB
+ @e Set value of class variable id of klass as val.
+ @j klass のクラス変数 id を val にする。
*/
DEFINE_INSN
setclassvariable
@@ -198,21 +170,21 @@ setclassvariable
(VALUE val)
()
{
- NODE * const cref = vm_get_cref(GET_ISEQ(), GET_LFP(), GET_DFP());
- rb_cvar_set(vm_get_cvar_base(cref), id, val);
+ NODE *cref = rb_vm_get_cref(GET_ISEQ(), GET_EP());
+ rb_cvar_set(vm_get_cvar_base(cref, GET_CFP()), id, val);
}
/**
@c variable
@e
- get constant variable id. if klass is Qnil, constant
- are searched in current scope. if klass is Qfalse, constant as
- top level constant. otherwise, get constant under klass
+ Get constant variable id. If klass is Qnil, constants
+ are searched in the current scope. If klass is Qfalse, constants
+ are searched as top level constants. Otherwise, get constant under klass
class or module.
- @j 萔 id ̒l𓾂B
- klass Qnil ȂÃXR[vœ萔̒l𓾂B
- Qfalse ȂAgbvxXR[v𓾂B
- ȊOȂAklass NX̉̒萔𓾂B
+ @j 定数 id の値を得る。
+ klass が Qnil なら、そのスコープで得られる定数の値を得る。
+ Qfalse なら、トップレベルスコープを得る。
+ それ以外なら、klass クラスの下の定数を得る。
*/
DEFINE_INSN
getconstant
@@ -226,15 +198,15 @@ getconstant
/**
@c variable
@e
- set constant variable id. if klass is Qfalse, constant
+ Set constant variable id. If klass is Qfalse, constant
is able to access in this scope. if klass is Qnil, set
top level constant. otherwise, set constant under klass
class or module.
- @j 萔 id ̒l val ɂB
- klass Qfalse ȂÃXR[vœ萔 id ̒lݒ肷B
- Qnil ȂAgbvxXR[v̒lݒ肷B
- ȊOȂAklass NX̉̒萔ݒ肷B
+ @j 定数 id の値を val にする。
+ klass が Qfalse なら、そのスコープで得られる定数 id の値を設定する。
+ Qnil なら、トップレベルスコープの値を設定する。
+ それ以外なら、klass クラスの下の定数を設定する。
*/
DEFINE_INSN
setconstant
@@ -250,7 +222,7 @@ setconstant
/**
@c variable
@e get global variable id.
- @j O[oϐ id ̒l𓾂B
+ @j グローバル変数 id の値を得る。
*/
DEFINE_INSN
getglobal
@@ -264,7 +236,7 @@ getglobal
/**
@c variable
@e set global variable id as val.
- @j O[oϐ id ̒lݒ肷B
+ @j グローバル変数 id の値を設定する。
*/
DEFINE_INSN
setglobal
@@ -283,7 +255,7 @@ setglobal
/**
@c put
@e put nil to stack.
- @j X^bN nil vbVB
+ @j スタックに nil をプッシュする。
*/
DEFINE_INSN
putnil
@@ -297,7 +269,7 @@ putnil
/**
@c put
@e put self.
- @j X^bN self vbVB
+ @j スタックに self をプッシュする。
*/
DEFINE_INSN
putself
@@ -312,7 +284,7 @@ putself
@c put
@e put some object.
i.e. Fixnum, true, false, nil, and so on.
- @j IuWFNg val X^bNɃvbVB
+ @j オブジェクト val をスタックにプッシュする。
i.e. Fixnum, true, false, nil, and so on.
*/
DEFINE_INSN
@@ -327,8 +299,8 @@ putobject
/**
@c put
@e put special object. "value_type" is for expansion.
- @j ʂȃIuWFNg val X^bNɃvbVB
- IuWFNg̎ނ value_type ɂD
+ @j 特別なオブジェクト val をスタックにプッシュする。
+ オブジェクトの種類は value_type による.
*/
DEFINE_INSN
putspecialobject
@@ -343,10 +315,10 @@ putspecialobject
val = rb_mRubyVMFrozenCore;
break;
case VM_SPECIAL_OBJECT_CBASE:
- val = vm_get_cbase(GET_ISEQ(), GET_LFP(), GET_DFP());
+ val = vm_get_cbase(GET_ISEQ(), GET_EP());
break;
case VM_SPECIAL_OBJECT_CONST_BASE:
- val = vm_get_const_base(GET_ISEQ(), GET_LFP(), GET_DFP());
+ val = vm_get_const_base(GET_ISEQ(), GET_EP());
break;
default:
rb_bug("putspecialobject insn: unknown value_type");
@@ -370,7 +342,7 @@ putiseq
/**
@c put
@e put string val. string will be copied.
- @j Rs[ăX^bNɃvbVB
+ @j 文字列をコピーしてスタックにプッシュする。
*/
DEFINE_INSN
putstring
@@ -384,7 +356,7 @@ putstring
/**
@c put
@e put concatenate strings
- @j X^bNgbv̕ n ˜ACʂX^bNɃvbVB
+ @j スタックトップの文字列を n 個連結し,結果をスタックにプッシュする。
*/
DEFINE_INSN
concatstrings
@@ -392,9 +364,9 @@ concatstrings
(...)
(VALUE val) // inc += 1 - num;
{
- rb_num_t i = num;
+ rb_num_t i = num - 1;
- val = rb_str_new(0, 0);
+ val = rb_str_resurrect(TOPN(i));
while (i-- > 0) {
const VALUE v = TOPN(i);
rb_str_append(val, v);
@@ -405,7 +377,7 @@ concatstrings
/**
@c put
@e to_str
- @j to_str ̌ʂX^bNɃvbVB
+ @j to_str の結果をスタックにプッシュする。
*/
DEFINE_INSN
tostring
@@ -419,8 +391,8 @@ tostring
/**
@c put
@e to Regexp
- @j str 𐳋K\ɃRpCăX^bNɃvbVB
- RpCCopt 𐳋K\̃IvVƂB
+ @j 文字列 str を正規表現にコンパイルしてスタックにプッシュする。
+ コンパイル時,opt を正規表現のオプションとする。
*/
DEFINE_INSN
toregexp
@@ -442,7 +414,7 @@ toregexp
/**
@c put
@e put new array.
- @j VzX^bN num ‚̒lŏĐvbVB
+ @j 新しい配列をスタック上の num 個の値で初期化して生成しプッシュする。
*/
DEFINE_INSN
newarray
@@ -457,7 +429,7 @@ newarray
/**
@c put
@e dup array
- @j z ary dup ăX^bNɃvbVB
+ @j 配列 ary を dup してスタックにプッシュする。
*/
DEFINE_INSN
duparray
@@ -471,13 +443,13 @@ duparray
/**
@c put
@e expand array to num objects.
- @j X^bNgbṽIuWFNgzł΁AWJB
- zIuWFNg̗vf numȉȂ΁A nil ςށBnumȏȂA
- numȏ̗vf͐؂̂ĂB
- zIuWFNgłȂ΁Anum - 1 ‚ nil ςށB
- flag ^ȂAcvf̔zς
- flag: 0x01 - Ōz
- flag: 0x02 - postarg p
+ @j スタックトップのオブジェクトが配列であれば、それを展開する。
+ 配列オブジェクトの要素数が num以下ならば、代わりに nil を積む。num以上なら、
+ num以上の要素は切り捨てる。
+ 配列オブジェクトでなければ、num - 1 個の nil を積む。
+ もし flag が真なら、残り要素の配列を積む
+ flag: 0x01 - 最後を配列に
+ flag: 0x02 - postarg 用
flag: 0x04 - reverse?
*/
DEFINE_INSN
@@ -492,7 +464,7 @@ expandarray
/**
@c put
@e concat two arrays
- @j ‚̔z ary1, ary2 AX^bNփvbVB
+ @j 二つの配列 ary1, ary2 を連結しスタックへプッシュする。
*/
DEFINE_INSN
concatarray
@@ -521,7 +493,7 @@ concatarray
/**
@c put
@e splat array
- @j z ary ɑ΂ to_a ĂяoB
+ @j 配列 ary に対して to_a を呼び出す。
*/
DEFINE_INSN
splatarray
@@ -533,54 +505,17 @@ splatarray
if (NIL_P(tmp)) {
tmp = rb_ary_new3(1, ary);
}
- obj = tmp;
-}
-
-/**
- @c put
- @e check value is included in ary
- @j z ary ɗvf obj Ă邩ǂ`FbNBcase/when ŗpB
- */
-DEFINE_INSN
-checkincludearray
-(VALUE flag)
-(VALUE obj, VALUE ary)
-(VALUE obj, VALUE result)
-{
- int i;
- result = Qfalse;
-
- if (TYPE(ary) != T_ARRAY) {
- ary = rb_Array(ary);
- }
-
- if (flag == Qtrue) {
- /* NODE_CASE */
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- /* TODO: fix me (use another method dispatch) */
- if (RTEST(rb_funcall2(RARRAY_PTR(ary)[i], idEqq, 1, &obj))) {
- result = Qtrue;
- break;
- }
- }
- }
- else {
- obj = Qfalse;
- /* NODE_WHEN */
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- if (RTEST(RARRAY_PTR(ary)[i])) {
- obj = result = Qtrue;
- break;
- }
- }
+ else if (RTEST(flag)) {
+ tmp = rb_ary_dup(tmp);
}
+ obj = tmp;
}
/**
@c put
@e put new Hash.
- @j VnbVX^bNgbv n ‚lƂĐB
- n ̓L[ƒl̃yAȂ̂ 2 ̔{łȂ΂ȂȂB
+ @j 新しいハッシュをスタックトップの n 個を初期値として生成する。
+ n はキーと値のペアなので 2 の倍数でなければならない。
*/
DEFINE_INSN
newhash
@@ -589,6 +524,11 @@ newhash
(VALUE val) // inc += 1 - num;
{
rb_num_t i;
+
+ if(RUBY_DTRACE_HASH_CREATE_ENABLED()) {
+ RUBY_DTRACE_HASH_CREATE(num, rb_sourcefile(), rb_sourceline());
+ }
+
val = rb_hash_new();
for (i = num; i > 0; i -= 2) {
@@ -602,7 +542,7 @@ newhash
/**
@c put
@e put new Range object.(Range.new(low, high, flag))
- @j Range.new(low, high, flag) ̂悤ȃIuWFNg𐶐X^bNɃvbVB
+ @j Range.new(low, high, flag) のようなオブジェクトを生成しスタックにプッシュする。
*/
DEFINE_INSN
newrange
@@ -620,7 +560,7 @@ newrange
/**
@c stack
@e pop from stack.
- @j X^bNƒ|bvB
+ @j スタックから一つポップする。
*/
DEFINE_INSN
pop
@@ -628,14 +568,14 @@ pop
(VALUE val)
()
{
- val = val;
+ (void)val;
/* none */
}
/**
@c stack
@e duplicate stack top.
- @j X^bNgbvRs[ăX^bNɃvbVB
+ @j スタックトップをコピーしてスタックにプッシュする。
*/
DEFINE_INSN
dup
@@ -649,7 +589,7 @@ dup
/**
@c stack
@e duplicate stack top n elements
- @j X^bNgbv n ‚Rs[ăX^bNɃvbVB
+ @j スタックトップの n 個をコピーしてスタックにプッシュする。
*/
DEFINE_INSN
dupn
@@ -669,7 +609,7 @@ dupn
/**
@c stack
@e swap top 2 vals
- @j X^bNgbv 2 ‚̒lB
+ @j スタックトップの 2 つの値を交換する。
*/
DEFINE_INSN
swap
@@ -683,7 +623,7 @@ swap
/**
@c stack
@e for stack caching.
- @j X^bNLbVȌԂ𒲐邽߂ɕKvȖ߁B
+ @j スタックキャッシングの状態を調整するために必要な命令。
*/
DEFINE_INSN
reput
@@ -697,7 +637,7 @@ reput
/**
@c stack
@e get nth stack value from stack top
- @j X^bNgbv n –ڂX^bNɃvbVB
+ @j スタックトップから n 個目をスタックにプッシュする。
*/
DEFINE_INSN
topn
@@ -711,7 +651,7 @@ topn
/**
@c stack
@e set Nth stack entry to stack top
- @j X^bNgbv̒l n –ڂ̃X^bNɃRs[
+ @j スタックトップの値を n 個目のスタックにコピー
*/
DEFINE_INSN
setn
@@ -725,7 +665,7 @@ setn
/**
@c stack
@e empt current stack
- @j current stack ɂB
+ @j current stack を空にする。
*/
DEFINE_INSN
adjuststack
@@ -744,7 +684,7 @@ adjuststack
/**
@c setting
@e defined?
- @j defined? sB
+ @j defined? を行う。
*/
DEFINE_INSN
defined
@@ -753,7 +693,7 @@ defined
(VALUE val)
{
VALUE klass;
- const char *expr_type = 0;
+ enum defined_type expr_type = 0;
enum defined_type type = (enum defined_type)op_type;
val = Qnil;
@@ -761,45 +701,48 @@ defined
switch (type) {
case DEFINED_IVAR:
if (rb_ivar_defined(GET_SELF(), SYM2ID(obj))) {
- expr_type = "instance-variable";
+ expr_type = DEFINED_IVAR;
}
break;
case DEFINED_IVAR2:
- klass = vm_get_cbase(GET_ISEQ(), GET_LFP(), GET_DFP());
+ klass = vm_get_cbase(GET_ISEQ(), GET_EP());
break;
case DEFINED_GVAR:
if (rb_gvar_defined(rb_global_entry(SYM2ID(obj)))) {
- expr_type = "global-variable";
+ expr_type = DEFINED_GVAR;
}
break;
case DEFINED_CVAR:
- klass = vm_get_cbase(GET_ISEQ(), GET_LFP(), GET_DFP());
+ {
+ NODE *cref = rb_vm_get_cref(GET_ISEQ(), GET_EP());
+ klass = vm_get_cvar_base(cref, GET_CFP());
if (rb_cvar_defined(klass, SYM2ID(obj))) {
- expr_type = "class variable";
+ expr_type = DEFINED_CVAR;
}
break;
+ }
case DEFINED_CONST:
klass = v;
if (vm_get_ev_const(th, GET_ISEQ(), klass, SYM2ID(obj), 1)) {
- expr_type = "constant";
+ expr_type = DEFINED_CONST;
}
break;
case DEFINED_FUNC:
klass = CLASS_OF(v);
if (rb_method_boundp(klass, SYM2ID(obj), 0)) {
- expr_type = "method";
+ expr_type = DEFINED_METHOD;
}
break;
case DEFINED_METHOD:{
VALUE klass = CLASS_OF(v);
- const rb_method_entry_t *me = rb_method_entry(klass, SYM2ID(obj));
+ const rb_method_entry_t *me = rb_method_entry(klass, SYM2ID(obj), 0);
if (me) {
if (!(me->flag & NOEX_PRIVATE)) {
if (!((me->flag & NOEX_PROTECTED) &&
!rb_obj_is_kind_of(GET_SELF(),
rb_class_real(klass)))) {
- expr_type = "method";
+ expr_type = DEFINED_METHOD;
}
}
}
@@ -809,36 +752,31 @@ defined
args[0] = obj; args[1] = Qfalse;
r = rb_check_funcall(v, rb_intern("respond_to_missing?"), 2, args);
- if (r != Qundef && RTEST(r))
- expr_type = "method";
+ if (r != Qundef && RTEST(r))
+ expr_type = DEFINED_METHOD;
}
break;
}
case DEFINED_YIELD:
if (GET_BLOCK_PTR()) {
- expr_type = "yield";
+ expr_type = DEFINED_YIELD;
}
break;
case DEFINED_ZSUPER:{
- rb_iseq_t *iseq = GET_ISEQ();
- while (iseq) {
- if (iseq->defined_method_id) {
- break;
- }
- iseq = iseq->parent_iseq;
- }
- if (iseq) {
- VALUE klass = vm_search_normal_superclass(iseq->klass, GET_SELF());
- if (rb_method_boundp(klass, iseq->defined_method_id, 0)) {
- expr_type = "super";
+ const rb_method_entry_t *me = GET_CFP()->me;
+ if (me) {
+ VALUE klass = vm_search_normal_superclass(GET_CFP()->klass);
+ ID id = me->def ? me->def->original_id : me->called_id;
+ if (rb_method_boundp(klass, id, 0)) {
+ expr_type = DEFINED_ZSUPER;
}
}
break;
}
case DEFINED_REF:{
- val = vm_getspecial(th, GET_LFP(), Qfalse, FIX2INT(obj));
+ val = vm_getspecial(th, GET_LEP(), Qfalse, FIX2INT(obj));
if (val != Qnil) {
- expr_type = "global-variable";
+ expr_type = DEFINED_GVAR;
}
break;
}
@@ -848,7 +786,7 @@ defined
}
if (expr_type != 0) {
if (needstr != Qfalse) {
- val = rb_str_new2(expr_type);
+ val = rb_iseq_defined_string(expr_type);
}
else {
val = Qtrue;
@@ -858,8 +796,44 @@ defined
/**
@c setting
+ @e check `target' matches `pattern'.
+ `flag & VM_CHECKMATCH_TYPE_MASK' describe how to check pattern.
+ VM_CHECKMATCH_TYPE_WHEN: ignore target and check pattern is truthy.
+ VM_CHECKMATCH_TYPE_CASE: check `patten === target'.
+ VM_CHECKMATCH_TYPE_RESCUE: check `pattern.kind_op?(Module) && pattern == target'.
+ if `flag & VM_CHECKMATCH_ARRAY' is not 0, then `patten' is array of patterns.
+ @j see above comments.
+ */
+DEFINE_INSN
+checkmatch
+(rb_num_t flag)
+(VALUE target, VALUE pattern)
+(VALUE result)
+{
+ enum vm_check_match_type checkmatch_type =
+ (enum vm_check_match_type)(flag & VM_CHECKMATCH_TYPE_MASK);
+ result = Qfalse;
+
+ if (flag & VM_CHECKMATCH_ARRAY) {
+ int i;
+ for (i = 0; i < RARRAY_LEN(pattern); i++) {
+ if (RTEST(check_match(RARRAY_PTR(pattern)[i], target, checkmatch_type))) {
+ result = Qtrue;
+ break;
+ }
+ }
+ }
+ else {
+ if (RTEST(check_match(pattern, target, checkmatch_type))) {
+ result = Qtrue;
+ }
+ }
+}
+
+/**
+ @c setting
@e trace
- @j trace p̖߁B
+ @j trace 用の命令。
*/
DEFINE_INSN
trace
@@ -869,7 +843,29 @@ trace
{
rb_event_flag_t flag = (rb_event_flag_t)nf;
- EXEC_EVENT_HOOK(th, flag, GET_SELF(), 0, 0 /* TODO: id, klass */);
+ if (RUBY_DTRACE_METHOD_ENTRY_ENABLED() ||
+ RUBY_DTRACE_METHOD_RETURN_ENABLED() ||
+ RUBY_DTRACE_CMETHOD_ENTRY_ENABLED() ||
+ RUBY_DTRACE_CMETHOD_RETURN_ENABLED()) {
+
+ switch(flag) {
+ case RUBY_EVENT_CALL:
+ RUBY_DTRACE_METHOD_ENTRY_HOOK(th, 0, 0);
+ break;
+ case RUBY_EVENT_C_CALL:
+ RUBY_DTRACE_CMETHOD_ENTRY_HOOK(th, 0, 0);
+ break;
+ case RUBY_EVENT_RETURN:
+ RUBY_DTRACE_METHOD_RETURN_HOOK(th, 0, 0);
+ break;
+ case RUBY_EVENT_C_RETURN:
+ RUBY_DTRACE_CMETHOD_RETURN_HOOK(th, 0, 0);
+ break;
+ }
+ }
+
+ EXEC_EVENT_HOOK(th, flag, GET_SELF(), 0, 0 /* id and klass are resolved at callee */,
+ (flag & RUBY_EVENT_RETURN | RUBY_EVENT_B_RETURN) ? TOPN(0) : Qundef);
}
/**********************************************************/
@@ -881,9 +877,9 @@ trace
@e
enter class definition scope. if super is Qfalse, and clsas
"klass" is defined, it's redefine. otherwise, define "klass" class.
- @j NX`XR[vֈڍsB
- super Qfalse klassNX`Ă΍Ē`łB
- łȂ΁Aklass NX`B
+ @j クラス定義スコープへ移行する。
+ もし super が Qfalse で klassクラスが定義されていれば再定義である。
+ そうでなければ、klass クラスを定義する。
*/
DEFINE_INSN
defineclass
@@ -906,10 +902,10 @@ defineclass
/* find klass */
rb_autoload_load(cbase, id);
- if (rb_const_defined_at(cbase, id)) {
+ if ((klass = vm_search_const_defined_class(cbase, id)) != 0) {
/* already exist */
- klass = define_type == 0 ? rb_public_const_get(cbase, id) : rb_const_get_at(cbase, id);
- if (TYPE(klass) != T_CLASS) {
+ klass = define_type == 0 ? rb_public_const_get_at(klass, id) : rb_const_get_at(klass, id);
+ if (!RB_TYPE_P(klass, T_CLASS)) {
rb_raise(rb_eTypeError, "%s is not a class", rb_id2name(id));
}
@@ -944,10 +940,10 @@ defineclass
vm_check_if_namespace(cbase);
/* find klass */
- if (rb_const_defined_at(cbase, id)) {
- klass = define_type == 2 ? rb_public_const_get(cbase, id) : rb_const_get_at(cbase, id);
+ if ((klass = vm_search_const_defined_class(cbase, id)) != 0) {
+ klass = define_type == 2 ? rb_public_const_get_at(klass, id) : rb_const_get_at(klass, id);
/* already exist */
- if (TYPE(klass) != T_MODULE) {
+ if (!RB_TYPE_P(klass, T_MODULE)) {
rb_raise(rb_eTypeError, "%s is not a module", rb_id2name(id));
}
}
@@ -965,10 +961,11 @@ defineclass
COPY_CREF(class_iseq->cref_stack, vm_cref_push(th, klass, NOEX_PUBLIC, NULL));
/* enter scope */
- vm_push_frame(th, class_iseq,
- VM_FRAME_MAGIC_CLASS, klass, (VALUE) GET_BLOCK_PTR(),
- class_iseq->iseq_encoded, GET_SP(), 0,
- class_iseq->local_size);
+ vm_push_frame(th, class_iseq, VM_FRAME_MAGIC_CLASS,
+ klass, 0, VM_ENVVAL_BLOCK_PTR(GET_BLOCK_PTR()),
+ class_iseq->iseq_encoded, GET_SP(),
+ class_iseq->local_size, 0);
+ rb_vm_using_modules(class_iseq->cref_stack, klass);
RESTORE_REGS();
INC_VM_STATE_VERSION();
@@ -982,85 +979,74 @@ defineclass
/**
@c method/iterator
- @e obj.send(id, args..) # args.size => num
- @j \bhĂяosB
- obj.send(id, args..) # args.size => num
- flag & VM_CALL_ARGS_SPLAT_BIT != 0 -> splat last arg
- flag & VM_CALL_ARGS_BLOCKARG_BIT != 0 -> Proc as Block
- flag & VM_CALL_FCALL_BIT != 0 -> FCALL ( func() )
- flag & VM_CALL_VCALL_BIT != 0 -> VCALL ( func )
- ...
+ @e invoke method.
+ @j メソッド呼び出しを行う。ci に必要な情報が格納されている。
*/
DEFINE_INSN
send
-(ID op_id, rb_num_t op_argc, ISEQ blockiseq, rb_num_t op_flag, IC ic)
+(CALL_INFO ci)
(...)
-(VALUE val) // inc += - (int)(op_argc + ((op_flag & VM_CALL_ARGS_BLOCKARG_BIT) ? 1 : 0));
+(VALUE val) // inc += - (int)(ci->orig_argc + ((ci->flag & VM_CALL_ARGS_BLOCKARG) ? 1 : 0));
{
- const rb_method_entry_t *me;
- VALUE recv, klass;
- rb_block_t *blockptr = 0;
- VALUE flag = op_flag;
- int num = caller_setup_args(th, GET_CFP(), flag, (int)op_argc,
- (rb_iseq_t *)blockiseq, &blockptr);
- ID id = op_id;
+ ci->argc = ci->orig_argc;
+ ci->blockptr = 0;
+ vm_caller_setup_args(th, reg_cfp, ci);
+ vm_search_method(ci, ci->recv = TOPN(ci->argc));
+ CALL_METHOD(ci);
+}
- /* get receiver */
- recv = (flag & VM_CALL_FCALL_BIT) ? GET_SELF() : TOPN(num);
- klass = CLASS_OF(recv);
- me = vm_method_search(id, klass, ic);
- CALL_METHOD(num, blockptr, flag, id, me, recv);
+/**
+ @c optimize
+ @e Invoke method without block, splat
+ @j Invoke method without block, splat
+ */
+DEFINE_INSN
+opt_send_simple
+(CALL_INFO ci)
+(...)
+(VALUE val) // inc += -ci->orig_argc;
+{
+ vm_search_method(ci, ci->recv = TOPN(ci->argc));
+ CALL_METHOD(ci);
}
/**
@c method/iterator
@e super(args) # args.size => num
- @j super sB
- super(args) # args.size => num
- flag IyḧӖ send ƓB
+ @j super を実行する。ci に必要な情報が格納されている。
*/
DEFINE_INSN
invokesuper
-(rb_num_t op_argc, ISEQ blockiseq, rb_num_t op_flag)
+(CALL_INFO ci)
(...)
-(VALUE val) // inc += - (int)(op_argc + ((op_flag & VM_CALL_ARGS_BLOCKARG_BIT) ? 1 : 0));
+(VALUE val) // inc += - (int)(ci->orig_argc + ((ci->flag & VM_CALL_ARGS_BLOCKARG) ? 1 : 0));
{
- rb_block_t *blockptr = !(op_flag & VM_CALL_ARGS_BLOCKARG_BIT) ? GET_BLOCK_PTR() : 0;
- VALUE flag = op_flag;
- int num = caller_setup_args(th, GET_CFP(), flag,
- (int)op_argc, blockiseq, &blockptr);
- VALUE recv, klass;
- ID id;
- const rb_method_entry_t *me;
-
- flag = VM_CALL_SUPER_BIT | VM_CALL_FCALL_BIT;
-
- recv = GET_SELF();
- vm_search_superclass(GET_CFP(), GET_ISEQ(), recv, TOPN(num), &id, &klass);
+ ci->argc = ci->orig_argc;
+ ci->blockptr = !(ci->flag & VM_CALL_ARGS_BLOCKARG) ? GET_BLOCK_PTR() : 0;
- /* temporary measure for [Bug #2402] [Bug #2502] [Bug #3136] */
- if (!rb_obj_is_kind_of(recv, klass)) {
- rb_raise(rb_eNotImpError, "super from singleton method that is defined to multiple classes is not supported; this will be fixed in 1.9.3 or later");
+ if (UNLIKELY(!(ci->flag & VM_CALL_ARGS_SKIP_SETUP))) {
+ vm_caller_setup_args(th, reg_cfp, ci);
}
-
- me = rb_method_entry(klass, id);
-
- CALL_METHOD(num, blockptr, flag, id, me, recv);
+ ci->recv = GET_SELF();
+ vm_search_super_method(th, GET_CFP(), ci);
+ CALL_METHOD(ci);
}
/**
@c method/iterator
- @e yield(args) # args.size => num, flag shows expand argument or not
- @j yield sB
- yield(args) # args.size => num
+ @e yield(args)
+ @j yield を実行する。
*/
DEFINE_INSN
invokeblock
-(rb_num_t num, rb_num_t flag)
+(CALL_INFO ci)
(...)
-(VALUE val) // inc += 1 - num;
+(VALUE val) // inc += 1 - ci->orig_argc;
{
- val = vm_invoke_block(th, GET_CFP(), num, flag);
+ ci->argc = ci->orig_argc;
+ ci->blockptr = 0;
+ ci->recv = GET_SELF();
+ val = vm_invoke_block(th, GET_CFP(), ci);
if (val == Qundef) {
RESTORE_REGS();
NEXT_INSN();
@@ -1070,7 +1056,7 @@ invokeblock
/**
@c method/iterator
@e return from this scope.
- @j ̃XR[v甲B
+ @j このスコープから抜ける。
*/
DEFINE_INSN
leave
@@ -1079,34 +1065,28 @@ leave
(VALUE val)
{
if (OPT_CHECKED_RUN) {
- if (reg_cfp->sp != reg_cfp->bp) {
+ if (reg_cfp->sp != vm_base_ptr(reg_cfp)) {
rb_bug("Stack consistency error (sp: %"PRIdPTRDIFF", bp: %"PRIdPTRDIFF")",
- VM_SP_CNT(th, reg_cfp->sp), VM_SP_CNT(th, reg_cfp->bp));
+ VM_SP_CNT(th, reg_cfp->sp), VM_SP_CNT(th, vm_base_ptr(reg_cfp)));
}
}
- RUBY_VM_CHECK_INTS();
- vm_pop_frame(th);
- RESTORE_REGS();
-}
+ RUBY_VM_CHECK_INTS(th);
+
+ if (UNLIKELY(VM_FRAME_TYPE_FINISH_P(GET_CFP()))) {
+ vm_pop_frame(th);
-/**
- @c method/iterator
- @e return from this vm loop
- @j VM loop 甲B
- */
-DEFINE_INSN
-finish
-()
-(VALUE val)
-(VALUE val)
-{
#if OPT_CALL_THREADED_CODE
- rb_bug("unused instruction on OPT_CALL_THREADED_CODE");
+ th->retval = val;
+ return 0;
#else
- th->cfp++;
- return val;
+ return val;
#endif
+ }
+ else {
+ vm_pop_frame(th);
+ RESTORE_REGS();
+ }
}
/**********************************************************/
@@ -1116,7 +1096,7 @@ finish
/**
@c exception
@e longjump
- @j WvsB
+ @j 大域ジャンプを行う。
*/
DEFINE_INSN
throw
@@ -1124,7 +1104,7 @@ throw
(VALUE throwobj)
(VALUE val)
{
- RUBY_VM_CHECK_INTS();
+ RUBY_VM_CHECK_INTS(th);
val = vm_throw(th, GET_CFP(), throw_state, throwobj);
THROW_EXCEPTION(val);
/* unreachable */
@@ -1137,7 +1117,7 @@ throw
/**
@c jump
@e set PC to (PC + dst).
- @j PC (PC + dst) ɂB
+ @j PC を (PC + dst) にする。
*/
DEFINE_INSN
jump
@@ -1145,14 +1125,14 @@ jump
()
()
{
- RUBY_VM_CHECK_INTS();
+ RUBY_VM_CHECK_INTS(th);
JUMP(dst);
}
/**
@c jump
@e if val is not false or nil, set PC to (PC + dst).
- @j val false nil łȂ΁APC (PC + dst) ɂB
+ @j もし val が false か nil でなければ、PC を (PC + dst) にする。
*/
DEFINE_INSN
branchif
@@ -1161,7 +1141,7 @@ branchif
()
{
if (RTEST(val)) {
- RUBY_VM_CHECK_INTS();
+ RUBY_VM_CHECK_INTS(th);
JUMP(dst);
}
}
@@ -1169,7 +1149,7 @@ branchif
/**
@c jump
@e if val is false or nil, set PC to (PC + dst).
- @j val false nil Ȃ΁APC (PC + dst) ɂB
+ @j もし val が false か nil ならば、PC を (PC + dst) にする。
*/
DEFINE_INSN
branchunless
@@ -1178,7 +1158,7 @@ branchunless
()
{
if (!RTEST(val)) {
- RUBY_VM_CHECK_INTS();
+ RUBY_VM_CHECK_INTS(th);
JUMP(dst);
}
}
@@ -1191,7 +1171,7 @@ branchunless
/**
@c optimize
@e inline cache
- @j CCLbVLȂAlX^bNɃvbV dst փWvB
+ @j インラインキャッシュが有効なら、値をスタックにプッシュして dst へジャンプする。
*/
DEFINE_INSN
getinlinecache
@@ -1212,7 +1192,7 @@ getinlinecache
/**
@c optimize
@e inline cache (once)
- @j once B
+ @j once を実現する。
*/
DEFINE_INSN
onceinlinecache
@@ -1227,8 +1207,8 @@ onceinlinecache
}
else if (ic->ic_value.value == Qundef)
{
- RUBY_VM_CHECK_INTS();
- rb_thread_schedule();
+ RUBY_VM_CHECK_INTS(th);
+ rb_thread_schedule();
goto retry;
}
else {
@@ -1241,7 +1221,7 @@ onceinlinecache
/**
@c optimize
@e set inline cache
- @j CCLbV̒lݒ肷B
+ @j インラインキャッシュの値を設定する。
*/
DEFINE_INSN
setinlinecache
@@ -1260,7 +1240,7 @@ setinlinecache
/**
@c optimize
@e case dispatcher
- @j case ŁA”\Ȃ\ŃWvB
+ @j case 文で、可能なら表引きでジャンプする。
*/
DEFINE_INSN
opt_case_dispatch
@@ -1279,7 +1259,11 @@ opt_case_dispatch
case T_FIXNUM:
case T_BIGNUM:
case T_STRING:
- if (BASIC_OP_UNREDEFINED_P(BOP_EQQ)) {
+ if (BASIC_OP_UNREDEFINED_P(BOP_EQQ,
+ SYMBOL_REDEFINED_OP_FLAG |
+ FIXNUM_REDEFINED_OP_FLAG |
+ BIGNUM_REDEFINED_OP_FLAG |
+ STRING_REDEFINED_OP_FLAG)) {
st_data_t val;
if (st_lookup(RHASH_TBL(hash), key, &val)) {
JUMP(FIX2INT((VALUE)val));
@@ -1294,45 +1278,21 @@ opt_case_dispatch
}
}
-/**
- @c optimize
- @e check environment
- @j ̊gpB
- */
-DEFINE_INSN
-opt_checkenv
-()
-()
-()
-{
- if (GET_CFP()->bp != GET_DFP() + 1) {
- VALUE *new_dfp = GET_CFP()->bp - 1;
- /* TODO: copy env and clean stack at creating env? */
- *new_dfp = *GET_DFP();
- SET_DFP(new_dfp);
- }
-}
-
-
/** simple functions */
/**
@c optimize
@e optimized X+Y.
- @j œKꂽ X+YB
+ @j 最適化された X+Y。
*/
DEFINE_INSN
opt_plus
-(IC ic)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
{
- if (0) {
-
- }
-#if 1
- else if (FIXNUM_2_P(recv, obj) &&
- BASIC_OP_UNREDEFINED_P(BOP_PLUS)) {
+ if (FIXNUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_PLUS,FIXNUM_REDEFINED_OP_FLAG)) {
/* fixnum + fixnum */
#ifndef LONG_LONG_VALUE
val = (recv + (obj & (~1)));
@@ -1354,57 +1314,48 @@ opt_plus
}
#endif
}
-#endif
-
+ else if (FLONUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_PLUS, FLOAT_REDEFINED_OP_FLAG)) {
+ val = DBL2NUM(RFLOAT_VALUE(recv) + RFLOAT_VALUE(obj));
+ }
else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
- if (0) {
- }
-#if 1
- else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
- HEAP_CLASS_OF(obj) == rb_cFloat &&
- BASIC_OP_UNREDEFINED_P(BOP_PLUS)) {
+ if (HEAP_CLASS_OF(recv) == rb_cFloat && HEAP_CLASS_OF(obj) == rb_cFloat &&
+ BASIC_OP_UNREDEFINED_P(BOP_PLUS, FLOAT_REDEFINED_OP_FLAG)) {
val = DBL2NUM(RFLOAT_VALUE(recv) + RFLOAT_VALUE(obj));
}
-#endif
-
-#if 1
- else if (HEAP_CLASS_OF(recv) == rb_cString &&
- HEAP_CLASS_OF(obj) == rb_cString &&
- BASIC_OP_UNREDEFINED_P(BOP_PLUS)) {
+ else if (HEAP_CLASS_OF(recv) == rb_cString && HEAP_CLASS_OF(obj) == rb_cString &&
+ BASIC_OP_UNREDEFINED_P(BOP_PLUS, STRING_REDEFINED_OP_FLAG)) {
val = rb_str_plus(recv, obj);
}
-#endif
-#if 1
else if (HEAP_CLASS_OF(recv) == rb_cArray &&
- BASIC_OP_UNREDEFINED_P(BOP_PLUS)) {
+ BASIC_OP_UNREDEFINED_P(BOP_PLUS, ARRAY_REDEFINED_OP_FLAG)) {
val = rb_ary_plus(recv, obj);
}
-#endif
else {
goto INSN_LABEL(normal_dispatch);
}
}
else {
- INSN_LABEL(normal_dispatch):
+ INSN_LABEL(normal_dispatch):
PUSH(recv);
PUSH(obj);
- CALL_SIMPLE_METHOD(1, idPLUS, recv);
+ CALL_SIMPLE_METHOD(recv);
}
}
/**
@c optimize
@e optimized X-Y.
- @j œKꂽ X-YB
+ @j 最適化された X-Y。
*/
DEFINE_INSN
opt_minus
-(IC ic)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
{
if (FIXNUM_2_P(recv, obj) &&
- BASIC_OP_UNREDEFINED_P(BOP_MINUS)) {
+ BASIC_OP_UNREDEFINED_P(BOP_MINUS, FIXNUM_REDEFINED_OP_FLAG)) {
long a, b, c;
a = FIX2LONG(recv);
@@ -1418,16 +1369,15 @@ opt_minus
val = rb_big_minus(rb_int2big(a), rb_int2big(b));
}
}
+ else if (FLONUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_MINUS, FLOAT_REDEFINED_OP_FLAG)) {
+ val = DBL2NUM(RFLOAT_VALUE(recv) - RFLOAT_VALUE(obj));
+ }
else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
- if (0) {
- }
-#if 1
- else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
- HEAP_CLASS_OF(obj) == rb_cFloat &&
- BASIC_OP_UNREDEFINED_P(BOP_MINUS)) {
+ if (HEAP_CLASS_OF(recv) == rb_cFloat && HEAP_CLASS_OF(obj) == rb_cFloat &&
+ BASIC_OP_UNREDEFINED_P(BOP_MINUS, FLOAT_REDEFINED_OP_FLAG)) {
val = DBL2NUM(RFLOAT_VALUE(recv) - RFLOAT_VALUE(obj));
}
-#endif
else {
goto INSN_LABEL(normal_dispatch);
}
@@ -1437,23 +1387,23 @@ opt_minus
INSN_LABEL(normal_dispatch):
PUSH(recv);
PUSH(obj);
- CALL_SIMPLE_METHOD(1, idMINUS, recv);
+ CALL_SIMPLE_METHOD(recv);
}
}
/**
@c optimize
@e optimized X*Y.
- @j œKꂽ X*YB
+ @j 最適化された X*Y。
*/
DEFINE_INSN
opt_mult
-(IC ic)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
{
if (FIXNUM_2_P(recv, obj) &&
- BASIC_OP_UNREDEFINED_P(BOP_MULT)) {
+ BASIC_OP_UNREDEFINED_P(BOP_MULT, FIXNUM_REDEFINED_OP_FLAG)) {
long a, b;
a = FIX2LONG(recv);
@@ -1473,16 +1423,15 @@ opt_mult
}
}
}
+ else if (FLONUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_MULT, FLOAT_REDEFINED_OP_FLAG)) {
+ val = DBL2NUM(RFLOAT_VALUE(recv) * RFLOAT_VALUE(obj));
+ }
else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
- if (0) {
- }
-#if 1
- else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
- HEAP_CLASS_OF(obj) == rb_cFloat &&
- BASIC_OP_UNREDEFINED_P(BOP_MULT)) {
+ if (HEAP_CLASS_OF(recv) == rb_cFloat && HEAP_CLASS_OF(obj) == rb_cFloat &&
+ BASIC_OP_UNREDEFINED_P(BOP_MULT, FLOAT_REDEFINED_OP_FLAG)) {
val = DBL2NUM(RFLOAT_VALUE(recv) * RFLOAT_VALUE(obj));
}
-#endif
else {
goto INSN_LABEL(normal_dispatch);
}
@@ -1491,23 +1440,23 @@ opt_mult
INSN_LABEL(normal_dispatch):
PUSH(recv);
PUSH(obj);
- CALL_SIMPLE_METHOD(1, idMULT, recv);
+ CALL_SIMPLE_METHOD(recv);
}
}
/**
@c optimize
@e optimized X/Y.
- @j œKꂽ X/YB
+ @j 最適化された X/Y。
*/
DEFINE_INSN
opt_div
-(IC ic)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
{
if (FIXNUM_2_P(recv, obj) &&
- BASIC_OP_UNREDEFINED_P(BOP_DIV)) {
+ BASIC_OP_UNREDEFINED_P(BOP_DIV, FIXNUM_REDEFINED_OP_FLAG)) {
long x, y, div;
x = FIX2LONG(recv);
@@ -1537,16 +1486,15 @@ opt_div
}
val = LONG2NUM(div);
}
+ else if (FLONUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_MULT, FLOAT_REDEFINED_OP_FLAG)) {
+ val = DBL2NUM(RFLOAT_VALUE(recv) / RFLOAT_VALUE(obj));
+ }
else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
- if (0) {
- }
-#if 1
- else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
- HEAP_CLASS_OF(obj) == rb_cFloat &&
- BASIC_OP_UNREDEFINED_P(BOP_DIV)) {
+ if (HEAP_CLASS_OF(recv) == rb_cFloat && HEAP_CLASS_OF(obj) == rb_cFloat &&
+ BASIC_OP_UNREDEFINED_P(BOP_DIV, FLOAT_REDEFINED_OP_FLAG)) {
val = DBL2NUM(RFLOAT_VALUE(recv) / RFLOAT_VALUE(obj));
}
-#endif
else {
goto INSN_LABEL(normal_dispatch);
}
@@ -1555,23 +1503,23 @@ opt_div
INSN_LABEL(normal_dispatch):
PUSH(recv);
PUSH(obj);
- CALL_SIMPLE_METHOD(1, idDIV, recv);
+ CALL_SIMPLE_METHOD(recv);
}
}
/**
@c optimize
@e optimized X%Y.
- @j œKꂽ X%YB
+ @j 最適化された X%Y。
*/
DEFINE_INSN
opt_mod
-(IC ic)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
{
if (FIXNUM_2_P(recv, obj) &&
- BASIC_OP_UNREDEFINED_P(BOP_MOD)) {
+ BASIC_OP_UNREDEFINED_P(BOP_MOD, FIXNUM_REDEFINED_OP_FLAG )) {
long x, y, mod;
x = FIX2LONG(recv);
@@ -1602,29 +1550,14 @@ opt_mod
}
val = LONG2FIX(mod);
}
+ else if (FLONUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_MOD, FLOAT_REDEFINED_OP_FLAG)) {
+ val = DBL2NUM(ruby_float_mod(RFLOAT_VALUE(recv), RFLOAT_VALUE(obj)));
+ }
else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
- if (0) {
- }
- else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
- HEAP_CLASS_OF(obj) == rb_cFloat &&
- BASIC_OP_UNREDEFINED_P(BOP_MOD)) {
- double x = RFLOAT_VALUE(recv);
- double y = RFLOAT_VALUE(obj);
- double div, mod;
-
- {
- double z;
-
- modf(x / y, &z);
- mod = x - z * y;
- }
-
- div = (x - mod) / y;
- if (y * mod < 0) {
- mod += y;
- div -= 1.0;
- }
- val = DBL2NUM(mod);
+ if (HEAP_CLASS_OF(recv) == rb_cFloat && HEAP_CLASS_OF(obj) == rb_cFloat &&
+ BASIC_OP_UNREDEFINED_P(BOP_MOD, FLOAT_REDEFINED_OP_FLAG)) {
+ val = DBL2NUM(ruby_float_mod(RFLOAT_VALUE(recv), RFLOAT_VALUE(obj)));
}
else {
goto INSN_LABEL(normal_dispatch);
@@ -1634,48 +1567,48 @@ opt_mod
INSN_LABEL(normal_dispatch):
PUSH(recv);
PUSH(obj);
- CALL_SIMPLE_METHOD(1, idMOD, recv);
+ CALL_SIMPLE_METHOD(recv);
}
}
/**
@c optimize
@e optimized X==Y.
- @j œKꂽ X==YB
+ @j 最適化された X==Y。
*/
DEFINE_INSN
opt_eq
-(IC ic)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
{
- val = opt_eq_func(recv, obj, ic);
+ val = opt_eq_func(recv, obj, ci);
if (val == Qundef) {
/* other */
PUSH(recv);
PUSH(obj);
- CALL_SIMPLE_METHOD(1, idEq, recv);
+ CALL_SIMPLE_METHOD(recv);
}
}
/**
@c optimize
@e optimized X!=Y.
- @j œKꂽ X!=YB
+ @j 最適化された X!=Y。
*/
DEFINE_INSN
opt_neq
-(IC ic, IC ic_eq)
+(CALL_INFO ci, CALL_INFO ci_eq)
(VALUE recv, VALUE obj)
(VALUE val)
{
extern VALUE rb_obj_not_equal(VALUE obj1, VALUE obj2);
- const rb_method_entry_t *me = vm_method_search(idNeq, CLASS_OF(recv), ic);
+ vm_search_method(ci, recv);
val = Qundef;
- if (check_cfunc(me, rb_obj_not_equal)) {
- val = opt_eq_func(recv, obj, ic_eq);
+ if (check_cfunc(ci->me, rb_obj_not_equal)) {
+ val = opt_eq_func(recv, obj, ci_eq);
if (val != Qundef) {
val = RTEST(val) ? Qfalse : Qtrue;
@@ -1686,23 +1619,23 @@ opt_neq
/* other */
PUSH(recv);
PUSH(obj);
- CALL_SIMPLE_METHOD(1, idNeq, recv);
+ CALL_SIMPLE_METHOD(recv);
}
}
/**
@c optimize
@e optimized X<Y.
- @j œKꂽ X<YB
+ @j 最適化された X<Y。
*/
DEFINE_INSN
opt_lt
-(IC ic)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
{
if (FIXNUM_2_P(recv, obj) &&
- BASIC_OP_UNREDEFINED_P(BOP_LT)) {
+ BASIC_OP_UNREDEFINED_P(BOP_LT, FIXNUM_REDEFINED_OP_FLAG)) {
SIGNED_VALUE a = recv, b = obj;
if (a < b) {
@@ -1712,22 +1645,16 @@ opt_lt
val = Qfalse;
}
}
+ else if (FLONUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_LT, FLOAT_REDEFINED_OP_FLAG)) {
+ /* flonum is not NaN */
+ val = RFLOAT_VALUE(recv) < RFLOAT_VALUE(obj) ? Qtrue : Qfalse;
+ }
else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
- if (0) {
- }
-#if 1
- else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
- HEAP_CLASS_OF(obj) == rb_cFloat &&
- BASIC_OP_UNREDEFINED_P(BOP_LT)) {
- double a = RFLOAT_VALUE(recv);
- double b = RFLOAT_VALUE(obj);
-#if defined(_MSC_VER) && _MSC_VER < 1300
- if (isnan(a) || isnan(b)) val = Qfalse;
- else
-#endif
- val = a < b ? Qtrue : Qfalse;
+ if (HEAP_CLASS_OF(recv) == rb_cFloat && HEAP_CLASS_OF(obj) == rb_cFloat &&
+ BASIC_OP_UNREDEFINED_P(BOP_LT, FLOAT_REDEFINED_OP_FLAG)) {
+ val = double_cmp_lt(RFLOAT_VALUE(recv), RFLOAT_VALUE(obj));
}
-#endif
else {
goto INSN_LABEL(normal_dispatch);
}
@@ -1736,23 +1663,23 @@ opt_lt
INSN_LABEL(normal_dispatch):
PUSH(recv);
PUSH(obj);
- CALL_SIMPLE_METHOD(1, idLT, recv);
+ CALL_SIMPLE_METHOD(recv);
}
}
/**
@c optimize
@e optimized X<=Y.
- @j œKꂽ X<=YB
+ @j 最適化された X<=Y。
*/
DEFINE_INSN
opt_le
-(IC ic)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
{
if (FIXNUM_2_P(recv, obj) &&
- BASIC_OP_UNREDEFINED_P(BOP_LE)) {
+ BASIC_OP_UNREDEFINED_P(BOP_LE, FIXNUM_REDEFINED_OP_FLAG)) {
SIGNED_VALUE a = recv, b = obj;
if (a <= b) {
@@ -1762,27 +1689,32 @@ opt_le
val = Qfalse;
}
}
+ else if (FLONUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_LE, FLOAT_REDEFINED_OP_FLAG)) {
+ /* flonum is not NaN */
+ val = RFLOAT_VALUE(recv) <= RFLOAT_VALUE(obj) ? Qtrue : Qfalse;
+ }
else {
/* other */
PUSH(recv);
PUSH(obj);
- CALL_SIMPLE_METHOD(1, idLE, recv);
+ CALL_SIMPLE_METHOD(recv);
}
}
/**
@c optimize
@e optimized X>Y.
- @j œKꂽ X>YB
+ @j 最適化された X>Y。
*/
DEFINE_INSN
opt_gt
-(IC ic)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
{
if (FIXNUM_2_P(recv, obj) &&
- BASIC_OP_UNREDEFINED_P(BOP_GT)) {
+ BASIC_OP_UNREDEFINED_P(BOP_GT, FIXNUM_REDEFINED_OP_FLAG)) {
SIGNED_VALUE a = recv, b = obj;
if (a > b) {
@@ -1792,22 +1724,16 @@ opt_gt
val = Qfalse;
}
}
+ else if (FLONUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_GT, FLOAT_REDEFINED_OP_FLAG)) {
+ /* flonum is not NaN */
+ val = RFLOAT_VALUE(recv) > RFLOAT_VALUE(obj) ? Qtrue : Qfalse;
+ }
else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
- if (0) {
- }
-#if 1
- else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
- HEAP_CLASS_OF(obj) == rb_cFloat &&
- BASIC_OP_UNREDEFINED_P(BOP_GT)) {
- double a = RFLOAT_VALUE(recv);
- double b = RFLOAT_VALUE(obj);
-#if defined(_MSC_VER) && _MSC_VER < 1300
- if (isnan(a) || isnan(b)) val = Qfalse;
- else
-#endif
- val = a > b ? Qtrue : Qfalse;
+ if (HEAP_CLASS_OF(recv) == rb_cFloat && HEAP_CLASS_OF(obj) == rb_cFloat &&
+ BASIC_OP_UNREDEFINED_P(BOP_GT, FLOAT_REDEFINED_OP_FLAG)) {
+ val = double_cmp_gt(RFLOAT_VALUE(recv), RFLOAT_VALUE(obj));
}
-#endif
else {
goto INSN_LABEL(normal_dispatch);
}
@@ -1816,23 +1742,23 @@ opt_gt
INSN_LABEL(normal_dispatch):
PUSH(recv);
PUSH(obj);
- CALL_SIMPLE_METHOD(1, idGT, recv);
+ CALL_SIMPLE_METHOD(recv);
}
}
/**
@c optimize
@e optimized X>=Y.
- @j œKꂽ X>=YB
+ @j 最適化された X>=Y。
*/
DEFINE_INSN
opt_ge
-(IC ic)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
{
if (FIXNUM_2_P(recv, obj) &&
- BASIC_OP_UNREDEFINED_P(BOP_GE)) {
+ BASIC_OP_UNREDEFINED_P(BOP_GE, FIXNUM_REDEFINED_OP_FLAG)) {
SIGNED_VALUE a = recv, b = obj;
if (a >= b) {
@@ -1842,33 +1768,36 @@ opt_ge
val = Qfalse;
}
}
+ else if (FLONUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_GE, FLOAT_REDEFINED_OP_FLAG)) {
+ /* flonum is not NaN */
+ val = RFLOAT_VALUE(recv) >= RFLOAT_VALUE(obj) ? Qtrue : Qfalse;
+ }
else {
PUSH(recv);
PUSH(obj);
- CALL_SIMPLE_METHOD(1, idGE, recv);
+ CALL_SIMPLE_METHOD(recv);
}
}
/**
@c optimize
@e <<
- @j œKꂽ X<<YB
+ @j 最適化された X<<Y。
*/
DEFINE_INSN
opt_ltlt
-(IC ic)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
{
if (!SPECIAL_CONST_P(recv)) {
- if (0) {
- }
- else if (HEAP_CLASS_OF(recv) == rb_cString &&
- BASIC_OP_UNREDEFINED_P(BOP_LTLT)) {
+ if (HEAP_CLASS_OF(recv) == rb_cString &&
+ BASIC_OP_UNREDEFINED_P(BOP_LTLT, STRING_REDEFINED_OP_FLAG)) {
val = rb_str_concat(recv, obj);
}
else if (HEAP_CLASS_OF(recv) == rb_cArray &&
- BASIC_OP_UNREDEFINED_P(BOP_LTLT)) {
+ BASIC_OP_UNREDEFINED_P(BOP_LTLT, ARRAY_REDEFINED_OP_FLAG)) {
val = rb_ary_push(recv, obj);
}
else {
@@ -1879,26 +1808,26 @@ opt_ltlt
INSN_LABEL(normal_dispatch):
PUSH(recv);
PUSH(obj);
- CALL_SIMPLE_METHOD(1, idLTLT, recv);
+ CALL_SIMPLE_METHOD(recv);
}
}
/**
@c optimize
@e []
- @j œKꂽ recv[obj]B
+ @j 最適化された recv[obj]。
*/
DEFINE_INSN
opt_aref
-(IC ic)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
{
- if (!SPECIAL_CONST_P(recv) && BASIC_OP_UNREDEFINED_P(BOP_AREF)) {
- if (HEAP_CLASS_OF(recv) == rb_cArray && FIXNUM_P(obj)) {
+ if (!SPECIAL_CONST_P(recv)) {
+ if (HEAP_CLASS_OF(recv) == rb_cArray && BASIC_OP_UNREDEFINED_P(BOP_AREF, ARRAY_REDEFINED_OP_FLAG) && FIXNUM_P(obj)) {
val = rb_ary_entry(recv, FIX2LONG(obj));
}
- else if (HEAP_CLASS_OF(recv) == rb_cHash) {
+ else if (HEAP_CLASS_OF(recv) == rb_cHash && BASIC_OP_UNREDEFINED_P(BOP_AREF, HASH_REDEFINED_OP_FLAG)) {
val = rb_hash_aref(recv, obj);
}
else {
@@ -1909,28 +1838,27 @@ opt_aref
INSN_LABEL(normal_dispatch):
PUSH(recv);
PUSH(obj);
- CALL_SIMPLE_METHOD(1, idAREF, recv);
+ CALL_SIMPLE_METHOD(recv);
}
}
/**
@c optimize
@e recv[obj] = set
- @j œKꂽ recv[obj] = setB
+ @j 最適化された recv[obj] = set。
*/
DEFINE_INSN
opt_aset
-(IC ic)
+(CALL_INFO ci)
(VALUE recv, VALUE obj, VALUE set)
(VALUE val)
{
- if (!SPECIAL_CONST_P(recv) &&
- BASIC_OP_UNREDEFINED_P(BOP_ASET)) {
- if (HEAP_CLASS_OF(recv) == rb_cArray && FIXNUM_P(obj)) {
+ if (!SPECIAL_CONST_P(recv)) {
+ if (HEAP_CLASS_OF(recv) == rb_cArray && BASIC_OP_UNREDEFINED_P(BOP_ASET, ARRAY_REDEFINED_OP_FLAG) && FIXNUM_P(obj)) {
rb_ary_store(recv, FIX2LONG(obj), set);
val = set;
}
- else if (HEAP_CLASS_OF(recv) == rb_cHash) {
+ else if (HEAP_CLASS_OF(recv) == rb_cHash && BASIC_OP_UNREDEFINED_P(BOP_ASET, HASH_REDEFINED_OP_FLAG)) {
rb_hash_aset(recv, obj, set);
val = set;
}
@@ -1943,30 +1871,32 @@ opt_aset
PUSH(recv);
PUSH(obj);
PUSH(set);
- CALL_SIMPLE_METHOD(2, idASET, recv);
+ CALL_SIMPLE_METHOD(recv);
}
}
/**
@c optimize
@e optimized length
- @j œKꂽ recv.length()B
+ @j 最適化された recv.length()。
*/
DEFINE_INSN
opt_length
-(IC ic)
+(CALL_INFO ci)
(VALUE recv)
(VALUE val)
{
- if (LIKELY(!SPECIAL_CONST_P(recv) &&
- BASIC_OP_UNREDEFINED_P(BOP_LENGTH))) {
- if (HEAP_CLASS_OF(recv) == rb_cString) {
+ if (!SPECIAL_CONST_P(recv)) {
+ if (HEAP_CLASS_OF(recv) == rb_cString &&
+ BASIC_OP_UNREDEFINED_P(BOP_LENGTH, STRING_REDEFINED_OP_FLAG)) {
val = rb_str_length(recv);
}
- else if (HEAP_CLASS_OF(recv) == rb_cArray) {
+ else if (HEAP_CLASS_OF(recv) == rb_cArray &&
+ BASIC_OP_UNREDEFINED_P(BOP_LENGTH, ARRAY_REDEFINED_OP_FLAG)) {
val = LONG2NUM(RARRAY_LEN(recv));
}
- else if (HEAP_CLASS_OF(recv) == rb_cHash) {
+ else if (HEAP_CLASS_OF(recv) == rb_cHash &&
+ BASIC_OP_UNREDEFINED_P(BOP_LENGTH, HASH_REDEFINED_OP_FLAG)) {
val = INT2FIX(RHASH_SIZE(recv));
}
else {
@@ -1976,30 +1906,32 @@ opt_length
else {
INSN_LABEL(normal_dispatch):
PUSH(recv);
- CALL_SIMPLE_METHOD(0, idLength, recv);
+ CALL_SIMPLE_METHOD(recv);
}
}
/**
@c optimize
@e optimized size
- @j œKꂽ recv.size()B
+ @j 最適化された recv.size()。
*/
DEFINE_INSN
opt_size
-(IC ic)
+(CALL_INFO ci)
(VALUE recv)
(VALUE val)
{
- if (LIKELY(BASIC_OP_UNREDEFINED_P(BOP_SIZE) &&
- !SPECIAL_CONST_P(recv))) {
- if (HEAP_CLASS_OF(recv) == rb_cString) {
+ if (!SPECIAL_CONST_P(recv)) {
+ if (HEAP_CLASS_OF(recv) == rb_cString &&
+ BASIC_OP_UNREDEFINED_P(BOP_SIZE, STRING_REDEFINED_OP_FLAG)) {
val = rb_str_length(recv);
}
- else if (HEAP_CLASS_OF(recv) == rb_cArray) {
+ else if (HEAP_CLASS_OF(recv) == rb_cArray &&
+ BASIC_OP_UNREDEFINED_P(BOP_SIZE, ARRAY_REDEFINED_OP_FLAG)) {
val = LONG2NUM(RARRAY_LEN(recv));
}
- else if (HEAP_CLASS_OF(recv) == rb_cHash) {
+ else if (HEAP_CLASS_OF(recv) == rb_cHash &&
+ BASIC_OP_UNREDEFINED_P(BOP_SIZE, HASH_REDEFINED_OP_FLAG)) {
val = INT2FIX(RHASH_SIZE(recv));
}
else {
@@ -2009,24 +1941,62 @@ opt_size
else {
INSN_LABEL(normal_dispatch):
PUSH(recv);
- CALL_SIMPLE_METHOD(0, idSize, recv);
+ CALL_SIMPLE_METHOD(recv);
+ }
+}
+
+/**
+ @c optimize
+ @e optimized empty?
+ @j 最適化された recv.empty?()。
+ */
+DEFINE_INSN
+opt_empty_p
+(CALL_INFO ci)
+(VALUE recv)
+(VALUE val)
+{
+ if (!SPECIAL_CONST_P(recv)) {
+ if (HEAP_CLASS_OF(recv) == rb_cString &&
+ BASIC_OP_UNREDEFINED_P(BOP_EMPTY_P, STRING_REDEFINED_OP_FLAG)) {
+ if (RSTRING_LEN(recv) == 0) val = Qtrue;
+ else val = Qfalse;
+ }
+ else if (HEAP_CLASS_OF(recv) == rb_cArray &&
+ BASIC_OP_UNREDEFINED_P(BOP_EMPTY_P, ARRAY_REDEFINED_OP_FLAG)) {
+ if (RARRAY_LEN(recv) == 0) val = Qtrue;
+ else val = Qfalse;
+ }
+ else if (HEAP_CLASS_OF(recv) == rb_cHash &&
+ BASIC_OP_UNREDEFINED_P(BOP_EMPTY_P, HASH_REDEFINED_OP_FLAG)) {
+ if (RHASH_EMPTY_P(recv)) val = Qtrue;
+ else val = Qfalse;
+ }
+ else {
+ goto INSN_LABEL(normal_dispatch);
+ }
+ }
+ else {
+ INSN_LABEL(normal_dispatch):
+ PUSH(recv);
+ CALL_SIMPLE_METHOD(recv);
}
}
/**
@c optimize
@e optimized succ
- @j œKꂽ recv.succ()B
+ @j 最適化された recv.succ()。
*/
DEFINE_INSN
opt_succ
-(IC ic)
+(CALL_INFO ci)
(VALUE recv)
(VALUE val)
{
if (SPECIAL_CONST_P(recv)) {
if (FIXNUM_P(recv) &&
- BASIC_OP_UNREDEFINED_P(BOP_SUCC)) {
+ BASIC_OP_UNREDEFINED_P(BOP_SUCC, FIXNUM_REDEFINED_OP_FLAG)) {
const VALUE obj = INT2FIX(1);
/* fixnum + INT2FIX(1) */
val = (recv + (obj & (~1)));
@@ -2041,11 +2011,11 @@ opt_succ
}
else {
if (HEAP_CLASS_OF(recv) == rb_cString &&
- BASIC_OP_UNREDEFINED_P(BOP_SUCC)) {
+ BASIC_OP_UNREDEFINED_P(BOP_SUCC, STRING_REDEFINED_OP_FLAG)) {
val = rb_str_succ(recv);
}
else if (HEAP_CLASS_OF(recv) == rb_cTime &&
- BASIC_OP_UNREDEFINED_P(BOP_SUCC)) {
+ BASIC_OP_UNREDEFINED_P(BOP_SUCC, TIME_REDEFINED_OP_FLAG)) {
val = rb_time_succ(recv);
}
else
@@ -2056,30 +2026,30 @@ opt_succ
if (0) {
INSN_LABEL(normal_dispatch):
PUSH(recv);
- CALL_SIMPLE_METHOD(0, idSucc, recv);
+ CALL_SIMPLE_METHOD(recv);
}
}
/**
@c optimize
@e optimized not
- @j œKꂽ recv.!()B
+ @j 最適化された recv.!()。
*/
DEFINE_INSN
opt_not
-(IC ic)
+(CALL_INFO ci)
(VALUE recv)
(VALUE val)
{
extern VALUE rb_obj_not(VALUE obj);
- const rb_method_entry_t *me = vm_method_search(idNot, CLASS_OF(recv), ic);
+ vm_search_method(ci, recv);
- if (check_cfunc(me, rb_obj_not)) {
+ if (check_cfunc(ci->me, rb_obj_not)) {
val = RTEST(recv) ? Qfalse : Qtrue;
}
else {
PUSH(recv);
- CALL_SIMPLE_METHOD(0, idNot, recv);
+ CALL_SIMPLE_METHOD(recv);
}
}
@@ -2087,7 +2057,7 @@ opt_not
/**
@c optimize
@e optimized regexp match
- @j œKꂽK\}b`B
+ @j 最適化された正規表現マッチ。
*/
DEFINE_INSN
opt_regexpmatch1
@@ -2101,7 +2071,7 @@ opt_regexpmatch1
/**
@c optimize
@e optimized regexp match 2
- @j œKꂽK\}b` 2
+ @j 最適化された正規表現マッチ 2
*/
DEFINE_INSN
opt_regexpmatch2
@@ -2109,7 +2079,7 @@ opt_regexpmatch2
(VALUE obj2, VALUE obj1)
(VALUE val)
{
- if (TYPE(obj2) == T_STRING) {
+ if (RB_TYPE_P(obj2, T_STRING)) {
val = rb_reg_match(obj1, obj2);
}
else {
@@ -2120,7 +2090,7 @@ opt_regexpmatch2
/**
@c optimize
@e call native compiled method
- @j lCeBuRpC\bhNB
+ @j ネイティブコンパイルしたメソッドを起動。
*/
DEFINE_INSN
opt_call_c_function
@@ -2157,7 +2127,7 @@ bitblt
/**
@c joke
@e The Answer to Life, the Universe, and Everything
- @j lAFAׂĂ̓B
+ @j 人生、宇宙、すべての答え。
*/
DEFINE_INSN
answer
diff --git a/internal.h b/internal.h
index 172e7f45ad..86181f913a 100644
--- a/internal.h
+++ b/internal.h
@@ -27,6 +27,9 @@ struct rb_classext_struct {
VALUE super;
struct st_table *iv_tbl;
struct st_table *const_tbl;
+ VALUE origin;
+ VALUE refined_class;
+ rb_alloc_func_t allocator;
};
#undef RCLASS_SUPER
@@ -36,15 +39,22 @@ struct rb_classext_struct {
#define RCLASS_CONST_TBL(c) (RCLASS_EXT(c)->const_tbl)
#define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl)
#define RCLASS_IV_INDEX_TBL(c) (RCLASS(c)->iv_index_tbl)
+#define RCLASS_ORIGIN(c) (RCLASS_EXT(c)->origin)
+#define RCLASS_REFINED_CLASS(c) (RCLASS_EXT(c)->refined_class)
struct vtm; /* defined by timev.h */
/* array.c */
VALUE rb_ary_last(int, VALUE *, VALUE);
+void rb_ary_set_len(VALUE, long);
+VALUE rb_ary_cat(VALUE, const VALUE *, long);
+void rb_ary_delete_same(VALUE, VALUE);
/* bignum.c */
VALUE rb_big_fdiv(VALUE x, VALUE y);
VALUE rb_big_uminus(VALUE x);
+VALUE rb_integer_float_cmp(VALUE x, VALUE y);
+VALUE rb_integer_float_eq(VALUE x, VALUE y);
/* class.c */
VALUE rb_obj_methods(int argc, VALUE *argv, VALUE obj);
@@ -52,6 +62,7 @@ VALUE rb_obj_protected_methods(int argc, VALUE *argv, VALUE obj);
VALUE rb_obj_private_methods(int argc, VALUE *argv, VALUE obj);
VALUE rb_obj_public_methods(int argc, VALUE *argv, VALUE obj);
int rb_obj_basic_to_s_p(VALUE);
+VALUE rb_special_singleton_class(VALUE);
void Init_class_hierarchy(void);
/* compile.c */
@@ -59,8 +70,13 @@ int rb_dvar_defined(ID);
int rb_local_defined(ID);
int rb_parse_in_eval(void);
int rb_parse_in_main(void);
+const char * rb_insns_name(int i);
VALUE rb_insns_name_array(void);
+/* cont.c */
+VALUE rb_obj_is_fiber(VALUE);
+void rb_fiber_reset_root_local_storage(VALUE);
+
/* debug.c */
PRINTF_ARGS(void ruby_debug_printf(const char*, ...), 1, 2);
@@ -73,10 +89,15 @@ ID rb_id_encoding(void);
/* encoding.c */
void rb_gc_mark_encodings(void);
+/* enum.c */
+VALUE rb_enum_cycle_size(VALUE self, VALUE args);
+
/* error.c */
NORETURN(PRINTF_ARGS(void rb_compile_bug(const char*, int, const char*, ...), 3, 4));
VALUE rb_check_backtrace(VALUE);
NORETURN(void rb_async_bug_errno(const char *,int));
+const char *rb_builtin_type_name(int t);
+const char *rb_builtin_class_name(VALUE x);
/* eval_error.c */
void ruby_error_print(void);
@@ -84,14 +105,27 @@ VALUE rb_get_backtrace(VALUE info);
/* eval_jump.c */
void rb_call_end_proc(VALUE data);
+void rb_mark_end_proc(void);
/* file.c */
VALUE rb_home_dir(const char *user, VALUE result);
VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict);
+void rb_file_const(const char*, VALUE);
+int rb_file_load_ok(const char *);
+VALUE rb_file_expand_path_fast(VALUE, VALUE);
+VALUE rb_file_expand_path_internal(VALUE, VALUE, int, int, VALUE);
+VALUE rb_get_path_check_to_string(VALUE, int);
+VALUE rb_get_path_check_convert(VALUE, VALUE, int);
void Init_File(void);
+#ifdef _WIN32
+/* file.c, win32/file.c */
+void rb_w32_init_file(void);
+#endif
+
/* gc.c */
void Init_heap(void);
+void *ruby_mimmalloc(size_t size);
/* inits.c */
void rb_call_inits(void);
@@ -103,11 +137,12 @@ ssize_t rb_io_bufread(VALUE io, void *buf, size_t size);
void rb_stdio_set_default_encoding(void);
/* iseq.c */
-VALUE rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE filepath, VALUE line, VALUE opt);
VALUE rb_iseq_clone(VALUE iseqval, VALUE newcbase);
/* load.c */
VALUE rb_get_load_path(void);
+VALUE rb_get_expanded_load_path(void);
+NORETURN(void rb_load_fail(VALUE, const char*));
/* math.c */
VALUE rb_math_atan2(VALUE, VALUE);
@@ -125,7 +160,9 @@ void Init_newline(void);
/* numeric.c */
int rb_num_to_uint(VALUE val, unsigned int *ret);
+VALUE num_interval_step_size(VALUE from, VALUE to, VALUE step, int excl);
int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl);
+double ruby_float_mod(double x, double y);
/* object.c */
VALUE rb_obj_equal(VALUE obj1, VALUE obj2);
@@ -133,9 +170,74 @@ VALUE rb_obj_equal(VALUE obj1, VALUE obj2);
/* parse.y */
VALUE rb_parser_get_yydebug(VALUE);
VALUE rb_parser_set_yydebug(VALUE, VALUE);
+int rb_is_const_name(VALUE name);
+int rb_is_class_name(VALUE name);
+int rb_is_global_name(VALUE name);
+int rb_is_instance_name(VALUE name);
+int rb_is_attrset_name(VALUE name);
+int rb_is_local_name(VALUE name);
+int rb_is_method_name(VALUE name);
+int rb_is_junk_name(VALUE name);
+void rb_gc_mark_parser(void);
+void rb_gc_mark_symbols(void);
/* proc.c */
VALUE rb_proc_location(VALUE self);
+st_index_t rb_hash_proc(st_index_t hash, VALUE proc);
+
+/* process.c */
+
+struct rb_execarg {
+ int use_shell;
+ union {
+ struct {
+ VALUE shell_script;
+ } sh;
+ struct {
+ VALUE command_name;
+ VALUE command_abspath; /* full path string or nil */
+ VALUE argv_str;
+ VALUE argv_buf;
+ } cmd;
+ } invoke;
+ VALUE redirect_fds;
+ VALUE envp_str;
+ VALUE envp_buf;
+ VALUE dup2_tmpbuf;
+ unsigned pgroup_given : 1;
+ unsigned umask_given : 1;
+ unsigned unsetenv_others_given : 1;
+ unsigned unsetenv_others_do : 1;
+ unsigned close_others_given : 1;
+ unsigned close_others_do : 1;
+ unsigned chdir_given : 1;
+ unsigned new_pgroup_given : 1;
+ unsigned new_pgroup_flag : 1;
+ unsigned uid_given : 1;
+ unsigned gid_given : 1;
+ rb_pid_t pgroup_pgid; /* asis(-1), new pgroup(0), specified pgroup (0<V). */
+ VALUE rlimit_limits; /* Qfalse or [[rtype, softlim, hardlim], ...] */
+ mode_t umask_mask;
+ rb_uid_t uid;
+ rb_gid_t gid;
+ VALUE fd_dup2;
+ VALUE fd_close;
+ VALUE fd_open;
+ VALUE fd_dup2_child;
+ int close_others_maxhint;
+ VALUE env_modification; /* Qfalse or [[k1,v1], ...] */
+ VALUE chdir_dir;
+};
+
+/* argv_str contains extra two elements.
+ * The beginning one is for /bin/sh used by exec_with_sh.
+ * The last one for terminating NULL used by execve.
+ * See rb_exec_fillarg() in process.c. */
+#define ARGVSTR2ARGC(argv_str) (RSTRING_LEN(argv_str) / sizeof(char *) - 2)
+#define ARGVSTR2ARGV(argv_str) ((char **)RSTRING_PTR(argv_str) + 1)
+
+rb_pid_t rb_fork_ruby(int *status);
+void rb_last_status_clear(void);
/* rational.c */
VALUE rb_lcm(VALUE x, VALUE y);
@@ -149,10 +251,16 @@ VALUE rb_reg_check_preprocess(VALUE);
int rb_get_next_signal(void);
/* strftime.c */
-size_t rb_strftime_timespec(char *s, size_t maxsize, const char *format, const struct vtm *vtm, struct timespec *ts, int gmt);
+#ifdef RUBY_ENCODING_H
+size_t rb_strftime_timespec(char *s, size_t maxsize, const char *format, rb_encoding *enc,
+ const struct vtm *vtm, struct timespec *ts, int gmt);
+size_t rb_strftime(char *s, size_t maxsize, const char *format, rb_encoding *enc,
+ const struct vtm *vtm, VALUE timev, int gmt);
+#endif
/* string.c */
int rb_str_buf_cat_escaped_char(VALUE result, unsigned int c, int unicode_p);
+int rb_str_symname_p(VALUE);
/* struct.c */
VALUE rb_struct_init_copy(VALUE copy, VALUE s);
@@ -162,11 +270,15 @@ struct timeval rb_time_timeval(VALUE);
/* thread.c */
VALUE rb_obj_is_mutex(VALUE obj);
-VALUE ruby_suppress_tracing(VALUE (*func)(VALUE, int), VALUE arg, int always);
+VALUE rb_suppress_tracing(VALUE (*func)(VALUE), VALUE arg);
void rb_thread_execute_interrupts(VALUE th);
void rb_clear_trace_func(void);
-VALUE rb_thread_backtrace(VALUE thval);
VALUE rb_get_coverages(void);
+VALUE rb_thread_shield_new(void);
+VALUE rb_thread_shield_wait(VALUE self);
+VALUE rb_thread_shield_release(VALUE self);
+VALUE rb_thread_shield_destroy(VALUE self);
+void rb_mutex_allow_trap(VALUE self, int val);
/* thread_pthread.c, thread_win32.c */
void Init_native_thread(void);
@@ -181,6 +293,7 @@ void rb_vm_change_state(void);
void rb_vm_inc_const_missing_count(void);
void rb_thread_mark(void *th);
const void **rb_vm_get_insns_address_table(void);
+VALUE rb_sourcefilename(void);
/* vm_dump.c */
void rb_vm_bugreport(void);
@@ -188,13 +301,26 @@ void rb_vm_bugreport(void);
/* vm_eval.c */
void Init_vm_eval(void);
VALUE rb_current_realfilepath(void);
+VALUE rb_check_block_call(VALUE, ID, int, VALUE *, VALUE (*)(ANYARGS), VALUE);
/* vm_method.c */
void Init_eval_method(void);
+int rb_method_defined_by(VALUE obj, ID mid, VALUE (*cfunc)(ANYARGS));
/* miniprelude.c, prelude.c */
void Init_prelude(void);
+/* vm_backtrace.c */
+void Init_vm_backtrace(void);
+VALUE vm_thread_backtrace(int argc, VALUE *argv, VALUE thval);
+VALUE vm_thread_backtrace_locations(int argc, VALUE *argv, VALUE thval);
+
+VALUE rb_make_backtrace(void);
+void rb_backtrace_print_as_bugreport(void);
+int rb_backtrace_p(VALUE obj);
+VALUE rb_backtrace_to_str_ary(VALUE obj);
+VALUE rb_vm_backtrace_object();
+
#if defined __GNUC__ && __GNUC__ >= 4
#pragma GCC visibility push(default)
#endif
@@ -203,15 +329,25 @@ const char *rb_objspace_data_type_name(VALUE obj);
/* Temporary. This API will be removed (renamed). */
VALUE rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd);
-/* experimental.
- * These APIs can be changed on Ruby 1.9.4 or later.
- * We will change these APIs (spac, name and so on) if there are something wrong.
- * If you use these APIs, catch up future changes.
- */
-void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
-VALUE rb_thread_call_without_gvl(
- rb_blocking_function_t *func, void *data1,
- rb_unblock_function_t *ubf, void *data2);
+/* io.c */
+void rb_maygvl_fd_fix_cloexec(int fd);
+
+/* process.c */
+int rb_exec_async_signal_safe(const struct rb_execarg *e, char *errmsg, size_t errmsg_buflen);
+rb_pid_t rb_fork_async_signal_safe(int *status, int (*chfunc)(void*, char *, size_t), void *charg, VALUE fds, char *errmsg, size_t errmsg_buflen);
+VALUE rb_execarg_new(int argc, VALUE *argv, int accept_shell);
+struct rb_execarg *rb_execarg_get(VALUE execarg_obj); /* dangerous. needs GC guard. */
+VALUE rb_execarg_init(int argc, VALUE *argv, int accept_shell, VALUE execarg_obj);
+int rb_execarg_addopt(VALUE execarg_obj, VALUE key, VALUE val);
+void rb_execarg_fixup(VALUE execarg_obj);
+int rb_execarg_run_options(const struct rb_execarg *e, struct rb_execarg *s, char* errmsg, size_t errmsg_buflen);
+VALUE rb_execarg_extract_options(VALUE execarg_obj, VALUE opthash);
+void rb_execarg_setenv(VALUE execarg_obj, VALUE env);
+
+/* variable.c */
+void rb_gc_mark_global_tbl(void);
+void rb_mark_generic_ivar(VALUE);
+void rb_mark_generic_ivar_tbl(void);
#if defined __GNUC__ && __GNUC__ >= 4
#pragma GCC visibility pop
diff --git a/io.c b/io.c
index ddb6d9576a..7a89654ba2 100644
--- a/io.c
+++ b/io.c
@@ -13,6 +13,7 @@
#include "ruby/ruby.h"
#include "ruby/io.h"
+#include "ruby/thread.h"
#include "dln.h"
#include "internal.h"
#include <ctype.h>
@@ -28,18 +29,16 @@
#if defined HAVE_NET_SOCKET_H
# include <net/socket.h>
#elif defined HAVE_SYS_SOCKET_H
-# include <sys/socket.h>
+# ifndef __native_client__
+# include <sys/socket.h>
+# endif
#endif
#if defined(__BOW__) || defined(__CYGWIN__) || defined(_WIN32) || defined(__EMX__) || defined(__BEOS__) || defined(__HAIKU__)
# define NO_SAFE_RENAME
#endif
-#if defined(__CYGWIN__) || defined(_WIN32)
-# define NO_LONG_FNAME
-#endif
-
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(sun) || defined(_nec_ews)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__sun) || defined(_nec_ews)
# define USE_SETVBUF
#endif
@@ -51,6 +50,9 @@
#if defined(HAVE_SYS_IOCTL_H) && !defined(_WIN32)
#include <sys/ioctl.h>
#endif
+#if defined(__native_client__) && defined(NACL_NEWLIB)
+# include "nacl/ioctl.h"
+#endif
#if defined(HAVE_FCNTL_H) || defined(_WIN32)
#include <fcntl.h>
#elif defined(HAVE_SYS_FCNTL_H)
@@ -155,12 +157,174 @@ void
rb_update_max_fd(int fd)
{
struct stat buf;
- if (fstat(fd, &buf) != 0) {
+ if (fstat(fd, &buf) != 0 && errno == EBADF) {
rb_bug("rb_update_max_fd: invalid fd (%d) given.", fd);
}
if (max_file_descriptor < fd) max_file_descriptor = fd;
}
+void
+rb_maygvl_fd_fix_cloexec(int fd)
+{
+ /* MinGW don't have F_GETFD and FD_CLOEXEC. [ruby-core:40281] */
+#if defined(F_GETFD) && !defined(__native_client__)
+ int flags, flags2, ret;
+ flags = fcntl(fd, F_GETFD); /* should not fail except EBADF. */
+ if (flags == -1) {
+ rb_bug("rb_maygvl_fd_fix_cloexec: fcntl(%d, F_GETFD) failed: %s", fd, strerror(errno));
+ }
+ if (fd <= 2)
+ flags2 = flags & ~FD_CLOEXEC; /* Clear CLOEXEC for standard file descriptors: 0, 1, 2. */
+ else
+ flags2 = flags | FD_CLOEXEC; /* Set CLOEXEC for non-standard file descriptors: 3, 4, 5, ... */
+ if (flags != flags2) {
+ ret = fcntl(fd, F_SETFD, flags2);
+ if (ret == -1) {
+ rb_bug("rb_maygvl_fd_fix_cloexec: fcntl(%d, F_SETFD, %d) failed: %s", fd, flags2, strerror(errno));
+ }
+ }
+#endif
+}
+
+void
+rb_fd_fix_cloexec(int fd)
+{
+ rb_maygvl_fd_fix_cloexec(fd);
+ if (max_file_descriptor < fd) max_file_descriptor = fd;
+}
+
+int
+rb_cloexec_open(const char *pathname, int flags, mode_t mode)
+{
+ int ret;
+#ifdef O_CLOEXEC
+ /* O_CLOEXEC is available since Linux 2.6.23. Linux 2.6.18 silently ignore it. */
+ flags |= O_CLOEXEC;
+#elif defined O_NOINHERIT
+ flags |= O_NOINHERIT;
+#endif
+ ret = open(pathname, flags, mode);
+ if (ret == -1) return -1;
+ rb_maygvl_fd_fix_cloexec(ret);
+ return ret;
+}
+
+int
+rb_cloexec_dup(int oldfd)
+{
+ /* Don't allocate standard file descriptors: 0, 1, 2 */
+ return rb_cloexec_fcntl_dupfd(oldfd, 3);
+}
+
+int
+rb_cloexec_dup2(int oldfd, int newfd)
+{
+ int ret;
+
+ /* When oldfd == newfd, dup2 succeeds but dup3 fails with EINVAL.
+ * rb_cloexec_dup2 succeeds as dup2. */
+ if (oldfd == newfd) {
+ ret = newfd;
+ }
+ else {
+#if defined(HAVE_DUP3) && defined(O_CLOEXEC)
+ static int try_dup3 = 1;
+ if (2 < newfd && try_dup3) {
+ ret = dup3(oldfd, newfd, O_CLOEXEC);
+ if (ret != -1)
+ return ret;
+ /* dup3 is available since Linux 2.6.27, glibc 2.9. */
+ if (errno == ENOSYS) {
+ try_dup3 = 0;
+ ret = dup2(oldfd, newfd);
+ }
+ }
+ else {
+ ret = dup2(oldfd, newfd);
+ }
+#else
+ ret = dup2(oldfd, newfd);
+# ifdef _WIN32
+ if (newfd >= 0 && newfd <= 2)
+ SetStdHandle(newfd == 0 ? STD_INPUT_HANDLE : newfd == 1 ? STD_OUTPUT_HANDLE : STD_ERROR_HANDLE, (HANDLE)rb_w32_get_osfhandle(newfd));
+# endif
+#endif
+ if (ret == -1) return -1;
+ }
+ rb_maygvl_fd_fix_cloexec(ret);
+ return ret;
+}
+
+int
+rb_cloexec_pipe(int fildes[2])
+{
+ int ret;
+
+#if defined(HAVE_PIPE2)
+ static int try_pipe2 = 1;
+ if (try_pipe2) {
+ ret = pipe2(fildes, O_CLOEXEC);
+ if (ret != -1)
+ return ret;
+ /* pipe2 is available since Linux 2.6.27, glibc 2.9. */
+ if (errno == ENOSYS) {
+ try_pipe2 = 0;
+ ret = pipe(fildes);
+ }
+ }
+ else {
+ ret = pipe(fildes);
+ }
+#else
+ ret = pipe(fildes);
+#endif
+ if (ret == -1) return -1;
+#ifdef __CYGWIN__
+ if (ret == 0 && fildes[1] == -1) {
+ close(fildes[0]);
+ fildes[0] = -1;
+ errno = ENFILE;
+ return -1;
+ }
+#endif
+ rb_maygvl_fd_fix_cloexec(fildes[0]);
+ rb_maygvl_fd_fix_cloexec(fildes[1]);
+ return ret;
+}
+
+int
+rb_cloexec_fcntl_dupfd(int fd, int minfd)
+{
+ int ret;
+
+#if defined(HAVE_FCNTL) && defined(F_DUPFD_CLOEXEC)
+ static int try_dupfd_cloexec = 1;
+ if (try_dupfd_cloexec) {
+ ret = fcntl(fd, F_DUPFD_CLOEXEC, minfd);
+ if (ret != -1) {
+ if (ret <= 2)
+ rb_maygvl_fd_fix_cloexec(ret);
+ return ret;
+ }
+ /* F_DUPFD_CLOEXEC is available since Linux 2.6.24. Linux 2.6.18 fails with EINVAL */
+ if (errno == EINVAL) {
+ ret = fcntl(fd, F_DUPFD, minfd);
+ if (ret != -1) {
+ try_dupfd_cloexec = 0;
+ }
+ }
+ }
+ else {
+ ret = fcntl(fd, F_DUPFD, minfd);
+ }
+#else
+ ret = fcntl(fd, F_DUPFD, minfd);
+#endif
+ if (ret == -1) return -1;
+ rb_maygvl_fd_fix_cloexec(ret);
+ return ret;
+}
+
#define argf_of(obj) (*(struct argf *)DATA_PTR(obj))
#define ARGF argf_of(argf)
@@ -193,7 +357,7 @@ rb_update_max_fd(int fd)
#if defined(_WIN32)
#define WAIT_FD_IN_WIN32(fptr) \
- (rb_w32_has_cancel_io() ? 0 : rb_thread_wait_fd((fptr)->fd))
+ (rb_w32_io_cancelable_p((fptr)->fd) ? 0 : rb_thread_wait_fd((fptr)->fd))
#else
#define WAIT_FD_IN_WIN32(fptr)
#endif
@@ -219,25 +383,163 @@ rb_update_max_fd(int fd)
# endif
#endif
+#define rb_sys_fail_path(path) rb_sys_fail_str(path)
+
+static int io_fflush(rb_io_t *);
+static rb_io_t *flush_before_seek(rb_io_t *fptr);
+
#define NEED_NEWLINE_DECORATOR_ON_READ(fptr) ((fptr)->mode & FMODE_TEXTMODE)
#define NEED_NEWLINE_DECORATOR_ON_WRITE(fptr) ((fptr)->mode & FMODE_TEXTMODE)
#if defined(RUBY_TEST_CRLF_ENVIRONMENT) || defined(_WIN32)
/* Windows */
# define DEFAULT_TEXTMODE FMODE_TEXTMODE
# define TEXTMODE_NEWLINE_DECORATOR_ON_WRITE ECONV_CRLF_NEWLINE_DECORATOR
+/*
+ * CRLF newline is set as default newline decorator.
+ * If only CRLF newline conversion is needed, we use binary IO process
+ * with OS's text mode for IO performance improvement.
+ * If encoding conversion is needed or a user sets text mode, we use encoding
+ * conversion IO process and universal newline decorator by default.
+ */
+#define NEED_READCONV(fptr) ((fptr)->encs.enc2 != NULL || (fptr)->encs.ecflags & ~ECONV_CRLF_NEWLINE_DECORATOR)
+#define NEED_WRITECONV(fptr) (((fptr)->encs.enc != NULL && (fptr)->encs.enc != rb_ascii8bit_encoding()) || ((fptr)->encs.ecflags & ((ECONV_DECORATOR_MASK & ~ECONV_CRLF_NEWLINE_DECORATOR)|ECONV_STATEFUL_DECORATOR_MASK)))
+#define SET_BINARY_MODE(fptr) setmode((fptr)->fd, O_BINARY)
+
+#define NEED_NEWLINE_DECORATOR_ON_READ_CHECK(fptr) do {\
+ if (NEED_NEWLINE_DECORATOR_ON_READ(fptr)) {\
+ if (((fptr)->mode & FMODE_READABLE) &&\
+ !((fptr)->encs.ecflags & ECONV_NEWLINE_DECORATOR_MASK)) {\
+ setmode((fptr)->fd, O_BINARY);\
+ }\
+ else {\
+ setmode((fptr)->fd, O_TEXT);\
+ }\
+ }\
+} while(0)
+
+#define SET_UNIVERSAL_NEWLINE_DECORATOR_IF_ENC2(enc2, ecflags) do {\
+ if ((enc2) && ((ecflags) & ECONV_DEFAULT_NEWLINE_DECORATOR)) {\
+ (ecflags) |= ECONV_UNIVERSAL_NEWLINE_DECORATOR;\
+ }\
+} while(0)
+
+/*
+ * IO unread with taking care of removed '\r' in text mode.
+ */
+static void
+io_unread(rb_io_t *fptr)
+{
+ off_t r, pos;
+ ssize_t read_size;
+ long i;
+ long newlines = 0;
+ long extra_max;
+ char *p;
+ char *buf;
+
+ rb_io_check_closed(fptr);
+ if (fptr->rbuf.len == 0 || fptr->mode & FMODE_DUPLEX) {
+ return;
+ }
+
+ errno = 0;
+ if (!rb_w32_fd_is_text(fptr->fd)) {
+ r = lseek(fptr->fd, -fptr->rbuf.len, SEEK_CUR);
+ if (r < 0 && errno) {
+ if (errno == ESPIPE)
+ fptr->mode |= FMODE_DUPLEX;
+ return;
+ }
+
+ fptr->rbuf.off = 0;
+ fptr->rbuf.len = 0;
+ return;
+ }
+
+ pos = lseek(fptr->fd, 0, SEEK_CUR);
+ if (pos < 0 && errno) {
+ if (errno == ESPIPE)
+ fptr->mode |= FMODE_DUPLEX;
+ return;
+ }
+
+ /* add extra offset for removed '\r' in rbuf */
+ extra_max = (long)(pos - fptr->rbuf.len);
+ p = fptr->rbuf.ptr + fptr->rbuf.off;
+
+ /* if the end of rbuf is '\r', rbuf doesn't have '\r' within rbuf.len */
+ if (*(fptr->rbuf.ptr + fptr->rbuf.capa - 1) == '\r') {
+ newlines++;
+ }
+
+ for (i = 0; i < fptr->rbuf.len; i++) {
+ if (*p == '\n') newlines++;
+ if (extra_max == newlines) break;
+ p++;
+ }
+
+ buf = ALLOC_N(char, fptr->rbuf.len + newlines);
+ while (newlines >= 0) {
+ r = lseek(fptr->fd, pos - fptr->rbuf.len - newlines, SEEK_SET);
+ if (newlines == 0) break;
+ if (r < 0) {
+ newlines--;
+ continue;
+ }
+ read_size = _read(fptr->fd, buf, fptr->rbuf.len + newlines);
+ if (read_size < 0) {
+ free(buf);
+ rb_sys_fail_path(fptr->pathv);
+ }
+ if (read_size == fptr->rbuf.len) {
+ lseek(fptr->fd, r, SEEK_SET);
+ break;
+ }
+ else {
+ newlines--;
+ }
+ }
+ free(buf);
+ fptr->rbuf.off = 0;
+ fptr->rbuf.len = 0;
+ return;
+}
+
+/*
+ * We use io_seek to back cursor position when changing mode from text to binary,
+ * but stdin and pipe cannot seek back. Stdin and pipe read should use encoding
+ * conversion for working properly with mode change.
+ *
+ * Return previous translation mode.
+ */
+static inline int
+set_binary_mode_with_seek_cur(rb_io_t *fptr)
+{
+ if (!rb_w32_fd_is_text(fptr->fd)) return O_BINARY;
+
+ if (fptr->rbuf.len == 0 || fptr->mode & FMODE_DUPLEX) {
+ return setmode(fptr->fd, O_BINARY);
+ }
+ flush_before_seek(fptr);
+ return setmode(fptr->fd, O_BINARY);
+}
+#define SET_BINARY_MODE_WITH_SEEK_CUR(fptr) set_binary_mode_with_seek_cur(fptr)
+
#else
/* Unix */
# define DEFAULT_TEXTMODE 0
-#endif
#define NEED_READCONV(fptr) ((fptr)->encs.enc2 != NULL || NEED_NEWLINE_DECORATOR_ON_READ(fptr))
#define NEED_WRITECONV(fptr) (((fptr)->encs.enc != NULL && (fptr)->encs.enc != rb_ascii8bit_encoding()) || NEED_NEWLINE_DECORATOR_ON_WRITE(fptr) || ((fptr)->encs.ecflags & (ECONV_DECORATOR_MASK|ECONV_STATEFUL_DECORATOR_MASK)))
+#define SET_BINARY_MODE(fptr) (void)(fptr)
+#define NEED_NEWLINE_DECORATOR_ON_READ_CHECK(fptr) (void)(fptr)
+#define SET_UNIVERSAL_NEWLINE_DECORATOR_IF_ENC2(enc2, ecflags) ((void)(enc2), (void)(ecflags))
+#define SET_BINARY_MODE_WITH_SEEK_CUR(fptr) (void)(fptr)
+#endif
#if !defined HAVE_SHUTDOWN && !defined shutdown
#define shutdown(a,b) 0
#endif
-#define rb_sys_fail_path(path) rb_sys_fail(NIL_P(path) ? 0 : RSTRING_PTR(path))
-
#if defined(_WIN32)
#define is_socket(fd, path) rb_w32_is_socket(fd)
#elif !defined(S_ISSOCK)
@@ -285,7 +587,6 @@ rb_io_check_closed(rb_io_t *fptr)
}
}
-static int io_fflush(rb_io_t *);
VALUE
rb_io_get_io(VALUE io)
@@ -293,7 +594,7 @@ rb_io_get_io(VALUE io)
return rb_convert_type(io, T_FILE, "IO", "to_io");
}
-static VALUE
+VALUE
rb_io_check_io(VALUE io)
{
return rb_check_convert_type(io, T_FILE, "IO", "to_io");
@@ -350,6 +651,7 @@ rb_io_s_try_convert(VALUE dummy, VALUE io)
return rb_io_check_io(io);
}
+#if !(defined(RUBY_TEST_CRLF_ENVIRONMENT) || defined(_WIN32))
static void
io_unread(rb_io_t *fptr)
{
@@ -369,6 +671,7 @@ io_unread(rb_io_t *fptr)
fptr->rbuf.len = 0;
return;
}
+#endif
static rb_encoding *io_input_encoding(rb_io_t *fptr);
@@ -424,8 +727,6 @@ flush_before_seek(rb_io_t *fptr)
# define SEEK_END 2
#endif
-#define FMODE_SYNCWRITE (FMODE_SYNC|FMODE_WRITABLE)
-
void
rb_io_check_char_readable(rb_io_t *fptr)
{
@@ -521,11 +822,11 @@ ruby_dup(int orig)
{
int fd;
- fd = dup(orig);
+ fd = rb_cloexec_dup(orig);
if (fd < 0) {
if (errno == EMFILE || errno == ENFILE || errno == ENOMEM) {
rb_gc();
- fd = dup(orig);
+ fd = rb_cloexec_dup(orig);
}
if (fd < 0) {
rb_sys_fail(0);
@@ -538,8 +839,7 @@ ruby_dup(int orig)
static VALUE
io_alloc(VALUE klass)
{
- NEWOBJ(io, struct RFile);
- OBJSETUP(io, klass, T_FILE);
+ NEWOBJ_OF(io, struct RFile, klass, T_FILE);
io->fptr = 0;
@@ -676,19 +976,12 @@ io_fflush(rb_io_t *fptr)
rb_io_check_closed(fptr);
if (fptr->wbuf.len == 0)
return 0;
- if (!rb_thread_fd_writable(fptr->fd)) {
- rb_io_check_closed(fptr);
- }
+ rb_io_check_closed(fptr);
while (fptr->wbuf.len > 0 && io_flush_buffer(fptr) != 0) {
if (!rb_io_wait_writable(fptr->fd))
return -1;
rb_io_check_closed(fptr);
}
-#ifdef _WIN32
- if (GetFileType((HANDLE)rb_w32_get_osfhandle(fptr->fd)) == FILE_TYPE_DISK) {
- fsync(fptr->fd);
- }
-#endif
return 0;
}
@@ -755,13 +1048,8 @@ make_writeconv(rb_io_t *fptr)
fptr->writeconv_initialized = 1;
- ecflags = fptr->encs.ecflags;
+ ecflags = fptr->encs.ecflags & ~ECONV_NEWLINE_DECORATOR_READ_MASK;
ecopts = fptr->encs.ecopts;
-#ifdef TEXTMODE_NEWLINE_DECORATOR_ON_WRITE
- if (NEED_NEWLINE_DECORATOR_ON_WRITE(fptr) &&
- !(ecflags & ECONV_NEWLINE_DECORATOR_MASK))
- ecflags |= TEXTMODE_NEWLINE_DECORATOR_ON_WRITE;
-#endif
if (!fptr->encs.enc || (fptr->encs.enc == rb_ascii8bit_encoding() && !fptr->encs.enc2)) {
/* no encoding conversion */
@@ -838,12 +1126,18 @@ io_binwrite(VALUE str, const char *ptr, long len, rb_io_t *fptr, int nosync)
fptr->wbuf.capa = IO_WBUF_CAPA_MIN;
fptr->wbuf.ptr = ALLOC_N(char, fptr->wbuf.capa);
fptr->write_lock = rb_mutex_new();
+ rb_mutex_allow_trap(fptr->write_lock, 1);
}
if ((!nosync && (fptr->mode & (FMODE_SYNC|FMODE_TTY))) ||
(fptr->wbuf.ptr && fptr->wbuf.capa <= fptr->wbuf.len + len)) {
struct binwrite_arg arg;
- /* xxx: use writev to avoid double write if available */
+ /*
+ * xxx: use writev to avoid double write if available
+ * writev may help avoid context switch between "a" and "\n" in
+ * STDERR.puts "a" [ruby-dev:25080] (rebroken since native threads
+ * introduced in 1.9)
+ */
if (fptr->wbuf.len && fptr->wbuf.len+len <= fptr->wbuf.capa) {
if (fptr->wbuf.capa < fptr->wbuf.off+fptr->wbuf.len+len) {
MEMMOVE(fptr->wbuf.ptr, fptr->wbuf.ptr+fptr->wbuf.off, char, fptr->wbuf.len);
@@ -857,11 +1151,8 @@ io_binwrite(VALUE str, const char *ptr, long len, rb_io_t *fptr, int nosync)
return -1L;
if (n == 0)
return len;
- /* avoid context switch between "a" and "\n" in STDERR.puts "a".
- [ruby-dev:25080] */
- if (fptr->stdio_file != stderr && !rb_thread_fd_writable(fptr->fd)) {
- rb_io_check_closed(fptr);
- }
+
+ rb_io_check_closed(fptr);
arg.fptr = fptr;
arg.str = str;
retry:
@@ -899,21 +1190,26 @@ io_binwrite(VALUE str, const char *ptr, long len, rb_io_t *fptr, int nosync)
return len;
}
+# define MODE_BTMODE(a,b,c) ((fmode & FMODE_BINMODE) ? (b) : \
+ (fmode & FMODE_TEXTMODE) ? (c) : (a))
static VALUE
do_writeconv(VALUE str, rb_io_t *fptr)
{
if (NEED_WRITECONV(fptr)) {
VALUE common_encoding = Qnil;
+ SET_BINARY_MODE(fptr);
make_writeconv(fptr);
if (fptr->writeconv) {
+#define fmode (fptr->mode)
if (!NIL_P(fptr->writeconv_asciicompat))
common_encoding = fptr->writeconv_asciicompat;
- else if (!rb_enc_asciicompat(rb_enc_get(str))) {
+ else if (MODE_BTMODE(DEFAULT_TEXTMODE,0,1) && !rb_enc_asciicompat(rb_enc_get(str))) {
rb_raise(rb_eArgError, "ASCII incompatible string written for text mode IO without encoding conversion: %s",
rb_enc_name(rb_enc_get(str)));
}
+#undef fmode
}
else {
if (fptr->encs.enc2)
@@ -931,6 +1227,23 @@ do_writeconv(VALUE str, rb_io_t *fptr)
str = rb_econv_str_convert(fptr->writeconv, str, ECONV_PARTIAL_INPUT);
}
}
+#if defined(RUBY_TEST_CRLF_ENVIRONMENT) || defined(_WIN32)
+#define fmode (fptr->mode)
+ else if (MODE_BTMODE(DEFAULT_TEXTMODE,0,1)) {
+ if ((fptr->mode & FMODE_READABLE) &&
+ !(fptr->encs.ecflags & ECONV_NEWLINE_DECORATOR_MASK)) {
+ setmode(fptr->fd, O_BINARY);
+ }
+ else {
+ setmode(fptr->fd, O_TEXT);
+ }
+ if (!rb_enc_asciicompat(rb_enc_get(str))) {
+ rb_raise(rb_eArgError, "ASCII incompatible string written for text mode IO without encoding conversion: %s",
+ rb_enc_name(rb_enc_get(str)));
+ }
+ }
+#undef fmode
+#endif
return str;
}
@@ -938,8 +1251,10 @@ static long
io_fwrite(VALUE str, rb_io_t *fptr, int nosync)
{
#ifdef _WIN32
- long len = rb_w32_write_console(str, fptr->fd);
- if (len > 0) return len;
+ if (fptr->mode & FMODE_TTY) {
+ long len = rb_w32_write_console(str, fptr->fd);
+ if (len > 0) return len;
+ }
#endif
str = do_writeconv(str, fptr);
return io_binwrite(str, RSTRING_PTR(str), RSTRING_LEN(str),
@@ -974,6 +1289,8 @@ io_write(VALUE io, VALUE str, int nosync)
io = tmp;
if (RSTRING_LEN(str) == 0) return INT2FIX(0);
+ str = rb_str_new_frozen(str);
+
GetOpenFile(io, fptr);
rb_io_check_writable(fptr);
@@ -1036,6 +1353,16 @@ rb_io_addstr(VALUE io, VALUE str)
return io;
}
+#ifdef HAVE_FSYNC
+static VALUE
+nogvl_fsync(void *ptr)
+{
+ rb_io_t *fptr = ptr;
+
+ return (VALUE)fsync(fptr->fd);
+}
+#endif
+
/*
* call-seq:
* ios.flush -> ios
@@ -1057,7 +1384,7 @@ rb_io_flush(VALUE io)
{
rb_io_t *fptr;
- if (TYPE(io) != T_FILE) {
+ if (!RB_TYPE_P(io, T_FILE)) {
return rb_funcall(io, id_flush, 0);
}
@@ -1067,6 +1394,11 @@ rb_io_flush(VALUE io)
if (fptr->mode & FMODE_WRITABLE) {
if (io_fflush(fptr) < 0)
rb_sys_fail(0);
+#ifdef _WIN32
+ if (GetFileType((HANDLE)rb_w32_get_osfhandle(fptr->fd)) == FILE_TYPE_DISK) {
+ rb_thread_io_blocking_region(nogvl_fsync, fptr, fptr->fd);
+ }
+#endif
}
if (fptr->mode & FMODE_READABLE) {
io_unread(fptr);
@@ -1154,6 +1486,8 @@ rb_io_seek_m(int argc, VALUE *argv, VALUE io)
* ios.pos = integer -> integer
*
* Seeks to the given position (in bytes) in <em>ios</em>.
+ * It is not guranteed that seeking to the right position when <em>ios</em>
+ * is textmode.
*
* f = File.new("testfile")
* f.pos = 17
@@ -1199,6 +1533,11 @@ rb_io_rewind(VALUE io)
GetOpenFile(io, fptr);
if (io_seek(fptr, 0L, 0) < 0 && errno) rb_sys_fail_path(fptr->pathv);
+#ifdef _WIN32
+ if (GetFileType((HANDLE)rb_w32_get_osfhandle(fptr->fd)) == FILE_TYPE_DISK) {
+ fsync(fptr->fd);
+ }
+#endif
if (io == ARGF.current_file) {
ARGF.lineno -= fptr->lineno;
}
@@ -1287,6 +1626,11 @@ rb_io_eof(VALUE io)
if (READ_CHAR_PENDING(fptr)) return Qfalse;
if (READ_DATA_PENDING(fptr)) return Qfalse;
READ_CHECK(fptr);
+#if defined(RUBY_TEST_CRLF_ENVIRONMENT) || defined(_WIN32)
+ if (!NEED_READCONV(fptr) && NEED_NEWLINE_DECORATOR_ON_READ(fptr)) {
+ return eof(fptr->fd) ? Qtrue : Qfalse;
+ }
+#endif
if (io_fillbuf(fptr) < 0) {
return Qtrue;
}
@@ -1316,6 +1660,8 @@ rb_io_sync(VALUE io)
return (fptr->mode & FMODE_SYNC) ? Qtrue : Qfalse;
}
+#ifdef HAVE_FSYNC
+
/*
* call-seq:
* ios.sync = boolean -> boolean
@@ -1347,7 +1693,6 @@ rb_io_set_sync(VALUE io, VALUE sync)
return sync;
}
-#ifdef HAVE_FSYNC
/*
* call-seq:
* ios.fsync -> 0 or nil
@@ -1355,7 +1700,7 @@ rb_io_set_sync(VALUE io, VALUE sync)
* Immediately writes all buffered data in <em>ios</em> to disk.
* Note that <code>fsync</code> differs from
* using <code>IO#sync=</code>. The latter ensures that data is flushed
- * from Ruby's buffers, but doesn't not guarantee that the underlying
+ * from Ruby's buffers, but does not guarantee that the underlying
* operating system actually writes it to disk.
*
* <code>NotImplementedError</code> is raised
@@ -1372,17 +1717,32 @@ rb_io_fsync(VALUE io)
if (io_fflush(fptr) < 0)
rb_sys_fail(0);
-#ifndef _WIN32 /* already called in io_fflush() */
- if (fsync(fptr->fd) < 0)
+# ifndef _WIN32 /* already called in io_fflush() */
+ if ((int)rb_thread_io_blocking_region(nogvl_fsync, fptr, fptr->fd) < 0)
rb_sys_fail_path(fptr->pathv);
-#endif
+# endif
return INT2FIX(0);
}
#else
-#define rb_io_fsync rb_f_notimplement
+# define rb_io_fsync rb_f_notimplement
+# define rb_io_sync rb_f_notimplement
+static VALUE
+rb_io_set_sync(VALUE io, VALUE sync)
+{
+ rb_notimplement();
+ UNREACHABLE;
+}
#endif
#ifdef HAVE_FDATASYNC
+static VALUE
+nogvl_fdatasync(void *ptr)
+{
+ rb_io_t *fptr = ptr;
+
+ return (VALUE)fdatasync(fptr->fd);
+}
+
/*
* call-seq:
* ios.fdatasync -> 0 or nil
@@ -1405,7 +1765,7 @@ rb_io_fdatasync(VALUE io)
if (io_fflush(fptr) < 0)
rb_sys_fail(0);
- if (fdatasync(fptr->fd) == 0)
+ if ((int)rb_thread_io_blocking_region(nogvl_fdatasync, fptr, fptr->fd) == 0)
return INT2FIX(0);
/* fall back */
@@ -1482,31 +1842,29 @@ static VALUE
rb_io_inspect(VALUE obj)
{
rb_io_t *fptr;
- const char *cname;
- char fd_desc[4+sizeof(int)*3];
- const char *path;
- const char *st = "";
+ VALUE result;
+ static const char closed[] = " (closed)";
fptr = RFILE(rb_io_taint_check(obj))->fptr;
if (!fptr) return rb_any_to_s(obj);
- cname = rb_obj_classname(obj);
+ result = rb_str_new_cstr("#<");
+ rb_str_append(result, rb_class_name(CLASS_OF(obj)));
+ rb_str_cat2(result, ":");
if (NIL_P(fptr->pathv)) {
if (fptr->fd < 0) {
- path = "";
- st = "(closed)";
+ rb_str_cat(result, closed+1, strlen(closed)-1);
}
else {
- snprintf(fd_desc, sizeof(fd_desc), "fd %d", fptr->fd);
- path = fd_desc;
+ rb_str_catf(result, "fd %d", fptr->fd);
}
}
else {
- path = RSTRING_PTR(fptr->pathv);
+ rb_str_append(result, fptr->pathv);
if (fptr->fd < 0) {
- st = " (closed)";
+ rb_str_cat(result, closed, strlen(closed));
}
}
- return rb_sprintf("#<%s:%s%s>", cname, path, st);
+ return rb_str_cat2(result, ">");
}
/*
@@ -1556,7 +1914,6 @@ io_bufread(char *ptr, long len, rb_io_t *fptr)
}
offset += c;
if ((n -= c) <= 0) break;
- rb_thread_wait_fd(fptr->fd);
}
return len - n;
}
@@ -1567,7 +1924,6 @@ io_bufread(char *ptr, long len, rb_io_t *fptr)
offset += c;
if ((n -= c) <= 0) break;
}
- rb_thread_wait_fd(fptr->fd);
rb_io_check_closed(fptr);
if (io_fillbuf(fptr) < 0) {
break;
@@ -1576,14 +1932,16 @@ io_bufread(char *ptr, long len, rb_io_t *fptr)
return len - n;
}
+static void io_setstrbuf(VALUE *str, long len);
+
static long
-io_fread(VALUE str, long offset, rb_io_t *fptr)
+io_fread(VALUE str, long offset, long size, rb_io_t *fptr)
{
long len;
+ io_setstrbuf(&str, offset + size);
rb_str_locktmp(str);
- len = io_bufread(RSTRING_PTR(str) + offset, RSTRING_LEN(str) - offset,
- fptr);
+ len = io_bufread(RSTRING_PTR(str) + offset, size, fptr);
rb_str_unlocktmp(str);
if (len < 0) rb_sys_fail_path(fptr->pathv);
return len;
@@ -1645,7 +2003,7 @@ make_readconv(rb_io_t *fptr, int size)
int ecflags;
VALUE ecopts;
const char *sname, *dname;
- ecflags = fptr->encs.ecflags;
+ ecflags = fptr->encs.ecflags & ~ECONV_NEWLINE_DECORATOR_WRITE_MASK;
ecopts = fptr->encs.ecopts;
if (fptr->encs.enc2) {
sname = rb_enc_name(fptr->encs.enc2);
@@ -1779,29 +2137,36 @@ io_shift_cbuf(rb_io_t *fptr, int len, VALUE *strp)
}
static void
-io_setstrbuf(VALUE *str,long len)
+io_setstrbuf(VALUE *str, long len)
{
#ifdef _WIN32
+ len = (len + 1) & ~1L; /* round up for wide char */
+#endif
if (NIL_P(*str)) {
- *str = rb_str_new(0, len+1);
- rb_str_set_len(*str,len);
+ *str = rb_str_new(0, 0);
}
else {
- StringValue(*str);
- rb_str_modify(*str);
- rb_str_resize(*str, len+1);
- rb_str_set_len(*str,len);
- }
-#else
- if (NIL_P(*str)) {
- *str = rb_str_new(0, len);
+ VALUE s = StringValue(*str);
+ long clen = RSTRING_LEN(s);
+ if (clen >= len) {
+ if (clen != len) {
+ rb_str_modify(s);
+ rb_str_set_len(s, len);
+ }
+ return;
+ }
+ len -= clen;
}
- else {
- StringValue(*str);
- rb_str_modify(*str);
- rb_str_resize(*str, len);
+ rb_str_modify_expand(*str, len);
+}
+
+static void
+io_set_read_length(VALUE str, long n)
+{
+ if (RSTRING_LEN(str) != n) {
+ rb_str_modify(str);
+ rb_str_set_len(str, n);
}
-#endif
}
static VALUE
@@ -1814,6 +2179,7 @@ read_all(rb_io_t *fptr, long siz, VALUE str)
int cr;
if (NEED_READCONV(fptr)) {
+ SET_BINARY_MODE(fptr);
io_setstrbuf(&str,0);
make_readconv(fptr, 0);
while (1) {
@@ -1835,6 +2201,7 @@ read_all(rb_io_t *fptr, long siz, VALUE str)
}
}
+ NEED_NEWLINE_DECORATOR_ON_READ_CHECK(fptr);
bytes = 0;
pos = 0;
@@ -1845,18 +2212,19 @@ read_all(rb_io_t *fptr, long siz, VALUE str)
io_setstrbuf(&str,siz);
for (;;) {
READ_CHECK(fptr);
- n = io_fread(str, bytes, fptr);
+ n = io_fread(str, bytes, siz - bytes, fptr);
if (n == 0 && bytes == 0) {
+ rb_str_set_len(str, 0);
break;
}
bytes += n;
+ rb_str_set_len(str, bytes);
if (cr != ENC_CODERANGE_BROKEN)
pos += rb_str_coderange_scan_restartable(RSTRING_PTR(str) + pos, RSTRING_PTR(str) + bytes, enc, &cr);
if (bytes < siz) break;
siz += BUFSIZ;
- rb_str_resize(str, siz);
+ rb_str_modify_expand(str, BUFSIZ);
}
- if (bytes != siz) rb_str_resize(str, bytes);
str = io_enc_str(str, fptr);
ENC_CODERANGE_SET(str, cr);
return str;
@@ -1912,6 +2280,7 @@ io_getpartial(int argc, VALUE *argv, VALUE io, int nonblock)
if (nonblock) {
rb_io_set_nonblock(fptr);
}
+ io_setstrbuf(&str, len);
rb_str_locktmp(str);
n = rb_read_internal(fptr->fd, RSTRING_PTR(str), len);
rb_str_unlocktmp(str);
@@ -1923,7 +2292,7 @@ io_getpartial(int argc, VALUE *argv, VALUE io, int nonblock)
rb_sys_fail_path(fptr->pathv);
}
}
- rb_str_resize(str, n);
+ io_set_read_length(str, n);
if (n == 0)
return Qnil;
@@ -1941,6 +2310,8 @@ io_getpartial(int argc, VALUE *argv, VALUE io, int nonblock)
* It doesn't block if some data available.
* If the optional <i>outbuf</i> argument is present,
* it must reference a String, which will receive the data.
+ * The <i>outbuf</i> will contain only the received data after the method call
+ * even if it is not empty at the beginning.
* It raises <code>EOFError</code> on end of file.
*
* readpartial is designed for streams such as pipe, socket, tty, etc.
@@ -1996,8 +2367,7 @@ io_readpartial(int argc, VALUE *argv, VALUE io)
ret = io_getpartial(argc, argv, io, 0);
if (NIL_P(ret))
rb_eof_error();
- else
- return ret;
+ return ret;
}
/*
@@ -2011,6 +2381,8 @@ io_readpartial(int argc, VALUE *argv, VALUE io)
*
* If the optional <i>outbuf</i> argument is present,
* it must reference a String, which will receive the data.
+ * The <i>outbuf</i> will contain only the received data after the method call
+ * even if it is not empty at the beginning.
*
* read_nonblock just calls the read(2) system call.
* It causes all errors the read(2) system call causes: Errno::EWOULDBLOCK, Errno::EINTR, etc.
@@ -2057,8 +2429,7 @@ io_read_nonblock(int argc, VALUE *argv, VALUE io)
ret = io_getpartial(argc, argv, io, 1);
if (NIL_P(ret))
rb_eof_error();
- else
- return ret;
+ return ret;
}
/*
@@ -2121,7 +2492,7 @@ rb_io_write_nonblock(VALUE io, VALUE str)
long n;
rb_secure(4);
- if (TYPE(str) != T_STRING)
+ if (!RB_TYPE_P(str, T_STRING))
str = rb_obj_as_string(str);
io = GetWriteIO(io);
@@ -2145,7 +2516,7 @@ rb_io_write_nonblock(VALUE io, VALUE str)
/*
* call-seq:
- * ios.read([length [, buffer]]) -> string, buffer, or nil
+ * ios.read([length [, outbuf]]) -> string, outbuf, or nil
*
* Reads <i>length</i> bytes from the I/O stream.
*
@@ -2165,8 +2536,10 @@ rb_io_write_nonblock(VALUE io, VALUE str)
*
* If <i>length</i> is zero, it returns <code>""</code>.
*
- * If the optional <i>buffer</i> argument is present, it must reference
+ * If the optional <i>outbuf</i> argument is present, it must reference
* a String, which will receive the data.
+ * The <i>outbuf</i> will contain only the received data after the method call
+ * even if it is not empty at the beginning.
*
* At end of file, it returns <code>nil</code> or <code>""</code>
* depend on <i>length</i>.
@@ -2200,7 +2573,10 @@ rb_io_write_nonblock(VALUE io, VALUE str)
* }
*
* Note that this method behaves like fread() function in C.
- * If you need the behavior like read(2) system call,
+ * This means it retry to invoke read(2) system call to read data with the specified length (or until EOF).
+ * This behavior is preserved even if <i>ios</i> is non-blocking mode.
+ * (This method is non-blocking flag insensitive as other methods.)
+ * If you need the behavior like single read(2) system call,
* consider readpartial, read_nonblock and sysread.
*/
@@ -2210,6 +2586,9 @@ io_read(int argc, VALUE *argv, VALUE io)
rb_io_t *fptr;
long n, len;
VALUE length, str;
+#if defined(RUBY_TEST_CRLF_ENVIRONMENT) || defined(_WIN32)
+ int previous_mode;
+#endif
rb_scan_args(argc, argv, "02", &length, &str);
@@ -2230,13 +2609,17 @@ io_read(int argc, VALUE *argv, VALUE io)
if (len == 0) return str;
READ_CHECK(fptr);
- n = io_fread(str, 0, fptr);
- if (n == 0) {
- if (fptr->fd < 0) return Qnil;
- rb_str_resize(str, 0);
- return Qnil;
+#if defined(RUBY_TEST_CRLF_ENVIRONMENT) || defined(_WIN32)
+ previous_mode = set_binary_mode_with_seek_cur(fptr);
+#endif
+ n = io_fread(str, 0, len, fptr);
+ io_set_read_length(str, n);
+#if defined(RUBY_TEST_CRLF_ENVIRONMENT) || defined(_WIN32)
+ if (previous_mode == O_TEXT) {
+ setmode(fptr->fd, O_TEXT);
}
- rb_str_resize(str, n);
+#endif
+ if (n == 0) return Qnil;
OBJ_TAINT(str);
return str;
@@ -2257,6 +2640,7 @@ appendline(rb_io_t *fptr, int delim, VALUE *strp, long *lp)
long limit = *lp;
if (NEED_READCONV(fptr)) {
+ SET_BINARY_MODE(fptr);
make_readconv(fptr, 0);
do {
const char *p, *e;
@@ -2299,6 +2683,7 @@ appendline(rb_io_t *fptr, int delim, VALUE *strp, long *lp)
return EOF;
}
+ NEED_NEWLINE_DECORATOR_ON_READ_CHECK(fptr);
do {
long pending = READ_DATA_PENDING_COUNT(fptr);
if (pending > 0) {
@@ -2337,6 +2722,7 @@ swallow(rb_io_t *fptr, int term)
if (NEED_READCONV(fptr)) {
rb_encoding *enc = io_read_encoding(fptr);
int needconv = rb_enc_mbminlen(enc) != 1;
+ SET_BINARY_MODE(fptr);
make_readconv(fptr, 0);
do {
size_t cnt;
@@ -2360,6 +2746,7 @@ swallow(rb_io_t *fptr, int term)
return FALSE;
}
+ NEED_NEWLINE_DECORATOR_ON_READ_CHECK(fptr);
do {
size_t cnt;
while ((cnt = READ_DATA_PENDING_COUNT(fptr)) > 0) {
@@ -2496,6 +2883,7 @@ rb_io_getline_1(VALUE rs, long limit, VALUE io)
}
else if (rs == rb_default_rs && limit < 0 && !NEED_READCONV(fptr) &&
rb_enc_asciicompat(enc = io_read_encoding(fptr))) {
+ NEED_NEWLINE_DECORATOR_ON_READ_CHECK(fptr);
return rb_io_getline_fast(fptr, enc, io);
}
else {
@@ -2505,6 +2893,7 @@ rb_io_getline_1(VALUE rs, long limit, VALUE io)
int rspara = 0;
int extra_limit = 16;
+ SET_BINARY_MODE(fptr);
enc = io_read_encoding(fptr);
if (!NIL_P(rs)) {
@@ -2823,15 +3212,14 @@ static VALUE
rb_io_each_byte(VALUE io)
{
rb_io_t *fptr;
- char *p, *e;
RETURN_ENUMERATOR(io, 0, 0);
GetOpenFile(io, fptr);
for (;;) {
while (fptr->rbuf.len > 0) {
- p = fptr->rbuf.ptr + fptr->rbuf.off++;
- e = p + fptr->rbuf.len--;
+ char *p = fptr->rbuf.ptr + fptr->rbuf.off++;
+ fptr->rbuf.len--;
rb_yield(INT2FIX(*p & 0xff));
errno = 0;
}
@@ -2854,6 +3242,7 @@ io_getc(rb_io_t *fptr, rb_encoding *enc)
VALUE str = Qnil;
rb_encoding *read_enc = io_read_encoding(fptr);
+ SET_BINARY_MODE(fptr);
make_readconv(fptr, 0);
while (1) {
@@ -2898,6 +3287,7 @@ io_getc(rb_io_t *fptr, rb_encoding *enc)
return str;
}
+ NEED_NEWLINE_DECORATOR_ON_READ_CHECK(fptr);
if (io_fillbuf(fptr) < 0) {
return Qnil;
}
@@ -3012,6 +3402,7 @@ rb_io_each_codepoint(VALUE io)
READ_CHECK(fptr);
if (NEED_READCONV(fptr)) {
+ SET_BINARY_MODE(fptr);
for (;;) {
make_readconv(fptr, 0);
for (;;) {
@@ -3052,6 +3443,7 @@ rb_io_each_codepoint(VALUE io)
rb_yield(UINT2NUM(c));
}
}
+ NEED_NEWLINE_DECORATOR_ON_READ_CHECK(fptr);
enc = io_input_encoding(fptr);
for (;;) {
if (io_fillbuf(fptr) < 0) {
@@ -3149,7 +3541,7 @@ rb_io_getbyte(VALUE io)
GetOpenFile(io, fptr);
rb_io_check_byte_readable(fptr);
READ_CHECK(fptr);
- if (fptr->fd == 0 && (fptr->mode & FMODE_TTY) && TYPE(rb_stdout) == T_FILE) {
+ if (fptr->fd == 0 && (fptr->mode & FMODE_TTY) && RB_TYPE_P(rb_stdout, T_FILE)) {
rb_io_t *ofp;
GetOpenFile(rb_stdout, ofp);
if (ofp->mode & FMODE_TTY) {
@@ -3248,13 +3640,14 @@ rb_io_ungetc(VALUE io, VALUE c)
if (FIXNUM_P(c)) {
c = rb_enc_uint_chr(FIX2UINT(c), io_read_encoding(fptr));
}
- else if (TYPE(c) == T_BIGNUM) {
+ else if (RB_TYPE_P(c, T_BIGNUM)) {
c = rb_enc_uint_chr(NUM2UINT(c), io_read_encoding(fptr));
}
else {
SafeStringValue(c);
}
if (NEED_READCONV(fptr)) {
+ SET_BINARY_MODE(fptr);
len = RSTRING_LEN(c);
#if SIZEOF_LONG > SIZEOF_INT
if (len > INT_MAX)
@@ -3274,6 +3667,7 @@ rb_io_ungetc(VALUE io, VALUE c)
MEMMOVE(fptr->cbuf.ptr+fptr->cbuf.off, RSTRING_PTR(c), char, len);
}
else {
+ NEED_NEWLINE_DECORATOR_ON_READ_CHECK(fptr);
io_ungetbyte(c, fptr);
}
return Qnil;
@@ -3470,10 +3864,51 @@ finish_writeconv_sync(VALUE arg)
return finish_writeconv(p->fptr, p->noalloc);
}
+static void*
+nogvl_close(void *ptr)
+{
+ int *fd = ptr;
+
+ return (void*)(intptr_t)close(*fd);
+}
+
+static int
+maygvl_close(int fd, int keepgvl)
+{
+ if (keepgvl)
+ return close(fd);
+
+ /*
+ * close() may block for certain file types (NFS, SO_LINGER sockets,
+ * inotify), so let other threads run.
+ */
+ return (int)(intptr_t)rb_thread_call_without_gvl(nogvl_close, &fd, RUBY_UBF_IO, 0);
+}
+
+static void*
+nogvl_fclose(void *ptr)
+{
+ FILE *file = ptr;
+
+ return (void*)(intptr_t)fclose(file);
+}
+
+static int
+maygvl_fclose(FILE *file, int keepgvl)
+{
+ if (keepgvl)
+ return fclose(file);
+
+ return (int)(intptr_t)rb_thread_call_without_gvl(nogvl_fclose, file, RUBY_UBF_IO, 0);
+}
+
static void
fptr_finalize(rb_io_t *fptr, int noraise)
{
VALUE err = Qnil;
+ int fd = fptr->fd;
+ FILE *stdio_file = fptr->stdio_file;
+
if (fptr->writeconv) {
if (fptr->write_lock && !noraise) {
struct finish_writeconv_arg arg;
@@ -3495,26 +3930,27 @@ fptr_finalize(rb_io_t *fptr, int noraise)
err = INT2NUM(errno);
}
}
- if (IS_PREP_STDIO(fptr) || fptr->fd <= 2) {
- goto skip_fd_close;
+
+ fptr->fd = -1;
+ fptr->stdio_file = 0;
+ fptr->mode &= ~(FMODE_READABLE|FMODE_WRITABLE);
+
+ if (IS_PREP_STDIO(fptr) || fd <= 2) {
+ /* need to keep FILE objects of stdin, stdout and stderr */
}
- if (fptr->stdio_file) {
- /* fptr->stdio_file is deallocated anyway
+ else if (stdio_file) {
+ /* stdio_file is deallocated anyway
* even if fclose failed. */
- if (fclose(fptr->stdio_file) < 0 && NIL_P(err))
- err = noraise ? Qtrue : INT2NUM(errno);
+ if ((maygvl_fclose(stdio_file, noraise) < 0) && NIL_P(err))
+ err = noraise ? Qtrue : INT2NUM(errno);
}
- else if (0 <= fptr->fd) {
- /* fptr->fd may be closed even if close fails.
+ else if (0 <= fd) {
+ /* fptr->fd may be closed even if close fails.
* POSIX doesn't specify it.
* We assumes it is closed. */
- if (close(fptr->fd) < 0 && NIL_P(err))
- err = noraise ? Qtrue : INT2NUM(errno);
+ if ((maygvl_close(fd, noraise) < 0) && NIL_P(err))
+ err = noraise ? Qtrue : INT2NUM(errno);
}
- skip_fd_close:
- fptr->fd = -1;
- fptr->stdio_file = 0;
- fptr->mode &= ~(FMODE_READABLE|FMODE_WRITABLE);
if (!NIL_P(err) && !noraise) {
switch(TYPE(err)) {
@@ -3626,16 +4062,11 @@ rb_io_close(VALUE io)
if (fptr->fd < 0) return Qnil;
fd = fptr->fd;
-#if defined __APPLE__ && defined(__MACH__) && \
- (!defined(MAC_OS_X_VERSION_MIN_ALLOWED) || MAC_OS_X_VERSION_MIN_ALLOWED <= 1050)
- /* close(2) on a fd which is being read by another thread causes
- * deadlock on Mac OS X 10.5 */
rb_thread_fd_close(fd);
-#endif
rb_io_fptr_cleanup(fptr, FALSE);
- rb_thread_fd_close(fd);
if (fptr->pid) {
+ rb_last_status_clear();
rb_syswait(fptr->pid);
fptr->pid = 0;
}
@@ -3891,19 +4322,18 @@ rb_io_syswrite(VALUE io, VALUE str)
long n;
rb_secure(4);
- if (TYPE(str) != T_STRING)
+ if (!RB_TYPE_P(str, T_STRING))
str = rb_obj_as_string(str);
io = GetWriteIO(io);
GetOpenFile(io, fptr);
rb_io_check_writable(fptr);
+ str = rb_str_new_frozen(str);
+
if (fptr->wbuf.len) {
rb_warn("syswrite for buffered IO");
}
- if (!rb_thread_fd_writable(fptr->fd)) {
- rb_io_check_closed(fptr);
- }
n = rb_write_internal(fptr->fd, RSTRING_PTR(str), RSTRING_LEN(str));
@@ -3921,6 +4351,8 @@ rb_io_syswrite(VALUE io, VALUE str)
* that read from <em>ios</em> or you may get unpredictable results.
* If the optional <i>outbuf</i> argument is present, it must reference
* a String, which will receive the data.
+ * The <i>outbuf</i> will contain only the received data after the method call
+ * even if it is not empty at the beginning.
* Raises <code>SystemCallError</code> on error and
* <code>EOFError</code> at end of file.
*
@@ -3949,9 +4381,19 @@ rb_io_sysread(int argc, VALUE *argv, VALUE io)
}
n = fptr->fd;
+
+ /*
+ * FIXME: removing rb_thread_wait_fd() here changes sysread semantics
+ * on non-blocking IOs. However, it's still currently possible
+ * for sysread to raise Errno::EAGAIN if another thread read()s
+ * the IO after we return from rb_thread_wait_fd() but before
+ * we call read()
+ */
rb_thread_wait_fd(fptr->fd);
+
rb_io_check_closed(fptr);
+ io_setstrbuf(&str, ilen);
rb_str_locktmp(str);
n = rb_read_internal(fptr->fd, RSTRING_PTR(str), ilen);
rb_str_unlocktmp(str);
@@ -3959,11 +4401,10 @@ rb_io_sysread(int argc, VALUE *argv, VALUE io)
if (n == -1) {
rb_sys_fail_path(fptr->pathv);
}
- rb_str_set_len(str, n);
+ io_set_read_length(str, n);
if (n == 0 && ilen > 0) {
rb_eof_error();
}
- rb_str_resize(str, n);
OBJ_TAINT(str);
return str;
@@ -3982,6 +4423,14 @@ rb_io_binmode(VALUE io)
fptr->mode |= FMODE_BINMODE;
fptr->mode &= ~FMODE_TEXTMODE;
fptr->writeconv_pre_ecflags &= ~ECONV_NEWLINE_DECORATOR_MASK;
+#ifdef O_BINARY
+ if (!fptr->readconv) {
+ SET_BINARY_MODE_WITH_SEEK_CUR(fptr);
+ }
+ else {
+ setmode(fptr->fd, O_BINARY);
+ }
+#endif
return io;
}
@@ -4001,6 +4450,7 @@ rb_io_ascii8bit_binmode(VALUE io)
}
fptr->mode |= FMODE_BINMODE;
fptr->mode &= ~FMODE_TEXTMODE;
+ SET_BINARY_MODE_WITH_SEEK_CUR(fptr);
fptr->encs.enc = rb_ascii8bit_encoding();
fptr->encs.enc2 = NULL;
@@ -4054,8 +4504,6 @@ rb_io_binmode_p(VALUE io)
static const char*
rb_io_fmode_modestr(int fmode)
{
-# define MODE_BTMODE(a,b,c) ((fmode & FMODE_BINMODE) ? (b) : \
- (fmode & FMODE_TEXTMODE) ? (c) : (a))
if (fmode & FMODE_APPEND) {
if ((fmode & FMODE_READWRITE) == FMODE_READWRITE) {
return MODE_BTMODE("a+", "ab+", "at+");
@@ -4063,6 +4511,8 @@ rb_io_fmode_modestr(int fmode)
return MODE_BTMODE("a", "ab", "at");
}
switch (fmode & FMODE_READWRITE) {
+ default:
+ rb_raise(rb_eArgError, "invalid access fmode 0x%x", fmode);
case FMODE_READABLE:
return MODE_BTMODE("r", "rb", "rt");
case FMODE_WRITABLE:
@@ -4073,8 +4523,6 @@ rb_io_fmode_modestr(int fmode)
}
return MODE_BTMODE("r+", "rb+", "rt+");
}
- rb_raise(rb_eArgError, "invalid access fmode 0x%x", fmode);
- return NULL; /* not reached */
}
static int
@@ -4232,6 +4680,8 @@ rb_io_oflags_modestr(int oflags)
}
}
switch (oflags & (O_RDONLY|O_WRONLY|O_RDWR)) {
+ default:
+ rb_raise(rb_eArgError, "invalid access oflags 0x%x", oflags);
case O_RDONLY:
return MODE_BINARY("r", "rb");
case O_WRONLY:
@@ -4239,8 +4689,6 @@ rb_io_oflags_modestr(int oflags)
case O_RDWR:
return MODE_BINARY("r+", "rb+");
}
- rb_raise(rb_eArgError, "invalid access oflags 0x%x", oflags);
- return NULL; /* not reached */
}
/*
@@ -4272,6 +4720,12 @@ rb_io_ext_int_to_encs(rb_encoding *ext, rb_encoding *intern, rb_encoding **enc,
}
static void
+unsupported_encoding(const char *name)
+{
+ rb_warn("Unsupported encoding %s ignored", name);
+}
+
+static void
parse_mode_enc(const char *estr, rb_encoding **enc_p, rb_encoding **enc2_p, int *fmode_p)
{
const char *p;
@@ -4315,7 +4769,7 @@ parse_mode_enc(const char *estr, rb_encoding **enc_p, rb_encoding **enc2_p, int
ext_enc = rb_enc_from_index(idx);
else {
if (idx != -2)
- rb_warn("Unsupported encoding %s ignored", estr);
+ unsupported_encoding(estr);
ext_enc = NULL;
}
@@ -4328,9 +4782,8 @@ parse_mode_enc(const char *estr, rb_encoding **enc_p, rb_encoding **enc2_p, int
else {
idx2 = rb_enc_find_index(p);
if (idx2 < 0)
- rb_warn("Unsupported encoding %s ignored", p);
+ unsupported_encoding(p);
else if (idx2 == idx) {
- rb_warn("Ignoring internal encoding %s: it is identical to external encoding %s", p, estr);
int_enc = (rb_encoding *)Qnil;
}
else
@@ -4341,23 +4794,6 @@ parse_mode_enc(const char *estr, rb_encoding **enc_p, rb_encoding **enc2_p, int
rb_io_ext_int_to_encs(ext_enc, int_enc, enc_p, enc2_p);
}
-static void
-mode_enc(rb_io_t *fptr, const char *estr)
-{
- clear_codeconv(fptr);
-
- parse_mode_enc(estr, &fptr->encs.enc, &fptr->encs.enc2, NULL);
-}
-
-static void
-rb_io_mode_enc(rb_io_t *fptr, const char *modestr)
-{
- const char *p = strchr(modestr, ':');
- if (p) {
- mode_enc(fptr, p+1);
- }
-}
-
int
rb_io_extract_encoding_option(VALUE opt, rb_encoding **enc_p, rb_encoding **enc2_p, int *fmode_p)
{
@@ -4440,7 +4876,7 @@ validate_enc_binmode(int *fmode_p, int ecflags, rb_encoding *enc, rb_encoding *e
rb_raise(rb_eArgError, "ASCII incompatible encoding needs binmode");
if (!(fmode & FMODE_BINMODE) &&
- (ecflags & ECONV_NEWLINE_DECORATOR_MASK)) {
+ (DEFAULT_TEXTMODE || (ecflags & ECONV_NEWLINE_DECORATOR_MASK))) {
fmode |= DEFAULT_TEXTMODE;
*fmode_p = fmode;
}
@@ -4458,11 +4894,19 @@ extract_binmode(VALUE opthash, int *fmode)
if (!NIL_P(opthash)) {
VALUE v;
v = rb_hash_aref(opthash, sym_textmode);
- if (!NIL_P(v) && RTEST(v))
- *fmode |= FMODE_TEXTMODE;
+ if (!NIL_P(v)) {
+ if (*fmode & FMODE_TEXTMODE)
+ rb_raise(rb_eArgError, "textmode specified twice");
+ if (RTEST(v))
+ *fmode |= FMODE_TEXTMODE;
+ }
v = rb_hash_aref(opthash, sym_binmode);
- if (!NIL_P(v) && RTEST(v))
- *fmode |= FMODE_BINMODE;
+ if (!NIL_P(v)) {
+ if (*fmode & FMODE_BINMODE)
+ rb_raise(rb_eArgError, "binmode specified twice");
+ if (RTEST(v))
+ *fmode |= FMODE_BINMODE;
+ }
if ((*fmode & FMODE_BINMODE) && (*fmode & FMODE_TEXTMODE))
rb_raise(rb_eArgError, "both textmode and binmode specified");
@@ -4488,7 +4932,7 @@ rb_io_extract_modeenc(VALUE *vmode_p, VALUE *vperm_p, VALUE opthash,
vmode_handle:
if (NIL_P(vmode)) {
- fmode = FMODE_READABLE | DEFAULT_TEXTMODE;
+ fmode = FMODE_READABLE;
oflags = O_RDONLY;
}
else if (!NIL_P(intmode = rb_check_to_integer(vmode, "to_int"))) {
@@ -4520,15 +4964,29 @@ rb_io_extract_modeenc(VALUE *vmode_p, VALUE *vperm_p, VALUE opthash,
ecflags = (fmode & FMODE_READABLE) ?
MODE_BTMODE(ECONV_DEFAULT_NEWLINE_DECORATOR,
0, ECONV_UNIVERSAL_NEWLINE_DECORATOR) : 0;
+#ifdef TEXTMODE_NEWLINE_DECORATOR_ON_WRITE
+ ecflags |= (fmode & FMODE_WRITABLE) ?
+ MODE_BTMODE(TEXTMODE_NEWLINE_DECORATOR_ON_WRITE,
+ 0, TEXTMODE_NEWLINE_DECORATOR_ON_WRITE) : 0;
+#endif
+ SET_UNIVERSAL_NEWLINE_DECORATOR_IF_ENC2(enc2, ecflags);
ecopts = Qnil;
}
else {
VALUE v;
extract_binmode(opthash, &fmode);
+ if (fmode & FMODE_BINMODE) {
#ifdef O_BINARY
- if (fmode & FMODE_BINMODE)
oflags |= O_BINARY;
#endif
+ if (!has_enc)
+ rb_io_ext_int_to_encs(rb_ascii8bit_encoding(), NULL, &enc, &enc2);
+ }
+#if DEFAULT_TEXTMODE
+ else if (NIL_P(vmode)) {
+ fmode |= DEFAULT_TEXTMODE;
+ }
+#endif
if (!has_vmode) {
v = rb_hash_aref(opthash, sym_mode);
if (!NIL_P(v)) {
@@ -4555,13 +5013,19 @@ rb_io_extract_modeenc(VALUE *vmode_p, VALUE *vperm_p, VALUE opthash,
ecflags = (fmode & FMODE_READABLE) ?
MODE_BTMODE(ECONV_DEFAULT_NEWLINE_DECORATOR,
0, ECONV_UNIVERSAL_NEWLINE_DECORATOR) : 0;
- ecflags = rb_econv_prepare_options(opthash, &ecopts, ecflags);
+#ifdef TEXTMODE_NEWLINE_DECORATOR_ON_WRITE
+ ecflags |= (fmode & FMODE_WRITABLE) ?
+ MODE_BTMODE(TEXTMODE_NEWLINE_DECORATOR_ON_WRITE,
+ 0, TEXTMODE_NEWLINE_DECORATOR_ON_WRITE) : 0;
+#endif
if (rb_io_extract_encoding_option(opthash, &enc, &enc2, &fmode)) {
if (has_enc) {
rb_raise(rb_eArgError, "encoding specified twice");
}
}
+ SET_UNIVERSAL_NEWLINE_DECORATOR_IF_ENC2(enc2, ecflags);
+ ecflags = rb_econv_prepare_options(opthash, &ecopts, ecflags);
}
validate_enc_binmode(&fmode, ecflags, enc, enc2);
@@ -4582,19 +5046,19 @@ struct sysopen_struct {
mode_t perm;
};
-static VALUE
+static void *
sysopen_func(void *ptr)
{
const struct sysopen_struct *data = ptr;
const char *fname = RSTRING_PTR(data->fname);
- return (VALUE)open(fname, data->oflags, data->perm);
+ return (void *)(VALUE)rb_cloexec_open(fname, data->oflags, data->perm);
}
static inline int
rb_sysopen_internal(struct sysopen_struct *data)
{
int fd;
- fd = (int)rb_thread_blocking_region(sysopen_func, data, RUBY_UBF_IO, 0);
+ fd = (int)(VALUE)rb_thread_call_without_gvl(sysopen_func, data, RUBY_UBF_IO, 0);
if (0 <= fd)
rb_update_max_fd(fd);
return fd;
@@ -4606,9 +5070,6 @@ rb_sysopen(VALUE fname, int oflags, mode_t perm)
int fd;
struct sysopen_struct data;
-#ifdef O_BINARY
- oflags |= O_BINARY;
-#endif
data.fname = rb_str_encode_ospath(fname);
data.oflags = oflags;
data.perm = perm;
@@ -4620,10 +5081,9 @@ rb_sysopen(VALUE fname, int oflags, mode_t perm)
fd = rb_sysopen_internal(&data);
}
if (fd < 0) {
- rb_sys_fail(RSTRING_PTR(fname));
+ rb_sys_fail_path(fname);
}
}
- rb_update_max_fd(fd);
return fd;
}
@@ -4632,18 +5092,18 @@ rb_fdopen(int fd, const char *modestr)
{
FILE *file;
-#if defined(sun)
+#if defined(__sun)
errno = 0;
#endif
file = fdopen(fd, modestr);
if (!file) {
if (
-#if defined(sun)
+#if defined(__sun)
errno == 0 ||
#endif
errno == EMFILE || errno == ENFILE) {
rb_gc();
-#if defined(sun)
+#if defined(__sun)
errno = 0;
#endif
file = fdopen(fd, modestr);
@@ -4651,7 +5111,7 @@ rb_fdopen(int fd, const char *modestr)
if (!file) {
#ifdef _WIN32
if (errno == 0) errno = EINVAL;
-#elif defined(sun)
+#elif defined(__sun)
if (errno == 0) errno = EMFILE;
#endif
rb_sys_fail(0);
@@ -4679,65 +5139,63 @@ static void io_encoding_set(rb_io_t *, VALUE, VALUE, VALUE);
static int
io_strip_bom(VALUE io)
{
- int b1, b2, b3, b4;
- switch (b1 = FIX2INT(rb_io_getbyte(io))) {
- case 0xEF:
- b2 = FIX2INT(rb_io_getbyte(io));
- if (b2 == 0xBB) {
- b3 = FIX2INT(rb_io_getbyte(io));
- if (b3 == 0xBF) {
+ VALUE b1, b2, b3, b4;
+
+ if (NIL_P(b1 = rb_io_getbyte(io))) return 0;
+ switch (b1) {
+ case INT2FIX(0xEF):
+ if (NIL_P(b2 = rb_io_getbyte(io))) break;
+ if (b2 == INT2FIX(0xBB) && !NIL_P(b3 = rb_io_getbyte(io))) {
+ if (b3 == INT2FIX(0xBF)) {
return rb_utf8_encindex();
}
- rb_io_ungetbyte(io, INT2FIX(b3));
+ rb_io_ungetbyte(io, b3);
}
- rb_io_ungetbyte(io, INT2FIX(b2));
+ rb_io_ungetbyte(io, b2);
break;
- case 0xFE:
- b2 = FIX2INT(rb_io_getbyte(io));
- if (b2 == 0xFF) {
+ case INT2FIX(0xFE):
+ if (NIL_P(b2 = rb_io_getbyte(io))) break;
+ if (b2 == INT2FIX(0xFF)) {
return rb_enc_find_index("UTF-16BE");
}
- rb_io_ungetbyte(io, INT2FIX(b2));
+ rb_io_ungetbyte(io, b2);
break;
- case 0xFF:
- b2 = FIX2INT(rb_io_getbyte(io));
- if (b2 == 0xFE) {
- b3 = FIX2INT(rb_io_getbyte(io));
- if (b3 == 0) {
- b4 = FIX2INT(rb_io_getbyte(io));
- if (b4 == 0) {
+ case INT2FIX(0xFF):
+ if (NIL_P(b2 = rb_io_getbyte(io))) break;
+ if (b2 == INT2FIX(0xFE)) {
+ b3 = rb_io_getbyte(io);
+ if (b3 == INT2FIX(0) && !NIL_P(b4 = rb_io_getbyte(io))) {
+ if (b4 == INT2FIX(0)) {
return rb_enc_find_index("UTF-32LE");
}
- rb_io_ungetbyte(io, INT2FIX(b4));
+ rb_io_ungetbyte(io, b4);
+ rb_io_ungetbyte(io, b3);
}
else {
- rb_io_ungetbyte(io, INT2FIX(b3));
+ rb_io_ungetbyte(io, b3);
return rb_enc_find_index("UTF-16LE");
}
- rb_io_ungetbyte(io, INT2FIX(b3));
}
- rb_io_ungetbyte(io, INT2FIX(b2));
+ rb_io_ungetbyte(io, b2);
break;
- case 0:
- b2 = FIX2INT(rb_io_getbyte(io));
- if (b2 == 0) {
- b3 = FIX2INT(rb_io_getbyte(io));
- if (b3 == 0xFE) {
- b4 = FIX2INT(rb_io_getbyte(io));
- if (b4 == 0xFF) {
+ case INT2FIX(0):
+ if (NIL_P(b2 = rb_io_getbyte(io))) break;
+ if (b2 == INT2FIX(0) && !NIL_P(b3 = rb_io_getbyte(io))) {
+ if (b3 == INT2FIX(0xFE) && !NIL_P(b4 = rb_io_getbyte(io))) {
+ if (b4 == INT2FIX(0xFF)) {
return rb_enc_find_index("UTF-32BE");
}
- rb_io_ungetbyte(io, INT2FIX(b4));
+ rb_io_ungetbyte(io, b4);
}
- rb_io_ungetbyte(io, INT2FIX(b3));
+ rb_io_ungetbyte(io, b3);
}
- rb_io_ungetbyte(io, INT2FIX(b2));
+ rb_io_ungetbyte(io, b2);
break;
}
- rb_io_ungetbyte(io, INT2FIX(b1));
+ rb_io_ungetbyte(io, b1);
return 0;
}
@@ -4908,11 +5366,11 @@ int
rb_pipe(int *pipes)
{
int ret;
- ret = pipe(pipes);
+ ret = rb_cloexec_pipe(pipes);
if (ret == -1) {
if (errno == EMFILE || errno == ENFILE) {
rb_gc();
- ret = pipe(pipes);
+ ret = rb_cloexec_pipe(pipes);
}
}
if (ret == 0) {
@@ -4922,14 +5380,23 @@ rb_pipe(int *pipes)
return ret;
}
-#ifdef HAVE_FORK
+#ifdef _WIN32
+#define HAVE_SPAWNV 1
+#define spawnv(mode, cmd, args) rb_w32_aspawn((mode), (cmd), (args))
+#define spawn(mode, cmd) rb_w32_spawn((mode), (cmd), 0)
+#endif
+
+#if defined(HAVE_FORK) || defined(HAVE_SPAWNV)
struct popen_arg {
- struct rb_exec_arg *execp;
+ VALUE execarg_obj;
+ struct rb_execarg *eargp;
int modef;
int pair[2];
int write_pair[2];
};
+#endif
+#ifdef HAVE_FORK
static void
popen_redirect(struct popen_arg *p)
{
@@ -4961,25 +5428,75 @@ popen_redirect(struct popen_arg *p)
}
}
+#if defined(__linux__)
+/* Linux /proc/self/status contains a line: "FDSize:\t<nnn>\n"
+ * Since /proc may not be available, linux_get_maxfd is just a hint.
+ * This function, linux_get_maxfd, must be async-signal-safe.
+ * I.e. opendir() is not usable.
+ *
+ * Note that memchr() and memcmp is *not* async-signal-safe in POSIX.
+ * However they are easy to re-implement in async-signal-safe manner.
+ * (Also note that there is missing/memcmp.c.)
+ */
+static int
+linux_get_maxfd(void)
+{
+ int fd;
+ char buf[4096], *p, *np, *e;
+ ssize_t ss;
+ fd = rb_cloexec_open("/proc/self/status", O_RDONLY|O_NOCTTY, 0);
+ if (fd == -1) return -1;
+ ss = read(fd, buf, sizeof(buf));
+ if (ss == -1) goto err;
+ p = buf;
+ e = buf + ss;
+ while ((int)sizeof("FDSize:\t0\n")-1 <= e-p &&
+ (np = memchr(p, '\n', e-p)) != NULL) {
+ if (memcmp(p, "FDSize:", sizeof("FDSize:")-1) == 0) {
+ int fdsize;
+ p += sizeof("FDSize:")-1;
+ *np = '\0';
+ fdsize = (int)ruby_strtoul(p, (char **)NULL, 10);
+ close(fd);
+ return fdsize;
+ }
+ p = np+1;
+ }
+ /* fall through */
+
+ err:
+ close(fd);
+ return -1;
+}
+#endif
+
+/* This function should be async-signal-safe. */
void
rb_close_before_exec(int lowfd, int maxhint, VALUE noclose_fds)
{
int fd, ret;
int max = max_file_descriptor;
+#ifdef F_MAXFD
+ /* F_MAXFD is available since NetBSD 2.0. */
+ ret = fcntl(0, F_MAXFD); /* async-signal-safe */
+ if (ret != -1)
+ maxhint = max = ret;
+#elif defined(__linux__)
+ ret = linux_get_maxfd();
+ if (maxhint < ret)
+ maxhint = ret;
+ /* maxhint = max = ret; if (ret == -1) abort(); // test */
+#endif
if (max < maxhint)
max = maxhint;
for (fd = lowfd; fd <= max; fd++) {
if (!NIL_P(noclose_fds) &&
- RTEST(rb_hash_lookup(noclose_fds, INT2FIX(fd))))
+ RTEST(rb_hash_lookup(noclose_fds, INT2FIX(fd)))) /* async-signal-safe */
continue;
-#ifdef FD_CLOEXEC
- ret = fcntl(fd, F_GETFD);
+ ret = fcntl(fd, F_GETFD); /* async-signal-safe */
if (ret != -1 && !(ret & FD_CLOEXEC)) {
- fcntl(fd, F_SETFD, ret|FD_CLOEXEC);
+ fcntl(fd, F_SETFD, ret|FD_CLOEXEC); /* async-signal-safe */
}
-#else
- ret = close(fd);
-#endif
#define CONTIGUOUS_CLOSED_FDS 20
if (ret != -1) {
if (max < fd + CONTIGUOUS_CLOSED_FDS)
@@ -4993,14 +5510,15 @@ popen_exec(void *pp, char *errmsg, size_t errmsg_len)
{
struct popen_arg *p = (struct popen_arg*)pp;
- rb_thread_atfork_before_exec();
- return rb_exec_err(p->execp, errmsg, errmsg_len);
+ return rb_exec_async_signal_safe(p->eargp, errmsg, errmsg_len);
}
#endif
static VALUE
-pipe_open(struct rb_exec_arg *eargp, VALUE prog, const char *modestr, int fmode, convconfig_t *convconfig)
+pipe_open(VALUE execarg_obj, const char *modestr, int fmode, convconfig_t *convconfig)
{
+ struct rb_execarg *eargp = NIL_P(execarg_obj) ? NULL : rb_execarg_get(execarg_obj);
+ VALUE prog = eargp ? (eargp->use_shell ? eargp->invoke.sh.shell_script : eargp->invoke.cmd.command_name) : Qfalse ;
rb_pid_t pid = 0;
rb_io_t *fptr;
VALUE port;
@@ -5008,85 +5526,112 @@ pipe_open(struct rb_exec_arg *eargp, VALUE prog, const char *modestr, int fmode,
VALUE write_port;
#if defined(HAVE_FORK)
int status;
- struct popen_arg arg;
char errmsg[80] = { '\0' };
-#elif defined(_WIN32)
- volatile VALUE argbuf;
+#endif
+#if defined(HAVE_FORK) || defined(HAVE_SPAWNV)
+ struct popen_arg arg;
+ int e = 0;
+#endif
+#if defined(HAVE_SPAWNV)
+# if defined(HAVE_SPAWNVE)
+# define DO_SPAWN(cmd, args, envp) ((args) ? \
+ spawnve(P_NOWAIT, (cmd), (args), (envp)) : \
+ spawne(P_NOWAIT, (cmd), (envp)))
+# else
+# define DO_SPAWN(cmd, args, envp) ((args) ? \
+ spawnv(P_NOWAIT, (cmd), (args)) : \
+ spawn(P_NOWAIT, (cmd)))
+# endif
+# if !defined(HAVE_FORK)
char **args = NULL;
- int pair[2], write_pair[2];
+ char **envp = NULL;
+# endif
#endif
#if !defined(HAVE_FORK)
- struct rb_exec_arg sarg;
+ struct rb_execarg sarg, *sargp = &sarg;
#endif
FILE *fp = 0;
int fd = -1;
int write_fd = -1;
+#if !defined(HAVE_FORK)
const char *cmd = 0;
+#if !defined(HAVE_SPAWNV)
int argc;
VALUE *argv;
+#endif
if (prog)
cmd = StringValueCStr(prog);
+#endif
- if (!eargp) {
- /* fork : IO.popen("-") */
- argc = 0;
- argv = 0;
- }
- else if (eargp->argc) {
- /* no shell : IO.popen([prog, arg0], arg1, ...) */
- argc = eargp->argc;
- argv = eargp->argv;
- }
- else {
- /* with shell : IO.popen(prog) */
- argc = 0;
- argv = 0;
- }
-
-#if defined(HAVE_FORK)
- arg.execp = eargp;
+#if defined(HAVE_FORK) || defined(HAVE_SPAWNV)
+ arg.execarg_obj = execarg_obj;
+ arg.eargp = eargp;
arg.modef = fmode;
arg.pair[0] = arg.pair[1] = -1;
arg.write_pair[0] = arg.write_pair[1] = -1;
+# if !defined(HAVE_FORK)
+ if (eargp && !eargp->use_shell) {
+ args = ARGVSTR2ARGV(eargp->invoke.cmd.argv_str);
+ }
+# endif
switch (fmode & (FMODE_READABLE|FMODE_WRITABLE)) {
case FMODE_READABLE|FMODE_WRITABLE:
if (rb_pipe(arg.write_pair) < 0)
- rb_sys_fail(cmd);
+ rb_sys_fail_str(prog);
if (rb_pipe(arg.pair) < 0) {
int e = errno;
close(arg.write_pair[0]);
close(arg.write_pair[1]);
errno = e;
- rb_sys_fail(cmd);
+ rb_sys_fail_str(prog);
}
if (eargp) {
- rb_exec_arg_addopt(eargp, INT2FIX(0), INT2FIX(arg.write_pair[0]));
- rb_exec_arg_addopt(eargp, INT2FIX(1), INT2FIX(arg.pair[1]));
+ rb_execarg_addopt(execarg_obj, INT2FIX(0), INT2FIX(arg.write_pair[0]));
+ rb_execarg_addopt(execarg_obj, INT2FIX(1), INT2FIX(arg.pair[1]));
}
break;
case FMODE_READABLE:
if (rb_pipe(arg.pair) < 0)
- rb_sys_fail(cmd);
+ rb_sys_fail_str(prog);
if (eargp)
- rb_exec_arg_addopt(eargp, INT2FIX(1), INT2FIX(arg.pair[1]));
+ rb_execarg_addopt(execarg_obj, INT2FIX(1), INT2FIX(arg.pair[1]));
break;
case FMODE_WRITABLE:
if (rb_pipe(arg.pair) < 0)
- rb_sys_fail(cmd);
+ rb_sys_fail_str(prog);
if (eargp)
- rb_exec_arg_addopt(eargp, INT2FIX(0), INT2FIX(arg.pair[0]));
+ rb_execarg_addopt(execarg_obj, INT2FIX(0), INT2FIX(arg.pair[0]));
break;
default:
- rb_sys_fail(cmd);
+ rb_sys_fail_str(prog);
}
- if (eargp) {
- rb_exec_arg_fixup(arg.execp);
- pid = rb_fork_err(&status, popen_exec, &arg, arg.execp->redirect_fds, errmsg, sizeof(errmsg));
+ if (!NIL_P(execarg_obj)) {
+ rb_execarg_fixup(execarg_obj);
+# if defined(HAVE_FORK)
+ pid = rb_fork_async_signal_safe(&status, popen_exec, &arg, arg.eargp->redirect_fds, errmsg, sizeof(errmsg));
+# else
+ rb_execarg_run_options(eargp, sargp, NULL, 0);
+ if (eargp->envp_str) envp = (char **)RSTRING_PTR(eargp->envp_str);
+ while ((pid = DO_SPAWN(cmd, args, envp)) == -1) {
+ /* exec failed */
+ switch (e = errno) {
+ case EAGAIN:
+# if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
+ case EWOULDBLOCK:
+# endif
+ rb_thread_sleep(1);
+ continue;
+ }
+ break;
+ }
+ if (eargp)
+ rb_execarg_run_options(sargp, NULL, NULL, 0);
+# endif
}
else {
- fflush(stdin); /* is it really needed? */
- pid = rb_fork(&status, 0, 0, Qnil);
+# if defined(HAVE_FORK)
+ pid = rb_fork_ruby(&status);
if (pid == 0) { /* child */
rb_thread_atfork();
popen_redirect(&arg);
@@ -5094,11 +5639,16 @@ pipe_open(struct rb_exec_arg *eargp, VALUE prog, const char *modestr, int fmode,
rb_io_synchronized(RFILE(orig_stderr)->fptr);
return Qnil;
}
+# else
+ rb_notimplement();
+# endif
}
/* parent */
if (pid == -1) {
- int e = errno;
+# if defined(HAVE_FORK)
+ e = errno;
+# endif
close(arg.pair[0]);
close(arg.pair[1]);
if ((fmode & (FMODE_READABLE|FMODE_WRITABLE)) == (FMODE_READABLE|FMODE_WRITABLE)) {
@@ -5106,9 +5656,11 @@ pipe_open(struct rb_exec_arg *eargp, VALUE prog, const char *modestr, int fmode,
close(arg.write_pair[1]);
}
errno = e;
+# if defined(HAVE_FORK)
if (errmsg[0])
rb_sys_fail(errmsg);
- rb_sys_fail(cmd);
+# endif
+ rb_sys_fail_str(prog);
}
if ((fmode & FMODE_READABLE) && (fmode & FMODE_WRITABLE)) {
close(arg.pair[1]);
@@ -5124,115 +5676,19 @@ pipe_open(struct rb_exec_arg *eargp, VALUE prog, const char *modestr, int fmode,
close(arg.pair[0]);
fd = arg.pair[1];
}
-#elif defined(_WIN32)
- if (argc) {
- int i;
-
- if (argc >= (int)(FIXNUM_MAX / sizeof(char *))) {
- rb_raise(rb_eArgError, "too many arguments");
- }
- argbuf = rb_str_tmp_new((argc+1) * sizeof(char *));
- args = (void *)RSTRING_PTR(argbuf);
- for (i = 0; i < argc; ++i) {
- args[i] = StringValueCStr(argv[i]);
- }
- args[i] = NULL;
- }
- switch (fmode & (FMODE_READABLE|FMODE_WRITABLE)) {
- case FMODE_READABLE|FMODE_WRITABLE:
- if (rb_pipe(write_pair) < 0)
- rb_sys_fail(cmd);
- if (rb_pipe(pair) < 0) {
- int e = errno;
- close(write_pair[0]);
- close(write_pair[1]);
- errno = e;
- rb_sys_fail(cmd);
- }
- if (eargp) {
- rb_exec_arg_addopt(eargp, INT2FIX(0), INT2FIX(write_pair[0]));
- rb_exec_arg_addopt(eargp, INT2FIX(1), INT2FIX(pair[1]));
- }
- break;
- case FMODE_READABLE:
- if (rb_pipe(pair) < 0)
- rb_sys_fail(cmd);
- if (eargp)
- rb_exec_arg_addopt(eargp, INT2FIX(1), INT2FIX(pair[1]));
- break;
- case FMODE_WRITABLE:
- if (rb_pipe(pair) < 0)
- rb_sys_fail(cmd);
- if (eargp)
- rb_exec_arg_addopt(eargp, INT2FIX(0), INT2FIX(pair[0]));
- break;
- default:
- rb_sys_fail(cmd);
- }
- if (eargp) {
- rb_exec_arg_fixup(eargp);
- rb_run_exec_options(eargp, &sarg);
- }
- while ((pid = (args ?
- rb_w32_aspawn(P_NOWAIT, cmd, args) :
- rb_w32_spawn(P_NOWAIT, cmd, 0))) == -1) {
- /* exec failed */
- switch (errno) {
- case EAGAIN:
-#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
- case EWOULDBLOCK:
-#endif
- rb_thread_sleep(1);
- break;
- default:
- {
- int e = errno;
- if (eargp)
- rb_run_exec_options(&sarg, NULL);
- close(pair[0]);
- close(pair[1]);
- if ((fmode & (FMODE_READABLE|FMODE_WRITABLE)) == (FMODE_READABLE|FMODE_WRITABLE)) {
- close(write_pair[0]);
- close(write_pair[1]);
- }
- errno = e;
- rb_sys_fail(cmd);
- }
- break;
- }
- }
-
- RB_GC_GUARD(argbuf);
-
- if (eargp)
- rb_run_exec_options(&sarg, NULL);
- if ((fmode & FMODE_READABLE) && (fmode & FMODE_WRITABLE)) {
- close(pair[1]);
- fd = pair[0];
- close(write_pair[0]);
- write_fd = write_pair[1];
- }
- else if (fmode & FMODE_READABLE) {
- close(pair[1]);
- fd = pair[0];
- }
- else {
- close(pair[0]);
- fd = pair[1];
- }
#else
if (argc) {
prog = rb_ary_join(rb_ary_new4(argc, argv), rb_str_new2(" "));
cmd = StringValueCStr(prog);
}
- if (eargp) {
- rb_exec_arg_fixup(eargp);
- rb_run_exec_options(eargp, &sarg);
+ if (!NIL_P(execarg_obj)) {
+ rb_execarg_fixup(execarg_obj);
+ rb_execarg_run_options(eargp, sargp, NULL, 0);
}
fp = popen(cmd, modestr);
if (eargp)
- rb_run_exec_options(&sarg, NULL);
- if (!fp) rb_sys_fail(RSTRING_PTR(prog));
+ rb_execarg_run_options(sargp, NULL, NULL, 0);
+ if (!fp) rb_sys_fail_path(prog);
fd = fileno(fp);
#endif
@@ -5243,9 +5699,21 @@ pipe_open(struct rb_exec_arg *eargp, VALUE prog, const char *modestr, int fmode,
fptr->mode = fmode | FMODE_SYNC|FMODE_DUPLEX;
if (convconfig) {
fptr->encs = *convconfig;
+#if defined(RUBY_TEST_CRLF_ENVIRONMENT) || defined(_WIN32)
+ if (fptr->encs.ecflags & ECONV_DEFAULT_NEWLINE_DECORATOR) {
+ fptr->encs.ecflags |= ECONV_UNIVERSAL_NEWLINE_DECORATOR;
+ }
+#endif
}
- else if (NEED_NEWLINE_DECORATOR_ON_READ(fptr)) {
- fptr->encs.ecflags |= ECONV_UNIVERSAL_NEWLINE_DECORATOR;
+ else {
+ if (NEED_NEWLINE_DECORATOR_ON_READ(fptr)) {
+ fptr->encs.ecflags |= ECONV_UNIVERSAL_NEWLINE_DECORATOR;
+ }
+#ifdef TEXTMODE_NEWLINE_DECORATOR_ON_WRITE
+ if (NEED_NEWLINE_DECORATOR_ON_WRITE(fptr)) {
+ fptr->encs.ecflags |= TEXTMODE_NEWLINE_DECORATOR_ON_WRITE;
+ }
+#endif
}
fptr->pid = pid;
@@ -5266,39 +5734,36 @@ pipe_open(struct rb_exec_arg *eargp, VALUE prog, const char *modestr, int fmode,
return port;
}
-static VALUE
-pipe_open_v(int argc, VALUE *argv, const char *modestr, int fmode, convconfig_t *convconfig)
+static int
+is_popen_fork(VALUE prog)
{
- VALUE prog;
- struct rb_exec_arg earg;
- prog = rb_exec_arg_init(argc, argv, FALSE, &earg);
- return pipe_open(&earg, prog, modestr, fmode, convconfig);
+ if (RSTRING_LEN(prog) == 1 && RSTRING_PTR(prog)[0] == '-') {
+#if !defined(HAVE_FORK)
+ rb_raise(rb_eNotImpError,
+ "fork() function is unimplemented on this machine");
+#else
+ return TRUE;
+#endif
+ }
+ return FALSE;
}
static VALUE
pipe_open_s(VALUE prog, const char *modestr, int fmode, convconfig_t *convconfig)
{
- const char *cmd = RSTRING_PTR(prog);
int argc = 1;
VALUE *argv = &prog;
- struct rb_exec_arg earg;
+ VALUE execarg_obj = Qnil;
- if (RSTRING_LEN(prog) == 1 && cmd[0] == '-') {
-#if !defined(HAVE_FORK)
- rb_raise(rb_eNotImpError,
- "fork() function is unimplemented on this machine");
-#endif
- return pipe_open(0, 0, modestr, fmode, convconfig);
- }
-
- rb_exec_arg_init(argc, argv, TRUE, &earg);
- return pipe_open(&earg, prog, modestr, fmode, convconfig);
+ if (!is_popen_fork(prog))
+ execarg_obj = rb_execarg_new(argc, argv, TRUE);
+ return pipe_open(execarg_obj, modestr, fmode, convconfig);
}
/*
* call-seq:
- * IO.popen(cmd, mode="r" [, opt]) -> io
- * IO.popen(cmd, mode="r" [, opt]) {|io| block } -> obj
+ * IO.popen([env,] cmd, mode="r" [, opt]) -> io
+ * IO.popen([env,] cmd, mode="r" [, opt]) {|io| block } -> obj
*
* Runs the specified command as a subprocess; the subprocess's
* standard input and output will be connected to the returned
@@ -5338,6 +5803,11 @@ pipe_open_s(VALUE prog, const char *modestr, int fmode, convconfig_t *convconfig
* ls_result_with_error = ls_io.read
* }
*
+ * # spawn options can be mixed with IO options
+ * IO.popen(["ls", "/"], :err=>[:child, :out]) {|ls_io|
+ * ls_result_with_error = ls_io.read
+ * }
+ *
* Raises exceptions which <code>IO.pipe</code> and
* <code>Kernel.spawn</code> raise.
*
@@ -5382,14 +5852,24 @@ static VALUE
rb_io_s_popen(int argc, VALUE *argv, VALUE klass)
{
const char *modestr;
- VALUE pname, pmode, port, tmp, opt;
+ VALUE pname, pmode = Qnil, port, tmp, opt = Qnil, env = Qnil, execarg_obj = Qnil;
int oflags, fmode;
convconfig_t convconfig;
- argc = rb_scan_args(argc, argv, "11:", &pname, &pmode, &opt);
-
- rb_io_extract_modeenc(&pmode, 0, opt, &oflags, &fmode, &convconfig);
- modestr = rb_io_oflags_modestr(oflags);
+ if (argc > 1 && !NIL_P(opt = rb_check_hash_type(argv[argc-1]))) --argc;
+ if (argc > 1 && !NIL_P(env = rb_check_hash_type(argv[0]))) --argc, ++argv;
+ switch (argc) {
+ case 2:
+ pmode = argv[1];
+ case 1:
+ pname = argv[0];
+ break;
+ default:
+ {
+ int ex = !NIL_P(opt);
+ rb_error_arity(argc + ex, 1 + ex, 2 + ex);
+ }
+ }
tmp = rb_check_array_type(pname);
if (!NIL_P(tmp)) {
@@ -5401,13 +5881,25 @@ rb_io_s_popen(int argc, VALUE *argv, VALUE klass)
#endif
tmp = rb_ary_dup(tmp);
RBASIC(tmp)->klass = 0;
- port = pipe_open_v((int)len, RARRAY_PTR(tmp), modestr, fmode, &convconfig);
+ execarg_obj = rb_execarg_new((int)len, RARRAY_PTR(tmp), FALSE);
rb_ary_clear(tmp);
}
else {
SafeStringValue(pname);
- port = pipe_open_s(pname, modestr, fmode, &convconfig);
+ execarg_obj = Qnil;
+ if (!is_popen_fork(pname))
+ execarg_obj = rb_execarg_new(1, &pname, TRUE);
+ }
+ if (!NIL_P(execarg_obj)) {
+ if (!NIL_P(opt))
+ opt = rb_execarg_extract_options(execarg_obj, opt);
+ if (!NIL_P(env))
+ rb_execarg_setenv(execarg_obj, env);
}
+ rb_io_extract_modeenc(&pmode, 0, opt, &oflags, &fmode, &convconfig);
+ modestr = rb_io_oflags_modestr(oflags);
+
+ port = pipe_open(execarg_obj, modestr, fmode, &convconfig);
if (NIL_P(port)) {
/* child */
if (rb_block_given_p()) {
@@ -5473,27 +5965,29 @@ rb_open_file(int argc, VALUE *argv, VALUE io)
*
* With no associated block, <code>File.open</code> is a synonym for
* File.new. If the optional code block is given, it will
- * be passed the opened +file+ as an argument, and the File object will
- * automatically be closed when the block terminates. In this instance,
- * <code>File.open</code> returns the value of the block.
- *
- * See IO.new for a list of values for the +opt+ parameter.
+ * be passed the opened +file+ as an argument and the File object will
+ * automatically be closed when the block terminates. The value of the block
+ * will be returned from <code>File.open</code>.
+ *
+ * If a file is being created, its initial permissions may be set using the
+ * +perm+ parameter. See File.new for further discussion.
+ *
+ * See IO.new for a description of the +mode+ and +opt+ parameters.
*/
/*
* Document-method: IO::open
*
* call-seq:
- * IO.open(fd, mode_string="r" [, opt]) -> io
- * IO.open(fd, mode_string="r" [, opt]) {|io| block } -> obj
- *
- * With no associated block, <code>IO.open</code> is a synonym for IO.new. If
- * the optional code block is given, it will be passed +io+ as an
- * argument, and the IO object will automatically be closed when the block
- * terminates. In this instance, IO.open returns the value of the block.
+ * IO.open(fd, mode="r" [, opt]) -> io
+ * IO.open(fd, mode="r" [, opt]) { |io| block } -> obj
*
- * See IO.new for a description of values for the +opt+ parameter.
+ * With no associated block, <code>IO.open</code> is a synonym for IO.new. If
+ * the optional code block is given, it will be passed +io+ as an argument,
+ * and the IO object will automatically be closed when the block terminates.
+ * In this instance, IO.open returns the value of the block.
*
+ * See IO.new for a description of the +fd+, +mode+ and +opt+ parameters.
*/
static VALUE
@@ -5516,7 +6010,6 @@ rb_io_s_open(int argc, VALUE *argv, VALUE klass)
* <code>Fixnum</code>.
*
* IO.sysopen("testfile") #=> 3
- *
*/
static VALUE
@@ -5564,72 +6057,58 @@ check_pipe_command(VALUE filename_or_command)
/*
* call-seq:
- * open(path [, mode_enc [, perm]] [, opt]) -> io or nil
- * open(path [, mode_enc [, perm]] [, opt]) {|io| block } -> obj
- *
- * Creates an <code>IO</code> object connected to the given stream,
- * file, or subprocess.
- *
- * If <i>path</i> does not start with a pipe character
- * (``<code>|</code>''), treat it as the name of a file to open using
- * the specified mode (defaulting to ``<code>r</code>'').
- *
- * The mode_enc is
- * either a string or an integer. If it is an integer, it must be
- * bitwise-or of open(2) flags, such as File::RDWR or File::EXCL.
- * If it is a string, it is either "mode", "mode:ext_enc", or
- * "mode:ext_enc:int_enc".
- * The mode is one of the following:
- *
- * r: read (default)
- * w: write
- * a: append
- *
- * The mode can be followed by "b" (means binary-mode), or "+"
- * (means both reading and writing allowed) or both.
- * If ext_enc (external encoding) is specified,
- * read string will be tagged by the encoding in reading,
- * and output string will be converted
- * to the specified encoding in writing.
- * If ext_enc starts with 'BOM|', check whether the input has a BOM. If
- * there is a BOM, strip it and set external encoding as
- * what the BOM tells. If there is no BOM, use ext_enc without 'BOM|'.
- * If two encoding names,
- * ext_enc and int_enc (external encoding and internal encoding),
- * are specified, the read string is converted from ext_enc
- * to int_enc then tagged with the int_enc in read mode,
- * and in write mode, the output string will be
- * converted from int_enc to ext_enc before writing.
- *
- * If a file is being created, its initial permissions may be
- * set using the integer third parameter.
- *
- * If a block is specified, it will be invoked with the
- * <code>File</code> object as a parameter, and the file will be
- * automatically closed when the block terminates. The call
- * returns the value of the block.
+ * open(path [, mode [, perm]] [, opt]) -> io or nil
+ * open(path [, mode [, perm]] [, opt]) {|io| block } -> obj
+ *
+ * Creates an IO object connected to the given stream, file, or subprocess.
+ *
+ * If +path+ does not start with a pipe character (<code>|</code>), treat it
+ * as the name of a file to open using the specified mode (defaulting to
+ * "r").
+ *
+ * The +mode+ is either a string or an integer. If it is an integer, it
+ * must be bitwise-or of open(2) flags, such as File::RDWR or File::EXCL. If
+ * it is a string, it is either "fmode", "fmode:ext_enc", or
+ * "fmode:ext_enc:int_enc".
+ *
+ * See the documentation of IO.new for full documentation of the +mode+ string
+ * directives.
+ *
+ * If a file is being created, its initial permissions may be set using the
+ * +perm+ parameter. See File.new and the open(2) and chmod(2) man pages for
+ * a description of permissions.
+ *
+ * If a block is specified, it will be invoked with the IO object as a
+ * parameter, and the IO will be automatically closed when the block
+ * terminates. The call returns the value of the block.
+ *
+ * If +path+ starts with a pipe character (<code>"|"</code>), a subprocess is
+ * created, connected to the caller by a pair of pipes. The returned IO
+ * object may be used to write to the standard input and read from the
+ * standard output of this subprocess.
*
- * If <i>path</i> starts with a pipe character, a subprocess is
- * created, connected to the caller by a pair of pipes. The returned
- * <code>IO</code> object may be used to write to the standard input
- * and read from the standard output of this subprocess. If the command
- * following the ``<code>|</code>'' is a single minus sign, Ruby forks,
- * and this subprocess is connected to the parent. In the subprocess,
- * the <code>open</code> call returns <code>nil</code>. If the command
- * is not ``<code>-</code>'', the subprocess runs the command. If a
- * block is associated with an <code>open("|-")</code> call, that block
- * will be run twice---once in the parent and once in the child. The
- * block parameter will be an <code>IO</code> object in the parent and
- * <code>nil</code> in the child. The parent's <code>IO</code> object
- * will be connected to the child's <code>$stdin</code> and
- * <code>$stdout</code>. The subprocess will be terminated at the end
- * of the block.
+ * If the command following the pipe is a single minus sign
+ * (<code>"|-"</code>), Ruby forks, and this subprocess is connected to the
+ * parent. If the command is not <code>"-"</code>, the subprocess runs the
+ * command.
+ *
+ * When the subprocess is ruby (opened via <code>"|-"</code>), the +open+
+ * call returns +nil+. If a block is associated with the open call, that
+ * block will run twice --- once in the parent and once in the child.
+ *
+ * The block parameter will be an IO object in the parent and +nil+ in the
+ * child. The parent's +IO+ object will be connected to the child's $stdin
+ * and $stdout. The subprocess will be terminated at the end of the block.
+ *
+ * === Examples
+ *
+ * Reading from "testfile":
*
* open("testfile") do |f|
* print f.gets
* end
*
- * <em>produces:</em>
+ * Produces:
*
* This is line one
*
@@ -5639,7 +6118,7 @@ check_pipe_command(VALUE filename_or_command)
* print cmd.gets
* cmd.close
*
- * <em>produces:</em>
+ * Produces:
*
* Wed Apr 9 08:56:31 CDT 2003
*
@@ -5653,21 +6132,23 @@ check_pipe_command(VALUE filename_or_command)
* puts "Got: #{f.gets}"
* end
*
- * <em>produces:</em>
+ * Produces:
*
* Got: in Child
*
- * Open a subprocess using a block to receive the I/O object:
+ * Open a subprocess using a block to receive the IO object:
*
- * open("|-") do |f|
- * if f == nil
- * puts "in Child"
- * else
+ * open "|-" do |f|
+ * if f then
+ * # parent process
* puts "Got: #{f.gets}"
+ * else
+ * # child process
+ * puts "in Child"
* end
* end
*
- * <em>produces:</em>
+ * Produces:
*
* Got: in Child
*/
@@ -5797,7 +6278,7 @@ io_reopen(VALUE io, VALUE nfile)
if (fd != fd2) {
if (IS_PREP_STDIO(fptr) || fd <= 2 || !fptr->stdio_file) {
/* need to keep FILE objects of stdin, stdout and stderr */
- if (dup2(fd2, fd) < 0)
+ if (rb_cloexec_dup2(fd2, fd) < 0)
rb_sys_fail_path(orig->pathv);
rb_update_max_fd(fd);
}
@@ -5805,7 +6286,7 @@ io_reopen(VALUE io, VALUE nfile)
fclose(fptr->stdio_file);
fptr->stdio_file = 0;
fptr->fd = -1;
- if (dup2(fd2, fd) < 0)
+ if (rb_cloexec_dup2(fd2, fd) < 0)
rb_sys_fail_path(orig->pathv);
rb_update_max_fd(fd);
fptr->fd = fd;
@@ -5848,12 +6329,12 @@ io_reopen(VALUE io, VALUE nfile)
static VALUE
rb_io_reopen(int argc, VALUE *argv, VALUE file)
{
- VALUE fname, nmode;
+ VALUE fname, nmode, opt;
int oflags;
rb_io_t *fptr;
rb_secure(4);
- if (rb_scan_args(argc, argv, "11", &fname, &nmode) == 1) {
+ if (rb_scan_args(argc, argv, "11:", &fname, &nmode, &opt) == 1) {
VALUE tmp = rb_io_check_io(fname);
if (!NIL_P(tmp)) {
return io_reopen(file, tmp);
@@ -5868,8 +6349,11 @@ rb_io_reopen(int argc, VALUE *argv, VALUE file)
MEMZERO(fptr, rb_io_t, 1);
}
- if (!NIL_P(nmode)) {
- int fmode = rb_io_modestr_fmode(StringValueCStr(nmode));
+ if (!NIL_P(nmode) || !NIL_P(opt)) {
+ int fmode;
+ convconfig_t convconfig;
+
+ rb_io_extract_modeenc(&nmode, 0, opt, &oflags, &fmode, &convconfig);
if (IS_PREP_STDIO(fptr) &&
((fptr->mode & FMODE_READWRITE) & (fmode & FMODE_READWRITE)) !=
(fptr->mode & FMODE_READWRITE)) {
@@ -5879,13 +6363,13 @@ rb_io_reopen(int argc, VALUE *argv, VALUE file)
rb_io_fmode_modestr(fmode));
}
fptr->mode = fmode;
- rb_io_mode_enc(fptr, StringValueCStr(nmode));
- fptr->encs.ecflags = 0;
- fptr->encs.ecopts = Qnil;
+ fptr->encs = convconfig;
+ }
+ else {
+ oflags = rb_io_fmode_oflags(fptr->mode);
}
fptr->pathv = rb_str_new_frozen(fname);
- oflags = rb_io_fmode_oflags(fptr->mode);
if (fptr->fd < 0) {
fptr->fd = rb_sysopen(fptr->pathv, oflags, 0666);
fptr->stdio_file = 0;
@@ -5903,10 +6387,19 @@ rb_io_reopen(int argc, VALUE *argv, VALUE file)
rb_sys_fail_path(fptr->pathv);
}
fptr->fd = fileno(fptr->stdio_file);
+ rb_fd_fix_cloexec(fptr->fd);
#ifdef USE_SETVBUF
if (setvbuf(fptr->stdio_file, NULL, _IOFBF, 0) != 0)
rb_warn("setvbuf() can't be honoured for %s", RSTRING_PTR(fptr->pathv));
#endif
+ if (fptr->stdio_file == stderr) {
+ if (setvbuf(fptr->stdio_file, NULL, _IONBF, BUFSIZ) != 0)
+ rb_warn("setvbuf() can't be honoured for %s", RSTRING_PTR(fptr->pathv));
+ }
+ else if (fptr->stdio_file == stdout && isatty(fptr->fd)) {
+ if (setvbuf(fptr->stdio_file, NULL, _IOLBF, BUFSIZ) != 0)
+ rb_warn("setvbuf() can't be honoured for %s", RSTRING_PTR(fptr->pathv));
+ }
}
else {
if (close(fptr->fd) < 0)
@@ -5928,7 +6421,7 @@ rb_io_init_copy(VALUE dest, VALUE io)
off_t pos;
io = rb_io_get_io(io);
- if (dest == io) return dest;
+ if (!OBJ_INIT_COPY(dest, io)) return dest;
GetOpenFile(io, orig);
MakeOpenFile(dest, fptr);
@@ -5998,7 +6491,7 @@ rb_f_printf(int argc, VALUE *argv)
VALUE out;
if (argc == 0) return Qnil;
- if (TYPE(argv[0]) == T_STRING) {
+ if (RB_TYPE_P(argv[0], T_STRING)) {
out = rb_stdout;
}
else {
@@ -6110,7 +6603,7 @@ static VALUE
rb_io_putc(VALUE io, VALUE ch)
{
VALUE str;
- if (TYPE(ch) == T_STRING) {
+ if (RB_TYPE_P(ch, T_STRING)) {
str = rb_str_substr(ch, 0, 1);
}
else {
@@ -6167,13 +6660,15 @@ io_puts_ary(VALUE ary, VALUE out, int recur)
if (recur) {
tmp = rb_str_new2("[...]");
rb_io_puts(1, &tmp, out);
- return Qnil;
+ return Qtrue;
}
+ ary = rb_check_array_type(ary);
+ if (NIL_P(ary)) return Qfalse;
for (i=0; i<RARRAY_LEN(ary); i++) {
tmp = RARRAY_PTR(ary)[i];
rb_io_puts(1, &tmp, out);
}
- return Qnil;
+ return Qtrue;
}
/*
@@ -6208,13 +6703,11 @@ rb_io_puts(int argc, VALUE *argv, VALUE out)
return Qnil;
}
for (i=0; i<argc; i++) {
- if (TYPE(argv[i]) == T_STRING) {
+ if (RB_TYPE_P(argv[i], T_STRING)) {
line = argv[i];
goto string;
}
- line = rb_check_array_type(argv[i]);
- if (!NIL_P(line)) {
- rb_exec_recursive(io_puts_ary, line, out);
+ if (rb_exec_recursive(io_puts_ary, argv[i], out)) {
continue;
}
line = rb_obj_as_string(argv[i]);
@@ -6251,7 +6744,7 @@ void
rb_p(VALUE obj) /* for debug print within C code */
{
VALUE str = rb_obj_as_string(rb_inspect(obj));
- if (TYPE(rb_stdout) == T_FILE &&
+ if (RB_TYPE_P(rb_stdout, T_FILE) &&
rb_method_basic_definition_p(CLASS_OF(rb_stdout), id_write)) {
io_write(rb_stdout, str, 1);
io_write(rb_stdout, rb_default_rs, 0);
@@ -6295,7 +6788,7 @@ rb_f_p(int argc, VALUE *argv, VALUE self)
else if (argc > 1) {
ret = rb_ary_new4(argc, argv);
}
- if (TYPE(rb_stdout) == T_FILE) {
+ if (RB_TYPE_P(rb_stdout, T_FILE)) {
rb_io_flush(rb_stdout);
}
return ret;
@@ -6344,7 +6837,10 @@ void
rb_write_error2(const char *mesg, long len)
{
if (rb_stderr == orig_stderr || RFILE(orig_stderr)->fptr->fd < 0) {
- (void)fwrite(mesg, sizeof(char), len, stderr);
+ if (fwrite(mesg, sizeof(char), (size_t)len, stderr) < (size_t)len) {
+ /* failed to write to stderr, what can we do? */
+ return;
+ }
}
else {
rb_io_write(rb_stderr, rb_str_new(mesg, len));
@@ -6409,9 +6905,16 @@ static VALUE
prep_stdio(FILE *f, int fmode, VALUE klass, const char *path)
{
rb_io_t *fptr;
- VALUE io = prep_io(fileno(f), fmode|FMODE_PREP, klass, path);
+ VALUE io = prep_io(fileno(f), fmode|FMODE_PREP|DEFAULT_TEXTMODE, klass, path);
GetOpenFile(io, fptr);
+ fptr->encs.ecflags |= ECONV_DEFAULT_NEWLINE_DECORATOR;
+#ifdef TEXTMODE_NEWLINE_DECORATOR_ON_WRITE
+ fptr->encs.ecflags |= TEXTMODE_NEWLINE_DECORATOR_ON_WRITE;
+ if (fmode & FMODE_READABLE) {
+ fptr->encs.ecflags |= ECONV_UNIVERSAL_NEWLINE_DECORATOR;
+ }
+#endif
fptr->stdio_file = f;
return io;
@@ -6431,59 +6934,117 @@ rb_io_stdio_file(rb_io_t *fptr)
* call-seq:
* IO.new(fd [, mode] [, opt]) -> io
*
- * Returns a new IO object (a stream) for the given IO object or integer file
- * descriptor and mode string. See also IO.sysopen and IO.for_fd.
+ * Returns a new IO object (a stream) for the given integer file descriptor
+ * +fd+ and +mode+ string. +opt+ may be used to specify parts of +mode+ in a
+ * more readable fashion. See also IO.sysopen and IO.for_fd.
*
- * === Parameters
+ * IO.new is called by various File and IO opening methods such as IO::open,
+ * Kernel#open, and File::open.
+ *
+ * === Open Mode
+ *
+ * When +mode+ is an integer it must be combination of the modes defined in
+ * File::Constants (+File::RDONLY+, +File::WRONLY | File::CREAT+). See the
+ * open(2) man page for more information.
+ *
+ * When +mode+ is a string it must be in one of the following forms:
+ *
+ * fmode
+ * fmode ":" ext_enc
+ * fmode ":" ext_enc ":" int_enc
+ * fmode ":" "BOM|UTF-*"
+ *
+ * +fmode+ is an IO open mode string, +ext_enc+ is the external encoding for
+ * the IO and +int_enc+ is the internal encoding.
+ *
+ * ==== IO Open Mode
+ *
+ * Ruby allows the following open modes:
+ *
+ * "r" Read-only, starts at beginning of file (default mode).
+ *
+ * "r+" Read-write, starts at beginning of file.
+ *
+ * "w" Write-only, truncates existing file
+ * to zero length or creates a new file for writing.
+ *
+ * "w+" Read-write, truncates existing file to zero length
+ * or creates a new file for reading and writing.
*
- * fd:: numeric file descriptor or IO object
- * mode:: file mode. a string or an integer
- * opt:: hash for specifying +mode+ by name.
+ * "a" Write-only, starts at end of file if file exists,
+ * otherwise creates a new file for writing.
*
- * ==== Mode
+ * "a+" Read-write, starts at end of file if file exists,
+ * otherwise creates a new file for reading and
+ * writing.
*
- * When mode is an integer it must be combination of the modes defined in
- * File::Constants.
+ * The following modes must be used separately, and along with one or more of
+ * the modes seen above.
*
- * When mode is a string it must be in one of the following forms:
- * - "fmode",
- * - "fmode:extern",
- * - "fmode:extern:intern".
- * <code>extern</code> is the external encoding name for the IO.
- * <code>intern</code> is the internal encoding.
- * <code>fmode</code> must be a file open mode string. See the description of
- * class IO for mode string directives.
+ * "b" Binary file mode
+ * Suppresses EOL <-> CRLF conversion on Windows. And
+ * sets external encoding to ASCII-8BIT unless explicitly
+ * specified.
*
- * When the mode of original IO is read only, the mode cannot be changed to
- * be writable. Similarly, the mode cannot be changed from write only to
- * readable.
+ * "t" Text file mode
+ *
+ * When the open mode of original IO is read only, the mode cannot be
+ * changed to be writable. Similarly, the open mode cannot be changed from
+ * write only to readable.
*
* When such a change is attempted the error is raised in different locations
* according to the platform.
*
- * ==== Options
- * +opt+ can have the following keys
+ * === IO Encoding
+ *
+ * When +ext_enc+ is specified, strings read will be tagged by the encoding
+ * when reading, and strings output will be converted to the specified
+ * encoding when writing.
+ *
+ * When +ext_enc+ and +int_enc+ are specified read strings will be converted
+ * from +ext_enc+ to +int_enc+ upon input, and written strings will be
+ * converted from +int_enc+ to +ext_enc+ upon output. See Encoding for
+ * further details of transcoding on input and output.
+ *
+ * If "BOM|UTF-8", "BOM|UTF-16LE" or "BOM|UTF16-BE" are used, ruby checks for
+ * a Unicode BOM in the input document to help determine the encoding. For
+ * UTF-16 encodings the file open mode must be binary. When present, the BOM
+ * is stripped and the external encoding from the BOM is used. When the BOM
+ * is missing the given Unicode encoding is used as +ext_enc+. (The BOM-set
+ * encoding option is case insensitive, so "bom|utf-8" is also valid.)
+ *
+ * === Options
+ *
+ * +opt+ can be used instead of +mode+ for improved readability. The
+ * following keys are supported:
+ *
* :mode ::
* Same as +mode+ parameter
- * :external_encoding ::
+ *
+ * :\external_encoding ::
* External encoding for the IO. "-" is a synonym for the default external
* encoding.
- * :internal_encoding ::
+ *
+ * :\internal_encoding ::
* Internal encoding for the IO. "-" is a synonym for the default internal
* encoding.
*
* If the value is nil no conversion occurs.
+ *
* :encoding ::
* Specifies external and internal encodings as "extern:intern".
+ *
* :textmode ::
* If the value is truth value, same as "t" in argument +mode+.
+ *
* :binmode ::
* If the value is truth value, same as "b" in argument +mode+.
+ *
* :autoclose ::
* If the value is +false+, the +fd+ will be kept open after this IO
* instance gets finalized.
*
- * Also +opt+ can have same keys in String#encode for controlling conversion
+ * Also, +opt+ can have same keys in String#encode for controlling conversion
* between the external encoding and the internal encoding.
*
* === Example 1
@@ -6493,7 +7054,7 @@ rb_io_stdio_file(rb_io_t *fptr)
* $stderr.puts "Hello"
* a.puts "World"
*
- * <em>produces:</em>
+ * Produces:
*
* Hello
* World
@@ -6580,20 +7141,14 @@ rb_io_initialize(int argc, VALUE *argv, VALUE io)
* File.new(filename, mode="r" [, opt]) -> file
* File.new(filename [, mode [, perm]] [, opt]) -> file
*
- * Opens the file named by +filename+ according to +mode+ (default is "r")
- * and returns a new <code>File</code> object.
- *
- * === Parameters
+ * Opens the file named by +filename+ according to the given +mode+ and
+ * returns a new File object.
*
- * See the description of class IO for a description of +mode+. The file
- * mode may optionally be specified as a Fixnum by +or+-ing together the
- * flags (O_RDONLY etc, again described under +IO+).
+ * See IO.new for a description of +mode+ and +opt+.
*
- * Optional permission bits may be given in +perm+. These mode and
- * permission bits are platform dependent; on Unix systems, see
- * <code>open(2)</code> for details.
- *
- * Optional +opt+ parameter is same as in IO.open.
+ * If a file is being created, permission bits may be given in +perm+. These
+ * mode and permission bits are platform dependent; on Unix systems, see
+ * open(2) and chmod(2) man pages for details.
*
* === Examples
*
@@ -6716,6 +7271,21 @@ argf_free(void *ptr)
xfree(p);
}
+static size_t
+argf_memsize(const void *ptr)
+{
+ const struct argf *p = ptr;
+ size_t size = sizeof(*p);
+ if (!ptr) return 0;
+ if (p->inplace) size += strlen(p->inplace) + 1;
+ return size;
+}
+
+static const rb_data_type_t argf_type = {
+ "ARGF",
+ {argf_mark, argf_free, argf_memsize},
+};
+
static inline void
argf_init(struct argf *p, VALUE v)
{
@@ -6729,7 +7299,7 @@ static VALUE
argf_alloc(VALUE klass)
{
struct argf *p;
- VALUE argf = Data_Make_Struct(klass, struct argf, argf_mark, argf_free, p);
+ VALUE argf = TypedData_Make_Struct(klass, struct argf, &argf_type, p);
argf_init(p, Qnil);
return argf;
@@ -6751,6 +7321,7 @@ argf_initialize(VALUE argf, VALUE argv)
static VALUE
argf_initialize_copy(VALUE argf, VALUE orig)
{
+ if (!OBJ_INIT_COPY(argf, orig)) return argf;
ARGF = argf_of(orig);
ARGF.argv = rb_obj_dup(ARGF.argv);
if (ARGF.inplace) {
@@ -6763,7 +7334,7 @@ argf_initialize_copy(VALUE argf, VALUE orig)
/*
* call-seq:
- * ARGF.lineno = number -> nil
+ * ARGF.lineno = integer -> integer
*
* Sets the line number of +ARGF+ as a whole to the given +Integer+.
*
@@ -6776,7 +7347,7 @@ argf_initialize_copy(VALUE argf, VALUE orig)
* ARGF.lineno #=> 0
* ARGF.readline #=> "This is line 1\n"
* ARGF.lineno #=> 1
- * ARGF.lineno = 0 #=> nil
+ * ARGF.lineno = 0 #=> 0
* ARGF.lineno #=> 0
*/
static VALUE
@@ -6814,7 +7385,7 @@ argf_forward(int argc, VALUE *argv, VALUE argf)
#define next_argv() argf_next_argv(argf)
#define ARGF_GENERIC_INPUT_P() \
- (ARGF.current_file == rb_stdin && TYPE(ARGF.current_file) != T_FILE)
+ (ARGF.current_file == rb_stdin && !RB_TYPE_P(ARGF.current_file, T_FILE))
#define ARGF_FORWARD(argc, argv) do {\
if (ARGF_GENERIC_INPUT_P())\
return argf_forward((argc), (argv), argf);\
@@ -6827,6 +7398,7 @@ argf_forward(int argc, VALUE *argv, VALUE argf)
static void
argf_close(VALUE file)
{
+ if (file == rb_stdin) return;
if (RB_TYPE_P(file, T_FILE)) {
rb_io_set_write_io(file, Qnil);
}
@@ -6839,8 +7411,9 @@ argf_next_argv(VALUE argf)
char *fn;
rb_io_t *fptr;
int stdout_binmode = 0;
+ int fmode;
- if (TYPE(rb_stdout) == T_FILE) {
+ if (RB_TYPE_P(rb_stdout, T_FILE)) {
GetOpenFile(rb_stdout, fptr);
if (fptr->mode & FMODE_BINMODE)
stdout_binmode = 1;
@@ -6855,6 +7428,14 @@ argf_next_argv(VALUE argf)
}
ARGF.init_p = 1;
}
+ else {
+ if (NIL_P(ARGF.argv)) {
+ ARGF.next_p = -1;
+ }
+ else if (ARGF.next_p == -1 && RARRAY_LEN(ARGF.argv) > 0) {
+ ARGF.next_p = 1;
+ }
+ }
if (ARGF.next_p == 1) {
retry:
@@ -6880,21 +7461,21 @@ argf_next_argv(VALUE argf)
VALUE str;
int fw;
- if (TYPE(rb_stdout) == T_FILE && rb_stdout != orig_stdout) {
+ if (RB_TYPE_P(rb_stdout, T_FILE) && rb_stdout != orig_stdout) {
rb_io_close(rb_stdout);
}
fstat(fr, &st);
if (*ARGF.inplace) {
str = rb_str_new2(fn);
-#ifdef NO_LONG_FNAME
- ruby_add_suffix(str, ARGF.inplace);
-#else
rb_str_cat2(str, ARGF.inplace);
-#endif
#ifdef NO_SAFE_RENAME
(void)close(fr);
(void)unlink(RSTRING_PTR(str));
- (void)rename(fn, RSTRING_PTR(str));
+ if (rename(fn, RSTRING_PTR(str)) < 0) {
+ rb_warn("Can't rename %s to %s: %s, skipping file",
+ fn, RSTRING_PTR(str), strerror(errno));
+ goto retry;
+ }
fr = rb_sysopen(str, O_RDONLY, 0);
#else
if (rename(fn, RSTRING_PTR(str)) < 0) {
@@ -6947,19 +7528,30 @@ argf_next_argv(VALUE argf)
rb_stdout = write_io;
if (stdout_binmode) rb_io_binmode(rb_stdout);
}
- ARGF.current_file = prep_io(fr, FMODE_READABLE, rb_cFile, fn);
+ fmode = FMODE_READABLE;
+ if (!ARGF.binmode) {
+ fmode |= DEFAULT_TEXTMODE;
+ }
+ ARGF.current_file = prep_io(fr, fmode, rb_cFile, fn);
if (!NIL_P(write_io)) {
rb_io_set_write_io(ARGF.current_file, write_io);
}
}
if (ARGF.binmode) rb_io_ascii8bit_binmode(ARGF.current_file);
+ GetOpenFile(ARGF.current_file, fptr);
if (ARGF.encs.enc) {
- rb_io_t *fptr;
-
- GetOpenFile(ARGF.current_file, fptr);
fptr->encs = ARGF.encs;
clear_codeconv(fptr);
}
+ else {
+ fptr->encs.ecflags &= ~ECONV_NEWLINE_DECORATOR_MASK;
+ if (!ARGF.binmode) {
+ fptr->encs.ecflags |= ECONV_DEFAULT_NEWLINE_DECORATOR;
+#ifdef TEXTMODE_NEWLINE_DECORATOR_ON_WRITE
+ fptr->encs.ecflags |= TEXTMODE_NEWLINE_DECORATOR_ON_WRITE;
+#endif
+ }
+ }
ARGF.next_p = 0;
}
else {
@@ -7230,6 +7822,7 @@ argf_readlines(int argc, VALUE *argv, VALUE argf)
ARGF.lineno = lineno + RARRAY_LEN(ary);
ARGF.last_lineno = ARGF.lineno;
}
+ ARGF.init_p = 0;
return ary;
}
@@ -7255,6 +7848,7 @@ rb_f_backquote(VALUE obj, VALUE str)
rb_io_t *fptr;
SafeStringValue(str);
+ rb_last_status_clear();
port = pipe_open_s(str, "r", FMODE_READABLE|DEFAULT_TEXTMODE, NULL);
if (NIL_P(port)) return rb_str_new(0,0);
@@ -7486,7 +8080,7 @@ do_io_advise(rb_io_t *fptr, VALUE advice, off_t offset, off_t len)
* The platform doesn't support this hint. We don't raise exception, instead
* silently ignore it. Because IO::advise is only hint.
*/
- if (num_adv == Qnil)
+ if (NIL_P(num_adv))
return Qnil;
ias.fd = fptr->fd;
@@ -7495,10 +8089,11 @@ do_io_advise(rb_io_t *fptr, VALUE advice, off_t offset, off_t len)
ias.len = len;
rv = (int)rb_thread_io_blocking_region(io_advise_internal, &ias, fptr->fd);
- if (rv)
+ if (rv) {
/* posix_fadvise(2) doesn't set errno. On success it returns 0; otherwise
it returns the error code. */
- rb_syserr_fail(rv, RSTRING_PTR(fptr->pathv));
+ rb_syserr_fail_str(rv, fptr->pathv);
+ }
return Qnil;
}
@@ -7583,7 +8178,7 @@ rb_io_advise(int argc, VALUE *argv, VALUE io)
#ifdef HAVE_POSIX_FADVISE
return do_io_advise(fptr, advice, off, l);
#else
- /* Ignore all hint */
+ ((void)off, (void)l); /* Ignore all hint */
return Qnil;
#endif
}
@@ -7662,60 +8257,228 @@ rb_f_select(int argc, VALUE *argv, VALUE obj)
return rb_ensure(select_call, (VALUE)&args, select_end, (VALUE)&args);
}
-struct io_cntl_arg {
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
+ typedef unsigned long ioctl_req_t;
+# define NUM2IOCTLREQ(num) NUM2ULONG(num)
+#else
+ typedef int ioctl_req_t;
+# define NUM2IOCTLREQ(num) NUM2INT(num)
+#endif
+
+struct ioctl_arg {
int fd;
- int cmd;
+ ioctl_req_t cmd;
long narg;
- int io_p;
};
-static VALUE nogvl_io_cntl(void *ptr)
+static VALUE
+nogvl_ioctl(void *ptr)
{
- struct io_cntl_arg *arg = ptr;
+ struct ioctl_arg *arg = ptr;
- if (arg->io_p)
- return (VALUE)ioctl(arg->fd, arg->cmd, arg->narg);
- else
- return (VALUE)fcntl(arg->fd, arg->cmd, arg->narg);
+ return (VALUE)ioctl(arg->fd, arg->cmd, arg->narg);
}
static int
-io_cntl(int fd, int cmd, long narg, int io_p)
+do_ioctl(int fd, ioctl_req_t cmd, long narg)
{
int retval;
- struct io_cntl_arg arg;
-
-#ifndef HAVE_FCNTL
- if (!io_p) {
- rb_notimplement();
- }
-#endif
+ struct ioctl_arg arg;
arg.fd = fd;
arg.cmd = cmd;
arg.narg = narg;
- arg.io_p = io_p;
- retval = (int)rb_thread_io_blocking_region(nogvl_io_cntl, &arg, fd);
-#if defined(F_DUPFD)
- if (!io_p && retval != -1 && cmd == F_DUPFD) {
- rb_update_max_fd(retval);
+ retval = (int)rb_thread_io_blocking_region(nogvl_ioctl, &arg, fd);
+
+ return retval;
+}
+
+#define DEFULT_IOCTL_NARG_LEN (256)
+
+#ifdef __linux__
+static long
+linux_iocparm_len(ioctl_req_t cmd)
+{
+ long len;
+
+ if ((cmd & 0xFFFF0000) == 0) {
+ /* legacy and unstructured ioctl number. */
+ return DEFULT_IOCTL_NARG_LEN;
}
+
+ len = _IOC_SIZE(cmd);
+
+ /* paranoia check for silly drivers which don't keep ioctl convention */
+ if (len < DEFULT_IOCTL_NARG_LEN)
+ len = DEFULT_IOCTL_NARG_LEN;
+
+ return len;
+}
#endif
- return retval;
+static long
+ioctl_narg_len(ioctl_req_t cmd)
+{
+ long len;
+
+#ifdef IOCPARM_MASK
+#ifndef IOCPARM_LEN
+#define IOCPARM_LEN(x) (((x) >> 16) & IOCPARM_MASK)
+#endif
+#endif
+#ifdef IOCPARM_LEN
+ len = IOCPARM_LEN(cmd); /* on BSDish systems we're safe */
+#elif defined(__linux__)
+ len = linux_iocparm_len(cmd);
+#else
+ /* otherwise guess at what's safe */
+ len = DEFULT_IOCTL_NARG_LEN;
+#endif
+
+ return len;
}
-static VALUE
-rb_io_ctl(VALUE io, VALUE req, VALUE arg, int io_p)
+#ifdef HAVE_FCNTL
+#ifdef __linux__
+typedef long fcntl_arg_t;
+#else
+/* posix */
+typedef int fcntl_arg_t;
+#endif
+
+static long
+fcntl_narg_len(int cmd)
{
- int cmd = NUM2INT(req);
- rb_io_t *fptr;
- long len = 0;
- long narg = 0;
- int retval;
+ long len;
- rb_secure(2);
+ switch (cmd) {
+#ifdef F_DUPFD
+ case F_DUPFD:
+ len = sizeof(fcntl_arg_t);
+ break;
+#endif
+#ifdef F_DUP2FD /* bsd specific */
+ case F_DUP2FD:
+ len = sizeof(int);
+ break;
+#endif
+#ifdef F_DUPFD_CLOEXEC /* linux specific */
+ case F_DUPFD_CLOEXEC:
+ len = sizeof(fcntl_arg_t);
+ break;
+#endif
+#ifdef F_GETFD
+ case F_GETFD:
+ len = 1;
+ break;
+#endif
+#ifdef F_SETFD
+ case F_SETFD:
+ len = sizeof(fcntl_arg_t);
+ break;
+#endif
+#ifdef F_GETFL
+ case F_GETFL:
+ len = 1;
+ break;
+#endif
+#ifdef F_SETFL
+ case F_SETFL:
+ len = sizeof(fcntl_arg_t);
+ break;
+#endif
+#ifdef F_GETOWN
+ case F_GETOWN:
+ len = 1;
+ break;
+#endif
+#ifdef F_SETOWN
+ case F_SETOWN:
+ len = sizeof(fcntl_arg_t);
+ break;
+#endif
+#ifdef F_GETOWN_EX /* linux specific */
+ case F_GETOWN_EX:
+ len = sizeof(struct f_owner_ex);
+ break;
+#endif
+#ifdef F_SETOWN_EX /* linux specific */
+ case F_SETOWN_EX:
+ len = sizeof(struct f_owner_ex);
+ break;
+#endif
+#ifdef F_GETLK
+ case F_GETLK:
+ len = sizeof(struct flock);
+ break;
+#endif
+#ifdef F_SETLK
+ case F_SETLK:
+ len = sizeof(struct flock);
+ break;
+#endif
+#ifdef F_SETLKW
+ case F_SETLKW:
+ len = sizeof(struct flock);
+ break;
+#endif
+#ifdef F_READAHEAD /* bsd specific */
+ case F_READAHEAD:
+ len = sizeof(int);
+ break;
+#endif
+#ifdef F_RDAHEAD /* Darwin specific */
+ case F_RDAHEAD:
+ len = sizeof(int);
+ break;
+#endif
+#ifdef F_GETSIG /* linux specific */
+ case F_GETSIG:
+ len = 1;
+ break;
+#endif
+#ifdef F_SETSIG /* linux specific */
+ case F_SETSIG:
+ len = sizeof(fcntl_arg_t);
+ break;
+#endif
+#ifdef F_GETLEASE /* linux specific */
+ case F_GETLEASE:
+ len = 1;
+ break;
+#endif
+#ifdef F_SETLEASE /* linux specific */
+ case F_SETLEASE:
+ len = sizeof(fcntl_arg_t);
+ break;
+#endif
+#ifdef F_NOTIFY /* linux specific */
+ case F_NOTIFY:
+ len = sizeof(fcntl_arg_t);
+ break;
+#endif
+
+ default:
+ len = 256;
+ break;
+ }
+
+ return len;
+}
+#else /* HAVE_FCNTL */
+static long
+fcntl_narg_len(int cmd)
+{
+ return 0;
+}
+#endif /* HAVE_FCNTL */
+
+static long
+setup_narg(ioctl_req_t cmd, VALUE *argp, int io_p)
+{
+ long narg = 0;
+ VALUE arg = *argp;
if (NIL_P(arg) || arg == Qfalse) {
narg = 0;
@@ -7733,50 +8496,51 @@ rb_io_ctl(VALUE io, VALUE req, VALUE arg, int io_p)
narg = NUM2LONG(arg);
}
else {
- arg = tmp;
-#ifdef IOCPARM_MASK
-#ifndef IOCPARM_LEN
-#define IOCPARM_LEN(x) (((x) >> 16) & IOCPARM_MASK)
-#endif
-#endif
-#ifdef IOCPARM_LEN
- len = IOCPARM_LEN(cmd); /* on BSDish systems we're safe */
-#else
- len = 256; /* otherwise guess at what's safe */
-#endif
+ long len;
+
+ *argp = arg = tmp;
+ if (io_p)
+ len = ioctl_narg_len(cmd);
+ else
+ len = fcntl_narg_len((int)cmd);
rb_str_modify(arg);
- if (len <= RSTRING_LEN(arg)) {
- len = RSTRING_LEN(arg);
- }
- if (RSTRING_LEN(arg) < len) {
+ /* expand for data + sentinel. */
+ if (RSTRING_LEN(arg) < len+1) {
rb_str_resize(arg, len+1);
}
- RSTRING_PTR(arg)[len] = 17; /* a little sanity check here */
+ /* a little sanity check here */
+ RSTRING_PTR(arg)[RSTRING_LEN(arg) - 1] = 17;
narg = (long)(SIGNED_VALUE)RSTRING_PTR(arg);
}
}
+
+ return narg;
+}
+
+static VALUE
+rb_ioctl(VALUE io, VALUE req, VALUE arg)
+{
+ ioctl_req_t cmd = NUM2IOCTLREQ(req);
+ rb_io_t *fptr;
+ long narg;
+ int retval;
+
+ rb_secure(2);
+
+ narg = setup_narg(cmd, &arg, 1);
GetOpenFile(io, fptr);
- retval = io_cntl(fptr->fd, cmd, narg, io_p);
+ retval = do_ioctl(fptr->fd, cmd, narg);
if (retval < 0) rb_sys_fail_path(fptr->pathv);
- if (TYPE(arg) == T_STRING && RSTRING_PTR(arg)[len] != 17) {
- rb_raise(rb_eArgError, "return value overflowed string");
- }
-
- if (!io_p && cmd == F_SETFL) {
- if (narg & O_NONBLOCK) {
- fptr->mode |= FMODE_WSPLIT_INITIALIZED;
- fptr->mode &= ~FMODE_WSPLIT;
- }
- else {
- fptr->mode &= ~(FMODE_WSPLIT_INITIALIZED|FMODE_WSPLIT);
- }
+ if (RB_TYPE_P(arg, T_STRING)) {
+ if (RSTRING_PTR(arg)[RSTRING_LEN(arg)-1] != 17)
+ rb_raise(rb_eArgError, "return value overflowed string");
+ RSTRING_PTR(arg)[RSTRING_LEN(arg)-1] = '\0';
}
return INT2NUM(retval);
}
-
/*
* call-seq:
* ios.ioctl(integer_cmd, arg) -> integer
@@ -7795,10 +8559,81 @@ rb_io_ioctl(int argc, VALUE *argv, VALUE io)
VALUE req, arg;
rb_scan_args(argc, argv, "11", &req, &arg);
- return rb_io_ctl(io, req, arg, 1);
+ return rb_ioctl(io, req, arg);
}
#ifdef HAVE_FCNTL
+struct fcntl_arg {
+ int fd;
+ int cmd;
+ long narg;
+};
+
+static VALUE
+nogvl_fcntl(void *ptr)
+{
+ struct fcntl_arg *arg = ptr;
+
+#if defined(F_DUPFD)
+ if (arg->cmd == F_DUPFD)
+ return (VALUE)rb_cloexec_fcntl_dupfd(arg->fd, (int)arg->narg);
+#endif
+ return (VALUE)fcntl(arg->fd, arg->cmd, arg->narg);
+}
+
+static int
+do_fcntl(int fd, int cmd, long narg)
+{
+ int retval;
+ struct fcntl_arg arg;
+
+ arg.fd = fd;
+ arg.cmd = cmd;
+ arg.narg = narg;
+
+ retval = (int)rb_thread_io_blocking_region(nogvl_fcntl, &arg, fd);
+#if defined(F_DUPFD)
+ if (retval != -1 && cmd == F_DUPFD) {
+ rb_update_max_fd(retval);
+ }
+#endif
+
+ return retval;
+}
+
+static VALUE
+rb_fcntl(VALUE io, VALUE req, VALUE arg)
+{
+ int cmd = NUM2INT(req);
+ rb_io_t *fptr;
+ long narg;
+ int retval;
+
+ rb_secure(2);
+
+ narg = setup_narg(cmd, &arg, 0);
+ GetOpenFile(io, fptr);
+ retval = do_fcntl(fptr->fd, cmd, narg);
+ if (retval < 0) rb_sys_fail_path(fptr->pathv);
+ if (RB_TYPE_P(arg, T_STRING)) {
+ if (RSTRING_PTR(arg)[RSTRING_LEN(arg)-1] != 17)
+ rb_raise(rb_eArgError, "return value overflowed string");
+ RSTRING_PTR(arg)[RSTRING_LEN(arg)-1] = '\0';
+ }
+
+ if (cmd == F_SETFL) {
+ if (narg & O_NONBLOCK) {
+ fptr->mode |= FMODE_WSPLIT_INITIALIZED;
+ fptr->mode &= ~FMODE_WSPLIT;
+ }
+ else {
+ fptr->mode &= ~(FMODE_WSPLIT_INITIALIZED|FMODE_WSPLIT);
+ }
+ }
+
+ return INT2NUM(retval);
+}
+
/*
* call-seq:
* ios.fcntl(integer_cmd, arg) -> integer
@@ -7818,7 +8653,7 @@ rb_io_fcntl(int argc, VALUE *argv, VALUE io)
VALUE req, arg;
rb_scan_args(argc, argv, "11", &req, &arg);
- return rb_io_ctl(io, req, arg, 0);
+ return rb_fcntl(io, req, arg);
}
#else
#define rb_io_fcntl rb_f_notimplement
@@ -7877,7 +8712,7 @@ rb_f_syscall(int argc, VALUE *argv)
# else
# error ---->> it is asserted that __syscall takes the first argument and returns retval in 64bit signed integer. <<----
# endif
-#elif defined linux
+#elif defined(__linux__)
# define SYSCALL syscall
# define NUM2SYSCALLID(x) NUM2LONG(x)
# define RETVAL2NUM(x) LONG2NUM(x)
@@ -7990,6 +8825,14 @@ io_new_instance(VALUE args)
return rb_class_new_instance(2, (VALUE*)args+1, *(VALUE*)args);
}
+static rb_encoding *
+find_encoding(VALUE v)
+{
+ rb_encoding *enc = rb_find_encoding(v);
+ if (!enc) unsupported_encoding(StringValueCStr(v));
+ return enc;
+}
+
static void
io_encoding_set(rb_io_t *fptr, VALUE v1, VALUE v2, VALUE opt)
{
@@ -7998,7 +8841,7 @@ io_encoding_set(rb_io_t *fptr, VALUE v1, VALUE v2, VALUE opt)
VALUE ecopts, tmp;
if (!NIL_P(v2)) {
- enc2 = rb_to_encoding(v1);
+ enc2 = find_encoding(v1);
tmp = rb_check_string_type(v2);
if (!NIL_P(tmp)) {
if (RSTRING_LEN(tmp) == 1 && RSTRING_PTR(tmp)[0] == '-') {
@@ -8007,30 +8850,39 @@ io_encoding_set(rb_io_t *fptr, VALUE v1, VALUE v2, VALUE opt)
enc2 = NULL;
}
else
- enc = rb_to_encoding(v2);
+ enc = find_encoding(v2);
if (enc == enc2) {
/* Special case - "-" => no transcoding */
enc2 = NULL;
}
}
- else
- enc = rb_to_encoding(v2);
+ else {
+ enc = find_encoding(v2);
+ if (enc == enc2) {
+ /* Special case - "-" => no transcoding */
+ enc2 = NULL;
+ }
+ }
+ SET_UNIVERSAL_NEWLINE_DECORATOR_IF_ENC2(enc2, ecflags);
ecflags = rb_econv_prepare_options(opt, &ecopts, ecflags);
}
else {
if (NIL_P(v1)) {
/* Set to default encodings */
rb_io_ext_int_to_encs(NULL, NULL, &enc, &enc2);
+ SET_UNIVERSAL_NEWLINE_DECORATOR_IF_ENC2(enc2, ecflags);
ecopts = Qnil;
}
else {
tmp = rb_check_string_type(v1);
if (!NIL_P(tmp) && rb_enc_asciicompat(rb_enc_get(tmp))) {
parse_mode_enc(RSTRING_PTR(tmp), &enc, &enc2, NULL);
+ SET_UNIVERSAL_NEWLINE_DECORATOR_IF_ENC2(enc2, ecflags);
ecflags = rb_econv_prepare_options(opt, &ecopts, ecflags);
}
else {
- rb_io_ext_int_to_encs(rb_to_encoding(v1), NULL, &enc, &enc2);
+ rb_io_ext_int_to_encs(find_encoding(v1), NULL, &enc, &enc2);
+ SET_UNIVERSAL_NEWLINE_DECORATOR_IF_ENC2(enc2, ecflags);
ecopts = Qnil;
}
}
@@ -8149,13 +9001,22 @@ rb_io_s_pipe(int argc, VALUE *argv, VALUE klass)
extract_binmode(opt, &fmode);
#if DEFAULT_TEXTMODE
- if ((fptr->mode & FMODE_TEXTMODE) && (fmode & FMODE_BINMODE))
+ if ((fptr->mode & FMODE_TEXTMODE) && (fmode & FMODE_BINMODE)) {
fptr->mode &= ~FMODE_TEXTMODE;
+ setmode(fptr->fd, O_BINARY);
+ }
+#if defined(RUBY_TEST_CRLF_ENVIRONMENT) || defined(_WIN32)
+ if (fptr->encs.ecflags & ECONV_DEFAULT_NEWLINE_DECORATOR) {
+ fptr->encs.ecflags |= ECONV_UNIVERSAL_NEWLINE_DECORATOR;
+ }
+#endif
#endif
fptr->mode |= fmode;
#if DEFAULT_TEXTMODE
- if ((fptr2->mode & FMODE_TEXTMODE) && (fmode & FMODE_BINMODE))
+ if ((fptr2->mode & FMODE_TEXTMODE) && (fmode & FMODE_BINMODE)) {
fptr2->mode &= ~FMODE_TEXTMODE;
+ setmode(fptr2->fd, O_BINARY);
+ }
#endif
fptr2->mode |= fmode;
@@ -8253,10 +9114,11 @@ static VALUE
rb_io_s_foreach(int argc, VALUE *argv, VALUE self)
{
VALUE opt;
+ int orig_argc = argc;
struct foreach_arg arg;
argc = rb_scan_args(argc, argv, "13:", NULL, NULL, NULL, NULL, &opt);
- RETURN_ENUMERATOR(self, argc, argv);
+ RETURN_ENUMERATOR(self, orig_argc, argv);
open_key_args(argc, argv, opt, &arg);
if (NIL_P(arg.io)) return Qnil;
return rb_ensure(io_s_foreach, (VALUE)&arg, rb_io_close, arg.io);
@@ -8323,31 +9185,35 @@ seek_before_access(VALUE argp)
* IO.read(name, [length [, offset]] ) -> string
* IO.read(name, [length [, offset]], open_args) -> string
*
- * Opens the file, optionally seeks to the given <i>offset</i>, then returns
- * <i>length</i> bytes (defaulting to the rest of the file).
- * <code>read</code> ensures the file is closed before returning.
+ * Opens the file, optionally seeks to the given +offset+, then returns
+ * +length+ bytes (defaulting to the rest of the file). <code>read</code>
+ * ensures the file is closed before returning.
*
* If the last argument is a hash, it specifies option for internal
* open(). The key would be the following. open_args: is exclusive
* to others.
*
- * encoding: string or encoding
+ * encoding::
+ * string or encoding
*
- * specifies encoding of the read string. encoding will be ignored
+ * specifies encoding of the read string. +encoding+ will be ignored
* if length is specified.
*
- * mode: string
+ * mode::
+ * string
*
- * specifies mode argument for open(). it should start with "r"
- * otherwise it would cause error.
+ * specifies mode argument for open(). It should start with "r"
+ * otherwise it will cause an error.
*
- * open_args: array of strings
+ * open_args:: array of strings
*
* specifies arguments for open() as an array.
*
- * IO.read("testfile") #=> "This is line one\nThis is line two\nThis is line three\nAnd so on...\n"
- * IO.read("testfile", 20) #=> "This is line one\nThi"
- * IO.read("testfile", 20, 10) #=> "ne one\nThis is line "
+ * Examples:
+ *
+ * IO.read("testfile") #=> "This is line one\nThis is line two\nThis is line three\nAnd so on...\n"
+ * IO.read("testfile", 20) #=> "This is line one\nThi"
+ * IO.read("testfile", 20, 10) #=> "ne one\nThis is line "
*/
static VALUE
@@ -8490,12 +9356,14 @@ io_s_write(int argc, VALUE *argv, int binary)
*
* specifies perm argument for open().
*
- * open_args: array of strings
+ * open_args: array
*
* specifies arguments for open() as an array.
*
- * IO.write("testfile", "0123456789") #=> "0123456789"
- * IO.write("testfile", "0123456789", 20) #=> "This is line one\nThi0123456789two\nThis is line three\nAnd so on...\n"
+ * IO.write("testfile", "0123456789", 20) # => 10
+ * # File could contain: "This is line one\nThi0123456789two\nThis is line three\nAnd so on...\n"
+ * IO.write("testfile", "0123456789") #=> 10
+ * # File would now read: "0123456789"
*/
static VALUE
@@ -8507,16 +9375,11 @@ rb_io_s_write(int argc, VALUE *argv, VALUE io)
/*
* call-seq:
* IO.binwrite(name, string, [offset] ) => fixnum
+ * IO.binwrite(name, string, [offset], open_args ) => fixnum
*
- * Opens the file, optionally seeks to the given <i>offset</i>, write
- * <i>string</i> then returns the length written.
- * <code>binwrite</code> ensures the file is closed before returning.
- * The open mode would be "wb:ASCII-8BIT".
- * If <i>offset</i> is not given, the file is truncated. Otherwise,
- * it is not truncated.
+ * Same as <code>IO.write</code> except opening the file in binary mode
+ * and ASCII-8BIT encoding ("wb:ASCII-8BIT").
*
- * IO.binwrite("testfile", "0123456789") #=> "0123456789"
- * IO.binwrite("testfile", "0123456789", 20) #=> "This is line one\nThi0123456789two\nThis is line three\nAnd so on...\n"
*/
static VALUE
@@ -8756,7 +9619,7 @@ nogvl_copy_stream_sendfile(struct copy_stream_struct *stp)
#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
case EWOULDBLOCK:
#endif
-#ifndef linux
+#ifndef __linux__
/*
* Linux requires stp->src_fd to be a mmap-able (regular) file,
* select() reports regular files to always be "ready", so
@@ -8914,7 +9777,7 @@ nogvl_copy_stream_read_write(struct copy_stream_struct *stp)
}
}
-static VALUE
+static void *
nogvl_copy_stream_func(void *arg)
{
struct copy_stream_struct *stp = (struct copy_stream_struct *)arg;
@@ -8933,7 +9796,7 @@ nogvl_copy_stream_func(void *arg)
#ifdef USE_SENDFILE
finish:
#endif
- return Qnil;
+ return 0;
}
static VALUE
@@ -8965,11 +9828,13 @@ copy_stream_fallback_body(VALUE arg)
l = buflen < rest ? buflen : (long)rest;
}
if (stp->src_fd == -1) {
- rb_funcall(stp->src, read_method, 2, INT2FIX(l), buf);
+ VALUE rc = rb_funcall(stp->src, read_method, 2, INT2FIX(l), buf);
+
+ if (read_method == id_read && NIL_P(rc))
+ break;
}
else {
ssize_t ss;
- rb_thread_wait_fd(stp->src_fd);
rb_str_resize(buf, buflen);
ss = maygvl_copy_stream_read(1, stp, RSTRING_PTR(buf), l, off);
if (ss == -1)
@@ -9017,13 +9882,13 @@ copy_stream_body(VALUE arg)
stp->total = 0;
if (stp->src == argf ||
- !(TYPE(stp->src) == T_FILE ||
- TYPE(stp->src) == T_STRING ||
+ !(RB_TYPE_P(stp->src, T_FILE) ||
+ RB_TYPE_P(stp->src, T_STRING) ||
rb_respond_to(stp->src, rb_intern("to_path")))) {
src_fd = -1;
}
else {
- src_io = TYPE(stp->src) == T_FILE ? stp->src : Qnil;
+ src_io = RB_TYPE_P(stp->src, T_FILE) ? stp->src : Qnil;
if (NIL_P(src_io)) {
VALUE args[2];
int oflags = O_RDONLY;
@@ -9044,13 +9909,13 @@ copy_stream_body(VALUE arg)
stp->src_fd = src_fd;
if (stp->dst == argf ||
- !(TYPE(stp->dst) == T_FILE ||
- TYPE(stp->dst) == T_STRING ||
+ !(RB_TYPE_P(stp->dst, T_FILE) ||
+ RB_TYPE_P(stp->dst, T_STRING) ||
rb_respond_to(stp->dst, rb_intern("to_path")))) {
dst_fd = -1;
}
else {
- dst_io = TYPE(stp->dst) == T_FILE ? stp->dst : Qnil;
+ dst_io = RB_TYPE_P(stp->dst, T_FILE) ? stp->dst : Qnil;
if (NIL_P(dst_io)) {
VALUE args[3];
int oflags = O_WRONLY|O_CREAT|O_TRUNC;
@@ -9060,7 +9925,7 @@ copy_stream_body(VALUE arg)
FilePathValue(stp->dst);
args[0] = stp->dst;
args[1] = INT2NUM(oflags);
- args[2] = INT2FIX(0600);
+ args[2] = INT2FIX(0666);
dst_io = rb_class_new_instance(3, args, rb_cFile);
stp->dst = dst_io;
stp->close_dst = 1;
@@ -9075,6 +9940,13 @@ copy_stream_body(VALUE arg)
}
stp->dst_fd = dst_fd;
+#ifdef O_BINARY
+ if (src_fptr)
+ SET_BINARY_MODE_WITH_SEEK_CUR(src_fptr);
+ if (dst_fptr)
+ setmode(dst_fd, O_BINARY);
+#endif
+
if (stp->src_offset == (off_t)-1 && src_fptr && src_fptr->rbuf.len) {
size_t len = src_fptr->rbuf.len;
VALUE str;
@@ -9109,7 +9981,8 @@ copy_stream_body(VALUE arg)
rb_fd_set(src_fd, &stp->fds);
rb_fd_set(dst_fd, &stp->fds);
- return rb_thread_blocking_region(nogvl_copy_stream_func, (void*)stp, RUBY_UBF_IO, 0);
+ rb_thread_call_without_gvl(nogvl_copy_stream_func, (void*)stp, RUBY_UBF_IO, 0);
+ return Qnil;
}
static VALUE
@@ -9258,7 +10131,7 @@ rb_io_set_encoding(int argc, VALUE *argv, VALUE io)
rb_io_t *fptr;
VALUE v1, v2, opt;
- if (TYPE(io) != T_FILE) {
+ if (!RB_TYPE_P(io, T_FILE)) {
return rb_funcall2(io, id_set_encoding, argc, argv);
}
@@ -9528,7 +10401,7 @@ argf_eof(VALUE argf)
/*
* call-seq:
- * ARGF.read([length [, buffer]]) -> string, buffer, or nil
+ * ARGF.read([length [, outbuf]]) -> string, outbuf, or nil
*
* Reads _length_ bytes from ARGF. The files named on the command line
* are concatenated and treated as a single file by this method, so when
@@ -9545,8 +10418,10 @@ argf_eof(VALUE argf)
*
* If _length_ is zero, it returns _""_.
*
- * If the optional _buffer_ argument is present, it must reference a String,
+ * If the optional _outbuf_ argument is present, it must reference a String,
* which will receive the data.
+ * The <i>outbuf</i> will contain only the received data after the method call
+ * even if it is not empty at the beginning.
*
* For example:
*
@@ -9632,7 +10507,10 @@ static VALUE argf_getpartial(int argc, VALUE *argv, VALUE argf, int nonblock);
* Reads at most _maxlen_ bytes from the ARGF stream. It blocks only if
* +ARGF+ has no data immediately available. If the optional _outbuf_
* argument is present, it must reference a String, which will receive the
- * data. It raises <code>EOFError</code> on end of file.
+ * data.
+ * The <i>outbuf</i> will contain only the received data after the method call
+ * even if it is not empty at the beginning.
+ * It raises <code>EOFError</code> on end of file.
*
* +readpartial+ is designed for streams such as pipes, sockets, and ttys. It
* blocks only when no data is immediately available. This means that it
@@ -9783,7 +10661,7 @@ argf_getbyte(VALUE argf)
retry:
if (!next_argv()) return Qnil;
- if (TYPE(ARGF.current_file) != T_FILE) {
+ if (!RB_TYPE_P(ARGF.current_file, T_FILE)) {
ch = rb_funcall3(ARGF.current_file, rb_intern("getbyte"), 0, 0);
}
else {
@@ -9823,7 +10701,7 @@ argf_readchar(VALUE argf)
retry:
if (!next_argv()) rb_eof_error();
- if (TYPE(ARGF.current_file) != T_FILE) {
+ if (!RB_TYPE_P(ARGF.current_file, T_FILE)) {
ch = rb_funcall3(ARGF.current_file, rb_intern("getc"), 0, 0);
}
else {
@@ -9983,6 +10861,36 @@ argf_each_char(VALUE argf)
/*
* call-seq:
+ * ARGF.codepoints {|codepoint| block } -> ARGF
+ * ARGF.codepoints -> an_enumerator
+ *
+ * ARGF.each_codepoint {|codepoint| block } -> ARGF
+ * ARGF.each_codepoint -> an_enumerator
+ *
+ * Iterates over each codepoint of each file in +ARGF+.
+ *
+ * This method allows you to treat the files supplied on the command line as
+ * a single file consisting of the concatenation of each named file. After
+ * the last codepoint of the first file has been returned, the first
+ * codepoint of the second file is returned. The +ARGF.filename+ method can
+ * be used to determine the name of the file in which the current codepoint
+ * appears.
+ *
+ * If no block is given, an enumerator is returned instead.
+ */
+static VALUE
+argf_each_codepoint(VALUE argf)
+{
+ RETURN_ENUMERATOR(argf, 0, 0);
+ for (;;) {
+ if (!next_argv()) return argf;
+ rb_block_call(ARGF.current_file, rb_intern("each_codepoint"), 0, 0, 0, 0);
+ ARGF.next_p = 1;
+ }
+}
+
+/*
+ * call-seq:
* ARGF.filename -> String
* ARGF.path -> String
*
@@ -10379,85 +11287,82 @@ argf_write(VALUE argf, VALUE str)
*/
/*
- * Class <code>IO</code> is the basis for all input and output in Ruby.
+ * The IO class is the basis for all input and output in Ruby.
* An I/O stream may be <em>duplexed</em> (that is, bidirectional), and
* so may use more than one native operating system stream.
*
- * Many of the examples in this section use class <code>File</code>,
- * the only standard subclass of <code>IO</code>. The two classes are
- * closely associated.
+ * Many of the examples in this section use the File class, the only standard
+ * subclass of IO. The two classes are closely associated. Like the File
+ * class, the Socket library subclasses from IO (such as TCPSocket or
+ * UDPSocket).
*
- * As used in this section, <em>portname</em> may take any of the
- * following forms.
+ * The Kernel#open method can create an IO (or File) object for these types
+ * of arguments:
*
* * A plain string represents a filename suitable for the underlying
* operating system.
*
- * * A string starting with ``<code>|</code>'' indicates a subprocess.
- * The remainder of the string following the ``<code>|</code>'' is
+ * * A string starting with <code>"|"</code> indicates a subprocess.
+ * The remainder of the string following the <code>"|"</code> is
* invoked as a process with appropriate input/output channels
* connected to it.
*
- * * A string equal to ``<code>|-</code>'' will create another Ruby
+ * * A string equal to <code>"|-"</code> will create another Ruby
* instance as a subprocess.
*
+ * The IO may be opened with different file modes (read-only, write-only) and
+ * encodings for proper conversion. See IO.new for these options. See
+ * Kernel#open for details of the various command formats described above.
+ *
+ * IO.popen, the Open3 library, or Process#spawn may also be used to
+ * communicate with subprocesses through an IO.
+ *
* Ruby will convert pathnames between different operating system
- * conventions if possible. For instance, on a Windows system the
- * filename ``<code>/gumby/ruby/test.rb</code>'' will be opened as
- * ``<code>\gumby\ruby\test.rb</code>''. When specifying a
- * Windows-style filename in a Ruby string, remember to escape the
- * backslashes:
+ * conventions if possible. For instance, on a Windows system the
+ * filename <code>"/gumby/ruby/test.rb"</code> will be opened as
+ * <code>"\gumby\ruby\test.rb"</code>. When specifying a Windows-style
+ * filename in a Ruby string, remember to escape the backslashes:
*
- * "c:\\gumby\\ruby\\test.rb"
+ * "c:\\gumby\\ruby\\test.rb"
*
* Our examples here will use the Unix-style forward slashes;
- * <code>File::SEPARATOR</code> can be used to get the
- * platform-specific separator character.
- *
- * I/O ports may be opened in any one of several different modes, which
- * are shown in this section as <em>mode</em>. The mode may
- * either be a Fixnum or a String. If numeric, it should be
- * one of the operating system specific constants (O_RDONLY,
- * O_WRONLY, O_RDWR, O_APPEND and so on). See man open(2) for
- * more information.
- *
- * If the mode is given as a String, it must be one of the
- * values listed in the following table.
- *
- * Mode | Meaning
- * -----+--------------------------------------------------------
- * "r" | Read-only, starts at beginning of file (default mode).
- * -----+--------------------------------------------------------
- * "r+" | Read-write, starts at beginning of file.
- * -----+--------------------------------------------------------
- * "w" | Write-only, truncates existing file
- * | to zero length or creates a new file for writing.
- * -----+--------------------------------------------------------
- * "w+" | Read-write, truncates existing file to zero length
- * | or creates a new file for reading and writing.
- * -----+--------------------------------------------------------
- * "a" | Write-only, starts at end of file if file exists,
- * | otherwise creates a new file for writing.
- * -----+--------------------------------------------------------
- * "a+" | Read-write, starts at end of file if file exists,
- * | otherwise creates a new file for reading and
- * | writing.
- * -----+--------------------------------------------------------
- * "b" | Binary file mode (may appear with
- * | any of the key letters listed above).
- * | Suppresses EOL <-> CRLF conversion on Windows. And
- * | sets external encoding to ASCII-8BIT unless explicitly
- * | specified.
- * -----+--------------------------------------------------------
- * "t" | Text file mode (may appear with
- * | any of the key letters listed above except "b").
- *
+ * File::ALT_SEPARATOR can be used to get the platform-specific separator
+ * character.
*
* The global constant ARGF (also accessible as $<) provides an
* IO-like stream which allows access to all files mentioned on the
- * command line (or STDIN if no files are mentioned). ARGF provides
- * the methods <code>#path</code> and <code>#filename</code> to access
- * the name of the file currently being read.
+ * command line (or STDIN if no files are mentioned). ARGF#path and its alias
+ * ARGF#filename are provided to access the name of the file currently being
+ * read.
+ *
+ * == io/console
+ *
+ * The io/console extension provides methods for interacting with the
+ * console. The console can be accessed from IO.console or the standard
+ * input/output/error IO objects.
+ *
+ * Requiring io/console adds the following methods:
+ *
+ * * IO::console
+ * * IO#raw
+ * * IO#raw!
+ * * IO#cooked
+ * * IO#cooked!
+ * * IO#getch
+ * * IO#echo=
+ * * IO#echo?
+ * * IO#noecho
+ * * IO#winsize
+ * * IO#winsize=
+ * * IO#iflush
+ * * IO#ioflush
+ * * IO#oflush
+ *
+ * Example:
+ *
+ * require 'io/console'
+ * rows, columns = $stdin.winsize
+ * puts "Your screen is #{columns} wide and #{rows} tall"
*/
void
@@ -10656,10 +11561,11 @@ Init_IO(void)
/* Holds the original stderr */
rb_define_global_const("STDERR", rb_stderr);
- /*
- * Hack to get rdoc to regard ARGF as a class:
- * rb_cARGF = rb_define_class("ARGF", rb_cObject);
- */
+#if 0
+ /* Hack to get rdoc to regard ARGF as a class: */
+ rb_cARGF = rb_define_class("ARGF", rb_cObject);
+#endif
+
rb_cARGF = rb_class_new(rb_cObject);
rb_set_class_path(rb_cARGF, rb_cObject, "ARGF.class");
rb_define_alloc_func(rb_cARGF, argf_alloc);
@@ -10669,6 +11575,7 @@ Init_IO(void)
rb_define_method(rb_cARGF, "initialize", argf_initialize, -2);
rb_define_method(rb_cARGF, "initialize_copy", argf_initialize_copy, 1);
rb_define_method(rb_cARGF, "to_s", argf_to_s, 0);
+ rb_define_alias(rb_cARGF, "inspect", "to_s");
rb_define_method(rb_cARGF, "argv", argf_argv, 0);
rb_define_method(rb_cARGF, "fileno", argf_fileno, 0);
@@ -10679,9 +11586,11 @@ Init_IO(void)
rb_define_method(rb_cARGF, "each_line", argf_each_line, -1);
rb_define_method(rb_cARGF, "each_byte", argf_each_byte, 0);
rb_define_method(rb_cARGF, "each_char", argf_each_char, 0);
+ rb_define_method(rb_cARGF, "each_codepoint", argf_each_codepoint, 0);
rb_define_method(rb_cARGF, "lines", argf_each_line, -1);
rb_define_method(rb_cARGF, "bytes", argf_each_byte, 0);
rb_define_method(rb_cARGF, "chars", argf_each_char, 0);
+ rb_define_method(rb_cARGF, "codepoints", argf_each_codepoint, 0);
rb_define_method(rb_cARGF, "read", argf_read, -1);
rb_define_method(rb_cARGF, "readpartial", argf_readpartial, -1);
@@ -10753,58 +11662,6 @@ Init_IO(void)
rb_define_method(rb_cFile, "initialize", rb_file_initialize, -1);
- /* open for reading only */
- rb_file_const("RDONLY", INT2FIX(O_RDONLY));
- /* open for writing only */
- rb_file_const("WRONLY", INT2FIX(O_WRONLY));
- /* open for reading and writing */
- rb_file_const("RDWR", INT2FIX(O_RDWR));
- /* append on each write */
- rb_file_const("APPEND", INT2FIX(O_APPEND));
- /* create file if it does not exist */
- rb_file_const("CREAT", INT2FIX(O_CREAT));
- /* error if CREAT and the file exists */
- rb_file_const("EXCL", INT2FIX(O_EXCL));
-#if defined(O_NDELAY) || defined(O_NONBLOCK)
-# ifndef O_NONBLOCK
-# define O_NONBLOCK O_NDELAY
-# endif
- /* do not block on open or for data to become available */
- rb_file_const("NONBLOCK", INT2FIX(O_NONBLOCK));
-#endif
- /* truncate size to 0 */
- rb_file_const("TRUNC", INT2FIX(O_TRUNC));
-#ifdef O_NOCTTY
- /* not to make opened IO the controlling terminal device */
- rb_file_const("NOCTTY", INT2FIX(O_NOCTTY));
-#endif
-#ifndef O_BINARY
-# define O_BINARY 0
-#endif
- /* disable line code conversion and make ASCII-8BIT */
- rb_file_const("BINARY", INT2FIX(O_BINARY));
-#ifdef O_SYNC
- rb_file_const("SYNC", INT2FIX(O_SYNC));
-#endif
-#ifdef O_DSYNC
- rb_file_const("DSYNC", INT2FIX(O_DSYNC));
-#endif
-#ifdef O_RSYNC
- rb_file_const("RSYNC", INT2FIX(O_RSYNC));
-#endif
-#ifdef O_NOFOLLOW
- /* do not follow symlinks */
- rb_file_const("NOFOLLOW", INT2FIX(O_NOFOLLOW)); /* FreeBSD, Linux */
-#endif
-#ifdef O_NOATIME
- /* do not change atime */
- rb_file_const("NOATIME", INT2FIX(O_NOATIME)); /* Linux */
-#endif
-#ifdef O_DIRECT
- /* Try to minimize cache effects of the I/O to and from this file. */
- rb_file_const("DIRECT", INT2FIX(O_DIRECT));
-#endif
-
sym_mode = ID2SYM(rb_intern("mode"));
sym_perm = ID2SYM(rb_intern("perm"));
sym_extenc = ID2SYM(rb_intern("external_encoding"));
diff --git a/iseq.c b/iseq.c
index c0cf98357f..7fc35df3e7 100644
--- a/iseq.c
+++ b/iseq.c
@@ -11,17 +11,20 @@
#include "ruby/ruby.h"
#include "internal.h"
+#include "eval_intern.h"
/* #define RUBY_MARK_FREE_DEBUG 1 */
#include "gc.h"
#include "vm_core.h"
#include "iseq.h"
+#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
+
#include "insns.inc"
#include "insns_info.inc"
-#define ISEQ_MAJOR_VERSION 1
-#define ISEQ_MINOR_VERSION 2
+#define ISEQ_MAJOR_VERSION 2
+#define ISEQ_MINOR_VERSION 0
VALUE rb_cISeq;
@@ -69,8 +72,8 @@ iseq_free(void *ptr)
if (!iseq->orig) {
/* It's possible that strings are freed */
if (0) {
- RUBY_GC_INFO("%s @ %s\n", RSTRING_PTR(iseq->name),
- RSTRING_PTR(iseq->filename));
+ RUBY_GC_INFO("%s @ %s\n", RSTRING_PTR(iseq->location.label),
+ RSTRING_PTR(iseq->location.path));
}
if (iseq->iseq != iseq->iseq_encoded) {
@@ -78,11 +81,13 @@ iseq_free(void *ptr)
}
RUBY_FREE_UNLESS_NULL(iseq->iseq);
- RUBY_FREE_UNLESS_NULL(iseq->insn_info_table);
+ RUBY_FREE_UNLESS_NULL(iseq->line_info_table);
RUBY_FREE_UNLESS_NULL(iseq->local_table);
RUBY_FREE_UNLESS_NULL(iseq->ic_entries);
+ RUBY_FREE_UNLESS_NULL(iseq->callinfo_entries);
RUBY_FREE_UNLESS_NULL(iseq->catch_table);
RUBY_FREE_UNLESS_NULL(iseq->arg_opt_table);
+ RUBY_FREE_UNLESS_NULL(iseq->arg_keyword_table);
compile_data_free(iseq->compile_data);
}
ruby_xfree(ptr);
@@ -98,11 +103,14 @@ iseq_mark(void *ptr)
if (ptr) {
rb_iseq_t *iseq = ptr;
- RUBY_GC_INFO("%s @ %s\n", RSTRING_PTR(iseq->name), RSTRING_PTR(iseq->filename));
+ RUBY_GC_INFO("%s @ %s\n", RSTRING_PTR(iseq->location.label), RSTRING_PTR(iseq->location.path));
RUBY_MARK_UNLESS_NULL(iseq->mark_ary);
- RUBY_MARK_UNLESS_NULL(iseq->name);
- RUBY_MARK_UNLESS_NULL(iseq->filename);
- RUBY_MARK_UNLESS_NULL(iseq->filepath);
+
+ RUBY_MARK_UNLESS_NULL(iseq->location.label);
+ RUBY_MARK_UNLESS_NULL(iseq->location.base_label);
+ RUBY_MARK_UNLESS_NULL(iseq->location.path);
+ RUBY_MARK_UNLESS_NULL(iseq->location.absolute_path);
+
RUBY_MARK_UNLESS_NULL((VALUE)iseq->cref_stack);
RUBY_MARK_UNLESS_NULL(iseq->klass);
RUBY_MARK_UNLESS_NULL(iseq->coverage);
@@ -136,11 +144,12 @@ iseq_memsize(const void *ptr)
}
size += iseq->iseq_size * sizeof(VALUE);
- size += iseq->insn_info_size * sizeof(struct iseq_insn_info_entry);
+ size += iseq->line_info_size * sizeof(struct iseq_line_info_entry);
size += iseq->local_table_size * sizeof(ID);
size += iseq->catch_table_size * sizeof(struct iseq_catch_table_entry);
size += iseq->arg_opts * sizeof(VALUE);
size += iseq->ic_size * sizeof(struct iseq_inline_cache_entry);
+ size += iseq->callinfo_size * sizeof(rb_call_info_t);
if (iseq->compile_data) {
struct iseq_compile_data_storage *cur;
@@ -174,45 +183,51 @@ iseq_alloc(VALUE klass)
return TypedData_Make_Struct(klass, rb_iseq_t, &iseq_data_type, iseq);
}
+static rb_iseq_location_t *
+iseq_location_setup(rb_iseq_t *iseq, VALUE path, VALUE absolute_path, VALUE name, size_t first_lineno)
+{
+ rb_iseq_location_t *loc = &iseq->location;
+ loc->path = path;
+ loc->absolute_path = absolute_path;
+ loc->label = loc->base_label = name;
+ loc->first_lineno = first_lineno;
+ return loc;
+}
+
static void
set_relation(rb_iseq_t *iseq, const VALUE parent)
{
const VALUE type = iseq->type;
rb_thread_t *th = GET_THREAD();
+ rb_iseq_t *piseq;
/* set class nest stack */
if (type == ISEQ_TYPE_TOP) {
/* toplevel is private */
- iseq->cref_stack = NEW_BLOCK(rb_cObject);
+ iseq->cref_stack = NEW_CREF(rb_cObject);
+ iseq->cref_stack->nd_refinements = Qnil;
iseq->cref_stack->nd_visi = NOEX_PRIVATE;
if (th->top_wrapper) {
- NODE *cref = NEW_BLOCK(th->top_wrapper);
+ NODE *cref = NEW_CREF(th->top_wrapper);
+ cref->nd_refinements = Qnil;
cref->nd_visi = NOEX_PRIVATE;
cref->nd_next = iseq->cref_stack;
iseq->cref_stack = cref;
}
+ iseq->local_iseq = iseq;
}
else if (type == ISEQ_TYPE_METHOD || type == ISEQ_TYPE_CLASS) {
- iseq->cref_stack = NEW_BLOCK(0); /* place holder */
- }
- else if (RTEST(parent)) {
- rb_iseq_t *piseq;
- GetISeqPtr(parent, piseq);
- iseq->cref_stack = piseq->cref_stack;
- }
-
- if (type == ISEQ_TYPE_TOP ||
- type == ISEQ_TYPE_METHOD || type == ISEQ_TYPE_CLASS) {
+ iseq->cref_stack = NEW_CREF(0); /* place holder */
+ iseq->cref_stack->nd_refinements = Qnil;
iseq->local_iseq = iseq;
}
else if (RTEST(parent)) {
- rb_iseq_t *piseq;
GetISeqPtr(parent, piseq);
+ iseq->cref_stack = piseq->cref_stack;
iseq->local_iseq = piseq->local_iseq;
}
if (RTEST(parent)) {
- rb_iseq_t *piseq;
GetISeqPtr(parent, piseq);
iseq->parent_iseq = piseq;
}
@@ -220,26 +235,30 @@ set_relation(rb_iseq_t *iseq, const VALUE parent)
static VALUE
prepare_iseq_build(rb_iseq_t *iseq,
- VALUE name, VALUE filename, VALUE filepath, VALUE line_no,
+ VALUE name, VALUE path, VALUE absolute_path, VALUE first_lineno,
VALUE parent, enum iseq_type type, VALUE block_opt,
const rb_compile_option_t *option)
{
+ iseq->type = type;
+ iseq->arg_rest = -1;
+ iseq->arg_block = -1;
+ iseq->arg_keyword = -1;
+ iseq->klass = 0;
+ set_relation(iseq, parent);
+
OBJ_FREEZE(name);
- OBJ_FREEZE(filename);
+ OBJ_FREEZE(path);
+
+ iseq_location_setup(iseq, path, absolute_path, name, first_lineno);
+ if (iseq != iseq->local_iseq) {
+ iseq->location.base_label = iseq->local_iseq->location.label;
+ }
- iseq->name = name;
- iseq->filename = filename;
- iseq->filepath = filepath;
- iseq->line_no = (unsigned short)line_no; /* TODO: really enough? */
iseq->defined_method_id = 0;
iseq->mark_ary = rb_ary_tmp_new(3);
OBJ_UNTRUST(iseq->mark_ary);
RBASIC(iseq->mark_ary)->klass = 0;
- iseq->type = type;
- iseq->arg_rest = -1;
- iseq->arg_block = -1;
- iseq->klass = 0;
/*
* iseq->special_block_builder = GC_GUARDED_PTR_REF(block_opt);
@@ -267,13 +286,11 @@ prepare_iseq_build(rb_iseq_t *iseq,
iseq->compile_data->option = option;
iseq->compile_data->last_coverable_line = -1;
- set_relation(iseq, parent);
-
iseq->coverage = Qfalse;
if (!GET_THREAD()->parse_in_eval) {
VALUE coverages = rb_get_coverages();
if (RTEST(coverages)) {
- iseq->coverage = rb_hash_lookup(coverages, filename);
+ iseq->coverage = rb_hash_lookup(coverages, path);
if (NIL_P(iseq->coverage)) iseq->coverage = Qfalse;
}
}
@@ -290,7 +307,7 @@ cleanup_iseq_build(rb_iseq_t *iseq)
compile_data_free(data);
if (RTEST(err)) {
- rb_funcall2(err, rb_intern("set_backtrace"), 1, &iseq->filename);
+ rb_funcall2(err, rb_intern("set_backtrace"), 1, &iseq->location.path);
rb_exc_raise(err);
}
return Qtrue;
@@ -365,6 +382,7 @@ make_compile_option_value(rb_compile_option_t *option)
SET_COMPILE_OPTION(option, opt, operands_unification);
SET_COMPILE_OPTION(option, opt, instructions_unification);
SET_COMPILE_OPTION(option, opt, stack_caching);
+ SET_COMPILE_OPTION(option, opt, trace_instruction);
SET_COMPILE_OPTION_NUM(option, opt, debug_level);
}
#undef SET_COMPILE_OPTION
@@ -373,31 +391,31 @@ make_compile_option_value(rb_compile_option_t *option)
}
VALUE
-rb_iseq_new(NODE *node, VALUE name, VALUE filename, VALUE filepath,
+rb_iseq_new(NODE *node, VALUE name, VALUE path, VALUE absolute_path,
VALUE parent, enum iseq_type type)
{
- return rb_iseq_new_with_opt(node, name, filename, filepath, INT2FIX(0), parent, type,
+ return rb_iseq_new_with_opt(node, name, path, absolute_path, INT2FIX(0), parent, type,
&COMPILE_OPTION_DEFAULT);
}
VALUE
-rb_iseq_new_top(NODE *node, VALUE name, VALUE filename, VALUE filepath, VALUE parent)
+rb_iseq_new_top(NODE *node, VALUE name, VALUE path, VALUE absolute_path, VALUE parent)
{
- return rb_iseq_new_with_opt(node, name, filename, filepath, INT2FIX(0), parent, ISEQ_TYPE_TOP,
+ return rb_iseq_new_with_opt(node, name, path, absolute_path, INT2FIX(0), parent, ISEQ_TYPE_TOP,
&COMPILE_OPTION_DEFAULT);
}
VALUE
-rb_iseq_new_main(NODE *node, VALUE filename, VALUE filepath)
+rb_iseq_new_main(NODE *node, VALUE path, VALUE absolute_path)
{
rb_thread_t *th = GET_THREAD();
VALUE parent = th->base_block->iseq->self;
- return rb_iseq_new_with_opt(node, rb_str_new2("<main>"), filename, filepath, INT2FIX(0),
+ return rb_iseq_new_with_opt(node, rb_str_new2("<main>"), path, absolute_path, INT2FIX(0),
parent, ISEQ_TYPE_MAIN, &COMPILE_OPTION_DEFAULT);
}
static VALUE
-rb_iseq_new_with_bopt_and_opt(NODE *node, VALUE name, VALUE filename, VALUE filepath, VALUE line_no,
+rb_iseq_new_with_bopt_and_opt(NODE *node, VALUE name, VALUE path, VALUE absolute_path, VALUE first_lineno,
VALUE parent, enum iseq_type type, VALUE bopt,
const rb_compile_option_t *option)
{
@@ -407,28 +425,28 @@ rb_iseq_new_with_bopt_and_opt(NODE *node, VALUE name, VALUE filename, VALUE file
GetISeqPtr(self, iseq);
iseq->self = self;
- prepare_iseq_build(iseq, name, filename, filepath, line_no, parent, type, bopt, option);
+ prepare_iseq_build(iseq, name, path, absolute_path, first_lineno, parent, type, bopt, option);
rb_iseq_compile_node(self, node);
cleanup_iseq_build(iseq);
return self;
}
VALUE
-rb_iseq_new_with_opt(NODE *node, VALUE name, VALUE filename, VALUE filepath, VALUE line_no,
+rb_iseq_new_with_opt(NODE *node, VALUE name, VALUE path, VALUE absolute_path, VALUE first_lineno,
VALUE parent, enum iseq_type type,
const rb_compile_option_t *option)
{
/* TODO: argument check */
- return rb_iseq_new_with_bopt_and_opt(node, name, filename, filepath, line_no, parent, type,
+ return rb_iseq_new_with_bopt_and_opt(node, name, path, absolute_path, first_lineno, parent, type,
Qfalse, option);
}
VALUE
-rb_iseq_new_with_bopt(NODE *node, VALUE name, VALUE filename, VALUE filepath, VALUE line_no,
+rb_iseq_new_with_bopt(NODE *node, VALUE name, VALUE path, VALUE absolute_path, VALUE first_lineno,
VALUE parent, enum iseq_type type, VALUE bopt)
{
/* TODO: argument check */
- return rb_iseq_new_with_bopt_and_opt(node, name, filename, filepath, line_no, parent, type,
+ return rb_iseq_new_with_bopt_and_opt(node, name, path, absolute_path, first_lineno, parent, type,
bopt, &COMPILE_OPTION_DEFAULT);
}
@@ -442,7 +460,7 @@ iseq_load(VALUE self, VALUE data, VALUE parent, VALUE opt)
VALUE iseqval = iseq_alloc(self);
VALUE magic, version1, version2, format_type, misc;
- VALUE name, filename, filepath, line_no;
+ VALUE name, path, absolute_path, first_lineno;
VALUE type, body, locals, args, exception;
st_data_t iseq_type;
@@ -452,7 +470,7 @@ iseq_load(VALUE self, VALUE data, VALUE parent, VALUE opt)
int i = 0;
/* [magic, major_version, minor_version, format_type, misc,
- * name, filename, line_no,
+ * label, path, first_lineno,
* type, locals, args, exception_table, body]
*/
@@ -463,12 +481,13 @@ iseq_load(VALUE self, VALUE data, VALUE parent, VALUE opt)
version2 = CHECK_INTEGER(rb_ary_entry(data, i++));
format_type = CHECK_INTEGER(rb_ary_entry(data, i++));
misc = rb_ary_entry(data, i++); /* TODO */
+ ((void)magic, (void)version1, (void)version2, (void)format_type, (void)misc);
name = CHECK_STRING(rb_ary_entry(data, i++));
- filename = CHECK_STRING(rb_ary_entry(data, i++));
- filepath = rb_ary_entry(data, i++);
- filepath = NIL_P(filepath) ? Qnil : CHECK_STRING(filepath);
- line_no = CHECK_INTEGER(rb_ary_entry(data, i++));
+ path = CHECK_STRING(rb_ary_entry(data, i++));
+ absolute_path = rb_ary_entry(data, i++);
+ absolute_path = NIL_P(absolute_path) ? Qnil : CHECK_STRING(absolute_path);
+ first_lineno = CHECK_INTEGER(rb_ary_entry(data, i++));
type = CHECK_SYMBOL(rb_ary_entry(data, i++));
locals = CHECK_ARRAY(rb_ary_entry(data, i++));
@@ -498,11 +517,12 @@ iseq_load(VALUE self, VALUE data, VALUE parent, VALUE opt)
}
if (st_lookup(type_map, type, &iseq_type) == 0) {
- const char *typename = rb_id2name(type);
+ ID typeid = SYM2ID(type);
+ VALUE typename = rb_id2str(typeid);
if (typename)
- rb_raise(rb_eTypeError, "unsupport type: :%s", typename);
+ rb_raise(rb_eTypeError, "unsupport type: :%"PRIsVALUE, typename);
else
- rb_raise(rb_eTypeError, "unsupport type: %p", (void *)type);
+ rb_raise(rb_eTypeError, "unsupport type: %p", (void *)typeid);
}
if (parent == Qnil) {
@@ -510,7 +530,7 @@ iseq_load(VALUE self, VALUE data, VALUE parent, VALUE opt)
}
make_compile_option(&option, opt);
- prepare_iseq_build(iseq, name, filename, filepath, line_no,
+ prepare_iseq_build(iseq, name, path, absolute_path, first_lineno,
parent, (enum iseq_type)iseq_type, 0, &option);
rb_iseq_build_from_ary(iseq, locals, args, exception, body);
@@ -519,6 +539,9 @@ iseq_load(VALUE self, VALUE data, VALUE parent, VALUE opt)
return iseqval;
}
+/*
+ * :nodoc:
+ */
static VALUE
iseq_s_load(int argc, VALUE *argv, VALUE self)
{
@@ -547,32 +570,82 @@ parse_string(VALUE str, const char *file, int line)
}
VALUE
-rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE filepath, VALUE line, VALUE opt)
+rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE absolute_path, VALUE line, rb_block_t *base_block, VALUE opt)
{
- rb_compile_option_t option;
- const char *fn = StringValueCStr(file);
- int ln = NUM2INT(line);
- NODE *node = parse_string(StringValue(src), fn, ln);
+ int state;
rb_thread_t *th = GET_THREAD();
- make_compile_option(&option, opt);
+ rb_block_t *prev_base_block = th->base_block;
+ VALUE iseqval = Qundef;
+
+ th->base_block = base_block;
+
+ TH_PUSH_TAG(th);
+ if ((state = EXEC_TAG()) == 0) {
+ int ln = NUM2INT(line);
+ const char *fn = StringValueCStr(file);
+ NODE *node;
+ rb_compile_option_t option;
- if (th->base_block && th->base_block->iseq) {
- return rb_iseq_new_with_opt(node, th->base_block->iseq->name,
- file, filepath, line, th->base_block->iseq->self,
- ISEQ_TYPE_EVAL, &option);
+ make_compile_option(&option, opt);
+
+ if (RB_TYPE_P((src), T_FILE))
+ node = rb_compile_file(fn, src, ln);
+ else
+ node = parse_string(StringValue(src), fn, ln);
+
+ if (base_block && base_block->iseq) {
+ iseqval = rb_iseq_new_with_opt(node, base_block->iseq->location.label,
+ file, absolute_path, line, base_block->iseq->self,
+ ISEQ_TYPE_EVAL, &option);
+ }
+ else {
+ iseqval = rb_iseq_new_with_opt(node, rb_str_new2("<compiled>"), file, absolute_path, line, Qfalse,
+ ISEQ_TYPE_TOP, &option);
+ }
}
- else {
- return rb_iseq_new_with_opt(node, rb_str_new2("<compiled>"), file, filepath, line, Qfalse,
- ISEQ_TYPE_TOP, &option);
+ TH_POP_TAG();
+
+ th->base_block = prev_base_block;
+
+ if (state) {
+ JUMP_TAG(state);
}
+
+ return iseqval;
}
VALUE
rb_iseq_compile(VALUE src, VALUE file, VALUE line)
{
- return rb_iseq_compile_with_option(src, file, Qnil, line, Qnil);
+ return rb_iseq_compile_with_option(src, file, Qnil, line, 0, Qnil);
}
+VALUE
+rb_iseq_compile_on_base(VALUE src, VALUE file, VALUE line, rb_block_t *base_block)
+{
+ return rb_iseq_compile_with_option(src, file, Qnil, line, base_block, Qnil);
+}
+
+/*
+ * call-seq:
+ * InstructionSequence.compile(source[, file[, path[, line[, options]]]]) -> iseq
+ * InstructionSequence.new(source[, file[, path[, line[, options]]]]) -> iseq
+ *
+ * Takes +source+, a String of Ruby code and compiles it to an
+ * InstructionSequence.
+ *
+ * Optionally takes +file+, +path+, and +line+ which describe the filename,
+ * absolute path and first line number of the ruby code in +source+ which are
+ * metadata attached to the returned +iseq+.
+ *
+ * +options+, which can be +true+, +false+ or a +Hash+, is used to
+ * modify the default behavior of the Ruby iseq compiler. For details
+ * regarding valid compile options see InstructionSequence.compile_option=.
+ *
+ * RubyVM::InstructionSequence.compile("a = 1 + 2")
+ * #=> <RubyVM::InstructionSequence:<compiled>@<compiled>>
+ *
+ */
static VALUE
iseq_s_compile(int argc, VALUE *argv, VALUE self)
{
@@ -584,9 +657,28 @@ iseq_s_compile(int argc, VALUE *argv, VALUE self)
if (NIL_P(file)) file = rb_str_new2("<compiled>");
if (NIL_P(line)) line = INT2FIX(1);
- return rb_iseq_compile_with_option(src, file, path, line, opt);
+ return rb_iseq_compile_with_option(src, file, path, line, 0, opt);
}
+/*
+ * call-seq:
+ * InstructionSequence.compile_file(file[, options]) -> iseq
+ *
+ * Takes +file+, a String with the location of a Ruby source file, reads,
+ * parses and compiles the file, and returns +iseq+, the compiled
+ * InstructionSequence with source location metadata set.
+ *
+ * Optionally takes +options+, which can be +true+, +false+ or a +Hash+, to
+ * modify the default behavior of the Ruby iseq compiler (for details see
+ * InstructionSequence.compile_option=).
+ *
+ * # /tmp/hello.rb
+ * puts "Hello, world!"
+ *
+ * # elsewhere
+ * RubyVM::InstructionSequence.compile_file("/tmp/hello.rb")
+ * #=> <RubyVM::InstructionSequence:<main>@/tmp/hello.rb>
+ */
static VALUE
iseq_s_compile_file(int argc, VALUE *argv, VALUE self)
{
@@ -612,6 +704,35 @@ iseq_s_compile_file(int argc, VALUE *argv, VALUE self)
ISEQ_TYPE_TOP, &option);
}
+/*
+ * call-seq:
+ * InstructionSequence.compile_option = options
+ *
+ * Sets the default values for various optimizations in the Ruby iseq
+ * compiler. Possible values for +options+ include +true+, which enables all
+ * options, +false+ which disables all options, a +Hash+ of options that you
+ * want to change (options not present in the hash will be left unchanged),
+ * and +nil+ which leaves all options unchanged.
+ *
+ * Possible option names (which are keys in +options+) which can be set to
+ * +true+ or +false+ include:
+ *
+ * * +:inline_const_cache+
+ * * +:instructions_unification+
+ * * +:operands_unification+
+ * * +:peephole_optimization+
+ * * +:specialized_instruction+
+ * * +:stack_caching+
+ * * +:tailcall_optimization+
+ * * +:trace_instruction+
+ *
+ * Additionally, +:debug_level+ can be set to an integer.
+ *
+ * These default options can be overwritten for a single run of the iseq
+ * compiler by passing any of the above values as the +options+ parameter to
+ * InstructionSequence.new, InstructionSequence.compile and
+ * InstructionSequence.compile_file.
+ */
static VALUE
iseq_s_compile_option_set(VALUE self, VALUE opt)
{
@@ -622,6 +743,13 @@ iseq_s_compile_option_set(VALUE self, VALUE opt)
return opt;
}
+/*
+ * call-seq:
+ * InstructionSequence.compile_option -> options
+ *
+ * Returns a hash of default options used by the Ruby iseq compiler.
+ * For details, see InstructionSequence.compile_option=.
+ */
static VALUE
iseq_s_compile_option_get(VALUE self)
{
@@ -633,12 +761,20 @@ iseq_check(VALUE val)
{
rb_iseq_t *iseq;
GetISeqPtr(val, iseq);
- if (!iseq->name) {
+ if (!iseq->location.label) {
rb_raise(rb_eTypeError, "uninitialized InstructionSequence");
}
return iseq;
}
+/*
+ * call-seq:
+ * iseq.eval -> obj
+ *
+ * Evaluates the instruction sequence and returns the result.
+ *
+ * RubyVM::InstructionSequence.compile("1 + 2").eval #=> 3
+ */
static VALUE
iseq_eval(VALUE self)
{
@@ -646,23 +782,139 @@ iseq_eval(VALUE self)
return rb_iseq_eval(self);
}
+/*
+ * :nodoc:
+ */
static VALUE
iseq_inspect(VALUE self)
{
rb_iseq_t *iseq;
GetISeqPtr(self, iseq);
- if (!iseq->name) {
+ if (!iseq->location.label) {
return rb_sprintf("#<%s: uninitialized>", rb_obj_classname(self));
}
return rb_sprintf("<%s:%s@%s>",
rb_obj_classname(self),
- RSTRING_PTR(iseq->name), RSTRING_PTR(iseq->filename));
+ RSTRING_PTR(iseq->location.label), RSTRING_PTR(iseq->location.path));
+}
+
+static VALUE
+iseq_path(VALUE self)
+{
+ rb_iseq_t *iseq;
+ GetISeqPtr(self, iseq);
+ return iseq->location.path;
+}
+
+static VALUE
+iseq_absolute_path(VALUE self)
+{
+ rb_iseq_t *iseq;
+ GetISeqPtr(self, iseq);
+ return iseq->location.absolute_path;
+}
+
+static VALUE
+iseq_label(VALUE self)
+{
+ rb_iseq_t *iseq;
+ GetISeqPtr(self, iseq);
+ return iseq->location.label;
+}
+
+static VALUE
+iseq_base_label(VALUE self)
+{
+ rb_iseq_t *iseq;
+ GetISeqPtr(self, iseq);
+ return iseq->location.base_label;
+}
+
+static VALUE
+iseq_first_lineno(VALUE self)
+{
+ rb_iseq_t *iseq;
+ GetISeqPtr(self, iseq);
+ return iseq->location.first_lineno;
}
static
VALUE iseq_data_to_ary(rb_iseq_t *iseq);
+/*
+ * call-seq:
+ * iseq.to_a -> ary
+ *
+ * Returns an Array of size 14 representing the instruction sequence with
+ * the following data:
+ *
+ * [magic]
+ * A string identifying the data format. Always
+ * "YARVInstructionSequence/SimpleDataFormat".
+ *
+ * [major_version]
+ * The major version of the instruction sequence.
+ *
+ * [minor_version]
+ * The minor version of the instruction sequence.
+ *
+ * [format_type]
+ * A number identifying the data format. Always 1.
+ *
+ * [misc]
+ * A hash containing +:arg_size+, the total number of arguments taken by
+ * the method or the block (0 if _iseq_ doesn't represent a method or
+ * block), +:local_size+, the number of local variables + 1, and
+ * +:stack_max+, used in calculating the stack depth at which a
+ * +SystemStackError+ is thrown.
+ *
+ * [name]
+ * The name of the context (block, method, class, module, etc.) that this
+ * instruction sequence belongs to. <code><main></code> if it's at the top
+ * level, <code><compiled></code> if it was evaluated from a string.
+ *
+ * [path]
+ * The relative path to the Ruby file where the instruction sequence was
+ * loaded from. <code><compiled></code> if the iseq was evaluated from a
+ * string.
+ *
+ * [absolute_path]
+ * The absolute path to the Ruby file where the instruction sequence was
+ * loaded from. +nil+ if the iseq was evaluated from a string.
+ *
+ * [start_lineno]
+ * The number of the first source line where the instruction sequence was
+ * loaded from.
+ *
+ * [type]
+ * The type of the instruction sequence. Valid values are +:top+,
+ * +:method+, +:block+, +:class+, +:rescue+, +:ensure+, +:eval+, +:main+,
+ * and +:defined_guard+.
+ *
+ * [locals]
+ * An array containing the names of all arguments and local variables as
+ * symbols.
+ *
+ * [args]
+ * The arity if the method or block only has required arguments. Otherwise
+ * an array of:
+ *
+ * [required_argc, [optional_arg_labels, ...],
+ * splat_index, post_splat_argc, post_splat_index,
+ * block_index, simple]
+ *
+ * More info about these values can be found in +vm_core.h+.
+ *
+ * [catch_table]
+ * A list of exceptions and control flow operators (rescue, next, redo,
+ * break, etc.).
+ *
+ * [bytecode]
+ * An array of arrays containing the instruction names and operands that
+ * make up the body of the instruction sequence.
+ *
+ */
static VALUE
iseq_to_a(VALUE self)
{
@@ -672,33 +924,53 @@ iseq_to_a(VALUE self)
}
int
-rb_iseq_first_lineno(rb_iseq_t *iseq)
+rb_iseq_first_lineno(const rb_iseq_t *iseq)
{
- return FIX2INT(iseq->line_no);
+ return FIX2INT(iseq->location.first_lineno);
}
/* TODO: search algorithm is brute force.
this should be binary search or so. */
-static struct iseq_insn_info_entry *
-get_insn_info(const rb_iseq_t *iseq, const unsigned long pos)
+static struct iseq_line_info_entry *
+get_line_info(const rb_iseq_t *iseq, size_t pos)
{
- unsigned long i, size = iseq->insn_info_size;
- struct iseq_insn_info_entry *table = iseq->insn_info_table;
+ size_t i = 0, size = iseq->line_info_size;
+ struct iseq_line_info_entry *table = iseq->line_info_table;
+ const int debug = 0;
- for (i = 0; i < size; i++) {
- if (table[i].position == pos) {
- return &table[i];
- }
+ if (debug) {
+ printf("size: %"PRIdSIZE"\n", size);
+ printf("table[%"PRIdSIZE"]: position: %d, line: %d, pos: %"PRIdSIZE"\n",
+ i, table[i].position, table[i].line_no, pos);
}
- return 0;
+ if (size == 0) {
+ return 0;
+ }
+ else if (size == 1) {
+ return &table[0];
+ }
+ else {
+ for (i=1; i<size; i++) {
+ if (debug) printf("table[%"PRIdSIZE"]: position: %d, line: %d, pos: %"PRIdSIZE"\n",
+ i, table[i].position, table[i].line_no, pos);
+
+ if (table[i].position == pos) {
+ return &table[i];
+ }
+ if (table[i].position > pos) {
+ return &table[i-1];
+ }
+ }
+ }
+ return &table[i-1];
}
-static unsigned short
-find_line_no(rb_iseq_t *iseq, unsigned long pos)
+static unsigned int
+find_line_no(const rb_iseq_t *iseq, size_t pos)
{
- struct iseq_insn_info_entry *entry = get_insn_info(iseq, pos);
+ struct iseq_line_info_entry *entry = get_line_info(iseq, pos);
if (entry) {
return entry->line_no;
}
@@ -707,27 +979,31 @@ find_line_no(rb_iseq_t *iseq, unsigned long pos)
}
}
-static unsigned short
-find_prev_line_no(rb_iseq_t *iseqdat, unsigned long pos)
+unsigned int
+rb_iseq_line_no(const rb_iseq_t *iseq, size_t pos)
{
- unsigned long i, size = iseqdat->insn_info_size;
- struct iseq_insn_info_entry *iiary = iseqdat->insn_info_table;
-
- for (i = 0; i < size; i++) {
- if (iiary[i].position == pos) {
- if (i > 0) {
- return iiary[i - 1].line_no;
- }
- else {
- return 0;
- }
- }
+ if (pos == 0) {
+ return find_line_no(iseq, pos);
+ }
+ else {
+ return find_line_no(iseq, pos - 1);
}
-
- return 0;
}
static VALUE
+id_to_name(ID id, VALUE default_value)
+{
+ VALUE str = rb_id2str(id);
+ if (!str) {
+ str = default_value;
+ }
+ else if (!rb_str_symname_p(str)) {
+ str = rb_str_inspect(str);
+ }
+ return str;
+}
+
+VALUE
insn_operand_intern(rb_iseq_t *iseq,
VALUE insn, int op_no, VALUE op,
int len, size_t pos, VALUE *pnop, VALUE child)
@@ -745,34 +1021,20 @@ insn_operand_intern(rb_iseq_t *iseq,
ret = rb_sprintf("%"PRIuVALUE, op);
break;
- case TS_LINDEX:
- {
- rb_iseq_t *liseq = iseq->local_iseq;
- int lidx = liseq->local_size - (int)op;
- const char *name = rb_id2name(liseq->local_table[lidx]);
+ case TS_LINDEX:{
+ if (insn == BIN(getlocal) || insn == BIN(setlocal)) {
+ if (pnop) {
+ rb_iseq_t *diseq = iseq;
+ VALUE level = *pnop, i;
- if (name) {
- ret = rb_str_new2(name);
+ for (i = 0; i < level; i++) {
+ diseq = diseq->parent_iseq;
+ }
+ ret = id_to_name(diseq->local_table[diseq->local_size - op], INT2FIX('*'));
}
else {
- ret = rb_str_new2("*");
- }
- break;
- }
- case TS_DINDEX:{
- if (insn == BIN(getdynamic) || insn == BIN(setdynamic)) {
- rb_iseq_t *diseq = iseq;
- VALUE level = *pnop, i;
- const char *name;
- for (i = 0; i < level; i++) {
- diseq = diseq->parent_iseq;
- }
- name = rb_id2name(diseq->local_table[diseq->local_size - op]);
-
- if (!name) {
- name = "*";
+ ret = rb_sprintf("%"PRIuVALUE, op);
}
- ret = rb_str_new2(name);
}
else {
ret = rb_inspect(INT2FIX(op));
@@ -786,7 +1048,9 @@ insn_operand_intern(rb_iseq_t *iseq,
op = obj_resurrect(op);
ret = rb_inspect(op);
if (CLASS_OF(op) == rb_cISeq) {
- rb_ary_push(child, op);
+ if (child) {
+ rb_ary_push(child, op);
+ }
}
break;
@@ -794,7 +1058,7 @@ insn_operand_intern(rb_iseq_t *iseq,
{
rb_iseq_t *iseq = (rb_iseq_t *)op;
if (iseq) {
- ret = iseq->name;
+ ret = iseq->location.label;
if (child) {
rb_ary_push(child, iseq->self);
}
@@ -815,6 +1079,40 @@ insn_operand_intern(rb_iseq_t *iseq,
ret = rb_sprintf("<ic:%"PRIdPTRDIFF">", (struct iseq_inline_cache_entry *)op - iseq->ic_entries);
break;
+ case TS_CALLINFO:
+ {
+ rb_call_info_t *ci = (rb_call_info_t *)op;
+ VALUE ary = rb_ary_new();
+
+ if (ci->mid) {
+ rb_ary_push(ary, rb_sprintf("mid:%s", rb_id2name(ci->mid)));
+ }
+
+ rb_ary_push(ary, rb_sprintf("argc:%d", ci->orig_argc));
+
+ if (ci->blockiseq) {
+ if (child) {
+ rb_ary_push(child, ci->blockiseq->self);
+ }
+ rb_ary_push(ary, rb_sprintf("block:%"PRIsVALUE, ci->blockiseq->location.label));
+ }
+
+ if (ci->flag) {
+ VALUE flags = rb_ary_new();
+ if (ci->flag & VM_CALL_ARGS_SPLAT) rb_ary_push(flags, rb_str_new2("ARGS_SPLAT"));
+ if (ci->flag & VM_CALL_ARGS_BLOCKARG) rb_ary_push(flags, rb_str_new2("ARGS_BLOCKARG"));
+ if (ci->flag & VM_CALL_FCALL) rb_ary_push(flags, rb_str_new2("FCALL"));
+ if (ci->flag & VM_CALL_VCALL) rb_ary_push(flags, rb_str_new2("VCALL"));
+ if (ci->flag & VM_CALL_TAILCALL) rb_ary_push(flags, rb_str_new2("TAILCALL"));
+ if (ci->flag & VM_CALL_SUPER) rb_ary_push(flags, rb_str_new2("SUPER"));
+ if (ci->flag & VM_CALL_OPT_SEND) rb_ary_push(flags, rb_str_new2("SNED")); /* maybe not reachable */
+ if (ci->flag & VM_CALL_ARGS_SKIP_SETUP) rb_ary_push(flags, rb_str_new2("ARGS_SKIP")); /* maybe not reachable */
+ rb_ary_push(ary, rb_ary_join(flags, rb_str_new2("|")));
+ }
+ ret = rb_sprintf("<callinfo!%"PRIsVALUE">", rb_ary_join(ary, rb_str_new2(", ")));
+ }
+ break;
+
case TS_CDHASH:
ret = rb_str_new2("<cdhash>");
break;
@@ -824,7 +1122,7 @@ insn_operand_intern(rb_iseq_t *iseq,
break;
default:
- rb_bug("rb_iseq_disasm: unknown operand type: %c", type);
+ rb_bug("insn_operand_intern: unknown operand type: %c", type);
}
return ret;
}
@@ -865,23 +1163,15 @@ rb_iseq_disasm_insn(VALUE ret, VALUE *iseq, size_t pos,
}
}
- if (1) {
- int line_no = find_line_no(iseqdat, pos);
- int prev = find_prev_line_no(iseqdat, pos);
+ {
+ unsigned int line_no = find_line_no(iseqdat, pos);
+ unsigned int prev = pos == 0 ? 0 : find_line_no(iseqdat, pos - 1);
if (line_no && line_no != prev) {
long slen = RSTRING_LEN(str);
slen = (slen > 70) ? 0 : (70 - slen);
str = rb_str_catf(str, "%*s(%4d)", (int)slen, "", line_no);
}
}
- else {
- /* for debug */
- struct iseq_insn_info_entry *entry = get_insn_info(iseqdat, pos);
- long slen = RSTRING_LEN(str);
- slen = (slen > 60) ? 0 : (60 - slen);
- str = rb_str_catf(str, "%*s(line: %d, sp: %d)",
- (int)slen, "", entry->line_no, entry->sp);
- }
if (ret) {
rb_str_cat2(str, "\n");
@@ -915,6 +1205,24 @@ catch_type(int type)
}
}
+/*
+ * call-seq:
+ * iseq.disasm -> str
+ * iseq.disassemble -> str
+ *
+ * Returns the instruction sequence as a +String+ in human readable form.
+ *
+ * puts RubyVM::InstructionSequence.compile('1 + 2').disasm
+ *
+ * Produces:
+ *
+ * == disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
+ * 0000 trace 1 ( 1)
+ * 0002 putobject 1
+ * 0004 putobject 2
+ * 0006 opt_plus <ic:1>
+ * 0008 leave
+ */
VALUE
rb_iseq_disasm(VALUE self)
{
@@ -975,8 +1283,8 @@ rb_iseq_disasm(VALUE self)
iseqdat->arg_simple);
for (i = 0; i < iseqdat->local_table_size; i++) {
- const char *name = rb_id2name(tbl[i]);
- char info[0x100];
+ long width;
+ VALUE name = id_to_name(tbl[i], 0);
char argi[0x100] = "";
char opti[0x100] = "";
@@ -997,10 +1305,14 @@ rb_iseq_disasm(VALUE self)
i < iseqdat->arg_post_start + iseqdat->arg_post_len) ? "Post" : "",
iseqdat->arg_block == i ? "Block" : "");
- snprintf(info, sizeof(info), "%s%s%s%s", name ? name : "?",
- *argi ? "<" : "", argi, *argi ? ">" : "");
-
- rb_str_catf(str, "[%2d] %-11s", iseqdat->local_size - i, info);
+ rb_str_catf(str, "[%2d] ", iseqdat->local_size - i);
+ width = RSTRING_LEN(str) + 11;
+ if (name)
+ rb_str_append(str, name);
+ else
+ rb_str_cat2(str, "?");
+ if (*argi) rb_str_catf(str, "<%s>", argi);
+ if ((width -= RSTRING_LEN(str)) > 0) rb_str_catf(str, "%*s", (int)width, "");
}
rb_str_cat2(str, "\n");
}
@@ -1019,7 +1331,7 @@ rb_iseq_disasm(VALUE self)
}
static VALUE
-iseq_s_disasm(VALUE klass, VALUE body)
+iseq_s_of(VALUE klass, VALUE body)
{
VALUE ret = Qnil;
rb_iseq_t *iseq;
@@ -1028,20 +1340,78 @@ iseq_s_disasm(VALUE klass, VALUE body)
if (rb_obj_is_proc(body)) {
rb_proc_t *proc;
- VALUE iseqval;
GetProcPtr(body, proc);
- iseqval = proc->block.iseq->self;
- if (RUBY_VM_NORMAL_ISEQ_P(iseqval)) {
- ret = rb_iseq_disasm(iseqval);
+ iseq = proc->block.iseq;
+ if (RUBY_VM_NORMAL_ISEQ_P(iseq)) {
+ ret = iseq->self;
}
}
else if ((iseq = rb_method_get_iseq(body)) != 0) {
- ret = rb_iseq_disasm(iseq->self);
+ ret = iseq->self;
}
-
return ret;
}
+/*
+ * call-seq:
+ * InstructionSequence.disasm(body) -> str
+ * InstructionSequence.disassemble(body) -> str
+ *
+ * Takes +body+, a Method or Proc object, and returns a String with the
+ * human readable instructions for +body+.
+ *
+ * For a Method object:
+ *
+ * # /tmp/method.rb
+ * def hello
+ * puts "hello, world"
+ * end
+ *
+ * puts RubyVM::InstructionSequence.disasm(method(:hello))
+ *
+ * Produces:
+ *
+ * == disasm: <RubyVM::InstructionSequence:hello@/tmp/method.rb>============
+ * 0000 trace 8 ( 1)
+ * 0002 trace 1 ( 2)
+ * 0004 putself
+ * 0005 putstring "hello, world"
+ * 0007 send :puts, 1, nil, 8, <ic:0>
+ * 0013 trace 16 ( 3)
+ * 0015 leave ( 2)
+ *
+ * For a Proc:
+ *
+ * # /tmp/proc.rb
+ * p = proc { num = 1 + 2 }
+ * puts RubyVM::InstructionSequence.disasm(p)
+ *
+ * Produces:
+ *
+ * == disasm: <RubyVM::InstructionSequence:block in <main>@/tmp/proc.rb>===
+ * == catch table
+ * | catch type: redo st: 0000 ed: 0012 sp: 0000 cont: 0000
+ * | catch type: next st: 0000 ed: 0012 sp: 0000 cont: 0012
+ * |------------------------------------------------------------------------
+ * local table (size: 2, argc: 0 [opts: 0, rest: -1, post: 0, block: -1] s1)
+ * [ 2] num
+ * 0000 trace 1 ( 1)
+ * 0002 putobject 1
+ * 0004 putobject 2
+ * 0006 opt_plus <ic:1>
+ * 0008 dup
+ * 0009 setlocal num, 0
+ * 0012 leave
+ *
+ */
+
+static VALUE
+iseq_s_disasm(VALUE klass, VALUE body)
+{
+ VALUE iseqval = iseq_s_of(klass, body);
+ return NIL_P(iseqval) ? Qnil : rb_iseq_disasm(iseqval);
+}
+
const char *
ruby_node_name(int node)
{
@@ -1099,8 +1469,10 @@ cdhash_each(VALUE key, VALUE value, VALUE ary)
static VALUE
iseq_data_to_ary(rb_iseq_t *iseq)
{
- long i, pos;
- int line = 0;
+ long i;
+ size_t ti;
+ unsigned int pos;
+ unsigned int line = 0;
VALUE *seq;
VALUE val = rb_ary_new();
@@ -1217,7 +1589,6 @@ iseq_data_to_ary(rb_iseq_t *iseq)
break;
}
case TS_LINDEX:
- case TS_DINDEX:
case TS_NUM:
rb_ary_push(ary, INT2FIX(*seq));
break;
@@ -1247,6 +1618,17 @@ iseq_data_to_ary(rb_iseq_t *iseq)
rb_ary_push(ary, INT2FIX(ic - iseq->ic_entries));
}
break;
+ case TS_CALLINFO:
+ {
+ rb_call_info_t *ci = (rb_call_info_t *)*seq;
+ VALUE e = rb_hash_new();
+ rb_hash_aset(e, ID2SYM(rb_intern("mid")), ci->mid ? ID2SYM(ci->mid) : Qnil);
+ rb_hash_aset(e, ID2SYM(rb_intern("flag")), ULONG2NUM(ci->flag));
+ rb_hash_aset(e, ID2SYM(rb_intern("orig_argc")), INT2FIX(ci->orig_argc));
+ rb_hash_aset(e, ID2SYM(rb_intern("blockptr")), ci->blockiseq ? iseq_data_to_ary(ci->blockiseq) : Qnil);
+ rb_ary_push(ary, e);
+ }
+ break;
case TS_ID:
rb_ary_push(ary, ID2SYM(*seq));
break;
@@ -1299,6 +1681,7 @@ iseq_data_to_ary(rb_iseq_t *iseq)
/* make body with labels and insert line number */
body = rb_ary_new();
+ ti = 0;
for (i=0, pos=0; i<RARRAY_LEN(nbody); i++) {
VALUE ary = RARRAY_PTR(nbody)[i];
@@ -1308,13 +1691,14 @@ iseq_data_to_ary(rb_iseq_t *iseq)
rb_ary_push(body, (VALUE)label);
}
- if (iseq->insn_info_table[i].line_no != line) {
- line = iseq->insn_info_table[i].line_no;
+ if (iseq->line_info_size < ti && iseq->line_info_table[ti].position == pos) {
+ line = iseq->line_info_table[ti].line_no;
rb_ary_push(body, INT2FIX(line));
+ ti++;
}
rb_ary_push(body, ary);
- pos += RARRAY_LEN(ary);
+ pos += RARRAY_LENINT(ary); /* reject too huge data */
}
st_free_table(labels_table);
@@ -1323,9 +1707,10 @@ iseq_data_to_ary(rb_iseq_t *iseq)
rb_hash_aset(misc, ID2SYM(rb_intern("local_size")), INT2FIX(iseq->local_size));
rb_hash_aset(misc, ID2SYM(rb_intern("stack_max")), INT2FIX(iseq->stack_max));
+ /* TODO: compatibility issue */
/*
* [:magic, :major_version, :minor_version, :format_type, :misc,
- * :name, :filename, :filepath, :line_no, :type, :locals, :args,
+ * :name, :path, :absolute_path, :start_lineno, :type, :locals, :args,
* :catch_table, :bytecode]
*/
rb_ary_push(val, rb_str_new2("YARVInstructionSequence/SimpleDataFormat"));
@@ -1333,10 +1718,10 @@ iseq_data_to_ary(rb_iseq_t *iseq)
rb_ary_push(val, INT2FIX(ISEQ_MINOR_VERSION)); /* minor */
rb_ary_push(val, INT2FIX(1));
rb_ary_push(val, misc);
- rb_ary_push(val, iseq->name);
- rb_ary_push(val, iseq->filename);
- rb_ary_push(val, iseq->filepath);
- rb_ary_push(val, iseq->line_no);
+ rb_ary_push(val, iseq->location.label);
+ rb_ary_push(val, iseq->location.path);
+ rb_ary_push(val, iseq->location.absolute_path);
+ rb_ary_push(val, iseq->location.first_lineno);
rb_ary_push(val, type);
rb_ary_push(val, locals);
rb_ary_push(val, args);
@@ -1363,7 +1748,9 @@ rb_iseq_clone(VALUE iseqval, VALUE newcbase)
iseq1->local_iseq = iseq1;
}
if (newcbase) {
- iseq1->cref_stack = NEW_BLOCK(newcbase);
+ iseq1->cref_stack = NEW_CREF(newcbase);
+ iseq1->cref_stack->nd_refinements = iseq0->cref_stack->nd_refinements;
+ iseq1->cref_stack->nd_visi = iseq0->cref_stack->nd_visi;
if (iseq0->cref_stack->nd_next) {
iseq1->cref_stack->nd_next = iseq0->cref_stack->nd_next;
}
@@ -1376,14 +1763,14 @@ rb_iseq_clone(VALUE iseqval, VALUE newcbase)
VALUE
rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc)
{
- int i, r, s;
+ int i, r;
VALUE a, args = rb_ary_new2(iseq->arg_size);
- ID req, opt, rest, block;
+ ID req, opt, rest, block, key, keyrest;
#define PARAM_TYPE(type) rb_ary_push(a = rb_ary_new2(2), ID2SYM(type))
#define PARAM_ID(i) iseq->local_table[(i)]
#define PARAM(i, type) ( \
PARAM_TYPE(type), \
- rb_id2name(PARAM_ID(i)) ? \
+ rb_id2str(PARAM_ID(i)) ? \
rb_ary_push(a, ID2SYM(PARAM_ID(i))) : \
a)
@@ -1392,7 +1779,7 @@ rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc)
if (is_proc) {
for (i = 0; i < iseq->argc; i++) {
PARAM_TYPE(opt);
- rb_ary_push(a, rb_id2name(PARAM_ID(i)) ? ID2SYM(PARAM_ID(i)) : Qnil);
+ rb_ary_push(a, rb_id2str(PARAM_ID(i)) ? ID2SYM(PARAM_ID(i)) : Qnil);
rb_ary_push(args, a);
}
}
@@ -1404,10 +1791,12 @@ rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc)
r = iseq->arg_rest != -1 ? iseq->arg_rest :
iseq->arg_post_len > 0 ? iseq->arg_post_start :
iseq->arg_block != -1 ? iseq->arg_block :
+ iseq->arg_keyword != -1 ? iseq->arg_keyword :
iseq->arg_size;
- for (s = i; i < r; i++) {
+ if (iseq->arg_keyword != -1) r -= iseq->arg_keywords;
+ for (; i < r; i++) {
PARAM_TYPE(opt);
- if (rb_id2name(PARAM_ID(i))) {
+ if (rb_id2str(PARAM_ID(i))) {
rb_ary_push(a, ID2SYM(PARAM_ID(i)));
}
rb_ary_push(args, a);
@@ -1420,7 +1809,7 @@ rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc)
if (is_proc) {
for (i = iseq->arg_post_start; i < r; i++) {
PARAM_TYPE(opt);
- rb_ary_push(a, rb_id2name(PARAM_ID(i)) ? ID2SYM(PARAM_ID(i)) : Qnil);
+ rb_ary_push(a, rb_id2str(PARAM_ID(i)) ? ID2SYM(PARAM_ID(i)) : Qnil);
rb_ary_push(args, a);
}
}
@@ -1429,6 +1818,20 @@ rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc)
rb_ary_push(args, PARAM(i, req));
}
}
+ if (iseq->arg_keyword != -1) {
+ CONST_ID(key, "key");
+ for (i = 0; i < iseq->arg_keywords; i++) {
+ PARAM_TYPE(key);
+ if (rb_id2str(iseq->arg_keyword_table[i])) {
+ rb_ary_push(a, ID2SYM(iseq->arg_keyword_table[i]));
+ }
+ rb_ary_push(args, a);
+ }
+ if (rb_id2str(iseq->local_table[iseq->arg_keyword])) {
+ CONST_ID(keyrest, "keyrest");
+ rb_ary_push(args, PARAM(iseq->arg_keyword, keyrest));
+ }
+ }
if (iseq->arg_block != -1) {
CONST_ID(block, "block");
rb_ary_push(args, PARAM(iseq->arg_block, block));
@@ -1436,19 +1839,58 @@ rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc)
return args;
}
+VALUE
+rb_iseq_defined_string(enum defined_type type)
+{
+ static const char expr_names[][18] = {
+ "nil",
+ "instance-variable",
+ "local-variable",
+ "global-variable",
+ "class variable",
+ "constant",
+ "method",
+ "yield",
+ "super",
+ "self",
+ "true",
+ "false",
+ "assignment",
+ "expression",
+ };
+ const char *estr;
+ VALUE *defs, str;
+
+ if ((unsigned)(type - 1) >= (unsigned)numberof(expr_names)) return 0;
+ estr = expr_names[type - 1];
+ if (!estr[0]) return 0;
+ defs = GET_VM()->defined_strings;
+ if (!defs) {
+ defs = ruby_xcalloc(numberof(expr_names), sizeof(VALUE));
+ GET_VM()->defined_strings = defs;
+ }
+ str = defs[type-1];
+ if (!str) {
+ str = rb_str_new_cstr(estr);;
+ OBJ_FREEZE(str);
+ defs[type-1] = str;
+ }
+ return str;
+}
+
/* ruby2cext */
VALUE
rb_iseq_build_for_ruby2cext(
const rb_iseq_t *iseq_template,
const rb_insn_func_t *func,
- const struct iseq_insn_info_entry *insn_info_table,
+ const struct iseq_line_info_entry *line_info_table,
const char **local_table,
const VALUE *arg_opt_table,
const struct iseq_catch_table_entry *catch_table,
const char *name,
- const char *filename,
- const unsigned short line_no)
+ const char *path,
+ const unsigned short first_lineno)
{
unsigned long i;
VALUE iseqval = iseq_alloc(rb_cISeq);
@@ -1457,9 +1899,9 @@ rb_iseq_build_for_ruby2cext(
/* copy iseq */
*iseq = *iseq_template;
- iseq->name = rb_str_new2(name);
- iseq->filename = rb_str_new2(filename);
- iseq->line_no = line_no;
+ iseq->location.label = rb_str_new2(name);
+ iseq->location.path = rb_str_new2(path);
+ iseq->location.first_lineno = first_lineno;
iseq->mark_ary = rb_ary_tmp_new(3);
OBJ_UNTRUST(iseq->mark_ary);
iseq->self = iseqval;
@@ -1480,8 +1922,8 @@ rb_iseq_build_for_ruby2cext(
} \
} while (0)
- ALLOC_AND_COPY(iseq->insn_info_table, insn_info_table,
- struct iseq_insn_info_entry, iseq->insn_info_size);
+ ALLOC_AND_COPY(iseq->line_info_table, line_info_table,
+ struct iseq_line_info_entry, iseq->line_info_size);
ALLOC_AND_COPY(iseq->catch_table, catch_table,
struct iseq_catch_table_entry, iseq->catch_table_size);
@@ -1494,10 +1936,128 @@ rb_iseq_build_for_ruby2cext(
return iseqval;
}
+/* Experimental tracing support: trace(line) -> trace(specified_line)
+ * MRI Specific.
+ */
+
+int
+rb_iseq_line_trace_each(VALUE iseqval, int (*func)(int line, rb_event_flag_t *events_ptr, void *d), void *data)
+{
+ int trace_num = 0;
+ size_t pos, insn;
+ rb_iseq_t *iseq;
+ int cont = 1;
+ GetISeqPtr(iseqval, iseq);
+
+ for (pos = 0; cont && pos < iseq->iseq_size; pos += insn_len(insn)) {
+ insn = iseq->iseq[pos];
+
+ if (insn == BIN(trace)) {
+ rb_event_flag_t current_events = (VALUE)iseq->iseq[pos+1];
+ rb_event_flag_t events = current_events & RUBY_EVENT_SPECIFIED_LINE;
+ trace_num++;
+
+ if (func) {
+ int line = find_line_no(iseq, pos);
+ /* printf("line: %d\n", line); */
+ cont = (*func)(line, &events, data);
+ if (current_events != events) {
+ iseq->iseq[pos+1] = iseq->iseq_encoded[pos+1] = (VALUE)(current_events | (events & RUBY_EVENT_SPECIFIED_LINE));
+ }
+ }
+ }
+ }
+ return trace_num;
+}
+
+static int
+collect_trace(int line, rb_event_flag_t *events_ptr, void *ptr)
+{
+ VALUE result = (VALUE)ptr;
+ rb_ary_push(result, INT2NUM(line));
+ return 1;
+}
+
+VALUE
+rb_iseq_line_trace_all(VALUE iseqval)
+{
+ VALUE result = rb_ary_new();
+ rb_iseq_line_trace_each(iseqval, collect_trace, (void *)result);
+ return result;
+}
+
+struct set_specifc_data {
+ int pos;
+ int set;
+ int prev; /* 1: set, 2: unset, 0: not found */
+};
+
+static int
+line_trace_specify(int line, rb_event_flag_t *events_ptr, void *ptr)
+{
+ struct set_specifc_data *data = (struct set_specifc_data *)ptr;
+
+ if (data->pos == 0) {
+ data->prev = *events_ptr & RUBY_EVENT_SPECIFIED_LINE ? 1 : 2;
+ if (data->set) {
+ *events_ptr = *events_ptr | RUBY_EVENT_SPECIFIED_LINE;
+ }
+ else {
+ *events_ptr = *events_ptr & ~RUBY_EVENT_SPECIFIED_LINE;
+ }
+ return 0; /* found */
+ }
+ else {
+ data->pos--;
+ return 1;
+ }
+}
+
+VALUE
+rb_iseq_line_trace_specify(VALUE iseqval, VALUE pos, VALUE set)
+{
+ struct set_specifc_data data;
+
+ data.prev = 0;
+ data.pos = NUM2INT(pos);
+ if (data.pos < 0) rb_raise(rb_eTypeError, "`pos' is negative");
+
+ switch (set) {
+ case Qtrue: data.set = 1; break;
+ case Qfalse: data.set = 0; break;
+ default:
+ rb_raise(rb_eTypeError, "`set' should be true/false");
+ }
+
+ rb_iseq_line_trace_each(iseqval, line_trace_specify, (void *)&data);
+
+ if (data.prev == 0) {
+ rb_raise(rb_eTypeError, "`pos' is out of range.");
+ }
+ return data.prev == 1 ? Qtrue : Qfalse;
+}
+
+/*
+ * Document-class: RubyVM::InstructionSequence
+ *
+ * The InstructionSequence class represents a compiled sequence of
+ * instructions for the Ruby Virtual Machine. With it, you can get a handle
+ * to the instructions that make up a method or a proc, compile strings of
+ * Ruby code down to VM instructions, and disassemble instruction sequences
+ * to strings for easy inspection. It is mostly useful if you want to learn
+ * how the Ruby VM works, but it also lets you control various settings for
+ * the Ruby iseq compiler. You can find the source for the VM instructions in
+ * +insns.def+ in the Ruby source.
+ *
+ * The instruction sequence that results from a given piece of Ruby code will
+ * almost certainly change as Ruby changes, so example output in this
+ * documentation may be different from what you see.
+ */
+
void
Init_ISeq(void)
{
- /* declare ::VM::InstructionSequence */
+ /* declare ::RubyVM::InstructionSequence */
rb_cISeq = rb_define_class_under(rb_cRubyVM, "InstructionSequence", rb_cObject);
rb_define_alloc_func(rb_cISeq, iseq_alloc);
rb_define_method(rb_cISeq, "inspect", iseq_inspect, 0);
@@ -1506,9 +2066,20 @@ Init_ISeq(void)
rb_define_method(rb_cISeq, "to_a", iseq_to_a, 0);
rb_define_method(rb_cISeq, "eval", iseq_eval, 0);
+ /* location APIs */
+ rb_define_method(rb_cISeq, "path", iseq_path, 0);
+ rb_define_method(rb_cISeq, "absolute_path", iseq_absolute_path, 0);
+ rb_define_method(rb_cISeq, "label", iseq_label, 0);
+ rb_define_method(rb_cISeq, "base_label", iseq_base_label, 0);
+ rb_define_method(rb_cISeq, "first_lineno", iseq_first_lineno, 0);
+
+ /* experimental */
+ rb_define_method(rb_cISeq, "line_trace_all", rb_iseq_line_trace_all, 0);
+ rb_define_method(rb_cISeq, "line_trace_specify", rb_iseq_line_trace_specify, 2);
+
#if 0 /* TBD */
- rb_define_method(rb_cISeq, "marshal_dump", iseq_marshal_dump, 0);
- rb_define_method(rb_cISeq, "marshal_load", iseq_marshal_load, 1);
+ rb_define_private_method(rb_cISeq, "marshal_dump", iseq_marshal_dump, 0);
+ rb_define_private_method(rb_cISeq, "marshal_load", iseq_marshal_load, 1);
#endif
/* disable this feature because there is no verifier. */
@@ -1522,5 +2093,5 @@ Init_ISeq(void)
rb_define_singleton_method(rb_cISeq, "compile_option=", iseq_s_compile_option_set, 1);
rb_define_singleton_method(rb_cISeq, "disasm", iseq_s_disasm, 1);
rb_define_singleton_method(rb_cISeq, "disassemble", iseq_s_disasm, 1);
+ rb_define_singleton_method(rb_cISeq, "of", iseq_s_of, 1);
}
-
diff --git a/iseq.h b/iseq.h
index beeacbb236..1b51d2a14d 100644
--- a/iseq.h
+++ b/iseq.h
@@ -26,6 +26,11 @@ VALUE rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE locals, VALUE args,
VALUE rb_iseq_load(VALUE data, VALUE parent, VALUE opt);
VALUE rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc);
struct st_table *ruby_insn_make_insn_table(void);
+unsigned int rb_iseq_line_no(const rb_iseq_t *iseq, size_t pos);
+
+int rb_iseq_line_trace_each(VALUE iseqval, int (*func)(int line, rb_event_flag_t *events_ptr, void *d), void *data);
+VALUE rb_iseq_line_trace_all(VALUE iseqval);
+VALUE rb_iseq_line_trace_specify(VALUE iseqval, VALUE pos, VALUE set);
/* proc.c */
rb_iseq_t *rb_method_get_iseq(VALUE body);
@@ -43,10 +48,9 @@ struct rb_compile_option_struct {
int debug_level;
};
-struct iseq_insn_info_entry {
- unsigned short position;
- unsigned short line_no;
- unsigned short sp;
+struct iseq_line_info_entry {
+ unsigned int position;
+ unsigned int line_no;
};
struct iseq_catch_table_entry {
@@ -106,18 +110,27 @@ struct iseq_compile_data {
/* defined? */
enum defined_type {
- DEFINED_IVAR = 1,
- DEFINED_IVAR2,
+ DEFINED_NIL = 1,
+ DEFINED_IVAR,
+ DEFINED_LVAR,
DEFINED_GVAR,
DEFINED_CVAR,
DEFINED_CONST,
DEFINED_METHOD,
DEFINED_YIELD,
- DEFINED_REF,
DEFINED_ZSUPER,
+ DEFINED_SELF,
+ DEFINED_TRUE,
+ DEFINED_FALSE,
+ DEFINED_ASGN,
+ DEFINED_EXPR,
+ DEFINED_IVAR2,
+ DEFINED_REF,
DEFINED_FUNC
};
+VALUE rb_iseq_defined_string(enum defined_type type);
+
#if defined __GNUC__ && __GNUC__ >= 4
#pragma GCC visibility pop
#endif
diff --git a/lib/abbrev.rb b/lib/abbrev.rb
index aa7e33a65d..d4f8196f49 100644..100755
--- a/lib/abbrev.rb
+++ b/lib/abbrev.rb
@@ -10,48 +10,72 @@
# $Id$
#++
-# Calculate the set of unique abbreviations for a given set of strings.
+##
+# Calculates the set of unique abbreviations for a given set of strings.
#
# require 'abbrev'
# require 'pp'
#
-# pp Abbrev::abbrev(['ruby', 'rules']).sort
+# pp Abbrev.abbrev(['ruby', 'rules'])
#
-# <i>Generates:</i>
+# Generates:
#
-# [["rub", "ruby"],
-# ["ruby", "ruby"],
-# ["rul", "rules"],
-# ["rule", "rules"],
-# ["rules", "rules"]]
+# { "rub" => "ruby",
+# "ruby" => "ruby",
+# "rul" => "rules",
+# "rule" => "rules",
+# "rules" => "rules" }
#
-# Also adds an +abbrev+ method to class +Array+.
+# It also provides an array core extension, Array#abbrev.
+#
+# pp %w{summer winter}.abbrev
+# #=> {"summe"=>"summer",
+# "summ"=>"summer",
+# "sum"=>"summer",
+# "su"=>"summer",
+# "s"=>"summer",
+# "winte"=>"winter",
+# "wint"=>"winter",
+# "win"=>"winter",
+# "wi"=>"winter",
+# "w"=>"winter",
+# "summer"=>"summer",
+# "winter"=>"winter"}
module Abbrev
# Given a set of strings, calculate the set of unambiguous
# abbreviations for those strings, and return a hash where the keys
# are all the possible abbreviations and the values are the full
- # strings. Thus, given input of "car" and "cone", the keys pointing
- # to "car" would be "ca" and "car", while those pointing to "cone"
- # would be "co", "con", and "cone".
+ # strings.
+ #
+ # Thus, given input of "car" and "cone", the keys pointing to "car" would be
+ # "ca" and "car", while those pointing to "cone" would be "co", "con", and
+ # "cone".
+ #
+ # require 'abbrev'
+ #
+ # Abbrev.abbrev(['car', 'cone'])
+ # #=> {"ca"=>"car", "con"=>"cone", "co"=>"cone", "car"=>"car", "cone"=>"cone"}
#
# The optional +pattern+ parameter is a pattern or a string. Only
- # those input strings matching the pattern, or begging the string,
- # are considered for inclusion in the output hash
-
+ # input strings that match the pattern or start with the string
+ # are included in the output hash.
+ #
+ # Abbrev.abbrev(%w{car box cone}, /b/)
+ # #=> {"bo"=>"box", "b"=>"box", "box"=>"box"}
def abbrev(words, pattern = nil)
table = {}
seen = Hash.new(0)
if pattern.is_a?(String)
- pattern = /^#{Regexp.quote(pattern)}/ # regard as a prefix
+ pattern = /\A#{Regexp.quote(pattern)}/ # regard as a prefix
end
words.each do |word|
- next if (abbrev = word).empty?
- while (len = abbrev.rindex(/[\w\W]\z/)) > 0
- abbrev = word[0,len]
+ next if word.empty?
+ word.size.downto(1) { |len|
+ abbrev = word[0...len]
next if pattern && pattern !~ abbrev
@@ -63,7 +87,7 @@ module Abbrev
else
break
end
- end
+ }
end
words.each do |word|
@@ -80,12 +104,22 @@ end
class Array
# Calculates the set of unambiguous abbreviations for the strings in
- # +self+. If passed a pattern or a string, only the strings matching
- # the pattern or starting with the string are considered.
+ # +self+.
+ #
+ # require 'abbrev'
+ # %w{ car cone }.abbrev
+ # #=> {"ca" => "car", "con"=>"cone", "co" => "cone",
+ # "car"=>"car", "cone" => "cone"}
+ #
+ # The optional +pattern+ parameter is a pattern or a string. Only
+ # input strings that match the pattern or start with the string
+ # are included in the output hash.
+ #
+ # %w{ fast boat day }.abbrev(/^.a/)
+ # #=> {"fas"=>"fast", "fa"=>"fast", "da"=>"day",
+ # "fast"=>"fast", "day"=>"day"}
#
- # %w{ car cone }.abbrev #=> { "ca" => "car", "car" => "car",
- # "co" => "cone", "con" => cone",
- # "cone" => "cone" }
+ # See also Abbrev.abbrev
def abbrev(pattern = nil)
Abbrev::abbrev(self, pattern)
end
diff --git a/lib/benchmark.rb b/lib/benchmark.rb
index 6a00da1359..f52ba7df34 100644
--- a/lib/benchmark.rb
+++ b/lib/benchmark.rb
@@ -19,7 +19,7 @@
# used to execute Ruby code.
#
# * Measure the time to construct the string given by the expression
-# <tt>"a"*1_000_000</tt>:
+# <code>"a"*1_000_000</code>:
#
# require 'benchmark'
#
@@ -122,18 +122,18 @@
module Benchmark
- BENCHMARK_VERSION = "2002-04-25" #:nodoc"
+ BENCHMARK_VERSION = "2002-04-25" # :nodoc:
- # Invokes the block with a <tt>Benchmark::Report</tt> object, which
+ # Invokes the block with a Benchmark::Report object, which
# may be used to collect and report on the results of individual
- # benchmark tests. Reserves <i>label_width</i> leading spaces for
- # labels on each line. Prints _caption_ at the top of the
- # report, and uses _format_ to format each line.
+ # benchmark tests. Reserves +label_width+ leading spaces for
+ # labels on each line. Prints +caption+ at the top of the
+ # report, and uses +format+ to format each line.
# Returns an array of Benchmark::Tms objects.
#
# If the block returns an array of
- # <tt>Benchmark::Tms</tt> objects, these will be used to format
- # additional lines of output. If _label_ parameters are
+ # Benchmark::Tms objects, these will be used to format
+ # additional lines of output. If +label+ parameters are
# given, these are used to label these extra lines.
#
# _Note_: Other methods provide a simpler interface to this one, and are
@@ -153,7 +153,7 @@ module Benchmark
# [tf+tt+tu, (tf+tt+tu)/3]
# end
#
- # <i>Generates:</i>
+ # Generates:
#
# user system total real
# for: 1.016667 0.016667 1.033333 ( 0.485749)
@@ -169,7 +169,7 @@ module Benchmark
label_width ||= 0
label_width += 1
format ||= FORMAT
- print ' '*label_width + caption
+ print ' '*label_width + caption unless caption.empty?
report = Report.new(label_width, format)
results = yield(report)
Array === results and results.grep(Tms).each {|t|
@@ -181,8 +181,9 @@ module Benchmark
end
- # A simple interface to the #benchmark method, #bm is generates sequential reports
- # with labels. The parameters have the same meaning as for #benchmark.
+ # A simple interface to the #benchmark method, #bm is generates sequential
+ # reports with labels. The parameters have the same meaning as for
+ # #benchmark.
#
# require 'benchmark'
#
@@ -193,7 +194,7 @@ module Benchmark
# x.report("upto:") { 1.upto(n) do ; a = "1"; end }
# end
#
- # <i>Generates:</i>
+ # Generates:
#
# user system total real
# for: 1.050000 0.000000 1.050000 ( 0.503462)
@@ -211,7 +212,7 @@ module Benchmark
# that run later. #bmbm attempts to minimize this effect by running
# the tests twice, the first time as a rehearsal in order to get the
# runtime environment stable, the second time for
- # real. <tt>GC.start</tt> is executed before the start of each of
+ # real. GC.start is executed before the start of each of
# the real timings; the cost of this is not included in the
# timings. In reality, though, there's only so much that #bmbm can
# do, and the results are not guaranteed to be isolated from garbage
@@ -229,7 +230,7 @@ module Benchmark
# x.report("sort") { array.dup.sort }
# end
#
- # <i>Generates:</i>
+ # Generates:
#
# Rehearsal -----------------------------------------
# sort! 11.928000 0.010000 11.938000 ( 12.756000)
@@ -243,7 +244,7 @@ module Benchmark
# #bmbm yields a Benchmark::Job object and returns an array of
# Benchmark::Tms objects.
#
- def bmbm(width = 0, &blk) # :yield: job
+ def bmbm(width = 0) # :yield: job
job = Job.new(width)
yield(job)
width = job.width + 1
@@ -283,7 +284,7 @@ module Benchmark
t1.stime - t0.stime,
t1.cutime - t0.cutime,
t1.cstime - t0.cstime,
- r1.to_f - r0.to_f,
+ r1 - r0,
label)
end
@@ -307,8 +308,8 @@ module Benchmark
# Returns an initialized Job instance.
# Usually, one doesn't call this method directly, as new
# Job objects are created by the #bmbm method.
- # _width_ is a initial value for the label offset used in formatting;
- # the #bmbm method passes its _width_ argument to this constructor.
+ # +width+ is a initial value for the label offset used in formatting;
+ # the #bmbm method passes its +width+ argument to this constructor.
#
def initialize(width)
@width = width
@@ -345,7 +346,7 @@ module Benchmark
# Returns an initialized Report instance.
# Usually, one doesn't call this method directly, as new
# Report objects are created by the #benchmark and #bm methods.
- # _width_ and _format_ are the label offset and
+ # +width+ and +format+ are the label offset and
# format string used by Tms#format.
#
def initialize(width = 0, format = nil)
@@ -353,8 +354,8 @@ module Benchmark
end
#
- # Prints the _label_ and measured time for the block,
- # formatted by _format_. See Tms#format for the
+ # Prints the +label+ and measured time for the block,
+ # formatted by +format+. See Tms#format for the
# formatting rules.
#
def item(label = "", *format, &blk) # :yield:
@@ -399,7 +400,7 @@ module Benchmark
# Elapsed real time
attr_reader :real
- # Total time, that is _utime_ + _stime_ + _cutime_ + _cstime_
+ # Total time, that is +utime+ + +stime+ + +cutime+ + +cstime+
attr_reader :total
# Label
@@ -407,9 +408,9 @@ module Benchmark
#
# Returns an initialized Tms object which has
- # _utime_ as the user CPU time, _stime_ as the system CPU time,
- # _cutime_ as the children's user CPU time, _cstime_ as the children's
- # system CPU time, _real_ as the elapsed real time and _label_ as the label.
+ # +utime+ as the user CPU time, +stime+ as the system CPU time,
+ # +cutime+ as the children's user CPU time, +cstime+ as the children's
+ # system CPU time, +real+ as the elapsed real time and +label+ as the label.
#
def initialize(utime = 0.0, stime = 0.0, cutime = 0.0, cstime = 0.0, real = 0.0, label = nil)
@utime, @stime, @cutime, @cstime, @real, @label = utime, stime, cutime, cstime, real, label.to_s
@@ -418,7 +419,7 @@ module Benchmark
#
# Returns a new Tms object whose times are the sum of the times for this
- # Tms object, plus the time required to execute the code block (_blk_).
+ # Tms object, plus the time required to execute the code block (+blk+).
#
def add(&blk) # :yield:
self + Benchmark.measure(&blk)
@@ -484,13 +485,13 @@ module Benchmark
#
def format(format = nil, *args)
str = (format || FORMAT).dup
- str.gsub!(/(%[-+\.\d]*)n/) { "#{$1}s" % label }
- str.gsub!(/(%[-+\.\d]*)u/) { "#{$1}f" % utime }
- str.gsub!(/(%[-+\.\d]*)y/) { "#{$1}f" % stime }
- str.gsub!(/(%[-+\.\d]*)U/) { "#{$1}f" % cutime }
- str.gsub!(/(%[-+\.\d]*)Y/) { "#{$1}f" % cstime }
- str.gsub!(/(%[-+\.\d]*)t/) { "#{$1}f" % total }
- str.gsub!(/(%[-+\.\d]*)r/) { "(#{$1}f)" % real }
+ str.gsub!(/(%[-+.\d]*)n/) { "#{$1}s" % label }
+ str.gsub!(/(%[-+.\d]*)u/) { "#{$1}f" % utime }
+ str.gsub!(/(%[-+.\d]*)y/) { "#{$1}f" % stime }
+ str.gsub!(/(%[-+.\d]*)U/) { "#{$1}f" % cutime }
+ str.gsub!(/(%[-+.\d]*)Y/) { "#{$1}f" % cstime }
+ str.gsub!(/(%[-+.\d]*)t/) { "#{$1}f" % total }
+ str.gsub!(/(%[-+.\d]*)r/) { "(#{$1}f)" % real }
format ? str % args : str
end
@@ -512,7 +513,7 @@ module Benchmark
end
protected
-
+
#
# Returns a new Tms object obtained by memberwise operation +op+
# of the individual times for this Tms object with those of the other
@@ -553,7 +554,7 @@ if __FILE__ == $0
n = ARGV[0].to_i.nonzero? || 50000
puts %Q([#{n} times iterations of `a = "1"'])
- benchmark(" " + CAPTION, 7, FORMAT) do |x|
+ benchmark(CAPTION, 7, FORMAT) do |x|
x.report("for:") {for _ in 1..n; _ = "1"; end} # Benchmark.measure
x.report("times:") {n.times do ; _ = "1"; end}
x.report("upto:") {1.upto(n) do ; _ = "1"; end}
diff --git a/lib/cgi.rb b/lib/cgi.rb
index 31730bd60c..1c5ccd369f 100644
--- a/lib/cgi.rb
+++ b/lib/cgi.rb
@@ -122,7 +122,7 @@ raise "Please, use ruby 1.9.0 or later." if RUBY_VERSION < "1.9.0"
#
# The simplest way to send output to the HTTP client is using the #out() method.
# This takes the HTTP headers as a hash parameter, and the body content
-# via a block. The headers can be generated as a string using the #header()
+# via a block. The headers can be generated as a string using the #http_header()
# method. The output stream can be written directly to using the #print()
# method.
#
@@ -234,22 +234,26 @@ raise "Please, use ruby 1.9.0 or later." if RUBY_VERSION < "1.9.0"
# === Print http header and html string to $DEFAULT_OUTPUT ($>)
#
# require "cgi"
-# cgi = CGI.new("html3") # add HTML generation methods
-# cgi.out() do
-# cgi.html() do
-# cgi.head{ cgi.title{"TITLE"} } +
-# cgi.body() do
-# cgi.form() do
-# cgi.textarea("get_text") +
-# cgi.br +
-# cgi.submit
+# cgi = CGI.new("html4") # add HTML generation methods
+# cgi.out do
+# cgi.html do
+# cgi.head do
+# cgi.title { "TITLE" }
+# end +
+# cgi.body do
+# cgi.form("ACTION" => "uri") do
+# cgi.p do
+# cgi.textarea("get_text") +
+# cgi.br +
+# cgi.submit
+# end
# end +
-# cgi.pre() do
+# cgi.pre do
# CGI::escapeHTML(
-# "params: " + cgi.params.inspect + "\n" +
-# "cookies: " + cgi.cookies.inspect + "\n" +
-# ENV.collect() do |key, value|
-# key + " --> " + value + "\n"
+# "params: #{cgi.params.inspect}\n" +
+# "cookies: #{cgi.cookies.inspect}\n" +
+# ENV.collect do |key, value|
+# "#{key} --> #{value}\n"
# end.join("")
# )
# end
@@ -262,6 +266,7 @@ raise "Please, use ruby 1.9.0 or later." if RUBY_VERSION < "1.9.0"
# CGI.new("html4") # html4.01 (Strict)
# CGI.new("html4Tr") # html4.01 Transitional
# CGI.new("html4Fr") # html4.01 Frameset
+# CGI.new("html5") # html5
#
class CGI
diff --git a/lib/cgi/core.rb b/lib/cgi/core.rb
index 824c80e5a0..27137a2032 100644
--- a/lib/cgi/core.rb
+++ b/lib/cgi/core.rb
@@ -67,8 +67,8 @@ class CGI
# Create an HTTP header block as a string.
#
# :call-seq:
- # headers(content_type_string="text/html")
- # headers(headers_hash)
+ # http_header(content_type_string="text/html")
+ # http_header(headers_hash)
#
# Includes the empty line that ends the header block.
#
@@ -127,29 +127,29 @@ class CGI
#
# Examples:
#
- # header
+ # http_header
# # Content-Type: text/html
#
- # header("text/plain")
+ # http_header("text/plain")
# # Content-Type: text/plain
#
- # header("nph" => true,
- # "status" => "OK", # == "200 OK"
- # # "status" => "200 GOOD",
- # "server" => ENV['SERVER_SOFTWARE'],
- # "connection" => "close",
- # "type" => "text/html",
- # "charset" => "iso-2022-jp",
- # # Content-Type: text/html; charset=iso-2022-jp
- # "length" => 103,
- # "language" => "ja",
- # "expires" => Time.now + 30,
- # "cookie" => [cookie1, cookie2],
- # "my_header1" => "my_value"
- # "my_header2" => "my_value")
+ # http_header("nph" => true,
+ # "status" => "OK", # == "200 OK"
+ # # "status" => "200 GOOD",
+ # "server" => ENV['SERVER_SOFTWARE'],
+ # "connection" => "close",
+ # "type" => "text/html",
+ # "charset" => "iso-2022-jp",
+ # # Content-Type: text/html; charset=iso-2022-jp
+ # "length" => 103,
+ # "language" => "ja",
+ # "expires" => Time.now + 30,
+ # "cookie" => [cookie1, cookie2],
+ # "my_header1" => "my_value"
+ # "my_header2" => "my_value")
#
# This method does not perform charset conversion.
- def header(options='text/html')
+ def http_header(options='text/html')
if options.is_a?(String)
content_type = options
buf = _header_for_string(content_type)
@@ -170,7 +170,15 @@ class CGI
buf << EOL # empty line of separator
return buf
end
- end # header()
+ end # http_header()
+
+ # This method is an alias for #http_header, when HTML5 tag maker is inactive.
+ #
+ # NOTE: use #http_header to create HTTP header blocks, this alias is only
+ # provided for backwards compatibility.
+ #
+ # Using #header with the HTML5 tag maker will create a <header> element.
+ alias :header :http_header
def _header_for_string(content_type) #:nodoc:
buf = ''
@@ -283,7 +291,7 @@ class CGI
# +content_type_string+::
# If a string is passed, it is assumed to be the content type.
# +headers_hash+::
- # This is a Hash of headers, similar to that used by #header.
+ # This is a Hash of headers, similar to that used by #http_header.
# +block+::
# A block is required and should evaluate to the body of the response.
#
@@ -344,7 +352,7 @@ class CGI
options["length"] = content.bytesize.to_s
output = stdoutput
output.binmode if defined? output.binmode
- output.print header(options)
+ output.print http_header(options)
output.print content unless "HEAD" == env_table['REQUEST_METHOD']
end
@@ -367,12 +375,13 @@ class CGI
params = {}
query.split(/[&;]/).each do |pairs|
key, value = pairs.split('=',2).collect{|v| CGI::unescape(v) }
- if key && value
- params.has_key?(key) ? params[key].push(value) : params[key] = [value]
- elsif key
- params[key]=[]
- end
+
+ next unless key
+
+ params[key] ||= []
+ params[key].push(value) if value
end
+
params.default=[].freeze
params
end
@@ -452,17 +461,17 @@ class CGI
end
##
- # Parses multipart form elements according to
+ # Parses multipart form elements according to
# http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2
#
- # Returns a hash of multipart form parameters with bodies of type StringIO or
+ # Returns a hash of multipart form parameters with bodies of type StringIO or
# Tempfile depending on whether the multipart form element exceeds 10 KB
#
# params[name => body]
#
def read_multipart(boundary, content_length)
## read first boundary
- stdin = $stdin
+ stdin = stdinput
first_line = "--#{boundary}#{EOL}"
content_length -= first_line.bytesize
status = stdin.read(first_line.bytesize)
@@ -478,10 +487,12 @@ class CGI
bufsize = 10 * 1024
max_count = MAX_MULTIPART_COUNT
n = 0
+ tempfiles = []
while true
(n += 1) < max_count or raise StandardError.new("too many parameters.")
## create body (StringIO or Tempfile)
body = create_body(bufsize < content_length)
+ tempfiles << body if defined?(Tempfile) && body.kind_of?(Tempfile)
class << body
if method_defined?(:path)
alias local_path path
@@ -529,16 +540,17 @@ class CGI
/Content-Disposition:.* filename=(?:"(.*?)"|([^;\r\n]*))/i.match(head)
filename = $1 || $2 || ''
filename = CGI.unescape(filename) if unescape_filename?()
- body.instance_variable_set('@original_filename', filename.taint)
+ body.instance_variable_set(:@original_filename, filename.taint)
## content type
/Content-Type: (.*)/i.match(head)
(content_type = $1 || '').chomp!
- body.instance_variable_set('@content_type', content_type.taint)
+ body.instance_variable_set(:@content_type, content_type.taint)
## query parameter name
/Content-Disposition:.* name=(?:"(.*?)"|([^;\r\n]*))/i.match(head)
name = $1 || $2 || ''
if body.original_filename.empty?
value=body.read.dup.force_encoding(@accept_charset)
+ body.unlink if defined?(Tempfile) && body.kind_of?(Tempfile)
(params[name] ||= []) << value
unless value.valid_encoding?
if @accept_charset_error_block
@@ -562,6 +574,14 @@ class CGI
raise EOFError, "bad boundary end of body part" unless boundary_end =~ /--/
params.default = []
params
+ ensure
+ if $! && tempfiles
+ tempfiles.each {|t|
+ if t.path
+ t.unlink
+ end
+ }
+ end
end # read_multipart
private :read_multipart
def create_body(is_large) #:nodoc:
@@ -770,6 +790,7 @@ class CGI
# "html4":: HTML 4.0
# "html4Tr":: HTML 4.0 Transitional
# "html4Fr":: HTML 4.0 with Framesets
+ # "html5":: HTML 5
#
# <tt>block</tt>::
# If provided, the block is called when an invalid encoding is
@@ -787,7 +808,7 @@ class CGI
# cookies and other parameters are parsed automatically from the standard
# CGI locations, which varies according to the REQUEST_METHOD.
def initialize(options = {}, &block) # :yields: name, value
- @accept_charset_error_block=block if block_given?
+ @accept_charset_error_block = block_given? ? block : nil
@options={:accept_charset=>@@accept_charset}
case options
when Hash
@@ -830,6 +851,11 @@ class CGI
extend Html4Fr
element_init()
extend HtmlExtension
+ when "html5"
+ require 'cgi/html'
+ extend Html5
+ element_init()
+ extend HtmlExtension
end
end
diff --git a/lib/cgi/html.rb b/lib/cgi/html.rb
index 04e2431735..ba19e3d603 100644
--- a/lib/cgi/html.rb
+++ b/lib/cgi/html.rb
@@ -63,8 +63,8 @@ class CGI
# cgi.a("http://www.example.com") { "Example" }
# # => "<A HREF=\"http://www.example.com\">Example</A>"
#
- # Modules Http3, Http4, etc., contain more basic HTML-generation methods
- # (:title, :center, etc.).
+ # Modules Html3, Html4, etc., contain more basic HTML-generation methods
+ # (+#title+, +#h1+, etc.).
#
# See class CGI for a detailed example.
#
@@ -334,7 +334,7 @@ class CGI
body = ""
end
if @output_hidden
- body += @output_hidden.collect{|k,v|
+ body << @output_hidden.collect{|k,v|
"<INPUT TYPE=\"HIDDEN\" NAME=\"#{k}\" VALUE=\"#{v}\">"
}.join
end
@@ -420,18 +420,18 @@ class CGI
if attributes.has_key?("DOCTYPE")
if attributes["DOCTYPE"]
- buf += attributes.delete("DOCTYPE")
+ buf << attributes.delete("DOCTYPE")
else
attributes.delete("DOCTYPE")
end
else
- buf += doctype
+ buf << doctype
end
if block_given?
- buf += super(attributes){ yield }
+ buf << super(attributes){ yield }
else
- buf += super(attributes)
+ buf << super(attributes)
end
if pretty
@@ -845,14 +845,15 @@ class CGI
# Initialise the HTML generation methods for this version.
def element_init
extend TagMaker
+ return if defined?(html)
methods = ""
# - -
for element in %w[ A TT I B U STRIKE BIG SMALL SUB SUP EM STRONG
- DFN CODE SAMP KBD VAR CITE FONT ADDRESS DIV center MAP
- APPLET PRE XMP LISTING DL OL UL DIR MENU SELECT table TITLE
+ DFN CODE SAMP KBD VAR CITE FONT ADDRESS DIV CENTER MAP
+ APPLET PRE XMP LISTING DL OL UL DIR MENU SELECT TABLE TITLE
STYLE SCRIPT H1 H2 H3 H4 H5 H6 TEXTAREA FORM BLOCKQUOTE
CAPTION ]
- methods += <<-BEGIN + nn_element_def(element) + <<-END
+ methods << <<-BEGIN + nn_element_def(element) + <<-END
def #{element.downcase}(attributes = {})
BEGIN
end
@@ -862,7 +863,7 @@ class CGI
# - O EMPTY
for element in %w[ IMG BASE BASEFONT BR AREA LINK PARAM HR INPUT
ISINDEX META ]
- methods += <<-BEGIN + nOE_element_def(element) + <<-END
+ methods << <<-BEGIN + nOE_element_def(element) + <<-END
def #{element.downcase}(attributes = {})
BEGIN
end
@@ -870,9 +871,9 @@ class CGI
end
# O O or - O
- for element in %w[ HTML HEAD BODY P PLAINTEXT DT DD LI OPTION tr
- th td ]
- methods += <<-BEGIN + nO_element_def(element) + <<-END
+ for element in %w[ HTML HEAD BODY P PLAINTEXT DT DD LI OPTION TR
+ TH TD ]
+ methods << <<-BEGIN + nO_element_def(element) + <<-END
def #{element.downcase}(attributes = {})
BEGIN
end
@@ -895,6 +896,7 @@ class CGI
# Initialise the HTML generation methods for this version.
def element_init
extend TagMaker
+ return if defined?(html)
methods = ""
# - -
for element in %w[ TT I B BIG SMALL EM STRONG DFN CODE SAMP KBD
@@ -902,7 +904,7 @@ class CGI
H1 H2 H3 H4 H5 H6 PRE Q INS DEL DL OL UL LABEL SELECT OPTGROUP
FIELDSET LEGEND BUTTON TABLE TITLE STYLE SCRIPT NOSCRIPT
TEXTAREA FORM A BLOCKQUOTE CAPTION ]
- methods += <<-BEGIN + nn_element_def(element) + <<-END
+ methods << <<-BEGIN + nn_element_def(element) + <<-END
def #{element.downcase}(attributes = {})
BEGIN
end
@@ -911,7 +913,7 @@ class CGI
# - O EMPTY
for element in %w[ IMG BASE BR AREA LINK PARAM HR INPUT COL META ]
- methods += <<-BEGIN + nOE_element_def(element) + <<-END
+ methods << <<-BEGIN + nOE_element_def(element) + <<-END
def #{element.downcase}(attributes = {})
BEGIN
end
@@ -920,8 +922,8 @@ class CGI
# O O or - O
for element in %w[ HTML BODY P DT DD LI OPTION THEAD TFOOT TBODY
- COLGROUP TR TH TD HEAD]
- methods += <<-BEGIN + nO_element_def(element) + <<-END
+ COLGROUP TR TH TD HEAD ]
+ methods << <<-BEGIN + nO_element_def(element) + <<-END
def #{element.downcase}(attributes = {})
BEGIN
end
@@ -944,6 +946,7 @@ class CGI
# Initialise the HTML generation methods for this version.
def element_init
extend TagMaker
+ return if defined?(html)
methods = ""
# - -
for element in %w[ TT I B U S STRIKE BIG SMALL EM STRONG DFN
@@ -952,7 +955,7 @@ class CGI
INS DEL DL OL UL DIR MENU LABEL SELECT OPTGROUP FIELDSET
LEGEND BUTTON TABLE IFRAME NOFRAMES TITLE STYLE SCRIPT
NOSCRIPT TEXTAREA FORM A BLOCKQUOTE CAPTION ]
- methods += <<-BEGIN + nn_element_def(element) + <<-END
+ methods << <<-BEGIN + nn_element_def(element) + <<-END
def #{element.downcase}(attributes = {})
BEGIN
end
@@ -962,7 +965,7 @@ class CGI
# - O EMPTY
for element in %w[ IMG BASE BASEFONT BR AREA LINK PARAM HR INPUT
COL ISINDEX META ]
- methods += <<-BEGIN + nOE_element_def(element) + <<-END
+ methods << <<-BEGIN + nOE_element_def(element) + <<-END
def #{element.downcase}(attributes = {})
BEGIN
end
@@ -972,7 +975,7 @@ class CGI
# O O or - O
for element in %w[ HTML BODY P DT DD LI OPTION THEAD TFOOT TBODY
COLGROUP TR TH TD HEAD ]
- methods += <<-BEGIN + nO_element_def(element) + <<-END
+ methods << <<-BEGIN + nO_element_def(element) + <<-END
def #{element.downcase}(attributes = {})
BEGIN
end
@@ -994,10 +997,11 @@ class CGI
# Initialise the HTML generation methods for this version.
def element_init
+ return if defined?(frameset)
methods = ""
# - -
for element in %w[ FRAMESET ]
- methods += <<-BEGIN + nn_element_def(element) + <<-END
+ methods << <<-BEGIN + nn_element_def(element) + <<-END
def #{element.downcase}(attributes = {})
BEGIN
end
@@ -1006,7 +1010,7 @@ class CGI
# - O EMPTY
for element in %w[ FRAME ]
- methods += <<-BEGIN + nOE_element_def(element) + <<-END
+ methods << <<-BEGIN + nOE_element_def(element) + <<-END
def #{element.downcase}(attributes = {})
BEGIN
end
@@ -1016,6 +1020,58 @@ class CGI
end
end # Html4Fr
-end
+ # Mixin module for HTML version 5 generation methods.
+ module Html5 # :nodoc:
+
+ # The DOCTYPE declaration for this version of HTML
+ def doctype
+ %|<!DOCTYPE HTML>|
+ end
+
+ # Initialise the HTML generation methods for this version.
+ def element_init
+ extend TagMaker
+ return if defined?(html)
+ methods = ""
+ # - -
+ for element in %w[ SECTION NAV ARTICLE ASIDE HGROUP HEADER
+ FOOTER FIGURE FIGCAPTION S TIME U MARK RUBY BDI IFRAME
+ VIDEO AUDIO CANVAS DATALIST OUTPUT PROGRESS METER DETAILS
+ SUMMARY MENU DIALOG I B SMALL EM STRONG DFN CODE SAMP KBD
+ VAR CITE ABBR SUB SUP SPAN BDO ADDRESS DIV MAP OBJECT
+ H1 H2 H3 H4 H5 H6 PRE Q INS DEL DL OL UL LABEL SELECT
+ FIELDSET LEGEND BUTTON TABLE TITLE STYLE SCRIPT NOSCRIPT
+ TEXTAREA FORM A BLOCKQUOTE CAPTION ]
+ methods += <<-BEGIN + nn_element_def(element) + <<-END
+ def #{element.downcase}(attributes = {})
+ BEGIN
+ end
+ END
+ end
+
+ # - O EMPTY
+ for element in %w[ IMG BASE BR AREA LINK PARAM HR INPUT COL META
+ COMMAND EMBED KEYGEN SOURCE TRACK WBR ]
+ methods += <<-BEGIN + nOE_element_def(element) + <<-END
+ def #{element.downcase}(attributes = {})
+ BEGIN
+ end
+ END
+ end
+
+ # O O or - O
+ for element in %w[ HTML HEAD BODY P DT DD LI OPTION THEAD TFOOT TBODY
+ OPTGROUP COLGROUP RT RP TR TH TD ]
+ methods += <<-BEGIN + nO_element_def(element) + <<-END
+ def #{element.downcase}(attributes = {})
+ BEGIN
+ end
+ END
+ end
+ eval(methods)
+ end
+
+ end # Html5
+end
diff --git a/lib/cgi/util.rb b/lib/cgi/util.rb
index 2bb3b0da78..41ae724c8c 100644
--- a/lib/cgi/util.rb
+++ b/lib/cgi/util.rb
@@ -4,9 +4,10 @@ class CGI
# url_encoded_string = CGI::escape("'Stop!' said Fred")
# # => "%27Stop%21%27+said+Fred"
def CGI::escape(string)
- string.gsub(/([^ a-zA-Z0-9_.-]+)/) do
+ encoding = string.encoding
+ string.dup.force_encoding('ASCII-8BIT').gsub(/([^ a-zA-Z0-9_.-]+)/) do
'%' + $1.unpack('H2' * $1.bytesize).join('%').upcase
- end.tr(' ', '+')
+ end.tr(' ', '+').force_encoding(encoding)
end
# URL-decode a string with encoding(optional).
@@ -21,6 +22,7 @@ class CGI
# The set of special characters and their escaped values
TABLE_FOR_ESCAPE_HTML__ = {
+ "'" => '&#39;',
'&' => '&amp;',
'"' => '&quot;',
'<' => '&lt;',
@@ -31,7 +33,7 @@ class CGI
# CGI::escapeHTML('Usage: foo "bar" <baz>')
# # => "Usage: foo &quot;bar&quot; &lt;baz&gt;"
def CGI::escapeHTML(string)
- string.gsub(/[&\"<>]/, TABLE_FOR_ESCAPE_HTML__)
+ string.gsub(/['&\"<>]/, TABLE_FOR_ESCAPE_HTML__)
end
# Unescape a string that has been HTML-escaped
@@ -40,8 +42,9 @@ class CGI
def CGI::unescapeHTML(string)
enc = string.encoding
if [Encoding::UTF_16BE, Encoding::UTF_16LE, Encoding::UTF_32BE, Encoding::UTF_32LE].include?(enc)
- return string.gsub(Regexp.new('&(amp|quot|gt|lt|#[0-9]+|#x[0-9A-Fa-f]+);'.encode(enc))) do
+ return string.gsub(Regexp.new('&(apos|amp|quot|gt|lt|#[0-9]+|#x[0-9A-Fa-f]+);'.encode(enc))) do
case $1.encode("US-ASCII")
+ when 'apos' then "'".encode(enc)
when 'amp' then '&'.encode(enc)
when 'quot' then '"'.encode(enc)
when 'gt' then '>'.encode(enc)
@@ -52,9 +55,10 @@ class CGI
end
end
asciicompat = Encoding.compatible?(string, "a")
- string.gsub(/&(amp|quot|gt|lt|\#[0-9]+|\#x[0-9A-Fa-f]+);/) do
+ string.gsub(/&(apos|amp|quot|gt|lt|\#[0-9]+|\#x[0-9A-Fa-f]+);/) do
match = $1.dup
case match
+ when 'apos' then "'"
when 'amp' then '&'
when 'quot' then '"'
when 'gt' then '>'
@@ -87,7 +91,7 @@ class CGI
def CGI::escape_html(str)
escapeHTML(str)
end
-
+
# Synonym for CGI::unescapeHTML(str)
def CGI::unescape_html(str)
unescapeHTML(str)
@@ -141,7 +145,7 @@ class CGI
def CGI::escape_element(str)
escapeElement(str)
end
-
+
# Synonym for CGI::unescapeElement(str)
def CGI::unescape_element(str)
unescapeElement(str)
diff --git a/lib/csv.rb b/lib/csv.rb
index 13f86ec318..58953a2bf9 100644
--- a/lib/csv.rb
+++ b/lib/csv.rb
@@ -973,6 +973,7 @@ class CSV
# <b><tt>:header_converters</tt></b>:: +nil+
# <b><tt>:skip_blanks</tt></b>:: +false+
# <b><tt>:force_quotes</tt></b>:: +false+
+ # <b><tt>:skip_lines</tt></b>:: +nil+
#
DEFAULT_OPTIONS = { col_sep: ",",
row_sep: :auto,
@@ -984,7 +985,8 @@ class CSV
return_headers: false,
header_converters: nil,
skip_blanks: false,
- force_quotes: false }.freeze
+ force_quotes: false,
+ skip_lines: nil }.freeze
#
# This method will return a CSV instance, just like CSV::new(), but the
@@ -1554,6 +1556,14 @@ class CSV
# skip over any rows with no content.
# <b><tt>:force_quotes</tt></b>:: When set to a +true+ value, CSV will
# quote all CSV fields it creates.
+ # <b><tt>:skip_lines</tt></b>:: When set to an object responding to
+ # <tt>match</tt>, every line matching
+ # it is considered a comment and ignored
+ # during parsing. When set to +nil+
+ # no line is considered a comment.
+ # If the passed object does not respond
+ # to <tt>match</tt>, <tt>ArgumentError</tt>
+ # is thrown.
#
# See CSV::DEFAULT_OPTIONS for the default settings.
#
@@ -1591,6 +1601,7 @@ class CSV
init_parsers(options)
init_converters(options)
init_headers(options)
+ init_comments(options)
options.delete(:encoding)
options.delete(:internal_encoding)
@@ -1620,6 +1631,10 @@ class CSV
attr_reader :quote_char
# The limit for field size, if any. See CSV::new for details.
attr_reader :field_size_limit
+
+ # The regex marking a line as a comment. See CSV::new for details
+ attr_reader :skip_lines
+
#
# Returns the current list of converters in effect. See CSV::new for details.
# Built-in converters will be returned by name, while others will be returned
@@ -1873,6 +1888,8 @@ class CSV
end
end
+ next if @skip_lines and @skip_lines.match parse
+
parts = parse.split(@col_sep, -1)
if parts.empty?
if in_extended_col
@@ -2189,6 +2206,17 @@ class CSV
init_converters(options, :header_converters)
end
+ # Stores the pattern of comments to skip from the provided options.
+ #
+ # The pattern must respond to +.match+, else ArgumentError is raised.
+ #
+ # See also CSV.new
+ def init_comments(options)
+ @skip_lines = options.delete(:skip_lines)
+ if @skip_lines and not @skip_lines.respond_to?(:match)
+ raise ArgumentError, ":skip_lines has to respond to matches"
+ end
+ end
#
# The actual work method for adding converters, used by both CSV.convert() and
# CSV.header_convert().
@@ -2319,8 +2347,8 @@ class CSV
private
- #
- # Returns the encoding of the internal IO object or the +default+ if the
+ #
+ # Returns the encoding of the internal IO object or the +default+ if the
# encoding cannot be determined.
#
def raw_encoding(default = Encoding::ASCII_8BIT)
@@ -2336,20 +2364,41 @@ class CSV
end
end
-# Another name for CSV::instance().
+# Passes +args+ to CSV::instance.
+#
+# CSV("CSV,data").read
+# #=> [["CSV", "data"]]
+#
+# If a block is given, the instance is passed the block and the return value
+# becomes the return value of the block.
+#
+# CSV("CSV,data") { |c|
+# c.read.any? { |a| a.include?("data") }
+# } #=> true
+#
+# CSV("CSV,data") { |c|
+# c.read.any? { |a| a.include?("zombies") }
+# } #=> false
+#
def CSV(*args, &block)
CSV.instance(*args, &block)
end
-class Array
- # Equivalent to <tt>CSV::generate_line(self, options)</tt>.
+class Array # :nodoc:
+ # Equivalent to CSV::generate_line(self, options)
+ #
+ # ["CSV", "data"].to_csv
+ # #=> "CSV,data\n"
def to_csv(options = Hash.new)
CSV.generate_line(self, options)
end
end
-class String
- # Equivalent to <tt>CSV::parse_line(self, options)</tt>.
+class String # :nodoc:
+ # Equivalent to CSV::parse_line(self, options)
+ #
+ # "CSV,data".parse_csv
+ # #=> ["CSV", "data"]
def parse_csv(options = Hash.new)
CSV.parse_line(self, options)
end
diff --git a/lib/debug.rb b/lib/debug.rb
index e99f69826a..0cf81c0885 100644
--- a/lib/debug.rb
+++ b/lib/debug.rb
@@ -12,18 +12,178 @@ end
require 'tracer'
require 'pp'
-class Tracer
+class Tracer # :nodoc:
def Tracer.trace_func(*vars)
Single.trace_func(*vars)
end
end
-SCRIPT_LINES__ = {} unless defined? SCRIPT_LINES__
+SCRIPT_LINES__ = {} unless defined? SCRIPT_LINES__ # :nodoc:
+
+##
+# This library provides debugging functionality to Ruby.
+#
+# To add a debugger to your code, start by requiring +debug+ in your
+# program:
+#
+# def say(word)
+# require 'debug'
+# puts word
+# end
+#
+# This will cause Ruby to interrupt execution and show a prompt when the +say+
+# method is run.
+#
+# Once you're inside the prompt, you can start debugging your program.
+#
+# (rdb:1) p word
+# "hello"
+#
+# == Getting help
+#
+# You can get help at any time by pressing +h+.
+#
+# (rdb:1) h
+# Debugger help v.-0.002b
+# Commands
+# b[reak] [file:|class:]<line|method>
+# b[reak] [class.]<line|method>
+# set breakpoint to some position
+# wat[ch] <expression> set watchpoint to some expression
+# cat[ch] (<exception>|off) set catchpoint to an exception
+# b[reak] list breakpoints
+# cat[ch] show catchpoint
+# del[ete][ nnn] delete some or all breakpoints
+# disp[lay] <expression> add expression into display expression list
+# undisp[lay][ nnn] delete one particular or all display expressions
+# c[ont] run until program ends or hit breakpoint
+# s[tep][ nnn] step (into methods) one line or till line nnn
+# n[ext][ nnn] go over one line or till line nnn
+# w[here] display frames
+# f[rame] alias for where
+# l[ist][ (-|nn-mm)] list program, - lists backwards
+# nn-mm lists given lines
+# up[ nn] move to higher frame
+# down[ nn] move to lower frame
+# fin[ish] return to outer frame
+# tr[ace] (on|off) set trace mode of current thread
+# tr[ace] (on|off) all set trace mode of all threads
+# q[uit] exit from debugger
+# v[ar] g[lobal] show global variables
+# v[ar] l[ocal] show local variables
+# v[ar] i[nstance] <object> show instance variables of object
+# v[ar] c[onst] <object> show constants of object
+# m[ethod] i[nstance] <obj> show methods of object
+# m[ethod] <class|module> show instance methods of class or module
+# th[read] l[ist] list all threads
+# th[read] c[ur[rent]] show current thread
+# th[read] [sw[itch]] <nnn> switch thread context to nnn
+# th[read] stop <nnn> stop thread nnn
+# th[read] resume <nnn> resume thread nnn
+# p expression evaluate expression and print its value
+# h[elp] print this help
+# <everything else> evaluate
+#
+# == Usage
+#
+# The following is a list of common functionalities that the debugger
+# provides.
+#
+# === Navigating through your code
+#
+# In general, a debugger is used to find bugs in your program, which
+# often means pausing execution and inspecting variables at some point
+# in time.
+#
+# Let's look at an example:
+#
+# def my_method(foo)
+# require 'debug'
+# foo = get_foo if foo.nil?
+# raise if foo.nil?
+# end
+#
+# When you run this program, the debugger will kick in just before the
+# +foo+ assignment.
+#
+# (rdb:1) p foo
+# nil
+#
+# In this example, it'd be interesting to move to the next line and
+# inspect the value of +foo+ again. You can do that by pressing +n+:
+#
+# (rdb:1) n # goes to next line
+# (rdb:1) p foo
+# nil
+#
+# You now know that the original value of +foo+ was nil, and that it
+# still was nil after calling +get_foo+.
+#
+# Other useful commands for navigating through your code are:
+#
+# +c+::
+# Runs the program until it either exists or encounters another breakpoint.
+# You usually press +c+ when you are finished debugging your program and
+# want to resume its execution.
+# +s+::
+# Steps into method definition. In the previous example, +s+ would take you
+# inside the method definition of +get_foo+.
+# +r+::
+# Restart the program.
+# +q+::
+# Quit the program.
+#
+# === Inspecting variables
+#
+# You can use the debugger to easily inspect both local and global variables.
+# We've seen how to inspect local variables before:
+#
+# (rdb:1) p my_arg
+# 42
+#
+# You can also pretty print the result of variables or expressions:
+#
+# (rdb:1) pp %w{a very long long array containing many words}
+# ["a",
+# "very",
+# "long",
+# ...
+# ]
+#
+# You can list all local variables with +v l+:
+#
+# (rdb:1) v l
+# foo => "hello"
+#
+# Similarly, you can show all global variables with +v g+:
+#
+# (rdb:1) v g
+# all global variables
+#
+# Finally, you can omit +p+ if you simply want to evaluate a variable or
+# expression
+#
+# (rdb:1) 5**2
+# 25
+#
+# === Going beyond basics
+#
+# Ruby Debug provides more advanced functionalities like switching
+# between threads, setting breakpoints and watch expressions, and more.
+# The full list of commands is available at any time by pressing +h+.
+#
+# == Staying out of trouble
+#
+# Make sure you remove every instance of +require 'debug'+ before
+# shipping your code. Failing to do so may result in your program
+# hanging unpredictably.
+#
+# Debug is not available in safe mode.
class DEBUGGER__
- MUTEX = Mutex.new
+ MUTEX = Mutex.new # :nodoc:
- class Context
+ class Context # :nodoc:
DEBUG_LAST_CMD = []
begin
@@ -545,7 +705,9 @@ Commands
th[read] [sw[itch]] <nnn> switch thread context to nnn
th[read] stop <nnn> stop thread nnn
th[read] resume <nnn> resume thread nnn
+ pp expression evaluate expression and pretty_print its value
p expression evaluate expression and print its value
+ r[estart] restart program
h[elp] print this help
<everything else> evaluate
EOHELP
diff --git a/lib/delegate.rb b/lib/delegate.rb
index 2086a721f9..e46e4f8c23 100644
--- a/lib/delegate.rb
+++ b/lib/delegate.rb
@@ -92,8 +92,8 @@ class Delegator < BasicObject
# Returns the methods available to this delegate object as the union
# of this object's and \_\_getobj\_\_ methods.
#
- def methods
- __getobj__.methods | super
+ def methods(all=true)
+ __getobj__.methods(all) | super
end
#
@@ -130,6 +130,9 @@ class Delegator < BasicObject
__getobj__ != obj
end
+ #
+ # Delegates ! to the \_\_getobj\_\_
+ #
def !
!__getobj__
end
@@ -285,8 +288,7 @@ class SimpleDelegator<Delegator
end
end
-# :stopdoc:
-def Delegator.delegating_block(mid)
+def Delegator.delegating_block(mid) # :nodoc:
lambda do |*args, &block|
target = self.__getobj__
begin
@@ -296,7 +298,6 @@ def Delegator.delegating_block(mid)
end
end
end
-# :startdoc:
#
# The primary interface to this library. Use to setup delegation when defining
diff --git a/lib/drb/drb.rb b/lib/drb/drb.rb
index 69456b1db2..fa914f877d 100644
--- a/lib/drb/drb.rb
+++ b/lib/drb/drb.rb
@@ -34,17 +34,11 @@
# [http://www2a.biglobe.ne.jp/~seki/ruby/druby.en.html]
# The English version of the dRuby home page.
#
-# [http://www.chadfowler.com/ruby/drb.html]
-# A quick tutorial introduction to using dRuby by Chad Fowler.
+# [http://pragprog.com/book/sidruby/the-druby-book]
+# The dRuby Book: Distributed and Parallel Computing with Ruby
+# by Masatoshi Seki and Makoto Inoue
#
-# [http://www.linux-mag.com/2002-09/ruby_05.html]
-# A tutorial introduction to dRuby in Linux Magazine by Dave Thomas.
-# Includes a discussion of Rinda.
-#
-# [http://www.eng.cse.dmu.ac.uk/~hgs/ruby/dRuby/]
-# Links to English-language Ruby material collected by Hugh Sasse.
-#
-# [http://www.rubycentral.com/book/ospace.html]
+# [http://www.ruby-doc.org/docs/ProgrammingRuby/html/ospace.html]
# The chapter from *Programming* *Ruby* by Dave Thomas and Andy Hunt
# which discusses dRuby.
#
@@ -1016,8 +1010,8 @@ module DRb
def self.new_with(uri, ref)
it = self.allocate
- it.instance_variable_set('@uri', uri)
- it.instance_variable_set('@ref', ref)
+ it.instance_variable_set(:@uri, uri)
+ it.instance_variable_set(:@ref, ref)
it
end
@@ -1388,7 +1382,7 @@ module DRb
def alive?
@thread.alive?
end
-
+
def here?(uri)
@exported_uri.include?(uri)
end
diff --git a/lib/drb/extservm.rb b/lib/drb/extservm.rb
index 216fe8dcee..8a7fc316af 100644
--- a/lib/drb/extservm.rb
+++ b/lib/drb/extservm.rb
@@ -79,7 +79,15 @@ module DRb
@servers[name] = false
end
uri = @uri || DRb.uri
- Process.detach spawn("#{command} #{uri} #{name}")
+ if command.respond_to? :to_ary
+ command = command.to_ary + [uri, name]
+ pid = spawn(*command)
+ else
+ pid = spawn("#{command} #{uri} #{name}")
+ end
+ th = Process.detach(pid)
+ th[:drb_service] = name
+ th
end
end
end
diff --git a/lib/drb/ssl.rb b/lib/drb/ssl.rb
index 17e2a73d85..c4f76987de 100644
--- a/lib/drb/ssl.rb
+++ b/lib/drb/ssl.rb
@@ -15,6 +15,7 @@ module DRb
:SSLClientCA => nil,
:SSLCACertificatePath => nil,
:SSLCACertificateFile => nil,
+ :SSLTmpDhCallback => nil,
:SSLVerifyMode => ::OpenSSL::SSL::VERIFY_NONE,
:SSLVerifyDepth => nil,
:SSLVerifyCallback => nil, # custom verification
@@ -54,7 +55,7 @@ module DRb
return
end
- rsa = OpenSSL::PKey::RSA.new(512){|p, n|
+ rsa = OpenSSL::PKey::RSA.new(1024){|p, n|
next unless self[:verbose]
case p
when 0; $stderr.putc "." # BN_generate_prime
@@ -101,6 +102,7 @@ module DRb
ctx.client_ca = self[:SSLClientCA]
ctx.ca_path = self[:SSLCACertificatePath]
ctx.ca_file = self[:SSLCACertificateFile]
+ ctx.tmp_dh_callback = self[:SSLTmpDhCallback]
ctx.verify_mode = self[:SSLVerifyMode]
ctx.verify_depth = self[:SSLVerifyDepth]
ctx.verify_callback = self[:SSLVerifyCallback]
@@ -177,7 +179,11 @@ module DRb
break if (@acl ? @acl.allow_socket?(soc) : true)
soc.close
end
- ssl = @config.accept(soc)
+ begin
+ ssl = @config.accept(soc)
+ ensure
+ soc.close if $!
+ end
self.class.new(uri, ssl, @config, true)
rescue OpenSSL::SSL::SSLError
warn("#{__FILE__}:#{__LINE__}: warning: #{$!.message} (#{$!.class})") if @config[:verbose]
diff --git a/lib/drb/unix.rb b/lib/drb/unix.rb
index 549ff8cf55..6de5052451 100644
--- a/lib/drb/unix.rb
+++ b/lib/drb/unix.rb
@@ -100,7 +100,7 @@ module DRb
end
def set_sockopt(soc)
- soc.fcntl(Fcntl::F_SETFL, Fcntl::FD_CLOEXEC) if defined? Fcntl::FD_CLOEXEC
+ soc.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) if defined? Fcntl::FD_CLOEXEC
end
end
diff --git a/lib/erb.rb b/lib/erb.rb
index bb47943a86..934d83aa48 100644
--- a/lib/erb.rb
+++ b/lib/erb.rb
@@ -1,3 +1,4 @@
+# -*- coding: us-ascii -*-
# = ERB -- Ruby Templating
#
# Author:: Masatoshi SEKI
@@ -10,6 +11,8 @@
#
# You can redistribute it and/or modify it under the same terms as Ruby.
+require "cgi/util"
+
#
# = ERB -- Ruby Templating
#
@@ -816,7 +819,7 @@ class ERB
end
# Generate results and print them. (see ERB#result)
- def run(b=TOPLEVEL_BINDING)
+ def run(b=new_toplevel)
print self.result(b)
end
@@ -828,7 +831,7 @@ class ERB
# _b_ accepts a Binding or Proc object which is used to set the context of
# code evaluation.
#
- def result(b=TOPLEVEL_BINDING)
+ def result(b=new_toplevel)
if @safe_level
proc {
$SAFE = @safe_level
@@ -839,6 +842,12 @@ class ERB
end
end
+ def new_toplevel
+ # New binding each time *near* toplevel for unspecified runs
+ TOPLEVEL_BINDING.dup
+ end
+ private :new_toplevel
+
# Define _methodname_ as instance method of _mod_ from compiled ruby source.
#
# example:
@@ -909,7 +918,7 @@ class ERB
# is a &gt; 0 &amp; a &lt; 10?
#
def html_escape(s)
- s.to_s.gsub(/&/, "&amp;").gsub(/\"/, "&quot;").gsub(/>/, "&gt;").gsub(/</, "&lt;")
+ CGI.escapeHTML(s.to_s)
end
alias h html_escape
module_function :h
diff --git a/lib/fileutils.rb b/lib/fileutils.rb
index d4213dd0be..af2d19ac61 100644
--- a/lib/fileutils.rb
+++ b/lib/fileutils.rb
@@ -83,16 +83,96 @@
#
module FileUtils
+ @fileutils_output = $stderr
+ @fileutils_label = ''
+ extend self
- def self.private_module_function(name) #:nodoc:
- module_function name
- private_class_method name
+ #
+ # This module has all methods of FileUtils module, but it outputs messages
+ # before acting. This equates to passing the <tt>:verbose</tt> flag to
+ # methods in FileUtils.
+ #
+ module Verbose
+ include FileUtils
+ @fileutils_output = $stderr
+ @fileutils_label = ''
+ extend self
+ end
+
+ #
+ # This module has all methods of FileUtils module, but never changes
+ # files/directories. This equates to passing the <tt>:noop</tt> flag
+ # to methods in FileUtils.
+ #
+ module NoWrite
+ include FileUtils
+ @fileutils_output = $stderr
+ @fileutils_label = ''
+ extend self
+ end
+
+ #
+ # This module has all methods of FileUtils module, but never changes
+ # files/directories, with printing message before acting.
+ # This equates to passing the <tt>:noop</tt> and <tt>:verbose</tt> flag
+ # to methods in FileUtils.
+ #
+ module DryRun
+ include FileUtils
+ @fileutils_output = $stderr
+ @fileutils_label = ''
+ extend self
end
# This hash table holds command options.
OPT_TABLE = {} #:nodoc: internal use only
#
+ def self.define_command(name, *options)
+ OPT_TABLE[name.to_s] = options
+
+ if options.include?(:verbose)
+ Verbose.module_eval(<<-EOS, __FILE__, __LINE__ + 1)
+ def #{name}(*args)
+ super(*fu_update_option(args, :verbose => true))
+ end
+ EOS
+ end
+ if options.include?(:noop)
+ NoWrite.module_eval(<<-EOS, __FILE__, __LINE__ + 1)
+ def #{name}(*args)
+ super(*fu_update_option(args, :noop => true))
+ end
+ EOS
+ DryRun.module_eval(<<-EOS, __FILE__, __LINE__ + 1)
+ def #{name}(*args)
+ super(*fu_update_option(args, :noop => true, :verbose => true))
+ end
+ EOS
+ else
+ NoWrite.module_eval(<<-EOS, __FILE__, __LINE__ + 1)
+ def #{name}(*); end
+ EOS
+ DryRun.module_eval(<<-EOS, __FILE__, __LINE__ + 1)
+ def #{name}(*); end
+ EOS
+ end
+
+ [self, Verbose, DryRun, NoWrite].each do |mod|
+ mod.module_eval(<<-EOS, __FILE__, __LINE__ + 1)
+ private :#{name}
+ class << self; public :#{name}; end
+ EOS
+ end
+ end
+
+ class << self
+ private :define_command
+ end
+
+public
+
+ #
# Options: (none)
#
# Returns the name of the current directory.
@@ -100,10 +180,11 @@ module FileUtils
def pwd
Dir.pwd
end
- module_function :pwd
alias getwd pwd
- module_function :getwd
+
+ define_command('pwd')
+ define_command('getwd')
#
# Options: verbose
@@ -118,20 +199,18 @@ module FileUtils
# FileUtils.cd('/') do # chdir
# [...] # do something
# end # return to original directory
- #
+ #
def cd(dir, options = {}, &block) # :yield: dir
fu_check_options options, OPT_TABLE['cd']
fu_output_message "cd #{dir}" if options[:verbose]
Dir.chdir(dir, &block)
fu_output_message 'cd -' if options[:verbose] and block
end
- module_function :cd
alias chdir cd
- module_function :chdir
- OPT_TABLE['cd'] =
- OPT_TABLE['chdir'] = [:verbose]
+ define_command('cd', :verbose)
+ define_command('chdir', :verbose)
#
# Options: (none)
@@ -142,9 +221,7 @@ module FileUtils
# FileUtils.uptodate?('hello.o', %w(hello.c hello.h)) or \
# system 'make hello.o'
#
- def uptodate?(new, old_list, options = nil)
- raise ArgumentError, 'uptodate? does not accept any option' if options
-
+ def uptodate?(new, old_list)
return false unless File.exist?(new)
new_time = File.mtime(new)
old_list.each do |old|
@@ -154,7 +231,8 @@ module FileUtils
end
true
end
- module_function :uptodate?
+
+ define_command('uptodate?')
#
# Options: mode noop verbose
@@ -176,9 +254,8 @@ module FileUtils
fu_mkdir dir, options[:mode]
end
end
- module_function :mkdir
- OPT_TABLE['mkdir'] = [:mode, :noop, :verbose]
+ define_command('mkdir', :mode, :noop, :verbose)
#
# Options: mode noop verbose
@@ -202,7 +279,7 @@ module FileUtils
fu_output_message "mkdir -p #{options[:mode] ? ('-m %03o ' % options[:mode]) : ''}#{list.join ' '}" if options[:verbose]
return *list if options[:noop]
- list.map {|path| path.sub(%r</\z>, '') }.each do |path|
+ list.map {|path| path.chomp(?/) }.each do |path|
# optimize for the most common case
begin
fu_mkdir path, options[:mode]
@@ -227,19 +304,18 @@ module FileUtils
return *list
end
- module_function :mkdir_p
alias mkpath mkdir_p
alias makedirs mkdir_p
- module_function :mkpath
- module_function :makedirs
- OPT_TABLE['mkdir_p'] =
- OPT_TABLE['mkpath'] =
- OPT_TABLE['makedirs'] = [:mode, :noop, :verbose]
+ define_command('mkdir_p', :mode, :noop, :verbose)
+ define_command('mkpath', :mode, :noop, :verbose)
+ define_command('makedirs', :mode, :noop, :verbose)
+
+private
def fu_mkdir(path, mode) #:nodoc:
- path = path.sub(%r</\z>, '')
+ path = path.chomp(?/)
if mode
Dir.mkdir path, mode
File.chmod mode, path
@@ -247,7 +323,8 @@ module FileUtils
Dir.mkdir path
end
end
- private_module_function :fu_mkdir
+
+public
#
# Options: noop, verbose
@@ -267,7 +344,7 @@ module FileUtils
return if options[:noop]
list.each do |dir|
begin
- Dir.rmdir(dir = dir.sub(%r</\z>, ''))
+ Dir.rmdir(dir = dir.chomp(?/))
if parents
until (parent = File.dirname(dir)) == '.' or parent == dir
Dir.rmdir(dir)
@@ -277,9 +354,8 @@ module FileUtils
end
end
end
- module_function :rmdir
- OPT_TABLE['rmdir'] = [:parents, :noop, :verbose]
+ define_command('rmdir', :parents, :noop, :verbose)
#
# Options: force noop verbose
@@ -312,13 +388,11 @@ module FileUtils
File.link s, d
end
end
- module_function :ln
alias link ln
- module_function :link
- OPT_TABLE['ln'] =
- OPT_TABLE['link'] = [:force, :noop, :verbose]
+ define_command('ln', :force, :noop, :verbose)
+ define_command('link', :force, :noop, :verbose)
#
# Options: force noop verbose
@@ -351,19 +425,17 @@ module FileUtils
File.symlink s, d
end
end
- module_function :ln_s
alias symlink ln_s
- module_function :symlink
- OPT_TABLE['ln_s'] =
- OPT_TABLE['symlink'] = [:force, :noop, :verbose]
+ define_command('ln_s', :force, :noop, :verbose)
+ define_command('symlink', :force, :noop, :verbose)
#
# Options: noop verbose
#
# Same as
- # #ln_s(src, dest, :force)
+ # #ln_s(src, dest, :force => true)
#
def ln_sf(src, dest, options = {})
fu_check_options options, OPT_TABLE['ln_sf']
@@ -371,9 +443,8 @@ module FileUtils
options[:force] = true
ln_s src, dest, options
end
- module_function :ln_sf
- OPT_TABLE['ln_sf'] = [:noop, :verbose]
+ define_command('ln_sf', :noop, :verbose)
#
# Options: preserve noop verbose
@@ -396,13 +467,11 @@ module FileUtils
copy_file s, d, options[:preserve]
end
end
- module_function :cp
alias copy cp
- module_function :copy
- OPT_TABLE['cp'] =
- OPT_TABLE['copy'] = [:preserve, :noop, :verbose]
+ define_command('cp', :preserve, :noop, :verbose)
+ define_command('copy', :preserve, :noop, :verbose)
#
# Options: preserve noop verbose dereference_root remove_destination
@@ -424,7 +493,7 @@ module FileUtils
# # If you want to copy all contents of a directory instead of the
# # directory itself, c.f. src/x -> dest/x, src/y -> dest/y,
# # use following code.
- # FileUtils.cp_r 'src/.', 'dest' # cp_r('src', 'dest') makes src/dest,
+ # FileUtils.cp_r 'src/.', 'dest' # cp_r('src', 'dest') makes dest/src,
# # but this doesn't.
#
def cp_r(src, dest, options = {})
@@ -437,10 +506,8 @@ module FileUtils
copy_entry s, d, options[:preserve], options[:dereference_root], options[:remove_destination]
end
end
- module_function :cp_r
- OPT_TABLE['cp_r'] = [:preserve, :noop, :verbose,
- :dereference_root, :remove_destination]
+ define_command('cp_r', :preserve, :noop, :verbose, :dereference_root, :remove_destination)
#
# Copies a file system entry +src+ to +dest+.
@@ -466,7 +533,8 @@ module FileUtils
ent.copy_metadata destent.path if preserve
end
end
- module_function :copy_entry
+
+ define_command(:copy_entry)
#
# Copies file contents of +src+ to +dest+.
@@ -477,7 +545,8 @@ module FileUtils
ent.copy_file dest
ent.copy_metadata dest if preserve
end
- module_function :copy_file
+
+ define_command(:copy_file)
#
# Copies stream +src+ to +dest+.
@@ -487,7 +556,8 @@ module FileUtils
def copy_stream(src, dest)
IO.copy_stream(src, dest)
end
- module_function :copy_stream
+
+ define_command(:copy_stream)
#
# Options: force noop verbose
@@ -530,18 +600,19 @@ module FileUtils
end
end
end
- module_function :mv
alias move mv
- module_function :move
- OPT_TABLE['mv'] =
- OPT_TABLE['move'] = [:force, :noop, :verbose, :secure]
+ define_command('mv', :force, :noop, :verbose, :secure)
+ define_command('move', :force, :noop, :verbose, :secure)
+
+private
def rename_cannot_overwrite_file? #:nodoc:
/cygwin|mswin|mingw|bccwin|emx/ =~ RUBY_PLATFORM
end
- private_module_function :rename_cannot_overwrite_file?
+
+public
#
# Options: force noop verbose
@@ -563,13 +634,11 @@ module FileUtils
remove_file path, options[:force]
end
end
- module_function :rm
alias remove rm
- module_function :remove
- OPT_TABLE['rm'] =
- OPT_TABLE['remove'] = [:force, :noop, :verbose]
+ define_command('rm', :force, :noop, :verbose)
+ define_command('remove', :force, :noop, :verbose)
#
# Options: noop verbose
@@ -584,13 +653,11 @@ module FileUtils
options[:force] = true
rm list, options
end
- module_function :rm_f
alias safe_unlink rm_f
- module_function :safe_unlink
- OPT_TABLE['rm_f'] =
- OPT_TABLE['safe_unlink'] = [:noop, :verbose]
+ define_command('rm_f', :noop, :verbose)
+ define_command('safe_unlink', :noop, :verbose)
#
# Options: force noop verbose secure
@@ -627,9 +694,8 @@ module FileUtils
end
end
end
- module_function :rm_r
- OPT_TABLE['rm_r'] = [:force, :noop, :verbose, :secure]
+ define_command('rm_r', :force, :noop, :verbose, :secure)
#
# Options: noop verbose secure
@@ -647,13 +713,11 @@ module FileUtils
options[:force] = true
rm_r list, options
end
- module_function :rm_rf
alias rmtree rm_rf
- module_function :rmtree
- OPT_TABLE['rm_rf'] =
- OPT_TABLE['rmtree'] = [:noop, :verbose, :secure]
+ define_command('rm_rf', :noop, :verbose, :secure)
+ define_command('rmtree', :noop, :verbose, :secure)
#
# This method removes a file system entry +path+. +path+ shall be a
@@ -741,21 +805,24 @@ module FileUtils
rescue
raise unless force
end
- module_function :remove_entry_secure
+
+ define_command(:remove_entry_secure)
+
+private
def fu_have_symlink? #:nodoc:
File.symlink nil, nil
rescue NotImplementedError
return false
- rescue
+ rescue TypeError
return true
end
- private_module_function :fu_have_symlink?
def fu_stat_identical_entry?(a, b) #:nodoc:
a.dev == b.dev and a.ino == b.ino
end
- private_module_function :fu_stat_identical_entry?
+
+public
#
# This method removes a file system entry +path+.
@@ -775,7 +842,8 @@ module FileUtils
rescue
raise unless force
end
- module_function :remove_entry
+
+ define_command(:remove_entry)
#
# Removes a file +path+.
@@ -786,7 +854,8 @@ module FileUtils
rescue
raise unless force
end
- module_function :remove_file
+
+ define_command(:remove_file)
#
# Removes a directory +dir+ and its contents recursively.
@@ -795,7 +864,8 @@ module FileUtils
def remove_dir(path, force = false)
remove_entry path, force # FIXME?? check if it is a directory
end
- module_function :remove_dir
+
+ define_command(:remove_dir)
#
# Returns true if the contents of a file A and a file B are identical.
@@ -811,31 +881,30 @@ module FileUtils
}
}
end
- module_function :compare_file
alias identical? compare_file
alias cmp compare_file
- module_function :identical?
- module_function :cmp
+
+ define_command(:compare_file)
+ define_command(:identical?)
+ define_command(:cmp)
#
# Returns true if the contents of a stream +a+ and +b+ are identical.
#
def compare_stream(a, b)
bsize = fu_stream_blksize(a, b)
- sa = sb = nil
- while sa == sb
- sa = a.read(bsize)
- sb = b.read(bsize)
- unless sa and sb
- if sa.nil? and sb.nil?
- return true
- end
- end
- end
+ sa = ""
+ sb = ""
+ begin
+ a.read(bsize, sa)
+ b.read(bsize, sb)
+ return true if sa.empty? && sb.empty?
+ end while sa == sb
false
end
- module_function :compare_stream
+
+ define_command(:compare_stream)
#
# Options: mode preserve noop verbose
@@ -860,9 +929,10 @@ module FileUtils
end
end
end
- module_function :install
- OPT_TABLE['install'] = [:mode, :preserve, :noop, :verbose]
+ define_command('install', :mode, :preserve, :noop, :verbose)
+
+private
def user_mask(target) #:nodoc:
mask = 0
@@ -880,7 +950,6 @@ module FileUtils
end
mask
end
- private_module_function :user_mask
def mode_mask(mode, path) #:nodoc:
mask = 0
@@ -902,7 +971,6 @@ module FileUtils
end
mask
end
- private_module_function :mode_mask
def symbolic_modes_to_i(modes, path) #:nodoc:
current_mode = (File.stat(path).mode & 07777)
@@ -923,12 +991,12 @@ module FileUtils
end
end
end
- private_module_function :symbolic_modes_to_i
def fu_mode(mode, path) #:nodoc:
mode.is_a?(String) ? symbolic_modes_to_i(mode, path) : mode
end
- private_module_function :fu_mode
+
+public
#
# Options: noop verbose
@@ -948,18 +1016,20 @@ module FileUtils
# FileUtils.chmod "u=wr,go=rr", %w(my.rb your.rb his.rb her.rb)
# FileUtils.chmod "u=wrx,go=rx", '/usr/bin/ruby', :verbose => true
#
- # "a" is user, group, other mask.
- # "u" is user's mask.
- # "g" is group's mask.
- # "o" is other's mask.
- # "w" is write permission.
- # "r" is read permission.
- # "x" is execute permission.
- # "s" is uid, gid.
- # "t" is sticky bit.
- # "+" is added to a class given the specified mode.
- # "-" Is removed from a given class given mode.
- # "=" Is the exact nature of the class will be given a specified mode.
+ # "a" :: is user, group, other mask.
+ # "u" :: is user's mask.
+ # "g" :: is group's mask.
+ # "o" :: is other's mask.
+ # "w" :: is write permission.
+ # "r" :: is read permission.
+ # "x" :: is execute permission.
+ # "X" ::
+ # is execute permission for directories only, must be used in conjunction with "+"
+ # "s" :: is uid, gid.
+ # "t" :: is sticky bit.
+ # "+" :: is added to a class given the specified mode.
+ # "-" :: Is removed from a given class given mode.
+ # "=" :: Is the exact nature of the class will be given a specified mode.
def chmod(mode, list, options = {})
fu_check_options options, OPT_TABLE['chmod']
@@ -970,9 +1040,8 @@ module FileUtils
Entry_.new(path).chmod(fu_mode(mode, path))
end
end
- module_function :chmod
- OPT_TABLE['chmod'] = [:noop, :verbose]
+ define_command('chmod', :noop, :verbose)
#
# Options: noop verbose force
@@ -1000,9 +1069,8 @@ module FileUtils
end
end
end
- module_function :chmod_R
- OPT_TABLE['chmod_R'] = [:noop, :verbose, :force]
+ define_command('chmod_R', :noop, :verbose, :force)
#
# Options: noop verbose
@@ -1029,9 +1097,8 @@ module FileUtils
Entry_.new(path).chown uid, gid
end
end
- module_function :chown
- OPT_TABLE['chown'] = [:noop, :verbose]
+ define_command('chown', :noop, :verbose)
#
# Options: noop verbose force
@@ -1066,9 +1133,10 @@ module FileUtils
end
end
end
- module_function :chown_R
- OPT_TABLE['chown_R'] = [:noop, :verbose, :force]
+ define_command('chown_R', :noop, :verbose, :force)
+
+private
begin
require 'etc'
@@ -1084,7 +1152,6 @@ module FileUtils
Etc.getpwnam(user).uid
end
end
- private_module_function :fu_get_uid
def fu_get_gid(group) #:nodoc:
return nil unless group
@@ -1097,7 +1164,6 @@ module FileUtils
Etc.getgrnam(group).gid
end
end
- private_module_function :fu_get_gid
rescue LoadError
# need Win32 support???
@@ -1105,14 +1171,14 @@ module FileUtils
def fu_get_uid(user) #:nodoc:
user # FIXME
end
- private_module_function :fu_get_uid
def fu_get_gid(group) #:nodoc:
group # FIXME
end
- private_module_function :fu_get_gid
end
+public
+
#
# Options: noop verbose
#
@@ -1145,11 +1211,10 @@ module FileUtils
end
end
end
- module_function :touch
- OPT_TABLE['touch'] = [:noop, :verbose, :mtime, :nocreate]
+ define_command('touch', :noop, :verbose, :mtime, :nocreate)
- private
+private
module StreamUtils_
private
@@ -1274,7 +1339,7 @@ module FileUtils
def entries
opts = {}
- opts[:encoding] = "UTF-8" if /mswin|mignw/ =~ RUBY_PLATFORM
+ opts[:encoding] = ::Encoding::UTF_8 if fu_windows?
Dir.entries(path(), opts)\
.reject {|n| n == '.' or n == '..' }\
.map {|n| Entry_.new(prefix(), join(rel(), n.untaint)) }
@@ -1376,14 +1441,37 @@ module FileUtils
def copy_metadata(path)
st = lstat()
- File.utime st.atime, st.mtime, path
+ if !st.symlink?
+ File.utime st.atime, st.mtime, path
+ end
begin
- File.chown st.uid, st.gid, path
+ if st.symlink?
+ begin
+ File.lchown st.uid, st.gid, path
+ rescue NotImplementedError
+ end
+ else
+ File.chown st.uid, st.gid, path
+ end
rescue Errno::EPERM
# clear setuid/setgid
- File.chmod st.mode & 01777, path
+ if st.symlink?
+ begin
+ File.lchmod st.mode & 01777, path
+ rescue NotImplementedError
+ end
+ else
+ File.chmod st.mode & 01777, path
+ end
else
- File.chmod st.mode, path
+ if st.symlink?
+ begin
+ File.lchmod st.mode, path
+ rescue NotImplementedError
+ end
+ else
+ File.chmod st.mode, path
+ end
end
end
@@ -1397,7 +1485,7 @@ module FileUtils
def remove_dir1
platform_support {
- Dir.rmdir path().sub(%r</\z>, '')
+ Dir.rmdir path().chomp(?/)
}
end
@@ -1448,7 +1536,7 @@ module FileUtils
yield self
end
- private
+ private
$fileutils_rb_have_lchmod = nil
@@ -1504,10 +1592,11 @@ module FileUtils
end
end # class Entry_
+private
+
def fu_list(arg) #:nodoc:
[arg].flatten.map {|path| File.path(path) }
end
- private_module_function :fu_list
def fu_each_src_dest(src, dest) #:nodoc:
fu_each_src_dest0(src, dest) do |s, d|
@@ -1515,7 +1604,6 @@ module FileUtils
yield s, d, File.stat(s)
end
end
- private_module_function :fu_each_src_dest
def fu_each_src_dest0(src, dest) #:nodoc:
if tmp = Array.try_convert(src)
@@ -1532,12 +1620,10 @@ module FileUtils
end
end
end
- private_module_function :fu_each_src_dest0
def fu_same?(a, b) #:nodoc:
File.identical?(a, b)
end
- private_module_function :fu_same?
def fu_check_options(options, optdecl) #:nodoc:
h = options.dup
@@ -1546,7 +1632,6 @@ module FileUtils
end
raise ArgumentError, "no such option: #{h.keys.join(' ')}" unless h.empty?
end
- private_module_function :fu_check_options
def fu_update_option(args, new) #:nodoc:
if tmp = Hash.try_convert(args.last)
@@ -1556,17 +1641,12 @@ module FileUtils
end
args
end
- private_module_function :fu_update_option
-
- @fileutils_output = $stderr
- @fileutils_label = ''
def fu_output_message(msg) #:nodoc:
@fileutils_output ||= $stderr
@fileutils_label ||= ''
@fileutils_output.puts @fileutils_label + msg
end
- private_module_function :fu_output_message
#
# Returns an Array of method names which have any options.
@@ -1616,91 +1696,27 @@ module FileUtils
OPT_TABLE.keys.select {|m| OPT_TABLE[m].include?(opt) }
end
- LOW_METHODS = singleton_methods(false) - collect_method(:noop).map(&:intern)
- module LowMethods
- module_eval("private\n" + ::FileUtils::LOW_METHODS.map {|name| "def #{name}(*)end"}.join("\n"),
- __FILE__, __LINE__)
- end
-
- METHODS = singleton_methods() - [:private_module_function,
- :commands, :options, :have_option?, :options_of, :collect_method]
-
+ # LOW_METHODS
#
- # This module has all methods of FileUtils module, but it outputs messages
- # before acting. This equates to passing the <tt>:verbose</tt> flag to
- # methods in FileUtils.
+ # :pwd, :getwd, :cd, :chdir,
+ # :uptodate?, :copy_entry, :copy_file, :copy_stream, :remove_entry_secure,
+ # :remove_entry, :remove_file, :remove_dir, :compare_file, :identical?,
+ # :cmp, :compare_stream
#
- module Verbose
- include FileUtils
- @fileutils_output = $stderr
- @fileutils_label = ''
- ::FileUtils.collect_method(:verbose).each do |name|
- module_eval(<<-EOS, __FILE__, __LINE__ + 1)
- def #{name}(*args)
- super(*fu_update_option(args, :verbose => true))
- end
- private :#{name}
- EOS
- end
- extend self
- class << self
- ::FileUtils::METHODS.each do |m|
- public m
- end
- end
- end
+ # DEPRECATED - Only here for backward compatibility.
+ LOW_METHODS = (commands - collect_method(:noop)).map(&:to_sym)
- #
- # This module has all methods of FileUtils module, but never changes
- # files/directories. This equates to passing the <tt>:noop</tt> flag
- # to methods in FileUtils.
- #
- module NoWrite
- include FileUtils
- include LowMethods
- @fileutils_output = $stderr
- @fileutils_label = ''
- ::FileUtils.collect_method(:noop).each do |name|
- module_eval(<<-EOS, __FILE__, __LINE__ + 1)
- def #{name}(*args)
- super(*fu_update_option(args, :noop => true))
- end
- private :#{name}
- EOS
- end
- extend self
- class << self
- ::FileUtils::METHODS.each do |m|
- public m
- end
- end
- end
+ # METHODS
#
- # This module has all methods of FileUtils module, but never changes
- # files/directories, with printing message before acting.
- # This equates to passing the <tt>:noop</tt> and <tt>:verbose</tt> flag
- # to methods in FileUtils.
+ # :pwd, :getwd, :cd, :chdir, :uptodate?, :mkdir, :mkdir_p, :mkpath, :makedirs,
+ # :rmdir, :ln, :link, :ln_s, :symlink, :ln_sf, :cp, :copy, :cp_r, :copy_entry,
+ # :copy_file, :copy_stream, :mv, :move, :rm, :remove, :rm_f, :safe_unlink,
+ # :rm_r, :rm_rf, :rmtree, :remove_entry_secure, :remove_entry, :remove_file,
+ # :remove_dir, :compare_file, :identical?, :cmp, :compare_stream, :install,
+ # :chmod, :chmod_R, :chown, :chown_R, :touch
#
- module DryRun
- include FileUtils
- include LowMethods
- @fileutils_output = $stderr
- @fileutils_label = ''
- ::FileUtils.collect_method(:noop).each do |name|
- module_eval(<<-EOS, __FILE__, __LINE__ + 1)
- def #{name}(*args)
- super(*fu_update_option(args, :noop => true, :verbose => true))
- end
- private :#{name}
- EOS
- end
- extend self
- class << self
- ::FileUtils::METHODS.each do |m|
- public m
- end
- end
- end
+ # DEPRECATED - Only here for backward compatibility.
+ METHODS = commands.map(&:to_sym)
end
diff --git a/lib/find.rb b/lib/find.rb
index cd2d1bf38b..571609cdef 100644
--- a/lib/find.rb
+++ b/lib/find.rb
@@ -30,6 +30,8 @@ module Find
# Calls the associated block with the name of every file and directory listed
# as arguments, then recursively on their subdirectories, and so on.
#
+ # Returns an enumerator if no block is given.
+ #
# See the +Find+ module documentation for an example.
#
def find(*paths) # :yield: path
diff --git a/lib/forwardable.rb b/lib/forwardable.rb
index 2b71b904d0..7a42e914bc 100644
--- a/lib/forwardable.rb
+++ b/lib/forwardable.rb
@@ -177,7 +177,7 @@ module Forwardable
# Define +method+ as delegator instance method with an optional
# alias name +ali+. Method calls to +ali+ will be delegated to
- # +accessor.method+.
+ # +accessor.method+.
#
# class MyQueue
# extend Forwardable
@@ -185,7 +185,7 @@ module Forwardable
# def initialize
# @queue = []
# end
- #
+ #
# def_delegator :@queue, :push, :mypush
# end
#
diff --git a/lib/ipaddr.rb b/lib/ipaddr.rb
index b6e7dad918..933ba7f90b 100644
--- a/lib/ipaddr.rb
+++ b/lib/ipaddr.rb
@@ -2,7 +2,7 @@
# ipaddr.rb - A class to manipulate an IP address
#
# Copyright (c) 2002 Hajimu UMEMOTO <ume@mahoroba.org>.
-# Copyright (c) 2007 Akinori MUSHA <knu@iDaemons.org>.
+# Copyright (c) 2007, 2009, 2012 Akinori MUSHA <knu@iDaemons.org>.
# All rights reserved.
#
# You can redistribute and/or modify it under the same terms as Ruby.
@@ -17,61 +17,6 @@
#
require 'socket'
-unless Socket.const_defined? "AF_INET6"
- class Socket < BasicSocket
- # IPv6 protocol family
- AF_INET6 = Object.new
- end
-
- class << IPSocket
- # Returns +true+ if +addr+ is a valid IPv4 address.
- def valid_v4?(addr)
- if /\A(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\Z/ =~ addr
- return $~.captures.all? {|i| i.to_i < 256}
- end
- return false
- end
-
- # Returns +true+ if +addr+ is a valid IPv6 address.
- def valid_v6?(addr)
- # IPv6 (normal)
- return true if /\A[\dA-Fa-f]{1,4}(:[\dA-Fa-f]{1,4})*\Z/ =~ addr
- return true if /\A[\dA-Fa-f]{1,4}(:[\dA-Fa-f]{1,4})*::([\dA-Fa-f]{1,4}(:[\dA-Fa-f]{1,4})*)?\Z/ =~ addr
- return true if /\A::([\dA-Fa-f]{1,4}(:[\dA-Fa-f]{1,4})*)?\Z/ =~ addr
- # IPv6 (IPv4 compat)
- return true if /\A[\dA-Fa-f]{1,4}(:[\dA-Fa-f]{1,4})*:/ =~ addr && valid_v4?($')
- return true if /\A[\dA-Fa-f]{1,4}(:[\dA-Fa-f]{1,4})*::([\dA-Fa-f]{1,4}(:[\dA-Fa-f]{1,4})*:)?/ =~ addr && valid_v4?($')
- return true if /\A::([\dA-Fa-f]{1,4}(:[\dA-Fa-f]{1,4})*:)?/ =~ addr && valid_v4?($')
-
- false
- end
-
- # Returns +true+ if +addr+ is either a valid IPv4 or IPv6 address.
- def valid?(addr)
- valid_v4?(addr) || valid_v6?(addr)
- end
-
- alias getaddress_orig getaddress
-
- # Returns a +String+ based representation of a valid DNS hostname,
- # IPv4 or IPv6 address.
- #
- # IPSocket.getaddress 'localhost' #=> "::1"
- # IPSocket.getaddress 'broadcasthost' #=> "255.255.255.255"
- # IPSocket.getaddress 'www.ruby-lang.org' #=> "221.186.184.68"
- # IPSocket.getaddress 'www.ccc.de' #=> "2a00:1328:e102:ccc0::122"
- def getaddress(s)
- if valid?(s)
- s
- elsif /\A[-A-Za-z\d.]+\Z/ =~ s
- getaddress_orig(s)
- else
- raise ArgumentError, "invalid address"
- end
- end
- end
-end
-
# IPAddr provides a set of methods to manipulate an IP address. Both IPv4 and
# IPv6 are supported.
#
@@ -99,9 +44,59 @@ class IPAddr
IN4MASK = 0xffffffff
# 128 bit mask for IPv4
IN6MASK = 0xffffffffffffffffffffffffffffffff
- # Formatstring for IPv6
+ # Format string for IPv6
IN6FORMAT = (["%.4x"] * 8).join(':')
+ # Regexp _internally_ used for parsing IPv4 address.
+ RE_IPV4ADDRLIKE = %r{
+ \A
+ (\d+) \. (\d+) \. (\d+) \. (\d+)
+ \z
+ }x
+
+ # Regexp _internally_ used for parsing IPv6 address.
+ RE_IPV6ADDRLIKE_FULL = %r{
+ \A
+ (?:
+ (?: [\da-f]{1,4} : ){7} [\da-f]{1,4}
+ |
+ ( (?: [\da-f]{1,4} : ){6} )
+ (\d+) \. (\d+) \. (\d+) \. (\d+)
+ )
+ \z
+ }xi
+
+ # Regexp _internally_ used for parsing IPv6 address.
+ RE_IPV6ADDRLIKE_COMPRESSED = %r{
+ \A
+ ( (?: (?: [\da-f]{1,4} : )* [\da-f]{1,4} )? )
+ ::
+ ( (?:
+ ( (?: [\da-f]{1,4} : )* )
+ (?:
+ [\da-f]{1,4}
+ |
+ (\d+) \. (\d+) \. (\d+) \. (\d+)
+ )
+ )? )
+ \z
+ }xi
+
+ # Generic IPAddr related error. Exceptions raised in this class should
+ # inherit from Error.
+ class Error < ArgumentError; end
+
+ # Raised when the provided IP address is an invalid address.
+ class InvalidAddressError < Error; end
+
+ # Raised when the address family is invalid such as an address with an
+ # unsupported family, an address with an inconsistent family, or an address
+ # who's family cannot be determined.
+ class AddressFamilyError < Error; end
+
+ # Raised when the address is an invalid length.
+ class InvalidPrefixError < InvalidAddressError; end
+
# Returns the address family of this IP address.
attr_reader :family
@@ -120,7 +115,7 @@ class IPAddr
when 16
s = IN6FORMAT % addr.unpack('n8')
else
- raise ArgumentError, "unsupported address family"
+ raise AddressFamilyError, "unsupported address family"
end
return s
end
@@ -212,7 +207,7 @@ class IPAddr
str.gsub!(/\b0{1,3}([\da-f]+)\b/i, '\1')
loop do
- break if str.sub!(/\A0:0:0:0:0:0:0:0\Z/, '::')
+ break if str.sub!(/\A0:0:0:0:0:0:0:0\z/, '::')
break if str.sub!(/\b0:0:0:0:0:0:0\b/, ':')
break if str.sub!(/\b0:0:0:0:0:0\b/, ':')
break if str.sub!(/\b0:0:0:0:0\b/, ':')
@@ -223,7 +218,7 @@ class IPAddr
end
str.sub!(/:{3,}/, '::')
- if /\A::(ffff:)?([\da-f]{1,4}):([\da-f]{1,4})\Z/i =~ str
+ if /\A::(ffff:)?([\da-f]{1,4}):([\da-f]{1,4})\z/i =~ str
str = sprintf('::%s%d.%d.%d.%d', $1, $2.hex / 256, $2.hex % 256, $3.hex / 256, $3.hex % 256)
end
@@ -246,7 +241,7 @@ class IPAddr
(@addr >> (112 - 16 * i)) & 0xffff
}.pack('n8')
else
- raise "unsupported address family"
+ raise AddressFamilyError, "unsupported address family"
end
end
@@ -278,7 +273,7 @@ class IPAddr
# into an IPv4-mapped IPv6 address.
def ipv4_mapped
if !ipv4?
- raise ArgumentError, "not an IPv4 address"
+ raise InvalidAddressError, "not an IPv4 address"
end
return self.clone.set(@addr | 0xffff00000000, Socket::AF_INET6)
end
@@ -287,7 +282,7 @@ class IPAddr
# into an IPv4-compatible IPv6 address.
def ipv4_compat
if !ipv4?
- raise ArgumentError, "not an IPv4 address"
+ raise InvalidAddressError, "not an IPv4 address"
end
return self.clone.set(@addr, Socket::AF_INET6)
end
@@ -311,14 +306,14 @@ class IPAddr
when Socket::AF_INET6
return ip6_arpa
else
- raise "unsupported address family"
+ raise AddressFamilyError, "unsupported address family"
end
end
# Returns a string for DNS reverse lookup compatible with RFC3172.
def ip6_arpa
if !ipv6?
- raise ArgumentError, "not an IPv6 address"
+ raise InvalidAddressError, "not an IPv6 address"
end
return _reverse + ".ip6.arpa"
end
@@ -326,7 +321,7 @@ class IPAddr
# Returns a string for DNS reverse lookup compatible with RFC1886.
def ip6_int
if !ipv6?
- raise ArgumentError, "not an IPv6 address"
+ raise InvalidAddressError, "not an IPv6 address"
end
return _reverse + ".ip6.int"
end
@@ -366,7 +361,7 @@ class IPAddr
when Socket::AF_INET6
end_addr = (@addr | (IN6MASK ^ @mask_addr))
else
- raise "unsupported address family"
+ raise AddressFamilyError, "unsupported address family"
end
return clone.set(begin_addr, @family)..clone.set(end_addr, @family)
@@ -381,7 +376,7 @@ class IPAddr
when Socket::AF_INET6
af = "IPv6"
else
- raise "unsupported address family"
+ raise AddressFamilyError, "unsupported address family"
end
return sprintf("#<%s: %s:%s/%s>", self.class.name,
af, _to_string(@addr), _to_string(@mask_addr))
@@ -396,14 +391,14 @@ class IPAddr
case family[0] ? family[0] : @family
when Socket::AF_INET
if addr < 0 || addr > IN4MASK
- raise ArgumentError, "invalid address"
+ raise InvalidAddressError, "invalid address"
end
when Socket::AF_INET6
if addr < 0 || addr > IN6MASK
- raise ArgumentError, "invalid address"
+ raise InvalidAddressError, "invalid address"
end
else
- raise ArgumentError, "unsupported address family"
+ raise AddressFamilyError, "unsupported address family"
end
@addr = addr
if family[0]
@@ -412,7 +407,7 @@ class IPAddr
return self
end
- # Set current netmask to given mask.
+ # Set current netmask to given mask.
def mask!(mask)
if mask.kind_of?(String)
if mask =~ /^\d+$/
@@ -420,7 +415,7 @@ class IPAddr
else
m = IPAddr.new(mask)
if m.family != @family
- raise ArgumentError, "address family is not same"
+ raise InvalidPrefixError, "address family is not same"
end
@mask_addr = m.to_i
@addr &= @mask_addr
@@ -432,18 +427,18 @@ class IPAddr
case @family
when Socket::AF_INET
if prefixlen < 0 || prefixlen > 32
- raise ArgumentError, "invalid length"
+ raise InvalidPrefixError, "invalid length"
end
masklen = 32 - prefixlen
@mask_addr = ((IN4MASK >> masklen) << masklen)
when Socket::AF_INET6
if prefixlen < 0 || prefixlen > 128
- raise ArgumentError, "invalid length"
+ raise InvalidPrefixError, "invalid length"
end
masklen = 128 - prefixlen
@mask_addr = ((IN6MASK >> masklen) << masklen)
else
- raise "unsupported address family"
+ raise AddressFamilyError, "unsupported address family"
end
@addr = ((@addr >> masklen) << masklen)
return self
@@ -477,9 +472,9 @@ class IPAddr
@mask_addr = (family == Socket::AF_INET) ? IN4MASK : IN6MASK
return
when Socket::AF_UNSPEC
- raise ArgumentError, "address family must be specified"
+ raise AddressFamilyError, "address family must be specified"
else
- raise ArgumentError, "unsupported address family: #{family}"
+ raise AddressFamilyError, "unsupported address family: #{family}"
end
end
prefix, prefixlen = addr.split('/')
@@ -490,11 +485,6 @@ class IPAddr
# It seems AI_NUMERICHOST doesn't do the job.
#Socket.getaddrinfo(left, nil, Socket::AF_INET6, Socket::SOCK_STREAM, nil,
# Socket::AI_NUMERICHOST)
- begin
- IPSocket.getaddress(prefix) # test if address is valid
- rescue
- raise ArgumentError, "invalid address"
- end
@addr = @family = nil
if family == Socket::AF_UNSPEC || family == Socket::AF_INET
@addr = in_addr(prefix)
@@ -507,7 +497,7 @@ class IPAddr
@family = Socket::AF_INET6
end
if family != Socket::AF_UNSPEC && @family != family
- raise ArgumentError, "address family mismatch"
+ raise AddressFamilyError, "address family mismatch"
end
if prefixlen
mask!(prefixlen)
@@ -528,26 +518,44 @@ class IPAddr
end
def in_addr(addr)
- if addr =~ /^\d+\.\d+\.\d+\.\d+$/
- return addr.split('.').inject(0) { |i, s|
- i << 8 | s.to_i
- }
+ case addr
+ when Array
+ octets = addr
+ else
+ m = RE_IPV4ADDRLIKE.match(addr) or return nil
+ octets = m.captures
end
- return nil
+ octets.inject(0) { |i, s|
+ (n = s.to_i) < 256 or raise InvalidAddressError, "invalid address"
+ s.match(/\A0./) and raise InvalidAddressError, "zero-filled number in IPv4 address is ambiguous"
+ i << 8 | n
+ }
end
def in6_addr(left)
case left
- when /^::ffff:(\d+\.\d+\.\d+\.\d+)$/i
- return in_addr($1) + 0xffff00000000
- when /^::(\d+\.\d+\.\d+\.\d+)$/i
- return in_addr($1)
- when /[^0-9a-f:]/i
- raise ArgumentError, "invalid address"
- when /^(.*)::(.*)$/
- left, right = $1, $2
- else
+ when RE_IPV6ADDRLIKE_FULL
+ if $2
+ addr = in_addr($~[2,4])
+ left = $1 + ':'
+ else
+ addr = 0
+ end
right = ''
+ when RE_IPV6ADDRLIKE_COMPRESSED
+ if $4
+ left.count(':') <= 6 or raise InvalidAddressError, "invalid address"
+ addr = in_addr($~[4,4])
+ left = $1
+ right = $3 + '0:0'
+ else
+ left.count(':') <= 7 or raise InvalidAddressError, "invalid address"
+ left = $1
+ right = $2
+ addr = 0
+ end
+ else
+ raise InvalidAddressError, "invalid address"
end
l = left.split(':')
r = right.split(':')
@@ -555,9 +563,9 @@ class IPAddr
if rest < 0
return nil
end
- return (l + Array.new(rest, '0') + r).inject(0) { |i, s|
+ (l + Array.new(rest, '0') + r).inject(0) { |i, s|
i << 16 | s.hex
- }
+ } | addr
end
def addr_mask(addr)
@@ -567,7 +575,7 @@ class IPAddr
when Socket::AF_INET6
return addr & IN6MASK
else
- raise "unsupported address family"
+ raise AddressFamilyError, "unsupported address family"
end
end
@@ -580,7 +588,7 @@ class IPAddr
when Socket::AF_INET6
return ("%.32x" % @addr).reverse!.gsub!(/.(?!$)/, '\&.')
else
- raise "unsupported address family"
+ raise AddressFamilyError, "unsupported address family"
end
end
@@ -593,12 +601,61 @@ class IPAddr
when Socket::AF_INET6
return (("%.32x" % addr).gsub!(/.{4}(?!$)/, '\&:'))
else
- raise "unsupported address family"
+ raise AddressFamilyError, "unsupported address family"
end
end
end
+unless Socket.const_defined? :AF_INET6
+ class Socket < BasicSocket
+ # IPv6 protocol family
+ AF_INET6 = Object.new
+ end
+
+ class << IPSocket
+ private
+
+ def valid_v6?(addr)
+ case addr
+ when IPAddr::RE_IPV6ADDRLIKE_FULL
+ if $2
+ $~[2,4].all? {|i| i.to_i < 256 }
+ else
+ true
+ end
+ when IPAddr::RE_IPV6ADDRLIKE_COMPRESSED
+ if $4
+ addr.count(':') <= 6 && $~[4,4].all? {|i| i.to_i < 256}
+ else
+ addr.count(':') <= 7
+ end
+ else
+ false
+ end
+ end
+
+ alias getaddress_orig getaddress
+
+ public
+
+ # Returns a +String+ based representation of a valid DNS hostname,
+ # IPv4 or IPv6 address.
+ #
+ # IPSocket.getaddress 'localhost' #=> "::1"
+ # IPSocket.getaddress 'broadcasthost' #=> "255.255.255.255"
+ # IPSocket.getaddress 'www.ruby-lang.org' #=> "221.186.184.68"
+ # IPSocket.getaddress 'www.ccc.de' #=> "2a00:1328:e102:ccc0::122"
+ def getaddress(s)
+ if valid_v6?(s)
+ s
+ else
+ getaddress_orig(s)
+ end
+ end
+ end
+end
+
if $0 == __FILE__
eval DATA.read, nil, $0, __LINE__+4
end
@@ -609,10 +666,15 @@ require 'test/unit'
class TC_IPAddr < Test::Unit::TestCase
def test_s_new
- assert_nothing_raised {
- IPAddr.new("3FFE:505:ffff::/48")
- IPAddr.new("0:0:0:1::")
- IPAddr.new("2001:200:300::/48")
+ [
+ ["3FFE:505:ffff::/48"],
+ ["0:0:0:1::"],
+ ["2001:200:300::/48"],
+ ["2001:200:300::192.168.1.2/48"],
+ ].each { |args|
+ assert_nothing_raised {
+ IPAddr.new(*args)
+ }
}
a = IPAddr.new
@@ -666,18 +728,15 @@ class TC_IPAddr < Test::Unit::TestCase
assert_equal("2001:200:300::", IPAddr.new("[2001:200:300::]/48").to_s)
- [
- ["fe80::1%fxp0"],
- ["::1/255.255.255.0"],
- ["::1:192.168.1.2/120"],
- [IPAddr.new("::1").to_i],
- ["::ffff:192.168.1.2/120", Socket::AF_INET],
- ["[192.168.1.2]/120"],
- ].each { |args|
- assert_raises(ArgumentError) {
- IPAddr.new(*args)
- }
- }
+ assert_raises(IPAddr::InvalidAddressError) { IPAddr.new("192.168.0.256") }
+ assert_raises(IPAddr::InvalidAddressError) { IPAddr.new("192.168.0.011") }
+ assert_raises(IPAddr::InvalidAddressError) { IPAddr.new("fe80::1%fxp0") }
+ assert_raises(IPAddr::InvalidAddressError) { IPAddr.new("[192.168.1.2]/120") }
+ assert_raises(IPAddr::InvalidPrefixError) { IPAddr.new("::1/255.255.255.0") }
+ assert_raises(IPAddr::InvalidPrefixError) { IPAddr.new("::1/129") }
+ assert_raises(IPAddr::InvalidPrefixError) { IPAddr.new("192.168.0.1/33") }
+ assert_raises(IPAddr::AddressFamilyError) { IPAddr.new(1) }
+ assert_raises(IPAddr::AddressFamilyError) { IPAddr.new("::ffff:192.168.1.2/120", Socket::AF_INET) }
end
def test_s_new_ntoh
@@ -738,14 +797,14 @@ class TC_IPAddr < Test::Unit::TestCase
def test_ip6_arpa
assert_equal("f.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.0.5.0.5.0.e.f.f.3.ip6.arpa", IPAddr.new("3ffe:505:2::f").ip6_arpa)
- assert_raises(ArgumentError) {
+ assert_raises(IPAddr::InvalidAddressError) {
IPAddr.new("192.168.2.1").ip6_arpa
}
end
def test_ip6_int
assert_equal("f.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.0.5.0.5.0.e.f.f.3.ip6.int", IPAddr.new("3ffe:505:2::f").ip6_int)
- assert_raises(ArgumentError) {
+ assert_raises(IPAddr::InvalidAddressError) {
IPAddr.new("192.168.2.1").ip6_int
}
end
@@ -811,7 +870,9 @@ class TC_Operator < Test::Unit::TestCase
end
def test_equal
- assert_equal(true, @a == IPAddr.new("3ffe:505:2::"))
+ assert_equal(true, @a == IPAddr.new("3FFE:505:2::"))
+ assert_equal(true, @a == IPAddr.new("3ffe:0505:0002::"))
+ assert_equal(true, @a == IPAddr.new("3ffe:0505:0002:0:0:0:0:0"))
assert_equal(false, @a == IPAddr.new("3ffe:505:3::"))
assert_equal(true, @a != IPAddr.new("3ffe:505:3::"))
assert_equal(false, @a != IPAddr.new("3ffe:505:2::"))
diff --git a/lib/irb/cmd/fork.rb b/lib/irb/cmd/fork.rb
index c2664626ae..a3531d4299 100644
--- a/lib/irb/cmd/fork.rb
+++ b/lib/irb/cmd/fork.rb
@@ -15,7 +15,7 @@
module IRB
module ExtendCommand
class Fork<Nop
- def execute(&block)
+ def execute
pid = send ExtendCommand.irb_original_method_name("fork")
unless pid
class << self
diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb
index 54e6526957..7fd69a0a09 100644
--- a/lib/irb/completion.rb
+++ b/lib/irb/completion.rb
@@ -178,8 +178,12 @@ module IRB
rescue Exception
name = ""
end
- next if name != "IRB::Context" and
- /^(IRB|SLex|RubyLex|RubyToken)/ =~ name
+ begin
+ next if name != "IRB::Context" and
+ /^(IRB|SLex|RubyLex|RubyToken)/ =~ name
+ rescue Exception
+ next
+ end
candidates.concat m.instance_methods(false).collect{|x| x.to_s}
}
candidates.sort!
diff --git a/lib/irb/output-method.rb b/lib/irb/output-method.rb
index 9cccda1c6a..7c0df935a9 100644
--- a/lib/irb/output-method.rb
+++ b/lib/irb/output-method.rb
@@ -19,7 +19,7 @@ module IRB
@RCS_ID='-$Id$-'
def print(*opts)
- IRB.fail NotImplementError, "print"
+ IRB.fail NotImplementedError, "print"
end
def printn(*opts)
diff --git a/lib/irb/workspace.rb b/lib/irb/workspace.rb
index edc0d3b147..a8d4a90ad8 100644
--- a/lib/irb/workspace.rb
+++ b/lib/irb/workspace.rb
@@ -38,7 +38,7 @@ EOF
unless defined? BINDING_QUEUE
require "thread"
- IRB.const_set("BINDING_QUEUE", SizedQueue.new(1))
+ IRB.const_set(:BINDING_QUEUE, SizedQueue.new(1))
Thread.abort_on_exception = true
Thread.start do
eval "require \"irb/ws-for-case-2\"", TOPLEVEL_BINDING, __FILE__, __LINE__
diff --git a/lib/logger.rb b/lib/logger.rb
index 6092959399..3376cf8216 100644
--- a/lib/logger.rb
+++ b/lib/logger.rb
@@ -18,18 +18,19 @@ require 'monitor'
#
# The messages have associated levels, such as +INFO+ or +ERROR+ that indicate
# their importance. You can then give the Logger a level, and only messages
-# at that level of higher will be printed.
+# at that level or higher will be printed.
#
# The levels are:
#
-# +FATAL+:: an unhandleable error that results in a program crash
-# +ERROR+:: a handleable error condition
-# +WARN+:: a warning
-# +INFO+:: generic (useful) information about system operation
-# +DEBUG+:: low-level information for developers
+# +UNKNOWN+:: An unknown message that should always be logged.
+# +FATAL+:: An unhandleable error that results in a program crash.
+# +ERROR+:: A handleable error condition.
+# +WARN+:: A warning.
+# +INFO+:: Generic (useful) information about system operation.
+# +DEBUG+:: Low-level information for developers.
#
# For instance, in a production system, you may have your Logger set to
-# +INFO+ or even +WARN+
+# +INFO+ or even +WARN+.
# When you are developing the system, however, you probably
# want to know about the program's internal state, and would set the Logger to
# +DEBUG+.
@@ -51,24 +52,29 @@ require 'monitor'
#
# === Example
#
-# This creates a logger to the standard output stream, with a level of +WARN+
+# This creates a Logger that outputs to the standard output stream, with a
+# level of +WARN+:
#
-# log = Logger.new(STDOUT)
-# log.level = Logger::WARN
+# require 'logger'
#
-# log.debug("Created logger")
-# log.info("Program started")
-# log.warn("Nothing to do!")
+# logger = Logger.new(STDOUT)
+# logger.level = Logger::WARN
+#
+# logger.debug("Created logger")
+# logger.info("Program started")
+# logger.warn("Nothing to do!")
+#
+# path = "a_non_existent_file"
#
# begin
-# File.each_line(path) do |line|
+# File.foreach(path) do |line|
# unless line =~ /^(\w+) = (.*)$/
-# log.error("Line in wrong format: #{line}")
+# logger.error("Line in wrong format: #{line.chomp}")
# end
# end
# rescue => err
-# log.fatal("Caught exception; exiting")
-# log.fatal(err)
+# logger.fatal("Caught exception; exiting")
+# logger.fatal(err)
# end
#
# Because the Logger's level is set to +WARN+, only the warning, error, and
@@ -102,16 +108,16 @@ require 'monitor'
# 3. Create a logger for the specified file.
#
# file = File.open('foo.log', File::WRONLY | File::APPEND)
-# # To create new (and to remove old) logfile, add File::CREAT like;
-# # file = open('foo.log', File::WRONLY | File::APPEND | File::CREAT)
+# # To create new (and to remove old) logfile, add File::CREAT like:
+# # file = File.open('foo.log', File::WRONLY | File::APPEND | File::CREAT)
# logger = Logger.new(file)
#
-# 4. Create a logger which ages logfile once it reaches a certain size. Leave
-# 10 "old log files" and each file is about 1,024,000 bytes.
+# 4. Create a logger which ages the logfile once it reaches a certain size.
+# Leave 10 "old" log files where each file is about 1,024,000 bytes.
#
# logger = Logger.new('foo.log', 10, 1024000)
#
-# 5. Create a logger which ages logfile daily/weekly/monthly.
+# 5. Create a logger which ages the logfile daily/weekly/monthly.
#
# logger = Logger.new('foo.log', 'daily')
# logger = Logger.new('foo.log', 'weekly')
@@ -124,13 +130,13 @@ require 'monitor'
# +debug+. +add+ is used below to log a message of an arbitrary (perhaps
# dynamic) level.
#
-# 1. Message in block.
+# 1. Message in a block.
#
# logger.fatal { "Argument 'foo' not given." }
#
# 2. Message as a string.
#
-# logger.error "Argument #{ @foo } mismatch."
+# logger.error "Argument #{@foo} mismatch."
#
# 3. With progname.
#
@@ -168,8 +174,7 @@ require 'monitor'
#
# logger.level = Logger::INFO
#
-# DEBUG < INFO < WARN < ERROR < FATAL < UNKNOWN
-#
+# # DEBUG < INFO < WARN < ERROR < FATAL < UNKNOWN
#
# == Format
#
@@ -177,22 +182,22 @@ require 'monitor'
# default. The default format and a sample are shown below:
#
# Log format:
-# SeverityID, [Date Time mSec #pid] SeverityLabel -- ProgName: message
+# SeverityID, [DateTime #pid] SeverityLabel -- ProgName: message
#
# Log sample:
-# I, [Wed Mar 03 02:34:24 JST 1999 895701 #19074] INFO -- Main: info.
+# I, [1999-03-03T02:34:24.895701 #19074] INFO -- Main: info.
#
-# You may change the date and time format via #datetime_format=
+# You may change the date and time format via #datetime_format=.
#
-# logger.datetime_format = "%Y-%m-%d %H:%M:%S"
+# logger.datetime_format = '%Y-%m-%d %H:%M:%S'
# # e.g. "2004-01-03 00:54:26"
#
-# Or, you may change the overall format with #formatter= method.
+# Or, you may change the overall format via the #formatter= method.
#
# logger.formatter = proc do |severity, datetime, progname, msg|
# "#{datetime}: #{msg}\n"
# end
-# # e.g. "Thu Sep 22 08:51:08 GMT+9:00 2005: hello world"
+# # e.g. "2005-09-22 08:51:08 +0900: hello world"
#
class Logger
VERSION = "1.2.7"
@@ -213,17 +218,17 @@ class Logger
# Logging severity.
module Severity
- # Low-level information, mostly for developers
+ # Low-level information, mostly for developers.
DEBUG = 0
- # generic, useful information about system operation
+ # Generic (useful) information about system operation.
INFO = 1
- # a warning
+ # A warning.
WARN = 2
- # a handleable error condition
+ # A handleable error condition.
ERROR = 3
- # an unhandleable error that results in a program crash
+ # An unhandleable error that results in a program crash.
FATAL = 4
- # an unknown message that should always be logged
+ # An unknown message that should always be logged.
UNKNOWN = 5
end
include Severity
@@ -231,7 +236,7 @@ class Logger
# Logging severity threshold (e.g. <tt>Logger::INFO</tt>).
attr_accessor :level
- # program name to include in log messages.
+ # Program name to include in log messages.
attr_accessor :progname
# Set date-time format.
@@ -249,9 +254,9 @@ class Logger
# Logging formatter, as a +Proc+ that will take four arguments and
# return the formatted message. The arguments are:
#
- # +severity+:: The Severity of the log message
- # +time+:: A Time instance representing when the message was logged
- # +progname+:: The #progname configured, or passed to the logger method
+ # +severity+:: The Severity of the log message.
+ # +time+:: A Time instance representing when the message was logged.
+ # +progname+:: The #progname configured, or passed to the logger method.
# +msg+:: The _Object_ the user passed to the log message; not necessarily a
# String.
#
@@ -338,8 +343,8 @@ class Logger
#
# +true+ if successful, +false+ otherwise.
#
- # When the given severity is not high enough (for this particular logger), log
- # no message, and return +true+.
+ # When the given severity is not high enough (for this particular logger),
+ # log no message, and return +true+.
#
# === Description
#
@@ -358,7 +363,7 @@ class Logger
#
# * Logfile is not locked.
# * Append open does not need to lock file.
- # * If the OS which supports multi I/O, records possibly be mixed.
+ # * If the OS supports multi I/O, records possibly may be mixed.
#
def add(severity, message = nil, progname = nil, &block)
severity ||= UNKNOWN
@@ -402,18 +407,17 @@ class Logger
#
# :call-seq:
# info(message)
- # info(progname,&block)
+ # info(progname, &block)
#
# Log an +INFO+ message.
#
- # +message+:: the message to log; does not need to be a String
- # +progname+:: in the block form, this is the #progname to use in the
- # the log message. The default can be set with #progname=
- # <tt>&block</tt>:: evaluates to the message to log. This is not evaluated
- # unless the logger's level is sufficient
- # to log the message. This allows you to create
- # potentially expensive logging messages that are
- # only called when the logger is configured to show them.
+ # +message+:: The message to log; does not need to be a String.
+ # +progname+:: In the block form, this is the #progname to use in the
+ # log message. The default can be set with #progname=.
+ # +block+:: Evaluates to the message to log. This is not evaluated unless
+ # the logger's level is sufficient to log the message. This
+ # allows you to create potentially expensive logging messages that
+ # are only called when the logger is configured to show them.
#
# === Examples
#
@@ -463,7 +467,7 @@ class Logger
#
# Log an +UNKNOWN+ message. This will be printed no matter what the logger's
- # level.
+ # level is.
#
# See #info for more information.
#
@@ -480,7 +484,7 @@ class Logger
private
- # Severity label for logging. (max 5 char)
+ # Severity label for logging (max 5 chars).
SEV_LABEL = %w(DEBUG INFO WARN ERROR FATAL ANY)
def format_severity(severity)
@@ -492,7 +496,7 @@ private
end
- # Default formatter for log messages
+ # Default formatter for log messages.
class Formatter
Format = "%s, [%s#%d] %5s -- %s: %s\n"
@@ -678,13 +682,13 @@ private
#
# == Description
#
- # Application -- Add logging support to your application.
+ # Application --- Add logging support to your application.
#
# == Usage
#
# 1. Define your application class as a sub-class of this class.
- # 2. Override 'run' method in your class to do many things.
- # 3. Instantiate it and invoke 'start'.
+ # 2. Override the +run+ method in your class to do many things.
+ # 3. Instantiate it and invoke #start.
#
# == Example
#
diff --git a/lib/mathn.rb b/lib/mathn.rb
index b1a959d8f8..aae4620c3f 100644
--- a/lib/mathn.rb
+++ b/lib/mathn.rb
@@ -28,7 +28,7 @@
# 20 / 9 * 3 * 14 / 7 * 3 / 2 # => 20
#
#
-# When you require 'mathn' the libraries for Prime, CMath, Matrix and Vector
+# When you require 'mathn', the libraries for Prime, CMath, Matrix and Vector
# are also loaded.
#
# == Copyright
@@ -53,8 +53,8 @@ unless defined?(Math.exp!)
end
##
-# When mathn is required Fixnum's division and exponentiation are enhanced to
-# return more precise values in mathematical formulas.
+# When mathn is required, Fixnum's division and exponentiation are enhanced to
+# return more precise values from mathematical expressions.
#
# 2/3*3 # => 0
# require 'mathn'
@@ -87,7 +87,7 @@ end
##
# When mathn is required Bignum's division and exponentiation are enhanced to
-# return more precise values in mathematical formulas.
+# return more precise values from mathematical expressions.
class Bignum
remove_method :/
@@ -115,7 +115,7 @@ class Bignum
end
##
-# When mathn is required Rational changes to simplfy the usage of Rational
+# When mathn is required Rational is changed to simplify the use of Rational
# operations.
#
# Normal behaviour:
@@ -198,14 +198,14 @@ class Rational
end
##
-# When mathn is requried the Math module changes as follows:
+# When mathn is required, the Math module changes as follows:
#
# Standard Math module behaviour:
# Math.sqrt(4/9) # => 0.0
# Math.sqrt(4.0/9.0) # => 0.666666666666667
# Math.sqrt(- 4/9) # => Errno::EDOM: Numerical argument out of domain - sqrt
#
-# After require 'mathn' this is changed to:
+# After require 'mathn', this is changed to:
#
# require 'mathn'
# Math.sqrt(4/9) # => 2/3
@@ -305,7 +305,7 @@ module Math
end
##
-# When mathn is required Float is changed to handle Complex numbers.
+# When mathn is required, Float is changed to handle Complex numbers.
class Float
alias power! **
diff --git a/lib/matrix.rb b/lib/matrix.rb
index 3c078c0c06..3ffd0ddc78 100644
--- a/lib/matrix.rb
+++ b/lib/matrix.rb
@@ -32,93 +32,93 @@ end
# == Method Catalogue
#
# To create a matrix:
-# * <tt> Matrix[*rows] </tt>
-# * <tt> Matrix.[](*rows) </tt>
-# * <tt> Matrix.rows(rows, copy = true) </tt>
-# * <tt> Matrix.columns(columns) </tt>
-# * <tt> Matrix.build(row_size, column_size, &block) </tt>
-# * <tt> Matrix.diagonal(*values) </tt>
-# * <tt> Matrix.scalar(n, value) </tt>
-# * <tt> Matrix.identity(n) </tt>
-# * <tt> Matrix.unit(n) </tt>
-# * <tt> Matrix.I(n) </tt>
-# * <tt> Matrix.zero(n) </tt>
-# * <tt> Matrix.row_vector(row) </tt>
-# * <tt> Matrix.column_vector(column) </tt>
+# * Matrix[*rows]
+# * Matrix.[](*rows)
+# * Matrix.rows(rows, copy = true)
+# * Matrix.columns(columns)
+# * Matrix.build(row_size, column_size, &block)
+# * Matrix.diagonal(*values)
+# * Matrix.scalar(n, value)
+# * Matrix.identity(n)
+# * Matrix.unit(n)
+# * Matrix.I(n)
+# * Matrix.zero(n)
+# * Matrix.row_vector(row)
+# * Matrix.column_vector(column)
#
# To access Matrix elements/columns/rows/submatrices/properties:
-# * <tt> [](i, j) </tt>
-# * <tt> #row_size </tt>
-# * <tt> #column_size </tt>
-# * <tt> #row(i) </tt>
-# * <tt> #column(j) </tt>
-# * <tt> #collect </tt>
-# * <tt> #map </tt>
-# * <tt> #each </tt>
-# * <tt> #each_with_index </tt>
-# * <tt> #find_index </tt>
-# * <tt> #minor(*param) </tt>
+# * #[](i, j)
+# * #row_size
+# * #column_size
+# * #row(i)
+# * #column(j)
+# * #collect
+# * #map
+# * #each
+# * #each_with_index
+# * #find_index
+# * #minor(*param)
#
# Properties of a matrix:
-# * <tt> #diagonal? </tt>
-# * <tt> #empty? </tt>
-# * <tt> #hermitian? </tt>
-# * <tt> #lower_triangular? </tt>
-# * <tt> #normal? </tt>
-# * <tt> #orthogonal? </tt>
-# * <tt> #permutation? </tt>
-# * <tt> #real? </tt>
-# * <tt> #regular? </tt>
-# * <tt> #singular? </tt>
-# * <tt> #square? </tt>
-# * <tt> #symmetric? </tt>
-# * <tt> #unitary? </tt>
-# * <tt> #upper_triangular? </tt>
-# * <tt> #zero? </tt>
+# * #diagonal?
+# * #empty?
+# * #hermitian?
+# * #lower_triangular?
+# * #normal?
+# * #orthogonal?
+# * #permutation?
+# * #real?
+# * #regular?
+# * #singular?
+# * #square?
+# * #symmetric?
+# * #unitary?
+# * #upper_triangular?
+# * #zero?
#
# Matrix arithmetic:
-# * <tt> *(m) </tt>
-# * <tt> +(m) </tt>
-# * <tt> -(m) </tt>
-# * <tt> #/(m) </tt>
-# * <tt> #inverse </tt>
-# * <tt> #inv </tt>
-# * <tt> ** </tt>
+# * #*(m)
+# * #+(m)
+# * #-(m)
+# * #/(m)
+# * #inverse
+# * #inv
+# * #**
#
# Matrix functions:
-# * <tt> #determinant </tt>
-# * <tt> #det </tt>
-# * <tt> #rank </tt>
-# * <tt> #round </tt>
-# * <tt> #trace </tt>
-# * <tt> #tr </tt>
-# * <tt> #transpose </tt>
-# * <tt> #t </tt>
+# * #determinant
+# * #det
+# * #rank
+# * #round
+# * #trace
+# * #tr
+# * #transpose
+# * #t
#
# Matrix decompositions:
-# * <tt> #eigen </tt>
-# * <tt> #eigensystem </tt>
-# * <tt> #lup </tt>
-# * <tt> #lup_decomposition </tt>
+# * #eigen
+# * #eigensystem
+# * #lup
+# * #lup_decomposition
#
# Complex arithmetic:
-# * <tt> conj </tt>
-# * <tt> conjugate </tt>
-# * <tt> imag </tt>
-# * <tt> imaginary </tt>
-# * <tt> real </tt>
-# * <tt> rect </tt>
-# * <tt> rectangular </tt>
+# * conj
+# * conjugate
+# * imag
+# * imaginary
+# * real
+# * rect
+# * rectangular
#
# Conversion to other data types:
-# * <tt> #coerce(other) </tt>
-# * <tt> #row_vectors </tt>
-# * <tt> #column_vectors </tt>
-# * <tt> #to_a </tt>
+# * #coerce(other)
+# * #row_vectors
+# * #column_vectors
+# * #to_a
#
# String representations:
-# * <tt> #to_s </tt>
-# * <tt> #inspect </tt>
+# * #to_s
+# * #inspect
#
class Matrix
include Enumerable
@@ -138,7 +138,7 @@ class Matrix
# -1 66
#
def Matrix.[](*rows)
- Matrix.rows(rows, false)
+ rows(rows, false)
end
#
@@ -168,7 +168,7 @@ class Matrix
# 93 66
#
def Matrix.columns(columns)
- Matrix.rows(columns, false).transpose
+ rows(columns, false).transpose
end
#
@@ -220,7 +220,7 @@ class Matrix
# 0 5
#
def Matrix.scalar(n, value)
- Matrix.diagonal(*Array.new(n, value))
+ diagonal(*Array.new(n, value))
end
#
@@ -230,7 +230,7 @@ class Matrix
# 0 1
#
def Matrix.identity(n)
- Matrix.scalar(n, 1)
+ scalar(n, 1)
end
class << Matrix
alias unit identity
@@ -304,7 +304,7 @@ class Matrix
end
def new_matrix(rows, column_size = rows[0].size) # :nodoc:
- Matrix.send(:new, rows, column_size) # bypass privacy of Matrix.new
+ self.class.send(:new, rows, column_size) # bypass privacy of Matrix.new
end
private :new_matrix
@@ -614,7 +614,7 @@ class Matrix
#
def hermitian?
Matrix.Raise ErrDimensionMismatch unless square?
- each_with_index(:strict_upper).all? do |e, row, col|
+ each_with_index(:upper).all? do |e, row, col|
e == rows[col][row].conj
end
end
@@ -718,9 +718,10 @@ class Matrix
#
def symmetric?
Matrix.Raise ErrDimensionMismatch unless square?
- each_with_index(:strict_upper).all? do |e, row, col|
- e == rows[col][row]
+ each_with_index(:strict_upper) do |e, row, col|
+ return false if e != rows[col][row]
end
+ true
end
#
@@ -808,7 +809,7 @@ class Matrix
}
return new_matrix rows, column_size
when Vector
- m = Matrix.column_vector(m)
+ m = self.class.column_vector(m)
r = self * m
return r.column(0)
when Matrix
@@ -838,7 +839,7 @@ class Matrix
when Numeric
Matrix.Raise ErrOperationNotDefined, "+", self.class, m.class
when Vector
- m = Matrix.column_vector(m)
+ m = self.class.column_vector(m)
when Matrix
else
return apply_through_coercion(m, __method__)
@@ -865,7 +866,7 @@ class Matrix
when Numeric
Matrix.Raise ErrOperationNotDefined, "-", self.class, m.class
when Vector
- m = Matrix.column_vector(m)
+ m = self.class.column_vector(m)
when Matrix
else
return apply_through_coercion(m, __method__)
@@ -909,7 +910,7 @@ class Matrix
#
def inverse
Matrix.Raise ErrDimensionMismatch unless square?
- Matrix.I(row_size).send(:inverse_from, self)
+ self.class.I(row_size).send(:inverse_from, self)
end
alias inv inverse
@@ -973,7 +974,7 @@ class Matrix
x = self
if other <= 0
x = self.inverse
- return Matrix.identity(self.column_size) if other == 0
+ return self.class.identity(self.column_size) if other == 0
other = -other
end
z = nil
@@ -984,7 +985,7 @@ class Matrix
end
when Numeric
v, d, v_inv = eigensystem
- v * Matrix.diagonal(*d.each(:diagonal).map{|e| e ** other}) * v_inv
+ v * self.class.diagonal(*d.each(:diagonal).map{|e| e ** other}) * v_inv
else
Matrix.Raise ErrOperationNotDefined, "**", self.class, other.class
end
@@ -1088,7 +1089,7 @@ class Matrix
#
def determinant_e
warn "#{caller(1)[0]}: warning: Matrix#determinant_e is deprecated; use #determinant"
- rank
+ determinant
end
alias det_e determinant_e
@@ -1168,7 +1169,7 @@ class Matrix
# 2 4 6
#
def transpose
- return Matrix.empty(column_size, 0) if row_size.zero?
+ return self.class.empty(column_size, 0) if row_size.zero?
new_matrix @rows.transpose, row_size
end
alias t transpose
@@ -1330,9 +1331,9 @@ class Matrix
#
def to_s
if empty?
- "Matrix.empty(#{row_size}, #{column_size})"
+ "#{self.class}.empty(#{row_size}, #{column_size})"
else
- "Matrix[" + @rows.collect{|row|
+ "#{self.class}[" + @rows.collect{|row|
"[" + row.collect{|e| e.to_s}.join(", ") + "]"
}.join(", ")+"]"
end
@@ -1343,9 +1344,9 @@ class Matrix
#
def inspect
if empty?
- "Matrix.empty(#{row_size}, #{column_size})"
+ "#{self.class}.empty(#{row_size}, #{column_size})"
else
- "Matrix#{@rows.inspect}"
+ "#{self.class}#{@rows.inspect}"
end
end
@@ -1499,40 +1500,40 @@ end
# == Method Catalogue
#
# To create a Vector:
-# * <tt> Vector.[](*array) </tt>
-# * <tt> Vector.elements(array, copy = true) </tt>
+# * Vector.[](*array)
+# * Vector.elements(array, copy = true)
#
# To access elements:
-# * <tt> [](i) </tt>
+# * #[](i)
#
# To enumerate the elements:
-# * <tt> #each2(v) </tt>
-# * <tt> #collect2(v) </tt>
+# * #each2(v)
+# * #collect2(v)
#
# Vector arithmetic:
-# * <tt> *(x) "is matrix or number" </tt>
-# * <tt> +(v) </tt>
-# * <tt> -(v) </tt>
+# * #*(x) "is matrix or number"
+# * #+(v)
+# * #-(v)
#
# Vector functions:
-# * <tt> #inner_product(v) </tt>
-# * <tt> #collect </tt>
-# * <tt> #magnitude </tt>
-# * <tt> #map </tt>
-# * <tt> #map2(v) </tt>
-# * <tt> #norm </tt>
-# * <tt> #normalize </tt>
-# * <tt> #r </tt>
-# * <tt> #size </tt>
+# * #inner_product(v)
+# * #collect
+# * #magnitude
+# * #map
+# * #map2(v)
+# * #norm
+# * #normalize
+# * #r
+# * #size
#
# Conversion to other data types:
-# * <tt> #covector </tt>
-# * <tt> #to_a </tt>
-# * <tt> #coerce(other) </tt>
+# * #covector
+# * #to_a
+# * #coerce(other)
#
# String representations:
-# * <tt> #to_s </tt>
-# * <tt> #inspect </tt>
+# * #to_s
+# * #inspect
#
class Vector
include ExceptionForMatrix
@@ -1654,7 +1655,7 @@ class Vector
# Return a copy of the vector.
#
def clone
- Vector.elements(@elements)
+ self.class.elements(@elements)
end
#
@@ -1675,7 +1676,7 @@ class Vector
case x
when Numeric
els = @elements.collect{|e| e * x}
- Vector.elements(els, false)
+ self.class.elements(els, false)
when Matrix
Matrix.column_vector(self) * x
when Vector
@@ -1695,7 +1696,7 @@ class Vector
els = collect2(v) {|v1, v2|
v1 + v2
}
- Vector.elements(els, false)
+ self.class.elements(els, false)
when Matrix
Matrix.column_vector(self) + v
else
@@ -1713,7 +1714,7 @@ class Vector
els = collect2(v) {|v1, v2|
v1 - v2
}
- Vector.elements(els, false)
+ self.class.elements(els, false)
when Matrix
Matrix.column_vector(self) - v
else
@@ -1728,7 +1729,7 @@ class Vector
case x
when Numeric
els = @elements.collect{|e| e / x}
- Vector.elements(els, false)
+ self.class.elements(els, false)
when Matrix, Vector
Vector.Raise ErrOperationNotDefined, "/", self.class, x.class
else
@@ -1760,7 +1761,7 @@ class Vector
def collect(&block) # :yield: e
return to_enum(:collect) unless block_given?
els = @elements.collect(&block)
- Vector.elements(els, false)
+ self.class.elements(els, false)
end
alias map collect
@@ -1769,7 +1770,7 @@ class Vector
# Vector[5,8,2].r => 9.643650761
#
def magnitude
- Math.sqrt(@elements.inject(0) {|v, e| v + e*e})
+ Math.sqrt(@elements.inject(0) {|v, e| v + e.abs2})
end
alias r magnitude
alias norm magnitude
@@ -1780,7 +1781,7 @@ class Vector
def map2(v, &block) # :yield: e1, e2
return to_enum(:map2, v) unless block_given?
els = collect2(v, &block)
- Vector.elements(els, false)
+ self.class.elements(els, false)
end
class ZeroVectorError < StandardError
diff --git a/lib/minitest/README.txt b/lib/minitest/README.txt
new file mode 100644
index 0000000000..6430c1b442
--- /dev/null
+++ b/lib/minitest/README.txt
@@ -0,0 +1,394 @@
+= minitest/{unit,spec,mock,benchmark}
+
+home :: https://github.com/seattlerb/minitest
+rdoc :: http://docs.seattlerb.org/minitest
+vim :: https://github.com/sunaku/vim-ruby-minitest
+
+== DESCRIPTION:
+
+minitest provides a complete suite of testing facilities supporting
+TDD, BDD, mocking, and benchmarking.
+
+ "I had a class with Jim Weirich on testing last week and we were
+ allowed to choose our testing frameworks. Kirk Haines and I were
+ paired up and we cracked open the code for a few test
+ frameworks...
+
+ I MUST say that minitest is *very* readable / understandable
+ compared to the 'other two' options we looked at. Nicely done and
+ thank you for helping us keep our mental sanity."
+
+ -- Wayne E. Seguin
+
+minitest/unit is a small and incredibly fast unit testing framework.
+It provides a rich set of assertions to make your tests clean and
+readable.
+
+minitest/spec is a functionally complete spec engine. It hooks onto
+minitest/unit and seamlessly bridges test assertions over to spec
+expectations.
+
+minitest/benchmark is an awesome way to assert the performance of your
+algorithms in a repeatable manner. Now you can assert that your newb
+co-worker doesn't replace your linear algorithm with an exponential
+one!
+
+minitest/mock by Steven Baker, is a beautifully tiny mock (and stub)
+object framework.
+
+minitest/pride shows pride in testing and adds coloring to your test
+output. I guess it is an example of how to write IO pipes too. :P
+
+minitest/unit is meant to have a clean implementation for language
+implementors that need a minimal set of methods to bootstrap a working
+test suite. For example, there is no magic involved for test-case
+discovery.
+
+ "Again, I can't praise enough the idea of a testing/specing
+ framework that I can actually read in full in one sitting!"
+
+ -- Piotr Szotkowski
+
+Comparing to rspec:
+
+ rspec is a testing DSL. minitest is ruby.
+
+ -- Adam Hawkins, "Bow Before MiniTest"
+
+minitest doesn't reinvent anything that ruby already provides, like:
+classes, modules, inheritance, methods. This means you only have to
+learn ruby to use minitest and all of your regular OO practices like
+extract-method refactorings still apply.
+
+== FEATURES/PROBLEMS:
+
+* minitest/autorun - the easy and explicit way to run all your tests.
+* minitest/unit - a very fast, simple, and clean test system.
+* minitest/spec - a very fast, simple, and clean spec system.
+* minitest/mock - a simple and clean mock/stub system.
+* minitest/benchmark - an awesome way to assert your algorithm's performance.
+* minitest/pride - show your pride in testing!
+* Incredibly small and fast runner, but no bells and whistles.
+
+== RATIONALE:
+
+See design_rationale.rb to see how specs and tests work in minitest.
+
+== SYNOPSIS:
+
+Given that you'd like to test the following class:
+
+ class Meme
+ def i_can_has_cheezburger?
+ "OHAI!"
+ end
+
+ def will_it_blend?
+ "YES!"
+ end
+ end
+
+=== Unit tests
+
+ require 'minitest/autorun'
+
+ class TestMeme < MiniTest::Unit::TestCase
+ def setup
+ @meme = Meme.new
+ end
+
+ def test_that_kitty_can_eat
+ assert_equal "OHAI!", @meme.i_can_has_cheezburger?
+ end
+
+ def test_that_it_will_not_blend
+ refute_match /^no/i, @meme.will_it_blend?
+ end
+
+ def test_that_will_be_skipped
+ skip "test this later"
+ end
+ end
+
+=== Specs
+
+ require 'minitest/autorun'
+
+ describe Meme do
+ before do
+ @meme = Meme.new
+ end
+
+ describe "when asked about cheeseburgers" do
+ it "must respond positively" do
+ @meme.i_can_has_cheezburger?.must_equal "OHAI!"
+ end
+ end
+
+ describe "when asked about blending possibilities" do
+ it "won't say no" do
+ @meme.will_it_blend?.wont_match /^no/i
+ end
+ end
+ end
+
+For matchers support check out:
+
+https://github.com/zenspider/minitest-matchers
+
+=== Benchmarks
+
+Add benchmarks to your regular unit tests. If the unit tests fail, the
+benchmarks won't run.
+
+ # optionally run benchmarks, good for CI-only work!
+ require 'minitest/benchmark' if ENV["BENCH"]
+
+ class TestMeme < MiniTest::Unit::TestCase
+ # Override self.bench_range or default range is [1, 10, 100, 1_000, 10_000]
+ def bench_my_algorithm
+ assert_performance_linear 0.9999 do |n| # n is a range value
+ @obj.my_algorithm(n)
+ end
+ end
+ end
+
+Or add them to your specs. If you make benchmarks optional, you'll
+need to wrap your benchmarks in a conditional since the methods won't
+be defined.
+
+ describe Meme do
+ if ENV["BENCH"] then
+ bench_performance_linear "my_algorithm", 0.9999 do |n|
+ 100.times do
+ @obj.my_algorithm(n)
+ end
+ end
+ end
+ end
+
+outputs something like:
+
+ # Running benchmarks:
+
+ TestBlah 100 1000 10000
+ bench_my_algorithm 0.006167 0.079279 0.786993
+ bench_other_algorithm 0.061679 0.792797 7.869932
+
+Output is tab-delimited to make it easy to paste into a spreadsheet.
+
+=== Mocks
+
+ class MemeAsker
+ def initialize(meme)
+ @meme = meme
+ end
+
+ def ask(question)
+ method = question.tr(" ","_") + "?"
+ @meme.__send__(method)
+ end
+ end
+
+ require 'minitest/autorun'
+
+ describe MemeAsker do
+ before do
+ @meme = MiniTest::Mock.new
+ @meme_asker = MemeAsker.new @meme
+ end
+
+ describe "#ask" do
+ describe "when passed an unpunctuated question" do
+ it "should invoke the appropriate predicate method on the meme" do
+ @meme.expect :will_it_blend?, :return_value
+ @meme_asker.ask "will it blend"
+ @meme.verify
+ end
+ end
+ end
+ end
+
+=== Stubs
+
+ def test_stale_eh
+ obj_under_test = Something.new
+
+ refute obj_under_test.stale?
+
+ Time.stub :now, Time.at(0) do # stub goes away once the block is done
+ assert obj_under_test.stale?
+ end
+ end
+
+=== Customizable Test Runner Types:
+
+MiniTest::Unit.runner=(runner) provides an easy way of creating custom
+test runners for specialized needs. Justin Weiss provides the
+following real-world example to create an alternative to regular
+fixture loading:
+
+ class MiniTestWithHooks::Unit < MiniTest::Unit
+ def before_suites
+ end
+
+ def after_suites
+ end
+
+ def _run_suites(suites, type)
+ begin
+ before_suites
+ super(suites, type)
+ ensure
+ after_suites
+ end
+ end
+
+ def _run_suite(suite, type)
+ begin
+ suite.before_suite
+ super(suite, type)
+ ensure
+ suite.after_suite
+ end
+ end
+ end
+
+ module MiniTestWithTransactions
+ class Unit < MiniTestWithHooks::Unit
+ include TestSetupHelper
+
+ def before_suites
+ super
+ setup_nested_transactions
+ # load any data we want available for all tests
+ end
+
+ def after_suites
+ teardown_nested_transactions
+ super
+ end
+ end
+ end
+
+ MiniTest::Unit.runner = MiniTestWithTransactions::Unit.new
+
+== Known Extensions:
+
+minitest-capistrano :: Assertions and expectations for testing Capistrano recipes
+minitest-capybara :: Capybara matchers support for minitest unit and spec
+minitest-chef-handler :: Run Minitest suites as Chef report handlers
+minitest-ci :: CI reporter plugin for MiniTest.
+minitest-colorize :: Colorize MiniTest output and show failing tests instantly.
+minitest-context :: Defines contexts for code reuse in MiniTest
+ specs that share common expectations.
+minitest-debugger :: Wraps assert so failed assertions drop into
+ the ruby debugger.
+minitest-display :: Patches MiniTest to allow for an easily configurable output.
+minitest-emoji :: Print out emoji for your test passes, fails, and skips.
+minitest-excludes :: Clean API for excluding certain tests you
+ don't want to run under certain conditions.
+minitest-firemock :: Makes your MiniTest mocks more resilient.
+minitest-growl :: Test notifier for minitest via growl.
+minitest-instrument :: Instrument ActiveSupport::Notifications when
+ test method is executed
+minitest-instrument-db :: Store information about speed of test
+ execution provided by minitest-instrument in database
+minitest-libnotify :: Test notifier for minitest via libnotify.
+minitest-macruby :: Provides extensions to minitest for macruby UI testing.
+minitest-matchers :: Adds support for RSpec-style matchers to minitest.
+minitest-metadata :: Annotate tests with metadata (key-value).
+minitest-mongoid :: Mongoid assertion matchers for MiniTest
+minitest-must_not :: Provides must_not as an alias for wont in MiniTest
+minitest-predicates :: Adds support for .predicate? methods
+minitest-rails :: MiniTest integration for Rails 3.x
+minitest-rails-capybara :: Capybara integration for MiniTest::Rails
+minitest-reporters :: Create customizable MiniTest output formats
+minitest-rg :: redgreen minitest
+minitest-shouldify :: Adding all manner of shoulds to MiniTest (bad idea)
+minitest-spec-magic :: Minitest::Spec extensions for Rails and beyond
+minitest-tags :: add tags for minitest
+minitest-wscolor :: Yet another test colorizer.
+minitest_owrapper :: Get tests results as a TestResult object.
+minitest_should :: Shoulda style syntax for minitest test::unit.
+minitest_tu_shim :: minitest_tu_shim bridges between test/unit and minitest.
+mongoid-minitest :: MiniTest matchers for Mongoid.
+pry-rescue :: A pry plugin w/ minitest support. See pry-rescue/minitest.rb.
+
+== Unknown Extensions:
+
+Authors... Please send me a pull request with a description of your minitest extension.
+
+* assay-minitest
+* capybara_minitest_spec
+* detroit-minitest
+* em-minitest-spec
+* flexmock-minitest
+* guard-minitest
+* guard-minitest-decisiv
+* minitest-activemodel
+* minitest-ar-assertions
+* minitest-around
+* minitest-capybara-unit
+* minitest-colorer
+* minitest-deluxe
+* minitest-extra-assertions
+* minitest-nc
+* minitest-rails-shoulda
+* minitest-spec
+* minitest-spec-context
+* minitest-spec-rails
+* minitest-spec-should
+* minitest-sugar
+* minitest_should
+* mongoid-minitest
+* spork-minitest
+
+== REQUIREMENTS:
+
+* Ruby 1.8, maybe even 1.6 or lower. No magic is involved.
+
+== INSTALL:
+
+ sudo gem install minitest
+
+On 1.9, you already have it. To get newer candy you can still install
+the gem, but you'll need to activate the gem explicitly to use it:
+
+ require 'rubygems'
+ gem 'minitest' # ensures you're using the gem, and not the built in MT
+ require 'minitest/autorun'
+
+ # ... usual testing stuffs ...
+
+DO NOTE: There is a serious problem with the way that ruby 1.9/2.0
+packages their own gems. They install a gem specification file, but
+don't install the gem contents in the gem path. This messes up
+Gem.find_files and many other things (gem which, gem contents, etc).
+
+Just install minitest as a gem for real and you'll be happier.
+
+== LICENSE:
+
+(The MIT License)
+
+Copyright (c) Ryan Davis, seattle.rb
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/lib/minitest/autorun.rb b/lib/minitest/autorun.rb
index 3b6c2d49f1..cb4a3a0e5d 100644
--- a/lib/minitest/autorun.rb
+++ b/lib/minitest/autorun.rb
@@ -1,9 +1,17 @@
+# encoding: utf-8
######################################################################
# This file is imported from the minitest project.
# DO NOT make modifications in this repo. They _will_ be reverted!
# File a patch instead and assign it to Ryan Davis.
######################################################################
+begin
+ require 'rubygems'
+ gem 'minitest'
+rescue Gem::LoadError
+ # do nothing
+end
+
require 'minitest/unit'
require 'minitest/spec'
require 'minitest/mock'
diff --git a/lib/minitest/benchmark.rb b/lib/minitest/benchmark.rb
index 77c0afafb7..02121db340 100644
--- a/lib/minitest/benchmark.rb
+++ b/lib/minitest/benchmark.rb
@@ -1,3 +1,4 @@
+# encoding: utf-8
######################################################################
# This file is imported from the minitest project.
# DO NOT make modifications in this repo. They _will_ be reverted!
@@ -7,9 +8,7 @@
require 'minitest/unit'
require 'minitest/spec'
-class MiniTest::Unit
- attr_accessor :runner
-
+class MiniTest::Unit # :nodoc:
def run_benchmarks # :nodoc:
_run_anything :benchmark
end
@@ -83,8 +82,8 @@ class MiniTest::Unit
#
# def bench_algorithm
# validation = proc { |x, y| ... }
- # assert_performance validation do |x|
- # @obj.algorithm
+ # assert_performance validation do |n|
+ # @obj.algorithm(n)
# end
# end
@@ -127,8 +126,8 @@ class MiniTest::Unit
# Eg:
#
# def bench_algorithm
- # assert_performance_constant 0.9999 do |x|
- # @obj.algorithm
+ # assert_performance_constant 0.9999 do |n|
+ # @obj.algorithm(n)
# end
# end
@@ -153,8 +152,8 @@ class MiniTest::Unit
# Eg:
#
# def bench_algorithm
- # assert_performance_exponential 0.9999 do |x|
- # @obj.algorithm
+ # assert_performance_exponential 0.9999 do |n|
+ # @obj.algorithm(n)
# end
# end
@@ -173,8 +172,8 @@ class MiniTest::Unit
# Eg:
#
# def bench_algorithm
- # assert_performance_linear 0.9999 do |x|
- # @obj.algorithm
+ # assert_performance_linear 0.9999 do |n|
+ # @obj.algorithm(n)
# end
# end
@@ -318,6 +317,15 @@ class MiniTest::Spec
define_method "bench_#{name.gsub(/\W+/, '_')}", &block
end
+ ##
+ # Specifies the ranges used for benchmarking for that class.
+ #
+ # bench_range do
+ # bench_exp(2, 16, 2)
+ # end
+ #
+ # See Unit::TestCase.bench_range for more details.
+
def self.bench_range &block
return super unless block
@@ -329,8 +337,8 @@ class MiniTest::Spec
# Create a benchmark that verifies that the performance is linear.
#
# describe "my class" do
- # bench_performance_linear "fast_algorithm", 0.9999 do
- # @obj.fast_algorithm
+ # bench_performance_linear "fast_algorithm", 0.9999 do |n|
+ # @obj.fast_algorithm(n)
# end
# end
@@ -344,8 +352,8 @@ class MiniTest::Spec
# Create a benchmark that verifies that the performance is constant.
#
# describe "my class" do
- # bench_performance_constant "zoom_algorithm!" do
- # @obj.zoom_algorithm!
+ # bench_performance_constant "zoom_algorithm!" do |n|
+ # @obj.zoom_algorithm!(n)
# end
# end
@@ -359,8 +367,8 @@ class MiniTest::Spec
# Create a benchmark that verifies that the performance is exponential.
#
# describe "my class" do
- # bench_performance_exponential "algorithm" do
- # @obj.algorithm
+ # bench_performance_exponential "algorithm" do |n|
+ # @obj.algorithm(n)
# end
# end
diff --git a/lib/minitest/hell.rb b/lib/minitest/hell.rb
new file mode 100644
index 0000000000..b1c602c875
--- /dev/null
+++ b/lib/minitest/hell.rb
@@ -0,0 +1,16 @@
+# encoding: utf-8
+######################################################################
+# This file is imported from the minitest project.
+# DO NOT make modifications in this repo. They _will_ be reverted!
+# File a patch instead and assign it to Ryan Davis.
+######################################################################
+
+class Minitest::Unit::TestCase
+ class << self
+ alias :old_test_order :test_order
+
+ def test_order # :nodoc:
+ :parallel
+ end
+ end
+end
diff --git a/lib/minitest/mock.rb b/lib/minitest/mock.rb
index 1cbf18b19f..4c1b604425 100644
--- a/lib/minitest/mock.rb
+++ b/lib/minitest/mock.rb
@@ -1,10 +1,12 @@
+# encoding: utf-8
######################################################################
# This file is imported from the minitest project.
# DO NOT make modifications in this repo. They _will_ be reverted!
# File a patch instead and assign it to Ryan Davis.
######################################################################
-class MockExpectationError < StandardError; end
+class MockExpectationError < StandardError # :nodoc:
+end # omg... worst bug ever. rdoc doesn't allow 1-liners
##
# A simple and clean mock object framework.
@@ -15,53 +17,184 @@ module MiniTest
# All mock objects are an instance of Mock
class Mock
+ alias :__respond_to? :respond_to?
+
+ skip_methods = %w(object_id respond_to_missing? inspect === to_s)
+
+ instance_methods.each do |m|
+ undef_method m unless skip_methods.include?(m.to_s) || m =~ /^__/
+ end
+
def initialize # :nodoc:
- @expected_calls = {}
- @actual_calls = Hash.new {|h,k| h[k] = [] }
+ @expected_calls = Hash.new { |calls, name| calls[name] = [] }
+ @actual_calls = Hash.new { |calls, name| calls[name] = [] }
end
##
- # Expect that method +name+ is called, optionally with +args+, and
- # returns +retval+.
+ # Expect that method +name+ is called, optionally with +args+ or a
+ # +blk+, and returns +retval+.
#
# @mock.expect(:meaning_of_life, 42)
# @mock.meaning_of_life # => 42
#
# @mock.expect(:do_something_with, true, [some_obj, true])
# @mock.do_something_with(some_obj, true) # => true
+ #
+ # @mock.expect(:do_something_else, true) do |a1, a2|
+ # a1 == "buggs" && a2 == :bunny
+ # end
+ #
+ # +args+ is compared to the expected args using case equality (ie, the
+ # '===' operator), allowing for less specific expectations.
+ #
+ # @mock.expect(:uses_any_string, true, [String])
+ # @mock.uses_any_string("foo") # => true
+ # @mock.verify # => true
+ #
+ # @mock.expect(:uses_one_string, true, ["foo"]
+ # @mock.uses_one_string("bar") # => true
+ # @mock.verify # => raises MockExpectationError
- def expect(name, retval, args=[])
- @expected_calls[name] = { :retval => retval, :args => args }
+ def expect(name, retval, args=[], &blk)
+ if block_given?
+ raise ArgumentError, "args ignored when block given" unless args.empty?
+ @expected_calls[name] << { :retval => retval, :block => blk }
+ else
+ raise ArgumentError, "args must be an array" unless Array === args
+ @expected_calls[name] << { :retval => retval, :args => args }
+ end
self
end
+ def __call name, data # :nodoc:
+ case data
+ when Hash then
+ "#{name}(#{data[:args].inspect[1..-2]}) => #{data[:retval].inspect}"
+ else
+ data.map { |d| __call name, d }.join ", "
+ end
+ end
+
##
# Verify that all methods were called as expected. Raises
# +MockExpectationError+ if the mock object was not called as
# expected.
def verify
- @expected_calls.each_key do |name|
- expected = @expected_calls[name]
- msg = "expected #{name}, #{expected.inspect}"
- raise MockExpectationError, msg unless
- @actual_calls.has_key? name and @actual_calls[name].include?(expected)
+ @expected_calls.each do |name, calls|
+ calls.each do |expected|
+ msg1 = "expected #{__call name, expected}"
+ msg2 = "#{msg1}, got [#{__call name, @actual_calls[name]}]"
+
+ raise MockExpectationError, msg2 if
+ @actual_calls.has_key?(name) and
+ not @actual_calls[name].include?(expected)
+
+ raise MockExpectationError, msg1 unless
+ @actual_calls.has_key?(name) and
+ @actual_calls[name].include?(expected)
+ end
end
true
end
def method_missing(sym, *args) # :nodoc:
- raise NoMethodError unless @expected_calls.has_key?(sym)
- raise ArgumentError unless @expected_calls[sym][:args].size == args.size
- retval = @expected_calls[sym][:retval]
- @actual_calls[sym] << { :retval => retval, :args => args }
+ unless @expected_calls.has_key?(sym) then
+ raise NoMethodError, "unmocked method %p, expected one of %p" %
+ [sym, @expected_calls.keys.sort_by(&:to_s)]
+ end
+
+ index = @actual_calls[sym].length
+ expected_call = @expected_calls[sym][index]
+
+ unless expected_call then
+ raise MockExpectationError, "No more expects available for %p: %p" %
+ [sym, args]
+ end
+
+ expected_args, retval, val_block =
+ expected_call.values_at(:args, :retval, :block)
+
+ if val_block then
+ raise MockExpectationError, "mocked method %p failed block w/ %p" %
+ [sym, args] unless val_block.call(args)
+
+ # keep "verify" happy
+ @actual_calls[sym] << expected_call
+ return retval
+ end
+
+ if expected_args.size != args.size then
+ raise ArgumentError, "mocked method %p expects %d arguments, got %d" %
+ [sym, expected_args.size, args.size]
+ end
+
+ fully_matched = expected_args.zip(args).all? { |mod, a|
+ mod === a or mod == a
+ }
+
+ unless fully_matched then
+ raise MockExpectationError, "mocked method %p called with unexpected arguments %p" %
+ [sym, args]
+ end
+
+ @actual_calls[sym] << {
+ :retval => retval,
+ :args => expected_args.zip(args).map { |mod, a| mod === a ? mod : a }
+ }
+
retval
end
- alias :original_respond_to? :respond_to?
- def respond_to?(sym) # :nodoc:
- return true if @expected_calls.has_key?(sym)
- return original_respond_to?(sym)
+ def respond_to?(sym, include_private = false) # :nodoc:
+ return true if @expected_calls.has_key?(sym.to_sym)
+ return __respond_to?(sym, include_private)
+ end
+ end
+end
+
+class Object # :nodoc:
+
+ ##
+ # Add a temporary stubbed method replacing +name+ for the duration
+ # of the +block+. If +val_or_callable+ responds to #call, then it
+ # returns the result of calling it, otherwise returns the value
+ # as-is. Cleans up the stub at the end of the +block+.
+ #
+ # def test_stale_eh
+ # obj_under_test = Something.new
+ # refute obj_under_test.stale?
+ #
+ # Time.stub :now, Time.at(0) do
+ # assert obj_under_test.stale?
+ # end
+ # end
+
+ def stub name, val_or_callable, &block
+ new_name = "__minitest_stub__#{name}"
+
+ metaclass = class << self; self; end
+
+ if respond_to? name and not methods.map(&:to_s).include? name.to_s then
+ metaclass.send :define_method, name do |*args|
+ super(*args)
+ end
+ end
+
+ metaclass.send :alias_method, new_name, name
+
+ metaclass.send :define_method, name do |*args|
+ if val_or_callable.respond_to? :call then
+ val_or_callable.call(*args)
+ else
+ val_or_callable
+ end
end
+
+ yield self
+ ensure
+ metaclass.send :undef_method, name
+ metaclass.send :alias_method, name, new_name
+ metaclass.send :undef_method, new_name
end
end
diff --git a/lib/minitest/parallel_each.rb b/lib/minitest/parallel_each.rb
new file mode 100644
index 0000000000..d501aa34ef
--- /dev/null
+++ b/lib/minitest/parallel_each.rb
@@ -0,0 +1,36 @@
+# encoding: utf-8
+######################################################################
+# This file is imported from the minitest project.
+# DO NOT make modifications in this repo. They _will_ be reverted!
+# File a patch instead and assign it to Ryan Davis.
+######################################################################
+
+class ParallelEach
+ require 'thread'
+ include Enumerable
+
+ N = (ENV['N'] || 2).to_i
+
+ def initialize list
+ @queue = Queue.new # *sigh*... the Queue api sucks sooo much...
+
+ list.each { |i| @queue << i }
+ N.times { @queue << nil }
+ end
+
+ def grep pattern
+ self.class.new super
+ end
+
+ def each
+ threads = N.times.map {
+ Thread.new do
+ Thread.current.abort_on_exception = true
+ while job = @queue.pop
+ yield job
+ end
+ end
+ }
+ threads.map(&:join)
+ end
+end
diff --git a/lib/minitest/pride.rb b/lib/minitest/pride.rb
index 9a4d68859a..40c35394fa 100644
--- a/lib/minitest/pride.rb
+++ b/lib/minitest/pride.rb
@@ -1,3 +1,4 @@
+# encoding: utf-8
######################################################################
# This file is imported from the minitest project.
# DO NOT make modifications in this repo. They _will_ be reverted!
@@ -10,32 +11,109 @@ require "minitest/unit"
# Show your testing pride!
class PrideIO
- attr_reader :io
- # stolen from /System/Library/Perl/5.10.0/Term/ANSIColor.pm
- COLORS = (31..36).to_a
- CHARS = ["*"]
+ # Start an escape sequence
+ ESC = "\e["
+
+ # End the escape sequence
+ NND = "#{ESC}0m"
+
+ # The IO we're going to pipe through.
+ attr_reader :io
- def initialize io
+ def initialize io # :nodoc:
@io = io
- @colors = COLORS.cycle
- @chars = CHARS.cycle
+ # stolen from /System/Library/Perl/5.10.0/Term/ANSIColor.pm
+ # also reference http://en.wikipedia.org/wiki/ANSI_escape_code
+ @colors ||= (31..36).to_a
+ @size = @colors.size
+ @index = 0
+ # io.sync = true
end
+ ##
+ # Wrap print to colorize the output.
+
def print o
case o
when "." then
- io.print "\e[#{@colors.next}m#{@chars.next}\e[0m"
+ io.print pride o
when "E", "F" then
- io.print "\e[41m\e[37m#{o}\e[0m"
+ io.print "#{ESC}41m#{ESC}37m#{o}#{NND}"
else
io.print o
end
end
- def method_missing msg, *args
+ def puts(*o) # :nodoc:
+ o.map! { |s|
+ s.to_s.sub(/Finished tests/) {
+ @index = 0
+ 'Fabulous tests'.split(//).map { |c|
+ pride(c)
+ }.join
+ }
+ }
+
+ super
+ end
+
+ ##
+ # Color a string.
+
+ def pride string
+ string = "*" if string == "."
+ c = @colors[@index % @size]
+ @index += 1
+ "#{ESC}#{c}m#{string}#{NND}"
+ end
+
+ def method_missing msg, *args # :nodoc:
io.send(msg, *args)
end
end
-MiniTest::Unit.output = PrideIO.new(MiniTest::Unit.output)
+##
+# If you thought the PrideIO was colorful...
+#
+# (Inspired by lolcat, but with clean math)
+
+class PrideLOL < PrideIO
+ PI_3 = Math::PI / 3 # :nodoc:
+
+ def initialize io # :nodoc:
+ # walk red, green, and blue around a circle separated by equal thirds.
+ #
+ # To visualize, type this into wolfram-alpha:
+ #
+ # plot (3*sin(x)+3), (3*sin(x+2*pi/3)+3), (3*sin(x+4*pi/3)+3)
+
+ # 6 has wide pretty gradients. 3 == lolcat, about half the width
+ @colors = (0...(6 * 7)).map { |n|
+ n *= 1.0 / 6
+ r = (3 * Math.sin(n ) + 3).to_i
+ g = (3 * Math.sin(n + 2 * PI_3) + 3).to_i
+ b = (3 * Math.sin(n + 4 * PI_3) + 3).to_i
+
+ # Then we take rgb and encode them in a single number using base 6.
+ # For some mysterious reason, we add 16... to clear the bottom 4 bits?
+ # Yes... they're ugly.
+
+ 36 * r + 6 * g + b + 16
+ }
+
+ super
+ end
+
+ ##
+ # Make the string even more colorful. Damnit.
+
+ def pride string
+ c = @colors[@index % @size]
+ @index += 1
+ "#{ESC}38;5;#{c}m#{string}#{NND}"
+ end
+end
+
+klass = ENV['TERM'] =~ /^xterm|-256color$/ ? PrideLOL : PrideIO
+MiniTest::Unit.output = klass.new(MiniTest::Unit.output)
diff --git a/lib/minitest/spec.rb b/lib/minitest/spec.rb
index 4b16cd03ec..7588982038 100644
--- a/lib/minitest/spec.rb
+++ b/lib/minitest/spec.rb
@@ -1,3 +1,4 @@
+# encoding: utf-8
######################################################################
# This file is imported from the minitest project.
# DO NOT make modifications in this repo. They _will_ be reverted!
@@ -8,54 +9,36 @@
require 'minitest/unit'
-class Module
+class Module # :nodoc:
def infect_an_assertion meth, new_name, dont_flip = false # :nodoc:
# warn "%-22p -> %p %p" % [meth, new_name, dont_flip]
self.class_eval <<-EOM
- def #{new_name} *args, &block
- return MiniTest::Spec.current.#{meth}(*args, &self) if
- Proc === self
- return MiniTest::Spec.current.#{meth}(args.first, self) if
- args.size == 1 unless #{!!dont_flip}
- return MiniTest::Spec.current.#{meth}(self, *args)
+ def #{new_name} *args
+ case
+ when Proc === self then
+ MiniTest::Spec.current.#{meth}(*args, &self)
+ when #{!!dont_flip} then
+ MiniTest::Spec.current.#{meth}(self, *args)
+ else
+ MiniTest::Spec.current.#{meth}(args.first, self, *args[1..-1])
+ end
end
EOM
end
##
- # Create your own expectations from MiniTest::Assertions using a
- # flexible set of rules. If you don't like must/wont, then this
- # method is your friend. For an example of its usage see the bottom
- # of minitest/spec.rb.
+ # infect_with_assertions has been removed due to excessive clever.
+ # Use infect_an_assertion directly instead.
def infect_with_assertions(pos_prefix, neg_prefix,
skip_re,
dont_flip_re = /\c0/,
map = {})
- MiniTest::Assertions.public_instance_methods(false).sort.each do |meth|
- meth = meth.to_s
-
- new_name = case meth
- when /^assert/ then
- meth.sub(/^assert/, pos_prefix.to_s)
- when /^refute/ then
- meth.sub(/^refute/, neg_prefix.to_s)
- end
- next unless new_name
- next if new_name =~ skip_re
-
- regexp, replacement = map.find { |re, _| new_name =~ re }
- new_name.sub! regexp, replacement if replacement
-
- puts "\n##\n# :method: #{new_name}\n# See MiniTest::Assertions##{meth}" if
- $0 == __FILE__
-
- infect_an_assertion meth, new_name, new_name =~ dont_flip_re
- end
+ abort "infect_with_assertions is dead. Use infect_an_assertion directly"
end
end
-module Kernel
+module Kernel # :nodoc:
##
# Describe a series of expectations for a given target +desc+.
#
@@ -80,25 +63,16 @@ module Kernel
# end
# end
- def describe desc, &block # :doc:
+ def describe desc, additional_desc = nil, &block # :doc:
stack = MiniTest::Spec.describe_stack
- name = [stack.last, desc].compact.join("::")
+ name = [stack.last, desc, additional_desc].compact.join("::")
sclas = stack.last || if Class === self && self < MiniTest::Spec then
self
else
MiniTest::Spec.spec_type desc
end
- cls = Class.new sclas
-
- sclas.children << cls unless cls == MiniTest::Spec
- # :stopdoc:
- # omg this sucks
- (class << cls; self; end).send(:define_method, :to_s) { name }
- (class << cls; self; end).send(:define_method, :desc) { desc }
- # :startdoc:
-
- cls.nuke_test_methods!
+ cls = sclas.create name, desc
stack.push cls
cls.class_eval(&block)
@@ -111,7 +85,7 @@ end
##
# MiniTest::Spec -- The faster, better, less-magical spec framework!
#
-# For a list of expectations, see Object.
+# For a list of expectations, see MiniTest::Expectations.
class MiniTest::Spec < MiniTest::Unit::TestCase
##
@@ -124,11 +98,27 @@ class MiniTest::Spec < MiniTest::Unit::TestCase
TYPES = [[//, MiniTest::Spec]]
##
- # Register a new type of spec that matches the spec's description. Eg:
+ # Register a new type of spec that matches the spec's description.
+ # This method can take either a Regexp and a spec class or a spec
+ # class and a block that takes the description and returns true if
+ # it matches.
+ #
+ # Eg:
#
- # register_spec_plugin(/Controller$/, MiniTest::Spec::Rails)
+ # register_spec_type(/Controller$/, MiniTest::Spec::Rails)
+ #
+ # or:
+ #
+ # register_spec_type(MiniTest::Spec::RailsModel) do |desc|
+ # desc.superclass == ActiveRecord::Base
+ # end
- def self.register_spec_type matcher, klass
+ def self.register_spec_type(*args, &block)
+ if block then
+ matcher, klass = block, args.first
+ else
+ matcher, klass = *args
+ end
TYPES.unshift [matcher, klass]
end
@@ -138,8 +128,13 @@ class MiniTest::Spec < MiniTest::Unit::TestCase
# spec_type("BlahController") # => MiniTest::Spec::Rails
def self.spec_type desc
- desc = desc.to_s
- TYPES.find { |re, klass| re === desc }.last
+ TYPES.find { |matcher, klass|
+ if matcher.respond_to? :call then
+ matcher.call desc
+ else
+ matcher === desc.to_s
+ end
+ }.last
end
@@describe_stack = []
@@ -147,19 +142,13 @@ class MiniTest::Spec < MiniTest::Unit::TestCase
@@describe_stack
end
- def self.current # :nodoc:
- @@current_spec
- end
+ ##
+ # Returns the children of this spec.
def self.children
@children ||= []
end
- def initialize name # :nodoc:
- super
- @@current_spec = self
- end
-
def self.nuke_test_methods! # :nodoc:
self.public_instance_methods.grep(/^test_/).each do |name|
self.send :undef_method, name
@@ -167,34 +156,17 @@ class MiniTest::Spec < MiniTest::Unit::TestCase
end
##
- # Spec users want setup/teardown to be inherited and NOTHING ELSE.
- # It is almost like method reuse is lost on them.
-
- def self.define_inheritable_method name, &block # :nodoc:
- # regular super() warns
- super_method = self.superclass.instance_method name
-
- teardown = name.to_s == "teardown"
- super_before = super_method && ! teardown
- super_after = super_method && teardown
-
- define_method name do
- super_method.bind(self).call if super_before
- instance_eval(&block)
- super_method.bind(self).call if super_after
- end
- end
-
- ##
# Define a 'before' action. Inherits the way normal methods should.
#
# NOTE: +type+ is ignored and is only there to make porting easier.
#
# Equivalent to MiniTest::Unit::TestCase#setup.
- def self.before type = :each, &block
- raise "unsupported before type: #{type}" unless type == :each
- define_inheritable_method :setup, &block
+ def self.before type = nil, &block
+ define_method :setup do
+ super()
+ self.instance_eval(&block)
+ end
end
##
@@ -204,9 +176,11 @@ class MiniTest::Spec < MiniTest::Unit::TestCase
#
# Equivalent to MiniTest::Unit::TestCase#teardown.
- def self.after type = :each, &block
- raise "unsupported after type: #{type}" unless type == :each
- define_inheritable_method :teardown, &block
+ def self.after type = nil, &block
+ define_method :teardown do
+ self.instance_eval(&block)
+ super()
+ end
end
##
@@ -215,171 +189,353 @@ class MiniTest::Spec < MiniTest::Unit::TestCase
# write specs don't like class inheritence, so this goes way out of
# its way to make sure that expectations aren't inherited.
#
+ # This is also aliased to #specify and doesn't require a +desc+ arg.
+ #
# Hint: If you _do_ want inheritence, use minitest/unit. You can mix
# and match between assertions and expectations as much as you want.
- def self.it desc, &block
+ def self.it desc = "anonymous", &block
block ||= proc { skip "(no tests defined)" }
@specs ||= 0
@specs += 1
- name = "test_%04d_%s" % [ @specs, desc.gsub(/\W+/, '_').downcase ]
+ name = "test_%04d_%s" % [ @specs, desc ]
define_method name, &block
self.children.each do |mod|
mod.send :undef_method, name if mod.public_method_defined? name
end
+
+ name
end
-end
-Object.infect_with_assertions(:must, :wont,
- /^(must|wont)$|wont_(throw)|
- must_(block|not?_|nothing|raise$)/x,
- /(must|wont)_(include|respond_to)/,
- /(must_throw)s/ => '\1',
- /(?!not)_same/ => '_be_same_as',
- /_in_/ => '_be_within_',
- /_operator/ => '_be',
- /_includes/ => '_include',
- /(must|wont)_(.*_of|nil|silent|empty)/ => '\1_be_\2',
- /must_raises/ => 'must_raise')
-
-class Object
- alias :must_be_close_to :must_be_within_delta
- alias :wont_be_close_to :wont_be_within_delta
-
- if $0 == __FILE__ then
- { "must" => "assert", "wont" => "refute" }.each do |a, b|
- puts "\n"
- puts "##"
- puts "# :method: #{a}_be_close_to"
- puts "# See MiniTest::Assertions##{b}_in_delta"
+ ##
+ # Essentially, define an accessor for +name+ with +block+.
+ #
+ # Why use let instead of def? I honestly don't know.
+
+ def self.let name, &block
+ define_method name do
+ @_memoized ||= {}
+ @_memoized.fetch(name) { |k| @_memoized[k] = instance_eval(&block) }
end
end
##
- # :method: must_be
- # See MiniTest::Assertions#assert_operator
+ # Another lazy man's accessor generator. Made even more lazy by
+ # setting the name for you to +subject+.
- ##
- # :method: must_be_close_to
- # See MiniTest::Assertions#assert_in_delta
+ def self.subject &block
+ let :subject, &block
+ end
+ def self.create name, desc # :nodoc:
+ cls = Class.new(self) do
+ @name = name
+ @desc = desc
+
+ nuke_test_methods!
+ end
+
+ children << cls
+
+ cls
+ end
+
+ def self.to_s # :nodoc:
+ defined?(@name) ? @name : super
+ end
+
+ # :stopdoc:
+ class << self
+ attr_reader :desc
+ alias :specify :it
+ alias :name :to_s
+ end
+ # :startdoc:
+end
+
+##
+# It's where you hide your "assertions".
+
+module MiniTest::Expectations
##
+ # See MiniTest::Assertions#assert_empty.
+ #
+ # collection.must_be_empty
+ #
# :method: must_be_empty
- # See MiniTest::Assertions#assert_empty
- ##
- # :method: must_be_instance_of
- # See MiniTest::Assertions#assert_instance_of
+ infect_an_assertion :assert_empty, :must_be_empty, :unary
##
- # :method: must_be_kind_of
- # See MiniTest::Assertions#assert_kind_of
+ # See MiniTest::Assertions#assert_equal
+ #
+ # a.must_equal b
+ #
+ # :method: must_equal
+
+ infect_an_assertion :assert_equal, :must_equal
##
- # :method: must_be_nil
- # See MiniTest::Assertions#assert_nil
+ # See MiniTest::Assertions#assert_in_delta
+ #
+ # n.must_be_close_to m [, delta]
+ #
+ # :method: must_be_close_to
+
+ infect_an_assertion :assert_in_delta, :must_be_close_to
+
+ alias :must_be_within_delta :must_be_close_to # :nodoc:
##
- # :method: must_be_same_as
- # See MiniTest::Assertions#assert_same
+ # See MiniTest::Assertions#assert_in_epsilon
+ #
+ # n.must_be_within_epsilon m [, epsilon]
+ #
+ # :method: must_be_within_epsilon
+
+ infect_an_assertion :assert_in_epsilon, :must_be_within_epsilon
##
- # :method: must_be_silent
- # See MiniTest::Assertions#assert_silent
+ # See MiniTest::Assertions#assert_includes
+ #
+ # collection.must_include obj
+ #
+ # :method: must_include
+
+ infect_an_assertion :assert_includes, :must_include, :reverse
##
- # :method: must_be_within_delta
- # See MiniTest::Assertions#assert_in_delta
+ # See MiniTest::Assertions#assert_instance_of
+ #
+ # obj.must_be_instance_of klass
+ #
+ # :method: must_be_instance_of
+
+ infect_an_assertion :assert_instance_of, :must_be_instance_of
##
- # :method: must_be_within_epsilon
- # See MiniTest::Assertions#assert_in_epsilon
+ # See MiniTest::Assertions#assert_kind_of
+ #
+ # obj.must_be_kind_of mod
+ #
+ # :method: must_be_kind_of
+
+ infect_an_assertion :assert_kind_of, :must_be_kind_of
##
- # :method: must_equal
- # See MiniTest::Assertions#assert_equal
+ # See MiniTest::Assertions#assert_match
+ #
+ # a.must_match b
+ #
+ # :method: must_match
+
+ infect_an_assertion :assert_match, :must_match
##
- # :method: must_include
- # See MiniTest::Assertions#assert_includes
+ # See MiniTest::Assertions#assert_nil
+ #
+ # obj.must_be_nil
+ #
+ # :method: must_be_nil
+
+ infect_an_assertion :assert_nil, :must_be_nil, :unary
##
- # :method: must_match
- # See MiniTest::Assertions#assert_match
+ # See MiniTest::Assertions#assert_operator
+ #
+ # n.must_be :<=, 42
+ #
+ # This can also do predicates:
+ #
+ # str.must_be :empty?
+ #
+ # :method: must_be
+
+ infect_an_assertion :assert_operator, :must_be, :reverse
##
- # :method: must_output
# See MiniTest::Assertions#assert_output
+ #
+ # proc { ... }.must_output out_or_nil [, err]
+ #
+ # :method: must_output
+
+ infect_an_assertion :assert_output, :must_output
##
- # :method: must_raise
# See MiniTest::Assertions#assert_raises
+ #
+ # proc { ... }.must_raise exception
+ #
+ # :method: must_raise
+
+ infect_an_assertion :assert_raises, :must_raise
##
- # :method: must_respond_to
# See MiniTest::Assertions#assert_respond_to
+ #
+ # obj.must_respond_to msg
+ #
+ # :method: must_respond_to
+
+ infect_an_assertion :assert_respond_to, :must_respond_to, :reverse
##
- # :method: must_send
- # See MiniTest::Assertions#assert_send
+ # See MiniTest::Assertions#assert_same
+ #
+ # a.must_be_same_as b
+ #
+ # :method: must_be_same_as
+
+ infect_an_assertion :assert_same, :must_be_same_as
##
- # :method: must_throw
- # See MiniTest::Assertions#assert_throws
+ # See MiniTest::Assertions#assert_send
+ # TODO: remove me
+ #
+ # a.must_send
+ #
+ # :method: must_send
+
+ infect_an_assertion :assert_send, :must_send
##
- # :method: wont_be
- # See MiniTest::Assertions#refute_operator
+ # See MiniTest::Assertions#assert_silent
+ #
+ # proc { ... }.must_be_silent
+ #
+ # :method: must_be_silent
+
+ infect_an_assertion :assert_silent, :must_be_silent
##
- # :method: wont_be_close_to
- # See MiniTest::Assertions#refute_in_delta
+ # See MiniTest::Assertions#assert_throws
+ #
+ # proc { ... }.must_throw sym
+ #
+ # :method: must_throw
+
+ infect_an_assertion :assert_throws, :must_throw
##
- # :method: wont_be_empty
# See MiniTest::Assertions#refute_empty
+ #
+ # collection.wont_be_empty
+ #
+ # :method: wont_be_empty
+
+ infect_an_assertion :refute_empty, :wont_be_empty, :unary
##
- # :method: wont_be_instance_of
- # See MiniTest::Assertions#refute_instance_of
+ # See MiniTest::Assertions#refute_equal
+ #
+ # a.wont_equal b
+ #
+ # :method: wont_equal
+
+ infect_an_assertion :refute_equal, :wont_equal
##
- # :method: wont_be_kind_of
- # See MiniTest::Assertions#refute_kind_of
+ # See MiniTest::Assertions#refute_in_delta
+ #
+ # n.wont_be_close_to m [, delta]
+ #
+ # :method: wont_be_close_to
+
+ infect_an_assertion :refute_in_delta, :wont_be_close_to
+
+ alias :wont_be_within_delta :wont_be_close_to # :nodoc:
##
- # :method: wont_be_nil
- # See MiniTest::Assertions#refute_nil
+ # See MiniTest::Assertions#refute_in_epsilon
+ #
+ # n.wont_be_within_epsilon m [, epsilon]
+ #
+ # :method: wont_be_within_epsilon
+
+ infect_an_assertion :refute_in_epsilon, :wont_be_within_epsilon
##
- # :method: wont_be_same_as
- # See MiniTest::Assertions#refute_same
+ # See MiniTest::Assertions#refute_includes
+ #
+ # collection.wont_include obj
+ #
+ # :method: wont_include
+
+ infect_an_assertion :refute_includes, :wont_include, :reverse
##
- # :method: wont_be_within_delta
- # See MiniTest::Assertions#refute_in_delta
+ # See MiniTest::Assertions#refute_instance_of
+ #
+ # obj.wont_be_instance_of klass
+ #
+ # :method: wont_be_instance_of
+
+ infect_an_assertion :refute_instance_of, :wont_be_instance_of
##
- # :method: wont_be_within_epsilon
- # See MiniTest::Assertions#refute_in_epsilon
+ # See MiniTest::Assertions#refute_kind_of
+ #
+ # obj.wont_be_kind_of mod
+ #
+ # :method: wont_be_kind_of
+
+ infect_an_assertion :refute_kind_of, :wont_be_kind_of
##
- # :method: wont_equal
- # See MiniTest::Assertions#refute_equal
+ # See MiniTest::Assertions#refute_match
+ #
+ # a.wont_match b
+ #
+ # :method: wont_match
+
+ infect_an_assertion :refute_match, :wont_match
##
- # :method: wont_include
- # See MiniTest::Assertions#refute_includes
+ # See MiniTest::Assertions#refute_nil
+ #
+ # obj.wont_be_nil
+ #
+ # :method: wont_be_nil
+
+ infect_an_assertion :refute_nil, :wont_be_nil, :unary
##
- # :method: wont_match
- # See MiniTest::Assertions#refute_match
+ # See MiniTest::Assertions#refute_operator
+ #
+ # n.wont_be :<=, 42
+ #
+ # This can also do predicates:
+ #
+ # str.wont_be :empty?
+ #
+ # :method: wont_be
+
+ infect_an_assertion :refute_operator, :wont_be, :reverse
##
- # :method: wont_respond_to
# See MiniTest::Assertions#refute_respond_to
+ #
+ # obj.wont_respond_to msg
+ #
+ # :method: wont_respond_to
+
+ infect_an_assertion :refute_respond_to, :wont_respond_to, :reverse
+
+ ##
+ # See MiniTest::Assertions#refute_same
+ #
+ # a.wont_be_same_as b
+ #
+ # :method: wont_be_same_as
+
+ infect_an_assertion :refute_same, :wont_be_same_as
+end
+
+class Object # :nodoc:
+ include MiniTest::Expectations unless ENV["MT_NO_EXPECTATIONS"]
end
diff --git a/lib/minitest/unit.rb b/lib/minitest/unit.rb
index 199360e644..a221dda4b4 100644
--- a/lib/minitest/unit.rb
+++ b/lib/minitest/unit.rb
@@ -1,3 +1,4 @@
+# encoding: utf-8
######################################################################
# This file is imported from the minitest project.
# DO NOT make modifications in this repo. They _will_ be reverted!
@@ -6,6 +7,8 @@
require 'optparse'
require 'rbconfig'
+require 'thread' # required for 1.8
+require 'minitest/parallel_each'
##
# Minimal (mostly drop-in) replacement for test-unit.
@@ -14,6 +17,18 @@ require 'rbconfig'
module MiniTest
+ def self.const_missing name # :nodoc:
+ case name
+ when :MINI_DIR then
+ msg = "MiniTest::MINI_DIR was removed. Don't violate other's internals."
+ warn "WAR\NING: #{msg}"
+ warn "WAR\NING: Used by #{caller.first}."
+ const_set :MINI_DIR, "bad value"
+ else
+ super
+ end
+ end
+
##
# Assertion base class
@@ -24,40 +39,36 @@ module MiniTest
class Skip < Assertion; end
- file = if RUBY_VERSION =~ /^1\.9/ then # bt's expanded, but __FILE__ isn't :(
- File.expand_path __FILE__
- elsif __FILE__ =~ /^[^\.]/ then # assume both relative
- require 'pathname'
- pwd = Pathname.new Dir.pwd
- pn = Pathname.new File.expand_path(__FILE__)
- relpath = pn.relative_path_from(pwd) rescue pn
- pn = File.join ".", relpath unless pn.relative?
- pn.to_s
- else # assume both are expanded
- __FILE__
- end
-
- # './lib' in project dir, or '/usr/local/blahblah' if installed
- MINI_DIR = File.dirname(File.dirname(file)) # :nodoc:
+ class << self
+ attr_accessor :backtrace_filter
+ end
- def self.filter_backtrace bt # :nodoc:
- return ["No backtrace"] unless bt
+ class BacktraceFilter # :nodoc:
+ def filter bt
+ return ["No backtrace"] unless bt
- new_bt = []
+ new_bt = []
- unless $DEBUG then
- bt.each do |line|
- break if line.rindex MINI_DIR, 0
- new_bt << line
+ unless $DEBUG then
+ bt.each do |line|
+ break if line =~ /lib\/minitest/
+ new_bt << line
+ end
+
+ new_bt = bt.reject { |line| line =~ /lib\/minitest/ } if new_bt.empty?
+ new_bt = bt.dup if new_bt.empty?
+ else
+ new_bt = bt.dup
end
- new_bt = bt.reject { |line| line.rindex MINI_DIR, 0 } if new_bt.empty?
- new_bt = bt.dup if new_bt.empty?
- else
- new_bt = bt.dup
+ new_bt
end
+ end
+
+ self.backtrace_filter = BacktraceFilter.new
- new_bt
+ def self.filter_backtrace bt # :nodoc:
+ backtrace_filter.filter bt
end
##
@@ -65,15 +76,18 @@ module MiniTest
# printed if the assertion fails.
module Assertions
+ UNDEFINED = Object.new # :nodoc:
- WINDOZE = RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
+ def UNDEFINED.inspect # :nodoc:
+ "UNDEFINED" # again with the rdoc bugs... :(
+ end
##
# Returns the diff command to use in #diff. Tries to intelligently
# figure out what diff to use.
def self.diff
- @diff = if WINDOZE
+ @diff = if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ then
"diff.exe -u"
else
if system("gdiff", __FILE__, __FILE__)
@@ -134,10 +148,11 @@ module MiniTest
if result.empty? then
klass = exp.class
result = [
- "No visible difference.",
- "You should look at your implementation of #{klass}#==.",
- expect
- ].join "\n"
+ "No visible difference in the #{klass}#inspect output.\n",
+ "You should look at the implementation of #== on ",
+ "#{klass} or its members.\n",
+ expect,
+ ].join
end
end
end
@@ -152,7 +167,7 @@ module MiniTest
def mu_pp obj
s = obj.inspect
- s = s.force_encoding Encoding.default_external if defined? Encoding
+ s = s.encode Encoding.default_external if defined? Encoding
s
end
@@ -189,8 +204,12 @@ module MiniTest
##
# Fails unless the block returns a true value.
+ #
+ # NOTE: This method is deprecated, use assert. It will be removed
+ # on 2013-01-01."
def assert_block msg = nil
+ warn "NOTE: MiniTest::Unit::TestCase#assert_block is deprecated, use assert. It will be removed on 2013-01-01. Called from #{caller.first}"
msg = message(msg) { "Expected block to return true value" }
assert yield, msg
end
@@ -229,7 +248,7 @@ module MiniTest
def assert_in_delta exp, act, delta = 0.001, msg = nil
n = (exp - act).abs
- msg = message(msg) { "Expected #{exp} - #{act} (#{n}) to be < #{delta}" }
+ msg = message(msg) { "Expected |#{exp} - #{act}| (#{n}) to be < #{delta}"}
assert delta >= n, msg
end
@@ -238,7 +257,7 @@ module MiniTest
# error less than +epsilon+.
def assert_in_epsilon a, b, epsilon = 0.001, msg = nil
- assert_in_delta a, b, [a, b].min * epsilon, msg
+ assert_in_delta a, b, [a.abs, b.abs].min * epsilon, msg
end
##
@@ -253,7 +272,7 @@ module MiniTest
end
##
- # Fails unless +obj+ is an instace of +cls+.
+ # Fails unless +obj+ is an instance of +cls+.
def assert_instance_of cls, obj, msg = nil
msg = message(msg) {
@@ -274,13 +293,13 @@ module MiniTest
end
##
- # Fails unless +exp+ is <tt>=~</tt> +act+.
+ # Fails unless +matcher+ <tt>=~</tt> +obj+.
- def assert_match exp, act, msg = nil
- msg = message(msg) { "Expected #{mu_pp(exp)} to match #{mu_pp(act)}" }
- assert_respond_to act, :"=~"
- exp = Regexp.new Regexp.escape exp if String === exp and String === act
- assert exp =~ act, msg
+ def assert_match matcher, obj, msg = nil
+ msg = message(msg) { "Expected #{mu_pp matcher} to match #{mu_pp obj}" }
+ assert_respond_to matcher, :"=~"
+ matcher = Regexp.new Regexp.escape matcher if String === matcher
+ assert matcher =~ obj, msg
end
##
@@ -292,11 +311,12 @@ module MiniTest
end
##
- # For testing equality operators and so-forth.
+ # For testing with binary operators.
#
# assert_operator 5, :<=, 4
- def assert_operator o1, op, o2, msg = nil
+ def assert_operator o1, op, o2 = UNDEFINED, msg = nil
+ return assert_predicate o1, op, msg if UNDEFINED == o2
msg = message(msg) { "Expected #{mu_pp(o1)} to be #{op} #{mu_pp(o2)}" }
assert o1.__send__(op, o2), msg
end
@@ -304,7 +324,10 @@ module MiniTest
##
# Fails if stdout or stderr do not output the expected results.
# Pass in nil if you don't care about that streams output. Pass in
- # "" if you require it to be silent.
+ # "" if you require it to be silent. Pass in a regexp if you want
+ # to pattern match.
+ #
+ # NOTE: this uses #capture_io, not #capture_subprocess_io.
#
# See also: #assert_silent
@@ -313,42 +336,60 @@ module MiniTest
yield
end
- x = assert_equal stdout, out, "In stdout" if stdout
- y = assert_equal stderr, err, "In stderr" if stderr
+ err_msg = Regexp === stderr ? :assert_match : :assert_equal if stderr
+ out_msg = Regexp === stdout ? :assert_match : :assert_equal if stdout
+
+ y = send err_msg, stderr, err, "In stderr" if err_msg
+ x = send out_msg, stdout, out, "In stdout" if out_msg
(!stdout || x) && (!stderr || y)
end
##
- # Fails unless the block raises one of +exp+
+ # For testing with predicates.
+ #
+ # assert_predicate str, :empty?
+ #
+ # This is really meant for specs and is front-ended by assert_operator:
+ #
+ # str.must_be :empty?
+
+ def assert_predicate o1, op, msg = nil
+ msg = message(msg) { "Expected #{mu_pp(o1)} to be #{op}" }
+ assert o1.__send__(op), msg
+ end
+
+ ##
+ # Fails unless the block raises one of +exp+. Returns the
+ # exception matched so you can check the message, attributes, etc.
def assert_raises *exp
- msg = "#{exp.pop}\n" if String === exp.last
+ msg = "#{exp.pop}.\n" if String === exp.last
- should_raise = false
begin
yield
- should_raise = true
rescue MiniTest::Skip => e
- details = "#{msg}#{mu_pp(exp)} exception expected, not"
-
- if exp.include? MiniTest::Skip then
- return e
- else
- raise e
- end
+ return e if exp.include? MiniTest::Skip
+ raise e
rescue Exception => e
- details = "#{msg}#{mu_pp(exp)} exception expected, not"
- assert(exp.any? { |ex|
- ex.instance_of?(Module) ? e.kind_of?(ex) : ex == e.class
- }, exception_details(e, details))
+ expected = exp.any? { |ex|
+ if ex.instance_of? Module then
+ e.kind_of? ex
+ else
+ e.instance_of? ex
+ end
+ }
+
+ assert expected, proc {
+ exception_details(e, "#{msg}#{mu_pp(exp)} exception expected, not")
+ }
return e
end
exp = exp.first if exp.size == 1
- flunk "#{msg}#{mu_pp(exp)} expected but nothing was raised." if
- should_raise
+
+ flunk "#{msg}#{mu_pp(exp)} expected but nothing was raised."
end
##
@@ -405,6 +446,8 @@ module MiniTest
catch(sym) do
begin
yield
+ rescue ThreadError => e # wtf?!? 1.8 + threads == suck
+ default += ", not \:#{e.message[/uncaught throw \`(\w+?)\'/, 1]}"
rescue ArgumentError => e # 1.9 exception
default += ", not #{e.message.split(/ /).last}"
rescue NameError => e # 1.8 exception
@@ -420,24 +463,76 @@ module MiniTest
# Captures $stdout and $stderr into strings:
#
# out, err = capture_io do
+ # puts "Some info"
# warn "You did a bad thing"
# end
#
+ # assert_match %r%info%, out
# assert_match %r%bad%, err
+ #
+ # NOTE: For efficiency, this method uses StringIO and does not
+ # capture IO for subprocesses. Use #capture_subprocess_io for
+ # that.
def capture_io
require 'stringio'
- orig_stdout, orig_stderr = $stdout, $stderr
captured_stdout, captured_stderr = StringIO.new, StringIO.new
- $stdout, $stderr = captured_stdout, captured_stderr
- yield
+ synchronize do
+ orig_stdout, orig_stderr = $stdout, $stderr
+ $stdout, $stderr = captured_stdout, captured_stderr
+
+ begin
+ yield
+ ensure
+ $stdout = orig_stdout
+ $stderr = orig_stderr
+ end
+ end
return captured_stdout.string, captured_stderr.string
- ensure
- $stdout = orig_stdout
- $stderr = orig_stderr
+ end
+
+ ##
+ # Captures $stdout and $stderr into strings, using Tempfile to
+ # ensure that subprocess IO is captured as well.
+ #
+ # out, err = capture_subprocess_io do
+ # system "echo Some info"
+ # system "echo You did a bad thing 1>&2"
+ # end
+ #
+ # assert_match %r%info%, out
+ # assert_match %r%bad%, err
+ #
+ # NOTE: This method is approximately 10x slower than #capture_io so
+ # only use it when you need to test the output of a subprocess.
+
+ def capture_subprocess_io
+ require 'tempfile'
+
+ captured_stdout, captured_stderr = Tempfile.new("out"), Tempfile.new("err")
+
+ synchronize do
+ orig_stdout, orig_stderr = $stdout.dup, $stderr.dup
+ $stdout.reopen captured_stdout
+ $stderr.reopen captured_stderr
+
+ begin
+ yield
+
+ $stdout.rewind
+ $stderr.rewind
+
+ [captured_stdout.read, captured_stderr.read]
+ ensure
+ captured_stdout.unlink
+ captured_stderr.unlink
+ $stdout.reopen orig_stdout
+ $stderr.reopen orig_stderr
+ end
+ end
end
##
@@ -491,7 +586,7 @@ module MiniTest
# Fails if +obj+ is empty.
def refute_empty obj, msg = nil
- msg = message(msg) { "Expected #{obj.inspect} to not be empty" }
+ msg = message(msg) { "Expected #{mu_pp(obj)} to not be empty" }
assert_respond_to obj, :empty?
refute obj.empty?, msg
end
@@ -509,14 +604,14 @@ module MiniTest
end
##
- # For comparing Floats. Fails if +exp+ is within +delta+ of +act+
+ # For comparing Floats. Fails if +exp+ is within +delta+ of +act+.
#
# refute_in_delta Math::PI, (22.0 / 7.0)
def refute_in_delta exp, act, delta = 0.001, msg = nil
n = (exp - act).abs
msg = message(msg) {
- "Expected #{exp} - #{act} (#{n}) to not be < #{delta}"
+ "Expected |#{exp} - #{act}| (#{n}) to not be < #{delta}"
}
refute delta > n, msg
end
@@ -530,7 +625,7 @@ module MiniTest
end
##
- # Fails if +collection+ includes +obj+
+ # Fails if +collection+ includes +obj+.
def refute_includes collection, obj, msg = nil
msg = message(msg) {
@@ -541,7 +636,7 @@ module MiniTest
end
##
- # Fails if +obj+ is an instance of +cls+
+ # Fails if +obj+ is an instance of +cls+.
def refute_instance_of cls, obj, msg = nil
msg = message(msg) {
@@ -551,7 +646,7 @@ module MiniTest
end
##
- # Fails if +obj+ is a kind of +cls+
+ # Fails if +obj+ is a kind of +cls+.
def refute_kind_of cls, obj, msg = nil # TODO: merge with instance_of
msg = message(msg) { "Expected #{mu_pp(obj)} to not be a kind of #{cls}" }
@@ -559,13 +654,13 @@ module MiniTest
end
##
- # Fails if +exp+ <tt>=~</tt> +act+
+ # Fails if +matcher+ <tt>=~</tt> +obj+.
- def refute_match exp, act, msg = nil
- msg = message(msg) { "Expected #{mu_pp(exp)} to not match #{mu_pp(act)}" }
- assert_respond_to act, :"=~"
- exp = (/#{Regexp.escape exp}/) if String === exp and String === act
- refute exp =~ act, msg
+ def refute_match matcher, obj, msg = nil
+ msg = message(msg) {"Expected #{mu_pp matcher} to not match #{mu_pp obj}"}
+ assert_respond_to matcher, :"=~"
+ matcher = Regexp.new Regexp.escape matcher if String === matcher
+ refute matcher =~ obj, msg
end
##
@@ -577,19 +672,32 @@ module MiniTest
end
##
- # Fails if +o1+ is not +op+ +o2+ nil. eg:
+ # Fails if +o1+ is not +op+ +o2+. Eg:
#
# refute_operator 1, :>, 2 #=> pass
# refute_operator 1, :<, 2 #=> fail
- def refute_operator o1, op, o2, msg = nil
- msg = message(msg) {
- "Expected #{mu_pp(o1)} to not be #{op} #{mu_pp(o2)}"
- }
+ def refute_operator o1, op, o2 = UNDEFINED, msg = nil
+ return refute_predicate o1, op, msg if UNDEFINED == o2
+ msg = message(msg) { "Expected #{mu_pp(o1)} to not be #{op} #{mu_pp(o2)}"}
refute o1.__send__(op, o2), msg
end
##
+ # For testing with predicates.
+ #
+ # refute_predicate str, :empty?
+ #
+ # This is really meant for specs and is front-ended by refute_operator:
+ #
+ # str.wont_be :empty?
+
+ def refute_predicate o1, op, msg = nil
+ msg = message(msg) { "Expected #{mu_pp(o1)} to not be #{op}" }
+ refute o1.__send__(op), msg
+ end
+
+ ##
# Fails if +obj+ responds to the message +meth+.
def refute_respond_to obj, meth, msg = nil
@@ -617,10 +725,19 @@ module MiniTest
msg ||= "Skipped, no message given"
raise MiniTest::Skip, msg, bt
end
+
+ ##
+ # Takes a block and wraps it with the runner's shared mutex.
+
+ def synchronize
+ Minitest::Unit.runner.synchronize do
+ yield
+ end
+ end
end
- class Unit
- VERSION = "2.2.2" # :nodoc:
+ class Unit # :nodoc:
+ VERSION = "4.3.2" # :nodoc:
attr_accessor :report, :failures, :errors, :skips # :nodoc:
attr_accessor :test_count, :assertion_count # :nodoc:
@@ -629,21 +746,25 @@ module MiniTest
attr_accessor :verbose # :nodoc:
attr_writer :options # :nodoc:
+ ##
+ # Lazy accessor for options.
+
def options
@options ||= {}
end
@@installed_at_exit ||= false
@@out = $stdout
+ @@after_tests = []
##
- # A simple hook allowing you to run a block of code after the
- # tests are done. Eg:
+ # A simple hook allowing you to run a block of code after _all_ of
+ # the tests are done. Eg:
#
# MiniTest::Unit.after_tests { p $debugging_info }
- def self.after_tests
- at_exit { at_exit { yield } }
+ def self.after_tests &block
+ @@after_tests << block
end
##
@@ -651,7 +772,8 @@ module MiniTest
def self.autorun
at_exit {
- next if $! # don't run if there was an exception
+ # don't run if there was a non-exit exception
+ next if $! and not $!.kind_of? SystemExit
# the order here is important. The at_exit handler must be
# installed before anyone else gets a chance to install their
@@ -659,7 +781,10 @@ module MiniTest
# to run (at_exit stacks).
exit_code = nil
- at_exit { exit false if exit_code && exit_code != 0 }
+ at_exit {
+ @@after_tests.reverse_each(&:call)
+ exit false if exit_code && exit_code != 0
+ }
exit_code = MiniTest::Unit.new.run ARGV
} unless @@installed_at_exit
@@ -674,16 +799,6 @@ module MiniTest
end
##
- # Returns the stream to use for output.
- #
- # DEPRECATED: use ::output instead.
-
- def self.out
- warn "::out deprecated, use ::output instead." if $VERBOSE
- output
- end
-
- ##
# Sets MiniTest::Unit to write output to +stream+. $stdout is the default
# output
@@ -717,6 +832,9 @@ module MiniTest
grep(/^run_/).map { |s| s.to_s }).uniq
end
+ ##
+ # Return the IO for output.
+
def output
self.class.output
end
@@ -729,6 +847,9 @@ module MiniTest
output.print(*a)
end
+ ##
+ # Runner for a given +type+ (eg, test vs bench).
+
def _run_anything type
suites = TestCase.send "#{type}_suites"
return if suites.empty?
@@ -766,10 +887,21 @@ module MiniTest
status
end
+ ##
+ # Runs all the +suites+ for a given +type+. Runs suites declaring
+ # a test_order of +:parallel+ in parallel, and everything else
+ # serial.
+
def _run_suites suites, type
- suites.map { |suite| _run_suite suite, type }
+ parallel, serial = suites.partition { |s| s.test_order == :parallel }
+
+ ParallelEach.new(parallel).map { |suite| _run_suite suite, type } +
+ serial.map { |suite| _run_suite suite, type }
end
+ ##
+ # Run a single +suite+ for a given +type+.
+
def _run_suite suite, type
header = "#{type}_suite_header"
puts send(header, suite) if respond_to? header
@@ -783,11 +915,10 @@ module MiniTest
print "#{suite}##{method} = " if @verbose
- @start_time = Time.now
+ start_time = Time.now if @verbose
result = inst.run self
- time = Time.now - @start_time
- print "%.2f s = " % time if @verbose
+ print "%.2f s = " % (Time.now - start_time) if @verbose
print result
puts if @verbose
@@ -797,6 +928,21 @@ module MiniTest
return assertions.size, assertions.inject(0) { |sum, n| sum + n }
end
+ ##
+ # Record the result of a single run. Makes it very easy to gather
+ # information. Eg:
+ #
+ # class StatisticsRecorder < MiniTest::Unit
+ # def record suite, method, assertions, time, error
+ # # ... record the results somewhere ...
+ # end
+ # end
+ #
+ # MiniTest::Unit.runner = StatisticsRecorder.new
+
+ def record suite, method, assertions, time, error
+ end
+
def location e # :nodoc:
last_before_assertion = ""
e.backtrace.reverse_each do |s|
@@ -832,9 +978,14 @@ module MiniTest
@report = []
@errors = @failures = @skips = 0
@verbose = false
+ @mutex = Mutex.new
end
- def process_args args = []
+ def synchronize # :nodoc:
+ @mutex.synchronize { yield }
+ end
+
+ def process_args args = [] # :nodoc:
options = {}
orig_args = args.dup
@@ -855,7 +1006,7 @@ module MiniTest
options[:verbose] = true
end
- opts.on '-n', '--name PATTERN', "Filter test names on pattern." do |a|
+ opts.on '-n', '--name PATTERN', "Filter test names on pattern (e.g. /foo/)" do |a|
options[:filter] = a
end
@@ -918,12 +1069,206 @@ module MiniTest
end
##
+ # Provides a simple set of guards that you can use in your tests
+ # to skip execution if it is not applicable. These methods are
+ # mixed into TestCase as both instance and class methods so you
+ # can use them inside or outside of the test methods.
+ #
+ # def test_something_for_mri
+ # skip "bug 1234" if jruby?
+ # # ...
+ # end
+ #
+ # if windows? then
+ # # ... lots of test methods ...
+ # end
+
+ module Guard
+
+ ##
+ # Is this running on jruby?
+
+ def jruby? platform = RUBY_PLATFORM
+ "java" == platform
+ end
+
+ ##
+ # Is this running on mri?
+
+ def mri? platform = RUBY_DESCRIPTION
+ /^ruby/ =~ platform
+ end
+
+ ##
+ # Is this running on rubinius?
+
+ def rubinius? platform = defined?(RUBY_ENGINE) && RUBY_ENGINE
+ "rbx" == platform
+ end
+
+ ##
+ # Is this running on windows?
+
+ def windows? platform = RUBY_PLATFORM
+ /mswin|mingw/ =~ platform
+ end
+ end
+
+ ##
+ # Provides before/after hooks for setup and teardown. These are
+ # meant for library writers, NOT for regular test authors. See
+ # #before_setup for an example.
+
+ module LifecycleHooks
+ ##
+ # Runs before every test, after setup. This hook is meant for
+ # libraries to extend minitest. It is not meant to be used by
+ # test developers.
+ #
+ # See #before_setup for an example.
+
+ def after_setup; end
+
+ ##
+ # Runs before every test, before setup. This hook is meant for
+ # libraries to extend minitest. It is not meant to be used by
+ # test developers.
+ #
+ # As a simplistic example:
+ #
+ # module MyMinitestPlugin
+ # def before_setup
+ # super
+ # # ... stuff to do before setup is run
+ # end
+ #
+ # def after_setup
+ # # ... stuff to do after setup is run
+ # super
+ # end
+ #
+ # def before_teardown
+ # super
+ # # ... stuff to do before teardown is run
+ # end
+ #
+ # def after_teardown
+ # # ... stuff to do after teardown is run
+ # super
+ # end
+ # end
+ #
+ # class MiniTest::Unit::TestCase
+ # include MyMinitestPlugin
+ # end
+
+ def before_setup; end
+
+ ##
+ # Runs after every test, before teardown. This hook is meant for
+ # libraries to extend minitest. It is not meant to be used by
+ # test developers.
+ #
+ # See #before_setup for an example.
+
+ def before_teardown; end
+
+ ##
+ # Runs after every test, after teardown. This hook is meant for
+ # libraries to extend minitest. It is not meant to be used by
+ # test developers.
+ #
+ # See #before_setup for an example.
+
+ def after_teardown; end
+ end
+
+ module Deprecated # :nodoc:
+
+ ##
+ # This entire module is deprecated and slated for removal on 2013-01-01.
+
+ module Hooks
+ def run_setup_hooks # :nodoc:
+ _run_hooks self.class.setup_hooks
+ end
+
+ def _run_hooks hooks # :nodoc:
+ hooks.each do |hook|
+ if hook.respond_to?(:arity) && hook.arity == 1
+ hook.call(self)
+ else
+ hook.call
+ end
+ end
+ end
+
+ def run_teardown_hooks # :nodoc:
+ _run_hooks self.class.teardown_hooks.reverse
+ end
+ end
+
+ ##
+ # This entire module is deprecated and slated for removal on 2013-01-01.
+
+ module HooksCM
+ ##
+ # Adds a block of code that will be executed before every
+ # TestCase is run.
+ #
+ # NOTE: This method is deprecated, use before/after_setup. It
+ # will be removed on 2013-01-01.
+
+ def add_setup_hook arg=nil, &block
+ warn "NOTE: MiniTest::Unit::TestCase.add_setup_hook is deprecated, use before/after_setup via a module (and call super!). It will be removed on 2013-01-01. Called from #{caller.first}"
+ hook = arg || block
+ @setup_hooks << hook
+ end
+
+ def setup_hooks # :nodoc:
+ if superclass.respond_to? :setup_hooks then
+ superclass.setup_hooks
+ else
+ []
+ end + @setup_hooks
+ end
+
+ ##
+ # Adds a block of code that will be executed after every
+ # TestCase is run.
+ #
+ # NOTE: This method is deprecated, use before/after_teardown. It
+ # will be removed on 2013-01-01.
+
+ def add_teardown_hook arg=nil, &block
+ warn "NOTE: MiniTest::Unit::TestCase#add_teardown_hook is deprecated, use before/after_teardown. It will be removed on 2013-01-01. Called from #{caller.first}"
+ hook = arg || block
+ @teardown_hooks << hook
+ end
+
+ def teardown_hooks # :nodoc:
+ if superclass.respond_to? :teardown_hooks then
+ superclass.teardown_hooks
+ else
+ []
+ end + @teardown_hooks
+ end
+ end
+ end
+
+ ##
# Subclass TestCase to create your own tests. Typically you'll want a
# TestCase subclass per implementation class.
#
# See MiniTest::Assertions
class TestCase
+ include LifecycleHooks
+ include Deprecated::Hooks
+ extend Deprecated::HooksCM # UGH... I can't wait 'til 2013!
+ include Guard
+ extend Guard
+
attr_reader :__name__ # :nodoc:
PASSTHROUGH_EXCEPTIONS = [NoMemoryError, SignalException,
@@ -936,47 +1281,75 @@ module MiniTest
def run runner
trap "INFO" do
+ runner.report.each_with_index do |msg, i|
+ warn "\n%3d) %s" % [i + 1, msg]
+ end
+ warn ''
time = runner.start_time ? Time.now - runner.start_time : 0
- warn "%s#%s %.2fs" % [self.class, self.__name__, time]
+ warn "Current Test: %s#%s %.2fs" % [self.class, self.__name__, time]
runner.status $stderr
end if SUPPORTS_INFO_SIGNAL
+ start_time = Time.now
+
result = ""
begin
@passed = nil
+ self.before_setup
self.setup
- self.__send__ self.__name__
+ self.after_setup
+ self.run_test self.__name__
result = "." unless io?
+ time = Time.now - start_time
+ runner.record self.class, self.__name__, self._assertions, time, nil
@passed = true
rescue *PASSTHROUGH_EXCEPTIONS
raise
rescue Exception => e
@passed = false
+ time = Time.now - start_time
+ runner.record self.class, self.__name__, self._assertions, time, e
result = runner.puke self.class, self.__name__, e
ensure
- begin
- self.teardown
- rescue *PASSTHROUGH_EXCEPTIONS
- raise
- rescue Exception => e
- result = runner.puke self.class, self.__name__, e
+ %w{ before_teardown teardown after_teardown }.each do |hook|
+ begin
+ self.send hook
+ rescue *PASSTHROUGH_EXCEPTIONS
+ raise
+ rescue Exception => e
+ @passed = false
+ result = runner.puke self.class, self.__name__, e
+ end
end
trap 'INFO', 'DEFAULT' if SUPPORTS_INFO_SIGNAL
end
result
end
+ alias :run_test :__send__
+
def initialize name # :nodoc:
@__name__ = name
@__io__ = nil
@passed = nil
+ @@current = self
+ end
+
+ def self.current # :nodoc:
+ @@current
end
+ ##
+ # Return the output IO object
+
def io
@__io__ = true
MiniTest::Unit.output
end
+ ##
+ # Have we hooked up the IO yet?
+
def io?
@__io__
end
@@ -987,16 +1360,51 @@ module MiniTest
reset
- def self.inherited klass # :nodoc:
- @@test_suites[klass] = true
+ ##
+ # Call this at the top of your tests when you absolutely
+ # positively need to have ordered tests. In doing so, you're
+ # admitting that you suck and your tests are weak.
+
+ def self.i_suck_and_my_tests_are_order_dependent!
+ class << self
+ undef_method :test_order if method_defined? :test_order
+ define_method :test_order do :alpha end
+ end
end
##
- # Defines test order and is subclassable. Defaults to :random
- # but can be overridden to return :alpha if your tests are order
- # dependent (read: weak).
+ # Make diffs for this TestCase use #pretty_inspect so that diff
+ # in assert_equal can be more details. NOTE: this is much slower
+ # than the regular inspect but much more usable for complex
+ # objects.
- def self.test_order
+ def self.make_my_diffs_pretty!
+ require 'pp'
+
+ define_method :mu_pp do |o|
+ o.pretty_inspect
+ end
+ end
+
+ ##
+ # Call this at the top of your tests when you want to run your
+ # tests in parallel. In doing so, you're admitting that you rule
+ # and your tests are awesome.
+
+ def self.parallelize_me!
+ class << self
+ undef_method :test_order if method_defined? :test_order
+ define_method :test_order do :parallel end
+ end
+ end
+
+ def self.inherited klass # :nodoc:
+ @@test_suites[klass] = true
+ klass.reset_setup_teardown_hooks
+ super
+ end
+
+ def self.test_order # :nodoc:
:random
end
@@ -1008,6 +1416,9 @@ module MiniTest
methods = public_instance_methods(true).grep(/^test/).map { |m| m.to_s }
case self.test_order
+ when :parallel
+ max = methods.size
+ ParallelEach.new methods.sort.sort_by { rand max }
when :random then
max = methods.size
methods.sort.sort_by { rand max }
@@ -1026,20 +1437,32 @@ module MiniTest
end
##
- # Runs before every test. Use this to refactor test initialization.
+ # Runs before every test. Use this to set up before each test
+ # run.
def setup; end
##
- # Runs after every test. Use this to refactor test cleanup.
+ # Runs after every test. Use this to clean up after each test
+ # run.
def teardown; end
+ def self.reset_setup_teardown_hooks # :nodoc:
+ # also deprecated... believe it.
+ @setup_hooks = []
+ @teardown_hooks = []
+ end
+
+ reset_setup_teardown_hooks
+
include MiniTest::Assertions
end # class TestCase
end # class Unit
end # module MiniTest
+Minitest = MiniTest # :nodoc: because ugh... I typo this all the time
+
if $DEBUG then
module Test # :nodoc:
module Unit # :nodoc:
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 85666ec004..d41e0c3552 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -1,4 +1,4 @@
-# -*- indent-tabs-mode: t -*-
+# -*- coding: us-ascii -*-
# module to create Makefile for extension modules
# invoke like: ruby -r mkmf extconf.rb
@@ -6,1678 +6,1793 @@ require 'rbconfig'
require 'fileutils'
require 'shellwords'
-CONFIG = RbConfig::MAKEFILE_CONFIG
-ORIG_LIBPATH = ENV['LIB']
-
-C_EXT = %w[c m]
-CXX_EXT = %w[cc mm cxx cpp]
-if File::FNM_SYSCASE.zero?
- CXX_EXT.concat(%w[C])
-end
-SRC_EXT = C_EXT + CXX_EXT
-$static = nil
-$config_h = '$(arch_hdrdir)/ruby/config.h'
-$default_static = $static
-
-unless defined? $configure_args
- $configure_args = {}
- args = CONFIG["configure_args"]
- if ENV["CONFIGURE_ARGS"]
- args << " " << ENV["CONFIGURE_ARGS"]
- end
- for arg in Shellwords::shellwords(args)
- arg, val = arg.split('=', 2)
- next unless arg
- arg.tr!('_', '-')
- if arg.sub!(/^(?!--)/, '--')
- val or next
- arg.downcase!
- end
- next if /^--(?:top|topsrc|src|cur)dir$/ =~ arg
- $configure_args[arg] = val || true
- end
- for arg in ARGV
- arg, val = arg.split('=', 2)
- next unless arg
- arg.tr!('_', '-')
- if arg.sub!(/^(?!--)/, '--')
- val or next
- arg.downcase!
- end
- $configure_args[arg] = val || true
- end
-end
-
-$libdir = CONFIG["libdir"]
-$rubylibdir = CONFIG["rubylibdir"]
-$archdir = CONFIG["archdir"]
-$sitedir = CONFIG["sitedir"]
-$sitelibdir = CONFIG["sitelibdir"]
-$sitearchdir = CONFIG["sitearchdir"]
-$vendordir = CONFIG["vendordir"]
-$vendorlibdir = CONFIG["vendorlibdir"]
-$vendorarchdir = CONFIG["vendorarchdir"]
-
-$mswin = /mswin/ =~ RUBY_PLATFORM
-$bccwin = /bccwin/ =~ RUBY_PLATFORM
-$mingw = /mingw/ =~ RUBY_PLATFORM
-$cygwin = /cygwin/ =~ RUBY_PLATFORM
-$netbsd = /netbsd/ =~ RUBY_PLATFORM
-$os2 = /os2/ =~ RUBY_PLATFORM
-$beos = /beos/ =~ RUBY_PLATFORM
-$haiku = /haiku/ =~ RUBY_PLATFORM
-$solaris = /solaris/ =~ RUBY_PLATFORM
-$universal = /universal/ =~ RUBY_PLATFORM
-$dest_prefix_pattern = (File::PATH_SEPARATOR == ';' ? /\A([[:alpha:]]:)?/ : /\A/)
-
# :stopdoc:
-
-def config_string(key, config = CONFIG)
- s = config[key] and !s.empty? and block_given? ? yield(s) : s
-end
-
-def dir_re(dir)
- Regexp.new('\$(?:\('+dir+'\)|\{'+dir+'\})(?:\$(?:\(target_prefix\)|\{target_prefix\}))?')
-end
-
-def relative_from(path, base)
- dir = File.join(path, "")
- if File.expand_path(dir) == File.expand_path(dir, base)
- path
- else
- File.join(base, path)
- end
-end
-
-INSTALL_DIRS = [
- [dir_re('commondir'), "$(RUBYCOMMONDIR)"],
- [dir_re('sitedir'), "$(RUBYCOMMONDIR)"],
- [dir_re('vendordir'), "$(RUBYCOMMONDIR)"],
- [dir_re('rubylibdir'), "$(RUBYLIBDIR)"],
- [dir_re('archdir'), "$(RUBYARCHDIR)"],
- [dir_re('sitelibdir'), "$(RUBYLIBDIR)"],
- [dir_re('vendorlibdir'), "$(RUBYLIBDIR)"],
- [dir_re('sitearchdir'), "$(RUBYARCHDIR)"],
- [dir_re('vendorarchdir'), "$(RUBYARCHDIR)"],
- [dir_re('rubyhdrdir'), "$(RUBYHDRDIR)"],
- [dir_re('sitehdrdir'), "$(SITEHDRDIR)"],
- [dir_re('vendorhdrdir'), "$(VENDORHDRDIR)"],
- [dir_re('bindir'), "$(BINDIR)"],
-]
-
-def install_dirs(target_prefix = nil)
- if $extout
- dirs = [
- ['BINDIR', '$(extout)/bin'],
- ['RUBYCOMMONDIR', '$(extout)/common'],
- ['RUBYLIBDIR', '$(RUBYCOMMONDIR)$(target_prefix)'],
- ['RUBYARCHDIR', '$(extout)/$(arch)$(target_prefix)'],
- ['HDRDIR', '$(extout)/include/ruby$(target_prefix)'],
- ['ARCHHDRDIR', '$(extout)/include/$(arch)/ruby$(target_prefix)'],
- ['extout', "#$extout"],
- ['extout_prefix', "#$extout_prefix"],
- ]
- elsif $extmk
- dirs = [
- ['BINDIR', '$(bindir)'],
- ['RUBYCOMMONDIR', '$(rubylibdir)'],
- ['RUBYLIBDIR', '$(rubylibdir)$(target_prefix)'],
- ['RUBYARCHDIR', '$(archdir)$(target_prefix)'],
- ['HDRDIR', '$(rubyhdrdir)/ruby$(target_prefix)'],
- ['ARCHHDRDIR', '$(rubyhdrdir)/$(arch)/ruby$(target_prefix)'],
- ]
- elsif $configure_args.has_key?('--vendor')
- dirs = [
- ['BINDIR', '$(bindir)'],
- ['RUBYCOMMONDIR', '$(vendordir)$(target_prefix)'],
- ['RUBYLIBDIR', '$(vendorlibdir)$(target_prefix)'],
- ['RUBYARCHDIR', '$(vendorarchdir)$(target_prefix)'],
- ['HDRDIR', '$(rubyhdrdir)/ruby$(target_prefix)'],
- ['ARCHHDRDIR', '$(rubyhdrdir)/$(arch)/ruby$(target_prefix)'],
- ]
- else
- dirs = [
- ['BINDIR', '$(bindir)'],
- ['RUBYCOMMONDIR', '$(sitedir)$(target_prefix)'],
- ['RUBYLIBDIR', '$(sitelibdir)$(target_prefix)'],
- ['RUBYARCHDIR', '$(sitearchdir)$(target_prefix)'],
- ['HDRDIR', '$(rubyhdrdir)/ruby$(target_prefix)'],
- ['ARCHHDRDIR', '$(rubyhdrdir)/$(arch)/ruby$(target_prefix)'],
- ]
- end
- dirs << ['target_prefix', (target_prefix ? "/#{target_prefix}" : "")]
- dirs
-end
-
-def map_dir(dir, map = nil)
- map ||= INSTALL_DIRS
- map.inject(dir) {|d, (orig, new)| d.gsub(orig, new)}
-end
-
-topdir = File.dirname(File.dirname(__FILE__))
-path = File.expand_path($0)
-$extmk = path[0, topdir.size+1] == topdir+"/"
-$extmk &&= %r"\A(?:ext|enc|tool|test(?:/.+)?)\z" =~ File.dirname(path[topdir.size+1..-1])
-$extmk &&= true
-if not $extmk and File.exist?(($hdrdir = RbConfig::CONFIG["rubyhdrdir"]) + "/ruby/ruby.h")
- $topdir = $hdrdir
- $top_srcdir = $hdrdir
- $arch_hdrdir = $hdrdir + "/$(arch)"
-elsif File.exist?(($hdrdir = ($top_srcdir ||= topdir) + "/include") + "/ruby.h")
- $topdir ||= RbConfig::CONFIG["topdir"]
- $arch_hdrdir = "$(extout)/include/$(arch)"
-else
- abort "mkmf.rb can't find header files for ruby at #{$hdrdir}/ruby.h"
-end
-
-OUTFLAG = CONFIG['OUTFLAG']
-COUTFLAG = CONFIG['COUTFLAG']
-CPPOUTFILE = CONFIG['CPPOUTFILE']
-
-CONFTEST_C = "conftest.c".freeze
-
class String
# Wraps a string in escaped quotes if it contains whitespace.
def quote
/\s/ =~ self ? "\"#{self}\"" : "#{self}"
end
+ # Escape whitespaces for Makefile.
+ def unspace
+ gsub(/\s/, '\\\\\\&')
+ end
+
# Generates a string used as cpp macro name.
def tr_cpp
strip.upcase.tr_s("^A-Z0-9_*", "_").tr_s("*", "P")
end
+
+ def funcall_style
+ /\)\z/ =~ self ? dup : "#{self}()"
+ end
+
+ def sans_arguments
+ self[/\A[^()]+/]
+ end
end
+
class Array
# Wraps all strings in escaped quotes if they contain whitespace.
def quote
map {|s| s.quote}
end
end
+# :startdoc:
-def rm_f(*files)
- opt = (Hash === files.last ? [files.pop] : [])
- FileUtils.rm_f(Dir[*files.flatten], *opt)
-end
+##
+# mkmf.rb is used by ruby C extensions to generate a Makefile which will
+# correctly compile and link the C extension to ruby and a third-party
+# library.
+module MakeMakefile
+
+ CONFIG = RbConfig::MAKEFILE_CONFIG
+ ORIG_LIBPATH = ENV['LIB']
+
+ C_EXT = %w[c m]
+ CXX_EXT = %w[cc mm cxx cpp]
+ if File::FNM_SYSCASE.zero?
+ CXX_EXT.concat(%w[C])
+ end
+ SRC_EXT = C_EXT + CXX_EXT
+ HDR_EXT = %w[h hpp]
+ $static = nil
+ $config_h = '$(arch_hdrdir)/ruby/config.h'
+ $default_static = $static
+
+ unless defined? $configure_args
+ $configure_args = {}
+ args = CONFIG["configure_args"]
+ if ENV["CONFIGURE_ARGS"]
+ args << " " << ENV["CONFIGURE_ARGS"]
+ end
+ for arg in Shellwords::shellwords(args)
+ arg, val = arg.split('=', 2)
+ next unless arg
+ arg.tr!('_', '-')
+ if arg.sub!(/^(?!--)/, '--')
+ val or next
+ arg.downcase!
+ end
+ next if /^--(?:top|topsrc|src|cur)dir$/ =~ arg
+ $configure_args[arg] = val || true
+ end
+ for arg in ARGV
+ arg, val = arg.split('=', 2)
+ next unless arg
+ arg.tr!('_', '-')
+ if arg.sub!(/^(?!--)/, '--')
+ val or next
+ arg.downcase!
+ end
+ $configure_args[arg] = val || true
+ end
+ end
-def rm_rf(*files)
- opt = (Hash === files.last ? [files.pop] : [])
- FileUtils.rm_rf(Dir[*files.flatten], *opt)
-end
+ $libdir = CONFIG["libdir"]
+ $rubylibdir = CONFIG["rubylibdir"]
+ $archdir = CONFIG["archdir"]
+ $sitedir = CONFIG["sitedir"]
+ $sitelibdir = CONFIG["sitelibdir"]
+ $sitearchdir = CONFIG["sitearchdir"]
+ $vendordir = CONFIG["vendordir"]
+ $vendorlibdir = CONFIG["vendorlibdir"]
+ $vendorarchdir = CONFIG["vendorarchdir"]
-# Returns time stamp of the +target+ file if it exists and is newer
-# than or equal to all of +times+.
-def modified?(target, times)
- (t = File.mtime(target)) rescue return nil
- Array === times or times = [times]
- t if times.all? {|n| n <= t}
-end
+ $mswin = /mswin/ =~ RUBY_PLATFORM
+ $bccwin = /bccwin/ =~ RUBY_PLATFORM
+ $mingw = /mingw/ =~ RUBY_PLATFORM
+ $cygwin = /cygwin/ =~ RUBY_PLATFORM
+ $netbsd = /netbsd/ =~ RUBY_PLATFORM
+ $os2 = /os2/ =~ RUBY_PLATFORM
+ $beos = /beos/ =~ RUBY_PLATFORM
+ $haiku = /haiku/ =~ RUBY_PLATFORM
+ $solaris = /solaris/ =~ RUBY_PLATFORM
+ $universal = /universal/ =~ RUBY_PLATFORM
+ $dest_prefix_pattern = (File::PATH_SEPARATOR == ';' ? /\A([[:alpha:]]:)?/ : /\A/)
-def merge_libs(*libs)
- libs.inject([]) do |x, y|
- xy = x & y
- xn = yn = 0
- y = y.inject([]) {|ary, e| ary.last == e ? ary : ary << e}
- y.each_with_index do |v, yi|
- if xy.include?(v)
- xi = [x.index(v), xn].max()
- x[xi, 1] = y[yn..yi]
- xn, yn = xi + (yi - yn + 1), yi + 1
- end
+ # :stopdoc:
+
+ def config_string(key, config = CONFIG)
+ s = config[key] and !s.empty? and block_given? ? yield(s) : s
+ end
+ module_function :config_string
+
+ def dir_re(dir)
+ Regexp.new('\$(?:\('+dir+'\)|\{'+dir+'\})(?:\$(?:\(target_prefix\)|\{target_prefix\}))?')
+ end
+ module_function :dir_re
+
+ def relative_from(path, base)
+ dir = File.join(path, "")
+ if File.expand_path(dir) == File.expand_path(dir, base)
+ path
+ else
+ File.join(base, path)
end
- x.concat(y[yn..-1] || [])
end
-end
-# This is a custom logging module. It generates an mkmf.log file when you
-# run your extconf.rb script. This can be useful for debugging unexpected
-# failures.
-#
-# This module and its associated methods are meant for internal use only.
-#
-module Logging
- @log = nil
- @logfile = 'mkmf.log'
- @orgerr = $stderr.dup
- @orgout = $stdout.dup
- @postpone = 0
- @quiet = $extmk
-
- def self::log_open
- @log ||= File::open(@logfile, 'wb')
- @log.sync = true
- end
-
- def self::open
- log_open
- $stderr.reopen(@log)
- $stdout.reopen(@log)
- yield
- ensure
- $stderr.reopen(@orgerr)
- $stdout.reopen(@orgout)
+ INSTALL_DIRS = [
+ [dir_re('commondir'), "$(RUBYCOMMONDIR)"],
+ [dir_re('sitedir'), "$(RUBYCOMMONDIR)"],
+ [dir_re('vendordir'), "$(RUBYCOMMONDIR)"],
+ [dir_re('rubylibdir'), "$(RUBYLIBDIR)"],
+ [dir_re('archdir'), "$(RUBYARCHDIR)"],
+ [dir_re('sitelibdir'), "$(RUBYLIBDIR)"],
+ [dir_re('vendorlibdir'), "$(RUBYLIBDIR)"],
+ [dir_re('sitearchdir'), "$(RUBYARCHDIR)"],
+ [dir_re('vendorarchdir'), "$(RUBYARCHDIR)"],
+ [dir_re('rubyhdrdir'), "$(RUBYHDRDIR)"],
+ [dir_re('sitehdrdir'), "$(SITEHDRDIR)"],
+ [dir_re('vendorhdrdir'), "$(VENDORHDRDIR)"],
+ [dir_re('bindir'), "$(BINDIR)"],
+ ]
+
+ def install_dirs(target_prefix = nil)
+ if $extout
+ dirs = [
+ ['BINDIR', '$(extout)/bin'],
+ ['RUBYCOMMONDIR', '$(extout)/common'],
+ ['RUBYLIBDIR', '$(RUBYCOMMONDIR)$(target_prefix)'],
+ ['RUBYARCHDIR', '$(extout)/$(arch)$(target_prefix)'],
+ ['HDRDIR', '$(extout)/include/ruby$(target_prefix)'],
+ ['ARCHHDRDIR', '$(extout)/include/$(arch)/ruby$(target_prefix)'],
+ ['extout', "#$extout"],
+ ['extout_prefix', "#$extout_prefix"],
+ ]
+ elsif $extmk
+ dirs = [
+ ['BINDIR', '$(bindir)'],
+ ['RUBYCOMMONDIR', '$(rubylibdir)'],
+ ['RUBYLIBDIR', '$(rubylibdir)$(target_prefix)'],
+ ['RUBYARCHDIR', '$(archdir)$(target_prefix)'],
+ ['HDRDIR', '$(rubyhdrdir)/ruby$(target_prefix)'],
+ ['ARCHHDRDIR', '$(rubyhdrdir)/$(arch)/ruby$(target_prefix)'],
+ ]
+ elsif $configure_args.has_key?('--vendor')
+ dirs = [
+ ['BINDIR', '$(bindir)'],
+ ['RUBYCOMMONDIR', '$(vendordir)$(target_prefix)'],
+ ['RUBYLIBDIR', '$(vendorlibdir)$(target_prefix)'],
+ ['RUBYARCHDIR', '$(vendorarchdir)$(target_prefix)'],
+ ['HDRDIR', '$(rubyhdrdir)/ruby$(target_prefix)'],
+ ['ARCHHDRDIR', '$(rubyhdrdir)/$(arch)/ruby$(target_prefix)'],
+ ]
+ else
+ dirs = [
+ ['BINDIR', '$(bindir)'],
+ ['RUBYCOMMONDIR', '$(sitedir)$(target_prefix)'],
+ ['RUBYLIBDIR', '$(sitelibdir)$(target_prefix)'],
+ ['RUBYARCHDIR', '$(sitearchdir)$(target_prefix)'],
+ ['HDRDIR', '$(rubyhdrdir)/ruby$(target_prefix)'],
+ ['ARCHHDRDIR', '$(rubyhdrdir)/$(arch)/ruby$(target_prefix)'],
+ ]
+ end
+ dirs << ['target_prefix', (target_prefix ? "/#{target_prefix}" : "")]
+ dirs
+ end
+
+ def map_dir(dir, map = nil)
+ map ||= INSTALL_DIRS
+ map.inject(dir) {|d, (orig, new)| d.gsub(orig, new)}
+ end
+
+ topdir = File.dirname(File.dirname(__FILE__))
+ path = File.expand_path($0)
+ $extmk = path[0, topdir.size+1] == topdir+"/"
+ $extmk &&= %r"\A(?:ext|enc|tool|test(?:/.+)?)\z" =~ File.dirname(path[topdir.size+1..-1])
+ $extmk &&= true
+ if not $extmk and File.exist?(RbConfig::CONFIG["rubyhdrdir"] + "/ruby/ruby.h")
+ $hdrdir = CONFIG["rubyhdrdir"]
+ $topdir = $hdrdir
+ $top_srcdir = $hdrdir
+ $arch_hdrdir = "$(hdrdir)/$(arch)"
+ elsif File.exist?(($hdrdir = ($top_srcdir ||= topdir) + "/include") + "/ruby.h")
+ $topdir ||= RbConfig::CONFIG["topdir"]
+ $arch_hdrdir = "$(extout)/include/$(arch)"
+ else
+ abort "mkmf.rb can't find header files for ruby at #{$hdrdir}/ruby.h"
end
- def self::message(*s)
- log_open
- @log.printf(*s)
+ OUTFLAG = CONFIG['OUTFLAG']
+ COUTFLAG = CONFIG['COUTFLAG']
+ CPPOUTFILE = CONFIG['CPPOUTFILE']
+
+ CONFTEST_C = "conftest.c".freeze
+
+ def rm_f(*files)
+ opt = (Hash === files.last ? [files.pop] : [])
+ FileUtils.rm_f(Dir[*files.flatten], *opt)
end
+ module_function :rm_f
- def self::logfile file
- @logfile = file
- log_close
+ def rm_rf(*files)
+ opt = (Hash === files.last ? [files.pop] : [])
+ FileUtils.rm_rf(Dir[*files.flatten], *opt)
end
+ module_function :rm_rf
- def self::log_close
- if @log and not @log.closed?
- @log.flush
- @log.close
- @log = nil
- end
+ # Returns time stamp of the +target+ file if it exists and is newer than or
+ # equal to all of +times+.
+ def modified?(target, times)
+ (t = File.mtime(target)) rescue return nil
+ Array === times or times = [times]
+ t if times.all? {|n| n <= t}
end
- def self::postpone
- tmplog = "mkmftmp#{@postpone += 1}.log"
- open do
- log, *save = @log, @logfile, @orgout, @orgerr
- @log, @logfile, @orgout, @orgerr = nil, tmplog, log, log
- begin
- log.print(open {yield @log})
- ensure
- @log.close if @log and not @log.closed?
- File::open(tmplog) {|t| FileUtils.copy_stream(t, log)} if File.exist?(tmplog)
- @log, @logfile, @orgout, @orgerr = log, *save
- @postpone -= 1
- rm_f tmplog
+ def split_libs(*strs)
+ strs.map {|s| s.split(/\s+(?=-|\z)/)}.flatten
+ end
+
+ def merge_libs(*libs)
+ libs.inject([]) do |x, y|
+ xy = x & y
+ xn = yn = 0
+ y = y.inject([]) {|ary, e| ary.last == e ? ary : ary << e}
+ y.each_with_index do |v, yi|
+ if xy.include?(v)
+ xi = [x.index(v), xn].max()
+ x[xi, 1] = y[yn..yi]
+ xn, yn = xi + (yi - yn + 1), yi + 1
+ end
end
+ x.concat(y[yn..-1] || [])
end
end
- class << self
- attr_accessor :quiet
+ # This is a custom logging module. It generates an mkmf.log file when you
+ # run your extconf.rb script. This can be useful for debugging unexpected
+ # failures.
+ #
+ # This module and its associated methods are meant for internal use only.
+ #
+ module Logging
+ @log = nil
+ @logfile = 'mkmf.log'
+ @orgerr = $stderr.dup
+ @orgout = $stdout.dup
+ @postpone = 0
+ @quiet = $extmk
+
+ def self::log_open
+ @log ||= File::open(@logfile, 'wb')
+ @log.sync = true
+ end
+
+ def self::open
+ log_open
+ $stderr.reopen(@log)
+ $stdout.reopen(@log)
+ yield
+ ensure
+ $stderr.reopen(@orgerr)
+ $stdout.reopen(@orgout)
+ end
+
+ def self::message(*s)
+ log_open
+ @log.printf(*s)
+ end
+
+ def self::logfile file
+ @logfile = file
+ log_close
+ end
+
+ def self::log_close
+ if @log and not @log.closed?
+ @log.flush
+ @log.close
+ @log = nil
+ end
+ end
+
+ def self::postpone
+ tmplog = "mkmftmp#{@postpone += 1}.log"
+ open do
+ log, *save = @log, @logfile, @orgout, @orgerr
+ @log, @logfile, @orgout, @orgerr = nil, tmplog, log, log
+ begin
+ log.print(open {yield @log})
+ ensure
+ @log.close if @log and not @log.closed?
+ File::open(tmplog) {|t| FileUtils.copy_stream(t, log)} if File.exist?(tmplog)
+ @log, @logfile, @orgout, @orgerr = log, *save
+ @postpone -= 1
+ MakeMakefile.rm_f tmplog
+ end
+ end
+ end
+
+ class << self
+ attr_accessor :quiet
+ end
end
-end
-def xsystem command, opts = nil
- varpat = /\$\((\w+)\)|\$\{(\w+)\}/
- if varpat =~ command
- vars = Hash.new {|h, k| h[k] = ''; ENV[k]}
- command = command.dup
- nil while command.gsub!(varpat) {vars[$1||$2]}
- end
- Logging::open do
- puts command.quote
- if opts and opts[:werror]
- result = nil
- Logging.postpone do |log|
- result = (system(command) and File.zero?(log.path))
- ""
+ def xsystem command, opts = nil
+ varpat = /\$\((\w+)\)|\$\{(\w+)\}/
+ if varpat =~ command
+ vars = Hash.new {|h, k| h[k] = ''; ENV[k]}
+ command = command.dup
+ nil while command.gsub!(varpat) {vars[$1||$2]}
+ end
+ Logging::open do
+ puts command.quote
+ if opts and opts[:werror]
+ result = nil
+ Logging.postpone do |log|
+ result = (system(command) and File.zero?(log.path))
+ ""
+ end
+ result
+ else
+ system(command)
end
- result
- else
- system(command)
end
end
-end
-def xpopen command, *mode, &block
- Logging::open do
- case mode[0]
- when nil, /^r/
- puts "#{command} |"
- else
- puts "| #{command}"
+ def xpopen command, *mode, &block
+ Logging::open do
+ case mode[0]
+ when nil, /^r/
+ puts "#{command} |"
+ else
+ puts "| #{command}"
+ end
+ IO.popen(command, *mode, &block)
end
- IO.popen(command, *mode, &block)
end
-end
-def log_src(src)
- src = src.split(/^/)
- fmt = "%#{src.size.to_s.size}d: %s"
- Logging::message <<"EOM"
-checked program was:
+ def log_src(src, heading="checked program was")
+ src = src.split(/^/)
+ fmt = "%#{src.size.to_s.size}d: %s"
+ Logging::message <<"EOM"
+#{heading}:
/* begin */
EOM
- src.each_with_index {|line, no| Logging::message fmt, no+1, line}
- Logging::message <<"EOM"
+ src.each_with_index {|line, no| Logging::message fmt, no+1, line}
+ Logging::message <<"EOM"
/* end */
EOM
-end
+ end
-def create_tmpsrc(src)
- src = "#{COMMON_HEADERS}\n#{src}"
- src = yield(src) if block_given?
- src.gsub!(/[ \t]+$/, '')
- src.gsub!(/\A\n+|^\n+$/, '')
- src.sub!(/[^\n]\z/, "\\&\n")
- count = 0
- begin
- open(CONFTEST_C, "wb") do |cfile|
- cfile.print src
- end
- rescue Errno::EACCES
- if (count += 1) < 5
- sleep 0.2
- retry
+ def create_tmpsrc(src)
+ src = "#{COMMON_HEADERS}\n#{src}"
+ src = yield(src) if block_given?
+ src.gsub!(/[ \t]+$/, '')
+ src.gsub!(/\A\n+|^\n+$/, '')
+ src.sub!(/[^\n]\z/, "\\&\n")
+ count = 0
+ begin
+ open(CONFTEST_C, "wb") do |cfile|
+ cfile.print src
+ end
+ rescue Errno::EACCES
+ if (count += 1) < 5
+ sleep 0.2
+ retry
+ end
end
+ src
end
- src
-end
-def have_devel?
- unless defined? $have_devel
- $have_devel = true
- $have_devel = try_link(MAIN_DOES_NOTHING)
+ def have_devel?
+ unless defined? $have_devel
+ $have_devel = true
+ $have_devel = try_link(MAIN_DOES_NOTHING)
+ end
+ $have_devel
end
- $have_devel
-end
-def try_do(src, command, *opts, &b)
- unless have_devel?
- raise <<MSG
+ def try_do(src, command, *opts, &b)
+ unless have_devel?
+ raise <<MSG
The compiler failed to generate an executable file.
You have to install development tools first.
MSG
+ end
+ begin
+ src = create_tmpsrc(src, &b)
+ xsystem(command, *opts)
+ ensure
+ log_src(src)
+ MakeMakefile.rm_rf 'conftest.dSYM'
+ end
end
- begin
- src = create_tmpsrc(src, &b)
- xsystem(command, *opts)
- ensure
- log_src(src)
- rm_rf 'conftest.dSYM'
- end
-end
-
-def link_command(ldflags, opt="", libpath=$DEFLIBPATH|$LIBPATH)
- conf = RbConfig::CONFIG.merge('hdrdir' => $hdrdir.quote,
- 'src' => "#{CONFTEST_C}",
- 'arch_hdrdir' => $arch_hdrdir.quote,
- 'top_srcdir' => $top_srcdir.quote,
- 'INCFLAGS' => "#$INCFLAGS",
- 'CPPFLAGS' => "#$CPPFLAGS",
- 'CFLAGS' => "#$CFLAGS",
- 'ARCH_FLAG' => "#$ARCH_FLAG",
- 'LDFLAGS' => "#$LDFLAGS #{ldflags}",
- 'LOCAL_LIBS' => "#$LOCAL_LIBS #$libs",
- 'LIBS' => "#$LIBRUBYARG_STATIC #{opt} #$LIBS")
- conf['LIBPATH'] = libpathflag(libpath.map {|s| RbConfig::expand(s.dup, conf)})
- RbConfig::expand(TRY_LINK.dup, conf)
-end
-def cc_command(opt="")
- conf = RbConfig::CONFIG.merge('hdrdir' => $hdrdir.quote, 'srcdir' => $srcdir.quote,
- 'arch_hdrdir' => $arch_hdrdir.quote,
- 'top_srcdir' => $top_srcdir.quote)
- RbConfig::expand("$(CC) #$INCFLAGS #$CPPFLAGS #$CFLAGS #$ARCH_FLAG #{opt} -c #{CONFTEST_C}",
- conf)
-end
+ def link_command(ldflags, opt="", libpath=$DEFLIBPATH|$LIBPATH)
+ librubyarg = $extmk ? $LIBRUBYARG_STATIC : "$(LIBRUBYARG)"
+ conf = RbConfig::CONFIG.merge('hdrdir' => $hdrdir.quote,
+ 'src' => "#{CONFTEST_C}",
+ 'arch_hdrdir' => $arch_hdrdir.quote,
+ 'top_srcdir' => $top_srcdir.quote,
+ 'INCFLAGS' => "#$INCFLAGS",
+ 'CPPFLAGS' => "#$CPPFLAGS",
+ 'CFLAGS' => "#$CFLAGS",
+ 'ARCH_FLAG' => "#$ARCH_FLAG",
+ 'LDFLAGS' => "#$LDFLAGS #{ldflags}",
+ 'LOCAL_LIBS' => "#$LOCAL_LIBS #$libs",
+ 'LIBS' => "#{librubyarg} #{opt} #$LIBS")
+ conf['LIBPATH'] = libpathflag(libpath.map {|s| RbConfig::expand(s.dup, conf)})
+ RbConfig::expand(TRY_LINK.dup, conf)
+ end
+
+ def cc_command(opt="")
+ conf = RbConfig::CONFIG.merge('hdrdir' => $hdrdir.quote, 'srcdir' => $srcdir.quote,
+ 'arch_hdrdir' => $arch_hdrdir.quote,
+ 'top_srcdir' => $top_srcdir.quote)
+ RbConfig::expand("$(CC) #$INCFLAGS #$CPPFLAGS #$CFLAGS #$ARCH_FLAG #{opt} -c #{CONFTEST_C}",
+ conf)
+ end
+
+ def cpp_command(outfile, opt="")
+ conf = RbConfig::CONFIG.merge('hdrdir' => $hdrdir.quote, 'srcdir' => $srcdir.quote,
+ 'arch_hdrdir' => $arch_hdrdir.quote,
+ 'top_srcdir' => $top_srcdir.quote)
+ if $universal and (arch_flag = conf['ARCH_FLAG']) and !arch_flag.empty?
+ conf['ARCH_FLAG'] = arch_flag.gsub(/(?:\G|\s)-arch\s+\S+/, '')
+ end
+ RbConfig::expand("$(CPP) #$INCFLAGS #$CPPFLAGS #$CFLAGS #{opt} #{CONFTEST_C} #{outfile}",
+ conf)
+ end
-def cpp_command(outfile, opt="")
- conf = RbConfig::CONFIG.merge('hdrdir' => $hdrdir.quote, 'srcdir' => $srcdir.quote,
- 'arch_hdrdir' => $arch_hdrdir.quote,
- 'top_srcdir' => $top_srcdir.quote)
- RbConfig::expand("$(CPP) #$INCFLAGS #$CPPFLAGS #$CFLAGS #{opt} #{CONFTEST_C} #{outfile}",
- conf)
-end
+ def libpathflag(libpath=$DEFLIBPATH|$LIBPATH)
+ libpath.map{|x|
+ case x
+ when "$(topdir)", /\A\./
+ LIBPATHFLAG
+ else
+ LIBPATHFLAG+RPATHFLAG
+ end % x.quote
+ }.join
+ end
-def libpathflag(libpath=$DEFLIBPATH|$LIBPATH)
- libpath.map{|x|
- case x
- when "$(topdir)", /\A\./
- LIBPATHFLAG
+ def with_werror(opt, opts = nil)
+ if opts
+ if opts[:werror] and config_string("WERRORFLAG") {|flag| opt = opt ? "#{opt} #{flag}" : flag}
+ (opts = opts.dup).delete(:werror)
+ end
+ yield(opt, opts)
else
- LIBPATHFLAG+RPATHFLAG
- end % x.quote
- }.join
-end
-
-def with_werror(opt, opts = nil)
- if opts
- if opts[:werror] and config_string("WERRORFLAG") {|flag| opt = opt ? "#{opt} #{flag}" : flag}
- (opts = opts.dup).delete(:werror)
+ yield(opt)
end
- yield(opt, opts)
- else
- yield(opt)
end
-end
-# :nodoc:
-def try_link0(src, opt="", *opts, &b)
- cmd = link_command("", opt)
- if $universal
- require 'tmpdir'
- Dir.mktmpdir("mkmf_", oldtmpdir = ENV["TMPDIR"]) do |tmpdir|
- begin
- ENV["TMPDIR"] = tmpdir
- try_do(src, cmd, *opts, &b)
- ensure
- ENV["TMPDIR"] = oldtmpdir
+ def try_link0(src, opt="", *opts, &b) # :nodoc:
+ cmd = link_command("", opt)
+ if $universal
+ require 'tmpdir'
+ Dir.mktmpdir("mkmf_", oldtmpdir = ENV["TMPDIR"]) do |tmpdir|
+ begin
+ ENV["TMPDIR"] = tmpdir
+ try_do(src, cmd, *opts, &b)
+ ensure
+ ENV["TMPDIR"] = oldtmpdir
+ end
end
- end
- else
- try_do(src, cmd, *opts, &b)
+ else
+ try_do(src, cmd, *opts, &b)
+ end and File.executable?("conftest#{$EXEEXT}")
+ end
+
+ # Returns whether or not the +src+ can be compiled as a C source and linked
+ # with its depending libraries successfully. +opt+ is passed to the linker
+ # as options. Note that +$CFLAGS+ and +$LDFLAGS+ are also passed to the
+ # linker.
+ #
+ # If a block given, it is called with the source before compilation. You can
+ # modify the source in the block.
+ #
+ # [+src+] a String which contains a C source
+ # [+opt+] a String which contains linker options
+ def try_link(src, opt="", *opts, &b)
+ try_link0(src, opt, *opts, &b)
+ ensure
+ MakeMakefile.rm_f "conftest*", "c0x32*"
+ end
+
+ # Returns whether or not the +src+ can be compiled as a C source. +opt+ is
+ # passed to the C compiler as options. Note that +$CFLAGS+ is also passed to
+ # the compiler.
+ #
+ # If a block given, it is called with the source before compilation. You can
+ # modify the source in the block.
+ #
+ # [+src+] a String which contains a C source
+ # [+opt+] a String which contains compiler options
+ def try_compile(src, opt="", *opts, &b)
+ with_werror(opt, *opts) {|_opt, *_opts| try_do(src, cc_command(_opt), *_opts, &b)} and
+ File.file?("conftest.#{$OBJEXT}")
+ ensure
+ MakeMakefile.rm_f "conftest*"
+ end
+
+ # Returns whether or not the +src+ can be preprocessed with the C
+ # preprocessor. +opt+ is passed to the preprocessor as options. Note that
+ # +$CFLAGS+ is also passed to the preprocessor.
+ #
+ # If a block given, it is called with the source before preprocessing. You
+ # can modify the source in the block.
+ #
+ # [+src+] a String which contains a C source
+ # [+opt+] a String which contains preprocessor options
+ def try_cpp(src, opt="", *opts, &b)
+ try_do(src, cpp_command(CPPOUTFILE, opt), *opts, &b) and
+ File.file?("conftest.i")
+ ensure
+ MakeMakefile.rm_f "conftest*"
end
-end
-# Returns whether or not the +src+ can be compiled as a C source and
-# linked with its depending libraries successfully.
-# +opt+ is passed to the linker as options. Note that +$CFLAGS+ and +$LDFLAGS+
-# are also passed to the linker.
-#
-# If a block given, it is called with the source before compilation. You can
-# modify the source in the block.
-#
-# [+src+] a String which contains a C source
-# [+opt+] a String which contains linker options
-def try_link(src, opt="", *opts, &b)
- try_link0(src, opt, *opts, &b)
-ensure
- rm_f "conftest*", "c0x32*"
-end
+ alias_method :try_header, (config_string('try_header') || :try_cpp)
-# Returns whether or not the +src+ can be compiled as a C source.
-# +opt+ is passed to the C compiler as options. Note that +$CFLAGS+ is
-# also passed to the compiler.
-#
-# If a block given, it is called with the source before compilation. You can
-# modify the source in the block.
-#
-# [+src+] a String which contains a C source
-# [+opt+] a String which contains compiler options
-def try_compile(src, opt="", *opts, &b)
- with_werror(opt, *opts) {|_opt, *_opts| try_do(src, cc_command(_opt), *_opts, &b)}
-ensure
- rm_f "conftest*"
-end
+ def cpp_include(header)
+ if header
+ header = [header] unless header.kind_of? Array
+ header.map {|h| String === h ? "#include <#{h}>\n" : h}.join
+ else
+ ""
+ end
+ end
-# Returns whether or not the +src+ can be preprocessed with the C preprocessor.
-# +opt+ is passed to the preprocessor as options. Note that +$CFLAGS+ is
-# also passed to the preprocessor.
-#
-# If a block given, it is called with the source before preprocessing. You can
-# modify the source in the block.
-#
-# [+src+] a String which contains a C source
-# [+opt+] a String which contains preprocessor options
-def try_cpp(src, opt="", *opts, &b)
- try_do(src, cpp_command(CPPOUTFILE, opt), *opts, &b)
-ensure
- rm_f "conftest*"
-end
+ def with_cppflags(flags)
+ cppflags = $CPPFLAGS
+ $CPPFLAGS = flags
+ ret = yield
+ ensure
+ $CPPFLAGS = cppflags unless ret
+ end
-class Object
- alias_method :try_header, (config_string('try_header') || :try_cpp)
-end
+ def try_cppflags(flags)
+ with_cppflags(flags) do
+ try_header("int main() {return 0;}")
+ end
+ end
-def cpp_include(header)
- if header
- header = [header] unless header.kind_of? Array
- header.map {|h| String === h ? "#include <#{h}>\n" : h}.join
- else
- ""
+ def with_cflags(flags)
+ cflags = $CFLAGS
+ $CFLAGS = flags
+ ret = yield
+ ensure
+ $CFLAGS = cflags unless ret
end
-end
-def with_cppflags(flags)
- cppflags = $CPPFLAGS
- $CPPFLAGS = flags
- ret = yield
-ensure
- $CPPFLAGS = cppflags unless ret
-end
+ def try_cflags(flags)
+ with_cflags(flags) do
+ try_compile("int main() {return 0;}")
+ end
+ end
-def with_cflags(flags)
- cflags = $CFLAGS
- $CFLAGS = flags
- ret = yield
-ensure
- $CFLAGS = cflags unless ret
-end
+ def with_ldflags(flags)
+ ldflags = $LDFLAGS
+ $LDFLAGS = flags
+ ret = yield
+ ensure
+ $LDFLAGS = ldflags unless ret
+ end
-def with_ldflags(flags)
- ldflags = $LDFLAGS
- $LDFLAGS = flags
- ret = yield
-ensure
- $LDFLAGS = ldflags unless ret
-end
+ def try_ldflags(flags)
+ with_ldflags(flags) do
+ try_link("int main() {return 0;}")
+ end
+ end
-def try_static_assert(expr, headers = nil, opt = "", &b)
- headers = cpp_include(headers)
- try_compile(<<SRC, opt, &b)
+ def try_static_assert(expr, headers = nil, opt = "", &b)
+ headers = cpp_include(headers)
+ try_compile(<<SRC, opt, &b)
#{headers}
/*top*/
int conftest_const[(#{expr}) ? 1 : -1];
SRC
-end
+ end
-def try_constant(const, headers = nil, opt = "", &b)
- includes = cpp_include(headers)
- if CROSS_COMPILING
- if try_static_assert("#{const} > 0", headers, opt)
- # positive constant
- elsif try_static_assert("#{const} < 0", headers, opt)
- neg = true
- const = "-(#{const})"
- elsif try_static_assert("#{const} == 0", headers, opt)
- return 0
- else
- # not a constant
- return nil
- end
- upper = 1
- lower = 0
- until try_static_assert("#{const} <= #{upper}", headers, opt)
- lower = upper
- upper <<= 1
- end
- return nil unless lower
- while upper > lower + 1
- mid = (upper + lower) / 2
- if try_static_assert("#{const} > #{mid}", headers, opt)
- lower = mid
+ def try_constant(const, headers = nil, opt = "", &b)
+ includes = cpp_include(headers)
+ if CROSS_COMPILING
+ if try_static_assert("#{const} > 0", headers, opt)
+ # positive constant
+ elsif try_static_assert("#{const} < 0", headers, opt)
+ neg = true
+ const = "-(#{const})"
+ elsif try_static_assert("#{const} == 0", headers, opt)
+ return 0
else
- upper = mid
+ # not a constant
+ return nil
end
- end
- upper = -upper if neg
- return upper
- else
- src = %{#{includes}
+ upper = 1
+ lower = 0
+ until try_static_assert("#{const} <= #{upper}", headers, opt)
+ lower = upper
+ upper <<= 1
+ end
+ return nil unless lower
+ while upper > lower + 1
+ mid = (upper + lower) / 2
+ if try_static_assert("#{const} > #{mid}", headers, opt)
+ lower = mid
+ else
+ upper = mid
+ end
+ end
+ upper = -upper if neg
+ return upper
+ else
+ src = %{#{includes}
#include <stdio.h>
/*top*/
int conftest_const = (int)(#{const});
int main() {printf("%d\\n", conftest_const); return 0;}
}
- if try_link0(src, opt, &b)
- xpopen("./conftest") do |f|
- return Integer(f.gets)
+ begin
+ if try_link0(src, opt, &b)
+ xpopen("./conftest") do |f|
+ return Integer(f.gets)
+ end
+ end
+ ensure
+ MakeMakefile.rm_f "conftest*"
end
end
+ nil
end
- nil
-end
-# You should use +have_func+ rather than +try_func+.
-#
-# [+func+] a String which contains a symbol name
-# [+libs+] a String which contains library names.
-# [+headers+] a String or an Array of strings which contains
-# names of header files.
-def try_func(func, libs, headers = nil, &b)
- headers = cpp_include(headers)
- case func
- when /^&/
- decltype = proc {|x|"const volatile void *#{x}"}
- else
- call = true
- decltype = proc {|x| "void ((*#{x})())"}
- end
- try_link(<<"SRC", libs, &b) or
+ # You should use +have_func+ rather than +try_func+.
+ #
+ # [+func+] a String which contains a symbol name
+ # [+libs+] a String which contains library names.
+ # [+headers+] a String or an Array of strings which contains names of header
+ # files.
+ def try_func(func, libs, headers = nil, opt = "", &b)
+ headers = cpp_include(headers)
+ case func
+ when /^&/
+ decltype = proc {|x|"const volatile void *#{x}"}
+ when /\)$/
+ call = func
+ else
+ call = "#{func}()"
+ decltype = proc {|x| "void ((*#{x})())"}
+ end
+ if opt and !opt.empty?
+ [[:to_str], [:join, " "], [:to_s]].each do |meth, *args|
+ if opt.respond_to?(meth)
+ break opt = opt.send(meth, *args)
+ end
+ end
+ opt = "#{opt} #{libs}"
+ else
+ opt = libs
+ end
+ decltype && try_link(<<"SRC", opt, &b) or
#{headers}
/*top*/
#{MAIN_DOES_NOTHING}
-int t() { #{decltype["volatile p"]}; p = (#{decltype[]})#{func}; return 0; }
+extern int t(void);
+int t(void) { #{decltype["volatile p"]}; p = (#{decltype[]})#{func}; return 0; }
SRC
- call && try_link(<<"SRC", libs, &b)
+ call && try_link(<<"SRC", opt, &b)
#{headers}
/*top*/
#{MAIN_DOES_NOTHING}
-int t() { #{func}(); return 0; }
+extern int t(void);
+int t(void) { #{call}; return 0; }
SRC
-end
+ end
-# You should use +have_var+ rather than +try_var+.
-def try_var(var, headers = nil, &b)
- headers = cpp_include(headers)
- try_compile(<<"SRC", &b)
+ # You should use +have_var+ rather than +try_var+.
+ def try_var(var, headers = nil, opt = "", &b)
+ headers = cpp_include(headers)
+ try_compile(<<"SRC", opt, &b)
#{headers}
/*top*/
#{MAIN_DOES_NOTHING}
-int t() { const volatile void *volatile p; p = &(&#{var})[0]; return 0; }
+extern int t(void);
+int t(void) { const volatile void *volatile p; p = &(&#{var})[0]; return 0; }
SRC
-end
+ end
-# Returns whether or not the +src+ can be preprocessed with the C preprocessor and
-# matches with +pat+.
-#
-# If a block given, it is called with the source before compilation. You can
-# modify the source in the block.
-#
-# [+pat+] a Regexp or a String
-# [+src+] a String which contains a C source
-# [+opt+] a String which contains preprocessor options
-#
-# Note:
-# When pat is a Regexp the matching will be checked in process,
-# otherwise egrep(1) will be invoked to check it.
-def egrep_cpp(pat, src, opt = "", &b)
- src = create_tmpsrc(src, &b)
- xpopen(cpp_command('', opt)) do |f|
- if Regexp === pat
- puts(" ruby -ne 'print if #{pat.inspect}'")
- f.grep(pat) {|l|
- puts "#{f.lineno}: #{l}"
- return true
- }
- false
- else
- puts(" egrep '#{pat}'")
- begin
- stdin = $stdin.dup
- $stdin.reopen(f)
- system("egrep", pat)
- ensure
- $stdin.reopen(stdin)
+ # Returns whether or not the +src+ can be preprocessed with the C
+ # preprocessor and matches with +pat+.
+ #
+ # If a block given, it is called with the source before compilation. You can
+ # modify the source in the block.
+ #
+ # [+pat+] a Regexp or a String
+ # [+src+] a String which contains a C source
+ # [+opt+] a String which contains preprocessor options
+ #
+ # NOTE: When pat is a Regexp the matching will be checked in process,
+ # otherwise egrep(1) will be invoked to check it.
+ def egrep_cpp(pat, src, opt = "", &b)
+ src = create_tmpsrc(src, &b)
+ xpopen(cpp_command('', opt)) do |f|
+ if Regexp === pat
+ puts(" ruby -ne 'print if #{pat.inspect}'")
+ f.grep(pat) {|l|
+ puts "#{f.lineno}: #{l}"
+ return true
+ }
+ false
+ else
+ puts(" egrep '#{pat}'")
+ begin
+ stdin = $stdin.dup
+ $stdin.reopen(f)
+ system("egrep", pat)
+ ensure
+ $stdin.reopen(stdin)
+ end
end
end
+ ensure
+ MakeMakefile.rm_f "conftest*"
+ log_src(src)
end
-ensure
- rm_f "conftest*"
- log_src(src)
-end
-# This is used internally by the have_macro? method.
-def macro_defined?(macro, src, opt = "", &b)
- src = src.sub(/[^\n]\z/, "\\&\n")
- try_compile(src + <<"SRC", opt, &b)
+ # This is used internally by the have_macro? method.
+ def macro_defined?(macro, src, opt = "", &b)
+ src = src.sub(/[^\n]\z/, "\\&\n")
+ try_compile(src + <<"SRC", opt, &b)
/*top*/
#ifndef #{macro}
# error
>>>>>> #{macro} undefined <<<<<<
#endif
SRC
-end
-
-# Returns whether or not
-# * the +src+ can be compiled as a C source,
-# * the result object can be linked with its depending libraries successfully,
-# * the linked file can be invoked as an executable
-# * and the executable exits successfully
-# +opt+ is passed to the linker as options. Note that +$CFLAGS+ and +$LDFLAGS+
-# are also passed to the linker.
-#
-# If a block given, it is called with the source before compilation. You can
-# modify the source in the block.
-#
-# [+src+] a String which contains a C source
-# [+opt+] a String which contains linker options
-#
-# @return true when the executable exits successfully, false when it fails, or
-# nil when preprocessing, compilation or link fails.
-def try_run(src, opt = "", &b)
- if try_link0(src, opt, &b)
- xsystem("./conftest")
- else
- nil
end
-ensure
- rm_f "conftest*"
-end
-def install_files(mfile, ifiles, map = nil, srcprefix = nil)
- ifiles or return
- ifiles.empty? and return
- srcprefix ||= "$(srcdir)/#{srcprefix}".chomp('/')
- RbConfig::expand(srcdir = srcprefix.dup)
- dirs = []
- path = Hash.new {|h, i| h[i] = dirs.push([i])[-1]}
- ifiles.each do |files, dir, prefix|
- dir = map_dir(dir, map)
- prefix &&= %r|\A#{Regexp.quote(prefix)}/?|
- if /\A\.\// =~ files
- # install files which are in current working directory.
- files = files[2..-1]
- len = nil
+ # Returns whether or not:
+ # * the +src+ can be compiled as a C source,
+ # * the result object can be linked with its depending libraries
+ # successfully,
+ # * the linked file can be invoked as an executable
+ # * and the executable exits successfully
+ #
+ # +opt+ is passed to the linker as options. Note that +$CFLAGS+ and
+ # +$LDFLAGS+ are also passed to the linker.
+ #
+ # If a block given, it is called with the source before compilation. You can
+ # modify the source in the block.
+ #
+ # [+src+] a String which contains a C source
+ # [+opt+] a String which contains linker options
+ #
+ # Returns true when the executable exits successfully, false when it fails,
+ # or nil when preprocessing, compilation or link fails.
+ def try_run(src, opt = "", &b)
+ if try_link0(src, opt, &b)
+ xsystem("./conftest")
else
- # install files which are under the $(srcdir).
- files = File.join(srcdir, files)
- len = srcdir.size
- end
- f = nil
- Dir.glob(files) do |fx|
- f = fx
- f[0..len] = "" if len
- case File.basename(f)
- when *$NONINSTALLFILES
- next
- end
- d = File.dirname(f)
- d.sub!(prefix, "") if prefix
- d = (d.empty? || d == ".") ? dir : File.join(dir, d)
- f = File.join(srcprefix, f) if len
- path[d] << f
+ nil
end
- unless len or f
- d = File.dirname(files)
- d.sub!(prefix, "") if prefix
- d = (d.empty? || d == ".") ? dir : File.join(dir, d)
- path[d] << files
+ ensure
+ MakeMakefile.rm_f "conftest*"
+ end
+
+ def install_files(mfile, ifiles, map = nil, srcprefix = nil)
+ ifiles or return
+ ifiles.empty? and return
+ srcprefix ||= "$(srcdir)/#{srcprefix}".chomp('/')
+ RbConfig::expand(srcdir = srcprefix.dup)
+ dirs = []
+ path = Hash.new {|h, i| h[i] = dirs.push([i])[-1]}
+ ifiles.each do |files, dir, prefix|
+ dir = map_dir(dir, map)
+ prefix &&= %r|\A#{Regexp.quote(prefix)}/?|
+ if /\A\.\// =~ files
+ # install files which are in current working directory.
+ files = files[2..-1]
+ len = nil
+ else
+ # install files which are under the $(srcdir).
+ files = File.join(srcdir, files)
+ len = srcdir.size
+ end
+ f = nil
+ Dir.glob(files) do |fx|
+ f = fx
+ f[0..len] = "" if len
+ case File.basename(f)
+ when *$NONINSTALLFILES
+ next
+ end
+ d = File.dirname(f)
+ d.sub!(prefix, "") if prefix
+ d = (d.empty? || d == ".") ? dir : File.join(dir, d)
+ f = File.join(srcprefix, f) if len
+ path[d] << f
+ end
+ unless len or f
+ d = File.dirname(files)
+ d.sub!(prefix, "") if prefix
+ d = (d.empty? || d == ".") ? dir : File.join(dir, d)
+ path[d] << files
+ end
end
+ dirs
end
- dirs
-end
-def install_rb(mfile, dest, srcdir = nil)
- install_files(mfile, [["lib/**/*.rb", dest, "lib"]], nil, srcdir)
-end
+ def install_rb(mfile, dest, srcdir = nil)
+ install_files(mfile, [["lib/**/*.rb", dest, "lib"]], nil, srcdir)
+ end
-def append_library(libs, lib) # :no-doc:
- format(LIBARG, lib) + " " + libs
-end
+ def append_library(libs, lib) # :no-doc:
+ format(LIBARG, lib) + " " + libs
+ end
-def message(*s)
- unless Logging.quiet and not $VERBOSE
- printf(*s)
- $stdout.flush
+ def message(*s)
+ unless Logging.quiet and not $VERBOSE
+ printf(*s)
+ $stdout.flush
+ end
end
-end
-# This emits a string to stdout that allows users to see the results of the
-# various have* and find* methods as they are tested.
-#
-# Internal use only.
-#
-def checking_for(m, fmt = nil)
- f = caller[0][/in `([^<].*)'$/, 1] and f << ": " #` for vim #'
- m = "checking #{/\Acheck/ =~ f ? '' : 'for '}#{m}... "
- message "%s", m
- a = r = nil
- Logging::postpone do
- r = yield
- a = (fmt ? fmt % r : r ? "yes" : "no") << "\n"
- "#{f}#{m}-------------------- #{a}\n"
- end
- message(a)
- Logging::message "--------------------\n\n"
- r
-end
+ # This emits a string to stdout that allows users to see the results of the
+ # various have* and find* methods as they are tested.
+ #
+ # Internal use only.
+ #
+ def checking_for(m, fmt = nil)
+ f = caller[0][/in `([^<].*)'$/, 1] and f << ": " #` for vim #'
+ m = "checking #{/\Acheck/ =~ f ? '' : 'for '}#{m}... "
+ message "%s", m
+ a = r = nil
+ Logging::postpone do
+ r = yield
+ a = (fmt ? "#{fmt % r}" : r ? "yes" : "no") << "\n"
+ "#{f}#{m}-------------------- #{a}\n"
+ end
+ message(a)
+ Logging::message "--------------------\n\n"
+ r
+ end
-def checking_message(target, place = nil, opt = nil)
- [["in", place], ["with", opt]].inject("#{target}") do |msg, (pre, noun)|
- if noun
- [[:to_str], [:join, ","], [:to_s]].each do |meth, *args|
- if noun.respond_to?(meth)
- break noun = noun.send(meth, *args)
+ def checking_message(target, place = nil, opt = nil)
+ [["in", place], ["with", opt]].inject("#{target}") do |msg, (pre, noun)|
+ if noun
+ [[:to_str], [:join, ","], [:to_s]].each do |meth, *args|
+ if noun.respond_to?(meth)
+ break noun = noun.send(meth, *args)
+ end
end
+ msg << " #{pre} #{noun}" unless noun.empty?
end
- msg << " #{pre} #{noun}" unless noun.empty?
+ msg
end
- msg
end
-end
-# :startdoc:
+ # :startdoc:
-# Returns whether or not +macro+ is defined either in the common header
-# files or within any +headers+ you provide.
-#
-# Any options you pass to +opt+ are passed along to the compiler.
-#
-def have_macro(macro, headers = nil, opt = "", &b)
- checking_for checking_message(macro, headers, opt) do
- macro_defined?(macro, cpp_include(headers), opt, &b)
+ # Returns whether or not +macro+ is defined either in the common header
+ # files or within any +headers+ you provide.
+ #
+ # Any options you pass to +opt+ are passed along to the compiler.
+ #
+ def have_macro(macro, headers = nil, opt = "", &b)
+ checking_for checking_message(macro, headers, opt) do
+ macro_defined?(macro, cpp_include(headers), opt, &b)
+ end
end
-end
-# Returns whether or not the given entry point +func+ can be found within
-# +lib+. If +func+ is nil, the 'main()' entry point is used by default.
-# If found, it adds the library to list of libraries to be used when linking
-# your extension.
-#
-# If +headers+ are provided, it will include those header files as the
-# header files it looks in when searching for +func+.
-#
-# The real name of the library to be linked can be altered by
-# '--with-FOOlib' configuration option.
-#
-def have_library(lib, func = nil, headers = nil, &b)
- func = "main" if !func or func.empty?
- lib = with_config(lib+'lib', lib)
- checking_for checking_message("#{func}()", LIBARG%lib) do
- if COMMON_LIBS.include?(lib)
- true
- else
- libs = append_library($libs, lib)
- if try_func(func, libs, headers, &b)
- $libs = libs
+ # Returns whether or not the given entry point +func+ can be found within
+ # +lib+. If +func+ is +nil+, the <code>main()</code> entry point is used by
+ # default. If found, it adds the library to list of libraries to be used
+ # when linking your extension.
+ #
+ # If +headers+ are provided, it will include those header files as the
+ # header files it looks in when searching for +func+.
+ #
+ # The real name of the library to be linked can be altered by
+ # <code>--with-FOOlib</code> configuration option.
+ #
+ def have_library(lib, func = nil, headers = nil, opt = "", &b)
+ func = "main" if !func or func.empty?
+ lib = with_config(lib+'lib', lib)
+ checking_for checking_message(func.funcall_style, LIBARG%lib, opt) do
+ if COMMON_LIBS.include?(lib)
true
else
- false
+ libs = append_library($libs, lib)
+ if try_func(func, libs, headers, opt, &b)
+ $libs = libs
+ true
+ else
+ false
+ end
end
end
end
-end
-# Returns whether or not the entry point +func+ can be found within the library
-# +lib+ in one of the +paths+ specified, where +paths+ is an array of strings.
-# If +func+ is nil , then the main() function is used as the entry point.
-#
-# If +lib+ is found, then the path it was found on is added to the list of
-# library paths searched and linked against.
-#
-def find_library(lib, func, *paths, &b)
- func = "main" if !func or func.empty?
- lib = with_config(lib+'lib', lib)
- paths = paths.collect {|path| path.split(File::PATH_SEPARATOR)}.flatten
- checking_for "#{func}() in #{LIBARG%lib}" do
- libpath = $LIBPATH
- libs = append_library($libs, lib)
- begin
- until r = try_func(func, libs, &b) or paths.empty?
- $LIBPATH = libpath | [paths.shift]
- end
- if r
- $libs = libs
- libpath = nil
+ # Returns whether or not the entry point +func+ can be found within the
+ # library +lib+ in one of the +paths+ specified, where +paths+ is an array
+ # of strings. If +func+ is +nil+ , then the <code>main()</code> function is
+ # used as the entry point.
+ #
+ # If +lib+ is found, then the path it was found on is added to the list of
+ # library paths searched and linked against.
+ #
+ def find_library(lib, func, *paths, &b)
+ func = "main" if !func or func.empty?
+ lib = with_config(lib+'lib', lib)
+ paths = paths.collect {|path| path.split(File::PATH_SEPARATOR)}.flatten
+ checking_for(func.funcall_style, LIBARG%lib) do
+ libpath = $LIBPATH
+ libs = append_library($libs, lib)
+ begin
+ until r = try_func(func, libs, &b) or paths.empty?
+ $LIBPATH = libpath | [paths.shift]
+ end
+ if r
+ $libs = libs
+ libpath = nil
+ end
+ ensure
+ $LIBPATH = libpath if libpath
end
- ensure
- $LIBPATH = libpath if libpath
+ r
end
- r
end
-end
-# Returns whether or not the function +func+ can be found in the common
-# header files, or within any +headers+ that you provide. If found, a
-# macro is passed as a preprocessor constant to the compiler using the
-# function name, in uppercase, prepended with 'HAVE_'.
-#
-# For example, if have_func('foo') returned true, then the HAVE_FOO
-# preprocessor macro would be passed to the compiler.
-#
-def have_func(func, headers = nil, &b)
- checking_for checking_message("#{func}()", headers) do
- if try_func(func, $libs, headers, &b)
- $defs.push(format("-DHAVE_%s", func.tr_cpp))
- true
- else
- false
+ # Returns whether or not the function +func+ can be found in the common
+ # header files, or within any +headers+ that you provide. If found, a macro
+ # is passed as a preprocessor constant to the compiler using the function
+ # name, in uppercase, prepended with +HAVE_+.
+ #
+ # To check functions in an additional library, you need to check that
+ # library first using <code>have_library()</code>. The +func+ shall be
+ # either mere function name or function name with arguments.
+ #
+ # For example, if <code>have_func('foo')</code> returned +true+, then the
+ # +HAVE_FOO+ preprocessor macro would be passed to the compiler.
+ #
+ def have_func(func, headers = nil, opt = "", &b)
+ checking_for checking_message(func.funcall_style, headers, opt) do
+ if try_func(func, $libs, headers, opt, &b)
+ $defs << "-DHAVE_#{func.sans_arguments.tr_cpp}"
+ true
+ else
+ false
+ end
end
end
-end
-# Returns whether or not the variable +var+ can be found in the common
-# header files, or within any +headers+ that you provide. If found, a
-# macro is passed as a preprocessor constant to the compiler using the
-# variable name, in uppercase, prepended with 'HAVE_'.
-#
-# For example, if have_var('foo') returned true, then the HAVE_FOO
-# preprocessor macro would be passed to the compiler.
-#
-def have_var(var, headers = nil, &b)
- checking_for checking_message(var, headers) do
- if try_var(var, headers, &b)
- $defs.push(format("-DHAVE_%s", var.tr_cpp))
- true
- else
- false
+ # Returns whether or not the variable +var+ can be found in the common
+ # header files, or within any +headers+ that you provide. If found, a macro
+ # is passed as a preprocessor constant to the compiler using the variable
+ # name, in uppercase, prepended with +HAVE_+.
+ #
+ # To check variables in an additional library, you need to check that
+ # library first using <code>have_library()</code>.
+ #
+ # For example, if <code>have_var('foo')</code> returned true, then the
+ # +HAVE_FOO+ preprocessor macro would be passed to the compiler.
+ #
+ def have_var(var, headers = nil, opt = "", &b)
+ checking_for checking_message(var, headers, opt) do
+ if try_var(var, headers, opt, &b)
+ $defs.push(format("-DHAVE_%s", var.tr_cpp))
+ true
+ else
+ false
+ end
end
end
-end
-# Returns whether or not the given +header+ file can be found on your system.
-# If found, a macro is passed as a preprocessor constant to the compiler using
-# the header file name, in uppercase, prepended with 'HAVE_'.
-#
-# For example, if have_header('foo.h') returned true, then the HAVE_FOO_H
-# preprocessor macro would be passed to the compiler.
-#
-def have_header(header, preheaders = nil, &b)
- checking_for header do
- if try_header(cpp_include(preheaders)+cpp_include(header), &b)
- $defs.push(format("-DHAVE_%s", header.tr_cpp))
- true
- else
- false
+ # Returns whether or not the given +header+ file can be found on your system.
+ # If found, a macro is passed as a preprocessor constant to the compiler
+ # using the header file name, in uppercase, prepended with +HAVE_+.
+ #
+ # For example, if <code>have_header('foo.h')</code> returned true, then the
+ # +HAVE_FOO_H+ preprocessor macro would be passed to the compiler.
+ #
+ def have_header(header, preheaders = nil, opt = "", &b)
+ checking_for header do
+ if try_header(cpp_include(preheaders)+cpp_include(header), opt, &b)
+ $defs.push(format("-DHAVE_%s", header.tr_cpp))
+ true
+ else
+ false
+ end
end
end
-end
-# Returns whether or not the given +framework+ can be found on your system.
-# If found, a macro is passed as a preprocessor constant to the compiler using
-# the framework name, in uppercase, prepended with 'HAVE_FRAMEWORK_'.
-#
-# For example, if have_framework('Ruby') returned true, then the HAVE_FRAMEWORK_RUBY
-# preprocessor macro would be passed to the compiler.
-#
-def have_framework(fw, &b)
- checking_for fw do
- src = cpp_include("#{fw}/#{fw}.h") << "\n" "int main(void){return 0;}"
- if try_link(src, opt = "-framework #{fw}", &b)
- $defs.push(format("-DHAVE_FRAMEWORK_%s", fw.tr_cpp))
- $LDFLAGS << " " << opt
- true
- else
- false
+ # Returns whether or not the given +framework+ can be found on your system.
+ # If found, a macro is passed as a preprocessor constant to the compiler
+ # using the framework name, in uppercase, prepended with +HAVE_FRAMEWORK_+.
+ #
+ # For example, if <code>have_framework('Ruby')</code> returned true, then
+ # the +HAVE_FRAMEWORK_RUBY+ preprocessor macro would be passed to the
+ # compiler.
+ #
+ def have_framework(fw, &b)
+ checking_for fw do
+ src = cpp_include("#{fw}/#{fw}.h") << "\n" "int main(void){return 0;}"
+ opt = " -framework #{fw}"
+ if try_link(src, "-ObjC#{opt}", &b)
+ $defs.push(format("-DHAVE_FRAMEWORK_%s", fw.tr_cpp))
+ # TODO: non-worse way than this hack, to get rid of separating
+ # option and its argument.
+ $LDFLAGS << " -ObjC" unless /(\A|\s)-ObjC(\s|\z)/ =~ $LDFLAGS
+ $LDFLAGS << opt
+ true
+ else
+ false
+ end
end
end
-end
-# Instructs mkmf to search for the given +header+ in any of the +paths+
-# provided, and returns whether or not it was found in those paths.
-#
-# If the header is found then the path it was found on is added to the list
-# of included directories that are sent to the compiler (via the -I switch).
-#
-def find_header(header, *paths)
- message = checking_message(header, paths)
- header = cpp_include(header)
- checking_for message do
- if try_header(header)
- true
- else
- found = false
- paths.each do |dir|
- opt = "-I#{dir}".quote
- if try_header(header, opt)
- $INCFLAGS << " " << opt
- found = true
- break
+ # Instructs mkmf to search for the given +header+ in any of the +paths+
+ # provided, and returns whether or not it was found in those paths.
+ #
+ # If the header is found then the path it was found on is added to the list
+ # of included directories that are sent to the compiler (via the
+ # <code>-I</code> switch).
+ #
+ def find_header(header, *paths)
+ message = checking_message(header, paths)
+ header = cpp_include(header)
+ checking_for message do
+ if try_header(header)
+ true
+ else
+ found = false
+ paths.each do |dir|
+ opt = "-I#{dir}".quote
+ if try_header(header, opt)
+ $INCFLAGS << " " << opt
+ found = true
+ break
+ end
end
+ found
end
- found
end
end
-end
-# Returns whether or not the struct of type +type+ contains +member+. If
-# it does not, or the struct type can't be found, then false is returned. You
-# may optionally specify additional +headers+ in which to look for the struct
-# (in addition to the common header files).
-#
-# If found, a macro is passed as a preprocessor constant to the compiler using
-# the type name and the member name, in uppercase, prepended with 'HAVE_'.
-#
-# For example, if have_struct_member('struct foo', 'bar') returned true, then the
-# HAVE_STRUCT_FOO_BAR preprocessor macro would be passed to the compiler.
-#
-# HAVE_ST_BAR is also defined for backward compatibility.
-#
-def have_struct_member(type, member, headers = nil, &b)
- checking_for checking_message("#{type}.#{member}", headers) do
- if try_compile(<<"SRC", &b)
+ # Returns whether or not the struct of type +type+ contains +member+. If
+ # it does not, or the struct type can't be found, then false is returned.
+ # You may optionally specify additional +headers+ in which to look for the
+ # struct (in addition to the common header files).
+ #
+ # If found, a macro is passed as a preprocessor constant to the compiler
+ # using the type name and the member name, in uppercase, prepended with
+ # +HAVE_+.
+ #
+ # For example, if <code>have_struct_member('struct foo', 'bar')</code>
+ # returned true, then the +HAVE_STRUCT_FOO_BAR+ preprocessor macro would be
+ # passed to the compiler.
+ #
+ # +HAVE_ST_BAR+ is also defined for backward compatibility.
+ #
+ def have_struct_member(type, member, headers = nil, opt = "", &b)
+ checking_for checking_message("#{type}.#{member}", headers) do
+ if try_compile(<<"SRC", opt, &b)
#{cpp_include(headers)}
/*top*/
#{MAIN_DOES_NOTHING}
int s = (char *)&((#{type}*)0)->#{member} - (char *)0;
SRC
- $defs.push(format("-DHAVE_%s_%s", type.tr_cpp, member.tr_cpp))
- $defs.push(format("-DHAVE_ST_%s", member.tr_cpp)) # backward compatibility
- true
- else
- false
+ $defs.push(format("-DHAVE_%s_%s", type.tr_cpp, member.tr_cpp))
+ $defs.push(format("-DHAVE_ST_%s", member.tr_cpp)) # backward compatibility
+ true
+ else
+ false
+ end
end
end
-end
-# Returns whether or not the static type +type+ is defined.
-#
-# See also +have_type+
-#
-def try_type(type, headers = nil, opt = "", &b)
- if try_compile(<<"SRC", opt, &b)
+ # Returns whether or not the static type +type+ is defined.
+ #
+ # See also +have_type+
+ #
+ def try_type(type, headers = nil, opt = "", &b)
+ if try_compile(<<"SRC", opt, &b)
#{cpp_include(headers)}
/*top*/
typedef #{type} conftest_type;
int conftestval[sizeof(conftest_type)?1:-1];
SRC
- $defs.push(format("-DHAVE_TYPE_%s", type.tr_cpp))
- true
- else
- false
+ $defs.push(format("-DHAVE_TYPE_%s", type.tr_cpp))
+ true
+ else
+ false
+ end
end
-end
-# Returns whether or not the static type +type+ is defined. You may
-# optionally pass additional +headers+ to check against in addition to the
-# common header files.
-#
-# You may also pass additional flags to +opt+ which are then passed along to
-# the compiler.
-#
-# If found, a macro is passed as a preprocessor constant to the compiler using
-# the type name, in uppercase, prepended with 'HAVE_TYPE_'.
-#
-# For example, if have_type('foo') returned true, then the HAVE_TYPE_FOO
-# preprocessor macro would be passed to the compiler.
-#
-def have_type(type, headers = nil, opt = "", &b)
- checking_for checking_message(type, headers, opt) do
- try_type(type, headers, opt, &b)
+ # Returns whether or not the static type +type+ is defined. You may
+ # optionally pass additional +headers+ to check against in addition to the
+ # common header files.
+ #
+ # You may also pass additional flags to +opt+ which are then passed along to
+ # the compiler.
+ #
+ # If found, a macro is passed as a preprocessor constant to the compiler
+ # using the type name, in uppercase, prepended with +HAVE_TYPE_+.
+ #
+ # For example, if <code>have_type('foo')</code> returned true, then the
+ # +HAVE_TYPE_FOO+ preprocessor macro would be passed to the compiler.
+ #
+ def have_type(type, headers = nil, opt = "", &b)
+ checking_for checking_message(type, headers, opt) do
+ try_type(type, headers, opt, &b)
+ end
end
-end
-# Returns where the static type +type+ is defined.
-#
-# You may also pass additional flags to +opt+ which are then passed along to
-# the compiler.
-#
-# See also +have_type+.
-#
-def find_type(type, opt, *headers, &b)
- opt ||= ""
- fmt = "not found"
- def fmt.%(x)
- x ? x.respond_to?(:join) ? x.join(",") : x : self
- end
- checking_for checking_message(type, nil, opt), fmt do
- headers.find do |h|
- try_type(type, h, opt, &b)
+ # Returns where the static type +type+ is defined.
+ #
+ # You may also pass additional flags to +opt+ which are then passed along to
+ # the compiler.
+ #
+ # See also +have_type+.
+ #
+ def find_type(type, opt, *headers, &b)
+ opt ||= ""
+ fmt = "not found"
+ def fmt.%(x)
+ x ? x.respond_to?(:join) ? x.join(",") : x : self
+ end
+ checking_for checking_message(type, nil, opt), fmt do
+ headers.find do |h|
+ try_type(type, h, opt, &b)
+ end
end
end
-end
-# Returns whether or not the Constant +const+ is defined.
-#
-# See also +have_const+
-#
-def try_const(const, headers = nil, opt = "", &b)
- const, type = *const
- if try_compile(<<"SRC", opt, &b)
+ # Returns whether or not the constant +const+ is defined.
+ #
+ # See also +have_const+
+ #
+ def try_const(const, headers = nil, opt = "", &b)
+ const, type = *const
+ if try_compile(<<"SRC", opt, &b)
#{cpp_include(headers)}
/*top*/
typedef #{type || 'int'} conftest_type;
conftest_type conftestval = #{type ? '' : '(int)'}#{const};
SRC
- $defs.push(format("-DHAVE_CONST_%s", const.tr_cpp))
- true
- else
- false
+ $defs.push(format("-DHAVE_CONST_%s", const.tr_cpp))
+ true
+ else
+ false
+ end
end
-end
-# Returns whether or not the constant +const+ is defined. You may
-# optionally pass the +type+ of +const+ as <code>[const, type]</code>,
-# like as:
-#
-# have_const(%w[PTHREAD_MUTEX_INITIALIZER pthread_mutex_t], "pthread.h")
-#
-# You may also pass additional +headers+ to check against in addition
-# to the common header files, and additional flags to +opt+ which are
-# then passed along to the compiler.
-#
-# If found, a macro is passed as a preprocessor constant to the compiler using
-# the type name, in uppercase, prepended with 'HAVE_CONST_'.
-#
-# For example, if have_const('foo') returned true, then the HAVE_CONST_FOO
-# preprocessor macro would be passed to the compiler.
-#
-def have_const(const, headers = nil, opt = "", &b)
- checking_for checking_message([*const].compact.join(' '), headers, opt) do
- try_const(const, headers, opt, &b)
+ # Returns whether or not the constant +const+ is defined. You may
+ # optionally pass the +type+ of +const+ as <code>[const, type]</code>,
+ # such as:
+ #
+ # have_const(%w[PTHREAD_MUTEX_INITIALIZER pthread_mutex_t], "pthread.h")
+ #
+ # You may also pass additional +headers+ to check against in addition to the
+ # common header files, and additional flags to +opt+ which are then passed
+ # along to the compiler.
+ #
+ # If found, a macro is passed as a preprocessor constant to the compiler
+ # using the type name, in uppercase, prepended with +HAVE_CONST_+.
+ #
+ # For example, if <code>have_const('foo')</code> returned true, then the
+ # +HAVE_CONST_FOO+ preprocessor macro would be passed to the compiler.
+ #
+ def have_const(const, headers = nil, opt = "", &b)
+ checking_for checking_message([*const].compact.join(' '), headers, opt) do
+ try_const(const, headers, opt, &b)
+ end
end
-end
-
-STRING_OR_FAILED_FORMAT = "%s"
-# :stopdoc:
-def STRING_OR_FAILED_FORMAT.%(x)
- x ? super : "failed"
-end
-
-def typedef_expr(type, headers)
- typename, member = type.split('.', 2)
- prelude = cpp_include(headers).split(/$/)
- prelude << "typedef #{typename} rbcv_typedef_;\n"
- return "rbcv_typedef_", member, prelude
-end
-def try_signedness(type, member, headers = nil, opts = nil, &b)
- raise ArgumentError, "don't know how to tell signedness of members" if member
- if try_static_assert("(#{type})-1 < 0", headers, opts)
- return -1
- elsif try_static_assert("(#{type})-1 > 0", headers, opts)
- return +1
+ # :stopdoc:
+ STRING_OR_FAILED_FORMAT = "%s"
+ def STRING_OR_FAILED_FORMAT.%(x)
+ x ? super : "failed"
end
-end
-# :startdoc:
+ def typedef_expr(type, headers)
+ typename, member = type.split('.', 2)
+ prelude = cpp_include(headers).split(/$/)
+ prelude << "typedef #{typename} rbcv_typedef_;\n"
+ return "rbcv_typedef_", member, prelude
+ end
-# Returns the size of the given +type+. You may optionally specify additional
-# +headers+ to search in for the +type+.
-#
-# If found, a macro is passed as a preprocessor constant to the compiler using
-# the type name, in uppercase, prepended with 'SIZEOF_', followed by the type
-# name, followed by '=X' where 'X' is the actual size.
-#
-# For example, if check_sizeof('mystruct') returned 12, then the
-# SIZEOF_MYSTRUCT=12 preprocessor macro would be passed to the compiler.
-#
-def check_sizeof(type, headers = nil, opts = "", &b)
- typedef, member, prelude = typedef_expr(type, headers)
- prelude << "static #{typedef} *rbcv_ptr_;\n"
- prelude = [prelude]
- expr = "sizeof((*rbcv_ptr_)#{"." << member if member})"
- fmt = STRING_OR_FAILED_FORMAT
- checking_for checking_message("size of #{type}", headers), fmt do
- if size = try_constant(expr, prelude, opts, &b)
- $defs.push(format("-DSIZEOF_%s=%s", type.tr_cpp, size))
- size
+ def try_signedness(type, member, headers = nil, opts = nil)
+ raise ArgumentError, "don't know how to tell signedness of members" if member
+ if try_static_assert("(#{type})-1 < 0", headers, opts)
+ return -1
+ elsif try_static_assert("(#{type})-1 > 0", headers, opts)
+ return +1
end
end
-end
-# Returns the signedness of the given +type+. You may optionally
-# specify additional +headers+ to search in for the +type+.
-#
-# If the +type+ is found and is a numeric type, a macro is passed as a
-# preprocessor constant to the compiler using the +type+ name, in
-# uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+
-# name, followed by '=X' where 'X' is positive integer if the +type+ is
-# unsigned, or negative integer if the +type+ is signed.
-#
-# For example, if size_t is defined as unsigned, then
-# check_signedness('size_t') would returned +1 and the
-# SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the
-# compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is
-# done.
-#
-def check_signedness(type, headers = nil, opts = nil, &b)
- typedef, member, prelude = typedef_expr(type, headers)
- signed = nil
- checking_for("signedness of #{type}", STRING_OR_FAILED_FORMAT) do
- signed = try_signedness(typedef, member, [prelude], opts, &b) or next nil
- $defs.push("-DSIGNEDNESS_OF_%s=%+d" % [type.tr_cpp, signed])
- signed < 0 ? "signed" : "unsigned"
- end
- signed
-end
+ # :startdoc:
+
+ # Returns the size of the given +type+. You may optionally specify
+ # additional +headers+ to search in for the +type+.
+ #
+ # If found, a macro is passed as a preprocessor constant to the compiler
+ # using the type name, in uppercase, prepended with +SIZEOF_+, followed by
+ # the type name, followed by <code>=X</code> where "X" is the actual size.
+ #
+ # For example, if <code>check_sizeof('mystruct')</code> returned 12, then
+ # the <code>SIZEOF_MYSTRUCT=12</code> preprocessor macro would be passed to
+ # the compiler.
+ #
+ def check_sizeof(type, headers = nil, opts = "", &b)
+ typedef, member, prelude = typedef_expr(type, headers)
+ prelude << "static #{typedef} *rbcv_ptr_;\n"
+ prelude = [prelude]
+ expr = "sizeof((*rbcv_ptr_)#{"." << member if member})"
+ fmt = STRING_OR_FAILED_FORMAT
+ checking_for checking_message("size of #{type}", headers), fmt do
+ if size = try_constant(expr, prelude, opts, &b)
+ $defs.push(format("-DSIZEOF_%s=%s", type.tr_cpp, size))
+ size
+ end
+ end
+ end
-# Returns the convertible integer type of the given +type+. You may
-# optionally specify additional +headers+ to search in for the +type+.
-# _Convertible_ means actually same type, or typedefed from same type.
-#
-# If the +type+ is a integer type and _convertible_ type is found,
-# following macros are passed as preprocessor constants to the
-# compiler using the +type+ name, in uppercase.
-#
-# * 'TYPEOF_', followed by the +type+ name, followed by '=X' where 'X'
-# is the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP,
-# where 'TYP' is the +type+ name in uppercase with replacing '_t'
-# suffix with 'T', followed by '=X' where 'X' is the macro name to
-# convert +type+ to +Integer+ object, and vice versa.
-#
-# For example, if foobar_t is defined as unsigned long, then
-# convertible_int("foobar_t") would return "unsigned long", and define
-# macros:
-#
-# #define TYPEOF_FOOBAR_T unsigned long
-# #define FOOBART2NUM ULONG2NUM
-# #define NUM2FOOBART NUM2ULONG
-def convertible_int(type, headers = nil, opts = nil, &b)
- type, macname = *type
- checking_for("convertible type of #{type}", STRING_OR_FAILED_FORMAT) do
- if UNIVERSAL_INTS.include?(type)
- type
- else
- typedef, member, prelude = typedef_expr(type, headers, &b)
- next unless signed = try_signedness(typedef, member, [prelude])
- u = "unsigned " if signed > 0
- prelude << "extern rbcv_typedef_ foo();"
- compat = UNIVERSAL_INTS.find {|t|
- try_compile([prelude, "extern #{u}#{t} foo();"].join("\n"), opts, :werror=>true, &b)
- }
- if compat
- macname ||= type.sub(/_(?=t\z)/, '').tr_cpp
- conv = (compat == "long long" ? "LL" : compat.upcase)
- compat = "#{u}#{compat}"
- $defs.push(format("-DTYPEOF_%s=%s", type.tr_cpp, compat.quote))
- $defs.push(format("-DPRI_%s_PREFIX=PRI_%s_PREFIX", macname, conv))
- conv = (u ? "U" : "") + conv
- $defs.push(format("-D%s2NUM=%s2NUM", macname, conv))
- $defs.push(format("-DNUM2%s=NUM2%s", macname, conv))
- compat
+ # Returns the signedness of the given +type+. You may optionally specify
+ # additional +headers+ to search in for the +type+.
+ #
+ # If the +type+ is found and is a numeric type, a macro is passed as a
+ # preprocessor constant to the compiler using the +type+ name, in uppercase,
+ # prepended with +SIGNEDNESS_OF_+, followed by the +type+ name, followed by
+ # <code>=X</code> where "X" is positive integer if the +type+ is unsigned
+ # and a negative integer if the +type+ is signed.
+ #
+ # For example, if +size_t+ is defined as unsigned, then
+ # <code>check_signedness('size_t')</code> would return +1 and the
+ # <code>SIGNEDNESS_OF_SIZE_T=+1</code> preprocessor macro would be passed to
+ # the compiler. The <code>SIGNEDNESS_OF_INT=-1</code> macro would be set
+ # for <code>check_signedness('int')</code>
+ #
+ def check_signedness(type, headers = nil, opts = nil, &b)
+ typedef, member, prelude = typedef_expr(type, headers)
+ signed = nil
+ checking_for("signedness of #{type}", STRING_OR_FAILED_FORMAT) do
+ signed = try_signedness(typedef, member, [prelude], opts, &b) or next nil
+ $defs.push("-DSIGNEDNESS_OF_%s=%+d" % [type.tr_cpp, signed])
+ signed < 0 ? "signed" : "unsigned"
+ end
+ signed
+ end
+
+ # Returns the convertible integer type of the given +type+. You may
+ # optionally specify additional +headers+ to search in for the +type+.
+ # _convertible_ means actually the same type, or typedef'd from the same
+ # type.
+ #
+ # If the +type+ is a integer type and the _convertible_ type is found,
+ # the following macros are passed as preprocessor constants to the compiler
+ # using the +type+ name, in uppercase.
+ #
+ # * +TYPEOF_+, followed by the +type+ name, followed by <code>=X</code>
+ # where "X" is the found _convertible_ type name.
+ # * +TYP2NUM+ and +NUM2TYP+,
+ # where +TYP+ is the +type+ name in uppercase with replacing an +_t+
+ # suffix with "T", followed by <code>=X</code> where "X" is the macro name
+ # to convert +type+ to an Integer object, and vice versa.
+ #
+ # For example, if +foobar_t+ is defined as unsigned long, then
+ # <code>convertible_int("foobar_t")</code> would return "unsigned long", and
+ # define these macros:
+ #
+ # #define TYPEOF_FOOBAR_T unsigned long
+ # #define FOOBART2NUM ULONG2NUM
+ # #define NUM2FOOBART NUM2ULONG
+ #
+ def convertible_int(type, headers = nil, opts = nil, &b)
+ type, macname = *type
+ checking_for("convertible type of #{type}", STRING_OR_FAILED_FORMAT) do
+ if UNIVERSAL_INTS.include?(type)
+ type
+ else
+ typedef, member, prelude = typedef_expr(type, headers, &b)
+ if member
+ prelude << "static rbcv_typedef_ rbcv_var;"
+ compat = UNIVERSAL_INTS.find {|t|
+ try_static_assert("sizeof(rbcv_var.#{member}) == sizeof(#{t})", [prelude], opts, &b)
+ }
+ else
+ next unless signed = try_signedness(typedef, member, [prelude])
+ u = "unsigned " if signed > 0
+ prelude << "extern rbcv_typedef_ foo();"
+ compat = UNIVERSAL_INTS.find {|t|
+ try_compile([prelude, "extern #{u}#{t} foo();"].join("\n"), opts, :werror=>true, &b)
+ }
+ end
+ if compat
+ macname ||= type.sub(/_(?=t\z)/, '').tr_cpp
+ conv = (compat == "long long" ? "LL" : compat.upcase)
+ compat = "#{u}#{compat}"
+ typename = type.tr_cpp
+ $defs.push(format("-DSIZEOF_%s=SIZEOF_%s", typename, compat.tr_cpp))
+ $defs.push(format("-DTYPEOF_%s=%s", typename, compat.quote))
+ $defs.push(format("-DPRI_%s_PREFIX=PRI_%s_PREFIX", macname, conv))
+ conv = (u ? "U" : "") + conv
+ $defs.push(format("-D%s2NUM=%s2NUM", macname, conv))
+ $defs.push(format("-DNUM2%s=NUM2%s", macname, conv))
+ compat
+ end
end
end
end
-end
-# :stopdoc:
+ # :stopdoc:
-# Used internally by the what_type? method to determine if +type+ is a scalar
-# pointer.
-def scalar_ptr_type?(type, member = nil, headers = nil, &b)
- try_compile(<<"SRC", &b) # pointer
+ # Used internally by the what_type? method to determine if +type+ is a scalar
+ # pointer.
+ def scalar_ptr_type?(type, member = nil, headers = nil, &b)
+ try_compile(<<"SRC", &b) # pointer
#{cpp_include(headers)}
/*top*/
volatile #{type} conftestval;
#{MAIN_DOES_NOTHING}
-int t() {return (int)(1-*(conftestval#{member ? ".#{member}" : ""}));}
+extern int t(void);
+int t(void) {return (int)(1-*(conftestval#{member ? ".#{member}" : ""}));}
SRC
-end
+ end
-# Used internally by the what_type? method to determine if +type+ is a scalar
-# pointer.
-def scalar_type?(type, member = nil, headers = nil, &b)
- try_compile(<<"SRC", &b) # pointer
+ # Used internally by the what_type? method to determine if +type+ is a scalar
+ # pointer.
+ def scalar_type?(type, member = nil, headers = nil, &b)
+ try_compile(<<"SRC", &b) # pointer
#{cpp_include(headers)}
/*top*/
volatile #{type} conftestval;
#{MAIN_DOES_NOTHING}
-int t() {return (int)(1-(conftestval#{member ? ".#{member}" : ""}));}
+extern int t(void);
+int t(void) {return (int)(1-(conftestval#{member ? ".#{member}" : ""}));}
SRC
-end
+ end
-# Used internally by the what_type? method to check if _typeof_ GCC
-# extension is available.
-def have_typeof?
- return $typeof if defined?($typeof)
- $typeof = %w[__typeof__ typeof].find do |t|
- try_compile(<<SRC)
+ # Used internally by the what_type? method to check if the _typeof_ GCC
+ # extension is available.
+ def have_typeof?
+ return $typeof if defined?($typeof)
+ $typeof = %w[__typeof__ typeof].find do |t|
+ try_compile(<<SRC)
int rbcv_foo;
#{t}(rbcv_foo) rbcv_bar;
SRC
+ end
end
-end
-def what_type?(type, member = nil, headers = nil, &b)
- m = "#{type}"
- var = val = "*rbcv_var_"
- func = "rbcv_func_(void)"
- if member
- m << "." << member
- else
- type, member = type.split('.', 2)
- end
- if member
- val = "(#{var}).#{member}"
- end
- prelude = [cpp_include(headers).split(/^/)]
- prelude << ["typedef #{type} rbcv_typedef_;\n",
- "extern rbcv_typedef_ *#{func};\n",
- "static rbcv_typedef_ #{var};\n",
- ]
- type = "rbcv_typedef_"
- fmt = member && !(typeof = have_typeof?) ? "seems %s" : "%s"
- if typeof
- var = "*rbcv_member_"
- func = "rbcv_mem_func_(void)"
- member = nil
- type = "rbcv_mem_typedef_"
- prelude[-1] << "typedef #{typeof}(#{val}) #{type};\n"
- prelude[-1] << "extern #{type} *#{func};\n"
- prelude[-1] << "static #{type} #{var};\n"
- val = var
- end
- def fmt.%(x)
- x ? super : "unknown"
- end
- checking_for checking_message(m, headers), fmt do
- if scalar_ptr_type?(type, member, prelude, &b)
- if try_static_assert("sizeof(*#{var}) == 1", prelude)
- return "string"
- end
- ptr = "*"
- elsif scalar_type?(type, member, prelude, &b)
- unless member and !typeof or try_static_assert("(#{type})-1 < 0", prelude)
- unsigned = "unsigned"
- end
- ptr = ""
+ def what_type?(type, member = nil, headers = nil, &b)
+ m = "#{type}"
+ var = val = "*rbcv_var_"
+ func = "rbcv_func_(void)"
+ if member
+ m << "." << member
else
- next
+ type, member = type.split('.', 2)
+ end
+ if member
+ val = "(#{var}).#{member}"
+ end
+ prelude = [cpp_include(headers).split(/^/)]
+ prelude << ["typedef #{type} rbcv_typedef_;\n",
+ "extern rbcv_typedef_ *#{func};\n",
+ "static rbcv_typedef_ #{var};\n",
+ ]
+ type = "rbcv_typedef_"
+ fmt = member && !(typeof = have_typeof?) ? "seems %s" : "%s"
+ if typeof
+ var = "*rbcv_member_"
+ func = "rbcv_mem_func_(void)"
+ member = nil
+ type = "rbcv_mem_typedef_"
+ prelude[-1] << "typedef #{typeof}(#{val}) #{type};\n"
+ prelude[-1] << "extern #{type} *#{func};\n"
+ prelude[-1] << "static #{type} #{var};\n"
+ val = var
end
- type = UNIVERSAL_INTS.find do |t|
- pre = prelude
- unless member
- pre += [["static #{unsigned} #{t} #{ptr}#{var};\n",
- "extern #{unsigned} #{t} #{ptr}*#{func};\n"]]
+ def fmt.%(x)
+ x ? super : "unknown"
+ end
+ checking_for checking_message(m, headers), fmt do
+ if scalar_ptr_type?(type, member, prelude, &b)
+ if try_static_assert("sizeof(*#{var}) == 1", prelude)
+ return "string"
+ end
+ ptr = "*"
+ elsif scalar_type?(type, member, prelude, &b)
+ unless member and !typeof or try_static_assert("(#{type})-1 < 0", prelude)
+ unsigned = "unsigned"
+ end
+ ptr = ""
+ else
+ next
+ end
+ type = UNIVERSAL_INTS.find do |t|
+ pre = prelude
+ unless member
+ pre += [["static #{unsigned} #{t} #{ptr}#{var};\n",
+ "extern #{unsigned} #{t} #{ptr}*#{func};\n"]]
+ end
+ try_static_assert("sizeof(#{ptr}#{val}) == sizeof(#{unsigned} #{t})", pre)
end
- try_static_assert("sizeof(#{ptr}#{val}) == sizeof(#{unsigned} #{t})", pre)
+ type or next
+ [unsigned, type, ptr].join(" ").strip
end
- type or next
- [unsigned, type, ptr].join(" ").strip
end
-end
-# This method is used internally by the find_executable method.
-#
-# Internal use only.
-#
-def find_executable0(bin, path = nil)
- executable_file = proc do |name|
- begin
- stat = File.stat(name)
- rescue SystemCallError
- else
- next name if stat.file? and stat.executable?
+ # This method is used internally by the find_executable method.
+ #
+ # Internal use only.
+ #
+ def find_executable0(bin, path = nil)
+ executable_file = proc do |name|
+ begin
+ stat = File.stat(name)
+ rescue SystemCallError
+ else
+ next name if stat.file? and stat.executable?
+ end
end
- end
- exts = config_string('EXECUTABLE_EXTS') {|s| s.split} || config_string('EXEEXT') {|s| [s]}
- if File.expand_path(bin) == bin
- return bin if executable_file.call(bin)
- if exts
- exts.each {|ext| executable_file.call(file = bin + ext) and return file}
+ exts = config_string('EXECUTABLE_EXTS') {|s| s.split} || config_string('EXEEXT') {|s| [s]}
+ if File.expand_path(bin) == bin
+ return bin if executable_file.call(bin)
+ if exts
+ exts.each {|ext| executable_file.call(file = bin + ext) and return file}
+ end
+ return nil
end
- return nil
- end
- if path ||= ENV['PATH']
- path = path.split(File::PATH_SEPARATOR)
- else
- path = %w[/usr/local/bin /usr/ucb /usr/bin /bin]
- end
- file = nil
- path.each do |dir|
- return file if executable_file.call(file = File.join(dir, bin))
- if exts
- exts.each {|ext| executable_file.call(ext = file + ext) and return ext}
+ if path ||= ENV['PATH']
+ path = path.split(File::PATH_SEPARATOR)
+ else
+ path = %w[/usr/local/bin /usr/ucb /usr/bin /bin]
+ end
+ file = nil
+ path.each do |dir|
+ return file if executable_file.call(file = File.join(dir, bin))
+ if exts
+ exts.each {|ext| executable_file.call(ext = file + ext) and return ext}
+ end
end
+ nil
end
- nil
-end
-
-# :startdoc:
-# Searches for the executable +bin+ on +path+. The default path is your
-# PATH environment variable. If that isn't defined, it will resort to
-# searching /usr/local/bin, /usr/ucb, /usr/bin and /bin.
-#
-# If found, it will return the full path, including the executable name,
-# of where it was found.
-#
-# Note that this method does not actually affect the generated Makefile.
-#
-def find_executable(bin, path = nil)
- checking_for checking_message(bin, path) do
- find_executable0(bin, path)
+ # :startdoc:
+
+ # Searches for the executable +bin+ on +path+. The default path is your
+ # +PATH+ environment variable. If that isn't defined, it will resort to
+ # searching /usr/local/bin, /usr/ucb, /usr/bin and /bin.
+ #
+ # If found, it will return the full path, including the executable name, of
+ # where it was found.
+ #
+ # Note that this method does not actually affect the generated Makefile.
+ #
+ def find_executable(bin, path = nil)
+ checking_for checking_message(bin, path) do
+ find_executable0(bin, path)
+ end
end
-end
-# :stopdoc:
+ # :stopdoc:
-def arg_config(config, default=nil, &block)
- $arg_config << [config, default]
- defaults = []
- if default
- defaults << default
- elsif !block
- defaults << nil
+ def arg_config(config, default=nil, &block)
+ $arg_config << [config, default]
+ defaults = []
+ if default
+ defaults << default
+ elsif !block
+ defaults << nil
+ end
+ $configure_args.fetch(config.tr('_', '-'), *defaults, &block)
+ end
+
+ # :startdoc:
+
+ # Tests for the presence of a <tt>--with-</tt>_config_ or
+ # <tt>--without-</tt>_config_ option. Returns +true+ if the with option is
+ # given, +false+ if the without option is given, and the default value
+ # otherwise.
+ #
+ # This can be useful for adding custom definitions, such as debug
+ # information.
+ #
+ # Example:
+ #
+ # if with_config("debug")
+ # $defs.push("-DOSSL_DEBUG") unless $defs.include? "-DOSSL_DEBUG"
+ # end
+ #
+ def with_config(config, default=nil)
+ config = config.sub(/^--with[-_]/, '')
+ val = arg_config("--with-"+config) do
+ if arg_config("--without-"+config)
+ false
+ elsif block_given?
+ yield(config, default)
+ else
+ break default
+ end
+ end
+ case val
+ when "yes"
+ true
+ when "no"
+ false
+ else
+ val
+ end
end
- $configure_args.fetch(config.tr('_', '-'), *defaults, &block)
-end
-# :startdoc:
-
-# Tests for the presence of a --with-<tt>config</tt> or --without-<tt>config</tt>
-# option. Returns true if the with option is given, false if the without
-# option is given, and the default value otherwise.
-#
-# This can be useful for adding custom definitions, such as debug information.
-#
-# Example:
-#
-# if with_config("debug")
-# $defs.push("-DOSSL_DEBUG") unless $defs.include? "-DOSSL_DEBUG"
-# end
-#
-def with_config(config, default=nil)
- config = config.sub(/^--with[-_]/, '')
- val = arg_config("--with-"+config) do
- if arg_config("--without-"+config)
+ # Tests for the presence of an <tt>--enable-</tt>_config_ or
+ # <tt>--disable-</tt>_config_ option. Returns +true+ if the enable option is
+ # given, +false+ if the disable option is given, and the default value
+ # otherwise.
+ #
+ # This can be useful for adding custom definitions, such as debug
+ # information.
+ #
+ # Example:
+ #
+ # if enable_config("debug")
+ # $defs.push("-DOSSL_DEBUG") unless $defs.include? "-DOSSL_DEBUG"
+ # end
+ #
+ def enable_config(config, default=nil)
+ if arg_config("--enable-"+config)
+ true
+ elsif arg_config("--disable-"+config)
false
elsif block_given?
yield(config, default)
else
- break default
+ return default
end
end
- case val
- when "yes"
- true
- when "no"
- false
- else
- val
- end
-end
-# Tests for the presence of an --enable-<tt>config</tt> or
-# --disable-<tt>config</tt> option. Returns true if the enable option is given,
-# false if the disable option is given, and the default value otherwise.
-#
-# This can be useful for adding custom definitions, such as debug information.
-#
-# Example:
-#
-# if enable_config("debug")
-# $defs.push("-DOSSL_DEBUG") unless $defs.include? "-DOSSL_DEBUG"
-# end
-#
-def enable_config(config, default=nil)
- if arg_config("--enable-"+config)
- true
- elsif arg_config("--disable-"+config)
- false
- elsif block_given?
- yield(config, default)
- else
- return default
- end
-end
+ # Generates a header file consisting of the various macro definitions
+ # generated by other methods such as have_func and have_header. These are
+ # then wrapped in a custom <code>#ifndef</code> based on the +header+ file
+ # name, which defaults to "extconf.h".
+ #
+ # For example:
+ #
+ # # extconf.rb
+ # require 'mkmf'
+ # have_func('realpath')
+ # have_header('sys/utime.h')
+ # create_header
+ # create_makefile('foo')
+ #
+ # The above script would generate the following extconf.h file:
+ #
+ # #ifndef EXTCONF_H
+ # #define EXTCONF_H
+ # #define HAVE_REALPATH 1
+ # #define HAVE_SYS_UTIME_H 1
+ # #endif
+ #
+ # Given that the create_header method generates a file based on definitions
+ # set earlier in your extconf.rb file, you will probably want to make this
+ # one of the last methods you call in your script.
+ #
+ def create_header(header = "extconf.h")
+ message "creating %s\n", header
+ sym = header.tr_cpp
+ hdr = ["#ifndef #{sym}\n#define #{sym}\n"]
+ for line in $defs
+ case line
+ when /^-D([^=]+)(?:=(.*))?/
+ hdr << "#define #$1 #{$2 ? Shellwords.shellwords($2)[0].gsub(/(?=\t+)/, "\\\n") : 1}\n"
+ when /^-U(.*)/
+ hdr << "#undef #$1\n"
+ end
+ end
+ hdr << "#endif\n"
+ hdr = hdr.join("")
+ log_src(hdr, "#{header} is")
+ unless (IO.read(header) == hdr rescue false)
+ open(header, "wb") do |hfile|
+ hfile.write(hdr)
+ end
+ end
+ $extconf_h = header
+ end
+
+ # Sets a +target+ name that the user can then use to configure various
+ # "with" options with on the command line by using that name. For example,
+ # if the target is set to "foo", then the user could use the
+ # <code>--with-foo-dir</code> command line option.
+ #
+ # You may pass along additional "include" or "lib" defaults via the
+ # +idefault+ and +ldefault+ parameters, respectively.
+ #
+ # Note that dir_config only adds to the list of places to search for
+ # libraries and include files. It does not link the libraries into your
+ # application.
+ #
+ def dir_config(target, idefault=nil, ldefault=nil)
+ if dir = with_config(target + "-dir", (idefault unless ldefault))
+ defaults = Array === dir ? dir : dir.split(File::PATH_SEPARATOR)
+ idefault = ldefault = nil
+ end
-# Generates a header file consisting of the various macro definitions generated
-# by other methods such as have_func and have_header. These are then wrapped in
-# a custom #ifndef based on the +header+ file name, which defaults to
-# 'extconf.h'.
-#
-# For example:
-#
-# # extconf.rb
-# require 'mkmf'
-# have_func('realpath')
-# have_header('sys/utime.h')
-# create_header
-# create_makefile('foo')
-#
-# The above script would generate the following extconf.h file:
-#
-# #ifndef EXTCONF_H
-# #define EXTCONF_H
-# #define HAVE_REALPATH 1
-# #define HAVE_SYS_UTIME_H 1
-# #endif
-#
-# Given that the create_header method generates a file based on definitions
-# set earlier in your extconf.rb file, you will probably want to make this
-# one of the last methods you call in your script.
-#
-def create_header(header = "extconf.h")
- message "creating %s\n", header
- sym = header.tr_cpp
- hdr = ["#ifndef #{sym}\n#define #{sym}\n"]
- for line in $defs
- case line
- when /^-D([^=]+)(?:=(.*))?/
- hdr << "#define #$1 #{$2 ? Shellwords.shellwords($2)[0].gsub(/(?=\t+)/, "\\\n") : 1}\n"
- when /^-U(.*)/
- hdr << "#undef #$1\n"
- end
- end
- hdr << "#endif\n"
- hdr = hdr.join
- unless (IO.read(header) == hdr rescue false)
- open(header, "wb") do |hfile|
- hfile.write(hdr)
- end
- end
- $extconf_h = header
-end
+ idir = with_config(target + "-include", idefault)
+ $arg_config.last[1] ||= "${#{target}-dir}/include"
+ ldir = with_config(target + "-lib", ldefault)
+ $arg_config.last[1] ||= "${#{target}-dir}/#{@libdir_basename}"
-# Sets a +target+ name that the user can then use to configure various 'with'
-# options with on the command line by using that name. For example, if the
-# target is set to "foo", then the user could use the --with-foo-dir command
-# line option.
-#
-# You may pass along additional 'include' or 'lib' defaults via the +idefault+
-# and +ldefault+ parameters, respectively.
-#
-# Note that dir_config only adds to the list of places to search for libraries
-# and include files. It does not link the libraries into your application.
-#
-def dir_config(target, idefault=nil, ldefault=nil)
- if dir = with_config(target + "-dir", (idefault unless ldefault))
- defaults = Array === dir ? dir : dir.split(File::PATH_SEPARATOR)
- idefault = ldefault = nil
- end
-
- idir = with_config(target + "-include", idefault)
- $arg_config.last[1] ||= "${#{target}-dir}/include"
- ldir = with_config(target + "-lib", ldefault)
- $arg_config.last[1] ||= "${#{target}-dir}/lib"
-
- idirs = idir ? Array === idir ? idir.dup : idir.split(File::PATH_SEPARATOR) : []
- if defaults
- idirs.concat(defaults.collect {|d| d + "/include"})
- idir = ([idir] + idirs).compact.join(File::PATH_SEPARATOR)
- end
- unless idirs.empty?
- idirs.collect! {|d| "-I" + d}
- idirs -= Shellwords.shellwords($CPPFLAGS)
+ idirs = idir ? Array === idir ? idir.dup : idir.split(File::PATH_SEPARATOR) : []
+ if defaults
+ idirs.concat(defaults.collect {|d| d + "/include"})
+ idir = ([idir] + idirs).compact.join(File::PATH_SEPARATOR)
+ end
unless idirs.empty?
- $CPPFLAGS = (idirs.quote << $CPPFLAGS).join(" ")
+ idirs.collect! {|d| "-I" + d}
+ idirs -= Shellwords.shellwords($CPPFLAGS)
+ unless idirs.empty?
+ $CPPFLAGS = (idirs.quote << $CPPFLAGS).join(" ")
+ end
end
- end
- ldirs = ldir ? Array === ldir ? ldir.dup : ldir.split(File::PATH_SEPARATOR) : []
- if defaults
- ldirs.concat(defaults.collect {|d| d + "/lib"})
- ldir = ([ldir] + ldirs).compact.join(File::PATH_SEPARATOR)
+ ldirs = ldir ? Array === ldir ? ldir.dup : ldir.split(File::PATH_SEPARATOR) : []
+ if defaults
+ ldirs.concat(defaults.collect {|d| "#{d}/#{@libdir_basename}"})
+ ldir = ([ldir] + ldirs).compact.join(File::PATH_SEPARATOR)
+ end
+ $LIBPATH = ldirs | $LIBPATH
+
+ [idir, ldir]
+ end
+
+ # :stopdoc:
+
+ # Handles meta information about installed libraries. Uses your platform's
+ # pkg-config program if it has one.
+ #
+ # The actual command name can be overridden by
+ # <code>--with-pkg-config</code> command line option.
+ def pkg_config(pkg)
+ if pkgconfig = with_config("#{pkg}-config") and find_executable0(pkgconfig)
+ # iff package specific config command is given
+ get = proc {|opt| `#{pkgconfig} --#{opt}`.strip}
+ elsif ($PKGCONFIG ||=
+ (pkgconfig = with_config("pkg-config", ("pkg-config" unless CROSS_COMPILING))) &&
+ find_executable0(pkgconfig) && pkgconfig) and
+ system("#{$PKGCONFIG} --exists #{pkg}")
+ # default to pkg-config command
+ get = proc {|opt| `#{$PKGCONFIG} --#{opt} #{pkg}`.strip}
+ elsif find_executable0(pkgconfig = "#{pkg}-config")
+ # default to package specific config command, as a last resort.
+ get = proc {|opt| `#{pkgconfig} --#{opt}`.strip}
+ end
+ if get and try_ldflags(ldflags = get['libs'])
+ cflags = get['cflags']
+ libs = get['libs-only-l']
+ ldflags = (Shellwords.shellwords(ldflags) - Shellwords.shellwords(libs)).quote.join(" ")
+ $CFLAGS += " " << cflags
+ $LDFLAGS += " " << ldflags
+ $libs += " " << libs
+ Logging::message "package configuration for %s\n", pkg
+ Logging::message "cflags: %s\nldflags: %s\nlibs: %s\n\n",
+ cflags, ldflags, libs
+ [cflags, ldflags, libs]
+ else
+ Logging::message "package configuration for %s is not found\n", pkg
+ nil
+ end
end
- $LIBPATH = ldirs | $LIBPATH
-
- [idir, ldir]
-end
-
-# :stopdoc:
-# Handles meta information about installed libraries. Uses your platform's
-# pkg-config program if it has one.
-def pkg_config(pkg)
- if pkgconfig = with_config("#{pkg}-config") and find_executable0(pkgconfig)
- # iff package specific config command is given
- get = proc {|opt| `#{pkgconfig} --#{opt}`.chomp}
- elsif ($PKGCONFIG ||=
- (pkgconfig = with_config("pkg-config", ("pkg-config" unless CROSS_COMPILING))) &&
- find_executable0(pkgconfig) && pkgconfig) and
- system("#{$PKGCONFIG} --exists #{pkg}")
- # default to pkg-config command
- get = proc {|opt| `#{$PKGCONFIG} --#{opt} #{pkg}`.chomp}
- elsif find_executable0(pkgconfig = "#{pkg}-config")
- # default to package specific config command, as a last resort.
- get = proc {|opt| `#{pkgconfig} --#{opt}`.chomp}
- end
- if get
- cflags = get['cflags']
- ldflags = get['libs']
- libs = get['libs-only-l']
- ldflags = (Shellwords.shellwords(ldflags) - Shellwords.shellwords(libs)).quote.join(" ")
- $CFLAGS += " " << cflags
- $LDFLAGS += " " << ldflags
- $libs += " " << libs
- Logging::message "package configuration for %s\n", pkg
- Logging::message "cflags: %s\nldflags: %s\nlibs: %s\n\n",
- cflags, ldflags, libs
- [cflags, ldflags, libs]
- else
- Logging::message "package configuration for %s is not found\n", pkg
- nil
+ def with_destdir(dir)
+ dir = dir.sub($dest_prefix_pattern, '')
+ /\A\$[\(\{]/ =~ dir ? dir : "$(DESTDIR)"+dir
end
-end
-def with_destdir(dir)
- dir = dir.sub($dest_prefix_pattern, '')
- /\A\$[\(\{]/ =~ dir ? dir : "$(DESTDIR)"+dir
-end
-
-# Converts forward slashes to backslashes. Aimed at MS Windows.
-#
-# Internal use only.
-#
-def winsep(s)
- s.tr('/', '\\')
-end
-
-# Converts native path to format acceptable in Makefile
-#
-# Internal use only.
-#
-if !CROSS_COMPILING
- case CONFIG['build_os']
- when 'mingw32'
- def mkintpath(path)
- # mingw uses make from msys and it needs special care
- # converts from C:\some\path to /C/some/path
- path = path.dup
- path.tr!('\\', '/')
- path.sub!(/\A([A-Za-z]):(?=\/)/, '/\1')
- path
- end
- end
-end
-unless defined?(mkintpath)
- def mkintpath(path)
- path
+ # Converts forward slashes to backslashes. Aimed at MS Windows.
+ #
+ # Internal use only.
+ #
+ def winsep(s)
+ s.tr('/', '\\')
end
-end
-def configuration(srcdir)
- mk = []
- vpath = $VPATH.dup
+ # Converts native path to format acceptable in Makefile
+ #
+ # Internal use only.
+ #
if !CROSS_COMPILING
case CONFIG['build_os']
+ when 'mingw32'
+ def mkintpath(path)
+ # mingw uses make from msys and it needs special care
+ # converts from C:\some\path to /C/some/path
+ path = path.dup
+ path.tr!('\\', '/')
+ path.sub!(/\A([A-Za-z]):(?=\/)/, '/\1')
+ path
+ end
when 'cygwin'
if CONFIG['target_os'] != 'cygwin'
- vpath = vpath.map {|p| p.sub(/.*/, '$(shell cygpath -u \&)')}
+ def mkintpath(path)
+ IO.popen(["cygpath", "-u", path], &:read).chomp
+ end
end
end
end
- CONFIG["hdrdir"] ||= $hdrdir
- mk << %{
+ unless method_defined?(:mkintpath)
+ def mkintpath(path)
+ path
+ end
+ end
+
+ def configuration(srcdir)
+ mk = []
+ vpath = $VPATH.dup
+ CONFIG["hdrdir"] ||= $hdrdir
+ mk << %{
SHELL = /bin/sh
# V=0 quiet, V=1 verbose. other values don't work.
V = 0
Q1 = $(V:1=)
Q = $(Q1:0=@)
-n=$(NULLCMD)
-ECHO1 = $(V:1=@$n)
+ECHO1 = $(V:1=@#{CONFIG['NULLCMD']})
ECHO = $(ECHO1:0=@echo)
#### Start of system configuration section. ####
#{"top_srcdir = " + $top_srcdir.sub(%r"\A#{Regexp.quote($topdir)}/", "$(topdir)/") if $extmk}
-srcdir = #{srcdir.gsub(/\$\((srcdir)\)|\$\{(srcdir)\}/) {mkintpath(CONFIG[$1||$2])}.quote}
-topdir = #{mkintpath($extmk ? CONFIG["topdir"] : $topdir).quote}
-hdrdir = #{mkintpath(CONFIG["hdrdir"]).quote}
+srcdir = #{srcdir.gsub(/\$\((srcdir)\)|\$\{(srcdir)\}/) {mkintpath(CONFIG[$1||$2]).unspace}}
+topdir = #{mkintpath($extmk ? CONFIG["topdir"] : $topdir).unspace}
+hdrdir = #{mkintpath(CONFIG["hdrdir"]).unspace}
arch_hdrdir = #{$arch_hdrdir.quote}
VPATH = #{vpath.join(CONFIG['PATH_SEPARATOR'])}
}
- if $extmk
- mk << "RUBYLIB =\n""RUBYOPT = -\n"
- end
- if destdir = CONFIG["prefix"][$dest_prefix_pattern, 1]
- mk << "\nDESTDIR = #{destdir}\n"
- end
- CONFIG.each do |key, var|
- next unless /prefix$/ =~ key
- mk << "#{key} = #{with_destdir(var)}\n"
- end
- CONFIG.each do |key, var|
- next if /^abs_/ =~ key
- next if /^(?:src|top|hdr)dir$/ =~ key
- next unless /dir$/ =~ key
- mk << "#{key} = #{with_destdir(var)}\n"
- end
- if !$extmk and !$configure_args.has_key?('--ruby') and
- sep = config_string('BUILD_FILE_SEPARATOR')
- sep = ":/=#{sep}"
- else
- sep = ""
- end
- possible_command = (proc {|s| s if /top_srcdir/ !~ s} unless $extmk)
- extconf_h = $extconf_h ? "-DRUBY_EXTCONF_H=\\\"$(RUBY_EXTCONF_H)\\\" " : $defs.join(" ") << " "
- mk << %{
-NULLCMD = #{CONFIG['NULLCMD']}
+ if $extmk
+ mk << "RUBYLIB =\n""RUBYOPT = -\n"
+ end
+ prefix = mkintpath(CONFIG["prefix"])
+ if destdir = prefix[$dest_prefix_pattern, 1]
+ mk << "\nDESTDIR = #{destdir}\n"
+ end
+ mk << "prefix = #{with_destdir(prefix).unspace}\n"
+ CONFIG.each do |key, var|
+ mk << "#{key} = #{with_destdir(mkintpath(var)).unspace}\n" if /.prefix$/ =~ key
+ end
+ CONFIG.each do |key, var|
+ next if /^abs_/ =~ key
+ next if /^(?:src|top|hdr)dir$/ =~ key
+ next unless /dir$/ =~ key
+ mk << "#{key} = #{with_destdir(var)}\n"
+ end
+ if !$extmk and !$configure_args.has_key?('--ruby') and
+ sep = config_string('BUILD_FILE_SEPARATOR')
+ sep = ":/=#{sep}"
+ else
+ sep = ""
+ end
+ possible_command = (proc {|s| s if /top_srcdir/ !~ s} unless $extmk)
+ extconf_h = $extconf_h ? "-DRUBY_EXTCONF_H=\\\"$(RUBY_EXTCONF_H)\\\" " : $defs.join(" ") << " "
+ headers = %w[$(hdrdir)/ruby.h $(hdrdir)/ruby/defines.h]
+ if RULE_SUBST
+ headers.each {|h| h.sub!(/.*/, &RULE_SUBST.method(:%))}
+ end
+ headers << $config_h
+ headers << '$(RUBY_EXTCONF_H)' if $extconf_h
+ mk << %{
CC = #{CONFIG['CC']}
CXX = #{CONFIG['CXX']}
@@ -1685,23 +1800,24 @@ LIBRUBY = #{CONFIG['LIBRUBY']}
LIBRUBY_A = #{CONFIG['LIBRUBY_A']}
LIBRUBYARG_SHARED = #$LIBRUBYARG_SHARED
LIBRUBYARG_STATIC = #$LIBRUBYARG_STATIC
-OUTFLAG = #{OUTFLAG}
-COUTFLAG = #{COUTFLAG}
+empty =
+OUTFLAG = #{OUTFLAG}$(empty)
+COUTFLAG = #{COUTFLAG}$(empty)
RUBY_EXTCONF_H = #{$extconf_h}
cflags = #{CONFIG['cflags']}
optflags = #{CONFIG['optflags']}
debugflags = #{CONFIG['debugflags']}
warnflags = #{$warnflags}
-CFLAGS = #{$static ? '' : CONFIG['CCDLFLAGS']} #$CFLAGS #$ARCH_FLAG
+CFLAGS = #{$static ? '' : CONFIG['CCDLFLAGS']} #$CFLAGS $(ARCH_FLAG)
INCFLAGS = -I. #$INCFLAGS
DEFS = #{CONFIG['DEFS']}
CPPFLAGS = #{extconf_h}#{$CPPFLAGS}
CXXFLAGS = $(CFLAGS) #{CONFIG['CXXFLAGS']}
ldflags = #{$LDFLAGS}
-dldflags = #{$DLDFLAGS}
+dldflags = #{$DLDFLAGS} #{CONFIG['EXTDLDFLAGS']}
ARCH_FLAG = #{$ARCH_FLAG}
-DLDFLAGS = $(ldflags) $(dldflags)
+DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
LDSHARED = #{CONFIG['LDSHARED']}
LDSHAREDXX = #{config_string('LDSHAREDXX') || '$(LDSHARED)'}
AR = #{CONFIG['AR']}
@@ -1713,8 +1829,10 @@ RUBY_SO_NAME = #{CONFIG['RUBY_SO_NAME']}
arch = #{CONFIG['arch']}
sitearch = #{CONFIG['sitearch']}
ruby_version = #{RbConfig::CONFIG['ruby_version']}
-ruby = #{$ruby}
+ruby = #{$ruby.sub(%r[\A#{Regexp.quote(RbConfig::CONFIG['bindir'])}(?=/|\z)]) {'$(bindir)'}}
RUBY = $(ruby#{sep})
+ruby_headers = #{headers.join(' ')}
+
RM = #{config_string('RM', &possible_command) || '$(RUBY) -run -e rm -- -f'}
RM_RF = #{'$(RUBY) -run -e rm -- -rf'}
RMDIRS = #{config_string('RMDIRS', &possible_command) || '$(RUBY) -run -e rmdir -- -p'}
@@ -1723,227 +1841,250 @@ INSTALL = #{config_string('INSTALL', &possible_command) || '@$(RUBY) -run -e ins
INSTALL_PROG = #{config_string('INSTALL_PROG') || '$(INSTALL) -m 0755'}
INSTALL_DATA = #{config_string('INSTALL_DATA') || '$(INSTALL) -m 0644'}
COPY = #{config_string('CP', &possible_command) || '@$(RUBY) -run -e cp -- -v'}
+TOUCH = exit >
#### End of system configuration section. ####
preload = #{defined?($preload) && $preload ? $preload.join(' ') : ''}
}
- if $nmake == ?b
- mk.each do |x|
- x.gsub!(/^(MAKEDIRS|INSTALL_(?:PROG|DATA))+\s*=.*\n/) do
- "!ifndef " + $1 + "\n" +
- $& +
- "!endif\n"
+ if $nmake == ?b
+ mk.each do |x|
+ x.gsub!(/^(MAKEDIRS|INSTALL_(?:PROG|DATA))+\s*=.*\n/) do
+ "!ifndef " + $1 + "\n" +
+ $& +
+ "!endif\n"
+ end
end
end
+ mk
end
- mk
-end
-# :startdoc:
-# creates a stub Makefile.
-#
-def dummy_makefile(srcdir)
- configuration(srcdir) << <<RULES << CLEANINGS
+ def timestamp_file(name)
+ name = name.gsub(/(\$[({]|[})])|(\/+)|[^-.\w]+/) {$1 ? "" : $2 ? ".-." : "_"}
+ "./.#{name}.time"
+ end
+ # :startdoc:
+
+ # creates a stub Makefile.
+ #
+ def dummy_makefile(srcdir)
+ configuration(srcdir) << <<RULES << CLEANINGS
CLEANFILES = #{$cleanfiles.join(' ')}
DISTCLEANFILES = #{$distcleanfiles.join(' ')}
all install static install-so install-rb: Makefile
.PHONY: all install static install-so install-rb
-.PHONY: clean clean-so clean-rb
+.PHONY: clean clean-so clean-static clean-rb
RULES
-end
+ end
-# Processes the data contents of the "depend" file.
-# Each line of this file is expected to be a file name.
-#
-# Returns the output of findings, in Makefile format.
-#
-def depend_rules(depend)
- suffixes = []
- depout = []
- cont = implicit = nil
- impconv = proc do
- COMPILE_RULES.each {|rule| depout << (rule % implicit[0]) << implicit[1]}
- implicit = nil
- end
- ruleconv = proc do |line|
- if implicit
- if /\A\t/ =~ line
- implicit[1] << line
- next
+ def each_compile_rules
+ vpath_splat = /\$\(\*VPATH\*\)/
+ COMPILE_RULES.each do |rule|
+ if vpath_splat =~ rule
+ $VPATH.each do |path|
+ yield rule.sub(vpath_splat) {path}
+ end
else
- impconv[]
+ yield rule
end
end
- if m = /\A\.(\w+)\.(\w+)(?:\s*:)/.match(line)
- suffixes << m[1] << m[2]
- implicit = [[m[1], m[2]], [m.post_match]]
- next
- elsif RULE_SUBST and /\A(?!\s*\w+\s*=)[$\w][^#]*:/ =~ line
- line.gsub!(%r"(\s)(?!\.)([^$(){}+=:\s\/\\,]+)(?=\s|\z)") {$1 + RULE_SUBST % $2}
- end
- depout << line
- end
- depend.each_line do |line|
- line.gsub!(/\.o\b/, ".#{$OBJEXT}")
- line.gsub!(/\$\((?:hdr|top)dir\)\/config.h/, $config_h)
- line.gsub!(%r"\$\(hdrdir\)/(?!ruby(?![^:;/\s]))(?=[-\w]+\.h)", '\&ruby/')
- if $nmake && /\A\s*\$\(RM|COPY\)/ =~ line
- line.gsub!(%r"[-\w\./]{2,}"){$&.tr("/", "\\")}
- line.gsub!(/(\$\((?!RM|COPY)[^:)]+)(?=\))/, '\1:/=\\')
- end
- if /(?:^|[^\\])(?:\\\\)*\\$/ =~ line
- (cont ||= []) << line
- next
- elsif cont
- line = (cont << line).join
- cont = nil
- end
- ruleconv.call(line)
- end
- if cont
- ruleconv.call(cont.join)
- elsif implicit
- impconv.call
- end
- unless suffixes.empty?
- depout.unshift(".SUFFIXES: ." + suffixes.uniq.join(" .") + "\n\n")
- end
- depout.unshift("$(OBJS): $(RUBY_EXTCONF_H)\n\n") if $extconf_h
- depout.flatten!
- depout
-end
-
-# Generates the Makefile for your extension, passing along any options and
-# preprocessor constants that you may have generated through other methods.
-#
-# The +target+ name should correspond the name of the global function name
-# defined within your C extension, minus the 'Init_'. For example, if your
-# C extension is defined as 'Init_foo', then your target would simply be 'foo'.
-#
-# If any '/' characters are present in the target name, only the last name
-# is interpreted as the target name, and the rest are considered toplevel
-# directory names, and the generated Makefile will be altered accordingly to
-# follow that directory structure.
-#
-# For example, if you pass 'test/foo' as a target name, your extension will
-# be installed under the 'test' directory. This means that in order to
-# load the file within a Ruby program later, that directory structure will
-# have to be followed, e.g. "require 'test/foo'".
-#
-# The +srcprefix+ should be used when your source files are not in the same
-# directory as your build script. This will not only eliminate the need for
-# you to manually copy the source files into the same directory as your build
-# script, but it also sets the proper +target_prefix+ in the generated
-# Makefile.
-#
-# Setting the +target_prefix+ will, in turn, install the generated binary in
-# a directory under your RbConfig::CONFIG['sitearchdir'] that mimics your local
-# filesystem when you run 'make install'.
-#
-# For example, given the following file tree:
-#
-# ext/
-# extconf.rb
-# test/
-# foo.c
-#
-# And given the following code:
-#
-# create_makefile('test/foo', 'test')
-#
-# That will set the +target_prefix+ in the generated Makefile to 'test'. That,
-# in turn, will create the following file tree when installed via the
-# 'make install' command:
-#
-# /path/to/ruby/sitearchdir/test/foo.so
-#
-# It is recommended that you use this approach to generate your makefiles,
-# instead of copying files around manually, because some third party
-# libraries may depend on the +target_prefix+ being set properly.
-#
-# The +srcprefix+ argument can be used to override the default source
-# directory, i.e. the current directory . It is included as part of the VPATH
-# and added to the list of INCFLAGS.
-#
-def create_makefile(target, srcprefix = nil)
- $target = target
- libpath = $DEFLIBPATH|$LIBPATH
- message "creating Makefile\n"
- rm_f "conftest*"
- if CONFIG["DLEXT"] == $OBJEXT
- for lib in libs = $libs.split
- lib.sub!(/-l(.*)/, %%"lib\\1.#{$LIBEXT}"%)
- end
- $defs.push(format("-DEXTLIB='%s'", libs.join(",")))
- end
-
- if target.include?('/')
- target_prefix, target = File.split(target)
- target_prefix[0,0] = '/'
- else
- target_prefix = ""
end
- srcprefix ||= "$(srcdir)/#{srcprefix}".chomp('/')
- RbConfig.expand(srcdir = srcprefix.dup)
-
- ext = ".#{$OBJEXT}"
- if not $objs
- srcs = $srcs || Dir[File.join(srcdir, "*.{#{SRC_EXT.join(%q{,})}}")]
- objs = srcs.inject(Hash.new {[]}) {|h, f| h[File.basename(f, ".*") << ext] <<= f; h}
- $objs = objs.keys
- unless objs.delete_if {|b, f| f.size == 1}.empty?
- dups = objs.sort.map {|b, f|
- "#{b[/.*\./]}{#{f.collect {|n| n[/([^.]+)\z/]}.join(',')}}"
- }
- abort "source files duplication - #{dups.join(", ")}"
+ # Processes the data contents of the "depend" file. Each line of this file
+ # is expected to be a file name.
+ #
+ # Returns the output of findings, in Makefile format.
+ #
+ def depend_rules(depend)
+ suffixes = []
+ depout = []
+ cont = implicit = nil
+ impconv = proc do
+ each_compile_rules {|rule| depout << (rule % implicit[0]) << implicit[1]}
+ implicit = nil
+ end
+ ruleconv = proc do |line|
+ if implicit
+ if /\A\t/ =~ line
+ implicit[1] << line
+ next
+ else
+ impconv[]
+ end
+ end
+ if m = /\A\.(\w+)\.(\w+)(?:\s*:)/.match(line)
+ suffixes << m[1] << m[2]
+ implicit = [[m[1], m[2]], [m.post_match]]
+ next
+ elsif RULE_SUBST and /\A(?!\s*\w+\s*=)[$\w][^#]*:/ =~ line
+ line.gsub!(%r"(\s)(?!\.)([^$(){}+=:\s\/\\,]+)(?=\s|\z)") {$1 + RULE_SUBST % $2}
+ end
+ depout << line
+ end
+ depend.each_line do |line|
+ line.gsub!(/\.o\b/, ".#{$OBJEXT}")
+ line.gsub!(/\$\((?:hdr|top)dir\)\/config.h/, $config_h)
+ line.gsub!(%r"\$\(hdrdir\)/(?!ruby(?![^:;/\s]))(?=[-\w]+\.h)", '\&ruby/')
+ if $nmake && /\A\s*\$\(RM|COPY\)/ =~ line
+ line.gsub!(%r"[-\w\./]{2,}"){$&.tr("/", "\\")}
+ line.gsub!(/(\$\((?!RM|COPY)[^:)]+)(?=\))/, '\1:/=\\')
+ end
+ if /(?:^|[^\\])(?:\\\\)*\\$/ =~ line
+ (cont ||= []) << line
+ next
+ elsif cont
+ line = (cont << line).join
+ cont = nil
+ end
+ ruleconv.call(line)
+ end
+ if cont
+ ruleconv.call(cont.join)
+ elsif implicit
+ impconv.call
+ end
+ unless suffixes.empty?
+ depout.unshift(".SUFFIXES: ." + suffixes.uniq.join(" .") + "\n\n")
+ end
+ depout.unshift("$(OBJS): $(RUBY_EXTCONF_H)\n\n") if $extconf_h
+ depout.flatten!
+ depout
+ end
+
+ # Generates the Makefile for your extension, passing along any options and
+ # preprocessor constants that you may have generated through other methods.
+ #
+ # The +target+ name should correspond the name of the global function name
+ # defined within your C extension, minus the +Init_+. For example, if your
+ # C extension is defined as +Init_foo+, then your target would simply be
+ # "foo".
+ #
+ # If any "/" characters are present in the target name, only the last name
+ # is interpreted as the target name, and the rest are considered toplevel
+ # directory names, and the generated Makefile will be altered accordingly to
+ # follow that directory structure.
+ #
+ # For example, if you pass "test/foo" as a target name, your extension will
+ # be installed under the "test" directory. This means that in order to
+ # load the file within a Ruby program later, that directory structure will
+ # have to be followed, e.g. <code>require 'test/foo'</code>.
+ #
+ # The +srcprefix+ should be used when your source files are not in the same
+ # directory as your build script. This will not only eliminate the need for
+ # you to manually copy the source files into the same directory as your
+ # build script, but it also sets the proper +target_prefix+ in the generated
+ # Makefile.
+ #
+ # Setting the +target_prefix+ will, in turn, install the generated binary in
+ # a directory under your <code>RbConfig::CONFIG['sitearchdir']</code> that
+ # mimics your local filesystem when you run <code>make install</code>.
+ #
+ # For example, given the following file tree:
+ #
+ # ext/
+ # extconf.rb
+ # test/
+ # foo.c
+ #
+ # And given the following code:
+ #
+ # create_makefile('test/foo', 'test')
+ #
+ # That will set the +target_prefix+ in the generated Makefile to "test".
+ # That, in turn, will create the following file tree when installed via the
+ # <code>make install</code> command:
+ #
+ # /path/to/ruby/sitearchdir/test/foo.so
+ #
+ # It is recommended that you use this approach to generate your makefiles,
+ # instead of copying files around manually, because some third party
+ # libraries may depend on the +target_prefix+ being set properly.
+ #
+ # The +srcprefix+ argument can be used to override the default source
+ # directory, i.e. the current directory. It is included as part of the
+ # +VPATH+ and added to the list of +INCFLAGS+.
+ #
+ def create_makefile(target, srcprefix = nil)
+ $target = target
+ libpath = $DEFLIBPATH|$LIBPATH
+ message "creating Makefile\n"
+ MakeMakefile.rm_f "conftest*"
+ if CONFIG["DLEXT"] == $OBJEXT
+ for lib in libs = $libs.split
+ lib.sub!(/-l(.*)/, %%"lib\\1.#{$LIBEXT}"%)
+ end
+ $defs.push(format("-DEXTLIB='%s'", libs.join(",")))
end
- else
- $objs.collect! {|o| File.basename(o, ".*") << ext} unless $OBJEXT == "o"
- srcs = $srcs || $objs.collect {|o| o.chomp(ext) << ".c"}
- end
- $srcs = srcs
- target = nil if $objs.empty?
+ if target.include?('/')
+ target_prefix, target = File.split(target)
+ target_prefix[0,0] = '/'
+ else
+ target_prefix = ""
+ end
- if target and EXPORT_PREFIX
- if File.exist?(File.join(srcdir, target + '.def'))
- deffile = "$(srcdir)/$(TARGET).def"
- unless EXPORT_PREFIX.empty?
- makedef = %{-pe "$_.sub!(/^(?=\\w)/,'#{EXPORT_PREFIX}') unless 1../^EXPORTS$/i"}
+ srcprefix ||= "$(srcdir)/#{srcprefix}".chomp('/')
+ RbConfig.expand(srcdir = srcprefix.dup)
+
+ ext = ".#{$OBJEXT}"
+ orig_srcs = Dir[File.join(srcdir, "*.{#{SRC_EXT.join(%q{,})}}")]
+ if not $objs
+ srcs = $srcs || orig_srcs
+ objs = srcs.inject(Hash.new {[]}) {|h, f| h[File.basename(f, ".*") << ext] <<= f; h}
+ $objs = objs.keys
+ unless objs.delete_if {|b, f| f.size == 1}.empty?
+ dups = objs.sort.map {|b, f|
+ "#{b[/.*\./]}{#{f.collect {|n| n[/([^.]+)\z/]}.join(',')}}"
+ }
+ abort "source files duplication - #{dups.join(", ")}"
end
else
- makedef = %{-e "puts 'EXPORTS', '#{EXPORT_PREFIX}' + 'Init_$(TARGET)'.sub(/\\..*\\z/,'')"}
+ $objs.collect! {|o| File.basename(o, ".*") << ext} unless $OBJEXT == "o"
+ srcs = $srcs || $objs.collect {|o| o.chomp(ext) << ".c"}
end
- if makedef
- $cleanfiles << '$(DEFFILE)'
- origdef = deffile
- deffile = "$(TARGET)-$(arch).def"
+ $srcs = srcs
+
+ hdrs = Dir[File.join(srcdir, "*.{#{HDR_EXT.join(%q{,})}}")]
+
+ target = nil if $objs.empty?
+
+ if target and EXPORT_PREFIX
+ if File.exist?(File.join(srcdir, target + '.def'))
+ deffile = "$(srcdir)/$(TARGET).def"
+ unless EXPORT_PREFIX.empty?
+ makedef = %{-pe "$_.sub!(/^(?=\\w)/,'#{EXPORT_PREFIX}') unless 1../^EXPORTS$/i"}
+ end
+ else
+ makedef = %{-e "puts 'EXPORTS', '$(TARGET_ENTRY)'"}
+ end
+ if makedef
+ $cleanfiles << '$(DEFFILE)'
+ origdef = deffile
+ deffile = "$(TARGET)-$(arch).def"
+ end
end
- end
- origdef ||= ''
+ origdef ||= ''
- if $extout and $INSTALLFILES
- $cleanfiles.concat($INSTALLFILES.collect {|files, dir|File.join(dir, files.sub(/\A\.\//, ''))})
- $distcleandirs.concat($INSTALLFILES.collect {|files, dir| dir})
- end
+ if $extout and $INSTALLFILES
+ $cleanfiles.concat($INSTALLFILES.collect {|files, dir|File.join(dir, files.sub(/\A\.\//, ''))})
+ $distcleandirs.concat($INSTALLFILES.collect {|files, dir| dir})
+ end
- if $extmk and not $extconf_h
- create_header
- end
+ if $extmk and not $extconf_h
+ create_header
+ end
- libpath = libpathflag(libpath)
+ libpath = libpathflag(libpath)
- dllib = target ? "$(TARGET).#{CONFIG['DLEXT']}" : ""
- staticlib = target ? "$(TARGET).#$LIBEXT" : ""
- mfile = open("Makefile", "wb")
- conf = configuration(srcprefix)
- conf = yield(conf) if block_given?
- mfile.puts(conf)
- mfile.print "
+ dllib = target ? "$(TARGET).#{CONFIG['DLEXT']}" : ""
+ staticlib = target ? "$(TARGET).#$LIBEXT" : ""
+ mfile = open("Makefile", "wb")
+ conf = configuration(srcprefix)
+ conf = yield(conf) if block_given?
+ mfile.puts(conf)
+ mfile.print "
libpath = #{($DEFLIBPATH|$LIBPATH).join(" ")}
LIBPATH = #{libpath}
DEFFILE = #{deffile}
@@ -1957,18 +2098,22 @@ extout_prefix = #{$extout_prefix}
target_prefix = #{target_prefix}
LOCAL_LIBS = #{$LOCAL_LIBS}
LIBS = #{$LIBRUBYARG} #{$libs} #{$LIBS}
-SRCS = #{srcs.collect(&File.method(:basename)).join(' ')}
+ORIG_SRCS = #{orig_srcs.collect(&File.method(:basename)).join(' ')}
+SRCS = $(ORIG_SRCS) #{(srcs - orig_srcs).collect(&File.method(:basename)).join(' ')}
OBJS = #{$objs.join(" ")}
+HDRS = #{hdrs.map{|h| '$(srcdir)/' + File.basename(h)}.join(' ')}
TARGET = #{target}
+TARGET_NAME = #{target && target[/\A\w+/]}
+TARGET_ENTRY = #{EXPORT_PREFIX || ''}Init_$(TARGET_NAME)
DLLIB = #{dllib}
EXTSTATIC = #{$static || ""}
STATIC_LIB = #{staticlib unless $static.nil?}
#{!$extout && defined?($installed_list) ? "INSTALLED_LIST = #{$installed_list}\n" : ""}
" #"
- # TODO: fixme
- install_dirs.each {|d| mfile.print("%-14s= %s\n" % d) if /^[[:upper:]]/ =~ d[0]}
- n = ($extout ? '$(RUBYARCHDIR)/' : '') + '$(TARGET)'
- mfile.print "
+ # TODO: fixme
+ install_dirs.each {|d| mfile.print("%-14s= %s\n" % d) if /^[[:upper:]]/ =~ d[0]}
+ n = ($extout ? '$(RUBYARCHDIR)/' : '') + '$(TARGET)'
+ mfile.print "
TARGET_SO = #{($extout ? '$(RUBYARCHDIR)/' : '')}$(DLLIB)
CLEANLIBS = #{n}.#{CONFIG['DLEXT']} #{config_string('cleanlibs') {|t| t.gsub(/\$\*/) {n}}}
CLEANOBJS = *.#{$OBJEXT} #{config_string('cleanobjs') {|t| t.gsub(/\$\*/, "$(TARGET)#{deffile ? '-$(arch)': ''}")} if target} *.bak
@@ -1976,325 +2121,334 @@ CLEANOBJS = *.#{$OBJEXT} #{config_string('cleanobjs') {|t| t.gsub(/\$\*/, "$
all: #{$extout ? "install" : target ? "$(DLLIB)" : "Makefile"}
static: $(STATIC_LIB)#{$extout ? " install-rb" : ""}
.PHONY: all install static install-so install-rb
-.PHONY: clean clean-so clean-rb
+.PHONY: clean clean-so clean-static clean-rb
"
- mfile.print CLEANINGS
- fsep = config_string('BUILD_FILE_SEPARATOR') {|s| s unless s == "/"}
- if fsep
- sep = ":/=#{fsep}"
- fseprepl = proc {|s|
- s = s.gsub("/", fsep)
- s = s.gsub(/(\$\(\w+)(\))/) {$1+sep+$2}
- s = s.gsub(/(\$\{\w+)(\})/) {$1+sep+$2}
- }
- rsep = ":#{fsep}=/"
- else
- fseprepl = proc {|s| s}
- sep = ""
- rsep = ""
- end
- dirs = []
- mfile.print "install: install-so install-rb\n\n"
- sodir = (dir = "$(RUBYARCHDIR)").dup
- mfile.print("install-so: ")
- if target
- f = "$(DLLIB)"
- dest = "#{dir}/#{f}"
- mfile.puts dir, "install-so: #{dest}"
- if $extout
- mfile.print "clean-so::\n"
- mfile.print "\t@-$(RM) #{fseprepl[dest]}\n"
- mfile.print "\t@-$(RMDIRS) #{fseprepl[dir]}#{$ignore_error}\n"
+ mfile.print CLEANINGS
+ fsep = config_string('BUILD_FILE_SEPARATOR') {|s| s unless s == "/"}
+ if fsep
+ sep = ":/=#{fsep}"
+ fseprepl = proc {|s|
+ s = s.gsub("/", fsep)
+ s = s.gsub(/(\$\(\w+)(\))/) {$1+sep+$2}
+ s = s.gsub(/(\$\{\w+)(\})/) {$1+sep+$2}
+ }
+ rsep = ":#{fsep}=/"
else
- mfile.print "#{dest}: #{f}\n\t@-$(MAKEDIRS) $(@D#{sep})\n"
- mfile.print "\t$(INSTALL_PROG) #{fseprepl[f]} $(@D#{sep})\n"
- if defined?($installed_list)
- mfile.print "\t@echo #{dir}/#{File.basename(f)}>>$(INSTALLED_LIST)\n"
- end
+ fseprepl = proc {|s| s}
+ sep = ""
+ rsep = ""
end
- else
- mfile.puts "Makefile"
- end
- mfile.print("install-rb: pre-install-rb install-rb-default\n")
- mfile.print("install-rb-default: pre-install-rb-default\n")
- mfile.print("pre-install-rb: Makefile\n")
- mfile.print("pre-install-rb-default: Makefile\n")
- for sfx, i in [["-default", [["lib/**/*.rb", "$(RUBYLIBDIR)", "lib"]]], ["", $INSTALLFILES]]
- files = install_files(mfile, i, nil, srcprefix) or next
- for dir, *files in files
- unless dirs.include?(dir)
- dirs << dir
- mfile.print "pre-install-rb#{sfx}: #{dir}\n"
+ dirs = []
+ mfile.print "install: install-so install-rb\n\n"
+ sodir = (dir = "$(RUBYARCHDIR)").dup
+ mfile.print("install-so: ")
+ if target
+ f = "$(DLLIB)"
+ dest = "#{dir}/#{f}"
+ if $extout
+ mfile.puts dest
+ mfile.print "clean-so::\n"
+ mfile.print "\t-$(Q)$(RM) #{fseprepl[dest]}\n"
+ mfile.print "\t-$(Q)$(RMDIRS) #{fseprepl[dir]}#{$ignore_error}\n"
+ else
+ mfile.print "#{f} #{timestamp_file(dir)}\n"
+ mfile.print "\t$(INSTALL_PROG) #{fseprepl[f]} #{dir}\n"
+ if defined?($installed_list)
+ mfile.print "\t@echo #{dir}/#{File.basename(f)}>>$(INSTALLED_LIST)\n"
+ end
end
- for f in files
- dest = "#{dir}/#{File.basename(f)}"
- mfile.print("install-rb#{sfx}: #{dest} #{dir}\n")
- mfile.print("#{dest}: #{f}\n")
- mfile.print("\t$(Q) $(#{$extout ? 'COPY' : 'INSTALL_DATA'}) #{f} $(@D#{sep})\n")
- if defined?($installed_list) and !$extout
- mfile.print("\t@echo #{dest}>>$(INSTALLED_LIST)\n")
+ mfile.print "clean-static::\n"
+ mfile.print "\t-$(Q)$(RM) $(STATIC_LIB)\n"
+ else
+ mfile.puts "Makefile"
+ end
+ mfile.print("install-rb: pre-install-rb install-rb-default\n")
+ mfile.print("install-rb-default: pre-install-rb-default\n")
+ mfile.print("pre-install-rb: Makefile\n")
+ mfile.print("pre-install-rb-default: Makefile\n")
+ for sfx, i in [["-default", [["lib/**/*.rb", "$(RUBYLIBDIR)", "lib"]]], ["", $INSTALLFILES]]
+ files = install_files(mfile, i, nil, srcprefix) or next
+ for dir, *files in files
+ unless dirs.include?(dir)
+ dirs << dir
+ mfile.print "pre-install-rb#{sfx}: #{timestamp_file(dir)}\n"
end
- if $extout
- mfile.print("clean-rb#{sfx}::\n")
- mfile.print("\t@-$(RM) #{fseprepl[dest]}\n")
+ for f in files
+ dest = "#{dir}/#{File.basename(f)}"
+ mfile.print("install-rb#{sfx}: #{dest}\n")
+ mfile.print("#{dest}: #{f} #{timestamp_file(dir)}\n")
+ mfile.print("\t$(Q) $(#{$extout ? 'COPY' : 'INSTALL_DATA'}) #{f} $(@D#{sep})\n")
+ if defined?($installed_list) and !$extout
+ mfile.print("\t@echo #{dest}>>$(INSTALLED_LIST)\n")
+ end
+ if $extout
+ mfile.print("clean-rb#{sfx}::\n")
+ mfile.print("\t-$(Q)$(RM) #{fseprepl[dest]}\n")
+ end
end
end
- end
- mfile.print "pre-install-rb#{sfx}:\n"
- mfile.print("\t$(ECHO) installing#{sfx.sub(/^-/, " ")} #{target} libraries\n")
- if $extout
- dirs.uniq!
- unless dirs.empty?
- mfile.print("clean-rb#{sfx}::\n")
- for dir in dirs.sort_by {|d| -d.count('/')}
- mfile.print("\t@-$(RMDIRS) #{fseprepl[dir]}#{$ignore_error}\n")
+ mfile.print "pre-install-rb#{sfx}:\n"
+ mfile.print("\t$(ECHO) installing#{sfx.sub(/^-/, " ")} #{target} libraries\n")
+ if $extout
+ dirs.uniq!
+ unless dirs.empty?
+ mfile.print("clean-rb#{sfx}::\n")
+ for dir in dirs.sort_by {|d| -d.count('/')}
+ mfile.print("\t-$(Q)$(RMDIRS) #{fseprepl[dir]}#{$ignore_error}\n")
+ end
end
end
end
- end
- dirs.unshift(sodir) if target and !dirs.include?(sodir)
- dirs.each {|d| mfile.print "#{d}:\n\t$(Q) $(MAKEDIRS) $@\n"}
+ dirs.unshift(sodir) if target and !dirs.include?(sodir)
+ dirs.each do |d|
+ t = timestamp_file(d)
+ mfile.print "#{t}:\n\t$(Q) $(MAKEDIRS) #{d}\n\t$(Q) $(TOUCH) $@\n"
+ end
- mfile.print <<-SITEINSTALL
+ mfile.print <<-SITEINSTALL
site-install: site-install-so site-install-rb
site-install-so: install-so
site-install-rb: install-rb
- SITEINSTALL
+ SITEINSTALL
- return unless target
+ return unless target
- mfile.puts SRC_EXT.collect {|e| ".path.#{e} = $(VPATH)"} if $nmake == ?b
- mfile.print ".SUFFIXES: .#{SRC_EXT.join(' .')} .#{$OBJEXT}\n"
- mfile.print "\n"
+ mfile.puts SRC_EXT.collect {|e| ".path.#{e} = $(VPATH)"} if $nmake == ?b
+ mfile.print ".SUFFIXES: .#{SRC_EXT.join(' .')} .#{$OBJEXT}\n"
+ mfile.print "\n"
- compile_command = "\n\t$(ECHO) compiling $(<#{rsep})\n\t$(Q) %s\n\n"
- CXX_EXT.each do |e|
- COMPILE_RULES.each do |rule|
- mfile.printf(rule, e, $OBJEXT)
- mfile.printf(compile_command, COMPILE_CXX)
+ compile_command = "\n\t$(ECHO) compiling $(<#{rsep})\n\t$(Q) %s\n\n"
+ CXX_EXT.each do |e|
+ each_compile_rules do |rule|
+ mfile.printf(rule, e, $OBJEXT)
+ mfile.printf(compile_command, COMPILE_CXX)
+ end
end
- end
- C_EXT.each do |e|
- COMPILE_RULES.each do |rule|
- mfile.printf(rule, e, $OBJEXT)
- mfile.printf(compile_command, COMPILE_C)
+ C_EXT.each do |e|
+ each_compile_rules do |rule|
+ mfile.printf(rule, e, $OBJEXT)
+ mfile.printf(compile_command, COMPILE_C)
+ end
end
- end
- mfile.print "$(RUBYARCHDIR)/" if $extout
- mfile.print "$(DLLIB): "
- mfile.print "$(DEFFILE) " if makedef
- mfile.print "$(OBJS) Makefile\n"
- mfile.print "\t$(ECHO) linking shared-object #{target_prefix.sub(/\A\/(.*)/, '\1/')}$(DLLIB)\n"
- mfile.print "\t@-$(RM) $(@#{sep})\n"
- mfile.print "\t@-$(MAKEDIRS) $(@D)\n" if $extout
- link_so = LINK_SO.gsub(/^/, "\t$(Q) ")
- if srcs.any?(&%r"\.(?:#{CXX_EXT.join('|')})\z".method(:===))
- link_so = link_so.sub(/\bLDSHARED\b/, '\&XX')
- end
- mfile.print link_so, "\n\n"
- unless $static.nil?
- mfile.print "$(STATIC_LIB): $(OBJS)\n\t@-$(RM) $(@#{sep})\n\t"
- mfile.print "$(ECHO) linking static-library $(@#{rsep})\n\t$(Q) "
- mfile.print "$(AR) #{config_string('ARFLAGS') || 'cru '}$@ $(OBJS)"
- config_string('RANLIB') do |ranlib|
- mfile.print "\n\t@-#{ranlib} $(DLLIB) 2> /dev/null || true"
+ mfile.print "$(RUBYARCHDIR)/" if $extout
+ mfile.print "$(DLLIB): "
+ mfile.print "$(DEFFILE) " if makedef
+ mfile.print "$(OBJS) Makefile"
+ mfile.print " #{timestamp_file('$(RUBYARCHDIR)')}" if $extout
+ mfile.print "\n"
+ mfile.print "\t$(ECHO) linking shared-object #{target_prefix.sub(/\A\/(.*)/, '\1/')}$(DLLIB)\n"
+ mfile.print "\t-$(Q)$(RM) $(@#{sep})\n"
+ link_so = LINK_SO.gsub(/^/, "\t$(Q) ")
+ if srcs.any?(&%r"\.(?:#{CXX_EXT.join('|')})\z".method(:===))
+ link_so = link_so.sub(/\bLDSHARED\b/, '\&XX')
+ end
+ mfile.print link_so, "\n\n"
+ unless $static.nil?
+ mfile.print "$(STATIC_LIB): $(OBJS)\n\t-$(Q)$(RM) $(@#{sep})\n\t"
+ mfile.print "$(ECHO) linking static-library $(@#{rsep})\n\t$(Q) "
+ mfile.print "$(AR) #{config_string('ARFLAGS') || 'cru '}$@ $(OBJS)"
+ config_string('RANLIB') do |ranlib|
+ mfile.print "\n\t-$(Q)#{ranlib} $(DLLIB) 2> /dev/null || true"
+ end
+ end
+ mfile.print "\n\n"
+ if makedef
+ mfile.print "$(DEFFILE): #{origdef}\n"
+ mfile.print "\t$(ECHO) generating $(@#{rsep})\n"
+ mfile.print "\t$(Q) $(RUBY) #{makedef} #{origdef} > $@\n\n"
end
- end
- mfile.print "\n\n"
- if makedef
- mfile.print "$(DEFFILE): #{origdef}\n"
- mfile.print "\t$(ECHO) generating $(@#{rsep})\n"
- mfile.print "\t$(Q) $(RUBY) #{makedef} #{origdef} > $@\n\n"
- end
- depend = File.join(srcdir, "depend")
- if File.exist?(depend)
- mfile.print("###\n", *depend_rules(File.read(depend)))
- else
- headers = %w[$(hdrdir)/ruby.h $(hdrdir)/ruby/defines.h]
- if RULE_SUBST
- headers.each {|h| h.sub!(/.*/, &RULE_SUBST.method(:%))}
+ depend = File.join(srcdir, "depend")
+ if File.exist?(depend)
+ mfile.print("###\n", *depend_rules(File.read(depend)))
+ else
+ mfile.print "$(OBJS): $(HDRS) $(ruby_headers)\n"
end
- headers << $config_h
- headers << '$(RUBY_EXTCONF_H)' if $extconf_h
- mfile.print "$(OBJS): ", headers.join(' '), "\n"
- end
- $makefile_created = true
-ensure
- mfile.close if mfile
-end
+ $makefile_created = true
+ ensure
+ mfile.close if mfile
+ end
+
+ # :stopdoc:
+
+ def init_mkmf(config = CONFIG, rbconfig = RbConfig::CONFIG)
+ $makefile_created = false
+ $arg_config = []
+ $enable_shared = config['ENABLE_SHARED'] == 'yes'
+ $defs = []
+ $extconf_h = nil
+ if $warnflags = CONFIG['warnflags'] and CONFIG['GCC'] == 'yes'
+ # turn warnings into errors only for bundled extensions.
+ config['warnflags'] = $warnflags.gsub(/(\A|\s)-Werror[-=]/, '\1-W')
+ RbConfig.expand(rbconfig['warnflags'] = config['warnflags'].dup)
+ config.each do |key, val|
+ RbConfig.expand(rbconfig[key] = val.dup) if /warnflags/ =~ val
+ end
+ $warnflags = config['warnflags'] unless $extmk
+ end
+ $CFLAGS = with_config("cflags", arg_config("CFLAGS", config["CFLAGS"])).dup
+ $ARCH_FLAG = with_config("arch_flag", arg_config("ARCH_FLAG", config["ARCH_FLAG"])).dup
+ $CPPFLAGS = with_config("cppflags", arg_config("CPPFLAGS", config["CPPFLAGS"])).dup
+ $LDFLAGS = with_config("ldflags", arg_config("LDFLAGS", config["LDFLAGS"])).dup
+ $INCFLAGS = "-I$(arch_hdrdir)"
+ $INCFLAGS << " -I$(hdrdir)/ruby/backward" unless $extmk
+ $INCFLAGS << " -I$(hdrdir) -I$(srcdir)"
+ $DLDFLAGS = with_config("dldflags", arg_config("DLDFLAGS", config["DLDFLAGS"])).dup
+ $LIBEXT = config['LIBEXT'].dup
+ $OBJEXT = config["OBJEXT"].dup
+ $EXEEXT = config["EXEEXT"].dup
+ $LIBS = "#{config['LIBS']} #{config['DLDLIBS']}"
+ $LIBRUBYARG = ""
+ $LIBRUBYARG_STATIC = config['LIBRUBYARG_STATIC']
+ $LIBRUBYARG_SHARED = config['LIBRUBYARG_SHARED']
+ $DEFLIBPATH = [$extmk ? "$(topdir)" : "$(libdir)"]
+ $DEFLIBPATH.unshift(".")
+ $LIBPATH = []
+ $INSTALLFILES = []
+ $NONINSTALLFILES = [/~\z/, /\A#.*#\z/, /\A\.#/, /\.bak\z/i, /\.orig\z/, /\.rej\z/, /\.l[ao]\z/, /\.o\z/]
+ $VPATH = %w[$(srcdir) $(topdir) $(arch_hdrdir)/ruby $(hdrdir)/ruby]
+
+ $objs = nil
+ $srcs = nil
+ $libs = ""
+ if $enable_shared or RbConfig.expand(config["LIBRUBY"].dup) != RbConfig.expand(config["LIBRUBY_A"].dup)
+ $LIBRUBYARG = config['LIBRUBYARG']
+ end
-# :stopdoc:
+ $LOCAL_LIBS = ""
-def init_mkmf(config = CONFIG, rbconfig = RbConfig::CONFIG)
- $makefile_created = false
- $arg_config = []
- $enable_shared = config['ENABLE_SHARED'] == 'yes'
- $defs = []
- $extconf_h = nil
- if $warnflags = CONFIG['warnflags'] and CONFIG['GCC'] == 'yes'
- # turn warnings into errors only for bundled extensions.
- config['warnflags'] = $warnflags.gsub(/(\A|\s)-Werror[-=]/, '\1-W')
- RbConfig.expand(rbconfig['warnflags'] = config['warnflags'].dup)
- config.each do |key, val|
- RbConfig.expand(rbconfig[key] = val.dup) if /warnflags/ =~ val
- end
- $warnflags = config['warnflags'] unless $extmk
- end
- $CFLAGS = with_config("cflags", arg_config("CFLAGS", config["CFLAGS"])).dup
- $ARCH_FLAG = with_config("arch_flag", arg_config("ARCH_FLAG", config["ARCH_FLAG"])).dup
- $CPPFLAGS = with_config("cppflags", arg_config("CPPFLAGS", config["CPPFLAGS"])).dup
- $LDFLAGS = with_config("ldflags", arg_config("LDFLAGS", config["LDFLAGS"])).dup
- $INCFLAGS = "-I$(arch_hdrdir)"
- $INCFLAGS << " -I$(hdrdir)/ruby/backward" unless $extmk
- $INCFLAGS << " -I$(hdrdir) -I$(srcdir)"
- $DLDFLAGS = with_config("dldflags", arg_config("DLDFLAGS", config["DLDFLAGS"])).dup
- $LIBEXT = config['LIBEXT'].dup
- $OBJEXT = config["OBJEXT"].dup
- $LIBS = "#{config['LIBS']} #{config['DLDLIBS']}"
- $LIBRUBYARG = ""
- $LIBRUBYARG_STATIC = config['LIBRUBYARG_STATIC']
- $LIBRUBYARG_SHARED = config['LIBRUBYARG_SHARED']
- $DEFLIBPATH = [$extmk ? "$(topdir)" : "$(libdir)"]
- $DEFLIBPATH.unshift(".")
- $LIBPATH = []
- $INSTALLFILES = []
- $NONINSTALLFILES = [/~\z/, /\A#.*#\z/, /\A\.#/, /\.bak\z/i, /\.orig\z/, /\.rej\z/, /\.l[ao]\z/, /\.o\z/]
- $VPATH = %w[$(srcdir) $(arch_hdrdir)/ruby $(hdrdir)/ruby]
-
- $objs = nil
- $srcs = nil
- $libs = ""
- if $enable_shared or RbConfig.expand(config["LIBRUBY"].dup) != RbConfig.expand(config["LIBRUBY_A"].dup)
- $LIBRUBYARG = config['LIBRUBYARG']
- end
-
- $LOCAL_LIBS = ""
-
- $cleanfiles = config_string('CLEANFILES') {|s| Shellwords.shellwords(s)} || []
- $cleanfiles << "mkmf.log"
- $distcleanfiles = config_string('DISTCLEANFILES') {|s| Shellwords.shellwords(s)} || []
- $distcleandirs = config_string('DISTCLEANDIRS') {|s| Shellwords.shellwords(s)} || []
-
- $extout ||= nil
- $extout_prefix ||= nil
-
- $arg_config.clear
- dir_config("opt")
-end
+ $cleanfiles = config_string('CLEANFILES') {|s| Shellwords.shellwords(s)} || []
+ $cleanfiles << "mkmf.log"
+ $distcleanfiles = config_string('DISTCLEANFILES') {|s| Shellwords.shellwords(s)} || []
+ $distcleandirs = config_string('DISTCLEANDIRS') {|s| Shellwords.shellwords(s)} || []
+
+ $extout ||= nil
+ $extout_prefix ||= nil
+
+ @libdir_basename = config["libdir"] && config["libdir"][/\A\$\(exec_prefix\)\/(.*)/, 1] or "lib"
-FailedMessage = <<MESSAGE
-Could not create Makefile due to some reason, probably lack of
-necessary libraries and/or headers. Check the mkmf.log file for more
-details. You may need configuration options.
+ $arg_config.clear
+ dir_config("opt")
+ end
+
+ FailedMessage = <<MESSAGE
+Could not create Makefile due to some reason, probably lack of necessary
+libraries and/or headers. Check the mkmf.log file for more details. You may
+need configuration options.
Provided configuration options:
MESSAGE
-# Returns whether or not the Makefile was successfully generated. If not,
-# the script will abort with an error message.
-#
-# Internal use only.
-#
-def mkmf_failed(path)
- unless $makefile_created or File.exist?("Makefile")
- opts = $arg_config.collect {|t, n| "\t#{t}#{n ? "=#{n}" : ""}\n"}
- abort "*** #{path} failed ***\n" + FailedMessage + opts.join
+ # Returns whether or not the Makefile was successfully generated. If not,
+ # the script will abort with an error message.
+ #
+ # Internal use only.
+ #
+ def mkmf_failed(path)
+ unless $makefile_created or File.exist?("Makefile")
+ opts = $arg_config.collect {|t, n| "\t#{t}#{n ? "=#{n}" : ""}\n"}
+ abort "*** #{path} failed ***\n" + FailedMessage + opts.join
+ end
end
-end
-# :startdoc:
+ extend self
+ init_mkmf
-init_mkmf
+ $make = with_config("make-prog", ENV["MAKE"] || "make")
+ make, = Shellwords.shellwords($make)
+ $nmake = nil
+ case
+ when $mswin
+ $nmake = ?m if /nmake/i =~ make
+ when $bccwin
+ $nmake = ?b if /Borland/i =~ `#{make} -h`
+ end
+ $ignore_error = $nmake ? '' : ' 2> /dev/null || true'
-$make = with_config("make-prog", ENV["MAKE"] || "make")
-make, = Shellwords.shellwords($make)
-$nmake = nil
-case
-when $mswin
- $nmake = ?m if /nmake/i =~ make
-when $bccwin
- $nmake = ?b if /Borland/i =~ `#{make} -h`
-end
-$ignore_error = $nmake ? '' : ' 2> /dev/null || true'
-
-RbConfig::CONFIG["srcdir"] = CONFIG["srcdir"] =
- $srcdir = arg_config("--srcdir", File.dirname($0))
-$configure_args["--topsrcdir"] ||= $srcdir
-if $curdir = arg_config("--curdir")
- RbConfig.expand(curdir = $curdir.dup)
-else
- curdir = $curdir = "."
-end
-unless File.expand_path(RbConfig::CONFIG["topdir"]) == File.expand_path(curdir)
- CONFIG["topdir"] = $curdir
- RbConfig::CONFIG["topdir"] = curdir
-end
-$configure_args["--topdir"] ||= $curdir
-$ruby = arg_config("--ruby", File.join(RbConfig::CONFIG["bindir"], CONFIG["ruby_install_name"]))
+ RbConfig::CONFIG["srcdir"] = CONFIG["srcdir"] =
+ $srcdir = arg_config("--srcdir", File.dirname($0))
+ $configure_args["--topsrcdir"] ||= $srcdir
+ if $curdir = arg_config("--curdir")
+ RbConfig.expand(curdir = $curdir.dup)
+ else
+ curdir = $curdir = "."
+ end
+ unless File.expand_path(RbConfig::CONFIG["topdir"]) == File.expand_path(curdir)
+ CONFIG["topdir"] = $curdir
+ RbConfig::CONFIG["topdir"] = curdir
+ end
+ $configure_args["--topdir"] ||= $curdir
+ $ruby = arg_config("--ruby", File.join(RbConfig::CONFIG["bindir"], CONFIG["ruby_install_name"]))
+
+ # :startdoc:
-split = Shellwords.method(:shellwords).to_proc
+ split = Shellwords.method(:shellwords).to_proc
-EXPORT_PREFIX = config_string('EXPORT_PREFIX') {|s| s.strip}
+ EXPORT_PREFIX = config_string('EXPORT_PREFIX') {|s| s.strip}
-hdr = ['#include "ruby.h"' "\n"]
-config_string('COMMON_MACROS') do |s|
- Shellwords.shellwords(s).each do |w|
- w, v = w.split(/=/, 2)
- hdr << "#ifndef #{w}"
- hdr << "#define #{[w, v].compact.join(" ")}"
- hdr << "#endif /* #{w} */"
+ hdr = ['#include "ruby.h"' "\n"]
+ config_string('COMMON_MACROS') do |s|
+ Shellwords.shellwords(s).each do |w|
+ w, v = w.split(/=/, 2)
+ hdr << "#ifndef #{w}"
+ hdr << "#define #{[w, v].compact.join(" ")}"
+ hdr << "#endif /* #{w} */"
+ end
end
-end
-config_string('COMMON_HEADERS') do |s|
- Shellwords.shellwords(s).each {|w| hdr << "#include <#{w}>"}
-end
-COMMON_HEADERS = hdr.join("\n")
-COMMON_LIBS = config_string('COMMON_LIBS', &split) || []
-
-COMPILE_RULES = config_string('COMPILE_RULES', &split) || %w[.%s.%s:]
-RULE_SUBST = config_string('RULE_SUBST')
-COMPILE_C = config_string('COMPILE_C') || '$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<'
-COMPILE_CXX = config_string('COMPILE_CXX') || '$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<'
-TRY_LINK = config_string('TRY_LINK') ||
- "$(CC) #{OUTFLAG}conftest $(INCFLAGS) $(CPPFLAGS) " \
- "$(CFLAGS) $(src) $(LIBPATH) $(LDFLAGS) $(ARCH_FLAG) $(LOCAL_LIBS) $(LIBS)"
-LINK_SO = config_string('LINK_SO') ||
- if CONFIG["DLEXT"] == $OBJEXT
- "ld $(DLDFLAGS) -r -o $@ $(OBJS)\n"
- else
- "$(LDSHARED) #{OUTFLAG}$@ $(OBJS) " \
- "$(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)"
- end
-LIBPATHFLAG = config_string('LIBPATHFLAG') || ' -L"%s"'
-RPATHFLAG = config_string('RPATHFLAG') || ''
-LIBARG = config_string('LIBARG') || '-l%s'
-MAIN_DOES_NOTHING = config_string('MAIN_DOES_NOTHING') || 'int main() {return 0;}'
-UNIVERSAL_INTS = config_string('UNIVERSAL_INTS') {|s| Shellwords.shellwords(s)} ||
- %w[int short long long\ long]
-
-sep = config_string('BUILD_FILE_SEPARATOR') {|s| ":/=#{s}" if s != "/"} || ""
-CLEANINGS = "
+ config_string('COMMON_HEADERS') do |s|
+ Shellwords.shellwords(s).each {|w| hdr << "#include <#{w}>"}
+ end
+ COMMON_HEADERS = hdr.join("\n")
+ COMMON_LIBS = config_string('COMMON_LIBS', &split) || []
+
+ COMPILE_RULES = config_string('COMPILE_RULES', &split) || %w[.%s.%s:]
+ RULE_SUBST = config_string('RULE_SUBST')
+ COMPILE_C = config_string('COMPILE_C') || '$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<'
+ COMPILE_CXX = config_string('COMPILE_CXX') || '$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<'
+ TRY_LINK = config_string('TRY_LINK') ||
+ "$(CC) #{OUTFLAG}conftest#{$EXEEXT} $(INCFLAGS) $(CPPFLAGS) " \
+ "$(CFLAGS) $(src) $(LIBPATH) $(LDFLAGS) $(ARCH_FLAG) $(LOCAL_LIBS) $(LIBS)"
+ LINK_SO = config_string('LINK_SO') ||
+ if CONFIG["DLEXT"] == $OBJEXT
+ "ld $(DLDFLAGS) -r -o $@ $(OBJS)\n"
+ else
+ "$(LDSHARED) #{OUTFLAG}$@ $(OBJS) " \
+ "$(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)"
+ end
+ LIBPATHFLAG = config_string('LIBPATHFLAG') || ' -L%s'
+ RPATHFLAG = config_string('RPATHFLAG') || ''
+ LIBARG = config_string('LIBARG') || '-l%s'
+ MAIN_DOES_NOTHING = config_string('MAIN_DOES_NOTHING') || 'int main(void) {return 0;}'
+ UNIVERSAL_INTS = config_string('UNIVERSAL_INTS') {|s| Shellwords.shellwords(s)} ||
+ %w[int short long long\ long]
+
+ sep = config_string('BUILD_FILE_SEPARATOR') {|s| ":/=#{s}" if s != "/"} || ""
+ CLEANINGS = "
+clean-static::
clean-rb-default::
clean-rb::
clean-so::
-clean: clean-so clean-rb-default clean-rb
-\t\t@-$(RM) $(CLEANLIBS#{sep}) $(CLEANOBJS#{sep}) $(CLEANFILES#{sep})
+clean: clean-so clean-static clean-rb-default clean-rb
+\t\t-$(Q)$(RM) $(CLEANLIBS#{sep}) $(CLEANOBJS#{sep}) $(CLEANFILES#{sep}) .*.time
distclean-rb-default::
distclean-rb::
distclean-so::
-distclean: clean distclean-so distclean-rb-default distclean-rb
-\t\t@-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
-\t\t@-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES#{sep})
-\t\t@-$(RMDIRS) $(DISTCLEANDIRS#{sep})#{$ignore_error}
+distclean-static::
+distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
+\t\t-$(Q)$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
+\t\t-$(Q)$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES#{sep})
+\t\t-$(Q)$(RMDIRS) $(DISTCLEANDIRS#{sep})#{$ignore_error}
realclean: distclean
"
+end
+
+include MakeMakefile
if not $extmk and /\A(extconf|makefile).rb\z/ =~ File.basename($0)
END {mkmf_failed($0)}
diff --git a/lib/monitor.rb b/lib/monitor.rb
index 9e26ec1de1..07394b5900 100644
--- a/lib/monitor.rb
+++ b/lib/monitor.rb
@@ -107,7 +107,7 @@ module MonitorMixin
@monitor.__send__(:mon_check_owner)
count = @monitor.__send__(:mon_exit_for_cond)
begin
- @cond.wait(@monitor.instance_variable_get("@mon_mutex"), timeout)
+ @cond.wait(@monitor.instance_variable_get(:@mon_mutex), timeout)
return true
ensure
@monitor.__send__(:mon_enter_for_cond, count)
diff --git a/lib/net/.document b/lib/net/.document
deleted file mode 100644
index 6332bb9e7e..0000000000
--- a/lib/net/.document
+++ /dev/null
@@ -1,8 +0,0 @@
-ftp.rb
-http.rb
-https.rb
-imap.rb
-pop.rb
-smtp.rb
-smtps.rb
-telnet.rb
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb
index 149fc6adc1..502783955b 100644
--- a/lib/net/ftp.rb
+++ b/lib/net/ftp.rb
@@ -16,6 +16,7 @@
require "socket"
require "monitor"
+require "net/protocol"
module Net
@@ -40,7 +41,7 @@ module Net
#
# === Example 1
#
- # ftp = Net::FTP.new('ftp.netlab.co.jp')
+ # ftp = Net::FTP.new('example.com')
# ftp.login
# files = ftp.chdir('pub/lang/ruby/contrib')
# files = ftp.list('n*')
@@ -49,7 +50,7 @@ module Net
#
# === Example 2
#
- # Net::FTP.open('ftp.netlab.co.jp') do |ftp|
+ # Net::FTP.open('example.com') do |ftp|
# ftp.login
# files = ftp.chdir('pub/lang/ruby/contrib')
# files = ftp.list('n*')
@@ -76,7 +77,7 @@ module Net
# :stopdoc:
FTP_PORT = 21
CRLF = "\r\n"
- DEFAULT_BLOCKSIZE = 4096
+ DEFAULT_BLOCKSIZE = BufferedIO::BUFSIZE
# :startdoc:
# When +true+, transfers are performed in binary mode. Default: +true+.
@@ -93,6 +94,24 @@ module Net
# transfers are resumed or restarted. Default: +false+.
attr_accessor :resume
+ # Number of seconds to wait for the connection to open. Any number
+ # may be used, including Floats for fractional seconds. If the FTP
+ # object cannot open a connection in this many seconds, it raises a
+ # Net::OpenTimeout exception.
+ attr_accessor :open_timeout
+
+ # Number of seconds to wait for one block to be read (via one read(2)
+ # call). Any number may be used, including Floats for fractional
+ # seconds. If the FTP object cannot read data in this many seconds,
+ # it raises a TimeoutError exception.
+ attr_reader :read_timeout
+
+ # Setter for the read_timeout attribute.
+ def read_timeout=(sec)
+ @sock.read_timeout = sec
+ @read_timeout = sec
+ end
+
# The server's welcome message.
attr_reader :welcome
@@ -135,6 +154,8 @@ module Net
@resume = false
@sock = NullSocket.new
@logged_in = false
+ @open_timeout = nil
+ @read_timeout = 60
if host
connect(host)
if user
@@ -199,12 +220,17 @@ module Net
# SOCKS_SERVER, then a SOCKSSocket is returned, else a TCPSocket is
# returned.
def open_socket(host, port) # :nodoc:
- if defined? SOCKSSocket and ENV["SOCKS_SERVER"]
- @passive = true
- return SOCKSSocket.open(host, port)
- else
- return TCPSocket.open(host, port)
- end
+ return Timeout.timeout(@open_timeout, Net::OpenTimeout) {
+ if defined? SOCKSSocket and ENV["SOCKS_SERVER"]
+ @passive = true
+ sock = SOCKSSocket.open(host, port)
+ else
+ sock = TCPSocket.open(host, port)
+ end
+ io = BufferedSocket.new(sock)
+ io.read_timeout = @read_timeout
+ io
+ }
end
private :open_socket
@@ -405,7 +431,10 @@ module Net
if resp[0] != ?1
raise FTPReplyError, resp
end
- conn = sock.accept
+ conn = BufferedSocket.new(sock.accept)
+ conn.read_timeout = @read_timeout
+ sock.shutdown(Socket::SHUT_WR) rescue nil
+ sock.read rescue nil
sock.close
end
return conn
@@ -454,13 +483,19 @@ module Net
def retrbinary(cmd, blocksize, rest_offset = nil) # :yield: data
synchronize do
with_binary(true) do
- conn = transfercmd(cmd, rest_offset)
- loop do
- data = conn.read(blocksize)
- break if data == nil
- yield(data)
+ begin
+ conn = transfercmd(cmd, rest_offset)
+ loop do
+ data = conn.read(blocksize)
+ break if data == nil
+ yield(data)
+ end
+ conn.shutdown(Socket::SHUT_WR)
+ conn.read_timeout = 1
+ conn.read
+ ensure
+ conn.close if conn
end
- conn.close
voidresp
end
end
@@ -475,13 +510,19 @@ module Net
def retrlines(cmd) # :yield: line
synchronize do
with_binary(false) do
- conn = transfercmd(cmd)
- loop do
- line = conn.gets
- break if line == nil
- yield(line.sub(/\r?\n\z/, ""), !line.match(/\n\z/).nil?)
+ begin
+ conn = transfercmd(cmd)
+ loop do
+ line = conn.gets
+ break if line == nil
+ yield(line.sub(/\r?\n\z/, ""), !line.match(/\n\z/).nil?)
+ end
+ conn.shutdown(Socket::SHUT_WR)
+ conn.read_timeout = 1
+ conn.read
+ ensure
+ conn.close if conn
end
- conn.close
voidresp
end
end
@@ -493,7 +534,7 @@ module Net
# +file+ to the server. If the optional block is given, it also passes it
# the data, in chunks of +blocksize+ characters.
#
- def storbinary(cmd, file, blocksize, rest_offset = nil, &block) # :yield: data
+ def storbinary(cmd, file, blocksize, rest_offset = nil) # :yield: data
if rest_offset
file.seek(rest_offset, IO::SEEK_SET)
end
@@ -504,7 +545,7 @@ module Net
buf = file.read(blocksize)
break if buf == nil
conn.write(buf)
- yield(buf) if block
+ yield(buf) if block_given?
end
conn.close
voidresp
@@ -525,7 +566,7 @@ module Net
# named +file+ to the server, one line at a time. If the optional block is
# given, it also passes it the lines.
#
- def storlines(cmd, file, &block) # :yield: line
+ def storlines(cmd, file) # :yield: line
synchronize do
with_binary(false) do
conn = transfercmd(cmd)
@@ -536,7 +577,7 @@ module Net
buf = buf.chomp + CRLF
end
conn.write(buf)
- yield(buf) if block
+ yield(buf) if block_given?
end
conn.close
voidresp
@@ -905,7 +946,16 @@ module Net
# a new connection with #connect.
#
def close
- @sock.close if @sock and not @sock.closed?
+ if @sock and not @sock.closed?
+ begin
+ @sock.shutdown(Socket::SHUT_WR) rescue nil
+ orig, self.read_timeout = self.read_timeout, 3
+ @sock.read rescue nil
+ ensure
+ @sock.close
+ self.read_timeout = orig
+ end
+ end
end
#
@@ -923,18 +973,11 @@ module Net
if resp[0, 3] != "227"
raise FTPReplyError, resp
end
- left = resp.index("(")
- right = resp.index(")")
- if left == nil or right == nil
- raise FTPProtoError, resp
- end
- numbers = resp[left + 1 .. right - 1].split(",")
- if numbers.length != 6
+ if m = /\((?<host>\d+(,\d+){3}),(?<port>\d+,\d+)\)/.match(resp)
+ return parse_pasv_ipv4_host(m["host"]), parse_pasv_port(m["port"])
+ else
raise FTPProtoError, resp
end
- host = numbers[0, 4].join(".")
- port = (numbers[4].to_i << 8) + numbers[5].to_i
- return host, port
end
private :parse227
@@ -946,34 +989,36 @@ module Net
if resp[0, 3] != "228"
raise FTPReplyError, resp
end
- left = resp.index("(")
- right = resp.index(")")
- if left == nil or right == nil
+ if m = /\(4,4,(?<host>\d+(,\d+){3}),2,(?<port>\d+,\d+)\)/.match(resp)
+ return parse_pasv_ipv4_host(m["host"]), parse_pasv_port(m["port"])
+ elsif m = /\(6,16,(?<host>\d+(,(\d+)){15}),2,(?<port>\d+,\d+)\)/.match(resp)
+ return parse_pasv_ipv6_host(m["host"]), parse_pasv_port(m["port"])
+ else
raise FTPProtoError, resp
end
- numbers = resp[left + 1 .. right - 1].split(",")
- if numbers[0] == "4"
- if numbers.length != 9 || numbers[1] != "4" || numbers[2 + 4] != "2"
- raise FTPProtoError, resp
- end
- host = numbers[2, 4].join(".")
- port = (numbers[7].to_i << 8) + numbers[8].to_i
- elsif numbers[0] == "6"
- if numbers.length != 21 || numbers[1] != "16" || numbers[2 + 16] != "2"
- raise FTPProtoError, resp
- end
- v6 = ["", "", "", "", "", "", "", ""]
- for i in 0 .. 7
- v6[i] = sprintf("%02x%02x", numbers[(i * 2) + 2].to_i,
- numbers[(i * 2) + 3].to_i)
- end
- host = v6[0, 8].join(":")
- port = (numbers[19].to_i << 8) + numbers[20].to_i
- end
return host, port
end
private :parse228
+ def parse_pasv_ipv4_host(s)
+ return s.tr(",", ".")
+ end
+ private :parse_pasv_ipv4_host
+
+ def parse_pasv_ipv6_host(s)
+ return s.split(/,/).map { |i|
+ "%02x" % i.to_i
+ }.each_slice(2).map(&:join).join(":")
+ end
+ private :parse_pasv_ipv6_host
+
+ def parse_pasv_port(s)
+ return s.split(/,/).map(&:to_i).inject { |x, y|
+ (x << 8) + y
+ }
+ end
+ private :parse_pasv_port
+
# handler for response code 229
# (Extended Passive Mode Entered)
#
@@ -982,18 +1027,11 @@ module Net
if resp[0, 3] != "229"
raise FTPReplyError, resp
end
- left = resp.index("(")
- right = resp.index(")")
- if left == nil or right == nil
- raise FTPProtoError, resp
- end
- numbers = resp[left + 1 .. right - 1].split(resp[left + 1, 1])
- if numbers.length != 4
+ if m = /\((?<d>[!-~])\k<d>\k<d>(?<port>\d+)\k<d>\)/.match(resp)
+ return @sock.peeraddr[3], m["port"].to_i
+ else
raise FTPProtoError, resp
end
- port = numbers[3].to_i
- host = (@sock.peeraddr())[3]
- return host, port
end
private :parse229
@@ -1028,10 +1066,48 @@ module Net
# :stopdoc:
class NullSocket
+ def read_timeout=(sec)
+ end
+
+ def close
+ end
+
def method_missing(mid, *args)
raise FTPConnectionError, "not connected"
end
end
+
+ class BufferedSocket < BufferedIO
+ [:addr, :peeraddr, :send, :shutdown].each do |method|
+ define_method(method) { |*args|
+ @io.__send__(method, *args)
+ }
+ end
+
+ def read(len = nil)
+ if len
+ s = super(len, "", true)
+ return s.empty? ? nil : s
+ else
+ result = ""
+ while s = super(DEFAULT_BLOCKSIZE, "", true)
+ break if s.empty?
+ result << s
+ end
+ return result
+ end
+ end
+
+ def gets
+ return readuntil("\n")
+ rescue EOFError
+ return nil
+ end
+
+ def readline
+ return readuntil("\n")
+ end
+ end
# :startdoc:
end
end
diff --git a/lib/net/http.rb b/lib/net/http.rb
index 7c9032aaa6..d6a668e6ff 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -23,6 +23,7 @@ require 'net/protocol'
require 'uri'
module Net #:nodoc:
+ autoload :OpenSSL, 'openssl'
# :stopdoc:
class HTTPBadResponse < StandardError; end
@@ -255,7 +256,7 @@ module Net #:nodoc:
# uri = URI('https://secure.example.com/some_path?query=string')
#
# Net::HTTP.start(uri.host, uri.port,
- # :use_ssl => uri.scheme == 'https').start do |http|
+ # :use_ssl => uri.scheme == 'https') do |http|
# request = Net::HTTP::Get.new uri.request_uri
#
# response = http.request request # Net::HTTPResponse object
@@ -266,22 +267,30 @@ module Net #:nodoc:
#
# === Proxies
#
- # Net::HTTP::Proxy has the same methods as Net::HTTP but its instances always
- # connect via the proxy instead of directly to the given host.
+ # Net::HTTP will automatically create a proxy from the +http_proxy+
+ # environment variable if it is present. To disable use of +http_proxy+,
+ # pass +nil+ for the proxy address.
+ #
+ # You may also create a custom proxy:
#
# proxy_addr = 'your.proxy.host'
# proxy_port = 8080
#
- # Net::HTTP::Proxy(proxy_addr, proxy_port).start('www.example.com') {|http|
- # # always connect to your.proxy.addr:8080
+ # Net::HTTP.new('example.com', nil, proxy_addr, proxy_port).start { |http|
+ # # always proxy via your.proxy.addr:8080
# }
#
- # Net::HTTP::Proxy returns a Net::HTTP instance when proxy_addr is nil so
- # there is no need for conditional code.
- #
- # See Net::HTTP::Proxy for further details and examples such as proxies that
+ # See Net::HTTP.new for further details and examples such as proxies that
# require a username and password.
#
+ # === Compression
+ #
+ # Net::HTTP automatically adds Accept-Encoding for compression of response
+ # bodies and automatically decompresses gzip and deflate responses unless a
+ # Range header was sent.
+ #
+ # Compression can be disabled through the Accept-Encoding: identity header.
+ #
# == HTTP Request Classes
#
# Here is the HTTP request class hierarchy.
@@ -290,6 +299,7 @@ module Net #:nodoc:
# * Net::HTTP::Get
# * Net::HTTP::Head
# * Net::HTTP::Post
+ # * Net::HTTP::Patch
# * Net::HTTP::Put
# * Net::HTTP::Proppatch
# * Net::HTTP::Lock
@@ -307,7 +317,7 @@ module Net #:nodoc:
# Here is HTTP response class hierarchy. All classes are defined in Net
# module and are subclasses of Net::HTTPResponse.
#
- # HTTPUnknownResponse:: For unhandled HTTP extenensions
+ # HTTPUnknownResponse:: For unhandled HTTP extensions
# HTTPInformation:: 1xx
# HTTPContinue:: 100
# HTTPSwitchProtocol:: 101
@@ -319,8 +329,9 @@ module Net #:nodoc:
# HTTPNoContent:: 204
# HTTPResetContent:: 205
# HTTPPartialContent:: 206
+ # HTTPMultiStatus:: 207
# HTTPRedirection:: 3xx
- # HTTPMultipleChoice:: 300
+ # HTTPMultipleChoices:: 300
# HTTPMovedPermanently:: 301
# HTTPFound:: 302
# HTTPSeeOther:: 303
@@ -346,6 +357,13 @@ module Net #:nodoc:
# HTTPUnsupportedMediaType:: 415
# HTTPRequestedRangeNotSatisfiable:: 416
# HTTPExpectationFailed:: 417
+ # HTTPUnprocessableEntity:: 422
+ # HTTPLocked:: 423
+ # HTTPFailedDependency:: 424
+ # HTTPUpgradeRequired:: 426
+ # HTTPPreconditionRequired:: 428
+ # HTTPTooManyRequests:: 429
+ # HTTPRequestHeaderFieldsTooLarge:: 431
# HTTPServerError:: 5xx
# HTTPInternalServerError:: 500
# HTTPNotImplemented:: 501
@@ -353,6 +371,8 @@ module Net #:nodoc:
# HTTPServiceUnavailable:: 503
# HTTPGatewayTimeOut:: 504
# HTTPVersionNotSupported:: 505
+ # HTTPInsufficientStorage:: 507
+ # HTTPNetworkAuthenticationRequired:: 511
#
# There is also the Net::HTTPBadResponse exception which is raised when
# there is a protocol error.
@@ -450,7 +470,8 @@ module Net #:nodoc:
}
else
uri = uri_or_host
- new(uri.hostname, uri.port).start {|http|
+ start(uri.hostname, uri.port,
+ :use_ssl => uri.scheme == 'https') {|http|
return http.request_get(uri.request_uri, &block)
}
end
@@ -478,7 +499,8 @@ module Net #:nodoc:
req = Post.new(url.request_uri)
req.form_data = params
req.basic_auth url.user, url.password if url.user
- new(url.hostname, url.port).start {|http|
+ start(url.hostname, url.port,
+ :use_ssl => url.scheme == 'https' ) {|http|
http.request(req)
}
end
@@ -506,14 +528,14 @@ module Net #:nodoc:
BufferedIO
end
- # call-seq:
+ # :call-seq:
# HTTP.start(address, port, p_addr, p_port, p_user, p_pass, &block)
# HTTP.start(address, port=nil, p_addr=nil, p_port=nil, p_user=nil, p_pass=nil, opt, &block)
#
# Creates a new Net::HTTP object, then additionally opens the TCP
# connection and HTTP session.
#
- # Argments are following:
+ # Arguments are the following:
# _address_ :: hostname or IP address of the server
# _port_ :: port of the server
# _p_addr_ :: address of proxy
@@ -557,15 +579,47 @@ module Net #:nodoc:
end
class << HTTP
- alias newobj new
+ alias newobj new # :nodoc:
end
# Creates a new Net::HTTP object without opening a TCP connection or
# HTTP session.
- # The +address+ should be a DNS hostname or IP address.
- # If +p_addr+ is given, creates a Net::HTTP object with proxy support.
- def HTTP.new(address, port = nil, p_addr = nil, p_port = nil, p_user = nil, p_pass = nil)
- Proxy(p_addr, p_port, p_user, p_pass).newobj(address, port)
+ #
+ # The +address+ should be a DNS hostname or IP address, the +port+ is the
+ # port the server operates on. If no +port+ is given the default port for
+ # HTTP or HTTPS is used.
+ #
+ # If none of the +p_+ arguments are given, the proxy host and port are
+ # taken from the +http_proxy+ environment variable (or its uppercase
+ # equivalent) if present. If the proxy requires authentication you must
+ # supply it by hand. See URI::Generic#find_proxy for details of proxy
+ # detection from the environment. To disable proxy detection set +p_addr+
+ # to nil.
+ #
+ # If you are connecting to a custom proxy, +p_addr+ the DNS name or IP
+ # address of the proxy host, +p_port+ the port to use to access the proxy,
+ # and +p_user+ and +p_pass+ the username and password if authorization is
+ # required to use the proxy.
+ #
+ def HTTP.new(address, port = nil, p_addr = :ENV, p_port = nil, p_user = nil, p_pass = nil)
+ http = super address, port
+
+ if proxy_class? then # from Net::HTTP::Proxy()
+ http.proxy_from_env = @proxy_from_env
+ http.proxy_address = @proxy_address
+ http.proxy_port = @proxy_port
+ http.proxy_user = @proxy_user
+ http.proxy_pass = @proxy_pass
+ elsif p_addr == :ENV then
+ http.proxy_from_env = true
+ else
+ http.proxy_address = p_addr
+ http.proxy_port = p_port || default_port
+ http.proxy_user = p_user
+ http.proxy_pass = p_pass
+ end
+
+ http
end
# Creates a new Net::HTTP object for the specified server address,
@@ -574,8 +628,11 @@ module Net #:nodoc:
def initialize(address, port = nil)
@address = address
@port = (port || HTTP.default_port)
+ @local_host = nil
+ @local_port = nil
@curr_http_version = HTTPVersion
- @no_keepalive_server = false
+ @keep_alive_timeout = 2
+ @last_communicated = nil
@close_on_empty_response = false
@socket = nil
@started = false
@@ -583,15 +640,21 @@ module Net #:nodoc:
@read_timeout = 60
@continue_timeout = nil
@debug_output = nil
+
+ @proxy_from_env = false
+ @proxy_uri = nil
+ @proxy_address = nil
+ @proxy_port = nil
+ @proxy_user = nil
+ @proxy_pass = nil
+
@use_ssl = false
@ssl_context = nil
+ @ssl_session = nil
@enable_post_connection_check = true
- @compression = nil
@sspi_enabled = false
- if defined?(SSL_ATTRIBUTES)
- SSL_ATTRIBUTES.each do |name|
- instance_variable_set "@#{name}", nil
- end
+ SSL_IVNAMES.each do |ivname|
+ instance_variable_set ivname, nil
end
end
@@ -619,16 +682,28 @@ module Net #:nodoc:
# The port number to connect to.
attr_reader :port
+ # The local host used to estabilish the connection.
+ attr_accessor :local_host
+
+ # The local port used to estabilish the connection.
+ attr_accessor :local_port
+
+ attr_writer :proxy_from_env
+ attr_writer :proxy_address
+ attr_writer :proxy_port
+ attr_writer :proxy_user
+ attr_writer :proxy_pass
+
# Number of seconds to wait for the connection to open. Any number
# may be used, including Floats for fractional seconds. If the HTTP
# object cannot open a connection in this many seconds, it raises a
- # TimeoutError exception.
+ # Net::OpenTimeout exception.
attr_accessor :open_timeout
# Number of seconds to wait for one block to be read (via one read(2)
# call). Any number may be used, including Floats for fractional
# seconds. If the HTTP object cannot read data in this many seconds,
- # it raises a TimeoutError exception.
+ # it raises a Net::ReadTimeout exception.
attr_reader :read_timeout
# Setter for the read_timeout attribute.
@@ -647,6 +722,12 @@ module Net #:nodoc:
@continue_timeout = sec
end
+ # Seconds to reuse the connection of the previous request.
+ # If the idle time is less than this Keep-Alive Timeout,
+ # Net::HTTP reuses the TCP/IP socket used by the previous communication.
+ # The default value is 2 seconds.
+ attr_accessor :keep_alive_timeout
+
# Returns true if the HTTP session has been started.
def started?
@started
@@ -666,22 +747,39 @@ module Net #:nodoc:
# If you change use_ssl value after session started,
# a Net::HTTP object raises IOError.
def use_ssl=(flag)
- flag = if flag
- require 'openssl' unless defined?(OpenSSL)
- true
- else
- false
- end
+ flag = flag ? true : false
if started? and @use_ssl != flag
raise IOError, "use_ssl value changed, but session already started"
end
@use_ssl = flag
end
- SSL_ATTRIBUTES = %w(
- ssl_version key cert ca_file ca_path cert_store ciphers
- verify_mode verify_callback verify_depth ssl_timeout
- )
+ SSL_IVNAMES = [
+ :@ca_file,
+ :@ca_path,
+ :@cert,
+ :@cert_store,
+ :@ciphers,
+ :@key,
+ :@ssl_timeout,
+ :@ssl_version,
+ :@verify_callback,
+ :@verify_depth,
+ :@verify_mode,
+ ]
+ SSL_ATTRIBUTES = [
+ :ca_file,
+ :ca_path,
+ :cert,
+ :cert_store,
+ :ciphers,
+ :key,
+ :ssl_timeout,
+ :ssl_version,
+ :verify_callback,
+ :verify_depth,
+ :verify_mode,
+ ]
# Sets path of a CA certification file in PEM format.
#
@@ -762,17 +860,26 @@ module Net #:nodoc:
private :do_start
def connect
- D "opening connection to #{conn_address()}..."
- s = timeout(@open_timeout) { TCPSocket.open(conn_address(), conn_port()) }
+ if proxy? then
+ conn_address = proxy_address
+ conn_port = proxy_port
+ else
+ conn_address = address
+ conn_port = port
+ end
+
+ D "opening connection to #{conn_address}..."
+ s = Timeout.timeout(@open_timeout, Net::OpenTimeout) {
+ TCPSocket.open(conn_address, conn_port, @local_host, @local_port)
+ }
D "opened"
if use_ssl?
ssl_parameters = Hash.new
iv_list = instance_variables
- SSL_ATTRIBUTES.each do |name|
- ivname = "@#{name}".intern
+ SSL_IVNAMES.each_with_index do |ivname, i|
if iv_list.include?(ivname) and
- value = instance_variable_get(ivname)
- ssl_parameters[name] = value
+ value = instance_variable_get(ivname)
+ ssl_parameters[SSL_ATTRIBUTES[i]] = value if value
end
end
@ssl_context = OpenSSL::SSL::SSLContext.new
@@ -787,23 +894,25 @@ module Net #:nodoc:
if use_ssl?
begin
if proxy?
- @socket.writeline sprintf('CONNECT %s:%s HTTP/%s',
- @address, @port, HTTPVersion)
- @socket.writeline "Host: #{@address}:#{@port}"
+ buf = "CONNECT #{@address}:#{@port} HTTP/#{HTTPVersion}\r\n"
+ buf << "Host: #{@address}:#{@port}\r\n"
if proxy_user
credential = ["#{proxy_user}:#{proxy_pass}"].pack('m')
credential.delete!("\r\n")
- @socket.writeline "Proxy-Authorization: Basic #{credential}"
+ buf << "Proxy-Authorization: Basic #{credential}\r\n"
end
- @socket.writeline ''
+ buf << "\r\n"
+ @socket.write(buf)
HTTPResponse.read_new(@socket).value
end
+ s.session = @ssl_session if @ssl_session
# Server Name Indication (SNI) RFC 3546
s.hostname = @address if s.respond_to? :hostname=
- timeout(@open_timeout) { s.connect }
+ Timeout.timeout(@open_timeout, Net::OpenTimeout) { s.connect }
if @ssl_context.verify_mode != OpenSSL::SSL::VERIFY_NONE
s.post_connection_check(@address)
end
+ @ssl_session = s.session
rescue => exception
D "Conn close because of connect error #{exception}"
@socket.close if @socket and not @socket.closed?
@@ -840,6 +949,7 @@ module Net #:nodoc:
# no proxy
@is_proxy_class = false
+ @proxy_from_env = false
@proxy_addr = nil
@proxy_port = nil
@proxy_user = nil
@@ -848,52 +958,27 @@ module Net #:nodoc:
# Creates an HTTP proxy class which behaves like Net::HTTP, but
# performs all access via the specified proxy.
#
- # The arguments are the DNS name or IP address of the proxy host,
- # the port to use to access the proxy, and a username and password
- # if authorization is required to use the proxy.
- #
- # You can replace any use of the Net::HTTP class with use of the
- # proxy class created.
- #
- # If +p_addr+ is nil, this method returns self (a Net::HTTP object).
- #
- # # Example
- # proxy_class = Net::HTTP::Proxy('proxy.example.com', 8080)
- #
- # proxy_class.start('www.ruby-lang.org') {|http|
- # # connecting proxy.foo.org:8080
- # }
- #
- # You may use them to work with authorization-enabled proxies:
- #
- # proxy_host = 'your.proxy.example'
- # proxy_port = 8080
- # proxy_user = 'user'
- # proxy_pass = 'pass'
- #
- # proxy = Net::HTTP::Proxy(proxy_host, proxy_port, proxy_user, proxy_pass)
- # proxy.start('www.example.com') { |http|
- # # always connect to your.proxy.example:8080 using specified username
- # # and password
- # }
- #
- # Note that net/http does not use the HTTP_PROXY environment variable.
- # If you want to use a proxy, you must set it explicitly.
- #
- def HTTP.Proxy(p_addr, p_port = nil, p_user = nil, p_pass = nil)
+ # This class is obsolete. You may pass these same parameters directly to
+ # Net::HTTP.new. See Net::HTTP.new for details of the arguments.
+ def HTTP.Proxy(p_addr = :ENV, p_port = nil, p_user = nil, p_pass = nil)
return self unless p_addr
- delta = ProxyDelta
- proxyclass = Class.new(self)
- proxyclass.module_eval {
- include delta
- # with proxy
+
+ Class.new(self) {
@is_proxy_class = true
- @proxy_address = p_addr
- @proxy_port = p_port || default_port()
- @proxy_user = p_user
- @proxy_pass = p_pass
+
+ if p_addr == :ENV then
+ @proxy_from_env = true
+ @proxy_address = nil
+ @proxy_port = nil
+ else
+ @proxy_from_env = false
+ @proxy_address = p_addr
+ @proxy_port = p_port || default_port
+ end
+
+ @proxy_user = p_user
+ @proxy_pass = p_pass
}
- proxyclass
end
class << HTTP
@@ -916,29 +1001,51 @@ module Net #:nodoc:
attr_reader :proxy_pass
end
- # True if self is a HTTP proxy class.
+ # True if requests for this connection will be proxied
def proxy?
- self.class.proxy_class?
+ !!if @proxy_from_env then
+ proxy_uri
+ else
+ @proxy_address
+ end
+ end
+
+ # True if the proxy for this connection is determined from the environment
+ def proxy_from_env?
+ @proxy_from_env
end
- # A convenience method for accessing value of proxy_address from Net::HTTP.
+ # The proxy URI determined from the environment for this connection.
+ def proxy_uri # :nodoc:
+ @proxy_uri ||= URI("http://#{address}:#{port}").find_proxy
+ end
+
+ # The address of the proxy server, if one is configured.
def proxy_address
- self.class.proxy_address
+ if @proxy_from_env then
+ proxy_uri && proxy_uri.hostname
+ else
+ @proxy_address
+ end
end
- # A convenience method for accessing value of proxy_port from Net::HTTP.
+ # The port of the proxy server, if one is configured.
def proxy_port
- self.class.proxy_port
+ if @proxy_from_env then
+ proxy_uri && proxy_uri.port
+ else
+ @proxy_port
+ end
end
- # A convenience method for accessing value of proxy_user from Net::HTTP.
+ # The proxy username, if one is configured
def proxy_user
- self.class.proxy_user
+ @proxy_user
end
- # A convenience method for accessing value of proxy_pass from Net::HTTP.
+ # The proxy password, if one is configured
def proxy_pass
- self.class.proxy_pass
+ @proxy_pass
end
alias proxyaddr proxy_address #:nodoc: obsolete
@@ -946,33 +1053,21 @@ module Net #:nodoc:
private
- # without proxy
+ # without proxy, obsolete
- def conn_address
+ def conn_address # :nodoc:
address()
end
- def conn_port
+ def conn_port # :nodoc:
port()
end
def edit_path(path)
- path
- end
-
- module ProxyDelta #:nodoc: internal use only
- private
-
- def conn_address
- proxy_address()
- end
-
- def conn_port
- proxy_port()
- end
-
- def edit_path(path)
- use_ssl? ? path : "http://#{addr_port()}#{path}"
+ if proxy? and not use_ssl? then
+ "http://#{addr_port}#{path}"
+ else
+ path
end
end
@@ -1024,28 +1119,10 @@ module Net #:nodoc:
initheader = initheader.merge({
"accept-encoding" => "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
})
- @compression = true
end
end
request(Get.new(path, initheader)) {|r|
- if r.key?("content-encoding") and @compression
- @compression = nil # Clear it till next set.
- the_body = r.read_body dest, &block
- case r["content-encoding"]
- when "gzip"
- r.body= Zlib::GzipReader.new(StringIO.new(the_body), encoding: "ASCII-8BIT").read
- r.delete("content-encoding")
- when "deflate"
- r.body= Zlib::Inflate.inflate(the_body);
- r.delete("content-encoding")
- when "identity"
- ; # nothing needed
- else
- ; # Don't do anything dramatic, unless we need to later
- end
- else
- r.read_body dest, &block
- end
+ r.read_body dest, &block
res = r
}
res
@@ -1315,18 +1392,38 @@ module Net #:nodoc:
res
end
+ IDEMPOTENT_METHODS_ = %w/GET HEAD PUT DELETE OPTIONS TRACE/ # :nodoc:
+
def transport_request(req)
- begin_transport req
- res = catch(:response) {
- req.exec @socket, @curr_http_version, edit_path(req.path)
- begin
- res = HTTPResponse.read_new(@socket)
- end while res.kind_of?(HTTPContinue)
- res.reading_body(@socket, req.response_body_permitted?) {
- yield res if block_given?
+ count = 0
+ begin
+ begin_transport req
+ res = catch(:response) {
+ req.exec @socket, @curr_http_version, edit_path(req.path)
+ begin
+ res = HTTPResponse.read_new(@socket)
+ end while res.kind_of?(HTTPContinue)
+ res.reading_body(@socket, req.response_body_permitted?) {
+ yield res if block_given?
+ }
+ res
}
- res
- }
+ rescue Net::OpenTimeout
+ raise
+ rescue Net::ReadTimeout, IOError, EOFError,
+ Errno::ECONNRESET, Errno::ECONNABORTED, Errno::EPIPE,
+ OpenSSL::SSL::SSLError, Timeout::Error => exception
+ if count == 0 && IDEMPOTENT_METHODS_.include?(req.method)
+ count += 1
+ @socket.close if @socket and not @socket.closed?
+ D "Conn close because of error #{exception}, and retry"
+ retry
+ end
+ D "Conn close because of error #{exception}"
+ @socket.close if @socket and not @socket.closed?
+ raise
+ end
+
end_transport req, res
res
rescue => exception
@@ -1336,7 +1433,14 @@ module Net #:nodoc:
end
def begin_transport(req)
- connect if @socket.closed?
+ if @socket.closed?
+ connect
+ elsif @last_communicated && @last_communicated + @keep_alive_timeout < Time.now
+ D 'Conn close because of keep_alive_timeout'
+ @socket.close
+ connect
+ end
+
if not req.response_body_permitted? and @close_on_empty_response
req['connection'] ||= 'close'
end
@@ -1345,6 +1449,7 @@ module Net #:nodoc:
def end_transport(req, res)
@curr_http_version = res.http_version
+ @last_communicated = nil
if @socket.closed?
D 'Conn socket closed'
elsif not res.body and @close_on_empty_response
@@ -1352,6 +1457,7 @@ module Net #:nodoc:
@socket.close
elsif keep_alive?(req, res)
D 'Conn keep-alive'
+ @last_communicated = Time.now
else
D 'Conn close'
@socket.close
@@ -1414,1415 +1520,22 @@ module Net #:nodoc:
@debug_output << msg
@debug_output << "\n"
end
-
- end
-
- HTTPSession = HTTP
-
-
- # The HTTPHeader module defines methods for reading and writing
- # HTTP headers.
- #
- # It is used as a mixin by other classes, to provide hash-like
- # access to HTTP header values. Unlike raw hash access, HTTPHeader
- # provides access via case-insensitive keys. It also provides
- # methods for accessing commonly-used HTTP header values in more
- # convenient formats.
- #
- module HTTPHeader
-
- def initialize_http_header(initheader)
- @header = {}
- return unless initheader
- initheader.each do |key, value|
- warn "net/http: warning: duplicated HTTP header: #{key}" if key?(key) and $VERBOSE
- @header[key.downcase] = [value.strip]
- end
- end
-
- def size #:nodoc: obsolete
- @header.size
- end
-
- alias length size #:nodoc: obsolete
-
- # Returns the header field corresponding to the case-insensitive key.
- # For example, a key of "Content-Type" might return "text/html"
- def [](key)
- a = @header[key.downcase] or return nil
- a.join(', ')
- end
-
- # Sets the header field corresponding to the case-insensitive key.
- def []=(key, val)
- unless val
- @header.delete key.downcase
- return val
- end
- @header[key.downcase] = [val]
- end
-
- # [Ruby 1.8.3]
- # Adds a value to a named header field, instead of replacing its value.
- # Second argument +val+ must be a String.
- # See also #[]=, #[] and #get_fields.
- #
- # request.add_field 'X-My-Header', 'a'
- # p request['X-My-Header'] #=> "a"
- # p request.get_fields('X-My-Header') #=> ["a"]
- # request.add_field 'X-My-Header', 'b'
- # p request['X-My-Header'] #=> "a, b"
- # p request.get_fields('X-My-Header') #=> ["a", "b"]
- # request.add_field 'X-My-Header', 'c'
- # p request['X-My-Header'] #=> "a, b, c"
- # p request.get_fields('X-My-Header') #=> ["a", "b", "c"]
- #
- def add_field(key, val)
- if @header.key?(key.downcase)
- @header[key.downcase].push val
- else
- @header[key.downcase] = [val]
- end
- end
-
- # [Ruby 1.8.3]
- # Returns an array of header field strings corresponding to the
- # case-insensitive +key+. This method allows you to get duplicated
- # header fields without any processing. See also #[].
- #
- # p response.get_fields('Set-Cookie')
- # #=> ["session=al98axx; expires=Fri, 31-Dec-1999 23:58:23",
- # "query=rubyscript; expires=Fri, 31-Dec-1999 23:58:23"]
- # p response['Set-Cookie']
- # #=> "session=al98axx; expires=Fri, 31-Dec-1999 23:58:23, query=rubyscript; expires=Fri, 31-Dec-1999 23:58:23"
- #
- def get_fields(key)
- return nil unless @header[key.downcase]
- @header[key.downcase].dup
- end
-
- # Returns the header field corresponding to the case-insensitive key.
- # Returns the default value +args+, or the result of the block, or
- # raises an IndexError if there's no header field named +key+
- # See Hash#fetch
- def fetch(key, *args, &block) #:yield: +key+
- a = @header.fetch(key.downcase, *args, &block)
- a.kind_of?(Array) ? a.join(', ') : a
- end
-
- # Iterates through the header names and values, passing in the name
- # and value to the code block supplied.
- #
- # Example:
- #
- # response.header.each_header {|key,value| puts "#{key} = #{value}" }
- #
- def each_header #:yield: +key+, +value+
- block_given? or return enum_for(__method__)
- @header.each do |k,va|
- yield k, va.join(', ')
- end
- end
-
- alias each each_header
-
- # Iterates through the header names in the header, passing
- # each header name to the code block.
- def each_name(&block) #:yield: +key+
- block_given? or return enum_for(__method__)
- @header.each_key(&block)
- end
-
- alias each_key each_name
-
- # Iterates through the header names in the header, passing
- # capitalized header names to the code block.
- #
- # Note that header names are capitalized systematically;
- # capitalization may not match that used by the remote HTTP
- # server in its response.
- def each_capitalized_name #:yield: +key+
- block_given? or return enum_for(__method__)
- @header.each_key do |k|
- yield capitalize(k)
- end
- end
-
- # Iterates through header values, passing each value to the
- # code block.
- def each_value #:yield: +value+
- block_given? or return enum_for(__method__)
- @header.each_value do |va|
- yield va.join(', ')
- end
- end
-
- # Removes a header field, specified by case-insensitive key.
- def delete(key)
- @header.delete(key.downcase)
- end
-
- # true if +key+ header exists.
- def key?(key)
- @header.key?(key.downcase)
- end
-
- # Returns a Hash consisting of header names and values.
- # e.g.
- # {"cache-control" => "private",
- # "content-type" => "text/html",
- # "date" => "Wed, 22 Jun 2005 22:11:50 GMT"}
- def to_hash
- @header.dup
- end
-
- # As for #each_header, except the keys are provided in capitalized form.
- #
- # Note that header names are capitalized systematically;
- # capitalization may not match that used by the remote HTTP
- # server in its response.
- def each_capitalized
- block_given? or return enum_for(__method__)
- @header.each do |k,v|
- yield capitalize(k), v.join(', ')
- end
- end
-
- alias canonical_each each_capitalized
-
- def capitalize(name)
- name.split(/-/).map {|s| s.capitalize }.join('-')
- end
- private :capitalize
-
- # Returns an Array of Range objects which represent the Range:
- # HTTP header field, or +nil+ if there is no such header.
- def range
- return nil unless @header['range']
- self['Range'].split(/,/).map {|spec|
- m = /bytes\s*=\s*(\d+)?\s*-\s*(\d+)?/i.match(spec) or
- raise HTTPHeaderSyntaxError, "wrong Range: #{spec}"
- d1 = m[1].to_i
- d2 = m[2].to_i
- if m[1] and m[2] then d1..d2
- elsif m[1] then d1..-1
- elsif m[2] then -d2..-1
- else
- raise HTTPHeaderSyntaxError, 'range is not specified'
- end
- }
- end
-
- # Sets the HTTP Range: header.
- # Accepts either a Range object as a single argument,
- # or a beginning index and a length from that index.
- # Example:
- #
- # req.range = (0..1023)
- # req.set_range 0, 1023
- #
- def set_range(r, e = nil)
- unless r
- @header.delete 'range'
- return r
- end
- r = (r...r+e) if e
- case r
- when Numeric
- n = r.to_i
- rangestr = (n > 0 ? "0-#{n-1}" : "-#{-n}")
- when Range
- first = r.first
- last = r.last
- last -= 1 if r.exclude_end?
- if last == -1
- rangestr = (first > 0 ? "#{first}-" : "-#{-first}")
- else
- raise HTTPHeaderSyntaxError, 'range.first is negative' if first < 0
- raise HTTPHeaderSyntaxError, 'range.last is negative' if last < 0
- raise HTTPHeaderSyntaxError, 'must be .first < .last' if first > last
- rangestr = "#{first}-#{last}"
- end
- else
- raise TypeError, 'Range/Integer is required'
- end
- @header['range'] = ["bytes=#{rangestr}"]
- r
- end
-
- alias range= set_range
-
- # Returns an Integer object which represents the HTTP Content-Length:
- # header field, or +nil+ if that field was not provided.
- def content_length
- return nil unless key?('Content-Length')
- len = self['Content-Length'].slice(/\d+/) or
- raise HTTPHeaderSyntaxError, 'wrong Content-Length format'
- len.to_i
- end
-
- def content_length=(len)
- unless len
- @header.delete 'content-length'
- return nil
- end
- @header['content-length'] = [len.to_i.to_s]
- end
-
- # Returns "true" if the "transfer-encoding" header is present and
- # set to "chunked". This is an HTTP/1.1 feature, allowing the
- # the content to be sent in "chunks" without at the outset
- # stating the entire content length.
- def chunked?
- return false unless @header['transfer-encoding']
- field = self['Transfer-Encoding']
- (/(?:\A|[^\-\w])chunked(?![\-\w])/i =~ field) ? true : false
- end
-
- # Returns a Range object which represents the value of the Content-Range:
- # header field.
- # For a partial entity body, this indicates where this fragment
- # fits inside the full entity body, as range of byte offsets.
- def content_range
- return nil unless @header['content-range']
- m = %r<bytes\s+(\d+)-(\d+)/(\d+|\*)>i.match(self['Content-Range']) or
- raise HTTPHeaderSyntaxError, 'wrong Content-Range format'
- m[1].to_i .. m[2].to_i
- end
-
- # The length of the range represented in Content-Range: header.
- def range_length
- r = content_range() or return nil
- r.end - r.begin + 1
- end
-
- # Returns a content type string such as "text/html".
- # This method returns nil if Content-Type: header field does not exist.
- def content_type
- return nil unless main_type()
- if sub_type()
- then "#{main_type()}/#{sub_type()}"
- else main_type()
- end
- end
-
- # Returns a content type string such as "text".
- # This method returns nil if Content-Type: header field does not exist.
- def main_type
- return nil unless @header['content-type']
- self['Content-Type'].split(';').first.to_s.split('/')[0].to_s.strip
- end
-
- # Returns a content type string such as "html".
- # This method returns nil if Content-Type: header field does not exist
- # or sub-type is not given (e.g. "Content-Type: text").
- def sub_type
- return nil unless @header['content-type']
- _, sub = *self['Content-Type'].split(';').first.to_s.split('/')
- return nil unless sub
- sub.strip
- end
-
- # Any parameters specified for the content type, returned as a Hash.
- # For example, a header of Content-Type: text/html; charset=EUC-JP
- # would result in type_params returning {'charset' => 'EUC-JP'}
- def type_params
- result = {}
- list = self['Content-Type'].to_s.split(';')
- list.shift
- list.each do |param|
- k, v = *param.split('=', 2)
- result[k.strip] = v.strip
- end
- result
- end
-
- # Sets the content type in an HTTP header.
- # The +type+ should be a full HTTP content type, e.g. "text/html".
- # The +params+ are an optional Hash of parameters to add after the
- # content type, e.g. {'charset' => 'iso-8859-1'}
- def set_content_type(type, params = {})
- @header['content-type'] = [type + params.map{|k,v|"; #{k}=#{v}"}.join('')]
- end
-
- alias content_type= set_content_type
-
- # Set header fields and a body from HTML form data.
- # +params+ should be an Array of Arrays or
- # a Hash containing HTML form data.
- # Optional argument +sep+ means data record separator.
- #
- # Values are URL encoded as necessary and the content-type is set to
- # application/x-www-form-urlencoded
- #
- # Example:
- # http.form_data = {"q" => "ruby", "lang" => "en"}
- # http.form_data = {"q" => ["ruby", "perl"], "lang" => "en"}
- # http.set_form_data({"q" => "ruby", "lang" => "en"}, ';')
- #
- def set_form_data(params, sep = '&')
- query = URI.encode_www_form(params)
- query.gsub!(/&/, sep) if sep != '&'
- self.body = query
- self.content_type = 'application/x-www-form-urlencoded'
- end
-
- alias form_data= set_form_data
-
- # Set a HTML form data set.
- # +params+ is the form data set; it is an Array of Arrays or a Hash
- # +enctype is the type to encode the form data set.
- # It is application/x-www-form-urlencoded or multipart/form-data.
- # +formpot+ is an optional hash to specify the detail.
- #
- # boundary:: the boundary of the multipart message
- # charset:: the charset of the message. All names and the values of
- # non-file fields are encoded as the charset.
- #
- # Each item of params is an array and contains following items:
- # +name+:: the name of the field
- # +value+:: the value of the field, it should be a String or a File
- # +opt+:: an optional hash to specify additional information
- #
- # Each item is a file field or a normal field.
- # If +value+ is a File object or the +opt+ have a filename key,
- # the item is treated as a file field.
- #
- # If Transfer-Encoding is set as chunked, this send the request in
- # chunked encoding. Because chunked encoding is HTTP/1.1 feature,
- # you must confirm the server to support HTTP/1.1 before sending it.
- #
- # Example:
- # http.set_form([["q", "ruby"], ["lang", "en"]])
- #
- # See also RFC 2388, RFC 2616, HTML 4.01, and HTML5
- #
- def set_form(params, enctype='application/x-www-form-urlencoded', formopt={})
- @body_data = params
- @body = nil
- @body_stream = nil
- @form_option = formopt
- case enctype
- when /\Aapplication\/x-www-form-urlencoded\z/i,
- /\Amultipart\/form-data\z/i
- self.content_type = enctype
- else
- raise ArgumentError, "invalid enctype: #{enctype}"
- end
- end
-
- # Set the Authorization: header for "Basic" authorization.
- def basic_auth(account, password)
- @header['authorization'] = [basic_encode(account, password)]
- end
-
- # Set Proxy-Authorization: header for "Basic" authorization.
- def proxy_basic_auth(account, password)
- @header['proxy-authorization'] = [basic_encode(account, password)]
- end
-
- def basic_encode(account, password)
- 'Basic ' + ["#{account}:#{password}"].pack('m').delete("\r\n")
- end
- private :basic_encode
-
- def connection_close?
- tokens(@header['connection']).include?('close') or
- tokens(@header['proxy-connection']).include?('close')
- end
-
- def connection_keep_alive?
- tokens(@header['connection']).include?('keep-alive') or
- tokens(@header['proxy-connection']).include?('keep-alive')
- end
-
- def tokens(vals)
- return [] unless vals
- vals.map {|v| v.split(',') }.flatten\
- .reject {|str| str.strip.empty? }\
- .map {|tok| tok.strip.downcase }
- end
- private :tokens
-
- end
-
-
- # HTTPGenericRequest is the parent of the HTTPRequest class.
- # Do not use this directly; use a subclass of HTTPRequest.
- #
- # Mixes in the HTTPHeader module to provide easier access to HTTP headers.
- #
- class HTTPGenericRequest
-
- include HTTPHeader
-
- def initialize(m, reqbody, resbody, path, initheader = nil)
- @method = m
- @request_has_body = reqbody
- @response_has_body = resbody
- raise ArgumentError, "no HTTP request path given" unless path
- raise ArgumentError, "HTTP request path is empty" if path.empty?
- @path = path
- initialize_http_header initheader
- self['Accept'] ||= '*/*'
- self['User-Agent'] ||= 'Ruby'
- @body = nil
- @body_stream = nil
- @body_data = nil
- end
-
- attr_reader :method
- attr_reader :path
-
- def inspect
- "\#<#{self.class} #{@method}>"
- end
-
- def request_body_permitted?
- @request_has_body
- end
-
- def response_body_permitted?
- @response_has_body
- end
-
- def body_exist?
- warn "Net::HTTPRequest#body_exist? is obsolete; use response_body_permitted?" if $VERBOSE
- response_body_permitted?
- end
-
- attr_reader :body
-
- def body=(str)
- @body = str
- @body_stream = nil
- @body_data = nil
- str
- end
-
- attr_reader :body_stream
-
- def body_stream=(input)
- @body = nil
- @body_stream = input
- @body_data = nil
- input
- end
-
- def set_body_internal(str) #:nodoc: internal use only
- raise ArgumentError, "both of body argument and HTTPRequest#body set" if str and (@body or @body_stream)
- self.body = str if str
- end
-
- #
- # write
- #
-
- def exec(sock, ver, path) #:nodoc: internal use only
- if @body
- send_request_with_body sock, ver, path, @body
- elsif @body_stream
- send_request_with_body_stream sock, ver, path, @body_stream
- elsif @body_data
- send_request_with_body_data sock, ver, path, @body_data
- else
- write_header sock, ver, path
- end
- end
-
- private
-
- def send_request_with_body(sock, ver, path, body)
- self.content_length = body.bytesize
- delete 'Transfer-Encoding'
- supply_default_content_type
- write_header sock, ver, path
- wait_for_continue sock, ver if sock.continue_timeout
- sock.write body
- end
-
- def send_request_with_body_stream(sock, ver, path, f)
- unless content_length() or chunked?
- raise ArgumentError,
- "Content-Length not given and Transfer-Encoding is not `chunked'"
- end
- supply_default_content_type
- write_header sock, ver, path
- wait_for_continue sock, ver if sock.continue_timeout
- if chunked?
- while s = f.read(1024)
- sock.write(sprintf("%x\r\n", s.length) << s << "\r\n")
- end
- sock.write "0\r\n\r\n"
- else
- while s = f.read(1024)
- sock.write s
- end
- end
- end
-
- def send_request_with_body_data(sock, ver, path, params)
- if /\Amultipart\/form-data\z/i !~ self.content_type
- self.content_type = 'application/x-www-form-urlencoded'
- return send_request_with_body(sock, ver, path, URI.encode_www_form(params))
- end
-
- opt = @form_option.dup
- require 'securerandom' unless defined?(SecureRandom)
- opt[:boundary] ||= SecureRandom.urlsafe_base64(40)
- self.set_content_type(self.content_type, boundary: opt[:boundary])
- if chunked?
- write_header sock, ver, path
- encode_multipart_form_data(sock, params, opt)
- else
- require 'tempfile'
- file = Tempfile.new('multipart')
- file.binmode
- encode_multipart_form_data(file, params, opt)
- file.rewind
- self.content_length = file.size
- write_header sock, ver, path
- IO.copy_stream(file, sock)
- end
- end
-
- def encode_multipart_form_data(out, params, opt)
- charset = opt[:charset]
- boundary = opt[:boundary]
- require 'securerandom' unless defined?(SecureRandom)
- boundary ||= SecureRandom.urlsafe_base64(40)
- chunked_p = chunked?
-
- buf = ''
- params.each do |key, value, h={}|
- key = quote_string(key, charset)
- filename =
- h.key?(:filename) ? h[:filename] :
- value.respond_to?(:to_path) ? File.basename(value.to_path) :
- nil
-
- buf << "--#{boundary}\r\n"
- if filename
- filename = quote_string(filename, charset)
- type = h[:content_type] || 'application/octet-stream'
- buf << "Content-Disposition: form-data; " \
- "name=\"#{key}\"; filename=\"#{filename}\"\r\n" \
- "Content-Type: #{type}\r\n\r\n"
- if !out.respond_to?(:write) || !value.respond_to?(:read)
- # if +out+ is not an IO or +value+ is not an IO
- buf << (value.respond_to?(:read) ? value.read : value)
- elsif value.respond_to?(:size) && chunked_p
- # if +out+ is an IO and +value+ is a File, use IO.copy_stream
- flush_buffer(out, buf, chunked_p)
- out << "%x\r\n" % value.size if chunked_p
- IO.copy_stream(value, out)
- out << "\r\n" if chunked_p
- else
- # +out+ is an IO, and +value+ is not a File but an IO
- flush_buffer(out, buf, chunked_p)
- 1 while flush_buffer(out, value.read(4096), chunked_p)
- end
- else
- # non-file field:
- # HTML5 says, "The parts of the generated multipart/form-data
- # resource that correspond to non-file fields must not have a
- # Content-Type header specified."
- buf << "Content-Disposition: form-data; name=\"#{key}\"\r\n\r\n"
- buf << (value.respond_to?(:read) ? value.read : value)
- end
- buf << "\r\n"
- end
- buf << "--#{boundary}--\r\n"
- flush_buffer(out, buf, chunked_p)
- out << "0\r\n\r\n" if chunked_p
- end
-
- def quote_string(str, charset)
- str = str.encode(charset, fallback:->(c){'&#%d;'%c.encode("UTF-8").ord}) if charset
- str = str.gsub(/[\\"]/, '\\\\\&')
- end
-
- def flush_buffer(out, buf, chunked_p)
- return unless buf
- out << "%x\r\n"%buf.bytesize if chunked_p
- out << buf
- out << "\r\n" if chunked_p
- buf.clear
- end
-
- def supply_default_content_type
- return if content_type()
- warn 'net/http: warning: Content-Type did not set; using application/x-www-form-urlencoded' if $VERBOSE
- set_content_type 'application/x-www-form-urlencoded'
- end
-
- ##
- # Waits up to the continue timeout for a response from the server provided
- # we're speaking HTTP 1.1 and are expecting a 100-continue response.
-
- def wait_for_continue(sock, ver)
- if ver >= '1.1' and @header['expect'] and
- @header['expect'].include?('100-continue')
- if IO.select([sock.io], nil, nil, sock.continue_timeout)
- res = HTTPResponse.read_new(sock)
- unless res.kind_of?(Net::HTTPContinue)
- throw :response, res
- end
- end
- end
- end
-
- def write_header(sock, ver, path)
- buf = "#{@method} #{path} HTTP/#{ver}\r\n"
- each_capitalized do |k,v|
- buf << "#{k}: #{v}\r\n"
- end
- buf << "\r\n"
- sock.write buf
- end
-
- end
-
-
- #
- # HTTP request class.
- # This class wraps together the request header and the request path.
- # You cannot use this class directly. Instead, you should use one of its
- # subclasses: Net::HTTP::Get, Net::HTTP::Post, Net::HTTP::Head.
- #
- class HTTPRequest < HTTPGenericRequest
-
- # Creates HTTP request object.
- def initialize(path, initheader = nil)
- super self.class::METHOD,
- self.class::REQUEST_HAS_BODY,
- self.class::RESPONSE_HAS_BODY,
- path, initheader
- end
- end
-
-
- class HTTP # reopen
- #
- # HTTP/1.1 methods --- RFC2616
- #
-
- # See Net::HTTPGenericRequest for attributes and methods.
- # See Net::HTTP for usage examples.
- class Get < HTTPRequest
- METHOD = 'GET'
- REQUEST_HAS_BODY = false
- RESPONSE_HAS_BODY = true
- end
-
- # See Net::HTTPGenericRequest for attributes and methods.
- # See Net::HTTP for usage examples.
- class Head < HTTPRequest
- METHOD = 'HEAD'
- REQUEST_HAS_BODY = false
- RESPONSE_HAS_BODY = false
- end
-
- # See Net::HTTPGenericRequest for attributes and methods.
- # See Net::HTTP for usage examples.
- class Post < HTTPRequest
- METHOD = 'POST'
- REQUEST_HAS_BODY = true
- RESPONSE_HAS_BODY = true
- end
-
- # See Net::HTTPGenericRequest for attributes and methods.
- # See Net::HTTP for usage examples.
- class Put < HTTPRequest
- METHOD = 'PUT'
- REQUEST_HAS_BODY = true
- RESPONSE_HAS_BODY = true
- end
-
- # See Net::HTTPGenericRequest for attributes and methods.
- # See Net::HTTP for usage examples.
- class Delete < HTTPRequest
- METHOD = 'DELETE'
- REQUEST_HAS_BODY = false
- RESPONSE_HAS_BODY = true
- end
-
- # See Net::HTTPGenericRequest for attributes and methods.
- class Options < HTTPRequest
- METHOD = 'OPTIONS'
- REQUEST_HAS_BODY = false
- RESPONSE_HAS_BODY = false
- end
-
- # See Net::HTTPGenericRequest for attributes and methods.
- class Trace < HTTPRequest
- METHOD = 'TRACE'
- REQUEST_HAS_BODY = false
- RESPONSE_HAS_BODY = true
- end
-
- #
- # PATCH method --- RFC5789
- #
-
- # See Net::HTTPGenericRequest for attributes and methods.
- class Patch < HTTPRequest
- METHOD = 'PATCH'
- REQUEST_HAS_BODY = true
- RESPONSE_HAS_BODY = true
- end
-
- #
- # WebDAV methods --- RFC2518
- #
-
- # See Net::HTTPGenericRequest for attributes and methods.
- class Propfind < HTTPRequest
- METHOD = 'PROPFIND'
- REQUEST_HAS_BODY = true
- RESPONSE_HAS_BODY = true
- end
-
- # See Net::HTTPGenericRequest for attributes and methods.
- class Proppatch < HTTPRequest
- METHOD = 'PROPPATCH'
- REQUEST_HAS_BODY = true
- RESPONSE_HAS_BODY = true
- end
-
- # See Net::HTTPGenericRequest for attributes and methods.
- class Mkcol < HTTPRequest
- METHOD = 'MKCOL'
- REQUEST_HAS_BODY = true
- RESPONSE_HAS_BODY = true
- end
-
- # See Net::HTTPGenericRequest for attributes and methods.
- class Copy < HTTPRequest
- METHOD = 'COPY'
- REQUEST_HAS_BODY = false
- RESPONSE_HAS_BODY = true
- end
-
- # See Net::HTTPGenericRequest for attributes and methods.
- class Move < HTTPRequest
- METHOD = 'MOVE'
- REQUEST_HAS_BODY = false
- RESPONSE_HAS_BODY = true
- end
-
- # See Net::HTTPGenericRequest for attributes and methods.
- class Lock < HTTPRequest
- METHOD = 'LOCK'
- REQUEST_HAS_BODY = true
- RESPONSE_HAS_BODY = true
- end
-
- # See Net::HTTPGenericRequest for attributes and methods.
- class Unlock < HTTPRequest
- METHOD = 'UNLOCK'
- REQUEST_HAS_BODY = true
- RESPONSE_HAS_BODY = true
- end
end
+end
- ###
- ### Response
- ###
-
- # HTTP exception class.
- # You cannot use HTTPExceptions directly; instead, you must use
- # its subclasses.
- module HTTPExceptions
- def initialize(msg, res) #:nodoc:
- super msg
- @response = res
- end
- attr_reader :response
- alias data response #:nodoc: obsolete
- end
- class HTTPError < ProtocolError
- include HTTPExceptions
- end
- class HTTPRetriableError < ProtoRetriableError
- include HTTPExceptions
- end
- class HTTPServerException < ProtoServerError
- # We cannot use the name "HTTPServerError", it is the name of the response.
- include HTTPExceptions
- end
- class HTTPFatalError < ProtoFatalError
- include HTTPExceptions
- end
+require 'net/http/exceptions'
+require 'net/http/header'
- # HTTP response class.
- #
- # This class wraps together the response header and the response body (the
- # entity requested).
- #
- # It mixes in the HTTPHeader module, which provides access to response
- # header values both via hash-like methods and via individual readers.
- #
- # Note that each possible HTTP response code defines its own
- # HTTPResponse subclass. These are listed below.
- #
- # All classes are
- # defined under the Net module. Indentation indicates inheritance.
- #
- # xxx HTTPResponse
- #
- # 1xx HTTPInformation
- # 100 HTTPContinue
- # 101 HTTPSwitchProtocol
- #
- # 2xx HTTPSuccess
- # 200 HTTPOK
- # 201 HTTPCreated
- # 202 HTTPAccepted
- # 203 HTTPNonAuthoritativeInformation
- # 204 HTTPNoContent
- # 205 HTTPResetContent
- # 206 HTTPPartialContent
- #
- # 3xx HTTPRedirection
- # 300 HTTPMultipleChoice
- # 301 HTTPMovedPermanently
- # 302 HTTPFound
- # 303 HTTPSeeOther
- # 304 HTTPNotModified
- # 305 HTTPUseProxy
- # 307 HTTPTemporaryRedirect
- #
- # 4xx HTTPClientError
- # 400 HTTPBadRequest
- # 401 HTTPUnauthorized
- # 402 HTTPPaymentRequired
- # 403 HTTPForbidden
- # 404 HTTPNotFound
- # 405 HTTPMethodNotAllowed
- # 406 HTTPNotAcceptable
- # 407 HTTPProxyAuthenticationRequired
- # 408 HTTPRequestTimeOut
- # 409 HTTPConflict
- # 410 HTTPGone
- # 411 HTTPLengthRequired
- # 412 HTTPPreconditionFailed
- # 413 HTTPRequestEntityTooLarge
- # 414 HTTPRequestURITooLong
- # 415 HTTPUnsupportedMediaType
- # 416 HTTPRequestedRangeNotSatisfiable
- # 417 HTTPExpectationFailed
- #
- # 5xx HTTPServerError
- # 500 HTTPInternalServerError
- # 501 HTTPNotImplemented
- # 502 HTTPBadGateway
- # 503 HTTPServiceUnavailable
- # 504 HTTPGatewayTimeOut
- # 505 HTTPVersionNotSupported
- #
- # xxx HTTPUnknownResponse
- #
- class HTTPResponse
- # true if the response has a body.
- def HTTPResponse.body_permitted?
- self::HAS_BODY
- end
-
- def HTTPResponse.exception_type # :nodoc: internal use only
- self::EXCEPTION_TYPE
- end
- end # reopened after
+require 'net/http/generic_request'
+require 'net/http/request'
+require 'net/http/requests'
- # :stopdoc:
+require 'net/http/response'
+require 'net/http/responses'
- class HTTPUnknownResponse < HTTPResponse
- HAS_BODY = true
- EXCEPTION_TYPE = HTTPError
- end
- class HTTPInformation < HTTPResponse # 1xx
- HAS_BODY = false
- EXCEPTION_TYPE = HTTPError
- end
- class HTTPSuccess < HTTPResponse # 2xx
- HAS_BODY = true
- EXCEPTION_TYPE = HTTPError
- end
- class HTTPRedirection < HTTPResponse # 3xx
- HAS_BODY = true
- EXCEPTION_TYPE = HTTPRetriableError
- end
- class HTTPClientError < HTTPResponse # 4xx
- HAS_BODY = true
- EXCEPTION_TYPE = HTTPServerException # for backward compatibility
- end
- class HTTPServerError < HTTPResponse # 5xx
- HAS_BODY = true
- EXCEPTION_TYPE = HTTPFatalError # for backward compatibility
- end
-
- class HTTPContinue < HTTPInformation # 100
- HAS_BODY = false
- end
- class HTTPSwitchProtocol < HTTPInformation # 101
- HAS_BODY = false
- end
-
- class HTTPOK < HTTPSuccess # 200
- HAS_BODY = true
- end
- class HTTPCreated < HTTPSuccess # 201
- HAS_BODY = true
- end
- class HTTPAccepted < HTTPSuccess # 202
- HAS_BODY = true
- end
- class HTTPNonAuthoritativeInformation < HTTPSuccess # 203
- HAS_BODY = true
- end
- class HTTPNoContent < HTTPSuccess # 204
- HAS_BODY = false
- end
- class HTTPResetContent < HTTPSuccess # 205
- HAS_BODY = false
- end
- class HTTPPartialContent < HTTPSuccess # 206
- HAS_BODY = true
- end
-
- class HTTPMultipleChoice < HTTPRedirection # 300
- HAS_BODY = true
- end
- class HTTPMovedPermanently < HTTPRedirection # 301
- HAS_BODY = true
- end
- class HTTPFound < HTTPRedirection # 302
- HAS_BODY = true
- end
- HTTPMovedTemporarily = HTTPFound
- class HTTPSeeOther < HTTPRedirection # 303
- HAS_BODY = true
- end
- class HTTPNotModified < HTTPRedirection # 304
- HAS_BODY = false
- end
- class HTTPUseProxy < HTTPRedirection # 305
- HAS_BODY = false
- end
- # 306 unused
- class HTTPTemporaryRedirect < HTTPRedirection # 307
- HAS_BODY = true
- end
-
- class HTTPBadRequest < HTTPClientError # 400
- HAS_BODY = true
- end
- class HTTPUnauthorized < HTTPClientError # 401
- HAS_BODY = true
- end
- class HTTPPaymentRequired < HTTPClientError # 402
- HAS_BODY = true
- end
- class HTTPForbidden < HTTPClientError # 403
- HAS_BODY = true
- end
- class HTTPNotFound < HTTPClientError # 404
- HAS_BODY = true
- end
- class HTTPMethodNotAllowed < HTTPClientError # 405
- HAS_BODY = true
- end
- class HTTPNotAcceptable < HTTPClientError # 406
- HAS_BODY = true
- end
- class HTTPProxyAuthenticationRequired < HTTPClientError # 407
- HAS_BODY = true
- end
- class HTTPRequestTimeOut < HTTPClientError # 408
- HAS_BODY = true
- end
- class HTTPConflict < HTTPClientError # 409
- HAS_BODY = true
- end
- class HTTPGone < HTTPClientError # 410
- HAS_BODY = true
- end
- class HTTPLengthRequired < HTTPClientError # 411
- HAS_BODY = true
- end
- class HTTPPreconditionFailed < HTTPClientError # 412
- HAS_BODY = true
- end
- class HTTPRequestEntityTooLarge < HTTPClientError # 413
- HAS_BODY = true
- end
- class HTTPRequestURITooLong < HTTPClientError # 414
- HAS_BODY = true
- end
- HTTPRequestURITooLarge = HTTPRequestURITooLong
- class HTTPUnsupportedMediaType < HTTPClientError # 415
- HAS_BODY = true
- end
- class HTTPRequestedRangeNotSatisfiable < HTTPClientError # 416
- HAS_BODY = true
- end
- class HTTPExpectationFailed < HTTPClientError # 417
- HAS_BODY = true
- end
-
- class HTTPInternalServerError < HTTPServerError # 500
- HAS_BODY = true
- end
- class HTTPNotImplemented < HTTPServerError # 501
- HAS_BODY = true
- end
- class HTTPBadGateway < HTTPServerError # 502
- HAS_BODY = true
- end
- class HTTPServiceUnavailable < HTTPServerError # 503
- HAS_BODY = true
- end
- class HTTPGatewayTimeOut < HTTPServerError # 504
- HAS_BODY = true
- end
- class HTTPVersionNotSupported < HTTPServerError # 505
- HAS_BODY = true
- end
-
- # :startdoc:
-
-
- class HTTPResponse # reopen
-
- CODE_CLASS_TO_OBJ = {
- '1' => HTTPInformation,
- '2' => HTTPSuccess,
- '3' => HTTPRedirection,
- '4' => HTTPClientError,
- '5' => HTTPServerError
- }
- CODE_TO_OBJ = {
- '100' => HTTPContinue,
- '101' => HTTPSwitchProtocol,
-
- '200' => HTTPOK,
- '201' => HTTPCreated,
- '202' => HTTPAccepted,
- '203' => HTTPNonAuthoritativeInformation,
- '204' => HTTPNoContent,
- '205' => HTTPResetContent,
- '206' => HTTPPartialContent,
-
- '300' => HTTPMultipleChoice,
- '301' => HTTPMovedPermanently,
- '302' => HTTPFound,
- '303' => HTTPSeeOther,
- '304' => HTTPNotModified,
- '305' => HTTPUseProxy,
- '307' => HTTPTemporaryRedirect,
-
- '400' => HTTPBadRequest,
- '401' => HTTPUnauthorized,
- '402' => HTTPPaymentRequired,
- '403' => HTTPForbidden,
- '404' => HTTPNotFound,
- '405' => HTTPMethodNotAllowed,
- '406' => HTTPNotAcceptable,
- '407' => HTTPProxyAuthenticationRequired,
- '408' => HTTPRequestTimeOut,
- '409' => HTTPConflict,
- '410' => HTTPGone,
- '411' => HTTPLengthRequired,
- '412' => HTTPPreconditionFailed,
- '413' => HTTPRequestEntityTooLarge,
- '414' => HTTPRequestURITooLong,
- '415' => HTTPUnsupportedMediaType,
- '416' => HTTPRequestedRangeNotSatisfiable,
- '417' => HTTPExpectationFailed,
-
- '500' => HTTPInternalServerError,
- '501' => HTTPNotImplemented,
- '502' => HTTPBadGateway,
- '503' => HTTPServiceUnavailable,
- '504' => HTTPGatewayTimeOut,
- '505' => HTTPVersionNotSupported
- }
-
- class << HTTPResponse
- def read_new(sock) #:nodoc: internal use only
- httpv, code, msg = read_status_line(sock)
- res = response_class(code).new(httpv, code, msg)
- each_response_header(sock) do |k,v|
- res.add_field k, v
- end
- res
- end
-
- private
-
- def read_status_line(sock)
- str = sock.readline
- m = /\AHTTP(?:\/(\d+\.\d+))?\s+(\d\d\d)\s*(.*)\z/in.match(str) or
- raise HTTPBadResponse, "wrong status line: #{str.dump}"
- m.captures
- end
-
- def response_class(code)
- CODE_TO_OBJ[code] or
- CODE_CLASS_TO_OBJ[code[0,1]] or
- HTTPUnknownResponse
- end
-
- def each_response_header(sock)
- key = value = nil
- while true
- line = sock.readuntil("\n", true).sub(/\s+\z/, '')
- break if line.empty?
- if line[0] == ?\s or line[0] == ?\t and value
- value << ' ' unless value.empty?
- value << line.strip
- else
- yield key, value if key
- key, value = line.strip.split(/\s*:\s*/, 2)
- raise HTTPBadResponse, 'wrong header line format' if value.nil?
- end
- end
- yield key, value if key
- end
- end
-
- # next is to fix bug in RDoc, where the private inside class << self
- # spills out.
- public
-
- include HTTPHeader
-
- def initialize(httpv, code, msg) #:nodoc: internal use only
- @http_version = httpv
- @code = code
- @message = msg
- initialize_http_header nil
- @body = nil
- @read = false
- end
-
- # The HTTP version supported by the server.
- attr_reader :http_version
-
- # The HTTP result code string. For example, '302'. You can also
- # determine the response type by examining which response subclass
- # the response object is an instance of.
- attr_reader :code
-
- # The HTTP result message sent by the server. For example, 'Not Found'.
- attr_reader :message
- alias msg message # :nodoc: obsolete
-
- def inspect
- "#<#{self.class} #{@code} #{@message} readbody=#{@read}>"
- end
-
- #
- # response <-> exception relationship
- #
-
- def code_type #:nodoc:
- self.class
- end
-
- def error! #:nodoc:
- raise error_type().new(@code + ' ' + @message.dump, self)
- end
-
- def error_type #:nodoc:
- self.class::EXCEPTION_TYPE
- end
-
- # Raises an HTTP error if the response is not 2xx (success).
- def value
- error! unless self.kind_of?(HTTPSuccess)
- end
-
- #
- # header (for backward compatibility only; DO NOT USE)
- #
-
- def response #:nodoc:
- warn "#{caller(1)[0]}: warning: HTTPResponse#response is obsolete" if $VERBOSE
- self
- end
-
- def header #:nodoc:
- warn "#{caller(1)[0]}: warning: HTTPResponse#header is obsolete" if $VERBOSE
- self
- end
-
- def read_header #:nodoc:
- warn "#{caller(1)[0]}: warning: HTTPResponse#read_header is obsolete" if $VERBOSE
- self
- end
-
- #
- # body
- #
-
- def reading_body(sock, reqmethodallowbody) #:nodoc: internal use only
- @socket = sock
- @body_exist = reqmethodallowbody && self.class.body_permitted?
- begin
- yield
- self.body # ensure to read body
- ensure
- @socket = nil
- end
- end
-
- # Gets the entity body returned by the remote HTTP server.
- #
- # If a block is given, the body is passed to the block, and
- # the body is provided in fragments, as it is read in from the socket.
- #
- # Calling this method a second or subsequent time for the same
- # HTTPResponse object will return the value already read.
- #
- # http.request_get('/index.html') {|res|
- # puts res.read_body
- # }
- #
- # http.request_get('/index.html') {|res|
- # p res.read_body.object_id # 538149362
- # p res.read_body.object_id # 538149362
- # }
- #
- # # using iterator
- # http.request_get('/index.html') {|res|
- # res.read_body do |segment|
- # print segment
- # end
- # }
- #
- def read_body(dest = nil, &block)
- if @read
- raise IOError, "#{self.class}\#read_body called twice" if dest or block
- return @body
- end
- to = procdest(dest, block)
- stream_check
- if @body_exist
- read_body_0 to
- @body = to
- else
- @body = nil
- end
- @read = true
-
- @body
- end
-
- # Returns the full entity body.
- #
- # Calling this method a second or subsequent time will return the
- # string already read.
- #
- # http.request_get('/index.html') {|res|
- # puts res.body
- # }
- #
- # http.request_get('/index.html') {|res|
- # p res.body.object_id # 538149362
- # p res.body.object_id # 538149362
- # }
- #
- def body
- read_body()
- end
-
- # Because it may be necessary to modify the body, Eg, decompression
- # this method facilitates that.
- def body=(value)
- @body = value
- end
-
- alias entity body #:nodoc: obsolete
-
- private
-
- def read_body_0(dest)
- if chunked?
- read_chunked dest
- return
- end
- clen = content_length()
- if clen
- @socket.read clen, dest, true # ignore EOF
- return
- end
- clen = range_length()
- if clen
- @socket.read clen, dest
- return
- end
- @socket.read_all dest
- end
-
- def read_chunked(dest)
- len = nil
- total = 0
- while true
- line = @socket.readline
- hexlen = line.slice(/[0-9a-fA-F]+/) or
- raise HTTPBadResponse, "wrong chunk size line: #{line}"
- len = hexlen.hex
- break if len == 0
- begin
- @socket.read len, dest
- ensure
- total += len
- @socket.read 2 # \r\n
- end
- end
- until @socket.readline.empty?
- # none
- end
- end
-
- def stream_check
- raise IOError, 'attempt to read body out of block' if @socket.closed?
- end
-
- def procdest(dest, block)
- raise ArgumentError, 'both arg and block given for HTTP method' \
- if dest and block
- if block
- ReadAdapter.new(block)
- else
- dest || ''
- end
- end
-
- end
-
-
- # :enddoc:
-
- #--
- # for backward compatibility
- class HTTP
- ProxyMod = ProxyDelta
- end
- module NetPrivate
- HTTPRequest = ::Net::HTTPRequest
- end
+require 'net/http/proxy_delta'
- HTTPInformationCode = HTTPInformation
- HTTPSuccessCode = HTTPSuccess
- HTTPRedirectionCode = HTTPRedirection
- HTTPRetriableCode = HTTPRedirection
- HTTPClientErrorCode = HTTPClientError
- HTTPFatalErrorCode = HTTPClientError
- HTTPServerErrorCode = HTTPServerError
- HTTPResponceReceiver = HTTPResponse
+require 'net/http/backward'
-end # module Net
diff --git a/lib/net/http/backward.rb b/lib/net/http/backward.rb
new file mode 100644
index 0000000000..faf47b8489
--- /dev/null
+++ b/lib/net/http/backward.rb
@@ -0,0 +1,25 @@
+# for backward compatibility
+
+# :enddoc:
+
+class Net::HTTP
+ ProxyMod = ProxyDelta
+end
+
+module Net
+ HTTPSession = Net::HTTP
+end
+
+module Net::NetPrivate
+ HTTPRequest = ::Net::HTTPRequest
+end
+
+Net::HTTPInformationCode = Net::HTTPInformation
+Net::HTTPSuccessCode = Net::HTTPSuccess
+Net::HTTPRedirectionCode = Net::HTTPRedirection
+Net::HTTPRetriableCode = Net::HTTPRedirection
+Net::HTTPClientErrorCode = Net::HTTPClientError
+Net::HTTPFatalErrorCode = Net::HTTPClientError
+Net::HTTPServerErrorCode = Net::HTTPServerError
+Net::HTTPResponceReceiver = Net::HTTPResponse
+
diff --git a/lib/net/http/exceptions.rb b/lib/net/http/exceptions.rb
new file mode 100644
index 0000000000..6c5d81cb04
--- /dev/null
+++ b/lib/net/http/exceptions.rb
@@ -0,0 +1,25 @@
+# Net::HTTP exception class.
+# You cannot use Net::HTTPExceptions directly; instead, you must use
+# its subclasses.
+module Net::HTTPExceptions
+ def initialize(msg, res) #:nodoc:
+ super msg
+ @response = res
+ end
+ attr_reader :response
+ alias data response #:nodoc: obsolete
+end
+class Net::HTTPError < Net::ProtocolError
+ include Net::HTTPExceptions
+end
+class Net::HTTPRetriableError < Net::ProtoRetriableError
+ include Net::HTTPExceptions
+end
+class Net::HTTPServerException < Net::ProtoServerError
+ # We cannot use the name "HTTPServerError", it is the name of the response.
+ include Net::HTTPExceptions
+end
+class Net::HTTPFatalError < Net::ProtoFatalError
+ include Net::HTTPExceptions
+end
+
diff --git a/lib/net/http/generic_request.rb b/lib/net/http/generic_request.rb
new file mode 100644
index 0000000000..bcf87d35be
--- /dev/null
+++ b/lib/net/http/generic_request.rb
@@ -0,0 +1,266 @@
+# HTTPGenericRequest is the parent of the HTTPRequest class.
+# Do not use this directly; use a subclass of HTTPRequest.
+#
+# Mixes in the HTTPHeader module to provide easier access to HTTP headers.
+#
+class Net::HTTPGenericRequest
+
+ include Net::HTTPHeader
+
+ def initialize(m, reqbody, resbody, path, initheader = nil)
+ @method = m
+ @request_has_body = reqbody
+ @response_has_body = resbody
+ raise ArgumentError, "no HTTP request path given" unless path
+ raise ArgumentError, "HTTP request path is empty" if path.empty?
+ @path = path
+
+ if @response_has_body and Net::HTTP::HAVE_ZLIB then
+ if !initheader ||
+ !initheader.keys.any? { |k|
+ %w[accept-encoding range].include? k.downcase
+ } then
+ initheader = initheader ? initheader.dup : {}
+ initheader["accept-encoding"] =
+ "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
+ end
+ end
+
+ initialize_http_header initheader
+ self['Accept'] ||= '*/*'
+ self['User-Agent'] ||= 'Ruby'
+ @body = nil
+ @body_stream = nil
+ @body_data = nil
+ end
+
+ attr_reader :method
+ attr_reader :path
+
+ def inspect
+ "\#<#{self.class} #{@method}>"
+ end
+
+ def request_body_permitted?
+ @request_has_body
+ end
+
+ def response_body_permitted?
+ @response_has_body
+ end
+
+ def body_exist?
+ warn "Net::HTTPRequest#body_exist? is obsolete; use response_body_permitted?" if $VERBOSE
+ response_body_permitted?
+ end
+
+ attr_reader :body
+
+ def body=(str)
+ @body = str
+ @body_stream = nil
+ @body_data = nil
+ str
+ end
+
+ attr_reader :body_stream
+
+ def body_stream=(input)
+ @body = nil
+ @body_stream = input
+ @body_data = nil
+ input
+ end
+
+ def set_body_internal(str) #:nodoc: internal use only
+ raise ArgumentError, "both of body argument and HTTPRequest#body set" if str and (@body or @body_stream)
+ self.body = str if str
+ end
+
+ #
+ # write
+ #
+
+ def exec(sock, ver, path) #:nodoc: internal use only
+ if @body
+ send_request_with_body sock, ver, path, @body
+ elsif @body_stream
+ send_request_with_body_stream sock, ver, path, @body_stream
+ elsif @body_data
+ send_request_with_body_data sock, ver, path, @body_data
+ else
+ write_header sock, ver, path
+ end
+ end
+
+ private
+
+ class Chunker #:nodoc:
+ def initialize(sock)
+ @sock = sock
+ @prev = nil
+ end
+
+ def write(buf)
+ # avoid memcpy() of buf, buf can huge and eat memory bandwidth
+ @sock.write("#{buf.bytesize.to_s(16)}\r\n")
+ rv = @sock.write(buf)
+ @sock.write("\r\n")
+ rv
+ end
+
+ def finish
+ @sock.write("0\r\n\r\n")
+ end
+ end
+
+ def send_request_with_body(sock, ver, path, body)
+ self.content_length = body.bytesize
+ delete 'Transfer-Encoding'
+ supply_default_content_type
+ write_header sock, ver, path
+ wait_for_continue sock, ver if sock.continue_timeout
+ sock.write body
+ end
+
+ def send_request_with_body_stream(sock, ver, path, f)
+ unless content_length() or chunked?
+ raise ArgumentError,
+ "Content-Length not given and Transfer-Encoding is not `chunked'"
+ end
+ supply_default_content_type
+ write_header sock, ver, path
+ wait_for_continue sock, ver if sock.continue_timeout
+ if chunked?
+ chunker = Chunker.new(sock)
+ IO.copy_stream(f, chunker)
+ chunker.finish
+ else
+ # copy_stream can sendfile() to sock.io unless we use SSL.
+ # If sock.io is an SSLSocket, copy_stream will hit SSL_write()
+ IO.copy_stream(f, sock.io)
+ end
+ end
+
+ def send_request_with_body_data(sock, ver, path, params)
+ if /\Amultipart\/form-data\z/i !~ self.content_type
+ self.content_type = 'application/x-www-form-urlencoded'
+ return send_request_with_body(sock, ver, path, URI.encode_www_form(params))
+ end
+
+ opt = @form_option.dup
+ require 'securerandom' unless defined?(SecureRandom)
+ opt[:boundary] ||= SecureRandom.urlsafe_base64(40)
+ self.set_content_type(self.content_type, boundary: opt[:boundary])
+ if chunked?
+ write_header sock, ver, path
+ encode_multipart_form_data(sock, params, opt)
+ else
+ require 'tempfile'
+ file = Tempfile.new('multipart')
+ file.binmode
+ encode_multipart_form_data(file, params, opt)
+ file.rewind
+ self.content_length = file.size
+ write_header sock, ver, path
+ IO.copy_stream(file, sock)
+ end
+ end
+
+ def encode_multipart_form_data(out, params, opt)
+ charset = opt[:charset]
+ boundary = opt[:boundary]
+ require 'securerandom' unless defined?(SecureRandom)
+ boundary ||= SecureRandom.urlsafe_base64(40)
+ chunked_p = chunked?
+
+ buf = ''
+ params.each do |key, value, h={}|
+ key = quote_string(key, charset)
+ filename =
+ h.key?(:filename) ? h[:filename] :
+ value.respond_to?(:to_path) ? File.basename(value.to_path) :
+ nil
+
+ buf << "--#{boundary}\r\n"
+ if filename
+ filename = quote_string(filename, charset)
+ type = h[:content_type] || 'application/octet-stream'
+ buf << "Content-Disposition: form-data; " \
+ "name=\"#{key}\"; filename=\"#{filename}\"\r\n" \
+ "Content-Type: #{type}\r\n\r\n"
+ if !out.respond_to?(:write) || !value.respond_to?(:read)
+ # if +out+ is not an IO or +value+ is not an IO
+ buf << (value.respond_to?(:read) ? value.read : value)
+ elsif value.respond_to?(:size) && chunked_p
+ # if +out+ is an IO and +value+ is a File, use IO.copy_stream
+ flush_buffer(out, buf, chunked_p)
+ out << "%x\r\n" % value.size if chunked_p
+ IO.copy_stream(value, out)
+ out << "\r\n" if chunked_p
+ else
+ # +out+ is an IO, and +value+ is not a File but an IO
+ flush_buffer(out, buf, chunked_p)
+ 1 while flush_buffer(out, value.read(4096), chunked_p)
+ end
+ else
+ # non-file field:
+ # HTML5 says, "The parts of the generated multipart/form-data
+ # resource that correspond to non-file fields must not have a
+ # Content-Type header specified."
+ buf << "Content-Disposition: form-data; name=\"#{key}\"\r\n\r\n"
+ buf << (value.respond_to?(:read) ? value.read : value)
+ end
+ buf << "\r\n"
+ end
+ buf << "--#{boundary}--\r\n"
+ flush_buffer(out, buf, chunked_p)
+ out << "0\r\n\r\n" if chunked_p
+ end
+
+ def quote_string(str, charset)
+ str = str.encode(charset, fallback:->(c){'&#%d;'%c.encode("UTF-8").ord}) if charset
+ str = str.gsub(/[\\"]/, '\\\\\&')
+ end
+
+ def flush_buffer(out, buf, chunked_p)
+ return unless buf
+ out << "%x\r\n"%buf.bytesize if chunked_p
+ out << buf
+ out << "\r\n" if chunked_p
+ buf.clear
+ end
+
+ def supply_default_content_type
+ return if content_type()
+ warn 'net/http: warning: Content-Type did not set; using application/x-www-form-urlencoded' if $VERBOSE
+ set_content_type 'application/x-www-form-urlencoded'
+ end
+
+ ##
+ # Waits up to the continue timeout for a response from the server provided
+ # we're speaking HTTP 1.1 and are expecting a 100-continue response.
+
+ def wait_for_continue(sock, ver)
+ if ver >= '1.1' and @header['expect'] and
+ @header['expect'].include?('100-continue')
+ if IO.select([sock.io], nil, nil, sock.continue_timeout)
+ res = Net::HTTPResponse.read_new(sock)
+ unless res.kind_of?(Net::HTTPContinue)
+ throw :response, res
+ end
+ end
+ end
+ end
+
+ def write_header(sock, ver, path)
+ buf = "#{@method} #{path} HTTP/#{ver}\r\n"
+ each_capitalized do |k,v|
+ buf << "#{k}: #{v}\r\n"
+ end
+ buf << "\r\n"
+ sock.write buf
+ end
+
+end
+
diff --git a/lib/net/http/header.rb b/lib/net/http/header.rb
new file mode 100644
index 0000000000..7e46e04395
--- /dev/null
+++ b/lib/net/http/header.rb
@@ -0,0 +1,452 @@
+# The HTTPHeader module defines methods for reading and writing
+# HTTP headers.
+#
+# It is used as a mixin by other classes, to provide hash-like
+# access to HTTP header values. Unlike raw hash access, HTTPHeader
+# provides access via case-insensitive keys. It also provides
+# methods for accessing commonly-used HTTP header values in more
+# convenient formats.
+#
+module Net::HTTPHeader
+
+ def initialize_http_header(initheader)
+ @header = {}
+ return unless initheader
+ initheader.each do |key, value|
+ warn "net/http: warning: duplicated HTTP header: #{key}" if key?(key) and $VERBOSE
+ @header[key.downcase] = [value.strip]
+ end
+ end
+
+ def size #:nodoc: obsolete
+ @header.size
+ end
+
+ alias length size #:nodoc: obsolete
+
+ # Returns the header field corresponding to the case-insensitive key.
+ # For example, a key of "Content-Type" might return "text/html"
+ def [](key)
+ a = @header[key.downcase] or return nil
+ a.join(', ')
+ end
+
+ # Sets the header field corresponding to the case-insensitive key.
+ def []=(key, val)
+ unless val
+ @header.delete key.downcase
+ return val
+ end
+ @header[key.downcase] = [val]
+ end
+
+ # [Ruby 1.8.3]
+ # Adds a value to a named header field, instead of replacing its value.
+ # Second argument +val+ must be a String.
+ # See also #[]=, #[] and #get_fields.
+ #
+ # request.add_field 'X-My-Header', 'a'
+ # p request['X-My-Header'] #=> "a"
+ # p request.get_fields('X-My-Header') #=> ["a"]
+ # request.add_field 'X-My-Header', 'b'
+ # p request['X-My-Header'] #=> "a, b"
+ # p request.get_fields('X-My-Header') #=> ["a", "b"]
+ # request.add_field 'X-My-Header', 'c'
+ # p request['X-My-Header'] #=> "a, b, c"
+ # p request.get_fields('X-My-Header') #=> ["a", "b", "c"]
+ #
+ def add_field(key, val)
+ if @header.key?(key.downcase)
+ @header[key.downcase].push val
+ else
+ @header[key.downcase] = [val]
+ end
+ end
+
+ # [Ruby 1.8.3]
+ # Returns an array of header field strings corresponding to the
+ # case-insensitive +key+. This method allows you to get duplicated
+ # header fields without any processing. See also #[].
+ #
+ # p response.get_fields('Set-Cookie')
+ # #=> ["session=al98axx; expires=Fri, 31-Dec-1999 23:58:23",
+ # "query=rubyscript; expires=Fri, 31-Dec-1999 23:58:23"]
+ # p response['Set-Cookie']
+ # #=> "session=al98axx; expires=Fri, 31-Dec-1999 23:58:23, query=rubyscript; expires=Fri, 31-Dec-1999 23:58:23"
+ #
+ def get_fields(key)
+ return nil unless @header[key.downcase]
+ @header[key.downcase].dup
+ end
+
+ # Returns the header field corresponding to the case-insensitive key.
+ # Returns the default value +args+, or the result of the block, or
+ # raises an IndexError if there's no header field named +key+
+ # See Hash#fetch
+ def fetch(key, *args, &block) #:yield: +key+
+ a = @header.fetch(key.downcase, *args, &block)
+ a.kind_of?(Array) ? a.join(', ') : a
+ end
+
+ # Iterates through the header names and values, passing in the name
+ # and value to the code block supplied.
+ #
+ # Example:
+ #
+ # response.header.each_header {|key,value| puts "#{key} = #{value}" }
+ #
+ def each_header #:yield: +key+, +value+
+ block_given? or return enum_for(__method__)
+ @header.each do |k,va|
+ yield k, va.join(', ')
+ end
+ end
+
+ alias each each_header
+
+ # Iterates through the header names in the header, passing
+ # each header name to the code block.
+ def each_name(&block) #:yield: +key+
+ block_given? or return enum_for(__method__)
+ @header.each_key(&block)
+ end
+
+ alias each_key each_name
+
+ # Iterates through the header names in the header, passing
+ # capitalized header names to the code block.
+ #
+ # Note that header names are capitalized systematically;
+ # capitalization may not match that used by the remote HTTP
+ # server in its response.
+ def each_capitalized_name #:yield: +key+
+ block_given? or return enum_for(__method__)
+ @header.each_key do |k|
+ yield capitalize(k)
+ end
+ end
+
+ # Iterates through header values, passing each value to the
+ # code block.
+ def each_value #:yield: +value+
+ block_given? or return enum_for(__method__)
+ @header.each_value do |va|
+ yield va.join(', ')
+ end
+ end
+
+ # Removes a header field, specified by case-insensitive key.
+ def delete(key)
+ @header.delete(key.downcase)
+ end
+
+ # true if +key+ header exists.
+ def key?(key)
+ @header.key?(key.downcase)
+ end
+
+ # Returns a Hash consisting of header names and values.
+ # e.g.
+ # {"cache-control" => "private",
+ # "content-type" => "text/html",
+ # "date" => "Wed, 22 Jun 2005 22:11:50 GMT"}
+ def to_hash
+ @header.dup
+ end
+
+ # As for #each_header, except the keys are provided in capitalized form.
+ #
+ # Note that header names are capitalized systematically;
+ # capitalization may not match that used by the remote HTTP
+ # server in its response.
+ def each_capitalized
+ block_given? or return enum_for(__method__)
+ @header.each do |k,v|
+ yield capitalize(k), v.join(', ')
+ end
+ end
+
+ alias canonical_each each_capitalized
+
+ def capitalize(name)
+ name.split(/-/).map {|s| s.capitalize }.join('-')
+ end
+ private :capitalize
+
+ # Returns an Array of Range objects which represent the Range:
+ # HTTP header field, or +nil+ if there is no such header.
+ def range
+ return nil unless @header['range']
+
+ value = self['Range']
+ # byte-range-set = *( "," OWS ) ( byte-range-spec / suffix-byte-range-spec )
+ # *( OWS "," [ OWS ( byte-range-spec / suffix-byte-range-spec ) ] )
+ # corrected collected ABNF
+ # http://tools.ietf.org/html/draft-ietf-httpbis-p5-range-19#section-5.4.1
+ # http://tools.ietf.org/html/draft-ietf-httpbis-p5-range-19#appendix-C
+ # http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-19#section-3.2.5
+ unless /\Abytes=((?:,[ \t]*)*(?:\d+-\d*|-\d+)(?:[ \t]*,(?:[ \t]*\d+-\d*|-\d+)?)*)\z/ =~ value
+ raise Net::HTTPHeaderSyntaxError, "invalid syntax for byte-ranges-specifier: '#{value}'"
+ end
+
+ byte_range_set = $1
+ result = byte_range_set.split(/,/).map {|spec|
+ m = /(\d+)?\s*-\s*(\d+)?/i.match(spec) or
+ raise Net::HTTPHeaderSyntaxError, "invalid byte-range-spec: '#{spec}'"
+ d1 = m[1].to_i
+ d2 = m[2].to_i
+ if m[1] and m[2]
+ if d1 > d2
+ raise Net::HTTPHeaderSyntaxError, "last-byte-pos MUST greater than or equal to first-byte-pos but '#{spec}'"
+ end
+ d1..d2
+ elsif m[1]
+ d1..-1
+ elsif m[2]
+ -d2..-1
+ else
+ raise Net::HTTPHeaderSyntaxError, 'range is not specified'
+ end
+ }
+ # if result.empty?
+ # byte-range-set must include at least one byte-range-spec or suffix-byte-range-spec
+ # but above regexp already denies it.
+ if result.size == 1 && result[0].begin == 0 && result[0].end == -1
+ raise Net::HTTPHeaderSyntaxError, 'only one suffix-byte-range-spec with zero suffix-length'
+ end
+ result
+ end
+
+ # Sets the HTTP Range: header.
+ # Accepts either a Range object as a single argument,
+ # or a beginning index and a length from that index.
+ # Example:
+ #
+ # req.range = (0..1023)
+ # req.set_range 0, 1023
+ #
+ def set_range(r, e = nil)
+ unless r
+ @header.delete 'range'
+ return r
+ end
+ r = (r...r+e) if e
+ case r
+ when Numeric
+ n = r.to_i
+ rangestr = (n > 0 ? "0-#{n-1}" : "-#{-n}")
+ when Range
+ first = r.first
+ last = r.last
+ last -= 1 if r.exclude_end?
+ if last == -1
+ rangestr = (first > 0 ? "#{first}-" : "-#{-first}")
+ else
+ raise Net::HTTPHeaderSyntaxError, 'range.first is negative' if first < 0
+ raise Net::HTTPHeaderSyntaxError, 'range.last is negative' if last < 0
+ raise Net::HTTPHeaderSyntaxError, 'must be .first < .last' if first > last
+ rangestr = "#{first}-#{last}"
+ end
+ else
+ raise TypeError, 'Range/Integer is required'
+ end
+ @header['range'] = ["bytes=#{rangestr}"]
+ r
+ end
+
+ alias range= set_range
+
+ # Returns an Integer object which represents the HTTP Content-Length:
+ # header field, or +nil+ if that field was not provided.
+ def content_length
+ return nil unless key?('Content-Length')
+ len = self['Content-Length'].slice(/\d+/) or
+ raise Net::HTTPHeaderSyntaxError, 'wrong Content-Length format'
+ len.to_i
+ end
+
+ def content_length=(len)
+ unless len
+ @header.delete 'content-length'
+ return nil
+ end
+ @header['content-length'] = [len.to_i.to_s]
+ end
+
+ # Returns "true" if the "transfer-encoding" header is present and
+ # set to "chunked". This is an HTTP/1.1 feature, allowing the
+ # the content to be sent in "chunks" without at the outset
+ # stating the entire content length.
+ def chunked?
+ return false unless @header['transfer-encoding']
+ field = self['Transfer-Encoding']
+ (/(?:\A|[^\-\w])chunked(?![\-\w])/i =~ field) ? true : false
+ end
+
+ # Returns a Range object which represents the value of the Content-Range:
+ # header field.
+ # For a partial entity body, this indicates where this fragment
+ # fits inside the full entity body, as range of byte offsets.
+ def content_range
+ return nil unless @header['content-range']
+ m = %r<bytes\s+(\d+)-(\d+)/(\d+|\*)>i.match(self['Content-Range']) or
+ raise Net::HTTPHeaderSyntaxError, 'wrong Content-Range format'
+ m[1].to_i .. m[2].to_i
+ end
+
+ # The length of the range represented in Content-Range: header.
+ def range_length
+ r = content_range() or return nil
+ r.end - r.begin + 1
+ end
+
+ # Returns a content type string such as "text/html".
+ # This method returns nil if Content-Type: header field does not exist.
+ def content_type
+ return nil unless main_type()
+ if sub_type()
+ then "#{main_type()}/#{sub_type()}"
+ else main_type()
+ end
+ end
+
+ # Returns a content type string such as "text".
+ # This method returns nil if Content-Type: header field does not exist.
+ def main_type
+ return nil unless @header['content-type']
+ self['Content-Type'].split(';').first.to_s.split('/')[0].to_s.strip
+ end
+
+ # Returns a content type string such as "html".
+ # This method returns nil if Content-Type: header field does not exist
+ # or sub-type is not given (e.g. "Content-Type: text").
+ def sub_type
+ return nil unless @header['content-type']
+ _, sub = *self['Content-Type'].split(';').first.to_s.split('/')
+ return nil unless sub
+ sub.strip
+ end
+
+ # Any parameters specified for the content type, returned as a Hash.
+ # For example, a header of Content-Type: text/html; charset=EUC-JP
+ # would result in type_params returning {'charset' => 'EUC-JP'}
+ def type_params
+ result = {}
+ list = self['Content-Type'].to_s.split(';')
+ list.shift
+ list.each do |param|
+ k, v = *param.split('=', 2)
+ result[k.strip] = v.strip
+ end
+ result
+ end
+
+ # Sets the content type in an HTTP header.
+ # The +type+ should be a full HTTP content type, e.g. "text/html".
+ # The +params+ are an optional Hash of parameters to add after the
+ # content type, e.g. {'charset' => 'iso-8859-1'}
+ def set_content_type(type, params = {})
+ @header['content-type'] = [type + params.map{|k,v|"; #{k}=#{v}"}.join('')]
+ end
+
+ alias content_type= set_content_type
+
+ # Set header fields and a body from HTML form data.
+ # +params+ should be an Array of Arrays or
+ # a Hash containing HTML form data.
+ # Optional argument +sep+ means data record separator.
+ #
+ # Values are URL encoded as necessary and the content-type is set to
+ # application/x-www-form-urlencoded
+ #
+ # Example:
+ # http.form_data = {"q" => "ruby", "lang" => "en"}
+ # http.form_data = {"q" => ["ruby", "perl"], "lang" => "en"}
+ # http.set_form_data({"q" => "ruby", "lang" => "en"}, ';')
+ #
+ def set_form_data(params, sep = '&')
+ query = URI.encode_www_form(params)
+ query.gsub!(/&/, sep) if sep != '&'
+ self.body = query
+ self.content_type = 'application/x-www-form-urlencoded'
+ end
+
+ alias form_data= set_form_data
+
+ # Set a HTML form data set.
+ # +params+ is the form data set; it is an Array of Arrays or a Hash
+ # +enctype is the type to encode the form data set.
+ # It is application/x-www-form-urlencoded or multipart/form-data.
+ # +formpot+ is an optional hash to specify the detail.
+ #
+ # boundary:: the boundary of the multipart message
+ # charset:: the charset of the message. All names and the values of
+ # non-file fields are encoded as the charset.
+ #
+ # Each item of params is an array and contains following items:
+ # +name+:: the name of the field
+ # +value+:: the value of the field, it should be a String or a File
+ # +opt+:: an optional hash to specify additional information
+ #
+ # Each item is a file field or a normal field.
+ # If +value+ is a File object or the +opt+ have a filename key,
+ # the item is treated as a file field.
+ #
+ # If Transfer-Encoding is set as chunked, this send the request in
+ # chunked encoding. Because chunked encoding is HTTP/1.1 feature,
+ # you must confirm the server to support HTTP/1.1 before sending it.
+ #
+ # Example:
+ # http.set_form([["q", "ruby"], ["lang", "en"]])
+ #
+ # See also RFC 2388, RFC 2616, HTML 4.01, and HTML5
+ #
+ def set_form(params, enctype='application/x-www-form-urlencoded', formopt={})
+ @body_data = params
+ @body = nil
+ @body_stream = nil
+ @form_option = formopt
+ case enctype
+ when /\Aapplication\/x-www-form-urlencoded\z/i,
+ /\Amultipart\/form-data\z/i
+ self.content_type = enctype
+ else
+ raise ArgumentError, "invalid enctype: #{enctype}"
+ end
+ end
+
+ # Set the Authorization: header for "Basic" authorization.
+ def basic_auth(account, password)
+ @header['authorization'] = [basic_encode(account, password)]
+ end
+
+ # Set Proxy-Authorization: header for "Basic" authorization.
+ def proxy_basic_auth(account, password)
+ @header['proxy-authorization'] = [basic_encode(account, password)]
+ end
+
+ def basic_encode(account, password)
+ 'Basic ' + ["#{account}:#{password}"].pack('m').delete("\r\n")
+ end
+ private :basic_encode
+
+ def connection_close?
+ tokens(@header['connection']).include?('close') or
+ tokens(@header['proxy-connection']).include?('close')
+ end
+
+ def connection_keep_alive?
+ tokens(@header['connection']).include?('keep-alive') or
+ tokens(@header['proxy-connection']).include?('keep-alive')
+ end
+
+ def tokens(vals)
+ return [] unless vals
+ vals.map {|v| v.split(',') }.flatten\
+ .reject {|str| str.strip.empty? }\
+ .map {|tok| tok.strip.downcase }
+ end
+ private :tokens
+
+end
+
diff --git a/lib/net/http/proxy_delta.rb b/lib/net/http/proxy_delta.rb
new file mode 100644
index 0000000000..b16c9f1ed8
--- /dev/null
+++ b/lib/net/http/proxy_delta.rb
@@ -0,0 +1,16 @@
+module Net::HTTP::ProxyDelta #:nodoc: internal use only
+ private
+
+ def conn_address
+ proxy_address()
+ end
+
+ def conn_port
+ proxy_port()
+ end
+
+ def edit_path(path)
+ use_ssl? ? path : "http://#{addr_port()}#{path}"
+ end
+end
+
diff --git a/lib/net/http/request.rb b/lib/net/http/request.rb
new file mode 100644
index 0000000000..e8b0f48fcc
--- /dev/null
+++ b/lib/net/http/request.rb
@@ -0,0 +1,20 @@
+# HTTP request class.
+# This class wraps together the request header and the request path.
+# You cannot use this class directly. Instead, you should use one of its
+# subclasses: Net::HTTP::Get, Net::HTTP::Post, Net::HTTP::Head.
+#
+class Net::HTTPRequest < Net::HTTPGenericRequest
+ # Creates an HTTP request object for +path+.
+ #
+ # +initheader+ are the default headers to use. Net::HTTP adds
+ # Accept-Encoding to enable compression of the response body unless
+ # Accept-Encoding or Range are supplied in +initheader+.
+
+ def initialize(path, initheader = nil)
+ super self.class::METHOD,
+ self.class::REQUEST_HAS_BODY,
+ self.class::RESPONSE_HAS_BODY,
+ path, initheader
+ end
+end
+
diff --git a/lib/net/http/requests.rb b/lib/net/http/requests.rb
new file mode 100644
index 0000000000..ef719ea6e7
--- /dev/null
+++ b/lib/net/http/requests.rb
@@ -0,0 +1,122 @@
+#
+# HTTP/1.1 methods --- RFC2616
+#
+
+# See Net::HTTPGenericRequest for attributes and methods.
+# See Net::HTTP for usage examples.
+class Net::HTTP::Get < Net::HTTPRequest
+ METHOD = 'GET'
+ REQUEST_HAS_BODY = false
+ RESPONSE_HAS_BODY = true
+end
+
+# See Net::HTTPGenericRequest for attributes and methods.
+# See Net::HTTP for usage examples.
+class Net::HTTP::Head < Net::HTTPRequest
+ METHOD = 'HEAD'
+ REQUEST_HAS_BODY = false
+ RESPONSE_HAS_BODY = false
+end
+
+# See Net::HTTPGenericRequest for attributes and methods.
+# See Net::HTTP for usage examples.
+class Net::HTTP::Post < Net::HTTPRequest
+ METHOD = 'POST'
+ REQUEST_HAS_BODY = true
+ RESPONSE_HAS_BODY = true
+end
+
+# See Net::HTTPGenericRequest for attributes and methods.
+# See Net::HTTP for usage examples.
+class Net::HTTP::Put < Net::HTTPRequest
+ METHOD = 'PUT'
+ REQUEST_HAS_BODY = true
+ RESPONSE_HAS_BODY = true
+end
+
+# See Net::HTTPGenericRequest for attributes and methods.
+# See Net::HTTP for usage examples.
+class Net::HTTP::Delete < Net::HTTPRequest
+ METHOD = 'DELETE'
+ REQUEST_HAS_BODY = false
+ RESPONSE_HAS_BODY = true
+end
+
+# See Net::HTTPGenericRequest for attributes and methods.
+class Net::HTTP::Options < Net::HTTPRequest
+ METHOD = 'OPTIONS'
+ REQUEST_HAS_BODY = false
+ RESPONSE_HAS_BODY = false
+end
+
+# See Net::HTTPGenericRequest for attributes and methods.
+class Net::HTTP::Trace < Net::HTTPRequest
+ METHOD = 'TRACE'
+ REQUEST_HAS_BODY = false
+ RESPONSE_HAS_BODY = true
+end
+
+#
+# PATCH method --- RFC5789
+#
+
+# See Net::HTTPGenericRequest for attributes and methods.
+class Net::HTTP::Patch < Net::HTTPRequest
+ METHOD = 'PATCH'
+ REQUEST_HAS_BODY = true
+ RESPONSE_HAS_BODY = true
+end
+
+#
+# WebDAV methods --- RFC2518
+#
+
+# See Net::HTTPGenericRequest for attributes and methods.
+class Net::HTTP::Propfind < Net::HTTPRequest
+ METHOD = 'PROPFIND'
+ REQUEST_HAS_BODY = true
+ RESPONSE_HAS_BODY = true
+end
+
+# See Net::HTTPGenericRequest for attributes and methods.
+class Net::HTTP::Proppatch < Net::HTTPRequest
+ METHOD = 'PROPPATCH'
+ REQUEST_HAS_BODY = true
+ RESPONSE_HAS_BODY = true
+end
+
+# See Net::HTTPGenericRequest for attributes and methods.
+class Net::HTTP::Mkcol < Net::HTTPRequest
+ METHOD = 'MKCOL'
+ REQUEST_HAS_BODY = true
+ RESPONSE_HAS_BODY = true
+end
+
+# See Net::HTTPGenericRequest for attributes and methods.
+class Net::HTTP::Copy < Net::HTTPRequest
+ METHOD = 'COPY'
+ REQUEST_HAS_BODY = false
+ RESPONSE_HAS_BODY = true
+end
+
+# See Net::HTTPGenericRequest for attributes and methods.
+class Net::HTTP::Move < Net::HTTPRequest
+ METHOD = 'MOVE'
+ REQUEST_HAS_BODY = false
+ RESPONSE_HAS_BODY = true
+end
+
+# See Net::HTTPGenericRequest for attributes and methods.
+class Net::HTTP::Lock < Net::HTTPRequest
+ METHOD = 'LOCK'
+ REQUEST_HAS_BODY = true
+ RESPONSE_HAS_BODY = true
+end
+
+# See Net::HTTPGenericRequest for attributes and methods.
+class Net::HTTP::Unlock < Net::HTTPRequest
+ METHOD = 'UNLOCK'
+ REQUEST_HAS_BODY = true
+ RESPONSE_HAS_BODY = true
+end
+
diff --git a/lib/net/http/response.rb b/lib/net/http/response.rb
new file mode 100644
index 0000000000..6b044c3d34
--- /dev/null
+++ b/lib/net/http/response.rb
@@ -0,0 +1,390 @@
+# HTTP response class.
+#
+# This class wraps together the response header and the response body (the
+# entity requested).
+#
+# It mixes in the HTTPHeader module, which provides access to response
+# header values both via hash-like methods and via individual readers.
+#
+# Note that each possible HTTP response code defines its own
+# HTTPResponse subclass. These are listed below.
+#
+# All classes are defined under the Net module. Indentation indicates
+# inheritance. For a list of the classes see Net::HTTP.
+#
+#
+class Net::HTTPResponse
+ class << self
+ # true if the response has a body.
+ def body_permitted?
+ self::HAS_BODY
+ end
+
+ def exception_type # :nodoc: internal use only
+ self::EXCEPTION_TYPE
+ end
+
+ def read_new(sock) #:nodoc: internal use only
+ httpv, code, msg = read_status_line(sock)
+ res = response_class(code).new(httpv, code, msg)
+ each_response_header(sock) do |k,v|
+ res.add_field k, v
+ end
+ res
+ end
+
+ private
+
+ def read_status_line(sock)
+ str = sock.readline
+ m = /\AHTTP(?:\/(\d+\.\d+))?\s+(\d\d\d)\s*(.*)\z/in.match(str) or
+ raise Net::HTTPBadResponse, "wrong status line: #{str.dump}"
+ m.captures
+ end
+
+ def response_class(code)
+ CODE_TO_OBJ[code] or
+ CODE_CLASS_TO_OBJ[code[0,1]] or
+ Net::HTTPUnknownResponse
+ end
+
+ def each_response_header(sock)
+ key = value = nil
+ while true
+ line = sock.readuntil("\n", true).sub(/\s+\z/, '')
+ break if line.empty?
+ if line[0] == ?\s or line[0] == ?\t and value
+ value << ' ' unless value.empty?
+ value << line.strip
+ else
+ yield key, value if key
+ key, value = line.strip.split(/\s*:\s*/, 2)
+ raise Net::HTTPBadResponse, 'wrong header line format' if value.nil?
+ end
+ end
+ yield key, value if key
+ end
+ end
+
+ # next is to fix bug in RDoc, where the private inside class << self
+ # spills out.
+ public
+
+ include Net::HTTPHeader
+
+ def initialize(httpv, code, msg) #:nodoc: internal use only
+ @http_version = httpv
+ @code = code
+ @message = msg
+ initialize_http_header nil
+ @body = nil
+ @read = false
+ end
+
+ # The HTTP version supported by the server.
+ attr_reader :http_version
+
+ # The HTTP result code string. For example, '302'. You can also
+ # determine the response type by examining which response subclass
+ # the response object is an instance of.
+ attr_reader :code
+
+ # The HTTP result message sent by the server. For example, 'Not Found'.
+ attr_reader :message
+ alias msg message # :nodoc: obsolete
+
+ def inspect
+ "#<#{self.class} #{@code} #{@message} readbody=#{@read}>"
+ end
+
+ #
+ # response <-> exception relationship
+ #
+
+ def code_type #:nodoc:
+ self.class
+ end
+
+ def error! #:nodoc:
+ raise error_type().new(@code + ' ' + @message.dump, self)
+ end
+
+ def error_type #:nodoc:
+ self.class::EXCEPTION_TYPE
+ end
+
+ # Raises an HTTP error if the response is not 2xx (success).
+ def value
+ error! unless self.kind_of?(Net::HTTPSuccess)
+ end
+
+ #
+ # header (for backward compatibility only; DO NOT USE)
+ #
+
+ def response #:nodoc:
+ warn "#{caller(1)[0]}: warning: Net::HTTPResponse#response is obsolete" if $VERBOSE
+ self
+ end
+
+ def header #:nodoc:
+ warn "#{caller(1)[0]}: warning: Net::HTTPResponse#header is obsolete" if $VERBOSE
+ self
+ end
+
+ def read_header #:nodoc:
+ warn "#{caller(1)[0]}: warning: Net::HTTPResponse#read_header is obsolete" if $VERBOSE
+ self
+ end
+
+ #
+ # body
+ #
+
+ def reading_body(sock, reqmethodallowbody) #:nodoc: internal use only
+ @socket = sock
+ @body_exist = reqmethodallowbody && self.class.body_permitted?
+ begin
+ yield
+ self.body # ensure to read body
+ ensure
+ @socket = nil
+ end
+ end
+
+ # Gets the entity body returned by the remote HTTP server.
+ #
+ # If a block is given, the body is passed to the block, and
+ # the body is provided in fragments, as it is read in from the socket.
+ #
+ # Calling this method a second or subsequent time for the same
+ # HTTPResponse object will return the value already read.
+ #
+ # http.request_get('/index.html') {|res|
+ # puts res.read_body
+ # }
+ #
+ # http.request_get('/index.html') {|res|
+ # p res.read_body.object_id # 538149362
+ # p res.read_body.object_id # 538149362
+ # }
+ #
+ # # using iterator
+ # http.request_get('/index.html') {|res|
+ # res.read_body do |segment|
+ # print segment
+ # end
+ # }
+ #
+ def read_body(dest = nil, &block)
+ if @read
+ raise IOError, "#{self.class}\#read_body called twice" if dest or block
+ return @body
+ end
+ to = procdest(dest, block)
+ stream_check
+ if @body_exist
+ read_body_0 to
+ @body = to
+ else
+ @body = nil
+ end
+ @read = true
+
+ @body
+ end
+
+ # Returns the full entity body.
+ #
+ # Calling this method a second or subsequent time will return the
+ # string already read.
+ #
+ # http.request_get('/index.html') {|res|
+ # puts res.body
+ # }
+ #
+ # http.request_get('/index.html') {|res|
+ # p res.body.object_id # 538149362
+ # p res.body.object_id # 538149362
+ # }
+ #
+ def body
+ read_body()
+ end
+
+ # Because it may be necessary to modify the body, Eg, decompression
+ # this method facilitates that.
+ def body=(value)
+ @body = value
+ end
+
+ alias entity body #:nodoc: obsolete
+
+ private
+
+ ##
+ # Checks for a supported Content-Encoding header and yields an Inflate
+ # wrapper for this response's socket when zlib is present. If the
+ # Content-Encoding is unsupported or zlib is missing the plain socket is
+ # yielded.
+ #
+ # If a Content-Range header is present a plain socket is yielded as the
+ # bytes in the range may not be a complete deflate block.
+
+ def inflater # :nodoc:
+ return yield @socket unless Net::HTTP::HAVE_ZLIB
+ return yield @socket if self['content-range']
+
+ case self['content-encoding']
+ when 'deflate', 'gzip', 'x-gzip' then
+ self.delete 'content-encoding'
+
+ inflate_body_io = Inflater.new(@socket)
+
+ begin
+ yield inflate_body_io
+ ensure
+ inflate_body_io.finish
+ end
+ when 'none', 'identity' then
+ self.delete 'content-encoding'
+
+ yield @socket
+ else
+ yield @socket
+ end
+ end
+
+ def read_body_0(dest)
+ inflater do |inflate_body_io|
+ if chunked?
+ read_chunked dest, inflate_body_io
+ return
+ end
+
+ @socket = inflate_body_io
+
+ clen = content_length()
+ if clen
+ @socket.read clen, dest, true # ignore EOF
+ return
+ end
+ clen = range_length()
+ if clen
+ @socket.read clen, dest
+ return
+ end
+ @socket.read_all dest
+ end
+ end
+
+ ##
+ # read_chunked reads from +@socket+ for chunk-size, chunk-extension, CRLF,
+ # etc. and +chunk_data_io+ for chunk-data which may be deflate or gzip
+ # encoded.
+ #
+ # See RFC 2616 section 3.6.1 for definitions
+
+ def read_chunked(dest, chunk_data_io) # :nodoc:
+ len = nil
+ total = 0
+ while true
+ line = @socket.readline
+ hexlen = line.slice(/[0-9a-fA-F]+/) or
+ raise Net::HTTPBadResponse, "wrong chunk size line: #{line}"
+ len = hexlen.hex
+ break if len == 0
+ begin
+ chunk_data_io.read len, dest
+ ensure
+ total += len
+ @socket.read 2 # \r\n
+ end
+ end
+ until @socket.readline.empty?
+ # none
+ end
+ end
+
+ def stream_check
+ raise IOError, 'attempt to read body out of block' if @socket.closed?
+ end
+
+ def procdest(dest, block)
+ raise ArgumentError, 'both arg and block given for HTTP method' if
+ dest and block
+ if block
+ Net::ReadAdapter.new(block)
+ else
+ dest || ''
+ end
+ end
+
+ ##
+ # Inflater is a wrapper around Net::BufferedIO that transparently inflates
+ # zlib and gzip streams.
+
+ class Inflater # :nodoc:
+
+ ##
+ # Creates a new Inflater wrapping +socket+
+
+ def initialize socket
+ @socket = socket
+ # zlib with automatic gzip detection
+ @inflate = Zlib::Inflate.new(32 + Zlib::MAX_WBITS)
+ end
+
+ ##
+ # Finishes the inflate stream.
+
+ def finish
+ @inflate.finish
+ end
+
+ ##
+ # Returns a Net::ReadAdapter that inflates each read chunk into +dest+.
+ #
+ # This allows a large response body to be inflated without storing the
+ # entire body in memory.
+
+ def inflate_adapter(dest)
+ block = proc do |compressed_chunk|
+ @inflate.inflate(compressed_chunk) do |chunk|
+ dest << chunk
+ end
+ end
+
+ Net::ReadAdapter.new(block)
+ end
+
+ ##
+ # Reads +clen+ bytes from the socket, inflates them, then writes them to
+ # +dest+. +ignore_eof+ is passed down to Net::BufferedIO#read
+ #
+ # Unlike Net::BufferedIO#read, this method returns more than +clen+ bytes.
+ # At this time there is no way for a user of Net::HTTPResponse to read a
+ # specific number of bytes from the HTTP response body, so this internal
+ # API does not return the same number of bytes as were requested.
+ #
+ # See https://bugs.ruby-lang.org/issues/6492 for further discussion.
+
+ def read clen, dest, ignore_eof = false
+ temp_dest = inflate_adapter(dest)
+
+ @socket.read clen, temp_dest, ignore_eof
+ end
+
+ ##
+ # Reads the rest of the socket, inflates it, then writes it to +dest+.
+
+ def read_all dest
+ temp_dest = inflate_adapter(dest)
+
+ @socket.read_all temp_dest
+ end
+
+ end
+
+end
+
diff --git a/lib/net/http/responses.rb b/lib/net/http/responses.rb
new file mode 100644
index 0000000000..38a5da2443
--- /dev/null
+++ b/lib/net/http/responses.rb
@@ -0,0 +1,268 @@
+# :stopdoc:
+class Net::HTTPUnknownResponse < Net::HTTPResponse
+ HAS_BODY = true
+ EXCEPTION_TYPE = Net::HTTPError
+end
+class Net::HTTPInformation < Net::HTTPResponse # 1xx
+ HAS_BODY = false
+ EXCEPTION_TYPE = Net::HTTPError
+end
+class Net::HTTPSuccess < Net::HTTPResponse # 2xx
+ HAS_BODY = true
+ EXCEPTION_TYPE = Net::HTTPError
+end
+class Net::HTTPRedirection < Net::HTTPResponse # 3xx
+ HAS_BODY = true
+ EXCEPTION_TYPE = Net::HTTPRetriableError
+end
+class Net::HTTPClientError < Net::HTTPResponse # 4xx
+ HAS_BODY = true
+ EXCEPTION_TYPE = Net::HTTPServerException # for backward compatibility
+end
+class Net::HTTPServerError < Net::HTTPResponse # 5xx
+ HAS_BODY = true
+ EXCEPTION_TYPE = Net::HTTPFatalError # for backward compatibility
+end
+
+class Net::HTTPContinue < Net::HTTPInformation # 100
+ HAS_BODY = false
+end
+class Net::HTTPSwitchProtocol < Net::HTTPInformation # 101
+ HAS_BODY = false
+end
+# 102 - RFC 2518; removed in RFC 4918
+
+class Net::HTTPOK < Net::HTTPSuccess # 200
+ HAS_BODY = true
+end
+class Net::HTTPCreated < Net::HTTPSuccess # 201
+ HAS_BODY = true
+end
+class Net::HTTPAccepted < Net::HTTPSuccess # 202
+ HAS_BODY = true
+end
+class Net::HTTPNonAuthoritativeInformation < Net::HTTPSuccess # 203
+ HAS_BODY = true
+end
+class Net::HTTPNoContent < Net::HTTPSuccess # 204
+ HAS_BODY = false
+end
+class Net::HTTPResetContent < Net::HTTPSuccess # 205
+ HAS_BODY = false
+end
+class Net::HTTPPartialContent < Net::HTTPSuccess # 206
+ HAS_BODY = true
+end
+class Net::HTTPMultiStatus < Net::HTTPSuccess # 207 - RFC 4918
+ HAS_BODY = true
+end
+# 208 Already Reported - RFC 5842; experimental
+# 226 IM Used - RFC 3229; no famous implementation known
+
+class Net::HTTPMultipleChoices < Net::HTTPRedirection # 300
+ HAS_BODY = true
+end
+Net::HTTPMultipleChoice = Net::HTTPMultipleChoices
+class Net::HTTPMovedPermanently < Net::HTTPRedirection # 301
+ HAS_BODY = true
+end
+class Net::HTTPFound < Net::HTTPRedirection # 302
+ HAS_BODY = true
+end
+Net::HTTPMovedTemporarily = Net::HTTPFound
+class Net::HTTPSeeOther < Net::HTTPRedirection # 303
+ HAS_BODY = true
+end
+class Net::HTTPNotModified < Net::HTTPRedirection # 304
+ HAS_BODY = false
+end
+class Net::HTTPUseProxy < Net::HTTPRedirection # 305
+ HAS_BODY = false
+end
+# 306 Switch Proxy - no longer unused
+class Net::HTTPTemporaryRedirect < Net::HTTPRedirection # 307
+ HAS_BODY = true
+end
+# 308 Permanent Redirect - in draft
+
+class Net::HTTPBadRequest < Net::HTTPClientError # 400
+ HAS_BODY = true
+end
+class Net::HTTPUnauthorized < Net::HTTPClientError # 401
+ HAS_BODY = true
+end
+class Net::HTTPPaymentRequired < Net::HTTPClientError # 402
+ HAS_BODY = true
+end
+class Net::HTTPForbidden < Net::HTTPClientError # 403
+ HAS_BODY = true
+end
+class Net::HTTPNotFound < Net::HTTPClientError # 404
+ HAS_BODY = true
+end
+class Net::HTTPMethodNotAllowed < Net::HTTPClientError # 405
+ HAS_BODY = true
+end
+class Net::HTTPNotAcceptable < Net::HTTPClientError # 406
+ HAS_BODY = true
+end
+class Net::HTTPProxyAuthenticationRequired < Net::HTTPClientError # 407
+ HAS_BODY = true
+end
+class Net::HTTPRequestTimeOut < Net::HTTPClientError # 408
+ HAS_BODY = true
+end
+class Net::HTTPConflict < Net::HTTPClientError # 409
+ HAS_BODY = true
+end
+class Net::HTTPGone < Net::HTTPClientError # 410
+ HAS_BODY = true
+end
+class Net::HTTPLengthRequired < Net::HTTPClientError # 411
+ HAS_BODY = true
+end
+class Net::HTTPPreconditionFailed < Net::HTTPClientError # 412
+ HAS_BODY = true
+end
+class Net::HTTPRequestEntityTooLarge < Net::HTTPClientError # 413
+ HAS_BODY = true
+end
+class Net::HTTPRequestURITooLong < Net::HTTPClientError # 414
+ HAS_BODY = true
+end
+Net::HTTPRequestURITooLarge = Net::HTTPRequestURITooLong
+class Net::HTTPUnsupportedMediaType < Net::HTTPClientError # 415
+ HAS_BODY = true
+end
+class Net::HTTPRequestedRangeNotSatisfiable < Net::HTTPClientError # 416
+ HAS_BODY = true
+end
+class Net::HTTPExpectationFailed < Net::HTTPClientError # 417
+ HAS_BODY = true
+end
+# 418 I'm a teapot - RFC 2324; a joke RFC
+# 420 Enhance Your Calm - Twitter
+class Net::HTTPUnprocessableEntity < Net::HTTPClientError # 422 - RFC 4918
+ HAS_BODY = true
+end
+class Net::HTTPLocked < Net::HTTPClientError # 423 - RFC 4918
+ HAS_BODY = true
+end
+class Net::HTTPFailedDependency < Net::HTTPClientError # 424 - RFC 4918
+ HAS_BODY = true
+end
+# 425 Unordered Collection - existed only in draft
+class Net::HTTPUpgradeRequired < Net::HTTPClientError # 426 - RFC 2817
+ HAS_BODY = true
+end
+class Net::HTTPPreconditionRequired < Net::HTTPClientError # 428 - RFC 6585
+ HAS_BODY = true
+end
+class Net::HTTPTooManyRequests < Net::HTTPClientError # 429 - RFC 6585
+ HAS_BODY = true
+end
+class Net::HTTPRequestHeaderFieldsTooLarge < Net::HTTPClientError # 431 - RFC 6585
+ HAS_BODY = true
+end
+# 444 No Response - Nginx
+# 449 Retry With - Microsoft
+# 450 Blocked by Windows Parental Controls - Microsoft
+# 499 Client Closed Request - Nginx
+
+class Net::HTTPInternalServerError < Net::HTTPServerError # 500
+ HAS_BODY = true
+end
+class Net::HTTPNotImplemented < Net::HTTPServerError # 501
+ HAS_BODY = true
+end
+class Net::HTTPBadGateway < Net::HTTPServerError # 502
+ HAS_BODY = true
+end
+class Net::HTTPServiceUnavailable < Net::HTTPServerError # 503
+ HAS_BODY = true
+end
+class Net::HTTPGatewayTimeOut < Net::HTTPServerError # 504
+ HAS_BODY = true
+end
+class Net::HTTPVersionNotSupported < Net::HTTPServerError # 505
+ HAS_BODY = true
+end
+# 506 Variant Also Negotiates - RFC 2295; experimental
+class Net::HTTPInsufficientStorage < Net::HTTPServerError # 507 - RFC 4918
+ HAS_BODY = true
+end
+# 508 Loop Detected - RFC 5842; experimental
+# 509 Bandwidth Limit Exceeded - Apache bw/limited extension
+# 510 Not Extended - RFC 2774; experimental
+class Net::HTTPNetworkAuthenticationRequired < Net::HTTPServerError # 511 - RFC 6585
+ HAS_BODY = true
+end
+
+class Net::HTTPResponse
+ CODE_CLASS_TO_OBJ = {
+ '1' => Net::HTTPInformation,
+ '2' => Net::HTTPSuccess,
+ '3' => Net::HTTPRedirection,
+ '4' => Net::HTTPClientError,
+ '5' => Net::HTTPServerError
+ }
+ CODE_TO_OBJ = {
+ '100' => Net::HTTPContinue,
+ '101' => Net::HTTPSwitchProtocol,
+
+ '200' => Net::HTTPOK,
+ '201' => Net::HTTPCreated,
+ '202' => Net::HTTPAccepted,
+ '203' => Net::HTTPNonAuthoritativeInformation,
+ '204' => Net::HTTPNoContent,
+ '205' => Net::HTTPResetContent,
+ '206' => Net::HTTPPartialContent,
+ '207' => Net::HTTPMultiStatus,
+
+ '300' => Net::HTTPMultipleChoices,
+ '301' => Net::HTTPMovedPermanently,
+ '302' => Net::HTTPFound,
+ '303' => Net::HTTPSeeOther,
+ '304' => Net::HTTPNotModified,
+ '305' => Net::HTTPUseProxy,
+ '307' => Net::HTTPTemporaryRedirect,
+
+ '400' => Net::HTTPBadRequest,
+ '401' => Net::HTTPUnauthorized,
+ '402' => Net::HTTPPaymentRequired,
+ '403' => Net::HTTPForbidden,
+ '404' => Net::HTTPNotFound,
+ '405' => Net::HTTPMethodNotAllowed,
+ '406' => Net::HTTPNotAcceptable,
+ '407' => Net::HTTPProxyAuthenticationRequired,
+ '408' => Net::HTTPRequestTimeOut,
+ '409' => Net::HTTPConflict,
+ '410' => Net::HTTPGone,
+ '411' => Net::HTTPLengthRequired,
+ '412' => Net::HTTPPreconditionFailed,
+ '413' => Net::HTTPRequestEntityTooLarge,
+ '414' => Net::HTTPRequestURITooLong,
+ '415' => Net::HTTPUnsupportedMediaType,
+ '416' => Net::HTTPRequestedRangeNotSatisfiable,
+ '417' => Net::HTTPExpectationFailed,
+ '422' => Net::HTTPUnprocessableEntity,
+ '423' => Net::HTTPLocked,
+ '424' => Net::HTTPFailedDependency,
+ '426' => Net::HTTPUpgradeRequired,
+ '428' => Net::HTTPPreconditionRequired,
+ '429' => Net::HTTPTooManyRequests,
+ '431' => Net::HTTPRequestHeaderFieldsTooLarge,
+
+ '500' => Net::HTTPInternalServerError,
+ '501' => Net::HTTPNotImplemented,
+ '502' => Net::HTTPBadGateway,
+ '503' => Net::HTTPServiceUnavailable,
+ '504' => Net::HTTPGatewayTimeOut,
+ '505' => Net::HTTPVersionNotSupported,
+ '507' => Net::HTTPInsufficientStorage,
+ '511' => Net::HTTPNetworkAuthenticationRequired,
+ }
+end
+
+# :startdoc:
+
diff --git a/lib/net/imap.rb b/lib/net/imap.rb
index 724bc08e3b..a83f455163 100644
--- a/lib/net/imap.rb
+++ b/lib/net/imap.rb
@@ -200,7 +200,7 @@ module Net
#
class IMAP
include MonitorMixin
- if defined?(OpenSSL)
+ if defined?(OpenSSL::SSL)
include OpenSSL
include SSL
end
@@ -295,6 +295,22 @@ module Net
@@authenticators[auth_type] = authenticator
end
+ # The default port for IMAP connections, port 143
+ def self.default_port
+ return PORT
+ end
+
+ # The default port for IMAPS connections, port 993
+ def self.default_tls_port
+ return SSL_PORT
+ end
+
+ class << self
+ alias default_imap_port default_port
+ alias default_imaps_port default_tls_port
+ alias default_ssl_port default_tls_port
+ end
+
# Disconnects from the server.
def disconnect
begin
@@ -905,10 +921,15 @@ module Net
@idle_done_cond = new_cond
@idle_done_cond.wait
@idle_done_cond = nil
+ if @receiver_thread_terminating
+ raise Net::IMAP::Error, "connection closed"
+ end
ensure
- remove_response_handler(response_handler)
- put_string("DONE#{CRLF}")
- response = get_tagged_response(tag, "IDLE")
+ unless @receiver_thread_terminating
+ remove_response_handler(response_handler)
+ put_string("DONE#{CRLF}")
+ response = get_tagged_response(tag, "IDLE")
+ end
end
end
@@ -934,27 +955,22 @@ module Net
# Net::IMAP does _not_ automatically encode and decode
# mailbox names to and from utf7.
def self.decode_utf7(s)
- return s.gsub(/&(.*?)-/n) {
- if $1.empty?
- "&"
+ return s.gsub(/&([^-]+)?-/n) {
+ if $1
+ ($1.tr(",", "/") + "===").unpack("m")[0].encode(Encoding::UTF_8, Encoding::UTF_16BE)
else
- base64 = $1.tr(",", "/")
- x = base64.length % 4
- if x > 0
- base64.concat("=" * (4 - x))
- end
- base64.unpack("m")[0].unpack("n*").pack("U*")
+ "&"
end
- }.force_encoding("UTF-8")
+ }
end
# Encode a string from UTF-8 format to modified UTF-7.
def self.encode_utf7(s)
- return s.gsub(/(&)|([^\x20-\x7e]+)/u) {
+ return s.gsub(/(&)|[^\x20-\x7e]+/) {
if $1
"&-"
else
- base64 = [$&.unpack("U*").pack("n*")].pack("m")
+ base64 = [$&.encode(Encoding::UTF_16BE)].pack("m")
"&" + base64.delete("=\n").tr("/", ",") + "-"
end
}.force_encoding("ASCII-8BIT")
@@ -980,7 +996,7 @@ module Net
@@authenticators = {}
@@max_flag_count = 10000
- # call-seq:
+ # :call-seq:
# Net::IMAP.new(host, options = {})
#
# Creates a new Net::IMAP object and connects it to the specified
@@ -1044,6 +1060,10 @@ module Net
@exception = nil
@greeting = get_response
+ if @greeting.nil?
+ @sock.close
+ raise Error, "connection closed"
+ end
if @greeting.name == "BYE"
@sock.close
raise ByeResponseError, @greeting
@@ -1056,6 +1076,7 @@ module Net
rescue Exception
end
}
+ @receiver_thread_terminating = false
end
def receive_responses
@@ -1115,8 +1136,12 @@ module Net
end
end
synchronize do
+ @receiver_thread_terminating = true
@tagged_response_arrival.broadcast
@continuation_request_arrival.broadcast
+ if @idle_done_cond
+ @idle_done_cond.signal
+ end
end
end
@@ -1408,7 +1433,7 @@ module Net
end
def start_tls_session(params = {})
- unless defined?(OpenSSL)
+ unless defined?(OpenSSL::SSL)
raise "SSL extension not installed"
end
if @sock.kind_of?(OpenSSL::SSL::SSLSocket)
@@ -1947,6 +1972,26 @@ module Net
end
end
+ # Net::IMAP::BodyTypeAttachment represents attachment body structures
+ # of messages.
+ #
+ # ==== Fields:
+ #
+ # media_type:: Returns the content media type name.
+ #
+ # subtype:: Returns +nil+.
+ #
+ # param:: Returns a hash that represents parameters.
+ #
+ # multipart?:: Returns false.
+ #
+ class BodyTypeAttachment < Struct.new(:media_type, :subtype,
+ :param)
+ def multipart?
+ return false
+ end
+ end
+
# Net::IMAP::BodyTypeMultipart represents multipart body structures
# of messages.
#
@@ -1988,6 +2033,14 @@ module Net
end
end
+ class BodyTypeExtension < Struct.new(:media_type, :subtype,
+ :params, :content_id,
+ :description, :encoding, :size)
+ def multipart?
+ return false
+ end
+ end
+
class ResponseParser # :nodoc:
def initialize
@str = nil
@@ -2154,12 +2207,12 @@ module Net
when "FETCH"
shift_token
match(T_SPACE)
- data = FetchData.new(n, msg_att)
+ data = FetchData.new(n, msg_att(n))
return UntaggedResponse.new(name, data, @str)
end
end
- def msg_att
+ def msg_att(n)
match(T_LPAR)
attr = {}
while true
@@ -2170,7 +2223,7 @@ module Net
break
when T_SPACE
shift_token
- token = lookahead
+ next
end
case token.value
when /\A(?:ENVELOPE)\z/ni
@@ -2188,7 +2241,7 @@ module Net
when /\A(?:UID)\z/ni
name, val = uid_data
else
- parse_error("unknown attribute `%s'", token.value)
+ parse_error("unknown attribute `%s' for {%d}", token.value, n)
end
attr[name] = val
end
@@ -2255,6 +2308,11 @@ module Net
def rfc822_text
token = match(T_ATOM)
name = token.value.upcase
+ token = lookahead
+ if token.symbol == T_LBRA
+ shift_token
+ match(T_RBRA)
+ end
match(T_SPACE)
return name, nstring
end
@@ -2312,6 +2370,8 @@ module Net
return body_type_text
when /\A(?:MESSAGE)\z/ni
return body_type_msg
+ when /\A(?:ATTACHMENT)\z/ni
+ return body_type_attachment
else
return body_type_basic
end
@@ -2350,6 +2410,30 @@ module Net
mtype, msubtype = media_type
match(T_SPACE)
param, content_id, desc, enc, size = body_fields
+
+ # If this is not message/rfc822, we shouldn't apply the RFC822 spec
+ # to it.
+ # We should handle anything other than message/rfc822 using
+ # multipart extension data [rfc3501] (i.e. the data itself won't be
+ # returned, we would have to retrieve it with BODYSTRUCTURE instead
+ # of with BODY
+ if "#{mtype}/#{msubtype}" != 'MESSAGE/RFC822' then
+ return BodyTypeExtension.new(mtype, msubtype,
+ param, content_id,
+ desc, enc, size)
+ end
+
+ # Also, sometimes a message/rfc822 is included as a large
+ # attachment instead of having all of the other details
+ # (e.g. attaching a .eml file to an email)
+
+ token = lookahead
+ if token.symbol == T_RPAR then
+ return BodyTypeMessage.new(mtype, msubtype, param, content_id,
+ desc, enc, size, nil, nil, nil, nil,
+ nil, nil, nil)
+ end
+
match(T_SPACE)
env = envelope
match(T_SPACE)
@@ -2364,6 +2448,13 @@ module Net
md5, disposition, language, extension)
end
+ def body_type_attachment
+ mtype = case_insensitive_string
+ match(T_SPACE)
+ param = body_fld_param
+ return BodyTypeAttachment.new(mtype, nil, param)
+ end
+
def body_type_mpart
parts = []
while true
@@ -2384,6 +2475,10 @@ module Net
def media_type
mtype = case_insensitive_string
+ token = lookahead
+ if token.symbol != T_SPACE
+ return mtype, nil
+ end
match(T_SPACE)
msubtype = case_insensitive_string
return mtype, msubtype
diff --git a/lib/net/pop.rb b/lib/net/pop.rb
index 7e14246d16..fd869b6985 100644
--- a/lib/net/pop.rb
+++ b/lib/net/pop.rb
@@ -326,7 +326,7 @@ module Net
@ssl_params = nil
- # call-seq:
+ # :call-seq:
# Net::POP.enable_ssl(params = {})
#
# Enable SSL for all new instances.
@@ -375,7 +375,7 @@ module Net
return @ssl_params[:verify_mode]
end
- # returns the :ca_file or :ca_path from POP3.ssh_params
+ # returns the :ca_file or :ca_path from POP3.ssl_params
def POP3.certs
return @ssl_params[:ca_file] || @ssl_params[:ca_path]
end
@@ -444,7 +444,7 @@ module Net
return !@ssl_params.nil?
end
- # call-seq:
+ # :call-seq:
# Net::POP#enable_ssl(params = {})
#
# Enables SSL for this instance. Must be called before the connection is
@@ -498,12 +498,12 @@ module Net
# Seconds to wait until a connection is opened.
# If the POP3 object cannot open a connection within this time,
- # it raises a TimeoutError exception.
+ # it raises a Net::OpenTimeout exception.
attr_accessor :open_timeout
# Seconds to wait until reading one block (by one read(1) call).
# If the POP3 object cannot complete a read() within this time,
- # it raises a TimeoutError exception.
+ # it raises a Net::ReadTimeout exception.
attr_reader :read_timeout
# Set the read timeout.
@@ -542,7 +542,9 @@ module Net
# internal method for Net::POP3.start
def do_start(account, password) # :nodoc:
- s = timeout(@open_timeout) { TCPSocket.open(@address, port) }
+ s = Timeout.timeout(@open_timeout, Net::OpenTimeout) do
+ TCPSocket.open(@address, port)
+ end
if use_ssl?
raise 'openssl library not installed' unless defined?(OpenSSL)
context = OpenSSL::SSL::SSLContext.new
diff --git a/lib/net/protocol.rb b/lib/net/protocol.rb
index ab0e70e609..14a68e1115 100644
--- a/lib/net/protocol.rb
+++ b/lib/net/protocol.rb
@@ -45,6 +45,18 @@ module Net # :nodoc:
class ProtoRetriableError < ProtocolError; end
ProtocRetryError = ProtoRetriableError
+ ##
+ # OpenTimeout, a subclass of Timeout::Error, is raised if a connection cannot
+ # be created within the open_timeout.
+
+ class OpenTimeout < Timeout::Error; end
+
+ ##
+ # ReadTimeout, a subclass of Timeout::Error, is raised if a chunk of the
+ # response cannot be read within the read_timeout.
+
+ class ReadTimeout < Timeout::Error; end
+
class BufferedIO #:nodoc: internal use only
def initialize(io)
@@ -143,7 +155,7 @@ module Net # :nodoc:
if IO.select([@io], nil, nil, @read_timeout)
retry
else
- raise Timeout::Error
+ raise Net::ReadTimeout
end
rescue IO::WaitWritable
# OpenSSL::Buffering#read_nonblock may fail with IO::WaitWritable.
@@ -151,7 +163,7 @@ module Net # :nodoc:
if IO.select(nil, [@io], nil, @read_timeout)
retry
else
- raise Timeout::Error
+ raise Net::ReadTimeout
end
end
end
@@ -310,7 +322,7 @@ module Net # :nodoc:
def each_crlf_line(src)
buffer_filling(@wbuf, src) do
- while line = @wbuf.slice!(/\A.*(?:\n|\r\n|\r(?!\z))/n)
+ while line = @wbuf.slice!(/\A[^\r\n]*(?:\n|\r(?:\n|(?!\z)))/)
yield line.chomp("\n") + "\r\n"
end
end
diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb
index 33b88f5c21..27d4557c0e 100644
--- a/lib/net/smtp.rb
+++ b/lib/net/smtp.rb
@@ -364,12 +364,12 @@ module Net
# Seconds to wait while attempting to open a connection.
# If the connection cannot be opened within this time, a
- # TimeoutError is raised.
+ # Net::OpenTimeout is raised.
attr_accessor :open_timeout
# Seconds to wait while reading one block (by one read(2) call).
# If the read(2) call does not complete within this time, a
- # TimeoutError is raised.
+ # Net::ReadTimeout is raised.
attr_reader :read_timeout
# Set the number of seconds to wait until timing-out a read(2)
@@ -448,8 +448,9 @@ module Net
# * Net::SMTPSyntaxError
# * Net::SMTPFatalError
# * Net::SMTPUnknownError
+ # * Net::OpenTimeout
+ # * Net::ReadTimeout
# * IOError
- # * TimeoutError
#
def SMTP.start(address, port = nil, helo = 'localhost',
user = nil, secret = nil, authtype = nil,
@@ -509,8 +510,9 @@ module Net
# * Net::SMTPSyntaxError
# * Net::SMTPFatalError
# * Net::SMTPUnknownError
+ # * Net::OpenTimeout
+ # * Net::ReadTimeout
# * IOError
- # * TimeoutError
#
def start(helo = 'localhost',
user = nil, secret = nil, authtype = nil) # :yield: smtp
@@ -546,7 +548,9 @@ module Net
check_auth_method(authtype || DEFAULT_AUTH_TYPE)
check_auth_args user, secret
end
- s = timeout(@open_timeout) { tcp_socket(@address, @port) }
+ s = Timeout.timeout(@open_timeout, Net::OpenTimeout) do
+ tcp_socket(@address, @port)
+ end
logging "Connection opened: #{@address}:#{@port}"
@socket = new_internet_message_io(tls? ? tlsconnect(s) : s)
check_response critical { recv_response() }
@@ -651,8 +655,8 @@ module Net
# * Net::SMTPSyntaxError
# * Net::SMTPFatalError
# * Net::SMTPUnknownError
+ # * Net::ReadTimeout
# * IOError
- # * TimeoutError
#
def send_message(msgstr, from_addr, *to_addrs)
raise IOError, 'closed session' unless @socket
@@ -704,8 +708,8 @@ module Net
# * Net::SMTPSyntaxError
# * Net::SMTPFatalError
# * Net::SMTPUnknownError
+ # * Net::ReadTimeout
# * IOError
- # * TimeoutError
#
def open_message_stream(from_addr, *to_addrs, &block) # :yield: stream
raise IOError, 'closed session' unless @socket
@@ -933,7 +937,7 @@ module Net
Response.parse(buf)
end
- def critical(&block)
+ def critical
return '200 dummy reply code' if @error_occured
begin
return yield()
@@ -951,7 +955,7 @@ module Net
def check_continue(res)
unless res.continue?
- raise SMTPUnknownError, "could not get 3xx (#{res.status})"
+ raise SMTPUnknownError, "could not get 3xx (#{res.status}: #{res.string})"
end
end
diff --git a/lib/net/telnet.rb b/lib/net/telnet.rb
index fe463c63dc..3c5d6e8e73 100644
--- a/lib/net/telnet.rb
+++ b/lib/net/telnet.rb
@@ -9,8 +9,7 @@
# For documentation, see Net::Telnet.
#
-require "socket"
-require "timeout"
+require "net/protocol"
require "English"
module Net
@@ -244,15 +243,15 @@ module Net
#
# Timeout:: the number of seconds to wait before timing out both the
# initial attempt to connect to host (in this constructor),
- # and all attempts to read data from the host (in #waitfor(),
- # #cmd(), and #login()). Exceeding this timeout causes a
- # TimeoutError to be raised. The default value is 10 seconds.
+ # which raises a Net::OpenTimeout, and all attempts to read data
+ # from the host, which raises a Net::ReadTimeout (in #waitfor(),
+ # #cmd(), and #login()). The default value is 10 seconds.
# You can disable the timeout by setting this value to false.
# In this case, the connect attempt will eventually timeout
# on the underlying connect(2) socket call with an
# Errno::ETIMEDOUT error (but generally only after a few
# minutes), but other attempts to read data from the host
- # will hand indefinitely if no data is forthcoming.
+ # will hang indefinitely if no data is forthcoming.
#
# Waittime:: the amount of time to wait after seeing what looks like a
# prompt (that is, received data that matches the Prompt
@@ -347,12 +346,12 @@ module Net
if @options["Timeout"] == false
@sock = TCPSocket.open(@options["Host"], @options["Port"])
else
- timeout(@options["Timeout"]) do
+ Timeout.timeout(@options["Timeout"], Net::OpenTimeout) do
@sock = TCPSocket.open(@options["Host"], @options["Port"])
end
end
- rescue TimeoutError
- raise TimeoutError, "timed out while opening a connection to the host"
+ rescue Net::OpenTimeout
+ raise Net::OpenTimeout, "timed out while opening a connection to the host"
rescue
@log.write($ERROR_INFO.to_s + "\n") if @options.has_key?("Output_log")
@dumplog.log_dump('#', $ERROR_INFO.to_s + "\n") if @options.has_key?("Dump_log")
@@ -508,7 +507,7 @@ module Net
# into a regular expression. Used only if Match and
# Prompt are not specified.
# Timeout:: the number of seconds to wait for data from the host
- # before raising a TimeoutError. If set to false,
+ # before raising a Timeout::Error. If set to false,
# no timeout will occur. If not specified, the
# Timeout option value specified when this instance
# was created will be used, or, failing that, the
@@ -555,7 +554,7 @@ module Net
rest = ''
until(prompt === line and not IO::select([@sock], nil, nil, waittime))
unless IO::select([@sock], nil, nil, time_out)
- raise TimeoutError, "timed out while waiting for more data"
+ raise Net::ReadTimeout, "timed out while waiting for more data"
end
begin
c = @sock.readpartial(1024 * 1024)
diff --git a/lib/observer.rb b/lib/observer.rb
index a5d0dc0f4e..208d8ed6ed 100644
--- a/lib/observer.rb
+++ b/lib/observer.rb
@@ -1,7 +1,7 @@
#
# Implementation of the _Observer_ object-oriented design pattern. The
# following documentation is copied, with modifications, from "Programming
-# Ruby", by Hunt and Thomas; http://www.rubycentral.com/book/lib_patterns.html.
+# Ruby", by Hunt and Thomas; http://www.ruby-doc.org/docs/ProgrammingRuby/html/lib_patterns.html.
#
# See Observable for more info.
@@ -184,7 +184,7 @@ module Observable
# Notify observers of a change in state *if* this object's changed state is
# +true+.
#
- # This will invoke the method named in #add_observer, pasing <tt>*arg</tt>.
+ # This will invoke the method named in #add_observer, passing <tt>*arg</tt>.
# The changed state is then set to +false+.
#
# <tt>*arg</tt>:: Any arguments to pass to the observers.
diff --git a/lib/open-uri.rb b/lib/open-uri.rb
index 4de5c43462..47a9b90fd0 100644
--- a/lib/open-uri.rb
+++ b/lib/open-uri.rb
@@ -9,21 +9,22 @@ module Kernel
alias open_uri_original_open open # :nodoc:
end
- # makes possible to open various resources including URIs.
- # If the first argument respond to `open' method,
- # the method is called with the rest arguments.
+ # Allows the opening of various resources including URIs.
#
- # If the first argument is a string which begins with xxx://,
- # it is parsed by URI.parse. If the parsed object respond to `open' method,
- # the method is called with the rest arguments.
+ # If the first argument responds to the 'open' method, 'open' is called on
+ # it with the rest of the arguments.
#
- # Otherwise original open is called.
+ # If the first argument is a string that begins with xxx://, it is parsed by
+ # URI.parse. If the parsed object responds to the 'open' method,
+ # 'open' is called on it with the rest of the arguments.
#
- # Since open-uri.rb provides URI::HTTP#open, URI::HTTPS#open and
- # URI::FTP#open,
- # Kernel[#.]open can accepts such URIs and strings which begins with
- # http://, https:// and ftp://.
- # In these case, the opened file object is extended by OpenURI::Meta.
+ # Otherwise, the original Kernel#open is called.
+ #
+ # OpenURI::OpenRead#open provides URI::HTTP#open, URI::HTTPS#open and
+ # URI::FTP#open, Kernel#open.
+ #
+ # We can accept URIs and strings that begin with http://, https:// and
+ # ftp://. In these cases, the opened file object is extended by OpenURI::Meta.
def open(name, *rest, &block) # :doc:
if name.respond_to?(:open)
name.open(*rest, &block)
@@ -38,18 +39,18 @@ module Kernel
module_function :open
end
-# OpenURI is an easy-to-use wrapper for net/http, net/https and net/ftp.
+# OpenURI is an easy-to-use wrapper for Net::HTTP, Net::HTTPS and Net::FTP.
#
-#== Example
+# == Example
#
-# It is possible to open http/https/ftp URL as usual like opening a file:
+# It is possible to open an http, https or ftp URL as though it were a file:
#
# open("http://www.ruby-lang.org/") {|f|
# f.each_line {|line| p line}
# }
#
-# The opened file has several methods for meta information as follows since
-# it is extended by OpenURI::Meta.
+# The opened file has several getter methods for its meta-information, as
+# follows, since it is extended by OpenURI::Meta.
#
# open("http://www.ruby-lang.org/en") {|f|
# f.each_line {|line| p line}
@@ -70,12 +71,14 @@ end
# }
#
# The environment variables such as http_proxy, https_proxy and ftp_proxy
-# are in effect by default. :proxy => nil disables proxy.
+# are in effect by default. Here we disable proxy:
#
# open("http://www.ruby-lang.org/en/raa.html", :proxy => nil) {|f|
# # ...
# }
#
+# See OpenURI::OpenRead.open and Kernel#open for more on available options.
+#
# URI objects can be opened in a similar way.
#
# uri = URI.parse("http://www.ruby-lang.org/en/")
@@ -149,7 +152,11 @@ module OpenURI
begin
yield io
ensure
- io.close
+ if io.respond_to? :close!
+ io.close! # Tempfile
+ else
+ io.close
+ end
end
else
io
@@ -355,6 +362,8 @@ module OpenURI
attr_reader :io
end
+ # Raised on redirection,
+ # only occurs when +redirect+ option for HTTP is +false+.
class HTTPRedirect < HTTPError
def initialize(message, io, uri)
super(message, io)
@@ -363,7 +372,7 @@ module OpenURI
attr_reader :uri
end
- class Buffer # :nodoc:
+ class Buffer # :nodoc: all
def initialize
@io = StringIO.new
@size = 0
@@ -407,14 +416,14 @@ module OpenURI
end
end
- # returns an Array which consists status code and message.
+ # returns an Array that consists of status code and message.
attr_accessor :status
- # returns a URI which is base of relative URIs in the data.
- # It may differ from the URI supplied by a user because redirection.
+ # returns a URI that is the base of relative URIs in the data.
+ # It may differ from the URI supplied by a user due to redirection.
attr_accessor :base_uri
- # returns a Hash which represents header fields.
+ # returns a Hash that represents header fields.
# The Hash keys are downcased for canonicalization.
attr_reader :meta
@@ -443,7 +452,7 @@ module OpenURI
meta_setup_encoding if name == 'content-type'
end
- # returns a Time which represents Last-Modified field.
+ # returns a Time that represents the Last-Modified field.
def last_modified
if v = @meta['last-modified']
Time.httpdate(v)
@@ -452,10 +461,12 @@ module OpenURI
end
end
+ # :stopdoc:
RE_LWS = /[\r\n\t ]+/n
RE_TOKEN = %r{[^\x00- ()<>@,;:\\"/\[\]?={}\x7f]+}n
RE_QUOTED_STRING = %r{"(?:[\r\n\t !#-\[\]-~\x80-\xff]|\\[\x00-\x7f])*"}n
RE_PARAMETERS = %r{(?:;#{RE_LWS}?#{RE_TOKEN}#{RE_LWS}?=#{RE_LWS}?(?:#{RE_TOKEN}|#{RE_QUOTED_STRING})#{RE_LWS}?)*}n
+ # :startdoc:
def content_type_parse # :nodoc:
v = @meta['content-type']
@@ -526,22 +537,25 @@ module OpenURI
# OpenURI::OpenRead#open provides `open' for URI::HTTP and URI::FTP.
#
# OpenURI::OpenRead#open takes optional 3 arguments as:
- # OpenURI::OpenRead#open([mode [, perm]] [, options]) [{|io| ... }]
#
- # `mode', `perm' is same as Kernel#open.
+ # OpenURI::OpenRead#open([mode [, perm]] [, options]) [{|io| ... }]
+ #
+ # OpenURI::OpenRead#open returns an IO-like object if block is not given.
+ # Otherwise it yields the IO object and return the value of the block.
+ # The IO object is extended with OpenURI::Meta.
+ #
+ # +mode+ and +perm+ are the same as Kernel#open.
#
- # However, `mode' must be read mode because OpenURI::OpenRead#open doesn't
+ # However, +mode+ must be read mode because OpenURI::OpenRead#open doesn't
# support write mode (yet).
- # Also `perm' is just ignored because it is meaningful only for file
- # creation.
+ # Also +perm+ is ignored because it is meaningful only for file creation.
#
- # `options' must be a hash.
+ # +options+ must be a hash.
#
- # Each pairs which key is a string in the hash specify a extra header
- # field for HTTP.
- # I.e. it is ignored for FTP without HTTP proxy.
+ # Each option with a string key specifies an extra header field for HTTP.
+ # I.e., it is ignored for FTP without HTTP proxy.
#
- # The hash may include other options which key is a symbol:
+ # The hash may include other options, where keys are symbols:
#
# [:proxy]
# Synopsis:
@@ -553,22 +567,28 @@ module OpenURI
#
# If :proxy option is specified, the value should be String, URI,
# boolean or nil.
+ #
# When String or URI is given, it is treated as proxy URI.
+ #
# When true is given or the option itself is not specified,
# environment variable `scheme_proxy' is examined.
# `scheme' is replaced by `http', `https' or `ftp'.
+ #
# When false or nil is given, the environment variables are ignored and
# connection will be made to a server directly.
#
# [:proxy_http_basic_authentication]
# Synopsis:
- # :proxy_http_basic_authentication => ["http://proxy.foo.com:8000/", "proxy-user", "proxy-password"]
- # :proxy_http_basic_authentication => [URI.parse("http://proxy.foo.com:8000/"), "proxy-user", "proxy-password"]
+ # :proxy_http_basic_authentication =>
+ # ["http://proxy.foo.com:8000/", "proxy-user", "proxy-password"]
+ # :proxy_http_basic_authentication =>
+ # [URI.parse("http://proxy.foo.com:8000/"),
+ # "proxy-user", "proxy-password"]
#
- # If :proxy option is specified, the value should be an Array with 3 elements.
- # It should contain a proxy URI, a proxy user name and a proxy password.
- # The proxy URI should be a String, an URI or nil.
- # The proxy user name and password should be a String.
+ # If :proxy option is specified, the value should be an Array with 3
+ # elements. It should contain a proxy URI, a proxy user name and a proxy
+ # password. The proxy URI should be a String, an URI or nil. The proxy
+ # user name and password should be a String.
#
# If nil is given for the proxy URI, this option is just ignored.
#
@@ -590,14 +610,13 @@ module OpenURI
#
# If :content_length_proc option is specified, the option value procedure
# is called before actual transfer is started.
- # It takes one argument which is expected content length in bytes.
+ # It takes one argument, which is expected content length in bytes.
#
# If two or more transfer is done by HTTP redirection, the procedure
# is called only one for a last transfer.
#
# When expected content length is unknown, the procedure is called with
- # nil.
- # It is happen when HTTP response has no Content-Length header.
+ # nil. This happens when the HTTP response has no Content-Length header.
#
# [:progress_proc]
# Synopsis:
@@ -605,7 +624,7 @@ module OpenURI
#
# If :progress_proc option is specified, the proc is called with one
# argument each time when `open' gets content fragment from network.
- # The argument `size' `size' is a accumulated transferred size in bytes.
+ # The argument +size+ is the accumulated transferred size in bytes.
#
# If two or more transfer is done by HTTP redirection, the procedure
# is called only one for a last transfer.
@@ -646,26 +665,24 @@ module OpenURI
#
# :ssl_verify_mode is used to specify openssl verify mode.
#
- # OpenURI::OpenRead#open returns an IO like object if block is not given.
- # Otherwise it yields the IO object and return the value of the block.
- # The IO object is extended with OpenURI::Meta.
- #
# [:ftp_active_mode]
# Synopsis:
# :ftp_active_mode=>bool
#
- # :ftp_active_mode=>true is used to make ftp active mode.
- # Note that the active mode is default in Ruby 1.8 or prior.
- # Ruby 1.9 uses passive mode by default.
+ # <tt>:ftp_active_mode => true</tt> is used to make ftp active mode.
+ # Ruby 1.9 uses passive mode by default.
+ # Note that the active mode is default in Ruby 1.8 or prior.
#
# [:redirect]
# Synopsis:
# :redirect=>bool
#
- # :redirect=>false is used to disable HTTP redirects at all.
- # OpenURI::HTTPRedirect exception raised on redirection.
- # It is true by default.
- # The true means redirections between http and ftp is permitted.
+ # +:redirect+ is true by default. <tt>:redirect => false</tt> is used to
+ # disable all HTTP redirects.
+ #
+ # OpenURI::HTTPRedirect exception raised on redirection.
+ # Using +true+ also means that redirections between http and ftp are
+ # permitted.
#
def open(*rest, &block)
OpenURI.open_uri(self, *rest, &block)
@@ -674,7 +691,7 @@ module OpenURI
# OpenURI::OpenRead#read([options]) reads a content referenced by self and
# returns the content as string.
# The string is extended with OpenURI::Meta.
- # The argument `options' is same as OpenURI::OpenRead#open.
+ # The argument +options+ is same as OpenURI::OpenRead#open.
def read(options={})
self.open(options) {|f|
str = f.read
@@ -686,84 +703,6 @@ module OpenURI
end
module URI
- class Generic
- # returns a proxy URI.
- # The proxy URI is obtained from environment variables such as http_proxy,
- # ftp_proxy, no_proxy, etc.
- # If there is no proper proxy, nil is returned.
- #
- # Note that capitalized variables (HTTP_PROXY, FTP_PROXY, NO_PROXY, etc.)
- # are examined too.
- #
- # But http_proxy and HTTP_PROXY is treated specially under CGI environment.
- # It's because HTTP_PROXY may be set by Proxy: header.
- # So HTTP_PROXY is not used.
- # http_proxy is not used too if the variable is case insensitive.
- # CGI_HTTP_PROXY can be used instead.
- def find_proxy
- name = self.scheme.downcase + '_proxy'
- proxy_uri = nil
- if name == 'http_proxy' && ENV.include?('REQUEST_METHOD') # CGI?
- # HTTP_PROXY conflicts with *_proxy for proxy settings and
- # HTTP_* for header information in CGI.
- # So it should be careful to use it.
- pairs = ENV.reject {|k, v| /\Ahttp_proxy\z/i !~ k }
- case pairs.length
- when 0 # no proxy setting anyway.
- proxy_uri = nil
- when 1
- k, _ = pairs.shift
- if k == 'http_proxy' && ENV[k.upcase] == nil
- # http_proxy is safe to use because ENV is case sensitive.
- proxy_uri = ENV[name]
- else
- proxy_uri = nil
- end
- else # http_proxy is safe to use because ENV is case sensitive.
- proxy_uri = ENV.to_hash[name]
- end
- if !proxy_uri
- # Use CGI_HTTP_PROXY. cf. libwww-perl.
- proxy_uri = ENV["CGI_#{name.upcase}"]
- end
- elsif name == 'http_proxy'
- unless proxy_uri = ENV[name]
- if proxy_uri = ENV[name.upcase]
- warn 'The environment variable HTTP_PROXY is discouraged. Use http_proxy.'
- end
- end
- else
- proxy_uri = ENV[name] || ENV[name.upcase]
- end
-
- if proxy_uri && self.hostname
- require 'socket'
- begin
- addr = IPSocket.getaddress(self.hostname)
- proxy_uri = nil if /\A127\.|\A::1\z/ =~ addr
- rescue SocketError
- end
- end
-
- if proxy_uri
- proxy_uri = URI.parse(proxy_uri)
- name = 'no_proxy'
- if no_proxy = ENV[name] || ENV[name.upcase]
- no_proxy.scan(/([^:,]*)(?::(\d+))?/) {|host, port|
- if /(\A|\.)#{Regexp.quote host}\z/i =~ self.host &&
- (!port || self.port == port.to_i)
- proxy_uri = nil
- break
- end
- }
- end
- proxy_uri
- else
- nil
- end
- end
- end
-
class HTTP
def buffer_open(buf, proxy, options) # :nodoc:
OpenURI.open_http(buf, self, proxy, options)
diff --git a/lib/open3.rb b/lib/open3.rb
index 03a7937c09..36211f042c 100644
--- a/lib/open3.rb
+++ b/lib/open3.rb
@@ -23,7 +23,7 @@
# - Open3.pipeline_rw : pipes for first stdin and last stdout of a pipeline
# - Open3.pipeline_r : pipe for last stdout of a pipeline
# - Open3.pipeline_w : pipe for first stdin of a pipeline
-# - Open3.pipeline_start : a pipeline
+# - Open3.pipeline_start : run a pipeline and don't wait
# - Open3.pipeline : run a pipline and wait
#
@@ -55,9 +55,9 @@ module Open3
# The parameters +cmd...+ is passed to Process.spawn.
# So a commandline string and list of argument strings can be accepted as follows.
#
- # Open3.popen3("echo a") {|i, o, e, t| ... }
- # Open3.popen3("echo", "a") {|i, o, e, t| ... }
- # Open3.popen3(["echo", "argv0"], "a") {|i, o, e, t| ... }
+ # Open3.popen3("echo abc") {|i, o, e, t| ... }
+ # Open3.popen3("echo", "abc") {|i, o, e, t| ... }
+ # Open3.popen3(["echo", "argv0"], "abc") {|i, o, e, t| ... }
#
# If the last parameter, opts, is a Hash, it is recognized as an option for Process.spawn.
#
@@ -70,6 +70,15 @@ module Open3
#
# Closing stdin, stdout and stderr does not wait the process.
#
+ # You should be careful to avoid deadlocks.
+ # Since pipes are fixed length buffer,
+ # Open3.popen3("prog") {|i, o, e, t| o.read } deadlocks if
+ # the program generates many output on stderr.
+ # You should be read stdout and stderr simultaneously (using thread or IO.select).
+ # However if you don't need stderr output, Open3.popen2 can be used.
+ # If merged stdout and stderr output is not a problem, you can use Open3.popen2e.
+ # If you really needs stdout and stderr output as separate strings, you can consider Open3.capture3.
+ #
def popen3(*cmd, &block)
if Hash === cmd.last
opts = cmd.pop.dup
@@ -239,8 +248,8 @@ module Open3
# End
# layouted_graph, dot_log = Open3.capture3("dot -v", :stdin_data=>graph)
#
- # o, e, s = Open3.capture3("echo a; sort >&2", :stdin_data=>"foo\nbar\nbaz\n")
- # p o #=> "a\n"
+ # o, e, s = Open3.capture3("echo abc; sort >&2", :stdin_data=>"foo\nbar\nbaz\n")
+ # p o #=> "abc\n"
# p e #=> "bar\nbaz\nfoo\n"
# p s #=> #<Process::Status: pid 32682 exit 0>
#
@@ -257,7 +266,7 @@ module Open3
# STDOUT.binmode; print thumnail
# end
#
- def capture3(*cmd, &block)
+ def capture3(*cmd)
if Hash === cmd.last
opts = cmd.pop.dup
else
@@ -311,7 +320,7 @@ module Open3
# End
# image, s = Open3.capture2("gnuplot", :stdin_data=>gnuplot_commands, :binmode=>true)
#
- def capture2(*cmd, &block)
+ def capture2(*cmd)
if Hash === cmd.last
opts = cmd.pop.dup
else
@@ -350,7 +359,7 @@ module Open3
# # capture make log
# make_log, s = Open3.capture2e("make")
#
- def capture2e(*cmd, &block)
+ def capture2e(*cmd)
if Hash === cmd.last
opts = cmd.pop.dup
else
@@ -653,7 +662,7 @@ module Open3
end
module_function :pipeline
- def pipeline_run(cmds, pipeline_opts, child_io, parent_io, &block) # :nodoc:
+ def pipeline_run(cmds, pipeline_opts, child_io, parent_io) # :nodoc:
if cmds.empty?
raise ArgumentError, "no commands"
end
diff --git a/lib/optparse.rb b/lib/optparse.rb
index 79a95c1462..272b99d411 100644
--- a/lib/optparse.rb
+++ b/lib/optparse.rb
@@ -204,8 +204,7 @@
# === Further documentation
#
# The above examples should be enough to learn how to use this class. If you
-# have any questions, email me (gsinclair@soyabean.com.au) and I will update
-# this document.
+# have any questions, file a ticket at http://bugs.ruby-lang.org.
#
class OptionParser
# :stopdoc:
@@ -1065,13 +1064,13 @@ XXX
#
# Returns option summary string.
#
- def help; summarize(banner.to_s.sub(/\n?\z/, "\n")) end
+ def help; summarize("#{banner}".sub(/\n?\z/, "\n")) end
alias to_s help
#
# Returns option summary list.
#
- def to_a; summarize(banner.to_a.dup) end
+ def to_a; summarize("#{banner}".split(/^/)) end
#
# Checks if an argument is given twice, in which case an ArgumentError is
@@ -1709,7 +1708,8 @@ XXX
f |= Regexp::IGNORECASE if /i/ =~ o
f |= Regexp::MULTILINE if /m/ =~ o
f |= Regexp::EXTENDED if /x/ =~ o
- k = o.delete("^imx")
+ k = o.delete("imx")
+ k = nil if k.empty?
end
Regexp.new(s || all, f, k)
end
diff --git a/lib/optparse/ac.rb b/lib/optparse/ac.rb
new file mode 100644
index 0000000000..6a8626094d
--- /dev/null
+++ b/lib/optparse/ac.rb
@@ -0,0 +1,50 @@
+require 'optparse'
+
+class OptionParser::AC < OptionParser
+ private
+
+ def _check_ac_args(name, block)
+ unless /\A\w[-\w]*\z/ =~ name
+ raise ArgumentError, name
+ end
+ unless block
+ raise ArgumentError, "no block given", ParseError.filter_backtrace(caller)
+ end
+ end
+
+ def _ac_arg_enable(prefix, name, help_string, block)
+ _check_ac_args(name, block)
+
+ sdesc = []
+ ldesc = ["--#{prefix}-#{name}"]
+ desc = [help_string]
+ q = name.downcase
+ enable = Switch::NoArgument.new(nil, proc {true}, sdesc, ldesc, nil, desc, block)
+ disable = Switch::NoArgument.new(nil, proc {false}, sdesc, ldesc, nil, desc, block)
+ top.append(enable, [], ["enable-" + q], disable, ['disable-' + q])
+ enable
+ end
+
+ public
+
+ def ac_arg_enable(name, help_string, &block)
+ _ac_arg_enable("enable", name, help_string, block)
+ end
+
+ def ac_arg_disable(name, help_string, &block)
+ _ac_arg_enable("disable", name, help_string, block)
+ end
+
+ def ac_arg_with(name, help_string, &block)
+ _check_ac_args(name, block)
+
+ sdesc = []
+ ldesc = ["--with-#{name}"]
+ desc = [help_string]
+ q = name.downcase
+ with = Switch::PlacedArgument.new(*search(:atype, String), sdesc, ldesc, nil, desc, block)
+ without = Switch::NoArgument.new(nil, proc {}, sdesc, ldesc, nil, desc, block)
+ top.append(with, [], ["with-" + q], without, ['without-' + q])
+ with
+ end
+end
diff --git a/lib/ostruct.rb b/lib/ostruct.rb
index f3b4608ee8..b291f08308 100644
--- a/lib/ostruct.rb
+++ b/lib/ostruct.rb
@@ -11,7 +11,7 @@
#
# An OpenStruct is a data structure, similar to a Hash, that allows the
# definition of arbitrary attributes with their accompanying values. This is
-# accomplished by using Ruby's metaporgramming to define methods on the class
+# accomplished by using Ruby's metaprogramming to define methods on the class
# itself.
#
# == Examples:
@@ -30,12 +30,6 @@
# An OpenStruct employs a Hash internally to store the methods and values and
# can even be initialized with one:
#
-# country_data = { :country => "Australia", :population => 20_000_000 }
-# australia = OpenStruct.new(country_data)
-# p australia # -> <OpenStruct country="Australia" population=20000000>
-#
-# You may also define the hash in the initialization call:
-#
# australia = OpenStruct.new(:country => "Australia", :population => 20_000_000)
# p australia # -> <OpenStruct country="Australia" population=20000000>
#
@@ -72,15 +66,16 @@
# method_missing and define_method.
#
# This should be a consideration if there is a concern about the performance of
-# the objects that are created. As there is much more overhead in the setting
-# of these properties compard to utilizing a Hash or a Struct.
+# the objects that are created, as there is much more overhead in the setting
+# of these properties compared to using a Hash or a Struct.
#
class OpenStruct
#
# Creates a new OpenStruct object. By default, the resulting OpenStruct
# object will have no attributes.
#
- # The optional +hash+, if given, will generate attributes and values.
+ # The optional +hash+, if given, will generate attributes and values
+ # (can be a Hash, an OpenStruct or a Struct).
# For example:
#
# require 'ostruct'
@@ -89,17 +84,12 @@ class OpenStruct
#
# p data # -> <OpenStruct country="Australia" population=20000000>
#
- # You may also define the hash in the initialization call:
- #
- # australia = OpenStruct.new(:country => "Australia",
- # :population => 20_000_000)
- # p australia # -> <OpenStruct country="Australia" population=20000000>
- #
def initialize(hash=nil)
@table = {}
if hash
- for k,v in hash
- @table[k.to_sym] = v
+ hash.each_pair do |k, v|
+ k = k.to_sym
+ @table[k] = v
new_ostruct_member(k)
end
end
@@ -109,35 +99,45 @@ class OpenStruct
def initialize_copy(orig)
super
@table = @table.dup
+ @table.each_key{|key| new_ostruct_member(key)}
end
#
- # Provides marshalling support for use by the Marshal library. Returning the
- # underlying Hash table that contains the functions defined as the keys and
- # the values assigned to them.
+ # Converts the OpenStruct to a hash with keys representing
+ # each attribute (as symbols) and their corresponding values
+ # Example:
#
- # require 'ostruct'
+ # require 'ostruct'
+ # data = OpenStruct.new("country" => "Australia", :population => 20_000_000)
+ # data.to_h # => {:country => "Australia", :population => 20000000 }
#
- # person = OpenStruct.new
- # person.name = 'John Smith'
- # person.age = 70
+ def to_h
+ @table.dup
+ end
+
#
- # person.marshal_dump # => { :name => 'John Smith', :age => 70 }
+ # Yields all attributes (as a symbol) along with the corresponding values
+ # or returns an enumerator if not block is given.
+ # Example:
#
- def marshal_dump
- @table
+ # require 'ostruct'
+ # data = OpenStruct.new("country" => "Australia", :population => 20_000_000)
+ # data.each_pair.to_a # => [[:country, "Australia"], [:population, 20000000]]
+ #
+ def each_pair
+ return to_enum __method__ unless block_given?
+ @table.each_pair{|p| yield p}
end
#
- # Provides marshalling support for use by the Marshal library. Accepting
- # a Hash of keys and values which will be used to populate the internal table
+ # Provides marshalling support for use by the Marshal library.
#
- # require 'ostruct'
+ def marshal_dump
+ @table
+ end
+
#
- # event = OpenStruct.new
- # hash = { 'time' => Time.now, 'title' => 'Birthday Party' }
- # event.marshal_load(hash)
- # event.title # => 'Birthday Party'
+ # Provides marshalling support for use by the Marshal library.
#
def marshal_load(x)
@table = x
@@ -145,8 +145,8 @@ class OpenStruct
end
#
- # #modifiable is used internally to check if the OpenStruct is able to be
- # modified before granting access to the internal Hash table to be augmented.
+ # Used internally to check if the OpenStruct is able to be
+ # modified before granting access to the internal Hash table to be modified.
#
def modifiable
begin
@@ -159,39 +159,58 @@ class OpenStruct
protected :modifiable
#
- # new_ostruct_member is used internally to defined properties on the
+ # Used internally to defined properties on the
# OpenStruct. It does this by using the metaprogramming function
- # define_method for both the getter method and the setter method.
+ # define_singleton_method for both the getter method and the setter method.
#
def new_ostruct_member(name)
name = name.to_sym
- unless self.respond_to?(name)
- class << self; self; end.class_eval do
- define_method(name) { @table[name] }
- define_method("#{name}=") { |x| modifiable[name] = x }
- end
+ unless respond_to?(name)
+ define_singleton_method(name) { @table[name] }
+ define_singleton_method("#{name}=") { |x| modifiable[name] = x }
end
name
end
+ protected :new_ostruct_member
def method_missing(mid, *args) # :nodoc:
mname = mid.id2name
len = args.length
- if mname.chomp!('=') && mid != :[]=
+ if mname.chomp!('=')
if len != 1
raise ArgumentError, "wrong number of arguments (#{len} for 1)", caller(1)
end
modifiable[new_ostruct_member(mname)] = args[0]
- elsif len == 0 && mid != :[]
+ elsif len == 0
@table[mid]
else
raise NoMethodError, "undefined method `#{mid}' for #{self}", caller(1)
end
end
+ # Returns the value of a member.
#
- # Remove the named field from the object. Returning the value that the field
- # contained if it has defined.
+ # person = OpenStruct.new('name' => 'John Smith', 'age' => 70)
+ # person[:age] # => 70, same as ostruct.age
+ #
+ def [](name)
+ @table[name.to_sym]
+ end
+
+ #
+ # Sets the value of a member.
+ #
+ # person = OpenStruct.new('name' => 'John Smith', 'age' => 70)
+ # person[:age] = 42 # => equivalent to ostruct.age = 42
+ # person.age # => 42
+ #
+ def []=(name, value)
+ modifiable[new_ostruct_member(name)] = value
+ end
+
+ #
+ # Remove the named field from the object. Returns the value that the field
+ # contained if it was defined.
#
# require 'ostruct'
#
@@ -201,8 +220,8 @@ class OpenStruct
#
def delete_field(name)
sym = name.to_sym
- @table.delete sym
singleton_class.__send__(:remove_method, sym, "#{name}=")
+ @table.delete sym
end
InspectKey = :__inspect_key__ # :nodoc:
@@ -238,11 +257,28 @@ class OpenStruct
#
# Compares this object and +other+ for equality. An OpenStruct is equal to
- # +other+ when +other+ is an OpenStruct and the two object's Hash tables are
+ # +other+ when +other+ is an OpenStruct and the two objects' Hash tables are
# equal.
#
def ==(other)
- return false unless(other.kind_of?(OpenStruct))
- return @table == other.table
+ return false unless other.kind_of?(OpenStruct)
+ @table == other.table
+ end
+
+ #
+ # Compares this object and +other+ for equality. An OpenStruct is eql? to
+ # +other+ when +other+ is an OpenStruct and the two objects' Hash tables are
+ # eql?.
+ #
+ def eql?(other)
+ return false unless other.kind_of?(OpenStruct)
+ @table.eql?(other.table)
+ end
+
+ # Compute a hash-code for this OpenStruct.
+ # Two hashes with the same content will have the same hash code
+ # (and will be eql?).
+ def hash
+ @table.hash
end
end
diff --git a/lib/pp.rb b/lib/pp.rb
index 56d726dc7d..6e0c797d2e 100644
--- a/lib/pp.rb
+++ b/lib/pp.rb
@@ -1,3 +1,24 @@
+require 'prettyprint'
+
+module Kernel
+ # returns a pretty printed object as a string.
+ def pretty_inspect
+ PP.pp(self, '')
+ end
+
+ private
+ # prints arguments in pretty form.
+ #
+ # pp returns argument(s).
+ def pp(*objs) # :doc:
+ objs.each {|obj|
+ PP.pp(obj)
+ }
+ objs.size <= 1 ? objs.first : objs
+ end
+ module_function :pp
+end
+
# == Pretty-printer for Ruby objects.
#
# = Which seems better?
@@ -27,11 +48,13 @@
#
# = Usage
#
-# pp(obj)
+# pp(obj) #=> obj
+# pp(obj1, obj2, ...) #=> [obj1, obj2, ...]
+# pp() #=> nil
#
-# output +obj+ to +$>+ in pretty printed format.
+# output +obj(s)+ to +$>+ in pretty printed format.
#
-# It returns +nil+.
+# It returns +obj(s)+.
#
# = Output Customization
# To define your customized pretty printing function for your classes,
@@ -42,28 +65,6 @@
#
# = Author
# Tanaka Akira <akr@m17n.org>
-
-require 'prettyprint'
-
-module Kernel
- # returns a pretty printed object as a string.
- def pretty_inspect
- PP.pp(self, '')
- end
-
- private
- # prints arguments in pretty form.
- #
- # pp returns argument(s).
- def pp(*objs) # :doc:
- objs.each {|obj|
- PP.pp(obj)
- }
- objs.size <= 1 ? objs.first : objs
- end
- module_function :pp
-end
-
class PP < PrettyPrint
# Outputs +obj+ to +out+ in pretty printed format of
# +width+ columns in width.
@@ -264,8 +265,7 @@ class PP < PrettyPrint
module ObjectMixin
# 1. specific pretty_print
# 2. specific inspect
- # 3. specific to_s
- # 4. generic pretty_print
+ # 3. generic pretty_print
# A default pretty printing method for general objects.
# It calls #pretty_print_instance_variables to list instance variables.
@@ -282,18 +282,10 @@ class PP < PrettyPrint
inspect_method = method_method.call(:inspect)
rescue NameError
end
- begin
- to_s_method = method_method.call(:to_s)
- rescue NameError
- end
if inspect_method && /\(Kernel\)#/ !~ inspect_method.inspect
q.text self.inspect
elsif !inspect_method && self.respond_to?(:inspect)
q.text self.inspect
- elsif to_s_method && /\(Kernel\)#/ !~ to_s_method.inspect
- q.text self.to_s
- elsif !to_s_method && self.respond_to?(:to_s)
- q.text self.to_s
else
q.pp_object(self)
end
diff --git a/lib/prettyprint.rb b/lib/prettyprint.rb
index 8b33bdf85f..9a90713a4d 100644
--- a/lib/prettyprint.rb
+++ b/lib/prettyprint.rb
@@ -157,7 +157,14 @@ class PrettyPrint
end
end
- # This is similar to #breakable, but is less-likely to insert a newline.
+ # This is similar to #breakable except
+ # the decision to break or not is determined individually.
+ #
+ # Two #fill_breakable under a group may cause 4 results:
+ # (break,break), (break,non-break), (non-break,break), (non-break,non-break).
+ # This is different to #breakable because two #breakable under a group
+ # may cause 2 results:
+ # (break,break), (non-break,non-break).
#
# The text sep+ is inserted if a line is not broken at this point.
#
diff --git a/lib/profiler.rb b/lib/profiler.rb
index a4b8889093..ed787af267 100644
--- a/lib/profiler.rb
+++ b/lib/profiler.rb
@@ -1,6 +1,65 @@
+# Profile provides a way to Profile your Ruby application.
+#
+# Profiling your program is a way of determining which methods are called and
+# how long each method takes to complete. This way you can detect which
+# methods are possible bottlenecks.
+#
+# Profiling your program will slow down your execution time considerably,
+# so activate it only when you need it. Don't confuse benchmarking with
+# profiling.
+#
+# There are two ways to activate Profiling:
+#
+# == Command line
+#
+# Run your Ruby script with <code>-rprofile</code>:
+#
+# ruby -rprofile example.rb
+#
+# If you're profiling an executable in your <code>$PATH</code> you can use
+# <code>ruby -S</code>:
+#
+# ruby -rprofile -S some_executable
+#
+# == From code
+#
+# Just require 'profile':
+#
+# require 'profile'
+#
+# def slow_method
+# 5000.times do
+# 9999999999999999*999999999
+# end
+# end
+#
+# def fast_method
+# 5000.times do
+# 9999999999999999+999999999
+# end
+# end
+#
+# slow_method
+# fast_method
+#
+# The output in both cases is a report when the execution is over:
+#
+# ruby -rprofile example.rb
+#
+# % cumulative self self total
+# time seconds seconds calls ms/call ms/call name
+# 68.42 0.13 0.13 2 65.00 95.00 Integer#times
+# 15.79 0.16 0.03 5000 0.01 0.01 Fixnum#*
+# 15.79 0.19 0.03 5000 0.01 0.01 Fixnum#+
+# 0.00 0.19 0.00 2 0.00 0.00 IO#set_encoding
+# 0.00 0.19 0.00 1 0.00 100.00 Object#slow_method
+# 0.00 0.19 0.00 2 0.00 0.00 Module#method_added
+# 0.00 0.19 0.00 1 0.00 90.00 Object#fast_method
+# 0.00 0.19 0.00 1 0.00 190.00 #toplevel
+
module Profiler__
# internal values
- @@start = @@stack = @@map = nil
+ @@start = @@stack = @@map = @@array = nil
PROFILE_PROC = proc{|event, file, line, id, binding, klass|
case event
when "call", "c-call"
@@ -10,7 +69,11 @@ module Profiler__
now = Process.times[0]
key = [klass, id]
if tick = @@stack.pop
- data = (@@map[key] ||= [0, 0.0, 0.0, key])
+ data = begin
+ @@map[key] ||= [0, 0.0, 0.0, key]
+ rescue NoMethodError
+ @@array.find{|i| i[3] == key} || (@@array << [0, 0.0, 0.0, key])[-1]
+ end
data[0] += 1
cost = now - tick[0]
data[1] += cost
@@ -24,6 +87,7 @@ module_function
@@start = Process.times[0]
@@stack = []
@@map = {}
+ @@array = []
set_trace_func PROFILE_PROC
end
def stop_profile
@@ -33,7 +97,7 @@ module_function
stop_profile
total = Process.times[0] - @@start
if total == 0 then total = 0.01 end
- data = @@map.values
+ data = @@map.values + @@array
data = data.sort_by{|x| -x[2]}
sum = 0
f.printf " %% cumulative self self total\n"
@@ -54,6 +118,9 @@ module_function
name += "."
end
name + id.id2name
+ rescue NoMethodError => e
+ name = e.message.slice(/#<.*?:0x[0-9a-f]+>/) || ""
+ name + "." + id.id2name
end
private :get_name
end
diff --git a/lib/pstore.rb b/lib/pstore.rb
index 9fb0249f3c..a2813a8e20 100644
--- a/lib/pstore.rb
+++ b/lib/pstore.rb
@@ -7,10 +7,7 @@
#
# See PStore for documentation.
-
-require "fileutils"
require "digest/md5"
-require "thread"
#
# PStore implements a file based persistence mechanism based on a Hash. User
@@ -94,10 +91,9 @@ require "thread"
# Needless to say, if you're storing valuable data with PStore, then you should
# backup the PStore files from time to time.
class PStore
- binmode = defined?(File::BINARY) ? File::BINARY : 0
- RDWR_ACCESS = File::RDWR | File::CREAT | binmode
- RD_ACCESS = File::RDONLY | binmode
- WR_ACCESS = File::WRONLY | File::CREAT | File::TRUNC | binmode
+ RDWR_ACCESS = {mode: IO::RDWR | IO::CREAT | IO::BINARY, encoding: Encoding::ASCII_8BIT}.freeze
+ RD_ACCESS = {mode: IO::RDONLY | IO::BINARY, encoding: Encoding::ASCII_8BIT}.freeze
+ WR_ACCESS = {mode: IO::WRONLY | IO::CREAT | IO::TRUNC | IO::BINARY, encoding: Encoding::ASCII_8BIT}.freeze
# The error type thrown by all PStore methods.
class Error < StandardError
@@ -142,8 +138,8 @@ class PStore
# Raises PStore::Error if the calling code is not in a PStore#transaction or
# if the code is in a read-only PStore#transaction.
#
- def in_transaction_wr()
- in_transaction()
+ def in_transaction_wr
+ in_transaction
raise PStore::Error, "in read-only transaction" if @rdonly
end
private :in_transaction, :in_transaction_wr
@@ -201,7 +197,7 @@ class PStore
# be read-only. It will raise PStore::Error if called at any other time.
#
def []=(name, value)
- in_transaction_wr()
+ in_transaction_wr
@table[name] = value
end
#
@@ -211,7 +207,7 @@ class PStore
# be read-only. It will raise PStore::Error if called at any other time.
#
def delete(name)
- in_transaction_wr()
+ in_transaction_wr
@table.delete name
end
@@ -311,10 +307,18 @@ class PStore
#
# Note that PStore does not support nested transactions.
#
- def transaction(read_only = false, &block) # :yields: pstore
+ def transaction(read_only = false) # :yields: pstore
value = nil
- raise PStore::Error, "nested transaction" if !@thread_safe && @lock.locked?
- @lock.synchronize do
+ if !@thread_safe
+ raise PStore::Error, "nested transaction" unless @lock.try_lock
+ else
+ begin
+ @lock.lock
+ rescue ThreadError
+ raise PStore::Error, "nested transaction"
+ end
+ end
+ begin
@rdonly = read_only
@abort = false
file = open_and_lock_file(@filename, read_only)
@@ -339,10 +343,10 @@ class PStore
value = yield(self)
end
end
+ ensure
+ @lock.unlock
end
value
- rescue ThreadError
- raise PStore::Error, "nested transaction"
end
private
@@ -389,9 +393,7 @@ class PStore
if read_only
begin
table = load(file)
- if !table.is_a?(Hash)
- raise Error, "PStore file seems to be corrupted."
- end
+ raise Error, "PStore file seems to be corrupted." unless table.is_a?(Hash)
rescue EOFError
# This seems to be a newly-created file.
table = {}
@@ -403,14 +405,12 @@ class PStore
# This seems to be a newly-created file.
table = {}
checksum = empty_marshal_checksum
- size = empty_marshal_data.size
+ size = empty_marshal_data.bytesize
else
table = load(data)
checksum = Digest::MD5.digest(data)
- size = data.size
- if !table.is_a?(Hash)
- raise Error, "PStore file seems to be corrupted."
- end
+ size = data.bytesize
+ raise Error, "PStore file seems to be corrupted." unless table.is_a?(Hash)
end
data.replace(EMPTY_STRING)
[table, checksum, size]
@@ -418,43 +418,17 @@ class PStore
end
def on_windows?
- is_windows = RUBY_PLATFORM =~ /mswin/ ||
- RUBY_PLATFORM =~ /mingw/ ||
- RUBY_PLATFORM =~ /bccwin/ ||
- RUBY_PLATFORM =~ /wince/
+ is_windows = RUBY_PLATFORM =~ /mswin|mingw|bccwin|wince/
self.class.__send__(:define_method, :on_windows?) do
is_windows
end
is_windows
end
- # Check whether Marshal.dump supports the 'canonical' option. This option
- # makes sure that Marshal.dump always dumps data structures in the same order.
- # This is important because otherwise, the checksums that we generate may differ.
- def marshal_dump_supports_canonical_option?
- begin
- Marshal.dump(nil, -1, true)
- result = true
- rescue
- result = false
- end
- self.class.__send__(:define_method, :marshal_dump_supports_canonical_option?) do
- result
- end
- result
- end
-
def save_data(original_checksum, original_file_size, file)
- # We only want to save the new data if the size or checksum has changed.
- # This results in less filesystem calls, which is good for performance.
- if marshal_dump_supports_canonical_option?
- new_data = Marshal.dump(@table, -1, true)
- else
- new_data = dump(@table)
- end
- new_checksum = Digest::MD5.digest(new_data)
+ new_data = dump(@table)
- if new_data.size != original_file_size || new_checksum != original_checksum
+ if new_data.bytesize != original_file_size || Digest::MD5.digest(new_data) != original_checksum
if @ultra_safe && !on_windows?
# Windows doesn't support atomic file renames.
save_data_with_atomic_file_rename_strategy(new_data, file)
@@ -484,8 +458,8 @@ class PStore
def save_data_with_fast_strategy(data, file)
file.rewind
- file.truncate(0)
file.write(data)
+ file.truncate(data.bytesize)
end
diff --git a/lib/racc/parser.rb b/lib/racc/parser.rb
index 737b0fda5d..e0b77f157e 100644
--- a/lib/racc/parser.rb
+++ b/lib/racc/parser.rb
@@ -11,10 +11,6 @@
# without restriction.
#
-unless defined?(NotImplementedError)
- NotImplementedError = NotImplementError
-end
-
module Racc
class ParseError < StandardError; end
end
diff --git a/lib/rake.rb b/lib/rake.rb
index fc1a6a5165..fff13fe460 100644
--- a/lib/rake.rb
+++ b/lib/rake.rb
@@ -43,6 +43,7 @@ require 'rake/win32'
require 'rake/task_argument_error'
require 'rake/rule_recursion_overflow_error'
require 'rake/rake_module'
+require 'rake/trace_output'
require 'rake/pseudo_status'
require 'rake/task_arguments'
require 'rake/invocation_chain'
@@ -58,6 +59,7 @@ require 'rake/early_time'
require 'rake/name_space'
require 'rake/task_manager'
require 'rake/application'
+require 'rake/backtrace'
$trace = false
diff --git a/lib/rake/application.rb b/lib/rake/application.rb
index a4954f27e7..734e20ac31 100644
--- a/lib/rake/application.rb
+++ b/lib/rake/application.rb
@@ -2,16 +2,23 @@ require 'shellwords'
require 'optparse'
require 'rake/task_manager'
+require 'rake/file_list'
+require 'rake/thread_pool'
+require 'rake/thread_history_display'
+require 'rake/trace_output'
require 'rake/win32'
module Rake
+ CommandLineOptionError = Class.new(StandardError)
+
######################################################################
# Rake main application object. When invoking +rake+ from the
# command line, a Rake::Application object is created and run.
#
class Application
include TaskManager
+ include TraceOutput
# The name of the application (typically 'rake')
attr_reader :name
@@ -54,7 +61,7 @@ module Rake
#
# * Initialize the command line options (+init+).
# * Define the tasks (+load_rakefile+).
- # * Run the top level tasks (+run_tasks+).
+ # * Run the top level tasks (+top_level+).
#
# If you wish to build a custom rake command, you should call
# +init+ on your application. Then define any tasks. Finally,
@@ -85,7 +92,7 @@ module Rake
# Run the top level tasks of a Rake application.
def top_level
- standard_exception_handling do
+ run_with_threads do
if options.show_tasks
display_tasks_and_comments
elsif options.show_prereqs
@@ -96,6 +103,21 @@ module Rake
end
end
+ # Run the given block with the thread startup and shutdown.
+ def run_with_threads
+ thread_pool.gather_history if options.job_stats == :history
+
+ yield
+
+ thread_pool.join
+ if options.job_stats
+ stats = thread_pool.statistics
+ puts "Maximum active threads: #{stats[:max_active_threads]}"
+ puts "Total threads in play: #{stats[:total_threads_in_play]}"
+ end
+ ThreadHistoryDisplay.new(thread_pool.history).show if options.job_stats == :history
+ end
+
# Add a loader to handle imported files ending in the extension
# +ext+.
def add_loader(ext, loader)
@@ -108,6 +130,11 @@ module Rake
@options ||= OpenStruct.new
end
+ # Return the thread pool used for multithreaded processing.
+ def thread_pool # :nodoc:
+ @thread_pool ||= ThreadPool.new(options.thread_pool_size||FIXNUM_MAX)
+ end
+
# private ----------------------------------------------------------------
def invoke_task(task_string)
@@ -146,15 +173,15 @@ module Rake
# Display the error message that caused the exception.
def display_error_message(ex)
- $stderr.puts "#{name} aborted!"
- $stderr.puts ex.message
- if options.trace
- $stderr.puts ex.backtrace.join("\n")
+ trace "#{name} aborted!"
+ trace ex.message
+ if options.backtrace
+ trace ex.backtrace.join("\n")
else
- $stderr.puts rakefile_location(ex.backtrace)
+ trace Backtrace.collapse(ex.backtrace).join("\n")
end
- $stderr.puts "Tasks: #{ex.chain}" if has_chain?(ex)
- $stderr.puts "(See full trace by running task with --trace)" unless options.trace
+ trace "Tasks: #{ex.chain}" if has_chain?(ex)
+ trace "(See full trace by running task with --trace)" unless options.backtrace
end
# Warn about deprecated usage.
@@ -180,7 +207,7 @@ module Rake
def have_rakefile
@rakefiles.each do |fn|
if File.exist?(fn)
- others = Dir.glob(fn, File::FNM_CASEFOLD)
+ others = FileList.glob(fn, File::FNM_CASEFOLD)
return others.size == 1 ? others.first : fn
elsif fn == ''
return fn
@@ -208,7 +235,7 @@ module Rake
# Display the tasks and comments.
def display_tasks_and_comments
displayable_tasks = tasks.select { |t|
- t.comment && t.name =~ options.show_task_pattern
+ (options.show_all_tasks || t.comment) && t.name =~ options.show_task_pattern
}
case options.show_tasks
when :tasks
@@ -222,7 +249,8 @@ module Rake
when :describe
displayable_tasks.each do |t|
puts "#{name} #{t.name_with_args}"
- t.full_comment.split("\n").each do |line|
+ comment = t.full_comment || ""
+ comment.split("\n").each do |line|
puts " #{line}"
end
puts
@@ -271,7 +299,9 @@ module Rake
end
def truncate(string, width)
- if string.length <= width
+ if string.nil?
+ ""
+ elsif string.length <= width
string
else
( string[0, width-3] || "" ) + "..."
@@ -286,140 +316,214 @@ module Rake
end
end
+ def trace(*strings)
+ options.trace_output ||= $stderr
+ trace_on(options.trace_output, *strings)
+ end
+
+ def sort_options(options)
+ options.sort_by { |opt|
+ opt.select { |o| o =~ /^-/ }.map { |o| o.downcase }.sort.reverse
+ }
+ end
+ private :sort_options
+
# A list of all the standard options used in rake, suitable for
# passing to OptionParser.
def standard_rake_options
- [
- ['--classic-namespace', '-C', "Put Task and FileTask in the top level namespace",
- lambda { |value|
- require 'rake/classic_namespace'
- options.classic_namespace = true
- }
- ],
- ['--describe', '-D [PATTERN]', "Describe the tasks (matching optional PATTERN), then exit.",
- lambda { |value|
- options.show_tasks = :describe
- options.show_task_pattern = Regexp.new(value || '')
- TaskManager.record_task_metadata = true
- }
- ],
- ['--dry-run', '-n', "Do a dry run without executing actions.",
- lambda { |value|
- Rake.verbose(true)
- Rake.nowrite(true)
- options.dryrun = true
- options.trace = true
- }
- ],
- ['--execute', '-e CODE', "Execute some Ruby code and exit.",
- lambda { |value|
- eval(value)
- exit
- }
- ],
- ['--execute-print', '-p CODE', "Execute some Ruby code, print the result, then exit.",
- lambda { |value|
- puts eval(value)
- exit
- }
- ],
- ['--execute-continue', '-E CODE',
- "Execute some Ruby code, then continue with normal task processing.",
- lambda { |value| eval(value) }
- ],
- ['--libdir', '-I LIBDIR', "Include LIBDIR in the search path for required modules.",
- lambda { |value| $:.push(value) }
- ],
- ['--no-search', '--nosearch', '-N', "Do not search parent directories for the Rakefile.",
- lambda { |value| options.nosearch = true }
- ],
- ['--prereqs', '-P', "Display the tasks and dependencies, then exit.",
- lambda { |value| options.show_prereqs = true }
- ],
- ['--quiet', '-q', "Do not log messages to standard output.",
- lambda { |value| Rake.verbose(false) }
- ],
- ['--rakefile', '-f [FILE]', "Use FILE as the rakefile.",
- lambda { |value|
- value ||= ''
- @rakefiles.clear
- @rakefiles << value
- }
- ],
- ['--rakelibdir', '--rakelib', '-R RAKELIBDIR',
- "Auto-import any .rake files in RAKELIBDIR. (default is 'rakelib')",
- lambda { |value| options.rakelib = value.split(':') }
- ],
- ['--require', '-r MODULE', "Require MODULE before executing rakefile.",
- lambda { |value|
- begin
- require value
- rescue LoadError => ex
+ sort_options(
+ [
+ ['--all', '-A', "Show all tasks, even uncommented ones",
+ lambda { |value|
+ options.show_all_tasks = value
+ }
+ ],
+ ['--backtrace=[OUT]', "Enable full backtrace. OUT can be stderr (default) or stdout.",
+ lambda { |value|
+ options.backtrace = true
+ select_trace_output(options, 'backtrace', value)
+ }
+ ],
+ ['--classic-namespace', '-C', "Put Task and FileTask in the top level namespace",
+ lambda { |value|
+ require 'rake/classic_namespace'
+ options.classic_namespace = true
+ }
+ ],
+ ['--comments', "Show commented tasks only",
+ lambda { |value|
+ options.show_all_tasks = !value
+ }
+ ],
+ ['--describe', '-D [PATTERN]', "Describe the tasks (matching optional PATTERN), then exit.",
+ lambda { |value|
+ select_tasks_to_show(options, :describe, value)
+ }
+ ],
+ ['--dry-run', '-n', "Do a dry run without executing actions.",
+ lambda { |value|
+ Rake.verbose(true)
+ Rake.nowrite(true)
+ options.dryrun = true
+ options.trace = true
+ }
+ ],
+ ['--execute', '-e CODE', "Execute some Ruby code and exit.",
+ lambda { |value|
+ eval(value)
+ exit
+ }
+ ],
+ ['--execute-print', '-p CODE', "Execute some Ruby code, print the result, then exit.",
+ lambda { |value|
+ puts eval(value)
+ exit
+ }
+ ],
+ ['--execute-continue', '-E CODE',
+ "Execute some Ruby code, then continue with normal task processing.",
+ lambda { |value| eval(value) }
+ ],
+ ['--jobs', '-j [NUMBER]',
+ "Specifies the maximum number of tasks to execute in parallel. (default:2)",
+ lambda { |value| options.thread_pool_size = [(value || 2).to_i,2].max }
+ ],
+ ['--job-stats [LEVEL]',
+ "Display job statistics. LEVEL=history displays a complete job list",
+ lambda { |value|
+ if value =~ /^history/i
+ options.job_stats = :history
+ else
+ options.job_stats = true
+ end
+ }
+ ],
+ ['--libdir', '-I LIBDIR', "Include LIBDIR in the search path for required modules.",
+ lambda { |value| $:.push(value) }
+ ],
+ ['--multitask', '-m', "Treat all tasks as multitasks.",
+ lambda { |value| options.always_multitask = true }
+ ],
+ ['--no-search', '--nosearch', '-N', "Do not search parent directories for the Rakefile.",
+ lambda { |value| options.nosearch = true }
+ ],
+ ['--prereqs', '-P', "Display the tasks and dependencies, then exit.",
+ lambda { |value| options.show_prereqs = true }
+ ],
+ ['--quiet', '-q', "Do not log messages to standard output.",
+ lambda { |value| Rake.verbose(false) }
+ ],
+ ['--rakefile', '-f [FILE]', "Use FILE as the rakefile.",
+ lambda { |value|
+ value ||= ''
+ @rakefiles.clear
+ @rakefiles << value
+ }
+ ],
+ ['--rakelibdir', '--rakelib', '-R RAKELIBDIR',
+ "Auto-import any .rake files in RAKELIBDIR. (default is 'rakelib')",
+ lambda { |value| options.rakelib = value.split(File::PATH_SEPARATOR) }
+ ],
+ ['--reduce-compat', "Remove DSL in Object; remove Module#const_missing which defines ::Task etc.",
+ # Load-time option.
+ # Handled in bin/rake where Rake::REDUCE_COMPAT is defined (or not).
+ lambda { |_| }
+ ],
+ ['--require', '-r MODULE', "Require MODULE before executing rakefile.",
+ lambda { |value|
begin
- rake_require value
- rescue LoadError
- raise ex
+ require value
+ rescue LoadError => ex
+ begin
+ rake_require value
+ rescue LoadError
+ raise ex
+ end
end
- end
- }
- ],
- ['--rules', "Trace the rules resolution.",
- lambda { |value| options.trace_rules = true }
- ],
- ['--silent', '-s', "Like --quiet, but also suppresses the 'in directory' announcement.",
- lambda { |value|
- Rake.verbose(false)
- options.silent = true
- }
- ],
- ['--system', '-g',
- "Using system wide (global) rakefiles (usually '~/.rake/*.rake').",
- lambda { |value| options.load_system = true }
- ],
- ['--no-system', '--nosystem', '-G',
- "Use standard project Rakefile search paths, ignore system wide rakefiles.",
- lambda { |value| options.ignore_system = true }
- ],
- ['--tasks', '-T [PATTERN]', "Display the tasks (matching optional PATTERN) with descriptions, then exit.",
- lambda { |value|
- options.show_tasks = :tasks
- options.show_task_pattern = Regexp.new(value || '')
- Rake::TaskManager.record_task_metadata = true
- }
- ],
- ['--trace', '-t', "Turn on invoke/execute tracing, enable full backtrace.",
- lambda { |value|
- options.trace = true
- Rake.verbose(true)
- }
- ],
- ['--verbose', '-v', "Log message to standard output.",
- lambda { |value| Rake.verbose(true) }
- ],
- ['--version', '-V', "Display the program version.",
- lambda { |value|
- puts "rake, version #{RAKEVERSION}"
- exit
- }
- ],
- ['--where', '-W [PATTERN]', "Describe the tasks (matching optional PATTERN), then exit.",
- lambda { |value|
- options.show_tasks = :lines
- options.show_task_pattern = Regexp.new(value || '')
- Rake::TaskManager.record_task_metadata = true
- }
- ],
- ['--no-deprecation-warnings', '-X', "Disable the deprecation warnings.",
- lambda { |value|
- options.ignore_deprecate = true
- }
- ],
- ]
+ }
+ ],
+ ['--rules', "Trace the rules resolution.",
+ lambda { |value| options.trace_rules = true }
+ ],
+ ['--silent', '-s', "Like --quiet, but also suppresses the 'in directory' announcement.",
+ lambda { |value|
+ Rake.verbose(false)
+ options.silent = true
+ }
+ ],
+ ['--suppress-backtrace PATTERN', "Suppress backtrace lines matching regexp PATTERN. Ignored if --trace is on.",
+ lambda { |value|
+ options.suppress_backtrace_pattern = Regexp.new(value)
+ }
+ ],
+ ['--system', '-g',
+ "Using system wide (global) rakefiles (usually '~/.rake/*.rake').",
+ lambda { |value| options.load_system = true }
+ ],
+ ['--no-system', '--nosystem', '-G',
+ "Use standard project Rakefile search paths, ignore system wide rakefiles.",
+ lambda { |value| options.ignore_system = true }
+ ],
+ ['--tasks', '-T [PATTERN]', "Display the tasks (matching optional PATTERN) with descriptions, then exit.",
+ lambda { |value|
+ select_tasks_to_show(options, :tasks, value)
+ }
+ ],
+ ['--trace=[OUT]', '-t', "Turn on invoke/execute tracing, enable full backtrace. OUT can be stderr (default) or stdout.",
+ lambda { |value|
+ options.trace = true
+ options.backtrace = true
+ select_trace_output(options, 'trace', value)
+ Rake.verbose(true)
+ }
+ ],
+ ['--verbose', '-v', "Log message to standard output.",
+ lambda { |value| Rake.verbose(true) }
+ ],
+ ['--version', '-V', "Display the program version.",
+ lambda { |value|
+ puts "rake, version #{RAKEVERSION}"
+ exit
+ }
+ ],
+ ['--where', '-W [PATTERN]', "Describe the tasks (matching optional PATTERN), then exit.",
+ lambda { |value|
+ select_tasks_to_show(options, :lines, value)
+ options.show_all_tasks = true
+ }
+ ],
+ ['--no-deprecation-warnings', '-X', "Disable the deprecation warnings.",
+ lambda { |value|
+ options.ignore_deprecate = true
+ }
+ ],
+ ])
+ end
+
+ def select_tasks_to_show(options, show_tasks, value)
+ options.show_tasks = show_tasks
+ options.show_task_pattern = Regexp.new(value || '')
+ Rake::TaskManager.record_task_metadata = true
+ end
+ private :select_tasks_to_show
+
+ def select_trace_output(options, trace_option, value)
+ value = value.strip unless value.nil?
+ case value
+ when 'stdout'
+ options.trace_output = $stdout
+ when 'stderr', nil
+ options.trace_output = $stderr
+ else
+ fail CommandLineOptionError, "Unrecognized --#{trace_option} option '#{value}'"
+ end
end
+ private :select_trace_output
# Read and handle the command line options.
def handle_options
options.rakelib = ['rakelib']
+ options.trace_output = $stderr
OptionParser.new do |opts|
opts.banner = "rake [-f rakefile] {options} targets..."
@@ -508,7 +612,7 @@ module Rake
end
def glob(path, &block)
- Dir[path.gsub("\\", '/')].each(&block)
+ FileList.glob(path.gsub("\\", '/')).each(&block)
end
private :glob
@@ -582,7 +686,7 @@ module Rake
@const_warning = true
end
- def rakefile_location backtrace = caller
+ def rakefile_location(backtrace=caller)
backtrace.map { |t| t[/([^:]+):/,1] }
re = /^#{@rakefile}$/
@@ -590,5 +694,9 @@ module Rake
backtrace.find { |str| str =~ re } || ''
end
+
+ private
+ FIXNUM_MAX = (2**(0.size * 8 - 2) - 1) # :nodoc:
+
end
end
diff --git a/lib/rake/backtrace.rb b/lib/rake/backtrace.rb
new file mode 100644
index 0000000000..e67132f67a
--- /dev/null
+++ b/lib/rake/backtrace.rb
@@ -0,0 +1,18 @@
+module Rake
+ module Backtrace
+ SUPPRESSED_PATHS =
+ RbConfig::CONFIG.values_at(*RbConfig::CONFIG.
+ keys.grep(/(prefix|libdir)/)).uniq + [
+ File.join(File.dirname(__FILE__), ".."),
+ ].map { |f| Regexp.quote(File.expand_path(f)) }
+ SUPPRESSED_PATHS.reject! { |s| s.nil? || s =~ /^ *$/ }
+
+ SUPPRESS_PATTERN = %r!(\A#{SUPPRESSED_PATHS.join('|')}|bin/rake:\d+)!i
+
+ def self.collapse(backtrace)
+ pattern = Rake.application.options.suppress_backtrace_pattern ||
+ SUPPRESS_PATTERN
+ backtrace.reject { |elem| elem =~ pattern }
+ end
+ end
+end
diff --git a/lib/rake/clean.rb b/lib/rake/clean.rb
index 5c9cbcdb24..32846d4a6d 100644
--- a/lib/rake/clean.rb
+++ b/lib/rake/clean.rb
@@ -16,7 +16,7 @@ require 'rake'
# :stopdoc:
CLEAN = Rake::FileList["**/*~", "**/*.bak", "**/core"]
CLEAN.clear_exclude.exclude { |fn|
- fn.pathmap("%f") == 'core' && File.directory?(fn)
+ fn.pathmap("%f").downcase == 'core' && File.directory?(fn)
}
desc "Remove any temporary products."
diff --git a/lib/rake/cloneable.rb b/lib/rake/cloneable.rb
index 19c780bff6..ac67471232 100644
--- a/lib/rake/cloneable.rb
+++ b/lib/rake/cloneable.rb
@@ -3,23 +3,14 @@ module Rake
# Mixin for creating easily cloned objects.
#
module Cloneable
- # Clone an object by making a new object and setting all the instance
- # variables to the same values.
- def dup
- sibling = self.class.new
- instance_variables.each do |ivar|
- value = self.instance_variable_get(ivar)
- new_value = value.clone rescue value
- sibling.instance_variable_set(ivar, new_value)
+ # The hook that invoked by 'clone' and 'dup' methods.
+ def initialize_copy(source)
+ super
+ source.instance_variables.each do |var|
+ src_value = source.instance_variable_get(var)
+ value = src_value.clone rescue src_value
+ instance_variable_set(var, value)
end
- sibling.taint if tainted?
- sibling
- end
-
- def clone
- sibling = dup
- sibling.freeze if frozen?
- sibling
end
end
end
diff --git a/lib/rake/contrib/ftptools.rb b/lib/rake/contrib/ftptools.rb
index 78420c7412..d39cde8ed9 100644
--- a/lib/rake/contrib/ftptools.rb
+++ b/lib/rake/contrib/ftptools.rb
@@ -5,6 +5,7 @@
require 'date'
require 'net/ftp'
+require 'rake/file_list'
module Rake # :nodoc:
@@ -127,7 +128,7 @@ module Rake # :nodoc:
# Upload all files matching +wildcard+ to the uploader's root
# path.
def upload_files(wildcard)
- Dir[wildcard].each do |fn|
+ FileList.glob(wildcard).each do |fn|
upload(fn)
end
end
diff --git a/lib/rake/contrib/sys.rb b/lib/rake/contrib/sys.rb
index 41963f1fef..5e31ea81b4 100644
--- a/lib/rake/contrib/sys.rb
+++ b/lib/rake/contrib/sys.rb
@@ -10,6 +10,7 @@ begin
rescue LoadError
end
require 'rbconfig'
+require 'rake/file_list'
######################################################################
# Sys provides a number of file manipulation tools for the convenience
@@ -27,7 +28,7 @@ module Sys
# Install all the files matching +wildcard+ into the +dest_dir+
# directory. The permission mode is set to +mode+.
def install(wildcard, dest_dir, mode)
- Dir[wildcard].each do |fn|
+ FileList.glob(wildcard).each do |fn|
File.install(fn, dest_dir, mode, $verbose)
end
end
@@ -81,7 +82,7 @@ module Sys
# recursively delete directories.
def delete(*wildcards)
wildcards.each do |wildcard|
- Dir[wildcard].each do |fn|
+ FileList.glob(wildcard).each do |fn|
if File.directory?(fn)
log "Deleting directory #{fn}"
Dir.delete(fn)
@@ -96,10 +97,10 @@ module Sys
# Recursively delete all files and directories matching +wildcard+.
def delete_all(*wildcards)
wildcards.each do |wildcard|
- Dir[wildcard].each do |fn|
+ FileList.glob(wildcard).each do |fn|
next if ! File.exist?(fn)
if File.directory?(fn)
- Dir["#{fn}/*"].each do |subfn|
+ FileList.glob("#{fn}/*").each do |subfn|
next if subfn=='.' || subfn=='..'
delete_all(subfn)
end
@@ -161,7 +162,7 @@ module Sys
# Perform a block with each file matching a set of wildcards.
def for_files(*wildcards)
wildcards.each do |wildcard|
- Dir[wildcard].each do |fn|
+ FileList.glob(wildcard).each do |fn|
yield(fn)
end
end
@@ -172,7 +173,7 @@ module Sys
private # ----------------------------------------------------------
def for_matching_files(wildcard, dest_dir)
- Dir[wildcard].each do |fn|
+ FileList.glob(wildcard).each do |fn|
dest_file = File.join(dest_dir, fn)
parent = File.dirname(dest_file)
makedirs(parent) if ! File.directory?(parent)
diff --git a/lib/rake/dsl_definition.rb b/lib/rake/dsl_definition.rb
index 3294f9e6c0..143b0bcf7a 100644
--- a/lib/rake/dsl_definition.rb
+++ b/lib/rake/dsl_definition.rb
@@ -52,8 +52,8 @@ module Rake
# Declare a file creation task.
# (Mainly used for the directory command).
- def file_create(args, &block)
- Rake::FileCreationTask.define_task(args, &block)
+ def file_create(*args, &block)
+ Rake::FileCreationTask.define_task(*args, &block)
end
# Declare a set of files tasks to create the given directories on
@@ -62,12 +62,15 @@ module Rake
# Example:
# directory "testdata/doc"
#
- def directory(dir)
+ def directory(*args, &block)
+ result = file_create(*args, &block)
+ dir, _ = *Rake.application.resolve_args(args)
Rake.each_dir_parent(dir) do |d|
file_create d do |t|
mkdir_p t.name if ! File.exist?(t.name)
end
end
+ result
end
# Declare a task that performs its prerequisites in
@@ -78,8 +81,8 @@ module Rake
# Example:
# multitask :deploy => [:deploy_gem, :deploy_rdoc]
#
- def multitask(args, &block)
- Rake::MultiTask.define_task(args, &block)
+ def multitask(*args, &block)
+ Rake::MultiTask.define_task(*args, &block)
end
# Create a new rake namespace and use it for evaluating the given
@@ -144,10 +147,12 @@ module Rake
Rake.application.add_import(fn)
end
end
+
end
+ DeprecatedCommands = Object.new.extend(DSL)
+
module DeprecatedObjectDSL # :nodoc:
- Commands = Object.new.extend DSL
DSL.private_instance_methods(false).each do |name|
line = __LINE__+1
class_eval %{
@@ -160,15 +165,18 @@ module Rake
end
$stderr.puts "WARNING: DSL method \#{self.class}##{name} called at \#{caller.first}"
end
- Rake::DeprecatedObjectDSL::Commands.send(:#{name}, *args, &block)
- end
+ Rake::DeprecatedCommands.send(:#{name}, *args, &block)
+ end
private :#{name}
}, __FILE__, line
end
- end
+ end unless defined? Rake::REDUCE_COMPAT
extend FileUtilsExt
end
+# Extend the main object with the DSL commands. This allows top-level
+# calls to task, etc. to work from a Rakefile without polluting the
+# object inheritance tree.
self.extend Rake::DSL
-include Rake::DeprecatedObjectDSL
+include Rake::DeprecatedObjectDSL unless defined? Rake::REDUCE_COMPAT
diff --git a/lib/rake/ext/module.rb b/lib/rake/ext/module.rb
index 3f64aef6c8..fc61bea555 100644
--- a/lib/rake/ext/module.rb
+++ b/lib/rake/ext/module.rb
@@ -36,4 +36,4 @@ class Module
rake_original_const_missing(const_name)
end
end
-end
+end unless defined? Rake::REDUCE_COMPAT
diff --git a/lib/rake/ext/string.rb b/lib/rake/ext/string.rb
index fb22a9deb1..be8b463e1a 100644
--- a/lib/rake/ext/string.rb
+++ b/lib/rake/ext/string.rb
@@ -4,6 +4,7 @@ require 'rake/ext/core'
# Rake extension methods for String.
#
class String
+
rake_extension("ext") do
# Replace the file extension with +newext+. If there is no extension on
# the string, append the new extension to the end. If the new extension
@@ -163,5 +164,5 @@ class String
result
end
end
-end # class String
+end
diff --git a/lib/rake/ext/time.rb b/lib/rake/ext/time.rb
index 7877abf0ce..ea8b037e39 100644
--- a/lib/rake/ext/time.rb
+++ b/lib/rake/ext/time.rb
@@ -1,6 +1,8 @@
#--
# Extensions to time to allow comparisons with an early time class.
+require 'rake/early_time'
+
class Time
alias rake_original_time_compare :<=>
def <=>(other)
@@ -11,4 +13,3 @@ class Time
end
end
end
-
diff --git a/lib/rake/file_list.rb b/lib/rake/file_list.rb
index 9f780346f3..3eae5fb0d7 100644
--- a/lib/rake/file_list.rb
+++ b/lib/rake/file_list.rb
@@ -286,7 +286,7 @@ module Rake
matched = 0
each do |fn|
begin
- open(fn, "rb", *options) do |inf|
+ open(fn, "r", *options) do |inf|
count = 0
inf.each do |line|
count += 1
@@ -340,7 +340,7 @@ module Rake
# Add matching glob patterns.
def add_matching(pattern)
- Dir[pattern].each do |fn|
+ FileList.glob(pattern).each do |fn|
self << fn unless exclude?(fn)
end
end
@@ -383,6 +383,13 @@ module Rake
def [](*args)
new(*args)
end
+
+ # Get a sorted list of files matching the pattern. This method
+ # should be prefered to Dir[pattern] and Dir.glob(pattern) because
+ # the files returned are guaranteed to be sorted.
+ def glob(pattern, *args)
+ Dir.glob(pattern, *args).sort
+ end
end
end
end
diff --git a/lib/rake/file_utils_ext.rb b/lib/rake/file_utils_ext.rb
index 557420df80..386af441d8 100644
--- a/lib/rake/file_utils_ext.rb
+++ b/lib/rake/file_utils_ext.rb
@@ -21,12 +21,13 @@ module Rake
$fileutils_verbose = true
$fileutils_nowrite = false
- FileUtils::OPT_TABLE.each do |name, opts|
+ FileUtils.commands.each do |name|
+ opts = FileUtils.options_of name
default_options = []
- if opts.include?(:verbose) || opts.include?("verbose")
+ if opts.include?("verbose")
default_options << ':verbose => FileUtilsExt.verbose_flag'
end
- if opts.include?(:noop) || opts.include?("noop")
+ if opts.include?("noop")
default_options << ':noop => FileUtilsExt.nowrite_flag'
end
diff --git a/lib/rake/multi_task.rb b/lib/rake/multi_task.rb
index 21c8de732f..5418a7a7b0 100644
--- a/lib/rake/multi_task.rb
+++ b/lib/rake/multi_task.rb
@@ -5,11 +5,8 @@ module Rake
#
class MultiTask < Task
private
- def invoke_prerequisites(args, invocation_chain)
- threads = @prerequisites.collect { |p|
- Thread.new(p) { |r| application[r, @scope].invoke_with_call_chain(args, invocation_chain) }
- }
- threads.each { |t| t.join }
+ def invoke_prerequisites(task_args, invocation_chain) # :nodoc:
+ invoke_prerequisites_concurrently(task_args, invocation_chain)
end
end
diff --git a/lib/rake/phony.rb b/lib/rake/phony.rb
new file mode 100644
index 0000000000..29633ae066
--- /dev/null
+++ b/lib/rake/phony.rb
@@ -0,0 +1,15 @@
+# Defines a :phony task that you can use as a dependency. This allows
+# file-based tasks to use non-file-based tasks as prerequisites
+# without forcing them to rebuild.
+#
+# See FileTask#out_of_date? and Task#timestamp for more info.
+
+require 'rake'
+
+task :phony
+
+Rake::Task[:phony].tap do |task|
+ def task.timestamp # :nodoc:
+ Time.at 0
+ end
+end
diff --git a/lib/rake/private_reader.rb b/lib/rake/private_reader.rb
new file mode 100644
index 0000000000..1620978576
--- /dev/null
+++ b/lib/rake/private_reader.rb
@@ -0,0 +1,20 @@
+module Rake
+
+ # Include PrivateReader to use +private_reader+.
+ module PrivateReader # :nodoc: all
+
+ def self.included(base)
+ base.extend(ClassMethods)
+ end
+
+ module ClassMethods
+
+ # Declare a list of private accessors
+ def private_reader(*names)
+ attr_reader(*names)
+ private(*names)
+ end
+ end
+
+ end
+end
diff --git a/lib/rake/promise.rb b/lib/rake/promise.rb
new file mode 100644
index 0000000000..3258b91139
--- /dev/null
+++ b/lib/rake/promise.rb
@@ -0,0 +1,99 @@
+module Rake
+
+ # A Promise object represents a promise to do work (a chore) in the
+ # future. The promise is created with a block and a list of
+ # arguments for the block. Calling value will return the value of
+ # the promised chore.
+ #
+ # Used by ThreadPool.
+ #
+ class Promise # :nodoc: all
+ NOT_SET = Object.new.freeze # :nodoc:
+
+ attr_accessor :recorder
+
+ # Create a promise to do the chore specified by the block.
+ def initialize(args, &block)
+ @mutex = Mutex.new
+ @result = NOT_SET
+ @error = NOT_SET
+ @args = args.collect { |a| begin; a.dup; rescue; a; end }
+ @block = block
+ end
+
+ # Return the value of this promise.
+ #
+ # If the promised chore is not yet complete, then do the work
+ # synchronously. We will wait.
+ def value
+ unless complete?
+ stat :sleeping_on, :item_id => object_id
+ @mutex.synchronize do
+ stat :has_lock_on, :item_id => object_id
+ chore
+ stat :releasing_lock_on, :item_id => object_id
+ end
+ end
+ error? ? raise(@error) : @result
+ end
+
+ # If no one else is working this promise, go ahead and do the chore.
+ def work
+ stat :attempting_lock_on, :item_id => object_id
+ if @mutex.try_lock
+ stat :has_lock_on, :item_id => object_id
+ chore
+ stat :releasing_lock_on, :item_id => object_id
+ @mutex.unlock
+ else
+ stat :bailed_on, :item_id => object_id
+ end
+ end
+
+ private
+
+ # Perform the chore promised
+ def chore
+ if complete?
+ stat :found_completed, :item_id => object_id
+ return
+ end
+ stat :will_execute, :item_id => object_id
+ begin
+ @result = @block.call(*@args)
+ rescue Exception => e
+ @error = e
+ end
+ stat :did_execute, :item_id => object_id
+ discard
+ end
+
+ # Do we have a result for the promise
+ def result?
+ ! @result.equal?(NOT_SET)
+ end
+
+ # Did the promise throw an error
+ def error?
+ ! @error.equal?(NOT_SET)
+ end
+
+ # Are we done with the promise
+ def complete?
+ result? || error?
+ end
+
+ # free up these items for the GC
+ def discard
+ @args = nil
+ @block = nil
+ end
+
+ # Record execution statistics if there is a recorder
+ def stat(*args)
+ @recorder.call(*args) if @recorder
+ end
+
+ end
+
+end
diff --git a/lib/rake/rake_module.rb b/lib/rake/rake_module.rb
index a9d210c637..fcf5800064 100644
--- a/lib/rake/rake_module.rb
+++ b/lib/rake/rake_module.rb
@@ -24,6 +24,14 @@ module Rake
def load_rakefile(path)
load(path)
end
+
+ # Add files to the rakelib list
+ def add_rakelib(*files)
+ application.options.rakelib ||= []
+ files.each do |file|
+ application.options.rakelib << file
+ end
+ end
end
end
diff --git a/lib/rake/rdoctask.rb b/lib/rake/rdoctask.rb
index b6ae224a9e..261fa69b4d 100644
--- a/lib/rake/rdoctask.rb
+++ b/lib/rake/rdoctask.rb
@@ -1,7 +1,7 @@
# rake/rdoctask is deprecated in favor of rdoc/task
if Rake.application
- Rake.application.deprecate('require \'rake/rdoctask\'', 'require \'rdoc/task\' (in RDoc 2.4.2+)', __FILE__)
+ Rake.application.deprecate('require \'rake/rdoctask\'', 'require \'rdoc/task\' (in RDoc 2.4.2+)', caller.first)
end
require 'rubygems'
diff --git a/lib/rake/ruby182_test_unit_fix.rb b/lib/rake/ruby182_test_unit_fix.rb
index 9e411ed51a..9e411ed51a 100755..100644
--- a/lib/rake/ruby182_test_unit_fix.rb
+++ b/lib/rake/ruby182_test_unit_fix.rb
diff --git a/lib/rake/runtest.rb b/lib/rake/runtest.rb
index 2b98a60cae..bd816ccfde 100644
--- a/lib/rake/runtest.rb
+++ b/lib/rake/runtest.rb
@@ -1,11 +1,12 @@
require 'test/unit'
require 'test/unit/assertions'
+require 'rake/file_list'
module Rake
include Test::Unit::Assertions
def run_tests(pattern='test/test*.rb', log_enabled=false)
- Dir["#{pattern}"].each { |fn|
+ FileList.glob(pattern).each { |fn|
$stderr.puts fn if log_enabled
begin
require fn
diff --git a/lib/rake/task.rb b/lib/rake/task.rb
index f977d18711..ac0ce68c60 100644
--- a/lib/rake/task.rb
+++ b/lib/rake/task.rb
@@ -105,7 +105,7 @@ module Rake
# Argument description (nil if none).
def arg_description # :nodoc:
- @arg_names ? "[#{(arg_names || []).join(',')}]" : nil
+ @arg_names ? "[#{arg_names.join(',')}]" : nil
end
# Name of arguments for this task.
@@ -123,6 +123,7 @@ module Rake
def clear
clear_prerequisites
clear_actions
+ clear_comments
self
end
@@ -138,6 +139,13 @@ module Rake
self
end
+ # Clear the existing comments on a rake task.
+ def clear_comments
+ @full_comment = nil
+ @comment = nil
+ self
+ end
+
# Invoke the task if it is needed. Prerequisites are invoked first.
def invoke(*args)
task_args = TaskArguments.new(arg_names, args)
@@ -150,7 +158,7 @@ module Rake
new_chain = InvocationChain.append(self, invocation_chain)
@lock.synchronize do
if application.options.trace
- $stderr.puts "** Invoke #{name} #{format_trace_flags}"
+ application.trace "** Invoke #{name} #{format_trace_flags}"
end
return if @already_invoked
@already_invoked = true
@@ -171,10 +179,25 @@ module Rake
# Invoke all the prerequisites of a task.
def invoke_prerequisites(task_args, invocation_chain) # :nodoc:
- prerequisite_tasks.each { |prereq|
- prereq_args = task_args.new_scope(prereq.arg_names)
- prereq.invoke_with_call_chain(prereq_args, invocation_chain)
- }
+ if application.options.always_multitask
+ invoke_prerequisites_concurrently(task_args, invocation_chain)
+ else
+ prerequisite_tasks.each { |p|
+ prereq_args = task_args.new_scope(p.arg_names)
+ p.invoke_with_call_chain(prereq_args, invocation_chain)
+ }
+ end
+ end
+
+ # Invoke all the prerequisites of a task in parallel.
+ def invoke_prerequisites_concurrently(task_args, invocation_chain) # :nodoc:
+ futures = prerequisite_tasks.collect do |p|
+ prereq_args = task_args.new_scope(p.arg_names)
+ application.thread_pool.future(p) do |r|
+ r.invoke_with_call_chain(prereq_args, invocation_chain)
+ end
+ end
+ futures.each { |f| f.value }
end
# Format the trace flags for display.
@@ -190,11 +213,11 @@ module Rake
def execute(args=nil)
args ||= EMPTY_TASK_ARGS
if application.options.dryrun
- $stderr.puts "** Execute (dry run) #{name}"
+ application.trace "** Execute (dry run) #{name}"
return
end
if application.options.trace
- $stderr.puts "** Execute #{name}"
+ application.trace "** Execute #{name}"
end
application.enhance_with_matching_rule(name) if @actions.empty?
@actions.each do |act|
diff --git a/lib/rake/task_arguments.rb b/lib/rake/task_arguments.rb
index 02d01b99f9..4417af2f8e 100644
--- a/lib/rake/task_arguments.rb
+++ b/lib/rake/task_arguments.rb
@@ -47,7 +47,7 @@ module Rake
keys.map { |k| lookup(k) }
end
- def method_missing(sym, *args, &block)
+ def method_missing(sym, *args)
lookup(sym.to_sym)
end
diff --git a/lib/rake/task_manager.rb b/lib/rake/task_manager.rb
index 4c3c26aa3a..5a9419d536 100644
--- a/lib/rake/task_manager.rb
+++ b/lib/rake/task_manager.rb
@@ -238,7 +238,7 @@ module Rake
end
def trace_rule(level, message)
- $stderr.puts "#{" "*level}#{message}" if Rake.application.options.trace_rules
+ options.trace_output.puts "#{" "*level}#{message}" if Rake.application.options.trace_rules
end
# Attempt to create a rule given the list of prerequisites.
diff --git a/lib/rake/testtask.rb b/lib/rake/testtask.rb
index 04d3ae473a..19592d80c8 100644
--- a/lib/rake/testtask.rb
+++ b/lib/rake/testtask.rb
@@ -96,7 +96,14 @@ module Rake
desc "Run tests" + (@name==:test ? "" : " for #{@name}")
task @name do
FileUtilsExt.verbose(@verbose) do
- ruby "#{ruby_opts_string} #{run_code} #{file_list_string} #{option_list}"
+ args = "#{ruby_opts_string} #{run_code} #{file_list_string} #{option_list}"
+ ruby args do |ok, status|
+ if !ok && status.respond_to?(:signaled?) && status.signaled?
+ raise SignalException.new(status.termsig)
+ elsif !ok
+ fail "Command failed with status (#{status.exitstatus}): [ruby #{args}]"
+ end
+ end
end
end
self
diff --git a/lib/rake/thread_history_display.rb b/lib/rake/thread_history_display.rb
new file mode 100644
index 0000000000..917e951064
--- /dev/null
+++ b/lib/rake/thread_history_display.rb
@@ -0,0 +1,48 @@
+require 'rake/private_reader'
+
+module Rake
+
+ class ThreadHistoryDisplay # :nodoc: all
+ include Rake::PrivateReader
+
+ private_reader :stats, :items, :threads
+
+ def initialize(stats)
+ @stats = stats
+ @items = { :_seq_ => 1 }
+ @threads = { :_seq_ => "A" }
+ end
+
+ def show
+ puts "Job History:"
+ stats.each do |stat|
+ stat[:data] ||= {}
+ rename(stat, :thread, threads)
+ rename(stat[:data], :item_id, items)
+ rename(stat[:data], :new_thread, threads)
+ rename(stat[:data], :deleted_thread, threads)
+ printf("%8d %2s %-20s %s\n",
+ (stat[:time] * 1_000_000).round,
+ stat[:thread],
+ stat[:event],
+ stat[:data].map { |k,v| "#{k}:#{v}" }.join(" "))
+ end
+ end
+
+ private
+
+ def rename(hash, key, renames)
+ if hash && hash[key]
+ original = hash[key]
+ value = renames[original]
+ unless value
+ value = renames[:_seq_]
+ renames[:_seq_] = renames[:_seq_].succ
+ renames[original] = value
+ end
+ hash[key] = value
+ end
+ end
+ end
+
+end
diff --git a/lib/rake/thread_pool.rb b/lib/rake/thread_pool.rb
new file mode 100644
index 0000000000..983a67a514
--- /dev/null
+++ b/lib/rake/thread_pool.rb
@@ -0,0 +1,155 @@
+require 'thread'
+require 'set'
+
+require 'rake/promise'
+
+module Rake
+
+ class ThreadPool # :nodoc: all
+
+ # Creates a ThreadPool object.
+ # The parameter is the size of the pool.
+ def initialize(thread_count)
+ @max_active_threads = [thread_count, 0].max
+ @threads = Set.new
+ @threads_mon = Monitor.new
+ @queue = Queue.new
+ @join_cond = @threads_mon.new_cond
+
+ @history_start_time = nil
+ @history = []
+ @history_mon = Monitor.new
+ @total_threads_in_play = 0
+ end
+
+ # Creates a future executed by the +ThreadPool+.
+ #
+ # The args are passed to the block when executing (similarly to
+ # <tt>Thread#new</tt>) The return value is an object representing
+ # a future which has been created and added to the queue in the
+ # pool. Sending <tt>#value</tt> to the object will sleep the
+ # current thread until the future is finished and will return the
+ # result (or raise an exception thrown from the future)
+ def future(*args, &block)
+ promise = Promise.new(args, &block)
+ promise.recorder = lambda { |*stats| stat(*stats) }
+
+ @queue.enq promise
+ stat :queued, :item_id => promise.object_id
+ start_thread
+ promise
+ end
+
+ # Waits until the queue of futures is empty and all threads have exited.
+ def join
+ @threads_mon.synchronize do
+ begin
+ stat :joining
+ @join_cond.wait unless @threads.empty?
+ stat :joined
+ rescue Exception => e
+ stat :joined
+ $stderr.puts e
+ $stderr.print "Queue contains #{@queue.size} items. Thread pool contains #{@threads.count} threads\n"
+ $stderr.print "Current Thread #{Thread.current} status = #{Thread.current.status}\n"
+ $stderr.puts e.backtrace.join("\n")
+ @threads.each do |t|
+ $stderr.print "Thread #{t} status = #{t.status}\n"
+ # 1.8 doesn't support Thread#backtrace
+ $stderr.puts t.backtrace.join("\n") if t.respond_to? :backtrace
+ end
+ raise e
+ end
+ end
+ end
+
+ # Enable the gathering of history events.
+ def gather_history #:nodoc:
+ @history_start_time = Time.now if @history_start_time.nil?
+ end
+
+ # Return a array of history events for the thread pool.
+ #
+ # History gathering must be enabled to be able to see the events
+ # (see #gather_history). Best to call this when the job is
+ # complete (i.e. after ThreadPool#join is called).
+ def history # :nodoc:
+ @history_mon.synchronize { @history.dup }.
+ sort_by { |i| i[:time] }.
+ each { |i| i[:time] -= @history_start_time }
+ end
+
+ # Return a hash of always collected statistics for the thread pool.
+ def statistics # :nodoc:
+ {
+ :total_threads_in_play => @total_threads_in_play,
+ :max_active_threads => @max_active_threads,
+ }
+ end
+
+ private
+
+ # processes one item on the queue. Returns true if there was an
+ # item to process, false if there was no item
+ def process_queue_item #:nodoc:
+ return false if @queue.empty?
+
+ # Even though we just asked if the queue was empty, it
+ # still could have had an item which by this statement
+ # is now gone. For this reason we pass true to Queue#deq
+ # because we will sleep indefinitely if it is empty.
+ promise = @queue.deq(true)
+ stat :dequeued, :item_id => promise.object_id
+ promise.work
+ return true
+
+ rescue ThreadError # this means the queue is empty
+ false
+ end
+
+ def start_thread # :nodoc:
+ @threads_mon.synchronize do
+ next unless @threads.count < @max_active_threads
+
+ t = Thread.new do
+ begin
+ while @threads.count <= @max_active_threads
+ break unless process_queue_item
+ end
+ ensure
+ @threads_mon.synchronize do
+ @threads.delete Thread.current
+ stat :ended, :thread_count => @threads.count
+ @join_cond.broadcast if @threads.empty?
+ end
+ end
+ end
+ @threads << t
+ stat :spawned, :new_thread => t.object_id, :thread_count => @threads.count
+ @total_threads_in_play = @threads.count if @threads.count > @total_threads_in_play
+ end
+ end
+
+ def stat(event, data=nil) # :nodoc:
+ return if @history_start_time.nil?
+ info = {
+ :event => event,
+ :data => data,
+ :time => Time.now,
+ :thread => Thread.current.object_id,
+ }
+ @history_mon.synchronize { @history << info }
+ end
+
+ # for testing only
+
+ def __queue__ # :nodoc:
+ @queue
+ end
+
+ def __threads__ # :nodoc:
+ @threads.dup
+ end
+ end
+
+end
diff --git a/lib/rake/trace_output.rb b/lib/rake/trace_output.rb
new file mode 100644
index 0000000000..e4d61cfb93
--- /dev/null
+++ b/lib/rake/trace_output.rb
@@ -0,0 +1,19 @@
+module Rake
+ module TraceOutput
+
+ # Write trace output to output stream +out+.
+ #
+ # The write is done as a single IO call (to print) to lessen the
+ # chance that the trace output is interrupted by other tasks also
+ # producing output.
+ def trace_on(out, *strings)
+ sep = $\ || "\n"
+ if strings.empty?
+ output = sep
+ else
+ output = strings.map { |s| s.end_with?(sep) ? s : s + sep }.join
+ end
+ out.print(output)
+ end
+ end
+end
diff --git a/lib/rake/version.rb b/lib/rake/version.rb
index 3afad7f25a..410afa82cf 100644
--- a/lib/rake/version.rb
+++ b/lib/rake/version.rb
@@ -1,8 +1,13 @@
module Rake
- VERSION = '0.9.2.1'
+ VERSION = '0.9.5'
module Version # :nodoc: all
- MAJOR, MINOR, BUILD = VERSION.split '.'
- NUMBERS = [ MAJOR, MINOR, BUILD ]
+ MAJOR, MINOR, BUILD, = Rake::VERSION.split '.'
+
+ NUMBERS = [
+ MAJOR,
+ MINOR,
+ BUILD,
+ ]
end
end
diff --git a/lib/rbconfig/obsolete.rb b/lib/rbconfig/obsolete.rb
index eae9155af6..8669186083 100644
--- a/lib/rbconfig/obsolete.rb
+++ b/lib/rbconfig/obsolete.rb
@@ -1,5 +1,38 @@
-loc = caller[0]
-loc = loc[/\A.*:\d+:/] if loc
-loc = "#{loc} " if loc
-warn "#{loc}Use RbConfig instead of obsolete and deprecated Config."
-Config = RbConfig # compatibility for ruby-1.8.4 and older.
+module ::RbConfig
+ module Obsolete
+ end
+ class << Obsolete
+ def _warn_
+ loc, = caller_locations(2, 1)
+ loc = "#{loc.to_s}: " if loc
+ warn "#{loc}Use RbConfig instead of obsolete and deprecated Config."
+ self
+ end
+
+ def const_missing(name)
+ _warn_
+ ::RbConfig.const_get(name)
+ end
+
+ def method_missing(*args, &block)
+ _warn_
+ rbconfig = ::RbConfig
+ result = rbconfig.__send__(*args, &block)
+ result = rbconfig if rbconfig.equal?(result)
+ result
+ end
+
+ def respond_to_missing?(*args, &block)
+ _warn_
+ ::RbConfig.respond_to_missing?(*args, &block)
+ end
+ end
+end
+
+::Config = ::RbConfig::Obsolete._warn_
+=begin
+def Object.const_missing(name)
+ return super unless name == :Config
+ ::RbConfig::Obsolete._warn_
+end
+=end
diff --git a/lib/rdoc.rb b/lib/rdoc.rb
index 187b7d4d51..23b63bb8e5 100644
--- a/lib/rdoc.rb
+++ b/lib/rdoc.rb
@@ -1,86 +1,55 @@
$DEBUG_RDOC = nil
-# :main: README.txt
+# :main: README.rdoc
##
-# RDoc is a Ruby documentation system which contains RDoc::RDoc for generating
-# documentation, RDoc::RI for interactive documentation and RDoc::Markup for
-# text markup.
+# RDoc produces documentation for Ruby source files by parsing the source and
+# extracting the definition for classes, modules, methods, includes and
+# requires. It associates these with optional documentation contained in an
+# immediately preceding comment block then renders the result using an output
+# formatter.
#
-# RDoc::RDoc produces documentation for Ruby source files. It works similarly
-# to JavaDoc, parsing the source and extracting the definition for classes,
-# modules, methods, includes and requires. It associates these with optional
-# documentation contained in an immediately preceding comment block then
-# renders the result using an output formatter.
-#
-# RDoc::Markup that converts plain text into various output formats. The
-# markup library is used to interpret the comment blocks that RDoc uses to
-# document methods, classes, and so on.
-#
-# RDoc::RI implements the +ri+ command-line tool which displays on-line
-# documentation for ruby classes, methods, etc. +ri+ features several output
-# formats and an interactive mode (<tt>ri -i</tt>). See <tt>ri --help</tt>
-# for further details.
+# For a simple introduction to writing or generating documentation using RDoc
+# see the README.
#
# == Roadmap
#
-# * If you want to use RDoc to create documentation for your Ruby source files,
-# see RDoc::Markup and refer to <tt>rdoc --help</tt> for command line
-# usage.
-# * If you want to write documentation for Ruby files see RDoc::Parser::Ruby
-# * If you want to write documentation for extensions written in C see
-# RDoc::Parser::C
-# * If you want to generate documentation using <tt>rake</tt> see RDoc::Task.
-# * If you want to drive RDoc programmatically, see RDoc::RDoc.
-# * If you want to use the library to format text blocks into HTML, look at
-# RDoc::Markup.
-# * If you want to make an RDoc plugin such as a generator or directive
-# handler see RDoc::RDoc.
-# * If you want to write your own output generator see RDoc::Generator.
-#
-# == Summary
+# If you think you found a bug in RDoc see DEVELOPERS@Bugs
#
-# Once installed, you can create documentation using the +rdoc+ command
+# If you want to use RDoc to create documentation for your Ruby source files,
+# see RDoc::Markup and refer to <tt>rdoc --help</tt> for command line usage.
#
-# % rdoc [options] [names...]
+# If you want to set the default markup format see
+# RDoc::Markup@Supported+Formats
#
-# For an up-to-date option summary, type
+# If you want to store rdoc configuration in your gem (such as the default
+# markup format) see RDoc::Options@Saved+Options
#
-# % rdoc --help
+# If you want to write documentation for Ruby files see RDoc::Parser::Ruby
#
-# A typical use might be to generate documentation for a package of Ruby
-# source (such as RDoc itself).
+# If you want to write documentation for extensions written in C see
+# RDoc::Parser::C
#
-# % rdoc
+# If you want to generate documentation using <tt>rake</tt> see RDoc::Task.
#
-# This command generates documentation for all the Ruby and C source
-# files in and below the current directory. These will be stored in a
-# documentation tree starting in the subdirectory +doc+.
+# If you want to drive RDoc programmatically, see RDoc::RDoc.
#
-# You can make this slightly more useful for your readers by having the
-# index page contain the documentation for the primary file. In our
-# case, we could type
+# If you want to use the library to format text blocks into HTML or other
+# formats, look at RDoc::Markup.
#
-# % rdoc --main README.txt
+# If you want to make an RDoc plugin such as a generator or directive handler
+# see RDoc::RDoc.
#
-# You'll find information on the various formatting tricks you can use
-# in comment blocks in the documentation this generates.
+# If you want to write your own output generator see RDoc::Generator.
#
-# RDoc uses file extensions to determine how to process each file. File names
-# ending +.rb+ and +.rbw+ are assumed to be Ruby source. Files
-# ending +.c+ are parsed as C files. All other files are assumed to
-# contain just Markup-style markup (with or without leading '#' comment
-# markers). If directory names are passed to RDoc, they are scanned
-# recursively for C and Ruby source files only.
+# If you want an overview of how RDoc works see DEVELOPERS
#
-# == Other stuff
+# == Credits
#
# RDoc is currently being maintained by Eric Hodel <drbrain@segment7.net>.
#
# Dave Thomas <dave@pragmaticprogrammer.com> is the original author of RDoc.
#
-# == Credits
-#
# * The Ruby parser in rdoc/parse.rb is based heavily on the outstanding
# work of Keiju ISHITSUKA of Nippon Rational Inc, who produced the Ruby
# parser for irb and the rtags package.
@@ -92,19 +61,10 @@ module RDoc
class Error < RuntimeError; end
- def self.const_missing const_name # :nodoc:
- if const_name.to_s == 'RDocError' then
- warn "RDoc::RDocError is deprecated"
- return Error
- end
-
- super
- end
-
##
# RDoc version you are using
- VERSION = '3.8'
+ VERSION = '4.0.0.preview2'
##
# Method visibilities
@@ -143,5 +103,80 @@ module RDoc
METHOD_MODIFIERS = GENERAL_MODIFIERS +
%w[arg args yield yields notnew not-new not_new doc]
+ ##
+ # Loads the best available YAML library.
+
+ def self.load_yaml
+ begin
+ gem 'psych'
+ rescue Gem::LoadError
+ end
+
+ begin
+ require 'psych'
+ rescue ::LoadError
+ ensure
+ require 'yaml'
+ end
+ end
+
+ autoload :RDoc, 'rdoc/rdoc'
+
+ autoload :TestCase, 'rdoc/test_case'
+
+ autoload :CrossReference, 'rdoc/cross_reference'
+ autoload :ERBIO, 'rdoc/erbio'
+ autoload :ERBPartial, 'rdoc/erb_partial'
+ autoload :Encoding, 'rdoc/encoding'
+ autoload :Generator, 'rdoc/generator'
+ autoload :Options, 'rdoc/options'
+ autoload :Parser, 'rdoc/parser'
+ autoload :Servlet, 'rdoc/servlet'
+ autoload :RI, 'rdoc/ri'
+ autoload :Stats, 'rdoc/stats'
+ autoload :Store, 'rdoc/store'
+ autoload :Task, 'rdoc/task'
+ autoload :Text, 'rdoc/text'
+
+ autoload :Markdown, 'rdoc/markdown'
+ autoload :Markup, 'rdoc/markup'
+ autoload :RD, 'rdoc/rd'
+ autoload :TomDoc, 'rdoc/tom_doc'
+
+ autoload :KNOWN_CLASSES, 'rdoc/known_classes'
+
+ autoload :RubyLex, 'rdoc/ruby_lex'
+ autoload :RubyToken, 'rdoc/ruby_token'
+ autoload :TokenStream, 'rdoc/token_stream'
+
+ autoload :Comment, 'rdoc/comment'
+
+ # code objects
+ #
+ # We represent the various high-level code constructs that appear in Ruby
+ # programs: classes, modules, methods, and so on.
+ autoload :CodeObject, 'rdoc/code_object'
+
+ autoload :Context, 'rdoc/context'
+ autoload :TopLevel, 'rdoc/top_level'
+
+ autoload :AnonClass, 'rdoc/anon_class'
+ autoload :ClassModule, 'rdoc/class_module'
+ autoload :NormalClass, 'rdoc/normal_class'
+ autoload :NormalModule, 'rdoc/normal_module'
+ autoload :SingleClass, 'rdoc/single_class'
+
+ autoload :Alias, 'rdoc/alias'
+ autoload :AnyMethod, 'rdoc/any_method'
+ autoload :MethodAttr, 'rdoc/method_attr'
+ autoload :GhostMethod, 'rdoc/ghost_method'
+ autoload :MetaMethod, 'rdoc/meta_method'
+ autoload :Attr, 'rdoc/attr'
+
+ autoload :Constant, 'rdoc/constant'
+ autoload :Include, 'rdoc/include'
+ autoload :Extend, 'rdoc/extend'
+ autoload :Require, 'rdoc/require'
+
end
diff --git a/lib/rdoc/alias.rb b/lib/rdoc/alias.rb
index fa433dc0a9..39d2694817 100644
--- a/lib/rdoc/alias.rb
+++ b/lib/rdoc/alias.rb
@@ -1,5 +1,3 @@
-require 'rdoc/code_object'
-
##
# Represent an alias, which is an old_name/new_name pair associated with a
# particular context
diff --git a/lib/rdoc/anon_class.rb b/lib/rdoc/anon_class.rb
index 63c09e11f1..c23d8e5d96 100644
--- a/lib/rdoc/anon_class.rb
+++ b/lib/rdoc/anon_class.rb
@@ -1,5 +1,3 @@
-require 'rdoc/class_module'
-
##
# An anonymous class like:
#
diff --git a/lib/rdoc/any_method.rb b/lib/rdoc/any_method.rb
index c008edfe95..b32690aa7d 100644
--- a/lib/rdoc/any_method.rb
+++ b/lib/rdoc/any_method.rb
@@ -1,12 +1,16 @@
-require 'rdoc/method_attr'
-require 'rdoc/token_stream'
-
##
# AnyMethod is the base class for objects representing methods
class RDoc::AnyMethod < RDoc::MethodAttr
- MARSHAL_VERSION = 1 # :nodoc:
+ ##
+ # 2::
+ # RDoc 4
+ # Added calls_super
+ # Added parent name and class
+ # Added section title
+
+ MARSHAL_VERSION = 2 # :nodoc:
##
# Don't rename \#initialize to \::new
@@ -28,6 +32,11 @@ class RDoc::AnyMethod < RDoc::MethodAttr
attr_accessor :params
+ ##
+ # If true this method uses +super+ to call a superclass version
+
+ attr_accessor :calls_super
+
include RDoc::TokenStream
##
@@ -39,6 +48,8 @@ class RDoc::AnyMethod < RDoc::MethodAttr
@c_function = nil
@dont_rename_initialize = false
@token_stream = nil
+ @calls_super = false
+ @superclass_method = nil
end
##
@@ -96,7 +107,11 @@ class RDoc::AnyMethod < RDoc::MethodAttr
@block_params,
aliases,
@params,
- @file.absolute_name,
+ @file.relative_name,
+ @calls_super,
+ @parent.name,
+ @parent.class,
+ @section.title,
]
end
@@ -107,34 +122,44 @@ class RDoc::AnyMethod < RDoc::MethodAttr
# * #full_name
# * #parent_name
- def marshal_load(array)
+ def marshal_load array
@dont_rename_initialize = nil
@is_alias_for = nil
@token_stream = nil
@aliases = []
-
- version = array[0]
- @name = array[1]
- @full_name = array[2]
- @singleton = array[3]
- @visibility = array[4]
- @comment = array[5]
- @call_seq = array[6]
- @block_params = array[7]
+ @parent = nil
+ @parent_name = nil
+ @parent_class = nil
+ @section = nil
+ @file = nil
+
+ version = array[0]
+ @name = array[1]
+ @full_name = array[2]
+ @singleton = array[3]
+ @visibility = array[4]
+ @comment = array[5]
+ @call_seq = array[6]
+ @block_params = array[7]
+ # 8 handled below
+ @params = array[9]
+ # 10 handled below
+ @calls_super = array[11]
+ @parent_name = array[12]
+ @parent_title = array[13]
+ @section_title = array[14]
array[8].each do |new_name, comment|
add_alias RDoc::Alias.new(nil, @name, new_name, comment, @singleton)
end
- @params = array[9]
-
- @parent_name = if @full_name =~ /#/ then
- $`
- else
- name = @full_name.split('::')
- name.pop
- name.join '::'
- end
+ @parent_name ||= if @full_name =~ /#/ then
+ $`
+ else
+ name = @full_name.split('::')
+ name.pop
+ name.join '::'
+ end
@file = RDoc::TopLevel.new array[10] if version > 0
end
@@ -169,7 +194,9 @@ class RDoc::AnyMethod < RDoc::MethodAttr
return []
end
- params.gsub(/\s+/, '').split ','
+ params = params.gsub(/\s+/, '').split ','
+
+ params.map { |param| param.sub(/=.*/, '') }
end
##
@@ -181,10 +208,12 @@ class RDoc::AnyMethod < RDoc::MethodAttr
params = @call_seq.split("\n").last
params = params.sub(/[^( ]+/, '')
params = params.sub(/(\|[^|]+\|)\s*\.\.\.\s*(end|\})/, '\1 \2')
- else
+ elsif @params then
params = @params.gsub(/\s*\#.*/, '')
params = params.tr("\n", " ").squeeze(" ")
params = "(#{params})" unless params[0] == ?(
+ else
+ params = ''
end
if @block_params then
@@ -203,5 +232,31 @@ class RDoc::AnyMethod < RDoc::MethodAttr
params
end
+ ##
+ # Sets the store for this method and its referenced code objects.
+
+ def store= store
+ super
+
+ @file = @store.add_file @file.full_name if @file
+ end
+
+ ##
+ # For methods that +super+, find the superclass method that would be called.
+
+ def superclass_method
+ return unless @calls_super
+ return @superclass_method if @superclass_method
+
+ parent.each_ancestor do |ancestor|
+ if method = ancestor.method_list.find { |m| m.name == @name } then
+ @superclass_method = method
+ break
+ end
+ end
+
+ @superclass_method
+ end
+
end
diff --git a/lib/rdoc/attr.rb b/lib/rdoc/attr.rb
index 5d9bc17831..155215ff99 100644
--- a/lib/rdoc/attr.rb
+++ b/lib/rdoc/attr.rb
@@ -1,12 +1,16 @@
-require 'rdoc/method_attr'
-
##
# An attribute created by \#attr, \#attr_reader, \#attr_writer or
# \#attr_accessor
class RDoc::Attr < RDoc::MethodAttr
- MARSHAL_VERSION = 2 # :nodoc:
+ ##
+ # 3::
+ # RDoc 4
+ # Added parent name and class
+ # Added section title
+
+ MARSHAL_VERSION = 3 # :nodoc:
##
# Is the attribute readable ('R'), writable ('W') or both ('RW')?
@@ -58,6 +62,16 @@ class RDoc::Attr < RDoc::MethodAttr
end
##
+ # Attributes never call super. See RDoc::AnyMethod#calls_super
+ #
+ # An RDoc::Attr can show up in the method list in some situations (see
+ # Gem::ConfigFile)
+
+ def calls_super # :nodoc:
+ false
+ end
+
+ ##
# Returns attr_reader, attr_writer or attr_accessor as appropriate.
def definition
@@ -92,7 +106,10 @@ class RDoc::Attr < RDoc::MethodAttr
@visibility,
parse(@comment),
singleton,
- @file.absolute_name,
+ @file.relative_name,
+ @parent.full_name,
+ @parent.class,
+ @section.title
]
end
@@ -104,17 +121,28 @@ class RDoc::Attr < RDoc::MethodAttr
# * #parent_name
def marshal_load array
- version = array[0]
- @name = array[1]
- @full_name = array[2]
- @rw = array[3]
- @visibility = array[4]
- @comment = array[5]
- @singleton = array[6] || false # MARSHAL_VERSION == 0
+ @aliases = []
+ @parent = nil
+ @parent_name = nil
+ @parent_class = nil
+ @section = nil
+ @file = nil
+
+ version = array[0]
+ @name = array[1]
+ @full_name = array[2]
+ @rw = array[3]
+ @visibility = array[4]
+ @comment = array[5]
+ @singleton = array[6] || false # MARSHAL_VERSION == 0
+ # 7 handled below
+ @parent_name = array[8]
+ @parent_class = array[9]
+ @section_title = array[10]
@file = RDoc::TopLevel.new array[7] if version > 1
- @parent_name = @full_name
+ @parent_name ||= @full_name.split('#', 2).first
end
def pretty_print q # :nodoc:
@@ -132,5 +160,14 @@ class RDoc::Attr < RDoc::MethodAttr
"#{definition} #{name} in: #{parent}"
end
+ ##
+ # Attributes do not have token streams.
+ #
+ # An RDoc::Attr can show up in the method list in some situations (see
+ # Gem::ConfigFile)
+
+ def token_stream # :nodoc:
+ end
+
end
diff --git a/lib/rdoc/class_module.rb b/lib/rdoc/class_module.rb
index e104101dcc..e2bb9de68d 100644
--- a/lib/rdoc/class_module.rb
+++ b/lib/rdoc/class_module.rb
@@ -1,5 +1,3 @@
-require 'rdoc/context'
-
##
# ClassModule is the base class for objects representing either a class or a
# module.
@@ -13,8 +11,17 @@ class RDoc::ClassModule < RDoc::Context
# * Added file to constants
# * Added file to includes
# * Added file to methods
-
- MARSHAL_VERSION = 1 # :nodoc:
+ # 2::
+ # RDoc 3.13
+ # * Added extends
+ # 3::
+ # RDoc 4.0
+ # * Added sections
+ # * Added in_files
+ # * Added parent name
+ # * Complete Constant dump
+
+ MARSHAL_VERSION = 3 # :nodoc:
##
# Constants that are aliases for this class or module
@@ -56,6 +63,7 @@ class RDoc::ClassModule < RDoc::Context
klass.external_aliases.concat mod.external_aliases
klass.constants.concat mod.constants
klass.includes.concat mod.includes
+ klass.extends.concat mod.extends
klass.methods_hash.update mod.methods_hash
klass.constants_hash.update mod.constants_hash
@@ -84,6 +92,7 @@ class RDoc::ClassModule < RDoc::Context
klass.external_aliases +
klass.constants +
klass.includes +
+ klass.extends +
klass.classes +
klass.modules).each do |obj|
obj.parent = klass
@@ -115,16 +124,32 @@ class RDoc::ClassModule < RDoc::Context
# across multiple runs.
def add_comment comment, location
- return if comment.empty? or not document_self
+ return unless document_self
original = comment
- comment = normalize_comment comment
+ comment = case comment
+ when RDoc::Comment then
+ comment.normalize
+ else
+ normalize_comment comment
+ end
@comment_location << [comment, location]
self.comment = original
end
+ def add_things my_things, other_things # :nodoc:
+ other_things.each do |group, things|
+ my_things[group].each { |thing| yield false, thing } if
+ my_things.include? group
+
+ things.each do |thing|
+ yield true, thing
+ end
+ end
+ end
+
##
# Ancestors list for this ClassModule: the list of included modules
# (classes will add their superclass if any).
@@ -142,6 +167,11 @@ class RDoc::ClassModule < RDoc::Context
end
##
+ # Ancestors of this class or module only
+
+ alias direct_ancestors ancestors
+
+ ##
# Clears the comment. Used by the ruby parser.
def clear_comment
@@ -155,9 +185,13 @@ class RDoc::ClassModule < RDoc::Context
# more like <tt>+=</tt>.
def comment= comment
- return if comment.empty?
+ comment = case comment
+ when RDoc::Comment then
+ comment.normalize
+ else
+ normalize_comment comment
+ end
- comment = normalize_comment comment
comment = "#{@comment}\n---\n#{comment}" unless @comment.empty?
super comment
@@ -166,7 +200,7 @@ class RDoc::ClassModule < RDoc::Context
##
# Prepares this ClassModule for use by a generator.
#
- # See RDoc::TopLevel::complete
+ # See RDoc::Store#complete
def complete min_visibility
update_aliases
@@ -176,12 +210,22 @@ class RDoc::ClassModule < RDoc::Context
end
##
+ # Does this ClassModule or any of its methods have document_self set?
+
+ def document_self_or_methods
+ document_self || method_list.any?{ |m| m.document_self }
+ end
+
+ ##
# Iterates the ancestors of this class or module for which an
# RDoc::ClassModule exists.
def each_ancestor # :yields: module
+ return enum_for __method__ unless block_given?
+
ancestors.each do |mod|
next if String === mod
+ next if self == mod
yield mod
end
end
@@ -215,13 +259,16 @@ class RDoc::ClassModule < RDoc::Context
# Return the fully qualified name of this class or module
def full_name
- @full_name ||= if RDoc::ClassModule === @parent then
- "#{@parent.full_name}::#{@name}"
+ @full_name ||= if RDoc::ClassModule === parent then
+ "#{parent.full_name}::#{@name}"
else
@name
end
end
+ ##
+ # TODO: filter included items by #display?
+
def marshal_dump # :nodoc:
attrs = attributes.sort.map do |attr|
[ attr.name, attr.rw,
@@ -247,13 +294,20 @@ class RDoc::ClassModule < RDoc::Context
@superclass,
parse(@comment_location),
attrs,
- constants.map do |const|
- [const.name, parse(const.comment), const.file_name]
- end,
+ constants,
includes.map do |incl|
[incl.name, parse(incl.comment), incl.file_name]
end,
method_types,
+ extends.map do |ext|
+ [ext.name, parse(ext.comment), ext.file_name]
+ end,
+ @sections.values,
+ @in_files.map do |tl|
+ tl.relative_name
+ end,
+ parent.full_name,
+ parent.class,
]
end
@@ -265,6 +319,8 @@ class RDoc::ClassModule < RDoc::Context
@parent = nil
@temporary_section = nil
@visibility = nil
+ @classes = {}
+ @modules = {}
@name = array[1]
@full_name = array[2]
@@ -288,9 +344,14 @@ class RDoc::ClassModule < RDoc::Context
attr.record_location RDoc::TopLevel.new file
end
- array[6].each do |name, comment, file|
- const = add_constant RDoc::Constant.new(name, nil, comment)
- const.record_location RDoc::TopLevel.new file
+ array[6].each do |constant, comment, file|
+ case constant
+ when RDoc::Constant then
+ add_constant constant
+ else
+ constant = add_constant RDoc::Constant.new(constant, nil, comment)
+ constant.record_location RDoc::TopLevel.new file
+ end
end
array[7].each do |name, comment, file|
@@ -310,6 +371,27 @@ class RDoc::ClassModule < RDoc::Context
end
end
end
+
+ array[9].each do |name, comment, file|
+ ext = add_extend RDoc::Extend.new(name, comment)
+ ext.record_location RDoc::TopLevel.new file
+ end if array[9] # Support Marshal version 1
+
+ sections = (array[10] || []).map do |section|
+ [section.title, section]
+ end
+
+ @sections = Hash[*sections.flatten]
+ @current_section = add_section nil
+
+ @in_files = []
+
+ (array[11] || []).each do |filename|
+ record_location RDoc::TopLevel.new filename
+ end
+
+ @parent_name = array[12]
+ @parent_class = array[13]
end
##
@@ -318,6 +400,9 @@ class RDoc::ClassModule < RDoc::Context
# The data in +class_module+ is preferred over the receiver.
def merge class_module
+ @parent = class_module.parent
+ @parent_name = class_module.parent_name
+
other_document = parse class_module.comment_location
if other_document then
@@ -357,6 +442,18 @@ class RDoc::ClassModule < RDoc::Context
end
end
+ @includes.uniq! # clean up
+
+ merge_collections extends, cm.extends, other_files do |add, ext|
+ if add then
+ add_extend ext
+ else
+ @extends.delete ext
+ end
+ end
+
+ @extends.uniq! # clean up
+
merge_collections method_list, cm.method_list, other_files do |add, meth|
if add then
add_method meth
@@ -366,6 +463,8 @@ class RDoc::ClassModule < RDoc::Context
end
end
+ merge_sections cm
+
self
end
@@ -388,22 +487,46 @@ class RDoc::ClassModule < RDoc::Context
my_things = mine. group_by { |thing| thing.file }
other_things = other.group_by { |thing| thing.file }
- my_things.delete_if do |file, things|
- next false unless other_files.include? file
+ remove_things my_things, other_files, &block
+ add_things my_things, other_things, &block
+ end
- things.each do |thing|
- yield false, thing
- end
+ ##
+ # Merges the comments in this ClassModule with the comments in the other
+ # ClassModule +cm+.
- true
+ def merge_sections cm # :nodoc:
+ my_sections = sections.group_by { |section| section.title }
+ other_sections = cm.sections.group_by { |section| section.title }
+
+ other_files = cm.in_files
+
+ remove_things my_sections, other_files do |_, section|
+ @sections.delete section.title
end
- other_things.each do |file, things|
- my_things[file].each { |thing| yield false, thing } if
- my_things.include?(file)
+ other_sections.each do |group, sections|
+ if my_sections.include? group
+ my_sections[group].each do |my_section|
+ other_section = cm.sections_hash[group]
- things.each do |thing|
- yield true, thing
+ my_comments = my_section.comments
+ other_comments = other_section.comments
+
+ other_files = other_section.in_files
+
+ merge_collections my_comments, other_comments, other_files do |add, comment|
+ if add then
+ my_section.add_comment comment
+ else
+ my_section.remove_comment comment
+ end
+ end
+ end
+ else
+ sections.each do |section|
+ add_section group, section.comments
+ end
end
end
end
@@ -435,11 +558,15 @@ class RDoc::ClassModule < RDoc::Context
when Array then
docs = comment_location.map do |comment, location|
doc = super comment
- doc.file = location.absolute_name
+ doc.file = location
doc
end
RDoc::Markup::Document.new(*docs)
+ when RDoc::Comment then
+ doc = super comment_location.text, comment_location.format
+ doc.file = comment_location.location
+ doc
when RDoc::Markup::Document then
return comment_location
else
@@ -448,10 +575,10 @@ class RDoc::ClassModule < RDoc::Context
end
##
- # Path to this class or module
+ # Path to this class or module for use with HTML generator output.
def path
- http_url RDoc::RDoc.current.generator.class_dir
+ http_url @store.rdoc.generator.class_dir
end
##
@@ -485,21 +612,61 @@ class RDoc::ClassModule < RDoc::Context
modules_hash.each_key do |name|
full_name = prefix + name
- modules_hash.delete name unless RDoc::TopLevel.all_modules_hash[full_name]
+ modules_hash.delete name unless @store.modules_hash[full_name]
end
classes_hash.each_key do |name|
full_name = prefix + name
- classes_hash.delete name unless RDoc::TopLevel.all_classes_hash[full_name]
+ classes_hash.delete name unless @store.classes_hash[full_name]
+ end
+ end
+
+ def remove_things my_things, other_files # :nodoc:
+ my_things.delete_if do |file, things|
+ next false unless other_files.include? file
+
+ things.each do |thing|
+ yield false, thing
+ end
+
+ true
end
end
##
+ # Search record used by RDoc::Generator::JsonIndex
+
+ def search_record
+ [
+ name,
+ full_name,
+ full_name,
+ '',
+ path,
+ '',
+ snippet(@comment_location),
+ ]
+ end
+
+ ##
+ # Sets the store for this class or module and its contained code objects.
+
+ def store= store
+ super
+
+ @attributes .each do |attr| attr.store = store end
+ @constants .each do |const| const.store = store end
+ @includes .each do |incl| incl.store = store end
+ @extends .each do |ext| ext.store = store end
+ @method_list.each do |meth| meth.store = store end
+ end
+
+ ##
# Get the superclass of this class. Attempts to retrieve the superclass
# object, returns the name if it is not known.
def superclass
- RDoc::TopLevel.find_class_named(@superclass) || @superclass
+ @store.find_class_named(@superclass) || @superclass
end
##
@@ -530,7 +697,7 @@ class RDoc::ClassModule < RDoc::Context
# aliases through a constant.
#
# The aliased module/class is replaced in the children and in
- # RDoc::TopLevel::all_modules_hash or RDoc::TopLevel::all_classes_hash
+ # RDoc::Store#modules_hash or RDoc::Store#classes_hash
# by a copy that has <tt>RDoc::ClassModule#is_alias_for</tt> set to
# the aliased module/class, and this copy is added to <tt>#aliases</tt>
# of the aliased module/class.
@@ -545,16 +712,21 @@ class RDoc::ClassModule < RDoc::Context
next unless cm = const.is_alias_for
cm_alias = cm.dup
cm_alias.name = const.name
- cm_alias.parent = self
- cm_alias.full_name = nil # force update for new parent
+
+ # Don't move top-level aliases under Object, they look ugly there
+ unless RDoc::TopLevel === cm_alias.parent then
+ cm_alias.parent = self
+ cm_alias.full_name = nil # force update for new parent
+ end
+
cm_alias.aliases.clear
cm_alias.is_alias_for = cm
if cm.module? then
- RDoc::TopLevel.all_modules_hash[cm_alias.full_name] = cm_alias
+ @store.modules_hash[cm_alias.full_name] = cm_alias
modules_hash[const.name] = cm_alias
else
- RDoc::TopLevel.all_classes_hash[cm_alias.full_name] = cm_alias
+ @store.classes_hash[cm_alias.full_name] = cm_alias
classes_hash[const.name] = cm_alias
end
@@ -571,8 +743,26 @@ class RDoc::ClassModule < RDoc::Context
def update_includes
includes.reject! do |include|
mod = include.module
- !(String === mod) && RDoc::TopLevel.all_modules_hash[mod.full_name].nil?
+ !(String === mod) && @store.modules_hash[mod.full_name].nil?
end
+
+ includes.uniq!
+ end
+
+ ##
+ # Deletes from #extends those whose module has been removed from the
+ # documentation.
+ #--
+ # FIXME: like update_includes, extends are not reliably removed
+
+ def update_extends
+ extends.reject! do |ext|
+ mod = ext.module
+
+ !(String === mod) && @store.modules_hash[mod.full_name].nil?
+ end
+
+ extends.uniq!
end
end
diff --git a/lib/rdoc/code_object.rb b/lib/rdoc/code_object.rb
index 606fd8ff49..e2d9d909da 100644
--- a/lib/rdoc/code_object.rb
+++ b/lib/rdoc/code_object.rb
@@ -1,6 +1,3 @@
-require 'rdoc'
-require 'rdoc/text'
-
##
# Base class for the RDoc code tree.
#
@@ -78,9 +75,9 @@ class RDoc::CodeObject
attr_accessor :offset
##
- # Our parent CodeObject
+ # Sets the parent CodeObject
- attr_accessor :parent
+ attr_writer :parent
##
# Did we ever receive a +:nodoc:+ directive?
@@ -88,9 +85,14 @@ class RDoc::CodeObject
attr_reader :received_nodoc
##
- # Which section are we in
+ # Set the section this CodeObject is in
- attr_accessor :section
+ attr_writer :section
+
+ ##
+ # The RDoc::Store for this object.
+
+ attr_accessor :store
##
# We are the model of the code, but we know that at some point we will be
@@ -103,17 +105,23 @@ class RDoc::CodeObject
# Creates a new CodeObject that will document itself and its children
def initialize
- @metadata = {}
- @comment = ''
- @parent = nil
- @file = nil
- @full_name = nil
+ @metadata = {}
+ @comment = ''
+ @parent = nil
+ @parent_name = nil # for loading
+ @parent_class = nil # for loading
+ @section = nil
+ @section_title = nil # for loading
+ @file = nil
+ @full_name = nil
+ @store = nil
@document_children = true
@document_self = true
@done_documenting = false
@force_documentation = false
@received_nodoc = false
+ @ignored = false
end
##
@@ -123,11 +131,11 @@ class RDoc::CodeObject
@comment = case comment
when NilClass then ''
when RDoc::Markup::Document then comment
+ when RDoc::Comment then comment.normalize
else
if comment and not comment.empty? then
normalize_comment comment
else
- # TODO is this sufficient?
# HACK correct fix is to have #initialize create @comment
# with the correct encoding
if String === @comment and
@@ -140,6 +148,13 @@ class RDoc::CodeObject
end
##
+ # Should this CodeObject be shown in documentation?
+
+ def display?
+ @document_self and not @ignored
+ end
+
+ ##
# Enables or disables documentation of this CodeObject's children unless it
# has been turned off by :enddoc:
@@ -195,6 +210,11 @@ class RDoc::CodeObject
self
end
+ ##
+ # File name where this CodeObject was found.
+ #
+ # See also RDoc::Context#in_files
+
def file_name
return unless @file
@@ -203,7 +223,7 @@ class RDoc::CodeObject
##
# Force the documentation of this object unless documentation
- # has been turned off by :endoc:
+ # has been turned off by :enddoc:
#--
# HACK untested, was assigning to an ivar
@@ -221,6 +241,57 @@ class RDoc::CodeObject
end
##
+ # Use this to ignore a CodeObject and all its children until found again
+ # (#record_location is called). An ignored item will not be shown in
+ # documentation.
+ #
+ # See github issue #55
+ #
+ # The ignored status is temporary in order to allow implementation details
+ # to be hidden. At the end of processing a file RDoc allows all classes
+ # and modules to add new documentation to previously created classes.
+ #
+ # If a class was ignored (via stopdoc) then reopened later with additional
+ # documentation it should be shown. If a class was ignored and never
+ # reopened it should not be shown. The ignore flag allows this to occur.
+
+ def ignore
+ @ignored = true
+
+ stop_doc
+ end
+
+ ##
+ # Has this class been ignored?
+
+ def ignored?
+ @ignored
+ end
+
+ ##
+ # Our parent CodeObject. The parent may be missing for classes loaded from
+ # legacy RI data stores.
+
+ def parent
+ return @parent if @parent
+ return nil unless @parent_name
+
+ if @parent_class == RDoc::TopLevel then
+ @parent = @store.add_file @parent_name
+ else
+ @parent = @store.find_class_or_module @parent_name
+
+ return @parent if @parent
+
+ begin
+ @parent = @store.load_class @parent_name
+ rescue RDoc::Store::MissingFileError
+ nil
+ end
+ end
+ end
+
+ ##
# File name of our parent
def parent_file_name
@@ -238,18 +309,30 @@ class RDoc::CodeObject
# Records the RDoc::TopLevel (file) where this code object was defined
def record_location top_level
+ @ignored = false
@file = top_level
end
##
+ # The section this CodeObject is in. Sections allow grouping of constants,
+ # attributes and methods inside a class or module.
+
+ def section
+ return @section if @section
+
+ @section = parent.add_section @section_title if parent
+ end
+
+ ##
# Enable capture of documentation unless documentation has been
- # turned off by :endoc:
+ # turned off by :enddoc:
def start_doc
return if @done_documenting
@document_self = true
@document_children = true
+ @ignored = false
end
##
diff --git a/lib/rdoc/code_objects.rb b/lib/rdoc/code_objects.rb
index c60dad92df..f1a626cd2e 100644
--- a/lib/rdoc/code_objects.rb
+++ b/lib/rdoc/code_objects.rb
@@ -1,23 +1,5 @@
-# We represent the various high-level code constructs that appear in Ruby
-# programs: classes, modules, methods, and so on.
+# This file was used to load all the RDoc::CodeObject subclasses at once. Now
+# autoload handles this.
-require 'rdoc/code_object'
-require 'rdoc/context'
-require 'rdoc/top_level'
-
-require 'rdoc/class_module'
-require 'rdoc/normal_class'
-require 'rdoc/normal_module'
-require 'rdoc/anon_class'
-require 'rdoc/single_class'
-
-require 'rdoc/any_method'
-require 'rdoc/alias'
-require 'rdoc/ghost_method'
-require 'rdoc/meta_method'
-
-require 'rdoc/attr'
-require 'rdoc/constant'
-require 'rdoc/require'
-require 'rdoc/include'
+require 'rdoc'
diff --git a/lib/rdoc/comment.rb b/lib/rdoc/comment.rb
new file mode 100644
index 0000000000..2b5be44ee5
--- /dev/null
+++ b/lib/rdoc/comment.rb
@@ -0,0 +1,232 @@
+##
+# A comment holds the text comment for a RDoc::CodeObject and provides a
+# unified way of cleaning it up and parsing it into an RDoc::Markup::Document.
+#
+# Each comment may have a different markup format set by #format=. By default
+# 'rdoc' is used. The :markup: directive tells RDoc which format to use.
+#
+# See RDoc::Markup@Other+directives for instructions on adding an alternate
+# format.
+
+class RDoc::Comment
+
+ include RDoc::Text
+
+ ##
+ # The format of this comment. Defaults to RDoc::Markup
+
+ attr_reader :format
+
+ ##
+ # The RDoc::TopLevel this comment was found in
+
+ attr_accessor :location
+
+ ##
+ # For duck-typing when merging classes at load time
+
+ alias file location # :nodoc:
+
+ ##
+ # The text for this comment
+
+ attr_reader :text
+
+ ##
+ # Overrides the content returned by #parse. Use when there is no #text
+ # source for this comment
+
+ attr_writer :document
+
+ ##
+ # Creates a new comment with +text+ that is found in the RDoc::TopLevel
+ # +location+.
+
+ def initialize text = nil, location = nil
+ @location = location
+ @text = text
+
+ @document = nil
+ @format = 'rdoc'
+ @normalized = false
+ end
+
+ ##
+ #--
+ # TODO deep copy @document
+
+ def initialize_copy copy # :nodoc:
+ @text = copy.text.dup
+ end
+
+ def == other # :nodoc:
+ self.class === other and
+ other.text == @text and other.location == @location
+ end
+
+ ##
+ # Look for a 'call-seq' in the comment to override the normal parameter
+ # handling. The :call-seq: is indented from the baseline. All lines of the
+ # same indentation level and prefix are consumed.
+ #
+ # For example, all of the following will be used as the :call-seq:
+ #
+ # # :call-seq:
+ # # ARGF.readlines(sep=$/) -> array
+ # # ARGF.readlines(limit) -> array
+ # # ARGF.readlines(sep, limit) -> array
+ # #
+ # # ARGF.to_a(sep=$/) -> array
+ # # ARGF.to_a(limit) -> array
+ # # ARGF.to_a(sep, limit) -> array
+
+ def extract_call_seq method
+ # we must handle situations like the above followed by an unindented first
+ # comment. The difficulty is to make sure not to match lines starting
+ # with ARGF at the same indent, but that are after the first description
+ # paragraph.
+ if @text =~ /^\s*:?call-seq:(.*?(?:\S).*?)^\s*$/m then
+ all_start, all_stop = $~.offset(0)
+ seq_start, seq_stop = $~.offset(1)
+
+ # we get the following lines that start with the leading word at the
+ # same indent, even if they have blank lines before
+ if $1 =~ /(^\s*\n)+^(\s*\w+)/m then
+ leading = $2 # ' * ARGF' in the example above
+ re = %r%
+ \A(
+ (^\s*\n)+
+ (^#{Regexp.escape leading}.*?\n)+
+ )+
+ ^\s*$
+ %xm
+
+ if @text[seq_stop..-1] =~ re then
+ all_stop = seq_stop + $~.offset(0).last
+ seq_stop = seq_stop + $~.offset(1).last
+ end
+ end
+
+ seq = @text[seq_start..seq_stop]
+ seq.gsub!(/^\s*(\S|\n)/m, '\1')
+ @text.slice! all_start...all_stop
+
+ method.call_seq = seq.chomp
+
+ elsif @text.sub!(/^\s*:?call-seq:(.*?)(^\s*$|\z)/m, '') then
+ seq = $1
+ seq.gsub!(/^\s*/, '')
+ method.call_seq = seq
+ end
+ #elsif @text.sub!(/\A\/\*\s*call-seq:(.*?)\*\/\Z/, '') then
+ # method.call_seq = $1.strip
+ #end
+
+ method
+ end
+
+ ##
+ # A comment is empty if its text String is empty.
+
+ def empty?
+ @text.empty?
+ end
+
+ ##
+ # HACK dubious
+
+ def force_encoding encoding
+ @text.force_encoding encoding
+ end
+
+ ##
+ # Sets the format of this comment and resets any parsed document
+
+ def format= format
+ @format = format
+ @document = nil
+ end
+
+ def inspect # :nodoc:
+ location = @location ? @location.relative_name : '(unknown)'
+
+ "#<%s:%x %s %p>" % [self.class, object_id, location, @text]
+ end
+
+ ##
+ # Normalizes the text. See RDoc::Text#normalize_comment for details
+
+ def normalize
+ return self unless @text
+ return self if @normalized # TODO eliminate duplicate normalization
+
+ @text = normalize_comment @text
+
+ @normalized = true
+
+ self
+ end
+
+ ##
+ # Was this text normalized?
+
+ def normalized? # :nodoc:
+ @normalized
+ end
+
+ ##
+ # Parses the comment into an RDoc::Markup::Document. The parsed document is
+ # cached until the text is changed.
+
+ def parse
+ return @document if @document
+
+ @document = super @text, @format
+ @document.file = @location
+ @document
+ end
+
+ ##
+ # Removes private sections from this comment. Private sections are flush to
+ # the comment marker and start with <tt>--</tt> and end with <tt>++</tt>.
+ # For C-style comments, a private marker may not start at the opening of the
+ # comment.
+ #
+ # /*
+ # *--
+ # * private
+ # *++
+ # * public
+ # */
+
+ def remove_private
+ # Workaround for gsub encoding for Ruby 1.9.2 and earlier
+ empty = ''
+ empty.force_encoding @text.encoding if Object.const_defined? :Encoding
+
+ @text = @text.gsub(%r%^\s*([#*]?)--.*?^\s*(\1)\+\+\n?%m, empty)
+ @text = @text.sub(%r%^\s*[#*]?--.*%m, '')
+ end
+
+ ##
+ # Replaces this comment's text with +text+ and resets the parsed document.
+ #
+ # An error is raised if the comment contains a document but no text.
+
+ def text= text
+ raise RDoc::Error, 'replacing document-only comment is not allowed' if
+ @text.nil? and @document
+
+ @document = nil
+ @text = text
+ end
+
+ ##
+ # Returns true if this comment is in TomDoc format.
+
+ def tomdoc?
+ @format == 'tomdoc'
+ end
+
+end
+
diff --git a/lib/rdoc/constant.rb b/lib/rdoc/constant.rb
index 056ce130be..48b32aaf98 100644
--- a/lib/rdoc/constant.rb
+++ b/lib/rdoc/constant.rb
@@ -1,16 +1,14 @@
-require 'rdoc/code_object'
-
##
# A constant
class RDoc::Constant < RDoc::CodeObject
+ MARSHAL_VERSION = 0 # :nodoc:
+
##
- # If this constant is an alias for a module or class,
- # this is the RDoc::ClassModule it is an alias for.
- # +nil+ otherwise.
+ # Sets the module or class this is constant is an alias for.
- attr_accessor :is_alias_for
+ attr_writer :is_alias_for
##
# The constant's name
@@ -23,13 +21,22 @@ class RDoc::Constant < RDoc::CodeObject
attr_accessor :value
##
+ # The constant's visibility
+
+ attr_accessor :visibility
+
+ ##
# Creates a new constant with +name+, +value+ and +comment+
def initialize(name, value, comment)
super()
- @name = name
+
+ @name = name
@value = value
+
@is_alias_for = nil
+ @visibility = nil
+
self.comment = comment
end
@@ -59,6 +66,27 @@ class RDoc::Constant < RDoc::CodeObject
super or is_alias_for && is_alias_for.documented?
end
+ ##
+ # Full constant name including namespace
+
+ def full_name
+ @full_name ||= "#{parent_name}::#{@name}"
+ end
+
+ ##
+ # The module or class this constant is an alias for
+
+ def is_alias_for
+ case @is_alias_for
+ when String then
+ found = @store.find_class_or_module @is_alias_for
+ @is_alias_for = found if found
+ @is_alias_for
+ else
+ @is_alias_for
+ end
+ end
+
def inspect # :nodoc:
"#<%s:0x%x %s::%s>" % [
self.class, object_id,
@@ -67,12 +95,76 @@ class RDoc::Constant < RDoc::CodeObject
end
##
- # Path to this constant
+ # Dumps this Constant for use by ri. See also #marshal_load
+
+ def marshal_dump
+ alias_name = case found = is_alias_for
+ when RDoc::CodeObject then found.full_name
+ else found
+ end
+
+ [ MARSHAL_VERSION,
+ @name,
+ full_name,
+ @visibility,
+ alias_name,
+ parse(@comment),
+ @file.relative_name,
+ parent.name,
+ parent.class,
+ section.title,
+ ]
+ end
+
+ ##
+ # Loads this Constant from +array+. For a loaded Constant the following
+ # methods will return cached values:
+ #
+ # * #full_name
+ # * #parent_name
+
+ def marshal_load array
+ initialize array[1], nil, array[5]
+
+ @full_name = array[2]
+ @visibility = array[3]
+ @is_alias_for = array[4]
+ # 5 handled above
+ # 6 handled below
+ @parent_name = array[7]
+ @parent_class = array[8]
+ @section_title = array[9]
+
+ @file = RDoc::TopLevel.new array[6]
+ end
+
+ ##
+ # Path to this constant for use with HTML generator output.
def path
"#{@parent.path}##{@name}"
end
+ def pretty_print q # :nodoc:
+ q.group 2, "[#{self.class.name} #{full_name}", "]" do
+ unless comment.empty? then
+ q.breakable
+ q.text "comment:"
+ q.breakable
+ q.pp @comment
+ end
+ end
+ end
+
+ ##
+ # Sets the store for this class or module and its contained code objects.
+
+ def store= store
+ super
+
+ @file = @store.add_file @file.full_name if @file
+ end
+
def to_s # :nodoc:
parent_name = parent ? parent.full_name : '(unknown)'
if is_alias_for
diff --git a/lib/rdoc/context.rb b/lib/rdoc/context.rb
index d2552c647c..6f9deae4a8 100644
--- a/lib/rdoc/context.rb
+++ b/lib/rdoc/context.rb
@@ -1,4 +1,4 @@
-require 'rdoc/code_object'
+require 'cgi'
##
# A Context is something that can hold modules, classes, methods, attributes,
@@ -15,6 +15,12 @@ class RDoc::Context < RDoc::CodeObject
TYPES = %w[class instance]
##
+ # If a context has these titles it will be sorted in this order.
+
+ TOMDOC_TITLES = [nil, 'Public', 'Internal', 'Deprecated'] # :nodoc:
+ TOMDOC_TITLES_SORT = TOMDOC_TITLES.sort_by { |title| title.to_s } # :nodoc:
+
+ ##
# Class/module aliases
attr_reader :aliases
@@ -25,6 +31,11 @@ class RDoc::Context < RDoc::CodeObject
attr_reader :attributes
##
+ # Block params to be used in the next MethodAttr parsed under this context
+
+ attr_accessor :block_params
+
+ ##
# Constants defined
attr_reader :constants
@@ -45,6 +56,11 @@ class RDoc::Context < RDoc::CodeObject
attr_reader :includes
##
+ # Modules this context is extended with
+
+ attr_reader :extends
+
+ ##
# Methods defined in this context
attr_reader :method_list
@@ -72,7 +88,7 @@ class RDoc::Context < RDoc::CodeObject
attr_accessor :unmatched_alias_lists
##
- # Aliases that could not eventually be resolved.
+ # Aliases that could not be resolved.
attr_reader :external_aliases
@@ -88,121 +104,14 @@ class RDoc::Context < RDoc::CodeObject
attr_reader :methods_hash
##
- # Hash of registered constants.
+ # Params to be used in the next MethodAttr parsed under this context
- attr_reader :constants_hash
+ attr_accessor :params
##
- # A section of documentation like:
- #
- # # :section: The title
- # # The body
- #
- # Sections can be referenced multiple times and will be collapsed into a
- # single section.
-
- class Section
-
- include RDoc::Text
-
- ##
- # Section comment
-
- attr_reader :comment
-
- ##
- # Context this Section lives in
-
- attr_reader :parent
-
- ##
- # Section title
-
- attr_reader :title
-
- @@sequence = "SEC00000"
-
- ##
- # Creates a new section with +title+ and +comment+
-
- def initialize parent, title, comment
- @parent = parent
- @title = title ? title.strip : title
-
- @@sequence.succ!
- @sequence = @@sequence.dup
-
- @comment = extract_comment comment
- end
-
- ##
- # Sections are equal when they have the same #title
-
- def == other
- self.class === other and @title == other.title
- end
-
- ##
- # Anchor reference for linking to this section
-
- def aref
- title = @title || '[untitled]'
-
- CGI.escape(title).gsub('%', '-').sub(/^-/, '')
- end
-
- ##
- # Appends +comment+ to the current comment separated by a rule.
-
- def comment= comment
- comment = extract_comment comment
-
- return if comment.empty?
-
- if @comment then
- @comment += "\n# ---\n#{comment}"
- else
- @comment = comment
- end
- end
-
- ##
- # Extracts the comment for this section from the original comment block.
- # If the first line contains :section:, strip it and use the rest.
- # Otherwise remove lines up to the line containing :section:, and look
- # for those lines again at the end and remove them. This lets us write
- #
- # # :section: The title
- # # The body
-
- def extract_comment comment
- if comment =~ /^#[ \t]*:section:.*\n/ then
- start = $`
- rest = $'
-
- if start.empty? then
- rest
- else
- rest.sub(/#{start.chomp}\Z/, '')
- end
- else
- comment
- end
- end
-
- def inspect # :nodoc:
- "#<%s:0x%x %p>" % [self.class, object_id, title]
- end
-
- ##
- # Section sequence number (deprecated)
-
- def sequence
- warn "RDoc::Context::Section#sequence is deprecated, use #aref"
- @sequence
- end
+ # Hash of registered constants.
- end
+ attr_reader :constants_hash
##
# Creates an unnamed empty context with public current visibility
@@ -235,6 +144,7 @@ class RDoc::Context < RDoc::CodeObject
@aliases = []
@requires = []
@includes = []
+ @extends = []
@constants = []
@external_aliases = []
@@ -242,8 +152,12 @@ class RDoc::Context < RDoc::CodeObject
# a method not yet encountered).
@unmatched_alias_lists = {}
- @methods_hash = {}
+ @methods_hash = {}
@constants_hash = {}
+
+ @params = nil
+
+ @store ||= nil
end
##
@@ -366,12 +280,12 @@ class RDoc::Context < RDoc::CodeObject
if full_name =~ /^(.+)::(\w+)$/ then
name = $2
ename = $1
- enclosing = RDoc::TopLevel.classes_hash[ename] ||
- RDoc::TopLevel.modules_hash[ename]
+ enclosing = @store.classes_hash[ename] || @store.modules_hash[ename]
# HACK: crashes in actionpack/lib/action_view/helpers/form_helper.rb (metaprogramming)
unless enclosing then
# try the given name at top level (will work for the above example)
- enclosing = RDoc::TopLevel.classes_hash[given_name] || RDoc::TopLevel.modules_hash[given_name]
+ enclosing = @store.classes_hash[given_name] ||
+ @store.modules_hash[given_name]
return enclosing if enclosing
# not found: create the parent(s)
names = ename.split('::')
@@ -410,7 +324,7 @@ class RDoc::Context < RDoc::CodeObject
end
# did we believe it was a module?
- mod = RDoc::TopLevel.modules_hash.delete superclass
+ mod = @store.modules_hash.delete superclass
upgrade_to_class mod, RDoc::NormalClass, mod.parent if mod
@@ -418,11 +332,12 @@ class RDoc::Context < RDoc::CodeObject
superclass = nil if superclass == full_name
end
- klass = RDoc::TopLevel.classes_hash[full_name]
+ klass = @store.classes_hash[full_name]
if klass then
# if TopLevel, it may not be registered in the classes:
enclosing.classes_hash[name] = klass
+
# update the superclass if needed
if superclass then
existing = klass.superclass
@@ -434,7 +349,7 @@ class RDoc::Context < RDoc::CodeObject
end
else
# this is a new class
- mod = RDoc::TopLevel.modules_hash.delete full_name
+ mod = @store.modules_hash.delete full_name
if mod then
klass = upgrade_to_class mod, RDoc::NormalClass, enclosing
@@ -444,10 +359,12 @@ class RDoc::Context < RDoc::CodeObject
klass = class_type.new name, superclass
enclosing.add_class_or_module(klass, enclosing.classes_hash,
- RDoc::TopLevel.classes_hash)
+ @store.classes_hash)
end
end
+ klass.parent = self
+
klass
end
@@ -462,6 +379,7 @@ class RDoc::Context < RDoc::CodeObject
mod.section = current_section # TODO declaring context? something is
# wrong here...
mod.parent = self
+ mod.store = @store
unless @done_documenting then
self_hash[mod.name] = mod
@@ -503,13 +421,21 @@ class RDoc::Context < RDoc::CodeObject
# Adds included module +include+ which should be an RDoc::Include
def add_include include
- add_to @includes, include unless
- @includes.map { |i| i.full_name }.include? include.full_name
+ add_to @includes, include
include
end
##
+ # Adds extension module +ext+ which should be an RDoc::Extend
+
+ def add_extend ext
+ add_to @extends, ext
+
+ ext
+ end
+
+ ##
# Adds +method+ if not already there. If it is (as method or attribute),
# updates the comment if it was empty.
@@ -522,6 +448,10 @@ class RDoc::Context < RDoc::CodeObject
if known then
known.comment = method.comment if known.comment.empty?
+ previously = ", previously in #{known.file}" unless
+ method.file == known.file
+ @store.rdoc.options.warn \
+ "Duplicate method #{known.full_name} in #{method.file}#{previously}"
else
@methods_hash[key] = method
method.visibility = @visibility
@@ -541,9 +471,9 @@ class RDoc::Context < RDoc::CodeObject
return mod if mod
full_name = child_name name
- mod = RDoc::TopLevel.modules_hash[full_name] || class_type.new(name)
+ mod = @store.modules_hash[full_name] || class_type.new(name)
- add_class_or_module(mod, @modules, RDoc::TopLevel.modules_hash)
+ add_class_or_module mod, @modules, @store.modules_hash
end
##
@@ -553,31 +483,34 @@ class RDoc::Context < RDoc::CodeObject
def add_module_alias from, name, file
return from if @done_documenting
- to_name = child_name(name)
+ to_name = child_name name
# if we already know this name, don't register an alias:
# see the metaprogramming in lib/active_support/basic_object.rb,
- # where we already know BasicObject as a class when we find
+ # where we already know BasicObject is a class when we find
# BasicObject = BlankSlate
- return from if RDoc::TopLevel.find_class_or_module(to_name)
+ return from if @store.find_class_or_module to_name
+
+ to = from.dup
+ to.name = name
+ to.full_name = nil
- if from.module? then
- RDoc::TopLevel.modules_hash[to_name] = from
- @modules[name] = from
+ if to.module? then
+ @store.modules_hash[to_name] = to
+ @modules[name] = to
else
- RDoc::TopLevel.classes_hash[to_name] = from
- @classes[name] = from
+ @store.classes_hash[to_name] = to
+ @classes[name] = to
end
- # HACK: register a constant for this alias:
- # constant value and comment will be updated after,
- # when the Ruby parser adds the constant
- const = RDoc::Constant.new name, nil, ''
+ # Registers a constant for this alias. The constant value and comment
+ # will be updated later, when the Ruby parser adds the constant
+ const = RDoc::Constant.new name, nil, to.comment
const.record_location file
const.is_alias_for = from
add_constant const
- from
+ to
end
##
@@ -601,9 +534,9 @@ class RDoc::Context < RDoc::CodeObject
#
# See also RDoc::Context::Section
- def add_section title, comment
+ def add_section title, comment = nil
if section = @sections[title] then
- section.comment = comment
+ section.add_comment comment if comment
else
section = Section.new self, title, comment
@sections[title] = section
@@ -615,17 +548,21 @@ class RDoc::Context < RDoc::CodeObject
##
# Adds +thing+ to the collection +array+
- def add_to(array, thing)
+ def add_to array, thing
array << thing if @document_self
- thing.parent = self
+
+ thing.parent = self
+ thing.store = @store if @store
thing.section = current_section
end
##
# Is there any content?
- # This means any of: comment, aliases, methods, attributes,
- # external aliases, require, constant.
- # Includes are also checked unless <tt>includes == false</tt>.
+ #
+ # This means any of: comment, aliases, methods, attributes, external
+ # aliases, require, constant.
+ #
+ # Includes and extends are also checked unless <tt>includes == false</tt>.
def any_content(includes = true)
@any_content ||= !(
@@ -637,7 +574,7 @@ class RDoc::Context < RDoc::CodeObject
@requires.empty? &&
@constants.empty?
)
- @any_content || (includes && !@includes.empty?)
+ @any_content || (includes && !(@includes + @extends).empty? )
end
##
@@ -720,6 +657,9 @@ class RDoc::Context < RDoc::CodeObject
##
# Iterator for ancestors for duck-typing. Does nothing. See
# RDoc::ClassModule#each_ancestor.
+ #
+ # This method exists to make it easy to work with Context subclasses that
+ # aren't part of RDoc.
def each_ancestor # :nodoc:
end
@@ -753,10 +693,19 @@ class RDoc::Context < RDoc::CodeObject
end
##
+ # Iterator for extension modules
+
+ def each_extend # :yields: extend
+ @extends.each do |e| yield e end
+ end
+
+ ##
# Iterator for methods
def each_method # :yields: method
- @method_list.sort.each {|m| yield m}
+ return enum_for __method__ unless block_given?
+
+ @method_list.sort.each { |m| yield m }
end
##
@@ -770,13 +719,15 @@ class RDoc::Context < RDoc::CodeObject
# NOTE: Do not edit collections yielded by this method
def each_section # :yields: section, constants, attributes
- constants = @constants.group_by do |constant| constant.section end
- constants.default = []
+ return enum_for __method__ unless block_given?
+ constants = @constants.group_by do |constant| constant.section end
attributes = @attributes.group_by do |attribute| attribute.section end
+
+ constants.default = []
attributes.default = []
- @sections.sort_by { |title, _| title.to_s }.each do |_, section|
+ sort_sections.each do |section|
yield section, constants[section].sort, attributes[section].sort
end
end
@@ -848,8 +799,8 @@ class RDoc::Context < RDoc::CodeObject
##
# Finds a file with +name+ in this context
- def find_file_named(name)
- top_level.class.find_file_named(name)
+ def find_file_named name
+ @store.find_file_named name
end
##
@@ -919,21 +870,21 @@ class RDoc::Context < RDoc::CodeObject
# look for a class or module 'symbol'
case symbol
when /^::/ then
- result = RDoc::TopLevel.find_class_or_module(symbol)
+ result = @store.find_class_or_module symbol
when /^(\w+):+(.+)$/
suffix = $2
top = $1
searched = self
- loop do
+ while searched do
mod = searched.find_module_named(top)
break unless mod
- result = RDoc::TopLevel.find_class_or_module(mod.full_name + '::' + suffix)
+ result = @store.find_class_or_module "#{mod.full_name}::#{suffix}"
break if result || searched.is_a?(RDoc::TopLevel)
searched = searched.parent
end
else
searched = self
- loop do
+ while searched do
result = searched.find_module_named(symbol)
break if result || searched.is_a?(RDoc::TopLevel)
searched = searched.parent
@@ -982,6 +933,8 @@ class RDoc::Context < RDoc::CodeObject
##
# Instance methods
+ #--
+ # TODO rename to instance_methods
def instance_method_list
@instance_method_list ||= method_list.reject { |a| a.singleton }
@@ -1095,24 +1048,23 @@ class RDoc::Context < RDoc::CodeObject
##
# Only called when min_visibility == :public or :private
- def remove_invisible_in(array, min_visibility) # :nodoc:
- if min_visibility == :public
+ def remove_invisible_in array, min_visibility # :nodoc:
+ if min_visibility == :public then
array.reject! { |e|
e.visibility != :public and not e.force_documentation
}
else
array.reject! { |e|
- e.visibility == :private and
- not e.force_documentation
+ e.visibility == :private and not e.force_documentation
}
end
end
##
- # Tries to resolve unmatched aliases when a method
- # or attribute has just been added.
+ # Tries to resolve unmatched aliases when a method or attribute has just
+ # been added.
- def resolve_aliases(added)
+ def resolve_aliases added
# resolve any pending unmatched aliases
key = added.pretty_name
unmatched_alias_list = @unmatched_alias_lists[key]
@@ -1125,6 +1077,31 @@ class RDoc::Context < RDoc::CodeObject
end
##
+ # Returns RDoc::Context::Section objects referenced in this context for use
+ # in a table of contents.
+
+ def section_contents
+ used_sections = {}
+
+ each_method do |method|
+ next unless method.display?
+
+ used_sections[method.section] = true
+ end
+
+ # order found sections
+ sections = sort_sections.select do |section|
+ used_sections[section]
+ end
+
+ # only the default section is used
+ return [] if
+ sections.length == 1 and not sections.first.title
+
+ sections
+ end
+
+ ##
# Sections in this context
def sections
@@ -1152,6 +1129,26 @@ class RDoc::Context < RDoc::CodeObject
end
end
+ ##
+ # Sorts sections alphabetically (default) or in TomDoc fashion (none,
+ # Public, Internal, Deprecated)
+
+ def sort_sections
+ titles = @sections.map { |title, _| title }
+
+ if titles.length > 1 and
+ TOMDOC_TITLES_SORT ==
+ (titles | TOMDOC_TITLES).sort_by { |title| title.to_s } then
+ @sections.values_at(*TOMDOC_TITLES).compact
+ else
+ @sections.sort_by { |title, _|
+ title.to_s
+ }.map { |_, section|
+ section
+ }
+ end
+ end
+
def to_s # :nodoc:
"#{self.class.name} #{self.full_name}"
end
@@ -1176,13 +1173,16 @@ class RDoc::Context < RDoc::CodeObject
enclosing.modules_hash.delete mod.name
klass = RDoc::ClassModule.from_module class_type, mod
+ klass.store = @store
# if it was there, then we keep it even if done_documenting
- RDoc::TopLevel.classes_hash[mod.full_name] = klass
- enclosing.classes_hash[mod.name] = klass
+ @store.classes_hash[mod.full_name] = klass
+ enclosing.classes_hash[mod.name] = klass
klass
end
+ autoload :Section, 'rdoc/context/section'
+
end
diff --git a/lib/rdoc/context/section.rb b/lib/rdoc/context/section.rb
new file mode 100644
index 0000000000..580f07deff
--- /dev/null
+++ b/lib/rdoc/context/section.rb
@@ -0,0 +1,238 @@
+##
+# A section of documentation like:
+#
+# # :section: The title
+# # The body
+#
+# Sections can be referenced multiple times and will be collapsed into a
+# single section.
+
+class RDoc::Context::Section
+
+ include RDoc::Text
+
+ MARSHAL_VERSION = 0 # :nodoc:
+
+ ##
+ # Section comment
+
+ attr_reader :comment
+
+ ##
+ # Section comments
+
+ attr_reader :comments
+
+ ##
+ # Context this Section lives in
+
+ attr_reader :parent
+
+ ##
+ # Section title
+
+ attr_reader :title
+
+ @@sequence = "SEC00000"
+
+ ##
+ # Creates a new section with +title+ and +comment+
+
+ def initialize parent, title, comment
+ @parent = parent
+ @title = title ? title.strip : title
+
+ @@sequence.succ!
+ @sequence = @@sequence.dup
+
+ @comments = []
+
+ add_comment comment
+ end
+
+ ##
+ # Sections are equal when they have the same #title
+
+ def == other
+ self.class === other and @title == other.title
+ end
+
+ ##
+ # Adds +comment+ to this section
+
+ def add_comment comment
+ comment = extract_comment comment
+
+ return if comment.empty?
+
+ case comment
+ when RDoc::Comment then
+ @comments << comment
+ when RDoc::Markup::Document then
+ @comments.concat comment.parts
+ when Array then
+ @comments.concat comment
+ else
+ raise TypeError, "unknown comment type: #{comment.inspect}"
+ end
+ end
+
+ ##
+ # Anchor reference for linking to this section
+
+ def aref
+ title = @title || '[untitled]'
+
+ CGI.escape(title).gsub('%', '-').sub(/^-/, '')
+ end
+
+ ##
+ # Extracts the comment for this section from the original comment block.
+ # If the first line contains :section:, strip it and use the rest.
+ # Otherwise remove lines up to the line containing :section:, and look
+ # for those lines again at the end and remove them. This lets us write
+ #
+ # # :section: The title
+ # # The body
+
+ def extract_comment comment
+ case comment
+ when Array then
+ comment.map do |c|
+ extract_comment c
+ end
+ when nil
+ RDoc::Comment.new ''
+ when RDoc::Comment then
+ if comment.text =~ /^#[ \t]*:section:.*\n/ then
+ start = $`
+ rest = $'
+
+ comment.text = if start.empty? then
+ rest
+ else
+ rest.sub(/#{start.chomp}\Z/, '')
+ end
+ end
+
+ comment
+ when RDoc::Markup::Document then
+ comment
+ else
+ raise TypeError, "unknown comment #{comment.inspect}"
+ end
+ end
+
+ def inspect # :nodoc:
+ "#<%s:0x%x %p>" % [self.class, object_id, title]
+ end
+
+ ##
+ # The files comments in this section come from
+
+ def in_files
+ return [] if @comments.empty?
+
+ case @comments
+ when Array then
+ @comments.map do |comment|
+ comment.file
+ end
+ when RDoc::Markup::Document then
+ @comment.parts.map do |document|
+ document.file
+ end
+ else
+ raise RDoc::Error, "BUG: unknown comment class #{@comments.class}"
+ end
+ end
+
+ ##
+ # Serializes this Section. The title and parsed comment are saved, but not
+ # the section parent which must be restored manually.
+
+ def marshal_dump
+ [
+ MARSHAL_VERSION,
+ @title,
+ parse,
+ ]
+ end
+
+ ##
+ # De-serializes this Section. The section parent must be restored manually.
+
+ def marshal_load array
+ @parent = nil
+
+ @title = array[1]
+ @comments = array[2]
+ end
+
+ ##
+ # Parses +comment_location+ into an RDoc::Markup::Document composed of
+ # multiple RDoc::Markup::Documents with their file set.
+
+ def parse
+ case @comments
+ when String then
+ super
+ when Array then
+ docs = @comments.map do |comment, location|
+ doc = super comment
+ doc.file = location if location
+ doc
+ end
+
+ RDoc::Markup::Document.new(*docs)
+ when RDoc::Comment then
+ doc = super @comments.text, comments.format
+ doc.file = @comments.location
+ doc
+ when RDoc::Markup::Document then
+ return @comments
+ else
+ raise ArgumentError, "unknown comment class #{comments.class}"
+ end
+ end
+
+ ##
+ # The section's title, or 'Top Section' if the title is nil.
+ #
+ # This is used by the table of contents template so the name is silly.
+
+ def plain_html
+ @title || 'Top Section'
+ end
+
+ ##
+ # Removes a comment from this section if it is from the same file as
+ # +comment+
+
+ def remove_comment comment
+ return if @comments.empty?
+
+ case @comments
+ when Array then
+ @comments.delete_if do |my_comment|
+ my_comment.file == comment.file
+ end
+ when RDoc::Markup::Document then
+ @comments.parts.delete_if do |document|
+ document.file == comment.file.name
+ end
+ else
+ raise RDoc::Error, "BUG: unknown comment class #{@comments.class}"
+ end
+ end
+
+ ##
+ # Section sequence number (deprecated)
+
+ def sequence
+ warn "RDoc::Context::Section#sequence is deprecated, use #aref"
+ @sequence
+ end
+
+end
+
diff --git a/lib/rdoc/cross_reference.rb b/lib/rdoc/cross_reference.rb
new file mode 100644
index 0000000000..c6f127387c
--- /dev/null
+++ b/lib/rdoc/cross_reference.rb
@@ -0,0 +1,183 @@
+##
+# RDoc::CrossReference is a reusable way to create cross references for names.
+
+class RDoc::CrossReference
+
+ ##
+ # Regular expression to match class references
+ #
+ # 1. There can be a '\\' in front of text to suppress the cross-reference
+ # 2. There can be a '::' in front of class names to reference from the
+ # top-level namespace.
+ # 3. The method can be followed by parenthesis (not recommended)
+
+ CLASS_REGEXP_STR = '\\\\?((?:\:{2})?[A-Z]\w*(?:\:\:\w+)*)'
+
+ ##
+ # Regular expression to match method references.
+ #
+ # See CLASS_REGEXP_STR
+
+ METHOD_REGEXP_STR = '([a-z]\w*[!?=]?|%)(?:\([\w.+*/=<>-]*\))?'
+
+ ##
+ # Regular expressions matching text that should potentially have
+ # cross-reference links generated are passed to add_special. Note that
+ # these expressions are meant to pick up text for which cross-references
+ # have been suppressed, since the suppression characters are removed by the
+ # code that is triggered.
+
+ CROSSREF_REGEXP = /(?:^|\s)
+ (
+ (?:
+ # A::B::C.meth
+ #{CLASS_REGEXP_STR}(?:[.#]|::)#{METHOD_REGEXP_STR}
+
+ # Stand-alone method (preceded by a #)
+ | \\?\##{METHOD_REGEXP_STR}
+
+ # Stand-alone method (preceded by ::)
+ | ::#{METHOD_REGEXP_STR}
+
+ # A::B::C
+ # The stuff after CLASS_REGEXP_STR is a
+ # nasty hack. CLASS_REGEXP_STR unfortunately matches
+ # words like dog and cat (these are legal "class"
+ # names in Fortran 95). When a word is flagged as a
+ # potential cross-reference, limitations in the markup
+ # engine suppress other processing, such as typesetting.
+ # This is particularly noticeable for contractions.
+ # In order that words like "can't" not
+ # be flagged as potential cross-references, only
+ # flag potential class cross-references if the character
+ # after the cross-reference is a space, sentence
+ # punctuation, tag start character, or attribute
+ # marker.
+ | #{CLASS_REGEXP_STR}(?=[@\s).?!,;<\000]|\z)
+
+ # Things that look like filenames
+ # The key thing is that there must be at least
+ # one special character (period, slash, or
+ # underscore).
+ | (?:\.\.\/)*[-\/\w]+[_\/.][-\w\/.]+
+
+ # Things that have markup suppressed
+ # Don't process things like '\<' in \<tt>, though.
+ # TODO: including < is a hack, not very satisfying.
+ | \\[^\s<]
+ )
+
+ # labels for headings
+ (?:@[\w+%-]+(?:\.[\w|%-]+)?)?
+ )/x
+
+ ##
+ # Version of CROSSREF_REGEXP used when <tt>--hyperlink-all</tt> is specified.
+
+ ALL_CROSSREF_REGEXP = /
+ (?:^|\s)
+ (
+ (?:
+ # A::B::C.meth
+ #{CLASS_REGEXP_STR}(?:[.#]|::)#{METHOD_REGEXP_STR}
+
+ # Stand-alone method
+ | \\?#{METHOD_REGEXP_STR}
+
+ # A::B::C
+ | #{CLASS_REGEXP_STR}(?=[@\s).?!,;<\000]|\z)
+
+ # Things that look like filenames
+ | (?:\.\.\/)*[-\/\w]+[_\/.][-\w\/.]+
+
+ # Things that have markup suppressed
+ | \\[^\s<]
+ )
+
+ # labels for headings
+ (?:@[\w+%-]+)?
+ )/x
+
+ ##
+ # Hash of references that have been looked-up to their replacements
+
+ attr_accessor :seen
+
+ ##
+ # Allows cross-references to be created based on the given +context+
+ # (RDoc::Context).
+
+ def initialize context
+ @context = context
+ @store = context.store
+
+ @seen = {}
+ end
+
+ ##
+ # Returns a reference to +name+.
+ #
+ # If the reference is found and +name+ is not documented +text+ will be
+ # returned. If +name+ is escaped +name+ is returned. If +name+ is not
+ # found +text+ is returned.
+
+ def resolve name, text
+ return @seen[name] if @seen.include? name
+
+ if /#{CLASS_REGEXP_STR}([.#]|::)#{METHOD_REGEXP_STR}/o =~ name then
+ type = $2
+ type = '' if type == '.' # will find either #method or ::method
+ method = "#{type}#{$3}"
+ container = @context.find_symbol_module($1)
+ elsif /^([.#]|::)#{METHOD_REGEXP_STR}/o =~ name then
+ type = $1
+ type = '' if type == '.'
+ method = "#{type}#{$2}"
+ container = @context
+ else
+ container = nil
+ end
+
+ if container then
+ ref = container.find_local_symbol method
+
+ unless ref || RDoc::TopLevel === container then
+ ref = container.find_ancestor_local_symbol method
+ end
+ end
+
+ ref = case name
+ when /^\\(#{CLASS_REGEXP_STR})$/o then
+ @context.find_symbol $1
+ else
+ @context.find_symbol name
+ end unless ref
+
+ # Try a page name
+ ref = @store.page name if not ref and name =~ /^\w+$/
+
+ ref = nil if RDoc::Alias === ref # external alias, can't link to it
+
+ out = if name == '\\' then
+ name
+ elsif name =~ /^\\/ then
+ # we remove the \ only in front of what we know:
+ # other backslashes are treated later, only outside of <tt>
+ ref ? $' : name
+ elsif ref then
+ if ref.display? then
+ ref
+ else
+ text
+ end
+ else
+ text
+ end
+
+ @seen[name] = out
+
+ out
+ end
+
+end
+
diff --git a/lib/rdoc/encoding.rb b/lib/rdoc/encoding.rb
index cfe1ba7725..0b1ec6728e 100644
--- a/lib/rdoc/encoding.rb
+++ b/lib/rdoc/encoding.rb
@@ -1,4 +1,4 @@
-require 'rdoc'
+# coding: US-ASCII
##
# This class is a wrapper around File IO and Encoding that helps RDoc load
@@ -18,32 +18,47 @@ module RDoc::Encoding
def self.read_file filename, encoding, force_transcode = false
content = open filename, "rb" do |f| f.read end
+ content.gsub!("\r\n", "\n") if RUBY_PLATFORM =~ /mswin|mingw/
utf8 = content.sub!(/\A\xef\xbb\xbf/, '')
RDoc::Encoding.set_encoding content
if Object.const_defined? :Encoding then
- encoding ||= Encoding.default_external
- orig_encoding = content.encoding
-
- if utf8 then
- content.force_encoding Encoding::UTF_8
- content.encode! encoding
- else
- # assume the content is in our output encoding
- content.force_encoding encoding
- end
-
- unless content.valid_encoding? then
- # revert and try to transcode
- content.force_encoding orig_encoding
- content.encode! encoding
- end
-
- unless content.valid_encoding? then
- warn "unable to convert #{filename} to #{encoding}, skipping"
- content = nil
+ begin
+ encoding ||= Encoding.default_external
+ orig_encoding = content.encoding
+
+ if utf8 then
+ content.force_encoding Encoding::UTF_8
+ content.encode! encoding
+ else
+ # assume the content is in our output encoding
+ content.force_encoding encoding
+ end
+
+ unless content.valid_encoding? then
+ # revert and try to transcode
+ content.force_encoding orig_encoding
+ content.encode! encoding
+ end
+
+ unless content.valid_encoding? then
+ warn "unable to convert #{filename} to #{encoding}, skipping"
+ content = nil
+ end
+ rescue Encoding::InvalidByteSequenceError,
+ Encoding::UndefinedConversionError => e
+ if force_transcode then
+ content.force_encoding orig_encoding
+ content.encode!(encoding,
+ :invalid => :replace, :undef => :replace,
+ :replace => '?')
+ return content
+ else
+ warn "unable to convert #{e.message} for #{filename}, skipping"
+ return nil
+ end
end
end
@@ -52,15 +67,6 @@ module RDoc::Encoding
raise unless e.message =~ /unknown encoding name - (.*)/
warn "unknown encoding name \"#{$1}\" for #{filename}, skipping"
nil
- rescue Encoding::UndefinedConversionError => e
- if force_transcode then
- content.force_encoding orig_encoding
- content.encode! encoding, :undef => :replace, :replace => '?'
- content
- else
- warn "unable to convert #{e.message} for #{filename}, skipping"
- nil
- end
rescue Errno::EISDIR, Errno::ENOENT
nil
end
diff --git a/lib/rdoc/erb_partial.rb b/lib/rdoc/erb_partial.rb
new file mode 100644
index 0000000000..910d1e0351
--- /dev/null
+++ b/lib/rdoc/erb_partial.rb
@@ -0,0 +1,18 @@
+##
+# Allows an ERB template to be rendered in the context (binding) of an
+# existing ERB template evaluation.
+
+class RDoc::ERBPartial < ERB
+
+ ##
+ # Overrides +compiler+ startup to set the +eoutvar+ to an empty string only
+ # if it isn't already set.
+
+ def set_eoutvar compiler, eoutvar = '_erbout'
+ super
+
+ compiler.pre_cmd = ["#{eoutvar} ||= ''"]
+ end
+
+end
+
diff --git a/lib/rdoc/extend.rb b/lib/rdoc/extend.rb
new file mode 100644
index 0000000000..2bccfba084
--- /dev/null
+++ b/lib/rdoc/extend.rb
@@ -0,0 +1,117 @@
+##
+# A Module extension in a class with \#extend
+
+class RDoc::Extend < RDoc::CodeObject
+
+ ##
+ # Name of extension module
+
+ attr_accessor :name
+
+ ##
+ # Creates a new Extend for +name+ with +comment+
+
+ def initialize(name, comment)
+ super()
+ @name = name
+ self.comment = comment
+ @module = nil # cache for module if found
+ end
+
+ ##
+ # Extends are sorted by name
+
+ def <=> other
+ return unless self.class === other
+
+ name <=> other.name
+ end
+
+ def == other # :nodoc:
+ self.class === other and @name == other.name
+ end
+
+ alias eql? ==
+
+ ##
+ # Full name based on #module
+
+ def full_name
+ m = self.module
+ RDoc::ClassModule === m ? m.full_name : @name
+ end
+
+ def hash # :nodoc:
+ [@name, self.module].hash
+ end
+
+ def inspect # :nodoc:
+ "#<%s:0x%x %s.extend %s>" % [
+ self.class,
+ object_id,
+ parent_name, @name,
+ ]
+ end
+
+ ##
+ # Attempts to locate the extend module object. Returns the name if not
+ # known.
+ #
+ # The scoping rules of Ruby to resolve the name of an extension module are:
+ # - first look into the children of the current context;
+ # - if not found, look into the children of extension modules,
+ # in reverse extend order;
+ # - if still not found, go up the hierarchy of names.
+ #
+ # This method has <code>O(n!)</code> behavior when the module calling
+ # extend is referencing nonexistent modules. Avoid calling #module until
+ # after all the files are parsed. This behavior is due to ruby's constant
+ # lookup behavior.
+
+ def module
+ return @module if @module
+
+ # search the current context
+ return @name unless parent
+ full_name = parent.child_name(@name)
+ @module = @store.modules_hash[full_name]
+ return @module if @module
+ return @name if @name =~ /^::/
+
+ # search the includes before this one, in reverse order
+ searched = parent.extends.take_while { |i| i != self }.reverse
+ searched.each do |i|
+ ext = i.module
+ next if String === ext
+ full_name = ext.child_name(@name)
+ @module = @store.modules_hash[full_name]
+ return @module if @module
+ end
+
+ # go up the hierarchy of names
+ up = parent.parent
+ while up
+ full_name = up.child_name(@name)
+ @module = @store.modules_hash[full_name]
+ return @module if @module
+ up = up.parent
+ end
+
+ @name
+ end
+
+ ##
+ # Sets the store for this class or module and its contained code objects.
+
+ def store= store
+ super
+
+ @file = @store.add_file @file.full_name if @file
+ end
+
+ def to_s # :nodoc:
+ "extend #@name in: #{parent}"
+ end
+
+end
+
diff --git a/lib/rdoc/generator.rb b/lib/rdoc/generator.rb
index 2fa891f533..9051f8a658 100644
--- a/lib/rdoc/generator.rb
+++ b/lib/rdoc/generator.rb
@@ -1,12 +1,10 @@
-require 'rdoc'
-
##
# RDoc uses generators to turn parsed source code in the form of an
# RDoc::CodeObject tree into some form of output. RDoc comes with the HTML
# generator RDoc::Generator::Darkfish and an ri data generator
# RDoc::Generator::RI.
#
-# = Registering a Generator
+# == Registering a Generator
#
# Generators are registered by calling RDoc::RDoc.add_generator with the class
# of the generator:
@@ -15,26 +13,38 @@ require 'rdoc'
# RDoc::RDoc.add_generator self
# end
#
-# = Adding Options to +rdoc+
+# == Adding Options to +rdoc+
#
# Before option processing in +rdoc+, RDoc::Options will call ::setup_options
# on the generator class with an RDoc::Options instance. The generator can
# use RDoc::Options#option_parser to add command-line options to the +rdoc+
-# tool. See OptionParser for details on how to add options.
+# tool. See RDoc::Options@Custom+Options for an example and see OptionParser
+# for details on how to add options.
#
# You can extend the RDoc::Options instance with additional accessors for your
# generator.
#
-# = Generator Instantiation
+# == Generator Instantiation
#
# After parsing, RDoc::RDoc will instantiate a generator by calling
-# #initialize with an RDoc::Options instance.
+# #initialize with an RDoc::Store instance and an RDoc::Options instance.
+#
+# The RDoc::Store instance holds documentation for parsed source code. In
+# RDoc 3 and earlier the RDoc::TopLevel class held this data. When upgrading
+# a generator from RDoc 3 and earlier you should only need to replace
+# RDoc::TopLevel with the store instance.
#
-# RDoc will then call #generate on the generator instance and pass in an Array
-# of RDoc::TopLevel instances, each representing a parsed file. You can use
-# the various class methods on RDoc::TopLevel and in the RDoc::CodeObject tree
-# to create your desired output format.
+# RDoc will then call #generate on the generator instance. You can use the
+# various methods on RDoc::Store and in the RDoc::CodeObject tree to create
+# your desired output format.
module RDoc::Generator
+
+ autoload :Markup, 'rdoc/generator/markup'
+
+ autoload :Darkfish, 'rdoc/generator/darkfish'
+ autoload :JsonIndex, 'rdoc/generator/json_index'
+ autoload :RI, 'rdoc/generator/ri'
+
end
diff --git a/lib/rdoc/generator/darkfish.rb b/lib/rdoc/generator/darkfish.rb
index 299e6b7dec..103a244a25 100644
--- a/lib/rdoc/generator/darkfish.rb
+++ b/lib/rdoc/generator/darkfish.rb
@@ -1,9 +1,8 @@
# -*- mode: ruby; ruby-indent-level: 2; tab-width: 2 -*-
-require 'pathname'
+require 'erb'
require 'fileutils'
-require 'rdoc/erbio'
-
+require 'pathname'
require 'rdoc/generator/markup'
##
@@ -46,6 +45,11 @@ require 'rdoc/generator/markup'
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# == Attributions
+#
+# Darkfish uses the {Silk Icons}[http://www.famfamfam.com/lab/icons/silk/] set
+# by Mark James.
class RDoc::Generator::Darkfish
@@ -53,6 +57,7 @@ class RDoc::Generator::Darkfish
include ERB::Util
+ ##
# Path to this file's parent directory. Used to find templates and other
# resources.
@@ -61,7 +66,7 @@ class RDoc::Generator::Darkfish
##
# Release Version
- VERSION = '2'
+ VERSION = '3'
##
# Description of this generator
@@ -69,19 +74,58 @@ class RDoc::Generator::Darkfish
DESCRIPTION = 'HTML generator, written by Michael Granger'
##
- # Initialize a few instance variables before we start
+ # The relative path to style sheets and javascript. By default this is set
+ # the same as the rel_prefix.
- def initialize options
- @options = options
+ attr_accessor :asset_rel_path
- @template_dir = Pathname.new options.template_dir
- @template_cache = {}
+ ##
+ # The path to generate files into, combined with <tt>--op</tt> from the
+ # options for a full path.
- @files = nil
- @classes = nil
+ attr_reader :base_dir
- @basedir = Pathname.pwd.expand_path
- end
+ ##
+ # Classes and modules to be used by this generator, not necessarily
+ # displayed. See also #modsort
+
+ attr_reader :classes
+
+ ##
+ # No files will be written when dry_run is true.
+
+ attr_accessor :dry_run
+
+ ##
+ # When false the generate methods return a String instead of writing to a
+ # file. The default is true.
+
+ attr_accessor :file_output
+
+ ##
+ # Files to be displayed by this generator
+
+ attr_reader :files
+
+ ##
+ # The JSON index generator for this Darkfish generator
+
+ attr_reader :json_index
+
+ ##
+ # Methods to be displayed by this generator
+
+ attr_reader :methods
+
+ ##
+ # Sorted list of classes and modules to be displayed by this generator
+
+ attr_reader :modsort
+
+ ##
+ # The RDoc::Store that is the source of the generated content
+
+ attr_reader :store
##
# The output directory
@@ -89,6 +133,29 @@ class RDoc::Generator::Darkfish
attr_reader :outputdir
##
+ # Initialize a few instance variables before we start
+
+ def initialize store, options
+ @store = store
+ @options = options
+
+ @asset_rel_path = ''
+ @base_dir = Pathname.pwd.expand_path
+ @dry_run = @options.dry_run
+ @file_output = true
+ @template_dir = Pathname.new options.template_dir
+ @template_cache = {}
+
+ @classes = nil
+ @context = nil
+ @files = nil
+ @methods = nil
+ @modsort = nil
+
+ @json_index = RDoc::Generator::JsonIndex.new self, options
+ end
+
+ ##
# Output progress information if debugging is enabled
def debug_msg *msg
@@ -126,7 +193,7 @@ class RDoc::Generator::Darkfish
def write_style_sheet
debug_msg "Copying static files"
- options = { :verbose => $DEBUG_RDOC, :noop => @options.dry_run }
+ options = { :verbose => $DEBUG_RDOC, :noop => @dry_run }
FileUtils.cp @template_dir + 'rdoc.css', '.', options
@@ -134,7 +201,7 @@ class RDoc::Generator::Darkfish
next if File.directory? path
next if File.basename(path) =~ /^\./
- dst = Pathname.new(path).relative_path_from @template_dir
+ dst = Pathname.new(path).relative_path_from @template_dir
# I suck at glob
dst_dir = dst.dirname
@@ -148,19 +215,17 @@ class RDoc::Generator::Darkfish
# Build the initial indices and output objects based on an array of TopLevel
# objects containing the extracted information.
- def generate top_levels
- @outputdir = Pathname.new(@options.op_dir).expand_path(@basedir)
+ def generate
+ setup
- @files = top_levels.sort
- @classes = RDoc::TopLevel.all_classes_and_modules.sort
- @methods = @classes.map { |m| m.method_list }.flatten.sort
- @modsort = get_sorted_module_list(@classes)
-
- # Now actually write the output
write_style_sheet
generate_index
generate_class_files
generate_file_files
+ generate_table_of_contents
+ @json_index.generate
+
+ copy_static
rescue => e
debug_msg "%s: %s\n %s" % [
@@ -170,42 +235,64 @@ class RDoc::Generator::Darkfish
raise
end
- protected
-
##
- # Return a list of the documented modules sorted by salience first, then
- # by name.
+ # Copies static files from the static_path into the output directory
- def get_sorted_module_list(classes)
- nscounts = classes.inject({}) do |counthash, klass|
- top_level = klass.full_name.gsub(/::.*/, '')
- counthash[top_level] ||= 0
- counthash[top_level] += 1
+ def copy_static
+ return if @options.static_path.empty?
- counthash
- end
+ fu_options = { :verbose => $DEBUG_RDOC, :noop => @dry_run }
- # Sort based on how often the top level namespace occurs, and then on the
- # name of the module -- this works for projects that put their stuff into
- # a namespace, of course, but doesn't hurt if they don't.
- classes.sort_by do |klass|
- top_level = klass.full_name.gsub( /::.*/, '' )
- [nscounts[top_level] * -1, klass.full_name]
- end.select do |klass|
- klass.document_self
+ @options.static_path.each do |path|
+ unless File.directory? path then
+ FileUtils.install path, @outputdir, fu_options.merge(:mode => 0644)
+ next
+ end
+
+ Dir.chdir path do
+ Dir[File.join('**', '*')].each do |entry|
+ dest_file = @outputdir + entry
+
+ if File.directory? entry then
+ FileUtils.mkdir_p entry, fu_options
+ else
+ FileUtils.install entry, dest_file, fu_options.merge(:mode => 0644)
+ end
+ end
+ end
end
end
##
+ # Return a list of the documented modules sorted by salience first, then
+ # by name.
+
+ def get_sorted_module_list classes
+ classes.select do |klass|
+ klass.display?
+ end.sort
+ end
+
+ ##
# Generate an index page which lists all the classes which are documented.
def generate_index
+ setup
+
template_file = @template_dir + 'index.rhtml'
return unless template_file.exist?
debug_msg "Rendering the index page..."
- out_file = @basedir + @options.op_dir + 'index.html'
+ out_file = @base_dir + @options.op_dir + 'index.html'
+ rel_prefix = @outputdir.relative_path_from out_file.dirname
+ search_index_rel_prefix = rel_prefix
+ search_index_rel_prefix += @asset_rel_path if @file_output
+
+ # suppress 1.9.3 warning
+ asset_rel_prefix = asset_rel_prefix = rel_prefix + @asset_rel_path
+
+ @title = @options.title
render_template template_file, out_file do |io| binding end
rescue => e
@@ -217,10 +304,40 @@ class RDoc::Generator::Darkfish
end
##
- # Generate a documentation file for each class
+ # Generates a class file for +klass+
+
+ def generate_class klass, template_file = nil
+ setup
+
+ current = klass
+
+ template_file ||= @template_dir + 'class.rhtml'
+
+ debug_msg " working on %s (%s)" % [klass.full_name, klass.path]
+ out_file = @outputdir + klass.path
+ rel_prefix = @outputdir.relative_path_from out_file.dirname
+ search_index_rel_prefix = rel_prefix
+ search_index_rel_prefix += @asset_rel_path if @file_output
+
+ # suppress 1.9.3 warning
+ asset_rel_prefix = asset_rel_prefix = rel_prefix + @asset_rel_path
+ svninfo = svninfo = get_svninfo(current)
+
+ @title = "#{klass.type} #{klass.full_name} - #{@options.title}"
+
+ debug_msg " rendering #{out_file}"
+ render_template template_file, out_file do |io| binding end
+ end
+
+ ##
+ # Generate a documentation file for each class and module
def generate_class_files
- template_file = @template_dir + 'classpage.rhtml'
+ setup
+
+ template_file = @template_dir + 'class.rhtml'
+ template_file = @template_dir + 'classpage.rhtml' unless
+ template_file.exist?
return unless template_file.exist?
debug_msg "Generating class documentation in #{@outputdir}"
@@ -228,14 +345,8 @@ class RDoc::Generator::Darkfish
@classes.each do |klass|
current = klass
- debug_msg " working on %s (%s)" % [klass.full_name, klass.path]
- out_file = @outputdir + klass.path
- # suppress 1.9.3 warning
- rel_prefix = rel_prefix = @outputdir.relative_path_from(out_file.dirname)
- svninfo = svninfo = self.get_svninfo(klass)
- debug_msg " rendering #{out_file}"
- render_template template_file, out_file do |io| binding end
+ generate_class klass, template_file
end
rescue => e
error = RDoc::Error.new \
@@ -249,19 +360,56 @@ class RDoc::Generator::Darkfish
# Generate a documentation file for each file
def generate_file_files
- template_file = @template_dir + 'filepage.rhtml'
- return unless template_file.exist?
+ setup
+
+ page_file = @template_dir + 'page.rhtml'
+ fileinfo_file = @template_dir + 'fileinfo.rhtml'
+
+ # for legacy templates
+ filepage_file = @template_dir + 'filepage.rhtml' unless
+ page_file.exist? or fileinfo_file.exist?
+
+ return unless
+ page_file.exist? or fileinfo_file.exist? or filepage_file.exist?
+
debug_msg "Generating file documentation in #{@outputdir}"
out_file = nil
+ current = nil
@files.each do |file|
- out_file = @outputdir + file.path
+ current = file
+
+ if file.text? and page_file.exist? then
+ generate_page file
+ next
+ end
+
+ template_file = nil
+ out_file = @outputdir + file.path
debug_msg " working on %s (%s)" % [file.full_name, out_file]
+ rel_prefix = @outputdir.relative_path_from out_file.dirname
+ search_index_rel_prefix = rel_prefix
+ search_index_rel_prefix += @asset_rel_path if @file_output
+
# suppress 1.9.3 warning
- rel_prefix = rel_prefix = @outputdir.relative_path_from(out_file.dirname)
+ asset_rel_prefix = asset_rel_prefix = rel_prefix + @asset_rel_path
+
+ unless filepage_file then
+ if file.text? then
+ next unless page_file.exist?
+ template_file = page_file
+ @title = file.page_name
+ else
+ next unless fileinfo_file.exist?
+ template_file = fileinfo_file
+ @title = "File: #{file.base_name}"
+ end
+ end
+
+ @title += " - #{@options.title}"
+ template_file ||= filepage_file
- debug_msg " rendering #{out_file}"
render_template template_file, out_file do |io| binding end
end
rescue => e
@@ -273,6 +421,132 @@ class RDoc::Generator::Darkfish
end
##
+ # Generate a page file for +file+
+
+ def generate_page file
+ setup
+
+ template_file = @template_dir + 'page.rhtml'
+
+ out_file = @outputdir + file.path
+ debug_msg " working on %s (%s)" % [file.full_name, out_file]
+ rel_prefix = @outputdir.relative_path_from out_file.dirname
+ search_index_rel_prefix = rel_prefix
+ search_index_rel_prefix += @asset_rel_path if @file_output
+
+ # suppress 1.9.3 warning
+ current = current = file
+ asset_rel_prefix = asset_rel_prefix = rel_prefix + @asset_rel_path
+
+ @title = "#{file.page_name} - #{@options.title}"
+
+ debug_msg " rendering #{out_file}"
+ render_template template_file, out_file do |io| binding end
+ end
+
+ ##
+ # Generates the 404 page for the RDoc servlet
+
+ def generate_servlet_not_found path
+ setup
+
+ template_file = @template_dir + 'servlet_not_found.rhtml'
+ return unless template_file.exist?
+
+ debug_msg "Rendering the servlet root page..."
+
+ rel_prefix = rel_prefix = ''
+ search_index_rel_prefix = rel_prefix
+ search_index_rel_prefix += @asset_rel_path if @file_output
+
+ # suppress 1.9.3 warning
+ asset_rel_prefix = asset_rel_prefix = ''
+
+ @title = 'Not Found'
+
+ render_template template_file do |io| binding end
+ rescue => e
+ error = RDoc::Error.new \
+ "error generating servlet_not_found: #{e.message} (#{e.class})"
+ error.set_backtrace e.backtrace
+
+ raise error
+ end
+
+ ##
+ # Generates the servlet root page for the RDoc servlet
+
+ def generate_servlet_root installed
+ setup
+
+ template_file = @template_dir + 'servlet_root.rhtml'
+ return unless template_file.exist?
+
+ debug_msg 'Rendering the servlet root page...'
+
+ rel_prefix = '.'
+ asset_rel_prefix = rel_prefix
+ search_index_rel_prefix = asset_rel_prefix
+ search_index_rel_prefix += @asset_rel_path if @file_output
+
+ @title = 'Local RDoc Documentation'
+
+ render_template template_file do |io| binding end
+ rescue => e
+ error = RDoc::Error.new \
+ "error generating servlet_root: #{e.message} (#{e.class})"
+ error.set_backtrace e.backtrace
+
+ raise error
+ end
+
+ ##
+ # Generate an index page which lists all the classes which are documented.
+
+ def generate_table_of_contents
+ setup
+
+ template_file = @template_dir + 'table_of_contents.rhtml'
+ return unless template_file.exist?
+
+ debug_msg "Rendering the Table of Contents..."
+
+ out_file = @outputdir + 'table_of_contents.html'
+ rel_prefix = @outputdir.relative_path_from out_file.dirname
+ search_index_rel_prefix = rel_prefix
+ search_index_rel_prefix += @asset_rel_path if @file_output
+
+ # suppress 1.9.3 warning
+ asset_rel_prefix = asset_rel_prefix = rel_prefix + @asset_rel_path
+
+ @title = "Table of Contents - #{@options.title}"
+
+ render_template template_file, out_file do |io| binding end
+ rescue => e
+ error = RDoc::Error.new \
+ "error generating table_of_contents.html: #{e.message} (#{e.class})"
+ error.set_backtrace e.backtrace
+
+ raise error
+ end
+
+ ##
+ # Prepares for generation of output from the current directory
+
+ def setup
+ return if instance_variable_defined? :@outputdir
+
+ @outputdir = Pathname.new(@options.op_dir).expand_path @base_dir
+
+ return unless @store
+
+ @classes = @store.all_classes_and_modules.sort
+ @files = @store.all_files.sort
+ @methods = @classes.map { |m| m.method_list }.flatten.sort
+ @modsort = get_sorted_module_list @classes
+ end
+
+ ##
# Return a string describing the amount of time in the given number of
# seconds in terms a human can understand easily.
@@ -325,6 +599,46 @@ class RDoc::Generator::Darkfish
end
##
+ # Creates a template from its components and the +body_file+.
+ #
+ # For backwards compatibility, if +body_file+ contains "<html" the body is
+ # used directly.
+
+ def assemble_template body_file
+ body = body_file.read
+ return body if body =~ /<html/
+
+ head_file = @template_dir + '_head.rhtml'
+ footer_file = @template_dir + '_footer.rhtml'
+
+ <<-TEMPLATE
+<!DOCTYPE html>
+
+<html>
+<head>
+#{head_file.read}
+
+#{body}
+
+#{footer_file.read}
+ TEMPLATE
+ end
+
+ ##
+ # Renders the ERb contained in +file_name+ relative to the template
+ # directory and returns the result based on the current context.
+
+ def render file_name
+ template_file = @template_dir + file_name
+
+ template = template_for template_file, false, RDoc::ERBPartial
+
+ template.filename = template_file.to_s
+
+ template.result @context
+ end
+
+ ##
# Load and render the erb template in the given +template_file+ and write
# it out to +out_file+.
#
@@ -332,28 +646,33 @@ class RDoc::Generator::Darkfish
#
# An io will be yielded which must be captured by binding in the caller.
- def render_template template_file, out_file # :yield: io
- template = template_for template_file
+ def render_template template_file, out_file = nil # :yield: io
+ io_output = out_file && !@dry_run && @file_output
+ erb_klass = io_output ? RDoc::ERBIO : ERB
+
+ template = template_for template_file, true, erb_klass
- unless @options.dry_run then
+ if io_output then
debug_msg "Outputting to %s" % [out_file.expand_path]
out_file.dirname.mkpath
out_file.open 'w', 0644 do |io|
io.set_encoding @options.encoding if Object.const_defined? :Encoding
- context = yield io
+ @context = yield io
- template_result template, context, template_file
+ template_result template, @context, template_file
end
else
- context = yield nil
+ @context = yield nil
- output = template_result template, context, template_file
+ output = template_result template, @context, template_file
debug_msg " would have written %d characters to %s" % [
output.length, out_file.expand_path
- ]
+ ] if @dry_run
+
+ output
end
end
@@ -374,14 +693,25 @@ class RDoc::Generator::Darkfish
##
# Retrieves a cache template for +file+, if present, or fills the cache.
- def template_for file
+ def template_for file, page = true, klass = ERB
template = @template_cache[file]
return template if template
- klass = @options.dry_run ? ERB : RDoc::ERBIO
+ template = if page then
+ assemble_template file
+ else
+ file.read
+ end
+
+ erbout = if page then
+ 'io'
+ else
+ file_var = File.basename(file).sub(/\..*/, '')
+ "_erbout_#{file_var}"
+ end
- template = klass.new file.read, nil, '<>'
+ template = klass.new template, nil, '<>', erbout
@template_cache[file] = template
template
end
diff --git a/lib/rdoc/generator/json_index.rb b/lib/rdoc/generator/json_index.rb
new file mode 100644
index 0000000000..c303b2effb
--- /dev/null
+++ b/lib/rdoc/generator/json_index.rb
@@ -0,0 +1,248 @@
+require 'json'
+
+##
+# The JsonIndex generator is designed to complement an HTML generator and
+# produces a JSON search index. This generator is derived from sdoc by
+# Vladimir Kolesnikov and contains verbatim code written by him.
+#
+# This generator is designed to be used with a regular HTML generator:
+#
+# class RDoc::Generator::Darkfish
+# def initialize options
+# # ...
+# @base_dir = Pathname.pwd.expand_path
+#
+# @json_index = RDoc::Generator::JsonIndex.new self, options
+# end
+#
+# def generate
+# # ...
+# @json_index.generate
+# end
+# end
+#
+# == Index Format
+#
+# The index is output as a JSON file assigned to the global variable
+# +search_data+. The structure is:
+#
+# var search_data = {
+# "index": {
+# "searchIndex":
+# ["a", "b", ...],
+# "longSearchIndex":
+# ["a", "a::b", ...],
+# "info": [
+# ["A", "A", "A.html", "", ""],
+# ["B", "A::B", "A::B.html", "", ""],
+# ...
+# ]
+# }
+# }
+#
+# The same item is described across the +searchIndex+, +longSearchIndex+ and
+# +info+ fields. The +searchIndex+ field contains the item's short name, the
+# +longSearchIndex+ field contains the full_name (when appropriate) and the
+# +info+ field contains the item's name, full_name, path, parameters and a
+# snippet of the item's comment.
+#
+# == LICENSE
+#
+# Copyright (c) 2009 Vladimir Kolesnikov
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+class RDoc::Generator::JsonIndex
+
+ include RDoc::Text
+
+ ##
+ # Where the search index lives in the generated output
+
+ SEARCH_INDEX_FILE = File.join 'js', 'search_index.js'
+
+ attr_reader :index # :nodoc:
+
+ ##
+ # Creates a new generator. +parent_generator+ is used to determine the
+ # class_dir and file_dir of links in the output index.
+ #
+ # +options+ are the same options passed to the parent generator.
+
+ def initialize parent_generator, options
+ @parent_generator = parent_generator
+ @store = parent_generator.store
+ @options = options
+
+ @template_dir = File.expand_path '../template/json_index', __FILE__
+ @base_dir = @parent_generator.base_dir
+
+ @classes = nil
+ @files = nil
+ @index = nil
+ end
+
+ ##
+ # Builds the JSON index as a Hash.
+
+ def build_index
+ reset @store.all_files.sort, @store.all_classes_and_modules.sort
+
+ index_classes
+ index_methods
+ index_pages
+
+ { :index => @index }
+ end
+
+ ##
+ # Output progress information if debugging is enabled
+
+ def debug_msg *msg
+ return unless $DEBUG_RDOC
+ $stderr.puts(*msg)
+ end
+
+ ##
+ # Writes the JSON index to disk
+
+ def generate
+ debug_msg "Generating JSON index"
+
+ debug_msg " writing search index to %s" % SEARCH_INDEX_FILE
+ data = build_index
+
+ return if @options.dry_run
+
+ out_dir = @base_dir + @options.op_dir
+ index_file = out_dir + SEARCH_INDEX_FILE
+
+ FileUtils.mkdir_p index_file.dirname, :verbose => $DEBUG_RDOC
+
+ index_file.open 'w', 0644 do |io|
+ io.set_encoding Encoding::UTF_8 if Object.const_defined? :Encoding
+ io.write 'var search_data = '
+
+ JSON.dump data, io, 0
+ end
+
+ Dir.chdir @template_dir do
+ Dir['**/*.js'].each do |source|
+ dest = File.join out_dir, source
+
+ FileUtils.install source, dest, :mode => 0644, :verbose => $DEBUG_RDOC
+ end
+ end
+ end
+
+ ##
+ # Adds classes and modules to the index
+
+ def index_classes
+ debug_msg " generating class search index"
+
+ documented = @classes.uniq.select do |klass|
+ klass.document_self_or_methods
+ end
+
+ documented.each do |klass|
+ debug_msg " #{klass.full_name}"
+ record = klass.search_record
+ @index[:searchIndex] << search_string(record.shift)
+ @index[:longSearchIndex] << search_string(record.shift)
+ @index[:info] << record
+ end
+ end
+
+ ##
+ # Adds methods to the index
+
+ def index_methods
+ debug_msg " generating method search index"
+
+ list = @classes.uniq.map do |klass|
+ klass.method_list
+ end.flatten.sort_by do |method|
+ [method.name, method.parent.full_name]
+ end
+
+ list.each do |method|
+ debug_msg " #{method.full_name}"
+ record = method.search_record
+ @index[:searchIndex] << "#{search_string record.shift}()"
+ @index[:longSearchIndex] << "#{search_string record.shift}()"
+ @index[:info] << record
+ end
+ end
+
+ ##
+ # Adds pages to the index
+
+ def index_pages
+ debug_msg " generating pages search index"
+
+ pages = @files.select do |file|
+ file.text?
+ end
+
+ pages.each do |page|
+ debug_msg " #{page.page_name}"
+ record = page.search_record
+ @index[:searchIndex] << search_string(record.shift)
+ @index[:longSearchIndex] << ''
+ record.shift
+ @index[:info] << record
+ end
+ end
+
+ ##
+ # The directory classes are written to
+
+ def class_dir
+ @parent_generator.class_dir
+ end
+
+ ##
+ # The directory files are written to
+
+ def file_dir
+ @parent_generator.file_dir
+ end
+
+ def reset files, classes # :nodoc:
+ @files = files
+ @classes = classes
+
+ @index = {
+ :searchIndex => [],
+ :longSearchIndex => [],
+ :info => []
+ }
+ end
+
+ ##
+ # Removes whitespace and downcases +string+
+
+ def search_string string
+ string.downcase.gsub(/\s/, '')
+ end
+
+end
+
diff --git a/lib/rdoc/generator/markup.rb b/lib/rdoc/generator/markup.rb
index c267bb1c13..788e5a485d 100644
--- a/lib/rdoc/generator/markup.rb
+++ b/lib/rdoc/generator/markup.rb
@@ -1,14 +1,8 @@
-# This file is loaded by generators. It allows RDoc's CodeObject tree to
-# avoid loading generator code to increase startup time (for ri).
-
-require 'rdoc/text'
-require 'rdoc/code_objects'
-require 'rdoc/generator'
-require 'rdoc/markup/to_html_crossref'
-require 'rdoc/ruby_token'
-
##
# Handle common RDoc::Markup tasks for various CodeObjects
+#
+# This module is loaded by generators. It allows RDoc's CodeObject tree to
+# avoid loading generator code to improve startup time for +ri+.
module RDoc::Generator::Markup
@@ -39,18 +33,18 @@ module RDoc::Generator::Markup
def formatter
return @formatter if defined? @formatter
- show_hash = RDoc::RDoc.current.options.show_hash
- hyperlink_all = RDoc::RDoc.current.options.hyperlink_all
+ options = @store.rdoc.options
this = RDoc::Context === self ? self : @parent
- @formatter = RDoc::Markup::ToHtmlCrossref.new(this.path, this, show_hash,
- hyperlink_all)
+ @formatter = RDoc::Markup::ToHtmlCrossref.new options, this.path, this
+ @formatter.code_object = self
+ @formatter
end
##
# Build a webcvs URL starting for the given +url+ with +full_path+ appended
# as the destination path. If +url+ contains '%s' +full_path+ will be
- # sprintf'd into +url+ instead.
+ # will replace the %s using sprintf on the +url+.
def cvs_url(url, full_path)
if /%s/ =~ url then
@@ -62,10 +56,14 @@ module RDoc::Generator::Markup
end
-class RDoc::AnyMethod
+class RDoc::CodeObject
include RDoc::Generator::Markup
+end
+
+class RDoc::MethodAttr
+
@add_line_numbers = false
class << self
@@ -82,7 +80,8 @@ class RDoc::AnyMethod
#
# # File xxxxx, line dddd
#
- # If it has, line numbers are added an ', line dddd' is removed.
+ # If it has this comment then line numbers are added to +src+ and the <tt>,
+ # line dddd</tt> portion of the comment is removed.
def add_line_numbers(src)
return unless src.sub!(/\A(.*)(, line (\d+))/, '\1')
@@ -111,32 +110,7 @@ class RDoc::AnyMethod
def markup_code
return '' unless @token_stream
- src = ""
-
- @token_stream.each do |t|
- next unless t
-
- style = case t
- when RDoc::RubyToken::TkCONSTANT then 'ruby-constant'
- when RDoc::RubyToken::TkKW then 'ruby-keyword'
- when RDoc::RubyToken::TkIVAR then 'ruby-ivar'
- when RDoc::RubyToken::TkOp then 'ruby-operator'
- when RDoc::RubyToken::TkId then 'ruby-identifier'
- when RDoc::RubyToken::TkNode then 'ruby-node'
- when RDoc::RubyToken::TkCOMMENT then 'ruby-comment'
- when RDoc::RubyToken::TkREGEXP then 'ruby-regexp'
- when RDoc::RubyToken::TkSTRING then 'ruby-string'
- when RDoc::RubyToken::TkVal then 'ruby-value'
- end
-
- text = CGI.escapeHTML t.text
-
- if style then
- src << "<span class=\"#{style}\">#{text}</span>"
- else
- src << text
- end
- end
+ src = RDoc::TokenStream.to_html @token_stream
# dedent the source
indent = src.length
@@ -151,34 +125,21 @@ class RDoc::AnyMethod
end
src.gsub!(/^#{' ' * indent}/, '') if indent > 0
- add_line_numbers(src) if self.class.add_line_numbers
+ add_line_numbers(src) if RDoc::MethodAttr.add_line_numbers
src
end
end
-class RDoc::Attr
+class RDoc::ClassModule
- include RDoc::Generator::Markup
-
-end
-
-class RDoc::Alias
-
- include RDoc::Generator::Markup
-
-end
-
-class RDoc::Constant
-
- include RDoc::Generator::Markup
-
-end
-
-class RDoc::Context
+ ##
+ # Handy wrapper for marking up this class or module's comment
- include RDoc::Generator::Markup
+ def description
+ markup @comment_location
+ end
end
@@ -195,12 +156,12 @@ class RDoc::TopLevel
# command line option to set.
def cvs_url
- url = RDoc::RDoc.current.options.webcvs
+ url = @store.rdoc.options.webcvs
if /%s/ =~ url then
- url % @absolute_name
+ url % @relative_name
else
- url + @absolute_name
+ url + @relative_name
end
end
diff --git a/lib/rdoc/generator/ri.rb b/lib/rdoc/generator/ri.rb
index 939a165cfb..b9c4141a5e 100644
--- a/lib/rdoc/generator/ri.rb
+++ b/lib/rdoc/generator/ri.rb
@@ -1,6 +1,3 @@
-require 'rdoc/generator'
-require 'rdoc/ri'
-
##
# Generates ri data files
@@ -16,70 +13,17 @@ class RDoc::Generator::RI
##
# Set up a new ri generator
- def initialize options #:not-new:
- @options = options
- @old_siginfo = nil
- @current = nil
-
- @store = RDoc::RI::Store.new '.'
- @store.dry_run = @options.dry_run
- @store.encoding = @options.encoding if @options.respond_to? :encoding
- end
-
- ##
- # Build the initial indices and output objects based on an array of TopLevel
- # objects containing the extracted information.
-
- def generate top_levels
- install_siginfo_handler
-
- @store.load_cache
-
- RDoc::TopLevel.all_classes_and_modules.each do |klass|
- @current = "#{klass.class}: #{klass.full_name}"
-
- @store.save_class klass
-
- klass.each_method do |method|
- @current = "#{method.class}: #{method.full_name}"
- @store.save_method klass, method
- end
-
- klass.each_attribute do |attribute|
- @store.save_method klass, attribute
- end
- end
-
- @current = 'saving cache'
-
- @store.save_cache
-
- ensure
- @current = nil
-
- remove_siginfo_handler
+ def initialize store, options #:not-new:
+ @options = options
+ @store = store
+ @store.path = '.'
end
##
- # Installs a siginfo handler that prints the current filename.
-
- def install_siginfo_handler
- return unless Signal.list.key? 'INFO'
-
- @old_siginfo = trap 'INFO' do
- puts @current if @current
- end
- end
-
- ##
- # Removes a siginfo handler and replaces the previous
-
- def remove_siginfo_handler
- return unless Signal.list.key? 'INFO'
-
- handler = @old_siginfo || 'DEFAULT'
+ # Writes the parsed data store to disk for use by ri.
- trap 'INFO', handler
+ def generate
+ @store.save
end
end
diff --git a/lib/rdoc/generator/template/darkfish/_footer.rhtml b/lib/rdoc/generator/template/darkfish/_footer.rhtml
new file mode 100644
index 0000000000..0736c335ba
--- /dev/null
+++ b/lib/rdoc/generator/template/darkfish/_footer.rhtml
@@ -0,0 +1,5 @@
+<footer id="validator-badges">
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> <%= RDoc::VERSION %>.
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> <%= RDoc::Generator::Darkfish::VERSION %>.
+</footer>
diff --git a/lib/rdoc/generator/template/darkfish/_head.rhtml b/lib/rdoc/generator/template/darkfish/_head.rhtml
new file mode 100644
index 0000000000..f3d82a37f6
--- /dev/null
+++ b/lib/rdoc/generator/template/darkfish/_head.rhtml
@@ -0,0 +1,16 @@
+<meta content="text/html; charset=<%= @options.charset %>" http-equiv="Content-Type">
+
+<title><%= h @title %></title>
+
+<link type="text/css" media="screen" href="<%= asset_rel_prefix %>/rdoc.css" rel="stylesheet">
+
+<script type="text/javascript">
+ var rdoc_rel_prefix = "<%= rel_prefix %>/";
+</script>
+
+<script type="text/javascript" charset="utf-8" src="<%= asset_rel_prefix %>/js/jquery.js"></script>
+<script type="text/javascript" charset="utf-8" src="<%= asset_rel_prefix %>/js/navigation.js"></script>
+<script type="text/javascript" charset="utf-8" src="<%= search_index_rel_prefix %>/js/search_index.js"></script>
+<script type="text/javascript" charset="utf-8" src="<%= asset_rel_prefix %>/js/search.js"></script>
+<script type="text/javascript" charset="utf-8" src="<%= asset_rel_prefix %>/js/searcher.js"></script>
+<script type="text/javascript" charset="utf-8" src="<%= asset_rel_prefix %>/js/darkfish.js"></script>
diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml
new file mode 100644
index 0000000000..93d57f39f6
--- /dev/null
+++ b/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml
@@ -0,0 +1,18 @@
+<% if !svninfo.empty? then %>
+<nav id="file-svninfo-section" class="section">
+ <h3 class="section-header">VCS Info</h3>
+ <div class="section-body">
+ <dl class="svninfo">
+ <dt>Rev
+ <dd><%= svninfo[:rev] %>
+
+ <dt>Last Checked In
+ <dd><%= svninfo[:commitdate].strftime('%Y-%m-%d %H:%M:%S') %>
+ (<%= svninfo[:commitdelta] %> ago)
+
+ <dt>Checked in by
+ <dd><%= svninfo[:committer] %>
+ </dl>
+ </div>
+</nav>
+<% end %>
diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml
new file mode 100644
index 0000000000..efa202fa18
--- /dev/null
+++ b/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml
@@ -0,0 +1,9 @@
+<nav id="classindex-section" class="section project-section">
+ <h3 class="section-header">Class and Module Index</h3>
+
+ <ul class="link-list">
+ <% @modsort.each do |index_klass| %>
+ <li><a href="<%= rel_prefix %>/<%= index_klass.path %>"><%= index_klass.full_name %></a>
+ <% end %>
+ </ul>
+</nav>
diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml
new file mode 100644
index 0000000000..19273829a0
--- /dev/null
+++ b/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml
@@ -0,0 +1,16 @@
+<% unless klass.extends.empty? then %>
+<!-- Extension Modules -->
+<nav id="extends-section" class="section">
+ <h3 class="section-header">Extended With Modules</h3>
+
+ <ul class="link-list">
+ <% klass.each_extend do |ext| %>
+ <% unless String === ext.module then %>
+ <li><a class="extend" href="<%= klass.aref_to ext.module.path %>"><%= ext.module.full_name %></a>
+ <% else %>
+ <li><span class="extend"><%= ext.name %></span>
+ <% end %>
+ <% end %>
+ </ul>
+</nav>
+<% end %>
diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml
new file mode 100644
index 0000000000..22be0c9b65
--- /dev/null
+++ b/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml
@@ -0,0 +1,8 @@
+<nav id="file-list-section" class="section">
+ <h3 class="section-header">Defined In</h3>
+ <ul>
+<% klass.in_files.each do |tl| %>
+ <li><%= h tl.relative_name %>
+<% end %>
+ </ul>
+</nav>
diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml
new file mode 100644
index 0000000000..5494f1f5f8
--- /dev/null
+++ b/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml
@@ -0,0 +1,16 @@
+<% unless klass.includes.empty? then %>
+<!-- Included Modules -->
+<nav id="includes-section" class="section">
+ <h3 class="section-header">Included Modules</h3>
+
+ <ul class="link-list">
+ <% klass.each_include do |inc| %>
+ <% unless String === inc.module then %>
+ <li><a class="include" href="<%= klass.aref_to inc.module.path %>"><%= inc.module.full_name %></a>
+ <% else %>
+ <li><span class="include"><%= inc.name %></span>
+ <% end %>
+ <% end %>
+ </ul>
+</nav>
+<% end %>
diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml
new file mode 100644
index 0000000000..45a3048e84
--- /dev/null
+++ b/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml
@@ -0,0 +1,14 @@
+<nav id="home-section" class="section">
+ <h3 class="section-header">Documentation</h3>
+
+ <ul>
+ <% installed.each do |name, href, exists| %>
+ <li class="folder">
+ <% if exists then %>
+ <a href="<%= href %>"><%= h name %></a>
+ <% else %>
+ <%= h name %>
+ <% end %>
+ <% end %>
+ </ul>
+</nav>
diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml
new file mode 100644
index 0000000000..88e2734819
--- /dev/null
+++ b/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml
@@ -0,0 +1,12 @@
+<% unless klass.method_list.empty? then %>
+<!-- Method Quickref -->
+<nav id="method-list-section" class="section">
+ <h3 class="section-header">Methods</h3>
+
+ <ul class="link-list">
+ <% klass.each_method do |meth| %>
+ <li <% if meth.calls_super %>class="calls-super" <% end %>><a href="#<%= meth.aref %>"><%= meth.singleton ? '::' : '#' %><%= h meth.name %></a>
+ <% end %>
+ </ul>
+</nav>
+<% end %>
diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml
new file mode 100644
index 0000000000..fdeb6aed9f
--- /dev/null
+++ b/lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml
@@ -0,0 +1,7 @@
+<nav id="home-section" class="section">
+ <h3 class="section-header">
+ <a href="<%= rel_prefix %>/index.html">Home</a>
+ <a href="<%= rel_prefix %>/table_of_contents.html#classes">Classes</a>
+ <a href="<%= rel_prefix %>/table_of_contents.html#methods">Methods</a>
+ </h3>
+</nav>
diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml
new file mode 100644
index 0000000000..2089387c51
--- /dev/null
+++ b/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml
@@ -0,0 +1,12 @@
+<% simple_files = @files.select { |f| f.text? } %>
+<% unless simple_files.empty? then %>
+<nav id="fileindex-section" class="section project-section">
+ <h3 class="section-header">Pages</h3>
+
+ <ul>
+ <% simple_files.each do |f| %>
+ <li class="file"><a href="<%= rel_prefix %>/<%= f.path %>"><%= h f.page_name %></a>
+ <% end %>
+ </ul>
+</nav>
+<% end %>
diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml
new file mode 100644
index 0000000000..463f05a8d9
--- /dev/null
+++ b/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml
@@ -0,0 +1,10 @@
+<% if klass.type == 'class' then %>
+<nav id="parent-class-section" class="section">
+ <h3 class="section-header">Parent</h3>
+ <% if klass.superclass and not String === klass.superclass then %>
+ <p class="link"><a href="<%= klass.aref_to klass.superclass.path %>"><%= klass.superclass.full_name %></a>
+ <% else %>
+ <p class="link"><%= klass.superclass %>
+ <% end %>
+</nav>
+<% end %>
diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml
new file mode 100644
index 0000000000..f3275783d0
--- /dev/null
+++ b/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml
@@ -0,0 +1,10 @@
+<nav id="search-section" class="section project-section" class="initially-hidden">
+ <form action="#" method="get" accept-charset="utf-8">
+ <h3 class="section-header">
+ <input type="text" name="search" placeholder="Search" id="search-field"
+ title="Type to search, Up and Down to navigate, Enter to load">
+ </h3>
+ </form>
+
+ <ul id="search-results" class="initially-hidden"></ul>
+</nav>
diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml
new file mode 100644
index 0000000000..726423a341
--- /dev/null
+++ b/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml
@@ -0,0 +1,10 @@
+<% unless klass.sections.length == 1 then %>
+<nav id="sections-section" class="section">
+ <h3 class="section-header">Sections</h3>
+ <ul class="link-list">
+ <% klass.sort_sections.each do |section| %>
+ <li><a href="#<%= section.aref %>"><%= h section.title %></a></li>
+ <% end %>
+ </ul>
+</nav>
+<% end %>
diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml
new file mode 100644
index 0000000000..225f811f0e
--- /dev/null
+++ b/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml
@@ -0,0 +1,13 @@
+<% table = current.parse(current.comment).table_of_contents
+ if table.length > 1 then %>
+<div id="table-of-contents">
+ <nav class="section">
+ <h3 class="section-header">Table of Contents</h3>
+ <ul>
+<% table.each do |heading| %>
+ <li><a href="#<%= heading.aref %>"><%= heading.plain_html %></a>
+<% end %>
+ </ul>
+ </nav>
+</div>
+<% end %>
diff --git a/lib/rdoc/generator/template/darkfish/class.rhtml b/lib/rdoc/generator/template/darkfish/class.rhtml
new file mode 100644
index 0000000000..c7e52e6808
--- /dev/null
+++ b/lib/rdoc/generator/template/darkfish/class.rhtml
@@ -0,0 +1,179 @@
+<body id="top" class="<%= klass.type %>">
+<nav id="metadata">
+ <%= render '_sidebar_navigation.rhtml' %>
+
+ <%= render '_sidebar_search.rhtml' %>
+
+ <%= render '_sidebar_table_of_contents.rhtml' %>
+
+ <div id="file-metadata">
+ <%= render '_sidebar_in_files.rhtml' %>
+ <%= render '_sidebar_VCS_info.rhtml' %>
+ </div>
+
+ <div id="class-metadata">
+ <%= render '_sidebar_sections.rhtml' %>
+ <%= render '_sidebar_parent.rhtml' %>
+ <%= render '_sidebar_includes.rhtml' %>
+ <%= render '_sidebar_extends.rhtml' %>
+ <%= render '_sidebar_methods.rhtml' %>
+ </div>
+
+ <div id="project-metadata">
+ <%= render '_sidebar_pages.rhtml' %>
+ <%= render '_sidebar_classes.rhtml' %>
+ </div>
+</nav>
+
+<div id="documentation">
+ <h1 class="<%= klass.type %>"><%= klass.type %> <%= klass.full_name %></h1>
+
+ <div id="description" class="description">
+ <%= klass.description %>
+ </div><!-- description -->
+
+ <% klass.each_section do |section, constants, attributes| %>
+ <% constants = constants.select { |const| const.display? } %>
+ <% attributes = attributes.select { |attr| attr.display? } %>
+ <section id="<%= section.aref %>" class="documentation-section">
+ <% if section.title then %>
+ <div class="documentation-section-title">
+ <h2 class="section-header">
+ <%= section.title %>
+ </h2>
+ <span class="section-click-top">
+ <a href="#top">&uarr; top</a>
+ </span>
+ </div>
+ <% end %>
+
+ <% if section.comment then %>
+ <div class="description">
+ <%= section.description %>
+ </div>
+ <% end %>
+
+ <% unless constants.empty? then %>
+ <!-- Constants -->
+ <section id="constants-list" class="section">
+ <h3 class="section-header">Constants</h3>
+ <dl>
+ <% constants.each do |const| %>
+ <dt id="<%= const.name %>"><%= const.name %>
+ <% if const.comment then %>
+ <dd class="description"><%= const.description.strip %>
+ <% else %>
+ <dd class="description missing-docs">(Not documented)
+ <% end %>
+ <% end %>
+ </dl>
+ </section>
+ <% end %>
+
+ <% unless attributes.empty? then %>
+ <!-- Attributes -->
+ <section id="attribute-method-details" class="method-section section">
+ <h3 class="section-header">Attributes</h3>
+
+ <% attributes.each do |attrib| %>
+ <div id="<%= attrib.aref %>" class="method-detail">
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name"><%= h attrib.name %></span><span
+ class="attribute-access-type">[<%= attrib.rw %>]</span>
+ </div>
+
+ <div class="method-description">
+ <% if attrib.comment then %>
+ <%= attrib.description.strip %>
+ <% else %>
+ <p class="missing-docs">(Not documented)
+ <% end %>
+ </div>
+ </div>
+ <% end %>
+ </section><!-- attribute-method-details -->
+ <% end %>
+
+ <!-- Methods -->
+ <% klass.methods_by_type(section).each do |type, visibilities|
+ next if visibilities.empty?
+ visibilities.each do |visibility, methods|
+ next if methods.empty? %>
+ <section id="<%= visibility %>-<%= type %>-<%= section.aref %>-method-details" class="method-section section">
+ <h3 class="section-header"><%= visibility.to_s.capitalize %> <%= type.capitalize %> Methods</h3>
+
+ <% methods.each do |method| %>
+ <div id="<%= method.aref %>" class="method-detail <%= method.is_alias_for ? "method-alias" : '' %>">
+ <% if method.call_seq then %>
+ <% method.call_seq.strip.split("\n").each_with_index do |call_seq, i| %>
+ <div class="method-heading">
+ <span class="method-callseq">
+ <%= h(call_seq.strip.
+ gsub( /^\w+\./m, '')).
+ gsub(/(.*)[-=]&gt;/, '\1&rarr;') %>
+ </span>
+ <% if i == 0 and method.token_stream then %>
+ <span class="method-click-advice">click to toggle source</span>
+ <% end %>
+ </div>
+ <% end %>
+ <% else %>
+ <div class="method-heading">
+ <span class="method-name"><%= h method.name %></span><span
+ class="method-args"><%= method.param_seq %></span>
+ <% if method.token_stream then %>
+ <span class="method-click-advice">click to toggle source</span>
+ <% end %>
+ </div>
+ <% end %>
+
+ <div class="method-description">
+ <% if method.comment then %>
+ <%= method.description.strip %>
+ <% else %>
+ <p class="missing-docs">(Not documented)
+ <% end %>
+ <% if method.calls_super then %>
+ <div class="method-calls-super">
+ Calls superclass method
+ <%=
+ method.superclass_method ?
+ method.formatter.link(method.superclass_method.full_name, method.superclass_method.full_name) : nil
+ %>
+ </div>
+ <% end %>
+
+ <% if method.token_stream then %>
+ <div class="method-source-code" id="<%= method.html_name %>-source">
+ <pre><%= method.markup_code %></pre>
+ </div><!-- <%= method.html_name %>-source -->
+ <% end %>
+ </div>
+
+ <% unless method.aliases.empty? then %>
+ <div class="aliases">
+ Also aliased as: <%= method.aliases.map do |aka|
+ if aka.parent then # HACK lib/rexml/encodings
+ %{<a href="#{klass.aref_to aka.path}">#{h aka.name}</a>}
+ else
+ h aka.name
+ end
+ end.join ", " %>
+ </div>
+ <% end %>
+
+ <% if method.is_alias_for then %>
+ <div class="aliases">
+ Alias for: <a href="<%= klass.aref_to method.is_alias_for.path %>"><%= h method.is_alias_for.name %></a>
+ </div>
+ <% end %>
+ </div><!-- <%= method.html_name %>-method -->
+
+ <% end %>
+ </section><!-- <%= visibility %>-<%= type %>-method-details -->
+ <% end
+ end %>
+ </section><!-- <%= section.aref %> -->
+<% end %>
+
+</div><!-- documentation -->
diff --git a/lib/rdoc/generator/template/darkfish/classpage.rhtml b/lib/rdoc/generator/template/darkfish/classpage.rhtml
deleted file mode 100644
index 856321532b..0000000000
--- a/lib/rdoc/generator/template/darkfish/classpage.rhtml
+++ /dev/null
@@ -1,319 +0,0 @@
-<?xml version="1.0" encoding="<%= @options.charset %>"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <meta content="text/html; charset=<%= @options.charset %>" http-equiv="Content-Type" />
-
- <title><%= klass.type.capitalize %>: <%= klass.full_name %></title>
-
- <link rel="stylesheet" href="<%= rel_prefix %>/rdoc.css" type="text/css" media="screen" />
-
- <script src="<%= rel_prefix %>/js/jquery.js" type="text/javascript" charset="utf-8"></script>
- <script src="<%= rel_prefix %>/js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
- <script src="<%= rel_prefix %>/js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
- <script src="<%= rel_prefix %>/js/darkfish.js" type="text/javascript" charset="utf-8"></script>
-
-</head>
-<body id="top" class="<%= klass.type %>">
-
- <div id="metadata">
- <div id="home-metadata">
- <div id="home-section" class="section">
- <h3 class="section-header">
- <a href="<%= rel_prefix %>/index.html">Home</a>
- <a href="<%= rel_prefix %>/index.html#classes">Classes</a>
- <a href="<%= rel_prefix %>/index.html#methods">Methods</a>
- </h3>
- </div>
- </div>
-
- <div id="file-metadata">
- <div id="file-list-section" class="section">
- <h3 class="section-header">In Files</h3>
- <div class="section-body">
- <ul>
- <% klass.in_files.each do |tl| %>
- <li><a href="<%= rel_prefix %>/<%= h tl.path %>?TB_iframe=true&amp;height=550&amp;width=785"
- class="thickbox" title="<%= h tl.absolute_name %>"><%= h tl.absolute_name %></a></li>
- <% end %>
- </ul>
- </div>
- </div>
-
- <% if !svninfo.empty? then %>
- <div id="file-svninfo-section" class="section">
- <h3 class="section-header">Subversion Info</h3>
- <div class="section-body">
- <dl class="svninfo">
- <dt>Rev</dt>
- <dd><%= svninfo[:rev] %></dd>
-
- <dt>Last Checked In</dt>
- <dd><%= svninfo[:commitdate].strftime('%Y-%m-%d %H:%M:%S') %>
- (<%= svninfo[:commitdelta] %> ago)</dd>
-
- <dt>Checked in by</dt>
- <dd><%= svninfo[:committer] %></dd>
- </dl>
- </div>
- </div>
- <% end %>
- </div>
-
- <div id="class-metadata">
- <% if klass.type == 'class' then %>
- <!-- Parent Class -->
- <div id="parent-class-section" class="section">
- <h3 class="section-header">Parent</h3>
- <% if klass.superclass and not String === klass.superclass then %>
- <p class="link"><a href="<%= klass.aref_to klass.superclass.path %>"><%= klass.superclass.full_name %></a></p>
- <% else %>
- <p class="link"><%= klass.superclass %></p>
- <% end %>
- </div>
- <% end %>
-
- <% unless klass.sections.length == 1 then %>
- <!-- Sections -->
- <div id="sections-section" class="section">
- <h3 class="section-header">Sections</h3>
- <ul class="link-list">
- <% klass.sections.sort_by { |s| s.title.to_s }.each do |section| %>
- <li><a href="#<%= section.aref %>"><%= h section.title %></a></li>
- <% end %>
- </ul>
- </div>
- <% end %>
-
- <% unless klass.classes_and_modules.empty? then %>
- <!-- Namespace Contents -->
- <div id="namespace-list-section" class="section">
- <h3 class="section-header">Namespace</h3>
- <ul class="link-list">
- <% (klass.modules.sort + klass.classes.sort).each do |mod| %>
- <li><span class="type"><%= mod.type.upcase %></span> <a href="<%= klass.aref_to mod.path %>"><%= mod.full_name %></a></li>
- <% end %>
- </ul>
- </div>
- <% end %>
-
- <% unless klass.method_list.empty? then %>
- <!-- Method Quickref -->
- <div id="method-list-section" class="section">
- <h3 class="section-header">Methods</h3>
- <ul class="link-list">
- <% klass.each_method do |meth| %>
- <li><a href="#<%= meth.aref %>"><%= meth.singleton ? '::' : '#' %><%= meth.name %></a></li>
- <% end %>
- </ul>
- </div>
- <% end %>
-
- <% unless klass.includes.empty? then %>
- <!-- Included Modules -->
- <div id="includes-section" class="section">
- <h3 class="section-header">Included Modules</h3>
- <ul class="link-list">
- <% klass.each_include do |inc| %>
- <% unless String === inc.module then %>
- <li><a class="include" href="<%= klass.aref_to inc.module.path %>"><%= inc.module.full_name %></a></li>
- <% else %>
- <li><span class="include"><%= inc.name %></span></li>
- <% end %>
- <% end %>
- </ul>
- </div>
- <% end %>
- </div>
-
- <div id="project-metadata">
- <% simple_files = @files.select {|tl| tl.parser == RDoc::Parser::Simple } %>
- <% unless simple_files.empty? then %>
- <div id="fileindex-section" class="section project-section">
- <h3 class="section-header">Files</h3>
- <ul>
- <% simple_files.each do |file| %>
- <li class="file"><a href="<%= rel_prefix %>/<%= file.path %>"><%= h file.base_name %></a></li>
- <% end %>
- </ul>
- </div>
- <% end %>
-
- <div id="classindex-section" class="section project-section">
- <h3 class="section-header">Class/Module Index
- <span class="search-toggle"><img src="<%= rel_prefix %>/images/find.png"
- height="16" width="16" alt="[+]"
- title="show/hide quicksearch" /></span></h3>
- <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
- <fieldset>
- <legend>Quicksearch</legend>
- <input type="text" name="quicksearch" value=""
- class="quicksearch-field" />
- </fieldset>
- </form>
-
- <ul class="link-list">
- <% @modsort.each do |index_klass| %>
- <li><a href="<%= rel_prefix %>/<%= index_klass.path %>"><%= index_klass.full_name %></a></li>
- <% end %>
- </ul>
- <div id="no-class-search-results" style="display: none;">No matching classes.</div>
- </div>
-
- <% if $DEBUG_RDOC then %>
- <div id="debugging-toggle"><img src="<%= rel_prefix %>/images/bug.png"
- alt="toggle debugging" height="16" width="16" /></div>
- <% end %>
- </div>
- </div>
-
- <div id="documentation">
- <h1 class="<%= klass.type %>"><%= klass.full_name %></h1>
-
- <div id="description" class="description">
- <%= klass.description %>
- </div><!-- description -->
-
- <% klass.each_section do |section, constants, attributes| %>
- <div id="<%= section.aref %>" class="documentation-section">
- <% if section.title then %>
- <h2 class="section-header">
- <%= section.title %>
- <a href="#top">&uarr; top</a>
- </h2>
- <% end %>
-
- <% if section.comment then %>
- <div class="description">
- <%= section.description %>
- </div>
- <% end %>
-
- <% unless constants.empty? then %>
- <!-- Constants -->
- <div id="constants-list" class="section">
- <h3 class="section-header">Constants</h3>
- <dl>
- <% constants.each do |const| %>
- <dt><a name="<%= const.name %>"><%= const.name %></a></dt>
- <% if const.comment then %>
- <dd class="description"><%= const.description.strip %></dd>
- <% else %>
- <dd class="description missing-docs">(Not documented)</dd>
- <% end %>
- <% end %>
- </dl>
- </div>
- <% end %>
-
- <% unless attributes.empty? then %>
- <!-- Attributes -->
- <div id="attribute-method-details" class="method-section section">
- <h3 class="section-header">Attributes</h3>
-
- <% attributes.each do |attrib| %>
- <div id="<%= attrib.html_name %>-attribute-method" class="method-detail">
- <a name="<%= h attrib.name %>"></a>
- <% if attrib.rw =~ /w/i then %>
- <a name="<%= h attrib.name %>="></a>
- <% end %>
- <div class="method-heading attribute-method-heading">
- <span class="method-name"><%= h attrib.name %></span><span
- class="attribute-access-type">[<%= attrib.rw %>]</span>
- </div>
-
- <div class="method-description">
- <% if attrib.comment then %>
- <%= attrib.description.strip %>
- <% else %>
- <p class="missing-docs">(Not documented)</p>
- <% end %>
- </div>
- </div>
- <% end %>
- </div><!-- attribute-method-details -->
- <% end %>
-
- <!-- Methods -->
- <% klass.methods_by_type(section).each do |type, visibilities|
- next if visibilities.empty?
- visibilities.each do |visibility, methods|
- next if methods.empty? %>
- <div id="<%= visibility %>-<%= type %>-method-details" class="method-section section">
- <h3 class="section-header"><%= visibility.to_s.capitalize %> <%= type.capitalize %> Methods</h3>
-
- <% methods.each do |method| %>
- <div id="<%= method.html_name %>-method" class="method-detail <%= method.is_alias_for ? "method-alias" : '' %>">
- <a name="<%= h method.aref %>"></a>
-
- <% if method.call_seq then %>
- <% method.call_seq.strip.split("\n").each_with_index do |call_seq, i| %>
- <div class="method-heading">
- <span class="method-callseq"><%= call_seq.strip.gsub(/->/, '&rarr;').gsub( /^\w+\./m, '') %></span>
- <% if i == 0 then %>
- <span class="method-click-advice">click to toggle source</span>
- <% end %>
- </div>
- <% end %>
- <% else %>
- <div class="method-heading">
- <span class="method-name"><%= h method.name %></span><span
- class="method-args"><%= method.params %></span>
- <span class="method-click-advice">click to toggle source</span>
- </div>
- <% end %>
-
- <div class="method-description">
- <% if method.comment then %>
- <%= method.description.strip %>
- <% else %>
- <p class="missing-docs">(Not documented)</p>
- <% end %>
-
- <% if method.token_stream then %>
- <div class="method-source-code" id="<%= method.html_name %>-source">
-<pre>
-<%= method.markup_code %>
-</pre>
- </div><!-- <%= method.html_name %>-source -->
- <% end %>
- </div>
-
- <% unless method.aliases.empty? then %>
- <div class="aliases">
- Also aliased as: <%= method.aliases.map do |aka|
- if aka.parent then # HACK lib/rexml/encodings
- %{<a href="#{klass.aref_to aka.path}">#{h aka.name}</a>}
- else
- h aka.name
- end
- end.join ", " %>
- </div>
- <% end %>
-
- <% if method.is_alias_for then %>
- <div class="aliases">
- Alias for: <a href="<%= klass.aref_to method.is_alias_for.path %>"><%= h method.is_alias_for.name %></a>
- </div>
- <% end %>
- </div><!-- <%= method.html_name %>-method -->
-
- <% end %>
- </div><!-- <%= visibility %>-<%= type %>-method-details -->
- <% end
- end %>
- </div><!-- <%= section.aref %> -->
- <% end %>
-
- </div><!-- documentation -->
-
- <div id="validator-badges">
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
- <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
- Rdoc Generator</a> <%= RDoc::Generator::Darkfish::VERSION %></small>.</p>
- </div>
-
-</body>
-</html>
-
diff --git a/lib/rdoc/generator/template/darkfish/filepage.rhtml b/lib/rdoc/generator/template/darkfish/filepage.rhtml
deleted file mode 100644
index b230a456a3..0000000000
--- a/lib/rdoc/generator/template/darkfish/filepage.rhtml
+++ /dev/null
@@ -1,124 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <meta content="text/html; charset=<%= @options.charset %>" http-equiv="Content-Type" />
-
- <title>File: <%= file.base_name %> [<%= @options.title %>]</title>
-
- <link type="text/css" media="screen" href="<%= rel_prefix %>/rdoc.css" rel="stylesheet" />
-
- <script src="<%= rel_prefix %>/js/jquery.js" type="text/javascript"
- charset="utf-8"></script>
- <script src="<%= rel_prefix %>/js/thickbox-compressed.js" type="text/javascript"
- charset="utf-8"></script>
- <script src="<%= rel_prefix %>/js/quicksearch.js" type="text/javascript"
- charset="utf-8"></script>
- <script src="<%= rel_prefix %>/js/darkfish.js" type="text/javascript"
- charset="utf-8"></script>
-</head>
-
-<% if file.parser == RDoc::Parser::Simple %>
-<body class="file">
- <div id="metadata">
- <div id="home-metadata">
- <div id="home-section" class="section">
- <h3 class="section-header">
- <a href="<%= rel_prefix %>/index.html">Home</a>
- <a href="<%= rel_prefix %>/index.html#classes">Classes</a>
- <a href="<%= rel_prefix %>/index.html#methods">Methods</a>
- </h3>
- </div>
- </div>
-
- <div id="project-metadata">
- <% simple_files = @files.select { |f| f.parser == RDoc::Parser::Simple } %>
- <% unless simple_files.empty? then %>
- <div id="fileindex-section" class="section project-section">
- <h3 class="section-header">Files</h3>
- <ul>
- <% simple_files.each do |f| %>
- <li class="file"><a href="<%= rel_prefix %>/<%= f.path %>"><%= h f.base_name %></a></li>
- <% end %>
- </ul>
- </div>
- <% end %>
-
- <div id="classindex-section" class="section project-section">
- <h3 class="section-header">Class Index
- <span class="search-toggle"><img src="<%= rel_prefix %>/images/find.png"
- height="16" width="16" alt="[+]"
- title="show/hide quicksearch" /></span></h3>
- <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
- <fieldset>
- <legend>Quicksearch</legend>
- <input type="text" name="quicksearch" value=""
- class="quicksearch-field" />
- </fieldset>
- </form>
-
- <ul class="link-list">
- <% @modsort.each do |index_klass| %>
- <li><a href="<%= rel_prefix %>/<%= index_klass.path %>"><%= index_klass.full_name %></a></li>
- <% end %>
- </ul>
- <div id="no-class-search-results" style="display: none;">No matching classes.</div>
- </div>
-
- <% if $DEBUG_RDOC %>
- <div id="debugging-toggle"><img src="<%= rel_prefix %>/images/bug.png"
- alt="toggle debugging" height="16" width="16" /></div>
- <% end %>
- </div>
- </div>
-
- <div id="documentation">
- <%= file.description %>
- </div>
-
- <div id="validator-badges">
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
- <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
- Rdoc Generator</a> <%= RDoc::Generator::Darkfish::VERSION %></small>.</p>
- </div>
-</body>
-<% else %>
-<body class="file file-popup">
- <div id="metadata">
- <dl>
- <dt class="modified-date">Last Modified</dt>
- <dd class="modified-date"><%= file.last_modified %></dd>
-
- <% if file.requires %>
- <dt class="requires">Requires</dt>
- <dd class="requires">
- <ul>
- <% file.requires.each do |require| %>
- <li><%= require.name %></li>
- <% end %>
- </ul>
- </dd>
- <% end %>
-
- <% if @options.webcvs %>
- <dt class="scs-url">Trac URL</dt>
- <dd class="scs-url"><a target="_top"
- href="<%= file.cvs_url %>"><%= file.cvs_url %></a></dd>
- <% end %>
- </dl>
- </div>
-
- <div id="documentation">
- <% if file.comment %>
- <div class="description">
- <h2>Description</h2>
- <%= file.description %>
- </div>
- <% end %>
- </div>
-</body>
-<% end %>
-</html>
-
diff --git a/lib/rdoc/generator/template/darkfish/images/add.png b/lib/rdoc/generator/template/darkfish/images/add.png
new file mode 100755
index 0000000000..6332fefea4
--- /dev/null
+++ b/lib/rdoc/generator/template/darkfish/images/add.png
Binary files differ
diff --git a/lib/rdoc/generator/template/darkfish/images/arrow_up.png b/lib/rdoc/generator/template/darkfish/images/arrow_up.png
new file mode 100755
index 0000000000..1ebb193243
--- /dev/null
+++ b/lib/rdoc/generator/template/darkfish/images/arrow_up.png
Binary files differ
diff --git a/lib/rdoc/generator/template/darkfish/images/delete.png b/lib/rdoc/generator/template/darkfish/images/delete.png
new file mode 100755
index 0000000000..08f249365a
--- /dev/null
+++ b/lib/rdoc/generator/template/darkfish/images/delete.png
Binary files differ
diff --git a/lib/rdoc/generator/template/darkfish/images/tag_blue.png b/lib/rdoc/generator/template/darkfish/images/tag_blue.png
new file mode 100755
index 0000000000..3f02b5f8f8
--- /dev/null
+++ b/lib/rdoc/generator/template/darkfish/images/tag_blue.png
Binary files differ
diff --git a/lib/rdoc/generator/template/darkfish/images/transparent.png b/lib/rdoc/generator/template/darkfish/images/transparent.png
new file mode 100644
index 0000000000..d665e179ef
--- /dev/null
+++ b/lib/rdoc/generator/template/darkfish/images/transparent.png
Binary files differ
diff --git a/lib/rdoc/generator/template/darkfish/index.rhtml b/lib/rdoc/generator/template/darkfish/index.rhtml
index 3198246f8a..d076c2a252 100644
--- a/lib/rdoc/generator/template/darkfish/index.rhtml
+++ b/lib/rdoc/generator/template/darkfish/index.rhtml
@@ -1,64 +1,19 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
- "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<body>
+<nav id="metadata">
+ <%= render '_sidebar_navigation.rhtml' %>
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-<head>
- <meta content="text/html; charset=<%= @options.charset %>" http-equiv="Content-Type" />
+ <%= render '_sidebar_search.rhtml' %>
- <title><%= h @options.title %></title>
-
- <link type="text/css" media="screen" href="rdoc.css" rel="stylesheet" />
-
- <script src="js/jquery.js" type="text/javascript" charset="utf-8"></script>
- <script src="js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
- <script src="js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
- <script src="js/darkfish.js" type="text/javascript" charset="utf-8"></script>
-
-</head>
-<body class="indexpage">
-
- <% $stderr.sync = true %>
- <h1><%= h @options.title %></h1>
-
- <% if @options.main_page && main_page = @files.find { |f| f.full_name == @options.main_page } then %>
- <div id="main">
- <%= main_page.description.sub(%r{^\s*<h1.*?/h1>}i, '') %>
- </div>
- <% else %>
- <p>This is the API documentation for '<%= @options.title %>'.</p>
- <% end %>
-
- <% simple_files = @files.select {|tl| tl.parser == RDoc::Parser::Simple } %>
- <% unless simple_files.empty? then %>
- <h2>Files</h2>
- <ul>
- <% simple_files.sort.each do |file| %>
- <li class="file"><a href="<%= file.path %>"><%= h file.base_name %></a></li>
- <% end %>
- </ul>
- <% end %>
-
- <h2 id="classes">Classes/Modules</h2>
- <ul>
- <% @modsort.each do |klass| %>
- <li class="<%= klass.type %>"><a href="<%= klass.path %>"><%= klass.full_name %></a></li>
- <% end %>
- </ul>
-
- <h2 id="methods">Methods</h2>
- <ul>
- <% RDoc::TopLevel.all_classes_and_modules.map do |mod|
- mod.method_list
- end.flatten.sort.each do |method| %>
- <li><a href="<%= method.path %>"><%= method.pretty_name %> &mdash; <%= method.parent.full_name %></a></li>
- <% end %>
- </ul>
-
- <div id="validator-badges">
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
- <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
- Rdoc Generator</a> <%= RDoc::Generator::Darkfish::VERSION %></small>.</p>
+ <div id="project-metadata">
+ <%= render '_sidebar_pages.rhtml' %>
+ <%= render '_sidebar_classes.rhtml' %>
</div>
-</body>
-</html>
+</nav>
+
+<div id="documentation" class="description">
+<% if @options.main_page && main_page = @files.find { |f| f.full_name == @options.main_page } then %>
+<%= main_page.description %>
+<% else %>
+<p>This is the API documentation for <%= @title %>.
+<% end %>
+</div>
diff --git a/lib/rdoc/generator/template/darkfish/js/darkfish.js b/lib/rdoc/generator/template/darkfish/js/darkfish.js
index 84565c1e2d..4be722fac3 100644
--- a/lib/rdoc/generator/template/darkfish/js/darkfish.js
+++ b/lib/rdoc/generator/template/darkfish/js/darkfish.js
@@ -9,12 +9,12 @@
/* Provide console simulation for firebug-less environments */
if (!("console" in window) || !("firebug" in console)) {
- var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
+ var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
"group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
- window.console = {};
- for (var i = 0; i < names.length; ++i)
- window.console[names[i]] = function() {};
+ window.console = {};
+ for (var i = 0; i < names.length; ++i)
+ window.console[names[i]] = function() {};
};
@@ -23,94 +23,131 @@ if (!("console" in window) || !("firebug" in console)) {
*/
$.fn.unwrap = function( expr ) {
return this.each( function() {
- $(this).parents( expr ).eq( 0 ).after( this ).remove();
+ $(this).parents( expr ).eq( 0 ).after( this ).remove();
});
};
function showSource( e ) {
- var target = e.target;
- var codeSections = $(target).
- parents('.method-detail').
- find('.method-source-code');
-
- $(target).
- parents('.method-detail').
- find('.method-source-code').
- slideToggle();
+ var target = e.target;
+ var codeSections = $(target).
+ parents('.method-detail').
+ find('.method-source-code');
+
+ $(target).
+ parents('.method-detail').
+ find('.method-source-code').
+ slideToggle();
};
function hookSourceViews() {
- $('.method-description,.method-heading').click( showSource );
+ $('.method-heading').click( showSource );
};
function toggleDebuggingSection() {
- $('.debugging-section').slideToggle();
+ $('.debugging-section').slideToggle();
};
function hookDebuggingToggle() {
- $('#debugging-toggle img').click( toggleDebuggingSection );
+ $('#debugging-toggle img').click( toggleDebuggingSection );
};
-function hookQuickSearch() {
- $('.quicksearch-field').each( function() {
- var searchElems = $(this).parents('.section').find( 'li' );
- var toggle = $(this).parents('.section').find('h3 .search-toggle');
- // console.debug( "Toggle is: %o", toggle );
- var qsbox = $(this).parents('form').get( 0 );
-
- $(this).quicksearch( this, searchElems, {
- noSearchResultsIndicator: 'no-class-search-results',
- focusOnLoad: false
- });
- $(toggle).click( function() {
- // console.debug( "Toggling qsbox: %o", qsbox );
- $(qsbox).toggle();
- });
- });
+function hookTableOfContentsToggle() {
+ $('.indexpage li .toc-toggle').each( function() {
+ $(this).click( function() {
+ $(this).toggleClass('open');
+ });
+
+ var section = $(this).next();
+
+ $(this).click( function() {
+ section.slideToggle();
+ });
+ });
+}
+
+function hookSearch() {
+ var input = $('#search-field').eq(0);
+ var result = $('#search-results').eq(0);
+ $(result).show();
+
+ var search_section = $('#search-section').get(0);
+ $(search_section).show();
+
+ var search = new Search(search_data, input, result);
+
+ search.renderItem = function(result) {
+ var li = document.createElement('li');
+ var html = '';
+
+ // TODO add relative path to <script> per-page
+ html += '<p class="search-match"><a href="' + rdoc_rel_prefix + result.path + '">' + this.hlt(result.title);
+ if (result.params)
+ html += '<span class="params">' + result.params + '</span>';
+ html += '</a>';
+
+
+ if (result.namespace)
+ html += '<p class="search-namespace">' + this.hlt(result.namespace);
+
+ if (result.snippet)
+ html += '<div class="search-snippet">' + result.snippet + '</div>';
+
+ li.innerHTML = html;
+
+ return li;
+ }
+
+ search.select = function(result) {
+ var result_element = result.get(0);
+ window.location.href = result_element.firstChild.firstChild.href;
+ }
+
+ search.scrollIntoView = search.scrollInWindow;
};
function highlightTarget( anchor ) {
- console.debug( "Highlighting target '%s'.", anchor );
-
- $("a[name=" + anchor + "]").each( function() {
- if ( !$(this).parent().parent().hasClass('target-section') ) {
- console.debug( "Wrapping the target-section" );
- $('div.method-detail').unwrap( 'div.target-section' );
- $(this).parent().wrap( '<div class="target-section"></div>' );
- } else {
- console.debug( "Already wrapped." );
- }
- });
+ console.debug( "Highlighting target '%s'.", anchor );
+
+ $("a[name=" + anchor + "]").each( function() {
+ if ( !$(this).parent().parent().hasClass('target-section') ) {
+ console.debug( "Wrapping the target-section" );
+ $('div.method-detail').unwrap( 'div.target-section' );
+ $(this).parent().wrap( '<div class="target-section"></div>' );
+ } else {
+ console.debug( "Already wrapped." );
+ }
+ });
};
function highlightLocationTarget() {
- console.debug( "Location hash: %s", window.location.hash );
- if ( ! window.location.hash || window.location.hash.length == 0 ) return;
+ console.debug( "Location hash: %s", window.location.hash );
+ if ( ! window.location.hash || window.location.hash.length == 0 ) return;
- var anchor = window.location.hash.substring(1);
- console.debug( "Found anchor: %s; matching %s", anchor, "a[name=" + anchor + "]" );
+ var anchor = window.location.hash.substring(1);
+ console.debug( "Found anchor: %s; matching %s", anchor, "a[name=" + anchor + "]" );
- highlightTarget( anchor );
+ highlightTarget( anchor );
};
function highlightClickTarget( event ) {
- console.debug( "Highlighting click target for event %o", event.target );
- try {
- var anchor = $(event.target).attr( 'href' ).substring(1);
- console.debug( "Found target anchor: %s", anchor );
- highlightTarget( anchor );
- } catch ( err ) {
- console.error( "Exception while highlighting: %o", err );
- };
+ console.debug( "Highlighting click target for event %o", event.target );
+ try {
+ var anchor = $(event.target).attr( 'href' ).substring(1);
+ console.debug( "Found target anchor: %s", anchor );
+ highlightTarget( anchor );
+ } catch ( err ) {
+ console.error( "Exception while highlighting: %o", err );
+ };
};
$(document).ready( function() {
- hookSourceViews();
- hookDebuggingToggle();
- hookQuickSearch();
- highlightLocationTarget();
+ hookSourceViews();
+ hookDebuggingToggle();
+ hookSearch();
+ highlightLocationTarget();
+ hookTableOfContentsToggle();
- $('ul.link-list a').bind( "click", highlightClickTarget );
+ $('ul.link-list a').bind( "click", highlightClickTarget );
});
diff --git a/lib/rdoc/generator/template/darkfish/js/jquery.js b/lib/rdoc/generator/template/darkfish/js/jquery.js
index afe9e74c90..48590ecb96 100644
--- a/lib/rdoc/generator/template/darkfish/js/jquery.js
+++ b/lib/rdoc/generator/template/darkfish/js/jquery.js
@@ -1,32 +1,18 @@
-/*
- * jQuery 1.2.6 - New Wave Javascript
+/*!
+ * jQuery JavaScript Library v1.6.2
+ * http://jquery.com/
*
- * Copyright (c) 2008 John Resig (jquery.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
+ * Copyright 2011, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
*
- * $Date: 2008-09-25 09:50:52 -0700 (Thu, 25 Sep 2008) $
- * $Rev: 38 $
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2011, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Thu Jun 30 14:16:56 2011 -0400
*/
-(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else
-return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else
-return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else
-selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery.browser.msie&&!option.attributes.value.specified?option.text:option.value;if(one)return value;values.push(value);}}return values;}else
-return(this[0].value||"").replace(/\r/g,"");}return undefined;}if(value.constructor==Number)value+='';return this.each(function(){if(this.nodeType!=1)return;if(value.constructor==Array&&/radio|checkbox/.test(this.type))this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else
-this.value=value;});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else
-return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else
-jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==i){target=this;--i;}for(;i<length;i++)if((options=arguments[i])!=null)for(var name in options){var src=target[name],copy=options[name];if(target===copy)continue;if(deep&&copy&&typeof copy=="object"&&!copy.nodeType)target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy);else if(copy!==undefined)target[name]=copy;}return target;};var expando="jQuery"+now(),uuid=0,windowData={},exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/^[\s[]?function/.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.browser.msie)script.text=data;else
-script.appendChild(document.createTextNode(data));head.insertBefore(script,head.firstChild);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id)id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])jQuery.cache[id]={};if(data!==undefined)jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])break;if(!name)jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)elem.removeAttribute(expando);}delete jQuery.cache[id];}},each:function(object,callback,args){var name,i=0,length=object.length;if(args){if(length==undefined){for(name in object)if(callback.apply(object[name],args)===false)break;}else
-for(;i<length;)if(callback.apply(object[i++],args)===false)break;}else{if(length==undefined){for(name in object)if(callback.call(object[name],name,object[name])===false)break;}else
-for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}return object;},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value))value=value.call(elem,i);return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(name)?value+"px":value;},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className))elem.className+=(elem.className?" ":"")+className;});},remove:function(elem,classNames){if(elem.nodeType==1)elem.className=classNames!=undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return!jQuery.className.has(classNames,className);}).join(" "):"";},has:function(elem,className){return jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else
-jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i<stack.length;i++)if(color(stack[i])){swap[i]=stack[i].style.display;stack[i].style.display="block";}ret=name=="display"&&swap[stack.length-1]!=null?"none":(computedStyle&&computedStyle.getPropertyValue(name))||"";for(i=0;i<swap.length;i++)if(swap[i]!=null)stack[i].style.display=swap[i];}if(name=="opacity"&&ret=="")ret="1";}else if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase();});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft;}}return ret;},clean:function(elems,context){var ret=[];context=context||document;if(typeof context.createElement=='undefined')context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;jQuery.each(elems,function(i,elem){if(!elem)return;if(elem.constructor==Number)elem+='';if(typeof elem=="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else
-ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&&notxml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else
-while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++)if(array[i]===elem)return i;return-1;},merge:function(first,second){var i=0,elem,pos=first.length;if(jQuery.browser.msie){while(elem=second[i++])if(elem.nodeType!=8)first[pos++]=elem;}else
-while(elem=second[i++])first[pos++]=elem;return first;},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i]);}}}catch(e){ret=array;}return ret;},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++)if(!inv!=!callback(elems[i],i))ret.push(elems[i]);return ret;},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!=null)ret[ret.length]=value;}return ret.concat.apply([],ret);}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});jQuery.each({parent:function(elem){return elem.parentNode;},parents:function(elem){return jQuery.dir(elem,"parentNode");},next:function(elem){return jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return jQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string")ret=jQuery.multiFilter(selector,ret);return this.pushStack(jQuery.unique(ret));};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;return this.each(function(){for(var i=0,length=args.length;i<length;i++)jQuery(args[i])[original](this);});};});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1)this.removeAttribute(name);},addClass:function(classNames){jQuery.className.add(this,classNames);},removeClass:function(classNames){jQuery.className.remove(this,classNames);},toggleClass:function(classNames){jQuery.className[jQuery.className.has(this,classNames)?"remove":"add"](this,classNames);},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).r.length){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this);jQuery.removeData(this);});if(this.parentNode)this.parentNode.removeChild(this);}},empty:function(){jQuery(">*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return i<m[3]-0;},gt:function(a,i,m){return i>m[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling)if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id])break;if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~")merge[id]=true;r.push(n);}if(m=="+")break;}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object")tag="param";r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]==".")r=jQuery.classFilter(r,m[2]);if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++)if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();done=jQuery.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQuery.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true;}var add=false;if(first==0){if(node.nodeIndex==last)add=true;}else if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else
-for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i<args.length)jQuery.event.proxy(fn,args[i++]);return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;event.preventDefault();return args[this.lastToggle++].apply(this,arguments)||false;}));},hover:function(fnOver,fnOut){return this.bind('mouseenter',fnOver).bind('mouseleave',fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)fn.call(document,jQuery);else
-jQuery.readyList.push(function(){return fn.call(this,jQuery);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document);});jQuery.readyList=null;}jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener&&!jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);if(jQuery.browser.msie&&window==top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}jQuery.ready();})();if(jQuery.browser.opera)document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady)return;for(var i=0;i<document.styleSheets.length;i++)if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return;}jQuery.ready();},false);if(jQuery.browser.safari){var numStyles;(function(){if(jQuery.isReady)return;if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return;}if(numStyles===undefined)numStyles=jQuery("style, link[rel=stylesheet]").length;if(document.styleSheets.length!=numStyles){setTimeout(arguments.callee,0);return;}jQuery.ready();})();}jQuery.event.add(window,"load",jQuery.ready);}jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);};});var withinElement=function(event,elem){var parent=event.relatedTarget;while(parent&&parent!=elem)try{parent=parent.parentNode;}catch(error){parent=elem;}return parent==elem;};jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind();});jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!='string')return this._load(url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else
-xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else
-jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else
-for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else
-s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
-e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)if(!timers[i]())timers.splice(i--,1);if(!timers.length){clearInterval(jQuery.timerId);jQuery.timerId=null;}},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=now();if(gotoEnd||t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})(); \ No newline at end of file
+(function(a,b){function cv(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cs(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cr(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cq(){cn=b}function cp(){setTimeout(cq,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function bZ(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function bY(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bC.test(a)?d(a,e):bY(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)bY(a+"["+e+"]",b[e],c,d);else d(a,b)}function bX(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bR,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bX(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bX(a,c,d,e,"*",g));return l}function bW(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bN),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bA(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bv:bw;if(d>0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bx(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bm(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(be,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bl(a){f.nodeName(a,"input")?bk(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bk)}function bk(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bj(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bi(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bh(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)f.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function bg(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function W(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(R.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function V(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function N(a,b){return(a&&a!=="*"?a+".":"")+b.replace(z,"`").replace(A,"&")}function M(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;i<s.length;i++)g=s[i],g.origType.replace(x,"")===a.type?q.push(g.selector):s.splice(i--,1);e=f(a.target).closest(q,a.currentTarget);for(j=0,k=e.length;j<k;j++){m=e[j];for(i=0;i<s.length;i++){g=s[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,d=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,d=f(a.relatedTarget).closest(g.selector)[0],d&&f.contains(h,d)&&(d=h);(!d||d!==h)&&p.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=p.length;j<k;j++){e=p[j];if(c&&e.level>c)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function K(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function E(){return!0}function D(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z])/ig,x=function(a,b){return b.toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!A){A=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||D.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b){if(H)return H.call(b,a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=s.exec(a)||t.exec(a)||u.exec(a)||a.indexOf("compatible")<0&&v.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g="done fail isResolved isRejected promise then always pipe".split(" "),h=[].slice;f.extend({_Deferred:function(){var a=[],b,c,d,e={done:function(){if(!d){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=f.type(i),j==="array"?e.done.apply(e,i):j==="function"&&a.push(i);k&&e.resolveWith(k[0],k[1])}return this},resolveWith:function(e,f){if(!d&&!b&&!c){f=f||[],c=1;try{while(a[0])a.shift().apply(e,f)}finally{b=[e,f],c=0}}return this},resolve:function(){e.resolveWith(this,arguments);return this},isResolved:function(){return!!c||!!b},cancel:function(){d=1,a=[];return this}};return e},Deferred:function(a){var b=f._Deferred(),c=f._Deferred(),d;f.extend(b,{then:function(a,c){b.done(a).fail(c);return this},always:function(){return b.done.apply(b,arguments).fail.apply(this,arguments)},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,pipe:function(a,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[c,"reject"]},function(a,c){var e=c[0],g=c[1],h;f.isFunction(e)?b[a](function(){h=e.apply(this,arguments),h&&f.isFunction(h.promise)?h.promise().then(d.resolve,d.reject):d[g](h)}):b[a](d[g])})}).promise()},promise:function(a){if(a==null){if(d)return d;d=a={}}var c=g.length;while(c--)a[g[c]]=b[g[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c<d;c++)b[c]&&f.isFunction(b[c].promise)?b[c].promise().then(i(c),g.reject):--e;e||g.resolveWith(g,b)}else g!==a&&g.resolveWith(g,d?[a]:[]);return g.promise()}}),f.support=function(){var a=c.createElement("div"),b=c.documentElement,d,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;a.setAttribute("className","t"),a.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0},m&&f.extend(p,{position:"absolute",left:-1e3,top:-1e3});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]||i[c]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h<i;h++)g=e[h].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),k(this[0],g,d[g]))}}return d}if(typeof a=="object")return this.each(function(){f.data(this,a)});var j=a.split(".");j[1]=j[1]?"."+j[1]:"";if(c===b){d=this.triggerHandler("getData"+j[1]+"!",[j[0]]),d===b&&this.length&&(d=f.data(this[0],a),d=k(this[0],a,d));return d===b&&j[1]?this.data(j[0]):d}return this.each(function(){var b=f(this),d=[j[0],c];b.triggerHandler("setData"+j[1]+"!",d),f.data(this,a,c),b.triggerHandler("changeData"+j[1]+"!",d)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,c){a&&(c=(c||"fx")+"mark",f.data(a,c,(f.data(a,c,b,!0)||0)+1,!0))},_unmark:function(a,c,d){a!==!0&&(d=c,c=a,a=!1);if(c){d=d||"fx";var e=d+"mark",g=a?0:(f.data(c,e,b,!0)||1)-1;g?f.data(c,e,g,!0):(f.removeData(c,e,!0),m(c,d,"mark"))}},queue:function(a,c,d){if(a){c=(c||"fx")+"queue";var e=f.data(a,c,b,!0);d&&(!e||f.isArray(d)?e=f.data(a,c,f.makeArray(d),!0):e.push(d));return e||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e;d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),d.call(a,function(){f.dequeue(a,b)})),c.length||(f.removeData(a,b+"queue",!0),m(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){f.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f._Deferred(),!0))h++,l.done(m);m();return d.promise()}});var n=/[\n\t\r]/g,o=/\s+/,p=/\r/g,q=/^(?:button|input)$/i,r=/^(?:button|input|object|select|textarea)$/i,s=/^a(?:rea)?$/i,t=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,u=/\:|^on/,v,w;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(o);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(o);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(n," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(o);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if((" "+this[c].className+" ").replace(n," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h<i;h++){var j=e[h];if(j.selected&&(f.support.optDisabled?!j.disabled:j.getAttribute("disabled")===null)&&(!j.parentNode.disabled||!f.nodeName(j.parentNode,"optgroup"))){b=f(j).val();if(g)return b;d.push(b)}}if(g&&!d.length&&e.length)return f(e[c]).val();return d},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=w:v&&c!=="className"&&(f.nodeName(a,"form")||u.test(c))&&(i=v)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}},value:{get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return f.prop(a,c)?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.attrHooks.title=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=/\.(.*)$/,y=/^(?:textarea|input|select)$/i,z=/\./g,A=/ /g,B=/[^\w\s.|`]/g,C=function(a){return a.replace(B,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=D;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=D);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),C).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))f.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=f.event.special[h]||{};for(j=e||0;j<p.length;j++){q=p[j];if(d.guid===q.guid){if(l||n.test(q.namespace))e==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(e!=null)break}}if(p.length===0||e!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&f.removeEvent(a,h,s.handle),g=null,delete t[h]}if(f.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,f.isEmptyObject(s)&&f.removeData(a,b,!0)}}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){var h=c.type||c,i=[],j;h.indexOf("!")>=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.
+shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h<i;h++){var j=d[h];if(e||c.namespace_re.test(j.namespace)){c.handler=j.handler,c.data=j.data,c.handleObj=j;var k=j.handler.apply(this,g);k!==b&&(c.result=k,k===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[f.expando])return a;var d=a;a=f.Event(d);for(var e=this.props.length,g;e;)g=this.props[--e],a[g]=d[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=a.target.ownerDocument||c,i=h.documentElement,j=h.body;a.pageX=a.clientX+(i&&i.scrollLeft||j&&j.scrollLeft||0)-(i&&i.clientLeft||j&&j.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||j&&j.scrollTop||0)-(i&&i.clientTop||j&&j.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:f.proxy,special:{ready:{setup:f.bindReady,teardown:f.noop},live:{add:function(a){f.event.add(this,N(a.origType,a.selector),f.extend({},a,{handler:M,guid:a.handler.guid}))},remove:function(a){f.event.remove(this,N(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!this.preventDefault)return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?E:D):this.type=a,b&&f.extend(this,b),this.timeStamp=f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=E;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=E;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=E,this.stopPropagation()},isDefaultPrevented:D,isPropagationStopped:D,isImmediatePropagationStopped:D};var F=function(a){var b=a.relatedTarget,c=!1,d=a.type;a.type=a.data,b!==this&&(b&&(c=f.contains(this,b)),c||(f.event.handle.apply(this,arguments),a.type=d))},G=function(a){a.type=a.data,f.event.handle.apply(this,arguments)};f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={setup:function(c){f.event.add(this,b,c&&c.selector?G:F,a)},teardown:function(a){f.event.remove(this,b,a&&a.selector?G:F)}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(a,b){if(!f.nodeName(this,"form"))f.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&f(b).closest("form").length&&K("submit",this,arguments)}),f.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&f(b).closest("form").length&&a.keyCode===13&&K("submit",this,arguments)});else return!1},teardown:function(a){f.event.remove(this,".specialSubmit")}});if(!f.support.changeBubbles){var H,I=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},J=function(c){var d=c.target,e,g;if(!!y.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=I(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:J,beforedeactivate:J,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&J.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&J.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",I(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in H)f.event.add(this,c+".specialChange",H[c]);return y.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return y.test(this.nodeName)}},H=f.event.special.change.filters,H.focus=H.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i<j;i++)f.event.add(this[i],a,g,d);return this}}),f.fn.extend({unbind:function(a,b){if(typeof a=="object"&&!a.preventDefault)for(var c in a)this.unbind(c,a[c]);else for(var d=0,e=this.length;d<e;d++)f.event.remove(this[d],a,b);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f.data(this,"lastToggle"+a.guid)||0)%d;f.data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var L={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};f.each(["live","die"],function(a,c){f.fn[c]=function(a,d,e,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:f(this.context);if(typeof a=="object"&&!a.preventDefault){for(var o in a)n[c](o,d,a[o],m);return this}if(c==="die"&&!a&&g&&g.charAt(0)==="."){n.unbind(g);return this}if(d===!1||f.isFunction(d))e=d||D,d=b;a=(a||"").split(" ");while((h=a[i++])!=null){j=x.exec(h),k="",j&&(k=j[0],h=h.replace(x,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,L[h]?(a.push(L[h]+k),h=h+k):h=(L[h]||h)+k;if(c==="live")for(var p=0,q=n.length;p<q;p++)f.event.add(n[p],"live."+N(h,m),{data:d,selector:m,handler:e,origType:h,origHandler:e,preType:l});else n.unbind("live."+N(h,m),e)}return this}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(!f)g=o=!0;else if(f===!0)continue}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("parentNode",b,f,a,e,c)},"~":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("previousSibling",b,f,a,e,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c<f;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){if(a===b){g=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};f.find=k,f.expr=k.selectors,f.expr[":"]=f.expr.filters,f.unique=k.uniqueSort,f.text=k.getText,f.isXMLDoc=k.isXML,f.contains=k.contains}();var O=/Until$/,P=/^(?:parents|prevUntil|prevAll)/,Q=/,/,R=/^.[^:#\[\.,]*$/,S=Array.prototype.slice,T=f.expr.match.POS,U={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(W(this,a,!1),"not",a)},filter:function(a){return this.pushStack(W(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d<e;d++)i=a[d],j[i]||(j[i]=T.test(i)?f(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=T.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(l?l.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=S.call(arguments);O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var X=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,Z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,$=/<([\w:]+)/,_=/<tbody/i,ba=/<|&#?\w+;/,bb=/<(?:script|object|embed|option|style)/i,bc=/checked\s*(?:[^=]|=\s*.checked.)/i,bd=/\/(java|ecma)script/i,be=/^\s*<!(?:\[CDATA\[|\-\-)/,bf={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};bf.optgroup=bf.option,bf.tbody=bf.tfoot=bf.colgroup=bf.caption=bf.thead,bf.th=bf.td,f.support.htmlSerialize||(bf._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(X,""):null;if(typeof a=="string"&&!bb.test(a)&&(f.support.leadingWhitespace||!Y.test(a))&&!bf[($.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Z,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bc.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bg(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bm)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i;b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!bb.test(a[0])&&(f.support.checkClone||!bc.test(a[0]))&&(g=!0,h=f.fragments[a[0]],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[a[0]]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j
+)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bi(a,d),e=bj(a),g=bj(d);for(h=0;e[h];++h)bi(e[h],g[h])}if(b){bh(a,d);if(c){e=bj(a),g=bj(d);for(h=0;e[h];++h)bh(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!ba.test(k))k=b.createTextNode(k);else{k=k.replace(Z,"<$1></$2>");var l=($.exec(k)||["",""])[1].toLowerCase(),m=bf[l]||bf._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=_.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Y.test(k)&&o.insertBefore(b.createTextNode(Y.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bl(k[i]);else bl(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||bd.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.expando,g=f.event.special,h=f.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&f.noData[j.nodeName.toLowerCase()])continue;c=j[f.expando];if(c){b=d[c]&&d[c][e];if(b&&b.events){for(var k in b.events)g[k]?f.event.remove(j,k):f.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[f.expando]:j.removeAttribute&&j.removeAttribute(f.expando),delete d[c]}}}});var bn=/alpha\([^)]*\)/i,bo=/opacity=([^)]*)/,bp=/([A-Z]|^ms)/g,bq=/^-?\d+(?:px)?$/i,br=/^-?\d/,bs=/^[+\-]=/,bt=/[^+\-\.\de]+/g,bu={position:"absolute",visibility:"hidden",display:"block"},bv=["Left","Right"],bw=["Top","Bottom"],bx,by,bz;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bx(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d;if(h==="number"&&isNaN(d)||d==null)return;h==="string"&&bs.test(d)&&(d=+d.replace(bt,"")+parseFloat(f.css(a,c)),h="number"),h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bx)return bx(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bA(a,b,d);f.swap(a,bu,function(){e=bA(a,b,d)});return e}},set:function(a,b){if(!bq.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bo.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bn.test(g)?g.replace(bn,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bx(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(by=function(a,c){var d,e,g;c=c.replace(bp,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bz=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bq.test(d)&&br.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bx=by||bz,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bB=/%20/g,bC=/\[\]$/,bD=/\r?\n/g,bE=/#.*$/,bF=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bG=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bH=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bI=/^(?:GET|HEAD)$/,bJ=/^\/\//,bK=/\?/,bL=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bM=/^(?:select|textarea)/i,bN=/\s+/,bO=/([?&])_=[^&]*/,bP=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bQ=f.fn.load,bR={},bS={},bT,bU;try{bT=e.href}catch(bV){bT=c.createElement("a"),bT.href="",bT=bT.href}bU=bP.exec(bT.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bQ)return bQ.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bL,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bM.test(this.nodeName)||bG.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bD,"\r\n")}}):{name:b.name,value:c.replace(bD,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bT,isLocal:bH.test(bU[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bW(bR),ajaxTransport:bW(bS),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?bZ(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=b$(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bF.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bE,"").replace(bJ,bU[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bN),d.crossDomain==null&&(r=bP.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bU[1]&&r[2]==bU[2]&&(r[3]||(r[1]==="http:"?80:443))==(bU[3]||(bU[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bX(bR,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bI.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bK.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bO,"$1_="+x);d.url=y+(y===d.url?(bK.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bX(bS,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bB,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn,co=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cr("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cs(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cr("hide",3),a,b,c);for(var d=0,e=this.length;d<e;d++)if(this[d].style){var g=f.css(this[d],"display");g!=="none"&&!f._data(this[d],"olddisplay")&&f._data(this[d],"olddisplay",g)}for(d=0;d<e;d++)this[d].style&&(this[d].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cr("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return this[e.queue===!1?"each":"queue"](function(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(f.support.inlineBlockNeedsLayout?(j=cs(this.nodeName),j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)):this.style.display="inline-block"))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)k=new f.fx(this,b,i),h=a[i],cj.test(h)?k[h==="toggle"?d?"show":"hide":h]():(l=ck.exec(h),m=k.cur(),l?(n=parseFloat(l[2]),o=l[3]||(f.cssNumber[i]?"":"px"),o!=="px"&&(f.style(this,i,(n||1)+o),m=(n||1)/k.cur()*m,f.style(this,i,m+o)),l[1]&&(n=(l[1]==="-="?-1:1)*n+m),k.custom(m,n,o)):k.custom(m,h,""));return!0})},stop:function(a,b){a&&this.queue([]),this.each(function(){var a=f.timers,c=a.length;b||f._unmark(!0,this);while(c--)a[c].elem===this&&(b&&a[c](!0),a.splice(c,1))}),b||this.dequeue();return this}}),f.each({slideDown:cr("show",1),slideUp:cr("hide",1),slideToggle:cr("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default,d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue!==!1?f.dequeue(this):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function h(a){return d.step(a)}var d=this,e=f.fx,g;this.startTime=cn||cp(),this.start=a,this.end=b,this.unit=c||this.unit||(f.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,h.elem=this.elem,h()&&f.timers.push(h)&&!cl&&(co?(cl=!0,g=function(){cl&&(co(g),e.tick())},co(g)):cl=setInterval(e.tick,e.interval))},show:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=cn||cp(),c=!0,d=this.elem,e=this.options,g,h;if(a||b>=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b<a.length;++b)a[b]()||a.splice(b--,1);a.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cl),cl=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var ct=/^t(?:able|d|h)$/i,cu=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cv(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);f.offset.initialize();var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.offset.doesNotAddBorder&&(!f.offset.doesAddBorderForTableAndCells||!ct.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={initialize:function(){var a=c.body,b=c.createElement("div"),d,e,g,h,i=parseFloat(f.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cu.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cu.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cv(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cv(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file
diff --git a/lib/rdoc/generator/template/darkfish/js/quicksearch.js b/lib/rdoc/generator/template/darkfish/js/quicksearch.js
deleted file mode 100644
index 70dbd33cd9..0000000000
--- a/lib/rdoc/generator/template/darkfish/js/quicksearch.js
+++ /dev/null
@@ -1,114 +0,0 @@
-/**
- *
- * JQuery QuickSearch - Hook up a form field to hide non-matching elements.
- * $Id: quicksearch.js 53 2009-01-07 02:52:03Z deveiant $
- *
- * Author: Michael Granger <mgranger@laika.com>
- *
- */
-jQuery.fn.quicksearch = function( target, searchElems, options ) {
- // console.debug( "Quicksearch fn" );
-
- var settings = {
- delay: 250,
- clearButton: false,
- highlightMatches: false,
- focusOnLoad: false,
- noSearchResultsIndicator: null
- };
- if ( options ) $.extend( settings, options );
-
- return jQuery(this).each( function() {
- // console.debug( "Creating a new quicksearch on %o for %o", this, searchElems );
- new jQuery.quicksearch( this, searchElems, settings );
- });
-};
-
-
-jQuery.quicksearch = function( searchBox, searchElems, settings ) {
- var timeout;
- var boxdiv = $(searchBox).parents('div').eq(0);
-
- function init() {
- setupKeyEventHandlers();
- focusOnLoad();
- };
-
- function setupKeyEventHandlers() {
- // console.debug( "Hooking up the 'keypress' event to %o", searchBox );
- $(searchBox).
- unbind( 'keyup' ).
- keyup( function(e) { return onSearchKey( e.keyCode ); });
- $(searchBox).
- unbind( 'keypress' ).
- keypress( function(e) {
- switch( e.which ) {
- // Execute the search on Enter, Tab, or Newline
- case 9:
- case 13:
- case 10:
- clearTimeout( timeout );
- e.preventDefault();
- doQuickSearch();
- break;
-
- // Allow backspace
- case 8:
- return true;
- break;
-
- // Only allow valid search characters
- default:
- return validQSChar( e.charCode );
- }
- });
- };
-
- function focusOnLoad() {
- if ( !settings.focusOnLoad ) return false;
- $(searchBox).focus();
- };
-
- function onSearchKey ( code ) {
- clearTimeout( timeout );
- // console.debug( "...scheduling search." );
- timeout = setTimeout( doQuickSearch, settings.delay );
- };
-
- function validQSChar( code ) {
- var c = String.fromCharCode( code );
- return (
- (c == ':') ||
- (c >= 'a' && c <= 'z') ||
- (c >= 'A' && c <= 'Z')
- );
- };
-
- function doQuickSearch() {
- var searchText = searchBox.value;
- var pat = new RegExp( searchText, "im" );
- var shownCount = 0;
-
- if ( settings.noSearchResultsIndicator ) {
- $('#' + settings.noSearchResultsIndicator).hide();
- }
-
- // All elements start out hidden
- $(searchElems).each( function(index) {
- var str = $(this).text();
-
- if ( pat.test(str) ) {
- shownCount += 1;
- $(this).fadeIn();
- } else {
- $(this).hide();
- }
- });
-
- if ( shownCount == 0 && settings.noSearchResultsIndicator ) {
- $('#' + settings.noSearchResultsIndicator).slideDown();
- }
- };
-
- init();
-};
diff --git a/lib/rdoc/generator/template/darkfish/js/search.js b/lib/rdoc/generator/template/darkfish/js/search.js
new file mode 100644
index 0000000000..dbdfdcbc4c
--- /dev/null
+++ b/lib/rdoc/generator/template/darkfish/js/search.js
@@ -0,0 +1,94 @@
+Search = function(data, input, result) {
+ this.data = data;
+ this.$input = $(input);
+ this.$result = $(result);
+
+ this.$current = null;
+ this.$view = this.$result.parent();
+ this.searcher = new Searcher(data.index);
+ this.init();
+}
+
+Search.prototype = $.extend({}, Navigation, new function() {
+ var suid = 1;
+
+ this.init = function() {
+ var _this = this;
+ var observer = function() {
+ _this.search(_this.$input[0].value);
+ };
+ this.$input.keyup(observer);
+ this.$input.click(observer); // mac's clear field
+
+ this.searcher.ready(function(results, isLast) {
+ _this.addResults(results, isLast);
+ })
+
+ this.initNavigation();
+ this.setNavigationActive(false);
+ }
+
+ this.search = function(value, selectFirstMatch) {
+ value = jQuery.trim(value).toLowerCase();
+ if (value) {
+ this.setNavigationActive(true);
+ } else {
+ this.setNavigationActive(false);
+ }
+
+ if (value == '') {
+ this.lastQuery = value;
+ this.$result.empty();
+ this.setNavigationActive(false);
+ } else if (value != this.lastQuery) {
+ this.lastQuery = value;
+ this.firstRun = true;
+ this.searcher.find(value);
+ }
+ }
+
+ this.addResults = function(results, isLast) {
+ var target = this.$result.get(0);
+ if (this.firstRun && (results.length > 0 || isLast)) {
+ this.$current = null;
+ this.$result.empty();
+ }
+
+ for (var i=0, l = results.length; i < l; i++) {
+ target.appendChild(this.renderItem.call(this, results[i]));
+ };
+
+ if (this.firstRun && results.length > 0) {
+ this.firstRun = false;
+ this.$current = $(target.firstChild);
+ this.$current.addClass('current');
+ }
+ if (jQuery.browser.msie) this.$element[0].className += '';